summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-bbcode.spec54
1 files changed, 35 insertions, 19 deletions
diff --git a/php-pecl-bbcode.spec b/php-pecl-bbcode.spec
index 133f9ad..2d40cad 100644
--- a/php-pecl-bbcode.spec
+++ b/php-pecl-bbcode.spec
@@ -7,9 +7,6 @@
# Please, preserve the changelog entries
#
%{?scl: %scl_package php-pecl-bbcode}
-%{!?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 bbcode
@@ -23,7 +20,7 @@
Summary: BBCode parsing Extension
Name: %{?scl_prefix}php-pecl-bbcode
Version: 1.0.3
-Release: 0.7.%{pre}%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 0.8.%{pre}%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
# pecl extension is PHP, bbcode2 is BSD, bstrlib (from bstring) is BSD
License: PHP and BSD
Group: Development/Languages
@@ -35,16 +32,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel >= 5.2.0
BuildRequires: %{?scl_prefix}php-pear
-Requires(post): %{__pecl}
-Requires(postun): %{__pecl}
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}%{?pre}
-Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}%{?pre}
-Provides: %{?scl_prefix}php-%{pecl_name} = %{version}%{?pre}
-Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}%{?pre}
+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}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
# Other third party repo stuff
@@ -87,6 +84,11 @@ Documentation: http://php.net/bbcode
mv %{pecl_name}-%{version}%{?pre} NTS
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' \
+ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -i package.xml
+
cd NTS
sed -i -e '/PHP_BBCODE_VERSION/s/1.1.0-dev/1.0.3b1/' php_bbcode.h
@@ -142,10 +144,7 @@ make -C ZTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
-# Test & Documentation
-for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
-done
+# 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
@@ -186,19 +185,29 @@ REPORT_EXIT_STATUS=1 \
rm -rf %{buildroot}
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+%if 0%{?fedora} < 24
+# when pear installed alone, after us
+%triggerin -- %{?scl_prefix}php-pear
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+# posttrans as pear can be installed after us
+%posttrans
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
%postun
-if [ $1 -eq 0 ] ; then
+if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
+%endif
%files
%defattr(-, root, root, -)
-%doc %{pecl_testdir}/%{pecl_name}
+%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -211,6 +220,12 @@ fi
%changelog
+* Tue Mar 8 2016 Remi Collet <remi@fedoraproject.org> - 1.0.3-0.8.b1
+- adapt for F24
+- don't install/register tests
+- drop runtime dependency on pear, new scriptlets
+- fix license management
+
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.0.3-0.7.b1
- Fedora 21 SCL mass rebuild
@@ -236,4 +251,5 @@ fi
- build against php 5.4
* Wed Oct 05 2011 Remi Collet <remi@fedoraproject.org> 1.0.3-0.1.b1
-- initial RPM \ No newline at end of file
+- initial RPM
+