summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-fs
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/archivemount/Manifest3
-rw-r--r--sys-fs/archivemount/archivemount-0.8.3.ebuild18
-rw-r--r--sys-fs/archivemount/archivemount-0.8.4.ebuild18
-rw-r--r--sys-fs/archivemount/archivemount-0.8.5.ebuild18
-rw-r--r--sys-fs/archivemount/metadata.xml8
-rw-r--r--sys-fs/arm-fdisk/Manifest3
-rw-r--r--sys-fs/arm-fdisk/arm-fdisk-3.0.6-r1.ebuild44
-rw-r--r--sys-fs/arm-fdisk/arm-fdisk-3.0.6.ebuild37
-rw-r--r--sys-fs/arm-fdisk/metadata.xml5
-rw-r--r--sys-fs/atari-fdisk/Manifest2
-rw-r--r--sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.1.ebuild42
-rw-r--r--sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild42
-rw-r--r--sys-fs/atari-fdisk/metadata.xml7
-rw-r--r--sys-fs/aufs-headers/Manifest3
-rw-r--r--sys-fs/aufs-headers/aufs-headers-3.19_p20150323.ebuild28
-rw-r--r--sys-fs/aufs-headers/aufs-headers-3.19_p20150420.ebuild28
-rw-r--r--sys-fs/aufs-headers/aufs-headers-4.0_p20150420.ebuild28
-rw-r--r--sys-fs/aufs-headers/metadata.xml7
-rw-r--r--sys-fs/aufs-util/Manifest3
-rw-r--r--sys-fs/aufs-util/aufs-util-3.19_p20150323.ebuild46
-rw-r--r--sys-fs/aufs-util/aufs-util-3.19_p20150420.ebuild46
-rw-r--r--sys-fs/aufs-util/aufs-util-4.0_p20150420.ebuild47
-rw-r--r--sys-fs/aufs-util/files/aufs-util-4.0_p20150420-version.patch16
-rw-r--r--sys-fs/aufs-util/metadata.xml7
-rw-r--r--sys-fs/aufs3/Manifest8
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150406.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150420.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150504.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150511.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150518.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150525.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150608.ebuild172
-rw-r--r--sys-fs/aufs3/aufs3-3_p20150622.ebuild172
-rw-r--r--sys-fs/aufs3/files/README.gentoo20
-rw-r--r--sys-fs/aufs3/files/pax-3.11.patch89
-rw-r--r--sys-fs/aufs3/files/pax-3.patch90
-rw-r--r--sys-fs/aufs3/metadata.xml17
-rw-r--r--sys-fs/aufs4/Manifest8
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150420.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150504.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150511.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150518.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150525.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150608.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150622.ebuild164
-rw-r--r--sys-fs/aufs4/aufs4-0_pre20150629.ebuild164
-rw-r--r--sys-fs/aufs4/files/README.gentoo20
-rw-r--r--sys-fs/aufs4/files/pax-4.patch89
-rw-r--r--sys-fs/aufs4/metadata.xml17
-rw-r--r--sys-fs/autorun/Manifest1
-rw-r--r--sys-fs/autorun/autorun-3.17.ebuild36
-rw-r--r--sys-fs/autorun/files/autorun-3.17-headers.patch13
-rw-r--r--sys-fs/autorun/metadata.xml8
-rw-r--r--sys-fs/avfs/Manifest3
-rw-r--r--sys-fs/avfs/avfs-1.0.1.ebuild61
-rw-r--r--sys-fs/avfs/avfs-1.0.2.ebuild61
-rw-r--r--sys-fs/avfs/avfs-1.0.3.ebuild61
-rw-r--r--sys-fs/avfs/metadata.xml13
-rw-r--r--sys-fs/bashmount/Manifest1
-rw-r--r--sys-fs/bashmount/bashmount-3.2.0.ebuild30
-rw-r--r--sys-fs/bashmount/metadata.xml10
-rw-r--r--sys-fs/bcache-tools/Manifest3
-rw-r--r--sys-fs/bcache-tools/bcache-tools-0_pre20130627-r1.ebuild43
-rw-r--r--sys-fs/bcache-tools/bcache-tools-1.0.4.ebuild52
-rw-r--r--sys-fs/bcache-tools/bcache-tools-1.0.5.ebuild52
-rw-r--r--sys-fs/bcache-tools/bcache-tools-9999.ebuild58
-rw-r--r--sys-fs/bcache-tools/metadata.xml7
-rw-r--r--sys-fs/bedup/Manifest1
-rw-r--r--sys-fs/bedup/bedup-0.9.0_p20140413-r1.ebuild28
-rw-r--r--sys-fs/bedup/bedup-9999.ebuild38
-rw-r--r--sys-fs/bedup/metadata.xml11
-rw-r--r--sys-fs/bindfs/Manifest4
-rw-r--r--sys-fs/bindfs/bindfs-1.12.2.ebuild32
-rw-r--r--sys-fs/bindfs/bindfs-1.12.3.ebuild32
-rw-r--r--sys-fs/bindfs/bindfs-1.12.5.ebuild31
-rw-r--r--sys-fs/bindfs/bindfs-1.12.6.ebuild31
-rw-r--r--sys-fs/bindfs/files/bindfs-1.10.7-cflags.patch16
-rw-r--r--sys-fs/bindfs/files/bindfs-1.12.2-ac-config-headers.patch25
-rw-r--r--sys-fs/bindfs/metadata.xml15
-rw-r--r--sys-fs/btrfs-progs/Manifest9
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild62
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild63
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild63
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild63
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild80
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild80
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild80
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild81
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild81
-rw-r--r--sys-fs/btrfs-progs/btrfs-progs-9999.ebuild81
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch30
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch11
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch17
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch78
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch111
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch146
-rw-r--r--sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch13
-rw-r--r--sys-fs/btrfs-progs/metadata.xml15
-rw-r--r--sys-fs/cachefilesd/Manifest1
-rw-r--r--sys-fs/cachefilesd/cachefilesd-0.10.5-r4.ebuild57
-rw-r--r--sys-fs/cachefilesd/files/0.10.1-makefile.patch21
-rw-r--r--sys-fs/cachefilesd/files/0.10.4-makefile.patch24
-rw-r--r--sys-fs/cachefilesd/files/cachefilesd-2.init54
-rw-r--r--sys-fs/cachefilesd/files/cachefilesd-3.init56
-rw-r--r--sys-fs/cachefilesd/files/cachefilesd-tmpfiles.d1
-rw-r--r--sys-fs/cachefilesd/files/cachefilesd.conf8
-rw-r--r--sys-fs/cachefilesd/files/cachefilesd.init52
-rw-r--r--sys-fs/cachefilesd/metadata.xml7
-rw-r--r--sys-fs/clamfs/Manifest1
-rw-r--r--sys-fs/clamfs/clamfs-1.0.1-r1.ebuild43
-rw-r--r--sys-fs/clamfs/files/clamfs-1.0.1-gcc45.patch15
-rw-r--r--sys-fs/clamfs/files/clamfs-1.0.1-gentoo.patch12
-rw-r--r--sys-fs/clamfs/files/clamfs.confd1
-rw-r--r--sys-fs/clamfs/files/clamfs.initd22
-rw-r--r--sys-fs/clamfs/metadata.xml15
-rw-r--r--sys-fs/cloudfuse/Manifest1
-rw-r--r--sys-fs/cloudfuse/cloudfuse-1.0.ebuild24
-rw-r--r--sys-fs/cloudfuse/metadata.xml20
-rw-r--r--sys-fs/copyfs/Manifest1
-rw-r--r--sys-fs/copyfs/copyfs-1.0.1.ebuild44
-rw-r--r--sys-fs/copyfs/files/copyfs-1.0-unlink.patch158
-rw-r--r--sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch46
-rw-r--r--sys-fs/copyfs/metadata.xml8
-rw-r--r--sys-fs/cramfs/Manifest1
-rw-r--r--sys-fs/cramfs/cramfs-1.1.ebuild26
-rw-r--r--sys-fs/cramfs/metadata.xml8
-rw-r--r--sys-fs/cryptsetup/Manifest4
-rw-r--r--sys-fs/cryptsetup/cryptsetup-1.6.2.ebuild122
-rw-r--r--sys-fs/cryptsetup/cryptsetup-1.6.5.ebuild124
-rw-r--r--sys-fs/cryptsetup/cryptsetup-1.6.6.ebuild130
-rw-r--r--sys-fs/cryptsetup/cryptsetup-1.6.7.ebuild103
-rw-r--r--sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd105
-rwxr-xr-xsys-fs/cryptsetup/files/1.5.1-dmcrypt.rc335
-rw-r--r--sys-fs/cryptsetup/files/1.6.7-dmcrypt.confd111
-rwxr-xr-xsys-fs/cryptsetup/files/1.6.7-dmcrypt.rc340
-rw-r--r--sys-fs/cryptsetup/files/cryptsetup-1.6.1-openssl-static.patch13
-rw-r--r--sys-fs/cryptsetup/metadata.xml17
-rw-r--r--sys-fs/davl/Manifest1
-rw-r--r--sys-fs/davl/davl-1.2.4-r1.ebuild36
-rw-r--r--sys-fs/davl/files/davl-1.2.1-asneeded.patch41
-rw-r--r--sys-fs/davl/files/davl-1.2.4-fragment.patch20
-rw-r--r--sys-fs/davl/metadata.xml10
-rw-r--r--sys-fs/dd-rescue/Manifest6
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.28.ebuild45
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.33.ebuild45
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.40.ebuild45
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.44.ebuild45
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.45.ebuild82
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.46.ebuild84
-rw-r--r--sys-fs/dd-rescue/metadata.xml5
-rw-r--r--sys-fs/ddrescue/Manifest3
-rw-r--r--sys-fs/ddrescue/ddrescue-1.16.ebuild40
-rw-r--r--sys-fs/ddrescue/ddrescue-1.18.1.ebuild42
-rw-r--r--sys-fs/ddrescue/ddrescue-1.19.ebuild43
-rw-r--r--sys-fs/ddrescue/metadata.xml8
-rw-r--r--sys-fs/devfsd/Manifest1
-rw-r--r--sys-fs/devfsd/devfsd-1.3.25-r9.ebuild60
-rwxr-xr-xsys-fs/devfsd/files/devfs-start.sh28
-rwxr-xr-xsys-fs/devfsd/files/devfs-stop.sh16
-rw-r--r--sys-fs/devfsd/files/devfsd-1.3.25-kernel-2.5.patch131
-rw-r--r--sys-fs/devfsd/files/devfsd-1.3.25-no-nis.patch69
-rw-r--r--sys-fs/devfsd/files/devfsd-1.3.25-pic.patch16
-rw-r--r--sys-fs/devfsd/files/devfsd.conf139
-rw-r--r--sys-fs/devfsd/metadata.xml5
-rw-r--r--sys-fs/dfc/Manifest1
-rw-r--r--sys-fs/dfc/dfc-3.0.5-r1.ebuild36
-rw-r--r--sys-fs/dfc/metadata.xml8
-rw-r--r--sys-fs/diskdev_cmds/Manifest3
-rw-r--r--sys-fs/diskdev_cmds/diskdev_cmds-332.14.ebuild41
-rw-r--r--sys-fs/diskdev_cmds/diskdev_cmds-332.14_p1.ebuild47
-rw-r--r--sys-fs/diskdev_cmds/files/diskdev_cmds-respect-cflags.patch9
-rw-r--r--sys-fs/diskdev_cmds/metadata.xml14
-rw-r--r--sys-fs/dmg2img/Manifest5
-rw-r--r--sys-fs/dmg2img/dmg2img-1.6.1.ebuild36
-rw-r--r--sys-fs/dmg2img/dmg2img-1.6.2.ebuild36
-rw-r--r--sys-fs/dmg2img/dmg2img-1.6.4.ebuild36
-rw-r--r--sys-fs/dmg2img/dmg2img-1.6.5.ebuild36
-rw-r--r--sys-fs/dmg2img/dmg2img-1.6.ebuild36
-rw-r--r--sys-fs/dmg2img/metadata.xml13
-rw-r--r--sys-fs/dmraid/Manifest3
-rw-r--r--sys-fs/dmraid/dmraid-1.0.0_rc14.ebuild72
-rw-r--r--sys-fs/dmraid/dmraid-1.0.0_rc15.ebuild72
-rw-r--r--sys-fs/dmraid/dmraid-1.0.0_rc16-r3.ebuild99
-rw-r--r--sys-fs/dmraid/files/dmraid-1.0.0_rc15-devsk-isw.patch24
-rw-r--r--sys-fs/dmraid/files/dmraid-1.0.0_rc15-undo-p-rename.patch13
-rw-r--r--sys-fs/dmraid/files/dmraid-1.0.0_rc16-as-needed2.patch11
-rw-r--r--sys-fs/dmraid/files/dmraid-1.0.0_rc16-return-all-sets.patch11
-rw-r--r--sys-fs/dmraid/files/dmraid-1.0.0_rc16-static-build-fixes.patch110
-rw-r--r--sys-fs/dmraid/files/dmraid-1.0.0_rc16-undo-p-rename.patch13
-rw-r--r--sys-fs/dmraid/files/dmraid-destdir-fix.patch34
-rw-r--r--sys-fs/dmraid/metadata.xml16
-rw-r--r--sys-fs/dosfstools/Manifest3
-rw-r--r--sys-fs/dosfstools/dosfstools-3.0.26.ebuild28
-rw-r--r--sys-fs/dosfstools/dosfstools-3.0.27.ebuild28
-rw-r--r--sys-fs/dosfstools/dosfstools-3.0.28.ebuild29
-rw-r--r--sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch29
-rw-r--r--sys-fs/dosfstools/metadata.xml8
-rw-r--r--sys-fs/duperemove/Manifest5
-rw-r--r--sys-fs/duperemove/duperemove-0.09.1.ebuild26
-rw-r--r--sys-fs/duperemove/duperemove-0.09.2.ebuild36
-rw-r--r--sys-fs/duperemove/duperemove-0.09.3.ebuild31
-rw-r--r--sys-fs/duperemove/duperemove-0.09.4.ebuild31
-rw-r--r--sys-fs/duperemove/duperemove-0.09.5.ebuild31
-rw-r--r--sys-fs/duperemove/metadata.xml15
-rw-r--r--sys-fs/e2fsprogs/Manifest4
-rw-r--r--sys-fs/e2fsprogs/e2fsprogs-1.41.7-r1.ebuild138
-rw-r--r--sys-fs/e2fsprogs/e2fsprogs-1.42.12.ebuild126
-rw-r--r--sys-fs/e2fsprogs/e2fsprogs-1.42.13.ebuild126
-rw-r--r--sys-fs/e2fsprogs/files/0001-resize2fs-Fix-error-message-so-the-mountpoint-is-pri.patch45
-rw-r--r--sys-fs/e2fsprogs/files/e2fsck.conf6
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.38-tests-locale.patch26
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch11
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.41.5-makefile.patch91
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch10
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-e2fsck-fix-makefile-dependency.patch28
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-fix-build-cflags.patch13
-rw-r--r--sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch13
-rw-r--r--sys-fs/e2fsprogs/files/fsck_ext2fs.896
-rw-r--r--sys-fs/e2fsprogs/files/fsck_ext2fs.c147
-rw-r--r--sys-fs/e2fsprogs/metadata.xml9
-rw-r--r--sys-fs/e2tools/Manifest1
-rw-r--r--sys-fs/e2tools/e2tools-0.0.16.ebuild22
-rw-r--r--sys-fs/e2tools/metadata.xml5
-rw-r--r--sys-fs/e4rat/Manifest2
-rw-r--r--sys-fs/e4rat/e4rat-0.2.3-r1.ebuild61
-rw-r--r--sys-fs/e4rat/e4rat-0.2.4_pre20141201.ebuild64
-rw-r--r--sys-fs/e4rat/files/e4rat-0.2.2-libdir.patch14
-rw-r--r--sys-fs/e4rat/files/e4rat-0.2.2-shared-build.patch74
-rw-r--r--sys-fs/e4rat/files/e4rat-0.2.3-boostfsv3.patch86
-rw-r--r--sys-fs/e4rat/files/e4rat-libdir.patch26
-rw-r--r--sys-fs/e4rat/files/e4rat-shared-build.patch96
-rw-r--r--sys-fs/e4rat/metadata.xml8
-rw-r--r--sys-fs/ecryptfs-utils/Manifest1
-rw-r--r--sys-fs/ecryptfs-utils/ecryptfs-utils-104.ebuild134
-rw-r--r--sys-fs/ecryptfs-utils/metadata.xml17
-rw-r--r--sys-fs/encfs/Manifest2
-rw-r--r--sys-fs/encfs/encfs-1.7.5.ebuild44
-rw-r--r--sys-fs/encfs/encfs-1.8.1.ebuild50
-rw-r--r--sys-fs/encfs/files/encfs-1.7.5-fix-pod.patch16
-rw-r--r--sys-fs/encfs/metadata.xml12
-rw-r--r--sys-fs/etcd-fs/Manifest1
-rw-r--r--sys-fs/etcd-fs/etcd-fs-0_p20140620.ebuild32
-rw-r--r--sys-fs/etcd-fs/metadata.xml13
-rw-r--r--sys-fs/eudev/Manifest7
-rw-r--r--sys-fs/eudev/eudev-1.10-r2.ebuild301
-rw-r--r--sys-fs/eudev/eudev-1.3.ebuild279
-rw-r--r--sys-fs/eudev/eudev-1.5.3-r1.ebuild286
-rw-r--r--sys-fs/eudev/eudev-1.9-r2.ebuild302
-rw-r--r--sys-fs/eudev/eudev-2.1.1.ebuild296
-rw-r--r--sys-fs/eudev/eudev-3.0.ebuild274
-rw-r--r--sys-fs/eudev/eudev-3.1.2-r10.ebuild270
-rw-r--r--sys-fs/eudev/eudev-3.1.2.ebuild274
-rw-r--r--sys-fs/eudev/eudev-9999.ebuild274
-rw-r--r--sys-fs/eudev/files/40-gentoo.rules10
-rw-r--r--sys-fs/eudev/files/eudev-exclude-MD.patch53
-rw-r--r--sys-fs/eudev/files/eudev-fix-selinux-headers.patch32
-rw-r--r--sys-fs/eudev/files/eudev-fix-selinux-linking.patch30
-rw-r--r--sys-fs/eudev/files/eudev-selinux-timespan.patch27
-rwxr-xr-xsys-fs/eudev/files/udev-postmount55
-rw-r--r--sys-fs/eudev/metadata.xml23
-rw-r--r--sys-fs/exfat-utils/Manifest3
-rw-r--r--sys-fs/exfat-utils/exfat-utils-1.0.1.ebuild29
-rw-r--r--sys-fs/exfat-utils/exfat-utils-1.1.0.ebuild29
-rw-r--r--sys-fs/exfat-utils/exfat-utils-1.1.1.ebuild29
-rw-r--r--sys-fs/exfat-utils/metadata.xml12
-rw-r--r--sys-fs/ext3grep/Manifest1
-rw-r--r--sys-fs/ext3grep/ext3grep-0.10.2.ebuild38
-rw-r--r--sys-fs/ext3grep/files/ext3grep-0.10.1-gcc44.patch197
-rw-r--r--sys-fs/ext3grep/files/ext3grep-0.10.2-include-unistd_h-for-sysconf.patch15
-rw-r--r--sys-fs/ext3grep/files/ext3grep-0.10.2-new-e2fsprogs.diff34
-rw-r--r--sys-fs/ext3grep/metadata.xml10
-rw-r--r--sys-fs/ext4magic/Manifest1
-rw-r--r--sys-fs/ext4magic/ext4magic-0.3.2.ebuild34
-rw-r--r--sys-fs/ext4magic/metadata.xml22
-rw-r--r--sys-fs/extundelete/Manifest3
-rw-r--r--sys-fs/extundelete/extundelete-0.2.0-r1.ebuild27
-rw-r--r--sys-fs/extundelete/extundelete-0.2.0-r2.ebuild30
-rw-r--r--sys-fs/extundelete/extundelete-0.2.4.ebuild21
-rw-r--r--sys-fs/extundelete/files/extundelete-0.2.0-build.patch23
-rw-r--r--sys-fs/extundelete/metadata.xml12
-rw-r--r--sys-fs/f2fs-tools/Manifest5
-rw-r--r--sys-fs/f2fs-tools/f2fs-tools-1.1.0-r1.ebuild19
-rw-r--r--sys-fs/f2fs-tools/f2fs-tools-1.2.0.ebuild26
-rw-r--r--sys-fs/f2fs-tools/f2fs-tools-1.3.0.ebuild26
-rw-r--r--sys-fs/f2fs-tools/f2fs-tools-1.4.0.ebuild26
-rw-r--r--sys-fs/f2fs-tools/f2fs-tools-1.4.1.ebuild26
-rw-r--r--sys-fs/f2fs-tools/metadata.xml8
-rw-r--r--sys-fs/fatsort/Manifest1
-rw-r--r--sys-fs/fatsort/fatsort-1.3.ebuild40
-rw-r--r--sys-fs/fatsort/files/fatsort-1.2-tests.patch30
-rw-r--r--sys-fs/fatsort/metadata.xml17
-rw-r--r--sys-fs/fur/Manifest1
-rw-r--r--sys-fs/fur/fur-0.5.ebuild34
-rw-r--r--sys-fs/fur/metadata.xml11
-rw-r--r--sys-fs/fuse-convmvfs/Manifest1
-rw-r--r--sys-fs/fuse-convmvfs/files/mount.convmvfs8
-rw-r--r--sys-fs/fuse-convmvfs/fuse-convmvfs-0.2.6.ebuild25
-rw-r--r--sys-fs/fuse-convmvfs/metadata.xml10
-rw-r--r--sys-fs/fuse-exfat/Manifest2
-rw-r--r--sys-fs/fuse-exfat/files/99-exfat.rules1
-rw-r--r--sys-fs/fuse-exfat/fuse-exfat-1.0.1.ebuild38
-rw-r--r--sys-fs/fuse-exfat/fuse-exfat-1.1.0.ebuild35
-rw-r--r--sys-fs/fuse-exfat/metadata.xml12
-rw-r--r--sys-fs/fuse-zip/Manifest4
-rw-r--r--sys-fs/fuse-zip/files/fuse-zip-0.2.13-as-needed.patch11
-rw-r--r--sys-fs/fuse-zip/files/libzip-fix-0.10.patch24
-rw-r--r--sys-fs/fuse-zip/fuse-zip-0.2.12.ebuild30
-rw-r--r--sys-fs/fuse-zip/fuse-zip-0.2.13.ebuild42
-rw-r--r--sys-fs/fuse-zip/fuse-zip-0.3.0.ebuild39
-rw-r--r--sys-fs/fuse-zip/fuse-zip-0.4.0.ebuild37
-rw-r--r--sys-fs/fuse-zip/metadata.xml13
-rw-r--r--sys-fs/fuse/Manifest2
-rw-r--r--sys-fs/fuse/files/fuse-2.9.3-kernel-types.patch19
-rw-r--r--sys-fs/fuse/files/fuse-fbsd.init23
-rw-r--r--sys-fs/fuse/files/fuse.init35
-rw-r--r--sys-fs/fuse/fuse-2.9.3.ebuild88
-rw-r--r--sys-fs/fuse/fuse-2.9.4.ebuild88
-rw-r--r--sys-fs/fuse/metadata.xml9
-rw-r--r--sys-fs/fuse4bsd/Manifest4
-rw-r--r--sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-gcc4.patch12
-rw-r--r--sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-ports.patch491
-rw-r--r--sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch15
-rw-r--r--sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch475
-rw-r--r--sys-fs/fuse4bsd/fuse4bsd-0.3.0.ebuild51
-rw-r--r--sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild72
-rw-r--r--sys-fs/fuse4bsd/metadata.xml5
-rw-r--r--sys-fs/fuseiso/Manifest1
-rw-r--r--sys-fs/fuseiso/files/fuseiso-20070708-fix-typo.patch12
-rw-r--r--sys-fs/fuseiso/files/fuseiso-20070708-largeiso.patch48
-rw-r--r--sys-fs/fuseiso/fuseiso-20070708-r1.ebuild29
-rw-r--r--sys-fs/fuseiso/metadata.xml8
-rw-r--r--sys-fs/genext2fs/Manifest4
-rw-r--r--sys-fs/genext2fs/genext2fs-1.3-r1.ebuild33
-rw-r--r--sys-fs/genext2fs/genext2fs-1.4.1.ebuild19
-rw-r--r--sys-fs/genext2fs/genext2fs-1.4.ebuild19
-rw-r--r--sys-fs/genext2fs/metadata.xml8
-rw-r--r--sys-fs/gfs2-utils/Manifest3
-rw-r--r--sys-fs/gfs2-utils/gfs2-utils-3.1.2.ebuild50
-rw-r--r--sys-fs/gfs2-utils/gfs2-utils-3.1.3.ebuild50
-rw-r--r--sys-fs/gfs2-utils/gfs2-utils-3.1.5.ebuild52
-rw-r--r--sys-fs/gfs2-utils/metadata.xml6
-rw-r--r--sys-fs/go-mtpfs/go-mtpfs-9999.ebuild49
-rw-r--r--sys-fs/go-mtpfs/metadata.xml13
-rw-r--r--sys-fs/gt5/Manifest1
-rw-r--r--sys-fs/gt5/files/gt5-1.4.0-bash-shabang.patch9
-rw-r--r--sys-fs/gt5/files/gt5-1.4.0-empty-dirs.patch11
-rw-r--r--sys-fs/gt5/gt5-1.4.0-r2.ebuild32
-rw-r--r--sys-fs/gt5/metadata.xml11
-rw-r--r--sys-fs/hfsplusutils/Manifest1
-rw-r--r--sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-errno.patch19
-rw-r--r--sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc4.patch132
-rw-r--r--sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-glob.patch12
-rw-r--r--sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-string.patch11
-rw-r--r--sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild36
-rw-r--r--sys-fs/hfsplusutils/metadata.xml5
-rw-r--r--sys-fs/hfsutils/Manifest1
-rw-r--r--sys-fs/hfsutils/files/hfsutils-3.2.6-errno.patch13
-rw-r--r--sys-fs/hfsutils/files/hfsutils-3.2.6-fix-tcl-8.6.patch8
-rw-r--r--sys-fs/hfsutils/files/largerthan2gb.patch14
-rw-r--r--sys-fs/hfsutils/hfsutils-3.2.6-r5.ebuild51
-rw-r--r--sys-fs/hfsutils/metadata.xml5
-rw-r--r--sys-fs/inotify-tools/Manifest2
-rw-r--r--sys-fs/inotify-tools/inotify-tools-3.13-r1.ebuild34
-rw-r--r--sys-fs/inotify-tools/inotify-tools-3.14.ebuild34
-rw-r--r--sys-fs/inotify-tools/metadata.xml16
-rw-r--r--sys-fs/iprutils/Manifest5
-rwxr-xr-xsys-fs/iprutils/files/iprdump16
-rwxr-xr-xsys-fs/iprutils/files/iprdump-r116
-rwxr-xr-xsys-fs/iprutils/files/iprinit20
-rwxr-xr-xsys-fs/iprutils/files/iprinit-r120
-rwxr-xr-xsys-fs/iprutils/files/iprupdate11
-rwxr-xr-xsys-fs/iprutils/files/iprupdate-r111
-rw-r--r--sys-fs/iprutils/files/iprutils-2.4.7-tinfo.patch14
-rw-r--r--sys-fs/iprutils/files/iprutils-2.4.8-tinfo.patch14
-rw-r--r--sys-fs/iprutils/iprutils-2.3.13.ebuild41
-rw-r--r--sys-fs/iprutils/iprutils-2.3.18.ebuild56
-rw-r--r--sys-fs/iprutils/iprutils-2.3.9.ebuild41
-rw-r--r--sys-fs/iprutils/iprutils-2.4.7.ebuild46
-rw-r--r--sys-fs/iprutils/iprutils-2.4.8-r1.ebuild51
-rw-r--r--sys-fs/iprutils/metadata.xml8
-rw-r--r--sys-fs/jdiskreport-bin/Manifest3
-rw-r--r--sys-fs/jdiskreport-bin/jdiskreport-bin-1.2.5-r1.ebuild32
-rw-r--r--sys-fs/jdiskreport-bin/jdiskreport-bin-1.3.0.ebuild32
-rw-r--r--sys-fs/jdiskreport-bin/jdiskreport-bin-1.4.1.ebuild32
-rw-r--r--sys-fs/jdiskreport-bin/metadata.xml11
-rw-r--r--sys-fs/jfsutils/Manifest1
-rw-r--r--sys-fs/jfsutils/files/jfsutils-1.1.15-linux-headers.patch12
-rw-r--r--sys-fs/jfsutils/jfsutils-1.1.15.ebuild38
-rw-r--r--sys-fs/jfsutils/metadata.xml9
-rw-r--r--sys-fs/jmtpfs/Manifest1
-rw-r--r--sys-fs/jmtpfs/jmtpfs-0.5.ebuild30
-rw-r--r--sys-fs/jmtpfs/metadata.xml10
-rw-r--r--sys-fs/ldapfuse/Manifest1
-rw-r--r--sys-fs/ldapfuse/ldapfuse-1.0.ebuild23
-rw-r--r--sys-fs/ldapfuse/metadata.xml10
-rw-r--r--sys-fs/lde/Manifest1
-rw-r--r--sys-fs/lde/files/lde-2.6.1-no-shadowing.patch39
-rw-r--r--sys-fs/lde/lde-2.6.1.ebuild33
-rw-r--r--sys-fs/lde/metadata.xml8
-rw-r--r--sys-fs/lessfs/Manifest2
-rw-r--r--sys-fs/lessfs/lessfs-1.5.13.ebuild49
-rw-r--r--sys-fs/lessfs/lessfs-1.7.0.ebuild51
-rw-r--r--sys-fs/lessfs/metadata.xml19
-rw-r--r--sys-fs/libeatmydata/Manifest3
-rw-r--r--sys-fs/libeatmydata/files/libeatmydata-105-undpkg.patch14
-rw-r--r--sys-fs/libeatmydata/libeatmydata-105-r1.ebuild33
-rw-r--r--sys-fs/libeatmydata/libeatmydata-65.ebuild30
-rw-r--r--sys-fs/libeatmydata/libeatmydata-82-r1.ebuild27
-rw-r--r--sys-fs/libeatmydata/libeatmydata-82.ebuild30
-rw-r--r--sys-fs/libeatmydata/metadata.xml15
-rw-r--r--sys-fs/libfat/Manifest1
-rw-r--r--sys-fs/libfat/libfat-0.3a.ebuild21
-rw-r--r--sys-fs/libfat/metadata.xml11
-rw-r--r--sys-fs/loop-aes/Manifest2
-rw-r--r--sys-fs/loop-aes/files/loop-aes-3.7c-linux4.patch45
-rw-r--r--sys-fs/loop-aes/loop-aes-3.7b.ebuild82
-rw-r--r--sys-fs/loop-aes/loop-aes-3.7c.ebuild83
-rw-r--r--sys-fs/loop-aes/metadata.xml15
-rw-r--r--sys-fs/lsscsi/Manifest4
-rw-r--r--sys-fs/lsscsi/lsscsi-0.25.ebuild19
-rw-r--r--sys-fs/lsscsi/lsscsi-0.26.ebuild14
-rw-r--r--sys-fs/lsscsi/lsscsi-0.27.ebuild13
-rw-r--r--sys-fs/lsscsi/lsscsi-0.28.ebuild13
-rw-r--r--sys-fs/lsscsi/metadata.xml5
-rw-r--r--sys-fs/lufis/Manifest2
-rw-r--r--sys-fs/lufis/files/lufis-0.2-lufs.patch250
-rw-r--r--sys-fs/lufis/files/lufis-allow-uid-and-gid-addon.patch29
-rw-r--r--sys-fs/lufis/lufis-0.2.ebuild34
-rw-r--r--sys-fs/lufis/lufis-0.3.ebuild30
-rw-r--r--sys-fs/lufis/metadata.xml8
-rw-r--r--sys-fs/lufs/Manifest1
-rw-r--r--sys-fs/lufs/files/lufs-0.9.7-enable-gnome-2.patch72
-rw-r--r--sys-fs/lufs/files/lufs-0.9.7-fPIC.patch12
-rw-r--r--sys-fs/lufs/files/lufs-0.9.7-gcc43.patch33
-rw-r--r--sys-fs/lufs/files/lufs-automount-port.diff28
-rw-r--r--sys-fs/lufs/files/lufs-no-kernel.patch111
-rw-r--r--sys-fs/lufs/lufs-0.9.7-r3.ebuild71
-rw-r--r--sys-fs/lufs/metadata.xml8
-rw-r--r--sys-fs/lvm2/Manifest4
-rw-r--r--sys-fs/lvm2/files/clvmd.confd-2.02.399
-rwxr-xr-xsys-fs/lvm2/files/clvmd.rc-2.02.39146
-rw-r--r--sys-fs/lvm2/files/device-mapper.conf-1.02.22-r31
-rw-r--r--sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2147
-rw-r--r--sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2111
-rw-r--r--sys-fs/lvm2/files/dmeventd.initd-2.02.67-r126
-rw-r--r--sys-fs/lvm2/files/dmtab12
-rw-r--r--sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r239
-rw-r--r--sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r246
-rw-r--r--sys-fs/lvm2/files/lvm.confd-2.02.28-r25
-rw-r--r--sys-fs/lvm2/files/lvm.rc-2.02.105-r297
-rw-r--r--sys-fs/lvm2/files/lvm.rc-2.02.95-r296
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch93
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch32
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch104
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch50
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch104
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch72
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch42
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch18
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch15
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch63
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch47
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch11
-rwxr-xr-xsys-fs/lvm2/files/lvmetad.initd-2.02.105-r213
-rw-r--r--sys-fs/lvm2/lvm2-2.02.103.ebuild235
-rw-r--r--sys-fs/lvm2/lvm2-2.02.109-r1.ebuild270
-rw-r--r--sys-fs/lvm2/lvm2-2.02.109.ebuild269
-rw-r--r--sys-fs/lvm2/lvm2-2.02.110.ebuild272
-rw-r--r--sys-fs/lvm2/lvm2-2.02.116.ebuild272
-rw-r--r--sys-fs/lvm2/metadata.xml24
-rw-r--r--sys-fs/mac-fdisk/Manifest3
-rw-r--r--sys-fs/mac-fdisk/files/big_pt.patch80
-rw-r--r--sys-fs/mac-fdisk/files/largerthan2gb.patch14
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch112
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch481
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch455
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch190
-rw-r--r--sys-fs/mac-fdisk/mac-fdisk-0.1-r7.ebuild55
-rw-r--r--sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild53
-rw-r--r--sys-fs/mac-fdisk/metadata.xml5
-rw-r--r--sys-fs/mdadm/Manifest6
-rw-r--r--sys-fs/mdadm/files/etc-default-mdadm7
-rw-r--r--sys-fs/mdadm/files/mdadm-3.2.1-mdassemble.patch16
-rw-r--r--sys-fs/mdadm/files/mdadm-3.2.x-udevdir.patch26
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-DDF-validate-metadata_update-size-before-using-it.patch44
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-Grow-Do-not-try-to-restart-if-reshape-is-running.patch45
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-Grow-fix-removal-of-line-in-wrong-case.patch39
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-IMSM-use-strcpy-rather-than-pointless-strncpy.patch32
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-IMSM-validate-metadata_update-size-before-using-it.patch128
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-Makefile-install-mdadm-grow-continue-.service.patch28
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-mdmon-allow-prepare_update-to-report-failure.patch119
-rw-r--r--sys-fs/mdadm/files/mdadm-3.3.1-mdmon-ensure-Unix-domain-socket-is-created-with-safe.patch34
-rw-r--r--sys-fs/mdadm/files/mdadm.confd7
-rwxr-xr-xsys-fs/mdadm/files/mdadm.rc26
-rw-r--r--sys-fs/mdadm/files/mdadm.service13
-rw-r--r--sys-fs/mdadm/files/mdadm.tmpfiles.conf1
-rw-r--r--sys-fs/mdadm/files/mdadm.weekly5
-rw-r--r--sys-fs/mdadm/files/mdraid.confd11
-rw-r--r--sys-fs/mdadm/files/mdraid.rc40
-rw-r--r--sys-fs/mdadm/mdadm-3.2.6-r1.ebuild75
-rw-r--r--sys-fs/mdadm/mdadm-3.3.1-r2.ebuild96
-rw-r--r--sys-fs/mdadm/mdadm-3.3.2-r1.ebuild82
-rw-r--r--sys-fs/mdadm/mdadm-3.3.3.ebuild82
-rw-r--r--sys-fs/mdadm/mdadm-3.3.4.ebuild82
-rw-r--r--sys-fs/mdadm/metadata.xml5
-rw-r--r--sys-fs/metadata.xml32
-rw-r--r--sys-fs/mhddfs/Manifest1
-rw-r--r--sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch66
-rw-r--r--sys-fs/mhddfs/metadata.xml8
-rw-r--r--sys-fs/mhddfs/mhddfs-0.1.39.ebuild47
-rw-r--r--sys-fs/mp3fs/Manifest2
-rw-r--r--sys-fs/mp3fs/metadata.xml11
-rw-r--r--sys-fs/mp3fs/mp3fs-0.32.ebuild24
-rw-r--r--sys-fs/mp3fs/mp3fs-0.91.ebuild21
-rw-r--r--sys-fs/mtd-utils/Manifest5
-rw-r--r--sys-fs/mtd-utils/files/mtd-utils-1.4.8-install.patch32
-rw-r--r--sys-fs/mtd-utils/metadata.xml9
-rw-r--r--sys-fs/mtd-utils/mtd-utils-1.4.5.ebuild60
-rw-r--r--sys-fs/mtd-utils/mtd-utils-1.4.6.ebuild60
-rw-r--r--sys-fs/mtd-utils/mtd-utils-1.4.8.ebuild67
-rw-r--r--sys-fs/mtd-utils/mtd-utils-1.5.0.ebuild62
-rw-r--r--sys-fs/mtd-utils/mtd-utils-1.5.1.ebuild62
-rw-r--r--sys-fs/mtd-utils/mtd-utils-99999999.ebuild62
-rw-r--r--sys-fs/mtools/Manifest5
-rw-r--r--sys-fs/mtools/files/mtools-3.9.11-flags.patch37
-rw-r--r--sys-fs/mtools/metadata.xml5
-rw-r--r--sys-fs/mtools/mtools-4.0.13.ebuild38
-rw-r--r--sys-fs/mtools/mtools-4.0.15.ebuild44
-rw-r--r--sys-fs/mtools/mtools-4.0.16.ebuild44
-rw-r--r--sys-fs/mtools/mtools-4.0.17.ebuild45
-rw-r--r--sys-fs/mtools/mtools-4.0.18.ebuild50
-rw-r--r--sys-fs/mtpfs/Manifest2
-rw-r--r--sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch70
-rw-r--r--sys-fs/mtpfs/files/mtpfs-1.1-unitialized-variable.patch12
-rw-r--r--sys-fs/mtpfs/metadata.xml21
-rw-r--r--sys-fs/mtpfs/mtpfs-1.0.ebuild46
-rw-r--r--sys-fs/mtpfs/mtpfs-1.1-r1.ebuild54
-rw-r--r--sys-fs/mtpfs/mtpfs-1.1-r2.ebuild55
-rw-r--r--sys-fs/mtpfs/mtpfs-1.1.ebuild50
-rw-r--r--sys-fs/multipath-tools/Manifest1
-rw-r--r--sys-fs/multipath-tools/files/multipath-tools-0.5.0-makefile.patch200
-rw-r--r--sys-fs/multipath-tools/files/multipath-tools-0.5.0-systemd-pkgconfig.patch24
-rwxr-xr-xsys-fs/multipath-tools/files/multipath.rc27
-rw-r--r--sys-fs/multipath-tools/files/rc-multipathd21
-rw-r--r--sys-fs/multipath-tools/metadata.xml5
-rw-r--r--sys-fs/multipath-tools/multipath-tools-0.5.0-r1.ebuild66
-rw-r--r--sys-fs/ncdu/Manifest1
-rw-r--r--sys-fs/ncdu/files/ncdu-1.11-missing-header.patch22
-rw-r--r--sys-fs/ncdu/files/ncdu-1.9-pkgconfig.patch39
-rw-r--r--sys-fs/ncdu/metadata.xml15
-rw-r--r--sys-fs/ncdu/ncdu-1.11.ebuild23
-rw-r--r--sys-fs/nilfs-utils/Manifest3
-rw-r--r--sys-fs/nilfs-utils/files/nilfs-utils-2.0.14-gentoo.patch10
-rw-r--r--sys-fs/nilfs-utils/metadata.xml22
-rw-r--r--sys-fs/nilfs-utils/nilfs-utils-2.1.5-r1.ebuild37
-rw-r--r--sys-fs/nilfs-utils/nilfs-utils-2.1.6.ebuild37
-rw-r--r--sys-fs/nilfs-utils/nilfs-utils-2.2.2.ebuild37
-rw-r--r--sys-fs/ntfs3g/Manifest3
-rw-r--r--sys-fs/ntfs3g/files/99-ntfs3g.rules1
-rw-r--r--sys-fs/ntfs3g/files/ntfs3g-2014.2.15-dont-put-things-in-root.patch39
-rw-r--r--sys-fs/ntfs3g/files/ntfs3g-2014.2.15-fix-fstrim-applied-to-partitons.patch217
-rw-r--r--sys-fs/ntfs3g/files/ntfs3g-2014.2.15-implement-fstrim.patch648
-rw-r--r--sys-fs/ntfs3g/files/ntfs3g-2014.2.15-no-split-usr.patch25
-rw-r--r--sys-fs/ntfs3g/files/ntfs3g-2014.2.15-update-fuse-lite-to-support-ioctls.patch610
-rw-r--r--sys-fs/ntfs3g/files/ntfs3g-2015.3.14-dont-put-things-in-root.patch30
-rw-r--r--sys-fs/ntfs3g/metadata.xml29
-rw-r--r--sys-fs/ntfs3g/ntfs3g-2013.1.13.ebuild93
-rw-r--r--sys-fs/ntfs3g/ntfs3g-2014.2.15-r1.ebuild87
-rw-r--r--sys-fs/ntfs3g/ntfs3g-2014.2.15.ebuild93
-rw-r--r--sys-fs/ntfs3g/ntfs3g-2015.3.14.ebuild85
-rw-r--r--sys-fs/obexfs/Manifest2
-rw-r--r--sys-fs/obexfs/metadata.xml12
-rw-r--r--sys-fs/obexfs/obexfs-0.11.ebuild23
-rw-r--r--sys-fs/obexfs/obexfs-0.12.ebuild26
-rw-r--r--sys-fs/ocfs2-tools/Manifest1
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch78
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch19
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2.confd38
-rw-r--r--sys-fs/ocfs2-tools/files/ocfs2.initd125
-rw-r--r--sys-fs/ocfs2-tools/metadata.xml8
-rw-r--r--sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r1.ebuild79
-rw-r--r--sys-fs/owfs/Manifest1
-rw-r--r--sys-fs/owfs/files/owfs-vendordir.patch30
-rw-r--r--sys-fs/owfs/files/owfs.confd2
-rwxr-xr-xsys-fs/owfs/files/owfs.initd32
-rw-r--r--sys-fs/owfs/files/owftpd.confd2
-rwxr-xr-xsys-fs/owfs/files/owftpd.initd32
-rw-r--r--sys-fs/owfs/files/owhttpd.confd2
-rwxr-xr-xsys-fs/owfs/files/owhttpd.initd32
-rw-r--r--sys-fs/owfs/files/owserver.confd2
-rwxr-xr-xsys-fs/owfs/files/owserver.initd32
-rw-r--r--sys-fs/owfs/metadata.xml24
-rw-r--r--sys-fs/owfs/owfs-2.7_p21-r4.ebuild168
-rw-r--r--sys-fs/progsreiserfs/Manifest1
-rw-r--r--sys-fs/progsreiserfs/files/progsreiserfs-0.3.1_rc8-autotools.patch13
-rw-r--r--sys-fs/progsreiserfs/metadata.xml9
-rw-r--r--sys-fs/progsreiserfs/progsreiserfs-0.3.1_rc8.ebuild60
-rw-r--r--sys-fs/pysize/Manifest1
-rw-r--r--sys-fs/pysize/files/0.2-setuptools-automagic.patch12
-rw-r--r--sys-fs/pysize/files/psyco-0.2-automagic.patch20
-rw-r--r--sys-fs/pysize/metadata.xml7
-rw-r--r--sys-fs/pysize/pysize-0.2-r1.ebuild71
-rw-r--r--sys-fs/pytagsfs/Manifest2
-rw-r--r--sys-fs/pytagsfs/metadata.xml11
-rw-r--r--sys-fs/pytagsfs/pytagsfs-0.9.2.ebuild41
-rw-r--r--sys-fs/pytagsfs/pytagsfs-0.9.2_rc2.ebuild41
-rw-r--r--sys-fs/quota/Manifest3
-rw-r--r--sys-fs/quota/files/quota-4.01-cflags.patch58
-rw-r--r--sys-fs/quota/files/quota-4.01-mnt.patch13
-rw-r--r--sys-fs/quota/files/quota-no-quotactl-manpage.patch19
-rw-r--r--sys-fs/quota/files/quota.confd20
-rw-r--r--sys-fs/quota/files/quota.rc738
-rw-r--r--sys-fs/quota/files/rpc.rquotad.initd26
-rw-r--r--sys-fs/quota/metadata.xml12
-rw-r--r--sys-fs/quota/quota-3.17-r1.ebuild80
-rw-r--r--sys-fs/quota/quota-4.01.ebuild80
-rw-r--r--sys-fs/quota/quota-4.02.ebuild78
-rw-r--r--sys-fs/quotatool/Manifest8
-rw-r--r--sys-fs/quotatool/files/quotatool-1.4.11-ldflags.patch27
-rw-r--r--sys-fs/quotatool/files/quotatool-1.4.13-ldflags.patch23
-rw-r--r--sys-fs/quotatool/metadata.xml5
-rw-r--r--sys-fs/quotatool/quotatool-1.4.11.ebuild33
-rw-r--r--sys-fs/quotatool/quotatool-1.4.12.ebuild32
-rw-r--r--sys-fs/quotatool/quotatool-1.4.13.ebuild27
-rw-r--r--sys-fs/quotatool/quotatool-1.4.6.ebuild20
-rw-r--r--sys-fs/quotatool/quotatool-1.5.0.ebuild27
-rw-r--r--sys-fs/quotatool/quotatool-1.6.0.ebuild27
-rw-r--r--sys-fs/quotatool/quotatool-1.6.1.ebuild27
-rw-r--r--sys-fs/quotatool/quotatool-1.6.2.ebuild27
-rw-r--r--sys-fs/rar2fs/Manifest1
-rw-r--r--sys-fs/rar2fs/metadata.xml16
-rw-r--r--sys-fs/rar2fs/rar2fs-1.20.0.ebuild28
-rw-r--r--sys-fs/rarfs/Manifest1
-rw-r--r--sys-fs/rarfs/metadata.xml11
-rw-r--r--sys-fs/rarfs/rarfs-0.1.1.ebuild38
-rw-r--r--sys-fs/redirfs/Manifest2
-rw-r--r--sys-fs/redirfs/metadata.xml22
-rw-r--r--sys-fs/redirfs/redirfs-0.10.20120313.ebuild35
-rw-r--r--sys-fs/redirfs/redirfs-0.8.ebuild31
-rw-r--r--sys-fs/redirfs/redirfs-9999.ebuild41
-rw-r--r--sys-fs/reiser4progs/Manifest3
-rw-r--r--sys-fs/reiser4progs/files/reiser4progs-1.0.7-gcc-4.4.patch15
-rw-r--r--sys-fs/reiser4progs/files/reiser4progs-1.0.7-readline-6.3.patch16
-rw-r--r--sys-fs/reiser4progs/metadata.xml11
-rw-r--r--sys-fs/reiser4progs/reiser4progs-1.0.7.ebuild55
-rw-r--r--sys-fs/reiser4progs/reiser4progs-1.0.8.ebuild49
-rw-r--r--sys-fs/reiser4progs/reiser4progs-1.0.9.ebuild49
-rw-r--r--sys-fs/reiserfs-defrag/Manifest2
-rw-r--r--sys-fs/reiserfs-defrag/metadata.xml16
-rw-r--r--sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.1.ebuild29
-rw-r--r--sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.2.ebuild25
-rw-r--r--sys-fs/reiserfsprogs/Manifest3
-rw-r--r--sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-fsck-n.patch12
-rw-r--r--sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-unaligned.patch35
-rw-r--r--sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.20-fsck-n.patch12
-rw-r--r--sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fix_large_fs.patch356
-rw-r--r--sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fsck-n.patch14
-rw-r--r--sys-fs/reiserfsprogs/metadata.xml5
-rw-r--r--sys-fs/reiserfsprogs/reiserfsprogs-3.6.21-r1.ebuild32
-rw-r--r--sys-fs/reiserfsprogs/reiserfsprogs-3.6.23.ebuild22
-rw-r--r--sys-fs/reiserfsprogs/reiserfsprogs-3.6.24.ebuild22
-rw-r--r--sys-fs/s3backer/Manifest1
-rw-r--r--sys-fs/s3backer/metadata.xml10
-rw-r--r--sys-fs/s3backer/s3backer-1.3.7.ebuild34
-rw-r--r--sys-fs/s3fs/Manifest2
-rw-r--r--sys-fs/s3fs/metadata.xml12
-rw-r--r--sys-fs/s3fs/s3fs-1.74.ebuild26
-rw-r--r--sys-fs/s3fs/s3fs-1.78.ebuild35
-rw-r--r--sys-fs/s3ql/Manifest4
-rw-r--r--sys-fs/s3ql/metadata.xml15
-rw-r--r--sys-fs/s3ql/s3ql-1.19.ebuild61
-rw-r--r--sys-fs/s3ql/s3ql-2.11.1.ebuild55
-rw-r--r--sys-fs/s3ql/s3ql-2.11.ebuild55
-rw-r--r--sys-fs/s3ql/s3ql-2.12.ebuild55
-rw-r--r--sys-fs/safecopy/Manifest1
-rw-r--r--sys-fs/safecopy/metadata.xml12
-rw-r--r--sys-fs/safecopy/safecopy-1.7.ebuild48
-rw-r--r--sys-fs/scan-ffs/Manifest1
-rw-r--r--sys-fs/scan-ffs/metadata.xml19
-rw-r--r--sys-fs/scan-ffs/scan-ffs-1.2.ebuild26
-rw-r--r--sys-fs/shake/Manifest1
-rw-r--r--sys-fs/shake/files/shake-0.999-fix_stat_include.patch22
-rw-r--r--sys-fs/shake/files/shake-0.999-uclibc.patch49
-rw-r--r--sys-fs/shake/metadata.xml9
-rw-r--r--sys-fs/shake/shake-0.999.ebuild26
-rw-r--r--sys-fs/siefs/Manifest1
-rw-r--r--sys-fs/siefs/files/siefs-0.5-external-vmoconv.patch12
-rw-r--r--sys-fs/siefs/files/siefs-0.5-qa-fixes.patch55
-rw-r--r--sys-fs/siefs/metadata.xml5
-rw-r--r--sys-fs/siefs/siefs-0.5-r1.ebuild32
-rw-r--r--sys-fs/siefs/siefs-0.5-r2.ebuild33
-rw-r--r--sys-fs/simple-mtpfs/Manifest2
-rw-r--r--sys-fs/simple-mtpfs/metadata.xml20
-rw-r--r--sys-fs/simple-mtpfs/simple-mtpfs-0.1.ebuild26
-rw-r--r--sys-fs/simple-mtpfs/simple-mtpfs-0.2.ebuild31
-rw-r--r--sys-fs/simple-mtpfs/simple-mtpfs-9999.ebuild31
-rw-r--r--sys-fs/snapraid/Manifest5
-rw-r--r--sys-fs/snapraid/metadata.xml11
-rw-r--r--sys-fs/snapraid/snapraid-6.2.ebuild21
-rw-r--r--sys-fs/snapraid/snapraid-6.3.ebuild21
-rw-r--r--sys-fs/snapraid/snapraid-7.0.ebuild23
-rw-r--r--sys-fs/snapraid/snapraid-7.1.ebuild18
-rw-r--r--sys-fs/snapraid/snapraid-8.1.ebuild18
-rw-r--r--sys-fs/squashfs-tools/Manifest3
-rw-r--r--sys-fs/squashfs-tools/metadata.xml12
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild40
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild40
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-4.3.ebuild50
-rw-r--r--sys-fs/squashfuse/Manifest1
-rw-r--r--sys-fs/squashfuse/metadata.xml14
-rw-r--r--sys-fs/squashfuse/squashfuse-0.1_p20130530.ebuild45
-rw-r--r--sys-fs/sshfs-fuse/Manifest2
-rw-r--r--sys-fs/sshfs-fuse/metadata.xml8
-rw-r--r--sys-fs/sshfs-fuse/sshfs-fuse-2.4.ebuild28
-rw-r--r--sys-fs/sshfs-fuse/sshfs-fuse-2.5.ebuild28
-rw-r--r--sys-fs/static-dev/metadata.xml5
-rw-r--r--sys-fs/static-dev/static-dev-0.1.ebuild35
-rw-r--r--sys-fs/sysfsutils/Manifest1
-rw-r--r--sys-fs/sysfsutils/metadata.xml12
-rw-r--r--sys-fs/sysfsutils/sysfsutils-2.1.0.ebuild39
-rw-r--r--sys-fs/traydevice/Manifest3
-rw-r--r--sys-fs/traydevice/metadata.xml5
-rw-r--r--sys-fs/traydevice/traydevice-1.5.2.ebuild45
-rw-r--r--sys-fs/traydevice/traydevice-1.5.ebuild46
-rw-r--r--sys-fs/traydevice/traydevice-1.6.2-r1.ebuild38
-rw-r--r--sys-fs/traydevice/traydevice-1.6.2.ebuild38
-rw-r--r--sys-fs/treesize/Manifest1
-rw-r--r--sys-fs/treesize/files/0.54.1-amd64.patch10
-rw-r--r--sys-fs/treesize/metadata.xml13
-rw-r--r--sys-fs/treesize/treesize-0.54.1.ebuild31
-rw-r--r--sys-fs/udev-init-scripts/Manifest3
-rw-r--r--sys-fs/udev-init-scripts/metadata.xml7
-rw-r--r--sys-fs/udev-init-scripts/udev-init-scripts-27.ebuild65
-rw-r--r--sys-fs/udev-init-scripts/udev-init-scripts-29.ebuild51
-rw-r--r--sys-fs/udev-init-scripts/udev-init-scripts-30.ebuild51
-rw-r--r--sys-fs/udev-init-scripts/udev-init-scripts-9999.ebuild51
-rw-r--r--sys-fs/udev/Manifest15
-rw-r--r--sys-fs/udev/metadata.xml16
-rw-r--r--sys-fs/udev/udev-208-r1.ebuild522
-rw-r--r--sys-fs/udev/udev-216.ebuild490
-rw-r--r--sys-fs/udev/udev-217.ebuild497
-rw-r--r--sys-fs/udev/udev-218.ebuild504
-rw-r--r--sys-fs/udev/udev-219.ebuild504
-rw-r--r--sys-fs/udev/udev-220-r1.ebuild507
-rw-r--r--sys-fs/udev/udev-220-r2.ebuild507
-rw-r--r--sys-fs/udev/udev-220-r3.ebuild507
-rw-r--r--sys-fs/udev/udev-222.ebuild435
-rw-r--r--sys-fs/udev/udev-224.ebuild433
-rw-r--r--sys-fs/udev/udev-9999.ebuild433
-rw-r--r--sys-fs/udftools/Manifest2
-rw-r--r--sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch22
-rw-r--r--sys-fs/udftools/files/pktcdvd.init62
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch28
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch15
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch23
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-openflags.patch15
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch44
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch57
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch115
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch164
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch94
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch160
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch52
-rw-r--r--sys-fs/udftools/metadata.xml8
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r10.ebuild49
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r9.ebuild43
-rw-r--r--sys-fs/udiskie/Manifest3
-rw-r--r--sys-fs/udiskie/metadata.xml9
-rw-r--r--sys-fs/udiskie/udiskie-0.6.2.ebuild57
-rw-r--r--sys-fs/udiskie/udiskie-0.6.4.ebuild57
-rw-r--r--sys-fs/udiskie/udiskie-1.1.1.ebuild55
-rw-r--r--sys-fs/udisks-glue/Manifest1
-rw-r--r--sys-fs/udisks-glue/metadata.xml10
-rw-r--r--sys-fs/udisks-glue/udisks-glue-1.3.5.ebuild34
-rw-r--r--sys-fs/udisks/Manifest3
-rw-r--r--sys-fs/udisks/files/udisks-1.0.2-ntfs-3g.patch12
-rw-r--r--sys-fs/udisks/files/udisks-1.0.4-revert-floppy.patch18
-rw-r--r--sys-fs/udisks/files/udisks-1.0.5-stat-includes.patch25
-rw-r--r--sys-fs/udisks/metadata.xml15
-rw-r--r--sys-fs/udisks/udisks-1.0.5-r1.ebuild105
-rw-r--r--sys-fs/udisks/udisks-2.1.4.ebuild102
-rw-r--r--sys-fs/udisks/udisks-2.1.6.ebuild105
-rw-r--r--sys-fs/ufsutils/Manifest2
-rw-r--r--sys-fs/ufsutils/metadata.xml5
-rw-r--r--sys-fs/ufsutils/ufsutils-8.2_p3.ebuild47
-rw-r--r--sys-fs/unionfs-fuse/Manifest4
-rw-r--r--sys-fs/unionfs-fuse/files/unionfs-fuse-0.23-makefile.patch15
-rw-r--r--sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-declare-chroot.patch12
-rw-r--r--sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-link-pthread.patch11
-rw-r--r--sys-fs/unionfs-fuse/metadata.xml11
-rw-r--r--sys-fs/unionfs-fuse/unionfs-fuse-0.24.ebuild23
-rw-r--r--sys-fs/unionfs-fuse/unionfs-fuse-0.25.ebuild23
-rw-r--r--sys-fs/unionfs-fuse/unionfs-fuse-0.26.ebuild30
-rw-r--r--sys-fs/unionfs-fuse/unionfs-fuse-1.0.ebuild22
-rw-r--r--sys-fs/unionfs-fuse/unionfs-fuse-9999.ebuild24
-rw-r--r--sys-fs/vhba/Manifest2
-rw-r--r--sys-fs/vhba/metadata.xml11
-rw-r--r--sys-fs/vhba/vhba-20130607.ebuild85
-rw-r--r--sys-fs/vhba/vhba-20140928.ebuild85
-rw-r--r--sys-fs/vzquota/Manifest1
-rw-r--r--sys-fs/vzquota/metadata.xml8
-rw-r--r--sys-fs/vzquota/vzquota-3.1.ebuild31
-rw-r--r--sys-fs/wpflash/Manifest1
-rw-r--r--sys-fs/wpflash/files/wpflash-gentoo.patch223
-rw-r--r--sys-fs/wpflash/metadata.xml5
-rw-r--r--sys-fs/wpflash/wpflash-0.ebuild31
-rw-r--r--sys-fs/xfsdump/Manifest4
-rw-r--r--sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch22
-rw-r--r--sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch14
-rw-r--r--sys-fs/xfsdump/files/xfsdump-3.0.6-path-overflow.patch31
-rw-r--r--sys-fs/xfsdump/metadata.xml5
-rw-r--r--sys-fs/xfsdump/xfsdump-3.0.6.ebuild50
-rw-r--r--sys-fs/xfsdump/xfsdump-3.1.2.ebuild44
-rw-r--r--sys-fs/xfsdump/xfsdump-3.1.3.ebuild44
-rw-r--r--sys-fs/xfsdump/xfsdump-3.1.4.ebuild44
-rw-r--r--sys-fs/xfsprogs/Manifest5
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-3.1.10-sharedlibs.patch120
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-3.1.11-sharedlibs.patch106
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch108
-rw-r--r--sys-fs/xfsprogs/metadata.xml5
-rw-r--r--sys-fs/xfsprogs/xfsprogs-3.1.10.ebuild96
-rw-r--r--sys-fs/xfsprogs/xfsprogs-3.1.11-r1.ebuild96
-rw-r--r--sys-fs/xfsprogs/xfsprogs-3.2.2.ebuild98
-rw-r--r--sys-fs/xfsprogs/xfsprogs-3.2.3.ebuild98
-rw-r--r--sys-fs/xfsprogs/xfsprogs-3.2.4.ebuild98
-rw-r--r--sys-fs/yaffs-utils/files/yaffs-utils-9999-build.patch36
-rw-r--r--sys-fs/yaffs-utils/metadata.xml5
-rw-r--r--sys-fs/yaffs-utils/yaffs-utils-9999.ebuild30
-rw-r--r--sys-fs/yaffs2-utils/files/yaffs2-utils-9999-build.patch46
-rw-r--r--sys-fs/yaffs2-utils/metadata.xml5
-rw-r--r--sys-fs/yaffs2-utils/yaffs2-utils-9999.ebuild30
-rw-r--r--sys-fs/yaffs2utils/Manifest1
-rw-r--r--sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-build.patch47
-rw-r--r--sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-unyaffs2-pointer.patch13
-rw-r--r--sys-fs/yaffs2utils/metadata.xml5
-rw-r--r--sys-fs/yaffs2utils/yaffs2utils-0.2.9.ebuild32
-rw-r--r--sys-fs/zerofree/Manifest2
-rw-r--r--sys-fs/zerofree/metadata.xml12
-rw-r--r--sys-fs/zerofree/zerofree-1.0.1.ebuild38
-rw-r--r--sys-fs/zerofree/zerofree-1.0.3.ebuild38
-rw-r--r--sys-fs/zfs-kmod/Manifest11
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch39
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch40
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch51
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch36
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch42
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch105
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch473
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch32
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch36
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch41
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch44
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch56
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch70
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch42
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch32
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch73
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch50
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch37
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch58
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch73
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch167
-rw-r--r--sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch108
-rw-r--r--sys-fs/zfs-kmod/metadata.xml14
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild124
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild137
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild152
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild129
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild129
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild129
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild145
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild138
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild142
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild142
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-9999.ebuild137
-rw-r--r--sys-fs/zfs/Manifest13
-rw-r--r--sys-fs/zfs/files/bash-completion232
-rw-r--r--sys-fs/zfs/files/bash-completion-r1391
-rwxr-xr-xsys-fs/zfs/files/zed26
-rw-r--r--sys-fs/zfs/files/zfs-0.6.0_rc14-fix-libzpool-function-relocations.patch34
-rw-r--r--sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch30
-rw-r--r--sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch42
-rw-r--r--sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch167
-rw-r--r--sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch57
-rw-r--r--sys-fs/zfs/files/zfs-init.sh.in29
-rw-r--r--sys-fs/zfs/files/zfs.service.in16
-rw-r--r--sys-fs/zfs/metadata.xml16
-rw-r--r--sys-fs/zfs/zfs-0.6.0_rc13-r2.ebuild123
-rw-r--r--sys-fs/zfs/zfs-0.6.0_rc14-r1.ebuild129
-rw-r--r--sys-fs/zfs/zfs-0.6.1-r4.ebuild154
-rw-r--r--sys-fs/zfs/zfs-0.6.2-r1.ebuild152
-rw-r--r--sys-fs/zfs/zfs-0.6.2-r2.ebuild152
-rw-r--r--sys-fs/zfs/zfs-0.6.2-r3.ebuild152
-rw-r--r--sys-fs/zfs/zfs-0.6.2-r4.ebuild153
-rw-r--r--sys-fs/zfs/zfs-0.6.2-r5.ebuild153
-rw-r--r--sys-fs/zfs/zfs-0.6.2.ebuild142
-rw-r--r--sys-fs/zfs/zfs-0.6.3-r2.ebuild150
-rw-r--r--sys-fs/zfs/zfs-0.6.3.ebuild142
-rw-r--r--sys-fs/zfs/zfs-0.6.4.2.ebuild142
-rw-r--r--sys-fs/zfs/zfs-0.6.4.ebuild143
-rw-r--r--sys-fs/zfs/zfs-9999.ebuild151
901 files changed, 48640 insertions, 0 deletions
diff --git a/sys-fs/archivemount/Manifest b/sys-fs/archivemount/Manifest
new file mode 100644
index 000000000000..89b3cd0985bf
--- /dev/null
+++ b/sys-fs/archivemount/Manifest
@@ -0,0 +1,3 @@
+DIST archivemount-0.8.3.tar.gz 127412 SHA256 e78899a8b7c9cb43fa4526d08c54a9e171475c00bf095770b8779a33e37661ff SHA512 f0d50cdce44a0ee57f0d3a32cb37af4159a7400e47a8c61360c9c0c1be6fdbe98d2aa1cc530b3a71fe70e4f550ea5ed431204d738931dca757135677e1984733 WHIRLPOOL c7466b672f6599de83602d81b423bd3b1b687c02efb6f042f64214f7ac54e3eae11418fbb51347a2ff34bb73dc9406b5bef3b2dd655e13030133dd98e2f28ac9
+DIST archivemount-0.8.4.tar.gz 127751 SHA256 e8dae319a03993d8fb342e85603371c0b0a40752bc22368aceac46c113c3b0ea SHA512 bea9461991cfef129a156f682cb83d58c56b5efe64de21a4fff5858c9e3d3aede5b9b265ee1ae7eb7115290e326c4090c364a3b8de8f3399263ffe54142fd619 WHIRLPOOL 3becd3e22dbca527e72712fb168b9470e0cfdebbc6ee1465b97078394c310dfc614e467a226832067945cf0e176f610bf27405485e9dd7712f90748fd31df718
+DIST archivemount-0.8.5.tar.gz 128998 SHA256 3c919fc46077a0f458cb52454d72c34f1cefda4e2a4e6c987a5156458f144f79 SHA512 ad0feec23b5fa41481520081d6615a8001168daff88bd7314c4127072b946434ade4e4e7505ea325a594d1cfc2d9438ddf72de2a2a0fe39ec5d1abf050c84b3a WHIRLPOOL c2df59d645d5db8786eca3520cd24ca6d5c0f2b317dbd6ad21432e65a76b91a2c234920d45674f18fe3b3b29566f3f6023d5f2ee7005a55459b9c06ebd3911e6
diff --git a/sys-fs/archivemount/archivemount-0.8.3.ebuild b/sys-fs/archivemount/archivemount-0.8.3.ebuild
new file mode 100644
index 000000000000..680ad07c8ae6
--- /dev/null
+++ b/sys-fs/archivemount/archivemount-0.8.3.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Mount archives using libarchive and FUSE"
+HOMEPAGE="http://www.cybernoia.de/software/archivemount/"
+SRC_URI="http://www.cybernoia.de/software/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="app-arch/libarchive:=
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
diff --git a/sys-fs/archivemount/archivemount-0.8.4.ebuild b/sys-fs/archivemount/archivemount-0.8.4.ebuild
new file mode 100644
index 000000000000..bd0001bdfa3d
--- /dev/null
+++ b/sys-fs/archivemount/archivemount-0.8.4.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Mount archives using libarchive and FUSE"
+HOMEPAGE="http://www.cybernoia.de/software/archivemount/"
+SRC_URI="http://www.cybernoia.de/software/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="app-arch/libarchive:=
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
diff --git a/sys-fs/archivemount/archivemount-0.8.5.ebuild b/sys-fs/archivemount/archivemount-0.8.5.ebuild
new file mode 100644
index 000000000000..bd0001bdfa3d
--- /dev/null
+++ b/sys-fs/archivemount/archivemount-0.8.5.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Mount archives using libarchive and FUSE"
+HOMEPAGE="http://www.cybernoia.de/software/archivemount/"
+SRC_URI="http://www.cybernoia.de/software/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="app-arch/libarchive:=
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
diff --git a/sys-fs/archivemount/metadata.xml b/sys-fs/archivemount/metadata.xml
new file mode 100644
index 000000000000..157326a7e891
--- /dev/null
+++ b/sys-fs/archivemount/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/arm-fdisk/Manifest b/sys-fs/arm-fdisk/Manifest
new file mode 100644
index 000000000000..673f366c9ce4
--- /dev/null
+++ b/sys-fs/arm-fdisk/Manifest
@@ -0,0 +1,3 @@
+DIST acorn-fdisk_3.0.6-6.2.diff.gz 5580 SHA256 d84e6a8c05114b044cace9d7705d319cbe38c3878eaf0918b1965453d88254ad SHA512 076587945548f10fef92a93910aee670927a2de9b1b32fd1b4ab72b1cfc26440177745f09b62f9b903987e3802060f4e278e1647ee12b7e2f29a0fd7b36ff188 WHIRLPOOL 6424710566c0c76e6aebcc32f5a9f4251402fc198aa22cad236caa10bf111b3a2a4377b940e6f98035a7193ca7e4b6045ba558557ad2b5b02422c09cb68ffc60
+DIST acorn-fdisk_3.0.6-6.diff.gz 5457 SHA256 ded7560b48ca758bca36fad7d015ad5766cf7f6f84fd89be13ac443138884fec
+DIST arm-fdisk-3.0.6.tar.gz 62266 SHA256 d6254982717be92aaffa1b6a2690d4e8b258285f7596beb196a9d24ceacf3a05 SHA512 954c1112c8108da676a0c4223de3a7b0320a37286b0ed099f3000bf4777ebb483b0b62eb0a5dd480f775c503020e7d9ed6ef737ef7bbc5bce858ae68aa471a3f WHIRLPOOL 3f26a40aa9823bdd87c163cc09d13e99679379238b233f32fe04b8235c4f42ce5d105d05a7a68561900c41b4990d177e69e0e694c5a8598a8e1d19e3745e78d9
diff --git a/sys-fs/arm-fdisk/arm-fdisk-3.0.6-r1.ebuild b/sys-fs/arm-fdisk/arm-fdisk-3.0.6-r1.ebuild
new file mode 100644
index 000000000000..d76ae0587f31
--- /dev/null
+++ b/sys-fs/arm-fdisk/arm-fdisk-3.0.6-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DEB_VER=6.2
+DESCRIPTION="edit disk partitions on Acorn machines"
+HOMEPAGE="http://www.arm.linux.org.uk/"
+SRC_URI="ftp://ftp.arm.linux.org.uk/pub/armlinux/source/other/${P}.tar.gz
+ mirror://debian/pool/main/a/acorn-fdisk/acorn-fdisk_${PV}-${DEB_VER}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc s390 sh sparc x86"
+IUSE=""
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${WORKDIR}"/acorn-fdisk_${PV}-${DEB_VER}.diff
+
+ find "${S}" -name Makefile -print0 | xargs -0 \
+ sed -i \
+ -e "s:-O2 -Wall\( -g\)\?::" \
+ -e "/^CFLAGS/s:=:+=:" \
+ -e "/^LDFLAGS/s:=:+=:" \
+ -e '/^STRIP/s:strip:true:'
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" || die
+}
+
+src_install() {
+ into /
+ newsbin fdisk ${PN} || die "sbin failed"
+ dosym ${PN} /sbin/acorn-fdisk
+ dodoc ChangeLog README debian/changelog
+}
diff --git a/sys-fs/arm-fdisk/arm-fdisk-3.0.6.ebuild b/sys-fs/arm-fdisk/arm-fdisk-3.0.6.ebuild
new file mode 100644
index 000000000000..4b245ff19584
--- /dev/null
+++ b/sys-fs/arm-fdisk/arm-fdisk-3.0.6.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DEB_VER=6
+DESCRIPTION="edit disk partitions on Acorn machines"
+HOMEPAGE="http://www.arm.linux.org.uk/"
+SRC_URI="ftp://ftp.arm.linux.org.uk/pub/armlinux/source/other/${P}.tar.gz
+ mirror://debian/pool/main/a/acorn-fdisk/acorn-fdisk_${PV}-${DEB_VER}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc s390 sh sparc x86"
+IUSE=""
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${WORKDIR}"/acorn-fdisk_${PV}-${DEB_VER}.diff
+
+ find "${S}" -name Makefile -print0 | xargs -0 \
+ sed -i \
+ -e "s:-O2 -Wall\( -g\)\?::" \
+ -e "/^CFLAGS/s:=:+=:" \
+ -e '/^STRIP/s:strip:true:'
+}
+
+src_install() {
+ into /
+ newsbin fdisk ${PN} || die "sbin failed"
+ dosym ${PN} /sbin/acorn-fdisk
+ dodoc ChangeLog README debian/changelog
+}
diff --git a/sys-fs/arm-fdisk/metadata.xml b/sys-fs/arm-fdisk/metadata.xml
new file mode 100644
index 000000000000..5454528f2093
--- /dev/null
+++ b/sys-fs/arm-fdisk/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>arm</herd>
+</pkgmetadata>
diff --git a/sys-fs/atari-fdisk/Manifest b/sys-fs/atari-fdisk/Manifest
new file mode 100644
index 000000000000..b699f5a08743
--- /dev/null
+++ b/sys-fs/atari-fdisk/Manifest
@@ -0,0 +1,2 @@
+DIST atari-fdisk_0.7.1-5.1.tar.gz 67705 SHA256 91eeb9db76b3f99ce48128281a00494a0a2ca43d5ef6bd3690adcf22bb5fcb95 SHA512 80e5e4ed1a1dd3d7fbfed68e33e43864d593f084921c699beca100ddbd5e8adb2da36badd6fc467417d3e80855b484f87576c78700ccfa763c5c7644370275f9 WHIRLPOOL 3b4d66163598d7896beb011d5c86ae481664fbbdd7f243bb2943531d7164924a867e242cf89fd4d664e5feb942c4c272623f3fb0be58685ae533d100be9aa02d
+DIST atari-fdisk_0.7.1-5.4.tar.gz 47576 SHA256 81ddb3a0d0088fb32011cede6deacb98a2b97da24fc8b2efe87dc45da601b96f
diff --git a/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.1.ebuild b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.1.ebuild
new file mode 100644
index 000000000000..52a41622c226
--- /dev/null
+++ b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit versionator toolchain-funcs
+
+MY_PV=$(get_version_component_range 1-3)
+DEB_PV=$(get_version_component_range 4-5)
+DESCRIPTION="create and edit the partition table of a disk partitioned in Atari format"
+HOMEPAGE="http://packages.qa.debian.org/a/atari-fdisk.html"
+SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${MY_PV}-${DEB_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha ~amd64 arm ~hppa ia64 m68k ~mips ~ppc s390 sh ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+src_compile() {
+ emake \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ COMPILE_ARCH=m68k \
+ || die
+}
+
+src_install() {
+ dodoc NEWS README TODO debian/changelog
+ doman debian/atari-fdisk.8
+
+ into /
+ if [[ $(tc-arch) == "m68k" ]] ; then
+ dosbin fdisk || die "sbin fdisk failed"
+ dosym fdisk /sbin/atari-fdisk
+ dosym atari-fdisk.8 /usr/share/man/man8/fdisk.8
+ else
+ dosbin atari-fdisk || die "sbin atari-fdisk failed"
+ fi
+}
diff --git a/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild
new file mode 100644
index 000000000000..84b470043b97
--- /dev/null
+++ b/sys-fs/atari-fdisk/atari-fdisk-0.7.1.5.4.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit versionator toolchain-funcs
+
+MY_PV=$(get_version_component_range 1-3)
+DEB_PV=$(get_version_component_range 4-5)
+DESCRIPTION="create and edit the partition table of a disk partitioned in Atari format"
+HOMEPAGE="http://packages.qa.debian.org/a/atari-fdisk.html"
+SRC_URI="mirror://debian/pool/main/a/${PN}/${PN}_${MY_PV}-${DEB_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 m68k ~mips ~ppc ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+src_compile() {
+ emake \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ COMPILE_ARCH=m68k \
+ || die
+}
+
+src_install() {
+ dodoc NEWS README TODO debian/changelog
+ doman debian/atari-fdisk.8
+
+ into /
+ if [[ $(tc-arch) == "m68k" ]] ; then
+ dosbin fdisk || die "sbin fdisk failed"
+ dosym fdisk /sbin/atari-fdisk
+ dosym atari-fdisk.8 /usr/share/man/man8/fdisk.8
+ else
+ dosbin atari-fdisk || die "sbin atari-fdisk failed"
+ fi
+}
diff --git a/sys-fs/atari-fdisk/metadata.xml b/sys-fs/atari-fdisk/metadata.xml
new file mode 100644
index 000000000000..0ba9416963a3
--- /dev/null
+++ b/sys-fs/atari-fdisk/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>m68k@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-fs/aufs-headers/Manifest b/sys-fs/aufs-headers/Manifest
new file mode 100644
index 000000000000..7342d48c4ffa
--- /dev/null
+++ b/sys-fs/aufs-headers/Manifest
@@ -0,0 +1,3 @@
+DIST aufs-headers-3.19_p20150323.tar.xz 3136 SHA256 84f70923b23268abe3cf8ccb547f30a40d9d4a8f422ce6f070fb3eb78233ec55 SHA512 a137003b8b09ac3b929914dba27a13a9c2d803733ab7e073388b2a34f329f0b1ffcbe9646787738565ef28d3be77ca4a9bc520d759db4ca799cb2aa3643ee06f WHIRLPOOL 74f36e80805fd17861cd66c9b17f76371b8a726d3422c1ef6dbb8e7cd5ebb350b795bc9026898a472f4091e3745e1683dc18e2bd88fd8492eaaef49dde53968b
+DIST aufs-headers-3.19_p20150420.tar.xz 3140 SHA256 b9b05adbc65d489e41d8290e25ed701350b15eb6033be48a80010661050553de SHA512 257acbdd2439d7250e1903dbd7098d5a71749110caec6f6eecbc2e93b07859b5a751138a8000204ab735e3082ad15fdf249b132a7bac0ad6fbb0994213ab601d WHIRLPOOL 67545b7b7481f48313b4b45bfa027edf86ed5e11c11f01cbfdbdcd38378f5f00709f29ca270fd3341c5745825366105462778f4d309f0f3f9b82265a009be58e
+DIST aufs-headers-4.0_p20150420.tar.xz 3140 SHA256 977e9ca19213faaeae58b2e28b458ee7369c361846f89ec86a043571bab35366 SHA512 fe1d42c66721cf78125070f29fc40dc3f88d84f8a59a35333a427f1d6e0353207ad595a8bd3e12591fcb73a54b76db122d2f2519c7db4dee0557f38dfdc0fe03 WHIRLPOOL 2a92b6dd45a6b52f69e634fffcfbf105fb01f3ad56ee68015c01ed499b0f4fe38e1793b19e05d38f509b2ac1d8f8ce1c1b7183ff746c448697c8270be4be1ee7
diff --git a/sys-fs/aufs-headers/aufs-headers-3.19_p20150323.ebuild b/sys-fs/aufs-headers/aufs-headers-3.19_p20150323.ebuild
new file mode 100644
index 000000000000..c2b1a29aac22
--- /dev/null
+++ b/sys-fs/aufs-headers/aufs-headers-3.19_p20150323.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator
+
+DESCRIPTION="User space headers for aufs3"
+HOMEPAGE="http://aufs.sourceforge.net/"
+# Clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-linux.git
+# Check aufs release Branch
+# Create .config
+# make headers_install INSTALL_HDR_PATH=${T}
+# find ${T} -type f \( ! -name "*aufs*" \) -delete
+# find ${T} -type d -empty -delete
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+S="${WORKDIR}"
+
+src_install() {
+ doheader -r include/*
+}
diff --git a/sys-fs/aufs-headers/aufs-headers-3.19_p20150420.ebuild b/sys-fs/aufs-headers/aufs-headers-3.19_p20150420.ebuild
new file mode 100644
index 000000000000..c2b1a29aac22
--- /dev/null
+++ b/sys-fs/aufs-headers/aufs-headers-3.19_p20150420.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator
+
+DESCRIPTION="User space headers for aufs3"
+HOMEPAGE="http://aufs.sourceforge.net/"
+# Clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-linux.git
+# Check aufs release Branch
+# Create .config
+# make headers_install INSTALL_HDR_PATH=${T}
+# find ${T} -type f \( ! -name "*aufs*" \) -delete
+# find ${T} -type d -empty -delete
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+S="${WORKDIR}"
+
+src_install() {
+ doheader -r include/*
+}
diff --git a/sys-fs/aufs-headers/aufs-headers-4.0_p20150420.ebuild b/sys-fs/aufs-headers/aufs-headers-4.0_p20150420.ebuild
new file mode 100644
index 000000000000..c2b1a29aac22
--- /dev/null
+++ b/sys-fs/aufs-headers/aufs-headers-4.0_p20150420.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator
+
+DESCRIPTION="User space headers for aufs3"
+HOMEPAGE="http://aufs.sourceforge.net/"
+# Clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-linux.git
+# Check aufs release Branch
+# Create .config
+# make headers_install INSTALL_HDR_PATH=${T}
+# find ${T} -type f \( ! -name "*aufs*" \) -delete
+# find ${T} -type d -empty -delete
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+S="${WORKDIR}"
+
+src_install() {
+ doheader -r include/*
+}
diff --git a/sys-fs/aufs-headers/metadata.xml b/sys-fs/aufs-headers/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sys-fs/aufs-headers/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/aufs-util/Manifest b/sys-fs/aufs-util/Manifest
new file mode 100644
index 000000000000..65e77e807f21
--- /dev/null
+++ b/sys-fs/aufs-util/Manifest
@@ -0,0 +1,3 @@
+DIST aufs-util-3.19_p20150323.tar.xz 97980 SHA256 6a7c342f7cda2abd7ee0eb20c40419c7e34a88cf73d77f4a9a697370a996fe7d SHA512 49f138538ea8997ddb6bedf368815f16a5d42a49b5f72c1548cd9c3718bb00831224e80e9b4dd8c984a6fb40b11223e317757020076d432117541f7d361b892b WHIRLPOOL 59d65f468bbb36ac11f200e45d2449549512a1b2168c4776764a540d22d919969067b551704d55403111a0b68364831152177dda8ace101fe77e158e86d82d25
+DIST aufs-util-3.19_p20150420.tar.xz 97980 SHA256 2ab7f16ee4a67b8ac85903da2e2f6569c8659ee217f060923ba93865a3ff212f SHA512 fe329e9efdbd7b585664b81c2bcd2d63ce5344d013eb2d76c6247e042c1cbe44a4a3ab6e8317734c06c24c1eeffe438d8f91a8e57d95b34e238b21a8b9389e8a WHIRLPOOL 0d3c6aa78e9ecbbb2cabbcddfbf7a9edd1d931b5993047e98f4eaf20e7c60c0077819a2c0b7d0f2e3fd85f6f9eedf86c17c508f3437194e2379295d94e1dc62d
+DIST aufs-util-4.0_p20150420.tar.xz 97924 SHA256 f6d19dad3729da05af9e283e48a4a573b7e00e5e822aa1741e0c225e69171fde SHA512 9a988dcd3640e4797c731ab921161bccbd125fc23475e39681b3a398a238715cb85ac8fe8dfc64053af7478c8c33fe28b7e8cc3a2f97eb31e3c4049305043085 WHIRLPOOL 50baac4fe8bfcc750038e586f9dc3fd2d819ba485951e624c0b07c95c81000fbe7c0b70cf55b61667be7210dff328290cbf95a198680e59549c31c3979d2c471
diff --git a/sys-fs/aufs-util/aufs-util-3.19_p20150323.ebuild b/sys-fs/aufs-util/aufs-util-3.19_p20150323.ebuild
new file mode 100644
index 000000000000..10ce3942ab3c
--- /dev/null
+++ b/sys-fs/aufs-util/aufs-util-3.19_p20150323.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic linux-info multilib toolchain-funcs
+
+DESCRIPTION="Utilities are always necessary for aufs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+# git archive -v --prefix=${P}/ --remote=git://git.code.sf.net/p/aufs/aufs-util aufs3.14 -o ${P}.tar
+# xz -ve9 *.tar
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ !sys-fs/aufs2
+ !<sys-fs/aufs3-3_p20130318"
+DEPEND="${RDEPEND}
+ ~sys-fs/aufs-headers-${PV}"
+
+src_prepare() {
+ sed \
+ -e "/LDFLAGS += -static -s/d" \
+ -e "/CFLAGS/s:-O::g" \
+ -i Makefile || die
+
+ sed \
+ -e '/LDFLAGS/s: -s::g' \
+ -e "s:m 644 -s:m 644:g" \
+ -e "s:/usr/lib:/usr/$(get_libdir):g" \
+ -i libau/Makefile || die
+
+ sed \
+ -e '/LDFLAGS/s: -s::g' \
+ -e '/LDLIBS/s:-lrt::g' \
+ -e '/LDLIBS/s:$: -lrt:g' \
+ -i fhsm/Makefile || die
+
+ tc-export CC AR
+ export HOSTCC=$(tc-getCC)
+}
diff --git a/sys-fs/aufs-util/aufs-util-3.19_p20150420.ebuild b/sys-fs/aufs-util/aufs-util-3.19_p20150420.ebuild
new file mode 100644
index 000000000000..10ce3942ab3c
--- /dev/null
+++ b/sys-fs/aufs-util/aufs-util-3.19_p20150420.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic linux-info multilib toolchain-funcs
+
+DESCRIPTION="Utilities are always necessary for aufs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+# git archive -v --prefix=${P}/ --remote=git://git.code.sf.net/p/aufs/aufs-util aufs3.14 -o ${P}.tar
+# xz -ve9 *.tar
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ !sys-fs/aufs2
+ !<sys-fs/aufs3-3_p20130318"
+DEPEND="${RDEPEND}
+ ~sys-fs/aufs-headers-${PV}"
+
+src_prepare() {
+ sed \
+ -e "/LDFLAGS += -static -s/d" \
+ -e "/CFLAGS/s:-O::g" \
+ -i Makefile || die
+
+ sed \
+ -e '/LDFLAGS/s: -s::g' \
+ -e "s:m 644 -s:m 644:g" \
+ -e "s:/usr/lib:/usr/$(get_libdir):g" \
+ -i libau/Makefile || die
+
+ sed \
+ -e '/LDFLAGS/s: -s::g' \
+ -e '/LDLIBS/s:-lrt::g' \
+ -e '/LDLIBS/s:$: -lrt:g' \
+ -i fhsm/Makefile || die
+
+ tc-export CC AR
+ export HOSTCC=$(tc-getCC)
+}
diff --git a/sys-fs/aufs-util/aufs-util-4.0_p20150420.ebuild b/sys-fs/aufs-util/aufs-util-4.0_p20150420.ebuild
new file mode 100644
index 000000000000..f7fee92dd671
--- /dev/null
+++ b/sys-fs/aufs-util/aufs-util-4.0_p20150420.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info multilib toolchain-funcs
+
+DESCRIPTION="Utilities are always necessary for aufs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+# git archive -v --prefix=${P}/ --remote=git://git.code.sf.net/p/aufs/aufs-util aufs4.0 -o ${P}.tar
+# xz -ve9 *.tar
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ !sys-fs/aufs2
+ !<sys-fs/aufs3-3_p20130318"
+DEPEND="${RDEPEND}
+ ~sys-fs/aufs-headers-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-version.patch
+ sed \
+ -e "/LDFLAGS += -static -s/d" \
+ -e "/CFLAGS/s:-O::g" \
+ -i Makefile || die
+
+ sed \
+ -e '/LDFLAGS/s: -s::g' \
+ -e "s:m 644 -s:m 644:g" \
+ -e "s:/usr/lib:/usr/$(get_libdir):g" \
+ -i libau/Makefile || die
+
+ sed \
+ -e '/LDFLAGS/s: -s::g' \
+ -e '/LDLIBS/s:-lrt::g' \
+ -e '/LDLIBS/s:$: -lrt:g' \
+ -i fhsm/Makefile || die
+
+ tc-export CC AR
+ export HOSTCC=$(tc-getCC)
+}
diff --git a/sys-fs/aufs-util/files/aufs-util-4.0_p20150420-version.patch b/sys-fs/aufs-util/files/aufs-util-4.0_p20150420-version.patch
new file mode 100644
index 000000000000..b861bb2bb0b7
--- /dev/null
+++ b/sys-fs/aufs-util/files/aufs-util-4.0_p20150420-version.patch
@@ -0,0 +1,16 @@
+ ver.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ver.c b/ver.c
+index 200b119..38abdd5 100644
+--- a/ver.c
++++ b/ver.c
+@@ -25,7 +25,7 @@
+ int main(int argc, char *argv[])
+ {
+ regex_t preg;
+- const char *pat = "^4\\.[0-9][0-9]";
++ const char *pat = "^4\\.[0-9][0-9]?";
+
+ if (regcomp(&preg, pat, REG_EXTENDED | REG_NOSUB))
+ AuFin("regcomp");
diff --git a/sys-fs/aufs-util/metadata.xml b/sys-fs/aufs-util/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sys-fs/aufs-util/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/aufs3/Manifest b/sys-fs/aufs3/Manifest
new file mode 100644
index 000000000000..6604433d0ce7
--- /dev/null
+++ b/sys-fs/aufs3/Manifest
@@ -0,0 +1,8 @@
+DIST aufs3-standalone-3_p20150406.tar.xz 2863952 SHA256 e2de4fcdb086ab33bc182b084bf534891cc31a7d3ffc805d40dc087c37ab464b SHA512 c843999798f99fef5c16232935606ca438774104dc04c58982bb2b3f9ae371d9f2173b5454d366481de22fd3e658ee9e67f6981504c5c8157af20a8f15f269d1 WHIRLPOOL 0d2efaa6918c6f90339cae02a9ef3908921e8d1903364aaff9af034262f439886a02a639f9eaae27a28093fc6bf451bbc9fe7072a766a36e51f75c779378095d
+DIST aufs3-standalone-3_p20150420.tar.xz 2864092 SHA256 0f592b3c84b149d0842c518b83656be61a627f5bb9c953b824fd1631e24a2224 SHA512 ad383f37c5201a6a6e53e91f18d63648b3768b8327f07c36a207eb90b63b13779709a0f18696896c833866a30e1010c70ad8aa1259ae08dca5465a68f91d48e5 WHIRLPOOL 029f0cb665e0aa5f8d8bc2a93177e73d8ee7d80d68326f4f38018cec5678ff70378e70473f48bde1ba4f8096331eae4e40949b7c732f22789d09c690cd5cfce7
+DIST aufs3-standalone-3_p20150504.tar.xz 2886004 SHA256 f88435f8fa5d0316a5d87cc8c99012a5504e4f52deee518ae6d4b48152a38071 SHA512 acb863eb197a089e7720237f4b1f1a28be150eee751cb6930e16d96053c1dee84333479ac5f2e5eee2107fe73f9563fe4864c01d07a9de452cff1b7fd283844c WHIRLPOOL d6dcea3e86d0eb5636fe6026c9d8e887e8c15283f364aaf41fe1b7eb4ebfe51caae8dcad26162353e90a28e27587a777fa6d7d6e710c1d1006f2b597bd39c06e
+DIST aufs3-standalone-3_p20150511.tar.xz 2940252 SHA256 c3f67eff4fa23a1734e94733d7d7f9e7be1564525e70c8207995a02f96c75ab3 SHA512 c66c6450596f5f5dd6223b7945cbd5a6bf8117c2c0c98547a7debae6e78965cce1cc5e681d60efa798f93f94f67c0129c5372d9fbcbd313abfc5a6bbf89d28df WHIRLPOOL e56fbac3edff29bcc2653683ceaa6e94f18f0764d435e454e981b9f728b03a7cb7562f5a1005455a764cfaf001c7db87d3b74e9a433165d51d53097f45f9cf75
+DIST aufs3-standalone-3_p20150518.tar.xz 2967016 SHA256 f938bdcc461dacf2b59c807b31fca70f166007a3973c50076b60c6d2e53b163c SHA512 7aede4db3135949a7f3098a29ff9234e21eb78534c0aec3b8fdcd63782110f48c76734752857bd157b29cbd16fdb7e844cc50992e4750cfb05ccfba2d9247b64 WHIRLPOOL bdf559b43d2cede70c334621574f62f123a481cefbec091f3e9e3bd12a499ea985e885a941e24634c2d8e9e9a83acb2c149da29038db00562824647ca6e8db78
+DIST aufs3-standalone-3_p20150525.tar.xz 2988108 SHA256 117be76206e67425c4144174afaa347c4f9e9414200899b5c43a8ec0b91c7d03 SHA512 ea6031ff9231ce68b95450e428989ad81b1c6ce4a9a21f718f73dbafd3aa1e12191d7abd57829e0f80cc0cf0aa412e35b2cad4e14430078b88b2e17312d7b708 WHIRLPOOL 81aeff069ebc6122856c74fcdd38784bd7a231c99726a73ddaad04f145978053fd3ff8b788ac0995fa261cfbf62d461c43f8dca887525df887fdb0011a417f40
+DIST aufs3-standalone-3_p20150608.tar.xz 3015460 SHA256 cdf92d07f45becfeb70ea3314e554ea9c8766a2815c3aa6c8d634b5307c76d5d SHA512 4d29d2d4908cd7a4471bc3efe5c23e57d41765937c700eee8593a5c07d7e84e12e6093ef4338b6bd4e9e6f0e44674557a659fd5fa5257a79b381385d208c2209 WHIRLPOOL ccf68e64eb5bc1893c2e5d50c6fc3eaf4e71fd06949ae16e4343734dca39f7f016ab0a08796d444efe55947a8645193979c0dccce702d8c38e46207bfde4f1ad
+DIST aufs3-standalone-3_p20150622.tar.xz 3063280 SHA256 2fa44f9df9d58df7a5251ebd2cec206fa90ca8e110c1f657df18e62adb170517 SHA512 fe7a62249130d68f72b14f21b57e5d6db402f56637afc876068d916e78884d08476c804ac58ef06eeb9e13e0a2e1cb75ac782f83054f1c06cb85c74a3c48ba01 WHIRLPOOL 7f85a5324d51e148c97109357c13fcab76121d25ee006211d2212f9c6d352330be110569848c8ca96421bc4582025c73030329d7e501837e4d18cafd6002f153
diff --git a/sys-fs/aufs3/aufs3-3_p20150406.ebuild b/sys-fs/aufs3/aufs3-3_p20150406.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150406.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150420.ebuild b/sys-fs/aufs3/aufs3-3_p20150420.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150420.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150504.ebuild b/sys-fs/aufs3/aufs3-3_p20150504.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150504.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150511.ebuild b/sys-fs/aufs3/aufs3-3_p20150511.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150511.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150518.ebuild b/sys-fs/aufs3/aufs3-3_p20150518.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150518.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150525.ebuild b/sys-fs/aufs3/aufs3-3_p20150525.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150525.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150608.ebuild b/sys-fs/aufs3/aufs3-3_p20150608.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150608.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/aufs3-3_p20150622.ebuild b/sys-fs/aufs3/aufs3-3_p20150622.ebuild
new file mode 100644
index 000000000000..a447062874a8
--- /dev/null
+++ b/sys-fs/aufs3/aufs3-3_p20150622.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=19
+# highest supported version
+KERN_MAX_VER=20
+# lowest supported version
+KERN_MIN_VER=14
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs4"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".21+
+ elif [[ "${KV_MINOR}" == "18" ]] && [[ "${KV_PATCH}" -ge "1" ]]; then
+ PATCH_BRANCH="${KV_MINOR}".1+
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs3"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ if kernel_is ge 3 11; then
+ epatch "${FILESDIR}"/pax-3.11.patch
+ else
+ epatch "${FILESDIR}"/pax-3.patch
+ fi
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs3/files/README.gentoo b/sys-fs/aufs3/files/README.gentoo
new file mode 100644
index 000000000000..64dfe94b4bda
--- /dev/null
+++ b/sys-fs/aufs3/files/README.gentoo
@@ -0,0 +1,20 @@
+There several other patches in aufs3. They are all
+optional. When you meet some problems, they will help you. You can find them
+in the documentation directory.
+
+ - aufs3-loopback.patch
+ Supports a nested loopback mount in a branch-fs. This patch is
+ unnecessary until aufs produces a message such like "you may want to try
+ another patch for loopback file".
+
+ - vfs-ino.patch
+ Modifies a system global kernel internal function get_next_ino() in
+ order to stop assigning 0 for an inode-number. Not directly related to
+ aufs, but recommended generally.
+
+ - tmpfs-idr.patch
+ Keeps the tmpfs inode number as the lowest value. Effective to reduce
+ the size of aufs XINO files for tmpfs branch. Also it prevents the
+ duplication of inode number, which is important for backup
+ tools, aubrsync or other utilities. When you find aufs XINO files for
+ tmpfs branch growing too much, try this patch.
diff --git a/sys-fs/aufs3/files/pax-3.11.patch b/sys-fs/aufs3/files/pax-3.11.patch
new file mode 100644
index 000000000000..cf216a5708ca
--- /dev/null
+++ b/sys-fs/aufs3/files/pax-3.11.patch
@@ -0,0 +1,89 @@
+--- a/fs/aufs/dynop.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/dynop.c 2012-10-09 15:41:58.562989820 -0400
+@@ -149,9 +149,11 @@
+ #define DySet(func, dst, src, h_op, h_sb) do { \
+ DyDbgInc(cnt); \
+ if (h_op->func) { \
+- if (src.func) \
+- dst.func = src.func; \
+- else \
++ if (src.func) { \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
++ } else \
+ AuDbg("%s %s\n", au_sbtype(h_sb), #func); \
+ } \
+ } while (0)
+@@ -159,7 +161,9 @@
+ #define DySetForce(func, dst, src) do { \
+ AuDebugOn(!src.func); \
+ DyDbgInc(cnt); \
+- dst.func = src.func; \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
+ } while (0)
+
+ #define DySetAop(func) \
+@@ -266,15 +270,17 @@
+ */
+ static void dy_adx(struct au_dyaop *dyaop, int do_dx)
+ {
++ pax_open_kernel();
+ if (!do_dx) {
+- dyaop->da_op.direct_IO = NULL;
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.direct_IO = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ } else {
+- dyaop->da_op.direct_IO = aufs_aop.direct_IO;
+- dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
++ *(void **)&dyaop->da_op.direct_IO = aufs_aop.direct_IO;
++ *(void **)&dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
+ if (!dyaop->da_get_xip_mem)
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ }
++ pax_close_kernel();
+ }
+
+ static struct au_dyaop *dy_aget(struct au_branch *br,
+--- a/fs/aufs/f_op_sp.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/f_op_sp.c 2012-10-09 15:41:58.562989820 -0400
+@@ -104,7 +104,7 @@
+ static int aufs_open_sp(struct inode *inode, struct file *file);
+ static struct au_sp_fop {
+ int done;
+- struct file_operations fop; /* not 'const' */
++ file_operations_no_const fop; /* not 'const' */
+ spinlock_t spin;
+ } au_sp_fop[AuSp_Last] = {
+ [AuSp_FIFO] = {
+@@ -157,8 +157,10 @@
+ h_file = au_hf_top(file);
+ spin_lock(&p->spin);
+ if (!p->done) {
+- p->fop = *h_file->f_op;
++ pax_open_kernel();
++ memcpy((void *)&p->fop, h_file->f_op, sizeof(p->fop));
+ p->fop.owner = THIS_MODULE;
++ pax_close_kernel();
+ if (p->fop.aio_read)
+ p->fop.aio_read = aufs_aio_read_sp;
+ if (p->fop.aio_write)
+--- a/fs/aufs/sysfs.c 2013-10-20 17:08:37.000000000 -0400
++++ b/fs/aufs/sysfs.c 2013-10-19 17:08:29.000000000 -0400
+@@ -233,8 +233,10 @@
+ for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) {
+ attr = &br_sysfs->attr;
+ sysfs_attr_init(attr);
+- attr->name = br_sysfs->name;
+- attr->mode = S_IRUGO;
++ pax_open_kernel();
++ *(void **)&attr->name = br_sysfs->name;
++ *(void **)&attr->mode = S_IRUGO;
++ pax_close_kernel();
+ br_sysfs++;
+ }
+ }
diff --git a/sys-fs/aufs3/files/pax-3.patch b/sys-fs/aufs3/files/pax-3.patch
new file mode 100644
index 000000000000..584fa6ace5b5
--- /dev/null
+++ b/sys-fs/aufs3/files/pax-3.patch
@@ -0,0 +1,90 @@
+--- a/fs/aufs/dynop.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/dynop.c 2012-10-09 15:41:58.562989820 -0400
+@@ -149,9 +149,11 @@
+ #define DySet(func, dst, src, h_op, h_sb) do { \
+ DyDbgInc(cnt); \
+ if (h_op->func) { \
+- if (src.func) \
+- dst.func = src.func; \
+- else \
++ if (src.func) { \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
++ } else \
+ AuDbg("%s %s\n", au_sbtype(h_sb), #func); \
+ } \
+ } while (0)
+@@ -159,7 +161,9 @@
+ #define DySetForce(func, dst, src) do { \
+ AuDebugOn(!src.func); \
+ DyDbgInc(cnt); \
+- dst.func = src.func; \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
+ } while (0)
+
+ #define DySetAop(func) \
+@@ -266,15 +270,17 @@
+ */
+ static void dy_adx(struct au_dyaop *dyaop, int do_dx)
+ {
++ pax_open_kernel();
+ if (!do_dx) {
+- dyaop->da_op.direct_IO = NULL;
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.direct_IO = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ } else {
+- dyaop->da_op.direct_IO = aufs_aop.direct_IO;
+- dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
++ *(void **)&dyaop->da_op.direct_IO = aufs_aop.direct_IO;
++ *(void **)&dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
+ if (!dyaop->da_get_xip_mem)
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ }
++ pax_close_kernel();
+ }
+
+ static struct au_dyaop *dy_aget(struct au_branch *br,
+--- a/fs/aufs/f_op_sp.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/f_op_sp.c 2012-10-09 15:41:58.562989820 -0400
+@@ -104,7 +104,7 @@
+ static int aufs_open_sp(struct inode *inode, struct file *file);
+ static struct au_sp_fop {
+ int done;
+- struct file_operations fop; /* not 'const' */
++ file_operations_no_const fop; /* not 'const' */
+ spinlock_t spin;
+ } au_sp_fop[AuSp_Last] = {
+ [AuSp_FIFO] = {
+@@ -157,8 +157,10 @@
+ h_file = au_hf_top(file);
+ spin_lock(&p->spin);
+ if (!p->done) {
+- p->fop = *h_file->f_op;
++ pax_open_kernel();
++ memcpy((void *)&p->fop, h_file->f_op, sizeof(p->fop));
+ p->fop.owner = THIS_MODULE;
++ pax_close_kernel();
+ if (p->fop.aio_read)
+ p->fop.aio_read = aufs_aio_read_sp;
+ if (p->fop.aio_write)
+diff -Naur linux-3.8.3-pentoo/fs/aufs/sysfs.c linux-3.8.3-pentoo-aufsfix/fs/aufs/sysfs.c
+--- linux-3.8.3-pentoo/fs/aufs/sysfs.c 2013-04-29 00:07:50.478827567 -0400
++++ linux-3.8.3-pentoo-aufsfix/fs/aufs/sysfs.c 2013-04-28 23:46:23.724793109 -0400
+@@ -208,8 +208,10 @@
+ struct attribute *attr = &br->br_attr;
+
+ sysfs_attr_init(attr);
+- attr->name = br->br_name;
+- attr->mode = S_IRUGO;
++ pax_open_kernel();
++ *(void **)&attr->name = br->br_name;
++ *(void **)&attr->mode = S_IRUGO;
++ pax_close_kernel();
+ }
+
+ void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex)
diff --git a/sys-fs/aufs3/metadata.xml b/sys-fs/aufs3/metadata.xml
new file mode 100644
index 000000000000..078f0414d465
--- /dev/null
+++ b/sys-fs/aufs3/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable additional debugging support</flag>
+ <flag name="hfs">Enable hfs support</flag>
+ <flag name="fuse">Enable fuse support</flag>
+ <flag name="inotify">Enable inotify support</flag>
+ <flag name="kernel-patch">Patch the current kernel for aufs3 support</flag>
+ <flag name="nfs">Enable support for nfs export</flag>
+ <flag name="pax_kernel">Apply patch needed for pax enabled kernels</flag>
+ <flag name="ramfs">Enable initramfs/rootfs support</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-fs/aufs4/Manifest b/sys-fs/aufs4/Manifest
new file mode 100644
index 000000000000..b8cb5aa210d3
--- /dev/null
+++ b/sys-fs/aufs4/Manifest
@@ -0,0 +1,8 @@
+DIST aufs4-standalone-0_pre20150420.tar.xz 424400 SHA256 7d96ee8bb16a4b72d60bfbab2955f5e68aec5a01d61a0a4870bb90f69099ad0f SHA512 71e460c582591861a1042fe628b186f081581f61fef61ccdc1ddb98ae7ee289ae58922c9df1549109f4351c8de3858fb3b2eb040f7e1da488f05f5b954468311 WHIRLPOOL f6b324404a62b465cd8a2d677000c4b4c7f951fa502f7ed6e5634d4a39dc90bb87e245a7f7036379a02d8e7f8a9fc64801c33e86ceb747b63912b8509d68a925
+DIST aufs4-standalone-0_pre20150504.tar.xz 466636 SHA256 b14bba141ead117ff9193a8a896a2bcefc418e11e642eb8547d4785833d70261 SHA512 c1299eb6ca179e60e60be2f7792001e2277f9507fd416994abd41c43e066be46ea508eaface45740153e4c34ccfcdcb3aa6a6118c840786fb1abf5aa56d6cc63 WHIRLPOOL 37bf469947c8ef5e0724e37fa40ec9535ff4065f81e64d45d924c16bb1d059d526ae853d0a73cd67de2aeacd3c41444a3a51545e9a12d08c0b8b27b526fa4dff
+DIST aufs4-standalone-0_pre20150511.tar.xz 501548 SHA256 a26e5e684c1878d0bd8e18c512979a6d0cccd9b1c8219746fe3d93ab1448f1be SHA512 da123ea8da38c840de76201284bf6846d794421e38e6193206ac753380eab3ecea33724c23c7b25d62f933c0c3d1e67082d17c1e702eefdb24c722808b88a69d WHIRLPOOL c7d2c81119933a55f0aa357fbc840f4a60597144386150c45260f2c7b99a0722d362595558df4b0db146c0fe65fb6886b002186e15a5e8cea00b3a04075a5500
+DIST aufs4-standalone-0_pre20150518.tar.xz 515624 SHA256 e2c2aeb02dce4f2b15da8459e92e90896c0fc795d6df829e2cab4eb2a82174a1 SHA512 4188d4d7928e1ee8ce88a7a079ee75c0ab9695c3e23db66952ff9d276ad3cfa5dbed1585dabe05856c5f3417d436fa3a1f93645ee68ebaa65a21610de8e34aca WHIRLPOOL 013672a12293ffe9067013d0295f6d797fafafa9f1ca49eb37a831fb77addac52dee804b9c809eadf4d18205a81e419be0b0b273d875a0f04e657498ccf95af8
+DIST aufs4-standalone-0_pre20150525.tar.xz 523720 SHA256 39abd01774e92eb717af89c57797601073c9237554d7e29ec509c7f61629a1e5 SHA512 3856eb2ca8bef3f0f54a8ea87ddb97c367cb96b10efff68b6edda7be1ec95a87742e1328e3d15f2c7a578659c9017187263c4e5371b602448d7ab5defdce43c2 WHIRLPOOL b5a91d900910bab24ccd01cc7b9626fd23cc92fdaf054f669e0fe2cefb5784065703b422a69379eda85d36c63cb8e9dc3a8018cdd277a85bab6886e68c62d60a
+DIST aufs4-standalone-0_pre20150608.tar.xz 532144 SHA256 8aaa1f348de3b6cfa86f21539d0ec44e5d0d18c27f0645719e3140462522a4e7 SHA512 1abd663b5f7997b93a865bf478c2900a3f69aff1d25149be683f8fd0f7362eaeccb7cdd9ce91ff08d1c4f2660414e03b7c9170fb7818c0839176b94c720d2896 WHIRLPOOL 36fa2691e8f5f27be41463c67df10d0e467892151e50df6f8396293c2572ad3d9229f00302bc47d816b48a08bdb64c92926381ba9d00c150dfb9f445dba8aeeb
+DIST aufs4-standalone-0_pre20150622.tar.xz 543932 SHA256 28de7f6968c62a48b78f4b6c9234dd4b7b134632e1d4e7d50e87da9e05c06343 SHA512 82f130ed3b43e2bfe42079c96dca70e868d7ce1df5511f68e7b85d343105d452c334fe7a15c1cd4e01450ca39dd527123c060b98b396d13c4250541ec464c2fc WHIRLPOOL e46a01857f2cbd52e6a3717bc5d076197443146fa9eab3b542aeb2698da652a45e8d40e1f9f50d9d4c3fc34d9a6da225712ac32f27f15eded4e8e3f23e113de8
+DIST aufs4-standalone-0_pre20150629.tar.xz 547808 SHA256 7c1d9a815c73e8cb1c9f909eee8f6945486c8e8feeea9cae4b3865b6032f17e5 SHA512 b7c734fb83515790b58a81b904acb286ef52124e0799dad1c7900dc8af3e0dc6f2875ba86805f1f39b8d04ce6660bf0c0307e4bbc1b58f2ca6171ead5e668a94 WHIRLPOOL b39f2cdeffd20b636c4a3aa5ec8e87cd6b1c8bdfdab071d1cabf53e10629beebffc919abf5fc90915ec0c14f4b4c45a510bbd303765564348a0e2d1688ddf79b
diff --git a/sys-fs/aufs4/aufs4-0_pre20150420.ebuild b/sys-fs/aufs4/aufs4-0_pre20150420.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150420.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150504.ebuild b/sys-fs/aufs4/aufs4-0_pre20150504.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150504.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150511.ebuild b/sys-fs/aufs4/aufs4-0_pre20150511.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150511.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150518.ebuild b/sys-fs/aufs4/aufs4-0_pre20150518.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150518.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150525.ebuild b/sys-fs/aufs4/aufs4-0_pre20150525.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150525.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150608.ebuild b/sys-fs/aufs4/aufs4-0_pre20150608.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150608.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150622.ebuild b/sys-fs/aufs4/aufs4-0_pre20150622.ebuild
new file mode 100644
index 000000000000..3289f18bff81
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150622.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=0
+# highest supported version
+KERN_MAX_VER=1
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/aufs4-0_pre20150629.ebuild b/sys-fs/aufs4/aufs4-0_pre20150629.ebuild
new file mode 100644
index 000000000000..382aafeef0a1
--- /dev/null
+++ b/sys-fs/aufs4/aufs4-0_pre20150629.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
+
+AUFS_VERSION="${PV%%_p*}"
+# highest branch version
+PATCH_MAX_VER=1
+# highest supported version
+KERN_MAX_VER=2
+# lowest supported version
+KERN_MIN_VER=0
+
+DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
+HOMEPAGE="http://aufs.sourceforge.net/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
+
+DEPEND="
+ dev-util/patchutils
+ dev-vcs/git"
+RDEPEND="
+ sys-fs/aufs-util
+ !sys-fs/aufs
+ !sys-fs/aufs2
+ !sys-fs/aufs3"
+
+S="${WORKDIR}"/${PN}-standalone
+
+MODULE_NAMES="aufs(misc:${S})"
+
+pkg_setup() {
+ CONFIG_CHECK+=" !AUFS_FS"
+ use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
+ use nfs && CONFIG_CHECK+=" EXPORTFS"
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
+ use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
+
+ # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
+ [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
+
+ get_version
+ kernel_is lt 4 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
+ kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
+
+ linux-mod_pkg_setup
+
+ if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
+ PATCH_BRANCH="x-rcN"
+ else
+ PATCH_BRANCH="${KV_MINOR}"
+ fi
+
+ case ${KV_EXTRA} in
+ "")
+ elog "It seems you are using vanilla-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources with USE=vanilla"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ "-gentoo")
+ elog "It seems you are using gentoo-sources with aufs4"
+ elog "Please use sys-kernel/aufs-sources"
+ elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
+ ;;
+ esac
+
+ pushd "${T}" &> /dev/null
+ unpack ${A}
+ cd ${PN}-standalone || die
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+ einfo "Using ${module_branch} as patch source"
+ git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
+ combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
+ combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
+ if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
+ if use kernel-patch; then
+ cd ${KV_DIR}
+ ewarn "Patching your kernel..."
+ patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
+ epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+ ewarn "You need to compile your kernel with the applied patch"
+ ewarn "to be able to load and use the aufs kernel module"
+ else
+ eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
+ eerror "Either enable the kernel-patch useflag to do it with this ebuild"
+ eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
+ die "missing kernel patch, please apply it first"
+ fi
+ fi
+ popd &> /dev/null
+ export PKG_SETUP_HAS_BEEN_RAN=1
+}
+
+set_config() {
+ for option in $*; do
+ grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
+ sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
+ done
+}
+
+src_prepare() {
+ local module_branch=origin/${PN}.${PATCH_BRANCH}
+
+ einfo "Using for module creation branch ${module_branch}"
+ git checkout -q -b local-gentoo ${module_branch} || die
+
+ # All config options to off
+ sed "s:= y:=:g" -i config.mk || die
+
+ set_config RDU BRANCH_MAX_127 SBILIST
+
+ use debug && set_config DEBUG
+ use fuse && set_config BR_FUSE POLL
+ use hfs && set_config BR_HFSPLUS
+ use inotify && set_config HNOTIFY HFSNOTIFY
+ use nfs && set_config EXPORT
+ use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
+ use ramfs && set_config BR_RAMFS
+
+ if use pax_kernel; then
+ epatch "${FILESDIR}"/pax-4.patch
+ fi
+
+ sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
+}
+
+src_compile() {
+ local ARCH=x86
+
+ emake \
+ CC=$(tc-getCC) \
+ LD=$(tc-getLD) \
+ LDFLAGS="$(raw-ldflags)" \
+ ARCH=$(tc-arch-kernel) \
+ CONFIG_AUFS_FS=m \
+ KDIR="${KV_OUT_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ insinto /usr/share/doc/${PF}
+
+ use doc && doins -r Documentation
+
+ use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
+
+ dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_pkg_postinst
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/aufs4/files/README.gentoo b/sys-fs/aufs4/files/README.gentoo
new file mode 100644
index 000000000000..64dfe94b4bda
--- /dev/null
+++ b/sys-fs/aufs4/files/README.gentoo
@@ -0,0 +1,20 @@
+There several other patches in aufs3. They are all
+optional. When you meet some problems, they will help you. You can find them
+in the documentation directory.
+
+ - aufs3-loopback.patch
+ Supports a nested loopback mount in a branch-fs. This patch is
+ unnecessary until aufs produces a message such like "you may want to try
+ another patch for loopback file".
+
+ - vfs-ino.patch
+ Modifies a system global kernel internal function get_next_ino() in
+ order to stop assigning 0 for an inode-number. Not directly related to
+ aufs, but recommended generally.
+
+ - tmpfs-idr.patch
+ Keeps the tmpfs inode number as the lowest value. Effective to reduce
+ the size of aufs XINO files for tmpfs branch. Also it prevents the
+ duplication of inode number, which is important for backup
+ tools, aubrsync or other utilities. When you find aufs XINO files for
+ tmpfs branch growing too much, try this patch.
diff --git a/sys-fs/aufs4/files/pax-4.patch b/sys-fs/aufs4/files/pax-4.patch
new file mode 100644
index 000000000000..cf216a5708ca
--- /dev/null
+++ b/sys-fs/aufs4/files/pax-4.patch
@@ -0,0 +1,89 @@
+--- a/fs/aufs/dynop.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/dynop.c 2012-10-09 15:41:58.562989820 -0400
+@@ -149,9 +149,11 @@
+ #define DySet(func, dst, src, h_op, h_sb) do { \
+ DyDbgInc(cnt); \
+ if (h_op->func) { \
+- if (src.func) \
+- dst.func = src.func; \
+- else \
++ if (src.func) { \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
++ } else \
+ AuDbg("%s %s\n", au_sbtype(h_sb), #func); \
+ } \
+ } while (0)
+@@ -159,7 +161,9 @@
+ #define DySetForce(func, dst, src) do { \
+ AuDebugOn(!src.func); \
+ DyDbgInc(cnt); \
+- dst.func = src.func; \
++ pax_open_kernel(); \
++ *(void **)&dst.func = src.func; \
++ pax_close_kernel(); \
+ } while (0)
+
+ #define DySetAop(func) \
+@@ -266,15 +270,17 @@
+ */
+ static void dy_adx(struct au_dyaop *dyaop, int do_dx)
+ {
++ pax_open_kernel();
+ if (!do_dx) {
+- dyaop->da_op.direct_IO = NULL;
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.direct_IO = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ } else {
+- dyaop->da_op.direct_IO = aufs_aop.direct_IO;
+- dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
++ *(void **)&dyaop->da_op.direct_IO = aufs_aop.direct_IO;
++ *(void **)&dyaop->da_op.get_xip_mem = aufs_aop.get_xip_mem;
+ if (!dyaop->da_get_xip_mem)
+- dyaop->da_op.get_xip_mem = NULL;
++ *(void **)&dyaop->da_op.get_xip_mem = NULL;
+ }
++ pax_close_kernel();
+ }
+
+ static struct au_dyaop *dy_aget(struct au_branch *br,
+--- a/fs/aufs/f_op_sp.c 2012-10-09 15:41:32.652989534 -0400
++++ b/fs/aufs/f_op_sp.c 2012-10-09 15:41:58.562989820 -0400
+@@ -104,7 +104,7 @@
+ static int aufs_open_sp(struct inode *inode, struct file *file);
+ static struct au_sp_fop {
+ int done;
+- struct file_operations fop; /* not 'const' */
++ file_operations_no_const fop; /* not 'const' */
+ spinlock_t spin;
+ } au_sp_fop[AuSp_Last] = {
+ [AuSp_FIFO] = {
+@@ -157,8 +157,10 @@
+ h_file = au_hf_top(file);
+ spin_lock(&p->spin);
+ if (!p->done) {
+- p->fop = *h_file->f_op;
++ pax_open_kernel();
++ memcpy((void *)&p->fop, h_file->f_op, sizeof(p->fop));
+ p->fop.owner = THIS_MODULE;
++ pax_close_kernel();
+ if (p->fop.aio_read)
+ p->fop.aio_read = aufs_aio_read_sp;
+ if (p->fop.aio_write)
+--- a/fs/aufs/sysfs.c 2013-10-20 17:08:37.000000000 -0400
++++ b/fs/aufs/sysfs.c 2013-10-19 17:08:29.000000000 -0400
+@@ -233,8 +233,10 @@
+ for (i = 0; i < ARRAY_SIZE(br->br_sysfs); i++) {
+ attr = &br_sysfs->attr;
+ sysfs_attr_init(attr);
+- attr->name = br_sysfs->name;
+- attr->mode = S_IRUGO;
++ pax_open_kernel();
++ *(void **)&attr->name = br_sysfs->name;
++ *(void **)&attr->mode = S_IRUGO;
++ pax_close_kernel();
+ br_sysfs++;
+ }
+ }
diff --git a/sys-fs/aufs4/metadata.xml b/sys-fs/aufs4/metadata.xml
new file mode 100644
index 000000000000..078f0414d465
--- /dev/null
+++ b/sys-fs/aufs4/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable additional debugging support</flag>
+ <flag name="hfs">Enable hfs support</flag>
+ <flag name="fuse">Enable fuse support</flag>
+ <flag name="inotify">Enable inotify support</flag>
+ <flag name="kernel-patch">Patch the current kernel for aufs3 support</flag>
+ <flag name="nfs">Enable support for nfs export</flag>
+ <flag name="pax_kernel">Apply patch needed for pax enabled kernels</flag>
+ <flag name="ramfs">Enable initramfs/rootfs support</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-fs/autorun/Manifest b/sys-fs/autorun/Manifest
new file mode 100644
index 000000000000..51fcf7d67bfd
--- /dev/null
+++ b/sys-fs/autorun/Manifest
@@ -0,0 +1 @@
+DIST autorun-3.17.tar.gz 481168 SHA256 5f1bc8c9a5ba9796f6803bd8dc7a43a2f95aa8f351b7aa63e56a198717852e91
diff --git a/sys-fs/autorun/autorun-3.17.ebuild b/sys-fs/autorun/autorun-3.17.ebuild
new file mode 100644
index 000000000000..cfb4d30b9fbc
--- /dev/null
+++ b/sys-fs/autorun/autorun-3.17.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="auto cdrom mounter for the lazy user"
+HOMEPAGE="http://autorun.sourceforge.net/"
+SRC_URI="mirror://sourceforge/autorun/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="sys-devel/gettext
+ dev-util/intltool
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.1.2"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-headers.patch
+}
+
+src_configure() {
+ export KDEDIR=/usr
+ econf \
+ --disable-dependency-tracking
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS README
+}
diff --git a/sys-fs/autorun/files/autorun-3.17-headers.patch b/sys-fs/autorun/files/autorun-3.17-headers.patch
new file mode 100644
index 000000000000..642f1596b704
--- /dev/null
+++ b/sys-fs/autorun/files/autorun-3.17-headers.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/251684
+
+--- autorun.cc
++++ autorun.cc
+@@ -90,6 +90,8 @@ char *strchr (), *strrchr ();
+
+ #include <errno.h>
+
++#include <stdlib.h>
++
+ #ifndef MNTTYPE_ISO9660
+ #define MNTTYPE_ISO9660 "iso9660"
+ #endif
diff --git a/sys-fs/autorun/metadata.xml b/sys-fs/autorun/metadata.xml
new file mode 100644
index 000000000000..d9b34f010cd8
--- /dev/null
+++ b/sys-fs/autorun/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">autorun</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/avfs/Manifest b/sys-fs/avfs/Manifest
new file mode 100644
index 000000000000..75e2318f0bf5
--- /dev/null
+++ b/sys-fs/avfs/Manifest
@@ -0,0 +1,3 @@
+DIST avfs-1.0.1.tar.bz2 678562 SHA256 6c6558c35864660e6d26e67f42caeb2bc8f9ef2ad0c502fd659fb7d94724aaf1 SHA512 3eefb07ed303343c4e5ec873fb519f171e8b19f00efda5e78f4af573fccabbefa59f77a677a34a569343db743bb41368beaf6e399d69f228ad0a77878e41adf0 WHIRLPOOL 68153492899a67b36bb8f982bb319469ee8cdf64e8c1ae642fd2f746736bc5ee93c22b0fa005ffc42d5bed543332875b5d6ed096bfd0a8bf2c2da3cc47cfacbf
+DIST avfs-1.0.2.tar.bz2 723051 SHA256 52693953e8290281d441a898040c5ac2989f11bc1fcb83ca5063c37a125a1c9a SHA512 a248c025388d169e2c6a57f04487c0aefb2c574647aade49c3a27d62621c0ead25b321b87518cdd718cb238387a766ec9e7fef434f30dcc4dd2bf9fbcc3de020 WHIRLPOOL 71f3949f39b130522d98fdf6ae431c8d410fc83d4e91028223c6bf0a247373ac129257c1b85efacbe430320d6e870b373a3e65cbfad31eb123f691f02da5c26d
+DIST avfs-1.0.3.tar.bz2 722861 SHA256 c6dee77b2b71567528f897727e51695587189765fc35f694e4734db0a7d4fec8 SHA512 b20a8bcba0d1d0181a14d5f1204f0532817037e3b5d32931f00f988793cb6cdabec82298686d82aa34885209d22841754e990c9c35b6384e0b441f99fd3d1efd WHIRLPOOL 406b708b5b9516ec97e024f518eb7370031edf8410d8637763bacd05f6d15ceb06217c43a8f28381c0d2f9fbfcd991a27b57cb45521ed71696e70e41352b7de2
diff --git a/sys-fs/avfs/avfs-1.0.1.ebuild b/sys-fs/avfs/avfs-1.0.1.ebuild
new file mode 100644
index 000000000000..5de47122fb6f
--- /dev/null
+++ b/sys-fs/avfs/avfs-1.0.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="AVFS is a virtual filesystem that allows browsing of compressed files"
+HOMEPAGE="http://sourceforge.net/projects/avf"
+SRC_URI="mirror://sourceforge/avf/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~hppa ppc ppc64 x86"
+IUSE="static-libs +lzma"
+
+RDEPEND=">=sys-fs/fuse-2.4
+ sys-libs/zlib
+ app-arch/bzip2
+ lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ econf \
+ --enable-fuse \
+ --enable-library \
+ --enable-shared \
+ --with-system-zlib \
+ --with-system-bzlib \
+ $(use_enable static-libs static) \
+ $(use_with lzma xz)
+}
+
+src_install() {
+ default
+
+ # remove cruft
+ rm "${D}"/usr/bin/{davpass,ftppass} || die
+
+ # install docs
+ dodoc doc/{api-overview,background,FORMAT,INSTALL.*,README.avfs-fuse}
+ dosym /usr/lib/avfs/extfs/README /usr/share/doc/${PF}/README.extfs
+
+ docinto scripts
+ dodoc scripts/{avfscoda*,*pass}
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ einfo "This version of AVFS includes FUSE support. It is user-based."
+ einfo "To execute:"
+ einfo "1) as user, mkdir ~/.avfs"
+ einfo "2) make sure fuse is either compiled into the kernel OR"
+ einfo " modprobe fuse or add to startup."
+ einfo "3) run mountavfs"
+ einfo "To unload daemon, type umountavfs"
+ einfo
+ einfo "READ the documentation! Enjoy :)"
+}
diff --git a/sys-fs/avfs/avfs-1.0.2.ebuild b/sys-fs/avfs/avfs-1.0.2.ebuild
new file mode 100644
index 000000000000..5af46d3c0a42
--- /dev/null
+++ b/sys-fs/avfs/avfs-1.0.2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="AVFS is a virtual filesystem that allows browsing of compressed files"
+HOMEPAGE="http://sourceforge.net/projects/avf"
+SRC_URI="mirror://sourceforge/avf/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE="static-libs +lzma"
+
+RDEPEND=">=sys-fs/fuse-2.4
+ sys-libs/zlib
+ app-arch/bzip2
+ lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ econf \
+ --enable-fuse \
+ --enable-library \
+ --enable-shared \
+ --with-system-zlib \
+ --with-system-bzlib \
+ $(use_enable static-libs static) \
+ $(use_with lzma xz)
+}
+
+src_install() {
+ default
+
+ # remove cruft
+ rm "${D}"/usr/bin/{davpass,ftppass} || die
+
+ # install docs
+ dodoc doc/{api-overview,background,FORMAT,INSTALL.*,README.avfs-fuse}
+ dosym /usr/lib/avfs/extfs/README /usr/share/doc/${PF}/README.extfs
+
+ docinto scripts
+ dodoc scripts/{avfscoda*,*pass}
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ einfo "This version of AVFS includes FUSE support. It is user-based."
+ einfo "To execute:"
+ einfo "1) as user, mkdir ~/.avfs"
+ einfo "2) make sure fuse is either compiled into the kernel OR"
+ einfo " modprobe fuse or add to startup."
+ einfo "3) run mountavfs"
+ einfo "To unload daemon, type umountavfs"
+ einfo
+ einfo "READ the documentation! Enjoy :)"
+}
diff --git a/sys-fs/avfs/avfs-1.0.3.ebuild b/sys-fs/avfs/avfs-1.0.3.ebuild
new file mode 100644
index 000000000000..da4c5c82e47a
--- /dev/null
+++ b/sys-fs/avfs/avfs-1.0.3.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="AVFS is a virtual filesystem that allows browsing of compressed files"
+HOMEPAGE="http://sourceforge.net/projects/avf"
+SRC_URI="mirror://sourceforge/avf/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE="static-libs +lzma"
+
+RDEPEND=">=sys-fs/fuse-2.4
+ sys-libs/zlib
+ app-arch/bzip2
+ lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ econf \
+ --enable-fuse \
+ --enable-library \
+ --enable-shared \
+ --with-system-zlib \
+ --with-system-bzlib \
+ $(use_enable static-libs static) \
+ $(use_with lzma xz)
+}
+
+src_install() {
+ default
+
+ # remove cruft
+ rm "${D}"/usr/bin/{davpass,ftppass} || die
+
+ # install docs
+ dodoc doc/{api-overview,background,FORMAT,INSTALL.*,README.avfs-fuse}
+ dosym /usr/lib/avfs/extfs/README /usr/share/doc/${PF}/README.extfs
+
+ docinto scripts
+ dodoc scripts/{avfscoda*,*pass}
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ einfo "This version of AVFS includes FUSE support. It is user-based."
+ einfo "To execute:"
+ einfo "1) as user, mkdir ~/.avfs"
+ einfo "2) make sure fuse is either compiled into the kernel OR"
+ einfo " modprobe fuse or add to startup."
+ einfo "3) run mountavfs"
+ einfo "To unload daemon, type umountavfs"
+ einfo
+ einfo "READ the documentation! Enjoy :)"
+}
diff --git a/sys-fs/avfs/metadata.xml b/sys-fs/avfs/metadata.xml
new file mode 100644
index 000000000000..26d3015a0b2e
--- /dev/null
+++ b/sys-fs/avfs/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>pete4abw@comcast.net</email>
+ <name>Peter Hyman</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">avf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/bashmount/Manifest b/sys-fs/bashmount/Manifest
new file mode 100644
index 000000000000..9d8539f1046c
--- /dev/null
+++ b/sys-fs/bashmount/Manifest
@@ -0,0 +1 @@
+DIST bashmount-3.2.0.tar.gz 18152 SHA256 814ee05cd433cff369da46c199803f5e7990395f0d99480ac6294e07ac2c6850 SHA512 9fd287f67ecb61c9b72d1fc6a5b85b39d48671299585ad456ff3e14cf2304ad540de1462bbf3eafd333ac038cf8a7f2286f5077b896ea88dff570306f7c7d642 WHIRLPOOL d8e5c986156cf2ebdc5a70048d1aa467065412e866879d66fc0adbce10b5580b040bb28dde11f4fe5dc1bc469c8e4b797828df80d40fdc54dddc0294744bfe3b
diff --git a/sys-fs/bashmount/bashmount-3.2.0.ebuild b/sys-fs/bashmount/bashmount-3.2.0.ebuild
new file mode 100644
index 000000000000..3e47fb505f7d
--- /dev/null
+++ b/sys-fs/bashmount/bashmount-3.2.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A bash script that uses udisks to handle removable devices without dependencies on any GUI"
+HOMEPAGE="http://sourceforge.net/projects/bashmount/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+# sys-apps/util-linux -> lsblk
+RDEPEND="app-shells/bash
+ sys-apps/dbus
+ sys-apps/util-linux
+ sys-fs/udisks:2
+ virtual/eject"
+DEPEND=""
+
+src_install() {
+ dobin ${PN}
+ insinto /etc
+ doins ${PN}.conf
+ doman ${PN}.1
+ dodoc NEWS
+}
diff --git a/sys-fs/bashmount/metadata.xml b/sys-fs/bashmount/metadata.xml
new file mode 100644
index 000000000000..2e162edbf6a1
--- /dev/null
+++ b/sys-fs/bashmount/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">bashmount</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/bcache-tools/Manifest b/sys-fs/bcache-tools/Manifest
new file mode 100644
index 000000000000..216ceb486d1d
--- /dev/null
+++ b/sys-fs/bcache-tools/Manifest
@@ -0,0 +1,3 @@
+DIST bcache-tools-0_pre20130627.tar.xz 17812 SHA256 aca02134fa3e18b27020e6500a21ff017fecadd3d64acbadc419efccc4abeacc SHA512 b3167ba61560f17ff5d1ac9e8514c9b7b5f02cc97500a5d68885bb4a04f92c50621095c922fdca1f6ff4d79955b3cd77dc42c5cda08525ad32468f8e80a5d85b WHIRLPOOL f9d335555419def9d9d8995a8b1ea7f3df78a23a13a5c818bc4d8d2cecbdd22a7f220e49c72446ea2ffa0eb3d49518dab9b2ff4ab0083df9b3d02537795c9c8d
+DIST bcache-tools-1.0.4.tgz 21683 SHA256 102ffc3a8389180f4b491188c3520f8a4b1a84e5a7ca26d2bd6de1821f4d913d SHA512 d3f325519c67ee43c2f4c690fe666dbba97c9ba06ee091f15ad082fb193895aac322b82843447205ae0eb909a520d93e0ce2dd6207707021e087dedf16d7b273 WHIRLPOOL 2c46e01dee2d8d431d83c6d6797a3fca392970819a795124d452366c12e665fe8e7467375fc537af9ac6b06c8dc650d1009e15d64d109c28d7d27e1c7061c8a1
+DIST bcache-tools-1.0.5.tgz 21934 SHA256 1449294ef545b3dc6f715f7b063bc2c8656984ad73bcd81a0dc048cbba416ea9 SHA512 aaf27e4cc3037d482cb14c8bb083c1ce5cda5641a19cec67ca1ad22cde71ce035e49701145c6d920b4d62058897c4b7d29d341b3b8bd436c9c51e2f8bdb5c568 WHIRLPOOL 7c2dd6919ba7cc7eebab0c90b517cd73ab4b7e02aedf4c998d95681e3feeedf5368fa5edf58a6a3e079fd7ad3ae5040fe6f02c743132f054c7f56fbad9c44f4b
diff --git a/sys-fs/bcache-tools/bcache-tools-0_pre20130627-r1.ebuild b/sys-fs/bcache-tools/bcache-tools-0_pre20130627-r1.ebuild
new file mode 100644
index 000000000000..4d0ddb2ca143
--- /dev/null
+++ b/sys-fs/bcache-tools/bcache-tools-0_pre20130627-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs udev
+
+DESCRIPTION="Tools for bcachefs"
+HOMEPAGE="http://bcache.evilpiepirate.org/"
+SRC_URI="http://dev.gentoo.org/~jlec/distfiles/${P}.tar.xz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+src_prepare() {
+ tc-export CC
+ sed \
+ -e '/^CFLAGS/d' \
+ -i Makefile || die
+}
+
+src_install() {
+ into /
+ dosbin make-bcache probe-bcache bcache-super-show
+ doman *.8
+
+ insinto /etc/initramfs-tools/hooks/bcache
+ doins initramfs/hook
+
+ udev_dorules 61-bcache.rules
+
+ exeinto $(get_udevdir)
+ doexe bcache-register
+
+ dodoc README
+}
+
+pkg_postinst() {
+ udev_reload
+}
diff --git a/sys-fs/bcache-tools/bcache-tools-1.0.4.ebuild b/sys-fs/bcache-tools/bcache-tools-1.0.4.ebuild
new file mode 100644
index 000000000000..8d4dd2b25e60
--- /dev/null
+++ b/sys-fs/bcache-tools/bcache-tools-1.0.4.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs udev
+
+DESCRIPTION="Tools for bcachefs"
+HOMEPAGE="http://bcache.evilpiepirate.org/"
+SRC_URI="https://github.com/g2p/bcache-tools/archive/v1.0.4.tar.gz -> ${P}.tgz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=sys-apps/util-linux-2.24"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ tc-export CC
+ sed \
+ -e '/^CFLAGS/s:-O2::' \
+ -e '/^CFLAGS/s:-g::' \
+ -i Makefile || die
+}
+
+src_install() {
+ into /
+ dosbin make-bcache bcache-super-show
+
+ exeinto $(get_udevdir)
+ doexe bcache-register probe-bcache
+
+ udev_dorules 69-bcache.rules
+
+ insinto /etc/initramfs-tools/hooks/bcache
+ doins initramfs/hook
+
+ # that is what dracut does
+ insinto /usr/lib/dracut/modules.d/90bcache
+ doins dracut/module-setup.sh
+
+ doman *.8
+
+ dodoc README
+}
+
+pkg_postinst() {
+ udev_reload
+}
diff --git a/sys-fs/bcache-tools/bcache-tools-1.0.5.ebuild b/sys-fs/bcache-tools/bcache-tools-1.0.5.ebuild
new file mode 100644
index 000000000000..72946faeecfd
--- /dev/null
+++ b/sys-fs/bcache-tools/bcache-tools-1.0.5.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs udev
+
+DESCRIPTION="Tools for bcachefs"
+HOMEPAGE="http://bcache.evilpiepirate.org/"
+SRC_URI="https://github.com/g2p/bcache-tools/archive/v${PV}.tar.gz -> ${P}.tgz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=sys-apps/util-linux-2.24"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ tc-export CC
+ sed \
+ -e '/^CFLAGS/s:-O2::' \
+ -e '/^CFLAGS/s:-g::' \
+ -i Makefile || die
+}
+
+src_install() {
+ into /
+ dosbin make-bcache bcache-super-show
+
+ exeinto $(get_udevdir)
+ doexe bcache-register probe-bcache
+
+ udev_dorules 69-bcache.rules
+
+ insinto /etc/initramfs-tools/hooks/bcache
+ doins initramfs/hook
+
+ # that is what dracut does
+ insinto /usr/lib/dracut/modules.d/90bcache
+ doins dracut/module-setup.sh
+
+ doman *.8
+
+ dodoc README
+}
+
+pkg_postinst() {
+ udev_reload
+}
diff --git a/sys-fs/bcache-tools/bcache-tools-9999.ebuild b/sys-fs/bcache-tools/bcache-tools-9999.ebuild
new file mode 100644
index 000000000000..ba397f60af14
--- /dev/null
+++ b/sys-fs/bcache-tools/bcache-tools-9999.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+EGIT_NONSHALLOW=true
+
+inherit git-r3 toolchain-funcs udev
+
+DESCRIPTION="Tools for bcachefs"
+HOMEPAGE="http://bcache.evilpiepirate.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://github.com/g2p/bcache-tools.git"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND=">=sys-apps/util-linux-2.24"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ tc-export CC
+ sed \
+ -e '/^CFLAGS/s:-O2::' \
+ -e '/^CFLAGS/s:-g::' \
+ -i Makefile || die
+}
+
+src_install() {
+ into /
+ dosbin make-bcache bcache-super-show
+
+ exeinto $(get_udevdir)
+ doexe bcache-register probe-bcache
+
+ udev_dorules 69-bcache.rules
+
+ insinto /etc/initramfs-tools/hooks/bcache
+ doins initramfs/hook
+
+ insinto /etc/initcpio/install/bcache
+ doins initcpio/install
+
+ # that is what dracut does
+ insinto /usr/lib/dracut/modules.d/90bcache
+ doins dracut/module-setup.sh
+
+ doman *.8
+
+ dodoc README
+}
+
+pkg_postinst() {
+ udev_reload
+}
diff --git a/sys-fs/bcache-tools/metadata.xml b/sys-fs/bcache-tools/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sys-fs/bcache-tools/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/bedup/Manifest b/sys-fs/bedup/Manifest
new file mode 100644
index 000000000000..039529ae1354
--- /dev/null
+++ b/sys-fs/bedup/Manifest
@@ -0,0 +1 @@
+DIST bedup-0.9.0_p20140413.tar.gz 48620 SHA256 f9c380074e3f13e42447c04a0fd5c1abca444487cf6ccb6400f09dcca14f90a6 SHA512 9a730dff2b2af239a6386d860881989de50f7a4fb6ae5b402c6dfe828308bbf4ccc2b6f616fdfc2b445fe23fbfcc302163b320813b50fa27940e578b5145345c WHIRLPOOL af4827f4514acc8380f312a72bb3208614f1f529e7373bca3bb610315e0474c9d7c7cbda1338d7019316e708f17ba73e71539092065041df588fd449f7639b54
diff --git a/sys-fs/bedup/bedup-0.9.0_p20140413-r1.ebuild b/sys-fs/bedup/bedup-0.9.0_p20140413-r1.ebuild
new file mode 100644
index 000000000000..8b6e089a104f
--- /dev/null
+++ b/sys-fs/bedup/bedup-0.9.0_p20140413-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit distutils-r1 vcs-snapshot
+
+DESCRIPTION="Btrfs file de-duplication tool"
+HOMEPAGE="https://github.com/g2p/bedup"
+SRC_URI="https://github.com/g2p/${PN}/archive/5189e166145b8954ac41883f81ef3c3b50dc96ab.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# we need btrfs-progs with includes installed.
+DEPEND=">=dev-python/cffi-0.5:=[${PYTHON_USEDEP}]
+ >=sys-fs/btrfs-progs-0.20_rc1_p358"
+RDEPEND="${DEPEND}
+ <dev-python/alembic-0.7[${PYTHON_USEDEP}]
+ dev-python/contextlib2[${PYTHON_USEDEP}]
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ >=dev-python/sqlalchemy-0.8.2[sqlite,${PYTHON_USEDEP}]"
diff --git a/sys-fs/bedup/bedup-9999.ebuild b/sys-fs/bedup/bedup-9999.ebuild
new file mode 100644
index 000000000000..9f4323451a29
--- /dev/null
+++ b/sys-fs/bedup/bedup-9999.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+#if LIVE
+EGIT_REPO_URI="git://github.com/g2p/bedup.git
+ https://github.com/g2p/bedup.git"
+inherit git-r3
+#endif
+
+inherit distutils-r1
+
+DESCRIPTION="Btrfs file de-duplication tool"
+HOMEPAGE="https://github.com/g2p/bedup"
+SRC_URI="https://github.com/g2p/${PN}/archive/v${PV}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+# we need btrfs-progs with includes installed.
+DEPEND=">=dev-python/cffi-0.5:=[${PYTHON_USEDEP}]
+ >=sys-fs/btrfs-progs-0.20_rc1_p358"
+RDEPEND="${DEPEND}
+ <dev-python/alembic-0.7[${PYTHON_USEDEP}]
+ dev-python/contextlib2[${PYTHON_USEDEP}]
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ >=dev-python/sqlalchemy-0.8.2[sqlite,${PYTHON_USEDEP}]"
+
+#if LIVE
+SRC_URI=
+KEYWORDS=
+#endif
diff --git a/sys-fs/bedup/metadata.xml b/sys-fs/bedup/metadata.xml
new file mode 100644
index 000000000000..4882123dbb58
--- /dev/null
+++ b/sys-fs/bedup/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">g2p/bedup</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/bindfs/Manifest b/sys-fs/bindfs/Manifest
new file mode 100644
index 000000000000..c67a6e08967c
--- /dev/null
+++ b/sys-fs/bindfs/Manifest
@@ -0,0 +1,4 @@
+DIST bindfs-1.12.2.tar.gz 349691 SHA256 e0e540ce8adfbb2955e7ac2f86589f913443a8c5425a729acf2a5b7563c39312 SHA512 3cbf0a0b5bd40cc96834cf0df53725ce4e832d2b7a318f149ff6e875726b849bb14cc7730910b4b8a2ac5c9501da64b04cb7bf7b15df87de7dfd08a3f232ec5c WHIRLPOOL 0c81d2ee15ca211bd9b336de257572c4444bfc70649a9dc17f7822c4f2ab282e3434cac66c8469db89ca8f93488fb5ed518dd82d844271cbaec649e98811df42
+DIST bindfs-1.12.3.tar.gz 345458 SHA256 ad3ee6aa6e609f8e0d37dbfaafbd6bdd015b0b2367efd2ecb550e70167d27e0d SHA512 47f4fac85023dc140bca7a39f70637076752a0bd4a0a895caa02c25122d0bd80cbbc366f15e77f2b57dfc465181b5e597e116b83fff3864b8b9b58db95e913ed WHIRLPOOL 8fdad5209f655f9fb684cfa857ca1c0bd7fb49aebad68a7432450821c5e7fb9d1a9d7a5300191f15922b1402a155bf00472d91ee882cec6d35f3d7b42c97bc5c
+DIST bindfs-1.12.5.tar.gz 346292 SHA256 a93b4e306cff3675e760ecd0ec7c4e125b67688aa850ad8a3506b5b73c9ed9dc SHA512 20ccf057cd8ffdefd811c28a6645130a9ccd68b5c4c782fb83d973456b9d60966008bff49b2b644eba948e0625d9af9897a6fb3601b51c9eb5768cf6694065f5 WHIRLPOOL fe237649c715a3588d6095bafb7c3290cd5cfe6c87095ba1e68bee21895a326f89881465d2199572f87f08a61931907fba066804174312099da433b83daf2936
+DIST bindfs-1.12.6.tar.gz 351981 SHA256 a954f8fe4d6193a1ab5db423c10fb33dd0da23eabce41e4379ecee4c6cb02069 SHA512 14fd335a082bc577bb67360a892953d6d059b97b24e6fa74ddc1457ed78f3a546799f3cdea48a37da89dfc06be2ee1f5abafc203f6843269f28a79c7d18093b0 WHIRLPOOL 19582aac090d7b1498f36b305ade6a1433c4156ae9562c197726805030263a5a3b8ab94eb203183e016e61ff75c8d5b492c4356095f624c86ca86eefa137ef3b
diff --git a/sys-fs/bindfs/bindfs-1.12.2.ebuild b/sys-fs/bindfs/bindfs-1.12.2.ebuild
new file mode 100644
index 000000000000..8fcb4dc378ba
--- /dev/null
+++ b/sys-fs/bindfs/bindfs-1.12.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools
+
+DESCRIPTION="FUSE filesystem for mounting a directory to another location and altering permissions"
+HOMEPAGE="http://bindfs.org/"
+SRC_URI="http://bindfs.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.10.7-cflags.patch
+ epatch "${FILESDIR}"/${PN}-1.12.2-ac-config-headers.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable debug)
+}
diff --git a/sys-fs/bindfs/bindfs-1.12.3.ebuild b/sys-fs/bindfs/bindfs-1.12.3.ebuild
new file mode 100644
index 000000000000..838dc45d68d6
--- /dev/null
+++ b/sys-fs/bindfs/bindfs-1.12.3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools
+
+DESCRIPTION="FUSE filesystem for mounting a directory to another location and altering permissions"
+HOMEPAGE="http://bindfs.org/"
+SRC_URI="http://bindfs.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND=">=sys-fs/fuse-2.6"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.10.7-cflags.patch
+ epatch "${FILESDIR}"/${PN}-1.12.2-ac-config-headers.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable debug)
+}
diff --git a/sys-fs/bindfs/bindfs-1.12.5.ebuild b/sys-fs/bindfs/bindfs-1.12.5.ebuild
new file mode 100644
index 000000000000..4e326142a33f
--- /dev/null
+++ b/sys-fs/bindfs/bindfs-1.12.5.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools
+
+DESCRIPTION="FUSE filesystem for mounting a directory to another location and altering permissions"
+HOMEPAGE="http://bindfs.org/"
+SRC_URI="http://bindfs.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND=">=sys-fs/fuse-2.6"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.10.7-cflags.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable debug)
+}
diff --git a/sys-fs/bindfs/bindfs-1.12.6.ebuild b/sys-fs/bindfs/bindfs-1.12.6.ebuild
new file mode 100644
index 000000000000..4e326142a33f
--- /dev/null
+++ b/sys-fs/bindfs/bindfs-1.12.6.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools
+
+DESCRIPTION="FUSE filesystem for mounting a directory to another location and altering permissions"
+HOMEPAGE="http://bindfs.org/"
+SRC_URI="http://bindfs.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND=">=sys-fs/fuse-2.6"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.10.7-cflags.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable debug)
+}
diff --git a/sys-fs/bindfs/files/bindfs-1.10.7-cflags.patch b/sys-fs/bindfs/files/bindfs-1.10.7-cflags.patch
new file mode 100644
index 000000000000..65d1933531c6
--- /dev/null
+++ b/sys-fs/bindfs/files/bindfs-1.10.7-cflags.patch
@@ -0,0 +1,16 @@
+--- bindfs-1.10.7/configure.ac
++++ bindfs-1.10.7/configure.ac
+@@ -15,13 +15,6 @@
+ AC_ARG_WITH([core-foundation],
+ AS_HELP_STRING([--with-core-foundation], [link against Core Foundation (OS X only) @<:@default=no@:>@]))
+
+-
+-if test x"$enable_debug" == "xyes" ; then
+- my_CFLAGS="-g -O0"
+-else
+- my_CFLAGS="-O2"
+-fi
+-
+ if test x"$enable_debug_output" == "xyes" ; then
+ AC_DEFINE([BINDFS_DEBUG], [1], [Define to 1 to enable debugging messages])
+ fi
diff --git a/sys-fs/bindfs/files/bindfs-1.12.2-ac-config-headers.patch b/sys-fs/bindfs/files/bindfs-1.12.2-ac-config-headers.patch
new file mode 100644
index 000000000000..7881102d7b0e
--- /dev/null
+++ b/sys-fs/bindfs/files/bindfs-1.12.2-ac-config-headers.patch
@@ -0,0 +1,25 @@
+From 6f52e8b2b7c77086a9d9c490f67268e8c88fa082 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Tue, 1 Oct 2013 23:43:25 +0200
+Subject: [PATCH] Migrate to AC_CONFIG_HEADERS
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 95164ed..2c9e46b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,7 +1,7 @@
+ AC_INIT([bindfs],[1.12.2],[martin.partel@gmail.com])
+
+ AM_INIT_AUTOMAKE([foreign])
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS([config.h])
+
+ AC_PROG_CC
+ AC_LANG(C)
+--
+1.8.2.1
+
diff --git a/sys-fs/bindfs/metadata.xml b/sys-fs/bindfs/metadata.xml
new file mode 100644
index 000000000000..94bb24b79b85
--- /dev/null
+++ b/sys-fs/bindfs/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <maintainer>
+ <email>sping@gentoo.org</email>
+ <name>Sebastian Pipping</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">bindfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/btrfs-progs/Manifest b/sys-fs/btrfs-progs/Manifest
new file mode 100644
index 000000000000..c4f414568d2c
--- /dev/null
+++ b/sys-fs/btrfs-progs/Manifest
@@ -0,0 +1,9 @@
+DIST btrfs-progs-v3.14.2.tar.xz 275372 SHA256 70e1d0ca887bfa5062dc74cc5d4556c19adb08453fbfa57edae6802d9c917793 SHA512 02f0cf7581b41143707769e53debecfdd3f5a1dd717530c33d4a657b09feafd73bb43408516a58fb6d2754365803018673321c7c1898b81bb36194f05a0d8955 WHIRLPOOL 4561adf84b6570e165be04c8c7b014646f4be11b7f9840a5929103271cb7e121006b515645968f9a4b7cbaf8b0a407c2e74b82b91bd6688b7f58b06fedf70e95
+DIST btrfs-progs-v3.16.2.tar.xz 291604 SHA256 d4d62abe0c2b8e86888f96e4bd21ca7e25c2d53120a3b9e8c6f987344147732b SHA512 7dc0f2f8f0bbddbbf1d4d99854425341c4b3997334c65d7e936bcec1ee5ca880101b8b45498721502857b478edae6237a934c7d4acb735de43c6d8ff35efe53b WHIRLPOOL 19e1fadeefcd40bfecf1b957c37da3387351e1f6cae04add59fd689524338c165e3547b799520e74bacc351ef236eec2481c1043159b58358b77cd74cf3db281
+DIST btrfs-progs-v3.17.3.tar.xz 588424 SHA256 e7bd9ff8d95b515973d3a1255c17fd481bcd75e4420f00c6c9c99489d1ddac2c SHA512 faa9b0d5281f72777d4b64b96774dcb1d6f579fd84e3bac3c256e779bf6fd67ee17aaf8f904dd29a8a8592f504e3e8af0caf1ab261689457a30467d3c1fb6a71 WHIRLPOOL 6ce02a7b078a277b882a2249ea4b628ce7b5dd16572d618b8cb999f88115c84ac30c9c9928525754edd458f86a458c9cf5c1753cb293c49e0d000795fae31604
+DIST btrfs-progs-v3.18.2.tar.xz 1029228 SHA256 dd8ddb4d201e5ffd32a15ed0e1f33fbc2c8fb16383f1519a9fae136698c2dfec SHA512 7fd125eeedabd54178f5198ac09c364b6772125124adcdb2620515a51c331307205ae06ff81375a49ebc62650d537c6f9eed2b63bf1f7e97b9ff047cda8a2cc4 WHIRLPOOL e5df056188abc2f57941b92be2774208fd1409f580c9604242f81aeda78f4be6d95f4cacfcf39917db363a033fb3b11f1eb864c15cccf24491fc1b660fce3803
+DIST btrfs-progs-v3.19.1.tar.xz 1101168 SHA256 248862a7e7e06188bb495bbaa05d3e0e34628b61a10ef03234b3b00698ce88db SHA512 c8b1c348afe3e32f54a72fcf361700bd63c12272e34ab34774936a2eca338dbea568d452f494d6ddd3c7be75b37a6d400fec33500548ed9b6df008212613d7f5 WHIRLPOOL 75bb08fe5ab49711f264d6cd35ddac39ea722ef2bcd57c53ad0d483cdf329b1b1b89c0b70280dea161568fd78c44eae30c76fb574ee649200237a13b3df1d8d4
+DIST btrfs-progs-v4.0.1.tar.xz 1104340 SHA256 2c2e10e79edd16a92effe8619c527fd130bc272fbca67896e1705bb2ec0293cb SHA512 52e5165f2fdd0f27f9c2f099b774523c36ab442948a13ede03736297a139903af4c0c444c77abc14b05f3cf633b006eb9dbc29f2b127858698ee1b6ad517a53f WHIRLPOOL ad8d2280c9205537a1045a835bffb39d73684fea87841215cd0916fdc91285aa299dc5885446b3c3aa50fcc2ab562a4b58a33cc9537ede3f57df4bc566aacb47
+DIST btrfs-progs-v4.0.tar.xz 1102500 SHA256 179cf1acc1b0061548b8f1d9cf973a8338bf96f192cecad99ecdace9ae065a1f SHA512 895d6c27bd82c4b320c705c32613b28e601f316c0881080d8c376d0045162eaab6c91431dee73b391fc608e6d7c16f3a744ef6b9c85adb4beaa4376fbbe36d9a WHIRLPOOL cf71cc4ab6c85e8673143bb779c7b252caf1bfabc14fb2d7dd3477bd842b491ac3d7f121c3dcbecec023c5873c4b4400a5f2087e55bbee14217982f9712d5c2f
+DIST btrfs-progs-v4.1.2.tar.xz 1123080 SHA256 62db60c6a0868afb6302112cea54c756873bc30b826696b167ec03ecd61b2f12 SHA512 dd159bcc3adb65efd4f612d75f5a6b30df8ad9fa06ef952dd03dac965256de37eab26f4cc2fb3840178403ccbb7368cae11638e27eadb9b1835b636c4b126e2e WHIRLPOOL 819e6d61ecbb0f2d099abcda70ae9ab53b3311a28131fdedbbad7cc033c4984309a460f704d2f2ce7cf36cf0e034e82618c1b45002fdfbb5eced648883e12a29
+DIST btrfs-progs-v4.1.tar.xz 1119564 SHA256 abc6ff9dbbf948e7358edd34db32103cba8b86c5cb9e3ed7eb3b5630e2feb7e8 SHA512 0c596bab3276d1dc6de010ce94a1d7758c80fe21d540b2d4b3487e0a5cf0a63b27fdba3e1af42aa349447a0be459f2087f9b4ae03fdc0dfcc4f316e570893346 WHIRLPOOL 97ae77f578f162ec114e137899f195ec0e28097902e2f2ae5e1f37db359cd6c1bae2f0fb6641b0365df80defb844d58603623db27dc63c1576437efcaf19d3e6
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild
new file mode 100644
index 000000000000..3b97509798db
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.14.2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha amd64 arm ~ia64 ~mips ppc ppc64 ~sparc x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/mason/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-2
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.14.2-install-man.patch"
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild
new file mode 100644
index 000000000000..f0ff067c0de1
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.16.2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild
new file mode 100644
index 000000000000..ea08de43e2de
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.17.3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild
new file mode 100644
index 000000000000..8ef9a0298c0d
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.18.2.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ inherit git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE=""
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ sys-fs/e2fsprogs:0=
+"
+DEPEND="${RDEPEND}
+ sys-apps/acl
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ BUILD_VERBOSE=1
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ prefix=/usr \
+ bindir=/sbin \
+ libdir=/usr/$(get_libdir) \
+ mandir=/usr/share/man
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild
new file mode 100644
index 000000000000..1d85858c9f6b
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-3.19.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild
new file mode 100644
index 000000000000..0bf8aaa7fe87
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.0.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha amd64 arm ~arm64 ~ia64 ~mips ppc ~ppc64 ~sparc x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild
new file mode 100644
index 000000000000..1d85858c9f6b
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.0.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild
new file mode 100644
index 000000000000..4f0cc37e6ccd
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.1.2.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild b/sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild
new file mode 100644
index 000000000000..4f0cc37e6ccd
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-4.1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild b/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild
new file mode 100644
index 000000000000..4f0cc37e6ccd
--- /dev/null
+++ b/sys-fs/btrfs-progs/btrfs-progs-9999.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit bash-completion-r1 eutils multilib toolchain-funcs
+
+libbtrfs_soname=0
+
+if [[ ${PV} != 9999 ]]; then
+ MY_PV=v${PV}
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+ SRC_URI="https://www.kernel.org/pub/linux/kernel/people/kdave/${PN}/${PN}-${MY_PV}.tar.xz"
+ S="${WORKDIR}"/${PN}-${MY_PV}
+else
+ WANT_LIBTOOL=none
+ inherit autotools git-r3
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
+ https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git"
+ EGIT_BRANCH="devel"
+fi
+
+DESCRIPTION="Btrfs filesystem utilities"
+HOMEPAGE="https://btrfs.wiki.kernel.org"
+
+LICENSE="GPL-2"
+SLOT="0/${libbtrfs_soname}"
+IUSE="+convert"
+
+RESTRICT=test # tries to mount repared filesystems
+
+RDEPEND="
+ dev-libs/lzo:2=
+ sys-libs/zlib:0=
+ convert? (
+ sys-fs/e2fsprogs:0=
+ sys-libs/e2fsprogs-libs:0=
+ )
+"
+DEPEND="${RDEPEND}
+ convert? ( sys-apps/acl )
+ app-text/asciidoc
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+"
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" sys-devel/gnuconfig"
+fi
+
+src_prepare() {
+ epatch_user
+ if [[ ${PV} == 9999 ]]; then
+ eautoreconf
+ mkdir config || die
+ local automakedir="$(autotools_run_tool --at-output automake --print-libdir)"
+ [[ -e ${automakedir} ]] || die "Could not locate automake directory"
+ ln -s "${automakedir}"/install-sh config/install-sh || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.guess config/config.guess || die
+ ln -s "${EPREFIX}"/usr/share/gnuconfig/config.sub config/config.sub || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}"/sbin
+ $(use_enable convert)
+ $(use_enable elibc_glibc backtrace)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ newbashcomp btrfs-completion btrfs
+}
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch
new file mode 100644
index 000000000000..e326f34af7e3
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-convert-remove-used-space-update.patch
@@ -0,0 +1,30 @@
+--- /var/tmp/portage/sys-fs/btrfs-progs-0.19/work/btrfs-progs-0.19/convert.c 2009-06-11 10:56:15.000000000 -0600
++++ btrfs-progs-unstable/convert.c 2009-09-21 08:51:43.773575874 -0600
+@@ -370,7 +370,6 @@
+ struct btrfs_extent_item *ei;
+ u32 blocksize = root->sectorsize;
+ u64 nbytes;
+- u64 bytes_used;
+
+ if (disk_bytenr == 0) {
+ ret = btrfs_insert_file_extent(trans, root, objectid,
+@@ -432,9 +431,6 @@
+ nbytes = btrfs_stack_inode_nbytes(inode) + num_bytes;
+ btrfs_set_stack_inode_nbytes(inode, nbytes);
+
+- bytes_used = btrfs_root_used(&root->root_item);
+- btrfs_set_root_used(&root->root_item, bytes_used + num_bytes);
+-
+ btrfs_release_path(root, &path);
+
+ ins_key.objectid = disk_bytenr;
+@@ -454,9 +450,6 @@
+
+ btrfs_mark_buffer_dirty(leaf);
+
+- bytes_used = btrfs_super_bytes_used(&info->super_copy);
+- btrfs_set_super_bytes_used(&info->super_copy, bytes_used +
+- num_bytes);
+ ret = btrfs_update_block_group(trans, root, disk_bytenr,
+ num_bytes, 1, 0);
+ if (ret)
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch
new file mode 100644
index 000000000000..38a0a18dbc61
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-fix-underlinking.patch
@@ -0,0 +1,11 @@
+--- btrfs-progs-0.19/Makefile~ 2011-06-05 10:21:04.000000000 -0600
++++ btrfs-progs-0.19/Makefile 2011-06-05 10:21:46.000000000 -0600
+@@ -75,7 +75,7 @@ quick-test: $(objects) quick-test.o
+ gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS)
+
+ convert: $(objects) convert.o
+- gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS)
++ gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs -lcom_err $(LDFLAGS) $(LIBS)
+
+ ioctl-test: $(objects) ioctl-test.o
+ gcc $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch
new file mode 100644
index 000000000000..183fe2af3ea3
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-0.19-glibc212.patch
@@ -0,0 +1,17 @@
+btrfsck.o: In function `maybe_free_inode_rec':
+btrfsck.c:(.text+0xce6): undefined reference to `S_ISDIR'
+btrfsck.c:(.text+0xd13): undefined reference to `S_ISREG'
+btrfsck.c:(.text+0xdc7): undefined reference to `S_ISREG'
+btrfsck.c:(.text+0xe2e): undefined reference to `S_ISLNK'
+btrfsck.c:(.text+0xe5b): undefined reference to `S_ISLNK'
+
+--- btrfsck.c
++++ btrfsck.c
+@@ -21,6 +21,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
++#include <sys/stat.h>
+ #include "kerncompat.h"
+ #include "ctree.h"
+ #include "disk-io.h"
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch
new file mode 100644
index 000000000000..e2feb0bdbefa
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-defrag-sockets.patch
@@ -0,0 +1,78 @@
+From: Pascal VITOUX <vitoux.pascal@gmail.com>
+To: linux-btrfs@vger.kernel.org
+Cc: Pascal VITOUX <vitoux.pascal@gmail.com>
+Subject: [PATCH] btrfs-progs: skip non-regular files while defragmenting
+Date: Thu, 9 Jan 2014 23:47:14 +0100
+Message-Id: <1389307634-8226-1-git-send-email-vitoux.pascal@gmail.com>
+X-Mailer: git-send-email 1.8.5.2
+Sender: linux-btrfs-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-btrfs.vger.kernel.org>
+X-Mailing-List: linux-btrfs@vger.kernel.org
+
+Skip non-regular files to avoid ioctl errors while defragmenting.
+
+They are silently ignored in recursive mode but reported as errors when
+used as command-line arguments.
+
+Signed-off-by: Pascal VITOUX <vitoux.pascal@gmail.com>
+Gentoo-bug: https://bugs.gentoo.org/503514
+Reported-by: Antoine Lemoine
+---
+ cmds-filesystem.c | 26 ++++++++++++++++----------
+ 1 file changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/cmds-filesystem.c b/cmds-filesystem.c
+index 1c1926b..54fba10 100644
+--- a/cmds-filesystem.c
++++ b/cmds-filesystem.c
+@@ -646,7 +646,7 @@ static int defrag_callback(const char *fpath, const struct stat *sb,
+ int e = 0;
+ int fd = 0;
+
+- if (typeflag == FTW_F) {
++ if ((typeflag == FTW_F) && S_ISREG(sb->st_mode)) {
+ if (defrag_global_verbose)
+ printf("%s\n", fpath);
+ fd = open(fpath, O_RDWR);
+@@ -748,6 +748,7 @@ static int cmd_defrag(int argc, char **argv)
+ defrag_global_range.flags |= BTRFS_DEFRAG_RANGE_START_IO;
+
+ for (i = optind; i < argc; i++) {
++ struct stat st;
+ dirstream = NULL;
+ fd = open_file_or_dir(argv[i], &dirstream);
+ if (fd < 0) {
+@@ -757,16 +758,21 @@ static int cmd_defrag(int argc, char **argv)
+ close_file_or_dir(fd, dirstream);
+ continue;
+ }
++ if (fstat(fd, &st)) {
++ fprintf(stderr, "ERROR: failed to stat %s - %s\n",
++ argv[i], strerror(errno));
++ defrag_global_errors++;
++ close_file_or_dir(fd, dirstream);
++ continue;
++ }
++ if (!(S_ISDIR(st.st_mode) || S_ISREG(st.st_mode))) {
++ fprintf(stderr, "ERROR: %s is not a directory or a regular "
++ "file.\n", argv[i]);
++ defrag_global_errors++;
++ close_file_or_dir(fd, dirstream);
++ continue;
++ }
+ if (recursive) {
+- struct stat st;
+-
+- if (fstat(fd, &st)) {
+- fprintf(stderr, "ERROR: failed to stat %s - %s\n",
+- argv[i], strerror(errno));
+- defrag_global_errors++;
+- close_file_or_dir(fd, dirstream);
+- continue;
+- }
+ if (S_ISDIR(st.st_mode)) {
+ ret = nftw(argv[i], defrag_callback, 10,
+ FTW_MOUNT | FTW_PHYS);
+--
+1.8.5.2
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch
new file mode 100644
index 000000000000..8a2cc7883a14
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.12-fix-send-subvol-492776.patch
@@ -0,0 +1,111 @@
+Gentoo-bug: http://bugs.gentoo.org/492776
+
+From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
+
+Steps to reproduce:
+ # mkfs.btrfs -f /dev/sda
+ # mount /dev/sda /mnt
+ # btrfs subvolume create /mnt/foo
+ # umount /mnt
+ # mount -o subvol=foo /dev/sda /mnt
+ # btrfs sub snapshot -r /mnt /mnt/snap
+ # btrfs send /mnt/snap > /dev/null
+
+We will fail to send '/mnt/snap',this is because btrfs send try to
+open '/mnt/snap' by btrfs internal subvolume path 'foo/snap' rather
+than relative path based on mounted point, this will return us 'no
+such file or directory',this is not right, fix it.
+
+Reported-by: Thomas Scheiblauer <tom@sharkbay.at>
+Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
+---
+v1->v2:
+ code cleanups(thanks to Stefan)
+---
+ cmds-send.c | 34 ++++++----------------------------
+ 1 file changed, 6 insertions(+), 28 deletions(-)
+
+diff --git a/cmds-send.c b/cmds-send.c
+index 53e9a53..6fdfd7f 100644
+--- a/cmds-send.c
++++ b/cmds-send.c
+@@ -282,31 +282,21 @@ out:
+ return ERR_PTR(ret);
+ }
+
+-static int do_send(struct btrfs_send *send, u64 root_id, u64 parent_root_id,
+- int is_first_subvol, int is_last_subvol)
++static int do_send(struct btrfs_send *send, u64 parent_root_id,
++ int is_first_subvol, int is_last_subvol, char *subvol)
+ {
+ int ret;
+ pthread_t t_read;
+ pthread_attr_t t_attr;
+ struct btrfs_ioctl_send_args io_send;
+- struct subvol_info *si;
+ void *t_err = NULL;
+ int subvol_fd = -1;
+ int pipefd[2] = {-1, -1};
+
+- si = subvol_uuid_search(&send->sus, root_id, NULL, 0, NULL,
+- subvol_search_by_root_id);
+- if (!si) {
+- ret = -ENOENT;
+- fprintf(stderr, "ERROR: could not find subvol info for %llu",
+- root_id);
+- goto out;
+- }
+-
+- subvol_fd = openat(send->mnt_fd, si->path, O_RDONLY | O_NOATIME);
++ subvol_fd = openat(send->mnt_fd, subvol, O_RDONLY | O_NOATIME);
+ if (subvol_fd < 0) {
+ ret = -errno;
+- fprintf(stderr, "ERROR: open %s failed. %s\n", si->path,
++ fprintf(stderr, "ERROR: open %s failed. %s\n", subvol,
+ strerror(-ret));
+ goto out;
+ }
+@@ -385,10 +375,6 @@ out:
+ close(pipefd[0]);
+ if (pipefd[1] != -1)
+ close(pipefd[1]);
+- if (si) {
+- free(si->path);
+- free(si);
+- }
+ return ret;
+ }
+
+@@ -664,14 +650,6 @@ int cmd_send(int argc, char **argv)
+ goto out;
+ }
+
+- ret = get_root_id(&send, get_subvol_name(send.root_path, subvol),
+- &root_id);
+- if (ret < 0) {
+- fprintf(stderr, "ERROR: could not resolve root_id "
+- "for %s\n", subvol);
+- goto out;
+- }
+-
+ if (!full_send && !parent_root_id) {
+ ret = find_good_parent(&send, root_id, &parent_root_id);
+ if (ret < 0) {
+@@ -700,8 +678,8 @@ int cmd_send(int argc, char **argv)
+ is_first_subvol = 1;
+ is_last_subvol = 1;
+ }
+- ret = do_send(&send, root_id, parent_root_id,
+- is_first_subvol, is_last_subvol);
++ ret = do_send(&send, parent_root_id, is_first_subvol,
++ is_last_subvol, subvol);
+ if (ret < 0)
+ goto out;
+
+--
+1.8.4
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch
new file mode 100644
index 000000000000..a9cced815b21
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.1-arg_strtou64.patch
@@ -0,0 +1,146 @@
+From: David Sterba <dsterba@suse.cz>
+To: linux-btrfs@vger.kernel.org
+Subject: [PATCH v2] btrfs-progs: move arg_strtou64 to a separate file for library
+Date: Tue, 22 Apr 2014 17:49:01 +0200
+
+Linking with libbtrfs fails because arg_strtou64 is not defined and we
+cannot just add utils.o to library objects because it's not
+library-clean.
+
+Reported-by: Arvin Schnell <aschnell@suse.com>
+Reported-by: Anton Farygin <rider@altlinux.org>
+Signed-off-by: David Sterba <dsterba@suse.cz>
+---
+
+v2: (thanks to Hugo)
+- added missing line from comment
+- fixed typo
+- reformated comment paragraphs
+
+ Makefile | 5 +++--
+ utils-lib.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ utils.c | 33 ---------------------------------
+ 3 files changed, 45 insertions(+), 35 deletions(-)
+ create mode 100644 utils-lib.c
+
+diff --git a/Makefile b/Makefile
+index 51d53fadf5af..76565e8b2307 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,14 +9,15 @@ CFLAGS = -g -O1 -fno-strict-aliasing
+ objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \
+ root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
+ extent-cache.o extent_io.o volumes.o utils.o repair.o \
+- qgroup.o raid6.o free-space-cache.o list_sort.o props.o
++ qgroup.o raid6.o free-space-cache.o list_sort.o props.o \
++ utils-lib.o
+ cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
+ cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \
+ cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \
+ cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \
+ cmds-property.o
+ libbtrfs_objects = send-stream.o send-utils.o rbtree.o btrfs-list.o crc32c.o \
+- uuid-tree.o
++ uuid-tree.o utils-lib.o
+ libbtrfs_headers = send-stream.h send-utils.h send.h rbtree.h btrfs-list.h \
+ crc32c.h list.h kerncompat.h radix-tree.h extent-cache.h \
+ extent_io.h ioctl.h ctree.h btrfsck.h
+diff --git a/utils-lib.c b/utils-lib.c
+new file mode 100644
+index 000000000000..9d53c6e5c710
+--- /dev/null
++++ b/utils-lib.c
+@@ -0,0 +1,42 @@
++#define _GNU_SOURCE
++
++#include "kerncompat.h"
++#include <unistd.h>
++#include <stdlib.h>
++#include <limits.h>
++
++#if BTRFS_FLAT_INCLUDES
++#else
++#endif /* BTRFS_FLAT_INCLUDES */
++
++/*
++ * This function should be only used when parsing command arg, it won't return
++ * error to its caller and rather exit directly just like usage().
++ */
++u64 arg_strtou64(const char *str)
++{
++ u64 value;
++ char *ptr_parse_end = NULL;
++
++ value = strtoull(str, &ptr_parse_end, 0);
++ if (ptr_parse_end && *ptr_parse_end != '\0') {
++ fprintf(stderr, "ERROR: %s is not a valid numeric value.\n",
++ str);
++ exit(1);
++ }
++
++ /*
++ * if we pass a negative number to strtoull, it will return an
++ * unexpected number to us, so let's do the check ourselves.
++ */
++ if (str[0] == '-') {
++ fprintf(stderr, "ERROR: %s: negative value is invalid.\n",
++ str);
++ exit(1);
++ }
++ if (value == ULLONG_MAX) {
++ fprintf(stderr, "ERROR: %s is too large.\n", str);
++ exit(1);
++ }
++ return value;
++}
+diff --git a/utils.c b/utils.c
+index 29953d9dd2a9..e130849c7bb5 100644
+--- a/utils.c
++++ b/utils.c
+@@ -1538,39 +1538,6 @@ scan_again:
+ return 0;
+ }
+
+-/*
+- * This function should be only used when parsing
+- * command arg, it won't return error to it's
+- * caller and rather exit directly just like usage().
+- */
+-u64 arg_strtou64(const char *str)
+-{
+- u64 value;
+- char *ptr_parse_end = NULL;
+-
+- value = strtoull(str, &ptr_parse_end, 0);
+- if (ptr_parse_end && *ptr_parse_end != '\0') {
+- fprintf(stderr, "ERROR: %s is not a valid numeric value.\n",
+- str);
+- exit(1);
+- }
+- /*
+- * if we pass a negative number to strtoull,
+- * it will return an unexpected number to us,
+- * so let's do the check ourselves.
+- */
+- if (str[0] == '-') {
+- fprintf(stderr, "ERROR: %s: negative value is invalid.\n",
+- str);
+- exit(1);
+- }
+- if (value == ULLONG_MAX) {
+- fprintf(stderr, "ERROR: %s is too large.\n", str);
+- exit(1);
+- }
+- return value;
+-}
+-
+ u64 parse_size(char *s)
+ {
+ int i;
+--
+1.9.0
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch
new file mode 100644
index 000000000000..69e36aaadeba
--- /dev/null
+++ b/sys-fs/btrfs-progs/files/btrfs-progs-3.14.2-install-man.patch
@@ -0,0 +1,13 @@
+diff --git a/Documentation/Makefile b/Documentation/Makefile
+index 034559e..f461bf2 100644
+--- a/Documentation/Makefile
++++ b/Documentation/Makefile
+@@ -75,7 +75,7 @@ install: install-man
+ install-man: man
+ $(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
+ $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir)
+- $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)
++ $(LNS) btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz
+
+ clean:
+ $(RM) *.xml *.xml+ *.8 *.8.gz
diff --git a/sys-fs/btrfs-progs/metadata.xml b/sys-fs/btrfs-progs/metadata.xml
new file mode 100644
index 000000000000..99f2c6f7db29
--- /dev/null
+++ b/sys-fs/btrfs-progs/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <use>
+ <flag name='convert'>Build ext2 conversion utility (btrfs-convert)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-fs/cachefilesd/Manifest b/sys-fs/cachefilesd/Manifest
new file mode 100644
index 000000000000..f6edcf0f5961
--- /dev/null
+++ b/sys-fs/cachefilesd/Manifest
@@ -0,0 +1 @@
+DIST cachefilesd-0.10.5.tar 112640 SHA256 125ea4f6aef4bf8e936a7cc747b59e074537a8aed74cd1bab3f05d7fbc47287f SHA512 996e47de40cff4d2c0d265689ef3a33aee6ef0d0432a03d7428133c091e77b0e099bd1346b5638bf2d9df6bb47bce519491b420d5916a3211c4e04e158ad92e8 WHIRLPOOL fad173739c307629ffef091a0cad890ee9bb3b133471de1fe9bb43cc06ee46a051fdb97262f9380a8133fb49cd87b9cbd3ee71205867046bd361f890c2645f1e
diff --git a/sys-fs/cachefilesd/cachefilesd-0.10.5-r4.ebuild b/sys-fs/cachefilesd/cachefilesd-0.10.5-r4.ebuild
new file mode 100644
index 000000000000..066f4146a5b4
--- /dev/null
+++ b/sys-fs/cachefilesd/cachefilesd-0.10.5-r4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic systemd toolchain-funcs
+
+DESCRIPTION="Provides a caching directory on an already mounted filesystem"
+HOMEPAGE="http://people.redhat.com/~dhowells/fscache/"
+SRC_URI="http://people.redhat.com/~dhowells/fscache/${P}.tar.bz2 -> ${P}.tar"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+IUSE="doc selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-cachefilesd )"
+DEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/0.10.4-makefile.patch
+ tc-export CC
+ if ! use selinux; then
+ sed -e '/^secctx/s:^:#:g' -i cachefilesd.conf || die
+ fi
+
+ append-flags -fpie
+}
+
+src_install() {
+ default
+
+ if use selinux; then
+ insinto /usr/share/doc/${P}
+ doins -r selinux
+ fi
+
+ dodoc howto.txt
+
+ newconfd "${FILESDIR}"/cachefilesd.conf ${PN}
+ newinitd "${FILESDIR}"/cachefilesd-3.init ${PN}
+
+ systemd_dounit ${PN}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}-tmpfiles.d ${PN}.conf
+}
+
+pkg_postinst() {
+ [[ -d /var/cache/fscache ]] && return
+ elog "Before CacheFiles can be used, a directory for local storage"
+ elog "must be created. The default configuration of /etc/cachefilesd.conf"
+ elog "uses /var/cache/fscache. The filesystem mounted there must support"
+ elog "extended attributes (mount -o user_xattr)."
+ echo ""
+ elog "Once that is taken care of, start the daemon, add -o ...,fsc"
+ elog "to the mount options of your network mounts, and let it fly!"
+}
diff --git a/sys-fs/cachefilesd/files/0.10.1-makefile.patch b/sys-fs/cachefilesd/files/0.10.1-makefile.patch
new file mode 100644
index 000000000000..af029c9293a3
--- /dev/null
+++ b/sys-fs/cachefilesd/files/0.10.1-makefile.patch
@@ -0,0 +1,21 @@
+diff --git a/Makefile b/Makefile
+index 15a8445..d650f47 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,4 +1,3 @@
+-CFLAGS := -g -O2 -Wall
+ INSTALL := install
+ DESTDIR :=
+ BUILDFOR :=
+@@ -21,7 +20,10 @@ endif
+ #
+ all: cachefilesd
+
+-cachefilesd: cachefilesd.c Makefile
++cachefilesd.o: cachefilesd.c
++ $(CC) $(CFLAGS) -c $<
++
++cachefilesd: cachefilesd.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ #
diff --git a/sys-fs/cachefilesd/files/0.10.4-makefile.patch b/sys-fs/cachefilesd/files/0.10.4-makefile.patch
new file mode 100644
index 000000000000..5cbb24001c95
--- /dev/null
+++ b/sys-fs/cachefilesd/files/0.10.4-makefile.patch
@@ -0,0 +1,24 @@
+ Makefile | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d5d352e..9a98bf5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,4 +1,3 @@
+-CFLAGS := -g -O2 -Wall
+ INSTALL := install
+ DESTDIR :=
+ ETCDIR := /etc
+@@ -38,7 +37,10 @@ endif
+ ###############################################################################
+ all: cachefilesd
+
+-cachefilesd: cachefilesd.c Makefile
++cachefilesd.o: cachefilesd.c
++ $(CC) $(CFLAGS) -c $<
++
++cachefilesd: cachefilesd.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ ###############################################################################
diff --git a/sys-fs/cachefilesd/files/cachefilesd-2.init b/sys-fs/cachefilesd/files/cachefilesd-2.init
new file mode 100644
index 000000000000..afc7fc5a0ab6
--- /dev/null
+++ b/sys-fs/cachefilesd/files/cachefilesd-2.init
@@ -0,0 +1,54 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use logger
+ before nfsmount
+}
+
+checkxattr() {
+ local testpath testfile ret
+ # SELinux requires xattrs, so we can assume things work already
+ [ -f /sys/fs/selinux/status ] && return 0;
+ testpath=$(awk '/^[[:space:]]*dir/ {print $2}' /etc/cachefilesd.conf)
+ testfile="${testpath}/.tmp-xattr-test.cachefilesd"
+ touch "${testfile}"
+ # creates a file in the testpath and tries to set an attribute on it to check
+ # if the support is available
+ attr -s test -V xattr "${testfile}" 2>&1 > /dev/null
+ ret=$?
+ rm -f "${testfile}"
+ [ ${ret} -ne 0 ] && eerror "xattr support missing on the ${testpath} filesystem"
+ return ${ret}
+}
+
+start() {
+ ebegin "Starting cachefilesd"
+ checkxattr || return $?
+ # check if the cachefiles modules is loaded (or builtin)
+ if [ ! -c /dev/cachefiles ] ; then
+ local ret
+ einfo "/dev/cachefiles doesn't exist, trying to modprobe cachefiles"
+ modprobe cachefiles
+ ret=$?
+ if [ $ret -ne 0 ] ; then
+ eerror "cachefiles modules cannot be loaded so cachefilesd "
+ eerror "cannot be started, aborting. Did you build fscache in your "
+ eerror "kernel? Note that you need a 2.6.30 or better kernel"
+ return $ret
+ fi
+ fi
+ start-stop-daemon --start --pidfile /var/run/cachefilesd.pid --exec /sbin/cachefilesd -- ${OPTIONS}
+ eend $? "Failed to start cachefilesd. Check the system log to see the error"
+
+}
+
+stop() {
+ ebegin "Stopping cachefilesd"
+ start-stop-daemon --stop --exec /sbin/cachefilesd --pidfile /var/run/cachefilesd.pid
+ eend $? "Failed to stop cachefilesd"
+}
+
diff --git a/sys-fs/cachefilesd/files/cachefilesd-3.init b/sys-fs/cachefilesd/files/cachefilesd-3.init
new file mode 100644
index 000000000000..b21c56e6e9ab
--- /dev/null
+++ b/sys-fs/cachefilesd/files/cachefilesd-3.init
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use logger
+ before nfsmount
+}
+
+checkxattr() {
+ local testpath testfile ret
+ # SELinux requires xattrs, so we can assume things work already
+ [ -f /sys/fs/selinux/status ] && return 0;
+ testpath=$(awk '/^[[:space:]]*dir/ {print $2}' /etc/cachefilesd.conf)
+ checkpath -d "${testpath}"
+ testfile="${testpath}/.tmp-xattr-test.cachefilesd"
+ touch "${testfile}"
+ # creates a file in the testpath and tries to set an attribute on it to check
+ # if the support is available
+ attr -s test -V xattr "${testfile}" 2>&1 > /dev/null
+ ret=$?
+ rm -f "${testfile}"
+ [ ${ret} -ne 0 ] && eerror "xattr support missing on the ${testpath} filesystem"
+ return ${ret}
+}
+
+start() {
+ ebegin "Starting cachefilesd"
+ checkxattr || return $?
+ # check if the cachefiles modules is loaded (or builtin)
+ if [ ! -c /dev/cachefiles ] ; then
+ local ret
+ einfo "/dev/cachefiles doesn't exist, trying to modprobe cachefiles"
+ modprobe cachefiles
+ ret=$?
+ if [ $ret -ne 0 ] ; then
+ eerror "cachefiles modules cannot be loaded so cachefilesd "
+ eerror "cannot be started, aborting. Did you build fscache in your "
+ eerror "kernel? Note that you need a 2.6.30 or better kernel"
+ return $ret
+ fi
+ fi
+
+ start-stop-daemon --start --pidfile /run/cachefilesd.pid --exec /sbin/cachefilesd -- ${OPTIONS}
+ eend $? "Failed to start cachefilesd. Check the system log to see the error"
+
+}
+
+stop() {
+ ebegin "Stopping cachefilesd"
+ start-stop-daemon --stop --exec /sbin/cachefilesd --pidfile /run/cachefilesd.pid
+ eend $? "Failed to stop cachefilesd"
+}
+
diff --git a/sys-fs/cachefilesd/files/cachefilesd-tmpfiles.d b/sys-fs/cachefilesd/files/cachefilesd-tmpfiles.d
new file mode 100644
index 000000000000..11da15afd7f0
--- /dev/null
+++ b/sys-fs/cachefilesd/files/cachefilesd-tmpfiles.d
@@ -0,0 +1 @@
+d /var/cache/fscache 0755 - - -
diff --git a/sys-fs/cachefilesd/files/cachefilesd.conf b/sys-fs/cachefilesd/files/cachefilesd.conf
new file mode 100644
index 000000000000..f91d40381545
--- /dev/null
+++ b/sys-fs/cachefilesd/files/cachefilesd.conf
@@ -0,0 +1,8 @@
+# Config file for /etc/init.d/cachefilesd
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# -d - This can be specified multiple times.
+# -f <configfile> - Read the specified configuration file instead of /etc/cachefiles.conf
+OPTIONS=""
diff --git a/sys-fs/cachefilesd/files/cachefilesd.init b/sys-fs/cachefilesd/files/cachefilesd.init
new file mode 100644
index 000000000000..93090ef2afbc
--- /dev/null
+++ b/sys-fs/cachefilesd/files/cachefilesd.init
@@ -0,0 +1,52 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use logger
+ before nfsmount
+}
+
+checkxattr() {
+ local testpath testfile ret
+ testpath=$(awk '/^[[:space:]]*dir/ {print $2}' /etc/cachefilesd.conf)
+ testfile="${testpath}/.tmp-xattr-test.cachefilesd"
+ touch "${testfile}"
+ # creates a file in the testpath and tries to set an attribute on it to check
+ # if the support is available
+ attr -s test -V xattr "${testfile}" 2>&1 > /dev/null
+ ret=$?
+ rm -f "${testfile}"
+ [ ${ret} -ne 0 ] && eerror "xattr support missing on the ${testpath} filesystem"
+ return ${ret}
+}
+
+start() {
+ ebegin "Starting cachefilesd"
+ checkxattr || return $?
+ # check if the cachefiles modules is loaded (or builtin)
+ if [ ! -c /dev/cachefiles ] ; then
+ local ret
+ einfo "/dev/cachefiles doesn't exist, trying to modprobe cachefiles"
+ modprobe cachefiles
+ ret=$?
+ if [ $ret -ne 0 ] ; then
+ eerror "cachefiles modules cannot be loaded so cachefilesd "
+ eerror "cannot be started, aborting. Did you build fscache in your "
+ eerror "kernel? Note that you need a 2.6.30 or better kernel"
+ return $ret
+ fi
+ fi
+ start-stop-daemon --start --pidfile /var/run/cachefilesd.pid --exec /sbin/cachefilesd -- ${OPTIONS}
+ eend $? "Failed to start cachefilesd. Check the system log to see the error"
+
+}
+
+stop() {
+ ebegin "Stopping cachefilesd"
+ start-stop-daemon --stop --exec /sbin/cachefilesd --pidfile /var/run/cachefilesd.pid
+ eend $? "Failed to stop cachefilesd"
+}
+
diff --git a/sys-fs/cachefilesd/metadata.xml b/sys-fs/cachefilesd/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sys-fs/cachefilesd/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/clamfs/Manifest b/sys-fs/clamfs/Manifest
new file mode 100644
index 000000000000..7e8758f70657
--- /dev/null
+++ b/sys-fs/clamfs/Manifest
@@ -0,0 +1 @@
+DIST clamfs-1.0.1.tar.gz 142386 SHA256 d4f8b0ce767fab3deeb356e8c7cd45a34b5e3de43177735b4f315fc16aa11d03
diff --git a/sys-fs/clamfs/clamfs-1.0.1-r1.ebuild b/sys-fs/clamfs/clamfs-1.0.1-r1.ebuild
new file mode 100644
index 000000000000..39286e311291
--- /dev/null
+++ b/sys-fs/clamfs/clamfs-1.0.1-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+inherit eutils linux-info
+
+DESCRIPTION="A FUSE-based user-space file system with on-access anti-virus file scanning"
+HOMEPAGE="http://clamfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=dev-libs/boost-1.33
+ sys-fs/fuse
+ dev-cpp/commoncpp2
+ dev-libs/rlog
+ dev-libs/poco"
+RDEPEND="${DEPEND}
+ app-antivirus/clamav"
+
+CONFIG_CHECK="~FUSE_FS"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${P}-gentoo.patch" \
+ "${FILESDIR}/${P}-gcc45.patch"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "emake install failed"
+
+ insinto /etc/clamfs
+ doins doc/clamfs.xml || die
+
+ newinitd "${FILESDIR}/${PN}.initd" ${PN} || die
+ newconfd "${FILESDIR}/${PN}.confd" ${PN} || die
+
+ dodoc AUTHORS ChangeLog NEWS README TODO || die
+}
diff --git a/sys-fs/clamfs/files/clamfs-1.0.1-gcc45.patch b/sys-fs/clamfs/files/clamfs-1.0.1-gcc45.patch
new file mode 100644
index 000000000000..1f5f63a252f2
--- /dev/null
+++ b/sys-fs/clamfs/files/clamfs-1.0.1-gcc45.patch
@@ -0,0 +1,15 @@
+Fix building with gcc 4.5
+
+http://bugs.gentoo.org/show_bug.cgi?id=320107
+
+--- src/scancache.cxx
++++ src/scancache.cxx
+@@ -37,7 +37,7 @@
+ }
+
+ ScanCache::ScanCache(long int elements, long int expire):
+- ExpireLRUCache<ino_t, CachedResult>::ExpireLRUCache<ino_t, CachedResult>(elements, expire) {
++ ExpireLRUCache<ino_t, CachedResult>(elements, expire) {
+ }
+
+ ScanCache::~ScanCache() {
diff --git a/sys-fs/clamfs/files/clamfs-1.0.1-gentoo.patch b/sys-fs/clamfs/files/clamfs-1.0.1-gentoo.patch
new file mode 100644
index 000000000000..f5c02daca6d6
--- /dev/null
+++ b/sys-fs/clamfs/files/clamfs-1.0.1-gentoo.patch
@@ -0,0 +1,12 @@
+diff -Naur clamfs-1.0.1.orig/doc/clamfs.xml clamfs-1.0.1/doc/clamfs.xml
+--- clamfs-1.0.1.orig/doc/clamfs.xml 2009-02-07 23:09:26.000000000 +0900
++++ clamfs-1.0.1/doc/clamfs.xml 2010-01-08 18:19:13.000000000 +0900
+@@ -16,7 +16,7 @@
+ check - (yes or no) check if clamd is available on startup (useful if
+ mounting clamfs file systems from /etc/fstab early on startup,
+ while clamav daemon is not yet started) -->
+- <clamd socket="/var/run/clamav/clamd.ctl" check="yes" />
++ <clamd socket="/var/run/clamav/clamd.sock" check="yes" />
+
+ <!-- File system settings
+ root - real directory to attach as our root
diff --git a/sys-fs/clamfs/files/clamfs.confd b/sys-fs/clamfs/files/clamfs.confd
new file mode 100644
index 000000000000..941549a4ca60
--- /dev/null
+++ b/sys-fs/clamfs/files/clamfs.confd
@@ -0,0 +1 @@
+CLAMFS_CONFFILE="/etc/clamfs/clamfs.xml"
diff --git a/sys-fs/clamfs/files/clamfs.initd b/sys-fs/clamfs/files/clamfs.initd
new file mode 100644
index 000000000000..d7f911ee2b62
--- /dev/null
+++ b/sys-fs/clamfs/files/clamfs.initd
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+ need clamd
+}
+
+start() {
+ ebegin "Starting clamfs"
+ start-stop-daemon --start --quiet \
+ --exec /usr/bin/clamfs -- ${CLAMFS_CONFFILE}
+ eend $? "Failed to start clamfs"
+}
+
+stop() {
+ ebegin "Stopping clamfs"
+ start-stop-daemon --stop --quiet --name clamfs
+ eend $? "Failed to stop clamfs"
+}
diff --git a/sys-fs/clamfs/metadata.xml b/sys-fs/clamfs/metadata.xml
new file mode 100644
index 000000000000..5b7eab143333
--- /dev/null
+++ b/sys-fs/clamfs/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ ClamFS is a FUSE-based user-space file system for Linux with on-access
+ anti-virus file scanning through clamd daemon (a file scanning service
+ developed by ClamAV Project).
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">clamfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/cloudfuse/Manifest b/sys-fs/cloudfuse/Manifest
new file mode 100644
index 000000000000..269a41b2ca1b
--- /dev/null
+++ b/sys-fs/cloudfuse/Manifest
@@ -0,0 +1 @@
+DIST 1.0.tar.gz 63361 SHA256 4684fcc7c596c3fd696e9b4f436fb5da4883ddbd4b36ce6dee4ef1b8f965a4a9 SHA512 c2631898f14a90a251e6fb94e62457d1f8594a53bde873326955c401785067aef750393d7a73e97c22146654d0a9e5fa909a3d26b280909a9ecf09c1bc7f0fb7 WHIRLPOOL e71934f11865696778a95227bd31aa34e1cdf2fcabb24437ed1c493e18f09a073125a9f100f3484e4f2b1f28a6e84920020acd8d12acac6c479e400b16ae629c
diff --git a/sys-fs/cloudfuse/cloudfuse-1.0.ebuild b/sys-fs/cloudfuse/cloudfuse-1.0.ebuild
new file mode 100644
index 000000000000..89648ba92161
--- /dev/null
+++ b/sys-fs/cloudfuse/cloudfuse-1.0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A FUSE filesystem for Rackspace's Cloud Files"
+HOMEPAGE="http://redbo.github.io/cloudfuse/"
+SRC_URI="https://github.com/redbo/${PN}/archive/${PV}.tar.gz"
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="
+ dev-libs/libxml2
+ dev-libs/openssl:0
+ net-misc/curl
+ sys-fs/fuse
+"
+
+RDEPEND="${DEPEND}"
diff --git a/sys-fs/cloudfuse/metadata.xml b/sys-fs/cloudfuse/metadata.xml
new file mode 100644
index 000000000000..a60ef5cec63b
--- /dev/null
+++ b/sys-fs/cloudfuse/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer status="active">
+ <email>erikmack@gmail.com</email>
+ <name>Erik Mackdanz</name>
+ </maintainer>
+ <maintainer status="active">
+ <email>alunduil@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ Cloudfuse is a FUSE application which provides access
+ to Rackspace's Cloud Files. The README claims that
+ Openstack Swift is also supported, though I haven't
+ tested this yet.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">redbo/cloudfuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/copyfs/Manifest b/sys-fs/copyfs/Manifest
new file mode 100644
index 000000000000..f23e29727886
--- /dev/null
+++ b/sys-fs/copyfs/Manifest
@@ -0,0 +1 @@
+DIST copyfs-1.0.1.tar.bz2 38429 SHA256 63022f60e2c6b488bef509add0e7cdb41d597ded22a70c1c6ae74ab4a6b7e0f7 SHA512 abe1a125913f35d8390385562d56a5a1aa238ec03bfa044d61ac8f514a4986bfa70502d30af9dbc90e58910dab7f0ab5e230de0b4fa2eb45fe3a2f6514be0a07 WHIRLPOOL e230bb1f4cf24bbc6cdf9bfcad4324d7861e6b36b3dd5a9611e62e52520635e2605831d697a548f82fb589422ac79e4997efbc9b2ef689746860d04932d3f5f2
diff --git a/sys-fs/copyfs/copyfs-1.0.1.ebuild b/sys-fs/copyfs/copyfs-1.0.1.ebuild
new file mode 100644
index 000000000000..c3410402b46a
--- /dev/null
+++ b/sys-fs/copyfs/copyfs-1.0.1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="fuse-based filesystem for maintaining configuration files"
+HOMEPAGE="http://invaders.mars-attacks.org/~boklm/copyfs/"
+SRC_URI="${HOMEPAGE}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64 ~ppc"
+IUSE=""
+
+DEPEND=">=sys-fs/fuse-2.0
+ sys-apps/attr"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # this patch fixes sandbox violations
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+
+ # this patch adds support for cleaning up the versions directory
+ # the patch is experimental at best, but it's better than your
+ # versions directory filling up with unused files
+ #
+ # patch by stuart@gentoo.org
+ epatch "${FILESDIR}"/${PN}-1.0-unlink.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf --bindir="${D}/usr/bin" --mandir="${D}/usr/share/man"
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+}
diff --git a/sys-fs/copyfs/files/copyfs-1.0-unlink.patch b/sys-fs/copyfs/files/copyfs-1.0-unlink.patch
new file mode 100644
index 000000000000..f4ee28fae148
--- /dev/null
+++ b/sys-fs/copyfs/files/copyfs-1.0-unlink.patch
@@ -0,0 +1,158 @@
+diff -u --recursive copyfs-1.0-orig/cache.c copyfs-1.0/cache.c
+--- copyfs-1.0-orig/cache.c 2004-12-10 13:34:08.000000000 +0000
++++ copyfs-1.0/cache.c 2004-12-18 20:30:17.945445677 +0000
+@@ -94,6 +94,61 @@
+ }
+
+ /*
++ * Remove metadata from the cache
++ */
++void cache_remove_metadata(metadata_t *metadata)
++{
++ version_t * version;
++
++ int atHead = 1;
++ int atTail = 1;
++
++ if (NULL == metadata)
++ return ;
++
++ /* Disconnect it from the list */
++ if (metadata->md_previous)
++ {
++ metadata->md_previous->md_next = metadata->md_next;
++ atHead = 0;
++ }
++
++ if (metadata->md_next)
++ {
++ metadata->md_next->md_previous = metadata->md_previous;
++ atTail = 0;
++ }
++
++ if (atHead)
++ {
++ metadata->md_bucket->b_contents = metadata->md_next;
++ if (metadata->md_next != NULL)
++ metadata->md_next->md_previous = NULL;
++ }
++
++ metadata->md_bucket->b_count--;
++ if (metadata->md_bucket->b_count == 0)
++ metadata->md_bucket->b_contents = NULL;
++
++ version = metadata->md_versions;
++
++ while (NULL != version)
++ {
++ metadata->md_versions = version->v_next;
++ free(version);
++ version = metadata->md_versions;
++ }
++
++ if (metadata->md_vfile != NULL)
++ free (metadata->md_vfile);
++
++ if (metadata->md_vpath != NULL)
++ free (metadata->md_vpath);
++
++ free(metadata);
++}
++
++/*
+ * Clean the older items out of the cache to free space. The goal is to
+ * half the number of items, so that we don't get called constantly.
+ */
+@@ -122,6 +177,7 @@
+ bucket = &cache_hash_table[CACHE_HASH(metadata->md_vfile)];
+ metadata->md_previous = NULL;
+ metadata->md_next = bucket->b_contents;
++ metadata->md_bucket = bucket;
+ if (bucket->b_contents)
+ bucket->b_contents->md_previous = metadata;
+ bucket->b_contents = metadata;
+diff -u --recursive copyfs-1.0-orig/cache.h copyfs-1.0/cache.h
+--- copyfs-1.0-orig/cache.h 2004-12-10 13:34:08.000000000 +0000
++++ copyfs-1.0/cache.h 2004-12-18 20:04:32.072307652 +0000
+@@ -11,6 +11,7 @@
+ void cache_initialize(void);
+ void cache_finalize(void);
+ metadata_t *cache_get_metadata(const char *vpath);
++void cache_remove_metadata(metadata_t *metadata);
+ void cache_add_metadata(metadata_t *metadata);
+ int cache_find_maximal_match(char **array, metadata_t **result);
+
+diff -u --recursive copyfs-1.0-orig/interface.c copyfs-1.0/interface.c
+--- copyfs-1.0-orig/interface.c 2004-12-18 20:04:21.560474299 +0000
++++ copyfs-1.0/interface.c 2004-12-18 20:17:22.367357210 +0000
+@@ -137,6 +137,7 @@
+ file = helper_build_composite("-S", "/", entry->d_name +
+ strlen(METADATA_PREFIX));
+ metadata = rcs_translate_to_metadata(file, rcs_version_path);
++
+ free(file);
+ if (metadata && !metadata->md_deleted)
+ {
+@@ -176,18 +177,42 @@
+ metadata = rcs_translate_to_metadata(path, rcs_version_path);
+ if (!metadata || metadata->md_deleted)
+ return -ENOENT;
+- version = rcs_find_version(metadata, LATEST, LATEST);
+- if (lstat(version->v_rfile, &st_rfile) == -1)
+- return -errno;
+- if (S_ISDIR(st_rfile.st_mode))
+- return -EISDIR;
++
++ /* remove all of the versions that we know about */
++
++ version = metadata->md_versions;
++
++ while (NULL != version)
++ {
++ /* if we can't stat the file, we assume it's already toast */
++
++ if (lstat(version->v_rfile, &st_rfile) == 0)
++ {
++ if (S_ISDIR(st_rfile.st_mode))
++ {
++ return -EISDIR;
++ }
++
++ if (unlink(version->v_rfile) == -1)
++ return -errno;
++ }
++
++ /* move on to the next version */
++ metadata->md_versions = version->v_next;
++ free(version);
++
++ version = metadata->md_versions;
++ }
++
++ /* if we get to here, we've released all the versions */
+ metadata->md_deleted = 1;
+ metafile = create_meta_name(metadata->md_vfile, "metadata");
+- if (write_metadata_file(metafile, metadata) == -1) {
+- free(metafile);
++ if (unlink(metafile) == -1)
+ return -errno;
+- }
+ free(metafile);
++
++ cache_remove_metadata(metadata);
++
+ return 0;
+ }
+
+diff -u --recursive copyfs-1.0-orig/structs.h copyfs-1.0/structs.h
+--- copyfs-1.0-orig/structs.h 2004-12-10 13:34:08.000000000 +0000
++++ copyfs-1.0/structs.h 2004-12-18 20:04:32.073307446 +0000
+@@ -38,6 +38,8 @@
+
+ metadata_t *md_next; /* Next file in bucket */
+ metadata_t *md_previous; /* Previous " */
++
++ bucket_t *md_bucket; /* Our container */
+ };
+
+ struct bucket_t
diff --git a/sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch b/sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch
new file mode 100644
index 000000000000..f0ddfab94af4
--- /dev/null
+++ b/sys-fs/copyfs/files/copyfs-1.0.1-gentoo.patch
@@ -0,0 +1,46 @@
+--- a/ea.c
++++ b/ea.c
+@@ -1,10 +1,11 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <fuse.h>
++#include <sys/errno.h>
+
+ #include "helper.h"
+ #include "structs.h"
+--- a/interface.c
++++ b/interface.c
+@@ -23,7 +23,7 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ #include <stdlib.h>
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include <sys/time.h>
+ #include <time.h>
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -27,7 +27,7 @@
+ OBJ = $(SRC:.c=.o)
+
+ CC = gcc
+-CFLAGS = -Wall -ansi -W -std=c99 -g -ggdb -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
++CFLAGS += -Wall -ansi -W -std=c99 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+ LIBS = -lfuse
+
+ all: $(TARGET)
+@@ -54,7 +54,7 @@
+ rm -rf /tmp/copyfs-dist
+
+ $(TARGET): $(OBJ)
+- gcc -o $(TARGET) $(OBJ) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(TARGET) $(OBJ) $(LIBS)
+
+ # Dependencies (use gcc -MM -D_FILE_OFFSET_BITS=64 *.c to regenerate)
+
diff --git a/sys-fs/copyfs/metadata.xml b/sys-fs/copyfs/metadata.xml
new file mode 100644
index 000000000000..333a655e1976
--- /dev/null
+++ b/sys-fs/copyfs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ <description>This package lacks a primary herd or maintainer.</description>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-fs/cramfs/Manifest b/sys-fs/cramfs/Manifest
new file mode 100644
index 000000000000..1db57063406f
--- /dev/null
+++ b/sys-fs/cramfs/Manifest
@@ -0,0 +1 @@
+DIST cramfs-1.1.tar.gz 24179 SHA256 133caca2c4e7c64106555154ee0ff693f5cf5beb9421ce2eb86baee997d22368
diff --git a/sys-fs/cramfs/cramfs-1.1.ebuild b/sys-fs/cramfs/cramfs-1.1.ebuild
new file mode 100644
index 000000000000..557bcb1f2149
--- /dev/null
+++ b/sys-fs/cramfs/cramfs-1.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="Linux filesystem designed to be simple, small, and to compress things well"
+HOMEPAGE="http://sourceforge.net/projects/cramfs/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ppc ~sparc x86"
+IUSE=""
+
+DEPEND="sys-libs/zlib"
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}" CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ into /
+ dosbin mkcramfs cramfsck || die
+ dodoc README NOTES
+}
diff --git a/sys-fs/cramfs/metadata.xml b/sys-fs/cramfs/metadata.xml
new file mode 100644
index 000000000000..5e2437596318
--- /dev/null
+++ b/sys-fs/cramfs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">cramfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/cryptsetup/Manifest b/sys-fs/cryptsetup/Manifest
new file mode 100644
index 000000000000..9ce574e0e98b
--- /dev/null
+++ b/sys-fs/cryptsetup/Manifest
@@ -0,0 +1,4 @@
+DIST cryptsetup-1.6.2.tar.bz2 1189584 SHA256 15723f0198303d4bcb99d480b7a773918e2d319f0348457988c063bdd03e109a SHA512 59fb835ef8bcd6d0c704a021055032639840ef4bb7be6ade8ff91d347ae74d8e6cba4583d8ced7a4a8c6f09ebc16c4eff3549c13c4327d92fd9234db58e18c10 WHIRLPOOL 3ab24572ea42dfdd0d5176dfa4621520cd0bccda53c3a01676d400a7a841ab9643c979c4942daa774658602bd8cdf659376cbc94c553e2097c5eb3c51a7edb31
+DIST cryptsetup-1.6.5.tar.xz 1136892 SHA256 267973f20be43f9d685f7193aa23954b60768c74a1d330243114d4b8bc17ca9a SHA512 c77ac590d28954e7bd430d1069b820a288c4668857a7ced7f81546ea39676f2b536abbcda06f20440e31c205b7ada68bcfa5aab220b102a2b62198a788d9b65e WHIRLPOOL 74a597abbdcc1225bb811597e53737eab2348a328f3ba30e7eb519a0621b06e6c898e320db8e24a16decfd4706b6a2e68b06894dde91124e4c089e952dbff9c1
+DIST cryptsetup-1.6.6.tar.xz 1145940 SHA256 2d2ce28e4e1137dd599d87884b62ef6dbf14fd7848b2a2bf7d61cf125fbd8e6f SHA512 6ee6b4e8fe4f721bb97d1cf47c5e2d1c96001dd3ac48154d414f64d23620ac3ec3eeea2ad584a1a3111e07a086c8a4fdbfabdf4859cda58ba2bd6765b1f009a8 WHIRLPOOL 07bb6b7f5153cfcd3a585f111733a05926d1f6f0ec190e0b0dc1777591bd0fec3c8782dc79f43bafd3829da28efbdd2d8f97daef8186392787c22c7f5e454376
+DIST cryptsetup-1.6.7.tar.xz 1188876 SHA256 c23c24c8d662032da8650c1c84985221be8bbedf4737c1540bba7e4517dfe820 SHA512 d6cecd2f3f5d468d4337d4e8407c8c3315e8972c0fc72cd1f93fb67f02a632b56ad293f08f6682f24c9ad0b5ad5967be751e5679413109692ade5823aafd1d19 WHIRLPOOL 95611938ddbf3520f1a2a2891e3103f6bf1699a210f7902bd65d1e61357ed44c9b6f344f567d1d5f1b88adb40154831e34014f3e22ec141f9101b707295007a0
diff --git a/sys-fs/cryptsetup/cryptsetup-1.6.2.ebuild b/sys-fs/cryptsetup/cryptsetup-1.6.2.ebuild
new file mode 100644
index 000000000000..6eb17d36e122
--- /dev/null
+++ b/sys-fs/cryptsetup/cryptsetup-1.6.2.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools python-single-r1 linux-info libtool eutils
+
+DESCRIPTION="Tool to setup encrypted devices with dm-crypt"
+HOMEPAGE="http://code.google.com/p/cryptsetup/"
+SRC_URI="http://cryptsetup.googlecode.com/files/${P}.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+CRYPTO_BACKENDS="+gcrypt kernel nettle openssl"
+# we don't support nss since it doesn't allow cryptsetup to be built statically
+# and it's missing ripemd160 support so it can't provide full backward compatibility
+IUSE="${CRYPTO_BACKENDS} nls python reencrypt static static-libs udev urandom"
+REQUIRED_USE="^^ ( ${CRYPTO_BACKENDS//+/} )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ static? ( !gcrypt )" #496612
+
+LIB_DEPEND="dev-libs/libgpg-error[static-libs(+)]
+ dev-libs/popt[static-libs(+)]
+ sys-apps/util-linux[static-libs(+)]
+ gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] )
+ nettle? ( >=dev-libs/nettle-2.4[static-libs(+)] )
+ openssl? ( dev-libs/openssl[static-libs(+)] )
+ sys-fs/lvm2[static-libs(+)]
+ udev? ( virtual/libudev[static-libs(+)] )"
+# We have to always depend on ${LIB_DEPEND} rather than put behind
+# !static? () because we provide a shared library which links against
+# these other packages. #414665
+RDEPEND="static-libs? ( ${LIB_DEPEND} )
+ ${LIB_DEPEND//\[static-libs\(+\)\]}
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ static? ( ${LIB_DEPEND} )"
+
+pkg_setup() {
+ local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC"
+ local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n"
+ local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n"
+ local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n"
+ check_extra_config
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die
+ epatch "${FILESDIR}"/${PN}-1.6.1-openssl-static.patch
+ eautoreconf
+}
+
+src_configure() {
+ if use kernel ; then
+ ewarn "Note that kernel backend is very slow for this type of operation"
+ ewarn "and is provided mainly for embedded systems wanting to avoid"
+ ewarn "userspace crypto libraries."
+ fi
+
+ econf \
+ --sbindir=/sbin \
+ --enable-shared \
+ $(use_enable static static-cryptsetup) \
+ $(use_enable static-libs static) \
+ $(use_enable nls) \
+ $(use_enable python) \
+ $(use_enable reencrypt cryptsetup-reencrypt) \
+ $(use_enable udev) \
+ $(use_enable !urandom dev-random) \
+ --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/}; do use ${x} && echo ${x} ; done)
+}
+
+src_test() {
+ if [[ ! -e /dev/mapper/control ]] ; then
+ ewarn "No /dev/mapper/control found -- skipping tests"
+ return 0
+ fi
+ local p
+ for p in /dev/mapper /dev/loop* ; do
+ addwrite ${p}
+ done
+ default
+}
+
+src_install() {
+ default
+ if use static ; then
+ mv "${ED}"/sbin/cryptsetup{.static,} || die
+ mv "${ED}"/sbin/veritysetup{.static,} || die
+ use reencrypt && { mv "${ED}"/sbin/cryptsetup-reencrypt{.static,} || die ; }
+ fi
+ prune_libtool_files --modules
+
+ newconfd "${FILESDIR}"/1.0.6-dmcrypt.confd dmcrypt
+ newinitd "${FILESDIR}"/1.5.1-dmcrypt.rc dmcrypt
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ elog "Please see the example for configuring a LUKS mountpoint"
+ elog "in /etc/conf.d/dmcrypt"
+ elog
+ elog "If you are using baselayout-2 then please do:"
+ elog "rc-update add dmcrypt boot"
+ elog "This version introduces a command line arguement 'key_timeout'."
+ elog "If you want the search for the removable key device to timeout"
+ elog "after 10 seconds add the following to your bootloader config:"
+ elog "key_timeout=10"
+ elog "A timeout of 0 will mean it will wait indefinitely."
+ elog
+ elog "Users using cryptsetup-1.0.x (dm-crypt plain) volumes must use"
+ elog "a compatibility mode when using cryptsetup-1.1.x. This can be"
+ elog "done by specifying the cipher (-c), key size (-s) and hash (-h)."
+ elog "For more info, see http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#6._Issues_with_Specific_Versions_of_cryptsetup"
+ fi
+}
diff --git a/sys-fs/cryptsetup/cryptsetup-1.6.5.ebuild b/sys-fs/cryptsetup/cryptsetup-1.6.5.ebuild
new file mode 100644
index 000000000000..f6e6cf711f70
--- /dev/null
+++ b/sys-fs/cryptsetup/cryptsetup-1.6.5.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools python-single-r1 linux-info libtool eutils versionator
+
+DESCRIPTION="Tool to setup encrypted devices with dm-crypt"
+HOMEPAGE="http://code.google.com/p/cryptsetup/"
+SRC_URI="http://cryptsetup.googlecode.com/files/${P}.tar.xz"
+SRC_URI="mirror://kernel/linux/utils/${PN}/v$(get_version_component_range 1-2)/${P}.tar.xz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+CRYPTO_BACKENDS="+gcrypt kernel nettle openssl"
+# we don't support nss since it doesn't allow cryptsetup to be built statically
+# and it's missing ripemd160 support so it can't provide full backward compatibility
+IUSE="${CRYPTO_BACKENDS} nls pwquality python reencrypt static static-libs udev urandom"
+REQUIRED_USE="^^ ( ${CRYPTO_BACKENDS//+/} )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ static? ( !gcrypt )" #496612
+
+LIB_DEPEND="dev-libs/libgpg-error[static-libs(+)]
+ dev-libs/popt[static-libs(+)]
+ sys-apps/util-linux[static-libs(+)]
+ gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] )
+ nettle? ( >=dev-libs/nettle-2.4[static-libs(+)] )
+ openssl? ( dev-libs/openssl[static-libs(+)] )
+ pwquality? ( dev-libs/libpwquality[static-libs(+)] )
+ sys-fs/lvm2[static-libs(+)]
+ udev? ( virtual/libudev[static-libs(+)] )"
+# We have to always depend on ${LIB_DEPEND} rather than put behind
+# !static? () because we provide a shared library which links against
+# these other packages. #414665
+RDEPEND="static-libs? ( ${LIB_DEPEND} )
+ ${LIB_DEPEND//\[static-libs\(+\)\]}
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ static? ( ${LIB_DEPEND} )"
+
+pkg_setup() {
+ local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC"
+ local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n"
+ local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n"
+ local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n"
+ check_extra_config
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die
+ epatch_user && eautoreconf
+}
+
+src_configure() {
+ if use kernel ; then
+ ewarn "Note that kernel backend is very slow for this type of operation"
+ ewarn "and is provided mainly for embedded systems wanting to avoid"
+ ewarn "userspace crypto libraries."
+ fi
+
+ econf \
+ --sbindir=/sbin \
+ --enable-shared \
+ $(use_enable static static-cryptsetup) \
+ $(use_enable static-libs static) \
+ $(use_enable nls) \
+ $(use_enable pwquality) \
+ $(use_enable python) \
+ $(use_enable reencrypt cryptsetup-reencrypt) \
+ $(use_enable udev) \
+ $(use_enable !urandom dev-random) \
+ --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/}; do use ${x} && echo ${x} ; done)
+}
+
+src_test() {
+ if [[ ! -e /dev/mapper/control ]] ; then
+ ewarn "No /dev/mapper/control found -- skipping tests"
+ return 0
+ fi
+ local p
+ for p in /dev/mapper /dev/loop* ; do
+ addwrite ${p}
+ done
+ default
+}
+
+src_install() {
+ default
+ if use static ; then
+ mv "${ED}"/sbin/cryptsetup{.static,} || die
+ mv "${ED}"/sbin/veritysetup{.static,} || die
+ use reencrypt && { mv "${ED}"/sbin/cryptsetup-reencrypt{.static,} || die ; }
+ fi
+ prune_libtool_files --modules
+
+ newconfd "${FILESDIR}"/1.0.6-dmcrypt.confd dmcrypt
+ newinitd "${FILESDIR}"/1.5.1-dmcrypt.rc dmcrypt
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ elog "Please see the example for configuring a LUKS mountpoint"
+ elog "in /etc/conf.d/dmcrypt"
+ elog
+ elog "If you are using baselayout-2 then please do:"
+ elog "rc-update add dmcrypt boot"
+ elog "This version introduces a command line arguement 'key_timeout'."
+ elog "If you want the search for the removable key device to timeout"
+ elog "after 10 seconds add the following to your bootloader config:"
+ elog "key_timeout=10"
+ elog "A timeout of 0 will mean it will wait indefinitely."
+ elog
+ elog "Users using cryptsetup-1.0.x (dm-crypt plain) volumes must use"
+ elog "a compatibility mode when using cryptsetup-1.1.x. This can be"
+ elog "done by specifying the cipher (-c), key size (-s) and hash (-h)."
+ elog "For more info, see http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#6._Issues_with_Specific_Versions_of_cryptsetup"
+ fi
+}
diff --git a/sys-fs/cryptsetup/cryptsetup-1.6.6.ebuild b/sys-fs/cryptsetup/cryptsetup-1.6.6.ebuild
new file mode 100644
index 000000000000..8a18b03c4797
--- /dev/null
+++ b/sys-fs/cryptsetup/cryptsetup-1.6.6.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools python-single-r1 linux-info libtool eutils versionator
+
+DESCRIPTION="Tool to setup encrypted devices with dm-crypt"
+HOMEPAGE="http://code.google.com/p/cryptsetup/"
+SRC_URI="http://cryptsetup.googlecode.com/files/${P}.tar.xz"
+SRC_URI="mirror://kernel/linux/utils/${PN}/v$(get_version_component_range 1-2)/${P}.tar.xz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+CRYPTO_BACKENDS="+gcrypt kernel nettle openssl"
+# we don't support nss since it doesn't allow cryptsetup to be built statically
+# and it's missing ripemd160 support so it can't provide full backward compatibility
+IUSE="${CRYPTO_BACKENDS} nls pwquality python reencrypt static static-libs udev urandom"
+REQUIRED_USE="^^ ( ${CRYPTO_BACKENDS//+/} )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ static? ( !gcrypt )" #496612
+
+LIB_DEPEND="dev-libs/libgpg-error[static-libs(+)]
+ dev-libs/popt[static-libs(+)]
+ sys-apps/util-linux[static-libs(+)]
+ gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] )
+ nettle? ( >=dev-libs/nettle-2.4[static-libs(+)] )
+ openssl? ( dev-libs/openssl[static-libs(+)] )
+ pwquality? ( dev-libs/libpwquality[static-libs(+)] )
+ sys-fs/lvm2[static-libs(+)]
+ udev? ( virtual/libudev[static-libs(+)] )"
+# We have to always depend on ${LIB_DEPEND} rather than put behind
+# !static? () because we provide a shared library which links against
+# these other packages. #414665
+RDEPEND="static-libs? ( ${LIB_DEPEND} )
+ ${LIB_DEPEND//\[static-libs\(+\)\]}
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ static? ( ${LIB_DEPEND} )"
+
+pkg_setup() {
+ local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC"
+ local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n"
+ local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n"
+ local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n"
+ check_extra_config
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die
+ epatch_user && eautoreconf
+}
+
+src_configure() {
+ if use kernel ; then
+ ewarn "Note that kernel backend is very slow for this type of operation"
+ ewarn "and is provided mainly for embedded systems wanting to avoid"
+ ewarn "userspace crypto libraries."
+ fi
+
+ econf \
+ --sbindir=/sbin \
+ --enable-shared \
+ $(use_enable static static-cryptsetup) \
+ $(use_enable static-libs static) \
+ $(use_enable nls) \
+ $(use_enable pwquality) \
+ $(use_enable python) \
+ $(use_enable reencrypt cryptsetup-reencrypt) \
+ $(use_enable udev) \
+ $(use_enable !urandom dev-random) \
+ --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/}; do use ${x} && echo ${x} ; done)
+}
+
+src_test() {
+ if [[ ! -e /dev/mapper/control ]] ; then
+ ewarn "No /dev/mapper/control found -- skipping tests"
+ return 0
+ fi
+ local p
+ for p in /dev/mapper /dev/loop* ; do
+ addwrite ${p}
+ done
+ default
+}
+
+src_install() {
+ default
+ if use static ; then
+ mv "${ED}"/sbin/cryptsetup{.static,} || die
+ mv "${ED}"/sbin/veritysetup{.static,} || die
+ use reencrypt && { mv "${ED}"/sbin/cryptsetup-reencrypt{.static,} || die ; }
+ fi
+ prune_libtool_files --modules
+
+ newconfd "${FILESDIR}"/1.0.6-dmcrypt.confd dmcrypt
+ newinitd "${FILESDIR}"/1.5.1-dmcrypt.rc dmcrypt
+}
+
+pkg_postinst() {
+ if use gcrypt ; then
+ elog "If you were using the whirlpool hash with libgcrypt, you might be impacted"
+ elog "by broken code in <libgcrypt-1.6.0 versions. See this page for more details:"
+ elog "https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#8._Issues_with_Specific_Versions_of_cryptsetup"
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ elog "Please see the example for configuring a LUKS mountpoint"
+ elog "in /etc/conf.d/dmcrypt"
+ elog
+ elog "If you are using baselayout-2 then please do:"
+ elog "rc-update add dmcrypt boot"
+ elog "This version introduces a command line arguement 'key_timeout'."
+ elog "If you want the search for the removable key device to timeout"
+ elog "after 10 seconds add the following to your bootloader config:"
+ elog "key_timeout=10"
+ elog "A timeout of 0 will mean it will wait indefinitely."
+ elog
+ elog "Users using cryptsetup-1.0.x (dm-crypt plain) volumes must use"
+ elog "a compatibility mode when using cryptsetup-1.1.x. This can be"
+ elog "done by specifying the cipher (-c), key size (-s) and hash (-h)."
+ elog "For more info, see http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#6._Issues_with_Specific_Versions_of_cryptsetup"
+ fi
+}
diff --git a/sys-fs/cryptsetup/cryptsetup-1.6.7.ebuild b/sys-fs/cryptsetup/cryptsetup-1.6.7.ebuild
new file mode 100644
index 000000000000..83cb5fdc2a88
--- /dev/null
+++ b/sys-fs/cryptsetup/cryptsetup-1.6.7.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools python-single-r1 linux-info libtool eutils versionator
+
+DESCRIPTION="Tool to setup encrypted devices with dm-crypt"
+HOMEPAGE="https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md"
+SRC_URI="mirror://kernel/linux/utils/${PN}/v$(get_version_component_range 1-2)/${P}.tar.xz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+CRYPTO_BACKENDS="+gcrypt kernel nettle openssl"
+# we don't support nss since it doesn't allow cryptsetup to be built statically
+# and it's missing ripemd160 support so it can't provide full backward compatibility
+IUSE="${CRYPTO_BACKENDS} nls pwquality python reencrypt static static-libs udev urandom"
+REQUIRED_USE="^^ ( ${CRYPTO_BACKENDS//+/} )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ static? ( !gcrypt )" #496612
+
+LIB_DEPEND="dev-libs/libgpg-error[static-libs(+)]
+ dev-libs/popt[static-libs(+)]
+ sys-apps/util-linux[static-libs(+)]
+ gcrypt? ( dev-libs/libgcrypt:0=[static-libs(+)] )
+ nettle? ( >=dev-libs/nettle-2.4[static-libs(+)] )
+ openssl? ( dev-libs/openssl[static-libs(+)] )
+ pwquality? ( dev-libs/libpwquality[static-libs(+)] )
+ sys-fs/lvm2[static-libs(+)]
+ udev? ( virtual/libudev[static-libs(+)] )"
+# We have to always depend on ${LIB_DEPEND} rather than put behind
+# !static? () because we provide a shared library which links against
+# these other packages. #414665
+RDEPEND="static-libs? ( ${LIB_DEPEND} )
+ ${LIB_DEPEND//\[static-libs\(+\)\]}
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ static? ( ${LIB_DEPEND} )"
+
+pkg_setup() {
+ local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC"
+ local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n"
+ local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n"
+ local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n"
+ check_extra_config
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ sed -i '/^LOOPDEV=/s:$: || exit 0:' tests/{compat,mode}-test || die
+ epatch_user && eautoreconf
+}
+
+src_configure() {
+ if use kernel ; then
+ ewarn "Note that kernel backend is very slow for this type of operation"
+ ewarn "and is provided mainly for embedded systems wanting to avoid"
+ ewarn "userspace crypto libraries."
+ fi
+
+ econf \
+ --sbindir=/sbin \
+ --enable-shared \
+ $(use_enable static static-cryptsetup) \
+ $(use_enable static-libs static) \
+ $(use_enable nls) \
+ $(use_enable pwquality) \
+ $(use_enable python) \
+ $(use_enable reencrypt cryptsetup-reencrypt) \
+ $(use_enable udev) \
+ $(use_enable !urandom dev-random) \
+ --with-crypto_backend=$(for x in ${CRYPTO_BACKENDS//+/} ; do usev ${x} ; done)
+}
+
+src_test() {
+ if [[ ! -e /dev/mapper/control ]] ; then
+ ewarn "No /dev/mapper/control found -- skipping tests"
+ return 0
+ fi
+ local p
+ for p in /dev/mapper /dev/loop* ; do
+ addwrite ${p}
+ done
+ default
+}
+
+src_install() {
+ default
+ if use static ; then
+ mv "${ED}"/sbin/cryptsetup{.static,} || die
+ mv "${ED}"/sbin/veritysetup{.static,} || die
+ use reencrypt && { mv "${ED}"/sbin/cryptsetup-reencrypt{.static,} || die ; }
+ fi
+ prune_libtool_files --modules
+
+ newconfd "${FILESDIR}"/1.6.7-dmcrypt.confd dmcrypt
+ newinitd "${FILESDIR}"/1.6.7-dmcrypt.rc dmcrypt
+}
diff --git a/sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd b/sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd
new file mode 100644
index 000000000000..0f6b554ae8a7
--- /dev/null
+++ b/sys-fs/cryptsetup/files/1.0.6-dmcrypt.confd
@@ -0,0 +1,105 @@
+# /etc/conf.d/dmcrypt
+
+# For people who run dmcrypt on top of some other layer (like raid),
+# use rc_need to specify that requirement. See the runscript(8) man
+# page for more information.
+
+#--------------------
+# Instructions
+#--------------------
+
+# Note regarding the syntax of this file. This file is *almost* bash,
+# but each line is evaluated separately. Separate swaps/targets can be
+# specified. The init-script which reads this file assumes that a
+# swap= or target= line starts a new section, similar to lilo or grub
+# configuration.
+
+# Note when using gpg keys and /usr on a separate partition, you will
+# have to copy /usr/bin/gpg to /bin/gpg so that it will work properly
+# and ensure that gpg has been compiled statically.
+# See http://bugs.gentoo.org/90482 for more information.
+
+# Note that the init-script which reads this file detects whether your
+# partition is LUKS or not. No mkfs is run unless you specify a makefs
+# option.
+
+# Global options:
+#----------------
+
+# Max number of checks to perform (1 per second)
+#dmcrypt_max_timeout=120
+
+# Arguments:
+#-----------
+# target=<name> == Mapping name for partition.
+# swap=<name> == Mapping name for swap partition.
+# source='<dev>' == Real device for partition.
+# Note: You can (and should) specify a tag like UUID
+# for blkid (see -t option). This is safer than using
+# the full path to the device.
+# key='</path/to/keyfile>[:<mode>]' == Fullpath from / or from inside removable media.
+# remdev='<dev>' == Device that will be assigned to removable media.
+# gpg_options='<opts>' == Default are --quiet --decrypt
+# options='<opts>' == cryptsetup, for LUKS you can only use --readonly
+# loop_file='<file>' == Loopback file.
+# Note: If you omit $source, then a free loopback will
+# be looked up automatically.
+# pre_mount='cmds' == commands to execute before mounting partition.
+# post_mount='cmds' == commands to execute after mounting partition.
+#-----------
+# Supported Modes
+# gpg == decrypt and pipe key into cryptsetup.
+# Note: new-line character must not be part of key.
+# Command to erase \n char: 'cat key | tr -d '\n' > cleanKey'
+
+#--------------------
+# dm-crypt examples
+#--------------------
+
+## swap
+# Swap partitions. These should come first so that no keys make their
+# way into unencrypted swap.
+# If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom
+# If no makefs is given then mkswap will be assumed
+#swap=crypt-swap
+#source='/dev/hda2'
+
+## /home with passphrase
+#target=crypt-home
+#source='/dev/hda5'
+
+## /home with regular keyfile
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey'
+
+## /home with gpg protected key
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey:gpg'
+
+## /home with regular keyfile on removable media(such as usb-stick)
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey'
+#remdev='/dev/sda1'
+
+##/home with gpg protected key on removable media(such as usb-stick)
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey:gpg'
+#remdev='/dev/sda1'
+
+##/tmp with regular keyfile
+#target=crypt-tmp
+#source='/dev/hda6'
+#key='/full/path/to/tmpkey'
+#pre_mount='/sbin/mkreiserfs -f -f ${dev}'
+#post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}'
+
+## Loopback file example
+#target='crypt-loop-home'
+#source='/dev/loop0'
+#loop_file='/mnt/crypt/home'
+
+# The file must be terminated by a newline. Or leave this comment last.
diff --git a/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc b/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc
new file mode 100755
index 000000000000..b6db91036040
--- /dev/null
+++ b/sys-fs/cryptsetup/files/1.5.1-dmcrypt.rc
@@ -0,0 +1,335 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before checkfs fsck
+
+ if grep -qs ^swap= "${conf_file}" ; then
+ before swap
+ fi
+}
+
+# We support multiple dmcrypt instances based on $SVCNAME
+conf_file="/etc/conf.d/${SVCNAME}"
+
+# Get splash helpers if available.
+if [ -e /sbin/splash-functions.sh ] ; then
+ . /sbin/splash-functions.sh
+fi
+
+# Setup mappings for an individual target/swap
+# Note: This relies on variables localized in the main body below.
+dm_crypt_execute() {
+ local dev ret mode foo
+
+ if [ -z "${target}" -a -z "${swap}" ] ; then
+ return
+ fi
+
+ # Handle automatic look up of the source path.
+ if [ -z "${source}" -a -n "${loop_file}" ] ; then
+ source=$(losetup --show -f "${loop_file}")
+ fi
+ case ${source} in
+ *=*)
+ source=$(blkid -l -t "${source}" -o device)
+ ;;
+ esac
+ if [ -z "${source}" ] || [ ! -e "${source}" ] ; then
+ ewarn "source \"${source}\" for ${target} missing, skipping..."
+ return
+ fi
+
+ if [ -n "${target}" ] ; then
+ # let user set options, otherwise leave empty
+ : ${options:=' '}
+ elif [ -n "${swap}" ] ; then
+ if cryptsetup isLuks ${source} 2>/dev/null ; then
+ ewarn "The swap you have defined is a LUKS partition. Aborting crypt-swap setup."
+ return
+ fi
+ target=${swap}
+ # swap contents do not need to be preserved between boots, luks not required.
+ # suspend2 users should have initramfs's init handling their swap partition either way.
+ : ${options:='-c aes -h sha1 -d /dev/urandom'}
+ : ${pre_mount:='mkswap ${dev}'}
+ fi
+
+ if [ -n "${loop_file}" ] ; then
+ dev="/dev/mapper/${target}"
+ ebegin " Setting up loop device ${source}"
+ losetup ${source} ${loop_file}
+ fi
+
+ # cryptsetup:
+ # open <device> <name> # <device> is $source
+ # create <name> <device> # <name> is $target
+ local arg1="create" arg2="${target}" arg3="${source}"
+ if cryptsetup isLuks ${source} 2>/dev/null ; then
+ arg1="open"
+ arg2="${source}"
+ arg3="${target}"
+ fi
+
+ # Older versions reported:
+ # ${target} is active:
+ # Newer versions report:
+ # ${target} is active[ and is in use.]
+ if cryptsetup status ${target} | egrep -q ' is active' ; then
+ einfo "dm-crypt mapping ${target} is already configured"
+ return
+ fi
+ splash svc_input_begin ${SVCNAME} >/dev/null 2>&1
+
+ # Handle keys
+ if [ -n "${key}" ] ; then
+ read_abort() {
+ # some colors
+ local ans savetty resettty
+ [ -z "${NORMAL}" ] && eval $(eval_ecolors)
+ einfon " $1? (${WARN}yes${NORMAL}/${GOOD}No${NORMAL}) "
+ shift
+ # This is ugly as s**t. But POSIX doesn't provide `read -t`, so
+ # we end up having to implement our own crap with stty/etc...
+ savetty=$(stty -g)
+ resettty='stty ${savetty}; trap - EXIT HUP INT TERM'
+ trap 'eval "${resettty}"' EXIT HUP INT TERM
+ stty -icanon
+ [ "${1}" = -t ] && stty min 0 time "$(( $2 * 10 ))"
+ ans=$(dd count=1 bs=1 2>/dev/null) || ans=''
+ eval "${resettty}"
+ if [ -z "${ans}" ] ; then
+ printf '\r'
+ else
+ echo
+ fi
+ case ${ans} in
+ [yY]) return 0;;
+ *) return 1;;
+ esac
+ }
+
+ # Notes: sed not used to avoid case where /usr partition is encrypted.
+ mode=${key##*:} && ( [ "${mode}" = "${key}" ] || [ -z "${mode}" ] ) && mode=reg
+ key=${key%:*}
+ case "${mode}" in
+ gpg|reg)
+ # handle key on removable device
+ if [ -n "${remdev}" ] ; then
+ # temp directory to mount removable device
+ local mntrem="${RC_SVCDIR}/dm-crypt-remdev.$$"
+ if [ ! -d "${mntrem}" ] ; then
+ if ! mkdir -p "${mntrem}" ; then
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: Unable to create temporary mount point '${mntrem}'"
+ return
+ fi
+ fi
+ i=0
+ einfo "Please insert removable device for ${target}"
+ while [ ${i} -lt ${dmcrypt_max_timeout:-120} ] ; do
+ foo=""
+ if mount -n -o ro "${remdev}" "${mntrem}" 2>/dev/null >/dev/null ; then
+ # keyfile exists?
+ if [ ! -e "${mntrem}${key}" ] ; then
+ umount -n "${mntrem}"
+ rmdir "${mntrem}"
+ einfo "Cannot find ${key} on removable media."
+ read_abort "Abort" ${read_timeout:--t 1} && return
+ else
+ key="${mntrem}${key}"
+ break
+ fi
+ else
+ [ -e "${remdev}" ] \
+ && foo="mount failed" \
+ || foo="mount source not found"
+ fi
+ : $((i += 1))
+ read_abort "Stop waiting after $i attempts (${foo})" -t 1 && return
+ done
+ else # keyfile ! on removable device
+ if [ ! -e "${key}" ] ; then
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: keyfile ${key} does not exist."
+ return
+ fi
+ fi
+ ;;
+ *)
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: mode ${mode} is invalid."
+ return
+ ;;
+ esac
+ else
+ mode=none
+ fi
+ ebegin " ${target} using: ${options} ${arg1} ${arg2} ${arg3}"
+ if [ "${mode}" = "gpg" ] ; then
+ : ${gpg_options:='-q -d'}
+ # gpg available ?
+ if command -v gpg >/dev/null ; then
+ for i in 0 1 2 ; do
+ # paranoid, don't store key in a variable, pipe it so it stays very little in ram unprotected.
+ # save stdin stdout stderr "values"
+ gpg ${gpg_options} ${key} 2>/dev/null | cryptsetup --key-file - ${options} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ [ ${ret} -eq 0 ] && break
+ done
+ eend ${ret} "failure running cryptsetup"
+ else
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: cannot find gpg application."
+ einfo "You have to install app-crypt/gnupg first."
+ einfo "If you have /usr on its own partition, try copying gpg to /bin ."
+ fi
+ else
+ if [ "${mode}" = "reg" ] ; then
+ cryptsetup ${options} -d ${key} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ eend ${ret} "failure running cryptsetup"
+ else
+ cryptsetup ${options} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ eend ${ret} "failure running cryptsetup"
+ fi
+ fi
+ if [ -d "${mntrem}" ] ; then
+ umount -n ${mntrem} 2>/dev/null >/dev/null
+ rmdir ${mntrem} 2>/dev/null >/dev/null
+ fi
+ splash svc_input_end ${SVCNAME} >/dev/null 2>&1
+
+ if [ ${ret} -ne 0 ] ; then
+ cryptfs_status=1
+ else
+ if [ -n "${pre_mount}" ] ; then
+ dev="/dev/mapper/${target}"
+ eval ebegin \"" pre_mount: ${pre_mount}"\"
+ eval "${pre_mount}" > /dev/null
+ ewend $? || cryptfs_status=1
+ fi
+ fi
+}
+
+# Lookup optional bootparams
+get_bootparam_val() {
+ # We're given something like:
+ # foo=bar=cow
+ # Return the "bar=cow" part.
+ case $1 in
+ *\=*)
+ local key=$(echo "$1" | cut -f1 -d=)
+ echo "$1" | cut -c $(( ${#key} + 2 ))
+ ;;
+ esac
+}
+
+start() {
+ local header=true cryptfs_status=0
+ local gpg_options key loop_file target targetline options pre_mount post_mount source swap remdev
+
+ local x
+ for x in $(cat /proc/cmdline) ; do
+ case "${x}" in
+ key_timeout\=*)
+ local KEY_TIMEOUT=$(get_bootparam_val "${x}")
+ if [ ${KEY_TIMEOUT} -gt 0 ] ; then
+ read_timeout="-t ${KEY_TIMEOUT}"
+ fi
+ ;;
+ esac
+ done
+
+ while read targetline <&3 ; do
+ case ${targetline} in
+ # skip comments and blank lines
+ ""|"#"*) continue ;;
+ # skip service-specific openrc configs #377927
+ rc_*) continue ;;
+ esac
+
+ ${header} && ebegin "Setting up dm-crypt mappings"
+ header=false
+
+ # check for the start of a new target/swap
+ case ${targetline} in
+ target=*|swap=*)
+ # If we have a target queued up, then execute it
+ dm_crypt_execute
+
+ # Prepare for the next target/swap by resetting variables
+ unset gpg_options key loop_file target options pre_mount post_mount source swap remdev
+ ;;
+
+ gpg_options=*|remdev=*|key=*|loop_file=*|options=*|pre_mount=*|post_mount=*|source=*)
+ if [ -z "${target}${swap}" ] ; then
+ ewarn "Ignoring setting outside target/swap section: ${targetline}"
+ continue
+ fi
+ ;;
+
+ dmcrypt_max_timeout=*)
+ # ignore global options
+ continue
+ ;;
+
+ *)
+ ewarn "Skipping invalid line in ${conf_file}: ${targetline}"
+ ;;
+ esac
+
+ # Queue this setting for the next call to dm_crypt_execute
+ eval "${targetline}"
+ done 3< ${conf_file}
+
+ # If we have a target queued up, then execute it
+ dm_crypt_execute
+
+ ewend ${cryptfs_status} "Failed to setup dm-crypt devices"
+}
+
+stop() {
+ local line header
+
+ # Break down all mappings
+ header=true
+ egrep "^(target|swap)=" ${conf_file} | \
+ while read line ; do
+ ${header} && einfo "Removing dm-crypt mappings"
+ header=false
+
+ target= swap=
+ eval ${line}
+
+ [ -n "${swap}" ] && target=${swap}
+ if [ -z "${target}" ] ; then
+ ewarn "invalid line in ${conf_file}: ${line}"
+ continue
+ fi
+
+ ebegin " ${target}"
+ cryptsetup remove ${target}
+ eend $?
+ done
+
+ # Break down loop devices
+ header=true
+ grep '^source=./dev/loop' ${conf_file} | \
+ while read line ; do
+ ${header} && einfo "Detaching dm-crypt loop devices"
+ header=false
+
+ source=
+ eval ${line}
+
+ ebegin " ${source}"
+ losetup -d "${source}"
+ eend $?
+ done
+
+ return 0
+}
diff --git a/sys-fs/cryptsetup/files/1.6.7-dmcrypt.confd b/sys-fs/cryptsetup/files/1.6.7-dmcrypt.confd
new file mode 100644
index 000000000000..642ff087078b
--- /dev/null
+++ b/sys-fs/cryptsetup/files/1.6.7-dmcrypt.confd
@@ -0,0 +1,111 @@
+# /etc/conf.d/dmcrypt
+
+# For people who run dmcrypt on top of some other layer (like raid),
+# use rc_need to specify that requirement. See the runscript(8) man
+# page for more information.
+
+#--------------------
+# Instructions
+#--------------------
+
+# Note regarding the syntax of this file. This file is *almost* bash,
+# but each line is evaluated separately. Separate swaps/targets can be
+# specified. The init-script which reads this file assumes that a
+# swap= or target= line starts a new section, similar to lilo or grub
+# configuration.
+
+# Note when using gpg keys and /usr on a separate partition, you will
+# have to copy /usr/bin/gpg to /bin/gpg so that it will work properly
+# and ensure that gpg has been compiled statically.
+# See http://bugs.gentoo.org/90482 for more information.
+
+# Note that the init-script which reads this file detects whether your
+# partition is LUKS or not. No mkfs is run unless you specify a makefs
+# option.
+
+# Global options:
+#----------------
+
+# How long to wait for each timeout (in seconds).
+dmcrypt_key_timeout=1
+
+# Max number of checks to perform (see dmcrypt_key_timeout).
+#dmcrypt_max_timeout=300
+
+# Number of password retries.
+dmcrypt_retries=5
+
+# Arguments:
+#-----------
+# target=<name> == Mapping name for partition.
+# swap=<name> == Mapping name for swap partition.
+# source='<dev>' == Real device for partition.
+# Note: You can (and should) specify a tag like UUID
+# for blkid (see -t option). This is safer than using
+# the full path to the device.
+# key='</path/to/keyfile>[:<mode>]' == Fullpath from / or from inside removable media.
+# remdev='<dev>' == Device that will be assigned to removable media.
+# gpg_options='<opts>' == Default are --quiet --decrypt
+# options='<opts>' == cryptsetup, for LUKS you can only use --readonly
+# loop_file='<file>' == Loopback file.
+# Note: If you omit $source, then a free loopback will
+# be looked up automatically.
+# pre_mount='cmds' == commands to execute before mounting partition.
+# post_mount='cmds' == commands to execute after mounting partition.
+#-----------
+# Supported Modes
+# gpg == decrypt and pipe key into cryptsetup.
+# Note: new-line character must not be part of key.
+# Command to erase \n char: 'cat key | tr -d '\n' > cleanKey'
+
+#--------------------
+# dm-crypt examples
+#--------------------
+
+## swap
+# Swap partitions. These should come first so that no keys make their
+# way into unencrypted swap.
+# If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom
+# If no makefs is given then mkswap will be assumed
+#swap=crypt-swap
+#source='/dev/hda2'
+
+## /home with passphrase
+#target=crypt-home
+#source='/dev/hda5'
+
+## /home with regular keyfile
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey'
+
+## /home with gpg protected key
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey:gpg'
+
+## /home with regular keyfile on removable media(such as usb-stick)
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey'
+#remdev='/dev/sda1'
+
+## /home with gpg protected key on removable media(such as usb-stick)
+#target=crypt-home
+#source='/dev/hda5'
+#key='/full/path/to/homekey:gpg'
+#remdev='/dev/sda1'
+
+## /tmp with regular keyfile
+#target=crypt-tmp
+#source='/dev/hda6'
+#key='/full/path/to/tmpkey'
+#pre_mount='/sbin/mkreiserfs -f -f ${dev}'
+#post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}'
+
+## Loopback file example
+#target='crypt-loop-home'
+#source='/dev/loop0'
+#loop_file='/mnt/crypt/home'
+
+# The file must be terminated by a newline. Or leave this comment last.
diff --git a/sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc b/sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc
new file mode 100755
index 000000000000..e52ad68b94c2
--- /dev/null
+++ b/sys-fs/cryptsetup/files/1.6.7-dmcrypt.rc
@@ -0,0 +1,340 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before checkfs fsck
+
+ if grep -qs ^swap= "${conf_file}" ; then
+ before swap
+ fi
+}
+
+# We support multiple dmcrypt instances based on $SVCNAME
+conf_file="/etc/conf.d/${SVCNAME}"
+
+# Get splash helpers if available.
+if [ -e /sbin/splash-functions.sh ] ; then
+ . /sbin/splash-functions.sh
+fi
+
+# Setup mappings for an individual target/swap
+# Note: This relies on variables localized in the main body below.
+dm_crypt_execute() {
+ local dev ret mode foo
+
+ if [ -z "${target}" -a -z "${swap}" ] ; then
+ return
+ fi
+
+ # Set up default values.
+ : ${dmcrypt_key_timeout:=1}
+ : ${dmcrypt_max_timeout:=300}
+ : ${dmcrypt_retries:=5}
+
+ # Handle automatic look up of the source path.
+ if [ -z "${source}" -a -n "${loop_file}" ] ; then
+ source=$(losetup --show -f "${loop_file}")
+ fi
+ case ${source} in
+ *=*)
+ source=$(blkid -l -t "${source}" -o device)
+ ;;
+ esac
+ if [ -z "${source}" ] || [ ! -e "${source}" ] ; then
+ ewarn "source \"${source}\" for ${target} missing, skipping..."
+ return
+ fi
+
+ if [ -n "${target}" ] ; then
+ # let user set options, otherwise leave empty
+ : ${options:=' '}
+ elif [ -n "${swap}" ] ; then
+ if cryptsetup isLuks ${source} 2>/dev/null ; then
+ ewarn "The swap you have defined is a LUKS partition. Aborting crypt-swap setup."
+ return
+ fi
+ target=${swap}
+ # swap contents do not need to be preserved between boots, luks not required.
+ # suspend2 users should have initramfs's init handling their swap partition either way.
+ : ${options:='-c aes -h sha1 -d /dev/urandom'}
+ : ${pre_mount:='mkswap ${dev}'}
+ fi
+
+ if [ -n "${loop_file}" ] ; then
+ dev="/dev/mapper/${target}"
+ ebegin " Setting up loop device ${source}"
+ losetup ${source} ${loop_file}
+ fi
+
+ # cryptsetup:
+ # open <device> <name> # <device> is $source
+ # create <name> <device> # <name> is $target
+ local arg1="create" arg2="${target}" arg3="${source}"
+ if cryptsetup isLuks ${source} 2>/dev/null ; then
+ arg1="open"
+ arg2="${source}"
+ arg3="${target}"
+ fi
+
+ # Older versions reported:
+ # ${target} is active:
+ # Newer versions report:
+ # ${target} is active[ and is in use.]
+ if cryptsetup status ${target} | egrep -q ' is active' ; then
+ einfo "dm-crypt mapping ${target} is already configured"
+ return
+ fi
+ splash svc_input_begin ${SVCNAME} >/dev/null 2>&1
+
+ # Handle keys
+ if [ -n "${key}" ] ; then
+ read_abort() {
+ # some colors
+ local ans savetty resettty
+ [ -z "${NORMAL}" ] && eval $(eval_ecolors)
+ einfon " $1? (${WARN}yes${NORMAL}/${GOOD}No${NORMAL}) "
+ shift
+ # This is ugly as s**t. But POSIX doesn't provide `read -t`, so
+ # we end up having to implement our own crap with stty/etc...
+ savetty=$(stty -g)
+ resettty='stty ${savetty}; trap - EXIT HUP INT TERM'
+ trap 'eval "${resettty}"' EXIT HUP INT TERM
+ stty -icanon
+ stty min 0 time "$(( $2 * 10 ))"
+ ans=$(dd count=1 bs=1 2>/dev/null) || ans=''
+ eval "${resettty}"
+ if [ -z "${ans}" ] ; then
+ printf '\r'
+ else
+ echo
+ fi
+ case ${ans} in
+ [yY]) return 0;;
+ *) return 1;;
+ esac
+ }
+
+ # Notes: sed not used to avoid case where /usr partition is encrypted.
+ mode=${key##*:} && ( [ "${mode}" = "${key}" ] || [ -z "${mode}" ] ) && mode=reg
+ key=${key%:*}
+ case "${mode}" in
+ gpg|reg)
+ # handle key on removable device
+ if [ -n "${remdev}" ] ; then
+ # temp directory to mount removable device
+ local mntrem="${RC_SVCDIR}/dm-crypt-remdev.$$"
+ if [ ! -d "${mntrem}" ] ; then
+ if ! mkdir -p "${mntrem}" ; then
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: Unable to create temporary mount point '${mntrem}'"
+ return
+ fi
+ fi
+ i=0
+ einfo "Please insert removable device for ${target}"
+ while [ ${i} -lt ${dmcrypt_max_timeout} ] ; do
+ foo=""
+ if mount -n -o ro "${remdev}" "${mntrem}" 2>/dev/null >/dev/null ; then
+ # keyfile exists?
+ if [ ! -e "${mntrem}${key}" ] ; then
+ umount -n "${mntrem}"
+ rmdir "${mntrem}"
+ einfo "Cannot find ${key} on removable media."
+ read_abort "Abort" ${dmcrypt_key_timeout} && return
+ else
+ key="${mntrem}${key}"
+ break
+ fi
+ else
+ [ -e "${remdev}" ] \
+ && foo="mount failed" \
+ || foo="mount source not found"
+ fi
+ : $((i += 1))
+ read_abort "Stop waiting after $i attempts (${foo})" -t 1 && return
+ done
+ else # keyfile ! on removable device
+ if [ ! -e "${key}" ] ; then
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: keyfile ${key} does not exist."
+ return
+ fi
+ fi
+ ;;
+ *)
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: mode ${mode} is invalid."
+ return
+ ;;
+ esac
+ else
+ mode=none
+ fi
+ ebegin " ${target} using: ${options} ${arg1} ${arg2} ${arg3}"
+ if [ "${mode}" = "gpg" ] ; then
+ : ${gpg_options:='-q -d'}
+ # gpg available ?
+ if command -v gpg >/dev/null ; then
+ i=0
+ while [ ${i} -lt ${dmcrypt_retries} ] ; do
+ # paranoid, don't store key in a variable, pipe it so it stays very little in ram unprotected.
+ # save stdin stdout stderr "values"
+ timeout ${dmcrypt_max_timeout} gpg ${gpg_options} ${key} 2>/dev/null | \
+ cryptsetup --key-file - ${options} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ # The timeout command exits 124 when it times out.
+ [ ${ret} -eq 0 -o ${ret} -eq 124 ] && break
+ : $(( i += 1 ))
+ done
+ eend ${ret} "failure running cryptsetup"
+ else
+ ewarn "${source} will not be decrypted ..."
+ einfo "Reason: cannot find gpg application."
+ einfo "You have to install app-crypt/gnupg first."
+ einfo "If you have /usr on its own partition, try copying gpg to /bin ."
+ fi
+ else
+ if [ "${mode}" = "reg" ] ; then
+ cryptsetup ${options} -d ${key} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ eend ${ret} "failure running cryptsetup"
+ else
+ cryptsetup ${options} ${arg1} ${arg2} ${arg3}
+ ret=$?
+ eend ${ret} "failure running cryptsetup"
+ fi
+ fi
+ if [ -d "${mntrem}" ] ; then
+ umount -n ${mntrem} 2>/dev/null >/dev/null
+ rmdir ${mntrem} 2>/dev/null >/dev/null
+ fi
+ splash svc_input_end ${SVCNAME} >/dev/null 2>&1
+
+ if [ ${ret} -ne 0 ] ; then
+ cryptfs_status=1
+ else
+ if [ -n "${pre_mount}" ] ; then
+ dev="/dev/mapper/${target}"
+ eval ebegin \"" pre_mount: ${pre_mount}"\"
+ eval "${pre_mount}" > /dev/null
+ ewend $? || cryptfs_status=1
+ fi
+ fi
+}
+
+# Lookup optional bootparams
+get_bootparam_val() {
+ # We're given something like:
+ # foo=bar=cow
+ # Return the "bar=cow" part.
+ case $1 in
+ *=*)
+ echo "${1#*=}"
+ ;;
+ esac
+}
+
+start() {
+ local header=true cryptfs_status=0
+ local gpg_options key loop_file target targetline options pre_mount post_mount source swap remdev
+
+ local x
+ for x in $(cat /proc/cmdline) ; do
+ case "${x}" in
+ key_timeout=*)
+ dmcrypt_key_timeout=$(get_bootparam_val "${x}")
+ ;;
+ esac
+ done
+
+ while read targetline <&3 ; do
+ case ${targetline} in
+ # skip comments and blank lines
+ ""|"#"*) continue ;;
+ # skip service-specific openrc configs #377927
+ rc_*) continue ;;
+ esac
+
+ ${header} && ebegin "Setting up dm-crypt mappings"
+ header=false
+
+ # check for the start of a new target/swap
+ case ${targetline} in
+ target=*|swap=*)
+ # If we have a target queued up, then execute it
+ dm_crypt_execute
+
+ # Prepare for the next target/swap by resetting variables
+ unset gpg_options key loop_file target options pre_mount post_mount source swap remdev
+ ;;
+
+ gpg_options=*|remdev=*|key=*|loop_file=*|options=*|pre_mount=*|post_mount=*|source=*)
+ if [ -z "${target}${swap}" ] ; then
+ ewarn "Ignoring setting outside target/swap section: ${targetline}"
+ continue
+ fi
+ ;;
+
+ dmcrypt_*=*)
+ # ignore global options
+ continue
+ ;;
+
+ *)
+ ewarn "Skipping invalid line in ${conf_file}: ${targetline}"
+ ;;
+ esac
+
+ # Queue this setting for the next call to dm_crypt_execute
+ eval "${targetline}"
+ done 3< ${conf_file}
+
+ # If we have a target queued up, then execute it
+ dm_crypt_execute
+
+ ewend ${cryptfs_status} "Failed to setup dm-crypt devices"
+}
+
+stop() {
+ local line header
+
+ # Break down all mappings
+ header=true
+ egrep "^(target|swap)=" ${conf_file} | \
+ while read line ; do
+ ${header} && einfo "Removing dm-crypt mappings"
+ header=false
+
+ target= swap=
+ eval ${line}
+
+ [ -n "${swap}" ] && target=${swap}
+ if [ -z "${target}" ] ; then
+ ewarn "invalid line in ${conf_file}: ${line}"
+ continue
+ fi
+
+ ebegin " ${target}"
+ cryptsetup remove ${target}
+ eend $?
+ done
+
+ # Break down loop devices
+ header=true
+ grep '^source=./dev/loop' ${conf_file} | \
+ while read line ; do
+ ${header} && einfo "Detaching dm-crypt loop devices"
+ header=false
+
+ source=
+ eval ${line}
+
+ ebegin " ${source}"
+ losetup -d "${source}"
+ eend $?
+ done
+
+ return 0
+}
diff --git a/sys-fs/cryptsetup/files/cryptsetup-1.6.1-openssl-static.patch b/sys-fs/cryptsetup/files/cryptsetup-1.6.1-openssl-static.patch
new file mode 100644
index 000000000000..e479a305c310
--- /dev/null
+++ b/sys-fs/cryptsetup/files/cryptsetup-1.6.1-openssl-static.patch
@@ -0,0 +1,13 @@
+--- a/configure.ac 2013-03-24 05:02:02.000000000 -0400
++++ b/configure.ac 2013-08-06 15:57:57.844461481 -0400
+@@ -149,8 +149,8 @@
+ if test x$enable_static_cryptsetup = xyes; then
+ saved_PKG_CONFIG=$PKG_CONFIG
+ PKG_CONFIG="$PKG_CONFIG --static"
+- PKG_CHECK_MODULES([OPENSSL], [openssl])
+- CRYPTO_STATIC_LIBS=$OPENSSL_LIBS
++ PKG_CHECK_MODULES([OPENSSL_STATIC], [openssl])
++ CRYPTO_STATIC_LIBS=$OPENSSL_STATIC_LIBS
+ PKG_CONFIG=$saved_PKG_CONFIG
+ fi
+ NO_FIPS([])
diff --git a/sys-fs/cryptsetup/metadata.xml b/sys-fs/cryptsetup/metadata.xml
new file mode 100644
index 000000000000..17bad91dcee8
--- /dev/null
+++ b/sys-fs/cryptsetup/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <use>
+ <flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> crypto backend</flag>
+ <flag name="kernel">Use kernel crypto backend (mainly for embedded systems)</flag>
+ <flag name="nettle">Use <pkg>dev-libs/nettle</pkg> crypto backend</flag>
+ <flag name="openssl">Use <pkg>dev-libs/openssl</pkg> crypto backend</flag>
+ <flag name="pwquality">Use <pkg>dev-libs/libpwquality</pkg> for password quality checking</flag>
+ <flag name="urandom">Use /dev/urandom instead of /dev/random</flag>
+ <flag name="reencrypt">Build cryptsetup-reencrypt</flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">cryptsetup</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/davl/Manifest b/sys-fs/davl/Manifest
new file mode 100644
index 000000000000..600c6a67cdee
--- /dev/null
+++ b/sys-fs/davl/Manifest
@@ -0,0 +1 @@
+DIST davl-1.2.4.tar.bz2 47539 SHA256 d0a1b0a2528ff029374c5019b04140ca3a99baacb9576cbaa5ee4e87e6c34fb5 SHA512 71c33c0bfaca7c7557541517ec9e7b084e4d50e7504e02d412442566c6046c8a68fe4020e05a3e2da5c9309bd75ba06abba8f16fad96b476b5c961814d24d602 WHIRLPOOL 9378bbf5e47bce2afb8f7038914b535839da03b65e713072303b5efb23e035b792b82dae6233d0a9eb8730094294009d10f331c2099994019224ddbf6c71dbe4
diff --git a/sys-fs/davl/davl-1.2.4-r1.ebuild b/sys-fs/davl/davl-1.2.4-r1.ebuild
new file mode 100644
index 000000000000..a7707c75d755
--- /dev/null
+++ b/sys-fs/davl/davl-1.2.4-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Visualizes the fragmentation status of ext2/3 filesystems"
+HOMEPAGE="http://davl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=x11-libs/gtk+-2.6:2"
+DEPEND="${RDEPEND}
+ >=sys-fs/e2fsprogs-1.41.7-r1
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.2.1-asneeded.patch \
+ "${FILESDIR}"/${P}-fragment.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dobin src/{cdavl/cdavl,gdavl/gdavl}
+ dodoc README
+ doman doc/*.8
+}
diff --git a/sys-fs/davl/files/davl-1.2.1-asneeded.patch b/sys-fs/davl/files/davl-1.2.1-asneeded.patch
new file mode 100644
index 000000000000..e7c1c925bbac
--- /dev/null
+++ b/sys-fs/davl/files/davl-1.2.1-asneeded.patch
@@ -0,0 +1,41 @@
+--- src/cdavl/Makefile
++++ src/cdavl/Makefile
+@@ -4,10 +4,6 @@
+ include $(PATH_LIST)
+
+
+-CC = gcc
+-DEBUG =
+-#DEBUG = -DDEBUG
+-CFLAGS = -Wall -g -O -D_FILE_OFFSET_BITS=64 $(DEBUG)
+ HEADERS = cdavl.h ../common/util.h ../drv/liveinfo_app.h
+ OBJS = ../common/util.o
+ CDAVL = cdavl
+--- src/gdavl/Makefile
++++ src/gdavl/Makefile
+@@ -4,22 +4,14 @@
+ include $(PATH_LIST)
+
+
+-CC = gcc
+-CFLAGS1 = -Wall -g -O `gtk-config --cflags --libs`
+-CFLAGS2 = -Wall -g -O `pkg-config --cflags --libs gtk+-2.0`
+-CFLAGS = -D$(GTK_VER)
+-ifeq ($(GTK_VER), GTK2)
+- CFLAGS += $(CFLAGS2)
+-else
+- CFLAGS += $(CFLAGS1)
+-endif
++CFLAGS += -D$(GTK_VER) `pkg-config --cflags gtk+-2.0`
++LDLIBS = `pkg-config --libs gtk+-2.0`
+ DEBUG =
+ #DEBUG = -D DEBUG
+ GDAVL = gdavl
+
+
+-$(GDAVL): gdavl.c if.c gdavl.h
+- $(CC) $(CFLAGS) $(DEBUG) -o $(GDAVL) gdavl.c if.c
++$(GDAVL): gdavl.o if.o
+
+ clean:
+ rm -rf $(GDAVL) *.o test/*.png test/log test/test.log
diff --git a/sys-fs/davl/files/davl-1.2.4-fragment.patch b/sys-fs/davl/files/davl-1.2.4-fragment.patch
new file mode 100644
index 000000000000..2b5e9338700c
--- /dev/null
+++ b/sys-fs/davl/files/davl-1.2.4-fragment.patch
@@ -0,0 +1,20 @@
+cdavl.c:101:53: error: ‘struct ext2_super_block’ has no member named ‘s_log_frag_size’
+cdavl.c:105:53: error: ‘struct ext2_super_block’ has no member named ‘s_frags_per_group’
+
+http://bugs.gentoo.org/425820
+
+--- src/cdavl/cdavl.c
++++ src/cdavl/cdavl.c
+@@ -98,9 +98,11 @@
+ PRINT4("s_free_inodes_count: ", le32_to_cpu(sb->s_free_inodes_count));
+ PRINT4("s_first_data_block: ", le32_to_cpu(sb->s_first_data_block));
+ PRINT4("s_log_block_size: ", le32_to_cpu(sb->s_log_block_size));
++ #if 0
+ PRINT4("s_log_frag_size: ", le32_to_cpu(sb->s_log_frag_size));
+- PRINT4("s_blocks_per_group: ", le32_to_cpu(sb->s_blocks_per_group));
+ PRINT4("s_frags_per_group: ", le32_to_cpu(sb->s_frags_per_group));
++ #endif
++ PRINT4("s_blocks_per_group: ", le32_to_cpu(sb->s_blocks_per_group));
+ PRINT4("s_inodes_per_group: ", le32_to_cpu(sb->s_inodes_per_group));
+ PRINT4("s_mtime: ", le32_to_cpu(sb->s_mtime));
+ PRINT4("s_wtime: ", le32_to_cpu(sb->s_wtime));
diff --git a/sys-fs/davl/metadata.xml b/sys-fs/davl/metadata.xml
new file mode 100644
index 000000000000..37613359a0b7
--- /dev/null
+++ b/sys-fs/davl/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>armin76@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">davl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/dd-rescue/Manifest b/sys-fs/dd-rescue/Manifest
new file mode 100644
index 000000000000..6c917590c385
--- /dev/null
+++ b/sys-fs/dd-rescue/Manifest
@@ -0,0 +1,6 @@
+DIST dd_rescue-1.28.tar.gz 22093 SHA256 4adcc368a1d4ad62577eaf8609809be1678335d54ef565a5a0fa6e1210489f03 SHA512 64a6eb2d6efbe79ca078b8de727ce551acd3a43bc6258b633a4de9ee51933944badc370855c27f05f306d8d3e95332c4b8884f7c11af321a9ac6797f9b02a3a3 WHIRLPOOL 138149efa98d0ade917d10eb6e64bae5cca0e60685eb4e804773e97cd31389f645544a969fd52747aa957260f01fa89db642929a8c36106b915d13eb87715fd4
+DIST dd_rescue-1.33.tar.gz 36923 SHA256 630b4524c0df2109851b9cf2112ce1c5f53c53d3ca11145bb98892ae4a9f8102 SHA512 6e9bab7baa8a723cb459d28575724972df963e7632d588ac06ab2a2a1ea775beb8c88dd3c3db7faf5d3653c8df58f2f29ea01c936a1862017ece1b686ef26936 WHIRLPOOL e81ee54612baedffa58fdc583bf3d8fcbacdfb9188e4540641336d614562dde76323d51854d71a07fee1ac0a350f71a3f09a41188bd5618aeffee5b4abed50c7
+DIST dd_rescue-1.40.tar.gz 47107 SHA256 54545ebbe2be00597d8c9ba3d51abcfdd7ba89f17d51974629e612c2619730ff SHA512 a518f632c24161310bb03265c60d20bc08472b15888c167f8a28ceaaeb67fe5c942f6a320b7a4cce4c9e0fff9e73b549d64ba13bd26f015286698ad5f8c5fed4 WHIRLPOOL 55c091e63d7226d328616835c8aa0a0551a89eb7a708d4a30130fb78fc7ec2e14b93c2d91280de6565bc58e5ec9722f6f7843656fae5d4efebdbb71cce900b26
+DIST dd_rescue-1.44.tar.gz 114799 SHA256 744fa857fff7beed6d00644ea5786ce0d2e83df315b04f7578008e0a9b2853a3 SHA512 16e9072aeda04fe898d36e13d1dfc871642c7d1d1ac79b787f3ffd24ced2e13c605b4b36f66334ee4e258d01eee286ef74862e498a5a9ea5f9bd65a66a6ec213 WHIRLPOOL 5f4bfbb4b952552d0418054015fe5940d1a83050a282fad3a42b708caa26501d41ded98024acf9919acb63604e066008ee695ff616a7c9be5abf38613815e5d6
+DIST dd_rescue-1.45.tar.gz 121426 SHA256 2626fa2842916f6861b4e1ce72284c81e1b6e7323a842911aad4082bdaa4f663 SHA512 88022f38ad0e1ea171f1db014ba5e3f421fe9c35782f01220e27beb03618998860694df6b5d2e96ea4927640952c57153f2a1633dee9c13a2227e17ddd46b160 WHIRLPOOL cbe7d227e70c1314ab15c90f4b5ba3f451f421769ebbb13589f8e66f8d09ca0986d50c0cfecdcce53fbd5a70c3aa027a5b20ea4f8c56ee05b5fc9c7be895fa18
+DIST dd_rescue-1.46.tar.gz 126790 SHA256 9e09b5583f778fe43b6c473998fe0455486d5ffeacbb72b022d6cf5ba8241aba SHA512 efd1bf5d80d4bafa6e6971caa84205dc5df4456a29a9fa3bb56aa984d68675ae3418e8ba3a355906f491f0f2e750c38fd695e37dbd193e554cd41afec3841e28 WHIRLPOOL ac965019d38539962018bcc5a6d32cbf303b4d00d5ed91d643655a820f17bfa1ca81b5123f95220663823e6622d55099a2da08aaacf60cefc37097aa3354c729
diff --git a/sys-fs/dd-rescue/dd-rescue-1.28.ebuild b/sys-fs/dd-rescue/dd-rescue-1.28.ebuild
new file mode 100644
index 000000000000..892319271fae
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.28.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit toolchain-funcs flag-o-matic
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~mips ppc ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="static kernel_linux elibc_glibc"
+
+S=${WORKDIR}/${MY_PN}
+
+src_compile() {
+ use static && append-ldflags -static
+
+ # Passing LDFLAGS together with CFLAGS is not often a good idea, but
+ # in this case it makes it possible to avoid patching; after all it
+ # only builds the progrma whole, not with object files.
+ #
+ # The falloc target creates a dd_rescue binary that uses the
+ # fallocate() function, present in Kernel 2.6.23 and later and GLIBC
+ # 2.10 and later. If somebody can think of a better way to
+ # optionally use it, suggestions are welcome.
+ emake RPM_OPT_FLAGS="${CFLAGS} ${LDFLAGS}" CC="$(tc-getCC)" \
+ $(use kernel_linux && use elibc_glibc && echo "falloc")
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the
+ # Makefile.
+ into /
+ dobin dd_rescue
+
+ dodoc README.dd_rescue
+}
diff --git a/sys-fs/dd-rescue/dd-rescue-1.33.ebuild b/sys-fs/dd-rescue/dd-rescue-1.33.ebuild
new file mode 100644
index 000000000000..e5c0bde05c7e
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.33.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="static kernel_linux elibc_glibc"
+
+S=${WORKDIR}/${MY_PN}
+
+src_compile() {
+ use static && append-ldflags -static
+
+ # Passing LDFLAGS together with CFLAGS is not often a good idea, but
+ # in this case it makes it possible to avoid patching; after all it
+ # only builds the progrma whole, not with object files.
+ #
+ # The falloc target creates a dd_rescue binary that uses the
+ # fallocate() function, present in Kernel 2.6.23 and later and GLIBC
+ # 2.10 and later. If somebody can think of a better way to
+ # optionally use it, suggestions are welcome.
+ emake RPM_OPT_FLAGS="${CFLAGS} ${LDFLAGS}" CC="$(tc-getCC)" \
+ $(use kernel_linux && use elibc_glibc && echo "falloc")
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the
+ # Makefile.
+ into /
+ dobin dd_rescue
+ dodoc README.dd_rescue
+ doman dd_rescue.1
+}
diff --git a/sys-fs/dd-rescue/dd-rescue-1.40.ebuild b/sys-fs/dd-rescue/dd-rescue-1.40.ebuild
new file mode 100644
index 000000000000..d29d995dca5b
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.40.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic autotools
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="static"
+
+S=${WORKDIR}/${MY_PN}
+
+src_prepare() {
+ sed -i \
+ -e 's:-ldl:$(LDFLAGS) -ldl:' \
+ Makefile
+ eautoreconf
+}
+
+src_compile() {
+ use static && append-ldflags -static
+
+ # The Makefile is a mess. Override a few vars rather than patch it.
+ emake \
+ RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
+ CFLAGS_OPT='$(CFLAGS)' \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the Makefile.
+ dobin dd_rescue
+ dodoc README.dd_rescue
+ doman dd_rescue.1
+}
diff --git a/sys-fs/dd-rescue/dd-rescue-1.44.ebuild b/sys-fs/dd-rescue/dd-rescue-1.44.ebuild
new file mode 100644
index 000000000000..9cb127e12d22
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.44.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic autotools
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="static"
+
+S=${WORKDIR}/${MY_PN}
+
+src_prepare() {
+ sed -i \
+ -e 's:-ldl:$(LDFLAGS) -ldl:' \
+ Makefile
+ eautoreconf
+}
+
+src_compile() {
+ use static && append-ldflags -static
+
+ # The Makefile is a mess. Override a few vars rather than patch it.
+ emake \
+ RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
+ CFLAGS_OPT='$(CFLAGS)' \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the Makefile.
+ dobin dd_rescue
+ dodoc README.dd_rescue
+ doman dd_rescue.1
+}
diff --git a/sys-fs/dd-rescue/dd-rescue-1.45.ebuild b/sys-fs/dd-rescue/dd-rescue-1.45.ebuild
new file mode 100644
index 000000000000..60a67ebe1505
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.45.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic multilib autotools
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr"
+
+RDEPEND="lzo? ( dev-libs/lzo )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_PN}
+
+src_prepare() {
+ sed -i \
+ -e 's:-ldl:$(LDFLAGS) -ldl:' \
+ -e 's:-shared:$(CFLAGS) $(LDFLAGS) -shared:' \
+ Makefile
+ eautoreconf
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ ac_cv_header_attr_xattr_h=$(usex xattr) \
+ ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \
+ econf
+}
+
+_emake() {
+ local arch
+ case ${ARCH} in
+ x86) arch=i386;;
+ amd64) arch=x86_64;;
+ arm) arch=arm;;
+ arm64) arch=aarch64;;
+ esac
+
+ local os=$(usex kernel_linux Linux IDK)
+
+ # The Makefile is a mess. Override a few vars rather than patch it.
+ emake \
+ MACH="${arch}" \
+ OS="${os}" \
+ HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \
+ RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
+ CFLAGS_OPT='$(CFLAGS)' \
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/${PN}" \
+ CC="$(tc-getCC)" \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the Makefile.
+ dobin dd_rescue
+ dodir /usr/$(get_libdir)/${PN}
+ cp -pPR libddr_*.so "${ED}"/usr/$(get_libdir)/${PN}/ || die
+ dodoc README.dd_rescue
+ doman dd_rescue.1
+ use lzo && doman ddr_lzo.1
+}
diff --git a/sys-fs/dd-rescue/dd-rescue-1.46.ebuild b/sys-fs/dd-rescue/dd-rescue-1.46.ebuild
new file mode 100644
index 000000000000..7884a21ae73d
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.46.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic multilib autotools
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr"
+
+RDEPEND="lzo? ( dev-libs/lzo )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_PN}
+
+src_prepare() {
+ sed -i \
+ -e 's:-ldl:$(LDFLAGS) -ldl:' \
+ -e 's:-shared:$(CFLAGS) $(LDFLAGS) -shared:' \
+ Makefile
+ eautoreconf
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ # OpenSSL is only used by a random helper tool we don't install.
+ ac_cv_header_attr_xattr_h=$(usex xattr) \
+ ac_cv_header_openssl_evp_h=no \
+ ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \
+ econf
+}
+
+_emake() {
+ local arch
+ case ${ARCH} in
+ x86) arch=i386;;
+ amd64) arch=x86_64;;
+ arm) arch=arm;;
+ arm64) arch=aarch64;;
+ esac
+
+ local os=$(usex kernel_linux Linux IDK)
+
+ # The Makefile is a mess. Override a few vars rather than patch it.
+ emake \
+ MACH="${arch}" \
+ OS="${os}" \
+ HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \
+ RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
+ CFLAGS_OPT='$(CFLAGS)' \
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/${PN}" \
+ CC="$(tc-getCC)" \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the Makefile.
+ dobin dd_rescue
+ dodir /usr/$(get_libdir)/${PN}
+ cp -pPR libddr_*.so "${ED}"/usr/$(get_libdir)/${PN}/ || die
+ dodoc README.dd_rescue
+ doman dd_rescue.1
+ use lzo && doman ddr_lzo.1
+}
diff --git a/sys-fs/dd-rescue/metadata.xml b/sys-fs/dd-rescue/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/dd-rescue/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/ddrescue/Manifest b/sys-fs/ddrescue/Manifest
new file mode 100644
index 000000000000..7deb7cc43712
--- /dev/null
+++ b/sys-fs/ddrescue/Manifest
@@ -0,0 +1,3 @@
+DIST ddrescue-1.16.tar.gz 104691 SHA256 76b3f2e5fb0306d24f2632c3e168cccb73dc0a348e3a7089cd9230748ff23de6 SHA512 c775ac34701b63ab7efd0a56cecf5c8b198874239e48383142db0ccb83c193c7101335374dc89efaa815b466258181f458a3589ea4abb230804b553fb42b345d WHIRLPOOL 63361744b8640241c59da06d1404b227d88008881a4360e52b654f4137cbef88b0b4e69118bd17a27dd887cf7a820b9cfcc5604ee226e0d57afd1b6d0ebf96c4
+DIST ddrescue-1.18.1.tar.lz 72233 SHA256 58614b4fd32706bd8cd3664349ca9fd0c0488b27a211d829d29e27e4978ba1a9 SHA512 66493da18f0c0cab5ad692ede2debad2376aeec53b23f96c5063d21da362f724370e785bfe38f5495bc57971d5ed428c6da8155b4eafd7d07a94e5a4d0955c96 WHIRLPOOL ec669a3905f6bac77e998e1cfdb609158141d0e53f9a2998662888253c4523f56e8d203af316d79e57b634ef198ef2acc48cb9d161468bdb86c53d301d9f9e84
+DIST ddrescue-1.19.tar.lz 68354 SHA256 ed8d0c9d9aac80a9110e9cb0d0a91a7390d3bf9f816b67a62ca4eb140f4747b8 SHA512 e95aab2f07b6759b8846ad2866cb763096d81655fb6fb8a718b5b4842eee4d834162817cbde830d2f7bb5dbbd1509a0d794389462c00679b18b63608ec180984 WHIRLPOOL 20cef1400876355dae7255b8075a026e115ed0f3cc35736b44838850716357aa33b8fc23bce97207b20c13ffe2af2e65be6c434c63814910bf04798788f47f06
diff --git a/sys-fs/ddrescue/ddrescue-1.16.ebuild b/sys-fs/ddrescue/ddrescue-1.16.ebuild
new file mode 100644
index 000000000000..ae6a1f54b24f
--- /dev/null
+++ b/sys-fs/ddrescue/ddrescue-1.16.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit toolchain-funcs
+
+DESCRIPTION="Copy data from one file or block device to another with read-error recovery"
+HOMEPAGE="http://www.gnu.org/software/ddrescue/ddrescue.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ia64 ppc ~sparc x86 ~amd64-linux"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+src_configure() {
+ # not a normal configure script
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ CPPFLAGS="${CPPFLAGS}" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_test() {
+ ./testsuite/check.sh "${S}"/testsuite || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install install-man
+ dodoc ChangeLog README NEWS AUTHORS
+}
diff --git a/sys-fs/ddrescue/ddrescue-1.18.1.ebuild b/sys-fs/ddrescue/ddrescue-1.18.1.ebuild
new file mode 100644
index 000000000000..9564ee28e54c
--- /dev/null
+++ b/sys-fs/ddrescue/ddrescue-1.18.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic unpacker
+
+DESCRIPTION="Copy data from one file or block device to another with read-error recovery"
+HOMEPAGE="http://www.gnu.org/software/ddrescue/ddrescue.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.lz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ia64 ppc ~sparc x86 ~amd64-linux"
+IUSE="static"
+
+DEPEND="$(unpacker_src_uri_depends)"
+RDEPEND=""
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # not a normal configure script
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ CPPFLAGS="${CPPFLAGS}" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_test() {
+ ./testsuite/check.sh "${S}"/testsuite || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install install-man
+ dodoc ChangeLog README NEWS AUTHORS
+}
diff --git a/sys-fs/ddrescue/ddrescue-1.19.ebuild b/sys-fs/ddrescue/ddrescue-1.19.ebuild
new file mode 100644
index 000000000000..1b57e60e6303
--- /dev/null
+++ b/sys-fs/ddrescue/ddrescue-1.19.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic unpacker
+
+DESCRIPTION="Copy data from one file or block device to another with read-error recovery"
+HOMEPAGE="http://www.gnu.org/software/ddrescue/ddrescue.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.lz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~sparc ~x86 ~amd64-linux"
+IUSE="static"
+
+DEPEND="$(unpacker_src_uri_depends)"
+RDEPEND=""
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # not a normal configure script
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ --enable-linux \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ CPPFLAGS="${CPPFLAGS}" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_test() {
+ ./testsuite/check.sh "${S}"/testsuite || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install install-man
+ dodoc ChangeLog README NEWS AUTHORS
+}
diff --git a/sys-fs/ddrescue/metadata.xml b/sys-fs/ddrescue/metadata.xml
new file mode 100644
index 000000000000..91c8a805afc2
--- /dev/null
+++ b/sys-fs/ddrescue/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/devfsd/Manifest b/sys-fs/devfsd/Manifest
new file mode 100644
index 000000000000..6e107462e8dc
--- /dev/null
+++ b/sys-fs/devfsd/Manifest
@@ -0,0 +1 @@
+DIST devfsd-v1.3.25.tar.gz 42645 SHA256 d0b030fdc45b989fe8030dbb0c025fb7229228d88e5e4f056d9499f4056f6d08 SHA512 3bf18edb0fc823b96b938b22fc0f978823acfd37708d24d9fec8a25dfdaced165be6162fd5a20bdf30bfc615699faea8239fc77b99c30f035fd7c6b40e7c8c2c WHIRLPOOL a54cbc26c9591601e60a7468f89fd5d3c2dd633984d5787641ea63cba5ce2a566b08dd3dc0e3bc636b584ab6eb35bf7eec31c05a87e7f1c4cb8425fc848dfccd
diff --git a/sys-fs/devfsd/devfsd-1.3.25-r9.ebuild b/sys-fs/devfsd/devfsd-1.3.25-r9.ebuild
new file mode 100644
index 000000000000..66f6e6aee48a
--- /dev/null
+++ b/sys-fs/devfsd/devfsd-1.3.25-r9.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Daemon for the Linux Device Filesystem"
+HOMEPAGE="http://www.atnf.csiro.au/~rgooch/linux/"
+SRC_URI="ftp://ftp.atnf.csiro.au/pub/people/rgooch/linux/daemons/devfsd/devfsd-v${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+DEPEND="<sys-kernel/linux-headers-2.6.18"
+RDEPEND=""
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-kernel-2.5.patch
+ epatch "${FILESDIR}"/${P}-pic.patch
+ epatch "${FILESDIR}"/${P}-no-nis.patch
+
+ use elibc_uclibc || append-cppflags -DHAVE_NIS
+ sed -i \
+ -e "s:-O2:${CFLAGS}:g" \
+ -e 's:/usr/man:/usr/share/man:' \
+ -e 's:/usr/src/linux:.:' \
+ -e '32,34d;11,16d' -e '6c\' \
+ -e 'DEFINES := -DLIBNSL="\\"/lib/libnsl.so.1\\""' \
+ -e 's:install -s:install:' \
+ GNUmakefile
+ use elibc_uclibc && sed -e 's|libnsl.so.1|libnsl.so.0|' -i GNUmakefile
+ tc-export CC
+}
+
+src_install() {
+ dodir /sbin /usr/share/man /etc
+ emake PREFIX="${D}" install
+ dodoc devfsd.conf INSTALL
+
+ keepdir /etc/devfs.d
+ insinto /etc
+ doins "${FILESDIR}"/devfsd.conf
+
+ insinto /lib/rcscripts/addons
+ doins "${FILESDIR}"/devfs-{start,stop}.sh
+}
+
+pkg_postinst() {
+ echo
+ einfo "You may wish to read the Gentoo Linux Device Filesystem Guide,"
+ einfo "which can be found online at:"
+ einfo " https://wwwold.gentoo.org/doc/en/devfs-guide.xml"
+ echo
+}
diff --git a/sys-fs/devfsd/files/devfs-start.sh b/sys-fs/devfsd/files/devfs-start.sh
new file mode 100755
index 000000000000..b8d832494e95
--- /dev/null
+++ b/sys-fs/devfsd/files/devfs-start.sh
@@ -0,0 +1,28 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+main() {
+ local mymounts=$(awk '($2 == "devfs") { print "yes"; exit 0 }' /proc/filesystems)
+
+ # Is devfs support compiled in?
+ if [[ ${mymounts} == "yes" ]] ; then
+ if [[ ${devfs_automounted} == "no" ]] ; then
+ ebegin "Mounting devfs at /dev"
+ try mount -n -t devfs devfs /dev
+ eend $?
+ else
+ ebegin "Kernel automatically mounted devfs at /dev"
+ eend 0
+ fi
+ ebegin "Starting devfsd"
+ /sbin/devfsd /dev >/dev/null
+ eend $? "Could not start /sbin/devfsd"
+ else
+ devfs="no"
+ fi
+}
+
+main
+
+
+# vim:ts=4
diff --git a/sys-fs/devfsd/files/devfs-stop.sh b/sys-fs/devfsd/files/devfs-stop.sh
new file mode 100755
index 000000000000..0b4856bc82c7
--- /dev/null
+++ b/sys-fs/devfsd/files/devfs-stop.sh
@@ -0,0 +1,16 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+main() {
+ # We need to properly terminate devfsd to save the permissions
+ if [[ -n $(ps --no-heading -C 'devfsd') ]]; then
+ ebegin "Stopping devfsd"
+ killall -15 devfsd &>/dev/null
+ eend $?
+ fi
+}
+
+main
+
+
+# vim:ts=4
diff --git a/sys-fs/devfsd/files/devfsd-1.3.25-kernel-2.5.patch b/sys-fs/devfsd/files/devfsd-1.3.25-kernel-2.5.patch
new file mode 100644
index 000000000000..bafa600c31ce
--- /dev/null
+++ b/sys-fs/devfsd/files/devfsd-1.3.25-kernel-2.5.patch
@@ -0,0 +1,131 @@
+diff -urpN devfsd/GNUmakefile devfsd.kernel25/GNUmakefile
+--- devfsd/GNUmakefile 2003-09-21 02:09:45.082973960 +0200
++++ devfsd.kernel25/GNUmakefile 2003-09-21 02:10:23.317161480 +0200
+@@ -12,13 +12,16 @@ endif
+ all: devfsd rpm.spec
+
+
+-OBJECTS = devfsd.o expression.o compat_name.o
++OBJECTS = devfsd.o expression.o compat_name.o check_kernel.o
+
+ CFLAGS = -O2 -I. -I$(KERNEL_DIR)/include -Wall $(CEXTRAS) $(DEFINES)
+
+ devfsd: $(OBJECTS)
+ $(CC) -O2 -o devfsd $(OBJECTS) $(LDFLAGS) -export-dynamic -ldl
+
++check_kernel.o: check_kernel.c
++ $(CC) -fomit-frame-pointer -O2 -c $<
++
+ install: devfsd
+ if [ ! -e $(SBINDIR) ]; then mkdir -p $(SBINDIR); fi
+ rm -f $(SBINDIR)/devfsd
+diff -urpN devfsd/check_kernel.c devfsd.kernel25/check_kernel.c
+--- devfsd/check_kernel.c 1970-01-01 02:00:00.000000000 +0200
++++ devfsd.kernel25/check_kernel.c 2003-09-21 01:59:56.645430064 +0200
+@@ -0,0 +1,44 @@
++#include <sys/types.h>
++#include <stdio.h>
++#include <unistd.h>
++#include <errno.h>
++#include <asm/unistd.h>
++
++extern char *modules_devfs;
++
++/* copied over from module-init-tools backward_compat.c */
++#ifndef __ia64 /* breaks ia64. */
++static _syscall2(long, create_module, const char *, name, size_t, size);
++#else
++#define create_module(name, size) \
++ syscall(__NR_create_module, (name), (size))
++#endif
++
++/* returns true if we have a 2.5.48+ kernel */
++int check_kernel_version (int verbose)
++{
++ int k25 = 1;
++
++ errno = 0;
++ if (create_module(NULL, 0) >= 0 /* Uh oh, what have I just done? */
++ || errno != ENOSYS)
++ k25 = 0;
++
++ if (verbose)
++ fprintf (stderr, "devfsd: kernel %s detected\n",
++ k25 ? "2.5.48+" : "2.4");
++
++ return k25;
++}
++
++void update_config_file (int verbose)
++{
++ int k25 = check_kernel_version (verbose);
++
++ if (k25)
++ modules_devfs = "/etc/modules.devfs";
++
++ if (verbose)
++ fprintf (stderr, "devfsd: using %s for MODLOAD\n", modules_devfs);
++}
++
+diff -urpN devfsd/devfsd.c devfsd.kernel25/devfsd.c
+--- devfsd/devfsd.c 2003-09-21 02:06:10.763555464 +0200
++++ devfsd.kernel25/devfsd.c 2003-09-21 02:12:17.482805664 +0200
+@@ -396,10 +396,16 @@ EXTERN_FUNCTION (flag st_expr_expand,
+ EXTERN_FUNCTION (const char *get_old_name,
+ (const char *devname, unsigned int namelen,
+ char *buffer, unsigned int major, unsigned int minor) );
+-
++EXTERN_FUNCTION (int check_kernel_version,
++ (int) );
++EXTERN_FUNCTION (void update_config_file,
++ (int) );
+
+ /* Public data */
+ flag syslog_is_open = FALSE;
++/* set to new style, runtime test will override it later */
++char *modules_devfs = "/etc/modules.devfs";
++
+
+
+ /* Public functions */
+@@ -507,7 +513,6 @@ static struct event_type
+ {0xffffffff, NULL, NULL}
+ };
+
+-
+ /* Public functions follow */
+
+ int main (int argc, char **argv)
+@@ -651,6 +656,7 @@ int main (int argc, char **argv)
+ /* Set umask so that mknod(2), open(2) and mkdir(2) have complete control
+ over permissions */
+ umask (0);
++ update_config_file (trace_level);
+ read_config (CONFIG_FILE, FALSE, &event_mask);
+ /* Do the scan before forking, so that boot scripts see the finished
+ product */
+@@ -1217,7 +1223,7 @@ static void action_modload (const struct
+ [RETURNS] Nothing.
+ */
+ {
+- char *argv[6];
++ char *argv[7];
+ char device[STRING_LENGTH];
+ char *env[4] = {"HOME=/", "TERM=linux", /* Safe mode environment */
+ "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL};
+@@ -1240,9 +1246,13 @@ static void action_modload (const struct
+ argv[0] = "/sbin/modprobe";
+ argv[1] = "-k";
+ argv[2] = "-C";
+- argv[3] = "/etc/modules.devfs";
++ argv[3] = modules_devfs;
+ argv[4] = device;
+- argv[5] = NULL;
++ if (check_kernel_version (trace_level))
++ argv[5] = "-q";
++ else
++ argv[5] = NULL;
++ argv[6] = NULL;
+ snprintf (device, sizeof (device), "/dev/%s", info->devname);
+ if (trace_level > 1)
+ fprintf (stderr, "%s modprobe with name: \"%s\"\n",
diff --git a/sys-fs/devfsd/files/devfsd-1.3.25-no-nis.patch b/sys-fs/devfsd/files/devfsd-1.3.25-no-nis.patch
new file mode 100644
index 000000000000..c676b7e980c9
--- /dev/null
+++ b/sys-fs/devfsd/files/devfsd-1.3.25-no-nis.patch
@@ -0,0 +1,69 @@
+--- devfsd/devfsd.c.mps 2003-12-04 15:54:03.000000000 +0100
++++ devfsd/devfsd.c 2003-12-04 16:05:32.000000000 +0100
+@@ -283,8 +283,10 @@
+ #include <regex.h>
+ #include <errno.h>
+ #include <dlfcn.h>
++#ifdef HAVE_NIS
+ #include <rpcsvc/ypclnt.h>
+ #include <rpcsvc/yp_prot.h>
++#endif
+ #include <karma.h>
+ #include "devfsd.h"
+ #include "version.h"
+@@ -414,9 +416,11 @@
+ unsigned long *event_mask);
+ static void process_config_line (CONST char *line, unsigned long *event_mask);
+ static void *dlsym_nofail (const char *file, void *handle, char *symbol);
++#ifdef HAVE_NIS
+ static int process_yp_line (int instatus, char *inkey, int inkeylen,
+ char *inval, int invallen, char *indata);
+ static void load_libnsl (void);
++#endif
+ static flag do_servicing (int fd, unsigned long event_mask);
+ static void service_name (const struct devfsd_notify_struct *info);
+ static void action_permissions (const struct devfsd_notify_struct *info,
+@@ -486,9 +490,11 @@
+ {"fd/2", "stderr"},
+ {NULL, NULL},
+ };
++#ifdef HAVE_NIS
+ static int (*my_yp_all) (char *domain, char *map,
+ struct ypall_callback *callback); /* = NULL */
+ static int (*my_yp_get_default_domain) (char **domainptr); /* = NULL */
++#endif
+ static struct event_type
+ {
+ unsigned int type; /* The DEVFSD_NOTIFY_* value */
+@@ -714,6 +720,7 @@
+ [RETURNS] Nothing.
+ */
+ {
++#ifdef HAVE_NIS
+ if (location[0] == '+')
+ {
+ /* It's a YP map */
+@@ -736,6 +743,7 @@
+ SYSLOG (LOG_ERR, "error reading map: \"%s\"\n", location + 1);
+ exit (1);
+ }
++#endif
+ read_config_file (location, optional, event_mask);
+ } /* End Function read_config */
+
+@@ -1006,6 +1014,7 @@
+ return (result);
+ } /* End Function dlsym_nofail */
+
++#ifdef HAVE_NIS
+ static void load_libnsl (void)
+ {
+ #ifdef LIBNSL /* It comes from a shared object */
+@@ -1034,6 +1043,7 @@
+ if (invallen > 0) process_config_line (inval, (unsigned long *) indata);
+ return (0);
+ } /* End Function process_yp_line */
++#endif
+
+ static flag do_servicing (int fd, unsigned long event_mask)
+ /* [SUMMARY] Service devfs changes until a signal is received.
diff --git a/sys-fs/devfsd/files/devfsd-1.3.25-pic.patch b/sys-fs/devfsd/files/devfsd-1.3.25-pic.patch
new file mode 100644
index 000000000000..67e325333c07
--- /dev/null
+++ b/sys-fs/devfsd/files/devfsd-1.3.25-pic.patch
@@ -0,0 +1,16 @@
+--- check_kernel.c.orig 2004-02-06 16:41:32.000000000 -0500
++++ check_kernel.c 2004-02-06 16:41:55.000000000 -0500
+@@ -6,13 +6,8 @@
+
+ extern char *modules_devfs;
+
+-/* copied over from module-init-tools backward_compat.c */
+-#ifndef __ia64 /* breaks ia64. */
+-static _syscall2(long, create_module, const char *, name, size_t, size);
+-#else
+ #define create_module(name, size) \
+ syscall(__NR_create_module, (name), (size))
+-#endif
+
+ /* returns true if we have a 2.5.48+ kernel */
+ int check_kernel_version (int verbose)
diff --git a/sys-fs/devfsd/files/devfsd.conf b/sys-fs/devfsd/files/devfsd.conf
new file mode 100644
index 000000000000..109ac87877c9
--- /dev/null
+++ b/sys-fs/devfsd/files/devfsd.conf
@@ -0,0 +1,139 @@
+# Sample /etc/devfsd.conf configuration file.
+# Richard Gooch <rgooch@atnf.csiro.au> 17-FEB-2002
+#
+# The Gentoo Linux Team - http://www.gentoo.org/
+# - Many fixes, etc
+#
+# $Id$
+
+# Enable full compatibility mode for old device names. You may comment these
+# out if you don't use the old device names. Make sure you know what you're
+# doing!
+REGISTER .* MKOLDCOMPAT
+UNREGISTER .* RMOLDCOMPAT
+
+# You may comment out the above and uncomment the following if you've
+# configured your system to use the original "new" devfs names or the really
+# new names
+#REGISTER ^vc/.* MKOLDCOMPAT
+#UNREGISTER ^vc/.* RMOLDCOMPAT
+#REGISTER ^pty/.* MKOLDCOMPAT
+#UNREGISTER ^pty/.* RMOLDCOMPAT
+#REGISTER ^misc MKOLDCOMPAT
+#UNREGISTER ^misc RMOLDCOMPAT
+
+# You may comment these out if you don't use the original "new" names
+REGISTER .* MKNEWCOMPAT
+UNREGISTER .* RMNEWCOMPAT
+
+# Enable module autoloading. You may comment this out if you don't use
+# autoloading
+LOOKUP .* MODLOAD
+
+# Uncomment the following if you want to set the group to "tty" for the
+# pseudo-tty devices. This is necessary so that mesg(1) can later be used to
+# enable/disable talk requests and wall(1) messages.
+REGISTER ^pty/s.* PERMISSIONS -1.tty 0600
+REGISTER ^pts/.* PERMISSIONS -1.tty 0600
+
+# Uncomment this if you want permissions to be saved and restored
+# NB: Do NOT change the following!
+# Do not do this for pseudo-terminal devices
+REGISTER ^pt[sy]/.* IGNORE
+CHANGE ^pt[sy]/.* IGNORE
+CREATE ^pt[sy]/.* IGNORE
+DELETE ^pt[sy] IGNORE
+REGISTER ^log IGNORE
+CHANGE ^log IGNORE
+CREATE ^log IGNORE
+DELETE ^log IGNORE
+REGISTER .* COPY /lib/dev-state/$devname $devpath
+CHANGE .* COPY $devpath /lib/dev-state/$devname
+CREATE .* COPY $devpath /lib/dev-state/$devname
+DELETE .* CFUNCTION GLOBAL unlink /lib/dev-state/$devname
+RESTORE /lib/dev-state
+
+# You can force default like this :
+# PERMISSIONS owner_and_group access_mode
+
+# ALSA/OSS stuff
+# Comment/change these if you want to change the permissions on
+# the audio devices
+LOOKUP snd MODLOAD ACTION snd
+LOOKUP dsp MODLOAD
+LOOKUP mixer MODLOAD
+LOOKUP midi MODLOAD
+REGISTER sound/.* PERMISSIONS root.audio 660
+REGISTER snd/.* PERMISSIONS root.audio 660
+
+# Uncomment this to let PAM manage devfs
+#REGISTER .* CFUNCTION /lib/security/pam_console_apply_devfsd.so pam_console_apply_single $devpath
+
+# Autoload the sg module if generic scsi driver compiled as module.
+#LOOKUP ^sg$ MODLOAD ACTION sg
+
+# Give the cdrom group access to /dev/sg0
+REGISTER ^scsi/host.*/bus.*/target.*/lun.*/generic PERMISSIONS root.cdrom 660
+
+# Give the cdrom group access to the cdrom devices
+REGISTER ^scsi/host.*/bus.*/target.*/lun.*/cd PERMISSIONS root.cdrom 660
+REGISTER ^ide/host.*/bus.*/target.*/lun.*/cd PERMISSIONS root.cdrom 660
+
+# Give the floppy group access to the floppy devices
+REGISTER ^floppy/.* PERMISSIONS root.floppy 660
+
+# Give the usb group access to the usb devices
+REGISTER ^usb/.* PERMISSIONS root.usb 660
+REGISTER ^tts/USB.* PERMISSIONS root.usb 660
+REGISTER ^usb/tts/(.*)$ CFUNCTION GLOBAL mksymlink $devname ttyUSB\1
+UNREGISTER ^usb/tts/(.*)$ CFUNCTION GLOBAL unlink ttyUSB\1
+
+# Video devices
+REGISTER ^v4l/.* PERMISSIONS root.video 660
+REGISTER ^dri/.* PERMISSIONS root.video 660
+REGISTER ^nvidia.* PERMISSIONS root.video 660
+
+# General note for the following auto creation of symlinks:
+#
+# If you change the device that the symlink points to,
+# you should also remove the symlink before restarting
+# devfsd
+
+# Create /dev/cdrom for the first cdrom drive
+LOOKUP ^cdrom$ CFUNCTION GLOBAL mksymlink cdroms/cdrom0 cdrom
+REGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL mksymlink $devname cdrom
+UNREGISTER ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink cdrom
+
+# Create /dev/dvd for the second cdrom drive
+# (change 'cdroms/cdrom1' to suite your setup)
+# NOTE: We add the fully qualified path here, else some apps
+# have problems to resolve the true device (drip comes to mind)
+#LOOKUP ^dvd$ CFUNCTION GLOBAL mksymlink ${mntpnt}/cdroms/cdrom1 dvd
+#REGISTER ^cdroms/cdrom1$ CFUNCTION GLOBAL mksymlink ${devpath} dvd
+#UNREGISTER ^cdroms/cdrom1$ CFUNCTION GLOBAL unlink dvd
+
+# Create /dev/cdrw for the first cdrom on the scsi bus
+# (change 'sr0' to suite your setup)
+#LOOKUP ^cdrw$ CFUNCTION GLOBAL mksymlink sr0 cdrw
+#REGISTER ^sr0$ CFUNCTION GLOBAL mksymlink $devname cdrw
+#UNREGISTER ^sr0$ CFUNCTION GLOBAL unlink cdrw
+
+# Create /dev/mouse
+LOOKUP ^mouse$ CFUNCTION GLOBAL mksymlink misc/psaux mouse
+REGISTER ^misc/psaux$ CFUNCTION GLOBAL mksymlink $devname mouse
+UNREGISTER ^misc/psaux$ CFUNCTION GLOBAL unlink mouse
+
+# Manage USB mouse
+REGISTER ^input/mouse0$ CFUNCTION GLOBAL mksymlink $devname usbmouse
+UNREGISTER ^input/mouse0$ CFUNCTION GLOBAL unlink usbmouse
+REGISTER ^input/mice$ CFUNCTION GLOBAL mksymlink $devname usbmouse
+UNREGISTER ^input/mice$ CFUNCTION GLOBAL unlink usbmouse
+
+# Create compatibility link for broken misc/net/tun driver
+REGISTER ^misc/net/tun$ CFUNCTION GLOBAL unlink net/tun
+REGISTER ^misc/net/tun$ CFUNCTION GLOBAL symlink /dev/$devname net/tun
+
+# Support additional config installed by packages ...
+INCLUDE /etc/devfs.d
+
+# devfsd.conf ends here
diff --git a/sys-fs/devfsd/metadata.xml b/sys-fs/devfsd/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/devfsd/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/dfc/Manifest b/sys-fs/dfc/Manifest
new file mode 100644
index 000000000000..94ac17084cac
--- /dev/null
+++ b/sys-fs/dfc/Manifest
@@ -0,0 +1 @@
+DIST dfc-3.0.5.tar.gz 43310 SHA256 3c947a1d6bc53347b1643921dcbf4c6f8fe7eb6167fc1f4e9436366f036d857a SHA512 f828ede8aee0a496518d1ee9583ba71495cdd01ee0d22833e3b46aeb5f5f870ce7de629923d129a7bf795b458feec10f9a16882134dae34dd2ace7ea9eebb134 WHIRLPOOL 060a9aa44a5b4294bc71fabd38b7d55a15fcf65ad3b9bef2d64b98f9e57670f6cb1370ba6b58fa65bfc01d067d9cf911f4e20cbdca5dbeea97b87f721f737423
diff --git a/sys-fs/dfc/dfc-3.0.5-r1.ebuild b/sys-fs/dfc/dfc-3.0.5-r1.ebuild
new file mode 100644
index 000000000000..d3a3569ed47e
--- /dev/null
+++ b/sys-fs/dfc/dfc-3.0.5-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit cmake-utils
+
+DESCRIPTION="A simple CLI tool that display file system usage, with colors"
+HOMEPAGE="http://projects.gw-computing.net/projects/dfc"
+SRC_URI="http://projects.gw-computing.net/attachments/download/467/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="nls"
+
+DEPEND="nls? (
+ virtual/libintl
+ sys-devel/gettext
+)"
+RDEPEND="nls? ( virtual/libintl )"
+
+src_configure() {
+ mycmakeargs=(
+ # avoid installing xdg config in /usr
+ -DXDG_CONFIG_DIR="${EPREFIX}"/etc/xdg
+ # use the standard Gentoo doc path
+ -DDFC_DOC_PATH="${EPREFIX}"/usr/share/doc/${PF}
+ # disable automagic dependency
+ $(cmake-utils_use nls NLS_ENABLED)
+ -DLFS_ENABLED=ON
+ -DGRIM=OFF
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/sys-fs/dfc/metadata.xml b/sys-fs/dfc/metadata.xml
new file mode 100644
index 000000000000..e7b8be659b2e
--- /dev/null
+++ b/sys-fs/dfc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>dlan@gentoo.org</email>
+ <name>Yixun Lan</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/diskdev_cmds/Manifest b/sys-fs/diskdev_cmds/Manifest
new file mode 100644
index 000000000000..7619d2dce49d
--- /dev/null
+++ b/sys-fs/diskdev_cmds/Manifest
@@ -0,0 +1,3 @@
+DIST diskdev_cmds-332.14.patch.bz2 40477 SHA256 695889250a1faad15d841f86d62af49b492e4db792d683d21c99340e3a35e68a
+DIST diskdev_cmds-332.14.tar.gz 714035 SHA256 a46bec392661a02d9683355baf4442d494e2bcde0ffb094aacc1e57ddc03b3d4 SHA512 e1df91fb5330dc01a79de99dd8b1f389a337a19c2136994d59b7cbca9c2e1cb5f7d47101366dd01db4e23a5d3d7afab41758045bf7402d739fa22182dc922044 WHIRLPOOL bb39c2949c7b05ca82301894954ccd726b5c962d6af61bf04c7e262de3304e788f38c392e8dd526d1038f9389c42033993ca8feb708fd94b7e94fd958db9728e
+DIST diskdev_cmds-332.14_p1.patch.bz2 21989 SHA256 8e6889b318b1015e9be13dc12b3694c8e7077428a1142fbeb503609771f49bda SHA512 aaef096aa6a3f2e09bcc8c1831172c3d68994589ade505153ade00e6f4d0c49263b63212f8616ece597b1ee218a87474bb1c3812d15f34c5bc5c51fd7b72a062 WHIRLPOOL efca536f9c5dcb8308945731094227f7b12b23b0f930a4d88add7780b4f9206631653d9ef008572936426a6fb5641393bd3ff39a393f66e88f6558584f7439e1
diff --git a/sys-fs/diskdev_cmds/diskdev_cmds-332.14.ebuild b/sys-fs/diskdev_cmds/diskdev_cmds-332.14.ebuild
new file mode 100644
index 000000000000..7e52817910dd
--- /dev/null
+++ b/sys-fs/diskdev_cmds/diskdev_cmds-332.14.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="HFS and HFS+ utils ported from OSX, supplies mkfs and fsck"
+HOMEPAGE="http://opendarwin.org"
+SRC_URI="http://darwinsource.opendarwin.org/tarballs/apsl/diskdev_cmds-${PV}.tar.gz
+ mirror://gentoo/diskdev_cmds-${PV}.patch.bz2"
+LICENSE="APSL-2"
+SLOT="0"
+KEYWORDS="-amd64 ~ppc ~x86"
+IUSE=""
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${WORKDIR}"/diskdev_cmds-${PV}.patch
+}
+
+src_compile() {
+ emake -f Makefile.lnx || die "emake failed"
+}
+
+src_install() {
+ exeinto /sbin
+ doexe fsck_hfs.tproj/fsck_hfs
+ doexe newfs_hfs.tproj/newfs_hfs
+ dosym /sbin/newfs_hfs /sbin/mkfs.hfs
+ dosym /sbin/newfs_hfs /sbin/mkfs.hfsplus
+ dosym /sbin/fsck_hfs /sbin/fsck.hfs
+ dosym /sbin/fsck_hfs /sbin/fsck.hfsplus
+ doman newfs_hfs.tproj/newfs_hfs.8
+ newman newfs_hfs.tproj/newfs_hfs.8 mkfs.hfs.8
+ newman newfs_hfs.tproj/newfs_hfs.8 mkfs.hfsplus.8
+ doman fsck_hfs.tproj/fsck_hfs.8
+ newman fsck_hfs.tproj/fsck_hfs.8 fsck.hfs.8
+ newman fsck_hfs.tproj/fsck_hfs.8 fsck.hfsplus.8
+}
diff --git a/sys-fs/diskdev_cmds/diskdev_cmds-332.14_p1.ebuild b/sys-fs/diskdev_cmds/diskdev_cmds-332.14_p1.ebuild
new file mode 100644
index 000000000000..8b1a4dd12615
--- /dev/null
+++ b/sys-fs/diskdev_cmds/diskdev_cmds-332.14_p1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_PV=${PV%_p*}
+
+DESCRIPTION="HFS and HFS+ utils ported from OSX, supplies mkfs and fsck"
+HOMEPAGE="http://opendarwin.org"
+SRC_URI="http://darwinsource.opendarwin.org/tarballs/apsl/diskdev_cmds-${MY_PV}.tar.gz
+ mirror://gentoo/diskdev_cmds-${PV}.patch.bz2"
+LICENSE="APSL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc x86"
+IUSE=""
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${WORKDIR}"/diskdev_cmds-${PV}.patch
+ epatch "${FILESDIR}"/diskdev_cmds-respect-cflags.patch
+}
+
+src_compile() {
+ emake -f Makefile.lnx || die "emake failed"
+}
+
+src_install() {
+ into /
+ dosbin fsck_hfs.tproj/fsck_hfs || die "dosbin fsck failed"
+ dosbin newfs_hfs.tproj/newfs_hfs || die "dosbin newfs failed"
+ dosym /sbin/newfs_hfs /sbin/mkfs.hfs || die "dosym mkfs.hfs failed"
+ dosym /sbin/newfs_hfs /sbin/mkfs.hfsplus || die "dosym mkfs.hfsplus failed"
+ dosym /sbin/fsck_hfs /sbin/fsck.hfs || die "dosym fsck.hfs failed"
+ dosym /sbin/fsck_hfs /sbin/fsck.hfsplus || die "dosym fsck.hfsplus failed"
+ doman newfs_hfs.tproj/newfs_hfs.8 || die "doman newfs_hfs.8 failed"
+ newman newfs_hfs.tproj/newfs_hfs.8 mkfs.hfs.8 || die "doman mkfs.hfs.8 failed"
+ newman newfs_hfs.tproj/newfs_hfs.8 mkfs.hfsplus.8 || die "doman mkfs.hfsplus.8 failed"
+ doman fsck_hfs.tproj/fsck_hfs.8 || die "doman fsck_hfs.8 failed"
+ newman fsck_hfs.tproj/fsck_hfs.8 fsck.hfs.8 || die "doman fsck.hfs.8 failed"
+ newman fsck_hfs.tproj/fsck_hfs.8 fsck.hfsplus.8 || die "doman fsck.hfsplus.8 failed"
+}
diff --git a/sys-fs/diskdev_cmds/files/diskdev_cmds-respect-cflags.patch b/sys-fs/diskdev_cmds/files/diskdev_cmds-respect-cflags.patch
new file mode 100644
index 000000000000..3f939f61163a
--- /dev/null
+++ b/sys-fs/diskdev_cmds/files/diskdev_cmds-respect-cflags.patch
@@ -0,0 +1,9 @@
+--- Makefile.lnx.bak 2009-07-22 11:58:10.000000000 -0400
++++ Makefile.lnx 2009-07-22 11:57:37.000000000 -0400
+@@ -1,5 +1,5 @@
+ CC := gcc
+-CFLAGS := -g3 -Wall -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1
++CFLAGS += -Wall -I$(PWD)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1
+ SUBDIRS := newfs_hfs.tproj fsck_hfs.tproj
+
+ all clean:
diff --git a/sys-fs/diskdev_cmds/metadata.xml b/sys-fs/diskdev_cmds/metadata.xml
new file mode 100644
index 000000000000..e2ceeff332bf
--- /dev/null
+++ b/sys-fs/diskdev_cmds/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc</herd>
+<maintainer>
+<email>josejx@gentoo.org</email>
+<name>Joseph Jezak</name>
+</maintainer>
+<longdescription lang="en">
+HFS+ Filesytstem tools (mkfs.hfsplus and fsck.hfsplus), ported from Apple's
+versions.
+</longdescription>
+</pkgmetadata>
+
diff --git a/sys-fs/dmg2img/Manifest b/sys-fs/dmg2img/Manifest
new file mode 100644
index 000000000000..23e8b3a4eae8
--- /dev/null
+++ b/sys-fs/dmg2img/Manifest
@@ -0,0 +1,5 @@
+DIST dmg2img-1.6.1.tar.gz 38025 SHA256 55e65c1e47bf78f09fb061b2db4f41c515c0cbaa932e3ff3b40bd2d981946ad2
+DIST dmg2img-1.6.2.tar.gz 24541 SHA256 8f1508a70cbe2275023ec293667790a813fada07fb4a39223e07bd44b3967dc5
+DIST dmg2img-1.6.4.tar.gz 24335 SHA256 cbbb8366196eea4609b35807a72b39b9edae7e518748a42c6dc6b69ee19d99ed SHA512 4c40e4b58c010e40661f4061e1c111ce362d341309c0d16669f481f31051f026ac7af5fb1c196ea2da263f79900e03bee3ca88c15cb5ec58617721b01212469c WHIRLPOOL 30c247c90eb624c78e72b2bbd287cb07ce511f0586c96d571fe6451b1ad3b70ceab2cb92cf1e4d7a011bd0177abf8f1b0ffb647f0831dbd3677def0f6e151219
+DIST dmg2img-1.6.5.tar.gz 23442 SHA256 400a16cbe5cb2bf8a9eec4a43ef3546e0329f248bbd2a79f6d9a1ebc0b503308 SHA512 31528a23986848a8ab319768a8254db6b0035324cbac8328ef865b98ab2cddfd606da19a27202c4ef53cdc5dda75aca489859f82115a5dde6fe9b1f20cd6bd46 WHIRLPOOL bbf35c53b42f821603610a33faa1868b2c4d66e76347d39ba2069662c7ea65d3b5aacfa6f2d09e5e602b5fb47e68d3914cd8cab8d6009aba2b6f8fff40f5077d
+DIST dmg2img-1.6.tar.gz 38003 SHA256 c9a8253772eeccc18f3e92f72c7969a034cf2a7856f6a709b601e5a8e5188c48
diff --git a/sys-fs/dmg2img/dmg2img-1.6.1.ebuild b/sys-fs/dmg2img/dmg2img-1.6.1.ebuild
new file mode 100644
index 000000000000..94cbdb407db5
--- /dev/null
+++ b/sys-fs/dmg2img/dmg2img-1.6.1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit toolchain-funcs
+
+DESCRIPTION="Converts Apple DMG files to standard HFS+ images"
+HOMEPAGE="http://vu1tur.eu.org/tools"
+#SRC_URI="http://vu1tur.eu.org/tools/download.pl?${P}.tar.gz"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ app-arch/bzip2
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+src_prepare() {
+ sed -i -e 's:-s:$(LDFLAGS):g' Makefile || die "sed failed"
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ dosbin dmg2img vfdecrypt || die "dosbin failed"
+ dodoc README
+}
diff --git a/sys-fs/dmg2img/dmg2img-1.6.2.ebuild b/sys-fs/dmg2img/dmg2img-1.6.2.ebuild
new file mode 100644
index 000000000000..f247b5a181e5
--- /dev/null
+++ b/sys-fs/dmg2img/dmg2img-1.6.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit toolchain-funcs
+
+DESCRIPTION="Converts Apple DMG files to standard HFS+ images"
+HOMEPAGE="http://vu1tur.eu.org/tools"
+SRC_URI="http://vu1tur.eu.org/tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ app-arch/bzip2
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+src_prepare() {
+ sed -i -e 's:-s:$(LDFLAGS):g' Makefile || die "sed failed"
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ dosbin dmg2img vfdecrypt || die "dosbin failed"
+ dodoc README
+ doman vfdecrypt.1
+}
diff --git a/sys-fs/dmg2img/dmg2img-1.6.4.ebuild b/sys-fs/dmg2img/dmg2img-1.6.4.ebuild
new file mode 100644
index 000000000000..5f9c703d031b
--- /dev/null
+++ b/sys-fs/dmg2img/dmg2img-1.6.4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit toolchain-funcs
+
+DESCRIPTION="Converts Apple DMG files to standard HFS+ images"
+HOMEPAGE="http://vu1tur.eu.org/tools"
+SRC_URI="http://vu1tur.eu.org/tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ app-arch/bzip2
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+src_prepare() {
+ sed -i -e 's:-s:$(LDFLAGS):g' Makefile || die "sed failed"
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ dosbin dmg2img vfdecrypt
+ dodoc README
+ doman vfdecrypt.1
+}
diff --git a/sys-fs/dmg2img/dmg2img-1.6.5.ebuild b/sys-fs/dmg2img/dmg2img-1.6.5.ebuild
new file mode 100644
index 000000000000..711fe160f4df
--- /dev/null
+++ b/sys-fs/dmg2img/dmg2img-1.6.5.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit toolchain-funcs
+
+DESCRIPTION="Converts Apple DMG files to standard HFS+ images"
+HOMEPAGE="http://vu1tur.eu.org/tools"
+SRC_URI="http://vu1tur.eu.org/tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ app-arch/bzip2
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+src_prepare() {
+ sed -i -e 's:-s:$(LDFLAGS):g' Makefile || die "sed failed"
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ dobin dmg2img vfdecrypt
+ dodoc README
+ doman vfdecrypt.1
+}
diff --git a/sys-fs/dmg2img/dmg2img-1.6.ebuild b/sys-fs/dmg2img/dmg2img-1.6.ebuild
new file mode 100644
index 000000000000..b89b644e2af5
--- /dev/null
+++ b/sys-fs/dmg2img/dmg2img-1.6.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit toolchain-funcs
+
+DESCRIPTION="Converts Apple DMG files to standard HFS+ images"
+HOMEPAGE="http://vu1tur.eu.org/tools"
+#SRC_URI="http://vu1tur.eu.org/tools/download.pl?${P}.tar.gz"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ app-arch/bzip2
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+src_prepare() {
+ sed -i -e 's:-s:$(LDFLAGS):g' Makefile || die "sed failed"
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ dosbin dmg2img vfdecrypt || die "dosbin failed"
+ dodoc README
+}
diff --git a/sys-fs/dmg2img/metadata.xml b/sys-fs/dmg2img/metadata.xml
new file mode 100644
index 000000000000..05318e4ef169
--- /dev/null
+++ b/sys-fs/dmg2img/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<maintainer>
+<email>josejx@gentoo.org</email>
+<name>Joseph Jezak</name>
+</maintainer>
+<longdescription lang="en">
+ dmg2img is an application that can convert .dmg files, popular on Mac OSX
+ systems, to HFS+ disk images, suitable for mounting on Linux systems.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/dmraid/Manifest b/sys-fs/dmraid/Manifest
new file mode 100644
index 000000000000..a89aedad182c
--- /dev/null
+++ b/sys-fs/dmraid/Manifest
@@ -0,0 +1,3 @@
+DIST dmraid-1.0.0.rc14.tar.bz2 164234 SHA256 a777354d6d69a9b58d84966cc7b37bc3f5c89539f885ad25fd874ed1c388fbec SHA512 0804e1bf91f4707b8845affeb987e68c5a85d97119af27ddba2927c87735a59b86b1fec4f03ac0fbdcde89d779d77e21cab4e6936dd1a82b53a0d8b16eb59768 WHIRLPOOL c5612139d3f24be710fb8e6d51eb6ebe0847dcf804c0c0ba1a5f3142a2680de2b33bfae74bbf3cff704b0da5d9d273c432906f1b7fd46e1057b8ef53cc89ca1e
+DIST dmraid-1.0.0.rc15.tar.bz2 190475 SHA256 30847258b7f946ed908e79af4058bbf2c9a3791728b8231f7c490ca601566c05
+DIST dmraid-1.0.0.rc16-3.tar.bz2 232743 SHA256 93421bd169d71ff5e7d2db95b62b030bfa205a12010b6468dcdef80337d6fbd8 SHA512 7c45e5117adc52fc2094b1b2bad4f4c518a46317a2196611966d72085ba3587c4ac8d1080f9d934888c01788f2b2d3d621c6f0d3e2a023c0fb1f9f3fa7fc127e WHIRLPOOL 87915ea0013766da8a9722b437bfe146b4b2c7560a7814ac6caab92054ddc3b4b59ceb4d413609d5eaab92b5cee67886ade7924455f1dba19f1b8dabc25d3498
diff --git a/sys-fs/dmraid/dmraid-1.0.0_rc14.ebuild b/sys-fs/dmraid/dmraid-1.0.0_rc14.ebuild
new file mode 100644
index 000000000000..be58d8d95f43
--- /dev/null
+++ b/sys-fs/dmraid/dmraid-1.0.0_rc14.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit linux-info flag-o-matic eutils
+
+MY_PV=${PV/_/.}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="Device-mapper RAID tool and library"
+HOMEPAGE="http://people.redhat.com/~heinzm/sw/dmraid/"
+SRC_URI="http://people.redhat.com/~heinzm/sw/dmraid/src/old/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="static selinux"
+
+DEPEND=">=sys-fs/lvm2-2.02.45
+ selinux? ( sys-libs/libselinux
+ sys-libs/libsepol )"
+S=${WORKDIR}/${PN}/${MY_PV}
+
+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
+ if use static && use selinux ; then
+ eerror "ERROR - cannot compile static with libselinux / libsepol"
+ die "USE flag conflicts."
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/dmraid-destdir-fix.patch
+}
+
+src_compile() {
+ econf \
+ $(use_enable static static_link) \
+ $(use_enable selinux libselinux) \
+ $(use_enable selinux libsepol) \
+ || die "econf failed"
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc CHANGELOG README TODO KNOWN_BUGS doc/*
+}
+
+pkg_postinst() {
+ einfo "For booting Gentoo from Device-Mapper RAID you can use Genkernel."
+ einfo " "
+ einfo "Genkernel will generate the kernel and the initrd with a statically "
+ einfo "linked dmraid binary (its own version which may not be the same as this version):"
+ einfo "emerge -av sys-kernel/genkernel"
+ einfo "genkernel --dmraid --udev all"
+ einfo " "
+ einfo "If you would rather use this version of DMRAID with Genkernel, copy the distfile"
+ einfo "from your distdir to '/usr/share/genkernel/pkg/' and update the following"
+ einfo "in /etc/genkernel.conf:"
+ einfo "DMRAID_VER=\"${MY_PV/_/.}\""
+ einfo "DMRAID_SRCTAR=\"\${GK_SHARE}/pkg/${A}\""
+ einfo " "
+ ewarn "DMRAID should be safe to use, but no warranties can be given"
+ einfo " "
+}
diff --git a/sys-fs/dmraid/dmraid-1.0.0_rc15.ebuild b/sys-fs/dmraid/dmraid-1.0.0_rc15.ebuild
new file mode 100644
index 000000000000..4f72bc28b0c9
--- /dev/null
+++ b/sys-fs/dmraid/dmraid-1.0.0_rc15.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit linux-info flag-o-matic eutils
+
+MY_PV=${PV/_/.}
+
+DESCRIPTION="Device-mapper RAID tool and library"
+HOMEPAGE="http://people.redhat.com/~heinzm/sw/dmraid/"
+SRC_URI="http://people.redhat.com/~heinzm/sw/dmraid/src/${PN}-${MY_PV}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ppc ~x86"
+IUSE="static selinux"
+
+DEPEND=">=sys-fs/lvm2-2.02.45
+ selinux? ( sys-libs/libselinux
+ sys-libs/libsepol )"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${PN}/${MY_PV}
+
+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
+ if use static && use selinux ; then
+ eerror "ERROR - cannot compile static with libselinux / libsepol"
+ die "USE flag conflicts."
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${PN}-destdir-fix.patch"
+}
+
+src_compile() {
+ econf \
+ $(use_enable static static_link) \
+ $(use_enable selinux libselinux) \
+ $(use_enable selinux libsepol)
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ dodoc CHANGELOG README TODO KNOWN_BUGS doc/* || die "dodoc failed"
+}
+
+pkg_postinst() {
+ einfo "For booting Gentoo from Device-Mapper RAID you can use Genkernel."
+ einfo " "
+ einfo "Genkernel will generate the kernel and the initrd with a statically "
+ einfo "linked dmraid binary (its own version which may not be the same as this version):"
+ einfo " emerge -av sys-kernel/genkernel"
+ einfo " genkernel --dmraid --udev all"
+ einfo " "
+ einfo "If you would rather use this version of DMRAID with Genkernel, copy the distfile"
+ einfo "from your distdir to '/usr/share/genkernel/pkg/' and update the following"
+ einfo "in /etc/genkernel.conf:"
+ einfo " DMRAID_VER=\"${MY_PV/_/.}\""
+ einfo " DMRAID_SRCTAR=\"\${GK_SHARE}/pkg/${A}\""
+ einfo " "
+ ewarn "DMRAID should be safe to use, but no warranties can be given"
+ einfo " "
+}
diff --git a/sys-fs/dmraid/dmraid-1.0.0_rc16-r3.ebuild b/sys-fs/dmraid/dmraid-1.0.0_rc16-r3.ebuild
new file mode 100644
index 000000000000..48de3497b796
--- /dev/null
+++ b/sys-fs/dmraid/dmraid-1.0.0_rc16-r3.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools linux-info flag-o-matic eutils
+
+MY_PV=${PV/_/.}-3
+
+DESCRIPTION="Device-mapper RAID tool and library"
+HOMEPAGE="http://people.redhat.com/~heinzm/sw/dmraid/"
+SRC_URI="http://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_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
+ 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
+}
diff --git a/sys-fs/dmraid/files/dmraid-1.0.0_rc15-devsk-isw.patch b/sys-fs/dmraid/files/dmraid-1.0.0_rc15-devsk-isw.patch
new file mode 100644
index 000000000000..1ce8834ebadd
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-1.0.0_rc15-devsk-isw.patch
@@ -0,0 +1,24 @@
+--- ./lib/device/scsi.c.org 2009-06-25 15:22:26.605895909 -0700
++++ ./lib/device/scsi.c 2009-06-25 15:56:39.784749181 -0700
+@@ -110,7 +110,9 @@
+ }
+
+ ret = ret &&
+- (di->serial = dbg_strdup((char *) &response[p->start + 1]));
++ (di->serial = dbg_strdup(remove_white_space
++ (lc, (char *)&response[p->start + 1],
++ MAX_RESPONSE_LEN)));
+ }
+
+ dbg_free(response);
+--- ./lib/metadata/metadata.c.org 2009-06-25 17:32:19.856309659 -0700
++++ ./lib/metadata/metadata.c 2009-06-25 17:32:35.502920755 -0700
+@@ -839,7 +839,7 @@
+ */
+ if (T_GROUP(rs)) {
+ _discover_partitions(lc, &rs->sets);
+- return;
++ continue;
+ }
+
+ /*
diff --git a/sys-fs/dmraid/files/dmraid-1.0.0_rc15-undo-p-rename.patch b/sys-fs/dmraid/files/dmraid-1.0.0_rc15-undo-p-rename.patch
new file mode 100644
index 000000000000..6636b0563086
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-1.0.0_rc15-undo-p-rename.patch
@@ -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);
+ }
+
diff --git a/sys-fs/dmraid/files/dmraid-1.0.0_rc16-as-needed2.patch b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-as-needed2.patch
new file mode 100644
index 000000000000..cf3018863ffd
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-as-needed2.patch
@@ -0,0 +1,11 @@
+--- 1.0.0.rc16/make.tmpl.in 2010-08-16 10:22:32.000000000 -0400
++++ 1.0.0.rc16/make.tmpl.in 2010-08-16 10:42:49.000000000 -0400
+@@ -136,7 +136,7 @@
+
+ %.so: $(OBJECTS)
+ $(CC) -shared -Wl,-soname,$(notdir $@).$(DMRAID_LIB_VERSION) \
+- -Wl,--version-script,.export.sym $(OBJECTS) -o $@ -ldevmapper-event
++ $(LDFLAGS) -Wl,--version-script,.export.sym $(OBJECTS) -o $@ -ldevmapper-event -ldl
+
+ $(LIB_STATIC): $(OBJECTS)
+ $(RM) $@
diff --git a/sys-fs/dmraid/files/dmraid-1.0.0_rc16-return-all-sets.patch b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-return-all-sets.patch
new file mode 100644
index 000000000000..1e6c71322498
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-return-all-sets.patch
@@ -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;
+ }
+
+ /*
diff --git a/sys-fs/dmraid/files/dmraid-1.0.0_rc16-static-build-fixes.patch b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-static-build-fixes.patch
new file mode 100644
index 000000000000..298811701e4e
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-static-build-fixes.patch
@@ -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) \ No newline at end of file
diff --git a/sys-fs/dmraid/files/dmraid-1.0.0_rc16-undo-p-rename.patch b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-undo-p-rename.patch
new file mode 100644
index 000000000000..6636b0563086
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-1.0.0_rc16-undo-p-rename.patch
@@ -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);
+ }
+
diff --git a/sys-fs/dmraid/files/dmraid-destdir-fix.patch b/sys-fs/dmraid/files/dmraid-destdir-fix.patch
new file mode 100644
index 000000000000..07c6b442f9a6
--- /dev/null
+++ b/sys-fs/dmraid/files/dmraid-destdir-fix.patch
@@ -0,0 +1,34 @@
+--- make.tmpl.in.old 2006-09-03 14:38:36.000000000 -0400
++++ make.tmpl.in 2006-09-03 14:37:43.000000000 -0400
+@@ -21,21 +21,21 @@
+ SOFLAG += @SOFLAG@
+
+ # Setup directory variables
+-prefix = $(DESTDIR)@prefix@
+-exec_prefix = $(DESTDIR)@exec_prefix@
+-bindir = @bindir@
++prefix = @prefix@
++exec_prefix = @exec_prefix@
++bindir = $(DESTDIR)@bindir@
+ ifeq ("@KLIBC@", "no")
+- libdir = @libdir@
+- sbindir = @sbindir@
+- includedir = @includedir@
+- infodir = @infodir@
+- mandir = @mandir@
++ libdir = $(DESTDIR)@libdir@
++ sbindir = $(DESTDIR)@sbindir@
++ includedir = $(DESTDIR)@includedir@
++ infodir = $(DESTDIR)@infodir@
++ mandir = $(DESTDIR)@mandir@
+ else
+ libdir = $(DESTDIR)@KLIBC_LIB_DIR@
+ sbindir = $(DESTDIR)@KLIBC_SBIN_DIR@
+ includedir = $(DESTDIR)@KLIBC_INCLUDE_DIR@
+- infodir = @infodir@
+- mandir = @mandir@
++ infodir = $(DESTDIR)@infodir@
++ mandir = $(DESTDIR)@mandir@
+ endif
+
+
diff --git a/sys-fs/dmraid/metadata.xml b/sys-fs/dmraid/metadata.xml
new file mode 100644
index 000000000000..e357fd86cf1d
--- /dev/null
+++ b/sys-fs/dmraid/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name='dietlibc'>Compile against <pkg>dev-libs/dietlibc</pkg></flag>
+ <flag name='intel_led'>Enable Intel LED support</flag>
+ <flag name='klibc'>Compile against <pkg>dev-libs/klibc</pkg></flag>
+ <flag name='led'>Enable LED support</flag>
+ <flag name='mini'>Create a minimal binary suitable for early boot environments</flag>
+ </use>
+ <maintainer>
+ <email>axs@gentoo.org</email>
+ <name>Ian Stakenvicius</name>
+ </maintainer>
+ <longdescription>This software discovers, activates, deactivates and displays properties of software RAID sets eg: ATARAID and contained DOS partitions.</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/dosfstools/Manifest b/sys-fs/dosfstools/Manifest
new file mode 100644
index 000000000000..63350b070646
--- /dev/null
+++ b/sys-fs/dosfstools/Manifest
@@ -0,0 +1,3 @@
+DIST dosfstools-3.0.26.tar.xz 79196 SHA256 468442fe8cd93961047d5cd67f7b67793126575103a67cd131330512b4893e75 SHA512 52b04950268ed4750d5c4d61b613f0f0e9083e91301499b8bf82efd125c75ecaeb444fdd682fa11ec1ce525d32a70937f621430b9995ea920f14d7b35a07b4ca WHIRLPOOL 6a581e8d0fef575c76330a69c063f46bccc7cbc673247228f7b4565e381cd93d7b847ff9afe4ed4c4318a86d456a65829dea2da3016e786c34e3d0f32b0ea399
+DIST dosfstools-3.0.27.tar.xz 79944 SHA256 85768eac8bd28d3bab62efb6f6d793c65b3fb81b9b38a5fe0b73e12f5ed158a8 SHA512 cf81a396f9e26e825f096c07576f161b77295255aa77a0dcc5c862eab2b0bb83bb3e7b1426b3fdb66afc3a45ea49340efb0be65dfa996dabc57eeb28c9420f83 WHIRLPOOL 1aa92d063b1697fa92343799e2af8313b3e480f5922d1c56d72d321cb6388b0d2b247a2200ec07dee0112a1101acb6a9c82143b21ee2bb750726e250dbcb99f6
+DIST dosfstools-3.0.28.tar.xz 82980 SHA256 ee95913044ecf2719b63ea11212917649709a6e53209a72d622135aaa8517ee2 SHA512 7325a9e05f51715b358cab0a8fa8f8096422b470f1a43eecfab2adbb954e1daf6a24003121be5b3a22de5fcb3e3adffbf1551e2158852b6663fd57a109f057ad WHIRLPOOL b584aa1dee4db96c04f19b6ac46b6322c533fcadbafb09546412e4d6a7568e23abe6985389dc446dacbe2d14f36dd7a8b52fc83b93ab1f5864b4b61f14f6ffd0
diff --git a/sys-fs/dosfstools/dosfstools-3.0.26.ebuild b/sys-fs/dosfstools/dosfstools-3.0.26.ebuild
new file mode 100644
index 000000000000..e57fc847c746
--- /dev/null
+++ b/sys-fs/dosfstools/dosfstools-3.0.26.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat"
+HOMEPAGE="http://www.daniel-baumann.ch/software/dosfstools/"
+SRC_URI="http://www.daniel-baumann.ch/files/software/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+RESTRICT="test" # there is no test target #239071
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.0.20-name-ext.patch
+ sed -i \
+ -e "/^PREFIX/s:=.*:= ${EPREFIX}/usr:" \
+ -e '/^OPTFLAGS/d' \
+ -e '/^DEBUGFLAGS/d' \
+ -e "/\$(DOCDIR)/s:${PN}:${PF}:" \
+ Makefile || die
+ append-lfs-flags
+ tc-export CC
+}
diff --git a/sys-fs/dosfstools/dosfstools-3.0.27.ebuild b/sys-fs/dosfstools/dosfstools-3.0.27.ebuild
new file mode 100644
index 000000000000..926cbb9e6ca7
--- /dev/null
+++ b/sys-fs/dosfstools/dosfstools-3.0.27.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat"
+HOMEPAGE="http://www.daniel-baumann.ch/software/dosfstools/"
+SRC_URI="https://github.com/dosfstools/dosfstools/releases/download/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+RESTRICT="test" # there is no test target #239071
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.0.20-name-ext.patch
+ sed -i \
+ -e "/^PREFIX/s:=.*:= ${EPREFIX}/usr:" \
+ -e '/^OPTFLAGS/d' \
+ -e '/^DEBUGFLAGS/d' \
+ -e "/\$(DOCDIR)/s:${PN}:${PF}:" \
+ Makefile || die
+ append-lfs-flags
+ tc-export CC
+}
diff --git a/sys-fs/dosfstools/dosfstools-3.0.28.ebuild b/sys-fs/dosfstools/dosfstools-3.0.28.ebuild
new file mode 100644
index 000000000000..d166419eaa7b
--- /dev/null
+++ b/sys-fs/dosfstools/dosfstools-3.0.28.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat"
+HOMEPAGE="http://www.daniel-baumann.ch/software/dosfstools/"
+SRC_URI="https://github.com/dosfstools/dosfstools/releases/download/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RESTRICT="test" # there is no test target #239071
+
+src_prepare() {
+ sed -i \
+ -e "/^PREFIX/s:=.*:= ${EPREFIX}/usr:" \
+ -e '/^OPTFLAGS/d' \
+ -e '/^DEBUGFLAGS/d' \
+ -e "/\$(DOCDIR)/s:${PN}:${PF}:" \
+ Makefile || die
+ append-lfs-flags
+ tc-export CC
+}
diff --git a/sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch b/sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch
new file mode 100644
index 000000000000..71149bd4d803
--- /dev/null
+++ b/sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch
@@ -0,0 +1,29 @@
+avoid fortify warnings about going beyond array bounds as the strcmp
+assumes name[8] and ext[3] are together
+
+--- dosfstools-3.0.20/src/check.c
++++ dosfstools-3.0.20/src/check.c
+@@ -264,7 +264,7 @@
+ {
+ int i, spc, suspicious = 0;
+ const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:";
+- const unsigned char *name = file->dir_ent.name;
++ const unsigned char *name = file->dir_ent.name_ext;
+ const unsigned char *ext = file->dir_ent.ext;
+
+ /* Do not complain about (and auto-correct) the extended attribute files
+--- dosfstools-3.0.20/src/fsck.fat.h
++++ dosfstools-3.0.20/src/fsck.fat.h
+@@ -126,7 +126,12 @@
+ };
+
+ typedef struct {
++ union {
++ struct {
+ __u8 name[8], ext[3]; /* name and extension */
++ };
++ __u8 name_ext[11];
++ };
+ __u8 attr; /* attribute bits */
+ __u8 lcase; /* Case for base and extension */
+ __u8 ctime_ms; /* Creation time, milliseconds */
diff --git a/sys-fs/dosfstools/metadata.xml b/sys-fs/dosfstools/metadata.xml
new file mode 100644
index 000000000000..afead5b884b9
--- /dev/null
+++ b/sys-fs/dosfstools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="github">dosfstools/dosfstools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/duperemove/Manifest b/sys-fs/duperemove/Manifest
new file mode 100644
index 000000000000..c1911b8eeb8b
--- /dev/null
+++ b/sys-fs/duperemove/Manifest
@@ -0,0 +1,5 @@
+DIST duperemove-0.09.1.tar.gz 54978 SHA256 58d5635fa48bf88108dd833453638ad394427750f58b5ee0f3f1a8f1ec9c141b SHA512 49de99b64c8b0a71a47474480f33b07f2e6602c355621a9d0c6c92a3b7c2f2f5e6c03abc4e2459a1b96fa9543767c0abe48c5c63daf53962a3033a3b1984a037 WHIRLPOOL bed45acfd63f49f44832589964a305614649b6f41013295d1710d784f8dfeb34ff5721ae641790b97b70541222987135377913843b516850f62689ad66a18661
+DIST duperemove-0.09.2.tar.gz 55715 SHA256 2f7155bb916f4827a940c7ceb16c785b529320e621d3c7cbbd78639a06e65094 SHA512 acc1c16ed3faf08e54d4adfcc9f852d2c967981bc461ab45b0673f46f2e86109020d56e641da9764d46f2cc53cbcad5d2aa014357a819ae170375d784b2c08c5 WHIRLPOOL b5cd27237fadbe9aecf76abf63788bcbbabcc17625f1d3daeeee2b315b1a3b9b67fa9309703857e0c564d53fd1573983aa9a55c5b406a56855af7911375bc60b
+DIST duperemove-0.09.3.tar.gz 55722 SHA256 349b047cfb388f2d616695b4ecbfa091243f84024bd75fbbbd7b88fb498794a0 SHA512 fe2a19088ec9ac3dda35da8b9580ddcc1c3b49e60824f2c1bbf8c013756c060b4c9663d1977bb6622c4de19754fd4a1011cc09ef3c785c2b4b218e0c9fb15b87 WHIRLPOOL 022eba5fb6ad1a4c74a4843762e7ccc7f6ba8187adbd6eb1bbe0168482cdd57664d7f6d9b4715d36866a8d026786abcf1e77ec87530f46fbea59b1357d4c90a4
+DIST duperemove-0.09.4.tar.gz 55725 SHA256 9d4c7fe0fd7ae3acb8c144e5fa8648749366c1e67a97ecbb28f07df0bb72fb29 SHA512 dff728a34bdf8df71aa13b7f9c8ffae8ce643337f4dafacb3ceeb778d326b1885f63ae03215c6d714c4fcd7b2f26b03e47d7ad3a42eca3f2d5de5b596b653bf1 WHIRLPOOL 806e5469ac7fbd6b9a1e3803f153a6a2e5eecc14fa05b9f08b3d5b1f16609fb5bc2c576c45133ac6c6a76e5d63fce4a98d44ab4e8b180b5cbccf06355d3967bc
+DIST duperemove-0.09.5.tar.gz 56175 SHA256 8c8c781ab53435dfcc114d2a500525c72428fdbafc14ead10de115d77b447b69 SHA512 111127d9ab7d5567de8393197cf5bc977db1f64b7405fd848e1ca5aaa5ca7a3057fa06b61b161d0dfc45e0c5ebcc2406218d9a834db519c7ca348cdc7a0fe2f2 WHIRLPOOL aff0d6cbab8f6f76cc528316dd17656e3b190809e3955bf83f59745b5dfd085e17b832dc09b4aa3ca6312bbfb199bea0f3ecb4f59d1bcc11c1743d97da93213c
diff --git a/sys-fs/duperemove/duperemove-0.09.1.ebuild b/sys-fs/duperemove/duperemove-0.09.1.ebuild
new file mode 100644
index 000000000000..9d7fc7a7f5f2
--- /dev/null
+++ b/sys-fs/duperemove/duperemove-0.09.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+DESCRIPTION="Btrfs deduplication utility."
+
+HOMEPAGE="https://github.com/markfasheh/duperemove"
+
+SRC_URI="https://github.com/markfasheh/duperemove/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+
+SLOT="0"
+
+KEYWORDS="~amd64"
+
+DEPEND="dev-libs/glib:2="
+
+RDEPEND="${DEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="/usr" install
+}
diff --git a/sys-fs/duperemove/duperemove-0.09.2.ebuild b/sys-fs/duperemove/duperemove-0.09.2.ebuild
new file mode 100644
index 000000000000..8936e1abfcb8
--- /dev/null
+++ b/sys-fs/duperemove/duperemove-0.09.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Btrfs deduplication utility"
+HOMEPAGE="https://github.com/markfasheh/duperemove"
+SRC_URI="https://github.com/markfasheh/duperemove/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-libs/glib:2=
+ dev-libs/libgcrypt:0="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # https://github.com/markfasheh/duperemove/issues/53#issuecomment-89796552
+ sed -i -e '/glib2_mutex_unlock/s:mutex_lock:mutex_unlock:' duperemove.c || die
+}
+
+src_compile() {
+ # CC & CFLAGS are set via = so need to override them
+ # LIBRARY_FLAGS are set via += so need to pass them via env
+ export LIBRARY_FLAGS="${LDFLAGS}"
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Wall"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="/usr" install
+}
diff --git a/sys-fs/duperemove/duperemove-0.09.3.ebuild b/sys-fs/duperemove/duperemove-0.09.3.ebuild
new file mode 100644
index 000000000000..fb5407dddd23
--- /dev/null
+++ b/sys-fs/duperemove/duperemove-0.09.3.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Btrfs deduplication utility"
+HOMEPAGE="https://github.com/markfasheh/duperemove"
+SRC_URI="https://github.com/markfasheh/duperemove/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-libs/glib:2=
+ dev-libs/libgcrypt:0="
+DEPEND="${RDEPEND}"
+
+src_compile() {
+ # CC & CFLAGS are set via = so need to override them
+ # LIBRARY_FLAGS are set via += so need to pass them via env
+ export LIBRARY_FLAGS="${LDFLAGS}"
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Wall"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="/usr" install
+}
diff --git a/sys-fs/duperemove/duperemove-0.09.4.ebuild b/sys-fs/duperemove/duperemove-0.09.4.ebuild
new file mode 100644
index 000000000000..fb5407dddd23
--- /dev/null
+++ b/sys-fs/duperemove/duperemove-0.09.4.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Btrfs deduplication utility"
+HOMEPAGE="https://github.com/markfasheh/duperemove"
+SRC_URI="https://github.com/markfasheh/duperemove/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-libs/glib:2=
+ dev-libs/libgcrypt:0="
+DEPEND="${RDEPEND}"
+
+src_compile() {
+ # CC & CFLAGS are set via = so need to override them
+ # LIBRARY_FLAGS are set via += so need to pass them via env
+ export LIBRARY_FLAGS="${LDFLAGS}"
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Wall"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="/usr" install
+}
diff --git a/sys-fs/duperemove/duperemove-0.09.5.ebuild b/sys-fs/duperemove/duperemove-0.09.5.ebuild
new file mode 100644
index 000000000000..fb5407dddd23
--- /dev/null
+++ b/sys-fs/duperemove/duperemove-0.09.5.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Btrfs deduplication utility"
+HOMEPAGE="https://github.com/markfasheh/duperemove"
+SRC_URI="https://github.com/markfasheh/duperemove/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-libs/glib:2=
+ dev-libs/libgcrypt:0="
+DEPEND="${RDEPEND}"
+
+src_compile() {
+ # CC & CFLAGS are set via = so need to override them
+ # LIBRARY_FLAGS are set via += so need to pass them via env
+ export LIBRARY_FLAGS="${LDFLAGS}"
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -Wall"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="/usr" install
+}
diff --git a/sys-fs/duperemove/metadata.xml b/sys-fs/duperemove/metadata.xml
new file mode 100644
index 000000000000..e74936a1dbfc
--- /dev/null
+++ b/sys-fs/duperemove/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>rich0@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <longdescription>Btrfs deduplication utility.</longdescription>
+ <upstream>
+ <remote-id type="github">markfasheh/duperemove</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/e2fsprogs/Manifest b/sys-fs/e2fsprogs/Manifest
new file mode 100644
index 000000000000..ed319e26019b
--- /dev/null
+++ b/sys-fs/e2fsprogs/Manifest
@@ -0,0 +1,4 @@
+DIST e2fsprogs-1.41.7.tar.gz 4425159 SHA256 2e2eeb5201e952dd02b77f609a0e630acdbce5d2b823ec11668e34f6bfde2f2c SHA512 c17c5f23feb7747941e7f019f197cca1cd4a84c067ad27d1a578ae213c7d7274aa79f3a64c7d69515f3f94db80df01ca71d4af83e9ea84c578a7257205395f7c WHIRLPOOL f760d7e658a1c78835ca470d077c7076a21f727f7d0a2411f5428363d12b7cd1676e2f221be9d9d1f5843c25320f7ef2f896ea47c9d4dc91190e0bc7df89ef36
+DIST e2fsprogs-1.42.12.tar.gz 6381695 SHA256 e17846d91a0edd89fa59b064bde8f8e5cec5851e35f587bcccb4014dbd63186c SHA512 a4b03470ed8f3e6c353250d80807070b8d5529ce219f7ec3076af89bd7cd674fbd443aab4d07dccff74606c9f620e349da32b451e3896a0635f6c700419f7cbf WHIRLPOOL 15f85fe969b174a99f06d875afafc83cc3e85cde0d8f1d833cb045c30259b3bfa9293ee84eeb793d9c60ece2cba4ca6bacbb8c861f11f3b56bd863ca1a2296f2
+DIST e2fsprogs-1.42.13.tar.gz 6511931 SHA256 59993ff3a44f82e504561e0ebf95e8c8fa9f9f5746eb6a7182239605d2a4e2d4 SHA512 d341790f55c3bff34425369063757280b9ba6ac08f405e14f94f299345ae76c0dc6e90871b746cc98c73467448d888fe5bc029688b5eed5fd22c3c37bf285cd0 WHIRLPOOL 2b26e355ad8e378cc7402be5fd5f5abe0af2aa6a1214b357dca682b922aa07c97af427b369ef21ddb3ee731768234a5f5faf488b92a68b0175d07845dbe7783f
+DIST e2fsprogs-1.42.9-mint-r1.patch.xz 9012 SHA256 3904654080b7f7776e97b703d17e1b59ae1d6f5e0cf32193b86e986bc0a9b396 SHA512 591a7c80d65082eebcdc455028be6ade05c9aae96c94f654106be0facef330a8875dae82891e6e3ad2b48dece2b4e1c1940dbc47cd3eba3e6eea3b5ddba9a8fc WHIRLPOOL ae6fc015fa77bfbde7a4ba2205c014b655e736c4ed5cb63a913245c6c40fa0637b65fa3eec6399dd1793c494892b76e0bbc12ffa6ac9c39d4da27333d8bbf6c7
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.41.7-r1.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.41.7-r1.ebuild
new file mode 100644
index 000000000000..6fdc1ddfc9c5
--- /dev/null
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.41.7-r1.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
+HOMEPAGE="http://e2fsprogs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/e2fsprogs/${P}.tar.gz"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+IUSE="nls elibc_FreeBSD"
+
+RDEPEND="~sys-libs/${PN}-libs-${PV}
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig
+ sys-apps/texinfo"
+
+pkg_setup() {
+ if [[ ! -e ${ROOT}/etc/mtab ]] ; then
+ # add some crap to deal with missing /etc/mtab #217719
+ ewarn "No /etc/mtab file, creating one temporarily"
+ echo "${PN} crap for src_test" > "${ROOT}"/etc/mtab
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-1.38-tests-locale.patch #99766
+ epatch "${FILESDIR}"/${PN}-1.41.5-makefile.patch
+ epatch "${FILESDIR}"/${PN}-1.40-fbsd.patch
+ epatch "${FILESDIR}"/0001-resize2fs-Fix-error-message-so-the-mountpoint-is-pri.patch #276352
+ # blargh ... trick e2fsprogs into using e2fsprogs-libs
+ rm -rf doc
+ sed -i -r \
+ -e 's:@LIBINTL@:@LTLIBINTL@:' \
+ -e '/^LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@LIB_EXT@:-l\1:' \
+ -e '/^DEPLIB(COM_ERR|SS)/s:=.*:=:' \
+ MCONFIG.in || die "muck libs" #122368
+ sed -i -r \
+ -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
+ Makefile.in || die "remove subdirs"
+ # stupid configure script clobbers CC for us
+ sed -i \
+ -e '/if test -z "$CC" ; then CC=cc; fi/d' \
+ configure || die "touching configure"
+
+ # we want to build the blkid/findfs binaries, but not the libs
+ sed -i \
+ -e '/BLKID_CMT=/s:BLKID_CMT:LIBBLKID_CMT:g' \
+ configure || die "touching configure for blkid"
+ sed -i \
+ -e '/BLKID_LIB_SUBDIR/s:@BLKID_CMT@:@LIBBLKID_CMT@:g' \
+ Makefile.in || die "remove blkid subdir better"
+ append-cppflags -DCONFIG_BUILD_FINDFS #275923
+
+ # Avoid rebuild
+ touch lib/ss/ss_err.h
+}
+
+src_compile() {
+ # Keep the package from doing silly things #261411
+ export VARTEXFONTS=${T}/fonts
+
+ # We want to use the "bsd" libraries while building on Darwin, but while
+ # building on other Gentoo/*BSD we prefer elf-naming scheme.
+ local libtype
+ case ${CHOST} in
+ *-darwin*) libtype=bsd;;
+ *) libtype=elf;;
+ esac
+
+ ac_cv_path_LDCONFIG=: \
+ econf \
+ --with-root-prefix=/ \
+ --enable-${libtype}-shlibs \
+ --with-ldopts="${LDFLAGS}" \
+ $(tc-has-tls || echo --disable-tls) \
+ --without-included-gettext \
+ $(use_enable nls) \
+ $(use_enable userland_GNU fsck) \
+ --disable-libblkid \
+ --disable-libuuid \
+ || die
+ if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
+ eerror "INTL sanity check failed, aborting build."
+ eerror "Please post your ${S}/config.log file as an"
+ eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096"
+ die "Preventing included intl cruft from building"
+ fi
+ emake COMPILE_ET=compile_et MK_CMDS=mk_cmds || die
+
+ # Build the FreeBSD helper
+ if use elibc_FreeBSD ; then
+ cp "${FILESDIR}"/fsck_ext2fs.c .
+ emake fsck_ext2fs || die
+ fi
+}
+
+pkg_preinst() {
+ if [[ -r ${ROOT}/etc/mtab ]] ; then
+ if [[ $(<"${ROOT}"/etc/mtab) == "${PN} crap for src_test" ]] ; then
+ rm -f "${ROOT}"/etc/mtab
+ fi
+ fi
+}
+
+src_install() {
+ # need to set root_libdir= manually as any --libdir options in the
+ # econf above (i.e. multilib) will screw up the default #276465
+ emake \
+ STRIP=: \
+ root_libdir="/$(get_libdir)" \
+ DESTDIR="${D}" \
+ install install-libs || die
+ dodoc README RELEASE-NOTES
+
+ if use elibc_FreeBSD ; then
+ # Install helpers for us
+ into /
+ dosbin "${S}"/fsck_ext2fs || die
+ doman "${FILESDIR}"/fsck_ext2fs.8
+
+ # these manpages are already provided by FreeBSD libc
+ # and filefrag is linux only
+ rm -f \
+ "${D}"/usr/sbin/filefrag \
+ "${D}"/usr/share/man/man8/filefrag.8 \
+ "${D}"/usr/bin/uuidgen \
+ "${D}"/usr/share/man/man3/{uuid,uuid_compare}.3 \
+ "${D}"/usr/share/man/man1/uuidgen.1 || die
+ fi
+}
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.42.12.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.42.12.ebuild
new file mode 100644
index 000000000000..3eb862835d44
--- /dev/null
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.42.12.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+case ${PV} in
+*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
+*) UP_PV=${PV} ;;
+esac
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
+HOMEPAGE="http://e2fsprogs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz
+ elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~m68k-mint"
+IUSE="nls static-libs elibc_FreeBSD"
+
+RDEPEND="~sys-libs/${PN}-libs-${PV}
+ >=sys-apps/util-linux-2.16
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig
+ sys-apps/texinfo"
+
+S=${WORKDIR}/${P%_pre*}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.41.8-makefile.patch
+ epatch "${FILESDIR}"/${PN}-1.40-fbsd.patch
+ if [[ ${CHOST} == *-mint* ]] ; then
+ epatch "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch
+ fi
+ epatch "${FILESDIR}"/${PN}-1.42.10-fix-build-cflags.patch #516854
+
+ # blargh ... trick e2fsprogs into using e2fsprogs-libs
+ rm -rf doc
+ sed -i -r \
+ -e 's:@LIBINTL@:@LTLIBINTL@:' \
+ -e '/^(STATIC_)?LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@(STATIC_)?LIB_EXT@:-l\1:' \
+ -e '/^DEP(STATIC_)?LIB(COM_ERR|SS)/s:=.*:=:' \
+ MCONFIG.in || die "muck libs" #122368
+ sed -i -r \
+ -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
+ Makefile.in || die "remove subdirs"
+ ln -s $(which mk_cmds) lib/ss/ || die
+
+ # Avoid rebuild
+ echo '#include_next <ss/ss_err.h>' > lib/ss/ss_err.h
+}
+
+src_configure() {
+ # Keep the package from doing silly things #261411
+ export VARTEXFONTS=${T}/fonts
+
+ # needs open64() prototypes and friends
+ append-cppflags -D_GNU_SOURCE
+
+ ac_cv_path_LDCONFIG=: \
+ econf \
+ --with-root-prefix="${EPREFIX}/" \
+ --enable-symlink-install \
+ $(tc-is-static-only || echo --enable-elf-shlibs) \
+ $(tc-has-tls || echo --disable-tls) \
+ --without-included-gettext \
+ $(use_enable nls) \
+ --disable-libblkid \
+ --disable-libuuid \
+ --disable-quota \
+ --disable-fsck \
+ --disable-uuidd
+ if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
+ eerror "INTL sanity check failed, aborting build."
+ eerror "Please post your ${S}/config.log file as an"
+ eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096"
+ die "Preventing included intl cruft from building"
+ fi
+}
+
+src_compile() {
+ emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds
+
+ # Build the FreeBSD helper
+ if use elibc_FreeBSD ; then
+ cp "${FILESDIR}"/fsck_ext2fs.c .
+ emake V=1 fsck_ext2fs
+ fi
+}
+
+src_install() {
+ # need to set root_libdir= manually as any --libdir options in the
+ # econf above (i.e. multilib) will screw up the default #276465
+ emake \
+ STRIP=: \
+ root_libdir="${EPREFIX}/usr/$(get_libdir)" \
+ DESTDIR="${D}" \
+ install install-libs
+ dodoc README RELEASE-NOTES
+
+ insinto /etc
+ doins "${FILESDIR}"/e2fsck.conf
+
+ # Move shared libraries to /lib/, install static libraries to
+ # /usr/lib/, and install linker scripts to /usr/lib/.
+ gen_usr_ldscript -a e2p ext2fs
+ # configure doesn't have an option to disable static libs :/
+ use static-libs || find "${D}" -name '*.a' -delete
+
+ if use elibc_FreeBSD ; then
+ # Install helpers for us
+ into /
+ dosbin "${S}"/fsck_ext2fs
+ doman "${FILESDIR}"/fsck_ext2fs.8
+
+ # filefrag is linux only
+ rm \
+ "${ED}"/usr/sbin/filefrag \
+ "${ED}"/usr/share/man/man8/filefrag.8 || die
+ fi
+}
diff --git a/sys-fs/e2fsprogs/e2fsprogs-1.42.13.ebuild b/sys-fs/e2fsprogs/e2fsprogs-1.42.13.ebuild
new file mode 100644
index 000000000000..03e558ff6e4e
--- /dev/null
+++ b/sys-fs/e2fsprogs/e2fsprogs-1.42.13.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+case ${PV} in
+*_pre*) UP_PV="${PV%_pre*}-WIP-${PV#*_pre}" ;;
+*) UP_PV=${PV} ;;
+esac
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="Standard EXT2/EXT3/EXT4 filesystem utilities"
+HOMEPAGE="http://e2fsprogs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/e2fsprogs/${PN}-${UP_PV}.tar.gz
+ elibc_mintlib? ( mirror://gentoo/${PN}-1.42.9-mint-r1.patch.xz )"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 -x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~m68k-mint"
+IUSE="nls static-libs elibc_FreeBSD"
+
+RDEPEND="~sys-libs/${PN}-libs-${PV}
+ >=sys-apps/util-linux-2.16
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/pkgconfig
+ sys-apps/texinfo"
+
+S=${WORKDIR}/${P%_pre*}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.41.8-makefile.patch
+ epatch "${FILESDIR}"/${PN}-1.40-fbsd.patch
+ if [[ ${CHOST} == *-mint* ]] ; then
+ epatch "${WORKDIR}"/${PN}-1.42.9-mint-r1.patch
+ fi
+ epatch "${FILESDIR}"/${PN}-1.42.13-fix-build-cflags.patch #516854
+
+ # blargh ... trick e2fsprogs into using e2fsprogs-libs
+ rm -rf doc
+ sed -i -r \
+ -e 's:@LIBINTL@:@LTLIBINTL@:' \
+ -e '/^(STATIC_)?LIB(COM_ERR|SS)/s:[$][(]LIB[)]/lib([^@]*)@(STATIC_)?LIB_EXT@:-l\1:' \
+ -e '/^DEP(STATIC_)?LIB(COM_ERR|SS)/s:=.*:=:' \
+ MCONFIG.in || die "muck libs" #122368
+ sed -i -r \
+ -e '/^LIB_SUBDIRS/s:lib/(et|ss)::g' \
+ Makefile.in || die "remove subdirs"
+ ln -s $(which mk_cmds) lib/ss/ || die
+
+ # Avoid rebuild
+ echo '#include_next <ss/ss_err.h>' > lib/ss/ss_err.h
+}
+
+src_configure() {
+ # Keep the package from doing silly things #261411
+ export VARTEXFONTS=${T}/fonts
+
+ # needs open64() prototypes and friends
+ append-cppflags -D_GNU_SOURCE
+
+ ac_cv_path_LDCONFIG=: \
+ econf \
+ --with-root-prefix="${EPREFIX}/" \
+ --enable-symlink-install \
+ $(tc-is-static-only || echo --enable-elf-shlibs) \
+ $(tc-has-tls || echo --disable-tls) \
+ --without-included-gettext \
+ $(use_enable nls) \
+ --disable-libblkid \
+ --disable-libuuid \
+ --disable-quota \
+ --disable-fsck \
+ --disable-uuidd
+ if [[ ${CHOST} != *-uclibc ]] && grep -qs 'USE_INCLUDED_LIBINTL.*yes' config.{log,status} ; then
+ eerror "INTL sanity check failed, aborting build."
+ eerror "Please post your ${S}/config.log file as an"
+ eerror "attachment to http://bugs.gentoo.org/show_bug.cgi?id=81096"
+ die "Preventing included intl cruft from building"
+ fi
+}
+
+src_compile() {
+ emake V=1 COMPILE_ET=compile_et MK_CMDS=mk_cmds
+
+ # Build the FreeBSD helper
+ if use elibc_FreeBSD ; then
+ cp "${FILESDIR}"/fsck_ext2fs.c .
+ emake V=1 fsck_ext2fs
+ fi
+}
+
+src_install() {
+ # need to set root_libdir= manually as any --libdir options in the
+ # econf above (i.e. multilib) will screw up the default #276465
+ emake \
+ STRIP=: \
+ root_libdir="${EPREFIX}/usr/$(get_libdir)" \
+ DESTDIR="${D}" \
+ install install-libs
+ dodoc README RELEASE-NOTES
+
+ insinto /etc
+ doins "${FILESDIR}"/e2fsck.conf
+
+ # Move shared libraries to /lib/, install static libraries to
+ # /usr/lib/, and install linker scripts to /usr/lib/.
+ gen_usr_ldscript -a e2p ext2fs
+ # configure doesn't have an option to disable static libs :/
+ use static-libs || find "${D}" -name '*.a' -delete
+
+ if use elibc_FreeBSD ; then
+ # Install helpers for us
+ into /
+ dosbin "${S}"/fsck_ext2fs
+ doman "${FILESDIR}"/fsck_ext2fs.8
+
+ # filefrag is linux only
+ rm \
+ "${ED}"/usr/sbin/filefrag \
+ "${ED}"/usr/share/man/man8/filefrag.8 || die
+ fi
+}
diff --git a/sys-fs/e2fsprogs/files/0001-resize2fs-Fix-error-message-so-the-mountpoint-is-pri.patch b/sys-fs/e2fsprogs/files/0001-resize2fs-Fix-error-message-so-the-mountpoint-is-pri.patch
new file mode 100644
index 000000000000..979bf74a0ea8
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/0001-resize2fs-Fix-error-message-so-the-mountpoint-is-pri.patch
@@ -0,0 +1,45 @@
+https://bugs.gentoo.org/276352
+
+From 3a4d9869d47c462c84688b0f8b15df5ab6f93381 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 2 Jul 2009 13:54:22 -0400
+Subject: [PATCH] resize2fs: Fix error message so the mountpoint is printed correctly
+
+The resize2fs program was freeing the mountpoint information too
+early, so garbage was getting printed instead of the correct
+information in an error message.
+
+Addresses-Debian-Bug: #535452
+
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+---
+ resize/main.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/resize/main.c b/resize/main.c
+index 9b03ba9..2dae161 100644
+--- a/resize/main.c
++++ b/resize/main.c
+@@ -250,10 +250,8 @@ int main (int argc, char ** argv)
+ device_name);
+ exit(1);
+ }
+- if (!(mount_flags & EXT2_MF_MOUNTED) || (mtpt[len-1] == 0)) {
+- free(mtpt);
++ if (!(mount_flags & EXT2_MF_MOUNTED) || (mtpt[len-1] == 0))
+ break;
+- }
+ free(mtpt);
+ len = 2 * len;
+ }
+@@ -453,6 +451,7 @@ int main (int argc, char ** argv)
+ ((flags & RESIZE_PERCENT_COMPLETE) ?
+ resize_progress_func : 0));
+ }
++ free(mtpt);
+ if (retval) {
+ com_err(program_name, retval, _("while trying to resize %s"),
+ device_name);
+--
+1.6.3.3
+
diff --git a/sys-fs/e2fsprogs/files/e2fsck.conf b/sys-fs/e2fsprogs/files/e2fsck.conf
new file mode 100644
index 000000000000..401cec45eec1
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsck.conf
@@ -0,0 +1,6 @@
+# See the e2fsck.conf man page for more info
+
+[options]
+
+# allow fsck to run sanely at any point in time #142850
+buggy_init_scripts = yes
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.38-tests-locale.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.38-tests-locale.patch
new file mode 100644
index 000000000000..6c316ac2a38b
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.38-tests-locale.patch
@@ -0,0 +1,26 @@
+Since the tests analyze the output messages, force the default locale.
+
+http://bugs.gentoo.org/99766
+
+--- tests/test_script.in
++++ tests/test_script.in
+@@ -3,6 +3,19 @@
+ # Test script for e2fsck
+ #
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ if test "$1"x = x ; then
+ TESTS=`ls -d $SRCDIR/[a-zA-Z]_* | $EGREP -v "\.failed|\.new"`
+ else
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch
new file mode 100644
index 000000000000..7d0919600d05
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.40-fbsd.patch
@@ -0,0 +1,11 @@
+--- a/lib/ext2fs/ext2_fs.h
++++ b/lib/ext2fs/ext2_fs.h
+@@ -414,7 +414,7 @@
+
+ #define i_size_high i_dir_acl
+
+-#if defined(__KERNEL__) || defined(__linux__)
++#if defined(__KERNEL__) || defined(__linux__) || defined(__FreeBSD__)
+ #define i_reserved1 osd1.linux1.l_i_reserved1
+ #define i_frag osd2.linux2.l_i_frag
+ #define i_fsize osd2.linux2.l_i_fsize
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.5-makefile.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.5-makefile.patch
new file mode 100644
index 000000000000..010a09aafabe
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.5-makefile.patch
@@ -0,0 +1,91 @@
+--- e2fsprogs-1.41.5/e2fsck/Makefile.in
++++ e2fsprogs-1.41.5/e2fsck/Makefile.in
+@@ -195,12 +195,12 @@
+ @echo " LINK $(root_sbindir)/fsck.ext2"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
++ @$(LN_S) -f e2fsck \
+ $(DESTDIR)$(root_sbindir)/fsck.ext2
+ @echo " LINK $(root_sbindir)/fsck.ext3"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
++ @$(LN_S) -f e2fsck \
+ $(DESTDIR)$(root_sbindir)/fsck.ext3
+ @echo " LINK $(root_sbindir)/fsck.ext4"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
++ @$(LN_S) -f e2fsck \
+ $(DESTDIR)$(root_sbindir)/fsck.ext4
+ @echo " LINK $(root_sbindir)/fsck.ext4dev"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/e2fsck \
++ @$(LN_S) -f e2fsck \
+ $(DESTDIR)$(root_sbindir)/fsck.ext4dev
+@@ -221,12 +221,12 @@
+ @echo " LINK $(man8dir)/fsck.ext2.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
++ @$(LN_S) -f e2fsck.8 \
+ $(DESTDIR)$(man8dir)/fsck.ext2.8
+ @echo " LINK $(man8dir)/fsck.ext3.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
++ @$(LN_S) -f e2fsck.8 \
+ $(DESTDIR)$(man8dir)/fsck.ext3.8
+ @echo " LINK $(man8dir)/fsck.ext4.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
++ @$(LN_S) -f e2fsck.8 \
+ $(DESTDIR)$(man8dir)/fsck.ext4.8
+ @echo " LINK $(man8dir)/fsck.ext4.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/e2fsck.8 \
++ @$(LN_S) -f e2fsck.8 \
+ $(DESTDIR)$(man8dir)/fsck.ext4dev.8
+--- e2fsprogs-1.41.5/misc/Makefile.in
++++ e2fsprogs-1.41.5/misc/Makefile.in
+@@ -394,19 +394,19 @@
+ @echo " LINK $(root_sbindir)/mkfs.ext2"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
++ @$(LN_S) -f mke2fs \
+ $(DESTDIR)$(root_sbindir)/mkfs.ext2
+ @echo " LINK $(root_sbindir)/mkfs.ext3"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
++ @$(LN_S) -f mke2fs \
+ $(DESTDIR)$(root_sbindir)/mkfs.ext3
+ @echo " LINK $(root_sbindir)/mkfs.ext4"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
++ @$(LN_S) -f mke2fs \
+ $(DESTDIR)$(root_sbindir)/mkfs.ext4
+ @echo " LINK $(root_sbindir)/mkfs.ext4dev"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/mke2fs \
++ @$(LN_S) -f mke2fs \
+ $(DESTDIR)$(root_sbindir)/mkfs.ext4dev
+ @echo " LINK $(root_sbindir)/e2label"
+- @$(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
++ @$(LN_S) -f tune2fs \
+ $(DESTDIR)$(root_sbindir)/e2label
+ @if test -n "$(FINDFS_LINK)"; then \
+ echo " LINK $(root_sbindir)/findfs"; \
+- $(LN) -f $(DESTDIR)$(root_sbindir)/tune2fs \
++ $(LN_S) -f tune2fs \
+ $(DESTDIR)$(root_sbindir)/$(FINDFS_LINK); \
+@@ -431,12 +431,12 @@
+ @echo " LINK mkfs.ext2.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
++ @$(LN_S) -f mke2fs.8 \
+ $(DESTDIR)$(man8dir)/mkfs.ext2.8
+ @echo " LINK mkfs.ext3.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
++ @$(LN_S) -f mke2fs.8 \
+ $(DESTDIR)$(man8dir)/mkfs.ext3.8
+ @echo " LINK mkfs.ext4.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
++ @$(LN_S) -f mke2fs.8 \
+ $(DESTDIR)$(man8dir)/mkfs.ext4.8
+ @echo " LINK mkfs.ext4dev.8"
+- @$(LN) -f $(DESTDIR)$(man8dir)/mke2fs.8 \
++ @$(LN_S) -f mke2fs.8 \
+ $(DESTDIR)$(man8dir)/mkfs.ext4dev.8
+--- e2fsprogs-1.41.5/Makefile.in
++++ e2fsprogs-1.41.5/Makefile.in
+@@ -281,6 +66,7 @@
+ uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
+
+ install-libs: install-libs-recursive
++install-libs-recursive: | install-shlibs-libs-recursive
+
+ uninstall-libs: uninstall-libs-recursive
+
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch
new file mode 100644
index 000000000000..b7d3d96856b5
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.41.8-makefile.patch
@@ -0,0 +1,10 @@
+--- e2fsprogs-1.41.5/Makefile.in
++++ e2fsprogs-1.41.5/Makefile.in
+@@ -281,6 +66,7 @@
+ uninstall: uninstall-progs-recursive uninstall-shlibs-libs-recursive uninstall-doc-libs
+
+ install-libs: install-libs-recursive
++install-libs-recursive: | install-shlibs-libs-recursive
+
+ uninstall-libs: uninstall-libs-recursive
+
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-e2fsck-fix-makefile-dependency.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-e2fsck-fix-makefile-dependency.patch
new file mode 100644
index 000000000000..033084706f42
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-e2fsck-fix-makefile-dependency.patch
@@ -0,0 +1,28 @@
+From 5c15bf5f978bae01f1ca3cbe6414ab1d355a6adf Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 22 May 2014 18:52:27 -0400
+Subject: e2fsck: fix Makefile dependency for quota.o
+
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+
+diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in
+index 4b10f6f..f773fea 100644
+--- a/e2fsck/Makefile.in
++++ b/e2fsck/Makefile.in
+@@ -552,3 +552,13 @@ logfile.o: $(srcdir)/logfile.c $(top_builddir)/lib/config.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
+ prof_err.o: prof_err.c
++quota.o: $(srcdir)/quota.c $(top_builddir)/lib/config.h \
++ $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
++ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
++ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
++ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
++ $(top_builddir)/lib/ext2fs/ext2_err.h \
++ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
++ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
++ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
++ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
+--
+cgit v0.10.1
+
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-fix-build-cflags.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-fix-build-cflags.patch
new file mode 100644
index 000000000000..69e6f358d9e1
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.10-fix-build-cflags.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/516854
+
+--- a/e2fsprogs-libs-1.42.10/configure
++++ b/e2fsprogs-libs-1.42.10/configure
+@@ -1328,7 +1328,7 @@
+ BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
+ BUILD_LDFLAGS="$LDFLAGS"
+ else
+- BUILD_CFLAGS=
++ BUILD_CFLAGS="$INCLUDES"
+ BUILD_LDFLAGS=
+ fi
+
diff --git a/sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch
new file mode 100644
index 000000000000..dcab9a34de09
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/e2fsprogs-1.42.13-fix-build-cflags.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/516854
+
+--- e2fsprogs-1.42.13/configure
++++ e2fsprogs-1.42.13/configure
+@@ -1315,6 +1315,8 @@
+ if test $cross_compiling = no; then
+ BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
+ BUILD_LDFLAGS="$LDFLAGS"
++else
++ BUILD_CFLAGS="$INCLUDES"
+ fi
+
+
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.8 b/sys-fs/e2fsprogs/files/fsck_ext2fs.8
new file mode 100644
index 000000000000..54d269b81b96
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/fsck_ext2fs.8
@@ -0,0 +1,96 @@
+.TH fsck_ext2fs 8 2006-07-02 "Matthias Andree" "FreeBSD Ports"
+.\"
+.\" fsck_ext2fs.8 - manual page for fsck_ext2fs wrapper
+.\"
+.\" (C) Copyright 2006 by Matthias Andree <matthias.andree@gmx.de>
+.\"
+.\" License: This file may be redistributed in accordance with the terms
+.\" of the GNU General Public License v2.
+.\"
+.\" Upstream $Id$
+.\" $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.8,v 1.1 2006/07/04 15:47:51 leeym Exp $
+.\"
+.SH NAME
+.B fsck_ext2fs
+\- compatibility wrapper for e2fsck
+.SH SYNOPSIS
+.P
+.B fsck_ext2fs
+[\fB\-Fpfnyv\fR] [\fB\-b\fR \fIblock\fR]
+.SH DESCRIPTION
+.P
+\fBfsck_ext2fs\fR maps the traditional FreeBSD \fBfsck_ffs\fR options to
+options with the same functionality for \fBe2fsck,\fR runs \fBe2fsck\fR
+and then maps its exit status to values that FreeBSD understands.
+\fBe2fsck\fR is a utility to check and repair ext2 and ext3 file
+systems.
+
+.SH OPTIONS
+.IP \fB\-F\fR
+(check foreground mode required) Immediately exits with status 1 to tell
+\fBfsck\fR that ext2fs cannot be checked in the background. \fBfsck\fR
+usually runs \fBfsck_*\fR programs twice, first with \fB\-F\fR to find
+out if they can do background checking, then either immediately without
+\fB\-F\fR for foreground checking or deferred in the background with
+\fB\-B\fR.
+.IP \fB\-p\fR
+(preen mode) This option suppresses adding the \fB\-f\fR option (unless
+\fB\-f\fR is also given) and adds the \fB\-p\fR option to the
+\fBe2fsck\fR command line. This causes \fBe2fsck\fR to automatically fix
+any filesystem problems that can safely be fixed without operator
+intervention. Without this option given, \fBe2fsck\fR will be run with
+the \fB\-f\fR option to force a check, since interactive scan and repair
+mode is the default on FreeBSD, but not on Linux where \fBe2fsck\fR
+comes from.
+.IP \fB\-f\fR
+(force check) This option forces the check of a clean file system while
+preening and is passed to \fBe2fsck\fR verbatim.
+.IP \fB\-n\fR
+("no" mode) This option causes the file system to be opened in read-only
+mode and assume "no" as answer to all questions. This is the only way to
+safely run \fBfsck\fR on a mounted ext2 or ext3 file system. This option
+is passed to \fBe2fsck\fR verbatim.
+.IP \fB\-y\fR
+("yes" mode) This option is passed verbatim to \fBe2fsck\fR and causes
+it to assume "yes" as answer to all questions. This allows the
+non-interactive use of e2fsck but is rather aggressive. Use with care.
+.IP \fB\-v\fR
+(verbose output) This option is passed verbatim to \fBe2fsck\fR and
+causes it to verbosely report its progress.
+.IP "\fB\-b\fR \fIblock\fR"
+(use alternate super block) This option is passed verbatim to
+\fBe2fsck\fR and selects an alternate super block, for use when the
+primary super block has been damaged. Please see the \fBe2fsck\fR(8)
+manual page for details.
+
+.SH EXIT STATUS
+If errors remain after \fBe2fsck\fR, an invalid option or too many
+options have been specified, \fBe2fsck\fR was killed with a signal or
+the \fIfork\fB system call failed, \fBfsck_ext2fs\fR exits with status
+EXIT_FAILURE (usually 1). If \fBe2fsck\fR cannot be started, exits with
+status 127. If the file system is clean after \fBe2fsck\fR operation,
+exits with status EXIT_SUCCESS (0).
+
+.SH NOTES
+.P
+This utility is merely meant as an adaptor so that \fBe2fsck\fR can be
+run during the boot process, it does not support all options that
+\fBe2fsck\fR offers. If you need one of its advanced options, please run
+\fBe2fsck\fR directly.
+
+.SH FILES
+.TP
+.I /sbin/e2fsck
+is the location of the \fBe2fsck\fR program to run.
+
+.SH AUTHOR
+.P
+Matthias Andree <matthias.andree@gmx.de> wrote the program and this
+manual page.
+.SH CONFORMING TO
+The FreeBSD 6.1 command line interface for \fBfsck_ufs\fR(8).
+.SH SEE ALSO
+.BR fsck (8),
+.BR e2fsck (8)
+and
+.BR fsck_ufs (8).
diff --git a/sys-fs/e2fsprogs/files/fsck_ext2fs.c b/sys-fs/e2fsprogs/files/fsck_ext2fs.c
new file mode 100644
index 000000000000..c0a35de6792e
--- /dev/null
+++ b/sys-fs/e2fsprogs/files/fsck_ext2fs.c
@@ -0,0 +1,147 @@
+/*
+ * fsck_ext2fs - wrapper for e2fsck on FreeBSD
+ * Copyright (C) 2004,2006 Matthias Andree <matthias.andree@gmx.de>
+ * redistributable in accordance with the
+ * GNU General Public License v2
+ *
+ * $FreeBSD: ports/sysutils/e2fsprogs/files/fsck_ext2fs.c,v 1.5 2006/07/04 15:47:51 leeym Exp $
+ *
+ * Upstream: $Id$
+ *
+ * format: gindent -kr
+ */
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <errno.h>
+
+__attribute__ ((noreturn))
+static int die(const char *tag)
+{
+ perror(tag);
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv)
+{
+ int ch, i = 1, force = 0, status, verbose = 0, t;
+ long block = 0;
+ enum { normal, preen, yes, no } mode = normal;
+ char *cmd[256];
+ pid_t pid;
+
+ cmd[0] = "/sbin/e2fsck";
+ while ((ch = getopt(argc, argv, "BFpfnyb:v")) != -1) {
+ switch (ch) {
+ case 'p':
+ mode = preen;
+ break;
+ case 'f':
+ force = 1;
+ break;
+ case 'n':
+ mode = no;
+ break;
+ case 'y':
+ mode = yes;
+ break;
+ case 'b':
+ block = atol(optarg);
+ break;
+ case 'v':
+ verbose++;
+ break;
+ case 'F':
+ /* e2fsck does not support background checking,
+ * hence exit with nonzero status to force
+ * the foreground check. */
+ exit(1);
+ case 'B':
+ default:
+ fprintf(stderr, "%s: unknown option -%c\n",
+ argv[0], optopt);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (force)
+ cmd[i++] = "-f";
+
+ switch (mode) {
+ case normal:
+ /* FreeBSD needs -f to force a check only in context
+ * with -p -- so map normal to force to match
+ * expectations */
+ if (!force)
+ cmd[i++] = "-f";
+ break;
+ case yes:
+ cmd[i++] = "-y";
+ break;
+ case no:
+ cmd[i++] = "-n";
+ break;
+ case preen:
+ cmd[i++] = "-p";
+ break;
+ }
+
+ if (block) {
+ static char b[30];
+
+ sprintf(b, "-b %ld", block);
+ cmd[i++] = b;
+ }
+
+ /* silently limit verbose to 15 so we don't overflow the cmd array */
+ if (verbose > 15)
+ verbose = 15;
+
+ for (t = verbose; t > 1; t--)
+ cmd[i++] = "-v";
+
+ while (optind < argc) {
+ cmd[i++] = argv[optind++];
+ /* sanity check so we don't overflow the cmd buffer */
+ if (i+1 == sizeof(cmd)/sizeof(cmd[0])) {
+ errno = E2BIG;
+ die(argv[0]);
+ }
+ }
+
+ cmd[i++] = 0;
+
+ if (verbose) {
+ for (i=0; cmd[i]; i++)
+ fputs(cmd[i], stderr),
+ fputc(' ', stderr);
+ fputc('\n', stderr);
+ }
+
+ pid = fork();
+ switch (pid) {
+ case -1:
+ /* error */
+ die("fork");
+ break;
+ case 0:
+ /* child */
+ (void) execv(cmd[0], cmd);
+ perror("execve");
+ _exit(127);
+ default:
+ /* parent */
+ if (pid != waitpid(pid, &status, 0))
+ die("waitpid");
+ if (WIFSIGNALED(status)
+ || (WIFEXITED(status) && WEXITSTATUS(status) >= 4))
+ exit(EXIT_FAILURE);
+ }
+ exit(EXIT_SUCCESS);
+}
diff --git a/sys-fs/e2fsprogs/metadata.xml b/sys-fs/e2fsprogs/metadata.xml
new file mode 100644
index 000000000000..14bdacde2617
--- /dev/null
+++ b/sys-fs/e2fsprogs/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:ext2_filesystems_utilities:e2fsprogs</remote-id>
+ <remote-id type="sourceforge">e2fsprogs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/e2tools/Manifest b/sys-fs/e2tools/Manifest
new file mode 100644
index 000000000000..51be0f3f3905
--- /dev/null
+++ b/sys-fs/e2tools/Manifest
@@ -0,0 +1 @@
+DIST e2tools-0.0.16.tar.gz 72333 RMD160 19f0f53a1958765ae5d5a0be49ae62e3d34f8c6b SHA1 c81110c8d7878d4413cdc0a09b97e88b70ebdd51 SHA256 4e3c8e17786ccc03fc9fb4145724edf332bb50e1b3c91b6f33e0e3a54861949b
diff --git a/sys-fs/e2tools/e2tools-0.0.16.ebuild b/sys-fs/e2tools/e2tools-0.0.16.ebuild
new file mode 100644
index 000000000000..eef4b5a477ed
--- /dev/null
+++ b/sys-fs/e2tools/e2tools-0.0.16.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="utilities to read, write, and manipulate files in an ext2/ext3 filesystem"
+HOMEPAGE="http://home.earthlink.net/~k_sheff/sw/e2tools/index.html"
+SRC_URI="http://home.earthlink.net/~k_sheff/sw/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-fs/e2fsprogs
+ sys-libs/e2fsprogs-libs"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i '/e2cp_LDADD/s:-L@[^@]*@::' Makefile.in || die
+}
diff --git a/sys-fs/e2tools/metadata.xml b/sys-fs/e2tools/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/e2tools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/e4rat/Manifest b/sys-fs/e4rat/Manifest
new file mode 100644
index 000000000000..f057cb658467
--- /dev/null
+++ b/sys-fs/e4rat/Manifest
@@ -0,0 +1,2 @@
+DIST e4rat-0.2.4_pre20141201.tar.xz 60408 SHA256 757d9d76b395a8b5092205bf623ba73860546f5f13efdf6b6347217b4ebe9e4b SHA512 61a53f6ac420392df5894d3f76de28c5d2e33fd3a6548cf8c9de52818bf937ba8bf8629db1b89103faa73b660548d7e467e17d7f2794a4100ca07971ded0cfb9 WHIRLPOOL 6c33956a6a601fd05d89325a2d2fa96ddf00c7e8130ac599c39e59e1ee3d3c21fc5ce712421969d96e96cfadd91fdbe6acc24d31d7acf413632fb49a575edeae
+DIST e4rat_0.2.3_src.tar.gz 72459 SHA256 f6feda9618eff0f9442baf771b4776b634e5a2f39e678c10e4c7946b2c6a96a0 SHA512 e1b78b7d84e17f0ded494217f2eb5912401d365844bc966d649682979e1d3deaceab6e9d820fb7fbec819e15133aa2af61131325204620d9b16a3c7638d7fdb7 WHIRLPOOL 912632a516bcefe2171bd1bc207394396ecec9cc74351b2afa511258cb1dfdbb38d2e5fe41a7af747addb92a5f8ff8b2b2321dee8f51d8e8bf7f919183e80c8c
diff --git a/sys-fs/e4rat/e4rat-0.2.3-r1.ebuild b/sys-fs/e4rat/e4rat-0.2.3-r1.ebuild
new file mode 100644
index 000000000000..d6c7a2dd7cc1
--- /dev/null
+++ b/sys-fs/e4rat/e4rat-0.2.3-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils linux-info readme.gentoo
+
+DESCRIPTION="Toolset to accelerate the boot process and application startup"
+HOMEPAGE="http://e4rat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P/-/_}_src.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="dev-lang/perl:=
+ >=dev-libs/boost-1.42:=
+ sys-fs/e2fsprogs
+ sys-process/audit
+ sys-process/lsof"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~AUDITSYSCALL"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.2.2-shared-build.patch
+ "${FILESDIR}"/${PN}-0.2.2-libdir.patch
+ "${FILESDIR}"/${P}-boostfsv3.patch
+)
+
+pkg_setup() {
+ check_extra_config
+ DOC_CONTENTS="
+ To launch systemd from e4rat you simply need to edit /etc/e4rat.conf
+ and set:\n
+ ; path to init process binary (DEFAULT: /sbin/init)\n
+ init /usr/lib/systemd/systemd"
+}
+
+src_install() {
+ cmake-utils_src_install
+ # relocate binaries to /sbin. If someone knows of a better way to do it
+ # please do tell me
+ dodir sbin
+ find "${D}"/usr/sbin -type f -exec mv {} "${D}"/sbin/. \; \
+ || die
+
+ dodoc README
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if has_version sys-apps/preload; then
+ elog "It appears you have sys-apps/preload installed. This may"
+ elog "has negative effects on ${PN}. You may want to disable preload"
+ elog "when using ${PN}."
+ fi
+}
diff --git a/sys-fs/e4rat/e4rat-0.2.4_pre20141201.ebuild b/sys-fs/e4rat/e4rat-0.2.4_pre20141201.ebuild
new file mode 100644
index 000000000000..a40f030eb9cf
--- /dev/null
+++ b/sys-fs/e4rat/e4rat-0.2.4_pre20141201.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils linux-info readme.gentoo
+
+DESCRIPTION="Toolset to accelerate the boot process and application startup"
+HOMEPAGE="http://e4rat.sourceforge.net/"
+#SRC_URI="mirror://sourceforge/${PN}/${P/-/_}_src.tar.gz"
+SRC_URI="http://dev.gentoo.org/~pacho/${PN}/${PN}-0.2.4_pre20141201.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/perl:=
+ >=dev-libs/boost-1.42:=
+ sys-fs/e2fsprogs
+ sys-process/audit
+ sys-process/lsof
+"
+DEPEND="${DEPEND}
+ app-arch/xz-utils
+"
+
+CONFIG_CHECK="~AUDITSYSCALL"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.2.2-shared-build.patch
+ "${FILESDIR}"/${PN}-0.2.2-libdir.patch
+)
+
+pkg_setup() {
+ check_extra_config
+ DOC_CONTENTS="
+ To launch systemd from e4rat you simply need to edit /etc/e4rat.conf
+ and set:\n
+ ; path to init process binary (DEFAULT: /sbin/init)\n
+ init /usr/lib/systemd/systemd"
+}
+
+src_install() {
+ cmake-utils_src_install
+ # relocate binaries to /sbin. If someone knows of a better way to do it
+ # please do tell me
+ dodir sbin
+ find "${D}"/usr/sbin -type f -exec mv {} "${D}"/sbin/. \; \
+ || die
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+ if has_version sys-apps/preload; then
+ elog "It appears you have sys-apps/preload installed. This may"
+ elog "has negative effects on ${PN}. You may want to disable preload"
+ elog "when using ${PN}."
+ fi
+}
diff --git a/sys-fs/e4rat/files/e4rat-0.2.2-libdir.patch b/sys-fs/e4rat/files/e4rat-0.2.2-libdir.patch
new file mode 100644
index 000000000000..eaa2695d7872
--- /dev/null
+++ b/sys-fs/e4rat/files/e4rat-0.2.2-libdir.patch
@@ -0,0 +1,14 @@
+Index: e4rat-0.2.2/src/CMakeLists.txt
+===================================================================
+--- e4rat-0.2.2.orig/src/CMakeLists.txt
++++ e4rat-0.2.2/src/CMakeLists.txt
+@@ -170,8 +170,7 @@ endif(NOT BUILD_CORE_LIBRARY_STATIC)
+
+ INSTALL(TARGETS ${${PROJECT_NAME}_TARGETS}
+ RUNTIME DESTINATION "sbin"
+- LIBRARY DESTINATION "lib"
+- ARCHIVE DESTINATION "lib"
++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ )
+
+ INSTALL(DIRECTORY DESTINATION "/var/lib/${PROJECT_NAME}")
diff --git a/sys-fs/e4rat/files/e4rat-0.2.2-shared-build.patch b/sys-fs/e4rat/files/e4rat-0.2.2-shared-build.patch
new file mode 100644
index 000000000000..636eb52fb612
--- /dev/null
+++ b/sys-fs/e4rat/files/e4rat-0.2.2-shared-build.patch
@@ -0,0 +1,74 @@
+Index: e4rat-0.2.2/CMakeLists.txt
+===================================================================
+--- e4rat-0.2.2.orig/CMakeLists.txt
++++ e4rat-0.2.2/CMakeLists.txt
+@@ -14,7 +14,6 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_D
+ set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "e4rat install prefix" FORCE)
+ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+-set(Boost_USE_STATIC_LIBS ON)
+ set(Boost_USE_MULTITHREADED OFF)
+ add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
+ find_package(Boost 1.41 COMPONENTS system filesystem regex REQUIRED)
+Index: e4rat-0.2.2/src/CMakeLists.txt
+===================================================================
+--- e4rat-0.2.2.orig/src/CMakeLists.txt
++++ e4rat-0.2.2/src/CMakeLists.txt
+@@ -131,21 +131,12 @@ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+ )
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug")
+
+-# On 64 bit architecture you cannot link a static to a shared library
+-# Therefore -static-libstdc++ will fail.
+-if(BUILD_CORE_LIBRARY_STATIC)
+- add_library(${PROJECT_NAME}-core STATIC
+- ${${PROJECT_NAME}-core_SRC}
+- )
+-else(BUILD_CORE_LIBRARY_STATIC)
+- add_library(${PROJECT_NAME}-core SHARED
+- ${${PROJECT_NAME}-core_SRC}
+- )
+- set_target_properties(${PROJECT_NAME}-core PROPERTIES
+- SOVERSION 0
+- LINK_FLAGS "-static-libgcc -static-libstdc++"
+- )
+-endif(BUILD_CORE_LIBRARY_STATIC)
++add_library(${PROJECT_NAME}-core SHARED
++ ${${PROJECT_NAME}-core_SRC}
++)
++set_target_properties(${PROJECT_NAME}-core PROPERTIES
++ SOVERSION 0
++)
+
+ target_link_libraries(${PROJECT_NAME}-core
+ ${${PROJECT_NAME}_LIBRARIES}
+@@ -158,15 +149,13 @@ foreach( EXE ${PROJECT_NAME}-collect
+ TARGET_LINK_LIBRARIES(${EXE}
+ ${PROJECT_NAME}-core
+ )
+- set_target_properties(${EXE} PROPERTIES
+- LINK_FLAGS "-static-libgcc -static-libstdc++"
+- )
+ endforeach( EXE )
+
+ ###
+ # install project targets
+ ###
+ set(${PROJECT_NAME}_TARGETS
++ ${PROJECT_NAME}-core
+ ${PROJECT_NAME}-collect
+ ${PROJECT_NAME}-preload
+ ${PROJECT_NAME}-realloc
+Index: e4rat-0.2.2/src/cmake/Findaudit.cmake
+===================================================================
+--- e4rat-0.2.2.orig/src/cmake/Findaudit.cmake
++++ e4rat-0.2.2/src/cmake/Findaudit.cmake
+@@ -1,7 +1,7 @@
+ FIND_PATH(AUDIT_INCLUDE_DIR libaudit.h /usr/include
+ /usr/local/include)
+
+-FIND_LIBRARY(AUDIT_LIBRARY NAMES libaudit.a PATH /usr/lib /usr/local/lib)
++FIND_LIBRARY(AUDIT_LIBRARY NAMES audit PATH /usr/lib /usr/local/lib)
+
+ IF (AUDIT_INCLUDE_DIR AND AUDIT_LIBRARY)
+ SET(AUDIT_FOUND TRUE)
diff --git a/sys-fs/e4rat/files/e4rat-0.2.3-boostfsv3.patch b/sys-fs/e4rat/files/e4rat-0.2.3-boostfsv3.patch
new file mode 100644
index 000000000000..5450af1c2aa9
--- /dev/null
+++ b/sys-fs/e4rat/files/e4rat-0.2.3-boostfsv3.patch
@@ -0,0 +1,86 @@
+Bug #425422
+Fixes building against boost-1.50
+Port to boost FS v3
+
+--- CMakeLists.txt.orig 2012-09-07 03:17:55.515017487 +0200
++++ CMakeLists.txt 2012-09-13 19:54:18.160054076 +0200
+@@ -15,7 +15,6 @@
+ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+ set(Boost_USE_MULTITHREADED OFF)
+-add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
+ find_package(Boost 1.41 COMPONENTS system filesystem regex REQUIRED)
+ set(${PROJECT_NAME}_LIBRARIES ${${PROJECT_NAME}_LIBRARIES}
+ ${Boost_LIBRARIES})
+--- src/config.cc.orig 2012-09-13 19:50:32.829871091 +0200
++++ src/config.cc 2012-09-13 19:55:37.023068153 +0200
+@@ -71,7 +71,7 @@
+ return;
+ }
+
+- tool_name = fs::path(argv[0]).filename();
++ tool_name = fs::path(argv[0]).filename().string();
+ found = tool_name.find_last_of("-");
+ if(found)
+ defaultSection = tool_name.substr(found+1);
+--- src/common.cc.orig 2012-09-13 19:58:06.187203344 +0200
++++ src/common.cc 2012-09-13 19:59:34.752096130 +0200
+@@ -157,7 +157,7 @@
+ p /= filesearch;
+ }
+ // Initialize regex filter - use * as default if nothing is given in filesearch
+- std::string f( p.has_filename() ? p.filename() : "*");
++ std::string f( p.has_filename() ? p.filename().string() : "*");
+
+ fs::path dir(system_complete(p).parent_path());
+ if( is_directory(dir) )
+@@ -166,8 +166,8 @@
+ it!=boost::filesystem::directory_iterator();
+ ++it )
+ {
+- if( boost::regex_match( it->leaf(), path2regex(f) ) )
+- fileset.push_back(it->string());
++ if( boost::regex_match( it->path().filename().string(), path2regex(f) ) )
++ fileset.push_back(it->path().filename().string());
+ }
+ return fileset;
+ }
+--- src/e4rat-collect.cc.orig 2012-09-13 20:03:40.185027797 +0200
++++ src/e4rat-collect.cc 2012-09-13 20:03:54.404850024 +0200
+@@ -396,7 +396,7 @@
+ * Parse application list given as arguments
+ */
+ for ( ; optind < argc; optind++)
+- project.observeApp(fs::path(argv[optind]).filename());
++ project.observeApp(fs::path(argv[optind]).filename().string());
+
+ /*
+ * Parse application list on stdin
+--- src/device.cc.orig 2012-09-13 20:00:40.232277516 +0200
++++ src/device.cc 2012-09-13 20:03:11.026392331 +0200
+@@ -196,13 +196,13 @@
+ it != end_itr;
+ ++it )
+ {
+- if(it->filename() == "root")
++ if(it->path().filename().string() == "root")
+ continue;
+- if(lstat(it->string().c_str(), &st))
++ if(lstat(it->path().filename().c_str(), &st))
+ continue;
+ if(st.st_rdev == get()->devno)
+ {
+- get()->deviceName = it->filename();
++ get()->deviceName = it->path().filename().string();
+ get()->devicePath = "/dev/" + get()->deviceName;
+ return 0;
+ }
+@@ -225,7 +225,7 @@
+ // the minor number of virtual filesystems are allocated dynamically in function set_anon_super() in fs/super.c
+ // for convenience set deviceName and devicePath to a common name
+ get()->deviceName = "virtual file system";
+- get()->devicePath = get()->mount_point.filename();
++ get()->devicePath = get()->mount_point.filename().string();
+ return 0;
+ case 2:
+ ss << "fd";
diff --git a/sys-fs/e4rat/files/e4rat-libdir.patch b/sys-fs/e4rat/files/e4rat-libdir.patch
new file mode 100644
index 000000000000..885e6166fa50
--- /dev/null
+++ b/sys-fs/e4rat/files/e4rat-libdir.patch
@@ -0,0 +1,26 @@
+From b2413a77f3f11c6722ea7e83aafbaa3fc5c73376 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
+Date: Sun, 11 Dec 2011 18:39:59 +0100
+Subject: [PATCH] Fix installing into libdir.
+
+---
+ e4rat-0.2.1/src/CMakeLists.txt | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/e4rat-0.2.1/src/CMakeLists.txt b/e4rat-0.2.1/src/CMakeLists.txt
+index d379ec6..9fc7492 100644
+--- a/e4rat-0.2.1/src/CMakeLists.txt
++++ b/e4rat-0.2.1/src/CMakeLists.txt
+@@ -163,8 +163,7 @@ endif(NOT HAVE_64_BIT)
+
+ INSTALL(TARGETS ${${PROJECT_NAME}_TARGETS}
+ RUNTIME DESTINATION "sbin"
+- LIBRARY DESTINATION "lib"
++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+- ARCHIVE DESTINATION "lib"
+ )
+
+ INSTALL(DIRECTORY DESTINATION "/var/lib/${PROJECT_NAME}")
+--
+1.7.8.110.g4cb5d1.dirty
+
diff --git a/sys-fs/e4rat/files/e4rat-shared-build.patch b/sys-fs/e4rat/files/e4rat-shared-build.patch
new file mode 100644
index 000000000000..2e322e2d651c
--- /dev/null
+++ b/sys-fs/e4rat/files/e4rat-shared-build.patch
@@ -0,0 +1,96 @@
+From d9114b018b79afdcedb59621dfc13a0423c65fae Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 10 Dec 2011 23:00:35 +0100
+Subject: [PATCH] Link with and install shared libraries.
+
+---
+ e4rat-0.2.1/CMakeLists.txt | 1 -
+ e4rat-0.2.1/src/CMakeLists.txt | 13 +------------
+ e4rat-0.2.1/src/cmake/Findaudit.cmake | 2 +-
+ e4rat-0.2.1/src/cmake/Findauparse.cmake | 2 +-
+ 4 files changed, 3 insertions(+), 15 deletions(-)
+
+diff --git a/e4rat-0.2.1/CMakeLists.txt b/e4rat-0.2.1/CMakeLists.txt
+index 72b0681..e5e64cf 100644
+--- a/e4rat-0.2.1/CMakeLists.txt
++++ b/e4rat-0.2.1/CMakeLists.txt
+@@ -14,7 +14,6 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX "/" CACHE PATH "e4rat install prefix" FORCE)
+ ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+-set(Boost_USE_STATIC_LIBS ON)
+ set(Boost_USE_MULTITHREADED OFF)
+ add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
+ find_package(Boost 1.41 COMPONENTS system filesystem regex REQUIRED)
+diff --git a/e4rat-0.2.1/src/CMakeLists.txt b/e4rat-0.2.1/src/CMakeLists.txt
+index d379ec6..4f8c12e 100644
+--- a/e4rat-0.2.1/src/CMakeLists.txt
++++ b/e4rat-0.2.1/src/CMakeLists.txt
+@@ -113,21 +113,12 @@ IF(CMAKE_BUILD_TYPE STREQUAL "debug")
+ )
+ ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug")
+
+-# On 64 bit architecture you cannot link a static to a shared library
+-# Therefore -static-libstdc++ will fail.
+-if(HAVE_64_BIT)
+- add_library(${PROJECT_NAME}-core STATIC
+- ${${PROJECT_NAME}-core_SRC}
+- )
+-else(HAVE_64_BIT)
+ add_library(${PROJECT_NAME}-core SHARED
+ ${${PROJECT_NAME}-core_SRC}
+ )
+ set_target_properties(${PROJECT_NAME}-core PROPERTIES
+ SOVERSION 0
+- LINK_FLAGS "-static-libgcc -static-libstdc++"
+ )
+-endif(HAVE_64_BIT)
+
+ target_link_libraries(${PROJECT_NAME}-core
+ ${${PROJECT_NAME}_LIBRARIES}
+@@ -140,15 +131,13 @@ foreach( EXE ${PROJECT_NAME}-collect
+ TARGET_LINK_LIBRARIES(${EXE}
+ ${PROJECT_NAME}-core
+ )
+- set_target_properties(${EXE} PROPERTIES
+- LINK_FLAGS "-static-libgcc -static-libstdc++"
+- )
+ endforeach( EXE )
+
+ ###
+ # install project targets
+ ###
+ set(${PROJECT_NAME}_TARGETS
++ ${PROJECT_NAME}-core
+ ${PROJECT_NAME}-collect
+ ${PROJECT_NAME}-preload
+ ${PROJECT_NAME}-realloc
+diff --git a/e4rat-0.2.1/src/cmake/Findaudit.cmake b/e4rat-0.2.1/src/cmake/Findaudit.cmake
+index 32ac636..d8de45a 100644
+--- a/e4rat-0.2.1/src/cmake/Findaudit.cmake
++++ b/e4rat-0.2.1/src/cmake/Findaudit.cmake
+@@ -1,7 +1,7 @@
+ FIND_PATH(AUDIT_INCLUDE_DIR libaudit.h /usr/include
+ /usr/local/include)
+
+-FIND_LIBRARY(AUDIT_LIBRARY NAMES libaudit.a PATH /usr/lib /usr/local/lib)
++FIND_LIBRARY(AUDIT_LIBRARY NAMES audit PATH /usr/lib /usr/local/lib)
+
+ IF (AUDIT_INCLUDE_DIR AND AUDIT_LIBRARY)
+ SET(AUDIT_FOUND TRUE)
+diff --git a/e4rat-0.2.1/src/cmake/Findauparse.cmake b/e4rat-0.2.1/src/cmake/Findauparse.cmake
+index 7db0511..3771cd5 100644
+--- a/e4rat-0.2.1/src/cmake/Findauparse.cmake
++++ b/e4rat-0.2.1/src/cmake/Findauparse.cmake
+@@ -1,7 +1,7 @@
+ FIND_PATH(AUPARSE_INCLUDE_DIR auparse.h /usr/include
+ /usr/local/include)
+
+-FIND_LIBRARY(AUPARSE_LIBRARY NAMES libauparse.a PATH /usr/lib /usr/local/lib)
++FIND_LIBRARY(AUPARSE_LIBRARY NAMES auparse PATH /usr/lib /usr/local/lib)
+
+ IF (AUPARSE_INCLUDE_DIR AND AUPARSE_LIBRARY)
+ SET(AUPARSE_FOUND TRUE)
+--
+1.7.8.110.g4cb5d1.dirty
+
diff --git a/sys-fs/e4rat/metadata.xml b/sys-fs/e4rat/metadata.xml
new file mode 100644
index 000000000000..e10b42734420
--- /dev/null
+++ b/sys-fs/e4rat/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>pacho@gentoo.org</email>
+<name>Pacho Ramos</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-fs/ecryptfs-utils/Manifest b/sys-fs/ecryptfs-utils/Manifest
new file mode 100644
index 000000000000..0b1233dde7e6
--- /dev/null
+++ b/sys-fs/ecryptfs-utils/Manifest
@@ -0,0 +1 @@
+DIST ecryptfs-utils_104.orig.tar.gz 649268 SHA256 4a200176542d46439c5297021f2c7fd7343b871c20c6f73f6e6c9fc4e5fd7438 SHA512 1d093df406c731e6a44bcfc647d5e84a4110fc8d55c8a6aee7e056b0cac8f826b16fbde3dcccd0cf64fcd981a7666b71b1697951ed614ad510c4a6e403f5efd8 WHIRLPOOL e483161d9268583dd596a62299e46c9e37d2e5ceb1f0e197115a9d4b489167abe40e3fd9ff4ed411f7b97543b26c0793411d815bdba9cef211dbe69f3c7bf54c
diff --git a/sys-fs/ecryptfs-utils/ecryptfs-utils-104.ebuild b/sys-fs/ecryptfs-utils/ecryptfs-utils-104.ebuild
new file mode 100644
index 000000000000..ee619a0238cc
--- /dev/null
+++ b/sys-fs/ecryptfs-utils/ecryptfs-utils-104.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+PYTHON_DEPEND="python? 2:2.5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.4 3.* *-jython 2.7-pypy-*"
+
+inherit flag-o-matic pam python linux-info autotools
+
+DESCRIPTION="eCryptfs userspace utilities"
+HOMEPAGE="https://launchpad.net/ecryptfs"
+SRC_URI="http://launchpad.net/ecryptfs/trunk/${PV}/+download/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+IUSE="doc gpg gtk openssl pam pkcs11 python suid tpm"
+
+RDEPEND=">=sys-apps/keyutils-1.0
+ >=dev-libs/libgcrypt-1.2.0:0
+ dev-libs/nss
+ gpg? ( app-crypt/gpgme )
+ gtk? ( x11-libs/gtk+:2 )
+ openssl? ( >=dev-libs/openssl-0.9.7 )
+ pam? ( sys-libs/pam )
+ pkcs11? (
+ >=dev-libs/openssl-0.9.7
+ >=dev-libs/pkcs11-helper-1.04
+ )
+ tpm? ( app-crypt/trousers )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-devel/gettext
+ >=dev-util/intltool-0.41.0
+ python? ( dev-lang/swig )"
+
+pkg_setup() {
+ use python && python_pkg_setup
+
+ CONFIG_CHECK="~ECRYPT_FS"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ echo "#!/bin/sh" > py-compile
+
+ # Python bindings are built/installed manually.
+ sed -e "/SUBDIRS =/s/ libecryptfs-swig//" -i src/Makefile.am || die "sed failed"
+
+ eautoreconf
+}
+
+src_configure() {
+ append-cppflags -D_FILE_OFFSET_BITS=64
+
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --enable-nss \
+ --with-pamdir=$(getpam_mod_dir) \
+ $(use_enable doc docs) \
+ $(use_enable gpg) \
+ $(use_enable gtk gui) \
+ $(use_enable openssl) \
+ $(use_enable pam) \
+ $(use_enable pkcs11 pkcs11-helper) \
+ $(use_enable python pywrap) \
+ $(use_enable tpm tspi)
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ python_copy_sources src/libecryptfs-swig
+ building() {
+ emake \
+ PYTHON="$(PYTHON)" \
+ PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
+ PYTHON_LDFLAGS="-L$(python_get_libdir) $(python_get_library -l)" \
+ PYTHON_SITE_PKG="$(python_get_sitedir)" \
+ PYTHON_VERSION="$(python_get_version)" \
+ SWIG_PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
+ pyexecdir="$(python_get_sitedir)" \
+ pythondir="$(python_get_sitedir)"
+ }
+ python_execute_function -s --source-dir src/libecryptfs-swig building
+ fi
+}
+
+src_install(){
+ emake DESTDIR="${D}" install
+
+ if use python; then
+ installation() {
+ emake \
+ DESTDIR="${D}" \
+ PYTHON="$(PYTHON)" \
+ PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
+ PYTHON_LDFLAGS="-L$(python_get_libdir) $(python_get_library -l)" \
+ PYTHON_SITE_PKG="$(python_get_sitedir)" \
+ PYTHON_VERSION="$(python_get_version)" \
+ SWIG_PYTHON_CPPFLAGS="-I$(python_get_includedir)" \
+ pyexecdir="$(python_get_sitedir)" \
+ pythondir="$(python_get_sitedir)" \
+ install || return 1
+ echo "ecryptfs-utils" > "${ED}$(python_get_sitedir)/ecryptfs-utils.pth"
+ }
+ python_execute_function -s --source-dir src/libecryptfs-swig installation
+
+ python_clean_installation_image
+ fi
+
+ use suid && fperms u+s /sbin/mount.ecryptfs_private
+
+ find "${ED}" -name '*.la' -exec rm -f '{}' +
+}
+
+pkg_postinst() {
+ use python && python_mod_optimize ecryptfs-utils
+
+ if use suid; then
+ ewarn
+ ewarn "You have chosen to install ${PN} with the binary setuid root. This"
+ ewarn "means that if there are any undetected vulnerabilities in the binary,"
+ ewarn "then local users may be able to gain root access on your machine."
+ ewarn
+ fi
+}
+
+pkg_postrm() {
+ use python && python_mod_cleanup ecryptfs-utils
+}
diff --git a/sys-fs/ecryptfs-utils/metadata.xml b/sys-fs/ecryptfs-utils/metadata.xml
new file mode 100644
index 000000000000..8a71e7a160ef
--- /dev/null
+++ b/sys-fs/ecryptfs-utils/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <herd>crypto</herd>
+ <use>
+ <flag name="gpg">Enable <pkg>app-crypt/gnupg</pkg> key module</flag>
+ <flag name="openssl">Enable <pkg>dev-libs/openssl</pkg> key
+ module</flag>
+ <flag name="pkcs11">Enable PKCS#11 (Smartcards) key module</flag>
+ <flag name="tpm">Enable support for Trusted Platform Module (TPM) using <pkg>app-crypt/trousers</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:ecryptfs:ecryptfs_utils</remote-id>
+ <remote-id type="launchpad">ecryptfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/encfs/Manifest b/sys-fs/encfs/Manifest
new file mode 100644
index 000000000000..08c219db54bb
--- /dev/null
+++ b/sys-fs/encfs/Manifest
@@ -0,0 +1,2 @@
+DIST encfs-1.7.5.tar.gz 168162 SHA256 111f15521479832a0ec5473c7e201316c88cae4e2c70bf8cea7fa23acb42c017 SHA512 e0cb9181d9c6c54a36dd19ab7a78d6f9ad0f017129d1addab012e72e00a3bb7e19481a2fbc511fd2a505c8b971cd93a02e556c6420b07acfba68ac3c37d224d7 WHIRLPOOL d0036483f404e81ba34d90a3bb5e422bf5354a05727cb75dcf8ab39c77b11276a21ec9e1e7933f554dbeb77107f4773d7251fbf50d5f4e2109d22658b8303177
+DIST encfs-1.8.1.tar.gz 316534 SHA256 ed6b69d8aba06382ad01116bbce2e4ad49f8de85cdf4e2fab7ee4ac82af537e9 SHA512 47e6cdded84c65bdb98c14774472a2f9df67f2bea05e4c2e20811d785c5ee458b708030922db9a5b49382495235a329bc8e889d104cc8501cd954119699847c6 WHIRLPOOL ccbd21927a9395dc178c41ebdf2fced4f8f7e14c23194baca32aa4270526388a34fd8817c2675d8610f983a90f121629056817c6599944f60a5d73b970e968f1
diff --git a/sys-fs/encfs/encfs-1.7.5.ebuild b/sys-fs/encfs/encfs-1.7.5.ebuild
new file mode 100644
index 000000000000..7214cdad2e9b
--- /dev/null
+++ b/sys-fs/encfs/encfs-1.7.5.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit autotools eutils multilib
+
+DESCRIPTION="An implementation of encrypted filesystem in user-space using FUSE"
+HOMEPAGE="https://vgough.github.io/encfs/"
+SRC_URI="https://github.com/vgough/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~sparc x86"
+IUSE="xattr"
+
+RDEPEND=">=dev-libs/boost-1.34
+ >=dev-libs/openssl-0.9.7
+ >=dev-libs/rlog-1.4
+ >=sys-fs/fuse-2.7.0
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig
+ xattr? ( sys-apps/attr )
+ sys-devel/gettext"
+
+src_prepare() {
+ epatch "${FILESDIR}/encfs-1.7.5-fix-pod.patch"
+ eautoreconf
+}
+
+src_configure() {
+ use xattr || export ac_cv_header_attr_xattr_h=no
+
+ econf \
+ --disable-dependency-tracking
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog README
+ find "${D}" -name '*.la' -delete
+}
diff --git a/sys-fs/encfs/encfs-1.8.1.ebuild b/sys-fs/encfs/encfs-1.8.1.ebuild
new file mode 100644
index 000000000000..62024ad930e9
--- /dev/null
+++ b/sys-fs/encfs/encfs-1.8.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit autotools eutils multilib
+
+DESCRIPTION="An implementation of encrypted filesystem in user-space using FUSE"
+HOMEPAGE="https://vgough.github.io/encfs/"
+SRC_URI="https://github.com/vgough/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~sparc ~x86"
+IUSE="xattr nls"
+
+RDEPEND=">=dev-libs/boost-1.34
+ >=sys-fs/fuse-2.5
+ >=dev-libs/openssl-0.9.7
+ >=dev-libs/rlog-1.3
+ sys-libs/zlib"
+# Your libc probably provides xattrs, but to be safe
+# we'll dep on sys-apps/attr. This should be fixed
+# if we ever create a virtual/attr.
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig
+ xattr? ( sys-apps/attr )
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ # configure searches for either attr/xattr.h or sys/xattr.h
+ use xattr || export ac_cv_header_{attr,sys}_xattr_h=no
+
+ econf \
+ $(use_enable nls) \
+ --disable-valgrind \
+ --enable-openssl \
+ --disable-dependency-tracking
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog README.md
+ find "${D}" -name '*.la' -delete
+}
diff --git a/sys-fs/encfs/files/encfs-1.7.5-fix-pod.patch b/sys-fs/encfs/files/encfs-1.7.5-fix-pod.patch
new file mode 100644
index 000000000000..1089a92da286
--- /dev/null
+++ b/sys-fs/encfs/files/encfs-1.7.5-fix-pod.patch
@@ -0,0 +1,16 @@
+diff -Naur encfs-1.7.5.orig/encfs/encfsctl.pod encfs-1.7.5/encfs/encfsctl.pod
+--- encfs-1.7.5.orig/encfs/encfsctl.pod 2011-12-29 17:26:28.000000000 -0500
++++ encfs-1.7.5/encfs/encfsctl.pod 2014-11-01 14:24:48.636330176 -0400
+@@ -1,4 +1,3 @@
+-=cut
+ Copyright (c) 2003-2004, Valient Gough <vgough@pobox.com>
+ All rights reserved.
+
+diff -Naur encfs-1.7.5.orig/encfs/encfs.pod encfs-1.7.5/encfs/encfs.pod
+--- encfs-1.7.5.orig/encfs/encfs.pod 2011-12-29 17:26:28.000000000 -0500
++++ encfs-1.7.5/encfs/encfs.pod 2014-11-01 14:24:51.132330290 -0400
+@@ -1,4 +1,3 @@
+-=cut
+ Copyright (c) 2003-2008, Valient Gough <vgough@pobox.com>
+ All rights reserved.
+
diff --git a/sys-fs/encfs/metadata.xml b/sys-fs/encfs/metadata.xml
new file mode 100644
index 000000000000..eadb5fd37f78
--- /dev/null
+++ b/sys-fs/encfs/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">encfs</remote-id>
+ <remote-id type="github">vgough/encfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/etcd-fs/Manifest b/sys-fs/etcd-fs/Manifest
new file mode 100644
index 000000000000..943ae9b72239
--- /dev/null
+++ b/sys-fs/etcd-fs/Manifest
@@ -0,0 +1 @@
+DIST etcd-fs-0_p20140620.zip 12608 SHA256 9882517f171242babf0067d4b6a0de61e9559a12c1d57068e0c2082557a64bf9 SHA512 9f0066ed635bf33812c2ab71d320d42e45684312243bff2e17c0d58eee25723ef980c59d6a7ca751ceacd69e75af7edc691d5595ab06d5de1bdfe244656367e9 WHIRLPOOL 620a2f916c3734b82be5ab6a3a8f3f849d86832f9127d05df00f176b04eabc47be12e131e2017313738a614ebcf8dfee7e7226a3dc6ed5a0c33836dc6a68166b
diff --git a/sys-fs/etcd-fs/etcd-fs-0_p20140620.ebuild b/sys-fs/etcd-fs/etcd-fs-0_p20140620.ebuild
new file mode 100644
index 000000000000..8d6504cf0895
--- /dev/null
+++ b/sys-fs/etcd-fs/etcd-fs-0_p20140620.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+KEYWORDS="~amd64"
+DESCRIPTION="Use etcd as a FUSE filesystem"
+HOMEPAGE="https://github.com/xetorthio/${PN}"
+EGIT_COMMIT="395eacbaebccccc5f03ed11dc887ea2f1af300a0"
+SRC_URI="${HOMEPAGE}/archive/${EGIT_COMMIT}.zip -> ${P}.zip"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+DEPEND="
+ >=dev-lang/go-1.3
+ dev-db/go-etcd
+ dev-libs/go-fuse"
+RDEPEND=""
+S=${WORKDIR}/${PN}-${EGIT_COMMIT}
+
+src_compile() {
+ CGO_CFLAGS=${CFLAGS} GOPATH=${S} \
+ go build \
+ -x -ldflags="-v -linkmode=external -extldflags '${LDFLAGS}'" \
+ etcdfs.go || die
+}
+
+src_install() {
+ dobin etcdfs
+ dodoc README.md
+}
diff --git a/sys-fs/etcd-fs/metadata.xml b/sys-fs/etcd-fs/metadata.xml
new file mode 100644
index 000000000000..2ce081f3df47
--- /dev/null
+++ b/sys-fs/etcd-fs/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>https://github.com/xetorthio/etcd-fs/issues</bugs-to>
+ <changelog>https://github.com/xetorthio/etcd-fs/commits/master</changelog>
+ <doc>https://github.com/xetorthio/etcd-fs/blob/master/README.md</doc>
+ <remote-id type="github">xetorthio/etcd-fs</remote-id>
+ </upstream>
+ <maintainer>
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/eudev/Manifest b/sys-fs/eudev/Manifest
new file mode 100644
index 000000000000..b4fbd0bc5708
--- /dev/null
+++ b/sys-fs/eudev/Manifest
@@ -0,0 +1,7 @@
+DIST eudev-1.10.tar.gz 1776717 SHA256 401eeb29147d3e24d87849a8006df62eadeb369d913484d59e9e35f3f73a20d1 SHA512 76ba9e3c732a6baad448500ef72368e985e0edf45b80d920e23432b5ee2da3e841c5faf2cc281af6432625758608c31eb441c6af9e2161d4e7264348e33e086f WHIRLPOOL d3251a1ef18e46e000a0941156ca4daa33b54a6147fece4cee6d863f86c98068e88bc11bc8a90f45c578ed62338218c5c8b4b06bb6132610e3d4a30bf79fe192
+DIST eudev-1.3.tar.gz 1679385 SHA256 6f1f0b15971a53c7070a44c902c7c1303f952927aa6370dbdf4d84d8bc09fac2 SHA512 5e0016fbe15eebfa68bb04fa7b5aedd7edc7a508afdc030adb7cbec4e9eca84fe16119ca73f5724ec290ad4bba179b42d2d0bc56f3aaf2a07e3c48b18374b3b3 WHIRLPOOL db748742f9149b7a232b0d630a8734e81fb1077ed581fcde88f57f299b6746bcadec0bdd9e7ad914dae848ace9199c7d664006003dc4999af3bfa1e14099f366
+DIST eudev-1.5.3.tar.gz 1724415 SHA256 8e4362979572719562f600bfd7decd42d4e21506db5483e3d2e88f725396c57b SHA512 c00f34d76d76ebd5c2862310a2ba3d7bf2f8d348a96e0120ed02aa9014857df736e3a2280a4478e50f2537cabc9082b8f5f5e57ef7b3cf925fae6dc3a4688ddb WHIRLPOOL b3fc943f6c3eaeba92aed72dee417738a840f4176182e08f7564a1fd34baa3cf2a52787ac8e936f74f6c13b7896eb929a2f83cf087b8b09e5b8c7d7858471dd5
+DIST eudev-1.9.tar.gz 1762520 SHA256 8f17e92f1177ce9352bde00360e227a7cbb3b97ac8816174bee34be80e44cef0 SHA512 13bd7df42d686818f499856d260e5dfaf10425f06e05449bf4cc8318667b166e2ae9c5e8b519008285aeaab9284ec5fde1f9f19e536dd4bae09a5439c86336b3 WHIRLPOOL d0504f05e191e94229bf60a497cab82fe461f52072ba7ed2171654e684397e4ffa9ba47c8b18cd0cc6d0168701dcac3b7d4b6c73168382e2432c7c229b2d0293
+DIST eudev-2.1.1.tar.gz 1786403 SHA256 6aef101c5496a2dc45e669307d478dbccb0ee0462a285512edcda51ff12e0e6a SHA512 b3fb6d80ef94f124e7c23d7df61ed65c298e58f400d8df6b38fb1cea1da6cd387a17866dd54e12c8160214a496dab5d55b2e40ab1a6142a332f951cd3525d490 WHIRLPOOL 2c1ea2463ea7f1a72071866795609f75021abd81d9ab36298238dc481586de5d71864467b5da04546d0e1a1e0abf9ac1386bda2140ed1b5d277ae13baaf0a7d5
+DIST eudev-3.0.tar.gz 1835636 SHA256 74db8aaf13cc392edfb821291783ecd64d815e6f81409f57e290d3017750db29 SHA512 a0cfbbd5b1e59dafaf0ba2e321756bb7bff3d1a92e09ab0fca674adc80911e55aec29ed0b74262846516443d344cf044a0cfffb9e1d1caeb2f145da8d1a5327f WHIRLPOOL e08dcdd18bc6a8f4df2d66099e2ff90abb6bf62f75af81fb98c90261ce254eba986a6742eeca5d673818c2098d8a335ce9212aa3f1be5e1495ac05a397fe3f7a
+DIST eudev-3.1.2.tar.gz 1858004 SHA256 4393b69e93dd8117defde6519b199d479f9d051f52061157a1a7a41b8fe10273 SHA512 d9aeb37a163ce4a0c116f75a927b4b99f8445d06624fbb3c28ade18f3effd8c54af5a4a52477c31a0452822a3dc0901468263195256e9dbf79d2ef08cf46f2b6 WHIRLPOOL 2249128672d2adfa968c123a2538063331348bc8e8481ad9c25bf8d9fb4d2d3c8a05417439f155d9ababe657b19a595c18c6ba60ad0d5584a8ead86220b39577
diff --git a/sys-fs/eudev/eudev-1.10-r2.ebuild b/sys-fs/eudev/eudev-1.10-r2.ebuild
new file mode 100644
index 000000000000..d82d8af53123
--- /dev/null
+++ b/sys-fs/eudev/eudev-1.10-r2.ebuild
@@ -0,0 +1,301 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+WANT_AUTOMAKE=1.13
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="amd64 arm hppa ~mips ppc ppc64 x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb +kmod introspection +keymap +modutils +openrc +rule-generator selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ keymap? ( dev-util/gperf )
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND="hwdb? ( >=sys-apps/hwids-20140304[udev] )
+ keymap? ( >=sys-apps/hwids-20140304[udev] )
+ openrc? ( >=sys-fs/udev-init-scripts-26 )"
+
+REQUIRED_USE="keymap? ( hwdb )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ if ! use rule-generator; then
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists:"
+ ewarn "\ttouch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+ ewarn "We are working on a better solution for the next beta release."
+ ewarn
+ fi
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ # Bug #520684
+ epatch "${FILESDIR}"/${PN}-fix-selinux-headers.patch
+ epatch "${FILESDIR}"/${PN}-fix-selinux-linking.patch
+
+ epatch_user
+
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-firmware-path="${EPREFIX}usr/lib/firmware/updates:${EPREFIX}usr/lib/firmware:${EPREFIX}lib/firmware/updates:${EPREFIX}lib/firmware"
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable keymap)
+ $(use_enable kmod libkmod)
+ $(usex kmod --enable-modules $(use_enable modutils modules))
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ $(use_enable rule-generator)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-keymap
+ --disable-libkmod
+ --disable-modules
+ --disable-selinux
+ --disable-rule-generator
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/shared
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ use rule-generator && use openrc && doinitd "${FILESDIR}"/udev-postmount
+
+ # drop distributed hwdb files, they override sys-apps/hwids
+ rm -f "${ED}"/etc/udev/hwdb.d/*.hwdb
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ if use rule-generator && use openrc && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then
+ ewarn
+ ewarn "Please add the udev-postmount init script to your default runlevel"
+ ewarn "to ensure the legacy rule-generator functionality works as reliably"
+ ewarn "as possible."
+ ewarn "\trc-update add udev-postmount default"
+ fi
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/eudev-1.3.ebuild b/sys-fs/eudev/eudev-1.3.ebuild
new file mode 100644
index 000000000000..65171c52eac2
--- /dev/null
+++ b/sys-fs/eudev/eudev-1.3.ebuild
@@ -0,0 +1,279 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.31
+
+inherit autotools eutils multilib linux-info multilib-minimal
+
+if [[ ${PV} = 9999* ]]
+then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="ia64"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev hwdb kmod introspection keymap +modutils +openrc +rule-generator selinux static-libs test"
+
+COMMON_DEPEND="gudev? ( dev-libs/glib:2 )
+ kmod? ( sys-apps/kmod )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
+ selinux? ( sys-libs/libselinux )
+ >=sys-apps/util-linux-2.20
+ !<sys-libs/glibc-2.11
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+DEPEND="${COMMON_DEPEND}
+ keymap? ( dev-util/gperf )
+ >=dev-util/intltool-0.40.0
+ virtual/pkgconfig
+ virtual/os-headers
+ !<sys-kernel/linux-headers-${KV_min}
+ doc? ( dev-util/gtk-doc )
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !sys-fs/udev
+ !sys-apps/coldplug
+ !sys-apps/systemd
+ !<sys-fs/lvm2-2.02.97
+ !sys-fs/device-mapper
+ !<sys-fs/udev-init-scripts-18
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND="hwdb? ( >=sys-apps/hwids-20130717-r1[udev] )
+ keymap? ( >=sys-apps/hwids-20130717-r1[udev] )
+ openrc? ( >=sys-fs/udev-init-scripts-18 )"
+
+REQUIRED_USE="keymap? ( hwdb )"
+
+pkg_pretend()
+{
+ if ! use rule-generator; then
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists:"
+ ewarn "\ttouch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+ ewarn "We are working on a better solution for the next beta release."
+ ewarn
+ fi
+}
+
+pkg_setup()
+{
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
+
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare()
+{
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch "${FILESDIR}"/${PN}-selinux-timespan.patch
+
+ epatch_user
+
+ if [[ ! -e configure ]]
+ then
+ if use doc
+ then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ elibtoolize
+ fi
+}
+
+multilib_src_configure()
+{
+ local econf_args
+
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-firmware-path="${EPREFIX}usr/lib/firmware/updates:${EPREFIX}usr/lib/firmware:${EPREFIX}lib/firmware/updates:${EPREFIX}lib/firmware"
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --exec-prefix=/
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable gudev)
+ $(use_enable introspection)
+ $(use_enable keymap)
+ $(use_enable kmod libkmod)
+ $(usex kmod --enable-modules $(use_enable modutils modules))
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ $(use_enable rule-generator)
+ )
+ else econf_args+=(
+ $(echo --disable-{gtk-doc,gudev,introspection,keymap,libkmod,modules,static,selinux,rule-generator})
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile()
+{
+ if ! multilib_is_native_abi; then
+ cd src/libudev || die "Could not change directory"
+ fi
+ emake
+}
+
+multilib_src_install()
+{
+ if ! multilib_is_native_abi; then
+ cd src/libudev || die "Could not change directory"
+ fi
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_test()
+{
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+# disable header checks because we only install libudev headers for non-native abi
+multilib_check_headers()
+{
+ :
+}
+
+multilib_src_install_all()
+{
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ use rule-generator && use openrc && doinitd "${FILESDIR}"/udev-postmount
+
+ # drop distributed hwdb files, they override sys-apps/hwids
+ rm -f "${ED}"/etc/udev/hwdb.d/*.hwdb
+}
+
+pkg_preinst()
+{
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]
+ then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]
+ then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst()
+{
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]
+ then
+ ewarn "Please make sure you remove /dev/loop, else losetup"
+ ewarn "may be confused when looking for unused devices."
+ fi
+
+ # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
+ # remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007
+ if [[ -f ${EROOT}etc/udev/rules.d/64-device-mapper.rules ]] &&
+ ! has_version sys-fs/device-mapper
+ then
+ rm -f "${EROOT}"etc/udev/rules.d/64-device-mapper.rules
+ einfo "Removed unneeded file 64-device-mapper.rules"
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ if use rule-generator && use openrc; then
+ ewarn
+ ewarn "Please add the udev-postmount init script to your default runlevel"
+ ewarn "to ensure the legacy rule-generator functionality works as reliably"
+ ewarn "as possible."
+ ewarn "\trc-update add udev-postmount default"
+ fi
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+}
diff --git a/sys-fs/eudev/eudev-1.5.3-r1.ebuild b/sys-fs/eudev/eudev-1.5.3-r1.ebuild
new file mode 100644
index 000000000000..cc4d390c4572
--- /dev/null
+++ b/sys-fs/eudev/eudev-1.5.3-r1.ebuild
@@ -0,0 +1,286 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.31
+
+inherit autotools eutils multilib linux-info multilib-minimal
+
+if [[ ${PV} = 9999* ]]
+then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="alpha"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb kmod introspection +keymap +modutils +openrc +rule-generator selinux static-libs test"
+
+COMMON_DEPEND="gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ kmod? ( sys-apps/kmod )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
+ selinux? ( sys-libs/libselinux )
+ >=sys-apps/util-linux-2.20
+ !<sys-libs/glibc-2.11
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+DEPEND="${COMMON_DEPEND}
+ keymap? ( dev-util/gperf )
+ >=dev-util/intltool-0.40.0
+ virtual/pkgconfig
+ virtual/os-headers
+ !<sys-kernel/linux-headers-${KV_min}
+ doc? ( dev-util/gtk-doc )
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !sys-fs/udev
+ !sys-apps/coldplug
+ !sys-apps/systemd
+ !<sys-fs/lvm2-2.02.97
+ !sys-fs/device-mapper
+ !<sys-fs/udev-init-scripts-18
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND="hwdb? ( >=sys-apps/hwids-20130717-r1[udev] )
+ keymap? ( >=sys-apps/hwids-20130717-r1[udev] )
+ openrc? ( >=sys-fs/udev-init-scripts-18 )"
+
+REQUIRED_USE="keymap? ( hwdb )"
+
+pkg_pretend()
+{
+ if ! use rule-generator; then
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists:"
+ ewarn "\ttouch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+ ewarn "We are working on a better solution for the next beta release."
+ ewarn
+ fi
+}
+
+pkg_setup()
+{
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2"
+
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare()
+{
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch_user
+
+ if [[ ! -e configure ]]
+ then
+ if use doc
+ then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ elibtoolize
+ fi
+}
+
+multilib_src_configure()
+{
+ local econf_args
+
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-firmware-path="${EPREFIX}usr/lib/firmware/updates:${EPREFIX}usr/lib/firmware:${EPREFIX}lib/firmware/updates:${EPREFIX}lib/firmware"
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable keymap)
+ $(use_enable kmod libkmod)
+ $(usex kmod --enable-modules $(use_enable modutils modules))
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ $(use_enable rule-generator)
+ )
+ else econf_args+=(
+ $(echo --disable-{gtk-doc,introspection,keymap,libkmod,modules,static,selinux,rule-generator})
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile()
+{
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install()
+{
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test()
+{
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+# disable header checks because we only install libudev headers for non-native abi
+multilib_check_headers()
+{
+ :
+}
+
+multilib_src_install_all()
+{
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ use rule-generator && use openrc && doinitd "${FILESDIR}"/udev-postmount
+
+ # drop distributed hwdb files, they override sys-apps/hwids
+ rm -f "${ED}"/etc/udev/hwdb.d/*.hwdb
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+}
+
+pkg_preinst()
+{
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]
+ then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]
+ then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst()
+{
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]
+ then
+ ewarn "Please make sure you remove /dev/loop, else losetup"
+ ewarn "may be confused when looking for unused devices."
+ fi
+
+ # 64-device-mapper.rules now gets installed by sys-fs/device-mapper
+ # remove it if user don't has sys-fs/device-mapper installed, 27 Jun 2007
+ if [[ -f ${EROOT}etc/udev/rules.d/64-device-mapper.rules ]] &&
+ ! has_version sys-fs/device-mapper
+ then
+ rm -f "${EROOT}"etc/udev/rules.d/64-device-mapper.rules
+ einfo "Removed unneeded file 64-device-mapper.rules"
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ if use rule-generator && use openrc && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then
+ ewarn
+ ewarn "Please add the udev-postmount init script to your default runlevel"
+ ewarn "to ensure the legacy rule-generator functionality works as reliably"
+ ewarn "as possible."
+ ewarn "\trc-update add udev-postmount default"
+ fi
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+}
diff --git a/sys-fs/eudev/eudev-1.9-r2.ebuild b/sys-fs/eudev/eudev-1.9-r2.ebuild
new file mode 100644
index 000000000000..f97d5925239b
--- /dev/null
+++ b/sys-fs/eudev/eudev-1.9-r2.ebuild
@@ -0,0 +1,302 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="amd64 arm hppa ~mips ppc ppc64 x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb +kmod introspection +keymap +modutils +openrc +rule-generator selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ keymap? ( dev-util/gperf )
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND="hwdb? ( >=sys-apps/hwids-20140304[udev] )
+ keymap? ( >=sys-apps/hwids-20140304[udev] )
+ openrc? ( >=sys-fs/udev-init-scripts-26 )"
+
+REQUIRED_USE="keymap? ( hwdb )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ if ! use rule-generator; then
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists:"
+ ewarn "\ttouch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+ ewarn "We are working on a better solution for the next beta release."
+ ewarn
+ fi
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ # Exclude MD from block device ownership event locking, bug #517986
+ epatch "${FILESDIR}"/${PN}-exclude-MD.patch
+
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ elibtoolize
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-firmware-path="${EPREFIX}usr/lib/firmware/updates:${EPREFIX}usr/lib/firmware:${EPREFIX}lib/firmware/updates:${EPREFIX}lib/firmware"
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable keymap)
+ $(use_enable kmod libkmod)
+ $(usex kmod --enable-modules $(use_enable modutils modules))
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ $(use_enable rule-generator)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-keymap
+ --disable-libkmod
+ --disable-modules
+ --disable-selinux
+ --disable-rule-generator
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ use rule-generator && use openrc && doinitd "${FILESDIR}"/udev-postmount
+
+ # drop distributed hwdb files, they override sys-apps/hwids
+ rm -f "${ED}"/etc/udev/hwdb.d/*.hwdb
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ if use rule-generator && use openrc && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then
+ ewarn
+ ewarn "Please add the udev-postmount init script to your default runlevel"
+ ewarn "to ensure the legacy rule-generator functionality works as reliably"
+ ewarn "as possible."
+ ewarn "\trc-update add udev-postmount default"
+ fi
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/eudev-2.1.1.ebuild b/sys-fs/eudev/eudev-2.1.1.ebuild
new file mode 100644
index 000000000000..c9d001b46bd8
--- /dev/null
+++ b/sys-fs/eudev/eudev-2.1.1.ebuild
@@ -0,0 +1,296 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+WANT_AUTOMAKE=1.13
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb +kmod introspection +keymap +modutils +rule-generator selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ keymap? ( dev-util/gperf )
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND=">=sys-fs/udev-init-scripts-26
+ hwdb? ( >=sys-apps/hwids-20140304[udev] )
+ keymap? ( >=sys-apps/hwids-20140304[udev] )"
+
+REQUIRED_USE="keymap? ( hwdb )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ if ! use rule-generator; then
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists:"
+ ewarn "\ttouch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+ ewarn "We are working on a better solution for the next beta release."
+ ewarn
+ fi
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch_user
+
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable keymap)
+ $(use_enable kmod libkmod)
+ $(usex kmod --enable-modules $(use_enable modutils modules))
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ $(use_enable rule-generator)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-keymap
+ --disable-libkmod
+ --disable-modules
+ --disable-selinux
+ --disable-rule-generator
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/shared
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ use rule-generator && doinitd "${FILESDIR}"/udev-postmount
+
+ # drop distributed hwdb files, they override sys-apps/hwids
+ rm -f "${ED}"/etc/udev/hwdb.d/*.hwdb
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ if use rule-generator && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qsv 'boot\|default\|sysinit'; then
+ ewarn
+ ewarn "Please add the udev-postmount init script to your default runlevel"
+ ewarn "to ensure the legacy rule-generator functionality works as reliably"
+ ewarn "as possible."
+ ewarn "\trc-update add udev-postmount default"
+ fi
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/eudev-3.0.ebuild b/sys-fs/eudev/eudev-3.0.ebuild
new file mode 100644
index 000000000000..8dade3487576
--- /dev/null
+++ b/sys-fs/eudev/eudev-3.0.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+WANT_AUTOMAKE=1.13
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb +kmod introspection selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND=">=sys-fs/udev-init-scripts-26
+ hwdb? ( >=sys-apps/hwids-20140304[udev] )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists: touch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch_user
+
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable kmod)
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-kmod
+ --disable-selinux
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/shared
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ # drop distributed hwdb files, they override sys-apps/hwids
+ rm -f "${ED}"/etc/udev/hwdb.d/*.hwdb
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/eudev-3.1.2-r10.ebuild b/sys-fs/eudev/eudev-3.1.2-r10.ebuild
new file mode 100644
index 000000000000..82cfc9d87226
--- /dev/null
+++ b/sys-fs/eudev/eudev-3.1.2-r10.ebuild
@@ -0,0 +1,270 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+WANT_AUTOMAKE=1.13
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc +hwdb +kmod introspection selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd"
+
+PDEPEND=">=sys-fs/udev-init-scripts-26
+ hwdb? ( >=sys-apps/hwids-20140304[udev] )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists: touch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch_user
+
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --with-rootrundir=/run
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --enable-manpages
+ --disable-hwdb
+ --exec-prefix=/
+
+ --disable-gudev
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable kmod)
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-kmod
+ --disable-selinux
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/shared
+ emake -C src/libudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/eudev-3.1.2.ebuild b/sys-fs/eudev/eudev-3.1.2.ebuild
new file mode 100644
index 000000000000..8d76fb21744c
--- /dev/null
+++ b/sys-fs/eudev/eudev-3.1.2.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+WANT_AUTOMAKE=1.13
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm hppa ia64 ~mips ~ppc ppc64 sparc x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb +kmod introspection selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND=">=sys-fs/udev-init-scripts-26
+ hwdb? ( >=sys-apps/hwids-20140304[udev] )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists: touch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch_user
+
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --with-rootrundir=/run
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --enable-manpages
+ --disable-hwdb
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable kmod)
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-kmod
+ --disable-selinux
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/shared
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/eudev-9999.ebuild b/sys-fs/eudev/eudev-9999.ebuild
new file mode 100644
index 000000000000..a030ccc216c4
--- /dev/null
+++ b/sys-fs/eudev/eudev-9999.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+KV_min=2.6.39
+WANT_AUTOMAKE=1.13
+
+inherit autotools eutils linux-info multilib multilib-minimal user
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://github.com/gentoo/eudev.git"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/${PN}/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="https://github.com/gentoo/eudev"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="doc gudev +hwdb +kmod introspection selinux static-libs test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ gudev? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-${KV_min}
+ doc? ( >=dev-util/gtk-doc-1.18
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ )
+ >=dev-util/intltool-0.50
+ test? ( app-text/tree dev-lang/perl )"
+
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ !sys-fs/udev
+ !sys-apps/systemd
+ gudev? ( !dev-libs/libgudev )"
+
+PDEPEND=">=sys-fs/udev-init-scripts-26
+ hwdb? ( >=sys-apps/hwids-20140304[udev] )"
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+pkg_pretend() {
+ ewarn
+ ewarn "As of 2013-01-29, ${P} provides the new interface renaming functionality,"
+ ewarn "as described in the URL below:"
+ ewarn "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ ewarn
+ ewarn "This functionality is enabled BY DEFAULT because eudev has no means of synchronizing"
+ ewarn "between the default or user-modified choice of sys-fs/udev. If you wish to disable"
+ ewarn "this new iface naming, please be sure that /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn "exists: touch /etc/udev/rules.d/80-net-name-slot.rules"
+ ewarn
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+ get_running_version
+
+ # These are required kernel options, but we don't error out on them
+ # because you can build under one kernel and run under another.
+ if kernel_is lt ${KV_min//./ }; then
+ ewarn
+ ewarn "Your current running kernel version ${KV_FULL} is too old to run ${P}."
+ ewarn "Make sure to run udev under kernel version ${KV_min} or above."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # change rules back to group uucp instead of dialout for now
+ sed -e 's/GROUP="dialout"/GROUP="uucp"/' -i rules/*.rules \
+ || die "failed to change group dialout to uucp"
+
+ epatch_user
+
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --with-rootprefix=
+ --with-rootrundir=/run
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-rootlibexecdir=/lib/udev
+ --with-html-dir="/usr/share/doc/${PF}/html"
+ --enable-split-usr
+ --enable-manpages
+ --disable-hwdb
+ --exec-prefix=/
+
+ $(use_enable gudev)
+ )
+
+ # Only build libudev for non-native_abi, and only install it to libdir,
+ # that means all options only apply to native_abi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable doc gtk-doc)
+ $(use_enable introspection)
+ $(use_enable kmod)
+ $(use_enable static-libs static)
+ $(use_enable selinux)
+ )
+ else
+ econf_args+=(
+ --disable-static
+ --disable-gtk-doc
+ --disable-introspection
+ --disable-kmod
+ --disable-selinux
+ )
+ fi
+ ECONF_SOURCE="${S}" econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ emake
+ else
+ emake -C src/shared
+ emake -C src/libudev
+ use gudev && emake -C src/gudev
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake -C src/libudev DESTDIR="${D}" install
+ use gudev && emake -C src/gudev DESTDIR="${D}" install
+ fi
+}
+
+multilib_src_test() {
+ # make sandbox get out of the way
+ # these are safe because there is a fake root filesystem put in place,
+ # but sandbox seems to evaluate the paths of the test i/o instead of the
+ # paths of the actual i/o that results.
+ # also only test for native abi
+ if multilib_is_native_abi; then
+ addread /sys
+ addwrite /dev
+ addwrite /run
+ default_src_test
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm -rf "${ED}"/usr/share/doc/${PF}/LICENSE.*
+
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/40-gentoo.rules
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${EROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${EROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${EROOT}"dev/loop 2>/dev/null
+ if [[ -d ${EROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ if use hwdb && has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ # reload database after it has be rebuilt, but only if we are not upgrading
+ # also pass if we are -9999 since who knows what hwdb related changes there might be
+ if [[ ${REPLACING_VERSIONS%-r*} == ${PV} || -z ${REPLACING_VERSIONS} ]] && \
+ [[ ${ROOT%/} == "" ]] && [[ ${PV} != "9999" ]]; then
+ udevadm control --reload
+ fi
+ fi
+
+ ewarn
+ ewarn "You need to restart eudev as soon as possible to make the"
+ ewarn "upgrade go into effect:"
+ ewarn "\t/etc/init.d/udev --nodeps restart"
+
+ elog
+ elog "For more information on eudev on Gentoo, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog " http://www.gentoo.org/doc/en/udev-guide.xml"
+ elog
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/eudev/files/40-gentoo.rules b/sys-fs/eudev/files/40-gentoo.rules
new file mode 100644
index 000000000000..365c6ea0d441
--- /dev/null
+++ b/sys-fs/eudev/files/40-gentoo.rules
@@ -0,0 +1,10 @@
+# do not edit this file, it will be overwritten on update
+
+# Propably unrequired, check how it is with OSS/OSS4, then remove
+SUBSYSTEM=="snd", GROUP="audio"
+
+# Gentoo specific usb group
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+
+# Keep this for Linux 2.6.32 support wrt #457868
+SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"
diff --git a/sys-fs/eudev/files/eudev-exclude-MD.patch b/sys-fs/eudev/files/eudev-exclude-MD.patch
new file mode 100644
index 000000000000..d56026168809
--- /dev/null
+++ b/sys-fs/eudev/files/eudev-exclude-MD.patch
@@ -0,0 +1,53 @@
+From 2e5b17d01347d3c3118be2b8ad63d20415dbb1f0 Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay@vrfy.org>
+Date: Thu, 24 Jul 2014 23:37:35 +0200
+Subject: [PATCH] udev: exclude MD from block device ownership event locking
+
+MD instantiates devices at open(). This is incomptible with the
+locking logic, as the "change" event emitted when stopping a
+device will bring it back.
+---
+ src/udev/udevd.c | 23 +++++++----------------
+ 1 file changed, 7 insertions(+), 16 deletions(-)
+
+diff --git a/src/udev/udevd.c b/src/udev/udevd.c
+index a45d324..db935d6 100644
+--- a/src/udev/udevd.c
++++ b/src/udev/udevd.c
+@@ -285,26 +285,17 @@ static void worker_new(struct event *event)
+ udev_event->exec_delay = exec_delay;
+
+ /*
+- * Take a "read lock" on the device node; this establishes
++ * Take a shared lock on the device node; this establishes
+ * a concept of device "ownership" to serialize device
+- * access. External processes holding a "write lock" will
++ * access. External processes holding an exclusive lock will
+ * cause udev to skip the event handling; in the case udev
+- * acquired the lock, the external process will block until
++ * acquired the lock, the external process can block until
+ * udev has finished its event handling.
+ */
+-
+- /*
+- * <kabi_> since we make check - device seems unused - we try
+- * ioctl to deactivate - and device is found to be opened
+- * <kay> sure, you try to take a write lock
+- * <kay> if you get it udev is out
+- * <kay> if you can't get it, udev is busy
+- * <kabi_> we cannot deactivate openned device (as it is in-use)
+- * <kay> maybe we should just exclude dm from that thing entirely
+- * <kabi_> IMHO this sounds like a good plan for this moment
+- */
+- if (streq_ptr("block", udev_device_get_subsystem(dev)) &&
+- !startswith(udev_device_get_sysname(dev), "dm-")) {
++ if (!streq_ptr(udev_device_get_action(dev), "remove") &&
++ streq_ptr("block", udev_device_get_subsystem(dev)) &&
++ !startswith(udev_device_get_sysname(dev), "dm-") &&
++ !startswith(udev_device_get_sysname(dev), "md")) {
+ struct udev_device *d = dev;
+
+ if (streq_ptr("partition", udev_device_get_devtype(d)))
+--
+1.8.5.5
+
diff --git a/sys-fs/eudev/files/eudev-fix-selinux-headers.patch b/sys-fs/eudev/files/eudev-fix-selinux-headers.patch
new file mode 100644
index 000000000000..1d1d8dcc236f
--- /dev/null
+++ b/sys-fs/eudev/files/eudev-fix-selinux-headers.patch
@@ -0,0 +1,32 @@
+From 361aa273d6fedda161c14b24302f009a58331693 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <amade@asmblr.net>
+Date: Tue, 2 Sep 2014 21:20:24 +0200
+Subject: [PATCH] fix SELINUX build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+---
+ src/shared/label.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/shared/label.c b/src/shared/label.c
+index 3c6277a..e674241 100644
+--- a/src/shared/label.c
++++ b/src/shared/label.c
+@@ -23,6 +23,11 @@
+ #include <sys/socket.h>
+ #include <sys/un.h>
+
++#ifdef HAVE_SELINUX
++#include <selinux/selinux.h>
++#include <selinux/label.h>
++#endif
++
+ #include "label.h"
+ #include "util.h"
+ #include "path-util.h"
+--
+2.1.0
+
diff --git a/sys-fs/eudev/files/eudev-fix-selinux-linking.patch b/sys-fs/eudev/files/eudev-fix-selinux-linking.patch
new file mode 100644
index 000000000000..6a5e05bcaf1e
--- /dev/null
+++ b/sys-fs/eudev/files/eudev-fix-selinux-linking.patch
@@ -0,0 +1,30 @@
+From e7f7217b9b9dbb3304116eae2b0ad90c84ede034 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <amade@asmblr.net>
+Date: Wed, 3 Sep 2014 11:01:31 +0200
+Subject: [PATCH] link libudev against SELINUX
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+---
+ src/libudev/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/libudev/Makefile.am b/src/libudev/Makefile.am
+index 868a9fc..72e43bc 100644
+--- a/src/libudev/Makefile.am
++++ b/src/libudev/Makefile.am
+@@ -54,7 +54,8 @@ libudev_la_LDFLAGS = \
+ -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
+
+ libudev_la_LIBADD = \
+- $(top_builddir)/src/shared/libudev_shared.la
++ $(top_builddir)/src/shared/libudev_shared.la \
++ $(SELINUX_LIBS)
+
+ libudev_private_la_SOURCES = \
+ $(libudev_la_SOURCES) \
+--
+2.1.0
+
diff --git a/sys-fs/eudev/files/eudev-selinux-timespan.patch b/sys-fs/eudev/files/eudev-selinux-timespan.patch
new file mode 100644
index 000000000000..0a51ee9bbe40
--- /dev/null
+++ b/sys-fs/eudev/files/eudev-selinux-timespan.patch
@@ -0,0 +1,27 @@
+commit 3cc37a5e294048a52fa3c2aa2c1ed89b0cd07169
+Author: Ian Stakenvicius <axs@gentoo.org>
+Date: Thu Aug 8 11:09:30 2013 -0400
+
+ Fixed compile error when --enable-selinux
+
+ FORMAT_TIMESPAN_MAX is used in src/udev/label.c in selinux-related
+ code, but this was not defined as it is located in a shared header
+ in systemd. Added the define to label.h. Didn't bother to track
+ down what commit added (or removed) this code (define)
+
+ Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
+
+diff --git a/src/udev/label.h b/src/udev/label.h
+index 3d12ac2..507fd2c 100644
+--- a/src/udev/label.h
++++ b/src/udev/label.h
+@@ -25,6 +25,9 @@
+ #include <stdbool.h>
+ #include <sys/socket.h>
+
++/* from systemd src/shared/time-util.h */
++#define FORMAT_TIMESPAN_MAX 64
++
+ int label_init(const char *prefix);
+ void label_finish(void);
+
diff --git a/sys-fs/eudev/files/udev-postmount b/sys-fs/eudev/files/udev-postmount
new file mode 100755
index 000000000000..e433736db9f3
--- /dev/null
+++ b/sys-fs/eudev/files/udev-postmount
@@ -0,0 +1,55 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend()
+{
+ need localmount
+ keyword -vserver -lxc
+}
+
+dir_writeable()
+{
+ touch "$1"/.test.$$ 2>/dev/null && rm "$1"/.test.$$
+}
+
+# store persistent-rules that got created while booting
+# when / was still read-only
+store_persistent_rules()
+{
+ # create /etc/udev/rules.d if it does not exist and /etc/udev is writable
+ [ -d /etc/udev/rules.d ] || \
+ dir_writeable /etc/udev && \
+ mkdir -p /etc/udev/rules.d
+
+ # only continue if rules-directory is writable
+ dir_writeable /etc/udev/rules.d || return 0
+
+ local file dest
+ for file in /run/udev/tmp-rules--*; do
+ dest=${file##*tmp-rules--}
+ [ "$dest" = '*' ] && break
+ type=${dest##70-persistent-}
+ type=${type%%.rules}
+ ebegin "Saving udev persistent ${type} rules to /etc/udev/rules.d"
+ cat "$file" >> /etc/udev/rules.d/"$dest" && rm -f "$file"
+ eend $? "Failed moving persistent rules!"
+ done
+}
+
+start()
+{
+ # check if this system uses udev
+ [ -d /run/udev ] || return 0
+
+ # store persistent-rules that got created while booting
+ # when / was still read-only
+ store_persistent_rules
+}
+
+stop()
+{
+ return 0
+}
+
+# vim:ts=4
diff --git a/sys-fs/eudev/metadata.xml b/sys-fs/eudev/metadata.xml
new file mode 100644
index 000000000000..4ee5faee4c77
--- /dev/null
+++ b/sys-fs/eudev/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>eudev@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="gudev">enable libudev gobject interface</flag>
+ <flag name="hwdb">read vendor/device string database and add it to udev database</flag>
+ <flag name="introspection">Use <pkg>dev-libs/gobject-introspection</pkg>
+ for introspection</flag>
+ <flag name="keymap">map custom hardware's multimedia keys</flag>
+ <flag name="kmod">enable module loading through libkmod</flag>
+ <flag name="modutils">enable module loading support - use modutils calls if kmod not enabled</flag>
+ <flag name="openrc">install the OpenRC init scripts</flag>
+ <flag name="rule-generator">install legacy rule generator rules and support scripts - note
+ that the functionality within was dropped from sys-fs/udev as it is not stable in
+ all cases; use at your own risk</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">gentoo/eudev</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/exfat-utils/Manifest b/sys-fs/exfat-utils/Manifest
new file mode 100644
index 000000000000..886868cf222f
--- /dev/null
+++ b/sys-fs/exfat-utils/Manifest
@@ -0,0 +1,3 @@
+DIST exfat-utils-1.0.1.tar.gz 51905 SHA256 eeacedca1878065dc3886674ae39cd51149c37bd7d6d7e9325c971a1d1acdab3 SHA512 e2716e902110858e33e21395c45881315cbe469cf5192de130031ce989bdcb388944ad22d8588ae1a29d682615809be886086d313d5ab46b3aafa6d356a0e8ac WHIRLPOOL 7d78afd9a37fed433704d8b6873d8ab19bd3d4e5c0e5951961f743768483c9843d51aa7342ec67e36466bb3141085a44c2d6ac6140f23361a4efd0d4ebcc6de1
+DIST exfat-utils-1.1.0.tar.gz 48723 SHA256 68a7943db27548b6aecb6305b3b5064e242945502f03ba95a5d14938a18cc94e SHA512 a672c4a1a90b652c991631db92ac2f59b4fe504d31c61b31e64f96d36bb0154c307c05134972f357bfb0f4006015381c65fee961edcfcfe6bf3c7d7dadf7f2eb WHIRLPOOL ff8f0964ff837118fe07632ed92e94d995d55650d9cf6fe391c1d67d65ba8fecb4d4a70740807d6f7591be0dcc49ccf3d760d32d042e937fc42e9558b1b21d02
+DIST exfat-utils-1.1.1.tar.gz 48754 SHA256 c64454083961fbad164fa7daef03d7e9247aa978c11395d62a265d48a1d56232 SHA512 d2ebf216a826734937402ff62c020d16c425e092cee5065a48bc7dca9d1e47e5906fc7bf3665ae553d819b0e2e066b1a882ad0bd2a6ab6caed50565f431ee253 WHIRLPOOL be4beda5a8dfa173553f9d03f019814195aa07506a0d6e31c7682b2f994e88e6673566f46dab77ad28784fd9551e0fe8d8f5e24922388f2fbdd181010c05fa7a
diff --git a/sys-fs/exfat-utils/exfat-utils-1.0.1.ebuild b/sys-fs/exfat-utils/exfat-utils-1.0.1.ebuild
new file mode 100644
index 000000000000..9f67f8425203
--- /dev/null
+++ b/sys-fs/exfat-utils/exfat-utils-1.0.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit scons-utils toolchain-funcs
+
+DESCRIPTION="exFAT filesystem utilities"
+HOMEPAGE="http://code.google.com/p/exfat/"
+SRC_URI="http://exfat.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc64 ~s390 ~sh ~sparc x86 ~arm-linux ~x86-linux"
+IUSE=""
+
+src_compile() {
+ tc-export AR CC RANLIB
+ escons CCFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ dobin dump/dumpexfat label/exfatlabel mkfs/mkexfatfs fsck/exfatfsck
+ dosym mkexfatfs /usr/bin/mkfs.exfat
+ dosym exfatfsck /usr/bin/fsck.exfat
+
+ doman */*.8
+ dodoc ChangeLog
+}
diff --git a/sys-fs/exfat-utils/exfat-utils-1.1.0.ebuild b/sys-fs/exfat-utils/exfat-utils-1.1.0.ebuild
new file mode 100644
index 000000000000..4782ed1f3a20
--- /dev/null
+++ b/sys-fs/exfat-utils/exfat-utils-1.1.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit scons-utils toolchain-funcs
+
+DESCRIPTION="exFAT filesystem utilities"
+HOMEPAGE="http://code.google.com/p/exfat/"
+SRC_URI="http://docs.google.com/uc?export=download&id=0B7CLI-REKbE3bnR2WHowZXNtUVU -> ${P}.tar.gz"
+
+LICENSE="GPL-2+" # COPYING is GPL-2 but ChangeLog says "Relicensed the project from GPLv3+ to GPLv2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE=""
+
+src_compile() {
+ tc-export AR CC RANLIB
+ escons CCFLAGS="${CFLAGS} -Wall -std=c99"
+}
+
+src_install() {
+ dobin dump/dumpexfat label/exfatlabel mkfs/mkexfatfs fsck/exfatfsck
+ dosym mkexfatfs /usr/bin/mkfs.exfat
+ dosym exfatfsck /usr/bin/fsck.exfat
+
+ doman */*.8
+ dodoc ChangeLog
+}
diff --git a/sys-fs/exfat-utils/exfat-utils-1.1.1.ebuild b/sys-fs/exfat-utils/exfat-utils-1.1.1.ebuild
new file mode 100644
index 000000000000..cf2b9f43c1c0
--- /dev/null
+++ b/sys-fs/exfat-utils/exfat-utils-1.1.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit scons-utils toolchain-funcs
+
+DESCRIPTION="exFAT filesystem utilities"
+HOMEPAGE="http://code.google.com/p/exfat/"
+SRC_URI="https://docs.google.com/uc?export=download&id=0B7CLI-REKbE3UzNtSkRvdHBpdjQ -> ${P}.tar.gz"
+
+LICENSE="GPL-2+" # COPYING is GPL-2 but ChangeLog says "Relicensed the project from GPLv3+ to GPLv2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE=""
+
+src_compile() {
+ tc-export AR CC RANLIB
+ escons CCFLAGS="${CFLAGS} -Wall -std=c99"
+}
+
+src_install() {
+ dobin dump/dumpexfat label/exfatlabel mkfs/mkexfatfs fsck/exfatfsck
+ dosym mkexfatfs /usr/bin/mkfs.exfat
+ dosym exfatfsck /usr/bin/fsck.exfat
+
+ doman */*.8
+ dodoc ChangeLog
+}
diff --git a/sys-fs/exfat-utils/metadata.xml b/sys-fs/exfat-utils/metadata.xml
new file mode 100644
index 000000000000..7b05b18e4457
--- /dev/null
+++ b/sys-fs/exfat-utils/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">exfat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/ext3grep/Manifest b/sys-fs/ext3grep/Manifest
new file mode 100644
index 000000000000..e86cf54049e6
--- /dev/null
+++ b/sys-fs/ext3grep/Manifest
@@ -0,0 +1 @@
+DIST ext3grep-0.10.2.tar.gz 236364 SHA256 586f3e939d2ffd782f6f006b81a3df2dc477c6da03f21edb8860c5c4f7198f3e SHA512 301a65c91d2342753a4588c40d496114067a18ceceb999f10fe3fc49c7d3a20c7836dba915575db352c89de7ff0ed3553cd8fbd2d1540109cb0ff7fa8f530b6f WHIRLPOOL ec56fae174c57c4736284f7f06628353b6c60490b1c9847fbade5808be50aa6a05aa427d8fa5d634c50dfdc196ef744b3dfc7e70955ea4122f2d84e7122259ae
diff --git a/sys-fs/ext3grep/ext3grep-0.10.2.ebuild b/sys-fs/ext3grep/ext3grep-0.10.2.ebuild
new file mode 100644
index 000000000000..c4d872ba50b6
--- /dev/null
+++ b/sys-fs/ext3grep/ext3grep-0.10.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="Recover deleted files on an ext3 file system"
+HOMEPAGE="http://code.google.com/p/ext3grep/"
+SRC_URI="http://ext3grep.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug pch"
+
+DOCS="NEWS README"
+
+RDEPEND=""
+DEPEND="sys-fs/e2fsprogs
+ virtual/os-headers
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-0.10.1-gcc44.patch \
+ "${FILESDIR}"/${P}-include-unistd_h-for-sysconf.patch
+
+ # Fix build against latest e2fsprogs, taken from
+ # https://code.google.com/p/ext3grep/issues/detail?id=34
+ epatch "${FILESDIR}"/${P}-new-e2fsprogs.diff
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ $(use_enable pch)
+}
diff --git a/sys-fs/ext3grep/files/ext3grep-0.10.1-gcc44.patch b/sys-fs/ext3grep/files/ext3grep-0.10.1-gcc44.patch
new file mode 100644
index 000000000000..a7a668c783b9
--- /dev/null
+++ b/sys-fs/ext3grep/files/ext3grep-0.10.1-gcc44.patch
@@ -0,0 +1,197 @@
+diff -Naur ext3grep-0.10.1-orig/src/commandline.cc ext3grep-0.10.1/src/commandline.cc
+--- ext3grep-0.10.1-orig/src/commandline.cc 2008-12-14 16:25:53.000000000 +0100
++++ ext3grep-0.10.1/src/commandline.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -32,6 +32,8 @@
+ #include "globals.h"
+ #include "restore.h"
+ #include "accept.h"
++#include <ctime>
++#include <limits>
+
+ // Commandline options.
+ bool commandline_superblock = false;
+diff -Naur ext3grep-0.10.1-orig/src/custom.cc ext3grep-0.10.1/src/custom.cc
+--- ext3grep-0.10.1-orig/src/custom.cc 2008-10-23 00:20:32.000000000 +0200
++++ ext3grep-0.10.1/src/custom.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -42,6 +42,9 @@
+ #include "get_block.h"
+ #include "init_consts.h"
+ #include "print_inode_to.h"
++#include <sys/time.h>
++#include <cstring>
++#include <ctime>
+
+ // The first part of this file was written and used for custom job:
+ // recovering emails on a 40 GB partition that had no information
+diff -Naur ext3grep-0.10.1-orig/src/debug.h ext3grep-0.10.1/src/debug.h
+--- ext3grep-0.10.1-orig/src/debug.h 2008-06-27 17:01:19.000000000 +0200
++++ ext3grep-0.10.1/src/debug.h 2009-08-04 00:25:07.000000000 +0200
+@@ -31,6 +31,7 @@
+
+ #include <iostream>
+ #include <cstdlib> // std::exit, EXIT_FAILURE
++#include <stdint.h>
+
+ #define AllocTag1(p)
+ #define AllocTag2(p, desc)
+diff -Naur ext3grep-0.10.1-orig/src/directories.cc ext3grep-0.10.1/src/directories.cc
+--- ext3grep-0.10.1-orig/src/directories.cc 2008-10-16 00:45:31.000000000 +0200
++++ ext3grep-0.10.1/src/directories.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -33,6 +33,9 @@
+ #include "indirect_blocks.h"
+ #include "get_block.h"
+ #include "directories.h"
++#include <cstring>
++#include <ctime>
++#include <algorithm>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/dir_inode_to_block.cc ext3grep-0.10.1/src/dir_inode_to_block.cc
+--- ext3grep-0.10.1-orig/src/dir_inode_to_block.cc 2008-06-28 15:40:06.000000000 +0200
++++ ext3grep-0.10.1/src/dir_inode_to_block.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -40,6 +40,8 @@
+ #include "print_inode_to.h"
+ #include "directories.h"
+ #include "journal.h"
++#include <cstring>
++#include <limits>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/histogram.cc ext3grep-0.10.1/src/histogram.cc
+--- ext3grep-0.10.1-orig/src/histogram.cc 2008-06-28 16:13:31.000000000 +0200
++++ ext3grep-0.10.1/src/histogram.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -29,6 +29,7 @@
+ #endif
+
+ #include "commandline.h"
++#include <cstring>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/indirect_blocks.cc ext3grep-0.10.1/src/indirect_blocks.cc
+--- ext3grep-0.10.1-orig/src/indirect_blocks.cc 2008-10-20 20:45:29.000000000 +0200
++++ ext3grep-0.10.1/src/indirect_blocks.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -54,6 +54,7 @@
+ #include "forward_declarations.h"
+ #include "endian_conversion.h"
+ #include "superblock.h"
++#include <set>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/init_directories.cc ext3grep-0.10.1/src/init_directories.cc
+--- ext3grep-0.10.1-orig/src/init_directories.cc 2008-06-29 21:08:31.000000000 +0200
++++ ext3grep-0.10.1/src/init_directories.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include "get_block.h"
+ #include "journal.h"
+ #include "dir_inode_to_block.h"
++#include <limits>
+
+ all_directories_type all_directories;
+ inode_to_directory_type inode_to_directory;
+diff -Naur ext3grep-0.10.1-orig/src/init_files.cc ext3grep-0.10.1/src/init_files.cc
+--- ext3grep-0.10.1-orig/src/init_files.cc 2008-06-29 04:39:33.000000000 +0200
++++ ext3grep-0.10.1/src/init_files.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -33,6 +33,7 @@
+ #include "globals.h"
+ #include "forward_declarations.h"
+ #include "journal.h"
++#include <algorithm>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/inode.cc ext3grep-0.10.1/src/inode.cc
+--- ext3grep-0.10.1-orig/src/inode.cc 2008-06-29 04:44:39.000000000 +0200
++++ ext3grep-0.10.1/src/inode.cc 2009-08-04 00:25:41.000000000 +0200
+@@ -33,6 +33,7 @@
+ #include "globals.h"
+ #include "conversion.h"
+ #include "inode.h"
++#include <limits>
+
+ #if USE_MMAP
+ void inode_unmap(int group)
+diff -Naur ext3grep-0.10.1-orig/src/is_blockdetection.h ext3grep-0.10.1/src/is_blockdetection.h
+--- ext3grep-0.10.1-orig/src/is_blockdetection.h 2008-07-11 02:23:37.000000000 +0200
++++ ext3grep-0.10.1/src/is_blockdetection.h 2009-08-04 00:25:40.000000000 +0200
+@@ -31,6 +31,8 @@
+
+ #include "inode.h" // Needed for InodePointer
+
++#include <cstring>
++
+ // Return type of is_directory.
+ enum is_directory_type {
+ isdir_no = 0, // Block is not a directory.
+diff -Naur ext3grep-0.10.1-orig/src/journal.cc ext3grep-0.10.1/src/journal.cc
+--- ext3grep-0.10.1-orig/src/journal.cc 2008-10-18 03:06:35.000000000 +0200
++++ ext3grep-0.10.1/src/journal.cc 2009-08-04 00:25:40.000000000 +0200
+@@ -37,6 +37,8 @@
+ #include "indirect_blocks.h"
+ #include "get_block.h"
+ #include "commandline.h"
++#include <algorithm>
++#include <ctime>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/last_undeleted_directory_inode_refering_to_block.cc ext3grep-0.10.1/src/last_undeleted_directory_inode_refering_to_block.cc
+--- ext3grep-0.10.1-orig/src/last_undeleted_directory_inode_refering_to_block.cc 2008-07-11 19:18:57.000000000 +0200
++++ ext3grep-0.10.1/src/last_undeleted_directory_inode_refering_to_block.cc 2009-08-04 00:25:41.000000000 +0200
+@@ -29,6 +29,7 @@
+ #include "is_blockdetection.h"
+ #include "inode_refers_to.h"
+ #include "journal.h"
++#include <limits>
+
+ // Return std::numeric_limits<int>::max() if the inode is still allocated
+ // and refering to the given block, otherwise return the Journal sequence
+diff -Naur ext3grep-0.10.1-orig/src/ostream_operators.cc ext3grep-0.10.1/src/ostream_operators.cc
+--- ext3grep-0.10.1-orig/src/ostream_operators.cc 2008-10-20 20:45:29.000000000 +0200
++++ ext3grep-0.10.1/src/ostream_operators.cc 2009-08-04 00:25:41.000000000 +0200
+@@ -31,6 +31,7 @@
+ #include "endian_conversion.h"
+ #include "superblock.h"
+ #include "globals.h"
++#include <ctime>
+
+ //-----------------------------------------------------------------------------
+ //
+diff -Naur ext3grep-0.10.1-orig/src/print_inode_to.cc ext3grep-0.10.1/src/print_inode_to.cc
+--- ext3grep-0.10.1-orig/src/print_inode_to.cc 2008-10-17 03:27:15.000000000 +0200
++++ ext3grep-0.10.1/src/print_inode_to.cc 2009-08-04 00:25:41.000000000 +0200
+@@ -30,6 +30,7 @@
+ #include "FileMode.h"
+ #include "globals.h"
+ #include "print_symlink.h"
++#include <ctime>
+
+ void print_inode_to(std::ostream& os, Inode const& inode)
+ {
+diff -Naur ext3grep-0.10.1-orig/src/restore.cc ext3grep-0.10.1/src/restore.cc
+--- ext3grep-0.10.1-orig/src/restore.cc 2008-10-18 17:30:54.000000000 +0200
++++ ext3grep-0.10.1/src/restore.cc 2009-08-04 00:25:41.000000000 +0200
+@@ -44,6 +44,9 @@
+ #include "FileMode.h"
+ #include "indirect_blocks.h"
+ #include "print_symlink.h"
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
+
+ #ifdef CPPGRAPH
+ void iterate_over_all_blocks_of__with__restore_file_action(void) { restore_file_action(0, 0, NULL); }
+diff -Naur ext3grep-0.10.1-orig/src/show_journal_inodes.cc ext3grep-0.10.1/src/show_journal_inodes.cc
+--- ext3grep-0.10.1-orig/src/show_journal_inodes.cc 2008-10-18 03:06:35.000000000 +0200
++++ ext3grep-0.10.1/src/show_journal_inodes.cc 2009-08-04 00:25:41.000000000 +0200
+@@ -30,6 +30,7 @@
+
+ #include "journal.h"
+ #include "print_inode_to.h"
++#include <limits>
+
+ void show_journal_inodes(int inodenr)
+ {
diff --git a/sys-fs/ext3grep/files/ext3grep-0.10.2-include-unistd_h-for-sysconf.patch b/sys-fs/ext3grep/files/ext3grep-0.10.2-include-unistd_h-for-sysconf.patch
new file mode 100644
index 000000000000..bf38c27e7095
--- /dev/null
+++ b/sys-fs/ext3grep/files/ext3grep-0.10.2-include-unistd_h-for-sysconf.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/422789
+
+--- src/init_consts.cc
++++ src/init_consts.cc
+@@ -27,6 +27,10 @@
+ #include "debug.h"
+ #endif
+
++#if USE_MMAP
++#include <unistd.h> /* sysconf */
++#endif
++
+ #include "globals.h"
+ #include "superblock.h"
+ #include "forward_declarations.h"
diff --git a/sys-fs/ext3grep/files/ext3grep-0.10.2-new-e2fsprogs.diff b/sys-fs/ext3grep/files/ext3grep-0.10.2-new-e2fsprogs.diff
new file mode 100644
index 000000000000..45b54b807bd7
--- /dev/null
+++ b/sys-fs/ext3grep/files/ext3grep-0.10.2-new-e2fsprogs.diff
@@ -0,0 +1,34 @@
+diff -ur ext3grep-0.10.1/src/ext3.h ext3grep-0.10.1.new/src/ext3.h
+--- ext3grep-0.10.1/src/ext3.h 2008-04-09 11:20:31.000000000 +0000
++++ ext3grep-0.10.1.new/src/ext3.h 2011-12-10 07:00:50.000000000 +0000
+@@ -24,6 +24,17 @@
+ #ifndef EXT3_H
+ #define EXT3_H
+
++// this trickery needs to happen before ext2_fs is included so
++// bail out if it has already been included by another path
++#ifdef _LINUX_EXT2_FS_H
++ #error please include this file before any other includes of ext2fs/ext2_fs.h
++#endif
++
++// some versions of the ext2 headers call this s_frags_per_group and some
++// call it s_clusters_per_group, define one to the other so our code works
++// with both
++#define s_clusters_per_group s_frags_per_group
++
+ // Use the header files from e2progs (http://e2fsprogs.sourceforge.net)
+ // We can use these headers and then everything named ext2 or ext3.
+ #include <ext2fs/ext2_fs.h> // Definitions of ext2, ext3 and ext4.
+@@ -110,6 +121,12 @@
+ __u32 faddr(void) const { return i_faddr; }
+ __u16 uid_high(void) const { return i_uid_high; }
+ __u16 gid_high(void) const { return i_gid_high; }
++#ifndef i_reseved2
++ //i_reseved2 has been split into two fields in recent
++ //versions of the headers, luckilly we can still access
++ //it in one peice through the hurd side of the union
++ #define i_reserved2 osd2.hurd2.h_i_author
++#endif
+ __u32 reserved2(void) const { return i_reserved2; }
+
+ void set_reserved2(__u32 val) { i_reserved2 = val; }
diff --git a/sys-fs/ext3grep/metadata.xml b/sys-fs/ext3grep/metadata.xml
new file mode 100644
index 000000000000..d4c00544c52a
--- /dev/null
+++ b/sys-fs/ext3grep/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hanno@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">ext3grep</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/ext4magic/Manifest b/sys-fs/ext4magic/Manifest
new file mode 100644
index 000000000000..c8872a3df721
--- /dev/null
+++ b/sys-fs/ext4magic/Manifest
@@ -0,0 +1 @@
+DIST ext4magic-0.3.2.tar.gz 426941 SHA256 8d9c6a594f212aecf4eb5410d277caeaea3adc03d35378257dfd017ef20ea115 SHA512 81bc9ba40dc2ea0bfb01bec160a1bbf0bf8a7983241aba34190d3571386f4d7dc63409866737b8d64516a3594eba11c819bbb721a1942c0a675d5675a7bba9a1 WHIRLPOOL 34bb59fa31babb0ac0edf098ed428c0f3a30976ce81edda15c1498e69f5a8d4453e3f7a133bd42dfe30bd11a42561ae8dd653a56e5831a8aaafacc90ba840da0
diff --git a/sys-fs/ext4magic/ext4magic-0.3.2.ebuild b/sys-fs/ext4magic/ext4magic-0.3.2.ebuild
new file mode 100644
index 000000000000..3c16018f9f4f
--- /dev/null
+++ b/sys-fs/ext4magic/ext4magic-0.3.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Linux admin tool, can help to recover deleted or overwritten files on ext3 and ext4 filesystems"
+HOMEPAGE="http://sourceforge.net/projects/ext4magic/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug expert-mode file-attr"
+
+RDEPEND="app-arch/bzip2
+ >=sys-apps/file-5.04
+ sys-apps/util-linux
+ >=sys-fs/e2fsprogs-1.41.9
+ sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS ChangeLog NEWS README TODO"
+
+src_configure() {
+ # build-system incorrectly recognizes '--disable-feature' options as enabled!
+ econf \
+ $(usex debug '--enable-debug' '') \
+ $(usex debug '--enable-debug-magic' '') \
+ $(usex expert-mode '--enable-expert-mode' '') \
+ $(usex file-attr '--enable-file-attr' '')
+}
diff --git a/sys-fs/ext4magic/metadata.xml b/sys-fs/ext4magic/metadata.xml
new file mode 100644
index 000000000000..3ae36b5a4189
--- /dev/null
+++ b/sys-fs/ext4magic/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>gokturk@binghamton.edu</email>
+ <name>Gokturk 'gokturk' Yuksek</name>
+ <description>Maintainer. Assign bugs on him</description>
+ </maintainer>
+ <maintainer>
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ <description>Proxy maintainer. CC him on bugs</description>
+ </maintainer>
+ <use>
+ <flag name="expert-mode">Builds ext4magic with expert mode. Highly useful in recovering data from a corrupted filesystem</flag>
+ <flag name="file-attr">Enable the recovery of file attributes (append, immutable, nodump etc)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ext4magic</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/extundelete/Manifest b/sys-fs/extundelete/Manifest
new file mode 100644
index 000000000000..3ba78306f202
--- /dev/null
+++ b/sys-fs/extundelete/Manifest
@@ -0,0 +1,3 @@
+DIST extundelete-0.2.0.tar.bz2 97851 SHA256 0f6a3004d8ddcafe63059a104c174f753c7fc95455081f3ff5aaf3b8c100f97b SHA512 2d4b18110795a5318fab5c5889a9b516360ea420215d0a3692322b30e87d5bb3954bbba725a067322cd76e7bba06466032a1405f9fc6dbc3f318723be238b317 WHIRLPOOL 5e79c5485eb323593289bc7b82a0960c9174e91f1491b9c64097c6095b7065b14dfafa3efe89030dbd3007d28ff54bb4d12814f5a5cf72920ceff63085c437a9
+DIST extundelete-0.2.4.tar.bz2 108472 SHA256 a1f9dd61247056d36401ce5d6785e74d08a184340eebd3865c345ddaa93f19f4 SHA512 5c896055b6fa3c38f283a043cca744513fdc1a60e212eac0c78fa868064a8eeb11f540c4cc5ca89ac68da0c1705a40fe45731c203b6748808f85e9870a207bcd WHIRLPOOL b7b9372ce38edf03c9d11199ff0ff225e1993b2e5a791f288db802f4a7789bca52c5e9d56361f18831cf472bdab4b7349e8b0f41ecbd26a6fcdee7d7a9772ec2
+DIST extundelete_0.2.0-2.1.debian.tar.gz 6862 SHA256 3e37f24ac60bd60a0d162184b2834b85bac0cd4cd2d055e1f687ed6a88f70f97 SHA512 37b74347a3017edfd28714731125f968f66beac1b7b7ebd1d44e3d3dff9da06216560433f330f4a544da24f7083f6e900fbe8a5c2930e8760405cb72e6a918e3 WHIRLPOOL e403d2f546d3d15032f6e49220cc0ca55bb9d7cfd0515030b57058e4d177f00ac34c378d08e5eb61245287322fa9d4d579d169e41e2b6b01e0109e112dff7642
diff --git a/sys-fs/extundelete/extundelete-0.2.0-r1.ebuild b/sys-fs/extundelete/extundelete-0.2.0-r1.ebuild
new file mode 100644
index 000000000000..525b7779556a
--- /dev/null
+++ b/sys-fs/extundelete/extundelete-0.2.0-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+_E2FS=1.42
+
+DESCRIPTION="A utility to undelete files from an ext3 or ext4 partition"
+HOMEPAGE="http://extundelete.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=sys-fs/e2fsprogs-${_E2FS}
+ >=sys-libs/e2fsprogs-libs-${_E2FS}"
+DEPEND="${RDEPEND}"
+
+DOCS="README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+}
diff --git a/sys-fs/extundelete/extundelete-0.2.0-r2.ebuild b/sys-fs/extundelete/extundelete-0.2.0-r2.ebuild
new file mode 100644
index 000000000000..60884ae20e56
--- /dev/null
+++ b/sys-fs/extundelete/extundelete-0.2.0-r2.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+_UNDEL_DEB=2.1
+_UNDEL_E2FS=1.42.6
+
+DESCRIPTION="A utility to undelete files from an ext3 or ext4 partition"
+HOMEPAGE="http://extundelete.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}-${_UNDEL_DEB}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT=0
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=sys-fs/e2fsprogs-${_UNDEL_E2FS}
+ >=sys-libs/e2fsprogs-libs-${_UNDEL_E2FS}"
+DEPEND=${RDEPEND}
+
+DOCS=README
+
+src_prepare() {
+ local d=${WORKDIR}/debian/patches
+ EPATCH_SOURCE=${d} epatch $(<"${d}"/series)
+}
diff --git a/sys-fs/extundelete/extundelete-0.2.4.ebuild b/sys-fs/extundelete/extundelete-0.2.4.ebuild
new file mode 100644
index 000000000000..bc3ba3e63017
--- /dev/null
+++ b/sys-fs/extundelete/extundelete-0.2.4.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A utility to undelete files from an ext3 or ext4 partition"
+HOMEPAGE="http://extundelete.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT=0
+KEYWORDS="amd64 x86"
+IUSE=""
+
+E2FSPROGS=1.42.6
+RDEPEND=">=sys-fs/e2fsprogs-${E2FSPROGS}
+ >=sys-libs/e2fsprogs-libs-${E2FSPROGS}"
+DEPEND=${RDEPEND}
+
+DOCS=README
diff --git a/sys-fs/extundelete/files/extundelete-0.2.0-build.patch b/sys-fs/extundelete/files/extundelete-0.2.0-build.patch
new file mode 100644
index 000000000000..2bd56ef2bbdf
--- /dev/null
+++ b/sys-fs/extundelete/files/extundelete-0.2.0-build.patch
@@ -0,0 +1,23 @@
+http://bugs.gentoo.org/402633
+http://projects.archlinux.org/svntogit/community.git/tree/trunk/extundelete-build.patch?h=packages/extundelete
+
+--- src/extundelete.cc
++++ src/extundelete.cc
+@@ -943,3 +943,3 @@
+ {
+- group_descriptor_table[n] = fs->group_desc[n];
++ group_descriptor_table[n] = *ext2fs_group_desc(fs, fs->group_desc, n);
+ }
+@@ -2613,3 +2613,4 @@
+ inode->osd2.linux2.l_i_gid_high = le16_to_cpu( (uint16_t *) &inodebuf[item*60] );
+- inode->osd2.linux2.l_i_reserved2 = le32_to_cpu( (uint32_t *) &inodebuf[item*62] );
++ inode->osd2.linux2.l_i_checksum_lo = le16_to_cpu( (uint16_t *) &inodebuf[item*62] );
++ inode->osd2.linux2.l_i_reserved = le16_to_cpu( (uint16_t *) &inodebuf[item*63] );
+ }
+--- src/insertionops.cc
++++ src/insertionops.cc
+@@ -65,3 +65,3 @@
+ os << "# Blocks per group: " << s_block->s_blocks_per_group << std::endl;
+- os << "# Fragments per group: " << s_block->s_frags_per_group << std::endl;
++ os << "# Fragments per group: " << s_block->s_clusters_per_group << std::endl;
+ os << "# Inodes per group: " << s_block->s_inodes_per_group << std::endl;
diff --git a/sys-fs/extundelete/metadata.xml b/sys-fs/extundelete/metadata.xml
new file mode 100644
index 000000000000..3af20051255f
--- /dev/null
+++ b/sys-fs/extundelete/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">extundelete</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/f2fs-tools/Manifest b/sys-fs/f2fs-tools/Manifest
new file mode 100644
index 000000000000..79349caa5f68
--- /dev/null
+++ b/sys-fs/f2fs-tools/Manifest
@@ -0,0 +1,5 @@
+DIST f2fs-tools-1.1.0.tar.gz 108520 SHA256 fcab080bf82fc8e8aa99602015c1c7343bdc7b94620f0508c2f0a778e72559cd SHA512 f42e1c40ebd20af25b23624b85b98b3e8357a4fabe9dc366ce98db4932fa1bef72dfe01ff7f02287568c567d8cda0cbf54e6a8cf4455be2d1e206057b27a9478 WHIRLPOOL b1793ff130e42357a2868908b08121464e873ee4e51605a7e27a25cec43a24d3b8d5189db0f56d96e58d5ddd84b9e9e572b12e91392fb4e9c2be2d0d6a05193e
+DIST f2fs-tools-1.2.0.tar.gz 369183 SHA256 c81f0beacde34ba3ce8c1758181aca697ff467ee7cb9176a49d54b8d900442de SHA512 11ab6915cc4bae1b0cdba5eb99fdd97ea5377b89f2c0abb0ec062c2a987efd38310a7234088708ba68c3332648de764dd9c078b467f49e02cd902a1893918983 WHIRLPOOL 581661a0f1171e700c6678ce0ea9fbbb2b62742309227f14a35452c986ac301888fc4ac9d04f1a7427ba6f6cd708dbec799c7860b0cc5c9e553ee982ce202174
+DIST f2fs-tools-1.3.0.tar.gz 725918 SHA256 82495872cfcbdade12aeb30f1c62492f5a26ce795af49df6d86441d03e175183 SHA512 c583b8c3296bd7cf98ddaab85cd6a0ff98325b519dda084e5a5da0ff77fc99de10a1d8e645030306d93b45be32a0158f241ca277f2517bcc33dd56957ea4948d WHIRLPOOL 6002eaacef7f02c81c569337a6524129838c8a9da444cddc0711e24558b133a950547abd5de05d9a3d840901918217843081782d439dcf83f77657d3477b0c28
+DIST f2fs-tools-1.4.0.tar.gz 397121 SHA256 851dd817a4c4a700383cf90a8d6f3333956cb154589daa2d6e482351ebf612bf SHA512 4d4c278d4fea25a6216ebbcbbcb88a424b16ef4d1fb1d56d186decb0f9e652f64c24f5bc7491fae360db52dbaccf8e14fb9fa9fdf86eb7025d0988e5647e17e8 WHIRLPOOL c6a53500ee86e953c31cc48e5fa2e5b8a68e55c25a33dd838f972cbdba1ff89792a801dc058425e96055f17a74c29fcfb1bd8ee747c754a44fcbba35973ac54b
+DIST f2fs-tools-1.4.1.tar.gz 403406 SHA256 194fd86283b6242fbae9f639bc5e4cf746e0f0525de5a8cc7eead8a03d5e31aa SHA512 75a74999a8387c3793252b06638174866d243706f596f86d33f6c3921d52e854354364c98a4692c7aaad49121b71ad3e7a6a2e82702b5d6965e984500eeaf7ab WHIRLPOOL 5d3250dae07cdb17857bc341f38fc1c1832c8e30d5704d57f65e7f00cedc052684681577440dfd47a491f00a0f678a82d15e5907cdd0e9b92a624954114967c9
diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.1.0-r1.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.1.0-r1.ebuild
new file mode 100644
index 000000000000..fc907e9a070f
--- /dev/null
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.1.0-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE="http://sourceforge.net/projects/f2fs-tools/ http://git.kernel.org/?p=linux/kernel/git/jaegeuk/f2fs-tools.git;a=summary"
+SRC_URI="http://dev.gentoo.org/~blueness/f2fs-tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 x86"
+IUSE=""
+
+src_configure () {
+ #This is required to install to /sbin, bug #481110
+ econf --prefix=/
+}
diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.2.0.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.2.0.ebuild
new file mode 100644
index 000000000000..6b781a5cd7b3
--- /dev/null
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.2.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/jaegeuk/f2fs-tools.git;a=summary"
+SRC_URI="http://dev.gentoo.org/~blueness/f2fs-tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE=""
+
+src_configure() {
+ #This is required to install to /sbin, bug #481110
+ econf --prefix=/ --includedir=/usr/include
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/libf2fs.{,l}a
+}
diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.3.0.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.3.0.ebuild
new file mode 100644
index 000000000000..6b781a5cd7b3
--- /dev/null
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.3.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/jaegeuk/f2fs-tools.git;a=summary"
+SRC_URI="http://dev.gentoo.org/~blueness/f2fs-tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE=""
+
+src_configure() {
+ #This is required to install to /sbin, bug #481110
+ econf --prefix=/ --includedir=/usr/include
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/libf2fs.{,l}a
+}
diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.4.0.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.4.0.ebuild
new file mode 100644
index 000000000000..8f53e74a70d5
--- /dev/null
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.4.0.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/jaegeuk/f2fs-tools.git;a=summary"
+SRC_URI="http://dev.gentoo.org/~blueness/f2fs-tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE=""
+
+src_configure() {
+ #This is required to install to /sbin, bug #481110
+ econf --prefix=/ --includedir=/usr/include
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/libf2fs.{,l}a
+}
diff --git a/sys-fs/f2fs-tools/f2fs-tools-1.4.1.ebuild b/sys-fs/f2fs-tools/f2fs-tools-1.4.1.ebuild
new file mode 100644
index 000000000000..8f53e74a70d5
--- /dev/null
+++ b/sys-fs/f2fs-tools/f2fs-tools-1.4.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="Tools for Flash-Friendly File System (F2FS)"
+HOMEPAGE="http://git.kernel.org/?p=linux/kernel/git/jaegeuk/f2fs-tools.git;a=summary"
+SRC_URI="http://dev.gentoo.org/~blueness/f2fs-tools/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE=""
+
+src_configure() {
+ #This is required to install to /sbin, bug #481110
+ econf --prefix=/ --includedir=/usr/include
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/libf2fs.{,l}a
+}
diff --git a/sys-fs/f2fs-tools/metadata.xml b/sys-fs/f2fs-tools/metadata.xml
new file mode 100644
index 000000000000..1e7587374fdf
--- /dev/null
+++ b/sys-fs/f2fs-tools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/fatsort/Manifest b/sys-fs/fatsort/Manifest
new file mode 100644
index 000000000000..e949381427c3
--- /dev/null
+++ b/sys-fs/fatsort/Manifest
@@ -0,0 +1 @@
+DIST fatsort-1.3.365.tar.gz 57209 SHA256 77acc374b189e80e3d75d3508f3c0ca559f8030f1c220f7cfde719a4adb03f3d SHA512 e3611841501e6dded8fd6270188ffb00191a20e93d84b0729cd2e215d37317f48e08bd67da41b88604858ef6f661e4b921b80645f454b78f91bfd2d0d4254d29 WHIRLPOOL 0998259baf3f315b0d7485fdf7d8172fa4c8f17f3f41fd163780eeaf7b6eda6c2e5dfdd99e9d0dd603bcd53aa6fc2a1ea6e1e2a2f14d211a8fc01b8db4ddeb9d
diff --git a/sys-fs/fatsort/fatsort-1.3.ebuild b/sys-fs/fatsort/fatsort-1.3.ebuild
new file mode 100644
index 000000000000..97697b8b8dee
--- /dev/null
+++ b/sys-fs/fatsort/fatsort-1.3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+SVN_REV=365
+MY_P=${P}.${SVN_REV}
+
+DESCRIPTION="Sorts files on FAT16/32 partitions, ideal for basic audio players"
+HOMEPAGE="http://fatsort.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="test"
+
+DEPEND="test? ( dev-util/bbe sys-fs/dosfstools )"
+
+RESTRICT="test? ( userpriv )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i -e '/^\(MANDIR=\|SBINDIR=\)/s|/usr/local|/usr|' \
+ $(find ./ -name Makefile) || die
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) LD=$(tc-getCC) \
+ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ DESTDIR="${D}"
+}
+
+src_test() {
+ make tests
+}
diff --git a/sys-fs/fatsort/files/fatsort-1.2-tests.patch b/sys-fs/fatsort/files/fatsort-1.2-tests.patch
new file mode 100644
index 000000000000..6fc44e23efcb
--- /dev/null
+++ b/sys-fs/fatsort/files/fatsort-1.2-tests.patch
@@ -0,0 +1,30 @@
+diff -Naur tests/tc_check_consistent_version/Makefile tests/tc_check_consistent_version/Makefile
+--- tests/tc_check_consistent_version/Makefile 2013-12-10 21:52:36.773278926 +0100
++++ tests/tc_check_consistent_version/Makefile 2013-12-10 21:52:43.783278646 +0100
+@@ -2,8 +2,8 @@
+
+ all:
+ manver=\
+- `head -1 ../../man/fatsort.1 | sed -e "s/.* \([0-9.]*\)\"$$/\1/"`; \
+- progver=`../../src/fatsort -v | head -1 | sed -e "s/^.* \([0-9.]\+\) .*$$/\1/"`; \
++ `head -2 ../../man/fatsort.1 | tail -1 | sed -e "s/^.*\"fatsort \([0-9.]\+\)\".*$$/\1/"`; \
++ progver=`../../src/fatsort --version | head -1 | sed -e "s/^fatsort \([0-9.]\+\).*$$/\1/"`; \
+ changesver=`head -1 ../../CHANGES | sed -e "s/^.*v\([0-9.]\+\)$$/\1/"`; \
+ echo "#$$manver#$$progver#$$changesver#"; \
+ [ "$$manver" = "$$progver" ]; \
+diff -Naur tests/tc_pos_sort_modification_time/Makefile tests/tc_pos_sort_modification_time/Makefile
+--- tests/tc_pos_sort_modification_time/Makefile 2013-12-10 21:52:36.772278926 +0100
++++ tests/tc_pos_sort_modification_time/Makefile 2013-12-10 21:57:06.433268173 +0100
+@@ -44,10 +44,11 @@
+ sudo mount -o loop,codepage=850,iocharset=iso8859-1,utf8,uid=${MOUNT_UID},gid=${MOUNT_GID} ${FS_IMG} ${MOUNT_POINT}
+ cat ${DIRECTORIES} | while read dir; do mkdir -p "${MOUNT_POINT}/$$dir"; done
+ cat ${FILES} | while read file; do touch "${MOUNT_POINT}/$$file"; done
+- sleep 3
++ sleep 1
+ touch ${MOUNT_POINT}/last # alter modification time
++ sleep 1
+ touch ${MOUNT_POINT}/first -t 200001010101.01
+-
++ sleep 1
+ sudo umount -l ${MOUNT_POINT}
+ rmdir ${MOUNT_POINT}
diff --git a/sys-fs/fatsort/metadata.xml b/sys-fs/fatsort/metadata.xml
new file mode 100644
index 000000000000..0cac73550ecf
--- /dev/null
+++ b/sys-fs/fatsort/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>billie@gentoo.org</email>
+ <name>Daniel Pielmeier</name>
+ </maintainer>
+ <longdescription><pkg>sys-fs/fatsort</pkg> is a utility that sorts FAT16 and FAT32 partitions. It even can
+ handle long file name entries. It reads the boot sector and sorts the
+ directory structure recursively. The main use case is to sort files on an
+ Audio player that does not implement the sorting function itself but plays
+ the files in the same order as they were copied to the disk.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">fatsort</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fur/Manifest b/sys-fs/fur/Manifest
new file mode 100644
index 000000000000..8005b20ce813
--- /dev/null
+++ b/sys-fs/fur/Manifest
@@ -0,0 +1 @@
+DIST fur-0.5.tar.gz 80811 SHA256 0b354be9d76766d2a605486c70fd434f0665d18c577689f4534dca351f941a34
diff --git a/sys-fs/fur/fur-0.5.ebuild b/sys-fs/fur/fur-0.5.ebuild
new file mode 100644
index 000000000000..7e548caa37a8
--- /dev/null
+++ b/sys-fs/fur/fur-0.5.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="A RAPI (SynCE) based FUSE module"
+HOMEPAGE="http://sourceforge.net/projects/synce/"
+SRC_URI="mirror://sourceforge/synce/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="void-chmod"
+
+RDEPEND="app-pda/synce-core
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ local myconf
+ use void-chmod && myconf="--enable-void-chmod"
+ econf ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dosym Fur /usr/bin/fur
+
+ dodoc Changelog README.txt
+ dohtml docs/*.html
+}
diff --git a/sys-fs/fur/metadata.xml b/sys-fs/fur/metadata.xml
new file mode 100644
index 000000000000..b7fb13fcc09a
--- /dev/null
+++ b/sys-fs/fur/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>pda</herd>
+ <use>
+ <flag name="void-chmod">Enable fake hook for "chmod" that will only return 0</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">synce</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fuse-convmvfs/Manifest b/sys-fs/fuse-convmvfs/Manifest
new file mode 100644
index 000000000000..7c5af3bf207d
--- /dev/null
+++ b/sys-fs/fuse-convmvfs/Manifest
@@ -0,0 +1 @@
+DIST fuse-convmvfs-0.2.6.tar.gz 94252 SHA256 67566fd4bc3f66211156872c60164aca898dcbba0669d52b8f74a9911b789695
diff --git a/sys-fs/fuse-convmvfs/files/mount.convmvfs b/sys-fs/fuse-convmvfs/files/mount.convmvfs
new file mode 100644
index 000000000000..cb383aa5463e
--- /dev/null
+++ b/sys-fs/fuse-convmvfs/files/mount.convmvfs
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# small wrapper-script to use convmvfs from
+# /etc/fstab and via "mount -t convmvfs".
+
+srcdir="${1}"
+shift
+exec /usr/bin/convmvfs "${@}" -o "srcdir=${srcdir}"
diff --git a/sys-fs/fuse-convmvfs/fuse-convmvfs-0.2.6.ebuild b/sys-fs/fuse-convmvfs/fuse-convmvfs-0.2.6.ebuild
new file mode 100644
index 000000000000..ae3ab7f8f281
--- /dev/null
+++ b/sys-fs/fuse-convmvfs/fuse-convmvfs-0.2.6.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="FUSE file system to convert filename charset"
+HOMEPAGE="http://fuse-convmvfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ default
+ exeinto /sbin
+ doexe "${FILESDIR}/mount.convmvfs"
+}
diff --git a/sys-fs/fuse-convmvfs/metadata.xml b/sys-fs/fuse-convmvfs/metadata.xml
new file mode 100644
index 000000000000..c955c26f4f19
--- /dev/null
+++ b/sys-fs/fuse-convmvfs/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">fuse-convmvfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fuse-exfat/Manifest b/sys-fs/fuse-exfat/Manifest
new file mode 100644
index 000000000000..1b0a539c8195
--- /dev/null
+++ b/sys-fs/fuse-exfat/Manifest
@@ -0,0 +1,2 @@
+DIST fuse-exfat-1.0.1.tar.gz 39627 SHA256 12ac1ba1b7d4343bef64e7898176705a41cfe3b5a7a179e28549d242e2854758 SHA512 e444031e7a6b999b3014ced255447bdfe4586b16970f36393706433262ca0cbd17911d6ca7af3465871f3136bdd9c8be2ec85f0dd124d670b240829093d341f6 WHIRLPOOL 521e1bc9356e2fcef7afc7720f5a4b017aa908f58af1537bc243ebfdfb6ba41dcba3cdb8d9e5b526e2333d93fffe4d0ffc5b29b9025387088f5b486393e5bf7c
+DIST fuse-exfat-1.1.0.tar.gz 36677 SHA256 198c520e417e955dc5c08687c278e63eefa56719da4452aa4a605be0327f953e SHA512 60280687c9adea3955fd85f003482e9d40163924837e5dcac4205c2bd02318c8ea280103a509213e83a04d390507f15dfe3cd3ecc03e9b90abcf4cef7e830398 WHIRLPOOL 86c029c13287b9b7b0b4d7798f7eef9dfad37bc05b5cbb836cd71539f78b0bcfeeffd7d2d35c3b4c55ca259b8ed1f0d6ea68bad23b3304c36775c20717b38a35
diff --git a/sys-fs/fuse-exfat/files/99-exfat.rules b/sys-fs/fuse-exfat/files/99-exfat.rules
new file mode 100644
index 000000000000..914e9d576f13
--- /dev/null
+++ b/sys-fs/fuse-exfat/files/99-exfat.rules
@@ -0,0 +1 @@
+ENV{ID_FS_TYPE}=="exfat", ENV{ID_FS_TYPE}="exfat-fuse"
diff --git a/sys-fs/fuse-exfat/fuse-exfat-1.0.1.ebuild b/sys-fs/fuse-exfat/fuse-exfat-1.0.1.ebuild
new file mode 100644
index 000000000000..67e41571bdc7
--- /dev/null
+++ b/sys-fs/fuse-exfat/fuse-exfat-1.0.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit scons-utils toolchain-funcs #udev
+
+DESCRIPTION="exFAT filesystem FUSE module"
+HOMEPAGE="http://code.google.com/p/exfat/"
+SRC_URI="http://exfat.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc64 ~s390 ~sh ~sparc x86 ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-fs/fuse"
+DEPEND=${RDEPEND}
+
+src_compile() {
+ tc-export AR CC RANLIB
+ escons CCFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ dosbin fuse/mount.exfat-fuse
+ dosym mount.exfat-fuse /usr/sbin/mount.exfat
+
+ doman */*.8
+ dodoc ChangeLog
+
+ #This shouldn't really be required. Comment it out for now.
+ #udev_dorules "${FILESDIR}"/99-exfat.rules
+}
+
+pkg_postinst() {
+ elog "You can emerge sys-fs/exfat-utils for dump, label, mkfs and fsck utilities."
+}
diff --git a/sys-fs/fuse-exfat/fuse-exfat-1.1.0.ebuild b/sys-fs/fuse-exfat/fuse-exfat-1.1.0.ebuild
new file mode 100644
index 000000000000..06bb9feafc95
--- /dev/null
+++ b/sys-fs/fuse-exfat/fuse-exfat-1.1.0.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit scons-utils toolchain-funcs
+
+DESCRIPTION="exFAT filesystem FUSE module"
+HOMEPAGE="http://code.google.com/p/exfat/"
+SRC_URI="http://docs.google.com/uc?export=download&id=0B7CLI-REKbE3VTdaa0EzTkhYdU0 -> ${P}.tar.gz"
+
+LICENSE="GPL-2+" # COPYING is GPL-2 but ChangeLog says "Relicensed the project from GPLv3+ to GPLv2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-fs/fuse"
+DEPEND=${RDEPEND}
+
+src_compile() {
+ tc-export AR CC RANLIB
+ escons CCFLAGS="${CFLAGS} -Wall -std=c99"
+}
+
+src_install() {
+ dosbin fuse/mount.exfat-fuse
+ dosym mount.exfat-fuse /usr/sbin/mount.exfat
+
+ doman */*.8
+ dodoc ChangeLog
+}
+
+pkg_postinst() {
+ elog "You can emerge sys-fs/exfat-utils for dump, label, mkfs and fsck utilities."
+}
diff --git a/sys-fs/fuse-exfat/metadata.xml b/sys-fs/fuse-exfat/metadata.xml
new file mode 100644
index 000000000000..7b05b18e4457
--- /dev/null
+++ b/sys-fs/fuse-exfat/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">exfat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fuse-zip/Manifest b/sys-fs/fuse-zip/Manifest
new file mode 100644
index 000000000000..c9134db552f4
--- /dev/null
+++ b/sys-fs/fuse-zip/Manifest
@@ -0,0 +1,4 @@
+DIST fuse-zip-0.2.12.tar.gz 181246 SHA256 c77b4e461dfe83acdb3d8cfbc6fe456592314756d20061864f51a389dfcc2c69
+DIST fuse-zip-0.2.13.tar.gz 185431 SHA256 e41c0746e3419db8f519fad7e819ef72ddb48ffca2de52773f038016aacd9804
+DIST fuse-zip-0.3.0.tar.gz 662401 SHA256 7b0960e40da4e98f40a12c26c032fee99f683bea59bede24653de2f139d08543 SHA512 170026a1fb80302c2319d46379db65686198cb162308fd5a2bffff9c047c176dfc8a8a4b94fc6d33d53ed7de6d65b39779c0e03d944e4284625a4140e521001f WHIRLPOOL 12da9e2e5954b47b0a16924f4358c33607a195c90f2a1373604390656e65730ccac7294cdb4032012361d037970cf35023a1136d6be52377b094f63d1e8a1349
+DIST fuse-zip-0.4.0.tar.gz 671498 SHA256 db9eb13aa250061eaa7df6b1ee5022dbea54089094af94cc3d1767b63bdc9ca7 SHA512 0224136a437884e7899522b80ae0e1e8c2601e31658ce7ac73bf9267f65ed629792db9c76054fe9ee007f7bc71167d785cc22659123c2b287fadb13a01c58ea8 WHIRLPOOL 031bd37c5fa331bb78e3736e6279358e93583dc5dae47905c603bec90d1754c189a2b1efb9978cb6b6b78fa99dcf5171760804ca5609e737730b7a06c5d67416
diff --git a/sys-fs/fuse-zip/files/fuse-zip-0.2.13-as-needed.patch b/sys-fs/fuse-zip/files/fuse-zip-0.2.13-as-needed.patch
new file mode 100644
index 000000000000..9394b7b36e41
--- /dev/null
+++ b/sys-fs/fuse-zip/files/fuse-zip-0.2.13-as-needed.patch
@@ -0,0 +1,11 @@
+Index: fuse-zip-0.2.13/Makefile
+===================================================================
+--- fuse-zip-0.2.13.orig/Makefile
++++ fuse-zip-0.2.13/Makefile
+@@ -1,5 +1,5 @@
+ DEST=fuse-zip
+-LIBS=$(shell pkg-config fuse --libs) $(shell pkg-config libzip --libs) -Llib -lfusezip
++LIBS=-lfusezip $(shell pkg-config fuse --libs) $(shell pkg-config libzip --libs) -Llib
+ LIB=lib/libfusezip.a
+ CXXFLAGS=-g -O2 -Wall -Wextra
+ RELEASE_CXXFLAGS=-O2 -Wall -Wextra
diff --git a/sys-fs/fuse-zip/files/libzip-fix-0.10.patch b/sys-fs/fuse-zip/files/libzip-fix-0.10.patch
new file mode 100644
index 000000000000..f2348e5f1bab
--- /dev/null
+++ b/sys-fs/fuse-zip/files/libzip-fix-0.10.patch
@@ -0,0 +1,24 @@
+diff -ru fuse-zip-0.2.13/lib/bigBuffer.cpp fuse-zip-0.2.13.new//lib/bigBuffer.cpp
+--- fuse-zip-0.2.13/lib/bigBuffer.cpp 2010-12-06 12:34:32.000000000 -0500
++++ fuse-zip-0.2.13.new//lib/bigBuffer.cpp 2011-09-28 21:40:01.294946957 -0400
+@@ -236,7 +236,7 @@
+ len = offset;
+ }
+
+-ssize_t BigBuffer::zipUserFunctionCallback(void *state, void *data, size_t len, enum zip_source_cmd cmd) {
++zip_int64_t BigBuffer::zipUserFunctionCallback(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) {
+ CallBackStruct *b = (CallBackStruct*)state;
+ switch (cmd) {
+ case ZIP_SOURCE_OPEN: {
+diff -ru fuse-zip-0.2.13/lib/bigBuffer.h fuse-zip-0.2.13.new//lib/bigBuffer.h
+--- fuse-zip-0.2.13/lib/bigBuffer.h 2010-12-06 12:34:32.000000000 -0500
++++ fuse-zip-0.2.13.new//lib/bigBuffer.h 2011-09-28 21:40:23.203719133 -0400
+@@ -52,7 +52,7 @@
+ * never called because read() always successfull.
+ * See zip_source_function(3) for details.
+ */
+- static ssize_t zipUserFunctionCallback(void *state, void *data, size_t len, enum zip_source_cmd cmd);
++ static zip_int64_t zipUserFunctionCallback(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd);
+
+ /**
+ * Return number of chunks needed to keep 'offset' bytes.
diff --git a/sys-fs/fuse-zip/fuse-zip-0.2.12.ebuild b/sys-fs/fuse-zip/fuse-zip-0.2.12.ebuild
new file mode 100644
index 000000000000..0c7f28c84088
--- /dev/null
+++ b/sys-fs/fuse-zip/fuse-zip-0.2.12.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+DESCRIPTION="FUSE file system to navigate, extract, create and modify ZIP archives based on libzip"
+HOMEPAGE="http://code.google.com/p/fuse-zip/"
+SRC_URI="http://fuse-zip.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/libzip
+ sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Fix strip than installing fuse-zip
+ sed -i -e 's/install -m 755 -s/install -m 755/' Makefile || die "sed failed"
+}
+
+src_install() {
+ emake INSTALLPREFIX="${D}"/usr install || die "Failed to install"
+ prepalldocs
+}
diff --git a/sys-fs/fuse-zip/fuse-zip-0.2.13.ebuild b/sys-fs/fuse-zip/fuse-zip-0.2.13.ebuild
new file mode 100644
index 000000000000..cebbb26336e0
--- /dev/null
+++ b/sys-fs/fuse-zip/fuse-zip-0.2.13.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="FUSE file system to navigate, extract, create and modify ZIP archives"
+HOMEPAGE="http://code.google.com/p/fuse-zip/"
+SRC_URI="http://fuse-zip.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/libzip
+ sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Fix strip than installing fuse-zip
+ sed -i -e 's/install -m 755 -s/install -m 755/' Makefile || die "sed failed"
+ # fix broken makefile
+ epatch "${FILESDIR}"/"${P}"-as-needed.patch
+ # fix building with libzip-0.10
+ epatch "${FILESDIR}"/libzip-fix-0.10.patch
+ #enable parallel build
+ sed -i -e "s:make :\$\(MAKE\) :" Makefile || die "sed failed"
+}
+
+src_compile() {
+ emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS} ${LDFLAGS}" || die
+}
+
+src_install() {
+ emake INSTALLPREFIX="${D}"/usr install || die "Failed to install"
+ prepalldocs
+}
diff --git a/sys-fs/fuse-zip/fuse-zip-0.3.0.ebuild b/sys-fs/fuse-zip/fuse-zip-0.3.0.ebuild
new file mode 100644
index 000000000000..0736b3c8a0e9
--- /dev/null
+++ b/sys-fs/fuse-zip/fuse-zip-0.3.0.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="FUSE file system to navigate, extract, create and modify ZIP archives"
+HOMEPAGE="http://code.google.com/p/fuse-zip/"
+SRC_URI="http://fuse-zip.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="dev-libs/libzip
+ sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Fix strip than installing fuse-zip
+ sed -i -e 's/install -m 755 -s/install -m 755/' Makefile || die "sed failed"
+ # fix broken makefile
+ epatch "${FILESDIR}"/"${PN}"-0.2.13-as-needed.patch
+ #enable parallel build
+ sed -i -e "s:make :\$\(MAKE\) :" Makefile || die "sed failed"
+}
+
+src_compile() {
+ emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS} ${LDFLAGS}"
+}
+
+src_install() {
+ emake INSTALLPREFIX="${D}"/usr install
+}
diff --git a/sys-fs/fuse-zip/fuse-zip-0.4.0.ebuild b/sys-fs/fuse-zip/fuse-zip-0.4.0.ebuild
new file mode 100644
index 000000000000..1fe3feecf280
--- /dev/null
+++ b/sys-fs/fuse-zip/fuse-zip-0.4.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="FUSE file system to navigate, extract, create and modify ZIP archives"
+HOMEPAGE="http://code.google.com/p/fuse-zip/"
+SRC_URI="http://fuse-zip.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=">=dev-libs/libzip-0.11.2:=
+ >=sys-fs/fuse-2.7:="
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Fix strip than installing fuse-zip
+ sed -i -e 's/install -m 755 -s/install -m 755/' Makefile || die "sed failed"
+ #enable parallel build
+ sed -i -e "s:make :\$\(MAKE\) :" Makefile || die "sed failed"
+}
+
+src_compile() {
+ emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS} ${LDFLAGS}"
+}
+
+src_install() {
+ emake INSTALLPREFIX="${D}"/usr install
+}
diff --git a/sys-fs/fuse-zip/metadata.xml b/sys-fs/fuse-zip/metadata.xml
new file mode 100644
index 000000000000..37f5c95810cb
--- /dev/null
+++ b/sys-fs/fuse-zip/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+ </longdescription>
+ <upstream>
+ <remote-id type="google-code">fuse-zip</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fuse/Manifest b/sys-fs/fuse/Manifest
new file mode 100644
index 000000000000..c4459b97fdc9
--- /dev/null
+++ b/sys-fs/fuse/Manifest
@@ -0,0 +1,2 @@
+DIST fuse-2.9.3.tar.gz 572044 SHA256 0beb83eaf2c5e50730fc553406ef124d77bc02c64854631bdfc86bfd6437391c SHA512 03f43f88694ec7e039ff3579a8e76349b5a5a05872c55901fc1d9ee53dbb6b1e69f6dd0005b620f3b5ead0b14da8eeb31d46b922d10f88f4e3f830aa47e8162c WHIRLPOOL 739562e48e85326049dac0ef06653e5e6574a01dd60649e23ddc0990ea6c1979e6ce952a1e84d0776b706fbcad79eb0e1328aa35f70ba4881db9a4482d254a04
+DIST fuse-2.9.4.tar.gz 577282 SHA256 6be9c0bff6af8c677414935f31699ea5a7f8f5f791cfa5205be02ea186b97ce1 SHA512 055ec2a78793276102bc5a0afea9eebd18b151cf752d0985380ffbde1c554e9fb7bc3a43838618e3957b274aa06624303ea12f32c659365c4768dad887bb557d WHIRLPOOL 6c866ba05be5a56e1b1d8793378c0c5c683375e9baad6de22344adaf5bb35021182b15783f59911259f98cb914ef4a1cb70be0cb9b5cd6625173b3b6454c32d7
diff --git a/sys-fs/fuse/files/fuse-2.9.3-kernel-types.patch b/sys-fs/fuse/files/fuse-2.9.3-kernel-types.patch
new file mode 100644
index 000000000000..5065392f09ec
--- /dev/null
+++ b/sys-fs/fuse/files/fuse-2.9.3-kernel-types.patch
@@ -0,0 +1,19 @@
+this is a minimal version of:
+http://sourceforge.net/p/fuse/fuse/ci/6b02a7082ae4c560427ff95b51aa8930bb4a6e1f/
+
+--- a/include/fuse_kernel.h
++++ b/include/fuse_kernel.h
+@@ -88,12 +88,7 @@
+ #ifndef _LINUX_FUSE_H
+ #define _LINUX_FUSE_H
+
+-#include <sys/types.h>
+-#define __u64 uint64_t
+-#define __s64 int64_t
+-#define __u32 uint32_t
+-#define __s32 int32_t
+-#define __u16 uint16_t
++#include <linux/types.h>
+
+ /*
+ * Version negotiation:
diff --git a/sys-fs/fuse/files/fuse-fbsd.init b/sys-fs/fuse/files/fuse-fbsd.init
new file mode 100644
index 000000000000..19b8400eb51d
--- /dev/null
+++ b/sys-fs/fuse/files/fuse-fbsd.init
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need localmount
+}
+
+start() {
+ ebegin "Starting fuse"
+ if ! kldstat -q -m fuse; then
+ kldload fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module"
+ fi
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping fuse"
+ if kldstat -q -m fuse; then
+ kldunload fuse >/dev/null 2>&1 || eerror $? "Error unloading fuse module"
+ fi
+ eend ${?}
+}
diff --git a/sys-fs/fuse/files/fuse.init b/sys-fs/fuse/files/fuse.init
new file mode 100644
index 000000000000..30b512e8dc66
--- /dev/null
+++ b/sys-fs/fuse/files/fuse.init
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MOUNTPOINT=/sys/fs/fuse/connections
+
+depend() {
+ need localmount
+}
+
+start() {
+
+ ebegin "Starting fuse"
+ if ! grep -qw fuse /proc/filesystems; then
+ modprobe fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module"
+ fi
+ if grep -qw fusectl /proc/filesystems && \
+ ! grep -qw $MOUNTPOINT /proc/mounts; then
+ mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \
+ eerror $? "Error mounting control filesystem"
+ fi
+ eend ${?}
+
+}
+
+stop() {
+
+ ebegin "Stopping fuse"
+ if grep -qw $MOUNTPOINT /proc/mounts; then
+ umount $MOUNTPOINT >/dev/null 2>&1 || \
+ eerror $? "Error unmounting control filesystem"
+ fi
+ eend ${?}
+
+}
diff --git a/sys-fs/fuse/fuse-2.9.3.ebuild b/sys-fs/fuse/fuse-2.9.3.ebuild
new file mode 100644
index 000000000000..79a7b7daecb4
--- /dev/null
+++ b/sys-fs/fuse/fuse-2.9.3.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils libtool linux-info udev toolchain-funcs
+
+MY_P=${P/_/-}
+DESCRIPTION="An interface for filesystems implemented in userspace"
+HOMEPAGE="http://fuse.sourceforge.net"
+SRC_URI="mirror://sourceforge/fuse/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="examples kernel_linux kernel_FreeBSD static-libs"
+
+PDEPEND="kernel_FreeBSD? ( sys-fs/fuse4bsd )"
+DEPEND="virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ if use kernel_linux ; then
+ if kernel_is lt 2 6 9 ; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use user-mode utils"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-kernel-types.patch
+ # sandbox violation with mtab writability wrt #438250
+ # don't sed configure.in without eautoreconf because of maintainer mode
+ sed -i 's:umount --fake:true --fake:' configure || die
+ elibtoolize
+}
+
+src_configure() {
+ econf \
+ INIT_D_PATH="${EPREFIX}/etc/init.d" \
+ MOUNT_FUSE_PATH="${EPREFIX}/sbin" \
+ UDEV_RULES_PATH="${EPREFIX}/$(get_udevdir)/rules.d" \
+ $(use_enable static-libs static) \
+ --disable-example
+}
+
+src_install() {
+ default
+
+ dodoc AUTHORS ChangeLog Filesystems README \
+ README.NFS NEWS doc/how-fuse-works \
+ doc/kernel.txt FAQ
+
+ if use examples ; then
+ docinto examples
+ dodoc example/*
+ fi
+
+ if use kernel_linux ; then
+ newinitd "${FILESDIR}"/fuse.init fuse
+ elif use kernel_FreeBSD ; then
+ insinto /usr/include/fuse
+ doins include/fuse_kernel.h
+ newinitd "${FILESDIR}"/fuse-fbsd.init fuse
+ else
+ die "We don't know what init code install for your kernel, please file a bug."
+ fi
+
+ prune_libtool_files
+ rm -rf "${D}"/dev
+
+ dodir /etc
+ cat > "${ED}"/etc/fuse.conf <<-EOF
+ # Set the maximum number of FUSE mounts allowed to non-root users.
+ # The default is 1000.
+ #
+ #mount_max = 1000
+
+ # Allow non-root users to specify the 'allow_other' or 'allow_root'
+ # mount options.
+ #
+ #user_allow_other
+ EOF
+}
diff --git a/sys-fs/fuse/fuse-2.9.4.ebuild b/sys-fs/fuse/fuse-2.9.4.ebuild
new file mode 100644
index 000000000000..1c493a96384d
--- /dev/null
+++ b/sys-fs/fuse/fuse-2.9.4.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils libtool linux-info udev toolchain-funcs
+
+MY_P=${P/_/-}
+DESCRIPTION="An interface for filesystems implemented in userspace"
+HOMEPAGE="http://fuse.sourceforge.net"
+SRC_URI="mirror://sourceforge/fuse/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="examples kernel_linux kernel_FreeBSD static-libs"
+
+PDEPEND="kernel_FreeBSD? ( sys-fs/fuse4bsd )"
+DEPEND="virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ if use kernel_linux ; then
+ if kernel_is lt 2 6 9 ; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use user-mode utils"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.9.3-kernel-types.patch
+ # sandbox violation with mtab writability wrt #438250
+ # don't sed configure.in without eautoreconf because of maintainer mode
+ sed -i 's:umount --fake:true --fake:' configure || die
+ elibtoolize
+}
+
+src_configure() {
+ econf \
+ INIT_D_PATH="${EPREFIX}/etc/init.d" \
+ MOUNT_FUSE_PATH="${EPREFIX}/sbin" \
+ UDEV_RULES_PATH="${EPREFIX}/$(get_udevdir)/rules.d" \
+ $(use_enable static-libs static) \
+ --disable-example
+}
+
+src_install() {
+ default
+
+ dodoc AUTHORS ChangeLog Filesystems README \
+ README.NFS NEWS doc/how-fuse-works \
+ doc/kernel.txt FAQ
+
+ if use examples ; then
+ docinto examples
+ dodoc example/*
+ fi
+
+ if use kernel_linux ; then
+ newinitd "${FILESDIR}"/fuse.init fuse
+ elif use kernel_FreeBSD ; then
+ insinto /usr/include/fuse
+ doins include/fuse_kernel.h
+ newinitd "${FILESDIR}"/fuse-fbsd.init fuse
+ else
+ die "We don't know what init code install for your kernel, please file a bug."
+ fi
+
+ prune_libtool_files
+ rm -rf "${D}"/dev
+
+ dodir /etc
+ cat > "${ED}"/etc/fuse.conf <<-EOF
+ # Set the maximum number of FUSE mounts allowed to non-root users.
+ # The default is 1000.
+ #
+ #mount_max = 1000
+
+ # Allow non-root users to specify the 'allow_other' or 'allow_root'
+ # mount options.
+ #
+ #user_allow_other
+ EOF
+}
diff --git a/sys-fs/fuse/metadata.xml b/sys-fs/fuse/metadata.xml
new file mode 100644
index 000000000000..be948520b186
--- /dev/null
+++ b/sys-fs/fuse/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:fuse:fuse</remote-id>
+ <remote-id type="sourceforge">fuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fuse4bsd/Manifest b/sys-fs/fuse4bsd/Manifest
new file mode 100644
index 000000000000..3d931909aa31
--- /dev/null
+++ b/sys-fs/fuse4bsd/Manifest
@@ -0,0 +1,4 @@
+DIST 498acaef33b0.tar.gz 116035 SHA256 3fff52dc292f481b4c51cad3e9cf5f8982e38a25e809ee986e8406c81aff0119 SHA512 6427d888cea5b1519c4ae92ec8ec640535692c59dd8ca987a32574050239c9ff4cb92a4cf6b34f3c1363becdd9fd75c031f5db4bda34b298898466066740845a WHIRLPOOL 4f78cb0228a73e76e15e6d85c2db94e1eaf75eb10507e533bb51c4a52092fc9c881187f10aca12bc89b791058790f9a84e139698e0e64ee602fe5efb3c03b82a
+DIST freebsd-sbin-6.2.tar.bz2 1162548 SHA256 aef424c07686bb72fbd06e4fd66a01b00bd36b70fec02ebdc228061cd4b435dd
+DIST freebsd-sbin-9.1.tar.bz2 1273913 SHA256 45008b0733b232ef03707ef5fa3e5c889e3b3728393d736bd9a869ea83be6447 SHA512 9f186602b7de96f268c352ca386986652fddf5570e7eca1afa8c0d2bdc83b57df1198efe47f36dd5c7a6abf4f9c935f1c8207a4a12a6b2153bd6c3c6292719dc WHIRLPOOL 20920dfa9607a0ce854319cef29bbd77fb1b31f6f6cfd5ac60cbd678169e43929e215743fe636d0c224443f3e6149a8f07c292d647f7f901592795ac292699f9
+DIST fuse4bsd-0.3.0.tar.gz 168068 SHA256 5ed1d9b0542d6962c135f6f2e8d296ab3feb51f239954cc6acc50833318854fe
diff --git a/sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-gcc4.patch b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-gcc4.patch
new file mode 100644
index 000000000000..ca1158e9fc1f
--- /dev/null
+++ b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-gcc4.patch
@@ -0,0 +1,12 @@
+diff -ur fuse4bsd-0.3.0.old/fuse_module/fuse.c fuse4bsd-0.3.0/fuse_module/fuse.c
+--- fuse4bsd-0.3.0.old/fuse_module/fuse.c 2006-11-05 14:32:44.000000000 +0100
++++ fuse4bsd-0.3.0/fuse_module/fuse.c 2006-11-05 14:33:43.000000000 +0100
+@@ -5971,7 +5971,7 @@
+ extern struct cdevsw fmaster_cdevsw[5];
+ static struct cdev *fmaster_dev[5];
+ #endif
+-extern struct vfsconf fuse_vfsconf;
++static struct vfsconf fuse_vfsconf;
+
+
+ static void
diff --git a/sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-ports.patch b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-ports.patch
new file mode 100644
index 000000000000..a2c349919298
--- /dev/null
+++ b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.0-ports.patch
@@ -0,0 +1,491 @@
+--- fuse_module/fmaster.c Mon Jun 19 22:10:26 2006 +0200
++++ fuse_module/fmaster.c Mon Jun 19 22:23:08 2006 +0200
+@@ -506,22 +506,22 @@ fuse_response_prettyprint(enum fuse_opco
+ case FUSE_FSYNCDIR:
+ //pp_buf(fresp);
+ break;
+-#if FUSE_HAS_GETLK
++#ifdef FUSE_HAS_GETLK
+ case FUSE_GETLK:
+ panic("FUSE_GETLK implementor has forgotten to define a response body format check");
+ break;
+ #endif
+-#if FUSE_HAS_SETLK
++#ifdef FUSE_HAS_SETLK
+ case FUSE_SETLK:
+ panic("FUSE_SETLK implementor has forgotten to define a response body format check");
+ break;
+ #endif
+-#if FUSE_HAS_SETLKW
++#ifdef FUSE_HAS_SETLKW
+ case FUSE_SETLKW:
+ panic("FUSE_SETLKW implementor has forgotten to define a response body format check");
+ break;
+ #endif
+-#if FUSE_HAS_ACCESS
++#ifdef FUSE_HAS_ACCESS
+ case FUSE_ACCESS:
+ break;
+ #endif--- fuse_module/fuse.c.orig Wed Sep 27 15:49:47 2006
++++ fuse_module/fuse.c Wed Sep 27 15:52:02 2006
+@@ -75,7 +75,7 @@
+ };
+
+
+-#if USE_OLD_CLONEHANDLER_API
++#ifdef USE_OLD_CLONEHANDLER_API
+ static void fusedev_clone(void *arg, char *name, int namelen, struct cdev **dev);
+ #else
+ static void fusedev_clone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev);
+@@ -120,7 +120,7 @@
+ __static void fuse_insert_message(struct fuse_ticket *tick);
+ __static fuse_handler_t fuse_standard_handler;
+ static fuse_handler_t fuse_fsync_handler;
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static fuse_handler_t fuse_forgetful_handler;
+ #endif
+
+@@ -852,27 +852,27 @@
+ case FUSE_FSYNCDIR:
+ err = blen == 0 ? 0 : EINVAL;
+ break;
+-#if FUSE_HAS_GETLK
++#ifdef FUSE_HAS_GETLK
+ case FUSE_GETLK:
+ panic("FUSE_GETLK implementor has forgotten to define a response body format check");
+ break;
+ #endif
+-#if FUSE_HAS_SETLK
++#ifdef FUSE_HAS_SETLK
+ case FUSE_SETLK:
+ panic("FUSE_SETLK implementor has forgotten to define a response body format check");
+ break;
+ #endif
+-#if FUSE_HAS_SETLKW
++#ifdef FUSE_HAS_SETLKW
+ case FUSE_SETLKW:
+ panic("FUSE_SETLKW implementor has forgotten to define a response body format check");
+ break;
+ #endif
+-#if FUSE_HAS_ACCESS
++#ifdef FUSE_HAS_ACCESS
+ case FUSE_ACCESS:
+ err = blen == 0 ? 0 : EINVAL;
+ break;
+ #endif
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ case FUSE_CREATE:
+ err = blen == sizeof(struct fuse_entry_out) + sizeof(struct fuse_open_out) ? 0 : EINVAL;
+ break;
+@@ -881,7 +881,7 @@
+ panic("fuse opcodes out of sync");
+ }
+
+-#if _DEBUG2G
++#ifdef _DEBUG2G
+ if (err)
+ DEBUG2G("op %s (#%d) with body size %d: invalid body size\n",
+ (0 <= opcode && opcode <= fuse_opnames_entries) ? fuse_opnames[opcode] : "???",
+@@ -904,7 +904,7 @@
+ uint64_t nid, enum fuse_opcode op, size_t blen,
+ struct thread* td, struct ucred *cred)
+ {
+- ihead->len = sizeof(ihead) + blen; /* actually not used by lib */
++ ihead->len = sizeof(*ihead) + blen; /* actually not used by lib */
+ ihead->unique = tick->unique;
+ ihead->nodeid = nid;
+ ihead->opcode = op;
+@@ -988,7 +988,7 @@
+ return (0);
+ }
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static int
+ fuse_forgetful_handler(struct fuse_callback_node *caliban, struct uio *uio)
+ {
+@@ -1242,7 +1242,7 @@
+ static int
+ fusedev_write(struct cdev *dev, struct uio *uio, int ioflag)
+ {
+-#if _DEBUG_MSGING
++#ifdef _DEBUG_MSGING
+ static int counter=0;
+ #endif
+ struct fuse_out_header *ohead;
+@@ -1415,7 +1415,7 @@
+ if ((err = fuse_callbn_wait_answer(&fdip->tick->callbn))) {
+ /* Uh-huh, we got interrupted... */
+
+-#if ! DONT_TRY_HARD_PREVENT_IO_IN_VAIN
++#ifndef DONT_TRY_HARD_PREVENT_IO_IN_VAIN
+ struct fuse_callback_node *fcallbn;
+ unsigned age;
+ #endif
+@@ -1438,7 +1438,7 @@
+ age = fdip->tick->age;
+ fuse_callbn_set_answered(&fdip->tick->callbn);
+ mtx_unlock(&fdip->tick->callbn.answer_mtx);
+-#if ! DONT_TRY_HARD_PREVENT_IO_IN_VAIN
++#ifndef DONT_TRY_HARD_PREVENT_IO_IN_VAIN
+ /*
+ * If we are willing to pay with one more locking, we
+ * can save on I/O by getting the device write handler
+@@ -1662,7 +1662,7 @@
+ /* static vop_pathconf_t fuse_pathconf; */
+ static vfs_hash_cmp_t fuse_vnode_cmp;
+ static vfs_hash_cmp_t fuse_vnode_bgdrop_cmp;
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static vfs_hash_cmp_t fuse_vnode_fgdrop_cmp;
+ #endif
+ /* static vfs_vget_t fuse_vget; */
+@@ -1683,7 +1683,7 @@
+ static vop_lookup_t fuse_lookup;
+ static int iterate_filehandles(struct vnode *vp, struct thread *td, struct ucred *cred, fuse_metrics_t fmetr, void *param);
+ static fuse_metrics_t fuse_standard_metrics;
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static __inline int create_filehandle(struct vnode *vp, struct thread *td, struct ucred *cred, int mode, struct fuse_dispatcher *fdip);
+ #endif
+ static struct fuse_filehandle *get_filehandle(struct vnode *vp, struct thread *td, struct ucred *cred, int mode, struct get_filehandle_param *gefhp);
+@@ -1729,7 +1729,7 @@
+
+ static b_strategy_t fuse_bufstrategy;
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static vop_access_t fuse_germ_access;
+ #endif
+
+@@ -1773,7 +1773,7 @@
+ .vop_unlock = fuse_unlock,
+ };
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static struct vop_vector fuse_germ_vnops;
+ #endif
+
+@@ -2092,7 +2092,7 @@
+
+ if (! (fmnt->mntopts & FUSEFS_SECONDARY)) {
+ data->mp = mp;
+-#if ! REALTIME_TRACK_UNPRIVPROCDBG
++#ifndef REALTIME_TRACK_UNPRIVPROCDBG
+ fmnt->mntopts &= ~FUSEFS_UNPRIVPROCDBG;
+ fmnt->mntopts |= get_unprivileged_proc_debug(td) ? FUSEFS_UNPRIVPROCDBG : 0;
+ #endif
+@@ -2380,7 +2380,7 @@
+ return (0);
+ }
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ /*
+ * Vnode comparison function with which the given vnode always
+ * gets inserted, but got marked invalid upon a clash. Caller
+@@ -2654,7 +2654,7 @@
+
+ fuse_filehandle_gc(vp, td, NULL);
+
+-#if ! DONT_STORE_FS_MAP
++#ifndef DONT_STORE_FS_MAP
+ /*
+ * Dropping vnodes when they are not in use would mean that
+ * the respective inode must be freed on the daemon's side
+@@ -2751,7 +2751,7 @@
+ int denied;
+
+ if ((denied = cr_candebug(
+-#if REALTIME_TRACK_UNPRIVPROCDBG
++#ifdef REALTIME_TRACK_UNPRIVPROCDBG
+ get_unprivileged_proc_debug(td),
+ #else
+ fmnt->mntopts & FUSEFS_UNPRIVPROCDBG,
+@@ -2948,7 +2948,7 @@
+
+ } else {
+ struct sx *devlock = fdi.slock;
+-#if FUSE_HAS_ACCESS
++#ifdef FUSE_HAS_ACCESS
+ struct fuse_access_in *fai;
+
+ if (! (facp->facc_flags & FACCESS_DO_ACCESS))
+@@ -3056,7 +3056,7 @@
+
+ bzero(&facp, sizeof(facp));
+ if (
+-#if NO_EARLY_PERM_CHECK_HACK
++#ifdef NO_EARLY_PERM_CHECK_HACK
+ 1
+ #else
+ dvp->v_vflag & VV_ROOT
+@@ -3281,8 +3281,12 @@
+ DEBUG("we peacefully found that file\n");
+
+ if (flags & ISDOTDOT) {
+- vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
++ VOP_UNLOCK(dvp, 0, td);
++ err = vn_lock(pdp, cnp->cn_lkflags, td);
+ VREF(pdp);
++ vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
++ if (err)
++ goto out;
+ *vpp = pdp;
+ } else if (nid == VTOI(dvp)) {
+ VREF(dvp); /* We want ourself, ie "." */
+@@ -3347,7 +3351,7 @@
+ if (islastcn && flags & ISOPEN)
+ ((struct fuse_vnode_data *)(*vpp)->v_data)->flags |= FVP_ACCESS_NOOP;
+
+-#if ! NO_EARLY_PERM_CHECK_HACK
++#ifndef NO_EARLY_PERM_CHECK_HACK
+ if (! islastcn) {
+ /* We have the attributes of the next item
+ * *now*, and it's a fact, and we do not have
+@@ -3486,7 +3490,7 @@
+ return (0);
+ }
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static __inline int
+ create_filehandle(struct vnode *vp, struct thread *td, struct ucred *cred,
+ int mode, struct fuse_dispatcher *fdip)
+@@ -3643,7 +3647,7 @@
+ * the vnode... if the vnode is a germ, it will be tried to be initialized
+ * via a dedicated method, but from that on we go on as usual.)
+ */
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ if (vp->v_op == &fuse_germ_vnops) {
+ KASSERT(gefhp, ("create_filehandle called without get_filehandle_param"));
+ gone_create = 1;
+@@ -3709,7 +3713,7 @@
+ if ((err = fdisp_wait_answ(&fdi)))
+ goto out;
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ setup_filehandle:
+ #endif
+ foo = fdi.answ;
+@@ -4184,7 +4188,7 @@
+ #define BSD_FUSE_PAGENO_BOUND MIN(FUSE_MAX_PAGES_PER_REQ, MAXBSIZE / PAGE_SIZE)
+
+ bcount = MIN(MAXBSIZE, biosize * BSD_FUSE_PAGENO_BOUND);
+-#if BIOREAD_CONSIDER_FILE_SIZE
++#ifdef BIOREAD_CONSIDER_FILE_SIZE
+ if (vp->v_type != VDIR) {
+ /*
+ * for directories we can't predict the size, in fact
+@@ -4493,7 +4497,7 @@
+ break;
+ }
+
+-#if ZERO_PAD_INCOMPLETE_BUFS
++#ifdef ZERO_PAD_INCOMPLETE_BUFS
+ if (isbzero(buf), FUSE_NAME_OFFSET) {
+ err = -1;
+ break;
+@@ -4658,7 +4662,7 @@
+ struct vnode *dvp = ap->a_dvp;
+ struct vnode **vpp = ap->a_vpp;
+ struct vattr *vap = ap->a_vap;
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ struct fuse_dispatcher fdi;
+ struct fuse_vnode_data *fvdat;
+ int err;
+@@ -4949,7 +4953,7 @@
+ if (err)
+ goto out;
+
+-#if ! DONT_DO_CHECKPATH
++#ifndef DONT_DO_CHECKPATH
+ if (doingdirectory && fdvp != tdvp) {
+ /*
+ * Check for pathname conflict.
+@@ -5396,7 +5400,6 @@
+ struct vnode *vp = fioda->vp;
+ struct uio *uio = fioda->uio;
+ struct ucred *cred = fioda->cred;
+- struct fuse_filehandle *fufh = fioda->fufh;
+
+ int biosize;
+
+@@ -5506,7 +5509,7 @@
+ if ((bp->b_flags & B_CACHE) == 0) {
+ bp->b_iocmd = BIO_READ;
+ vfs_busy_pages(bp, 0);
+- fuse_strategy_i(vp, bp, fufh, 0);
++ fuse_strategy_i(vp, bp, NULL, 0);
+ if ((err = bp->b_error)) {
+ brelse(bp);
+ break;
+@@ -5741,7 +5744,7 @@
+ chunksize, (long long unsigned)fri->offset, respsize);
+
+ if (respsize < chunksize) {
+-#if ZERO_PAD_INCOMPLETE_BUFS
++#ifdef ZERO_PAD_INCOMPLETE_BUFS
+ /*
+ * "if we don't get enough data, just fill the
+ * rest with zeros."
+@@ -5888,7 +5891,7 @@
+ "vp=%p, rc=%d", bp, vp, rc));
+ }
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ static int
+ fuse_germ_access(struct vop_access_args *ap)
+ {
+@@ -5908,7 +5911,7 @@
+
+ /* Modeled after tunclone() of net/if_tun.c
+ */
+-#if USE_OLD_CLONEHANDLER_API
++#ifdef USE_OLD_CLONEHANDLER_API
+ static void
+ fusedev_clone(void *arg, char *name, int namelen, struct cdev **dev)
+ #else
+@@ -6019,7 +6022,7 @@
+ fuse_fileops.fo_close = fuse_close_f;
+ fuse_fileops.fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE;
+
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ memcpy(&fuse_germ_vnops, &dead_vnodeops, sizeof(struct vop_vector));
+ fuse_germ_vnops.vop_access = fuse_germ_access;
+ fuse_germ_vnops.vop_open = fuse_open;
+--- fuse_module/fuse.h.orig Fri Feb 10 17:31:53 2006
++++ fuse_module/fuse.h Sun Jul 16 14:43:20 2006
+@@ -8,7 +8,7 @@
+
+ #ifndef USE_OLD_CLONEHANDLER_API
+ #if __FreeBSD_version < 600034 || ( __FreeBSD_version >= 700000 && __FreeBSD_version < 700002 )
+-#define USE_OLD_CLONEHANDLER_API 1
++#define USE_OLD_CLONEHANDLER_API
+ #endif
+ #endif
+
+@@ -19,10 +19,10 @@
+ */
+ #if FUSE_KERNELABI_GEQ(7, 3)
+ #ifndef FUSE_HAS_ACCESS
+-#define FUSE_HAS_ACCESS 1
++#define FUSE_HAS_ACCESS
+ #endif
+ #ifndef FUSE_HAS_CREATE
+-#define FUSE_HAS_CREATE 1
++#define FUSE_HAS_CREATE
+ #endif
+ #endif
+
+@@ -75,7 +75,7 @@
+ size_t len; /* To keep track of size of the data pushed into base, =< len, of course */
+ };
+
+-#if ! FUSE_AUX
++#ifndef FUSE_AUX
+ #ifndef FUSE_MAX_STORED_FREE_TICKETS
+ #define FUSE_MAX_STORED_FREE_TICKETS 0
+ #endif
+@@ -251,7 +251,7 @@
+ int flags;
+ LIST_HEAD(, fuse_filehandle) fh_head;
+ int fh_counter;
+-#if FUSE_HAS_CREATE
++#ifdef FUSE_HAS_CREATE
+ struct componentname *germcnp;
+ #endif
+ };
+@@ -260,6 +260,9 @@
+
+ /* Debug related stuff */
+
++#ifndef DEBUGTOLOG
++#define DEBUGTOLOG 0
++#endif
+ #if DEBUGTOLOG
+ #define dprintf(args ...) log(LOG_DEBUG, args)
+ #else
+@@ -267,6 +270,9 @@
+ #endif
+
+ #define DEBLABEL "[fuse-debug] "
++#ifndef _DEBUG
++#define _DEBUG 0
++#endif
+ #if _DEBUG
+ #ifndef _DEBUG2G
+ #define _DEBUG2G 1
+@@ -280,6 +286,9 @@
+ #define DEBUG(args ...)
+ #endif
+
++#ifndef _DEBUG2G
++#define _DEBUG2G 0
++#endif
+ #if _DEBUG2G
+ #ifndef _DEBUG3G
+ #define _DEBUG3G 1
+@@ -290,6 +299,9 @@
+ #define DEBUG2G(args ...)
+ #endif
+
++#ifndef _DEBUG3G
++#define _DEBUG3G 0
++#endif
+ #if _DEBUG3G
+ #define DEBUG3G(args, ...) \
+ printf(DEBLABEL "%s:%d: " args, __func__, __LINE__, ## __VA_ARGS__)
+@@ -297,13 +309,19 @@
+ #define DEBUG3G(args ...)
+ #endif
+
++#ifndef FMASTER
++#define FMASTER 0
++#endif
+ #if FMASTER
+ #ifndef _DEBUG_MSGING
+ #define _DEBUG_MSGING 1
+ #endif
+ #endif
+
+-#if _DEBUG_MSGING
++#ifndef _DEBUG_MSG
++#define _DEBUG_MSG 0
++#endif
++#ifdef _DEBUG_MSGING
+ #define fuprintf(args...) \
+ uprintf("[kern] " args)
+ #else
+@@ -319,7 +337,7 @@
+ void fprettyprint(struct fuse_iov *fiov, size_t dlen);
+ #endif
+
+-#if IGNORE_INLINE
++#ifdef IGNORE_INLINE
+ #define __inline
+ #endif
+
+--- fuse_module/fuse_subr.c.orig Fri Feb 10 17:31:53 2006
++++ fuse_module/fuse_subr.c Wed Sep 27 11:57:01 2006
+@@ -15,9 +15,11 @@
+ {
+ int err;
+ int unprivileged_proc_debug;
++ size_t ilen = sizeof(unprivileged_proc_debug);
+
+ err = kernel_sysctlbyname(td, "security.bsd.unprivileged_proc_debug",
+- NULL, 0, &unprivileged_proc_debug, sizeof(unprivileged_proc_debug), NULL, 0);
++ &unprivileged_proc_debug, &ilen,
++ NULL, 0, NULL, 0);
+
+ if (err)
+ unprivileged_proc_debug = 0;
diff --git a/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch
new file mode 100644
index 000000000000..cc3ea70ec7af
--- /dev/null
+++ b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-fbsd91.patch
@@ -0,0 +1,15 @@
+Taken from FreeBSD ports
+
+extra-patch-fuse_module__fuse_vnops.c
+
+--- fuse_module/fuse_vfsops.c.orig 2008-02-05 07:25:57.000000000 +0200
++++ fuse_module/fuse_vfsops.c 2011-09-08 10:27:43.000000000 +0300
+@@ -224,7 +231,7 @@
+ struct cdev *fdev;
+ struct sx *slock;
+ struct fuse_data *data;
+- int mntopts = 0, __mntopts = 0, max_read_set = 0, secondary = 0;
++ uint64_t mntopts = 0, __mntopts = 0, max_read_set = 0, secondary = 0;
+ unsigned max_read = ~0;
+ struct vnode *rvp;
+ struct fuse_vnode_data *fvdat;
diff --git a/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch
new file mode 100644
index 000000000000..cf4cf4441196
--- /dev/null
+++ b/sys-fs/fuse4bsd/files/fuse4bsd-0.3.9_pre1-ports.patch
@@ -0,0 +1,475 @@
+Taken from FreeBSD Ports
+
+cat sysutils/fusefs-kmod/files/patch-* > fuse4bsd-0.3.9_pre20080208-ports.patch
+
+
+--- fuse_module/Makefile.orig 2008-02-05 08:25:57.000000000 +0300
++++ fuse_module/Makefile 2009-01-14 00:29:13.000000000 +0300
+@@ -1,3 +1,5 @@
++.undef KERNCONF
++
+ .include "../Makefile.common"
+
+ SRCS = fuse_main.c \
+@@ -22,7 +24,8 @@
+
+ .if defined(KERNCONF)
+ KERNCONF1!= echo ${KERNCONF} | sed -e 's/ .*//g'
+-KERNCONFDIR= /usr/obj/usr/src/sys/${KERNCONF1}
++KRNLOBJDIR!= make -C /usr/src -f /usr/src/Makefile.inc1 -V KRNLOBJDIR
++KERNCONFDIR= ${KRNLOBJDIR}/${KERNCONF1}
+ .endif
+
+ .if defined(KERNCONFDIR)
+--- fuse_module/fuse.h.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse.h 2009-05-13 18:40:19.000000000 -0400
+@@ -25,6 +25,22 @@
+ #endif
+ #endif
+
++#ifndef VFSOPS_TAKES_THREAD
++#if __FreeBSD_version >= 800087
++#define VFSOPS_TAKES_THREAD 0
++#else
++#define VFSOPS_TAKES_THREAD 1
++#endif
++#endif
++
++#ifndef VOP_ACCESS_TAKES_ACCMODE_T
++#if __FreeBSD_version >= 800052
++#define VOP_ACCESS_TAKES_ACCMODE_T 1
++#else
++#define VOP_ACCESS_TAKES_ACCMODE_T 0
++#endif
++#endif
++
+ #ifndef VOP_OPEN_TAKES_FP
+ #if __FreeBSD_version >= 700044
+ #define VOP_OPEN_TAKES_FP 1
+@@ -49,6 +65,14 @@
+ #endif
+ #endif
+
++#ifndef VOP_GETATTR_TAKES_THREAD
++#if __FreeBSD_version >= 800046
++#define VOP_GETATTR_TAKES_THREAD 0
++#else
++#define VOP_GETATTR_TAKES_THREAD 1
++#endif
++#endif
++
+ #ifndef USE_PRIVILEGE_API
+ /*
+ * __FreeBSD_version bump was omitted for introduction of
+--- fuse_module/fuse_dev.c
++++ fuse_module/fuse_dev.c
+@@ -52,8 +52,13 @@
+ .d_read = fusedev_read,
+ .d_write = fusedev_write,
+ .d_version = D_VERSION,
++#ifndef D_NEEDMINOR
++#define D_NEEDMINOR 0
++#endif
+ #if ! DO_GIANT_MANUALLY
+- .d_flags = D_NEEDGIANT,
++ .d_flags = D_NEEDMINOR|D_NEEDGIANT,
++#else
++ .d_flags = D_NEEDMINOR,
+ #endif
+ };
+
+@@ -548,7 +553,12 @@
+ /* find any existing device, or allocate new unit number */
+ i = clone_create(&fuseclones, &fuse_cdevsw, &unit, dev, 0);
+ if (i) {
+- *dev = make_dev(&fuse_cdevsw, unit2minor(unit),
++ *dev = make_dev(&fuse_cdevsw,
++#if __FreeBSD_version < 800062
++ unit2minor(unit),
++#else /* __FreeBSD_version >= 800062 */
++ unit,
++#endif /* __FreeBSD_version < 800062 */
+ UID_ROOT, GID_OPERATOR,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP,
+ "fuse%d", unit);
+--- fuse_module/fuse_io.c.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse_io.c 2009-07-13 09:31:24.000000000 -0400
+@@ -35,6 +35,10 @@
+ #include <vm/vnode_pager.h>
+ #include <vm/vm_object.h>
+
++#if (__FreeBSD_version >= 800000)
++#define vfs_bio_set_validclean vfs_bio_set_valid
++#endif
++
+ #include "fuse.h"
+ #include "fuse_session.h"
+ #include "fuse_vnode.h"
+@@ -157,7 +161,11 @@
+ goto out;
+
+ if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) {
+- if ((err = VOP_GETATTR(vp, &va, cred, td)))
++ if ((err = VOP_GETATTR(vp, &va, cred
++#if VOP_GETATTR_TAKES_THREAD
++ , td
++#endif
++ )))
+ goto out;
+ uio->uio_offset = va.va_size;
+ } else if ((flags & FOF_OFFSET) == 0)
+@@ -227,7 +235,7 @@
+ return (0);
+
+ biosize = vp->v_mount->mnt_stat.f_iosize;
+- bcount = min(MAXBSIZE, biosize);
++ bcount = MIN(MAXBSIZE, biosize);
+
+ DEBUG2G("entering loop\n");
+ do {
+@@ -352,7 +360,7 @@
+ fri = fdi.indata;
+ fri->fh = fufh->fh_id;
+ fri->offset = uio->uio_offset;
+- fri->size = min(uio->uio_resid,
++ fri->size = MIN(uio->uio_resid,
+ fusefs_get_data(vp->v_mount)->max_read);
+
+ DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n",
+@@ -399,7 +407,7 @@
+ while (uio->uio_resid > 0) {
+ int transfersize;
+
+- chunksize = min(iov->iov_len, nmax);
++ chunksize = MIN(iov->iov_len, nmax);
+
+ if (uio->uio_rw == UIO_READ) {
+ struct fuse_read_in *fri;
+@@ -464,7 +472,7 @@
+ {
+ int err;
+
+- if ((err = uiomove(buf, min(reqsize, bufsize), uio)))
++ if ((err = uiomove(buf, MIN(reqsize, bufsize), uio)))
+ return (err);
+
+ if (bufsize < reqsize)
+@@ -502,7 +510,7 @@
+ }
+
+ while (uio->uio_resid > 0) {
+- chunksize = min(uio->uio_resid,
++ chunksize = MIN(uio->uio_resid,
+ fusefs_get_data(vp->v_mount)->max_write);
+
+ fdi.iosize = sizeof(*fwi) + chunksize;
+@@ -569,7 +577,7 @@
+ do {
+ lbn = uio->uio_offset / biosize;
+ on = uio->uio_offset & (biosize-1);
+- n = min((unsigned)(biosize - on), uio->uio_resid);
++ n = MIN((unsigned)(biosize - on), uio->uio_resid);
+
+ DEBUG2G("lbn %d, on %d, n %d, uio offset %d, uio resid %d\n",
+ (int)lbn, on, n, (int)uio->uio_offset, uio->uio_resid);
+@@ -739,8 +747,8 @@
+ */
+ if (n) {
+ if (bp->b_dirtyend > 0) {
+- bp->b_dirtyoff = min(on, bp->b_dirtyoff);
+- bp->b_dirtyend = max((on + n), bp->b_dirtyend);
++ bp->b_dirtyoff = MIN(on, bp->b_dirtyoff);
++ bp->b_dirtyend = MAX((on + n), bp->b_dirtyend);
+ } else {
+ bp->b_dirtyoff = on;
+ bp->b_dirtyend = on + n;
+@@ -823,7 +831,11 @@
+ #if FUSELIB_CONFORM_BIOREAD
+ struct vattr va;
+
+- if ((err = VOP_GETATTR(vp, &va, cred, curthread)))
++ if ((err = VOP_GETATTR(vp, &va, cred
++#if VOP_GETATTR_TAKES_THREAD
++ , curthread
++#endif
++ )))
+ goto out;
+ #endif
+
+@@ -831,7 +843,7 @@
+ bp->b_resid = bp->b_bcount;
+ while (bp->b_resid > 0) {
+ DEBUG2G("starting bio with resid %ld\n", bp->b_resid);
+- chunksize = min(bp->b_resid,
++ chunksize = MIN(bp->b_resid,
+ fusefs_get_data(vp->v_mount)->max_read);
+ fdi.iosize = sizeof(*fri);
+ if (! op)
+@@ -842,8 +854,8 @@
+ fri->fh = fufh->fh_id;
+ fri->offset = ((off_t)bp->b_blkno) * biosize + ioff;
+ #if FUSELIB_CONFORM_BIOREAD
+- chunksize = min(chunksize,
+- min(fri->offset + bp->b_resid,
++ chunksize = MIN(chunksize,
++ MIN(fri->offset + bp->b_resid,
+ va.va_size) - fri->offset);
+ if (chunksize == 0) {
+ respsize = -1;
+@@ -901,7 +913,7 @@
+
+ bufdat = bp->b_data + bp->b_dirtyoff;
+ while (bp->b_dirtyend > bp->b_dirtyoff) {
+- chunksize = min(bp->b_dirtyend - bp->b_dirtyoff,
++ chunksize = MIN(bp->b_dirtyend - bp->b_dirtyoff,
+ fusefs_get_data(vp->v_mount)->max_write);
+
+ fdi.iosize = sizeof(*fwi);
+--- fuse_module/fuse_main.c.00 2010-08-15 14:40:29.000000000 +0400
++++ fuse_module/fuse_main.c 2010-08-15 15:56:56.000000000 +0400
+@@ -108,6 +108,9 @@
+ switch (what) {
+ case MOD_LOAD: /* kldload */
+
++#if __FreeBSD_version > 800009
++ fuse_fileops.fo_truncate = vnops.fo_truncate;
++#endif
+ fuse_fileops.fo_ioctl = vnops.fo_ioctl;
+ fuse_fileops.fo_poll = vnops.fo_poll;
+ fuse_fileops.fo_kqfilter = vnops.fo_kqfilter;
+
+
+--- fuse_module/fuse_vfsops.c.orig 2008-02-05 00:25:57.000000000 -0500
++++ fuse_module/fuse_vfsops.c 2009-05-13 18:54:01.000000000 -0400
+@@ -18,6 +18,7 @@
+ #include <sys/namei.h>
+ #include <sys/mount.h>
+ #include <sys/sysctl.h>
++#include <sys/fcntl.h>
+
+ #include "fuse.h"
+ #include "fuse_session.h"
+@@ -213,8 +214,14 @@
+ * Mount system call
+ */
+ static int
++#if VFSOPS_TAKES_THREAD
+ fuse_mount(struct mount *mp, struct thread *td)
+ {
++#else
++fuse_mount(struct mount *mp)
++{
++ struct thread *td = curthread;
++#endif
+ int err = 0;
+ size_t len;
+ char *fspec, *subtype = NULL;
+@@ -529,8 +536,14 @@
+ * Unmount system call
+ */
+ static int
++#if VFSOPS_TAKES_THREAD
+ fuse_unmount(struct mount *mp, int mntflags, struct thread *td)
+ {
++#else
++fuse_unmount(struct mount *mp, int mntflags)
++{
++ struct thread *td = curthread;
++#endif
+ int flags = 0, err = 0;
+ struct fuse_data *data;
+ struct fuse_secondary_data *fsdat = NULL;
+@@ -633,8 +646,14 @@
+
+ /* stolen from portalfs */
+ static int
++#if VFSOPS_TAKES_THREAD
+ fuse_root(struct mount *mp, int flags, struct vnode **vpp, struct thread *td)
+ {
++#else
++fuse_root(struct mount *mp, int flags, struct vnode **vpp)
++{
++ struct thread *td = curthread;
++#endif
+ /*
+ * Return locked reference to root.
+ */
+@@ -650,7 +669,11 @@
+ data = fsdat->master;
+ sx_slock(&data->mhierlock);
+ if (data->mpri == FM_PRIMARY)
+- err = fuse_root(data->mp, flags, vpp, td);
++ err = fuse_root(data->mp, flags, vpp
++#if VFSOPS_TAKES_THREAD
++ , td
++#endif
++ );
+ else
+ err = ENXIO;
+ sx_sunlock(&data->mhierlock);
+@@ -667,7 +690,11 @@
+ if (vp->v_type == VNON) {
+ struct vattr va;
+
+- (void)VOP_GETATTR(vp, &va, td->td_ucred, td);
++ (void)VOP_GETATTR(vp, &va, td->td_ucred
++#if VOP_GETATTR_TAKES_THREAD
++ , td
++#endif
++ );
+ }
+ *vpp = vp;
+ #if _DEBUG2G
+@@ -678,8 +705,14 @@
+ }
+
+ static int
++#if VFSOPS_TAKES_THREAD
+ fuse_statfs(struct mount *mp, struct statfs *sbp, struct thread *td)
+ {
++#else
++fuse_statfs(struct mount *mp, struct statfs *sbp)
++{
++ struct thread *td = curthread;
++#endif
+ struct fuse_dispatcher fdi;
+ struct fuse_statfs_out *fsfo;
+ struct fuse_data *data;
+@@ -696,7 +729,11 @@
+
+ sx_slock(&data->mhierlock);
+ if (data->mpri == FM_PRIMARY)
+- err = fuse_statfs(data->mp, sbp, td);
++ err = fuse_statfs(data->mp, sbp
++#if VFSOPS_TAKES_THREAD
++ , td
++#endif
++ );
+ else
+ err = ENXIO;
+ sx_sunlock(&data->mhierlock);
+@@ -794,7 +831,11 @@
+ if (nodeid == FUSE_ROOT_ID) {
+ if (parentid != FUSE_NULL_ID)
+ return (ENOENT);
+- err = VFS_ROOT(mp, myflags, vpp, td);
++ err = VFS_ROOT(mp, myflags, vpp
++#if VFSOPS_TAKES_THREAD
++ , td
++#endif
++ );
+ if (err)
+ return (err);
+ KASSERT(*vpp, ("we neither err'd nor found the root node"));
+--- ./fuse_module/fuse_vnops.c.orig 2012-09-19 06:04:10.512413490 +0200
++++ ./fuse_module/fuse_vnops.c 2012-09-19 06:20:44.949613892 +0200
+@@ -799,8 +799,11 @@
+ struct vnode *vp = ap->a_vp;
+ struct vattr *vap = ap->a_vap;
+ struct ucred *cred = ap->a_cred;
++#if VOP_GETATTR_TAKES_THREAD
+ struct thread *td = ap->a_td;
+-
++#else
++ struct thread *td = curthread;
++#endif
+ struct fuse_dispatcher fdi;
+ struct timespec uptsp;
+ int err = 0;
+@@ -871,7 +874,11 @@
+ fuse_access(ap)
+ struct vop_access_args /* {
+ struct vnode *a_vp;
++#if VOP_ACCESS_TAKES_ACCMODE_T
++ accmode_t a_accmode;
++#else
+ int a_mode;
++#endif
+ struct ucred *a_cred;
+ struct thread *a_td;
+ } */ *ap;
+@@ -886,7 +893,13 @@
+ else
+ facp.facc_flags |= FACCESS_DO_ACCESS;
+
+- return fuse_access_i(vp, ap->a_mode, ap->a_cred, ap->a_td, &facp);
++ return fuse_access_i(vp,
++#if VOP_ACCESS_TAKES_ACCMODE_T
++ ap->a_accmode,
++#else
++ ap->a_mode,
++#endif
++ ap->a_cred, ap->a_td, &facp);
+ }
+
+ /*
+@@ -946,7 +959,11 @@
+ /* We are to do the check in-kernel */
+
+ if (! (facp->facc_flags & FACCESS_VA_VALID)) {
+- err = VOP_GETATTR(vp, VTOVA(vp), cred, td);
++ err = VOP_GETATTR(vp, VTOVA(vp), cred
++#if VOP_GETATTR_TAKES_THREAD
++ , td
++#endif
++ );
+ if (err)
+ return (err);
+ facp->facc_flags |= FACCESS_VA_VALID;
+@@ -1544,7 +1561,7 @@
+ struct fuse_vnode_data *fvdat = VTOFUD(vp);
+ uint64_t parentid = fvdat->parent_nid;
+ struct componentname *cnp = fvdat->germcnp;
+- struct fuse_open_in *foi;
++ struct fuse_create_in *foi;
+ struct fuse_entry_out *feo;
+ struct fuse_mknod_in fmni;
+ int err;
+@@ -1929,7 +1946,11 @@
+ * It will not invalidate pages which are dirty, locked, under
+ * writeback or mapped into pagetables.")
+ */
++#if VOP_GETATTR_TAKES_THREAD
+ err = vinvalbuf(vp, 0, td, PCATCH, 0);
++#else
++ err = vinvalbuf(vp, 0, PCATCH, 0);
++#endif
+ fufh->flags |= FOPEN_KEEP_CACHE;
+ }
+
+@@ -3005,8 +3026,11 @@
+ struct vattr *vap = ap->a_vap;
+ struct vnode *vp = ap->a_vp;
+ struct ucred *cred = ap->a_cred;
++#if VOP_GETATTR_TAKES_THREAD
+ struct thread *td = ap->a_td;
+-
++#else
++ struct thread *td = curthread;
++#endif
+ int err = 0;
+ struct fuse_dispatcher fdi;
+ struct fuse_setattr_in *fsai;
+--- mount_fusefs/mount_fusefs.c 2008-02-05 07:25:57.000000000 +0200
++++ mount_fusefs/mount_fusefs.c 2012-01-07 21:07:35.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include <getopt.h>
+ #include <libgen.h>
+ #include <limits.h>
++#include <osreldate.h>
+ #include <paths.h>
+
+ #include "fuse4bsd.h"
+@@ -312,7 +313,12 @@
+ * Resolve the mountpoint with realpath(3) and remove unnecessary
+ * slashes from the devicename if there are any.
+ */
++#if __FreeBSD_version >= 1000005
++ if (checkpath(dir, mntpath) != 0)
++ err(1, "%s", mntpath);
++#else
+ (void)checkpath(dir, mntpath);
++#endif
+ (void)rmslashes(dev, dev);
+
+ if (strcmp(dev, "auto") == 0)
diff --git a/sys-fs/fuse4bsd/fuse4bsd-0.3.0.ebuild b/sys-fs/fuse4bsd/fuse4bsd-0.3.0.ebuild
new file mode 100644
index 000000000000..af1892de220c
--- /dev/null
+++ b/sys-fs/fuse4bsd/fuse4bsd-0.3.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit portability toolchain-funcs eutils flag-o-matic
+
+DESCRIPTION="Fuse for FreeBSD"
+HOMEPAGE="http://fuse4bsd.creo.hu/"
+# -sbin is needed for getmntopts.c, hardcoding 6.2 is nasty but can't think of
+# any better solution right now
+SRC_URI="http://fuse4bsd.creo.hu/downloads/${P}.tar.gz
+ mirror://gentoo/freebsd-sbin-6.2.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-freebsd/freebsd-sources-6.2
+ virtual/pmake"
+RDEPEND="sys-fs/fuse"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ cp /usr/include/fuse/fuse_kernel.h fuse_module/
+ cp "${WORKDIR}/sbin/mount/getmntopts.c" mount_fusefs/
+ epatch "${FILESDIR}"/${P}-gcc4.patch
+ epatch "${FILESDIR}"/${P}-ports.patch
+}
+
+src_compile() {
+ tc-export CC
+ $(get_bmake) \
+ KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \
+ MOUNT="${WORKDIR}/sbin/mount" LDFLAGS="$(raw-ldflags)" \
+ || die "$(get_bmake) failed"
+}
+
+src_install() {
+ dodir /boot/modules
+ $(get_bmake) \
+ KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \
+ DESTDIR="${D}" install \
+ || die "$(get_bmake) failed"
+
+ for docdir in ./ ./plaintext_out ./html_chunked_out ./html_aux; do
+ docinto ${docdir}
+ dodoc doc/${docdir}/*
+ done
+}
diff --git a/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild b/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild
new file mode 100644
index 000000000000..ec1a8e38ba95
--- /dev/null
+++ b/sys-fs/fuse4bsd/fuse4bsd-0.3.9_pre1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit portability toolchain-funcs eutils flag-o-matic
+
+DESCRIPTION="Fuse for FreeBSD"
+HOMEPAGE="http://fuse4bsd.creo.hu/"
+# -sbin is needed for getmntopts.c, hardcoding 6.2 is nasty but can't think of
+# any better solution right now
+SRC_URI="http://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/fuse4bsd/498acaef33b0.tar.gz
+ mirror://gentoo/freebsd-sbin-9.1.tar.bz2"
+S="${WORKDIR}/fuse4bsd-498acaef33b0"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~x86-fbsd"
+IUSE="doc"
+
+DEPEND=">=sys-freebsd/freebsd-sources-9.1
+ virtual/pmake
+ doc? ( app-text/deplate )"
+RDEPEND="sys-fs/fuse"
+
+QA_TEXTRELS="boot/modules/fuse.ko"
+
+src_prepare() {
+ cp /usr/include/fuse/fuse_kernel.h fuse_module/ || die
+ cp "${WORKDIR}/sbin/mount/getmntopts.c" mount_fusefs/ || die
+ epatch "${FILESDIR}"/${P}-ports.patch
+ epatch "${FILESDIR}"/${P}-fbsd91.patch
+ sed -i -e "s:^DEPLATE=.*:DEPLATE=${EPREFIX}/usr/bin/deplate:" \
+ doc/Makefile || die
+}
+
+src_compile() {
+ filter-ldflags "-Wl,--hash-style=*"
+ tc-export CC
+ cd "${S}"/fuse_module
+ $(get_bmake) \
+ KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \
+ MOUNT="${WORKDIR}/sbin/mount" LDFLAGS="$(raw-ldflags)" \
+ || die "$(get_bmake) failed"
+
+ cd "${S}"/mount_fusefs
+ $(get_bmake) \
+ KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \
+ MOUNT="${WORKDIR}/sbin/mount" \
+ || die "$(get_bmake) failed"
+
+ if use doc; then
+ cd "${S}"/doc
+ $(get_bmake) all || die "$(get_bmake) failed"
+ fi
+}
+
+src_install() {
+ dodir /boot/modules
+ $(get_bmake) \
+ KMODDIR=/boot/modules BINDIR=/usr/sbin MANDIR=/usr/share/man/man \
+ DESTDIR="${ED}" install \
+ || die "$(get_bmake) failed"
+
+ dodoc doc/{CREDITS,README}
+ if use doc; then
+ dodoc doc/plaintext_out/* doc/pdf_out/*.pdf
+ docinto html
+ dodoc doc/html_chunked_out/*
+ fi
+}
diff --git a/sys-fs/fuse4bsd/metadata.xml b/sys-fs/fuse4bsd/metadata.xml
new file mode 100644
index 000000000000..ecedda4aa2cc
--- /dev/null
+++ b/sys-fs/fuse4bsd/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>bsd</herd>
+</pkgmetadata>
diff --git a/sys-fs/fuseiso/Manifest b/sys-fs/fuseiso/Manifest
new file mode 100644
index 000000000000..243455bc549e
--- /dev/null
+++ b/sys-fs/fuseiso/Manifest
@@ -0,0 +1 @@
+DIST fuseiso-20070708.tar.bz2 239960 SHA256 8b242e077d66cd20900c59c905ff90b4c934b0613dd5a20facb0b1260ac5fd88 SHA512 d9d8153101494434fe4ec9c684cec46a1eee46fd3ce06e97fa27f4746990f866e1f23f256b2659e60296d2362cea05d259a0a2ef669ecddf7a0a7e44110c4ae0 WHIRLPOOL df6dd63a3e56cfbce8f85e37215c50d155ee9fb780a80a463c34b79ed1f7964cc3ba6d6b990e32dc991020be309bfdd08a2866ebf3eeedda03ed8262687a1fb4
diff --git a/sys-fs/fuseiso/files/fuseiso-20070708-fix-typo.patch b/sys-fs/fuseiso/files/fuseiso-20070708-fix-typo.patch
new file mode 100644
index 000000000000..522ee7598e0e
--- /dev/null
+++ b/sys-fs/fuseiso/files/fuseiso-20070708-fix-typo.patch
@@ -0,0 +1,12 @@
+diff -urp fuseiso-20070708.org/src/fuseiso.c fuseiso-20070708/src/fuseiso.c
+--- fuseiso-20070708.org/src/fuseiso.c 2013-08-22 19:33:46.316904170 +0800
++++ fuseiso-20070708/src/fuseiso.c 2013-08-22 19:31:54.789908834 +0800
+@@ -295,7 +295,7 @@ void usage(const char* prog) {
+ " -f -- run in foreground, do not daemonize\n"
+ " -d -- run in foreground and print debug information\n"
+ " -s -- run single-threaded\n"
+- "\nPlease consult with FUSE ducumentation for more information\n",
++ "\nPlease consult with FUSE documentation for more information\n",
+ VERSION,
+ prog);
+ };
diff --git a/sys-fs/fuseiso/files/fuseiso-20070708-largeiso.patch b/sys-fs/fuseiso/files/fuseiso-20070708-largeiso.patch
new file mode 100644
index 000000000000..e323768d247e
--- /dev/null
+++ b/sys-fs/fuseiso/files/fuseiso-20070708-largeiso.patch
@@ -0,0 +1,48 @@
+http://bugzilla.redhat.com/show_bug.cgi?id=440436
+
+diff -ur fuseiso-20070708.orig/src/isofs.c fuseiso-20070708/src/isofs.c
+--- fuseiso-20070708.orig/src/isofs.c 2007-07-08 15:22:59.000000000 +0300
++++ fuseiso-20070708/src/isofs.c 2009-10-25 12:02:16.000000000 +0200
+@@ -178,7 +178,7 @@
+ context.data_size = isonum_723(context.pd.logical_block_size);
+
+ if(!context.block_size) {
+- fprintf(stderr, "init: wrong block data size %d, using default 2048\n", context.data_size);
++ fprintf(stderr, "init: wrong block data size %Lu, using default 2048\n", context.data_size);
+ context.data_size = 2048;
+ };
+
+@@ -324,7 +324,7 @@
+
+ if(context.block_size != 2048) {
+ // report unusual data block size
+- printf("Data block size: %d\n", context.block_size);
++ printf("Data block size: %Lu\n", context.block_size);
+ };
+
+ char buf[129];
+@@ -479,7 +479,7 @@
+ };
+ size_t len = read(context.fd, buf, context.data_size);
+ if(len != context.data_size) {
+- fprintf(stderr, "isofs_read_raw_block: can`t read full block, read only %d bytes from offset %d, %d required; errno %d, message %s\n",
++ fprintf(stderr, "isofs_read_raw_block: can`t read full block, read only %d bytes from offset %d, %Lu required; errno %d, message %s\n",
+ len, (int) off, context.data_size, errno, strerror(errno));
+ fprintf(stderr, "isofs_read_raw_block: huh? reading zeros beyond file end? someone want to save a penny?\n");
+ memset(buf + len, 0, context.data_size - len);
+diff -ur fuseiso-20070708.orig/src/isofs.h fuseiso-20070708/src/isofs.h
+--- fuseiso-20070708.orig/src/isofs.h 2006-10-17 04:50:39.000000000 +0300
++++ fuseiso-20070708/src/isofs.h 2009-10-25 12:02:16.000000000 +0200
+@@ -38,9 +38,9 @@
+ struct iso_directory_record *root;
+ int file_offset; // offset to begin of useful data (for .nrg files)
+ int id_offset; // offset to CD001 inside file
+- size_t block_size; // raw block size
+- size_t block_offset; // offset from block start to data
+- size_t data_size; // data size inside block
++ off_t block_size; // raw block size
++ off_t block_offset; // offset from block start to data
++ off_t data_size; // data size inside block
+ int susp; // parse susp entries
+ int susp_skip; // skip bytes from susp SP entry
+ int joliet_level; // joliet extension level (1, 2 or 3)
diff --git a/sys-fs/fuseiso/fuseiso-20070708-r1.ebuild b/sys-fs/fuseiso/fuseiso-20070708-r1.ebuild
new file mode 100644
index 000000000000..9acd2cf4f5fa
--- /dev/null
+++ b/sys-fs/fuseiso/fuseiso-20070708-r1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Fuse module to mount ISO9660"
+HOMEPAGE="http://sourceforge.net/projects/fuseiso"
+SRC_URI="http://superb-dca2.dl.sourceforge.net/project/fuseiso/fuseiso/20070708/fuseiso-20070708.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+RDEPEND="sys-fs/fuse
+ sys-libs/zlib
+ dev-libs/glib:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-largeiso.patch"
+ epatch "${FILESDIR}/${P}-fix-typo.patch" # bug #482078
+ epatch_user
+}
diff --git a/sys-fs/fuseiso/metadata.xml b/sys-fs/fuseiso/metadata.xml
new file mode 100644
index 000000000000..2f90b14e8632
--- /dev/null
+++ b/sys-fs/fuseiso/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>zhaoxiaoqiang007@gmail.com</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/genext2fs/Manifest b/sys-fs/genext2fs/Manifest
new file mode 100644
index 000000000000..f9342228ae54
--- /dev/null
+++ b/sys-fs/genext2fs/Manifest
@@ -0,0 +1,4 @@
+DIST genext2fs-1.3-uclibc-updates.patch.bz2 20048 SHA256 dd9b1e1afc146328deaa4440560e37fc9b527324aea4a347fa28a1025d442315
+DIST genext2fs-1.4.1.tar.gz 103283 SHA256 404dbbfa7a86a6c3de8225c8da254d026b17fd288e05cec4df2cc7e1f4feecfc SHA512 1b9ec7044014423345ae6b09862ba6903f5b3e0f68fb8bbcf97daf2705471cc1633a9fdbc5e00afe1b191e1af7bed87bde2e538bc7365469218f2a00b062845c WHIRLPOOL c92cda39f10b988ae753fcd8b70c7abd687832f96f2b80322e55ae560e73657ceb0eaad62b190fb538976151d6c9278ad859848fe190e97b366f0cabb21fae2c
+DIST genext2fs-1.4.tar.gz 101384 SHA256 b48b7f01f493fc4f977778e6c368f6916a8c6bf7f9d6a6ff910ff364d725b9b5
+DIST genext2fs_1.3.orig.tar.gz 19343 SHA256 8e7dfa34f3919226550dc6507a23753f9fda55e78b15b264291ecf5940d837e9
diff --git a/sys-fs/genext2fs/genext2fs-1.3-r1.ebuild b/sys-fs/genext2fs/genext2fs-1.3-r1.ebuild
new file mode 100644
index 000000000000..e93bd4ddfec6
--- /dev/null
+++ b/sys-fs/genext2fs/genext2fs-1.3-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="generate ext2 file systems"
+HOMEPAGE="http://sourceforge.net/projects/genext2fs"
+SRC_URI="mirror://debian/pool/main/g/genext2fs/${PN}_${PV}.orig.tar.gz
+ mirror://gentoo/${P}-uclibc-updates.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha arm hppa ~mips ppc sparc x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}/${P}.orig
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${WORKDIR}/${P}-uclibc-updates.patch
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die
+}
diff --git a/sys-fs/genext2fs/genext2fs-1.4.1.ebuild b/sys-fs/genext2fs/genext2fs-1.4.1.ebuild
new file mode 100644
index 000000000000..11a5e249f532
--- /dev/null
+++ b/sys-fs/genext2fs/genext2fs-1.4.1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="generate ext2 file systems"
+HOMEPAGE="http://sourceforge.net/projects/genext2fs"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ~mips ppc sparc x86"
+IUSE=""
+
+DEPEND=""
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog NEWS README TODO
+}
diff --git a/sys-fs/genext2fs/genext2fs-1.4.ebuild b/sys-fs/genext2fs/genext2fs-1.4.ebuild
new file mode 100644
index 000000000000..12f86ad9b32d
--- /dev/null
+++ b/sys-fs/genext2fs/genext2fs-1.4.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="generate ext2 file systems"
+HOMEPAGE="http://sourceforge.net/projects/genext2fs"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog NEWS README TODO
+}
diff --git a/sys-fs/genext2fs/metadata.xml b/sys-fs/genext2fs/metadata.xml
new file mode 100644
index 000000000000..039dac4acd36
--- /dev/null
+++ b/sys-fs/genext2fs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>dev-embedded</herd>
+ <upstream>
+ <remote-id type="sourceforge">genext2fs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/gfs2-utils/Manifest b/sys-fs/gfs2-utils/Manifest
new file mode 100644
index 000000000000..ee76e4c3891e
--- /dev/null
+++ b/sys-fs/gfs2-utils/Manifest
@@ -0,0 +1,3 @@
+DIST gfs2-utils-3.1.2.tar.gz 348485 SHA256 34e3eabb0b95bcb4358268df6209af597688e7138161152b51d1c60b533d9fbd
+DIST gfs2-utils-3.1.3.tar.gz 356745 SHA256 0f27670ef1cb46105e9adbe3ffbc7bd51112bbb12164754d9d0c799344b6fe33 SHA512 3a3ac7cd446d20ebdae2f8283acc828a9e104509e35196c8320579f7bc7dd4eb1fb75873541f10bcdd614505beba6c70f188428a2ddac7725c2fa23c9cc86910 WHIRLPOOL cd2e1cf15435b087d74c0f0e82ff565f596a62396832e36b4c788b0d1839ab00415b954477666f73fd491860022adaa646dfbe33691a2f738e4e13bc9259e604
+DIST gfs2-utils-3.1.5.tar.gz 336862 SHA256 8676bb20e0961883920803e19e79dc6205df86ef4c66080275706c6da9a13d18 SHA512 85fea4ea93eaad2f0bdb6c57c9d193a8ee8be47e05dff15f2883ca11487f49d843a2d02590f4844c7ce9d80f8967bd6dd18b652e56f78f9f3ae9e9c7274b285e WHIRLPOOL 7a5027b9302da04d55ddd44b18e1638a30c1adfcbf30041dd609198ada36b0a7258ba52ca7df291cd2c587ec0c1664d357b73cf5c54846afb2ab2eabb05ea2c0
diff --git a/sys-fs/gfs2-utils/gfs2-utils-3.1.2.ebuild b/sys-fs/gfs2-utils/gfs2-utils-3.1.2.ebuild
new file mode 100644
index 000000000000..147b1246777c
--- /dev/null
+++ b/sys-fs/gfs2-utils/gfs2-utils-3.1.2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools linux-info
+
+DESCRIPTION="GFS2 Utilities"
+HOMEPAGE="https://fedorahosted.org/cluster/wiki/HomePage"
+SRC_URI="https://fedorahosted.org/releases/${PN:0:1}/${PN:1:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="sys-cluster/corosync
+ sys-cluster/openais
+ sys-cluster/liblogthread
+ sys-cluster/libccs
+ sys-cluster/libfence
+ sys-cluster/libdlm
+ sys-libs/ncurses"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ mkdir m4
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ --with-kernel="${KERNEL_DIR}" \
+ --localstatedir=/var
+}
+
+src_install() {
+ default
+ rm -rf "${D}/usr/share/doc"
+ dodoc doc/*.txt
+
+ rmdir "${D}"/var/run/{cluster,} # cman-init.d creates it
+
+ keepdir /var/{lib,log}/cluster
+}
diff --git a/sys-fs/gfs2-utils/gfs2-utils-3.1.3.ebuild b/sys-fs/gfs2-utils/gfs2-utils-3.1.3.ebuild
new file mode 100644
index 000000000000..ed55398c516e
--- /dev/null
+++ b/sys-fs/gfs2-utils/gfs2-utils-3.1.3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools linux-info
+
+DESCRIPTION="GFS2 Utilities"
+HOMEPAGE="https://fedorahosted.org/cluster/wiki/HomePage"
+SRC_URI="https://fedorahosted.org/releases/${PN:0:1}/${PN:1:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="sys-cluster/corosync
+ sys-cluster/openais
+ sys-cluster/liblogthread
+ sys-cluster/libccs
+ sys-cluster/libfence
+ sys-cluster/libdlm
+ sys-libs/ncurses"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ mkdir m4
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ --with-kernel="${KERNEL_DIR}" \
+ --localstatedir=/var
+}
+
+src_install() {
+ default
+ rm -rf "${D}/usr/share/doc"
+ dodoc doc/*.txt
+
+ rmdir "${D}"/var/run/{cluster,} # cman-init.d creates it
+
+ keepdir /var/{lib,log}/cluster
+}
diff --git a/sys-fs/gfs2-utils/gfs2-utils-3.1.5.ebuild b/sys-fs/gfs2-utils/gfs2-utils-3.1.5.ebuild
new file mode 100644
index 000000000000..c20be01e89a9
--- /dev/null
+++ b/sys-fs/gfs2-utils/gfs2-utils-3.1.5.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools linux-info
+
+DESCRIPTION="GFS2 Utilities"
+HOMEPAGE="https://fedorahosted.org/cluster/wiki/HomePage"
+SRC_URI="https://fedorahosted.org/releases/${PN:0:1}/${PN:1:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="sys-cluster/corosync
+ sys-cluster/openais
+ sys-cluster/liblogthread
+ sys-cluster/libccs
+ sys-cluster/libfence
+ sys-cluster/libdlm
+ sys-libs/ncurses"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ --localstatedir=/var
+}
+
+src_compile() {
+ # parallel build is broken
+ emake -j1
+}
+
+src_install() {
+ default
+ rm -rf "${D}/usr/share/doc"
+ dodoc doc/*.txt
+
+ keepdir /var/{lib,log}/cluster
+}
diff --git a/sys-fs/gfs2-utils/metadata.xml b/sys-fs/gfs2-utils/metadata.xml
new file mode 100644
index 000000000000..71656942007a
--- /dev/null
+++ b/sys-fs/gfs2-utils/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>cluster</herd>
+ <longdescription>GFS2 Utilities</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/go-mtpfs/go-mtpfs-9999.ebuild b/sys-fs/go-mtpfs/go-mtpfs-9999.ebuild
new file mode 100644
index 000000000000..4da89fdf40e5
--- /dev/null
+++ b/sys-fs/go-mtpfs/go-mtpfs-9999.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit git-r3 flag-o-matic toolchain-funcs
+
+DESCRIPTION="a simple FUSE filesystem for mounting Android devices as a MTP device"
+HOMEPAGE="https://github.com/hanwen/go-mtpfs"
+EGIT_REPO_URI="https://github.com/hanwen/go-mtpfs.git"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+COMMON_DEPEND="virtual/libusb
+ virtual/udev"
+DEPEND="${COMMON_DEPEND}
+ dev-libs/go-fuse
+ dev-libs/go-usb
+ dev-lang/go
+ media-libs/libmtp"
+
+RDEPEND="${COMMON_DEPEND}"
+
+#Tests require a connected mtp device
+RESTRICT="test"
+
+GO_PN="github.com/hanwen/${PN}"
+EGIT_CHECKOUT_DIR="${S}/src/${GO_PN}"
+QA_FLAGS_IGNORED=usr/bin/go-mtpfs
+
+export GOPATH="${S}"
+
+src_compile() {
+ go build -ldflags '-extldflags=-fno-PIC' -v -x -work ${GO_PN} || die
+}
+
+src_test() {
+ go test -ldflags '-extldflags=-fno-PIC' ${GO_PN}/fs || die
+ go test -ldflags '-extldflags=-fno-PIC' ${GO_PN}/usb || die
+ go test -ldflags '-extldflags=-fno-PIC' ${GO_PN}/mtp || die
+}
+
+src_install() {
+ dobin go-mtpfs
+}
diff --git a/sys-fs/go-mtpfs/metadata.xml b/sys-fs/go-mtpfs/metadata.xml
new file mode 100644
index 000000000000..aa788364ce7c
--- /dev/null
+++ b/sys-fs/go-mtpfs/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>zerochaos@gentoo.org</email>
+ <name>Rick Farina</name>
+ </maintainer>
+ <longdescription lang="en">
+</longdescription>
+ <upstream>
+ <remote-id type="github">hanwen/go-mtpfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/gt5/Manifest b/sys-fs/gt5/Manifest
new file mode 100644
index 000000000000..eecc4bbfe3c9
--- /dev/null
+++ b/sys-fs/gt5/Manifest
@@ -0,0 +1 @@
+DIST gt5-1.4.0.tar.gz 16504 SHA256 785a2a71f77e29d2cf4bbd2c6f49f690d6fdcb5f53abd51aee393572fd7fa03e
diff --git a/sys-fs/gt5/files/gt5-1.4.0-bash-shabang.patch b/sys-fs/gt5/files/gt5-1.4.0-bash-shabang.patch
new file mode 100644
index 000000000000..d28d9f6c1eed
--- /dev/null
+++ b/sys-fs/gt5/files/gt5-1.4.0-bash-shabang.patch
@@ -0,0 +1,9 @@
+diff -ru gt5-1.4.0.orig/gt5 gt5-1.4.0/gt5
+--- gt5-1.4.0.orig/gt5 2007-09-17 00:29:48.685233203 +0200
++++ gt5-1.4.0/gt5 2007-09-17 00:29:55.684165472 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ version=1.4.0
+
+ #HTML-colours: ---------------------------------------------------------------
diff --git a/sys-fs/gt5/files/gt5-1.4.0-empty-dirs.patch b/sys-fs/gt5/files/gt5-1.4.0-empty-dirs.patch
new file mode 100644
index 000000000000..4aab4d0ab840
--- /dev/null
+++ b/sys-fs/gt5/files/gt5-1.4.0-empty-dirs.patch
@@ -0,0 +1,11 @@
+--- /usr/bin/gt5.old 2011-01-10 23:01:29.778000092 +0100
++++ /usr/bin/gt5 2011-01-10 23:01:16.577000089 +0100
+@@ -261,7 +261,7 @@
+
+ #can du handle depths?
+ DEPTH="$(du --help 2>&1 | "$AWK" '
+- /depth/{sub(/^[^-]*/,""); sub(/[N ].*/,""); print; exit}
++ /depth/{sub(/^[^-]*/,""); sub(/,[N ].*/,""); print; exit}
+ ')$((MAX_DEPTH+1))"
+
+ {
diff --git a/sys-fs/gt5/gt5-1.4.0-r2.ebuild b/sys-fs/gt5/gt5-1.4.0-r2.ebuild
new file mode 100644
index 000000000000..54150aee36f0
--- /dev/null
+++ b/sys-fs/gt5/gt5-1.4.0-r2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="a diff-capable 'du-browser'"
+HOMEPAGE="http://gt5.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~sparc x86"
+IUSE=""
+
+RDEPEND="|| ( www-client/links
+ www-client/elinks
+ www-client/lynx )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${P}-bash-shabang.patch" \
+ "${FILESDIR}/${P}-empty-dirs.patch"
+}
+
+src_install() {
+ dobin gt5
+ doman gt5.1
+ dodoc Changelog README
+}
diff --git a/sys-fs/gt5/metadata.xml b/sys-fs/gt5/metadata.xml
new file mode 100644
index 000000000000..f81cb39ecad7
--- /dev/null
+++ b/sys-fs/gt5/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>angelos@gentoo.org</email>
+ <name>Christoph Mende</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gt5</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/hfsplusutils/Manifest b/sys-fs/hfsplusutils/Manifest
new file mode 100644
index 000000000000..bfc25de40584
--- /dev/null
+++ b/sys-fs/hfsplusutils/Manifest
@@ -0,0 +1 @@
+DIST hfsplus_1.0.4.src.tar.bz2 185461 RMD160 4aa92c2429dbba7d7da81c525004cc46a0f8fb7c SHA1 dfaea9a7e09133377a028dd7a0b6135b43e5d0fd SHA256 032b1c663b1400f3ea1c2ec1a03adebd6e57e51fd38e997befdd223448a10c6d
diff --git a/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-errno.patch b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-errno.patch
new file mode 100644
index 000000000000..c9caeb4208fb
--- /dev/null
+++ b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-errno.patch
@@ -0,0 +1,19 @@
+diff -ruN hfsplus.orig/src/hpmkdir.c hfsplus-1.0.4/src/hpmkdir.c
+--- hfsplus.orig/src/hpmkdir.c 2003-03-30 20:09:59.000000000 +0200
++++ hfsplus-1.0.4/src/hpmkdir.c 2003-03-30 20:11:15.000000000 +0200
+@@ -46,8 +46,9 @@
+ # include <string.h>
+ # include <time.h>
+ # include <ctype.h>
+-# include <errno.h>
+ */
++# include <errno.h>
++
+ # include <stdio.h>
+ # include <stdlib.h>
+
+@@ -164,3 +165,4 @@
+ hfsputil_perrorp(argv0);
+ return -1;
+ }
++
diff --git a/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc4.patch b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc4.patch
new file mode 100644
index 000000000000..04724440ddbf
--- /dev/null
+++ b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-gcc4.patch
@@ -0,0 +1,132 @@
+--- hfsplus-1.0.4/libhfsp/src/btree.c~ 2002-03-05 19:50:28.000000000 +0000
++++ hfsplus-1.0.4/libhfsp/src/btree.c 2005-04-30 12:48:48.000000000 +0100
+@@ -393,7 +393,7 @@ static int btree_init(btree* bt, volume*
+ {
+ p = volume_readfromfork(vol, nodebuf, fork, 0, bt->blkpernode,
+ HFSP_EXTENT_DATA, bt->cnid);
+- ((char*) p) += HEADER_RESERVEDOFFSET; // skip header
++ p += HEADER_RESERVEDOFFSET; // skip header
+ }
+
+ bt->alloc_bits = malloc(alloc_size);
+--- hfsplus-1.0.4/libhfsp/src/swab.h~ 2002-03-05 19:50:29.000000000 +0000
++++ hfsplus-1.0.4/libhfsp/src/swab.h 2005-04-30 12:48:05.000000000 +0100
+@@ -36,28 +36,28 @@
+
+ #define bswabU16(val) bswap_16(val)
+
+-#define bswabU16_inc(ptr) bswap_16(*((UInt16*) (ptr))++)
+-#define bswabU32_inc(ptr) bswap_32(*((UInt32*) (ptr))++)
+-#define bswabU64_inc(ptr) bswap_64(*((UInt64*) (ptr))++)
+-
+-#define bstoreU16_inc(ptr, val) (*((UInt16*) (ptr))++) = bswap_16(val)
+-#define bstoreU32_inc(ptr, val) (*((UInt32*) (ptr))++) = bswap_32(val)
+-#define bstoreU64_inc(ptr, val) (*((UInt64*) (ptr))++) = bswap_64(val)
++#define bswabU16_inc(ptr) bswap_16(*(*((UInt16**) (void *)(&ptr)))++)
++#define bswabU32_inc(ptr) bswap_32(*(*((UInt32**) (void *)(&ptr)))++)
++#define bswabU64_inc(ptr) bswap_64(*(*((UInt64**) (void *)(&ptr)))++)
++
++#define bstoreU16_inc(ptr, val) (*(*((UInt16**) (void *)(&ptr)))++) = bswap_16(val)
++#define bstoreU32_inc(ptr, val) (*(*((UInt32**) (void *)(&ptr)))++) = bswap_32(val)
++#define bstoreU64_inc(ptr, val) (*(*((UInt64**) (void *)(&ptr)))++) = bswap_64(val)
+
+ #else // BYTE_ORDER == BIG_ENDIAN
+
+ #define bswabU16(val) val
+
+-#define bswabU16_inc(ptr) (*((UInt16*) (ptr))++)
+-#define bswabU32_inc(ptr) (*((UInt32*) (ptr))++)
+-#define bswabU64_inc(ptr) (*((UInt64*) (ptr))++)
+-
+-#define bstoreU16_inc(ptr, val) (*((UInt16*) (ptr))++) = val
+-#define bstoreU32_inc(ptr, val) (*((UInt32*) (ptr))++) = val
+-#define bstoreU64_inc(ptr, val) (*((UInt64*) (ptr))++) = val
++#define bswabU16_inc(ptr) (*(*((UInt16**) (void *)(&ptr)))++)
++#define bswabU32_inc(ptr) (*(*((UInt32**) (void *)(&ptr)))++)
++#define bswabU64_inc(ptr) (*(*((UInt64**) (void *)(&ptr)))++)
++
++#define bstoreU16_inc(ptr, val) (*(*((UInt16**) (void *)(&ptr)))++) = val
++#define bstoreU32_inc(ptr, val) (*(*((UInt32**) (void *)(&ptr)))++) = val
++#define bstoreU64_inc(ptr, val) (*(*((UInt64**) (void *)(&ptr)))++) = val
+
+ #endif
+
+ /* for the sake of compleetness and readability */
+-#define bswabU8_inc(ptr) (*((UInt8*) (ptr))++)
+-#define bstoreU8_inc(ptr,val) (*((UInt8*) (ptr))++) = val
++#define bswabU8_inc(ptr) (*(*((UInt8**) (void *)(&ptr)))++)
++#define bstoreU8_inc(ptr,val) (*(*((UInt8**) (void *)(&ptr)))++) = val
+--- hfsplus-1.0.4/libhfsp/src/btreecheck.c~ 2002-03-05 19:50:29.000000000 +0000
++++ hfsplus-1.0.4/libhfsp/src/btreecheck.c 2005-04-30 12:49:22.000000000 +0100
+@@ -264,7 +264,7 @@ static int fscheck_btree_init(btree* bt,
+ {
+ p = volume_readfromfork(vol, nodebuf, fork, 0, bt->blkpernode,
+ HFSP_EXTENT_DATA, bt->cnid);
+- ((char*) p) += HEADER_RESERVEDOFFSET; // skip header
++ p += HEADER_RESERVEDOFFSET; // skip header
+ }
+
+ bt->alloc_bits = malloc(alloc_size);
+--- hfsplus-1.0.4/libhfsp/src/fscheck.c~ 2002-03-25 15:48:37.000000000 +0000
++++ hfsplus-1.0.4/libhfsp/src/fscheck.c 2005-04-30 12:50:26.000000000 +0100
+@@ -230,7 +230,7 @@ static int fscheck_volume_readbuf(volume
+ vh->write_count = bswabU32_inc(p);
+ vh->encodings_bmp = bswabU64_inc(p);
+ memcpy(vh->finder_info, p, 32);
+- ((char*) p) += 32; // So finderinfo must be swapped later, ***
++ p += 32; // So finderinfo must be swapped later, ***
+ p = volume_readfork(p, &vh->alloc_file );
+ p = volume_readfork(p, &vh->ext_file );
+ p = volume_readfork(p, &vh->cat_file );
+@@ -277,12 +277,12 @@ static int fscheck_read_wrapper(volume *
+ printf("Volume is wrapped in HFS volume "
+ " (use hfsck to check this)\n");
+
+- ((char*) p) += 0x12; /* skip unneded HFS vol fields */
++ p += 0x12; /* skip unneded HFS vol fields */
+ drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */
+- ((char*) p) += 0x4; /* skip unneded HFS vol fields */
++ p += 0x4; /* skip unneded HFS vol fields */
+ drAlBlSt = bswabU16_inc(p); /* offset 0x1C */
+
+- ((char*) p) += 0x5E; /* skip unneded HFS vol fields */
++ p += 0x5E; /* skip unneded HFS vol fields */
+ signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */
+ if (signature != HFSP_VOLHEAD_SIG)
+ HFSP_ERROR(-1, "This looks like a normal HFS volume");
+--- hfsplus-1.0.4/libhfsp/src/volume.c~ 2002-03-26 18:00:29.000000000 +0000
++++ hfsplus-1.0.4/libhfsp/src/volume.c 2005-04-30 12:51:41.000000000 +0100
+@@ -345,7 +345,7 @@ static int volume_readbuf(hfsp_vh* vh, v
+ vh->write_count = bswabU32_inc(p);
+ vh->encodings_bmp = bswabU64_inc(p);
+ memcpy(vh->finder_info, p, 32);
+- ((char*) p) += 32; // finderinfo is not used by now
++ p += 32; // finderinfo is not used by now
+ p = volume_readfork(p, &vh->alloc_file );
+ p = volume_readfork(p, &vh->ext_file );
+ p = volume_readfork(p, &vh->cat_file );
+@@ -381,7 +381,7 @@ static int volume_writebuf(hfsp_vh* vh,
+ bstoreU32_inc(p, vh->write_count );
+ bstoreU64_inc(p, vh->encodings_bmp );
+ memcpy(p, vh->finder_info, 32);
+- ((char*) p) += 32; // finderinfo is not used by now
++ p += 32; // finderinfo is not used by now
+ p = volume_writefork(p, &vh->alloc_file );
+ p = volume_writefork(p, &vh->ext_file );
+ p = volume_writefork(p, &vh->cat_file );
+@@ -417,12 +417,12 @@ static int volume_read_wrapper(volume *
+
+ UInt16 embeds, embedl; /* Start/lenght of embedded area in blocks */
+
+- ((char*) p) += 0x12; /* skip unneeded HFS vol fields */
++ p += 0x12; /* skip unneeded HFS vol fields */
+ drAlBlkSiz = bswabU32_inc(p); /* offset 0x14 */
+- ((char*) p) += 0x4; /* skip unneeded HFS vol fields */
++ p += 0x4; /* skip unneeded HFS vol fields */
+ drAlBlSt = bswabU16_inc(p); /* offset 0x1C */
+
+- ((char*) p) += 0x5E; /* skip unneeded HFS vol fields */
++ p += 0x5E; /* skip unneeded HFS vol fields */
+ signature = bswabU16_inc(p); /* offset 0x7C, drEmbedSigWord */
+ if (signature != HFSP_VOLHEAD_SIG)
+ HFSP_ERROR(-1, "This looks like a normal HFS volume");
diff --git a/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-glob.patch b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-glob.patch
new file mode 100644
index 000000000000..cd92d0a0a86d
--- /dev/null
+++ b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-glob.patch
@@ -0,0 +1,12 @@
+--- src/glob.c.orig 2002-10-09 08:02:31.000000000 -0500
++++ src/glob.c 2002-10-09 08:02:46.000000000 -0500
+@@ -48,7 +48,7 @@
+
+ switch (*pat)
+ {
+- case NULL: // pattern at end
++ case '\0': // pattern at end
+ return (!*str); // String at end ?
+
+ case '*': // match all
+
diff --git a/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-string.patch b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-string.patch
new file mode 100644
index 000000000000..2602876a1127
--- /dev/null
+++ b/sys-fs/hfsplusutils/files/hfsplusutils-1.0.4-string.patch
@@ -0,0 +1,11 @@
+--- libhfsp/src/unicode.c.bak 2007-01-08 17:14:44.000000000 -0500
++++ libhfsp/src/unicode.c 2007-01-08 17:14:52.000000000 -0500
+@@ -16,7 +16,7 @@
+ #include <stdlib.h>
+ #include <endian.h>
+ #include <byteswap.h>
+-#include <linux/string.h>
++#include <string.h>
+
+ #define __USE_GNU
+ /* need wcsrtomb */
diff --git a/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild b/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild
new file mode 100644
index 000000000000..aa6fe7ce9e43
--- /dev/null
+++ b/sys-fs/hfsplusutils/hfsplusutils-1.0.4-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit autotools eutils
+
+MY_P="hfsplus_${PV}"
+DESCRIPTION="HFS+ Filesystem Access Utilities (a PPC filesystem)"
+HOMEPAGE="http://penguinppc.org/historical/hfsplus/"
+SRC_URI="http://penguinppc.org/historical/hfsplus/${MY_P}.src.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc ppc64 x86"
+IUSE=""
+
+DEPEND="app-arch/bzip2"
+RDEPEND=""
+
+S=${WORKDIR}/hfsplus-${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-glob.patch"
+ epatch "${FILESDIR}/${P}-errno.patch"
+ epatch "${FILESDIR}/${P}-gcc4.patch"
+ epatch "${FILESDIR}/${P}-string.patch"
+ #let's avoid the Makefile.cvs since isn't working for us
+ eautoreconf
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+ newman doc/man/hfsp.man hfsp.1
+}
diff --git a/sys-fs/hfsplusutils/metadata.xml b/sys-fs/hfsplusutils/metadata.xml
new file mode 100644
index 000000000000..034c09eb248a
--- /dev/null
+++ b/sys-fs/hfsplusutils/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc</herd>
+</pkgmetadata>
diff --git a/sys-fs/hfsutils/Manifest b/sys-fs/hfsutils/Manifest
new file mode 100644
index 000000000000..99605ba25104
--- /dev/null
+++ b/sys-fs/hfsutils/Manifest
@@ -0,0 +1 @@
+DIST hfsutils-3.2.6.tar.gz 207697 SHA256 bc9d22d6d252b920ec9cdf18e00b7655a6189b3f34f42e58d5bb152957289840 SHA512 0db3050e5969c4e4e6c6ddb10cbc221a5837eb1e12f9331e7129511d31a4ec8d38420ed0b948dadc85ed990f3b1085e930eb7f0c37b3883866d963e47cbbb173 WHIRLPOOL 7e9e42a0ee1fbe8bf7e2deac790892d3ee2fc0b51208b56f6b3a7016ce382c12081ab38dd376edbdc949c212786b317124c447afb613da3b9a7403c0c3020b54
diff --git a/sys-fs/hfsutils/files/hfsutils-3.2.6-errno.patch b/sys-fs/hfsutils/files/hfsutils-3.2.6-errno.patch
new file mode 100644
index 000000000000..6e25f794b220
--- /dev/null
+++ b/sys-fs/hfsutils/files/hfsutils-3.2.6-errno.patch
@@ -0,0 +1,13 @@
+diff -ruN hfsutils.orig/tclhfs.c hfsutils-3.2.6/tclhfs.c
+--- hfsutils.orig/tclhfs.c 2003-03-31 17:34:55.000000000 +0200
++++ hfsutils-3.2.6/tclhfs.c 2003-03-31 17:39:51.000000000 +0200
+@@ -43,8 +43,7 @@
+ # include "charset.h"
+ # include "suid.h"
+ # include "version.h"
+-
+-extern int errno;
++# include <errno.h>
+
+ # define ERROR(code, str) (hfs_error = (str), errno = (code))
+
diff --git a/sys-fs/hfsutils/files/hfsutils-3.2.6-fix-tcl-8.6.patch b/sys-fs/hfsutils/files/hfsutils-3.2.6-fix-tcl-8.6.patch
new file mode 100644
index 000000000000..19f15424543c
--- /dev/null
+++ b/sys-fs/hfsutils/files/hfsutils-3.2.6-fix-tcl-8.6.patch
@@ -0,0 +1,8 @@
+--- hfsutils-3.2.6/config.h.in
++++ hfsutils-3.2.6/config.h.in
+@@ -91,3 +91,5 @@
+ # ifndef HAVE_STRTOL
+ long strtol(const char *, char **, int);
+ # endif
++
++#define USE_INTERP_RESULT 1
diff --git a/sys-fs/hfsutils/files/largerthan2gb.patch b/sys-fs/hfsutils/files/largerthan2gb.patch
new file mode 100644
index 000000000000..a688ff621a30
--- /dev/null
+++ b/sys-fs/hfsutils/files/largerthan2gb.patch
@@ -0,0 +1,14 @@
+--- libhfs/os/unix.c-orig 1998-11-02 23:09:13.000000000 +0100
++++ libhfs/os/unix.c 2004-12-13 14:39:28.099124272 +0100
+@@ -19,6 +19,11 @@
+ * $Id$
+ */
+
++#ifdef __linux__
++#define _FILE_OFFSET_BITS 64
++#define _LARGE_FILES
++#endif
++
+ # ifdef HAVE_CONFIG_H
+ # include "config.h"
+ # endif
diff --git a/sys-fs/hfsutils/hfsutils-3.2.6-r5.ebuild b/sys-fs/hfsutils/hfsutils-3.2.6-r5.ebuild
new file mode 100644
index 000000000000..82c2eab00dd0
--- /dev/null
+++ b/sys-fs/hfsutils/hfsutils-3.2.6-r5.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="HFS FS Access utils"
+HOMEPAGE="http://www.mars.org/home/rob/proj/hfs/"
+SRC_URI="ftp://ftp.mars.org/pub/hfs/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc ppc64 sparc x86"
+IUSE="tcl tk"
+
+DEPEND="
+ tcl? ( dev-lang/tcl:0= )
+ tk? ( dev-lang/tk:0= )"
+RDEPEND="${DEPEND}"
+
+# use tk requires tcl - bug #150437
+REQUIRED_USE="tk? ( tcl )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-errno.patch \
+ "${FILESDIR}"/largerthan2gb.patch \
+ "${FILESDIR}"/${P}-fix-tcl-8.6.patch
+}
+
+src_configure() {
+ econf $(use_with tcl) $(use_with tk)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR) rc" CC="$(tc-getCC)" RANLIB="$(tc-getRANLIB)"
+ emake CC="$(tc-getCC)" -C hfsck
+}
+
+src_install() {
+ dodir /usr/bin /usr/lib /usr/share/man/man1
+ emake \
+ prefix="${D}"/usr \
+ MANDEST="${D}"/usr/share/man \
+ infodir="${D}"/usr/share/info \
+ install
+ dobin hfsck/hfsck
+ dodoc BLURB CHANGES README TODO doc/*.txt
+}
diff --git a/sys-fs/hfsutils/metadata.xml b/sys-fs/hfsutils/metadata.xml
new file mode 100644
index 000000000000..034c09eb248a
--- /dev/null
+++ b/sys-fs/hfsutils/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc</herd>
+</pkgmetadata>
diff --git a/sys-fs/inotify-tools/Manifest b/sys-fs/inotify-tools/Manifest
new file mode 100644
index 000000000000..19a5856ab79f
--- /dev/null
+++ b/sys-fs/inotify-tools/Manifest
@@ -0,0 +1,2 @@
+DIST inotify-tools-3.13.tar.gz 389473 SHA256 464146acec2c118be63a6c2a090d9252fbe9689c093db85b695d0502fa229445 SHA512 e757ca5d3bac2b6b84e9435671107d6d695ff7d04cefd139590ab538d1be8f9a295eb9b0042406bdbfa60bb2b2545a428ec861e60f1cbf172050d47d0350bdb9 WHIRLPOOL 342d2ca503a6f6939ba10dde93937f1bb9b26459e4d5f98948996e59ee124a8a9d9fb0c9988dad8d0e242d3d5478ae3f5c62f975df43076a9f86f94ab8ef9348
+DIST inotify-tools-3.14.tar.gz 358772 SHA256 222bcca8893d7bf8a1ce207fb39ceead5233b5015623d099392e95197676c92f SHA512 6074d510e89bba5da0d7c4d86f2562c662868666ba0a7ea5d73e53c010a0050dd1fc01959b22cffdb9b8a35bd1b0b43c04d02d6f19927520f05889e8a9297dfb WHIRLPOOL fb22537b127ed8c03f4d0501d498c3731d7b85ce688ab8f281c7173d615c876d9ccd77b1d5a2a4effed642cfa30a99738b751608c9f279ce627ae951b41cada4
diff --git a/sys-fs/inotify-tools/inotify-tools-3.13-r1.ebuild b/sys-fs/inotify-tools/inotify-tools-3.13-r1.ebuild
new file mode 100644
index 000000000000..4e52d08f38ab
--- /dev/null
+++ b/sys-fs/inotify-tools/inotify-tools-3.13-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="a set of command-line programs providing a simple interface to inotify"
+HOMEPAGE="https://github.com/rvoicilas/inotify-tools/wiki"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm hppa x86"
+IUSE="doc"
+
+DEPEND="doc? ( app-doc/doxygen )"
+RDEPEND=""
+
+src_prepare() {
+ # timestamps are busted in tarball
+ find . -type f -exec touch -r configure {} +
+}
+
+src_configure() {
+ # only docs installed are doxygen ones, so use /html
+ econf \
+ --docdir=/usr/share/doc/${PF}/html \
+ $(use_enable doc doxygen)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README NEWS AUTHORS ChangeLog
+}
diff --git a/sys-fs/inotify-tools/inotify-tools-3.14.ebuild b/sys-fs/inotify-tools/inotify-tools-3.14.ebuild
new file mode 100644
index 000000000000..7dd8dc6af5d5
--- /dev/null
+++ b/sys-fs/inotify-tools/inotify-tools-3.14.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="a set of command-line programs providing a simple interface to inotify"
+HOMEPAGE="https://github.com/rvoicilas/inotify-tools/wiki"
+SRC_URI="http://github.com/downloads/rvoicilas/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ~mips ~sparc x86"
+IUSE="doc"
+
+DEPEND="doc? ( app-doc/doxygen )"
+RDEPEND=""
+
+src_prepare() {
+ # timestamps are busted in tarball
+ find . -type f -exec touch -r configure {} +
+}
+
+src_configure() {
+ # only docs installed are doxygen ones, so use /html
+ econf \
+ --docdir=/usr/share/doc/${PF}/html \
+ $(use_enable doc doxygen)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README NEWS AUTHORS ChangeLog
+}
diff --git a/sys-fs/inotify-tools/metadata.xml b/sys-fs/inotify-tools/metadata.xml
new file mode 100644
index 000000000000..e91887d4fe6b
--- /dev/null
+++ b/sys-fs/inotify-tools/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <longdescription>
+inotify-tools is a set of command-line programs for Linux providing a simple
+interface to inotify. These programs can be used to monitor and act upon
+filesystem events. Requires a Linux kernel supporting inotify.
+</longdescription>
+ <upstream>
+ <remote-id type="github">downloads/rvoicilas</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/iprutils/Manifest b/sys-fs/iprutils/Manifest
new file mode 100644
index 000000000000..3862039ba6f3
--- /dev/null
+++ b/sys-fs/iprutils/Manifest
@@ -0,0 +1,5 @@
+DIST iprutils-2.3.13-src.tgz 180225 SHA256 a225095819dce9402a24066ee65062ad57e0d9ba7f338477042ad7e45193ae7d SHA512 7c185f05300a25147e2b3a7c2e66be7fd5d8a9d5b2655dd86a1c845b9c71175cf8f211b869836b16c9b93655e701837496d736990f022bbccd5eff0056d1ecf0 WHIRLPOOL caeb901d78cf94b24dc4510a5de8b8a45561e583084f0ee4e22a0f1bf33d5c9f2b7998ef455a8bcacf7f0225495fd9ec6d4abc54259e1f1b5b11a62f50337fea
+DIST iprutils-2.3.18-src.tgz 1384924 SHA256 8e510659e740c00e2200bb3d1726c3bbe0c0f93e1c4320a63c007ff5ceceffa3 SHA512 230722556c080b6784574f05066230cfd932e0fb9812a19ec6d911f2b281b6a52b15dd4084c7dc29c2004edbfcc6e4b94080a6f0869746a9021116949ec318e0 WHIRLPOOL 88bb686c3128806a77b55a9a871c95c63fc31a3d24046f8ac519a04204e6ec3ce1a74c259322762ab3f1f35204a0938c11cb6af496da2f80bbfe78864d5c3603
+DIST iprutils-2.3.9-src.tgz 169854 SHA256 9d56d058dc377ec21323e6a8710742168f5d2148d13dc249021f7123b8ba360f SHA512 d9b05d070941970827140ef6b2b69d2566f862b06e85c91ceec2561dfb08c4c428fd3fafe36657acb7481f2f7c695d355cd1b43f60ad241275facd6bb8d43535 WHIRLPOOL 7f21d6212465338f93f97e0ee7a521065923a57ce9c28b266e7f8929927e0a4bb2d6dd2f89af9bbb8c43c8ad2498abd8a3370d8b7fdf72b1bc0725617f097162
+DIST iprutils-2.4.7.tar.gz 467671 SHA256 bb3a729b35824428d9a7d4db0a25d5ec89ff1dfcc13dd3c62fe254dc56408dd0 SHA512 9e6fd37cb72ce1d092b02f1cdfeb9e97962007327f92f4d9dd2a755489dab3a5d51a459d2f256d8453de74935a5cee8f25f71a820d82347ae67aa72a89043a91 WHIRLPOOL 190a906a91114f56b434e9efb657f9b3ba8a6b145715934f20919dc18521ee696604403134d35a5196c0d8d823c32b5f9e08aaa40bacddebeb42e5dae7ceab02
+DIST iprutils-2.4.8.tar.gz 474447 SHA256 fbd118344b5f7e0acfdadff8093043dee70ad88b58cb3d8ea53e005a3d2b5a17 SHA512 08086058d80b46a58d7d35676645160c7058e88e7d7e61fac36a8565b6ad3a42b0f6e1fe3238de7017ec2b53f1aa93b427bb7113c0c0b21fb148f22fc5a2b6a5 WHIRLPOOL 5f06cd2fab55cac77c212d3693bf3bcea41f1747d6e63c4a24d16ab781da2067163b0e21dfb83eb8cca767bc7458491a0b48b2d859c5e8ea46a59defad5347b9
diff --git a/sys-fs/iprutils/files/iprdump b/sys-fs/iprutils/files/iprdump
new file mode 100755
index 000000000000..2801b8f1ad25
--- /dev/null
+++ b/sys-fs/iprutils/files/iprdump
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+
+depend() {
+ need logger iprinit
+}
+
+start() {
+ ebegin "Starting the ipr dump daemon"
+ start-stop-daemon --start --quiet --exec /sbin/iprdump
+
+}
+
+stop() {
+ ebegin "Stopping the ipr dump daemon"
+ start-stop-daemon --stop --name iprdump
+}
diff --git a/sys-fs/iprutils/files/iprdump-r1 b/sys-fs/iprutils/files/iprdump-r1
new file mode 100755
index 000000000000..66c1e4c81928
--- /dev/null
+++ b/sys-fs/iprutils/files/iprdump-r1
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+
+depend() {
+ need logger iprinit
+}
+
+start() {
+ ebegin "Starting the ipr dump daemon"
+ start-stop-daemon --start --quiet --exec /usr/sbin/iprdump -- --daemon
+
+}
+
+stop() {
+ ebegin "Stopping the ipr dump daemon"
+ start-stop-daemon --stop --name iprdump
+}
diff --git a/sys-fs/iprutils/files/iprinit b/sys-fs/iprutils/files/iprinit
new file mode 100755
index 000000000000..bd54d9918992
--- /dev/null
+++ b/sys-fs/iprutils/files/iprinit
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+
+depend() {
+ need logger
+}
+
+
+start() {
+ ebegin "Starting ipr initialization daemon"
+
+ if [ ! -d /sys/class/scsi_generic ] ; then
+ /sbin/modprobe sg
+ fi
+ start-stop-daemon --start --quiet --exec /sbin/iprinit -- --daemon
+}
+
+stop() {
+ ebegin "Shutting down ipr initialization daemon"
+ start-stop-daemon --stop --name iprinit
+}
diff --git a/sys-fs/iprutils/files/iprinit-r1 b/sys-fs/iprutils/files/iprinit-r1
new file mode 100755
index 000000000000..892e287f605c
--- /dev/null
+++ b/sys-fs/iprutils/files/iprinit-r1
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+
+depend() {
+ need logger
+}
+
+
+start() {
+ ebegin "Starting ipr initialization daemon"
+
+ if [ ! -d /sys/class/scsi_generic ] ; then
+ /sbin/modprobe sg
+ fi
+ start-stop-daemon --start --quiet --exec /usr/sbin/iprinit -- --daemon
+}
+
+stop() {
+ ebegin "Shutting down ipr initialization daemon"
+ start-stop-daemon --stop --name iprinit
+}
diff --git a/sys-fs/iprutils/files/iprupdate b/sys-fs/iprutils/files/iprupdate
new file mode 100755
index 000000000000..9aba8fee8303
--- /dev/null
+++ b/sys-fs/iprutils/files/iprupdate
@@ -0,0 +1,11 @@
+#!/sbin/runscript
+
+depend() {
+ need logger iprinit
+}
+
+start() {
+ ebegin "Checking ipr microcode levels"
+ /sbin/iprupdate 2>&1 > /dev/null
+ eend $? "Failed to complete ipr microcode updates"
+}
diff --git a/sys-fs/iprutils/files/iprupdate-r1 b/sys-fs/iprutils/files/iprupdate-r1
new file mode 100755
index 000000000000..48a63e8e2dcf
--- /dev/null
+++ b/sys-fs/iprutils/files/iprupdate-r1
@@ -0,0 +1,11 @@
+#!/sbin/runscript
+
+depend() {
+ need logger iprinit
+}
+
+start() {
+ ebegin "Checking ipr microcode levels"
+ /usr/sbin/iprupdate 2>&1 > /dev/null
+ eend $? "Failed to complete ipr microcode updates"
+}
diff --git a/sys-fs/iprutils/files/iprutils-2.4.7-tinfo.patch b/sys-fs/iprutils/files/iprutils-2.4.7-tinfo.patch
new file mode 100644
index 000000000000..406f3efff2a7
--- /dev/null
+++ b/sys-fs/iprutils/files/iprutils-2.4.7-tinfo.patch
@@ -0,0 +1,14 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -30,7 +30,10 @@
+ AC_CHECK_LIB([menu], [new_menu], [], [AC_ERROR("libmenu not found.")])
+ AC_CHECK_LIB([panel], [show_panel], [], [AC_ERROR("libpanel not found.")])
+ AC_CHECK_LIB([ncurses], [curses_version], [],
+- [AC_ERROR("libncurses not found.")])
++ AC_CHECK_LIB([tinfo], [curses_version], [],
++ [AC_ERROR("libncurses not found.")]))
++AC_CHECK_LIB([ncurses], [wnoutrefresh], [],
++ [AC_ERROR("libncurses not found.")])
+
+ # Checks for header files.
+ AC_CHECK_HEADERS([fcntl.h libintl.h locale.h netinet/in.h nl_types.h \
diff --git a/sys-fs/iprutils/files/iprutils-2.4.8-tinfo.patch b/sys-fs/iprutils/files/iprutils-2.4.8-tinfo.patch
new file mode 100644
index 000000000000..29930b76387e
--- /dev/null
+++ b/sys-fs/iprutils/files/iprutils-2.4.8-tinfo.patch
@@ -0,0 +1,14 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -51,7 +51,10 @@
+
+ save_LIBS="$LIBS"
+ AC_CHECK_LIB([ncurses], [curses_version], [],
+- [AC_ERROR("libncurses not found.")])
++ AC_CHECK_LIB([tinfo], [curses_version], [],
++ [AC_ERROR("libncurses not found.")]))
++AC_CHECK_LIB([ncurses], [wnoutrefresh], [],
++ [AC_ERROR("libncurses not found.")])
+ AC_CHECK_LIB([form], [free_form], [], [AC_ERROR("libform not found.")])
+ AC_CHECK_LIB([m], [matherr], [], [AC_ERROR("libm not found.")])
+ AC_CHECK_LIB([menu], [new_menu], [], [AC_ERROR("libmenu not found.")])
diff --git a/sys-fs/iprutils/iprutils-2.3.13.ebuild b/sys-fs/iprutils/iprutils-2.3.13.ebuild
new file mode 100644
index 000000000000..e62ce44af247
--- /dev/null
+++ b/sys-fs/iprutils/iprutils-2.3.13.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+S=${WORKDIR}/${PN}
+DESCRIPTION="IBM's tools for support of the ipr SCSI controller"
+SRC_URI="mirror://sourceforge/iprdd/${P}-src.tgz"
+HOMEPAGE="http://sourceforge.net/projects/iprdd/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+
+DEPEND=">=sys-libs/ncurses-5.4-r5
+ >=sys-apps/pciutils-2.1.11-r1
+ >=sys-fs/sysfsutils-1.3.0
+ virtual/udev"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_install () {
+ make INSTALL_MOD_PATH="${D}" install || die
+ dodoc ChangeLog
+
+ newinitd "${FILESDIR}"/iprinit iprinit
+ newinitd "${FILESDIR}"/iprupdate iprupdate
+ newinitd "${FILESDIR}"/iprdump iprdump
+}
+
+pkg_postinst() {
+ einfo "This package also contains several init.d files. "
+ einfo "You should add them to your default runlevels as follows:"
+ einfo "rc-update add iprinit default"
+ einfo "rc-update add iprdump default"
+ einfo "rc-update add iprupdate default"
+ ebeep 5
+}
diff --git a/sys-fs/iprutils/iprutils-2.3.18.ebuild b/sys-fs/iprutils/iprutils-2.3.18.ebuild
new file mode 100644
index 000000000000..574a2150c4cc
--- /dev/null
+++ b/sys-fs/iprutils/iprutils-2.3.18.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="IBM's tools for support of the ipr SCSI controller"
+SRC_URI="mirror://sourceforge/iprdd/${P}-src.tgz"
+HOMEPAGE="http://sourceforge.net/projects/iprdd/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+
+DEPEND=">=sys-libs/ncurses-5.4-r5
+ >=sys-apps/pciutils-2.1.11-r1
+ >=sys-fs/sysfsutils-1.3.0
+ virtual/udev"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ # Respect CFLAGS and LDFLAGS, bug #377757
+ sed -i \
+ -e '/^CFLAGS/s/= -g/+=/' \
+ -e 's/$(CFLAGS)/\0 $(LDFLAGS)/g' \
+ Makefile || die
+
+ epatch_user
+}
+
+src_compile() {
+ # Respect CC, bug #377757
+ emake CC="$(tc-getCC)"
+}
+
+src_install () {
+ emake INSTALL_MOD_PATH="${D}" install
+
+ newinitd "${FILESDIR}"/iprinit iprinit
+ newinitd "${FILESDIR}"/iprupdate iprupdate
+ newinitd "${FILESDIR}"/iprdump iprdump
+}
+
+pkg_postinst() {
+ einfo "This package also contains several init.d files. "
+ einfo "You should add them to your default runlevels as follows:"
+ einfo "rc-update add iprinit default"
+ einfo "rc-update add iprdump default"
+ einfo "rc-update add iprupdate default"
+}
diff --git a/sys-fs/iprutils/iprutils-2.3.9.ebuild b/sys-fs/iprutils/iprutils-2.3.9.ebuild
new file mode 100644
index 000000000000..d28ed6c714c0
--- /dev/null
+++ b/sys-fs/iprutils/iprutils-2.3.9.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+S=${WORKDIR}/${PN}
+DESCRIPTION="IBM's tools for support of the ipr SCSI controller"
+SRC_URI="mirror://sourceforge/iprdd/${P}-src.tgz"
+HOMEPAGE="http://sourceforge.net/projects/iprdd/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+
+DEPEND=">=sys-libs/ncurses-5.4-r5
+ >=sys-apps/pciutils-2.1.11-r1
+ >=sys-fs/sysfsutils-1.3.0
+ virtual/udev"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_install () {
+ make INSTALL_MOD_PATH="${D}" install || die
+ dodoc ChangeLog
+
+ newinitd "${FILESDIR}"/iprinit iprinit
+ newinitd "${FILESDIR}"/iprupdate iprupdate
+ newinitd "${FILESDIR}"/iprdump iprdump
+}
+
+pkg_postinst() {
+ einfo "This package also contains several init.d files. "
+ einfo "You should add them to your default runlevels as follows:"
+ einfo "rc-update add iprinit default"
+ einfo "rc-update add iprdump default"
+ einfo "rc-update add iprupdate default"
+ ebeep 5
+}
diff --git a/sys-fs/iprutils/iprutils-2.4.7.ebuild b/sys-fs/iprutils/iprutils-2.4.7.ebuild
new file mode 100644
index 000000000000..8e47de291b45
--- /dev/null
+++ b/sys-fs/iprutils/iprutils-2.4.7.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="IBM's tools for support of the ipr SCSI controller"
+SRC_URI="mirror://sourceforge/iprdd/${P}.tar.gz"
+HOMEPAGE="http://sourceforge.net/projects/iprdd/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ~ppc64"
+IUSE="static-libs"
+
+DEPEND="
+ >=sys-libs/ncurses-5.4-r5
+ >=sys-apps/pciutils-2.1.11-r1
+ virtual/udev
+"
+RDEPEND="
+ ${DEPEND}
+ virtual/logger
+"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.4.7-tinfo.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install () {
+ default
+
+ newinitd "${FILESDIR}"/iprinit-r1 iprinit
+ newinitd "${FILESDIR}"/iprupdate-r1 iprupdate
+ newinitd "${FILESDIR}"/iprdump-r1 iprdump
+
+ prune_libtool_files
+}
diff --git a/sys-fs/iprutils/iprutils-2.4.8-r1.ebuild b/sys-fs/iprutils/iprutils-2.4.8-r1.ebuild
new file mode 100644
index 000000000000..52fff2c51c53
--- /dev/null
+++ b/sys-fs/iprutils/iprutils-2.4.8-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils toolchain-funcs
+
+DESCRIPTION="IBM's tools for support of the ipr SCSI controller"
+SRC_URI="mirror://sourceforge/iprdd/${P}.tar.gz"
+HOMEPAGE="http://sourceforge.net/projects/iprdd/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE="static-libs"
+
+IPRUTILS_DEPEND="
+ >=sys-libs/ncurses-5.4-r5
+ >=sys-apps/pciutils-2.1.11-r1
+"
+RDEPEND="
+ ${IPRUTILS_DEPEND}
+ virtual/logger
+ virtual/udev
+"
+DEPEND="
+ ${IPRUTILS_DEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.4.8-tinfo.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install () {
+ emake DESTDIR="${D}" \
+ bashcompdir=$(get_bashcompdir) install
+
+ newinitd "${FILESDIR}"/iprinit-r1 iprinit
+ newinitd "${FILESDIR}"/iprupdate-r1 iprupdate
+ newinitd "${FILESDIR}"/iprdump-r1 iprdump
+
+ prune_libtool_files
+}
diff --git a/sys-fs/iprutils/metadata.xml b/sys-fs/iprutils/metadata.xml
new file mode 100644
index 000000000000..fc39b7328154
--- /dev/null
+++ b/sys-fs/iprutils/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ppc64</herd>
+ <upstream>
+ <remote-id type="sourceforge">iprdd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/jdiskreport-bin/Manifest b/sys-fs/jdiskreport-bin/Manifest
new file mode 100644
index 000000000000..e7e436537ed4
--- /dev/null
+++ b/sys-fs/jdiskreport-bin/Manifest
@@ -0,0 +1,3 @@
+DIST jdiskreport-1_2_5.zip 613585 SHA256 30efef5f5e75ed6f51a9a3973711960c5eccae503edcf00f728948d6b19b12d2 SHA512 d23641610a9fba6b7b2c5d529244229e807d89bd2b4c339e59522547f3b45a32415d6819a4ee8d5bd4a8789ea4610887428bfd5a5a4c56b11911da035a560993 WHIRLPOOL 8c2f13ca29e4184117cd20a684b8e9d7ab60abeeaab260b5d8dbeb5430013543c8ca872814c2c23da5f74e0e932ff6da4e287e867a556918fb4620d7dde779ff
+DIST jdiskreport-1_3_0.zip 650433 SHA256 abc308ef722023db5384cb98d251e4e458ab4f794c4fc2138a86e177d2c1f1ed SHA512 9d57e7db810117a27c1d8d2aef40113652f25055e3512500fdf5f8806b1d68f4be8b4231e281d690108301afde3cc6b70f061c71d3fafef06689ca3228dd44ea WHIRLPOOL a39b9843a5a1e456e621b50c4967be2905755addcff0cf80e79baea88efbb628d6f1a48537ac9f1bedb2d87d9f0a067d8e921ea5f87619c4227da9d12c4a16b4
+DIST jdiskreport-1_4_1.zip 864613 SHA256 a834d3b50bcba0711caff7284103c16025c03057ea6ebfc34a3ac1a5f9fcb534 SHA512 c1e17bdaab739561ae46475d69805e18be271a0d41b555e981cde59091d6c46fe3cf6775bdd992200edbb4646b7a04003a6b67bfedc18161952a20e47b18ea38 WHIRLPOOL 07266fc401ce0c0d74cf30b96974119c3277bdad0971f9ca66347d2d15052e0cba58072572b4b8615762c72fcffd5a0a71df876454dd0d1683ce06502328f513
diff --git a/sys-fs/jdiskreport-bin/jdiskreport-bin-1.2.5-r1.ebuild b/sys-fs/jdiskreport-bin/jdiskreport-bin-1.2.5-r1.ebuild
new file mode 100644
index 000000000000..e4e96d85c586
--- /dev/null
+++ b/sys-fs/jdiskreport-bin/jdiskreport-bin-1.2.5-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit java-pkg-2
+
+MY_PN=${PN/-bin/}
+MY_PV=${PV//\./_}
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="JDiskReport helps you to understand disk drive usage"
+HOMEPAGE="http://www.jgoodies.com/freeware/jdiskreport/"
+SRC_URI="http://www.jgoodies.com/download/${MY_PN}/${MY_P}.zip"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND=">=virtual/jre-1.4"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ java-pkg_newjar ${MY_PN}-${PV}.jar
+ java-pkg_dolauncher ${MY_PN}
+
+ dodoc README.txt RELEASE-NOTES.txt || die
+}
diff --git a/sys-fs/jdiskreport-bin/jdiskreport-bin-1.3.0.ebuild b/sys-fs/jdiskreport-bin/jdiskreport-bin-1.3.0.ebuild
new file mode 100644
index 000000000000..e4e96d85c586
--- /dev/null
+++ b/sys-fs/jdiskreport-bin/jdiskreport-bin-1.3.0.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit java-pkg-2
+
+MY_PN=${PN/-bin/}
+MY_PV=${PV//\./_}
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="JDiskReport helps you to understand disk drive usage"
+HOMEPAGE="http://www.jgoodies.com/freeware/jdiskreport/"
+SRC_URI="http://www.jgoodies.com/download/${MY_PN}/${MY_P}.zip"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND=">=virtual/jre-1.4"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ java-pkg_newjar ${MY_PN}-${PV}.jar
+ java-pkg_dolauncher ${MY_PN}
+
+ dodoc README.txt RELEASE-NOTES.txt || die
+}
diff --git a/sys-fs/jdiskreport-bin/jdiskreport-bin-1.4.1.ebuild b/sys-fs/jdiskreport-bin/jdiskreport-bin-1.4.1.ebuild
new file mode 100644
index 000000000000..3ba865fc2db9
--- /dev/null
+++ b/sys-fs/jdiskreport-bin/jdiskreport-bin-1.4.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit java-pkg-2
+
+MY_PN=${PN/-bin/}
+MY_PV=${PV//\./_}
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="JDiskReport helps you to understand disk drive usage"
+HOMEPAGE="http://www.jgoodies.com/freeware/jdiskreport/"
+SRC_URI="http://www.jgoodies.com/download/${MY_PN}/${MY_P}.zip"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/unzip"
+RDEPEND=">=virtual/jre-1.6"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+src_install() {
+ java-pkg_newjar ${MY_PN}-${PV}.jar
+ java-pkg_dolauncher ${MY_PN}
+
+ dodoc README.txt RELEASE-NOTES.txt || die
+}
diff --git a/sys-fs/jdiskreport-bin/metadata.xml b/sys-fs/jdiskreport-bin/metadata.xml
new file mode 100644
index 000000000000..da3a594a0008
--- /dev/null
+++ b/sys-fs/jdiskreport-bin/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <longdescription lang="en">
+ JDiskReport enables you to understand how much space the files and
+ directories consume on your disk drives, and it helps you find obsolete
+ files and folders.
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-fs/jfsutils/Manifest b/sys-fs/jfsutils/Manifest
new file mode 100644
index 000000000000..a80227235735
--- /dev/null
+++ b/sys-fs/jfsutils/Manifest
@@ -0,0 +1 @@
+DIST jfsutils-1.1.15.tar.gz 539148 SHA256 244a15f64015ce3ea17e49bdf6e1a0fb4f9af92b82fa9e05aa64cb30b5f07a4d SHA512 fa8ba7f4997471da3e6ea7239564f3395046222cfbb2b10e37b24ad0bd107b7eadbb51ce328d89d193034360b4035ca5e0e5b0b416a74483d7a2c0a2b9c65858 WHIRLPOOL 8a62c037601999f616041250e06adc10fceb48fc80b319003383ac08b2e1fbb2aaaca781848be2845d6e99f05d1d7a884f9af89e2a6236d64cc4387be02222e8
diff --git a/sys-fs/jfsutils/files/jfsutils-1.1.15-linux-headers.patch b/sys-fs/jfsutils/files/jfsutils-1.1.15-linux-headers.patch
new file mode 100644
index 000000000000..b3570107c57d
--- /dev/null
+++ b/sys-fs/jfsutils/files/jfsutils-1.1.15-linux-headers.patch
@@ -0,0 +1,12 @@
+Index: jfsutils-1.1.15/libfs/devices.h
+===================================================================
+--- jfsutils-1.1.15.orig/libfs/devices.h
++++ jfsutils-1.1.15/libfs/devices.h
+@@ -42,6 +42,7 @@
+
+ struct stat;
+
++#include <stdint.h>
+ int ujfs_get_dev_size(FILE *, int64_t * size);
+ int ujfs_rw_diskblocks(FILE *, int64_t, int32_t, void *, int32_t);
+ int ujfs_flush_dev(FILE *);
diff --git a/sys-fs/jfsutils/jfsutils-1.1.15.ebuild b/sys-fs/jfsutils/jfsutils-1.1.15.ebuild
new file mode 100644
index 000000000000..7080e0df034a
--- /dev/null
+++ b/sys-fs/jfsutils/jfsutils-1.1.15.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="IBM's Journaling Filesystem (JFS) Utilities"
+HOMEPAGE="http://jfs.sourceforge.net/"
+SRC_URI="http://jfs.sourceforge.net/project/pub/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh ~sparc x86"
+IUSE="static"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-linux-headers.patch
+}
+
+src_configure() {
+ # It doesn't compile on alpha without this LDFLAGS
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ use static && append-ldflags -static
+ econf --sbindir=/sbin
+}
+
+src_install () {
+ default
+
+ rm -f "${ED}"/sbin/{mkfs,fsck}.jfs || die
+ dosym /sbin/jfs_mkfs /sbin/mkfs.jfs
+ dosym /sbin/jfs_fsck /sbin/fsck.jfs
+}
diff --git a/sys-fs/jfsutils/metadata.xml b/sys-fs/jfsutils/metadata.xml
new file mode 100644
index 000000000000..67e7fd658cef
--- /dev/null
+++ b/sys-fs/jfsutils/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <longdescription>
+ Utilities for working with IBM's journaled file system
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-fs/jmtpfs/Manifest b/sys-fs/jmtpfs/Manifest
new file mode 100644
index 000000000000..b489e2624845
--- /dev/null
+++ b/sys-fs/jmtpfs/Manifest
@@ -0,0 +1 @@
+DIST jmtpfs-0.5.tar.gz 142914 SHA256 c0cacc4751c586a3b2b0fcd9c98dae4810a5d44f3eb9d2870868a15eeb696883 SHA512 1997d202199af59ae2138701855864e4dab624fff4feac08ea98e3e4ed6c39e4181d8f9fec35db0e83570f48de204f3d00e1b0d2244ec677f77a99b1dc9c38b3 WHIRLPOOL 041ab7f515abe66bd6141a085e13151c8754b18cb490ebd6ced7f7400e2f94047a4c4ff5044c9db5b7a0b08bcdad220f19636df8997acce11ceb4daa170a11f5
diff --git a/sys-fs/jmtpfs/jmtpfs-0.5.ebuild b/sys-fs/jmtpfs/jmtpfs-0.5.ebuild
new file mode 100644
index 000000000000..c570f746ef2d
--- /dev/null
+++ b/sys-fs/jmtpfs/jmtpfs-0.5.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+
+DESCRIPTION="A FUSE and libmtp based filesystem for accessing MTP devices"
+HOMEPAGE="https://github.com/JasonFerrara/jmtpfs"
+SRC_URI="${HOMEPAGE}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+ >=media-libs/libmtp-1.1.6
+ sys-fs/fuse
+"
+DEPEND="
+ ${RDEPEND}
+ virtual/pkgconfig
+"
+
+DOCS=(AUTHORS NEWS README)
+
+src_prepare() {
+ eautoreconf
+}
diff --git a/sys-fs/jmtpfs/metadata.xml b/sys-fs/jmtpfs/metadata.xml
new file mode 100644
index 000000000000..d05888e6e512
--- /dev/null
+++ b/sys-fs/jmtpfs/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jer@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">JasonFerrara/jmtpfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/ldapfuse/Manifest b/sys-fs/ldapfuse/Manifest
new file mode 100644
index 000000000000..946b5eae8117
--- /dev/null
+++ b/sys-fs/ldapfuse/Manifest
@@ -0,0 +1 @@
+DIST ldapfuse-1.0.tar.xz 76024 SHA256 8ef6d5d423bf798fcd1361a1c14f4972b264eae331f6683503ec76910c660f27
diff --git a/sys-fs/ldapfuse/ldapfuse-1.0.ebuild b/sys-fs/ldapfuse/ldapfuse-1.0.ebuild
new file mode 100644
index 000000000000..06af88a73c1e
--- /dev/null
+++ b/sys-fs/ldapfuse/ldapfuse-1.0.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="A virtual filesystem for FUSE which allows navigation of an LDAP tree"
+HOMEPAGE="http://sourceforge.net/projects/ldapfuse/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="net-nds/openldap
+ sys-fs/fuse
+ >=sys-libs/libhx-3.12"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+
+DOCS=( doc/changelog.txt doc/rfcs.txt )
diff --git a/sys-fs/ldapfuse/metadata.xml b/sys-fs/ldapfuse/metadata.xml
new file mode 100644
index 000000000000..a4b9a4576cc9
--- /dev/null
+++ b/sys-fs/ldapfuse/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">ldapfuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/lde/Manifest b/sys-fs/lde/Manifest
new file mode 100644
index 000000000000..6097e8f9e6aa
--- /dev/null
+++ b/sys-fs/lde/Manifest
@@ -0,0 +1 @@
+DIST lde-2.6.1.tar.gz 598050 SHA256 d987555145a05d7b8c9f65e3f0f9754da1c29cc9933597d1765117b7ef3b0694
diff --git a/sys-fs/lde/files/lde-2.6.1-no-shadowing.patch b/sys-fs/lde/files/lde-2.6.1-no-shadowing.patch
new file mode 100644
index 000000000000..586bbf3e8768
--- /dev/null
+++ b/sys-fs/lde/files/lde-2.6.1-no-shadowing.patch
@@ -0,0 +1,39 @@
+rename daylight to avoid shadowing the daylight function and pissing off gcc
+
+http://bugs.gentoo.org/141881
+
+--- lde/src/swiped/cnews/getdate.y
++++ lde/src/swiped/cnews/getdate.y
+@@ -24,7 +24,7 @@
+
+ static int timeflag, dateflag, dayflag, relflag;
+ static time_t relsec, relmonth;
+- static int hh, mm, ss, merid, daylight;
++ static int hh, mm, ss, merid, foo_daylight;
+ static int dayord, dayreq;
+ static int month, day, year;
+ static int ourzone;
+@@ -68,19 +68,19 @@
+ {hh = $1; mm = $3; merid = $4;}
+ | NUMBER ':' NUMBER NUMBER
+ {hh = $1; mm = $3; merid = 24;
+- daylight = STANDARD; ourzone = $4%100 + 60*$4/100;}
++ foo_daylight = STANDARD; ourzone = $4%100 + 60*$4/100;}
+ | NUMBER ':' NUMBER ':' NUMBER
+ {hh = $1; mm = $3; ss = $5; merid = 24;}
+ | NUMBER ':' NUMBER ':' NUMBER MERIDIAN
+ {hh = $1; mm = $3; ss = $5; merid = $6;}
+ | NUMBER ':' NUMBER ':' NUMBER NUMBER
+ {hh = $1; mm = $3; ss = $5; merid = 24;
+- daylight = STANDARD; ourzone = $6%100 + 60*$6/100;};
++ foo_daylight = STANDARD; ourzone = $6%100 + 60*$6/100;};
+
+ zone: ZONE
+- {ourzone = $1; daylight = STANDARD;}
++ {ourzone = $1; foo_daylight = STANDARD;}
+ | DAYZONE
+- {ourzone = $1; daylight = DAYLIGHT;};
++ {ourzone = $1; foo_daylight = DAYLIGHT;};
+
+ dyspec: DAY
+ {dayord = 1; dayreq = $1;}
diff --git a/sys-fs/lde/lde-2.6.1.ebuild b/sys-fs/lde/lde-2.6.1.ebuild
new file mode 100644
index 000000000000..c80084b73f4f
--- /dev/null
+++ b/sys-fs/lde/lde-2.6.1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="ext2fs and minix disk editor for linux"
+HOMEPAGE="http://lde.sourceforge.net/"
+SRC_URI="mirror://sourceforge/lde/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="${RDEPEND}
+ dev-util/yacc"
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-no-shadowing.patch #141881
+}
+
+src_install() {
+ into /
+ dosbin lde || die
+ newman doc/lde.man lde.8
+ dodoc WARNING README TODO
+}
diff --git a/sys-fs/lde/metadata.xml b/sys-fs/lde/metadata.xml
new file mode 100644
index 000000000000..3a3de5497390
--- /dev/null
+++ b/sys-fs/lde/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">lde</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/lessfs/Manifest b/sys-fs/lessfs/Manifest
new file mode 100644
index 000000000000..b1fdfadf4a10
--- /dev/null
+++ b/sys-fs/lessfs/Manifest
@@ -0,0 +1,2 @@
+DIST lessfs-1.5.13.tar.gz 506221 SHA256 eba0ec05d4586d8741776dc96ca9369a9544fb8b8998d5c692da331ddf4ba7f2 SHA512 7143b7e1df8e059184d003be6519cac323fa035a6d9005b4e007504328d58624232ff9a494ecf11d445977f9138e7c41492d7fd30721065e5293927f85585604 WHIRLPOOL 2ef56b0057178678e280b65d458aa6c216c16e84b9524be8bfe66c2da0778f4ca89dd991dc4644f31fbb432621c4e08575d8191ccfc3f8197834a5096440d813
+DIST lessfs-1.7.0.tar.gz 514667 SHA256 d5782ab88ca79bf8f7d790d440f30e3979ec8ecad2a8eae75d33260bfadc8711 SHA512 a868b28159fbcd2e7672607d46e3007c7b959bd8c8880b6c98cdab6c61fd104ac222e156f543c2b3e9f9d9fe2f1879c2988ee80605946f03b646481e7c6f15d1 WHIRLPOOL bee790252b5a0ce5b71621c65e5454334ef55f003e55c7b7a96acafec11281606c50820e7d3ed68675255953b2f479881d329e351e79684a057a6e6433036ee8
diff --git a/sys-fs/lessfs/lessfs-1.5.13.ebuild b/sys-fs/lessfs/lessfs-1.5.13.ebuild
new file mode 100644
index 000000000000..310c1711e43d
--- /dev/null
+++ b/sys-fs/lessfs/lessfs-1.5.13.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit readme.gentoo
+
+MY_PV="${PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="A high performance inline data deduplicating filesystem"
+HOMEPAGE="http://www.lessfs.com"
+SRC_URI="mirror://sourceforge/${PN}/${PN}/${MY_P}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="berkdb crypt debug filelog memtrace lzo"
+
+DEPEND="berkdb? ( sys-libs/db )
+ >=dev-db/tokyocabinet-1.4.42
+ app-crypt/mhash
+ >=sys-fs/fuse-2.8.0
+ crypt? ( dev-libs/openssl )
+ lzo? ( dev-libs/lzo )"
+
+RDEPEND=""
+
+S="${WORKDIR}/${MY_P}"
+
+DOC_CONTENTS="Default configuration file: /etc/${PN}.cfg.
+ If your host is a client consult the following configuration
+ file: /usr/share/doc/${PF}/${PN}.cfg-slave.*"
+
+src_configure() {
+ econf \
+ $(use_enable debug) $(use_enable debug lckdebug) \
+ $(use_enable filelog) $(use_with crypt crypto) \
+ $(use_with lzo) $(use_enable memtrace) \
+ $(use_with berkdb berkeleydb)
+}
+
+src_install () {
+ emake DESTDIR="${D}" install
+ dodoc ChangeLog FAQ README.*
+ insinto /etc
+ newins examples/lessfs.cfg-master ${PN}.cfg
+ dodoc examples/lessfs.* etc/lessfs.*
+ readme.gentoo_create_doc
+}
diff --git a/sys-fs/lessfs/lessfs-1.7.0.ebuild b/sys-fs/lessfs/lessfs-1.7.0.ebuild
new file mode 100644
index 000000000000..99fe01fe5e4b
--- /dev/null
+++ b/sys-fs/lessfs/lessfs-1.7.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit readme.gentoo
+
+MY_PV="${PV/_/-}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="A high performance inline data deduplicating filesystem"
+HOMEPAGE="http://www.lessfs.com"
+SRC_URI="mirror://sourceforge/${PN}/${PN}/${MY_P}/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="berkdb crypt debug filelog memtrace lzo snappy"
+
+DEPEND="berkdb? ( sys-libs/db )
+ crypt? ( dev-libs/openssl )
+ lzo? ( dev-libs/lzo )
+ snappy? ( app-arch/snappy )
+ >=dev-db/tokyocabinet-1.4.42
+ app-crypt/mhash
+ >=sys-fs/fuse-2.8.0"
+
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+DOC_CONTENTS="Default configuration file: /etc/${PN}.cfg.
+ If your host is a client consult the following configuration
+ file: /usr/share/doc/${PF}/${PN}.cfg-slave.*"
+
+src_configure() {
+ econf \
+ $(use_enable debug) $(use_enable debug lckdebug) \
+ $(use_enable filelog) $(use_with crypt crypto) \
+ $(use_with lzo) $(use_enable memtrace) \
+ $(use_with berkdb berkeleydb) \
+ $(use_with snappy)
+}
+
+src_install () {
+ emake DESTDIR="${D}" install
+ dodoc ChangeLog FAQ README.*
+ insinto /etc
+ newins examples/lessfs.cfg-master ${PN}.cfg
+ dodoc examples/lessfs.* etc/lessfs.*
+ readme.gentoo_create_doc
+}
diff --git a/sys-fs/lessfs/metadata.xml b/sys-fs/lessfs/metadata.xml
new file mode 100644
index 000000000000..e6b229aec935
--- /dev/null
+++ b/sys-fs/lessfs/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <use>
+ <flag name="filelog">Enable the ability to log to a file instead of syslog</flag>
+ <flag name="memtrace">Enable leefs to create a report regarding the memory allocation. This feature should be used for debugging purposes to avoid performance degradation</flag>
+ <flag name="snappy">Enable snappy compression using the <pkg>app-arch/snappy</pkg> library</flag>
+ </use>
+ <longdescription lang="en">
+Data deduplication (often called “intelligent compression” or “single-instance storage”) is a method of reducing storage needs by eliminating redundant data. Data deduplication is often used for backup purposes and for virtual machine image storage. lessfs can determine if data is redundant by calculating a unique (192 bit) tiger hash of each block of data that is written. When lessfs has determined that a block of data needs to be stored it first compresses the block with LZO or QUICKLZ compression. The combination of these two techniques results in a very high overall compression rate for many types of data. Multimedia files like mp3, avi or jpg files can not be compressed by lessfs when they are only stored once on the filesystem.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">lessfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/libeatmydata/Manifest b/sys-fs/libeatmydata/Manifest
new file mode 100644
index 000000000000..f24deedf6065
--- /dev/null
+++ b/sys-fs/libeatmydata/Manifest
@@ -0,0 +1,3 @@
+DIST libeatmydata-105.tar.gz 419427 SHA256 bdd2d068b6b27cf47cd22aa4c5da43b3d4a05944cfe0ad1b0d843d360ed3a8dd SHA512 fb2ac1400d5e3c44bfc952c72f29a4c7234edf5b756a9602ad822c57fbc9813c35d2da9492e2982abf81e0826d278da2d31ee1865e806754e0b387ad699367d4 WHIRLPOOL 52e3e4db47b279d654450cacc76e24d2138f35299d55c81fd8760a1e054450d9d0e21ec3163ddce5116a868e0ea04783c014ca13480f8140e3a422b6480a83e2
+DIST libeatmydata-65.tar.gz 408813 SHA256 8a16c1ff04aeceed1891e2772728359d3368347e1807bed60fc6147d8968d5c1 SHA512 b2e3ed9c67b6ae9b0e5918b114bf0fb6e59dda3bff9b9331a8c280243822d4c77f35e9b08138ea65a74c893cc2bd67677bbf28b03bc61f011b24dd39d171adc2 WHIRLPOOL 51347727497073130ab4ea18d963a8d98c3e950a56c612f0485f205908b1b97f10f6e0afdad2a3d1c448bde2132426fc0a173a6140009a26a3a8db581b13460e
+DIST libeatmydata-82.tar.gz 407977 SHA256 0b675f58069f912727cee5eb75f9ff1a6a8300fe7e3fe4fc6bdd03b7c2c15b29 SHA512 882b2464c26d99ea0b01a2f1171dddb637ac0b3509c18416da4e0199f515ff23c43a7bb5eb641bc3447a2c6be06c261260713565c3e4c4b988995d09f52d623c WHIRLPOOL 5f6decc9e2a8de05379bd16874b2fb8865b52b115686c11cb0d0126b2ace822e0722cf0e2a7810e9f573fb1845dac00db991ecdbef10e98f49a1a5e4a7705153
diff --git a/sys-fs/libeatmydata/files/libeatmydata-105-undpkg.patch b/sys-fs/libeatmydata/files/libeatmydata-105-undpkg.patch
new file mode 100644
index 000000000000..3ffd698c7ddd
--- /dev/null
+++ b/sys-fs/libeatmydata/files/libeatmydata-105-undpkg.patch
@@ -0,0 +1,14 @@
+Don't rely on debian's way to multilib/multiarch.
+
+https://bugs.gentoo.org/550344
+diff --git a/eatmydata.in b/eatmydata.in
+index 40468db..aa143f0 100644
+--- a/eatmydata.in
++++ b/eatmydata.in
+@@ -17,5 +17,4 @@
+
+-export `dpkg-architecture|grep DEB_BUILD_MULTIARCH`
++shlib="@libexecdir@/eatmydata.sh"
+
+-shlib="/usr/lib/$DEB_BUILD_MULTIARCH/eatmydata.sh"
+ if [ -f "$shlib" ]; then
diff --git a/sys-fs/libeatmydata/libeatmydata-105-r1.ebuild b/sys-fs/libeatmydata/libeatmydata-105-r1.ebuild
new file mode 100644
index 000000000000..6000f4cada2d
--- /dev/null
+++ b/sys-fs/libeatmydata/libeatmydata-105-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools-multilib eutils
+
+DESCRIPTION="LD_PRELOAD hack to convert sync()/msync() and the like to NO-OP"
+HOMEPAGE="https://launchpad.net/libeatmydata/"
+SRC_URI="https://launchpad.net/${PN}/trunk/release-${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+# sandbox fools LD_PRELOAD and libeatmydata does not get control
+# bug/feature in sandbox?
+#DEPEND="test? ( dev-util/strace )"
+RESTRICT=test
+
+DEPEND="sys-apps/sed"
+RDEPEND=""
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-105-undpkg.patch
+)
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+
+ dodoc AUTHORS README
+}
diff --git a/sys-fs/libeatmydata/libeatmydata-65.ebuild b/sys-fs/libeatmydata/libeatmydata-65.ebuild
new file mode 100644
index 000000000000..147dee5ead44
--- /dev/null
+++ b/sys-fs/libeatmydata/libeatmydata-65.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit eutils
+
+DESCRIPTION="LD_PRELOAD hack to convert sync()/msync() and the like to NO-OP"
+HOMEPAGE="https://launchpad.net/libeatmydata/"
+SRC_URI="https://launchpad.net/${PN}/trunk/release-${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+# sandbox fools LD_PRELOAD and libeatmydata does not get control
+# bug/feature in sandbox?
+#DEPEND="test? ( dev-util/strace )"
+RESTRICT=test
+
+DEPEND="sys-apps/sed"
+RDEPEND=""
+
+src_install() {
+ default
+
+ prune_libtool_files --all
+ dodoc AUTHORS README
+}
diff --git a/sys-fs/libeatmydata/libeatmydata-82-r1.ebuild b/sys-fs/libeatmydata/libeatmydata-82-r1.ebuild
new file mode 100644
index 000000000000..268b562f8784
--- /dev/null
+++ b/sys-fs/libeatmydata/libeatmydata-82-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools-multilib eutils
+
+DESCRIPTION="LD_PRELOAD hack to convert sync()/msync() and the like to NO-OP"
+HOMEPAGE="https://launchpad.net/libeatmydata/"
+SRC_URI="https://launchpad.net/${PN}/trunk/${P}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+# sandbox fools LD_PRELOAD and libeatmydata does not get control
+# bug/feature in sandbox?
+#DEPEND="test? ( dev-util/strace )"
+RESTRICT=test
+
+DEPEND="sys-apps/sed"
+RDEPEND=""
+
+multilib_src_install_all() {
+ dodoc AUTHORS README
+}
diff --git a/sys-fs/libeatmydata/libeatmydata-82.ebuild b/sys-fs/libeatmydata/libeatmydata-82.ebuild
new file mode 100644
index 000000000000..75d4892fd0c6
--- /dev/null
+++ b/sys-fs/libeatmydata/libeatmydata-82.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="LD_PRELOAD hack to convert sync()/msync() and the like to NO-OP"
+HOMEPAGE="https://launchpad.net/libeatmydata/"
+SRC_URI="https://launchpad.net/${PN}/trunk/${P}/+download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+# sandbox fools LD_PRELOAD and libeatmydata does not get control
+# bug/feature in sandbox?
+#DEPEND="test? ( dev-util/strace )"
+RESTRICT=test
+
+DEPEND="sys-apps/sed"
+RDEPEND=""
+
+src_install() {
+ default
+
+ prune_libtool_files --all
+ dodoc AUTHORS README
+}
diff --git a/sys-fs/libeatmydata/metadata.xml b/sys-fs/libeatmydata/metadata.xml
new file mode 100644
index 000000000000..e44d669eaaa3
--- /dev/null
+++ b/sys-fs/libeatmydata/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <longdescription>
+ eatmydata: library and utilities designed to disable fsync and friends.
+ Used as LD_PRELOAD hack to hijack fsync() and open(O_SYNC) calls.
+ </longdescription>
+ <upstream>
+ <remote-id type="launchpad">libeatmydata</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/libfat/Manifest b/sys-fs/libfat/Manifest
new file mode 100644
index 000000000000..3208fd733af7
--- /dev/null
+++ b/sys-fs/libfat/Manifest
@@ -0,0 +1 @@
+DIST libfat-0.3a.tar.gz 384923 SHA256 42f7d74df7e516d602ae70576be9d829f2e217dd2245ac1ea7b26bb7b300734a
diff --git a/sys-fs/libfat/libfat-0.3a.ebuild b/sys-fs/libfat/libfat-0.3a.ebuild
new file mode 100644
index 000000000000..7e4937631ce7
--- /dev/null
+++ b/sys-fs/libfat/libfat-0.3a.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Support library to access and manipulate FAT12 / FAT16 / FAT32 file systems"
+HOMEPAGE="http://libfat.sourceforge.net"
+SRC_URI="mirror://sourceforge/libfat/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/glib:2
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/fuse-umfuse-fat-0.1
diff --git a/sys-fs/libfat/metadata.xml b/sys-fs/libfat/metadata.xml
new file mode 100644
index 000000000000..97ca43fa1ff4
--- /dev/null
+++ b/sys-fs/libfat/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>vapier@gentoo.org</email>
+ <description>make whatever changes you want</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libfat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/loop-aes/Manifest b/sys-fs/loop-aes/Manifest
new file mode 100644
index 000000000000..ae83b026192b
--- /dev/null
+++ b/sys-fs/loop-aes/Manifest
@@ -0,0 +1,2 @@
+DIST loop-AES-v3.7b.tar.bz2 334227 SHA256 b6794ca655c8a0b9ac47814264d96d7dab588493e3d2c09357eaad1e3436d648 SHA512 f673d8ccb9b3072256ff3501785204f1d64af5211eabaf47b5d3dc6c42e3d7ad6a2e4bcddcad76ee903637097a8aa4e1df9e16fff345af2ecd6e105b32bf35d3 WHIRLPOOL 1d4aeda49fbdfb404d8377bb87572a8a2cf18859917188916c00951829b834c9ec475615adf6f587a4bdda63888fdbee8f91ae0161c1ecba755488292a4d72df
+DIST loop-AES-v3.7c.tar.bz2 334719 SHA256 2c4eb21afc6e45d99d17e4c26b084d1f1e45c0453da9092a6a95ef918c588173 SHA512 8b260cfe7864973714ddae37ea7231fdefa98ce104f5bee4a1157653a5dd36a89328ee97f3d76d59e1824468f59e46873acd7e5cf9083b73ef0a3b74c24d6bdb WHIRLPOOL 20d07e5f07a158118dcd022f14dff2144c41c51e9add1c747545b7ae8742dd617705e37b03a39262d9b8faed7550a2563f9d827549c487e31e06287b99d36825
diff --git a/sys-fs/loop-aes/files/loop-aes-3.7c-linux4.patch b/sys-fs/loop-aes/files/loop-aes-3.7c-linux4.patch
new file mode 100644
index 000000000000..339f2c9d6003
--- /dev/null
+++ b/sys-fs/loop-aes/files/loop-aes-3.7c-linux4.patch
@@ -0,0 +1,45 @@
+From 9b7f9272a5462e03daea0b316f9047e103866ed3 Mon Sep 17 00:00:00 2001
+From: Alon Bar-Lev <alon.barlev@gmail.com>
+Date: Wed, 6 May 2015 22:51:54 +0300
+Subject: [PATCH] build: support linux-4
+
+---
+ loop-h-version.h | 4 +++-
+ loop.c-4.x.patched | 1 +
+ loop.h-4.x.patched | 1 +
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+ create mode 120000 loop.c-4.x.patched
+ create mode 120000 loop.h-4.x.patched
+
+diff --git a/loop-h-version.h b/loop-h-version.h
+index 8e6a734..84a538c 100644
+--- a/loop-h-version.h
++++ b/loop-h-version.h
+@@ -1,5 +1,7 @@
+ #include <linux/version.h>
+-#if LINUX_VERSION_CODE >= 0x30000
++#if LINUX_VERSION_CODE >= 0x40000
++# include "loop.h-4.x.patched"
++#elif LINUX_VERSION_CODE >= 0x30000
+ # include "loop.h-3.x.patched"
+ #elif LINUX_VERSION_CODE >= 0x20600
+ # include "loop.h-2.6.patched"
+diff --git a/loop.c-4.x.patched b/loop.c-4.x.patched
+new file mode 120000
+index 0000000..b6e51c3
+--- /dev/null
++++ b/loop.c-4.x.patched
+@@ -0,0 +1 @@
++loop.c-3.x.patched
+\ No newline at end of file
+diff --git a/loop.h-4.x.patched b/loop.h-4.x.patched
+new file mode 120000
+index 0000000..0924ecb
+--- /dev/null
++++ b/loop.h-4.x.patched
+@@ -0,0 +1 @@
++loop.h-3.x.patched
+\ No newline at end of file
+--
+2.3.6
+
diff --git a/sys-fs/loop-aes/loop-aes-3.7b.ebuild b/sys-fs/loop-aes/loop-aes-3.7b.ebuild
new file mode 100644
index 000000000000..9fc6e7234e7e
--- /dev/null
+++ b/sys-fs/loop-aes/loop-aes-3.7b.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit linux-mod
+
+MY_P="${PN/aes/AES}-v${PV}"
+
+DESCRIPTION="Linux kernel module to encrypt local file systems and disk partitions with AES cipher"
+HOMEPAGE="http://loop-aes.sourceforge.net/loop-AES.README"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~hppa ~ppc ~sparc x86"
+IUSE="cpu_flags_x86_aes extra-ciphers keyscrub cpu_flags_x86_padlock"
+
+DEPEND="app-crypt/loop-aes-losetup"
+RDEPEND=""
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ CONFIG_CHECK="!BLK_DEV_LOOP"
+ MODULE_NAMES="loop(block::tmp-d-kbuild)"
+ BUILD_TARGETS="all"
+
+ BUILD_PARAMS=" \
+ V=1 \
+ LINUX_SOURCE=\"${KERNEL_DIR}\" \
+ KBUILD_OUTPUT=\"${KBUILD_OUTPUT}\" \
+ USE_KBUILD=y MODINST=n RUNDM=n"
+ use cpu_flags_x86_aes && BUILD_PARAMS="${BUILD_PARAMS} INTELAES=y"
+ use keyscrub && BUILD_PARAMS="${BUILD_PARAMS} KEYSCRUB=y"
+ use cpu_flags_x86_padlock && BUILD_PARAMS="${BUILD_PARAMS} PADLOCK=y"
+
+ if use extra-ciphers; then
+ MODULE_NAMES="${MODULE_NAMES}
+ loop_blowfish(block::tmp-d-kbuild)
+ loop_serpent(block::tmp-d-kbuild)
+ loop_twofish(block::tmp-d-kbuild)"
+ BUILD_PARAMS="${BUILD_PARAMS} EXTRA_CIPHERS=y"
+ fi
+}
+
+src_prepare() {
+ sed -e 's/make/$(MAKE)/g' -i Makefile || die "sed failed"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ dodoc README
+ dobin loop-aes-keygen
+ doman loop-aes-keygen.1
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ einfo
+ einfo "For more instructions take a look at examples in README at:"
+ einfo "'${EPREFIX}/usr/share/doc/${PF}'"
+ einfo
+ einfo "If you have a newer Intel processor (i5, i7), and you use AES"
+ einfo "you may want to consider using the aes-ni use flag. It will"
+ einfo "use your processors native AES instructions giving quite a speed"
+ einfo "increase."
+ einfo
+
+ ewarn
+ ewarn "Please consider using loop-aes-losetup package instead of"
+ ewarn "util-linux[loop-aes], it will enable all loop-aes services"
+ ewarn "without patching util-linux package"
+ ewarn
+ ewarn "In future only loop-aes-losetup will be available in portage"
+ ewarn
+}
diff --git a/sys-fs/loop-aes/loop-aes-3.7c.ebuild b/sys-fs/loop-aes/loop-aes-3.7c.ebuild
new file mode 100644
index 000000000000..60400f43ec79
--- /dev/null
+++ b/sys-fs/loop-aes/loop-aes-3.7c.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-mod
+
+MY_P="${PN/aes/AES}-v${PV}"
+
+DESCRIPTION="Linux kernel module to encrypt local file systems and disk partitions with AES cipher"
+HOMEPAGE="http://loop-aes.sourceforge.net/loop-AES.README"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+IUSE="cpu_flags_x86_aes extra-ciphers keyscrub cpu_flags_x86_padlock"
+
+DEPEND="app-crypt/loop-aes-losetup"
+RDEPEND=""
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ CONFIG_CHECK="!BLK_DEV_LOOP"
+ MODULE_NAMES="loop(block::tmp-d-kbuild)"
+ BUILD_TARGETS="all"
+
+ BUILD_PARAMS=" \
+ V=1 \
+ LINUX_SOURCE=\"${KERNEL_DIR}\" \
+ KBUILD_OUTPUT=\"${KBUILD_OUTPUT}\" \
+ USE_KBUILD=y MODINST=n RUNDM=n"
+ use cpu_flags_x86_aes && BUILD_PARAMS="${BUILD_PARAMS} INTELAES=y"
+ use keyscrub && BUILD_PARAMS="${BUILD_PARAMS} KEYSCRUB=y"
+ use cpu_flags_x86_padlock && BUILD_PARAMS="${BUILD_PARAMS} PADLOCK=y"
+
+ if use extra-ciphers; then
+ MODULE_NAMES="${MODULE_NAMES}
+ loop_blowfish(block::tmp-d-kbuild)
+ loop_serpent(block::tmp-d-kbuild)
+ loop_twofish(block::tmp-d-kbuild)"
+ BUILD_PARAMS="${BUILD_PARAMS} EXTRA_CIPHERS=y"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-linux4.patch"
+ sed -e 's/make/$(MAKE)/g' -i Makefile || die "sed failed"
+}
+
+src_install() {
+ linux-mod_src_install
+
+ dodoc README
+ dobin loop-aes-keygen
+ doman loop-aes-keygen.1
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ einfo
+ einfo "For more instructions take a look at examples in README at:"
+ einfo "'${EPREFIX}/usr/share/doc/${PF}'"
+ einfo
+ einfo "If you have a newer Intel processor (i5, i7), and you use AES"
+ einfo "you may want to consider using the aes-ni use flag. It will"
+ einfo "use your processors native AES instructions giving quite a speed"
+ einfo "increase."
+ einfo
+
+ ewarn
+ ewarn "Please consider using loop-aes-losetup package instead of"
+ ewarn "util-linux[loop-aes], it will enable all loop-aes services"
+ ewarn "without patching util-linux package"
+ ewarn
+ ewarn "In future only loop-aes-losetup will be available in portage"
+ ewarn
+}
diff --git a/sys-fs/loop-aes/metadata.xml b/sys-fs/loop-aes/metadata.xml
new file mode 100644
index 000000000000..94c55ab280ba
--- /dev/null
+++ b/sys-fs/loop-aes/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>crypto</herd>
+ <use>
+ <flag name="extra-ciphers">Enable extra ciphers</flag>
+ <flag name="keyscrub">Protects the encryption key in memory but takes
+ more cpu resources</flag>
+ <flag name="cpu_flags_x86_padlock">Use VIA padlock instructions,
+ detected at run time, code still works on non-padlock processors</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">loop-aes</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/lsscsi/Manifest b/sys-fs/lsscsi/Manifest
new file mode 100644
index 000000000000..453d6dddf3c0
--- /dev/null
+++ b/sys-fs/lsscsi/Manifest
@@ -0,0 +1,4 @@
+DIST lsscsi-0.25.tgz 126199 SHA256 002231d113eac89493ad1c154f243355bf0bb44295e9d517076a7ab7c2b94e78 SHA512 ad2b264ad607498ab1aee4918a2f8ff479b982bd8a7a6df8482331b83c77a39a0b9f1f3cdbc0b4904fee3b7282601d48c28d65a5c7b8803fcdfa027a417ecd20 WHIRLPOOL 79b84292640b24a3480eaf24d1db936714804e5da80c36e28d8fd35d96fa0aaa2a76875ae74d29109944689aa6a5f5b2bd09251ff2ae10c690dd8f749f2da36b
+DIST lsscsi-0.26.tgz 132506 SHA256 9c62ca3b838203f1dc374fdbf519fc1705a9f3c02049ea0205e016a624d28d7f SHA512 0d6bca3f402920f2af160f4162322d039b3bfb16de641da23ef55a3f34a14d2ffd66a1231f0ca98568c248ed3913907cf9d236de70d943ae30985293998885ff WHIRLPOOL cff3fb5719969bf42228daf692c886fc5713329802d10059ce7bc0af9488bde38701fb3f3f7dbf36f0ae5f9aa0e9dbd5513866fbef36bfa924b0dbfde46141b5
+DIST lsscsi-0.27.tgz 138537 SHA256 6b8254f7b241ff0c3690e168b11a216d105962263fdd5a3da6dfb4cba5a0d9b4 SHA512 faa4404e7fcf7c00178bd26cf54bbc876e7b2d52e952c7e8dee7454fb506e641dc75b9def8c07363ed5cb75537a9b73de8bc05b1877ce8a734aa9afd80f6b22f WHIRLPOOL 7fb7c14c2cb37009eb70493ed83c69b4d5a43fa0f9afa0a9327e5969280b3880831b6301cc2fbe72f3ece1c28329bac64cf3a38fe3d753eb78636a53cd924ab6
+DIST lsscsi-0.28.tgz 150259 SHA256 025d009a1af42bc5b2fca664c44c9ecdfd754356e4a44f5c6aced2420afadd50 SHA512 6d5cf8ebc42af0d8dbe8f2a1e90f4c429d058f184027318686fd22bc117e66c0b1847e4c97964d3d0e1b7bf4a5f1e296e1e3575ed2f5ff999eef70bdfb9ea4d4 WHIRLPOOL c6606475ad9642f0a867b49ff08ccbb8390c3c0d6c912a1701b7ccabd77c400ee074127831b436252ef7665fdac7d35fe06d95c55d2d2e585000be8eafc1d321
diff --git a/sys-fs/lsscsi/lsscsi-0.25.ebuild b/sys-fs/lsscsi/lsscsi-0.25.ebuild
new file mode 100644
index 000000000000..e884a60b1879
--- /dev/null
+++ b/sys-fs/lsscsi/lsscsi-0.25.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+DESCRIPTION="SCSI sysfs query tool"
+HOMEPAGE="http://sg.danny.cz/scsi/lsscsi.html"
+SRC_URI="http://sg.danny.cz/scsi/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS CREDITS ChangeLog NEWS README
+}
diff --git a/sys-fs/lsscsi/lsscsi-0.26.ebuild b/sys-fs/lsscsi/lsscsi-0.26.ebuild
new file mode 100644
index 000000000000..38efc5f4ca35
--- /dev/null
+++ b/sys-fs/lsscsi/lsscsi-0.26.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="SCSI sysfs query tool"
+HOMEPAGE="http://sg.danny.cz/scsi/lsscsi.html"
+SRC_URI="http://sg.danny.cz/scsi/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE=""
diff --git a/sys-fs/lsscsi/lsscsi-0.27.ebuild b/sys-fs/lsscsi/lsscsi-0.27.ebuild
new file mode 100644
index 000000000000..e274c2f6169a
--- /dev/null
+++ b/sys-fs/lsscsi/lsscsi-0.27.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="SCSI sysfs query tool"
+HOMEPAGE="http://sg.danny.cz/scsi/lsscsi.html"
+SRC_URI="http://sg.danny.cz/scsi/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
diff --git a/sys-fs/lsscsi/lsscsi-0.28.ebuild b/sys-fs/lsscsi/lsscsi-0.28.ebuild
new file mode 100644
index 000000000000..e3700959f087
--- /dev/null
+++ b/sys-fs/lsscsi/lsscsi-0.28.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="SCSI sysfs query tool"
+HOMEPAGE="http://sg.danny.cz/scsi/lsscsi.html"
+SRC_URI="http://sg.danny.cz/scsi/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
diff --git a/sys-fs/lsscsi/metadata.xml b/sys-fs/lsscsi/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/lsscsi/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/lufis/Manifest b/sys-fs/lufis/Manifest
new file mode 100644
index 000000000000..553144f35e50
--- /dev/null
+++ b/sys-fs/lufis/Manifest
@@ -0,0 +1,2 @@
+DIST lufis-0.2.tar.gz 17072 SHA256 079bad9b0497db8942fcadf467cf5eff4534edcb8c59ec6081ca0cbf8b9477e6
+DIST lufis-0.3.tar.gz 18158 SHA256 84b2c6fb0a14e07a62c7859e1c6903cddb41343a95b1e9115e6da44d1fa29837
diff --git a/sys-fs/lufis/files/lufis-0.2-lufs.patch b/sys-fs/lufis/files/lufis-0.2-lufs.patch
new file mode 100644
index 000000000000..00edacb55be2
--- /dev/null
+++ b/sys-fs/lufis/files/lufis-0.2-lufs.patch
@@ -0,0 +1,250 @@
+This patch makes it possible to compile lufis without the lufs package.
+It has been merged to the lufis cvs tree.
+We would like to remove lufs soon in favour of the newer system fuse.
+
+diff -Naur lufis-0.2.orig/lufs/fs.h lufis-0.2/lufs/fs.h
+--- lufis-0.2.orig/lufs/fs.h 1970-01-01 01:00:00.000000000 +0100
++++ lufis-0.2/lufs/fs.h 2004-11-12 21:07:45.714978800 +0100
+@@ -0,0 +1,112 @@
++/*
++ * lufs.h
++ * Copyright (C) 2002 Florin Malita <mali@go.ro>
++ *
++ * This file is part of LUFS, a free userspace filesystem implementation.
++ * See http://lufs.sourceforge.net/ for updates.
++ *
++ * LUFS 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 2 of the License, or
++ * (at your option) any later version.
++ *
++ * LUFS 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, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef _LUFS_FS_H_
++#define _LUFS_FS_H_
++
++#include <sys/types.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++struct dir_cache;
++struct directory;
++struct lufs_fattr;
++struct file_system;
++struct list_head;
++struct dir_cache;
++
++#define MAX_LEN 64
++
++struct credentials{
++ char user[MAX_LEN];
++ char group[MAX_LEN];
++ uid_t uid;
++ gid_t gid;
++};
++
++
++struct directory* lu_cache_mkdir(char*);
++int lu_cache_add2dir(struct directory*, char*, char*, struct lufs_fattr*);
++int lu_cache_lookup(struct dir_cache*, char*, char*, struct lufs_fattr*, char*, int);
++void lu_cache_add_dir(struct dir_cache*, struct directory*);
++void lu_cache_killdir(struct directory*);
++
++int lu_check_to(int, int, int);
++int lu_atomic_read(int, char*, int, int);
++int lu_atomic_write(int, char*, int, int);
++
++int lu_opt_loadcfg(struct list_head*, char*);
++int lu_opt_parse(struct list_head*, char*, char*);
++int lu_opt_getint(struct list_head*, char*, char*, long int*, int);
++const char* lu_opt_getchar(struct list_head*, char*, char*);
++
++
++#ifdef __cplusplus
++} /* end of extern "C" { */
++#endif
++
++#ifdef TRACE
++#undef TRACE
++#endif
++#ifdef WARN
++#undef WARN
++#endif
++#ifdef ERROR
++#undef ERROR
++#endif
++
++#ifdef __cplusplus
++
++#include <iostream>
++
++#ifdef DEBUG
++#define TRACE(x) cout<<std::hex<<"["<<getpid()<<"]("<<__func__<<")"<<x<<"\n"
++#define WARN(x) cerr<<std::hex<<"["<<getpid()<<"]("<<__func__<<")"<<x<<"\n"
++#define ERROR(x) cerr<<std::hex<<"["<<getpid()<<"]("<<__func__<<")"<<x<<"\n"
++#else
++#define TRACE(x...) do{}while(0)
++#define WARN(x...) do{}while(0)
++#define ERROR(x...) cerr<<x<<"\n"
++#endif
++
++#else
++
++#include <stdio.h>
++
++#ifdef DEBUG
++#define TRACE(x...) do{fprintf(stderr, "[%x](%s) ", getpid(), __func__); fprintf(stderr, x); fprintf(stderr, "\n");}while(0)
++#define WARN(x...) do{fprintf(stderr, "[%x](%s) ", getpid(), __func__); fprintf(stderr, x); fprintf(stderr, "\n");}while(0)
++#define ERROR(x...) do{fprintf(stderr, "[%x](%s) ", getpid(), __func__); fprintf(stderr, x); fprintf(stderr, "\n");}while(0)
++#else
++#define TRACE(x...) do{}while(0)
++#define WARN(x...) do{}while(0)
++#define ERROR(x...) do{fprintf(stderr, x); fprintf(stderr, "\n");}while(0)
++#endif
++
++#endif
++
++
++
++#endif
++
+diff -Naur lufis-0.2.orig/lufs/proto.h lufis-0.2/lufs/proto.h
+--- lufis-0.2.orig/lufs/proto.h 1970-01-01 01:00:00.000000000 +0100
++++ lufis-0.2/lufs/proto.h 2004-11-12 21:07:45.715978648 +0100
+@@ -0,0 +1,116 @@
++/*
++ * proto.h
++ * Copyright (C) 2002 Florin Malita <mali@go.ro>
++ *
++ * This file is part of LUFS, a free userspace filesystem implementation.
++ * See http://lufs.sourceforge.net/ for updates.
++ *
++ * LUFS 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 2 of the License, or
++ * (at your option) any later version.
++ *
++ * LUFS 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, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef _LU_PROTO_H_
++#define _LU_PROTO_H_
++
++#define LU_MAXDATA 4096
++
++#define PVERSION 0x02
++
++#define PTYPE_OK 0x00
++#define PTYPE_MOUNT 0x01
++#define PTYPE_READ 0x02
++#define PTYPE_WRITE 0x03
++#define PTYPE_READDIR 0x04
++#define PTYPE_STAT 0x05
++#define PTYPE_UMOUNT 0x06
++#define PTYPE_SETATTR 0x07
++#define PTYPE_MKDIR 0x08
++#define PTYPE_RMDIR 0x09
++#define PTYPE_CREATE 0x0A
++#define PTYPE_UNLINK 0x0B
++#define PTYPE_RENAME 0x0C
++#define PTYPE_OPEN 0x0D
++#define PTYPE_RELEASE 0x0E
++#define PTYPE_READLINK 0x0F
++#define PTYPE_LINK 0x10
++#define PTYPE_SYMLINK 0x11
++#define PTYPE_STATFS 0x12
++
++#define PTYPE_MAX 0x12
++
++
++#define PTYPE_ERROR 0x100
++
++#define PERROR(x) (-(x & (PTYPE_ERROR - 1)) - 1)
++#define PIS_ERROR(x) (x & PTYPE_ERROR)
++
++struct lu_msg {
++ unsigned short msg_version;
++ unsigned short msg_type;
++ unsigned short msg_datalen;
++ unsigned short msg_pid;
++};
++
++
++struct lufs_fattr{
++ unsigned long f_ino;
++ unsigned long f_mode;
++ unsigned long f_nlink;
++ unsigned long f_uid;
++ unsigned long f_gid;
++ long long f_size;
++ unsigned long f_atime;
++ unsigned long f_mtime;
++ unsigned long f_ctime;
++ unsigned long f_blksize;
++ unsigned long f_blocks;
++};
++
++
++struct lufs_sbattr{ /* struct statfs64 */
++ unsigned long long sb_bytes;
++ unsigned long long sb_bytes_free;
++ unsigned long long sb_bytes_available;
++ unsigned long long sb_files;
++ unsigned long long sb_ffree;
++};
++
++
++struct lufs_req_readdir{
++ unsigned short offset;
++ char dirname[0];
++};
++
++struct lufs_req_mkdir{
++ int mode;
++ char dirname[0];
++};
++
++struct lufs_req_rw{
++ long long offset;
++ unsigned long count;
++ char name[0];
++};
++
++struct lufs_req_open{
++ unsigned mode;
++ char name[0];
++};
++
++struct lufs_req_setattr{
++ struct lufs_fattr fattr;
++ char name[0];
++};
++
++#endif
+diff -Naur lufis-0.2.orig/Makefile lufis-0.2/Makefile
+--- lufis-0.2.orig/Makefile 2004-11-12 21:07:36.138434656 +0100
++++ lufis-0.2/Makefile 2004-11-12 21:10:04.342904152 +0100
+@@ -1,5 +1,5 @@
+ CC = gcc
+-CFLAGS = -Wall -W -g
++CFLAGS += -Wall -W -g -I.
+ LDLIBS = -lfuse -lpthread -ldl -rdynamic
+ CPPFLAGS := -D_FILE_OFFSET_BITS=64
+ #CPPFLAGS += -DDEBUG
diff --git a/sys-fs/lufis/files/lufis-allow-uid-and-gid-addon.patch b/sys-fs/lufis/files/lufis-allow-uid-and-gid-addon.patch
new file mode 100644
index 000000000000..006559762b85
--- /dev/null
+++ b/sys-fs/lufis/files/lufis-allow-uid-and-gid-addon.patch
@@ -0,0 +1,29 @@
+--- lufis-0.3.orig/lufis.c 2005-02-05 18:59:56.000000000 +0100
++++ lufis-0.3/lufis.c 2005-02-05 19:00:38.000000000 +0100
+@@ -276,15 +276,21 @@ static int lu_getattr(const char *path,
+ if(res < 0)
+ return res;
+
+- /* Take uid= and gid= vars when the filesystem returns 1 */
++ // Take uid= and gid= vars when the filesystem returns 1
+ if(fattr.f_uid == (uid_t) 1) {
+- lu_opt_getint(&lu_cfg, "MOUNT", "uid", &option_uid, 0);
+- fattr.f_uid = (uid_t) option_uid;
++ if(!lu_opt_getint(&lu_cfg, "MOUNT", "uid", &option_uid, 0))
++ fattr.f_uid = (uid_t) option_uid;
++ else
++ // default to 0 (root) when no argument was supplied
++ fattr.f_uid = (uid_t) 0;
+ }
+
+ if(fattr.f_gid == (gid_t) 1) {
+- lu_opt_getint(&lu_cfg, "MOUNT", "gid", &option_gid, 0);
+- fattr.f_gid = (gid_t) option_gid;
++ if(!lu_opt_getint(&lu_cfg, "MOUNT", "gid", &option_gid, 0))
++ fattr.f_gid = (gid_t) option_gid;
++ else
++ // default to 0 (root) when no argument was supplied
++ fattr.f_gid = (gid_t) 0;
+ }
+
+ stbuf->st_mode = fattr.f_mode;
diff --git a/sys-fs/lufis/lufis-0.2.ebuild b/sys-fs/lufis/lufis-0.2.ebuild
new file mode 100644
index 000000000000..45d388c1a010
--- /dev/null
+++ b/sys-fs/lufis/lufis-0.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Wrapper to use lufs modules with fuse kernel support"
+SRC_URI="mirror://sourceforge/avf/${P}.tar.gz"
+HOMEPAGE="http://avf.sourceforge.net/"
+LICENSE="GPL-2"
+DEPEND="!<sys-fs/lufs-0.9.7-r3
+ >=sys-fs/fuse-1.3"
+KEYWORDS="x86 ~ppc"
+SLOT="0"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${P}-lufs.patch
+}
+
+src_compile () {
+ emake || die "emake failed"
+}
+
+src_install () {
+ dobin lufis
+ dodoc README COPYING ChangeLog
+
+ insinto /usr/include/lufs/
+ doins lufs/fs.h
+ doins lufs/proto.h
+}
diff --git a/sys-fs/lufis/lufis-0.3.ebuild b/sys-fs/lufis/lufis-0.3.ebuild
new file mode 100644
index 000000000000..e23a80631842
--- /dev/null
+++ b/sys-fs/lufis/lufis-0.3.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Wrapper to use lufs modules with fuse kernel support"
+SRC_URI="mirror://sourceforge/fuse/${P}.tar.gz"
+HOMEPAGE="http://fuse.sourceforge.net/"
+LICENSE="GPL-2"
+DEPEND="!<sys-fs/lufs-0.9.7-r3
+ >=sys-fs/fuse-1.3"
+KEYWORDS="x86 ppc ~amd64"
+SLOT="0"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/lufis-allow-uid-and-gid-addon.patch
+}
+
+src_install() {
+ dobin lufis
+ dodoc README COPYING ChangeLog
+
+ insinto /usr/include/lufs/
+ doins fs.h
+ doins proto.h
+}
diff --git a/sys-fs/lufis/metadata.xml b/sys-fs/lufis/metadata.xml
new file mode 100644
index 000000000000..e93f1bcba449
--- /dev/null
+++ b/sys-fs/lufis/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <upstream>
+ <remote-id type="sourceforge">fuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/lufs/Manifest b/sys-fs/lufs/Manifest
new file mode 100644
index 000000000000..39790d71508c
--- /dev/null
+++ b/sys-fs/lufs/Manifest
@@ -0,0 +1 @@
+DIST lufs-0.9.7.tar.gz 537772 SHA256 2d91457906ee2ff1e26de82987019fe2efe22d9c3b6c7741b7ed8fffbae51411
diff --git a/sys-fs/lufs/files/lufs-0.9.7-enable-gnome-2.patch b/sys-fs/lufs/files/lufs-0.9.7-enable-gnome-2.patch
new file mode 100644
index 000000000000..6d6d4ba3b1ab
--- /dev/null
+++ b/sys-fs/lufs/files/lufs-0.9.7-enable-gnome-2.patch
@@ -0,0 +1,72 @@
+diff -upr -x aclocal.m4 -x Makefile.in -x configure -x '.*' -x autom4te.cache -x kernel lufs-0.9.7.orig/config.h.in lufs-0.9.7/config.h.in
+--- lufs-0.9.7.orig/config.h.in 2003-10-29 22:48:48.000000000 +0000
++++ lufs-0.9.7/config.h.in 2004-01-13 22:51:00.000000000 +0000
+@@ -9,6 +9,9 @@
+ /* Define if libchipcard is present. */
+ #undef HAS_LIBCHIPCARD
+
++/* Define if using libgnome-2 rather than 1. */
++#undef HAS_LIBGNOME_2
++
+ /* Define if ssh is found. */
+ #undef HAS_SSH
+
+diff -upr -x aclocal.m4 -x Makefile.in -x configure -x '.*' -x autom4te.cache -x kernel lufs-0.9.7.orig/configure.in lufs-0.9.7/configure.in
+--- lufs-0.9.7.orig/configure.in 2003-10-29 22:40:28.000000000 +0000
++++ lufs-0.9.7/configure.in 2004-01-13 22:50:20.802647656 +0000
+@@ -164,7 +164,9 @@ AC_SUBST(SSHPROG)
+ dnl Checking gnome
+ AC_CHECK_PROG(GCONF, gnome-config, gnome-config)
+ AC_CHECK_PROG(GVFSCONF, gnome-vfs-config, gnome-vfs-config)
++AC_CHECK_PROG(PKGCONF, pkg-config, pkg-config)
+ AC_CHECK_LIB(gnomevfs, gnome_vfs_init, HAS_GNOMEVFS=1,)
++AC_CHECK_LIB(gnomevfs-2, gnome_vfs_init, HAS_GNOMEVFS2=1,`$PKGCONF --libs-only-l gnome-vfs-2.0`)
+ if test "$GCONF" -a "$GVFSCONF" -a "$HAS_GNOMEVFS"
+ then
+ AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
+@@ -172,6 +174,16 @@ then
+ GVFS_LDADD="`$GCONF --libs gnome` `$GVFSCONF --libs`"
+ GVFS_CFLAGS="`$GCONF --cflags gnome` `$GVFSCONF --cflags`"
+ opt_fs="$opt_fs gvfs"
++elif test "$PKGCONF" -a "$HAS_GNOMEVFS2"
++then
++ AC_DEFINE([HAS_GVFS], 1, [Define if gvfs is to be built.])
++ AC_DEFINE([HAS_LIBGNOME_2], 1, [Define if using libgnome-2 rather than 1.])
++ define_has_libgnome_2="#define HAS_LIBGNOME_2"
++ AC_SUBST(define_has_libgnome_2)
++
++ GVFS_LDADD="`$PKGCONF --libs libgnome-2.0` `$PKGCONF --libs gnome-vfs-2.0`"
++ GVFS_CFLAGS="`$PKGCONF --cflags libgnome-2.0` `$PKGCONF --cflags gnome-vfs-2.0`"
++ opt_fs="$opt_fs gvfs"
+ fi
+ AC_SUBST(GVFS_LDADD)
+ AC_SUBST(GVFS_CFLAGS)
+diff -upr -x aclocal.m4 -x Makefile.in -x configure -x '.*' -x autom4te.cache -x kernel lufs-0.9.7.orig/filesystems/gvfs/gvfs.cpp lufs-0.9.7/filesystems/gvfs/gvfs.cpp
+--- lufs-0.9.7.orig/filesystems/gvfs/gvfs.cpp 2003-03-08 21:45:29.000000000 +0000
++++ lufs-0.9.7/filesystems/gvfs/gvfs.cpp 2004-01-13 22:55:44.906376400 +0000
+@@ -36,8 +36,13 @@
+ #include <lufs/fs.h>
+
+ #include "gvfs.h"
++#include "config.h"
+
++#ifdef HAS_LIBGNOME_2
++#include <libgnome/libgnome.h>
++#else
+ #include <gnome.h>
++#endif
+ #include <libgnomevfs/gnome-vfs.h>
+
+ extern "C" {
+@@ -275,7 +280,11 @@ GVFS::do_readdir(char* d, struct directo
+ goto out_uri;
+ }
+
++#ifdef HAS_LIBGNOME_2
++ if(gnome_vfs_directory_open_from_uri(&dir, uri, GNOME_VFS_FILE_INFO_DEFAULT) != GNOME_VFS_OK){
++#else
+ if(gnome_vfs_directory_open_from_uri(&dir, uri, GNOME_VFS_FILE_INFO_DEFAULT, NULL) != GNOME_VFS_OK){
++#endif
+ WARN("could not open directory!");
+ goto out_info;
+ }
diff --git a/sys-fs/lufs/files/lufs-0.9.7-fPIC.patch b/sys-fs/lufs/files/lufs-0.9.7-fPIC.patch
new file mode 100644
index 000000000000..05bb1d2f5d25
--- /dev/null
+++ b/sys-fs/lufs/files/lufs-0.9.7-fPIC.patch
@@ -0,0 +1,12 @@
+--- filesystems/gnetfs/Makefile.in 2004-03-18 15:59:28.391299639 +0000
++++ filesystems/gnetfs/Makefile.in 2004-03-18 15:59:45.316142704 +0000
+@@ -197,7 +197,7 @@
+ @AMDEP_TRUE@ ./$(DEPDIR)/vtree.Plo ./$(DEPDIR)/xfer.Plo
+-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++COMPILE = $(CC) -fPIC $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
++LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) -prefer-pic $(DEFS) $(DEFAULT_INCLUDES) \
+ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ CCLD = $(CC)
+ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
diff --git a/sys-fs/lufs/files/lufs-0.9.7-gcc43.patch b/sys-fs/lufs/files/lufs-0.9.7-gcc43.patch
new file mode 100644
index 000000000000..3736ba62b017
--- /dev/null
+++ b/sys-fs/lufs/files/lufs-0.9.7-gcc43.patch
@@ -0,0 +1,33 @@
+--- filesystems/ftpfs/ftplib.cpp.orig 2008-06-08 20:01:35.000000000 +0200
++++ filesystems/ftpfs/ftplib.cpp 2008-06-08 20:01:53.000000000 +0200
+@@ -20,6 +20,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <cstring>
+ #include <unistd.h>
+ #include <netdb.h>
+ #include <stdio.h>
+--- filesystems/ftpfs/ftpfs.h.orig 2008-06-08 20:04:33.000000000 +0200
++++ filesystems/ftpfs/ftpfs.h 2008-06-08 20:05:07.000000000 +0200
+@@ -23,6 +23,8 @@
+ #ifndef _FTPFS_H_
+ #define _FTPFS_H_
+
++#include <cstdlib>
++#include <cstring>
+ using namespace std;
+
+ struct directory;
+--- filesystems/sshfs/sftplib.h.orig 2008-06-08 20:08:55.000000000 +0200
++++ filesystems/sshfs/sftplib.h 2008-06-08 20:09:43.000000000 +0200
+@@ -28,6 +28,9 @@
+
+ #include <string>
+
++#include <cstring>
++#include <cstdlib>
++
+ using namespace std;
+
+ #define MAXDATA 32768
diff --git a/sys-fs/lufs/files/lufs-automount-port.diff b/sys-fs/lufs/files/lufs-automount-port.diff
new file mode 100644
index 000000000000..b184b20aba97
--- /dev/null
+++ b/sys-fs/lufs/files/lufs-automount-port.diff
@@ -0,0 +1,28 @@
+Files lufs-0.9.5.org/util/a.out and lufs-0.9.5/util/a.out differ
+diff -Nur lufs-0.9.5.org/util/auto.sshfs.c lufs-0.9.5/util/auto.sshfs.c
+--- lufs-0.9.5.org/util/auto.sshfs.c 2003-10-24 16:51:49.000000000 +0200
++++ lufs-0.9.5/util/auto.sshfs.c 2003-10-24 16:54:15.000000000 +0200
+@@ -26,6 +26,8 @@
+ int
+ main(int argc, char **argv){
+ char *c;
++ char *d;
++ int port = 22;
+
+ if(argc < 2)
+ return 1;
+@@ -34,8 +36,12 @@
+ return 1;
+
+ *c = 0;
+-
+- printf("-fstype=lufs,fs=sshfs,quiet,host=%s,username=%s none\n", c + 1, argv[1]);
++ d = strchr(c + 1, ':');
++ if (d) {
++ port = atoi(d + 1);
++ *d = 0;
++ }
++ printf("-fstype=lufs,fs=sshfs,quiet,host=%s,port=%d,username=%s none\n", c + 1,port, argv[1]);
+
+ return 0;
+ }
diff --git a/sys-fs/lufs/files/lufs-no-kernel.patch b/sys-fs/lufs/files/lufs-no-kernel.patch
new file mode 100644
index 000000000000..75a67dbf9a1a
--- /dev/null
+++ b/sys-fs/lufs/files/lufs-no-kernel.patch
@@ -0,0 +1,111 @@
+diff -pur lufs-0.9.7.orig/configure.in lufs-0.9.7/configure.in
+--- lufs-0.9.7.orig/configure.in 2005-02-07 07:59:18.000000000 +0100
++++ lufs-0.9.7/configure.in 2005-02-07 07:59:40.000000000 +0100
+@@ -9,107 +9,6 @@ AM_INIT_AUTOMAKE(lufs,0.9.7)
+ dnl "static" FSs
+ opt_fs="localfs locasefs ftpfs gnetfs"
+
+-AC_ARG_ENABLE(kernel-support,
+- [ --enable-kernel-support enable building of the kernel module (default=yes)],
+- [ KERNEL_SUPPORT=$enableval ],)
+-
+-if test "$KERNEL_SUPPORT" != "no"
+-then
+-
+- dnl Checking os
+- AC_MSG_CHECKING(OS)
+- OS_DIR=`uname -s`
+- if test ! -d kernel/$OS_DIR
+- then
+- AC_MSG_ERROR($OS_DIR - not supported!)
+- else
+- AC_MSG_RESULT($OS_DIR)
+- fi
+-
+- dnl LINUX kernel configuration
+- if test "$OS_DIR"="Linux"
+- then
+-
+- dnl Checking kernel & headers
+- AC_MSG_CHECKING(kernel)
+- AC_ARG_WITH(kernel,
+- [ --with-kernel=VERSION specify a kernel version to compile for],
+- [KERNEL_VERSION=$withval],
+- [KERNEL_VERSION=`uname -r`])
+- MODULES_DIR=/lib/modules/$KERNEL_VERSION
+- AC_MSG_RESULT($KERNEL_VERSION)
+-
+- AC_MSG_CHECKING(kernel support)
+- KERNEL_DIR=`echo $KERNEL_VERSION | cut -d'.' -f1,2`
+- if test ! -d kernel/$OS_DIR/$KERNEL_DIR
+- then
+- AC_MSG_ERROR([$KERNEL_DIR not supported!])
+- else
+- AC_MSG_RESULT([supported in kernel/$OS_DIR/$KERNEL_DIR])
+- fi
+-
+- AC_MSG_CHECKING(kernel headers)
+- AC_ARG_WITH(kheaders,
+- [ --with-kheaders=DIR specify the location of the kernel headers],
+- [KERNEL_HDR=$withval],
+- [KERNEL_HDR=$MODULES_DIR/build/include])
+- if test ! -f $KERNEL_HDR/linux/fs.h
+- then
+- AC_MSG_ERROR([not found in $KERNEL_HDR. please install them!])
+- else
+- AC_MSG_RESULT([found in $KERNEL_HDR])
+- fi
+-
+- AC_MSG_CHECKING(kernel configuration)
+- if test -f $MODULES_DIR/build/.config
+- then
+- tmp=`cat $MODULES_DIR/build/.config | grep CONFIG_MODVERSIONS=y`
+- if test "$tmp"
+- then
+- AC_MSG_RESULT([found, using modversions])
+- MODVERSIONS="yes"
+-# MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
+- else
+- AC_MSG_RESULT([found, not using modversions])
+- fi
+- else
+- AC_MSG_RESULT([not found at $MODULES_DIR/build/.config, assuming modversions support])
+- MODVERSIONS="yes"
+-# MODV_FLAGS="-DMODVERSIONS -include $KERNEL_HDR/linux/modversions.h"
+- fi
+-
+- AC_ARG_ENABLE(modversions,
+- [ --enable-modversions enable modeversions support (default=auto-detect)],
+- [ if test $enableval = "yes"; then MODVERSIONS="yes"; else MODVERSIONS=""; fi ],)
+-
+- if test $MODVERSIONS; then
+- AC_MSG_CHECKING(modversions.h)
+- if test -f $KERNEL_HDR/linux/modversions.h; then
+- MODV_FILE="$KERNEL_HDR/linux/modversions.h"
+- fi
+-
+- if test -f $KERNEL_HDR/config/modversions.h; then
+- MODV_FILE="$KERNEL_HDR/config/modversions.h"
+- fi
+-
+- if test $MODV_FILE; then
+- MODV_FLAGS="-DMODVERSIONS -include $MODV_FILE"
+- AC_MSG_RESULT([$MODV_FILE])
+- else
+- AC_MSG_ERROR([not found!])
+- fi
+- fi
+-
+- AC_SUBST(MODV_FLAGS)
+- AC_SUBST(KERNEL_DIR)
+- AC_SUBST(MODULES_DIR)
+- AC_SUBST(KERNEL_HDR)
+-
+- fi
+-fi
+-AC_SUBST(OS_DIR)
+-
+-
+ dnl options
+ AC_ARG_ENABLE(debug,
+ [ --enable-debug enable debug messages to stdout (default=no)],
diff --git a/sys-fs/lufs/lufs-0.9.7-r3.ebuild b/sys-fs/lufs/lufs-0.9.7-r3.ebuild
new file mode 100644
index 000000000000..07d107b75c09
--- /dev/null
+++ b/sys-fs/lufs/lufs-0.9.7-r3.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils autotools
+
+DESCRIPTION="User-mode filesystem implementation"
+HOMEPAGE="http://sourceforge.net/projects/lufs/"
+SRC_URI="mirror://sourceforge/lufs/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 ppc ~amd64"
+IUSE="debug"
+
+RDEPEND="sys-fs/lufis"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-fPIC.patch
+ epatch "${FILESDIR}"/lufs-automount-port.diff
+ epatch "${FILESDIR}"/${P}-enable-gnome-2.patch
+ epatch "${FILESDIR}"/lufs-no-kernel.patch
+ epatch "${FILESDIR}"/${P}-gcc43.patch
+
+ filesystems="ftpfs localfs"
+ use amd64 || filesystems+=" sshfs"
+
+ eautoreconf
+}
+
+src_compile() {
+ einfo "Compiling for ${filesystems}"
+ unset ARCH
+ econf $(use_enable debug) || die
+
+ cd filesystems
+ local i
+ for i in ${filesystems} ; do
+ cd ${i}
+ emake || die "emake ${i} failed"
+ cd ..
+ done
+}
+
+src_install() {
+ cd filesystems
+ local i
+ for i in ${filesystems} ; do
+ cd ${i}
+ emake DESTDIR="${D}" install || die "emake install ${i} failed"
+ cd ..
+ done
+}
+
+pkg_postinst() {
+ ewarn "Lufs Kernel support and lufsd,lufsmnt have been disabled in favour"
+ ewarn "of lufis, please use lufis to mount lufs-filesystems, eg:"
+ if use amd64; then
+ elog "# lufis fs=ftpfs,host=ftp.kernel.org /mnt/lufis/ -s"
+ else
+ elog "# lufis fs=sshfs,host=dev.gentoo.org,username=genstef /mnt/lufis/ -s"
+ fi
+ ewarn "If something does not work for you with this setup please"
+ ewarn "complain to bugs.gentoo.org"
+ einfo "Note: There is also the native sshfs-fuse implementation now"
+ use amd64 && ewarn "lufs-sshfs does not work on amd64 and is disabled there."
+}
diff --git a/sys-fs/lufs/metadata.xml b/sys-fs/lufs/metadata.xml
new file mode 100644
index 000000000000..65b57aa6ecc4
--- /dev/null
+++ b/sys-fs/lufs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">lufs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
new file mode 100644
index 000000000000..682252695a88
--- /dev/null
+++ b/sys-fs/lvm2/Manifest
@@ -0,0 +1,4 @@
+DIST LVM2.2.02.103.tgz 1343887 SHA256 71c5a2e8842ed2f13f52e02b44eb183110a3410dedd1e117348e4eecc29d3c2a SHA512 1a9920947312e3e248bff7ff5d5eb54dec3f3b05eb3388fa92f95369b26ae8e6838186f87d817b09e8c635ddc3cdf51bc1d07c2a9d65fd7eab33598998bb7afe WHIRLPOOL de96dd8b7fb46ec777f34169759852ee5ef03ccdc93e110bf63c92dddb9cf4f805635444ceeead6b581610d2a23217d3b4729c286f016623f73b99c0b35a42a0
+DIST LVM2.2.02.109.tgz 1482167 SHA256 7bc95ba5209c8aa5bd492167b2e2797f156852ed11cfc63fb783070ade8e65e7 SHA512 210645cccf297112ffdbc63e0336385c31b2d17d226ae10813ba8ffd4f01ce07af44a4134e60644283e4360e10e925113e867378502ae0166f3fc91258caea68 WHIRLPOOL 7f2d91446f502440b2ed73df0f2ce29069364bbb198e675223b61c17e5cc6e1c162ce60a977cb07b71e44d672c688bbbf0247380f1b9c5adf325cf324f4c4bb7
+DIST LVM2.2.02.110.tgz 1487448 SHA256 3dad1aa04a71b8420b15f44c53f041001436539d3f8073490c2d0c52f6fecd11 SHA512 5b4dfa5ed877d34efa5b109dc712e8fa9154b4954b267b0243f1925f9d2fa8c67f4ce8da36a85f3bba6c117f6153fdbf150e3753587ab90584a86d2654dc0812 WHIRLPOOL ea221ed3e9d3f79009d7c341a7a75b52eacc5be79e28f2498e7cdc0f4a97c2bebff405b032eb8086d3b5b5aaf79da2f281c5734562355bddbe6004058e114ced
+DIST LVM2.2.02.116.tgz 1538340 SHA256 2479d6ea61c405efcfcd8a78390d00c1d2e9c92c0262f3ed599f2c0fb6f0b767 SHA512 992541339637d597257850b4ff7f5348fb7cdcccf806ac8d986a3be1ad1edc5f6bfaedeed5128690c541d1a485cdc75742e90a766363c39867901003518fb84d WHIRLPOOL 1e89ec941882fddba62c9649be46eb5bc6c9cb899669d4bbe4a4a1023c8bf7d8264c4815ef88bb39dedcb9637815411feb826aa102e629d77b80e45e099e398d
diff --git a/sys-fs/lvm2/files/clvmd.confd-2.02.39 b/sys-fs/lvm2/files/clvmd.confd-2.02.39
new file mode 100644
index 000000000000..57821709f5f8
--- /dev/null
+++ b/sys-fs/lvm2/files/clvmd.confd-2.02.39
@@ -0,0 +1,9 @@
+# CLVMD_CLUSTER_TIMEOUT -- amount of time to wait for cluster quorum.
+
+CLVMD_CLUSTER_TIMEOUT=30
+
+
+# CLVMD_NODES_TIMEOUT -- amount of time to wait for the other nodes to
+# join the cluster.
+
+CLVMD_NODES_TIMEOUT=60
diff --git a/sys-fs/lvm2/files/clvmd.rc-2.02.39 b/sys-fs/lvm2/files/clvmd.rc-2.02.39
new file mode 100755
index 000000000000..5bba99af1957
--- /dev/null
+++ b/sys-fs/lvm2/files/clvmd.rc-2.02.39
@@ -0,0 +1,146 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -x /usr/sbin/clvmd ] && CLVMD_BIN="/usr/sbin/clvmd" || CLVMD_BIN="/sbin/clvmd"
+
+[ -z "$CLVMD_CLUSTER_TIMEOUT" ] && CLVMD_CLUSTER_TIMEOUT=30
+[ -n "$CLVMD_NODES_TIMEOUT" ] || CLVMD_NODES_TIMEOUT=60
+
+VGCHANGE="/sbin/vgchange"
+VGSCAN="/sbin/vgscan"
+VGDISPLAY="/sbin/vgdisplay"
+CLVMD_PIDFILE="/var/run/clvmd.pid"
+
+depend() {
+ use net dns logger dmeventd
+ need cman
+}
+
+load_modules() {
+ local module modules
+ modules=$1
+
+ for module in ${modules}; do
+ ebegin "Loading ${module} kernel module"
+ modprobe ${module}
+ eend $? "Failed to load ${module} kernel module"
+ done
+}
+
+unload_modules() {
+ local module modules
+ modules=$1
+
+ for module in ${modules}; do
+ ebegin "Unloading ${module} kernel module"
+ modprobe -r ${module}
+ eend $? "Failed to unload ${module} kernel module"
+ done
+}
+
+umount_gfs_filesystems() {
+ local sig retry
+ local remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
+
+ if [ -n "${remaining}" ]
+ then
+ sig=
+ retry=3
+ while [ -n "${remaining}" -a "${retry}" -gt 0 ]
+ do
+ if [ "${retry}" -lt 3 ]
+ then
+ ebegin "Unmounting GFS filesystems (retry)"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems this retry"
+ else
+ ebegin "Unmounting GFS filesystems"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems"
+ fi
+ remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
+ [ -z "${remaining}" ] && break
+ /bin/fuser -k -m ${sig} ${remaining} &>/dev/null
+ sleep 5
+ retry=$((${retry} -1))
+ sig=-9
+ done
+ fi
+}
+
+
+start_volumes() {
+ ebegin "Scanning LVM volumes"
+ $VGSCAN > /dev/null 2>&1
+ eend $?
+
+ ret=$?
+ if [ "$ret" -eq 5 ]
+ then
+ einfo " Waiting for other nodes to join the cluster ($CLVMD_NODES_TIMEOUT seconds)"
+ fi
+
+ clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
+ for vg in $clustervgs; do
+ ebegin " Activating Clustered VG: ${vg} "
+
+ wait=0
+ while [ -n "$($VGCHANGE -a y ${vg} 2>&1 |grep "clvmd not running")" ]; do
+ if [ $wait -lt $CLVMD_NODES_TIMEOUT ]; then
+ sleep 3
+ wait=$(($wait + 3))
+ else
+ eend 1
+ fi
+ done
+ eend 0
+ done
+}
+
+stop_volumes() {
+ # Deactivate only clustered volumes
+ clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
+ for vg in $clustervgs; do
+ ebegin " Shutting Down Clustered VG: ${vg} "
+ $VGCHANGE -anl ${vg} >/dev/null
+ eend $?
+ done
+}
+
+
+start() {
+ local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices})
+
+ if [ -z "${module}" ]; then
+ load_modules "dm-mod"
+ sleep 1s
+ fi
+
+ ebegin "Starting clvmd ($CLVMD_CLUSTER_TIMEOUT seconds)"
+
+ start-stop-daemon --start --quiet --exec ${CLVMD_BIN} -- -T ${CLVMD_CLUSTER_TIMEOUT}
+ eend $?
+
+ start_volumes
+}
+
+stop() {
+
+ # umount GFS filesystems
+ umount_gfs_filesystems
+
+ #stop_volumes
+
+ ebegin "Stopping clvmd"
+ #start-stop-daemon --stop -s TERM --quiet --exec ${CLVMD_BIN} --name clvmd
+ killall -TERM ${CLVMD_BIN} >/dev/null
+ eend $?
+
+ #local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/modules)
+
+ #if [[ "$?" -eq 0 && ! -z "${module}" ]]; then
+ # unload_modules "dm-mod"
+ #fi
+}
diff --git a/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 b/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3
new file mode 100644
index 000000000000..bc7a25158635
--- /dev/null
+++ b/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3
@@ -0,0 +1 @@
+RC_AFTER="lvm"
diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2 b/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
new file mode 100644
index 000000000000..5e3669d0ab5c
--- /dev/null
+++ b/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
@@ -0,0 +1,147 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ before dmeventd checkfs fsck
+ after modules
+}
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+# char **build_dmsetup_command(volume)
+#
+# Returns complete dmsetup command given single volume name
+build_dmsetup_command() {
+ local count dmsetup_cmd
+
+ # Number of lines mentioning volume name
+ count=$(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | grep -c ${1})
+
+ # If there's just one line:
+ if [ ${count} -eq 1 ] ; then
+ echo "echo $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk '{$1=""; print $0}') | /sbin/dmsetup create ${1}"
+
+ # For all cases with more lines:
+ elif [ ${count} -gt 1 ] ; then
+ for c in $( seq 1 ${count} ) ; do
+ if [ ${c} -eq 1 ] ; then
+ # Heavy escaping in awk-statement because we cannot use apostrophes
+ dmsetup_cmd="echo -e $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
+ else
+ # Append starting with newline
+ dmsetup_cmd="${dmsetup_cmd}\\\\n \
+ $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
+ fi
+ done
+ echo "${dmsetup_cmd} | /sbin/dmsetup create ${1}"
+ fi
+
+ return 0
+}
+
+# char **get_new_dm_volumes(void)
+#
+# Return unique volumes from /etc/dmtab
+get_new_dm_volumes() {
+ local volume
+
+ # Filter comments and blank lines
+ grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ awk '{ print $1 }' | \
+ uniq | \
+ while read volume ; do
+ # If it exists, skip it
+ dmvolume_exists "${volume%:}" && continue
+
+ echo "${volume%:}"
+ done
+
+ return 0
+}
+
+# int dmvolume_exists(volume)
+#
+# Return true if volume exists in DM table
+dmvolume_exists() {
+ local x line volume=$1
+
+ [ -z "${volume}" ] && return 1
+
+ /sbin/dmsetup ls 2>/dev/null | \
+ while read line ; do
+ for x in ${line} ; do
+ # the following conditonal return only breaks out
+ # of the while loop, as it is running in a pipe.
+ [ "${x}" = "${volume}" ] && return 1
+ # We only want to check the volume name
+ break
+ done
+ done
+
+ # if 1 was returned from the above loop, then indicate that
+ # volume exists
+ [ $? = 1 ] && return 0
+
+ # otherwise the loop exited normally and the volume does not
+ # exist
+ return 1
+}
+
+# int is_empty_dm_volume(volume)
+#
+# Return true if the volume exists in DM table, but is empty/non-valid
+is_empty_dm_volume() {
+ local table volume=$1
+
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
+}
+
+
+start() {
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ # Ensure the dirs exist for locking and running
+ checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
+
+ local x volume
+
+ if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
+ einfo " Setting up device-mapper volumes:"
+
+ get_new_dm_volumes | \
+ while read x ; do
+ [ -n "${x}" ] || continue
+
+ volume="${x##* }"
+
+ ebegin " Creating volume: ${volume}"
+ if ! eval $(build_dmsetup_command ${volume}) >/dev/null 2>/dev/null ; then
+ eend 1 " Error creating volume: ${volume}"
+ # dmsetup still adds an empty volume in some cases,
+ # so lets remove it
+ is_empty_dm_volume "${volume}" && \
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
+ else
+ eend 0
+ fi
+ done
+ fi
+}
+
diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2 b/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2
new file mode 100644
index 000000000000..4cd506a41ff5
--- /dev/null
+++ b/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2
@@ -0,0 +1,111 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ before dmeventd checkfs fsck
+ after modules
+}
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+# char **get_new_dm_volumes(void)
+#
+# Return dmsetup commands to setup volumes
+get_new_dm_volumes() {
+ local volume params
+
+ # Filter comments and blank lines
+ grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ while read volume params ; do
+ # If it exists, skip it
+ dmvolume_exists "${volume%:}" && continue
+ # Assemble the command to run to create volume
+ echo "echo ${params} | /sbin/dmsetup create ${volume%:}"
+ done
+
+ return 0
+}
+
+# int dmvolume_exists(volume)
+#
+# Return true if volume exists in DM table
+dmvolume_exists() {
+ local x line volume=$1
+
+ [ -z "${volume}" ] && return 1
+
+ /sbin/dmsetup ls 2>/dev/null | \
+ while read line ; do
+ for x in ${line} ; do
+ # the following conditonal return only breaks out
+ # of the while loop, as it is running in a pipe.
+ [ "${x}" = "${volume}" ] && return 1
+ # We only want to check the volume name
+ break
+ done
+ done
+
+ # if 1 was returned from the above loop, then indicate that
+ # volume exists
+ [ $? = 1 ] && return 0
+
+ # otherwise the loop exited normally and the volume does not
+ # exist
+ return 1
+}
+
+# int is_empty_dm_volume(volume)
+#
+# Return true if the volume exists in DM table, but is empty/non-valid
+is_empty_dm_volume() {
+ local table volume=$1
+
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
+}
+
+
+start() {
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ # Ensure the dirs exist for locking and running
+ checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
+
+ local x volume
+
+ if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
+ einfo " Setting up device-mapper volumes:"
+
+ get_new_dm_volumes | \
+ while read x ; do
+ [ -n "${x}" ] || continue
+
+ volume="${x##* }"
+
+ ebegin " Creating volume: ${volume}"
+ if ! eval "${x}" >/dev/null 2>/dev/null ; then
+ eend 1 " Error creating volume: ${volume}"
+ # dmsetup still adds an empty volume in some cases,
+ # so lets remove it
+ is_empty_dm_volume "${volume}" && \
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
+ else
+ eend 0
+ fi
+ done
+ fi
+}
+
diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1 b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
new file mode 100644
index 000000000000..7067391f03e3
--- /dev/null
+++ b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PIDFILE=/run/dmeventd.pid
+BIN=/sbin/dmeventd
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ after lvm device-mapper
+}
+
+start() {
+ ebegin "Starting dmeventd"
+ start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dmeventd"
+ start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
diff --git a/sys-fs/lvm2/files/dmtab b/sys-fs/lvm2/files/dmtab
new file mode 100644
index 000000000000..0f3f05a426de
--- /dev/null
+++ b/sys-fs/lvm2/files/dmtab
@@ -0,0 +1,12 @@
+#/etc/dmraid: config file for adding device-mapper volumes at boot
+# $Id$
+
+# Format: <volume name>: <table>
+# Example: isw0: 0 312602976 striped 2 128 /dev/sda 0 /dev/sdb 0
+#
+# Alternatively you can create all your volumes the first time, and just run:
+#
+# dmsetup table >> /etc/dmtab
+#
+# and verify that they are correct.
+
diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
new file mode 100644
index 000000000000..fd76d96dff8a
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# This script is based on upstream file
+# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ need lvm dmeventd
+}
+
+VGCHANGE=/sbin/vgchange
+VGS=/sbin/vgs
+
+start() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+ ebegin "Starting LVM monitoring for VGs ${VGSLIST}:"
+ $VGCHANGE --monitor y --poll y ${VGSLIST}
+ ret=$?
+ eend $ret
+ return $ret
+
+}
+
+stop() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+ ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:"
+ $VGCHANGE --monitor n ${VGSLIST}
+ ret=$?
+ eend $ret
+ return $ret
+}
diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2
new file mode 100644
index 000000000000..2a96706cad06
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# This script is based on upstream file
+# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ need lvm dmeventd
+}
+
+VGCHANGE=/sbin/vgchange
+VGS=/sbin/vgs
+
+start() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
+ for vg in $VGSLIST
+ do
+ ebegin "Starting LVM monitoring for VG $vg:"
+ $VGCHANGE --monitor y --poll y $vg
+ ret2=$?
+ eend $ret2
+ [ $ret2 -ne 0 ] && ret=$ret2
+ done
+ return $ret
+}
+
+stop() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
+ for vg in $VGSLIST
+ do
+ ebegin "Stopping LVM monitoring for VG $vg:"
+ $VGCHANGE --monitor n $vg
+ ret2=$?
+ eend $ret2
+ [ $ret2 -ne 0 ] && ret=$ret2
+ done
+ return $ret
+}
diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2 b/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
new file mode 100644
index 000000000000..2fbd8668c376
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
@@ -0,0 +1,5 @@
+# LVM should normally only be started after mdraid is available
+# this is because LVM physical volumes are very often MD devices.
+RC_AFTER="mdraid"
+
+# vim: ft=gentoo-conf-d
diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
new file mode 100644
index 000000000000..62ddac41e3a2
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
@@ -0,0 +1,97 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before checkfs fsck
+ after modules device-mapper
+ need lvmetad sysfs
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+# Stop LVM2
+if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ln ${VGS}\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed (possibly some LVs still needed for /usr or root)"
+ fi
+
+ einfo "Finished shutting down the Logical Volume Manager"
+ return 0
+fi
+}
+
+# vim:ts=4
diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.95-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.95-r2
new file mode 100644
index 000000000000..d0d9e318c56b
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.95-r2
@@ -0,0 +1,96 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use dmeventd
+ before checkfs fsck
+ after dmeventd modules device-mapper
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+# Stop LVM2
+if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ln\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed"
+ fi
+
+ einfo "Finished Shutting down the Logical Volume Manager"
+fi
+}
+
+# vim:ts=4
diff --git a/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch b/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch
new file mode 100644
index 000000000000..d6c8e5fd45c5
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch
@@ -0,0 +1,93 @@
+diff -ur LVM2.2.02.100.orig/configure.in LVM2.2.02.100/configure.in
+--- LVM2.2.02.100.orig/configure.in 2013-08-13 13:44:43.000000000 +0300
++++ LVM2.2.02.100/configure.in 2013-09-12 23:23:19.365329440 +0300
+@@ -954,6 +954,7 @@
+ pkg_config_init
+ fi
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+
+@@ -1199,19 +1200,32 @@
+ if test x$SELINUX = xyes; then
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+- SELINUX_LIBS="-lsepol"])
++ SEPOL_LIBS="-lsepol"])
+
+- AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+- AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+- AC_CHECK_HEADERS([selinux/label.h])
+- AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++ dnl -- init pkgconfig if required
++ if test x$PKGCONFIG_INIT != x1; then
++ pkg_config_init
++ fi
++ PKG_CHECK_MODULES(SELINUX, libselinux, [
+ SELINUX_PC="libselinux"
+- HAVE_SELINUX=yes ], [
+- AC_MSG_WARN(Disabling selinux)
+- SELINUX_LIBS=
+- SELINUX_PC=
+- HAVE_SELINUX=no ])
++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ ],[
++ dnl -- old non-pkgconfig method, is buggy with static builds
++ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
++ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
++ AC_CHECK_HEADERS([selinux/label.h])
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
++ SELINUX_STATIC_LIBS="$SELINUX_LIBS"
++ SELINUX_PC="libselinux"
++ HAVE_SELINUX=yes ], [
++ AC_MSG_WARN(Disabling selinux)
++ SELINUX_LIBS=
++ SELINUX_PC=
++ HAVE_SELINUX=no ])
++ ])
+ fi
+
+ ################################################################################
+@@ -1615,6 +1629,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -1625,6 +1640,7 @@
+ AC_SUBST(THIN_DUMP_CMD)
+ AC_SUBST(THIN_REPAIR_CMD)
+ AC_SUBST(UDEV_LIBS)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+diff -ur LVM2.2.02.100.orig/make.tmpl.in LVM2.2.02.100/make.tmpl.in
+--- LVM2.2.02.100.orig/make.tmpl.in 2013-08-13 13:44:43.000000000 +0300
++++ LVM2.2.02.100/make.tmpl.in 2013-09-12 23:22:58.125328808 +0300
+@@ -32,7 +32,7 @@
+
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS += @CFLAGS@ @UDEV_CFLAGS@
+@@ -46,7 +46,9 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ TESTING = @TESTING@
+
+ # Setup directory variables
diff --git a/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch
new file mode 100644
index 000000000000..594d60617259
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch
@@ -0,0 +1,32 @@
+Make sure that libdm usage always brings in pthread libraries, both in
+pkgconfig and during manual build.
+
+--- tools/Makefile.in
++++ tools/Makefile.in
+@@ -87,6 +87,7 @@
+ INSTALL_LVM_TARGETS += install_tools_static
+ INSTALL_DMSETUP_TARGETS += install_dmsetup_static
+ INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++ STATIC_LIBS += @PTHREAD_LIBS@
+ endif
+
+ LVMLIBS = $(LVMINTERNAL_LIBS)
+@@ -118,6 +119,10 @@
+
+ include $(top_builddir)/make.tmpl
+
++ifeq ("@STATIC_LINK@", "yes")
++ STATIC_LIBS += @PTHREAD_LIBS@
++endif
++
+ device-mapper: $(TARGETS_DM)
+
+ CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)
+--- libdm/libdevmapper.pc.in
++++ libdm/libdevmapper.pc.in
+@@ -8,4 +8,5 @@
+ Version: @DM_LIB_PATCHLEVEL@
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -ldevmapper
++Libs.private: -L${libdir} @PTHREAD_LIBS@
+ Requires.private: @SELINUX_PC@ @UDEV_PC@
diff --git a/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch
new file mode 100644
index 000000000000..723cd0e276e2
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch
@@ -0,0 +1,104 @@
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/configure.in LVM2.2.02.107/configure.in
+--- LVM2.2.02.107.orig/configure.in 2014-07-15 12:57:55.867439868 -0700
++++ LVM2.2.02.107/configure.in 2014-07-15 17:24:02.662666091 -0700
+@@ -997,6 +997,7 @@
+ fi])
+ if test "$BLKID_WIPING" = yes; then
+ BLKID_PC="blkid"
++ BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ fi
+ fi
+@@ -1022,6 +1023,7 @@
+ if test "$UDEV_SYNC" = yes; then
+ pkg_config_init
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+
+@@ -1242,19 +1244,32 @@
+ if test "$SELINUX" = yes; then
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+- SELINUX_LIBS="-lsepol"])
++ SEPOL_LIBS="-lsepol"])
++
++ dnl -- init pkgconfig if required
++ if test x$PKGCONFIG_INIT != x1; then
++ pkg_config_init
++ fi
++ PKG_CHECK_MODULES(SELINUX, libselinux, [
++ SELINUX_PC="libselinux"
++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ ],[
++ dnl -- old non-pkgconfig method, is buggy with static builds
+
+ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ AC_CHECK_HEADERS([selinux/label.h])
+ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ SELINUX_PC="libselinux"
+ HAVE_SELINUX=yes ], [
+ AC_MSG_WARN(Disabling selinux)
+ SELINUX_LIBS=
+ SELINUX_PC=
+ HAVE_SELINUX=no ])
++ ])
+ fi
+
+ ################################################################################
+@@ -1556,6 +1571,7 @@
+ ################################################################################
+ AC_SUBST(APPLIB)
+ AC_SUBST(AWK)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BLKID_PC)
+ AC_SUBST(BLKID_WIPING)
+ AC_SUBST(BUILD_CMIRRORD)
+@@ -1651,6 +1667,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -1662,6 +1679,7 @@
+ AC_SUBST(THIN_DUMP_CMD)
+ AC_SUBST(THIN_REPAIR_CMD)
+ AC_SUBST(THIN_RESTORE_CMD)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/make.tmpl.in LVM2.2.02.107/make.tmpl.in
+--- LVM2.2.02.107.orig/make.tmpl.in 2014-07-15 12:57:55.868439884 -0700
++++ LVM2.2.02.107/make.tmpl.in 2014-07-15 17:23:24.060055838 -0700
+@@ -44,7 +44,7 @@
+
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS += @CFLAGS@
+@@ -59,10 +59,13 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ TESTING = @TESTING@
+
+ # Setup directory variables
diff --git a/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch
new file mode 100644
index 000000000000..af5a5afe258d
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch
@@ -0,0 +1,50 @@
+Maintainer note: Forward ported without editing from lvm2-2.02.99-example.conf.in.patch to apply cleanly.
+
+--- conf/example.conf.in
++++ conf/example.conf.in
+@@ -105,6 +105,10 @@
+ # By default we accept every block device:
+ # filter = [ "a/.*/" ]
+
++ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++ # noise when you probed while not available.
++ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
++
+ # Exclude the cdrom drive
+ # filter = [ "r|/dev/cdrom|" ]
+
+@@ -522,7 +526,8 @@
+ # e.g. vgscan.lvm1 and they will stop working after you start using
+ # the new lvm2 on-disk metadata format.
+ # The default value is set when the tools are built.
+- # fallback_to_lvm1 = 0
++ # Gentoo: the LVM tools are a seperate package.
++ fallback_to_lvm1 = 0
+
+ # The default metadata format that commands should use - "lvm1" or "lvm2".
+ # The command line override is -M1 or -M2.
+@@ -1182,12 +1187,13 @@
+
+ # Metadata settings
+ #
+-# metadata {
++metadata {
+ # Default number of copies of metadata to hold on each PV. 0, 1 or 2.
+ # You might want to override it from the command line with 0
+ # when running pvcreate on new PVs which are to be added to large VGs.
+
+- # pvmetadatacopies = 1
++ # Gentoo: enable for data safety, but PV resize is then disabled.
++ # pvmetadatacopies = 2
+
+ # Default number of copies of metadata to maintain for each VG.
+ # If set to a non-zero value, LVM automatically chooses which of
+@@ -1222,7 +1228,7 @@
+ # the supplied toolset to make changes (e.g. vgcfgrestore).
+
+ # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
+-#}
++}
+
+ # Event daemon
+ #
diff --git a/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch
new file mode 100644
index 000000000000..3ab699868a5d
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch
@@ -0,0 +1,104 @@
+Maintainer note: Forward ported without editing from lvm2-2.02.107-static-pkgconfig-libs.patch to apply cleanly.
+
+--- configure.in
++++ configure.in
+@@ -1067,6 +1067,7 @@
+ fi])
+ if test "$BLKID_WIPING" = yes; then
+ BLKID_PC="blkid"
++ BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ fi
+ fi
+@@ -1092,6 +1093,7 @@
+ if test "$UDEV_SYNC" = yes; then
+ pkg_config_init
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+
+@@ -1312,19 +1314,32 @@
+ if test "$SELINUX" = yes; then
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+- SELINUX_LIBS="-lsepol"])
++ SEPOL_LIBS="-lsepol"])
++
++ dnl -- init pkgconfig if required
++ if test x$PKGCONFIG_INIT != x1; then
++ pkg_config_init
++ fi
++ PKG_CHECK_MODULES(SELINUX, libselinux, [
++ SELINUX_PC="libselinux"
++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ ],[
++ dnl -- old non-pkgconfig method, is buggy with static builds
+
+ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ AC_CHECK_HEADERS([selinux/label.h])
+ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ SELINUX_PC="libselinux"
+ HAVE_SELINUX=yes ], [
+ AC_MSG_WARN(Disabling selinux)
+ SELINUX_LIBS=
+ SELINUX_PC=
+ HAVE_SELINUX=no ])
++ ])
+ fi
+
+ ################################################################################
+@@ -1626,6 +1641,7 @@
+ ################################################################################
+ AC_SUBST(APPLIB)
+ AC_SUBST(AWK)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BLKID_PC)
+ AC_SUBST(BLKID_WIPING)
+ AC_SUBST(BUILD_CMIRRORD)
+@@ -1721,6 +1737,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -1735,6 +1752,7 @@
+ AC_SUBST(CACHE_DUMP_CMD)
+ AC_SUBST(CACHE_REPAIR_CMD)
+ AC_SUBST(CACHE_RESTORE_CMD)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+--- make.tmpl.in
++++ make.tmpl.in
+@@ -43,7 +43,7 @@
+
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS += @CFLAGS@
+@@ -57,10 +57,13 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ TESTING = @TESTING@
+
+ # Setup directory variables
diff --git a/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch b/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch
new file mode 100644
index 000000000000..59aaa9b34a08
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch
@@ -0,0 +1,72 @@
+--- LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd.orig 2006-11-21 22:41:56.000000000 +0000
++++ LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd 2009-12-26 01:47:08.025224602 +0000
+@@ -54,7 +54,9 @@
+ DEVRAM=/tmp/initrd.$$
+
+ # set defaults
+-BINFILES=${BINFILES:-"`which lvm` `which bash` `which busybox` `which pivot_root`"}
++LVM=`which lvm.static`
++LVM=${LVM:-"`which lvm`"}
++BINFILES=${BINFILES:-"${LVM} `which bash` `which busybox` `which pivot_root`"}
+ BASICDEVICES=${BASICDEVICES:-"std consoleonly fd"}
+ BLOCKDEVICES=${BLOCKDEVICES:-"md hda hdb hdc hdd sda sdb sdc sdd"}
+ MAKEDEV=${MAKEDEV:-"debian"}
+@@ -119,6 +121,10 @@
+ echo "$PRE Mounting /proc"
+ mount -t proc none /proc
+
++# We need /sys for lvm
++echo "$PRE Mounting /sys"
++mount -t sysfs sysfs /sys
++
+ # plug in modules listed in /etc/modules
+ if [ -f /etc/modules ]; then
+ echo -n "$PRE plugging in kernel modules:"
+@@ -179,26 +185,29 @@
+ # run a shell if we're passed lvm2rescue on commandline
+ grep lvm2rescue /proc/cmdline 1>/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+- lvm vgchange --ignorelockingfailure -P -a y
++ $LVM vgchange --ignorelockingfailure -P -a y
+ do_shell
+ else
+- lvm vgchange --ignorelockingfailure -a y
++ $LVM vgchange --ignorelockingfailure -a y
+ fi
+
+ echo "$PRE Mounting root filesystem $rootvol ro"
+ mkdir /rootvol
+ if ! mount -t auto -o ro $rootvol /rootvol; then
+- echo "\t*FAILED*";
++ echo "\t*FAILED TRYING TO MOUNT ROOTVOL*";
+ do_shell
+ fi
+
+ echo "$PRE Umounting /proc"
+ umount /proc
+
++echo "$PRE Umounting /sys"
++umount /sys
++
+ echo "$PRE Changing roots"
+ cd /rootvol
+ if ! pivot_root . initrd ; then
+- echo "\t*FAILED*"
++ echo "\t*FAILED PIVOT TO NEW ROOT*"
+ do_shell
+ fi
+
+@@ -356,7 +365,7 @@
+ fi
+
+ verbose "creating basic set of directories in $TMPMNT"
+-(cd $TMPMNT; mkdir bin dev etc lib proc sbin var)
++(cd $TMPMNT; mkdir bin dev etc lib proc sbin sys var)
+ if [ $? -ne 0 ]; then
+ echo "$cmd -- ERROR creating directories in $TMPMNT"
+ cleanup 1
+@@ -499,4 +508,3 @@
+ FINALTXT
+
+ cleanup 0
+-
diff --git a/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch b/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch
new file mode 100644
index 000000000000..5ddcb4e56711
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch
@@ -0,0 +1,42 @@
+diff -Nuar --exclude '*~' LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in LVM2.2.02.63/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in 2010-04-09 14:42:48.000000000 -0700
++++ LVM2.2.02.63/daemons/dmeventd/Makefile.in 2010-04-19 11:53:27.000000000 -0700
+@@ -28,11 +28,12 @@
+ INSTALL_LIB_TARGETS = install_lib_dynamic
+
+ LIB_NAME = libdevmapper-event
++LIB_STATIC = $(LIB_NAME).a
++INSTALL_LIB_TARGETS += install_lib_static
++TARGETS += $(LIB_STATIC)
+ ifeq ("@STATIC_LINK@", "yes")
+- LIB_STATIC = $(LIB_NAME).a
+- TARGETS += $(LIB_STATIC) dmeventd.static
++ TARGETS += dmeventd.static
+ INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
+- INSTALL_LIB_TARGETS += install_lib_static
+ endif
+
+ LIB_VERSION = $(LIB_VERSION_DM)
+diff -Nuar --exclude '*~' LVM2.2.02.63.orig/libdm/Makefile.in LVM2.2.02.63/libdm/Makefile.in
+--- LVM2.2.02.63.orig/libdm/Makefile.in 2010-04-09 14:42:51.000000000 -0700
++++ LVM2.2.02.63/libdm/Makefile.in 2010-04-19 11:52:20.000000000 -0700
+@@ -34,8 +34,8 @@
+
+ INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
+
+-ifeq ("@STATIC_LINK@", "yes")
+ LIB_STATIC = $(interface)/libdevmapper.a
++ifeq ("@STATIC_LINK@", "yes")
+ endif
+
+ LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
+@@ -63,8 +63,8 @@
+
+ INSTALL_TYPE = install_dynamic
+
+-ifeq ("@STATIC_LINK@", "yes")
+ INSTALL_TYPE += install_static
++ifeq ("@STATIC_LINK@", "yes")
+ endif
+
+ ifeq ("@PKGCONFIG@", "yes")
diff --git a/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch b/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch
new file mode 100644
index 000000000000..7f0bfb894f02
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch
@@ -0,0 +1,18 @@
+X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=301331
+X-Gentoo-Bug: 301331
+
+diff -Nuar LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd
+--- LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd 2010-06-07 18:44:34.182980475 +0000
++++ LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd 2010-06-07 18:51:27.636312899 +0000
+@@ -469,9 +469,9 @@
+ rmdir $TMPMNT/lost+found
+
+ echo "$cmd -- ummounting ram disk"
+-umount $DEVRAM
++umount $TMPMNT
+ if [ $? -ne 0 ]; then
+- echo "$cmd -- ERROR umounting $DEVRAM"
++ echo "$cmd -- ERROR umounting $TMPMNT"
+ cleanup 1
+ fi
+
diff --git a/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch b/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch
new file mode 100644
index 000000000000..7576e1923ca2
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/330255
+
+liblvm2app.so: undefined reference to `floor'
+
+--- liblvm/Makefile.in
++++ liblvm/Makefile.in
+@@ -39,7 +39,7 @@
+
+ include $(top_builddir)/make.tmpl
+
+-LIBS += $(LVMINTERNAL_LIBS) -ldevmapper
++LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -lm
+
+ ifeq ("@DMEVENTD@", "yes")
+ LIBS += -ldevmapper-event
diff --git a/sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch
new file mode 100644
index 000000000000..de2b294ef3e4
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch
@@ -0,0 +1,63 @@
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/configure.in LVM2.2.02.92/configure.in
+--- LVM2.2.02.92.orig/configure.in 2012-02-20 11:36:27.000000000 -0800
++++ LVM2.2.02.92/configure.in 2012-02-20 15:53:40.700124222 -0800
+@@ -32,6 +32,7 @@
+ COPTIMISE_FLAG="-O2"
+ CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ ELDFLAGS="-Wl,--export-dynamic"
++ STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ # FIXME Generate list and use --dynamic-list=.dlopen.sym
+ CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -1458,6 +1459,7 @@
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTING)
+ AC_SUBST(THIN)
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/daemons/dmeventd/Makefile.in LVM2.2.02.92/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.92.orig/daemons/dmeventd/Makefile.in 2012-02-20 15:48:04.861683196 -0800
++++ LVM2.2.02.92/daemons/dmeventd/Makefile.in 2012-02-20 15:52:50.732314588 -0800
+@@ -65,7 +65,7 @@
+ $(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
+
+ dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
+- $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
++ $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
+ dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
+
+ ifeq ("@PKGCONFIG@", "yes")
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/make.tmpl.in LVM2.2.02.92/make.tmpl.in
+--- LVM2.2.02.92.orig/make.tmpl.in 2012-02-20 15:48:05.034685963 -0800
++++ LVM2.2.02.92/make.tmpl.in 2012-02-20 15:48:58.622550855 -0800
+@@ -38,6 +38,7 @@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+ LDFLAGS += @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ LIB_SUFFIX = @LIB_SUFFIX@
+ LVMINTERNAL_LIBS = -llvm-internal $(UDEV_LIBS) $(DL_LIBS)
+ DL_LIBS = @DL_LIBS@
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/tools/Makefile.in LVM2.2.02.92/tools/Makefile.in
+--- LVM2.2.02.92.orig/tools/Makefile.in 2011-11-14 13:30:36.000000000 -0800
++++ LVM2.2.02.92/tools/Makefile.in 2012-02-20 15:52:25.242901501 -0800
+@@ -126,7 +126,7 @@
+ -o $@ dmsetup.o -ldevmapper $(LIBS)
+
+ dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
+- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ -o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS)
+
+ all: device-mapper
+@@ -136,7 +136,7 @@
+ $(LVMLIBS) $(READLINE_LIBS) $(LIBS) -rdynamic
+
+ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a
+- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
++ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
+ $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
+
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch
new file mode 100644
index 000000000000..38be5dfaad0e
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch
@@ -0,0 +1,47 @@
+--- conf/example.conf.in
++++ conf/example.conf.in
+@@ -50,7 +50,9 @@
+
+
+ # By default we accept every block device:
+- filter = [ "a/.*/" ]
++ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++ # noise when you probed while not available.
++ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
+
+ # Exclude the cdrom drive
+ # filter = [ "r|/dev/cdrom|" ]
+@@ -259,6 +261,8 @@
+ # the new lvm2 on-disk metadata format.
+ # The default value is set when the tools are built.
+ # fallback_to_lvm1 = 0
++ # Gentoo: the LVM tools are a seperate package.
++ fallback_to_lvm1 = 0
+
+ # The default metadata format that commands should use - "lvm1" or "lvm2".
+ # The command line override is -M1 or -M2.
+@@ -449,12 +453,12 @@
+
+ # Metadata settings
+ #
+-# metadata {
++metadata {
+ # Default number of copies of metadata to hold on each PV. 0, 1 or 2.
+ # You might want to override it from the command line with 0
+ # when running pvcreate on new PVs which are to be added to large VGs.
+-
+- # pvmetadatacopies = 1
++ # Gentoo: enable for data safety, but PV resize is then disabled.
++ #pvmetadatacopies = 2
+
+ # Approximate default size of on-disk metadata areas in sectors.
+ # You should increase this if you have large volume groups or
+@@ -476,7 +480,7 @@
+ # the supplied toolset to make changes (e.g. vgcfgrestore).
+
+ # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
+-#}
++}
+
+ # Event daemon
+ #
diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
new file mode 100644
index 000000000000..364fbd4475f0
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
@@ -0,0 +1,11 @@
+--- make.tmpl.in
++++ make.tmpl.in
+@@ -395,7 +395,7 @@
+ ( cat $(srcdir)/.exported_symbols; \
+ if test x$(EXPORTED_HEADER) != x; then \
+ $(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
+- $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
++ LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
+ fi \
+ ) > $@
+
diff --git a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
new file mode 100755
index 000000000000..abeca75f63aa
--- /dev/null
+++ b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
@@ -0,0 +1,13 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/run/lvmetad.pid"
+command="/sbin/lvmetad"
+command_args="${LVMETAD_OPTS:=-p ${pidfile}}"
+start_stop_daemon_args="--pidfile ${pidfile}"
+
+depend() {
+ :
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.103.ebuild b/sys-fs/lvm2/lvm2-2.02.103.ebuild
new file mode 100644
index 000000000000..c5635d6f8a84
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.103.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs clvm cman +lvm1 lvm2create_initrd selinux +udev +thin"
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+ readline? ( sys-libs/readline )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/clvm
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.2.1 )"
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=virtual/libudev-208:=[static-libs] )
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ # Gentoo specific modification(s):
+ epatch "${FILESDIR}"/${PN}-2.02.99-example.conf.in.patch
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{,.in} || die #480212
+
+ # For upstream -- review and forward:
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+ epatch "${FILESDIR}"/${PN}-2.02.100-selinux_and_udev_static.patch #370217, #439414
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ local buildmode
+
+ myconf="${myconf} --enable-dmeventd"
+ myconf="${myconf} --enable-cmdlib"
+ myconf="${myconf} --enable-applib"
+ myconf="${myconf} --enable-fsadm"
+ myconf="${myconf} --enable-lvmetad"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static; then
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ myconf="${myconf} --enable-static_link"
+ else
+ buildmode="shared"
+ fi
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=internal"
+ myconf="${myconf} --with-snapshots=internal"
+ use thin \
+ && myconf="${myconf} --with-thin=internal" \
+ || myconf="${myconf} --with-thin=none"
+
+ if use lvm1; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}"/etc \
+ --exec-prefix="${EPREFIX}" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}"/sbin \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-dm-run-dir=/run \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-default-pid-dir=/run \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+ "$(systemd_with_unitdir)" \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+}
+
+src_install() {
+ local inst
+ for inst in install install_systemd_units install_systemd_generators install_tmpfiles_configuration; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/lvm.rc-2.02.95-r2 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.67-r2 lvm-monitoring
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.95-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.109-r1.ebuild b/sys-fs/lvm2/lvm2-2.02.109-r1.ebuild
new file mode 100644
index 000000000000..a7127d295bf5
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.109-r1.ebuild
@@ -0,0 +1,270 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
+ static? ( !udev )" #520450
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+ readline? ( sys-libs/readline )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/clvm
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=virtual/libudev-208:=[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ # Gentoo specific modification(s):
+ epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+ if use systemd && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # For upstream -- review and forward:
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+ epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+ sed -i -e 's:|share):|shared):' configure.in || die #520640
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myconf
+ local buildmode
+
+ myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+ myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+ myconf="${myconf} $(use_enable !device-mapper-only applib)"
+ myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+ myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+ use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static; then
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ myconf="${myconf} --enable-static_link"
+ else
+ buildmode="shared"
+ fi
+ dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=${dmbuildmode}"
+ myconf="${myconf} --with-snapshots=${dmbuildmode}"
+ if use thin; then
+ myconf="${myconf} --with-thin=internal --with-cache=internal"
+ local texec
+ for texec in check dump repair restore; do
+ myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+ myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+ done
+ else
+ myconf="${myconf} --with-thin=none --with-cache=none"
+ fi
+
+ if use lvm1; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}"/etc \
+ --exec-prefix="${EPREFIX}" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}"/sbin \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-dm-run-dir=/run \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-default-pid-dir=/run \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+ $(use_enable systemd udev-systemd-background-jobs) \
+ "$(systemd_with_unitdir)" \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst
+ INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
+ use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+ for inst in ${INSTALL_TARGETS}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+ fi
+
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.109.ebuild b/sys-fs/lvm2/lvm2-2.02.109.ebuild
new file mode 100644
index 000000000000..5b311d1a30c3
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.109.ebuild
@@ -0,0 +1,269 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )"
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+ readline? ( sys-libs/readline )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/clvm
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=virtual/libudev-208:=[static-libs] )
+ <sys-apps/util-linux-2.25[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ # Gentoo specific modification(s):
+ epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+ if use systemd && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # For upstream -- review and forward:
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+ epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+ sed -i -e 's:|share):|shared):' configure.in || die #520640
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myconf
+ local buildmode
+
+ myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+ myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+ myconf="${myconf} $(use_enable !device-mapper-only applib)"
+ myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+ myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+ use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static; then
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ myconf="${myconf} --enable-static_link"
+ else
+ buildmode="shared"
+ fi
+ dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=${dmbuildmode}"
+ myconf="${myconf} --with-snapshots=${dmbuildmode}"
+ if use thin; then
+ myconf="${myconf} --with-thin=internal --with-cache=internal"
+ local texec
+ for texec in check dump repair restore; do
+ myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+ myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+ done
+ else
+ myconf="${myconf} --with-thin=none --with-cache=none"
+ fi
+
+ if use lvm1; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}"/etc \
+ --exec-prefix="${EPREFIX}" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}"/sbin \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-dm-run-dir=/run \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-default-pid-dir=/run \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+ $(use_enable systemd udev-systemd-background-jobs) \
+ "$(systemd_with_unitdir)" \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst
+ INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
+ use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+ for inst in ${INSTALL_TARGETS}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+ fi
+
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.110.ebuild b/sys-fs/lvm2/lvm2-2.02.110.ebuild
new file mode 100644
index 000000000000..80fcf16bac95
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.110.ebuild
@@ -0,0 +1,272 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
+ systemd? ( udev )
+ static? ( !udev )" #520450
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+ readline? ( sys-libs/readline )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/clvm
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=virtual/libudev-208:=[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ # Gentoo specific modification(s):
+ epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+ if use udev && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+ elog "if it was previously disabled."
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # For upstream -- review and forward:
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+ epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myconf
+ local buildmode
+
+ myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+ myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+ myconf="${myconf} $(use_enable !device-mapper-only applib)"
+ myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+ myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+ use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static; then
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ myconf="${myconf} --enable-static_link"
+ else
+ buildmode="shared"
+ fi
+ dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=${dmbuildmode}"
+ myconf="${myconf} --with-snapshots=${dmbuildmode}"
+ if use thin; then
+ myconf="${myconf} --with-thin=internal --with-cache=internal"
+ local texec
+ for texec in check dump repair restore; do
+ myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+ myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+ done
+ else
+ myconf="${myconf} --with-thin=none --with-cache=none"
+ fi
+
+ if use lvm1; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}"/etc \
+ --exec-prefix="${EPREFIX}" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}"/sbin \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-dm-run-dir=/run \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-default-pid-dir=/run \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+ $(use_enable systemd udev-systemd-background-jobs) \
+ "$(systemd_with_unitdir)" \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst
+ INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
+ use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+ for inst in ${INSTALL_TARGETS}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+ fi
+
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.116.ebuild b/sys-fs/lvm2/lvm2-2.02.116.ebuild
new file mode 100644
index 000000000000..2ba8ca612b82
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.116.ebuild
@@ -0,0 +1,272 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
+ systemd? ( udev )
+ static? ( !udev )" #520450
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+ readline? ( sys-libs/readline )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/clvm
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=virtual/libudev-208:=[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ # Gentoo specific modification(s):
+ epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+ if use udev && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+ elog "if it was previously disabled."
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # For upstream -- review and forward:
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+ epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myconf
+ local buildmode
+
+ myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+ myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+ myconf="${myconf} $(use_enable !device-mapper-only applib)"
+ myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+ myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+ use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static; then
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ myconf="${myconf} --enable-static_link"
+ else
+ buildmode="shared"
+ fi
+ dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=${dmbuildmode}"
+ myconf="${myconf} --with-snapshots=${dmbuildmode}"
+ if use thin; then
+ myconf="${myconf} --with-thin=internal --with-cache=internal"
+ local texec
+ for texec in check dump repair restore; do
+ myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+ myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+ done
+ else
+ myconf="${myconf} --with-thin=none --with-cache=none"
+ fi
+
+ if use lvm1; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}"/etc \
+ --exec-prefix="${EPREFIX}" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}"/sbin \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-dm-run-dir=/run \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-default-pid-dir=/run \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+ $(use_enable systemd udev-systemd-background-jobs) \
+ "$(systemd_with_unitdir)" \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst
+ INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
+ use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+ for inst in ${INSTALL_TARGETS}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+ fi
+
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/metadata.xml b/sys-fs/lvm2/metadata.xml
new file mode 100644
index 000000000000..74f768f71088
--- /dev/null
+++ b/sys-fs/lvm2/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+ <maintainer>
+ <email>agk@redhat.com</email>
+ <name>Alasdair Kergon</name>
+ <description>Upstream Maintainer (please CC on bugs)</description>
+ </maintainer>
+ <use>
+ <flag name='clvm'>Allow users to build clustered lvm2</flag>
+ <flag name='cman'>Cman support for clustered lvm</flag>
+ <flag name='lvm1'>Allow users to build lvm2 with lvm1 support</flag>
+ <flag name='lvm2create_initrd'>Install lvm2create_initrd script and pull in <pkg>sys-apps/makedev</pkg> for the /sbin/MAKEDEV command</flag>
+ <flag name='thin'>Support for thin volumes</flag>
+ <flag name='device-mapper-only'>Build only device-mapper and not the rest of LVM2 (UNSUPPORTED)</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:heinz_mauelshagen:lvm2</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/mac-fdisk/Manifest b/sys-fs/mac-fdisk/Manifest
new file mode 100644
index 000000000000..4d15df900375
--- /dev/null
+++ b/sys-fs/mac-fdisk/Manifest
@@ -0,0 +1,3 @@
+DIST mac-fdisk_0.1-13.diff.gz 19615 SHA256 a6dd96c8ddce896dac2e2b2c2eff346d339ae697cd19e2ac9676556d8bc63644 SHA512 adc34f20e73ae91c39acb073f70f0041a4a0726985fc5e5de34ae433996b3f719ca4193cce51efc6599ba1773ad63fee045a8d72b6bd8a036c188d762626fe57 WHIRLPOOL 9badaa6a514eb95623bf6dfc1815935a2510a0a8ef9b2546aa0c0e3816c9b9ab584ac3136f28988d3f6768dfaec7ed9d49cac6fbfa1384e029128a565743e983
+DIST mac-fdisk_0.1-16.diff.gz 19896 SHA256 0ab4247a80734cffcebd439b2c6021a5560daf4d5bb246af3ee0a75d52bfd486 SHA512 deb44217afae097594e14dea6cd128f6cb1e8ed6e62e646d2aa311508ea27d164c94187e8eb1f1d018ee6044346f6785770981a655b6ad536dbbce550df13359 WHIRLPOOL 5f34bdc9ef8e0b823e5113cf79ddc2e9007f5e18c90c7c162e025e65c349407baf7f0da9aae4a5d1615af87ab3b2cade65265aef88d7413625a44c8a531b426c
+DIST mac-fdisk_0.1.orig.tar.gz 55817 SHA256 7059fc4ba41ca2ef857e1092e9c56e910f27693d407b5c3d78f7102ad0c56a66 SHA512 1263e60a18111162f5ef439b5f9615cef9de94e7836cb998782a6e6d3bcf92a69e49566b33c7330bdea05de5e6ca83f7920c6707f342ce515440160695f07120 WHIRLPOOL 3a25aba4950933c677d56a1f8c8aa000520818cf413c3cf3f418be5ec2ad520f9d9542771b61b2e53ad58e4dfa3298acab551eef8fb1a0cbac93a390f9968bb4
diff --git a/sys-fs/mac-fdisk/files/big_pt.patch b/sys-fs/mac-fdisk/files/big_pt.patch
new file mode 100644
index 000000000000..fe9e78ec73de
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/big_pt.patch
@@ -0,0 +1,80 @@
+--- a/partition_map.c
++++ b/partition_map.c
+@@ -25,6 +25,11 @@
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
++//
++// Defines
++//
++// #define TEST_COMPUTE
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -36,6 +41,10 @@
+ #include <sys/ioctl.h>
+ #include "kernel-defs.h"
+ #include <sys/stat.h>
++#ifdef TEST_COMPUTE
++#include <linux/fs.h>
++#endif
++
+ #endif
+
+ #include "partition_map.h"
+@@ -45,10 +54,6 @@
+ #include "errors.h"
+
+
+-//
+-// Defines
+-//
+-// #define TEST_COMPUTE
+
+
+ //
+@@ -666,7 +671,7 @@
+ loff_t pos;
+ #endif
+ char* data;
+- unsigned long l, r, x;
++ unsigned long long l, r, x;
+ int valid;
+
+ #ifdef TEST_COMPUTE
+@@ -720,9 +725,11 @@
+ } else {
+ r = r * 2;
+ }
+- if (r >= (1024*1024*1024)) {
+- break;
+- }
++// There's no explanation for this, but I suspect the author was trying to
++// prevent going over the 32 bit size
++// if (r >= (1024*1024*1024*2)) {
++// break;
++// }
+ }
+ // binary search for end
+ while (l <= r) {
+@@ -740,11 +747,17 @@
+ if (valid != 0) {
+ x = x + 1;
+ }
+- // printf("size in blocks = %d\n", x);
++#ifdef TEST_COMPUTE
++ printf("size in blocks = %d\n", x);
++#endif
+ free(data);
+ }
++
++ // Add a warning just in case...
++ if(x > 0x80000000)
++ printf("Warning: Large disks may not work with this tool!\n");
+
+- return x;
++ return (unsigned long) x;
+ }
+
+
diff --git a/sys-fs/mac-fdisk/files/largerthan2gb.patch b/sys-fs/mac-fdisk/files/largerthan2gb.patch
new file mode 100644
index 000000000000..b33487ca9e97
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/largerthan2gb.patch
@@ -0,0 +1,14 @@
+--- a/fdisk.h
++++ b/fdisk.h
+@@ -2,6 +2,11 @@
+ fdisk.h
+ */
+
++#ifdef __linux__
++#define _FILE_OFFSET_BITS 64
++#define _LARGE_FILES
++#endif
++
+ #define SECTOR_SIZE 512
+ #define NETBSD_PARTITION 0xa5
+ #define cround(n) (((n) + display_factor * unit_flag) / display_factor)
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch
new file mode 100644
index 000000000000..2ac7eaf41538
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch
@@ -0,0 +1,112 @@
+Include a lot more headers and remove a bunch of braindead __linux__ checks
+
+--- a/dump.c
++++ b/dump.c
+@@ -30,10 +30,8 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+ #include <unistd.h>
+-#endif
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- a/errors.c
++++ b/errors.c
+@@ -26,9 +26,7 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+-#endif
+ #include <string.h>
+ #include <stdarg.h>
+
+@@ -115,8 +113,8 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0 && value < sys_nerr) {
+- fprintf(stderr, " (%s)\n", sys_errlist[value]);
++ if (value > 0) {
++ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+ }
+@@ -144,8 +142,8 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0 && value < sys_nerr) {
+- fprintf(stderr, " (%s)\n", sys_errlist[value]);
++ if (value > 0) {
++ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+ }
+--- a/fdisk.c
++++ b/fdisk.c
+@@ -62,6 +62,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <setjmp.h>
+--- a/fdisklabel.c
++++ b/fdisklabel.c
+@@ -38,6 +38,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <setjmp.h>
+--- a/io.c
++++ b/io.c
+@@ -26,9 +26,9 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+ #include <fcntl.h>
++#ifndef __linux__
+ #include <SCSI.h>
+ #else
+ #ifdef __GLIBC__
+--- a/partition_map.c
++++ b/partition_map.c
+@@ -26,10 +26,9 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
++#include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#endif
+ #include <errno.h>
+
+ #include <fcntl.h>
+--- a/pdisk.c
++++ b/pdisk.c
+@@ -32,10 +32,11 @@
+ #include <getopt.h>
+ #include <stddef.h>
+ #else
+-#include <stdlib.h>
+-#include <unistd.h>
+ #include <SIOUX.h>
+ #endif
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
+ #include <errno.h>
+
+ #ifdef __linux__
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch
new file mode 100644
index 000000000000..4fb1617eec8e
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1-r6-ppc64.patch
@@ -0,0 +1,481 @@
+--- a/bitfield.c
++++ b/bitfield.c
+@@ -67,13 +67,12 @@
+ //
+ // Routines
+ //
+-unsigned long
+-bitfield_set(unsigned long *bf, int base, int length, unsigned long value)
++unsigned int
++bitfield_set(unsigned int *bf, int base, int length, unsigned int value)
+ {
+- unsigned long t;
+- unsigned long m;
++ unsigned int t;
++ unsigned int m;
+ int s;
+- int i;
+
+ // compute shift & mask, coerce value to correct number of bits,
+ // zap the old bits and stuff the new value
+@@ -86,12 +85,11 @@
+ }
+
+
+-unsigned long
+-bitfield_get(unsigned long bf, int base, int length)
++unsigned int
++bitfield_get(unsigned int bf, int base, int length)
+ {
+- unsigned long m;
++ unsigned int m;
+ int s;
+- int i;
+
+ // compute shift & mask
+ // return the correct number of bits (shifted to low end)
+--- a/bitfield.h
++++ b/bitfield.h
+@@ -63,5 +63,5 @@
+ //
+ // Forward declarations
+ //
+-unsigned long bitfield_set(unsigned long *bf, int base, int length, unsigned long value);
+-unsigned long bitfield_get(unsigned long bf, int base, int length);
++unsigned int bitfield_set(unsigned int *bf, int base, int length, unsigned int value);
++unsigned int bitfield_get(unsigned int bf, int base, int length);
+--- a/dpme.h
++++ b/dpme.h
+@@ -61,7 +61,7 @@
+ //
+ typedef unsigned char u8;
+ typedef unsigned short u16;
+-typedef unsigned long u32;
++typedef unsigned int u32;
+
+
+ // Physical block zero of the disk has this format
+@@ -113,10 +113,10 @@
+ #endif
+ u32 dpme_boot_block ;
+ u32 dpme_boot_bytes ;
+- u8 *dpme_load_addr ;
+- u8 *dpme_load_addr_2 ;
+- u8 *dpme_goto_addr ;
+- u8 *dpme_goto_addr_2 ;
++ u32 dpme_load_addr ;
++ u32 dpme_load_addr_2 ;
++ u32 dpme_goto_addr ;
++ u32 dpme_goto_addr_2 ;
+ u32 dpme_checksum ;
+ char dpme_process_id[16] ;
+ u32 dpme_boot_args[32] ;
+--- a/dump.c
++++ b/dump.c
+@@ -61,16 +61,16 @@
+ // Global Constants
+ //
+ NAMES plist[] = {
+- "Drvr", "Apple_Driver",
+- "Dr43", "Apple_Driver43",
+- "Free", "Apple_Free",
+- " HFS", "Apple_HFS",
+- " MFS", "Apple_MFS",
+- "PDOS", "Apple_PRODOS",
+- "junk", "Apple_Scratch",
+- "unix", "Apple_UNIX_SVR2",
+- " map", "Apple_partition_map",
+- 0, 0
++ {"Drvr"}, {"Apple_Driver"},
++ {"Dr43"}, {"Apple_Driver43"},
++ {"Free"}, {"Apple_Free"},
++ {" HFS"}, {"Apple_HFS"},
++ {" MFS"}, {"Apple_MFS"},
++ {"PDOS"}, {"Apple_PRODOS"},
++ {"junk"}, {"Apple_Scratch"},
++ {"unix"}, {"Apple_UNIX_SVR2"},
++ {" map"}, {"Apple_partition_map"},
++ {0}, {0}
+ };
+
+ const char * kStringEmpty = "";
+@@ -162,10 +162,10 @@
+ }
+ #ifdef __mc68000__
+ printf("%*s type name "
+- "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base");
++ "%*s %-*s ( size ) system\n", (int)strlen(map->name)+1, "#", j, "length", j, "base");
+ #else
+ printf("%*s type name "
+- "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base");
++ "%*s %-*s ( size ) system\n", (int)strlen(map->name)+1, "#", j, "length", j, "base");
+ #endif
+
+ /* Grok devfs names. (courtesy Colin Walters)*/
+@@ -199,7 +199,6 @@
+ partition_map_header *map;
+ int j;
+ DPME *p;
+- BZB *bp;
+ char *s;
+ #ifdef __mc68000__
+ int aflag = 1;
+@@ -222,13 +221,13 @@
+ }
+ }
+ #ifdef __mc68000__
+- printf("%s%-2d %.4s %-12.12s ", dev, entry->disk_address, s, p->dpme_name);
++ printf("%s%-2d %.4s %-12.12s ", dev, (int)entry->disk_address, s, p->dpme_name);
+ #else
+- printf("%s%-4d %.4s %-18.32s ", dev, entry->disk_address, s, p->dpme_name);
++ printf("%s%-4d %.4s %-18.32s ", dev, (int)entry->disk_address, s, p->dpme_name);
+ #endif
+ } else {
+ printf("%s%-4d %20.32s %-18.32s ", dev,
+- entry->disk_address, p->dpme_type, p->dpme_name);
++ (int)entry->disk_address, p->dpme_type, p->dpme_name);
+ }
+
+ if (pflag) {
+@@ -312,7 +311,6 @@
+ int i;
+ int fd;
+ DPME * data;
+- long t;
+
+ data = (DPME *) malloc(PBLOCK_SIZE);
+ if (data == NULL) {
+@@ -380,7 +378,7 @@
+ printf("Header:\n");
+ printf("fd=%d (%s)\n", map->fd, (map->regular_file)?"file":"device");
+ printf("map %d blocks out of %d, media %u blocks\n",
+- map->blocks_in_map, map->maximum_in_map, map->media_size);
++ map->blocks_in_map, map->maximum_in_map, (unsigned int)map->media_size);
+ printf("Map is%s writeable", (map->writeable)?kStringEmpty:kStringNot);
+ printf(", but%s changed\n", (map->changed)?kStringEmpty:kStringNot);
+ printf("\n");
+@@ -424,7 +422,7 @@
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+ printf("%2d: %20.32s ",
+- entry->disk_address, p->dpme_type);
++ (int)entry->disk_address, p->dpme_type);
+ printf("%7u @ %-7u ", p->dpme_pblocks, p->dpme_pblock_start);
+ printf("%c%c%c%c%c%c%c%c%c%c ",
+ (dpme_valid_get(p))?'V':'v',
+@@ -447,7 +445,7 @@
+ "goto_address checksum processor\n");
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+- printf("%2d: ", entry->disk_address);
++ printf("%2d: ", (int)entry->disk_address);
+ printf("%7u ", p->dpme_boot_block);
+ printf("%7u ", p->dpme_boot_bytes);
+ printf("%8x ", p->dpme_load_addr);
+@@ -464,7 +462,7 @@
+ */
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+- printf("%2d: ", entry->disk_address);
++ printf("%2d: ", (int)entry->disk_address);
+
+ bp = (BZB *) (p->dpme_bzb);
+ j = -1;
+--- a/errors.c
++++ b/errors.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <stdarg.h>
+
++#include <errno.h>
+ #include "errors.h"
+ #include "pdisk.h"
+
+@@ -113,7 +114,7 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0) {
++ if (value > 0 && value < errno) {
+ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+@@ -142,7 +143,7 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0) {
++ if (value > 0 && value < errno) {
+ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+--- a/fdisk.c
++++ b/fdisk.c
+@@ -71,12 +71,65 @@
+
+ #include <sys/ioctl.h>
+
+-typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
+-
+ #include "kernel-defs.h"
+
+ #include "fdisk.h"
+
++/* ----------- */
++#define _PPC64_TYPES_H
++#define BITS_PER_LONG 64
++
++typedef __signed__ char __s8;
++typedef signed char s8;
++typedef unsigned char u8;
++typedef unsigned char __u8;
++
++typedef __signed__ short __s16;
++typedef signed short s16;
++/*typedef unsigned short __u16;*/
++typedef unsigned short u16;
++
++typedef __signed__ int __s32;
++typedef signed int s32;
++/*typedef unsigned int __u32;*/
++typedef unsigned int u32;
++
++typedef __signed__ long __s64;
++typedef signed long s64;
++typedef unsigned long __u64;
++typedef unsigned long u64;
++
++typedef struct {
++ __u32 u[4];
++} __attribute((aligned(16))) __vector128;
++
++typedef __vector128 vector128;
++
++typedef u32 dma_addr_t;
++typedef u64 dma64_addr_t;
++
++typedef struct {
++ unsigned long entry;
++ unsigned long toc;
++ unsigned long env;
++} func_descr_t;
++
++typedef unsigned int umode_t;
++
++#define BITS_TO_LONGS(bits) \
++ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
++#define DECLARE_BITMAP(name,bits) \
++ unsigned long name[BITS_TO_LONGS(bits)]
++#define CLEAR_BITMAP(name,bits) \
++ memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
++
++/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
++#define HDIO_GETGEO 0x0301 /* get device geometry */
++
++#define BLKRRPART _IO(0x12,95) /* re-read partition table */
++
++/* ---------- */
++
+ #define hex_val(c) ({ \
+ char _c = (c); \
+ isdigit(_c) ? _c - '0' : \
+@@ -1416,7 +1469,7 @@
+ }
+ }
+
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+ if (argc > 3)
+ fatal(usage);
+--- a/fdisklabel.c
++++ b/fdisklabel.c
+@@ -35,6 +35,7 @@
+ SUCH DAMAGE.
+ */
+
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -47,6 +48,8 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+
++#include <asm/types.h>
++
+ #include "kernel-defs.h"
+
+ #include "fdisk.h"
+@@ -263,8 +266,8 @@
+ fprintf(f, "type: %s\n", bsd_dktypenames[lp->d_type]);
+ else
+ fprintf(f, "type: %d\n", lp->d_type);
+- fprintf(f, "disk: %.*s\n", sizeof(lp->d_typename), lp->d_typename);
+- fprintf(f, "label: %.*s\n", sizeof(lp->d_packname), lp->d_packname);
++ fprintf(f, "disk: %.*s\n", (int)sizeof(lp->d_typename), lp->d_typename);
++ fprintf(f, "label: %.*s\n", (int)sizeof(lp->d_packname), lp->d_packname);
+ fprintf(f, "flags:");
+ if (lp->d_flags & BSD_D_REMOVABLE)
+ fprintf(f, " removable");
+@@ -273,17 +276,17 @@
+ if (lp->d_flags & BSD_D_BADSECT)
+ fprintf(f, " badsect");
+ fprintf(f, "\n");
+- fprintf(f, "bytes/sector: %d\n", lp->d_secsize);
+- fprintf(f, "sectors/track: %d\n", lp->d_nsectors);
+- fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks);
+- fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl);
+- fprintf(f, "cylinders: %d\n", lp->d_ncylinders);
++ fprintf(f, "bytes/sector: %d\n", (int)lp->d_secsize);
++ fprintf(f, "sectors/track: %d\n", (int)lp->d_nsectors);
++ fprintf(f, "tracks/cylinder: %d\n", (int)lp->d_ntracks);
++ fprintf(f, "sectors/cylinder: %d\n", (int)lp->d_secpercyl);
++ fprintf(f, "cylinders: %d\n", (int)lp->d_ncylinders);
+ fprintf(f, "rpm: %d\n", lp->d_rpm);
+ fprintf(f, "interleave: %d\n", lp->d_interleave);
+ fprintf(f, "trackskew: %d\n", lp->d_trackskew);
+ fprintf(f, "cylinderskew: %d\n", lp->d_cylskew);
+- fprintf(f, "headswitch: %d\t\t# milliseconds\n", lp->d_headswitch);
+- fprintf(f, "track-to-track seek: %d\t# milliseconds\n", lp->d_trkseek);
++ fprintf(f, "headswitch: %d\t\t# milliseconds\n", (int)lp->d_headswitch);
++ fprintf(f, "track-to-track seek: %d\t# milliseconds\n", (int)lp->d_trkseek);
+ fprintf(f, "drivedata: ");
+ for (i = NDDATA - 1; i >= 0; i--)
+ if (lp->d_drivedata[i])
+@@ -291,7 +294,7 @@
+ if (i < 0)
+ i = 0;
+ for (j = 0; j <= i; j++)
+- fprintf(f, "%d ", lp->d_drivedata[j]);
++ fprintf(f, "%d ", (int)lp->d_drivedata[j]);
+ }
+ fprintf (f, "\n%d partitions:\n", lp->d_npartitions);
+ fprintf (f, "# size offset fstype [fsize bsize cpg]\n");
+@@ -299,7 +302,7 @@
+ for (i = 0; i < lp->d_npartitions; i++, pp++) {
+ if (pp->p_size) {
+ fprintf(f, " %c: %8d %8d ", 'a' + i,
+- pp->p_size, pp->p_offset);
++ (int)pp->p_size, (int)pp->p_offset);
+ if ((unsigned) pp->p_fstype < BSD_FSMAXTYPES)
+ fprintf(f, "%8.8s", bsd_fstypes[pp->p_fstype].name);
+ else
+@@ -308,12 +311,12 @@
+ {
+ case BSD_FS_UNUSED:
+ fprintf(f, " %5d %5d %5.5s ",
+- pp->p_fsize, pp->p_fsize * pp->p_frag, "");
++ (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag, "");
+ break;
+
+ case BSD_FS_BSDFFS:
+ fprintf(f, " %5d %5d %5d ",
+- pp->p_fsize, pp->p_fsize * pp->p_frag,
++ (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag,
+ pp->p_cpg);
+ break;
+
+@@ -323,21 +326,21 @@
+ }
+ fprintf(f, "\t# (Cyl. %4d",
+ #if 0
+- pp->p_offset / lp->d_secpercyl); /* differs from Linux fdisk */
++ (int)(pp->p_offset / lp->d_secpercyl)); /* differs from Linux fdisk */
+ #else
+- pp->p_offset / lp->d_secpercyl + 1);
++ (int)(pp->p_offset / lp->d_secpercyl + 1));
+ #endif
+ if (pp->p_offset % lp->d_secpercyl)
+ putc('*', f);
+ else
+ putc(' ', f);
+ fprintf(f, "- %d",
+- (pp->p_offset +
++ (int)((pp->p_offset +
+ pp->p_size + lp->d_secpercyl - 1) /
+ #if 0
+- lp->d_secpercyl - 1); /* differs from Linux fdisk */
++ lp->d_secpercyl - 1)); /* differs from Linux fdisk */
+ #else
+- lp->d_secpercyl);
++ lp->d_secpercyl));
+ #endif
+ if (pp->p_size % lp->d_secpercyl)
+ putc('*', f);
+--- a/io.c
++++ b/io.c
+@@ -33,8 +33,10 @@
+ #else
+ #ifdef __GLIBC__
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #endif
+ #endif
++#include <linux/unistd.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdarg.h>
+@@ -466,7 +468,7 @@
+ long t;
+
+ if (rflag) {
+- printf("Can't write block %u to file", num);
++ printf("Can't write block %u to file", (unsigned int)num);
+ return 0;
+ }
+ #ifndef __linux__
+--- a/partition_map.c
++++ b/partition_map.c
+@@ -105,7 +105,6 @@
+ int fd;
+ partition_map_header * map;
+ int writeable;
+- unsigned long length;
+ #ifdef __linux__
+ struct stat info;
+ #endif
+@@ -402,9 +401,7 @@
+ {
+ int fd;
+ partition_map_header * map;
+- unsigned long length;
+ DPME *data;
+- int ok;
+ unsigned long number;
+ #ifdef __linux__
+ struct stat info;
+@@ -433,13 +430,13 @@
+ map->maximum_in_map = -1;
+
+ number = compute_device_size(fd);
+- printf("size of 'device' is %u blocks: ", number);
++ printf("size of 'device' is %u blocks: ", (unsigned int)number);
+ flush_to_newline(0);
+ get_number_argument("what should be the size? ", (long *)&number, number);
+ if (number < 4) {
+ number = 4;
+ }
+- printf("new size of 'device' is %u blocks\n", number);
++ printf("new size of 'device' is %u blocks\n", (unsigned int)number);
+ map->media_size = number;
+
+ #ifdef __linux__
+--- a/pdisk.c
++++ b/pdisk.c
+@@ -437,7 +437,6 @@
+ {
+ long base;
+ long length;
+- long mult;
+ char *name;
+ char *type_name;
+
+@@ -599,7 +598,6 @@
+ void
+ do_reorder(partition_map_header *map)
+ {
+- partition_map * cur;
+ long old_index;
+ long index;
+
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch
new file mode 100644
index 000000000000..616adc5b811f
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-ppc64.patch
@@ -0,0 +1,455 @@
+--- a/bitfield.c
++++ b/bitfield.c
+@@ -67,13 +67,12 @@
+ //
+ // Routines
+ //
+-unsigned long
+-bitfield_set(unsigned long *bf, int base, int length, unsigned long value)
++unsigned int
++bitfield_set(unsigned int *bf, int base, int length, unsigned int value)
+ {
+- unsigned long t;
+- unsigned long m;
++ unsigned int t;
++ unsigned int m;
+ int s;
+- int i;
+
+ // compute shift & mask, coerce value to correct number of bits,
+ // zap the old bits and stuff the new value
+@@ -86,12 +85,11 @@
+ }
+
+
+-unsigned long
+-bitfield_get(unsigned long bf, int base, int length)
++unsigned int
++bitfield_get(unsigned int bf, int base, int length)
+ {
+- unsigned long m;
++ unsigned int m;
+ int s;
+- int i;
+
+ // compute shift & mask
+ // return the correct number of bits (shifted to low end)
+--- a/bitfield.h
++++ b/bitfield.h
+@@ -63,5 +63,5 @@
+ //
+ // Forward declarations
+ //
+-unsigned long bitfield_set(unsigned long *bf, int base, int length, unsigned long value);
+-unsigned long bitfield_get(unsigned long bf, int base, int length);
++unsigned int bitfield_set(unsigned int *bf, int base, int length, unsigned int value);
++unsigned int bitfield_get(unsigned int bf, int base, int length);
+--- a/dump.c
++++ b/dump.c
+@@ -61,16 +61,16 @@
+ // Global Constants
+ //
+ NAMES plist[] = {
+- "Drvr", "Apple_Driver",
+- "Dr43", "Apple_Driver43",
+- "Free", "Apple_Free",
+- " HFS", "Apple_HFS",
+- " MFS", "Apple_MFS",
+- "PDOS", "Apple_PRODOS",
+- "junk", "Apple_Scratch",
+- "unix", "Apple_UNIX_SVR2",
+- " map", "Apple_partition_map",
+- 0, 0
++ {"Drvr"}, {"Apple_Driver"},
++ {"Dr43"}, {"Apple_Driver43"},
++ {"Free"}, {"Apple_Free"},
++ {" HFS"}, {"Apple_HFS"},
++ {" MFS"}, {"Apple_MFS"},
++ {"PDOS"}, {"Apple_PRODOS"},
++ {"junk"}, {"Apple_Scratch"},
++ {"unix"}, {"Apple_UNIX_SVR2"},
++ {" map"}, {"Apple_partition_map"},
++ {0}, {0}
+ };
+
+ const char * kStringEmpty = "";
+@@ -162,10 +162,10 @@
+ }
+ #ifdef __mc68000__
+ printf("%*s type name "
+- "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base");
++ "%*s %-*s ( size ) system\n", (int)strlen(map->name)+1, "#", j, "length", j, "base");
+ #else
+ printf("%*s type name "
+- "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base");
++ "%*s %-*s ( size ) system\n", (int)strlen(map->name)+1, "#", j, "length", j, "base");
+ #endif
+
+ /* Grok devfs names. (courtesy Colin Walters)*/
+@@ -199,7 +199,6 @@
+ partition_map_header *map;
+ int j;
+ DPME *p;
+- BZB *bp;
+ char *s;
+ #ifdef __mc68000__
+ int aflag = 1;
+@@ -222,13 +221,13 @@
+ }
+ }
+ #ifdef __mc68000__
+- printf("%s%-2d %.4s %-12.12s ", dev, entry->disk_address, s, p->dpme_name);
++ printf("%s%-2d %.4s %-12.12s ", dev, (int)entry->disk_address, s, p->dpme_name);
+ #else
+- printf("%s%-4d %.4s %-18.32s ", dev, entry->disk_address, s, p->dpme_name);
++ printf("%s%-4d %.4s %-18.32s ", dev, (int)entry->disk_address, s, p->dpme_name);
+ #endif
+ } else {
+ printf("%s%-4d %20.32s %-18.32s ", dev,
+- entry->disk_address, p->dpme_type, p->dpme_name);
++ (int)entry->disk_address, p->dpme_type, p->dpme_name);
+ }
+
+ if (pflag) {
+@@ -312,7 +311,6 @@
+ int i;
+ int fd;
+ DPME * data;
+- long t;
+
+ data = (DPME *) malloc(PBLOCK_SIZE);
+ if (data == NULL) {
+@@ -380,7 +378,7 @@
+ printf("Header:\n");
+ printf("fd=%d (%s)\n", map->fd, (map->regular_file)?"file":"device");
+ printf("map %d blocks out of %d, media %u blocks\n",
+- map->blocks_in_map, map->maximum_in_map, map->media_size);
++ map->blocks_in_map, map->maximum_in_map, (unsigned int)map->media_size);
+ printf("Map is%s writeable", (map->writeable)?kStringEmpty:kStringNot);
+ printf(", but%s changed\n", (map->changed)?kStringEmpty:kStringNot);
+ printf("\n");
+@@ -424,7 +422,7 @@
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+ printf("%2d: %20.32s ",
+- entry->disk_address, p->dpme_type);
++ (int)entry->disk_address, p->dpme_type);
+ printf("%7u @ %-7u ", p->dpme_pblocks, p->dpme_pblock_start);
+ printf("%c%c%c%c%c%c%c%c%c%c ",
+ (dpme_valid_get(p))?'V':'v',
+@@ -447,7 +445,7 @@
+ "goto_address checksum processor\n");
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+- printf("%2d: ", entry->disk_address);
++ printf("%2d: ", (int)entry->disk_address);
+ printf("%7u ", p->dpme_boot_block);
+ printf("%7u ", p->dpme_boot_bytes);
+ printf("%8x ", p->dpme_load_addr);
+@@ -464,7 +462,7 @@
+ */
+ for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) {
+ p = entry->data;
+- printf("%2d: ", entry->disk_address);
++ printf("%2d: ", (int)entry->disk_address);
+
+ bp = (BZB *) (p->dpme_bzb);
+ j = -1;
+--- a/errors.c
++++ b/errors.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <stdarg.h>
+
++#include <errno.h>
+ #include "errors.h"
+ #include "pdisk.h"
+
+@@ -113,7 +114,7 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0) {
++ if (value > 0 && value < errno) {
+ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+@@ -142,7 +143,7 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0) {
++ if (value > 0 && value < errno) {
+ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+--- a/fdisk.c
++++ b/fdisk.c
+@@ -71,12 +71,65 @@
+
+ #include <sys/ioctl.h>
+
+-typedef unsigned short kdev_t; /* BAD hack; kdev_t is not exported */
+-
+ #include "kernel-defs.h"
+
+ #include "fdisk.h"
+
++/* ----------- */
++#define _PPC64_TYPES_H
++#define BITS_PER_LONG 64
++
++typedef __signed__ char __s8;
++typedef signed char s8;
++typedef unsigned char u8;
++typedef unsigned char __u8;
++
++typedef __signed__ short __s16;
++typedef signed short s16;
++/*typedef unsigned short __u16;*/
++typedef unsigned short u16;
++
++typedef __signed__ int __s32;
++typedef signed int s32;
++/*typedef unsigned int __u32;*/
++typedef unsigned int u32;
++
++typedef __signed__ long __s64;
++typedef signed long s64;
++typedef unsigned long __u64;
++typedef unsigned long u64;
++
++typedef struct {
++ __u32 u[4];
++} __attribute((aligned(16))) __vector128;
++
++typedef __vector128 vector128;
++
++typedef u32 dma_addr_t;
++typedef u64 dma64_addr_t;
++
++typedef struct {
++ unsigned long entry;
++ unsigned long toc;
++ unsigned long env;
++} func_descr_t;
++
++typedef unsigned int umode_t;
++
++#define BITS_TO_LONGS(bits) \
++ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
++#define DECLARE_BITMAP(name,bits) \
++ unsigned long name[BITS_TO_LONGS(bits)]
++#define CLEAR_BITMAP(name,bits) \
++ memset(name, 0, BITS_TO_LONGS(bits)*sizeof(unsigned long))
++
++/* hd/ide ctl's that pass (arg) ptrs to user space are numbered 0x030n/0x031n */
++#define HDIO_GETGEO 0x0301 /* get device geometry */
++
++#define BLKRRPART _IO(0x12,95) /* re-read partition table */
++
++/* ---------- */
++
+ #define hex_val(c) ({ \
+ char _c = (c); \
+ isdigit(_c) ? _c - '0' : \
+@@ -1416,7 +1469,7 @@
+ }
+ }
+
+-void main(int argc, char **argv)
++int main(int argc, char **argv)
+ {
+ if (argc > 3)
+ fatal(usage);
+--- a/fdisklabel.c
++++ b/fdisklabel.c
+@@ -35,6 +35,7 @@
+ SUCH DAMAGE.
+ */
+
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -47,6 +48,8 @@
+ #include <sys/ioctl.h>
+ #include <sys/param.h>
+
++#include <asm/types.h>
++
+ #include "kernel-defs.h"
+
+ #include "fdisk.h"
+@@ -263,8 +266,8 @@
+ fprintf(f, "type: %s\n", bsd_dktypenames[lp->d_type]);
+ else
+ fprintf(f, "type: %d\n", lp->d_type);
+- fprintf(f, "disk: %.*s\n", sizeof(lp->d_typename), lp->d_typename);
+- fprintf(f, "label: %.*s\n", sizeof(lp->d_packname), lp->d_packname);
++ fprintf(f, "disk: %.*s\n", (int)sizeof(lp->d_typename), lp->d_typename);
++ fprintf(f, "label: %.*s\n", (int)sizeof(lp->d_packname), lp->d_packname);
+ fprintf(f, "flags:");
+ if (lp->d_flags & BSD_D_REMOVABLE)
+ fprintf(f, " removable");
+@@ -273,17 +276,17 @@
+ if (lp->d_flags & BSD_D_BADSECT)
+ fprintf(f, " badsect");
+ fprintf(f, "\n");
+- fprintf(f, "bytes/sector: %d\n", lp->d_secsize);
+- fprintf(f, "sectors/track: %d\n", lp->d_nsectors);
+- fprintf(f, "tracks/cylinder: %d\n", lp->d_ntracks);
+- fprintf(f, "sectors/cylinder: %d\n", lp->d_secpercyl);
+- fprintf(f, "cylinders: %d\n", lp->d_ncylinders);
++ fprintf(f, "bytes/sector: %d\n", (int)lp->d_secsize);
++ fprintf(f, "sectors/track: %d\n", (int)lp->d_nsectors);
++ fprintf(f, "tracks/cylinder: %d\n", (int)lp->d_ntracks);
++ fprintf(f, "sectors/cylinder: %d\n", (int)lp->d_secpercyl);
++ fprintf(f, "cylinders: %d\n", (int)lp->d_ncylinders);
+ fprintf(f, "rpm: %d\n", lp->d_rpm);
+ fprintf(f, "interleave: %d\n", lp->d_interleave);
+ fprintf(f, "trackskew: %d\n", lp->d_trackskew);
+ fprintf(f, "cylinderskew: %d\n", lp->d_cylskew);
+- fprintf(f, "headswitch: %d\t\t# milliseconds\n", lp->d_headswitch);
+- fprintf(f, "track-to-track seek: %d\t# milliseconds\n", lp->d_trkseek);
++ fprintf(f, "headswitch: %d\t\t# milliseconds\n", (int)lp->d_headswitch);
++ fprintf(f, "track-to-track seek: %d\t# milliseconds\n", (int)lp->d_trkseek);
+ fprintf(f, "drivedata: ");
+ for (i = NDDATA - 1; i >= 0; i--)
+ if (lp->d_drivedata[i])
+@@ -291,7 +294,7 @@
+ if (i < 0)
+ i = 0;
+ for (j = 0; j <= i; j++)
+- fprintf(f, "%d ", lp->d_drivedata[j]);
++ fprintf(f, "%d ", (int)lp->d_drivedata[j]);
+ }
+ fprintf (f, "\n%d partitions:\n", lp->d_npartitions);
+ fprintf (f, "# size offset fstype [fsize bsize cpg]\n");
+@@ -299,7 +302,7 @@
+ for (i = 0; i < lp->d_npartitions; i++, pp++) {
+ if (pp->p_size) {
+ fprintf(f, " %c: %8d %8d ", 'a' + i,
+- pp->p_size, pp->p_offset);
++ (int)pp->p_size, (int)pp->p_offset);
+ if ((unsigned) pp->p_fstype < BSD_FSMAXTYPES)
+ fprintf(f, "%8.8s", bsd_fstypes[pp->p_fstype].name);
+ else
+@@ -308,12 +311,12 @@
+ {
+ case BSD_FS_UNUSED:
+ fprintf(f, " %5d %5d %5.5s ",
+- pp->p_fsize, pp->p_fsize * pp->p_frag, "");
++ (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag, "");
+ break;
+
+ case BSD_FS_BSDFFS:
+ fprintf(f, " %5d %5d %5d ",
+- pp->p_fsize, pp->p_fsize * pp->p_frag,
++ (int)pp->p_fsize, (int)pp->p_fsize * pp->p_frag,
+ pp->p_cpg);
+ break;
+
+@@ -323,21 +326,21 @@
+ }
+ fprintf(f, "\t# (Cyl. %4d",
+ #if 0
+- pp->p_offset / lp->d_secpercyl); /* differs from Linux fdisk */
++ (int)(pp->p_offset / lp->d_secpercyl)); /* differs from Linux fdisk */
+ #else
+- pp->p_offset / lp->d_secpercyl + 1);
++ (int)(pp->p_offset / lp->d_secpercyl + 1));
+ #endif
+ if (pp->p_offset % lp->d_secpercyl)
+ putc('*', f);
+ else
+ putc(' ', f);
+ fprintf(f, "- %d",
+- (pp->p_offset +
++ (int)((pp->p_offset +
+ pp->p_size + lp->d_secpercyl - 1) /
+ #if 0
+- lp->d_secpercyl - 1); /* differs from Linux fdisk */
++ lp->d_secpercyl - 1)); /* differs from Linux fdisk */
+ #else
+- lp->d_secpercyl);
++ lp->d_secpercyl));
+ #endif
+ if (pp->p_size % lp->d_secpercyl)
+ putc('*', f);
+--- a/io.c
++++ b/io.c
+@@ -33,8 +33,10 @@
+ #else
+ #ifdef __GLIBC__
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #endif
+ #endif
++#include <linux/unistd.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <stdarg.h>
+@@ -466,7 +468,7 @@
+ long t;
+
+ if (rflag) {
+- printf("Can't write block %u to file", num);
++ printf("Can't write block %u to file", (unsigned int)num);
+ return 0;
+ }
+ #ifndef __linux__
+--- a/partition_map.c
++++ b/partition_map.c
+@@ -105,7 +105,6 @@
+ int fd;
+ partition_map_header * map;
+ int writeable;
+- unsigned long length;
+ #ifdef __linux__
+ struct stat info;
+ #endif
+@@ -402,9 +401,7 @@
+ {
+ int fd;
+ partition_map_header * map;
+- unsigned long length;
+ DPME *data;
+- int ok;
+ unsigned long number;
+ #ifdef __linux__
+ struct stat info;
+@@ -433,13 +430,13 @@
+ map->maximum_in_map = -1;
+
+ number = compute_device_size(fd);
+- printf("size of 'device' is %u blocks: ", number);
++ printf("size of 'device' is %u blocks: ", (unsigned int)number);
+ flush_to_newline(0);
+ get_number_argument("what should be the size? ", (long *)&number, number);
+ if (number < 4) {
+ number = 4;
+ }
+- printf("new size of 'device' is %u blocks\n", number);
++ printf("new size of 'device' is %u blocks\n", (unsigned int)number);
+ map->media_size = number;
+
+ #ifdef __linux__
+--- a/pdisk.c
++++ b/pdisk.c
+@@ -437,7 +437,6 @@
+ {
+ long base;
+ long length;
+- long mult;
+ char *name;
+ char *type_name;
+
+@@ -599,7 +598,6 @@
+ void
+ do_reorder(partition_map_header *map)
+ {
+- partition_map * cur;
+ long old_index;
+ long index;
+
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch b/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch
new file mode 100644
index 000000000000..8658ba9a60d5
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-amd64.patch
@@ -0,0 +1,190 @@
+--- a/fdisklabel.c
++++ b/fdisklabel.c
+@@ -72,7 +72,7 @@
+ static int bsd_readlabel (struct partition *p, struct disklabel *d);
+ static int bsd_writelabel (struct partition *p, struct disklabel *d);
+ static void sync_disks (void);
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ static int bsd_translate_fstype (int linux_type);
+ static void bsd_link_part (void);
+ #endif
+@@ -82,7 +82,7 @@
+
+ static struct disklabel bsd_dlabel;
+ static char buffer[BSD_BBSIZE];
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ static struct partition *bsd_part;
+ static int bsd_part_index;
+ #endif
+@@ -99,13 +99,13 @@
+ " n add a new BSD partition\n"
+ " p print BSD partition table\n"
+ " q quit without saving changes\n"
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ " r return to main menu\n"
+ #endif
+ " s show complete disklabel\n"
+ " t change a partition's filesystem id\n"
+ " w write disklabel to disk\n"
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ " x link BSD partition to non-BSD partition"
+ #endif
+ );
+@@ -114,7 +114,7 @@
+ void
+ bselect (void)
+ {
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ int t;
+
+ for (t=0; t<4; t++)
+@@ -185,7 +185,7 @@
+ case 'w':
+ bsd_write_disklabel ();
+ break;
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ case 'r':
+ return;
+ case 'x':
+@@ -223,7 +223,7 @@
+ if (!bsd_check_new_partition (&i))
+ return;
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ begin = bsd_part -> start_sect;
+ end = begin + bsd_part -> nr_sects - 1;
+ #elif defined (__alpha__) || defined (__powerpc__)
+@@ -257,7 +257,7 @@
+
+ if (show_all)
+ {
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ fprintf(f, "# %s%d:\n", disk_device, bsd_part_index+1);
+ #elif defined (__alpha__) || defined (__powerpc__)
+ fprintf(f, "# %s:\n", disk_device);
+@@ -352,7 +352,7 @@
+ static void
+ bsd_write_disklabel (void)
+ {
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ printf ("Writing disklabel to %s%d.\n", disk_device, bsd_part_index+1);
+ bsd_writelabel (bsd_part, &bsd_dlabel);
+ #elif defined (__alpha__) || defined (__powerpc__)
+@@ -366,7 +366,7 @@
+ {
+ char c;
+
+-#if defined (i386)
++#if defined (i386) || defined(__amd64)
+ fprintf (stderr, "%s%d contains no disklabel.\n",
+ disk_device, bsd_part_index+1);
+ #elif defined (__alpha__) || defined (__powerpc__)
+@@ -376,7 +376,7 @@
+ while (1)
+ if ((c = tolower (read_char ("Do you want to create a disklabel? (y/n) "))) == 'y')
+ {
+-#if defined (i386)
++#if defined (i386) || defined(__amd64)
+ if (bsd_initlabel (bsd_part, &bsd_dlabel, bsd_part_index) == 1)
+ #elif defined (__alpha__) || defined (__powerpc__) || defined (__mc68000__)
+ if (bsd_initlabel (NULL, &bsd_dlabel, 0) == 1)
+@@ -507,7 +507,7 @@
+
+ bcopy (&dl, d, sizeof (struct disklabel));
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ sector = bsd_part -> start_sect;
+ #elif defined (__powerpc__)
+ sector = 0;
+@@ -521,7 +521,7 @@
+ if (BSD_BBSIZE != write (fd, buffer, BSD_BBSIZE))
+ fatal (unable_to_write);
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ printf ("Bootstrap installed on %s%d.\n", disk_device, bsd_part_index+1);
+ #elif defined (__alpha__) || defined (__powerpc__)
+ printf ("Bootstrap installed on %s.\n", disk_device);
+@@ -625,7 +625,7 @@
+ d -> d_subtype = BSD_DSTYPE_INDOSPART & pindex;
+ #endif
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ d -> d_flags = BSD_D_DOSPART;
+ #else
+ d -> d_flags = 0;
+@@ -648,7 +648,7 @@
+ d -> d_bbsize = BSD_BBSIZE;
+ d -> d_sbsize = BSD_SBSIZE;
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ d -> d_npartitions = 4;
+ pp = &d -> d_partitions[2]; /* Partition C should be the NetBSD partition */
+ pp -> p_offset = p -> start_sect;
+@@ -674,7 +674,7 @@
+ {
+ int t, sector;
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ sector = p -> start_sect;
+ #elif defined (__alpha__) || defined (__powerpc__)
+ sector = 0;
+@@ -708,7 +708,7 @@
+ {
+ int sector;
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ sector = p -> start_sect + BSD_LABELSECTOR;
+ #elif defined (__alpha__) || defined (__powerpc__)
+ sector = BSD_LABELSECTOR;
+@@ -749,7 +749,7 @@
+ sleep (4);
+ }
+
+-#if defined (i386)
++#if defined (i386) || defined (__amd64)
+ static int
+ bsd_translate_fstype (int linux_type)
+ {
+--- a/fdisklabel.h
++++ b/fdisklabel.h
+@@ -35,7 +35,7 @@
+ #define BSD_MAXPARTITIONS 8
+ #define BSD_LINUX_BOOTDIR "/usr/ucb/mdec"
+
+-#if defined (i386)
++#if defined (i386) || defined(__amd64)
+ #define BSD_LABELSECTOR 1
+ #define BSD_LABELOFFSET 0
+ #define BSD_BBSIZE 8192 /* size of boot area, with label */
+--- a/kernel-defs.h
++++ b/kernel-defs.h
+@@ -15,8 +15,14 @@
+ /* from asm/ioctl.h */
+ #define _IOC_NRBITS 8
+ #define _IOC_TYPEBITS 8
++
++#ifndef _IOC_SIZEBITS
+ #define _IOC_SIZEBITS 13
++#endif
++
++#ifndef _IOC_DIRBITS
+ #define _IOC_DIRBITS 3
++#endif
+
+ #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+ #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
diff --git a/sys-fs/mac-fdisk/mac-fdisk-0.1-r7.ebuild b/sys-fs/mac-fdisk/mac-fdisk-0.1-r7.ebuild
new file mode 100644
index 000000000000..a1a7f91cc1ef
--- /dev/null
+++ b/sys-fs/mac-fdisk/mac-fdisk-0.1-r7.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DEBRV=13
+DESCRIPTION="Mac/PowerMac disk partitioning utility"
+HOMEPAGE="ftp://ftp.mklinux.apple.com/pub/Other_Tools/"
+SRC_URI="mirror://debian/pool/main/m/mac-fdisk/${PN}_${PV}.orig.tar.gz
+ mirror://debian/pool/main/m/mac-fdisk/${PN}_${PV}-${DEBRV}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack mac-fdisk_${PV}.orig.tar.gz
+ mv mac-fdisk-${PV}.orig ${P}
+ cd "${S}"
+ epatch "${DISTDIR}"/${PN}_${PV}-${DEBRV}.diff.gz
+
+ epatch "${FILESDIR}"/largerthan2gb.patch
+ epatch "${FILESDIR}"/${P}-headers.patch
+
+ ### Patch for bug #142737
+ epatch "${FILESDIR}"/${PN}-0.1-r6-ppc64.patch
+
+ ### Patch for building on amd64
+ epatch "${FILESDIR}"/${PN}-amd64.patch
+
+ ### Patch for large (>550GB disks)
+ ### Note that >=2TB disks may not work due to limitations of the Mac
+ ### Partition Table structure, this needs to be investigated
+ epatch "${FILESDIR}"/big_pt.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die "emake failed!"
+}
+
+src_install() {
+ into /
+ newsbin pdisk mac-fdisk || die
+ newsbin fdisk pmac-fdisk || die
+
+ into /usr
+ newman mac-fdisk.8.in mac-fdisk.8
+ newman pmac-fdisk.8.in pmac-fdisk.8
+ dodoc README HISTORY
+}
diff --git a/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild b/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild
new file mode 100644
index 000000000000..1666352eaf07
--- /dev/null
+++ b/sys-fs/mac-fdisk/mac-fdisk-0.1_p16.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Mac/PowerMac disk partitioning utility"
+HOMEPAGE="ftp://ftp.mklinux.apple.com/pub/Other_Tools/"
+SRC_URI="
+ mirror://debian/pool/main/m/mac-fdisk/${PN}_${PV/_p*}.orig.tar.gz
+ mirror://debian/pool/main/m/mac-fdisk/${PN}_${PV/_p*}-${PV/*_p}.diff.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+S=${WORKDIR}/${P/_p*}.orig
+
+src_prepare() {
+ epatch "${WORKDIR}"/${PN}_${PV/_p*}-${PV/*_p}.diff
+
+ epatch "${FILESDIR}"/largerthan2gb.patch
+
+ epatch "${FILESDIR}"/${PN}-0.1-headers.patch
+
+ ### Patch for bug #142737
+ epatch "${FILESDIR}"/${PN}-0.1_p16-ppc64.patch
+
+ ### Patch for building on amd64
+ epatch "${FILESDIR}"/${PN}-amd64.patch
+
+ ### Patch for large (>550GB disks)
+ ### Note that >=2TB disks may not work due to limitations of the Mac
+ ### Partition Table structure, this needs to be investigated
+ epatch "${FILESDIR}"/big_pt.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ into /
+ newsbin pdisk mac-fdisk
+ newsbin fdisk pmac-fdisk
+
+ into /usr
+ newman mac-fdisk.8.in mac-fdisk.8
+ newman pmac-fdisk.8.in pmac-fdisk.8
+ dodoc README HISTORY
+}
diff --git a/sys-fs/mac-fdisk/metadata.xml b/sys-fs/mac-fdisk/metadata.xml
new file mode 100644
index 000000000000..034c09eb248a
--- /dev/null
+++ b/sys-fs/mac-fdisk/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ppc</herd>
+</pkgmetadata>
diff --git a/sys-fs/mdadm/Manifest b/sys-fs/mdadm/Manifest
new file mode 100644
index 000000000000..ba6acd4672fa
--- /dev/null
+++ b/sys-fs/mdadm/Manifest
@@ -0,0 +1,6 @@
+DIST mdadm-3.2.6.tar.bz2 371525 SHA256 c44ed3b31238b41cffe67caffaf45067d01e095de94988889ea8a94e22dc6c38 SHA512 1ebcd4c797cd9f7388f9a27372a19205dc81a4b19adc83e1d6d7cfd4ef18f40a211fddf59ed027a1bf35bd36d4b6795e88e8086c3b022c188ec6e9f68bf1a4ee WHIRLPOOL 61d07512758491326c21bb745ca457a9f3d9215292358d7b4755eb84bb72877058fb239cbffe25c8121caff066aded84e8353b9716e9d4a45d724777f01a6714
+DIST mdadm-3.3.1.tar.xz 407964 SHA256 d8c74112cfd77bdc1dbc1291fe8d9243c76d91bfa276fcb95f2a75ca7717ab02 SHA512 46fc1889e97d2d14b72ac26ee07eb4301467dc4a0e838ba89920253484fcd443749f3afccb3d792f7e468b20021d50dbc29dda7033d9b5a8fbaee664200f1981 WHIRLPOOL ca690bd35ab8ff475694d8f0420cd762704cc1777116edfdc9394973efa0d6decce1721dc1f7c8c84728d7434073cb6ab5161e5518c46aa8b4a7a5547ebb011d
+DIST mdadm-3.3.2.tar.xz 410628 SHA256 0f3a7e1a76b13892b79f9fceaf99ecb23513260389a768ac644ffa3ae06e5b8c SHA512 204363e41ec544ac44fa40ddf2758e31cbc1a88d7f038fa32a90b494b07be8e025be1bea8623029847ae495aabe3d1f2c503480db087d8a3dacd240003174936 WHIRLPOOL be7a7b77d6b53decfd03b2171e368d7162e48fe23835e664891acaa8cd1808236f9e34c27c573839c0f613be0e17ea94522df01a6537243eed132e87d3ea8d88
+DIST mdadm-3.3.3.tar.xz 413140 SHA256 f5b50a6b506697fb9968d660444447473b453f9eaefaa9b7d31c184693b8a28c SHA512 f2778e48a094bdf43861da0e83473cf021c3770575be0f494178dd0d386aa493eb486c2844b3b804f757f9168b7589afaa580b71777808c1f7905568e726fc66 WHIRLPOOL 6bc5991fc9eba7a7b79c175e46534070368c922fe3f1fb8ade67c97940df95d4bba9933b7e509e0b06b0e62034d72f739c6c15830e628c0cc51984751d9be08d
+DIST mdadm-3.3.4.tar.xz 413396 SHA256 8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68 SHA512 4393e5d3a50ee148cc7503d48e7dda30419ed72a8098eaa9b883ff1ee81e09c66414edbe40d8c80b28d3ae7a7b5e5b11f6a8e14188a1066c19ac08ca89ddbcb6 WHIRLPOOL 41a8bcf399a11da82c9a0bdf49a31d8c71aeccfcfe2000edf78fe2933c6bdf6f10f2c5450b0589564a75e3a37195abe2e4c0dbbc42911ca9dda4e2d538618caa
+DIST mdadm_3.3-2.debian.tar.gz 127889 SHA256 c38b155e7395b35380d506458d979b82c5b853de996f21ccab50b1202d726301 SHA512 92e4c403542caba4b9afb870ba803e6bc7ade143b27efdc27e03b3407f322722a635457cce9e8c195a3ecd7cbce66fdebdd6046fc4f36836e56e27d5d838c037 WHIRLPOOL 8f8ef1142a79044093a5f55b181dc35a142b83041a59a9b71945aa6fe84cd089a7e1b183ec6b5db210a0d07e94efad0ab3a0d0341fc6cbbbf4da9d0254b5c737
diff --git a/sys-fs/mdadm/files/etc-default-mdadm b/sys-fs/mdadm/files/etc-default-mdadm
new file mode 100644
index 000000000000..70ff20b8e385
--- /dev/null
+++ b/sys-fs/mdadm/files/etc-default-mdadm
@@ -0,0 +1,7 @@
+# Based on Debian /etc/default/mdadm
+
+# Gentoo comment: The cronjob checks for this value to decide to actually validate arrays. If missing, it does NOT actually do anything.
+# AUTOCHECK:
+# should mdadm run periodic redundancy checks over your arrays? See
+# /etc/cron.d/mdadm.
+AUTOCHECK=true
diff --git a/sys-fs/mdadm/files/mdadm-3.2.1-mdassemble.patch b/sys-fs/mdadm/files/mdadm-3.2.1-mdassemble.patch
new file mode 100644
index 000000000000..6e12dc2534a0
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.2.1-mdassemble.patch
@@ -0,0 +1,16 @@
+http://bugs.gentoo.org/211426
+
+make default mdassemble sane
+
+--- a/Makefile
++++ b/Makefile
+@@ -181,8 +181,7 @@
+ $(CC) $(CXFLAGS) $(LDFLAGS) -o raid6check raid6check.o $(CHECK_OBJS)
+
+ mdassemble : $(ASSEMBLE_SRCS) $(INCL)
+- rm -f $(OBJS)
+- $(DIET_GCC) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS) $(STATICSRC)
++ $(CC) $(CFLAGS) $(LDFLAGS) $(ASSEMBLE_FLAGS) -DHAVE_STDINT_H -o mdassemble $(ASSEMBLE_SRCS) $(STATICSRC)
+
+ mdassemble.static : $(ASSEMBLE_SRCS) $(INCL)
+ rm -f $(OBJS)
diff --git a/sys-fs/mdadm/files/mdadm-3.2.x-udevdir.patch b/sys-fs/mdadm/files/mdadm-3.2.x-udevdir.patch
new file mode 100644
index 000000000000..8bfdcd5261ab
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.2.x-udevdir.patch
@@ -0,0 +1,26 @@
+http://bugs.gentoo.org/430900
+
+--- Makefile
++++ Makefile
+@@ -97,6 +97,12 @@
+ MAN4DIR = $(MANDIR)/man4
+ MAN5DIR = $(MANDIR)/man5
+ MAN8DIR = $(MANDIR)/man8
++PKG_CONFIG ?= pkg-config
++
++UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null)
++ifndef UDEVDIR
++ UDEVDIR = lib/udev
++endif
+
+ OBJS = mdadm.o config.o policy.o mdstat.o ReadMe.o util.o maps.o lib.o \
+ Manage.o Assemble.o Build.o \
+@@ -254,7 +260,7 @@
+ $(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
+
+ install-udev: udev-md-raid.rules
+- $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules
++ $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/$(UDEVDIR)/rules.d/64-md-raid.rules
+
+ uninstall:
+ rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-DDF-validate-metadata_update-size-before-using-it.patch b/sys-fs/mdadm/files/mdadm-3.3.1-DDF-validate-metadata_update-size-before-using-it.patch
new file mode 100644
index 000000000000..befb7da91735
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-DDF-validate-metadata_update-size-before-using-it.patch
@@ -0,0 +1,44 @@
+From 1f17f96b538793a0e665e471f602c6fa490ec167 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 10 Jul 2014 15:59:06 +1000
+Subject: [PATCH 12/14] DDF: validate metadata_update size before using it.
+
+process_update already checks update->len, for all but
+the 'magic', prepare_update doesn't at all.
+
+So add tests to prepare_update that we don't exceed the buffer.
+This will consequently protect process_update from looking
+for a 'magic' which isn't there.
+
+Reported-by: Vincent Berg <vberg@ioactive.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ super-ddf.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/super-ddf.c b/super-ddf.c
+index 1e43ca2..8957c2e 100644
+--- a/super-ddf.c
++++ b/super-ddf.c
+@@ -4914,10 +4914,16 @@ static int ddf_prepare_update(struct supertype *st,
+ * If a malloc is needed, do it here.
+ */
+ struct ddf_super *ddf = st->sb;
+- be32 *magic = (be32 *)update->buf;
++ be32 *magic;
++ if (update->len < 4)
++ return 0;
++ magic = (be32 *)update->buf;
+ if (be32_eq(*magic, DDF_VD_CONF_MAGIC)) {
+ struct vcl *vcl;
+- struct vd_config *conf = (struct vd_config *) update->buf;
++ struct vd_config *conf;
++ if (update->len < (int)sizeof(*conf))
++ return 0;
++ conf = (struct vd_config *) update->buf;
+ if (posix_memalign(&update->space, 512,
+ offsetof(struct vcl, conf)
+ + ddf->conf_rec_len * 512) != 0) {
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-Grow-Do-not-try-to-restart-if-reshape-is-running.patch b/sys-fs/mdadm/files/mdadm-3.3.1-Grow-Do-not-try-to-restart-if-reshape-is-running.patch
new file mode 100644
index 000000000000..717317b8a2d0
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-Grow-Do-not-try-to-restart-if-reshape-is-running.patch
@@ -0,0 +1,45 @@
+From 13ffbe89b6103c146c08eb1c9a70833306c8322b Mon Sep 17 00:00:00 2001
+From: Pawel Baldysiak <pawel.baldysiak@intel.com>
+Date: Wed, 16 Jul 2014 12:20:34 +0200
+Subject: [PATCH 14/14] Grow: Do not try to restart if reshape is running
+
+Grow process did not check if reshape is already started
+when deciding about restarting.
+Sync_action should be checked in this case, and if
+reshape is running - restart flag should not be set.
+Otherwise, Grow process will fail to write data to
+sysfs, and reshape will not be continued.
+
+Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
+Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ Grow.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Grow.c b/Grow.c
+index a2f4f14..ea9cc60 100644
+--- a/Grow.c
++++ b/Grow.c
+@@ -2822,6 +2822,7 @@ static int reshape_array(char *container, int fd, char *devname,
+ unsigned long long array_size;
+ int done;
+ struct mdinfo *sra = NULL;
++ char buf[20];
+
+ /* when reshaping a RAID0, the component_size might be zero.
+ * So try to fix that up.
+@@ -2869,7 +2870,9 @@ static int reshape_array(char *container, int fd, char *devname,
+ goto release;
+ }
+
+- if (st->ss->external && restart && (info->reshape_progress == 0)) {
++ if (st->ss->external && restart && (info->reshape_progress == 0) &&
++ !((sysfs_get_str(info, NULL, "sync_action", buf, sizeof(buf)) > 0) &&
++ (strncmp(buf, "reshape", 7) == 0))) {
+ /* When reshape is restarted from '0', very begin of array
+ * it is possible that for external metadata reshape and array
+ * configuration doesn't happen.
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-Grow-fix-removal-of-line-in-wrong-case.patch b/sys-fs/mdadm/files/mdadm-3.3.1-Grow-fix-removal-of-line-in-wrong-case.patch
new file mode 100644
index 000000000000..acc38267d160
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-Grow-fix-removal-of-line-in-wrong-case.patch
@@ -0,0 +1,39 @@
+From e339dba2a1744dc6860a58e286ded39fc993c2db Mon Sep 17 00:00:00 2001
+From: Pawel Baldysiak <pawel.baldysiak@intel.com>
+Date: Wed, 11 Jun 2014 15:18:44 +0000
+Subject: [PATCH 02/14] Grow: fix removal of line in wrong case
+
+Commit 18d9bcfa33939cee345d4d7735bc6081bcc409c8
+removed wrong line (in case RAID0->RAID4).
+This patch corrects this mistake
+(line should be removed in case RAID4->RAID4).
+
+Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ Grow.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Grow.c b/Grow.c
+index 12730e2..a2f4f14 100644
+--- a/Grow.c
++++ b/Grow.c
+@@ -1324,6 +1324,7 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
+
+ switch (re->level) {
+ case 4:
++ re->before.layout = 0;
+ re->after.layout = 0;
+ break;
+ case 5:
+@@ -1339,7 +1340,6 @@ char *analyse_change(char *devname, struct mdinfo *info, struct reshape *re)
+
+ switch (re->level) {
+ case 4:
+- re->before.layout = 0;
+ re->after.layout = 0;
+ break;
+ case 5:
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-IMSM-use-strcpy-rather-than-pointless-strncpy.patch b/sys-fs/mdadm/files/mdadm-3.3.1-IMSM-use-strcpy-rather-than-pointless-strncpy.patch
new file mode 100644
index 000000000000..b63b1e732d36
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-IMSM-use-strcpy-rather-than-pointless-strncpy.patch
@@ -0,0 +1,32 @@
+From 6d8d290a2f09a3bfd9e44f382ae5daea128772f7 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 3 Jul 2014 15:04:01 +1000
+Subject: [PATCH 03/14] IMSM: use strcpy rather than pointless strncpy.
+
+As strncpy doesn't guarantee to nul-terminate, some static
+analysers get upset that it is followed by a 'strncat'.
+So just use a 'strcpy' - strlen(disk_by_path) is constant
+and definitely less than PATH_MAX.
+
+Link: https://github.com/neilbrown/mdadm/issues/4
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ super-intel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/super-intel.c b/super-intel.c
+index 9dd807a..0106b4f 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -9357,7 +9357,7 @@ static const char *imsm_get_disk_controller_domain(const char *path)
+ char *drv=NULL;
+ struct stat st;
+
+- strncpy(disk_path, disk_by_path, PATH_MAX - 1);
++ strcpy(disk_path, disk_by_path);
+ strncat(disk_path, path, PATH_MAX - strlen(disk_path) - 1);
+ if (stat(disk_path, &st) == 0) {
+ struct sys_dev* hba;
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-IMSM-validate-metadata_update-size-before-using-it.patch b/sys-fs/mdadm/files/mdadm-3.3.1-IMSM-validate-metadata_update-size-before-using-it.patch
new file mode 100644
index 000000000000..b1610835753a
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-IMSM-validate-metadata_update-size-before-using-it.patch
@@ -0,0 +1,128 @@
+From 095b8088fa99ad1195d1aba03af2aa561b4a6379 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 10 Jul 2014 16:09:28 +1000
+Subject: [PATCH 13/14] IMSM: validate metadata_update size before using it.
+
+Every case in prepare_update check that the size message
+size is sufficient, so process_update doesn't need to check anything.
+
+Reported-by: Vincent Berg <vberg@ioactive.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ super-intel.c | 44 +++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 41 insertions(+), 3 deletions(-)
+
+diff --git a/super-intel.c b/super-intel.c
+index 2547b4a..b4efa72 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -8587,7 +8587,7 @@ static void imsm_process_update(struct supertype *st,
+ }
+ case update_add_remove_disk: {
+ /* we may be able to repair some arrays if disks are
+- * being added, check teh status of add_remove_disk
++ * being added, check the status of add_remove_disk
+ * if discs has been added.
+ */
+ if (add_remove_disk_update(super)) {
+@@ -8617,19 +8617,28 @@ static int imsm_prepare_update(struct supertype *st,
+ * integrated by the monitor thread without worrying about live pointers
+ * in the manager thread.
+ */
+- enum imsm_update_type type = *(enum imsm_update_type *) update->buf;
++ enum imsm_update_type type;
+ struct intel_super *super = st->sb;
+ struct imsm_super *mpb = super->anchor;
+ size_t buf_len;
+ size_t len = 0;
+
++ if (update->len < (int)sizeof(type))
++ return 0;
++
++ type = *(enum imsm_update_type *) update->buf;
++
+ switch (type) {
+ case update_general_migration_checkpoint:
++ if (update->len < (int)sizeof(struct imsm_update_general_migration_checkpoint))
++ return 0;
+ dprintf("imsm: prepare_update() "
+ "for update_general_migration_checkpoint called\n");
+ break;
+ case update_takeover: {
+ struct imsm_update_takeover *u = (void *)update->buf;
++ if (update->len < (int)sizeof(*u))
++ return 0;
+ if (u->direction == R0_TO_R10) {
+ void **tail = (void **)&update->space_list;
+ struct imsm_dev *dev = get_imsm_dev(super, u->subarray);
+@@ -8670,6 +8679,9 @@ static int imsm_prepare_update(struct supertype *st,
+ struct intel_dev *dl;
+ void **space_tail = (void**)&update->space_list;
+
++ if (update->len < (int)sizeof(*u))
++ return 0;
++
+ dprintf("imsm: imsm_prepare_update() for update_reshape\n");
+
+ for (dl = super->devlist; dl; dl = dl->next) {
+@@ -8702,6 +8714,9 @@ static int imsm_prepare_update(struct supertype *st,
+ void *s;
+ int current_level = -1;
+
++ if (update->len < (int)sizeof(*u))
++ return 0;
++
+ dprintf("imsm: imsm_prepare_update() for update_reshape\n");
+
+ /* add space for bigger array in update
+@@ -8769,6 +8784,13 @@ static int imsm_prepare_update(struct supertype *st,
+ break;
+ }
+ case update_size_change: {
++ if (update->len < (int)sizeof(struct imsm_update_size_change))
++ return 0;
++ break;
++ }
++ case update_activate_spare: {
++ if (update->len < (int)sizeof(struct imsm_update_activate_spare))
++ return 0;
+ break;
+ }
+ case update_create_array: {
+@@ -8781,6 +8803,9 @@ static int imsm_prepare_update(struct supertype *st,
+ int i;
+ int activate = 0;
+
++ if (update->len < (int)sizeof(*u))
++ return 0;
++
+ inf = get_disk_info(u);
+ len = sizeof_imsm_dev(dev, 1);
+ /* allocate a new super->devlist entry */
+@@ -8802,9 +8827,22 @@ static int imsm_prepare_update(struct supertype *st,
+ }
+ len += activate * sizeof(struct imsm_disk);
+ break;
+- default:
++ }
++ case update_kill_array: {
++ if (update->len < (int)sizeof(struct imsm_update_kill_array))
++ return 0;
+ break;
+ }
++ case update_rename_array: {
++ if (update->len < (int)sizeof(struct imsm_update_rename_array))
++ return 0;
++ break;
++ }
++ case update_add_remove_disk:
++ /* no update->len needed */
++ break;
++ default:
++ return 0;
+ }
+
+ /* check if we need a larger metadata buffer */
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-Makefile-install-mdadm-grow-continue-.service.patch b/sys-fs/mdadm/files/mdadm-3.3.1-Makefile-install-mdadm-grow-continue-.service.patch
new file mode 100644
index 000000000000..431bfd1abe3b
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-Makefile-install-mdadm-grow-continue-.service.patch
@@ -0,0 +1,28 @@
+From 616f197f9d6d044afb9e27ddc9cd087d21d610f0 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Tue, 10 Jun 2014 20:34:40 +1000
+Subject: [PATCH 01/14] Makefile: install mdadm-grow-continue@.service
+
+Forgot to add this to install-systemd target
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c7e7a42..1a4a5dc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -290,7 +290,7 @@ install-udev: udev-md-raid-arrays.rules udev-md-raid-assembly.rules
+
+ install-systemd: systemd/mdmon@.service
+ @for file in mdmon@.service mdmonitor.service mdadm-last-resort@.timer \
+- mdadm-last-resort@.service ; \
++ mdadm-last-resort@.service mdadm-grow-continue@.service; \
+ do sed -e 's,BINDIR,$(BINDIR),g' systemd/$$file > .install.tmp && \
+ echo $(INSTALL) -D -m 644 systemd/$$file $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \
+ $(INSTALL) -D -m 644 .install.tmp $(DESTDIR)$(SYSTEMD_DIR)/$$file ; \
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-mdmon-allow-prepare_update-to-report-failure.patch b/sys-fs/mdadm/files/mdadm-3.3.1-mdmon-allow-prepare_update-to-report-failure.patch
new file mode 100644
index 000000000000..772248b19c3d
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-mdmon-allow-prepare_update-to-report-failure.patch
@@ -0,0 +1,119 @@
+From 5fe6f031d9a21a935f0ef1b1fbdb314b53f2199f Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 10 Jul 2014 15:54:02 +1000
+Subject: [PATCH 11/14] mdmon: allow prepare_update to report failure.
+
+If 'prepare_update' fails for some reason there is little
+point continuing on to 'process_update'.
+For now only malloc failures are caught, but other failures
+will be considered in future.
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ managemon.c | 3 ++-
+ mdadm.h | 5 ++++-
+ super-ddf.c | 8 +++++---
+ super-intel.c | 9 +++++----
+ 4 files changed, 16 insertions(+), 9 deletions(-)
+
+diff --git a/managemon.c b/managemon.c
+index 5f7e2ce..1c9eccc 100644
+--- a/managemon.c
++++ b/managemon.c
+@@ -819,7 +819,8 @@ static void handle_message(struct supertype *container, struct metadata_update *
+ mu->space_list = NULL;
+ mu->next = NULL;
+ if (container->ss->prepare_update)
+- container->ss->prepare_update(container, mu);
++ if (!container->ss->prepare_update(container, mu))
++ free_updates(&mu);
+ queue_metadata_update(mu);
+ }
+ }
+diff --git a/mdadm.h b/mdadm.h
+index 914d67c..02a9288 100644
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -929,7 +929,10 @@ extern struct superswitch {
+ void (*sync_metadata)(struct supertype *st);
+ void (*process_update)(struct supertype *st,
+ struct metadata_update *update);
+- void (*prepare_update)(struct supertype *st,
++ /* Prepare updates allocates extra memory that might be
++ * needed. If the update cannot be understood, return 0.
++ */
++ int (*prepare_update)(struct supertype *st,
+ struct metadata_update *update);
+
+ /* activate_spare will check if the array is degraded and, if it
+diff --git a/super-ddf.c b/super-ddf.c
+index ab9fc46..1e43ca2 100644
+--- a/super-ddf.c
++++ b/super-ddf.c
+@@ -4906,8 +4906,8 @@ static void ddf_process_update(struct supertype *st,
+ /* case DDF_SPARE_ASSIGN_MAGIC */
+ }
+
+-static void ddf_prepare_update(struct supertype *st,
+- struct metadata_update *update)
++static int ddf_prepare_update(struct supertype *st,
++ struct metadata_update *update)
+ {
+ /* This update arrived at managemon.
+ * We are about to pass it to monitor.
+@@ -4922,15 +4922,17 @@ static void ddf_prepare_update(struct supertype *st,
+ offsetof(struct vcl, conf)
+ + ddf->conf_rec_len * 512) != 0) {
+ update->space = NULL;
+- return;
++ return 0;
+ }
+ vcl = update->space;
+ vcl->conf.sec_elmnt_count = conf->sec_elmnt_count;
+ if (alloc_other_bvds(ddf, vcl) != 0) {
+ free(update->space);
+ update->space = NULL;
++ return 0;
+ }
+ }
++ return 1;
+ }
+
+ /*
+diff --git a/super-intel.c b/super-intel.c
+index 7734bde..2547b4a 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -8607,8 +8607,8 @@ static void imsm_process_update(struct supertype *st,
+
+ static struct mdinfo *get_spares_for_grow(struct supertype *st);
+
+-static void imsm_prepare_update(struct supertype *st,
+- struct metadata_update *update)
++static int imsm_prepare_update(struct supertype *st,
++ struct metadata_update *update)
+ {
+ /**
+ * Allocate space to hold new disk entries, raid-device entries or a new
+@@ -8828,6 +8828,7 @@ static void imsm_prepare_update(struct supertype *st,
+ else
+ super->next_buf = NULL;
+ }
++ return 1;
+ }
+
+ /* must be called while manager is quiesced */
+@@ -9716,8 +9717,8 @@ static void imsm_update_metadata_locally(struct supertype *st,
+ mu.space = NULL;
+ mu.space_list = NULL;
+ mu.next = NULL;
+- imsm_prepare_update(st, &mu);
+- imsm_process_update(st, &mu);
++ if (imsm_prepare_update(st, &mu))
++ imsm_process_update(st, &mu);
+
+ while (mu.space_list) {
+ void **space = mu.space_list;
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm-3.3.1-mdmon-ensure-Unix-domain-socket-is-created-with-safe.patch b/sys-fs/mdadm/files/mdadm-3.3.1-mdmon-ensure-Unix-domain-socket-is-created-with-safe.patch
new file mode 100644
index 000000000000..9780196e28cd
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm-3.3.1-mdmon-ensure-Unix-domain-socket-is-created-with-safe.patch
@@ -0,0 +1,34 @@
+From 120ec6f7b96455e42bdfa9131c0c9026c57eaf19 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Thu, 3 Jul 2014 17:06:45 +1000
+Subject: [PATCH 09/14] mdmon: ensure Unix domain socket is created with safe
+ permissions.
+
+In the unlikely case that mdmon is started with an overly
+permissive umask, we don't want to risk giving away world acccess.
+
+All other "mkdir" and "O_CREAT" calls in mdmon and mdadm set
+a suitably restrictive permission mask. 'bind' don't take an
+explicit mask so it needs an implicit one.
+
+Reported-by: Vincent Berg <vberg@ioactive.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+---
+ mdmon.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/mdmon.c b/mdmon.c
+index b84d4d9..21221cd 100644
+--- a/mdmon.c
++++ b/mdmon.c
+@@ -232,6 +232,7 @@ static int make_control_sock(char *devname)
+
+ addr.sun_family = PF_LOCAL;
+ strcpy(addr.sun_path, path);
++ umask(077); /* ensure no world write access */
+ if (bind(sfd, &addr, sizeof(addr)) < 0) {
+ close(sfd);
+ return -1;
+--
+2.0.0
+
diff --git a/sys-fs/mdadm/files/mdadm.confd b/sys-fs/mdadm/files/mdadm.confd
new file mode 100644
index 000000000000..a4ead14dc34e
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/mdadm: config file for /etc/init.d/mdadm
+
+# Misc options to pass to mdadm in monitor mode.
+# For more info, run `mdadm --monitor --help` or see
+# the mdadm(8) manpage.
+
+MDADM_OPTS="--syslog"
diff --git a/sys-fs/mdadm/files/mdadm.rc b/sys-fs/mdadm/files/mdadm.rc
new file mode 100755
index 000000000000..f4858c33f435
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm.rc
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger dns net
+}
+
+start() {
+ ebegin "Starting mdadm monitor"
+ mdadm --monitor --scan \
+ --daemonise \
+ --pid-file /var/run/mdadm.pid \
+ ${MDADM_OPTS}
+ eend $?
+}
+
+stop() {
+ local ret
+ ebegin "Stopping mdadm monitor"
+ start-stop-daemon --stop --pidfile /var/run/mdadm.pid
+ ret=$?
+ rm -f /var/run/mdadm.pid
+ eend ${ret}
+}
diff --git a/sys-fs/mdadm/files/mdadm.service b/sys-fs/mdadm/files/mdadm.service
new file mode 100644
index 000000000000..342177d4f06a
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Software RAID monitoring and management
+ConditionPathExists=/etc/mdadm.conf
+
+[Service]
+Type=forking
+PIDFile=/run/mdadm/mdadm.pid
+EnvironmentFile=/etc/conf.d/mdadm
+ExecStart=/sbin/mdadm --monitor --scan -f --pid-file=/run/mdadm/mdadm.pid $MDADM_OPTS
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/sys-fs/mdadm/files/mdadm.tmpfiles.conf b/sys-fs/mdadm/files/mdadm.tmpfiles.conf
new file mode 100644
index 000000000000..3207ddae0e43
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm.tmpfiles.conf
@@ -0,0 +1 @@
+d /run/mdadm 0710 root root -
diff --git a/sys-fs/mdadm/files/mdadm.weekly b/sys-fs/mdadm/files/mdadm.weekly
new file mode 100644
index 000000000000..e2b35b550fce
--- /dev/null
+++ b/sys-fs/mdadm/files/mdadm.weekly
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This requires that AUTOCHECK is true in /etc/default/mdadm
+if [ -x /usr/sbin/checkarray ] && [ $(date +\%d) -le 7 ]; then
+ /usr/sbin/checkarray --cron --all --idle --quiet
+fi
diff --git a/sys-fs/mdadm/files/mdraid.confd b/sys-fs/mdadm/files/mdraid.confd
new file mode 100644
index 000000000000..5694d732d006
--- /dev/null
+++ b/sys-fs/mdadm/files/mdraid.confd
@@ -0,0 +1,11 @@
+# /etc/conf.d/mdraid: config file for /etc/init.d/mdraid
+
+# For people who run raid on top of some other layer (like
+# dmcrypt), use rc_need to specify that requirement. See
+# the runscript(8) man page for more information.
+
+# Most configuration happens in /etc/mdadm.conf.
+
+# Pass additional options when assembling raids.
+# Note: This applies to all raids.
+MDADM_ASSEMBLE_OPTS=""
diff --git a/sys-fs/mdadm/files/mdraid.rc b/sys-fs/mdadm/files/mdraid.rc
new file mode 100644
index 000000000000..b46b79f73770
--- /dev/null
+++ b/sys-fs/mdadm/files/mdraid.rc
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before checkfs fsck
+ after modules
+}
+
+start() {
+ local output
+
+ ebegin "Starting up RAID devices"
+ output=$(mdadm -As ${MDADM_ASSEMBLE_OPTS} 2>&1)
+ eend $? "${output}"
+
+ local pat="/dev/md_d*"
+ set -- ${pat}
+ if [ "$*" != "${pat}" ] ; then
+ ebegin "Creating RAID device partitions"
+ blockdev "$@"
+ eend $?
+ # wait because vgscan runs next, and we want udev to fire
+ sleep 1
+ fi
+
+ return 0
+}
+
+stop() {
+ local output
+
+ # XXX: Maybe drop this check ?
+ [ ! -e /etc/mdadm/mdadm.conf ] && [ ! -e /etc/mdadm.conf ] && return 0
+
+ ebegin "Shutting down RAID devices (mdadm)"
+ output=$(mdadm -Ss 2>&1)
+ eend $? "${output}"
+}
diff --git a/sys-fs/mdadm/mdadm-3.2.6-r1.ebuild b/sys-fs/mdadm/mdadm-3.2.6-r1.ebuild
new file mode 100644
index 000000000000..7a34dd48f7ad
--- /dev/null
+++ b/sys-fs/mdadm/mdadm-3.2.6-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit multilib eutils flag-o-matic systemd toolchain-funcs
+
+DESCRIPTION="A useful tool for running RAID systems - it can be used as a replacement for the raidtools"
+HOMEPAGE="http://neil.brown.name/blog/mdadm"
+SRC_URI="mirror://kernel/linux/utils/raid/mdadm/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="static"
+
+DEPEND="virtual/pkgconfig"
+RDEPEND="!<sys-apps/baselayout-2.1-r1
+ !<sys-apps/openrc-0.10
+ >=sys-apps/util-linux-2.16"
+
+# The tests edit values in /proc and run tests on software raid devices.
+# Thus, they shouldn't be run on systems with active software RAID devices.
+RESTRICT="test"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2.1-mdassemble.patch #211426
+ epatch "${FILESDIR}"/${PN}-3.2.x-udevdir.patch #430900
+}
+
+mdadm_emake() {
+ emake \
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+ CC="$(tc-getCC)" \
+ CWFLAGS="-Wall" \
+ CXFLAGS="${CFLAGS}" \
+ MAP_DIR=/run/mdadm \
+ "$@"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ mdadm_emake all mdassemble
+}
+
+src_test() {
+ mdadm_emake test
+
+ sh ./test || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ into /
+ dosbin mdassemble
+ dodoc ChangeLog INSTALL TODO README* ANNOUNCE-${PV}
+
+ insinto /etc
+ newins mdadm.conf-example mdadm.conf
+ newinitd "${FILESDIR}"/mdadm.rc mdadm
+ newconfd "${FILESDIR}"/mdadm.confd mdadm
+ newinitd "${FILESDIR}"/mdraid.rc mdraid
+ newconfd "${FILESDIR}"/mdraid.confd mdraid
+ systemd_dounit "${FILESDIR}/mdadm.service"
+ systemd_newtmpfilesd "${FILESDIR}/mdadm.tmpfiles.conf" mdadm.conf
+}
+
+pkg_preinst() {
+ if ! has_version ${CATEGORY}/${PN} ; then
+ # Only inform people the first time they install.
+ elog "If you're not relying on kernel auto-detect of your RAID"
+ elog "devices, you need to add 'mdraid' to your 'boot' runlevel:"
+ elog " rc-update add mdraid boot"
+ fi
+}
diff --git a/sys-fs/mdadm/mdadm-3.3.1-r2.ebuild b/sys-fs/mdadm/mdadm-3.3.1-r2.ebuild
new file mode 100644
index 000000000000..2f56dba220c1
--- /dev/null
+++ b/sys-fs/mdadm/mdadm-3.3.1-r2.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic multilib systemd toolchain-funcs udev
+
+DESCRIPTION="A useful tool for running RAID systems - it can be used as a replacement for the raidtools"
+HOMEPAGE="http://neil.brown.name/blog/mdadm"
+DEB_PR=2
+SRC_URI="mirror://kernel/linux/utils/raid/mdadm/${P}.tar.xz
+ mirror://debian/pool/main/m/mdadm/${PN}_3.3-${DEB_PR}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="static"
+
+DEPEND="virtual/pkgconfig
+ app-arch/xz-utils"
+RDEPEND=">=sys-apps/util-linux-2.16"
+
+# The tests edit values in /proc and run tests on software raid devices.
+# Thus, they shouldn't be run on systems with active software RAID devices.
+RESTRICT="test"
+
+mdadm_emake() {
+ emake \
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+ CC="$(tc-getCC)" \
+ CWFLAGS="-Wall" \
+ CXFLAGS="${CFLAGS}" \
+ UDEVDIR="$(get_udevdir)" \
+ SYSTEMD_DIR="$(systemd_get_unitdir)" \
+ "$@"
+}
+
+src_prepare() {
+ # These are important bugfixes from upstream git after 3.3.1 release,
+ # and before and including 17 Jul 2014:
+ epatch \
+ "${FILESDIR}"/${P}-Makefile-install-mdadm-grow-continue-.service.patch \
+ "${FILESDIR}"/${P}-Grow-fix-removal-of-line-in-wrong-case.patch \
+ "${FILESDIR}"/${P}-IMSM-use-strcpy-rather-than-pointless-strncpy.patch \
+ "${FILESDIR}"/${P}-mdmon-ensure-Unix-domain-socket-is-created-with-safe.patch \
+ "${FILESDIR}"/${P}-mdmon-allow-prepare_update-to-report-failure.patch \
+ "${FILESDIR}"/${P}-DDF-validate-metadata_update-size-before-using-it.patch \
+ "${FILESDIR}"/${P}-IMSM-validate-metadata_update-size-before-using-it.patch \
+ "${FILESDIR}"/${P}-Grow-Do-not-try-to-restart-if-reshape-is-running.patch
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ mdadm_emake all mdassemble
+}
+
+src_test() {
+ mdadm_emake test
+
+ sh ./test || die
+}
+
+src_install() {
+ # Use split lines because of bug #517218
+ mdadm_emake DESTDIR="${D}" install
+ mdadm_emake DESTDIR="${D}" install-systemd
+ into /
+ dosbin mdassemble
+ dodoc ChangeLog INSTALL TODO README* ANNOUNCE-${PV}
+
+ insinto /etc
+ newins mdadm.conf-example mdadm.conf
+ newinitd "${FILESDIR}"/mdadm.rc mdadm
+ newconfd "${FILESDIR}"/mdadm.confd mdadm
+ newinitd "${FILESDIR}"/mdraid.rc mdraid
+ newconfd "${FILESDIR}"/mdraid.confd mdraid
+
+ # From the Debian patchset
+ into /usr
+ dodoc "${WORKDIR}"/debian/README.checkarray
+ dosbin "${WORKDIR}"/debian/checkarray
+
+ insinto /etc/cron.weekly
+ newins "${FILESDIR}"/mdadm.weekly mdadm
+}
+
+pkg_postinst() {
+ if ! systemd_is_booted; then
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ # Only inform people the first time they install.
+ elog "If you're not relying on kernel auto-detect of your RAID"
+ elog "devices, you need to add 'mdraid' to your 'boot' runlevel:"
+ elog " rc-update add mdraid boot"
+ fi
+ fi
+}
diff --git a/sys-fs/mdadm/mdadm-3.3.2-r1.ebuild b/sys-fs/mdadm/mdadm-3.3.2-r1.ebuild
new file mode 100644
index 000000000000..ffa2141d880d
--- /dev/null
+++ b/sys-fs/mdadm/mdadm-3.3.2-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic multilib systemd toolchain-funcs udev
+
+DESCRIPTION="A useful tool for running RAID systems - it can be used as a replacement for the raidtools"
+HOMEPAGE="http://neil.brown.name/blog/mdadm"
+DEB_PR=2
+SRC_URI="mirror://kernel/linux/utils/raid/mdadm/${P}.tar.xz
+ mirror://debian/pool/main/m/mdadm/${PN}_3.3-${DEB_PR}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="static"
+
+DEPEND="virtual/pkgconfig
+ app-arch/xz-utils"
+RDEPEND=">=sys-apps/util-linux-2.16"
+
+# The tests edit values in /proc and run tests on software raid devices.
+# Thus, they shouldn't be run on systems with active software RAID devices.
+RESTRICT="test"
+
+mdadm_emake() {
+ emake \
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+ CC="$(tc-getCC)" \
+ CWFLAGS="-Wall" \
+ CXFLAGS="${CFLAGS}" \
+ UDEVDIR="$(get_udevdir)" \
+ SYSTEMD_DIR="$(systemd_get_unitdir)" \
+ "$@"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ mdadm_emake all mdassemble
+}
+
+src_test() {
+ mdadm_emake test
+
+ sh ./test || die
+}
+
+src_install() {
+ mdadm_emake DESTDIR="${D}" install install-systemd
+ into /
+ dosbin mdassemble
+ dodoc ChangeLog INSTALL TODO README* ANNOUNCE-${PV}
+
+ insinto /etc
+ newins mdadm.conf-example mdadm.conf
+ newinitd "${FILESDIR}"/mdadm.rc mdadm
+ newconfd "${FILESDIR}"/mdadm.confd mdadm
+ newinitd "${FILESDIR}"/mdraid.rc mdraid
+ newconfd "${FILESDIR}"/mdraid.confd mdraid
+
+ # From the Debian patchset
+ into /usr
+ dodoc "${WORKDIR}"/debian/README.checkarray
+ dosbin "${WORKDIR}"/debian/checkarray
+ insinto /etc/default
+ newins "${FILESDIR}"/etc-default-mdadm mdadm
+
+ insinto /etc/cron.weekly
+ newins "${FILESDIR}"/mdadm.weekly mdadm
+}
+
+pkg_postinst() {
+ if ! systemd_is_booted; then
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ # Only inform people the first time they install.
+ elog "If you're not relying on kernel auto-detect of your RAID"
+ elog "devices, you need to add 'mdraid' to your 'boot' runlevel:"
+ elog " rc-update add mdraid boot"
+ fi
+ fi
+}
diff --git a/sys-fs/mdadm/mdadm-3.3.3.ebuild b/sys-fs/mdadm/mdadm-3.3.3.ebuild
new file mode 100644
index 000000000000..ffa2141d880d
--- /dev/null
+++ b/sys-fs/mdadm/mdadm-3.3.3.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic multilib systemd toolchain-funcs udev
+
+DESCRIPTION="A useful tool for running RAID systems - it can be used as a replacement for the raidtools"
+HOMEPAGE="http://neil.brown.name/blog/mdadm"
+DEB_PR=2
+SRC_URI="mirror://kernel/linux/utils/raid/mdadm/${P}.tar.xz
+ mirror://debian/pool/main/m/mdadm/${PN}_3.3-${DEB_PR}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="static"
+
+DEPEND="virtual/pkgconfig
+ app-arch/xz-utils"
+RDEPEND=">=sys-apps/util-linux-2.16"
+
+# The tests edit values in /proc and run tests on software raid devices.
+# Thus, they shouldn't be run on systems with active software RAID devices.
+RESTRICT="test"
+
+mdadm_emake() {
+ emake \
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+ CC="$(tc-getCC)" \
+ CWFLAGS="-Wall" \
+ CXFLAGS="${CFLAGS}" \
+ UDEVDIR="$(get_udevdir)" \
+ SYSTEMD_DIR="$(systemd_get_unitdir)" \
+ "$@"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ mdadm_emake all mdassemble
+}
+
+src_test() {
+ mdadm_emake test
+
+ sh ./test || die
+}
+
+src_install() {
+ mdadm_emake DESTDIR="${D}" install install-systemd
+ into /
+ dosbin mdassemble
+ dodoc ChangeLog INSTALL TODO README* ANNOUNCE-${PV}
+
+ insinto /etc
+ newins mdadm.conf-example mdadm.conf
+ newinitd "${FILESDIR}"/mdadm.rc mdadm
+ newconfd "${FILESDIR}"/mdadm.confd mdadm
+ newinitd "${FILESDIR}"/mdraid.rc mdraid
+ newconfd "${FILESDIR}"/mdraid.confd mdraid
+
+ # From the Debian patchset
+ into /usr
+ dodoc "${WORKDIR}"/debian/README.checkarray
+ dosbin "${WORKDIR}"/debian/checkarray
+ insinto /etc/default
+ newins "${FILESDIR}"/etc-default-mdadm mdadm
+
+ insinto /etc/cron.weekly
+ newins "${FILESDIR}"/mdadm.weekly mdadm
+}
+
+pkg_postinst() {
+ if ! systemd_is_booted; then
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ # Only inform people the first time they install.
+ elog "If you're not relying on kernel auto-detect of your RAID"
+ elog "devices, you need to add 'mdraid' to your 'boot' runlevel:"
+ elog " rc-update add mdraid boot"
+ fi
+ fi
+}
diff --git a/sys-fs/mdadm/mdadm-3.3.4.ebuild b/sys-fs/mdadm/mdadm-3.3.4.ebuild
new file mode 100644
index 000000000000..ffa2141d880d
--- /dev/null
+++ b/sys-fs/mdadm/mdadm-3.3.4.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic multilib systemd toolchain-funcs udev
+
+DESCRIPTION="A useful tool for running RAID systems - it can be used as a replacement for the raidtools"
+HOMEPAGE="http://neil.brown.name/blog/mdadm"
+DEB_PR=2
+SRC_URI="mirror://kernel/linux/utils/raid/mdadm/${P}.tar.xz
+ mirror://debian/pool/main/m/mdadm/${PN}_3.3-${DEB_PR}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="static"
+
+DEPEND="virtual/pkgconfig
+ app-arch/xz-utils"
+RDEPEND=">=sys-apps/util-linux-2.16"
+
+# The tests edit values in /proc and run tests on software raid devices.
+# Thus, they shouldn't be run on systems with active software RAID devices.
+RESTRICT="test"
+
+mdadm_emake() {
+ emake \
+ PKG_CONFIG="$(tc-getPKG_CONFIG)" \
+ CC="$(tc-getCC)" \
+ CWFLAGS="-Wall" \
+ CXFLAGS="${CFLAGS}" \
+ UDEVDIR="$(get_udevdir)" \
+ SYSTEMD_DIR="$(systemd_get_unitdir)" \
+ "$@"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ mdadm_emake all mdassemble
+}
+
+src_test() {
+ mdadm_emake test
+
+ sh ./test || die
+}
+
+src_install() {
+ mdadm_emake DESTDIR="${D}" install install-systemd
+ into /
+ dosbin mdassemble
+ dodoc ChangeLog INSTALL TODO README* ANNOUNCE-${PV}
+
+ insinto /etc
+ newins mdadm.conf-example mdadm.conf
+ newinitd "${FILESDIR}"/mdadm.rc mdadm
+ newconfd "${FILESDIR}"/mdadm.confd mdadm
+ newinitd "${FILESDIR}"/mdraid.rc mdraid
+ newconfd "${FILESDIR}"/mdraid.confd mdraid
+
+ # From the Debian patchset
+ into /usr
+ dodoc "${WORKDIR}"/debian/README.checkarray
+ dosbin "${WORKDIR}"/debian/checkarray
+ insinto /etc/default
+ newins "${FILESDIR}"/etc-default-mdadm mdadm
+
+ insinto /etc/cron.weekly
+ newins "${FILESDIR}"/mdadm.weekly mdadm
+}
+
+pkg_postinst() {
+ if ! systemd_is_booted; then
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ # Only inform people the first time they install.
+ elog "If you're not relying on kernel auto-detect of your RAID"
+ elog "devices, you need to add 'mdraid' to your 'boot' runlevel:"
+ elog " rc-update add mdraid boot"
+ fi
+ fi
+}
diff --git a/sys-fs/mdadm/metadata.xml b/sys-fs/mdadm/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/mdadm/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/metadata.xml b/sys-fs/metadata.xml
new file mode 100644
index 000000000000..0760ba105602
--- /dev/null
+++ b/sys-fs/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sys-fs category contains filesystem tools and utilities.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sys-fs contiene herramientas y utilidades de sistemas de
+ ficheros.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sys-fs enthält Programme für die Arbeit mit Dateisystemen.
+ </longdescription>
+ <longdescription lang="nl">
+ De sys-fs categorie bevat hulpmiddelen om met bestandssystemen te werken.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sys-fs chứa các công cụ và tiện ích về hệ tập tin.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sys-fs contiene gli strumenti e le utilità di supporto per i vari file systems.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sys-fs contém certos utilitários e ferramentas para
+ sistemas de arquivos.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sys-fs zawiera programy i narzędzia związane z różnymi
+ systemami plików.
+ </longdescription>
+</catmetadata>
+
diff --git a/sys-fs/mhddfs/Manifest b/sys-fs/mhddfs/Manifest
new file mode 100644
index 000000000000..8f6579100271
--- /dev/null
+++ b/sys-fs/mhddfs/Manifest
@@ -0,0 +1 @@
+DIST mhddfs_0.1.39.tar.gz 40665 SHA256 702fc5486460c1828898426b1935179ce60bc1ed16fc8bc575c9ec1d12acef91 SHA512 cf1952e665e82a92ccfef9215d4faf78cd235566b67e6ebc3a60ab53089d9391bc41a08e6b203ad052e4a08bdd14428f2d9abe48f341aeb0c80ae1da80f83f89 WHIRLPOOL 8bad918dbfe9862620b1a26f106740b66af0ddd86b078d776e4f671f21399e225876f6b98edafe4165e97c85d9eda4b6f5abe27eb71740341b4606ac864ff5e4
diff --git a/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch b/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch
new file mode 100644
index 000000000000..331bb7c23f60
--- /dev/null
+++ b/sys-fs/mhddfs/files/mhddfs-respect-compiler-vars.patch
@@ -0,0 +1,66 @@
+--- Makefile.orig 2012-11-19 15:25:21.665692111 +0400
++++ Makefile 2012-11-19 15:27:08.406691288 +0400
+@@ -22,13 +22,13 @@
+
+ TARGET = mhddfs
+
+-CFLAGS = -Wall $(shell pkg-config fuse --cflags) \
++CFLAGS += -Wall $(shell pkg-config fuse --cflags) \
+ -DFUSE_USE_VERSION=26 -MMD
+ ifdef WITHOUT_XATTR
+ CFLAGS += -DWITHOUT_XATTR
+ endif
+
+-LDFLAGS = $(shell pkg-config fuse --libs)
++LIBS = $(shell pkg-config fuse --libs)
+
+ FORTAR = src COPYING LICENSE README Makefile \
+ README.ru.UTF-8 ChangeLog mhddfs.1 \
+@@ -64,14 +64,14 @@
+ $(shell rpm --eval '%_rpmdir')/*/mhddfs-*$(VERSION)-$(RELEASE)* .
+
+ $(TARGET): obj/obj-stamp $(OBJ)
+- gcc $(CFLAGS) $(OBJ) -o $@ $(LDFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o $@
+
+ obj/obj-stamp:
+ mkdir -p obj
+ touch $@
+
+ obj/%.o: src/%.c
+- gcc $(CFLAGS) -c $< -o $@
++ $(CC) $(CFLAGS) -c $< -o $@
+
+ clean:
+ rm -fr obj $(TARGET) pwrite_test statvfs rename
+@@ -79,7 +79,7 @@
+ rm -fr rename-test/mnt
+
+ rename: tests/rename.c
+- gcc -o $@ $<
++ $(CC) -o $@ $<
+
+ release_svn_thread:
+ @echo current version $(VERSION)
+@@ -94,10 +94,10 @@
+ screen -t vim vim Makefile src/*.[ch] README* ChangeLog mhddfs.1
+
+ pwrite_test: src/test/pwrite.c
+- gcc -o $@ $<
++ $(CC) -o $@ $<
+
+ statvfs: src/test/statvfs.c
+- gcc -o $@ $<
++ $(CC) -o $@ $<
+
+ images-mount: test1.img test2.img
+ mount|grep -q `pwd`/test1 || sudo mount -o loop test1.img test1
+@@ -141,7 +141,7 @@
+ while make test; do echo ok; echo; done
+
+ ptest:
+- gcc -o $@ tests/plocks.c -l pthread
++ $(CC) -o $@ tests/plocks.c -l pthread
+ -./$@
+ rm -f $@
+
diff --git a/sys-fs/mhddfs/metadata.xml b/sys-fs/mhddfs/metadata.xml
new file mode 100644
index 000000000000..b6b8956cde34
--- /dev/null
+++ b/sys-fs/mhddfs/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/mhddfs/mhddfs-0.1.39.ebuild b/sys-fs/mhddfs/mhddfs-0.1.39.ebuild
new file mode 100644
index 000000000000..79be5d001610
--- /dev/null
+++ b/sys-fs/mhddfs/mhddfs-0.1.39.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit base eutils toolchain-funcs
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="Fuse multi harddrive filesystem"
+HOMEPAGE="http://mhddfs.uvw.ru/ http://svn.uvw.ru/mhddfs/trunk/README"
+SRC_URI="http://mhddfs.uvw.ru/downloads/${MY_P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64"
+IUSE="linguas_ru suid"
+
+RDEPEND=">=sys-fs/fuse-2.7.0"
+DEPEND="${RDEPEND}
+ dev-libs/uthash"
+
+DOCS="ChangeLog README"
+PATCHES=( "${FILESDIR}/${PN}-respect-compiler-vars.patch" )
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dobin mhddfs
+ doman mhddfs.1
+ dodoc ${DOCS}
+ use linguas_ru && dodoc README.ru.UTF-8
+ use suid && fperms u+s /usr/bin/${PN}
+}
+
+pkg_postinst() {
+ if use suid; then
+ ewarn
+ ewarn "You have chosen to install ${PN} with the binary setuid root. This"
+ ewarn "means that if there any undetected vulnerabilities in the binary,"
+ ewarn "then local users may be able to gain root access on your machine."
+ ewarn
+ fi
+}
diff --git a/sys-fs/mp3fs/Manifest b/sys-fs/mp3fs/Manifest
new file mode 100644
index 000000000000..fae4867da817
--- /dev/null
+++ b/sys-fs/mp3fs/Manifest
@@ -0,0 +1,2 @@
+DIST mp3fs-0.32.tar.gz 120579 SHA256 0b3d7064bf27b86a7f691684760f02126b5edab0108d65826c2a0f7f1a3eefd1 SHA512 826ad719198195d66fff5bbb4b9b6734b5f180f37ead11bf77ecf9dd7cc86e4e2243cdea78c029b3bb8757efb9f52143f84c979f07034b016147b6257d0c9980 WHIRLPOOL 318a9ad3187e443ae396df6bc52da1178371777f7d8720e97ab7ac0a0d9a5c919b52bd0f87ff7c4aa2ef324b0fcb74cd5582067674447997d612de3053c8c0db
+DIST mp3fs-0.91.tar.gz 357098 SHA256 a47b5e351b7660e6f535a3c5b489c5a8191209957f8c0b8d066a5c221e8ecf92 SHA512 9499566afbaf181acd9efb8a4d6253e288ab9be0c8b036b2993553d0d4f4692d7dbcf34ac03787d8dbbfc35b2cc29e1d78612933c428a908c9c48290fedb8681 WHIRLPOOL 7acf9bf3a89df397439c814dd8110558d9508942b76e337a0d776bfb906da6ae69e3ee1ce480210f993eae3f3a4e457880373241a21ade127e7b2f993020ffdc
diff --git a/sys-fs/mp3fs/metadata.xml b/sys-fs/mp3fs/metadata.xml
new file mode 100644
index 000000000000..19703855fdd0
--- /dev/null
+++ b/sys-fs/mp3fs/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tamiko@gentoo.org</email>
+ <name>Matthias Maier</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">khenriks/mp3fs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/mp3fs/mp3fs-0.32.ebuild b/sys-fs/mp3fs/mp3fs-0.32.ebuild
new file mode 100644
index 000000000000..e71056c4d0dd
--- /dev/null
+++ b/sys-fs/mp3fs/mp3fs-0.32.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="a read-only FUSE filesystem which transcodes FLAC audio files to MP3 when read"
+HOMEPAGE="http://khenriks.github.com/mp3fs/"
+SRC_URI="mirror://github/khenriks/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse
+ media-libs/libid3tag
+ media-libs/flac
+ media-sound/lame
+ media-libs/libogg"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS README.rst
+}
diff --git a/sys-fs/mp3fs/mp3fs-0.91.ebuild b/sys-fs/mp3fs/mp3fs-0.91.ebuild
new file mode 100644
index 000000000000..a681935398fd
--- /dev/null
+++ b/sys-fs/mp3fs/mp3fs-0.91.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="a read-only FUSE filesystem which transcodes FLAC audio files to MP3 when read"
+HOMEPAGE="http://khenriks.github.com/mp3fs/"
+SRC_URI="https://github.com/khenriks/mp3fs/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse
+ media-libs/libid3tag
+ media-libs/flac
+ media-sound/lame
+ media-libs/libogg"
+RDEPEND="${DEPEND}"
diff --git a/sys-fs/mtd-utils/Manifest b/sys-fs/mtd-utils/Manifest
new file mode 100644
index 000000000000..b08ae6410e3d
--- /dev/null
+++ b/sys-fs/mtd-utils/Manifest
@@ -0,0 +1,5 @@
+DIST mtd-utils-1.4.5.tar.gz 337279 SHA256 b30d9e262f7d8ede7ad4a3bc13803d4661e36cfb4db7f687ed64afb26e93537b SHA512 eb62b19ee3f1896e1890195b364675fa8d275d28deea60b67e7111713c0c16329035fcab934e3668d6b87b63ea3fa341c8160329a7a866eb9075f76d2284d441 WHIRLPOOL f065e04d58d38fe5d32a7652f8a810cff7faed89c95fb11b0ee471af85d5d43250ef5439408bf876af8adae3c8899f802e26a0da67a527de4d24c4214c2016a7
+DIST mtd-utils-1.4.6.tar.gz 337429 SHA256 fde4698120fbedfe0bbdcb79a99c31c16686d2dddf5801716a83cbe68c38ef09 SHA512 9547a263fd9cb3e4f2dbb6911cc7395192104f9afca5da671f8679d54fa23488914f6dfa609f8dac96d90964b855167af3d25ecb72373785e49a65bd06637ec9 WHIRLPOOL 3a17ac320fa6fb6414ce40b2d92c93dd2957e8035bb4096157fb86966bd7e9f6ca151b65d6afb6221a4e824e595f0977f63bc038520ae1c55acb00c14ad6680c
+DIST mtd-utils-1.4.8.tar.gz 335568 SHA256 c8d291ec979824996df905f41801507aec2e6d4625bc62bc0a71411849a5d642 SHA512 7cf082e1784c8bc34f9bc82c0c2fd46ef4ee5edf5f472f8a144acd29005bfaeeefb8e71da50cefb167cd3f90cdfc2b2a89275f97167d217e64a63d293fc5567c WHIRLPOOL 45b95cde58645279ed3e58a96a864609486a7d2717f07c158b5d7e1e9e7f6856783f4d6976ac660f6738db78aa37651f93192259fb6585bf3383880d16b6ba25
+DIST mtd-utils-1.5.0.tar.gz 336791 SHA256 37c660830010910c75baf4bb92697b99bdef1a63be31630882f9ebdb9347c420 SHA512 d5be5fdf4e34b553b37486c36c786e1eb8f472660c35a6adfd1305045530a270388aae4da8df34d65138469ccb576d72f2791234a4c00d1fdbacdf680d361c5a WHIRLPOOL 0c66f31baa4e54b0e1430632270425ecba0da9a0e61ff09a90a8c2a668a9194c71ab2e775da29b597aac398d6e6e1069d13524f05d121c8a480184cc7687ec11
+DIST mtd-utils-1.5.1.tar.gz 341326 SHA256 c3c5765c9f8d2a0b505f4114264c70214984dcda60b0887f480bd9ed5a9d8015 SHA512 7b11dabec26db1187ce9a39f5187998bce9a2ae4e3b99c6ce230dee826cb7576f69885f2125c7e833b229ab7feb0ef18d19ce4bf63dad48c0126586b121183ab WHIRLPOOL 3c79c8d441f2cd872e36897fe641e427c4bdacd2d16396e87ecb2ef95732b1ea903a003f15ab224343002ba99c5e87ce05978a2136070c3aa8e9d2168a90915b
diff --git a/sys-fs/mtd-utils/files/mtd-utils-1.4.8-install.patch b/sys-fs/mtd-utils/files/mtd-utils-1.4.8-install.patch
new file mode 100644
index 000000000000..4ef55cff284c
--- /dev/null
+++ b/sys-fs/mtd-utils/files/mtd-utils-1.4.8-install.patch
@@ -0,0 +1,32 @@
+From c7e4747c1589b2d090361cb753f212a7eec5ca7f Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 19 Nov 2011 15:59:21 -0500
+Subject: [PATCH 1/2] Makefile: fix install target with out-of-tree builds
+
+The install target always looks for the compiled binaries in the working
+directory which breaks when doing something like `make CHOST=... install`.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d0bc3d6..4b71b8f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -58,9 +58,9 @@ endif
+ rm -f $(BUILDDIR)/include/version.h
+ $(MAKE) -C $(TESTS) clean
+
+-install:: ${BINS} ${SCRIPTS}
++install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
+ mkdir -p ${DESTDIR}/${SBINDIR}
+- install -m 0755 ${BINS} ${SCRIPTS} ${DESTDIR}/${SBINDIR}/
++ install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
+ mkdir -p ${DESTDIR}/${MANDIR}/man1
+ gzip -9c mkfs.jffs2.1 > ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz
+
+--
+1.7.6.1
+
diff --git a/sys-fs/mtd-utils/metadata.xml b/sys-fs/mtd-utils/metadata.xml
new file mode 100644
index 000000000000..125f41ea9e58
--- /dev/null
+++ b/sys-fs/mtd-utils/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
+
diff --git a/sys-fs/mtd-utils/mtd-utils-1.4.5.ebuild b/sys-fs/mtd-utils/mtd-utils-1.4.5.ebuild
new file mode 100644
index 000000000000..acfd6bcd1b0e
--- /dev/null
+++ b/sys-fs/mtd-utils/mtd-utils-1.4.5.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.infradead.org/mtd-utils.git"
+
+ inherit git
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ if [[ ${PV} == *.*.* ]] ; then
+ MY_PV="${PV}-*"
+ SRC_URI="http://git.infradead.org/mtd-utils.git/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
+ else
+ MY_PV="${PV}-02ae0aac87576d07202a62d11294ea55b56f450b"
+ SRC_URI="mirror://gentoo/${PN}-snapshot-${MY_PV}.tar.xz"
+ fi
+ KEYWORDS="amd64 arm ~mips ppc x86 ~x86-linux"
+fi
+
+DESCRIPTION="MTD userspace tools (NFTL, JFFS2, NAND, FTL, UBI)"
+HOMEPAGE="http://git.infradead.org/?p=mtd-utils.git;a=summary"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="xattr"
+
+# We need libuuid
+RDEPEND="!sys-fs/mtd
+ dev-libs/lzo
+ sys-libs/zlib
+ >=sys-apps/util-linux-2.16"
+# ACL is only required for the <sys/acl.h> header file to build mkfs.jffs2
+# And ACL brings in Attr as well.
+DEPEND="${RDEPEND}
+ xattr? ( sys-apps/acl )"
+
+# Diff snapshots have diff versions encoded into their dirnames
+S=${WORKDIR}/${PN}
+
+makeopts() {
+ echo CROSS=${CHOST}-
+ use xattr || echo WITHOUT_XATTR=1
+}
+
+src_compile() {
+ cd "${S}"*
+ emake $(makeopts) || die
+}
+
+src_install() {
+ cd "${S}"*
+ emake $(makeopts) install DESTDIR="${ED}" || die
+ dodoc *.txt
+ newdoc mkfs.ubifs/README README.mkfs.ubifs
+ # TODO: check ubi-utils for docs+scripts
+}
diff --git a/sys-fs/mtd-utils/mtd-utils-1.4.6.ebuild b/sys-fs/mtd-utils/mtd-utils-1.4.6.ebuild
new file mode 100644
index 000000000000..bc546a1c23c8
--- /dev/null
+++ b/sys-fs/mtd-utils/mtd-utils-1.4.6.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.infradead.org/mtd-utils.git"
+
+ inherit git
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ if [[ ${PV} == *.*.* ]] ; then
+ MY_PV="${PV}-*"
+ SRC_URI="http://git.infradead.org/mtd-utils.git/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
+ else
+ MY_PV="${PV}-02ae0aac87576d07202a62d11294ea55b56f450b"
+ SRC_URI="mirror://gentoo/${PN}-snapshot-${MY_PV}.tar.xz"
+ fi
+ KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86 ~x86-linux"
+fi
+
+DESCRIPTION="MTD userspace tools (NFTL, JFFS2, NAND, FTL, UBI)"
+HOMEPAGE="http://git.infradead.org/?p=mtd-utils.git;a=summary"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="xattr"
+
+# We need libuuid
+RDEPEND="!sys-fs/mtd
+ dev-libs/lzo
+ sys-libs/zlib
+ >=sys-apps/util-linux-2.16"
+# ACL is only required for the <sys/acl.h> header file to build mkfs.jffs2
+# And ACL brings in Attr as well.
+DEPEND="${RDEPEND}
+ xattr? ( sys-apps/acl )"
+
+# Diff snapshots have diff versions encoded into their dirnames
+S=${WORKDIR}/${PN}
+
+makeopts() {
+ echo CROSS=${CHOST}-
+ use xattr || echo WITHOUT_XATTR=1
+}
+
+src_compile() {
+ cd "${S}"*
+ emake $(makeopts) || die
+}
+
+src_install() {
+ cd "${S}"*
+ emake $(makeopts) install DESTDIR="${ED}" || die
+ dodoc *.txt
+ newdoc mkfs.ubifs/README README.mkfs.ubifs
+ # TODO: check ubi-utils for docs+scripts
+}
diff --git a/sys-fs/mtd-utils/mtd-utils-1.4.8.ebuild b/sys-fs/mtd-utils/mtd-utils-1.4.8.ebuild
new file mode 100644
index 000000000000..ba1a57f60508
--- /dev/null
+++ b/sys-fs/mtd-utils/mtd-utils-1.4.8.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.infradead.org/mtd-utils.git"
+
+ inherit git
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ if [[ ${PV} == *.*.* ]] ; then
+ MY_PV="${PV}-*"
+ SRC_URI="http://git.infradead.org/mtd-utils.git/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
+ else
+ MY_PV="${PV}-02ae0aac87576d07202a62d11294ea55b56f450b"
+ SRC_URI="mirror://gentoo/${PN}-snapshot-${MY_PV}.tar.xz"
+ fi
+ KEYWORDS="amd64 arm ~mips ppc x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="MTD userspace tools (NFTL, JFFS2, NAND, FTL, UBI)"
+HOMEPAGE="http://git.infradead.org/?p=mtd-utils.git;a=summary"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="xattr"
+
+# We need libuuid
+RDEPEND="!sys-fs/mtd
+ dev-libs/lzo
+ sys-libs/zlib
+ >=sys-apps/util-linux-2.16"
+# ACL is only required for the <sys/acl.h> header file to build mkfs.jffs2
+# And ACL brings in Attr as well.
+DEPEND="${RDEPEND}
+ xattr? ( sys-apps/acl )"
+
+# Diff snapshots have diff versions encoded into their dirnames
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ cd "${S}"*
+ epatch "${FILESDIR}"/${P}-install.patch
+}
+
+makeopts() {
+ echo CROSS=${CHOST}-
+ use xattr || echo WITHOUT_XATTR=1
+}
+
+src_compile() {
+ cd "${S}"*
+ emake $(makeopts) || die
+}
+
+src_install() {
+ cd "${S}"*
+ emake $(makeopts) install DESTDIR="${ED}" || die
+ dodoc *.txt
+ newdoc mkfs.ubifs/README README.mkfs.ubifs
+ # TODO: check ubi-utils for docs+scripts
+}
diff --git a/sys-fs/mtd-utils/mtd-utils-1.5.0.ebuild b/sys-fs/mtd-utils/mtd-utils-1.5.0.ebuild
new file mode 100644
index 000000000000..4bca6a1b9c2c
--- /dev/null
+++ b/sys-fs/mtd-utils/mtd-utils-1.5.0.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils vcs-snapshot
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.infradead.org/mtd-utils.git"
+
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ if [[ ${PV} == *.*.* ]] ; then
+ MY_PV="${PV}-*"
+ SRC_URI="http://git.infradead.org/mtd-utils.git/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
+ else
+ MY_PV="${PV}-02ae0aac87576d07202a62d11294ea55b56f450b"
+ SRC_URI="mirror://gentoo/${PN}-snapshot-${MY_PV}.tar.xz"
+ fi
+ KEYWORDS="amd64 arm ~mips ppc x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="MTD userspace tools (NFTL, JFFS2, NAND, FTL, UBI)"
+HOMEPAGE="http://git.infradead.org/?p=mtd-utils.git;a=summary"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="xattr"
+
+# We need libuuid
+RDEPEND="!sys-fs/mtd
+ dev-libs/lzo
+ sys-libs/zlib
+ >=sys-apps/util-linux-2.16"
+# ACL is only required for the <sys/acl.h> header file to build mkfs.jffs2
+# And ACL brings in Attr as well.
+DEPEND="${RDEPEND}
+ xattr? ( sys-apps/acl )"
+
+makeopts() {
+ # These affect build output, so keep it common between compile & install.
+ echo CROSS=${CHOST}- V=1
+ use xattr || echo WITHOUT_XATTR=1
+}
+
+src_compile() {
+ tc-export AR CC RANLIB
+ local compileopts=(
+ AR="${AR}" CC="${CC}" RANLIB="${RANLIB}"
+ )
+ emake $(makeopts) "${compileopts[@]}"
+}
+
+src_install() {
+ emake $(makeopts) install DESTDIR="${ED}"
+ dodoc *.txt
+ newdoc mkfs.ubifs/README README.mkfs.ubifs
+ # TODO: check ubi-utils for docs+scripts
+}
diff --git a/sys-fs/mtd-utils/mtd-utils-1.5.1.ebuild b/sys-fs/mtd-utils/mtd-utils-1.5.1.ebuild
new file mode 100644
index 000000000000..26c0a62d42d7
--- /dev/null
+++ b/sys-fs/mtd-utils/mtd-utils-1.5.1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils vcs-snapshot
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.infradead.org/mtd-utils.git"
+
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ if [[ ${PV} == *.*.* ]] ; then
+ MY_PV="${PV}-*"
+ SRC_URI="http://git.infradead.org/mtd-utils.git/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
+ else
+ MY_PV="${PV}-02ae0aac87576d07202a62d11294ea55b56f450b"
+ SRC_URI="mirror://gentoo/${PN}-snapshot-${MY_PV}.tar.xz"
+ fi
+ KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="MTD userspace tools (NFTL, JFFS2, NAND, FTL, UBI)"
+HOMEPAGE="http://git.infradead.org/?p=mtd-utils.git;a=summary"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="xattr"
+
+# We need libuuid
+RDEPEND="!sys-fs/mtd
+ dev-libs/lzo
+ sys-libs/zlib
+ >=sys-apps/util-linux-2.16"
+# ACL is only required for the <sys/acl.h> header file to build mkfs.jffs2
+# And ACL brings in Attr as well.
+DEPEND="${RDEPEND}
+ xattr? ( sys-apps/acl )"
+
+makeopts() {
+ # These affect build output, so keep it common between compile & install.
+ echo CROSS=${CHOST}- V=1
+ use xattr || echo WITHOUT_XATTR=1
+}
+
+src_compile() {
+ tc-export AR CC RANLIB
+ local compileopts=(
+ AR="${AR}" CC="${CC}" RANLIB="${RANLIB}"
+ )
+ emake $(makeopts) "${compileopts[@]}"
+}
+
+src_install() {
+ emake $(makeopts) install DESTDIR="${ED}"
+ dodoc *.txt
+ newdoc mkfs.ubifs/README README.mkfs.ubifs
+ # TODO: check ubi-utils for docs+scripts
+}
diff --git a/sys-fs/mtd-utils/mtd-utils-99999999.ebuild b/sys-fs/mtd-utils/mtd-utils-99999999.ebuild
new file mode 100644
index 000000000000..4380caf19725
--- /dev/null
+++ b/sys-fs/mtd-utils/mtd-utils-99999999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils vcs-snapshot
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.infradead.org/mtd-utils.git"
+
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ if [[ ${PV} == *.*.* ]] ; then
+ MY_PV="${PV}-*"
+ SRC_URI="http://git.infradead.org/mtd-utils.git/snapshot/v${PV}.tar.gz -> ${P}.tar.gz"
+ else
+ MY_PV="${PV}-02ae0aac87576d07202a62d11294ea55b56f450b"
+ SRC_URI="mirror://gentoo/${PN}-snapshot-${MY_PV}.tar.xz"
+ fi
+ KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="MTD userspace tools (NFTL, JFFS2, NAND, FTL, UBI)"
+HOMEPAGE="http://git.infradead.org/?p=mtd-utils.git;a=summary"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="xattr"
+
+# We need libuuid
+RDEPEND="!sys-fs/mtd
+ dev-libs/lzo
+ sys-libs/zlib
+ >=sys-apps/util-linux-2.16"
+# ACL is only required for the <sys/acl.h> header file to build mkfs.jffs2
+# And ACL brings in Attr as well.
+DEPEND="${RDEPEND}
+ xattr? ( sys-apps/acl )"
+
+makeopts() {
+ # These affect build output, so keep it common between compile & install.
+ echo CROSS=${CHOST}- V=1
+ use xattr || echo WITHOUT_XATTR=1
+}
+
+src_compile() {
+ tc-export AR CC RANLIB
+ local compileopts=(
+ AR="${AR}" CC="${CC}" RANLIB="${RANLIB}"
+ )
+ emake $(makeopts) "${compileopts[@]}"
+}
+
+src_install() {
+ emake $(makeopts) install DESTDIR="${ED}"
+ dodoc *.txt
+ newdoc mkfs.ubifs/README README.mkfs.ubifs
+ # TODO: check ubi-utils for docs+scripts
+}
diff --git a/sys-fs/mtools/Manifest b/sys-fs/mtools/Manifest
new file mode 100644
index 000000000000..50aba274280b
--- /dev/null
+++ b/sys-fs/mtools/Manifest
@@ -0,0 +1,5 @@
+DIST mtools-4.0.13.tar.bz2 382262 SHA256 6f5d7bd44f2e259f7359054d936d8d3039fa6c492c7ca4eaa0c6bc8005a347da SHA512 b8bc838f5174adcf876bc527ea922b055c5c0a48e64628645a3d0e88286ebca8db281edc4f91b83edb8793f1aba1a4fc05403d4d2724d995cf07490395c33f91 WHIRLPOOL 93e0dd88201ecbb5885fc0e56efc6f18ff3dcaf4845e9eebc7c60ec830d77ae0076a2d4cb4e94c2e0d3ab2d834c63b86471f921a1a9957f25a3e514adbe2c4b7
+DIST mtools-4.0.15.tar.bz2 386339 SHA256 290defca107cc183a17c98d3f7d00db02228b724084a2a818f1dd6ea86973899 SHA512 0ee4d060ffb95c0e5b0e859634bee50e056aaa7d3917fdbcc4fd8ca86710b1d93ef252bec588d5c010f2fb6081853e76338b966e4584e510728be4ec3113e0da WHIRLPOOL c4ab4cb1f0b1fd4c3540ef81379d3976590f1433135ab75b1ec2de4e0e219ba33fdbb5778289f76d3eea90d27259ae9145a4152942abda8f7057f38ba0e9e65d
+DIST mtools-4.0.16.tar.bz2 408615 SHA256 7c9e337786d142399d37202ff2002f95bfb3f4e96620223a18d7206708ad2ed5 SHA512 bbe1cb9246defacf5364fcf24c92be7877343e0cb6d5545984fa1fedc51e40e396fd5b9848773fa923789a8cf0726e5609f16c78fc9d185b30eb163dc35b845f WHIRLPOOL 62bb8ec6494de09122ff04e6130204e83e5f103235b094d10e49b4055bb08824fe8b762bbe7c32d1eed65cd62d07a61ebfdf5e7a888716e23609038cfb217bcc
+DIST mtools-4.0.17.tar.bz2 412310 SHA256 0ecc358e30a72d215b1d4c625b27e67121cd6f6075370dfb791ef2a8b980ecb6 SHA512 0ad44bc9d7088d8a0edc648ac81fb4c9ea522c8d7561717f02475514186081050c283c0393bf32358b95ea60554713c26ea7e06074041d3fbdcaf642aec2e1ce WHIRLPOOL ce220067850ac91cbe8a2687b82be4afe2cf3f3f1a3444bb3e02c6ac2ffa470dc7825c2e0c5fc72c9010839d956f8a1351b4944194336a38c38ce0ef37387327
+DIST mtools-4.0.18.tar.bz2 420190 SHA256 59e9cf80885399c4f229e5d87e49c0c2bfeec044e1386d59fcd0b0aead6b2f85 SHA512 3981a4727aa4e2ec5c931201b236f52fcd1c9d55f888cb2fbdc5c4172402e2b229ede9a5005b972ffdad59bcb861e2fcc01404845e521116419079ae78239090 WHIRLPOOL 478ae2187e3a44ebad8f9b5fca869d80a7bcb0b55183af59bc361c2efd241e6e69be0194e18c690ff156ba808d9fc52ad2303aeff606d09b4e478f90b51186f9
diff --git a/sys-fs/mtools/files/mtools-3.9.11-flags.patch b/sys-fs/mtools/files/mtools-3.9.11-flags.patch
new file mode 100644
index 000000000000..e0092abf1aac
--- /dev/null
+++ b/sys-fs/mtools/files/mtools-3.9.11-flags.patch
@@ -0,0 +1,37 @@
+remove pointless flags
+
+http://bugs.gentoo.org/232766
+
+--- mtools/configure
++++ mtools/configure
+@@ -5904,9 +5904,6 @@
+ my_host_os=`echo $host_os1 $host_os2 $host_os3 | sort -u`
+ objs=`echo $srcdir/*.c | sed 's/\.c$/.o/' `
+ if [ "X$GCC" = "Xyes" ] ; then
+- if [ "$host_cpu" = i486 ] ; then
+- CFLAGS="$CFLAGS -m486"
+- fi
+ Wall=-Wall
+ if [ "$host_os3" = sunos ] ; then
+ Wall=""
+@@ -5921,9 +5918,6 @@
+ CFLAGS="$CFLAGS -ZP"
+ MACHDEPLIBS="-lposix -UTIL"
+ fi
+- case "${host}" in
+- arm*-*-linux) CFLAGS="$CFLAGS -mstructure-size-boundary=8";;
+- esac
+ CFLAGS="$CFLAGS $Wall"
+ else
+ if [ $host_os3 = hpux ] ; then
+@@ -5940,10 +5934,6 @@
+ fi
+
+
+-if [ $host_vendor = linux ] ; then
+- LDFLAGS="$LDFLAGS -z"
+-fi
+-
+ if [ $host_os3 = xenix ] ; then
+ LDFLAGS="$LDFLAGS -M2e -i -f 5000"
+ fi
diff --git a/sys-fs/mtools/metadata.xml b/sys-fs/mtools/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/mtools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/mtools/mtools-4.0.13.ebuild b/sys-fs/mtools/mtools-4.0.13.ebuild
new file mode 100644
index 000000000000..7dd8db9bb02c
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.13.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="http://mtools.linux.lu/"
+SRC_URI="http://mtools.linux.lu/${P}.tar.bz2
+ mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ppc ppc64 sparc x86"
+IUSE="X"
+
+DEPEND="
+ X? (
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXt
+ )"
+
+src_compile() {
+ econf \
+ --sysconfdir=/etc/mtools \
+ $(use_with X x) \
+ || die
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install || die
+ insinto /etc/mtools
+ doins mtools.conf || die
+ dosed '/^SAMPLE FILE$/s:^:#:' /etc/mtools/mtools.conf # default is fine
+ dodoc README* Release.notes
+}
diff --git a/sys-fs/mtools/mtools-4.0.15.ebuild b/sys-fs/mtools/mtools-4.0.15.ebuild
new file mode 100644
index 000000000000..5b94ba771817
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.15.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit autotools
+
+DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="http://mtools.linux.lu/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ppc ppc64 sparc x86"
+IUSE="X"
+
+DEPEND="
+ X? (
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXt
+ )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ eautoconf #341443
+}
+
+src_configure() {
+ econf \
+ --sysconfdir=/etc/mtools \
+ $(use_with X x)
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install || die
+ insinto /etc/mtools
+ doins mtools.conf || die
+ dosed '/^SAMPLE FILE$/s:^:#:' /etc/mtools/mtools.conf # default is fine
+ dodoc README* Release.notes
+}
diff --git a/sys-fs/mtools/mtools-4.0.16.ebuild b/sys-fs/mtools/mtools-4.0.16.ebuild
new file mode 100644
index 000000000000..52b0aa3160cc
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.16.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit autotools
+
+DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="http://mtools.linux.lu/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="X"
+
+DEPEND="
+ X? (
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXt
+ )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ eautoconf #341443
+}
+
+src_configure() {
+ econf \
+ --sysconfdir=/etc/mtools \
+ $(use_with X x)
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install || die
+ insinto /etc/mtools
+ doins mtools.conf || die
+ dosed '/^SAMPLE FILE$/s:^:#:' /etc/mtools/mtools.conf # default is fine
+ dodoc README* Release.notes
+}
diff --git a/sys-fs/mtools/mtools-4.0.17.ebuild b/sys-fs/mtools/mtools-4.0.17.ebuild
new file mode 100644
index 000000000000..182aca4c9483
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.17.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="http://mtools.linux.lu/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="X"
+
+DEPEND="
+ X? (
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXt
+ )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Don't throw errors on existing directories
+ sed -i -e "s:mkdir:mkdir -p:" mkinstalldirs || die
+}
+
+src_configure() {
+ econf \
+ --sysconfdir=/etc/mtools \
+ $(use_with X x)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README* Release.notes
+
+ insinto /etc/mtools
+ doins mtools.conf
+ # default is fine
+ sed -i -e '/^SAMPLE FILE$/s:^:#:' "${D}"/etc/mtools/mtools.conf || die
+}
diff --git a/sys-fs/mtools/mtools-4.0.18.ebuild b/sys-fs/mtools/mtools-4.0.18.ebuild
new file mode 100644
index 000000000000..9d57c44f7c20
--- /dev/null
+++ b/sys-fs/mtools/mtools-4.0.18.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic
+
+DESCRIPTION="utilities to access MS-DOS disks from Unix without mounting them"
+HOMEPAGE="http://mtools.linux.lu/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x64-macos ~x64-solaris"
+IUSE="X elibc_glibc"
+
+DEPEND="
+ !elibc_glibc? ( virtual/libiconv )
+ X? (
+ x11-libs/libICE
+ x11-libs/libXau
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libXt
+ )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Don't throw errors on existing directories
+ sed -i -e "s:mkdir:mkdir -p:" mkinstalldirs || die
+}
+
+src_configure() {
+ # 447688
+ use elibc_glibc || append-libs iconv
+ econf \
+ --sysconfdir="${EPREFIX}"/etc/mtools \
+ $(use_with X x)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README* Release.notes
+
+ insinto /etc/mtools
+ doins mtools.conf
+ # default is fine
+ sed -i -e '/^SAMPLE FILE$/s:^:#:' "${ED}"/etc/mtools/mtools.conf || die
+}
diff --git a/sys-fs/mtpfs/Manifest b/sys-fs/mtpfs/Manifest
new file mode 100644
index 000000000000..23e56876edc6
--- /dev/null
+++ b/sys-fs/mtpfs/Manifest
@@ -0,0 +1,2 @@
+DIST mtpfs-1.0.tar.gz 104242 SHA256 879ccf929a7ce395af30ae81314850a5cb55a0056107477016121b9392c49c13 SHA512 af3bd067410f51bf76619a5d98a23c2a5755d2f5e2764221af145a463ab1b819332b00e358887488f2e26e29c91dcabceedf5f8637d97a9b2ba06b91281a6a4d WHIRLPOOL 074effa8933a26cf6a98af92c7629833cd0a831baae3fb3c296eda62b22477df9d43404b2452644e83ae0902e427717854ec9c4cd5fa1c9705d83b82471f3476
+DIST mtpfs-1.1.tar.gz 108329 SHA256 1baf357de16995a5f0b5bc1b6833517a77456481d861cdba70f1ce1316ce4c1d SHA512 627f1a5efa024276f58857e0cb2a2b3057ab9ba6c26d8dcba9de066f4c0efc56a5c991e000e67763b874ee9feb1d9a1e176872b56dd13b146823e8724f2052c8 WHIRLPOOL 891b84f52cbb1ab19f25a45ac73253b0fd1c0f3340d5989eca7cc33ac04c964e3a21062969e9995f90bd0b3b82ebe819854c5de2a729a3efe95d06da1d094d7b
diff --git a/sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch b/sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch
new file mode 100644
index 000000000000..b344fc44bc1e
--- /dev/null
+++ b/sys-fs/mtpfs/files/mtpfs-1.1-fix-mutex-crash.patch
@@ -0,0 +1,70 @@
+commit c30d53648a713a3f7f7711f081732aa814c6e74d
+Author: Sergei Trofimovich <siarheit@google.com>
+Date: Sat May 30 23:20:42 2015 +0100
+
+ mtpfs.c: remove all unlocking calls from mtpfs_getattr_real
+
+ Lock is already acquired/freed in the caller function 'mtpfs_getattr'.
+ Noticed when trying to use mtpfs today :)
+
+ Should also fix the same issue https://github.com/cjd/mtpfs/issues/1
+ as I get the same backtrace.
+
+ Signed-off-by: Sergei Trofimovich <siarheit@google.com>
+
+diff --git a/mtpfs.c b/mtpfs.c
+index e5e1b03..553d282 100644
+--- a/mtpfs.c
++++ b/mtpfs.c
+@@ -776,5 +776,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
+ {
+ int ret = 0;
+- if (path==NULL) return_unlock(-ENOENT);
++ if (path==NULL) return -ENOENT;
+ memset (stbuf, 0, sizeof (struct stat));
+
+@@ -787,5 +787,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
+ stbuf->st_mode = S_IFDIR | 0777;
+ stbuf->st_nlink = 2;
+- return_unlock(0);
++ return 0;
+ }
+
+@@ -799,5 +799,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
+ stbuf->st_blocks = 2;
+ stbuf->st_mtime = time(NULL);
+- return_unlock(0);
++ return 0;
+ }
+ }
+@@ -808,5 +808,5 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
+ stbuf->st_mode = S_IFDIR | 0777;
+ stbuf->st_nlink = 2;
+- return_unlock(0);
++ return 0;
+ }
+
+@@ -843,9 +843,9 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
+ stbuf->st_blocks = 2;
+ stbuf->st_mtime = time(NULL);
+- return_unlock(0);
++ return 0;
+ }
+ playlist = playlist->next;
+ }
+- return_unlock(-ENOENT);
++ return -ENOENT;
+ }
+
+@@ -864,9 +864,9 @@ mtpfs_getattr_real (const gchar * path, struct stat *stbuf)
+ stbuf->st_mode = S_IFREG | 0777;
+ stbuf->st_mtime = file->modificationdate;
+- return_unlock(0);
++ return 0;
+ }
+ }
+
+- return_unlock(-ENOENT);
++ return -ENOENT;
+ }
+
diff --git a/sys-fs/mtpfs/files/mtpfs-1.1-unitialized-variable.patch b/sys-fs/mtpfs/files/mtpfs-1.1-unitialized-variable.patch
new file mode 100644
index 000000000000..fb49624515b8
--- /dev/null
+++ b/sys-fs/mtpfs/files/mtpfs-1.1-unitialized-variable.patch
@@ -0,0 +1,12 @@
+https://bugs.gentoo.org/556690
+--- mtpfs.c.old 2015-08-04 21:56:13.080712801 +0200
++++ mtpfs.c 2015-08-04 21:20:54.822965092 +0200
+@@ -1324,7 +1324,7 @@ main (int argc, char *argv[])
+ LIBMTP_raw_device_t * rawdevices;
+ int numrawdevices;
+ LIBMTP_error_number_t err;
+- int i;
++ int i = 0;
+
+ int opt;
+ extern int optind;
diff --git a/sys-fs/mtpfs/metadata.xml b/sys-fs/mtpfs/metadata.xml
new file mode 100644
index 000000000000..086187b8c231
--- /dev/null
+++ b/sys-fs/mtpfs/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+ </maintainer>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+
+ <longdescription>
+ MTPfs is a FUSE filesystem that supports reading and writing from any
+ MTP device, as supported by libmtp. MTPfs includes extra features such
+ as playlist and meta information support for MP3 players.
+ </longdescription>
+ <use>
+ <flag name='mad'>Enable handling of MP3's metadata</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-fs/mtpfs/mtpfs-1.0.ebuild b/sys-fs/mtpfs/mtpfs-1.0.ebuild
new file mode 100644
index 000000000000..9d206f9a332c
--- /dev/null
+++ b/sys-fs/mtpfs/mtpfs-1.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="A FUSE filesystem providing access to MTP devices"
+HOMEPAGE="http://www.adebenham.com/mtpfs/"
+SRC_URI="http://www.adebenham.com/debian/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+DEPEND="dev-libs/glib:2
+ media-libs/libid3tag
+ media-libs/libmad
+ media-libs/libmtp
+ sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+DOCS=(AUTHORS NEWS README)
+
+src_prepare() {
+ sed -e "/#include <string.h>/ a\
+ #include <stdlib.h>" -i mtpfs.h id3read.c || die #implicit
+}
+
+src_configure() {
+ econf $(use_enable debug)
+}
+
+pkg_postinst() {
+ einfo "To mount your MTP device, issue:"
+ einfo " /usr/bin/mtpfs <mountpoint>"
+ echo
+ einfo "To unmount your MTP device, issue:"
+ einfo " /usr/bin/fusermount -u <mountpoint>"
+
+ if use debug; then
+ echo
+ einfo "You have enabled debugging output."
+ einfo "Please make sure you run mtpfs with the -d flag."
+ fi
+}
diff --git a/sys-fs/mtpfs/mtpfs-1.1-r1.ebuild b/sys-fs/mtpfs/mtpfs-1.1-r1.ebuild
new file mode 100644
index 000000000000..ceaa24f3e521
--- /dev/null
+++ b/sys-fs/mtpfs/mtpfs-1.1-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A FUSE filesystem providing access to MTP devices"
+HOMEPAGE="http://www.adebenham.com/mtpfs/"
+SRC_URI="http://www.adebenham.com/files/mtp/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug mad"
+
+RDEPEND="dev-libs/glib:2
+ >=media-libs/libmtp-1.1.2
+ sys-fs/fuse
+ mad? (
+ media-libs/libid3tag
+ media-libs/libmad
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=(AUTHORS NEWS README)
+
+src_prepare() {
+ sed -e "/#include <string.h>/ a\
+ #include <stdlib.h>" -i mtpfs.h id3read.c || die #implicit
+
+ epatch "${FILESDIR}"/${P}-fix-mutex-crash.patch
+}
+
+src_configure() {
+ econf $(use_enable debug) \
+ $(use_enable mad)
+}
+
+pkg_postinst() {
+ einfo "To mount your MTP device, issue:"
+ einfo " /usr/bin/mtpfs <mountpoint>"
+ echo
+ einfo "To unmount your MTP device, issue:"
+ einfo " /usr/bin/fusermount -u <mountpoint>"
+
+ if use debug; then
+ echo
+ einfo "You have enabled debugging output."
+ einfo "Please make sure you run mtpfs with the -d flag."
+ fi
+}
diff --git a/sys-fs/mtpfs/mtpfs-1.1-r2.ebuild b/sys-fs/mtpfs/mtpfs-1.1-r2.ebuild
new file mode 100644
index 000000000000..e15536c203db
--- /dev/null
+++ b/sys-fs/mtpfs/mtpfs-1.1-r2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A FUSE filesystem providing access to MTP devices"
+HOMEPAGE="http://www.adebenham.com/mtpfs/"
+SRC_URI="http://www.adebenham.com/files/mtp/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug mad"
+
+RDEPEND="dev-libs/glib:2
+ >=media-libs/libmtp-1.1.2
+ sys-fs/fuse
+ mad? (
+ media-libs/libid3tag
+ media-libs/libmad
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=(AUTHORS NEWS README)
+
+src_prepare() {
+ sed -e "/#include <string.h>/ a\
+ #include <stdlib.h>" -i mtpfs.h id3read.c || die #implicit
+
+ epatch "${FILESDIR}"/${P}-fix-mutex-crash.patch
+ epatch "${FILESDIR}"/${P}-unitialized-variable.patch
+}
+
+src_configure() {
+ econf $(use_enable debug) \
+ $(use_enable mad)
+}
+
+pkg_postinst() {
+ einfo "To mount your MTP device, issue:"
+ einfo " /usr/bin/mtpfs <mountpoint>"
+ echo
+ einfo "To unmount your MTP device, issue:"
+ einfo " /usr/bin/fusermount -u <mountpoint>"
+
+ if use debug; then
+ echo
+ einfo "You have enabled debugging output."
+ einfo "Please make sure you run mtpfs with the -d flag."
+ fi
+}
diff --git a/sys-fs/mtpfs/mtpfs-1.1.ebuild b/sys-fs/mtpfs/mtpfs-1.1.ebuild
new file mode 100644
index 000000000000..3ed46ff9da61
--- /dev/null
+++ b/sys-fs/mtpfs/mtpfs-1.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="A FUSE filesystem providing access to MTP devices"
+HOMEPAGE="http://www.adebenham.com/mtpfs/"
+SRC_URI="http://www.adebenham.com/files/mtp/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug mad"
+
+RDEPEND="dev-libs/glib:2
+ >=media-libs/libmtp-1.1.2
+ sys-fs/fuse
+ mad? (
+ media-libs/libid3tag
+ media-libs/libmad
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=(AUTHORS NEWS README)
+
+src_prepare() {
+ sed -e "/#include <string.h>/ a\
+ #include <stdlib.h>" -i mtpfs.h id3read.c || die #implicit
+}
+
+src_configure() {
+ econf $(use_enable debug) \
+ $(use_enable mad)
+}
+
+pkg_postinst() {
+ einfo "To mount your MTP device, issue:"
+ einfo " /usr/bin/mtpfs <mountpoint>"
+ echo
+ einfo "To unmount your MTP device, issue:"
+ einfo " /usr/bin/fusermount -u <mountpoint>"
+
+ if use debug; then
+ echo
+ einfo "You have enabled debugging output."
+ einfo "Please make sure you run mtpfs with the -d flag."
+ fi
+}
diff --git a/sys-fs/multipath-tools/Manifest b/sys-fs/multipath-tools/Manifest
new file mode 100644
index 000000000000..23af9e77a811
--- /dev/null
+++ b/sys-fs/multipath-tools/Manifest
@@ -0,0 +1 @@
+DIST multipath-tools-0.5.0.tar.bz2 184024 SHA256 f13cf1eb84e94e83b2019e68f7965526903c13e94246db43965d181668a0a6f9 SHA512 dfad21c45d0f69e39041d30d203a582c8ee8329bf390c51cde10155b3de379e7ad8fead2ac4beb268a924fd7e7dc8e1cf538ea3c70d41479fd8786fa30ba22a9 WHIRLPOOL bc8a365d66d1c5f584de04304125949926d4a1576cba4a00acca0f1333eb13d83318da36d9d88c5dc92691a331d427ad6b99eb1f2983fbc387303dbfdbae11ff
diff --git a/sys-fs/multipath-tools/files/multipath-tools-0.5.0-makefile.patch b/sys-fs/multipath-tools/files/multipath-tools-0.5.0-makefile.patch
new file mode 100644
index 000000000000..691b138731f6
--- /dev/null
+++ b/sys-fs/multipath-tools/files/multipath-tools-0.5.0-makefile.patch
@@ -0,0 +1,200 @@
+--- multipath-tools-0.5.0/kpartx/Makefile
++++ multipath-tools-0.5.0/kpartx/Makefile
+@@ -12,7 +12,7 @@
+ CFLAGS += -DLIBDM_API_COOKIE
+ endif
+
+-LDFLAGS = -ldevmapper
++LIBS = -ldevmapper
+ OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
+ gpt.o mac.o ps3.o crc32.o lopart.o xstrncpy.o devmapper.o
+ EXEC = kpartx
+@@ -20,8 +20,7 @@
+ all: $(EXEC)
+
+ $(EXEC): $(OBJS)
+- $(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
+- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(EXEC)
+
+ install: $(EXEC) $(EXEC).8
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
+@@ -29,14 +28,15 @@
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(libudevdir)
+ $(INSTALL_PROGRAM) -m 755 kpartx_id $(DESTDIR)$(libudevdir)
+ $(INSTALL_PROGRAM) -d $(DESTDIR)/etc/udev/rules.d
+- $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/
++ $(INSTALL_PROGRAM) -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/66-kpartx.rules
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
+- $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
++ $(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
+
+ uninstall:
+ rm -f $(DESTDIR)$(bindir)/$(EXEC)
+- rm -f $(DESTDIR)$(mandir)/$(EXEC).8.gz
++ rm -f $(DESTDIR)$(mandir)/$(EXEC).8
+ rm -f $(DESTDIR)$(libudevdir)/kpartx_id
++ rm -f $(DESTDIR)/etc/udev/rules.d/66-kpartx.rules
+
+ clean:
+- rm -f core *.o $(EXEC) *.gz
++ rm -f core *.o $(EXEC)
+--- multipath-tools-0.5.0/libmpathpersist/Makefile
++++ multipath-tools-0.5.0/libmpathpersist/Makefile
+@@ -22,8 +22,6 @@
+ $(CC) -Wall -fPIC -c $(CFLAGS) *.c
+ $(CC) -shared $(LIBDEPS) -Wl,-soname=$@ $(CFLAGS) -o $@ $(OBJS)
+ ln -s $(LIBS) $(DEVLIB)
+- $(GZIP) mpath_persistent_reserve_in.3 > mpath_persistent_reserve_in.3.gz
+- $(GZIP) mpath_persistent_reserve_out.3 > mpath_persistent_reserve_out.3.gz
+
+ install: $(LIBS)
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir)
+@@ -31,19 +29,17 @@
+ $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(syslibdir)
+ $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(man3dir)
+ $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/include/
+- $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)/usr/share/doc/mpathpersist/
+- ln -sf $(DESTDIR)$(syslibdir)/$(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB)
+- install -m 644 mpath_persistent_reserve_in.3.gz $(DESTDIR)$(man3dir)
+- install -m 644 mpath_persistent_reserve_out.3.gz $(DESTDIR)$(man3dir)
+- install -m 644 mpath_persist.h $(DESTDIR)/usr/include/
++ $(INSTALL_PROGRAM) -m 644 mpath_persistent_reserve_in.3 $(DESTDIR)$(man3dir)
++ $(INSTALL_PROGRAM) -m 644 mpath_persistent_reserve_out.3 $(DESTDIR)$(man3dir)
++ $(INSTALL_PROGRAM) -m 644 mpath_persist.h $(DESTDIR)/usr/include/
+
+ uninstall:
+ rm -f $(DESTDIR)$(syslibdir)/$(LIBS)
+- rm $(DESTDIR)$(mandir)/mpath_persistent_reserve_in.3.gz
+- rm $(DESTDIR)$(mandir)/mpath_persistent_reserve_out.3.gz
++ rm $(DESTDIR)$(mandir)/mpath_persistent_reserve_in.3
++ rm $(DESTDIR)$(mandir)/mpath_persistent_reserve_out.3
+
+ clean:
+ rm -f core *.a *.o
+ rm -f libmpathpersist.so.0
+ rm -f libmpathpersist.so
+- rm -f mpath_persistent_reserve_in.3.gz mpath_persistent_reserve_out.3.gz
++ rm -f mpath_persistent_reserve_in.3 mpath_persistent_reserve_out.3
+--- multipath-tools-0.5.0/Makefile.inc
++++ multipath-tools-0.5.0/Makefile.inc
+@@ -48,8 +48,8 @@
+ RPM_OPT_FLAGS = -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
+ endif
+
+-OPTFLAGS = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
+-CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
++OPTFLAGS = -Wall -Wunused -Wstrict-prototypes
++CFLAGS += $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
+ SHARED_FLAGS = -shared
+
+ %.o: %.c
+--- multipath-tools-0.5.0/mpathpersist/Makefile
++++ multipath-tools-0.5.0/mpathpersist/Makefile
+@@ -13,18 +13,17 @@
+
+ $(EXEC): $(OBJS)
+ $(CC) -g $(OBJS) -o $(EXEC) $(LDFLAGS) $(CFLAGS)
+- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
+
+ install:
+ install -d $(DESTDIR)$(bindir)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ install -d $(DESTDIR)$(mandir)
+- install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
++ install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
+
+ clean:
+ rm -f *.o $(EXEC)
+- rm -f mpathpersist.8.gz
++ rm -f mpathpersist.8
+
+ uninstall:
+ rm $(DESTDIR)$(bindir)/$(EXEC)
+- rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
++ rm $(DESTDIR)$(mandir)/$(EXEC).8
+--- multipath-tools-0.5.0/multipath/Makefile
++++ multipath-tools-0.5.0/multipath/Makefile
+@@ -7,29 +7,27 @@
+ OBJS = main.o
+
+ CFLAGS += -I$(multipathdir)
+-LDFLAGS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath -ludev
++LIBS += -lpthread -ldevmapper -ldl -L$(multipathdir) -lmultipath -ludev
+
+ EXEC = multipath
+
+ all: $(EXEC)
+
+ $(EXEC): $(OBJS)
+- $(CC) $(CFLAGS) $(OBJS) -o $(EXEC) $(LDFLAGS)
+- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
+- $(GZIP) $(EXEC).conf.5 > $(EXEC).conf.5.gz
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(EXEC)
+
+ install:
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
+ $(INSTALL_PROGRAM) -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
+- $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
++ $(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(man5dir)
+- $(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5.gz $(DESTDIR)$(man5dir)
++ $(INSTALL_PROGRAM) -m 644 $(EXEC).conf.5 $(DESTDIR)$(man5dir)
+
+ uninstall:
+ rm $(DESTDIR)$(bindir)/$(EXEC)
+- rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
+- rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz
++ rm $(DESTDIR)$(mandir)/$(EXEC).8
++ rm $(DESTDIR)$(man5dir)/$(EXEC).conf.5
+
+ clean:
+- rm -f core *.o $(EXEC) *.gz
++ rm -f core *.o $(EXEC)
+--- multipath-tools-0.5.0/multipathd/Makefile
++++ multipath-tools-0.5.0/multipathd/Makefile
+@@ -9,11 +9,11 @@
+ ifdef SYSTEMD
+ CFLAGS += -DUSE_SYSTEMD=$(SYSTEMD)
+ endif
+-LDFLAGS += -lpthread -ldevmapper -lreadline
++LIBS += -lpthread -ldevmapper -lreadline
+ ifdef SYSTEMD
+- LDFLAGS += -lsystemd-daemon
++ LIBS += -lsystemd-daemon
+ endif
+-LDFLAGS += -ludev -ldl \
++LIBS += -ludev -ldl \
+ -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist
+
+ #
+@@ -35,8 +35,7 @@
+ all : $(EXEC)
+
+ $(EXEC): $(OBJS)
+- $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC)
+- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(EXEC)
+
+ install:
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(bindir)
+@@ -48,15 +47,15 @@
+ $(INSTALL_PROGRAM) -m 644 $(EXEC).socket $(DESTDIR)$(unitdir)
+ endif
+ $(INSTALL_PROGRAM) -d $(DESTDIR)$(mandir)
+- $(INSTALL_PROGRAM) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
++ $(INSTALL_PROGRAM) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
+
+ uninstall:
+ rm -f $(DESTDIR)$(bindir)/$(EXEC)
+ rm -f $(DESTDIR)$(rcdir)/$(EXEC)
+- rm -f $(DESTDIR)$(mandir)/$(EXEC).8.gz
++ rm -f $(DESTDIR)$(mandir)/$(EXEC).8
+ rm -f $(DESTDIR)$(unitdir)/$(EXEC).service
+ rm -f $(DESTDIR)$(unitdir)/$(EXEC).socket
+
+ clean:
+- rm -f core *.o $(EXEC) *.gz
++ rm -f core *.o $(EXEC)
+
diff --git a/sys-fs/multipath-tools/files/multipath-tools-0.5.0-systemd-pkgconfig.patch b/sys-fs/multipath-tools/files/multipath-tools-0.5.0-systemd-pkgconfig.patch
new file mode 100644
index 000000000000..d75f841361a6
--- /dev/null
+++ b/sys-fs/multipath-tools/files/multipath-tools-0.5.0-systemd-pkgconfig.patch
@@ -0,0 +1,24 @@
+diff -ru multipath-tools-0.5.0/libmultipath/Makefile multipath-tools-0.5.0-modified/libmultipath/Makefile
+--- multipath-tools-0.5.0/libmultipath/Makefile 2013-12-17 22:40:41.000000000 +0100
++++ multipath-tools-0.5.0-modified/libmultipath/Makefile 2014-03-07 04:03:45.963309627 +0100
+@@ -9,7 +9,7 @@
+ LIBS = $(DEVLIB).$(SONAME)
+ LIBDEPS = -lpthread -ldl -ldevmapper -ludev
+ ifdef SYSTEMD
+- LIBDEPS += -lsystemd-daemon
++ LIBDEPS += $(shell pkg-config --libs libsystemd 2>/dev/null || pkg-config --libs libsystemd-daemon 2>/dev/null)
+ endif
+
+ OBJS = memory.o parser.o vector.o devmapper.o callout.o \
+diff -ru multipath-tools-0.5.0/multipathd/Makefile multipath-tools-0.5.0-modified/multipathd/Makefile
+--- multipath-tools-0.5.0/multipathd/Makefile 2014-03-07 04:05:09.340307633 +0100
++++ multipath-tools-0.5.0-modified/multipathd/Makefile 2014-03-07 04:04:03.555309206 +0100
+@@ -11,7 +11,7 @@
+ endif
+ LIBS += -lpthread -ldevmapper -lreadline
+ ifdef SYSTEMD
+- LIBS += -lsystemd-daemon
++ LIBS += $(shell pkg-config --libs libsystemd 2>/dev/null || pkg-config --libs libsystemd-daemon 2>/dev/null)
+ endif
+ LIBS += -ludev -ldl \
+ -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist
diff --git a/sys-fs/multipath-tools/files/multipath.rc b/sys-fs/multipath-tools/files/multipath.rc
new file mode 100755
index 000000000000..cf43e5b30710
--- /dev/null
+++ b/sys-fs/multipath-tools/files/multipath.rc
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before checkfs fsck multipathd lvm
+ after modules device-mapper
+}
+
+start() {
+ if ! grep -qs device-mapper /proc/devices /proc/misc ; then
+ [ -e /proc/modules ] && modprobe -q dm-mod
+ fi
+
+ ebegin "Activating Multipath devices"
+ multipath -v0 >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down Multipath devices"
+ multipath -v0 -F >/dev/null
+ eend $?
+}
+
+# vim:ts=4
diff --git a/sys-fs/multipath-tools/files/rc-multipathd b/sys-fs/multipath-tools/files/rc-multipathd
new file mode 100644
index 000000000000..646a911d0de8
--- /dev/null
+++ b/sys-fs/multipath-tools/files/rc-multipathd
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ after modules
+}
+
+start() {
+ ebegin "Starting multipathd"
+ start-stop-daemon --start --quiet --exec /sbin/multipathd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping multipathd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/multipathd.pid
+ eend $?
+}
diff --git a/sys-fs/multipath-tools/metadata.xml b/sys-fs/multipath-tools/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/multipath-tools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/multipath-tools/multipath-tools-0.5.0-r1.ebuild b/sys-fs/multipath-tools/multipath-tools-0.5.0-r1.ebuild
new file mode 100644
index 000000000000..33644346fda8
--- /dev/null
+++ b/sys-fs/multipath-tools/multipath-tools-0.5.0-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils systemd toolchain-funcs udev
+
+DESCRIPTION="Device mapper target autoconfig"
+HOMEPAGE="http://christophe.varoqui.free.fr/"
+SRC_URI="http://christophe.varoqui.free.fr/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~ia64 ppc ppc64 ~sparc x86"
+IUSE="systemd"
+
+RDEPEND=">=sys-fs/lvm2-2.02.45
+ >=virtual/udev-171
+ dev-libs/libaio
+ sys-libs/readline
+ systemd? ( sys-apps/systemd )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-makefile.patch
+ epatch "${FILESDIR}"/${P}-systemd-pkgconfig.patch
+ epatch_user
+}
+
+src_compile() {
+ # LIBDM_API_FLUSH involves grepping files in /usr/include,
+ # so force the test to go the way we want #411337.
+ emake LIBDM_API_FLUSH=1 CC="$(tc-getCC)" SYSTEMD=$(usex systemd 1 "")
+}
+
+src_install() {
+ local udevdir="$(get_udevdir)"
+
+ dodir /sbin /usr/share/man/man8
+ emake \
+ DESTDIR="${D}" \
+ SYSTEMD=$(usex systemd 1 "") \
+ unitdir="$(systemd_get_unitdir)" \
+ libudevdir='${prefix}'/"${udevdir}" \
+ install
+
+ insinto /etc
+ newins "${S}"/multipath.conf.annotated multipath.conf
+ # /etc/udev is reserved for user modified rules!
+ mv "${D}"/etc/udev/rules.d "${D}/${udevdir}"/ || die
+ fperms 644 "${udevdir}"/rules.d/66-kpartx.rules
+ newinitd "${FILESDIR}"/rc-multipathd multipathd
+ newinitd "${FILESDIR}"/multipath.rc multipath
+
+ dodoc multipath.conf.* AUTHOR ChangeLog FAQ
+ docinto kpartx
+ dodoc kpartx/ChangeLog kpartx/README
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "If you need multipath on your system, you must"
+ elog "add 'multipath' into your boot runlevel!"
+ fi
+}
diff --git a/sys-fs/ncdu/Manifest b/sys-fs/ncdu/Manifest
new file mode 100644
index 000000000000..d43b80fb88e2
--- /dev/null
+++ b/sys-fs/ncdu/Manifest
@@ -0,0 +1 @@
+DIST ncdu-1.11.tar.gz 134093 SHA256 d0aea772e47463c281007f279a9041252155a2b2349b18adb9055075e141bb7b SHA512 4b9319900dd11da7c3bd2ba9a478c52b8280e3560b8b5b6610fc145c5d81d726715db69cd21bd400d75339a5bcf140bcafb3b4430075427a51b65763e81d8c48 WHIRLPOOL a0ff88adde70ce7f95f9bf172dc0fd5001d5e909bc0db86258d9d2a5f4dba45e511247c71b784b74b73da3b16f695e2eba4d3e89ce445b241801067dac248608
diff --git a/sys-fs/ncdu/files/ncdu-1.11-missing-header.patch b/sys-fs/ncdu/files/ncdu-1.11-missing-header.patch
new file mode 100644
index 000000000000..4c79139f7b06
--- /dev/null
+++ b/sys-fs/ncdu/files/ncdu-1.11-missing-header.patch
@@ -0,0 +1,22 @@
+From 29f347c19cb7ad17c4b401e1d984fce8eafaaafa Mon Sep 17 00:00:00 2001
+From: Yorhel <git@yorhel.nl>
+Date: Tue, 7 Apr 2015 10:39:46 +0200
+Subject: shell.c: Include sys/wait.h
+
+Required for the W* macros on OpenBSD. Reported by Brian Callahan.
+
+diff --git a/src/shell.c b/src/shell.c
+index d601b5a..eb275cd 100644
+--- a/src/shell.c
++++ b/src/shell.c
+@@ -32,6 +32,7 @@
+ #include <ncurses.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <sys/wait.h>
+
+ void shell_draw() {
+ char *full_path;
+--
+cgit v0.10.1
+
diff --git a/sys-fs/ncdu/files/ncdu-1.9-pkgconfig.patch b/sys-fs/ncdu/files/ncdu-1.9-pkgconfig.patch
new file mode 100644
index 000000000000..0d180b34239f
--- /dev/null
+++ b/sys-fs/ncdu/files/ncdu-1.9-pkgconfig.patch
@@ -0,0 +1,39 @@
+ configure.in | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index f4a4a2d..1333234 100644
+--- a/configure.in
++++ b/configure.in
+@@ -36,19 +36,22 @@ AC_ARG_WITH([ncursesw],
+ AC_HELP_STRING([--with-ncursesw], [compile/link with wide-char ncurses library @<:@default@:>@]),
+ [ncurses=ncursesw])
+ if test "$ncurses" = "auto" -o "$ncurses" = "ncursesw"; then
+- AC_CHECK_LIB([ncursesw],
+- [initscr],
+- [LIBS="$LIBS -lncursesw"; ncurses=ncursesw],
+- [ncurses=ncurses])
++ PKG_CHECK_MODULES([NCURSES], [ncursesw], [LIBS="$LIBS $NCURSES_LIBS"; ncurses=ncursesw],
++ [AC_CHECK_LIB([ncursesw],
++ [initscr],
++ [LIBS="$LIBS -lncursesw"; ncurses=ncursesw],
++ [ncurses=ncurses])
++ ])
+ fi
+ if test "$ncurses" = "ncurses"; then
+- AC_CHECK_LIB([ncurses],
+- [initscr],
+- [LIBS="$LIBS -lncurses"],
+- [AC_MSG_ERROR(ncurses library is required)])
++ PKG_CHECK_MODULES([NCURSES], [ncurses], [LIBS="$LIBS $NCURSES_LIBS"],
++ [AC_CHECK_LIB([ncurses],
++ [initscr],
++ [LIBS="$LIBS -lncurses"],
++ [AC_MSG_ERROR(ncurses library is required)])
++ ])
+ fi
+
+
+
+ AC_OUTPUT([Makefile])
+-
diff --git a/sys-fs/ncdu/metadata.xml b/sys-fs/ncdu/metadata.xml
new file mode 100644
index 000000000000..02c723c3ef9b
--- /dev/null
+++ b/sys-fs/ncdu/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>wschlich@gentoo.org</email>
+ <name>Wolfram Schlich</name>
+ <description>Primary maintainer</description>
+ </maintainer>
+ <longdescription>
+As the name already suggests, ncdu is an NCurses version of the famous old 'du'
+unix command. It provides a fast and easy interface to your harddrive. Where is
+your disk space going? Why is your home directory that large? ncdu can answer
+those questions for you in just a matter of seconds!
+</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/ncdu/ncdu-1.11.ebuild b/sys-fs/ncdu/ncdu-1.11.ebuild
new file mode 100644
index 000000000000..06611e681716
--- /dev/null
+++ b/sys-fs/ncdu/ncdu-1.11.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="NCurses Disk Usage"
+HOMEPAGE="http://dev.yorhel.nl/ncdu/"
+SRC_URI="http://dev.yorhel.nl/download/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc ppc64 x86 ~amd64-linux ~x86-linux ~x64-macos"
+
+RDEPEND="sys-libs/ncurses[unicode]"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-missing-header.patch
+}
diff --git a/sys-fs/nilfs-utils/Manifest b/sys-fs/nilfs-utils/Manifest
new file mode 100644
index 000000000000..960eb63aaf05
--- /dev/null
+++ b/sys-fs/nilfs-utils/Manifest
@@ -0,0 +1,3 @@
+DIST nilfs-utils-2.1.5.tar.bz2 389552 SHA256 ba9b2983f160a4af821a9552db8449a169fc6522c993fa895ab949db477d1331 SHA512 a9c0cf6d9df524b9cdb3379bcb8e0c1427aa6e1a792cc649f366a68416374cfc7c9f0db3dd78f3c3165be05a9e8eefb0db30c394ad04c8e3e89ee6ebcbfa42c0 WHIRLPOOL 58c1226bcb2542291fe6fb96fedc644e758d471f5f62c786f99fa5cd7eb113c0e6a6646e70db56efdf765e5acef1f871b9fc14e9662f8a79133cec9845a7cd22
+DIST nilfs-utils-2.1.6.tar.bz2 391303 SHA256 de0631531dfda9c1167c0d07c56c94de9b1f1cade8ecb2ad898cd15cf92dafe9 SHA512 ce0cbaccd6cbf4f7f45cbf0d94cb253c77dafbedac4b71229002ed6c772ad6bb8af598c1e933614f9837901f85b217462ed0dbd5a577b4fbb50528a732a60f83 WHIRLPOOL e7f085d4e72b816fcb78a1dd878792f3b61e0be3ca9a3785405199dec76c4836a88a26dcea6186efd9c277873068bcb1865d863249d50b713efe30214b4ee498
+DIST nilfs-utils-2.2.2.tar.bz2 424097 SHA256 14376ff6ca4e286030aa65cf09e224e02ae8aacd1352711e1cc083243c2f51f0 SHA512 2ac0f1f25472d8900732db9f31e6b824e7e591bf306aa18d8b55c5d93807f4f7ceb65ba7e49540a39c7f285ad63c5f4ab795d34b2a04398d91cd2beb5fc6edce WHIRLPOOL 313b23f2372d7dc95cad3a170bf448a76436a0171337bb9eec551c266c758c2e3f73bb375193dcb8cd7c1ce1578f9811338826c1a1e3462a782f7c92a69adc0c
diff --git a/sys-fs/nilfs-utils/files/nilfs-utils-2.0.14-gentoo.patch b/sys-fs/nilfs-utils/files/nilfs-utils-2.0.14-gentoo.patch
new file mode 100644
index 000000000000..367a163139d2
--- /dev/null
+++ b/sys-fs/nilfs-utils/files/nilfs-utils-2.0.14-gentoo.patch
@@ -0,0 +1,10 @@
+diff -Naur nilfs-utils-2.0.14.orig/lib/Makefile.am nilfs-utils-2.0.14/lib/Makefile.am
+--- nilfs-utils-2.0.14.orig/lib/Makefile.am 2009-07-19 23:53:00.000000000 +0900
++++ nilfs-utils-2.0.14/lib/Makefile.am 2009-07-20 09:44:32.000000000 +0900
+@@ -23,6 +23,3 @@
+ libnilfs_la_CPPFLAGS = -I$(top_srcdir)/include
+ libnilfs_la_LDFLAGS = -version-info $(VERSIONINFO)
+ libnilfs_la_LIBADD = libnilfsmisc.la
+-
+-install-exec-hook:
+- $(LDCONFIG) $(DESTDIR)$(libdir)
diff --git a/sys-fs/nilfs-utils/metadata.xml b/sys-fs/nilfs-utils/metadata.xml
new file mode 100644
index 000000000000..eeae63038e7c
--- /dev/null
+++ b/sys-fs/nilfs-utils/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>naota@gentoo.org</email>
+</maintainer>
+<longdescription lang="en">
+NILFS is a new implementation of a log-structured file system for the
+Linux 2.6 operating system. Conventional features of a log-structured
+file systems (LFS) are high write performance and fast recovery time.
+In addition, LFS prevents data write operations from overwriting the
+disk blocks, thereby minimizing the damage to file data and system
+consistency on hardware failure. Furthermore, LFS writes data and
+meta-data in the correct order which helps ensuring consistency in the
+entire file system. LFS can instantaneously create file system
+snapshots and check the file system speedy. We implemented ``NILFS''
+using modern technology: For example, the file and inode blocks are
+managed by a B-tree structure, internal data are processed in 64 bit
+wide word size. The B-tree structure enables ``NILFS'' to create and
+store huge files.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/nilfs-utils/nilfs-utils-2.1.5-r1.ebuild b/sys-fs/nilfs-utils/nilfs-utils-2.1.5-r1.ebuild
new file mode 100644
index 000000000000..b1fc0e15bcb7
--- /dev/null
+++ b/sys-fs/nilfs-utils/nilfs-utils-2.1.5-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib linux-info
+
+DESCRIPTION="A New Implementation of a Log-structured File System for Linux"
+HOMEPAGE="http://nilfs.sourceforge.net/"
+SRC_URI="http://nilfs.sourceforge.net/download/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ppc ppc64 x86"
+IUSE="static-libs"
+
+RDEPEND="sys-libs/e2fsprogs-libs
+ sys-apps/util-linux"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+
+CONFIG_CHECK="~POSIX_MQUEUE"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ --libdir=/$(get_libdir) \
+ --enable-libmount
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/*.la || die
+}
diff --git a/sys-fs/nilfs-utils/nilfs-utils-2.1.6.ebuild b/sys-fs/nilfs-utils/nilfs-utils-2.1.6.ebuild
new file mode 100644
index 000000000000..b2d32edf9619
--- /dev/null
+++ b/sys-fs/nilfs-utils/nilfs-utils-2.1.6.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib linux-info
+
+DESCRIPTION="A New Implementation of a Log-structured File System for Linux"
+HOMEPAGE="http://nilfs.sourceforge.net/"
+SRC_URI="http://nilfs.sourceforge.net/download/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE="static-libs"
+
+RDEPEND="sys-libs/e2fsprogs-libs
+ sys-apps/util-linux"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+
+CONFIG_CHECK="~POSIX_MQUEUE"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ --libdir=/$(get_libdir) \
+ --enable-libmount
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/*.la || die
+}
diff --git a/sys-fs/nilfs-utils/nilfs-utils-2.2.2.ebuild b/sys-fs/nilfs-utils/nilfs-utils-2.2.2.ebuild
new file mode 100644
index 000000000000..b2d32edf9619
--- /dev/null
+++ b/sys-fs/nilfs-utils/nilfs-utils-2.2.2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib linux-info
+
+DESCRIPTION="A New Implementation of a Log-structured File System for Linux"
+HOMEPAGE="http://nilfs.sourceforge.net/"
+SRC_URI="http://nilfs.sourceforge.net/download/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE="static-libs"
+
+RDEPEND="sys-libs/e2fsprogs-libs
+ sys-apps/util-linux"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers"
+
+CONFIG_CHECK="~POSIX_MQUEUE"
+
+DOCS=( AUTHORS ChangeLog NEWS README )
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ --libdir=/$(get_libdir) \
+ --enable-libmount
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/$(get_libdir)/*.la || die
+}
diff --git a/sys-fs/ntfs3g/Manifest b/sys-fs/ntfs3g/Manifest
new file mode 100644
index 000000000000..6a72c80a7f9e
--- /dev/null
+++ b/sys-fs/ntfs3g/Manifest
@@ -0,0 +1,3 @@
+DIST ntfs-3g_ntfsprogs-2013.1.13.tgz 1176304 SHA256 4b383f0074a3ab7683339d1f18222b107aaeb4983db119292c43c2b275cefb27 SHA512 34cc930320a9a54df406d0fdd71154503bac1181b5642382fcb38fa8c51235fa252c74a5c1ab06019972a236bbd717b47d2acbc7581a747657e4f7a8f216d8bc WHIRLPOOL 7a1c8ec1d93741f564053a9eb8f1c0e5511b23079ab2db6f0dd328d2d49572db22903fc9f15aa1bd6d9faad510c908a59fe22eaaa465d3519318579a75d1e89a
+DIST ntfs-3g_ntfsprogs-2014.2.15.tgz 1143575 SHA256 4c3099400cb14b231a3c9d718b3a8d152d38555059341ce5fc6d02292a4a5b56 SHA512 7e4a5c9ac9d43dcf0d4b4085dea6703126fc4808cb9e1b7038884b20df2a8ab8f54c269d7204a279b62c5ba1127a966fd64226a8ed8f0c11667d9326c2f8fa7c WHIRLPOOL 33931d50ba548cf309849b07e22068106b19caebe9f66f8a8d59e19c75fdbf282c9683656042452ba54ad160b3ebc7d098e90b7ad991316e3e5ff0c27f1c6e83
+DIST ntfs-3g_ntfsprogs-2015.3.14.tgz 1210069 SHA256 97f996015d8316d4a272bd2629978e5e97072dd3cc148ce39802f8037c6538f2 SHA512 9744dee814e89a97050bc8beb76f1a7d8a585e7d7740e8041e393c6912c93e49803f9b41af84e8315b3162e58b19ca8d155d435395cb07ecaa7de9caaf2af441 WHIRLPOOL 6963d56200c686b2717ae05afda85665a2746ce75d75bb486672055d7cfdebb8ac983f1b99b3ff65068be3a26493c16d3f7fe509602b966b3b1fa23d4d3c9472
diff --git a/sys-fs/ntfs3g/files/99-ntfs3g.rules b/sys-fs/ntfs3g/files/99-ntfs3g.rules
new file mode 100644
index 000000000000..52dca4064766
--- /dev/null
+++ b/sys-fs/ntfs3g/files/99-ntfs3g.rules
@@ -0,0 +1 @@
+ENV{ID_FS_TYPE}=="ntfs", ENV{ID_FS_TYPE}="ntfs-3g"
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-dont-put-things-in-root.patch b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-dont-put-things-in-root.patch
new file mode 100644
index 000000000000..2444793480b5
--- /dev/null
+++ b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-dont-put-things-in-root.patch
@@ -0,0 +1,39 @@
+diff -ur ntfs-3g_ntfsprogs-2014.2.15.orig/ntfsprogs/Makefile.am ntfs-3g_ntfsprogs-2014.2.15/ntfsprogs/Makefile.am
+--- ntfs-3g_ntfsprogs-2014.2.15.orig/ntfsprogs/Makefile.am 2015-01-29 00:12:51.786936314 -0800
++++ ntfs-3g_ntfsprogs-2014.2.15/ntfsprogs/Makefile.am 2015-01-29 00:13:59.156442369 -0800
+@@ -140,8 +140,8 @@
+ # mkfs.ntfs[.8] hard link
+
+ install-exec-hook:
+- $(INSTALL) -d $(DESTDIR)/sbin
+- $(LN_S) -f $(sbindir)/mkntfs $(DESTDIR)/sbin/mkfs.ntfs
++ $(INSTALL) -d $(DESTDIR)/$(sbindir)
++ $(LN_S) -f mkntfs $(DESTDIR)/$(sbindir)/mkfs.ntfs
+
+ install-data-hook:
+ $(INSTALL) -d $(DESTDIR)$(man8dir)
+diff -ur ntfs-3g_ntfsprogs-2014.2.15.orig/src/Makefile.am ntfs-3g_ntfsprogs-2014.2.15/src/Makefile.am
+--- ntfs-3g_ntfsprogs-2014.2.15.orig/src/Makefile.am 2015-01-29 00:12:51.789936248 -0800
++++ ntfs-3g_ntfsprogs-2014.2.15/src/Makefile.am 2015-01-29 00:14:00.570411008 -0800
+@@ -68,9 +68,9 @@
+
+ if ENABLE_MOUNT_HELPER
+ install-exec-local: install-rootbinPROGRAMS
+- $(MKDIR_P) "$(DESTDIR)/sbin"
+- $(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/sbin/mount.ntfs-3g"
+- $(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
++ $(MKDIR_P) "$(DESTDIR)/$(sbindir)"
++ $(LN_S) -f "../bin/ntfs-3g" "$(DESTDIR)/$(sbindir)/mount.ntfs-3g"
++ $(LN_S) -f "../bin/lowntfs-3g" "$(DESTDIR)/$(sbindir)/mount.lowntfs-3g"
+ endif
+
+ install-data-local: install-man8
+@@ -80,7 +79,7 @@
+ uninstall-local:
+ $(RM) -f "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
+ if ENABLE_MOUNT_HELPER
+- $(RM) -f "$(DESTDIR)/sbin/mount.ntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
++ $(RM) -f "$(DESTDIR)/$(sbindir)/mount.ntfs-3g" "$(DESTDIR)/$(sbindir)/mount.lowntfs-3g"
+ endif
+
+ endif # ENABLE_NTFS_3G
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-fix-fstrim-applied-to-partitons.patch b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-fix-fstrim-applied-to-partitons.patch
new file mode 100644
index 000000000000..b67cb712ad51
--- /dev/null
+++ b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-fix-fstrim-applied-to-partitons.patch
@@ -0,0 +1,217 @@
+From c26a519da1ed182e7cfd67e7a353932dda53d811 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= <jpandre@users.sourceforge.net>
+Date: Mon, 4 Aug 2014 17:39:50 +0200
+Subject: [PATCH] Fixed fstrim(8) applied to partitions
+
+The new way goes via /sys/dev/block/MAJOR:MINOR to map partitions to
+devices and get discard parameters of the parent device. It also ensures
+that the partition is aligned to the discard block size.
+
+Contributed by Richard W.M. Jones
+---
+ libntfs-3g/ioctl.c | 140 ++++++++++++++++++++++++++---------------------------
+ 1 file changed, 68 insertions(+), 72 deletions(-)
+
+diff --git a/libntfs-3g/ioctl.c b/libntfs-3g/ioctl.c
+index bbbceb9..eb7c8e7 100644
+--- a/libntfs-3g/ioctl.c
++++ b/libntfs-3g/ioctl.c
+@@ -66,8 +66,6 @@
+ #include <linux/fs.h>
+ #endif
+
+-#include <dirent.h>
+-
+ #include "compat.h"
+ #include "debug.h"
+ #include "bitmap.h"
+@@ -135,17 +133,14 @@ static int read_u64(const char *path, u64 *n)
+ }
+
+ /* Find discard limits for current backing device.
+- * XXX Kernel makes this a pain in the neck.
+ */
+-static int fstrim_limits(ntfs_volume *vol, u64 *discard_granularity,
++static int fstrim_limits(ntfs_volume *vol,
++ u64 *discard_alignment,
++ u64 *discard_granularity,
+ u64 *discard_max_bytes)
+ {
+ struct stat statbuf;
+- DIR *dir;
+- struct dirent *d;
+- char path[80];
+- char line[64];
+- char dev[64];
++ char path1[80], path2[80];
+ int ret;
+
+ /* Stat the backing device. Caller has ensured it is a block device. */
+@@ -155,82 +150,78 @@ static int fstrim_limits(ntfs_volume *vol, u64 *discard_granularity,
+ return -errno;
+ }
+
+- /* Now look for a /sys/block/<dev>/dev file which contains
+- * "major:minor\n".
++ /* For whole devices,
++ * /sys/dev/block/MAJOR:MINOR/discard_alignment
++ * /sys/dev/block/MAJOR:MINOR/queue/discard_granularity
++ * /sys/dev/block/MAJOR:MINOR/queue/discard_max_bytes
++ * will exist.
++ * For partitions, we also need to check the parent device:
++ * /sys/dev/block/MAJOR:MINOR/../queue/discard_granularity
++ * /sys/dev/block/MAJOR:MINOR/../queue/discard_max_bytes
+ */
+- snprintf(dev, sizeof dev, "%d:%d\n",
++ snprintf(path1, sizeof path1, "/sys/dev/block/%d:%d",
+ major(statbuf.st_rdev), minor(statbuf.st_rdev));
+
+- dir = opendir("/sys/block");
+- if (dir == NULL) {
+- ntfs_log_debug("fstrim_limits: could not open /sys/block\n");
+- return -errno;
++ snprintf(path2, sizeof path2, "%s/discard_alignment", path1);
++ ret = read_u64(path2, discard_alignment);
++ if (ret) {
++ if (ret != -ENOENT)
++ return ret;
++ else
++ /* We would expect this file to exist on all
++ * modern kernels. But for the sake of very
++ * old kernels:
++ */
++ goto not_found;
+ }
+- for (;;) {
+- errno = 0;
+- d = readdir(dir);
+- if (!d) break;
+
+- snprintf(path, sizeof path, "/sys/block/%s/dev", d->d_name);
+- ret = read_line(path, line, sizeof line);
+- if (ret)
+- continue;
+- if (strcmp(line, dev) == 0)
+- goto found;
++ snprintf(path2, sizeof path2, "%s/queue/discard_granularity", path1);
++ ret = read_u64(path2, discard_granularity);
++ if (ret) {
++ if (ret != -ENOENT)
++ return ret;
++ else {
++ snprintf(path2, sizeof path2,
++ "%s/../queue/discard_granularity", path1);
++ ret = read_u64(path2, discard_granularity);
++ if (ret) {
++ if (ret != -ENOENT)
++ return ret;
++ else
++ goto not_found;
++ }
++ }
+ }
+
+- /* Check readdir didn't fail. */
+- if (errno != 0) {
+- ret = -errno;
+- ntfs_log_debug("fstrim_limits: readdir failed\n");
+- goto out;
++ snprintf(path2, sizeof path2, "%s/queue/discard_max_bytes", path1);
++ ret = read_u64(path2, discard_max_bytes);
++ if (ret) {
++ if (ret != -ENOENT)
++ return ret;
++ else {
++ snprintf(path2, sizeof path2,
++ "%s/../queue/discard_max_bytes", path1);
++ ret = read_u64(path2, discard_max_bytes);
++ if (ret) {
++ if (ret != -ENOENT)
++ return ret;
++ else
++ goto not_found;
++ }
++ }
+ }
+
++ return 0;
++
++not_found:
+ /* If we reach here then we didn't find the device. This is
+ * not an error, but set discard_max_bytes = 0 to indicate
+ * that discard is not available.
+ */
++ *discard_alignment = 0;
+ *discard_granularity = 0;
+ *discard_max_bytes = 0;
+- ntfs_log_debug("fstrim_limits: /sys/block entry corresponding to device %s not found\n",
+- vol->dev->d_name);
+- ret = 0;
+- goto out;
+-
+-found:
+- /* Found the device at /sys/block/ + d->d_name */
+- snprintf (path, sizeof path,
+- "/sys/block/%s/queue/discard_granularity",
+- d->d_name);
+- ret = read_u64(path, discard_granularity);
+- if (ret) {
+- ntfs_log_debug("fstrim_limits: could not read %s\n", path);
+- goto out;
+- }
+-
+- snprintf (path, sizeof path,
+- "/sys/block/%s/queue/discard_max_bytes",
+- d->d_name);
+- ret = read_u64(path, discard_max_bytes);
+- if (ret) {
+- ntfs_log_debug("fstrim_limits: could not read %s\n", path);
+- goto out;
+- }
+-
+- ntfs_log_debug("fstrim_limits: device %s discard granularity = %llu max_bytes = %llu\n",
+- d->d_name,
+- (unsigned long long) *discard_granularity,
+- (unsigned long long) *discard_max_bytes);
+-
+- ret = 0;
+-out:
+- if (closedir (dir) == -1) {
+- ret = -errno;
+- ntfs_log_debug("fstrim_limits: closedir failed\n");
+- return ret;
+- }
+-
+- return ret;
++ return 0;
+ }
+
+ #define FSTRIM_BUFSIZ 4096
+@@ -247,7 +238,7 @@ static int fstrim(ntfs_volume *vol, void *data)
+ u64 start = range->start;
+ u64 len = range->len;
+ u64 minlen = range->minlen;
+- u64 discard_granularity, discard_max_bytes;
++ u64 discard_alignment, discard_granularity, discard_max_bytes;
+ u8 *buf = NULL;
+ LCN start_buf;
+ int ret;
+@@ -279,9 +270,14 @@ static int fstrim(ntfs_volume *vol, void *data)
+ return -EOPNOTSUPP;
+ }
+
+- ret = fstrim_limits(vol, &discard_granularity, &discard_max_bytes);
++ ret = fstrim_limits(vol, &discard_alignment,
++ &discard_granularity, &discard_max_bytes);
+ if (ret)
+ return ret;
++ if (discard_alignment != 0) {
++ ntfs_log_debug("fstrim: backing device is not aligned for discards\n");
++ return -EOPNOTSUPP;
++ }
+ if (discard_granularity > vol->cluster_size) {
+ ntfs_log_debug("fstrim: discard granularity of backing device is larger than cluster size\n");
+ return -EOPNOTSUPP;
+--
+1.9.3
+
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-implement-fstrim.patch b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-implement-fstrim.patch
new file mode 100644
index 000000000000..467f5d67493a
--- /dev/null
+++ b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-implement-fstrim.patch
@@ -0,0 +1,648 @@
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/configure.ac ntfs-3g_ntfsprogs-2014.2.15/configure.ac
+--- ntfs-3g_ntfsprogs-2014.2.15.old/configure.ac 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15/configure.ac 2014-07-31 13:51:24.425065808 +0100
+@@ -463,7 +463,8 @@
+ regex.h endian.h byteswap.h sys/byteorder.h sys/disk.h sys/endian.h \
+ sys/param.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/stat.h sys/types.h \
+ sys/vfs.h sys/statvfs.h sys/sysmacros.h linux/major.h linux/fd.h \
+- linux/hdreg.h machine/endian.h windows.h syslog.h pwd.h malloc.h])
++ linux/fs.h inttypes.h linux/hdreg.h \
++ machine/endian.h windows.h syslog.h pwd.h malloc.h])
+
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_HEADER_STDBOOL
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/include/ntfs-3g/ioctl.h ntfs-3g_ntfsprogs-2014.2.15/include/ntfs-3g/ioctl.h
+--- ntfs-3g_ntfsprogs-2014.2.15.old/include/ntfs-3g/ioctl.h 1970-01-01 01:00:00.000000000 +0100
++++ ntfs-3g_ntfsprogs-2014.2.15/include/ntfs-3g/ioctl.h 2014-07-31 13:51:24.426065810 +0100
+@@ -0,0 +1,30 @@
++/*
++ *
++ * Copyright (c) 2014 Jean-Pierre Andre
++ *
++ */
++
++/*
++ * 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 2 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 (in the main directory of the NTFS-3G
++ * distribution in the file COPYING); if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef IOCTL_H
++#define IOCTL_H
++
++int ntfs_ioctl(ntfs_inode *ni, int cmd, void *arg,
++ unsigned int flags, void *data);
++
++#endif /* IOCTL_H */
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/include/ntfs-3g/volume.h ntfs-3g_ntfsprogs-2014.2.15/include/ntfs-3g/volume.h
+--- ntfs-3g_ntfsprogs-2014.2.15.old/include/ntfs-3g/volume.h 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15/include/ntfs-3g/volume.h 2014-07-31 13:51:24.426065810 +0100
+@@ -36,9 +36,7 @@
+ #ifdef HAVE_SYS_PARAM_H
+ #include <sys/param.h>
+ #endif
+-#ifdef HAVE_SYS_MOUNT_H
+-#include <sys/mount.h>
+-#endif
++ /* Do not #include <sys/mount.h> here : conflicts with <linux/fs.h> */
+ #ifdef HAVE_MNTENT_H
+ #include <mntent.h>
+ #endif
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/libntfs-3g/ioctl.c ntfs-3g_ntfsprogs-2014.2.15/libntfs-3g/ioctl.c
+--- ntfs-3g_ntfsprogs-2014.2.15.old/libntfs-3g/ioctl.c 1970-01-01 01:00:00.000000000 +0100
++++ ntfs-3g_ntfsprogs-2014.2.15/libntfs-3g/ioctl.c 2014-07-31 13:51:24.427065813 +0100
+@@ -0,0 +1,382 @@
++/**
++ * ioctl.c - Processing of ioctls
++ *
++ * This module is part of ntfs-3g library
++ *
++ * Copyright (c) 2014 Jean-Pierre Andre
++ * Copyright (c) 2014 Red Hat, Inc.
++ *
++ * This program/include file 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 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program/include file 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 (in the main directory of the NTFS-3G
++ * distribution in the file COPYING); if not, write to the Free Software
++ * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#include "config.h"
++
++#ifdef HAVE_STDIO_H
++#include <stdio.h>
++#endif
++#ifdef HAVE_INTTYPES_H
++#include <inttypes.h>
++#endif
++#ifdef HAVE_STRING_H
++#include <string.h>
++#endif
++#ifdef HAVE_ERRNO_H
++#include <errno.h>
++#endif
++#ifdef HAVE_FCNTL_H
++#include <fcntl.h>
++#endif
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
++#ifdef HAVE_STDLIB_H
++#include <stdlib.h>
++#endif
++#ifdef HAVE_LIMITS_H
++#include <limits.h>
++#endif
++#include <syslog.h>
++
++#ifdef HAVE_SETXATTR
++#include <sys/xattr.h>
++#endif
++
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++
++#ifdef HAVE_SYS_STAT_H
++#include <sys/stat.h>
++#endif
++
++#ifdef HAVE_LINUX_FS_H
++#include <linux/fs.h>
++#endif
++
++#include <dirent.h>
++
++#include "compat.h"
++#include "debug.h"
++#include "bitmap.h"
++#include "attrib.h"
++#include "inode.h"
++#include "layout.h"
++#include "volume.h"
++#include "index.h"
++#include "logging.h"
++#include "ntfstime.h"
++#include "unistr.h"
++#include "dir.h"
++#include "security.h"
++#include "ioctl.h"
++#include "misc.h"
++
++#if defined(FITRIM) && defined(BLKDISCARD)
++
++/* Issue a TRIM request to the underlying device for the given clusters. */
++static int fstrim_clusters(ntfs_volume *vol, LCN lcn, s64 length)
++{
++ struct ntfs_device *dev = vol->dev;
++ uint64_t range[2];
++
++ ntfs_log_debug("fstrim_clusters: %lld length %lld\n",
++ (long long) lcn, (long long) length);
++
++ range[0] = lcn << vol->cluster_size_bits;
++ range[1] = length << vol->cluster_size_bits;
++
++ if (dev->d_ops->ioctl(dev, BLKDISCARD, range) == -1) {
++ ntfs_log_debug("fstrim_one_cluster: ioctl failed: %m\n");
++ return -errno;
++ }
++ return 0;
++}
++
++static int read_line(const char *path, char *line, size_t max_bytes)
++{
++ FILE *fp;
++
++ fp = fopen(path, "r");
++ if (fp == NULL)
++ return -errno;
++ if (fgets(line, max_bytes, fp) == NULL) {
++ int ret = -EIO; /* fgets doesn't set errno */
++ fclose(fp);
++ return ret;
++ }
++ fclose (fp);
++ return 0;
++}
++
++static int read_u64(const char *path, u64 *n)
++{
++ char line[64];
++ int ret;
++
++ ret = read_line(path, line, sizeof line);
++ if (ret)
++ return ret;
++ if (sscanf(line, "%" SCNu64, n) != 1)
++ return -EINVAL;
++ return 0;
++}
++
++/* Find discard limits for current backing device.
++ * XXX Kernel makes this a pain in the neck.
++ */
++static int fstrim_limits(ntfs_volume *vol, u64 *discard_granularity,
++ u64 *discard_max_bytes)
++{
++ struct stat statbuf;
++ DIR *dir;
++ struct dirent *d;
++ char path[80];
++ char line[64];
++ char dev[64];
++ int ret;
++
++ /* Stat the backing device. Caller has ensured it is a block device. */
++ if (stat(vol->dev->d_name, &statbuf) == -1) {
++ ntfs_log_debug("fstrim_limits: could not stat %s\n",
++ vol->dev->d_name);
++ return -errno;
++ }
++
++ /* Now look for a /sys/block/<dev>/dev file which contains
++ * "major:minor\n".
++ */
++ snprintf(dev, sizeof dev, "%d:%d\n",
++ major(statbuf.st_rdev), minor(statbuf.st_rdev));
++
++ dir = opendir("/sys/block");
++ if (dir == NULL) {
++ ntfs_log_debug("fstrim_limits: could not open /sys/block\n");
++ return -errno;
++ }
++ for (;;) {
++ errno = 0;
++ d = readdir(dir);
++ if (!d) break;
++
++ snprintf(path, sizeof path, "/sys/block/%s/dev", d->d_name);
++ ret = read_line(path, line, sizeof line);
++ if (ret)
++ continue;
++ if (strcmp(line, dev) == 0)
++ goto found;
++ }
++
++ /* Check readdir didn't fail. */
++ if (errno != 0) {
++ ret = -errno;
++ ntfs_log_debug("fstrim_limits: readdir failed\n");
++ goto out;
++ }
++
++ /* If we reach here then we didn't find the device. This is
++ * not an error, but set discard_max_bytes = 0 to indicate
++ * that discard is not available.
++ */
++ *discard_granularity = 0;
++ *discard_max_bytes = 0;
++ ntfs_log_debug("fstrim_limits: /sys/block entry corresponding to device %s not found\n",
++ vol->dev->d_name);
++ ret = 0;
++ goto out;
++
++found:
++ /* Found the device at /sys/block/ + d->d_name */
++ snprintf (path, sizeof path,
++ "/sys/block/%s/queue/discard_granularity",
++ d->d_name);
++ ret = read_u64(path, discard_granularity);
++ if (ret) {
++ ntfs_log_debug("fstrim_limits: could not read %s\n", path);
++ goto out;
++ }
++
++ snprintf (path, sizeof path,
++ "/sys/block/%s/queue/discard_max_bytes",
++ d->d_name);
++ ret = read_u64(path, discard_max_bytes);
++ if (ret) {
++ ntfs_log_debug("fstrim_limits: could not read %s\n", path);
++ goto out;
++ }
++
++ ntfs_log_debug("fstrim_limits: device %s discard granularity = %llu max_bytes = %llu\n",
++ d->d_name,
++ (unsigned long long) *discard_granularity,
++ (unsigned long long) *discard_max_bytes);
++
++ ret = 0;
++out:
++ if (closedir (dir) == -1) {
++ ret = -errno;
++ ntfs_log_debug("fstrim_limits: closedir failed\n");
++ return ret;
++ }
++
++ return ret;
++}
++
++#define FSTRIM_BUFSIZ 4096
++
++/* Trim the filesystem.
++ *
++ * Free blocks between 'start' and 'start+len-1' (both byte offsets)
++ * are found and TRIM requests are sent to the block device. 'minlen'
++ * is the minimum continguous free range to discard.
++ */
++static int fstrim(ntfs_volume *vol, void *data)
++{
++ struct fstrim_range *range = data;
++ u64 start = range->start;
++ u64 len = range->len;
++ u64 minlen = range->minlen;
++ u64 discard_granularity, discard_max_bytes;
++ u8 *buf = NULL;
++ LCN start_buf;
++ int ret;
++
++ ntfs_log_debug("fstrim: start=%llu len=%llu minlen=%llu\n",
++ (unsigned long long) start,
++ (unsigned long long) len,
++ (unsigned long long) minlen);
++
++ /* Fail if user tries to use the fstrim -o/-l/-m options.
++ * XXX We could fix these limitations in future.
++ */
++ if (start != 0 || len != (uint64_t)-1) {
++ ntfs_log_debug("fstrim: setting start or length is not supported\n");
++ return -EINVAL;
++ }
++ if (minlen > vol->cluster_size) {
++ ntfs_log_debug("fstrim: minlen > cluster size is not supported\n");
++ return -EINVAL;
++ }
++
++ /* Only block devices are supported. It would be possible to
++ * support backing files (ie. without using loop) but the
++ * ioctls used to punch holes in files are completely
++ * different.
++ */
++ if (!NDevBlock(vol->dev)) {
++ ntfs_log_debug("fstrim: not supported for non-block-device\n");
++ return -EOPNOTSUPP;
++ }
++
++ ret = fstrim_limits(vol, &discard_granularity, &discard_max_bytes);
++ if (ret)
++ return ret;
++ if (discard_granularity > vol->cluster_size) {
++ ntfs_log_debug("fstrim: discard granularity of backing device is larger than cluster size\n");
++ return -EOPNOTSUPP;
++ }
++ if (discard_max_bytes == 0) {
++ ntfs_log_debug("fstrim: backing device does not support discard (discard_max_bytes == 0)\n");
++ return -EOPNOTSUPP;
++ }
++
++ /* Sync the device before doing anything. */
++ ret = ntfs_device_sync(vol->dev);
++ if (ret)
++ return ret;
++
++ /* Read through the bitmap. */
++ buf = ntfs_malloc(FSTRIM_BUFSIZ);
++ if (buf == NULL)
++ return -errno;
++ for (start_buf = 0; start_buf < vol->nr_clusters;
++ start_buf += FSTRIM_BUFSIZ * 8) {
++ s64 count;
++ s64 br;
++ LCN end_buf, start_lcn;
++
++ /* start_buf is LCN of first cluster in the current buffer.
++ * end_buf is LCN of last cluster + 1 in the current buffer.
++ */
++ end_buf = start_buf + FSTRIM_BUFSIZ*8;
++ if (end_buf > vol->nr_clusters)
++ end_buf = vol->nr_clusters;
++ count = (end_buf - start_buf) / 8;
++
++ br = ntfs_attr_pread(vol->lcnbmp_na, start_buf/8, count, buf);
++ if (br != count) {
++ if (br >= 0)
++ ret = -EIO;
++ else
++ ret = -errno;
++ goto free_out;
++ }
++
++ /* Trim the clusters in large as possible blocks, but
++ * not larger than discard_max_bytes.
++ */
++ for (start_lcn = start_buf; start_lcn < end_buf; ++start_lcn) {
++ if (!ntfs_bit_get(buf, start_lcn-start_buf)) {
++ LCN end_lcn;
++
++ /* Cluster 'start_lcn' is not in use,
++ * find end of this run.
++ */
++ end_lcn = start_lcn+1;
++ while (end_lcn < end_buf &&
++ (u64) (end_lcn-start_lcn) << vol->cluster_size_bits
++ < discard_max_bytes &&
++ !ntfs_bit_get(buf, end_lcn-start_buf))
++ end_lcn++;
++
++ ret = fstrim_clusters(vol,
++ start_lcn, end_lcn-start_lcn);
++ if (ret)
++ goto free_out;
++
++ start_lcn = end_lcn-1;
++ }
++ }
++ }
++
++ ret = 0;
++free_out:
++ free(buf);
++ return ret;
++}
++
++#endif /* FITRIM && BLKDISCARD */
++
++int ntfs_ioctl(ntfs_inode *ni, int cmd, void *arg __attribute__((unused)),
++ unsigned int flags __attribute__((unused)), void *data)
++{
++ int ret = 0;
++
++ switch (cmd) {
++#if defined(FITRIM) && defined(BLKDISCARD)
++ case FITRIM:
++ if (!ni || !data)
++ ret = -EINVAL;
++ else
++ ret = fstrim(ni->vol, data);
++ break;
++#else
++#warning FITRIM or BLKDISCARD not defined
++#endif
++ default :
++ ret = -EINVAL;
++ break;
++ }
++ return (ret);
++}
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/libntfs-3g/Makefile.am ntfs-3g_ntfsprogs-2014.2.15/libntfs-3g/Makefile.am
+--- ntfs-3g_ntfsprogs-2014.2.15.old/libntfs-3g/Makefile.am 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15/libntfs-3g/Makefile.am 2014-07-31 13:51:24.426065810 +0100
+@@ -30,6 +30,7 @@
+ efs.c \
+ index.c \
+ inode.c \
++ ioctl.c \
+ lcnalloc.c \
+ logfile.c \
+ logging.c \
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/src/lowntfs-3g.c ntfs-3g_ntfsprogs-2014.2.15/src/lowntfs-3g.c
+--- ntfs-3g_ntfsprogs-2014.2.15.old/src/lowntfs-3g.c 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15/src/lowntfs-3g.c 2014-07-31 13:51:24.429065815 +0100
+@@ -81,7 +81,12 @@
+ #include <sys/dirent.h>
+ #endif /* defined(__APPLE__) || defined(__DARWIN__) */
+
++#ifdef HAVE_LINUX_FS_H
++#include <linux/fs.h>
++#endif
++
+ #include "compat.h"
++#include "bitmap.h"
+ #include "attrib.h"
+ #include "inode.h"
+ #include "volume.h"
+@@ -97,6 +102,7 @@
+ #include "logging.h"
+ #include "xattrs.h"
+ #include "misc.h"
++#include "ioctl.h"
+
+ #include "ntfs-3g_common.h"
+
+@@ -564,8 +570,6 @@
+ }
+ #endif /* defined(__APPLE__) || defined(__DARWIN__) */
+
+-#if defined(FUSE_CAP_DONT_MASK) || defined(FUSE_CAP_BIG_WRITES) \
+- || (defined(__APPLE__) || defined(__DARWIN__))
+ static void ntfs_init(void *userdata __attribute__((unused)),
+ struct fuse_conn_info *conn)
+ {
+@@ -582,8 +586,8 @@
+ >= SAFE_CAPACITY_FOR_BIG_WRITES))
+ conn->want |= FUSE_CAP_BIG_WRITES;
+ #endif
++ conn->want |= FUSE_CAP_IOCTL_DIR;
+ }
+-#endif /* defined(FUSE_CAP_DONT_MASK) || (defined(__APPLE__) || defined(__DARWIN__)) */
+
+ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx,
+ ntfs_inode *ni, struct stat *stbuf)
+@@ -2573,6 +2577,48 @@
+ fuse_reply_err(req, 0);
+ }
+
++static void ntfs_fuse_ioctl(fuse_req_t req __attribute__((unused)),
++ fuse_ino_t ino __attribute__((unused)),
++ int cmd, void *arg,
++ struct fuse_file_info *fi __attribute__((unused)),
++ unsigned flags, const void *data,
++ size_t in_bufsz, size_t out_bufsz)
++{
++ ntfs_inode *ni;
++ char *buf = (char*)NULL;
++ int bufsz;
++ int ret = 0;
++
++ if (flags & FUSE_IOCTL_COMPAT) {
++ ret = -ENOSYS;
++ } else {
++ ni = ntfs_inode_open(ctx->vol, INODE(ino));
++ if (!ni) {
++ ret = -errno;
++ goto fail;
++ }
++ bufsz = (in_bufsz > out_bufsz ? in_bufsz : out_bufsz);
++ if (bufsz) {
++ buf = ntfs_malloc(bufsz);
++ if (!buf) {
++ ret = ENOMEM;
++ goto fail;
++ }
++ memcpy(buf, data, in_bufsz);
++ }
++ ret = ntfs_ioctl(ni, cmd, arg, flags, buf);
++ if (ntfs_inode_close (ni))
++ set_fuse_error(&ret);
++ }
++ if (ret)
++fail :
++ fuse_reply_err(req, -ret);
++ else
++ fuse_reply_ioctl(req, 0, buf, out_bufsz);
++ if (buf)
++ free(buf);
++}
++
+ static void ntfs_fuse_bmap(fuse_req_t req, fuse_ino_t ino, size_t blocksize,
+ uint64_t vidx)
+ {
+@@ -3496,6 +3542,7 @@
+ .fsyncdir = ntfs_fuse_fsync,
+ .bmap = ntfs_fuse_bmap,
+ .destroy = ntfs_fuse_destroy2,
++ .ioctl = ntfs_fuse_ioctl,
+ #if !KERNELPERMS | (POSIXACLS & !KERNELACLS)
+ .access = ntfs_fuse_access,
+ #endif
+@@ -3512,10 +3559,7 @@
+ .setbkuptime = ntfs_macfuse_setbkuptime,
+ .setchgtime = ntfs_macfuse_setchgtime,
+ #endif /* defined(__APPLE__) || defined(__DARWIN__) */
+-#if defined(FUSE_CAP_DONT_MASK) || defined(FUSE_CAP_BIG_WRITES) \
+- || (defined(__APPLE__) || defined(__DARWIN__))
+ .init = ntfs_init
+-#endif
+ };
+
+ static int ntfs_fuse_init(void)
+diff -urN ntfs-3g_ntfsprogs-2014.2.15.old/src/ntfs-3g.c ntfs-3g_ntfsprogs-2014.2.15/src/ntfs-3g.c
+--- ntfs-3g_ntfsprogs-2014.2.15.old/src/ntfs-3g.c 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15/src/ntfs-3g.c 2014-07-31 13:51:24.430065816 +0100
+@@ -96,6 +96,7 @@
+ #include "logging.h"
+ #include "xattrs.h"
+ #include "misc.h"
++#include "ioctl.h"
+
+ #include "ntfs-3g_common.h"
+
+@@ -636,8 +637,6 @@
+ }
+ #endif /* defined(__APPLE__) || defined(__DARWIN__) */
+
+-#if defined(FUSE_CAP_DONT_MASK) || defined(FUSE_CAP_BIG_WRITES) \
+- || (defined(__APPLE__) || defined(__DARWIN__))
+ static void *ntfs_init(struct fuse_conn_info *conn)
+ {
+ #if defined(__APPLE__) || defined(__DARWIN__)
+@@ -653,9 +652,9 @@
+ >= SAFE_CAPACITY_FOR_BIG_WRITES))
+ conn->want |= FUSE_CAP_BIG_WRITES;
+ #endif
++ conn->want |= FUSE_CAP_IOCTL_DIR;
+ return NULL;
+ }
+-#endif /* defined(FUSE_CAP_DONT_MASK) || (defined(__APPLE__) || defined(__DARWIN__)) */
+
+ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf)
+ {
+@@ -2412,6 +2411,28 @@
+ return (ret);
+ }
+
++static int ntfs_fuse_ioctl(const char *path,
++ int cmd, void *arg,
++ struct fuse_file_info *fi __attribute__((unused)),
++ unsigned int flags, void *data)
++{
++ ntfs_inode *ni;
++ int ret;
++
++ if (flags & FUSE_IOCTL_COMPAT)
++ return -ENOSYS;
++
++ ni = ntfs_pathname_to_inode(ctx->vol, NULL, path);
++ if (!ni)
++ return -errno;
++
++ ret = ntfs_ioctl(ni, cmd, arg, flags, data);
++
++ if (ntfs_inode_close (ni))
++ set_fuse_error(&ret);
++ return ret;
++}
++
+ static int ntfs_fuse_bmap(const char *path, size_t blocksize, uint64_t *idx)
+ {
+ ntfs_inode *ni;
+@@ -3335,6 +3356,7 @@
+ .fsyncdir = ntfs_fuse_fsync,
+ .bmap = ntfs_fuse_bmap,
+ .destroy = ntfs_fuse_destroy2,
++ .ioctl = ntfs_fuse_ioctl,
+ #if !KERNELPERMS | (POSIXACLS & !KERNELACLS)
+ .access = ntfs_fuse_access,
+ .opendir = ntfs_fuse_opendir,
+@@ -3352,10 +3374,7 @@
+ .setbkuptime = ntfs_macfuse_setbkuptime,
+ .setchgtime = ntfs_macfuse_setchgtime,
+ #endif /* defined(__APPLE__) || defined(__DARWIN__) */
+-#if defined(FUSE_CAP_DONT_MASK) || defined(FUSE_CAP_BIG_WRITES) \
+- || (defined(__APPLE__) || defined(__DARWIN__))
+ .init = ntfs_init
+-#endif
+ };
+
+ static int ntfs_fuse_init(void)
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-no-split-usr.patch b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-no-split-usr.patch
new file mode 100644
index 000000000000..0228bfec330b
--- /dev/null
+++ b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-no-split-usr.patch
@@ -0,0 +1,25 @@
+we handle split /usr logic ourselves. this ends up breaking when building
+for an abi that doesn't exist in / (like cross-compiling) as the tests fail.
+
+--- a/libntfs-3g/Makefile.in
++++ b/libntfs-3g/Makefile.in
+@@ -912,19 +912,6 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-local \
+ uninstall-rootlibLTLIBRARIES
+
+
+-# We may need to move .so files to root
+-# And create ldscript or symbolic link from /usr
+-install-exec-hook: install-rootlibLTLIBRARIES
+-@INSTALL_LIBRARY_TRUE@ if [ ! "$(rootlibdir)" -ef "$(libdir)" ]; then \
+-@INSTALL_LIBRARY_TRUE@ $(MV) -f "$(DESTDIR)/$(libdir)"/libntfs-3g.so* "$(DESTDIR)/$(rootlibdir)"; \
+-@INSTALL_LIBRARY_TRUE@ fi
+-@GENERATE_LDSCRIPT_TRUE@@INSTALL_LIBRARY_TRUE@ if [ ! "$(rootlibdir)" -ef "$(libdir)" ]; then \
+-@GENERATE_LDSCRIPT_TRUE@@INSTALL_LIBRARY_TRUE@ $(install_sh_PROGRAM) "libntfs-3g.script.so" "$(DESTDIR)/$(libdir)/libntfs-3g.so"; \
+-@GENERATE_LDSCRIPT_TRUE@@INSTALL_LIBRARY_TRUE@ fi
+-@GENERATE_LDSCRIPT_FALSE@@INSTALL_LIBRARY_TRUE@ if [ ! "$(rootlibdir)" -ef "$(libdir)" ]; then \
+-@GENERATE_LDSCRIPT_FALSE@@INSTALL_LIBRARY_TRUE@ $(LN_S) "$(rootlibdir)/libntfs-3g.so" "$(DESTDIR)/$(libdir)/libntfs-3g.so"; \
+-@GENERATE_LDSCRIPT_FALSE@@INSTALL_LIBRARY_TRUE@ fi
+-
+ uninstall-local:
+ @INSTALL_LIBRARY_TRUE@ $(RM) -f "$(DESTDIR)/$(rootlibdir)"/libntfs-3g.so*
+
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-update-fuse-lite-to-support-ioctls.patch b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-update-fuse-lite-to-support-ioctls.patch
new file mode 100644
index 000000000000..0c9b7cc97d3d
--- /dev/null
+++ b/sys-fs/ntfs3g/files/ntfs3g-2014.2.15-update-fuse-lite-to-support-ioctls.patch
@@ -0,0 +1,610 @@
+diff -ur ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse_common.h ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse_common.h
+--- ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse_common.h 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse_common.h 2014-07-31 13:47:17.401904166 +0100
+@@ -49,6 +49,22 @@
+ #endif
+
+ #define FUSE_CAP_BIG_WRITES (1 << 5)
++#define FUSE_CAP_IOCTL_DIR (1 << 11)
++
++/**
++ * Ioctl flags
++ *
++ * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
++ * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
++ * FUSE_IOCTL_RETRY: retry with new iovecs
++ * FUSE_IOCTL_DIR: is a directory
++ */
++#define FUSE_IOCTL_COMPAT (1 << 0)
++#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
++#define FUSE_IOCTL_RETRY (1 << 2)
++#define FUSE_IOCTL_DIR (1 << 4)
++
++#define FUSE_IOCTL_MAX_IOV 256
+
+ /**
+ * Information about open files
+diff -ur ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse.h ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse.h
+--- ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse.h 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse.h 2014-07-31 13:47:17.401904166 +0100
+@@ -420,9 +420,27 @@
+ * Introduced in version 2.6
+ */
+ int (*bmap) (const char *, size_t blocksize, uint64_t *idx);
+- unsigned int flag_nullpath_ok : 1;
+
+ /**
++ * Ioctl
++ *
++ * flags will have FUSE_IOCTL_COMPAT set for 32bit ioctls in
++ * 64bit environment. The size and direction of data is
++ * determined by _IOC_*() decoding of cmd. For _IOC_NONE,
++ * data will be NULL, for _IOC_WRITE data is out area, for
++ * _IOC_READ in area and if both are set in/out area. In all
++ * non-NULL cases, the area is of _IOC_SIZE(cmd) bytes.
++ *
++ * Introduced in version 2.8
++ */
++ int (*ioctl) (const char *, int cmd, void *arg,
++ struct fuse_file_info *, unsigned int flags, void *data);
++
++ /*
++ * The flags below have been discarded, they should not be used
++ */
++ unsigned int flag_nullpath_ok : 1;
++ /**
+ * Reserved flags, don't set
+ */
+ unsigned int flag_reserved : 30;
+@@ -450,10 +468,8 @@
+ /** Private filesystem data */
+ void *private_data;
+
+-#ifdef POSIXACLS
+ /** Umask of the calling process (introduced in version 2.8) */
+ mode_t umask;
+-#endif
+ };
+
+ /* ----------------------------------------------------------- *
+@@ -601,6 +617,8 @@
+ const char *name);
+ int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
+ uint64_t *idx);
++int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, int cmd, void *arg,
++ struct fuse_file_info *fi, unsigned int flags, void *data);
+ void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
+ void fuse_fs_destroy(struct fuse_fs *fs);
+
+diff -ur ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse_kernel.h ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse_kernel.h
+--- ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse_kernel.h 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse_kernel.h 2014-07-31 13:47:17.401904166 +0100
+@@ -48,13 +48,19 @@
+ /** Version number of this interface */
+ #define FUSE_KERNEL_VERSION 7
+
+-/** Minor version number of this interface */
+-#ifdef POSIXACLS
+-#define FUSE_KERNEL_MINOR_VERSION 12
++/** Minor version number of this interface
++ * We introduce ourself as 7.18 (Posix ACLS : 7.12, IOCTL_DIR : 7.18)
++ * and we expect features features defined for 7.18, but not implemented
++ * here to not be triggered by ntfs-3g.
++ */
++#define FUSE_KERNEL_MINOR_VERSION 18
++
++/*
++ * For binary compatibility with old kernels we accept falling back to 7.8
++ */
++
++#define FUSE_KERNEL_MAJOR_FALLBACK 7
+ #define FUSE_KERNEL_MINOR_FALLBACK 8
+-#else
+-#define FUSE_KERNEL_MINOR_VERSION 8
+-#endif
+
+ /** The node ID of the root inode */
+ #define FUSE_ROOT_ID 1
+@@ -83,9 +89,7 @@
+ __u32 uid;
+ __u32 gid;
+ __u32 rdev;
+-#ifdef POSIXACLS
+ __u64 filling; /* JPA needed for minor >= 12, but meaning unknown */
+-#endif
+ };
+
+ struct fuse_kstatfs {
+@@ -132,11 +136,13 @@
+ * INIT request/reply flags
+ * FUSE_BIG_WRITES: allow big writes to be issued to the file system
+ * FUSE_DONT_MASK: don't apply umask to file mode on create operations
++ * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
+ */
+ #define FUSE_ASYNC_READ (1 << 0)
+ #define FUSE_POSIX_LOCKS (1 << 1)
+ #define FUSE_BIG_WRITES (1 << 5)
+ #define FUSE_DONT_MASK (1 << 6)
++#define FUSE_HAS_IOCTL_DIR (1 << 11)
+
+ /**
+ * Release flags
+@@ -180,6 +186,7 @@
+ FUSE_INTERRUPT = 36,
+ FUSE_BMAP = 37,
+ FUSE_DESTROY = 38,
++ FUSE_IOCTL = 39,
+ };
+
+ /* The read buffer is required to be at least 8k, but may be much larger */
+@@ -215,10 +222,8 @@
+ struct fuse_mknod_in {
+ __u32 mode;
+ __u32 rdev;
+-#ifdef POSIXACLS
+ __u32 umask;
+ __u32 padding;
+-#endif
+ };
+
+ struct fuse_mkdir_in {
+@@ -255,20 +260,14 @@
+
+ struct fuse_open_in {
+ __u32 flags;
+-#ifdef POSIXACLS
+- __u32 unused;
+-#else
+- __u32 mode;
+-#endif
++ __u32 mode; /* unused for protocol < 7.12 */
+ };
+
+ struct fuse_create_in {
+ __u32 flags;
+ __u32 mode;
+-#ifdef POSIXACLS
+ __u32 umask;
+ __u32 padding;
+-#endif
+ };
+
+ struct fuse_open_out {
+@@ -305,11 +304,9 @@
+ __u64 offset;
+ __u32 size;
+ __u32 write_flags;
+-#ifdef POSIXACLS
+ __u64 lock_owner; /* JPA */
+ __u32 flags; /* JPA */
+ __u32 padding; /* JPA */
+-#endif
+ };
+
+ struct fuse_write_out {
+@@ -389,6 +386,27 @@
+ __u64 block;
+ };
+
++struct fuse_ioctl_in {
++ __u64 fh;
++ __u32 flags;
++ __u32 cmd;
++ __u64 arg;
++ __u32 in_size;
++ __u32 out_size;
++};
++
++struct fuse_ioctl_iovec {
++ __u64 base;
++ __u64 len;
++};
++
++struct fuse_ioctl_out {
++ __s32 result;
++ __u32 flags;
++ __u32 in_iovs;
++ __u32 out_iovs;
++};
++
+ struct fuse_in_header {
+ __u32 len;
+ __u32 opcode;
+diff -ur ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse_lowlevel.h ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse_lowlevel.h
+--- ntfs-3g_ntfsprogs-2014.2.15/include/fuse-lite/fuse_lowlevel.h 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15.new/include/fuse-lite/fuse_lowlevel.h 2014-07-31 13:47:17.402904167 +0100
+@@ -101,10 +101,8 @@
+ /** Thread ID of the calling process */
+ pid_t pid;
+
+-#ifdef POSIXACLS
+ /** Umask of the calling process (introduced in version 2.8) */
+ mode_t umask;
+-#endif
+ };
+
+ /* 'to_set' flags in setattr */
+@@ -805,6 +803,37 @@
+ */
+ void (*bmap) (fuse_req_t req, fuse_ino_t ino, size_t blocksize,
+ uint64_t idx);
++ /**
++ * Ioctl
++ *
++ * Note: For unrestricted ioctls (not allowed for FUSE
++ * servers), data in and out areas can be discovered by giving
++ * iovs and setting FUSE_IOCTL_RETRY in @flags. For
++ * restricted ioctls, kernel prepares in/out data area
++ * according to the information encoded in cmd.
++ *
++ * Introduced in version 2.8
++ *
++ * Valid replies:
++ * fuse_reply_ioctl_retry
++ * fuse_reply_ioctl
++ * fuse_reply_ioctl_iov
++ * fuse_reply_err
++ *
++ * @param req request handle
++ * @param ino the inode number
++ * @param cmd ioctl command
++ * @param arg ioctl argument
++ * @param fi file information
++ * @param flags for FUSE_IOCTL_* flags
++ * @param in_buf data fetched from the caller
++ * @param in_bufsz number of fetched bytes
++ * @param out_bufsz maximum size of output data
++ */
++ void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
++ struct fuse_file_info *fi, unsigned flags,
++ const void *in_buf, size_t in_bufsz, size_t out_bufsz);
++
+ };
+
+ /**
+@@ -1022,6 +1051,20 @@
+ const char *name, const struct stat *stbuf,
+ off_t off);
+
++/**
++ * Reply to finish ioctl
++ *
++ * Possible requests:
++ * ioctl
++ *
++ * @param req request handle
++ * @param result result to be passed to the caller
++ * @param buf buffer containing output data
++ * @param size length of output data
++ */
++int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, size_t size);
++
++
+ /* ----------------------------------------------------------- *
+ * Utility functions *
+ * ----------------------------------------------------------- */
+diff -ur ntfs-3g_ntfsprogs-2014.2.15/libfuse-lite/fuse.c ntfs-3g_ntfsprogs-2014.2.15.new/libfuse-lite/fuse.c
+--- ntfs-3g_ntfsprogs-2014.2.15/libfuse-lite/fuse.c 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15.new/libfuse-lite/fuse.c 2014-07-31 13:47:17.403904167 +0100
+@@ -1040,6 +1040,21 @@
+ return -ENOSYS;
+ }
+
++int fuse_fs_ioctl(struct fuse_fs *fs, const char *path, int cmd, void *arg,
++ struct fuse_file_info *fi, unsigned int flags, void *data)
++{
++ fuse_get_context()->private_data = fs->user_data;
++ if (fs->op.ioctl) {
++/*
++ if (fs->debug)
++ fprintf(stderr, "ioctl[%llu] 0x%x flags: 0x%x\n",
++ (unsigned long long) fi->fh, cmd, flags);
++*/
++ return fs->op.ioctl(path, cmd, arg, fi, flags, data);
++ } else
++ return -ENOSYS;
++}
++
+ static int is_open(struct fuse *f, fuse_ino_t dir, const char *name)
+ {
+ struct node *node;
+@@ -2716,6 +2731,60 @@
+ reply_err(req, err);
+ }
+
++static void fuse_lib_ioctl(fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
++ struct fuse_file_info *llfi, unsigned int flags,
++ const void *in_buf, size_t in_bufsz,
++ size_t out_bufsz)
++{
++ struct fuse *f = req_fuse_prepare(req);
++ struct fuse_intr_data d;
++ struct fuse_file_info fi;
++ char *path, *out_buf = NULL;
++ int err;
++
++ err = -EPERM;
++ if (flags & FUSE_IOCTL_UNRESTRICTED)
++ goto err;
++
++ if (flags & FUSE_IOCTL_DIR)
++ get_dirhandle(llfi, &fi);
++ else
++ fi = *llfi;
++
++ if (out_bufsz) {
++ err = -ENOMEM;
++ out_buf = malloc(out_bufsz);
++ if (!out_buf)
++ goto err;
++ }
++
++ assert(!in_bufsz || !out_bufsz || in_bufsz == out_bufsz);
++ if (out_buf)
++ memcpy(out_buf, in_buf, in_bufsz);
++
++ path = get_path(f, ino); /* Should be get_path_nullok() */
++ if (!path) {
++ err = ENOENT;
++ goto err;
++ }
++
++ fuse_prepare_interrupt(f, req, &d);
++
++ /* Note : const qualifier dropped */
++ err = fuse_fs_ioctl(f->fs, path, cmd, arg, &fi, flags,
++ out_buf ? (void*)out_buf : (void*)(uintptr_t)in_buf);
++
++ fuse_finish_interrupt(f, req, &d);
++ free(path);
++
++ fuse_reply_ioctl(req, err, out_buf, out_bufsz);
++ goto out;
++err:
++ reply_err(req, err);
++out:
++ free(out_buf);
++}
++
+ static struct fuse_lowlevel_ops fuse_path_ops = {
+ .init = fuse_lib_init,
+ .destroy = fuse_lib_destroy,
+@@ -2751,6 +2820,7 @@
+ .getlk = fuse_lib_getlk,
+ .setlk = fuse_lib_setlk,
+ .bmap = fuse_lib_bmap,
++ .ioctl = fuse_lib_ioctl,
+ };
+
+ struct fuse_session *fuse_get_session(struct fuse *f)
+diff -ur ntfs-3g_ntfsprogs-2014.2.15/libfuse-lite/fuse_lowlevel.c ntfs-3g_ntfsprogs-2014.2.15.new/libfuse-lite/fuse_lowlevel.c
+--- ntfs-3g_ntfsprogs-2014.2.15/libfuse-lite/fuse_lowlevel.c 2014-02-15 14:07:52.000000000 +0000
++++ ntfs-3g_ntfsprogs-2014.2.15.new/libfuse-lite/fuse_lowlevel.c 2014-07-31 13:47:17.403904167 +0100
+@@ -333,12 +333,8 @@
+
+ memset(&arg, 0, sizeof(arg));
+ fill_entry(&arg, e);
+-#ifdef POSIXACLS
+ return send_reply_ok(req, &arg, (req->f->conn.proto_minor >= 12
+ ? sizeof(arg) : FUSE_COMPAT_ENTRY_OUT_SIZE));
+-#else
+- return send_reply_ok(req, &arg, sizeof(arg));
+-#endif
+ }
+
+ int fuse_reply_create(fuse_req_t req, const struct fuse_entry_param *e,
+@@ -351,7 +347,6 @@
+
+ memset(&arg, 0, sizeof(arg));
+ fill_entry(&arg.e, e);
+-#ifdef POSIXACLS
+ if (req->f->conn.proto_minor < 12) {
+ fill_open((struct fuse_open_out*)
+ ((char*)&arg + FUSE_COMPAT_ENTRY_OUT_SIZE), f);
+@@ -361,10 +356,6 @@
+ fill_open(&arg.o, f);
+ return send_reply_ok(req, &arg, sizeof(arg));
+ }
+-#else
+- fill_open(&arg.o, f);
+- return send_reply_ok(req, &arg, sizeof(arg));
+-#endif
+ }
+
+ int fuse_reply_attr(fuse_req_t req, const struct stat *attr,
+@@ -377,12 +368,8 @@
+ arg.attr_valid_nsec = calc_timeout_nsec(attr_timeout);
+ convert_stat(attr, &arg.attr);
+
+-#ifdef POSIXACLS
+ return send_reply_ok(req, &arg, (req->f->conn.proto_minor >= 12
+ ? sizeof(arg) : FUSE_COMPAT_FUSE_ATTR_OUT_SIZE));
+-#else
+- return send_reply_ok(req, &arg, sizeof(arg));
+-#endif
+ }
+
+ int fuse_reply_readlink(fuse_req_t req, const char *linkname)
+@@ -462,6 +449,28 @@
+ return send_reply_ok(req, &arg, sizeof(arg));
+ }
+
++int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, size_t size)
++{
++ struct fuse_ioctl_out arg;
++ struct iovec iov[3];
++ size_t count = 1;
++
++ memset(&arg, 0, sizeof(arg));
++ arg.result = result;
++ iov[count].iov_base = &arg;
++ iov[count].iov_len = sizeof(arg);
++ count++;
++
++ if (size) {
++ /* Note : const qualifier dropped */
++ iov[count].iov_base = (char *)(uintptr_t) buf;
++ iov[count].iov_len = size;
++ count++;
++ }
++
++ return send_reply_iov(req, 0, iov, count);
++}
++
+ static void do_lookup(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
+ {
+ const char *name = (const char *) inarg;
+@@ -538,11 +547,9 @@
+ const struct fuse_mknod_in *arg = (const struct fuse_mknod_in *) inarg;
+ const char *name = PARAM(arg);
+
+-#ifdef POSIXACLS
+ if (req->f->conn.proto_minor >= 12)
+ req->ctx.umask = arg->umask;
+ else
+-#endif
+ name = (const char *) inarg + FUSE_COMPAT_MKNOD_IN_SIZE;
+
+ if (req->f->op.mknod)
+@@ -555,10 +562,8 @@
+ {
+ const struct fuse_mkdir_in *arg = (const struct fuse_mkdir_in *) inarg;
+
+-#ifdef POSIXACLS
+ if (req->f->conn.proto_minor >= 12)
+ req->ctx.umask = arg->umask;
+-#endif
+
+ if (req->f->op.mkdir)
+ req->f->op.mkdir(req, nodeid, PARAM(arg), arg->mode);
+@@ -630,11 +635,9 @@
+ memset(&fi, 0, sizeof(fi));
+ fi.flags = arg->flags;
+
+-#ifdef POSIXACLS
+ if (req->f->conn.proto_minor >= 12)
+ req->ctx.umask = arg->umask;
+ else
+-#endif
+ name = (const char *) inarg + sizeof(struct fuse_open_in);
+
+ req->f->op.create(req, nodeid, name, arg->mode, &fi);
+@@ -682,7 +685,6 @@
+ fi.writepage = arg->write_flags & 1;
+
+ if (req->f->op.write) {
+-#ifdef POSIXACLS
+ const char *buf;
+
+ if (req->f->conn.proto_minor >= 12)
+@@ -690,9 +692,6 @@
+ else
+ buf = ((const char*)arg) + FUSE_COMPAT_WRITE_IN_SIZE;
+ req->f->op.write(req, nodeid, buf, arg->size, arg->offset, &fi);
+-#else
+- req->f->op.write(req, nodeid, PARAM(arg), arg->size, arg->offset, &fi);
+-#endif
+ } else
+ fuse_reply_err(req, ENOSYS);
+ }
+@@ -1011,6 +1010,39 @@
+ fuse_reply_err(req, ENOSYS);
+ }
+
++static void do_ioctl(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
++{
++ const struct fuse_ioctl_in *arg = (const struct fuse_ioctl_in *) inarg;
++ unsigned int flags = arg->flags;
++ const void *in_buf = arg->in_size ? PARAM(arg) : NULL;
++ struct fuse_file_info fi;
++
++ if (flags & FUSE_IOCTL_DIR &&
++ !(req->f->conn.want & FUSE_CAP_IOCTL_DIR)) {
++ fuse_reply_err(req, ENOTTY);
++ return;
++ }
++
++ memset(&fi, 0, sizeof(fi));
++ fi.fh = arg->fh;
++
++/* TODO JPA (need req->ioctl_64bit in obscure fuse_req_t)
++// probably a 64 bit ioctl on a 32-bit cpu
++// this is to forward a request from the kernel
++ if (sizeof(void *) == 4 && req->f->conn.proto_minor >= 16 &&
++ !(flags & FUSE_IOCTL_32BIT)) {
++ req->ioctl_64bit = 1;
++ }
++*/
++
++ if (req->f->op.ioctl)
++ req->f->op.ioctl(req, nodeid, arg->cmd,
++ (void *)(uintptr_t)arg->arg, &fi, flags,
++ in_buf, arg->in_size, arg->out_size);
++ else
++ fuse_reply_err(req, ENOSYS);
++}
++
+ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
+ {
+ const struct fuse_init_in *arg = (const struct fuse_init_in *) inarg;
+@@ -1047,6 +1079,8 @@
+ #endif
+ if (arg->flags & FUSE_BIG_WRITES)
+ f->conn.capable |= FUSE_CAP_BIG_WRITES;
++ if (arg->flags & FUSE_HAS_IOCTL_DIR)
++ f->conn.capable |= FUSE_CAP_IOCTL_DIR;
+ } else {
+ f->conn.async_read = 0;
+ f->conn.max_readahead = 0;
+@@ -1069,28 +1103,28 @@
+ memset(&outarg, 0, sizeof(outarg));
+ outarg.major = FUSE_KERNEL_VERSION;
+ /*
+- * if POSIXACLS is not set, protocol 7.8 provides a good
+- * compatibility with older kernel modules.
+- * if POSIXACLS is set, we try to use protocol 7.12 supposed
+- * to have the ability to process the umask conditionnally,
+- * but, when using an older kernel module, we fallback to 7.8
++ * Suggest using protocol 7.18 when available, and fallback
++ * to 7.8 when running on an old kernel.
++ * Protocol 7.12 has the ability to process the umask
++ * conditionnally (as needed if POSIXACLS is set)
++ * Protocol 7.18 has the ability to process the ioctls
+ */
+-#ifdef POSIXACLS
+- if (arg->major > 7 || (arg->major == 7 && arg->minor >= 12))
++ if (arg->major > 7 || (arg->major == 7 && arg->minor >= 18)) {
+ outarg.minor = FUSE_KERNEL_MINOR_VERSION;
+- else
+- outarg.minor = FUSE_KERNEL_MINOR_FALLBACK;
+-#else
+- outarg.minor = FUSE_KERNEL_MINOR_VERSION;
++ if (f->conn.want & FUSE_CAP_IOCTL_DIR)
++ outarg.flags |= FUSE_HAS_IOCTL_DIR;
++#ifdef POSIXACLS
++ if (f->conn.want & FUSE_CAP_DONT_MASK)
++ outarg.flags |= FUSE_DONT_MASK;
+ #endif
++ } else {
++ outarg.major = FUSE_KERNEL_MAJOR_FALLBACK;
++ outarg.minor = FUSE_KERNEL_MINOR_FALLBACK;
++ }
+ if (f->conn.async_read)
+ outarg.flags |= FUSE_ASYNC_READ;
+ if (f->op.getlk && f->op.setlk)
+ outarg.flags |= FUSE_POSIX_LOCKS;
+-#ifdef POSIXACLS
+- if (f->conn.want & FUSE_CAP_DONT_MASK)
+- outarg.flags |= FUSE_DONT_MASK;
+-#endif
+ if (f->conn.want & FUSE_CAP_BIG_WRITES)
+ outarg.flags |= FUSE_BIG_WRITES;
+ outarg.max_readahead = f->conn.max_readahead;
+@@ -1191,6 +1225,7 @@
+ [FUSE_CREATE] = { do_create, "CREATE" },
+ [FUSE_INTERRUPT] = { do_interrupt, "INTERRUPT" },
+ [FUSE_BMAP] = { do_bmap, "BMAP" },
++ [FUSE_IOCTL] = { do_ioctl, "IOCTL" },
+ [FUSE_DESTROY] = { do_destroy, "DESTROY" },
+ };
+
diff --git a/sys-fs/ntfs3g/files/ntfs3g-2015.3.14-dont-put-things-in-root.patch b/sys-fs/ntfs3g/files/ntfs3g-2015.3.14-dont-put-things-in-root.patch
new file mode 100644
index 000000000000..e86d9defbaea
--- /dev/null
+++ b/sys-fs/ntfs3g/files/ntfs3g-2015.3.14-dont-put-things-in-root.patch
@@ -0,0 +1,30 @@
+install all files into the sbindir since there's no need to split between /sbin and /usr/sbin
+
+--- a/ntfsprogs/Makefile.in
++++ b/ntfsprogs/Makefile.in
+@@ -1348,8 +1348,8 @@ uninstall-man: uninstall-man8
+ # mkfs.ntfs[.8] hard link
+
+ @ENABLE_NTFSPROGS_TRUE@install-exec-hook:
+-@ENABLE_NTFSPROGS_TRUE@ $(INSTALL) -d $(DESTDIR)/sbin
+-@ENABLE_NTFSPROGS_TRUE@ $(LN_S) -f $(sbindir)/mkntfs $(DESTDIR)/sbin/mkfs.ntfs
++@ENABLE_NTFSPROGS_TRUE@ $(INSTALL) -d $(DESTDIR)/$(sbindir)
++@ENABLE_NTFSPROGS_TRUE@ $(LN_S) -f mkntfs $(DESTDIR)/$(sbindir)/mkfs.ntfs
+
+ @ENABLE_NTFSPROGS_TRUE@install-data-hook:
+ @ENABLE_NTFSPROGS_TRUE@ $(INSTALL) -d $(DESTDIR)$(man8dir)
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -1040,9 +1040,9 @@ uninstall-man: uninstall-man8
+ @ENABLE_NTFS_3G_TRUE@@RUN_LDCONFIG_TRUE@ $(LDCONFIG)
+
+ @ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@install-exec-local: install-rootbinPROGRAMS
+-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@ $(MKDIR_P) "$(DESTDIR)/sbin"
+-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@ $(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/sbin/mount.ntfs-3g"
+-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@ $(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
++@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@ $(MKDIR_P) "$(DESTDIR)/$(sbindir)"
++@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@ $(LN_S) -f "../bin/ntfs-3g" "$(DESTDIR)/$(sbindir)/mount.ntfs-3g"
++@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@ $(LN_S) -f "../bin/lowntfs-3g" "$(DESTDIR)/$(sbindir)/mount.lowntfs-3g"
+
+ @ENABLE_NTFS_3G_TRUE@install-data-local: install-man8
+ @ENABLE_NTFS_3G_TRUE@ $(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
diff --git a/sys-fs/ntfs3g/metadata.xml b/sys-fs/ntfs3g/metadata.xml
new file mode 100644
index 000000000000..1f0868a61e70
--- /dev/null
+++ b/sys-fs/ntfs3g/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <maintainer>
+ <email>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+ <longdescription lang="en">
+The ntfs-3g driver is an open source, GPL licensed, third generation Linux
+NTFS driver for 32-bit, little-endian architectures which was implemented
+by the Linux-NTFS project. It provides full read-write access to NTFS,
+excluding access to encrypted files, writing compressed files, changing
+file ownership, access right.
+ </longdescription>
+ <use>
+ <flag name='external-fuse'>Use external FUSE library instead of internal
+ one. Must be disabled for unprivileged mounting to work.</flag>
+ <flag name='ntfsdecrypt'>Build and install the ntfsdecrypt application.</flag>
+ <flag name='ntfsprogs'>Include internal version of ntfsprogs.</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:ntfs-3g:ntfs-3g</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/ntfs3g/ntfs3g-2013.1.13.ebuild b/sys-fs/ntfs3g/ntfs3g-2013.1.13.ebuild
new file mode 100644
index 000000000000..6707e0f0e324
--- /dev/null
+++ b/sys-fs/ntfs3g/ntfs3g-2013.1.13.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-info udev toolchain-funcs
+
+MY_PN=${PN/3g/-3g}
+MY_P=${MY_PN}_ntfsprogs-${PV}
+
+DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
+HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
+SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr"
+
+RDEPEND="!<sys-apps/util-linux-2.20.1-r2
+ !sys-fs/ntfsprogs
+ ntfsdecrypt? (
+ >=dev-libs/libgcrypt-1.2.2:0
+ <dev-libs/libgcrypt-1.6.0:0
+ >=net-libs/gnutls-1.4.4
+ )
+ external-fuse? ( >=sys-fs/fuse-2.8.0 )"
+DEPEND="${RDEPEND}
+ sys-apps/attr
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS="AUTHORS ChangeLog CREDITS README"
+
+pkg_setup() {
+ if use external-fuse && use kernel_linux; then
+ if kernel_is lt 2 6 9; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # add missing $(sbindir) references
+ sed -e 's:sbin\($\|/\):$(sbindir)\1:g' \
+ -i ntfsprogs/Makefile.in src/Makefile.in || die
+}
+
+src_configure() {
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ --exec-prefix="${EPREFIX}"/usr \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable debug) \
+ --enable-ldscript \
+ --disable-ldconfig \
+ $(use_enable acl posix-acls) \
+ $(use_enable xattr xattr-mappings) \
+ $(use_enable ntfsdecrypt crypto) \
+ $(use_enable ntfsprogs) \
+ --without-uuid \
+ --enable-extras \
+ $(use_enable static-libs static) \
+ --with-fuse=$(usex external-fuse external internal)
+}
+
+src_install() {
+ default
+
+ use suid && fperms u+s /usr/bin/${MY_PN}
+ udev_dorules "${FILESDIR}"/99-ntfs3g.rules
+ prune_libtool_files
+
+ # http://bugs.gentoo.org/398069
+ rmdir "${D}"/sbin
+
+ dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
+}
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ # Bug 450024
+ if tc-ld-is-gold; then
+ eerror "ntfs-3g does not function correctly when built with the gold linker."
+ eerror "Please select the bfd linker with binutils-config."
+ die "GNU gold detected"
+ fi
+ fi
+}
diff --git a/sys-fs/ntfs3g/ntfs3g-2014.2.15-r1.ebuild b/sys-fs/ntfs3g/ntfs3g-2014.2.15-r1.ebuild
new file mode 100644
index 000000000000..06aaeca8657a
--- /dev/null
+++ b/sys-fs/ntfs3g/ntfs3g-2014.2.15-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-info udev toolchain-funcs autotools
+
+MY_PN=${PN/3g/-3g}
+MY_P=${MY_PN}_ntfsprogs-${PV}
+
+DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
+HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
+SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ppc ~ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr"
+
+RDEPEND="!<sys-apps/util-linux-2.20.1-r2
+ !sys-fs/ntfsprogs
+ ntfsdecrypt? (
+ >=dev-libs/libgcrypt-1.2.2:0
+ >=net-libs/gnutls-1.4.4
+ )
+ external-fuse? ( >=sys-fs/fuse-2.8.0 )"
+DEPEND="${RDEPEND}
+ sys-apps/attr
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS="AUTHORS ChangeLog CREDITS README"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
+ "${FILESDIR}"/${PN}-2014.2.15-dont-put-things-in-root.patch
+ "${FILESDIR}"/${P}-update-fuse-lite-to-support-ioctls.patch
+ "${FILESDIR}"/${P}-implement-fstrim.patch
+ "${FILESDIR}"/${P}-fix-fstrim-applied-to-partitons.patch
+)
+
+pkg_setup() {
+ if use external-fuse && use kernel_linux; then
+ if kernel_is lt 2 6 9; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ eautoreconf
+ elibtoolize
+}
+
+src_configure() {
+ tc-ld-disable-gold
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ --exec-prefix="${EPREFIX}"/usr \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable debug) \
+ --enable-ldscript \
+ --disable-ldconfig \
+ $(use_enable acl posix-acls) \
+ $(use_enable xattr xattr-mappings) \
+ $(use_enable ntfsdecrypt crypto) \
+ $(use_enable ntfsprogs) \
+ --without-uuid \
+ --enable-extras \
+ $(use_enable static-libs static) \
+ --with-fuse=$(usex external-fuse external internal)
+}
+
+src_install() {
+ default
+
+ use suid && fperms u+s /usr/bin/${MY_PN}
+ udev_dorules "${FILESDIR}"/99-ntfs3g.rules
+ prune_libtool_files
+
+ dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
+}
diff --git a/sys-fs/ntfs3g/ntfs3g-2014.2.15.ebuild b/sys-fs/ntfs3g/ntfs3g-2014.2.15.ebuild
new file mode 100644
index 000000000000..391eaa3c7539
--- /dev/null
+++ b/sys-fs/ntfs3g/ntfs3g-2014.2.15.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-info udev toolchain-funcs
+
+MY_PN=${PN/3g/-3g}
+MY_P=${MY_PN}_ntfsprogs-${PV}
+
+DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
+HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
+SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr"
+
+RDEPEND="!<sys-apps/util-linux-2.20.1-r2
+ !sys-fs/ntfsprogs
+ ntfsdecrypt? (
+ >=dev-libs/libgcrypt-1.2.2:0
+ >=net-libs/gnutls-1.4.4
+ )
+ external-fuse? ( >=sys-fs/fuse-2.8.0 )"
+DEPEND="${RDEPEND}
+ sys-apps/attr
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS="AUTHORS ChangeLog CREDITS README"
+
+pkg_setup() {
+ if use external-fuse && use kernel_linux; then
+ if kernel_is lt 2 6 9; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # add missing $(sbindir) references
+ sed -e 's:sbin\($\|/\):$(sbindir)\1:g' \
+ -i ntfsprogs/Makefile.in src/Makefile.in || die
+ epatch "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
+}
+
+src_configure() {
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ --exec-prefix="${EPREFIX}"/usr \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable debug) \
+ --enable-ldscript \
+ --disable-ldconfig \
+ $(use_enable acl posix-acls) \
+ $(use_enable xattr xattr-mappings) \
+ $(use_enable ntfsdecrypt crypto) \
+ $(use_enable ntfsprogs) \
+ --without-uuid \
+ --enable-extras \
+ $(use_enable static-libs static) \
+ --with-fuse=$(usex external-fuse external internal)
+}
+
+src_install() {
+ default
+
+ use suid && fperms u+s /usr/bin/${MY_PN}
+ udev_dorules "${FILESDIR}"/99-ntfs3g.rules
+ prune_libtool_files
+
+ # http://bugs.gentoo.org/398069
+ rmdir "${D}"/sbin
+
+ dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
+}
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ # Bug 450024
+ if tc-ld-is-gold; then
+ eerror "ntfs-3g does not function correctly when built with the gold linker."
+ eerror "Please select the bfd linker with binutils-config."
+ die "GNU gold detected"
+ fi
+ fi
+}
diff --git a/sys-fs/ntfs3g/ntfs3g-2015.3.14.ebuild b/sys-fs/ntfs3g/ntfs3g-2015.3.14.ebuild
new file mode 100644
index 000000000000..f7f0089e6f24
--- /dev/null
+++ b/sys-fs/ntfs3g/ntfs3g-2015.3.14.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-info udev toolchain-funcs libtool
+
+MY_PN=${PN/3g/-3g}
+MY_P=${MY_PN}_ntfsprogs-${PV}
+
+DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
+HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
+SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0/86"
+KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr"
+
+RDEPEND="!<sys-apps/util-linux-2.20.1-r2
+ !sys-fs/ntfsprogs
+ ntfsdecrypt? (
+ >=dev-libs/libgcrypt-1.2.2:0
+ >=net-libs/gnutls-1.4.4
+ )
+ external-fuse? ( >=sys-fs/fuse-2.8.0 )"
+DEPEND="${RDEPEND}
+ sys-apps/attr
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS="AUTHORS ChangeLog CREDITS README"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
+ "${FILESDIR}"/${PN}-2015.3.14-dont-put-things-in-root.patch
+)
+
+pkg_setup() {
+ if use external-fuse && use kernel_linux; then
+ if kernel_is lt 2 6 9; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ # Note: patches apply to Makefile.in, so don't run autotools here.
+ elibtoolize
+}
+
+src_configure() {
+ tc-ld-disable-gold
+ econf \
+ --prefix="${EPREFIX}"/usr \
+ --exec-prefix="${EPREFIX}"/usr \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable debug) \
+ --enable-ldscript \
+ --disable-ldconfig \
+ $(use_enable acl posix-acls) \
+ $(use_enable xattr xattr-mappings) \
+ $(use_enable ntfsdecrypt crypto) \
+ $(use_enable ntfsprogs) \
+ $(use_enable ntfsprogs quarantined) \
+ --without-uuid \
+ --enable-extras \
+ $(use_enable static-libs static) \
+ --with-fuse=$(usex external-fuse external internal)
+}
+
+src_install() {
+ default
+
+ use suid && fperms u+s /usr/bin/${MY_PN}
+ udev_dorules "${FILESDIR}"/99-ntfs3g.rules
+ prune_libtool_files
+
+ dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
+}
diff --git a/sys-fs/obexfs/Manifest b/sys-fs/obexfs/Manifest
new file mode 100644
index 000000000000..42d496cb7870
--- /dev/null
+++ b/sys-fs/obexfs/Manifest
@@ -0,0 +1,2 @@
+DIST obexfs-0.11.tar.gz 86933 SHA256 4ff113dfa4f677e047fce0ee4da7c619adfe6087181376facbb605a38a347243
+DIST obexfs-0.12.tar.gz 83924 SHA256 72a62aeb4d4decff962f22239513651843857492e9d6b50f515c9bf9fccd73bc SHA512 f9b9c7c220271b7bf538d748beb3cb7fabd0377ef74855a959f7595755904be739ed5995909f423a40218d05a71de6b48a5ef471e2dc0934164aba2805c7e2e0 WHIRLPOOL 0355b71be7b393601bfcdbef791b061e284782135e6c3bd6164bbe304810e3be601279f1b5da3776528ec0aea41f829aab2560932c87cfa909fb4458fc9139f2
diff --git a/sys-fs/obexfs/metadata.xml b/sys-fs/obexfs/metadata.xml
new file mode 100644
index 000000000000..64ba3092b06f
--- /dev/null
+++ b/sys-fs/obexfs/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>Userspace filesystem used for accessing files on
+OBEX-capable mobile phones.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">openobex</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/obexfs/obexfs-0.11.ebuild b/sys-fs/obexfs/obexfs-0.11.ebuild
new file mode 100644
index 000000000000..22c6554c0321
--- /dev/null
+++ b/sys-fs/obexfs/obexfs-0.11.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="FUSE filesystem interface for ObexFTP"
+HOMEPAGE="http://dev.zuckschwerdt.org/openobex/wiki/ObexFs"
+SRC_URI="http://triq.net/obexftp/${P/_/-}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=">=app-mobilephone/obexftp-0.22
+ sys-fs/fuse"
+RDEPEND=${DEPEND}
+
+S="${WORKDIR}/${P%_*}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS ChangeLog README
+}
diff --git a/sys-fs/obexfs/obexfs-0.12.ebuild b/sys-fs/obexfs/obexfs-0.12.ebuild
new file mode 100644
index 000000000000..b844b3b5b057
--- /dev/null
+++ b/sys-fs/obexfs/obexfs-0.12.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="FUSE filesystem interface for ObexFTP"
+HOMEPAGE="http://dev.zuckschwerdt.org/openobex/wiki/ObexFs"
+SRC_URI="mirror://sourceforge/openobex/files/${PN}/${PV}/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ >=app-mobilephone/obexftp-0.22
+ sys-fs/fuse
+"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Fix building, bug #523062 (from ArchLinux)
+ export OBEXFTP_CFLAGS="-I/usr/include/obexftp -I/usr/include/multicobex -I/usr/include/bfb"
+ export OBEXFTP_LIBS="-lobexftp -lmulticobex -lbfb -lopenobex -lbluetooth"
+}
diff --git a/sys-fs/ocfs2-tools/Manifest b/sys-fs/ocfs2-tools/Manifest
new file mode 100644
index 000000000000..4a5adffc3082
--- /dev/null
+++ b/sys-fs/ocfs2-tools/Manifest
@@ -0,0 +1 @@
+DIST ocfs2-tools-1.8.2.tar.xz 963132 SHA256 3af5e43695bf780531208b5b058741320c1f03fe54568390bf74cba5066f315b SHA512 b1354730a1e51117497b56e0a1fd79667d608cdf2ccdfa9eb7355f9f40684e64c0787722fa8e6046b35dd00c2ff7a822719b47d059f23253f0bab64e181875ee WHIRLPOOL 88621b43622635dbc4e02b3f5a0c9ff2a411e0481459abc13850f33456fad5ebdc23d5bd3f3fe541ab83cb404fe49bd7814f9f6199dc7f258a8432a12302174a
diff --git a/sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch b/sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch
new file mode 100644
index 000000000000..c382522f14ed
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2-tools-1.6.4-asneeded.patch
@@ -0,0 +1,78 @@
+--- configure.in.orig 2011-01-19 20:43:35.000000000 +0100
++++ configure.in 2012-02-21 11:14:51.047974999 +0100
+@@ -265,7 +265,6 @@
+ cpg_package=openais
+ fi
+ TRY_PATH="$AIS_TRY_PATH"
+- AC_MSG_CHECKING([for cpg_initialize in -lcpg])
+ while test "x$TRY_PATH" != "x"; do
+ TRY="`echo $TRY_PATH | cut -f1 -d:`"
+ NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
+@@ -281,9 +280,8 @@
+ # TRY="$TRY"
+
+ saved_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $TRY -lcpg"
+- AC_LINK_IFELSE([AC_LANG_CALL([], [cpg_initialize])],
+- cpg_found=yes)
++ LDFLAGS="$LDFLAGS $TRY"
++ AC_SEARCH_LIBS([cpg_initialize], [cpg], [cpg_found=yes], [], [])
+ LDFLAGS="$saved_LDFLAGS"
+
+ if test "x$cpg_found" = "xyes"; then
+@@ -292,10 +290,7 @@
+ fi
+ done
+ fi
+-if test "x$cpg_found" = "xyes"; then
+- AC_MSG_RESULT(yes)
+-else
+- AC_MSG_RESULT(no)
++if test "x$cpg_found" = "xno"; then
+ AC_MSG_WARN([libcpg not found, ocfs2_controld will not be built])
+ fi
+ AC_SUBST(CPG_LDFLAGS)
+@@ -309,7 +304,6 @@
+ if test "x$ckpt_found" = "xyes"; then
+ ckpt_found=
+ TRY_PATH="$AIS_TRY_PATH"
+- AC_MSG_CHECKING([for saCkptInitialize in -lSaCkpt])
+ while test "x$TRY_PATH" != "x"; do
+ TRY="`echo $TRY_PATH | cut -f1 -d:`"
+ NEW_TRY_PATH="`echo $TRY_PATH | cut -f2- -d:`"
+@@ -325,9 +319,8 @@
+ # TRY="$TRY"
+
+ saved_LDFLAGS="$LDFLAGS"
+- LDFLAGS="$LDFLAGS $TRY -lSaCkpt"
+- AC_LINK_IFELSE([AC_LANG_CALL([], [saCkptInitialize])],
+- ckpt_found=yes)
++ LDFLAGS="$LDFLAGS $TRY"
++ AC_SEARCH_LIBS([saCkptInitialize], [SaCkpt], [ckpt_found=yes], [], [])
+ LDFLAGS="$saved_LDFLAGS"
+
+ if test "x$ckpt_found" = "xyes"; then
+@@ -336,10 +329,7 @@
+ fi
+ done
+ fi
+-if test "x$ckpt_found" = "xyes"; then
+- AC_MSG_RESULT(yes)
+-else
+- AC_MSG_RESULT(no)
++if test "x$ckpt_found" = "xno"; then
+ AC_MSG_WARN([libSaCkpt not found, ocfs2_controld will not be built])
+ fi
+ AC_SUBST(AIS_LDFLAGS)
+
+--- ocfs2_controld/Makefile.orig 2012-02-21 11:49:36.248974932 +0100
++++ ocfs2_controld/Makefile 2012-02-21 11:49:47.943974980 +0100
+@@ -14,7 +14,7 @@
+ ifneq ($(BUILD_PCMK_SUPPORT),)
+ SBIN_PROGRAMS += ocfs2_controld.pcmk
+ # Some pacemaker headers which pacemaker.c includes want this.
+-PCMK_INCLUDES = -I/usr/include/pacemaker -I/usr/include/heartbeat/ $(GLIB_CFLAGS)
++PCMK_INCLUDES = -I/usr/include/pacemaker -I/usr/include/heartbeat/ `pkg-config --cflags libxml-2.0` $(GLIB_CFLAGS)
+ endif
+
+ INCLUDES = -I$(TOPDIR)/include -I. $(PCMK_INCLUDES)
diff --git a/sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch b/sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch
new file mode 100644
index 000000000000..24bc40dcd09f
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2-tools-recent-kernels.patch
@@ -0,0 +1,19 @@
+# git diff include/ocfs2-kernel/ocfs2_fs.h
+diff --git a/include/ocfs2-kernel/ocfs2_fs.h b/include/ocfs2-kernel/ocfs2_fs.h
+index 3eafb07..7bb954a 100644
+--- a/include/ocfs2-kernel/ocfs2_fs.h
++++ b/include/ocfs2-kernel/ocfs2_fs.h
+@@ -1681,11 +1681,11 @@ static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
+ return chars;
+ }
+
+-static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
++/*static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
+ umode_t mode)
+ {
+ de->file_type = ocfs2_type_by_mode[(mode & S_IFMT)>>S_SHIFT];
+-}
++}*/
+
+ static inline int ocfs2_gd_is_discontig(struct ocfs2_group_desc *gd)
+ { \ No newline at end of file
diff --git a/sys-fs/ocfs2-tools/files/ocfs2.confd b/sys-fs/ocfs2-tools/files/ocfs2.confd
new file mode 100644
index 000000000000..b9538cbea33e
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2.confd
@@ -0,0 +1,38 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Put your cluster names here, separated by space, ie.
+# OCFS2_CLUSTER="cluster1 admincluster cluster2"
+OCFS2_CLUSTER="home"
+
+# Some heartbeat tweaks to prevent self-fencing quite so much during heavy load.
+# http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html
+
+# How long to wait before a node is considered dead from lack of network activity.
+OCFS2_IDLE_TIMEOUT_MS="30000"
+# How often we should attempt to send heartbeats.
+OCFS2_KEEPALIVE_DELAY_MS="2000"
+OCFS2_RECONNECT_DELAY_MS="2000"
+# How often we should attempt to send heartbeats.
+# How many interations before a node is considered dead from lack of IO activity.
+# (dead_threshold - 1) * 2s
+OCFS2_DEAD_THRESHOLD="61"
+
+# Default: "-fy" (force check on double-unmounted boot). I beleave this is best.
+# Native way is "-y", but once I have twice reboot/powerOFF with bad result...
+# Affected only fstab.
+OCFS2_FSCK="-fy"
+
+# http://oss.oracle.com/projects/ocfs2-tools/news/article_8.html
+# starting from 1.4.3, fsck.ocfs2 "aggressively cache the metadata blocks"
+# this is useful on lots of free memory, but I have heavy slowdown on x86_64
+# with 1G of RAM.
+# "yes" will "swapoff -a" & "swapon -a" around fsck to avoid caching over swap
+OCFS2_FSCK_SWAPOFF="yes"
+
+# Signal to kill processes on stop/umount on busy device (empty to not kill)
+#OCFS2_UMOUNT_KILL="KILL"
+
+# "yes" to force stop
+#OCFS2_FORCE_STOP="no"
diff --git a/sys-fs/ocfs2-tools/files/ocfs2.initd b/sys-fs/ocfs2-tools/files/ocfs2.initd
new file mode 100644
index 000000000000..e5c091ee04c7
--- /dev/null
+++ b/sys-fs/ocfs2-tools/files/ocfs2.initd
@@ -0,0 +1,125 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net localmount
+ before netmount
+}
+
+check_modules_config() {
+ local MODULES=$1
+ local CONFIGS=$2
+ local MODULE
+ local retval=0
+
+ for MODULE in ${MODULES}; do
+ if ! ls -1 /sys/module | egrep -q "^${MODULE}$"; then
+ retval=1
+ fi
+ done
+ if [ ${retval} -eq 1 ] && [ -e /proc/config.gz ]; then
+ retval=0
+ for MODULE in ${CONFIGS}; do
+ if ! gzip -dc /proc/config.gz | egrep -q "^CONFIG_${MODULE}=y$"; then
+ retval=1
+ fi
+ done
+ fi
+ return ${retval}
+}
+
+check_modules() {
+ check_modules_config "ocfs2_dlmfs ocfs2 ocfs2_dlm ocfs2_nodemanager" "OCFS2_FS OCFS2_FS_O2CB" && check_modules_config configfs CONFIGFS_FS && return 0
+ if ! egrep -q '\s*ocfs2\s*$' /proc/filesystems || ! egrep -q '\s*ocfs2_dlmfs\s*$' /proc/filesystems; then
+ ewarn "One or more required modules are not loaded."
+ ewarn "Make sure you have "
+ ewarn " - placed ocfs, dlmfs and configfs into /etc/modules.autoload.d/kernel-2.6 or built directly into the kernel."
+ ewarn "For a (in)complete documentation, read /usr/share/doc/ocfs-<version>/INSTALL.GENTOO.bz2"
+ fi
+ return 1
+}
+
+check_pseudofs() {
+ local retval=0
+ local HASMOUNT="mount -l -t"
+ if [ -z "`${HASMOUNT} configfs`" ] ; then
+ retval=1
+ fi
+ if [ -z "`${HASMOUNT} ocfs2_dlmfs`" ] ; then
+ retval=1
+ fi
+
+ if [ ${retval} -eq 1 ]; then
+ ewarn "One or more pseudo-filesystes are not mounted."
+ ewarn "Make sure you have following lines in your /etc/fstab:"
+ ewarn "none /sys/kernel/config configfs defaults 0 0"
+ ewarn "none /sys/kernel/dlm ocfs2_dlmfs defaults 0 0"
+ fi
+ return ${retval}
+}
+
+
+
+start() {
+ check_modules || return $?
+ check_pseudofs || return $?
+
+ einfo "Starting OCFS2 cluster"
+ for cluster in ${OCFS2_CLUSTER}; do
+ ebegin " - ${cluster}"
+ /sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=yes >/dev/null 2>&1
+ eend $?
+
+ # Some heartbeat tweaks to prevent self-fencing quite so much during heavy load.
+ # http://oss.oracle.com/projects/ocfs2/dist/documentation/ocfs2_faq.html
+
+ # How long to wait before a node is considered dead from lack of network activity.
+ echo $OCFS2_IDLE_TIMEOUT_MS > /sys/kernel/config/cluster/${cluster}/idle_timeout_ms
+ # How often we should attempt to send heartbeats.
+ echo $OCFS2_KEEPALIVE_DELAY_MS > /sys/kernel/config/cluster/${cluster}/keepalive_delay_ms
+ echo $OCFS2_RECONNECT_DELAY_MS > /sys/kernel/config/cluster/${cluster}/reconnect_delay_ms
+ # How many interations before a node is considered dead from lack of IO activity.
+ # (dead_threshold - 1) * 2s
+ echo $OCFS2_DEAD_THRESHOLD > /sys/kernel/config/cluster/${cluster}/heartbeat/dead_threshold
+ done
+ sleep 2
+}
+
+stop() {
+ # Shamelesly stolen from netmount
+ local ret
+ ebegin "Unmounting OCFS2 filesystems"
+ [ -z "$(umount -art ocfs2 2>&1)" ]
+ ret=$?
+ eend ${ret} "Failed to simply unmount filesystems"
+ [ ${ret} -eq 0 ] && return 0
+
+ declare -a siglist=( "TERM" "KILL" "KILL" )
+ local retry=0
+ local remaining="go"
+
+ while [ -n "${remaining}" -a ${retry} -lt 3 ]
+ do
+ remaining="$(awk '$3 ~ /'ocfs2'/ { if ($2 != "/") print $2 }' /proc/mounts | sort -r)"
+ IFS=$'\n'
+ set -- ${remaining//\\040/ }
+ unset IFS
+ [ -z "${remaining}" ] && break
+
+ ebegin $'\t'"Unmounting ocfs2 filesystems (retry #$((retry+1)))"
+ /bin/fuser -k -${siglist[$((retry++))]} -m "$@" &>/dev/null
+ sleep 5
+ umount "$@" &>/dev/null
+ eend $? $'\t'"Failed to unmount filesystems"
+ done
+
+
+ einfo "Stopping OCFS2 cluster"
+ for cluster in ${OCFS_CLUSTERS}; do
+ ebegin " - ${cluster}"
+ /sbin/o2cb_ctl -H -n ${cluster} -t cluster -a online=no >/dev/null 2>&1
+ eend $?
+ done
+}
diff --git a/sys-fs/ocfs2-tools/metadata.xml b/sys-fs/ocfs2-tools/metadata.xml
new file mode 100644
index 000000000000..8c121b2e4919
--- /dev/null
+++ b/sys-fs/ocfs2-tools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<use>
+ <flag name='external'>Enable external locking</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r1.ebuild b/sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r1.ebuild
new file mode 100644
index 000000000000..05c673da5155
--- /dev/null
+++ b/sys-fs/ocfs2-tools/ocfs2-tools-1.8.2-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+PYTHON_DEPEND="gtk? 2"
+inherit autotools eutils python
+
+DESCRIPTION="Support programs for the Oracle Cluster Filesystem 2"
+HOMEPAGE="http://oss.oracle.com/projects/ocfs2-tools/"
+SRC_URI="http://dev.gentoo.org/~alexxy/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug external gtk"
+
+RDEPEND="
+ dev-libs/libaio
+ sys-apps/util-linux
+ sys-cluster/libcman
+ external? (
+ sys-cluster/libdlm
+ sys-cluster/pacemaker[-heartbeat]
+ )
+ sys-fs/e2fsprogs
+ sys-libs/ncurses
+ sys-libs/readline
+ sys-process/psmisc
+ gtk? (
+ dev-python/pygtk
+ )
+"
+# 99% of deps this thing has is automagic
+# specialy cluster things corosync/pacemaker
+DEPEND="${RDEPEND}"
+
+DOCS=(
+ "${S}/documentation/samples/cluster.conf"
+ "${S}/documentation/users_guide.txt"
+)
+
+MAKEOPTS+=" -j1"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.6.4-asneeded.patch"
+ "${FILESDIR}/${PN}-recent-kernels.patch"
+ )
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ sed -e 's/ncurses, tgetstr/ncurses, printw/g' -i configure.in || die
+ # gentoo uses /sys/kernel/dlm as dlmfs mountpoint
+ sed -e 's:"/dlm/":"/sys/kernel/dlm":g' \
+ -i libo2dlm/o2dlm_test.c \
+ -i libocfs2/dlm.c || die "sed failed"
+ epatch ${PATCHES[@]}
+ rm -f aclocal.m4
+ AT_M4DIR=. eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug debug) \
+ $(use_enable debug debugexe) \
+ $(use_enable gtk ocfs2console) \
+ --enable-dynamic-fsck \
+ --enable-dynamic-ctl
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}/ocfs2.initd" ocfs2
+ newconfd "${FILESDIR}/ocfs2.confd" ocfs2
+}
diff --git a/sys-fs/owfs/Manifest b/sys-fs/owfs/Manifest
new file mode 100644
index 000000000000..c70827c67099
--- /dev/null
+++ b/sys-fs/owfs/Manifest
@@ -0,0 +1 @@
+DIST owfs-2.7p21.tar.gz 1247466 SHA256 070a3368e9400e900618f8a704f487baf3671f6764715b4de04b151c66d3306d SHA512 ec6d372d32ebf59278c2c68d5fbed42664f52bc1702f4ea8e5506457594943413e37801d341102029cb48a9d8c3d6b3d68615a1dd517c93aa0a475a1bb06c4cf WHIRLPOOL 31901ae07a7431a368cdb4fa0a30a1885da29f55187dc601b53f2e9ebf4e11aba73de93d7f6308671ecb3afa8433548b41a2e79a9a0cc4771adee93a5a6a1ddd
diff --git a/sys-fs/owfs/files/owfs-vendordir.patch b/sys-fs/owfs/files/owfs-vendordir.patch
new file mode 100644
index 000000000000..ac09e4f2fc79
--- /dev/null
+++ b/sys-fs/owfs/files/owfs-vendordir.patch
@@ -0,0 +1,30 @@
+diff -ruN owfs-2.7p21.orig/module/ownet/perl5/Makefile.am owfs-2.7p21/module/ownet/perl5/Makefile.am
+--- owfs-2.7p21.orig/module/ownet/perl5/Makefile.am 2008-06-12 16:24:30.000000000 +0200
++++ owfs-2.7p21/module/ownet/perl5/Makefile.am 2012-05-20 15:45:07.340529762 +0200
+@@ -7,9 +7,9 @@
+ # Can't really install the perl-modules under prefix-directory.. it should be site-global.
+ OWNet/Makefile: OWNet/Makefile.PL
+ if HAVE_DEBIAN
+- ( cd OWNet; $(PERL) Makefile.PL PREFIX=@prefix@ )
++ ( cd OWNet; $(PERL) Makefile.PL PREFIX=@prefix@ INSTALLDIRS=vendor )
+ else
+- ( cd OWNet; $(PERL) Makefile.PL )
++ ( cd OWNet; $(PERL) Makefile.PL INSTALLDIRS=vendor )
+ endif
+
+ install-data-local: OWNet/Makefile
+diff -ruN owfs-2.7p21.orig/module/swig/perl5/Makefile.am owfs-2.7p21/module/swig/perl5/Makefile.am
+--- owfs-2.7p21.orig/module/swig/perl5/Makefile.am 2008-06-12 16:24:30.000000000 +0200
++++ owfs-2.7p21/module/swig/perl5/Makefile.am 2012-05-20 15:44:04.519526274 +0200
+@@ -17,9 +17,9 @@
+ ( cd OW; $(PERL) Makefile.PL )
+ else
+ if HAVE_DEBIAN
+- ( cd OW; $(PERL) Makefile.PL PREFIX=@prefix@ )
++ ( cd OW; $(PERL) Makefile.PL PREFIX=@prefix@ INSTALLDIRS=vendor )
+ else
+- ( cd OW; $(PERL) Makefile.PL )
++ ( cd OW; $(PERL) Makefile.PL INSTALLDIRS=vendor )
+ endif
+ endif
+
diff --git a/sys-fs/owfs/files/owfs.confd b/sys-fs/owfs/files/owfs.confd
new file mode 100644
index 000000000000..f85d25e74f22
--- /dev/null
+++ b/sys-fs/owfs/files/owfs.confd
@@ -0,0 +1,2 @@
+# owfs configuration
+OWFS_OPTS="-m /var/lib/owfs/mnt --allow_other -s 127.0.0.1:4304"
diff --git a/sys-fs/owfs/files/owfs.initd b/sys-fs/owfs/files/owfs.initd
new file mode 100755
index 000000000000..7ed8a51bea1a
--- /dev/null
+++ b/sys-fs/owfs/files/owfs.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+INSTANCE=${SVCNAME#*.}
+PROGRAM=${SVCNAME%%.*}
+PIDFILE=${PIDFILE:-/var/run/owfs/${PROGRAM}.pid}
+OWUID=${OWUID:-owfs}
+OWGID=${OWGID:-owfs}
+
+depend() {
+ need net
+ use logger owserver
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -c ${OWUID}:${OWGID} -- \
+ --pid_file ${PIDFILE} \
+ --background --error_print 1 \
+ ${OWFS_OPTS:--m /var/lib/owfs/mnt --allow_other -s 127.0.0.1:4304}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -u ${OWUID}
+ eend $?
+}
diff --git a/sys-fs/owfs/files/owftpd.confd b/sys-fs/owfs/files/owftpd.confd
new file mode 100644
index 000000000000..fc93d2fd7195
--- /dev/null
+++ b/sys-fs/owfs/files/owftpd.confd
@@ -0,0 +1,2 @@
+# owfs owftpd configuration
+OWFTPD_OPTS="--nozero -p 127.0.0.1:4381 -s 127.0.0.1:4304 --max_clients 5 --timeout_ftp 600"
diff --git a/sys-fs/owfs/files/owftpd.initd b/sys-fs/owfs/files/owftpd.initd
new file mode 100755
index 000000000000..eae2782f92f3
--- /dev/null
+++ b/sys-fs/owfs/files/owftpd.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+INSTANCE=${SVCNAME#*.}
+PROGRAM=${SVCNAME%%.*}
+PIDFILE=${PIDFILE:-/var/run/owfs/${PROGRAM}.pid}
+OWUID=${OWUID:-owfs}
+OWGID=${OWGID:-owfs}
+
+depend() {
+ need net
+ use logger owserver
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -c ${OWUID}:${OWGID} -- \
+ --pid_file ${PIDFILE} \
+ --background --error_print 1 \
+ ${OWFTPD_OPTS:---nozero -p 127.0.0.1:4381 -s 127.0.0.1:4304 --max_clients 5 --timeout_ftp 600}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -u ${OWUID}
+ eend $?
+}
diff --git a/sys-fs/owfs/files/owhttpd.confd b/sys-fs/owfs/files/owhttpd.confd
new file mode 100644
index 000000000000..2a5200c31118
--- /dev/null
+++ b/sys-fs/owfs/files/owhttpd.confd
@@ -0,0 +1,2 @@
+# owfs owhttpd configuration
+OWHTTPD_OPTS="--nozero -p 127.0.0.1:4380 -s 127.0.0.1:4304"
diff --git a/sys-fs/owfs/files/owhttpd.initd b/sys-fs/owfs/files/owhttpd.initd
new file mode 100755
index 000000000000..a05f5dce295a
--- /dev/null
+++ b/sys-fs/owfs/files/owhttpd.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+INSTANCE=${SVCNAME#*.}
+PROGRAM=${SVCNAME%%.*}
+PIDFILE=${PIDFILE:-/var/run/owfs/${PROGRAM}.pid}
+OWUID=${OWUID:-owfs}
+OWGID=${OWGID:-owfs}
+
+depend() {
+ need net
+ use logger owserver
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -c ${OWUID}:${OWGID} -- \
+ --pid_file ${PIDFILE} \
+ --background --error_print 1 \
+ ${OWHTTPD_OPTS:---nozero -p 127.0.0.1:4380 -s 127.0.0.1:4304}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -u ${OWUID}
+ eend $?
+}
diff --git a/sys-fs/owfs/files/owserver.confd b/sys-fs/owfs/files/owserver.confd
new file mode 100644
index 000000000000..e764e2df10ec
--- /dev/null
+++ b/sys-fs/owfs/files/owserver.confd
@@ -0,0 +1,2 @@
+# owfs owserver configuration
+OWSERVER_OPTS="--nozero -p 127.0.0.1:4304 -d /dev/ttyS0 --timeout_volatile 5"
diff --git a/sys-fs/owfs/files/owserver.initd b/sys-fs/owfs/files/owserver.initd
new file mode 100755
index 000000000000..0ddfbd2f81c9
--- /dev/null
+++ b/sys-fs/owfs/files/owserver.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+INSTANCE=${SVCNAME#*.}
+PROGRAM=${SVCNAME%%.*}
+PIDFILE=${PIDFILE:-/var/run/owfs/${PROGRAM}.pid}
+OWUID=${OWUID:-owfs}
+OWGID=${OWGID:-owfs}
+
+depend() {
+ need net
+ use logger
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -c ${OWUID}:${OWGID} -- \
+ --pid_file ${PIDFILE} \
+ --background --error_print 1 \
+ ${OWSERVER_OPTS:---nozero -p 127.0.0.1:4304 -d /dev/ttyS0}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/bin/${PROGRAM} \
+ --pidfile ${PIDFILE} -u ${OWUID}
+ eend $?
+}
diff --git a/sys-fs/owfs/metadata.xml b/sys-fs/owfs/metadata.xml
new file mode 100644
index 000000000000..f7c7df462bdd
--- /dev/null
+++ b/sys-fs/owfs/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+OWFS (One Wire File System) is an easy way to use the powerful 1-wire system
+of Dallas/Maxim. A simple and flexible program to monitor and control the
+physical environment. You can write scripts to read temperature, flash
+lights, write to an LCD, log and graph, ...
+</longdescription>
+ <use>
+ <flag name="ftpd">Enable building the OWFS FTP server (owftpd)</flag>
+ <flag name="fuse">Enable building the FUSE-based OWFS client (owfs)</flag>
+ <flag name="httpd">Enable building the OWFS web server (owhttpd)</flag>
+ <flag name="parport">Enable support for the DS1410E parallel port
+ adapter</flag>
+ <flag name="server">Enable building the OWFS server (owserver)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">owfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/owfs/owfs-2.7_p21-r4.ebuild b/sys-fs/owfs/owfs-2.7_p21-r4.ebuild
new file mode 100644
index 000000000000..ae0371c324c4
--- /dev/null
+++ b/sys-fs/owfs/owfs-2.7_p21-r4.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+DISTUTILS_OPTIONAL=1
+
+inherit distutils-r1 eutils perl-module autotools user
+
+MY_P=${P/_/}
+
+DESCRIPTION="Access 1-Wire devices like a filesystem"
+SRC_URI="mirror://sourceforge/owfs/${MY_P}.tar.gz"
+HOMEPAGE="http://www.owfs.org/ http://owfs.sourceforge.net/"
+
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+LICENSE="GPL-2"
+
+RDEPEND="
+ fuse? ( sys-fs/fuse )
+ perl? ( dev-lang/perl )
+ php? ( dev-lang/php:=[cli] )
+ python? ( ${PYTHON_DEPS} )
+ tcl? ( dev-lang/tcl:0= )
+ usb? ( virtual/libusb:0 )
+ zeroconf? ( net-dns/avahi[mdnsresponder-compat] )"
+
+DEPEND="${RDEPEND}
+ perl? ( dev-lang/swig )
+ php? ( dev-lang/swig )
+ python? ( dev-lang/swig )"
+
+IUSE="debug fuse ftpd httpd parport perl php python server tcl usb zeroconf"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+OWUID=${OWUID:-owfs}
+OWGID=${OWGID:-owfs}
+
+pkg_setup() {
+ enewgroup ${OWGID} 150
+ enewuser ${OWUID} 150 -1 -1 ${OWGID}
+}
+
+src_prepare() {
+ # Support user's CFLAGS and LDFLAGS.
+ sed -i "s/@CPPFLAGS@/@CPPFLAGS@ ${CFLAGS}/" \
+ module/swig/perl5/OW/Makefile.linux.in || die
+ sed -i "s/@LIBS@/@LIBS@ ${LDFLAGS}/" \
+ module/swig/perl5/OW/Makefile.linux.in || die
+
+ epatch "${FILESDIR}/${PN}-vendordir.patch"
+
+ eautoreconf
+}
+
+src_configure() {
+ # disable owpython since we can build python anyway
+ # and without it, we don't have to fix the build ;)
+ econf \
+ $(use_enable debug) \
+ $(use_enable fuse owfs) \
+ $(use_enable ftpd owftpd) \
+ $(use_enable httpd owhttpd) \
+ $(use_enable parport) \
+ $(use_enable perl owperl) \
+ $(use_enable php owphp) \
+ --disable-owpython \
+ $(use_enable server owserver) \
+ $(use_enable tcl owtcl) \
+ $(use_enable zeroconf zero) \
+ $(use_enable usb)
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ local CFLAGS="${CFLAGS} -fno-strict-aliasing"
+
+ pushd module/ownet/python > /dev/null || die
+ distutils-r1_src_compile
+ popd > /dev/null || die
+
+ pushd module/swig/python > /dev/null || die
+ emake ow_wrap.c
+ distutils-r1_src_compile
+ popd > /dev/null || die
+ fi
+}
+
+src_test() { :; }
+
+src_install() {
+ default
+
+ if use server || use httpd || use ftpd || use fuse; then
+ diropts -m 0750 -o ${OWUID} -g ${OWGID}
+ dodir /var/run/owfs
+
+ for i in server httpd ftpd; do
+ if use ${i}; then
+ newinitd "${FILESDIR}"/ow${i}.initd ow${i}
+ newconfd "${FILESDIR}"/ow${i}.confd ow${i}
+ fi
+ done
+
+ if use fuse; then
+ dodir /var/lib/owfs
+ dodir /var/lib/owfs/mnt
+ newinitd "${FILESDIR}"/owfs.initd owfs
+ newconfd "${FILESDIR}"/owfs.confd owfs
+ fi
+ fi
+ use perl && perl_delete_localpod
+
+ if use python; then
+ pushd module/ownet/python > /dev/null || die
+ distutils-r1_src_install
+ popd > /dev/null || die
+
+ pushd module/swig/python > /dev/null || die
+ distutils-r1_src_install
+ popd > /dev/null || die
+ fi
+}
+
+pkg_postinst() {
+ if use server || use httpd || use ftpd || use fuse; then
+ echo
+ einfo
+ einfo "Be sure to check/edit the following files,"
+ einfo "e.g. to fit your 1 wire bus controller"
+ einfo "device or daemon network settings:"
+ for i in server httpd ftpd; do
+ if use ${i}; then
+ einfo "- ${ROOT%/}/etc/conf.d/ow${i}"
+ fi
+ done
+ if use fuse; then
+ einfo "- ${ROOT%/}/etc/conf.d/owfs"
+ fi
+ einfo
+ echo
+ if [[ ${OWUID} != root ]]; then
+ ewarn
+ ewarn "In order to allow the OWFS daemon user '${OWUID}' to read"
+ ewarn "from and/or write to a 1 wire bus controller device, make"
+ ewarn "sure the user has appropriate permission to access the"
+ ewarn "corresponding device node/path (e.g. /dev/ttyS0), for example"
+ ewarn "by adding the user to the group 'uucp' (for serial devices)"
+ ewarn "or 'usb' (for USB devices accessed via usbfs on /proc/bus/usb)."
+ ewarn
+ if use fuse; then
+ ewarn "In order to allow regular users to read from and/or write to"
+ ewarn "1 wire bus devices accessible via the owfs FUSE filesystem"
+ ewarn "client and its filesystem mountpoint, make sure the user is"
+ ewarn "a member of the group '${OWGID}'."
+ ewarn
+ fi
+ echo
+ fi
+ fi
+}
diff --git a/sys-fs/progsreiserfs/Manifest b/sys-fs/progsreiserfs/Manifest
new file mode 100644
index 000000000000..661fbbdbc4a4
--- /dev/null
+++ b/sys-fs/progsreiserfs/Manifest
@@ -0,0 +1 @@
+DIST progsreiserfs-0.3.1-rc8.tar.gz 399279 SHA256 1473899a21df0679a32ebde5a35c158468a7e51a0cb6fd89d77c42bfde9b6399 SHA512 65266ab5a598b2073e6893da6554bdfe43796be3bd608eb7c4f687c3ef6ed395ce67def49b62d2b3705dfdeb38bd5f5d1c91fec6ad7323788d490058b015c26d WHIRLPOOL 2afe87ef74d7bbbd012b5dd141663291222e8bf22ae318ac217e38f0af90f7524beb15362ebbc001f3998f14a555b10586e09a5cb412c105dce6b791cd2ee2fa
diff --git a/sys-fs/progsreiserfs/files/progsreiserfs-0.3.1_rc8-autotools.patch b/sys-fs/progsreiserfs/files/progsreiserfs-0.3.1_rc8-autotools.patch
new file mode 100644
index 000000000000..4a0753f4f09b
--- /dev/null
+++ b/sys-fs/progsreiserfs/files/progsreiserfs-0.3.1_rc8-autotools.patch
@@ -0,0 +1,13 @@
+http://bugs.gentoo.org/442226
+
+--- progsreiserfs.m4
++++ progsreiserfs.m4
+@@ -10,7 +10,7 @@
+ dnl Adds the required libraries to $REISERFS_LIBS and does an
+ dnl AC_SUBST(REISERFS_LIBS)
+
+-AC_DEFUN(AC_CHECK_LIBREISERFS,
++AC_DEFUN([AC_CHECK_LIBREISERFS],
+ [
+
+ dnl save LIBS
diff --git a/sys-fs/progsreiserfs/metadata.xml b/sys-fs/progsreiserfs/metadata.xml
new file mode 100644
index 000000000000..07c910b18ad9
--- /dev/null
+++ b/sys-fs/progsreiserfs/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+ <description>Maintainer as part of base-system work. Assign bugs to base-system.</description>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-fs/progsreiserfs/progsreiserfs-0.3.1_rc8.ebuild b/sys-fs/progsreiserfs/progsreiserfs-0.3.1_rc8.ebuild
new file mode 100644
index 000000000000..a699539e568f
--- /dev/null
+++ b/sys-fs/progsreiserfs/progsreiserfs-0.3.1_rc8.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic libtool
+
+MY_P=${PN}-${PV/_/-}
+
+DESCRIPTION="Library for accessing and manipulating reiserfs partitions"
+HOMEPAGE="http://reiserfs.linux.kiev.ua/"
+SRC_URI="http://reiserfs.linux.kiev.ua/snapshots/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ppc ~ppc64 ~sparc x86"
+IUSE="debug examples nls static-libs"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ sys-apps/util-linux
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-autotools.patch
+
+ elibtoolize
+}
+
+src_configure() {
+ filter-lfs-flags
+
+ econf \
+ $(use_enable static-libs static) \
+ --disable-Werror \
+ $(use_enable nls) \
+ $(use_enable debug)
+}
+
+src_install() {
+ default
+
+ if use examples; then
+ docinto examples
+ dodoc demos/*.c
+ fi
+
+ rm -r "${ED}"/usr/{sbin,share/man} || die
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ ewarn "progsreiserfs has been proven dangerous in the past, generating bad"
+ ewarn "partitions and destroying data on resize/cpfs operations."
+ ewarn "Because of this, we do NOT provide their binaries, but only their"
+ ewarn "libraries instead, as these are needed for other applications."
+}
diff --git a/sys-fs/pysize/Manifest b/sys-fs/pysize/Manifest
new file mode 100644
index 000000000000..72969f7d92e8
--- /dev/null
+++ b/sys-fs/pysize/Manifest
@@ -0,0 +1 @@
+DIST pysize-0.2.tar.bz2 498930 SHA256 1b0aea834bb5a9a15b7fe9680d5618adeb58242bdf14fac218498ee49d4b3bf5 SHA512 621e6e8de75d3486c196cf59e29f1c01eca151139a1d8518ace334d92533dd2df19fce52a3362c3b8abbb1e3b244148609a081832ae53f91bccc65f5f7fa57a5 WHIRLPOOL 7dbfdc12a7a0835439d6626334eb0c1af954dc0aa4f21c2ab0d472e2a8aedaccf1ba8a91a9640da40e0a070cac6d6c5f721a5b5a2bbd89c441324450c313df0c
diff --git a/sys-fs/pysize/files/0.2-setuptools-automagic.patch b/sys-fs/pysize/files/0.2-setuptools-automagic.patch
new file mode 100644
index 000000000000..3e27c889f1a5
--- /dev/null
+++ b/sys-fs/pysize/files/0.2-setuptools-automagic.patch
@@ -0,0 +1,12 @@
+diff --git a/setup.py b/setup.py
+index 5550188..123d22c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -2,7 +2,6 @@
+
+ import sys
+
+-sys.path.append('setuptools-0.7a1dev_r53614-py2.4.egg')
+ from setuptools import setup, find_packages
+ from pysize.version import VERSION
+
diff --git a/sys-fs/pysize/files/psyco-0.2-automagic.patch b/sys-fs/pysize/files/psyco-0.2-automagic.patch
new file mode 100644
index 000000000000..696f81fa4feb
--- /dev/null
+++ b/sys-fs/pysize/files/psyco-0.2-automagic.patch
@@ -0,0 +1,20 @@
+--- pysize/main.py 2007-03-11 16:09:53.000000000 +0100
++++ pysize/main.py.new 2009-01-02 00:08:43.384827054 +0100
+@@ -69,17 +69,8 @@
+ stats.print_stats(40)
+ os.remove(prof_file)
+
+-def _try_psyco():
+- try:
+- # Try to use psyco if available
+- import psyco
+- psyco.full()
+- except ImportError:
+- pass
+-
+ def main():
+ install_sigquit_traceback()
+- _try_psyco()
+ locale.setlocale(locale.LC_ALL, '')
+ usage = '%s [OPTIONS] [DIRECTORIES...]' % (sys.argv[0])
+ parser = optparse.OptionParser(usage=usage, version='pysize ' + VERSION)
diff --git a/sys-fs/pysize/metadata.xml b/sys-fs/pysize/metadata.xml
new file mode 100644
index 000000000000..4a00a64b40ae
--- /dev/null
+++ b/sys-fs/pysize/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/pysize/pysize-0.2-r1.ebuild b/sys-fs/pysize/pysize-0.2-r1.ebuild
new file mode 100644
index 000000000000..e5966b3edc58
--- /dev/null
+++ b/sys-fs/pysize/pysize-0.2-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="A graphical and console tool for exploring the size of directories"
+HOMEPAGE="http://guichaz.free.fr/pysize/"
+SRC_URI="http://guichaz.free.fr/${PN}/files/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
+IUSE="gtk ncurses"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ gtk? ( dev-python/pygtk:2 )
+ ncurses? ( sys-libs/ncurses )"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+
+PATCHES=(
+ "${FILESDIR}"/psyco-${PV}-automagic.patch
+ "${FILESDIR}"/${PV}-setuptools-automagic.patch
+ )
+
+DISTUTILS_NO_PARALLEL_BUILD=1
+
+python_prepare_all() {
+ if ! use gtk; then
+ sed \
+ -e '/^from pysize.ui.gtk/d' \
+ -e "s~'gtk': ui_gtk.run,~~g" \
+ -e 's:ui_gtk.run,::g' \
+ -i pysize/main.py || die "Failed to remove gtk support"
+ rm -rf pysize/ui/gtk || die "Failed to remove gtk support"
+ fi
+
+ if ! use ncurses; then
+ sed \
+ -e '/^from pysize.ui.curses/d' \
+ -e "s~'curses': ui_curses.run,~~g" \
+ -e 's:ui_curses.run,::g' \
+ -i pysize/main.py || die "Failed to remove ncurses support"
+ rm -rf pysize/ui/curses || die "Failed to remove ncurses support"
+ fi
+
+ sed \
+ -e '/for ui_run in/s:ui_ascii.run:ui_ascii.run, ui_ascii.run:g' \
+ -i pysize/main.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+src_test() {
+ # Tests shatter otherwise
+ local DISTUTILS_NO_PARALLEL_BUILD=1
+ distutils-r1_src_test
+}
+
+python_test() {
+ pushd "${S}"/tests > /dev/null
+ PYTHONPATH=.:../ "${PYTHON}" pysize_tests.py || die "tests failed under ${EPYTHON}"
+ popd > /dev/null
+}
diff --git a/sys-fs/pytagsfs/Manifest b/sys-fs/pytagsfs/Manifest
new file mode 100644
index 000000000000..b61fd20931db
--- /dev/null
+++ b/sys-fs/pytagsfs/Manifest
@@ -0,0 +1,2 @@
+DIST pytagsfs-0.9.2.tar.gz 221155 SHA256 8b4e8e50432e8fe5b0c7bca62540f946ecfb606d07eb5ad0a9aeb28d9017635c
+DIST pytagsfs-0.9.2rc2.tar.gz 221043 SHA256 5916c5cb7a8cdb4e9cfe0dd51e5f55fa8031b72edd923f38382995776d78d4ed
diff --git a/sys-fs/pytagsfs/metadata.xml b/sys-fs/pytagsfs/metadata.xml
new file mode 100644
index 000000000000..2aad73845219
--- /dev/null
+++ b/sys-fs/pytagsfs/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>sping@gentoo.org</email>
+ <name>Sebastian Pipping</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">pytagsfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/pytagsfs/pytagsfs-0.9.2.ebuild b/sys-fs/pytagsfs/pytagsfs-0.9.2.ebuild
new file mode 100644
index 000000000000..8d948d285dab
--- /dev/null
+++ b/sys-fs/pytagsfs/pytagsfs-0.9.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+PYTHON_DEPEND="2:2.5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.4 3.* *-jython 2.7-pypy-*"
+DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1"
+DISTUTILS_SRC_TEST="setup.py"
+
+inherit distutils
+
+MY_PV="${PV/_/}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="File system that arranges media files based their tags"
+HOMEPAGE="https://launchpad.net/pytagsfs"
+SRC_URI="http://www.alittletooquiet.net/media/release/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+S="${WORKDIR}/${MY_P}"
+
+RDEPEND=">=dev-python/fuse-python-0.2-r1
+ >=dev-python/sclapp-0.5.2
+ || ( dev-python/inotifyx
+ ( dev-libs/libgamin[python]
+ app-admin/gam-server ) )
+ media-libs/mutagen"
+DEPEND="${RDEPEND}
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ test? ( dev-python/inotifyx
+ dev-libs/libgamin[python]
+ app-admin/gam-server
+ media-sound/madplay
+ media-sound/vorbis-tools
+ media-libs/flac )"
diff --git a/sys-fs/pytagsfs/pytagsfs-0.9.2_rc2.ebuild b/sys-fs/pytagsfs/pytagsfs-0.9.2_rc2.ebuild
new file mode 100644
index 000000000000..58f6891fbb45
--- /dev/null
+++ b/sys-fs/pytagsfs/pytagsfs-0.9.2_rc2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+PYTHON_DEPEND="2:2.5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.4 3.* 2.7-pypy-* *-jython"
+DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1"
+DISTUTILS_SRC_TEST="setup.py"
+
+inherit distutils
+
+MY_PV="${PV/_/}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="File system that arranges media files based their tags"
+HOMEPAGE="https://launchpad.net/pytagsfs"
+SRC_URI="http://www.alittletooquiet.net/media/release/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+S="${WORKDIR}/${MY_P}"
+
+RDEPEND="dev-python/fuse-python
+ >=dev-python/sclapp-0.5.2
+ || ( dev-python/inotifyx
+ ( dev-libs/libgamin[python]
+ app-admin/gam-server ) )
+ media-libs/mutagen"
+DEPEND="${RDEPEND}
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ test? ( dev-python/inotifyx
+ dev-libs/libgamin[python]
+ app-admin/gam-server
+ media-sound/madplay
+ media-sound/vorbis-tools
+ media-libs/flac )"
diff --git a/sys-fs/quota/Manifest b/sys-fs/quota/Manifest
new file mode 100644
index 000000000000..6d6fede09c3d
--- /dev/null
+++ b/sys-fs/quota/Manifest
@@ -0,0 +1,3 @@
+DIST quota-3.17.tar.gz 439168 SHA256 253320993bb132814c724ca268a6346368be41846ad600f65ee4232ec8597d6f SHA512 7d200862f5ebee024295352289d940a1b728cb017e7c2c4f422a5a98d58ba8f62130640a4c08bdec02f94ea0f4abe146fb494c039b43021fd410ec17fd32b238 WHIRLPOOL e334f22a7c2f8097a2f7145217d1cf134a135a1b6705470121e3a9c0492d59677508bfaa06bcb4eecb9992491910f5b29068e005cafb5086df39da591e375613
+DIST quota-4.01.tar.gz 458123 SHA256 a36300bbc126b79b745bf937245092808b4585aa3309ef3335d4ab9d873cd206 SHA512 57f79efe7e538f3109d0e44e4f87388ec4e8134f34ba92a30acb5d223090e8fb0087dfc558a951facc7f9b4d2301b4e305b710576363c13f5e70b06c91194dda WHIRLPOOL ff4aba698fe067e33c7c4fcd2463d5b5b2f557e49d59cb98cceefb145a7e0d2ee371e411a6d8c4d51ddd28c102d34c95f03a733dac47dd52582ea4d31f102c31
+DIST quota-4.02.tar.gz 489289 SHA256 f4c2f48abf94bbdc396df33d276f2e9d19af58c232cb85eef9c174a747c33795 SHA512 547e08893b95928e5d183d29bee70d1932f85a675b96f64446e5a723d0759ad2d31223f8b6a5652cd698fce4907a15c294b91c18de32faddbef4975c9f22f2aa WHIRLPOOL eb102a14dfe780b7ed062c3c7abec1ef766beb31c18d92c5115ca703672ebb7e7bfb0479885c6c8c78520554aeb477bc1f4d48fbb76b0336047f42b55af49036
diff --git a/sys-fs/quota/files/quota-4.01-cflags.patch b/sys-fs/quota/files/quota-4.01-cflags.patch
new file mode 100644
index 000000000000..4e61855c29ad
--- /dev/null
+++ b/sys-fs/quota/files/quota-4.01-cflags.patch
@@ -0,0 +1,58 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Mon Apr 21 10:36:28 UTC 2014
+Subject: respect CFLAGS in linking command wrt #446281
+
+--- quota-tools/Makefile.in
++++ quota-tools/Makefile.in
+@@ -105,37 +105,47 @@
+ -$(INSTALL) -m $(DEF_MAN_MODE) *.8 $(ROOTDIR)$(mandir)/man8
+
+ quotaon: quotaon.o quotaon_xfs.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ quotacheck: quotacheck.o quotacheck_v1.o quotacheck_v2.o quotaops.o $(LIBOBJS)
+- $(CC) $(LDFLAGS) -o $@ $^ $(EXT2LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(EXT2LIBS)
+
+ quota: quota.o quotaops.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ quotasync: quotasync.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ quot: quot.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ repquota: repquota.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ warnquota: warnquota.o $(LIBOBJS)
+- $(CC) $(LDFLAGS) -o $@ $^ $(LDAPLIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDAPLIBS)
+
+ quotastats: quotastats.o common.o pot.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ xqmstats: xqmstats.o common.o pot.o
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ edquota: edquota.o quotaops.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ setquota: setquota.o quotaops.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ convertquota: convertquota.o $(LIBOBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+ rpc.rquotad: rquota_server.o rquota_svc.o svc_socket.o $(LIBOBJS)
+- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ ifneq ($(NETLINKLIBS),)
+ quota_nld: quota_nld.o $(LIBOBJS)
+- $(CC) $(LDFLAGS) -o $@ $^ $(NETLINKLIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(NETLINKLIBS)
+ endif
+
+ pot.o: pot.c pot.h
diff --git a/sys-fs/quota/files/quota-4.01-mnt.patch b/sys-fs/quota/files/quota-4.01-mnt.patch
new file mode 100644
index 000000000000..1aa1590accb8
--- /dev/null
+++ b/sys-fs/quota/files/quota-4.01-mnt.patch
@@ -0,0 +1,13 @@
+https://sourceforge.net/tracker/?func=detail&aid=3599717&group_id=18136&atid=318136
+
+--- a/quotasys.c
++++ b/quotasys.c
+@@ -642,7 +642,7 @@
+ die(2, _("Cannot initialize mountpoint scan.\n"));
+ while ((mnt = get_next_mount())) {
+ #ifndef RPC
+- if (nfs_fstype(mnt->mnt_type))
++ if (nfs_fstype(mnt->me_type))
+ continue;
+ #endif
+ if (fmt == -1 || count) {
diff --git a/sys-fs/quota/files/quota-no-quotactl-manpage.patch b/sys-fs/quota/files/quota-no-quotactl-manpage.patch
new file mode 100644
index 000000000000..bf0014d0459f
--- /dev/null
+++ b/sys-fs/quota/files/quota-no-quotactl-manpage.patch
@@ -0,0 +1,19 @@
+diff -urN quota-tools.orig/Makefile.in quota-tools/Makefile.in
+--- quota-tools.orig/Makefile.in 2003-04-08 06:04:25.000000000 -0700
++++ quota-tools/Makefile.in 2003-12-10 02:07:40.000000000 -0800
+@@ -88,7 +88,6 @@
+ -$(INSTALL) -m $(DEF_CONF_MODE) quotatab $(ROOTDIR)$(sysconfdir)
+ -$(INSTALL) -m $(DEF_CONF_MODE) quotagrpadmins $(ROOTDIR)$(sysconfdir)
+ -mkdir -p $(ROOTDIR)$(mandir)/man1
+- -mkdir -p $(ROOTDIR)$(mandir)/man2
+ -mkdir -p $(ROOTDIR)$(mandir)/man3
+ -mkdir -p $(ROOTDIR)$(mandir)/man8
+ -$(INSTALL) -m 755 -d $(ROOTDIR)$(includedir)/rpcsvc
+@@ -96,7 +95,6 @@
+ -$(INSTALL) -s -m $(DEF_SBIN_MODE) quota $(ROOTDIR)$(bindir)
+ -$(INSTALL) -s -m $(DEF_SBIN_MODE) rpc.rquotad $(ROOTDIR)$(sbindir)
+ -$(INSTALL) -m $(DEF_MAN_MODE) *.1 $(ROOTDIR)$(mandir)/man1
+- -$(INSTALL) -m $(DEF_MAN_MODE) *.2 $(ROOTDIR)$(mandir)/man2
+ -$(INSTALL) -m $(DEF_MAN_MODE) *.3 $(ROOTDIR)$(mandir)/man3
+ -$(INSTALL) -m $(DEF_MAN_MODE) *.8 $(ROOTDIR)$(mandir)/man8
+
diff --git a/sys-fs/quota/files/quota.confd b/sys-fs/quota/files/quota.confd
new file mode 100644
index 000000000000..6e66c88dda14
--- /dev/null
+++ b/sys-fs/quota/files/quota.confd
@@ -0,0 +1,20 @@
+# /etc/conf.d/quota: config file for /etc/init.d/quota
+
+# Note: if your console is hooked up to a serial terminal,
+# you prob want to drop the '-v' from the OPTS vars below.
+
+
+# Run quotacheck ?
+RUN_QUOTACHECK="yes"
+
+
+# Options for quotacheck
+QUOTACHECK_OPTS="-avug"
+
+
+# Options for quotaon
+QUOTAON_OPTS="-avug"
+
+
+# Options for quotaoff
+QUOTAOFF_OPTS="-avug"
diff --git a/sys-fs/quota/files/quota.rc7 b/sys-fs/quota/files/quota.rc7
new file mode 100644
index 000000000000..9ec5af028a92
--- /dev/null
+++ b/sys-fs/quota/files/quota.rc7
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Id$
+
+extra_started_commands="check"
+description_check="Running quotacheck with quota being offline"
+
+depend() {
+ need localmount
+ use portmap
+}
+
+start() {
+ if [ "${RUN_QUOTACHECK}" = "yes" ] ; then
+ ebegin "Checking quotas (may take a while)"
+ quotacheck ${QUOTACHECK_OPTS}
+ eend $?
+ fi
+
+ ebegin "Starting quota"
+ quotaon ${QUOTAON_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping quota"
+ quotaoff ${QUOTAOFF_OPTS}
+ eend $?
+}
+
+check() {
+ ebegin "Checking quota"
+ quotaoff ${QUOTAOFF_OPTS} && \
+ quotacheck ${QUOTACHECK_OPTS} && \
+ quotaon ${QUOTAON_OPTS}
+ eend $?
+}
diff --git a/sys-fs/quota/files/rpc.rquotad.initd b/sys-fs/quota/files/rpc.rquotad.initd
new file mode 100644
index 000000000000..60b4fbc338fd
--- /dev/null
+++ b/sys-fs/quota/files/rpc.rquotad.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+[ -e /etc/conf.d/nfs ] && source /etc/conf.d/nfs
+
+rpc_bin=/usr/sbin/rpc.rquotad
+
+depend() {
+ use ypbind net
+ need portmap
+ after quota
+}
+
+start() {
+ ebegin "Starting rpc.rquotad"
+ ${rpc_bin} ${OPTS_RPC_RQUOTAD}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping rpc.rquotad"
+ start-stop-daemon --stop --quiet --exec ${rpc_bin}
+ eend $?
+}
diff --git a/sys-fs/quota/metadata.xml b/sys-fs/quota/metadata.xml
new file mode 100644
index 000000000000..12e2a6c0b033
--- /dev/null
+++ b/sys-fs/quota/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <use>
+ <flag name="netlink">Compile daemon receiving quota messages via netlink</flag>
+ <flag name="rpc">Enable quota interaction via RPC</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">linuxquota</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/quota/quota-3.17-r1.ebuild b/sys-fs/quota/quota-3.17-r1.ebuild
new file mode 100644
index 000000000000..7a66895e2cf1
--- /dev/null
+++ b/sys-fs/quota/quota-3.17-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Linux quota tools"
+HOMEPAGE="http://sourceforge.net/projects/linuxquota/"
+SRC_URI="mirror://sourceforge/linuxquota/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="nls tcpd ldap rpc"
+
+RDEPEND="ldap? ( >=net-nds/openldap-2.3.35 )
+ tcpd? ( sys-apps/tcp-wrappers )
+ rpc? ( || ( net-nds/portmap net-nds/rpcbind ) )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/quota-tools
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # patch to prevent quotactl.2 manpage from being installed
+ # that page is provided by man-pages instead
+ epatch "${FILESDIR}"/${PN}-no-quotactl-manpage.patch
+
+ # This was for openldap-2.2 support before,
+ # Now we only support >=2.3
+ append-cppflags -DLDAP_DEPRECATED=0
+
+ sed -i -e "s:,LIBS=\"\$saved_LIBS=\":;LIBS=\"\$saved_LIBS\":" configure
+}
+
+src_compile() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable ldap ldapmail) \
+ $(use_enable rpc) \
+ $(use_enable rpc rpcsetquota) \
+ || die
+ emake || die
+}
+
+src_install() {
+ emake STRIP="" ROOTDIR="${D}" install || die
+ rm -r "${D}"/usr/include || die #70938
+
+ insinto /etc
+ insopts -m0644
+ doins warnquota.conf quotatab
+
+ ecvs_clean
+ dodoc doc/*
+ dodoc README.*
+ dodoc Changelog
+
+ newinitd "${FILESDIR}"/quota.rc7 quota
+ newconfd "${FILESDIR}"/quota.confd quota
+
+ if use rpc ; then
+ newinitd "${FILESDIR}"/rpc.rquotad.initd rpc.rquotad
+ else
+ rm -f "${D}"/usr/sbin/rpc.rquotad
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ insopts -m0644
+ doins ldap-scripts/quota.schema
+
+ exeinto /usr/share/quota/ldap-scripts
+ doexe ldap-scripts/*.pl
+ doexe ldap-scripts/edquota_editor
+ fi
+}
diff --git a/sys-fs/quota/quota-4.01.ebuild b/sys-fs/quota/quota-4.01.ebuild
new file mode 100644
index 000000000000..337bb861d791
--- /dev/null
+++ b/sys-fs/quota/quota-4.01.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Linux quota tools"
+HOMEPAGE="http://sourceforge.net/projects/linuxquota/"
+SRC_URI="mirror://sourceforge/linuxquota/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="ldap netlink nls rpc tcpd"
+
+RDEPEND="ldap? ( >=net-nds/openldap-2.3.35 )
+ netlink? (
+ sys-apps/dbus
+ dev-libs/libnl:1.1
+ )
+ rpc? ( net-nds/rpcbind )
+ tcpd? ( sys-apps/tcp-wrappers )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/quota-tools
+
+src_prepare() {
+ local args=(
+ -e '1iCC = @CC@' #446277
+ )
+ if ! use rpc ; then
+ args+=( #465810
+ -e '/^PROGS/s:rpc.rquotad::'
+ -e '/^RPCGEN/s:=.*:=false:'
+ -e '/^RPCCLNTOBJS/s:=.*:=:'
+ )
+ fi
+ sed -i "${args[@]}" Makefile.in || die
+ epatch "${FILESDIR}"/${PN}-4.01-mnt.patch \
+ "${FILESDIR}"/${PN}-4.01-cflags.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable ldap ldapmail) \
+ $(use_enable netlink) \
+ $(use_enable rpc) \
+ $(use_enable rpc rpcsetquota)
+}
+
+src_install() {
+ emake STRIP="" ROOTDIR="${D}" install
+ dodoc doc/* README.* Changelog
+ rm -r "${ED}"/usr/include || die #70938
+
+ insinto /etc
+ insopts -m0644
+ doins warnquota.conf quotatab
+
+ newinitd "${FILESDIR}"/quota.rc7 quota
+ newconfd "${FILESDIR}"/quota.confd quota
+
+ if use rpc ; then
+ newinitd "${FILESDIR}"/rpc.rquotad.initd rpc.rquotad
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ insopts -m0644
+ doins ldap-scripts/quota.schema
+
+ exeinto /usr/share/quota/ldap-scripts
+ doexe ldap-scripts/*.pl
+ doexe ldap-scripts/edquota_editor
+ fi
+}
diff --git a/sys-fs/quota/quota-4.02.ebuild b/sys-fs/quota/quota-4.02.ebuild
new file mode 100644
index 000000000000..46f418c497df
--- /dev/null
+++ b/sys-fs/quota/quota-4.02.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Linux quota tools"
+HOMEPAGE="http://sourceforge.net/projects/linuxquota/"
+SRC_URI="mirror://sourceforge/linuxquota/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="ldap netlink nls rpc tcpd"
+
+RDEPEND="ldap? ( >=net-nds/openldap-2.3.35 )
+ netlink? (
+ sys-apps/dbus
+ dev-libs/libnl:1.1
+ )
+ rpc? ( net-nds/rpcbind )
+ tcpd? ( sys-apps/tcp-wrappers )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/quota-tools
+
+src_prepare() {
+ local args=(
+ -e '1iCC = @CC@' #446277
+ )
+ if ! use rpc ; then
+ args+=( #465810
+ -e '/^PROGS/s:rpc.rquotad::'
+ -e '/^RPCGEN/s:=.*:=false:'
+ -e '/^RPCCLNTOBJS/s:=.*:=:'
+ )
+ fi
+ sed -i "${args[@]}" Makefile.in || die
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable ldap ldapmail) \
+ $(use_enable netlink) \
+ $(use_enable rpc) \
+ $(use_enable rpc rpcsetquota)
+}
+
+src_install() {
+ emake STRIP="" ROOTDIR="${D}" install
+ dodoc doc/* README.* Changelog
+ rm -r "${ED}"/usr/include || die #70938
+
+ insinto /etc
+ insopts -m0644
+ doins warnquota.conf quotatab
+
+ newinitd "${FILESDIR}"/quota.rc7 quota
+ newconfd "${FILESDIR}"/quota.confd quota
+
+ if use rpc ; then
+ newinitd "${FILESDIR}"/rpc.rquotad.initd rpc.rquotad
+ fi
+
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ insopts -m0644
+ doins ldap-scripts/quota.schema
+
+ exeinto /usr/share/quota/ldap-scripts
+ doexe ldap-scripts/*.pl
+ doexe ldap-scripts/edquota_editor
+ fi
+}
diff --git a/sys-fs/quotatool/Manifest b/sys-fs/quotatool/Manifest
new file mode 100644
index 000000000000..2cd0650916c2
--- /dev/null
+++ b/sys-fs/quotatool/Manifest
@@ -0,0 +1,8 @@
+DIST quotatool-1.4.11.tar.gz 113856 SHA256 75d83d2d47e41a5e0d9f3792e94926e2f49d70ed768df83ca521e96c007ab01c
+DIST quotatool-1.4.12.tar.gz 129171 SHA256 8f5fe77b94249bc9a3499a32467e76d9e19b9fb423f2262badf2c6fea857c27e
+DIST quotatool-1.4.13.tar.gz 130830 SHA256 a80d368a98efc978a9fa958c122bcee76c27ab8232c2b664c878441db6da83f5 SHA512 9407bee9c71f59f018b93739cc2e319123de036a62240d20e4c9e2e14e07353fc6e7caefc3fbcd02bb110f4dfaa9c58816d2abd4863c13e691f2d8c3341b7c5b WHIRLPOOL efbec7ae54de4fa3a36ef6485bb4feb0a2fb5a1924f4b5e900fb9094ec6f60fb454891e3e823d94f404cc56ffeb9cb2ad71572152fdf6c787686387d494ddc86
+DIST quotatool-1.4.6.tar.gz 114836 SHA256 7aed92f5691cd61b1291417a0eddc39a668426977d297bc4a6f912ede3662758
+DIST quotatool-1.5.0.tar.gz 131575 SHA256 6dde036e690e5fbc9f2b7df8bb5392761d46cb398543b2a5e690887b91044e2d SHA512 fea55ff6750d5b67d29eecddd94a002f53f5a7d3dd515d2e590743ff5824795cf3ae0c3bf083aa7b728f9c9df719bef55d9535b3c5016177e7f0fb0c34aadca1 WHIRLPOOL 2ced2dc559882e54e83a90c86568e8ba6e922a7c724c0efebef297c30d6dcdc1af539e33488401f4437f4797de9f4e72e60da74071c5f70929dd790d6565d83e
+DIST quotatool-1.6.0.tar.gz 133912 SHA256 2e455b2dde56936caee8c2df2ed75f782ca60ca2bf1c3fef50ce7b23571379d2 SHA512 7ff01fcf6e70ed0935fb81e4a863489d0d73b4bc2d09d3b891898953a96467d56a557305d4080377e35bc463fd04eca0c990f8ea35954b3dc23359cdbd7a9368 WHIRLPOOL 2bcb53455da3da7bf11cae1b2808a55f1282bb89428de10ed869f311db674fa70b2c313741b6a60967d79489af957403e62436373a41ad9bf53d4099a8bce05d
+DIST quotatool-1.6.1.tar.gz 146842 SHA256 428dac9c791e469e6a96b90de28d1850f0d47e93d67c4072bf0e9688863ec14b SHA512 b2b030c8acdd4c9b7de67e5df1814f9d5cd6c6586503613165f2a19a00f1450f19ac5f06b7691a4104ca5e517f4be9d6bd72145dd222aee2a755516a6ad6e78d WHIRLPOOL 3a606c5265d7c9cdf5f37f79acb33c8ae44aa0ea24c325e36b45e04f7bdc1bd353e7275f06a09b3c5deaef2cd5663d4e9247f77ce47d23b1d9eddb9999ad05b5
+DIST quotatool-1.6.2.tar.gz 147691 SHA256 e53adc480d54ae873d160dc0e88d78095f95d9131e528749fd982245513ea090 SHA512 882bdc43e49ef69b1b2899da01faf7853524f67585b716bba195ea89a250a90a7796a225b7d141b68bf45c7524d9fe506000998e6e7dc113b559f95e6ed21e2c WHIRLPOOL e2b0e5569f269fa969f1844dc54f05da32d6462b5caeac0538aaf1c2667cbd93a8b45152c61181445b80b5aa9775dbfa61515df8c0fe3d13e0dab5631594bc22
diff --git a/sys-fs/quotatool/files/quotatool-1.4.11-ldflags.patch b/sys-fs/quotatool/files/quotatool-1.4.11-ldflags.patch
new file mode 100644
index 000000000000..4f028227db7b
--- /dev/null
+++ b/sys-fs/quotatool/files/quotatool-1.4.11-ldflags.patch
@@ -0,0 +1,27 @@
+Index: quotatool-1.4.11/local.mk.in
+===================================================================
+--- quotatool-1.4.11.orig/local.mk.in
++++ quotatool-1.4.11/local.mk.in
+@@ -17,7 +17,8 @@ SHELL := /bin/sh
+
+ CC := @CC@
+ CFLAGS := @CFLAGS@
+-CPPFLAGS = $(inc) @DEFS@
++LDFLAGS := @LDFLAGS@
++CPPFLAGS = @CPPFLAGS@ $(inc) @DEFS@
+
+
+ INSTALL := @INSTALL@
+Index: quotatool-1.4.11/Makefile
+===================================================================
+--- quotatool-1.4.11.orig/Makefile
++++ quotatool-1.4.11/Makefile
+@@ -58,7 +58,7 @@ subdirs := src
+ # compile the program (and the objects)
+ all: $(prog)
+ $(prog): $(objs)
+- $(CC) -o $(prog) $(objs) $(libs) $(CFLAGS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $(prog) $(objs) $(libs)
+
+
+
diff --git a/sys-fs/quotatool/files/quotatool-1.4.13-ldflags.patch b/sys-fs/quotatool/files/quotatool-1.4.13-ldflags.patch
new file mode 100644
index 000000000000..d73f02f8ce81
--- /dev/null
+++ b/sys-fs/quotatool/files/quotatool-1.4.13-ldflags.patch
@@ -0,0 +1,23 @@
+--- quotatool-1.4.13/local.mk.in
++++ quotatool-1.4.13/local.mk.in
+@@ -17,7 +17,8 @@
+
+ CC := @CC@
+ CFLAGS := @CFLAGS@
+-CPPFLAGS = $(inc) @DEFS@
++LDFLAGS := @LDFLAGS@
++CPPFLAGS = @CPPFLAGS@ $(inc) @DEFS@
+
+
+ INSTALL := @INSTALL@
+--- quotatool-1.4.13/Makefile
++++ quotatool-1.4.13/Makefile
+@@ -58,7 +58,7 @@
+ # compile the program (and the objects)
+ all: $(prog)
+ $(prog): $(objs)
+- $(CC) -o $(prog) $(objs) $(libs) $(CFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $(prog) $(objs) $(libs)
+
+
+
diff --git a/sys-fs/quotatool/metadata.xml b/sys-fs/quotatool/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/quotatool/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/quotatool/quotatool-1.4.11.ebuild b/sys-fs/quotatool/quotatool-1.4.11.ebuild
new file mode 100644
index 000000000000..5d0c0412042b
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.4.11.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit autotools eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+DEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-ldflags.patch"
+
+ # rebuild autotools since it uses symlinked copies of support files
+ # that we can't rely on.
+ eautoreconf
+}
+
+src_install () {
+ dobin quotatool || die
+ doman man/quotatool.8 || die
+ dodoc AUTHORS ChangeLog README TODO || die
+}
diff --git a/sys-fs/quotatool/quotatool-1.4.12.ebuild b/sys-fs/quotatool/quotatool-1.4.12.ebuild
new file mode 100644
index 000000000000..6cb592132559
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.4.12.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-1.4.11-ldflags.patch"
+
+ # rebuild autotools since it uses symlinked copies of support files
+ # that we can't rely on.
+ eautoreconf
+}
+
+src_install () {
+ dobin quotatool
+ doman man/quotatool.8
+ dodoc AUTHORS ChangeLog README TODO
+}
diff --git a/sys-fs/quotatool/quotatool-1.4.13.ebuild b/sys-fs/quotatool/quotatool-1.4.13.ebuild
new file mode 100644
index 000000000000..32d1f1a97ad4
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.4.13.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.4.13-ldflags.patch
+}
+
+src_install () {
+ dodir /usr/sbin /usr/share/man/man8
+ default
+}
diff --git a/sys-fs/quotatool/quotatool-1.4.6.ebuild b/sys-fs/quotatool/quotatool-1.4.6.ebuild
new file mode 100644
index 000000000000..b69a552af1ca
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.4.6.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_install () {
+ dobin quotatool || die
+ doman man/quotatool.8
+ dodoc AUTHORS ChangeLog README TODO
+}
diff --git a/sys-fs/quotatool/quotatool-1.5.0.ebuild b/sys-fs/quotatool/quotatool-1.5.0.ebuild
new file mode 100644
index 000000000000..32d1f1a97ad4
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.5.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.4.13-ldflags.patch
+}
+
+src_install () {
+ dodir /usr/sbin /usr/share/man/man8
+ default
+}
diff --git a/sys-fs/quotatool/quotatool-1.6.0.ebuild b/sys-fs/quotatool/quotatool-1.6.0.ebuild
new file mode 100644
index 000000000000..c5a40a349c40
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.6.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.4.13-ldflags.patch
+}
+
+src_install () {
+ dodir /usr/sbin /usr/share/man/man8
+ default
+}
diff --git a/sys-fs/quotatool/quotatool-1.6.1.ebuild b/sys-fs/quotatool/quotatool-1.6.1.ebuild
new file mode 100644
index 000000000000..c5a40a349c40
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.6.1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.4.13-ldflags.patch
+}
+
+src_install () {
+ dodir /usr/sbin /usr/share/man/man8
+ default
+}
diff --git a/sys-fs/quotatool/quotatool-1.6.2.ebuild b/sys-fs/quotatool/quotatool-1.6.2.ebuild
new file mode 100644
index 000000000000..c5a40a349c40
--- /dev/null
+++ b/sys-fs/quotatool/quotatool-1.6.2.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="command-line utility for filesystem quotas"
+HOMEPAGE="http://quotatool.ekenberg.se/"
+SRC_URI="http://quotatool.ekenberg.se/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/quota"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.4.13-ldflags.patch
+}
+
+src_install () {
+ dodir /usr/sbin /usr/share/man/man8
+ default
+}
diff --git a/sys-fs/rar2fs/Manifest b/sys-fs/rar2fs/Manifest
new file mode 100644
index 000000000000..edd2c9dd56c9
--- /dev/null
+++ b/sys-fs/rar2fs/Manifest
@@ -0,0 +1 @@
+DIST rar2fs-1.20.0.tar.gz 254330 SHA256 2b14cc5acefa12a07f5d0b1a4241713707e60e32f7a82cd86879ec1bd9cbae2d SHA512 a0136ee57b87da8846118282fb7fe70da2e07e7380c137e39ea45c16c6ef3400341b2034008cb261dc7c4d7b0ed666f43d0485374df05f3339c4aa52b7ca9164 WHIRLPOOL 69c15c483f18c895739f4bd9423314c288e45f3ea3cf582399a59a30842ea81a00343b636143ed955ea0b807068fbc4f7a3bb45188a7a4c77ab6588728391f4b
diff --git a/sys-fs/rar2fs/metadata.xml b/sys-fs/rar2fs/metadata.xml
new file mode 100644
index 000000000000..ee1594674128
--- /dev/null
+++ b/sys-fs/rar2fs/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+ <maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">rar2fs</remote-id>
+ <remote-id type="github">hasse69/rar2fs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/rar2fs/rar2fs-1.20.0.ebuild b/sys-fs/rar2fs/rar2fs-1.20.0.ebuild
new file mode 100644
index 000000000000..6f3e94fd6612
--- /dev/null
+++ b/sys-fs/rar2fs/rar2fs-1.20.0.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A FUSE based filesystem that can mount one or multiple RAR archive(s)"
+HOMEPAGE="http://hasse69.github.io/rar2fs/ https://github.com/hasse69/rar2fs"
+SRC_URI="https://github.com/hasse69/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND=">=app-arch/unrar-5:=
+ sys-fs/fuse"
+DEPEND="${RDEPEND}"
+
+DOCS="AUTHORS ChangeLog"
+
+src_configure() {
+ export USER_CFLAGS="${CFLAGS}"
+
+ econf \
+ --with-unrar=/usr/include/libunrar \
+ $(use_enable debug)
+}
diff --git a/sys-fs/rarfs/Manifest b/sys-fs/rarfs/Manifest
new file mode 100644
index 000000000000..5a20627b191c
--- /dev/null
+++ b/sys-fs/rarfs/Manifest
@@ -0,0 +1 @@
+DIST rarfs-0.1.1.tar.gz 349283 SHA256 e4855ab457e0be327641fc5aed958da3a06996425de4183055f2aad428ff0c1c SHA512 a374dc2dcd83808296dc0b0b3109fd84771d47956cc30fa16ac53cc768ae5ff717cff2fa22ebcbacdd72b645b75986c5d44e47aa1a52a92f230f1944ceaa8b28 WHIRLPOOL 8f1c613ad0b70aac85c3533b79b5e8599a3765d4e60633b294c307481dedcb5b91b6a30bce40429b153896f2f5e80105554d19fec813f5231fd505ad6611d70f
diff --git a/sys-fs/rarfs/metadata.xml b/sys-fs/rarfs/metadata.xml
new file mode 100644
index 000000000000..5c1e2c8b685d
--- /dev/null
+++ b/sys-fs/rarfs/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">rarfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/rarfs/rarfs-0.1.1.ebuild b/sys-fs/rarfs/rarfs-0.1.1.ebuild
new file mode 100644
index 000000000000..e663922d38fb
--- /dev/null
+++ b/sys-fs/rarfs/rarfs-0.1.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.*"
+
+inherit python
+
+DESCRIPTION="Fuse module to mount uncompressed RAR archives"
+HOMEPAGE="http://sourceforge.net/projects/rarfs/"
+SRC_URI="mirror://sourceforge/rarfs/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/fuse"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( README )
+
+src_install() {
+ install_prarfs() {
+ python_convert_shebangs -q ${PYTHON_ABI} scripts/prarfs
+ newbin scripts/prarfs prarfs-${PYTHON_ABI}
+ }
+ python_execute_function -q install_prarfs
+ python_generate_wrapper_scripts "${ED}/usr/bin/prarfs"
+
+ dobin src/rarfs
+ dodoc ${DOCS[@]}
+}
diff --git a/sys-fs/redirfs/Manifest b/sys-fs/redirfs/Manifest
new file mode 100644
index 000000000000..e90a0fc908d2
--- /dev/null
+++ b/sys-fs/redirfs/Manifest
@@ -0,0 +1,2 @@
+DIST redirfs-0.10.20120313.tar.bz2 1479473 SHA256 2481407d004c5e205f8ce602e6db7c9e8c5090b4953e72bfb4c3a547416e0a2a SHA512 8f7973adeec40d0098ed9d7d889d345625d61d0579e5206f09ca51ce881d4e1f9193fff5d78d1a44b544924016118001dfbc653ac16f7dfbf78d32a25c60907a WHIRLPOOL 8f10add2507fe28dad7d781884ebb664be2cef639331fe23158641cf2f0276eb2703535584ef8c76b9a2d04e4ce9c22d4e4c47daea79e4699bb9aeccc8491c1a
+DIST redirfs-0.8.tar.gz 41580 SHA256 ef9248f85e3ce15cd34a9f402386ec4b5cf58f6be00cd9f195257364da913012
diff --git a/sys-fs/redirfs/metadata.xml b/sys-fs/redirfs/metadata.xml
new file mode 100644
index 000000000000..32e583418aee
--- /dev/null
+++ b/sys-fs/redirfs/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>bicatali@gentoo.org</email>
+</maintainer>
+<longdescription lang='en'>
+ The RedirFS or redirecting file system is a layer between
+ virtual file system switch (VFS) and file system drivers. It is
+ implemented as an out-of-kernel module for Linux and it provides
+ framework allowing modification of file system calls in the VFS
+ layer. The RedirFS by itself does not provide any additional
+ functionality and if it is loaded into the Linux kernel, it just
+ occupies some memory space and it does practically nothing. The
+ RedirFS is intended to be used by so-called filters. Filter is a
+ linux kernel module (LKM) that uses the RedirFS framework. Each
+ filter can add some useful functionality to the existing file
+ systems like transparent compression, transparent encryption,
+ merging contents of several directories into one, allowing writing
+ to a read-only media and others.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/redirfs/redirfs-0.10.20120313.ebuild b/sys-fs/redirfs/redirfs-0.10.20120313.ebuild
new file mode 100644
index 000000000000..e8e19fbd727b
--- /dev/null
+++ b/sys-fs/redirfs/redirfs-0.10.20120313.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit linux-mod
+
+KEYWORDS="~amd64 ~x86"
+SRC_URI="http://dev.gentoo.org/~bicatali/distfiles/${P}.tar.bz2"
+
+DESCRIPTION="Layer between virtual file system switch and file system drivers"
+HOMEPAGE="http://www.redirfs.org/"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+pkg_setup() {
+ SRCDIR="${S}/src/redirfs"
+ MODULE_NAMES="redirfs(misc:${SRCDIR})"
+ BUILD_PARAMS="-C ${KERNEL_DIR} M=${SRCDIR}"
+ BUILD_TARGETS="redirfs.ko"
+ linux-mod_pkg_setup
+}
+
+src_install() {
+ linux-mod_src_install
+ insinto ${KERNEL_DIR}/include/linux
+ doins ${SRCDIR}/redirfs.h
+ dodoc ${SRCDIR}/{CHANGELOG,README,TODO}
+}
diff --git a/sys-fs/redirfs/redirfs-0.8.ebuild b/sys-fs/redirfs/redirfs-0.8.ebuild
new file mode 100644
index 000000000000..f27bdbed8dcf
--- /dev/null
+++ b/sys-fs/redirfs/redirfs-0.8.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit linux-mod
+
+DESCRIPTION="Layer between virtual file system switch and file system drivers"
+HOMEPAGE="http://www.redirfs.org"
+SRC_URI="http://www.redirfs.org/packages/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ MODULE_NAMES="redirfs(misc:)"
+ BUILD_TARGETS="redirfs.ko"
+ BUILD_PARAMS="-C ${KERNEL_DIR} M=${S} modules"
+}
+
+src_install() {
+ dodoc CHANGELOG INSTALL README TODO
+ linux-mod_src_install
+ insinto /usr/include
+ doins redirfs.h
+}
diff --git a/sys-fs/redirfs/redirfs-9999.ebuild b/sys-fs/redirfs/redirfs-9999.ebuild
new file mode 100644
index 000000000000..147bf07ac929
--- /dev/null
+++ b/sys-fs/redirfs/redirfs-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit linux-mod
+
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-2
+ KEYWORDS=""
+ EGIT_REPO_URI="git://www.redirfs.org/git/fhrbata/redirfs.git"
+ SRCDIR="${S}/src/redirfs"
+else
+ KEYWORDS="~amd64 ~x86"
+ SRC_URI="http://www.redirfs.org/packages/${P}.tar.gz"
+fi
+
+DESCRIPTION="Layer between virtual file system switch and file system drivers"
+HOMEPAGE="http://www.redirfs.org/"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+pkg_setup() {
+ MODULE_NAMES="redirfs(misc:${SRCDIR})"
+ BUILD_PARAMS="-C ${KERNEL_DIR} M=${SRCDIR}"
+ BUILD_TARGETS="redirfs.ko"
+ linux-mod_pkg_setup
+}
+
+src_install() {
+ linux-mod_src_install
+ insinto /usr/include
+ doins ${SRCDIR}/redirfs.h
+ dodoc ${SRCDIR}/{CHANGELOG,README,TODO}
+}
diff --git a/sys-fs/reiser4progs/Manifest b/sys-fs/reiser4progs/Manifest
new file mode 100644
index 000000000000..52041520da46
--- /dev/null
+++ b/sys-fs/reiser4progs/Manifest
@@ -0,0 +1,3 @@
+DIST reiser4progs-1.0.7.tar.gz 844126 SHA256 1211996ad3efebc0ca543aea2f67527d33e50fce1b827ad341e207f171d94d96 SHA512 afc88dc2cb7a2e9c8e8c4bc93012b41a19cecaf96a0dc7d75f20c535ebfbb8eac79688529d42ba5cbe067395a1a13cd997246e5bc57181c6dfaced6e6fec4a05 WHIRLPOOL 6c17458cd68dc3ea02fcfc221b03f860206fcd205d7887cffb84b1f712e305b6097be29ae44a4a098d188ffdaf8cf44f06cadbf24dc25bcaabe059e12f21ae0a
+DIST reiser4progs-1.0.8.tar.gz 866466 SHA256 186e2f8619cf66a79654789be044781dd656cbd4a3c4f514da3516301226b086 SHA512 d49de6d191fc842d5f7dad447b1e8ac2bec4c18e40096ad4911766153688fe558374fbb34eb510ec5c9a929e64edb2c14e11f6d0ac2c247e1978fd766bd24116 WHIRLPOOL 83a0422f77ce4035410a10c727b8f0193c071e046b74b2359db566d83fc8a22906454401f0a15e53dee26cbf7b723b4993e71bb207792d56f39dddcd13993c6d
+DIST reiser4progs-1.0.9.tar.gz 913470 SHA256 ffb027c83b0080e86f7cbe238c1e185ab09225f962a171245e7f4b7e9a97cd34 SHA512 1aa3cc1a59081d4987c94fc0dda42b9b64329e8187483809968438d2c7b1152eed23d3d6682aabe2216e1aee50f9653120a0bc4fe798195d6a1cf9c43c9508b0 WHIRLPOOL 6cd385b506ac52fe44f7b8cca3a0c4815b59c22e200a25898eba5c5a5e6491b16d7e1fedd074ac58e748437df084e40a4e92059081a51a6a30b4e0e4a9945a17
diff --git a/sys-fs/reiser4progs/files/reiser4progs-1.0.7-gcc-4.4.patch b/sys-fs/reiser4progs/files/reiser4progs-1.0.7-gcc-4.4.patch
new file mode 100644
index 000000000000..3f32af5d78b4
--- /dev/null
+++ b/sys-fs/reiser4progs/files/reiser4progs-1.0.7-gcc-4.4.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/269240
+
+fix build failure when using gcc-4.4
+
+--- reiser4progs-1.0.7/plugin/node/node40/node40.c
++++ reiser4progs-1.0.7/plugin/node/node40/node40.c
+@@ -994,7 +994,7 @@
+ func = cb_comp_key3;
+ #elif defined(ENABLE_LARGE_KEYS)
+ func = cb_comp_key4;
+-#elif
++#else
+ func = NULL;
+ #endif
+
diff --git a/sys-fs/reiser4progs/files/reiser4progs-1.0.7-readline-6.3.patch b/sys-fs/reiser4progs/files/reiser4progs-1.0.7-readline-6.3.patch
new file mode 100644
index 000000000000..9de53bd41203
--- /dev/null
+++ b/sys-fs/reiser4progs/files/reiser4progs-1.0.7-readline-6.3.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/504472
+
+fix building w/readline-6.3 -- the old CPPFunction define has been deleted
+
+--- a/libmisc/ui.c
++++ b/libmisc/ui.c
+@@ -256,8 +256,7 @@ static void _init(void) {
+
+ #if defined(HAVE_LIBREADLINE) && defined(HAVE_READLINE_READLINE_H)
+ rl_initialize();
+- rl_attempted_completion_function =
+- (CPPFunction *)misc_complete;
++ rl_attempted_completion_function = misc_complete;
+ #endif
+
+ aal_exception_set_handler(misc_exception_handler);
diff --git a/sys-fs/reiser4progs/metadata.xml b/sys-fs/reiser4progs/metadata.xml
new file mode 100644
index 000000000000..f1ece2ee4810
--- /dev/null
+++ b/sys-fs/reiser4progs/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <longdescription>
+This is a library for reiser4 filesystem access and manipulation.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">reiser4</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/reiser4progs/reiser4progs-1.0.7.ebuild b/sys-fs/reiser4progs/reiser4progs-1.0.7.ebuild
new file mode 100644
index 000000000000..de27102ffef7
--- /dev/null
+++ b/sys-fs/reiser4progs/reiser4progs-1.0.7.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit multilib eutils toolchain-funcs
+
+MY_P=${PN}-${PV/_p/-}
+DESCRIPTION="reiser4progs: mkfs, fsck, etc..."
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/fs/reiser4/reiser4progs/"
+SRC_URI="mirror://kernel/linux/utils/fs/reiser4/reiser4progs/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 -sparc x86"
+IUSE="static debug readline"
+
+DEPEND="~sys-libs/libaal-1.0.5
+ readline? ( sys-libs/readline )"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-gcc-4.4.patch #269240
+ epatch "${FILESDIR}"/${P}-readline-6.3.patch #504472
+ printf '#!/bin/sh\ntrue\n' > run-ldconfig
+}
+
+src_compile() {
+ econf \
+ $(use_enable static full-static) \
+ $(use_enable static mkfs-static) \
+ $(use_enable static fsck-static) \
+ $(use_enable static debugfs-static) \
+ $(use_enable static measurefs-static) \
+ $(use_enable static cpfs-static) \
+ $(use_enable static resizefs-static) \
+ $(use_enable debug) \
+ $(use_with readline) \
+ --enable-libminimal \
+ --sbindir=/sbin \
+ || die "configure failed"
+ emake || die "make failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS BUGS CREDITS ChangeLog NEWS README THANKS TODO
+
+ # move shared libs to /
+ dodir /$(get_libdir)
+ mv "${D}"/usr/$(get_libdir)/lib*.so* "${D}"/$(get_libdir)/ || die
+ gen_usr_ldscript libreiser4-minimal.so libreiser4.so librepair.so
+}
diff --git a/sys-fs/reiser4progs/reiser4progs-1.0.8.ebuild b/sys-fs/reiser4progs/reiser4progs-1.0.8.ebuild
new file mode 100644
index 000000000000..7c87b60b9141
--- /dev/null
+++ b/sys-fs/reiser4progs/reiser4progs-1.0.8.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib eutils toolchain-funcs
+
+DESCRIPTION="reiser4progs: mkfs, fsck, etc..."
+HOMEPAGE="https://sourceforge.net/projects/reiser4/"
+SRC_URI="mirror://sourceforge/reiser4/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 -sparc ~x86"
+IUSE="debug readline static static-libs"
+
+LIB_DEPEND="~sys-libs/libaal-1.0.5[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ static-libs? ( ~sys-libs/libaal-1.0.5[static-libs(+)] )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )"
+
+src_prepare() {
+ printf '#!/bin/sh\ntrue\n' > run-ldconfig
+ # Delete hardcoded link/compile flags.
+ sed -i -r \
+ -e '/CFLAGS=/s: -static":":' \
+ -e '/CFLAGS/s: (-O[123s]|-g)\>::g' \
+ configure || die
+ epatch "${FILESDIR}"/${PN}-1.0.7-readline-6.3.patch #504472
+}
+
+src_configure() {
+ econf \
+ $(use_enable static full-static) \
+ $(use_enable static-libs static) \
+ $(use_enable debug) \
+ $(use_with readline) \
+ --disable-Werror \
+ --enable-libminimal \
+ --sbindir=/sbin
+}
+
+src_install() {
+ default
+ gen_usr_ldscript -a reiser4{,-minimal} repair
+}
diff --git a/sys-fs/reiser4progs/reiser4progs-1.0.9.ebuild b/sys-fs/reiser4progs/reiser4progs-1.0.9.ebuild
new file mode 100644
index 000000000000..a390451a26c6
--- /dev/null
+++ b/sys-fs/reiser4progs/reiser4progs-1.0.9.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib eutils toolchain-funcs
+
+DESCRIPTION="reiser4progs: mkfs, fsck, etc..."
+HOMEPAGE="https://sourceforge.net/projects/reiser4/"
+SRC_URI="mirror://sourceforge/reiser4/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 -sparc x86"
+IUSE="debug readline static static-libs"
+
+LIB_DEPEND="~sys-libs/libaal-1.0.6[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ static-libs? ( ~sys-libs/libaal-1.0.6[static-libs(+)] )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )"
+
+src_prepare() {
+ printf '#!/bin/sh\ntrue\n' > run-ldconfig
+ # Delete hardcoded link/compile flags.
+ sed -i -r \
+ -e '/CFLAGS=/s: -static":":' \
+ -e '/CFLAGS/s: (-O[123s]|-g)\>::g' \
+ configure || die
+ epatch "${FILESDIR}"/${PN}-1.0.7-readline-6.3.patch #504472
+}
+
+src_configure() {
+ econf \
+ $(use_enable static full-static) \
+ $(use_enable static-libs static) \
+ $(use_enable debug) \
+ $(use_with readline) \
+ --disable-Werror \
+ --enable-libminimal \
+ --sbindir=/sbin
+}
+
+src_install() {
+ default
+ gen_usr_ldscript -a reiser4{,-minimal} repair
+}
diff --git a/sys-fs/reiserfs-defrag/Manifest b/sys-fs/reiserfs-defrag/Manifest
new file mode 100644
index 000000000000..1fc56bbeccb3
--- /dev/null
+++ b/sys-fs/reiserfs-defrag/Manifest
@@ -0,0 +1,2 @@
+DIST reiserfs-defrag-0.2.1.tar.gz 48556 SHA256 eca38a4a0e7268bcf76f51e8d0d48e46213aa86105f20398769da9ab75d278ce SHA512 ba0959d74659df9956a930724024c3cbba4cac93275fdf3707333f38c5c0f07e17420b07387e52e7533ed17ddd8fc9fec7ce0e8a553e888109badbb64bedb737 WHIRLPOOL 8bbee9eced591324dfe9dd4aafdfd2df00c18a53136887ed3cb3a935dc9e19eb107ac8739cef5107c7c3b91d556d7e293790bac4ae5507dc260eb1fec8458248
+DIST reiserfs-defrag-0.2.2.tar.gz 52988 SHA256 28fc7fe7373fab0e90f74acaf2fbfcf2578f7b04eeadcecb50f88bee2b67e718 SHA512 1e8dfb085a7635eda92bb820d3089b8ca2101fb00ede971b8de24018250a2238067e8db4e5f52b3d3aca2c45c8a395ae6687ce762d355e814697faef8ff59025 WHIRLPOOL 20699c5cff706ed8177aabf2d70b61acd46c6316d11dd4b110b3ced854db7950d7443008ad445e168222773f5bd9666a103cddf0cc3bcc65548d3b5a58f1009e
diff --git a/sys-fs/reiserfs-defrag/metadata.xml b/sys-fs/reiserfs-defrag/metadata.xml
new file mode 100644
index 000000000000..0be16b34138f
--- /dev/null
+++ b/sys-fs/reiserfs-defrag/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <upstream>
+ <maintainer>
+ <email>ibragimovrinat@mail.ru</email>
+ <name>Rinat Ibragimov</name>
+ </maintainer>
+ <bugs-to>https://github.com/i-rinat/reiserfs-defrag/issues</bugs-to>
+ <remote-id type="github">i-rinat/reiserfs-defrag</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.1.ebuild b/sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.1.ebuild
new file mode 100644
index 000000000000..51eb987cba00
--- /dev/null
+++ b/sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Small defragmentation tool for reiserfs"
+HOMEPAGE="https://github.com/i-rinat/reiserfs-defrag"
+SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_install() {
+ cmake-utils_src_install
+
+ dodoc ChangeLog README.md
+}
+
+pkg_postinst() {
+ ewarn "Defragmentation should be done OFFLINE only! You MUST unmount your reiserfs partition before starting ${PN}"
+}
diff --git a/sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.2.ebuild b/sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.2.ebuild
new file mode 100644
index 000000000000..6a0cb5641089
--- /dev/null
+++ b/sys-fs/reiserfs-defrag/reiserfs-defrag-0.2.2.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Small defragmentation tool for reiserfs"
+HOMEPAGE="https://github.com/i-rinat/reiserfs-defrag"
+SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+DOCS=( ChangeLog README.md )
+
+pkg_postinst() {
+ ewarn "Defragmentation should be done OFFLINE only! You MUST unmount your reiserfs partition before starting ${PN}"
+}
diff --git a/sys-fs/reiserfsprogs/Manifest b/sys-fs/reiserfsprogs/Manifest
new file mode 100644
index 000000000000..1ee220bf953a
--- /dev/null
+++ b/sys-fs/reiserfsprogs/Manifest
@@ -0,0 +1,3 @@
+DIST reiserfsprogs-3.6.21.tar.gz 423521 SHA256 cc87cecd5c259665aae46a7760525486767e1ace6da833a4f1a616a58b5ad092 SHA512 fd7e96a75aec9f8db205aaa81f5508c3bd11d550dd54a158e3c5e15ecc39cd013ff4628d622f66bc15a3597c2f763c12696fda87a350ff4dfcbc3566979edc23 WHIRLPOOL b4ed0944cca82ae964412f62f1024688e8c83552c10c61f6bb27e936dde6e55fd856847ebd0450114d675c994213a5a7c96421c6506434c5c60accf86faf054e
+DIST reiserfsprogs-3.6.23.tar.xz 311524 SHA256 022350675117a8b07d736240b16f01c8ffcc07a0bdf997a4c16818902fc6bb75 SHA512 31039a0758148680a1f4e34b4c030f4c947732d6a0701f3df466b76509d72df5d2c8ac3e760d4ddc1edba9a229297d02ae0e4549ff9875217e75fecade76f2d6 WHIRLPOOL 4dd601d7aea8f5a57295c8704f0d4200c1716b32c5a4ea2de91a9406db097b54add1fe34b721d4dfce05d88329f20722547f23b73acc909416ef306ab690b7b8
+DIST reiserfsprogs-3.6.24.tar.xz 316444 SHA256 7e44fefe557d68a642191428210f3d64d80283b9ad0e45c24130f6ce936b0760 SHA512 183cda8c1bef375a9e90b6bfcbbbe7cc901f12890be29551e74950c723b0ae565786be86f69cba2a5d8b2f9014d22f6f3bdf277d666d4b6bea15406cb2803a42 WHIRLPOOL 1046b9ca94e733a1b90c220a122d41cb933522e39244b6c6de987de1eefe9a2712a3a7dbaf5de64f2c76de1eb9b43c3fe0650fc3ac11929951956a91ea92e571
diff --git a/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-fsck-n.patch b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-fsck-n.patch
new file mode 100644
index 000000000000..2146c94d4f36
--- /dev/null
+++ b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-fsck-n.patch
@@ -0,0 +1,12 @@
+diff -ur reiserfsprogs-3.6.19.orig/fsck/main.c reiserfsprogs-3.6.19/fsck/main.c
+--- reiserfsprogs-3.6.19.orig/fsck/main.c 2004-10-07 15:04:08.000000000 +0100
++++ reiserfsprogs-3.6.19/fsck/main.c 2007-05-02 16:05:08.000000000 +0100
+@@ -416,7 +416,7 @@
+ (data->log == stdout) ? "stdout" :
+ (data->log_file_name ? data->log_file_name : "fsck.run"));
+
+- if (!(data->options & OPT_YES) && !user_confirmed (warn_to, "\nDo you want to "
++ if (!(data->options & OPT_YES) && !(data->options & OPT_SILENT) && !user_confirmed (warn_to, "\nDo you want to "
+ "run this program?[N/Yes] (note need to type Yes if you do):", "Yes\n"))
+ exit (EXIT_USER);
+ }
diff --git a/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-unaligned.patch b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-unaligned.patch
new file mode 100644
index 000000000000..5883ce85f827
--- /dev/null
+++ b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.19-unaligned.patch
@@ -0,0 +1,35 @@
+backported from 3.6.20
+
+http://bugs.gentoo.org/153494
+
+--- include/reiserfs_fs.h
++++ include/reiserfs_fs.h
+@@ -38,14 +38,22 @@
+ # define extern_inline
+ #endif
+
+-#include <asm/unaligned.h>
+-
+ #ifndef get_unaligned
+-#if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
+- defined(__PPC) || defined(powerpc) || defined(__powerpc__)
+-# define get_unaligned(ptr) (*(ptr))
+-# define put_unaligned(val,ptr) ((void)(*(ptr) = (val)))
++#define get_unaligned(ptr) \
++({ \
++ __typeof__(*(ptr)) __tmp; \
++ memcpy(&__tmp, (ptr), sizeof(*(ptr))); \
++ __tmp; \
++})
+ #endif
++
++#ifndef put_unaligned
++#define put_unaligned(val, ptr) \
++({ \
++ __typeof__(*(ptr)) __tmp = (val); \
++ memcpy((ptr), &__tmp, sizeof(*(ptr))); \
++ (void)0; \
++})
+ #endif
+
+ #define get_leXX(xx,p,field) (le##xx##_to_cpu ((p)->field))
diff --git a/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.20-fsck-n.patch b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.20-fsck-n.patch
new file mode 100644
index 000000000000..b29133ee65b4
--- /dev/null
+++ b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.20-fsck-n.patch
@@ -0,0 +1,12 @@
+diff -ur a/utils/fsck/main.c b/utils/fsck/main.c
+--- a/utils/fsck/main.c 2006-03-28 13:40:23.000000000 +0100
++++ b/utils/fsck/main.c 2007-08-02 10:13:53.000000000 +0100
+@@ -421,7 +421,7 @@
+ (data->log == stdout) ? "stdout" :
+ (data->log_file_name ? data->log_file_name : "fsck.run"));
+
+- if (!(data->options & OPT_YES)) {
++ if (!(data->options & OPT_YES) && !(data->options & OPT_SILENT)) {
+ if (!util_user_confirmed(warn_to, "\nDo you want to run this "
+ "program?[N/Yes] (note need to type "
+ "Yes if you do):", "Yes\n"))
diff --git a/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fix_large_fs.patch b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fix_large_fs.patch
new file mode 100644
index 000000000000..a214440a5393
--- /dev/null
+++ b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fix_large_fs.patch
@@ -0,0 +1,356 @@
+From: Jeff Mahoney <jeffm@suse.com>
+Subject: [PATCH] reiserfs: Fix signedness issues for large file systems
+References: bnc#701602
+
+
+Signed-by: Jeff Mahoney <jeffm@suse.com>
+---
+ debugreiserfs/debugreiserfs.c | 22 +++++++++++-----------
+ debugreiserfs/pack.c | 18 +++++++++---------
+ debugreiserfs/scan.c | 2 +-
+ debugreiserfs/stat.c | 2 +-
+ fsck/check_tree.c | 6 +++---
+ fsck/pass0.c | 10 +++++-----
+ fsck/pass1.c | 4 ++--
+ include/reiserfs_fs.h | 2 ++
+ lib/io.c | 2 +-
+ reiserfscore/journal.c | 2 +-
+ reiserfscore/prints.c | 14 +++++++-------
+ reiserfscore/reiserfslib.c | 5 +++--
+ reiserfscore/stree.c | 2 +-
+ 13 files changed, 47 insertions(+), 44 deletions(-)
+
+--- a/debugreiserfs/debugreiserfs.c
++++ b/debugreiserfs/debugreiserfs.c
+@@ -59,11 +59,11 @@ Options:\n\
+
+ #if 1
+ struct reiserfs_fsstat {
+- int nr_internals;
+- int nr_leaves;
+- int nr_files;
+- int nr_directories;
+- int nr_unformatted;
++ unsigned int nr_internals;
++ unsigned int nr_leaves;
++ unsigned int nr_files;
++ unsigned int nr_directories;
++ unsigned int nr_unformatted;
+ } g_stat_info;
+ #endif
+
+@@ -465,14 +465,14 @@ static void init_bitmap (reiserfs_filsys
+ case ALL_BLOCKS:
+ input_bitmap (fs) = reiserfs_create_bitmap (block_count);
+ reiserfs_bitmap_fill (input_bitmap (fs));
+- reiserfs_warning (stderr, "Whole device (%d blocks) is to be scanned\n",
++ reiserfs_warning (stderr, "Whole device (%u blocks) is to be scanned\n",
+ reiserfs_bitmap_ones (input_bitmap (fs)));
+ break;
+ case USED_BLOCKS:
+ reiserfs_warning (stderr, "Loading on-disk bitmap .. ");
+ input_bitmap (fs) = reiserfs_create_bitmap (block_count);
+ reiserfs_bitmap_copy (input_bitmap (fs), fs->fs_bitmap2);
+- reiserfs_warning (stderr, "%d bits set - done\n",
++ reiserfs_warning (stderr, "%lu bits set - done\n",
+ reiserfs_bitmap_ones (input_bitmap (fs)));
+ break;
+ case UNUSED_BLOCKS:
+@@ -480,7 +480,7 @@ static void init_bitmap (reiserfs_filsys
+ input_bitmap (fs) = reiserfs_create_bitmap (block_count);
+ reiserfs_bitmap_copy (input_bitmap (fs), fs->fs_bitmap2);
+ reiserfs_bitmap_invert (input_bitmap (fs));
+- reiserfs_warning (stderr, "%d bits set - done\n",
++ reiserfs_warning (stderr, "%lu bits set - done\n",
+ reiserfs_bitmap_ones (input_bitmap (fs)));
+ break;
+ case EXTERN_BITMAP:
+@@ -494,7 +494,7 @@ static void init_bitmap (reiserfs_filsys
+ reiserfs_exit (1, "could not load fitmap from \"%s\"",
+ input_bitmap_file_name(fs));
+ }
+- reiserfs_warning (stderr, "%d blocks marked in the given bitmap\n",
++ reiserfs_warning (stderr, "%u blocks marked in the given bitmap\n",
+ reiserfs_bitmap_ones (input_bitmap (fs)));
+ fclose (fp);
+ break;
+@@ -554,8 +554,8 @@ static void do_dump_tree (reiserfs_filsy
+ }
+
+ /* print the statistic */
+- printf ("\t%d internal + %d leaves + %d "
+- "unformatted nodes = %d blocks\n",
++ printf ("\t%u internal + %u leaves + %u "
++ "unformatted nodes = %u blocks\n",
+ g_stat_info.nr_internals, g_stat_info.nr_leaves,
+ g_stat_info.nr_unformatted, g_stat_info.nr_internals +
+ g_stat_info.nr_leaves + g_stat_info.nr_unformatted);
+--- a/debugreiserfs/pack.c
++++ b/debugreiserfs/pack.c
+@@ -8,7 +8,7 @@
+
+
+ /* counters for each kind of blocks */
+-int packed,
++unsigned int packed,
+ packed_leaves,
+ full_blocks,
+ having_ih_array, /* blocks with broken block head */
+@@ -638,7 +638,7 @@ static void pack_frozen_data (reiserfs_f
+ }
+ reiserfs_warning (stderr, "ok\n");fflush (stderr);
+ reiserfs_warning (stderr,
+- "Super block, bitmaps, journal - %d blocks - done, %d blocks left\n",
++ "Super block, bitmaps, journal - %u blocks - done, %u blocks left\n",
+ packed, reiserfs_bitmap_ones (what_to_pack));
+ }
+
+@@ -693,13 +693,13 @@ void pack_partition (reiserfs_filsys_t *
+ magic16 = END_MAGIC;
+ fwrite_le16 (&magic16);
+
+- fprintf (stderr, "\nPacked %d blocks:\n"
+- "\tcompessed %d\n"
+- "\tfull blocks %d\n"
+- "\t\tleaves with broken block head %d\n"
+- "\t\tcorrupted leaves %d\n"
+- "\t\tinternals %d\n"
+- "\t\tdescriptors %d\n",
++ fprintf (stderr, "\nPacked %u blocks:\n"
++ "\tcompessed %u\n"
++ "\tfull blocks %u\n"
++ "\t\tleaves with broken block head %u\n"
++ "\t\tcorrupted leaves %u\n"
++ "\t\tinternals %u\n"
++ "\t\tdescriptors %u\n",
+ packed,
+ packed_leaves, full_blocks, having_ih_array,
+ bad_leaves, internals, descs);
+--- a/debugreiserfs/scan.c
++++ b/debugreiserfs/scan.c
+@@ -1032,7 +1032,7 @@ void do_scan (reiserfs_filsys_t * fs)
+ /* step 2: */
+ done = 0;
+ total = reiserfs_bitmap_ones (input_bitmap (fs));
+- printf ("%ld bits set in bitmap\n", total);
++ printf ("%lu bits set in bitmap\n", total);
+ for (i = 0; i < get_sb_block_count (fs->fs_ondisk_sb); i ++) {
+ int type;
+
+--- a/debugreiserfs/stat.c
++++ b/debugreiserfs/stat.c
+@@ -245,7 +245,7 @@ void do_stat (reiserfs_filsys_t * fs)
+ reiserfs_exit (1, "could not open %s to save bitmap: %m\n",
+ input_bitmap_file_name(fs));
+ }
+- reiserfs_warning (stderr, "Updated bitmap contains %d blocks marked\n",
++ reiserfs_warning (stderr, "Updated bitmap contains %u blocks marked\n",
+ reiserfs_bitmap_ones (input_bitmap (fs)));
+
+ reiserfs_bitmap_save (fp, input_bitmap (fs));
+--- a/fsck/check_tree.c
++++ b/fsck/check_tree.c
+@@ -119,7 +119,7 @@ static int is_block_free (reiserfs_filsy
+ }
+
+
+-/*static int hits = 0;*/
++/*static unsigned int hits = 0;*/
+
+ /* we have seen this block in the tree, mark corresponding bit in the
+ control bitmap */
+@@ -156,7 +156,7 @@ static void init_control_bitmap (reiserf
+ for (i = 0; i <= fs->fs_super_bh->b_blocknr; i ++)
+ we_met_it (i);
+
+- /*printf ("SKIPPED: %d blocks marked used (%d)\n", hits,
++ /*printf ("SKIPPED: %u blocks marked used (%d)\n", hits,
+ reiserfs_bitmap_zeros (control_bitmap));
+ hits = 0;*/
+
+@@ -172,7 +172,7 @@ static void init_control_bitmap (reiserf
+ block ++;
+ }
+
+- /*printf ("BITMAPS: %d blocks marked used (%d)\n", hits,
++ /*printf ("BITMAPS: %u blocks marked used (%d)\n", hits,
+ reiserfs_bitmap_zeros (control_bitmap));
+
+ hits = 0;*/
+--- a/fsck/pass0.c
++++ b/fsck/pass0.c
+@@ -1759,7 +1759,7 @@ static void init_source_bitmap (reiserfs
+ case ALL_BLOCKS:
+ fsck_source_bitmap (fs) = reiserfs_create_bitmap (block_count);
+ reiserfs_bitmap_fill (fsck_source_bitmap (fs));
+- fsck_progress ("The whole partition (%d blocks) is to be scanned\n",
++ fsck_progress ("The whole partition (%u blocks) is to be scanned\n",
+ reiserfs_bitmap_ones (fsck_source_bitmap (fs)));
+ break;
+
+@@ -1768,7 +1768,7 @@ static void init_source_bitmap (reiserfs
+ fsck_source_bitmap (fs) = reiserfs_create_bitmap (block_count);
+ reiserfs_bitmap_copy (fsck_source_bitmap (fs), fs->fs_bitmap2);
+
+- fsck_progress ("ok, %d blocks marked used\n",
++ fsck_progress ("ok, %u blocks marked used\n",
+ reiserfs_bitmap_ones (fsck_source_bitmap (fs)));
+ break;
+
+@@ -1787,7 +1787,7 @@ static void init_source_bitmap (reiserfs
+ fsck_data (fs)->rebuild.bitmap_file_name);
+ }
+
+- fsck_progress ("%d blocks marked used in extern bitmap\n",
++ fsck_progress ("%u blocks marked used in extern bitmap\n",
+ reiserfs_bitmap_ones (fsck_source_bitmap (fs)));
+ fclose (fp);
+ break;
+@@ -1863,8 +1863,8 @@ static void init_source_bitmap (reiserfs
+
+ fsck_source_bitmap (fs)->bm_set_bits = reiserfs_bitmap_ones (fsck_source_bitmap (fs));
+
+- fsck_progress ("Skipping %d blocks (super block, journal, "
+- "bitmaps) %d blocks will be read\n", tmp, fsck_source_bitmap (fs)->bm_set_bits);
++ fsck_progress ("Skipping %u blocks (super block, journal, "
++ "bitmaps) %u blocks will be read\n", tmp, fsck_source_bitmap (fs)->bm_set_bits);
+
+ }
+
+--- a/fsck/pass1.c
++++ b/fsck/pass1.c
+@@ -646,8 +646,8 @@ void load_pass_1_result (FILE * fp, reis
+ fetch_objectid_map (proper_id_map (fs), fs);
+ */
+
+- fsck_progress ("Pass 1 result loaded. %d blocks used, %d allocable, "
+- "still to be inserted %d\n",
++ fsck_progress ("Pass 1 result loaded. %u blocks used, %u allocable, "
++ "still to be inserted %u\n",
+ reiserfs_bitmap_ones (fsck_new_bitmap (fs)),
+ reiserfs_bitmap_zeros (fsck_allocable_bitmap (fs)),
+ reiserfs_bitmap_zeros (fsck_uninsertables (fs)));
+--- a/include/reiserfs_fs.h
++++ b/include/reiserfs_fs.h
+@@ -32,6 +32,8 @@
+ #ifndef REISERFSPROGS_FS_H
+ #define REISERFSPRIGS_FS_H
+
++typedef unsigned int blocknr_t;
++
+ #ifndef NO_EXTERN_INLINE
+ # define extern_inline extern inline
+ #else
+--- a/lib/io.c
++++ b/lib/io.c
+@@ -628,7 +628,7 @@ void close_rollback_file () {
+ return;
+ fwrite (&rollback_blocks_number, sizeof (rollback_blocksize), 1, s_rollback_file);
+ if (log_file != 0)
+- fprintf (log_file, "rollback: %d blocks backed up\n", rollback_blocks_number);
++ fprintf (log_file, "rollback: %u blocks backed up\n", rollback_blocks_number);
+ }
+
+ fclose (s_rollback_file);
+--- a/reiserfscore/journal.c
++++ b/reiserfscore/journal.c
+@@ -577,7 +577,7 @@ int reiserfs_create_journal(
+ {
+ /* host device does not contain enough blocks */
+ reiserfs_warning (stderr, "reiserfs_create_journal: cannot create "
+- "a journal of %lu blocks with %lu offset on %d blocks\n",
++ "a journal of %lu blocks with %lu offset on %u blocks\n",
+ len, offset, get_sb_block_count(sb));
+ return 0;
+ }
+--- a/reiserfscore/prints.c
++++ b/reiserfscore/prints.c
+@@ -148,7 +148,7 @@ static int print_disk_child (FILE * stre
+ int len;
+
+ dc = *((const struct disk_child **)(args[0]));
+- len = asprintf (&buffer, "[dc_number=%u, dc_size=%u]", get_dc_child_blocknr (dc),
++ len = asprintf (&buffer, "[dc_number=%lu, dc_size=%u]", get_dc_child_blocknr (dc),
+ get_dc_child_size (dc));
+ FPRINTF;
+ }
+@@ -373,9 +373,9 @@ static void print_sequence (FILE * fp, _
+ return;
+
+ if (len == 1)
+- reiserfs_warning (fp, " %d", le32_to_cpu (start));
++ reiserfs_warning (fp, " %u", le32_to_cpu (start));
+ else
+- reiserfs_warning (fp, " %d(%d)", le32_to_cpu (start), len);
++ reiserfs_warning (fp, " %u(%d)", le32_to_cpu (start), len);
+ }
+
+
+@@ -491,7 +491,7 @@ static int print_internal (FILE * fp, st
+ to = last < B_NR_ITEMS (bh) ? last : B_NR_ITEMS (bh);
+ }
+
+- reiserfs_warning (fp, "INTERNAL NODE (%ld) contains %b\n", bh->b_blocknr, bh);
++ reiserfs_warning (fp, "INTERNAL NODE (%lu) contains %b\n", bh->b_blocknr, bh);
+
+ dc = B_N_CHILD (bh, from);
+ reiserfs_warning (fp, "PTR %d: %y ", from, dc);
+@@ -527,7 +527,7 @@ static int print_leaf (FILE * fp, reiser
+
+ reiserfs_warning (fp,
+ "\n===================================================================\n");
+- reiserfs_warning (fp, "LEAF NODE (%ld) contains %b (real items %d)\n",
++ reiserfs_warning (fp, "LEAF NODE (%lu) contains %b (real items %d)\n",
+ bh->b_blocknr, bh, real_nr);
+
+ if (!(print_mode & PRINT_TREE_DETAILS)) {
+@@ -761,7 +761,7 @@ void print_block (FILE * fp, reiserfs_fi
+ if (print_super_block (fp, fs, file_name, bh, 0))
+ if (print_leaf (fp, fs, bh, mode, first, last))
+ if (print_internal (fp, bh, first, last))
+- reiserfs_warning (fp, "Block %ld contains unformatted data\n", bh->b_blocknr);
++ reiserfs_warning (fp, "Block %lu contains unformatted data\n", bh->b_blocknr);
+ }
+
+
+@@ -797,7 +797,7 @@ void print_tb (int mode, int item_pos, i
+ tbSh = 0;
+ tbFh = 0;
+ }
+- printf ("* %u * %3lu(%2lu) * %3lu(%2lu) * %3lu(%2lu) * %5ld * %5ld * %5ld * %5ld * %5ld *\n",
++ printf ("* %u * %3lu(%2lu) * %3lu(%2lu) * %3lu(%2lu) * %5lu * %5lu * %5lu * %5lu * %5lu *\n",
+ h,
+ tbSh ? tbSh->b_blocknr : ~0ul,
+ tbSh ? tbSh->b_count : ~0ul,
+--- a/reiserfscore/reiserfslib.c
++++ b/reiserfscore/reiserfslib.c
+@@ -59,7 +59,8 @@ reiserfs_filsys_t * reiserfs_open (char
+ reiserfs_filsys_t * fs;
+ struct buffer_head * bh;
+ struct reiserfs_super_block * sb;
+- int fd, i;
++ int fd;
++ unsigned int i;
+
+ /* convert root dir key and parent root dir key to little endian format */
+ make_const_keys ();
+@@ -200,7 +201,7 @@ reiserfs_filsys_t * reiserfs_create (cha
+ block_size, block_count, 0))
+ {
+ reiserfs_warning (stderr, "reiserfs_create: can not create that small "
+- "(%d blocks) filesystem\n", block_count);
++ "(%u blocks) filesystem\n", block_count);
+ return 0;
+ }
+
+--- a/reiserfscore/stree.c
++++ b/reiserfscore/stree.c
+@@ -313,7 +313,7 @@ int search_by_key (reiserfs_filsys_t * f
+ int n_stop_level) /* How far down the tree to search.*/
+ {
+ struct reiserfs_super_block * sb;
+- int n_block_number,
++ unsigned int n_block_number,
+ expected_level,
+ n_block_size = fs->fs_blocksize;
+ struct buffer_head * p_s_bh;
diff --git a/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fsck-n.patch b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fsck-n.patch
new file mode 100644
index 000000000000..0eacd22f66d3
--- /dev/null
+++ b/sys-fs/reiserfsprogs/files/reiserfsprogs-3.6.21-fsck-n.patch
@@ -0,0 +1,14 @@
+--- fsck/main.c
++++ fsck/main.c
+@@ -421,8 +421,9 @@
+ (data->log == stdout) ? "stdout" :
+ (data->log_file_name ? data->log_file_name : "fsck.run"));
+
+- if (!(data->options & OPT_YES) && !user_confirmed (warn_to, "\nDo you want to "
+- "run this program?[N/Yes] (note need to type Yes if you do):", "Yes\n"))
++ if (!(data->options & OPT_YES) && !(data->options & OPT_SILENT) &&
++ !user_confirmed (warn_to, "\nDo you want to run this program?[N/Yes] "
++ "(note need to type Yes if you do):", "Yes\n"))
+ exit (EXIT_USER);
+ }
+
diff --git a/sys-fs/reiserfsprogs/metadata.xml b/sys-fs/reiserfsprogs/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/reiserfsprogs/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/reiserfsprogs/reiserfsprogs-3.6.21-r1.ebuild b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.21-r1.ebuild
new file mode 100644
index 000000000000..020a7e4db5a0
--- /dev/null
+++ b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.21-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Reiserfs Utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/fs/reiserfs/"
+SRC_URI="mirror://kernel/linux/utils/fs/reiserfs/${P}.tar.gz
+ mirror://kernel/linux/kernel/people/jeffm/${PN}/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 -sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fsck-n.patch
+ epatch "${FILESDIR}"/${P}-fix_large_fs.patch
+}
+
+src_configure() {
+ econf --prefix="${EPREFIX}/"
+}
+
+src_install() {
+ default
+ dosym reiserfsck /sbin/fsck.reiserfs
+ dosym mkreiserfs /sbin/mkfs.reiserfs
+}
diff --git a/sys-fs/reiserfsprogs/reiserfsprogs-3.6.23.ebuild b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.23.ebuild
new file mode 100644
index 000000000000..12e177f6ac69
--- /dev/null
+++ b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.23.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit flag-o-matic
+
+DESCRIPTION="Reiserfs Utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/fs/reiserfs/"
+SRC_URI="mirror://kernel/linux/utils/fs/reiserfs/${P}.tar.xz
+ mirror://kernel/linux/kernel/people/jeffm/${PN}/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 -sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+src_configure() {
+ append-flags -std=gnu89 #427300
+ econf --prefix="${EPREFIX}/"
+}
diff --git a/sys-fs/reiserfsprogs/reiserfsprogs-3.6.24.ebuild b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.24.ebuild
new file mode 100644
index 000000000000..33b8e5671a46
--- /dev/null
+++ b/sys-fs/reiserfsprogs/reiserfsprogs-3.6.24.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit flag-o-matic
+
+DESCRIPTION="Reiserfs Utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/fs/reiserfs/"
+SRC_URI="mirror://kernel/linux/utils/fs/reiserfs/${P}.tar.xz
+ mirror://kernel/linux/kernel/people/jeffm/${PN}/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 -sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+src_configure() {
+ append-flags -std=gnu89 #427300
+ econf --prefix="${EPREFIX}/"
+}
diff --git a/sys-fs/s3backer/Manifest b/sys-fs/s3backer/Manifest
new file mode 100644
index 000000000000..000ccbecf5b9
--- /dev/null
+++ b/sys-fs/s3backer/Manifest
@@ -0,0 +1 @@
+DIST s3backer-1.3.7.tar.gz 179068 SHA256 7a6f028d16301b0fd32679eebe34ff2d614f343979ee7a0fab0110b85934aaca SHA512 c3fae911e6b39cb211ac5d85c3d75cb6fd823243879d98d2a2b18644d22fe5a70a293d06c4e3c6559452d39cec80bbac9cea76965ead451bb0a145a61df8bc83 WHIRLPOOL 6906cb833deffb4218cfaca28f7f88116aff1dab7ddfd764452600b13b250da27ac672d98597f8f848b26bfcd70648291f97d2cd91155bb72c995792a6375bfe
diff --git a/sys-fs/s3backer/metadata.xml b/sys-fs/s3backer/metadata.xml
new file mode 100644
index 000000000000..45fcce25c7e2
--- /dev/null
+++ b/sys-fs/s3backer/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">s3backer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/s3backer/s3backer-1.3.7.ebuild b/sys-fs/s3backer/s3backer-1.3.7.ebuild
new file mode 100644
index 000000000000..37811d8c6dc6
--- /dev/null
+++ b/sys-fs/s3backer/s3backer-1.3.7.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+
+DESCRIPTION="FUSE-based single file backing store via Amazon S3"
+HOMEPAGE="http://code.google.com/p/s3backer"
+SRC_URI="http://s3backer.googlecode.com/files/s3backer-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="net-misc/curl
+ sys-fs/fuse
+ sys-libs/zlib
+ dev-libs/expat
+ dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -e "/docdir=/s:packages/\$(PACKAGE):${PF}:" \
+ -e "/doc_DATA=/d" \
+ -i Makefile.am || die
+
+ eautoreconf
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}"
+}
diff --git a/sys-fs/s3fs/Manifest b/sys-fs/s3fs/Manifest
new file mode 100644
index 000000000000..250bcb88e78a
--- /dev/null
+++ b/sys-fs/s3fs/Manifest
@@ -0,0 +1,2 @@
+DIST s3fs-1.74.tar.gz 199120 SHA256 d77d540582fe8287354fd3637e48064f81f6fe80c5f0e0f8253221c56b892b88 SHA512 c9f6e2a113d2cfb9d6ac485d58ae8ebf317b9fc29b2fab34de427f206902eda22de056cbcdbc0e8cdebeff7900793e96a87f4ad8a3b1add85433a617ba53889d WHIRLPOOL 3572602fb3fe71e1e17d46925fc3459623fc7e9dcad1bfeee6120bba5d57005eacccbb87b786af74af62cc3f2ec87dce965a05a4c5645f6b5d035a578c617568
+DIST s3fs-1.78.tar.gz 99538 SHA256 36c0b00a294d9676c462985c0c3f1362540e8ebc61c15bacb45e28a2f00297f5 SHA512 ba0ad1ee5fc3c31d5b98dc7511abc8e74e91649af27aaaf5ecdca76cc7503bf66118638f983199bcdcaa51897f1bfa802310db9e2b72538d9f345f6942a3a8d0 WHIRLPOOL 1c9c5589475c0d545657973d638d51deac3266b0878fe27a114bd3da938455c56d941183783b264e226fa7c4976b357f4009063c985311bcf27749f7b454690f
diff --git a/sys-fs/s3fs/metadata.xml b/sys-fs/s3fs/metadata.xml
new file mode 100644
index 000000000000..e903c6dbb70c
--- /dev/null
+++ b/sys-fs/s3fs/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">s3fs is a utility to mount Amazon S3 as a filesystem over FUSE</longdescription>
+ <upstream>
+ <remote-id type="google-code">s3fs</remote-id>
+ <remote-id type="github">s3fs-fuse/s3fs-fuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/s3fs/s3fs-1.74.ebuild b/sys-fs/s3fs/s3fs-1.74.ebuild
new file mode 100644
index 000000000000..b2fe0812df9e
--- /dev/null
+++ b/sys-fs/s3fs/s3fs-1.74.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="Amazon mounting S3 via fuse"
+HOMEPAGE="http://s3fs.googlecode.com/"
+SRC_URI="http://s3fs.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+CDEPEND=">=dev-libs/libxml2-2.6:2
+ dev-libs/openssl
+ >=net-misc/curl-7.0
+ >=sys-fs/fuse-2.8.4"
+RDEPEND="${CDEPEND}
+ app-misc/mime-types"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test"
diff --git a/sys-fs/s3fs/s3fs-1.78.ebuild b/sys-fs/s3fs/s3fs-1.78.ebuild
new file mode 100644
index 000000000000..34cc4f8a7480
--- /dev/null
+++ b/sys-fs/s3fs/s3fs-1.78.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+
+MY_PN=${PN}-fuse
+MY_P=${MY_PN}-${PV}
+
+DESCRIPTION="Amazon mounting S3 via fuse"
+HOMEPAGE="https://github.com/s3fs-fuse/s3fs-fuse/"
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+CDEPEND=">=dev-libs/libxml2-2.6:2
+ dev-libs/openssl
+ >=net-misc/curl-7.0
+ >=sys-fs/fuse-2.8.4"
+RDEPEND="${CDEPEND}
+ app-misc/mime-types"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ eautoreconf
+}
diff --git a/sys-fs/s3ql/Manifest b/sys-fs/s3ql/Manifest
new file mode 100644
index 000000000000..d7b442321e44
--- /dev/null
+++ b/sys-fs/s3ql/Manifest
@@ -0,0 +1,4 @@
+DIST s3ql-1.19.tar.bz2 641689 SHA256 280271c156d027583ba4aa94c2fd189c3d63dd833cd4fd3c5c84bf97cb2d96c7 SHA512 5751f4d21abdc3996d877785bb07752fca75ec60ad716a102f666b5329e9b225519c4365c93031e056db78e3bffc80a7a1afe227c375e1c19e35b8bdffe5a0bf WHIRLPOOL e7025a95cf9aaf48ec7a7091e0d91cca1f8d15cf62901cbf9fb853b4c3b09ffe9e4ca6b1added432825c3dccec398ff31c85fba9375a72fd489bffcbf0f3c399
+DIST s3ql-2.11.1.tar.bz2 897259 SHA256 15c09a7b733d2b7a0eced31f0bfc4b423f27c70b5f20ce47d2f2ab270a829560 SHA512 72e873f0d23dd86ca5f7a65809189225feff0f6f14bb046dcc8117f3eb725c3327408fe504ffd80566d70bad620b5f5c34174784f1d318bf1f7e6abf4edcb1a7 WHIRLPOOL a59c4c3735081e21dc103dbf531c162bfcaa7fae45b7d8ef81e5dadeaf24588fed1cfc913643c64bc39e52df47f1a21d2b8f4920cdb2632f1053ae4cc7ff9363
+DIST s3ql-2.11.tar.bz2 867710 SHA256 bfa893ffbe26f3b3480c6e60664ca33af3c3d65b05767b759d5ed6b580c57b3e SHA512 86f3cb3294f38ab25ddf593dae2ea36af6d4df8871e15b3c99bddd7c8c5c038ab5cd0adaf067afb508dd3f7e163e8b86ab7994f2401cf33543cdeb43bc9fdb9d WHIRLPOOL a4e01f0971e687da594d1c106866cf05b7010e56091c6ddad635039d455a7c8973a6fb37de1ffa71efd1b314cbd533ac380c8b508e7e4e9c752a40300f1d9126
+DIST s3ql-2.12.tar.bz2 906837 SHA256 1b8c727fe2490328ba880218c57e29b2c3376600e529f576629c443a5b7c8b81 SHA512 51c90a983a6b076fd70468406e6a1c74592b85458068bc07325d43b75d1ca50fb80694fcab83e6c41a1e3ac8209a203716624971be1cecc9cad75a8f3f4761d9 WHIRLPOOL d5225a104c7b02fe0a17a86ad6f48eeb17265aa74a2de793829b5a3b84a3d60ec5039839f801a1c8648f58e5007ba021ca949a7384842993f2b4a3e3e06f4393
diff --git a/sys-fs/s3ql/metadata.xml b/sys-fs/s3ql/metadata.xml
new file mode 100644
index 000000000000..02d68c07b662
--- /dev/null
+++ b/sys-fs/s3ql/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <use>
+ <flag name="contrib">Install additional contributed scripts</flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">s3ql</remote-id>
+ <remote-id type="bitbucket">nikratio/s3ql</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/s3ql/s3ql-1.19.ebuild b/sys-fs/s3ql/s3ql-1.19.ebuild
new file mode 100644
index 000000000000..14374669fd24
--- /dev/null
+++ b/sys-fs/s3ql/s3ql-1.19.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="A full-featured file system for online data storage"
+HOMEPAGE="https://bitbucket.org/nikratio/s3ql/"
+SRC_URI="https://www.bitbucket.org/nikratio/s3ql/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="contrib doc test"
+
+RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ >=dev-python/apsw-3.7.0[${PYTHON_USEDEP}]
+ >=dev-python/llfuse-0.37[${PYTHON_USEDEP}]
+ dev-python/pycryptopp[${PYTHON_USEDEP}]
+ dev-python/pyliblzma[${PYTHON_USEDEP}]
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/pytest[${PYTHON_USEDEP}]
+ net-misc/rsync[xattr]
+ )"
+
+python_prepare_all() {
+ # use system setuptools
+ sed -i '/use_setuptools/d' setup.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ if [[ ${EUID} -ne 0 ]] ; then
+ ewarn "Skipping tests: root privileges are required so userpriv must be disabled"
+ else
+ addwrite /dev/fuse
+ esetup.py test
+ fi
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use contrib ; then
+ exeinto /usr/share/doc/${PF}/contrib
+ docompress -x /usr/share/doc/${PF}/contrib
+ doexe contrib/*.{py,sh}
+ doman contrib/*.1
+ fi
+
+ if use doc ; then
+ dodoc doc/manual.pdf
+ dohtml -r doc/html/*
+ fi
+}
diff --git a/sys-fs/s3ql/s3ql-2.11.1.ebuild b/sys-fs/s3ql/s3ql-2.11.1.ebuild
new file mode 100644
index 000000000000..cf5f32acae4c
--- /dev/null
+++ b/sys-fs/s3ql/s3ql-2.11.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python3_{3,4} )
+
+inherit distutils-r1
+
+DESCRIPTION="A full-featured file system for online data storage"
+HOMEPAGE="https://bitbucket.org/nikratio/s3ql/"
+SRC_URI="https://www.bitbucket.org/nikratio/s3ql/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="contrib doc test"
+
+RDEPEND=">=dev-db/sqlite-3.7.0:3
+ dev-python/defusedxml[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ >=dev-python/apsw-3.7.0[${PYTHON_USEDEP}]
+ >=dev-python/dugong-3.2[${PYTHON_USEDEP}]
+ >=dev-python/llfuse-0.39[${PYTHON_USEDEP}]
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/pytest[${PYTHON_USEDEP}]
+ net-misc/rsync[xattr]
+ )"
+
+RESTRICT="test"
+
+python_test() {
+ addwrite /dev/fuse
+ py.test -v tests || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use contrib ; then
+ exeinto /usr/share/doc/${PF}/contrib
+ docompress -x /usr/share/doc/${PF}/contrib
+ doexe contrib/*.{py,sh}
+ doman contrib/*.1
+ fi
+
+ if use doc ; then
+ dodoc doc/manual.pdf
+ dohtml -r doc/html/*
+ fi
+}
diff --git a/sys-fs/s3ql/s3ql-2.11.ebuild b/sys-fs/s3ql/s3ql-2.11.ebuild
new file mode 100644
index 000000000000..cf5f32acae4c
--- /dev/null
+++ b/sys-fs/s3ql/s3ql-2.11.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python3_{3,4} )
+
+inherit distutils-r1
+
+DESCRIPTION="A full-featured file system for online data storage"
+HOMEPAGE="https://bitbucket.org/nikratio/s3ql/"
+SRC_URI="https://www.bitbucket.org/nikratio/s3ql/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="contrib doc test"
+
+RDEPEND=">=dev-db/sqlite-3.7.0:3
+ dev-python/defusedxml[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ >=dev-python/apsw-3.7.0[${PYTHON_USEDEP}]
+ >=dev-python/dugong-3.2[${PYTHON_USEDEP}]
+ >=dev-python/llfuse-0.39[${PYTHON_USEDEP}]
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/pytest[${PYTHON_USEDEP}]
+ net-misc/rsync[xattr]
+ )"
+
+RESTRICT="test"
+
+python_test() {
+ addwrite /dev/fuse
+ py.test -v tests || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use contrib ; then
+ exeinto /usr/share/doc/${PF}/contrib
+ docompress -x /usr/share/doc/${PF}/contrib
+ doexe contrib/*.{py,sh}
+ doman contrib/*.1
+ fi
+
+ if use doc ; then
+ dodoc doc/manual.pdf
+ dohtml -r doc/html/*
+ fi
+}
diff --git a/sys-fs/s3ql/s3ql-2.12.ebuild b/sys-fs/s3ql/s3ql-2.12.ebuild
new file mode 100644
index 000000000000..cf5f32acae4c
--- /dev/null
+++ b/sys-fs/s3ql/s3ql-2.12.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python3_{3,4} )
+
+inherit distutils-r1
+
+DESCRIPTION="A full-featured file system for online data storage"
+HOMEPAGE="https://bitbucket.org/nikratio/s3ql/"
+SRC_URI="https://www.bitbucket.org/nikratio/s3ql/downloads/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="contrib doc test"
+
+RDEPEND=">=dev-db/sqlite-3.7.0:3
+ dev-python/defusedxml[${PYTHON_USEDEP}]
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ >=dev-python/apsw-3.7.0[${PYTHON_USEDEP}]
+ >=dev-python/dugong-3.2[${PYTHON_USEDEP}]
+ >=dev-python/llfuse-0.39[${PYTHON_USEDEP}]
+ dev-python/pycrypto[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ sys-fs/fuse"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/pytest[${PYTHON_USEDEP}]
+ net-misc/rsync[xattr]
+ )"
+
+RESTRICT="test"
+
+python_test() {
+ addwrite /dev/fuse
+ py.test -v tests || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ if use contrib ; then
+ exeinto /usr/share/doc/${PF}/contrib
+ docompress -x /usr/share/doc/${PF}/contrib
+ doexe contrib/*.{py,sh}
+ doman contrib/*.1
+ fi
+
+ if use doc ; then
+ dodoc doc/manual.pdf
+ dohtml -r doc/html/*
+ fi
+}
diff --git a/sys-fs/safecopy/Manifest b/sys-fs/safecopy/Manifest
new file mode 100644
index 000000000000..2e50e7f6425e
--- /dev/null
+++ b/sys-fs/safecopy/Manifest
@@ -0,0 +1 @@
+DIST safecopy-1.7.tar.gz 398465 SHA256 42fbed5d4764020eb0f34d95e97a0e14e62d801c3ef80f89bd497d94d39cc4fd SHA512 ecba54ecc0e0dc13dd6339f8c8dc311fc3ad41ef23318c1aa2a7f6bb7f1529389bedf7b58ea72486c083d39032a6e4a775e5a555a1ff96c669fa7fbd6c1fb868 WHIRLPOOL e71dd8c5db77a53a1cb088d964f1496581ef3ca7d534413f5bd20a3939b32fcab869aaaf05395bbcfd7289982be1c2e4065a55470f5a852b8c552dd8578cd09f
diff --git a/sys-fs/safecopy/metadata.xml b/sys-fs/safecopy/metadata.xml
new file mode 100644
index 000000000000..95aac75c6a48
--- /dev/null
+++ b/sys-fs/safecopy/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>chewi@gentoo.org</email>
+ <name>James Le Cuirot</name>
+ </maintainer>
+ <longdescription>safecopy is a data recovery tool which tries to extract as much data as possible from a problematic (i.e. damaged sectors) source - like floppy drives, hard disk partitions, CDs, tape devices, ..., where other tools like dd would fail due to I/O errors.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">safecopy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/safecopy/safecopy-1.7.ebuild b/sys-fs/safecopy/safecopy-1.7.ebuild
new file mode 100644
index 000000000000..7a1672e93a3c
--- /dev/null
+++ b/sys-fs/safecopy/safecopy-1.7.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit base
+
+DESCRIPTION="Data recovery tool to fault-tolerantly extract data from damaged (io-errors) devices or files"
+HOMEPAGE="http://safecopy.sourceforge.net"
+SRC_URI="mirror://sourceforge/safecopy/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="test"
+
+RDEPEND=""
+DEPEND=""
+
+DOCS=( README )
+
+src_prepare() {
+ base_src_prepare
+ sed -e 's:bin/sh:bin/bash:' \
+ -i "${S}"/test/test.sh || die
+}
+
+src_configure() {
+ econf
+ if use test; then
+ cd "${S}"/simulator
+ econf
+ fi
+}
+
+src_compile() {
+ emake
+ if use test; then
+ cd "${S}"/simulator
+ emake
+ fi
+}
+
+src_test() {
+ cd "${S}"/test
+ ./test.sh || die
+}
diff --git a/sys-fs/scan-ffs/Manifest b/sys-fs/scan-ffs/Manifest
new file mode 100644
index 000000000000..5ca450f8b5b4
--- /dev/null
+++ b/sys-fs/scan-ffs/Manifest
@@ -0,0 +1 @@
+DIST scan_ffs-1.2.tar.bz2 5119 SHA256 a6d52583a275c02ca8c504a302e065b20512da5795cd2929cda13184c5305d4a SHA512 5b4260148a6997bd246a69c4c66069d5b0ac811ea0477e58ea2eb8594fceb3013f8f056eeebc703b1bcba8839e16eaeb177af254c7bba264ab791686986eecbf WHIRLPOOL 90d5b2ecd72ebc14cf4f8b9e1fe04be623a2853e7c492ad6121a54e11e2d066122b7cfc2b608d0566c54ec19fc9932539a50c6356a3c5f8f6380395be2ba4006
diff --git a/sys-fs/scan-ffs/metadata.xml b/sys-fs/scan-ffs/metadata.xml
new file mode 100644
index 000000000000..9c79e985dd9f
--- /dev/null
+++ b/sys-fs/scan-ffs/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>bsd</herd>
+<longdescription>
+scan_ffs(8) recovers accidential lost or deleted disklabels.
+
+This is the life-saver of typos. If you have ever been working too long,
+and just happened to type 'disklabel -rw da0 floppy', instead of 'diskla-
+bel -rw fd0 floppy', you know what I am talking about.
+
+This little program will take a raw disk device (which you might have to
+create) that covers the whole disk, and finds all probable UFS/FFS parti-
+tions on the disk. It has various options to make it go faster, and to
+print out information to help in the reconstruction of the disklabel.
+
+Ported from OpenBSD to FreeBSD 4/5 with support for UFS1 and UFS2.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-fs/scan-ffs/scan-ffs-1.2.ebuild b/sys-fs/scan-ffs/scan-ffs-1.2.ebuild
new file mode 100644
index 000000000000..b72b81109ce9
--- /dev/null
+++ b/sys-fs/scan-ffs/scan-ffs-1.2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit bsdmk
+
+MY_PN=${PN/-/_}
+MY_P=${MY_PN}-${PV}
+DESCRIPTION="Recovers lost disklabel"
+HOMEPAGE="http://www.ranner.eu/projects/"
+SRC_URI="http://www.ranner.eu/stuff/${MY_P}.tar.bz2"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/${MY_P}"
+
+src_install() {
+ bsdmk_src_install
+ dodoc README ChangeLog
+}
diff --git a/sys-fs/shake/Manifest b/sys-fs/shake/Manifest
new file mode 100644
index 000000000000..29dce23f682f
--- /dev/null
+++ b/sys-fs/shake/Manifest
@@ -0,0 +1 @@
+DIST shake-0.999.tar.bz2 37225 SHA256 f030d5ba5d4d2d449249c49b253a71de8c342b9b2f5e1e7d3e7ba5277e3f5e91 SHA512 7dbd61cb35f771ffae6ec90bcdbf0cc467166661a78379191c7cf888d5f32ad27ea56da739f8f39344a209003747de2be1b57f2335ddc5641f55605c15c84b78 WHIRLPOOL 1d7354dac8aa3582048e8f8532ee308a792c041f15dc7b1e9e68b86b7cbfa66a72bbf9bbca481a3ac9738cb505d529eecd9aae135f2a64cfe5570ace59b862d8
diff --git a/sys-fs/shake/files/shake-0.999-fix_stat_include.patch b/sys-fs/shake/files/shake-0.999-fix_stat_include.patch
new file mode 100644
index 000000000000..b55776397288
--- /dev/null
+++ b/sys-fs/shake/files/shake-0.999-fix_stat_include.patch
@@ -0,0 +1,22 @@
+diff -Naur shake-fs-0.999.orig/judge.c shake-fs-0.999/judge.c
+--- shake-fs-0.999.orig/judge.c 2013-01-21 13:21:17.171974754 +0100
++++ shake-fs-0.999/judge.c 2013-01-21 13:21:31.346958593 +0100
+@@ -26,7 +26,6 @@
+ #include <fcntl.h> // open()
+ #include <sys/types.h> // open(), umask()
+ #include <dirent.h> // scandir()
+-#include <sys/stat.h> // stat(), umask()
+ #include <unistd.h> // stat()
+ #include <stdio.h> // printf(), tmpfile()
+ #include <error.h> // error()
+diff -Naur shake-fs-0.999.orig/judge.h shake-fs-0.999/judge.h
+--- shake-fs-0.999.orig/judge.h 2013-01-21 13:21:17.171974754 +0100
++++ shake-fs-0.999/judge.h 2013-01-21 13:21:47.630940034 +0100
+@@ -22,6 +22,7 @@
+ #include <stdbool.h>
+ #include <fcntl.h>
+ #include <time.h>
++#include <sys/stat.h>
+ typedef unsigned int uint;
+ typedef long long int llint;
+
diff --git a/sys-fs/shake/files/shake-0.999-uclibc.patch b/sys-fs/shake/files/shake-0.999-uclibc.patch
new file mode 100644
index 000000000000..2c54df0b552c
--- /dev/null
+++ b/sys-fs/shake/files/shake-0.999-uclibc.patch
@@ -0,0 +1,49 @@
+--- shake-fs-0.999-orig/executive.c
++++ shake-fs-0.999/executive.c
+@@ -214,12 +214,21 @@ release (struct accused *a, struct law *
+ assert (a->fd >= 0);
+ /* Restores mtime */
+ {
++#ifdef __UCLIBC__
++ struct timespec tv[2];
++ tv[0].tv_sec = a->atime;
++ tv[0].tv_nsec = 0;
++ tv[1].tv_sec = a->mtime;
++ tv[1].tv_nsec = 0;
++ futimens (a->fd, tv);
++#else
+ struct timeval tv[2];
+ tv[0].tv_sec = a->atime;
+ tv[0].tv_usec = 0;
+ tv[1].tv_sec = a->mtime;
+ tv[1].tv_usec = 0;
+ futimes (a->fd, tv);
++#endif
+ }
+ if (has_been_unlocked (a, l))
+ error (0, 0, "%s: concurent accesses", a->name);
+--- shake-fs-0.999-orig/linux.h
++++ shake-fs-0.999/linux.h
+@@ -32,7 +32,6 @@
+ /* Called once, perform OS-specific tasks.
+ */
+ int os_specific_setup (const char *tempfile);
+-
+
+
+ /* Get a write lock on the file.
+@@ -54,12 +53,13 @@ int readlock_to_writelock (int fd);
+ /* Return true if fd is locked, else false
+ */
+ bool is_locked (int fd);
+-
+
+
++#ifndef __UCLIBC__
+ /* Declares the glibc function
+ */
+ int futimes (int fd, const struct timeval tv[2]);
++#endif
+
+ /* Set the shake_ptime field and ctime of the file to the actual date.
+ */
diff --git a/sys-fs/shake/metadata.xml b/sys-fs/shake/metadata.xml
new file mode 100644
index 000000000000..b61b80f7ab1c
--- /dev/null
+++ b/sys-fs/shake/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>voyageur@gentoo.org</email>
+ </maintainer>
+ <longdescription>Shake is a defragmenter that runs in userspace, without
+then need of patching the kernel and while the system is used </longdescription>
+</pkgmetadata>
diff --git a/sys-fs/shake/shake-0.999.ebuild b/sys-fs/shake/shake-0.999.ebuild
new file mode 100644
index 000000000000..b58f1b6cae7c
--- /dev/null
+++ b/sys-fs/shake/shake-0.999.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit cmake-utils eutils
+
+DESCRIPTION="defragmenter that runs in userspace while the system is used"
+HOMEPAGE="http://vleu.net/shake/"
+SRC_URI="http://download.savannah.nongnu.org/releases/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+RDEPEND="sys-apps/attr"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S=${WORKDIR}/${PN}-fs-${PV}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix_stat_include.patch
+ "${FILESDIR}"/${P}-uclibc.patch
+ )
diff --git a/sys-fs/siefs/Manifest b/sys-fs/siefs/Manifest
new file mode 100644
index 000000000000..7938f9db55c0
--- /dev/null
+++ b/sys-fs/siefs/Manifest
@@ -0,0 +1 @@
+DIST siefs-0.5.tar.gz 112466 SHA256 9e1d829de412446c7b2ce5ba1c9ca1f89206c42e8a510c920907d684e0b7f525
diff --git a/sys-fs/siefs/files/siefs-0.5-external-vmoconv.patch b/sys-fs/siefs/files/siefs-0.5-external-vmoconv.patch
new file mode 100644
index 000000000000..cb9688e24979
--- /dev/null
+++ b/sys-fs/siefs/files/siefs-0.5-external-vmoconv.patch
@@ -0,0 +1,12 @@
+diff -Nru siefs-0.5.orig/configure.in siefs-0.5/configure.in
+--- siefs-0.5.orig/configure.in 2005-04-04 05:15:31.000000000 +0000
++++ siefs-0.5/configure.in 2009-03-03 20:55:08.000000000 +0000
+@@ -50,7 +50,7 @@
+ AC_MSG_RESULT(${fuseinst})
+ AC_SUBST(fuseinst)
+
+-subdirs="siefs converter"
++subdirs="siefs"
+ AC_SUBST(subdirs)
+
+ AC_DEFINE_UNQUOTED(FUSEINST, "${fuseinst}")
diff --git a/sys-fs/siefs/files/siefs-0.5-qa-fixes.patch b/sys-fs/siefs/files/siefs-0.5-qa-fixes.patch
new file mode 100644
index 000000000000..dbd8a30fb1c7
--- /dev/null
+++ b/sys-fs/siefs/files/siefs-0.5-qa-fixes.patch
@@ -0,0 +1,55 @@
+diff -Nru siefs-0.5.orig/siefs/Makefile.am siefs-0.5/siefs/Makefile.am
+--- siefs-0.5.orig/siefs/Makefile.am 2005-04-05 14:36:28.000000000 +0000
++++ siefs-0.5/siefs/Makefile.am 2009-03-03 20:59:05.000000000 +0000
+@@ -9,8 +9,8 @@
+ slink_SOURCES = slink.c obex.c obex.h transport.c transport.h comm.c comm.h \
+ crcmodel.c crcmodel.h
+
+-LDADD = $(fuseinst)/lib/libfuse.a -lpthread
++LDADD = -lfuse -lpthread
+
+ install-exec-hook:
+- -rm -f /sbin/mount.siefs
+- -ln -s $(DESTDIR)$(bindir)/siefs /sbin/mount.siefs
++ -mkdir $(DESTDIR)/sbin/
++ -ln -s ..$(bindir)/siefs $(DESTDIR)/sbin/mount.siefs
+diff -Nru siefs-0.5.orig/siefs/charset.c siefs-0.5/siefs/charset.c
+--- siefs-0.5.orig/siefs/charset.c 2005-04-05 17:15:47.000000000 +0300
++++ siefs-0.5/siefs/charset.c 2007-05-23 14:13:19.000000000 +0300
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
+
+diff -Nru siefs-0.5.orig/siefs/comm.c siefs-0.5/siefs/comm.c
+--- siefs-0.5.orig/siefs/comm.c 2005-04-05 02:53:38.000000000 +0300
++++ siefs-0.5/siefs/comm.c 2007-05-23 14:12:32.000000000 +0300
+@@ -15,6 +15,7 @@
+ #include <termios.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <stdarg.h>
+ #include <errno.h>
+ #include "comm.h"
+@@ -114,7 +115,7 @@
+ if (fd < 0) return -1;
+ h->fd = fd;
+
+- bzero(&tio, sizeof(tio));
++ memset(&tio, 0, sizeof(tio));
+ f = commflags(h->speed);
+ if (f == -1) return -1;
+ tio.c_cflag = f;
+diff -Nru siefs-0.5.orig/siefs/transport.c siefs-0.5/siefs/transport.c
+--- siefs-0.5.orig/siefs/transport.c 2005-04-05 18:06:44.000000000 +0300
++++ siefs-0.5/siefs/transport.c 2007-05-23 14:13:00.000000000 +0300
+@@ -10,6 +10,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <errno.h>
+ #include "comm.h"
+ #include "crcmodel.h"
diff --git a/sys-fs/siefs/metadata.xml b/sys-fs/siefs/metadata.xml
new file mode 100644
index 000000000000..f7740ac73b8a
--- /dev/null
+++ b/sys-fs/siefs/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+</pkgmetadata>
diff --git a/sys-fs/siefs/siefs-0.5-r1.ebuild b/sys-fs/siefs/siefs-0.5-r1.ebuild
new file mode 100644
index 000000000000..8a9115a1c301
--- /dev/null
+++ b/sys-fs/siefs/siefs-0.5-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Siemens FS"
+HOMEPAGE="http://chaos.allsiemens.com/siefs"
+SRC_URI="http://chaos.allsiemens.com/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}/siefs"
+ epatch "${FILESDIR}"/${P}-qa-fixes.patch
+
+ sed -i "s:-rm -f /sbin/mount.siefs:-mkdir \$(DESTDIR)/sbin/:" Makefile.in
+ sed -i "s:-ln -s \$(DESTDIR)\$(bindir)/siefs /sbin/mount.siefs:-ln -s ..\$(bindir)/siefs \$(DESTDIR)/sbin/mount.siefs:" Makefile.in
+ sed -i "s:LDADD = \$(fuseinst)/lib/libfuse.a:LDADD = -lfuse:" Makefile.in
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+ dodoc README AUTHORS
+}
diff --git a/sys-fs/siefs/siefs-0.5-r2.ebuild b/sys-fs/siefs/siefs-0.5-r2.ebuild
new file mode 100644
index 000000000000..f580d9e6a870
--- /dev/null
+++ b/sys-fs/siefs/siefs-0.5-r2.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils autotools
+
+DESCRIPTION="Siemens FS"
+HOMEPAGE="http://chaos.allsiemens.com/siefs"
+SRC_URI="http://chaos.allsiemens.com/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}
+ app-mobilephone/vmoconv"
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-qa-fixes.patch
+ epatch "${FILESDIR}"/${P}-external-vmoconv.patch
+
+ eautoreconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc README AUTHORS
+}
diff --git a/sys-fs/simple-mtpfs/Manifest b/sys-fs/simple-mtpfs/Manifest
new file mode 100644
index 000000000000..7a5f16ea777d
--- /dev/null
+++ b/sys-fs/simple-mtpfs/Manifest
@@ -0,0 +1,2 @@
+DIST simple-mtpfs-0.1.tar.gz 116145 SHA256 052618c742e7b3faa95e1c84e8b9e1df1517dccb9460f538bb032223243588a1 SHA512 5c4b390c43ede521061c677b496d47376304a4625414853a2183a41cb4a2c67361ecd7e26d0b6197cc78e84d0a9c99ec92e85bd1c179784b5a7c06ae05ede308 WHIRLPOOL 4df83ffc56339df76124e22f93df8fcf188cad30da83f8a9349e5a8ad8ff64010a0d118bcd4a9719ee0e9a5e3cf2fd997af6f3220951792a5e8f00da3d4a0291
+DIST simple-mtpfs-0.2.tar.gz 35003 SHA256 3ce41fb194971041aa6ad15292a6cdad70eb8b5fc3e7a03a638bc3cac0c515ea SHA512 adb844288af214802ab6e0ddf949d2dc97ec03289db4b68c6b08da00534cdd48f621d8a52287b18d7826cabd78ddad2ca7ded6337016432c473e26c4c6f3c9e5 WHIRLPOOL 9b19d026da2786e8bd08b7c2ea4372cca6bb36e346e0430233af516db50c6d72cef88d65c5da92333941e353534fd486b932573602ea540bd0ba51117ea4c94c
diff --git a/sys-fs/simple-mtpfs/metadata.xml b/sys-fs/simple-mtpfs/metadata.xml
new file mode 100644
index 000000000000..4e5e1a98d139
--- /dev/null
+++ b/sys-fs/simple-mtpfs/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>sochotnicky@gentoo.org</email>
+ <name>Stanislav Ochotnicky</name>
+ </maintainer>
+ <longdescription lang="en">
+ SIMPLE-MTPFS (Simple Media Transfer Protocol FileSystem) is a file system for
+ Linux (and other operating systems with a FUSE implementation, such as Mac OS X
+ or FreeBSD) capable of operating on files on MTP devices attached via
+ USB to local machine. On the local computer where the SIMPLE-MTPFS is
+ mounted, the implementation makes use of the FUSE (Filesystem in Userspace)
+ kernel module. The practical effect of this is that the end user can seamlessly
+ interact with MTP device files.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">phatina/simple-mtpfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/simple-mtpfs/simple-mtpfs-0.1.ebuild b/sys-fs/simple-mtpfs/simple-mtpfs-0.1.ebuild
new file mode 100644
index 000000000000..0874155d432c
--- /dev/null
+++ b/sys-fs/simple-mtpfs/simple-mtpfs-0.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils eutils
+
+DESCRIPTION="Simple MTP fuse filesystem driver"
+HOMEPAGE="https://github.com/phatina/simple-mtpfs"
+SRC_URI="mirror://github/phatina/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+CDEPEND="media-libs/libmtp
+ >=sys-fs/fuse-2.8"
+
+DEPEND="virtual/pkgconfig
+ ${CDEPEND}"
+
+RDEPEND="${CDEPEND}"
+
+AUTOTOOLS_AUTORECONF=1
diff --git a/sys-fs/simple-mtpfs/simple-mtpfs-0.2.ebuild b/sys-fs/simple-mtpfs/simple-mtpfs-0.2.ebuild
new file mode 100644
index 000000000000..1f9cb413674f
--- /dev/null
+++ b/sys-fs/simple-mtpfs/simple-mtpfs-0.2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+EGIT_REPO_URI="git://github.com/phatina/${PN}.git"
+inherit autotools-utils eutils
+[[ ${PV} == 9999 ]] && inherit git-r3
+
+DESCRIPTION="Simple MTP fuse filesystem driver"
+HOMEPAGE="https://github.com/phatina/simple-mtpfs"
+[[ ${PV} == 9999 ]] || SRC_URI="https://github.com/phatina/${PN}/archive/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+[[ ${PV} == 9999 ]] || \
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ media-libs/libmtp
+ >=sys-fs/fuse-2.8
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+[[ ${PV} == 9999 ]] || S="${WORKDIR}/${PN}-${P}"
+
+AUTOTOOLS_AUTORECONF=1
diff --git a/sys-fs/simple-mtpfs/simple-mtpfs-9999.ebuild b/sys-fs/simple-mtpfs/simple-mtpfs-9999.ebuild
new file mode 100644
index 000000000000..1f9cb413674f
--- /dev/null
+++ b/sys-fs/simple-mtpfs/simple-mtpfs-9999.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+EGIT_REPO_URI="git://github.com/phatina/${PN}.git"
+inherit autotools-utils eutils
+[[ ${PV} == 9999 ]] && inherit git-r3
+
+DESCRIPTION="Simple MTP fuse filesystem driver"
+HOMEPAGE="https://github.com/phatina/simple-mtpfs"
+[[ ${PV} == 9999 ]] || SRC_URI="https://github.com/phatina/${PN}/archive/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+[[ ${PV} == 9999 ]] || \
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ media-libs/libmtp
+ >=sys-fs/fuse-2.8
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+[[ ${PV} == 9999 ]] || S="${WORKDIR}/${PN}-${P}"
+
+AUTOTOOLS_AUTORECONF=1
diff --git a/sys-fs/snapraid/Manifest b/sys-fs/snapraid/Manifest
new file mode 100644
index 000000000000..59e137b8082d
--- /dev/null
+++ b/sys-fs/snapraid/Manifest
@@ -0,0 +1,5 @@
+DIST snapraid-6.2.tar.gz 609619 SHA256 b182328227ed9b87b01037f7d005d38a6e3cfb0f675e919978c696dcc6246787 SHA512 c14d6e48d027589ea67de633b979c1a9770cfca7a35bd2a4053ec467ce7edad1c1b21884bcc6e3092a7016533ab1dc6c3a4c8e11f39172d6be8fc4f1b1c9bb9a WHIRLPOOL a0127f33cbbd97b1b39c0de0b0837336a0060c35ffa41c0b118d0cedcf9d69ddf929e824e68d8ba43271ec8a13d45ec1c19228962e155e97be5260fd266cc459
+DIST snapraid-6.3.tar.gz 615262 SHA256 1f1961385b865bff5282bd16aff76f372f3ed19b685ef7a3b27d907a499385d2 SHA512 52d9ce738c14f584e08b32dbb58ca43859e41a05cfd3baa3d15d0677d2b8335e05264429f1aa7e1e5c1c71b26f1ece304717bd0f82c3078464580a97cc0d6c6a WHIRLPOOL 73d79e621e795aea3572c8f9def149c2cddc31b380cc57581b8b96302f175957fb93dd48fccff7f5b52bc7b3e6fbd86415e8ba9498f630276dc8c8fc0cd036b0
+DIST snapraid-7.0.tar.gz 633959 SHA256 554684520204d45f8b7cee9abb0269dd2bdba272cb0130c3b26062bea551a791 SHA512 36acea57e277047f26380c3d97f6f2bb7907f046ff4001a59705c51c9e4184c4ea7d4f2d0c4eb767d9e395ab97453acbac73183ae6dd99e0ac0f12897cbad32c WHIRLPOOL 3b4950333043f8acbf7ff0c3e1172a190fad26963658b1103c8feeb6c05141b0b948f8c05b50afb90c1740947be1baa940db82096b61c87d25e9959b9d248049
+DIST snapraid-7.1.tar.gz 634036 SHA256 dd9005b6d7ea701e4aa0f854a0e34dabe68d7765b75f12fc6b3e1fda4d5c2cef SHA512 3f8f822c8937a66c17677a4d52c0b45ee73eeb032654b98c3012905ae436945276f127c43a48d07f5a4eb128d6bedbc3bdc4166e8a867ec12c7992726c6e6045 WHIRLPOOL ec0d0887a71d85c091c33c7859393b890b7a1ab37716e1ba4e592b62cf537f31b3920ad9069abf8860a7ea710cbb1f1f9a9a59feae7a2540eca9ed5b851b8d21
+DIST snapraid-8.1.tar.gz 669318 SHA256 6bf89a1319ac3403958cd2c98a9c6102728c0070cfa1aedd90c4561d93c54e5d SHA512 a505b85f80e2d06dbb0ad6f8680e1ce8178eafacc9be2fd232dbff853dcbd59389ae29e8a0144ba958d2180b4ddee5a50aa54d4ac5655f4fb2ed729a32bcae89 WHIRLPOOL ea7309509cb35ca4b46735dac931de48784dbf0ed21305de9f62c17c47c2a4395d3110b8a0a2f9313e8615a97814886365dcf6258ab9433d34aa37a62d573937
diff --git a/sys-fs/snapraid/metadata.xml b/sys-fs/snapraid/metadata.xml
new file mode 100644
index 000000000000..ed1a84e27183
--- /dev/null
+++ b/sys-fs/snapraid/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">snapraid</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/snapraid/snapraid-6.2.ebuild b/sys-fs/snapraid/snapraid-6.2.ebuild
new file mode 100644
index 000000000000..a971eab39120
--- /dev/null
+++ b/sys-fs/snapraid/snapraid-6.2.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="a backup program for disk array for home media centers"
+HOMEPAGE="http://snapraid.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+DOCS=( "AUTHORS" "HISTORY" "README" "TODO" "snapraid.conf.example" )
diff --git a/sys-fs/snapraid/snapraid-6.3.ebuild b/sys-fs/snapraid/snapraid-6.3.ebuild
new file mode 100644
index 000000000000..a971eab39120
--- /dev/null
+++ b/sys-fs/snapraid/snapraid-6.3.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="a backup program for disk array for home media centers"
+HOMEPAGE="http://snapraid.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+DOCS=( "AUTHORS" "HISTORY" "README" "TODO" "snapraid.conf.example" )
diff --git a/sys-fs/snapraid/snapraid-7.0.ebuild b/sys-fs/snapraid/snapraid-7.0.ebuild
new file mode 100644
index 000000000000..0d480753d37c
--- /dev/null
+++ b/sys-fs/snapraid/snapraid-7.0.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="a backup program for disk array for home media centers"
+HOMEPAGE="http://snapraid.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+DOCS=( "AUTHORS" "HISTORY" "README" "TODO" "snapraid.conf.example" )
+
+AUTOTOOLS_IN_SOURCE_BUILD=1
diff --git a/sys-fs/snapraid/snapraid-7.1.ebuild b/sys-fs/snapraid/snapraid-7.1.ebuild
new file mode 100644
index 000000000000..f80f6333e5c1
--- /dev/null
+++ b/sys-fs/snapraid/snapraid-7.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="a backup program for disk array for home media centers"
+HOMEPAGE="http://snapraid.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DOCS=( "AUTHORS" "HISTORY" "README" "TODO" "snapraid.conf.example" )
diff --git a/sys-fs/snapraid/snapraid-8.1.ebuild b/sys-fs/snapraid/snapraid-8.1.ebuild
new file mode 100644
index 000000000000..f80f6333e5c1
--- /dev/null
+++ b/sys-fs/snapraid/snapraid-8.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="a backup program for disk array for home media centers"
+HOMEPAGE="http://snapraid.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DOCS=( "AUTHORS" "HISTORY" "README" "TODO" "snapraid.conf.example" )
diff --git a/sys-fs/squashfs-tools/Manifest b/sys-fs/squashfs-tools/Manifest
new file mode 100644
index 000000000000..89f24ed2b873
--- /dev/null
+++ b/sys-fs/squashfs-tools/Manifest
@@ -0,0 +1,3 @@
+DIST squashfs3.2-r2.tar.gz 314764 SHA256 8482465d58d78099c608b32fc034921f7c8c3cf7934b5edc68c463cd450b40a7 SHA512 983f1fa966c15fb4929eaaf2d88401aac72f6d04e8c5523bd46397bc28928ff13b638e0e96bc09650627449c37f6a654ffa727445f1e9ca13cdc9de4fc43012f WHIRLPOOL 14b22cfc16e5c9bc91a5e02b9d4b64589339162d59613b12c2344acbed34690616a7a0254d9a63f839e96ff4b850f30fd7e1e855aecb76423356f4b1d8582129
+DIST squashfs3.4.tar.gz 352660 SHA256 9ea1a9b3bd4f387ca11b5e96f00f8ae996fb81c4c7ad41f7c7f359917628a339 SHA512 5e126ea468271f54c62d473a04a355169514f2668b4dc0de4138a8ef2a6e633d373454e7b85c1c684b875d9dfc8afb17c05548dd5062d05f847ffef8e624d9fe WHIRLPOOL 7c113f3a66d0d28310302017e5f317d14bb5576e680a8f94e687193a376db92c54920be7d1121637f860cafa802d665ba419115e976b07029ca1f0c51953972d
+DIST squashfs4.3.tar.gz 182550 SHA256 0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6 SHA512 854ed7acc99920f24ecf11e0da807e5a2a162eeda55db971aba63a03f0da2c13b20ec0564a906c4b0e415bd8258b273a10208c7abc0704f2ceea773aa6148a79 WHIRLPOOL c819f416b34cc46a232b8bc385017774603f81b4a865e6b97208004c183ebad5de7d0f726be444f8cb4e1d450abed9340dab730aec0762407f034e99b39bdc06
diff --git a/sys-fs/squashfs-tools/metadata.xml b/sys-fs/squashfs-tools/metadata.xml
new file mode 100644
index 000000000000..5613e68b3586
--- /dev/null
+++ b/sys-fs/squashfs-tools/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>livecd</herd>
+ <use>
+ <flag name="xz">Enable support for XZ ("LZMA2") compression using <pkg>app-arch/xz-utils</pkg></flag>
+ <flag name="lz4">Enable support for LZ4 compression using <pkg>app-arch/lz4</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">squashfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild b/sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild
new file mode 100644
index 000000000000..9e9a19231451
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-3.2_p2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_PV=${PV/_p/-r}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="3.0" # squashfs filesystem version
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+
+src_prepare() {
+ sed -i \
+ -e 's:-O2:$(CFLAGS):' \
+ -e '/-lz/s:$: $(LDFLAGS):' \
+ Makefile || die
+
+ echo "struct dir_info; `grep '^int dir_scan2' mksquashfs.c`;" >> global.h
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ newbin mksquashfs mksquashfs-${SLOT}
+ newbin unsquashfs unsquashfs-${SLOT}
+ cd ..
+ dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README README-3.2
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild b/sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild
new file mode 100644
index 000000000000..4d107d652b4e
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-3.4.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+MY_PV=${PV/_p/-r}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net/"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="3.1" # squashfs filesystem version
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+
+RDEPEND="sys-libs/zlib"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+
+src_prepare() {
+ sed -i \
+ -e 's:-O2:$(CFLAGS):' \
+ -e '/-lz/s:$: $(LDFLAGS):' \
+ Makefile || die
+
+ sed -i -e 's:get_nprocs():sysconf(_SC_NPROCESSORS_ONLN):' *.c
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ newbin mksquashfs mksquashfs-${SLOT}
+ newbin unsquashfs unsquashfs-${SLOT}
+ cd ..
+ dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README README
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-4.3.ebuild b/sys-fs/squashfs-tools/squashfs-tools-4.3.ebuild
new file mode 100644
index 000000000000..52a045b72ad3
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-4.3.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="+xz lzma lz4 lzo xattr"
+
+RDEPEND="
+ sys-libs/zlib
+ !xz? ( !lzo? ( sys-libs/zlib ) )
+ lz4? ( app-arch/lz4 )
+ lzma? ( app-arch/xz-utils )
+ lzo? ( dev-libs/lzo )
+ xattr? ( sys-apps/attr )
+ xz? ( app-arch/xz-utils )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/squashfs${PV}/${PN}"
+
+src_configure() {
+ # set up make command line variables in EMAKE_SQUASHFS_CONF
+ EMAKE_SQUASHFS_CONF=(
+ $(usex lzma LZMA_XZ_SUPPORT=1 LZMA_XS_SUPPORT=0)
+ $(usex lzo LZO_SUPPORT=1 LZO_SUPPORT=0)
+ $(usex lz4 LZ4_SUPPORT=1 LZ4_SUPPORT=0)
+ $(usex xattr XATTR_SUPPORT=1 XATTR_SUPPORT=0)
+ $(usex xz XZ_SUPPORT=1 XZ_SUPPORT=0)
+ )
+
+ tc-export CC
+}
+
+src_compile() {
+ emake ${EMAKE_SQUASHFS_CONF[@]}
+}
+
+src_install() {
+ dobin mksquashfs unsquashfs
+ dodoc ../README
+}
diff --git a/sys-fs/squashfuse/Manifest b/sys-fs/squashfuse/Manifest
new file mode 100644
index 000000000000..6bf6392c6e4c
--- /dev/null
+++ b/sys-fs/squashfuse/Manifest
@@ -0,0 +1 @@
+DIST squashfuse-0.1_p20130530.zip 70224 SHA256 821c2e3ea484315f27b424326a7488c8880a64ab5d212774864dcb0b5d95675d SHA512 1e2ba5a61cdc5eac3fcf13d5d2a55d0656ac247b057f7cff9ef5365eb59f52fa6159cd2ea73475627e62f53fab72c5d12819161e794c683d53059f7667a774f0 WHIRLPOOL 0d07722d4d7f22e4d2dc68b0eedbaf9f3d4d09a6eeaac31bd3956996e73842750f056eb88a1ba68bd4fb8584714913c09a0550180c31bd2ec182bb1901beac73
diff --git a/sys-fs/squashfuse/metadata.xml b/sys-fs/squashfuse/metadata.xml
new file mode 100644
index 000000000000..582c3386d1de
--- /dev/null
+++ b/sys-fs/squashfuse/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>mailto:dave@vasilevsky.ca</bugs-to>
+ <changelog>https://github.com/vasi/squashfuse/commits/master</changelog>
+ <doc>https://raw.github.com/vasi/squashfuse/master/README</doc>
+ <remote-id type="github">vasi/squashfuse</remote-id>
+ </upstream>
+ <maintainer>
+ <email>zmedico@gentoo.org</email>
+ <name>Zac Medico</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/squashfuse/squashfuse-0.1_p20130530.ebuild b/sys-fs/squashfuse/squashfuse-0.1_p20130530.ebuild
new file mode 100644
index 000000000000..08b8d0c72d0d
--- /dev/null
+++ b/sys-fs/squashfuse/squashfuse-0.1_p20130530.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools
+
+DESCRIPTION="FUSE filesystem to mount squashfs archives"
+HOMEPAGE="https://github.com/vasi/squashfuse"
+EGIT_COMMIT="f03158f49cb4adbb6459cb2a1898e586b488cb10"
+SRC_URI="https://github.com/vasi/squashfuse/archive/${EGIT_COMMIT}.zip -> ${P}.zip"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="lzma lzo +zlib"
+REQUIRED_USE="|| ( lzma zlib lzo )"
+
+COMMON_DEPEND="
+ >=sys-fs/fuse-2.8.6:=
+ lzma? ( >=app-arch/xz-utils-5.0.4:= )
+ zlib? ( >=sys-libs/zlib-1.2.5-r2:= )
+ lzo? ( >=dev-libs/lzo-2.06:= )
+"
+DEPEND="app-arch/unzip
+ ${COMMON_DEPEND}"
+RDEPEND="${COMMON_DEPEND}"
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ mv ${PN}-${EGIT_COMMIT}/* ./ || die
+}
+
+src_prepare() {
+ sed -i -e "1s:\\[0\\.1\\]:[${PV}]:" configure.ac || die
+ AT_M4DIR=${S}/m4 eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use lzma || echo --without-xz) \
+ $(use lzo || echo --without-lzo) \
+ $(use zlib || echo --without-zlib)
+}
diff --git a/sys-fs/sshfs-fuse/Manifest b/sys-fs/sshfs-fuse/Manifest
new file mode 100644
index 000000000000..eefdb8893e25
--- /dev/null
+++ b/sys-fs/sshfs-fuse/Manifest
@@ -0,0 +1,2 @@
+DIST sshfs-fuse-2.4.tar.gz 132930 SHA256 3c93ba8522568093c94ff9c5a3763929380dd229365d905769ff82475d774dd1 SHA512 2f73d2163052f815bba65ad4a33a12626cd76628cd90df80378f3d045c61df7b0b4e7e5eec744e2adf44bdd1814cfc454d705eb74914ad4586f8835a926073de WHIRLPOOL 9773ca67c384dabc8122eaf08a27cb63f2cbdfb558d5cf2c581db2e8355801f93370763963d1f301a3504ef4bea80add1f6dadc6846c73847c5c056b4c0e394b
+DIST sshfs-fuse-2.5.tar.gz 136378 SHA256 e9171452e5d0150b9c6a2158fd2e2dcefb5d5d03ba4d208949e00a3a46c6e63e SHA512 48ae4008d10fe66b843ff1e891627f8262e00d064fec048c8c1189507e757994e81e4fa2deb4d8d56cff0d1818efe4a692494b9c48a01c6c79c626acefa1b53e WHIRLPOOL 00086691d287a770ce04ed068250841fe9fd8ec054a9f86f2ffd388c5c519b4f6bc559990724d25895065d6ab8618eb07129801c32a68eb9bfefb8fa952a412f
diff --git a/sys-fs/sshfs-fuse/metadata.xml b/sys-fs/sshfs-fuse/metadata.xml
new file mode 100644
index 000000000000..e93f1bcba449
--- /dev/null
+++ b/sys-fs/sshfs-fuse/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <upstream>
+ <remote-id type="sourceforge">fuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/sshfs-fuse/sshfs-fuse-2.4.ebuild b/sys-fs/sshfs-fuse/sshfs-fuse-2.4.ebuild
new file mode 100644
index 000000000000..0ff654b5af62
--- /dev/null
+++ b/sys-fs/sshfs-fuse/sshfs-fuse-2.4.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Fuse-filesystem utilizing the sftp service"
+SRC_URI="mirror://sourceforge/fuse/${P}.tar.gz"
+HOMEPAGE="http://fuse.sourceforge.net/sshfs.html"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+SLOT="0"
+IUSE=""
+
+CDEPEND=">=sys-fs/fuse-2.6.0_pre3
+ >=dev-libs/glib-2.4.2"
+RDEPEND="${CDEPEND}
+ >=net-misc/openssh-4.3"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( README NEWS ChangeLog AUTHORS FAQ.txt )
+
+src_configure() {
+ # hack not needed with >=net-misc/openssh-4.3
+ econf --disable-sshnodelay
+}
diff --git a/sys-fs/sshfs-fuse/sshfs-fuse-2.5.ebuild b/sys-fs/sshfs-fuse/sshfs-fuse-2.5.ebuild
new file mode 100644
index 000000000000..0ff654b5af62
--- /dev/null
+++ b/sys-fs/sshfs-fuse/sshfs-fuse-2.5.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Fuse-filesystem utilizing the sftp service"
+SRC_URI="mirror://sourceforge/fuse/${P}.tar.gz"
+HOMEPAGE="http://fuse.sourceforge.net/sshfs.html"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+SLOT="0"
+IUSE=""
+
+CDEPEND=">=sys-fs/fuse-2.6.0_pre3
+ >=dev-libs/glib-2.4.2"
+RDEPEND="${CDEPEND}
+ >=net-misc/openssh-4.3"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( README NEWS ChangeLog AUTHORS FAQ.txt )
+
+src_configure() {
+ # hack not needed with >=net-misc/openssh-4.3
+ econf --disable-sshnodelay
+}
diff --git a/sys-fs/static-dev/metadata.xml b/sys-fs/static-dev/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/static-dev/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/static-dev/static-dev-0.1.ebuild b/sys-fs/static-dev/static-dev-0.1.ebuild
new file mode 100644
index 000000000000..0240a59882b2
--- /dev/null
+++ b/sys-fs/static-dev/static-dev-0.1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="A skeleton, statically managed /dev"
+HOMEPAGE="http://bugs.gentoo.org/107875"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+RDEPEND="sys-apps/makedev"
+
+abort() {
+ echo
+ eerror "We have detected that you currently use udev or devfs or devtmpfs"
+ eerror "and this ebuild cannot install to the same mount-point."
+ die "Cannot install on udev/devfs tmpfs."
+}
+
+pkg_preinst() {
+ if [[ -d ${ROOT}/dev/.udev || -c ${ROOT}/dev/.devfs ]] ; then
+ abort
+ fi
+ if [[ ${ROOT} == "/" ]] && \
+ ! awk '$2 == "/dev" && $3 == "devtmpfs" { exit 1 }' /proc/mounts ; then
+ abort
+ fi
+}
+
+pkg_postinst() {
+ MAKEDEV -d "${ROOT}"/dev generic sg scd rtc hde hdf hdg hdh input audio video
+}
diff --git a/sys-fs/sysfsutils/Manifest b/sys-fs/sysfsutils/Manifest
new file mode 100644
index 000000000000..6b8366dbde54
--- /dev/null
+++ b/sys-fs/sysfsutils/Manifest
@@ -0,0 +1 @@
+DIST sysfsutils-2.1.0.tar.gz 788885 SHA256 e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a SHA512 485902d98b41a69343cb037883d0c0a1de8a1a4aed657cd4528fe10bc845ac51629657dff01deef042e57c9bd9243095e23fc931d06d74db31b03c5f0a18cf07 WHIRLPOOL c9170e1fd1815b9ff3070d97d7bacca89bbd51abd4f62d838d7eaf1e22ccd4164442e105d5b2e8a41042c411f8c4cd9a167c7a729c1e724627801471a138f51b
diff --git a/sys-fs/sysfsutils/metadata.xml b/sys-fs/sysfsutils/metadata.xml
new file mode 100644
index 000000000000..9bf2cea425b7
--- /dev/null
+++ b/sys-fs/sysfsutils/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>gregkh@gentoo.org</email>
+ <name>Greg Kroah-Hartman</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">linux-diag</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/sysfsutils/sysfsutils-2.1.0.ebuild b/sys-fs/sysfsutils/sysfsutils-2.1.0.ebuild
new file mode 100644
index 000000000000..07c98ee7adf5
--- /dev/null
+++ b/sys-fs/sysfsutils/sysfsutils-2.1.0.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="System Utilities Based on Sysfs"
+HOMEPAGE="http://linux-diag.sourceforge.net/Sysfsutils.html"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE="static-libs"
+
+src_prepare() {
+ sed -i 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die #467642
+
+ # workaround maintainer mode
+ AT_M4DIR=m4 eautoreconf
+
+ # with eautoreconf you get "Useless epunt_cxx usage"
+ # without you don't
+# epunt_cxx
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ dodoc docs/libsysfs.txt
+ gen_usr_ldscript -a sysfs
+
+ # We do not distribute this
+ rm -f "${ED}"/usr/bin/dlist_test "${ED}"/usr/lib*/libsysfs.la || die
+}
diff --git a/sys-fs/traydevice/Manifest b/sys-fs/traydevice/Manifest
new file mode 100644
index 000000000000..0586da9caa5b
--- /dev/null
+++ b/sys-fs/traydevice/Manifest
@@ -0,0 +1,3 @@
+DIST traydevice-1.5.2.tar.gz 24379 SHA256 e3d703d04c7b91b552332334c7fdbec9317eed8367dd733b9f45d24239c94393
+DIST traydevice-1.5.tar.gz 24234 SHA256 15af177049797d3536196899960b749529fdaffdd29ec4335f1dd6ec0e610ea3
+DIST traydevice-1.6.2.tar.gz 29238 SHA256 abeb4573d52a2111b0512e5cb2b728431151ed6b91b94dafbe42b872688deccb SHA512 19523c502a58aed9e1ea3c52970438a7119d9f4895527777b6c5c4167d44e917b23ca4cb7c1916f7eb7ff8c539d3c72cc1b70712affaa32a9eaa344ec8e92634 WHIRLPOOL 891a3b397d1b10dd143042da4fc048e8cbbcfba492b396a0ddc03d91e1d992fcdad963e0997e4530ba8276d4fd812dc4b699282c8f9d9e9c9d36751af3d8d11e
diff --git a/sys-fs/traydevice/metadata.xml b/sys-fs/traydevice/metadata.xml
new file mode 100644
index 000000000000..540f810e069d
--- /dev/null
+++ b/sys-fs/traydevice/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>desktop-misc</herd>
+</pkgmetadata>
diff --git a/sys-fs/traydevice/traydevice-1.5.2.ebuild b/sys-fs/traydevice/traydevice-1.5.2.ebuild
new file mode 100644
index 000000000000..17d8fe0201d4
--- /dev/null
+++ b/sys-fs/traydevice/traydevice-1.5.2.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.*"
+
+inherit distutils
+
+DESCRIPTION="A little desktop application displaying systray icon for UDisks"
+HOMEPAGE="http://savannah.nongnu.org/projects/traydevice/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="dev-python/dbus-python
+ dev-python/lxml
+ dev-python/pyxdg
+ sys-fs/udisks:0"
+DEPEND="app-text/docbook2X"
+
+src_prepare() {
+ sed -i \
+ -e 's:docbook2man:docbook2man.pl:' \
+ setup.py || die
+
+ distutils_src_prepare
+}
+
+src_compile() { :; }
+
+src_install() {
+ distutils_src_install \
+ --prefix=/usr \
+ --install-data=/usr/share/${PN} \
+ --install-man=/usr/share/man
+
+ rm -f "${D}"/usr/share/${PN}/*.txt
+}
diff --git a/sys-fs/traydevice/traydevice-1.5.ebuild b/sys-fs/traydevice/traydevice-1.5.ebuild
new file mode 100644
index 000000000000..ecf4f67a0dbe
--- /dev/null
+++ b/sys-fs/traydevice/traydevice-1.5.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.*"
+
+inherit distutils
+
+DESCRIPTION="A little desktop application displaying systray icon for UDisks"
+HOMEPAGE="http://savannah.nongnu.org/projects/traydevice/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="dev-python/dbus-python
+ dev-python/lxml
+ dev-python/pyxdg
+ sys-fs/udisks:0"
+DEPEND="app-text/docbook2X"
+
+src_prepare() {
+ sed -i \
+ -e 's:docbook2man:docbook2man.pl:' \
+ setup.py || die
+
+ distutils_src_prepare
+}
+
+src_compile() { :; }
+
+src_install() {
+ distutils_src_install \
+ --root="${D}" \
+ --prefix=/usr \
+ --install-data=/usr/share/${PN} \
+ --install-man=/usr/share/man
+
+ rm -f "${D}"/usr/share/${PN}/*.txt
+}
diff --git a/sys-fs/traydevice/traydevice-1.6.2-r1.ebuild b/sys-fs/traydevice/traydevice-1.6.2-r1.ebuild
new file mode 100644
index 000000000000..c51df187a77f
--- /dev/null
+++ b/sys-fs/traydevice/traydevice-1.6.2-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+DISTUTILS_SINGLE_IMPL=1
+PYTHON_COMPAT=( python2_7 )
+inherit distutils-r1
+
+DESCRIPTION="A little desktop application displaying systray icon for UDisks"
+HOMEPAGE="http://savannah.nongnu.org/projects/traydevice/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-python/lxml[${PYTHON_USEDEP}]
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ sys-fs/udisks:2"
+DEPEND="app-text/docbook2X"
+
+src_compile() { :; }
+
+python_install() {
+ distutils-r1_python_install \
+ --prefix=/usr \
+ --install-data=/usr/share/${PN} \
+ --install-man=/usr/share/man \
+ --docbook2man=docbook2man.pl
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ rm -f "${ED}"/usr/share/${PN}/doc/*.txt
+}
diff --git a/sys-fs/traydevice/traydevice-1.6.2.ebuild b/sys-fs/traydevice/traydevice-1.6.2.ebuild
new file mode 100644
index 000000000000..7e6e828bb02c
--- /dev/null
+++ b/sys-fs/traydevice/traydevice-1.6.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_DEPEND="2:2.6"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.5 3.*"
+
+inherit distutils
+
+DESCRIPTION="A little desktop application displaying systray icon for UDisks"
+HOMEPAGE="http://savannah.nongnu.org/projects/traydevice/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-python/dbus-python
+ dev-python/lxml
+ dev-python/pyxdg
+ sys-fs/udisks:2"
+DEPEND="app-text/docbook2X"
+
+src_compile() { :; }
+
+src_install() {
+ distutils_src_install \
+ --prefix=/usr \
+ --install-data=/usr/share/${PN} \
+ --install-man=/usr/share/man \
+ --docbook2man=$(type -p docbook2man.pl)
+
+ rm -f "${D}"/usr/share/${PN}/*.txt
+}
diff --git a/sys-fs/treesize/Manifest b/sys-fs/treesize/Manifest
new file mode 100644
index 000000000000..814233cb9e0b
--- /dev/null
+++ b/sys-fs/treesize/Manifest
@@ -0,0 +1 @@
+DIST treesize-0.54.1-src.tbz2 296047 SHA256 eb88841b4bb4e557be543107f396c50ecfdb0430324d753306d54bcaba20ef12
diff --git a/sys-fs/treesize/files/0.54.1-amd64.patch b/sys-fs/treesize/files/0.54.1-amd64.patch
new file mode 100644
index 000000000000..d7d9d787ad39
--- /dev/null
+++ b/sys-fs/treesize/files/0.54.1-amd64.patch
@@ -0,0 +1,10 @@
+--- src/ui-util.c 2007-11-16 22:08:01.000000000 +0100
++++ src/ui-util.c.new 2009-05-09 11:34:59.000000000 +0200
+@@ -18,6 +18,7 @@
+
+ #include "ui-util.h"
+ #include "FAfolderAnalyzer.h"
++#include "support.h"
+ extern GtkWidget *mainWindow;
+
+ gpointer getTVSelectedValue( int element ){
diff --git a/sys-fs/treesize/metadata.xml b/sys-fs/treesize/metadata.xml
new file mode 100644
index 000000000000..f4573e11fe58
--- /dev/null
+++ b/sys-fs/treesize/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">treesize</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/treesize/treesize-0.54.1.ebuild b/sys-fs/treesize/treesize-0.54.1.ebuild
new file mode 100644
index 000000000000..b3018e5171fb
--- /dev/null
+++ b/sys-fs/treesize/treesize-0.54.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit autotools base
+
+DESCRIPTION="A disk consumption analyzing tool"
+HOMEPAGE="http://treesize.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}-src.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="x11-libs/gtk+:2"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${PV}-amd64.patch" )
+
+src_prepare() {
+ eautoreconf
+ base_src_prepare
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "installation failed"
+ dodoc NEWS README TODO ChangeLog || die "nothing to read"
+}
diff --git a/sys-fs/udev-init-scripts/Manifest b/sys-fs/udev-init-scripts/Manifest
new file mode 100644
index 000000000000..a6f26f09d1bd
--- /dev/null
+++ b/sys-fs/udev-init-scripts/Manifest
@@ -0,0 +1,3 @@
+DIST udev-init-scripts-27.tar.bz2 3456 SHA256 1a091c361e9845861c138b505881edcb7b68fcf91708db526dff0b320243c936 SHA512 8a526d5252d54c724ad99250141d3ffddfbe6044ff9c9b9c02a4984f03ab6492a8b6a36022b93c7c06b0869b61a3c4dfa82fc47f560e927684fad636f56e4ba8 WHIRLPOOL 270a4ae1053a0303a851d6dcc5b51d2b89c5438b93f85dfb80726d11d61e950ae13e88b6063938f4ea8b49ae7167fb58211b6ce670f8d6c52212aed5da80b339
+DIST udev-init-scripts-29.tar.gz 3650 SHA256 63fd923b259f216d8a1b1b64d8e541d67fb5ef86ac163ad087306017fa6426d9 SHA512 b6233b1ef2af6c581584faa6c640840a19c92c70a4e754bcc2d27112fb15b528799c0a3e60f8c5c4436754d3f14c598e946eeca3f0d21512f8cd40f406594514 WHIRLPOOL adbf345047416dce9848c6acf3c92b341961a25fbfb03e6488ff5899ac216e00e53061ea4f0aa4412ea90e4b0e323181abb4480fc313497a5a82f2bf286708fb
+DIST udev-init-scripts-30.tar.gz 3668 SHA256 4de998d68e28f8ce4c1d4c9955aec0fa4cfe84673cbf3bfe1be71a1e9918693f SHA512 bf9ec69d9fb9edbe37f3dec8e1d5c828ea63591382de33818297ec5e37490c2dd709a8e32251fba36a816952c98af49172c7c09f3252712ddc51820205c4efdd WHIRLPOOL e666263adbd42ec99ed31c7537361e10deea19293aadd0580410abc901d87d1befdec2231d448cc364564803d2177649037111640218eb96f79ed931e41e26a7
diff --git a/sys-fs/udev-init-scripts/metadata.xml b/sys-fs/udev-init-scripts/metadata.xml
new file mode 100644
index 000000000000..f9cc3c3cbd9c
--- /dev/null
+++ b/sys-fs/udev-init-scripts/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>udev-bugs@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-fs/udev-init-scripts/udev-init-scripts-27.ebuild b/sys-fs/udev-init-scripts/udev-init-scripts-27.ebuild
new file mode 100644
index 000000000000..8a0f928f2be6
--- /dev/null
+++ b/sys-fs/udev-init-scripts/udev-init-scripts-27.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [ "${PV}" = "9999" ]; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/udev-gentoo-scripts.git"
+ inherit git-r3
+else
+ SRC_URI="http://dev.gentoo.org/~williamh/dist/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+inherit eutils
+
+DESCRIPTION="udev startup scripts for openrc"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+RDEPEND=">=virtual/udev-180
+ !<sys-fs/udev-186
+ !<sys-apps/openrc-0.13"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch_user
+}
+
+pkg_postinst() {
+ # Add udev to the sysinit runlevel automatically if this is
+ # the first install of this package.
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ if [[ ! -d ${ROOT%/}/etc/runlevels/sysinit ]]; then
+ mkdir -p "${ROOT%/}"/etc/runlevels/sysinit
+ fi
+ if [[ -x ${ROOT%/}/etc/init.d/udev ]]; then
+ ln -s /etc/init.d/udev "${ROOT%/}"/etc/runlevels/sysinit/udev
+ fi
+ fi
+
+ # Warn the user about adding udev to their sysinit runlevel
+ if [[ -e ${ROOT%/}/etc/runlevels/sysinit ]]; then
+ if [[ ! -e ${ROOT%/}/etc/runlevels/sysinit/udev ]]; then
+ ewarn
+ ewarn "You need to add udev to the sysinit runlevel."
+ ewarn "If you do not do this,"
+ ewarn "your system will not be able to boot!"
+ ewarn "Run this command:"
+ ewarn "\trc-update add udev sysinit"
+ fi
+ fi
+
+ if ! has_version "sys-fs/eudev[rule-generator]" && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qs 'boot\|default\|sysinit'; then
+ ewarn "The udev-postmount service has been removed because the reasons for"
+ ewarn "its existance have been removed upstream."
+ ewarn "Please remove it from your runlevels."
+ fi
+}
diff --git a/sys-fs/udev-init-scripts/udev-init-scripts-29.ebuild b/sys-fs/udev-init-scripts/udev-init-scripts-29.ebuild
new file mode 100644
index 000000000000..8cdd11a12c3d
--- /dev/null
+++ b/sys-fs/udev-init-scripts/udev-init-scripts-29.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [ "${PV}" = "9999" ]; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/udev-gentoo-scripts.git"
+ inherit git-r3
+else
+ SRC_URI="http://dev.gentoo.org/~williamh/dist/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit eutils
+
+DESCRIPTION="udev startup scripts for openrc"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+DEPEND=""
+RDEPEND=">=virtual/udev-217
+ !<sys-apps/openrc-0.14"
+
+src_prepare() {
+ epatch_user
+}
+
+pkg_postinst() {
+ # Add udev and udev-trigger to the sysinit runlevel automatically.
+ for f in udev udev-trigger; do
+ if [[ -x ${ROOT%/}/etc/init.d/${f} &&
+ -d ${ROOT%/}/etc/runlevels/sysinit &&
+ ! -L "${ROOT%/}/etc/runlevels/sysinit/${f}" ]]; then
+ ln -snf /etc/init.d/${f} "${ROOT%/}"/etc/runlevels/sysinit/${f}
+ ewarn "Adding ${f} to the sysinit runlevel"
+ fi
+ done
+
+ if ! has_version "sys-fs/eudev[rule-generator]" && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qs 'boot\|default\|sysinit'; then
+ ewarn "The udev-postmount service has been removed because the reasons for"
+ ewarn "its existance have been removed upstream."
+ ewarn "Please remove it from your runlevels."
+ fi
+}
diff --git a/sys-fs/udev-init-scripts/udev-init-scripts-30.ebuild b/sys-fs/udev-init-scripts/udev-init-scripts-30.ebuild
new file mode 100644
index 000000000000..8cdd11a12c3d
--- /dev/null
+++ b/sys-fs/udev-init-scripts/udev-init-scripts-30.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [ "${PV}" = "9999" ]; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/udev-gentoo-scripts.git"
+ inherit git-r3
+else
+ SRC_URI="http://dev.gentoo.org/~williamh/dist/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit eutils
+
+DESCRIPTION="udev startup scripts for openrc"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+DEPEND=""
+RDEPEND=">=virtual/udev-217
+ !<sys-apps/openrc-0.14"
+
+src_prepare() {
+ epatch_user
+}
+
+pkg_postinst() {
+ # Add udev and udev-trigger to the sysinit runlevel automatically.
+ for f in udev udev-trigger; do
+ if [[ -x ${ROOT%/}/etc/init.d/${f} &&
+ -d ${ROOT%/}/etc/runlevels/sysinit &&
+ ! -L "${ROOT%/}/etc/runlevels/sysinit/${f}" ]]; then
+ ln -snf /etc/init.d/${f} "${ROOT%/}"/etc/runlevels/sysinit/${f}
+ ewarn "Adding ${f} to the sysinit runlevel"
+ fi
+ done
+
+ if ! has_version "sys-fs/eudev[rule-generator]" && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qs 'boot\|default\|sysinit'; then
+ ewarn "The udev-postmount service has been removed because the reasons for"
+ ewarn "its existance have been removed upstream."
+ ewarn "Please remove it from your runlevels."
+ fi
+}
diff --git a/sys-fs/udev-init-scripts/udev-init-scripts-9999.ebuild b/sys-fs/udev-init-scripts/udev-init-scripts-9999.ebuild
new file mode 100644
index 000000000000..0dd445e0dfc5
--- /dev/null
+++ b/sys-fs/udev-init-scripts/udev-init-scripts-9999.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [ "${PV}" = "9999" ]; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/udev-gentoo-scripts.git"
+ inherit git-r3
+else
+ SRC_URI="http://dev.gentoo.org/~williamh/dist/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit eutils
+
+DESCRIPTION="udev startup scripts for openrc"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+DEPEND=""
+RDEPEND=">=virtual/udev-217
+ !<sys-apps/openrc-0.14"
+
+src_prepare() {
+ epatch_user
+}
+
+pkg_postinst() {
+ # Add udev and udev-trigger to the sysinit runlevel automatically.
+ for f in udev udev-trigger; do
+ if [[ -x ${ROOT%/}/etc/init.d/${f} &&
+ -d ${ROOT%/}/etc/runlevels/sysinit &&
+ ! -L "${ROOT%/}/etc/runlevels/sysinit/${f}" ]]; then
+ ln -snf /etc/init.d/${f} "${ROOT%/}"/etc/runlevels/sysinit/${f}
+ ewarn "Adding ${f} to the sysinit runlevel"
+ fi
+ done
+
+ if ! has_version "sys-fs/eudev[rule-generator]" && \
+ [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qs 'boot\|default\|sysinit'; then
+ ewarn "The udev-postmount service has been removed because the reasons for"
+ ewarn "its existance have been removed upstream."
+ ewarn "Please remove it from your runlevels."
+ fi
+}
diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest
new file mode 100644
index 000000000000..98758325c3d5
--- /dev/null
+++ b/sys-fs/udev/Manifest
@@ -0,0 +1,15 @@
+DIST systemd-208-r1.tar.xz 2382904 SHA256 aa64fa864466fd5727005c55d61c092828b94b4f857272c0b503695022146390 SHA512 c21989b747f5e73ba2311919e1ae558132e4ab2e0d8715c25f51e5e90069e147a52e04280c736ecca6b675af7d79def576171a9b08aaeda45fcd52bcdca011cb WHIRLPOOL e86fdbf96c75c4c94c9507900a5696ff811f5439e0cb45bdc765dc42c62a855c9d2e7d3414df7ec7e18013d937c9148e42c861d0e28e8b4c2fabebd234fbee03
+DIST systemd-216.tar.xz 3612960 SHA256 945d3db7d840d6ffe98aa68394428e13317161ae79905397faab6671619728f3 SHA512 f4eee6664368168eafd61939f1355ac21c7eeecce6247de98ef36f40bb6a942d12c006ced4ee15f3d8f11699c194990222d5a5115b45f2aa81f2a1abafebbdd2 WHIRLPOOL 505e09b55209a4f9d8cec077970571b2e1298e8db02946a6c79df139dece9d1a08e46c86ef6c8053274abfd46c9a5ea09157f5bc9dc1f7461322c596e84ef494
+DIST systemd-217.tar.xz 3694524 SHA256 a031e6fbcdc7077b37338bae8074d9428ee2fa98033beb4923a62871890f7498 SHA512 7a0b13330b621ec179499018bfbe9619a91cdbd120ae2067e19cbb9bbc25c80dd0f80aac217d823be1332054439bc9b2153ac78fc1eb231fa0fd55cb3bf7a70f WHIRLPOOL f22674a629b7b928875b6b06b0cffaf5874cdcb90c44787279cd8ff2a798e5bc525c1058f8b2bfe746d100c4d7686e36a6f604276d5735f7554122e4caad6689
+DIST systemd-218.tar.xz 3782276 SHA256 1b0768b53b6c6d813a93a4b8fe1f80cf53561b09075010a97c7aa08eee3fd59b SHA512 c183cce8532ccb4716b84587c96a626eea390202a5469b9d89c8cee7f703e40d7c584e05f29501d375b8cd2a1409d011de564df16f54e27f66b3c3007a6e5bd4 WHIRLPOOL 4d0bcf3ddfecd3354d9f4ab13851f8da6baf31e89e64d3b1ac671159f16f23597d88cc2525aece2f867c140fc97e80bce086a5af91f84b8095e2503c13995e6d
+DIST systemd-219.tar.xz 3938228 SHA256 5c57113454e37c040d0cb481bd960ae7cf3a3fe0a231ff4945259bc74503f2d9 SHA512 19a92891996723bbd83fe745f365d25b2879a059466670aebb9e9fbb6a79a3ed6e1a93e8b76042605038766cabad3ddb89aff40b4a11ab830ffa7dc64f87234f WHIRLPOOL 440868c47bed26571084009fa86d267c921cd5cbbc63b596c1161ef7f33a1b9427ad315450014cd729c761b27bf42542c3b0b7ca68e09b23fc8f606147e7e9fb
+DIST systemd-220.tar.xz 4036028 SHA256 3659588c40221ee7257502c0735491f72796dbe17be560013f6d310deb446332 SHA512 c309b4309f8b8d2d97450fb281053feec7b89227626b69e37f3a0d2154c2810c217e58e218f17da11c04f703c6196cec21c4afdcf63879bc736bbdca058a5da5 WHIRLPOOL 2f8974eacb706987e85c7907a517f6b2d47b009f9259a36375537c8bd09bc4774c81e8dc853aa83e644d7c1b579f5113d0bb8a504c7caa5a9240750f9936d561
+DIST udev-208-patches-1.tar.xz 964 SHA256 b2df84afd8631736aceee1317d332fd9bee347df503aa55cd78bcf1b375e8f75 SHA512 6e85daaf8639255bbaa76364cda02f8b034ec5f687730a7e3ea7427b53031b4cdcbe1b8758e1474104d52e04781605ee3c1e31bbec2df33c95e606cee8eb0f28 WHIRLPOOL 054d1e954c4eacd10fcdacf130bf6cf2dd165f3da10ba5629f4bd8e488a221e8e5d7db3ab821593af8dd92011dee98daadf09e5dd726a4c99861f4abaea6aca0
+DIST udev-216-patches-2.tar.xz 1264 SHA256 18b7b8f852f11c2ac2a58458462ce686ebec48859562df99c5b9c29c95ddfa3c SHA512 1f5912f3bbc3e40a4efad9de8b1fab2b3a750f3f23c9f2e33a581658959d22cf23f9ff1b8f51597874e7bca1d0f757f37fd5550b4112160261559524eda261f4 WHIRLPOOL 8f93f982de2d1fa10f7e3c6541c559f2c881730276498b14d4d27b8577bdb340d49b2dc7a50a40e8a13fcabbbabb3dfa5f1605aa842e325d12c17e82d2dc787b
+DIST udev-217-patches-1.tar.xz 616 SHA256 80c0e57caa2845164b3fda1a9a74d07763a6b18e55c6e1ec60c0d888cdf24cf8 SHA512 e0ffd9c515c79da30b51448f1a78f6cc442ca595dd0bcd0f766fee31fd1324af6b820238ab342c8e40d6953ce17b872344deb0e7d1803830952d7dcc6f3479cd WHIRLPOOL a4e28fdae7b67fcd65a2d0fbf7e080e9dde6b4cdaacaa845d2bffc26717aa8f7a498fc0e6ad6edf8a553759a0f4b4ddb5da768211b294a1b37a21eecc225cf10
+DIST udev-218-patches-1.tar.xz 616 SHA256 80c0e57caa2845164b3fda1a9a74d07763a6b18e55c6e1ec60c0d888cdf24cf8 SHA512 e0ffd9c515c79da30b51448f1a78f6cc442ca595dd0bcd0f766fee31fd1324af6b820238ab342c8e40d6953ce17b872344deb0e7d1803830952d7dcc6f3479cd WHIRLPOOL a4e28fdae7b67fcd65a2d0fbf7e080e9dde6b4cdaacaa845d2bffc26717aa8f7a498fc0e6ad6edf8a553759a0f4b4ddb5da768211b294a1b37a21eecc225cf10
+DIST udev-220-patches-1.tar.xz 1760 SHA256 ac2e778776db9dc13d431b871d5b67aad378bc4bd0b7108476500313ab9c8d2a SHA512 0cbaf904a5aadedfc3bd8aee735f700b2489112e51938ea54ed34a7fdef4e8f26749eb251a82bbc409fb631f1abc4f70c732cf9b2de7ced739efd3cfadcd5cc2 WHIRLPOOL 75e67af7592c9177d81f43a4aa403b1c359fd4695007f3324e73f65289f1d2b8c3575556980c77473717198eaac03b59c4e7e0575586bde1735cfe6942dde53e
+DIST udev-220-patches-3.tar.xz 2812 SHA256 885e3f4a52e7f178272da5591d22baf87954d2c8e6fed188193deff493b0ab13 SHA512 15a5bbd3f4ac95d14ffc7c95cd2494b4d74cfd95674f3b0ac3ed9ae955e88a026ad9be82e9229aaf81a2ac9649411aa178fccba2beee688f287e925a8bf3057c WHIRLPOOL 3f1f24eddb80d29da4cba0a32dd8697a9a1f7fc45c00207effe5d944f8ad4c09aae86c0d45dc7af560f42ccdecf0cd69267c46ddd853123bfcae202c5bd90d75
+DIST udev-220-patches-4.tar.xz 3432 SHA256 b17c676c7984d90bcafb57d087e77bc9e435a3244187f51e8c5ce1b3d4248ac9 SHA512 747e6d36faaed145bbe630e794bdd636d4e39d55fc2fc422d815cee3ab4aa579f15abbd1ff88c0448667546c8b04f72663cffa46d07861199076912bd009d25d WHIRLPOOL 0a349daae71b6ac95afc7414aa931f8aaa7328d2a0e7058cf6099b794531a1148bcd198f404d5d4bab7b250b1390adeb6938e8771da90fb7f56114560fd03a82
+DIST udev-222.tar.gz 4015599 SHA256 b49f51f9855127987adc98aad3b6d608e4e53eaa029b629f2ea2089ce0234f34 SHA512 83f0acf0ca90c89c902c268af6eef4b61380a30380013cbe89c929357959f51682cd3961a6a4f772abc09d5ca09404ae290edf2c3253fab1b20dc2b5b3ecde47 WHIRLPOOL dd0151034de374b072e70448e7a9ff47693df0190e8a2a11488593400d3d7e53e0a91d86037d027c750584089e6c68e58c437647d608a72f8826f091e3253879
+DIST udev-224.tar.gz 3868075 SHA256 0d7ac1532a57639fbc828f8a5051a090883c6ad2908618a7a13ab386db831bfc SHA512 7717d340c6de11afd589234b7ec8952fe2ffcd05829622bd7ea8e008870c0e3b83eb1eaf20e85ffffa7adafc9c0c0b94fd93784510792109240e22e6b963f198 WHIRLPOOL 645b08ff0c20994b17b8ed585fb0eef682336961d7fedf25031fa4dc89a4d9a2b58c254e0f9baeedcb228435316fdfb562f9fefd21e5a63f94499d2f1040e093
diff --git a/sys-fs/udev/metadata.xml b/sys-fs/udev/metadata.xml
new file mode 100644
index 000000000000..6348f89f97da
--- /dev/null
+++ b/sys-fs/udev/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>udev-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="firmware-loader">Enable the userspace firmware loader (DEPRECATED, replaced by the in-kernel loader starting from 3.8)</flag>
+ <flag name="gudev">Build the gobject interface library</flag>
+ <flag name="kmod">Enable kernel module loading/unloading support using <pkg>sys-apps/kmod</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:kernel:udev</remote-id>
+ <remote-id type="github">systemd/systemd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/udev/udev-208-r1.ebuild b/sys-fs/udev/udev-208-r1.ebuild
new file mode 100644
index 000000000000..dd0c68eaefee
--- /dev/null
+++ b/sys-fs/udev/udev-208-r1.ebuild
@@ -0,0 +1,522 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils linux-info multilib toolchain-funcs versionator multilib-minimal
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+else
+ patchset=1
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz -> systemd-${PV}-r1.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc +firmware-loader gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1 )
+ kmod? ( >=sys-apps/kmod-14 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-devel/make-3.82-r4
+ virtual/os-headers
+ virtual/pkgconfig
+ !<sys-kernel/linux-headers-2.6.32
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=dev-util/intltool-0.50"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !sys-apps/coldplug
+ !<sys-fs/lvm2-2.02.97-r1
+ !sys-fs/device-mapper
+ !<sys-fs/udev-init-scripts-22
+ !<sys-kernel/dracut-017-r1
+ !<sys-kernel/genkernel-3.4.25
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=7d3733faee4203fd7c75c3f3c0d55741
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL"
+ linux-info_pkg_setup
+
+ # Based on README from tarball:
+ local MINKV=3.0
+ # These arch's have the mandatory accept4() function support in Linux 2.6.32.61, see:
+ # $ grep -r define.*accept4 linux-2.6.32.61/*
+ if use amd64 || use ia64 || use mips || use sparc || use x86; then
+ MINKV=2.6.32
+ fi
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 20 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ # These are missing from upstream 50-udev-default.rules
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific usb group
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ # Keep this for Linux 2.6.32 kernels with accept4() support like .60 wrt #457868
+ SUBSYSTEM=="mem", KERNEL=="null|zero|full|random|urandom", MODE="0666"
+ EOF
+
+ # Create link to systemd-udevd.8 here to avoid parallel build problem and
+ # while at it, create convinience link to `man 8 udevd` even if upstream
+ # doesn't do that anymore
+ local man
+ for man in udevd systemd-udevd; do
+ echo '.so systemd-udevd.service.8' > "${T}"/${man}.8
+ done
+
+ # Remove requirements for gettext and intltool wrt bug #443028
+ if ! has_version dev-util/intltool && ! [[ ${PV} = 9999* ]]; then
+ sed -i \
+ -e '/INTLTOOL_APPLIED_VERSION=/s:=.*:=0.40.0:' \
+ -e '/XML::Parser perl module is required for intltool/s|^|:|' \
+ configure || die
+ eval export INTLTOOL_{EXTRACT,MERGE,UPDATE}=/bin/true
+ eval export {MSG{FMT,MERGE},XGETTEXT}=/bin/true
+ fi
+
+ # apply user patches
+ epatch_user
+
+ # compile with older versions of gcc #451110
+ version_is_at_least 4.6 $(gcc-version) || \
+ sed -i 's:static_assert:alsdjflkasjdfa:' src/shared/macro.h
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ DBUS_CFLAGS=' '
+ DBUS_LIBS=' '
+ --docdir=/usr/share/doc/${PF}
+ --libdir=/usr/$(get_libdir)
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --with-rootprefix=
+ --without-python
+ --disable-python-devel
+ --disable-audit
+ --disable-coredump
+ --disable-hostnamed
+ --disable-ima
+ --disable-libcryptsetup
+ --disable-localed
+ --disable-logind
+ --disable-myhostname
+ --disable-nls
+ --disable-pam
+ --disable-quotacheck
+ --disable-readahead
+ $(use_enable gudev)
+ --enable-split-usr
+ --disable-tcpwrap
+ --disable-timedated
+ --disable-xz
+ --disable-polkit
+ --disable-tmpfiles
+ --disable-machined
+ --disable-xattr
+ )
+ # Use pregenerated copies when possible wrt #480924
+ if ! [[ ${PV} = 9999* ]]; then
+ econf_args+=(
+ --disable-manpages
+ )
+ fi
+ if multilib_is_native_abi; then
+ econf_args+=(
+ --with-rootlibdir=/$(get_libdir)
+ $(use_enable acl)
+ $(use_enable doc gtk-doc)
+ $(use_enable kmod)
+ $(use_enable selinux)
+ $(use_enable static-libs static)
+ --enable-introspection=$(usex introspection)
+ )
+ else
+ econf_args+=(
+ --with-rootlibdir=/usr/$(get_libdir)
+ --disable-acl
+ --disable-gtk-doc
+ --disable-kmod
+ --disable-selinux
+ --disable-static
+ --disable-manpages
+ --enable-introspection=no
+ )
+ fi
+ use firmware-loader && econf_args+=( --with-firmware-path="/lib/firmware/updates:/lib/firmware" )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.7
+ man/udevadm.8
+ man/systemd-udevd.service.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-sharepkgconfigDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ # install udevadm compatibility symlink
+ dosym {../bin,sbin}/udevadm
+
+ # install udevd to /sbin and remove empty and redudant directory
+ # /lib/systemd because systemd is installed to /usr wrt #462750
+ mv "${D}"/{lib/systemd/systemd-,sbin/}udevd || die
+ rm -r "${D}"/lib/systemd
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.7,udevadm.8,systemd-udevd.service.8}
+ else
+ doman "${S}"/man/{udev.7,udevadm.8,systemd-udevd.service.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/LICENSE.*
+
+ # see src_prepare() for content of these files
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+ doman "${T}"/{systemd-,}udevd.8
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT}usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT}"usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT}"run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT}"dev/loop 2>/dev/null
+ if [[ -d ${ROOT}dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ # 64-device-mapper.rules is related to sys-fs/device-mapper which we block
+ # in favor of sys-fs/lvm2
+ old_dm_rules=${ROOT}etc/udev/rules.d/64-device-mapper.rules
+ if [[ -f ${old_dm_rules} ]]; then
+ rm -f "${old_dm_rules}"
+ einfo "Removed unneeded file ${old_dm_rules}"
+ fi
+
+ local fstab="${ROOT}"etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT}usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_net_name="${ROOT}"etc/udev/rules.d/80-net-name-slot.rules
+ if [[ -f ${old_net_name} ]]; then
+ local old_net_sum=bebf4bd1b6b668e9ff34a3999aa6ff32
+ MD5=$(md5sum < "${old_net_name}")
+ MD5=${MD5/ -/}
+ if [[ ${MD5} == ${old_net_sum} ]]; then
+ ewarn "Removing unmodified file ${old_net_name} from old udev installation to enable"
+ ewarn "the new predictable network interface naming."
+ rm -f "${old_net_name}"
+ fi
+ fi
+
+ local old_cd_rules="${ROOT}"etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT}"etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/udev/rules.d/80-net-name-slot.rules, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ if [[ ${ROOT} != "" ]] && [[ ${ROOT} != "/" ]]; then
+ return 0
+ fi
+ udevadm control --reload
+ fi
+ fi
+}
diff --git a/sys-fs/udev/udev-216.ebuild b/sys-fs/udev/udev-216.ebuild
new file mode 100644
index 000000000000..766d6211a682
--- /dev/null
+++ b/sys-fs/udev/udev-216.ebuild
@@ -0,0 +1,490 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=2
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc +firmware-loader gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.7
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=c18b74c4f8bf4a397ee667ee419f3a8e
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 28 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-readahead
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ $(use firmware-loader && echo "--with-firmware-path=/lib/firmware/updates:/lib/firmware")
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-sharepkgconfigDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-217.ebuild b/sys-fs/udev/udev-217.ebuild
new file mode 100644
index 000000000000..6e915831bd3d
--- /dev/null
+++ b/sys-fs/udev/udev-217.ebuild
@@ -0,0 +1,497 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=1
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.7
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=c18b74c4f8bf4a397ee667ee419f3a8e
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 28 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-sharepkgconfigDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-218.ebuild b/sys-fs/udev/udev-218.ebuild
new file mode 100644
index 000000000000..58bb69e6fbd1
--- /dev/null
+++ b/sys-fs/udev/udev-218.ebuild
@@ -0,0 +1,504 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=1
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.7
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=c18b74c4f8bf4a397ee667ee419f3a8e
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 27 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-sharepkgconfigDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-219.ebuild b/sys-fs/udev/udev-219.ebuild
new file mode 100644
index 000000000000..3d1ffdfcba7c
--- /dev/null
+++ b/sys-fs/udev/udev-219.ebuild
@@ -0,0 +1,504 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=c18b74c4f8bf4a397ee667ee419f3a8e
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 27 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-sharepkgconfigDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-220-r1.ebuild b/sys-fs/udev/udev-220-r1.ebuild
new file mode 100644
index 000000000000..d119ab0f5a93
--- /dev/null
+++ b/sys-fs/udev/udev-220-r1.ebuild
@@ -0,0 +1,507 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=1
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 28 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+ rm src/journal/audit_type-to-name.h src/udev/keyboard-keys-from-name.gperf \
+ || die
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-pkgconfigdataDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ pkgconfigdata_DATA="src/udev/udev.pc"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-220-r2.ebuild b/sys-fs/udev/udev-220-r2.ebuild
new file mode 100644
index 000000000000..8fdf43970256
--- /dev/null
+++ b/sys-fs/udev/udev-220-r2.ebuild
@@ -0,0 +1,507 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=3
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 28 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+ rm src/journal/audit_type-to-name.h src/udev/keyboard-keys-from-name.gperf \
+ || die
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-pkgconfigdataDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ pkgconfigdata_DATA="src/udev/udev.pc"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-220-r3.ebuild b/sys-fs/udev/udev-220-r3.ebuild
new file mode 100644
index 000000000000..f92a1d45b16c
--- /dev/null
+++ b/sys-fs/udev/udev-220-r3.ebuild
@@ -0,0 +1,507 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-2
+ patchset=
+else
+ patchset=4
+ SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl doc gudev introspection +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20
+ acl? ( sys-apps/acl )
+ gudev? ( >=dev-libs/glib-2.34.3[${MULTILIB_USEDEP}] )
+ introspection? ( >=dev-libs/gobject-introspection-1.38 )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ doc? ( >=dev-util/gtk-doc-1.18 )"
+# Try with `emerge -C docbook-xml-dtd` to see the build failure without DTDs
+if [[ ${PV} = 9999* ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10
+ gudev? ( !dev-libs/libgudev )"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 28 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # apply user patches
+ epatch_user
+
+ if [[ ! -e configure ]]; then
+ if use doc; then
+ gtkdocize --docdir docs || die "gtkdocize failed"
+ else
+ echo 'EXTRA_DIST =' > docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ check_default_rules
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+ rm src/journal/audit_type-to-name.h src/udev/keyboard-keys-from-name.gperf \
+ || die
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable introspection)
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(use_enable gudev)
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --with-html-dir=/usr/share/doc/${PF}/html
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Use pregenerated copies when possible wrt #480924
+ [[ ${PV} = 9999* ]] || econf_args+=( --disable-manpages )
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ accelerometer
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ if [[ ${PV} = 9999* ]]; then
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ fi
+
+ if use doc; then
+ emake -C docs/libudev
+ use gudev && emake -C docs/gudev
+ fi
+ else
+ local lib_targets=( libudev.la )
+ use gudev && lib_targets+=( libgudev-1.0.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-libgudev_includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-girDATA
+ install-pkgconfiglibDATA
+ install-pkgconfigdataDATA
+ install-typelibsDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ pkgconfigdata_DATA="src/udev/udev.pc"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+
+ if use doc; then
+ emake -C docs/libudev DESTDIR="${D}" install
+ use gudev && emake -C docs/gudev DESTDIR="${D}" install
+ fi
+
+ if [[ ${PV} = 9999* ]]; then
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ doman "${S}"/man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ fi
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ if use gudev; then
+ lib_LTLIBRARIES+=" libgudev-1.0.la"
+ pkgconfiglib_DATA+=" src/gudev/gudev-1.0.pc"
+ fi
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+
+ if ! [[ ${PV} = 9999* ]]; then
+ insinto /usr/share/doc/${PF}/html/gudev
+ doins "${S}"/docs/gudev/html/*
+
+ insinto /usr/share/doc/${PF}/html/libudev
+ doins "${S}"/docs/libudev/html/*
+ fi
+}
+
+pkg_preinst() {
+ local htmldir
+ for htmldir in gudev libudev; do
+ if [[ -d ${ROOT%/}/usr/share/gtk-doc/html/${htmldir} ]]; then
+ rm -rf "${ROOT%/}"/usr/share/gtk-doc/html/${htmldir}
+ fi
+ if [[ -d ${D}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym ../../doc/${PF}/html/${htmldir} \
+ /usr/share/gtk-doc/html/${htmldir}
+ fi
+ done
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-222.ebuild b/sys-fs/udev/udev-222.ebuild
new file mode 100644
index 000000000000..4d29b23babea
--- /dev/null
+++ b/sys-fs/udev/udev-222.ebuild
@@ -0,0 +1,435 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-r3
+else
+ patchset=
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.24
+ acl? ( sys-apps/acl )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 25 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # stub out the am_path_libcrypt function
+ echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4
+
+ # apply user patches
+ epatch_user
+
+ eautoreconf
+
+ if ! [[ ${PV} = 9999* ]]; then
+ check_default_rules
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+ export cc_cv_CFLAGS__Werror_shadow=no #554454
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ --disable-python-devel
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnuefi
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-terminal
+ --disable-myhostname
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ else
+ local lib_targets=( libudev.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-pkgconfiglibDATA
+ install-pkgconfigdataDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ pkgconfigdata_DATA="src/udev/udev.pc"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-224.ebuild b/sys-fs/udev/udev-224.ebuild
new file mode 100644
index 000000000000..08f9e6257ff8
--- /dev/null
+++ b/sys-fs/udev/udev-224.ebuild
@@ -0,0 +1,433 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-r3
+else
+ patchset=
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.24
+ acl? ( sys-apps/acl )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 25 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # stub out the am_path_libcrypt function
+ echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4
+
+ # apply user patches
+ epatch_user
+
+ eautoreconf
+
+ if ! [[ ${PV} = 9999* ]]; then
+ check_default_rules
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+ export cc_cv_CFLAGS__Werror_shadow=no #554454
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnuefi
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-myhostname
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ else
+ local lib_targets=( libudev.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-pkgconfiglibDATA
+ install-pkgconfigdataDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ pkgconfigdata_DATA="src/udev/udev.pc"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild
new file mode 100644
index 000000000000..08f9e6257ff8
--- /dev/null
+++ b/sys-fs/udev/udev-9999.ebuild
@@ -0,0 +1,433 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools bash-completion-r1 eutils linux-info multilib multilib-minimal toolchain-funcs udev user versionator
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/systemd"
+ inherit git-r3
+else
+ patchset=
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ if [[ -n "${patchset}" ]]; then
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~ssuominen/${P}-patches-${patchset}.tar.xz
+ http://dev.gentoo.org/~williamh/dist/${P}-patches-${patchset}.tar.xz"
+ fi
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="LGPL-2.1 MIT GPL-2"
+SLOT="0"
+IUSE="acl +kmod selinux static-libs"
+
+RESTRICT="test"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.24
+ acl? ( sys-apps/acl )
+ kmod? ( >=sys-apps/kmod-16 )
+ selinux? ( >=sys-libs/libselinux-2.1.9 )
+ !<sys-libs/glibc-2.11
+ !sys-apps/gentoo-systemd-integration
+ !sys-apps/systemd
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+# Force new make >= -r4 to skip some parallel build issues
+DEPEND="${COMMON_DEPEND}
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ sys-libs/libcap
+ virtual/os-headers
+ virtual/pkgconfig
+ >=sys-devel/make-3.82-r4
+ >=sys-kernel/linux-headers-3.9
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+RDEPEND="${COMMON_DEPEND}
+ !<sys-fs/lvm2-2.02.103
+ !<sec-policy/selinux-base-2.20120725-r10"
+PDEPEND=">=sys-apps/hwids-20140304[udev]
+ >=sys-fs/udev-init-scripts-26"
+
+S=${WORKDIR}/systemd-${PV}
+
+# The multilib-build.eclass doesn't handle situation where the installed headers
+# are different in ABIs. In this case, we install libgudev headers in native
+# ABI but not for non-native ABI.
+multilib_check_headers() { :; }
+
+check_default_rules() {
+ # Make sure there are no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ local udev_rules_md5=b8ad860dccae0ca51656b33c405ea2ca
+ MD5=$(md5sum < "${S}"/rules/50-udev-default.rules)
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != ${udev_rules_md5} ]]; then
+ eerror "50-udev-default.rules has been updated, please validate!"
+ eerror "md5sum: ${MD5}"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+}
+
+pkg_setup() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ CONFIG_CHECK="~BLK_DEV_BSG ~DEVTMPFS ~!IDE ~INOTIFY_USER ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2 ~SIGNALFD ~EPOLL ~FHANDLE ~NET ~!FW_LOADER_USER_HELPER"
+ linux-info_pkg_setup
+
+ # CONFIG_FHANDLE was introduced by 2.6.39
+ local MINKV=2.6.39
+
+ if kernel_is -lt ${MINKV//./ }; then
+ eerror "Your running kernel is too old to run this version of ${P}"
+ eerror "You need to upgrade kernel at least to ${MINKV}"
+ fi
+
+ if kernel_is -lt 3 7; then
+ ewarn "Your running kernel is too old to have firmware loader and"
+ ewarn "this version of ${P} doesn't have userspace firmware loader"
+ ewarn "If you need firmware support, you need to upgrade kernel at least to 3.7"
+ fi
+ fi
+}
+
+src_prepare() {
+ if ! [[ ${PV} = 9999* ]]; then
+ # secure_getenv() disable for non-glibc systems wrt bug #443030
+ if ! [[ $(grep -r secure_getenv * | wc -l) -eq 25 ]]; then
+ eerror "The line count for secure_getenv() failed, see bug #443030"
+ die
+ fi
+ fi
+
+ # backport some patches
+ if [[ -n "${patchset}" ]]; then
+ EPATCH_SUFFIX=patch EPATCH_FORCE=yes epatch
+ fi
+
+ cat <<-EOF > "${T}"/40-gentoo.rules
+ # Gentoo specific floppy and usb groups
+ SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+ SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb"
+ EOF
+
+ # change rules back to group uucp instead of dialout for now wrt #454556
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # stub out the am_path_libcrypt function
+ echo 'AC_DEFUN([AM_PATH_LIBGCRYPT],[:])' > m4/gcrypt.m4
+
+ # apply user patches
+ epatch_user
+
+ eautoreconf
+
+ if ! [[ ${PV} = 9999* ]]; then
+ check_default_rules
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by systemd/s:as_fn_error:echo:' \
+ configure || die
+
+ if ! use elibc_glibc; then #443030
+ echo '#define secure_getenv(x) NULL' >> config.h.in
+ sed -i -e '/error.*secure_getenv/s:.*:#define secure_getenv(x) NULL:' src/shared/missing.h || die
+ fi
+}
+
+multilib_src_configure() {
+ tc-export CC #463846
+ export cc_cv_CFLAGS__flto=no #502950
+ export cc_cv_CFLAGS__Werror_shadow=no #554454
+
+ # Keep sorted by ./configure --help and only pass --disable flags
+ # when *required* to avoid external deps or unnecessary compile
+ local econf_args
+ econf_args=(
+ ac_cv_search_cap_init=
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}
+ $(multilib_native_use_enable static-libs static)
+ --disable-nls
+ --disable-dbus
+ $(multilib_native_use_enable kmod)
+ --disable-xkbcommon
+ --disable-seccomp
+ $(multilib_native_use_enable selinux)
+ --disable-xz
+ --disable-lz4
+ --disable-pam
+ $(multilib_native_use_enable acl)
+ --disable-gcrypt
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-qrencode
+ --disable-microhttpd
+ --disable-gnuefi
+ --disable-gnutls
+ --disable-libcurl
+ --disable-libidn
+ --disable-quotacheck
+ --disable-logind
+ --disable-polkit
+ --disable-myhostname
+ $(multilib_is_native_abi || echo "--disable-manpages")
+ --enable-split-usr
+ --without-python
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ --with-rootprefix=
+ $(multilib_is_native_abi && echo "--with-rootlibdir=/$(get_libdir)")
+ )
+
+ if ! multilib_is_native_abi; then
+ econf_args+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ ECONF_SOURCE=${S} econf "${econf_args[@]}"
+}
+
+multilib_src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ # Most of the parallel build problems were solved by >=sys-devel/make-3.82-r4,
+ # but not everything -- separate building of the binaries as a workaround,
+ # which will force internal libraries required for the helpers to be built
+ # early enough, like eg. libsystemd-shared.la
+ if multilib_is_native_abi; then
+ local lib_targets=( libudev.la )
+ emake "${lib_targets[@]}"
+
+ local exec_targets=(
+ systemd-udevd
+ udevadm
+ )
+ emake "${exec_targets[@]}"
+
+ local helper_targets=(
+ ata_id
+ cdrom_id
+ collect
+ scsi_id
+ v4l_id
+ mtd_probe
+ )
+ emake "${helper_targets[@]}"
+
+ local man_targets=(
+ man/udev.conf.5
+ man/systemd.link.5
+ man/udev.7
+ man/systemd-udevd.service.8
+ man/udevadm.8
+ )
+ emake "${man_targets[@]}"
+ else
+ local lib_targets=( libudev.la )
+ emake "${lib_targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-rootbinPROGRAMS
+ install-rootlibexecPROGRAMS
+ install-udevlibexecPROGRAMS
+ install-dist_udevconfDATA
+ install-dist_udevrulesDATA
+ install-pkgconfiglibDATA
+ install-pkgconfigdataDATA
+ install-dist_docDATA
+ libudev-install-hook
+ install-directories-hook
+ install-dist_bashcompletionDATA
+ install-dist_networkDATA
+ )
+
+ # add final values of variables:
+ targets+=(
+ rootlibexec_PROGRAMS=systemd-udevd
+ rootbin_PROGRAMS=udevadm
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ pkgconfigdata_DATA="src/udev/udev.pc"
+ INSTALL_DIRS='$(sysconfdir)/udev/rules.d \
+ $(sysconfdir)/udev/hwdb.d \
+ $(sysconfdir)/systemd/network'
+ dist_bashcompletion_DATA="shell-completion/bash/udevadm"
+ dist_network_DATA="network/99-default.link"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ doman man/{udev.conf.5,systemd.link.5,udev.7,systemd-udevd.service.8,udevadm.8}
+ else
+ local lib_LTLIBRARIES="libudev.la" \
+ pkgconfiglib_DATA="src/libudev/libudev.pc" \
+ include_HEADERS="src/libudev/libudev.h"
+
+ local targets=(
+ install-libLTLIBRARIES
+ install-includeHEADERS
+ install-pkgconfiglibDATA
+ )
+
+ targets+=(
+ lib_LTLIBRARIES="${lib_LTLIBRARIES}"
+ pkgconfiglib_DATA="${pkgconfiglib_DATA}"
+ include_HEADERS="${include_HEADERS}"
+ )
+ emake -j1 DESTDIR="${D}" "${targets[@]}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc TODO
+
+ prune_libtool_files --all
+ rm -f \
+ "${D}"/lib/udev/rules.d/99-systemd.rules \
+ "${D}"/usr/share/doc/${PF}/{LICENSE.*,GVARIANT-SERIALIZATION,DIFFERENCES,PORTING-DBUS1,sd-shutdown.h}
+
+ # see src_prepare() for content of 40-gentoo.rules
+ insinto /lib/udev/rules.d
+ doins "${T}"/40-gentoo.rules
+
+ # maintainer note: by not letting the upstream build-sys create the .so
+ # link, you also avoid a parallel make problem
+ mv "${D}"/usr/share/man/man8/systemd-udevd{.service,}.8
+}
+
+pkg_postinst() {
+ mkdir -p "${ROOT%/}"/run
+
+ # "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
+ # So try to remove it here (will only work if empty).
+ rmdir "${ROOT%/}"/dev/loop 2>/dev/null
+ if [[ -d ${ROOT%/}/dev/loop ]]; then
+ ewarn "Please make sure your remove /dev/loop,"
+ ewarn "else losetup may be confused when looking for unused devices."
+ fi
+
+ local fstab="${ROOT%/}"/etc/fstab dev path fstype rest
+ while read -r dev path fstype rest; do
+ if [[ ${path} == /dev && ${fstype} != devtmpfs ]]; then
+ ewarn "You need to edit your /dev line in ${fstab} to have devtmpfs"
+ ewarn "filesystem. Otherwise udev won't be able to boot."
+ ewarn "See, http://bugs.gentoo.org/453186"
+ fi
+ done < "${fstab}"
+
+ if [[ -d ${ROOT%/}/usr/lib/udev ]]; then
+ ewarn
+ ewarn "Please re-emerge all packages on your system which install"
+ ewarn "rules and helpers in /usr/lib/udev. They should now be in"
+ ewarn "/lib/udev."
+ ewarn
+ ewarn "One way to do this is to run the following command:"
+ ewarn "emerge -av1 \$(qfile -q -S -C /usr/lib/udev)"
+ ewarn "Note that qfile can be found in app-portage/portage-utils"
+ fi
+
+ local old_cd_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-cd.rules
+ local old_net_rules="${ROOT%/}"/etc/udev/rules.d/70-persistent-net.rules
+ for old_rules in "${old_cd_rules}" "${old_net_rules}"; do
+ if [[ -f ${old_rules} ]]; then
+ ewarn
+ ewarn "File ${old_rules} is from old udev installation but if you still use it,"
+ ewarn "rename it to something else starting with 70- to silence this deprecation"
+ ewarn "warning."
+ fi
+ done
+
+ elog
+ elog "Starting from version >= 197 the new predictable network interface names are"
+ elog "used by default, see:"
+ elog "http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames"
+ elog "http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/udev-builtin-net_id.c"
+ elog
+ elog "Example command to get the information for the new interface name before booting"
+ elog "(replace <ifname> with, for example, eth0):"
+ elog "# udevadm test-builtin net_id /sys/class/net/<ifname> 2> /dev/null"
+ elog
+ elog "You can use either kernel parameter \"net.ifnames=0\", create empty"
+ elog "file /etc/systemd/network/99-default.link, or symlink it to /dev/null"
+ elog "to disable the feature."
+
+ if has_version 'sys-apps/biosdevname'; then
+ ewarn
+ ewarn "You can replace the functionality of sys-apps/biosdevname which has been"
+ ewarn "detected to be installed with the new predictable network interface names."
+ fi
+
+ ewarn
+ ewarn "You need to restart udev as soon as possible to make the upgrade go"
+ ewarn "into effect."
+ ewarn "The method you use to do this depends on your init system."
+ if has_version 'sys-apps/openrc'; then
+ ewarn "For sys-apps/openrc users it is:"
+ ewarn "# /etc/init.d/udev --nodeps restart"
+ fi
+
+ elog
+ elog "For more information on udev on Gentoo, upgrading, writing udev rules, and"
+ elog "fixing known issues visit:"
+ elog "http://wiki.gentoo.org/wiki/Udev"
+ elog "http://wiki.gentoo.org/wiki/Udev/upgrade"
+
+ # If user has disabled 80-net-name-slot.rules using a empty file or a symlink to /dev/null,
+ # do the same for 80-net-setup-link.rules to keep the old behavior
+ local net_move=no
+ local net_name_slot_sym=no
+ local net_rules_path="${ROOT%/}"/etc/udev/rules.d
+ local net_name_slot="${net_rules_path}"/80-net-name-slot.rules
+ local net_setup_link="${net_rules_path}"/80-net-setup-link.rules
+ if [[ ! -e ${net_setup_link} ]]; then
+ [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]] && net_move=yes
+ if [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ fi
+ fi
+ if [[ ${net_move} == yes ]]; then
+ ebegin "Copying ${net_name_slot} to ${net_setup_link}"
+
+ if [[ ${net_name_slot_sym} == yes ]]; then
+ ln -nfs /dev/null "${net_setup_link}"
+ else
+ cp "${net_name_slot}" "${net_setup_link}"
+ fi
+ eend $?
+ fi
+
+ # http://cgit.freedesktop.org/systemd/systemd/commit/rules/50-udev-default.rules?id=3dff3e00e044e2d53c76fa842b9a4759d4a50e69
+ # http://bugs.gentoo.org/246847
+ # http://bugs.gentoo.org/514174
+ enewgroup input
+
+ # Update hwdb database in case the format is changed by udev version.
+ if has_version 'sys-apps/hwids[udev]'; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # Only reload when we are not upgrading to avoid potential race w/ incompatible hwdb.bin and the running udevd
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [[ -z ${REPLACING_VERSIONS} ]] && udev_reload
+ fi
+}
diff --git a/sys-fs/udftools/Manifest b/sys-fs/udftools/Manifest
new file mode 100644
index 000000000000..3c09d3367e13
--- /dev/null
+++ b/sys-fs/udftools/Manifest
@@ -0,0 +1,2 @@
+DIST udftools-1.0.0b3.patch.bz2 3372 SHA256 4c35eb06da92677203137ee407ba29bdf0bec574550567cc6cecb63158099dbb SHA512 2b30741ffb7bab0139f6a3fb55911517c7f0489b76bc3453c3e0c519356689a8a9ad9c2b7e954267e8e14a6840498cd3c93641c5eb69f373f7bb19d35ffe9f19 WHIRLPOOL 43d096e0959da24f2b272ee60ba753c45346c12139627c5a6721b6db71f4dd85ca62d97799c79fca5b6d3e2222ff86262bb3ac62c9a3f3fe1f1fbd387bcc34c9
+DIST udftools-1.0.0b3.tar.gz 293257 SHA256 c5079e878d4d8e03de0fd75bfecf485a299689b8289a5288f18b2e793e0904a0 SHA512 4b45ff2e389ce93c3ac372f74daa3e2a43e02434c1e3d9df8cf050e137799491ac88d7aedd2b61c6d79a7ab8878042689c948c0b2aeb4be0a172c64844f07068 WHIRLPOOL 157ff4b18ef7497067b8398e0d57a25e6549c3c8637633fe3648c42d446562cd9c2f2533a25895cf628343223eb1ccbb59511df40606525486c6e4e58c0dc0d3
diff --git a/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch b/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch
new file mode 100644
index 000000000000..602c808a1b0b
--- /dev/null
+++ b/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch
@@ -0,0 +1,22 @@
+Fix CD blanking for kernels 2.6.8 and newer
+(write access is required to perform blanking commands)
+
+The original version broke support on Linux 2.4, thanks to Ben Peddell for pointing
+this out to me, and for the updated patch.
+
+ - Daniel Drake <dsd@gentoo.org>
+ - Ben Peddell <klightspeed@klightspeed.is-a-geek.net>
+
+--- udftools-1.0.0b3/cdrwtool/main.c.orig 2004-12-30 22:53:52.000000000 +0000
++++ udftools-1.0.0b3/cdrwtool/main.c 2004-12-30 22:54:36.000000000 +0000
+@@ -242,7 +242,9 @@ int main(int argc, char *argv[])
+ udf_init_disc(&disc.udf_disc);
+ strcpy(filename, CDROM_DEVICE);
+ parse_args(argc, argv, &disc, filename);
+- if ((fd = open(filename, O_RDONLY | O_NONBLOCK)) < 0)
++ if (((fd = open(filename, O_RDWR | O_NONBLOCK)) < 0) &&
++ ((errno != EROFS) ||
++ ((fd = open(filename, O_RDONLY | O_NONBLOCK)) < 0)))
+ {
+ perror("open cdrom device");
+ return fd;
diff --git a/sys-fs/udftools/files/pktcdvd.init b/sys-fs/udftools/files/pktcdvd.init
new file mode 100644
index 000000000000..81eb917b355c
--- /dev/null
+++ b/sys-fs/udftools/files/pktcdvd.init
@@ -0,0 +1,62 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Id$
+
+depend() {
+ need localmount modules
+}
+
+checkconfig() {
+ if ! [ -e /dev/pktcdvd/control ]; then
+ eerror "Could not find packet-writing control device at /dev/pktcdvd/control"
+ eerror "Please ensure that your kernel includes packet writing support,"
+ eerror "and if modular, ensure that the module is loaded."
+ return 1
+ fi
+}
+
+get_rw_devices() {
+ devices_raw=$(sed -re '/^drive name:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
+ count=0
+ for i in $devices_raw; do
+ eval "devices_$count=\"\$i\""
+ count=$(( $count + 1 ))
+ done
+ devs=""
+
+ cdrw_caps=$(sed -re '/^Can write CD-RW:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
+
+ count=0
+ for i in $cdrw_caps; do
+ [ "$i" -eq 1 ] && eval "devs=\"\$devs \$devices_$count\""
+ count=$(( $count + 1 ))
+ done
+
+ echo ${devs}
+}
+
+start() {
+ checkconfig || return 1
+
+ for i in $(get_rw_devices)
+ do
+ devnode="/dev/${i}"
+ [ -e "${devnode}" ] || continue
+
+ /usr/bin/pktsetup "${i}" "${devnode}" > /dev/null
+ [ -e "/dev/pktcdvd/${i}" ] || continue
+ chmod 660 "/dev/pktcdvd/${i}"
+ chgrp cdrw "/dev/pktcdvd/${i}"
+ done
+}
+
+stop() {
+ checkconfig || return 1
+
+ for i in $(get_rw_devices)
+ do
+ /usr/bin/pktsetup -d "${i}" > /dev/null
+ done
+}
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch
new file mode 100644
index 000000000000..d49b2561e4e9
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch
@@ -0,0 +1,28 @@
+http://bugs.gentoo.org/120245
+
+BE fix
+
+===================================================================
+RCS file: /cvsroot/linux-udf/udftools/mkudffs/mkudffs.c,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -r1.3 -r1.4
+--- linux-udf/udftools/mkudffs/mkudffs.c 2004/02/23 03:35:33 1.3
++++ linux-udf/udftools/mkudffs/mkudffs.c 2004/03/02 02:09:39 1.4
+@@ -250,14 +250,14 @@
+ if (size % offsets[PSPACE_SIZE])
+ size -= (size % offsets[PSPACE_SIZE]);
+ set_extent(disc, PSPACE, start, size);
+- for (i=0; i<disc->udf_lvd[0]->numPartitionMaps; i++)
++ for (i=0; i<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); i++)
+ {
+ if (i == 1)
+ disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(0xFFFFFFFF);
+ else
+ disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(size);
+ }
+- for (j=0; j<disc->udf_lvd[0]->numPartitionMaps; j++)
++ for (j=0; j<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); j++)
+ {
+ if (j == 1)
+ disc->udf_lvid->sizeTable[i+j] = cpu_to_le32(0xFFFFFFFF);
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch b/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch
new file mode 100644
index 000000000000..3b58f20f0173
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/112122
+
+gcc4 compat
+
+--- a/wrudf/wrudf.c
++++ b/wrudf/wrudf.c
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- (char*)spm += spm->partitionMapLength;
++ spm = (char*)spm + spm->partitionMapLength;
+ }
+
+ if( medium == CDR ) {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch b/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch
new file mode 100644
index 000000000000..74dddf9e012c
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch
@@ -0,0 +1,23 @@
+http://bugs.gentoo.org/335511
+
+--- cdrwtool/cdrwtool.c
++++ cdrwtool/cdrwtool.c
+@@ -31,6 +31,7 @@
+ #include <sys/ioctl.h>
+ #include <asm/param.h>
+
++#include <limits.h> /* INT_MAX */
+ #include <linux/cdrom.h>
+
+ #include "cdrwtool.h"
+--- pktsetup/pktsetup.c
++++ pktsetup/pktsetup.c
+@@ -26,6 +26,8 @@
+ #include <bits/types.h>
+ #include <sys/types.h>
+
++#include <limits.h> /* INT_MAX */
++#include <stdlib.h> /* system */
+ #include <linux/cdrom.h>
+
+ /*
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch b/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch
new file mode 100644
index 000000000000..88803e43d6fb
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch
@@ -0,0 +1,15 @@
+From: Magnus Granberg <zorry@ume.nu>
+https://bugs.gentoo.org/232100
+Remove nonsense O_CREAT flag
+
+--- pktsetup/pktsetup.c 2008-06-19 00:27:08.000000000 +0200
++++ pktsetup/pktsetup.c 2008-06-19 00:20:31.000000000 +0200
+@@ -85,7 +85,7 @@
+ {
+ int pkt_fd, dev_fd, cmd;
+
+- if ((pkt_fd = open(pkt_device, O_RDONLY | O_CREAT)) == -1) {
++ if ((pkt_fd = open(pkt_device, O_RDONLY)) == -1) {
+ perror("open packet device");
+ return;
+ }
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
new file mode 100644
index 000000000000..8e7e0d13a7f2
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
@@ -0,0 +1,44 @@
+taken from Fedora, but with minor return type fixes: changed NULL to 0
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-extsize.patch?h=f22
+
+diff -up udftools-1.0.0b3/libudffs/extent.c.extsize udftools-1.0.0b3/libudffs/extent.c
+--- udftools-1.0.0b3/libudffs/extent.c.extsize 2012-01-26 09:45:22.217856499 +0100
++++ udftools-1.0.0b3/libudffs/extent.c 2012-01-26 09:45:43.142855067 +0100
+@@ -50,7 +50,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = next_extent(start_ext->next, type);
+
+- if (start_ext->start % offset)
++ if (start_ext != NULL && start_ext->start % offset)
+ {
+ inc = offset - (start_ext->start % offset);
+ if (start_ext->blocks - inc < blocks)
+@@ -62,7 +62,7 @@ cont:
+ else
+ inc = 0;
+
+- return start_ext->start + inc;
++ return start_ext ? start_ext->start + inc : 0;
+ }
+
+ struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type)
+@@ -81,7 +81,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = prev_extent(start_ext->prev, type);
+
+- if ((start_ext->start + start_ext->blocks) % offset)
++ if (start_ext != NULL && (start_ext->start + start_ext->blocks) % offset)
+ {
+ dec = (start_ext->start + start_ext->blocks) % offset;
+ if (start_ext->blocks - dec < blocks)
+@@ -93,7 +93,7 @@ cont:
+ else
+ dec = 0;
+
+- return start_ext->start + start_ext->blocks - dec - blocks;
++ return start_ext ? start_ext->start + start_ext->blocks - dec - blocks : 0;
+ }
+
+ struct udf_extent *find_extent(struct udf_disc *disc, uint32_t start)
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
new file mode 100644
index 000000000000..afda3bd00d3a
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
@@ -0,0 +1,57 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-man-missing-options.patch?h=f22
+
+diff -up wrk/doc/cdrwtool.1.wrk wrk/doc/cdrwtool.1
+--- wrk/doc/cdrwtool.1.wrk 2014-01-29 15:23:18.623940293 +0100
++++ wrk/doc/cdrwtool.1 2014-01-29 15:24:27.027471222 +0100
+@@ -97,6 +97,10 @@ Close track.
+ .IP "\fB\-r \fItrack\fP"
+ Reserve track.
+
++.IP "\fB\-z \fIlength\fP"
++Fixed packet length.
++
++
+ .IP \fB\-s\fP
+ Set write parameters determined by
+ .BR "\-l" , " \-w" ", and" " \-p"
+diff -up wrk/doc/mkudffs.8.wrk wrk/doc/mkudffs.8
+--- wrk/doc/mkudffs.8.wrk 2014-01-29 15:47:54.095408327 +0100
++++ wrk/doc/mkudffs.8 2014-01-29 15:51:18.115200882 +0100
+@@ -151,6 +151,13 @@ Use 16-bit unicode for file names
+ .TP
+ .B \-\-utf8
+ Use UTF-8 for file names
++.TP
++.B \-\-closed
++.TP
++.B \-\-bridge
++.TP
++.BI \-\-packetlen= " length "
++
+
+ .SH "EXIT STATUS"
+ .B mkudffs
+diff -up wrk/doc/pktsetup.8.wrk wrk/doc/pktsetup.8
+--- wrk/doc/pktsetup.8.wrk 2002-11-26 08:18:51.000000000 +0100
++++ wrk/doc/pktsetup.8 2014-01-29 15:36:29.509665177 +0100
+@@ -37,6 +37,9 @@ pktsetup \- set up and tear down packet
+ .B pktsetup
+ .B \-d
+ .I packet_device
++.br
++.B pktsetup
++.B \-s
+ .ad b
+ .SH DESCRIPTION
+ .B Pktsetup
+@@ -58,6 +61,8 @@ returns 0 on success, nonzero on failure
+ .IP "\fB\-d \fIpacket-device\fP"
+ Delete the association between the specified \fIpacket-device\fP
+ and its block device.
++.IP "\fB\-s"
++Show device mappings.
+
+ .SH EXAMPLE
+ The following commands provide an example of using the
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
new file mode 100644
index 000000000000..68c637cd89f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
@@ -0,0 +1,115 @@
+taken from Fedora, but parts removed due to conflicts w/udftools-1.0.0b-bigendian.patch
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-mkudffs-bigendian.patch?h=f22
+
+diff -up udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian udftools-1.0.0b3/mkudffs/defaults.c
+--- udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian 2007-08-23 13:41:29.000000000 +0200
++++ udftools-1.0.0b3/mkudffs/defaults.c 2007-08-23 13:42:16.000000000 +0200
+@@ -69,7 +69,7 @@ struct primaryVolDesc default_pvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(1),
+@@ -119,7 +119,7 @@ struct logicalVolDesc default_lvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(2),
+@@ -157,7 +157,7 @@ struct volDescPtr default_vdp =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_VDP),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct volDescPtr) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(3),
+@@ -192,7 +192,7 @@ struct impUseVolDesc default_iuvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_IUVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct impUseVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(4),
+@@ -215,7 +215,7 @@ struct partitionDesc default_pd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct partitionDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(5),
+@@ -242,7 +242,7 @@ struct unallocSpaceDesc default_usd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_USD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct unallocSpaceDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(6),
+@@ -254,7 +254,7 @@ struct terminatingDesc default_td =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_TD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct terminatingDesc) - sizeof(tag)),
+ },
+ };
+@@ -265,7 +265,7 @@ struct logicalVolIntegrityDesc default_l
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolIntegrityDesc) - sizeof(tag)),
+ },
+ integrityType : constant_cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE),
+@@ -295,7 +295,7 @@ struct sparingTable default_stable =
+ {
+ tagIdent : constant_cpu_to_le16(0),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct sparingTable) - sizeof(tag)),
+ },
+ sparingIdent :
+@@ -387,7 +387,7 @@ struct fileSetDesc default_fsd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_FSD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct fileSetDesc) - sizeof(tag)),
+ },
+ interchangeLvl : constant_cpu_to_le16(2),
+@@ -426,7 +426,7 @@ struct fileEntry default_fe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
+@@ -458,7 +458,7 @@ struct extendedFileEntry default_efe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
new file mode 100644
index 000000000000..9ff411b24528
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
@@ -0,0 +1,164 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-staticanal.patch?h=f22
+
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/cdrwtool/cdrwtool.c:626: result_independent_of_operands: (ret == ioctl(fd, 21289, 1)) < 0 is always false regardless of the values of its operands. This occurs as the logical operand of if.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal udftools-1.0.0b3/cdrwtool/cdrwtool.c
+--- udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal 2012-01-26 16:20:44.518234366 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.c 2012-01-26 16:20:44.537234366 +0100
+@@ -623,7 +623,7 @@ int cdrom_open_check(int fd)
+ if ((ret = ioctl(fd, CDROM_CLEAR_OPTIONS, CDO_LOCK)) < 0)
+ return ret;
+
+- if ((ret == ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
++ if ((ret = ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
+ fprintf(stderr, "CD-ROM appears to already be opened\n");
+ return 1;
+ }
+diff -up udftools-1.0.0b3/cdrwtool/options.c.staticanal udftools-1.0.0b3/cdrwtool/options.c
+--- udftools-1.0.0b3/cdrwtool/options.c.staticanal 2012-01-26 16:26:11.288212023 +0100
++++ udftools-1.0.0b3/cdrwtool/options.c 2012-01-26 16:27:24.125207040 +0100
+@@ -135,7 +135,8 @@ void parse_args(int argc, char *argv[],
+ }
+ case 'd':
+ {
+- strcpy(device, optarg);
++ strncpy(device, optarg, NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ printf("using device %s\n", device);
+ break;
+ }
+
+
+==========================================================================
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: negative_return_fn: Function "open64(filename, 66, 432)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: var_assign: Assigning: signed variable "fd" = "open64".
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:165: negative_returns: "fd" is passed to a parameter that cannot be negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:85: neg_sink_parm_call: Passing "fd" to "valid_offset", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:55: neg_sink_parm_call: Passing "fd" to "udf_lseek64", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:43: neg_sink_parm_call: Passing "fd" to "lseek64", which cannot accept a negative.
+
+diff -up udftools-1.0.0b3/mkudffs/main.c.staticanal udftools-1.0.0b3/mkudffs/main.c
+--- udftools-1.0.0b3/mkudffs/main.c.staticanal 2004-02-23 04:33:11.000000000 +0100
++++ udftools-1.0.0b3/mkudffs/main.c 2012-01-26 16:29:17.605199282 +0100
+@@ -162,6 +162,10 @@ int main(int argc, char *argv[])
+ #else
+ fd = open(filename, O_RDWR | O_CREAT | O_LARGEFILE, 0660);
+ #endif
++ if (fd == NULL) {
++ fprintf(stderr, "mkudffs: cannot open '%s' for writing\n", filename);
++ exit(1);
++ }
+ disc.head->blocks = get_blocks(fd, disc.blocksize, disc.head->blocks);
+ disc.write = write_func;
+ disc.write_data = &fd;
+
+
+==========================================================================
+Error: BAD_SIZEOF:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/mkudffs.c:45: bad_sizeof: Taking the size of pointer parameter "disc" is suspicious.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal udftools-1.0.0b3/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal 2012-01-26 16:20:44.526234367 +0100
++++ udftools-1.0.0b3/mkudffs/mkudffs.c 2012-01-26 16:20:44.539234366 +0100
+@@ -42,7 +42,7 @@ void udf_init_disc(struct udf_disc *disc
+ struct tm *tm;
+ int altzone;
+
+- memset(disc, 0x00, sizeof(disc));
++ memset(disc, 0x00, sizeof(*disc));
+
+ disc->blocksize = 2048;
+ disc->blocksize_bits = 11;
+diff -up udftools-1.0.0b3/mkudffs/options.c.staticanal udftools-1.0.0b3/mkudffs/options.c
+--- udftools-1.0.0b3/mkudffs/options.c.staticanal 2012-01-26 16:24:14.082220036 +0100
++++ udftools-1.0.0b3/mkudffs/options.c 2012-01-26 16:27:29.086206703 +0100
+@@ -320,7 +320,8 @@ void parse_args(int argc, char *argv[],
+ }
+ if (optind == argc)
+ usage();
+- strcpy(device, argv[optind]);
++ strncpy(device, argv[optind], NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ optind ++;
+ if (optind < argc)
+ disc->head->blocks = strtoul(argv[optind++], NULL, 0);
+
+
+==========================================================================
+Error: OVERRUN_STATIC:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:378: overrun-local: Overrunning static array "spm->locSparingTable", with 4 elements, at position 4 with index variable "i".
+
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: negative_return_fn: Function "open(filename, 2)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: var_assign: Assigning: signed variable "device" = "open".
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:773: negative_returns: "device" is passed to a parameter that cannot be negative.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal 2012-01-26 16:20:44.529234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2012-01-26 16:35:29.729173836 +0100
+@@ -374,7 +374,7 @@ void updateSparingTable() {
+ struct packetbuf *pb;
+ struct sparablePartitionMap *spm = (struct sparablePartitionMap*)lvd->partitionMaps;
+
+- for( i = 0; i <= 4; i++ ) {
++ for( i = 0; i < sizeof(spm->locSparingTable); i++ ) {
+ pbn = spm->locSparingTable[i];
+ if( pbn == 0 )
+ return;
+@@ -682,6 +682,8 @@ readExtents(char* dest, int usesShort, v
+ dest += 2048;
+ if( len < 2048 )
+ break;
++ /* dead code, len couldn't be 0 at this point
++ (break was called in this case) */
+ if( len == 0 ) {
+ if( usesShort ) {
+ sh++;
+@@ -766,8 +768,10 @@ initIO(char *filename)
+
+ if( S_ISREG(filestat.st_mode) ) { /* disk image of a UDF volume */
+ devicetype = DISK_IMAGE;
+- if( !(device = open(filename, O_RDWR)) )
++ if( !(device = open(filename, O_RDWR)) ) {
+ fail("initIO: open %s failed\n", filename);
++ return 0;
++ }
+
+ /* heuristically determine medium imitated on disk image based on VAT FileEntry in block 512 */
+ rv = lseek(device, 2048 * 512, SEEK_SET);
+
+==========================================================================
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cmnd.c:699: missing_parentheses: !(*fid)->fileCharacteristics & 2 is always 0 regardless of the values of its operands. This occurs as the logical operand of if. Did you intend to apply '&' to (*fid)->fileCharacteristics and 2? If so, parentheses would be required to force this interpretation.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal 2012-01-26 16:20:44.530234366 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2012-01-26 16:20:44.543234366 +0100
+@@ -696,7 +696,7 @@ analyzeDest(char* arg, struct fileIdentD
+ *fid = findFileIdentDesc(curDir, comp);
+ if( *fid == NULL )
+ return DIR_INVALID;
+- if( ! (*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY )
++ if( ! ((*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY ))
+ return DIR_INVALID;
+ if( (*fid)->fileCharacteristics & FID_FILE_CHAR_DELETED )
+ return DIR_INVALID;
+diff -up udftools-1.0.0b3/wrudf/wrudf.c.staticanal udftools-1.0.0b3/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c.staticanal 2012-01-26 16:20:44.528234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.c 2012-01-26 16:20:44.545234365 +0100
+@@ -158,6 +158,7 @@ initialise(char *devicename)
+
+ if( (p = readTaggedBlock(blkno, ABSOLUTE)) == NULL ) {
+ if( !inMainSeq )
++ /* dead code - the condition "inMainSeq" cannot be false */
+ fail("Volume Descriptor Sequences read failure\n");
+ blkno = extentRsrvVolDescSeq.extLocation;
+ len = extentRsrvVolDescSeq.extLength;
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
new file mode 100644
index 000000000000..5b530c6041e1
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
@@ -0,0 +1,94 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes.patch?h=f22
+
+diff -Naupr udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h udftools-1.0.0b3/cdrwtool/cdrwtool.h
+--- udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h 2002-11-26 08:18:50.000000000 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.h 2006-07-27 14:16:06.000000000 +0200
+@@ -226,6 +226,7 @@ int read_disc_info(int, disc_info_t *);
+ int read_track_info(int, track_info_t *, int);
+ int reserve_track(int, struct cdrw_disc *);
+ int close_track(int, unsigned int);
++int close_session(int, unsigned int);
+ int read_buffer_cap(int, struct cdrw_disc *);
+ int set_cd_speed(int, int);
+ void cdrom_close(int);
+@@ -236,5 +237,6 @@ int print_disc_track_info(int);
+ void make_write_page(write_params_t *, struct cdrw_disc *);
+ void print_params(write_params_t *);
+ void cdrw_init_disc(struct cdrw_disc *);
++int udf_set_version(struct udf_disc *, int);
+
+ #endif /* _CDRWTOOL_H */
+diff -Naupr udftools-1.0.0b3.orig/include/udf_endian.h udftools-1.0.0b3/include/udf_endian.h
+--- udftools-1.0.0b3.orig/include/udf_endian.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/include/udf_endian.h 2006-07-27 14:09:30.000000000 +0200
+@@ -23,6 +23,8 @@
+ #ifndef __UDF_ENDIAN_H
+ #define __UDF_ENDIAN_H
+
++#include <string.h>
++
+ #include "bswap.h"
+
+ static inline lb_addr lelb_to_cpu(lb_addr in)
+diff -Naupr udftools-1.0.0b3.orig/libudffs/unicode.c udftools-1.0.0b3/libudffs/unicode.c
+--- udftools-1.0.0b3.orig/libudffs/unicode.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/libudffs/unicode.c 2006-07-27 14:11:17.000000000 +0200
+@@ -169,8 +169,6 @@ error_out:
+
+ int decode_string(struct udf_disc *disc, char *in, char *out, int inlen)
+ {
+- int i;
+-
+ if (disc->flags & FLAG_UTF8)
+ return decode_utf8(in, out, inlen);
+ else if (disc->flags & (FLAG_UNICODE8 | FLAG_UNICODE16))
+diff -Naupr udftools-1.0.0b3.orig/pktsetup/pktsetup.c udftools-1.0.0b3/pktsetup/pktsetup.c
+--- udftools-1.0.0b3.orig/pktsetup/pktsetup.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/pktsetup/pktsetup.c 2006-07-27 14:18:24.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <getopt.h>
+ #include <bits/types.h>
+ #include <sys/types.h>
++#include <string.h>
+
+ #include <linux/cdrom.h>
+
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.am udftools-1.0.0b3/wrudf/Makefile.am
+--- udftools-1.0.0b3.orig/wrudf/Makefile.am 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.am 2006-07-27 14:21:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.in udftools-1.0.0b3/wrudf/Makefile.in
+--- udftools-1.0.0b3.orig/wrudf/Makefile.in 2004-02-23 10:33:48.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.in 2006-07-27 14:21:44.000000000 +0200
+@@ -85,7 +85,7 @@ am__quote = @am__quote@
+ install_sh = @install_sh@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+ subdir = wrudf
+diff -Naupr udftools-1.0.0b3.orig/wrudf/wrudf.h udftools-1.0.0b3/wrudf/wrudf.h
+--- udftools-1.0.0b3.orig/wrudf/wrudf.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.h 2006-07-27 14:22:33.000000000 +0200
+@@ -23,9 +23,11 @@
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdint.h>
++#include <string.h>
+
+ #include "ecma_167.h"
+ #include "osta_udf.h"
++#include "libudffs.h"
+
+ struct generic_desc
+ {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
new file mode 100644
index 000000000000..1593eb600fae
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
@@ -0,0 +1,160 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes2.patch?h=f22
+
+diff -ur udftools-1.0.0b3/libudffs/file.c udftools-1.0.0b3-new/libudffs/file.c
+--- udftools-1.0.0b3/libudffs/file.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/libudffs/file.c 2007-08-23 14:02:07.000000000 +0200
+@@ -576,7 +576,7 @@
+ tmp = leBPL_to_cpup(p);
+ found_first:
+ tmp |= (~0UL << size);
+- if (tmp == ~0UL) /* Are any bits zero? */
++ if (tmp == (uintBPL)~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
+ found_middle:
+ return result + ffz(tmp);
+diff -ur udftools-1.0.0b3/mkudffs/mkudffs.c udftools-1.0.0b3-new/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/mkudffs/mkudffs.c 2007-08-23 14:14:42.000000000 +0200
+@@ -72,7 +72,7 @@
+ disc->udf_pvd[0] = malloc(sizeof(struct primaryVolDesc));
+ memcpy(disc->udf_pvd[0], &default_pvd, sizeof(struct primaryVolDesc));
+ memcpy(&disc->udf_pvd[0]->recordingDateAndTime, &ts, sizeof(timestamp));
+- sprintf(&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
++ sprintf((char *)&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
+ mktime(tm), &disc->udf_pvd[0]->volSetIdent[9]);
+ disc->udf_pvd[0]->volIdent[31] = strlen(disc->udf_pvd[0]->volIdent);
+ disc->udf_pvd[0]->volSetIdent[127] = strlen(disc->udf_pvd[0]->volSetIdent);
+@@ -289,7 +289,7 @@
+ int write_disc(struct udf_disc *disc)
+ {
+ struct udf_extent *start_ext;
+- int ret;
++ int ret=0;
+
+ start_ext = disc->head;
+
+@@ -299,6 +299,7 @@
+ return ret;
+ start_ext = start_ext->next;
+ }
++ return ret;
+ }
+
+ void setup_vrs(struct udf_disc *disc)
+@@ -450,7 +451,7 @@
+ struct unallocSpaceEntry *use;
+ short_ad *sad;
+ int max = (0x3FFFFFFF / disc->blocksize) * disc->blocksize;
+- int pos;
++ int pos=0;
+ long long rem;
+
+ if (disc->flags & FLAG_STRATEGY4096)
+diff -ur udftools-1.0.0b3/wrudf/ide-pc.c udftools-1.0.0b3-new/wrudf/ide-pc.c
+--- udftools-1.0.0b3/wrudf/ide-pc.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/ide-pc.c 2007-08-23 14:32:09.000000000 +0200
+@@ -31,6 +31,7 @@
+ #include <sys/types.h> /* for u_char etc. */
+ #include <linux/cdrom.h>
+ #include <unistd.h> /* sleep() */
++#include <stdlib.h>
+
+ #include "bswap.h"
+ #include "ide-pc.h"
+diff -ur udftools-1.0.0b3/wrudf/wrudf.c udftools-1.0.0b3-new/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/wrudf/wrudf.c 2007-08-23 14:26:41.000000000 +0200
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- spm = (char*)spm + spm->partitionMapLength;
++ spm = (struct sparablePartitionMap*)((char*)spm + spm->partitionMapLength);
+ }
+
+ if( medium == CDR ) {
+@@ -300,7 +300,7 @@
+ fail("SpaceBitmap not found\n");
+ }
+
+- if (fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))
++ if ((fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))>=0)
+ fsdOut[fsdLen] = '\0';
+
+ printf("You are going to update fileset '%s'\nProceed (y/N) : ", &fsdOut[1]);
+@@ -605,7 +605,7 @@
+ int
+ main(int argc, char** argv)
+ {
+- int rv;
++ int rv=0;
+ int cmnd;
+ char prompt[256];
+ Directory *d;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cdrw.c udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c 2007-08-23 14:30:14.000000000 +0200
+@@ -614,7 +614,6 @@
+ readTaggedBlock(uint32_t lbn, uint16_t partition)
+ {
+ int i;
+- uint32_t blkno;
+ uint8_t sum, *p;
+ struct generic_desc *block;
+
+@@ -634,7 +633,7 @@
+ if( strncmp(((struct sparingTable*)block)->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING)) != 0 ) {
+ for( i = 0; i < 2048; i++ ) {
+ if( ((uint8_t*)block)[i] != 0 ) {
+- printf("readTaggedBlock: Empty block %d not all zeroes\n", blkno);
++ printf("readTaggedBlock: Empty block %d not all zeroes\n", lbn);
+ break;
+ }
+ }
+@@ -647,10 +646,10 @@
+ sum += *(p + i);
+
+ if( block->descTag.tagChecksum != sum )
+- fail("readTagged: Checksum error in block %d\n", blkno);
++ fail("readTagged: Checksum error in block %d\n", lbn);
+
+ if( block->descTag.descCRC != udf_crc((uint8_t*)block + sizeof(tag), ((tag*)block)->descCRCLength, 0) )
+- fail("readTagged: CRC error in block %d\n", blkno);
++ fail("readTagged: CRC error in block %d\n", lbn);
+
+ return block;
+ }
+@@ -709,8 +708,8 @@
+ writeExtents(char* src, int usesShort, void* extents)
+ {
+ uint len, blkno, partitionNumber;
+- long_ad *lo;
+- short_ad *sh;
++ long_ad *lo=NULL;
++ short_ad *sh=NULL;
+
+ if( usesShort ) {
+ sh = (short_ad*) extents;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cmnd.c udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c 2007-08-23 14:22:41.000000000 +0200
+@@ -45,7 +45,7 @@
+ int
+ copyFile(Directory *dir, char* inName, char*newName, struct stat *fileStat)
+ {
+- int fd, i, blkno;
++ int fd, i=0, blkno;
+ uint32_t nBytes, blkInPkt;
+ uint32_t maxVarPktSize; // in bytes
+ struct fileIdentDesc *fid;
+@@ -54,7 +54,7 @@
+
+ fd = open(inName, O_RDONLY);
+ if( fd == 0 ) {
+- printf("'%s' does not exist\n", cmndv[i]);
++ printf("'%s' does not exist\n", inName);
+ return CMND_FAILED;
+ }
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
new file mode 100644
index 000000000000..06d9c3f616f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
@@ -0,0 +1,52 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-wrudf_help.patch?h=f22
+
+diff -up wrk/wrudf/wrudf.c.wrk wrk/wrudf/wrudf.c
+--- wrk/wrudf/wrudf.c.wrk 2013-04-15 15:32:03.395528452 +0200
++++ wrk/wrudf/wrudf.c 2013-04-15 16:06:37.535546730 +0200
+@@ -603,6 +603,28 @@ parseCmnd(char* line)
+ return cmnd;
+ }
+
++int show_help()
++{
++ char *msg =
++ "Interactive tool to maintain an UDF filesystem.\n"
++ "Usage:\n"
++ "\twrudf [device]\n"
++ "Available commands:\n"
++ "\tcp\n"
++ "\trm\n"
++ "\tmkdir\n"
++ "\trmdir\n"
++ "\tlsc\n"
++ "\tlsh\n"
++ "\tcdc\n"
++ "\tcdh\n"
++ "Specify cdh/lsh or cdc/lsc to do cd or ls for Harddisk or CompactDisc.\n"
++ "\tquit\n"
++ "\texit\n";
++ printf("%s", msg);
++ return 0;
++}
++
+ int
+ main(int argc, char** argv)
+ {
+@@ -614,8 +636,14 @@ main(int argc, char** argv)
+ printf("wrudf " WRUDF_VERSION "\n");
+ devicename= "/dev/cdrom";
+
+- if(argc > 1 )
++ if(argc > 1 ) {
++ if (strcmp(argv[1], "-h")==0 || strcmp(argv[1], "-help")==0 || strcmp(argv[1], "--help")==0) {
++ return show_help();
++ }
++ }
++ else {
+ devicename = argv[1]; /* can specify disk image filename */
++ }
+
+ if( setpriority(PRIO_PROCESS, 0, -10) ) {
+ printf("setpriority(): %m\n");
diff --git a/sys-fs/udftools/metadata.xml b/sys-fs/udftools/metadata.xml
new file mode 100644
index 000000000000..acbd8886c16a
--- /dev/null
+++ b/sys-fs/udftools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">linux-udf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/udftools/udftools-1.0.0b-r10.ebuild b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
new file mode 100644
index 000000000000..508cdcdd5ac9
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="http://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ epatch "${FILESDIR}"/${P}3-extsize.patch
+ epatch "${FILESDIR}"/${P}3-man-missing-options.patch
+ epatch "${FILESDIR}"/${P}3-mkudffs-bigendian.patch
+ epatch "${FILESDIR}"/${P}3-staticanal.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes2.patch
+ epatch "${FILESDIR}"/${P}3-wrudf_help.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}
diff --git a/sys-fs/udftools/udftools-1.0.0b-r9.ebuild b/sys-fs/udftools/udftools-1.0.0b-r9.ebuild
new file mode 100644
index 000000000000..2fd946e8bfd0
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r9.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="http://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc ChangeLog
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}
diff --git a/sys-fs/udiskie/Manifest b/sys-fs/udiskie/Manifest
new file mode 100644
index 000000000000..45cd276194bb
--- /dev/null
+++ b/sys-fs/udiskie/Manifest
@@ -0,0 +1,3 @@
+DIST udiskie-0.6.2.tar.gz 48983 SHA256 94427cc626efc375dfc8f7b8dfc4eb7028e69829f3eb42e7f54d20a4780cbf37 SHA512 5e1aae4b31c9d7d1a438c2153bbdc5bb45a1f28264c80ed11d060e507949c996cc8fa0b85b506d7ee0f867b583529d6c039353ea19490c3c158c7d94c7ad9e26 WHIRLPOOL bd5e8d9871c87173198cb1747fcd707888e32357ef7c8d1bd0afd8a08b876cf6361690a27bc0cff21432b2bca770315d613dc0bb08d79002c67a689bc35b4e94
+DIST udiskie-0.6.4.tar.gz 51201 SHA256 fe0f387b50266016042cb6e551f7cb9c17246e5bb58f2a8833d7bfa83b2f9d44 SHA512 a3eca82e5595d961fe52bb9c3379ec18a5d187d0d7afd48f4801155570a50b742c27cb3a93a58535d57bbf8a0bc673366d1c57bf38a32d92e53fb31b98133bfa WHIRLPOOL 3297ecee02b2994471bf8e74650efe390e32c5b75384ed5fd0220eceb27d8863291f476643b1694810fef1d9e8136525235fe8f8a2c0f162c9a9d46e19f1e1da
+DIST udiskie-1.1.1.tar.gz 62207 SHA256 5d7750d4264cd1defc812bf0bc9ec63e52ed859b6d40e4d1941846ec8f8eddea SHA512 0524aeafb4777039a35be8854a0cf3bdbefd43eccb758da9aa2fa71fc4041816ff009dbbff20b4906c9bac281995c9923fcf542107a83c76ecb8c45d6b20b1ba WHIRLPOOL 7bddf8c6e90457e16f17dd4375cd66447d585f264837a03daee1ffe1935990108c37ad4c3de1a51ebe34e111953a30460d11f1807fc80d547129ebba100ade0a
diff --git a/sys-fs/udiskie/metadata.xml b/sys-fs/udiskie/metadata.xml
new file mode 100644
index 000000000000..41657ce3215a
--- /dev/null
+++ b/sys-fs/udiskie/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>desktop-misc</herd>
+ <upstream>
+ <remote-id type="pypi">udiskie</remote-id>
+ <remote-id type="github">coldfix/udiskie</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/udiskie/udiskie-0.6.2.ebuild b/sys-fs/udiskie/udiskie-0.6.2.ebuild
new file mode 100644
index 000000000000..3f1d10f2c41e
--- /dev/null
+++ b/sys-fs/udiskie/udiskie-0.6.2.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit distutils-r1 gnome2-utils readme.gentoo
+
+DESCRIPTION="An automatic disk mounting service using udisks"
+HOMEPAGE="http://pypi.python.org/pypi/udiskie http://github.com/coldfix/udiskie"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~arm x86"
+IUSE=""
+
+RDEPEND="dev-python/dbus-python
+ dev-python/notify-python
+ dev-python/pygobject:2
+ dev-python/pyxdg
+ sys-fs/udisks"
+DEPEND="app-text/asciidoc
+ dev-python/setuptools"
+
+DOC_CONTENTS="You have to select which sys-fs/udisks SLOT you want to use:\n
+# emerge --noreplace 'sys-fs/udisks:0' (for UDisks 1.0.4+)\nor\n
+# emerge --noreplace 'sys-fs/udisks:2' (for UDisks 2.0.0+)"
+
+src_prepare() {
+ sed -i -e 's:gtk-update-icon-cache:true:' setup.py || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ distutils-r1_src_compile
+ emake -C doc
+}
+
+src_install() {
+ distutils-r1_src_install
+ doman doc/${PN}.8
+ readme.gentoo_src_install
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ readme.gentoo_pkg_postinst
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-fs/udiskie/udiskie-0.6.4.ebuild b/sys-fs/udiskie/udiskie-0.6.4.ebuild
new file mode 100644
index 000000000000..51ce34607388
--- /dev/null
+++ b/sys-fs/udiskie/udiskie-0.6.4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit distutils-r1 gnome2-utils readme.gentoo
+
+DESCRIPTION="An automatic disk mounting service using udisks"
+HOMEPAGE="http://pypi.python.org/pypi/udiskie http://github.com/coldfix/udiskie"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND="dev-python/dbus-python
+ dev-python/notify-python
+ dev-python/pygobject:2
+ dev-python/pyxdg
+ sys-fs/udisks"
+DEPEND="app-text/asciidoc
+ dev-python/setuptools"
+
+DOC_CONTENTS="You have to select which sys-fs/udisks SLOT you want to use:\n
+# emerge --noreplace 'sys-fs/udisks:0' (for UDisks 1.0.4+)\nor\n
+# emerge --noreplace 'sys-fs/udisks:2' (for UDisks 2.0.0+)"
+
+src_prepare() {
+ sed -i -e 's:gtk-update-icon-cache:true:' setup.py || die
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ distutils-r1_src_compile
+ emake -C doc
+}
+
+src_install() {
+ distutils-r1_src_install
+ doman doc/${PN}.8
+ readme.gentoo_src_install
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ readme.gentoo_pkg_postinst
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-fs/udiskie/udiskie-1.1.1.ebuild b/sys-fs/udiskie/udiskie-1.1.1.ebuild
new file mode 100644
index 000000000000..a060e187671f
--- /dev/null
+++ b/sys-fs/udiskie/udiskie-1.1.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+inherit distutils-r1 gnome2-utils
+
+DESCRIPTION="An automatic disk mounting service using udisks"
+HOMEPAGE="http://pypi.python.org/pypi/udiskie http://github.com/coldfix/udiskie"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND="dev-python/docopt[${PYTHON_USEDEP}]
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/pyxdg[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ sys-fs/udisks:2"
+DEPEND="app-text/asciidoc
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+
+src_prepare() {
+ sed -i \
+ -e "s:udiskie.__version__:2:" \
+ -e 's:gtk-update-icon-cache:true:' \
+ setup.py || die
+
+ distutils-r1_src_prepare
+}
+
+src_compile() {
+ distutils-r1_src_compile
+ emake -C doc
+}
+
+src_install() {
+ distutils-r1_src_install
+ doman doc/${PN}.8
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-fs/udisks-glue/Manifest b/sys-fs/udisks-glue/Manifest
new file mode 100644
index 000000000000..d1df483b0a7a
--- /dev/null
+++ b/sys-fs/udisks-glue/Manifest
@@ -0,0 +1 @@
+DIST udisks-glue-1.3.5.tar.gz 17363 SHA256 308170bb179e53b3cab40a66f628fba5904bccdd53539de8b762cc140da0572f SHA512 a7246a3d1ae72a308e461ebbefd6c64a2c935f4c3354706a49cf94b368f61ea77e578d3d4e9a4ed5596d3e74f5e3df14b14571935451a5e5e79ea6d96c058cb0 WHIRLPOOL 1d4986898662a0bf82d37578caa98981e14107b681c3bca5b1f5afd5660c896c84b162d021e5826c19e51d81be8f1841b0093ae09b75bf04e2a01d9ebc19e418
diff --git a/sys-fs/udisks-glue/metadata.xml b/sys-fs/udisks-glue/metadata.xml
new file mode 100644
index 000000000000..17d23ba46c30
--- /dev/null
+++ b/sys-fs/udisks-glue/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">fernandotcl/udisks-glue</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/udisks-glue/udisks-glue-1.3.5.ebuild b/sys-fs/udisks-glue/udisks-glue-1.3.5.ebuild
new file mode 100644
index 000000000000..984588c4ca0e
--- /dev/null
+++ b/sys-fs/udisks-glue/udisks-glue-1.3.5.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools
+
+DESCRIPTION="A tool to associate udisks events to user-defined actions"
+HOMEPAGE="http://github.com/fernandotcl/udisks-glue"
+SRC_URI="http://github.com/fernandotcl/udisks-glue/tarball/release-${PV} -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+COMMON_DEPEND=">=dev-libs/dbus-glib-0.100.2
+ >=dev-libs/glib-2
+ dev-libs/confuse"
+RDEPEND="${COMMON_DEPEND}
+ >=sys-fs/udisks-1.0.4-r5:0"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+DOCS=( ChangeLog README )
+
+src_unpack() {
+ unpack ${A}
+ mv *-${PN}-* "${S}"
+}
+
+src_prepare() {
+ eautoreconf
+}
diff --git a/sys-fs/udisks/Manifest b/sys-fs/udisks/Manifest
new file mode 100644
index 000000000000..97854d0cc4ae
--- /dev/null
+++ b/sys-fs/udisks/Manifest
@@ -0,0 +1,3 @@
+DIST udisks-1.0.5.tar.gz 736221 SHA256 f2ec82eb0ea7e01dc299b5b29b3c18cdf861236ec43dcff66b3552b4b31c6f71 SHA512 bdf4970113975221ff0e17866db18fd969ff9c8e1e851c8ad7572630814ab0c46b59df59433edcb2e7cc41cc8152afd35807f45e07f6d0fa87b21b5a77d0965a WHIRLPOOL 4698911bf53532b5149a71ab1a031fa836193476114ba26f0cde588c3095661f21492feb855e1eb3aa8f1c87ad8125bdc32b7cf56ac43f2de84073f3085f39eb
+DIST udisks-2.1.4.tar.bz2 901364 SHA256 a4e148dd3a4a209160452a12cfe770382836027002f6c84f2e6c17eb5be519bb SHA512 782e94d27cdacf4178fc7c39ad300168d3280be6cd434f067c6e329efe91544d5bbfe9a2499483e3f4bdce16c55a061be53d9c592943b693441db8f9cfacee12 WHIRLPOOL fbb2487dce06f241112f2ba7dadcd384dd2b448a0f15688381331d01a8f954231f1794d7e26667b30ee6f899ec516dad620082caf4b0292d6a5bc91faf52231d
+DIST udisks-2.1.6.tar.bz2 908987 SHA256 dec5f5c85fa0f74f39336acbfba1770f9988c096be23873714543c304b09f46a SHA512 33badcf87986504cf13926f23f1ac0386d732920918871e5bdbcbd704bfcee17d9d3c5002bbdd497bf88a47f844595ad06fc2049bc805099c052943ba3750770 WHIRLPOOL 798cfae910b4cc85ebbd0b60aa987fda6bc6009fb37bba8ad3644bca497f1bb5dde04d574aab97f323dd4c4ae8dcbbc3de9fa09cbdbee45ff19a0b1fbf22b797
diff --git a/sys-fs/udisks/files/udisks-1.0.2-ntfs-3g.patch b/sys-fs/udisks/files/udisks-1.0.2-ntfs-3g.patch
new file mode 100644
index 000000000000..b6ba4a4849a8
--- /dev/null
+++ b/sys-fs/udisks/files/udisks-1.0.2-ntfs-3g.patch
@@ -0,0 +1,12 @@
+Support ntfs-3g by default without entry in /etc/filesystems for write access.
+
+--- src/device.c
++++ src/device.c
+@@ -5909,6 +5909,7 @@
+ "vfat",
+ "exfat",
+ "ntfs",
++ "ntfs-3g",
+ NULL,
+ };
+ \ No newline at end of file
diff --git a/sys-fs/udisks/files/udisks-1.0.4-revert-floppy.patch b/sys-fs/udisks/files/udisks-1.0.4-revert-floppy.patch
new file mode 100644
index 000000000000..0f13a6aba833
--- /dev/null
+++ b/sys-fs/udisks/files/udisks-1.0.4-revert-floppy.patch
@@ -0,0 +1,18 @@
+This change was done upstream to prevent UDisks1 from polling for floppy drive so often but broke
+mounting floppies while at it.
+
+http://bugs.freedesktop.org/show_bug.cgi?id=30283
+http://bugs.gentoo.org/show_bug.cgi?id=338185
+
+--- src/device.c
++++ src/device.c
+@@ -4485,7 +4485,8 @@ update_info (Device *device)
+ }
+ else
+ {
+- if (g_udev_device_get_property_as_boolean (device->priv->d, "ID_CDROM_MEDIA"))
++ if (g_udev_device_get_property_as_boolean (device->priv->d, "ID_CDROM_MEDIA") ||
++ g_udev_device_get_property_as_boolean (device->priv->d, "ID_DRIVE_FLOPPY"))
+ {
+ media_available = TRUE;
+ }
diff --git a/sys-fs/udisks/files/udisks-1.0.5-stat-includes.patch b/sys-fs/udisks/files/udisks-1.0.5-stat-includes.patch
new file mode 100644
index 000000000000..85ef5208049d
--- /dev/null
+++ b/sys-fs/udisks/files/udisks-1.0.5-stat-includes.patch
@@ -0,0 +1,25 @@
+From 0aa652a7b257f98f9e8e7dc7b0ddc9bc62377d09 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Fri, 29 May 2015 21:09:39 -0400
+Subject: [PATCH] Bug 90778 - fix build with newer glibc versions
+
+https://bugs.freedesktop.org/show_bug.cgi?id=90778
+---
+ src/helpers/job-drive-detach.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/helpers/job-drive-detach.c b/src/helpers/job-drive-detach.c
+index eeafcab..d122a1f 100644
+--- a/src/helpers/job-drive-detach.c
++++ b/src/helpers/job-drive-detach.c
+@@ -18,6 +18,7 @@
+ *
+ */
+
++#include <sys/stat.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
+--
+2.4.2
+
diff --git a/sys-fs/udisks/metadata.xml b/sys-fs/udisks/metadata.xml
new file mode 100644
index 000000000000..f6f88f4bc4b8
--- /dev/null
+++ b/sys-fs/udisks/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>freedesktop</herd>
+ <maintainer>
+ <email>freedesktop-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='cryptsetup'>Enable <pkg>sys-fs/cryptsetup</pkg> support</flag>
+ <flag name='gptfdisk'>Pull in <pkg>sys-apps/gptfdisk</pkg> for sgdisk command as used by partitioning functionality</flag>
+ <flag name='introspection'>Use <pkg>dev-libs/gobject-introspection</pkg> for introspection</flag>
+ <flag name='remote-access'>Control whether connections from other clients over LAN are allowed</flag>
+ <flag name='systemd'>Support <pkg>sys-apps/systemd</pkg>'s logind</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-fs/udisks/udisks-1.0.5-r1.ebuild b/sys-fs/udisks/udisks-1.0.5-r1.ebuild
new file mode 100644
index 000000000000..3b3a43a4457f
--- /dev/null
+++ b/sys-fs/udisks/udisks-1.0.5-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils bash-completion-r1 linux-info udev systemd
+
+DESCRIPTION="Daemon providing interfaces to work with storage devices"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/udisks"
+SRC_URI="http://hal.freedesktop.org/releases/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE="debug nls remote-access selinux"
+
+COMMON_DEPEND=">=dev-libs/dbus-glib-0.100
+ >=dev-libs/glib-2.30
+ >=dev-libs/libatasmart-0.19
+ >=sys-auth/polkit-0.110
+ >=sys-apps/dbus-1.6
+ >=sys-apps/sg3_utils-1.27.20090411
+ >=sys-block/parted-3
+ >=sys-fs/lvm2-2.02.66
+ virtual/libgudev:=
+ virtual/libudev:=
+ virtual/udev
+ selinux? ( sec-policy/selinux-devicekit )"
+# util-linux -> mount, umount, swapon, swapoff (see also #403073)
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/util-linux-2.20.1-r2
+ virtual/eject
+ remote-access? ( net-dns/avahi )"
+DEPEND="${COMMON_DEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ dev-util/intltool
+ virtual/pkgconfig"
+
+QA_MULTILIB_PATHS="usr/lib/${PN}/.*"
+
+pkg_setup() {
+ # Listing only major arch's here to avoid tracking kernel's defconfig
+ if use amd64 || use arm || use ppc || use ppc64 || use x86; then
+ CONFIG_CHECK="~!IDE" #319829
+ CONFIG_CHECK+=" ~NLS_UTF8" #425562
+ kernel_is lt 3 10 && CONFIG_CHECK+=" ~USB_SUSPEND" #331065, #477278
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.0.2-ntfs-3g.patch \
+ "${FILESDIR}"/${PN}-1.0.4-revert-floppy.patch \
+ "${FILESDIR}"/${PN}-1.0.5-stat-includes.patch
+
+ sed -i -e "s:/lib/udev:$(get_udevdir):" data/80-udisks.rules || die
+
+ epatch_user
+}
+
+src_configure() {
+ # device-mapper -> lvm2 -> mandatory depend -> force enabled
+ econf \
+ --libexecdir=/usr/lib/${PN} \
+ --localstatedir="${EPREFIX}"/var \
+ --disable-static \
+ $(use_enable debug verbose-mode) \
+ --enable-man-pages \
+ --disable-gtk-doc \
+ --enable-lvm2 \
+ --enable-dmmp \
+ $(use_enable remote-access) \
+ $(use_enable nls) \
+ --with-html-dir="${EPREFIX}"/deprecated \
+ "$(systemd_with_unitdir)"
+}
+
+src_test() {
+ ewarn "Skipping testsuite because sys-fs/udisks:0 is deprecated"
+ ewarn "in favour of sys-fs/udisks:2."
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ slashsbindir=/usr/sbin \
+ slashlibdir=/usr/lib \
+ udevhelperdir="$(get_udevdir)" \
+ udevrulesdir="$(get_udevdir)"/rules.d \
+ install #398081
+
+ dodoc AUTHORS HACKING NEWS README
+
+ rm -f "${ED}"/etc/profile.d/udisks-bash-completion.sh
+ newbashcomp tools/udisks-bash-completion.sh ${PN}
+
+ prune_libtool_files --all
+
+ keepdir /media
+ keepdir /var/lib/udisks #383091
+
+ rm -rf "${ED}"/deprecated
+}
diff --git a/sys-fs/udisks/udisks-2.1.4.ebuild b/sys-fs/udisks/udisks-2.1.4.ebuild
new file mode 100644
index 000000000000..07988ef711e5
--- /dev/null
+++ b/sys-fs/udisks/udisks-2.1.4.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit bash-completion-r1 eutils linux-info systemd udev
+
+DESCRIPTION="Daemon providing interfaces to work with storage devices"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/udisks"
+SRC_URI="http://udisks.freedesktop.org/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE="debug cryptsetup +gptfdisk +introspection selinux systemd"
+
+COMMON_DEPEND=">=dev-libs/glib-2.36
+ >=dev-libs/libatasmart-0.19
+ >=sys-auth/polkit-0.110
+ virtual/acl
+ virtual/libgudev:=
+ virtual/udev
+ introspection? ( >=dev-libs/gobject-introspection-1.30 )
+ systemd? ( sys-apps/systemd )"
+# gptfdisk -> src/udiskslinuxpartition.c -> sgdisk (see also #412801#c1)
+# util-linux -> mount, umount, swapon, swapoff (see also #403073)
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/util-linux-2.20.1-r2
+ >=sys-block/parted-3
+ virtual/eject
+ cryptsetup? (
+ sys-fs/cryptsetup[udev(+)]
+ sys-fs/lvm2[udev(+)]
+ )
+ gptfdisk? ( >=sys-apps/gptfdisk-0.8 )
+ selinux? ( sec-policy/selinux-devicekit )
+"
+DEPEND="${COMMON_DEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=dev-util/gdbus-codegen-2.32
+ dev-util/intltool
+ >=sys-kernel/linux-headers-3.1
+ virtual/pkgconfig"
+
+QA_MULTILIB_PATHS="usr/lib/udisks2/udisksd"
+
+DOCS="AUTHORS HACKING NEWS README"
+
+pkg_setup() {
+ # Listing only major arch's here to avoid tracking kernel's defconfig
+ if use amd64 || use arm || use ppc || use ppc64 || use x86; then
+ CONFIG_CHECK="~!IDE" #319829
+ CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" #412377
+ CONFIG_CHECK+=" ~SWAP" # http://forums.gentoo.org/viewtopic-t-923640.html
+ CONFIG_CHECK+=" ~NLS_UTF8" #425562
+ kernel_is lt 3 10 && CONFIG_CHECK+=" ~USB_SUSPEND" #331065, #477278
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ use systemd || { sed -i -e 's:libsystemd-login:&disable:' configure || die; }
+
+ epatch_user
+}
+
+src_configure() {
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ --disable-static \
+ $(use_enable debug) \
+ --disable-gtk-doc \
+ $(use_enable introspection) \
+ --with-html-dir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --with-udevdir="$(get_udevdir)" \
+ "$(systemd_with_unitdir)"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+ keepdir /var/lib/udisks2 #383091
+
+ rm -rf "${ED}"/usr/share/bash-completion
+ dobashcomp data/completions/udisksctl
+
+ local htmldir=udisks2
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym /usr/share/doc/${PF}/html/${htmldir} /usr/share/gtk-doc/html/${htmldir}
+ fi
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"/run #415987
+
+ # See pkg_postinst() of >=sys-apps/baselayout-2.1-r1. Keep in sync?
+ if ! grep -qs "^tmpfs.*/run " "${EROOT}"/proc/mounts ; then
+ echo
+ ewarn "You should reboot the system now to get /run mounted with tmpfs!"
+ fi
+}
diff --git a/sys-fs/udisks/udisks-2.1.6.ebuild b/sys-fs/udisks/udisks-2.1.6.ebuild
new file mode 100644
index 000000000000..5fdf05eb31ab
--- /dev/null
+++ b/sys-fs/udisks/udisks-2.1.6.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit bash-completion-r1 eutils linux-info systemd udev
+
+DESCRIPTION="Daemon providing interfaces to work with storage devices"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/udisks"
+SRC_URI="http://udisks.freedesktop.org/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="debug cryptsetup +gptfdisk +introspection selinux systemd"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.36:2
+ >=dev-libs/libatasmart-0.19
+ >=sys-auth/polkit-0.110
+ virtual/acl
+ virtual/libgudev:=
+ virtual/udev
+ introspection? ( >=dev-libs/gobject-introspection-1.30:= )
+ systemd? ( sys-apps/systemd )
+"
+# gptfdisk -> src/udiskslinuxpartition.c -> sgdisk (see also #412801#c1)
+# util-linux -> mount, umount, swapon, swapoff (see also #403073)
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/util-linux-2.20.1-r2
+ >=sys-block/parted-3
+ virtual/eject
+ cryptsetup? (
+ sys-fs/cryptsetup[udev(+)]
+ sys-fs/lvm2[udev(+)]
+ )
+ gptfdisk? ( >=sys-apps/gptfdisk-0.8 )
+ selinux? ( sec-policy/selinux-devicekit )
+"
+DEPEND="${COMMON_DEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ >=dev-util/gdbus-codegen-2.32
+ dev-util/intltool
+ >=sys-kernel/linux-headers-3.1
+ virtual/pkgconfig
+"
+
+QA_MULTILIB_PATHS="usr/lib/udisks2/udisksd"
+
+DOCS="AUTHORS HACKING NEWS README"
+
+pkg_setup() {
+ # Listing only major arch's here to avoid tracking kernel's defconfig
+ if use amd64 || use arm || use ppc || use ppc64 || use x86; then
+ CONFIG_CHECK="~!IDE" #319829
+ CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" #412377
+ CONFIG_CHECK+=" ~SWAP" # http://forums.gentoo.org/viewtopic-t-923640.html
+ CONFIG_CHECK+=" ~NLS_UTF8" #425562
+ kernel_is lt 3 10 && CONFIG_CHECK+=" ~USB_SUSPEND" #331065, #477278
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ use systemd || { sed -i -e 's:libsystemd-login:&disable:' configure || die; }
+
+ epatch_user
+}
+
+src_configure() {
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ --disable-static \
+ $(use_enable debug) \
+ --disable-gtk-doc \
+ $(use_enable introspection) \
+ --with-html-dir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --with-udevdir="$(get_udevdir)" \
+ "$(systemd_with_unitdir)"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+ keepdir /var/lib/udisks2 #383091
+
+ rm -rf "${ED}"/usr/share/bash-completion
+ dobashcomp data/completions/udisksctl
+
+ local htmldir=udisks2
+ if [[ -d ${ED}/usr/share/doc/${PF}/html/${htmldir} ]]; then
+ dosym /usr/share/doc/${PF}/html/${htmldir} /usr/share/gtk-doc/html/${htmldir}
+ fi
+}
+
+pkg_postinst() {
+ mkdir -p "${EROOT}"/run #415987
+
+ # See pkg_postinst() of >=sys-apps/baselayout-2.1-r1. Keep in sync?
+ if ! grep -qs "^tmpfs.*/run " "${EROOT}"/proc/mounts ; then
+ echo
+ ewarn "You should reboot the system now to get /run mounted with tmpfs!"
+ fi
+}
diff --git a/sys-fs/ufsutils/Manifest b/sys-fs/ufsutils/Manifest
new file mode 100644
index 000000000000..31b41db833d2
--- /dev/null
+++ b/sys-fs/ufsutils/Manifest
@@ -0,0 +1,2 @@
+DIST ufsutils_8.2-3.debian.tar.gz 23469 SHA256 6040ad18ddbf9fa37b87b084fe6cf19c50f63456d15b6726067c558f8383b795 SHA512 7bc925e742eaf4e1837ca4b46afa7966490234492eeb40ad8fabf71550a79890f3294780c2dbdf3593a82fc8e0708cf4c72baba81f4fec9a884cfa545c8895c8 WHIRLPOOL eb161eebfa50316283813cf774f701d24bdc718db268e541f564e8a93e7486eb060138c53fa1ed78bcbe3485457a59b6b9e17ca7309743805df864b215606faf
+DIST ufsutils_8.2.orig.tar.gz 463499 SHA256 6298d2a94fb601f6951bf81ce074e6af597e8867ac210d8ff73348aeb3738bd9 SHA512 f378372c2493c16fe8cb3977f4ed2d104e747895e97d7642d21b5e87a2a03ac696bbac093e534e13c2f1dc4638741edcbbb0ddec5abcbfa6b4f7401efbf7cf14 WHIRLPOOL ae944c34162727d37a3ea9ff63876ed75f55830c655b6a15afbf8d29bc4bd362cf76b07e8c2521ea42b1440247c5be3d290c4f310593aa8fa0dc950c2dd65e54
diff --git a/sys-fs/ufsutils/metadata.xml b/sys-fs/ufsutils/metadata.xml
new file mode 100644
index 000000000000..ecedda4aa2cc
--- /dev/null
+++ b/sys-fs/ufsutils/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>bsd</herd>
+</pkgmetadata>
diff --git a/sys-fs/ufsutils/ufsutils-8.2_p3.ebuild b/sys-fs/ufsutils/ufsutils-8.2_p3.ebuild
new file mode 100644
index 000000000000..ede8bde27a2d
--- /dev/null
+++ b/sys-fs/ufsutils/ufsutils-8.2_p3.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="FFS/UFS/UFS2 filesystem utilities from FreeBSD"
+HOMEPAGE="http://packages.debian.org/source/sid/ufsutils"
+
+SRC_URI="mirror://debian/pool/main/u/${PN}/${PN}_${PV%_*}.orig.tar.gz
+ mirror://debian/pool/main/u/${PN}/${PN}_${PV%_*}-${PV##*_p}.debian.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="dev-libs/libbsd
+ dev-libs/libedit
+ sys-libs/ncurses"
+
+S="${WORKDIR}/${P%_*}"
+
+src_prepare() {
+ EPATCH_SOURCE="${WORKDIR}/debian/patches" EPATCH_SUFFIX="patch" \
+ EPATCH_OPTS="-p1" EPATCH_FORCE="yes" epatch
+
+ # growfs is not properly ported
+ sed -e "s:sbin/growfs::" -i Makefile
+
+ sed -e "s:^\(prefix = \)\(.*\):\1${EPREFIX}usr:" \
+ -e "s:^\(libdir = \$(exec_prefix)\/\)\(.*\):\1$(get_libdir):" \
+ -i Makefile.common
+}
+
+src_compile(){
+ emake -j1
+}
+
+src_install() {
+ dodir /usr/$(get_libdir)
+ dodir /usr/sbin
+ dodir /usr/share/man/man8
+ emake DESTDIR="${ED}" install
+}
diff --git a/sys-fs/unionfs-fuse/Manifest b/sys-fs/unionfs-fuse/Manifest
new file mode 100644
index 000000000000..da19ba8ef1f0
--- /dev/null
+++ b/sys-fs/unionfs-fuse/Manifest
@@ -0,0 +1,4 @@
+DIST unionfs-fuse-0.24.tar.bz2 30381 SHA256 d8abc855eb618ac356b1e716599c82f8f0f74dbaee36d4062edc707567121937 SHA512 e0e414f4edbf641ec9d0135a8723e43fc75412359b482f7aedd66fe8245e4df03943c5ecb6f8de4fdbd97f0346033c691e766cc4f4a755f5b43748e1441d3fbd WHIRLPOOL dc132086d9614895961dc8b498c435145b4390fc80331e0575ee8420faea0201325ab2394b9090d8f721c602ef1f93e150573b1b88b77ee4f7be4a262103b986
+DIST unionfs-fuse-0.25.tar.bz2 30674 SHA256 a33f0a8c4ec35108f173a7a96463222534c21b3a50c167a7c868fc5723347e8f
+DIST unionfs-fuse-0.26.tar.xz 38600 SHA256 8d5c9dcb51ecb9a9b03890e16d17e37d602b0c1f23ed6a9ddec2b0f719c9f662 SHA512 07805a2ca90354ed0f8feac3ab0005cc4bba64200172e019f00eb50786776c94a6f976a7c383b17b30373e628838ef94cced510d475d557cafb1a2b309d058f0 WHIRLPOOL e4db99e1eae6ae3bfccaf047411b71642b28a1aeaa5ce922934536fac5034e5941ea6e29299908aa54600b699c1ebc7da6b3601f5acab395b0b08d53a29bd09f
+DIST unionfs-fuse-1.0.tar.gz 48149 SHA256 2ee80bd0634a61adb2159212e155d607a0a82ad659214ae6edb3530396cccc09 SHA512 805151acaeae8526fba430701a1690f6eb0ad8331a9e730095ee538dc2b148d02fe996a63e8a7f6471d1ef622cc5c03d82bd2b2faad1ebe3b614ec343c2f55de WHIRLPOOL 447c8ef93c26f33ba3e8d4ee6bbc48ae545f4cda2e66a832e78ec750ceaa3428546f98cfda8a64eafd78aec2c567e21e1121ef49a2e967b67b23ecf725807449
diff --git a/sys-fs/unionfs-fuse/files/unionfs-fuse-0.23-makefile.patch b/sys-fs/unionfs-fuse/files/unionfs-fuse-0.23-makefile.patch
new file mode 100644
index 000000000000..6f80808dce75
--- /dev/null
+++ b/sys-fs/unionfs-fuse/files/unionfs-fuse-0.23-makefile.patch
@@ -0,0 +1,15 @@
+--- Makefile_BACKUP 2010-01-12 01:26:33.000000000 +0100
++++ Makefile 2010-01-12 01:26:58.000000000 +0100
+@@ -7,10 +7,10 @@
+ LIB = -lfuse -lpthread -lm
+
+ build:
+- make -C src/
++ $(MAKE) -C src/
+
+ clean:
+- make -C src/ clean
++ $(MAKE) -C src/ clean
+
+ install: build
+ cp src/unionfs $(DESTDIR)/sbin/
diff --git a/sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-declare-chroot.patch b/sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-declare-chroot.patch
new file mode 100644
index 000000000000..e436f9f01575
--- /dev/null
+++ b/sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-declare-chroot.patch
@@ -0,0 +1,12 @@
+--- unionfs-fuse-0.26/src/unionfs.c 2012-09-22 22:24:05.090568485 +0200
++++ unionfs-fuse-0.26/src/unionfs.c 2012-09-22 22:24:09.036519156 +0200
+@@ -13,6 +13,9 @@
+ #ifdef linux
+ // For pread()/pwrite()/utimensat()
+ #define _XOPEN_SOURCE 700
++
++ // For chroot
++ #define _BSD_SOURCE
+ #endif
+
+ #include <fuse.h>
diff --git a/sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-link-pthread.patch b/sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-link-pthread.patch
new file mode 100644
index 000000000000..9bed29fe2ed7
--- /dev/null
+++ b/sys-fs/unionfs-fuse/files/unionfs-fuse-0.26-link-pthread.patch
@@ -0,0 +1,11 @@
+--- src/Makefile 2012-09-22 22:14:36.484677038 +0200
++++ src/Makefile 2012-09-22 22:14:40.162631059 +0200
+@@ -5,7 +5,7 @@
+
+ LDFLAGS +=
+
+-LIB = $(shell pkg-config --libs fuse)
++LIB = $(shell pkg-config --libs fuse) -lpthread
+
+ HASHTABLE_OBJ = hashtable.o hashtable_itr.o
+ UNIONFS_OBJ = unionfs.o stats.o opts.o debug.o findbranch.o readdir.o \
diff --git a/sys-fs/unionfs-fuse/metadata.xml b/sys-fs/unionfs-fuse/metadata.xml
new file mode 100644
index 000000000000..c1f58a24c230
--- /dev/null
+++ b/sys-fs/unionfs-fuse/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>sping@gentoo.org</email>
+ <name>Sebastian Pipping</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">rpodgorny/unionfs-fuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/unionfs-fuse/unionfs-fuse-0.24.ebuild b/sys-fs/unionfs-fuse/unionfs-fuse-0.24.ebuild
new file mode 100644
index 000000000000..4c5375e2a111
--- /dev/null
+++ b/sys-fs/unionfs-fuse/unionfs-fuse-0.24.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+DESCRIPTION="Self-syncing tree-merging file system based on FUSE"
+
+HOMEPAGE="http://podgorny.cz/moin/UnionFsFuse"
+SRC_URI="http://podgorny.cz/unionfs-fuse/releases/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ dodir /usr/sbin /usr/share/man/man8/ || die "dodir failed"
+ emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
+}
diff --git a/sys-fs/unionfs-fuse/unionfs-fuse-0.25.ebuild b/sys-fs/unionfs-fuse/unionfs-fuse-0.25.ebuild
new file mode 100644
index 000000000000..33daf1ee9342
--- /dev/null
+++ b/sys-fs/unionfs-fuse/unionfs-fuse-0.25.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+DESCRIPTION="Self-syncing tree-merging file system based on FUSE"
+
+HOMEPAGE="http://podgorny.cz/moin/UnionFsFuse"
+SRC_URI="http://podgorny.cz/unionfs-fuse/releases/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ dodir /usr/sbin /usr/share/man/man8/ || die "dodir failed"
+ emake DESTDIR="${D}" PREFIX="/usr" install || die "emake install failed"
+}
diff --git a/sys-fs/unionfs-fuse/unionfs-fuse-0.26.ebuild b/sys-fs/unionfs-fuse/unionfs-fuse-0.26.ebuild
new file mode 100644
index 000000000000..a1754f10808a
--- /dev/null
+++ b/sys-fs/unionfs-fuse/unionfs-fuse-0.26.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils
+
+DESCRIPTION="Self-syncing tree-merging file system based on FUSE"
+
+HOMEPAGE="http://podgorny.cz/moin/UnionFsFuse"
+SRC_URI="http://podgorny.cz/unionfs-fuse/releases/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x86-linux"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-link-pthread.patch
+ epatch "${FILESDIR}"/${P}-declare-chroot.patch
+}
+
+src_install() {
+ dodir /usr/sbin /usr/share/man/man8/ || die "dodir failed"
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install || die "emake install failed"
+}
diff --git a/sys-fs/unionfs-fuse/unionfs-fuse-1.0.ebuild b/sys-fs/unionfs-fuse/unionfs-fuse-1.0.ebuild
new file mode 100644
index 000000000000..9f852dfd1f89
--- /dev/null
+++ b/sys-fs/unionfs-fuse/unionfs-fuse-1.0.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Self-syncing tree-merging file system based on FUSE"
+
+HOMEPAGE="https://github.com/rpodgorny/unionfs-fuse"
+SRC_URI="https://github.com/rpodgorny/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x86-linux"
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install || die "emake install failed"
+}
diff --git a/sys-fs/unionfs-fuse/unionfs-fuse-9999.ebuild b/sys-fs/unionfs-fuse/unionfs-fuse-9999.ebuild
new file mode 100644
index 000000000000..e94a50ef3729
--- /dev/null
+++ b/sys-fs/unionfs-fuse/unionfs-fuse-9999.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit git-r3
+
+DESCRIPTION="Self-syncing tree-merging file system based on FUSE"
+
+HOMEPAGE="https://github.com/rpodgorny/unionfs-fuse"
+EGIT_REPO_URI="https://github.com/rpodgorny/unionfs-fuse.git"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+DEPEND="sys-fs/fuse"
+RDEPEND="${DEPEND}"
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install || die "emake install failed"
+}
diff --git a/sys-fs/vhba/Manifest b/sys-fs/vhba/Manifest
new file mode 100644
index 000000000000..b69d202047bf
--- /dev/null
+++ b/sys-fs/vhba/Manifest
@@ -0,0 +1,2 @@
+DIST vhba-module-20130607.tar.bz2 15528 SHA256 d2c4919d2904a8f880e2730250f7ed6e3143575d5c4de6b88a97c2228aa2a185 SHA512 7ac359a3a20920a3baac81d1dd941f4ea04d77cffaf4bc63dc2d9b9d0f80883be82c00a911ab17b9b0da3719bd10f6bc392edd00f9342a332da5c5f036dfc4d7 WHIRLPOOL 85623ce6ae303ebf55512410f10c9f0b524f298104bf9305ce403516c8c12897eb253ab8163da6137c16e719d1abee4206b1864b8a73e9fd58bc95a6621d211e
+DIST vhba-module-20140928.tar.bz2 15571 SHA256 45f56e4972b5aa7175903307901ca42d29da6fc8f92ab4c47007f53bc5bb55a2 SHA512 efa61b2ac44a015582f99affa4c26e4b6ccdd1506a7f14626c08833c4ffff300d128dd4e9040d83d5a51064b0bc9f95397c3cdfec7197c53c3d6f1a97953f779 WHIRLPOOL 4b96bb5010b8ab892db09f7e8f36fc67107533dd4d6beea6d5b89e6076c44ee969bee5d3b646b4ca5b1f0f6af446096fd892ab0970b8d6893fe4730f3eb18c07
diff --git a/sys-fs/vhba/metadata.xml b/sys-fs/vhba/metadata.xml
new file mode 100644
index 000000000000..e56b6a0cf661
--- /dev/null
+++ b/sys-fs/vhba/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>tetromino@gentoo.org</email>
+ <name>Alexandre Rostovtsev</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">cdemu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/vhba/vhba-20130607.ebuild b/sys-fs/vhba/vhba-20130607.ebuild
new file mode 100644
index 000000000000..057915718310
--- /dev/null
+++ b/sys-fs/vhba/vhba-20130607.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit linux-mod user udev
+
+MY_P=vhba-module-${PV}
+DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite"
+HOMEPAGE="http://cdemu.org"
+SRC_URI="mirror://sourceforge/cdemu/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 ~hppa x86"
+IUSE=""
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+MODULE_NAMES="vhba(block:${S})"
+BUILD_TARGETS=modules
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG"
+ check_extra_config
+ BUILD_PARAMS="KDIR=${KV_OUT_DIR}"
+ linux-mod_pkg_setup
+
+ enewgroup cdemu
+}
+
+src_prepare() {
+ # Avoid "make jobserver unavailable" warning and -Werror problems
+ sed -e '/ccflags/s/-Werror$/-Wall/' \
+ -i Makefile || die "sed failed"
+}
+
+src_install() {
+ dodoc AUTHORS ChangeLog README
+ linux-mod_src_install
+
+ einfo "Generating udev rules ..."
+ dodir "$(get_udevdir)"/rules.d
+ cat > "${D}/$(get_udevdir)"/rules.d/70-vhba.rules <<-EOF || die
+ # do not edit this file, it will be overwritten on update
+ #
+ KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu"
+ EOF
+}
+
+pkg_postinst() {
+ elog "Don't forget to add your user to the cdemu group if you want to"
+ elog "be able to use virtual cdemu devices."
+
+ # Older versions of vhba installed their rule file in /etc/udev/rules.d,
+ # which overrides rules in /lib/udev/rules.d. We remove the old file
+ # automatically if it is identical to the default one installed by
+ # vhba-1.2.1 or 20101015-r1. Note that the comment at the top of the rules
+ # file states that it can be automatically overwritten by the system.
+ old_rules="${ROOT}etc/udev/rules.d/70-vhba.rules"
+ if [[ -f "${old_rules}" ]]; then
+ case "$(md5sum ${old_rules})" in
+ 2959b3cf61cfe6e466cc3516a7bc19de* | 1e7a7e5d6d28c811eeec98ec26ed5d28* )
+ elog
+ elog "Removing old ${old_rules} ..."
+ rm -f "${old_rules}" ||
+ eerror "Failed, please remove ${old_rules} manually."
+ ;;
+ * )
+ ewarn
+ ewarn "The ${old_rules} file from a previous"
+ ewarn "installation of ${PN} is overriding ${P}'s"
+ ewarn "udev rules. Unless you had deliberately customized it,"
+ ewarn "you should remove it."
+ ewarn
+ ;;
+ esac
+ fi
+
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/vhba/vhba-20140928.ebuild b/sys-fs/vhba/vhba-20140928.ebuild
new file mode 100644
index 000000000000..871c2b1185d6
--- /dev/null
+++ b/sys-fs/vhba/vhba-20140928.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit linux-mod user udev
+
+MY_P=vhba-module-${PV}
+DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite"
+HOMEPAGE="http://cdemu.org"
+SRC_URI="mirror://sourceforge/cdemu/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="amd64 ~hppa x86"
+IUSE=""
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+MODULE_NAMES="vhba(block:${S})"
+BUILD_TARGETS=modules
+
+pkg_setup() {
+ CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG"
+ check_extra_config
+ BUILD_PARAMS="KDIR=${KV_OUT_DIR}"
+ linux-mod_pkg_setup
+
+ enewgroup cdemu
+}
+
+src_prepare() {
+ # Avoid "make jobserver unavailable" warning and -Werror problems
+ sed -e '/ccflags/s/-Werror$/-Wall/' \
+ -i Makefile || die "sed failed"
+}
+
+src_install() {
+ dodoc AUTHORS ChangeLog README
+ linux-mod_src_install
+
+ einfo "Generating udev rules ..."
+ dodir "$(get_udevdir)"/rules.d
+ cat > "${D}/$(get_udevdir)"/rules.d/70-vhba.rules <<-EOF || die
+ # do not edit this file, it will be overwritten on update
+ #
+ KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu"
+ EOF
+}
+
+pkg_postinst() {
+ elog "Don't forget to add your user to the cdemu group if you want to"
+ elog "be able to use virtual cdemu devices."
+
+ # Older versions of vhba installed their rule file in /etc/udev/rules.d,
+ # which overrides rules in /lib/udev/rules.d. We remove the old file
+ # automatically if it is identical to the default one installed by
+ # vhba-1.2.1 or 20101015-r1. Note that the comment at the top of the rules
+ # file states that it can be automatically overwritten by the system.
+ old_rules="${ROOT}etc/udev/rules.d/70-vhba.rules"
+ if [[ -f "${old_rules}" ]]; then
+ case "$(md5sum ${old_rules})" in
+ 2959b3cf61cfe6e466cc3516a7bc19de* | 1e7a7e5d6d28c811eeec98ec26ed5d28* )
+ elog
+ elog "Removing old ${old_rules} ..."
+ rm -f "${old_rules}" ||
+ eerror "Failed, please remove ${old_rules} manually."
+ ;;
+ * )
+ ewarn
+ ewarn "The ${old_rules} file from a previous"
+ ewarn "installation of ${PN} is overriding ${P}'s"
+ ewarn "udev rules. Unless you had deliberately customized it,"
+ ewarn "you should remove it."
+ ewarn
+ ;;
+ esac
+ fi
+
+ linux-mod_pkg_postinst
+}
diff --git a/sys-fs/vzquota/Manifest b/sys-fs/vzquota/Manifest
new file mode 100644
index 000000000000..1d57fa7ad025
--- /dev/null
+++ b/sys-fs/vzquota/Manifest
@@ -0,0 +1 @@
+DIST vzquota-3.1.tar.bz2 46848 SHA256 749a2d1b2659fdcd5d43b299ad9152bbf029e1889a3c5cf8fe941c0b156fc4a3 SHA512 e2289df9235149c8d511a6b2846f672574622fb39ca5cd8f5780af9a4cc204ce12f1a2ecd0382143c04eca93e64ce6851caab0782e8ad178352954ca599ffaac WHIRLPOOL c9a2e4a604a3520fbc66191b2e357170bb1a5bc7e4bf1eb4bf265381deb701493cb2aeb3c941a6d26036772bf2e4fcec1c01d7497ee01436f2fe07e2ef8eddd6
diff --git a/sys-fs/vzquota/metadata.xml b/sys-fs/vzquota/metadata.xml
new file mode 100644
index 000000000000..1aecc7ea300a
--- /dev/null
+++ b/sys-fs/vzquota/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>pva@gentoo.org</email>
+<name>Peter Volkov</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-fs/vzquota/vzquota-3.1.ebuild b/sys-fs/vzquota/vzquota-3.1.ebuild
new file mode 100644
index 000000000000..defd5971055c
--- /dev/null
+++ b/sys-fs/vzquota/vzquota-3.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="OpenVZ VPS disk quota utility"
+HOMEPAGE="http://openvz.org/download/utils/vzquota/"
+SRC_URI="http://download.openvz.org/utils/${PN}/${PV}/src/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ia64 ~ppc64 ~sparc x86"
+IUSE=""
+
+src_prepare() {
+ sed -e 's,$(INSTALL) -s -m,$(INSTALL) -m,' \
+ -e 's:$(CC) $(CFLAGS) -o:$(CC) $(CFLAGS) $(LDFLAGS) -o:' \
+ -e 's:-Werror ::' \
+ -i "${S}/src/Makefile" || die 'sed on src/Makefile failed'
+ tc-export CC
+}
+
+src_install() {
+ emake DESTDIR="${ED}" INSTALL="${EPREFIX}/usr/bin/install" install
+ keepdir /var/vzquota
+ # remove accidentally created man8 dir
+ rm -r "${ED}/man8" || die 'remove man8 directory failed'
+}
diff --git a/sys-fs/wpflash/Manifest b/sys-fs/wpflash/Manifest
new file mode 100644
index 000000000000..29c73699c674
--- /dev/null
+++ b/sys-fs/wpflash/Manifest
@@ -0,0 +1 @@
+DIST wpflash.c 25813 RMD160 6398cc7aa9530d8922ac4715fe6ae21a23c2631b SHA1 1ef76d31dc45bfc11a0da48e8baaa84499d70bb3 SHA256 9c2158b14a77ba2baf9e0a136288367f402c60366084288615a459566a046ee3
diff --git a/sys-fs/wpflash/files/wpflash-gentoo.patch b/sys-fs/wpflash/files/wpflash-gentoo.patch
new file mode 100644
index 000000000000..8706b9ceec36
--- /dev/null
+++ b/sys-fs/wpflash/files/wpflash-gentoo.patch
@@ -0,0 +1,223 @@
+--- wpflash.c
++++ wpflash.c
+@@ -5,6 +5,9 @@
+ #include <termios.h>
+ #include <linux/ppdev.h>
+ #include <sys/ioctl.h>
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
+
+ int do_write(int, void *, int);
+ int do_read(int, void *, int);
+@@ -74,6 +77,13 @@ struct partition_table {
+ struct partition modified;
+ struct partition *find_partition(char *);
+
++void usage();
++void bad_partition(char *name);
++int erase_sector(int addr);
++int read_object(char *filename, char *memory, int rom_size);
++int read_raw(char *filename, char *memory, int rom_size);
++int write_flash(int addr, char *buffer, int length);
++int read_flash(int addr, char *buffer, int length);
+
+ /* This structure defines the sectors
+ on the FLASH */
+@@ -199,7 +209,8 @@ find_partition(char *name)
+ return fixup_partition(partition);
+ partition++;
+ }
+- bad_partition();
++ bad_partition(name);
++ return NULL;
+ }
+
+ /* Initialize a "cmd" structure */
+@@ -224,6 +235,7 @@ set_cmd(struct cmd *cmd, char type, int
+ waiting for "CONTROL-A" to signal it should jump
+ to the programming code */
+
++void
+ wait_boot_prompt()
+ {
+ char line[256], *s;
+@@ -236,7 +248,7 @@ wait_boot_prompt()
+ else if (*s == '\n') {
+ *s = 0;
+ if (strcmp(line, "Enter CTRL-A to enter programmer.") == 0)
+- return 1;
++ return;
+ s = line;
+ } else {
+ s++;
+@@ -246,6 +258,7 @@ wait_boot_prompt()
+
+ /* Erase a partition */
+
++int
+ erase_partition(char *name) {
+
+ struct partition *partition = find_partition(name);
+@@ -328,16 +341,18 @@ erase_partition(char *name) {
+ }
+ }
+ printf("done.\n");
++
++ return 0;
+ }
+
+ /* Program a partition */
+
+
++int
+ program_partition(char *name, char *filename, int hexdump)
+ {
+ struct partition *partition = find_partition(name);
+ int addr, maxaddr, maxpgm, addrincr, startaddr;
+- int i;
+
+ /* Load data to be programmed in either hex or binary
+ format */
+@@ -384,6 +399,7 @@ program_partition(char *name, char *file
+
+ /* Read a partition */
+
++int
+ read_partition(char *name, char *filename)
+ {
+ struct partition *partition = find_partition(name);
+@@ -421,13 +437,17 @@ read_partition(char *name, char *filenam
+ return(0);
+ }
+
++int pp_open();
++int hello();
++int initialize();
++int device_id(int *deviceID1, int *deviceID2);
++int device_id_v0(int *deviceID1, int *deviceID2);
++int double_wide();
++int parse_flash_params(char *filename);
++
++int
+ main(int argc, char **argv) {
+- struct termios termios;
+- char c;
+- int i;
+- int cpid;
+- int count;
+- int maxcount;
++ struct termios termios;
+ int version;
+ int deviceID1, deviceID2;
+ struct flash_chip *f;
+@@ -607,6 +627,8 @@ main(int argc, char **argv) {
+ /* If we got to here, an invalid operation was specified */
+
+ usage();
++
++ return 0;
+ }
+
+ /* Reads a block of data from the flash.
+@@ -632,7 +654,7 @@ read_flash(int addr, char *buffer, int l
+ for (count = 0; count < length + 1; count = count + readl) {
+ readl = do_read(sfd, buffer+count, length+1-count);
+ if (readl == 0)
+- exit;
++ exit(0);
+ }
+
+ /* Check checksum at end of data */
+@@ -662,7 +684,6 @@ write_flash(int addr, char *buffer, int
+ struct cmd cmd;
+ int count;
+ int checksum;
+- int readl;
+ char checksumbuf[1];
+
+ /* Build and send "W" command to programmer.
+@@ -705,6 +726,7 @@ write_flash(int addr, char *buffer, int
+
+ /* Send initialize command */
+
++int
+ initialize() {
+ struct cmd cmd;
+ char checksumbuf[1];
+@@ -770,6 +792,7 @@ int device_id_v0(int *deviceID1, int *de
+ Note supported on Version 0 programmers. */
+
+
++int
+ double_wide() {
+ struct cmd cmd;
+ char checksumbuf[1];
+@@ -835,6 +858,7 @@ hello() {
+
+ /* Send erase (whole flash) command */
+
++int
+ erase() {
+ struct cmd cmd;
+ char checksumbuf[1];
+@@ -857,6 +881,7 @@ erase() {
+
+ /* Send erase sector command */
+
++int
+ erase_sector(int addr) {
+ struct cmd cmd;
+ char checksumbuf[1];
+@@ -900,7 +925,7 @@ hex(char c) {
+
+ int parse_line(char *buffer, char *mem, int rom_size, int *max_mem) {
+ char *c = buffer;
+- unsigned int address, word_addr;
++ unsigned int address;
+ unsigned int length,type;
+ unsigned int checksum = 0;
+ int count = 0;
+@@ -1020,10 +1045,7 @@ int
+ read_raw(char *filename, char *memory, int rom_size)
+ {
+ FILE *f;
+- char line[80];
+- int lines_read = 0;
+ int count = 0;
+- int bytes ;
+ static int max_mem;
+
+ max_mem = 0;
+@@ -1042,7 +1064,7 @@ read_raw(char *filename, char *memory, i
+ exit(1);
+ }
+
+- while (count = fread(memory, 1, 1024, f)) {
++ while ((count = fread(memory, 1, 1024, f))) {
+ memory += count;
+ max_mem += count;
+ }
+@@ -1053,12 +1075,13 @@ read_raw(char *filename, char *memory, i
+ return max_mem; //return highest memory address used
+ }
+
+-bad_partition(char *name)
++void bad_partition(char *name)
+ {
+ fprintf(stderr, "Unknown partition: %s\n\n", name);
+ usage();
+ }
+
++void
+ usage() {
+ struct partition *partition = partition_table;
+
+@@ -1077,6 +1100,7 @@ usage() {
+ exit(1);
+ }
+
++void
+ pp_write(int fd, char value)
+ {
+ u_char d = value;
diff --git a/sys-fs/wpflash/metadata.xml b/sys-fs/wpflash/metadata.xml
new file mode 100644
index 000000000000..5454528f2093
--- /dev/null
+++ b/sys-fs/wpflash/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>arm</herd>
+</pkgmetadata>
diff --git a/sys-fs/wpflash/wpflash-0.ebuild b/sys-fs/wpflash/wpflash-0.ebuild
new file mode 100644
index 000000000000..c4c1daa08c77
--- /dev/null
+++ b/sys-fs/wpflash/wpflash-0.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="flash the firmware on a Webpal"
+HOMEPAGE="http://webpal.bigbrd.com/"
+SRC_URI="http://webpal.bigbrd.com/wpflash.c"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${DISTDIR}"/${A} "${WORKDIR}"/ || die
+ epatch "${FILESDIR}"/${PN}-gentoo.patch
+}
+
+src_compile() {
+ emake wpflash || die
+}
+
+src_install() {
+ dosbin wpflash || die
+}
diff --git a/sys-fs/xfsdump/Manifest b/sys-fs/xfsdump/Manifest
new file mode 100644
index 000000000000..bb29e7e1284d
--- /dev/null
+++ b/sys-fs/xfsdump/Manifest
@@ -0,0 +1,4 @@
+DIST xfsdump-3.0.6.tar.gz 789635 SHA256 d6aa8040f7fe7c4dcb41190b7530c36177b084134e92a2c01e309ff4c18a1829 SHA512 2dbb255575f83e144e54d024ad46e8246fa24b20aad2c67052b66a9879ddda3b49546ec5daaa8eb9cf44f5293a313814a131faf49f6a1e76aca435da3da3d5bf WHIRLPOOL 5ff53fcba183cbf9f27631241e5065e0ee6e6ca19bba6f881698238df1a03ba0fc6b7a6084403a87cc7a7962f21611f404e8598a945c7f32eb57d40abe49abbc
+DIST xfsdump-3.1.2.tar.gz 831511 SHA256 dc3065b9aeb00de078b8a54ae3f46c71d43d4c4ad4c69ec77343182e881fa4d8 SHA512 23a295ec17002284852f83583a9a66600f2c94742f9c0372db6193e38a53142f71ab3c46fb6d48f0caa9a2737712e217c9adf798edfbd172403d6c372fc63b02 WHIRLPOOL 4854f65496a47a96b5bd00353e31ae816a3898d5aef314b0e16b148da291acf2b123ae4182c8e4791b992bc83a9d32d40d6874b69920d36953935a473c425bef
+DIST xfsdump-3.1.3.tar.gz 826922 SHA256 f02138a5d96e06c506ac8cb6e4fedeb0bf7d7cf8b9747f262d0735b885dbf8fa SHA512 18f5ce7e249b317247012246fd7c5980f62cc46a5718adc80a3137be4f2d7c47edd7d1286e31fbae9c0629a49fc13482308e37950c5122165929088e467865b9 WHIRLPOOL cb80202e16c14ac279ffc698acf1ad3b1fe7365a451d05bba5ec5410b6cdcaf06f7f1986f374130cc40d0a43ccb0eedb2ed433a3e41c6701e9c94c247d821207
+DIST xfsdump-3.1.4.tar.gz 848188 SHA256 570eafd0721515bdd79cb0e295b701d49cdf81e71a0a0ff0df6d4c5cc1960943 SHA512 e82885ad6b3f1d81c1cdeff56714b73651e1c74eb4ce71574875ec0bb69b3fe707b40f85f0766b21ba589d13364ecfc0bad657a9b15c428cf821f926c3d66b25 WHIRLPOOL 5677000929f260b391743207a865c7529b788db46806a62c62bb6917025194913609cc804ead23314988f44853abc57f3c86ee22d2bde365697a35b0a7e3b607
diff --git a/sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch b/sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch
new file mode 100644
index 000000000000..014ca33d2154
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch
@@ -0,0 +1,22 @@
+http://bugs.gentoo.org/311881
+
+--- xfsdump-3.0.4/dump/Makefile
++++ xfsdump-3.0.4/dump/Makefile
+@@ -102,7 +102,6 @@
+ $(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
+ $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_ROOT_SBIN_DIR)
+ $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
+- $(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
+ install-dev:
+
+ $(COMMINCL) $(COMMON):
+--- xfsdump-3.0.4/restore/Makefile
++++ xfsdump-3.0.4/restore/Makefile
+@@ -114,7 +114,6 @@
+ $(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
+ $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_ROOT_SBIN_DIR)
+ $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
+- $(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
+ install-dev:
+
+ $(COMMINCL) $(COMMON):
diff --git a/sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch b/sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch
new file mode 100644
index 000000000000..053615c8dca4
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch
@@ -0,0 +1,14 @@
+http://oss.sgi.com/bugzilla/show_bug.cgi?id=876
+https://bugs.gentoo.org/335115
+
+--- dump/content.c
++++ dump/content.c
+@@ -6460,7 +6460,7 @@
+ Media_prompt_erase( drive_t *drivep )
+ {
+ fold_t fold;
+- char question[ 100 ];
++ char question[ 200 ];
+ char *preamblestr[ PREAMBLEMAX ];
+ size_t preamblecnt;
+ char *querystr[ QUERYMAX ];
diff --git a/sys-fs/xfsdump/files/xfsdump-3.0.6-path-overflow.patch b/sys-fs/xfsdump/files/xfsdump-3.0.6-path-overflow.patch
new file mode 100644
index 000000000000..a6d9f6b82233
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.0.6-path-overflow.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/370949
+
+From 435bad87388821684bb3cd2a33c42787cf970017 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 6 Nov 2011 00:44:57 -0400
+Subject: [PATCH] path: fix 1 byte overflow with empty lists
+
+If pap->pa_cnt is 0, then the local buffer is allocated as 1 byte,
+but the code then writes two bytes to it '/' and '\0'.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ common/path.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/common/path.c b/common/path.c
+index 66320de..ca24f6a 100644
+--- a/common/path.c
++++ b/common/path.c
+@@ -285,6 +285,8 @@ pa_gen( pa_t *pap )
+ for ( i = 0 ; i < pap->pa_cnt ; i++ ) {
+ sz += strlen( pap->pa_array[ i ] ) + 1;
+ }
++ if ( i == 0 )
++ sz++;
+ sz++;
+
+ retp = ( char * )malloc( sz );
+--
+1.7.6.1
+
diff --git a/sys-fs/xfsdump/metadata.xml b/sys-fs/xfsdump/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/xfsdump/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/xfsdump/xfsdump-3.0.6.ebuild b/sys-fs/xfsdump/xfsdump-3.0.6.ebuild
new file mode 100644
index 000000000000..4f3c2e86c2f8
--- /dev/null
+++ b/sys-fs/xfsdump/xfsdump-3.0.6.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit multilib eutils
+
+DESCRIPTION="xfs dump/restore utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 -sparc x86"
+IUSE=""
+
+RDEPEND="sys-fs/e2fsprogs
+ !<sys-fs/xfsprogs-3
+ sys-apps/dmapi
+ >=sys-apps/attr-2.4.19"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+ epatch "${FILESDIR}"/${PN}-3.0.5-prompt-overflow.patch #335115
+ epatch "${FILESDIR}"/${PN}-3.0.4-no-symlink.patch #311881
+ epatch "${FILESDIR}"/${PN}-3.0.6-path-overflow.patch #370949
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libdir=/$(get_libdir) \
+ --libexecdir=/usr/$(get_libdir) \
+ --sbindir=/sbin
+}
+
+src_install() {
+ emake DIST_ROOT="${D}" install || die
+ prepalldocs
+}
diff --git a/sys-fs/xfsdump/xfsdump-3.1.2.ebuild b/sys-fs/xfsdump/xfsdump-3.1.2.ebuild
new file mode 100644
index 000000000000..e196a818eb1e
--- /dev/null
+++ b/sys-fs/xfsdump/xfsdump-3.1.2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib eutils
+
+DESCRIPTION="xfs dump/restore utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 -sparc x86"
+IUSE=""
+
+RDEPEND="sys-fs/e2fsprogs
+ !<sys-fs/xfsprogs-3
+ sys-apps/dmapi
+ >=sys-apps/attr-2.4.19"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+ epatch "${FILESDIR}"/${PN}-3.0.5-prompt-overflow.patch #335115
+ epatch "${FILESDIR}"/${PN}-3.0.4-no-symlink.patch #311881
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libdir=/$(get_libdir) \
+ --libexecdir=/usr/$(get_libdir) \
+ --sbindir=/sbin
+}
diff --git a/sys-fs/xfsdump/xfsdump-3.1.3.ebuild b/sys-fs/xfsdump/xfsdump-3.1.3.ebuild
new file mode 100644
index 000000000000..b242a9e90635
--- /dev/null
+++ b/sys-fs/xfsdump/xfsdump-3.1.3.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib eutils
+
+DESCRIPTION="xfs dump/restore utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 -sparc x86"
+IUSE=""
+
+RDEPEND="sys-fs/e2fsprogs
+ !<sys-fs/xfsprogs-3
+ sys-apps/dmapi
+ >=sys-apps/attr-2.4.19"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+ epatch "${FILESDIR}"/${PN}-3.0.5-prompt-overflow.patch #335115
+ epatch "${FILESDIR}"/${PN}-3.0.4-no-symlink.patch #311881
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libdir=/$(get_libdir) \
+ --libexecdir=/usr/$(get_libdir) \
+ --sbindir=/sbin
+}
diff --git a/sys-fs/xfsdump/xfsdump-3.1.4.ebuild b/sys-fs/xfsdump/xfsdump-3.1.4.ebuild
new file mode 100644
index 000000000000..ffb1a5458d61
--- /dev/null
+++ b/sys-fs/xfsdump/xfsdump-3.1.4.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib eutils
+
+DESCRIPTION="xfs dump/restore utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 -sparc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/e2fsprogs
+ >=sys-fs/xfsprogs-3.2.0
+ sys-apps/dmapi
+ >=sys-apps/attr-2.4.19"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+ epatch "${FILESDIR}"/${PN}-3.0.5-prompt-overflow.patch #335115
+ epatch "${FILESDIR}"/${PN}-3.0.4-no-symlink.patch #311881
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libdir=/$(get_libdir) \
+ --libexecdir=/usr/$(get_libdir) \
+ --sbindir=/sbin
+}
diff --git a/sys-fs/xfsprogs/Manifest b/sys-fs/xfsprogs/Manifest
new file mode 100644
index 000000000000..120b49ff8ef0
--- /dev/null
+++ b/sys-fs/xfsprogs/Manifest
@@ -0,0 +1,5 @@
+DIST xfsprogs-3.1.10.tar.gz 1375721 SHA256 9ec8dc77bf3bc114c3ba89f87316a32e3097efb3e7fc44df23421614bb21aa6c SHA512 c5ff72978e13fc74e4b0e5294d2a7e2efffda088051cd39c7f71629bbc5f9f4c694c4aff6b50e57d60d3bd0c15a90ddd18afc3697336cd8d2429939cc82554bb WHIRLPOOL 9c0f9b36de3314e8add80a20a227ec36cd582cf4f98eafaf55ad5fe14521eceaf9d202c9ac46968f73ce1c97233cbec45d8c421127ff31819f72bf0f9f18276a
+DIST xfsprogs-3.1.11.tar.gz 1399833 SHA256 adf4980177b5c890c1ca86b9c0e3e4d69a3f95bfc01746844280c2393cf4d6be SHA512 6de16f0904709e53e6ceea8239e23b7e109375733fd712fd97bfbbf74ec7f1376147e61d1fbe498f1d5be2148bf8ca233c0577d5b88e9201bfd4bb87e696c28a WHIRLPOOL d52f177d172940e46c813575459917d73042739629f83537932eff38b28a524956484ad6ebbbd2d5d698f1a4b60c1a0f127ca1dd22bba86dcd74c5b94bf51962
+DIST xfsprogs-3.2.2.tar.gz 1477667 SHA256 1a525ce21dc39d4ad3d775fa3c12c2dd4fb7a85e1e05ddd4530dcf773ed65fab SHA512 6316ce6da87bc3d70c1a887b7c5558b594fa6960105d6a51ad0e8072d5533444f69da174f370907738a15bd50f785f715f71947de916940daf0df2845f4a700e WHIRLPOOL a3e1d57e3dd77f91361ff710306a5579a5d99204849291d6730f672e65febe18a5957646cfcda60d02684a24333dca45f742637256b423a7756d4f28556594cf
+DIST xfsprogs-3.2.3.tar.gz 1479757 SHA256 7a5124a880997939551b519610a2e54bd4cd0b0adfd563ce3f4de30827109ac9 SHA512 8f0a95624ccbc71aa6911b62ee5a1cfc56795a581eb746e1bbef8a6385633d9dc15c913a4fd73b1e46c54820a3d36914045e603ef18c506666442b8a2def0a3b WHIRLPOOL af4950cd719717e023756028cf73b0a2e7ae738dab184bedd81a81d82431baa67915dc0d6b58bdc7afc1450156d3a64078bb0b70583fa07b8cc3b02ad96dd2ce
+DIST xfsprogs-3.2.4.tar.gz 1482424 SHA256 dde65ead82d3cbfa9b4ded9796b6d22095d7d759a22d41ae6f1a4ec458bb0465 SHA512 fb1ea5beb933b86970cac198fa4e296457f0f5b30bd72fda54452644730277929dee28f11f35a154910e4a19857455ecffdd21b3df456023e0da95e2fd0aa0eb WHIRLPOOL dec87905b5a5af053e71e88f1670470c00b94a758dbb77773adbc601db61b4efaaba306f344a4334b11680973d5153fcc7f8b5d59c4698f21d654570e8355fe9
diff --git a/sys-fs/xfsprogs/files/xfsprogs-3.1.10-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-3.1.10-sharedlibs.patch
new file mode 100644
index 000000000000..5c07a1b5d706
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-3.1.10-sharedlibs.patch
@@ -0,0 +1,120 @@
+ripped from PLD Linux
+
+--- xfsprogs-3.1.2/libdisk/Makefile
++++ xfsprogs-3.1.2/libdisk/Makefile
+@@ -25,8 +25,10 @@
+ include $(BUILDRULES)
+
+ install: default
++ $(INSTALL_LTLIB)
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: install-dev
+
+--- xfsprogs-3.1.2/libxcmd/Makefile
++++ xfsprogs-3.1.2/libxcmd/Makefile
+@@ -32,6 +32,12 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++ $(INSTALL_LTLIB)
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .dep
+--- xfsprogs-3.1.2/libxfs/Makefile
++++ xfsprogs-3.1.2/libxfs/Makefile
+@@ -41,7 +41,9 @@
+ include $(BUILDRULES)
+
+ install: default
++ $(INSTALL_LTLIB_ROOT)
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: default
+--- xfsprogs-3.1.2/libxlog/Makefile
++++ xfsprogs-3.1.2/libxlog/Makefile
+@@ -12,6 +12,8 @@
+
+ CFILES = xfs_log_recover.c util.c
+
++LTLIBS = $(LIBUUID) $(LIBXFS)
++
+ # don't want to link xfs_repair with a debug libxlog.
+ DEBUG = -DNDEBUG
+
+@@ -19,6 +21,12 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++ $(INSTALL_LTLIB_ROOT)
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .dep
+--- xfsprogs-3.1.2/Makefile
++++ xfsprogs-3.1.2/Makefile
+@@ -66,6 +66,8 @@
+ mkfs: libxfs
+ quota: libxcmd
+ repair: libxfs libxlog
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifneq ($(ENABLE_BLKID), yes)
+ mkfs: libdisk
+--- xfsprogs-3.1.2/include/buildmacros
++++ xfsprogs-3.1.2/include/buildmacros
+@@ -56,11 +56,13 @@
+ endif
+
+ ifeq ($(ENABLE_SHARED),yes)
+-INSTALL_LTLIB = \
++_INSTALL_LTLIB = set -e; \
+ cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -m 755 -T so_dot_version $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_ROOT_LIB_DIR)
++ ../$(INSTALL) -m 755 -d $(1); \
++ ../$(INSTALL) -m 755 -T so_dot_version $(LIBNAME).lai $(1); \
++ ../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(1)
++INSTALL_LTLIB_ROOT = $(call _INSTALL_LTLIB,$(PKG_ROOT_LIB_DIR))
++INSTALL_LTLIB = $(call _INSTALL_LTLIB,$(PKG_LIB_DIR))
+ endif
+
+ # Libtool thinks the static and shared libs should be in the same dir, so
+@@ -71,17 +71,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if test "x$(PKG_LIB_DIR)" != "x$(PKG_ROOT_LIB_DIR)" ; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
diff --git a/sys-fs/xfsprogs/files/xfsprogs-3.1.11-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-3.1.11-sharedlibs.patch
new file mode 100644
index 000000000000..38599bd651fa
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-3.1.11-sharedlibs.patch
@@ -0,0 +1,106 @@
+use libtool to do all installing. do not use the manual file install as
+that'll copy files directly from the .libs/ subdir which might have rpaths
+that we do not want.
+
+--- a/libdisk/Makefile
++++ b/libdisk/Makefile
+@@ -25,6 +25,7 @@
+ install: default
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: install-dev
+
+--- a/libhandle/Makefile
++++ b/libhandle/Makefile
+@@ -20,7 +20,6 @@
+ include $(BUILDRULES)
+
+ install: default
+- $(INSTALL_LTLIB)
+
+ install-dev: default
+ $(INSTALL_LTLIB_DEV)
+--- a/libxcmd/Makefile
++++ b/libxcmd/Makefile
+@@ -32,6 +32,11 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .dep
+--- a/libxfs/Makefile
++++ b/libxfs/Makefile
+@@ -41,5 +41,6 @@
+ install: default
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: default
+--- a/libxlog/Makefile
++++ b/libxlog/Makefile
+@@ -12,6 +12,8 @@
+
+ CFILES = xfs_log_recover.c util.c
+
++LTLIBS = $(LIBUUID) $(LIBXFS)
++
+ # don't want to link xfs_repair with a debug libxlog.
+ DEBUG = -DNDEBUG
+
+@@ -19,6 +21,11 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .dep
+--- a/Makefile
++++ b/Makefile
+@@ -66,6 +66,8 @@
+ mkfs: libxfs
+ quota: libxcmd
+ repair: libxfs libxlog
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifneq ($(ENABLE_BLKID), yes)
+ mkfs: libdisk
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -71,17 +71,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if test "x$(PKG_LIB_DIR)" != "x$(PKG_ROOT_LIB_DIR)" ; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
diff --git a/sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch
new file mode 100644
index 000000000000..118874a5e998
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch
@@ -0,0 +1,108 @@
+use libtool to do all installing. do not use the manual file install as
+that'll copy files directly from the .libs/ subdir which might have rpaths
+that we do not want.
+
+--- xfsprogs-3.2.2/include/buildmacros
++++ xfsprogs-3.2.2/include/buildmacros
+@@ -70,18 +70,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
+- "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))"; ]; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
+--- xfsprogs-3.2.2/libdisk/Makefile
++++ xfsprogs-3.2.2/libdisk/Makefile
+@@ -31,6 +31,7 @@
+ install: default
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: install-dev
+
+--- xfsprogs-3.2.2/libhandle/Makefile
++++ xfsprogs-3.2.2/libhandle/Makefile
+@@ -20,7 +20,6 @@
+ include $(BUILDRULES)
+
+ install: default
+- $(INSTALL_LTLIB)
+
+ install-dev: default
+ $(INSTALL_LTLIB_DEV)
+--- xfsprogs-3.2.2/libxcmd/Makefile
++++ xfsprogs-3.2.2/libxcmd/Makefile
+@@ -34,6 +34,11 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++
++ install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .ltdep
+--- xfsprogs-3.2.2/libxfs/Makefile
++++ xfsprogs-3.2.2/libxfs/Makefile
+@@ -86,6 +86,7 @@
+ install: default
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: default
+
+--- xfsprogs-3.2.2/libxlog/Makefile
++++ xfsprogs-3.2.2/libxlog/Makefile
+@@ -12,6 +12,8 @@
+
+ CFILES = xfs_log_recover.c util.c
+
++LTLIBS = $(LIBUUID) $(LIBXFS)
++
+ # don't want to link xfs_repair with a debug libxlog.
+ DEBUG = -DNDEBUG
+
+@@ -19,6 +21,11 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .ltdep
+--- xfsprogs-3.2.2/Makefile
++++ xfsprogs-3.2.2/Makefile
+@@ -63,6 +63,8 @@
+ mkfs: libxfs
+ quota: libxcmd
+ repair: libxfs libxlog
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifneq ($(ENABLE_BLKID), yes)
+ mkfs: libdisk
diff --git a/sys-fs/xfsprogs/metadata.xml b/sys-fs/xfsprogs/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-fs/xfsprogs/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/xfsprogs/xfsprogs-3.1.10.ebuild b/sys-fs/xfsprogs/xfsprogs-3.1.10.ebuild
new file mode 100644
index 000000000000..db0a6721f906
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-3.1.10.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.10-sharedlibs.patch
+
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in || die
+ sed -i \
+ -e '1iLLDFLAGS = -static' \
+ {estimate,fsr}/Makefile || die
+ sed -i \
+ -e "/LLDFLAGS/s:-static:$(use static && echo -all-static):" \
+ $(find -name Makefile) || die
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install install-dev
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-3.1.11-r1.ebuild b/sys-fs/xfsprogs/xfsprogs-3.1.11-r1.ebuild
new file mode 100644
index 000000000000..f4f212035000
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-3.1.11-r1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.11-sharedlibs.patch
+
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in || die
+ sed -i \
+ -e '1iLLDFLAGS = -static' \
+ {estimate,fsr}/Makefile || die
+ sed -i \
+ -e "/LLDFLAGS/s:-static:$(use static && echo -all-static):" \
+ $(find -name Makefile) || die
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install install-{dev,qa}
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-3.2.2.ebuild b/sys-fs/xfsprogs/xfsprogs-3.2.2.ebuild
new file mode 100644
index 000000000000..e3e46bd58fd2
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-3.2.2.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2.2-sharedlibs.patch
+
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in || die
+ sed -i \
+ -e '1iLLDFLAGS = -static' \
+ {estimate,fsr}/Makefile || die
+ sed -i \
+ -e "/LLDFLAGS/s:-static:$(use static && echo -all-static):" \
+ $(find -name Makefile) || die
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on these targets for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-{dev,qa}
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-3.2.3.ebuild b/sys-fs/xfsprogs/xfsprogs-3.2.3.ebuild
new file mode 100644
index 000000000000..463f6d33a8f4
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-3.2.3.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2.2-sharedlibs.patch
+
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in || die
+ sed -i \
+ -e '1iLLDFLAGS = -static' \
+ {estimate,fsr}/Makefile || die
+ sed -i \
+ -e "/LLDFLAGS/s:-static-libtool-libs:$(use static && echo -all-static):" \
+ $(find -name Makefile) || die
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on these targets for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-{dev,qa}
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/xfsprogs/xfsprogs-3.2.4.ebuild b/sys-fs/xfsprogs/xfsprogs-3.2.4.ebuild
new file mode 100644
index 000000000000..56054d2b7906
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-3.2.4.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2.2-sharedlibs.patch
+
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in || die
+ sed -i \
+ -e '1iLLDFLAGS = -static' \
+ {estimate,fsr}/Makefile || die
+ sed -i \
+ -e "/LLDFLAGS/s:-static-libtool-libs:$(use static && echo -all-static):" \
+ $(find -name Makefile) || die
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on these targets for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-{dev,qa}
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-fs/yaffs-utils/files/yaffs-utils-9999-build.patch b/sys-fs/yaffs-utils/files/yaffs-utils-9999-build.patch
new file mode 100644
index 000000000000..901484db9995
--- /dev/null
+++ b/sys-fs/yaffs-utils/files/yaffs-utils-9999-build.patch
@@ -0,0 +1,36 @@
+diff --git a/utils/Makefile b/utils/Makefile
+index 4929e08..51c4e5f 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -16,14 +16,13 @@
+
+ #KERNELDIR = /usr/src/kernel-headers-2.4.18
+
+-CFLAGS = -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL
++CFLAGS+= -I.. -Wall -DCONFIG_YAFFS_UTIL $(CPPFLAGS)
+ CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
+ CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
+
+ ## Change if you are using a cross-compiler
+ MAKETOOLS =
+
+-CC=$(MAKETOOLS)gcc
+
+ MKYAFFSOBJS = mkyaffs.o
+
+@@ -36,13 +35,13 @@ $(MKYAFFSIMAGEOBJS): %.o: %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+ mkyaffsimage: $(MKYAFFSIMAGEOBJS)
+- $(CC) -o $@ $(MKYAFFSIMAGEOBJS)
++ $(CC) $(CFLAGS) -o $@ $(MKYAFFSIMAGEOBJS) $(LDFLAGS)
+
+ $(MKYAFFSOBJS): %.o: %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+ mkyaffs: $(MKYAFFSOBJS)
+- $(CC) -o $@ $(MKYAFFSOBJS)
++ $(CC) $(CFLAGS) -o $@ $(MKYAFFSOBJS) $(LDFLAGS)
+
+ yaffs_ecc.c:
+ ln -s ../yaffs_ecc.c yaffs_ecc.c
diff --git a/sys-fs/yaffs-utils/metadata.xml b/sys-fs/yaffs-utils/metadata.xml
new file mode 100644
index 000000000000..5c40e771595f
--- /dev/null
+++ b/sys-fs/yaffs-utils/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+</pkgmetadata>
diff --git a/sys-fs/yaffs-utils/yaffs-utils-9999.ebuild b/sys-fs/yaffs-utils/yaffs-utils-9999.ebuild
new file mode 100644
index 000000000000..6aa511a90425
--- /dev/null
+++ b/sys-fs/yaffs-utils/yaffs-utils-9999.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+EGIT_REPO_URI="git://www.aleph1.co.uk/yaffs"
+EGIT_SOURCEDIR=${WORKDIR}
+
+inherit eutils git-2 toolchain-funcs
+
+DESCRIPTION="tools for generating YAFFS images"
+HOMEPAGE="http://www.aleph1.co.uk/yaffs/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+S=${WORKDIR}/utils
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+ tc-export CC
+}
+
+src_install() {
+ dobin mkyaffs || die
+ dodoc ../README
+}
diff --git a/sys-fs/yaffs2-utils/files/yaffs2-utils-9999-build.patch b/sys-fs/yaffs2-utils/files/yaffs2-utils-9999-build.patch
new file mode 100644
index 000000000000..ecbb958d434b
--- /dev/null
+++ b/sys-fs/yaffs2-utils/files/yaffs2-utils-9999-build.patch
@@ -0,0 +1,46 @@
+From 3f4b0661b63efaca78791612ce9be84271d784a5 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 5 Nov 2012 02:08:27 -0500
+Subject: [PATCH] fix build build system
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ utils/Makefile | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/utils/Makefile b/utils/Makefile
+index 710ebbf..26aea6b 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -16,14 +16,13 @@
+
+ #KERNELDIR = /usr/src/kernel-headers-2.4.18
+
+-CFLAGS = -O2 -Wall -DCONFIG_YAFFS_UTIL
++CFLAGS+= -Wall -DCONFIG_YAFFS_UTIL -DCONFIG_YAFFS_DEFINES_TYPES
+ CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
+ CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
+
+ ## Change if you are using a cross-compiler
+ MAKETOOLS =
+
+-CC=$(MAKETOOLS)gcc
+
+ COMMON_BASE_C_LINKS = yaffs_ecc.c
+ COMMON_BASE_LINKS = $(COMMON_BASE_C_LINKS) yaffs_ecc.h yaffs_guts.h yaffs_packedtags2.h yaffs_trace.h
+@@ -57,10 +56,10 @@ $(COMMONOBJS) $(MKYAFFSIMAGEOBJS) $(MKYAFFS2IMAGEOBJS) : %.o: %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+ mkyaffsimage: $(MKYAFFSIMAGEOBJS) $(COMMONOBJS)
+- $(CC) -o $@ $^
++ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+ mkyaffs2image: $(MKYAFFS2IMAGEOBJS) $(COMMONOBJS)
+- $(CC) -o $@ $^
++ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+
+ clean:
+--
+1.7.12.4
+
diff --git a/sys-fs/yaffs2-utils/metadata.xml b/sys-fs/yaffs2-utils/metadata.xml
new file mode 100644
index 000000000000..5c40e771595f
--- /dev/null
+++ b/sys-fs/yaffs2-utils/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+</pkgmetadata>
diff --git a/sys-fs/yaffs2-utils/yaffs2-utils-9999.ebuild b/sys-fs/yaffs2-utils/yaffs2-utils-9999.ebuild
new file mode 100644
index 000000000000..892bbfb917c5
--- /dev/null
+++ b/sys-fs/yaffs2-utils/yaffs2-utils-9999.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+EGIT_REPO_URI="git://www.aleph1.co.uk/yaffs2"
+EGIT_SOURCEDIR=${WORKDIR}
+
+inherit eutils git-2 toolchain-funcs
+
+DESCRIPTION="tools for generating YAFFS images"
+HOMEPAGE="http://www.aleph1.co.uk/yaffs/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+S=${WORKDIR}/utils
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+ tc-export CC
+}
+
+src_install() {
+ dobin mkyaffsimage mkyaffs2image
+ dodoc ../README-linux
+}
diff --git a/sys-fs/yaffs2utils/Manifest b/sys-fs/yaffs2utils/Manifest
new file mode 100644
index 000000000000..99fe950b0e04
--- /dev/null
+++ b/sys-fs/yaffs2utils/Manifest
@@ -0,0 +1 @@
+DIST yaffs2utils-0.2.9.tar.gz 39689 SHA256 9b0912bf683eb839b6e57c9255c83894c3b700d16489a49d319c54c1abf8f6d7 SHA512 001a2452515f750bdb2251feebfe20c4f1b716b3c850e13646ee054f8e607c18ecfc2781a2f3e1f288b8b32661b11fec8a87e88d8bd4a44c98cad4dbbffd489b WHIRLPOOL bb615f7994af6840950030c4e79cc78a109c3c03aac2efb3c177d3abe0d96af2e58655cb0a7a653817c6812033c3d877597a555bebcdd15b677c3debcac76879
diff --git a/sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-build.patch b/sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-build.patch
new file mode 100644
index 000000000000..c16d4de141e6
--- /dev/null
+++ b/sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-build.patch
@@ -0,0 +1,47 @@
+--- a/Makefile
++++ b/Makefile
+@@ -18,21 +18,15 @@
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ #
+
+-CROSS =
+-CC = $(CROSS)gcc
+
+-CFLAGS = -I. -I./yaffs2
+-CFLAGS += -O2
+-CFLAGS += -Wall -Wshadow -Winline -Wpointer-arith -Wnested-externs \
+- -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations \
+- -Wmissing-prototypes -Wredundant-decls
++CPPFLAGS += -I. -I./yaffs2
+
+-CFLAGS += -D_HAVE_MMAP
++CPPFLAGS += -D_HAVE_MMAP
+
+ #CFLAGS += -D_MKYAFFS2_DEBUG
+ #CFLAGS += -D_UNYAFFS2_DEBUG
+
+-LDFLAGS += -lm
++LDLIBS += -lm
+
+ YAFFS2SRCS = yaffs2/yaffs_hweight.c yaffs2/yaffs_ecc.c \
+ yaffs2/yaffs_packedtags1.c yaffs2/yaffs_packedtags2.c
+@@ -60,14 +54,16 @@ all: $(TARGET)
+ install:
+ cp $(TARGET) $(INSTALLDIR)
+
++LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
++
+ mkyaffs2: $(YAFFS2OBJS) $(LIBOBJS) $(MKYAFFS2OBJS)
+- $(CC) -o $@ $(YAFFS2OBJS) $(LIBOBJS) $(MKYAFFS2OBJS) $(LDFLAGS)
++ $(LINK)
+
+ unyaffs2: $(YAFFS2OBJS) $(LIBOBJS) $(UNYAFFS2OBJS)
+- $(CC) -o $@ $(YAFFS2OBJS) $(LIBOBJS) $(UNYAFFS2OBJS) $(LDFLAGS)
++ $(LINK)
+
+ unspare2: $(YAFFS2OBJS) $(LIBOBJS) $(UNSPARE2OBJS)
+- $(CC) -o $@ $(YAFFS2OBJS) $(LIBOBJS) $(UNSPARE2OBJS) $(LDFLAGS)
++ $(LINK)
+
+ clean:
+ rm -rf $(YAFFS2OBJS) $(LIBOBJS) \
diff --git a/sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-unyaffs2-pointer.patch b/sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-unyaffs2-pointer.patch
new file mode 100644
index 000000000000..3730ab41248c
--- /dev/null
+++ b/sys-fs/yaffs2utils/files/yaffs2utils-0.2.9-unyaffs2-pointer.patch
@@ -0,0 +1,13 @@
+https://code.google.com/p/yaffs2utils/issues/detail?id=42
+
+--- a/unyaffs2.c
++++ b/unyaffs2.c
+@@ -1102,7 +1102,7 @@ unyaffs2_extract_hardlink (const char *fpath, struct unyaffs2_obj *obj)
+ char *lnkfile;
+
+ struct unyaffs2_obj *equiv;
+- union unyaffs2_file_variant *variant;
++ union unyaffs2_file_variant variant;
+
+ equiv = unyaffs2_follow_hardlink(obj);
+ if (equiv == NULL) {
diff --git a/sys-fs/yaffs2utils/metadata.xml b/sys-fs/yaffs2utils/metadata.xml
new file mode 100644
index 000000000000..5c40e771595f
--- /dev/null
+++ b/sys-fs/yaffs2utils/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+</pkgmetadata>
diff --git a/sys-fs/yaffs2utils/yaffs2utils-0.2.9.ebuild b/sys-fs/yaffs2utils/yaffs2utils-0.2.9.ebuild
new file mode 100644
index 000000000000..dbc6c8acfeb8
--- /dev/null
+++ b/sys-fs/yaffs2utils/yaffs2utils-0.2.9.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="tools for generating YAFFS images"
+HOMEPAGE="http://code.google.com/p/yaffs2utils/"
+SRC_URI="https://yaffs2utils.googlecode.com/files/0.2.9.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~x86"
+IUSE=""
+
+S=${WORKDIR}/${PV}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-unyaffs2-pointer.patch
+}
+
+src_configure() {
+ tc-export CC
+}
+
+src_install() {
+ dobin unspare2 mkyaffs2 unyaffs2
+ dodoc CHANGES README
+}
diff --git a/sys-fs/zerofree/Manifest b/sys-fs/zerofree/Manifest
new file mode 100644
index 000000000000..87c94883bc47
--- /dev/null
+++ b/sys-fs/zerofree/Manifest
@@ -0,0 +1,2 @@
+DIST zerofree-1.0.1.tgz 8333 SHA256 ddf33ac01e554997659841b723bd826dfcd2554f31176b7a05993236cefd3cd8
+DIST zerofree-1.0.3.tgz 8506 SHA256 3acfda860be0f0ddcb5c982ff3b4475b1ee8cc35a90ae2a910e93261dbe0ccf6 SHA512 e23d343471240382629b4c86b6caa74571a77fb19f1b31bbbd9fad03ba1b42898f8ae042d1238d9c91d9b7fbc9893fb708cb557d3bbd9ab9a024aca6a8ddbbe3 WHIRLPOOL b1954c9a60bcbd8ba7acaf8c50e2ba3f9748346825d2b97f0666a568597400ff9de2eae42aa2c47cbec1efd9dabe1975b8ce34c82ecb847bfdf08b4c50510499
diff --git a/sys-fs/zerofree/metadata.xml b/sys-fs/zerofree/metadata.xml
new file mode 100644
index 000000000000..984946d9eb56
--- /dev/null
+++ b/sys-fs/zerofree/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>kumba@gentoo.org</email>
+ </maintainer>
+
+ <longdescription>
+ zerofree is a small utility designed to zero-out the free space on a filesystem. It is especially useful for guests on a virtual machine before compacting their disk images.
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-fs/zerofree/zerofree-1.0.1.ebuild b/sys-fs/zerofree/zerofree-1.0.1.ebuild
new file mode 100644
index 000000000000..c8ff374e4e76
--- /dev/null
+++ b/sys-fs/zerofree/zerofree-1.0.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Zero's out all free space on a filesystem"
+HOMEPAGE="http://intgat.tigress.co.uk/rmy/uml/index.html"
+SRC_URI="http://intgat.tigress.co.uk/rmy/uml/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~mips"
+IUSE=""
+
+DEPEND="sys-libs/e2fsprogs-libs"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Honor system CFLAGS.
+ sed -i \
+ -e "s:CC=gcc:CC=$(tc-getCC)\nCFLAGS=${CFLAGS}\nLDFLAGS=${LDFLAGS}:g" \
+ -e "s:-o zerofree:\$(CFLAGS) \$(LDFLAGS) -o zerofree:g" \
+ -e "/-lext2fs/{ s:-lext2fs::g; s:$: -lext2fs:g; }" \
+ Makefile || die "Failed to sed the Makefile"
+}
+
+src_compile() {
+ # Just a Makefile, nothing fancy.
+ make || die "Failed to compile ${PN}."
+}
+
+src_install() {
+ # Install into /sbin
+ into /
+ dosbin zerofree
+}
diff --git a/sys-fs/zerofree/zerofree-1.0.3.ebuild b/sys-fs/zerofree/zerofree-1.0.3.ebuild
new file mode 100644
index 000000000000..c8ff374e4e76
--- /dev/null
+++ b/sys-fs/zerofree/zerofree-1.0.3.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Zero's out all free space on a filesystem"
+HOMEPAGE="http://intgat.tigress.co.uk/rmy/uml/index.html"
+SRC_URI="http://intgat.tigress.co.uk/rmy/uml/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~mips"
+IUSE=""
+
+DEPEND="sys-libs/e2fsprogs-libs"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Honor system CFLAGS.
+ sed -i \
+ -e "s:CC=gcc:CC=$(tc-getCC)\nCFLAGS=${CFLAGS}\nLDFLAGS=${LDFLAGS}:g" \
+ -e "s:-o zerofree:\$(CFLAGS) \$(LDFLAGS) -o zerofree:g" \
+ -e "/-lext2fs/{ s:-lext2fs::g; s:$: -lext2fs:g; }" \
+ Makefile || die "Failed to sed the Makefile"
+}
+
+src_compile() {
+ # Just a Makefile, nothing fancy.
+ make || die "Failed to compile ${PN}."
+}
+
+src_install() {
+ # Install into /sbin
+ into /
+ dosbin zerofree
+}
diff --git a/sys-fs/zfs-kmod/Manifest b/sys-fs/zfs-kmod/Manifest
new file mode 100644
index 000000000000..6698c0d00a29
--- /dev/null
+++ b/sys-fs/zfs-kmod/Manifest
@@ -0,0 +1,11 @@
+DIST zfs-0.6.0-rc13.tar.gz 1490582 SHA256 3e689fc0704237c7d755c65e34ed214a262535afefafde4aef0f112f8c833a09 SHA512 c9bbf1fb7f293a0f5b1247e17c411073994bf419d5f6c1b781efeeb4022f62851e8ea3cf7ee0330b0609bfe13b8084c48f00e942ce52323d706733cccf49699e WHIRLPOOL 97083a6f5d66addc9bc7b3cc3f7dd3bc1696980affbd4033d71cd09ecad413ffb666a8a185dfa2e4f20dd4003746ad61d12142f7a6556db5b34008716c933798
+DIST zfs-0.6.0-rc14.tar.gz 1527612 SHA256 5eae8ef790b26e0dd7c801cc0a235a631ad91d67f148a444d912dbeb24b9a12d SHA512 ad38544ced150ce500c78507782e53a8534815b819e5b9aefda6d670fb7905e31a42cdb4d45164700df48673ea7c42bd1d29a60f1f00e25271b3906de9212d15 WHIRLPOOL cfd4de541eb6c18ee4df8950883525d1b1887e0d9c5f840d97353a5d716ed639f1ab3dc0fe4d8368a890564f10053026bcc738b6066c4488647f1b83be54288d
+DIST zfs-0.6.1.tar.gz 1535521 SHA256 42ed127f74af0ecafc14800a5d2b766655f5ea821098aba92446c1c447093fad SHA512 ef583639f15a5b2e4582760bb013ab5091abc15bae17884d811afec707aff337248102a22fb9fb6f62f99cb3477a8ae82edfdcfdfb962276f593173a5dfe5871 WHIRLPOOL a6791fc2d384e03073abc850f99ba761afd18073337264d8a7bc08b4ddc6fff52df5ce11addc9a3ac7cdfdd9ce9bd779208e515cda631ec19de05fbf9f92307b
+DIST zfs-0.6.2.tar.gz 1558656 SHA256 91b844bf7a42df22d7533e8004289270b7859b8fcbca3bff8087a79b131318b4 SHA512 008f9decdea3e92f6d74f5369ec9df5776b15efbb9f2bc01012999b71e1f2bc5b46b310a329b60545907dcc78773ec79eb6d21aca49d911f33299fd0a36e1a4b WHIRLPOOL 587279866b6ffa2bfebc91f00cb28de85f7f186426a0292f44c6cde7ca3a51c1911fc0ee431c25c3ee0866174522f90ce04b54de4aa3dc0829ba3a719e47af58
+DIST zfs-0.6.3-patches-r1.tar.xz 87852 SHA256 71b5286f77cb6a6c2b97cee406dfd4788f7b40b6675c4a56fc630a47e90d5280 SHA512 e2fa573c7b30a3811e9e1596d35b65f5d013ed5bac43e364b44ffab734398a3294979c152a80ec9a722611cc7c971aec217d8e1a37cc9240a3fa2dddb5b90e3b WHIRLPOOL f2da02d5c7d2385e7de1e858c31d299632ca864d422f0c94e5d3b8674d24beeb073ad2600698350306a9e70dbeef390f0e513d19c126502fceec18795c203d50
+DIST zfs-0.6.3.tar.gz 1665270 SHA256 00caeae63cc724d3dd741aeb36fd2dc03d2158794bd6a5e925cdc8d7e5d3da8c SHA512 8c7741f5f227eb031d79fe87bf7d60e790a098fa6caede462d556c97d798832f97f5a377cbb74fc99b8d198e5f3cc1a3491f69fcdaa0408933dbadd132013416 WHIRLPOOL db9791da12c441c89667b194154b209f5aa69ea46d5327cfcde0b3a910cf1f0e5ca448909824e45b31252a1907280b711fb6ba04eb313d09de0ffbf5e6e304fe
+DIST zfs-0.6.4.2.tar.gz 1738601 SHA256 26af2924cbb891b79203a31827cba4cdc310162d5f7b9e2d643eb6576aa19015 SHA512 87a28997b8f9d36e189410171db583402418a55782b7b7f333993e98c5e17ccc4b6cd5825f38b904294c87e3dfdfb7748bd71cc371589c1358f16c942e0c18db WHIRLPOOL 1700de7da56311a7b608c99a821e2fa97a6145ccc88f3d8eff12f778421ba7b7b9cc5f5fbe5f1acd2ea2fd1db778c200a2ea961e3859a8fc89d80474894293f1
+DIST zfs-0.6.4.tar.gz 1735736 SHA256 7f37aaaa1fc15201dde58bb84e0f191ccac462f19ffec0c889b6f6ed3f73a804 SHA512 cf47cbf5fa8dff75f5e9d81b323f5745d7b210266ba9e6ccab16bbf0e2b055aa1168bad94a77a4bc56c6fbe0391593f210bd4c74f7a8d0d99385ac4dd61e5622 WHIRLPOOL 1b0cc8a9727b57f2e63bd106cd94780002a068b31668b9dc103dbc0b48858a380d7c228f39f0526fc84b9d10aca1bd376ace0346a2ef4306a9d164c2d56606f1
+DIST zfs-kmod-0.6.2-p2.tar.xz 28636 SHA256 12882463a38a5a57cf2bb3c14c5783f9511f6dc7b163a47575f2f3dcc24f26f6 SHA512 5792660ae8f5013d12e70d608e9cffa92a8c4089a88a5e78728ee88204b3f970d452d5b0b3874e02be49ebbc139e07139be7b5a86ca40bc8b23cb11a7198a9a8 WHIRLPOOL 0e4c57b363cdd3d736efbd1355567b18e22439bd3b20ef40b27f6b97ad4570c7cc99a11b196ac25359d1966c1a70e178f4fd1687b60450f148ccda47b07282a9
+DIST zfs-kmod-0.6.2-p3.tar.xz 45988 SHA256 4af06d1472f5d24e01d147b6fec5c78fbbd9739d1259bd3fbf57af66c99b9bcb SHA512 eddf67c0aa49d42f663f98dc721bac75e8d0521df5ae174cd6aeee0a935a71b49e06961404eb6c71a09cd239358868a2fe49de4f1d26776948f8fe7fc943165c WHIRLPOOL 5634a92f6f322f67edef95ad121b0b1699e520ca8beb05b3385dc7e20198dd45d337731bf7df69d1b1c552ed0b78d54b15bc9c9e76b694ae4c8d360892b9d764
+DIST zfs-kmod-0.6.2-p4.tar.xz 63984 SHA256 9167edc4be86e3fcda6b3c198e51f92ab0c95ac5baca11666c28029a628cdac9 SHA512 13e4ec415c35d2f268d89565745f5898c0943423577a2ba6714b3a069c5a80f244cd06dff91464f38dd4ed60673d1145ead080bb03a56d4be33e328f948ffa64 WHIRLPOOL 8c399ec67119ed4fbebb5599d00f888918678bc4e4ea369b4bdc5c75bfc90fc76396087624c8011de370a54ff103bccaa8922d05ac7ccebb2b3481bbbcf44b19
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch
new file mode 100644
index 000000000000..2daf211c7744
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-invisible-snapshots.patch
@@ -0,0 +1,39 @@
+From 1c50c992bafd96773dc3950d382a89806df8cc9c Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Wed, 9 Jan 2013 11:09:06 -0800
+Subject: [PATCH] Revert "Avoid ELOOP on auto-mounted snapshots"
+
+This reverts commit 7afcf5b1da83549bfba70a61fae7a00eaa63c2b0 which
+accidentally introduced a regression with the .zfs snapshot directory.
+While the updated code still does correctly mount the requested
+snapshot. It updates the vfsmount such that it references the
+original dataset vfsmount. The result is that the snapshot itself
+isn't visible.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #816
+---
+ module/zfs/zpl_ctldir.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/module/zfs/zpl_ctldir.c b/module/zfs/zpl_ctldir.c
+index a2d8fa9..7dfaf6e 100644
+--- a/module/zfs/zpl_ctldir.c
++++ b/module/zfs/zpl_ctldir.c
+@@ -357,13 +357,6 @@
+ return ERR_PTR(error);
+
+ /*
+- * Ensure path->dentry points to the dentry for the root of the
+- * newly-mounted snapshot, otherwise this function may be called
+- * repeatedly which can lead to an incorrect ELOOP error return.
+- */
+- follow_up(path);
+-
+- /*
+ * Rather than returning the new vfsmount for the snapshot we must
+ * return NULL to indicate a mount collision. This is done because
+ * the user space mount calls do_add_mount() which adds the vfsmount
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch
new file mode 100644
index 000000000000..7d0263f31901
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-fix-recursive-reader.patch
@@ -0,0 +1,40 @@
+diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c
+index 21fdd08..872d44a 100644
+--- a/module/zfs/dsl_dataset.c
++++ b/module/zfs/dsl_dataset.c
+@@ -20,7 +20,7 @@
+ */
+ /*
+ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+- * Copyright (c) 2011 by Delphix. All rights reserved.
++ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
+
+@@ -4158,9 +4220,13 @@ struct dsl_ds_releasearg {
+ dsl_dataset_t *snap;
+ uint64_t used, comp, uncomp;
+
+- err = dsl_dataset_hold_obj(dp, snapobj, FTAG, &snap);
+- if (err != 0)
+- break;
++ if (snapobj == new->ds_object) {
++ snap = new;
++ } else {
++ err = dsl_dataset_hold_obj(dp, snapobj, FTAG, &snap);
++ if (err != 0)
++ break;
++ }
+
+ if (snap->ds_phys->ds_prev_snap_txg ==
+ oldsnap->ds_phys->ds_creation_txg) {
+@@ -4189,7 +4255,8 @@ struct dsl_ds_releasearg {
+ * was not a snapshot of/before new.
+ */
+ snapobj = snap->ds_phys->ds_prev_snap_obj;
+- dsl_dataset_rele(snap, FTAG);
++ if (snap != new)
++ dsl_dataset_rele(snap, FTAG);
+ if (snapobj == 0) {
+ err = EINVAL;
+ break;
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch
new file mode 100644
index 000000000000..9f31ecc82307
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc13-gcc-4.7-compat.patch
@@ -0,0 +1,51 @@
+From 37f000c5aa76613e644cf3e5b1ec7bd2df6f7451 Mon Sep 17 00:00:00 2001
+From: Ned Bass <bass6@llnl.gov>
+Date: Wed, 26 Dec 2012 14:56:41 -0800
+Subject: [PATCH] Fix gcc array subscript above bounds warning
+
+In a debug build, certain GCC versions flag an array bounds warning in
+the below code from dnode_sync.c
+
+ } else {
+ int i;
+ ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr);
+ /* the blkptrs we are losing better be unallocated */
+ for (i = dn->dn_next_nblkptr[txgoff];
+ i < dnp->dn_nblkptr; i++)
+ ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
+
+This usage is in fact safe, since the ASSERT ensures the index does
+not exceed to maximum possible number of block pointers. However gcc
+can't determine that the assignment 'i = dn->dn_next_nblkptr[txgoff];'
+falls within the array bounds so it issues a warning. To avoid this,
+initialize i to zero to make gcc happy but skip the elements before
+dn->dn_next_nblkptr[txgoff] in the loop body. Since a dnode contains
+at most 3 block pointers this overhead should be negligible.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #950
+---
+ module/zfs/dnode_sync.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c
+index af636dc..f2dda86 100644
+--- a/module/zfs/dnode_sync.c
++++ b/module/zfs/dnode_sync.c
+@@ -666,9 +666,10 @@
+ int i;
+ ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr);
+ /* the blkptrs we are losing better be unallocated */
+- for (i = dn->dn_next_nblkptr[txgoff];
+- i < dnp->dn_nblkptr; i++)
+- ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
++ for (i = 0; i < dnp->dn_nblkptr; i++) {
++ if (i >= dn->dn_next_nblkptr[txgoff])
++ ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i]));
++ }
+ #endif
+ }
+ mutex_enter(&dn->dn_mtx);
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch
new file mode 100644
index 000000000000..13189244c69a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-cast-const-for-32bit-compatibility.patch
@@ -0,0 +1,36 @@
+From dd26aa535b395735ca61ea2a3e618aded45eb05e Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Mon, 4 Feb 2013 16:35:54 -0800
+Subject: [PATCH] Cast 'zfs bad bloc' to ULL for x86
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Explicitly case this value to an unsigned long long for 32-bit
+systems to inform the compiler that a long type should not be
+used. Otherwise we get the following compiler error:
+
+ dmu_send.c:376: error: integer constant is too large for
+ ‘long’ type
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+---
+ module/zfs/dmu_send.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c
+index 0cf3c4a..921c3d7 100644
+--- a/module/zfs/dmu_send.c
++++ b/module/zfs/dmu_send.c
+@@ -373,7 +373,7 @@
+ for (ptr = abuf->b_data;
+ (char *)ptr < (char *)abuf->b_data + blksz;
+ ptr++)
+- *ptr = 0x2f5baddb10c;
++ *ptr = 0x2f5baddb10cULL;
+ } else {
+ return (EIO);
+ }
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch
new file mode 100644
index 000000000000..fb4c7c35696c
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-flush-properly.patch
@@ -0,0 +1,42 @@
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 5623785..9d5aa46 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -16,7 +16,6 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
+ ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS
+ ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE
+ ZFS_AC_KERNEL_BDEV_PHYSICAL_BLOCK_SIZE
+- ZFS_AC_KERNEL_BIO_EMPTY_BARRIER
+ ZFS_AC_KERNEL_BIO_FAILFAST
+ ZFS_AC_KERNEL_BIO_FAILFAST_DTD
+ ZFS_AC_KERNEL_REQ_FAILFAST_MASK
+diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
+index cbf0a4d..e902a70 100644
+--- a/module/zfs/vdev_disk.c
++++ b/module/zfs/vdev_disk.c
+@@ -604,8 +604,6 @@
+ return __vdev_disk_physio(bdev, NULL, kbuf, size, offset, flags);
+ }
+
+-/* 2.6.24 API change */
+-#ifdef HAVE_BIO_EMPTY_BARRIER
+ BIO_END_IO_PROTO(vdev_disk_io_flush_completion, bio, size, rc)
+ {
+ zio_t *zio = bio->bi_private;
+@@ -646,13 +644,6 @@
+
+ return 0;
+ }
+-#else
+-static int
+-vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
+-{
+- return ENOTSUP;
+-}
+-#endif /* HAVE_BIO_EMPTY_BARRIER */
+
+ static int
+ vdev_disk_io_start(zio_t *zio)
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch
new file mode 100644
index 000000000000..15d5af34d5c5
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-autotools-checks.patch
@@ -0,0 +1,105 @@
+From d75af3c0ebb4e31ece087aeecfeff282cb6f1361 Mon Sep 17 00:00:00 2001
+From: Etienne Dechamps <etienne@edechamps.fr>
+Date: Sun, 24 Feb 2013 12:42:28 +0000
+Subject: [PATCH] Use -Werror for all kernel configure tests.
+
+As a matter of fact, we're already using -Werror for most tests because
+of a bug in kernel-bio-empty-barrier.m4 which sets -Werror without
+reverting it afterwards. This meant that all tests which ran after this
+one was using -Werror.
+
+This patch simply makes it clear that we're using -Werror and makes
+the code more readable and more predictable.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1317
+---
+ config/kernel-bio-empty-barrier.m4 | 1 -
+ config/kernel-bio-end-io-t-args.m4 | 3 ---
+ config/kernel-security-inode-init.m4 | 6 ------
+ config/kernel.m4 | 2 +-
+ 4 files changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/config/kernel-bio-empty-barrier.m4 b/config/kernel-bio-empty-barrier.m4
+index 99549fe..fda16b3 100644
+--- a/config/kernel-bio-empty-barrier.m4
++++ b/config/kernel-bio-empty-barrier.m4
+@@ -4,7 +4,6 @@ dnl # Empty write barriers are now supported and we should use them.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_BIO_EMPTY_BARRIER], [
+ AC_MSG_CHECKING([whether bio_empty_barrier() is defined])
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
+ ],[
+diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4
+index ced4861..44e4826 100644
+--- a/config/kernel-bio-end-io-t-args.m4
++++ b/config/kernel-bio-end-io-t-args.m4
+@@ -9,8 +9,6 @@ dnl # to void.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ AC_MSG_CHECKING([whether bio_end_io_t wants 2 args])
+- tmp_flags="$EXTRA_KCFLAGS"
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
+ ],[
+@@ -25,5 +23,4 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+- EXTRA_KCFLAGS="$tmp_flags"
+ ])
+diff --git a/config/kernel-security-inode-init.m4 b/config/kernel-security-inode-init.m4
+index c21588a..a62176d 100644
+--- a/config/kernel-security-inode-init.m4
++++ b/config/kernel-security-inode-init.m4
+@@ -7,8 +7,6 @@ dnl # security checks will just be skipped.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
+ AC_MSG_CHECKING([whether security_inode_init_security wants 6 args])
+- tmp_flags="$EXTRA_KCFLAGS"
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/security.h>
+ ],[
+@@ -27,7 +25,6 @@ AC_DEFUN([ZFS_AC_KERNEL_6ARGS_SECURITY_INODE_INIT_SECURITY], [
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+- EXTRA_KCFLAGS="$tmp_flags"
+ ])
+
+ dnl #
+@@ -39,8 +36,6 @@ dnl # and the EVM xattr.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY], [
+ AC_MSG_CHECKING([whether security_inode_init_security wants callback])
+- tmp_flags="$EXTRA_KCFLAGS"
+- EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/security.h>
+ ],[
+@@ -57,5 +52,4 @@ AC_DEFUN([ZFS_AC_KERNEL_CALLBACK_SECURITY_INODE_INIT_SECURITY], [
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+- EXTRA_KCFLAGS="$tmp_flags"
+ ])
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 6d28074..5623785 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -488,7 +488,7 @@ AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
+ modpost_flag=''
+ test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+ AS_IF(
+- [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
++ [AC_TRY_COMMAND(cp conftest.c build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
+ [$4],
+ [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
+ )
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch
new file mode 100644
index 000000000000..03ee65ef9d4a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-improved-hardened-support.patch
@@ -0,0 +1,473 @@
+From ead579050140bfa010d06f6e0fea3f680c781b38 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Thu, 14 Feb 2013 18:54:04 -0500
+Subject: [PATCH] Eliminate runtime function pointer modifications in
+ autotools checks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PaX/GrSecurity patched kernels implement a dialect of C that relies on a
+GCC plugin for enforcement. A basic idea in this dialect is that
+function pointers in structures should not change during runtime.
+This causes code that modifies function pointers at runtime to fail to
+compile in many instances. The autotools checks rely on whether or
+not small test cases compile against a given kernel. Some
+autotools checks assume some default case if other cases fail. When one
+of these autotools checks tests a PaX/GrSecurity patched kernel by
+modifying a function pointer at runtime, the default case will be used.
+
+Early detection of such situations is possible by relying on compiler
+warnings, which are compiler errors when --enable-debug is used.
+Unfortunately, very few people build ZFS with --enable-debug. The more
+common situation is that these issues manifest themselves as runtime
+failures in the form of NULL pointer exceptions.
+
+Previous patches that addressed such issues with PaX/GrSecurity
+compatibility largely relied on rewriting autotools checks to avoid
+runtime function pointer modification or the addition of PaX/GrSecurity
+specific checks. This patch takes the previous work to its logical
+conclusion by eliminating the use of runtime function pointer
+modification. This permits the removal of PaX-specific autotools checks
+in favor of ones that work across all supported kernels.
+
+This should resolve issues that were reported to occur with
+PaX/GrSecurity-patched Linux 3.7.5 kernels on Gentoo Linux.
+
+https://bugs.gentoo.org/show_bug.cgi?id=457176
+
+We should be able to prevent future regressions in PaX/GrSecurity
+compatibility by ensuring that all changes to ZFSOnLinux avoid runtime
+function pointer modification. At the same time, this does not solve the
+issue of silent failures triggering default cases in the autotools
+check, which is what permitted these regressions to become runtime
+failures in the first place. This will need to be addressed in a future
+patch.
+
+Reported-by: Marcin Mirosław <bug@mejor.pl>
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+---
+ config/kernel-bdev-block-device-operations.m4 | 21 +++----
+ config/kernel-bio-end-io-t-args.m4 | 6 +-
+ config/kernel-create-nameidata.m4 | 12 ++--
+ config/kernel-dentry-operations.m4 | 6 +-
+ config/kernel-dirty-inode.m4 | 8 +--
+ config/kernel-fallocate.m4 | 37 +++--------
+ config/kernel-fsync.m4 | 84 ++++---------------------
+ config/kernel-lookup-nameidata.m4 | 9 +--
+ config/kernel-mkdir-umode-t.m4 | 7 ++-
+ config/kernel-shrink.m4 | 21 +++----
+ 10 files changed, 62 insertions(+), 149 deletions(-)
+
+diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4
+index 28c3032..1674af0 100644
+--- a/config/kernel-bdev-block-device-operations.m4
++++ b/config/kernel-bdev-block-device-operations.m4
+@@ -7,24 +7,21 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+ EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/blkdev.h>
+- ],[
+- int (*blk_open) (struct block_device *, fmode_t) = NULL;
+- int (*blk_release) (struct gendisk *, fmode_t) = NULL;
+- int (*blk_ioctl) (struct block_device *, fmode_t,
+- unsigned, unsigned long) = NULL;
+- int (*blk_compat_ioctl) (struct block_device *, fmode_t,
+- unsigned, unsigned long) = NULL;
+- struct block_device_operations blk_ops = {
++
++ int blk_open (struct block_device *bdev, fmode_t mode) { return 0; }
++ int blk_release (struct gendisk *g, fmode_t mode) { return 0; }
++ int blk_ioctl (struct block_device *bdev, fmode_t mode,
++ unsigned x, unsigned long y) { return 0; }
++ int blk_compat_ioctl (struct block_device * bdev, fmode_t mode,
++ unsigned x, unsigned long y) { return 0; }
++ static struct block_device_operations blk_ops __attribute__ ((unused)) = {
+ .open = blk_open,
+ .release = blk_release,
+ .ioctl = blk_ioctl,
+ .compat_ioctl = blk_compat_ioctl,
+ };
++ ],[
+
+- blk_ops.open(NULL, 0);
+- blk_ops.release(NULL, 0);
+- blk_ops.ioctl(NULL, 0, 0, 0);
+- blk_ops.compat_ioctl(NULL, 0, 0, 0);
+ ],[
+ AC_MSG_RESULT(struct block_device)
+ AC_DEFINE(HAVE_BDEV_BLOCK_DEVICE_OPERATIONS, 1,
+diff --git a/config/kernel-bio-end-io-t-args.m4 b/config/kernel-bio-end-io-t-args.m4
+index ced4861..fe5707a 100644
+--- a/config/kernel-bio-end-io-t-args.m4
++++ b/config/kernel-bio-end-io-t-args.m4
+@@ -13,11 +13,9 @@ AC_DEFUN([ZFS_AC_KERNEL_BIO_END_IO_T_ARGS], [
+ EXTRA_KCFLAGS="-Werror"
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
++ void wanted_end_io(struct bio * bio, int x) { return; }
+ ],[
+- void (*wanted_end_io)(struct bio *, int) = NULL;
+- bio_end_io_t *local_end_io __attribute__ ((unused));
+-
+- local_end_io = wanted_end_io;
++ bio_end_io_t *local_end_io __attribute__ ((unused)) = wanted_end_io;
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_2ARGS_BIO_END_IO_T, 1,
+diff --git a/config/kernel-create-nameidata.m4 b/config/kernel-create-nameidata.m4
+index 100f077..c779715 100644
+--- a/config/kernel-create-nameidata.m4
++++ b/config/kernel-create-nameidata.m4
+@@ -5,18 +5,18 @@ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->create() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+ #ifdef HAVE_MKDIR_UMODE_T
+- int (*inode_create) (struct inode *,struct dentry *,
+- umode_t, struct nameidata *) = NULL;
++ int inode_create (struct inode *inode ,struct dentry *dentry,
++ umode_t umode, struct nameidata *nidata) { return 0; }
+ #else
+- int (*inode_create) (struct inode *,struct dentry *,
+- int, struct nameidata *) = NULL;
++ int inode_create (struct inode *inode,struct dentry *dentry,
++ int umode, struct nameidata * nidata) { return 0; }
+ #endif
+- struct inode_operations iops __attribute__ ((unused)) = {
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .create = inode_create,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
+ [iops->create() operation takes nameidata])
+diff --git a/config/kernel-dentry-operations.m4 b/config/kernel-dentry-operations.m4
+index dfbea7d..b89c51d 100644
+--- a/config/kernel-dentry-operations.m4
++++ b/config/kernel-dentry-operations.m4
+@@ -5,12 +5,12 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/dcache.h>
+- ],[
+- int (*revalidate) (struct dentry *, struct nameidata *) = NULL;
+- struct dentry_operations dops __attribute__ ((unused)) = {
++ int revalidate (struct dentry *dentry, struct nameidata *nidata) { return 0; }
++ static struct dentry_operations dops __attribute__ ((unused)) = {
+ .d_revalidate = revalidate,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_D_REVALIDATE_NAMEIDATA, 1,
+ [dops->d_revalidate() operation takes nameidata])
+diff --git a/config/kernel-dirty-inode.m4 b/config/kernel-dirty-inode.m4
+index 2ededf1..86e3425 100644
+--- a/config/kernel-dirty-inode.m4
++++ b/config/kernel-dirty-inode.m4
+@@ -8,11 +8,11 @@ AC_DEFUN([ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS], [
+ AC_MSG_CHECKING([whether sops->dirty_inode() wants flags])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ void dirty_inode (struct inode * a, int b) { return; }
++ static struct super_operations sops __attribute__ ((unused)) = {
++ .dirty_inode = dirty_inode,
++ };
+ ],[
+- void (*dirty_inode) (struct inode *, int) = NULL;
+- struct super_operations sops __attribute__ ((unused));
+-
+- sops.dirty_inode = dirty_inode;
+ ],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_DIRTY_INODE_WITH_FLAGS, 1,
+diff --git a/config/kernel-fallocate.m4 b/config/kernel-fallocate.m4
+index 6ac5ae6..0041ef2 100644
+--- a/config/kernel-fallocate.m4
++++ b/config/kernel-fallocate.m4
+@@ -5,12 +5,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FILE_FALLOCATE], [
+ AC_MSG_CHECKING([whether fops->fallocate() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+- struct file_operations fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
++ long test_fallocate(struct file *file, int mode, loff_t offset, loff_t len) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fallocate = test_fallocate,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
+ ],[
+@@ -25,34 +25,14 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_FALLOCATE], [
+ AC_MSG_CHECKING([whether iops->fallocate() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+- struct inode_operations fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
++ long test_fallocate (struct inode *inode, int mode, loff_t offset, loff_t len) { return 0; }
++ static const struct inode_operations fops __attribute__ ((unused)) = {
++ .fallocate = test_fallocate,
+ };
+ ],[
+- AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+- ],[
+- AC_MSG_RESULT(no)
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.38 - 3.x API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
+- AC_MSG_CHECKING([whether fops->fallocate() exists])
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+- struct file_operations_no_const fops __attribute__ ((unused)) = {
+- .fallocate = fallocate,
+- };
+ ],[
+ AC_MSG_RESULT(yes)
+- AC_DEFINE(HAVE_FILE_FALLOCATE, 1, [fops->fallocate() exists])
++ AC_DEFINE(HAVE_INODE_FALLOCATE, 1, [fops->fallocate() exists])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+@@ -65,5 +45,4 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FALLOCATE], [
+ ZFS_AC_KERNEL_FILE_FALLOCATE
+ ZFS_AC_KERNEL_INODE_FALLOCATE
+- ZFS_AC_PAX_KERNEL_FILE_FALLOCATE
+ ])
+diff --git a/config/kernel-fsync.m4 b/config/kernel-fsync.m4
+index ca00d93..9ac0c79 100644
+--- a/config/kernel-fsync.m4
++++ b/config/kernel-fsync.m4
+@@ -4,11 +4,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITH_DENTRY], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, struct dentry *dentry, int x) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, struct dentry *, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([dentry])
+ AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+@@ -23,11 +23,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, int x) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([no dentry])
+ AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+@@ -42,68 +42,11 @@ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_FSYNC_RANGE], [
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
++ int test_fsync (struct file *f, loff_t a, loff_t b, int c) { return 0; }
++ static const struct file_operations fops __attribute__ ((unused)) = {
++ .fsync = test_fsync,
++ };
+ ],[
+- int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+- struct file_operations fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([range])
+- AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+- [fops->fsync() with range])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.x - 2.6.34 API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, struct dentry *, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([dentry])
+- AC_DEFINE(HAVE_FSYNC_WITH_DENTRY, 1,
+- [fops->fsync() with dentry])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 2.6.35 - Linux 3.0 API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+- ],[
+- AC_MSG_RESULT([no dentry])
+- AC_DEFINE(HAVE_FSYNC_WITHOUT_DENTRY, 1,
+- [fops->fsync() without dentry])
+- ],[
+- ])
+-])
+-
+-dnl #
+-dnl # PaX Linux 3.1 - 3.x API
+-dnl #
+-AC_DEFUN([ZFS_AC_PAX_KERNEL_FSYNC_RANGE], [
+- ZFS_LINUX_TRY_COMPILE([
+- #include <linux/fs.h>
+- ],[
+- int (*fsync) (struct file *, loff_t, loff_t, int) = NULL;
+- file_operations_no_const fops __attribute__ ((unused));
+-
+- fops.fsync = fsync;
+ ],[
+ AC_MSG_RESULT([range])
+ AC_DEFINE(HAVE_FSYNC_RANGE, 1,
+@@ -117,7 +60,4 @@ AC_DEFUN([ZFS_AC_KERNEL_FSYNC], [
+ ZFS_AC_KERNEL_FSYNC_WITH_DENTRY
+ ZFS_AC_KERNEL_FSYNC_WITHOUT_DENTRY
+ ZFS_AC_KERNEL_FSYNC_RANGE
+- ZFS_AC_PAX_KERNEL_FSYNC_WITH_DENTRY
+- ZFS_AC_PAX_KERNEL_FSYNC_WITHOUT_DENTRY
+- ZFS_AC_PAX_KERNEL_FSYNC_RANGE
+ ])
+diff --git a/config/kernel-lookup-nameidata.m4 b/config/kernel-lookup-nameidata.m4
+index 5e30be4..20b8cca 100644
+--- a/config/kernel-lookup-nameidata.m4
++++ b/config/kernel-lookup-nameidata.m4
+@@ -5,13 +5,14 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->lookup() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- struct dentry * (*inode_lookup) (struct inode *,struct dentry *,
+- struct nameidata *) = NULL;
+- struct inode_operations iops __attribute__ ((unused)) = {
++ struct dentry * inode_lookup (struct inode * inode,
++ struct dentry * dentry, struct nameidata * nidata)
++ { return NULL; }
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .lookup = inode_lookup,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LOOKUP_NAMEIDATA, 1,
+ [iops->lookup() operation takes nameidata])
+diff --git a/config/kernel-mkdir-umode-t.m4 b/config/kernel-mkdir-umode-t.m4
+index dd5d94b..ce8aa8f 100644
+--- a/config/kernel-mkdir-umode-t.m4
++++ b/config/kernel-mkdir-umode-t.m4
+@@ -10,12 +10,13 @@ AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [
+ AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*mkdir) (struct inode *,struct dentry *,umode_t) = NULL;
+- struct inode_operations iops __attribute__ ((unused)) = {
++ int mkdir (struct inode * inode, struct dentry * dentry, umode_t umode)
++ { return 0; }
++ static struct inode_operations iops __attribute__ ((unused)) = {
+ .mkdir = mkdir,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
+ [iops->create()/mkdir()/mknod() take umode_t])
+diff --git a/config/kernel-shrink.m4 b/config/kernel-shrink.m4
+index ea748c9..ce4b965 100644
+--- a/config/kernel-shrink.m4
++++ b/config/kernel-shrink.m4
+@@ -8,15 +8,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SHRINK], [
+ AC_MSG_CHECKING([whether super_block has s_shrink])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*shrink)(struct shrinker *, struct shrink_control *sc)
+- __attribute__ ((unused)) = NULL;
+- struct super_block sb __attribute__ ((unused)) = {
++ int shrink(struct shrinker * s, struct shrink_control *sc) { return 0; }
++ static struct super_block sb __attribute__ ((unused)) = {
+ .s_shrink.shrink = shrink,
+ .s_shrink.seeks = DEFAULT_SEEKS,
+ .s_shrink.batch = 0,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SHRINK, 1, [struct super_block has s_shrink])
+
+@@ -29,13 +28,12 @@ AC_DEFUN([ZFS_AC_KERNEL_NR_CACHED_OBJECTS], [
+ AC_MSG_CHECKING([whether sops->nr_cached_objects() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- int (*nr_cached_objects)(struct super_block *)
+- __attribute__ ((unused)) = NULL;
+- struct super_operations sops __attribute__ ((unused)) = {
++ int nr_cached_objects(struct super_block * sb) { return 0; }
++ static struct super_operations sops __attribute__ ((unused)) = {
+ .nr_cached_objects = nr_cached_objects,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_NR_CACHED_OBJECTS, 1,
+ [sops->nr_cached_objects() exists])
+@@ -48,13 +46,12 @@ AC_DEFUN([ZFS_AC_KERNEL_FREE_CACHED_OBJECTS], [
+ AC_MSG_CHECKING([whether sops->free_cached_objects() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+- ],[
+- void (*free_cached_objects)(struct super_block *, int)
+- __attribute__ ((unused)) = NULL;
+- struct super_operations sops __attribute__ ((unused)) = {
++ void free_cached_objects(struct super_block * sb, int x) { return; }
++ static struct super_operations sops __attribute__ ((unused)) = {
+ .free_cached_objects = free_cached_objects,
+ };
+ ],[
++ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FREE_CACHED_OBJECTS, 1,
+ [sops->free_cached_objects() exists])
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch
new file mode 100644
index 000000000000..1dfef6117f1a
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-linux-3.9-compat.patch
@@ -0,0 +1,32 @@
+commit 3d8c9c9de0a5e1f1b496fcef2750a01a45860b04
+Author: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Mon Mar 4 15:52:11 2013 -0500
+
+ Linux 3.9 compat: Undefine GCC_VERSION
+
+ The mainline kernel started defining GCC_VERSION with commit
+ torvalds/linux@3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16. Unfortunately,
+ LZ4 also defines this macro, but the two defintions are incompatible. We
+ undefine GCC_VERSION in lz4.c to handle this.
+
+ Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+
+diff --git a/module/zfs/lz4.c b/module/zfs/lz4.c
+index b9850c0..8afaad1 100644
+--- a/module/zfs/lz4.c
++++ b/module/zfs/lz4.c
+@@ -243,6 +243,14 @@ lz4_decompress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
+ /* Disable restrict */
+ #define restrict
+
++/*
++ * Linux : GCC_VERSION is defined as of 3.9-rc1, so undefine it.
++ * torvalds/linux@3f3f8d2f48acfd8ed3b8e6b7377935da57b27b16
++ */
++#ifdef GCC_VERSION
++#undef GCC_VERSION
++#endif
++
+ #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+
+ #if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__) \ No newline at end of file
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch
new file mode 100644
index 000000000000..5f9f6525e73c
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-vfs-name-length-compatibility.patch
@@ -0,0 +1,36 @@
+From 7f235381a0e501df55ebe2de10b69124e928d175 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Mon, 11 Feb 2013 12:55:24 -0800
+Subject: [PATCH] Add explicit MAXNAMELEN check
+
+It turns out that the Linux VFS doesn't strictly handle all cases
+where a component path name exceeds MAXNAMELEN. It does however
+appear to correctly handle MAXPATHLEN for us.
+
+The right way to handle this appears to be to add an explicit
+check to the zpl_lookup() function. Several in-tree filesystems
+handle this case the same way.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #1279
+---
+ module/zfs/zpl_inode.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
+index e406288..8c8ec24 100644
+--- a/module/zfs/zpl_inode.c
++++ b/module/zfs/zpl_inode.c
+@@ -41,6 +41,9 @@
+ struct inode *ip;
+ int error;
+
++ if (dlen(dentry) > ZFS_MAXNAMELEN)
++ return ERR_PTR(-ENAMETOOLONG);
++
+ crhold(cr);
+ error = -zfs_lookup(dir, dname(dentry), &ip, 0, cr, NULL, NULL);
+ ASSERT3S(error, <=, 0);
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch
new file mode 100644
index 000000000000..81ec15f3e6c7
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc14-zfs_arc_memory_throttle_disable.patch
@@ -0,0 +1,41 @@
+From 546c978bbd3f132a88609cab15ec0e954eaa62b8 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Thu, 21 Feb 2013 12:14:44 -0800
+Subject: [PATCH] Enable zfs_arc_memory_throttle_disable by default
+
+The zfs_arc_memory_throttle_disable module option was introduced
+by commit 0c5493d47059f25ce9dbf20c9fe87655f55102a1 to resolve a
+memory miscalculation which could result in the txg_sync thread
+spinning.
+
+When this was first introduced the default behavior was left
+unchanged until enough real world usage confirmed there were no
+unexpected issues. We've now reached that point. Linux's
+direct reclaim is working as expected so we're enabling this
+behavior by default.
+
+This helps pave the way to retire the spl_kmem_availrmem()
+functionality in the SPL layer. This was the only caller.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #938
+---
+ module/zfs/arc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/zfs/arc.c b/module/zfs/arc.c
+index 09924db..b7499ee 100644
+--- a/module/zfs/arc.c
++++ b/module/zfs/arc.c
+@@ -189,7 +189,7 @@
+ int zfs_arc_grow_retry = 0;
+ int zfs_arc_shrink_shift = 0;
+ int zfs_arc_p_min_shift = 0;
+-int zfs_arc_memory_throttle_disable = 0;
++int zfs_arc_memory_throttle_disable = 1;
+ int zfs_disable_dup_eviction = 0;
+ int zfs_arc_meta_prune = 0;
+
+--
+1.8.1.5
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch
new file mode 100644
index 000000000000..51a81363eac8
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-1-of-3.patch
@@ -0,0 +1,44 @@
+From e2060f922f8526aecf437de4cc4dff4c3cdfae16 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue, 15 May 2012 23:19:32 -0400
+Subject: [PATCH] Revert Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool))
+
+Commit eec8164771bee067c3cd55ed0a16dadeeba276de worked around an issue
+involving direct reclaim through the use of PF_MEMALLOC. Since we
+are reworking thing to use KM_PUSHPAGE so that swap works, we revert
+this patch in favor of the use of KM_PUSHPAGE in the affected areas.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #726
+---
+ module/zfs/txg.c | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/module/zfs/txg.c b/module/zfs/txg.c
+index 5021e44..8d037f7 100644
+--- a/module/zfs/txg.c
++++ b/module/zfs/txg.c
+@@ -372,19 +372,6 @@
+ callb_cpr_t cpr;
+ uint64_t start, delta;
+
+-#ifdef _KERNEL
+- /*
+- * Disable the normal reclaim path for the txg_sync thread. This
+- * ensures the thread will never enter dmu_tx_assign() which can
+- * otherwise occur due to direct reclaim. If this is allowed to
+- * happen the system can deadlock. Direct reclaim call path:
+- *
+- * ->shrink_icache_memory->prune_icache->dispose_list->
+- * clear_inode->zpl_clear_inode->zfs_inactive->dmu_tx_assign
+- */
+- current->flags |= PF_MEMALLOC;
+-#endif /* _KERNEL */
+-
+ txg_thread_enter(tx, &cpr);
+
+ start = delta = 0;
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch
new file mode 100644
index 000000000000..0a4fd26040e7
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-2-of-3.patch
@@ -0,0 +1,56 @@
+From 78d26b8497b3845fc8130981c76214d6788f7a9d Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Mon, 7 May 2012 14:14:45 -0400
+Subject: [PATCH] Revert Fix zpl_writepage() deadlock
+
+The commit, cfc9a5c88f91f7b4d606fce89505e1f404691ea5, to fix deadlocks
+in zpl_writepage() relied on PF_MEMALLOC. That had the effect of
+disabling the direct reclaim path on all allocations originating from
+calls to this function, but it failed to address the actual cause of
+those deadlocks. This led to the same deadlocks being observed with
+swap on zvols, but not with swap on the loop device, which exercises
+this code.
+
+The use of PF_MEMALLOC also had the side effect of permitting
+allocations to be made from ZONE_DMA in instances that did not require
+it. This contributes to the possibility of panics caused by depletion
+of pages from ZONE_DMA.
+
+As such, we revert this patch in favor of a proper fix for both issues.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #726
+---
+ module/zfs/zpl_file.c | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
+index 5ac41c9..2e9f72a 100644
+--- a/module/zfs/zpl_file.c
++++ b/module/zfs/zpl_file.c
+@@ -358,20 +358,7 @@
+ ASSERT(PageLocked(pp));
+ ASSERT(!PageWriteback(pp));
+
+- /*
+- * Disable the normal reclaim path for zpl_putpage(). This
+- * ensures that all memory allocations under this call path
+- * will never enter direct reclaim. If this were to happen
+- * the VM might try to write out additional pages by calling
+- * zpl_putpage() again resulting in a deadlock.
+- */
+- if (current->flags & PF_MEMALLOC) {
+- (void) zfs_putpage(mapping->host, pp, wbc);
+- } else {
+- current->flags |= PF_MEMALLOC;
+- (void) zfs_putpage(mapping->host, pp, wbc);
+- current->flags &= ~PF_MEMALLOC;
+- }
++ (void) zfs_putpage(mapping->host, pp, wbc);
+
+ return (0);
+ }
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch
new file mode 100644
index 000000000000..2eb85754b0f8
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.0_rc9-remove-pfmalloc-3-of-3.patch
@@ -0,0 +1,70 @@
+From a1c889dd6fb04d70439074a9399c9ea8f29f2cdb Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Wed, 16 May 2012 18:16:02 -0400
+Subject: [PATCH] Revert Disable direct reclaim for z_wr_* threads
+
+This commit used PF_MEMALLOC to prevent a memory reclaim deadlock.
+However, commit 49be0ccf1fdc2ce852271d4d2f8b7a9c2c4be6db eliminated
+the invocation of __cv_init(), which was the cause of the deadlock.
+PF_MEMALLOC has the side effect of permitting pages from ZONE_DMA
+to be allocated. The use of PF_MEMALLOC was found to cause stability
+problems when doing swap on zvols. Since this technique is known to
+cause problems and no longer fixes anything, we revert it.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #726
+---
+ include/sys/zfs_context.h | 1 -
+ module/zfs/spa.c | 9 +++------
+ 2 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
+index e4af6fc..77dded3 100644
+--- a/include/sys/zfs_context.h
++++ b/include/sys/zfs_context.h
+@@ -382,7 +382,6 @@ extern kstat_t *kstat_create(char *, int,
+ #define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */
+ #define TASKQ_THREADS_CPU_PCT 0x0008 /* Scale # threads by # cpus */
+ #define TASKQ_DC_BATCH 0x0010 /* Mark threads as batch */
+-#define TASKQ_NORECLAIM 0x0020 /* Disable direct memory reclaim */
+
+ #define TQ_SLEEP KM_SLEEP /* Can block for memory */
+ #define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */
+diff --git a/module/zfs/spa.c b/module/zfs/spa.c
+index c33a33a..436cd26 100644
+--- a/module/zfs/spa.c
++++ b/module/zfs/spa.c
+@@ -617,8 +617,9 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
+
+ static taskq_t *
+ spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode,
+- uint_t value, uint_t flags)
++ uint_t value)
+ {
++ uint_t flags = TASKQ_PREPOPULATE;
+ boolean_t batch = B_FALSE;
+
+ switch (mode) {
+@@ -668,17 +669,13 @@ static inline int spa_load_impl(spa_t *spa, uint64_t, nvlist_t *config,
+ const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
+ enum zti_modes mode = ztip->zti_mode;
+ uint_t value = ztip->zti_value;
+- uint_t flags = 0;
+ char name[32];
+
+- if (t == ZIO_TYPE_WRITE)
+- flags |= TASKQ_NORECLAIM;
+-
+ (void) snprintf(name, sizeof (name),
+ "%s_%s", zio_type_name[t], zio_taskq_types[q]);
+
+ spa->spa_zio_taskq[t][q] =
+- spa_taskq_create(spa, name, mode, value, flags);
++ spa_taskq_create(spa, name, mode, value);
+ }
+ }
+ }
+--
+1.7.10
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch
new file mode 100644
index 000000000000..00ec1057efa1
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-arc-read-panic.patch
@@ -0,0 +1,42 @@
+From 3db3ff4a787acf068b122562fb5be5aecec2611f Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@gentoo.org>
+Date: Tue, 2 Jul 2013 00:07:15 -0400
+Subject: [PATCH] Use MAXPATHLEN instead of sizeof in snprintf
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This silences a GCC 4.8.0 warning by fixing a programming error
+caught by static analysis:
+
+../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’:
+../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’
+ in ‘snprintf’ call is the same expression as the destination;
+ did you mean to provide an explicit length?
+ [-Werror=sizeof-pointer-memaccess]
+ (void) snprintf(path, sizeof (path), ztest_aux_template,
+ ^
+
+Signed-off-by: Richard Yao <ryao@gentoo.org>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1480
+---
+ cmd/ztest/ztest.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
+index b38d7b1..93a5f1e 100644
+--- a/cmd/ztest/ztest.c
++++ b/cmd/ztest/ztest.c
+@@ -2581,7 +2581,7 @@ enum ztest_object {
+ zs->zs_vdev_aux = 0;
+ for (;;) {
+ int c;
+- (void) snprintf(path, sizeof (path), ztest_aux_template,
++ (void) snprintf(path, MAXPATHLEN, ztest_aux_template,
+ ztest_opts.zo_dir, ztest_opts.zo_pool, aux,
+ zs->zs_vdev_aux);
+ for (c = 0; c < sav->sav_count; c++)
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch
new file mode 100644
index 000000000000..ce7d5c0494d9
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-getdents.patch
@@ -0,0 +1,32 @@
+From 8f1e11b6105bf46a4258958eb3dcae2ab21ed8b2 Mon Sep 17 00:00:00 2001
+From: Caleb James DeLisle <calebdelisle@lavabit.com>
+Date: Tue, 16 Apr 2013 05:23:39 -0400
+Subject: [PATCH] Remove .readdir from zpl_file_operations table
+
+The zpl_readdir() function shouldn't be registered as part of
+the zpl_file_operations table, it must only be part of the
+zpl_dir_file_operations table. By removing this callback
+the VFS will now correctly return ENOTDIR when calling
+getdents() on a file.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1404
+---
+ module/zfs/zpl_file.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
+index 9c27b7f..db6a72c 100644
+--- a/module/zfs/zpl_file.c
++++ b/module/zfs/zpl_file.c
+@@ -446,7 +446,6 @@
+ .llseek = generic_file_llseek,
+ .read = zpl_read,
+ .write = zpl_write,
+- .readdir = zpl_readdir,
+ .mmap = zpl_mmap,
+ .fsync = zpl_fsync,
+ #ifdef HAVE_FILE_FALLOCATE
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch
new file mode 100644
index 000000000000..8513e78882b1
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-txg_quiesce-deadlock.patch
@@ -0,0 +1,73 @@
+From 57f5a2008e2e6acf58934cf43c5fdca0faffa73e Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Thu, 25 Apr 2013 16:29:22 -0700
+Subject: [PATCH] Fix txg_quiesce thread deadlock
+
+A deadlock was accidentally introduced by commit e95853a which
+can occur when the system is under memory pressure. What happens
+is that while the txg_quiesce thread is holding the tx->tx_cpu
+locks it enters memory reclaim. In the context of this memory
+reclaim it then issues synchronous I/O to a ZVOL swap device.
+Because the txg_quiesce thread is holding the tx->tx_cpu locks
+a new txg cannot be opened to handle the I/O. Deadlock.
+
+The fix is straight forward. Move the memory allocation outside
+the critical region where the tx->tx_cpu locks are held. And for
+good measure change the offending allocation to KM_PUSHPAGE to
+ensure it never attempts to issue I/O during reclaim.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Issue #1274
+---
+ module/zfs/dsl_pool.c | 2 +-
+ module/zfs/txg.c | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c
+index 704f034..771b265 100644
+--- a/module/zfs/dsl_pool.c
++++ b/module/zfs/dsl_pool.c
+@@ -143,7 +143,7 @@
+ {
+ txg_history_t *th, *rm;
+
+- th = kmem_zalloc(sizeof(txg_history_t), KM_SLEEP);
++ th = kmem_zalloc(sizeof(txg_history_t), KM_PUSHPAGE);
+ mutex_init(&th->th_lock, NULL, MUTEX_DEFAULT, NULL);
+ th->th_kstat.txg = txg;
+ th->th_kstat.state = TXG_STATE_OPEN;
+diff --git a/module/zfs/txg.c b/module/zfs/txg.c
+index c7c3df3..7c820af 100644
+--- a/module/zfs/txg.c
++++ b/module/zfs/txg.c
+@@ -367,6 +367,13 @@
+ tx->tx_open_txg++;
+
+ /*
++ * Now that we've incremented tx_open_txg, we can let threads
++ * enter the next transaction group.
++ */
++ for (c = 0; c < max_ncpus; c++)
++ mutex_exit(&tx->tx_cpu[c].tc_lock);
++
++ /*
+ * Measure how long the txg was open and replace the kstat.
+ */
+ th = dsl_pool_txg_history_get(dp, txg);
+@@ -376,13 +383,6 @@
+ dsl_pool_txg_history_add(dp, tx->tx_open_txg);
+
+ /*
+- * Now that we've incremented tx_open_txg, we can let threads
+- * enter the next transaction group.
+- */
+- for (c = 0; c < max_ncpus; c++)
+- mutex_exit(&tx->tx_cpu[c].tc_lock);
+-
+- /*
+ * Quiesce the transaction group by waiting for everyone to txg_exit().
+ */
+ start = gethrtime();
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch
new file mode 100644
index 000000000000..b4801708ae35
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-1.patch
@@ -0,0 +1,50 @@
+From f706421173c571371afff5e2a2ee0784c5e3f95d Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Wed, 17 Apr 2013 13:07:36 -0700
+Subject: [PATCH] Correctly return ERANGE in getxattr(2)
+
+According to the getxattr(2) man page the ERANGE errno should be
+returned when the size of the value buffer is to small to hold the
+result. Prior to this patch the implementation would just truncate
+the value to size bytes.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1408
+---
+ module/zfs/zpl_xattr.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
+index c03764f..a7e38e6 100644
+--- a/module/zfs/zpl_xattr.c
++++ b/module/zfs/zpl_xattr.c
+@@ -225,6 +225,11 @@
+ goto out;
+ }
+
++ if (size < i_size_read(xip)) {
++ error = -ERANGE;
++ goto out;
++ }
++
+ error = zpl_read_common(xip, value, size, 0, UIO_SYSSPACE, 0, cr);
+ out:
+ if (xip)
+@@ -263,9 +268,12 @@
+ if (!size)
+ return (nv_size);
+
+- memcpy(value, nv_value, MIN(size, nv_size));
++ if (size < nv_size)
++ return (-ERANGE);
++
++ memcpy(value, nv_value, nv_size);
+
+- return (MIN(size, nv_size));
++ return (nv_size);
+ }
+
+ static int
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch
new file mode 100644
index 000000000000..bb4b1c4a3a34
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-xattr-behavior-2.patch
@@ -0,0 +1,37 @@
+From 0377189b884fab7db02a95088e05712c7cf336f7 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Wed, 8 May 2013 09:20:04 -0700
+Subject: [PATCH] Only check directory xattr on ENOENT
+
+When SA xattrs are enabled only fallback to checking the directory
+xattrs when the name is not found as a SA xattr. Otherwise, the SA
+error which should be returned to the caller is overwritten by the
+directory xattr errors. Positive return values indicating success
+will also be immediately returned.
+
+In the case of #1437 the ERANGE error was being correctly returned
+by zpl_xattr_get_sa() only to be overridden with ENOENT which was
+returned by the subsequent unnessisary call to zpl_xattr_get_dir().
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1437
+---
+ module/zfs/zpl_xattr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/module/zfs/zpl_xattr.c b/module/zfs/zpl_xattr.c
+index a7e38e6..eb2c00d 100644
+--- a/module/zfs/zpl_xattr.c
++++ b/module/zfs/zpl_xattr.c
+@@ -288,7 +288,7 @@
+
+ if (zsb->z_use_sa && zp->z_is_sa) {
+ error = zpl_xattr_get_sa(ip, name, value, size);
+- if (error >= 0)
++ if (error != -ENOENT)
+ goto out;
+ }
+
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch
new file mode 100644
index 000000000000..e59c869eed04
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch
@@ -0,0 +1,58 @@
+From ab68b6e5db29abcd20c0c7b12a8c2fa570031c8b Mon Sep 17 00:00:00 2001
+From: Tim Chase <tim@chase2k.com>
+Date: Mon, 24 Jun 2013 22:03:56 -0500
+Subject: [PATCH] Fix zfs_sb_teardown/zfs_resume_fs NULL dereference
+
+Fix a pair of conditions in which a concurrent umount can cause
+NULL pointer dereferences:
+
+* zfs_sb_teardown - prevent a NULL dereference by not calling
+ dmu_objset_pool with a null z_os.
+
+* zfs_resume_fs - don't try to unmount with a null z_os. This
+ change makes the ZoL code more consistent
+ with both Illumos and FreeBSD.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1543
+---
+ module/zfs/zfs_vfsops.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c
+index e618f2b..602c332 100644
+--- a/module/zfs/zfs_vfsops.c
++++ b/module/zfs/zfs_vfsops.c
+@@ -1056,10 +1056,12 @@
+ }
+
+ /*
+- * Drain the iput_taskq to ensure all active references to the
++ * If someone has not already unmounted this file system,
++ * drain the iput_taskq to ensure all active references to the
+ * zfs_sb_t have been handled only then can it be safely destroyed.
+ */
+- taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
++ if (zsb->z_os)
++ taskq_wait(dsl_pool_iput_taskq(dmu_objset_pool(zsb->z_os)));
+
+ /*
+ * Close the zil. NB: Can't close the zil while zfs_inactive
+@@ -1480,10 +1482,11 @@
+
+ if (err) {
+ /*
+- * Since we couldn't reopen zfs_sb_t, force
+- * unmount this file system.
++ * Since we couldn't reopen zfs_sb_t or, setup the
++ * sa framework, force unmount this file system.
+ */
+- (void) zfs_umount(zsb->z_sb);
++ if (zsb->z_os)
++ (void) zfs_umount(zsb->z_sb);
+ }
+ return (err);
+ }
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch
new file mode 100644
index 000000000000..7cca7d1137c8
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch
@@ -0,0 +1,73 @@
+From 76351672c222f28ea1b681097a9eff58a6791555 Mon Sep 17 00:00:00 2001
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Date: Thu, 11 Jul 2013 14:11:32 -0700
+Subject: [PATCH] Fix zfsctl_expire_snapshot() deadlock
+
+It is possible for an automounted snapshot which is expiring to
+deadlock with a manual unmount of the snapshot. This can occur
+because taskq_cancel_id() will block if the task is currently
+executing until it completes. But it will never complete because
+zfsctl_unmount_snapshot() is holding the zsb->z_ctldir_lock which
+zfsctl_expire_snapshot() must acquire.
+
+---------------------- z_unmount/0:2153 ---------------------
+ mutex_lock <blocking on zsb->z_ctldir_lock>
+ zfsctl_unmount_snapshot
+ zfsctl_expire_snapshot
+ taskq_thread
+
+------------------------- zfs:10690 -------------------------
+ taskq_wait_id <waiting for z_unmount to exit>
+ taskq_cancel_id
+ __zfsctl_unmount_snapshot
+ zfsctl_unmount_snapshot <takes zsb->z_ctldir_lock>
+ zfs_unmount_snap
+ zfs_ioc_destroy_snaps_nvl
+ zfsdev_ioctl
+ do_vfs_ioctl
+
+We resolve the deadlock by dropping the zsb->z_ctldir_lock before
+calling __zfsctl_unmount_snapshot(). The lock is only there to
+prevent concurrent modification to the zsb->z_ctldir_snaps AVL
+tree. Moreover, we're careful to remove the zfs_snapentry_t from
+the AVL tree before dropping the lock which ensures no other tasks
+can find it. On failure it's added back to the tree.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
+Closes #1527
+---
+ module/zfs/zfs_ctldir.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c
+index 4fa530b..168f853 100644
+--- a/module/zfs/zfs_ctldir.c
++++ b/module/zfs/zfs_ctldir.c
+@@ -732,7 +732,11 @@ struct inode *
+ sep = avl_find(&zsb->z_ctldir_snaps, &search, NULL);
+ if (sep) {
+ avl_remove(&zsb->z_ctldir_snaps, sep);
++ mutex_exit(&zsb->z_ctldir_lock);
++
+ error = __zfsctl_unmount_snapshot(sep, flags);
++
++ mutex_enter(&zsb->z_ctldir_lock);
+ if (error == EBUSY)
+ avl_add(&zsb->z_ctldir_snaps, sep);
+ else
+@@ -767,7 +771,11 @@ struct inode *
+ while (sep != NULL) {
+ next = AVL_NEXT(&zsb->z_ctldir_snaps, sep);
+ avl_remove(&zsb->z_ctldir_snaps, sep);
++ mutex_exit(&zsb->z_ctldir_lock);
++
+ error = __zfsctl_unmount_snapshot(sep, flags);
++
++ mutex_enter(&zsb->z_ctldir_lock);
+ if (error == EBUSY) {
+ avl_add(&zsb->z_ctldir_snaps, sep);
+ (*count)++;
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch
new file mode 100644
index 000000000000..b1e7d3736db0
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-fix-zvol-initialization-r1.patch
@@ -0,0 +1,167 @@
+diff --git a/module/zfs/spa.c b/module/zfs/spa.c
+index e986e92..65f78b7 100644
+--- a/module/zfs/spa.c
++++ b/module/zfs/spa.c
+@@ -64,6 +64,7 @@
+ #include <sys/zfs_ioctl.h>
+ #include <sys/dsl_scan.h>
+ #include <sys/zfeature.h>
++#include <sys/zvol.h>
+
+ #ifdef _KERNEL
+ #include <sys/bootprops.h>
+@@ -2856,6 +2857,7 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ spa_load_state_t state = SPA_LOAD_OPEN;
+ int error;
+ int locked = B_FALSE;
++ int firstopen = B_FALSE;
+
+ *spapp = NULL;
+
+@@ -2879,6 +2881,8 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ if (spa->spa_state == POOL_STATE_UNINITIALIZED) {
+ zpool_rewind_policy_t policy;
+
++ firstopen = B_TRUE;
++
+ zpool_get_rewind_policy(nvpolicy ? nvpolicy : spa->spa_config,
+ &policy);
+ if (policy.zrp_request & ZPOOL_DO_REWIND)
+@@ -2953,6 +2957,11 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ mutex_exit(&spa_namespace_lock);
+ }
+
++#ifdef _KERNEL
++ if (firstopen)
++ zvol_create_minors(spa->spa_name);
++#endif
++
+ *spapp = spa;
+
+ return (0);
+@@ -4010,6 +4019,10 @@ spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
+ mutex_exit(&spa_namespace_lock);
+ spa_history_log_version(spa, LOG_POOL_IMPORT);
+
++#ifdef _KERNEL
++ zvol_create_minors(pool);
++#endif
++
+ return (0);
+ }
+
+diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
+index 1226b2c..a9184a1 100644
+--- a/module/zfs/zfs_ioctl.c
++++ b/module/zfs/zfs_ioctl.c
+@@ -1268,9 +1268,6 @@ zfs_ioc_pool_import(zfs_cmd_t *zc)
+ error = err;
+ }
+
+- if (error == 0)
+- zvol_create_minors(zc->zc_name);
+-
+ nvlist_free(config);
+
+ if (props)
+diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
+index 43a7bb6..e35c91b 100644
+--- a/module/zfs/zvol.c
++++ b/module/zfs/zvol.c
+@@ -1215,6 +1215,9 @@ zvol_alloc(dev_t dev, const char *name)
+
+ zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
+
++ spin_lock_init(&zv->zv_lock);
++ list_link_init(&zv->zv_next);
++
+ zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock);
+ if (zv->zv_queue == NULL)
+ goto out_kmem;
+@@ -1248,9 +1251,6 @@ zvol_alloc(dev_t dev, const char *name)
+ sizeof (rl_t), offsetof(rl_t, r_node));
+ zv->zv_znode.z_is_zvol = TRUE;
+
+- spin_lock_init(&zv->zv_lock);
+- list_link_init(&zv->zv_next);
+-
+ zv->zv_disk->major = zvol_major;
+ zv->zv_disk->first_minor = (dev & MINORMASK);
+ zv->zv_disk->fops = &zvol_ops;
+@@ -1561,30 +1561,36 @@ zvol_init(void)
+ {
+ int error;
+
++ list_create(&zvol_state_list, sizeof (zvol_state_t),
++ offsetof(zvol_state_t, zv_next));
++ mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
++
+ zvol_taskq = taskq_create(ZVOL_DRIVER, zvol_threads, maxclsyspri,
+ zvol_threads, INT_MAX, TASKQ_PREPOPULATE);
+ if (zvol_taskq == NULL) {
+ printk(KERN_INFO "ZFS: taskq_create() failed\n");
+- return (-ENOMEM);
++ error = -ENOMEM;
++ goto out1;
+ }
+
+ error = register_blkdev(zvol_major, ZVOL_DRIVER);
+ if (error) {
+ printk(KERN_INFO "ZFS: register_blkdev() failed %d\n", error);
+- taskq_destroy(zvol_taskq);
+- return (error);
++ goto out2;
+ }
+
+ blk_register_region(MKDEV(zvol_major, 0), 1UL << MINORBITS,
+ THIS_MODULE, zvol_probe, NULL, NULL);
+
+- mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
+- list_create(&zvol_state_list, sizeof (zvol_state_t),
+- offsetof(zvol_state_t, zv_next));
++ return (0);
+
+- (void) zvol_create_minors(NULL);
++out2:
++ taskq_destroy(zvol_taskq);
++out1:
++ mutex_destroy(&zvol_state_lock);
++ list_destroy(&zvol_state_list);
+
+- return (0);
++ return (error);
+ }
+
+ void
+diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh
+index 141348c..281166c 100755
+--- a/scripts/zconfig.sh
++++ b/scripts/zconfig.sh
+@@ -264,8 +264,9 @@ test_4() {
+ zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
+ ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
+
+- # Load the modules, wait 1 second for udev
++ # Load the modules, list the pools to ensure they are opened
+ ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10
++ ${ZPOOL} list &>/dev/null
+
+ # Verify the devices were created
+ zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
+diff --git a/udev/rules.d/90-zfs.rules.in b/udev/rules.d/90-zfs.rules.in
+index 52e1d63..a2715d2 100644
+--- a/udev/rules.d/90-zfs.rules.in
++++ b/udev/rules.d/90-zfs.rules.in
+@@ -1,4 +1,4 @@
+-SUBSYSTEM!="block", GOTO="zfs_end"
++SUBSYSTEM!="block|misc", GOTO="zfs_end"
+ ACTION!="add|change", GOTO="zfs_end"
+
+ ENV{ID_FS_TYPE}=="zfs", RUN+="/sbin/modprobe zfs"
+@@ -7,4 +7,6 @@ ENV{ID_FS_TYPE}=="zfs_member", RUN+="/sbin/modprobe zfs"
+ KERNEL=="null", SYMLINK+="root"
+ SYMLINK=="null", SYMLINK+="root"
+
++SUBSYSTEM=="misc", KERNEL=="zfs", RUN+="@sbindir@/zpool list"
++
+ LABEL="zfs_end"
diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch
new file mode 100644
index 000000000000..90755a1a527f
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-0.6.1-linux-3.10-compat.patch
@@ -0,0 +1,108 @@
+commit a1d9543a39942be56879ca9338078afc77c25cea
+Author: Chris Dunlop <chris@onthe.net.au>
+Date: Mon Jun 3 16:58:52 2013 +1000
+
+ 3.10 API change: block_device_operations->release() returns void
+
+ Linux kernel commit torvalds/linux@db2a144 changed the return type
+ of block_device_operations->release() to void. Detect the expected
+ prototype and defined our callout accordingly.
+
+ Signed-off-by: Chris Dunlop <chris@onthe.net.au>
+ Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+ Closes #1494
+
+diff --git a/config/kernel-bdev-block-device-operations.m4 b/config/kernel-bdev-block-device-operations.m4
+index 8b5e0a3..faacc19 100644
+--- a/config/kernel-bdev-block-device-operations.m4
++++ b/config/kernel-bdev-block-device-operations.m4
+@@ -10,7 +10,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+
+ int blk_open(struct block_device *bdev, fmode_t mode)
+ { return 0; }
+- int blk_release(struct gendisk *g, fmode_t mode) { return 0; }
+ int blk_ioctl(struct block_device *bdev, fmode_t mode,
+ unsigned x, unsigned long y) { return 0; }
+ int blk_compat_ioctl(struct block_device * bdev, fmode_t mode,
+@@ -19,7 +18,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS], [
+ static const struct block_device_operations
+ bops __attribute__ ((unused)) = {
+ .open = blk_open,
+- .release = blk_release,
++ .release = NULL,
+ .ioctl = blk_ioctl,
+ .compat_ioctl = blk_compat_ioctl,
+ };
+diff --git a/config/kernel-block-device-operations-release-void.m4 b/config/kernel-block-device-operations-release-void.m4
+new file mode 100644
+index 0000000..a73f858
+--- /dev/null
++++ b/config/kernel-block-device-operations-release-void.m4
+@@ -0,0 +1,29 @@
++dnl #
++dnl # 3.10.x API change
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID], [
++ AC_MSG_CHECKING([whether block_device_operations.release is void])
++ tmp_flags="$EXTRA_KCFLAGS"
++ EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
++ ZFS_LINUX_TRY_COMPILE([
++ #include <linux/blkdev.h>
++
++ void blk_release(struct gendisk *g, fmode_t mode) { return; }
++
++ static const struct block_device_operations
++ bops __attribute__ ((unused)) = {
++ .open = NULL,
++ .release = blk_release,
++ .ioctl = NULL,
++ .compat_ioctl = NULL,
++ };
++ ],[
++ ],[
++ AC_MSG_RESULT(void)
++ AC_DEFINE(HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID, 1,
++ [struct block_device_operations.release returns void])
++ ],[
++ AC_MSG_RESULT(int)
++ ])
++ EXTRA_KCFLAGS="$tmp_flags"
++])
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index 7b8e3b0..46c0255 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -7,6 +7,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
+ ZFS_AC_TEST_MODULE
+ ZFS_AC_KERNEL_CONFIG
+ ZFS_AC_KERNEL_BDEV_BLOCK_DEVICE_OPERATIONS
++ ZFS_AC_KERNEL_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
+ ZFS_AC_KERNEL_TYPE_FMODE_T
+ ZFS_AC_KERNEL_KOBJ_NAME_LEN
+ ZFS_AC_KERNEL_3ARG_BLKDEV_GET
+diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
+index e35c91b..b516156 100644
+--- a/module/zfs/zvol.c
++++ b/module/zfs/zvol.c
+@@ -1024,7 +1024,11 @@ out_mutex:
+ return (error);
+ }
+
++#ifdef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
++static void
++#else
+ static int
++#endif
+ zvol_release(struct gendisk *disk, fmode_t mode)
+ {
+ zvol_state_t *zv = disk->private_data;
+@@ -1044,7 +1048,9 @@ zvol_release(struct gendisk *disk, fmode_t mode)
+ if (drop_mutex)
+ mutex_exit(&zvol_state_lock);
+
++#ifndef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
+ return (0);
++#endif
+ }
+
+ static int
diff --git a/sys-fs/zfs-kmod/metadata.xml b/sys-fs/zfs-kmod/metadata.xml
new file mode 100644
index 000000000000..89265acacd16
--- /dev/null
+++ b/sys-fs/zfs-kmod/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <use>
+ <flag name="rootfs">Install zfs-shutdown script to support exporting a pool containing rootfs</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">zfsonlinux/zfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild
new file mode 100644
index 000000000000..fd97e6e7decd
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc13-r4.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ virtual/awk
+ dev-lang/perl
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 8 || die "Linux 3.8 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Fix regression where snapshots are not visible
+ epatch "${FILESDIR}/${P}-fix-invisible-snapshots.patch"
+
+ # Fix deadlock involving concurrent `zfs destroy` and `zfs list` commands
+ epatch "${FILESDIR}/${P}-fix-recursive-reader.patch"
+
+ # Fix USE=debug build failure involving GCC 4.7
+ epatch "${FILESDIR}/${P}-gcc-4.7-compat.patch"
+
+ # Cast constant for 32-bit compatibility
+ epatch "${FILESDIR}/${PN}-0.6.0_rc14-cast-const-for-32bit-compatibility.patch"
+
+ # Handle missing name length check in Linux VFS
+ epatch "${FILESDIR}/${PN}-0.6.0_rc14-vfs-name-length-compatibility.patch"
+
+ # Fix barrier regression on Linux 2.6.37 and later
+ epatch "${FILESDIR}/${PN}-0.6.0_rc14-flush-properly.patch"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild
new file mode 100644
index 000000000000..f8eed927b575
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.0_rc14-r5.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 9 || die "Linux 3.9 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Cast constant for 32-bit compatibility
+ epatch "${FILESDIR}/${P}-cast-const-for-32bit-compatibility.patch"
+
+ # Handle missing name length check in Linux VFS
+ epatch "${FILESDIR}/${P}-vfs-name-length-compatibility.patch"
+
+ # Fix NULL pointer exception on hardened kernels, bug #457176
+ epatch "${FILESDIR}/${P}-improved-hardened-support.patch"
+
+ # Fix barrier regression on Linux 2.6.37 and later
+ epatch "${FILESDIR}/${P}-flush-properly.patch"
+
+ # Improve accuracy of autotools checks
+ epatch "${FILESDIR}/${P}-improved-autotools-checks.patch"
+
+ # Linux 3.9 Support
+ epatch "${FILESDIR}/${P}-linux-3.9-compat.patch"
+
+ # Do not second guess Linux's memory management
+ epatch "${FILESDIR}/${P}-zfs_arc_memory_throttle_disable.patch"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+
+ # Provide /usr/src/zfs symlink for lustre
+ dosym "$(basename $(echo "${ED}/usr/src/zfs-"*))/${KV_FULL}" /usr/src/zfs
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux introduces support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild
new file mode 100644
index 000000000000..add60655a5b7
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.1-r2.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !UIDGID_STRICT_TYPE_CHECKS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 10 || die "Linux 3.10 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Correctness fix for getdents
+ epatch "${FILESDIR}/${P}-fix-getdents.patch"
+
+ # Prevent possible deadlock regression
+ epatch "${FILESDIR}/${P}-fix-txg_quiesce-deadlock.patch"
+
+ # Correctness fixes for xattr
+ epatch "${FILESDIR}/${P}-fix-xattr-behavior-1.patch"
+ epatch "${FILESDIR}/${P}-fix-xattr-behavior-2.patch"
+
+ # Make certain that zvols always appear
+ epatch "${FILESDIR}/${P}-fix-zvol-initialization-r1.patch"
+
+ # Linux 3.10 Compatibility
+ epatch "${FILESDIR}/${PN}-0.6.1-linux-3.10-compat.patch"
+
+ # ARC Read Panic Fix
+ epatch "${FILESDIR}/${PN}-0.6.1-fix-arc-read-panic.patch"
+
+ # Fix zfsctl_expire_snapshot deadlock
+ epatch "${FILESDIR}/${PN}-0.6.1-fix-zfsctl_expire_snapshot-deadlock.patch"
+
+ # Fix NULL pointer dereference in zfsctl_expire_snapshot
+ epatch "${FILESDIR}/${PN}-0.6.1-fix-zfs_sb_teardown-NULL-pointer-deref.patch"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+
+ # Provide /usr/src/zfs symlink for lustre
+ dosym "$(basename $(echo "${ED}/usr/src/zfs-"*))/${KV_FULL}" /usr/src/zfs
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild
new file mode 100644
index 000000000000..2979452fe76a
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r3.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p2.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 12 || die "Linux 3.12 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild
new file mode 100644
index 000000000000..abc989cf389b
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r4.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p3.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild
new file mode 100644
index 000000000000..662180211837
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.2-r5.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit bash-completion-r1 flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="git://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-${MY_PV}-p4.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK} BLK_DEV_INITRD
+ DEVTMPFS"
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 14 || die "Linux 3.14 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-${MY_PV}-patches"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild
new file mode 100644
index 000000000000..d8dba9780223
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.3-r1.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/zfs-${PV}-patches-${PR}.tar.xz"
+ S="${WORKDIR}/zfs-zfs-${PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_RANDKSTACK
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 17 || die "Linux 3.17 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/zfs-${PV}-patches"
+ fi
+
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild
new file mode 100644
index 000000000000..9cce1c34beba
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.3.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_RANDKSTACK
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 16 || die "Linux 3.16 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild
new file mode 100644
index 000000000000..67b57ef87967
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.2.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 4 1 || die "Linux 4.1 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for new feature flags"
+ ewarn "that are incompatible with ZFSOnLinux 0.6.3 and GRUB2 support for"
+ ewarn "/boot with the new feature flags is not yet available."
+ ewarn "Do *NOT* upgrade root pools to use the new feature flags."
+ ewarn "Any new pools will be created with the new feature flags by default"
+ ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
+ ewarn "create a newpool that is backward compatible, use "
+ ewarn "zpool create -o version=28 ..."
+ ewarn "Then explicitly enable older features. Note that the LZ4 feature has"
+ ewarn "been upgraded to support metadata compression and has not been"
+ ewarn "tested against the older GRUB2 code base. GRUB2 support will be"
+ ewarn "updated as soon as the GRUB2 developers and Open ZFS community write"
+ ewarn "GRUB2 patchese that pass mutual review."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild
new file mode 100644
index 000000000000..bad80188a2c2
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-0.6.4.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 32 || die "Linux 2.6.32 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 4 0 || die "Linux 4.0 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for new feature flags"
+ ewarn "that are incompatible with ZFSOnLinux 0.6.3 and GRUB2 support for"
+ ewarn "/boot with the new feature flags is not yet available."
+ ewarn "Do *NOT* upgrade root pools to use the new feature flags."
+ ewarn "Any new pools will be created with the new feature flags by default"
+ ewarn "and will not be compatible with older versions of ZFSOnLinux. To"
+ ewarn "create a newpool that is backward compatible, use "
+ ewarn "zpool create -o version=28 ..."
+ ewarn "Then explicitly enable older features. Note that the LZ4 feature has"
+ ewarn "been upgraded to support metadata compression and has not been"
+ ewarn "tested against the older GRUB2 code base. GRUB2 support will be"
+ ewarn "updated as soon as the GRUB2 developers and Open ZFS community write"
+ ewarn "GRUB2 patchese that pass mutual review."
+}
diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
new file mode 100644
index 000000000000..50318f9e3040
--- /dev/null
+++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+inherit flag-o-matic linux-info linux-mod toolchain-funcs autotools-utils
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2
+ MY_PV=9999
+ EGIT_REPO_URI="https://github.com/zfsonlinux/zfs.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/zfs/archive/zfs-${MY_PV}.tar.gz"
+ S="${WORKDIR}/zfs-zfs-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+DESCRIPTION="Linux ZFS kernel module for sys-fs/zfs"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="CDDL debug? ( GPL-2+ )"
+SLOT="0"
+IUSE="custom-cflags debug +rootfs"
+RESTRICT="debug? ( strip ) test"
+
+DEPEND="
+ =sys-kernel/spl-${PV}*
+ dev-lang/perl
+ virtual/awk
+"
+
+RDEPEND="${DEPEND}
+ !sys-fs/zfs-fuse
+"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ CONFIG_CHECK="!DEBUG_LOCK_ALLOC
+ BLK_DEV_LOOP
+ EFI_PARTITION
+ IOSCHED_NOOP
+ MODULES
+ !PAX_KERNEXEC_PLUGIN_METHOD_OR
+ !PAX_USERCOPY_SLABS
+ ZLIB_DEFLATE
+ ZLIB_INFLATE
+ "
+
+ use debug && CONFIG_CHECK="${CONFIG_CHECK}
+ FRAME_POINTER
+ DEBUG_INFO
+ !DEBUG_INFO_REDUCED
+ "
+
+ use rootfs && \
+ CONFIG_CHECK="${CONFIG_CHECK}
+ BLK_DEV_INITRD
+ DEVTMPFS
+ "
+
+ kernel_is ge 2 6 26 || die "Linux 2.6.26 or newer required"
+
+ [ ${PV} != "9999" ] && \
+ { kernel_is le 3 16 || die "Linux 3.16 is the latest supported version."; }
+
+ check_extra_config
+}
+
+src_prepare() {
+ # Remove GPLv2-licensed ZPIOS unless we are debugging
+ use debug || sed -e 's/^subdir-m += zpios$//' -i "${S}/module/Makefile.in"
+
+ # Set module revision number
+ [ ${PV} != "9999" ] && \
+ { sed -i "s/\(Release:\)\(.*\)1/\1\2${PR}-gentoo/" "${S}/META" || die "Could not set Gentoo release"; }
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local SPL_PATH="$(basename $(echo "${EROOT}usr/src/spl-"*))"
+ use custom-cflags || strip-flags
+ filter-ldflags -Wl,*
+
+ set_arch_to_kernel
+ local myeconfargs=(${myeconfargs}
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=kernel
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-spl="${EROOT}usr/src/${SPL_PATH}"
+ --with-spl-obj="${EROOT}usr/src/${SPL_PATH}/${KV_FULL}"
+ $(use_enable debug)
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install INSTALL_MOD_PATH="${INSTALL_MOD_PATH:-$EROOT}"
+ dodoc AUTHORS COPYRIGHT DISCLAIMER README.markdown
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ # Remove old modules
+ if [ -d "${EROOT}lib/modules/${KV_FULL}/addon/zfs" ]
+ then
+ ewarn "${PN} now installs modules in ${EROOT}lib/modules/${KV_FULL}/extra/zfs"
+ ewarn "Old modules were detected in ${EROOT}lib/modules/${KV_FULL}/addon/zfs"
+ ewarn "Automatically removing old modules to avoid problems."
+ rm -r "${EROOT}lib/modules/${KV_FULL}/addon/zfs" || die "Cannot remove modules"
+ rmdir --ignore-fail-on-non-empty "${EROOT}lib/modules/${KV_FULL}/addon"
+ fi
+
+ if use x86 || use arm
+ then
+ ewarn "32-bit kernels will likely require increasing vmalloc to"
+ ewarn "at least 256M and decreasing zfs_arc_max to some value less than that."
+ fi
+
+ ewarn "This version of ZFSOnLinux includes support for features flags."
+ ewarn "If you upgrade your pools to make use of feature flags, you will lose"
+ ewarn "the ability to import them using older versions of ZFSOnLinux."
+ ewarn "Any new pools will be created with feature flag support and will"
+ ewarn "not be compatible with older versions of ZFSOnLinux. To create a new"
+ ewarn "pool that is backward compatible, use zpool create -o version=28 ..."
+}
diff --git a/sys-fs/zfs/Manifest b/sys-fs/zfs/Manifest
new file mode 100644
index 000000000000..415ec6f0f4ad
--- /dev/null
+++ b/sys-fs/zfs/Manifest
@@ -0,0 +1,13 @@
+DIST zfs-0.6.0-rc13.tar.gz 1490582 SHA256 3e689fc0704237c7d755c65e34ed214a262535afefafde4aef0f112f8c833a09 SHA512 c9bbf1fb7f293a0f5b1247e17c411073994bf419d5f6c1b781efeeb4022f62851e8ea3cf7ee0330b0609bfe13b8084c48f00e942ce52323d706733cccf49699e WHIRLPOOL 97083a6f5d66addc9bc7b3cc3f7dd3bc1696980affbd4033d71cd09ecad413ffb666a8a185dfa2e4f20dd4003746ad61d12142f7a6556db5b34008716c933798
+DIST zfs-0.6.0-rc14.tar.gz 1527612 SHA256 5eae8ef790b26e0dd7c801cc0a235a631ad91d67f148a444d912dbeb24b9a12d SHA512 ad38544ced150ce500c78507782e53a8534815b819e5b9aefda6d670fb7905e31a42cdb4d45164700df48673ea7c42bd1d29a60f1f00e25271b3906de9212d15 WHIRLPOOL cfd4de541eb6c18ee4df8950883525d1b1887e0d9c5f840d97353a5d716ed639f1ab3dc0fe4d8368a890564f10053026bcc738b6066c4488647f1b83be54288d
+DIST zfs-0.6.1.tar.gz 1535521 SHA256 42ed127f74af0ecafc14800a5d2b766655f5ea821098aba92446c1c447093fad SHA512 ef583639f15a5b2e4582760bb013ab5091abc15bae17884d811afec707aff337248102a22fb9fb6f62f99cb3477a8ae82edfdcfdfb962276f593173a5dfe5871 WHIRLPOOL a6791fc2d384e03073abc850f99ba761afd18073337264d8a7bc08b4ddc6fff52df5ce11addc9a3ac7cdfdd9ce9bd779208e515cda631ec19de05fbf9f92307b
+DIST zfs-0.6.2.tar.gz 1558656 SHA256 91b844bf7a42df22d7533e8004289270b7859b8fcbca3bff8087a79b131318b4 SHA512 008f9decdea3e92f6d74f5369ec9df5776b15efbb9f2bc01012999b71e1f2bc5b46b310a329b60545907dcc78773ec79eb6d21aca49d911f33299fd0a36e1a4b WHIRLPOOL 587279866b6ffa2bfebc91f00cb28de85f7f186426a0292f44c6cde7ca3a51c1911fc0ee431c25c3ee0866174522f90ce04b54de4aa3dc0829ba3a719e47af58
+DIST zfs-0.6.3-patches-r1.tar.xz 87852 SHA256 71b5286f77cb6a6c2b97cee406dfd4788f7b40b6675c4a56fc630a47e90d5280 SHA512 e2fa573c7b30a3811e9e1596d35b65f5d013ed5bac43e364b44ffab734398a3294979c152a80ec9a722611cc7c971aec217d8e1a37cc9240a3fa2dddb5b90e3b WHIRLPOOL f2da02d5c7d2385e7de1e858c31d299632ca864d422f0c94e5d3b8674d24beeb073ad2600698350306a9e70dbeef390f0e513d19c126502fceec18795c203d50
+DIST zfs-0.6.3.tar.gz 1665270 SHA256 00caeae63cc724d3dd741aeb36fd2dc03d2158794bd6a5e925cdc8d7e5d3da8c SHA512 8c7741f5f227eb031d79fe87bf7d60e790a098fa6caede462d556c97d798832f97f5a377cbb74fc99b8d198e5f3cc1a3491f69fcdaa0408933dbadd132013416 WHIRLPOOL db9791da12c441c89667b194154b209f5aa69ea46d5327cfcde0b3a910cf1f0e5ca448909824e45b31252a1907280b711fb6ba04eb313d09de0ffbf5e6e304fe
+DIST zfs-0.6.4.2.tar.gz 1738601 SHA256 26af2924cbb891b79203a31827cba4cdc310162d5f7b9e2d643eb6576aa19015 SHA512 87a28997b8f9d36e189410171db583402418a55782b7b7f333993e98c5e17ccc4b6cd5825f38b904294c87e3dfdfb7748bd71cc371589c1358f16c942e0c18db WHIRLPOOL 1700de7da56311a7b608c99a821e2fa97a6145ccc88f3d8eff12f778421ba7b7b9cc5f5fbe5f1acd2ea2fd1db778c200a2ea961e3859a8fc89d80474894293f1
+DIST zfs-0.6.4.tar.gz 1735736 SHA256 7f37aaaa1fc15201dde58bb84e0f191ccac462f19ffec0c889b6f6ed3f73a804 SHA512 cf47cbf5fa8dff75f5e9d81b323f5745d7b210266ba9e6ccab16bbf0e2b055aa1168bad94a77a4bc56c6fbe0391593f210bd4c74f7a8d0d99385ac4dd61e5622 WHIRLPOOL 1b0cc8a9727b57f2e63bd106cd94780002a068b31668b9dc103dbc0b48858a380d7c228f39f0526fc84b9d10aca1bd376ace0346a2ef4306a9d164c2d56606f1
+DIST zfs-kmod-0.6.2-p0.tar.xz 8244 SHA256 84456e1d52c6d44cc377d131ee34c042c289d00f74e7a9b521d8ef82bdfcf369 SHA512 ff29830e44aeb537d82d2c34070a245271b51013131f9191d03ab35eff2b86559c4bdadd3cf21f7aa7bec07c3556ef712db9cca2beedd1288036c29d750567e2 WHIRLPOOL 62b9a920a832f5715a24c2a0cdc914a5e77700b0e8723df868b1bf8b8a7ecec6f7df14cb294dfb4f4f219cc8253615c594b609a117b57b576e1796b8042bfdc5
+DIST zfs-kmod-0.6.2-p1.tar.xz 15988 SHA256 0d5ee6d53f6ba694937a9c1f009a0c18519e56cfcd328e5a42a0486f967608e5 SHA512 77b4f167073fa1be2501889f6795972a370c90b58dca121c95c38d98b37fa092ad043e5ab447e677f2207da7119b9fd2c940990bec83118edf18daff2eccaa16 WHIRLPOOL 730347f5d6c7449f309f6b53cdbcbb77b94c35385cebdb5a953f851f01d26c87d615b8ef673a7346f8351e01237833e18ed2fc7cca78bb200e7537222b3e46e2
+DIST zfs-kmod-0.6.2-p2.tar.xz 28636 SHA256 12882463a38a5a57cf2bb3c14c5783f9511f6dc7b163a47575f2f3dcc24f26f6 SHA512 5792660ae8f5013d12e70d608e9cffa92a8c4089a88a5e78728ee88204b3f970d452d5b0b3874e02be49ebbc139e07139be7b5a86ca40bc8b23cb11a7198a9a8 WHIRLPOOL 0e4c57b363cdd3d736efbd1355567b18e22439bd3b20ef40b27f6b97ad4570c7cc99a11b196ac25359d1966c1a70e178f4fd1687b60450f148ccda47b07282a9
+DIST zfs-kmod-0.6.2-p3.tar.xz 45988 SHA256 4af06d1472f5d24e01d147b6fec5c78fbbd9739d1259bd3fbf57af66c99b9bcb SHA512 eddf67c0aa49d42f663f98dc721bac75e8d0521df5ae174cd6aeee0a935a71b49e06961404eb6c71a09cd239358868a2fe49de4f1d26776948f8fe7fc943165c WHIRLPOOL 5634a92f6f322f67edef95ad121b0b1699e520ca8beb05b3385dc7e20198dd45d337731bf7df69d1b1c552ed0b78d54b15bc9c9e76b694ae4c8d360892b9d764
+DIST zfs-kmod-0.6.2-p4.tar.xz 63984 SHA256 9167edc4be86e3fcda6b3c198e51f92ab0c95ac5baca11666c28029a628cdac9 SHA512 13e4ec415c35d2f268d89565745f5898c0943423577a2ba6714b3a069c5a80f244cd06dff91464f38dd4ed60673d1145ead080bb03a56d4be33e328f948ffa64 WHIRLPOOL 8c399ec67119ed4fbebb5599d00f888918678bc4e4ea369b4bdc5c75bfc90fc76396087624c8011de370a54ff103bccaa8922d05ac7ccebb2b3481bbbcf44b19
diff --git a/sys-fs/zfs/files/bash-completion b/sys-fs/zfs/files/bash-completion
new file mode 100644
index 000000000000..1b9428bf8602
--- /dev/null
+++ b/sys-fs/zfs/files/bash-completion
@@ -0,0 +1,232 @@
+# Copyright (c) 2010, Aneurin Price <aneurin.price@gmail.com>
+
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+__zfs_get_commands()
+{
+ zfs 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq
+}
+
+__zfs_get_properties()
+{
+ zfs get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all
+}
+
+__zfs_get_editable_properties()
+{
+ zfs get 2>&1 | awk '$2 == "YES" {printf("%s=\n", $1)}'
+}
+
+__zfs_get_inheritable_properties()
+{
+ zfs get 2>&1 | awk '$3 == "YES" {print $1}'
+}
+
+__zfs_list_datasets()
+{
+ zfs list -H -o name
+}
+
+__zfs_list_filesystems()
+{
+ zfs list -H -o name -t filesystem
+}
+
+__zfs_list_snapshots()
+{
+ zfs list -H -o name -t snapshot
+}
+
+__zfs_list_volumes()
+{
+ zfs list -H -o name -t volume
+}
+
+__zfs_argument_chosen()
+{
+ for word in $(seq $((COMP_CWORD-1)) -1 2)
+ do
+ local prev="${COMP_WORDS[$word]}"
+ for property in $@
+ do
+ if [ "x$prev" = "x$property" ]
+ then
+ return 0
+ fi
+ done
+ done
+ return 1
+}
+
+__zfs_complete_ordered_arguments()
+{
+ local list1=$1
+ local list2=$2
+ local cur=$3
+ local extra=$4
+ if __zfs_argument_chosen $list1
+ then
+ COMPREPLY=($(compgen -W "$list2 $extra" -- "$cur"))
+ else
+ COMPREPLY=($(compgen -W "$list1 $extra" -- "$cur"))
+ fi
+}
+
+__zfs_complete()
+{
+ local cur prev cmd cmds
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ cmd="${COMP_WORDS[1]}"
+ cmds=$(__zfs_get_commands)
+
+ if [ "${prev##*/}" = "zfs" ]
+ then
+ COMPREPLY=($(compgen -W "$cmds -?" -- "$cur"))
+ return 0
+ fi
+
+ case "${cmd}" in
+ clone)
+ __zfs_complete_ordered_arguments "$(__zfs_list_snapshots)" "$(__zfs_list_filesystems) $(__zfs_list_volumes)" $cur
+ return 0
+ ;;
+ get)
+ __zfs_complete_ordered_arguments "$(__zfs_get_properties)" "$(__zfs_list_datasets)" "$cur" "-H -r -p"
+ return 0
+ ;;
+ inherit)
+ __zfs_complete_ordered_arguments "$(__zfs_get_inheritable_properties)" "$(__zfs_list_datasets)" $cur
+ return 0
+ ;;
+ list)
+ if [ "x$prev" = "x-o" ]
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_get_properties)" -- "${cur##*,}"))
+ local existing_opts=$(expr "$cur" : '\(.*,\)')
+ if [ ! "x$existing_opts" = "x" ]
+ then
+ COMPREPLY=( "${COMPREPLY[@]/#/${existing_opts}}" )
+ fi
+ else
+ COMPREPLY=($(compgen -W "$(__zfs_list_datasets) -H -r -o" -- "$cur"))
+ fi
+ return 0
+ ;;
+ promote)
+ COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur"))
+ return 0
+ ;;
+ rollback|send)
+ COMPREPLY=($(compgen -W "$(__zfs_list_snapshots)" -- "$cur"))
+ return 0
+ ;;
+ snapshot)
+ COMPREPLY=($(compgen -W "$(__zfs_list_filesystems) $(__zfs_list_volumes)" -- "$cur"))
+ return 0
+ ;;
+ set)
+ __zfs_complete_ordered_arguments "$(__zfs_get_editable_properties)" "$(__zfs_list_filesystems) $(__zfs_list_volumes)" $cur
+ return 0
+ ;;
+ *)
+ COMPREPLY=($(compgen -W "$(__zfs_list_datasets)" -- "$cur"))
+ return 0
+ ;;
+ esac
+
+}
+
+__zpool_get_commands()
+{
+ zpool 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq
+}
+
+__zpool_get_properties()
+{
+ zpool get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all
+}
+
+__zpool_get_editable_properties()
+{
+ zpool get 2>&1 | awk '$2 == "YES" {printf("%s=\n", $1)}'
+}
+
+__zpool_list_pools()
+{
+ zpool list -H -o name
+}
+
+__zpool_complete()
+{
+ local cur prev cmd cmds
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ cmd="${COMP_WORDS[1]}"
+ cmds=$(__zpool_get_commands)
+
+ if [ "${prev##*/}" = "zpool" ]
+ then
+ COMPREPLY=($(compgen -W "$cmds" -- "$cur"))
+ return 0
+ fi
+
+ case "${cmd}" in
+ get)
+ __zfs_complete_ordered_arguments "$(__zpool_get_properties)" "$(__zpool_list_pools)" $cur
+ return 0
+ ;;
+ import)
+ if [ "x$prev" = "x-d" ]
+ then
+ _filedir -d
+ else
+ COMPREPLY=($(compgen -W "$(__zpool_list_pools) -d" -- "$cur"))
+ fi
+ return 0
+ ;;
+ set)
+ __zfs_complete_ordered_arguments "$(__zpool_get_editable_properties)" "$(__zpool_list_pools)" $cur
+ return 0
+ ;;
+ add|attach|clear|create|detach|offline|online|remove|replace)
+ local pools="$(__zpool_list_pools)"
+ if __zfs_argument_chosen $pools
+ then
+ _filedir
+ else
+ COMPREPLY=($(compgen -W "$pools" -- "$cur"))
+ fi
+ return 0
+ ;;
+ *)
+ COMPREPLY=($(compgen -W "$(__zpool_list_pools)" -- "$cur"))
+ return 0
+ ;;
+ esac
+
+}
+
+complete -F __zfs_complete zfs
+complete -o filenames -F __zpool_complete zpool
diff --git a/sys-fs/zfs/files/bash-completion-r1 b/sys-fs/zfs/files/bash-completion-r1
new file mode 100644
index 000000000000..b1aded368e85
--- /dev/null
+++ b/sys-fs/zfs/files/bash-completion-r1
@@ -0,0 +1,391 @@
+# Copyright (c) 2013, Aneurin Price <aneurin.price@gmail.com>
+
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation
+# files (the "Software"), to deal in the Software without
+# restriction, including without limitation the rights to use,
+# copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following
+# conditions:
+
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+
+#if [[ -w /dev/zfs ]]; then
+ __ZFS_CMD="zfs"
+ __ZPOOL_CMD="zpool"
+#else
+# __ZFS_CMD="sudo zfs"
+# __ZPOOL_CMD="sudo zpool"
+#fi
+
+__zfs_get_commands()
+{
+ $__ZFS_CMD 2>&1 | awk '/^\t[a-z]/ {print $1}' | cut -f1 -d '|' | uniq
+}
+
+__zfs_get_properties()
+{
+ $__ZFS_CMD get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all name space
+}
+
+__zfs_get_editable_properties()
+{
+ $__ZFS_CMD get 2>&1 | awk '$2 == "YES" {print $1"="}'
+}
+
+__zfs_get_inheritable_properties()
+{
+ $__ZFS_CMD get 2>&1 | awk '$3 == "YES" {print $1}'
+}
+
+__zfs_list_datasets()
+{
+ $__ZFS_CMD list -H -o name -t filesystem,volume
+}
+
+__zfs_list_filesystems()
+{
+ $__ZFS_CMD list -H -o name -t filesystem
+}
+
+__zfs_match_snapshot()
+{
+ local base_dataset=${cur%@*}
+ if [[ $base_dataset != $cur ]]
+ then
+ $__ZFS_CMD list -H -o name -t snapshot -d 1 $base_dataset
+ else
+ $__ZFS_CMD list -H -o name -t filesystem,volume | awk '{print $1"@"}'
+ fi
+}
+
+__zfs_match_explicit_snapshot()
+{
+ local base_dataset=${cur%@*}
+ if [[ $base_dataset != $cur ]]
+ then
+ $__ZFS_CMD list -H -o name -t snapshot -d 1 $base_dataset
+ fi
+}
+
+__zfs_match_multiple_snapshots()
+{
+ local existing_opts=$(expr "$cur" : '\(.*\)[%,]')
+ if [[ $existing_opts ]]
+ then
+ local base_dataset=${cur%@*}
+ if [[ $base_dataset != $cur ]]
+ then
+ local cur=${cur##*,}
+ if [[ $cur =~ ^%|%.*% ]]
+ then
+ # correct range syntax is start%end
+ return 1
+ fi
+ local range_start=$(expr "$cur" : '\(.*%\)')
+ $__ZFS_CMD list -H -o name -t snapshot -d 1 $base_dataset | sed 's$.*@$'$range_start'$g'
+ fi
+ else
+ __zfs_match_explicit_snapshot; __zfs_list_datasets
+ fi
+}
+
+__zfs_list_volumes()
+{
+ $__ZFS_CMD list -H -o name -t volume
+}
+
+__zfs_argument_chosen()
+{
+ local word property
+ for word in $(seq $((COMP_CWORD-1)) -1 2)
+ do
+ local prev="${COMP_WORDS[$word]}"
+ if [[ ${COMP_WORDS[$word-1]} != -[tos] ]]
+ then
+ if [[ "$prev" == [^,]*,* ]] || [[ "$prev" == *[@:]* ]]
+ then
+ return 0
+ fi
+ for property in $@
+ do
+ if [[ $prev == "$property" ]]
+ then
+ return 0
+ fi
+ done
+ fi
+ done
+ return 1
+}
+
+__zfs_complete_ordered_arguments()
+{
+ local list1=$1
+ local list2=$2
+ local cur=$3
+ local extra=$4
+ if __zfs_argument_chosen $list1
+ then
+ COMPREPLY=($(compgen -W "$list2 $extra" -- "$cur"))
+ else
+ COMPREPLY=($(compgen -W "$list1 $extra" -- "$cur"))
+ fi
+}
+
+__zfs_complete_multiple_options()
+{
+ local options=$1
+ local cur=$2
+
+ COMPREPLY=($(compgen -W "$options" -- "${cur##*,}"))
+ local existing_opts=$(expr "$cur" : '\(.*,\)')
+ if [[ $existing_opts ]]
+ then
+ COMPREPLY=( "${COMPREPLY[@]/#/${existing_opts}}" )
+ fi
+}
+
+__zfs_complete_switch()
+{
+ local options=$1
+ if [[ ${cur:0:1} == - ]]
+ then
+ COMPREPLY=($(compgen -W "-{$options}" -- "$cur"))
+ return 0
+ else
+ return 1
+ fi
+}
+
+__zfs_complete()
+{
+ local cur prev cmd cmds
+ COMPREPLY=()
+ # Don't split on colon
+ _get_comp_words_by_ref -n : -c cur -p prev -w COMP_WORDS -i COMP_CWORD
+ cmd="${COMP_WORDS[1]}"
+
+ if [[ ${prev##*/} == zfs ]]
+ then
+ cmds=$(__zfs_get_commands)
+ COMPREPLY=($(compgen -W "$cmds -?" -- "$cur"))
+ return 0
+ fi
+
+ case "${cmd}" in
+ clone)
+ case "${prev}" in
+ -o)
+ COMPREPLY=($(compgen -W "$(__zfs_get_editable_properties)" -- "$cur"))
+ ;;
+ *)
+ if ! __zfs_complete_switch "o,p"
+ then
+ if __zfs_argument_chosen
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_list_datasets)" -- "$cur"))
+ else
+ COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur"))
+ fi
+ fi
+ ;;
+ esac
+ ;;
+ get)
+ case "${prev}" in
+ -d)
+ COMPREPLY=($(compgen -W "" -- "$cur"))
+ ;;
+ -t)
+ __zfs_complete_multiple_options "filesystem volume snapshot all" "$cur"
+ ;;
+ -s)
+ __zfs_complete_multiple_options "local default inherited temporary none" "$cur"
+ ;;
+ -o)
+ __zfs_complete_multiple_options "name property value source received all" "$cur"
+ ;;
+ *)
+ if ! __zfs_complete_switch "H,r,p,d,o,t,s"
+ then
+ if __zfs_argument_chosen $(__zfs_get_properties)
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" -- "$cur"))
+ else
+ __zfs_complete_multiple_options "$(__zfs_get_properties)" "$cur"
+ fi
+ fi
+ ;;
+ esac
+ ;;
+ inherit)
+ if ! __zfs_complete_switch "r"
+ then
+ __zfs_complete_ordered_arguments "$(__zfs_get_inheritable_properties)" "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" $cur
+ fi
+ ;;
+ list)
+ case "${prev}" in
+ -d)
+ COMPREPLY=($(compgen -W "" -- "$cur"))
+ ;;
+ -t)
+ __zfs_complete_multiple_options "filesystem volume snapshot all" "$cur"
+ ;;
+ -o)
+ __zfs_complete_multiple_options "$(__zfs_get_properties)" "$cur"
+ ;;
+ -s|-S)
+ COMPREPLY=($(compgen -W "$(__zfs_get_properties)" -- "$cur"))
+ ;;
+ *)
+ if ! __zfs_complete_switch "H,r,d,o,t,s,S"
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" -- "$cur"))
+ fi
+ ;;
+ esac
+ ;;
+ promote)
+ COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur"))
+ ;;
+ rollback)
+ if ! __zfs_complete_switch "r,R,f"
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur"))
+ fi
+ ;;
+ send)
+ if ! __zfs_complete_switch "d,n,P,p,R,v,i,I"
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_match_snapshot)" -- "$cur"))
+ fi
+ ;;
+ snapshot)
+ case "${prev}" in
+ -o)
+ COMPREPLY=($(compgen -W "$(__zfs_get_editable_properties)" -- "$cur"))
+ ;;
+ *)
+ if ! __zfs_complete_switch "o,r"
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_list_datasets | awk '{print $1"@"}')" -- "$cur"))
+ fi
+ ;;
+ esac
+ ;;
+ set)
+ __zfs_complete_ordered_arguments "$(__zfs_get_editable_properties)" "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" $cur
+ ;;
+ upgrade)
+ case "${prev}" in
+ -a|-V|-v)
+ COMPREPLY=($(compgen -W "" -- "$cur"))
+ ;;
+ *)
+ if ! __zfs_complete_switch "a,V,v,r"
+ then
+ COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur"))
+ fi
+ ;;
+ esac
+ ;;
+ destroy)
+ if ! __zfs_complete_switch "d,f,n,p,R,r,v"
+ then
+ __zfs_complete_multiple_options "$(__zfs_match_multiple_snapshots)" $cur
+ fi
+ ;;
+ *)
+ COMPREPLY=($(compgen -W "$(__zfs_match_explicit_snapshot) $(__zfs_list_datasets)" -- "$cur"))
+ ;;
+ esac
+ __ltrim_colon_completions "$cur"
+ return 0
+}
+
+__zpool_get_commands()
+{
+ $__ZPOOL_CMD 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq
+}
+
+__zpool_get_properties()
+{
+ $__ZPOOL_CMD get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all
+}
+
+__zpool_get_editable_properties()
+{
+ $__ZPOOL_CMD get 2>&1 | awk '$2 == "YES" {print $1"="}'
+}
+
+__zpool_list_pools()
+{
+ $__ZPOOL_CMD list -H -o name
+}
+
+__zpool_complete()
+{
+ local cur prev cmd cmds
+ COMPREPLY=()
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ cmd="${COMP_WORDS[1]}"
+
+ if [[ ${prev##*/} == zpool ]]
+ then
+ cmds=$(__zpool_get_commands)
+ COMPREPLY=($(compgen -W "$cmds" -- "$cur"))
+ return 0
+ fi
+
+ case "${cmd}" in
+ get)
+ __zfs_complete_ordered_arguments "$(__zpool_get_properties)" "$(__zpool_list_pools)" $cur
+ return 0
+ ;;
+ import)
+ if [[ $prev == -d ]]
+ then
+ _filedir -d
+ else
+ COMPREPLY=($(compgen -W "$(__zpool_list_pools) -d" -- "$cur"))
+ fi
+ return 0
+ ;;
+ set)
+ __zfs_complete_ordered_arguments "$(__zpool_get_editable_properties)" "$(__zpool_list_pools)" $cur
+ return 0
+ ;;
+ add|attach|clear|create|detach|offline|online|remove|replace)
+ local pools="$(__zpool_list_pools)"
+ if __zfs_argument_chosen $pools
+ then
+ _filedir
+ else
+ COMPREPLY=($(compgen -W "$pools" -- "$cur"))
+ fi
+ return 0
+ ;;
+ *)
+ COMPREPLY=($(compgen -W "$(__zpool_list_pools)" -- "$cur"))
+ return 0
+ ;;
+ esac
+
+}
+
+complete -F __zfs_complete zfs
+complete -F __zpool_complete zpool
diff --git a/sys-fs/zfs/files/zed b/sys-fs/zfs/files/zed
new file mode 100755
index 000000000000..f963d47070ed
--- /dev/null
+++ b/sys-fs/zfs/files/zed
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need zfs
+}
+
+start() {
+ ebegin "Starting ZFS Event daemon"
+
+ checkpath -q -d -m 0755 /var/run/zed
+
+ start-stop-daemon --start -q \
+ --exec /sbin/zed -- -M \
+ -p /var/run/zed/pid
+ eend $?
+
+}
+
+stop() {
+ebegin "Stopping ZFS Event daemon"
+ start-stop-daemon --stop -q --pidfile /var/run/zed/pid
+eend $?
+}
diff --git a/sys-fs/zfs/files/zfs-0.6.0_rc14-fix-libzpool-function-relocations.patch b/sys-fs/zfs/files/zfs-0.6.0_rc14-fix-libzpool-function-relocations.patch
new file mode 100644
index 000000000000..b493424a1e77
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.0_rc14-fix-libzpool-function-relocations.patch
@@ -0,0 +1,34 @@
+From 399f60c8b47f7513d078a7c181ff132e2cafdd15 Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue, 5 Feb 2013 18:14:30 -0500
+Subject: [PATCH] Fix function relocations in libzpool
+
+binutils 2.23.1 fails in situations that generate function relocations
+on PowerPC and possibly other architectures. This causes linking of
+libzpool to fail because it depends on libnvpair. We add a dependency on
+libnvpair to lib/libzpool/Makefile.am to correct that.
+
+Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1267
+---
+ lib/libzpool/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am
+index 3e62de6..cbba388 100644
+--- a/lib/libzpool/Makefile.am
++++ b/lib/libzpool/Makefile.am
+@@ -94,7 +94,8 @@ libzpool_la_SOURCES = \
+
+ libzpool_la_LIBADD = \
+ $(top_builddir)/lib/libunicode/libunicode.la \
+- $(top_builddir)/lib/libuutil/libuutil.la
++ $(top_builddir)/lib/libuutil/libuutil.la \
++ $(top_builddir)/lib/libnvpair/libnvpair.la
+
+ libzpool_la_LDFLAGS = -pthread -version-info 1:1:0
+
+--
+1.7.10
+
diff --git a/sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch b/sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch
new file mode 100644
index 000000000000..f73840feeed6
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.1-avoid-zdb-abort.patch
@@ -0,0 +1,30 @@
+From 5d3dc3fb72518a4c191e3a014622b74365eb3a74 Mon Sep 17 00:00:00 2001
+From: Mike Leddy <mike.leddy@gmail.com>
+Date: Thu, 4 Jul 2013 01:02:05 -0300
+Subject: [PATCH] Avoid abort() in vn_rdwr(): libzpool/kernel.c
+
+Make sure that buffer is aligned to 512 bytes on linux so that
+pread call combined with O_DIRECT does not return EINVAL.
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1570
+---
+ cmd/zdb/zdb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
+index 936974b..a2b6bfe 100644
+--- a/cmd/zdb/zdb.c
++++ b/cmd/zdb/zdb.c
+@@ -2844,7 +2844,7 @@
+ psize = size;
+ lsize = size;
+
+- pbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
++ pbuf = umem_alloc_aligned(SPA_MAXBLOCKSIZE, 512, UMEM_NOFAIL);
+ lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
+
+ BP_ZERO(bp);
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch b/sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch
new file mode 100644
index 000000000000..00ec1057efa1
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.1-fix-gcc-4.8-warning.patch
@@ -0,0 +1,42 @@
+From 3db3ff4a787acf068b122562fb5be5aecec2611f Mon Sep 17 00:00:00 2001
+From: Richard Yao <ryao@gentoo.org>
+Date: Tue, 2 Jul 2013 00:07:15 -0400
+Subject: [PATCH] Use MAXPATHLEN instead of sizeof in snprintf
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This silences a GCC 4.8.0 warning by fixing a programming error
+caught by static analysis:
+
+../../cmd/ztest/ztest.c: In function ‘ztest_vdev_aux_add_remove’:
+../../cmd/ztest/ztest.c:2584:33: error: argument to ‘sizeof’
+ in ‘snprintf’ call is the same expression as the destination;
+ did you mean to provide an explicit length?
+ [-Werror=sizeof-pointer-memaccess]
+ (void) snprintf(path, sizeof (path), ztest_aux_template,
+ ^
+
+Signed-off-by: Richard Yao <ryao@gentoo.org>
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Closes #1480
+---
+ cmd/ztest/ztest.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
+index b38d7b1..93a5f1e 100644
+--- a/cmd/ztest/ztest.c
++++ b/cmd/ztest/ztest.c
+@@ -2581,7 +2581,7 @@ enum ztest_object {
+ zs->zs_vdev_aux = 0;
+ for (;;) {
+ int c;
+- (void) snprintf(path, sizeof (path), ztest_aux_template,
++ (void) snprintf(path, MAXPATHLEN, ztest_aux_template,
+ ztest_opts.zo_dir, ztest_opts.zo_pool, aux,
+ zs->zs_vdev_aux);
+ for (c = 0; c < sav->sav_count; c++)
+--
+1.8.1.6
+
diff --git a/sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch b/sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch
new file mode 100644
index 000000000000..b1e7d3736db0
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.1-fix-zvol-initialization-r1.patch
@@ -0,0 +1,167 @@
+diff --git a/module/zfs/spa.c b/module/zfs/spa.c
+index e986e92..65f78b7 100644
+--- a/module/zfs/spa.c
++++ b/module/zfs/spa.c
+@@ -64,6 +64,7 @@
+ #include <sys/zfs_ioctl.h>
+ #include <sys/dsl_scan.h>
+ #include <sys/zfeature.h>
++#include <sys/zvol.h>
+
+ #ifdef _KERNEL
+ #include <sys/bootprops.h>
+@@ -2856,6 +2857,7 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ spa_load_state_t state = SPA_LOAD_OPEN;
+ int error;
+ int locked = B_FALSE;
++ int firstopen = B_FALSE;
+
+ *spapp = NULL;
+
+@@ -2879,6 +2881,8 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ if (spa->spa_state == POOL_STATE_UNINITIALIZED) {
+ zpool_rewind_policy_t policy;
+
++ firstopen = B_TRUE;
++
+ zpool_get_rewind_policy(nvpolicy ? nvpolicy : spa->spa_config,
+ &policy);
+ if (policy.zrp_request & ZPOOL_DO_REWIND)
+@@ -2953,6 +2957,11 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy,
+ mutex_exit(&spa_namespace_lock);
+ }
+
++#ifdef _KERNEL
++ if (firstopen)
++ zvol_create_minors(spa->spa_name);
++#endif
++
+ *spapp = spa;
+
+ return (0);
+@@ -4010,6 +4019,10 @@ spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags)
+ mutex_exit(&spa_namespace_lock);
+ spa_history_log_version(spa, LOG_POOL_IMPORT);
+
++#ifdef _KERNEL
++ zvol_create_minors(pool);
++#endif
++
+ return (0);
+ }
+
+diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
+index 1226b2c..a9184a1 100644
+--- a/module/zfs/zfs_ioctl.c
++++ b/module/zfs/zfs_ioctl.c
+@@ -1268,9 +1268,6 @@ zfs_ioc_pool_import(zfs_cmd_t *zc)
+ error = err;
+ }
+
+- if (error == 0)
+- zvol_create_minors(zc->zc_name);
+-
+ nvlist_free(config);
+
+ if (props)
+diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c
+index 43a7bb6..e35c91b 100644
+--- a/module/zfs/zvol.c
++++ b/module/zfs/zvol.c
+@@ -1215,6 +1215,9 @@ zvol_alloc(dev_t dev, const char *name)
+
+ zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
+
++ spin_lock_init(&zv->zv_lock);
++ list_link_init(&zv->zv_next);
++
+ zv->zv_queue = blk_init_queue(zvol_request, &zv->zv_lock);
+ if (zv->zv_queue == NULL)
+ goto out_kmem;
+@@ -1248,9 +1251,6 @@ zvol_alloc(dev_t dev, const char *name)
+ sizeof (rl_t), offsetof(rl_t, r_node));
+ zv->zv_znode.z_is_zvol = TRUE;
+
+- spin_lock_init(&zv->zv_lock);
+- list_link_init(&zv->zv_next);
+-
+ zv->zv_disk->major = zvol_major;
+ zv->zv_disk->first_minor = (dev & MINORMASK);
+ zv->zv_disk->fops = &zvol_ops;
+@@ -1561,30 +1561,36 @@ zvol_init(void)
+ {
+ int error;
+
++ list_create(&zvol_state_list, sizeof (zvol_state_t),
++ offsetof(zvol_state_t, zv_next));
++ mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
++
+ zvol_taskq = taskq_create(ZVOL_DRIVER, zvol_threads, maxclsyspri,
+ zvol_threads, INT_MAX, TASKQ_PREPOPULATE);
+ if (zvol_taskq == NULL) {
+ printk(KERN_INFO "ZFS: taskq_create() failed\n");
+- return (-ENOMEM);
++ error = -ENOMEM;
++ goto out1;
+ }
+
+ error = register_blkdev(zvol_major, ZVOL_DRIVER);
+ if (error) {
+ printk(KERN_INFO "ZFS: register_blkdev() failed %d\n", error);
+- taskq_destroy(zvol_taskq);
+- return (error);
++ goto out2;
+ }
+
+ blk_register_region(MKDEV(zvol_major, 0), 1UL << MINORBITS,
+ THIS_MODULE, zvol_probe, NULL, NULL);
+
+- mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
+- list_create(&zvol_state_list, sizeof (zvol_state_t),
+- offsetof(zvol_state_t, zv_next));
++ return (0);
+
+- (void) zvol_create_minors(NULL);
++out2:
++ taskq_destroy(zvol_taskq);
++out1:
++ mutex_destroy(&zvol_state_lock);
++ list_destroy(&zvol_state_list);
+
+- return (0);
++ return (error);
+ }
+
+ void
+diff --git a/scripts/zconfig.sh b/scripts/zconfig.sh
+index 141348c..281166c 100755
+--- a/scripts/zconfig.sh
++++ b/scripts/zconfig.sh
+@@ -264,8 +264,9 @@ test_4() {
+ zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
+ ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
+
+- # Load the modules, wait 1 second for udev
++ # Load the modules, list the pools to ensure they are opened
+ ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10
++ ${ZPOOL} list &>/dev/null
+
+ # Verify the devices were created
+ zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
+diff --git a/udev/rules.d/90-zfs.rules.in b/udev/rules.d/90-zfs.rules.in
+index 52e1d63..a2715d2 100644
+--- a/udev/rules.d/90-zfs.rules.in
++++ b/udev/rules.d/90-zfs.rules.in
+@@ -1,4 +1,4 @@
+-SUBSYSTEM!="block", GOTO="zfs_end"
++SUBSYSTEM!="block|misc", GOTO="zfs_end"
+ ACTION!="add|change", GOTO="zfs_end"
+
+ ENV{ID_FS_TYPE}=="zfs", RUN+="/sbin/modprobe zfs"
+@@ -7,4 +7,6 @@ ENV{ID_FS_TYPE}=="zfs_member", RUN+="/sbin/modprobe zfs"
+ KERNEL=="null", SYMLINK+="root"
+ SYMLINK=="null", SYMLINK+="root"
+
++SUBSYSTEM=="misc", KERNEL=="zfs", RUN+="@sbindir@/zpool list"
++
+ LABEL="zfs_end"
diff --git a/sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch b/sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch
new file mode 100644
index 000000000000..e794b183eb33
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-0.6.1-gentoo-openrc-dependencies.patch
@@ -0,0 +1,57 @@
+commit 75c2fb953c99bba008f1ef72ee71136002749f51
+Author: Richard Yao <ryao@cs.stonybrook.edu>
+Date: Tue May 28 20:08:15 2013 -0400
+
+ Improve OpenRC init script
+
+ The current zfs OpenRC script's dependencies cause OpenRC to attempt to
+ unmount ZFS filesystems at shutdown while things were still using them,
+ which would fail. This is a cosmetic issue, but it should still be
+ addressed. It probably does not affect systems where the rootfs is a
+ legacy filesystem, but any system with the rootfs on ZFS needs to run
+ the ZFS init script after the system is ready to shutdown filesystems.
+
+ OpenRC's shutdown process occurs in the reverse order of the startup
+ process. Therefore running the ZFS shutdown procedure after filesystems
+ are ready to be unmounted requires running the startup procedure before
+ fstab. This patch changes the dependencies of the script to expliclty
+ run before fstab at boot when the rootfs is ZFS and to run after fstab
+ at boot whenever the rootfs is not ZFS. This should cover most use
+ cases.
+
+ The only cases not covered well by this are systems with legacy
+ root filesystems where people want to configure fstab to mount a non-ZFS
+ filesystem off a zvol and possibly also systems whose pools are stored
+ on network block devices. The former requires that the ZFS script run
+ before fstab, which could cause ZFS datasets to mount too early and
+ appear under the fstab mount points. The latter requires that the ZFS
+ script run after networking starts, which precludes the ability to store
+ any system information on ZFS. An additional OpenRC script could be
+ written to handle non-root pools on network block devices, but that will
+ depend on user demand and developer time.
+
+ Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
+
+diff --git a/etc/init.d/zfs.gentoo.in b/etc/init.d/zfs.gentoo.in
+index 5b8671e..0034e02 100644
+--- a/etc/init.d/zfs.gentoo.in
++++ b/etc/init.d/zfs.gentoo.in
+@@ -10,9 +10,16 @@ fi
+
+ depend()
+ {
++ # Try to allow people to mix and match fstab with ZFS in a way that makes sense.
++ if [ "$(mountinfo -s /)" = 'zfs' ]
++ then
++ before localmount
++ else
++ after localmount
++ fi
++
+ # bootmisc will log to /var which may be a different zfs than root.
+- before net bootmisc
+- after udev localmount
++ before bootmisc logger
+ keyword -lxc -openvz -prefix -vserver
+ }
+
diff --git a/sys-fs/zfs/files/zfs-init.sh.in b/sys-fs/zfs/files/zfs-init.sh.in
new file mode 100644
index 000000000000..ed84585cd5f6
--- /dev/null
+++ b/sys-fs/zfs/files/zfs-init.sh.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+ZFS="@sbindir@/zfs"
+ZPOOL="@sbindir@/zpool"
+ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+
+if [ -f "${ZPOOL_CACHE}" ]; then
+ "${ZPOOL}" import -c "${ZPOOL_CACHE}" -aN 2>/dev/null
+ if [ "${?}" != "0" ]; then
+ echo "Failed to import not-yet imported pools." >&2
+ fi
+fi
+
+echo "Mounting ZFS filesystems"
+"${ZFS}" mount -a
+if [ "${?}" != "0" ]; then
+ echo "Failed to mount ZFS filesystems." >&2
+ exit 1
+fi
+
+echo "Exporting ZFS filesystems"
+"${ZFS}" share -a
+if [ "${?}" != "0" ]; then
+ echo "Failed to export ZFS filesystems." >&2
+ exit 1
+fi
+
+exit 0
+
diff --git a/sys-fs/zfs/files/zfs.service.in b/sys-fs/zfs/files/zfs.service.in
new file mode 100644
index 000000000000..c390a480708e
--- /dev/null
+++ b/sys-fs/zfs/files/zfs.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=ZFS filesystems setup
+Before=network.target
+After=systemd-udev-settle.target local-fs.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=/sbin/modprobe zfs
+ExecStartPre=/usr/bin/test -c /dev/zfs
+ExecStart=/usr/libexec/zfs-init.sh
+ExecStop=@sbindir@/zfs umount -a
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/sys-fs/zfs/metadata.xml b/sys-fs/zfs/metadata.xml
new file mode 100644
index 000000000000..612042af97c8
--- /dev/null
+++ b/sys-fs/zfs/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <use>
+ <flag name="kernel-builtin">Disable dependency on sys-fs/zfs-kmod under the assumption that ZFS is part of the kernel source tree</flag>
+ <flag name="rootfs">Enable dependencies required for booting off a pool containing a rootfs</flag>
+ <flag name="test-suite">Install regression test suite</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">zfsonlinux/zfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/zfs/zfs-0.6.0_rc13-r2.ebuild b/sys-fs/zfs/zfs-0.6.0_rc13-r2.ebuild
new file mode 100644
index 000000000000..ef49fd86683c
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.0_rc13-r2.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="custom-cflags kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/share/dracut"
+ use test-suite || rm -rf "${ED}usr/libexec"
+
+ newbashcomp "${FILESDIR}/bash-completion" zfs
+
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.0_rc14-r1.ebuild b/sys-fs/zfs/zfs-0.6.0_rc14-r1.ebuild
new file mode 100644
index 000000000000..8d6fc4f406d5
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.0_rc14-r1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="custom-cflags kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ if [ ${PV} != "9999" ]
+ then
+ epatch "${FILESDIR}/${P}-fix-libzpool-function-relocations.patch"
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/share/dracut"
+ use test-suite || rm -rf "${ED}usr/libexec"
+
+ newbashcomp "${FILESDIR}/bash-completion" zfs
+
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.1-r4.ebuild b/sys-fs/zfs/zfs-0.6.1-r4.ebuild
new file mode 100644
index 000000000000..3f8d9e918384
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.1-r4.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="bash-completion custom-cflags kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Fix OpenRC dependencies
+ epatch "${FILESDIR}/${P}-gentoo-openrc-dependencies.patch"
+
+ # Make zvol initialization asynchronous
+ epatch "${FILESDIR}/${P}-fix-zvol-initialization-r1.patch"
+
+ # Use MAXPATHLEN to silence GCC 4.8 warning
+ epatch "${FILESDIR}/${P}-fix-gcc-4.8-warning.patch"
+
+ # Avoid zdb abort
+ epatch "${FILESDIR}/${P}-avoid-zdb-abort.patch"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.2-r1.ebuild b/sys-fs/zfs/zfs-0.6.2-r1.ebuild
new file mode 100644
index 000000000000..b3311bdec6f6
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.2-r1.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-kmod-${MY_PV}-p0.tar.xz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="bash-completion custom-cflags kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-kmod-${MY_PV}-patches"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.2-r2.ebuild b/sys-fs/zfs/zfs-0.6.2-r2.ebuild
new file mode 100644
index 000000000000..6628a2aa2c9a
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.2-r2.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-kmod-${MY_PV}-p1.tar.xz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="bash-completion custom-cflags kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-kmod-${MY_PV}-patches"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.2-r3.ebuild b/sys-fs/zfs/zfs-0.6.2-r3.ebuild
new file mode 100644
index 000000000000..8fcf5dc14875
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.2-r3.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-kmod-${MY_PV}-p2.tar.xz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-kmod-${MY_PV}-patches"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.2-r4.ebuild b/sys-fs/zfs/zfs-0.6.2-r4.ebuild
new file mode 100644
index 000000000000..cd154daa1d51
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.2-r4.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-kmod-${MY_PV}-p3.tar.xz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-kmod-${MY_PV}-patches"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.2-r5.ebuild b/sys-fs/zfs/zfs-0.6.2-r5.ebuild
new file mode 100644
index 000000000000..8a4ca903b7a6
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.2-r5.ebuild
@@ -0,0 +1,153 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-kmod-${MY_PV}-p4.tar.xz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-kmod-${MY_PV}-patches"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.2.ebuild b/sys-fs/zfs/zfs-0.6.2.ebuild
new file mode 100644
index 000000000000..f40224da03d8
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.2.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL MIT"
+SLOT="0"
+IUSE="bash-completion custom-cflags kernel-builtin +rootfs selinux test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ selinux? ( sys-libs/libselinux )
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ $(use_with selinux)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.3-r2.ebuild b/sys-fs/zfs/zfs-0.6.3-r2.ebuild
new file mode 100644
index 000000000000..bad5eb1d44d4
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.3-r2.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${P}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${P}-patches-r1.tar.xz"
+ S="${WORKDIR}/${PN}-${P}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${P}-patches"
+ fi
+
+# Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-dracutdir="/usr/$(get_libdir)/dracut"
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.3.ebuild b/sys-fs/zfs/zfs-0.6.3.ebuild
new file mode 100644
index 000000000000..13ebead85668
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.3.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.4.2.ebuild b/sys-fs/zfs/zfs-0.6.4.2.ebuild
new file mode 100644
index 000000000000..abf9ee9000bf
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.4.2.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${P}.tar.gz"
+ S="${WORKDIR}/${PN}-${P}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+ doinitd "${FILESDIR}/zed"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-0.6.4.ebuild b/sys-fs/zfs/zfs-0.6.4.ebuild
new file mode 100644
index 000000000000..aeb66945896e
--- /dev/null
+++ b/sys-fs/zfs/zfs-0.6.4.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="git://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
+ rm -rf "${ED}usr/lib/dracut"
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+ doinitd "${FILESDIR}/zed"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}
diff --git a/sys-fs/zfs/zfs-9999.ebuild b/sys-fs/zfs/zfs-9999.ebuild
new file mode 100644
index 000000000000..972b84cc0f48
--- /dev/null
+++ b/sys-fs/zfs/zfs-9999.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit python-r1
+
+AT_M4DIR="config"
+AUTOTOOLS_AUTORECONF="1"
+AUTOTOOLS_IN_SOURCE_BUILD="1"
+
+if [ ${PV} == "9999" ] ; then
+ inherit git-2 linux-mod
+ EGIT_REPO_URI="https://github.com/zfsonlinux/${PN}.git"
+else
+ inherit eutils versionator
+ MY_PV=$(replace_version_separator 3 '-')
+ SRC_URI="https://github.com/zfsonlinux/${PN}/archive/${PN}-${MY_PV}.tar.gz
+ http://dev.gentoo.org/~ryao/dist/${PN}-kmod-${MY_PV}-p2.tar.xz"
+ S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64"
+fi
+
+inherit bash-completion-r1 flag-o-matic toolchain-funcs autotools-utils udev systemd
+
+DESCRIPTION="Userland utilities for ZFS Linux kernel module"
+HOMEPAGE="http://zfsonlinux.org/"
+
+LICENSE="BSD-2 CDDL bash-completion? ( MIT )"
+SLOT="0"
+IUSE="bash-completion custom-cflags debug kernel-builtin +rootfs test-suite static-libs"
+RESTRICT="test"
+
+COMMON_DEPEND="
+ sys-apps/util-linux[static-libs?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/awk
+"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !=sys-apps/grep-2.13*
+ !kernel-builtin? ( =sys-fs/zfs-kmod-${PV}* )
+ !sys-fs/zfs-fuse
+ !prefix? ( virtual/udev )
+ test-suite? (
+ sys-apps/util-linux
+ sys-devel/bc
+ sys-block/parted
+ sys-fs/lsscsi
+ sys-fs/mdadm
+ sys-process/procps
+ virtual/modutils
+ )
+ rootfs? (
+ app-arch/cpio
+ app-misc/pax-utils
+ !<sys-boot/grub-2.00-r2:2
+ )
+"
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ if [ ${PV} != "9999" ]
+ then
+ # Apply patch set
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/${PN}-kmod-${MY_PV}-patches"
+ fi
+
+ # Update paths
+ sed -e "s|/sbin/lsmod|/bin/lsmod|" \
+ -e "s|/usr/bin/scsi-rescan|/usr/sbin/rescan-scsi-bus|" \
+ -e "s|/sbin/parted|/usr/sbin/parted|" \
+ -i scripts/common.sh.in
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ use custom-cflags || strip-flags
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --sbindir="${EPREFIX}/sbin"
+ --with-config=user
+ --with-dracutdir="/usr/$(get_libdir)/dracut"
+ --with-linux="${KV_DIR}"
+ --with-linux-obj="${KV_OUT_DIR}"
+ --with-udevdir="$(get_udevdir)"
+ --with-blkid
+ $(use_enable debug)
+ )
+ autotools-utils_src_configure
+
+ # prepare systemd unit and helper script
+ cat "${FILESDIR}/zfs.service.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs.service" || die
+ cat "${FILESDIR}/zfs-init.sh.in" | \
+ sed -e "s:@sbindir@:${EPREFIX}/sbin:g" \
+ -e "s:@sysconfdir@:${EPREFIX}/etc:g" \
+ > "${T}/zfs-init.sh" || die
+}
+
+src_install() {
+ autotools-utils_src_install
+ gen_usr_ldscript -a uutil nvpair zpool zfs zfs_core
+ use test-suite || rm -rf "${ED}usr/share/zfs"
+
+ use bash-completion && newbashcomp "${FILESDIR}/bash-completion-r1" zfs
+
+ exeinto /usr/libexec
+ doexe "${T}/zfs-init.sh"
+ systemd_dounit "${T}/zfs.service"
+}
+
+pkg_postinst() {
+
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ einfo "Adding ${P} to the module database to ensure that the"
+ einfo "kernel modules and userland utilities stay in sync."
+ update_moduledb
+ fi
+
+ [ -e "${EROOT}/etc/runlevels/boot/zfs" ] \
+ || ewarn 'You should add zfs to the boot runlevel.'
+
+ if [ -e "${EROOT}/etc/runlevels/shutdown/zfs-shutdown" ]
+ then
+ einfo "The zfs-shutdown script is obsolete. Removing it from runlevel."
+ rm "${EROOT}/etc/runlevels/shutdown/zfs-shutdown"
+ fi
+
+}
+
+pkg_postrm() {
+ if ! use kernel-builtin && [ ${PV} = "9999" ]
+ then
+ remove_moduledb
+ fi
+}