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