summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--composer.json34
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-simplepie-php71.patch22
-rw-r--r--php-simplepie-rpm.patch30
-rw-r--r--php-simplepie.spec123
6 files changed, 209 insertions, 32 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..7620585
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "simplepie/simplepie",
+ "description": "A simple Atom/RSS parsing library for PHP",
+ "type": "library",
+ "keywords": ["rss", "atom", "feeds"],
+ "homepage": "http://simplepie.org/",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Ryan Parman",
+ "homepage": "http://ryanparman.com/",
+ "role": "Creator, alumnus developer"
+ },
+ {
+ "name": "Geoffrey Sneddon",
+ "homepage": "http://gsnedders.com/",
+ "role": "Alumnus developer"
+ },
+ {
+ "name": "Ryan McCue",
+ "email": "me@ryanmccue.info",
+ "homepage": "http://ryanmccue.info/",
+ "role": "Developer"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "autoload": {
+ "psr-0": {
+ "SimplePie": "library"
+ }
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..87d223d
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n"
+
+echo "Cloning..."
+rm -rf $PROJECT-$COMMIT
+git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
diff --git a/php-simplepie-php71.patch b/php-simplepie-php71.patch
new file mode 100644
index 0000000..0f16a20
--- /dev/null
+++ b/php-simplepie-php71.patch
@@ -0,0 +1,22 @@
+From 1111dab1baced14aaf05509c41ee416c3fc6a961 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@famillecollet.com>
+Date: Thu, 7 Jul 2016 08:20:40 +0200
+Subject: [PATCH] Fix for PHP 7.1
+
+---
+ library/SimplePie/Parse/Date.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/library/SimplePie/Parse/Date.php b/library/SimplePie/Parse/Date.php
+index a415ba6..226f453 100644
+--- a/library/SimplePie/Parse/Date.php
++++ b/library/SimplePie/Parse/Date.php
+@@ -690,7 +690,7 @@ public function date_w3cdtf($date)
+ }
+
+ // Convert the number of seconds to an integer, taking decimals into account
+- $second = round($match[6] + $match[7] / pow(10, strlen($match[7])));
++ $second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7])));
+
+ return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone;
+ }
diff --git a/php-simplepie-rpm.patch b/php-simplepie-rpm.patch
new file mode 100644
index 0000000..35e3fe1
--- /dev/null
+++ b/php-simplepie-rpm.patch
@@ -0,0 +1,30 @@
+diff -up ./autoloader.php.rpm ./autoloader.php
+--- ./autoloader.php.rpm 2016-07-07 08:03:48.148863182 +0200
++++ ./autoloader.php 2016-07-07 08:04:13.777994006 +0200
+@@ -63,7 +63,7 @@ class SimplePie_Autoloader
+ */
+ public function __construct()
+ {
+- $this->path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'library';
++ $this->path = dirname(__FILE__);
+ }
+
+ /**
+@@ -82,4 +82,4 @@ class SimplePie_Autoloader
+ $filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
+ include $filename;
+ }
+-}
+\ Pas de fin de ligne à la fin du fichier
++}
+diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
+--- ./tests/bootstrap.php.rpm 2016-07-07 08:03:52.644886131 +0200
++++ ./tests/bootstrap.php 2016-07-07 08:04:51.301185544 +0200
+@@ -1,6 +1,6 @@
+ <?php
+
+-require_once dirname(dirname(__FILE__)) . '/autoloader.php';
++require_once '@PATH@/autoloader.php';
+
+ /**
+ * Acts as a fake feed request
diff --git a/php-simplepie.spec b/php-simplepie.spec
index 10f765e..0d219f8 100644
--- a/php-simplepie.spec
+++ b/php-simplepie.spec
@@ -1,29 +1,54 @@
-Name: php-simplepie
-Version: 1.3.1
-Release: 2%{?dist}
-Summary: Simple RSS Library in PHP
-
-Group: Development/Libraries
-License: BSD
-URL: http://simplepie.org/
-Source0: http://simplepie.org/downloads/simplepie_%{version}.zip
-
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
-BuildArch: noarch
-BuildRequires: php-phpunit-PHPUnit
-
-Requires: php-IDNA_Convert
-Requires: php-curl
-Requires: php-date
-Requires: php-dom
-Requires: php-iconv
-Requires: php-libxml
-Requires: php-mbstring
-Requires: php-pcre
-Requires: php-pdo
-Requires: php-reflection
-Requires: php-xml
-# Optional: memcache, xmlreader, zlib
+# remirepo spec file for php-simplepie, from:
+
+# Fedora spec file for php-simplepie
+#
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please preserve changelog entries
+#
+%global gh_commit 9b775e88ba1128fa14c69ff94ab954d86067de2a
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner simplepie
+%global gh_project simplepie
+%global with_tests 0%{!?_without_tests:1}
+
+Name: php-simplepie
+Version: 1.4.2
+Release: 1%{?dist}
+Summary: A simple Atom/RSS parsing library for PHP
+
+Group: Development/Libraries
+License: BSD
+URL: http://simplepie.org/
+# Git snapshot to retrieve test suite excluded in .gitattributes
+Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz
+Source1: makesrc.sh
+
+# Adapt autoloader for installation tree
+Patch0: %{name}-rpm.patch
+# https://github.com/simplepie/simplepie/pull/458
+Patch1: %{name}-php71.patch
+
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+BuildArch: noarch
+BuildRequires: php-phpunit-PHPUnit
+
+Requires: php-IDNA_Convert
+Requires: php-curl
+Requires: php-date
+Requires: php-dom
+Requires: php-iconv
+Requires: php-libxml
+Requires: php-mbstring
+Requires: php-pcre
+Requires: php-pdo
+Requires: php-reflection
+Requires: php-xml
+# Optional: memcache, memcached, redis, xmlreader, zlib
+
+Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+
%description
SimplePie is a very fast and easy-to-use class, written in PHP, that puts the
@@ -31,10 +56,17 @@ SimplePie is a very fast and easy-to-use class, written in PHP, that puts the
beginners and veterans alike, SimplePie is focused on speed, ease of use,
compatibility and standards compliance.
+Autoloader: %{_datadir}/php/%{name}/autoloader.php
+
+
%prep
-%setup -qn simplepie-simplepie-e9472a1
-chmod -x demo/cli_test.php
-chmod -x demo/for_the_demo/mediaplayer_readme.htm
+%setup -q -n %{gh_project}-%{gh_commit}
+
+%patch0 -p1 -b .rpm
+%patch1 -p1
+
+find . -type f -exec chmod -x {} \;
+rm demo/cache/.gitignore
%build
@@ -46,12 +78,33 @@ rm -rf %{buildroot}
mkdir -p %{buildroot}/%{_datadir}/php/
cp -ar library %{buildroot}/%{_datadir}/php/%{name}
-sed -e '/__FILE__/s/\..*$/;/' autoloader.php \
- > %{buildroot}/%{_datadir}/php/%{name}/autoloader.php
+install -pm 644 autoloader.php \
+ %{buildroot}/%{_datadir}/php/%{name}/autoloader.php
%check
-phpunit .
+sed -e 's:@PATH@:%{buildroot}/%{_datadir}/php/%{name}:' \
+ -i tests/bootstrap.php
+
+run=0
+ret=0
+if which php56; then
+ php56 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+
+# Known failed test with PHP 7+
+rm tests/IRITest.php
+rm tests/oldtests/first_item_title/SPtests/bugs/179.0.10.php
+
+if which php71; then
+ php71 %{_bindir}/phpunit || ret=1
+ run=1
+fi
+if [ $run -eq 0 ]; then
+%{_bindir}/phpunit --verbose
+fi
+exit $ret
%clean
@@ -65,6 +118,12 @@ rm -rf %{buildroot}
%changelog
+* Thu Jul 7 2016 Remi Collet <remi@fedoraproject.org> - 1.4.2-1
+- update to 1.4.2
+- sources from git snapshot
+- add patch for php 7.1 https://github.com/simplepie/simplepie/pull/458
+- provide php-composer(simplepie/simplepie)
+
* Sun Dec 16 2012 Remi Collet <remi@fedoraproject.org> - 1.3.1-2
- really install library
- provides autoloader.php