[5913] | 1 | %{!?__pear: %{expand: %%global __pear /usr/bin/pear5}} |
---|
| 2 | %global pear_name DB |
---|
| 3 | |
---|
| 4 | # run rpmbuild --with sqlite if sqlite extension available |
---|
| 5 | %global with_sqlite %{?_with_sqlite:1}%{!?_with_sqlite:0} |
---|
| 6 | |
---|
| 7 | Name: php-pear-DB |
---|
| 8 | Version: 1.7.14 |
---|
| 9 | Release: 1%{?_dist_release} |
---|
| 10 | Summary: PEAR: Database Abstraction Layer |
---|
| 11 | |
---|
| 12 | Group: Development/Libraries |
---|
| 13 | License: PHP |
---|
| 14 | URL: http://pear.php.net/package/DB |
---|
| 15 | Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz |
---|
| 16 | Source2: xml2changelog |
---|
| 17 | |
---|
| 18 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 19 | |
---|
| 20 | BuildArch: noarch |
---|
| 21 | ## Vine's php5-pear is a subpackage from php5 (internal version 1.9.4) |
---|
| 22 | BuildRequires: php-pear(PEAR) >= 1.4.9 |
---|
| 23 | %if %{with_sqlite} |
---|
| 24 | BuildRequires: php-sqlite |
---|
| 25 | %endif |
---|
| 26 | |
---|
| 27 | Requires(post): %{__pear} |
---|
| 28 | Requires(postun): %{__pear} |
---|
| 29 | Provides: php-pear(%{pear_name}) = %{version} |
---|
| 30 | Requires: php >= 4.2.0 |
---|
| 31 | Requires: php-pear(PEAR) |
---|
| 32 | |
---|
| 33 | %description |
---|
| 34 | DB is a database abstraction layer providing: |
---|
| 35 | * an OO-style query API |
---|
| 36 | * portability features that make programs written for one DBMS work with |
---|
| 37 | other DBMS's |
---|
| 38 | * a DSN (data source name) format for specifying database servers |
---|
| 39 | * prepare/execute (bind) emulation for databases that don't support it natively |
---|
| 40 | * a result object for each query response |
---|
| 41 | * portable error codes |
---|
| 42 | * sequence emulation |
---|
| 43 | * sequential and non-sequential row fetching as well as bulk fetching |
---|
| 44 | * formats fetched rows as associative arrays, ordered arrays or objects |
---|
| 45 | * row limit support |
---|
| 46 | * transactions support |
---|
| 47 | * table information interface |
---|
| 48 | * DocBook and phpDocumentor API documentation |
---|
| 49 | |
---|
| 50 | DB layers itself on top of PHP's existing database extensions. |
---|
| 51 | |
---|
| 52 | %prep |
---|
| 53 | %setup -q -c |
---|
| 54 | %{_bindir}/php -n %{SOURCE2} package.xml >CHANGELOG |
---|
| 55 | |
---|
| 56 | cd %{pear_name}-%{version} |
---|
| 57 | # Package is V2 |
---|
| 58 | mv ../package.xml %{name}.xml |
---|
| 59 | |
---|
| 60 | # update run test suite |
---|
| 61 | sed -e 's@^ *DB_TEST_RUN_TESTS=.*$@[ -d /usr/lib64 ] \&\& DB_TEST_RUN_TESTS=/usr/lib64/php/build/run-tests.php || DB_TEST_RUN_TESTS=/usr/lib/php/build/run-tests.php@' \ |
---|
| 62 | -e 's@^ *DB_TEST_DIR=.*$@DB_TEST_DIR=%{pear_testdir}/DB/tests@' \ |
---|
| 63 | -e 's@^ *TEST_PHP_EXECUTABLE=.*$@TEST_PHP_EXECUTABLE=%{_bindir}/php@' \ |
---|
| 64 | tests/run.cvs >tests/run |
---|
| 65 | |
---|
| 66 | sed -e 's@^ *DB_TEST_RUN_TESTS=.*$@[ -d /usr/lib64 ] \&\& DB_TEST_RUN_TESTS=/usr/lib64/php/build/run-tests.php || DB_TEST_RUN_TESTS=/usr/lib/php/build/run-tests.php@' \ |
---|
| 67 | -e 's@^ *DB_TEST_DIR=.*$@DB_TEST_DIR=%{pear_testdir}/DB/tests/driver@' \ |
---|
| 68 | -e 's@^ *TEST_PHP_EXECUTABLE=.*$@TEST_PHP_EXECUTABLE=%{_bindir}/php@' \ |
---|
| 69 | tests/driver/run.cvs >tests/driver/run |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | %build |
---|
| 73 | cd %{pear_name}-%{version} |
---|
| 74 | # Empty build section, most likely nothing required. |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | %install |
---|
| 78 | rm -rf %{buildroot} |
---|
| 79 | cd %{pear_name}-%{version} |
---|
| 80 | %{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml |
---|
| 81 | |
---|
| 82 | # Clean up unnecessary files |
---|
| 83 | rm -rf %{buildroot}%{pear_phpdir}/.??* |
---|
| 84 | |
---|
| 85 | # Install XML package description |
---|
| 86 | mkdir -p %{buildroot}%{pear_xmldir} |
---|
| 87 | install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} |
---|
| 88 | |
---|
| 89 | # Install new test suite |
---|
| 90 | install -pm 755 tests/run %{buildroot}%{pear_testdir}/DB/tests/ |
---|
| 91 | install -pm 755 tests/driver/run %{buildroot}%{pear_testdir}/DB/tests/driver/ |
---|
| 92 | |
---|
| 93 | mv %{buildroot}%{pear_docdir}/%{pear_name}/doc/TESTERS . |
---|
| 94 | iconv -f ISO-8859-1 -t UTF-8 TESTERS \ |
---|
| 95 | -o %{buildroot}%{pear_docdir}/%{pear_name}/doc/TESTERS |
---|
| 96 | touch -r TESTERS %{buildroot}%{pear_docdir}/%{pear_name}/doc/TESTERS |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | %clean |
---|
| 100 | rm -rf %{buildroot} |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | %check |
---|
| 104 | top=$PWD |
---|
| 105 | cd %{pear_name}-%{version}/tests |
---|
| 106 | %{__pear} \ |
---|
| 107 | run-tests \ |
---|
| 108 | -i "-d include_path=%{buildroot}%{pear_phpdir}:%{pear_phpdir}" \ |
---|
| 109 | . | tee $top/tests.log |
---|
| 110 | |
---|
| 111 | cd driver |
---|
| 112 | %if %{with_sqlite} |
---|
| 113 | %{__pear} \ |
---|
| 114 | run-tests \ |
---|
| 115 | -i "-d include_path=%{buildroot}%{pear_phpdir}:%{pear_phpdir}" \ |
---|
| 116 | . | tee -a $top/tests.log |
---|
| 117 | %else |
---|
| 118 | echo "Driver test skipped (need sqlite extension)" |
---|
| 119 | %endif |
---|
| 120 | |
---|
| 121 | grep "FAILED TESTS" $top/tests.log && exit 1 |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | %post |
---|
| 125 | %{__pear} install --nodeps --soft --force --register-only \ |
---|
| 126 | %{pear_xmldir}/%{name}.xml >/dev/null || : |
---|
| 127 | |
---|
| 128 | %postun |
---|
| 129 | if [ $1 -eq 0 ] ; then |
---|
| 130 | %{__pear} uninstall --nodeps --ignore-errors --register-only \ |
---|
| 131 | %{pear_name} >/dev/null || : |
---|
| 132 | fi |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | %files |
---|
| 136 | %defattr(-,root,root,-) |
---|
| 137 | %doc CHANGELOG |
---|
| 138 | %doc %{pear_docdir}/%{pear_name} |
---|
| 139 | %{pear_xmldir}/%{name}.xml |
---|
| 140 | %{pear_phpdir}/DB* |
---|
| 141 | %{pear_testdir}/DB |
---|
| 142 | %exclude %{pear_testdir}/DB/tests/run.cvs |
---|
| 143 | %exclude %{pear_testdir}/DB/tests/driver/*.cvs |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | %changelog |
---|
| 147 | * Tue Mar 13 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.7.14-1 |
---|
| 148 | - initial build for Vine Linux |
---|
| 149 | |
---|
| 150 | * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.14-2 |
---|
| 151 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild |
---|
| 152 | |
---|
| 153 | * Sat Aug 27 2011 Remi Collet <remi@fedoraproject.org> 1.7.14-1 |
---|
| 154 | - update to 1.7.14 |
---|
| 155 | |
---|
| 156 | * Wed Apr 13 2011 Remi Collet <Fedora@FamilleCollet.com> 1.7.13-5 |
---|
| 157 | - doc in /usr/share/doc/pear |
---|
| 158 | - define timezone during build |
---|
| 159 | - rename DB.xml to php-pear-DB.xml |
---|
| 160 | - fix libdir in provided tests (%%{_libdir} have no value for noarch package) |
---|
| 161 | - run tests in %%check (no driver as no sqlite extension) |
---|
| 162 | |
---|
| 163 | * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.13-4 |
---|
| 164 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild |
---|
| 165 | |
---|
| 166 | * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.13-3 |
---|
| 167 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild |
---|
| 168 | |
---|
| 169 | * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.13-2 |
---|
| 170 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild |
---|
| 171 | |
---|
| 172 | * Fri Sep 21 2007 Remi Collet <Fedora@FamilleCollet.com> 1.7.13-1 |
---|
| 173 | - update to 1.7.13 |
---|
| 174 | - fix TEXTERS encoding |
---|
| 175 | |
---|
| 176 | * Thu Aug 23 2007 Remi Collet <Fedora@FamilleCollet.com> 1.7.12-2 |
---|
| 177 | - Fix License |
---|
| 178 | |
---|
| 179 | * Mon Jul 23 2007 Remi Collet <Fedora@FamilleCollet.com> 1.7.12-1 |
---|
| 180 | - update to 1.7.12 |
---|
| 181 | - change requires from php to php-common |
---|
| 182 | - update test suite to run (but only after install) |
---|
| 183 | - add %%check, only for documentation purpose |
---|
| 184 | |
---|
| 185 | * Mon Apr 30 2007 Remi Collet <Fedora@FamilleCollet.com> 1.7.11-1 |
---|
| 186 | - update to 1.7.11 |
---|
| 187 | - add generated CHANGELOG |
---|
| 188 | |
---|
| 189 | * Sun Sep 10 2006 Tim Jackson <rpm@timj.co.uk> 1.7.6-7 |
---|
| 190 | - Update spec to new conventions (#198706) |
---|
| 191 | |
---|
| 192 | * Wed Jun 28 2006 Tim Jackson <rpm@timj.co.uk> 1.7.6-6 |
---|
| 193 | - Move tests to peardir/test instead of peardir/tests (bug #196764) |
---|
| 194 | |
---|
| 195 | * Wed May 17 2006 Tim Jackson <rpm@timj.co.uk> 1.7.6-5 |
---|
| 196 | - Moved package XML file to %%{peardir}/.pkgxml (see bug #190252) |
---|
| 197 | - Abstracted package XML directory |
---|
| 198 | - Removed some "-f"s on rm's to avoid masking possible errors |
---|
| 199 | |
---|
| 200 | * Tue Jan 24 2006 Tim Jackson <rpm@timj.co.uk> 1.7.6-4 |
---|
| 201 | - Move package XML file to _libdir/php/pear rather than _var/lib/pear |
---|
| 202 | |
---|
| 203 | * Tue Jan 24 2006 Tim Jackson <rpm@timj.co.uk> 1.7.6-3 |
---|
| 204 | - Requires(post,postun) php-pear |
---|
| 205 | |
---|
| 206 | * Sat Dec 31 2005 Tim Jackson <rpm@timj.co.uk> 1.7.6-2 |
---|
| 207 | - Rearranged so it makes more sense |
---|
| 208 | - Remove external license file |
---|
| 209 | - peardir definition now comes from "pear config-get" |
---|
| 210 | - BR php-pear |
---|
| 211 | - shorten description |
---|
| 212 | - be explicit about the files in the package |
---|
| 213 | - use macro for /var |
---|
| 214 | - remove versioning from pear(PEAR) dep; 1.0b1 is very old |
---|
| 215 | |
---|
| 216 | * Sat Dec 31 2005 Tim Jackson <rpm@timj.co.uk> 1.7.6-1 |
---|
| 217 | - First RPM build |
---|