perl-db/perl-db.spec

changeset 778
389c33ef5a93
child 779
8a3648cce554
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/perl-db/perl-db.spec	Mon Jul 01 21:20:32 2013 +0200
     1.3 @@ -0,0 +1,140 @@
     1.4 +##
     1.5 +##  perl-db.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   versions of individual parts
    1.28 +%define       V_perl           5.16
    1.29 +%define       V_berkeleydb     0.51
    1.30 +%define       V_bdb            1.89
    1.31 +%define       V_db_file        1.826
    1.32 +%define       V_db_file_lock   0.05
    1.33 +
    1.34 +#   package information
    1.35 +Name:         perl-db
    1.36 +Summary:      Perl Modules for use with Berkeley-DB
    1.37 +URL:          http://www.cpan.org/
    1.38 +Vendor:       Perl Community
    1.39 +Packager:     OpenPKG Foundation e.V.
    1.40 +Distribution: OpenPKG Community
    1.41 +Class:        BASE
    1.42 +Group:        Perl
    1.43 +License:      GPL/Artistic
    1.44 +Version:      %{V_perl}
    1.45 +Release:      20120531
    1.46 +
    1.47 +#   package options
    1.48 +%option       with_pthreads  no
    1.49 +
    1.50 +#   list of sources
    1.51 +Source0:      http://www.cpan.org/authors/id/P/PM/PMQS/BerkeleyDB-%{V_berkeleydb}.tar.gz
    1.52 +Source1:      http://www.cpan.org/authors/id/M/ML/MLEHMANN/BDB-%{V_bdb}.tar.gz
    1.53 +Source2:      http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-%{V_db_file}.tar.gz
    1.54 +Source3:      http://www.cpan.org/authors/id/D/DH/DHARRIS/DB_File-Lock-%{V_db_file_lock}.tar.gz
    1.55 +Patch0:       perl-db.patch
    1.56 +
    1.57 +#   build information
    1.58 +BuildPreReq:  OpenPKG, openpkg >= 20100101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
    1.59 +PreReq:       OpenPKG, openpkg >= 20100101, perl >= %{V_perl}
    1.60 +BuildPreReq:  db >= 4.1.24
    1.61 +PreReq:       db >= 4.1.24
    1.62 +%if "%{with_pthreads}" == "yes"
    1.63 +BuildPreReq:  db::with_pthreads = yes
    1.64 +PreReq:       db::with_pthreads = yes
    1.65 +%endif
    1.66 +
    1.67 +%description
    1.68 +    Various modules for using the Berkeley-DB library from within Perl:
    1.69 +    - BerkeleyDB (%{V_berkeleydb})
    1.70 +    - BDB (%{V_bdb})
    1.71 +    - DB_File (%{V_db_file})
    1.72 +    - DB_File::Lock (%{V_db_file_lock})
    1.73 +
    1.74 +%track
    1.75 +    prog perl-db:BerkeleyDB = {
    1.76 +        version   = %{V_berkeleydb}
    1.77 +        url       = http://www.cpan.org/authors/id/P/PM/PMQS/
    1.78 +        regex     = BerkeleyDB-(__VER__)\.tar\.gz
    1.79 +    }
    1.80 +    prog perl-db:BDB = {
    1.81 +        version   = %{V_bdb}
    1.82 +        url       = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
    1.83 +        regex     = BDB-(__VER__)\.tar\.gz
    1.84 +    }
    1.85 +    prog perl-db:DB_File = {
    1.86 +        version   = %{V_db_file}
    1.87 +        url       = http://www.cpan.org/authors/id/P/PM/PMQS/
    1.88 +        regex     = DB_File-(__VER__)\.tar\.gz
    1.89 +    }
    1.90 +    prog perl-db:DB_File-Lock = {
    1.91 +        version   = %{V_db_file_lock}
    1.92 +        url       = http://www.cpan.org/authors/id/D/DH/DHARRIS/
    1.93 +        regex     = DB_File-Lock-(__VER__)\.tar\.gz
    1.94 +    }
    1.95 +
    1.96 +%prep
    1.97 +    %setup -q -c
    1.98 +    %setup -q -T -D -a 1
    1.99 +    %setup -q -T -D -a 2
   1.100 +    %setup -q -T -D -a 3
   1.101 +    %patch -p0
   1.102 +
   1.103 +%build
   1.104 +
   1.105 +%install
   1.106 +    %{l_prefix}/bin/perl-openpkg prepare
   1.107 +
   1.108 +    #   build BerkeleyDB
   1.109 +    ( cd BerkeleyDB-%{V_berkeleydb}
   1.110 +      ( echo "INCLUDE = %{l_prefix}/include"
   1.111 +        echo "LIB = %{l_prefix}/lib"
   1.112 +      ) >config.in
   1.113 +    ) || exit $?
   1.114 +    %{l_prefix}/bin/perl-openpkg -d BerkeleyDB-%{V_berkeleydb} configure build install
   1.115 +
   1.116 +    #   build BDB
   1.117 +%if "%{with_pthreads}" == "yes"
   1.118 +    %{l_shtool} subst \
   1.119 +        -e 's;$INC = "";$INC = "%{l_cppflags} -pthread";' \
   1.120 +        -e 's;-lpthread -ldb;%{l_ldflags} -pthread -ldb;' \
   1.121 +        BDB-%{V_bdb}/Makefile.PL
   1.122 +    %{l_prefix}/bin/perl-openpkg -d BDB-%{V_bdb} configure build install
   1.123 +%endif
   1.124 +
   1.125 +    #   build DB_File
   1.126 +    ( cd DB_File-%{V_db_file}
   1.127 +      ( echo "PREFIX = size_t"
   1.128 +        echo "HASH = u_int32_t"
   1.129 +        echo "INCLUDE = %{l_prefix}/include"
   1.130 +        echo "LIB = %{l_prefix}/lib"
   1.131 +      ) >config.in
   1.132 +      %{l_shtool} subst -e "s;INSTALLDIRS => .perl.,;;" Makefile.PL
   1.133 +    ) || exit $?
   1.134 +    %{l_prefix}/bin/perl-openpkg -d DB_File-%{V_db_file} configure build install
   1.135 +
   1.136 +    %{l_prefix}/bin/perl-openpkg -d %{SOURCE3}  configure build install
   1.137 +    %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
   1.138 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
   1.139 +
   1.140 +%files -f files
   1.141 +
   1.142 +%clean
   1.143 +

mercurial