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