]> git.pld-linux.org Git - packages/php-pecl-apcu.git/blob - php-pecl-apcu.spec
57effc6d86148b6856067658905a7865c5cda83e
[packages/php-pecl-apcu.git] / php-pecl-apcu.spec
1 #
2 # Conditional build:
3 %bcond_without  web             # make web package
4
5 # on builders, build "web" only under php70
6 %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "70"
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:        5.1.8
15 Release:        1
16 License:        PHP 3.01
17 Group:          Development/Languages/PHP
18 Source0:        https://pecl.php.net/get/%{modname}-%{version}.tgz
19 # Source0-md5:  0ef8be2ee8acb4dba5a66b247a254995
20 Source1:        %{modname}.ini
21 Source2:        apache.conf
22 Source3:        config.php
23 Patch0:         config.patch
24 URL:            https://pecl.php.net/package/APCu/
25 BuildRequires:  %{php_name}-devel >= 4:7.0.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 devel
51 Summary: APCu developer files (header)
52 Group:          Development/Libraries
53 Requires:       %{php_name}-devel
54 # does not require base
55
56 %description devel
57 These are the files needed to compile programs using Igbinary
58
59 %package -n apcu-panel
60 Summary:        APCu control panel
61 Group:          Applications/Networking
62 Requires:       php(apcu) = %{version}
63 Requires:       php(gd)
64 Requires:       webapps
65 Requires:       webserver(access)
66 Requires:       webserver(php) >= 5.0
67 %if "%{_rpmversion}" >= "5"
68 BuildArch:      noarch
69 %endif
70
71 %description -n apcu-panel
72 This package provides the APCu control panel, with Webserver
73 configuration, available on <http://localhost/apcu-panel/>
74
75 %prep
76 %setup -qc
77 mv %{modname}-%{version}/* .
78 %patch0 -p1
79 cp -p %{SOURCE1} .
80
81 %build
82 %{__libtoolize}
83 phpize
84 %configure \
85         --%{!?debug:dis}%{?debug:en}able-apcu-debug \
86         --enable-apcu-spinlocks \
87         --enable-apcu-mmap
88 %{__make}
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 %{__make} install \
93         EXTENSION_DIR=%{php_extensiondir} \
94         INSTALL_ROOT=$RPM_BUILD_ROOT
95
96 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
97 cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
98
99 # Install the Control Panel
100 %if %{with web}
101 install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
102 cp -p apc.php  $RPM_BUILD_ROOT%{_appdir}/index.php
103 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
104 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
105 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %post
112 %php_webserver_restart
113
114 %postun
115 if [ "$1" = 0 ]; then
116         %php_webserver_restart
117 fi
118
119 %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
120 %webapp_register apache %{_webapp}
121
122 %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base
123 %webapp_unregister apache %{_webapp}
124
125 %triggerin -n apcu-panel -- apache < 2.2.0, apache-base
126 %webapp_register httpd %{_webapp}
127
128 %triggerun -n apcu-panel -- apache < 2.2.0, apache-base
129 %webapp_unregister httpd %{_webapp}
130
131 %files
132 %defattr(644,root,root,755)
133 %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE
134 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
135 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
136
137 %files devel
138 %defattr(644,root,root,755)
139 %{_includedir}/php/ext/%{modname}
140
141 %if %{with web}
142 %files -n apcu-panel
143 %defattr(644,root,root,755)
144 %dir %attr(750,root,http) %{_sysconfdir}
145 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
146 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
147 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
148 %{_appdir}
149 %endif
This page took 0.085286 seconds and 2 git commands to generate.