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