]> git.pld-linux.org Git - packages/apache-mod_suphp.git/blob - apache-mod_suphp.spec
- allow build without httpd binary
[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.0
11 Release:        3
12 License:        GPL
13 Group:          Networking/Daemons
14 Source0:        http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
15 # Source0-md5:  fa89691101b9ebf18f4922b1382186c6
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(post,preun):   %{apxs}
28 Requires:       apache(modules-api) = %apache_modules_api
29 Requires:       apache >= 2.0.52-2
30 Requires:       php-cgi
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
34 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
35
36 %description
37 suPHP is a tool for executing PHP scripts with the permissions of
38 their owners. It consists of an Apache module (mod_suphp) and a setuid
39 root binary (suphp) that is called by the Apache module to change the
40 uid of the process executing the PHP interpreter.
41
42 %description -l pl
43 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów w PHP z
44 uprawnieniami ich w³a¶cicieli. Sk³ada siê z modu³u (mod_suphp) oraz
45 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
46 modu³ w celu zmiany uid procesu uruchamiaj±cego interpreter PHP.
47
48 %prep
49 %setup -q -n %{mod_name}-%{version}
50 %patch0 -p1
51 %patch1 -p1
52 %patch2 -p1
53
54 %build
55 %{__aclocal}
56 %{__autoconf}
57 %{__autoheader}
58 chmod 755 configure
59 export APACHE_VERSION=$(rpm -q --qf '%%{version}' apache-apxs)
60 %configure \
61         %{?with_checkpath: --enable-checkpath} \
62         %{!?with_checkpath: --disable-checkpath} \
63         --with-apache-user=http \
64         --with-min-uid=500 \
65         --with-min-gid=1000 \
66         --with-apxs=%{apxs} \
67         --disable-checkuid \
68         --disable-checkgid
69
70 # FIXME: I don't know anything about libtool, but libtool created by configure
71 # doesn't work. My hardcoded trick is to replace libtool created by configure
72 # with one provided by libtool package in /usr/bin/ path.
73 cp %{_bindir}/libtool .
74
75 %{__make}
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir},%{_datadir}/suphp}
80 install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
81
82 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
83 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
84 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/70_mod-suphp.conf
85
86 install -d $RPM_BUILD_ROOT/etc/logrotate.d
87 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
88
89 install doc/suphp.conf-example $RPM_BUILD_ROOT%{_datadir}/suphp
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %post
95 if [ -f /var/lock/subsys/httpd ]; then
96         /etc/rc.d/init.d/httpd restart 1>&2
97 fi
98
99 %preun
100 if [ "$1" = "0" ]; then
101         if [ -f /var/lock/subsys/httpd ]; then
102                 /etc/rc.d/init.d/httpd restart 1>&2
103         fi
104 fi
105
106 %files
107 %defattr(644,root,root,755)
108 %doc README AUTHORS ChangeLog doc
109 %attr(4755,root,root) %{_sbindir}/suphp
110 %attr(755,root,root) %{_pkglibdir}/*
111 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
112 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*
113 %dir %{_datadir}/suphp
114 %{_datadir}/suphp/*
This page took 0.0292 seconds and 3 git commands to generate.