]> git.pld-linux.org Git - packages/php-rrdtool.git/blob - php-rrdtool.spec
- fix build on amd64
[packages/php-rrdtool.git] / php-rrdtool.spec
1 %define         _modname        rrdtool
2 %define         _sysconfdir     /etc/php
3 %define         extensionsdir   %(php-config --extension-dir 2>/dev/null)
4 Summary:        RRDtool PHP module
5 Summary(pl):    Modu³ PHP RRDtool
6 Name:           php-rrdtool
7 Version:        1.0.50
8 Release:        1
9 License:        GPL
10 Group:          Applications/Databases
11 Source0:        http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.x/rrdtool-%{version}.tar.gz
12 # Source0-md5:  c466e2e7df95fa8e318e46437da87686
13 Patch0:         rrdtool-php-config.patch
14 URL:            http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/
15 BuildRequires:  cgilibc-devel
16 BuildRequires:  gd-devel
17 BuildRequires:  openssl-devel >= 0.9.5
18 BuildRequires:  php-devel >= 3:5.0.0
19 BuildRequires:  rpmbuild(macros) >= 1.230
20 BuildRequires:  rrdtool-devel
21 Requires(post,preun):   php-common
22 Requires:       %{_sysconfdir}/conf.d
23 %requires_eq_to php-common php-devel
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %description
27 This package includes a dynamic shared object (DSO) that adds RRDtool
28 bindings to the PHP HTML-embedded scripting language.
29
30 %description -l pl
31 Modu³ RRDtool dla PHP.
32
33 %prep
34 %setup -q -n rrdtool-%{version}
35 %patch0 -p0
36
37 %build
38 cd contrib/php4
39 phpize
40 %configure \
41         --with-openssl \
42         --includedir="%{_includedir}/php"
43
44 %{__make}
45
46 %install
47 rm -rf $RPM_BUILD_ROOT
48 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/conf.d,%{_examplesdir}/%{name}-%{version}}
49
50 cd contrib/php4
51 %{__make} install \
52         INSTALL_ROOT=$RPM_BUILD_ROOT
53
54 cat <<'EOF' > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/%{_modname}.ini
55 ; Enable %{_modname} extension module
56 extension=%{_modname}.so
57 EOF
58
59 cp -a examples/*.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %post
65 [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
66 [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
67
68 %postun
69 if [ "$1" = 0 ]; then
70         [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
71         [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart
72 fi
73
74 %files
75 %defattr(644,root,root,755)
76 %doc contrib/php4/USAGE
77 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/%{_modname}.ini
78 %attr(755,root,root) %{extensionsdir}/%{_modname}.so
79 %{_examplesdir}/%{name}-%{version}
This page took 0.082535 seconds and 3 git commands to generate.