]> git.pld-linux.org Git - packages/php-pecl-apcu.git/blob - php-pecl-apcu.spec
67eae4057ac491918c7bb0e3fde1e1508d06b548
[packages/php-pecl-apcu.git] / php-pecl-apcu.spec
1 #
2 # Conditional build:
3 %bcond_without  web             # make web package
4
5 # don't build for php53
6 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "55"
7 %undefine       with_web
8 %endif
9
10 %define         php_name        php%{?php_suffix}
11 %define         modname apcu
12 Summary:        APCu - APC User Cache
13 Name:           %{php_name}-pecl-%{modname}
14 Version:        4.0.7
15 Release:        3
16 License:        PHP 3.01
17 Group:          Development/Languages/PHP
18 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
19 # Source0-md5:  9feb03d3e5217242a39244964f098b52
20 Source1:        %{modname}.ini
21 Source2:        apache.conf
22 Source3:        config.php
23 Patch0:         config.patch
24 URL:            http://pecl.php.net/package/APCu/
25 BuildRequires:  %{php_name}-devel >= 4:5.1.0
26 BuildRequires:  libtool
27 BuildRequires:  rpmbuild(macros) >= 1.666
28 %{?requires_php_extension}
29 Provides:       php(apcu) = %{version}
30 Obsoletes:      php-pecl-apcu < 4.0.4-2
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %define         _webapps        /etc/webapps
34 %define         _webapp         %{modname}
35 %define         _sysconfdir     %{_webapps}/%{_webapp}
36 %define         _appdir         %{_datadir}/%{_webapp}
37
38 %description
39 APCu is userland caching: APC stripped of opcode caching in
40 preparation for the deployment of Zend Optimizer+ as the primary
41 solution to opcode caching in future versions of PHP.
42
43 APCu only supports userland caching (and dumping) of variables,
44 providing an upgrade path for the future. When O+ takes over, many
45 will be tempted to use 3rd party solutions to userland caching,
46 possibly even distributed solutions; this would be a grave error. The
47 tried and tested APC codebase provides far superior support for local
48 storage of PHP variables.
49
50 %package -n apcu-panel
51 Summary:        APCu control panel
52 Group:          Applications/Networking
53 Requires:       php(apcu) = %{version}
54 Requires:       php(gd)
55 Requires:       webapps
56 Requires:       webserver(access)
57 Requires:       webserver(php) >= 5.0
58 %if "%{_rpmversion}" >= "5"
59 BuildArch:      noarch
60 %endif
61
62 %description -n apcu-panel
63 This package provides the APCu control panel, with Webserver
64 configuration, available on <http://localhost/apcu-panel/>
65
66 %prep
67 %setup -qc
68 mv %{modname}-%{version}/* .
69 %patch0 -p1
70 cp -p %{SOURCE1} .
71
72 %build
73 %{__libtoolize}
74 phpize
75 %configure \
76         --%{!?debug:dis}%{?debug:en}able-apcu-debug \
77         --enable-apcu-spinlocks \
78         --enable-apcu-mmap
79 %{__make}
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83 install -d $RPM_BUILD_ROOT{%{php_extensiondir},%{php_sysconfdir}/conf.d}
84 install -p modules/apcu.so $RPM_BUILD_ROOT%{php_extensiondir}/%{modname}.so
85 cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
86
87 # Install the Control Panel
88 %if %{with web}
89 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
90 cp -p apc.php  $RPM_BUILD_ROOT%{_appdir}/index.php
91 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
92 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
93 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
94 %endif
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %post
100 %php_webserver_restart
101
102 %postun
103 if [ "$1" = 0 ]; then
104         %php_webserver_restart
105 fi
106
107 %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
108 %webapp_register apache %{_webapp}
109
110 %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
111 %webapp_unregister apache %{_webapp}
112
113 %triggerin -n apcu-panel -- apache < 2.2.0, apache-base
114 %webapp_register httpd %{_webapp}
115
116 %triggerun -n apcu-panel -- apache < 2.2.0, apache-base
117 %webapp_unregister httpd %{_webapp}
118
119 %files
120 %defattr(644,root,root,755)
121 %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE
122 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
123 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
124
125 %if %{with web}
126 %files -n apcu-panel
127 %defattr(644,root,root,755)
128 %dir %attr(750,root,http) %{_sysconfdir}
129 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
130 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
131 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
132 %{_appdir}
133 %endif
This page took 0.106952 seconds and 2 git commands to generate.