Исправлен ebuild dmraid

rasdark
parent 23c2946c91
commit be002dc9c7

@ -0,0 +1 @@
DIST dmraid-1.0.0.rc16-3.tar.bz2 232743 SHA256 93421bd169d71ff5e7d2db95b62b030bfa205a12010b6468dcdef80337d6fbd8 SHA512 7c45e5117adc52fc2094b1b2bad4f4c518a46317a2196611966d72085ba3587c4ac8d1080f9d934888c01788f2b2d3d621c6f0d3e2a023c0fb1f9f3fa7fc127e WHIRLPOOL 87915ea0013766da8a9722b437bfe146b4b2c7560a7814ac6caab92054ddc3b4b59ceb4d413609d5eaab92b5cee67886ade7924455f1dba19f1b8dabc25d3498

@ -0,0 +1,103 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
inherit autotools linux-info flag-o-matic eutils
MY_PV=${PV/_/.}-3
DESCRIPTION="Device-mapper RAID tool and library"
HOMEPAGE="https://people.redhat.com/~heinzm/sw/dmraid/"
SRC_URI="https://people.redhat.com/~heinzm/sw/dmraid/src/${PN}-${MY_PV}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
IUSE="dietlibc intel_led klibc led mini static"
REQUIRED_USE="klibc? ( !dietlibc )"
RDEPEND=">=sys-fs/lvm2-2.02.45
klibc? ( dev-libs/klibc )
dietlibc? ( dev-libs/dietlibc )"
DEPEND="${RDEPEND}
virtual/pkgconfig
static? ( sys-fs/lvm2[static-libs] )"
S=${WORKDIR}/${PN}/${MY_PV}/${PN}
pkg_setup() {
if kernel_is lt 2 6 ; then
ewarn "You are using a kernel < 2.6"
ewarn "DMraid uses recently introduced Device-Mapper features."
ewarn "These might be unavailable in the kernel you are running now."
fi
}
src_prepare() {
epatch "${FILESDIR}"/${P}-undo-p-rename.patch \
"${FILESDIR}"/${P}-return-all-sets.patch \
"${FILESDIR}"/${P}-static-build-fixes.patch
# pkg_check_modules is not in aclocal.m4 by default, and eautoreconf doesnt add it
einfo "Appending pkg.m4 from system to aclocal.m4"
cat "${ROOT}"/usr/share/aclocal/pkg.m4 >>"${S}"/aclocal.m4 || die "Could not append pkg.m4"
epatch_user
eautoreconf
einfo "Creating prepatched source archive for use with Genkernel"
# archive the patched source for use with genkernel
cd "${WORKDIR}" || die
mkdir -p "tmp/${PN}" || die
cp -a "${PN}/${MY_PV}/${PN}" "tmp/${PN}" || die
mv "tmp/${PN}/${PN}" "tmp/${PN}/${MY_PV}" || die
cd tmp || die
tar -jcf ${PN}-${MY_PV}-prepatched.tar.bz2 ${PN} || die
mv ${PN}-${MY_PV}-prepatched.tar.bz2 .. || die
}
src_configure() {
econf --with-usrlibdir='${prefix}'/$(get_libdir) \
$(use_enable static static_link) \
$(use_enable mini) \
$(use_enable led) \
$(use_enable intel_led) \
$(use_enable klibc) \
$(use_enable dietlibc)
}
src_compile() {
emake -j1
}
src_install() {
emake DESTDIR="${D}" install
dodoc CHANGELOG README TODO KNOWN_BUGS doc/*
insinto /usr/share/${PN}
doins "${WORKDIR}"/${PN}-${MY_PV}-prepatched.tar.bz2
}
pkg_postinst() {
if [[ -z ${REPLACING_VERSIONS} ]]; then
elog "For booting Gentoo from Device-Mapper RAID you can use a Genkernel initramfs."
elog
elog "Genkernel will generate the kernel and the initramfs with a statically "
elog "linked dmraid binary (its own version which may not be the same as this version):"
elog "\t emerge -av sys-kernel/genkernel"
elog "\t genkernel --dmraid all"
fi
# skip this message if this revision has already been emerged
if [[ " ${REPLACING_VERSIONS} " != *\ ${PVR}\ * ]]; then
elog
elog "A pre-patched distfile of this version of DMRAID has been installed at"
elog "/usr/share/${PN}/${PN}-${MY_PV}-prepatched.tar.bz2 , to support using it within a"
elog "Genkernel initramfs."
elog
fi
if [[ -z ${REPLACING_VERSIONS} ]]; then
elog "If you would rather use this version of DMRAID with Genkernel, update the following"
elog "in /etc/genkernel.conf:"
elog "\t DMRAID_VER=\"${MY_PV}\""
elog "\t DMRAID_SRCTAR=\"/usr/share/${PN}/${PN}-${MY_PV}-prepatched.tar.bz2\""
elog
fi
}

@ -0,0 +1,11 @@
--- a/1.0.0.rc16/lib/metadata/metadata.c 2009-11-27 21:57:50.182129589 -0800
+++ b/1.0.0.rc16/lib/metadata/metadata.c 2009-11-27 21:57:58.950964293 -0800
@@ -839,7 +839,7 @@
*/
if (T_GROUP(rs)) {
_discover_partitions(lc, &rs->sets);
- return;
+ continue;
}
/*

@ -0,0 +1,110 @@
--- tools/Makefile.in.old 2010-05-31 07:18:31.000000000 -0400
+++ tools/Makefile.in 2010-12-13 13:15:22.000000000 -0500
@@ -60,17 +60,23 @@
ifeq ("@KLIBC@", "no")
ifeq ("@STATIC_LINK@", "no")
LDFLAGS += -rdynamic
+ MYLIBOBJ=$(top_builddir)/lib/libdmraid.so
else
LDFLAGS += -static
+ MYLIBOBJ=$(top_builddir)/lib/libdmraid.a
+ DMRAIDLIBS += \
+ $(DEVMAPPEREVENT_LIBS) \
+ $(DEVMAPPER_LIBS) \
+ $(DL_LIBS)
endif
endif
.PHONY: install_dmraid_tools
-dmraid: $(OBJECTS) $(top_builddir)/lib/libdmraid.a
+dmraid: $(OBJECTS) $(MYLIBOBJ)
$(CC) -o $@ $(OBJECTS) $(LDFLAGS) -L$(top_builddir)/lib $(DMRAIDLIBS) $(LIBS)
-dmevent_tool: $(OBJECTS2) $(top_builddir)/lib/libdmraid.a
+dmevent_tool: $(OBJECTS2) $(MYLIBOBJ)
$(CC) -o $@ $(OBJECTS2) $(INCLUDES) $(LDFLAGS) -L$(top_builddir)/lib \
$(DMEVENTTOOLLIBS) $(DMRAIDLIBS) $(LIBS)
--- lib/Makefile.in.old 2010-10-27 07:31:46.000000000 -0400
+++ lib/Makefile.in 2010-12-13 13:04:16.000000000 -0500
@@ -60,11 +60,11 @@
USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \
$(AWK) -f $(top_srcdir)/tools/relpath.awk)
-TARGETS = $(LIB_STATIC)
+TARGETS = $(LIB_STATIC) $(LIB_SHARED) $(LIB_EVENTS_SHARED)
ifeq ("@KLIBC@", "no")
ifeq ("@STATIC_LINK@", "no")
- TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED)
+ TARGETS = $(LIB_SHARED) $(LIB_EVENTS_SHARED)
endif
endif
--- configure.in 2010-05-31 07:18:30.000000000 -0400
+++ configure.in.new 2010-12-07 13:30:40.000000000 -0500
@@ -155,6 +155,15 @@
Default is dynamic linking]),
[STATIC_LINK=$enableval], [STATIC_LINK=no])
+if test "x$STATIC_LINK" != "xno"; then
+ if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+ fi
+ PKG_CONFIG="${PKG_CONFIG} --static"
+ ac_cv_env_PKG_CONFIG_set=set
+fi
+PKG_PROG_PKG_CONFIG([0.2])
+
dnl Enables shared libdmraid
AC_ARG_ENABLE(shared_lib,
AC_HELP_STRING([--enable-shared_lib], [Use this to generate shared
@@ -248,23 +257,31 @@
AC_HELP_STRING([--with-devmapper-prefix=PFX],
[Where is devmapper library installed]),
[DEVMAPPER_LIBS="-L$withval/lib"
- DEVMAPPER_CFLAGS="-I$withval/include"],
+ DEVMAPPER_CFLAGS="-I$withval/include"
+ dmprefix=$withval],
[DEVMAPPER_LIBS=
- DEVMAPPER_CFLAGS=])
-save_LDFLAGS=$LDFLAGS
-save_CPPFLAGS=$CPPFLAGS
-LDFLAGS="$LDFLAGS $DEVMAPPER_LIBS"
-CPPFLAGS="$CPPFLAGS $DEVMAPPER_CFLAGS"
-AC_CHECK_LIB(devmapper-event, dm_event_handler_create,
- [DEVMAPPEREVENT_LIBS="$DEVMAPPER_LIBS -ldevmapper-event"],
- [AC_MSG_ERROR([device-mapper-event library is either missing or is too old and badly linked])])
-AC_CHECK_LIB(devmapper, dm_task_set_name,
- [DEVMAPPER_LIBS="$DEVMAPPER_LIBS -ldevmapper"],
- [AC_MSG_ERROR([device-mapper library is missing])])
-AC_CHECK_HEADERS(libdevmapper.h libdevmapper-event.h,,
- [AC_MSG_ERROR([Missing headers device-mapper headers])])
-CPPFLAGS=$save_CPPFLAGS
-LDFLAGS=$save_LDFLAGS
+ DEVMAPPER_CFLAGS=
+ dmprefix=no])
+if test "x$dmprefix" = xno ; then
+ PKG_CHECK_MODULES([DEVMAPPER],[devmapper],
+ [PKG_CHECK_MODULES([DEVMAPPEREVENT],[devmapper-event])
+ ])
+else
+ save_LDFLAGS=$LDFLAGS
+ save_CPPFLAGS=$CPPFLAGS
+ LDFLAGS="$LDFLAGS $DEVMAPPER_LIBS"
+ CPPFLAGS="$CPPFLAGS $DEVMAPPER_CFLAGS"
+ AC_CHECK_LIB(devmapper-event, dm_event_handler_create,
+ [DEVMAPPEREVENT_LIBS="$DEVMAPPER_LIBS -ldevmapper-event"],
+ [AC_MSG_ERROR([device-mapper-event library is either missing or is too old and badly linked])])
+ AC_CHECK_LIB(devmapper, dm_task_set_name,
+ [DEVMAPPER_LIBS="$DEVMAPPER_LIBS -ldevmapper"],
+ [AC_MSG_ERROR([device-mapper library is missing])])
+ AC_CHECK_HEADERS(libdevmapper.h libdevmapper-event.h,,
+ [AC_MSG_ERROR([Missing headers device-mapper headers])])
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+fi
VERSION=$srcdir/tools/VERSION
DMRAID_LIB_MAJOR=$(cut -d. -f1 $VERSION)

@ -0,0 +1,13 @@
Author: Giuseppe Iuculano <giuseppe@iuculano.it>
Description: Removed "p" from device name. A proper upgrade script is needed before using it.
--- a/1.0.0.rc15/lib/format/partition/dos.c
+++ b/1.0.0.rc15/lib/format/partition/dos.c
@@ -31,7 +31,7 @@ _name(struct lib_context *lc, struct rai
{
const char *base = get_basename(lc, rd->di->path);
- return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc),
+ return type ? snprintf(str, len, "%s%u", base,
partition) : snprintf(str, len, "%s", base);
}
Loading…
Cancel
Save