Skip to content

Commit

Permalink
dev-db/freetds: [QA] fix multiple violations
Browse files Browse the repository at this point in the history
* Fix broken --docdir on Prefix
* Don't build static archives unless
  USE="static-libs" is enabled
* Remove .la files unless USE="static-libs"
  is enabled
* Bump to EAPI 7
* Clean up overly complicated src_configure
* Add subslot operator for gnutls, libressl
  and openssl

Package-Manager: Portage-2.3.44, Repoman-2.3.10
  • Loading branch information
SoapGentoo committed Aug 6, 2018
1 parent d9f464f commit 56767b4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
44 changes: 25 additions & 19 deletions dev-db/freetds/freetds-1.00.341.ebuild
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6
EAPI=7

# This is from the "current" release series, because the "stable" series
# is a little too stable for us (missing bug fixes, and so on).
Expand All @@ -13,25 +13,23 @@ SRC_URI="ftp://ftp.freetds.org/pub/${PN}/current/${MY_PN}.${PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64
~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos"
IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos"
IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl static-libs"
RESTRICT="test"

# sed, grep, and awk are used by the build system and the osql script.
COMMON_DEPEND="sys-apps/sed
sys-apps/grep
virtual/awk
gnutls? ( net-libs/gnutls )
gnutls? ( net-libs/gnutls:= )
iconv? ( virtual/libiconv )
iodbc? ( dev-db/libiodbc )
kerberos? ( virtual/krb5 )
odbc? ( dev-db/unixODBC )
ssl? (
!libressl? ( dev-libs/openssl:0 )
libressl? ( dev-libs/libressl )
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
)"

DEPEND="${COMMON_DEPEND}"

# bind-tools is needed because the osql script calls "host".
Expand All @@ -48,15 +46,23 @@ REQUIRED_USE="?? ( iodbc odbc )"
S="${WORKDIR}/${MY_PN}.${PV}"

src_configure() {
local myconf=( $(use_with iodbc) )
myconf+=( $(use_with odbc unixodbc "${EPREFIX}/usr") )
myconf+=( $(use_enable iconv libiconv) )
myconf+=( $(use_with iconv libiconv-prefix "${EPREFIX}/usr") )
myconf+=( $(use_enable kerberos krb5) )
myconf+=( $(use_enable mssql msdblib) )
myconf+=( $(use_with gnutls) )
myconf+=( $(use_with ssl openssl "${EPREFIX}/usr") )
myconf+=( --docdir="/usr/share/doc/${PF}" )

econf "${myconf[@]}"
econf \
--enable-shared \
$(use_enable iconv libiconv) \
$(use_enable kerberos krb5) \
$(use_enable mssql msdblib) \
$(use_enable static-libs static) \
$(use_with iodbc) \
$(use_with odbc unixodbc "${EPREFIX}/usr") \
$(use_with iconv libiconv-prefix "${EPREFIX}/usr") \
$(use_with gnutls) \
$(use_with ssl openssl "${EPREFIX}/usr")
}

src_install() {
default

if ! use static-libs; then
find "${D}" -name '*.la' -delete || die
fi
}
2 changes: 1 addition & 1 deletion dev-db/freetds/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<!-- maintainer-needed -->
</pkgmetadata>

0 comments on commit 56767b4

Please sign in to comment.