diff options
author | Tiziano Müller <dev-zero@gentoo.org> | 2007-01-23 20:37:06 +0000 |
---|---|---|
committer | Tiziano Müller <dev-zero@gentoo.org> | 2007-01-23 20:37:06 +0000 |
commit | 6639f4b526e5c55766ecdc363e44f7e5ac8faa0c (patch) | |
tree | 5f015b9bff6a0bde9f1c263409f8471d5ef8d6f9 /sys-fs/evms | |
parent | Stable on ppc wrt bug 154198 (diff) | |
download | gentoo-2-6639f4b526e5c55766ecdc363e44f7e5ac8faa0c.tar.gz gentoo-2-6639f4b526e5c55766ecdc363e44f7e5ac8faa0c.tar.bz2 gentoo-2-6639f4b526e5c55766ecdc363e44f7e5ac8faa0c.zip |
Added src_test(). Added patch from Debian to set group for /dev/evms/* to disk, bug #159358
(Portage version: 2.1.2-r1)
Diffstat (limited to 'sys-fs/evms')
-rw-r--r-- | sys-fs/evms/ChangeLog | 12 | ||||
-rw-r--r-- | sys-fs/evms/evms-2.5.5-r4.ebuild | 43 | ||||
-rw-r--r-- | sys-fs/evms/evms-2.5.5-r5.ebuild | 152 | ||||
-rw-r--r-- | sys-fs/evms/files/digest-evms-2.5.5-r5 | 3 | ||||
-rw-r--r-- | sys-fs/evms/files/evms-2.5.5-use_disk_group.patch | 48 |
5 files changed, 254 insertions, 4 deletions
diff --git a/sys-fs/evms/ChangeLog b/sys-fs/evms/ChangeLog index 61e269d41ec4..94883f7499eb 100644 --- a/sys-fs/evms/ChangeLog +++ b/sys-fs/evms/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-fs/evms -# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/ChangeLog,v 1.57 2006/12/09 09:09:17 dev-zero Exp $ +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/ChangeLog,v 1.58 2007/01/23 20:37:06 dev-zero Exp $ + +*evms-2.5.5-r5 (23 Jan 2007) + + 23 Jan 2007; Tiziano Müller <dev-zero@gentoo.org> + +files/evms-2.5.5-use_disk_group.patch, evms-2.5.5-r4.ebuild, + +evms-2.5.5-r5.ebuild: + Added src_test(). Added patch from Debian to set group for /dev/evms/* to + disk, bug #159358 09 Dec 2006; Tiziano Müller <dev-zero@gentoo.org> ChangeLog: Corrected dependencies to fix #157497, thanks to Gour. diff --git a/sys-fs/evms/evms-2.5.5-r4.ebuild b/sys-fs/evms/evms-2.5.5-r4.ebuild index fff4b0b4017f..8725ad6fc049 100644 --- a/sys-fs/evms/evms-2.5.5-r4.ebuild +++ b/sys-fs/evms/evms-2.5.5-r4.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/evms-2.5.5-r4.ebuild,v 1.2 2006/12/09 09:09:17 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/evms-2.5.5-r4.ebuild,v 1.3 2007/01/23 20:37:06 dev-zero Exp $ WANT_AUTOMAKE="latest" WANT_AUTOCONF="latest" @@ -110,3 +110,42 @@ src_install() { # Needed for bug #51252 dosym libevms-2.5.so.0.0 /$(get_libdir)/libevms-2.5.so.0 } + +src_test() { + if [[ -z ${EVMS_TEST_VOLUME} ]] ; then + eerror "This is a volume manager and it therefore needs a volume" + eerror "for testing. You have to define EVMS_TEST_VOLUME as" + eerror "a volume evms can operate on." + eerror "Example: export EVMS_TEST_VOLUME=sda" + eerror "Note: The volume-name can not be a symlink." + eerror "WARNING: EVMS WILL DESTROY EVERYTHING ON IT." + einfo "If you don't have an empty disk, you can use the loopback-device:" + einfo "- Create a large file using dd (this creates a 4GB file):" + einfo " dd if=/dev/zero of=/tmp/evms_test_file bs=1M count=4096" + einfo "- Activate a loop device on this file:" + einfo " losetup /dev/loop0 /tmp/evms_test_file" + einfo "- export EVMS_TEST_VOLUME=loop0" + einfo "The disk has to be at least 4GB!" + einfo "To deactivate the loop-device afterwards:" + einfo "- losetup -d /dev/loop0" + hasq userpriv ${FEATURES} && ewarn "These tests have to run as root. Disable userpriv!" + die "need test-volume" + fi + + if hasq userpriv ${FEATURES} ; then + eerror "These tests need root privileges. Disable userpriv!" + die "userpriv is not supported" + fi + + volume=$(readlink "/dev/${EVMS_TEST_VOLUME}") + einfo "Disabling sandbox for:" + einfo " - /dev/${volume:-${EVMS_TEST_VOLUME}}" + addwrite /dev/${volume:-${EVMS_TEST_VOLUME}} + einfo " - /dev/evms" + addwrite /dev/evms + einfo " - /var/lock/evms-engine" + addwrite /var/lock/evms-engine + + cd "${S}/tests/suite" + PATH="${PATH}:/sbin:/${S}/tests" ./run_tests ${EVMS_TEST_VOLUME} || die "tests failed" +} diff --git a/sys-fs/evms/evms-2.5.5-r5.ebuild b/sys-fs/evms/evms-2.5.5-r5.ebuild new file mode 100644 index 000000000000..ef0290a83cb0 --- /dev/null +++ b/sys-fs/evms/evms-2.5.5-r5.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/evms-2.5.5-r5.ebuild,v 1.1 2007/01/23 20:37:06 dev-zero Exp $ + +WANT_AUTOMAKE="latest" +WANT_AUTOCONF="latest" + +inherit eutils flag-o-matic multilib toolchain-funcs autotools + +DESCRIPTION="Utilities for the IBM Enterprise Volume Management System" +HOMEPAGE="http://www.sourceforge.net/projects/evms" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="debug gtk ncurses nls" + +#EVMS uses libuuid from e2fsprogs +RDEPEND="virtual/libc + sys-fs/e2fsprogs + sys-fs/device-mapper + >=sys-apps/baselayout-1.9.4-r6 + gtk? ( =x11-libs/gtk+-1* + =dev-libs/glib-1* ) + ncurses? ( sys-libs/ncurses + >=dev-libs/glib-2.12.4-r1 )" +DEPEND="${RDEPEND}" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/${PV}/md_super_fix.patch" + epatch "${FILESDIR}/${PV}/ntfs_unmkfs.patch" + epatch "${FILESDIR}/${PV}/raid5_degrade_fix.patch" + epatch "${FILESDIR}/${PV}/raid5_remove_spare_fix.patch" + epatch "${FILESDIR}/${PV}/raid5_remove_spare_fix_2.patch" + epatch "${FILESDIR}/${PV}/raid5_algorithm.patch" + epatch "${FILESDIR}/${PV}/cli_reload_options.patch" + epatch "${FILESDIR}/${PV}/cli_query_segfault.patch" + epatch "${FILESDIR}/${PV}/get_geometry.patch" + epatch "${FILESDIR}/${PV}/BaseName.patch" + + epatch "${FILESDIR}/${P}-as-needed.patch" + epatch "${FILESDIR}/${P}-glib_dep.patch" + epatch "${FILESDIR}/${P}-ocfs2.patch" + epatch "${FILESDIR}/${P}-use_disk_group.patch" + + eautoreconf +} + +src_compile() { + # Bug #54856 + # filter-flags "-fstack-protector" + replace-flags -O3 -O2 + replace-flags -Os -O2 + + local excluded_interfaces="" + use ncurses || excluded_interfaces="--disable-text-mode" + use gtk || excluded_interfaces="${excluded_interfaces} --disable-gui" + + # We have to link statically against glib because evmsn resides in /sbin + econf \ + --libdir=/$(get_libdir) \ + --sbindir=/sbin \ + --includedir=/usr/include \ + --with-static-glib \ + $(use_with debug) \ + $(use_enable nls) \ + ${excluded_interfaces} || die "Failed configure" + emake || die "Failed emake" +} + +src_install() { + emake DESTDIR="${D}" install || die "Make install died" + dodoc ChangeLog INSTALL* PLUGIN.IDS README TERMINOLOGY doc/linuxrc + + insinto /$(get_libdir)/rcscripts/addons + newins "${FILESDIR}/evms2-start.sh" evms-start.sh || die "rcscript addon failed" + + # install the sample configuration into the doc dir + dodoc "${D}/etc/evms.conf.sample" + rm -f "${D}/etc/evms.conf.sample" + + # the kernel patches may come handy for people compiling their own kernel + docinto kernel/2.4 + dodoc kernel/2.4/* + docinto kernel/2.6 + dodoc kernel/2.6/* + + # move static libraries to /usr/lib + dodir /usr/$(get_libdir) + mv -f ${D}/$(get_libdir)/*.a "${D}/usr/$(get_libdir)" + + # Create linker scripts for dynamic libs in /lib, else gcc + # links to the static ones in /usr/lib first. Bug #4411. + for x in "${D}/usr/$(get_libdir)"/*.a ; do + if [ -f ${x} ] ; then + local lib="${x##*/}" + gen_usr_ldscript ${lib/\.a/\.so} + fi + done + + # the gtk+ frontend should live in /usr/sbin + if use gtk ; then + dodir /usr/sbin + mv -f ${D}/sbin/evmsgui ${D}/usr/sbin + fi + + # Needed for bug #51252 + dosym libevms-2.5.so.0.0 /$(get_libdir)/libevms-2.5.so.0 +} + +src_test() { + if [[ -z ${EVMS_TEST_VOLUME} ]] ; then + eerror "This is a volume manager and it therefore needs a volume" + eerror "for testing. You have to define EVMS_TEST_VOLUME as" + eerror "a volume evms can operate on." + eerror "Example: export EVMS_TEST_VOLUME=sda" + eerror "Note: The volume-name can not be a symlink." + eerror "WARNING: EVMS WILL DESTROY EVERYTHING ON IT." + einfo "If you don't have an empty disk, you can use the loopback-device:" + einfo "- Create a large file using dd (this creates a 4GB file):" + einfo " dd if=/dev/zero of=/tmp/evms_test_file bs=1M count=4096" + einfo "- Activate a loop device on this file:" + einfo " losetup /dev/loop0 /tmp/evms_test_file" + einfo "- export EVMS_TEST_VOLUME=loop0" + einfo "The disk has to be at least 4GB!" + einfo "To deactivate the loop-device afterwards:" + einfo "- losetup -d /dev/loop0" + hasq userpriv ${FEATURES} && ewarn "These tests have to run as root. Disable userpriv!" + die "need test-volume" + fi + + if hasq userpriv ${FEATURES} ; then + eerror "These tests need root privileges. Disable userpriv!" + die "userpriv is not supported" + fi + + volume=$(readlink "/dev/${EVMS_TEST_VOLUME}") + einfo "Disabling sandbox for:" + einfo " - /dev/${volume:-${EVMS_TEST_VOLUME}}" + addwrite /dev/${volume:-${EVMS_TEST_VOLUME}} + einfo " - /dev/evms" + addwrite /dev/evms + einfo " - /var/lock/evms-engine" + addwrite /var/lock/evms-engine + + cd "${S}/tests/suite" + PATH="${PATH}:/sbin:/${S}/tests" ./run_tests ${EVMS_TEST_VOLUME} || die "tests failed" +} diff --git a/sys-fs/evms/files/digest-evms-2.5.5-r5 b/sys-fs/evms/files/digest-evms-2.5.5-r5 new file mode 100644 index 000000000000..33b12c6760ce --- /dev/null +++ b/sys-fs/evms/files/digest-evms-2.5.5-r5 @@ -0,0 +1,3 @@ +MD5 45b463f0cbade194dc0a08be432b572e evms-2.5.5.tar.gz 2286321 +RMD160 716d6b34f48f6f7a3f5f4627bc4a2c34957607f7 evms-2.5.5.tar.gz 2286321 +SHA256 9dbfaac148d822068ba883f6533935e03ae5cfc9fdf8836dea6aee99c859307c evms-2.5.5.tar.gz 2286321 diff --git a/sys-fs/evms/files/evms-2.5.5-use_disk_group.patch b/sys-fs/evms/files/evms-2.5.5-use_disk_group.patch new file mode 100644 index 000000000000..5130816f24f3 --- /dev/null +++ b/sys-fs/evms/files/evms-2.5.5-use_disk_group.patch @@ -0,0 +1,48 @@ +--- evms-2.5.5.orig/engine/discover.c ++++ evms-2.5.5/engine/discover.c +@@ -28,6 +28,8 @@ + #include <unistd.h> + #include <sys/stat.h> + #include <sys/time.h> ++#include <sys/types.h> ++#include <grp.h> + + #include "fullengine.h" + #include "discover.h" +@@ -162,9 +164,23 @@ + int rc = 0; + dev_t devt = makedev(major, minor); + char dir_name[EVMS_OBJECT_NODE_PATH_LEN + EVMS_NAME_SIZE + 1]; ++ struct group *disk; + + LOG_PROC_ENTRY(); + ++ /* ++ * Debian-specific: We want all devices to be owned by the ++ * group disk, not root. ++ */ ++ disk = getgrnam("disk"); ++ if (disk) { ++ if (setegid(disk->gr_gid) != 0) { ++ LOG_WARNING("could not setegid to group disk (%s), continuing as group root\n", strerror(errno)); ++ } ++ } else { ++ LOG_WARNING("could not find group disk (%s), continuing as group root\n", strerror(errno)); ++ } ++ + /* Make sure major:minor is valid. */ + if (major != 0) { + switch (hasa_dev_node(name, major, minor)) { +@@ -227,6 +243,12 @@ + LOG_DEBUG("Device node %s is for major %d, minor %d.\n", name, major, minor); + } + ++ if (disk) { ++ if (setegid(getgid()) != 0) { ++ LOG_WARNING("could not setegid back to old group (%s)\n", strerror(errno)); ++ } ++ } ++ + LOG_PROC_EXIT_INT(rc); + return rc; + } |