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