added lieferhund

This commit is contained in:
kitzman 2021-11-16 03:10:18 +02:00
parent 42861067dd
commit 4ff0313e93
Signed by: kitzman
GPG Key ID: 83289D84AA7C9A54
4 changed files with 141 additions and 1 deletions

View File

@ -41,4 +41,9 @@ The APKBUILD will be sent to the aports repo... one day™.
## Lieferhund + sinntp scripts
Coming soon ™.
My news processor. Currently can only read RSS and Atom. I scripted it to send
the news to an NNTP server (one line command with sinntp - and the news item
has the same structure as an email, so you can just use the interpolator).
**NOTE**: It has to compile GnuTLS - because the Alpine package does not provide
Guile bindings, which are a prerequisite for running Lieferhund.

View File

@ -0,0 +1,44 @@
# Contributor: kitzman <kitzman @ disroot . org>
# Maintainer: kitzman <kitzman @ disroot . org>
pkgname=sinntp
pkgver=1.6
pkgrel=0
pkgdesc="NNTP utilities"
provides=""
replaces=""
url="https://github.com/jwilk/sinntp"
arch="noarch"
license="GPLv2"
depends="python3"
checkdepends="python3-dev"
makedepends="gzip"
subpackages=""
source="https://github.com/jwilk/sinntp/releases/download/1.6/sinntp-1.6.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"
sha512sums="
44276960bda9ed532559af369eee3afa53a6b1638ec2089bffe229be4816d91cda98b8ae1d5f48d4774139e8776b52ae48cd6188d4d644a749ba70782dc94fe3 sinntp-1.6.tar.gz
"
package() {
sources="$srcdir/$pkgname-$pkgver"
mkdir -p "$pkgdir"/usr/bin
mkdir -p "$pkgdir"/usr/share/sinntp
mkdir -p "$pkgdir"/usr/share/man/man1
cp "$sources"/doc/manpages/* "$pkgdir"/usr/share/man/man1/.
find "$pkgdir"/usr/share/man/man1 -exec gzip {} \;
cp "$sources"/sinntp "$pkgdir"/usr/share/sinntp/.
cp "$sources"/plugins.py "$pkgdir"/usr/share/sinntp/.
cp "$sources"/utils.py "$pkgdir"/usr/share/sinntp/.
ln -s /usr/share/sinntp/sinntp "$pkgdir"/usr/bin/sinntp
cp "$sources"/nntp-push "$pkgdir"/usr/bin/.
cp "$sources"/nntp-pull "$pkgdir"/usr/bin/.
cp "$sources"/nntp-list "$pkgdir"/usr/bin/.
cp "$sources"/nntp-get "$pkgdir"/usr/bin/.
}

View File

@ -0,0 +1,83 @@
FROM alpine:3.14
RUN apk update
RUN apk upgrade
# APKBUILD env sinntp package
RUN apk add coreutils shadow sudo
RUN apk add ca-certificates ca-certificates-bundle
RUN update-ca-certificates
RUN apk add alpine-sdk
RUN apk add git build-base automake autoconf texinfo
RUN apk add guile guile-libs guile-dev
RUN useradd -m -G wheel,users,abuild abuild-user
RUN sed '$a%wheel ALL=(ALL) NOPASSWD: ALL' -i /etc/sudoers
USER abuild-user
# sinntp package
RUN mkdir -p /home/abuild-user/staging/sinntp
WORKDIR /home/abuild-user/staging/sinntp
COPY APKBUILD.sinntp APKBUILD
RUN abuild-keygen -a -i -n
RUN abuild -r
RUN sudo apk add --allow-untrusted /home/abuild-user/packages/staging/x86_64/sinntp*.apk
# gnutls package
RUN mkdir -p /home/abuild-user/staging/gnutls
WORKDIR /home/abuild-user/staging/gnutls
RUN curl -LO https://git.alpinelinux.org/aports/plain/main/gnutls/APKBUILD
RUN curl -LO https://git.alpinelinux.org/aports/plain/main/gnutls/tests-crq.patch
RUN curl -LO https://git.alpinelinux.org/aports/plain/main/gnutls/tests-certtool.patch
RUN sed 's|$pkgname-dbg||g' -i APKBUILD
RUN sed 's|disable-guile|enable-guile|g' -i APKBUILD
RUN sed 's|makedepends="|makedepends="texinfo guile guile-dev guile-libs |g' -i APKBUILD
RUN sed '10aoptions="!strip !check"' -i APKBUILD
RUN abuild -r
RUN sudo apk add --allow-untrusted /home/abuild-user/packages/staging/x86_64/gnutls*.apk
USER root
RUN sed 's|%wheel ALL=(ALL) NOPASSWD: ALL||g' -i /etc/sudoers
# Lieferhund itself
ENV LH_TAG af0aa6b
RUN git clone https://git.disroot.org/kitzman/lieferhund /tmp/lieferhund
WORKDIR /tmp/lieferhund
RUN git checkout $LH_TAG
RUN autoreconf -vfi
RUN ./configure
RUN make
RUN make check
RUN make install
WORKDIR /home/lieferhund
RUN rm -rf /tmp/lieferhund
RUN mkdir -p /usr/lib/news
RUN chown news:news /usr/lib/news
USER news
RUN cd $HOME
ENTRYPOINT ["lieferwelpe.scm", \
"-c", "/var/lib/lieferhund/config.scm", \
"-b", "/var/lib/lieferhund/db.scm", \
"-t", "1h"]

View File

@ -0,0 +1,8 @@
IMAGE="lieferhund:0.1"
MOUNT_ARGS="-v /var/lib/lieferhund:/var/lib/lieferhund"
NETWORK_ARGS=""
USER_ARGS=""
CUSTOM_ARGS=""