]> git.pld-linux.org Git - packages/boa.git/blob - boa.spec
- refresh config.sub
[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}.2
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:  flex
22 BuildRequires:  sgml-tools
23 PreReq:         rc-scripts
24 Requires(pre):  /usr/bin/getgid
25 Requires(pre):  /bin/id
26 Requires(pre):  /usr/sbin/groupadd
27 Requires(pre):  /usr/sbin/useradd
28 Requires(postun):       /usr/sbin/groupdel
29 Requires(postun):       /usr/sbin/userdel
30 Requires(post,preun):   /sbin/chkconfig
31 Provides:       httpd
32 Provides:       webserver
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Obsoletes:      apache
35 Obsoletes:      httpd
36 Obsoletes:      thttpd
37 Obsoletes:      webserver
38
39 %define         _sysconfdir     /etc/httpd
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 %patch1 -p0
59
60 %build
61 cp -f /usr/share/automake/config.sub .
62 CFLAGS="%{rpmcflags} %{?with_ipv6:-DINET6} -DSERVER_ROOT='\"/etc/httpd\"'"
63 %{__autoconf}
64 %configure
65 %{__make}
66 %{__make} -C docs boa.html
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/ \
71         $RPM_BUILD_ROOT/var/log/httpd \
72         $RPM_BUILD_ROOT/srv/httpd/{cgi-bin,html} \
73         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/conf,%{_mandir}/man8} \
74         $RPM_BUILD_ROOT/etc/logrotate.d
75
76 install src/{boa,boa_indexer} $RPM_BUILD_ROOT%{_sbindir}/
77
78 install src/*.pl $RPM_BUILD_ROOT/srv/httpd/cgi-bin/
79 install examples/* $RPM_BUILD_ROOT/srv/httpd/cgi-bin/
80 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
81
82 install boa.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
83 install contrib/redhat/boa.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
84
85 install docs/boa.8 $RPM_BUILD_ROOT%{_mandir}/man8/
86
87 touch $RPM_BUILD_ROOT/var/log/httpd/{access_log,agent_log,error_log,referer_log}
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92 %pre
93 if [ -n "`getgid http`" ]; then
94         if [ "`getgid http`" != "51" ]; then
95                 echo "Error: group http doesn't have gid=51. Correct this before installing boa." 1>&2
96                 exit 1
97         fi
98 else
99         echo "Creating group http GID=51"
100         /usr/sbin/groupadd -g 51 -r -f http
101 fi
102 if [ -n "`id -u http 2>/dev/null`" ]; then
103         if [ "`id -u http`" != "51" ]; then
104                 echo "Error: user http doesn't have uid=51. Correct this before installing boa." 1>&2
105                 exit 1
106         fi
107 else
108         echo "Creating user http UID=51"
109         /usr/sbin/useradd -u 51 -r -d /srv/httpd -s /bin/false -c "HTTP User" -g http http 1>&2
110 fi
111
112 %postun
113 if [ "$1" = "0" ]; then
114         echo "Removing user http UID=51"
115         /usr/sbin/userdel http > /dev/null 2>&1
116         echo "Removing group http GID=51"
117         /usr/sbin/groupdel http > /dev/null 2>&1
118 fi
119
120 %post
121 /sbin/chkconfig --add boa
122 if [ -f /var/lock/subsys/boa ]; then
123         /etc/rc.d/init.d/boa restart 1>&2
124 else
125         echo "Run \"/etc/rc.d/init.d/boa start\" to start boa http daemon."
126 fi
127
128 %preun
129 if [ "$1" = "0" ]; then
130         if [ -f /var/lock/subsys/boa ]; then
131                 /etc/rc.d/init.d/boa stop 1>&2
132         fi
133         /sbin/chkconfig --del boa
134 fi
135
136 %files
137 %defattr(644,root,root,755)
138 %doc README ChangeLog docs/*.html docs/*.png
139 %attr(750,root,root) %dir %{_sysconfdir}
140 %attr(640,root,root) %config(noreplace) %{_sysconfdir}/*
141 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/%{name}
142 %dir /srv/httpd
143 %attr(755,root,root) /srv/httpd/html
144 %attr(755,root,root) /srv/httpd/cgi-bin
145 %attr(750,root,root) %dir /var/log/httpd/
146 %attr(640,root,root) %ghost /var/log/httpd/*
147 %attr(755,root,root) %{_sbindir}/*
148 %attr(754,root,root) /etc/rc.d/init.d/%{name}
149 %{_mandir}/man8/*
This page took 0.085985 seconds and 3 git commands to generate.