~dricottone/huttese-apk

82ab309f2c2c94074666ba87db541734f87927c4 — Dominic Ricottone 2 years ago fcdbf82
New build process

Packages can now be built with `make`. The targets are all based on the
files that are served in the official mirror.

Re-added two dependencies of todo.sr.ht that I has missed.
7 files changed, 245 insertions(+), 0 deletions(-)

A .gitignore
A Dockerfile
A Makefile
A build.sh
A pkgsrc/py3-aiosmtpd/APKBUILD
A pkgsrc/py3-atpublic/APKBUILD
A repositories
A .gitignore => .gitignore +2 -0
@@ 0,0 1,2 @@
keys/
pkg/

A Dockerfile => Dockerfile +33 -0
@@ 0,0 1,33 @@
FROM alpine:3.15

# apk
COPY repositories /etc/apk/repositories
COPY keys/me@dominic-ricottone.com.rsa.pub /etc/apk/keys/me@dominic-ricottone.com.rsa.pub
RUN chmod 644 /etc/apk/keys/me@dominic-ricottone.com.rsa.pub
RUN apk update --update-cache && apk add abuild sudo

# builder
RUN adduser -D builder && addgroup builder abuild
RUN sh -c 'echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'

# abuild
RUN mkdir /home/builder/.abuild
COPY keys/me@dominic-ricottone.com.rsa /home/builder/.abuild/me@dominic-ricottone.com.rsa
RUN chmod 600 /home/builder/.abuild/me@dominic-ricottone.com.rsa
RUN sh -c 'echo "PACKAGER_PRIVKEY=\"/home/builder/.abuild/me@dominic-ricottone.com.rsa\"" >> /home/builder/.abuild/abuild.conf'
RUN chown builder /home/builder/.abuild/ -R

# pkg
RUN mkdir /home/builder/packages
VOLUME /home/builder/packages/huttese-pkgsrc/
RUN chown builder /home/builder/packages/ -R

# pkgsrcs
COPY --chown=builder:abuild pkgsrc /var/huttese-pkgsrc
COPY --chown=builder:abuild build.sh /var/huttese-pkgsrc/build.sh
WORKDIR /var/huttese-pkgsrc

USER builder
ENTRYPOINT ["/var/huttese-pkgsrc/build.sh"]
CMD ["py3-orderedmultidict"]


A Makefile => Makefile +136 -0
@@ 0,0 1,136 @@
image:
	podman build . --tag builder

keys:
	mkdir keys
	openssl genrsa -out keys/me@dominic-ricottone.com.rsa 2048
	openssl rsa -in keys/me@dominic-ricottone.com.rsa -pubout -out keys/me@dominic-ricottone.com.rsa.pub

BUILDS_SR_HT=pkg/aarch64/builds.sr.ht-0.82.8-r0.apk
$(BUILDS_SR_HT): pkgsrc/builds.sr.ht/APKBUILD $(PY3_ANSI2HTML) $(PY3_CELERY) $(PY3_PGPY) $(PY3_SRHT)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder builds.sr.ht

GIT_SR_HT=pkg/aarch64/git.sr.ht-78-22.0-r0.apk
$(GIT_SR_HT): pkgsrc/git.sr.ht/APKBUILD $(PY3_MINIO) $(PY3_SCMSRHT)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder git.sr.ht

META_SR_HT=pkg/aarch64/meta.sr.ht-0.59.0-r0.apk
$(META_SR_HT): pkgsrc/meta.sr.ht/APKBUILD $(PY3_PGPY) $(PY3_SSHPUBKEYS) $(PY3_SRHT) $(PY3_ZXCVBN)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder meta.sr.ht

PY3_AIOSMTPD=pkg/aarch64/py3-aiosmtpd-1.4.2-r0.apk
$(PY3_AIOSMTPD): pkgsrc/py3-aiosmtpd/APKBUILD $(PY3_ATPUBLIC)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-aiosmtpd

PY3_AMQP=pkg/aarch64/py3-amqp-5.1.0-r1.apk
$(PY3_AMQP): pkgsrc/py3-amqp/APKBUILD $(PY3_VINE)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-amqp

PY3_ANSI2HTML=pkg/aarch64/py3-ansi2html-1.7.0-r0.apk
$(PY3_ANSI2HTML): pkgsrc/py3-ansi2html/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-ansi2html

PY3_ANYJSON=pkg/aarch64/py3-anyjson-0.3.3-r0.apk
$(PY3_ANYJSON): pkgsrc/py3-anyjson/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-anyjson

PY3_ATPUBLIC=pkg/aarch64/py3-atpublic-2.3-r1.apk
$(PY3_ATPUBLIC): pkgsrc/py3-atpublic/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-atpublic

PY3_BILLIARD=pkg/aarch64/py3-billiard-3.6.4.0-r0.apk
$(PY3_BILLIARD): pkgsrc/py3-billiard/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-billiard

PY3_CASE=pkg/aarch64/py3-case-1.5.3-r0.apk
$(PY3_CASE): pkgsrc/py3-case/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-case

PY3_CELERY=pkg/aarch64/py3-celery-5.2.6-r0.apk
$(PY3_CELERY): pkgsrc/py3-celery/APKBUILD $(PY3_AMQP) $(PY3_BILLIARD) $(PY3_CLICK_DIDYOUMEAN) $(PY3_CLICK_REPL) $(PY3_KOMBU) $(PY3_VINE)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-celery

PY3_CLICK_DIDYOUMEAN=pkg/aarch64/py3-click-didyoumean-0.3.0-r0.apk
$(PY3_CLICK_DIDYOUMEAN): pkgsrc/py3-click-didyoumean/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-click-didyoumean

PY3_CLICK_REPL=pkg/aarch64/py3-click-repl-0.2.0-r0.apk
$(PY3_CLICK_REPL): pkgsrc/py3-click-repl/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-click-repl

PY3_COLOUR=pkg/aarch64/py3-colour-0.1.5-r3.apk
$(PY3_COLOUR): pkgsrc/py3-colour/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-colour

PY3_FURL=pkg/aarch64/py3-furl-2.1.2-r0.apk
$(PY3_FURL): pkgsrc/py3-furl/APKBUILD $(PY3_ORDEREDMULTIDICT)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-furl

PY3_HUMANIZE=pkg/aarch64/py3-humanize-4.0.0-r0.apk
$(PY3_HUMANIZE): pkgsrc/py3-humanize/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-humanize

PY3_INFINITY=pkg/aarch64/py3-infinity-1.5-r0.apk
$(PY3_INFINITY): pkgsrc/py3-infinity/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-infinity

PY3_INTERVALS=pkg/aarch64/py3-intervals-0.9.2-r0.apk
$(PY3_INTERVALS): pkgsrc/py3-intervals/APKBUILD $(PY3_INFINITY)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-intervals

PY3_KOMBU=pkg/aarch64/py3-kombu-5.2.4-r0.apk
$(PY3_KOMBU): pkgsrc/py3-kombu/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-kombu

PY3_MINIO=pkg/aarch64/py3-minio-7.1.3-r0.apk
$(PY3_MINIO): pkgsrc/py3-minio/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-minio

PY3_MISTLETOE=pkg/aarch64/py3-mistletoe-0.8.2-r0.apk
$(PY3_MISTLETOE): pkgsrc/py3-mistletoe/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-mistletoe

PY3_ORDEREDMULTIDICT=pkg/aarch64/py3-orderedmultidict-1.0.1-r0.apk
$(PY3_ORDEREDMULTIDICT): pkgsrc/py3-orderedmultidict/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-orderedmultidict

PY3_PGPY=pkg/aarch64/py3-pgpy-0.5.4-r0.apk
$(PY3_PGPY): pkgsrc/py3-pgpy/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-pgpy

PY3_PYGMENTS=pkg/aarch64/py3-pygments-2.11.2-r2.apk
$(PY3_PYGMENTS): pkgsrc/py3-pygments/APKBUILD $(PY3_WCAG_CONTRAST_RATIO)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-pygments

PY3_SCMSRHT=pkg/aarch64/py3-scmsrht-0.22.21-r0.apk
$(PY3_SCMSRHT): pkgsrc/py3-scmsrht/APKBUILD $(BUILDS_SR_HT) $(PY3_SRHT)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-scmsrht

PY3_SQLALCHEMY_UTILS=pkg/aarch64/py3-sqlalchemy-utils-0.38.2-r0.apk
$(PY3_SQLALCHEMY_UTILS): pkgsrc/py3-sqlalchemy-utils/APKBUILD $(PY3_ANYJSON) $(PY3_INTERVALS) $(PY3_COLOUR) $(PY3_FURL)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-sqlalchemy-utils

PY3_SSHPUBKEYS=pkg/aarch64/py3-sshpubkeys-3.3.1-r0.apk
$(PY3_SSHPUBKEYS): pkgsrc/py3-sshpubkeys/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-sshpubkeys

PY3_SRHT=pkg/aarch64/py3-srht-0.69.5-r0.apk
$(PY3_SRHT): $(PY3_CELERY) $(PY3_HUMANIZE) $(PY3_MISTLETOE) $(PY3_PGPY) $(PY3_PYGMENTS) $(PY3_SQLALCHEMY_UTILS)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-srht

PY3_VINE=pkg/aarch64/py3-vine-5.0.0-r0.apk
$(PY3_VINE): pkgsrc/py3-vine/APKBUILD $(PY3_CASE)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-vine

PY3_WCAG_CONTRAST_RATIO=pkg/aarch64/py3-wcag-contrast-ratio-0.9-r0.apk
$(PY3_WCAG_CONTRAST_RATIO): pkgsrc/py3-wcag-contrast-ratio/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-wcag-contrast-ratio

PY3_ZXCVBN=pkg/aarch64/py3-zxcvbn-4.4.28-r0.apk
$(PY3_ZXCVBN): pkgsrc/py3-zxcvbn/APKBUILD
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder py3-zxcvbn

TODO_SR_HT=pkg/aarch64/todo.sr.ht-0.72.8-r0.apk
$(TODO_SR_HT): pkgsrc/todo.sr.ht/APKBUILD $(PY3_AIOSMTPD) $(PY3_SRHT)
	podman run --rm --mount type=bind,src=/var/deploy/build/huttese-apk/pkg,target=/home/builder/packages/huttese-pkgsrc,Z builder todo.sr.ht


A build.sh => build.sh +7 -0
@@ 0,0 1,7 @@
#!/bin/sh
cd "/var/huttese-pkgsrc/$1" || exit 1
sudo apk update
. APKBUILD
abuild checksum || exit 1
abuild -r || exit 1


A pkgsrc/py3-aiosmtpd/APKBUILD => pkgsrc/py3-aiosmtpd/APKBUILD +32 -0
@@ 0,0 1,32 @@
# Contributor: Drew DeVault <sir@cmpwn.com>
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-aiosmtpd
_pyname=aiosmtpd
pkgver=1.4.2
pkgrel=1
pkgdesc="A reimplementation of the Python stdlib smtpd.py based on asyncio"
url="https://github.com/aio-libs/aiosmtpd"
arch="noarch"
license="Apache-2.0"
depends="py3-atpublic"
makedepends="python3-dev py3-setuptools"
checkdepends="py3-pytest py3-pytest-mock py3-pluggy"
_pypiprefix="${_pyname%${_pyname#?}}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
replaces="py-aiosmtpd"
builddir="$srcdir"/$_pyname-$pkgver
options="!check" # https://gitlab.alpinelinux.org/alpine/aports/-/issues/12503

build() {
	python3 setup.py build
}

check() {
	pytest-3
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="b910ae4c00b52f59b9f2199b296a1b76caa7567cbcd2e27c73d4ec894e9b48cd8190090083ce33b87dc924c4394a6425506355951208af65b89a6c1abe371114  aiosmtpd-1.4.2.tar.gz"

A pkgsrc/py3-atpublic/APKBUILD => pkgsrc/py3-atpublic/APKBUILD +32 -0
@@ 0,0 1,32 @@
# Contributor: Drew DeVault <sir@cmpwn.com>
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-atpublic
_pyname=atpublic
pkgver=2.3
pkgrel=2
pkgdesc="@public for populating __all__"
url="https://gitlab.com/warsaw/public"
arch="noarch"
license="Apache-2.0"
makedepends="python3-dev py3-setuptools py3-pytest"
checkdepends="py3-sybil py3-pytest-cov"
_pypiprefix="${_pyname%${_pyname#?}}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
replaces="py-atpublic"
builddir="$srcdir"/$_pyname-$pkgver

build() {
	python3 setup.py build
}

check() {
	pytest-3
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
88c140c7ca0cfe3db791fd43a97f9fc63de979191a026df4d9f7a34a347b657d7d7b6fb7e31a231ac3adbc5e5d014b8e3c3606b93515a6ad42ea3d101b480329  atpublic-2.3.tar.gz
"

A repositories => repositories +3 -0
@@ 0,0 1,3 @@
/home/builder/packages/huttese-pkgsrc
https://dl-cdn.alpinelinux.org/alpine/v3.15/main
https://dl-cdn.alpinelinux.org/alpine/v3.15/community