summaryrefslogtreecommitdiffstats
path: root/main/lighttpd/APKBUILD
blob: b4a4d5ac8d3bc5191edd5b02578361da84ec24a3 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lighttpd
pkgver=1.4.30
_streamver=2.2.0
pkgrel=0
pkgdesc="a secure, fast, compliant and very flexible web-server"
url="http://www.lighttpd.net/"
arch="all"
license="custom"
install="$pkgname.pre-install $pkgname.post-install"
depends=
makedepends="flex pcre-dev openssl-dev zlib-dev bzip2-dev lua-dev pkgconfig
	automake autoconf openldap-dev libxml2-dev sqlite-dev libev-dev"
source="http://download.lighttpd.net/lighttpd/releases-1.4.x/$pkgname-$pkgver.tar.bz2
	http://h264.code-shop.com/download/lighttpd-1.4.18_mod_h264_streaming-$_streamver.tar.gz
	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotate
	spawn-fcgi.confd
	spawn-fcgi.initd
	lighttpd.conf
	mime-types.conf
	mod_cgi.conf
	mod_fastcgi.conf
	mod_fastcgi_fpm.conf
	"
subpackages="$pkgname-doc $pkgname-mod_auth $pkgname-mod_h264_streaming
	$pkgname-mod_webdav"

prepare() {
	cd "$srcdir"/$pkgname-$pkgver

	# copy over the mod-h264-streaming mod
	# http://h264.code-shop.com/trac/wiki/Mod-H264-Streaming-Lighttpd-Version2#DownloadLighttpd1.4.191.4.20andother1.4.x
	cp "$srcdir"/lighttpd-1.4.18/src/moov.* src/
	cp "$srcdir"/lighttpd-1.4.18/src/mod_h264_streaming.c src/

	cat >> src/Makefile.am <<__EOF__

lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c moov.c
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = \$(common_libadd)
__EOF__
	aclocal -I m4 && autoconf && automake
}

build() { 
	local i
	cd "$srcdir"/$pkgname-$pkgver
	./configure --prefix=/usr \
		--disable-dependency-tracking \
		--enable-lfs \
		--libdir=/usr/lib/lighttpd \
		--without-mysql \
		--without-attr \
		--without-kerberos5 \
		--without-fam \
		--with-webdav-props \
		--with-webdav-locks \
		--without-gdbm \
		--without-memcache \
		--with-bzip2 \
		--with-ldap \
		--with-openssl \
		--with-libev \
		--with-lua || return 1

	make
}

package() {
	cd "$srcdir"/$pkgname-$pkgver
	make DESTDIR="$pkgdir" install || return 1
	rm "$pkgdir"/usr/lib/lighttpd/*.la || return 1

	# create dirs
	install -d -m755 "$pkgdir"/var/run/lighttpd/ \
		"$pkgdir"/var/log/lighttpd/ \
		"$pkgdir"/etc/lighttpd/ \
		"$pkgdir"/var/www/localhost/htdocs

	# lighttpd
	install -D -m755 "$srcdir"/lighttpd.initd "$pkgdir"/etc/init.d/lighttpd
	install -D -m644 "$srcdir"/lighttpd.confd "$pkgdir"/etc/conf.d/lighttpd
	install -D -m644 "$srcdir"/lighttpd.logrotate \
		"$pkgdir"/etc/logrotate.d/lighttpd
	
	# spawn-fcgi
	install -D -m755 "$srcdir"/spawn-fcgi.initd \
		"$pkgdir"/etc/init.d/spawn-fcgi
	install -D -m644 "$srcdir"/spawn-fcgi.confd \
		"$pkgdir"/etc/conf.d/spawn-fcgi

	# config files
	for i in lighttpd.conf mime-types.conf mod_cgi.conf mod_fastcgi.conf mod_fastcgi_fpm.conf; do
		install -m644 "$srcdir"/$i "$pkgdir"/etc/lighttpd/$i
	done
}

_mv_mod() {
	mkdir -p "$subpkgdir"/usr/lib/lighttpd
	while [ $# -gt 0 ]; do
		mv "$pkgdir"/usr/lib/lighttpd/$1.so \
			"$subpkgdir"/usr/lib/lighttpd/ || return 1
		shift
	done
}

mod_h264_streaming() {
	pkgdesc="H264 Streaming Module for lighttpd"
	url="http://h264.code-shop.com/trac"
	license="CCPL-nc-sa-3.0"
	replaces="lighttpd-h264_streaming"
	_mv_mod mod_h264_streaming
}

mod_auth() {
	pkgdesc="Authentication module for lighttpd"
	_mv_mod mod_auth
}

mod_webdav() {
	pkgdesc="WebDAV module for lighttpd"
	_mv_mod mod_webdav
}


md5sums="63f9df52dcae0ab5689a95c99c54e48a  lighttpd-1.4.30.tar.bz2
ac37885c881a058194405232e7737a7a  lighttpd-1.4.18_mod_h264_streaming-2.2.0.tar.gz
e37770e4eed20390806a2420a3970fcd  lighttpd.initd
0dede109282bfe685bdec6b35f0e4b6b  lighttpd.confd
ad091c9157134890499f26d170352c9f  lighttpd.logrotate
1d925aed297ec4541fb230dd19e11bc1  spawn-fcgi.confd
2f177ba0a35fd1c683edef3453c20bc8  spawn-fcgi.initd
268bf5dd2c370ee5e119246775ac5640  lighttpd.conf
fef397e7bcf1b741dea211a555e1803c  mime-types.conf
9c1407e95f62ed22da66c4ef5f69c3b5  mod_cgi.conf
f3363e39832f1b6678468b482d121afb  mod_fastcgi.conf
aee5947a1abf380b0685a534ca384b42  mod_fastcgi_fpm.conf"