Blob Blame History Raw
%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
%{!?__pear:       %global __pear %{_bindir}/pear}
%global pear_name Net_URL_Mapper

Name:           php-pear-Net-URL-Mapper
Version:        0.9.1
Release:        16%{?dist}
Summary:        Simple and flexible way to build nice URLs for web applications

Group:          Development/Languages
License:        BSD
URL:            http://pear.php.net/package/Net_URL_Mapper
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
Source2:        xml2changelog

# https://github.com/pear/Net_URL_Mapper/commit/6d6ffc9e8ea3bc87e448c55ec529f52d56d8eca1
Patch1:         Net_URL_Mapper-git.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  php-pear
# for tests
BuildRequires:  php-pear(pear.phpunit.de/PHPUnit)
BuildRequires:  php-pear(Net_URL) >= 1.0.14

Requires:       php-pear(PEAR)
Requires:       php-pear(Net_URL) >= 1.0.14
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}


%description
Net_URL_Mapper provides a simple and flexible way to build nice URLs for your
web applications.

The URL syntax is similar to what can be found in Ruby on Rails or Python
Routes module and as such, this package can be compared to what they call a
router. Still, Net_URL_Mapper does not perform the dispatching like these
frameworks and therefore can be used with your own router.


%prep
%setup -qc
%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 10

cd %{pear_name}-%{version}
# Package.xml is V2
mv ../package.xml %{name}.xml

%patch1 -p1 -b .orig


%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.


%install
rm -rf $RPM_BUILD_ROOT
cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml

# Clean up unnecessary files
rm -rf $RPM_BUILD_ROOT%{pear_metadir}/.??*

# Install XML package description
install -d $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}

cd $RPM_BUILD_ROOT%{pear_testdir}/%{pear_name}

%clean
rm -rf $RPM_BUILD_ROOT


%post
%{__pear} install --nodeps --soft --force --register-only \
    %{pear_xmldir}/%{name}.xml >/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
        %{pear_name} >/dev/null || :
fi


%check
# error_reporting = E_ALL & ~E_STRICT & ~E_DEPRECATED = 22527
cd %{pear_name}-%{version}
phpunit \
   -d error_reporting=22527 \
   -d date.timezone=UTC \
   --include-path=$RPM_BUILD_ROOT%{pear_phpdir} \
   tests


%files
%defattr(-,root,root,-)
%doc CHANGELOG
%{pear_xmldir}/%{name}.xml
%{pear_testdir}/%{pear_name}
%{pear_datadir}/%{pear_name}
# Net_URL own Net but not Net/URL
%{pear_phpdir}/Net/URL
# Packaging stuff
%exclude %{_bindir}/*php


%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sat Jan 18 2014 Remi Collet <remi@fedoraproject.org> - 0.9.1-12
- set error_reporting during test

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Feb 19 2013 Remi Collet <remi@fedoraproject.org> - 0.9.1-10
- fix metadata location

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Aug 19 2012 Remi Collet <remi@fedoraproject.org> - 0.9.1-8
- rebuilt for new pear_datadir

* Tue Aug 14 2012 Remi Collet <remi@fedoraproject.org> - 0.9.1-7
- rebuilt for new pear_testdir

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jan 16 2012 Remi Collet <remi@fedoraproject.org> - 0.9.1-5
- fix from GIT for test suite

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Jul  6 2011 Remi Collet <Fedora@FamilleCollet.com> - 0.9.1-3
- fix include_path in test (FTBFS #716015)

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Oct 27 2010 Remi Collet <Fedora@FamilleCollet.com> - 0.9.1-1
- Version 0.9.1 (beta) - API 1.0.0 (stable)
- add generated Changelog
- run tests in %%check

* Wed Aug 18 2010 Remi Collet <Fedora@FamilleCollet.com> - 0.9.0-5
- rename Net_URL_Mapper.xml to php-pear-Net-URL-Mapper.xml
- set date.timezone during build
- clean define

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Feb  9 2008 Christopher Stone <chris.stone@gmail.com> 0.9.0-2
- Add test file patch (bz #431955)

* Thu Feb  7 2008 Christopher Stone <chris.stone@gmail.com> 0.9.0-1
- Initial Fedora release