]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd.spec
- reversed without-attr cond build, it was mistake, sorry, corrected conditional BR.
[packages/lighttpd.git] / lighttpd.spec
1 #
2 # Conditional build for freebsd:
3 %bcond_without  xattr   # without support of extended attributes
4 #
5 Summary:        Fast and light http server
6 Summary(pl):    Szybki i lekki serwer http
7 Name:           lighttpd
8 Version:        1.2.7
9 Release:        1
10 Group:          Networking/Daemons
11 License:        QPL
12 ## do not remove next two lines because atomic revisions are common in lighttpd
13 #%define                _rel    20080401-0000   
14 #Source0:       http://jan.kneschke.de/projects/lighttpd/download/%{name}-%{version}-%{_rel}.tar.gz
15 Source0:        http://jan.kneschke.de/projects/lighttpd/download/%{name}-%{version}.tar.gz
16 # Source0-md5:  0139b1ec4514089e9ca11dc3072529ab
17 Source1:        %{name}.init
18 Source2:        %{name}.conf
19 Source3:        %{name}.user
20 Source4:        %{name}.logrotate
21 Patch0:         http://jan.kneschke.de/projects/lighttpd/download/lighttpd-1.2.7-cond.patch
22 Patch1:         lighttpd-amd64-LINUX_SENDFILE-temporary.patch
23 URL:            http://jan.kneschke.de/projects/lighttpd/
24 BuildRequires:  autoconf
25 BuildRequires:  automake
26 BuildRequires:  bzip2-devel
27 BuildRequires:  libtool
28 BuildRequires:  openssl-devel
29 BuildRequires:  pcre-devel
30 BuildRequires:  zlib-devel
31 %if %{with xattr}
32 BuildRequires:  attr-devel
33 %endif
34 PreReq:         rc-scripts
35 Requires(pre):  sh-utils
36 Requires(pre):  /bin/id
37 Requires(pre):  /usr/bin/getgid
38 Requires(pre):  /usr/sbin/groupadd
39 Requires(pre):  /usr/sbin/useradd
40 Requires(post,preun):   /sbin/chkconfig
41 Requires(postun):       /usr/sbin/userdel
42 Requires(postun):       /usr/sbin/groupdel
43 Provides:       httpd
44 Provides:       webserver
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define         _libdir         %{_prefix}/%{_lib}/%{name}
48 %define         _lighttpddir    /home/services/%{name}
49 %define         _sysconfdir     /etc/%{name}
50
51 %description
52 lighttpd is a secure, fast, compliant and very flexible web-server
53 which has been optimized for high-performance environments. It has
54 a very low memory footprint compared to other webservers and takes
55 care of cpu-load. Its advanced feature-set (FastCGI, CGI, Auth,
56 Output-Compression, URL-Rewriting and many more) make lighttpd the
57 perfect webserver-software for every server that is suffering load
58 problems.
59
60 %description -l pl
61 lighttpd jest bezpiecznym, szybkim, przyjaznym i bardzo elastycznym
62 serwerem WWW, który zosta³ zoptymalizowany pod k±tem
63 wysokowydajno¶ciowych ¶rodowisk. Zajmuje bardzo ma³± ilo¶æ pamiêci
64 w porównaniu do innych serwerów WWW oraz dba o zajêto¶æ procesora.
65 Szeroki zestaw opcji (FastCGI, CGI, uwierzytelnianie, kompresja
66 wyj¶cia, przepisywanie URL-i i wiele innych) czyni± z lighttpd
67 doskona³e oprogramowanie web-serwerowe na ka¿dy serwer cierpi±cy
68 z powodu problemów z obci±¿eniem.
69
70 %prep
71 %setup -q
72 %patch0 -p1
73
74 %ifarch amd64
75 %patch1 
76 %endif
77
78 %build
79 %{__libtoolize}
80 %{__aclocal}
81 %{__autoconf}
82 %{__automake}
83 %configure \
84         --enable-mod-chat \
85         --enable-mod-cache \
86         --enable-mod-localizer \
87         %{?with_xattr:--with-attr} \
88         --with-openssl
89         
90 %{__make}
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94 install -d $RPM_BUILD_ROOT{%{_lighttpddir}/cgi-bin,/etc/{logrotate.d,rc.d/init.d},%{_sysconfdir}} \
95         $RPM_BUILD_ROOT/var/log/{%{name},archiv/%{name}}
96
97 %{__make} install \
98         DESTDIR=$RPM_BUILD_ROOT
99
100 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
101 install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
102 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
103
104 %clean
105 rm -rf $RPM_BUILD_ROOT
106
107 %pre
108 if [ -n "`getgid lighttpd`" ]; then
109         if [ "`getgid lighttpd`" != "109" ]; then
110                 echo "Error: group lighttpd doesn't have gid=109. Correct this before installing %{name}." 1>&2
111                 exit 1
112         fi
113 else
114         /usr/sbin/groupadd -g 109 -r -f lighttpd
115 fi
116 if [ -n "`id -u lighttpd 2>/dev/null`" ]; then
117         if [ "`id -u lighttpd`" != "116" ]; then
118                 echo "Error: user lighhttpd doesn't have uid=116. Correct this before installing %{name}." 1>&2
119                 exit 1
120         fi
121 else
122         /usr/sbin/useradd -u 116 -r -d %{_lighttpddir} -s /bin/false -c "HTTP User" -g lighttpd lighttpd 1>&2
123 fi
124
125 %post
126 /sbin/chkconfig --add %{name}
127 if [ -f /var/lock/subsys/%{name} ]; then
128         /etc/rc.d/init.d/%{name} restart 1>&2
129 else
130         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
131 fi
132
133 %preun
134 if [ "$1" = "0" ]; then
135         if [ -f /var/lock/subsys/%{name} ]; then
136                 /etc/rc.d/init.d/%{name} stop 1>&2
137         fi
138         /sbin/chkconfig --del %{name}
139 fi
140
141 %postun
142 if [ "$1" = "0" ]; then
143         /usr/sbin/userdel lighttpd
144         /usr/sbin/groupdel lighttpd
145 fi
146
147 %files
148 %defattr(644,root,root,755)
149 %doc NEWS README 
150 %attr(755,root,root) %{_sbindir}/*
151 %dir %{_libdir}
152 %attr(755,root,root) %{_libdir}/*.so
153 %attr(750,root,root) %dir /var/log/archiv/%{name}
154 %dir %attr(750,lighttpd,root) /var/log/%{name}
155 %attr(-, lighttpd, lighttpd) %{_lighttpddir}
156 %attr(754,root,root) /etc/rc.d/init.d/%{name}
157 %dir %attr(754,root,root) %{_sysconfdir}
158 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/*.*
159 %attr(640,root,root) /etc/logrotate.d/%{name}
160 %{_mandir}/man?/*
This page took 0.036086 seconds and 4 git commands to generate.