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