]> git.pld-linux.org Git - packages/apache-mod_suphp.git/blob - apache-mod_suphp.spec
- updated to 0.7.0
[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.UTF-8):      Moduł do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich właścicieli
9 Name:           apache-mod_%{mod_name}
10 Version:        0.7.0
11 Release:        1
12 License:        GPL
13 Group:          Networking/Daemons/HTTP
14 Source0:        http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz
15 # Source0-md5:  dac578fc8bda630cc37ed6e47d4ff213
16 Source1:        %{name}.logrotate
17 Source2:        %{name}.conf
18 Source3:        %{name}-suphp.conf
19 Patch0:         %{name}-compiler-flags.patch
20 Patch1:         %{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 BuildRequires:  libtool
28 BuildRequires:  rpmbuild(macros) >= 1.268
29 Requires:       apache(modules-api) = %apache_modules_api
30 Requires:       php-cgi
31 Conflicts:      logrotate < 3.7-4
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         apacheconfdir   %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
35 %define         apachelibdir    %(%{apxs} -q LIBEXECDIR 2>/dev/null)
36
37 %description
38 suPHP is a tool for executing PHP scripts with the permissions of
39 their owners. It consists of an Apache module (mod_suphp) and a setuid
40 root binary (suphp) that is called by the Apache module to change the
41 uid of the process executing the PHP interpreter.
42
43 %description -l pl.UTF-8
44 suPHP jest narzędziem pozwalającym na wykonywanie skryptów w PHP z
45 uprawnieniami ich właścicieli. Składa się z modułu (mod_suphp) oraz
46 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
47 moduł w celu zmiany uid procesu uruchamiającego interpreter PHP.
48
49 %prep
50 %setup -q -n %{mod_name}-%{version}
51 %patch0 -p1
52 %patch1 -p1
53
54 %build
55 %{__libtoolize}
56 %{__aclocal}
57 %{__autoconf}
58 %{__autoheader}
59 %{__automake}
60 APACHE_VERSION=$(rpm -q --qf '%{V}' apache-devel); export APACHE_VERSION
61 %configure \
62         --%{?with_checkpath:en}%{!?with_checkpath:dis}able-checkpath \
63         --with-apache-user=http \
64         --with-min-uid=500 \
65         --with-min-gid=1000 \
66         --with-apxs=%{apxs} \
67         --with-apr=%{_bindir}/apr-1-config \
68         --with-setid-mode=owner \
69         --with-logfile=/var/log/httpd/suphp_log
70
71 %{__make}
72
73 %install
74 rm -rf $RPM_BUILD_ROOT
75 install -d $RPM_BUILD_ROOT{%{_sbindir},%{apachelibdir},%{_datadir}/suphp}
76 install -d $RPM_BUILD_ROOT%{apacheconfdir}
77
78 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
79 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{apachelibdir}
80 install %{SOURCE2} $RPM_BUILD_ROOT%{apacheconfdir}/70_mod_%{mod_name}.conf
81 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{mod_name}.conf
82
83 install -d $RPM_BUILD_ROOT/etc/logrotate.d
84 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
85
86 install doc/suphp.conf-example $RPM_BUILD_ROOT%{_datadir}/suphp
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %post
92 %service -q httpd restart
93
94 %postun
95 if [ "$1" = "0" ]; then
96         %service -q httpd restart
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) %{apacheconfdir}/*_mod_%{mod_name}.conf
103 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{mod_name}.conf
104 %attr(755,root,root) %{apachelibdir}/*.so
105 %attr(4755,root,root) %{_sbindir}/suphp
106 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
107 %dir %{_datadir}/suphp
108 %{_datadir}/suphp/*
This page took 0.050166 seconds and 3 git commands to generate.