df7b309
#
1c84ddd
# Fedora spec file for php-pdepend-PHP-Depend
1c84ddd
#
1c84ddd
# License: MIT
1c84ddd
# http://opensource.org/licenses/MIT
1c84ddd
#
1c84ddd
# Please, preserve the changelog entries
1c84ddd
#
50fb785
%global gh_commit    da3166a06b4a89915920a42444f707122a1584c9
1c84ddd
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
1c84ddd
%global gh_owner     pdepend
1c84ddd
%global gh_project   pdepend
1c84ddd
%{!?__pear: %global __pear %{_bindir}/pear}
1c84ddd
%global pear_name    PHP_Depend
1c84ddd
%global pear_channel pear.pdepend.org
1c84ddd
%global php_home     %{_datadir}/php/PDepend
1c84ddd
%global with_tests   0%{!?_without_tests:1}
4c7b55a
b8e3d83
%global sym_pref php-symfony4
b8e3d83
%global sym_path %{_datadir}/php/Symfony4
f3e7e89
4c7b55a
Name:           php-pdepend-PHP-Depend
50fb785
Version:        2.10.3
50fb785
Release:        1%{?dist}
4c7b55a
Summary:        PHP_Depend design quality metrics for PHP package
4c7b55a
4c7b55a
License:        BSD
1c84ddd
URL:            http://pdepend.org/
1c84ddd
# git snashop to get upstream test suite
1c84ddd
Source0:        %{name}-%{version}-%{gh_short}.tgz
1c84ddd
Source1:        makesrc.sh
f3e7e89
1c84ddd
# Autoloader
1c84ddd
Patch0:         %{name}-rpm.patch
4c7b55a
4c7b55a
BuildArch:      noarch
1c84ddd
%if %{with_tests}
36f61f5
# From composer/json, "require-dev": {
fc0caa8
#        "phpunit/phpunit": "^4.8.36|^5.7.27",
36f61f5
#        "squizlabs/php_codesniffer": "^2.0.0"
fc0caa8
BuildRequires:  php-composer(phpunit/phpunit) >= 5.7.27
1c84ddd
BuildRequires:  php(language) >= 5.3.7
73a84f1
BuildRequires:  %{sym_pref}-dependency-injection
73a84f1
BuildRequires:  %{sym_pref}-filesystem
73a84f1
BuildRequires:  %{sym_pref}-config
1c84ddd
BuildRequires:  php-bcmath
1c84ddd
BuildRequires:  php-date
1c84ddd
BuildRequires:  php-dom
76f0e27
BuildRequires:  php-iconv
1c84ddd
BuildRequires:  php-libxml
76f0e27
BuildRequires:  php-mbstring
1c84ddd
BuildRequires:  php-pcre
1c84ddd
BuildRequires:  php-reflection
1c84ddd
BuildRequires:  php-simplexml
1c84ddd
BuildRequires:  php-spl
1c84ddd
BuildRequires:  php-tokenizer
76f0e27
BuildRequires:  php-xml
76f0e27
# Autoloader
d3f752a
BuildRequires:  php-composer(fedora/autoloader)
1c84ddd
%endif
1c84ddd
1c84ddd
# From composer.json, "require": {
1c84ddd
#        "php": ">=5.3.7"
50fb785
#        "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0",
50fb785
#        "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0",
50fb785
#        "symfony/config": "^2.3.0|^3|^4|^5|^6.0",
1c84ddd
Requires:       php(language) >= 5.3.7
73a84f1
Requires:       %{sym_pref}-dependency-injection
73a84f1
Requires:       %{sym_pref}-filesystem
73a84f1
Requires:       %{sym_pref}-config
76f0e27
# From phpcompatinfo report for version 2.3.0
1c84ddd
Requires:       php-bcmath
1c84ddd
Requires:       php-date
1c84ddd
Requires:       php-dom
76f0e27
Requires:       php-iconv
1c84ddd
Requires:       php-libxml
76f0e27
Requires:       php-mbstring
1c84ddd
Requires:       php-pcre
1c84ddd
Requires:       php-reflection
1c84ddd
Requires:       php-simplexml
1c84ddd
Requires:       php-spl
1c84ddd
Requires:       php-tokenizer
76f0e27
Requires:       php-xml
1c84ddd
# Autoloader
d3f752a
Requires:       php-composer(fedora/autoloader)
1c84ddd
1c84ddd
# Single package in this channel
1c84ddd
Obsoletes:      php-channel-pdepend <= 1.3
1c84ddd
1c84ddd
Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
1c84ddd
Provides:       php-composer(%{gh_owner}/%{gh_project}) = %{version}
6bcd0f9
Provides:       pdepend = %{version}
4c7b55a
4c7b55a
4c7b55a
%description
1c84ddd
PHP_Depend is an adaption of the established Java development tool JDepend.
1c84ddd
This tool shows you the quality of your design in the terms of extensibility,
1c84ddd
reusability and maintainability.
4c7b55a
4c7b55a
1c84ddd
%prep
1c84ddd
%setup -q -n %{gh_project}-%{gh_commit}
4c7b55a
1c84ddd
%patch0 -p0
f3e7e89
cat << 'EOF' | tee src/main/php/PDepend/autoload.php
f3e7e89
f3e7e89
/* Autoloader for %{name} and its dependencies */
f3e7e89
f3e7e89
require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
f3e7e89
\Fedora\Autoloader\Autoload::addPsr4('PDepend\\', __DIR__);
f3e7e89
\Fedora\Autoloader\Dependencies::required([
f3e7e89
    '%{sym_path}/Component/DependencyInjection/autoload.php',
f3e7e89
    '%{sym_path}/Component/Filesystem/autoload.php',
f3e7e89
    '%{sym_path}/Component/Config/autoload.php',
f3e7e89
]);
f3e7e89
EOF
4c7b55a
1c84ddd
find src/main/php -name \*php -exec sed -e 's:@package_version@:%{version}:' -i {} \;
1c84ddd
find src/test/php -name \*xml -exec sed -e 's:@package_version@:%{version}:' -i {} \;
4c7b55a
4c7b55a
1c84ddd
%build
1c84ddd
# Empty build section, most likely nothing required.
4c7b55a
4c7b55a
1c84ddd
%install
1c84ddd
: Library
1c84ddd
mkdir -p $(dirname %{buildroot}%{php_home})
1c84ddd
cp -pr src/main/php/PDepend %{buildroot}%{php_home}
1c84ddd
1c84ddd
: Resources
1c84ddd
mkdir -p %{buildroot}%{_datadir}/%{name}
1c84ddd
cp -pr src/main/resources %{buildroot}%{_datadir}/%{name}/resources
1c84ddd
1c84ddd
: Command
1c84ddd
install -Dpm 0755 src/bin/pdepend %{buildroot}%{_bindir}/pdepend
1c84ddd
1c84ddd
1c84ddd
%check
1c84ddd
%if %{with_tests}
df7b309
cat << 'EOF' | tee src/test/php/PDepend/bootstrap.php
1c84ddd
1c84ddd
require '%{buildroot}%{php_home}/autoload.php';
d3f752a
\Fedora\Autoloader\Autoload::addPsr4('PDepend\\', __DIR__);
1c84ddd
EOF
1c84ddd
1af9978
# testBinCanReadInput rely on git layout
99a2c17
ret=0
155c757
for cmd in php php74 php80 php81; do
99a2c17
  if which $cmd; then
b8e3d83
    $cmd %{_bindir}/phpunit -d memory_limit=1G \
b8e3d83
      --no-coverage \
1af9978
      --filter '^((?!(testBinCanReadInput)).)*$' \
b8e3d83
      --verbose || ret=1
99a2c17
  fi
99a2c17
done
99a2c17
exit $ret
1c84ddd
%else
1c84ddd
: Test suite disabled
1c84ddd
%endif
1c84ddd
1c84ddd
1c84ddd
%pre
1c84ddd
if [ -x %{_bindir}/pear ]; then
1c84ddd
   %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
1c84ddd
      %{pear_channel}/%{pear_name} >/dev/null || :
4c7b55a
fi
4c7b55a
4c7b55a
4c7b55a
%files
1c84ddd
%license LICENSE
1c84ddd
%doc composer.json
73a84f1
%doc CHANGELOG.md
1c84ddd
%{php_home}
1c84ddd
%{_datadir}/%{name}
4c7b55a
%{_bindir}/pdepend
1c84ddd
4c7b55a
4c7b55a
%changelog
50fb785
* Wed Feb 23 2022 Remi Collet <remi@remirepo.net> - 2.10.3-1
50fb785
- update to 2.10.3
50fb785
67fee6f
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.10.2-2
67fee6f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
67fee6f
155c757
* Wed Nov 17 2021 Remi Collet <remi@remirepo.net> - 2.10.2-1
155c757
- update to 2.10.2
155c757
99c4bb8
* Mon Oct 11 2021 Remi Collet <remi@remirepo.net> - 2.10.1-1
99c4bb8
- update to 2.10.1
99c4bb8
47779c6
* Thu Jul 22 2021 Remi Collet <remi@remirepo.net> - 2.10.0-1
47779c6
- update to 2.10.0
47779c6
db4a437
* Fri Apr 16 2021 Remi Collet <remi@remirepo.net> - 2.9.1-1
db4a437
- update to 2.9.1
db4a437
fc0caa8
* Thu Mar 11 2021 Remi Collet <remi@remirepo.net> - 2.9.0-1
fc0caa8
- update to 2.9.0
fc0caa8
8aa9d28
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-3
8aa9d28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
8aa9d28
4c1a44d
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.0-2
4c1a44d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
4c1a44d
163e039
* Tue Jun 23 2020 Remi Collet <remi@remirepo.net> - 2.8.0-1
163e039
- update to 2.8.0
163e039
02137ec
* Thu Feb 13 2020 Remi Collet <remi@remirepo.net> - 2.7.1-1
02137ec
- update to 2.7.1
02137ec
ba99954
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
ba99954
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
ba99954
1af9978
* Mon Jan 27 2020 Remi Collet <remi@remirepo.net> - 2.7.0-1
1af9978
- update to 2.7.0
1af9978
b8e3d83
* Fri Jan  3 2020 Remi Collet <remi@remirepo.net> - 2.6.1-1
b8e3d83
- update to 2.6.1
b8e3d83
1ebecdf
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-6
1ebecdf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
1ebecdf
7052b2c
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-5
7052b2c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
7052b2c
0cf162b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-4
0cf162b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0cf162b
6371055
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-3
6371055
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
6371055
f13dc4d
* Wed Dec 13 2017 Remi Collet <remi@remirepo.net> - 2.5.2-2
f13dc4d
- Update to 2.5.2 (new sources)
f13dc4d
73a84f1
* Wed Dec 13 2017 Remi Collet <remi@remirepo.net> - 2.5.2-1
73a84f1
- Update to 2.5.2
73a84f1
- switch to symfony package names
73a84f1
- open https://github.com/pdepend/pdepend/issues/357 missing changelog
73a84f1
499b4c5
* Tue Nov 21 2017 Remi Collet <remi@remirepo.net> - 2.5.1-1
499b4c5
- Update to 2.5.1
499b4c5
- open https://github.com/pdepend/pdepend/issues/337 missing changelog
499b4c5
6bcd0f9
* Wed Nov  1 2017 Remi Collet <remi@fedoraproject.org> - 2.5.0-5
6bcd0f9
- fix FTBFS from Koschei, add patch for PHP 7.2 from
6bcd0f9
  https://github.com/pdepend/pdepend/pull/303
6bcd0f9
- provide pdepend
f3e7e89
- allow only a symfony version
6bcd0f9
9d75ad2
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-4
9d75ad2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
9d75ad2
99a2c17
* Wed May 10 2017 Remi Collet <remi@fedoraproject.org> - 2.5.0-3
99a2c17
- adapt for Symfony v3
99a2c17
1270ead
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-2
1270ead
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1270ead
86838ab
* Thu Jan 19 2017 Remi Collet <remi@fedoraproject.org> - 2.5.0-1
86838ab
- update to 2.5.0
86838ab
4c9986a
* Wed Jan 11 2017 Remi Collet <remi@fedoraproject.org> - 2.4.1-1
4c9986a
- update to 2.4.1
4c9986a
baa7d33
* Tue Jan 10 2017 Remi Collet <remi@fedoraproject.org> - 2.4.0-1
baa7d33
- update to 2.4.0
baa7d33
411177e
* Thu Nov 24 2016 Remi Collet <remi@fedoraproject.org> - 2.3.2-1
411177e
- update to 2.3.2
411177e
76f0e27
* Wed Nov 23 2016 Remi Collet <remi@fedoraproject.org> - 2.3.0-1
76f0e27
- update to 2.3.0
76f0e27
- add dependency on iconv, mbstring and xml
76f0e27
d3f752a
* Tue Nov 22 2016 Remi Collet <remi@fedoraproject.org> - 2.2.6-1
d3f752a
- update to 2.2.6
d3f752a
- switch to fedora/autoloader
d3f752a
9b78e72
* Thu Mar 10 2016 Remi Collet <remi@fedoraproject.org> - 2.2.4-1
9b78e72
- update to 2.2.4
9b78e72
df7b309
* Tue Feb 23 2016 Remi Collet <remi@fedoraproject.org> - 2.2.3-1
df7b309
- update to 2.2.3
df7b309
462bfc8
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.2-2
462bfc8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
462bfc8
cc7a34e
* Fri Oct 16 2015 Remi Collet <remi@fedoraproject.org> - 2.2.2-1
cc7a34e
- update to 2.2.2
cc7a34e
36f61f5
* Fri Sep 25 2015 Remi Collet <remi@fedoraproject.org> - 2.2.1-1
36f61f5
- update to 2.2.1
36f61f5
9c9a923
* Mon Sep 21 2015 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
9c9a923
- update to 2.2.0
9c9a923
1c84ddd
* Mon Jul 13 2015 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
1c84ddd
- update to 2.1.0
1c84ddd
- switch from pear channel to git snapshot sources
1c84ddd
- run upstream test suite during build
1c84ddd
8b935e9
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-3
8b935e9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
8b935e9
135d3ba
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-2
135d3ba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
135d3ba
Christof Damian ca86af1
* Sat Nov 16 2013 Christof Damian <christof@damian.net> - 1.1.2-1
Christof Damian ca86af1
- upstream 1.1.2
Christof Damian ca86af1
Christof Damian cba3c06
* Mon Aug  5 2013 Christof Damian <christof@damian.net> - 1.1.1-2
Christof Damian cba3c06
- explicit requires from Remi
Christof Damian cba3c06
- use tar -i for broken source
Christof Damian cba3c06
8574e04
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-4
8574e04
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8574e04
Christof Damian d5c4c9f
* Tue Jul 30 2013 Christof Damian <christof@damian.net> - 1.1.1-1
Christof Damian d5c4c9f
- upstream 1.1.1
Christof Damian d5c4c9f
Christof Damian a6e556e
* Sat Feb 23 2013 Christof Damian <christof@damian.net> - 1.1.0-3
Christof Damian a6e556e
- use pear_metadir FTBFS 914350
Christof Damian a6e556e
2f81324
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
2f81324
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2f81324
Christof Damian 8674ef9
* Wed Sep 12 2012 Christof Damian <christof@damian.net> - 1.1.0-1
Christof Damian 8674ef9
- upstream 1.1.0
Christof Damian 8674ef9
5dcb03b
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-2
5dcb03b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
5dcb03b
Christof Damian d950dab
* Tue May  1 2012 Christof Damian <christof@damian.net> - 1.0.7-1
Christof Damian d950dab
- upstream 1.0.7
Christof Damian d950dab
Christof Damian d2c06b2
* Wed Apr 11 2012 Christof Damian <christof@damian.net> - 1.0.5-1
Christof Damian d2c06b2
- upstream 1.0.5
Christof Damian d2c06b2
Christof Damian 43d447a
* Fri Mar  2 2012 Christof Damian <christof@damian.net> - 1.0.4-1
Christof Damian 43d447a
- upstream 1.0.4
Christof Damian 43d447a
Christof Damian bd1418c
* Thu Feb  9 2012 Christof Damian <christof@damian.net> - 1.0.1-1
Christof Damian bd1418c
- upstream 1.0.1
Christof Damian bd1418c
845a0fd
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.6-2
845a0fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
845a0fd
Christof Damian 6d7d6fe
* Sun Oct 30 2011 Christof Damian <christof@damian.net> - 0.10.6-1
Christof Damian 6d7d6fe
- upstream 0.10.6
Christof Damian 6d7d6fe
Christof Damian ba1263e
* Fri May 20 2011 Christof Damian <christof@damian.net> - 0.10.5-1
Christof Damian ba1263e
- upstream 0.10.5
Christof Damian ba1263e
Christof Damian b0150fb
* Fri Mar  4 2011 Christof Damian <christof@damian.net> - 0.10.3-1
Christof Damian b0150fb
- upstream 0.10.3
Christof Damian b0150fb
Christof Damian bb313ce
* Mon Feb 28 2011 Christof Damian <cdamian@robin.gotham.krass.com> - 0.10.2-1
Christof Damian bb313ce
- upstream 0.10.2
Christof Damian bb313ce
17f578e
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-2
17f578e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
17f578e
Christof Damian a0e9c48
* Sun Feb  6 2011 Christof Damian <christof@damian.net> - 0.10.1-1
Christof Damian a0e9c48
- upstream stable release 0.10.1 
Christof Damian a0e9c48
Christof Damian dab3329
* Fri Sep 17 2010 Christof Damian <christof@damian.net> - 0.9.19-1
Christof Damian dab3329
- upstream 0.9.19
Christof Damian dab3329
Christof Damian 4b8db9d
* Fri Sep  3 2010 Christof Damian <christof@damian.net> - 0.9.18-1
Christof Damian 4b8db9d
- upstream 0.9.18
Christof Damian 4b8db9d
Christof Damian a5849eb
* Fri Jul 30 2010 Christof Damian <christof@damian.net> - 0.9.17-1
Christof Damian a5849eb
- upstream 0.9.17
Christof Damian a5849eb
101c80d
* Sun Jun 20 2010 Christof Damian <christof@damian.net> - 0.9.16-1
101c80d
- upstream 0.9.16: bugfixes
101c80d
5fe8359
* Sat May 22 2010 Christof Damian <christof@damian.net> - 0.9.14-1
5fe8359
- upstream 0.9.14
5fe8359
8b7e737
* Mon May 10 2010 Christof Damian <christof@damian.net> - 0.9.13-1
8b7e737
- upstream 0.9.13 important bugfixes
8b7e737
0fe3a33
* Tue Apr 27 2010 Christof Damian <christof@damian.net> - 0.9.12-1
0fe3a33
- upstream 0.9.12
0fe3a33
- upstream removed all tests
0fe3a33
dcc156e
* Wed Mar  3 2010 Christof Damian <christof@damian.net> - 0.9.11-1
dcc156e
- upstream 0.9.11
dcc156e
5b25753
* Tue Feb 23 2010 Christof Damian <christof@damian.net> - 0.9.10-1
5b25753
- upstream 0.9.10
5b25753
- replaced define macro with global
5b25753
4c7b55a
* Tue Jan 26 2010 Christof Damian <christof@damian.net> 0.9.9-2
4c7b55a
- require pecl imagick, which is an optional requirement
4c7b55a
- require php-xml for dom
4c7b55a
- change postun to use channel macro for consistency
4c7b55a
- own /usr/share/pear/PHP
4c7b55a
- include test files (which currently don't work)
4c7b55a
4c7b55a
* Fri Jan 1 2010 Christof Damian <christof@damian.net> 0.9.9-1
4c7b55a
- initial release