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