]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- use %useradd/%groupadd macros
[packages/lighttpd.git] / lighttpd.spec
1 #
2 # TODO
3 # - test ldap and mysql (failed at this time)
4 # - documentroot specified in config doesn't exist
5 # - mysql issue: http://www.freebsd.org/cgi/query-pr.cgi?pr=76866
6 #
7 # Conditional build for lighttpd:
8 %bcond_without  xattr           # without support of extended attributes
9 %bcond_without  ipv6            # IPv4-only version (doesn't require IPv6 in kernel)
10 # use it if you have 2.4 kernel to get sendfile() support,
11 # and don't need > 2GB file requests,
12 # see http://article.gmane.org/gmane.comp.web.lighttpd:722
13 %bcond_without  largefile       # without largefile support
14 %bcond_without  ssl             # disable ssl support
15 %bcond_with     mysql           # with mysql
16 %bcond_with     ldap            # with ldap
17 %bcond_with     valgrind        # compile code with valgrind support.
18 %bcond_with     dirhide         # with 'hide from dirlisting' hack
19 #
20 # Prerelease snapshot: DATE-TIME
21 ##define _snap 20050116-1743
22
23 %if 0%{?_snap}
24 %define _source http://www.lighttpd.net/download/%{name}-%{version}-%{_snap}.tar.gz
25 %else
26 %define _source http://www.lighttpd.net/download/%{name}-%{version}.tar.gz
27 %endif
28
29 %define         _rel 3.5
30
31 Summary:        Fast and light HTTP server
32 Summary(pl):    Szybki i lekki serwer HTTP
33 Name:           lighttpd
34 Version:        1.3.13
35 Release:        %{_rel}%{?_snap:.%(echo %{_snap}|tr - _)}
36 Group:          Networking/Daemons
37 License:        BSD
38 Source0:        %{_source}
39 # Source0-md5:  2f017b936be376ad6f6c2ee26db93467
40 Source1:        %{name}.init
41 Source2:        %{name}.conf
42 Source3:        %{name}.user
43 Source4:        %{name}.logrotate
44 Source5:        %{name}.sysconfig
45 Patch0:         http://minghetti.ch/blob/dirlist-hide.patch
46 Patch1:         %{name}-fcgi-verbose.patch
47 Patch2:         %{name}-proxy-error-handler.patch
48 Patch3:         %{name}-fcgi-retry-timeout.patch
49 Patch4:         http://glen.alkohol.ee/pld/lighttpd-request_header-print.patch
50 URL:            http://www.lighttpd.net/
51 BuildRequires:  autoconf
52 BuildRequires:  automake
53 BuildRequires:  bzip2-devel
54 BuildRequires:  libtool
55 %{?with_ssl:BuildRequires:      openssl-devel}
56 BuildRequires:  pcre-devel
57 BuildRequires:  rpmbuild(macros) >= 1.159
58 BuildRequires:  zlib-devel
59 %if %{with xattr}
60 BuildRequires:  attr-devel
61 %endif
62 %{?with_ldap:BuildRequires:     openldap-devel}
63 %{?with_mysql:BuildRequires:    mysql-devel}
64 %{?debug:BuildRequires: valgrind}
65 BuildRequires:  rpmbuild(macros) >= 1.202
66 PreReq:         rc-scripts
67 Requires(pre):  sh-utils
68 Requires(pre):  /bin/id
69 Requires(pre):  /usr/bin/getgid
70 Requires(pre):  /usr/sbin/groupadd
71 Requires(pre):  /usr/sbin/useradd
72 Requires(post,preun):   /sbin/chkconfig
73 Requires(postun):       /usr/sbin/groupdel
74 Requires(postun):       /usr/sbin/userdel
75 Provides:       group(lighttpd)
76 Provides:       httpd
77 Provides:       user(lighttpd)
78 Provides:       webserver
79 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80
81 %define         _libdir         %{_prefix}/%{_lib}/%{name}
82 %define         _lighttpddir    /home/services/%{name}
83 %define         _sysconfdir     /etc/%{name}
84
85 %description
86 lighttpd is a secure, fast, compliant and very flexible web-server
87 which has been optimized for high-performance environments. It has a
88 very low memory footprint compared to other webservers and takes care
89 of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
90 Output-Compression, URL-Rewriting and many more) make lighttpd the
91 perfect webserver-software for every server that is suffering load
92 problems.
93
94 %description -l pl
95 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
96 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
97 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci w
98 porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
99 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
100 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
101 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy z
102 powodu problemów z obci±¿eniem.
103
104 %package -n spawn-fcgi
105 Summary:        Spawn fcgi-process directly
106 Summary(pl):    Bezpo¶rednie uruchamianie procesów fcgi
107 Group:          Applications
108
109 %description -n spawn-fcgi
110 spawn-fcgi is used to spawn fcgi-process directly without the help of
111 a webserver or the programm itself.
112
113 %description -n spawn-fcgi -l pl
114 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
115 pomocy serwera WWW ani samego programu.
116
117 %prep
118 %setup -q
119 %{?with_dirhide:%patch0 -p0}
120 %patch1 -p1
121 %patch2 -p1
122 %patch3 -p1
123 %patch4 -p1
124
125 %build
126 %{__libtoolize}
127 %{__aclocal}
128 %{__autoconf}
129 %configure \
130         CFLAGS="%{rpmcflags} -DFCGI_RETRY_TIMEOUT=20" \
131         %{?with_valgrind:--with-valgrind} \
132         %{?with_xattr:--with-attr} \
133         %{?with_mysql:--with-mysql} \
134         %{?with_ldap:--with-ldap} \
135         %{!?with_ipv6:--disable-ipv6} \
136         %{!?with_largefile:--disable-lfs} \
137         %{?with_ssl:--with-openssl}
138
139 %{__make}
140
141 %install
142 rm -rf $RPM_BUILD_ROOT
143 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/{cgi-bin,html},/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_sysconfdir}} \
144         $RPM_BUILD_ROOT/var/log/{%{name},archiv/%{name}}
145
146 %{__make} install \
147         DESTDIR=$RPM_BUILD_ROOT
148
149 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
150 install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
151 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
152 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
153
154 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
155
156 # could use automake patch, but automake generation fails...
157 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
158
159 %clean
160 rm -rf $RPM_BUILD_ROOT
161
162 %pre
163 %groupadd -g 109 lighttpd
164 %useradd -u 116 -d %{_lighttpddir} -c "HTTP User" -g lighttpd lighttpd
165
166 %post
167 /sbin/chkconfig --add %{name}
168 if [ -f /var/lock/subsys/%{name} ]; then
169         /etc/rc.d/init.d/%{name} restart 1>&2
170 else
171         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
172 fi
173
174 %preun
175 if [ "$1" = "0" ]; then
176         if [ -f /var/lock/subsys/%{name} ]; then
177                 /etc/rc.d/init.d/%{name} stop 1>&2
178         fi
179         /sbin/chkconfig --del %{name}
180 fi
181
182 %postun
183 if [ "$1" = "0" ]; then
184         %userremove lighttpd
185         %groupremove lighttpd
186 fi
187
188 %triggerpostun -- %{name} <= 1.3.6-2
189 # upgraded
190 if [ "$1" = "2" ]; then
191 %banner %{name} -e <<EOF
192 spawn-fcgi program is now available separately from spawn-fcgi package.
193
194 EOF
195 fi
196
197 %files
198 %defattr(644,root,root,755)
199 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
200 %attr(755,root,root) %{_sbindir}/*
201 %dir %{_libdir}
202 %attr(755,root,root) %{_libdir}/*.so
203 %attr(750,root,root) %dir /var/log/archiv/%{name}
204 %dir %attr(750,lighttpd,root) /var/log/%{name}
205 %attr(755,lighttpd,lighttpd) %{_lighttpddir}
206 %attr(754,root,root) /etc/rc.d/init.d/%{name}
207 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
208 %dir %attr(750,root,lighttpd) %{_sysconfdir}
209 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
210 %attr(640,root,lighttpd) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.user
211 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
212 %{_mandir}/man?/*
213
214 %files -n spawn-fcgi
215 %defattr(644,root,root,755)
216 %doc doc/spawn-php.sh
217 %attr(755,root,root) %{_sbindir}/spawn-fcgi
This page took 0.059043 seconds and 4 git commands to generate.