From 00a558fd6e7df730676dac2329fd186768d6ce0e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 23 Feb 2014 08:27:56 +0100 Subject: php-pecl-dbus: 0.1.1 - New package --- php-pecl-dbus.spec | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 php-pecl-dbus.spec (limited to 'php-pecl-dbus.spec') diff --git a/php-pecl-dbus.spec b/php-pecl-dbus.spec new file mode 100644 index 0000000..dff2c34 --- /dev/null +++ b/php-pecl-dbus.spec @@ -0,0 +1,199 @@ +# spec file for php-pecl-dbus +# +# Copyright (c) 2014 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/3.0/ +# +# Please, preserve the changelog entries +# +%{?scl: %scl_package php-pecl-dbus} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} + +%global with_zts 0%{?__ztsphp:1} +%global pecl_name dbus + +Summary: Extension for interaction with DBUS busses +Name: %{?scl_prefix}php-pecl-%{pecl_name} +Version: 0.1.1 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +License: BSD +Group: Development/Languages +URL: http://pecl.php.net/package/%{pecl_name} +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz + +# Link from dbus.c header +Source1: http://www.php.net/license/3_01.txt + +# Fix RPATH added because of "pkg-config --libs dbus-1" +Patch0: %{pecl_name}-rpath.patch + +# http://svn.php.net/viewvc?view=revision&revision=332055 +# http://svn.php.net/viewvc?view=revision&revision=315794 +# http://svn.php.net/viewvc?view=revision&revision=314194 +Patch1: %{pecl_name}-svn.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: %{?scl_prefix}php-devel > 5.2 +BuildRequires: %{?scl_prefix}php-pear +BuildRequires: dbus-devel +BuildRequires: libxml2-devel + +Requires(post): %{__pecl} +Requires(postun): %{__pecl} +Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} +Requires: %{?scl_prefix}php(api) = %{php_core_api} + +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} + +%if 0%{!?scl:1} +# Other third party repo stuff +%if "%{php_version}" > "5.4" +Obsoletes: php53-pecl-%{pecl_name} +Obsoletes: php53u-pecl-%{pecl_name} +Obsoletes: php54-pecl-%{pecl_name} +%endif +%if "%{php_version}" > "5.5" +Obsoletes: php55u-pecl-%{pecl_name} +%endif +%endif + +%if 0%{?fedora} < 20 +# Filter shared private +%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} +%{?filter_setup} +%endif + + +%description +This extension allows you to talk to DBUS services on a system, +and also act as a DBUS service. + + +%prep +%setup -q -c +mv %{pecl_name}-%{version} NTS + +cd NTS +%patch0 -p1 -b .rpath +%patch1 -p3 -b .upstream + +cp %{SOURCE1} LICENSE + +# Fix version +sed -e '/PHP_DBUS_VERSION/s/0.1.0/%{version}/' -i php_dbus.h + +# Sanity check, really often broken +extver=$(sed -n '/#define PHP_DBUS_VERSION/{s/.* "//;s/".*$//;p}' php_dbus.h) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream extension version is ${extver}, expecting %{version}. + exit 1 +fi +cd .. + +%if %{with_zts} +# Duplicate source tree for NTS / ZTS build +cp -pr NTS ZTS +%endif + +# Create configuration file +cat > %{pecl_name}.ini << 'EOF' +; Enable %{pecl_name} extension module +extension=%{pecl_name}.so +EOF + + +%build +cd NTS +%{_bindir}/phpize +%configure \ + --with-libdir=%{_lib} \ + --with-php-config=%{_bindir}/php-config +make %{?_smp_mflags} + +%if %{with_zts} +cd ../ZTS +%{_bindir}/zts-phpize +%configure \ + --with-libdir=%{_lib} \ + --with-php-config=%{_bindir}/zts-php-config +make %{?_smp_mflags} +%endif + + +%install +rm -rf %{buildroot} + +make -C NTS \ + install INSTALL_ROOT=%{buildroot} + +# install config file +install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini + +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + +%if %{with_zts} +make -C ZTS \ + install INSTALL_ROOT=%{buildroot} + +install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini +%endif + +# Documentation +for i in LICENSE $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + + +%post +%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : + + +%postun +if [ $1 -eq 0 ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi + + +%check +cd NTS +: Minimal load test for NTS extension +%{__php} --no-php-ini \ + --define extension=modules/%{pecl_name}.so \ + --modules | grep %{pecl_name} + +%if %{with_zts} +cd ../ZTS +: Minimal load test for ZTS extension +%{__ztsphp} --no-php-ini \ + --define extension=modules/%{pecl_name}.so \ + --modules | grep %{pecl_name} +%endif + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%doc %{pecl_docdir}/%{pecl_name} +%{pecl_xmldir}/%{name}.xml +%config(noreplace) %{php_inidir}/%{pecl_name}.ini +%{php_extdir}/%{pecl_name}.so + +%if %{with_zts} +%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini +%{php_ztsextdir}/%{pecl_name}.so +%endif + + +%changelog +* Sun Feb 23 2014 Remi Collet - 0.1.1-1 +- initial package, version 0.1.1 (alpha) +- upstream patches from SVN \ No newline at end of file -- cgit