diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2018-04-17 15:28:40 +0200 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2018-04-17 15:29:46 +0200 |
commit | 11fbbe4764e7e9fde909d1833fd873976aee9eb1 (patch) | |
tree | b70ed6e962d93c56a589938ec4a7de2f8f1b78d2 /sys-block/nbd | |
parent | dev-db/percona-xtrabackup: Fix build problems (diff) | |
download | gentoo-11fbbe4764e7e9fde909d1833fd873976aee9eb1.tar.gz gentoo-11fbbe4764e7e9fde909d1833fd873976aee9eb1.tar.bz2 gentoo-11fbbe4764e7e9fde909d1833fd873976aee9eb1.zip |
sys-block/nbd: Added live ebuild.
Package-Manager: Portage-2.3.29, Repoman-2.3.9
Diffstat (limited to 'sys-block/nbd')
-rw-r--r-- | sys-block/nbd/files/nbd-3.17-automagic.patch | 84 | ||||
-rw-r--r-- | sys-block/nbd/metadata.xml | 3 | ||||
-rw-r--r-- | sys-block/nbd/nbd-9999.ebuild | 65 |
3 files changed, 152 insertions, 0 deletions
diff --git a/sys-block/nbd/files/nbd-3.17-automagic.patch b/sys-block/nbd/files/nbd-3.17-automagic.patch new file mode 100644 index 000000000000..4ece53596da4 --- /dev/null +++ b/sys-block/nbd/files/nbd-3.17-automagic.patch @@ -0,0 +1,84 @@ +From 55c225b53c24b0ae93f49d5f004291da8c265870 Mon Sep 17 00:00:00 2001 +From: Lars Wendler <polynomial-c@gentoo.org> +Date: Mon, 9 Apr 2018 11:26:06 +0200 +Subject: [PATCH] Don't make gnutls and libnl automagic + +Introduce --without-gnutls and --without-libnl configure options so that +users can disable gnutls/libnl even if the packages are available on the +system. The default is unchanged from before this patch. If no +--with(out)-* option has been given on the command line, the macro looks +for presence and uses the packages if found. +--- + configure.ac | 47 ++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 38 insertions(+), 9 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cdb4af3..4b76007 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -212,10 +212,25 @@ dnl ;; + dnl esac + dnl fi + +-PKG_CHECK_MODULES(GnuTLS, [gnutls >= 2.12.0],[HAVE_GNUTLS=1],[HAVE_GNUTLS=0]) +-if test x$HAVE_GNUTLS = x1; then +- AC_DEFINE(HAVE_GNUTLS, 1, [Define to 1 if you have a GnuTLS version of 2.12 or above]) ++AC_ARG_WITH([gnutls], ++ [AS_HELP_STRING([--without-gnutls], ++ [do not use gnutls])], ++ [], ++ [with_gnutls=check] ++) ++if test "x$with_gnutls" != "xno"; then ++ PKG_CHECK_MODULES(GnuTLS, [gnutls >= 2.12.0], ++ [HAVE_GNUTLS=1 ++ AC_DEFINE(HAVE_GNUTLS, 1, [Define to 1 if you have a GnuTLS version of 2.12 or above])], ++ [if test "x$with_gnutls" = "xyes"; then ++ AC_MSG_ERROR([--with-gnutls given but cannot find gnutls]) ++ else ++ HAVE_GNUTLS=0 ++ AC_DEFINE(HAVE_GNUTLS, 0) ++ fi] ++ ) + else ++ HAVE_GNUTLS=0 + AC_DEFINE(HAVE_GNUTLS, 0) + fi + AM_CONDITIONAL([GNUTLS], [test "x$HAVE_GNUTLS" = "x1"]) +@@ -294,13 +309,27 @@ AC_PREPROC_IFELSE( + [AC_MSG_RESULT([yes]); NEED_BSD_SOURCE=1]) + AC_DEFINE([NEED_BSD_SOURCE], $NEED_BSD_SOURCE, [Define to 1 if _BSD_SOURCE needs to be defined before certain inclusions]) + +-PKG_CHECK_MODULES(LIBNL3, libnl-genl-3.0 >= 3.1, [have_libnl3=yes], [have_libnl3=no]) +-if test "${have_libnl3}" = "yes" +-then +- AC_DEFINE(HAVE_NETLINK, 1, [Define to 1 if we have netlink support]) +- CFLAGS+=" $LIBNL3_CFLAGS" +- LIBS+=" $LIBNL3_LIBS" ++AC_ARG_WITH([libnl], ++ [AS_HELP_STRING([--without-libnl], ++ [do not use libnl])], ++ [], ++ [with_libnl=check] ++) ++if test "x$with_libnl" != "xno"; then ++ PKG_CHECK_MODULES(LIBNL3, libnl-genl-3.0 >= 3.1, ++ [HAVE_NETLINK=1 ++ AC_DEFINE(HAVE_NETLINK, 1, [Define to 1 if we have netlink support]) ++ CFLAGS+=" $LIBNL3_CFLAGS" ++ LIBS+=" $LIBNL3_LIBS"], ++ [if test "x$with_libnl" = "xyes"; then ++ AC_MSG_ERROR([--with-libnl given but cannot find libnl]) ++ else ++ HAVE_NETLINK=0 ++ AC_DEFINE(HAVE_NETLINK, 0) ++ fi] ++ ) + else ++ HAVE_NETLINK=0 + AC_DEFINE(HAVE_NETLINK, 0, [Define to 1 if we have netlink support]) + fi + +-- +2.17.0 + diff --git a/sys-block/nbd/metadata.xml b/sys-block/nbd/metadata.xml index f583809ec477..e233f07bc3f4 100644 --- a/sys-block/nbd/metadata.xml +++ b/sys-block/nbd/metadata.xml @@ -5,6 +5,9 @@ <email>base-system@gentoo.org</email> <name>Gentoo Base System</name> </maintainer> +<use> + <flag name="netlink">Add support for netlink protocol via <pkg>dev-libs/libnl</pkg></flag> +</use> <upstream> <remote-id type="sourceforge">nbd</remote-id> </upstream> diff --git a/sys-block/nbd/nbd-9999.ebuild b/sys-block/nbd/nbd-9999.ebuild new file mode 100644 index 000000000000..1117affd0207 --- /dev/null +++ b/sys-block/nbd/nbd-9999.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +DESCRIPTION="Userland client/server for kernel network block device" +HOMEPAGE="http://nbd.sourceforge.net/" +if [[ "${PV}" = 9999 ]] ; then + inherit autotools git-r3 + EGIT_REPO_URI="https://github.com/NetworkBlockDevice/nbd.git" +else + SRC_URI="mirror://sourceforge/nbd/${P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" +fi +LICENSE="GPL-2" +SLOT="0" +IUSE="debug gnutls netlink zlib" + +# gnutls is an automagic dep. +RDEPEND=" + >=dev-libs/glib-2.26.0 + gnutls? ( >=net-libs/gnutls-2.12.0 ) + netlink? ( >=dev-libs/libnl-3.1 ) + zlib? ( sys-libs/zlib ) +" +DEPEND="${RDEPEND} + virtual/pkgconfig +" + +if [[ "${PV}" = 9999 ]] ; then + DEPEND+=" + app-text/docbook-sgml-dtd:4.5 + app-text/docbook-sgml-utils + " +fi + +PATCHES=( + "${FILESDIR}/${PN}-3.17-automagic.patch" +) + +src_prepare() { + default + if [[ "${PV}" = 9999 ]] ; then + emake -C man -f Makefile.am \ + nbd-server.1.sh.in \ + nbd-server.5.sh.in \ + nbd-client.8.sh.in \ + nbd-trdump.1.sh.in \ + nbdtab.5.sh.in + emake -C systemd -f Makefile.am nbd@.service.sh.in + eautoreconf + fi +} + +src_configure() { + local myeconfargs=( + --enable-lfs + $(use_enable !debug syslog) + $(use_enable debug) + $(use_enable zlib gznbd) + $(use_with gnutls) + $(use_with netlink libnl) + ) + econf "${myeconfargs[@]}" +} |