1 Summary: A fast, lightweighte, non-forking HTTP server for UN*X systems
2 Summary(pl): Szybki, niedu¿y, nie forkuj±cy siê serwer HTTP
8 Source0: http://www.mathopd.org/dist/%{name}-%{version}p3.tar.gz
9 # Source0-md5: 6e0fea187134cb52509c2f98a8644d11
12 Source3: http://www.mathopd.org/dist/dir_cgi.c.txt
13 URL: http://www.mathopd.org/
14 BuildRequires: rpmbuild(macros) >= 1.159
15 Requires(pre): /bin/id
16 Requires(pre): /usr/bin/getgid
17 Requires(pre): /usr/sbin/groupadd
18 Requires(pre): /usr/sbin/useradd
19 Requires(pre): sh-utils
20 Requires(postun): /usr/sbin/groupdel
21 Requires(postun): /usr/sbin/userdel
22 Requires(post,preun): /sbin/chkconfig
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 %define _datadir /home/services/httpd
32 Mathopd is a very small, yet very fast HTTP server for UN*X systems.
33 Mathopd is designed specifically to handle a large number of
34 connections with minimal fuss. It contains no unnecessary add-ons, but
35 it does the trick for most things.
38 Mathopd jest bardzo ma³ym, bardzo szybkim serwerem HTTP dla systemów
39 uniksowych. Jest zaprojektowany specjalnie do obs³ugi du¿ej liczby
40 po³±czeñ. Nie ma niepotrzebnych dodatków, ale potrafi wiêkszo¶æ
44 %setup -q -n %{name}-1.5p3
46 cp -f %{SOURCE3} dir_cgi.c
49 CFLAGS="%{rpmcflags}"; export CFLAGS
51 %{__cc} %{rpmcflags} %{rpmldflags} -o mathopd-dir_cgi dir_cgi.c
54 %{__make} CC="%{__cc}"
57 rm -rf $RPM_BUILD_ROOT
58 install -d $RPM_BUILD_ROOT%{_datadir}/cgi-bin \
59 $RPM_BUILD_ROOT/etc/rc.d/init.d \
60 $RPM_BUILD_ROOT{%{_sbindir},%{_var}/log/mathopd}
62 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mathopd
63 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
64 install src/mathopd $RPM_BUILD_ROOT%{_sbindir}
65 install mathopd-dir_cgi $RPM_BUILD_ROOT%{_sbindir}
68 rm -rf $RPM_BUILD_ROOT
71 if [ -n "`getgid http`" ]; then
72 if [ "`getgid http`" != "51" ]; then
73 echo "Error: group http doesn't have gid=51. Correct this before installing %{name}." 1>&2
77 /usr/sbin/groupadd -g 51 -r -f http
79 if [ -n "`id -u http 2>/dev/null`" ]; then
80 if [ "`id -u http`" != "51" ]; then
81 echo "Error: user http doesn't have uid=51. Correct this before installing %{name}." 1>&2
85 /usr/sbin/useradd -u 51 -r -d %{_datadir} -s /bin/false -c "HTTP User" -g http http 1>&2
89 /sbin/chkconfig --add %{name}
90 if [ -f /var/lock/subsys/mathopd ]; then
91 /etc/rc.d/init.d/mathopd restart 1>&2
93 echo "Run \"/etc/rc.d/init.d/mathopd start\" to start %{name} HTTP daemon."
97 if [ "$1" = "0" ]; then
98 if [ -f /var/lock/subsys/mathopd ]; then
99 /etc/rc.d/init.d/mathopd stop 1>&2
101 /sbin/chkconfig --del %{name}
105 if [ "$1" = "0" ]; then
111 %defattr(644,root,root,755)
113 %attr(755,root,root) %{_sbindir}/mathopd*
114 %attr(755,http,http) %{_datadir}
115 %attr(754,root,root) /etc/rc.d/init.d/mathopd
116 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mathopd.conf
117 %attr(750,http,http) %dir %{_var}/log/mathopd