Reorganize build process

This commit is contained in:
Disassembler 2018-10-25 22:05:48 +02:00
parent 3abd3cf835
commit f9218366fa
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
31 changed files with 2814 additions and 158 deletions

23
app-acme-sh/APKBUILD Normal file
View File

@ -0,0 +1,23 @@
# Contributor: Disassembler <disassembler@dasm.cz>
# Maintainer: Disassembler <disassembler@dasm.cz>
pkgname=acme-sh
pkgver=2.7.9
pkgrel=0
pkgdesc="A pure Unix shell script implementing ACME client protocol"
url="https://github.com/Neilpang/acme.sh"
arch="noarch"
license="GPL"
_commit=4f59a821d33281ff5a3090cbe8de47c5f0ae10ce
source="${pkgname}-${pkgver}.tar.gz::https://github.com/Neilpang/acme.sh/archive/${_commit}.tar.gz"
builddir="${srcdir}/acme.sh-${_commit}"
options="!check"
package() {
cd ${builddir}
sed -i 's|$HOME/.$PROJECT_NAME|/etc/acme.sh.d|' acme.sh
mkdir -p ${pkgdir}/usr/bin
cp acme.sh ${pkgdir}/usr/bin/
chmod +x ${pkgdir}/usr/bin/acme.sh
}
sha512sums="93d38007c0c8187217ac220b09180c3a367a9b518d0bb777a58900de134f1afde54e6643c42426e18f65a18de0d77b0c685396b9c33198b927f0ce2b5da778d1 acme-sh-2.7.9.tar.gz"

43
app-lxc/APKBUILD Normal file
View File

@ -0,0 +1,43 @@
# Contributor: Disassembler <disassembler@dasm.cz>
# Maintainer: Disassembler <disassembler@dasm.cz>
pkgname=lxc
pkgver=3.0.3
pkgrel=0
pkgdesc="Userspace interface for the Linux kernel containment features"
url="https://linuxcontainers.org/lxc/"
arch="x86_64"
license="GPL"
depends="gzip"
options="suid !check"
makedepends="automake autoconf bsd-compat-headers libcap-dev libseccomp-dev libtool linux-headers"
_commit=b8ab4849432cd64d789a757e385d1d324d88a61d
source="${pkgname}-${pkgver}.tar.gz::https://github.com/lxc/lxc/archive/${_commit}.tar.gz"
builddir="${srcdir}/${pkgname}-${_commit}"
build() {
cd ${builddir}
./autogen.sh
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-apparmor \
--with-distro=alpine \
--disable-werror
make
}
package() {
cd ${builddir}
make DESTDIR=${pkgdir} install
rm -rf ${pkgdir}/usr/include/
rm -rf ${pkgdir}/usr/lib/liblxc.a
rm -rf ${pkgdir}/usr/lib/liblxc.la
rm -rf ${pkgdir}/usr/lib/pkgconfig/
rm -rf ${pkgdir}/usr/share/doc/
rm -rf ${pkgdir}/usr/share/lxc/selinux/
rm -rf ${pkgdir}/usr/share/lxc/templates/
rm -rf ${pkgdir}/usr/share/man/
}
sha512sums="ef62f93799a14ba0e1b2fdbb4f69f8b531aef8eeecf537e2a08be3f30147484729bd41fa65e9ea5519c1c1f0e6f8940aac41ca5b749f89529a5b970e4ea0095c lxc-3.0.3.tar.gz"

View File

@ -15,4 +15,4 @@ RUN EOF
rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager
EOF
COPY lxc-tomcat
COPY lxc

View File

@ -1,89 +0,0 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))
# Install build and packaging scripts
ln -s ${SOURCE_DIR}/zz-extra/fix-apk /usr/bin/fix-apk
ln -s ${SOURCE_DIR}/zz-extra/lxc-build /usr/bin/lxc-build
ln -s ${SOURCE_DIR}/zz-extra/lxc-pack /usr/bin/lxc-pack
# Build basic Alpine LXC image
mkdir -p /var/lib/lxc/shared/alpine
wget https://github.com/gliderlabs/docker-alpine/raw/c14b86580b9f86f42296050ec7564faf6b6db9be/versions/library-3.8/x86_64/rootfs.tar.xz -O - | tar xJf - -C /var/lib/lxc/shared/alpine
chmod 755 /var/lib/lxc/shared/alpine
lxc-build ${SOURCE_DIR}/basic-runtimes/alpine.lxcfile
# Build shared overlays
lxc-build ${SOURCE_DIR}/basic-runtimes/java.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/libxml.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/php.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/python2.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/python3.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/nodejs.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/ruby.lxcfile
lxc-build ${SOURCE_DIR}/basic-runtimes/tomcat.lxcfile
# Build applications
lxc-build ${SOURCE_DIR}/activemq
lxc-build ${SOURCE_DIR}/ckan
lxc-build ${SOURCE_DIR}/ckan-datapusher
lxc-build ${SOURCE_DIR}/crisiscleanup
lxc-build ${SOURCE_DIR}/cts
lxc-build ${SOURCE_DIR}/frontlinesms
lxc-build ${SOURCE_DIR}/gnuhealth
lxc-build ${SOURCE_DIR}/kanboard
lxc-build ${SOURCE_DIR}/mariadb
lxc-build ${SOURCE_DIR}/mifosx
lxc-build ${SOURCE_DIR}/motech
lxc-build ${SOURCE_DIR}/opendatakit
lxc-build ${SOURCE_DIR}/opendatakit-build
lxc-build ${SOURCE_DIR}/openmapkit
lxc-build ${SOURCE_DIR}/pandora
lxc-build ${SOURCE_DIR}/postgres
lxc-build ${SOURCE_DIR}/rabbitmq
lxc-build ${SOURCE_DIR}/redis
lxc-build ${SOURCE_DIR}/sahana
lxc-build ${SOURCE_DIR}/sahana-demo
lxc-build ${SOURCE_DIR}/sambro
lxc-build ${SOURCE_DIR}/seeddms
lxc-build ${SOURCE_DIR}/sigmah
lxc-build ${SOURCE_DIR}/solr
lxc-build ${SOURCE_DIR}/ushahidi
# Create packages
lxc-pack ${SOURCE_DIR}/basic-runtimes/alpine.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/java.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/libxml.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/php.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/python2.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/python3.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/nodejs.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/ruby.pkg
lxc-pack ${SOURCE_DIR}/basic-runtimes/tomcat.pkg
lxc-pack ${SOURCE_DIR}/activemq
lxc-pack ${SOURCE_DIR}/ckan
lxc-pack ${SOURCE_DIR}/ckan-datapusher
lxc-pack ${SOURCE_DIR}/crisiscleanup
lxc-pack ${SOURCE_DIR}/cts
lxc-pack ${SOURCE_DIR}/frontlinesms
lxc-pack ${SOURCE_DIR}/gnuhealth
lxc-pack ${SOURCE_DIR}/kanboard
lxc-pack ${SOURCE_DIR}/mariadb
lxc-pack ${SOURCE_DIR}/mifosx
lxc-pack ${SOURCE_DIR}/motech
lxc-pack ${SOURCE_DIR}/opendatakit
lxc-pack ${SOURCE_DIR}/opendatakit-build
lxc-pack ${SOURCE_DIR}/openmapkit
lxc-pack ${SOURCE_DIR}/pandora
lxc-pack ${SOURCE_DIR}/postgres
lxc-pack ${SOURCE_DIR}/rabbitmq
lxc-pack ${SOURCE_DIR}/redis
lxc-pack ${SOURCE_DIR}/sahana
lxc-pack ${SOURCE_DIR}/sahana-demo
lxc-pack ${SOURCE_DIR}/sambro
lxc-pack ${SOURCE_DIR}/seeddms
lxc-pack ${SOURCE_DIR}/sigmah
lxc-pack ${SOURCE_DIR}/solr
lxc-pack ${SOURCE_DIR}/ushahidi

View File

@ -1,33 +0,0 @@
#!/bin/sh
set -e
SOURCE_DIR=$(realpath $(dirname "${0}"))
# Setup components
${SOURCE_DIR}/activemq/setup.sh
${SOURCE_DIR}/ckan-datapusher/setup.sh
${SOURCE_DIR}/mariadb/setup.sh
${SOURCE_DIR}/postgres/setup.sh
${SOURCE_DIR}/rabbitmq/setup.sh
${SOURCE_DIR}/redis/setup.sh
${SOURCE_DIR}/solr/setup.sh
# Setup applications
${SOURCE_DIR}/ckan/setup.sh
${SOURCE_DIR}/crisiscleanup/setup.sh
${SOURCE_DIR}/cts/setup.sh
${SOURCE_DIR}/frontlinesms/setup.sh
${SOURCE_DIR}/gnuhealth/setup.sh
${SOURCE_DIR}/kanboard/setup.sh
${SOURCE_DIR}/mifosx/setup.sh
${SOURCE_DIR}/motech/setup.sh
${SOURCE_DIR}/opendatakit/setup.sh
${SOURCE_DIR}/opendatakit-build/setup.sh
${SOURCE_DIR}/openmapkit/setup.sh
${SOURCE_DIR}/pandora/setup.sh
${SOURCE_DIR}/sahana/setup.sh
${SOURCE_DIR}/sahana-demo/setup.sh
${SOURCE_DIR}/sambro/setup.sh
${SOURCE_DIR}/seeddms/setup.sh
${SOURCE_DIR}/sigmah/setup.sh
${SOURCE_DIR}/ushahidi/setup.sh

103
zz-build/build-all.sh Executable file
View File

@ -0,0 +1,103 @@
#!/bin/sh
set -e
cd $(realpath $(dirname "${0}"))
# Install Alpine SDK
apk update
apk add alpine-sdk
# Copy build toolchain
adduser root abuild
cp etc/abuild.conf /etc/abuild.conf
cp usr/bin/abuild /usr/bin/abuild
cp usr/bin/fix-apk /usr/bin/fix-apk
cp usr/bin/lxc-build /usr/bin/lxc-build
mkdir /srv/build
# Supply /srv/build/repokey.rsa
# Build native apps
cd ../app-acme-sh
abuild -F
cd ../app-lxc
su -c 'abuild -Fr'
# Build basic Alpine LXC image
mkdir -p /var/lib/lxc/shared/alpine
wget https://github.com/gliderlabs/docker-alpine/raw/c14b86580b9f86f42296050ec7564faf6b6db9be/versions/library-3.8/x86_64/rootfs.tar.xz -O - | tar xJf - -C /var/lib/lxc/shared/alpine
chmod 755 /var/lib/lxc/shared/alpine
lxc-build ../basic-alpine
# Build shared overlays
lxc-build ../basic-java
lxc-build ../basic-libxml
lxc-build ../basic-php
lxc-build ../basic-python2
lxc-build ../basic-python3
lxc-build ../basic-nodejs
lxc-build ../basic-ruby
lxc-build ../basic-tomcat
# Build applications
lxc-build ../activemq
lxc-build ../ckan
lxc-build ../ckan-datapusher
lxc-build ../crisiscleanup
lxc-build ../cts
lxc-build ../frontlinesms
lxc-build ../gnuhealth
lxc-build ../kanboard
lxc-build ../mariadb
lxc-build ../mifosx
lxc-build ../motech
lxc-build ../opendatakit
lxc-build ../opendatakit-build
lxc-build ../openmapkit
lxc-build ../pandora
lxc-build ../postgres
lxc-build ../rabbitmq
lxc-build ../redis
lxc-build ../sahana
lxc-build ../sahana-demo
lxc-build ../sambro
lxc-build ../seeddms
lxc-build ../sigmah
lxc-build ../solr
lxc-build ../ushahidi
# Create packages
lxc-pack ../basic-alpine
lxc-pack ../basic-java
lxc-pack ../basic-libxml
lxc-pack ../basic-php
lxc-pack ../basic-python2
lxc-pack ../basic-python3
lxc-pack ../basic-nodejs
lxc-pack ../basic-ruby
lxc-pack ../basic-tomcat
lxc-pack ../activemq
lxc-pack ../ckan
lxc-pack ../ckan-datapusher
lxc-pack ../crisiscleanup
lxc-pack ../cts
lxc-pack ../frontlinesms
lxc-pack ../gnuhealth
lxc-pack ../kanboard
lxc-pack ../mariadb
lxc-pack ../mifosx
lxc-pack ../motech
lxc-pack ../opendatakit
lxc-pack ../opendatakit-build
lxc-pack ../openmapkit
lxc-pack ../pandora
lxc-pack ../postgres
lxc-pack ../rabbitmq
lxc-pack ../redis
lxc-pack ../sahana
lxc-pack ../sahana-demo
lxc-pack ../sambro
lxc-pack ../seeddms
lxc-pack ../sigmah
lxc-pack ../solr
lxc-pack ../ushahidi

29
zz-build/etc/abuild.conf Normal file
View File

@ -0,0 +1,29 @@
export CFLAGS="-Os -fomit-frame-pointer"
export CXXFLAGS="$CFLAGS"
export CPPFLAGS="$CFLAGS"
export LDFLAGS="-Wl,--as-needed"
export JOBS=2
export MAKEFLAGS=-j$JOBS
# remove line below to disable colors
USE_COLORS=1
SRCDEST=/var/cache/distfiles
# uncomment line below to store built packages in other location
# The package will be stored as $REPODEST/$repo/$pkgname-$pkgver-r$pkgrel.apk
# where $repo is the name of the parent directory of $startdir.
REPODEST=/srv/build/packages/
# PACKAGER and MAINTAINER are used by newapkbuild when creating new aports for
# the APKBUILD's "Contributor:" and "Maintainer:" comments, respectively.
#PACKAGER="Your Name <your@email.address>"
#MAINTAINER="$PACKAGER"
PACKAGER_PRIVKEY="/srv/build/repokey.rsa"
# what to clean up after a successful build
CLEANUP="srcdir bldroot pkgdir deps"
# what to cleanup after a failed build
ERROR_CLEANUP="bldroot deps"

2615
zz-build/usr/bin/abuild Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
#!/bin/sh
apk --no-cache add build-base gzip libcap-dev lvm2 util-linux automake autoconf libtool lua5.3-dev linux-headers bash tar docbook2x libseccomp-dev python3-dev dnsmasq py3-setuptools git xz
git clone --depth=1 https://github.com/lxc/lxc.git
cd lxc
./autogen.sh
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-apparmor \
--with-distro=alpine \
--disable-werror
make -j $(getconf _NPROCESSORS_ONLN)
mkdir /tmp/lxc
make DESTDIR=/tmp/lxc install
cd /tmp/lxc
rm -rf usr/include/
rm -rf usr/lib/liblxc.a
rm -rf usr/lib/liblxc.la
rm -rf usr/lib/pkgconfig/
rm -rf usr/share/doc/
rm -rf usr/share/lxc/selinux/
rm -rf usr/share/lxc/templates/
rm -rf usr/share/man/
find . | xargs -n 1 strip -s
tar cf - * | xz -9 -c - >../lxc.tar.xz