michael@778: ## michael@778: ## perl-db.spec -- OpenPKG RPM Package Specification michael@778: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@778: ## michael@778: ## Permission to use, copy, modify, and distribute this software for michael@778: ## any purpose with or without fee is hereby granted, provided that michael@778: ## the above copyright notice and this permission notice appear in all michael@778: ## copies. michael@778: ## michael@778: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@778: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@778: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@778: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@778: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@778: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@778: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@778: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@778: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@778: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@778: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@778: ## SUCH DAMAGE. michael@778: ## michael@778: michael@778: # versions of individual parts michael@778: %define V_perl 5.16 michael@779: %define V_berkeleydb 0.52 michael@779: %define V_bdb 1.9 michael@779: %define V_db_file 1.828 michael@778: %define V_db_file_lock 0.05 michael@778: michael@778: # package information michael@778: Name: perl-db michael@778: Summary: Perl Modules for use with Berkeley-DB michael@778: URL: http://www.cpan.org/ michael@778: Vendor: Perl Community michael@778: Packager: OpenPKG Foundation e.V. michael@778: Distribution: OpenPKG Community michael@778: Class: BASE michael@778: Group: Perl michael@778: License: GPL/Artistic michael@778: Version: %{V_perl} michael@778: Release: 20120531 michael@778: michael@778: # package options michael@778: %option with_pthreads no michael@778: michael@778: # list of sources michael@778: Source0: http://www.cpan.org/authors/id/P/PM/PMQS/BerkeleyDB-%{V_berkeleydb}.tar.gz michael@778: Source1: http://www.cpan.org/authors/id/M/ML/MLEHMANN/BDB-%{V_bdb}.tar.gz michael@778: Source2: http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-%{V_db_file}.tar.gz michael@778: Source3: http://www.cpan.org/authors/id/D/DH/DHARRIS/DB_File-Lock-%{V_db_file_lock}.tar.gz michael@778: Patch0: perl-db.patch michael@778: michael@778: # build information michael@778: BuildPreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126 michael@778: PreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl} michael@778: BuildPreReq: db >= 4.1.24 michael@778: PreReq: db >= 4.1.24 michael@778: %if "%{with_pthreads}" == "yes" michael@778: BuildPreReq: db::with_pthreads = yes michael@778: PreReq: db::with_pthreads = yes michael@778: %endif michael@778: michael@778: %description michael@778: Various modules for using the Berkeley-DB library from within Perl: michael@778: - BerkeleyDB (%{V_berkeleydb}) michael@778: - BDB (%{V_bdb}) michael@778: - DB_File (%{V_db_file}) michael@778: - DB_File::Lock (%{V_db_file_lock}) michael@778: michael@778: %track michael@778: prog perl-db:BerkeleyDB = { michael@778: version = %{V_berkeleydb} michael@778: url = http://www.cpan.org/authors/id/P/PM/PMQS/ michael@778: regex = BerkeleyDB-(__VER__)\.tar\.gz michael@778: } michael@778: prog perl-db:BDB = { michael@778: version = %{V_bdb} michael@778: url = http://www.cpan.org/authors/id/M/ML/MLEHMANN/ michael@778: regex = BDB-(__VER__)\.tar\.gz michael@778: } michael@778: prog perl-db:DB_File = { michael@778: version = %{V_db_file} michael@778: url = http://www.cpan.org/authors/id/P/PM/PMQS/ michael@778: regex = DB_File-(__VER__)\.tar\.gz michael@778: } michael@778: prog perl-db:DB_File-Lock = { michael@778: version = %{V_db_file_lock} michael@778: url = http://www.cpan.org/authors/id/D/DH/DHARRIS/ michael@778: regex = DB_File-Lock-(__VER__)\.tar\.gz michael@778: } michael@778: michael@778: %prep michael@778: %setup -q -c michael@778: %setup -q -T -D -a 1 michael@778: %setup -q -T -D -a 2 michael@778: %setup -q -T -D -a 3 michael@778: %patch -p0 michael@779: %{l_shtool} subst \ michael@779: -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \ michael@779: BerkeleyDB-*/BerkeleyDB.xs \ michael@779: BerkeleyDB-*/BerkeleyDB.xs \ michael@779: BerkeleyDB-*/typemap \ michael@779: BerkeleyDB-*/typemap \ michael@779: BerkeleyDB-*/BerkeleyDB.c \ michael@779: BerkeleyDB-*/BerkeleyDB.c \ michael@779: BDB-*/BDB.xs \ michael@779: BDB-*/BDB.xs \ michael@779: DB_File-*/README \ michael@779: DB_File-*/README \ michael@779: DB_File-*/config.in \ michael@779: DB_File-*/config.in \ michael@779: DB_File-*/typemap \ michael@779: DB_File-*/typemap \ michael@779: DB_File-*/DB_File.xs \ michael@779: DB_File-*/DB_File.xs michael@778: michael@778: %build michael@778: michael@778: %install michael@778: %{l_prefix}/bin/perl-openpkg prepare michael@778: michael@778: # build BerkeleyDB michael@778: ( cd BerkeleyDB-%{V_berkeleydb} michael@778: ( echo "INCLUDE = %{l_prefix}/include" michael@778: echo "LIB = %{l_prefix}/lib" michael@778: ) >config.in michael@778: ) || exit $? michael@778: %{l_prefix}/bin/perl-openpkg -d BerkeleyDB-%{V_berkeleydb} configure build install michael@778: michael@778: # build BDB michael@778: %if "%{with_pthreads}" == "yes" michael@778: %{l_shtool} subst \ michael@778: -e 's;$INC = "";$INC = "%{l_cppflags} -pthread";' \ michael@778: -e 's;-lpthread -ldb;%{l_ldflags} -pthread -ldb;' \ michael@778: BDB-%{V_bdb}/Makefile.PL michael@778: %{l_prefix}/bin/perl-openpkg -d BDB-%{V_bdb} configure build install michael@778: %endif michael@778: michael@778: # build DB_File michael@778: ( cd DB_File-%{V_db_file} michael@778: ( echo "PREFIX = size_t" michael@778: echo "HASH = u_int32_t" michael@778: echo "INCLUDE = %{l_prefix}/include" michael@778: echo "LIB = %{l_prefix}/lib" michael@778: ) >config.in michael@778: %{l_shtool} subst -e "s;INSTALLDIRS => .perl.,;;" Makefile.PL michael@778: ) || exit $? michael@778: %{l_prefix}/bin/perl-openpkg -d DB_File-%{V_db_file} configure build install michael@778: michael@778: %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install michael@778: %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup michael@778: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files` michael@778: michael@778: %files -f files michael@778: michael@778: %clean michael@778: