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