]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- added .sysconfig
[packages/lighttpd.git] / lighttpd.spec
1 #
2 # TODO
3 # - fix modules:
4 #  mod_localizer   : disabled (liblocalizer missing)
5 #  mod_maps        : disabled (liblocalizer missing)
6 #  mod_chat        : disabled, buy your license :)
7 #  mod_cache       : disabled, buy your license :)
8 # - test ldap and mysql (failed at this time)
9 # - documentroot specified in config doesn't exist
10 #
11 # Conditional build for lighttpd:
12 %bcond_without  xattr   # without support of extended attributes
13 %bcond_with     mysql   # with mysql
14 %bcond_with     ldap    # with ldap
15 #
16 Summary:        Fast and light HTTP server
17 Summary(pl):    Szybki i lekki serwer HTTP
18 Name:           lighttpd
19 Version:        1.3.7
20 Release:        0.6
21 Group:          Networking/Daemons
22 License:        BSD
23 ## do not remove next two lines because atomic revisions are common in lighttpd
24 #%define                _rel    20041102-1041
25 #Source0:       http://jan.kneschke.de/projects/lighttpd/download/%{name}-%{version}-%{_rel}.tar.gz
26 Source0:        http://jan.kneschke.de/projects/lighttpd/download/%{name}-%{version}.tar.gz
27 # Source0-md5:  40ac1d07d9efb0366720d081c3e02224
28 Source1:        %{name}.init
29 Source2:        %{name}.conf
30 Source3:        %{name}.user
31 Source4:        %{name}.logrotate
32 Source5:        %{name}.sysconfig
33 URL:            http://jan.kneschke.de/projects/lighttpd/
34 BuildRequires:  autoconf
35 BuildRequires:  automake
36 BuildRequires:  bzip2-devel
37 BuildRequires:  libtool
38 BuildRequires:  openssl-devel
39 BuildRequires:  pcre-devel
40 BuildRequires:  rpmbuild(macros) >= 1.159
41 BuildRequires:  zlib-devel
42 %if %{with xattr}
43 BuildRequires:  attr-devel
44 %endif
45 %{?with_ldap:BuildRequires:     openldap-devel}
46 %{?with_mysql:BuildRequires:    mysql-devel}
47 PreReq:         rc-scripts
48 Requires(pre):  sh-utils
49 Requires(pre):  /bin/id
50 Requires(pre):  /usr/bin/getgid
51 Requires(pre):  /usr/sbin/groupadd
52 Requires(pre):  /usr/sbin/useradd
53 Requires(post,preun):   /sbin/chkconfig
54 Requires(postun):       /usr/sbin/groupdel
55 Requires(postun):       /usr/sbin/userdel
56 Provides:       group(lighttpd)
57 Provides:       httpd
58 Provides:       user(lighttpd)
59 Provides:       webserver
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62 %define         _libdir         %{_prefix}/%{_lib}/%{name}
63 %define         _lighttpddir    /home/services/%{name}
64 %define         _sysconfdir     /etc/%{name}
65
66 %description
67 lighttpd is a secure, fast, compliant and very flexible web-server
68 which has been optimized for high-performance environments. It has
69 a very low memory footprint compared to other webservers and takes
70 care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
71 Output-Compression, URL-Rewriting and many more) make lighttpd the
72 perfect webserver-software for every server that is suffering load
73 problems.
74
75 %description -l pl
76 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
77 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
78 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci
79 w porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
80 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
81 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
82 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy
83 z powodu problemów z obci±¿eniem.
84
85 %package -n spawn-fcgi
86 Summary:        Spawn fcgi-process directly
87 Summary(pl):    Bezpo¶rednie uruchamianie procesów fcgi
88 Group:          Applications
89
90 %description -n spawn-fcgi
91 spawn-fcgi is used to spawn fcgi-process directly without the help of
92 a webserver or the programm itself.
93
94 %description -n spawn-fcgi -l pl
95 spawn-fcgi s³u¿y do uruchamiania procesów fcgi bezpo¶rednio, bez
96 pomocy serwera WWW ani samego programu.
97
98 %prep
99 %setup -q
100
101 %build
102 %{__libtoolize}
103 %{__aclocal}
104 %{__autoconf}
105 %configure \
106         --enable-mod-chat \
107         --enable-mod-cache \
108         --enable-mod-localizer \
109         %{?with_xattr:--with-attr} \
110         %{?with_mysql:--with-mysql} \
111         %{?with_ldap:--with-ldap} \
112         --with-openssl
113         
114 %{__make}
115
116 %install
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/cgi-bin,/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_sysconfdir}} \
119         $RPM_BUILD_ROOT/var/log/{%{name},archiv/%{name}}
120
121 %{__make} install \
122         DESTDIR=$RPM_BUILD_ROOT
123
124 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
125 install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
126 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
127 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
128
129 # could use automake patch, but automake generation fails...
130 mv $RPM_BUILD_ROOT%{_bindir}/spawn-fcgi $RPM_BUILD_ROOT%{_sbindir}/spawn-fcgi
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %pre
136 if [ -n "`/usr/bin/getgid lighttpd`" ]; then
137         if [ "`/usr/bin/getgid lighttpd`" != 109 ]; then
138                 echo "Error: group lighttpd doesn't have gid=109. Correct this before installing %{name}." 1>&2
139                 exit 1
140         fi
141 else
142         /usr/sbin/groupadd -g 109 lighttpd
143 fi
144 if [ -n "`/bin/id -u lighttpd 2>/dev/null`" ]; then
145         if [ "`/bin/id -u lighttpd`" != 116 ]; then
146                 echo "Error: user lighttpd doesn't have uid=116. Correct this before installing %{name}." 1>&2
147                 exit 1
148         fi
149 else
150         /usr/sbin/useradd -u 116 -d %{_lighttpddir} -s /bin/false \
151                 -c "HTTP User" -g lighttpd lighttpd 1>&2
152 fi
153
154 %post
155 /sbin/chkconfig --add %{name}
156 if [ -f /var/lock/subsys/%{name} ]; then
157         /etc/rc.d/init.d/%{name} restart 1>&2
158 else
159         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
160 fi
161
162 %preun
163 if [ "$1" = "0" ]; then
164         if [ -f /var/lock/subsys/%{name} ]; then
165                 /etc/rc.d/init.d/%{name} stop 1>&2
166         fi
167         /sbin/chkconfig --del %{name}
168 fi
169
170 %postun
171 if [ "$1" = "0" ]; then
172         %userremove lighttpd
173         %groupremove lighttpd
174 fi
175
176 %triggerpostun -- %{name} <= 1.3.6-2
177 # upgraded
178 if [ "$1" = "2" ]; then
179 %banner %{name} -e <<EOF
180 spawn-fcgi program is now available separately from spawn-fcgi package.
181
182 EOF
183 fi
184
185
186 %files
187 %defattr(644,root,root,755)
188 %doc NEWS README ChangeLog doc/lighttpd.conf doc/*.txt doc/rrdtool-graph.sh
189 %attr(755,root,root) %{_sbindir}/*
190 %dir %{_libdir}
191 %attr(755,root,root) %{_libdir}/*.so
192 %attr(750,root,root) %dir /var/log/archiv/%{name}
193 %dir %attr(750,lighttpd,root) /var/log/%{name}
194 %attr(755,lighttpd,lighttpd) %{_lighttpddir}
195 %attr(754,root,root) /etc/rc.d/init.d/%{name}
196 %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/*
197 %dir %attr(750,root,lighttpd) %{_sysconfdir}
198 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}.conf
199 %attr(640,root,lighttpd) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.user
200 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
201 %{_mandir}/man?/*
202
203 %files -n spawn-fcgi
204 %defattr(644,root,root,755)
205 %attr(755,root,root) %{_sbindir}/spawn-fcgi
This page took 0.047548 seconds and 4 git commands to generate.