]> TLD Linux GIT Repositories - packages/php-dirs.git/blob - php-dirs.spec
- fix build with rpm.org RPM
[packages/php-dirs.git] / php-dirs.spec
1 # TODO
2 # - move tmpwatch R: to php-session package (as session files file storage no
3 #   longer can cleanup itself due dir perms)
4 # - https://fedorahosted.org/tmpwatch/ticket/7 is implemented in tmpwatch-2.9.16, see 3467603 todo
5 Summary:        Common dirs for PHP
6 Summary(pl.UTF-8):      Wspólne katalogi dla PHP
7 Name:           php-dirs
8 Version:        1.10
9 Release:        4
10 License:        GPL
11 Group:          Base
12 Source0:        php-session.sh
13 Source1:        crontab
14 BuildRequires:  rpmbuild(macros) >= 1.644
15 Requires(postun):       /usr/sbin/groupdel
16 Requires(pre):  /usr/bin/getgid
17 Requires(pre):  /usr/sbin/groupadd
18 Requires:       tmpwatch
19 Conflicts:      php-pear < 4:1.4-2
20 Provides:       group(http)
21 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22
23 %define         _libexecdir     %{_prefix}/lib
24
25 %global         debug_package   %{nil}
26
27 %description
28 Common directories for PHP.
29
30 %description -l pl.UTF-8
31 Wspólne katalogi dla PHP.
32
33 %prep
34
35 %install
36 rm -rf $RPM_BUILD_ROOT
37 install -d $RPM_BUILD_ROOT{/etc/cron.d,/var/{cache,log,run}/php,/var/log/archive/php} \
38         $RPM_BUILD_ROOT%{_docdir}/phpdoc $RPM_BUILD_ROOT{%{_includedir},%{_libdir}}/php \
39         $RPM_BUILD_ROOT%{_libexecdir} $RPM_BUILD_ROOT%{php_data_dir}
40
41 install -p %{SOURCE0} $RPM_BUILD_ROOT%{_libexecdir}
42 sed -e 's,@libexecdir@,%{_libexecdir},' %{SOURCE1} >$RPM_BUILD_ROOT/etc/cron.d/php-session
43
44 while read dir; do
45         install -d $RPM_BUILD_ROOT$dir
46 done <<EOF
47 %{php_data_dir}/tests
48 %{php_data_dir}/Symfony/Bridge
49 %{php_data_dir}/Symfony/Component
50 EOF
51
52 %clean
53 rm -rf $RPM_BUILD_ROOT
54
55 %pre
56 %groupadd -g 51 http
57
58 %postun
59 if [ "$1" = "0" ]; then
60         %groupremove http
61 fi
62
63 %files
64 %defattr(644,root,root,755)
65 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/php-session
66 %attr(755,root,root) %{_libexecdir}/php-session.sh
67
68 %dir %{_docdir}/phpdoc
69 %dir %{_includedir}/php
70 %dir %{_libdir}/php
71 %dir %{php_data_dir}
72
73 %attr(775,root,http) %dir %verify(not group mode) /var/log/php
74 %attr(770,root,root) %dir %verify(not group mode) /var/log/archive/php
75
76 # no +r, so only predictable names can be used. currently php-soap wsdl cache is there
77 %attr(730,root,http) %dir %verify(not group mode) /var/cache/php
78
79 # http needs only +x for directory
80 # (otherwise it knows session file names and can read it contents)
81 # keep o+x for fcgi.sock (lighttpd)
82 %attr(731,root,http) %dir %verify(not group mode) /var/run/php