[php-pear-File-CSV] import new package
Remi Collet
remi at fedoraproject.org
Sun Apr 1 06:21:28 UTC 2012
commit d0b1b5742e32db13fa0069f260a3474666d5d25d
Author: remi <fedora at famillecollet.com>
Date: Sun Apr 1 08:20:16 2012 +0200
import new package
.gitignore | 1 +
file-csv-test.patch | 70 ++++++++++++++++++++++++++++
php-pear-File-CSV.spec | 119 ++++++++++++++++++++++++++++++++++++++++++++++++
sources | 1 +
4 files changed, 191 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..eca352d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/File_CSV-1.0.0.tgz
diff --git a/file-csv-test.patch b/file-csv-test.patch
new file mode 100644
index 0000000..dbc443d
--- /dev/null
+++ b/file-csv-test.patch
@@ -0,0 +1,70 @@
+--- File_CSV-1.0.0/tests/CSV/bug13332.phpt.orig 2012-01-29 20:07:14.000000000 +0100
++++ File_CSV-1.0.0/tests/CSV/bug13332.phpt 2012-01-29 20:07:19.000000000 +0100
+@@ -19,34 +19,27 @@
+ $csv[] = $tmp;
+ }
+
+-var_dump($csv);
++print_r($csv);
+ ?>
+ --EXPECT--
+-array(2) {
+- [0]=>
+- array(5) {
+- [0]=>
+- string(1) "1"
+- [1]=>
+- string(1) "2"
+- [2]=>
+- string(6) "Twenty"
+- [3]=>
+- string(35) "This is a test of a "quoted" value."
+- [4]=>
+- string(15) "There is no cow"
+- }
+- [1]=>
+- array(5) {
+- [0]=>
+- string(1) "2"
+- [1]=>
+- string(1) "4"
+- [2]=>
+- string(5) "Forty"
+- [3]=>
+- string(37) "Another "quoted value", with a comma."
+- [4]=>
+- string(14) "There is a cow"
+- }
+-}
++Array
++(
++ [0] => Array
++ (
++ [0] => 1
++ [1] => 2
++ [2] => Twenty
++ [3] => This is a test of a "quoted" value.
++ [4] => There is no cow
++ )
++
++ [1] => Array
++ (
++ [0] => 2
++ [1] => 4
++ [2] => Forty
++ [3] => Another "quoted value", with a comma.
++ [4] => There is a cow
++ )
++
++)
+--- package.xml.orig 2012-01-29 20:08:48.000000000 +0100
++++ package.xml 2012-01-29 20:09:06.000000000 +0100
+@@ -127,7 +127,7 @@
+ <file md5sum="ecd67fa789344b9b1713fc8df8e8f2b0" name="tests/CSV/bug11526.csv" role="test" />
+ <file md5sum="64e72728d716678a8483b9183811b84d" name="tests/CSV/bug11526.phpt" role="test" />
+ <file md5sum="a23bce7b80e20b698e72ea9dae379f60" name="tests/CSV/bug13332.csv" role="test" />
+- <file md5sum="2982eb5ecfa4ce5eef2457dcd4bfd598" name="tests/CSV/bug13332.phpt" role="test" />
++ <file name="tests/CSV/bug13332.phpt" role="test" />
+ <file md5sum="3e9295c06548af5707cb9ae99b38632f" name="tests/CSV/bug14030.phpt" role="test" />
+ <file md5sum="0c2da2f5898cbc86591862de8c349c90" name="tests/CSV/bug14118.csv" role="test" />
+ <file md5sum="9830a96ef8dbcb4dbf785fcb1e6b0be1" name="tests/CSV/bug14118.phpt" role="test" />
diff --git a/php-pear-File-CSV.spec b/php-pear-File-CSV.spec
new file mode 100644
index 0000000..2e7b987
--- /dev/null
+++ b/php-pear-File-CSV.spec
@@ -0,0 +1,119 @@
+%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
+%global pear_name File_CSV
+
+# Tests are only run with rpmbuild --with tests
+# Can't be run in mock because of circular dependencies
+%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
+
+Name: php-pear-File-CSV
+Version: 1.0.0
+Release: 2%{?dist}
+Summary: Read and write of CSV files
+
+Group: Development/Libraries
+License: BSD
+URL: http://pear.php.net/package/File_CSV
+Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz
+
+# https://pear.php.net/bugs/19255 patch fails with php 5.4
+Patch0: file-csv-test.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+BuildRequires: php-pear(PEAR) >= 1.7.0
+%if %{with_tests}
+BuildRequires: php-pear(File) >= 1.4.0
+%endif
+
+Requires(post): %{__pear}
+Requires(postun): %{__pear}
+Requires: php-pear(PEAR) >= 1.7.0
+Requires: php-pear(File) >= 1.4.0
+Provides: php-pear(%{pear_name}) = %{version}
+
+
+%description
+Read and write of CSV files as well as discovering the format the CSV file
+is in.
+
+Supports headers and is excel compatible, i.e. ="0004" outputs as 0004
+(only read wise)
+
+For more information on CSV: http://rfc.net/rfc4180.html
+
+
+%prep
+%setup -q -c
+
+%patch0 -p0 -b .tests
+
+cd %{pear_name}-%{version}
+# Package is V2
+mv ../package.xml %{name}.xml
+
+
+%build
+cd %{pear_name}-%{version}
+# Empty build section, most likely nothing required.
+
+
+%install
+cd %{pear_name}-%{version}
+rm -rf %{buildroot}
+%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
+
+# Clean up unnecessary files
+rm -rf %{buildroot}%{pear_phpdir}/.??*
+
+# Install XML package description
+mkdir -p %{buildroot}%{pear_xmldir}
+install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+
+
+%check
+cd %{pear_name}-%{version}
+%if %{with_tests}
+%{__pear} \
+ run-tests \
+ --recur \
+ --ini "-d include_path=%{buildroot}%{pear_phpdir}:%{pear_phpdir}" \
+ tests | tee ../tests.log
+grep "FAILED TESTS" ../tests.log && exit 1
+%else
+echo 'Test suite disabled (missing "--with test" option)'
+%endif
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%post
+%{__pear} install --nodeps --soft --force --register-only \
+ %{pear_xmldir}/%{name}.xml >/dev/null || :
+
+
+%postun
+if [ $1 -eq 0 ] ; then
+ %{__pear} uninstall --nodeps --ignore-errors --register-only \
+ pear.php.net/%{pear_name} >/dev/null || :
+fi
+
+
+%files
+%defattr(-,root,root,-)
+%doc %{pear_docdir}/%{pear_name}
+%{pear_xmldir}/%{name}.xml
+%{pear_phpdir}/File/CSV.php
+%{pear_testdir}/%{pear_name}
+
+
+%changelog
+* Mon Mar 05 2012 Remi Collet <remi at fedoraproject.org> - 1.0.0-2
+- spec cleanups
+- patch for test which fails with php 5.4
+ https://pear.php.net/bugs/19255
+
+* Sat Mar 19 2011 Remi Collet <Fedora at FamilleCollet.com> - 1.0.0-1
+- initial package
+
diff --git a/sources b/sources
index e69de29..973a2fd 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a3899032d51cee860a2008e8b294c885 File_CSV-1.0.0.tgz
More information about the scm-commits
mailing list