aboutsummaryrefslogtreecommitdiffstats
path: root/main/mini_httpd/APKBUILD
blob: d22ded9cec6ba8fba929df170b9c8286a8afb1ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mini_httpd
pkgver=1.19
pkgrel=8
pkgdesc="Small forking webserver with ssl and ipv6 support"
url="http://www.acme.com/software/mini_httpd/"
arch="all"
license="BSD"
depends="logrotate"
makedepends="openssl-dev"
subpackages="$pkgname-doc"
install="$pkgname.pre-install $pkgname.pre-upgrade"
source="http://www.acme.com/software/mini_httpd/$pkgname-$pkgver.tar.gz
	$pkgname.conf.sample
	$pkgname.initd
	$pkgname.logrotate
	"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd "$_builddir"
	sed -i s:getline:htgetline:g \
		htpasswd.c || return 1
}

build() {
	cd "$_builddir"
	make CFLAGS="${CFLAGS} -DUSE_SSL" \
		LDFLAGS="${LDFLAGS}" \
		SSL_LIBS="-lssl -lcrypto" \
		|| return 1
}

package() {
	cd "$_builddir"
	# does not respect DESTDIR
	make install \
		BINDIR="$pkgdir"/usr/sbin \
		MANDIR="$pkgdir"/usr/share/man

	# rename htpasswd to mini_htpasswd
	mv "$pkgdir"/usr/sbin/htpasswd "$pkgdir"/usr/sbin/mini_htpasswd
	mv "$pkgdir"/usr/share/man/man1/htpasswd.1 \
		"$pkgdir"/usr/share/man/man1/mini_htpasswd.1

	mkdir -p "$pkgdir"/var/www/localhost/htdocs
	install -D -m644 ../mini_httpd.conf.sample \
		"$pkgdir"/etc/mini_httpd/mini_httpd.conf
	install -D -m755 ../mini_httpd.initd "$pkgdir"/etc/init.d/mini_httpd
	install -D -m644 ../mini_httpd.logrotate \
		"$pkgdir"/etc/logrotate.d/mini_httpd
	install -d "$pkgdir"/var/run/mini_httpd "$pkgdir"/var/log/mini_httpd
}

md5sums="7c68293ad265ecfe2edea917912f6f1f  mini_httpd-1.19.tar.gz
2cd6630a7e19461b31a93504a8b6b24b  mini_httpd.conf.sample
f8e68c02d124007f21fb08cdc53c76a0  mini_httpd.initd
915683e9c7e1cef7ce9b1bbaa31ab680  mini_httpd.logrotate"