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

Contents of /sys-libs/db/db-5.1.19-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu May 24 05:34:44 2012 UTC (22 months, 3 weeks ago) by vapier
Branch: MAIN
Changes since 1.2: +3 -3 lines
Drop unused libtool inherit, and add missing multilib.

(Portage version: 2.2.0_alpha107_p3/cvs/Linux x86_64)

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.1.19-r2.ebuild,v 1.2 2011/11/13 20:38:10 vapier 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="OracleDB"
30 SLOT="5.1"
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
55 # use the includes from the prefix
56 epatch "${FILESDIR}"/${PN}-4.6-jni-check-prefix-first.patch
57 epatch "${FILESDIR}"/${PN}-4.3-listen-to-java-options.patch
58
59 # upstream autoconf fails to build DBM when it's supposed to
60 # merged upstream in 5.0.26
61 #epatch "${FILESDIR}"/${PN}-5.0.21-enable-dbm-autoconf.patch
62
63 # Upstream release script grabs the dates when the script was run, so lets
64 # end-run them to keep the date the same.
65 export REAL_DB_RELEASE_DATE="$(awk \
66 '/^DB_VERSION_STRING=/{ gsub(".*\\(|\\).*","",$0); print $0; }' \
67 "${S_BASE}"/dist/configure)"
68 sed -r -i \
69 -e "/^DB_RELEASE_DATE=/s~=.*~='${REAL_DB_RELEASE_DATE}'~g" \
70 "${S_BASE}"/dist/RELEASE
71
72 # Include the SLOT for Java JAR files
73 # This supersedes the unused jarlocation patches.
74 sed -r -i \
75 -e '/jarfile=.*\.jar$/s,(.jar$),-$(LIBVERSION)\1,g' \
76 "${S_BASE}"/dist/Makefile.in
77
78 cd "${S_BASE}"/dist
79 rm -f aclocal/libtool.m4
80 sed -i \
81 -e '/AC_PROG_LIBTOOL$/aLT_OUTPUT' \
82 configure.ac
83 sed -i \
84 -e '/^AC_PATH_TOOL/s/ sh, none/ bash, none/' \
85 aclocal/programs.m4
86 AT_M4DIR="aclocal aclocal_java" eautoreconf
87 # Upstream sucks - they do autoconf and THEN replace the version variables.
88 . ./RELEASE
89 for v in \
90 DB_VERSION_{FAMILY,LETTER,RELEASE,MAJOR,MINOR} \
91 DB_VERSION_{PATCH,FULL,UNIQUE_NAME,STRING,FULL_STRING} \
92 DB_VERSION \
93 DB_RELEASE_DATE ; do
94 local ev="__EDIT_${v}__"
95 sed -i -e "s/${ev}/${!v}/g" configure
96 done
97 }
98
99 src_configure() {
100 local myconf=''
101
102 # compilation with -O0 fails on amd64, see bug #171231
103 if use amd64; then
104 replace-flags -O0 -O2
105 is-flagq -O[s123] || append-flags -O2
106 fi
107
108 # use `set` here since the java opts will contain whitespace
109 set --
110 if use java ; then
111 set -- "$@" \
112 --with-java-prefix="${JAVA_HOME}" \
113 --with-javac-flags="$(java-pkg_javac-args)"
114 fi
115
116 # Add linker versions to the symbols. Easier to do, and safer than header file
117 # mumbo jumbo.
118 if use userland_GNU ; then
119 append-ldflags -Wl,--default-symver
120 fi
121
122 # Bug #270851: test needs TCL support
123 if use tcl || use test ; then
124 myconf="${myconf} --enable-tcl"
125 myconf="${myconf} --with-tcl=/usr/$(get_libdir)"
126 else
127 myconf="${myconf} --disable-tcl"
128 fi
129
130 # sql_compat will cause a collision with sqlite3
131 # --enable-sql_compat
132 cd "${S}"
133 ECONF_SOURCE="${S_BASE}"/dist \
134 STRIP="true" \
135 econf \
136 --enable-compat185 \
137 --enable-dbm \
138 --enable-o_direct \
139 --without-uniquename \
140 --enable-sql \
141 --enable-sql_codegen \
142 --disable-sql_compat \
143 $(use arm && echo --with-mutex=ARM/gcc-assembly) \
144 $(use amd64 && echo --with-mutex=x86/gcc-assembly) \
145 $(use_enable cxx) \
146 $(use_enable cxx stl) \
147 $(use_enable java) \
148 ${myconf} \
149 $(use_enable test) \
150 "$@"
151 }
152
153 src_compile() {
154 emake || die "make failed"
155 }
156
157 src_install() {
158 emake install DESTDIR="${D}" || die
159
160 db_src_install_usrbinslot
161
162 db_src_install_headerslot
163
164 db_src_install_doc
165
166 db_src_install_usrlibcleanup
167
168 dodir /usr/sbin
169 # This file is not always built, and no longer exists as of db-4.8
170 [[ -f "${D}"/usr/bin/berkeley_db_svc ]] && \
171 mv "${D}"/usr/bin/berkeley_db_svc "${D}"/usr/sbin/berkeley_db"${SLOT/./}"_svc
172
173 if use java; then
174 java-pkg_regso "${D}"/usr/"$(get_libdir)"/libdb_java*.so
175 java-pkg_dojar "${D}"/usr/"$(get_libdir)"/*.jar
176 rm -f "${D}"/usr/"$(get_libdir)"/*.jar
177 fi
178 }
179
180 pkg_postinst() {
181 db_fix_so
182 }
183
184 pkg_postrm() {
185 db_fix_so
186 }
187
188 src_test() {
189 # db_repsite is impossible to build, as upstream strips those sources.
190 # db_repsite is used directly in the setup_site_prog,
191 # setup_site_prog is called from open_site_prog
192 # which is called only from tests in the multi_repmgr group.
193 #sed -ri \
194 # -e '/set subs/s,multi_repmgr,,g' \
195 # "${S_BASE}/test/testparams.tcl"
196 sed -ri \
197 -e '/multi_repmgr/d' \
198 "${S_BASE}/test/tcl/test.tcl"
199
200 db_src_test
201 }

  ViewVC Help
Powered by ViewVC 1.1.20