6f38864
# remirepo/fedora spec file for php-pecl-rrd
f5522fa
#
c5b2fd3
# Copyright (c) 2011-2018 Remi Collet
f5522fa
# License: CC-BY-SA
6f38864
# http://creativecommons.org/licenses/by-sa/4.0/
f5522fa
#
f5522fa
# Please, preserve the changelog entries
f5522fa
#
c5b2fd3
c5b2fd3
# we don't want -z defs linker flag
c5b2fd3
%undefine _strict_symbol_defs_build
c5b2fd3
1b813cb
%global with_zts  0%{?__ztsphp:1}
0684016
%global pecl_name rrd
2f7350b
%global ini_name  40-%{pecl_name}.ini
0684016
0684016
Summary:      PHP Bindings for rrdtool
0684016
Name:         php-pecl-rrd
2bbd210
Version:      2.0.1
030f49d
Release:      15%{?dist}
f42fb97
License:      BSD
0684016
URL:          http://pecl.php.net/package/rrd
0684016
bb4e8fe
Source0:      http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
bb4e8fe
2bbd210
BuildRequires: php-devel > 7
0684016
BuildRequires: rrdtool
6f38864
BuildRequires: pkgconfig(librrd) >= 1.3.0
0684016
BuildRequires: php-pear
0684016
0684016
Requires:     php(zend-abi) = %{php_zend_api}
0684016
Requires:     php(api) = %{php_core_api}
0684016
99afd0a
Conflicts:    rrdtool-php
a21b488
Provides:     php-pecl(%{pecl_name})         = %{version}
99afd0a
Provides:     php-pecl(%{pecl_name})%{?_isa} = %{version}
a21b488
Provides:     php-%{pecl_name}               = %{version}%{?pre}
a21b488
Provides:     php-%{pecl_name}%{?_isa}       = %{version}%{?pre}
99afd0a
0684016
0684016
%description
0684016
Procedural and simple OO wrapper for rrdtool - data logging and graphing
0684016
system for time series data.
0684016
0684016
0684016
%prep 
0684016
%setup -c -q
0684016
1b813cb
mv %{pecl_name}-%{version} NTS
bb4e8fe
a21b488
# Don't install/register tests
a21b488
sed -e 's/role="test"/role="src"/' \
a21b488
    -e '/LICENSE/s/role="doc"/role="src"/' \
a21b488
    -i package.xml
a21b488
2f7350b
cat > %{ini_name} << 'EOF'
f42fb97
; Enable %{pecl_name} extension module
f42fb97
extension=%{pecl_name}.so
f42fb97
EOF
f42fb97
1b813cb
%if %{with_zts}
1b813cb
cp -r  NTS ZTS
1b813cb
%endif
1b813cb
0684016
0684016
%build
1b813cb
cd NTS
1b813cb
%{_bindir}/phpize
1b813cb
%configure --with-php-config=%{_bindir}/php-config
1b813cb
make %{?_smp_mflags}
0684016
1b813cb
%if %{with_zts}
1b813cb
cd ../ZTS
1b813cb
%{_bindir}/zts-phpize
1b813cb
%configure --with-php-config=%{_bindir}/zts-php-config
0684016
make %{?_smp_mflags}
1b813cb
%endif
0684016
0684016
0684016
%install
1b813cb
make install -C NTS INSTALL_ROOT=%{buildroot}
0684016
0684016
# Drop in the bit of configuration
2f7350b
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
0684016
0684016
# Install XML package description
f42fb97
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
0684016
1b813cb
%if %{with_zts}
1b813cb
make install -C ZTS INSTALL_ROOT=%{buildroot}
2f7350b
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
1b813cb
%endif
1b813cb
1b813cb
# Test & Documentation
1b813cb
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
1b813cb
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
1b813cb
done
1b813cb
0684016
0684016
%check
1b813cb
%if %{with_zts}
1b813cb
%{__ztsphp} --no-php-ini \
1b813cb
    --define extension=ZTS/modules/%{pecl_name}.so \
1b813cb
    --modules | grep %{pecl_name}
1b813cb
%endif
1b813cb
1b813cb
cd NTS
1b813cb
%{__php} --no-php-ini \
1b813cb
    --define extension=modules/%{pecl_name}.so \
0684016
    --modules | grep %{pecl_name}
0684016
8c326d7
# See https://bugzilla.redhat.com/1224530 - segfault on ARM
8c326d7
%ifnarch %{arm}
6f38864
if pkg-config librrd --atleast-version=1.5.0
6f38864
then
6f38864
  : ignore test failed with rrdtool > 1.5
6f38864
  rm tests/rrd_{016,017}.phpt
6f38864
fi
6f38864
if ! pkg-config librrd --atleast-version=1.4.0
6f38864
then
6f38864
  : ignore test failed with rrdtool < 1.4
6f38864
  rm tests/rrd_{012,017}.phpt
6f38864
fi
1b813cb
0684016
make -C tests/data clean
0684016
make -C tests/data all
99afd0a
8c326d7
TEST_PHP_EXECUTABLE=%{_bindir}/php \
8c326d7
TEST_PHP_ARGS="-n -d extension_dir= -d extension=$PWD/modules/%{pecl_name}.so" \
8c326d7
NO_INTERACTION=1 \
8c326d7
REPORT_EXIT_STATUS=1 \
8c326d7
%{_bindir}/php -n run-tests.php --show-diff
8c326d7
%endif
0684016
0684016
0684016
%files
a21b488
%license NTS/LICENSE
1b813cb
%doc %{pecl_docdir}/%{pecl_name}
a21b488
%{pecl_xmldir}/%{name}.xml
a21b488
2f7350b
%config(noreplace) %{php_inidir}/%{ini_name}
0684016
%{php_extdir}/%{pecl_name}.so
0684016
1b813cb
%if %{with_zts}
2f7350b
%config(noreplace) %{php_ztsinidir}/%{ini_name}
1b813cb
%{php_ztsextdir}/%{pecl_name}.so
1b813cb
%endif
1b813cb
0684016
0684016
%changelog
030f49d
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-15
030f49d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
030f49d
a4645bf
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-14
a4645bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a4645bf
4486b4b
* Thu Oct 03 2019 Remi Collet <remi@remirepo.net> - 2.0.1-13
4486b4b
- rebuild for https://fedoraproject.org/wiki/Changes/php74
4486b4b
9e98b90
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-12
9e98b90
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
9e98b90
650246a
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-11
650246a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
650246a
72a314c
* Thu Oct 11 2018 Remi Collet <remi@remirepo.net> - 2.0.1-10
72a314c
- Rebuild for https://fedoraproject.org/wiki/Changes/php73
72a314c
069dc7b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-9
069dc7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
069dc7b
1f0ea55
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-8
1f0ea55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1f0ea55
c5b2fd3
* Mon Jan 29 2018 Remi Collet <remi@remirepo.net> - 2.0.1-7
c5b2fd3
- undefine _strict_symbol_defs_build
c5b2fd3
8f53fb4
* Tue Oct 03 2017 Remi Collet <remi@fedoraproject.org> - 2.0.1-6
8f53fb4
- rebuild for https://fedoraproject.org/wiki/Changes/php72
8f53fb4
f7557c5
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-5
f7557c5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
f7557c5
70a00bb
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-4
70a00bb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
70a00bb
ff415a2
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-3
ff415a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ff415a2
6233a70
* Mon Nov 14 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-2
6233a70
- rebuild for https://fedoraproject.org/wiki/Changes/php71
6233a70
2bbd210
* Mon Jun 27 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
2bbd210
- update to 2.0.1
2bbd210
a21b488
* Thu Apr 28 2016 Remi Collet <remi@fedoraproject.org> - 1.1.3-10
a21b488
- rebuild for new rrdtool
a21b488
- fix license management
a21b488
- don't provide the test suite
a21b488
0aec283
* Sat Feb 13 2016 Remi Collet <remi@fedoraproject.org> - 1.1.3-9
0aec283
- drop scriptlets (replaced by file triggers in php-pear)
0aec283
- cleanup
0aec283
eb51e70
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-8
eb51e70
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
eb51e70
8af21c9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-7
8af21c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
8af21c9
6f38864
* Sun May 24 2015 Remi Collet <remi@fedoraproject.org> - 1.1.3-6
6f38864
- ignore failed tests with rrdtool 1.5
6f38864
  FTBFS detected by Koschei, reported upstream
8c326d7
- skip test suite on arm
6f38864
14f944c
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-5
14f944c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
14f944c
c776828
* Thu Jun 19 2014 Remi Collet <rcollet@redhat.com> - 1.1.3-4
c776828
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
c776828
64fab00
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-3
64fab00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
64fab00
2f7350b
* Thu Apr 24 2014 Remi Collet <rcollet@redhat.com> - 1.1.3-2
2f7350b
- add numerical prefix to extension configuration file
2f7350b
04aca47
* Wed Jan 15 2014 Remi Collet <remi@fedoraproject.org> - 1.1.3-1
04aca47
- Update to 1.1.3 (stable)
04aca47
- drop merged patch
04aca47
1b813cb
* Tue Jan 14 2014 Remi Collet <remi@fedoraproject.org> - 1.1.2-1
1b813cb
- Update to 1.1.2 (stable)
1b813cb
- install doc in pecl doc_dir
1b813cb
- install tests in pecl test_dir
1b813cb
- add conditional build of ZTS extension
1b813cb
bb4e8fe
* Mon Sep 09 2013 Remi Collet <remi@fedoraproject.org> - 1.1.1-2
bb4e8fe
- patch for build warning
bb4e8fe
- patch to fix test result with recent rrdtool
bb4e8fe
f5522fa
* Mon Sep 09 2013 Remi Collet <remi@fedoraproject.org> - 1.1.1-1
f5522fa
- Update to 1.1.1
f5522fa
70ba1d3
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-4
70ba1d3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
70ba1d3
Remi Collet 76be267
* Fri Mar 22 2013 Remi Collet <rcollet@redhat.com> - 1.1.0-3
Remi Collet 76be267
- rebuild for http://fedoraproject.org/wiki/Features/Php55
Remi Collet 76be267
8f8dd7b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
8f8dd7b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
8f8dd7b
99afd0a
* Sun Aug 12 2012 Remi Collet <remi@fedoraproject.org> - 1.1.0-1
99afd0a
- Version 1.1.0 (stable), api 1.1.0 (stable)
99afd0a
4227b66
* Tue Jul 31 2012 Remi Collet <remi@fedoraproject.org> - 1.0.5-4
4227b66
- ignore test results (fails with rrdtool 1.4.7)
4227b66
2f83dfb
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-4
2f83dfb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2f83dfb
d925144
* Thu Jan 19 2012 Remi Collet <remi@fedoraproject.org> - 1.0.5-3
d925144
- build against php 5.4
d925144
0a7cdbf
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-2
0a7cdbf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
0a7cdbf
f42fb97
* Fri Nov 18 2011 Remi Collet <remi@fedoraproject.org> 1.0.5-1
f42fb97
- update to 1.0.5
f42fb97
- change license from PHP to BSD
f42fb97
9a3a290
* Tue Aug 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.4-1
9a3a290
- Version 1.0.4 (stable) - API 1.0.4 (stable)
9a3a290
- fix filters
9a3a290
0684016
* Fri Apr 29 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.3-1
0684016
- Version 1.0.3 (stable) - API 1.0.3 (stable)
0684016
- no change in sources
0684016
0684016
* Wed Apr 20 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.2-1
0684016
- Version 1.0.2 (stable) - API 1.0.2 (stable)
0684016
- no change in sources
0684016
0684016
* Sat Apr 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.1-1
0684016
- Version 1.0.1 (stable) - API 1.0.1 (stable)
0684016
- no change in sources
0684016
- remove generated Changelog (only latest version, no real value)
0684016
0684016
* Tue Apr 12 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.0-1
0684016
- Version 1.0.0 (stable) - API 1.0.0 (stable)
0684016
- remove all patches merged by upstream
0684016
0684016
* Sat Mar 05 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10.0-2
0684016
- improved patches
0684016
- implement rrd_strversion
0684016
0684016
* Fri Mar 04 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10.0-1
0684016
- Version 0.10.0 (stable) - API 0.10.0 (beta)
0684016
- remove patches, merged upstream
0684016
- add links to 5 new upstream bugs
0684016
0684016
* Mon Jan 03 2011 Remi Collet <Fedora@FamilleCollet.com> 0.9.0-1
0684016
- Version 0.9.0 (beta) - API 0.9.0 (beta)
0684016
- initial RPM
0684016