diff options
Diffstat (limited to 'php-pecl-apm.spec')
-rw-r--r-- | php-pecl-apm.spec | 107 |
1 files changed, 14 insertions, 93 deletions
diff --git a/php-pecl-apm.spec b/php-pecl-apm.spec index 26408ee..6e4e24f 100644 --- a/php-pecl-apm.spec +++ b/php-pecl-apm.spec @@ -8,7 +8,6 @@ # %{?scl: %scl_package php-pecl-apm} %{!?scl: %global pkg_name %{name}} -%{!?scl: %global _root_sysconfdir %{_sysconfdir}} %{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} %{!?php_incldir: %global php_incldir %{_includedir}/php} %{!?__pecl: %global __pecl %{_bindir}/pecl} @@ -16,7 +15,7 @@ %global pecl_name apm %global proj_name APM # https://github.com/patrickallaert/php-apm/issues/13 -%global with_zts 0 +%global with_zts 0%{?__ztsphp:1} %if "%{php_version}" < "5.6" # after json.ini %global ini_name z-%{pecl_name}.ini @@ -39,8 +38,8 @@ Name: %{?scl_prefix}php-pecl-apm Summary: Alternative PHP Monitor -Version: 2.0.0 -Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Version: 2.0.2 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} Source0: http://pecl.php.net/get/%{proj_name}-%{version}.tgz # Webserver configuration files @@ -109,68 +108,28 @@ them to one of his drivers: * MariaDB/MySQL drivers are storing those in a database. %endif +NOTICE: the extension is disable, apm.ini configuration file needs to be edited. + The optional %{?scl_prefix}apm-web package provides the web application. Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection}. -%package -n %{?scl_prefix}apm-web -Summary: Alternative PHP Monitor web application -Group: Applications/Internet -%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6 -BuildArch: noarch -%endif -%if %{with_phpfpm} -Requires: webserver -Requires: nginx-filesystem -Requires: httpd-filesystem -Requires: php(httpd) -%else -Requires: httpd -Requires: mod_php -%endif -# From phpcompatinfo report -Requires: %{?scl_prefix}php-date -Requires: %{?scl_prefix}php-json -Requires: %{?scl_prefix}php-pcre -Requires: %{?scl_prefix}php-pdo - - -%description -n %{?scl_prefix}apm-web -This package provides the APM (Alternative PHP Monitor) web -application, with Apache%{?with_phpfpm: and Nginx} configuration, -available on http://localhost/%{?scl_prefix}apm-web/ - -The optional %{?scl_prefix}php-pecl-apm package provides the extension. - - %prep %setup -qc mv %{proj_name}-%{version} NTS -# Don't install/register tests -# https://github.com/patrickallaert/php-apm/issues/12 -sed -e 's/role="test"/role="src"/' \ - -e 's/role="data"/role="src"/' \ - -e 's/role="php"/role="src"/' \ - -i package.xml - cd NTS -# https://github.com/patrickallaert/php-apm/issues/11 -sed -e '/APM_VERSION/s/1.2.0alpha1/%{version}/' -i apm.c -# Sanity check, really often broken -extver=$(sed -n '/#define APM_VERSION/{s/.* "//;s/".*$//;p}' apm.c) +: Sanity check, really often broken +extver=$(sed -n '/#define PHP_APM_VERSION/{s/.* "//;s/".*$//;p}' php_apm.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream extension version is ${extver}, expecting %{version}. exit 1 fi -: Fix configuration path -sed -e 's:"config/db.php":"%{_sysconfdir}/apm-web/db.php":' \ - -i web/model/repository.php : Disable the ext -sed -e 's/; apm.enabled="1"/apm.enabled="0"/' \ +sed -e 's/^extension=/; extension=/' \ -i apm.ini cd .. @@ -179,15 +138,6 @@ cd .. cp -pr NTS ZTS %endif -: Create webserver configuration files -sed -e 's:@ALIAS@:%{?scl_prefix}apm-web:g' \ - -e 's:@SHARE@:%{_datadir}:g' \ - %{SOURCE1} | tee %{name}.httpd - -sed -e 's:@ALIAS@:%{?scl_prefix}apm-web:g' \ - -e 's:@SHARE@:%{_datadir}:g' \ - %{SOURCE2} | tee %{name}.nginx - %build peclconf() { @@ -233,26 +183,6 @@ install -D -m 644 ZTS/apm.ini %{buildroot}%{php_ztsinidir}/%{ini_name} # Install the package XML file install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml -# Install the web application -mv NTS/web/config config - -install -d %{buildroot}%{_datadir} -cp -pr NTS/web %{buildroot}%{_datadir}/%{?scl_prefix}apm-web - -# Apache config -install -D -m 644 %{name}.httpd \ - %{buildroot}%{_root_sysconfdir}/httpd/conf.d/%{?scl_prefix}apm-web.conf - -# Nginx config -%if %{with_phpfpm} -install -Dpm 0644 %{name}.nginx \ - %{buildroot}/%{_root_sysconfdir}/nginx/default.d/%{?scl_prefix}apm-web.conf -%endif - -# Application config -install -D -m 644 -p config/db.php \ - %{buildroot}%{_sysconfdir}/apm-web/db.php - cd NTS for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{proj_name}/$i @@ -275,7 +205,7 @@ fi %if %{with_zts} cd ../ZTS : Minimal load test for ZTS extension -%{__ztsphp} --no-php-ini \ +%{__ztsphp} $opt \ $dep \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} @@ -318,21 +248,12 @@ fi %endif -%files -n %{?scl_prefix}apm-web -%defattr(-,root,root,-) -%{!?_licensedir:%global license %%doc} -%license NTS/LICENSE -# Need to restrict access, as it contains a clear password -%attr(750,root,apache) %dir %{_sysconfdir}/apm-web -%attr(640,root,apache) %config(noreplace) %{_sysconfdir}/apm-web/db.php -%{_datadir}/%{?scl_prefix}apm-web -%config(noreplace) %{_root_sysconfdir}/httpd/conf.d/%{?scl_prefix}apm-web.conf -%if %{with_phpfpm} -%config(noreplace) %{_root_sysconfdir}/nginx/default.d/%{?scl_prefix}apm-web.conf -%endif - - %changelog +* Tue Mar 10 2015 Remi Collet <remi@fedoraproject.org> - 2.0.2-1 +- Update to 2.0.2 +- drop sub package, apm-web is now a separate project +- enable ZTS extension + * Sat Feb 21 2015 Remi Collet <remi@fedoraproject.org> - 2.0.0-2 - add missing dependencies - drop dependency between extension and webapp |