Blame SPECS/php-pecl-jsonc.spec

0763b5
# spec file for php-pecl-jsonc
0763b5
#
0763b5
# Copyright (c) 2013-2015 Remi Collet
0763b5
# License: CC-BY-SA
0763b5
# http://creativecommons.org/licenses/by-sa/3.0/
0763b5
#
0763b5
# Please, preserve the changelog entries
0763b5
#
0763b5
%{?scl:     %scl_package       php-pecl-jsonc}
0763b5
%{!?__pecl: %global __pecl     %{_bindir}/pecl}
0763b5
0763b5
%global pecl_name  json
0763b5
%global proj_name  jsonc
0763b5
%global with_zts   0%{?__ztsphp:1}
0763b5
0763b5
%if "%{php_version}" < "5.6"
0763b5
%global ini_name  %{pecl_name}.ini
0763b5
%else
0763b5
%global ini_name  40-%{pecl_name}.ini
0763b5
%endif
0763b5
0763b5
Summary:       Support for JSON serialization
0763b5
Name:          %{?scl_prefix}php-pecl-%{proj_name}
0763b5
Version:       1.3.6
0763b5
Release:       3%{?dist}
0763b5
License:       PHP
0763b5
Group:         Development/Languages
0763b5
URL:           http://pecl.php.net/package/%{proj_name}
0763b5
Source0:       http://pecl.php.net/get/%{proj_name}-%{version}.tgz
0763b5
0763b5
BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
0763b5
BuildRequires: %{?scl_prefix}php-devel >= 5.4
0763b5
BuildRequires: %{?scl_prefix}php-pear
0763b5
BuildRequires: pcre-devel
0763b5
0763b5
Requires:      %{?scl_prefix}php(zend-abi) = %{php_zend_api}
0763b5
Requires:      %{?scl_prefix}php(api) = %{php_core_api}
0763b5
0763b5
Provides:      %{?scl_prefix}php-%{pecl_name} = %{version}
0763b5
Provides:      %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
0763b5
Provides:      %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
0763b5
Provides:      %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
0763b5
Provides:      %{?scl_prefix}php-pecl(%{proj_name}) = %{version}
0763b5
Provides:      %{?scl_prefix}php-pecl(%{proj_name})%{?_isa} = %{version}
0763b5
Obsoletes:     %{?scl_prefix}php-pecl-json < 1.3.1-2
0763b5
Provides:      %{?scl_prefix}php-pecl-json = %{version}-%{release}
0763b5
Provides:      %{?scl_prefix}php-pecl-json%{?_isa} = %{version}-%{release}
0763b5
0763b5
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
0763b5
# Filter private shared
0763b5
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
0763b5
%{?filter_setup}
0763b5
%endif
0763b5
0763b5
0763b5
%description
0763b5
The %{name} module will add support for JSON (JavaScript Object Notation)
0763b5
serialization to PHP.
0763b5
0763b5
This is a dropin alternative to standard PHP JSON extension which
0763b5
use the json-c library parser.
0763b5
0763b5
0763b5
%package devel
0763b5
Summary:       JSON developer files (header)
0763b5
Group:         Development/Libraries
0763b5
Requires:      %{name}%{?_isa} = %{version}-%{release}
0763b5
Requires:      %{?scl_prefix}php-devel%{?_isa}
0763b5
0763b5
%description devel
0763b5
These are the files needed to compile programs using JSON serializer.
0763b5
0763b5
0763b5
%prep
0763b5
%setup -q -c 
0763b5
cd %{proj_name}-%{version}
0763b5
0763b5
# Sanity check, really often broken
0763b5
extver=$(sed -n '/#define PHP_JSON_VERSION/{s/.* "//;s/".*$//;p}' php_json.h )
0763b5
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
0763b5
   : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}.
0763b5
   exit 1
0763b5
fi
0763b5
cd ..
0763b5
0763b5
cat << 'EOF' | tee %{ini_name}
0763b5
; Enable %{pecl_name} extension module
0763b5
extension = %{pecl_name}.so
0763b5
EOF
0763b5
0763b5
%if %{with_zts}
0763b5
# duplicate for ZTS build
0763b5
cp -pr %{proj_name}-%{version} %{proj_name}-zts
0763b5
%endif
0763b5
0763b5
0763b5
%build
0763b5
cd %{proj_name}-%{version}
0763b5
%{_bindir}/phpize
0763b5
%configure \
0763b5
  --with-php-config=%{_bindir}/php-config
0763b5
make %{?_smp_mflags}
0763b5
0763b5
%if %{with_zts}
0763b5
cd ../%{proj_name}-zts
0763b5
%{_bindir}/zts-phpize
0763b5
%configure \
0763b5
  --with-php-config=%{_bindir}/zts-php-config
0763b5
make %{?_smp_mflags}
0763b5
%endif
0763b5
0763b5
0763b5
%install
0763b5
rm -rf %{buildroot}
0763b5
# Install the NTS stuff
0763b5
make -C %{proj_name}-%{version} \
0763b5
     install INSTALL_ROOT=%{buildroot}
0763b5
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
0763b5
%{?nfsmountable:install -D -m 644 %{ini_name} %{buildroot}%{_scl_scripts}/register.content%{php_inidir}/%{ini_name}}
0763b5
0763b5
%if %{with_zts}
0763b5
# Install the ZTS stuff
0763b5
make -C %{proj_name}-zts \
0763b5
     install INSTALL_ROOT=%{buildroot}
0763b5
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
0763b5
%{?nfsmountable:install -D -m 644 %{ini_name} %{buildroot}%{_scl_scripts}/register.content%{php_ztsinidir}/%{ini_name}}
0763b5
%endif
0763b5
0763b5
# Install the package XML file
0763b5
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
0763b5
0763b5
# Test & Documentation
0763b5
for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
0763b5
do install -Dpm 644 %{proj_name}-%{version}/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
0763b5
done
0763b5
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
0763b5
do install -Dpm 644 %{proj_name}-%{version}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
0763b5
done
0763b5
0763b5
0763b5
%check
0763b5
cd %{proj_name}-%{version}
0763b5
0763b5
: Minimal load test for NTS extension
0763b5
%{__php} --no-php-ini \
0763b5
    --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
0763b5
    -m | grep %{pecl_name}
0763b5
0763b5
%if %{with_zts}
0763b5
: Minimal load test for ZTS extension
0763b5
%{__ztsphp} --no-php-ini \
0763b5
    --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
0763b5
    -m | grep %{pecl_name}
0763b5
%endif
0763b5
0763b5
TEST_PHP_EXECUTABLE=%{_bindir}/php \
0763b5
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
0763b5
NO_INTERACTION=1 \
0763b5
REPORT_EXIT_STATUS=1 \
0763b5
%{_bindir}/php -n run-tests.php
0763b5
0763b5
%if %{with_zts}
0763b5
cd ../%{proj_name}-zts
0763b5
0763b5
TEST_PHP_EXECUTABLE=%{__ztsphp} \
0763b5
TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
0763b5
NO_INTERACTION=1 \
0763b5
REPORT_EXIT_STATUS=1 \
0763b5
%{__ztsphp} -n run-tests.php
0763b5
%endif
0763b5
0763b5
0763b5
# when pear installed alone, after us
0763b5
%triggerin -- %{?scl_prefix}php-pear
0763b5
if [ -x %{__pecl} ] ; then
0763b5
    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
0763b5
fi
0763b5
0763b5
# posttrans as pear can be installed after us
0763b5
%posttrans
0763b5
if [ -x %{__pecl} ] ; then
0763b5
    %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
0763b5
fi
0763b5
0763b5
%postun
0763b5
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
0763b5
    %{pecl_uninstall} %{proj_name} >/dev/null || :
0763b5
fi
0763b5
0763b5
0763b5
%clean
0763b5
rm -rf %{buildroot}
0763b5
0763b5
0763b5
%files
0763b5
%defattr(-,root,root,-)
0763b5
%doc %{pecl_docdir}/%{pecl_name}
0763b5
%{pecl_xmldir}/%{name}.xml
0763b5
0763b5
%config(noreplace) %{php_inidir}/%{ini_name}
0763b5
%{php_extdir}/%{pecl_name}.so
0763b5
%{?nfsmountable:%{_scl_scripts}/register.content/*}
0763b5
0763b5
%if %{with_zts}
0763b5
%config(noreplace) %{php_ztsinidir}/%{ini_name}
0763b5
%{php_ztsextdir}/%{pecl_name}.so
0763b5
%endif
0763b5
0763b5
0763b5
%files devel
0763b5
%defattr(-,root,root,-)
0763b5
%doc %{pecl_testdir}/%{pecl_name}
0763b5
0763b5
%{php_incldir}/ext/json
0763b5
0763b5
%if %{with_zts}
0763b5
%{php_ztsincldir}/ext/json
0763b5
%endif
0763b5
0763b5
0763b5
0763b5
%changelog
0763b5
* Mon Mar 16 2015 Remi Collet <rcollet@redhat.com> 1.3.6-3
0763b5
- rebuild to remove scls directory #1200056
0763b5
0763b5
* Mon Jan 26 2015 Remi Collet <rcollet@redhat.com> 1.3.6-2
0763b5
- add register.content
0763b5
0763b5
* Thu Jan 15 2015 Remi Collet <rcollet@redhat.com> 1.3.6-1
0763b5
- initial package for rh-php56 in RHSCL-2.0
0763b5
0763b5
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 1.3.6-2
0763b5
- new scriptlets
0763b5
0763b5
* Fri Aug  1 2014 Remi Collet <remi@fedoraproject.org> - 1.3.6-1
0763b5
- release 1.3.6 (stable, bugfix)
0763b5
0763b5
* Thu Apr 10 2014 Remi Collet <remi@fedoraproject.org> - 1.3.5-1.1
0763b5
- missing __sync_val_compare_and_swap_4 in el5 i386
0763b5
0763b5
* Thu Apr 10 2014 Remi Collet <remi@fedoraproject.org> - 1.3.5-1
0763b5
- release 1.3.5 (stable) - security
0763b5
0763b5
* Wed Apr  9 2014 Remi Collet <remi@fedoraproject.org> - 1.3.4-2
0763b5
- add numerical prefix to extension configuration file
0763b5
0763b5
* Sat Feb 22 2014 Remi Collet <rcollet@redhat.com> - 1.3.4-1
0763b5
- release 1.3.4 (stable)
0763b5
- move documentation in pecl_docdir
0763b5
- move tests in pecl_testdir (devel)
0763b5
0763b5
* Thu Dec 12 2013 Remi Collet <rcollet@redhat.com> - 1.3.3-1
0763b5
- release 1.3.3 (stable)
0763b5
0763b5
* Thu Sep 26 2013 Remi Collet <rcollet@redhat.com> - 1.3.2-2
0763b5
- fix decode of string value with null-byte
0763b5
0763b5
* Mon Sep  9 2013 Remi Collet <rcollet@redhat.com> - 1.3.2-1
0763b5
- release 1.3.2 (stable)
0763b5
0763b5
* Mon Jun 24 2013 Remi Collet <rcollet@redhat.com> - 1.3.1-2.el5.2
0763b5
- add metapackage "php-json" to fix upgrade issue (EL-5)
0763b5
0763b5
* Wed Jun 12 2013 Remi Collet <rcollet@redhat.com> - 1.3.1-2
0763b5
- rename to php-pecl-jsonc
0763b5
0763b5
* Wed Jun 12 2013 Remi Collet <rcollet@redhat.com> - 1.3.1-1
0763b5
- release 1.3.1 (beta)
0763b5
0763b5
* Tue Jun  4 2013 Remi Collet <rcollet@redhat.com> - 1.3.0-1
0763b5
- release 1.3.0 (beta)
0763b5
- use system json-c when available (fedora >= 20)
0763b5
- use jsonc name for module and configuration
0763b5
0763b5
* Mon Apr 29 2013 Remi Collet <rcollet@redhat.com> - 1.3.0-0.3
0763b5
- rebuild with latest changes
0763b5
- use system json-c library
0763b5
- temporarily rename to jsonc-c.so
0763b5
0763b5
* Sat Apr 27 2013 Remi Collet <rcollet@redhat.com> - 1.3.0-0.2
0763b5
- rebuild with latest changes
0763b5
0763b5
* Sat Apr 27 2013 Remi Collet <rcollet@redhat.com> - 1.3.0-0.1
0763b5
- initial package