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