]> git.pld-linux.org Git - packages/boa.git/blob - boa.spec
- cleaning
[packages/boa.git] / boa.spec
1 #
2 # Conditional build:
3 # _without_ipv6 - IPv4-only version (doesn't require IPv6 in kernel)
4 #
5 Summary:        Boa high speed HTTP server
6 Summary(pl):    Boa - szybki serwer HTTP
7 Name:           boa
8 Version:        0.94.13
9 Release:        1
10 Epoch:          1
11 License:        GPL v2
12 Group:          Networking/Daemons
13 Source0:        http://www.boa.org/%{name}-%{version}.tar.gz
14 Source1:        %{name}.init
15 Patch0:         %{name}-PLD.patch
16 Patch1:         %{name}-logrotate.patch
17 URL:            http://www.boa.org/
18 BuildRequires:  autoconf
19 BuildRequires:  flex
20 BuildRequires:  sgml-tools
21 PreReq:         rc-scripts
22 Requires(pre):  /usr/bin/getgid
23 Requires(pre):  /bin/id
24 Requires(pre):  /usr/sbin/groupadd
25 Requires(pre):  /usr/sbin/useradd
26 Requires(postun):       /usr/sbin/groupdel
27 Requires(postun):       /usr/sbin/userdel
28 Requires(post,preun):   /sbin/chkconfig
29 Provides:       httpd
30 Provides:       webserver
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Obsoletes:      apache
33 Obsoletes:      httpd
34 Obsoletes:      thttpd
35 Obsoletes:      webserver
36
37 %define         _sysconfdir     /etc/httpd
38
39 %description
40 A high speed, lightweight web server (HTTP protocol). Based on direct
41 use of the select(2) system call, it internally multiplexes all
42 connections without forking, for maximum speed and minimum system
43 resource use.
44
45 %description -l pl
46 Niezwykle szybki i wysoko wydajny serwer WWW (protokó³ HTTP). Bazuje
47 na bezpo¶rednim u¿yciu funkcji systemowej select(2) dziêki czemu mo¿e
48 obs³ugiwaæ wiele po³±czeñ równocze¶nie bez fork()owania co w efekcie
49 znacznie zwiêksza szybko¶æ dzia³ania oraz zmniejsza zu¿ycie zasobów
50 systemowych.
51
52 %prep
53 %setup -q
54 %patch0 -p1
55 %patch1 -p0
56
57 %build
58 cd src
59 CFLAGS="%{rpmcflags} %{!?_without_ipv6:-DINET6}"
60 %{__autoconf}
61 %configure
62 %{__make}
63 cd ../docs
64 %{__make} boa.html
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/ \
69         $RPM_BUILD_ROOT/var/log/httpd \
70         $RPM_BUILD_ROOT/home/services/httpd/{cgi-bin,html} \
71         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/conf,%{_mandir}/man8} \
72         $RPM_BUILD_ROOT/etc/logrotate.d
73
74 install src/{boa,boa_indexer} $RPM_BUILD_ROOT%{_sbindir}/
75
76 install src/*.pl $RPM_BUILD_ROOT/home/services/httpd/cgi-bin/
77 install examples/* $RPM_BUILD_ROOT/home/services/httpd/cgi-bin/
78 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
79
80 install boa.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
81 install contrib/redhat/boa.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
82
83 install docs/boa.8 $RPM_BUILD_ROOT%{_mandir}/man8/
84
85 touch $RPM_BUILD_ROOT/var/log/httpd/{access_log,agent_log,error_log,referer_log}
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %pre
91 if [ -n "`getgid http`" ]; then
92         if [ "`getgid http`" != "51" ]; then
93                 echo "Error: group http doesn't have gid=51. Correct this before installing boa." 1>&2
94             exit 1
95         fi
96 else
97         echo "Creating group http GID=51"
98         /usr/sbin/groupadd -g 51 -r -f http
99 fi
100 if [ -n "`id -u http 2>/dev/null`" ]; then
101         if [ "`id -u http`" != "51" ]; then
102                 echo "Error: user http doesn't have uid=51. Correct this before installing boa." 1>&2
103                 exit 1
104         fi
105 else
106         echo "Creating user http UID=51"
107         /usr/sbin/useradd -u 51 -r -d /home/services/httpd -s /bin/false -c "HTTP User" -g http http 1>&2
108 fi
109
110 %postun
111 if [ "$1" = "0" ]; then
112         echo "Removing user http UID=51"
113         /usr/sbin/userdel http > /dev/null 2>&1
114         echo "Removing group http GID=51"
115         /usr/sbin/groupdel http > /dev/null 2>&1
116 fi
117
118 %post
119 /sbin/chkconfig --add boa
120 if [ -f /var/lock/subsys/boa ]; then
121         /etc/rc.d/init.d/boa restart 1>&2
122 else
123         echo "Run \"/etc/rc.d/init.d/boa start\" to start boa http daemon."
124 fi
125
126 %preun
127 if [ "$1" = "0" ]; then
128         if [ -f /var/lock/subsys/boa ]; then
129                 /etc/rc.d/init.d/boa stop 1>&2
130         fi
131         /sbin/chkconfig --del boa
132 fi
133
134 %files
135 %defattr(644,root,root,755)
136 %doc README ChangeLog docs/*.html docs/*.png
137 %attr(750,root,root) %dir %{_sysconfdir}
138 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/*
139 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/%{name}
140 %dir /home/services/httpd
141 %attr(755,root,root) /home/services/httpd/html
142 %attr(755,root,root) /home/services/httpd/cgi-bin
143 %attr(750,root,root) %dir /var/log/httpd/
144 %attr(640,root,root) %ghost /var/log/httpd/*
145 %attr(755,root,root) %{_sbindir}/*
146 %attr(754,root,root) /etc/rc.d/init.d/%{name}
147 %{_mandir}/man8/*
This page took 0.4832 seconds and 3 git commands to generate.