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