/[gentoo-x86]/dev-db/myodbc/myodbc-5.1.6.ebuild
Gentoo

Contents of /dev-db/myodbc/myodbc-5.1.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Tue Jul 31 09:10:56 2012 UTC (2 years, 1 month ago) by kensington
Branch: MAIN
Changes since 1.5: +3 -3 lines
Add missing slot dependencies on Qt.

(Portage version: 2.1.11.9/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/dev-db/myodbc/myodbc-5.1.6.ebuild,v 1.5 2010/06/26 15:14:45 nixnut Exp $
4
5 EAPI=2
6 inherit eutils versionator autotools
7
8 MAJOR="$(get_version_component_range 1-2 $PV)"
9 MY_PN="mysql-connector-odbc"
10 MY_P="${MY_PN}-${PV/_p/r}"
11 DESCRIPTION="ODBC driver for MySQL"
12 HOMEPAGE="http://www.mysql.com/products/myodbc/"
13 SRC_URI="mirror://mysql/Downloads/Connector-ODBC/${MAJOR}/${MY_P}.tar.gz"
14 RESTRICT="primaryuri"
15 LICENSE="GPL-2"
16 SLOT="${MAJOR}"
17 KEYWORDS="amd64 ppc x86"
18 IUSE="debug doc static qt4"
19 RDEPEND=">=virtual/mysql-4.0
20 dev-db/unixODBC
21 qt4? ( >=x11-libs/qt-gui-4:4 )"
22 # perl is required for building docs
23 DEPEND="${RDEPEND}
24 doc? ( dev-lang/perl )"
25 S=${WORKDIR}/${MY_P}
26
27 # Careful!
28 DRIVER_NAME="${PN}-${SLOT}"
29
30 src_unpack() {
31 unpack ${A}
32 epatch "${FILESDIR}"/myodbc-5.1.6-qt4-includedir.patch
33 }
34
35 src_prepare() {
36 eautoreconf
37 }
38
39 src_configure() {
40 local myconf="--enable-static"
41 use static \
42 && myconf="${myconf} --disable-shared" \
43 || myconf="${myconf} --enable-shared"
44
45 myconf="${myconf} $(use_with doc docs) $(use_with debug)"
46 #myconf="${myconf} --disable-gui"
47 #TODO: the configure test against qt 4 enter in an endless loop
48 myconf="${myconf}
49 $(use_enable qt4 gui)
50 $(use_with qt4 qt-libraries /usr/$(get_libdir)/qt4/)"
51
52 econf \
53 --libexecdir=/usr/sbin \
54 --sysconfdir=/etc/myodbc \
55 --localstatedir=/var/lib/myodbc \
56 --with-mysql-libs=/usr/lib/mysql \
57 --with-mysql-includes=/usr/include/mysql \
58 --with-odbc-ini=/etc/unixODBC/odbc.ini \
59 --with-unixODBC=/usr \
60 --enable-myodbc3i \
61 --enable-myodbc3m \
62 --disable-test \
63 --without-samples \
64 ${myconf} \
65 || die "econf failed"
66 }
67
68 src_compile() {
69 emake \
70 || die "emake failed"
71 }
72
73 src_install() {
74 into /usr
75 einstall \
76 libexecdir="${D}"/usr/sbin \
77 sysconfdir="${D}"/etc/myodbc \
78 localstatedir="${D}"/var/lib/myodbc \
79 pkgdatadir="${D}"/usr/share/doc/${PF}
80 dodoc INSTALL README
81 prepalldocs
82 dodir /usr/share/${PN}-${SLOT}
83 for i in odbc.ini odbcinst.ini; do
84 einfo "Building $i"
85 sed \
86 -e "s,__PN__,${DRIVER_NAME},g" \
87 -e "s,__PF__,${PF},g" \
88 -e "s,libmyodbc3.so,libmyodbc${SLOT:0:1}.so,g" \
89 >"${D}"/usr/share/${PN}-${SLOT}/${i} \
90 <"${FILESDIR}"/${i}.m4 \
91 || die "Failed to build $i"
92 done;
93 }
94
95 pkg_config() {
96 [ "${ROOT}" != "/" ] && \
97 die 'Sorry, non-standard ROOT setting is not supported :-('
98
99 local msg='MySQL ODBC driver'
100 local drivers=$(/usr/bin/odbcinst -q -d)
101 if echo $drivers | grep -vq "^\[${DRIVER_NAME}\]$" ; then
102 ebegin "Installing ${msg}"
103 /usr/bin/odbcinst -i -d -f /usr/share/${PN}-${SLOT}/odbcinst.ini
104 rc=$?
105 eend $rc
106 [ $rc -ne 0 ] && die
107 else
108 einfo "Skipping already installed ${msg}"
109 fi
110
111 local sources=$(/usr/bin/odbcinst -q -s)
112 msg='sample MySQL ODBC DSN'
113 if echo $sources | grep -vq "^\[${DRIVER_NAME}-test\]$"; then
114 ebegin "Installing ${msg}"
115 /usr/bin/odbcinst -i -s -l -f /usr/share/${PN}-${SLOT}/odbc.ini
116 rc=$?
117 eend $rc
118 [ $rc -ne 0 ] && die
119 else
120 einfo "Skipping already installed ${msg}"
121 fi
122 }
123
124 pkg_postinst() {
125 elog "If this is a new install, please run the following command"
126 elog "to configure the MySQL ODBC drivers and sources:"
127 elog "emerge --config =${CATEGORY}/${PF}"
128 elog "Please note that the driver name used to form the DSN now includes the SLOT."
129 }

  ViewVC Help
Powered by ViewVC 1.1.20