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