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