]> git.pld-linux.org Git - packages/apache-mod_suphp.git/blob - apache-mod_suphp.spec
-correct path of config file for apache
[packages/apache-mod_suphp.git] / apache-mod_suphp.spec
1 #
2 # Available build options:
3 %bcond_with     checkpath       # enable check if php execution is within
4                                 # DOCUMENT_ROOT of the vhost
5 #
6 %define         mod_name        suphp
7 %define         apxs            /usr/sbin/apxs
8 %define         _apache1        %(rpm -q apache-devel 2> /dev/null | grep -Eq '\\-2\\.[0-9]+\\.' && echo 0 || echo 1)
9 Summary:        Apache module: suPHP - execute PHP scripts with the permissions of their owners
10 Summary(pl):    Modu³ do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich w³a¶cicieli
11 Name:           apache-mod_%{mod_name}
12 Version:        0.5.1
13 Release:        1
14 License:        GPL
15 Group:          Networking/Daemons
16 Source0:        http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz     
17 # Source0-md5:  6898ccd801ec93cb7c6a69a9ac8f3703
18 Source1:        apache-mod_suphp.logrotate
19 Source2:        apache-mod_suphp.conf
20 URL:            http://www.suphp.org/
21 BuildRequires:  %{apxs}
22 BuildRequires:  apache-devel
23 BuildRequires:  autoconf
24 BuildRequires:  automake
25 Requires(post,preun):   %{apxs}
26 Requires:       apache
27 Requires:       php-cgi
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
31
32 %description
33 suPHP is a tool for executing PHP scripts with the permissions of their
34 owners. It consists of an Apache module (mod_suphp) and a setuid root
35 binary (suphp) that is called by the Apache module to change the uid of
36 the process executing the PHP interpreter.
37
38 %description -l pl
39 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów PHP z
40 uprawnieniami ich w³a¶cicieli. Sk³ada siê z modu³u (mod_suphp) oraz
41 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
42 modu³ w celu zmiany uid procesu uruchamiaj±cego interpreter PHP.
43
44 %prep
45 %setup -q -n %{mod_name}-%{version}
46
47 %build
48 %{__aclocal}
49 %{__autoconf}
50 %{__autoheader}
51 chmod 755 configure
52 %configure \
53         %{?with_checkpath: --enable-checkpath} \
54         %{!?with_checkpath: --disable-checkpath} \
55         --with-apache-user=http \
56         --with-min-uid=500 \
57         --with-min-gid=1000 \
58         --with-apxs=%{apxs} \
59         --disable-checkuid \
60         --disable-checkgid 
61
62 %{__make}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
67 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf
68
69 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
70 %if %{_apache1}
71 install src/apache/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
72 %else
73 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
74 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.conf/70_mod-suphp.conf
75 %endif
76
77 install -d $RPM_BUILD_ROOT/etc/logrotate.d
78 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %if %{_apache1}
84 %post
85 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
86 if [ -f /var/lock/subsys/httpd ]; then
87         /etc/rc.d/init.d/httpd restart 1>&2
88 fi
89
90 %preun
91 if [ "$1" = "0" ]; then
92         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
93         if [ -f /var/lock/subsys/httpd ]; then
94                 /etc/rc.d/init.d/httpd restart 1>&2
95         fi
96 fi
97 %endif
98
99 %files
100 %defattr(644,root,root,755)
101 %doc README AUTHORS ChangeLog doc
102 %attr(4755,root,root) %{_sbindir}/suphp
103 %attr(755,root,root) %{_pkglibdir}/*
104 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
105 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/httpd/httpd.conf/*
This page took 0.039615 seconds and 3 git commands to generate.