From 5ffcec2e52679d5d6621371bd202d4f4a36f186c Mon Sep 17 00:00:00 2001 From: tmpfile Date: Sat, 13 May 2017 10:45:42 -0300 Subject: community/thttpd: modernize abuild --- community/thttpd/APKBUILD | 113 ++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 69 deletions(-) (limited to 'community/thttpd') diff --git a/community/thttpd/APKBUILD b/community/thttpd/APKBUILD index f2d91e3ce2..fec4ddb691 100644 --- a/community/thttpd/APKBUILD +++ b/community/thttpd/APKBUILD @@ -2,99 +2,74 @@ # Maintainer: Francesco Colista pkgname=thttpd pkgver=2.27 -pkgrel=1 -pkgdesc="Simple, small, portable, fast, adn secure HTTP server" +pkgrel=2 +pkgdesc="Simple, small, portable, fast, and secure HTTP server" url="http://www.acme.com/software/thttpd" arch="all" license="custom:BSD" -depends="" -depends_dev="" -makedepends="$depends_dev" install="$pkgname.pre-install $pkgname.post-install" subpackages="$pkgname-doc" source="http://www.acme.com/software/$pkgname/$pkgname-$pkgver.tar.gz - thttpd.initd - thttpd.confd - thttpd.conf - thttpd.logrotated + thttpd.initd + thttpd.confd + thttpd.conf + thttpd.logrotated thttpd-webgroup.patch - forwarded-for.patch + forwarded-for.patch thttpd-makeweb-notsuid.patch - " + " -_builddir=$srcdir/$pkgname-$pkgver +builddir="$srcdir/$pkgname-$pkgver" prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done - echo 'mkv video/x-matroska' >> mime_types.txt + default_prepare + cd "$builddir" + echo 'mkv video/x-matroska' >> mime_types.txt } build() { - cd "$_builddir" + cd "$builddir" - ./configure --prefix=/usr --mandir=/usr/share/man - sed -e 's/^CFLAGS =/CFLAGS +=/' \ - -e '/^STATICFLAG =/c STATICFLAG =' \ - -i Makefile */Makefile || return 1 - - make || return 1 + ./configure --prefix=/usr --mandir=/usr/share/man + sed -e 's/^CFLAGS =/CFLAGS +=/' \ + -e '/^STATICFLAG =/c STATICFLAG =' \ + -i Makefile */Makefile + make } package() { - cd "$_builddir" - - mkdir -p $pkgdir/usr/share/man/man1 + cd "$builddir" + + mkdir -p $pkgdir/usr/share/man/man1 - make \ - BINDIR="$pkgdir"/usr/sbin \ - WEBDIR="$pkgdir"/var/www/http \ - MANDIR="$pkgdir"/usr/share/man \ - WEBGROUP=www-data install || return 1 + make \ + BINDIR="$pkgdir"/usr/sbin \ + WEBDIR="$pkgdir"/var/www/http \ + MANDIR="$pkgdir"/usr/share/man \ + WEBGROUP=www-data install - rm -rf "$pkgdir"/var/www/http/* + rm -rf "$pkgdir"/var/www/http/* - install -m755 -D "$srcdir"/$pkgname.initd \ - "$pkgdir"/etc/init.d/$pkgname || return 1 - install -m644 -D "$srcdir"/$pkgname.confd \ - "$pkgdir"/etc/conf.d/$pkgname || return 1 - install -m644 -D "$srcdir"/$pkgname.conf \ - "$pkgdir"/etc/thttpd.conf || return 1 - install -m644 -D "$srcdir"/$pkgname.logrotated \ - "$pkgdir"/etc/logrotate.d/thttpd || return 1 + install -m755 -D "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.conf \ + "$pkgdir"/etc/thttpd.conf + install -m644 -D "$srcdir"/$pkgname.logrotated \ + "$pkgdir"/etc/logrotate.d/thttpd - install -d "$pkgdir"/var/log/thttpd - install -d "$pkgdir"/usr/share/licenses/"$pkgname" - head -n 26 thttpd.c > \ - "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE || return 1 - mkdir -p "$pkgdir/usr/share/doc/$pkgname" - cat > $pkgdir/usr/share/doc/$pkgname/README.alpine < \ + "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE + mkdir -p "$pkgdir/usr/share/doc/$pkgname" + cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <