summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-03-17 08:52:01 +0100
committerRemi Collet <fedora@famillecollet.com>2014-03-17 08:52:01 +0100
commit69a4c5cd24b3ac71140ca6bb3a2eadaba15f137c (patch)
tree8957a6d8ea3e92425b886823f95b68b834080ca8
parentd645ac6edc8ad056329c3368b0d3dfb85b49b074 (diff)
php-pecl-haru: cleanups, doc in pecl_docdir
-rw-r--r--php-pecl-haru.spec96
1 files changed, 63 insertions, 33 deletions
diff --git a/php-pecl-haru.spec b/php-pecl-haru.spec
index 4da24d4..e8a1c07 100644
--- a/php-pecl-haru.spec
+++ b/php-pecl-haru.spec
@@ -1,12 +1,23 @@
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
-%global pecl_name haru
+# spec file for php-pecl-haru
+#
+# Copyright (c) 2012-2014 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/3.0/
+#
+# Please, preserve the changelog entries
+#
+%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
+%{!?__pecl: %global __pecl %{_bindir}/pecl}
+%{!?__php: %global __php %{_bindir}/php}
+
+%global pecl_name haru
+%global with_zts 0%{?__ztsphp:1}
Summary: Haru PDF functions
Name: php-pecl-haru
Version: 1.0.4
-Release: 1%{?dist}.2
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-# https://bugs.php.net/60958 - Please Provides LICENSE file
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/haru
@@ -31,7 +42,24 @@ Provides: php-%{pecl_name}%{?_isa} = %{version}
Provides: php-pecl(%{pecl_name}) = %{version}
Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
+%if "%{?vendor}" == "Remi Collet"
+# Other third party repo stuff
+Obsoletes: php53-pecl-%{pecl_name}
+Obsoletes: php53u-pecl-%{pecl_name}
+Obsoletes: php54-pecl-%{pecl_name}
+%if "%{php_version}" > "5.5"
+Obsoletes: php55u-pecl-%{pecl_name}
+%endif
+%if "%{php_version}" > "5.6"
+Obsoletes: php56u-pecl-%{pecl_name}
+%endif
+%endif
+
+%if 0%{?fedora} < 20
+# Filter shared private
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
+%endif
%description
@@ -45,6 +73,7 @@ Documentation : http://www.php.net/haru
%prep
%setup -c -q
+mv %{pecl_name}-%{version} NTS
# Create configuration file
cat >%{pecl_name}.ini << 'EOF'
@@ -53,30 +82,30 @@ extension=%{pecl_name}.so
EOF
# Check extension version
-extver=$(sed -n '/#define PHP_HARU_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_haru.h)
+extver=$(sed -n '/#define PHP_HARU_VERSION/{s/.* "//;s/".*$//;p}' NTS/php_haru.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}.
exit 1
fi
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
# Build ZTS extension if ZTS devel available (fedora >= 17)
-cp -r %{pecl_name}-%{version} %{pecl_name}-zts
+cp -r NTS ZTS
%endif
%build
export PHP_RPATH=no
-cd %{pecl_name}-%{version}
+cd NTS
%{_bindir}/phpize
%configure \
--with-libdir=%{_lib} \
--with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
-%if 0%{?__ztsphp:1}
-cd ../%{pecl_name}-zts
+%if %{with_zts}
+cd ../ZTS
%{_bindir}/zts-phpize
%configure \
--with-libdir=%{_lib} \
@@ -87,21 +116,25 @@ make %{?_smp_mflags}
%install
rm -rf %{buildroot}
-make install -C %{pecl_name}-%{version} \
- INSTALL_ROOT=%{buildroot}
-
-%if 0%{?__ztsphp:1}
-make install -C %{pecl_name}-zts \
- INSTALL_ROOT=%{buildroot}
+make install -C NTS INSTALL_ROOT=%{buildroot}
# Drop in the bit of configuration
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
+
+%if %{with_zts}
+make install -C ZTS INSTALL_ROOT=%{buildroot}
+
install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
%endif
-install -D -m 644 %{pecl_name}.ini %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini
# Install XML package description
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+# Test & Documentation
+for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+done
+
%clean
rm -rf %{buildroot}
@@ -118,40 +151,38 @@ fi
%check
-cd %{pecl_name}-%{version}
-
-# only check if build extension can be loaded
-php -n -q \
- -d extension_dir=modules \
- -d extension=%{pecl_name}.so \
+: Check if build NTS extension can be loaded
+%{__php} -n -q \
+ -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
-%if 0%{?__ztsphp:1}
-cd ../%{pecl_name}-zts
-
-# only check if build extension can be loaded
+%if %{with_zts}
+: Check if build ZTS extension can be loaded
%{__ztsphp} -n -q \
- -d extension_dir=modules \
- -d extension=%{pecl_name}.so \
+ -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
%endif
%files
%defattr(-, root, root, -)
-%doc %{pecl_name}-%{version}/CREDITS
+%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini
%{php_extdir}/%{pecl_name}.so
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
%{php_ztsextdir}/%{pecl_name}.so
%endif
%changelog
+* Mon Mar 17 2014 Remi Collet <remi@fedoraproject.org> - 1.0.4-2
+- cleanups
+- install doc in pecl_docdir
+
* Mon Dec 24 2012 Remi Collet <remi@fedoraproject.org> - 1.0.4-1
- update to 1.0.4
- also provides php-haru
@@ -162,5 +193,4 @@ cd ../%{pecl_name}-zts
* Thu Feb 02 2012 Remi Collet <remi@fedoraproject.org> - 1.0.3-1
- Initial RPM
- https://bugs.php.net/60958 - Please Provides LICENSE file
-- https://bugs.php.net/60959 - Version 1.0.3 reports as 1.0.1
-
+- https://bugs.php.net/60959 - Version 1.0.3 reports as 1.0.1 \ No newline at end of file