Name: php-when Version: 0.3 Release: 2%{?dist} Summary: Date/Calendar recursion library for PHP License: MIT URL: https://github.com/tplaner/When # Download from # https://github.com/tplaner/When/archive/v0.3.tar.gz Source0: When-%{version}.tar.gz BuildArch: noarch Requires: php-date php-spl %description PHP library that handles recursive dates: It determines the next date of recursion given an iCalendar "rrule" like pattern. %package tests Summary: Test files for %{name} Requires: %{name} = %{version}-%{release} # phpunit tests BuildRequires: php-phpunit-PHPUnit %description tests PHPUnit tests for %{name}. %prep %setup -q -n When-%{version} sed -e '/Framework.php/d' \ -e '/When.php/s:./:when/:' \ -e '/When_Iterator.php/s:./:when/:' \ -i Tests/*php %build %install mkdir -p %{buildroot}%{_datadir}/php/when install -pm 644 When.php %{buildroot}%{_datadir}/php/when install -pm 644 When_Iterator.php %{buildroot}%{_datadir}/php/when mkdir -p %{buildroot}%{_datadir}/tests/when install -pm 644 Tests/*.php %{buildroot}%{_datadir}/tests/when/ %check cd Tests phpunit -d include_path=%{buildroot}%{_datadir}/php:.:%{_datadir}/php:%{_datadir}/pear -d date.timezone=UTC . %files %doc README.md %dir %{_datadir}/php/when %{_datadir}/php/when/When.php %{_datadir}/php/when/When_Iterator.php %files tests %dir %{_datadir}/tests %{_datadir}/tests/when %changelog * Sat Dec 15 2012 Gregor Tätzner - 0.3-2 - enabled phpunit tests - moved tests to %%{_datadir}/tests/when * Tue Dec 11 2012 Gregor Tätzner - 0.3-1 - Initial package