]> git.pld-linux.org Git - packages/boa.git/blob - boa.spec
- updated to 0.94.14rc21 (cleanup release)
[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     rc21
10 Release:        0.%{_rc}.1
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:  e24b570bd767a124fcfb40a34d148ba9
16 Source1:        %{name}.init
17 Patch0:         %{name}-PLD.patch
18 URL:            http://www.boa.org/
19 BuildRequires:  autoconf >= 2.59
20 BuildRequires:  automake
21 BuildRequires:  flex
22 BuildRequires:  rpmbuild(macros) >= 1.159
23 BuildRequires:  sed >= 4.0
24 BuildRequires:  texinfo
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:       user(http)
35 Provides:       webserver
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 A high speed, lightweight web server (HTTP protocol). Based on direct
40 use of the select(2) system call, it internally multiplexes all
41 connections without forking, for maximum speed and minimum system
42 resource use.
43
44 %description -l pl
45 Niezwykle szybki i wysoko wydajny serwer WWW (protokó³ HTTP). Bazuje
46 na bezpo¶rednim u¿yciu funkcji systemowej select(2) dziêki czemu mo¿e
47 obs³ugiwaæ wiele po³±czeñ równocze¶nie bez fork()owania co w efekcie
48 znacznie zwiêksza szybko¶æ dzia³ania oraz zmniejsza zu¿ycie zasobów
49 systemowych.
50
51 %prep
52 %setup -q -n %{name}-%{version}%{_rc}
53 cp examples/boa.conf .
54 %patch0 -p0
55
56 %build
57 cp -f /usr/share/automake/config.sub .
58 %{__sed} -i 's,},  olddir /var/log/archiv/boa\x0a},' contrib/rpm/boa.logrotate
59 CFLAGS="%{rpmcflags} %{?with_ipv6:-DINET6} -DSERVER_ROOT='\"%{_sysconfdir}\"'"
60 %{__autoconf}
61 %configure
62 %{__make}
63 %{__make} -C docs boa.html
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/ \
68         $RPM_BUILD_ROOT/var/log/{,archiv/}boa \
69         $RPM_BUILD_ROOT%{_sbindir} \
70         $RPM_BUILD_ROOT%{_mandir}/man8 \
71         $RPM_BUILD_ROOT/etc/logrotate.d \
72         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
73
74 install src/{boa,boa_indexer} $RPM_BUILD_ROOT%{_sbindir}/
75
76 install examples/*.pl examples/*.cgi \
77         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
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/rpm/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/boa/{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 /usr/share/empty -s /bin/false -c "HTTP User" -g http http 1>&2
108 fi
109
110 %postun
111 if [ "$1" = "0" ]; then
112         %userremove http
113         %groupremove http
114 fi
115
116 %post
117 /sbin/chkconfig --add boa
118 if [ -f /var/lock/subsys/boa ]; then
119         /etc/rc.d/init.d/boa restart 1>&2
120 else
121         echo "Run \"/etc/rc.d/init.d/boa start\" to start boa HTTP daemon."
122 fi
123
124 %preun
125 if [ "$1" = "0" ]; then
126         if [ -f /var/lock/subsys/boa ]; then
127                 /etc/rc.d/init.d/boa stop 1>&2
128         fi
129         /sbin/chkconfig --del boa
130 fi
131
132 %triggerpostun -- boa < 0.94.14-0.rc20.0
133 if [ -f /etc/httpd/boa.conf.rpmsave ]; then
134         echo "warning: installing /etc/boa.conf as /etc/boa.conf.rpmnew"
135         mv /etc/boa.conf /etc/boa.conf.rpmnew
136         echo "warning: moving /etc/httpd/boa.conf.rpmsave to /etc/boa.conf"
137         mv /etc/httpd/boa.conf.rpmsave /etc/boa.conf
138 fi
139
140 %files
141 %defattr(644,root,root,755)
142 %doc CHANGES README docs/*.html docs/*.png
143 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/boa.conf
144 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
145 %attr(750,root,root) %dir /var/log/%{name}/
146 %attr(750,root,root) %dir /var/log/archiv/%{name}/
147 %attr(640,root,root) %ghost /var/log/%{name}/*
148 %attr(755,root,root) %{_sbindir}/*
149 %attr(754,root,root) /etc/rc.d/init.d/%{name}
150 %{_mandir}/man8/*
151 %{_examplesdir}/%{name}-%{version}
This page took 0.824059 seconds and 4 git commands to generate.