From 558027f1380c227356b752dd0bb31b7bb294686c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 15 May 2019 16:35:23 +0200 Subject: 3.0.0 from Fedora --- .gitignore | 8 +++ composer.json | 26 ++++++++++ php-when.spec | 154 +++++++++++++++++++++++++++++++++++++++------------------- 3 files changed, 138 insertions(+), 50 deletions(-) create mode 100644 .gitignore create mode 100755 composer.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json new file mode 100755 index 0000000..9789d13 --- /dev/null +++ b/composer.json @@ -0,0 +1,26 @@ +{ + "name": "tplaner/when", + "type": "library", + "description": "Date/Calendar recursion library.", + "keywords": ["recurrence", "date", "time", "DateTime", "repeat"], + "homepage": "https://github.com/tplaner/When", + "license": "MIT", + "authors": [ + { + "name": "Tom Planer", + "email": "tplaner@gmail.com" + } + ], + "require": { + "php": ">=7.1.3" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "autoload": { + "psr-4": { + "When\\": "src/" + } + }, + "minimum-stability": "dev" +} diff --git a/php-when.spec b/php-when.spec index 633ed71..c6fb260 100644 --- a/php-when.spec +++ b/php-when.spec @@ -1,73 +1,127 @@ -Name: php-when -Version: 0.3 -Release: 2%{?dist} -Summary: Date/Calendar recursion library for PHP - -Group: Development/Libraries -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 - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildArch: noarch - -Requires: php-date php-spl +# remirepo spec file for php-when, from +# +# Fedora spec file for php-when +# +# Copyright (c) 2019 Shawn Iwinski +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + +%global github_owner tplaner +%global github_name When +%global github_version 3.0.0 +%global github_commit 09182e1707085382b8207c480120e96e98880563 + +%global composer_vendor tplaner +%global composer_project when + +# "php": ">=7.1.3" +%global php_min_ver 7.1.3 + +# Build using "--without tests" to disable tests +%global with_tests 0%{!?_without_tests:1} + +%{!?phpdir: %global phpdir %{_datadir}/php} + +Name: php-when +Version: %{github_version} +Release: 1%{?github_release}%{?dist} +Summary: Date/Calendar recursion library for PHP + +License: MIT +URL: https://github.com/%{github_owner}/%{github_name} +Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz + +BuildArch: noarch +# Tests +%if %{with_tests} +## composer.json +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-composer(phpunit/phpunit) +## phpcompatinfo (computed from version 3.0.0) +BuildRequires: php-date +BuildRequires: php-spl +## Autoloader +BuildRequires: php-composer(fedora/autoloader) +%endif + +# composer.json +Requires: php(language) >= %{php_min_ver} +# phpcompatinfo (computed from version 3.0.0) +Requires: php-date +Requires: php-spl + +# Standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" naming +Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} +# Composer +Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description -PHP library that handles recursive dates: It determines the next date of -recursion given an iCalendar "rrule" like pattern. +%{summary}. -%package tests -Summary: Test files for %{name} -Group: Development/Libraries +Autoloader: %{phpdir}/When/autoload.php -Requires: %{name} = %{version}-%{release} -# phpunit tests -Requires: php-phpunit-PHPUnit -BuildRequires: php-phpunit-PHPUnit - -%description tests -PHPUnit tests for %{name}. %prep -%setup -q -n When-%{version} +%setup -qn %{github_name}-%{github_commit} + +# Remove exec bit from doc file +chmod a-x composer.json -# remove deprecated include and set prefix -sed -e '/Framework.php/d' \ - -e '/When.php/s:./:when/:' \ - -e '/When_Iterator.php/s:./:when/:' \ - -i Tests/*php %build +: Create autoloader +cat <<'AUTOLOAD' | tee src/autoload.php + - 3.0.0-1 +- Update to 3.0.0 (RHBZ #1469514) +- Rewrite spec and license it under the MIT license + * Mon Dec 17 2012 Remi Collet - 0.3-2 - backport for remi repo. -- cgit