]> git.pld-linux.org Git - packages/mathopd.git/blob - mathopd.spec
- use %useradd/%groupadd macros
[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.5
5 Release:        1
6 Group:          Networking
7 License:        BSD
8 Source0:        http://www.mathopd.org/dist/%{name}-%{version}p3.tar.gz
9 # Source0-md5:  6e0fea187134cb52509c2f98a8644d11
10 Source1:        %{name}.init
11 Source2:        %{name}.conf
12 Source3:        http://www.mathopd.org/dist/dir_cgi.c.txt
13 URL:            http://www.mathopd.org/
14 BuildRequires:  rpmbuild(macros) >= 1.202
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
23 Provides:       group(http)
24 Provides:       httpd
25 Provides:       user(http)
26 Provides:       webserver
27 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29 %define         _datadir        /home/services/httpd
30
31 %description
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.
36
37 %description -l pl
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¶æ
41 rzeczy.
42
43 %prep
44 %setup -q -n %{name}-1.5p3
45
46 cp -f %{SOURCE3}  dir_cgi.c
47
48 %build
49 CFLAGS="%{rpmcflags}"; export CFLAGS
50
51 %{__cc} %{rpmcflags} %{rpmldflags} -o mathopd-dir_cgi dir_cgi.c
52
53 cd src
54 %{__make} CC="%{__cc}"
55
56 %install
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}
61
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}
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %pre
71 %groupadd -g 51 -r -f http
72 %useradd -u 51 -r -d %{_datadir} -s /bin/false -c "HTTP User" -g http http
73
74 %post
75 /sbin/chkconfig --add %{name}
76 if [ -f /var/lock/subsys/mathopd ]; then
77         /etc/rc.d/init.d/mathopd restart 1>&2
78 else
79         echo "Run \"/etc/rc.d/init.d/mathopd start\" to start %{name} HTTP daemon."
80 fi
81
82 %preun
83 if [ "$1" = "0" ]; then
84         if [ -f /var/lock/subsys/mathopd ]; then
85                 /etc/rc.d/init.d/mathopd stop 1>&2
86         fi
87         /sbin/chkconfig --del %{name}
88 fi
89
90 %postun
91 if [ "$1" = "0" ]; then
92         %userremove http
93         %groupremove http
94 fi
95
96 %files
97 %defattr(644,root,root,755)
98 %doc [A-Z]* doc/*
99 %attr(755,root,root) %{_sbindir}/mathopd*
100 %attr(755,http,http) %{_datadir}
101 %attr(754,root,root) /etc/rc.d/init.d/mathopd
102 %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mathopd.conf
103 %attr(750,http,http) %dir %{_var}/log/mathopd
This page took 0.16621 seconds and 4 git commands to generate.