Tue, 02 Jul 2013 18:21:58 +0200
Remove superfluous init scripts and introduce SQL population logic.
michael@778 | 1 | ## |
michael@778 | 2 | ## perl-db.spec -- OpenPKG RPM Package Specification |
michael@778 | 3 | ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@778 | 4 | ## |
michael@778 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@778 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@778 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@778 | 8 | ## copies. |
michael@778 | 9 | ## |
michael@778 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@778 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@778 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@778 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@778 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@778 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@778 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@778 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@778 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@778 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@778 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@778 | 21 | ## SUCH DAMAGE. |
michael@778 | 22 | ## |
michael@778 | 23 | |
michael@778 | 24 | # versions of individual parts |
michael@778 | 25 | %define V_perl 5.16 |
michael@779 | 26 | %define V_berkeleydb 0.52 |
michael@779 | 27 | %define V_bdb 1.9 |
michael@779 | 28 | %define V_db_file 1.828 |
michael@778 | 29 | %define V_db_file_lock 0.05 |
michael@778 | 30 | |
michael@778 | 31 | # package information |
michael@778 | 32 | Name: perl-db |
michael@778 | 33 | Summary: Perl Modules for use with Berkeley-DB |
michael@778 | 34 | URL: http://www.cpan.org/ |
michael@778 | 35 | Vendor: Perl Community |
michael@778 | 36 | Packager: OpenPKG Foundation e.V. |
michael@778 | 37 | Distribution: OpenPKG Community |
michael@778 | 38 | Class: BASE |
michael@778 | 39 | Group: Perl |
michael@778 | 40 | License: GPL/Artistic |
michael@778 | 41 | Version: %{V_perl} |
michael@778 | 42 | Release: 20120531 |
michael@778 | 43 | |
michael@778 | 44 | # package options |
michael@778 | 45 | %option with_pthreads no |
michael@778 | 46 | |
michael@778 | 47 | # list of sources |
michael@778 | 48 | Source0: http://www.cpan.org/authors/id/P/PM/PMQS/BerkeleyDB-%{V_berkeleydb}.tar.gz |
michael@778 | 49 | Source1: http://www.cpan.org/authors/id/M/ML/MLEHMANN/BDB-%{V_bdb}.tar.gz |
michael@778 | 50 | Source2: http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-%{V_db_file}.tar.gz |
michael@778 | 51 | Source3: http://www.cpan.org/authors/id/D/DH/DHARRIS/DB_File-Lock-%{V_db_file_lock}.tar.gz |
michael@778 | 52 | Patch0: perl-db.patch |
michael@778 | 53 | |
michael@778 | 54 | # build information |
michael@778 | 55 | BuildPreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126 |
michael@778 | 56 | PreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl} |
michael@778 | 57 | BuildPreReq: db >= 4.1.24 |
michael@778 | 58 | PreReq: db >= 4.1.24 |
michael@778 | 59 | %if "%{with_pthreads}" == "yes" |
michael@778 | 60 | BuildPreReq: db::with_pthreads = yes |
michael@778 | 61 | PreReq: db::with_pthreads = yes |
michael@778 | 62 | %endif |
michael@778 | 63 | |
michael@778 | 64 | %description |
michael@778 | 65 | Various modules for using the Berkeley-DB library from within Perl: |
michael@778 | 66 | - BerkeleyDB (%{V_berkeleydb}) |
michael@778 | 67 | - BDB (%{V_bdb}) |
michael@778 | 68 | - DB_File (%{V_db_file}) |
michael@778 | 69 | - DB_File::Lock (%{V_db_file_lock}) |
michael@778 | 70 | |
michael@778 | 71 | %track |
michael@778 | 72 | prog perl-db:BerkeleyDB = { |
michael@778 | 73 | version = %{V_berkeleydb} |
michael@778 | 74 | url = http://www.cpan.org/authors/id/P/PM/PMQS/ |
michael@778 | 75 | regex = BerkeleyDB-(__VER__)\.tar\.gz |
michael@778 | 76 | } |
michael@778 | 77 | prog perl-db:BDB = { |
michael@778 | 78 | version = %{V_bdb} |
michael@778 | 79 | url = http://www.cpan.org/authors/id/M/ML/MLEHMANN/ |
michael@778 | 80 | regex = BDB-(__VER__)\.tar\.gz |
michael@778 | 81 | } |
michael@778 | 82 | prog perl-db:DB_File = { |
michael@778 | 83 | version = %{V_db_file} |
michael@778 | 84 | url = http://www.cpan.org/authors/id/P/PM/PMQS/ |
michael@778 | 85 | regex = DB_File-(__VER__)\.tar\.gz |
michael@778 | 86 | } |
michael@778 | 87 | prog perl-db:DB_File-Lock = { |
michael@778 | 88 | version = %{V_db_file_lock} |
michael@778 | 89 | url = http://www.cpan.org/authors/id/D/DH/DHARRIS/ |
michael@778 | 90 | regex = DB_File-Lock-(__VER__)\.tar\.gz |
michael@778 | 91 | } |
michael@778 | 92 | |
michael@778 | 93 | %prep |
michael@778 | 94 | %setup -q -c |
michael@778 | 95 | %setup -q -T -D -a 1 |
michael@778 | 96 | %setup -q -T -D -a 2 |
michael@778 | 97 | %setup -q -T -D -a 3 |
michael@778 | 98 | %patch -p0 |
michael@779 | 99 | %{l_shtool} subst \ |
michael@779 | 100 | -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \ |
michael@779 | 101 | BerkeleyDB-*/BerkeleyDB.xs \ |
michael@779 | 102 | BerkeleyDB-*/BerkeleyDB.xs \ |
michael@779 | 103 | BerkeleyDB-*/typemap \ |
michael@779 | 104 | BerkeleyDB-*/typemap \ |
michael@779 | 105 | BerkeleyDB-*/BerkeleyDB.c \ |
michael@779 | 106 | BerkeleyDB-*/BerkeleyDB.c \ |
michael@779 | 107 | BDB-*/BDB.xs \ |
michael@779 | 108 | BDB-*/BDB.xs \ |
michael@779 | 109 | DB_File-*/README \ |
michael@779 | 110 | DB_File-*/README \ |
michael@779 | 111 | DB_File-*/config.in \ |
michael@779 | 112 | DB_File-*/config.in \ |
michael@779 | 113 | DB_File-*/typemap \ |
michael@779 | 114 | DB_File-*/typemap \ |
michael@779 | 115 | DB_File-*/DB_File.xs \ |
michael@779 | 116 | DB_File-*/DB_File.xs |
michael@778 | 117 | |
michael@778 | 118 | %build |
michael@778 | 119 | |
michael@778 | 120 | %install |
michael@778 | 121 | %{l_prefix}/bin/perl-openpkg prepare |
michael@778 | 122 | |
michael@778 | 123 | # build BerkeleyDB |
michael@778 | 124 | ( cd BerkeleyDB-%{V_berkeleydb} |
michael@778 | 125 | ( echo "INCLUDE = %{l_prefix}/include" |
michael@778 | 126 | echo "LIB = %{l_prefix}/lib" |
michael@778 | 127 | ) >config.in |
michael@778 | 128 | ) || exit $? |
michael@778 | 129 | %{l_prefix}/bin/perl-openpkg -d BerkeleyDB-%{V_berkeleydb} configure build install |
michael@778 | 130 | |
michael@778 | 131 | # build BDB |
michael@778 | 132 | %if "%{with_pthreads}" == "yes" |
michael@778 | 133 | %{l_shtool} subst \ |
michael@778 | 134 | -e 's;$INC = "";$INC = "%{l_cppflags} -pthread";' \ |
michael@778 | 135 | -e 's;-lpthread -ldb;%{l_ldflags} -pthread -ldb;' \ |
michael@778 | 136 | BDB-%{V_bdb}/Makefile.PL |
michael@778 | 137 | %{l_prefix}/bin/perl-openpkg -d BDB-%{V_bdb} configure build install |
michael@778 | 138 | %endif |
michael@778 | 139 | |
michael@778 | 140 | # build DB_File |
michael@778 | 141 | ( cd DB_File-%{V_db_file} |
michael@778 | 142 | ( echo "PREFIX = size_t" |
michael@778 | 143 | echo "HASH = u_int32_t" |
michael@778 | 144 | echo "INCLUDE = %{l_prefix}/include" |
michael@778 | 145 | echo "LIB = %{l_prefix}/lib" |
michael@778 | 146 | ) >config.in |
michael@778 | 147 | %{l_shtool} subst -e "s;INSTALLDIRS => .perl.,;;" Makefile.PL |
michael@778 | 148 | ) || exit $? |
michael@778 | 149 | %{l_prefix}/bin/perl-openpkg -d DB_File-%{V_db_file} configure build install |
michael@778 | 150 | |
michael@778 | 151 | %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install |
michael@778 | 152 | %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup |
michael@778 | 153 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files` |
michael@778 | 154 | |
michael@778 | 155 | %files -f files |
michael@778 | 156 | |
michael@778 | 157 | %clean |
michael@778 | 158 |