]> 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:        3
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 %description
26 Common directories for PHP.
27
28 %description -l pl.UTF-8
29 Wspólne katalogi dla PHP.
30
31 %prep
32
33 %install
34 rm -rf $RPM_BUILD_ROOT
35 install -d $RPM_BUILD_ROOT{/etc/cron.d,/var/{cache,log,run}/php,/var/log/archive/php} \
36         $RPM_BUILD_ROOT%{_docdir}/phpdoc $RPM_BUILD_ROOT{%{_includedir},%{_libdir}}/php \
37         $RPM_BUILD_ROOT%{_libexecdir} $RPM_BUILD_ROOT%{php_data_dir}
38
39 install -p %{SOURCE0} $RPM_BUILD_ROOT%{_libexecdir}
40 sed -e 's,@libexecdir@,%{_libexecdir},' %{SOURCE1} >$RPM_BUILD_ROOT/etc/cron.d/php-session
41
42 while read dir; do
43         install -d $RPM_BUILD_ROOT$dir
44 done <<EOF
45 %{php_data_dir}/tests
46 %{php_data_dir}/Symfony/Bridge
47 %{php_data_dir}/Symfony/Component
48 EOF
49
50 %clean
51 rm -rf $RPM_BUILD_ROOT
52
53 %pre
54 %groupadd -g 51 http
55
56 %postun
57 if [ "$1" = "0" ]; then
58         %groupremove http
59 fi
60
61 %files
62 %defattr(644,root,root,755)
63 %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/php-session
64 %attr(755,root,root) %{_libexecdir}/php-session.sh
65
66 %dir %{_docdir}/phpdoc
67 %dir %{_includedir}/php
68 %dir %{_libdir}/php
69 %dir %{php_data_dir}
70
71 %attr(775,root,http) %dir %verify(not group mode) /var/log/php
72 %attr(770,root,root) %dir %verify(not group mode) /var/log/archive/php
73
74 # no +r, so only predictable names can be used. currently php-soap wsdl cache is there
75 %attr(730,root,http) %dir %verify(not group mode) /var/cache/php
76
77 # http needs only +x for directory
78 # (otherwise it knows session file names and can read it contents)
79 # keep o+x for fcgi.sock (lighttpd)
80 %attr(731,root,http) %dir %verify(not group mode) /var/run/php