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