]> git.ipfire.org Git - ipfire-3.x.git/blame - compat-db/compat-db.nm
compat-db: Fix build on aarch64
[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
5b363179 9release = 8
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
5b363179
MT
56 # Fix autotools on aarch64
57 for i in $(find %{DIR_SRC}/db-${version} -name config.guess -or -name config.sub); do
58 if ! grep -q "aarch64" ${i}; then
59 if [ -e "%{datadir}/pakfire/$(basename ${i})" ]; then
60 cp -vf %{datadir}/pakfire/$(basename ${i}) $(dirname ${i})
61 fi
62 fi
63 done
64
04fc14b1
MT
65 cd %{DIR_SRC}/db-${version}/build_unix
66 ../dist/configure \
67 %{configure_options}
68
69 %{MACRO_FIX_LIBTOOL}
70
71 make %{PARALLELISMFLAGS}
72 done
73 end
74
75 install
76 for version in %{versions}; do
77 cd %{DIR_SRC}/db-${version}/build_unix
78 make install DESTDIR=%{BUILDROOT} \
79 docdir=%{datadir}/doc/db-${version}
80
81 # Remove unversioned libs.
ffd22a7b 82 rm -vf %{BUILDROOT}%{libdir}/libdb*-{5,4}.so
04fc14b1
MT
83
84 # Move binaries.
85 tag=$(echo ${version} | cut -c1,3)
86 for bin in %{BUILDROOT}%{bindir}/*db_*; do
87 t=$(echo ${bin} | sed "s/db_/db${tag}_/g")
88 mv -v ${bin} ${t}
89 done
90
91 # Move libs.
92 major=$(echo ${version} | cut -c1-3)
93 mkdir -pv %{BUILDROOT}%{libdir}/db${version}
94 pushd %{BUILDROOT}%{libdir}/db${version}
95 ln -svf ../libdb-${major}.so libdb.so
96 ln -svf ../libdb_cxx-${major}.so libdb_cxx.so
97 popd
98 rm -vf %{BUILDROOT}%{libdir}/libdb{,_cxx}.so
99
100 # Move headers.
ffd22a7b 101 mkdir -pv %{BUILDROOT}%{includedir}/db-${version}
04fc14b1 102 mv -v %{BUILDROOT}%{includedir}/*.h \
ffd22a7b 103 %{BUILDROOT}%{includedir}/db-${version}/
04fc14b1
MT
104
105 # Remove documentation.
106 rm -rf %{BUILDROOT}%{datadir}/doc
107 done
108 end
109end
110
111packages
112 package %{name}
ffd22a7b 113 requires
972881e6 114 compat-db53 = %{version_db53}-%{_release}
ffd22a7b
MT
115 compat-db52 = %{version_db52}-%{_release}
116 compat-db48 = %{version_db48}-%{_release}
117 compat-db47 = %{version_db47}-%{_release}
118 compat-db46 = %{version_db46}-%{_release}
119 end
04fc14b1 120 end
ffd22a7b 121
04fc14b1
MT
122 template COMPATDB
123 version = %{version_db%{version_tag}}
124
125 summary = The Berkeley DB database %{version} compatibility library.
126 description
127 The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
128 embedded database support for both traditional and client/server applications.
129
130 This package contains Berkeley DB library version %{version} used for compatibility.
131 end
132
133 files
134 %{bindir}/berkeley_db%{version_tag}_*
135 %{bindir}/db%{version_tag}_*
136 %{libdir}/db%{version}
137 %{libdir}/libdb*-%{version_major}.so
138 end
139
04fc14b1
MT
140 obsoletes
141 db4 < 1:%{version_major}
142 db4-devel < 1:%{version_major}
143 db4-cxx < 1:%{version_major}
144 db4-utils < 1:%{version_major}
ffd22a7b
MT
145
146 libdb < %{version_major}
147 end
148
149 conflicts
150 libdb = %{version_major}
04fc14b1
MT
151 end
152 end
153
972881e6
MT
154 package %{name}53
155 template COMPATDB
156
157 version_tag = 53
158 version_major = 5.3
159 end
160
ffd22a7b
MT
161 package %{name}52
162 template COMPATDB
163
164 version_tag = 52
165 version_major = 5.2
166 end
167
168 package %{name}48
169 template COMPATDB
170
171 version_tag = 48
172 version_major = 4.8
173 end
174
04fc14b1
MT
175 package %{name}47
176 template COMPATDB
177
178 version_tag = 47
179 version_major = 4.7
180 end
181
182 package %{name}46
183 template COMPATDB
184
185 version_tag = 46
186 version_major = 4.6
187 end
188
189 package %{name}-headers
190 summary = The Berkeley DB database compatibility headers.
191 description
192 The Berkeley Database (Berkeley DB) is a programmatic toolkit that provides
193 embedded database support for both traditional and client/server applications.
194
195 This package contains Berkeley DB library headers used for compatibility.
196 end
197 arch = noarch
198
199 files = %{includedir}
ffd22a7b
MT
200
201 requires
202 compat-db = %{main_version}-%{_release}
203 end
04fc14b1
MT
204 end
205
206 package %{name}-debuginfo
207 template DEBUGINFO
208 end
209end