]>
Commit | Line | Data |
---|---|---|
9416cacc AG |
1 | # |
2 | # Available build options: | |
4f71446b | 3 | %bcond_with checkpath # enable check if php execution is within DOCUMENT_ROOT of the vhost |
131ba8d3 | 4 | |
f728b606 AG |
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 | |
dd7674a9 | 8 | Summary(pl.UTF-8): Moduł do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich właścicieli |
f728b606 | 9 | Name: apache-mod_%{mod_name} |
bc97f205 PS |
10 | Version: 0.7.2 |
11 | Release: 1 | |
f728b606 | 12 | License: GPL |
0dca1078 | 13 | Group: Networking/Daemons/HTTP |
3c364514 | 14 | Source0: http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz |
bc97f205 | 15 | # Source0-md5: 852793953eec97f4ae992e366b517e81 |
80f911b6 | 16 | Source1: %{name}.logrotate |
17 | Source2: %{name}.conf | |
e5964759 | 18 | Source3: %{name}-suphp.conf |
9bdf7b7c AG |
19 | Patch0: %{name}-compiler-flags.patch |
20 | Patch1: %{name}-apache_version.patch | |
8b342dff | 21 | Patch2: automake-1.13.patch |
f728b606 | 22 | URL: http://www.suphp.org/ |
053bbfa6 | 23 | BuildRequires: %{apxs} |
cdd38411 | 24 | BuildRequires: apache-devel >= 2.0.52-2 |
18fcd50c JB |
25 | BuildRequires: autoconf |
26 | BuildRequires: automake | |
6577b666 | 27 | BuildRequires: libstdc++-devel |
9bdf7b7c | 28 | BuildRequires: libtool |
61194e06 | 29 | BuildRequires: rpmbuild(macros) >= 1.268 |
4f71446b | 30 | Requires: apache(modules-api) = %apache_modules_api |
131ba8d3 | 31 | Requires: php(cgi) |
5751bdbd | 32 | Conflicts: logrotate < 3.7-4 |
f728b606 AG |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
83d5fc38 ER |
35 | %define apacheconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d |
36 | %define apachelibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
f728b606 AG |
37 | |
38 | %description | |
3c364514 AG |
39 | suPHP is a tool for executing PHP scripts with the permissions of |
40 | their owners. It consists of an Apache module (mod_suphp) and a setuid | |
41 | root binary (suphp) that is called by the Apache module to change the | |
42 | uid of the process executing the PHP interpreter. | |
f728b606 | 43 | |
e45c9df2 JR |
44 | %description -l pl.UTF-8 |
45 | suPHP jest narzędziem pozwalającym na wykonywanie skryptów w PHP z | |
46 | uprawnieniami ich właścicieli. Składa się z modułu (mod_suphp) oraz | |
47 | programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez | |
48 | moduł w celu zmiany uid procesu uruchamiającego interpreter PHP. | |
f728b606 AG |
49 | |
50 | %prep | |
51 | %setup -q -n %{mod_name}-%{version} | |
fc2af1ea | 52 | %patch0 -p1 |
72e21711 | 53 | %patch1 -p1 |
8b342dff | 54 | %patch2 -p1 |
f728b606 AG |
55 | |
56 | %build | |
9bdf7b7c | 57 | %{__libtoolize} |
f728b606 AG |
58 | %{__aclocal} |
59 | %{__autoconf} | |
60 | %{__autoheader} | |
72e21711 | 61 | %{__automake} |
83d5fc38 | 62 | APACHE_VERSION=$(rpm -q --qf '%{V}' apache-devel); export APACHE_VERSION |
18fcd50c | 63 | %configure \ |
83d5fc38 | 64 | --%{?with_checkpath:en}%{!?with_checkpath:dis}able-checkpath \ |
18fcd50c | 65 | --with-apache-user=http \ |
48cd0203 | 66 | --with-min-uid=500 \ |
9416cacc AG |
67 | --with-min-gid=1000 \ |
68 | --with-apxs=%{apxs} \ | |
9bdf7b7c | 69 | --with-apr=%{_bindir}/apr-1-config \ |
e5964759 JR |
70 | --with-setid-mode=owner \ |
71 | --with-logfile=/var/log/httpd/suphp_log | |
48cd0203 | 72 | |
f728b606 AG |
73 | %{__make} |
74 | ||
f728b606 AG |
75 | %install |
76 | rm -rf $RPM_BUILD_ROOT | |
83d5fc38 ER |
77 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{apachelibdir},%{_datadir}/suphp} |
78 | install -d $RPM_BUILD_ROOT%{apacheconfdir} | |
f728b606 | 79 | |
131ba8d3 ER |
80 | install -p src/suphp $RPM_BUILD_ROOT%{_sbindir} |
81 | install -p src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{apachelibdir} | |
82 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{apacheconfdir}/70_mod_%{mod_name}.conf | |
83 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{mod_name}.conf | |
f728b606 | 84 | |
18fcd50c | 85 | install -d $RPM_BUILD_ROOT/etc/logrotate.d |
131ba8d3 ER |
86 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp |
87 | cp -p doc/suphp.conf-example $RPM_BUILD_ROOT%{_datadir}/suphp | |
630dd324 | 88 | |
f728b606 AG |
89 | %clean |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %post | |
61194e06 | 93 | %service -q httpd restart |
f728b606 | 94 | |
3057f748 | 95 | %postun |
f728b606 | 96 | if [ "$1" = "0" ]; then |
61194e06 | 97 | %service -q httpd restart |
f728b606 AG |
98 | fi |
99 | ||
100 | %files | |
101 | %defattr(644,root,root,755) | |
102 | %doc README AUTHORS ChangeLog doc | |
83d5fc38 | 103 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}.conf |
e5964759 | 104 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{mod_name}.conf |
83d5fc38 | 105 | %attr(755,root,root) %{apachelibdir}/*.so |
f9a8a397 | 106 | %attr(4755,root,root) %{_sbindir}/suphp |
3c364514 | 107 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* |
4f71446b | 108 | %dir %{_datadir}/suphp |
630dd324 | 109 | %{_datadir}/suphp/* |