/[gentoo-x86]/sys-libs/db/db-5.0.32.ebuild
Gentoo

Contents of /sys-libs/db/db-5.0.32.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Nov 25 19:23:39 2012 UTC (5 months, 3 weeks ago) by ulm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +2 -2 lines
Update LICENSE: DB and OracleDB are identical, except for the different copyright holder. They have been unified in the "Sleepycat" license template, which is the name used by both OSI and SPDX. Bug 300426.

(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key E7BE08CA7DC6EA25)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-libs/db/db-5.0.32.ebuild,v 1.4 2012/05/29 10:42:37 ryao Exp $
4
5 EAPI=2
6 inherit eutils db flag-o-matic java-pkg-opt-2 autotools multilib
7
8 #Number of official patches
9 #PATCHNO=`echo ${PV}|sed -e "s,\(.*_p\)\([0-9]*\),\2,"`
10 PATCHNO=${PV/*.*.*_p}
11 if [[ ${PATCHNO} == "${PV}" ]] ; then
12 MY_PV=${PV}
13 MY_P=${P}
14 PATCHNO=0
15 else
16 MY_PV=${PV/_p${PATCHNO}}
17 MY_P=${PN}-${MY_PV}
18 fi
19
20 S_BASE="${WORKDIR}/${MY_P}"
21 S="${S_BASE}/build_unix"
22 DESCRIPTION="Oracle Berkeley DB"
23 HOMEPAGE="http://www.oracle.com/technology/software/products/berkeley-db/index.html"
24 SRC_URI="http://download.oracle.com/berkeley-db/${MY_P}.tar.gz"
25 for (( i=1 ; i<=${PATCHNO} ; i++ )) ; do
26 export SRC_URI="${SRC_URI} http://www.oracle.com/technology/products/berkeley-db/db/update/${MY_PV}/patch.${MY_PV}.${i}"
27 done
28
29 LICENSE="Sleepycat"
30 SLOT="5.0"
31 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
32 IUSE="doc java cxx tcl test"
33
34 # the entire testsuite needs the TCL functionality
35 DEPEND="tcl? ( >=dev-lang/tcl-8.4 )
36 test? ( >=dev-lang/tcl-8.4 )
37 java? ( >=virtual/jdk-1.5 )
38 >=sys-devel/binutils-2.16.1"
39 RDEPEND="tcl? ( dev-lang/tcl )
40 java? ( >=virtual/jre-1.5 )"
41
42 src_unpack() {
43 unpack "${MY_P}".tar.gz
44 }
45
46 src_prepare() {
47 cd "${WORKDIR}"/"${MY_P}"
48 for (( i=1 ; i<=${PATCHNO} ; i++ ))
49 do
50 epatch "${DISTDIR}"/patch."${MY_PV}"."${i}"
51 done
52 epatch "${FILESDIR}"/${PN}-4.8-libtool.patch
53 epatch "${FILESDIR}"/${PN}-4.8.24-java-manifest-location.patch
54 epatch "${FILESDIR}"/${PN}-4.8.30-rename-atomic-compare-exchange.patch
55
56 # use the includes from the prefix
57 epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
58 epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
59
60 # upstream autoconf fails to build DBM when it's supposed to
61 # merged upstream in 5.0.26
62 #epatch "${FILESDIR}"/${PN}-5.0.21-enable-dbm-autoconf.patch
63
64 # Upstream release script grabs the dates when the script was run, so lets
65 # end-run them to keep the date the same.
66 export REAL_DB_RELEASE_DATE="$(awk \
67 '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
68 "${S_BASE}"/dist/configure)"
69 sed -r -i \
70 -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
71 "${S_BASE}"/dist/RELEASE
72
73 # Include the SLOT for Java JAR files
74 # This supersedes the unused jarlocation patches.
75 sed -r -i \
76 -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
77 "${S_BASE}"/dist/Makefile.in
78
79 cd "${S_BASE}"/dist
80 rm -f aclocal/libtool.m4
81 sed -i \
82 -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
83 configure.ac
84 sed -i \
85 -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
86 aclocal/programs.m4
87 AT_M4DIR="aclocal aclocal_java" eautoreconf
88 # Upstream sucks - they do autoconf and THEN replace the version variables.
89 . ./RELEASE
90 for v in \
91 DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
92 DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
93 DB_VERSION \
94 DB_RELEASE_DATE ; do
95 local ev="__EDIT_${v}__"
96 sed -i -e "s/${ev}/${!v}/g" configure
97 done
98 }
99
100 src_configure() {
101 local myconf=''
102
103 # compilation with -O0 fails on amd64, see bug #171231
104 if use amd64; then
105 replace-flags -O0 -O2
106 is-flagq -O[s123] || append-flags -O2
107 fi
108
109 # use `set` here since the java opts will contain whitespace
110 set --
111 if use java ; then
112 set -- "$@" \
113 --with-java-prefix="${JAVA_HOME}" \
114 --with-javac-flags="$(java-pkg_javac-args)"
115 fi
116
117 # Add linker versions to the symbols. Easier to do, and safer than header file
118 # mumbo jumbo.
119 if use userland_GNU ; then
120 append-ldflags -Wl,--default-symver
121 fi
122
123 # Bug #270851: test needs TCL support
124 if use tcl || use test ; then
125 myconf="${myconf} --enable-tcl"
126 myconf="${myconf} --with-tcl=/usr/$(get_libdir)"
127 else
128 myconf="${myconf} --disable-tcl"
129 fi
130
131 # sql_compat will cause a collision with sqlite3
132 # --enable-sql_compat
133 cd "${S}"
134 ECONF_SOURCE="${S_BASE}"/dist \
135 STRIP="true" \
136 econf \
137 --enable-compat185 \
138 --enable-dbm \
139 --enable-o_direct \
140 --without-uniquename \
141 --enable-sql \
142 --enable-sql_codegen \
143 --disable-sql_compat \
144 $(use arm && echo --with-mutex=ARM/gcc-assembly) \
145 $(use amd64 && echo --with-mutex=x86/gcc-assembly) \
146 $(use_enable cxx) \
147 $(use_enable cxx stl) \
148 $(use_enable java) \
149 ${myconf} \
150 $(use_enable test) \
151 "$@"
152 }
153
154 src_compile() {
155 emake || die "make failed"
156 }
157
158 src_install() {
159 emake install DESTDIR="${D}" || die
160
161 db_src_install_usrbinslot
162
163 db_src_install_headerslot
164
165 db_src_install_doc
166
167 db_src_install_usrlibcleanup
168
169 dodir /usr/sbin
170 # This file is not always built, and no longer exists as of db-4.8
171 [[ -f "${D}"/usr/bin/berkeley_db_svc ]] && \
172 mv "${D}"/usr/bin/berkeley_db_svc "${D}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
173
174 if use java; then
175 java-pkg_regso "${D}"/usr/"$(get_libdir)"/libdb_java*.so
176 java-pkg_dojar "${D}"/usr/"$(get_libdir)"/*.jar
177 rm -f "${D}"/usr/"$(get_libdir)"/*.jar
178 fi
179 }
180
181 pkg_postinst() {
182 db_fix_so
183 }
184
185 pkg_postrm() {
186 db_fix_so
187 }
188
189 src_test() {
190 # db_repsite is impossible to build, as upstream strips those sources.
191 # db_repsite is used directly in the setup_site_prog,
192 # setup_site_prog is called from open_site_prog
193 # which is called only from tests in the multi_repmgr group.
194 #sed -ri \
195 # -e '/set subs/s,multi_repmgr,,g' \
196 # "${S_BASE}/test/testparams.tcl"
197 sed -ri \
198 -e '/multi_repmgr/d' \
199 "${S_BASE}/test/test.tcl"
200
201 db_src_test
202 }

  ViewVC Help
Powered by ViewVC 1.1.13