summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-06-03 16:07:40 +0200
committerRemi Collet <fedora@famillecollet.com>2015-06-03 16:07:40 +0200
commit2fa6982be178ff0185e589180fd2f2776621c2b0 (patch)
tree08868ebf992831ef42ebcc24dbddf2a0ffbffeba
php-zetacomponents-base: 1.9 - New Package
-rw-r--r--Makefile4
-rw-r--r--php-zetacomponents-base-layout.patch12
-rw-r--r--php-zetacomponents-base.spec120
3 files changed, 136 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13af741
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../../common/Makefile
+
diff --git a/php-zetacomponents-base-layout.patch b/php-zetacomponents-base-layout.patch
new file mode 100644
index 0000000..0b81af0
--- /dev/null
+++ b/php-zetacomponents-base-layout.patch
@@ -0,0 +1,12 @@
+diff -up src/base.php.rpm src/base.php
+--- src/base.php.rpm 2015-06-03 15:28:58.325040622 +0200
++++ src/base.php 2015-06-03 15:29:04.688069768 +0200
+@@ -57,7 +57,7 @@ class ezcBase
+ *
+ * @var string
+ */
+- private static $libraryMode = "devel";
++ private static $libraryMode = "pear";
+
+ /**
+ * Contains the current working directory, which is used when the
diff --git a/php-zetacomponents-base.spec b/php-zetacomponents-base.spec
new file mode 100644
index 0000000..3e15c61
--- /dev/null
+++ b/php-zetacomponents-base.spec
@@ -0,0 +1,120 @@
+# remirepo/fedora spec file for php-zetacomponents-base
+#
+# Copyright (c) 2015 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+
+%global gh_commit f20df24e8de3e48b6b69b2503f917e457281e687
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner zetacomponents
+%global gh_project Base
+%global cname base
+%global ezcdir %{_datadir}/php/ezc
+%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+
+Name: php-%{gh_owner}-%{cname}
+Version: 1.9
+Release: 1%{?dist}
+Summary: Zeta Base Component
+
+Group: Development/Libraries
+License: ASL 2.0
+URL: http://zetacomponents.org/
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+
+# Use old PEAR layout
+Patch0: %{name}-layout.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+BuildRequires: %{_bindir}/phpab
+%if %{with_tests}
+BuildRequires: %{_bindir}/phpunit
+BuildRequires: %{_bindir}/convert
+BuildRequires: php-composer(%{gh_owner}/unit-test)
+%endif
+
+# From phpcompatinfo report for 1.9
+Requires: php(language) > 5.3
+Requires: php-pcre
+Requires: php-simplexml
+Requires: php-spl
+
+Provides: php-composer(%{gh_owner}/%{cname}) = %{version}
+
+
+%description
+This is the base package of the eZ publish components, offering the basic
+support that all Components need. In the first version this will be the
+autoload support.
+
+
+%prep
+%setup -q -n %{gh_project}-%{gh_commit}
+
+%patch0 -p0
+
+
+%build
+: Generate a simple autoloader
+%{_bindir}/phpab \
+ --output src/autoloader.php \
+ src
+
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{ezcdir}/autoload
+
+: The library
+cp -pr src \
+ %{buildroot}%{ezcdir}/%{gh_project}
+: For ezcBase autoloader
+cp -pr src/*_autoload.php \
+ %{buildroot}%{ezcdir}/autoload
+
+
+%check
+%if %{with_tests}
+: Ignore test relying on composer layout
+rm tests/file_find_recursive_test.php
+
+: Create test autoloader
+mkdir vendor
+cat <<EOF | tee vendor/autoload.php
+<?php
+require '%{ezcdir}/UnitTest/autoloader.php';
+require '$PWD/src/autoloader.php';
+EOF
+
+: Run test test suite
+%{_bindir}/phpunit
+%else
+: Test suite disabled
+%endif
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%files
+%defattr(-,root,root,-)
+%{!?_licensedir:%global license %%doc}
+%license NOTICE CREDITS
+%doc ChangeLog
+%doc composer.json
+%doc docs design
+%dir %{ezcdir}
+%dir %{ezcdir}/autoload
+ %{ezcdir}/autoload/*_autoload.php
+ %{ezcdir}/%{gh_project}
+
+
+%changelog
+* Wed Jun 3 2015 Remi Collet <remi@fedoraproject.org> - 1.0.2-1
+- initial package
+- open https://github.com/zetacomponents/UnitTest/issues/4 License \ No newline at end of file