]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blame - libdb/libdb.nm
libdb: Switch to patchelf to remove the RPATH
[people/stevee/ipfire-3.x.git] / libdb / libdb.nm
CommitLineData
ab6c9f35
MT
1###############################################################################
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
4###############################################################################
5
6name = libdb
4d95524b
AM
7version_major = 6
8version_minor = 1
9version_patch = 26
ab6c9f35 10version = %{version_major}.%{version_minor}.%{version_patch}
7d1a3678 11release = 5
ab6c9f35
MT
12thisapp = db-%{version}
13
14soversion = %{version_major}.%{version_minor}
15
16maintainer = Michael Tremer <michael.tremer@ipfire.org>
17groups = System/Libraries
18url = http://www.oracle.com/technology/products/berkeley-db/
19license = Proprietary
20summary = Berkeley DB is a library that provides an embedded database.
21
22description
23 Berkeley DB (BDB) is a computer software library that provides
24 a high-performance embedded database.
25end
26
27source_dl = http://download.oracle.com/berkeley-db/
28
29build
30 requires
c5bfdc18 31 automake
ab6c9f35
MT
32 gcc-c++
33 libtool
7d1a3678 34 patchelf
ab6c9f35 35 perl
c5bfdc18 36 zlib-devel
ab6c9f35
MT
37 end
38
39 CFLAGS += -fno-strict-aliasing
40
41 DIR_APP = %{DIR_SRC}/%{thisapp}/dist/dist-tls
42
43 prepare_cmds
c5bfdc18
MT
44 for i in $(find %{DIR_SRC}/%{thisapp} -name config.guess -or -name config.sub); do
45 cp -vf %{datadir}/automake-*/config.{guess,sub} $(dirname ${i})
46 done
47
48 mkdir -pv %{DIR_APP} && cd %{DIR_APP}
49 ln -svf ../configure .
ab6c9f35
MT
50 end
51
52 MACRO_FIX_LIBTOOL
53 # Remove libtool predep_objects and postdep_objects wonkiness so that
54 # building without -nostdlib doesn't include them twice. Because we
55 # already link with g++, weird stuff happens if you don't let the
56 # compiler handle this.
57 perl -pi -e 's/^predep_objects=".*$/predep_objects=""/' libtool
58 perl -pi -e 's/^postdep_objects=".*$/postdep_objects=""/' libtool
59 perl -pi -e 's/-shared -nostdlib/-shared/' libtool
60 end
61
62 configure_options += \
63 -C \
64 --enable-compat185 \
65 --enable-cxx \
66 --enable-sql \
67 --disable-static \
50e06e54
MT
68 --disable-rpath \
69 STRIP=:
ab6c9f35
MT
70
71 install_cmds
72 # Remove RPATH in all binaries.
73 for i in %{BUILDROOT}%{bindir}/*; do
7d1a3678 74 patchelf --remove-rpath ${i}
ab6c9f35
MT
75 done
76
77 # Remove documentation which is very big.
867e9a49 78 rm -rf %{BUILDROOT}%{prefix}/docs
ab6c9f35
MT
79
80 # Remove unversioned libs.
81 rm -vf %{BUILDROOT}%{libdir}/libdb*-%{version_major}.so
82
83 mkdir -pv %{BUILDROOT}%{includedir}/%{name}
84 mv -v %{BUILDROOT}%{includedir}/*.h %{BUILDROOT}%{includedir}/%{name}/
85 for i in db.h db_cxx.h db_185.h; do
86 ln -svf %{name}/${i} %{BUILDROOT}/%{includedir}
87 done
6049dfde
SS
88
89 # Fix binary permissions.
90 find %{BUILDROOT}%{bindir} -type f -executable \
91 -exec chmod 755 {} \;
92
93 # Fix header permissions.
94 find %{BUILDROOT}%{includedir} -type f -iname "*.h" \
95 -exec chmod 644 {} \;
ab6c9f35
MT
96 end
97end
98
99packages
100 package %{name}
101
102 package %{name}-devel
103 template DEVEL
104
ebaf588e
MT
105 obsoletes
106 compat-db-headers
107 end
108
6208ca27
MT
109 # You cannot install libdb-devel and db4-devel
110 # at the same time.
111 conflicts
ebaf588e 112 compat-db-headers
6208ca27
MT
113 db4-devel
114 end
115
ab6c9f35
MT
116 files += !%{libdir}/libdb-%{soversion}.so
117 files += !%{libdir}/libdb_sql-%{soversion}.so
118 end
119
120 package %{name}-utils
121 summary = Command line tools for managing Berkeley DB (version 4) databases.
122 description = %{summary}
123
124 files
125 /usr/bin
126 end
127 end
128
129 package %{name}-cxx
130 summary = The Berkeley DB database library (version 4) for C++.
131 description = %{summary}
132
133 files
134 %{libdir}/libdb_cxx-%{soversion}.so
135 end
136 end
137
138 package %{name}-debuginfo
139 template DEBUGINFO
140 end
141end