From 78e6d4f46b30cc87252275ed81099e634d5e7017 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 8 Jan 2016 12:23:23 +0100 Subject: php-mcnetic-zipstreamer: 1.7, new package --- Makefile | 4 ++ php-mcnetic-zipstreamer-warn.patch | 11 ++++ php-mcnetic-zipstreamer.spec | 121 +++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 Makefile create mode 100644 php-mcnetic-zipstreamer-warn.patch create mode 100644 php-mcnetic-zipstreamer.spec 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/php-mcnetic-zipstreamer-warn.patch b/php-mcnetic-zipstreamer-warn.patch new file mode 100644 index 0000000..e96c1e7 --- /dev/null +++ b/php-mcnetic-zipstreamer-warn.patch @@ -0,0 +1,11 @@ +--- src/ZipStreamer.php.rpm 2016-01-08 12:15:06.445995538 +0100 ++++ src/ZipStreamer.php 2016-01-08 12:15:32.810095324 +0100 +@@ -668,7 +668,7 @@ + } + + public function update($data) { +- return $this->peclDeflateStream->update($data); ++ return ($data ? $this->peclDeflateStream->update($data) : @$this->peclDeflateStream->update($data)); + } + + public function finish() { diff --git a/php-mcnetic-zipstreamer.spec b/php-mcnetic-zipstreamer.spec new file mode 100644 index 0000000..420442d --- /dev/null +++ b/php-mcnetic-zipstreamer.spec @@ -0,0 +1,121 @@ +# remirepo/fedora spec file for php-mcnetic-zipstreamer +# +# Copyright (c) 2016 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit 44c99c659abf4dac92882437c1da68de824ca9d0 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner McNetic +%global gh_project PHPZipStreamer +%global with_tests 0%{!?_without_tests:1} +%global namespace ZipStreamer + +Name: php-mcnetic-zipstreamer +Version: 1.7 +Release: 1%{?dist} +Summary: Stream zip files without i/o overhead + +Group: Development/Libraries +License: GPLv3+ +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz + +# See https://github.com/McNetic/PHPZipStreamer/issues/29 +Patch1: %{name}-warn.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +BuildRequires: php-composer(theseer/autoload) +%if %{with_tests} +BuildRequires: php(language) >= 5.3.0 +BuildRequires: php-date +BuildRequires: php-hash +BuildRequires: php-mbstring +BuildRequires: php-pcre +BuildRequires: php-spl +BuildRequires: php-composer(phpunit/phpunit) +BuildRequires: php-pecl(Xdebug) +BuildRequires: php-pecl(pecl_http) +%endif + +# From composer.json +# "php": ">=5.3.0" +Requires: php(language) >= 5.3.0 +# From phpcompatinfo report for version0.7 +Requires: php-date +Requires: php-hash +Requires: php-mbstring +Requires: php-spl +%if 0%{?fedora} > 21 +# For compression +Recommends: php-pecl(pecl_http) +%else +Requires: php-pecl(pecl_http) +%endif + +Provides: php-composer(mcnetic/zipstreamer) = %{version} + + +%description +Simple Class to create zip files on the fly and stream directly to the +HTTP client as the content is added (without using temporary files). + +Autoloader: %{_datadir}/php/%{namespace}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +%patch1 -p0 -b .rpm +find . -name \*.rpm -exec rm {} \; + + +%build +%{_bindir}/phpab -o src/autoload.php src + + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_datadir}/php +cp -pr src %{buildroot}%{_datadir}/php/%{namespace} + + +%check +%if %{with_tests} + +: Run test suite +%{_bindir}/phpunit \ + --bootstrap %{buildroot}%{_datadir}/php/%{namespace}/autoload.php \ + --configuration test/phpunit.xml + +if which php70; then + php70 %{_bindir}/phpunit \ + --bootstrap %{buildroot}%{_datadir}/php/%{namespace}/autoload.php \ + --configuration test/phpunit.xml +fi +%else +: Test suite disabled +%endif + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc *.md +%doc composer.json +%{_datadir}/php/%{namespace} + + +%changelog +* Fri Jan 8 2016 Remi Collet - 1.7.1 +- initial package +- add patch to workaround error raised by pecl_http + see https://github.com/McNetic/PHPZipStreamer/issues/29 \ No newline at end of file -- cgit