]> git.pld-linux.org Git - packages/apache-mod_suphp.git/blob - apache-mod_suphp.spec
acb4aea5d275e813c0dbe76a6e062be4ff1b02c3
[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:        5
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
35 their owners. It consists of an Apache module (mod_suphp) and a setuid
36 root binary (suphp) that is called by the Apache module to change the
37 uid of the process executing the PHP interpreter.
38
39 %description -l pl
40 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów 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         --with-php=%{_bindir}/php.cgi \
62         --disable-checkuid \
63         --disable-checkgid
64
65 %{__make}
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
70 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
71
72 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
73 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
74 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_mod-suphp.conf
75
76 install -d $RPM_BUILD_ROOT/etc/logrotate.d
77 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
78
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82 %post
83 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
84 if [ -f /var/lock/subsys/httpd ]; then
85         /etc/rc.d/init.d/httpd restart 1>&2
86 fi
87
88 %preun
89 if [ "$1" = "0" ]; then
90         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
91         if [ -f /var/lock/subsys/httpd ]; then
92                 /etc/rc.d/init.d/httpd restart 1>&2
93         fi
94 fi
95
96 %files
97 %defattr(644,root,root,755)
98 %doc README AUTHORS ChangeLog doc
99 %attr(4755,root,root) %{_sbindir}/suphp
100 %attr(755,root,root) %{_pkglibdir}/*
101 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
102 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*
This page took 0.031137 seconds and 3 git commands to generate.