]> git.pld-linux.org Git - packages/mathopd.git/blob - mathopd.spec
- noreplace and verify flags for config
[packages/mathopd.git] / mathopd.spec
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
3 Name:           mathopd
4 Version:        1.4gamma
5 Release:        3
6 Group:          Networking
7 License:        BSD
8 Source0:        http://www.mathopd.org/dist/%{name}-1.4-gamma.tar.gz
9 # Source0-md5:  f16222d1fdf70cd15c0c5e73984cc757
10 Source1:        %{name}.init
11 Source2:        %{name}.conf
12 URL:            http://www.mathopd.org/
13 Provides:       httpd
14 Provides:       webserver
15 Requires(pre):  sh-utils
16 Requires(pre):  /usr/bin/getgid
17 Requires(pre):  /bin/id
18 Requires(pre):  /usr/sbin/groupadd
19 Requires(pre):  /usr/sbin/useradd
20 Requires(postun):       /usr/sbin/userdel
21 Requires(postun):       /usr/sbin/groupdel
22 Requires(post,preun):   /sbin/chkconfig
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %define         _datadir        /home/services/httpd
26
27 %description
28 Mathopd is a very small, yet very fast HTTP server for UN*X systems.
29 Mathopd is designed specifically to handle a large number of
30 connections with minimal fuss. It contains no unnecessary add-ons, but
31 it does the trick for most things.
32
33 %description -l pl
34 Mathopd jest bardzo ma³ym, bardzo szybkim serwerem HTTP dla systemów
35 uniksowych. Jest zaprojektowany specjalnie do obs³ugi du¿ej liczby
36 po³±czeñ. Nie ma niepotrzebnych dodatków, ale potrafi wiêkszo¶æ
37 rzeczy.
38
39 %prep
40 %setup -q -n %{name}-1.4
41
42 %build
43 CFLAGS="%{rpmcflags}"; export CFLAGS
44 cd src
45 %{__make}
46
47 %install
48 rm -rf $RPM_BUILD_ROOT
49 install -d $RPM_BUILD_ROOT%{_datadir}/cgi-bin \
50         $RPM_BUILD_ROOT/etc/rc.d/init.d \
51         $RPM_BUILD_ROOT{%{_sbindir},%{_var}/log/mathopd}
52
53 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/mathopd
54 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
55 install src/mathopd $RPM_BUILD_ROOT%{_sbindir}
56
57 %clean
58 rm -rf $RPM_BUILD_ROOT
59
60 %pre
61 if [ -n "`getgid http`" ]; then
62         if [ "`getgid http`" != "51" ]; then
63                 echo "Error: group http doesn't have gid=51. Correct this before installing %{name}." 1>&2
64                 exit 1
65         fi
66 else
67         /usr/sbin/groupadd -g 51 -r -f http
68 fi
69 if [ -n "`id -u http 2>/dev/null`" ]; then
70         if [ "`id -u http`" != "51" ]; then
71                 echo "Error: user http doesn't have uid=51. Correct this before installing %{name}." 1>&2
72                 exit 1
73         fi
74 else
75         /usr/sbin/useradd -u 51 -r -d %{_datadir} -s /bin/false -c "HTTP User" -g http http 1>&2
76 fi
77
78 %post
79 /sbin/chkconfig --add %{name}
80 if [ -f /var/lock/subsys/mathopd ]; then
81         /etc/rc.d/init.d/mathopd restart 1>&2
82 else
83         echo "Run \"/etc/rc.d/init.d/mathopd start\" to start %{name} daemon."
84 fi
85
86 %preun
87 if [ "$1" = "0" ]; then
88         if [ -f /var/lock/subsys/mathopd ]; then
89                 /etc/rc.d/init.d/mathopd stop 1>&2
90         fi
91         /sbin/chkconfig --del %{name}
92 fi
93
94 %postun
95 if [ "$1" = "0" ]; then
96         /usr/sbin/userdel http
97         /usr/sbin/groupdel http
98 fi
99
100 %files
101 %defattr(644,root,root,755)
102 %doc [A-Z]* doc/*
103 %attr(755,root,root) %{_sbindir}/mathopd
104 %attr(755,http,http) %{_datadir}
105 %attr(754,root,root) /etc/rc.d/init.d/mathopd
106 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mathopd.conf
107 %attr(750,http,http) %dir %{_var}/log/mathopd
This page took 0.065863 seconds and 4 git commands to generate.