Gentoo Archives: gentoo-commits

From: "Alexey Shvetsov (alexxy)" <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: virtuoso.eclass
Date: Mon, 08 Feb 2010 20:30:21
Message-Id: E1NeaFP-0006ty-Jy@stork.gentoo.org
1 alexxy 10/02/08 20:30:19
2
3 Added: virtuoso.eclass
4 Log:
5 Initial import
6
7 Revision Changes Path
8 1.1 eclass/virtuoso.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/virtuoso.eclass?rev=1.1&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/virtuoso.eclass?rev=1.1&content-type=text/plain
12
13 Index: virtuoso.eclass
14 ===================================================================
15 # Copyright 1999-2010 Gentoo Foundation
16 # Distributed under the terms of the GNU General Public License v2
17 # $Header: /var/cvsroot/gentoo-x86/eclass/virtuoso.eclass,v 1.1 2010/02/08 20:30:19 alexxy Exp $
18
19 # @ECLASS: virtuoso.eclass
20 # @MAINTAINER:
21 # Maciej Mrozowski <reavertm@g.o>
22 #
23 # @BLURB: Provides splitting functionality for Virtuoso
24 # @DESCRIPTION:
25 # This eclass provides common code for splitting Virtuoso OpenSource database
26
27 case ${EAPI:-0} in
28 2|3) : ;;
29 *) DEPEND="EAPI-TOO-OLD" ;;
30 esac
31
32 inherit base autotools flag-o-matic multilib
33
34 MY_P="virtuoso-opensource-${PV}"
35
36 case ${PV} in
37 *9999*)
38 ECVS_SERVER="virtuoso.cvs.sourceforge.net:/cvsroot/virtuoso"
39 SRC_URI=""
40 inherit cvs
41 ;;
42 *)
43 # Use this variable to determine distribution method (live or tarball)
44 TARBALL="${MY_P}.tar.gz"
45 SRC_URI="mirror://sourceforge/virtuoso/${TARBALL}"
46 ;;
47 esac
48
49 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install
50
51 # Set some defaults
52 HOMEPAGE="http://virtuoso.openlinksw.com/wiki/main/Main/"
53 LICENSE="GPL-2"
54 SLOT="0"
55
56 DEPEND=">=sys-devel/libtool-2.2.6a"
57 RDEPEND=""
58
59 S="${WORKDIR}/${MY_P}"
60
61 # @FUNCTION: virtuoso_src_prepare
62 # @DESCRIPTION:
63 # 1. Applies common release patches (from ${FILESDIR}/${PV}/ dir)
64 # 2. Applies package-specific patches (from ${FILESDIR}/, PATCHES can be used)
65 # 3. Modifies makefiles for split build. Uses VOS_EXTRACT
66 # 4. eautoreconf
67 virtuoso_src_prepare() {
68 debug-print-function ${FUNCNAME} "$@"
69
70 for file in "${FILESDIR}/${PV}"/*; do
71 epatch "${file}"
72 done
73
74 base_src_prepare
75
76 # @ECLASS-VARIABLE: VOS_EXTRACT
77 # @DESCRIPTION:
78 # Lists any subdirectories that are required to be extracted
79 # and enabled in Makefile.am's for current package.
80 if [[ -n ${VOS_EXTRACT} ]]; then
81 # Comment out everything
82 find . -name Makefile.am -exec \
83 sed -e '/SUBDIRS\s*=/s/^/# DISABLED /g' -i {} + \
84 || die "failed to disable subdirs"
85
86 # Uncomment specified
87 local path
88 for path in ${VOS_EXTRACT}; do
89 if [[ -d "${path}" ]]; then
90 # Uncomment leaf
91 if [[ -f "${path}"/Makefile.am ]]; then
92 sed -e '/^# DISABLED \s*SUBDIRS\s*=/s/# DISABLED //g' \
93 -i "${path}"/Makefile.am || die "failed to uncomment leaf in ${path}/Makefile.am"
94 fi
95 # Process remaining path elements
96 while true; do
97 local subdir=`basename "${path}"`
98 path=`dirname "${path}"`
99 if [[ -f "${path}"/Makefile.am ]]; then
100 # Uncomment if necessary
101 sed -e '/^# DISABLED \s*SUBDIRS\s*=/s/.*/SUBDIRS =/g' \
102 -i "${path}"/Makefile.am
103 # Append subdirs if not there already
104 if [[ -z `grep --color=never -P "SUBDIRS\s*=.*${subdir}\b" "${path}"/Makefile.am` ]]; then
105 sed -e "/^SUBDIRS\s*=/s|$| ${subdir}|" \
106 -i "${path}"/Makefile.am || die "failed to append ${subdir}"
107 fi
108 fi
109 [[ "${path}" = . ]] && break
110 done
111 fi
112 done
113 fi
114
115 eautoreconf
116 }
117
118 # @FUNCTION: virtuoso_src_configure
119 # @DESCRIPTION:
120 # Runs ./configure with common and user options specified via myconf variable
121 virtuoso_src_configure() {
122 debug-print-function ${FUNCNAME} "$@"
123
124 use amd64 && append-flags "-m64"
125
126 # Override some variables to make tests work
127 if [[ ${PN} != virtuoso-server ]]; then
128 [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
129 export ISQL=${EPREFIX}/usr/bin/isql-v
130 export SERVER=${EPREFIX}/usr/bin/virtuoso-t
131 fi
132
133 econf \
134 --with-layout=gentoo \
135 --localstatedir=${EPREFIX}/var \
136 --enable-shared \
137 --with-pthreads \
138 --without-internal-zlib \
139 ${myconf}
140 }
141
142 # @FUNCTION: virtuoso_src_compile
143 # @DESCRIPTION
144 # Runs make for specified subdirs
145 virtuoso_src_compile() {
146 debug-print-function ${FUNCNAME} "$@"
147
148 base_src_compile
149 }
150
151 # @FUNCTION: virtuoso_src_install
152 # @DESCRIPTION:
153 # Default src_install
154 virtuoso_src_install() {
155 debug-print-function ${FUNCNAME} "$@"
156
157 base_src_install
158 }