]> git.pld-linux.org Git - packages/apache-mod_suphp.git/blob - apache-mod_suphp.spec
- also works with apache2 (todo: apache 2 configuration file)
[packages/apache-mod_suphp.git] / apache-mod_suphp.spec
1 #
2 # Available build options:
3 #  with_checkpath       - enable check if php execution is within DOCUMENT_ROOT
4 #                         of the vhost
5 #
6 %define         mod_name        suphp
7 %define         apxs            /usr/sbin/apxs
8 %define         _apache1        %(rpm -q apache-devel 2> /dev/null | grep -Eq '\\-2\\.[0-9]+\\.' && echo 0 || echo 1)
9 Summary:        Apache module: suPHP - execute PHP scripts with the permissions of their owners
10 Summary(pl):    Modu³ do apache: suPHP - uruchamianie skryptów PHP z uprawnieniami ich w³a¶cicieli
11 Name:           apache-mod_%{mod_name}
12 Version:        0.5
13 Release:        0.2
14 License:        GPL
15 Group:          Networking/Daemons
16 Source0:        http://www.suphp.org/download/%{mod_name}-%{version}.tar.gz     
17 # Source0-md5:  a17b2f7bec0db326ee10d28460f34fe4
18 Source1:        apache-mod_suphp.logrotate
19 URL:            http://www.suphp.org/
20 BuildRequires:  %{apxs}
21 BuildRequires:  apache-devel
22 BuildRequires:  autoconf
23 BuildRequires:  automake
24 Requires(post,preun):   %{apxs}
25 Requires:       apache
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
29
30 %description
31 suPHP is a tool for executing PHP scripts with the permissions of their
32 owners. It consists of an Apache module (mod_suphp) and a setuid root
33 binary (suphp) that is called by the Apache module to change the uid of
34 the process executing the PHP interpreter.
35
36 %description -l pl
37 suPHP jest narzêdziem pozwalaj±cym na wykonywanie skryptów PHP z
38 uprawnieniami ich w³a¶cicieli. Sk³ada siê z modu³u (mod_suphp) oraz
39 programu (suphp) z ustawionym bitem suid, który uruchamiany jest przez
40 modu³ w celu zmiany uid procesu uruchamiaj±cego interpreter PHP.
41
42 %prep
43 %setup -q -n %{mod_name}-%{version}
44
45 %build
46 %{__aclocal}
47 %{__autoconf}
48 %{__autoheader}
49 chmod 755 configure
50 %configure \
51         %{?with_checkpath: --enable-checkpath} \
52         %{!?with_checkpath: --disable-checkpath} \
53         --with-apache-user=http \
54         --with-min-uid=500 \
55         --with-min-gid=1000 \
56         --with-apxs=%{apxs} \
57         --disable-checkuid \
58         --disable-checkgid 
59
60 %{__make}
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_pkglibdir}}
65
66 install src/suphp $RPM_BUILD_ROOT%{_sbindir}
67 %if %{_apache1}
68 install src/apache/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
69 %else
70 install src/apache2/.libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
71 %endif
72
73 install -d $RPM_BUILD_ROOT/etc/logrotate.d
74 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/apache-mod_suphp
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %if %{_apache1}
80 %post
81 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
82 if [ -f /var/lock/subsys/httpd ]; then
83         /etc/rc.d/init.d/httpd restart 1>&2
84 fi
85
86 %preun
87 if [ "$1" = "0" ]; then
88         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
89         if [ -f /var/lock/subsys/httpd ]; then
90                 /etc/rc.d/init.d/httpd restart 1>&2
91         fi
92 fi
93 %endif
94
95 %files
96 %defattr(644,root,root,755)
97 %doc README AUTHORS ChangeLog doc
98 %attr(4755,root,root) %{_sbindir}/*
99 %attr(755,root,root) %{_pkglibdir}/*
100 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/*
This page took 0.168408 seconds and 4 git commands to generate.