aboutsummaryrefslogtreecommitdiffstats
path: root/testing/yaws/APKBUILD
blob: 8e92ba33f667d8c120d8fe6d89574a98f5e53d66 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Contributor: Vitaliy Tokarev <vitaliy.tokarev@gmail.com>
# Maintainer:
pkgname=yaws
pkgver=1.97
pkgrel=0
pkgdesc="Yet Another Web Server, pure Erlang HTTP server/framework"
url="http://yaws.hyber.org/"
arch="all"
license="BSD"
depends="erlang linux-pam"
depends_dev="linux-pam-dev erlang-dev"
makedepends="$depends_dev perl"
options="!emptydirs"
install=""
subpackages="$pkgname-doc $pkgname-web"
source="http://yaws.hyber.org/download/$pkgname-$pkgver.tar.gz
	yaws.initd
	yaws.conf.alpine"

_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
}

build() {
	cd "$_builddir"
	export ERLCFLAGS="-W"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	# XXX: from arch linux
	install -d "$pkgdir/usr/lib/erlang/lib"
	ln -s /usr/lib/yaws "$pkgdir/usr/lib/erlang/lib/$pkgname-$pkgver" \
		|| return 1

	# init.d
	install -Dm755 "$srcdir/yaws.initd" "$pkgdir/etc/init.d/yaws" \
		|| return 1

	# License
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" \
		|| return 1

	# update config
	# * basically change log dir to /var/log/yaws
	# * on of <server localhost> definitions commented, because conflict
	install -Dm644 "$srcdir"/yaws.conf.alpine "$pkgdir/etc/yaws/yaws.conf" \
		|| return 1

	install -d "$pkgdir"/var/log/yaws
}

web() {
	arch="noarch"
	depends="yaws"
	pkgdesc="Yet Another Web Server, pure Erlang HTTP server/framework (examples)"

	mkdir -p "$subpkgdir"/var
	mv "$pkgdir"/var/yaws "$subpkgdir"/var/

	# cleanup unnecessary Makefiles
	find "$subpkgdir"/var/yaws/www -type f -name 'Makefile' \
		-exec rm -f {} \;
}

md5sums="7a835c3b80b1158b54695591ed2d0864  yaws-1.97.tar.gz
3a1445696bd25ae71631d13457980693  yaws.initd
2b71d01e0837aff6798e602c74ae6a2c  yaws.conf.alpine"
sha256sums="a792478564866393f3e901bf4ec33272c22d7c01a8c5493b33856729d25b026e  yaws-1.97.tar.gz
313ce8cacd25e8eed5717dfd9e79d1683a4038a64cffff6e93aacfd2fb11c261  yaws.initd
ebff598ac47a0185a81ca5fb45b1c843b184390d85c630686aa2579b6d51e3af  yaws.conf.alpine"
sha512sums="b91fa598ea91a190e341dda35f7bc0ee468454fd5eb6bf7cbae722c59816e6b6da81a08aea5f2f6fa49fafaeccd42c85025ed21be9f208c4e2b73b624586db12  yaws-1.97.tar.gz
07ff290eb98be729445d797361503d01dfba29f050639632d251202267aa485655fd04798f4de8d66a83bb0a798280116f8b06d5b9e8810d3cb2d20c1c1bd1d6  yaws.initd
7f4bf1a099337cf53a2492cc2e295108adcb9ab26b27089303429542c5097ed357623f6d448c5b0b9c9e4d0e8517350ab9d8bf1b6d51a529c45b264f810c688d  yaws.conf.alpine"