]> git.ipfire.org Git - ipfire-3.x.git/blame - compat-db/compat-db.nm
compat-db: Add compatibility for libdb-5.3
[ipfire-3.x.git] / compat-db / compat-db.nm
CommitLineData
04fc14b1
MT
1###############################################################################
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
4###############################################################################
5
6name = compat-db
20ec0afc 7version = %{main_version}
ffd22a7b 8# Release cannot be reset because the sub-packages won't get updated
972881e6 9release = 7
04fc14b1
MT
10thisapp = db-%{version}
11
12maintainer = Michael Tremer <michael.tremer@ipfire.org>
13groups = System/Libraries
14url = http://www.oracle.com/technology/products/berkeley-db/
15license = Proprietary
16summary = The Berkeley DB database compatibility library.
17
18description
19 Berkeley DB (BDB) is a computer software library that provides
20 a high-performance embedded database.
21
22 This package contains various version that were used in the
23 past. Some software may depend on them though.
24end
25
26version_db46 = 4.6.21
27version_db47 = 4.7.25
ffd22a7b
MT
28version_db48 = 4.8.30
29version_db52 = 5.2.36
972881e6
MT
30version_db53 = 5.3.28
31versions = %{version_db53} %{version_db52} %{version_db48} %{version_db47} %{version_db46}
32main_version:= %{version_db53}
04fc14b1
MT
33
34source_dl = http://download.oracle.com/berkeley-db/
972881e6
MT
35sources = db-%{version_db53}.tar.gz
36sources += db-%{version_db52}.tar.gz
ffd22a7b
MT
37sources += db-%{version_db48}.tar.gz
38sources += db-%{version_db47}.tar.gz
04fc14b1
MT
39sources += db-%{version_db46}.tar.gz
40
41build
42 requires
43 gcc-c++
44 end
45
46 CFLAGS += -fno-strict-aliasing
ffd22a7b 47 CFLAGS += -Wno-format
04fc14b1
MT
48
49 configure_options += \
50 --enable-compat185 \
51 --enable-cxx \
52 --disable-static
53
54 build
55 for version in %{versions}; do
56 cd %{DIR_SRC}/db-${version}/build_unix
57 ../dist/configure \
58 %{configure_options}
59
60 %{MACRO_FIX_LIBTOOL}
61
62 make %{PARALLELISMFLAGS}
63 done
64 end
65
66 install
67 for version in %{versions}; do
68 cd %{DIR_SRC}/db-${version}/build_unix
69 make install DESTDIR=%{BUILDROOT} \
70 docdir=%{datadir}/doc/db-${version}
71
72 # Remove unversioned libs.
ffd22a7b 73 rm -vf %{BUILDROOT}%{libdir}/libdb*-{5,4}.so
04fc14b1
MT
74
75 # Move binaries.
76 tag=$(echo ${version} | cut -c1,3)
77 for bin in %{BUILDROOT}%{bindir}/*db_*; do
78 t=$(echo ${bin} | sed "s/db_/db${tag}_/g")
79 mv -v ${bin} ${t}
80 done
81
82 # Move libs.
83 major=$(echo ${version} | cut -c1-3)
84 mkdir -pv %{BUILDROOT}%{libdir}/db${version}
85 pushd %{BUILDROOT}%{libdir}/db${version}
86 ln -svf ../libdb-${major}.so libdb.so
87 ln -svf ../libdb_cxx-${major}.so libdb_cxx.so
88 popd
89 rm -vf %{BUILDROOT}%{libdir}/libdb{,_cxx}.so
90
91 # Move headers.
ffd22a7b 92 mkdir -pv %{BUILDROOT}%{includedir}/db-${version}
04fc14b1 93 mv -v %{BUILDROOT}%{includedir}/*.h \
ffd22a7b 94 %{BUILDROOT}%{includedir}/db-${version}/
04fc14b1
MT
95
96 # Remove documentation.
97 rm -rf %{BUILDROOT}%{datadir}/doc
98 done
99 end
100end
101
102packages
103 package %{name}
ffd22a7b 104 requires
972881e6 105 compat-db53 = %{version_db53}-%{_release}
ffd22a7b
MT
106 compat-db52 = %{version_db52}-%{_release}
107 compat-db48 = %{version_db48}-%{_release}
108 compat-db47 = %{version_db47}-%{_release}
109 compat-db46 = %{version_db46}-%{_release}
110 end
04fc14b1 111 end
ffd22a7b 112
04fc14b1
MT
113 template COMPATDB
114 version = %{version_db%{version_tag}}
115
116 summary = The Berkeley DB database %{version} compatibility library.
117 description
118 The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
119 embedded database support for both traditional and client/server applications.
120
121 This package contains Berkeley DB library version %{version} used for compatibility.
122 end
123
124 files
125 %{bindir}/berkeley_db%{version_tag}_*
126 %{bindir}/db%{version_tag}_*
127 %{libdir}/db%{version}
128 %{libdir}/libdb*-%{version_major}.so
129 end
130
04fc14b1
MT
131 obsoletes
132 db4 < 1:%{version_major}
133 db4-devel < 1:%{version_major}
134 db4-cxx < 1:%{version_major}
135 db4-utils < 1:%{version_major}
ffd22a7b
MT
136
137 libdb < %{version_major}
138 end
139
140 conflicts
141 libdb = %{version_major}
04fc14b1
MT
142 end
143 end
144
972881e6
MT
145 package %{name}53
146 template COMPATDB
147
148 version_tag = 53
149 version_major = 5.3
150 end
151
ffd22a7b
MT
152 package %{name}52
153 template COMPATDB
154
155 version_tag = 52
156 version_major = 5.2
157 end
158
159 package %{name}48
160 template COMPATDB
161
162 version_tag = 48
163 version_major = 4.8
164 end
165
04fc14b1
MT
166 package %{name}47
167 template COMPATDB
168
169 version_tag = 47
170 version_major = 4.7
171 end
172
173 package %{name}46
174 template COMPATDB
175
176 version_tag = 46
177 version_major = 4.6
178 end
179
180 package %{name}-headers
181 summary = The Berkeley DB database compatibility headers.
182 description
183 The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
184 embedded database support for both traditional and client/server applications.
185
186 This package contains Berkeley DB library headers used for compatibility.
187 end
188 arch = noarch
189
190 files = %{includedir}
ffd22a7b
MT
191
192 requires
193 compat-db = %{main_version}-%{_release}
194 end
04fc14b1
MT
195 end
196
197 package %{name}-debuginfo
198 template DEBUGINFO
199 end
200end