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