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