From 9b71bd5796b1ac9f9779cc42d79762f25db6be1c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Sun, 24 Mar 2024 21:38:43 -0400 Subject: [PATCH] * Tue Feb 19 2013 Remi Collet - 1.0.0-6 - fix metadata location --- File_CSV-1.0.0.tgz | 3 + Makefile | 2 +- README.md | 18 ++-- change-this-to-the-package-name.spec | 55 ----------- file-csv-test.patch | 70 ++++++++++++++ php-pear-File-CSV.spec | 132 +++++++++++++++++++++++++++ 6 files changed, 218 insertions(+), 62 deletions(-) create mode 100644 File_CSV-1.0.0.tgz delete mode 100644 change-this-to-the-package-name.spec create mode 100644 file-csv-test.patch create mode 100644 php-pear-File-CSV.spec diff --git a/File_CSV-1.0.0.tgz b/File_CSV-1.0.0.tgz new file mode 100644 index 0000000..e947d81 --- /dev/null +++ b/File_CSV-1.0.0.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2ace64aa13c9d05266ec596a6bd357caab96133cdb5d1baad0973fa04f434ae +size 20327 diff --git a/Makefile b/Makefile index 019b73c..8f6a8e0 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NAME := ${REPO_NAME} +NAME := php-pear-File-CSV SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common diff --git a/README.md b/README.md index b978d3b..5c8269f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,22 @@ -# ${REPO_NAME} +# php-pear-File-CSV -SMEServer Koozali local git repo for ${REPO_NAME} +SMEServer Koozali local git repo for php-pear-File-CSV ## Documentation -
https://metacpan.org/pod/${REPO_NAME} +
https://pear.php.net/package/File_CSV ## Bugzilla -CPAN bug report are [here](https://rt.cpan.org/Public/Dist/Display.html?Name=${REPO_NAME}) +CPAN bug report are [here](https://pear.php.net/bugs/search.php?search_for=&boolean=0&limit=10&order_by=&direction=ASC&cmd=display&status=Open&bug_type=All&package_name%5B%5D=File_CSV&php_os=&packagever=&phpver=&assign=&maintain=&author_email=&bug_age=0&bug_updated=0) -Show list of Koozali outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=${REPO_NAME}&product=SME%20Server%2011.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) +Show list of Koozali outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=php-pear-File-CSV&product=SME%20Server%2011.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) ## Description -${REPO_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 diff --git a/change-this-to-the-package-name.spec b/change-this-to-the-package-name.spec deleted file mode 100644 index 663f08c..0000000 --- a/change-this-to-the-package-name.spec +++ /dev/null @@ -1,55 +0,0 @@ -%define name ${REPO_NAME} -%define version 1.0 -%define release 1 -Summary: This is what ${REPO_NAME} does. -Name: %{name} -Version: %{version} -Release: %{release}%{?dist} -Source: %{name}-%{version}.tar.gz -License: GNU GPL version 2 -Group: SMEserver/addon -BuildRoot: %{_tmppath}/%{name}-buildroot -Prefix: %{_prefix} -BuildArchitectures: noarch -BuildRequires: e-smith-devtools -Requires: e-smith-release >= 10.0 -AutoReqProv: no - -%description -${REPO_DESCRIPTION} - -%changelog -* Day MMMM DD YYYY 1.0-1.sme -- Initial code - create RPM [SME:99999] - -%prep - -%setup -q - -%build -perl createlinks - -%install -rm -rf $$RPM_BUILD_ROOT -(cd root ; find . -depth -print | cpio -dump $$RPM_BUILD_ROOT) -rm -f %{name}-%{version}-filelist -/sbin/e-smith/genfilelist $$RPM_BUILD_ROOT \ -> %{name}-%{version}-filelist -#echo "%doc COPYING" >> %{name}-%{version}-filelist -#--dir 'attr(755,user,grp)' \ -#--file 'attr(755,root,root)' \ - -%clean -cd .. -rm -rf %{name}-%{version} - -%pre - -%preun - -%post - -%postun -#uninstall -%files -f %{name}-%{version}-filelist -%defattr(-,root,root) 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 @@ + + + +- ++ + + + diff --git a/php-pear-File-CSV.spec b/php-pear-File-CSV.spec new file mode 100644 index 0000000..94a34ed --- /dev/null +++ b/php-pear-File-CSV.spec @@ -0,0 +1,132 @@ +%{!?pear_metadir: %global pear_metadir %{pear_phpdir}} +%{!?__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: 6%{?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_metadir}/.??* + +# 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 +* Tue Feb 19 2013 Remi Collet - 1.0.0-6 +- fix metadata location + +* Thu Feb 14 2013 Fedora Release Engineering - 1.0.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Aug 14 2012 Remi Collet - 1.0.0-4 +- rebuilt for new pear_testdir + +* Fri Jul 20 2012 Fedora Release Engineering - 1.0.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Mar 05 2012 Remi Collet - 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 - 1.0.0-1 +- initial package +