Gentoo Archives: gentoo-commits

From: Alexey Shvetsov <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: eclass/
Date: Sun, 20 Nov 2011 00:07:08
Message-Id: 27c20e1b4509c3f3a596bf0530f98b6f078c7c5f.alexxy@gentoo
1 commit: 27c20e1b4509c3f3a596bf0530f98b6f078c7c5f
2 Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 19 23:26:02 2011 +0000
4 Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 19 23:28:47 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=27c20e1b
7
8 [eclass] Add virtuoso one
9
10 Signed-off-by: Alexey Shvetsov <alexxy <AT> gentoo.org>
11
12 ---
13 eclass/virtuoso.eclass | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
14 1 files changed, 144 insertions(+), 0 deletions(-)
15
16 diff --git a/eclass/virtuoso.eclass b/eclass/virtuoso.eclass
17 new file mode 100644
18 index 0000000..b4c7677
19 --- /dev/null
20 +++ b/eclass/virtuoso.eclass
21 @@ -0,0 +1,144 @@
22 +# Copyright 1999-2010 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Header: /var/cvsroot/gentoo-x86/eclass/virtuoso.eclass,v 1.11 2011/07/07 23:00:06 reavertm Exp $
25 +
26 +# @ECLASS: virtuoso.eclass
27 +# @MAINTAINER:
28 +# Maciej Mrozowski <reavertm@g.o>
29 +#
30 +# @BLURB: Provides splitting functionality for Virtuoso
31 +# @DESCRIPTION:
32 +# This eclass provides common code for splitting Virtuoso OpenSource database
33 +
34 +case ${EAPI:-0} in
35 + 2|3|4) : ;;
36 + *) die "EAPI=${EAPI} is not supported" ;;
37 +esac
38 +
39 +inherit base autotools multilib
40 +
41 +MY_P="virtuoso-opensource-${PV}"
42 +
43 +case ${PV} in
44 + *9999*)
45 + ECVS_SERVER="virtuoso.cvs.sourceforge.net:/cvsroot/virtuoso"
46 + ECVS_PROJECT='virtuoso'
47 + SRC_URI=""
48 + inherit cvs
49 + ;;
50 + *)
51 + # Use this variable to determine distribution method (live or tarball)
52 + TARBALL="${MY_P}.tar.gz"
53 + SRC_URI="mirror://sourceforge/virtuoso/${TARBALL} mirror://gentoo/VOS-genpatches-${PV}.tar.bz2"
54 + ;;
55 +esac
56 +
57 +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install
58 +
59 +# Set some defaults
60 +HOMEPAGE='http://virtuoso.openlinksw.com/wiki/main/Main/'
61 +LICENSE='GPL-2'
62 +SLOT='0'
63 +
64 +# Restrict incompatible gawk, bug 374315
65 +DEPEND='
66 + >=sys-devel/libtool-2.2.6a
67 +'
68 +RDEPEND=''
69 +
70 +S="${WORKDIR}/${MY_P}"
71 +
72 +# @FUNCTION: virtuoso_src_prepare
73 +# @DESCRIPTION:
74 +# 1. Applies common release patches
75 +# 2. Applies package-specific patches (from ${FILESDIR}/, PATCHES can be used)
76 +# 3. Applies user patches from /etc/portage/patches/${CATEGORY}/${PN}/
77 +# 4. Modifies makefiles for split build. Uses VOS_EXTRACT
78 +# 5. eautoreconf
79 +virtuoso_src_prepare() {
80 + debug-print-function ${FUNCNAME} "$@"
81 +
82 + EPATCH_SUFFIX='patch' EPATCH_FORCE='yes' epatch
83 + base_src_prepare
84 +
85 + # @ECLASS-VARIABLE: VOS_EXTRACT
86 + # @DESCRIPTION:
87 + # Lists any subdirectories that are required to be extracted
88 + # and enabled in Makefile.am's for current package.
89 + if [[ -n ${VOS_EXTRACT} ]]; then
90 + # Comment out everything
91 + find . -name Makefile.am -exec \
92 + sed -e '/SUBDIRS\s*=/s/^/# DISABLED /g' -i {} + \
93 + || die 'failed to disable subdirs'
94 +
95 + # Uncomment specified
96 + local path
97 + for path in ${VOS_EXTRACT}; do
98 + if [[ -d "${path}" ]]; then
99 + # Uncomment leaf
100 + if [[ -f "${path}"/Makefile.am ]]; then
101 + sed -e '/^# DISABLED \s*SUBDIRS\s*=/s/# DISABLED //g' \
102 + -i "${path}"/Makefile.am || die "failed to uncomment leaf in ${path}/Makefile.am"
103 + fi
104 + # Process remaining path elements
105 + while true; do
106 + local subdir=`basename "${path}"`
107 + path=`dirname "${path}"`
108 + if [[ -f "${path}"/Makefile.am ]]; then
109 + # Uncomment if necessary
110 + sed -e '/^# DISABLED \s*SUBDIRS\s*=/s/.*/SUBDIRS =/g' \
111 + -i "${path}"/Makefile.am
112 + # Append subdirs if not there already
113 + if [[ -z `sed -ne "/SUBDIRS\s*=.*${subdir}\b/p" "${path}"/Makefile.am` ]]; then
114 + sed -e "/^SUBDIRS\s*=/s|$| ${subdir}|" \
115 + -i "${path}"/Makefile.am || die "failed to append ${subdir}"
116 + fi
117 + fi
118 + [[ "${path}" = . ]] && break
119 + done
120 + fi
121 + done
122 + fi
123 +
124 + eautoreconf
125 +}
126 +
127 +# @FUNCTION: virtuoso_src_configure
128 +# @DESCRIPTION:
129 +# Runs ./configure with common and user options specified via myconf variable
130 +virtuoso_src_configure() {
131 + debug-print-function ${FUNCNAME} "$@"
132 +
133 + # Override some variables to make tests work
134 + if [[ ${PN} != virtuoso-server ]]; then
135 + [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX=
136 + export ISQL="${EPREFIX}"/usr/bin/isql-v
137 + export SERVER="${EPREFIX}"/usr/bin/virtuoso-t
138 + fi
139 +
140 + econf \
141 + --with-layout=gentoo \
142 + --localstatedir="${EPREFIX}"/var \
143 + --enable-shared \
144 + --with-pthreads \
145 + --without-internal-zlib \
146 + ${myconf}
147 +}
148 +
149 +# @FUNCTION: virtuoso_src_compile
150 +# @DESCRIPTION:
151 +# Runs make for specified subdirs
152 +virtuoso_src_compile() {
153 + debug-print-function ${FUNCNAME} "$@"
154 +
155 + base_src_compile
156 +}
157 +
158 +# @FUNCTION: virtuoso_src_install
159 +# @DESCRIPTION:
160 +# Default src_install
161 +virtuoso_src_install() {
162 + debug-print-function ${FUNCNAME} "$@"
163 +
164 + base_src_install
165 +}