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