diff options
author | Jeroen Roovers <jer@gentoo.org> | 2012-11-14 03:31:45 +0000 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2012-11-14 03:31:45 +0000 |
commit | 66b00532e0f736f0871a246f654955765f1a3ba5 (patch) | |
tree | 54228b3f17824d8c1baf2285a68fce48c1919431 /sys-block | |
parent | update HOMEPAGE (bug #443034) (diff) | |
download | gentoo-2-66b00532e0f736f0871a246f654955765f1a3ba5.tar.gz gentoo-2-66b00532e0f736f0871a246f654955765f1a3ba5.tar.bz2 gentoo-2-66b00532e0f736f0871a246f654955765f1a3ba5.zip |
Add ZFS detection by Richard Yao (bug #419157).
(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key A792A613)
Diffstat (limited to 'sys-block')
-rw-r--r-- | sys-block/parted/ChangeLog | 8 | ||||
-rw-r--r-- | sys-block/parted/files/parted-3.1-zfs.patch | 170 | ||||
-rw-r--r-- | sys-block/parted/parted-3.1-r1.ebuild | 81 |
3 files changed, 258 insertions, 1 deletions
diff --git a/sys-block/parted/ChangeLog b/sys-block/parted/ChangeLog index 338ef49f3c25..9345d851ebc3 100644 --- a/sys-block/parted/ChangeLog +++ b/sys-block/parted/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-block/parted # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-block/parted/ChangeLog,v 1.22 2012/06/17 16:20:52 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-block/parted/ChangeLog,v 1.23 2012/11/14 03:31:44 jer Exp $ + +*parted-3.1-r1 (14 Nov 2012) + + 14 Nov 2012; Jeroen Roovers <jer@gentoo.org> +parted-3.1-r1.ebuild, + +files/parted-3.1-zfs.patch: + Add ZFS detection by Richard Yao (bug #419157). 17 Jun 2012; Raúl Porcel <armin76@gentoo.org> parted-3.1.ebuild: alpha/ia64/s390/sh/sparc stable wrt #414431 diff --git a/sys-block/parted/files/parted-3.1-zfs.patch b/sys-block/parted/files/parted-3.1-zfs.patch new file mode 100644 index 000000000000..a87d6d346551 --- /dev/null +++ b/sys-block/parted/files/parted-3.1-zfs.patch @@ -0,0 +1,170 @@ +commit 65f838008107a688751dd5a2753c9073e9353daf +Author: root <root@desktop.(none)> +Date: Fri Jun 1 16:26:34 2012 -0400 + + Add ZFS Support + +diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am +index 8d48ea1..51b4151 100644 +--- a/libparted/fs/Makefile.am ++++ b/libparted/fs/Makefile.am +@@ -49,7 +49,8 @@ libfs_la_SOURCES = \ + xfs/platform_defs.h \ + xfs/xfs.c \ + xfs/xfs_sb.h \ +- xfs/xfs_types.h ++ xfs/xfs_types.h \ ++ zfs/zfs.c + + lib_LTLIBRARIES = libparted-fs-resize.la + +diff --git a/libparted/fs/Makefile.in b/libparted/fs/Makefile.in +index 4335eb1..e3a134b 100644 +--- a/libparted/fs/Makefile.in ++++ b/libparted/fs/Makefile.in +@@ -1112,7 +1112,8 @@ libfs_la_SOURCES = \ + xfs/platform_defs.h \ + xfs/xfs.c \ + xfs/xfs_sb.h \ +- xfs/xfs_types.h ++ xfs/xfs_types.h \ ++ zfs/zfs.c + + lib_LTLIBRARIES = libparted-fs-resize.la + EXTRA_DIST = hfs/DOC hfs/HISTORY hfs/TODO fsresize.sym +diff --git a/libparted/fs/zfs/Makefile.am b/libparted/fs/zfs/Makefile.am +new file mode 100644 +index 0000000..3273c6a +--- /dev/null ++++ b/libparted/fs/zfs/zfs.c +@@ -0,0 +1,81 @@ ++/* ++ libparted - a library for manipulating disk partitions ++ Copyright (C) 2000, 2007, 2009-2010 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see <http://www.gnu.org/licenses/>. ++*/ ++ ++#include <config.h> ++ ++#include <parted/parted.h> ++#include <parted/endian.h> ++ ++#if ENABLE_NLS ++# include <libintl.h> ++# define _(String) dgettext (PACKAGE, String) ++#else ++# define _(String) (String) ++#endif /* ENABLE_NLS */ ++ ++#include <unistd.h> ++ ++#define ZFS_BLOCK_SIZES ((int[2]){512, 0}) ++ ++#define ZFS_SIGNATURE 0x00bab10c ++ ++struct zfs_uberblock ++{ ++ uint64_t signature; ++ uint64_t version; ++}; ++ ++static PedGeometry* ++zfs_probe (PedGeometry* geom) ++{ ++ uint8_t buf[512]; ++ struct zfs_uberblock *uber = (void *) buf; ++ ++ if (!ped_geometry_read (geom, buf, 256, 1)) ++ return 0; ++ ++ if ((le64toh (uber->signature) == ZFS_SIGNATURE ++ || be64toh (uber->signature) == ZFS_SIGNATURE) ++ && uber->version != 0) ++ return ped_geometry_new (geom->dev, geom->start, geom->length); ++ else ++ return NULL; ++} ++ ++static PedFileSystemOps zfs_ops = { ++ probe: zfs_probe, ++}; ++ ++static PedFileSystemType zfs_type = { ++ next: NULL, ++ ops: &zfs_ops, ++ name: "zfs", ++ block_sizes: ZFS_BLOCK_SIZES ++}; ++ ++void ++ped_file_system_zfs_init () ++{ ++ ped_file_system_type_register (&zfs_type); ++} ++ ++void ++ped_file_system_zfs_done () ++{ ++ ped_file_system_type_unregister (&zfs_type); ++} +diff --git a/libparted/libparted.c b/libparted/libparted.c +index a6d86f0..6545989 100644 +--- a/libparted/libparted.c ++++ b/libparted/libparted.c +@@ -109,6 +109,7 @@ extern void ped_file_system_hfs_init (void); + extern void ped_file_system_fat_init (void); + extern void ped_file_system_ext2_init (void); + extern void ped_file_system_nilfs2_init (void); ++extern void ped_file_system_zfs_init (void); + + static void + init_file_system_types () +@@ -124,6 +125,7 @@ init_file_system_types () + ped_file_system_fat_init (); + ped_file_system_ext2_init (); + ped_file_system_nilfs2_init (); ++ ped_file_system_zfs_init (); + } + + extern void ped_disk_aix_done (); +@@ -186,6 +188,7 @@ extern void ped_file_system_reiserfs_done (void); + extern void ped_file_system_ufs_done (void); + extern void ped_file_system_xfs_done (void); + extern void ped_file_system_amiga_done (void); ++extern void ped_file_system_zfs_done (void); + + static void + done_file_system_types () +@@ -201,6 +204,7 @@ done_file_system_types () + ped_file_system_ufs_done (); + ped_file_system_xfs_done (); + ped_file_system_amiga_done (); ++ ped_file_system_zfs_done (); + } + + static void _done() __attribute__ ((destructor)); +diff --git a/scripts/data/abi/baseline_symbols.txt b/scripts/data/abi/baseline_symbols.txt +index 9162f1a..8bb87e6 100644 +--- a/scripts/data/abi/baseline_symbols.txt ++++ b/scripts/data/abi/baseline_symbols.txt +@@ -344,6 +344,8 @@ FUNC:ped_file_system_ufs_done + FUNC:ped_file_system_ufs_init + FUNC:ped_file_system_xfs_done + FUNC:ped_file_system_xfs_init ++FUNC:ped_file_system_zfs_done ++FUNC:ped_file_system_zfs_init + FUNC:ped_geometry_check + FUNC:ped_geometry_destroy + FUNC:ped_geometry_duplicate diff --git a/sys-block/parted/parted-3.1-r1.ebuild b/sys-block/parted/parted-3.1-r1.ebuild new file mode 100644 index 000000000000..4f58b58e9cb4 --- /dev/null +++ b/sys-block/parted/parted-3.1-r1.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-block/parted/parted-3.1-r1.ebuild,v 1.1 2012/11/14 03:31:44 jer Exp $ + +EAPI="4" + +WANT_AUTOMAKE="1.11" + +inherit autotools eutils + +DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems" +HOMEPAGE="http://www.gnu.org/software/parted" +SRC_URI="mirror://gnu/${PN}/${P}.tar.xz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~mips ~s390 ~sh ~x86" +IUSE="+debug device-mapper nls readline selinux static-libs test" + +# specific version for gettext needed +# to fix bug 85999 +RDEPEND=" + >=sys-fs/e2fsprogs-1.27 + >=sys-libs/ncurses-5.7-r7 + nls? ( >=sys-devel/gettext-0.12.1-r2 ) + readline? ( >=sys-libs/readline-5.2 ) + selinux? ( sys-libs/libselinux ) + device-mapper? ( || ( >=sys-fs/lvm2-2.02.45 sys-fs/device-mapper ) ) +" +DEPEND=" + ${RDEPEND} + virtual/pkgconfig + test? ( + >=dev-libs/check-0.9.3 + dev-perl/Digest-CRC + ) +" + +src_prepare() { + # Remove tests known to FAIL instead of SKIP without OS/userland support + sed -i libparted/tests/Makefile.am \ + -e 's|t3000-symlink.sh||g' || die "sed failed" + sed -i tests/Makefile.am \ + -e '/t4100-msdos-partition-limits.sh/d' \ + -e '/t4100-dvh-partition-limits.sh/d' \ + -e '/t6000-dm.sh/d' || die "sed failed" + # there is no configure flag for controlling the dev-libs/check test + sed -i configure.ac \ + -e "s:have_check=[a-z]*:have_check=$(usex test):g" || die + + epatch "${FILESDIR}"/${PN}-3.1-zfs.patch + eautoreconf +} + +src_configure() { + econf \ + $(use_with readline) \ + $(use_enable nls) \ + $(use_enable debug) \ + $(use_enable selinux) \ + $(use_enable device-mapper) \ + $(use_enable static-libs static) \ + --disable-rpath +} + +src_test() { + if use debug; then + # Do not die when tests fail - some requirements are not + # properly checked and should not lead to the ebuild failing. + emake check + else + ewarn "Skipping tests because USE=-debug is set." + fi +} + +src_install() { + emake install DESTDIR="${D}" + dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO + dodoc doc/{API,FAT,USER.jp} + find "${ED}" -name '*.la' -exec rm -f {} + +} |