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