summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/9base/9base-6-r1.ebuild50
-rw-r--r--sys-apps/9base/Manifest1
-rw-r--r--sys-apps/9base/metadata.xml8
-rw-r--r--sys-apps/accountsservice/Manifest2
-rw-r--r--sys-apps/accountsservice/accountsservice-0.6.39.ebuild59
-rw-r--r--sys-apps/accountsservice/accountsservice-0.6.40.ebuild58
-rw-r--r--sys-apps/accountsservice/files/accountsservice-0.6.35-gentoo-system-users.patch51
-rw-r--r--sys-apps/accountsservice/metadata.xml9
-rw-r--r--sys-apps/ack/Manifest1
-rw-r--r--sys-apps/ack/ack-2.14.ebuild28
-rw-r--r--sys-apps/ack/files/ack-2.14-gentoo.patch22
-rw-r--r--sys-apps/ack/metadata.xml11
-rw-r--r--sys-apps/acl/Manifest4
-rw-r--r--sys-apps/acl/acl-2.2.49-r1.ebuild62
-rw-r--r--sys-apps/acl/acl-2.2.49.ebuild64
-rw-r--r--sys-apps/acl/acl-2.2.51.ebuild63
-rw-r--r--sys-apps/acl/acl-2.2.52-r1.ebuild59
-rw-r--r--sys-apps/acl/acl-2.2.52.ebuild49
-rw-r--r--sys-apps/acl/files/acl-2.2.49-quote-strchr.patch25
-rw-r--r--sys-apps/acl/files/acl-2.2.51-config-shell.patch53
-rw-r--r--sys-apps/acl/metadata.xml13
-rw-r--r--sys-apps/adjtime/Manifest1
-rw-r--r--sys-apps/adjtime/adjtime-0.4-r2.ebuild43
-rw-r--r--sys-apps/adjtime/metadata.xml9
-rw-r--r--sys-apps/agedu/Manifest2
-rw-r--r--sys-apps/agedu/agedu-20141024.10297.ebuild34
-rw-r--r--sys-apps/agedu/agedu-20150422.3922.ebuild34
-rw-r--r--sys-apps/agedu/files/agedu-r9671-fix-automagic.patch44
-rw-r--r--sys-apps/agedu/metadata.xml8
-rw-r--r--sys-apps/aix-miscutils/Manifest1
-rw-r--r--sys-apps/aix-miscutils/aix-miscutils-0.1.1671.ebuild16
-rw-r--r--sys-apps/aix-miscutils/metadata.xml8
-rw-r--r--sys-apps/apmd/Manifest2
-rw-r--r--sys-apps/apmd/apmd-3.2.2_p14.ebuild79
-rw-r--r--sys-apps/apmd/files/apmd.confd4
-rw-r--r--sys-apps/apmd/files/apmd.rc629
-rw-r--r--sys-apps/apmd/metadata.xml5
-rw-r--r--sys-apps/apparmor-utils/Manifest2
-rw-r--r--sys-apps/apparmor-utils/apparmor-utils-2.8.3.ebuild52
-rw-r--r--sys-apps/apparmor-utils/apparmor-utils-2.8.4.ebuild52
-rw-r--r--sys-apps/apparmor-utils/metadata.xml11
-rw-r--r--sys-apps/apparmor/Manifest2
-rw-r--r--sys-apps/apparmor/apparmor-2.8.3.ebuild46
-rw-r--r--sys-apps/apparmor/apparmor-2.8.4.ebuild46
-rw-r--r--sys-apps/apparmor/files/apparmor-2.8.2-makefile.patch34
-rwxr-xr-xsys-apps/apparmor/files/apparmor-init92
-rw-r--r--sys-apps/apparmor/metadata.xml11
-rw-r--r--sys-apps/apply-default-acl/Manifest1
-rw-r--r--sys-apps/apply-default-acl/apply-default-acl-0.0.4.ebuild22
-rw-r--r--sys-apps/apply-default-acl/metadata.xml15
-rw-r--r--sys-apps/arrayprobe/Manifest1
-rw-r--r--sys-apps/arrayprobe/arrayprobe-2.0-r2.ebuild22
-rw-r--r--sys-apps/arrayprobe/files/2.0-ida_headers.patch647
-rw-r--r--sys-apps/arrayprobe/files/2.0-malloc-strlen.patch20
-rw-r--r--sys-apps/arrayprobe/metadata.xml9
-rw-r--r--sys-apps/attr/Manifest2
-rw-r--r--sys-apps/attr/attr-2.4.46-r2.ebuild54
-rw-r--r--sys-apps/attr/attr-2.4.47-r1.ebuild69
-rw-r--r--sys-apps/attr/attr-2.4.47-r2.ebuild69
-rw-r--r--sys-apps/attr/files/attr-2.4.44-gettext.patch63
-rw-r--r--sys-apps/attr/files/attr-2.4.46-config-shell.patch53
-rw-r--r--sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch180
-rw-r--r--sys-apps/attr/metadata.xml5
-rw-r--r--sys-apps/audio-entropyd/Manifest1
-rw-r--r--sys-apps/audio-entropyd/audio-entropyd-2.0.3-r1.ebuild38
-rw-r--r--sys-apps/audio-entropyd/audio-entropyd-2.0.3.ebuild37
-rw-r--r--sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-ldflags.patch13
-rw-r--r--sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-uclibc.patch27
-rw-r--r--sys-apps/audio-entropyd/files/audio-entropyd.conf-213
-rw-r--r--sys-apps/audio-entropyd/files/audio-entropyd.init-227
-rw-r--r--sys-apps/audio-entropyd/files/audio-entropyd.service8
-rw-r--r--sys-apps/audio-entropyd/metadata.xml9
-rw-r--r--sys-apps/baobab/Manifest2
-rw-r--r--sys-apps/baobab/baobab-3.14.1.ebuild40
-rw-r--r--sys-apps/baobab/baobab-3.16.1.ebuild40
-rw-r--r--sys-apps/baobab/metadata.xml5
-rw-r--r--sys-apps/bar/Manifest1
-rw-r--r--sys-apps/bar/bar-1.11.1.ebuild49
-rw-r--r--sys-apps/bar/metadata.xml8
-rw-r--r--sys-apps/baselayout-java/Manifest1
-rw-r--r--sys-apps/baselayout-java/baselayout-java-0.1.0.ebuild28
-rw-r--r--sys-apps/baselayout-java/metadata.xml7
-rw-r--r--sys-apps/baselayout-prefix/Manifest4
-rw-r--r--sys-apps/baselayout-prefix/baselayout-prefix-1.12.14-r1.ebuild148
-rw-r--r--sys-apps/baselayout-prefix/baselayout-prefix-1.12.14.ebuild182
-rw-r--r--sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r11.ebuild180
-rw-r--r--sys-apps/baselayout-prefix/baselayout-prefix-2.2-r3.ebuild96
-rw-r--r--sys-apps/baselayout-prefix/baselayout-prefix-2.2-r4.ebuild84
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-aix.patch110
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-darwin-kvm.patch22
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-gnulib.patch78
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-bash.patch18
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-eprefix.patch25
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-pkgconfig.patch16
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-prompt.patch58
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch33
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining.patch83
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-no-consoletype.patch11
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-pidof.patch11
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-sh.patch226
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-src.patch102
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix.patch409
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch66
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch42
-rw-r--r--sys-apps/baselayout-prefix/files/baselayout-1.12.5-termios_h.patch30
-rw-r--r--sys-apps/baselayout-prefix/files/einfo-1.0.4-termcap-check.patch83
-rw-r--r--sys-apps/baselayout-prefix/metadata.xml10
-rw-r--r--sys-apps/baselayout/Manifest1
-rw-r--r--sys-apps/baselayout/baselayout-2.2.ebuild234
-rw-r--r--sys-apps/baselayout/metadata.xml5
-rw-r--r--sys-apps/biosdevname/Manifest4
-rw-r--r--sys-apps/biosdevname/biosdevname-0.3.11-r1.ebuild40
-rw-r--r--sys-apps/biosdevname/biosdevname-0.4.0.ebuild40
-rw-r--r--sys-apps/biosdevname/biosdevname-0.4.1.ebuild42
-rw-r--r--sys-apps/biosdevname/biosdevname-0.6.1.ebuild25
-rw-r--r--sys-apps/biosdevname/metadata.xml14
-rw-r--r--sys-apps/biosdisk/Manifest1
-rw-r--r--sys-apps/biosdisk/biosdisk-0_p20100611-r1.ebuild46
-rw-r--r--sys-apps/biosdisk/metadata.xml14
-rw-r--r--sys-apps/bleachbit/Manifest3
-rw-r--r--sys-apps/bleachbit/bleachbit-1.2.ebuild65
-rw-r--r--sys-apps/bleachbit/bleachbit-1.4.ebuild65
-rw-r--r--sys-apps/bleachbit/bleachbit-1.9.1.ebuild65
-rw-r--r--sys-apps/bleachbit/metadata.xml12
-rw-r--r--sys-apps/busybox/Manifest8
-rw-r--r--sys-apps/busybox/busybox-1.20.2.ebuild291
-rw-r--r--sys-apps/busybox/busybox-1.21.0.ebuild299
-rw-r--r--sys-apps/busybox/busybox-1.21.1.ebuild299
-rw-r--r--sys-apps/busybox/busybox-1.22.0.ebuild299
-rw-r--r--sys-apps/busybox/busybox-1.22.1-r1.ebuild300
-rw-r--r--sys-apps/busybox/busybox-1.22.1.ebuild299
-rw-r--r--sys-apps/busybox/busybox-1.23.0-r1.ebuild302
-rw-r--r--sys-apps/busybox/busybox-1.23.1-r1.ebuild303
-rw-r--r--sys-apps/busybox/busybox-1.23.1.ebuild302
-rw-r--r--sys-apps/busybox/busybox-1.23.2.ebuild305
-rw-r--r--sys-apps/busybox/busybox-9999.ebuild303
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-bb.patch22
-rw-r--r--sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch33
-rw-r--r--sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch109
-rw-r--r--sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch67
-rw-r--r--sys-apps/busybox/files/busybox-1.21.0-mdev.patch35
-rw-r--r--sys-apps/busybox/files/busybox-1.21.0-platform.patch24
-rw-r--r--sys-apps/busybox/files/busybox-1.21.0-xz.patch84
-rw-r--r--sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch51
-rw-r--r--sys-apps/busybox/files/busybox-1.22.0-find.patch40
-rw-r--r--sys-apps/busybox/files/busybox-1.22.0-grep.patch80
-rw-r--r--sys-apps/busybox/files/busybox-1.22.0-lineedit.patch12
-rw-r--r--sys-apps/busybox/files/busybox-1.22.0-ntpd.patch11
-rw-r--r--sys-apps/busybox/files/busybox-1.22.1-ash.patch11
-rw-r--r--sys-apps/busybox/files/busybox-1.22.1-date.patch30
-rw-r--r--sys-apps/busybox/files/busybox-1.22.1-iplink.patch19
-rw-r--r--sys-apps/busybox/files/busybox-1.22.1-lzop.patch66
-rw-r--r--sys-apps/busybox/files/busybox-1.22.1-nc.patch15
-rw-r--r--sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch64
-rw-r--r--sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch166
-rw-r--r--sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch39
-rw-r--r--sys-apps/busybox/files/ginit.c124
-rw-r--r--sys-apps/busybox/files/klogd.confd9
-rw-r--r--sys-apps/busybox/files/klogd.initd12
-rwxr-xr-xsys-apps/busybox/files/mdev-start.sh125
-rw-r--r--sys-apps/busybox/files/mdev.initd53
-rwxr-xr-xsys-apps/busybox/files/mdev.rc9
-rwxr-xr-xsys-apps/busybox/files/mdev.rc.198
-rw-r--r--sys-apps/busybox/files/mdev/dvbdev18
-rw-r--r--sys-apps/busybox/files/mdev/ide_links23
-rw-r--r--sys-apps/busybox/files/mdev/usbdev62
-rw-r--r--sys-apps/busybox/files/mdev/usbdisk_link34
-rw-r--r--sys-apps/busybox/files/ntpd.confd6
-rw-r--r--sys-apps/busybox/files/ntpd.initd13
-rw-r--r--sys-apps/busybox/files/syslogd.confd9
-rw-r--r--sys-apps/busybox/files/syslogd.initd13
-rw-r--r--sys-apps/busybox/files/watchdog.confd9
-rw-r--r--sys-apps/busybox/files/watchdog.initd8
-rw-r--r--sys-apps/busybox/metadata.xml16
-rw-r--r--sys-apps/byld/Manifest1
-rw-r--r--sys-apps/byld/byld-1.0.3.ebuild27
-rw-r--r--sys-apps/byld/metadata.xml8
-rw-r--r--sys-apps/cciss_vol_status/Manifest4
-rw-r--r--sys-apps/cciss_vol_status/cciss_vol_status-1.03.ebuild18
-rw-r--r--sys-apps/cciss_vol_status/cciss_vol_status-1.09-r1.ebuild22
-rw-r--r--sys-apps/cciss_vol_status/cciss_vol_status-1.09.ebuild20
-rw-r--r--sys-apps/cciss_vol_status/cciss_vol_status-1.10.ebuild22
-rw-r--r--sys-apps/cciss_vol_status/cciss_vol_status-1.11.ebuild22
-rw-r--r--sys-apps/cciss_vol_status/files/1.06-strlen-typo.patch12
-rw-r--r--sys-apps/cciss_vol_status/files/cciss_vol_status.cron21
-rw-r--r--sys-apps/cciss_vol_status/metadata.xml12
-rw-r--r--sys-apps/ccs-tools/Manifest1
-rw-r--r--sys-apps/ccs-tools/ccs-tools-1.8.3_p20130214.ebuild62
-rw-r--r--sys-apps/ccs-tools/files/ccs-tools-1.8.3_p20130214-warnings.patch22
-rw-r--r--sys-apps/ccs-tools/metadata.xml10
-rw-r--r--sys-apps/checkpolicy/Manifest3
-rw-r--r--sys-apps/checkpolicy/checkpolicy-2.2.ebuild47
-rw-r--r--sys-apps/checkpolicy/checkpolicy-2.3.ebuild51
-rw-r--r--sys-apps/checkpolicy/checkpolicy-2.4.ebuild51
-rw-r--r--sys-apps/checkpolicy/checkpolicy-9999.ebuild58
-rw-r--r--sys-apps/checkpolicy/metadata.xml6
-rw-r--r--sys-apps/checkservice/Manifest1
-rw-r--r--sys-apps/checkservice/checkservice-1.2.0.ebuild50
-rw-r--r--sys-apps/checkservice/metadata.xml7
-rw-r--r--sys-apps/chname/Manifest1
-rw-r--r--sys-apps/chname/chname-1.0-r1.ebuild30
-rw-r--r--sys-apps/chname/metadata.xml11
-rw-r--r--sys-apps/cinit/Manifest1
-rw-r--r--sys-apps/cinit/cinit-0.2.1.ebuild38
-rw-r--r--sys-apps/cinit/metadata.xml8
-rw-r--r--sys-apps/clrngd/Manifest1
-rw-r--r--sys-apps/clrngd/clrngd-1.0.3.ebuild27
-rw-r--r--sys-apps/clrngd/files/clrngd-conf.d9
-rw-r--r--sys-apps/clrngd/files/clrngd-init.d19
-rw-r--r--sys-apps/clrngd/metadata.xml7
-rw-r--r--sys-apps/cobalt-panel-utils/Manifest1
-rw-r--r--sys-apps/cobalt-panel-utils/cobalt-panel-utils-1.0.2.ebuild45
-rw-r--r--sys-apps/cobalt-panel-utils/metadata.xml11
-rw-r--r--sys-apps/collectl/Manifest4
-rw-r--r--sys-apps/collectl/collectl-3.7.3.ebuild35
-rw-r--r--sys-apps/collectl/collectl-3.7.4.ebuild37
-rw-r--r--sys-apps/collectl/collectl-4.0.0.ebuild37
-rw-r--r--sys-apps/collectl/collectl-4.0.2.ebuild37
-rwxr-xr-xsys-apps/collectl/files/collectl.initd-216
-rw-r--r--sys-apps/collectl/metadata.xml8
-rw-r--r--sys-apps/conspy/Manifest2
-rw-r--r--sys-apps/conspy/conspy-1.10.ebuild35
-rw-r--r--sys-apps/conspy/conspy-1.8.ebuild27
-rw-r--r--sys-apps/conspy/metadata.xml5
-rw-r--r--sys-apps/coreutils/Manifest15
-rw-r--r--sys-apps/coreutils/coreutils-8.20.ebuild177
-rw-r--r--sys-apps/coreutils/coreutils-8.21.ebuild180
-rw-r--r--sys-apps/coreutils/coreutils-8.22-r1.ebuild170
-rw-r--r--sys-apps/coreutils/coreutils-8.22.ebuild178
-rw-r--r--sys-apps/coreutils/coreutils-8.23.ebuild176
-rw-r--r--sys-apps/coreutils/coreutils-8.24.ebuild176
-rw-r--r--sys-apps/coreutils/metadata.xml11
-rw-r--r--sys-apps/cpint/Manifest2
-rw-r--r--sys-apps/cpint/cpint-1.1.6.ebuild28
-rw-r--r--sys-apps/cpint/cpint-2.5.3.ebuild32
-rw-r--r--sys-apps/cpint/files/cpint-2.5.3-build.patch73
-rw-r--r--sys-apps/cpint/files/cpint-2.5.3-kernel.patch43
-rw-r--r--sys-apps/cpint/files/cpint-2.5.3-prototypes.patch43
-rw-r--r--sys-apps/cpint/metadata.xml6
-rw-r--r--sys-apps/cpuid/Manifest3
-rw-r--r--sys-apps/cpuid/cpuid-20130610.ebuild31
-rw-r--r--sys-apps/cpuid/cpuid-20140123.ebuild31
-rw-r--r--sys-apps/cpuid/cpuid-20150606.ebuild31
-rw-r--r--sys-apps/cpuid/files/cpuid-20110305-Makefile.patch30
-rw-r--r--sys-apps/cpuid/files/cpuid-20110305-fPIC.patch24
-rw-r--r--sys-apps/cpuid/files/cpuid-20150606-Makefile.patch21
-rw-r--r--sys-apps/cpuid/metadata.xml12
-rw-r--r--sys-apps/cracklib-words/Manifest1
-rw-r--r--sys-apps/cracklib-words/cracklib-words-20080507.ebuild29
-rw-r--r--sys-apps/cracklib-words/metadata.xml8
-rw-r--r--sys-apps/cv/Manifest1
-rw-r--r--sys-apps/cv/cv-0.4.1.ebuild34
-rw-r--r--sys-apps/cv/metadata.xml11
-rw-r--r--sys-apps/daemonize/Manifest3
-rw-r--r--sys-apps/daemonize/daemonize-1.7.4.ebuild28
-rw-r--r--sys-apps/daemonize/daemonize-1.7.5.ebuild28
-rw-r--r--sys-apps/daemonize/daemonize-1.7.6.ebuild28
-rw-r--r--sys-apps/daemonize/metadata.xml13
-rw-r--r--sys-apps/darwin-miscutils/Manifest17
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-10.ebuild156
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-4-r1.ebuild106
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-5-r1.ebuild141
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild140
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild139
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-8.ebuild133
-rw-r--r--sys-apps/darwin-miscutils/darwin-miscutils-9.ebuild130
-rw-r--r--sys-apps/darwin-miscutils/files/darwin-miscutils-5-error.patch14
-rw-r--r--sys-apps/darwin-miscutils/files/darwin-miscutils-5-stdlib.patch20
-rw-r--r--sys-apps/darwin-miscutils/files/darwin-miscutils-5-w.patch10
-rw-r--r--sys-apps/darwin-miscutils/files/darwin-miscutils-6-w64.patch17
-rw-r--r--sys-apps/darwin-miscutils/metadata.xml5
-rw-r--r--sys-apps/dbus/Manifest3
-rw-r--r--sys-apps/dbus/dbus-1.8.16.ebuild248
-rw-r--r--sys-apps/dbus/dbus-1.8.18.ebuild252
-rw-r--r--sys-apps/dbus/dbus-1.8.20.ebuild252
-rw-r--r--sys-apps/dbus/files/80-dbus13
-rw-r--r--sys-apps/dbus/files/dbus.initd50
-rw-r--r--sys-apps/dbus/metadata.xml14
-rw-r--r--sys-apps/dcfldd/Manifest1
-rw-r--r--sys-apps/dcfldd/dcfldd-1.3.4.1.ebuild26
-rw-r--r--sys-apps/dcfldd/metadata.xml8
-rw-r--r--sys-apps/dchroot/Manifest1
-rw-r--r--sys-apps/dchroot/dchroot-0.12.1.ebuild36
-rw-r--r--sys-apps/dchroot/metadata.xml7
-rw-r--r--sys-apps/debianutils/Manifest4
-rw-r--r--sys-apps/debianutils/debianutils-4.3.2.ebuild44
-rw-r--r--sys-apps/debianutils/debianutils-4.3.3.ebuild44
-rw-r--r--sys-apps/debianutils/debianutils-4.3.4.ebuild44
-rw-r--r--sys-apps/debianutils/debianutils-4.4.ebuild44
-rw-r--r--sys-apps/debianutils/files/debianutils-3.4.2-no-bs-namespace.patch30
-rw-r--r--sys-apps/debianutils/metadata.xml5
-rw-r--r--sys-apps/diffutils/Manifest1
-rw-r--r--sys-apps/diffutils/diffutils-3.3.ebuild49
-rw-r--r--sys-apps/diffutils/metadata.xml5
-rw-r--r--sys-apps/dmapi/Manifest1
-rw-r--r--sys-apps/dmapi/dmapi-2.2.12-r1.ebuild48
-rw-r--r--sys-apps/dmapi/dmapi-2.2.12.ebuild42
-rw-r--r--sys-apps/dmapi/metadata.xml5
-rw-r--r--sys-apps/dmidecode/Manifest1
-rw-r--r--sys-apps/dmidecode/dmidecode-2.12-r1.ebuild44
-rw-r--r--sys-apps/dmidecode/files/2.12-supported-smbios-version.patch55
-rw-r--r--sys-apps/dmidecode/metadata.xml5
-rw-r--r--sys-apps/dmtcp/Manifest1
-rw-r--r--sys-apps/dmtcp/dmtcp-1.2.6.ebuild62
-rw-r--r--sys-apps/dmtcp/files/dmtcp-1.2.1-gcc46.patch21
-rw-r--r--sys-apps/dmtcp/metadata.xml12
-rw-r--r--sys-apps/dnotify/Manifest1
-rw-r--r--sys-apps/dnotify/dnotify-0.18.0.ebuild33
-rw-r--r--sys-apps/dnotify/files/dnotify-0.18.0-glibc-212.patch12
-rw-r--r--sys-apps/dnotify/files/dnotify-0.18.0-nls.patch10
-rw-r--r--sys-apps/dnotify/metadata.xml5
-rw-r--r--sys-apps/dog/Manifest1
-rw-r--r--sys-apps/dog/dog-1.7-r4.ebuild43
-rw-r--r--sys-apps/dog/files/1.7-manpage-touchup.patch18
-rw-r--r--sys-apps/dog/files/dog-1.7-64bit-goodness.patch33
-rw-r--r--sys-apps/dog/files/dog-1.7-check-ctime.diff53
-rw-r--r--sys-apps/dog/files/dog-1.7-strfry.patch13
-rw-r--r--sys-apps/dog/metadata.xml5
-rw-r--r--sys-apps/dstat/Manifest2
-rw-r--r--sys-apps/dstat/dstat-0.6.9-r1.ebuild44
-rw-r--r--sys-apps/dstat/dstat-0.7.2-r1.ebuild48
-rw-r--r--sys-apps/dstat/files/dstat-0.6.9-CVE-2009-3894.patch15
-rw-r--r--sys-apps/dstat/metadata.xml20
-rw-r--r--sys-apps/dtc/Manifest3
-rw-r--r--sys-apps/dtc/dtc-1.3.0-r1.ebuild52
-rw-r--r--sys-apps/dtc/dtc-1.3.0.ebuild46
-rw-r--r--sys-apps/dtc/dtc-1.4.0.ebuild52
-rw-r--r--sys-apps/dtc/dtc-1.4.1-r1.ebuild52
-rw-r--r--sys-apps/dtc/dtc-1.4.1.ebuild49
-rw-r--r--sys-apps/dtc/dtc-9999.ebuild49
-rw-r--r--sys-apps/dtc/files/dtc-1.3.0-fdtdump.patch118
-rw-r--r--sys-apps/dtc/files/dtc-1.4.1-echo-n.patch95
-rw-r--r--sys-apps/dtc/files/dtc-1.4.1-missing-syms.patch30
-rw-r--r--sys-apps/dtc/metadata.xml8
-rw-r--r--sys-apps/ed/Manifest3
-rw-r--r--sys-apps/ed/ed-1.10.ebuild30
-rw-r--r--sys-apps/ed/ed-1.11.ebuild31
-rw-r--r--sys-apps/ed/ed-1.12.ebuild31
-rw-r--r--sys-apps/ed/files/ed-1.5-build.patch32
-rw-r--r--sys-apps/ed/metadata.xml5
-rw-r--r--sys-apps/edac-utils/Manifest1
-rw-r--r--sys-apps/edac-utils/edac-utils-0.18.ebuild43
-rw-r--r--sys-apps/edac-utils/metadata.xml11
-rw-r--r--sys-apps/elfix/Manifest2
-rw-r--r--sys-apps/elfix/elfix-0.8.4.ebuild38
-rw-r--r--sys-apps/elfix/elfix-0.9.0-r1.ebuild45
-rw-r--r--sys-apps/elfix/files/elfix-0.9.0-backport-fix-paxmark_sh.patch57
-rw-r--r--sys-apps/elfix/files/elfix-0.9.0-backport-fix-revdep-pax.patch25
-rw-r--r--sys-apps/elfix/metadata.xml13
-rw-r--r--sys-apps/entropy-server/Manifest1
-rw-r--r--sys-apps/entropy-server/entropy-server-254.ebuild36
-rw-r--r--sys-apps/entropy-server/metadata.xml12
-rw-r--r--sys-apps/entropy/Manifest1
-rw-r--r--sys-apps/entropy/entropy-254.ebuild112
-rw-r--r--sys-apps/entropy/metadata.xml11
-rw-r--r--sys-apps/epoch/Manifest8
-rw-r--r--sys-apps/epoch/epoch-1.0.1.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.0.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.0_rc1.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.0_rc2.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.1.1.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.2.0.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.2.1.ebuild74
-rw-r--r--sys-apps/epoch/epoch-1.2.2.ebuild74
-rw-r--r--sys-apps/epoch/epoch-9999.ebuild74
-rw-r--r--sys-apps/epoch/files/epoch-1.0-fix-CFLAGS.patch10
-rw-r--r--sys-apps/epoch/files/epoch-1.0_rc1-epoch.conf77
-rw-r--r--sys-apps/epoch/files/epoch-1.0_rc1-fix-CFLAGS.patch11
-rw-r--r--sys-apps/epoch/metadata.xml27
-rw-r--r--sys-apps/etckeeper/Manifest3
-rw-r--r--sys-apps/etckeeper/etckeeper-1.11-r1.ebuild75
-rw-r--r--sys-apps/etckeeper/etckeeper-1.18.1.ebuild75
-rw-r--r--sys-apps/etckeeper/etckeeper-1.18.ebuild75
-rw-r--r--sys-apps/etckeeper/files/99etckeeper1
-rw-r--r--sys-apps/etckeeper/files/bashrc4
-rw-r--r--sys-apps/etckeeper/files/bashrc-r14
-rw-r--r--sys-apps/etckeeper/files/etckeeper-1.11-gentoo.patch64
-rw-r--r--sys-apps/etckeeper/files/etckeeper-1.18-gentoo.patch86
-rw-r--r--sys-apps/etckeeper/metadata.xml22
-rw-r--r--sys-apps/ethtool/Manifest12
-rw-r--r--sys-apps/ethtool/ethtool-2.6.39.ebuild14
-rw-r--r--sys-apps/ethtool/ethtool-3.0.ebuild14
-rw-r--r--sys-apps/ethtool/ethtool-3.10.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.12.1.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.13.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.14.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.15.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.16.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.18.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-3.4.2.ebuild14
-rw-r--r--sys-apps/ethtool/ethtool-3.8.ebuild15
-rw-r--r--sys-apps/ethtool/ethtool-4.0.ebuild15
-rw-r--r--sys-apps/ethtool/metadata.xml16
-rw-r--r--sys-apps/fakechroot/Manifest1
-rw-r--r--sys-apps/fakechroot/fakechroot-2.17.2.ebuild27
-rw-r--r--sys-apps/fakechroot/metadata.xml9
-rw-r--r--sys-apps/fakeroot-ng/Manifest3
-rw-r--r--sys-apps/fakeroot-ng/fakeroot-ng-0.17.ebuild22
-rw-r--r--sys-apps/fakeroot-ng/fakeroot-ng-0.18-r1.ebuild22
-rw-r--r--sys-apps/fakeroot-ng/fakeroot-ng-0.18.ebuild18
-rw-r--r--sys-apps/fakeroot-ng/files/fakeroot-ng-gcc-4.8.2.patch10
-rw-r--r--sys-apps/fakeroot-ng/metadata.xml12
-rw-r--r--sys-apps/fakeroot/Manifest4
-rw-r--r--sys-apps/fakeroot/fakeroot-1.18.4.ebuild38
-rw-r--r--sys-apps/fakeroot/fakeroot-1.19.ebuild37
-rw-r--r--sys-apps/fakeroot/fakeroot-1.20.2.ebuild38
-rw-r--r--sys-apps/fakeroot/fakeroot-1.20.ebuild38
-rw-r--r--sys-apps/fakeroot/files/fakeroot-1.18.4-no-acl_h.patch35
-rw-r--r--sys-apps/fakeroot/files/fakeroot-1.19-no-acl_h.patch37
-rw-r--r--sys-apps/fakeroot/metadata.xml5
-rw-r--r--sys-apps/fbset/Manifest1
-rw-r--r--sys-apps/fbset/fbset-2.1.ebuild36
-rw-r--r--sys-apps/fbset/files/fbset-2.1-build.patch21
-rw-r--r--sys-apps/fbset/metadata.xml5
-rw-r--r--sys-apps/file/Manifest3
-rw-r--r--sys-apps/file/file-5.22-r1.ebuild105
-rw-r--r--sys-apps/file/file-5.22.ebuild105
-rw-r--r--sys-apps/file/file-5.23.ebuild105
-rw-r--r--sys-apps/file/file-5.24.ebuild105
-rw-r--r--sys-apps/file/file-9999.ebuild105
-rw-r--r--sys-apps/file/metadata.xml8
-rw-r--r--sys-apps/findutils/Manifest3
-rw-r--r--sys-apps/findutils/files/findutils-4.4.2-gnulib-date-x32.patch26
-rw-r--r--sys-apps/findutils/files/findutils-4.4.2-selinux.diff464
-rw-r--r--sys-apps/findutils/files/findutils-4.5.14-test-bashisms.patch66
-rw-r--r--sys-apps/findutils/findutils-4.4.2-r1.ebuild54
-rw-r--r--sys-apps/findutils/findutils-4.4.2-r2.ebuild56
-rw-r--r--sys-apps/findutils/findutils-4.5.12.ebuild50
-rw-r--r--sys-apps/findutils/findutils-4.5.14-r1.ebuild56
-rw-r--r--sys-apps/findutils/findutils-4.5.14.ebuild50
-rw-r--r--sys-apps/findutils/metadata.xml8
-rw-r--r--sys-apps/flashrom/Manifest3
-rw-r--r--sys-apps/flashrom/flashrom-0.9.6.1.ebuild99
-rw-r--r--sys-apps/flashrom/flashrom-0.9.7.ebuild114
-rw-r--r--sys-apps/flashrom/flashrom-0.9.8.ebuild128
-rw-r--r--sys-apps/flashrom/flashrom-9999.ebuild128
-rw-r--r--sys-apps/flashrom/metadata.xml60
-rw-r--r--sys-apps/flock/Manifest1
-rw-r--r--sys-apps/flock/flock-2.19.ebuild20
-rw-r--r--sys-apps/flock/metadata.xml5
-rw-r--r--sys-apps/fwcrv/Manifest1
-rw-r--r--sys-apps/fwcrv/files/fwcrv-0.1.0-endian.patch47
-rw-r--r--sys-apps/fwcrv/fwcrv-0.1.0.ebuild30
-rw-r--r--sys-apps/fwcrv/metadata.xml5
-rw-r--r--sys-apps/fwts/Manifest2
-rw-r--r--sys-apps/fwts/fwts-14.12.00.ebuild49
-rw-r--r--sys-apps/fwts/fwts-15.03.01.ebuild45
-rw-r--r--sys-apps/fwts/metadata.xml11
-rw-r--r--sys-apps/fxload/Manifest1
-rw-r--r--sys-apps/fxload/fxload-20081013-r1.ebuild36
-rw-r--r--sys-apps/fxload/metadata.xml11
-rw-r--r--sys-apps/gawk/Manifest4
-rw-r--r--sys-apps/gawk/files/filefuncs/Makefile57
-rw-r--r--sys-apps/gawk/files/filefuncs/filefuncs.c485
-rw-r--r--sys-apps/gawk/files/gawk-4.1.0-ports.patch189
-rw-r--r--sys-apps/gawk/files/gawk-4.1.3-bsd_configure_readline.patch63
-rw-r--r--sys-apps/gawk/gawk-3.1.8.ebuild78
-rw-r--r--sys-apps/gawk/gawk-4.0.2.ebuild74
-rw-r--r--sys-apps/gawk/gawk-4.1.2.ebuild74
-rw-r--r--sys-apps/gawk/gawk-4.1.3.ebuild77
-rw-r--r--sys-apps/gawk/metadata.xml8
-rw-r--r--sys-apps/gentoo-functions/Manifest5
-rw-r--r--sys-apps/gentoo-functions/gentoo-functions-0.10.ebuild31
-rw-r--r--sys-apps/gentoo-functions/gentoo-functions-0.7.ebuild26
-rw-r--r--sys-apps/gentoo-functions/gentoo-functions-0.8.ebuild34
-rw-r--r--sys-apps/gentoo-functions/gentoo-functions-0.9.ebuild30
-rw-r--r--sys-apps/gentoo-functions/gentoo-functions-9999.ebuild31
-rw-r--r--sys-apps/gentoo-functions/metadata.xml20
-rw-r--r--sys-apps/gentoo-systemd-integration/Manifest2
-rw-r--r--sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-2.ebuild28
-rw-r--r--sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-4.ebuild30
-rw-r--r--sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-9999.ebuild44
-rw-r--r--sys-apps/gentoo-systemd-integration/metadata.xml11
-rw-r--r--sys-apps/gnome-disk-utility/Manifest2
-rw-r--r--sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-kill-gsd-automagic.patch46
-rw-r--r--sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-raise-gsd-dependency.patch35
-rw-r--r--sys-apps/gnome-disk-utility/gnome-disk-utility-3.14.0.ebuild56
-rw-r--r--sys-apps/gnome-disk-utility/gnome-disk-utility-3.16.2.ebuild56
-rw-r--r--sys-apps/gnome-disk-utility/metadata.xml9
-rw-r--r--sys-apps/gpet/Manifest1
-rw-r--r--sys-apps/gpet/gpet-0.4.ebuild23
-rw-r--r--sys-apps/gpet/metadata.xml10
-rw-r--r--sys-apps/gptfdisk/Manifest2
-rw-r--r--sys-apps/gptfdisk/gptfdisk-0.8.10.ebuild47
-rw-r--r--sys-apps/gptfdisk/gptfdisk-1.0.0.ebuild47
-rw-r--r--sys-apps/gptfdisk/metadata.xml15
-rw-r--r--sys-apps/gradm/Manifest3
-rw-r--r--sys-apps/gradm/files/respect-gentoo-env-r2.patch42
-rw-r--r--sys-apps/gradm/files/respect-gentoo-env-r3.patch42
-rw-r--r--sys-apps/gradm/gradm-3.1.201506081912.ebuild48
-rw-r--r--sys-apps/gradm/gradm-3.1.201507041117.ebuild48
-rw-r--r--sys-apps/gradm/gradm-3.1.201507191652.ebuild48
-rw-r--r--sys-apps/gradm/metadata.xml9
-rw-r--r--sys-apps/grep/Manifest2
-rw-r--r--sys-apps/grep/grep-2.21-r1.ebuild54
-rw-r--r--sys-apps/grep/metadata.xml8
-rw-r--r--sys-apps/groff/Manifest3
-rw-r--r--sys-apps/groff/files/groff-1.19.2-man-unicode-dashes.patch24
-rw-r--r--sys-apps/groff/files/groff-1.22.2-parallel-mom.patch96
-rw-r--r--sys-apps/groff/files/groff-1.22.3-parallel-mom.patch11
-rw-r--r--sys-apps/groff/groff-1.22.2.ebuild90
-rw-r--r--sys-apps/groff/groff-1.22.3.ebuild78
-rw-r--r--sys-apps/groff/metadata.xml5
-rw-r--r--sys-apps/gscanbus/Manifest1
-rw-r--r--sys-apps/gscanbus/gscanbus-0.8.ebuild21
-rw-r--r--sys-apps/gscanbus/metadata.xml8
-rw-r--r--sys-apps/gsmartcontrol/Manifest1
-rw-r--r--sys-apps/gsmartcontrol/gsmartcontrol-0.8.7.ebuild41
-rw-r--r--sys-apps/gsmartcontrol/metadata.xml12
-rw-r--r--sys-apps/hardened-shadow/Manifest1
-rw-r--r--sys-apps/hardened-shadow/hardened-shadow-0.9.2.ebuild36
-rw-r--r--sys-apps/hardened-shadow/metadata.xml11
-rw-r--r--sys-apps/haveged/Manifest3
-rw-r--r--sys-apps/haveged/files/haveged-conf.d10
-rw-r--r--sys-apps/haveged/files/haveged-init.d.216
-rw-r--r--sys-apps/haveged/files/haveged-init.d.317
-rw-r--r--sys-apps/haveged/files/haveged.conf7
-rw-r--r--sys-apps/haveged/files/service.gentoo12
-rw-r--r--sys-apps/haveged/haveged-1.5.ebuild33
-rw-r--r--sys-apps/haveged/haveged-1.7a-r1.ebuild41
-rw-r--r--sys-apps/haveged/haveged-1.7a.ebuild39
-rw-r--r--sys-apps/haveged/haveged-1.9.1.ebuild44
-rw-r--r--sys-apps/haveged/metadata.xml9
-rw-r--r--sys-apps/hbaapi/Manifest2
-rw-r--r--sys-apps/hbaapi/files/hba.conf43
-rw-r--r--sys-apps/hbaapi/files/hbaapi-2.2-qa.patch37
-rw-r--r--sys-apps/hbaapi/hbaapi-2.2.ebuild47
-rw-r--r--sys-apps/hbaapi/metadata.xml8
-rw-r--r--sys-apps/hdparm/Manifest4
-rw-r--r--sys-apps/hdparm/files/hdparm-conf.d.326
-rw-r--r--sys-apps/hdparm/files/hdparm-init-861
-rw-r--r--sys-apps/hdparm/hdparm-9.39.ebuild40
-rw-r--r--sys-apps/hdparm/hdparm-9.45.ebuild41
-rw-r--r--sys-apps/hdparm/hdparm-9.47.ebuild41
-rw-r--r--sys-apps/hdparm/hdparm-9.48.ebuild41
-rw-r--r--sys-apps/hdparm/metadata.xml8
-rw-r--r--sys-apps/heirloom-tools/Manifest1
-rw-r--r--sys-apps/heirloom-tools/heirloom-tools-070715.ebuild42
-rw-r--r--sys-apps/heirloom-tools/metadata.xml8
-rw-r--r--sys-apps/help2man/Manifest3
-rw-r--r--sys-apps/help2man/files/help2man-1.36.4-respect-LDFLAGS.patch11
-rw-r--r--sys-apps/help2man/files/help2man-1.38.4-linguas.patch53
-rw-r--r--sys-apps/help2man/files/help2man-1.46.1-linguas.patch67
-rw-r--r--sys-apps/help2man/help2man-1.45.1.ebuild31
-rw-r--r--sys-apps/help2man/help2man-1.46.6.ebuild33
-rw-r--r--sys-apps/help2man/help2man-1.47.1.ebuild33
-rw-r--r--sys-apps/help2man/metadata.xml5
-rw-r--r--sys-apps/hexdump-esr/Manifest1
-rw-r--r--sys-apps/hexdump-esr/hexdump-esr-1.8.ebuild37
-rw-r--r--sys-apps/hexdump-esr/metadata.xml7
-rw-r--r--sys-apps/hotplug2stdout/Manifest1
-rw-r--r--sys-apps/hotplug2stdout/hotplug2stdout-1.2.1.ebuild20
-rw-r--r--sys-apps/hotplug2stdout/metadata.xml8
-rw-r--r--sys-apps/hprofile/Manifest3
-rw-r--r--sys-apps/hprofile/hprofile-3.0.6.ebuild19
-rw-r--r--sys-apps/hprofile/hprofile-3.1.1.ebuild19
-rw-r--r--sys-apps/hprofile/hprofile-3.2.2.ebuild19
-rw-r--r--sys-apps/hprofile/metadata.xml8
-rw-r--r--sys-apps/hwdata-gentoo/Manifest1
-rw-r--r--sys-apps/hwdata-gentoo/files/0.4-openchrome.patch22
-rw-r--r--sys-apps/hwdata-gentoo/hwdata-gentoo-0.4.ebuild41
-rw-r--r--sys-apps/hwdata-gentoo/metadata.xml9
-rw-r--r--sys-apps/hwdata-redhat/Manifest1
-rw-r--r--sys-apps/hwdata-redhat/files/hwdata-redhat-0.217-python-3.patch13
-rw-r--r--sys-apps/hwdata-redhat/hwdata-redhat-0.217.ebuild39
-rw-r--r--sys-apps/hwdata-redhat/metadata.xml8
-rw-r--r--sys-apps/hwids/Manifest8
-rw-r--r--sys-apps/hwids/hwids-20141010.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20141110.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20141214.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20150107.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20150129.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20150417.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20150421-r1.ebuild73
-rw-r--r--sys-apps/hwids/hwids-20150421.ebuild65
-rw-r--r--sys-apps/hwids/hwids-20150717-r1.ebuild73
-rw-r--r--sys-apps/hwids/hwids-20150717.ebuild65
-rw-r--r--sys-apps/hwids/hwids-99999999.ebuild73
-rw-r--r--sys-apps/hwids/metadata.xml23
-rw-r--r--sys-apps/hwinfo/Manifest3
-rw-r--r--sys-apps/hwinfo/hwinfo-19.1.ebuild57
-rw-r--r--sys-apps/hwinfo/hwinfo-20.0.ebuild62
-rw-r--r--sys-apps/hwinfo/hwinfo-21.4.ebuild64
-rw-r--r--sys-apps/hwinfo/metadata.xml8
-rw-r--r--sys-apps/hwloc/Manifest7
-rw-r--r--sys-apps/hwloc/files/hwloc-1.8.1-gl.patch11
-rw-r--r--sys-apps/hwloc/files/hwloc-gather-topology-fix-lstopo-path-after-install.patch26
-rw-r--r--sys-apps/hwloc/hwloc-1.10.0-r2.ebuild77
-rw-r--r--sys-apps/hwloc/hwloc-1.10.0.ebuild72
-rw-r--r--sys-apps/hwloc/hwloc-1.10.1-r1.ebuild72
-rw-r--r--sys-apps/hwloc/hwloc-1.6.1.ebuild52
-rw-r--r--sys-apps/hwloc/hwloc-1.6.2.ebuild56
-rw-r--r--sys-apps/hwloc/hwloc-1.7.2.ebuild72
-rw-r--r--sys-apps/hwloc/hwloc-1.8.1.ebuild73
-rw-r--r--sys-apps/hwloc/hwloc-1.9.ebuild73
-rw-r--r--sys-apps/hwloc/metadata.xml21
-rw-r--r--sys-apps/hwsetup/Manifest1
-rw-r--r--sys-apps/hwsetup/files/1.2-3-fastprobe.patch74
-rw-r--r--sys-apps/hwsetup/files/1.2-7-dyn_blacklist.patch62
-rw-r--r--sys-apps/hwsetup/files/1.2-7-gentoo.patch20
-rw-r--r--sys-apps/hwsetup/files/1.2-7-openchrome.patch11
-rw-r--r--sys-apps/hwsetup/files/1.2-strip.patch11
-rw-r--r--sys-apps/hwsetup/hwsetup-1.2-r3.ebuild70
-rw-r--r--sys-apps/hwsetup/metadata.xml5
-rw-r--r--sys-apps/i2c-tools/Manifest2
-rw-r--r--sys-apps/i2c-tools/files/i2c-tools-3.1.1-python-3.patch129
-rw-r--r--sys-apps/i2c-tools/i2c-tools-3.0.2.ebuild61
-rw-r--r--sys-apps/i2c-tools/i2c-tools-3.1.1-r1.ebuild60
-rw-r--r--sys-apps/i2c-tools/metadata.xml5
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/Manifest2
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-remove-doc.patch14
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-removeinitandvscsis.patch23
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.6-removeinitandvscsis.patch27
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/files/ibmvscsis69
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.0.ebuild46
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.6.ebuild37
-rw-r--r--sys-apps/ibm-powerpc-utils-papr/metadata.xml5
-rw-r--r--sys-apps/ibm-powerpc-utils/Manifest5
-rw-r--r--sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.1.0-remove-doc.patch23
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.1.0.ebuild38
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.12.ebuild30
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.2.ebuild32
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.25.ebuild30
-rw-r--r--sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.26.ebuild30
-rw-r--r--sys-apps/ibm-powerpc-utils/metadata.xml11
-rw-r--r--sys-apps/idle3-tools/Manifest1
-rw-r--r--sys-apps/idle3-tools/idle3-tools-0.9.1.ebuild23
-rw-r--r--sys-apps/idle3-tools/metadata.xml17
-rw-r--r--sys-apps/ifd-gempc/Manifest1
-rw-r--r--sys-apps/ifd-gempc/files/reader.conf11
-rw-r--r--sys-apps/ifd-gempc/ifd-gempc-1.0.6.ebuild52
-rw-r--r--sys-apps/ifd-gempc/metadata.xml9
-rw-r--r--sys-apps/ifplugd/Manifest1
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-interface.patch13
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff12
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-noip.patch21
-rw-r--r--sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch63
-rw-r--r--sys-apps/ifplugd/files/ifplugd.action55
-rw-r--r--sys-apps/ifplugd/ifplugd-0.28-r9.ebuild71
-rw-r--r--sys-apps/ifplugd/metadata.xml8
-rw-r--r--sys-apps/input-utils/Manifest2
-rw-r--r--sys-apps/input-utils/files/input-utils-0.0.1-protocol-mismatch-fix.patch22
-rw-r--r--sys-apps/input-utils/files/input-utils-0.0.1_pre20081014.patch116
-rw-r--r--sys-apps/input-utils/input-utils-0.0.1_pre20081014.ebuild35
-rw-r--r--sys-apps/input-utils/input-utils-1.1.ebuild37
-rw-r--r--sys-apps/input-utils/metadata.xml19
-rw-r--r--sys-apps/install-xattr/Manifest2
-rw-r--r--sys-apps/install-xattr/install-xattr-0.4.ebuild45
-rw-r--r--sys-apps/install-xattr/install-xattr-0.5.ebuild45
-rw-r--r--sys-apps/install-xattr/install-xattr-9999.ebuild45
-rw-r--r--sys-apps/install-xattr/metadata.xml9
-rw-r--r--sys-apps/intel-performance-counter-monitor/Manifest1
-rw-r--r--sys-apps/intel-performance-counter-monitor/intel-performance-counter-monitor-2.8.ebuild50
-rw-r--r--sys-apps/intel-performance-counter-monitor/metadata.xml10
-rw-r--r--sys-apps/inxi/Manifest2
-rw-r--r--sys-apps/inxi/inxi-2.2.14.ebuild39
-rw-r--r--sys-apps/inxi/inxi-2.2.19.ebuild39
-rw-r--r--sys-apps/inxi/metadata.xml8
-rw-r--r--sys-apps/iotools/Manifest2
-rw-r--r--sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch22
-rw-r--r--sys-apps/iotools/files/iotools-1.4-ldflags.patch13
-rw-r--r--sys-apps/iotools/iotools-1.4.ebuild52
-rw-r--r--sys-apps/iotools/iotools-1.5.ebuild54
-rw-r--r--sys-apps/iotools/metadata.xml10
-rw-r--r--sys-apps/ipmitool/Manifest5
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.confd23
-rw-r--r--sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.initd25
-rw-r--r--sys-apps/ipmitool/ipmitool-1.8.11-r1.ebuild76
-rw-r--r--sys-apps/ipmitool/ipmitool-1.8.11.ebuild60
-rw-r--r--sys-apps/ipmitool/ipmitool-1.8.14-r1.ebuild82
-rw-r--r--sys-apps/ipmitool/ipmitool-1.8.14.ebuild81
-rw-r--r--sys-apps/ipmitool/metadata.xml13
-rw-r--r--sys-apps/ipmiutil/Manifest4
-rw-r--r--sys-apps/ipmiutil/files/ipmiutil-2.9.3-flags.patch20
-rw-r--r--sys-apps/ipmiutil/files/ipmiutil-2.9.3-tmpdir.patch11
-rw-r--r--sys-apps/ipmiutil/ipmiutil-2.7.7.ebuild34
-rw-r--r--sys-apps/ipmiutil/ipmiutil-2.8.2.ebuild36
-rw-r--r--sys-apps/ipmiutil/ipmiutil-2.8.5.ebuild34
-rw-r--r--sys-apps/ipmiutil/ipmiutil-2.9.3.ebuild38
-rw-r--r--sys-apps/ipmiutil/metadata.xml8
-rw-r--r--sys-apps/iproute2/Manifest8
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.26-ldflags.patch15
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch224
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.29.1-hfsc.patch885
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.35-cached-routes.patch34
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.35-no-iptables.patch15
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.35-no-ipv6.patch27
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.35-xtables.patch30
-rw-r--r--sys-apps/iproute2/files/iproute2-2.6.38-parallel-build.patch40
-rw-r--r--sys-apps/iproute2/files/iproute2-3.1.0-mtu.patch48
-rw-r--r--sys-apps/iproute2/files/iproute2-3.1.0-no-ipv6.patch41
-rw-r--r--sys-apps/iproute2/files/iproute2-3.10.0-no-ipv6.patch41
-rw-r--r--sys-apps/iproute2/files/iproute2-3.6.0-pkg-config.patch67
-rw-r--r--sys-apps/iproute2/files/iproute2-3.7.0-clang.patch72
-rw-r--r--sys-apps/iproute2/files/iproute2-3.7.0-man7.patch55
-rw-r--r--sys-apps/iproute2/files/iproute2-3.8.0-old-mount-libc.patch38
-rw-r--r--sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch62
-rw-r--r--sys-apps/iproute2/iproute2-2.6.38.ebuild90
-rw-r--r--sys-apps/iproute2/iproute2-3.17.0.ebuild124
-rw-r--r--sys-apps/iproute2/iproute2-3.19.0.ebuild124
-rw-r--r--sys-apps/iproute2/iproute2-3.3.0.ebuild105
-rw-r--r--sys-apps/iproute2/iproute2-3.8.0.ebuild117
-rw-r--r--sys-apps/iproute2/iproute2-4.0.0-r2.ebuild129
-rw-r--r--sys-apps/iproute2/iproute2-4.1.0.ebuild129
-rw-r--r--sys-apps/iproute2/iproute2-4.1.1.ebuild131
-rw-r--r--sys-apps/iproute2/iproute2-9999.ebuild128
-rw-r--r--sys-apps/iproute2/metadata.xml10
-rw-r--r--sys-apps/irqbalance/Manifest6
-rw-r--r--sys-apps/irqbalance/files/irqbalance-0.56-build.patch16
-rw-r--r--sys-apps/irqbalance/files/irqbalance.164
-rw-r--r--sys-apps/irqbalance/files/irqbalance.confd15
-rw-r--r--sys-apps/irqbalance/files/irqbalance.confd-119
-rw-r--r--sys-apps/irqbalance/files/irqbalance.init-0.55-r221
-rw-r--r--sys-apps/irqbalance/files/irqbalance.init.212
-rw-r--r--sys-apps/irqbalance/files/irqbalance.init.328
-rw-r--r--sys-apps/irqbalance/files/irqbalance.service11
-rw-r--r--sys-apps/irqbalance/irqbalance-0.56.ebuild39
-rw-r--r--sys-apps/irqbalance/irqbalance-1.0.4.ebuild35
-rw-r--r--sys-apps/irqbalance/irqbalance-1.0.5-r1.ebuild40
-rw-r--r--sys-apps/irqbalance/irqbalance-1.0.6.ebuild40
-rw-r--r--sys-apps/irqbalance/irqbalance-1.0.7-r1.ebuild49
-rw-r--r--sys-apps/irqbalance/irqbalance-1.0.7.ebuild44
-rw-r--r--sys-apps/irqbalance/irqbalance-1.0.9.ebuild49
-rw-r--r--sys-apps/irqbalance/metadata.xml12
-rw-r--r--sys-apps/isapnptools/Manifest1
-rw-r--r--sys-apps/isapnptools/files/isapnp.rc26
-rw-r--r--sys-apps/isapnptools/files/isapnptools-1.26-gcc.patch41
-rw-r--r--sys-apps/isapnptools/files/isapnptools-1.27-include.patch10
-rw-r--r--sys-apps/isapnptools/isapnptools-1.27.ebuild33
-rw-r--r--sys-apps/isapnptools/metadata.xml5
-rw-r--r--sys-apps/kbd/Manifest4
-rw-r--r--sys-apps/kbd/files/kbd-1.15.5-loadkeys-parse.patch90
-rw-r--r--sys-apps/kbd/files/kbd-2.0.0-tests.patch34
-rw-r--r--sys-apps/kbd/files/kbd-2.0.1-big_endian.patch27
-rw-r--r--sys-apps/kbd/files/kbd-2.0.1-stdarg.patch43
-rw-r--r--sys-apps/kbd/kbd-1.15.5-r1.ebuild50
-rw-r--r--sys-apps/kbd/kbd-2.0.1-r1.ebuild64
-rw-r--r--sys-apps/kbd/kbd-2.0.1.ebuild55
-rw-r--r--sys-apps/kbd/kbd-2.0.2.ebuild62
-rw-r--r--sys-apps/kbd/kbd-2.0.3.ebuild62
-rw-r--r--sys-apps/kbd/kbd-9999.ebuild62
-rw-r--r--sys-apps/kbd/metadata.xml5
-rw-r--r--sys-apps/kexec-tools/Manifest3
-rw-r--r--sys-apps/kexec-tools/files/90_kexec9
-rw-r--r--sys-apps/kexec-tools/files/README.Gentoo33
-rw-r--r--sys-apps/kexec-tools/files/kexec-tools-2.0.0-respect-LDFLAGS.patch11
-rw-r--r--sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch17
-rw-r--r--sys-apps/kexec-tools/files/kexec-tools-2.0.4-out-of-source.patch24
-rw-r--r--sys-apps/kexec-tools/files/kexec-tools-2.0.9-hardened.patch16
-rw-r--r--sys-apps/kexec-tools/files/kexec.conf16
-rw-r--r--sys-apps/kexec-tools/files/kexec.conf-2.0.434
-rw-r--r--sys-apps/kexec-tools/files/kexec.conf-999918
-rw-r--r--sys-apps/kexec-tools/files/kexec.init-2.0.4144
-rw-r--r--sys-apps/kexec-tools/files/kexec.init-2.0.4-r2165
-rw-r--r--sys-apps/kexec-tools/files/kexec.init-2.0.4-r3165
-rw-r--r--sys-apps/kexec-tools/files/kexec.init-9999165
-rw-r--r--sys-apps/kexec-tools/files/kexec.service16
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild73
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.8.ebuild75
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.9-r1.ebuild71
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.9-r2.ebuild71
-rw-r--r--sys-apps/kexec-tools/kexec-tools-2.0.9.ebuild75
-rw-r--r--sys-apps/kexec-tools/kexec-tools-9999.ebuild74
-rw-r--r--sys-apps/kexec-tools/metadata.xml13
-rw-r--r--sys-apps/keyutils/Manifest3
-rw-r--r--sys-apps/keyutils/files/keyutils-1.5.5-makefile-fixup.patch27
-rw-r--r--sys-apps/keyutils/keyutils-1.5.5.ebuild69
-rw-r--r--sys-apps/keyutils/keyutils-1.5.8.ebuild69
-rw-r--r--sys-apps/keyutils/keyutils-1.5.9-r1.ebuild82
-rw-r--r--sys-apps/keyutils/keyutils-1.5.9.ebuild69
-rw-r--r--sys-apps/keyutils/metadata.xml8
-rw-r--r--sys-apps/kmod/Manifest2
-rw-r--r--sys-apps/kmod/files/kmod-static-nodes-r119
-rw-r--r--sys-apps/kmod/kmod-20.ebuild190
-rw-r--r--sys-apps/kmod/kmod-21.ebuild190
-rw-r--r--sys-apps/kmod/kmod-9999.ebuild190
-rw-r--r--sys-apps/kmod/metadata.xml13
-rw-r--r--sys-apps/lcdsplash/Manifest1
-rw-r--r--sys-apps/lcdsplash/lcdsplash-0.3.ebuild31
-rw-r--r--sys-apps/lcdsplash/metadata.xml5
-rw-r--r--sys-apps/lcdtest/Manifest1
-rw-r--r--sys-apps/lcdtest/files/1.18-build-system.patch62
-rw-r--r--sys-apps/lcdtest/lcdtest-1.18.ebuild61
-rw-r--r--sys-apps/lcdtest/metadata.xml14
-rw-r--r--sys-apps/lcdutils/Manifest1
-rw-r--r--sys-apps/lcdutils/files/include-stdlib.h-for-exit.patch50
-rw-r--r--sys-apps/lcdutils/lcdutils-0.2.ebuild34
-rw-r--r--sys-apps/lcdutils/metadata.xml14
-rw-r--r--sys-apps/less/Manifest6
-rw-r--r--sys-apps/less/files/README.Gentoo22
-rw-r--r--sys-apps/less/files/code2color-0.2.patch26
-rw-r--r--sys-apps/less/files/less.envd2
-rw-r--r--sys-apps/less/files/lesspipe.sh274
-rw-r--r--sys-apps/less/less-458.ebuild56
-rw-r--r--sys-apps/less/less-476.ebuild57
-rw-r--r--sys-apps/less/less-477.ebuild57
-rw-r--r--sys-apps/less/less-478.ebuild57
-rw-r--r--sys-apps/less/less-479.ebuild57
-rw-r--r--sys-apps/less/metadata.xml5
-rw-r--r--sys-apps/likwid/Manifest1
-rw-r--r--sys-apps/likwid/files/likwid-3.1.3-Makefile.patch42
-rw-r--r--sys-apps/likwid/files/likwid-3.1.3-fix-gnustack.patch32
-rw-r--r--sys-apps/likwid/likwid-3.1.3.ebuild67
-rw-r--r--sys-apps/likwid/metadata.xml10
-rw-r--r--sys-apps/linux-misc-apps/Manifest2
-rw-r--r--sys-apps/linux-misc-apps/files/freefall.confd6
-rw-r--r--sys-apps/linux-misc-apps/files/freefall.initd45
-rw-r--r--sys-apps/linux-misc-apps/files/hpfall.confd6
-rw-r--r--sys-apps/linux-misc-apps/files/hpfall.initd45
-rw-r--r--sys-apps/linux-misc-apps/linux-misc-apps-3.18.ebuild165
-rw-r--r--sys-apps/linux-misc-apps/linux-misc-apps-3.6-r2.ebuild185
-rw-r--r--sys-apps/linux-misc-apps/metadata.xml7
-rw-r--r--sys-apps/lkcdutils/Manifest4
-rw-r--r--sys-apps/lkcdutils/files/lkcdutils-6.2.0-build.patch24
-rw-r--r--sys-apps/lkcdutils/lkcdutils-4.1.1.ebuild67
-rw-r--r--sys-apps/lkcdutils/lkcdutils-6.2.0.ebuild35
-rw-r--r--sys-apps/lkcdutils/metadata.xml11
-rw-r--r--sys-apps/lm_sensors/Manifest3
-rw-r--r--sys-apps/lm_sensors/files/fancontrol-init.d-223
-rw-r--r--sys-apps/lm_sensors/files/fancontrol.service9
-rw-r--r--sys-apps/lm_sensors/files/lm_sensors-3-init.d105
-rw-r--r--sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch129
-rw-r--r--sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch118
-rw-r--r--sys-apps/lm_sensors/files/lm_sensors-3.3.5-sensors-detect-gentoo.patch120
-rw-r--r--sys-apps/lm_sensors/files/sensord-4-init.d22
-rw-r--r--sys-apps/lm_sensors/files/sensord-conf.d3
-rw-r--r--sys-apps/lm_sensors/files/sensord.service9
-rw-r--r--sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild109
-rw-r--r--sys-apps/lm_sensors/lm_sensors-3.3.5.ebuild109
-rw-r--r--sys-apps/lm_sensors/lm_sensors-3.4.0.ebuild109
-rw-r--r--sys-apps/lm_sensors/metadata.xml13
-rw-r--r--sys-apps/lmctfy/Manifest4
-rw-r--r--sys-apps/lmctfy/lmctfy-0.2.0.ebuild35
-rw-r--r--sys-apps/lmctfy/lmctfy-0.3.0.ebuild35
-rw-r--r--sys-apps/lmctfy/lmctfy-0.3.1.ebuild35
-rw-r--r--sys-apps/lmctfy/lmctfy-0.5.0-r1.ebuild38
-rw-r--r--sys-apps/lmctfy/lmctfy-0.5.0.ebuild35
-rw-r--r--sys-apps/lmctfy/metadata.xml11
-rw-r--r--sys-apps/lnxhc/Manifest1
-rw-r--r--sys-apps/lnxhc/files/lnxhc-1.2-ifconfig-path.patch23
-rw-r--r--sys-apps/lnxhc/files/lnxhc-1.2-usrlocal.patch43
-rw-r--r--sys-apps/lnxhc/lnxhc-1.2-r1.ebuild23
-rw-r--r--sys-apps/lnxhc/metadata.xml11
-rw-r--r--sys-apps/logwatch/Manifest3
-rwxr-xr-xsys-apps/logwatch/files/logwatch6
-rw-r--r--sys-apps/logwatch/files/logwatch-7.4.0-openssh-hpn.patch19
-rw-r--r--sys-apps/logwatch/logwatch-7.4.0-r1.ebuild86
-rw-r--r--sys-apps/logwatch/logwatch-7.4.0.ebuild78
-rw-r--r--sys-apps/logwatch/logwatch-7.4.0_p170-r1.ebuild87
-rw-r--r--sys-apps/logwatch/logwatch-7.4.1.ebuild85
-rw-r--r--sys-apps/logwatch/metadata.xml8
-rw-r--r--sys-apps/lomoco/Manifest1
-rw-r--r--sys-apps/lomoco/files/lomoco-1.0-gentoo-hardware-support.patch287
-rw-r--r--sys-apps/lomoco/files/lomoco-1.0-updated-udev.patch95
-rw-r--r--sys-apps/lomoco/files/lomoco-pm-utils-r17
-rw-r--r--sys-apps/lomoco/files/lomoco.conf9
-rw-r--r--sys-apps/lomoco/lomoco-1.0-r9.ebuild53
-rw-r--r--sys-apps/lomoco/metadata.xml10
-rw-r--r--sys-apps/lsadb/Manifest1
-rw-r--r--sys-apps/lsadb/files/lsadb-makefile.patch10
-rw-r--r--sys-apps/lsadb/lsadb-0.1.3.ebuild31
-rw-r--r--sys-apps/lsadb/metadata.xml5
-rw-r--r--sys-apps/lsb-release/Manifest1
-rw-r--r--sys-apps/lsb-release/files/lsb-release-1.4-os-release.patch10
-rw-r--r--sys-apps/lsb-release/lsb-release-1.4-r1.ebuild33
-rw-r--r--sys-apps/lsb-release/lsb-release-1.4-r2.ebuild36
-rw-r--r--sys-apps/lsb-release/lsb-release-1.4-r3.ebuild39
-rw-r--r--sys-apps/lsb-release/lsb-release-1.4.ebuild29
-rw-r--r--sys-apps/lsb-release/metadata.xml22
-rw-r--r--sys-apps/lshw/Manifest2
-rw-r--r--sys-apps/lshw/files/lshw-02.15b-build.patch116
-rw-r--r--sys-apps/lshw/files/lshw-02.16b-gentoo.patch161
-rw-r--r--sys-apps/lshw/files/lshw-02.17b-fat.patch10
-rw-r--r--sys-apps/lshw/files/lshw-02.17b-gentoo.patch159
-rw-r--r--sys-apps/lshw/lshw-02.16b-r2.ebuild70
-rw-r--r--sys-apps/lshw/lshw-02.17b-r1.ebuild72
-rw-r--r--sys-apps/lshw/lshw-02.17b.ebuild70
-rw-r--r--sys-apps/lshw/metadata.xml5
-rw-r--r--sys-apps/lssbus/Manifest1
-rw-r--r--sys-apps/lssbus/lssbus-0.1.ebuild20
-rw-r--r--sys-apps/lssbus/metadata.xml12
-rw-r--r--sys-apps/magneto-core/Manifest1
-rw-r--r--sys-apps/magneto-core/magneto-core-254.ebuild32
-rw-r--r--sys-apps/magneto-core/metadata.xml9
-rw-r--r--sys-apps/makedev/Manifest1
-rw-r--r--sys-apps/makedev/files/makedev-3.23.1-headers.patch12
-rw-r--r--sys-apps/makedev/makedev-3.23.1.ebuild53
-rw-r--r--sys-apps/makedev/metadata.xml5
-rw-r--r--sys-apps/man-db/Manifest3
-rw-r--r--sys-apps/man-db/files/man-db.cron10
-rw-r--r--sys-apps/man-db/man-db-2.6.6.ebuild81
-rw-r--r--sys-apps/man-db/man-db-2.6.7.1.ebuild81
-rw-r--r--sys-apps/man-db/man-db-2.7.1.ebuild89
-rw-r--r--sys-apps/man-db/metadata.xml5
-rw-r--r--sys-apps/man-pages-posix/Manifest1
-rw-r--r--sys-apps/man-pages-posix/files/man-pages-2.08-updates.patch11
-rw-r--r--sys-apps/man-pages-posix/man-pages-posix-2013a.ebuild33
-rw-r--r--sys-apps/man-pages-posix/metadata.xml5
-rw-r--r--sys-apps/man-pages/Manifest11
-rw-r--r--sys-apps/man-pages/man-pages-3.75.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.77.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.78.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.79.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.80.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.81.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.82.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-3.83.ebuild52
-rw-r--r--sys-apps/man-pages/man-pages-4.00.ebuild54
-rw-r--r--sys-apps/man-pages/man-pages-4.01.ebuild54
-rw-r--r--sys-apps/man-pages/metadata.xml5
-rw-r--r--sys-apps/man/Manifest1
-rw-r--r--sys-apps/man/files/makewhatis.cron5
-rw-r--r--sys-apps/man/files/man-1.5m2-apropos.patch16
-rw-r--r--sys-apps/man/files/man-1.6-cross-compile.patch61
-rw-r--r--sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch83
-rw-r--r--sys-apps/man/files/man-1.6e-headers.patch13
-rw-r--r--sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch69
-rw-r--r--sys-apps/man/files/man-1.6f-man2html-compression-2.patch61
-rw-r--r--sys-apps/man/files/man-1.6f-parallel-build.patch78
-rw-r--r--sys-apps/man/files/man-1.6f-so-search-2.patch34
-rw-r--r--sys-apps/man/files/man-1.6f-unicode.patch28
-rw-r--r--sys-apps/man/files/man-1.6g-compress.patch17
-rw-r--r--sys-apps/man/files/man-1.6g-echo-escape.patch15
-rw-r--r--sys-apps/man/files/man-1.6g-fbsd.patch15
-rw-r--r--sys-apps/man/files/man-1.6g-xz.patch53
-rw-r--r--sys-apps/man/man-1.6g-r1.ebuild129
-rw-r--r--sys-apps/man/man-1.6g.ebuild128
-rw-r--r--sys-apps/man/metadata.xml5
-rw-r--r--sys-apps/mawk/Manifest5
-rw-r--r--sys-apps/mawk/files/mawk-1.3.4-cross-compile.patch13
-rw-r--r--sys-apps/mawk/mawk-1.3.4_p20100625.ebuild32
-rw-r--r--sys-apps/mawk/mawk-1.3.4_p20131226.ebuild43
-rw-r--r--sys-apps/mawk/mawk-1.3.4_p20140914.ebuild43
-rw-r--r--sys-apps/mawk/mawk-1.3.4_p20141027.ebuild43
-rw-r--r--sys-apps/mawk/mawk-1.3.4_p20141206.ebuild43
-rw-r--r--sys-apps/mawk/metadata.xml5
-rw-r--r--sys-apps/memtest86+/Manifest4
-rw-r--r--sys-apps/memtest86+/files/39_memtest86+33
-rw-r--r--sys-apps/memtest86+/files/make-memtest86+-boot-floppy111
-rw-r--r--sys-apps/memtest86+/files/make-memtest86+-boot-floppy.139
-rw-r--r--sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch11
-rw-r--r--sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch30
-rw-r--r--sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch30
-rw-r--r--sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch30
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch54
-rw-r--r--sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch16
-rw-r--r--sys-apps/memtest86+/memtest86+-2.01.ebuild56
-rw-r--r--sys-apps/memtest86+/memtest86+-4.00.ebuild75
-rw-r--r--sys-apps/memtest86+/memtest86+-4.20-r1.ebuild88
-rw-r--r--sys-apps/memtest86+/memtest86+-4.20-r2.ebuild74
-rw-r--r--sys-apps/memtest86+/memtest86+-5.01-r1.ebuild76
-rw-r--r--sys-apps/memtest86+/memtest86+-5.01.ebuild90
-rw-r--r--sys-apps/memtest86+/metadata.xml9
-rw-r--r--sys-apps/memtest86/Manifest3
-rw-r--r--sys-apps/memtest86/files/39_memtest8618
-rw-r--r--sys-apps/memtest86/files/memtest86-3.2-solar.patch27
-rw-r--r--sys-apps/memtest86/files/memtest86-3.3-funky-test.patch15
-rw-r--r--sys-apps/memtest86/files/memtest86-3.3-gnu-hash.patch12
-rw-r--r--sys-apps/memtest86/files/memtest86-4.0-build.patch41
-rw-r--r--sys-apps/memtest86/files/memtest86-4.3.3-build-nopie.patch47
-rw-r--r--sys-apps/memtest86/files/memtest86-4.3.3-build.patch43
-rw-r--r--sys-apps/memtest86/memtest86-3.3.ebuild55
-rw-r--r--sys-apps/memtest86/memtest86-4.3.6.ebuild65
-rw-r--r--sys-apps/memtest86/memtest86-4.3.7.ebuild65
-rw-r--r--sys-apps/memtest86/metadata.xml8
-rw-r--r--sys-apps/memtester/Manifest2
-rw-r--r--sys-apps/memtester/memtester-4.2.2.ebuild28
-rw-r--r--sys-apps/memtester/memtester-4.3.0.ebuild28
-rw-r--r--sys-apps/memtester/metadata.xml5
-rw-r--r--sys-apps/metadata.xml45
-rw-r--r--sys-apps/microcode-ctl/Manifest3
-rw-r--r--sys-apps/microcode-ctl/files/microcode_ctl.conf.d11
-rw-r--r--sys-apps/microcode-ctl/files/microcode_ctl.rc25
-rw-r--r--sys-apps/microcode-ctl/files/microcode_ctl.rc-r125
-rw-r--r--sys-apps/microcode-ctl/metadata.xml5
-rw-r--r--sys-apps/microcode-ctl/microcode-ctl-1.23.ebuild51
-rw-r--r--sys-apps/microcode-ctl/microcode-ctl-1.27.ebuild51
-rw-r--r--sys-apps/microcode-ctl/microcode-ctl-1.28.ebuild51
-rw-r--r--sys-apps/microcode-data/Manifest4
-rw-r--r--sys-apps/microcode-data/files/intel-microcode2ucode.c163
-rw-r--r--sys-apps/microcode-data/metadata.xml5
-rw-r--r--sys-apps/microcode-data/microcode-data-20140430.ebuild45
-rw-r--r--sys-apps/microcode-data/microcode-data-20140624.ebuild45
-rw-r--r--sys-apps/microcode-data/microcode-data-20140913.ebuild45
-rw-r--r--sys-apps/microcode-data/microcode-data-20150121.ebuild45
-rw-r--r--sys-apps/minised/Manifest2
-rw-r--r--sys-apps/minised/metadata.xml6
-rw-r--r--sys-apps/minised/minised-1.13.ebuild24
-rw-r--r--sys-apps/minised/minised-1.14.ebuild19
-rw-r--r--sys-apps/miscfiles/Manifest5
-rw-r--r--sys-apps/miscfiles/files/miscfiles-1.3-Makefile.diff18
-rw-r--r--sys-apps/miscfiles/metadata.xml5
-rw-r--r--sys-apps/miscfiles/miscfiles-1.4.2-r1.ebuild53
-rw-r--r--sys-apps/miscfiles/miscfiles-1.5-r1.ebuild62
-rw-r--r--sys-apps/miscfiles/miscfiles-1.5.ebuild62
-rw-r--r--sys-apps/mlocate/Manifest1
-rw-r--r--sys-apps/mlocate/files/mlocate-cron.conf9
-rw-r--r--sys-apps/mlocate/files/mlocate.cron-r248
-rw-r--r--sys-apps/mlocate/files/updatedb.conf17
-rw-r--r--sys-apps/mlocate/metadata.xml9
-rw-r--r--sys-apps/mlocate/mlocate-0.26-r1.ebuild63
-rw-r--r--sys-apps/modutils/Manifest1
-rw-r--r--sys-apps/modutils/files/modutils-2.4.27-alias.patch86
-rw-r--r--sys-apps/modutils/files/modutils-2.4.27-flex.patch37
-rw-r--r--sys-apps/modutils/files/modutils-2.4.27-gcc.patch280
-rw-r--r--sys-apps/modutils/files/modutils-2.4.27-no-nested-function.patch43
-rw-r--r--sys-apps/modutils/metadata.xml5
-rw-r--r--sys-apps/modutils/modutils-2.4.27-r1.ebuild40
-rw-r--r--sys-apps/more/Manifest1
-rw-r--r--sys-apps/more/files/more-2.12r-freebsd.patch65
-rw-r--r--sys-apps/more/metadata.xml7
-rw-r--r--sys-apps/more/more-2.12r.ebuild62
-rw-r--r--sys-apps/moreutils/Manifest7
-rw-r--r--sys-apps/moreutils/files/moreutils-0.47-dtd-path.patch99
-rw-r--r--sys-apps/moreutils/metadata.xml15
-rw-r--r--sys-apps/moreutils/moreutils-0.50.ebuild61
-rw-r--r--sys-apps/moreutils/moreutils-0.51.ebuild58
-rw-r--r--sys-apps/moreutils/moreutils-0.52.ebuild58
-rw-r--r--sys-apps/moreutils/moreutils-0.53.ebuild58
-rw-r--r--sys-apps/moreutils/moreutils-0.54.ebuild56
-rw-r--r--sys-apps/moreutils/moreutils-0.55.ebuild56
-rw-r--r--sys-apps/moreutils/moreutils-0.56.ebuild56
-rw-r--r--sys-apps/most/Manifest1
-rw-r--r--sys-apps/most/files/most-5.0.0a-donot-hardcode-path.patch33
-rw-r--r--sys-apps/most/files/most-5.0.0a-no-explicit-termcap.patch216
-rw-r--r--sys-apps/most/metadata.xml5
-rw-r--r--sys-apps/most/most-5.0.0a-r1.ebuild36
-rw-r--r--sys-apps/mount-gtk/Manifest1
-rw-r--r--sys-apps/mount-gtk/files/mount-gtk-1.4.2-c++11.patch31
-rw-r--r--sys-apps/mount-gtk/metadata.xml12
-rw-r--r--sys-apps/mount-gtk/mount-gtk-1.4.2.ebuild37
-rw-r--r--sys-apps/mouseemu/Manifest2
-rw-r--r--sys-apps/mouseemu/files/mouseemu-0.12-fix.diff48
-rw-r--r--sys-apps/mouseemu/files/mouseemu-0.13-fix.patch14
-rw-r--r--sys-apps/mouseemu/files/mouseemu-0.15-build.patch9
-rw-r--r--sys-apps/mouseemu/metadata.xml5
-rw-r--r--sys-apps/mouseemu/mouseemu-0.12.ebuild41
-rw-r--r--sys-apps/mouseemu/mouseemu-0.15.ebuild42
-rw-r--r--sys-apps/msr-tools/Manifest2
-rw-r--r--sys-apps/msr-tools/metadata.xml7
-rw-r--r--sys-apps/msr-tools/msr-tools-1.2.ebuild32
-rw-r--r--sys-apps/mtree/Manifest2
-rw-r--r--sys-apps/mtree/files/mtree-1.5-gcc4.patch29
-rw-r--r--sys-apps/mtree/files/mtree-2007.4+glibc-2.8.patch25
-rw-r--r--sys-apps/mtree/metadata.xml5
-rw-r--r--sys-apps/mtree/mtree-1.0.1.ebuild28
-rw-r--r--sys-apps/mtree/mtree-1.0.ebuild27
-rw-r--r--sys-apps/nawk/Manifest1
-rw-r--r--sys-apps/nawk/files/nawk-20121220-parallel-build.patch61
-rw-r--r--sys-apps/nawk/metadata.xml9
-rw-r--r--sys-apps/nawk/nawk-20121220-r2.ebuild50
-rw-r--r--sys-apps/nca/Manifest1
-rw-r--r--sys-apps/nca/files/ncad.initd16
-rw-r--r--sys-apps/nca/metadata.xml16
-rw-r--r--sys-apps/nca/nca-0.9.0.ebuild42
-rw-r--r--sys-apps/net-tools/Manifest5
-rw-r--r--sys-apps/net-tools/metadata.xml8
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20130513023548-r1.ebuild95
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20130513023548-r2.ebuild95
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20130513023548.ebuild95
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20141019041918-r1.ebuild95
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20141019041918.ebuild95
-rw-r--r--sys-apps/net-tools/net-tools-9999.ebuild69
-rw-r--r--sys-apps/netboot-base/Manifest1
-rw-r--r--sys-apps/netboot-base/metadata.xml5
-rw-r--r--sys-apps/netboot-base/netboot-base-20050110.ebuild46
-rw-r--r--sys-apps/netkit-base/Manifest1
-rw-r--r--sys-apps/netkit-base/files/003_all_netkit-base-0.17-gcc4.patch11
-rw-r--r--sys-apps/netkit-base/files/004_all_netkit-base-0.17-misc-fixes.patch54
-rw-r--r--sys-apps/netkit-base/files/005_all_netkit-base-0.17-no-rpc.patch26
-rw-r--r--sys-apps/netkit-base/files/inetd.rc624
-rw-r--r--sys-apps/netkit-base/metadata.xml5
-rw-r--r--sys-apps/netkit-base/netkit-base-0.17-r9.ebuild43
-rw-r--r--sys-apps/netloc/Manifest1
-rw-r--r--sys-apps/netloc/metadata.xml8
-rw-r--r--sys-apps/netloc/netloc-0.5.ebuild29
-rw-r--r--sys-apps/netplug/Manifest1
-rw-r--r--sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch37
-rw-r--r--sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch187
-rwxr-xr-xsys-apps/netplug/files/netplug-243
-rw-r--r--sys-apps/netplug/metadata.xml11
-rw-r--r--sys-apps/netplug/netplug-1.2.9.2-r1.ebuild64
-rw-r--r--sys-apps/newrelic-sysmond/Manifest1
-rw-r--r--sys-apps/newrelic-sysmond/files/newrelic-sysmond.rc24
-rw-r--r--sys-apps/newrelic-sysmond/metadata.xml8
-rw-r--r--sys-apps/newrelic-sysmond/newrelic-sysmond-1.1.2.124.ebuild57
-rw-r--r--sys-apps/noexec/Manifest1
-rw-r--r--sys-apps/noexec/metadata.xml10
-rw-r--r--sys-apps/noexec/noexec-1.1.0.ebuild19
-rw-r--r--sys-apps/openrc/Manifest10
-rw-r--r--sys-apps/openrc/files/openrc-0.8.3-ccwgroup.patch57
-rw-r--r--sys-apps/openrc/files/openrc-0.8.3-deprecation_warning.patch33
-rw-r--r--sys-apps/openrc/files/openrc-9999-msg-style.patch81
-rw-r--r--sys-apps/openrc/files/openrc-9999-pause.patch29
-rw-r--r--sys-apps/openrc/files/openrc.logrotate4
-rw-r--r--sys-apps/openrc/files/start-stop-daemon.pam2
-rw-r--r--sys-apps/openrc/metadata.xml11
-rw-r--r--sys-apps/openrc/openrc-0.13.11.ebuild332
-rw-r--r--sys-apps/openrc/openrc-0.14.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.15.1.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.15.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.16.1.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.16.2.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.16.3.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.16.4.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.16.ebuild337
-rw-r--r--sys-apps/openrc/openrc-0.17.ebuild337
-rw-r--r--sys-apps/openrc/openrc-9999.ebuild337
-rw-r--r--sys-apps/pacman/Manifest2
-rw-r--r--sys-apps/pacman/files/pacman-4.0.0-gpgme.patch45
-rw-r--r--sys-apps/pacman/metadata.xml11
-rw-r--r--sys-apps/pacman/pacman-4.0.1.ebuild83
-rw-r--r--sys-apps/pacman/pacman-4.0.3-r1.ebuild87
-rw-r--r--sys-apps/pacman/pacman-4.0.3.ebuild83
-rw-r--r--sys-apps/paludis/Manifest4
-rw-r--r--sys-apps/paludis/files/paludis-2.0.0-fix-format-security.patch66
-rw-r--r--sys-apps/paludis/files/paludis-2.2.0-check-IUSE_EFFECTIVE-in-EAPI-5.patch88
-rw-r--r--sys-apps/paludis/files/paludis-2.2.0-filter-EBUILD_PHASE_FUNC.patch22
-rw-r--r--sys-apps/paludis/files/paludis-2.2.0-filter-IUSE_EFFECTIVE.patch31
-rw-r--r--sys-apps/paludis/files/paludis-2.2.0-fix-MERGE_TYPE.patch81
-rw-r--r--sys-apps/paludis/files/paludis-2.2.0-fix-PWD-handling.patch30
-rw-r--r--sys-apps/paludis/metadata.xml18
-rw-r--r--sys-apps/paludis/paludis-1.4.2-r1.ebuild157
-rw-r--r--sys-apps/paludis/paludis-2.0.0.ebuild161
-rw-r--r--sys-apps/paludis/paludis-2.2.0-r2.ebuild169
-rw-r--r--sys-apps/paludis/paludis-2.2.0.ebuild159
-rw-r--r--sys-apps/paludis/paludis-2.4.0.ebuild162
-rw-r--r--sys-apps/paludis/paludis-9999.ebuild165
-rw-r--r--sys-apps/paxctl/Manifest3
-rw-r--r--sys-apps/paxctl/metadata.xml9
-rw-r--r--sys-apps/paxctl/paxctl-0.7-r2.ebuild38
-rw-r--r--sys-apps/paxctl/paxctl-0.8.ebuild38
-rw-r--r--sys-apps/paxctl/paxctl-0.9.ebuild38
-rw-r--r--sys-apps/paxctld/Manifest1
-rw-r--r--sys-apps/paxctld/metadata.xml9
-rw-r--r--sys-apps/paxctld/paxctld-1.0.ebuild27
-rw-r--r--sys-apps/pciutils/Manifest4
-rw-r--r--sys-apps/pciutils/files/conf.d-pciparm28
-rw-r--r--sys-apps/pciutils/files/init.d-pciparm80
-rw-r--r--sys-apps/pciutils/files/pciutils-3.1.9-static-pc.patch13
-rw-r--r--sys-apps/pciutils/metadata.xml10
-rw-r--r--sys-apps/pciutils/pciutils-3.2.0.ebuild84
-rw-r--r--sys-apps/pciutils/pciutils-3.2.1.ebuild84
-rw-r--r--sys-apps/pciutils/pciutils-3.3.0-r2.ebuild108
-rw-r--r--sys-apps/pciutils/pciutils-3.3.1.ebuild108
-rw-r--r--sys-apps/pcmciautils/Manifest2
-rw-r--r--sys-apps/pcmciautils/metadata.xml8
-rw-r--r--sys-apps/pcmciautils/pcmciautils-018_p8-r1.ebuild73
-rw-r--r--sys-apps/pcmciautils/pcmciautils-018_p8.ebuild73
-rw-r--r--sys-apps/pcsc-lite/Manifest3
-rw-r--r--sys-apps/pcsc-lite/files/99-pcscd-hotplug.rules7
-rw-r--r--sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-nopolkit.patch35
-rw-r--r--sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch20
-rw-r--r--sys-apps/pcsc-lite/files/pcscd-init.523
-rw-r--r--sys-apps/pcsc-lite/files/pcscd-init.623
-rw-r--r--sys-apps/pcsc-lite/files/pcscd-init.723
-rw-r--r--sys-apps/pcsc-lite/metadata.xml29
-rw-r--r--sys-apps/pcsc-lite/pcsc-lite-1.8.12-r1.ebuild106
-rw-r--r--sys-apps/pcsc-lite/pcsc-lite-1.8.13-r1.ebuild106
-rw-r--r--sys-apps/pcsc-lite/pcsc-lite-1.8.13.ebuild106
-rw-r--r--sys-apps/pcsc-lite/pcsc-lite-1.8.8-r1.ebuild93
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/Manifest1
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch24
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch24
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/files/reader.conf11
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/metadata.xml5
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r1.ebuild65
-rw-r--r--sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r2.ebuild66
-rw-r--r--sys-apps/pcsc-tools/Manifest2
-rw-r--r--sys-apps/pcsc-tools/files/smartcard.cron15
-rw-r--r--sys-apps/pcsc-tools/metadata.xml10
-rw-r--r--sys-apps/pcsc-tools/pcsc-tools-1.4.22.ebuild65
-rw-r--r--sys-apps/pcsc-tools/pcsc-tools-1.4.23.ebuild65
-rw-r--r--sys-apps/pkgcore/Manifest1
-rw-r--r--sys-apps/pkgcore/metadata.xml15
-rw-r--r--sys-apps/pkgcore/pkgcore-0.9.1.ebuild83
-rw-r--r--sys-apps/pkgcore/pkgcore-9999.ebuild75
-rw-r--r--sys-apps/pmount-gui/Manifest1
-rw-r--r--sys-apps/pmount-gui/metadata.xml5
-rw-r--r--sys-apps/pmount-gui/pmount-gui-0_pre20130806.ebuild38
-rw-r--r--sys-apps/pmount/Manifest1
-rw-r--r--sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch43
-rw-r--r--sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch22
-rw-r--r--sys-apps/pmount/files/pmount.bash-completion94
-rw-r--r--sys-apps/pmount/metadata.xml8
-rw-r--r--sys-apps/pmount/pmount-0.9.99_alpha-r3.ebuild83
-rw-r--r--sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild86
-rw-r--r--sys-apps/policycoreutils/Manifest8
-rw-r--r--sys-apps/policycoreutils/files/0001-policycoreutils-pp-add-roletype-statements-for-both-.patch61
-rw-r--r--sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch9
-rw-r--r--sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch108
-rw-r--r--sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch14
-rw-r--r--sys-apps/policycoreutils/files/0040-reverse-access-check-in-run_init.patch12
-rw-r--r--sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch11
-rw-r--r--sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch64
-rw-r--r--sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch11
-rw-r--r--sys-apps/policycoreutils/metadata.xml24
-rw-r--r--sys-apps/policycoreutils/policycoreutils-2.2.5-r4.ebuild156
-rw-r--r--sys-apps/policycoreutils/policycoreutils-2.3-r3.ebuild154
-rw-r--r--sys-apps/policycoreutils/policycoreutils-2.4-r1.ebuild159
-rw-r--r--sys-apps/policycoreutils/policycoreutils-2.4.ebuild147
-rw-r--r--sys-apps/policycoreutils/policycoreutils-9999.ebuild191
-rw-r--r--sys-apps/portage/Manifest4
-rw-r--r--sys-apps/portage/files/README.RESCUE2
-rw-r--r--sys-apps/portage/metadata.xml20
-rw-r--r--sys-apps/portage/portage-2.2.14.ebuild352
-rw-r--r--sys-apps/portage/portage-2.2.18.ebuild352
-rw-r--r--sys-apps/portage/portage-2.2.20.ebuild365
-rw-r--r--sys-apps/portage/portage-2.2.8-r2.ebuild574
-rw-r--r--sys-apps/portage/portage-9999.ebuild243
-rw-r--r--sys-apps/powerpc-utils/Manifest3
-rw-r--r--sys-apps/powerpc-utils/metadata.xml5
-rw-r--r--sys-apps/powerpc-utils/powerpc-utils-1.1.3.18-r2.ebuild53
-rw-r--r--sys-apps/prctl/Manifest1
-rw-r--r--sys-apps/prctl/metadata.xml8
-rw-r--r--sys-apps/prctl/prctl-1.5.ebuild28
-rw-r--r--sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in78
-rw-r--r--sys-apps/prefix-chain-utils/files/startprefix.in38
-rw-r--r--sys-apps/prefix-chain-utils/metadata.xml5
-rw-r--r--sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r5.ebuild57
-rw-r--r--sys-apps/preload/Manifest1
-rw-r--r--sys-apps/preload/files/00-patch-configure.diff15
-rw-r--r--sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch64
-rw-r--r--sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch29
-rw-r--r--sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch27
-rw-r--r--sys-apps/preload/files/02-patch-preload_conf.diff21
-rw-r--r--sys-apps/preload/files/02-patch-preload_sysconfig.diff39
-rw-r--r--sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch31
-rw-r--r--sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch21
-rw-r--r--sys-apps/preload/files/preload-0.6.4.init.in50
-rwxr-xr-xsys-apps/preload/files/preload-0.6.4.init.in-r166
-rwxr-xr-xsys-apps/preload/files/preload-0.6.4.init.in-r266
-rw-r--r--sys-apps/preload/metadata.xml11
-rw-r--r--sys-apps/preload/preload-0.6.4-r3.ebuild64
-rw-r--r--sys-apps/proot/Manifest5
-rw-r--r--sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch19
-rw-r--r--sys-apps/proot/files/proot-3.2.1-makefile.patch11
-rw-r--r--sys-apps/proot/files/proot-3.2.2-build-care.patch20
-rw-r--r--sys-apps/proot/files/proot-4.0.1-argv.patch125
-rw-r--r--sys-apps/proot/metadata.xml24
-rw-r--r--sys-apps/proot/proot-3.2.2-r1.ebuild73
-rw-r--r--sys-apps/proot/proot-4.0.1.ebuild68
-rw-r--r--sys-apps/proot/proot-4.0.3.ebuild69
-rw-r--r--sys-apps/proot/proot-5.0.0.ebuild69
-rw-r--r--sys-apps/proot/proot-5.1.0.ebuild69
-rw-r--r--sys-apps/pv/Manifest1
-rw-r--r--sys-apps/pv/metadata.xml11
-rw-r--r--sys-apps/pv/pv-1.6.0-r1.ebuild52
-rw-r--r--sys-apps/pv/pv-1.6.0.ebuild44
-rw-r--r--sys-apps/pyrenamer/Manifest1
-rw-r--r--sys-apps/pyrenamer/metadata.xml11
-rw-r--r--sys-apps/pyrenamer/pyrenamer-0.6.0-r2.ebuild33
-rw-r--r--sys-apps/qcontrol/Manifest2
-rw-r--r--sys-apps/qcontrol/files/0.4.2-Makefile.patch22
-rw-r--r--sys-apps/qcontrol/files/conf.d5
-rw-r--r--sys-apps/qcontrol/files/init.d74
-rw-r--r--sys-apps/qcontrol/metadata.xml9
-rw-r--r--sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild62
-rw-r--r--sys-apps/qdiskusage/Manifest1
-rw-r--r--sys-apps/qdiskusage/metadata.xml8
-rw-r--r--sys-apps/qdiskusage/qdiskusage-1.0.4.ebuild31
-rw-r--r--sys-apps/qingy/Manifest4
-rw-r--r--sys-apps/qingy/files/50qingy-gentoo.el7
-rw-r--r--sys-apps/qingy/files/qingy-1.0.0-tinfo.patch42
-rw-r--r--sys-apps/qingy/files/qingy-logrotate6
-rw-r--r--sys-apps/qingy/files/qingy_at.service21
-rw-r--r--sys-apps/qingy/metadata.xml13
-rw-r--r--sys-apps/qingy/qingy-1.0.0-r1.ebuild132
-rw-r--r--sys-apps/qingy/qingy-1.0.0-r2.ebuild134
-rw-r--r--sys-apps/qingy/qingy-1.0.0.ebuild125
-rw-r--r--sys-apps/raidutils/Manifest2
-rw-r--r--sys-apps/raidutils/files/raidutils-0.0.6-gcc45.patch14
-rw-r--r--sys-apps/raidutils/metadata.xml14
-rw-r--r--sys-apps/raidutils/raidutils-0.0.6-r2.ebuild41
-rw-r--r--sys-apps/razercfg/Manifest8
-rw-r--r--sys-apps/razercfg/files/razerd.init.d26
-rw-r--r--sys-apps/razercfg/files/razerd.init.d-r126
-rw-r--r--sys-apps/razercfg/files/razerd.init.d-r226
-rw-r--r--sys-apps/razercfg/metadata.xml22
-rw-r--r--sys-apps/razercfg/razercfg-0.23.ebuild56
-rw-r--r--sys-apps/razercfg/razercfg-0.24.ebuild62
-rw-r--r--sys-apps/razercfg/razercfg-0.25.ebuild56
-rw-r--r--sys-apps/razercfg/razercfg-0.26.ebuild71
-rw-r--r--sys-apps/razercfg/razercfg-0.29.ebuild72
-rw-r--r--sys-apps/razercfg/razercfg-0.30.ebuild74
-rw-r--r--sys-apps/razercfg/razercfg-0.31.ebuild74
-rw-r--r--sys-apps/razercfg/razercfg-0.32.ebuild74
-rw-r--r--sys-apps/readahead-list/Manifest1
-rw-r--r--sys-apps/readahead-list/files/conf.d-readahead-list16
-rw-r--r--sys-apps/readahead-list/files/init.d-readahead-list23
-rw-r--r--sys-apps/readahead-list/files/init.d-readahead-list-early23
-rw-r--r--sys-apps/readahead-list/files/readahead-list-1.20060421.1016-gcc-4.3.patch10
-rw-r--r--sys-apps/readahead-list/metadata.xml9
-rw-r--r--sys-apps/readahead-list/readahead-list-1.20060421.1016-r1.ebuild59
-rw-r--r--sys-apps/readahead-list/readahead-list-1.20060421.1016.ebuild61
-rw-r--r--sys-apps/rename/Manifest1
-rw-r--r--sys-apps/rename/files/rename-1.3-build.patch11
-rw-r--r--sys-apps/rename/files/rename-1.3-gcc44.patch16
-rw-r--r--sys-apps/rename/files/rename-1.3-rename.patch95
-rw-r--r--sys-apps/rename/metadata.xml5
-rw-r--r--sys-apps/rename/rename-1.3-r1.ebuild38
-rw-r--r--sys-apps/rename/rename-1.3.ebuild38
-rw-r--r--sys-apps/renameutils/Manifest1
-rw-r--r--sys-apps/renameutils/files/renameutils-0.12.0-autopoint.patch12
-rw-r--r--sys-apps/renameutils/files/renameutils-0.12.0-typo.patch13
-rw-r--r--sys-apps/renameutils/files/renameutils-0.9.0-destdir.patch29
-rw-r--r--sys-apps/renameutils/metadata.xml7
-rw-r--r--sys-apps/renameutils/renameutils-0.12.0.ebuild29
-rw-r--r--sys-apps/rescan-scsi-bus/Manifest3
-rw-r--r--sys-apps/rescan-scsi-bus/files/rescan-scsi-bus-1.25-support-sysfs-only-systems.patch14
-rw-r--r--sys-apps/rescan-scsi-bus/metadata.xml8
-rw-r--r--sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.29.ebuild41
-rw-r--r--sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.56.ebuild41
-rw-r--r--sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57-r1.ebuild36
-rw-r--r--sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57.ebuild35
-rw-r--r--sys-apps/restartd/Manifest1
-rw-r--r--sys-apps/restartd/metadata.xml7
-rw-r--r--sys-apps/restartd/restartd-0.2.2.ebuild30
-rw-r--r--sys-apps/rigo-daemon/Manifest1
-rw-r--r--sys-apps/rigo-daemon/metadata.xml11
-rw-r--r--sys-apps/rigo-daemon/rigo-daemon-254.ebuild44
-rw-r--r--sys-apps/rkflashtool/Manifest1
-rw-r--r--sys-apps/rkflashtool/files/rkflashtool-5.1-missing-version.h5
-rw-r--r--sys-apps/rkflashtool/metadata.xml11
-rw-r--r--sys-apps/rkflashtool/rkflashtool-5.1.ebuild34
-rw-r--r--sys-apps/rng-tools/Manifest2
-rw-r--r--sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch71
-rw-r--r--sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch100
-rw-r--r--sys-apps/rng-tools/files/rngd-confd-4.122
-rw-r--r--sys-apps/rng-tools/files/rngd-initd-4.129
-rw-r--r--sys-apps/rng-tools/files/rngd-initd-r1-4.120
-rw-r--r--sys-apps/rng-tools/files/rngd.service8
-rw-r--r--sys-apps/rng-tools/files/test-for-argp.patch43
-rw-r--r--sys-apps/rng-tools/metadata.xml18
-rw-r--r--sys-apps/rng-tools/rng-tools-4-r7.ebuild36
-rw-r--r--sys-apps/rng-tools/rng-tools-5.ebuild38
-rw-r--r--sys-apps/roccat-tools/Manifest2
-rw-r--r--sys-apps/roccat-tools/files/README.gentoo17
-rw-r--r--sys-apps/roccat-tools/metadata.xml18
-rw-r--r--sys-apps/roccat-tools/roccat-tools-3.4.0.ebuild92
-rw-r--r--sys-apps/roccat-tools/roccat-tools-3.5.0-r1.ebuild101
-rw-r--r--sys-apps/roccat-tools/roccat-tools-3.5.0.ebuild92
-rw-r--r--sys-apps/rsbac-admin/Manifest3
-rw-r--r--sys-apps/rsbac-admin/files/nsswitch.conf24
-rw-r--r--sys-apps/rsbac-admin/files/rklogd32
-rw-r--r--sys-apps/rsbac-admin/files/rsbac.conf8
-rw-r--r--sys-apps/rsbac-admin/metadata.xml15
-rw-r--r--sys-apps/rsbac-admin/rsbac-admin-1.4.6-r1.ebuild71
-rw-r--r--sys-apps/rsbac-admin/rsbac-admin-1.4.6.ebuild69
-rw-r--r--sys-apps/rsbac-admin/rsbac-admin-1.4.7.ebuild71
-rw-r--r--sys-apps/rsbac-admin/rsbac-admin-1.4.8.ebuild71
-rw-r--r--sys-apps/s390-tools/Manifest4
-rw-r--r--sys-apps/s390-tools/files/s390-tools-1.13.0-build.patch153
-rw-r--r--sys-apps/s390-tools/files/s390-tools-1.13.0-larl.patch67
-rw-r--r--sys-apps/s390-tools/files/s390-tools-1.16.0-build.patch153
-rw-r--r--sys-apps/s390-tools/files/s390-tools-1.23.1-build.patch153
-rw-r--r--sys-apps/s390-tools/files/s390-tools-1.9.0-build.patch156
-rw-r--r--sys-apps/s390-tools/metadata.xml19
-rw-r--r--sys-apps/s390-tools/s390-tools-1.17.0.ebuild54
-rw-r--r--sys-apps/s390-tools/s390-tools-1.23.1.ebuild54
-rw-r--r--sys-apps/s6/Manifest1
-rw-r--r--sys-apps/s6/metadata.xml12
-rw-r--r--sys-apps/s6/s6-2.1.3.0.ebuild67
-rw-r--r--sys-apps/salinfo/Manifest1
-rw-r--r--sys-apps/salinfo/files/salinfo-1.2-build.patch47
-rw-r--r--sys-apps/salinfo/metadata.xml5
-rw-r--r--sys-apps/salinfo/salinfo-1.2.ebuild29
-rw-r--r--sys-apps/sandbox/Manifest5
-rw-r--r--sys-apps/sandbox/files/0001-libsandbox-handle-more-at-functions.patch42
-rw-r--r--sys-apps/sandbox/files/09sandbox1
-rw-r--r--sys-apps/sandbox/files/sandbox-1.6-disable-pthread.patch37
-rw-r--r--sys-apps/sandbox/files/sandbox-1.6-disable-qa-static.patch13
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-check-empty-paths-at.patch201
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-desktop.patch30
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-gcc-5.patch13
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-log-var.patch51
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-no-pch.patch29
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-open-nofollow.patch54
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-static-close-fd.patch93
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-trace-hppa.patch27
-rw-r--r--sys-apps/sandbox/metadata.xml11
-rw-r--r--sys-apps/sandbox/sandbox-1.6-r2.ebuild104
-rw-r--r--sys-apps/sandbox/sandbox-2.3-r1.ebuild103
-rw-r--r--sys-apps/sandbox/sandbox-2.4.ebuild100
-rw-r--r--sys-apps/sandbox/sandbox-2.5.ebuild117
-rw-r--r--sys-apps/sandbox/sandbox-2.6-r1.ebuild131
-rw-r--r--sys-apps/sdparm/Manifest3
-rw-r--r--sys-apps/sdparm/metadata.xml8
-rw-r--r--sys-apps/sdparm/sdparm-1.07.ebuild27
-rw-r--r--sys-apps/sdparm/sdparm-1.08-r1.ebuild35
-rw-r--r--sys-apps/sdparm/sdparm-1.09.ebuild35
-rw-r--r--sys-apps/secilc/metadata.xml12
-rw-r--r--sys-apps/secilc/secilc-9999.ebuild45
-rw-r--r--sys-apps/sed/Manifest2
-rw-r--r--sys-apps/sed/files/sed-4.1.5-alloca.patch14
-rw-r--r--sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch45
-rw-r--r--sys-apps/sed/metadata.xml5
-rw-r--r--sys-apps/sed/sed-4.2.1-r1.ebuild68
-rw-r--r--sys-apps/sed/sed-4.2.2.ebuild70
-rw-r--r--sys-apps/servicelog/Manifest3
-rw-r--r--sys-apps/servicelog/metadata.xml8
-rw-r--r--sys-apps/servicelog/servicelog-1.0.1.ebuild32
-rw-r--r--sys-apps/servicelog/servicelog-1.1.11.ebuild32
-rw-r--r--sys-apps/servicelog/servicelog-1.1.13.ebuild32
-rw-r--r--sys-apps/setserial/Manifest1
-rwxr-xr-xsys-apps/setserial/files/serial-2.17-r423
-rw-r--r--sys-apps/setserial/files/setserial-2.17-build.patch11
-rw-r--r--sys-apps/setserial/files/setserial-2.17-hayes-esp.patch15
-rw-r--r--sys-apps/setserial/files/setserial-2.17-headers.patch12
-rw-r--r--sys-apps/setserial/files/setserial-2.17-manpage-updates.patch36
-rw-r--r--sys-apps/setserial/files/setserial-2.17-spelling.patch7
-rw-r--r--sys-apps/setserial/metadata.xml5
-rw-r--r--sys-apps/setserial/setserial-2.17-r4.ebuild45
-rw-r--r--sys-apps/sg3_utils/Manifest2
-rw-r--r--sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch31
-rw-r--r--sys-apps/sg3_utils/metadata.xml5
-rw-r--r--sys-apps/sg3_utils/sg3_utils-1.40.ebuild44
-rw-r--r--sys-apps/sg3_utils/sg3_utils-1.41.ebuild44
-rw-r--r--sys-apps/shadow/Manifest2
-rw-r--r--sys-apps/shadow/files/default/useradd7
-rw-r--r--sys-apps/shadow/files/login_defs_pam.sed24
-rw-r--r--sys-apps/shadow/files/pam.d-include/passwd8
-rw-r--r--sys-apps/shadow/files/pam.d-include/shadow8
-rw-r--r--sys-apps/shadow/files/securetty36
-rw-r--r--sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch10
-rw-r--r--sys-apps/shadow/files/shadow-4.2.1-cross-size-checks.patch41
-rw-r--r--sys-apps/shadow/metadata.xml12
-rw-r--r--sys-apps/shadow/shadow-4.1.5.1-r1.ebuild195
-rw-r--r--sys-apps/shadow/shadow-4.2.1-r1.ebuild211
-rw-r--r--sys-apps/shadow/shadow-4.2.1.ebuild196
-rw-r--r--sys-apps/smartmontools/Manifest2
-rw-r--r--sys-apps/smartmontools/files/smartd-r1.rc29
-rw-r--r--sys-apps/smartmontools/files/smartd.confd4
-rw-r--r--sys-apps/smartmontools/metadata.xml11
-rw-r--r--sys-apps/smartmontools/smartmontools-6.3.ebuild66
-rw-r--r--sys-apps/smartmontools/smartmontools-6.4.ebuild66
-rw-r--r--sys-apps/smartmontools/smartmontools-9999.ebuild62
-rw-r--r--sys-apps/sparc-utils/Manifest2
-rw-r--r--sys-apps/sparc-utils/files/audioctl.init23
-rw-r--r--sys-apps/sparc-utils/metadata.xml13
-rw-r--r--sys-apps/sparc-utils/sparc-utils-1.9-r4.ebuild76
-rw-r--r--sys-apps/spu-tools/Manifest2
-rw-r--r--sys-apps/spu-tools/metadata.xml10
-rw-r--r--sys-apps/spu-tools/spu-tools-2.2.80_p95.ebuild28
-rw-r--r--sys-apps/spu-tools/spu-tools-2.3.0.135.ebuild28
-rw-r--r--sys-apps/stroke/Manifest1
-rw-r--r--sys-apps/stroke/metadata.xml13
-rw-r--r--sys-apps/stroke/stroke-0.1.3.ebuild16
-rw-r--r--sys-apps/superiotool/Manifest1
-rwxr-xr-xsys-apps/superiotool/files/make-tarball.sh34
-rw-r--r--sys-apps/superiotool/metadata.xml14
-rw-r--r--sys-apps/superiotool/superiotool-6637.ebuild48
-rw-r--r--sys-apps/superiotool/superiotool-99999999.ebuild48
-rw-r--r--sys-apps/syscriptor/Manifest1
-rw-r--r--sys-apps/syscriptor/metadata.xml8
-rw-r--r--sys-apps/syscriptor/syscriptor-1.5.15.ebuild19
-rw-r--r--sys-apps/syslog-notify/Manifest1
-rw-r--r--sys-apps/syslog-notify/metadata.xml11
-rw-r--r--sys-apps/syslog-notify/syslog-notify-0.2.ebuild41
-rw-r--r--sys-apps/systemd-readahead/Manifest1
-rw-r--r--sys-apps/systemd-readahead/metadata.xml8
-rw-r--r--sys-apps/systemd-readahead/systemd-readahead-216.ebuild161
-rw-r--r--sys-apps/systemd-sysv-utils/Manifest5
-rw-r--r--sys-apps/systemd-sysv-utils/metadata.xml8
-rw-r--r--sys-apps/systemd-sysv-utils/systemd-sysv-utils-208.ebuild34
-rw-r--r--sys-apps/systemd-sysv-utils/systemd-sysv-utils-212.ebuild35
-rw-r--r--sys-apps/systemd-sysv-utils/systemd-sysv-utils-215.ebuild35
-rw-r--r--sys-apps/systemd-sysv-utils/systemd-sysv-utils-216.ebuild35
-rw-r--r--sys-apps/systemd-sysv-utils/systemd-sysv-utils-217.ebuild35
-rw-r--r--sys-apps/systemd-ui/Manifest1
-rw-r--r--sys-apps/systemd-ui/files/systemd-ui-3-vala-0.24.patch35
-rw-r--r--sys-apps/systemd-ui/metadata.xml8
-rw-r--r--sys-apps/systemd-ui/systemd-ui-3.ebuild48
-rw-r--r--sys-apps/systemd-ui/systemd-ui-9999.ebuild60
-rw-r--r--sys-apps/systemd/Manifest11
-rw-r--r--sys-apps/systemd/files/215-0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch116
-rw-r--r--sys-apps/systemd/files/215-0002-endian-explicitly-include-endian.h-wherever-we-want-.patch53
-rw-r--r--sys-apps/systemd/files/215-0003-udev-exclude-MD-from-block-device-ownership-event-lo.patch54
-rw-r--r--sys-apps/systemd/files/216-lz4-build.patch19
-rw-r--r--sys-apps/systemd/files/216-tmpfiles-setup-dev.patch21
-rw-r--r--sys-apps/systemd/files/217-systemd-consoled.service.in15
-rw-r--r--sys-apps/systemd/files/218-Dont-enable-audit-by-default.patch30
-rw-r--r--sys-apps/systemd/files/224-0001-networkd-fix-neworkd-crash.patch28
-rw-r--r--sys-apps/systemd/files/compile-unifont.py119
-rw-r--r--sys-apps/systemd/metadata.xml35
-rw-r--r--sys-apps/systemd/systemd-216-r3.ebuild496
-rw-r--r--sys-apps/systemd/systemd-218-r3.ebuild460
-rw-r--r--sys-apps/systemd/systemd-219_p112.ebuild473
-rw-r--r--sys-apps/systemd/systemd-220-r2.ebuild494
-rw-r--r--sys-apps/systemd/systemd-221.ebuild489
-rw-r--r--sys-apps/systemd/systemd-222-r1.ebuild480
-rw-r--r--sys-apps/systemd/systemd-222.ebuild482
-rw-r--r--sys-apps/systemd/systemd-224-r1.ebuild479
-rw-r--r--sys-apps/systemd/systemd-224.ebuild476
-rw-r--r--sys-apps/systemd/systemd-9999.ebuild476
-rw-r--r--sys-apps/sysvinit/Manifest1
-rw-r--r--sys-apps/sysvinit/files/inittab-2.8758
-rwxr-xr-xsys-apps/sysvinit/files/reboot.sh11
-rwxr-xr-xsys-apps/sysvinit/files/shutdown.sh13
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch142
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch36
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch60
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.88-selinux.patch38
-rw-r--r--sys-apps/sysvinit/files/sysvinit-2.88-shutdown-h.patch65
-rw-r--r--sys-apps/sysvinit/metadata.xml5
-rw-r--r--sys-apps/sysvinit/sysvinit-2.88-r4.ebuild104
-rw-r--r--sys-apps/sysvinit/sysvinit-2.88-r5.ebuild106
-rw-r--r--sys-apps/sysvinit/sysvinit-2.88-r6.ebuild113
-rw-r--r--sys-apps/sysvinit/sysvinit-2.88-r7.ebuild118
-rw-r--r--sys-apps/tcp-wrappers/Manifest2
-rw-r--r--sys-apps/tcp-wrappers/files/hosts.allow.example17
-rw-r--r--sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch295
-rw-r--r--sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch35
-rw-r--r--sys-apps/tcp-wrappers/metadata.xml11
-rw-r--r--sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r1.ebuild98
-rw-r--r--sys-apps/texinfo/Manifest3
-rw-r--r--sys-apps/texinfo/files/texinfo-4.13-accentenc-test.patch17
-rw-r--r--sys-apps/texinfo/files/texinfo-4.13-docbook.patch66
-rw-r--r--sys-apps/texinfo/files/texinfo-4.13-texi2dvi-regexp-range.patch23
-rw-r--r--sys-apps/texinfo/files/texinfo-4.13-tinfo.patch24
-rw-r--r--sys-apps/texinfo/files/texinfo-4.13-xz.patch130
-rw-r--r--sys-apps/texinfo/metadata.xml5
-rw-r--r--sys-apps/texinfo/texinfo-4.13-r2.ebuild58
-rw-r--r--sys-apps/texinfo/texinfo-5.2.ebuild41
-rw-r--r--sys-apps/texinfo/texinfo-6.0.ebuild41
-rw-r--r--sys-apps/the_silver_searcher/Manifest1
-rw-r--r--sys-apps/the_silver_searcher/metadata.xml15
-rw-r--r--sys-apps/the_silver_searcher/the_silver_searcher-0.29.1.ebuild40
-rw-r--r--sys-apps/timer_entropyd/Manifest1
-rw-r--r--sys-apps/timer_entropyd/files/timer_entropyd-0.1-syslog.patch28
-rw-r--r--sys-apps/timer_entropyd/files/timer_entropyd.initd.114
-rw-r--r--sys-apps/timer_entropyd/metadata.xml15
-rw-r--r--sys-apps/timer_entropyd/timer_entropyd-0.2.ebuild43
-rw-r--r--sys-apps/tomoyo-tools/Manifest1
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-gentoo.patch14
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-ldflags.patch17
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20110929-gentoo.patch16
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20120414-flags-parallel.patch82
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.4.0_p20110929-flags-parallel.patch87
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20120414-flags-parallel.patch87
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-flags-parallel.patch87
-rw-r--r--sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-warnings.patch22
-rw-r--r--sys-apps/tomoyo-tools/metadata.xml10
-rw-r--r--sys-apps/tomoyo-tools/tomoyo-tools-2.5.0_p20130214.ebuild68
-rw-r--r--sys-apps/toybox/Manifest7
-rw-r--r--sys-apps/toybox/metadata.xml8
-rw-r--r--sys-apps/toybox/toybox-0.4.7.ebuild37
-rw-r--r--sys-apps/toybox/toybox-0.4.8.ebuild37
-rw-r--r--sys-apps/toybox/toybox-0.4.9-r1.ebuild50
-rw-r--r--sys-apps/toybox/toybox-0.4.9.ebuild37
-rw-r--r--sys-apps/toybox/toybox-0.5.0.ebuild58
-rw-r--r--sys-apps/toybox/toybox-0.5.1.ebuild58
-rw-r--r--sys-apps/toybox/toybox-0.5.2.ebuild58
-rw-r--r--sys-apps/toybox/toybox-0.6.0.ebuild60
-rw-r--r--sys-apps/toybox/toybox-9999.ebuild58
-rw-r--r--sys-apps/tuned/Manifest3
-rw-r--r--sys-apps/tuned/files/tuned.initd17
-rw-r--r--sys-apps/tuned/metadata.xml12
-rw-r--r--sys-apps/tuned/tuned-2.4.1.ebuild45
-rw-r--r--sys-apps/tuned/tuned-2.5.0.ebuild45
-rw-r--r--sys-apps/tuned/tuned-2.5.1.ebuild45
-rw-r--r--sys-apps/turbotail/Manifest1
-rw-r--r--sys-apps/turbotail/metadata.xml5
-rw-r--r--sys-apps/turbotail/turbotail-0.3-r1.ebuild39
-rw-r--r--sys-apps/turbotail/turbotail-0.3.ebuild35
-rw-r--r--sys-apps/tuxonice-userui/Manifest2
-rw-r--r--sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-Makefiles.patch45
-rw-r--r--sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch88
-rw-r--r--sys-apps/tuxonice-userui/files/tuxonice-userui-1.1-freetype-2.5.patch38
-rw-r--r--sys-apps/tuxonice-userui/metadata.xml12
-rw-r--r--sys-apps/tuxonice-userui/tuxonice-userui-1.1-r2.ebuild70
-rw-r--r--sys-apps/uam/Manifest3
-rw-r--r--sys-apps/uam/metadata.xml21
-rw-r--r--sys-apps/uam/uam-0.3.1.ebuild45
-rw-r--r--sys-apps/uam/uam-0.3.2.ebuild45
-rw-r--r--sys-apps/uam/uam-0.3.ebuild51
-rw-r--r--sys-apps/uam/uam-9999.ebuild57
-rw-r--r--sys-apps/ucspi-proxy/Manifest3
-rw-r--r--sys-apps/ucspi-proxy/metadata.xml9
-rw-r--r--sys-apps/ucspi-proxy/ucspi-proxy-0.97.ebuild30
-rw-r--r--sys-apps/ucspi-proxy/ucspi-proxy-0.98.ebuild37
-rw-r--r--sys-apps/ucspi-proxy/ucspi-proxy-0.99.ebuild32
-rw-r--r--sys-apps/ucspi-ssl/Manifest1
-rw-r--r--sys-apps/ucspi-ssl/metadata.xml13
-rw-r--r--sys-apps/ucspi-ssl/ucspi-ssl-0.94-r1.ebuild53
-rw-r--r--sys-apps/ucspi-tcp/Manifest5
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch27
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-bigendian.patch18
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-errno.patch13
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-exit.patch10
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-large-responses.patch26
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch89
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch36
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch11
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos.patch544
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-rblsmtpd-ignore-on-RELAYCLIENT.patch25
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-tcprules.patch16
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-uint-headers.patch133
-rw-r--r--sys-apps/ucspi-tcp/files/tcprules-Makefile11
-rw-r--r--sys-apps/ucspi-tcp/metadata.xml13
-rw-r--r--sys-apps/ucspi-tcp/ucspi-tcp-0.88-r17.ebuild91
-rw-r--r--sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild75
-rw-r--r--sys-apps/ucspi-unix/Manifest1
-rw-r--r--sys-apps/ucspi-unix/files/ucspi-unix-0.36-fix-parallel-build.patch19
-rw-r--r--sys-apps/ucspi-unix/files/ucspi-unix-0.36-include-sys_socket.h.patch11
-rw-r--r--sys-apps/ucspi-unix/files/ucspi-unix-gentoo-head.patch33
-rw-r--r--sys-apps/ucspi-unix/metadata.xml9
-rw-r--r--sys-apps/ucspi-unix/ucspi-unix-0.36-r2.ebuild35
-rw-r--r--sys-apps/ucspi-unix/ucspi-unix-0.36-r3.ebuild37
-rw-r--r--sys-apps/ucspi-unix/ucspi-unix-0.36-r4.ebuild38
-rw-r--r--sys-apps/udevil/Manifest3
-rw-r--r--sys-apps/udevil/files/udevil-0.4.1-automake-1.13.patch11
-rw-r--r--sys-apps/udevil/files/udevil-0.4.1-flags.patch46
-rw-r--r--sys-apps/udevil/files/udevil-0.4.3-flags.patch46
-rw-r--r--sys-apps/udevil/files/udevil-0.4.4-stat.patch11
-rw-r--r--sys-apps/udevil/metadata.xml16
-rw-r--r--sys-apps/udevil/udevil-0.4.1.ebuild71
-rw-r--r--sys-apps/udevil/udevil-0.4.3.ebuild71
-rw-r--r--sys-apps/udevil/udevil-0.4.4-r1.ebuild73
-rw-r--r--sys-apps/udevil/udevil-0.4.4.ebuild72
-rw-r--r--sys-apps/uevt/Manifest1
-rw-r--r--sys-apps/uevt/files/uevt-2.3-support_for_more_than_one_CPU.patch220
-rw-r--r--sys-apps/uevt/files/uevt-2.3-vala-0.24.patch13
-rw-r--r--sys-apps/uevt/metadata.xml5
-rw-r--r--sys-apps/uevt/uevt-2.3-r1.ebuild53
-rw-r--r--sys-apps/ultracopier/Manifest1
-rw-r--r--sys-apps/ultracopier/metadata.xml10
-rw-r--r--sys-apps/ultracopier/ultracopier-0.2.0.16.ebuild40
-rw-r--r--sys-apps/unscd/Manifest2
-rw-r--r--sys-apps/unscd/files/unscd-tmpfiles.conf1
-rwxr-xr-xsys-apps/unscd/files/unscd.initd40
-rw-r--r--sys-apps/unscd/files/unscd.initd-r116
-rw-r--r--sys-apps/unscd/files/unscd.service18
-rw-r--r--sys-apps/unscd/metadata.xml5
-rw-r--r--sys-apps/unscd/unscd-0.51.ebuild35
-rw-r--r--sys-apps/unscd/unscd-0.52-r2.ebuild37
-rw-r--r--sys-apps/usb_modeswitch/Manifest10
-rw-r--r--sys-apps/usb_modeswitch/metadata.xml12
-rw-r--r--sys-apps/usb_modeswitch/usb_modeswitch-1.2.7_p20130807.ebuild59
-rw-r--r--sys-apps/usb_modeswitch/usb_modeswitch-2.1.0_p20140129.ebuild63
-rw-r--r--sys-apps/usb_modeswitch/usb_modeswitch-2.1.1_p20140327.ebuild63
-rw-r--r--sys-apps/usb_modeswitch/usb_modeswitch-2.2.0_p20140529.ebuild63
-rw-r--r--sys-apps/usb_modeswitch/usb_modeswitch-2.2.3_p20150627.ebuild63
-rw-r--r--sys-apps/usbmon/Manifest1
-rw-r--r--sys-apps/usbmon/metadata.xml7
-rw-r--r--sys-apps/usbmon/usbmon-6-r1.ebuild32
-rw-r--r--sys-apps/usbredir/Manifest6
-rw-r--r--sys-apps/usbredir/metadata.xml6
-rw-r--r--sys-apps/usbredir/usbredir-0.4.3.ebuild33
-rw-r--r--sys-apps/usbredir/usbredir-0.4.4.ebuild34
-rw-r--r--sys-apps/usbredir/usbredir-0.5.1.ebuild36
-rw-r--r--sys-apps/usbredir/usbredir-0.5.ebuild36
-rw-r--r--sys-apps/usbredir/usbredir-0.6.ebuild36
-rw-r--r--sys-apps/usbredir/usbredir-0.7.ebuild36
-rw-r--r--sys-apps/usbredir/usbredir-9999.ebuild38
-rw-r--r--sys-apps/usbutils/Manifest2
-rw-r--r--sys-apps/usbutils/files/usbutils-006-stdint.patch32
-rw-r--r--sys-apps/usbutils/metadata.xml5
-rw-r--r--sys-apps/usbutils/usbutils-007.ebuild55
-rw-r--r--sys-apps/usbutils/usbutils-008-r1.ebuild50
-rw-r--r--sys-apps/usbutils/usbutils-008.ebuild52
-rw-r--r--sys-apps/usermode-utilities/Manifest1
-rw-r--r--sys-apps/usermode-utilities/files/usermode-utilities-20070815-humfsify-owner.patch12
-rw-r--r--sys-apps/usermode-utilities/files/usermode-utilities-20070815-rollup.patch101
-rw-r--r--sys-apps/usermode-utilities/metadata.xml10
-rw-r--r--sys-apps/usermode-utilities/usermode-utilities-20070815-r3.ebuild40
-rw-r--r--sys-apps/utempter/Manifest1
-rw-r--r--sys-apps/utempter/files/utempter-0.5.5.6-build.patch11
-rw-r--r--sys-apps/utempter/files/utempter-0.5.5.6-no_utmpx.patch38
-rw-r--r--sys-apps/utempter/files/utempter-0.5.5.6-soname-makefile-fix.patch22
-rw-r--r--sys-apps/utempter/metadata.xml6
-rw-r--r--sys-apps/utempter/utempter-0.5.5.6.ebuild57
-rw-r--r--sys-apps/util-linux/Manifest7
-rw-r--r--sys-apps/util-linux/files/crypto-loop.confd9
-rwxr-xr-xsys-apps/util-linux/files/crypto-loop.initd70
-rw-r--r--sys-apps/util-linux/files/util-linux-2.24-fix-fdisk-on-alpha.patch13
-rw-r--r--sys-apps/util-linux/files/util-linux-2.24-last-tests.patch86
-rw-r--r--sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch41
-rw-r--r--sys-apps/util-linux/files/util-linux-2.25-parallel-setarch.patch33
-rw-r--r--sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch43
-rw-r--r--sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch33
-rw-r--r--sys-apps/util-linux/metadata.xml20
-rw-r--r--sys-apps/util-linux/util-linux-2.24.1-r2.ebuild147
-rw-r--r--sys-apps/util-linux/util-linux-2.24.1-r3.ebuild174
-rw-r--r--sys-apps/util-linux/util-linux-2.24.2.ebuild177
-rw-r--r--sys-apps/util-linux/util-linux-2.25.1-r1.ebuild174
-rw-r--r--sys-apps/util-linux/util-linux-2.25.1.ebuild173
-rw-r--r--sys-apps/util-linux/util-linux-2.25.2-r1.ebuild177
-rw-r--r--sys-apps/util-linux/util-linux-2.25.2-r2.ebuild183
-rw-r--r--sys-apps/util-linux/util-linux-2.25.2.ebuild174
-rw-r--r--sys-apps/util-linux/util-linux-2.26.1-r1.ebuild178
-rw-r--r--sys-apps/util-linux/util-linux-2.26.1.ebuild177
-rw-r--r--sys-apps/util-linux/util-linux-2.26.2.ebuild182
-rw-r--r--sys-apps/util-linux/util-linux-2.26.ebuild177
-rw-r--r--sys-apps/util-linux/util-linux-9999.ebuild182
-rw-r--r--sys-apps/v86d/Manifest1
-rw-r--r--sys-apps/v86d/metadata.xml10
-rw-r--r--sys-apps/v86d/v86d-0.1.10.ebuild57
-rw-r--r--sys-apps/vbetool/Manifest1
-rw-r--r--sys-apps/vbetool/files/vbetool-1.0-build.patch18
-rw-r--r--sys-apps/vbetool/metadata.xml8
-rw-r--r--sys-apps/vbetool/vbetool-1.1.ebuild31
-rw-r--r--sys-apps/watchdog/Manifest2
-rw-r--r--sys-apps/watchdog/files/watchdog-conf.d6
-rw-r--r--sys-apps/watchdog/files/watchdog-init.d48
-rw-r--r--sys-apps/watchdog/files/watchdog.service10
-rw-r--r--sys-apps/watchdog/metadata.xml11
-rw-r--r--sys-apps/watchdog/watchdog-5.13-r1.ebuild38
-rw-r--r--sys-apps/watchdog/watchdog-5.14.ebuild38
-rw-r--r--sys-apps/which/Manifest2
-rw-r--r--sys-apps/which/metadata.xml5
-rw-r--r--sys-apps/which/which-2.20-r1.ebuild25
-rw-r--r--sys-apps/which/which-2.21.ebuild25
-rw-r--r--sys-apps/x86info/Manifest1
-rw-r--r--sys-apps/x86info/files/1.21-pic.patch15
-rw-r--r--sys-apps/x86info/files/x86info-1.24-pic.patch33
-rw-r--r--sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch13
-rw-r--r--sys-apps/x86info/files/x86info-modules.conf-rc9
-rw-r--r--sys-apps/x86info/metadata.xml8
-rw-r--r--sys-apps/x86info/x86info-1.30.ebuild62
-rw-r--r--sys-apps/xinetd/Manifest1
-rw-r--r--sys-apps/xinetd/files/xinetd-2.3.14-DESTDIR.patch27
-rw-r--r--sys-apps/xinetd/files/xinetd-2.3.14-config.patch9
-rw-r--r--sys-apps/xinetd/files/xinetd-2.3.14-install-contrib.patch24
-rw-r--r--sys-apps/xinetd/files/xinetd.confd3
-rw-r--r--sys-apps/xinetd/files/xinetd.rc633
-rw-r--r--sys-apps/xinetd/files/xinetd.service10
-rw-r--r--sys-apps/xinetd/metadata.xml8
-rw-r--r--sys-apps/xinetd/xinetd-2.3.15-r1.ebuild54
-rw-r--r--sys-apps/xmbmon/Manifest2
-rw-r--r--sys-apps/xmbmon/files/mbmon.confd10
-rw-r--r--sys-apps/xmbmon/files/mbmon.rc20
-rw-r--r--sys-apps/xmbmon/files/xmbmon-2.0.5-amd64.patch24
-rw-r--r--sys-apps/xmbmon/files/xmbmon-2.0.5-loopback.patch40
-rw-r--r--sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch31
-rw-r--r--sys-apps/xmbmon/metadata.xml5
-rw-r--r--sys-apps/xmbmon/xmbmon-2.0.5-r1.ebuild74
-rw-r--r--sys-apps/yum/Manifest1
-rw-r--r--sys-apps/yum/metadata.xml11
-rw-r--r--sys-apps/yum/yum-3.4.3_p20130218-r1.ebuild44
-rw-r--r--sys-apps/yum/yum-3.4.3_p20130218.ebuild43
-rw-r--r--sys-apps/zorroutils/Manifest1
-rw-r--r--sys-apps/zorroutils/files/zorroutils-0.04-20021014.diff62
-rw-r--r--sys-apps/zorroutils/files/zorroutils-gentoo.diff6
-rw-r--r--sys-apps/zorroutils/metadata.xml12
-rw-r--r--sys-apps/zorroutils/zorroutils-0.04.ebuild35
1746 files changed, 84152 insertions, 0 deletions
diff --git a/sys-apps/9base/9base-6-r1.ebuild b/sys-apps/9base/9base-6-r1.ebuild
new file mode 100644
index 000000000000..a305aceab3cc
--- /dev/null
+++ b/sys-apps/9base/9base-6-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="A port of various original Plan 9 tools for Unix, based on plan9port"
+HOMEPAGE="http://tools.suckless.org/9base"
+SRC_URI="http://dl.suckless.org/tools/${P}.tar.gz"
+
+LICENSE="9base MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+pkg_setup() {
+ local _objtype=386
+ [[ $(tc-arch) == "amd64" ]] && _objtype=x86_64
+ [[ $(tc-arch) == "ppc" ]] && _objtype=ppc
+
+ my9baseopts=(
+ PREFIX=/usr/plan9
+ OBJTYPE=${_objtype}
+ AR="$(tc-getAR) rc"
+ CC="$(tc-getCC)"
+ DESTDIR="${D}"
+ )
+}
+
+src_prepare() {
+ sed -i -e '/strip/d' std.mk {diff,sam}/Makefile || die
+
+ # http://lists.suckless.org/dev/1006/4639.html
+ sed -i -e '/-static/d' config.mk || die
+}
+
+src_compile() {
+ emake "${my9baseopts[@]}"
+}
+
+src_install() {
+ emake "${my9baseopts[@]}" install
+ dodoc README
+
+ # We don't compress to keep support for plan9's man
+ docompress -x /usr/plan9/share/man
+}
diff --git a/sys-apps/9base/Manifest b/sys-apps/9base/Manifest
new file mode 100644
index 000000000000..3772a3448c20
--- /dev/null
+++ b/sys-apps/9base/Manifest
@@ -0,0 +1 @@
+DIST 9base-6.tar.gz 1045868 SHA256 2997480eb5b4cf3092c0896483cd2de625158bf51c501aea2dc5cf74176d6de9 SHA512 38108a94118b56c6f3982e692beb1068c52f9aecd74447d6b552b77fae5e365eab72b4781bdf07d9696ac89d54371c1cae8cc0363de510b53988302acef50dba WHIRLPOOL 364afe8a9eabb42e215f1520751e737ab418d084aafbc83df57e823662d5237bae0f7c2904257073dac382c7c3116d46bb958b7d56bdee493ad9f6b12e147a71
diff --git a/sys-apps/9base/metadata.xml b/sys-apps/9base/metadata.xml
new file mode 100644
index 000000000000..c2d865517c00
--- /dev/null
+++ b/sys-apps/9base/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>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/accountsservice/Manifest b/sys-apps/accountsservice/Manifest
new file mode 100644
index 000000000000..3ee491ffddcc
--- /dev/null
+++ b/sys-apps/accountsservice/Manifest
@@ -0,0 +1,2 @@
+DIST accountsservice-0.6.39.tar.xz 367648 SHA256 f938a3d517ddd44c7605b49f11028198071906e0fde96f22c7e16d1eb275335d SHA512 b72f2edf95b7df5b38c75fbe4be2581384f7ff3631248a9fd2a523a13638e2c9c8933f195b8991a7138a556786531258b00878dc1a68863b616d2d2a17cbcf33 WHIRLPOOL 34b199ea220a8a34743ded82fba37b1ce90f7aafc9b7c1eb5988ef772d5d1f4d5283267327370d5a26966cc5370549323ffd2a9645bead9700b1a53dd5afe9bf
+DIST accountsservice-0.6.40.tar.xz 367772 SHA256 f04f756600cbab558671658ab8e77212de2a000c07bc0469e7b51541871fcb2b SHA512 da12a97ca9a2eb69d978fd3b5f46e8dd2e2f3e6f57db027e0b8c8c583c715d45f105c9ddcd1a2a1c4a2f4bfce672431e601a7cd0f063b31675fd6f13b6cb4ef8 WHIRLPOOL 3a12f5e5e68f3b21ec1347a9e1677b8eee10818ced138e35a3b1f61d8814a6af5ad50aed352a0fcbec819d8271c46c8db2e93ea0c7ccbbb5672f0f7e7e4786be
diff --git a/sys-apps/accountsservice/accountsservice-0.6.39.ebuild b/sys-apps/accountsservice/accountsservice-0.6.39.ebuild
new file mode 100644
index 000000000000..1230504b639c
--- /dev/null
+++ b/sys-apps/accountsservice/accountsservice-0.6.39.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+
+inherit eutils gnome2 systemd
+
+DESCRIPTION="D-Bus interfaces for querying and manipulating user account information"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/AccountsService/"
+SRC_URI="http://www.freedesktop.org/software/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm ~arm64 ~ia64 ppc ppc64 ~sparc x86"
+
+IUSE="doc +introspection selinux systemd"
+
+CDEPEND="
+ >=dev-libs/glib-2.37.3:2
+ sys-auth/polkit
+ introspection? ( >=dev-libs/gobject-introspection-0.9.12 )
+ systemd? ( >=sys-apps/systemd-186:0= )
+ !systemd? ( sys-auth/consolekit )
+"
+DEPEND="${CDEPEND}
+ dev-libs/libxslt
+ dev-util/gdbus-codegen
+ >=dev-util/gtk-doc-am-1.15
+ >=dev-util/intltool-0.40
+ sys-devel/gettext
+ virtual/pkgconfig
+ doc? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-accountsd )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-0.6.35-gentoo-system-users.patch"
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --disable-static \
+ --disable-more-warnings \
+ --localstatedir="${EPREFIX}"/var \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ --enable-admin-group="wheel" \
+ $(use_enable doc docbook-docs) \
+ $(use_enable introspection) \
+ $(use_enable systemd) \
+ $(systemd_with_unitdir)
+}
diff --git a/sys-apps/accountsservice/accountsservice-0.6.40.ebuild b/sys-apps/accountsservice/accountsservice-0.6.40.ebuild
new file mode 100644
index 000000000000..e995953183e9
--- /dev/null
+++ b/sys-apps/accountsservice/accountsservice-0.6.40.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+
+inherit eutils gnome2 systemd
+
+DESCRIPTION="D-Bus interfaces for querying and manipulating user account information"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/AccountsService/"
+SRC_URI="http://www.freedesktop.org/software/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm ~ia64 ppc ppc64 ~sparc x86"
+
+IUSE="doc +introspection selinux systemd"
+
+CDEPEND="
+ >=dev-libs/glib-2.37.3:2
+ sys-auth/polkit
+ introspection? ( >=dev-libs/gobject-introspection-0.9.12 )
+ systemd? ( >=sys-apps/systemd-186:0= )
+ !systemd? ( sys-auth/consolekit )
+"
+DEPEND="${CDEPEND}
+ dev-libs/libxslt
+ dev-util/gdbus-codegen
+ >=dev-util/gtk-doc-am-1.15
+ >=dev-util/intltool-0.40
+ sys-devel/gettext
+ virtual/pkgconfig
+ doc? (
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-accountsd )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-0.6.35-gentoo-system-users.patch"
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --disable-static \
+ --disable-more-warnings \
+ --localstatedir="${EPREFIX}"/var \
+ --enable-admin-group="wheel" \
+ $(use_enable doc docbook-docs) \
+ $(use_enable introspection) \
+ $(use_enable systemd) \
+ $(systemd_with_unitdir)
+}
diff --git a/sys-apps/accountsservice/files/accountsservice-0.6.35-gentoo-system-users.patch b/sys-apps/accountsservice/files/accountsservice-0.6.35-gentoo-system-users.patch
new file mode 100644
index 000000000000..9868e26ea39c
--- /dev/null
+++ b/sys-apps/accountsservice/files/accountsservice-0.6.35-gentoo-system-users.patch
@@ -0,0 +1,51 @@
+--- src/user-classify.c.old 2013-12-04 20:29:48.944454769 +0100
++++ src/user-classify.c 2013-12-04 20:32:59.728283477 +0100
+@@ -55,6 +55,48 @@
+ "at",
+ "gdm",
+ "gnome-initial-setup"
++ /* Additional Gentoo system users with non-trivial login shell */
++ "amanda",
++ "backuppc",
++ "drqueue",
++ "firebird",
++ "flexlm",
++ "foldingathome",
++ "geneweb",
++ "git",
++ "gnump3d",
++ "hacluster",
++ "hg",
++ "hsqldb",
++ "infinote",
++ "foldingathome",
++ "geneweb",
++ "git",
++ "gnump3d",
++ "hacluster",
++ "hg",
++ "hsqldb",
++ "infinote",
++ "jffnms",
++ "klive",
++ "mailman",
++ "mpd",
++ "mythtv",
++ "nagios",
++ "nx",
++ "oneadmin",
++ "openvpn",
++ "p2p",
++ "phxd",
++ "resin",
++ "rplayd",
++ "scponly",
++ "secoff",
++ "tinyproxy",
++ "ttrssd",
++ "vboxguest",
++ "vdr",
++ "vdradmin",
+ };
+
+ #define PATH_NOLOGIN "/sbin/nologin"
diff --git a/sys-apps/accountsservice/metadata.xml b/sys-apps/accountsservice/metadata.xml
new file mode 100644
index 000000000000..863d6473f89d
--- /dev/null
+++ b/sys-apps/accountsservice/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>gnome</herd>
+ <use>
+ <flag name="systemd">Use <pkg>sys-apps/systemd</pkg> instead of
+ <pkg>sys-auth/consolekit</pkg> for session tracking</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/ack/Manifest b/sys-apps/ack/Manifest
new file mode 100644
index 000000000000..43b5fd98122f
--- /dev/null
+++ b/sys-apps/ack/Manifest
@@ -0,0 +1 @@
+DIST ack-2.14.tar.gz 222479 SHA256 8549a833efec158dc85bc6334b3a384ae5a389896942eab9a58c6e630c181b3f SHA512 64af6490947e4dcc9e9a28c28db5750df7bec4098e3e8a9d940be5f6b99fe0169c091d390480eb95cf7704f24c745bd6c93b8cfd8de7cab75c11c313184666b4 WHIRLPOOL 1ff77ca6d4bbd65e5330de5bd9dd9ea67de8c2fe799078115315e4fd9b90ea59d58230f476579da999e2e4040537b50d7bbc166e49f877dae36c95971af6de67
diff --git a/sys-apps/ack/ack-2.14.ebuild b/sys-apps/ack/ack-2.14.ebuild
new file mode 100644
index 000000000000..1bf49df3b616
--- /dev/null
+++ b/sys-apps/ack/ack-2.14.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MODULE_AUTHOR=PETDANCE
+inherit perl-module
+
+DESCRIPTION="ack is a tool like grep, aimed at programmers with large trees of heterogeneous source code"
+HOMEPAGE="http://betterthangrep.com/ ${HOMEPAGE}"
+
+LICENSE="Artistic-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa x86 ~x86-interix ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="test"
+
+RDEPEND=">=dev-perl/File-Next-1.100.0"
+DEPEND="${RDEPEND}"
+
+SRC_TEST=do
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+
+src_test() {
+ # Tests fail when run in parallel and if dev-perl/IO-Tty is installed
+ # which enables interactive tests that need to read from stdin. If IO-Tty
+ # is not installed the related tests are skipped.
+ MAKEOPTS+=" -j1" perl-module_src_test
+}
diff --git a/sys-apps/ack/files/ack-2.14-gentoo.patch b/sys-apps/ack/files/ack-2.14-gentoo.patch
new file mode 100644
index 000000000000..80f0747deef9
--- /dev/null
+++ b/sys-apps/ack/files/ack-2.14-gentoo.patch
@@ -0,0 +1,22 @@
+--- ack-2.14/ConfigDefault.pm
++++ ack-2.14/ConfigDefault.pm
+@@ -252,6 +252,9 @@
+ # http://en.wikipedia.org/wiki/Fortran
+ --type-add=fortran:ext:f,f77,f90,f95,f03,for,ftn,fpp
+
++# Gentoo http://www.gentoo.org/
++--type-add=gentoo:ext:ebuild,eclass
++
+ # Go
+ # http://golang.org/
+ --type-add=go:ext:go
+--- ack-2.14/t/ack-filetypes.t
++++ ack-2.14/t/ack-filetypes.t
+@@ -26,6 +26,7 @@
+ elisp
+ erlang
+ fortran
++gentoo
+ go
+ groovy
+ haskell
diff --git a/sys-apps/ack/metadata.xml b/sys-apps/ack/metadata.xml
new file mode 100644
index 000000000000..3373cf89e6bb
--- /dev/null
+++ b/sys-apps/ack/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>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="cpan">ack</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/acl/Manifest b/sys-apps/acl/Manifest
new file mode 100644
index 000000000000..8a8caa8247fd
--- /dev/null
+++ b/sys-apps/acl/Manifest
@@ -0,0 +1,4 @@
+DIST acl-2.2.42-CITI_NFS4_ALL-2.dif 97276 SHA256 10c930e4c6d147d03ad6dc67e38663522fd277525c149d932a8279e2cbe1b95e
+DIST acl-2.2.49.src.tar.gz 362743 SHA256 b9c7f4752e4ef4930a62fa5aa0d7efe1cba2b5a3a2d6ee2b45c0a70c72b7e5d5 SHA512 c65b1ca18c16e434f1ff5b196908d1c39d62399740826a4a9b3ef0e6ba5cc4fced838b4a844ccffc5cb26554c4755b2f4e0fd69c9045d692f9019972ce3f7f0b WHIRLPOOL 028f373f334700896b8c455f41a9f83dc6da82a6454da9da81a98e05f5f058ee88d0b1487f97e9d5b7c204a97ed125fc331bdcce6cb454ddbfbe9eeb6de0a55c
+DIST acl-2.2.51.src.tar.gz 385378 SHA256 06854521cf5d396801af7e54b9636680edf8064355e51c07657ec7442a185225 SHA512 32b0c7f5aff27b1a0278dea2cc7aacf03f791c5bd7e9ae520bf29516bf3e52969c0a7ce9af3c2fa95b222cc70d4e19da167d008dcdf0fb46bda86cd584c96d98 WHIRLPOOL 0c41e39008c0bbb254d3ca29dc597e888d0a76820d8f78246ae06448ea5fdf9d25b54c112d86137420007641d23e172c67402d05acdc34af5b6b387b32c290a2
+DIST acl-2.2.52.src.tar.gz 386604 SHA256 179074bb0580c06c4b4137be4c5a92a701583277967acdb5546043c7874e0d23 SHA512 59973199d371cd0b2368e95bc829a1b47f04e808a174fefba4c6854e766158bd19a71d9dbcc8d6fdc1573a1f971cdda39c453f7fa243bce02c1ab97c6e7c72e7 WHIRLPOOL 19bcc46e56ce0226e084bb6f86e411b09418d53f094f478afd60c3c568cf2066d9f0352a4da20f6f41d6e08c13412a182a7306aa3fbe2a248d1f6388856f63a2
diff --git a/sys-apps/acl/acl-2.2.49-r1.ebuild b/sys-apps/acl/acl-2.2.49-r1.ebuild
new file mode 100644
index 000000000000..cb399072efe1
--- /dev/null
+++ b/sys-apps/acl/acl-2.2.49-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="access control list utilities, libraries and headers"
+HOMEPAGE="http://savannah.nongnu.org/projects/acl"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${P}.src.tar.gz
+ nfs? ( http://www.citi.umich.edu/projects/nfsv4/linux/acl-patches/2.2.42-2/acl-2.2.42-CITI_NFS4_ALL-2.dif )"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux"
+IUSE="nfs nls static-libs"
+
+RDEPEND=">=sys-apps/attr-2.4
+ nfs? ( net-libs/libnfsidmap )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ if use nfs ; then
+ cp "${DISTDIR}"/acl-2.2.42-CITI_NFS4_ALL-2.dif . || die
+ sed -i \
+ -e '/^diff --git a.debian.changelog b.debian.changelog/,/^diff --git/d' \
+ acl-2.2.42-CITI_NFS4_ALL-2.dif || die
+ epatch acl-2.2.42-CITI_NFS4_ALL-2.dif
+ fi
+ epatch "${FILESDIR}"/${P}-quote-strchr.patch
+ sed -i \
+ -e '/^as_dummy=/s:=":="$PATH$PATH_SEPARATOR:' \
+ configure # hack PATH with AC_PATH_PROG
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die "failed to update builddefs"
+ strip-linguas po
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+src_install() {
+ emake DIST_ROOT="${D}" install install-dev install-lib || die
+ use static-libs || find "${D}" -name '*.la' -delete
+
+ # move shared libs to /
+ gen_usr_ldscript -a acl
+}
diff --git a/sys-apps/acl/acl-2.2.49.ebuild b/sys-apps/acl/acl-2.2.49.ebuild
new file mode 100644
index 000000000000..243dd1cdae59
--- /dev/null
+++ b/sys-apps/acl/acl-2.2.49.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="access control list utilities, libraries and headers"
+HOMEPAGE="http://savannah.nongnu.org/projects/acl"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${P}.src.tar.gz
+ nfs? ( http://www.citi.umich.edu/projects/nfsv4/linux/acl-patches/2.2.42-2/acl-2.2.42-CITI_NFS4_ALL-2.dif )"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux"
+IUSE="nfs nls"
+
+RDEPEND=">=sys-apps/attr-2.4
+ nfs? ( net-libs/libnfsidmap )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${P}.src.tar.gz
+ cd "${S}"
+ if use nfs ; then
+ cp "${DISTDIR}"/acl-2.2.42-CITI_NFS4_ALL-2.dif . || die
+ sed -i \
+ -e '/^diff --git a.debian.changelog b.debian.changelog/,/^diff --git/d' \
+ acl-2.2.42-CITI_NFS4_ALL-2.dif || die
+ epatch acl-2.2.42-CITI_NFS4_ALL-2.dif
+ fi
+ epatch "${FILESDIR}"/${P}-quote-strchr.patch
+ sed -i \
+ -e '/^as_dummy=/s:=":="$PATH$PATH_SEPARATOR:' \
+ configure # hack PATH with AC_PATH_PROG
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die "failed to update builddefs"
+ strip-linguas po
+}
+
+src_compile() {
+ use prefix || EPREFIX=
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+
+ emake || die
+}
+
+src_install() {
+ emake DIST_ROOT="${D}" install install-dev install-lib || die
+ prepalldocs
+
+ # move shared libs to /
+ gen_usr_ldscript -a acl
+}
diff --git a/sys-apps/acl/acl-2.2.51.ebuild b/sys-apps/acl/acl-2.2.51.ebuild
new file mode 100644
index 000000000000..81e6130d9486
--- /dev/null
+++ b/sys-apps/acl/acl-2.2.51.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="access control list utilities, libraries and headers"
+HOMEPAGE="http://savannah.nongnu.org/projects/acl"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${P}.src.tar.gz
+ nfs? ( http://www.citi.umich.edu/projects/nfsv4/linux/acl-patches/2.2.42-2/acl-2.2.42-CITI_NFS4_ALL-2.dif )"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="nfs nls static-libs"
+
+RDEPEND=">=sys-apps/attr-2.4
+ nfs? ( net-libs/libnfsidmap )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ if use nfs ; then
+ cp "${DISTDIR}"/acl-2.2.42-CITI_NFS4_ALL-2.dif . || die
+ sed -i \
+ -e '/^diff --git a.debian.changelog b.debian.changelog/,/^diff --git/d' \
+ acl-2.2.42-CITI_NFS4_ALL-2.dif || die
+ epatch acl-2.2.42-CITI_NFS4_ALL-2.dif
+ fi
+ epatch "${FILESDIR}"/${PN}-2.2.49-quote-strchr.patch
+ epatch "${FILESDIR}"/${PN}-2.2.51-config-shell.patch #365397
+ sed -i \
+ -e '/^as_dummy=/s:=":="$PATH$PATH_SEPARATOR:' \
+ configure # hack PATH with AC_PATH_PROG
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die "failed to update builddefs"
+ strip-linguas po
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+src_install() {
+ emake DIST_ROOT="${D}" install install-dev install-lib || die
+ use static-libs || find "${D}" -name '*.la' -delete
+
+ # move shared libs to /
+ gen_usr_ldscript -a acl
+}
diff --git a/sys-apps/acl/acl-2.2.52-r1.ebuild b/sys-apps/acl/acl-2.2.52-r1.ebuild
new file mode 100644
index 000000000000..00869bfbaa8c
--- /dev/null
+++ b/sys-apps/acl/acl-2.2.52-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+DESCRIPTION="access control list utilities, libraries and headers"
+HOMEPAGE="http://savannah.nongnu.org/projects/acl"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${P}.src.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="nls static-libs"
+
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die
+ strip-linguas po
+
+ # same as https://savannah.nongnu.org/bugs/index.php?39736
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+multilib_src_install() {
+ emake DIST_ROOT="${D}" install install-dev install-lib
+
+ # move shared libs to /
+ multilib_is_native_abi && gen_usr_ldscript -a acl
+}
+
+multilib_src_install_all() {
+ use static-libs || prune_libtool_files --all
+}
diff --git a/sys-apps/acl/acl-2.2.52.ebuild b/sys-apps/acl/acl-2.2.52.ebuild
new file mode 100644
index 000000000000..ccb800c9d82f
--- /dev/null
+++ b/sys-apps/acl/acl-2.2.52.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 eutils toolchain-funcs
+
+DESCRIPTION="access control list utilities, libraries and headers"
+HOMEPAGE="http://savannah.nongnu.org/projects/acl"
+SRC_URI="http://download.savannah.gnu.org/releases/${PN}/${P}.src.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="nls static-libs"
+
+RDEPEND=">=sys-apps/attr-2.4"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die
+ strip-linguas po
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+src_install() {
+ emake DIST_ROOT="${D}" install install-dev install-lib || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # move shared libs to /
+ gen_usr_ldscript -a acl
+}
diff --git a/sys-apps/acl/files/acl-2.2.49-quote-strchr.patch b/sys-apps/acl/files/acl-2.2.49-quote-strchr.patch
new file mode 100644
index 000000000000..d2510da24eea
--- /dev/null
+++ b/sys-apps/acl/files/acl-2.2.49-quote-strchr.patch
@@ -0,0 +1,25 @@
+From 7565e4fcb9209782ed02f3caff246cf5ea816674 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 8 Jan 2010 21:28:31 -0500
+Subject: [PATCH] quote: pull in string.h for strchr prototype
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libmisc/quote.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/libmisc/quote.c b/libmisc/quote.c
+index f98c887..bf8f9eb 100644
+--- a/libmisc/quote.c
++++ b/libmisc/quote.c
+@@ -20,6 +20,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <ctype.h>
++#include <string.h>
+ #include "misc.h"
+
+ const char *quote(const char *str, const char *quote_chars)
+--
+1.6.6
+
diff --git a/sys-apps/acl/files/acl-2.2.51-config-shell.patch b/sys-apps/acl/files/acl-2.2.51-config-shell.patch
new file mode 100644
index 000000000000..78b3f0f641db
--- /dev/null
+++ b/sys-apps/acl/files/acl-2.2.51-config-shell.patch
@@ -0,0 +1,53 @@
+https://bugs.gentoo.org/365397
+
+From 10bfb16245ec4b55c1f5b6dc5554913bc9b13c9c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 16 May 2011 01:59:52 -0400
+Subject: [PATCH] use SHELL from configure
+
+If /bin/sh is not a functional enough shell, configure will select a
+SHELL of /bin/bash or better. But the current build helpers always
+hardcode /bin/sh, so if libtool itself configures itself for /bin/bash,
+things will fail when it attempts to do:
+ SHELL = /bin/sh
+ LIBTOOL = $(SHELL) .../libtool
+ ...
+ eval: 1: base_compile+= -pipe: not found
+ ...
+
+So rather than hardcoding SHELL to /bin/sh, set it to @SHELL@ and let
+configure find a good value for us.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/builddefs.in | 1 +
+ include/buildmacros | 1 -
+ 2 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d054a56..434ce95 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -46,6 +46,7 @@ MAKE = @make@
+ ECHO = @echo@
+ SORT = @sort@
+ LN_S = @LN_S@
++SHELL = @SHELL@
+ LIBTOOL = @LIBTOOL@
+ MAKEDEPEND = @makedepend@
+
+diff --git a/include/buildmacros b/include/buildmacros
+index ab89182..8efb32e 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -42,7 +42,6 @@ OBJECTS = $(ASFILES:.s=.o) \
+
+ INSTALL = $(TOPDIR)/include/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
+
+-SHELL = /bin/sh
+ IMAGES_DIR = $(TOPDIR)/all-images
+ DIST_DIR = $(TOPDIR)/dist
+
+--
+1.7.5.rc3
+
diff --git a/sys-apps/acl/metadata.xml b/sys-apps/acl/metadata.xml
new file mode 100644
index 000000000000..2dc91f5bf1de
--- /dev/null
+++ b/sys-apps/acl/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>
+<use>
+ <flag name='nfs'>
+ add support for NFS acls
+ </flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:xfs:acl</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-apps/adjtime/Manifest b/sys-apps/adjtime/Manifest
new file mode 100644
index 000000000000..94fb0fd12a3a
--- /dev/null
+++ b/sys-apps/adjtime/Manifest
@@ -0,0 +1 @@
+DIST adjtime.zip 2805 SHA256 64d0ffe0510ce727c3ead8bbc1e3c923a463253b375579b31040815cb6014800 SHA512 cc0f16ca19fea240300f9e0a9eddcefa07cb21f59fe4da8e7132dc75ec26ecaf7036ee6d282f8a488005b40077931e1cadc5634095aa0ff402f375bc0e83a1c0 WHIRLPOOL be5bec263c81fbbf97fb90dbe2df8351181a3c42dba00759700d71798dea93327731cc0647049781cdc0177bb943ae6b457299fe9cf32d4b77d6c88776216e16
diff --git a/sys-apps/adjtime/adjtime-0.4-r2.ebuild b/sys-apps/adjtime/adjtime-0.4-r2.ebuild
new file mode 100644
index 000000000000..a723741cb411
--- /dev/null
+++ b/sys-apps/adjtime/adjtime-0.4-r2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A perl script to adjust the clock tick of the hardware clock on the system board"
+HOMEPAGE="http://groups.yahoo.com/group/LinkStation_General/"
+SRC_URI="http://www.gentoogeek.org/files/${PN}.zip"
+
+LICENSE="all-rights-reserved" #441922
+SLOT="0"
+KEYWORDS="ppc"
+RESTRICT="mirror bindist"
+
+DEPEND="app-arch/unzip"
+RDEPEND="dev-lang/perl
+ >=net-misc/ntp-4.2"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ sed -i -e 's:/usr/sbin/tickadj:/usr/bin/tickadj:' adjtime.pl || die
+}
+
+src_install() {
+ dosbin adjtime.pl
+}
+
+pkg_postinst() {
+ ewarn "There have been issues with running adjtime as an init script"
+ ewarn "(the shell environment for perl is dorked up). The suggested"
+ ewarn "method is to use ntp-date rather than ntpd at startup, and"
+ ewarn "add the following two lines to local.start instead:"
+ ewarn
+ ewarn "/usr/bin/perl /usr/sbin/adjtime.pl -v -s ntp_host -i 60"
+ ewarn
+ ewarn "/etc/init.d/ntpd start"
+ ewarn
+ ewarn "replacing ntp_host with your preferred ntp server. Remember,"
+ ewarn "since adjtime uses ntp-date, ntpd must be stopped (or not yet"
+ ewarn "started) prior to running the adjtime script."
+}
diff --git a/sys-apps/adjtime/metadata.xml b/sys-apps/adjtime/metadata.xml
new file mode 100644
index 000000000000..316fde480cf2
--- /dev/null
+++ b/sys-apps/adjtime/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>ppc</herd>
+<longdescription>A perl script to adjust the tick on the Kurobox and
+ LinkStation hardware clock (required to keep an accurate clock).
+ Should work on most hardware platforms.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/agedu/Manifest b/sys-apps/agedu/Manifest
new file mode 100644
index 000000000000..84b6b426f987
--- /dev/null
+++ b/sys-apps/agedu/Manifest
@@ -0,0 +1,2 @@
+DIST agedu-20141024.r10297.tar.gz 164175 SHA256 2760df3b2e37ec0a472a1630fcd53f61443e76ddb7daabb907ada77d3a580ce0 SHA512 1fe2344b5542f9c2b316ef294e25364590384723c0d56f1fcf1d1518d18dcb34daa1ba35bc23be5cb0723e0d2e278e05d21852e075bc656b6df51d94b8c3a08d WHIRLPOOL 0f59bd5f7d652f429788677fed2cf6e223223a227533434719be6aab5638b2d082989274656b2ef41adc754884fe7aa2f89447114e2dd17e51dbd8fb2ceb0597
+DIST agedu-20150422.3922.tar.gz 164771 SHA256 4314c8f991bb6a9bf8d0792737be4f51141a87627ad867f515e07d8b7f0922eb SHA512 77833c369e4647b00eebe671152345b2a4adc01b40fe1f51f1d8f9e1258b11b55dc3441997aa135ecfe5f36598afbb6566108caa1178a94f5a34d9b7904f14f4 WHIRLPOOL 7b84a775bd4af3c3b59039af880bcdb0363ffbf4f40e49396659d21ba5bab14865bae84c1b1890341a34ed1bf48c7a5d383053ec904ccf9e67e39c485c03f625
diff --git a/sys-apps/agedu/agedu-20141024.10297.ebuild b/sys-apps/agedu/agedu-20141024.10297.ebuild
new file mode 100644
index 000000000000..f1aca36a19e8
--- /dev/null
+++ b/sys-apps/agedu/agedu-20141024.10297.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 autotools eutils versionator
+
+MY_COMP=( $(get_all_version_components) )
+MY_P="${PN}-${MY_COMP[0]}.r${MY_COMP[2]}"
+
+DESCRIPTION="A utility for tracking down wasted disk space"
+HOMEPAGE="http://www.chiark.greenend.org.uk/~sgtatham/agedu/"
+SRC_URI="http://www.chiark.greenend.org.uk/~sgtatham/${PN}/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc ipv6"
+
+DEPEND="doc? ( app-doc/halibut )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-r9671-fix-automagic.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf --enable-ipv4 \
+ $(use_enable doc halibut) \
+ $(use_enable ipv6)
+}
diff --git a/sys-apps/agedu/agedu-20150422.3922.ebuild b/sys-apps/agedu/agedu-20150422.3922.ebuild
new file mode 100644
index 000000000000..a9472ed6e8d0
--- /dev/null
+++ b/sys-apps/agedu/agedu-20150422.3922.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 eutils versionator
+
+MY_COMP=( $(get_all_version_components) )
+MY_P="${PN}-${MY_COMP[0]}.${MY_COMP[2]}"
+
+DESCRIPTION="A utility for tracking down wasted disk space"
+HOMEPAGE="http://www.chiark.greenend.org.uk/~sgtatham/agedu/"
+SRC_URI="http://www.chiark.greenend.org.uk/~sgtatham/${PN}/${MY_P}ffe.tar.gz -> ${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}ffe"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc ipv6"
+
+DEPEND="doc? ( app-doc/halibut )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-r9671-fix-automagic.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf --enable-ipv4 \
+ $(use_enable doc halibut) \
+ $(use_enable ipv6)
+}
diff --git a/sys-apps/agedu/files/agedu-r9671-fix-automagic.patch b/sys-apps/agedu/files/agedu-r9671-fix-automagic.patch
new file mode 100644
index 000000000000..8e0c6ea2969e
--- /dev/null
+++ b/sys-apps/agedu/files/agedu-r9671-fix-automagic.patch
@@ -0,0 +1,44 @@
+diff -Naur agedu-r9671.orig/configure.ac agedu-r9671/configure.ac
+--- agedu-r9671.orig/configure.ac 2012-10-20 21:20:47.000000000 -0400
++++ agedu-r9671/configure.ac 2012-10-21 15:13:08.000000000 -0400
+@@ -10,8 +10,6 @@
+ AC_PROG_CC
+ AC_PROG_CC_C99
+ AC_PROG_INSTALL
+-AC_CHECK_PROG([HALIBUT],[halibut],[yes],[no])
+-AM_CONDITIONAL([HAVE_HALIBUT],[test "x$HALIBUT" = "xyes"])
+
+ # Checks for libraries.
+
+@@ -43,13 +41,28 @@
+
+ AC_CHECK_FUNCS([ftruncate fdopendir lstat64 stat64 memchr munmap select socket strcasecmp strchr strcspn strerror strrchr strspn strtoul strtoull connect inet_ntoa inet_addr gethostbyname getaddrinfo])
+
++AC_ARG_ENABLE([halibut],
++ AS_HELP_STRING([--disable-halibut],
++ [disable documentation with halibut (default off)]),
++ [halibut=$enableval],[halibut=no])
++
++if test "$halibut" = "no"; then
++ AM_CONDITIONAL([HAVE_HALIBUT],[false])
++else
++ AC_CHECK_PROG([have_halibut],[halibut],[yes],[no])
++ if test "$have_halibut" = "no"; then
++ AC_MSG_ERROR([halibut configured but not found])
++ fi
++ AM_CONDITIONAL([HAVE_HALIBUT],[true])
++fi
++
+ AC_ARG_ENABLE([ipv6],
+ AS_HELP_STRING([--disable-ipv6],
+- [disable IPv6 in the built-in web server]),
+- [ipv6=$enableval],[ipv6=$ac_cv_func_getaddrinfo])
++ [disable IPv6 in the built-in web server (default off)]),
++ [ipv6=$enableval],[ipv6=no])
+ AC_ARG_ENABLE([ipv4],
+ AS_HELP_STRING([--disable-ipv4],
+- [disable IPv4 in the built-in web server]),
++ [disable IPv4 in the built-in web server (default on)]),
+ [ipv4=$enableval],[ipv4=yes])
+ if test "$ipv6" = "no"; then
+ AC_DEFINE([NO_IPV6], [1], [define if IPv6 is disabled at configure time])
diff --git a/sys-apps/agedu/metadata.xml b/sys-apps/agedu/metadata.xml
new file mode 100644
index 000000000000..1e7587374fdf
--- /dev/null
+++ b/sys-apps/agedu/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-apps/aix-miscutils/Manifest b/sys-apps/aix-miscutils/Manifest
new file mode 100644
index 000000000000..1c1f24999488
--- /dev/null
+++ b/sys-apps/aix-miscutils/Manifest
@@ -0,0 +1 @@
+DIST aix-miscutils-0.1.1671.tar.bz2 84825 RMD160 8fe6e3d490fb9053c9ee852c319df412b703b1c7 SHA1 5e34f1c9aa50dd2a9c6b5e7f8ba8a8aa0fe09b2b SHA256 3ba79107ddf0ae39263ad864471c438b920ac2845c25e86c546b198450a19304
diff --git a/sys-apps/aix-miscutils/aix-miscutils-0.1.1671.ebuild b/sys-apps/aix-miscutils/aix-miscutils-0.1.1671.ebuild
new file mode 100644
index 000000000000..efe805347812
--- /dev/null
+++ b/sys-apps/aix-miscutils/aix-miscutils-0.1.1671.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Miscellaneous helpers for AIX (currently just ldd)"
+HOMEPAGE="http://www.gentoo.org/proj/en/gentoo-alt/prefix/"
+SRC_URI="http://dev.gentoo.org/~haubi/distfiles/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc-aix"
+IUSE=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+}
diff --git a/sys-apps/aix-miscutils/metadata.xml b/sys-apps/aix-miscutils/metadata.xml
new file mode 100644
index 000000000000..0a2c0a13150a
--- /dev/null
+++ b/sys-apps/aix-miscutils/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>prefix</herd>
+<maintainer>
+ <email>haubi@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/apmd/Manifest b/sys-apps/apmd/Manifest
new file mode 100644
index 000000000000..ccd5df8ac921
--- /dev/null
+++ b/sys-apps/apmd/Manifest
@@ -0,0 +1,2 @@
+DIST apmd_3.2.2-14.diff.gz 19195 SHA256 7905ff96be93d725544d0040e425c42f9c05580db3c272f11cff75b9aa89d430 SHA512 a3578d0c43950f832fb437a744f8a4c3058c731649decb90f7b42c901b06f4df5f9a75599b4278e15af1c8a30d8043b0d76eb7d2cb67b05bf6bb210d5912a16d WHIRLPOOL 300ef81d426fffa0c3ce944d523245745a9388013672f756d4f298f5e2d0b136d962b6d635d6fc787bdd2aa351097ac682ebe0b9ee41fc32e19c74b69601712b
+DIST apmd_3.2.2.orig.tar.gz 72757 SHA256 7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d SHA512 fdc74703e75a700397bb2c907986f0cf0792ee4128d7a7ae08adf090bff0ea595044ba7a935d34929745bb702eb8bfe232e0ee9156efd23a995dc087f1b20bf4 WHIRLPOOL 4fbb0f6d99215ce754686c2748b7ad7bcbe219ddafa190a05f9c345957f7bebd51b04e26e23ec4bdb8c49cba6e89fabbb3dbf631fd4342a5dc4bd1148e4b7b63
diff --git a/sys-apps/apmd/apmd-3.2.2_p14.ebuild b/sys-apps/apmd/apmd-3.2.2_p14.ebuild
new file mode 100644
index 000000000000..3313962ac015
--- /dev/null
+++ b/sys-apps/apmd/apmd-3.2.2_p14.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils multilib toolchain-funcs
+
+MY_PV=${PV%_p*}
+MY_P=${PN}_${MY_PV}
+PATCHV=${PV#*_p}
+
+DESCRIPTION="Advanced Power Management Daemon"
+HOMEPAGE="http://packages.qa.debian.org/a/apmd.html"
+SRC_URI="mirror://debian/pool/main/a/apmd/${MY_P}.orig.tar.gz
+ mirror://debian/pool/main/a/apmd/${MY_P}-${PATCHV}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 x86"
+IUSE="nls X"
+
+RDEPEND=">=sys-apps/debianutils-1.16
+ >=sys-power/powermgmt-base-1.31
+ X? ( x11-libs/libX11
+ x11-libs/libXaw
+ x11-libs/libXmu
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libXt
+ x11-libs/libXext )"
+DEPEND="${RDEPEND}
+ sys-devel/libtool
+ virtual/os-headers"
+
+S=${WORKDIR}/${PN}-${MY_PV}.orig
+
+src_prepare() {
+ epatch "${WORKDIR}"/${MY_P}-${PATCHV}.diff
+
+ if ! use X; then
+ sed -i \
+ -e 's:\(EXES=.*\)xapm:\1:' \
+ -e 's:\(.*\)\$(LT_INSTALL).*xapm.*$:\1echo:' \
+ Makefile || die
+ fi
+
+ # use system headers and skip on_ac_power
+ rm -f on_ac_power*
+
+ sed -i \
+ -e '/on_ac_power/d' \
+ -e 's:-I/usr/src/linux/include -I/usr/X11R6/include::' \
+ -e 's:-L/usr/X11R6/lib::' \
+ Makefile || die
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dodir /usr/sbin
+ emake DESTDIR="${D}" PREFIX=/usr LIBDIR=/usr/$(get_libdir) install
+
+ keepdir /etc/apm/{event.d,suspend.d,resume.d,other.d,scripts.d}
+ exeinto /etc/apm
+ doexe debian/apmd_proxy
+ dodoc AUTHORS {,apmsleep.}README debian/{changelog,README.Debian}
+
+ doman *.{1,8}
+
+ # note: apmd_proxy.conf is currently disabled and not used, thus
+ # not installed - liquidx (01 Mar 2004)
+
+ newconfd "${FILESDIR}"/apmd.confd apmd
+ newinitd "${FILESDIR}"/apmd.rc6 apmd
+
+ use nls || rm -rf "${D}"/usr/share/man/fr
+}
diff --git a/sys-apps/apmd/files/apmd.confd b/sys-apps/apmd/files/apmd.confd
new file mode 100644
index 000000000000..5f371d9083b8
--- /dev/null
+++ b/sys-apps/apmd/files/apmd.confd
@@ -0,0 +1,4 @@
+# /etc/init.d/apmd:
+# $Id$
+
+APMD_OPTS="-P /etc/apm/apmd_proxy"
diff --git a/sys-apps/apmd/files/apmd.rc6 b/sys-apps/apmd/files/apmd.rc6
new file mode 100644
index 000000000000..bb5e0091b773
--- /dev/null
+++ b/sys-apps/apmd/files/apmd.rc6
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+checkconfig() {
+ if [ ! -e /proc/apm ] ; then
+ eerror "APM support has not been compiled into the kernel"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting apmd"
+ start-stop-daemon --start --quiet --pidfile /var/run/apmd.pid \
+ --startas /usr/sbin/apmd -- ${APMD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping apmd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/apmd.pid
+ eend $?
+}
diff --git a/sys-apps/apmd/metadata.xml b/sys-apps/apmd/metadata.xml
new file mode 100644
index 000000000000..4538a68724a6
--- /dev/null
+++ b/sys-apps/apmd/metadata.xml
@@ -0,0 +1,5 @@
+<?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>
+</pkgmetadata>
diff --git a/sys-apps/apparmor-utils/Manifest b/sys-apps/apparmor-utils/Manifest
new file mode 100644
index 000000000000..dbf34e84db21
--- /dev/null
+++ b/sys-apps/apparmor-utils/Manifest
@@ -0,0 +1,2 @@
+DIST apparmor-2.8.3.tar.gz 1534245 SHA256 84c2ca7fb6d170e5bb56270f01c9b78e78a991b9eee7fa53a9e6409ef0845c7e SHA512 c1102206fc93e09865a8cbb239164298af298175d7043efa10ab7227c23e7aef664d38fa3b67e82e2263fba9dbc0567fa659233226633b7e26ac80e2c02c78fb WHIRLPOOL 24ee03843c4cc08e63c4641784bd648f2b85e42b2528e03b3a7d80d5d6b96e1eec5ea9cfdd2d1243dc855c9a05d0661fa3336f8d95b460be3b2bceab51936086
+DIST apparmor-2.8.4.tar.gz 1539923 SHA256 98cb81b2e2e17a8034005d2612ba6c33893486fdf995626f3bb94a4a082371d6 SHA512 d9f15bbfb4cb8428cacc7669099a0ce8acf33cbf309a65fea601f1d23b6e741a403eb4f8d91a8897f1959862f8d2ca8843918e56f511f2230e88476037511177 WHIRLPOOL 0520a5295a1184754c4d4dafe8253f4c0b6c8d0145ee586f0ecdab2d86630b7d08f8fd8ae87658c5663d3410575838b01d8c1ad2faec74271153c0d7a510e35b
diff --git a/sys-apps/apparmor-utils/apparmor-utils-2.8.3.ebuild b/sys-apps/apparmor-utils/apparmor-utils-2.8.3.ebuild
new file mode 100644
index 000000000000..bbbe5103efa1
--- /dev/null
+++ b/sys-apps/apparmor-utils/apparmor-utils-2.8.3.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit perl-module python-r1 versionator
+
+DESCRIPTION="Additional userspace utils to assist with AppArmor profile management"
+HOMEPAGE="http://apparmor.net/"
+SRC_URI="http://launchpad.net/apparmor/$(get_version_component_range 1-2)/${PV}/+download/apparmor-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="dev-lang/perl
+ ${PYTHON_DEPS}"
+RDEPEND="${DEPEND}
+ ~sys-libs/libapparmor-${PV}[perl]
+ ~sys-apps/apparmor-${PV}
+ dev-perl/Locale-gettext
+ dev-perl/RPC-XML
+ dev-perl/TermReadKey
+ virtual/perl-Data-Dumper
+ virtual/perl-Getopt-Long"
+
+S=${WORKDIR}/apparmor-${PV}/utils
+
+src_compile() {
+ python_export_best
+
+ # launches non-make subprocesses causing "make jobserver unavailable"
+ # error messages to appear in generated code
+ emake -j1
+}
+
+src_install() {
+ perl_set_version
+ emake DESTDIR="${D}" PERLDIR="${D}/${VENDOR_LIB}/Immunix" \
+ VIM_INSTALL_PATH="${D}/usr/share/vim/vimfiles/syntax" install
+
+ install_python() {
+ "${PYTHON}" "${S}"/python-tools-setup.py install --prefix=/usr \
+ --root="${D}" --version="${PV}"
+ }
+
+ python_foreach_impl install_python
+ python_replicate_script "${D}"/usr/bin/aa-easyprof
+}
diff --git a/sys-apps/apparmor-utils/apparmor-utils-2.8.4.ebuild b/sys-apps/apparmor-utils/apparmor-utils-2.8.4.ebuild
new file mode 100644
index 000000000000..bbbe5103efa1
--- /dev/null
+++ b/sys-apps/apparmor-utils/apparmor-utils-2.8.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
+PYTHON_COMPAT=( python2_7 )
+
+inherit perl-module python-r1 versionator
+
+DESCRIPTION="Additional userspace utils to assist with AppArmor profile management"
+HOMEPAGE="http://apparmor.net/"
+SRC_URI="http://launchpad.net/apparmor/$(get_version_component_range 1-2)/${PV}/+download/apparmor-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="dev-lang/perl
+ ${PYTHON_DEPS}"
+RDEPEND="${DEPEND}
+ ~sys-libs/libapparmor-${PV}[perl]
+ ~sys-apps/apparmor-${PV}
+ dev-perl/Locale-gettext
+ dev-perl/RPC-XML
+ dev-perl/TermReadKey
+ virtual/perl-Data-Dumper
+ virtual/perl-Getopt-Long"
+
+S=${WORKDIR}/apparmor-${PV}/utils
+
+src_compile() {
+ python_export_best
+
+ # launches non-make subprocesses causing "make jobserver unavailable"
+ # error messages to appear in generated code
+ emake -j1
+}
+
+src_install() {
+ perl_set_version
+ emake DESTDIR="${D}" PERLDIR="${D}/${VENDOR_LIB}/Immunix" \
+ VIM_INSTALL_PATH="${D}/usr/share/vim/vimfiles/syntax" install
+
+ install_python() {
+ "${PYTHON}" "${S}"/python-tools-setup.py install --prefix=/usr \
+ --root="${D}" --version="${PV}"
+ }
+
+ python_foreach_impl install_python
+ python_replicate_script "${D}"/usr/bin/aa-easyprof
+}
diff --git a/sys-apps/apparmor-utils/metadata.xml b/sys-apps/apparmor-utils/metadata.xml
new file mode 100644
index 000000000000..f60a2bbf973d
--- /dev/null
+++ b/sys-apps/apparmor-utils/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>hardened</herd>
+ <maintainer>
+ <email>kensington@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">apparmor</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/apparmor/Manifest b/sys-apps/apparmor/Manifest
new file mode 100644
index 000000000000..dbf34e84db21
--- /dev/null
+++ b/sys-apps/apparmor/Manifest
@@ -0,0 +1,2 @@
+DIST apparmor-2.8.3.tar.gz 1534245 SHA256 84c2ca7fb6d170e5bb56270f01c9b78e78a991b9eee7fa53a9e6409ef0845c7e SHA512 c1102206fc93e09865a8cbb239164298af298175d7043efa10ab7227c23e7aef664d38fa3b67e82e2263fba9dbc0567fa659233226633b7e26ac80e2c02c78fb WHIRLPOOL 24ee03843c4cc08e63c4641784bd648f2b85e42b2528e03b3a7d80d5d6b96e1eec5ea9cfdd2d1243dc855c9a05d0661fa3336f8d95b460be3b2bceab51936086
+DIST apparmor-2.8.4.tar.gz 1539923 SHA256 98cb81b2e2e17a8034005d2612ba6c33893486fdf995626f3bb94a4a082371d6 SHA512 d9f15bbfb4cb8428cacc7669099a0ce8acf33cbf309a65fea601f1d23b6e741a403eb4f8d91a8897f1959862f8d2ca8843918e56f511f2230e88476037511177 WHIRLPOOL 0520a5295a1184754c4d4dafe8253f4c0b6c8d0145ee586f0ecdab2d86630b7d08f8fd8ae87658c5663d3410575838b01d8c1ad2faec74271153c0d7a510e35b
diff --git a/sys-apps/apparmor/apparmor-2.8.3.ebuild b/sys-apps/apparmor/apparmor-2.8.3.ebuild
new file mode 100644
index 000000000000..010c707ae943
--- /dev/null
+++ b/sys-apps/apparmor/apparmor-2.8.3.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs versionator
+
+DESCRIPTION="Userspace utils and init scripts for the AppArmor application security system"
+HOMEPAGE="http://apparmor.net/"
+SRC_URI="http://launchpad.net/${PN}/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc"
+
+DEPEND="dev-lang/perl
+ sys-devel/bison
+ sys-devel/flex
+ doc? ( dev-tex/latex2html )"
+
+S=${WORKDIR}/apparmor-${PV}/parser
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.2-makefile.patch
+
+ # remove warning about missing file that controls features
+ # we don't currently support
+ sed -e "/installation problem/ctrue" -i rc.apparmor.functions || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" arch manpages
+ use doc && emake pdf
+}
+
+src_install() {
+ default
+
+ dodir /etc/apparmor.d
+
+ newinitd "${FILESDIR}"/${PN}-init ${PN}
+
+ use doc && dodoc techdoc.pdf
+}
diff --git a/sys-apps/apparmor/apparmor-2.8.4.ebuild b/sys-apps/apparmor/apparmor-2.8.4.ebuild
new file mode 100644
index 000000000000..613842763c46
--- /dev/null
+++ b/sys-apps/apparmor/apparmor-2.8.4.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils toolchain-funcs versionator
+
+DESCRIPTION="Userspace utils and init scripts for the AppArmor application security system"
+HOMEPAGE="http://apparmor.net/"
+SRC_URI="http://launchpad.net/${PN}/$(get_version_component_range 1-2)/${PV}/+download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc"
+
+DEPEND="dev-lang/perl
+ sys-devel/bison
+ sys-devel/flex
+ doc? ( dev-tex/latex2html )"
+
+S=${WORKDIR}/apparmor-${PV}/parser
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.2-makefile.patch
+
+ # remove warning about missing file that controls features
+ # we don't currently support
+ sed -e "/installation problem/ctrue" -i rc.apparmor.functions || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" arch manpages
+ use doc && emake pdf
+}
+
+src_install() {
+ default
+
+ dodir /etc/apparmor.d/disable
+
+ newinitd "${FILESDIR}"/${PN}-init ${PN}
+
+ use doc && dodoc techdoc.pdf
+}
diff --git a/sys-apps/apparmor/files/apparmor-2.8.2-makefile.patch b/sys-apps/apparmor/files/apparmor-2.8.2-makefile.patch
new file mode 100644
index 000000000000..0888c15d9121
--- /dev/null
+++ b/sys-apps/apparmor/files/apparmor-2.8.2-makefile.patch
@@ -0,0 +1,34 @@
+--- Makefile
++++ Makefile
+@@ -31,7 +31,7 @@
+ CONFDIR=/etc/apparmor
+ INSTALL_CONFDIR=${DESTDIR}${CONFDIR}
+ LOCALEDIR=/usr/share/locale
+-MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 subdomain.conf.5 apparmor.vim.5
++MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8
+
+ YACC := /usr/bin/bison
+ YFLAGS := -d
+@@ -153,7 +153,7 @@
+ ln -s `$(CXX) -print-file-name=libstdc++.a`
+
+ apparmor_parser: $(OBJECTS) $(AAREOBJECTS)
+- $(CXX) $(EXTRA_CFLAGS) -o $@ $(OBJECTS) $(LIBS) \
++ $(CXX) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ $(OBJECTS) $(LIBS) \
+ ${LEXLIB} $(AAREOBJECTS) $(AARE_LDFLAGS)
+
+ parser_yacc.c parser_yacc.h: parser_yacc.y parser.h
+@@ -284,11 +284,9 @@
+ .PHONY: install-indep
+ install-indep:
+ install -m 755 -d $(INSTALL_CONFDIR)
+- install -m 644 subdomain.conf $(INSTALL_CONFDIR)
++ install -m 755 -d ${DESTDIR}/usr/libexec
+ install -m 644 parser.conf $(INSTALL_CONFDIR)
+- install -m 755 -d ${DESTDIR}/var/lib/apparmor
+- install -m 755 -d $(APPARMOR_BIN_PREFIX)
+- install -m 755 rc.apparmor.functions $(APPARMOR_BIN_PREFIX)
++ install -m 755 rc.apparmor.functions ${DESTDIR}/usr/libexec
+ $(MAKE) -C po install NAME=${NAME} DESTDIR=${DESTDIR}
+ $(MAKE) install_manpages DESTDIR=${DESTDIR}
+
diff --git a/sys-apps/apparmor/files/apparmor-init b/sys-apps/apparmor/files/apparmor-init
new file mode 100755
index 000000000000..ffdb6f76cbc6
--- /dev/null
+++ b/sys-apps/apparmor/files/apparmor-init
@@ -0,0 +1,92 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Load all configured profiles for the AppArmor security module."
+description_reload="Reload all profiles"
+
+extra_started_commands="reload"
+
+aa_action() {
+ local arg=$1
+ local return
+
+ shift
+ $*
+ return=$?
+
+ if [ ${return} -eq 0 ]; then
+ aa_log_success_msg $arg
+ else
+ aa_log_failure_msg arg
+ fi
+
+ return $return
+}
+
+aa_log_action_start() {
+ ebegin $1
+}
+
+aa_log_action_end() {
+ eend $1
+}
+
+aa_log_success_msg() {
+ einfo $1
+}
+
+aa_log_warning_msg() {
+ ewarn $1
+}
+
+aa_log_failure_msg() {
+ eerror $1
+}
+
+aa_log_skipped_msg() {
+ einfo $1
+}
+
+aa_log_daemon_msg() {
+ einfo $1
+}
+
+aa_log_end_msg() {
+ eend $1
+}
+
+. /usr/libexec/rc.apparmor.functions
+
+start() {
+ ebegin "Starting AppArmor"
+ eindent
+
+ if ! is_apparmor_loaded ; then
+ load_module
+ if [ $? -ne 0 ]; then
+ eerror "AppArmor kernel support is not present"
+ eend 1
+ return 1
+ fi
+ fi
+
+ parse_profiles load
+
+ eoutdent
+}
+
+stop() {
+ ebegin "Stopping AppArmor"
+ eindent
+ apparmor_stop
+ eoutdent
+}
+
+reload() {
+ # todo: split out clean_profiles into its own function upstream
+ # so we can do parse_profiles reload && clean_profiles
+ # and do a proper reload instead of restart
+ apparmor_restart
+}
diff --git a/sys-apps/apparmor/metadata.xml b/sys-apps/apparmor/metadata.xml
new file mode 100644
index 000000000000..f60a2bbf973d
--- /dev/null
+++ b/sys-apps/apparmor/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>hardened</herd>
+ <maintainer>
+ <email>kensington@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">apparmor</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/apply-default-acl/Manifest b/sys-apps/apply-default-acl/Manifest
new file mode 100644
index 000000000000..cc3ed7ab650b
--- /dev/null
+++ b/sys-apps/apply-default-acl/Manifest
@@ -0,0 +1 @@
+DIST apply-default-acl-0.0.4.tar.gz 99201 SHA256 a9c9a91198f8294aa6ec9c2e43e3bdb6c75e07961306a29a9b13d453d3079680 SHA512 0935ba7608314d55b223803e9b118fc8e785bc92d8235077a1e7534309184934e2558dbc9e39ba45224018cdf1bd7148c471f3ff3b71aab6c1449c377fac3b5d WHIRLPOOL 76718fd814a9e8fd0dd6ead9373babc39b36d1da22cd55b0b20ff3d83489f0bd355964bfe6ffbcf6f3961f318cc462ca658c0660cdedec3f3c201820249f5fd3
diff --git a/sys-apps/apply-default-acl/apply-default-acl-0.0.4.ebuild b/sys-apps/apply-default-acl/apply-default-acl-0.0.4.ebuild
new file mode 100644
index 000000000000..2663e98ece83
--- /dev/null
+++ b/sys-apps/apply-default-acl/apply-default-acl-0.0.4.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Apply default POSIX ACLs to files and directories"
+HOMEPAGE="http://michael.orlitzky.com/code/apply-default-acl.php"
+SRC_URI="http://michael.orlitzky.com/code/releases/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+DEPEND="sys-apps/acl"
+RDEPEND="${DEPEND}"
+
+DOCS=( doc/README )
+
+# tests need to be executed on filesystem with ACL support
+# skipping them for now
+RESTRICT="test"
diff --git a/sys-apps/apply-default-acl/metadata.xml b/sys-apps/apply-default-acl/metadata.xml
new file mode 100644
index 000000000000..d5e2ea387b89
--- /dev/null
+++ b/sys-apps/apply-default-acl/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>mjo@gentoo.org</email>
+ <name>Michael Orlitzky</name>
+ </maintainer>
+
+ <upstream>
+ <maintainer status="active">
+ <email>michael@orlitzky.com</email>
+ <name>Michael Orlitzky</name>
+ </maintainer>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/arrayprobe/Manifest b/sys-apps/arrayprobe/Manifest
new file mode 100644
index 000000000000..f5eec1d05631
--- /dev/null
+++ b/sys-apps/arrayprobe/Manifest
@@ -0,0 +1 @@
+DIST arrayprobe-2.0.tar.gz 83831 SHA256 ccb560b5c7e8b378d110cad6e9245884e7e673acfa3c4016ef33acd699f1f4d0 SHA512 4664e20604697edf2f848447419b26ff860dd302b3d3e5aa0f3977855c590b5acbe23c39b684a2ecb1603c86cf7762e86bfc7125421ccad7f322e387c4178870 WHIRLPOOL 56eec2322f806f25e411614e12e9c584208202203f6d070846c73d04c0b379103ad2c45d3a6638a8cf6d66ea51173fbf0dcd91af3b01702a39848bb8a503cd34
diff --git a/sys-apps/arrayprobe/arrayprobe-2.0-r2.ebuild b/sys-apps/arrayprobe/arrayprobe-2.0-r2.ebuild
new file mode 100644
index 000000000000..b9af20e37ab4
--- /dev/null
+++ b/sys-apps/arrayprobe/arrayprobe-2.0-r2.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils autotools
+
+DESCRIPTION="CLI utility that reports the status of a HP (Compaq) array controller (both IDA & CCISS supported)"
+HOMEPAGE="http://www.strocamp.net/opensource/arrayprobe.php"
+SRC_URI="http://www.strocamp.net/opensource/compaq/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ia64 x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV}-malloc-strlen.patch"
+ epatch "${FILESDIR}/${PV}-ida_headers.patch"
+ eautoreconf
+}
diff --git a/sys-apps/arrayprobe/files/2.0-ida_headers.patch b/sys-apps/arrayprobe/files/2.0-ida_headers.patch
new file mode 100644
index 000000000000..fbdb20b87ea6
--- /dev/null
+++ b/sys-apps/arrayprobe/files/2.0-ida_headers.patch
@@ -0,0 +1,647 @@
+diff -Naur arrayprobe-2.0.old/cciss_events.h arrayprobe-2.0/cciss_events.h
+--- arrayprobe-2.0.old/cciss_events.h 2005-12-27 10:51:29.000000000 +0100
++++ arrayprobe-2.0/cciss_events.h 2010-01-13 15:46:53.000000000 +0100
+@@ -27,8 +27,12 @@
+ #define QWORD __u64
+
+ /* from cciss_cmd.h */
++#ifndef CISS_MAX_LUN
+ #define CISS_MAX_LUN 16
++#endif
++#ifndef CISS_MAX_PHYS_LUN
+ #define CISS_MAX_PHYS_LUN 1024
++#endif
+
+ #define CompareEvent(event,par_class,par_subclass,par_detail) \
+ ((event.class.class==par_class) && \
+diff -Naur arrayprobe-2.0.old/configure.ac arrayprobe-2.0/configure.ac
+--- arrayprobe-2.0.old/configure.ac 2006-01-03 13:58:31.000000000 +0100
++++ arrayprobe-2.0/configure.ac 2010-01-13 15:42:49.000000000 +0100
+@@ -19,38 +19,6 @@
+ dnl Check for compile.h (2.6.x kernels only?
+ AC_CHECK_HEADERS(linux/compiler.h)
+
+-dnl Check for kernel sources
+-AC_MSG_CHECKING(for kernel sources)
+-found_kernel_dir=""
+-for kernel_dir in /usr/src/linux /usr/src/linux-2.4
+-do
+- if test -d $kernel_dir/drivers/block ; then
+- CFLAGS="$CFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
+- CPPFLAGS="$CPPFLAGS -I$kernel_dir/include -I$kernel_dir/drivers/block"
+- found_kernel_dir="$kernel_dir"
+- fi
+-done
+-
+-if test "$found_kernel_dir" != "" ; then
+- AC_MSG_RESULT(found $found_kernel_dir )
+-else
+- AC_MSG_ERROR(Kernel sources not found)
+-fi
+-
+-dnl Check Headers
+-AC_CHECK_HEADERS(ida_ioctl.h ida_cmd.h cpqarray.h,,
+- AC_MSG_ERROR(You need to have the complete kernel sources.),[[#include <linux/compiler.h>
+- #include <unistd.h>]])
+-
+-dnl Check version of SmartArray driver
+-AC_MSG_CHECKING(SmartArray driver version)
+-AC_EGREP_HEADER(blk_cnt, ida_ioctl.h,AC_MSG_RESULT(ok),
+- AC_MSG_ERROR(You need to have the SmartArray driver version 1.0.1 or higher installed.))
+-
+-dnl Check for CCISS header file
+-AC_CHECK_HEADERS(linux/cciss_ioctl.h,,
+- AC_MSG_ERROR(You need to have the CCISS driver in the kernel.),[[#include <linux/compiler.h>]])
+-
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+
+diff -Naur arrayprobe-2.0.old/cpqarray.h arrayprobe-2.0/cpqarray.h
+--- arrayprobe-2.0.old/cpqarray.h 1970-01-01 01:00:00.000000000 +0100
++++ arrayprobe-2.0/cpqarray.h 2010-01-13 15:40:11.000000000 +0100
+@@ -0,0 +1,126 @@
++/*
++ * Disk Array driver for Compaq SMART2 Controllers
++ * Copyright 1998 Compaq Computer Corporation
++ *
++ * 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, GOOD TITLE or
++ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ * Questions/Comments/Bugfixes to iss_storagedev@hp.com
++ *
++ * If you want to make changes, improve or add functionality to this
++ * driver, you'll probably need the Compaq Array Controller Interface
++ * Specificiation (Document number ECG086/1198)
++ */
++#ifndef CPQARRAY_H
++#define CPQARRAY_H
++
++#ifdef __KERNEL__
++#include <linux/blkdev.h>
++#include <linux/slab.h>
++#include <linux/proc_fs.h>
++#include <linux/timer.h>
++#endif
++
++#include "ida_cmd.h"
++
++#define IO_OK 0
++#define IO_ERROR 1
++#define NWD 16
++#define NWD_SHIFT 4
++
++#define IDA_TIMER (5*HZ)
++#define IDA_TIMEOUT (10*HZ)
++
++#define MISC_NONFATAL_WARN 0x01
++
++typedef struct {
++ unsigned blk_size;
++ unsigned nr_blks;
++ unsigned cylinders;
++ unsigned heads;
++ unsigned sectors;
++ int usage_count;
++} drv_info_t;
++
++#ifdef __KERNEL__
++
++struct ctlr_info;
++typedef struct ctlr_info ctlr_info_t;
++
++struct access_method {
++ void (*submit_command)(ctlr_info_t *h, cmdlist_t *c);
++ void (*set_intr_mask)(ctlr_info_t *h, unsigned long val);
++ unsigned long (*fifo_full)(ctlr_info_t *h);
++ unsigned long (*intr_pending)(ctlr_info_t *h);
++ unsigned long (*command_completed)(ctlr_info_t *h);
++};
++
++struct board_type {
++ __u32 board_id;
++ char *product_name;
++ struct access_method *access;
++};
++
++struct ctlr_info {
++ int ctlr;
++ char devname[8];
++ __u32 log_drv_map;
++ __u32 drv_assign_map;
++ __u32 drv_spare_map;
++ __u32 mp_failed_drv_map;
++
++ char firm_rev[4];
++ int ctlr_sig;
++
++ int log_drives;
++ int phys_drives;
++
++ struct pci_dev *pci_dev; /* NULL if EISA */
++ __u32 board_id;
++ char *product_name;
++
++ void __iomem *vaddr;
++ unsigned long paddr;
++ unsigned long io_mem_addr;
++ unsigned long io_mem_length;
++ int intr;
++ int usage_count;
++ drv_info_t drv[NWD];
++ struct proc_dir_entry *proc;
++
++ struct access_method access;
++
++ cmdlist_t *reqQ;
++ cmdlist_t *cmpQ;
++ cmdlist_t *cmd_pool;
++ dma_addr_t cmd_pool_dhandle;
++ unsigned long *cmd_pool_bits;
++ struct request_queue *queue;
++ spinlock_t lock;
++
++ unsigned int Qdepth;
++ unsigned int maxQsinceinit;
++
++ unsigned int nr_requests;
++ unsigned int nr_allocs;
++ unsigned int nr_frees;
++ struct timer_list timer;
++ unsigned int misc_tflags;
++};
++
++#define IDA_LOCK(i) (&hba[i]->lock)
++
++#endif
++
++#endif /* CPQARRAY_H */
+diff -Naur arrayprobe-2.0.old/ida_cmd.h arrayprobe-2.0/ida_cmd.h
+--- arrayprobe-2.0.old/ida_cmd.h 1970-01-01 01:00:00.000000000 +0100
++++ arrayprobe-2.0/ida_cmd.h 2010-01-13 15:40:29.000000000 +0100
+@@ -0,0 +1,349 @@
++/*
++ * Disk Array driver for Compaq SMART2 Controllers
++ * Copyright 1998 Compaq Computer Corporation
++ *
++ * 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, GOOD TITLE or
++ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ * Questions/Comments/Bugfixes to iss_storagedev@hp.com
++ *
++ */
++#ifndef ARRAYCMD_H
++#define ARRAYCMD_H
++
++/*#include <asm/types.h>*/
++#if 0
++#include <linux/blkdev.h>
++#endif
++
++/* for the Smart Array 42XX cards */
++#define S42XX_REQUEST_PORT_OFFSET 0x40
++#define S42XX_REPLY_INTR_MASK_OFFSET 0x34
++#define S42XX_REPLY_PORT_OFFSET 0x44
++#define S42XX_INTR_STATUS 0x30
++
++#define S42XX_INTR_OFF 0x08
++#define S42XX_INTR_PENDING 0x08
++
++#define COMMAND_FIFO 0x04
++#define COMMAND_COMPLETE_FIFO 0x08
++#define INTR_MASK 0x0C
++#define INTR_STATUS 0x10
++#define INTR_PENDING 0x14
++
++#define FIFO_NOT_EMPTY 0x01
++#define FIFO_NOT_FULL 0x02
++
++#define BIG_PROBLEM 0x40
++#define LOG_NOT_CONF 2
++
++#pragma pack(1)
++typedef struct {
++ __u32 size;
++ __u32 addr;
++} sg_t;
++
++#define RCODE_NONFATAL 0x02
++#define RCODE_FATAL 0x04
++#define RCODE_INVREQ 0x10
++typedef struct {
++ __u16 next;
++ __u8 cmd;
++ __u8 rcode;
++ __u32 blk;
++ __u16 blk_cnt;
++ __u8 sg_cnt;
++ __u8 reserved;
++} rhdr_t;
++
++#define SG_MAX 32
++typedef struct {
++ rhdr_t hdr;
++ sg_t sg[SG_MAX];
++ __u32 bp;
++} rblk_t;
++
++typedef struct {
++ __u8 unit;
++ __u8 prio;
++ __u16 size;
++} chdr_t;
++
++#define CMD_RWREQ 0x00
++#define CMD_IOCTL_PEND 0x01
++#define CMD_IOCTL_DONE 0x02
++
++typedef struct cmdlist {
++ chdr_t hdr;
++ rblk_t req;
++ __u32 size;
++ int retry_cnt;
++ __u32 busaddr;
++ int ctlr;
++ struct cmdlist *prev;
++ struct cmdlist *next;
++ struct request *rq;
++ int type;
++} cmdlist_t;
++
++#define ID_CTLR 0x11
++typedef struct {
++ __u8 nr_drvs;
++ __u32 cfg_sig;
++ __u8 firm_rev[4];
++ __u8 rom_rev[4];
++ __u8 hw_rev;
++ __u32 bb_rev;
++ __u32 drv_present_map;
++ __u32 ext_drv_map;
++ __u32 board_id;
++ __u8 cfg_error;
++ __u32 non_disk_bits;
++ __u8 bad_ram_addr;
++ __u8 cpu_rev;
++ __u8 pdpi_rev;
++ __u8 epic_rev;
++ __u8 wcxc_rev;
++ __u8 marketing_rev;
++ __u8 ctlr_flags;
++ __u8 host_flags;
++ __u8 expand_dis;
++ __u8 scsi_chips;
++ __u32 max_req_blocks;
++ __u32 ctlr_clock;
++ __u8 drvs_per_bus;
++ __u16 big_drv_present_map[8];
++ __u16 big_ext_drv_map[8];
++ __u16 big_non_disk_map[8];
++ __u16 task_flags;
++ __u8 icl_bus;
++ __u8 red_modes;
++ __u8 cur_red_mode;
++ __u8 red_ctlr_stat;
++ __u8 red_fail_reason;
++ __u8 reserved[403];
++} id_ctlr_t;
++
++typedef struct {
++ __u16 cyl;
++ __u8 heads;
++ __u8 xsig;
++ __u8 psectors;
++ __u16 wpre;
++ __u8 maxecc;
++ __u8 drv_ctrl;
++ __u16 pcyls;
++ __u8 pheads;
++ __u16 landz;
++ __u8 sect_per_track;
++ __u8 cksum;
++} drv_param_t;
++
++#define ID_LOG_DRV 0x10
++typedef struct {
++ __u16 blk_size;
++ __u32 nr_blks;
++ drv_param_t drv;
++ __u8 fault_tol;
++ __u8 reserved;
++ __u8 bios_disable;
++} id_log_drv_t;
++
++#define ID_LOG_DRV_EXT 0x18
++typedef struct {
++ __u32 log_drv_id;
++ __u8 log_drv_label[64];
++ __u8 reserved[418];
++} id_log_drv_ext_t;
++
++#define SENSE_LOG_DRV_STAT 0x12
++typedef struct {
++ __u8 status;
++ __u32 fail_map;
++ __u16 read_err[32];
++ __u16 write_err[32];
++ __u8 drv_err_data[256];
++ __u8 drq_timeout[32];
++ __u32 blks_to_recover;
++ __u8 drv_recovering;
++ __u16 remap_cnt[32];
++ __u32 replace_drv_map;
++ __u32 act_spare_map;
++ __u8 spare_stat;
++ __u8 spare_repl_map[32];
++ __u32 repl_ok_map;
++ __u8 media_exch;
++ __u8 cache_fail;
++ __u8 expn_fail;
++ __u8 unit_flags;
++ __u16 big_fail_map[8];
++ __u16 big_remap_map[128];
++ __u16 big_repl_map[8];
++ __u16 big_act_spare_map[8];
++ __u8 big_spar_repl_map[128];
++ __u16 big_repl_ok_map[8];
++ __u8 big_drv_rebuild;
++ __u8 reserved[36];
++} sense_log_drv_stat_t;
++
++#define START_RECOVER 0x13
++
++#define ID_PHYS_DRV 0x15
++typedef struct {
++ __u8 scsi_bus;
++ __u8 scsi_id;
++ __u16 blk_size;
++ __u32 nr_blks;
++ __u32 rsvd_blks;
++ __u8 drv_model[40];
++ __u8 drv_sn[40];
++ __u8 drv_fw[8];
++ __u8 scsi_iq_bits;
++ __u8 compaq_drv_stmp;
++ __u8 last_fail;
++ __u8 phys_drv_flags;
++ __u8 phys_drv_flags1;
++ __u8 scsi_lun;
++ __u8 phys_drv_flags2;
++ __u8 reserved;
++ __u32 spi_speed_rules;
++ __u8 phys_connector[2];
++ __u8 phys_box_on_bus;
++ __u8 phys_bay_in_box;
++} id_phys_drv_t;
++
++#define BLINK_DRV_LEDS 0x16
++typedef struct {
++ __u32 blink_duration;
++ __u32 reserved;
++ __u8 blink[256];
++ __u8 reserved1[248];
++} blink_drv_leds_t;
++
++#define SENSE_BLINK_LEDS 0x17
++typedef struct {
++ __u32 blink_duration;
++ __u32 btime_elap;
++ __u8 blink[256];
++ __u8 reserved1[248];
++} sense_blink_leds_t;
++
++#define IDA_READ 0x20
++#define IDA_WRITE 0x30
++#define IDA_WRITE_MEDIA 0x31
++#define RESET_TO_DIAG 0x40
++#define DIAG_PASS_THRU 0x41
++
++#define SENSE_CONFIG 0x50
++#define SET_CONFIG 0x51
++typedef struct {
++ __u32 cfg_sig;
++ __u16 compat_port;
++ __u8 data_dist_mode;
++ __u8 surf_an_ctrl;
++ __u16 ctlr_phys_drv;
++ __u16 log_unit_phys_drv;
++ __u16 fault_tol_mode;
++ __u8 phys_drv_param[16];
++ drv_param_t drv;
++ __u32 drv_asgn_map;
++ __u16 dist_factor;
++ __u32 spare_asgn_map;
++ __u8 reserved[6];
++ __u16 os;
++ __u8 ctlr_order;
++ __u8 extra_info;
++ __u32 data_offs;
++ __u8 parity_backedout_write_drvs;
++ __u8 parity_dist_mode;
++ __u8 parity_shift_fact;
++ __u8 bios_disable_flag;
++ __u32 blks_on_vol;
++ __u32 blks_per_drv;
++ __u8 scratch[16];
++ __u16 big_drv_map[8];
++ __u16 big_spare_map[8];
++ __u8 ss_source_vol;
++ __u8 mix_drv_cap_range;
++ struct {
++ __u16 big_drv_map[8];
++ __u32 blks_per_drv;
++ __u16 fault_tol_mode;
++ __u16 dist_factor;
++ } MDC_range[4];
++ __u8 reserved1[248];
++} config_t;
++
++#define BYPASS_VOL_STATE 0x52
++#define SS_CREATE_VOL 0x53
++#define CHANGE_CONFIG 0x54
++#define SENSE_ORIG_CONF 0x55
++#define REORDER_LOG_DRV 0x56
++typedef struct {
++ __u8 old_units[32];
++} reorder_log_drv_t;
++
++#define LABEL_LOG_DRV 0x57
++typedef struct {
++ __u8 log_drv_label[64];
++} label_log_drv_t;
++
++#define SS_TO_VOL 0x58
++
++#define SET_SURF_DELAY 0x60
++typedef struct {
++ __u16 delay;
++ __u8 reserved[510];
++} surf_delay_t;
++
++#define SET_OVERHEAT_DELAY 0x61
++typedef struct {
++ __u16 delay;
++} overhead_delay_t;
++
++#define SET_MP_DELAY
++typedef struct {
++ __u16 delay;
++ __u8 reserved[510];
++} mp_delay_t;
++
++#define PASSTHRU_A 0x91
++typedef struct {
++ __u8 target;
++ __u8 bus;
++ __u8 lun;
++ __u32 timeout;
++ __u32 flags;
++ __u8 status;
++ __u8 error;
++ __u8 cdb_len;
++ __u8 sense_error;
++ __u8 sense_key;
++ __u32 sense_info;
++ __u8 sense_code;
++ __u8 sense_qual;
++ __u32 residual;
++ __u8 reserved[4];
++ __u8 cdb[12];
++} scsi_param_t;
++
++#define RESUME_BACKGROUND_ACTIVITY 0x99
++#define SENSE_CONTROLLER_PERFORMANCE 0xa8
++#define FLUSH_CACHE 0xc2
++#define COLLECT_BUFFER 0xd2
++#define READ_FLASH_ROM 0xf6
++#define WRITE_FLASH_ROM 0xf7
++#pragma pack()
++
++#endif /* ARRAYCMD_H */
+diff -Naur arrayprobe-2.0.old/ida_ioctl.h arrayprobe-2.0/ida_ioctl.h
+--- arrayprobe-2.0.old/ida_ioctl.h 1970-01-01 01:00:00.000000000 +0100
++++ arrayprobe-2.0/ida_ioctl.h 2010-01-13 15:44:46.000000000 +0100
+@@ -0,0 +1,87 @@
++/*
++ * Disk Array driver for Compaq SMART2 Controllers
++ * Copyright 1998 Compaq Computer Corporation
++ *
++ * 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, GOOD TITLE or
++ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ * Questions/Comments/Bugfixes to iss_storagedev@hp.com
++ *
++ */
++#ifndef IDA_IOCTL_H
++#define IDA_IOCTL_H
++
++#include "ida_cmd.h"
++#include "cpqarray.h"
++
++#define IDAGETDRVINFO 0x27272828
++#define IDAPASSTHRU 0x28282929
++#define IDAGETCTLRSIG 0x29293030
++#define IDAREVALIDATEVOLS 0x30303131
++#define IDADRIVERVERSION 0x31313232
++#define IDAGETPCIINFO 0x32323333
++
++typedef struct _ida_pci_info_struct
++{
++ unsigned char bus;
++ unsigned char dev_fn;
++ __u32 board_id;
++} ida_pci_info_struct;
++/*
++ * Normally, the ioctl determines the logical unit for this command by
++ * the major,minor number of the fd passed to ioctl. If you need to send
++ * a command to a different/nonexistant unit (such as during config), you
++ * can override the normal behavior by setting the unit valid bit. (Normally,
++ * it should be zero) The controller the command is sent to is still
++ * determined by the major number of the open device.
++ */
++
++#define UNITVALID 0x80
++typedef struct {
++ __u8 cmd;
++ __u8 rcode;
++ __u8 unit;
++ __u32 blk;
++ __u16 blk_cnt;
++
++/* currently, sg_cnt is assumed to be 1: only the 0th element of sg is used */
++ struct {
++ void *addr;
++ size_t size;
++ } sg[SG_MAX];
++ int sg_cnt;
++
++ union ctlr_cmds {
++ drv_info_t drv;
++ unsigned char buf[1024];
++
++ id_ctlr_t id_ctlr;
++ drv_param_t drv_param;
++ id_log_drv_t id_log_drv;
++ id_log_drv_ext_t id_log_drv_ext;
++ sense_log_drv_stat_t sense_log_drv_stat;
++ id_phys_drv_t id_phys_drv;
++ blink_drv_leds_t blink_drv_leds;
++ sense_blink_leds_t sense_blink_leds;
++ config_t config;
++ reorder_log_drv_t reorder_log_drv;
++ label_log_drv_t label_log_drv;
++ surf_delay_t surf_delay;
++ overhead_delay_t overhead_delay;
++ mp_delay_t mp_delay;
++ scsi_param_t scsi_param;
++ } c;
++} ida_ioctl_t;
++
++#endif /* IDA_IOCTL_H */
+diff -Naur arrayprobe-2.0.old/probe.c arrayprobe-2.0/probe.c
+--- arrayprobe-2.0.old/probe.c 2006-01-03 14:11:17.000000000 +0100
++++ arrayprobe-2.0/probe.c 2010-01-13 15:45:22.000000000 +0100
+@@ -33,10 +33,9 @@
+ #include <getopt.h>
+ #include <errno.h>
+
+-#include <linux/compiler.h>
+ #include <linux/cciss_ioctl.h>
+
+-#include <ida_ioctl.h>
++#include "ida_ioctl.h"
+
+ #include "cciss_events.h"
+
diff --git a/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch b/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch
new file mode 100644
index 000000000000..8d955a8f933d
--- /dev/null
+++ b/sys-apps/arrayprobe/files/2.0-malloc-strlen.patch
@@ -0,0 +1,20 @@
+--- probe.c.old 2010-01-13 12:15:32.000000000 +0100
++++ probe.c 2010-01-13 12:16:44.000000000 +0100
+@@ -354,7 +354,7 @@
+ int drivenum = event.detail.logstatchange.logicaldrivenumber;
+ logdrvs[drivenum].state.state = event.detail.logstatchange.newlogicaldrivestate;
+ logdrvs[drivenum].state.severity = logicaldrivestatusseverity[event.detail.logstatchange.newlogicaldrivestate];
+- logdrvs[drivenum].state.message = (char *)malloc(strlen(logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate] + 1));
++ logdrvs[drivenum].state.message = (char *)malloc(strlen(logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate]) + 1);
+ strcpy (logdrvs[drivenum].state.message, logicaldrivestatusstr[event.detail.logstatchange.newlogicaldrivestate]);
+ }
+ if (verbose) {
+@@ -479,7 +479,7 @@
+ int ida_device = 0; /* only for use with -f , used to determine protocol to use */
+ int max_logical = 64; /* hardcoded */
+ int cur_logical = 0; /* number of drives detected */
+- logdrv *logdrvs = (logdrv *)malloc(sizeof(logdrv)*max_logical);
++ logdrv *logdrvs;
+ int worst_disk;
+ int worst_sev = SEV_NORMAL;
+ int cntr;
diff --git a/sys-apps/arrayprobe/metadata.xml b/sys-apps/arrayprobe/metadata.xml
new file mode 100644
index 000000000000..d5dc80d32a78
--- /dev/null
+++ b/sys-apps/arrayprobe/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>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/attr/Manifest b/sys-apps/attr/Manifest
new file mode 100644
index 000000000000..88c14e595f6b
--- /dev/null
+++ b/sys-apps/attr/Manifest
@@ -0,0 +1,2 @@
+DIST attr-2.4.46.src.tar.gz 338181 SHA256 dcd69bdca7ff166bc45141eddbcf21967999a6b66b0544be12a1cc2fd6340e1f SHA512 f1b8e6e4d1aa9f5c1b51d5d08684c9fdfa4b7d22efc1a77c13e4d5f0ae8e053bbb3d49a1c1e3c4143f63c9752ed534a2d009e0ab49cea880032620edbe8fdbb5 WHIRLPOOL 300f3be50a015f2d6d44a4707c31a312015c308899acdf146dfbbdb373336f5de7696f4832dba9543abd9cdfceccd84ef602d672fb88a125210e2622a13cf8fa
+DIST attr-2.4.47.src.tar.gz 343692 SHA256 25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859 SHA512 2a333f63655758298650cf8f89c175efdc0112dcc4013e8d023e2a9a69f177e4bcb1f1d10b6666d6f2027dca4dec0833d54749952ab153d28367e1a72e6e2831 WHIRLPOOL a012f7a0225e63d4d195fae7027e64c0c92edb039622bfdec611b2facbcde83eb5fc921ecfe95c50f54f7c9b518f57a0555dcedc148cc8ff6e73371668a40557
diff --git a/sys-apps/attr/attr-2.4.46-r2.ebuild b/sys-apps/attr/attr-2.4.46-r2.ebuild
new file mode 100644
index 000000000000..5d19e57e8f73
--- /dev/null
+++ b/sys-apps/attr/attr-2.4.46-r2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Extended attributes tools"
+HOMEPAGE="http://savannah.nongnu.org/projects/attr"
+SRC_URI="mirror://nongnu/${PN}/${P}.src.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="nls static-libs"
+
+DEPEND="nls? ( sys-devel/gettext )
+ sys-devel/autoconf"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.4.44-gettext.patch
+ epatch "${FILESDIR}"/${PN}-2.4.46-config-shell.patch #366671
+ epatch "${FILESDIR}"/${PN}-2.4.46-generic-syscalls.patch #460702
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die "failed to update builddefs"
+ strip-linguas -u po
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+src_install() {
+ emake DIST_ROOT="${D}" install install-lib install-dev || die
+ use static-libs || find "${D}" -name '*.la' -delete
+ # the man-pages packages provides the man2 files
+ rm -r "${ED}"/usr/share/man/man2
+
+ # we install attr into /bin, so we need the shared lib with it
+ gen_usr_ldscript -a attr
+}
diff --git a/sys-apps/attr/attr-2.4.47-r1.ebuild b/sys-apps/attr/attr-2.4.47-r1.ebuild
new file mode 100644
index 000000000000..f0db984ba8ec
--- /dev/null
+++ b/sys-apps/attr/attr-2.4.47-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+DESCRIPTION="Extended attributes tools"
+HOMEPAGE="http://savannah.nongnu.org/projects/attr"
+SRC_URI="mirror://nongnu/${PN}/${P}.src.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="nls static-libs"
+
+DEPEND="nls? ( sys-devel/gettext )
+ sys-devel/autoconf"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die
+ strip-linguas -u po
+ multilib_copy_sources # https://savannah.nongnu.org/bugs/index.php?39736
+}
+
+multilib_src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+multilib_src_compile() {
+ emake $(multilib_is_native_abi || echo TOOL_SUBDIRS=)
+}
+
+multilib_src_install() {
+ emake \
+ $(multilib_is_native_abi || echo TOOL_SUBDIRS=) \
+ DIST_ROOT="${D}" \
+ install install-lib install-dev
+
+ if multilib_is_native_abi; then
+ # we install attr into /bin, so we need the shared lib with it
+ gen_usr_ldscript -a attr
+ # the man-pages packages provides the man2 files
+ # note: man-pages are installed by TOOL_SUBDIRS
+ rm -r "${ED}"/usr/share/man/man2 || die
+ fi
+}
+
+multilib_src_install_all() {
+ use static-libs || prune_libtool_files --all
+ einstalldocs
+}
diff --git a/sys-apps/attr/attr-2.4.47-r2.ebuild b/sys-apps/attr/attr-2.4.47-r2.ebuild
new file mode 100644
index 000000000000..91ab80d8340d
--- /dev/null
+++ b/sys-apps/attr/attr-2.4.47-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib-minimal
+
+DESCRIPTION="Extended attributes tools"
+HOMEPAGE="http://savannah.nongnu.org/projects/attr"
+SRC_URI="mirror://nongnu/${PN}/${P}.src.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh ~sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="nls static-libs"
+
+DEPEND="nls? ( sys-devel/gettext )
+ sys-devel/autoconf"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
+ include/builddefs.in \
+ || die
+ strip-linguas -u po
+ multilib_copy_sources # https://savannah.nongnu.org/bugs/index.php?39736
+}
+
+multilib_src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ $(use_enable nls gettext) \
+ --enable-shared $(use_enable static-libs static) \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
+ --bindir="${EPREFIX}"/bin
+}
+
+multilib_src_compile() {
+ emake $(multilib_is_native_abi || echo TOOL_SUBDIRS=)
+}
+
+multilib_src_install() {
+ emake \
+ $(multilib_is_native_abi || echo TOOL_SUBDIRS=) \
+ DIST_ROOT="${D}" \
+ install install-lib install-dev
+
+ if multilib_is_native_abi; then
+ # we install attr into /bin, so we need the shared lib with it
+ gen_usr_ldscript -a attr
+ # the man-pages packages provides the man2 files
+ # note: man-pages are installed by TOOL_SUBDIRS
+ rm -r "${ED}"/usr/share/man/man2 "${ED}"/usr/share/man/man5/attr.5 || die
+ fi
+}
+
+multilib_src_install_all() {
+ use static-libs || prune_libtool_files --all
+ einstalldocs
+}
diff --git a/sys-apps/attr/files/attr-2.4.44-gettext.patch b/sys-apps/attr/files/attr-2.4.44-gettext.patch
new file mode 100644
index 000000000000..49c2d32bdce4
--- /dev/null
+++ b/sys-apps/attr/files/attr-2.4.44-gettext.patch
@@ -0,0 +1,63 @@
+--- include/gettext.h
++++ include/gettext.h
+@@ -0,0 +1,10 @@
++#include <config.h>
++#ifdef ENABLE_GETTEXT
++# include <libintl.h>
++# define _(x) gettext(x)
++#else
++# define _(x) (x)
++# define textdomain(d) do { } while (0)
++# define bindtextdomain(d,dir) do { } while (0)
++#endif
++#include <locale.h>
+--- attr/attr.c
++++ attr/attr.c
+@@ -26,6 +26,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <locale.h>
++#include "gettext.h"
+
+ #include <attr/attributes.h>
+ #include "config.h"
+--- libattr/attr_copy_file.c.orig 2007-09-20 02:51:37.000000000 -0400
++++ libattr/attr_copy_file.c 2007-09-20 02:51:51.000000000 -0400
+@@ -19,6 +19,7 @@
+
+ #if defined (HAVE_CONFIG_H)
+ #include "config.h"
++#include "gettext.h"
+ #endif
+
+ #include <sys/types.h>
+--- libattr/attr_copy_fd.c.orig 2007-09-20 02:52:23.000000000 -0400
++++ libattr/attr_copy_fd.c 2007-09-20 02:52:31.000000000 -0400
+@@ -19,6 +19,7 @@
+
+ #if defined (HAVE_CONFIG_H)
+ #include "config.h"
++#include "gettext.h"
+ #endif
+
+ #include <sys/types.h>
+--- getfattr/getfattr.c.orig 2007-09-20 02:52:49.000000000 -0400
++++ getfattr/getfattr.c 2007-09-20 02:52:59.000000000 -0400
+@@ -30,6 +30,7 @@
+ #include <regex.h>
+ #include <ftw.h>
+ #include <locale.h>
++#include "gettext.h"
+
+ #include <attr/xattr.h>
+ #include "config.h"
+--- setfattr/setfattr.c.orig 2007-09-20 02:53:12.000000000 -0400
++++ setfattr/setfattr.c 2007-09-20 02:53:20.000000000 -0400
+@@ -28,6 +28,7 @@
+ #include <getopt.h>
+ #include <locale.h>
+ #include <ctype.h>
++#include "gettext.h"
+
+ #include <attr/xattr.h>
+ #include "config.h"
diff --git a/sys-apps/attr/files/attr-2.4.46-config-shell.patch b/sys-apps/attr/files/attr-2.4.46-config-shell.patch
new file mode 100644
index 000000000000..b6660e63c03c
--- /dev/null
+++ b/sys-apps/attr/files/attr-2.4.46-config-shell.patch
@@ -0,0 +1,53 @@
+https://bugs.gentoo.org/366671
+
+From 10bfb16245ec4b55c1f5b6dc5554913bc9b13c9c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 16 May 2011 01:59:52 -0400
+Subject: [PATCH] use SHELL from configure
+
+If /bin/sh is not a functional enough shell, configure will select a
+SHELL of /bin/bash or better. But the current build helpers always
+hardcode /bin/sh, so if libtool itself configures itself for /bin/bash,
+things will fail when it attempts to do:
+ SHELL = /bin/sh
+ LIBTOOL = $(SHELL) .../libtool
+ ...
+ eval: 1: base_compile+= -pipe: not found
+ ...
+
+So rather than hardcoding SHELL to /bin/sh, set it to @SHELL@ and let
+configure find a good value for us.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ include/builddefs.in | 1 +
+ include/buildmacros | 1 -
+ 2 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/include/builddefs.in b/include/builddefs.in
+index d054a56..434ce95 100644
+--- a/include/builddefs.in
++++ b/include/builddefs.in
+@@ -46,6 +46,7 @@ MAKE = @make@
+ ECHO = @echo@
+ SORT = @sort@
+ LN_S = @LN_S@
++SHELL = @SHELL@
+ LIBTOOL = @LIBTOOL@
+ MAKEDEPEND = @makedepend@
+
+diff --git a/include/buildmacros b/include/buildmacros
+index ab89182..8efb32e 100644
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -42,7 +42,6 @@ OBJECTS = $(ASFILES:.s=.o) \
+
+ INSTALL = $(TOPDIR)/include/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
+
+-SHELL = /bin/sh
+ IMAGES_DIR = $(TOPDIR)/all-images
+ DIST_DIR = $(TOPDIR)/dist
+
+--
+1.7.5.rc3
+
diff --git a/sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch b/sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch
new file mode 100644
index 000000000000..d12fcd29afd1
--- /dev/null
+++ b/sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch
@@ -0,0 +1,180 @@
+http://lists.nongnu.org/archive/html/acl-devel/2012-12/msg00000.html
+https://bugs.gentoo.org/460702
+
+--- a/libattr/syscalls.c
++++ b/libattr/syscalls.c
+@@ -23,172 +23,10 @@
+
+ #include <errno.h>
+ #include <unistd.h>
++#include <sys/syscall.h>
+
+-#if defined (__i386__)
++#if defined (__NR_setxattr)
+ # define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 226
+-# define __NR_lsetxattr 227
+-# define __NR_fsetxattr 228
+-# define __NR_getxattr 229
+-# define __NR_lgetxattr 230
+-# define __NR_fgetxattr 231
+-# define __NR_listxattr 232
+-# define __NR_llistxattr 233
+-# define __NR_flistxattr 234
+-# define __NR_removexattr 235
+-# define __NR_lremovexattr 236
+-# define __NR_fremovexattr 237
+-#elif defined (__sparc__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 169
+-# define __NR_lsetxattr 170
+-# define __NR_fsetxattr 171
+-# define __NR_getxattr 172
+-# define __NR_lgetxattr 173
+-# define __NR_fgetxattr 177
+-# define __NR_listxattr 178
+-# define __NR_llistxattr 179
+-# define __NR_flistxattr 180
+-# define __NR_removexattr 181
+-# define __NR_lremovexattr 182
+-# define __NR_fremovexattr 186
+-#elif defined (__ia64__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 1217
+-# define __NR_lsetxattr 1218
+-# define __NR_fsetxattr 1219
+-# define __NR_getxattr 1220
+-# define __NR_lgetxattr 1221
+-# define __NR_fgetxattr 1222
+-# define __NR_listxattr 1223
+-# define __NR_llistxattr 1224
+-# define __NR_flistxattr 1225
+-# define __NR_removexattr 1226
+-# define __NR_lremovexattr 1227
+-# define __NR_fremovexattr 1228
+-#elif defined (__powerpc__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 209
+-# define __NR_lsetxattr 210
+-# define __NR_fsetxattr 211
+-# define __NR_getxattr 212
+-# define __NR_lgetxattr 213
+-# define __NR_fgetxattr 214
+-# define __NR_listxattr 215
+-# define __NR_llistxattr 216
+-# define __NR_flistxattr 217
+-# define __NR_removexattr 218
+-# define __NR_lremovexattr 219
+-# define __NR_fremovexattr 220
+-#elif defined (__x86_64__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 188
+-# define __NR_lsetxattr 189
+-# define __NR_fsetxattr 190
+-# define __NR_getxattr 191
+-# define __NR_lgetxattr 192
+-# define __NR_fgetxattr 193
+-# define __NR_listxattr 194
+-# define __NR_llistxattr 195
+-# define __NR_flistxattr 196
+-# define __NR_removexattr 197
+-# define __NR_lremovexattr 198
+-# define __NR_fremovexattr 199
+-#elif defined (__s390__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 224
+-# define __NR_lsetxattr 225
+-# define __NR_fsetxattr 226
+-# define __NR_getxattr 227
+-# define __NR_lgetxattr 228
+-# define __NR_fgetxattr 229
+-# define __NR_listxattr 230
+-# define __NR_llistxattr 231
+-# define __NR_flistxattr 232
+-# define __NR_removexattr 233
+-# define __NR_lremovexattr 234
+-# define __NR_fremovexattr 235
+-#elif defined (__arm__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# if defined(__ARM_EABI__) || defined(__thumb__)
+-# define __NR_SYSCALL_BASE 0
+-# else
+-# define __NR_SYSCALL_BASE 0x900000
+-# endif
+-# define __NR_setxattr (__NR_SYSCALL_BASE+226)
+-# define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
+-# define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
+-# define __NR_getxattr (__NR_SYSCALL_BASE+229)
+-# define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
+-# define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
+-# define __NR_listxattr (__NR_SYSCALL_BASE+232)
+-# define __NR_llistxattr (__NR_SYSCALL_BASE+233)
+-# define __NR_flistxattr (__NR_SYSCALL_BASE+234)
+-# define __NR_removexattr (__NR_SYSCALL_BASE+235)
+-# define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
+-# define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
+-#elif defined (__mips64)
+-# define HAVE_XATTR_SYSCALLS 1
+-# ifdef __LP64__ /* mips64 using n64 ABI */
+-# define __NR_Linux 5000
+-# else /* mips64 using n32 ABI */
+-# define __NR_Linux 6000
+-# endif
+-# define __NR_setxattr (__NR_Linux + 180)
+-# define __NR_lsetxattr (__NR_Linux + 181)
+-# define __NR_fsetxattr (__NR_Linux + 182)
+-# define __NR_getxattr (__NR_Linux + 183)
+-# define __NR_lgetxattr (__NR_Linux + 184)
+-# define __NR_fgetxattr (__NR_Linux + 185)
+-# define __NR_listxattr (__NR_Linux + 186)
+-# define __NR_llistxattr (__NR_Linux + 187)
+-# define __NR_flistxattr (__NR_Linux + 188)
+-# define __NR_removexattr (__NR_Linux + 189)
+-# define __NR_lremovexattr (__NR_Linux + 190)
+-# define __NR_fremovexattr (__NR_Linux + 191)
+-#elif defined (__mips__) /* mips32, or mips64 using o32 ABI */
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_Linux 4000
+-# define __NR_setxattr (__NR_Linux + 224)
+-# define __NR_lsetxattr (__NR_Linux + 225)
+-# define __NR_fsetxattr (__NR_Linux + 226)
+-# define __NR_getxattr (__NR_Linux + 227)
+-# define __NR_lgetxattr (__NR_Linux + 228)
+-# define __NR_fgetxattr (__NR_Linux + 229)
+-# define __NR_listxattr (__NR_Linux + 230)
+-# define __NR_llistxattr (__NR_Linux + 231)
+-# define __NR_flistxattr (__NR_Linux + 232)
+-# define __NR_removexattr (__NR_Linux + 233)
+-# define __NR_lremovexattr (__NR_Linux + 234)
+-# define __NR_fremovexattr (__NR_Linux + 235)
+-#elif defined (__alpha__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 382
+-# define __NR_lsetxattr 383
+-# define __NR_fsetxattr 384
+-# define __NR_getxattr 385
+-# define __NR_lgetxattr 386
+-# define __NR_fgetxattr 387
+-# define __NR_listxattr 388
+-# define __NR_llistxattr 389
+-# define __NR_flistxattr 390
+-# define __NR_removexattr 391
+-# define __NR_lremovexattr 392
+-# define __NR_fremovexattr 393
+-#elif defined (__mc68000__)
+-# define HAVE_XATTR_SYSCALLS 1
+-# define __NR_setxattr 223
+-# define __NR_lsetxattr 224
+-# define __NR_fsetxattr 225
+-# define __NR_getxattr 226
+-# define __NR_lgetxattr 227
+-# define __NR_fgetxattr 228
+-# define __NR_listxattr 229
+-# define __NR_llistxattr 230
+-# define __NR_flistxattr 231
+-# define __NR_removexattr 232
+-# define __NR_lremovexattr 233
+-# define __NR_fremovexattr 234
+ #else
+ # warning "Extended attribute syscalls undefined for this architecture"
+ # define HAVE_XATTR_SYSCALLS 0
diff --git a/sys-apps/attr/metadata.xml b/sys-apps/attr/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/attr/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-apps/audio-entropyd/Manifest b/sys-apps/audio-entropyd/Manifest
new file mode 100644
index 000000000000..f70abfd24266
--- /dev/null
+++ b/sys-apps/audio-entropyd/Manifest
@@ -0,0 +1 @@
+DIST audio-entropyd-2.0.3.tgz 16681 SHA256 6fbaf1c4f77e988f4656cd079309d5eb6bd36cbae89c2ee01324c5690adaf3ff SHA512 d21c2d547235accdd460bcaf1ff5f5696db2988d385c3c52aad0d651865386409682f8747d1823765f0c0925bf28f38abdfc0b114d239f494c7eb699c5ed3ebf WHIRLPOOL e653b7cccda00323b5f17a675d72cef1a9adf9915dcd27041e63993073a378d92ab5779d25434ecd48ecbb74b45abc4217e4b629c98ba3885589727ef90edf6d
diff --git a/sys-apps/audio-entropyd/audio-entropyd-2.0.3-r1.ebuild b/sys-apps/audio-entropyd/audio-entropyd-2.0.3-r1.ebuild
new file mode 100644
index 000000000000..7657afd41b73
--- /dev/null
+++ b/sys-apps/audio-entropyd/audio-entropyd-2.0.3-r1.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 systemd toolchain-funcs
+
+DESCRIPTION="Audio-entropyd generates entropy-data for the /dev/random device"
+HOMEPAGE="http://www.vanheusden.com/aed/"
+SRC_URI="http://www.vanheusden.com/aed/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86"
+IUSE="selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-entropyd )
+ media-sound/alsa-utils
+ media-libs/alsa-lib"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.1-uclibc.patch" \
+ "${FILESDIR}/${PN}-2.0.1-ldflags.patch"
+ sed -i -e "s:^OPT_FLAGS=.*:OPT_FLAGS=${CFLAGS}:" \
+ -e "/^WARNFLAGS/s: -g::" Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dosbin audio-entropyd
+ dodoc README TODO
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ newinitd "${FILESDIR}/${PN}.init-2" ${PN}
+ newconfd "${FILESDIR}/${PN}.conf-2" ${PN}
+}
diff --git a/sys-apps/audio-entropyd/audio-entropyd-2.0.3.ebuild b/sys-apps/audio-entropyd/audio-entropyd-2.0.3.ebuild
new file mode 100644
index 000000000000..1dfc1007e9a2
--- /dev/null
+++ b/sys-apps/audio-entropyd/audio-entropyd-2.0.3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Audio-entropyd generates entropy-data for the /dev/random device"
+HOMEPAGE="http://www.vanheusden.com/aed/"
+SRC_URI="http://www.vanheusden.com/aed/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86"
+IUSE="selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-entropyd )
+ media-sound/alsa-utils
+ media-libs/alsa-lib"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.1-uclibc.patch" \
+ "${FILESDIR}/${PN}-2.0.1-ldflags.patch"
+ sed -i -e "s:^OPT_FLAGS=.*:OPT_FLAGS=${CFLAGS}:" \
+ -e "/^WARNFLAGS/s: -g::" Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ dosbin audio-entropyd
+ dodoc README TODO
+ newinitd "${FILESDIR}/${PN}.init-2" ${PN}
+ newconfd "${FILESDIR}/${PN}.conf-2" ${PN}
+}
diff --git a/sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-ldflags.patch b/sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-ldflags.patch
new file mode 100644
index 000000000000..870e9121140d
--- /dev/null
+++ b/sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-ldflags.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 95a84a6..340f95f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ TARGETS=audio-entropyd
+ all: $(TARGETS)
+
+ audio-entropyd: audio-entropyd.o error.o proc.o val.o RNGTEST.o error.o
+- $(CC) -o $@ $^ $(LFLAGS)
++ $(CC) $(LDFLAGS) -o $@ $^ $(LFLAGS)
+
+ install: audio-entropyd
+ cp audio-entropyd /usr/local/sbin/
diff --git a/sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-uclibc.patch b/sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-uclibc.patch
new file mode 100644
index 000000000000..bdf5adeff825
--- /dev/null
+++ b/sys-apps/audio-entropyd/files/audio-entropyd-2.0.1-uclibc.patch
@@ -0,0 +1,27 @@
+--- audio-entropyd-1.0.1.orig/error.c 2008-01-22 09:50:28 +0000
++++ audio-entropyd-1.0.1/error.c 2008-01-22 09:53:51 +0000
+@@ -9,13 +9,13 @@
+ #include <signal.h>
+ #include <syslog.h>
+ #include <regex.h>
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) && !defined(__UCLIBC__)
+ #include <execinfo.h>
+ #endif
+
+ void print_trace(void)
+ {
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) && !defined(__UCLIBC__)
+ void *array[MAX_BACKTRACE_LENGTH];
+ size_t size;
+
+@@ -39,7 +39,7 @@
+ printf("\n\n\nDebug information:\n");
+ if (errno) fprintf(stderr, "errno: %d=%s (if applicable)\n", errno, strerror(errno));
+
+-#if defined(__GLIBC__)
++#if defined(__GLIBC__) && !defined(__UCLIBC__)
+ print_trace();
+ #endif
+
diff --git a/sys-apps/audio-entropyd/files/audio-entropyd.conf-2 b/sys-apps/audio-entropyd/files/audio-entropyd.conf-2
new file mode 100644
index 000000000000..ec3a56fa5c1f
--- /dev/null
+++ b/sys-apps/audio-entropyd/files/audio-entropyd.conf-2
@@ -0,0 +1,13 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# /etc/conf.d/audio-entropyd
+
+# The acceptable values are DEVICE, READSIZE and SAMPLERATE
+# These defaults give the optimum entropy
+
+#DEVICE="hw:0"
+
+#SAMPLERATE must be a valid sampling rate of your audio source
+SAMPLERATE="44050"
diff --git a/sys-apps/audio-entropyd/files/audio-entropyd.init-2 b/sys-apps/audio-entropyd/files/audio-entropyd.init-2
new file mode 100644
index 000000000000..a31993b727c0
--- /dev/null
+++ b/sys-apps/audio-entropyd/files/audio-entropyd.init-2
@@ -0,0 +1,27 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need modules
+ use alsasound
+ provide entropy
+}
+
+start() {
+ local params=""
+ [ -n "$DEVICE" ] && params="$params -d $DEVICE"
+ [ -n "$SAMPLERATE" ] && params="$params -N $SAMPLERATE"
+
+ ebegin "Starting audio entropy gathering daemon"
+ start-stop-daemon --start --quiet --pidfile /var/run/audio-entropyd.pid \
+ --exec /usr/sbin/audio-entropyd -- ${params}
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping audio entropy gathering daemon"
+ start-stop-daemon --stop --quiet --pidfile /var/run/audio-entropyd.pid
+ eend ${?}
+}
diff --git a/sys-apps/audio-entropyd/files/audio-entropyd.service b/sys-apps/audio-entropyd/files/audio-entropyd.service
new file mode 100644
index 000000000000..849ad0131c63
--- /dev/null
+++ b/sys-apps/audio-entropyd/files/audio-entropyd.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Audio Entropy Daemon
+
+[Service]
+ExecStart=/usr/sbin/audio-entropyd -n
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/audio-entropyd/metadata.xml b/sys-apps/audio-entropyd/metadata.xml
new file mode 100644
index 000000000000..bc557e5fa607
--- /dev/null
+++ b/sys-apps/audio-entropyd/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>angelos@gentoo.org</email>
+ <name>Christoph Mende</name>
+</maintainer>
+<longdescription>Audio-entropyd generates entropy-data for the /dev/random device.</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/baobab/Manifest b/sys-apps/baobab/Manifest
new file mode 100644
index 000000000000..5087017c55fb
--- /dev/null
+++ b/sys-apps/baobab/Manifest
@@ -0,0 +1,2 @@
+DIST baobab-3.14.1.tar.xz 884316 SHA256 76966521858f3c46fedbf38deb8f9847737ef0bc3c5f330c51d1feb68a711d17 SHA512 1738a8d536cb9cc9031dda2179b8997ecb03b5eee3cd462194b894eac36ab27a7deb268a7bc9c554909a4e473bda3ebe2ff35a06b70939b5f79152c73d794ab1 WHIRLPOOL 8fd948f75c57d937a79fa0d1e7a2e8d38a8555207205b341c1e13a79aeeef2e377ec828c300571daadb50e0ec056403bb23a4af15c6aad15431dc33ffcdb768b
+DIST baobab-3.16.1.tar.xz 880192 SHA256 1fe40433df3adda0bcc4d0a6edc2bc2501888798d7e8336ad51d443c9a1fcef2 SHA512 3b68348d4686900dbc24eb904d0709fb5495ebbce5bfe44f5f956242d18492ce6b1ca8a072c1c3e7f384ea2d5b668d35d3867cf50434aeaf84878c5f5b5dc288 WHIRLPOOL 74a75cad585ae0d9c14e65712baa9a6b52c48d0eb1f7cc508c42a997695b3c154b34eb708e7247c683769e52dd1650847b55534a46bd89854888706b0ed4cc6b
diff --git a/sys-apps/baobab/baobab-3.14.1.ebuild b/sys-apps/baobab/baobab-3.14.1.ebuild
new file mode 100644
index 000000000000..333785d2e04c
--- /dev/null
+++ b/sys-apps/baobab/baobab-3.14.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+
+inherit gnome2
+
+DESCRIPTION="Disk usage browser for GNOME"
+HOMEPAGE="https://wiki.gnome.org/Apps/Baobab"
+
+LICENSE="GPL-2+ FDL-1.1+"
+SLOT="0"
+IUSE=""
+KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.40:2
+ >=x11-libs/gtk+-3.13.2:3
+"
+RDEPEND="${COMMON_DEPEND}
+ gnome-base/gsettings-desktop-schemas
+ x11-themes/gnome-icon-theme-extras
+ !<gnome-extra/gnome-utils-3.4
+"
+# ${PN} was part of gnome-utils before 3.4
+DEPEND="${COMMON_DEPEND}
+ >=dev-util/intltool-0.40
+ >=sys-devel/gettext-0.17
+ virtual/pkgconfig
+"
+
+src_configure() {
+ gnome2_src_configure \
+ ITSTOOL=$(type -P true) \
+ XMLLINT=$(type -P true) \
+ VALAC=$(type -P true) \
+ VAPIGEN=$(type -P true)
+}
diff --git a/sys-apps/baobab/baobab-3.16.1.ebuild b/sys-apps/baobab/baobab-3.16.1.ebuild
new file mode 100644
index 000000000000..dd274a04f9e0
--- /dev/null
+++ b/sys-apps/baobab/baobab-3.16.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+
+inherit gnome2
+
+DESCRIPTION="Disk usage browser for GNOME"
+HOMEPAGE="https://wiki.gnome.org/Apps/Baobab"
+
+LICENSE="GPL-2+ FDL-1.1+"
+SLOT="0"
+IUSE=""
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.40:2
+ >=x11-libs/gtk+-3.13.2:3
+"
+RDEPEND="${COMMON_DEPEND}
+ gnome-base/gsettings-desktop-schemas
+ x11-themes/gnome-icon-theme-extras
+ !<gnome-extra/gnome-utils-3.4
+"
+# ${PN} was part of gnome-utils before 3.4
+DEPEND="${COMMON_DEPEND}
+ dev-libs/libxml2
+ >=dev-util/intltool-0.40
+ >=sys-devel/gettext-0.17
+ virtual/pkgconfig
+"
+
+src_configure() {
+ gnome2_src_configure \
+ ITSTOOL=$(type -P true) \
+ VALAC=$(type -P true) \
+ VAPIGEN=$(type -P true)
+}
diff --git a/sys-apps/baobab/metadata.xml b/sys-apps/baobab/metadata.xml
new file mode 100644
index 000000000000..da6fd63d0085
--- /dev/null
+++ b/sys-apps/baobab/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>gnome</herd>
+</pkgmetadata>
diff --git a/sys-apps/bar/Manifest b/sys-apps/bar/Manifest
new file mode 100644
index 000000000000..a851d43953d0
--- /dev/null
+++ b/sys-apps/bar/Manifest
@@ -0,0 +1 @@
+DIST bar_1.11.1.tar.gz 187144 SHA256 fa0f5ec5c8400316c2f4debdc6cdcb80e186e668c2e4471df4fec7bfcd626503
diff --git a/sys-apps/bar/bar-1.11.1.ebuild b/sys-apps/bar/bar-1.11.1.ebuild
new file mode 100644
index 000000000000..6c32902d0d1c
--- /dev/null
+++ b/sys-apps/bar/bar-1.11.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools
+
+DESCRIPTION="Console Progress Bar"
+HOMEPAGE="http://clpbar.sourceforge.net/"
+SRC_URI="mirror://sourceforge/clpbar/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc"
+
+DEPEND="doc? ( >=app-doc/doxygen-1.3.5 )"
+RDEPEND=""
+
+src_prepare() {
+ sed -e '/^LDFLAGS/d' \
+ -e '/cd $(WEB_DIR) && $(MAKE)/d' -i Makefile.am || die
+ eautomake
+}
+
+src_configure() {
+ local myconf
+
+ # Fix wrt #113392
+ use sparc && myconf="${myconf} --disable-use-memalign"
+ econf ${myconf}
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}"
+ if use doc; then
+ mkdir -p ../www/doxygen/${PV}
+ emake update-www
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS TODO TROUBLESHOOTING debian/changelog
+ if use doc ; then
+ dohtml -r ../www/doxygen/${PV}/html/*
+ fi
+}
diff --git a/sys-apps/bar/metadata.xml b/sys-apps/bar/metadata.xml
new file mode 100644
index 000000000000..d3cb34b9ca6e
--- /dev/null
+++ b/sys-apps/bar/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>shell-tools</herd>
+ <upstream>
+ <remote-id type="sourceforge">clpbar</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/baselayout-java/Manifest b/sys-apps/baselayout-java/Manifest
new file mode 100644
index 000000000000..20e110f50582
--- /dev/null
+++ b/sys-apps/baselayout-java/Manifest
@@ -0,0 +1 @@
+DIST baselayout-java-0.1.0.tar.gz 72571 SHA256 da5dd2210597e3aa4e2ff437cd25cadc9999fdcfdb31ca459395243695c9e2c7 SHA512 6f5b6ff1ed07406711e15a768f5abdf9f7edef1b31e094760f265863aa8991bf60ff71c8b10003265d8ec1aa7c94a611bede96980d25c819908b705b4d2d1062 WHIRLPOOL 9a3111a64d04bd6f274c13f5ed3c641fa1dbbd8d8cf1ff152df7a55771148d80fdcd3c3dc5a7394675723a58aa51ce680fef20c6209380dde4ec0fe1c18a3fac
diff --git a/sys-apps/baselayout-java/baselayout-java-0.1.0.ebuild b/sys-apps/baselayout-java/baselayout-java-0.1.0.ebuild
new file mode 100644
index 000000000000..5b0011fc220e
--- /dev/null
+++ b/sys-apps/baselayout-java/baselayout-java-0.1.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
+
+inherit fdo-mime gnome2-utils
+
+DESCRIPTION="Baselayout for Java"
+HOMEPAGE="http://www.gentoo.org/proj/en/java/"
+SRC_URI="http://dev.gentoo.org/~sera/distfiles/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ia64 ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="!<dev-java/java-config-2.2"
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
diff --git a/sys-apps/baselayout-java/metadata.xml b/sys-apps/baselayout-java/metadata.xml
new file mode 100644
index 000000000000..8335e2c18589
--- /dev/null
+++ b/sys-apps/baselayout-java/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>java</herd>
+<longdescription lang="en">
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/baselayout-prefix/Manifest b/sys-apps/baselayout-prefix/Manifest
new file mode 100644
index 000000000000..44b3a225d84c
--- /dev/null
+++ b/sys-apps/baselayout-prefix/Manifest
@@ -0,0 +1,4 @@
+DIST baselayout-2.2.tar.bz2 40744 SHA256 11d4a223b06da545c3e59e07c9195570f334b5b1be05d995df0ebc8ea2203e98 SHA512 a5199c42e835d9f2683cc94f3c4c47ecdc392316c24e0932845736e2e90479b0c5c8ad72ead8e0537f097405b7d7548d00b87b7ff8c9e3651486e3c5c0970b36 WHIRLPOOL 60cc4f7f76c5a45c15303e526decffb3bad2b50ac659b1dd072d2ed4b0eb0b31929a1a733ddb03a31ee5882b889a4efb87206f63ffaa2b11e26d36afd0933a95
+DIST baselayout-prefix-1.12.14.1709.tar.bz2 461562 SHA256 ca1eec028b7ec72f1e3196f71eafd564062d9b677569698fe41ac5f817c9379e SHA512 600cf1a90771deb0f1d2be73dc2b6fbd0708c8b19e4b300a95cb5e5431be05904864cbcf8cd87dd3aefa5827fc8c3324d5249496a37a84ea2f676a25447f5b9e WHIRLPOOL 872f02fa0e4920c1c6fadbfeeee19d52ab1a2ccce32b0eb52e245dc71767cf31110c063946163bc171d6085a50867f74936c397fd6fdf8e9e30b146b06dc8926
+DIST baselayout-prefix-1.12.5.1701.tar.bz2 412843 SHA256 452ee800e37c65d9c44e77130f0ea9f082e05df2f9a673523fe2e03170fa3099 SHA512 87d73943a9210c2ab613a60bed1197fa92fe536bde870f97e28aaa6cbc432d2c94b507f9a78011c2b7e92a09612267c3d23a540bdb5677a836d6dc845af0858b WHIRLPOOL 4a678f1b150a48c85507a09dce57572b98eb7f2c4e22bb57294cc653e7ac896281ed255f39ecc6c45e3a1ddd385ffded1eaec9b3b0412b62320f0e997e8a84ec
+DIST einfo-1.0.6.tar.xz 222368 SHA256 036108a6160c0a5468483e94effc2665d2028b6c64ea22ec607117cbaec564d6 SHA512 d9fabb11621b3ab49aaa0ad318ee6f511ee09d2a4de1cce7da1c3e0b1f8cb9a3b2f5d446f7e6d7b662a21955178ed89cc4c212382aac66d40a774f42f9a53738 WHIRLPOOL ec7bd03ac6f10205f8405fa0c4907af748a95727bb0a3fa20024a5fd215cb19e9eeebabcdba4be4710962d170bd96c47e03258e0f5b03e98449c90a32d0dedf0
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-1.12.14-r1.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.14-r1.ebuild
new file mode 100644
index 000000000000..2dc3eefcaeac
--- /dev/null
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.14-r1.ebuild
@@ -0,0 +1,148 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils toolchain-funcs multilib prefix flag-o-matic user
+
+# last part in e.g. 1.12.14.1704
+PVER=1709
+
+DESCRIPTION="Baselayout for Gentoo Prefix installs"
+HOMEPAGE="http://prefix.gentoo.org/"
+SRC_URI="http://dev.gentoo.org/~grobian/distfiles/${P}.${PVER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="prefix-chaining"
+DEPEND=">=sys-apps/portage-2.2.01"
+RDEPEND=">=sys-libs/readline-5.0-r1
+ >=app-shells/bash-3.1_p7
+ >=sys-apps/coreutils-5.2.1
+ kernel_Darwin? ( sys-process/pidof-bsd )
+ kernel_FreeBSD? ( sys-process/pidof-bsd )"
+
+S=${WORKDIR}/${P}.${PVER}
+
+src_prepare() {
+ if use prefix-chaining; then
+ epatch "${S}"/baselayout-${PV}-prefix-chaining.patch
+
+ # need to set the PKG_CONFIG_PATH globally for this prefix, when
+ # chaining is enabled, since pkg-config may not be installed locally,
+ # but still .pc files should be found for all RDEPENDable prefixes in
+ # the chain.
+ echo "PKG_CONFIG_PATH=\"${EPREFIX}/usr/lib/pkgconfig:${EPREFIX}/usr/share/pkgconfig\"" >> "${S}"/etc/env.d/00basic
+ fi
+
+ cd "${S}"
+ eprefixify \
+ etc/env.d/00basic \
+ etc/profile
+
+ # add the host OS MANPATH
+ echo 'MANPATH="/usr/share/man"' > etc/env.d/99basic || die "can't make file"
+
+ # avoid a re-automake run
+ touch -r gnulib/configure.ac gnulib/Makefile.in gnulib/aclocal.m4 || die
+}
+
+src_configure() {
+ cd gnulib || die
+ default
+}
+
+src_compile() {
+ # build gnulib first
+ pushd gnulib > /dev/null || die
+ emake || die "Cannot build gnulib"
+ popd > /dev/null
+
+ # use gnulib (buildsystem doesn't respect cppflags)
+ append-cflags -I../gnulib -I../gnulib/gllib
+ append-ldflags -L../gnulib/gllib
+ append-libs gnu
+
+ local libdir="lib"
+
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+}
+
+src_install() {
+ local dir libdirs libdirs_env rcscripts_dir
+
+ dodir /etc
+ dodir /etc/env.d
+ dodir /etc/init.d # .keep file might mess up init.d stuff
+
+ libdirs=$(get_all_libdirs)
+ : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
+
+ rcscripts_dir="/lib/rcscripts"
+
+ for dir in ${libdirs}; do
+ libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
+ [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
+ dodir /"${dir}"
+ dodir /usr/"${dir}"
+ dodir /usr/local/"${dir}"
+ done
+
+ # Ugly compatibility with stupid ebuilds and old profiles symlinks
+ if [[ ${SYMLINK_LIB} == "yes" ]] ; then
+ rm -r "${ED}"/{lib,usr/lib,usr/local/lib} &> /dev/null
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
+ fi
+
+ # FHS compatibility symlinks stuff
+ dosym /var/tmp /usr/tmp
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Prefix Base System version ${PV}" > ${ED}/etc/gentoo-release
+
+ # get the basic stuff in there
+ doenvd "${S}"/etc/env.d/* || die "doenvd"
+
+ # copy the profile
+ cp "${S}"/etc/profile "${ED}"/etc/profile
+
+ # Setup files in /sbin
+ #
+ cd "${S}"/sbin
+ into /
+ # These moved from /etc/init.d/ to /sbin to help newb systems
+ # from breaking
+
+ #
+ # Install baselayout utilities
+ #
+ local libdir="lib"
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+}
+
+pkg_postinst() {
+ if [[ ${EUID} == 0 ]] ; then
+ # setup portage user, such that things that require root privs
+ # don't fail, bug #321623
+ enewgroup portage 250
+ enewuser portage 250 -1 "${EPREFIX}"/var/tmp/portage portage
+ fi
+
+ # This is also written in src_install (so it's in CONTENTS), but
+ # write it here so that the new version is immediately in the file
+ # (without waiting for the user to do etc-update)
+ rm -f "${EROOT}"/etc/._cfg????_gentoo-release
+ echo "Gentoo Prefix Base System version ${PV}" > "${EROOT}"/etc/gentoo-release
+
+ echo
+ einfo "Please be sure to update all pending '._cfg*' files in /etc,"
+ einfo "else things might break! You can use 'etc-update'"
+ einfo "to accomplish this:"
+ einfo
+ einfo " # etc-update"
+ echo
+}
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-1.12.14.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.14.ebuild
new file mode 100644
index 000000000000..ac709afaae54
--- /dev/null
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.14.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils toolchain-funcs multilib prefix flag-o-matic user
+
+# last part in e.g. 1.12.14.1704
+PVER=1709
+
+DESCRIPTION="Baselayout for Gentoo Prefix installs"
+HOMEPAGE="http://prefix.gentoo.org/"
+SRC_URI="http://dev.gentoo.org/~grobian/distfiles/${P}.${PVER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="prefix-chaining"
+DEPEND=">=sys-apps/portage-2.2.01"
+RDEPEND=">=sys-libs/readline-5.0-r1
+ >=app-shells/bash-3.1_p7
+ >=sys-apps/coreutils-5.2.1
+ kernel_Darwin? ( sys-process/pidof-bsd )
+ kernel_FreeBSD? ( sys-process/pidof-bsd )"
+
+S=${WORKDIR}/${P}.${PVER}
+
+src_prepare() {
+ if use prefix-chaining; then
+ epatch "${S}"/baselayout-${PV}-prefix-chaining.patch
+
+ # need to set the PKG_CONFIG_PATH globally for this prefix, when
+ # chaining is enabled, since pkg-config may not be installed locally,
+ # but still .pc files should be found for all RDEPENDable prefixes in
+ # the chain.
+ echo "PKG_CONFIG_PATH=\"${EPREFIX}/usr/lib/pkgconfig:${EPREFIX}/usr/share/pkgconfig\"" >> "${S}"/etc/env.d/00basic
+ fi
+
+ # The consoletype application in this form will only work on Linux
+ [[ ${CHOST} == *-linux-* ]] || epatch "${FILESDIR}"/baselayout-1.12.5-prefix-no-consoletype.patch
+
+ cd "${S}"
+ eprefixify \
+ etc/env.d/00basic \
+ etc/profile \
+ sbin/functions.sh \
+ sbin/runscript.sh \
+ src/runscript.c \
+ sbin/depscan.sh \
+ sbin/rc-daemon.sh \
+ sbin/rc-services.sh
+ # add the host OS MANPATH
+ echo 'MANPATH="/usr/share/man"' > etc/env.d/99basic || die "can't make file"
+
+ # avoid a re-automake run
+ touch -r gnulib/configure.ac gnulib/Makefile.in gnulib/aclocal.m4 || die
+}
+
+src_configure() {
+ cd gnulib || die
+ default
+}
+
+src_compile() {
+ # build gnulib first
+ pushd gnulib > /dev/null || die
+ emake || die "Cannot build gnulib"
+ popd > /dev/null
+
+ # use gnulib (buildsystem doesn't respect cppflags)
+ append-cflags -I../gnulib -I../gnulib/gllib
+ append-ldflags -L../gnulib/gllib
+ append-libs gnu
+
+ local libdir="lib"
+
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+
+ # CFLAGS in LD for #370695
+ make -C "${S}"/src \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getCC) ${CFLAGS} ${LDFLAGS}" \
+ CFLAGS="${CFLAGS}" \
+ LIBDIR="${libdir}" || die
+}
+
+src_install() {
+ local dir libdirs libdirs_env rcscripts_dir
+
+ dodir /etc
+ dodir /etc/env.d
+ dodir /etc/init.d # .keep file might mess up init.d stuff
+
+ libdirs=$(get_all_libdirs)
+ : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
+
+ rcscripts_dir="/lib/rcscripts"
+
+ for dir in ${libdirs}; do
+ libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
+ [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
+ dodir /"${dir}"
+ dodir /usr/"${dir}"
+ dodir /usr/local/"${dir}"
+ done
+
+ # Ugly compatibility with stupid ebuilds and old profiles symlinks
+ if [[ ${SYMLINK_LIB} == "yes" ]] ; then
+ rm -r "${ED}"/{lib,usr/lib,usr/local/lib} &> /dev/null
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
+ fi
+
+ # FHS compatibility symlinks stuff
+ dosym /var/tmp /usr/tmp
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Prefix Base System version ${PV}" > ${ED}/etc/gentoo-release
+
+ # get the basic stuff in there
+ doenvd "${S}"/etc/env.d/* || die "doenvd"
+
+ # copy the profile
+ cp "${S}"/etc/profile "${ED}"/etc/profile
+
+ # Setup files in /sbin
+ #
+ cd "${S}"/sbin
+ into /
+ # These moved from /etc/init.d/ to /sbin to help newb systems
+ # from breaking
+ dosbin runscript.sh functions.sh
+
+ # Compat symlinks between /etc/init.d and /sbin
+ # (some stuff have hardcoded paths)
+ dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
+ dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
+ dosym ../../sbin/functions.sh /etc/init.d/functions.sh
+
+ cd "${S}"/sbin
+ into /
+ dosbin depscan.sh
+ insinto ${rcscripts_dir}/awk
+ doins "${S}"/src/awk/functions.awk
+
+ #
+ # Install baselayout utilities
+ #
+ local libdir="lib"
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+
+ cd "${S}"/src
+ make DESTDIR="${ED}" LIBDIR="${libdir}" install || die
+
+ insinto ${rcscripts_dir}/sh
+ doins "${S}"/sbin/rc-*
+}
+
+pkg_postinst() {
+ if [[ ${EUID} == 0 ]] ; then
+ # setup portage user, such that things that require root privs
+ # don't fail, bug #321623
+ enewgroup portage 250
+ enewuser portage 250 -1 "${EPREFIX}"/var/tmp/portage portage
+ fi
+
+ # This is also written in src_install (so it's in CONTENTS), but
+ # write it here so that the new version is immediately in the file
+ # (without waiting for the user to do etc-update)
+ rm -f "${EROOT}"/etc/._cfg????_gentoo-release
+ echo "Gentoo Prefix Base System version ${PV}" > "${EROOT}"/etc/gentoo-release
+
+ echo
+ einfo "Please be sure to update all pending '._cfg*' files in /etc,"
+ einfo "else things might break! You can use 'etc-update'"
+ einfo "to accomplish this:"
+ einfo
+ einfo " # etc-update"
+ echo
+}
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r11.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r11.ebuild
new file mode 100644
index 000000000000..165cf8908786
--- /dev/null
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-1.12.5-r11.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils toolchain-funcs multilib prefix flag-o-matic user
+
+# baselayout-prefix-1.12.5.1694.tar.bz2
+PVER=1701
+
+DESCRIPTION="Baselayout for Gentoo Prefix installs"
+HOMEPAGE="http://prefix.gentoo.org/"
+SRC_URI="http://dev.gentoo.org/~grobian/distfiles/${P}.${PVER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="prefix-chaining"
+DEPEND=">=sys-apps/portage-2.2.01"
+RDEPEND=">=sys-libs/readline-5.0-r1
+ >=app-shells/bash-3.1_p7
+ >=sys-apps/coreutils-5.2.1
+ kernel_Darwin? ( sys-process/pidof-bsd )
+ kernel_FreeBSD? ( sys-process/pidof-bsd )"
+
+S=${WORKDIR}/${P}.${PVER}
+
+src_prepare() {
+ if use prefix-chaining; then
+ epatch "${S}"/baselayout-1.12.5-prefix-chaining.patch
+
+ # need to set the PKG_CONFIG_PATH globally for this prefix, when
+ # chaining is enabled, since pkg-config may not be installed locally,
+ # but still .pc files should be found for all RDEPENDable prefixes in
+ # the chain.
+ echo "PKG_CONFIG_PATH=\"${EPREFIX}/usr/lib/pkgconfig:${EPREFIX}/usr/share/pkgconfig\"" >> "${S}"/etc/env.d/00basic
+ fi
+
+ # The consoletype application in this form will only work on Linux
+ [[ ${CHOST} == *-linux-* ]] || epatch "${FILESDIR}"/${P/-prefix/}-prefix-no-consoletype.patch
+
+ cd "${S}"
+ eprefixify \
+ etc/env.d/00basic \
+ etc/profile \
+ sbin/env-update.sh \
+ sbin/functions.sh \
+ sbin/runscript.sh \
+ src/runscript.c \
+ sbin/depscan.sh \
+ sbin/rc-daemon.sh \
+ sbin/rc-services.sh
+ # add the host OS MANPATH
+ echo 'MANPATH="/usr/share/man"' > etc/env.d/99basic || die "can't make file"
+}
+
+src_configure() {
+ cd gnulib || die
+ default
+}
+
+src_compile() {
+ # build gnulib first
+ pushd gnulib > /dev/null || die
+ emake || die "Cannot build gnulib"
+ popd > /dev/null
+
+ # use gnulib
+ append-flags -I../gnulib -I../gnulib/gllib
+ append-ldflags -L../gnulib/gllib
+ append-libs gnu
+
+ local libdir="lib"
+
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+
+ make -C "${S}"/src \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getCC) ${LDFLAGS}" \
+ CFLAGS="${CFLAGS}" \
+ LIBDIR="${libdir}" || die
+}
+
+src_install() {
+ local dir libdirs libdirs_env rcscripts_dir
+
+ dodir /etc
+ dodir /etc/env.d
+ dodir /etc/init.d # .keep file might mess up init.d stuff
+
+ libdirs=$(get_all_libdirs)
+ : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
+
+ rcscripts_dir="/lib/rcscripts"
+
+ for dir in ${libdirs}; do
+ libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir}
+ [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue
+ dodir /"${dir}"
+ dodir /usr/"${dir}"
+ dodir /usr/local/"${dir}"
+ done
+
+ # Ugly compatibility with stupid ebuilds and old profiles symlinks
+ if [[ ${SYMLINK_LIB} == "yes" ]] ; then
+ rm -r "${ED}"/{lib,usr/lib,usr/local/lib} &> /dev/null
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib
+ dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib
+ fi
+
+ # FHS compatibility symlinks stuff
+ dosym /var/tmp /usr/tmp
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Prefix Base System version ${PV}" > ${ED}/etc/gentoo-release
+
+ # get the basic stuff in there
+ doenvd "${S}"/etc/env.d/* || die "doenvd"
+
+ # copy the profile
+ cp "${S}"/etc/profile "${ED}"/etc/profile
+
+ # Setup files in /sbin
+ #
+ cd "${S}"/sbin
+ into /
+ # These moved from /etc/init.d/ to /sbin to help newb systems
+ # from breaking
+ dosbin runscript.sh functions.sh
+
+ # Compat symlinks between /etc/init.d and /sbin
+ # (some stuff have hardcoded paths)
+ dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh
+ dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh
+ dosym ../../sbin/functions.sh /etc/init.d/functions.sh
+
+ cd "${S}"/sbin
+ into /
+ dosbin depscan.sh
+ dosbin env-update.sh
+ insinto ${rcscripts_dir}/awk
+ doins "${S}"/src/awk/functions.awk
+
+ #
+ # Install baselayout utilities
+ #
+ local libdir="lib"
+ [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+
+ cd "${S}"/src
+ make DESTDIR="${ED}" LIBDIR="${libdir}" install || die
+
+ insinto ${rcscripts_dir}/sh
+ doins "${S}"/sbin/rc-*
+}
+
+pkg_postinst() {
+ if [[ ${EUID} == 0 ]] ; then
+ # setup portage user, such that things that require root privs
+ # don't fail, bug #321623
+ enewgroup portage 250
+ enewuser portage 250 -1 "${EPREFIX}"/var/tmp/portage portage
+ fi
+
+ # This is also written in src_install (so it's in CONTENTS), but
+ # write it here so that the new version is immediately in the file
+ # (without waiting for the user to do etc-update)
+ rm -f "${EROOT}"/etc/._cfg????_gentoo-release
+ echo "Gentoo Prefix Base System version ${PV}" > "${EROOT}"/etc/gentoo-release
+
+ echo
+ einfo "Please be sure to update all pending '._cfg*' files in /etc,"
+ einfo "else things might break! You can use 'etc-update'"
+ einfo "to accomplish this:"
+ einfo
+ einfo " # etc-update"
+ echo
+}
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r3.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r3.ebuild
new file mode 100644
index 000000000000..bd96d0c42b87
--- /dev/null
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r3.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils multilib libtool
+
+MY_P=${P/-prefix/} # just use "upstream" sources
+EINFO=einfo-1.0.6
+DESCRIPTION="Minimal baselayout and e-functions for Gentoo Prefix installs"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~vapier/dist/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~redlizard/distfiles/${EINFO}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~arm ~arm-linux ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+IUSE="build kernel_linux"
+
+S=${WORKDIR}/${EINFO}
+
+pkg_preinst() {
+ # This is written in src_install (so it's in CONTENTS), but punt all
+ # pending updates to avoid user having to do etc-update (and make the
+ # pkg_postinst logic simpler).
+ rm -f "${EROOT}"/etc/._cfg????_gentoo-release
+}
+
+src_prepare() {
+ # exotic platforms still aren't fixed in upstream libtool
+ elibtoolize
+}
+
+src_configure() {
+ econf --libexecdir="${EPREFIX}/usr/lib/einfo"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # make functions.sh available in /etc/init.d
+ # Note: we cannot replace the symlink with a file here, or Portage will
+ # config-protect it, and etc-update can't handle symlink to file updates
+ dodir etc/init.d
+ dosym ../../usr/lib/einfo/sh/functions.sh /etc/init.d/functions.sh
+
+ pushd "${WORKDIR}"/${MY_P} > /dev/null || die
+ dodir etc
+ sed \
+ -e "/PATH=/!s:/\(etc\|usr/bin\|bin\):\"${EPREFIX}\"/\1:g" \
+ -e "/PATH=/s|\([:\"]\)/|\1${EPREFIX}/|g" \
+ -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \
+ -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \
+ etc/profile > "${ED}"/etc/profile || die
+ dodir etc/env.d
+ sed \
+ -e "s:/\(etc/env.d\|opt\|usr\):${EPREFIX}/\1:g" \
+ -e "/^PATH=/s|\"$|:${EPREFIX}/usr/sbin:${EPREFIX}/sbin\"|" \
+ etc/env.d/00basic > "${ED}"/etc/env.d/00basic || die
+ dodoc ChangeLog.svn
+ popd > /dev/null
+
+ # add the host OS MANPATH
+ if [[ -d "${ROOT}"/usr/share/man ]] ; then
+ echo 'MANPATH="/usr/share/man"' > "${ED}"/etc/env.d/99basic || die
+ fi
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Prefix Base System release ${PV}" > "${ED}"/etc/gentoo-release
+
+ # FHS compatibility symlinks stuff
+ dosym /var/tmp /usr/tmp
+
+ # add a dummy to avoid Portage shebang errors
+ dodir sbin
+ cat > "${ED}"/sbin/runscript <<- EOF
+ #!/bin/sh
+
+ echo "runscript not supported by Gentoo Prefix Base System release ${PV}" 1>&2
+ exit 1
+ EOF
+ chmod 755 "${ED}"/sbin/runscript || die
+}
+
+pkg_postinst() {
+ # Take care of the etc-update for the user
+ if [ -e "${EROOT}"/etc/._cfg0000_gentoo-release ] ; then
+ mv "${EROOT}"/etc/._cfg0000_gentoo-release "${EROOT}"/etc/gentoo-release
+ fi
+
+ # baselayout leaves behind a lot of .keep files, so let's clean them up
+ find "${EROOT}"/lib/rcscripts/ -name .keep -exec rm -f {} + 2>/dev/null
+ find "${EROOT}"/lib/rcscripts/ -depth -type d -exec rmdir {} + 2>/dev/null
+}
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r4.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r4.ebuild
new file mode 100644
index 000000000000..cf4a23472751
--- /dev/null
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r4.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=3
+
+inherit eutils multilib libtool
+
+MY_P=${P/-prefix/} # just use "upstream" sources
+DESCRIPTION="Minimal baselayout for Gentoo Prefix installs"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~vapier/dist/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~arm ~arm-linux ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+
+RDEPEND="sys-apps/gentoo-functions"
+DEPEND="${RDEPEND}"
+
+pkg_preinst() {
+ # This is written in src_install (so it's in CONTENTS), but punt all
+ # pending updates to avoid user having to do etc-update (and make the
+ # pkg_postinst logic simpler).
+ rm -f "${EROOT}"/etc/._cfg????_gentoo-release
+}
+
+src_install() {
+ # make functions.sh available in /etc/init.d (from gentoo-functions)
+ # Note: we cannot replace the symlink with a file here, or Portage will
+ # config-protect it, and etc-update can't handle symlink to file updates
+ dodir etc/init.d
+ dosym ../../lib/gentoo/functions.sh /etc/init.d/functions.sh
+
+ pushd "${WORKDIR}"/${MY_P} > /dev/null || die
+ dodir etc
+ sed \
+ -e "/PATH=/!s:/\(etc\|usr/bin\|bin\):\"${EPREFIX}\"/\1:g" \
+ -e "/PATH=/s|\([:\"]\)/|\1${EPREFIX}/|g" \
+ -e "/PATH=.*\/sbin/s|\"$|:/usr/sbin:/sbin\"|" \
+ -e "/PATH=.*\/bin/s|\"$|:/usr/bin:/bin\"|" \
+ etc/profile > "${ED}"/etc/profile || die
+ dodir etc/env.d
+ sed \
+ -e "s:/\(etc/env.d\|opt\|usr\):${EPREFIX}/\1:g" \
+ -e "/^PATH=/s|\"$|:${EPREFIX}/usr/sbin:${EPREFIX}/sbin\"|" \
+ etc/env.d/00basic > "${ED}"/etc/env.d/00basic || die
+ dodoc ChangeLog.svn
+ popd > /dev/null
+
+ # add the host OS MANPATH
+ if [[ -d "${ROOT}"/usr/share/man ]] ; then
+ echo 'MANPATH="/usr/share/man"' > "${ED}"/etc/env.d/99basic || die
+ fi
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Prefix Base System release ${PV}" > "${ED}"/etc/gentoo-release
+
+ # FHS compatibility symlinks stuff
+ dosym /var/tmp /usr/tmp
+
+ # add a dummy to avoid Portage shebang errors
+ dodir sbin
+ cat > "${ED}"/sbin/runscript <<- EOF
+ #!/usr/bin/env sh
+ source "${EPREFIX}/lib/gentoo/functions.sh"
+
+ eerror "runscript not supported by Gentoo Prefix Base System release ${PV}" 1>&2
+ exit 1
+ EOF
+ chmod 755 "${ED}"/sbin/runscript || die
+}
+
+pkg_postinst() {
+ # Take care of the etc-update for the user
+ if [ -e "${EROOT}"/etc/._cfg0000_gentoo-release ] ; then
+ mv "${EROOT}"/etc/._cfg0000_gentoo-release "${EROOT}"/etc/gentoo-release
+ fi
+
+ # baselayout leaves behind a lot of .keep files, so let's clean them up
+ find "${EROOT}"/lib/rcscripts/ -name .keep -exec rm -f {} + 2>/dev/null
+ find "${EROOT}"/lib/rcscripts/ -depth -type d -exec rmdir {} + 2>/dev/null
+}
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-aix.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-aix.patch
new file mode 100644
index 000000000000..ebc162345a52
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-aix.patch
@@ -0,0 +1,110 @@
+W00T, AIX does have /proc filesystem - even with slightly different layout.
+
+--- src/start-stop-daemon.c
++++ src/start-stop-daemon.c
+@@ -56,6 +56,8 @@
+ # define OSNetBSD
+ #elif defined(__APPLE__)
+ # define OSDarwin
++#elif defined(_AIX)
++# define OSaix
+ #else
+ # error Unknown architecture - cannot build start-stop-daemon
+ #endif
+@@ -85,6 +87,10 @@
+ #include <sys/pstat.h>
+ #endif
+
++#if defined(OSaix)
++#include <sys/procfs.h>
++#endif
++
+ #include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -178,7 +184,7 @@
+ static void do_pidfile(const char *name);
+ static void do_stop(int signal_nr, int quietmode,
+ int *n_killed, int *n_notkilled, int retry_nr);
+-#if defined(OSLinux) || defined(OShpux)
++#if defined(OSLinux) || defined(OShpux) || defined(OSaix)
+ static int pid_is_exec(pid_t pid, const struct stat *esb);
+ #endif
+
+@@ -755,7 +761,7 @@
+ static void
+ check(pid_t pid)
+ {
+-#if defined(OSLinux) || defined(OShpux)
++#if defined(OSLinux) || defined(OShpux) || defined(OSaix)
+ if (execname && !pid_is_exec(pid, &exec_stat))
+ return;
+ #elif defined(OSHURD) || defined(OSFreeBSD) || defined(OSNetBSD) || defined(OSDarwin)
+@@ -791,7 +797,7 @@
+ /* WTA: this needs to be an autoconf check for /proc/pid existance.
+ */
+
+-#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd)
++#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd) || defined(OSaix)
+ static void
+ do_procinit(void)
+ {
+@@ -1059,6 +1065,58 @@
+ }
+ #endif /* OShpux */
+
++#if defined(OSaix)
++/* max possible pid (signed long) in theory:
++ * 32bit: 2147483647 (10 digits)
++ * 64bit: 9223372036854775807 (19 digits)
++ */
++static int
++pid_is_exec(pid_t pid, const struct stat *esb)
++{
++ struct stat sb;
++ char buf[40];
++
++ sprintf(buf, "/proc/%ld/object/a.out", pid);
++ if (stat(buf, &sb) != 0)
++ return 0;
++ return (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino);
++}
++
++
++static int
++pid_is_user(pid_t pid, uid_t uid)
++{
++ struct stat sb;
++ char buf[32];
++
++ sprintf(buf, "/proc/%ld", pid);
++ if (stat(buf, &sb) != 0)
++ return 0;
++ return (sb.st_uid == uid);
++}
++
++
++static int
++pid_is_cmd(pid_t pid, const char *name)
++{
++ char buf[40];
++ FILE *f;
++ struct psinfo psi;
++ int r;
++
++ sprintf(buf, "/proc/%ld/psinfo", pid);
++ f = fopen(buf, "r");
++ if (!f)
++ return 0;
++ r = fread(&psi, sizeof(psi), 1, f);
++ fclose(f);
++ if (r != 1) {
++ return 0;
++ }
++ return strcmp(name, psi.pr_fname) == 0;
++}
++#endif /* OSaix */
++
+
+ static void
+ do_findprocs(void)
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-darwin-kvm.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-darwin-kvm.patch
new file mode 100644
index 000000000000..08668edff73e
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-darwin-kvm.patch
@@ -0,0 +1,22 @@
+http://bugs.gentoo.org/show_bug.cgi?id=360855
+
+by JTRiley
+
+--- baselayout-1.12.5/src/start-stop-daemon.c
++++ baselayout-1.12.5/src/start-stop-daemon.c
+@@ -73,10 +73,14 @@
+ #include <sys/types.h>
+
+ #include <err.h>
+-#include <kvm.h>
+ #include <limits.h>
+ #endif
+
++#if defined(OSOpenBSD) || defined(OSFreeBSD) || defined(OSNetBSD)
++#include <kvm.h>
++#endif
++
++
+ #if defined(OShpux)
+ #include <sys/param.h>
+ #include <sys/pstat.h>
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-gnulib.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-gnulib.patch
new file mode 100644
index 000000000000..dfb64c633206
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-gnulib.patch
@@ -0,0 +1,78 @@
+Need to add libraries after object files, or solaris
+linker might not see library's symbols to be needed
+when added to LDFLAGS.
+
+Take strndup from gnulib too, this decl breaks on Linux (#361417).
+
+VERSION is defined in gnulib's config.h.
+
+--- src/Makefile.orig 2011-03-30 13:15:56 +0200
++++ src/Makefile 2011-03-30 13:16:52 +0200
+@@ -30,10 +30,10 @@
+ $(CC) $(CFLAGS) -c -o $@ $^
+
+ runscript: runscript.o rs-misc.o
+- $(LD) $(LDFLAGS) -o $@ $^ $(LDFLAGS_RS)
++ $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_RS)
+
+ start-stop-daemon: start-stop-daemon.c
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDFLAGS_SSD)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS_SSD)
+
+ install: $(TARGET)
+ install -m 0755 -d $(DESTDIR)/bin
+--- src/core/misc.c.orig 2011-03-31 17:46:46 +0200
++++ src/core/misc.c 2011-03-31 17:47:03 +0200
+@@ -86,31 +86,6 @@
+ return new_path;
+ }
+
+-char *strndup(const char *str, size_t size) {
+- char *new_str = NULL;
+- size_t len;
+-
+- if (NULL == str) {
+- DBG_MSG("Invalid argument passed!\n");
+- errno = EINVAL;
+- return NULL;
+- }
+-
+- /* Check lenght of str without breaching the size limit */
+- for (len = 0;(len < size) && ('\0' != str[len]);len++);
+-
+- new_str = malloc(len + 1);
+- if (NULL == new_str) {
+- DBG_MSG("Failed to allocate buffer!\n");
+- return NULL;
+- }
+-
+- /* Make sure our string is NULL terminated */
+- new_str[len] = '\0';
+-
+- return (char *)memcpy(new_str, str, len);
+-}
+-
+ char *gbasename(const char *path) {
+ char *new_path = NULL;
+
+--- src/core/misc.h.orig 2011-03-31 17:46:43 +0200
++++ src/core/misc.h 2011-03-31 18:06:58 +0200
+@@ -246,8 +246,6 @@
+ * with the malloc() call. */
+ char *strcatpaths(const char *pathname1, const char *pathname2);
+
+-/* Compat functions for GNU extensions */
+-char *strndup(const char *str, size_t size);
+ /* Same as basename(3), but do not modify path */
+ char *gbasename(const char *path);
+
+--- src/start-stop-daemon.c.orig 2011-03-31 18:11:02 +0200
++++ src/start-stop-daemon.c 2011-03-31 18:11:03 +0200
+@@ -31,6 +31,7 @@
+ *
+ */
+
++#undef VERSION
+ #define VERSION "1.13.11+gentoo"
+
+ #define NONRETURNPRINTFFORMAT(x, y) \
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-bash.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-bash.patch
new file mode 100644
index 000000000000..095ce451c048
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-bash.patch
@@ -0,0 +1,18 @@
+diff -ru baselayout-1.12.5.orig/sbin/env-update.sh baselayout-1.12.5/sbin/env-update.sh
+--- baselayout-1.12.5.orig/sbin/env-update.sh 2010-08-17 12:56:00.968746729 +0200
++++ baselayout-1.12.5/sbin/env-update.sh 2010-08-17 12:56:47.185326760 +0200
+@@ -1,4 +1,4 @@
+-#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
++#! /usr/bin/env bash
+ # Copyright 1999-2004 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+
+diff -ru baselayout-1.12.5.orig/sbin/runscript.sh baselayout-1.12.5/sbin/runscript.sh
+--- baselayout-1.12.5.orig/sbin/runscript.sh 2010-08-17 12:56:00.968746729 +0200
++++ baselayout-1.12.5/sbin/runscript.sh 2010-08-17 12:56:58.362098849 +0200
+@@ -1,4 +1,4 @@
+-#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
++#! /usr/bin/env bash
+ # Copyright 1999-2006 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-eprefix.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-eprefix.patch
new file mode 100644
index 000000000000..28d8039be1b7
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-eprefix.patch
@@ -0,0 +1,25 @@
+diff -ru baselayout-1.12.5.orig/etc/profile baselayout-1.12.5/etc/profile
+--- baselayout-1.12.5.orig/etc/profile 2009-11-27 15:27:58 +0100
++++ baselayout-1.12.5/etc/profile 2009-11-27 15:34:14 +0100
+@@ -137,6 +137,21 @@
+ done
+ fi
+
++#
++# final finally set EPREFIX to our prefix if we don't have a local portage. this
++# was previously done by the startprefix script, but we want to be able to start
++# this environment by simply sourcing etc/profile with the correct shell.
++#
++if [[ -z "${EPREFIX}" ]]; then
++ if [[ ! -x "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/emerge ]]; then
++ export EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
++ fi
++elif [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" ]]; then
++ echo "WARNING: EPREFIX is set from environment to \"${EPREFIX}\"."
++ echo " You are entering the prefix \"@GENTOO_PORTAGE_EPREFIX@\"."
++ echo " Having EPREFIX set this way will probably render this environment unusable."
++fi
++
+ unset _ro_root
+ unset _ro_deps
+ unset _ro_chained_path_vars
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-pkgconfig.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-pkgconfig.patch
new file mode 100644
index 000000000000..b0d7e79e26e1
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-pkgconfig.patch
@@ -0,0 +1,16 @@
+diff -ru baselayout-1.12.5.orig/etc/profile baselayout-1.12.5/etc/profile
+--- baselayout-1.12.5.orig/etc/profile 2009-07-14 09:48:59 +0200
++++ baselayout-1.12.5/etc/profile 2009-07-14 09:50:48 +0200
+@@ -30,8 +30,11 @@
+ if [[ -n "${_ro_root}" ]]; then
+ _ro_chained_path_vars="PATH MANPATH"
+
+- [[ ${_ro_deps} == *RDEPEND* ]] &&
++ if [[ ${_ro_deps} == *RDEPEND* ]]; then
+ _ro_chained_path_vars="${_ro_chained_path_vars} PKG_CONFIG_PATH"
++ else
++ unset PKG_CONFIG_PATH
++ fi
+
+ for var in ${_ro_chained_path_vars}; do
+ eval "_ro_backupenv_paths_${var}=\${${var}}"
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-prompt.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-prompt.patch
new file mode 100644
index 000000000000..eb7a4ab1ff58
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-prompt.patch
@@ -0,0 +1,58 @@
+diff -ru baselayout-1.12.5.orig/etc/profile baselayout-1.12.5/etc/profile
+--- baselayout-1.12.5.orig/etc/profile 2009-12-09 13:48:07 +0100
++++ baselayout-1.12.5/etc/profile 2009-12-09 13:54:52 +0100
+@@ -110,9 +110,34 @@
+ # it in the user's dot-files), but it shouldn't make any
+ # difference.
+ . "@GENTOO_PORTAGE_EPREFIX@"/etc/bash/bashrc
++ elif [ -n "${_ro_root}" ]; then
++ # We're in a prefix chain, but have no local bash. we rely on bash
++ # beeing there _somewhere_ in the chain, so we do not need to set
++ # PS1 explicitly.
++ if [ -z "${PS1}" ]; then
++ # try harder to find something in the parent prefix of the chain.
++ # dont bother to search multiple chain members up to the top.
++ if [ -f "${_ro_root}/etc/bash/bashrc" ]; then
++ . "${_ro_root}/etc/bash/bashrc"
++ fi
++ fi
+ else
+ PS1='\u@\h \w \$ '
+ fi
++
++ # Set the last dirpart of the current prefix somewhere
++ # in the prompt, so one immediately knows where he/she is.
++ if [ ${_ro_recursion_level} == 0 ]; then
++ # we're in the last prefix of the chain here.
++ _ro_name="@GENTOO_PORTAGE_EPREFIX@"
++ _ro_name="${_ro_name##*/}"
++
++ # use color only if the prompt already contains color escapes
++ case "${PS1}" in
++ *'\[\033['*'m\]'*) PS1="\[\033[01;36m\][${_ro_name}]\[\033[00m\] ${PS1}" ;;
++ *) PS1="[${_ro_name}] ${PS1}" ;;
++ esac
++ fi
+ else
+ # Setup a bland default prompt. Since this prompt should be useable
+ # on color and non-color terminals, as well as shells that don't
+@@ -120,6 +145,10 @@
+ PS1="`whoami`@`uname -n | cut -f1 -d.` \$ "
+ fi
+
++# when chaining prefixes, we want the prompt to be passed to the child too,
++# so we need to export it.
++export PS1
++
+ for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do
+ if [ -r "$sh" ] ; then
+ . "$sh"
+@@ -146,7 +175,7 @@
+ if [[ ! -x "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/emerge ]]; then
+ export EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+ fi
+-elif [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" ]]; then
++elif [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" && ${_ro_recursion_level} == 0 ]]; then
+ echo "WARNING: EPREFIX is set from environment to \"${EPREFIX}\"."
+ echo " You are entering the prefix \"@GENTOO_PORTAGE_EPREFIX@\"."
+ echo " Having EPREFIX set this way will probably render this environment unusable."
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch
new file mode 100644
index 000000000000..71883838e7bd
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining-recursion.patch
@@ -0,0 +1,33 @@
+diff -ru baselayout-1.12.5.orig/etc/profile baselayout-1.12.5/etc/profile
+--- baselayout-1.12.5.orig/etc/profile 2009-07-20 09:10:30 +0200
++++ baselayout-1.12.5/etc/profile 2009-07-20 09:49:01 +0200
+@@ -17,10 +17,29 @@
+ _ro_root=$(. "/tools/mduft/eprefix/preserved"/etc/make.conf && echo $READONLY_EPREFIX)
+ _ro_deps=${_ro_root#*:}
+ _ro_root=${_ro_root%:*}
++
++#
++# prevent dooming of _ro_* variables by recursing down the
++# profile chain, by backing the up, tagged by resursion depth.
++#
++
++[[ -z "${_ro_recursion_level}" ]] && _ro_recursion_level=0
++((++_ro_recursion_level))
++
++for _ro_backup_var in _ro_root _ro_deps; do
++ eval "_ro_b${_ro_recursion_level}_${_ro_backup_var}=\${${_ro_backup_var}}"
++done
++
+ if [ -n "${_ro_root}" -a -f "${_ro_root}"/etc/profile ]; then
+ . "${_ro_root}"/etc/profile
+ fi
+
++for _ro_backup_var in _ro_root _ro_deps; do
++ eval "${_ro_backup_var}=\${_ro_b${_ro_recursion_level}_${_ro_backup_var}}"
++done
++
++((--_ro_recursion_level))
++
+ #
+ # With prefix-chaining we want another set of variables that
+ # should be retained for all prefixes. for example it is ok
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining.patch
new file mode 100644
index 000000000000..f17d1bb39363
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-chaining.patch
@@ -0,0 +1,83 @@
+diff -ru baselayout-1.12.5.orig/etc/profile baselayout-1.12.5/etc/profile
+--- baselayout-1.12.5.orig/etc/profile 2009-03-24 08:18:37.000000000 +0100
++++ baselayout-1.12.5/etc/profile 2009-03-24 11:50:57.000000000 +0100
+@@ -4,6 +4,40 @@
+ # environment for login shells.
+ #
+
++#
++# for prefix-chaining, the very first thing to do is to load
++# the profiles for all chained instances above.
++#
++# TODO: is it safe in any case to shell source make.conf?
++# don't do any recursive expansion here. if the parent can
++# use READONLY_EPREFIX's, it has to have the same profile as
++# we have here, and thus it will source parents before
++# evaluating anything from itself.
++#
++_ro_root=$(. "@GENTOO_PORTAGE_EPREFIX@"/etc/make.conf && echo $READONLY_EPREFIX)
++_ro_deps=${_ro_root#*:}
++_ro_root=${_ro_root%:*}
++if [ -n "${_ro_root}" -a -f "${_ro_root}"/etc/profile ]; then
++ . "${_ro_root}"/etc/profile
++fi
++
++#
++# With prefix-chaining we want another set of variables that
++# should be retained for all prefixes. for example it is ok
++# to retain PKG_CONFIG_PATH if the parent of the chain can
++# be used to resolve RDEPEND...
++#
++if [[ -n "${_ro_root}" ]]; then
++ _ro_chained_path_vars="PATH MANPATH"
++
++ [[ ${_ro_deps} == *RDEPEND* ]] &&
++ _ro_chained_path_vars="${_ro_chained_path_vars} PKG_CONFIG_PATH"
++
++ for var in ${_ro_chained_path_vars}; do
++ eval "_ro_backupenv_paths_${var}=\${${var}}"
++ done
++fi
++
+ # Load environment settings from profile.env, which is created by
+ # env-update from the files in /etc/env.d
+ if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then
+@@ -21,10 +55,17 @@
+ # It is intentional in the following line to use || instead of -o.
+ # This way the evaluation can be short-circuited and calling whoami is
+ # avoided.
++#
++# system directories are only appended if this prefix is the last
++# one in a chain of prefixes (or the only prefix in the chain), so
++# that they don't end up in the middle of multiple different prefix
++# paths (profile is recursive now, see above!)
+ if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
+- PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin"
++ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}"
++ [[ -z "${_ro_root}" ]] && PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin"
+ else
+- PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin"
++ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}"
++ [[ -z "${_ro_root}" ]] && PATH="$PATH:/usr/bin:/bin"
+ fi
+ export PATH
+ unset ROOTPATH
+@@ -63,3 +104,18 @@
+ fi
+ done
+ unset sh
++
++#
++# finally chain the save variables for previous prefixes in the chain.
++#
++if [[ -n "${_ro_chained_path_vars}" ]]; then
++ for var in ${_ro_chained_path_vars}; do
++ eval "export ${var}=\${${var}}:\${_ro_backupenv_paths_${var}}"
++ eval "unset _ro_backupenv_paths_${var}"
++ done
++fi
++
++unset _ro_root
++unset _ro_deps
++unset _ro_chained_path_vars
++
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-no-consoletype.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-no-consoletype.patch
new file mode 100644
index 000000000000..442dea3543ed
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-no-consoletype.patch
@@ -0,0 +1,11 @@
+--- baselayout-1.12.5/src/Makefile 2007-10-17 21:22:08 +0400
++++ baselayout-1.12.5/src/Makefile 2007-10-17 21:22:23 +0400
+@@ -9,7 +9,7 @@
+ LIBDIR = lib
+
+ BIN_TARGETS =
+-SBIN_TARGETS = consoletype runscript start-stop-daemon
++SBIN_TARGETS = runscript start-stop-daemon
+ SYS_WHITELIST = env_whitelist
+
+ TARGET = $(BIN_TARGETS) $(SBIN_TARGETS)
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-pidof.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-pidof.patch
new file mode 100644
index 000000000000..0a592cc59494
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-pidof.patch
@@ -0,0 +1,11 @@
+--- baselayout-1.12.5/sbin/rc-daemon.sh 2007-10-18 19:15:34 +0400
++++ baselayout-1.12.5/sbin/rc-daemon.sh 2007-10-18 19:20:32 +0400
+@@ -186,7 +186,7 @@
+ args="${args} '"${arg}"'"
+ done
+
+- eval /bin/pidof -x ${args}
++ eval @GENTOO_PORTAGE_EPREFIX@/bin/pidof -x ${args}
+ }
+
+ # bool is_daemon_running(char* cmd, char* pidfile)
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-sh.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-sh.patch
new file mode 100644
index 000000000000..a1f45939f2a1
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-sh.patch
@@ -0,0 +1,226 @@
+diff -ur sbin/rc-daemon.sh @GENTOO_PORTAGE_EPREFIX@/lib/rcscripts/sh/rc-daemon.sh
+--- baselayout-1.12.5/sbin/rc-daemon.sh 2006-09-14 14:11:34 +0400
++++ baselayout-1.12.5/sbin/rc-daemon.sh 2007-10-18 01:20:10 +0400
+@@ -226,7 +229,7 @@
+ # We don't do anyting fancy - just pass the given options
+ # to start-stop-daemon and return the value
+ rc_start_daemon() {
+- eval /sbin/start-stop-daemon "${args}"
++ eval @GENTOO_PORTAGE_EPREFIX@/sbin/start-stop-daemon "${args}"
+ local retval="$?"
+
+ [[ ${retval} != "0" ]] && return "${retval}"
+@@ -365,7 +368,7 @@
+
+ # We pass --oknodo and --test directly to start-stop-daemon and return
+ if ${nothing}; then
+- eval /sbin/start-stop-daemon "${args}"
++ eval @GENTOO_PORTAGE_EPREFIX@/sbin/start-stop-daemon "${args}"
+ return "$?"
+ fi
+
+diff -ur sbin/rc-services.sh @GENTOO_PORTAGE_EPREFIX@/lib/rcscripts/sh/rc-services.sh
+--- baselayout-1.12.5/sbin/rc-services.sh 2006-09-14 14:11:34 +0400
++++ baselayout-1.12.5/sbin/rc-services.sh 2007-10-18 01:25:55 +0400
+@@ -8,9 +8,9 @@
+
+ if [[ ${RC_GOT_DEPTREE_INFO} != "yes" ]] ; then
+ # Only try and update if we are root
+- if [[ ${EUID} == "0" ]] && ! /sbin/depscan.sh ; then
++ if [[ ${EUID} == "0" ]] && ! @GENTOO_PORTAGE_EPREFIX@/sbin/depscan.sh ; then
+ echo
+- eerror "Error running '/sbin/depscan.sh'!"
++ eerror "Error running '@GENTOO_PORTAGE_EPREFIX@/sbin/depscan.sh'!"
+ eerror "Please correct any problems above."
+ exit 1
+ fi
+@@ -19,7 +19,7 @@
+ if [[ ${RC_GOT_DEPTREE_INFO} != "yes" ]] ; then
+ echo
+ eerror "Dependency info is missing! Please run"
+- eerror " # /sbin/depscan.sh"
++ eerror " # @GENTOO_PORTAGE_EPREFIX@/sbin/depscan.sh"
+ eerror "to fix this."
+ exit 1
+ fi
+@@ -134,7 +134,7 @@
+ if ! get_dep_info "${myservice}" >/dev/null ; then
+ eerror "Could not get dependency info for ${myservice}!" > /dev/stderr
+ eerror "Please run:" > /dev/stderr
+- eerror " # /sbin/depscan.sh" > /dev/stderr
++ eerror " # @GENTOO_PORTAGE_EPREFIX@/sbin/depscan.sh" > /dev/stderr
+ eerror "to try and fix this." > /dev/stderr
+ return 1
+ fi
+@@ -212,11 +212,11 @@
+
+ [[ -z $1 || -z $2 ]] && return 1
+
+- [[ $2 != "${BOOTLEVEL}" && -e /etc/runlevels/"${BOOTLEVEL}"/.fake ]] && \
+- fake_services="$( < /etc/runlevels/"${BOOTLEVEL}"/.fake )"
++ [[ $2 != "${BOOTLEVEL}" && -e @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/"${BOOTLEVEL}"/.fake ]] && \
++ fake_services="$( < @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/"${BOOTLEVEL}"/.fake )"
+
+- [[ -e /etc/runlevels/"$2"/.fake ]] && \
+- fake_services="${fake_services} $( < /etc/runlevels/"$2"/.fake )"
++ [[ -e @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/"$2"/.fake ]] && \
++ fake_services="${fake_services} $( < @GENTOO_PORTAGE_EPREFIX@/etc/runlevels/"$2"/.fake )"
+
+ for x in ${fake_services} ; do
+ [[ $1 == "${x##*/}" ]] && return 0
+@@ -232,7 +232,7 @@
+ in_runlevel() {
+ [[ -z $1 || -z $2 ]] && return 1
+
+- [[ -L "/etc/runlevels/$2/$1" ]] && return 0
++ [[ -L "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/$2/$1" ]] && return 0
+
+ return 1
+ }
+@@ -385,7 +385,7 @@
+ local service="$1"
+ [[ -z ${service} ]] && return 1
+
+- if [[ ! -e "/etc/init.d/${service}" ]] ; then
++ if [[ ! -e "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" ]] ; then
+ mark_service_stopped "${service}"
+ return 1
+ fi
+@@ -408,8 +408,8 @@
+ # if we can not start the services in parallel
+ # then just start it and return the exit status
+ (
+- profiling name "/etc/init.d/${service} start"
+- "/etc/init.d/${service}" start
++ profiling name "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service} start"
++ "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" start
+ )
+
+ service_started "${service}" || service_inactive "${service}" \
+@@ -423,8 +423,8 @@
+ else
+ # if parallel startup is allowed, start it in background
+ (
+- profiling name "/etc/init.d/${service} start"
+- "/etc/init.d/${service}" start
++ profiling name "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service} start"
++ "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" start
+
+ service_started "${service}" || service_inactive "${service}" \
+ || service_scheduled "${service}"
+@@ -445,7 +445,7 @@
+ local service="$1"
+ [[ -z ${service} ]] && return 1
+
+- if [[ ! -e "/etc/init.d/${service}" ]] ; then
++ if [[ ! -e "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" ]] ; then
+ mark_service_stopped "${service}"
+ return 0
+ fi
+@@ -470,7 +470,7 @@
+ ${STOP_CRITICAL} == "yes" ]] ; then
+ # if we can not start the services in parallel
+ # then just start it and return the exit status
+- ( "/etc/init.d/${service}" stop )
++ ( "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" stop )
+ service_stopped "${service}"
+ retval=$?
+ end_service "${service}" "${retval}"
+@@ -479,7 +479,7 @@
+ else
+ # if parallel startup is allowed, start it in background
+ (
+- ( "/etc/init.d/${service}" stop )
++ ( "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" stop )
+ service_stopped "${service}"
+ retval=$?
+ end_service "${service}" "${retval}"
+@@ -496,7 +496,7 @@
+ mark_service_coldplugged() {
+ [[ -z $1 ]] && return 1
+
+- ln -snf "/etc/init.d/$1" "${svcdir}/coldplugged/$1"
++ ln -snf "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/$1" "${svcdir}/coldplugged/$1"
+ return 0
+ }
+
+@@ -507,7 +507,7 @@
+ mark_service_starting() {
+ [[ -z $1 ]] && return 1
+
+- ln -sn "/etc/init.d/$1" "${svcdir}/starting/$1" 2>/dev/null || return 1
++ ln -sn "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/$1" "${svcdir}/starting/$1" 2>/dev/null || return 1
+
+ [[ -f "${svcdir}/started/$1" ]] && rm -f "${svcdir}/started/$1"
+ [[ -f "${svcdir}/inactive/$1" ]] \
+@@ -522,7 +522,7 @@
+ mark_service_started() {
+ [[ -z $1 ]] && return 1
+
+- ln -snf "/etc/init.d/$1" "${svcdir}/started/$1"
++ ln -snf "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/$1" "${svcdir}/started/$1"
+
+ rm -f "${svcdir}/starting/$1" "${svcdir}/inactive/$1" \
+ "${svcdir}/wasinactive/$1" "${svcdir}/stopping/$1" \
+@@ -538,7 +538,7 @@
+ mark_service_inactive() {
+ [[ -z $1 ]] && return 1
+
+- ln -snf "/etc/init.d/$1" "${svcdir}/inactive/$1"
++ ln -snf "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/$1" "${svcdir}/inactive/$1"
+
+ rm -f "${svcdir}/started/$1" "${svcdir}/wasinactive/$1" \
+ "${svcdir}/starting/$1" "${svcdir}/stopping/$1"
+@@ -553,7 +553,7 @@
+ mark_service_stopping() {
+ [[ -z $1 ]] && return 1
+
+- ln -sn "/etc/init.d/$1" "${svcdir}/stopping/$1" 2>/dev/null || return 1
++ ln -sn "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/$1" "${svcdir}/stopping/$1" 2>/dev/null || return 1
+
+ rm -f "${svcdir}/started/$1"
+ [[ -f "${svcdir}/inactive/$1" ]] \
+@@ -690,7 +691,7 @@
+ mark_service_failed() {
+ [[ -z $1 || ! -d "${svcdir}/failed" ]] && return 1
+
+- ln -snf "/etc/init.d/$1" "${svcdir}/failed/$1"
++ ln -snf "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/$1" "${svcdir}/failed/$1"
+ }
+
+ # bool service_failed(service)
+@@ -744,8 +745,8 @@
+ return $?
+ ;;
+ yes)
+- for x in $(dolisting "/etc/runlevels/${BOOTLEVEL}/net.*") \
+- $(dolisting "/etc/runlevels/${SOFTLEVEL}/net.*") ; do
++ for x in $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}/net.*") \
++ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${SOFTLEVEL}/net.*") ; do
+ local y="${x##*/}"
+ [[ ${y} == "$1" ]] && return 1
+ service_started "${y}" || return 1
+@@ -785,8 +786,8 @@
+ [[ -f "${svcdir}/softlevel" ]] && mylevel=$( < "${svcdir}/softlevel" )
+
+ for x in $( i$1 "$2" ) ; do
+- [[ -e "/etc/runlevels/${BOOTLEVEL}/${x}" || \
+- -e "/etc/runlevels/${mylevel}/${x}" || \
++ [[ -e "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}/${x}" || \
++ -e "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${mylevel}/${x}" || \
+ ${x} == "net" ]] \
+ && valid="${valid} ${x}"
+ done
+@@ -836,9 +837,9 @@
+ net_services="${net_services} ${x##*/}"
+ done
+ else
+- for x in $(dolisting "/etc/runlevels/${BOOTLEVEL}/net.*") \
+- $(dolisting "/etc/runlevels/${SOFTLEVEL}/net.*") \
+- $(dolisting "/etc/runlevels/coldplugged/net.*") ; do
++ for x in $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}/net.*") \
++ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${SOFTLEVEL}/net.*") \
++ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/coldplugged/net.*") ; do
+ net_services="${net_services} ${x##*/}"
+ done
+ fi
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-src.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-src.patch
new file mode 100644
index 000000000000..a6ee5dbf3032
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix-src.patch
@@ -0,0 +1,102 @@
+--- baselayout-1.12.5/src/runscript.c 2007-10-17 21:11:10 +0400
++++ baselayout-1.12.5/src/runscript.c 2007-10-17 21:13:56 +0400
+@@ -22,16 +22,16 @@
+ # define LIBDIR "lib"
+ #endif
+
+-#define SBIN_RC "/sbin/rc"
+-#define PROFILE_ENV "/etc/profile.env"
+-#define RCSCRIPTS_LIB "/" LIBDIR "/rcscripts"
++#define SBIN_RC "@GENTOO_PORTAGE_EPREFIX@/sbin/rc"
++#define PROFILE_ENV "@GENTOO_PORTAGE_EPREFIX@/etc/profile.env"
++#define RCSCRIPTS_LIB "@GENTOO_PORTAGE_EPREFIX@/" LIBDIR "/rcscripts"
+ #define SYS_WHITELIST RCSCRIPTS_LIB "/conf.d/env_whitelist"
+-#define USR_WHITELIST "/etc/conf.d/env_whitelist"
++#define USR_WHITELIST "@GENTOO_PORTAGE_EPREFIX@/etc/conf.d/env_whitelist"
+ #define RCSCRIPT_HELP RCSCRIPTS_LIB "/sh/rc-help.sh"
+ #define SELINUX_LIB RCSCRIPTS_LIB "/runscript_selinux.so"
+ #define SOFTLEVEL "SOFTLEVEL"
+
+-#define DEFAULT_PATH "PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin"
++#define DEFAULT_PATH "PATH=@GENTOO_PORTAGE_EPREFIX@/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/local/sbin"
+
+ #define IS_SBIN_RC() (0 == strcmp(caller, SBIN_RC))
+
+@@ -217,7 +217,7 @@
+ int new = 1;
+
+ /* Need to be /bin/bash, else BASH is invalid */
+- myargs[0] = "/bin/bash";
++ myargs[0] = "@GENTOO_PORTAGE_EPREFIX@/bin/bash";
+ while (argv[new] != 0) {
+ myargs[new] = argv[new];
+ new++;
+@@ -243,10 +243,10 @@
+ setup_selinux(argc, argv);
+
+ if (!IS_SBIN_RC()) {
+- if (execve("/sbin/runscript.sh", myargs, myenv) < 0)
++ if (execve("@GENTOO_PORTAGE_EPREFIX@/sbin/runscript.sh", myargs, myenv) < 0)
+ exit(1);
+ } else {
+- if (execve("/bin/bash", myargs, myenv) < 0)
++ if (execve("@GENTOO_PORTAGE_EPREFIX@/bin/bash", myargs, myenv) < 0)
+ exit(1);
+ }
+
+diff -ur ./sbin/depscan.sh /Users/dirk/src@GENTOO_PORTAGE_EPREFIX@/sbin/depscan.sh
+--- baselayout-1.12.5/sbin/depscan.sh 2007-10-17 21:26:21 +0400
++++ baselayout-1.12.5/sbin/depscan.sh 2007-10-17 18:58:23 +0400
+@@ -7,7 +7,7 @@
+ fi
+
+ argv0=${0##*/}
+-source /etc/init.d/functions.sh || {
++source @GENTOO_PORTAGE_EPREFIX@/etc/init.d/functions.sh || {
+ echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2
+ exit 1
+ }
+@@ -89,7 +91,7 @@
+ fi
+
+ touch "${mtime_test}"
+- for config in /etc/conf.d/* /etc/init.d/* /etc/rc.conf
++ for config in @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/* @GENTOO_PORTAGE_EPREFIX@/etc/init.d/* @GENTOO_PORTAGE_EPREFIX@/etc/rc.conf
+ do
+ ! ${update} \
+ && is_older_than "${mysvcdir}/depcache" "${config}" \
+@@ -104,7 +106,7 @@
+ rm -f "${mtime_test}"
+
+ if [[ ${clock_screw} == 1 ]] ; then
+- ewarn "One of the files in /etc/{conf.d,init.d} or /etc/rc.conf"
++ ewarn "One of the files in @GENTOO_PORTAGE_EPREFIX@/etc/{conf.d,init.d} or @GENTOO_PORTAGE_EPREFIX@/etc/rc.conf"
+ ewarn "has a modification time in the future!"
+ fi
+
+@@ -125,17 +127,17 @@
+
+ export SVCDIR DEPTYPES ORDTYPES
+
+-cd /etc/init.d
++cd @GENTOO_PORTAGE_EPREFIX@/etc/init.d
+
+-/bin/gawk \
+- -f /lib/rcscripts/awk/functions.awk \
+- -f /lib/rcscripts/awk/cachedepends.awk || \
++@GENTOO_PORTAGE_EPREFIX@/bin/gawk \
++ -f @GENTOO_PORTAGE_EPREFIX@/lib/rcscripts/awk/functions.awk \
++ -f @GENTOO_PORTAGE_EPREFIX@/lib/rcscripts/awk/cachedepends.awk || \
+ retval=1
+
+-bash "${mysvcdir}/depcache" | \
+-/bin/gawk \
+- -f /lib/rcscripts/awk/functions.awk \
+- -f /lib/rcscripts/awk/gendepends.awk || \
++@GENTOO_PORTAGE_EPREFIX@/bin/bash "${mysvcdir}/depcache" | \
++@GENTOO_PORTAGE_EPREFIX@/bin/gawk \
++ -f @GENTOO_PORTAGE_EPREFIX@/lib/rcscripts/awk/functions.awk \
++ -f @GENTOO_PORTAGE_EPREFIX@/lib/rcscripts/awk/gendepends.awk || \
+ retval=1
+
+ touch "${mysvcdir}"/dep{cache,tree}
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix.patch
new file mode 100644
index 000000000000..3394a323a07a
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-prefix.patch
@@ -0,0 +1,409 @@
+--- baselayout-1.12.5/etc/env.d/00basic
++++ baselayout-1.12.5/etc/env.d/00basic
+@@ -1,10 +1,11 @@
+-# /etc/env.d/00basic
++# @GENTOO_PORTAGE_EPREFIX@/etc/env.d/00basic
+
+-PATH="/opt/bin"
+-ROOTPATH="/opt/bin"
+-LDPATH="/usr/local/lib"
+-MANPATH="/usr/local/share/man:/usr/share/man"
+-INFOPATH="/usr/share/info"
++# in prefix we have sbin variants in user path!
++PATH="@GENTOO_PORTAGE_EPREFIX@/opt/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/sbin"
++ROOTPATH="@GENTOO_PORTAGE_EPREFIX@/opt/bin"
++LDPATH="@GENTOO_PORTAGE_EPREFIX@/usr/local/lib"
++MANPATH="@GENTOO_PORTAGE_EPREFIX@/usr/share/man"
++INFOPATH="@GENTOO_PORTAGE_EPREFIX@/usr/share/info"
+ CVS_RSH="ssh"
+-PAGER="/usr/bin/less"
++PAGER="@GENTOO_PORTAGE_EPREFIX@/usr/bin/less"
+ LESSOPEN="|lesspipe.sh %s"
+--- baselayout-1.12.5/sbin/env-update.sh
++++ baselayout-1.12.5/sbin/env-update.sh
+@@ -1,10 +1,10 @@
+-#!/bin/bash
++#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+ # Copyright 1999-2004 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+
+-source /sbin/functions.sh || exit 1
++source "@GENTOO_PORTAGE_EPREFIX@"/sbin/functions.sh || exit 1
+
+-if [[ ${EUID} != "0" ]] ; then
++if [[ ${EPREFIX/\//} == "" ]] && [[ ${EUID} != "0" ]] ; then
+ eerror "$0: must be root."
+ exit 1
+ fi
+@@ -13,8 +13,8 @@
+ echo "usage: env-update.sh
+
+ note:
+- This utility generates /etc/profile.env and /etc/csh.env
+- from the contents of /etc/env.d/
++ This utility generates @GENTOO_PORTAGE_EPREFIX@/etc/profile.env and @GENTOO_PORTAGE_EPREFIX@/etc/csh.env
++ from the contents of @GENTOO_PORTAGE_EPREFIX@/etc/env.d/
+ "
+ exit 1
+ }
+@@ -30,9 +30,9 @@
+ if [[ $# != "0" ]] ; then
+ usage
+ else
+- /bin/gawk \
+- -f /lib/rcscripts/awk/functions.awk \
+- -f /lib/rcscripts/awk/genenviron.awk
++ "@GENTOO_PORTAGE_EPREFIX@"/bin/gawk \
++ -f "@GENTOO_PORTAGE_EPREFIX@"/lib/rcscripts/awk/functions.awk \
++ -f "@GENTOO_PORTAGE_EPREFIX@"/lib/rcscripts/awk/genenviron.awk
+ fi
+
+ # vim:ts=4
+--- baselayout-1.12.5/sbin/functions.sh
++++ baselayout-1.12.5/sbin/functions.sh
+@@ -4,11 +4,11 @@
+ RC_GOT_FUNCTIONS="yes"
+
+ # Override defaults with user settings ...
+-[[ -f /etc/conf.d/rc ]] && source /etc/conf.d/rc
++[[ -f @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/rc ]] && source "@GENTOO_PORTAGE_EPREFIX@"/etc/conf.d/rc
+
+ # Check /etc/conf.d/rc for a description of these ...
+-declare -r svclib="/lib/rcscripts"
+-declare -r svcdir="${svcdir:-/var/lib/init.d}"
++declare -r svclib="@GENTOO_PORTAGE_EPREFIX@/lib/rcscripts"
++declare -r svcdir="${svcdir:-@GENTOO_PORTAGE_EPREFIX@/var/lib/init.d}"
+ svcmount="${svcmount:-no}"
+ svcfstype="${svcfstype:-tmpfs}"
+ svcsize="${svcsize:-1024}"
+@@ -83,7 +84,7 @@
+ }
+ # This will override the splash() function...
+ if ! import_addon splash-functions.sh ; then
+- [[ -f /sbin/splash-functions.sh ]] && source /sbin/splash-functions.sh
++ [[ -f @GENTOO_PORTAGE_EPREFIX@/sbin/splash-functions.sh ]] && source "@GENTOO_PORTAGE_EPREFIX@"/sbin/splash-functions.sh
+ fi
+
+ # void profiling(...)
+@@ -114,8 +115,8 @@
+ local newbootlevel=
+ local newsoftlevel=
+
+- if [[ -r /proc/cmdline ]] ; then
+- for copt in $(</proc/cmdline) ; do
++ if [[ -r @GENTOO_PORTAGE_EPREFIX@/proc/cmdline ]] ; then
++ for copt in $(<"@GENTOO_PORTAGE_EPREFIX@"/proc/cmdline) ; do
+ case "${copt%=*}" in
+ bootlevel)
+ newbootlevel="${copt##*=}"
+@@ -153,8 +154,8 @@
+ fi
+
+ if [[ ${RC_USE_CONFIG_PROFILE} == "yes" && -n ${DEFAULTLEVEL} ]] && \
+- [[ -d "/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" || \
+- -L "/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" ]] ; then
++ [[ -d "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" || \
++ -L "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}.${DEFAULTLEVEL}" ]] ; then
+ export BOOTLEVEL="${BOOTLEVEL}.${DEFAULTLEVEL}"
+ fi
+
+@@ -176,8 +177,8 @@
+ get_libdir() {
+ if [[ -n ${CONF_LIBDIR_OVERRIDE} ]] ; then
+ CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}"
+- elif [[ -x /usr/bin/portageq ]] ; then
+- CONF_LIBDIR="$(/usr/bin/portageq envvar CONF_LIBDIR)"
++ elif [[ -x @GENTOO_PORTAGE_EPREFIX@/usr/bin/portageq ]] ; then
++ CONF_LIBDIR="$("@GENTOO_PORTAGE_EPREFIX@"/usr/bin/portageq envvar CONF_LIBDIR)"
+ fi
+ echo "${CONF_LIBDIR:=lib}"
+ }
+@@ -190,14 +191,14 @@
+ local pri=
+ local tag=
+
+- if [[ -x /usr/bin/logger ]] ; then
++ if [[ -x @GENTOO_PORTAGE_EPREFIX@/usr/bin/logger ]] ; then
+ pri="$1"
+ tag="$2"
+
+ shift 2
+ [[ -z "$*" ]] && return 0
+
+- /usr/bin/logger -p "${pri}" -t "${tag}" -- "$*"
++ "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/logger -p "${pri}" -t "${tag}" -- "$*"
+ fi
+
+ return 0
+@@ -269,7 +270,7 @@
+ fi
+
+ local name="rc-scripts"
+- [[ $0 != "/sbin/runscript.sh" ]] && name="${0##*/}"
++ [[ $0 != "@GENTOO_PORTAGE_EPREFIX@/sbin/runscript.sh" ]] && name="${0##*/}"
+ # Log warnings to system log
+ esyslog "daemon.warning" "${name}" "$*"
+
+@@ -290,7 +291,7 @@
+ fi
+
+ local name="rc-scripts"
+- [[ $0 != "/sbin/runscript.sh" ]] && name="${0##*/}"
++ [[ $0 != "@GENTOO_PORTAGE_EPREFIX@/sbin/runscript.sh" ]] && name="${0##*/}"
+ # Log errors to system log
+ esyslog "daemon.err" "rc-scripts" "$*"
+
+@@ -488,9 +489,9 @@
+ get_bootparam() {
+ local x copt params retval=1
+
+- [[ ! -r /proc/cmdline ]] && return 1
++ [[ ! -r @GENTOO_PORTAGE_EPREFIX@/proc/cmdline ]] && return 1
+
+- for copt in $(< /proc/cmdline) ; do
++ for copt in $(< "@GENTOO_PORTAGE_EPREFIX@"/proc/cmdline) ; do
+ if [[ ${copt%=*} == "gentoo" ]] ; then
+ params=$(gawk -v PARAMS="${copt##*=}" '
+ BEGIN {
+@@ -583,8 +584,8 @@
+ # get the version of baselayout that this system is running
+ #
+ get_base_ver() {
+- [[ ! -r /etc/gentoo-release ]] && return 0
+- local ver="$(</etc/gentoo-release)"
++ [[ ! -r @GENTOO_PORTAGE_EPREFIX@/etc/gentoo-release ]] && return 0
++ local ver="$(<"@GENTOO_PORTAGE_EPREFIX@"/etc/gentoo-release)"
+ echo "${ver##* }"
+ }
+
+@@ -602,8 +603,8 @@
+ is_net_fs() {
+ local fstype
+ # /proc/mounts is always accurate but may not always be available
+- if [[ -e /proc/mounts ]] ; then
+- fstype="$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' /proc/mounts )"
++ if [[ -e @GENTOO_PORTAGE_EPREFIX@/proc/mounts ]] ; then
++ fstype="$( sed -n -e '/^rootfs/!s:.* '"$1"' \([^ ]*\).*:\1:p' "@GENTOO_PORTAGE_EPREFIX@"/proc/mounts )"
+ else
+ fstype="$( mount | sed -n -e 's:.* on '"$1"' type \([^ ]*\).*:\1:p' )"
+ fi
+@@ -618,7 +619,7 @@
+ # EXAMPLE: if is_union_fs / ; then ...
+ #
+ is_union_fs() {
+- [[ ! -x /sbin/unionctl ]] && return 1
++ [[ ! -x @GENTOO_PORTAGE_EPREFIX@/sbin/unionctl ]] && return 1
+ unionctl "$1" --list &>/dev/null
+ }
+
+@@ -629,7 +630,7 @@
+ # EXAMPLE: if is_uml_sys ; then ...
+ #
+ is_uml_sys() {
+- grep -qs 'UML' /proc/cpuinfo
++ grep -qs 'UML' "@GENTOO_PORTAGE_EPREFIX@"/proc/cpuinfo
+ }
+
+ # bool is_vserver_sys()
+@@ -639,7 +640,7 @@
+ # EXAMPLE: if is_vserver_sys ; then ...
+ #
+ is_vserver_sys() {
+- grep -qs '^s_context:[[:space:]]*[1-9]' /proc/self/status
++ grep -qs '^s_context:[[:space:]]*[1-9]' "@GENTOO_PORTAGE_EPREFIX@"/proc/self/status
+ }
+
+ # bool is_xenU_sys()
+@@ -649,9 +650,9 @@
+ # EXAMPLE: if is_xenU_sys ; then ...
+ #
+ is_xenU_sys() {
+- [[ ! -d /proc/xen ]] && return 1
+- [[ ! -r /proc/xen/capabilities ]] && return 1
+- grep -q "control_d" /proc/xen/capabilities && return 1
++ [[ ! -d "@GENTOO_PORTAGE_EPREFIX@"/proc/xen ]] && return 1
++ [[ ! -r "@GENTOO_PORTAGE_EPREFIX@"/proc/xen/capabilities ]] && return 1
++ grep -q "control_d" "@GENTOO_PORTAGE_EPREFIX@"/proc/xen/capabilities && return 1
+ return 0
+ }
+
+@@ -667,7 +668,7 @@
+ gawk '$1 ~ "^#" { next }
+ $2 == "'$*'" { stab="-t "$3" -o "$4" "$1" "$2; }
+ END { print stab; }
+- ' /etc/fstab
++ ' "@GENTOO_PORTAGE_EPREFIX@"/etc/fstab
+ }
+
+ # char *reverse_list(list)
+@@ -771,13 +772,13 @@
+ # Setup a basic $PATH. Just add system default to existing.
+ # This should solve both /sbin and /usr/sbin not present when
+ # doing 'su -c foo', or for something like: PATH= rcscript start
+- PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:${PATH}"
++ PATH="@GENTOO_PORTAGE_EPREFIX@/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/local/sbin:${PATH}"
+
+ # Cache the CONSOLETYPE - this is important as backgrounded shells don't
+ # have a TTY. rc unsets it at the end of running so it shouldn't hang
+ # around
+ if [[ -z ${CONSOLETYPE} ]] ; then
+- export CONSOLETYPE="$( /sbin/consoletype 2>/dev/null )"
++ export CONSOLETYPE="$( "@GENTOO_PORTAGE_EPREFIX@"/sbin/consoletype 2>/dev/null )"
+ fi
+ if [[ ${CONSOLETYPE} == "serial" ]] ; then
+ RC_NOCOLOR="yes"
+@@ -797,7 +798,7 @@
+
+ # If we are not /sbin/rc then ensure that we cannot change level variables
+ if [[ -n ${BASH_SOURCE} \
+- && ${BASH_SOURCE[${#BASH_SOURCE[@]}-1]} != "/sbin/rc" ]] ; then
++ && ${BASH_SOURCE[${#BASH_SOURCE[@]}-1]} != "@GENTOO_PORTAGE_EPREFIX@/sbin/rc" ]] ; then
+ declare -r BOOTLEVEL DEFAULTLEVEL SOFTLEVEL
+ fi
+ else
+--- baselayout-1.12.5/etc/profile
++++ baselayout-1.12.5/etc/profile
+@@ -1,4 +1,4 @@
+-# /etc/profile: login shell setup
++# @GENTOO_PORTAGE_EPREFIX@/etc/profile: login shell setup
+ #
+ # That this file is used by any Bourne-shell derivative to setup the
+ # environment for login shells.
+@@ -6,8 +6,8 @@
+
+ # Load environment settings from profile.env, which is created by
+ # env-update from the files in /etc/env.d
+-if [ -e /etc/profile.env ] ; then
+- . /etc/profile.env
++if [ -e "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env ] ; then
++ . "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.env
+ fi
+
+ # 077 would be more secure, but 022 is generally quite realistic
+@@ -22,23 +22,23 @@
+ # This way the evaluation can be short-circuited and calling whoami is
+ # avoided.
+ if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
+- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
++ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/sbin:@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/sbin:@GENTOO_PORTAGE_EPREFIX@/bin:${ROOTPATH}:/usr/sbin:/usr/bin:/sbin:/bin"
+ else
+- PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
++ PATH="@GENTOO_PORTAGE_EPREFIX@/usr/bin:@GENTOO_PORTAGE_EPREFIX@/bin:${PATH}:/usr/bin:/bin"
+ fi
+ export PATH
+ unset ROOTPATH
+
+ # Extract the value of EDITOR
+-[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
+-[ -z "$EDITOR" ] && EDITOR="/bin/nano"
++[ -z "$EDITOR" ] && EDITOR="`. @GENTOO_PORTAGE_EPREFIX@/etc/rc.conf 2>/dev/null; echo $EDITOR`"
++[ -z "$EDITOR" ] && EDITOR="@GENTOO_PORTAGE_EPREFIX@/bin/nano"
+ export EDITOR
+
+ if [ -n "${BASH_VERSION}" ] ; then
+ # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
+ # including color. We leave out color here because not all
+ # terminals support it.
+- if [ -f /etc/bash/bashrc ] ; then
++ if [ -f "@GENTOO_PORTAGE_EPREFIX@"/etc/bash/bashrc ] ; then
+ # Bash login shells run only /etc/profile
+ # Bash non-login shells run only /etc/bash/bashrc
+ # Since we want to run /etc/bash/bashrc regardless, we source it
+@@ -46,7 +46,7 @@
+ # this *after* the user's .bash_profile runs (without putting
+ # it in the user's dot-files), but it shouldn't make any
+ # difference.
+- . /etc/bash/bashrc
++ . "@GENTOO_PORTAGE_EPREFIX@"/etc/bash/bashrc
+ else
+ PS1='\u@\h \w \$ '
+ fi
+@@ -57,7 +57,7 @@
+ PS1="`whoami`@`uname -n | cut -f1 -d.` \$ "
+ fi
+
+-for sh in /etc/profile.d/*.sh ; do
++for sh in "@GENTOO_PORTAGE_EPREFIX@"/etc/profile.d/*.sh ; do
+ if [ -r "$sh" ] ; then
+ . "$sh"
+ fi
+--- baselayout-1.12.5/sbin/runscript.sh~ 2006-09-14 12:11:34 +0200
++++ baselayout-1.12.5/sbin/runscript.sh 2007-10-06 13:28:40 +0200
+@@ -1,18 +1,18 @@
+-#!/bin/bash
++#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
+ # Copyright 1999-2006 Gentoo Foundation
+ # Distributed under the terms of the GNU General Public License v2
+
+ # Common functions
+-[[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source /sbin/functions.sh
++[[ ${RC_GOT_FUNCTIONS} != "yes" ]] && source @GENTOO_PORTAGE_EPREFIX@/sbin/functions.sh
+
+-# User must be root to run most script stuff (except status)
+-if [[ ${EUID} != "0" ]] && ! [[ $2 == "status" && $# -eq 2 ]] ; then
+- eerror "$0: must be root to run init scripts"
+- exit 1
+-fi
++## User must be root to run most script stuff (except status)
++#if [[ ${EUID} != "0" ]] && ! [[ $2 == "status" && $# -eq 2 ]] ; then
++# eerror "$0: must be root to run init scripts"
++# exit 1
++#fi
+
+ myscript="$1"
+-if [[ -L $1 && ! -L "/etc/init.d/${1##*/}" ]] ; then
++if [[ -L $1 && ! -L "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${1##*/}" ]] ; then
+ SVCNAME="$(readlink "$1")"
+ else
+ SVCNAME="$1"
+@@ -84,12 +84,12 @@
+ # configuration, if the system administrator chose to put it
+ # there (if it exists).
+ if net_service "${SVCNAME}" ; then
+- conf="$(add_suffix /etc/conf.d/net)"
++ conf="$(add_suffix @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/net)"
+ [[ -e ${conf} ]] && source "${conf}"
+ fi
+-conf="$(add_suffix "/etc/conf.d/${SVCNAME}")"
++conf="$(add_suffix "@GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${SVCNAME}")"
+ [[ -e ${conf} ]] && source "${conf}"
+-conf="$(add_suffix /etc/rc.conf)"
++conf="$(add_suffix @GENTOO_PORTAGE_EPREFIX@/etc/rc.conf)"
+ [[ -e ${conf} ]] && source "${conf}"
+
+ mylevel="${SOFTLEVEL}"
+@@ -146,7 +146,7 @@
+ local service="$1" start="$2"
+ [[ ! -d "${svcdir}/scheduled/${service}" ]] \
+ && mkdir -p "${svcdir}/scheduled/${service}"
+- ln -snf "/etc/init.d/${service}" \
++ ln -snf "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${service}" \
+ "${svcdir}/scheduled/${service}/${start}"
+ }
+
+@@ -334,9 +334,9 @@
+ if [[ ${retval} == "0" && ${RC_NO_DEPS} != "yes" ]] ; then
+ local startupservices="$(ineed "${SVCNAME}") $(valid_iuse "${SVCNAME}")"
+ local netservices=
+- for x in $(dolisting "/etc/runlevels/${BOOTLEVEL}/net.*") \
+- $(dolisting "/etc/runlevels/${mylevel}/net.*") \
+- $(dolisting "/var/lib/init.d/coldplugged/net.*") ; do
++ for x in $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${BOOTLEVEL}/net.*") \
++ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/etc/runlevels/${mylevel}/net.*") \
++ $(dolisting "@GENTOO_PORTAGE_EPREFIX@/var/lib/init.d/coldplugged/net.*") ; do
+ netservices="${netservices} ${x##*/}"
+ done
+
+@@ -631,9 +631,9 @@
+
+ # Simple way to try and detect if the service use svc_{start,stop}
+ # to restart if it have a custom restart() funtion.
+- if [[ -n $(egrep '^[[:space:]]*restart[[:space:]]*()' "/etc/init.d/${SVCNAME}") ]] ; then
+- if [[ -z $(egrep 'svc_stop' "/etc/init.d/${SVCNAME}") || \
+- -z $(egrep 'svc_start' "/etc/init.d/${SVCNAME}") ]] ; then
++ if [[ -n $(egrep '^[[:space:]]*restart[[:space:]]*()' "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${SVCNAME}") ]] ; then
++ if [[ -z $(egrep 'svc_stop' "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${SVCNAME}") || \
++ -z $(egrep 'svc_start' "@GENTOO_PORTAGE_EPREFIX@/etc/init.d/${SVCNAME}") ]] ; then
+ echo
+ ewarn "Please use 'svc_stop; svc_start' and not 'stop; start' to"
+ ewarn "restart the service in its custom 'restart()' function."
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch
new file mode 100644
index 000000000000..20e45827acdd
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-solaris.patch
@@ -0,0 +1,66 @@
+--- src/start-stop-daemon.c
++++ src/start-stop-daemon.c
+@@ -44,7 +44,7 @@
+ # define OSLinux
+ #elif defined(__GNU__)
+ # define OSHURD
+-#elif defined(__sparc__)
++#elif defined (__SVR4) && defined (__sun)
+ # define OSsunos
+ #elif defined(OPENBSD) || defined(__OpenBSD__)
+ # define OSOpenBSD
+@@ -94,6 +94,9 @@
+ #if defined(OSaix)
+ #include <sys/procfs.h>
+ #endif
++#if defined(OSsunos)
++#include <procfs.h>
++#endif
+
+ #include <errno.h>
+ #include <stdio.h>
+@@ -188,7 +191,7 @@
+ static void do_pidfile(const char *name);
+ static void do_stop(int signal_nr, int quietmode,
+ int *n_killed, int *n_notkilled, int retry_nr);
+-#if defined(OSLinux) || defined(OShpux) || defined(OSaix)
++#if defined(OSLinux) || defined(OShpux) || defined(OSaix) || defined(OSsunos)
+ static int pid_is_exec(pid_t pid, const struct stat *esb);
+ #endif
+
+@@ -765,7 +768,7 @@
+ static void
+ check(pid_t pid)
+ {
+-#if defined(OSLinux) || defined(OShpux) || defined(OSaix)
++#if defined(OSLinux) || defined(OShpux) || defined(OSaix) || defined(OSsunos)
+ if (execname && !pid_is_exec(pid, &exec_stat))
+ return;
+ #elif defined(OSHURD) || defined(OSFreeBSD) || defined(OSNetBSD) || defined(OSDarwin)
+@@ -801,7 +804,7 @@
+ /* WTA: this needs to be an autoconf check for /proc/pid existance.
+ */
+
+-#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd) || defined(OSaix)
++#if defined(OSLinux) || defined (OSsunos) || defined(OSfreebsd) || defined(OSaix) || defined(OSsunos)
+ static void
+ do_procinit(void)
+ {
+@@ -1069,7 +1072,7 @@
+ }
+ #endif /* OShpux */
+
+-#if defined(OSaix)
++#if defined(OSaix) || defined(OSsunos)
+ /* max possible pid (signed long) in theory:
+ * 32bit: 2147483647 (10 digits)
+ * 64bit: 9223372036854775807 (19 digits)
+@@ -1119,7 +1122,7 @@
+ }
+ return strcmp(name, psi.pr_fname) == 0;
+ }
+-#endif /* OSaix */
++#endif /* OSaix || OSsunos */
+
+
+ static void
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch
new file mode 100644
index 000000000000..3e67a226c77c
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-strsep.patch
@@ -0,0 +1,42 @@
+--- src/core/misc.h
++++ src/core/misc.h
+@@ -284,5 +284,9 @@
+ void file_unmap(char *buf, size_t bufsize);
+ size_t buf_get_line(char *buf, size_t buflen, size_t cur);
+
++#if defined (__SVR4) && defined (__sun)
++char* strsep(char** str, const char* delims);
++#endif
++
+ #endif /* _MISC_H */
+
+--- src/core/misc.c
++++ src/core/misc.c
+@@ -647,3 +647,27 @@
+ return count - cur;
+ }
+
++#if defined (__SVR4) && defined (__sun)
++char* strsep(char** str, const char* delims)
++{
++ char* token;
++
++ if (*str == NULL) {
++ /* No more tokens */
++ return NULL;
++ }
++
++ token=*str;
++ while (**str != '\0') {
++ if (strchr(delims, **str) != NULL) {
++ **str = '\0';
++ (*str)++;
++ return token;
++ }
++ (*str)++;
++ }
++ /* There is no other token */
++ *str = NULL;
++ return token;
++}
++#endif
diff --git a/sys-apps/baselayout-prefix/files/baselayout-1.12.5-termios_h.patch b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-termios_h.patch
new file mode 100644
index 000000000000..8c84bf6ce33a
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/baselayout-1.12.5-termios_h.patch
@@ -0,0 +1,30 @@
+<termios.h> is standard as per SUSv2 already:
+http://pubs.opengroup.org/onlinepubs/007908799/xsh/termios.h.html
+AIX does not provide <sys/termios.h> at all, Linux, Solaris, HP-UX,
+Darwin and Interix have both, redirecting one to the other.
+
+--- src/start-stop-daemon.c.orig 2011-03-28 13:55:36 +0200
++++ src/start-stop-daemon.c 2011-03-28 14:50:47 +0200
+@@ -37,6 +37,9 @@
+ #define NONRETURNING \
+ __attribute__((noreturn))
+
++#define HAVE_TERMIOS_H
++#undef HAVE_SYS_TERMIOS_H
++
+ #if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__))
+ # define OSLinux
+ #elif defined(__GNU__)
+@@ -97,7 +123,11 @@
+ #include <grp.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+-#include <sys/termios.h>
++#if defined(HAVE_TERMIOS_H)
++# include <termios.h>
++#elif defined(HAVE_SYS_TERMIOS_H)
++# include <sys/termios.h>
++#endif
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <assert.h>
diff --git a/sys-apps/baselayout-prefix/files/einfo-1.0.4-termcap-check.patch b/sys-apps/baselayout-prefix/files/einfo-1.0.4-termcap-check.patch
new file mode 100644
index 000000000000..61d779e47e20
--- /dev/null
+++ b/sys-apps/baselayout-prefix/files/einfo-1.0.4-termcap-check.patch
@@ -0,0 +1,83 @@
+#diff -ru einfo-1.0.4/configure.ac einfo/configure.ac
+#--- einfo-1.0.4/configure.ac 2013-10-27 17:39:07.000000000 +0100
+#+++ einfo/configure.ac 2013-10-29 18:01:51.975745907 +0100
+#@@ -22,7 +22,7 @@
+# )
+# )
+# fi
+#-AC_DEFINE([HAVE_TERMCAP], test "x$HAVE_TERMCAP" != "x",
+#+AC_DEFINE_UNQUOTED([HAVE_TERMCAP], `test "x$HAVE_TERMCAP" = "x"; echo $?`,
+# [Define if termcap.h and library exist])
+# AC_SUBST([TERMCAP_LIBS], [$HAVE_TERMCAP])
+#
+diff -ru einfo-1.0.4/configure einfo/configure
+--- einfo-1.0.4/configure 2013-10-27 17:42:20.000000000 +0100
++++ einfo/configure 2013-10-29 18:02:08.405707018 +0100
+@@ -11447,7 +11432,9 @@
+
+ fi
+
+-$as_echo "#define HAVE_TERMCAP test \"x\$HAVE_TERMCAP\" != \"x\"" >>confdefs.h
++cat >>confdefs.h <<_ACEOF
++#define HAVE_TERMCAP `test "x$HAVE_TERMCAP" = "x"; echo $?`
++_ACEOF
+
+ TERMCAP_LIBS=$HAVE_TERMCAP
+
+diff -ru einfo-1.0.4/src/libeinfo/libeinfo.c einfo/src/libeinfo/libeinfo.c
+--- einfo-1.0.4/src/libeinfo/libeinfo.c 2013-10-27 17:37:25.000000000 +0100
++++ einfo/src/libeinfo/libeinfo.c 2013-10-29 18:05:38.081876730 +0100
+@@ -50,7 +50,7 @@
+ #include <string.h>
+ #include <strings.h>
+ #include <syslog.h>
+-#ifdef HAVE_TERMCAP
++#if HAVE_TERMCAP
+ # include <termcap.h>
+ #endif
+ #include <unistd.h>
+@@ -155,7 +155,7 @@
+
+ /* Termcap buffers and pointers
+ * Static buffers suck hard, but some termcap implementations require them */
+-#ifdef HAVE_TERMCAP
++#if HAVE_TERMCAP
+ static char termcapbuf[2048];
+ static char tcapbuf[512];
+ #else
+@@ -287,7 +287,7 @@
+ }
+
+ /* Fake tgoto call - very crapy, but works for our needs */
+-#ifndef HAVE_TERMCAP
++#if !HAVE_TERMCAP
+ static char *
+ tgoto(const char *cap, int col, int line)
+ {
+@@ -363,7 +363,7 @@
+ const char *bold;
+ char tmp[100];
+ unsigned int i = 0;
+-#ifdef HAVE_TERMCAP
++#if HAVE_TERMCAP
+ char *bp;
+ #endif
+
+@@ -387,7 +387,7 @@
+ if (strcmp(term, "cons25") == 0)
+ term_is_cons25 = true;
+
+-#ifdef HAVE_TERMCAP
++#if HAVE_TERMCAP
+ /* Check termcap to see if we can do colour or not */
+ if (tgetent(termcapbuf, term) == 1) {
+ bp = tcapbuf;
+@@ -433,7 +433,7 @@
+ _me = ME;
+ if (!_up)
+ _up = UP;
+-#ifdef HAVE_TERMCAP
++#if HAVE_TERMCAP
+ }
+
+ if (!_af || !_ce || !_me || !_md || !_up) {
diff --git a/sys-apps/baselayout-prefix/metadata.xml b/sys-apps/baselayout-prefix/metadata.xml
new file mode 100644
index 000000000000..ab2f5b1d003d
--- /dev/null
+++ b/sys-apps/baselayout-prefix/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>prefix@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='prefix-chaining'>install in a chained Prefix environment</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/baselayout/Manifest b/sys-apps/baselayout/Manifest
new file mode 100644
index 000000000000..1951dcd22627
--- /dev/null
+++ b/sys-apps/baselayout/Manifest
@@ -0,0 +1 @@
+DIST baselayout-2.2.tar.bz2 40744 SHA256 11d4a223b06da545c3e59e07c9195570f334b5b1be05d995df0ebc8ea2203e98 SHA512 a5199c42e835d9f2683cc94f3c4c47ecdc392316c24e0932845736e2e90479b0c5c8ad72ead8e0537f097405b7d7548d00b87b7ff8c9e3651486e3c5c0970b36 WHIRLPOOL 60cc4f7f76c5a45c15303e526decffb3bad2b50ac659b1dd072d2ed4b0eb0b31929a1a733ddb03a31ee5882b889a4efb87206f63ffaa2b11e26d36afd0933a95
diff --git a/sys-apps/baselayout/baselayout-2.2.ebuild b/sys-apps/baselayout/baselayout-2.2.ebuild
new file mode 100644
index 000000000000..41b47560137e
--- /dev/null
+++ b/sys-apps/baselayout/baselayout-2.2.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils multilib
+
+DESCRIPTION="Filesystem baselayout and init scripts"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="build kernel_linux"
+
+pkg_setup() {
+ multilib_layout
+}
+
+# Create our multilib dirs - the Makefile has no knowledge of this
+multilib_warn() {
+ local syms=$1 dirs=$2 def_libdir=$3
+
+ [ -z "${syms}${dirs}" ] && return
+
+ ewarn "Your system profile has SYMLINK_LIB=${SYMLINK_LIB}, so that means"
+ if [ -z "${syms}" ] ; then
+ ewarn "you need to have these paths as symlinks to ${def_libdir}:"
+ ewarn "$1"
+ fi
+}
+multilib_layout() {
+ local libdir libdirs=$(get_all_libdirs) def_libdir=$(get_abi_LIBDIR $DEFAULT_ABI)
+ : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass...
+
+ [ -z "${def_libdir}" ] && die "your DEFAULT_ABI=$DEFAULT_ABI appears to be invalid"
+
+ # figure out which paths should be symlinks and which should be directories
+ local dirs syms exp d
+ for libdir in ${libdirs} ; do
+ exp=( {,usr/,usr/local/}${libdir} )
+ for d in "${exp[@]/#/${ROOT}}" ; do
+ # most things should be dirs
+ if [ "${SYMLINK_LIB}" = "yes" ] && [ "${libdir}" = "lib" ] ; then
+ [ ! -h "${d}" ] && [ -e "${d}" ] && dirs+=" ${d}"
+ else
+ [ -h "${d}" ] && syms+=" ${d}"
+ fi
+ done
+ done
+ if [ -n "${syms}${dirs}" ] ; then
+ ewarn "Your system profile has SYMLINK_LIB=${SYMLINK_LIB:-no}, so that means you need to"
+ ewarn "have these paths configured as follows:"
+ [ -n "${dirs}" ] && ewarn "symlinks to '${def_libdir}':${dirs}"
+ [ -n "${syms}" ] && ewarn "directories:${syms}"
+ ewarn "The ebuild will attempt to fix these, but only for trivial conversions."
+ ewarn "If things fail, you will need to manually create/move the directories."
+ echo
+ fi
+
+ # setup symlinks and dirs where we expect them to be; do not migrate
+ # data ... just fall over in that case.
+ local prefix
+ for prefix in "${ROOT}"{,usr/,usr/local/} ; do
+ if [ "${SYMLINK_LIB}" = yes ] ; then
+ # we need to make sure "lib" points to the native libdir
+ if [ -h "${prefix}lib" ] ; then
+ # it's already a symlink! assume it's pointing to right place ...
+ continue
+ elif [ -d "${prefix}lib" ] ; then
+ # "lib" is a dir, so need to convert to a symlink
+ ewarn "Converting ${prefix}lib from a dir to a symlink"
+ rm -f "${prefix}lib"/.keep
+ if rmdir "${prefix}lib" 2>/dev/null ; then
+ ln -s ${def_libdir} "${prefix}lib" || die
+ else
+ die "non-empty dir found where we needed a symlink: ${prefix}lib"
+ fi
+ else
+ # nothing exists, so just set it up sanely
+ ewarn "Initializing ${prefix}lib as a symlink"
+ mkdir -p "${prefix}" || die
+ rm -f "${prefix}lib" || die
+ ln -s ${def_libdir} "${prefix}lib" || die
+ mkdir -p "${prefix}${def_libdir}" #423571
+ fi
+ else
+ # we need to make sure "lib" is a dir
+ if [ -h "${prefix}lib" ] ; then
+ # "lib" is a symlink, so need to convert to a dir
+ ewarn "Converting ${prefix}lib from a symlink to a dir"
+ rm -f "${prefix}lib" || die
+ if [ -d "${prefix}lib32" ] ; then
+ ewarn "Migrating ${prefix}lib32 to ${prefix}lib"
+ mv "${prefix}lib32" "${prefix}lib" || die
+ else
+ mkdir -p "${prefix}lib" || die
+ fi
+ elif [ -d "${prefix}lib" ] ; then
+ # make sure the old "lib" ABI location does not exist; we
+ # only symlinked the lib dir on systems where we moved it
+ # to "lib32" ...
+ case ${CHOST} in
+ *-gentoo-freebsd*) ;; # We want it the other way on fbsd.
+ i?86*|x86_64*|powerpc*|sparc*|s390*)
+ if [ -d "${prefix}lib32" ] ; then
+ rm -f "${prefix}lib32"/.keep
+ if ! rmdir "${prefix}lib32" 2>/dev/null ; then
+ ewarn "You need to merge ${prefix}lib32 into ${prefix}lib"
+ die "non-empty dir found where there should be none: ${prefix}lib32"
+ fi
+ fi
+ ;;
+ esac
+ else
+ # nothing exists, so just set it up sanely
+ ewarn "Initializing ${prefix}lib as a dir"
+ mkdir -p "${prefix}" || die
+ rm -f "${prefix}lib" || die
+ ln -s ${def_libdir} "${prefix}lib" || die
+ fi
+ fi
+ done
+}
+
+pkg_preinst() {
+ # Bug #217848 - Since the remap_dns_vars() called by pkg_preinst() of
+ # the baselayout-1.x ebuild copies all the real configs from the user's
+ # /etc/conf.d into ${D}, it makes them all appear to be the default
+ # versions. In order to protect them from being unmerged after this
+ # upgrade, modify their timestamps.
+ touch "${ROOT}"/etc/conf.d/* 2>/dev/null
+
+ # This is written in src_install (so it's in CONTENTS), but punt all
+ # pending updates to avoid user having to do etc-update (and make the
+ # pkg_postinst logic simpler).
+ rm -f "${ROOT}"/etc/._cfg????_gentoo-release
+
+ # We need to install directories and maybe some dev nodes when building
+ # stages, but they cannot be in CONTENTS.
+ # Also, we cannot reference $S as binpkg will break so we do this.
+ multilib_layout
+ if use build ; then
+ emake -C "${D}/usr/share/${PN}" DESTDIR="${ROOT}" layout || die
+ fi
+ rm -f "${D}"/usr/share/${PN}/Makefile
+}
+
+src_install() {
+ emake \
+ OS=$(usex kernel_FreeBSD BSD Linux) \
+ DESTDIR="${D}" \
+ install || die
+ dodoc ChangeLog.svn
+
+ # need the makefile in pkg_preinst
+ insinto /usr/share/${PN}
+ doins Makefile || die
+
+ # handle multilib paths. do it here because we want this behavior
+ # regardless of the C library that you're using. we do explicitly
+ # list paths which the native ldconfig searches, but this isn't
+ # problematic as it doesn't change the resulting ld.so.cache or
+ # take longer to generate. similarly, listing both the native
+ # path and the symlinked path doesn't change the resulting cache.
+ local libdir ldpaths
+ for libdir in $(get_all_libdirs) ; do
+ ldpaths+=":/${libdir}:/usr/${libdir}:/usr/local/${libdir}"
+ done
+ echo "LDPATH='${ldpaths#:}'" >> "${D}"/etc/env.d/00basic
+
+ # rc-scripts version for testing of features that *should* be present
+ echo "Gentoo Base System release ${PV}" > "${D}"/etc/gentoo-release
+}
+
+pkg_postinst() {
+ local x
+
+ # We installed some files to /usr/share/baselayout instead of /etc to stop
+ # (1) overwriting the user's settings
+ # (2) screwing things up when attempting to merge files
+ # (3) accidentally packaging up personal files with quickpkg
+ # If they don't exist then we install them
+ for x in master.passwd passwd shadow group fstab ; do
+ [ -e "${ROOT}etc/${x}" ] && continue
+ [ -e "${ROOT}usr/share/baselayout/${x}" ] || continue
+ cp -p "${ROOT}usr/share/baselayout/${x}" "${ROOT}"etc
+ done
+
+ # Force shadow permissions to not be world-readable #260993
+ for x in shadow ; do
+ [ -e "${ROOT}etc/${x}" ] && chmod o-rwx "${ROOT}etc/${x}"
+ done
+
+ # Take care of the etc-update for the user
+ if [ -e "${ROOT}"/etc/._cfg0000_gentoo-release ] ; then
+ mv "${ROOT}"/etc/._cfg0000_gentoo-release "${ROOT}"/etc/gentoo-release
+ fi
+
+ # whine about users that lack passwords #193541
+ if [[ -e ${ROOT}/etc/shadow ]] ; then
+ local bad_users=$(sed -n '/^[^:]*::/s|^\([^:]*\)::.*|\1|p' "${ROOT}"/etc/shadow)
+ if [[ -n ${bad_users} ]] ; then
+ echo
+ ewarn "The following users lack passwords!"
+ ewarn ${bad_users}
+ fi
+ fi
+
+ # baselayout leaves behind a lot of .keep files, so let's clean them up
+ find "${ROOT}"/lib*/rcscripts/ -name .keep -exec rm -f {} + 2>/dev/null
+ find "${ROOT}"/lib*/rcscripts/ -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # whine about users with invalid shells #215698
+ if [[ -e ${ROOT}/etc/passwd ]] ; then
+ local bad_shells=$(awk -F: 'system("test -e " $7) { print $1 " - " $7}' /etc/passwd | sort)
+ if [[ -n ${bad_shells} ]] ; then
+ echo
+ ewarn "The following users have non-existent shells!"
+ ewarn "${bad_shells}"
+ fi
+ fi
+
+ # http://bugs.gentoo.org/361349
+ if use kernel_linux; then
+ mkdir -p "${ROOT}"/run
+
+ if ! grep -qs "^tmpfs.*/run " "${ROOT}"/proc/mounts ; then
+ echo
+ ewarn "You should reboot the system now to get /run mounted with tmpfs!"
+ fi
+ fi
+}
diff --git a/sys-apps/baselayout/metadata.xml b/sys-apps/baselayout/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/baselayout/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-apps/biosdevname/Manifest b/sys-apps/biosdevname/Manifest
new file mode 100644
index 000000000000..9518dd56d556
--- /dev/null
+++ b/sys-apps/biosdevname/Manifest
@@ -0,0 +1,4 @@
+DIST biosdevname-0.3.11.tar.gz 186408 SHA256 02c127f7fff76127cd6006e7cdd9da9335035bcb3e0a0fcf039fbb5c0f5d2dc0 SHA512 2c96c8c8163c5fd74735c52881d448af731bac875c4825ba54608a2b100de70bc2003edda86f1d1ed3597260177d572348e2358f1663a788f193e20e5d50f719 WHIRLPOOL 860815bd928459779f4def4953a04fa2ce8b7caeb8370bf2c1e3e4db87e29d2deac4318b7d12ff4415ad0c0ef166cae7470ce83601330ad9afc6a36603da6db1
+DIST biosdevname-0.4.0.tar.gz 187775 SHA256 7d567ea8081bc83c6fe17fa32bf8e2b852636a733f5e4d9d583fedeb2f48e21b SHA512 0607f6c04725b4df58becfc6d3b16139397e0ab0f172ac137c670115c8d1a3b2849266e0d801b635d8e4aa4b3ac662a0f356835df0c4d05bfee6ff3e6459c1d8 WHIRLPOOL f2fe757b0f00c90252594cb38d499250c987a012135f1aa73eb3679e81f12fee44606476a21ef175c7c2b254ce5a0f5936b90dd9605e7274f5fd42f7d5398906
+DIST biosdevname-0.4.1.tar.gz 187782 SHA256 230e5bffd17f46b6d820faa46ea79ace3eecaf919852ee7ff231e73f6b9f8fe7 SHA512 1c7534dd31acbba7121fc4f904d828b6bfc035248cde3366a58f4596f601c81618b44a96d67b99d4a17cf8d985c971be41196134f6d43ae63b4f8cd4308bed22 WHIRLPOOL 33917ad8ed6493b3fd6b5880e592031fc028e975e428cc9b2b5b16b299f5be647baac6a601c70b9422931a1cf6f98133944e18e9355afe2a0453d456e4697407
+DIST biosdevname-0.6.1.tar.gz 195604 SHA256 b43580589a3f40afc836afbff9bcd837224c710b75a4d0b576f2e4d44ec158cc SHA512 46962c50618eb87c3ade5f4866bbb3fddb75f3a450bc32610d54062375b53bcd4c2f17cc3d729335c7d582043d0b491c8d8e1dc50d7de9c7683846b8dc8b0d77 WHIRLPOOL 9fa40a118ca57dd4e1a226ab0bea117f0291b0ee8807a5c2a9a56ef850d52d9500bb59a0d9e1fcba4cb87e85f269c76216bbee4eb331906cfa545b69ef3c6774
diff --git a/sys-apps/biosdevname/biosdevname-0.3.11-r1.ebuild b/sys-apps/biosdevname/biosdevname-0.3.11-r1.ebuild
new file mode 100644
index 000000000000..cc48a0776f54
--- /dev/null
+++ b/sys-apps/biosdevname/biosdevname-0.3.11-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Sets BIOS-given device names instead of kernel eth* names"
+HOMEPAGE="http://linux.dell.com/biosdevname/"
+SRC_URI="http://linux.dell.com/biosdevname/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+CDEPEND="virtual/udev"
+DEPEND="${CDEPEND}
+ sys-apps/pciutils"
+RDEPEND="${CDEPEND}"
+
+src_prepare() {
+ sed -e 's|/sbin/biosdevname|/usr\0|g' -i "${S}"/biosdevname.rules.in
+}
+
+pkg_postinst() {
+ elog "To make it working you need to remove"
+ elog ""
+ elog " /etc/udev/rules.d/70-persistent-net.rules"
+ elog ""
+ elog "and then reboot the machine. After reboot ethernet devices names will"
+ elog "change to the ones reported by BIOS. For more information you might"
+ elog "want to read following document:"
+ elog ""
+ elog " http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming"
+ elog ""
+ elog "To disable this feature, pass biosdevname=0 to kernel command line."
+ elog ""
+ elog "If you use Dracut, you might want to enable 'biosdevname' module"
+ elog "(in DRACUT_MODULES variable)."
+}
diff --git a/sys-apps/biosdevname/biosdevname-0.4.0.ebuild b/sys-apps/biosdevname/biosdevname-0.4.0.ebuild
new file mode 100644
index 000000000000..cc48a0776f54
--- /dev/null
+++ b/sys-apps/biosdevname/biosdevname-0.4.0.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Sets BIOS-given device names instead of kernel eth* names"
+HOMEPAGE="http://linux.dell.com/biosdevname/"
+SRC_URI="http://linux.dell.com/biosdevname/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+CDEPEND="virtual/udev"
+DEPEND="${CDEPEND}
+ sys-apps/pciutils"
+RDEPEND="${CDEPEND}"
+
+src_prepare() {
+ sed -e 's|/sbin/biosdevname|/usr\0|g' -i "${S}"/biosdevname.rules.in
+}
+
+pkg_postinst() {
+ elog "To make it working you need to remove"
+ elog ""
+ elog " /etc/udev/rules.d/70-persistent-net.rules"
+ elog ""
+ elog "and then reboot the machine. After reboot ethernet devices names will"
+ elog "change to the ones reported by BIOS. For more information you might"
+ elog "want to read following document:"
+ elog ""
+ elog " http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming"
+ elog ""
+ elog "To disable this feature, pass biosdevname=0 to kernel command line."
+ elog ""
+ elog "If you use Dracut, you might want to enable 'biosdevname' module"
+ elog "(in DRACUT_MODULES variable)."
+}
diff --git a/sys-apps/biosdevname/biosdevname-0.4.1.ebuild b/sys-apps/biosdevname/biosdevname-0.4.1.ebuild
new file mode 100644
index 000000000000..72022c9aefe7
--- /dev/null
+++ b/sys-apps/biosdevname/biosdevname-0.4.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit udev
+
+DESCRIPTION="Sets BIOS-given device names instead of kernel eth* names"
+HOMEPAGE="http://linux.dell.com/biosdevname/"
+SRC_URI="http://linux.dell.com/biosdevname/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+CDEPEND="virtual/udev"
+DEPEND="${CDEPEND}
+ sys-apps/pciutils"
+RDEPEND="${CDEPEND}"
+
+src_prepare() {
+ sed -i -e 's|/sbin/biosdevname|/usr\0|g' biosdevname.rules.in || die
+ sed -i -e "/RULEDEST/s:/lib/udev:$(get_udevdir):" configure{,.ac} || die
+}
+
+pkg_postinst() {
+ elog "To make it working you need to remove"
+ elog ""
+ elog " /etc/udev/rules.d/70-persistent-net.rules"
+ elog ""
+ elog "and then reboot the machine. After reboot ethernet devices names will"
+ elog "change to the ones reported by BIOS. For more information you might"
+ elog "want to read following document:"
+ elog ""
+ elog " http://fedoraproject.org/wiki/Features/ConsistentNetworkDeviceNaming"
+ elog ""
+ elog "To disable this feature, pass biosdevname=0 to kernel command line."
+ elog ""
+ elog "If you use Dracut, you might want to enable 'biosdevname' module"
+ elog "(in DRACUT_MODULES variable)."
+}
diff --git a/sys-apps/biosdevname/biosdevname-0.6.1.ebuild b/sys-apps/biosdevname/biosdevname-0.6.1.ebuild
new file mode 100644
index 000000000000..04c74128faa7
--- /dev/null
+++ b/sys-apps/biosdevname/biosdevname-0.6.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit udev
+
+DESCRIPTION="Sets BIOS-given device names instead of kernel eth* names"
+HOMEPAGE="http://linux.dell.com/biosdevname/"
+SRC_URI="http://linux.dell.com/biosdevname/${P}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+CDEPEND="virtual/udev"
+DEPEND="${CDEPEND}
+ sys-apps/pciutils"
+RDEPEND="${CDEPEND}"
+
+src_prepare() {
+ sed -i -e 's|/sbin/biosdevname|/usr\0|g' biosdevname.rules.in || die
+ sed -i -e "/RULEDEST/s:/lib/udev:$(get_udevdir):" configure{,.ac} || die
+}
diff --git a/sys-apps/biosdevname/metadata.xml b/sys-apps/biosdevname/metadata.xml
new file mode 100644
index 000000000000..030bf464fc66
--- /dev/null
+++ b/sys-apps/biosdevname/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>aidecoe@gentoo.org</email>
+ <name>Amadeusz Żołnowski</name>
+</maintainer>
+<longdescription lang="en">
+biosdevname in its simplest form takes a kernel device name as an argument, and
+returns the BIOS-given name it "should" be. This is necessary on systems where
+the BIOS name for a given device (e.g. the label on the chassis is "Gb1")
+doesn't map directly and obviously to the kernel name (e.g. eth0).
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/biosdisk/Manifest b/sys-apps/biosdisk/Manifest
new file mode 100644
index 000000000000..6d5af87c3b72
--- /dev/null
+++ b/sys-apps/biosdisk/Manifest
@@ -0,0 +1 @@
+DIST biosdisk-git-06112010.tar.gz 1195889 SHA256 3319207abb6715ca032852190c64a2b27a227364f848eccd362ecdf1d3102478 SHA512 ade60e0e1ebb069e7f8d2046eff479cdb5186e54e0408b7fe65ac803476c9e325f9771617bbbcd60471d6b2d637aaef20c68af89c16c4ea26e04cfe501e4a310 WHIRLPOOL ca5340c25ab4a1eb579d180d404a0e4314500d85a309acdf36d0359d145b2266c76fcb446ff10212efb926034640e041e448bedf94a868a013a76dcdd4063cdc
diff --git a/sys-apps/biosdisk/biosdisk-0_p20100611-r1.ebuild b/sys-apps/biosdisk/biosdisk-0_p20100611-r1.ebuild
new file mode 100644
index 000000000000..39fd2880515d
--- /dev/null
+++ b/sys-apps/biosdisk/biosdisk-0_p20100611-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit versionator python-single-r1
+
+MY_PV=$(get_version_component_range 2)
+MY_PV_YEAR=${MY_PV:1:4}
+MY_PV_MONTH=${MY_PV:5:2}
+MY_PV_DAY=${MY_PV:7:2}
+MY_PV="${MY_PV_MONTH}${MY_PV_DAY}${MY_PV_YEAR}"
+
+S=${WORKDIR}/${PN}
+DESCRIPTION="A script that creates floppy boot images to flash Dell BIOSes"
+HOMEPAGE="http://en.community.dell.com/techcenter/os-applications/w/wiki/linux-projects.aspx"
+SRC_URI="http://linux.dell.com/biosdisk/${PN}-git-${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RDEPEND="
+ >=app-text/dos2unix-5.0
+ sys-boot/syslinux
+ ${PYTHON_DEPS}
+"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_install() {
+ python_fix_shebang blconf
+
+ dosbin biosdisk blconf
+
+ dodoc AUTHORS README README.dosdisk TODO VERSION
+ doman biosdisk.8.gz
+
+ insinto /usr/share/biosdisk
+ doins dosdisk.img dosdisk{288,8192}.img biosdisk-mkrpm-{fedora,redhat,generic}-template.spec
+
+ insinto /etc
+ doins biosdisk.conf
+}
diff --git a/sys-apps/biosdisk/metadata.xml b/sys-apps/biosdisk/metadata.xml
new file mode 100644
index 000000000000..b61e26392d00
--- /dev/null
+++ b/sys-apps/biosdisk/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>proxy-maintainers</herd>
+<maintainer>
+ <email>mattsch@gmail.com</email>
+ <name>Matthew Schultz</name>
+ <description>Assign bugs to him</description>
+</maintainer>
+<maintainer>
+ <email>pacho@gentoo.org</email>
+ <description>Proxy maintainer, CC him in bugs</description>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/bleachbit/Manifest b/sys-apps/bleachbit/Manifest
new file mode 100644
index 000000000000..1cade2bbe62a
--- /dev/null
+++ b/sys-apps/bleachbit/Manifest
@@ -0,0 +1,3 @@
+DIST bleachbit-1.2.tar.bz2 346530 SHA256 655b6e1ef7d5658c8e1a8e62b2c4ae0e4b1af484e47f1fb93a735892bbd2eea3 SHA512 a84881789c408335493b0923b51e66940295c430b2ea8838e420603ef8ee7548a0a1d605564070034bfe3a2d9159015e403db14470d6b33cf5260c3e4b43d267 WHIRLPOOL 262b7261188097d36584019a38ce8ef291572b85be318f39a6bb603546a39c733b9da761763b1234b8762bae4bde8dd0ee7cb8bac5abcebe3541f81025f5fff8
+DIST bleachbit-1.4.tar.bz2 351729 SHA256 6ccba22b865718e4b72fdba527af71b79b01cbd63108f1cfe845eababf4bd0b3 SHA512 e460f65f1f732d20723d8f64685209959c1482ecff385ccb779baad866af0d4b7004b14351ec3f8d3179c5bd94edfdfc9a2e1413c414d61d45cbe361cb41f375 WHIRLPOOL b6b735fe62dadbb5874d3577e4e7a31b8de275e89a0bd1325a3680f91e06e4b773752226c55a4b90caaa6bf01e18e8111fa2277c4ff3d34c156922ceb96e2051
+DIST bleachbit-1.9.1.tar.bz2 371882 SHA256 8d15c6d849043f44a184d85c2b79324c7441d40f348493acb9a2fc8f675b4c51 SHA512 a72f35be5f0de07fe5dc6f5fd5cea4c235249f2a7714e820e91bfabc41585e2c31bb316779760a3755579ade0cfe310101bf0c70f919b9cf1f37872ac0dfb23a WHIRLPOOL 98cfd1d4597d77b337d87ab0b52f38e7608b4acdca1e44b1c6c432c0649b660b54350271d0ac9449761d6bb0609a32093f0ada941140bbff457f8dbc25d51bf2
diff --git a/sys-apps/bleachbit/bleachbit-1.2.ebuild b/sys-apps/bleachbit/bleachbit-1.2.ebuild
new file mode 100644
index 000000000000..bad30be4768b
--- /dev/null
+++ b/sys-apps/bleachbit/bleachbit-1.2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PLOCALES="ar ast be bg bn bs ca cs da de el en_AU en_GB eo es et eu fa fi fo fr gl he hi hr hu hy ia id it ja ko ku ky lt ms
+my nb nds nl pl pt_BR pt ro ru se si sk sl sr sv ta te th tr ug uk uz vi zh_CN zh_TW"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1 eutils l10n
+
+DESCRIPTION="Clean junk to free disk space and to maintain privacy"
+HOMEPAGE="http://bleachbit.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+gtk nls"
+
+RDEPEND="gtk? ( dev-python/pygtk:2[$PYTHON_USEDEP] )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+DOCS=( README )
+
+python_prepare_all() {
+ rem_locale() {
+ rm "po/${1}.po" || die "removing of ${1}.po failed"
+ }
+
+ l10n_find_plocales_changes po "" ".po"
+ l10n_for_each_disabled_locale_do rem_locale
+
+ addpredict /root/.gnome2 #401981
+
+ # warning: key "Encoding" in group "Desktop Entry" is deprecated
+ sed -i -e '/Encoding/d' ${PN}.desktop || die
+
+ # choose correct Python implementation, bug #465254
+ sed -i -e 's/python/$(PYTHON)/g' po/Makefile || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use nls && emake -C po
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ use nls && emake -C po DESTDIR="${D}" install
+
+ # http://bugs.gentoo.org/388999
+ insinto /usr/share/${PN}/cleaners
+ doins cleaners/*.xml
+
+ newbin ${PN}.py ${PN}
+ python_replicate_script "${D}/usr/bin/${PN}"
+
+ doicon ${PN}.png
+ domenu ${PN}.desktop
+}
diff --git a/sys-apps/bleachbit/bleachbit-1.4.ebuild b/sys-apps/bleachbit/bleachbit-1.4.ebuild
new file mode 100644
index 000000000000..fe0b6f7f1373
--- /dev/null
+++ b/sys-apps/bleachbit/bleachbit-1.4.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PLOCALES="ar ast be bg bn bs ca cs da de el en_AU en_GB eo es et eu fa fi fo fr gl he hi hr hu hy ia id it ja ko ku ky lt ms
+my nb nds nl pl pt_BR pt ro ru se si sk sl sr sv ta te th tr ug uk uz vi zh_CN zh_TW"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1 eutils l10n
+
+DESCRIPTION="Clean junk to free disk space and to maintain privacy"
+HOMEPAGE="http://bleachbit.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+gtk nls"
+
+RDEPEND="gtk? ( dev-python/pygtk:2[$PYTHON_USEDEP] )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+DOCS=( README )
+
+python_prepare_all() {
+ rem_locale() {
+ rm "po/${1}.po" || die "removing of ${1}.po failed"
+ }
+
+ l10n_find_plocales_changes po "" ".po"
+ l10n_for_each_disabled_locale_do rem_locale
+
+ addpredict /root/.gnome2 #401981
+
+ # warning: key "Encoding" in group "Desktop Entry" is deprecated
+ sed -i -e '/Encoding/d' ${PN}.desktop || die
+
+ # choose correct Python implementation, bug #465254
+ sed -i -e 's/python/$(PYTHON)/g' po/Makefile || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use nls && emake -C po
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ use nls && emake -C po DESTDIR="${D}" install
+
+ # http://bugs.gentoo.org/388999
+ insinto /usr/share/${PN}/cleaners
+ doins cleaners/*.xml
+
+ newbin ${PN}.py ${PN}
+ python_replicate_script "${D}/usr/bin/${PN}"
+
+ doicon ${PN}.png
+ domenu ${PN}.desktop
+}
diff --git a/sys-apps/bleachbit/bleachbit-1.9.1.ebuild b/sys-apps/bleachbit/bleachbit-1.9.1.ebuild
new file mode 100644
index 000000000000..d07636decf75
--- /dev/null
+++ b/sys-apps/bleachbit/bleachbit-1.9.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PLOCALES="ar ast be bg bn bs ca cs da de el en_AU en_GB eo es et eu fa fi fo fr gl he hi hr hu hy ia id it ja ko ku ky lt lv
+ms my nb nds nl nn pl pt_BR pt ro ru se si sk sl sr sv ta te th tr ug uk uz vi zh_CN zh_TW"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit distutils-r1 eutils l10n
+
+DESCRIPTION="Clean junk to free disk space and to maintain privacy"
+HOMEPAGE="http://bleachbit.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+gtk nls"
+
+RDEPEND="gtk? ( dev-python/pygtk:2[$PYTHON_USEDEP] )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+DOCS=( README.md )
+
+python_prepare_all() {
+ rem_locale() {
+ rm "po/${1}.po" || die "removing of ${1}.po failed"
+ }
+
+ l10n_find_plocales_changes po "" ".po"
+ l10n_for_each_disabled_locale_do rem_locale
+
+ #addpredict /root/.gnome2 #401981
+
+ # warning: key "Encoding" in group "Desktop Entry" is deprecated
+ sed -i -e '/Encoding/d' ${PN}.desktop || die
+
+ # choose correct Python implementation, bug #465254
+ sed -i -e 's/python/$(PYTHON)/g' po/Makefile || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use nls && emake -C po
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+ use nls && emake -C po DESTDIR="${D}" install
+
+ # http://bugs.gentoo.org/388999
+ insinto /usr/share/${PN}/cleaners
+ doins cleaners/*.xml
+
+ newbin ${PN}.py ${PN}
+ python_replicate_script "${D}/usr/bin/${PN}"
+
+ doicon ${PN}.png
+ domenu ${PN}.desktop
+}
diff --git a/sys-apps/bleachbit/metadata.xml b/sys-apps/bleachbit/metadata.xml
new file mode 100644
index 000000000000..21591c8dd36e
--- /dev/null
+++ b/sys-apps/bleachbit/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>dastergon@gentoo.org</email>
+ <name>Pavlos Ratis</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">bleachbit</remote-id>
+ <bugs-to>http://bugs.launchpad.net/bleachbit</bugs-to>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
new file mode 100644
index 000000000000..70008b2c9a26
--- /dev/null
+++ b/sys-apps/busybox/Manifest
@@ -0,0 +1,8 @@
+DIST busybox-1.20.2.tar.bz2 2186738 SHA256 eb13ff01dae5618ead2ef6f92ba879e9e0390f9583bd545d8789d27cf39b6882 SHA512 089b67cd920f332daf910711739b1e55ba4c76cfa2122dfe5464432e0d76d3af8327837ebc3cc9954deef3e8f766d16a1928aecb2c169fe3de5a722eea7ea3dd WHIRLPOOL aa8fec92d0ac8bb246dea7353537d425a5fecfa0bb807d0e291c7351e8289b84aab83303c45b75f9b7a98cd10177e210511064f0709425c2f84b069fe6a06420
+DIST busybox-1.21.0.tar.bz2 2200841 SHA256 eb9d268627783297f5f459cb9bd61a94e395dc7cb3647e10ec186e0159aa36ed SHA512 ddafded24881f03db550d9793585bb5442c70f2a60a5d9770126f50981dadfe95fc0b280f83d5b8a8ce21c86bb7ce64e9f1a606cea140fb2f2599a21de55ba31 WHIRLPOOL d50378bb823dd59e8a607ed6a72d4890f4e5ad3304f1ddba9f7f3d49b5ab820acc9daa2b3c4619f8b147dec085c53c3c6f4b4ebe4c60b431299031d2af00a4d3
+DIST busybox-1.21.1.tar.bz2 2201917 SHA256 cd5be0912ec856110ae12c76c3ec9cd5cba1df45b5a9da2b095b8284d1481303 SHA512 b1dd626e1c111214ebd9b933ce2465c943fd8a0a515b6962a31f3a76276ff7992c21b7f96eeb9baeb861a5e734689054e6df5dd6414c753c37084e2d705810e1 WHIRLPOOL 8ec0d9c23d8e2eb28e7f8e88f076908cf6a3f7b64aabd0a7a1af2200064a5337c82fdac9450726236e0632faa202ea08396ca5c35e5334c2128a307adbdd736c
+DIST busybox-1.22.0.tar.bz2 2218120 SHA256 92f00cd391b7d5fa2215c8450abe2ba15f9d16c226e8855fb21b6c9a5b723a53 SHA512 75d00fbad703d942c5a6882bda0c66fde32fb480ee9693c8da8107c2088ec5c95aad8eb3dbb2feceed095e133916fea27136328b7a1eba47e3b63bf50bc40a66 WHIRLPOOL 055aba8e8d116f664f61458f32c31c08bfdb0db97934eb00af02098981e25665aff16e9a371234a6859e4954d1568603a99ca7d6925cd42a27e7dae30523514f
+DIST busybox-1.22.1.tar.bz2 2218650 SHA256 ae0b029d0a9e4dd71a077a790840e496dd838998e4571b87b60fed7462b6678b SHA512 3e99fe373d638f714c3a61e1b02493d85ca532f472df038f7557db518ded38347072882ed568852941be7aac46fc34007257b4287375335ff5a09b60b295ce80 WHIRLPOOL 8f022480960b81d673772bdda857b5b3860edd893a833a64f5184ec6816b6b0f328079ca67ec1ba1d288a7c4b805b39c6038f0d385884762a396a86ccea7b0c8
+DIST busybox-1.23.0.tar.bz2 2253001 SHA256 483ab594dd962ddbb332fd24e36ffdd6e36ac2182fbff055c56e1ca49fda09e4 SHA512 02c8f9dd9e47ad67b417fa58ba952bbdda6e79bad5399fba3d8217803053c2fd045228bd76d56e97d40c98296841dc66e4fa829887c05378a83bdeabafeb7f72 WHIRLPOOL 01d68487d4d3cff4fb807970446f42db1dec3309fdd3fb0402f138eee28dc0885dba324b5b12b417effd4fad87581a32da09a0e9f7c050377025a52ecce2308b
+DIST busybox-1.23.1.tar.bz2 2252635 SHA256 300f1db0a7ca4ecee8f8d8027aba250b903372e8339b7d9123d37c1e900473bf SHA512 60849c220dde596c4197f16dd844573b24dd46c8544345a2d5a2b1976fa0ac340d22fbc97f5a1437b7de1c04f4e16aa07b3d62bc77eb83b2467582a50ed4b362 WHIRLPOOL 7cd25e42e74663849b094df699a72deaf02b1088064a511341f76aaa419c936557bbafd54523c6818082dfd4e17605f06ee51abed238ef57a56a9be12c910f99
+DIST busybox-1.23.2.tar.bz2 2252786 SHA256 05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a SHA512 209c8ef26e40ccb81510f6b663202b080f9bbecac7faf386bbabf7e36a43d63b15dd6ce9f7a84c1ccc5345c524999812251da1e113ef9faadc6af1fedd24c7c9 WHIRLPOOL a0396f7f49ae702f1617e72d5d4646aceec4eba67219c7125bd8d0926d1acb1ef41ea15a7406c3cf5e5e0d8925cc75910ed5128e5fbdd257b80e2cb4f7a048a2
diff --git a/sys-apps/busybox/busybox-1.20.2.ebuild b/sys-apps/busybox/busybox-1.20.2.ebuild
new file mode 100644
index 000000000000..465f436de71c
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.20.2.ebuild
@@ -0,0 +1,291 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+################################################################################
+# BUSYBOX ALTERNATE CONFIG MINI-HOWTO
+#
+# Busybox can be modified in many different ways. Here's a few ways to do it:
+#
+# (1) Emerge busybox with FEATURES=keepwork so the work directory won't
+# get erased afterwards. Add a definition like ROOT=/my/root/path to the
+# start of the line if you're installing to somewhere else than the root
+# directory. This command will save the default configuration to
+# ${PORTAGE_CONFIGROOT} (or ${ROOT} if ${PORTAGE_CONFIGROOT} is not
+# defined), and it will tell you that it has done this. Note the location
+# where the config file was saved.
+#
+# FEATURES=keepwork USE=savedconfig emerge busybox
+#
+# (2) Go to the work directory and change the configuration of busybox using its
+# menuconfig feature.
+#
+# cd /var/tmp/portage/busybox*/work/busybox-*
+# make menuconfig
+#
+# (3) Save your configuration to the default location and copy it to the
+# one of the locations listed in /usr/portage/eclass/savedconfig.eclass
+#
+# (4) Emerge busybox with USE=savedconfig to use the configuration file you
+# just generated.
+#
+################################################################################
+#
+# (1) Alternatively skip the above steps and simply emerge busybox without
+# USE=savedconfig.
+#
+# (2) Edit the file it saves by hand. ${ROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF}
+#
+# (3) Remerge busybox as using USE=savedconfig.
+#
+################################################################################
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static systemd"
+RESTRICT="test"
+
+RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ case $1 in
+ y) sed -i -e "s:.*\<CONFIG_$2\>.*set:CONFIG_$2=y:g" .config;;
+ n) sed -i -e "s:CONFIG_$2=y:# CONFIG_$2 is not set:g" .config;;
+ *) use $1 \
+ && busybox_config_option y $2 \
+ || busybox_config_option n $2
+ return 0
+ ;;
+ esac
+ einfo $(grep "CONFIG_$2[= ]" .config || echo Could not find CONFIG_$2 ...)
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${PN}-1.20.0-udhcpc6-ipv6.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 allyesconfig > /dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.rc.1 mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.21.0.ebuild b/sys-apps/busybox/busybox-1.21.0.ebuild
new file mode 100644
index 000000000000..6bb6f6d97142
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.21.0.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 allyesconfig > /dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.rc.1 mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.21.1.ebuild b/sys-apps/busybox/busybox-1.21.1.ebuild
new file mode 100644
index 000000000000..7db94ece64a5
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.21.1.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 allyesconfig > /dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.rc.1 mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.22.0.ebuild b/sys-apps/busybox/busybox-1.22.0.ebuild
new file mode 100644
index 000000000000..82f62c91a3b1
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.22.0.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 allyesconfig > /dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.rc.1 mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.22.1-r1.ebuild b/sys-apps/busybox/busybox-1.22.1-r1.ebuild
new file mode 100644
index 000000000000..d6d5bfa41449
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.22.1-r1.ebuild
@@ -0,0 +1,300 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s defconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.rc.1 mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.22.1.ebuild b/sys-apps/busybox/busybox-1.22.1.ebuild
new file mode 100644
index 000000000000..9d6a3e71acc5
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.22.1.ebuild
@@ -0,0 +1,299 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${RDEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 allyesconfig > /dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.rc.1 mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.23.0-r1.ebuild b/sys-apps/busybox/busybox-1.23.0-r1.ebuild
new file mode 100644
index 000000000000..e413eeeaceac
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.0-r1.ebuild
@@ -0,0 +1,302 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+RDEPEND="${COMMON_DEPEND}
+mdev? ( !<sys-apps/openrc-0.13 )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+# epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s allyesconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.23.1-r1.ebuild b/sys-apps/busybox/busybox-1.23.1-r1.ebuild
new file mode 100644
index 000000000000..66057b0d009e
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.1-r1.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ppc ppc64 s390 sh ~sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+RDEPEND="${COMMON_DEPEND}
+mdev? ( !<sys-apps/openrc-0.13 )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s allyesconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n START_STOP_DAEMON
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.23.1.ebuild b/sys-apps/busybox/busybox-1.23.1.ebuild
new file mode 100644
index 000000000000..ad6264807fbb
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.1.ebuild
@@ -0,0 +1,302 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+RDEPEND="${COMMON_DEPEND}
+mdev? ( !<sys-apps/openrc-0.13 )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+# epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s allyesconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-1.23.2.ebuild b/sys-apps/busybox/busybox-1.23.2.ebuild
new file mode 100644
index 000000000000..5492e2b35977
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.2.ebuild
@@ -0,0 +1,305 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+RDEPEND="${COMMON_DEPEND}
+mdev? ( !<sys-apps/openrc-0.13 )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+ epatch "${FILESDIR}"/${PN}-1.23.1-trylink-flags.patch
+ # No busybox-1.23.2 specific patches ... yet!
+ #epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s allyesconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n START_STOP_DAEMON
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/busybox-9999.ebuild b/sys-apps/busybox/busybox-9999.ebuild
new file mode 100644
index 000000000000..c51709160450
--- /dev/null
+++ b/sys-apps/busybox/busybox-9999.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
+
+EAPI="4"
+inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
+
+DESCRIPTION="Utilities for rescue and embedded systems"
+HOMEPAGE="http://www.busybox.net/"
+if [[ ${PV} == "9999" ]] ; then
+ MY_P=${PN}
+ EGIT_REPO_URI="git://busybox.net/busybox.git"
+ inherit git-2
+else
+ MY_P=${PN}-${PV/_/-}
+ SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
+RESTRICT="test"
+
+COMMON_DEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
+ pam? ( sys-libs/pam )"
+DEPEND="${COMMON_DEPEND}
+ static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
+ >=sys-kernel/linux-headers-2.6.39"
+RDEPEND="${COMMON_DEPEND}
+mdev? ( !<sys-apps/openrc-0.13 )"
+
+S=${WORKDIR}/${MY_P}
+
+busybox_config_option() {
+ local flag=$1 ; shift
+ if [[ ${flag} != [yn] ]] ; then
+ busybox_config_option $(usex ${flag} y n) "$@"
+ return
+ fi
+ while [[ $# -gt 0 ]] ; do
+ if [[ ${flag} == "y" ]] ; then
+ sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
+ else
+ sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
+ fi
+ einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
+ shift
+ done
+}
+
+busybox_config_enabled() {
+ local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
+ case ${val} in
+ "") return 1 ;;
+ y) return 0 ;;
+ *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
+ esac
+}
+
+src_prepare() {
+ unset KBUILD_OUTPUT #88088
+ append-flags -fno-strict-aliasing #310413
+ use ppc64 && append-flags -mminimal-toc #130943
+
+ # patches go here!
+ epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
+# epatch "${FILESDIR}"/${P}-*.patch
+ cp "${FILESDIR}"/ginit.c init/ || die
+
+ # flag cleanup
+ sed -i -r \
+ -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
+ Makefile.flags || die
+ #sed -i '/bbsh/s:^//::' include/applets.h
+ sed -i '/^#error Aborting compilation./d' applets/applets.c || die
+ use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
+ sed -i \
+ -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
+ -e "/^AR\>/s:=.*:= $(tc-getAR):" \
+ -e "/^CC\>/s:=.*:= $(tc-getCC):" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
+ Makefile || die
+ sed -i \
+ -e 's:-static-libgcc::' \
+ Makefile.flags || die
+}
+
+src_configure() {
+ # check for a busybox config before making one of our own.
+ # if one exist lets return and use it.
+
+ restore_config .config
+ if [ -f .config ]; then
+ yes "" | emake -j1 -s oldconfig >/dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ fi
+
+ # setup the config file
+ emake -j1 -s allyesconfig >/dev/null
+ # nommu forces a bunch of things off which we want on #387555
+ busybox_config_option n NOMMU
+ sed -i '/^#/d' .config
+ yes "" | emake -j1 -s oldconfig >/dev/null
+
+ # now turn off stuff we really don't want
+ busybox_config_option n DMALLOC
+ busybox_config_option n FEATURE_SUID_CONFIG
+ busybox_config_option n BUILD_AT_ONCE
+ busybox_config_option n BUILD_LIBBUSYBOX
+ busybox_config_option n FEATURE_CLEAN_UP
+ busybox_config_option n MONOTONIC_SYSCALL
+ busybox_config_option n START_STOP_DAEMON
+ busybox_config_option n USE_PORTABLE_CODE
+ busybox_config_option n WERROR
+
+ # If these are not set and we are using a uclibc/busybox setup
+ # all calls to system() will fail.
+ busybox_config_option y ASH
+ busybox_config_option n HUSH
+
+ # disable ipv6 applets
+ if ! use ipv6; then
+ busybox_config_option n FEATURE_IPV6
+ busybox_config_option n TRACEROUTE6
+ busybox_config_option n PING6
+ busybox_config_option n UDHCPC6
+ fi
+
+ if use static && use pam ; then
+ ewarn "You cannot have USE='static pam'. Assuming static is more important."
+ fi
+ busybox_config_option $(usex static n pam) PAM
+ busybox_config_option static STATIC
+ busybox_config_option syslog {K,SYS}LOGD LOGGER
+ busybox_config_option systemd FEATURE_SYSTEMD
+ busybox_config_option math FEATURE_AWK_LIBM
+
+ # all the debug options are compiler related, so punt them
+ busybox_config_option n DEBUG
+ busybox_config_option y NO_DEBUG_LIB
+ busybox_config_option n DMALLOC
+ busybox_config_option n EFENCE
+ busybox_config_option $(usex debug y n) TFTP_DEBUG
+
+ busybox_config_option selinux SELINUX
+
+ # this opt only controls mounting with <linux-2.6.23
+ busybox_config_option n FEATURE_MOUNT_NFS
+
+ # default a bunch of uncommon options to off
+ local opt
+ for opt in \
+ ADD_SHELL \
+ BEEP BOOTCHARTD \
+ CRONTAB \
+ DC DEVFSD DNSD DPKG{,_DEB} \
+ FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
+ FEATURE_DEVFS \
+ HOSTID HUSH \
+ INETD INOTIFYD IPCALC \
+ LOCALE_SUPPORT LOGNAME LPD \
+ MAKEMIME MKFS_MINIX MSH \
+ OD \
+ RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
+ SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
+ TASKSET TCPSVD \
+ RPM RPM2CPIO \
+ UDPSVD UUDECODE UUENCODE
+ do
+ busybox_config_option n ${opt}
+ done
+
+ emake -j1 oldconfig > /dev/null
+}
+
+src_compile() {
+ unset KBUILD_OUTPUT #88088
+ export SKIP_STRIP=y
+
+ emake V=1 busybox
+}
+
+src_install() {
+ unset KBUILD_OUTPUT #88088
+ save_config .config
+
+ into /
+ dodir /bin
+ if use sep-usr ; then
+ # install /ginit to take care of mounting stuff
+ exeinto /
+ newexe busybox_unstripped ginit
+ dosym /ginit /bin/bb
+ dosym bb /bin/busybox
+ else
+ newbin busybox_unstripped busybox
+ dosym busybox /bin/bb
+ fi
+ if use mdev ; then
+ dodir /$(get_libdir)/mdev/
+ use make-symlinks || dosym /bin/bb /sbin/mdev
+ cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
+
+ exeinto /$(get_libdir)/mdev/
+ doexe "${FILESDIR}"/mdev/*
+
+ newinitd "${FILESDIR}"/mdev.initd mdev
+ fi
+ if use livecd ; then
+ dosym busybox /bin/vi
+ fi
+
+ # add busybox daemon's, bug #444718
+ if busybox_config_enabled FEATURE_NTPD_SERVER; then
+ newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
+ newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
+ fi
+ if busybox_config_enabled SYSLOGD; then
+ newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
+ newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
+ fi
+ if busybox_config_enabled KLOGD; then
+ newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
+ newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
+ fi
+ if busybox_config_enabled WATCHDOG; then
+ newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
+ newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
+ fi
+ if busybox_config_enabled UDHCPC; then
+ local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
+ exeinto "${path%/*}"
+ newexe examples/udhcp/simple.script "${path##*/}"
+ fi
+ if busybox_config_enabled UDHCPD; then
+ insinto /etc
+ doins examples/udhcp/udhcpd.conf
+ fi
+
+ # bundle up the symlink files for use later
+ emake DESTDIR="${ED}" install
+ rm _install/bin/busybox
+ # for compatibility, provide /usr/bin/env
+ mkdir -p _install/usr/bin
+ ln -s /bin/env _install/usr/bin/env
+ tar cf busybox-links.tar -C _install . || : #;die
+ insinto /usr/share/${PN}
+ use make-symlinks && doins busybox-links.tar
+
+ dodoc AUTHORS README TODO
+
+ cd docs
+ docinto txt
+ dodoc *.txt
+ docinto pod
+ dodoc *.pod
+ dohtml *.html
+
+ cd ../examples
+ docinto examples
+ dodoc inittab depmod.pl *.conf *.script undeb unrpm
+}
+
+pkg_preinst() {
+ if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
+ ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
+ ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
+ ewarn "If you are creating a binary only and not merging this is probably ok."
+ ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
+ die "silly options will destroy your system"
+ fi
+
+ if use make-symlinks ; then
+ mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
+ fi
+}
+
+pkg_postinst() {
+ savedconfig_pkg_postinst
+
+ if use make-symlinks ; then
+ cd "${T}" || die
+ mkdir _install
+ tar xf busybox-links.tar -C _install || die
+ cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
+ fi
+
+ if use sep-usr ; then
+ elog "In order to use the sep-usr support, you have to update your"
+ elog "kernel command line. Add the option:"
+ elog " init=/ginit"
+ elog "To launch a different init than /sbin/init, use:"
+ elog " init=/ginit /sbin/yourinit"
+ elog "To get a rescue shell, you may boot with:"
+ elog " init=/ginit bb"
+ fi
+}
diff --git a/sys-apps/busybox/files/busybox-1.19.0-bb.patch b/sys-apps/busybox/files/busybox-1.19.0-bb.patch
new file mode 100644
index 000000000000..a66b45a5e21d
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.19.0-bb.patch
@@ -0,0 +1,22 @@
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -75,6 +75,8 @@
+ //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
+ //applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
+ //applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
++//applet:IF_ASH(APPLET_ODDNAME(bb, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
++//applet:IF_ASH(APPLET_ODDNAME(bbsh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
+
+ //kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
+ //kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -7255,6 +7255,8 @@
+ }
+ /* re-exec ourselves with the new arguments */
+ execve(bb_busybox_exec_path, argv, envp);
++ execve("/bin/busybox.static", argv, envp);
++ execve("/bin/busybox", argv, envp);
+ /* If they called chroot or otherwise made the binary no longer
+ * executable, fall through */
+ }
diff --git a/sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch b/sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch
new file mode 100644
index 000000000000..0148809d0fd3
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.20.0-udhcpc6-ipv6.patch
@@ -0,0 +1,33 @@
+From 3da46c8163ecf14a02f8317d0b76b225eceaf28c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 2 May 2012 21:45:35 -0400
+Subject: [PATCH] udhcpc6: depend on ipv6
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ networking/udhcp/d6_dhcpc.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
+index a792a9d..7c9f52a 100644
+--- a/networking/udhcp/d6_dhcpc.c
++++ b/networking/udhcp/d6_dhcpc.c
+@@ -12,10 +12,11 @@
+ */
+
+ //config:config UDHCPC6
+-//config: bool "udhcp client for DHCPv6 (udhcpc6)"
+-//config: default n # not yet ready
+-//config: help
+-//config: udhcpc6 is a DHCPv6 client
++//config: bool "udhcp client for DHCPv6 (udhcpc6)"
++//config: default n # not yet ready
++//config: depends on FEATURE_IPV6
++//config: help
++//config: udhcpc6 is a DHCPv6 client
+
+ //applet:IF_UDHCPC6(APPLET(udhcpc6, BB_DIR_USR_BIN, BB_SUID_DROP))
+
+--
+1.7.9.7
+
diff --git a/sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch b/sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch
new file mode 100644
index 000000000000..f682d00f7022
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.20.2-glibc-sys-resource.patch
@@ -0,0 +1,109 @@
+https://bugs.gentoo.org/424954
+
+From c5fe9f7b723f949457263ef8e22ab807d5b549ce Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 5 Jul 2012 23:19:09 -0400
+Subject: [PATCH] include sys/resource.h where needed
+
+We use functions from sys/resource.h in misc applets, but don't include
+the header. This breaks building with newer glibc versions, so add the
+include where needed.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ loginutils/passwd.c | 1 +
+ miscutils/time.c | 1 +
+ networking/inetd.c | 1 +
+ networking/ntpd.c | 1 +
+ networking/ntpd_simple.c | 1 +
+ runit/chpst.c | 1 +
+ shell/shell_common.c | 1 +
+ 7 files changed, 7 insertions(+)
+
+diff --git a/loginutils/passwd.c b/loginutils/passwd.c
+index b83db00..a7006f0 100644
+--- a/loginutils/passwd.c
++++ b/loginutils/passwd.c
+@@ -15,6 +15,7 @@
+
+ #include "libbb.h"
+ #include <syslog.h>
++#include <sys/resource.h> /* setrlimit */
+
+ static void nuke_str(char *str)
+ {
+diff --git a/miscutils/time.c b/miscutils/time.c
+index 945f15f..ffed386 100644
+--- a/miscutils/time.c
++++ b/miscutils/time.c
+@@ -16,6 +16,7 @@
+ //usage: "\n -v Verbose"
+
+ #include "libbb.h"
++#include <sys/resource.h> /* getrusage */
+
+ /* Information on the resources used by a child process. */
+ typedef struct {
+diff --git a/networking/inetd.c b/networking/inetd.c
+index 1308d74..00baf69 100644
+--- a/networking/inetd.c
++++ b/networking/inetd.c
+@@ -165,6 +165,7 @@
+ //usage: "\n (default: 0 - disabled)"
+
+ #include <syslog.h>
++#include <sys/resource.h> /* setrlimit */
+ #include <sys/un.h>
+
+ #include "libbb.h"
+diff --git a/networking/ntpd.c b/networking/ntpd.c
+index 72e9d0b..5b92db6 100644
+--- a/networking/ntpd.c
++++ b/networking/ntpd.c
+@@ -46,6 +46,7 @@
+ #include "libbb.h"
+ #include <math.h>
+ #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
++#include <sys/resource.h> /* setpriority */
+ #include <sys/timex.h>
+ #ifndef IPTOS_LOWDELAY
+ # define IPTOS_LOWDELAY 0x10
+diff --git a/networking/ntpd_simple.c b/networking/ntpd_simple.c
+index 4ad44e4..1b7c66b 100644
+--- a/networking/ntpd_simple.c
++++ b/networking/ntpd_simple.c
+@@ -7,6 +7,7 @@
+ */
+ #include "libbb.h"
+ #include <netinet/ip.h> /* For IPTOS_LOWDELAY definition */
++#include <sys/resource.h> /* setpriority */
+ #ifndef IPTOS_LOWDELAY
+ # define IPTOS_LOWDELAY 0x10
+ #endif
+diff --git a/runit/chpst.c b/runit/chpst.c
+index ac296ba..ed72c8b 100644
+--- a/runit/chpst.c
++++ b/runit/chpst.c
+@@ -91,6 +91,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ //usage: "\n a SIGXCPU after N seconds"
+
+ #include "libbb.h"
++#include <sys/resource.h> /* getrlimit */
+
+ /*
+ Five applets here: chpst, envdir, envuidgid, setuidgid, softlimit.
+diff --git a/shell/shell_common.c b/shell/shell_common.c
+index 51c92d6..780e27e 100644
+--- a/shell/shell_common.c
++++ b/shell/shell_common.c
+@@ -18,6 +18,7 @@
+ */
+ #include "libbb.h"
+ #include "shell_common.h"
++#include <sys/resource.h> /* getrlimit */
+
+ const char defifsvar[] ALIGN1 = "IFS= \t\n";
+
+--
+1.7.9.7
+
diff --git a/sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch b/sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch
new file mode 100644
index 000000000000..5e9ef26d056e
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.20.2-selinux-pkg-config.patch
@@ -0,0 +1,67 @@
+From 5694afd72a0a424fcdd2ac85838229a1a86b7e84 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 20 Oct 2012 15:01:26 -0400
+Subject: [PATCH] build system: use pkg-config to look up selinux libs
+
+Newer versions of libselinux has started linking against more libs.
+Rather than continuing hardcoding things, switch to using pkg-config
+to query for its dependencies.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 1 +
+ Makefile.flags | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index b2e9477..8995ff5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -297,6 +297,7 @@ NM = $(CROSS_COMPILE)nm
+ STRIP = $(CROSS_COMPILE)strip
+ OBJCOPY = $(CROSS_COMPILE)objcopy
+ OBJDUMP = $(CROSS_COMPILE)objdump
++PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
+ AWK = awk
+ GENKSYMS = scripts/genksyms/genksyms
+ DEPMOD = /sbin/depmod
+diff --git a/Makefile.flags b/Makefile.flags
+index e77c0e5..307afa7 100644
+--- a/Makefile.flags
++++ b/Makefile.flags
+@@ -78,6 +78,12 @@ ARCH_FPIC ?= -fpic
+ ARCH_FPIE ?= -fpie
+ ARCH_PIE ?= -pie
+
++# Usage: $(eval $(call pkg_check_modules,VARIABLE-PREFIX,MODULES))
++define pkg_check_modules
++$(1)_CFLAGS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags $(2))
++$(1)_LIBS := $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs $(2))
++endef
++
+ ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+ # on i386: 14% smaller libbusybox.so
+ # (code itself is 9% bigger, we save on relocs/PLT/GOT)
+@@ -89,6 +95,7 @@ endif
+
+ ifeq ($(CONFIG_STATIC),y)
+ CFLAGS_busybox += -static
++PKG_CONFIG_FLAGS += --static
+ endif
+
+ ifeq ($(CONFIG_PIE),y)
+@@ -131,7 +138,10 @@ LDLIBS += pam pam_misc pthread
+ endif
+
+ ifeq ($(CONFIG_SELINUX),y)
+-LDLIBS += selinux sepol
++SELINUX_PC_MODULES = libselinux libsepol
++$(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES)))
++CPPFLAGS += $(SELINUX_CFLAGS)
++LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%))
+ endif
+
+ ifeq ($(CONFIG_EFENCE),y)
+--
+1.7.12
+
diff --git a/sys-apps/busybox/files/busybox-1.21.0-mdev.patch b/sys-apps/busybox/files/busybox-1.21.0-mdev.patch
new file mode 100644
index 000000000000..cb873fafc19d
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.21.0-mdev.patch
@@ -0,0 +1,35 @@
+--- busybox-1.21.0/util-linux/mdev.c
++++ busybox-1.21.0-mdev/util-linux/mdev.c
+@@ -661,6 +661,8 @@ static void make_device(char *device_nam
+ if (mknod(node_name, rule->mode | type, makedev(major, minor)) && errno != EEXIST)
+ bb_perror_msg("can't create '%s'", node_name);
+ if (ENABLE_FEATURE_MDEV_CONF) {
++ if (G.verbose)
++ bb_error_msg("chmod: %o chown: %u:%u", rule->mode, rule->ugid.uid, rule->ugid.gid);
+ chmod(node_name, rule->mode);
+ chown(node_name, rule->ugid.uid, rule->ugid.gid);
+ }
+@@ -813,6 +815,7 @@ static void load_firmware(const char *fi
+ full_write(loading_fd, "-1", 2);
+
+ out:
++ xchdir("/dev");
+ if (ENABLE_FEATURE_CLEAN_UP) {
+ close(firmware_fd);
+ close(loading_fd);
+@@ -919,11 +922,13 @@ int mdev_main(int argc UNUSED_PARAM, cha
+ }
+
+ {
+- int logfd = open("/dev/mdev.log", O_WRONLY | O_APPEND);
++ int logfd = open("mdev.log", O_WRONLY | O_APPEND);
+ if (logfd >= 0) {
+ xmove_fd(logfd, STDERR_FILENO);
+ G.verbose = 1;
+- bb_error_msg("seq: %s action: %s", seq, action);
++ if (seq)
++ applet_name = xasprintf("%s[%s]", applet_name, seq);
++ bb_error_msg("action: %s", action);
+ }
+ }
+
diff --git a/sys-apps/busybox/files/busybox-1.21.0-platform.patch b/sys-apps/busybox/files/busybox-1.21.0-platform.patch
new file mode 100644
index 000000000000..9be6cb8f21d9
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.21.0-platform.patch
@@ -0,0 +1,24 @@
+--- busybox-1.21.0/archival/libarchive/decompress_unxz.c
++++ busybox-1.21.0-platform/archival/libarchive/decompress_unxz.c
+@@ -30,8 +30,8 @@ static uint32_t xz_crc32(const uint8_t *
+ /* We use arch-optimized unaligned accessors */
+ #define get_unaligned_le32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_LE32(v); })
+ #define get_unaligned_be32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_BE32(v); })
+-#define put_unaligned_le32(val, buf) move_to_unaligned16(buf, SWAP_LE32(val))
+-#define put_unaligned_be32(val, buf) move_to_unaligned16(buf, SWAP_BE32(val))
++#define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
++#define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
+
+ #include "unxz/xz_dec_bcj.c"
+ #include "unxz/xz_dec_lzma2.c"
+--- busybox-1.21.0/include/platform.h
++++ busybox-1.21.0-platform/include/platform.h
+@@ -228,7 +228,7 @@ typedef uint32_t bb__aliased_uint32_t FI
+ # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
+ # define move_to_unaligned16(u16p, v) do { \
+ uint16_t __t = (v); \
+- memcpy((u16p), &__t, 4); \
++ memcpy((u16p), &__t, 2); \
+ } while (0)
+ # define move_to_unaligned32(u32p, v) do { \
+ uint32_t __t = (v); \
diff --git a/sys-apps/busybox/files/busybox-1.21.0-xz.patch b/sys-apps/busybox/files/busybox-1.21.0-xz.patch
new file mode 100644
index 000000000000..56ba1a2731e6
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.21.0-xz.patch
@@ -0,0 +1,84 @@
+--- busybox-1.21.0/archival/libarchive/decompress_unxz.c
++++ busybox-1.21.0-xz/archival/libarchive/decompress_unxz.c
+@@ -40,6 +40,7 @@ static uint32_t xz_crc32(const uint8_t *
+ IF_DESKTOP(long long) int FAST_FUNC
+ unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
+ {
++ enum xz_ret xz_result;
+ struct xz_buf iobuf;
+ struct xz_dec *state;
+ unsigned char *membuf;
+@@ -63,9 +64,8 @@ unpack_xz_stream(transformer_aux_data_t
+ /* Limit memory usage to about 64 MiB. */
+ state = xz_dec_init(XZ_DYNALLOC, 64*1024*1024);
+
++ xz_result = X_OK;
+ while (1) {
+- enum xz_ret r;
+-
+ if (iobuf.in_pos == iobuf.in_size) {
+ int rd = safe_read(src_fd, membuf, BUFSIZ);
+ if (rd < 0) {
+@@ -73,28 +73,57 @@ unpack_xz_stream(transformer_aux_data_t
+ total = -1;
+ break;
+ }
++ if (rd == 0 && xz_result == XZ_STREAM_END)
++ break;
+ iobuf.in_size = rd;
+ iobuf.in_pos = 0;
+ }
++ if (xz_result == XZ_STREAM_END) {
++ /*
++ * Try to start decoding next concatenated stream.
++ * Stream padding must always be a multiple of four
++ * bytes to preserve four-byte alignment. To keep the
++ * code slightly smaller, we aren't as strict here as
++ * the .xz spec requires. We just skip all zero-bytes
++ * without checking the alignment and thus can accept
++ * files that aren't valid, e.g. the XZ utils test
++ * files bad-0pad-empty.xz and bad-0catpad-empty.xz.
++ */
++ do {
++ if (membuf[iobuf.in_pos] != 0) {
++ xz_dec_reset(state);
++ goto do_run;
++ }
++ iobuf.in_pos++;
++ } while (iobuf.in_pos < iobuf.in_size);
++ }
++ do_run:
+ // bb_error_msg(">in pos:%d size:%d out pos:%d size:%d",
+ // iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size);
+- r = xz_dec_run(state, &iobuf);
++ xz_result = xz_dec_run(state, &iobuf);
+ // bb_error_msg("<in pos:%d size:%d out pos:%d size:%d r:%d",
+-// iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, r);
++// iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, xz_result);
+ if (iobuf.out_pos) {
+ xwrite(dst_fd, iobuf.out, iobuf.out_pos);
+ IF_DESKTOP(total += iobuf.out_pos;)
+ iobuf.out_pos = 0;
+ }
+- if (r == XZ_STREAM_END) {
+- break;
++ if (xz_result == XZ_STREAM_END) {
++ /*
++ * Can just "break;" here, if not for concatenated
++ * .xz streams.
++ * Checking for padding may require buffer
++ * replenishment. Can't do it here.
++ */
++ continue;
+ }
+- if (r != XZ_OK && r != XZ_UNSUPPORTED_CHECK) {
++ if (xz_result != XZ_OK && xz_result != XZ_UNSUPPORTED_CHECK) {
+ bb_error_msg("corrupted data");
+ total = -1;
+ break;
+ }
+ }
++
+ xz_dec_end(state);
+ free(membuf);
+
diff --git a/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch b/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch
new file mode 100644
index 000000000000..bbd9e554c241
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.21.1-trylink-only-prefix-libs-with-l.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/484560
+
+From 3eab2b7675fc7e2889cd69285a2a31980a4bf504 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 12 Sep 2013 00:29:40 -0400
+Subject: [PATCH] trylink: only prefix libs with -l
+
+If our pkg-config queries pass back a flag like -pthread, the trylink
+script will expand that to -l-pthread. So change trylink to only add
+the -l prefix to a value that doesn't have a - prefix already.
+
+Reported-by: thaehaid@incognitomail.org
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ scripts/trylink | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/trylink b/scripts/trylink
+index a8b0b2e..e471699 100755
+--- a/scripts/trylink
++++ b/scripts/trylink
+@@ -117,7 +117,7 @@ LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
+ # First link with all libs. If it fails, bail out
+ echo "Trying libraries: $LDLIBS"
+ # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
+-l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
++l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
+ test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
+ try $CC $CFLAGS $LDFLAGS \
+ -o $EXE \
+@@ -141,7 +141,7 @@ while test "$LDLIBS"; do
+ for one in $LDLIBS; do
+ without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs`
+ # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
+- l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
++ l_list=`echo " $without_one " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
+ test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP"
+ $debug && echo "Trying -l options: '$l_list'"
+ try $CC $CFLAGS $LDFLAGS \
+@@ -172,7 +172,7 @@ done
+
+ # Make the binary with final, minimal list of libs
+ echo "Final link with: ${LDLIBS:-<none>}"
+-l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
++l_list=`echo " $LDLIBS " | sed -e 's: \([^- ][^ ]*\): -l\1:g'`
+ test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
+ # --verbose gives us gobs of info to stdout (e.g. linker script used)
+ if ! test -f busybox_ldscript; then
+--
+1.8.3.2
+
diff --git a/sys-apps/busybox/files/busybox-1.22.0-find.patch b/sys-apps/busybox/files/busybox-1.22.0-find.patch
new file mode 100644
index 000000000000..75a06a85880f
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.0-find.patch
@@ -0,0 +1,40 @@
+--- busybox-1.22.0/findutils/find.c
++++ busybox-1.22.0-find/findutils/find.c
+@@ -1291,9 +1291,27 @@ int find_main(int argc, char **argv) MAI
+ int find_main(int argc UNUSED_PARAM, char **argv)
+ {
+ int i, firstopt, status = EXIT_SUCCESS;
++ char **past_HLP, *saved;
+
+ INIT_G();
+
++ /* "find -type f" + getopt("+HLP") => disaster.
++ * Need to avoid getopt running into a non-HLP option.
++ * Do this by temporarily storing NULL there:
++ */
++ past_HLP = argv;
++ for (;;) {
++ saved = *++past_HLP;
++ if (!saved)
++ break;
++ if (saved[0] != '-')
++ break;
++ if (!saved[1])
++ break; /* it is "-" */
++ if ((saved+1)[strspn(saved+1, "HLP")] != '\0')
++ break;
++ }
++ *past_HLP = NULL;
+ /* "+": stop on first non-option */
+ i = getopt32(argv, "+HLP");
+ if (i & (1<<0))
+@@ -1301,7 +1319,8 @@ int find_main(int argc UNUSED_PARAM, cha
+ if (i & (1<<1))
+ G.recurse_flags |= ACTION_FOLLOWLINKS | ACTION_DANGLING_OK;
+ /* -P is default and is ignored */
+- argv += optind;
++ argv = past_HLP; /* same result as "argv += optind;" */
++ *past_HLP = saved;
+
+ for (firstopt = 0; argv[firstopt]; firstopt++) {
+ if (argv[firstopt][0] == '-')
diff --git a/sys-apps/busybox/files/busybox-1.22.0-grep.patch b/sys-apps/busybox/files/busybox-1.22.0-grep.patch
new file mode 100644
index 000000000000..053245d9e34a
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.0-grep.patch
@@ -0,0 +1,80 @@
+--- busybox-1.22.0/findutils/grep.c
++++ busybox-1.22.0-grep/findutils/grep.c
+@@ -373,6 +373,9 @@ static int grep_file(FILE *file)
+ opt_f_not_found: ;
+ }
+ } else {
++#if ENABLE_EXTRA_COMPAT
++ unsigned start_pos;
++#endif
+ char *match_at;
+
+ if (!(gl->flg_mem_alocated_compiled & COMPILED)) {
+@@ -389,15 +392,18 @@ static int grep_file(FILE *file)
+ #if !ENABLE_EXTRA_COMPAT
+ gl->matched_range.rm_so = 0;
+ gl->matched_range.rm_eo = 0;
++#else
++ start_pos = 0;
+ #endif
+ match_at = line;
+ opt_w_again:
++//bb_error_msg("'%s' start_pos:%d line_len:%d", match_at, start_pos, line_len);
+ if (
+ #if !ENABLE_EXTRA_COMPAT
+ regexec(&gl->compiled_regex, match_at, 1, &gl->matched_range, 0) == 0
+ #else
+ re_search(&gl->compiled_regex, match_at, line_len,
+- /*start:*/ 0, /*range:*/ line_len,
++ start_pos, /*range:*/ line_len,
+ &gl->matched_range) >= 0
+ #endif
+ ) {
+@@ -416,8 +422,24 @@ static int grep_file(FILE *file)
+ if (!c || (!isalnum(c) && c != '_')) {
+ found = 1;
+ } else {
+- match_at += gl->matched_range.rm_eo;
+- goto opt_w_again;
++ /*
++ * Why check gl->matched_range.rm_eo?
++ * Zero-length match makes -w skip the line:
++ * "echo foo | grep ^" prints "foo",
++ * "echo foo | grep -w ^" prints nothing.
++ * Without such check, we can loop forever.
++ */
++#if !ENABLE_EXTRA_COMPAT
++ if (gl->matched_range.rm_eo != 0) {
++ match_at += gl->matched_range.rm_eo;
++ goto opt_w_again;
++ }
++#else
++ if (gl->matched_range.rm_eo > start_pos) {
++ start_pos = gl->matched_range.rm_eo;
++ goto opt_w_again;
++ }
++#endif
+ }
+ }
+ }
+--- busybox-1.22.0/testsuite/grep.tests
++++ busybox-1.22.0-grep/testsuite/grep.tests
+@@ -147,6 +147,18 @@ testing "grep -w doesn't stop on 1st mis
+ "foop foo\n" \
+ ""
+
++testing "grep -w ^str doesn't match str not at the beginning" \
++ "grep -w ^str input" \
++ "" \
++ "strstr\n" \
++ ""
++
++testing "grep -w ^ doesn't hang" \
++ "grep -w ^ input" \
++ "" \
++ "anything\n" \
++ ""
++
+ # testing "test name" "commands" "expected result" "file input" "stdin"
+ # file input will be file called "input"
+ # test can create a file "actual" instead of writing to stdout
diff --git a/sys-apps/busybox/files/busybox-1.22.0-lineedit.patch b/sys-apps/busybox/files/busybox-1.22.0-lineedit.patch
new file mode 100644
index 000000000000..e4143140d656
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.0-lineedit.patch
@@ -0,0 +1,12 @@
+--- busybox-1.22.0/libbb/lineedit.c
++++ busybox-1.22.0-lineedit/libbb/lineedit.c
+@@ -1255,7 +1255,9 @@ line_input_t* FAST_FUNC new_line_input_t
+ {
+ line_input_t *n = xzalloc(sizeof(*n));
+ n->flags = flags;
++#if MAX_HISTORY > 0
+ n->max_history = MAX_HISTORY;
++#endif
+ return n;
+ }
+
diff --git a/sys-apps/busybox/files/busybox-1.22.0-ntpd.patch b/sys-apps/busybox/files/busybox-1.22.0-ntpd.patch
new file mode 100644
index 000000000000..1334f577e6a2
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.0-ntpd.patch
@@ -0,0 +1,11 @@
+--- busybox-1.22.0/networking/ntpd.c
++++ busybox-1.22.0-ntpd/networking/ntpd.c
+@@ -1445,6 +1445,8 @@ update_local_clock(peer_t *p)
+
+ run_script("step", offset);
+
++ recv_time += offset;
++
+ #if USING_INITIAL_FREQ_ESTIMATION
+ if (G.discipline_state == STATE_NSET) {
+ set_new_values(STATE_FREQ, /*offset:*/ 0, recv_time);
diff --git a/sys-apps/busybox/files/busybox-1.22.1-ash.patch b/sys-apps/busybox/files/busybox-1.22.1-ash.patch
new file mode 100644
index 000000000000..301e9428d0b3
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.1-ash.patch
@@ -0,0 +1,11 @@
+--- busybox-1.22.1/shell/ash.c
++++ busybox-1.22.1-ash/shell/ash.c
+@@ -13014,7 +13014,7 @@ init(void)
+ setvar2("PPID", utoa(getppid()));
+ #if ENABLE_ASH_BASH_COMPAT
+ p = lookupvar("SHLVL");
+- setvar2("SHLVL", utoa(p ? atoi(p) + 1 : 1));
++ setvar("SHLVL", utoa((p ? atoi(p) : 0) + 1), VEXPORT);
+ #endif
+ p = lookupvar("PWD");
+ if (p) {
diff --git a/sys-apps/busybox/files/busybox-1.22.1-date.patch b/sys-apps/busybox/files/busybox-1.22.1-date.patch
new file mode 100644
index 000000000000..6380d8781ea5
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.1-date.patch
@@ -0,0 +1,30 @@
+--- busybox-1.22.1/libbb/time.c
++++ busybox-1.22.1-date/libbb/time.c
+@@ -68,15 +68,23 @@ void FAST_FUNC parse_datestr(const char
+ /* else end != NUL and we error out */
+ }
+ } else
+- /* yyyy-mm-dd HH */
+- if (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
++ if (strchr(date_str, '-')
++ /* Why strchr('-') check?
++ * sscanf below will trash ptm->tm_year, this breaks
++ * if parse_str is "10101010" (iow, "MMddhhmm" form)
++ * because we destroy year. Do these sscanf
++ * only if we saw a dash in parse_str.
++ */
++ /* yyyy-mm-dd HH */
++ && (sscanf(date_str, "%u-%u-%u %u%c", &ptm->tm_year,
+ &ptm->tm_mon, &ptm->tm_mday,
+ &ptm->tm_hour,
+ &end) >= 4
+- /* yyyy-mm-dd */
+- || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
++ /* yyyy-mm-dd */
++ || sscanf(date_str, "%u-%u-%u%c", &ptm->tm_year,
+ &ptm->tm_mon, &ptm->tm_mday,
+ &end) >= 3
++ )
+ ) {
+ ptm->tm_year -= 1900; /* Adjust years */
+ ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */
diff --git a/sys-apps/busybox/files/busybox-1.22.1-iplink.patch b/sys-apps/busybox/files/busybox-1.22.1-iplink.patch
new file mode 100644
index 000000000000..dbd76c574996
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.1-iplink.patch
@@ -0,0 +1,19 @@
+--- busybox-1.22.1/networking/libiproute/iplink.c
++++ busybox-1.22.1-iplink/networking/libiproute/iplink.c
+@@ -31,6 +31,16 @@
+ #ifndef IFLA_LINKINFO
+ # define IFLA_LINKINFO 18
+ # define IFLA_INFO_KIND 1
++# define IFLA_INFO_DATA 2
++#endif
++
++#ifndef IFLA_VLAN_MAX
++# define IFLA_VLAN_ID 1
++# define IFLA_VLAN_FLAGS 2
++struct ifla_vlan_flags {
++ uint32_t flags;
++ uint32_t mask;
++};
+ #endif
+
+ /* taken from linux/sockios.h */
diff --git a/sys-apps/busybox/files/busybox-1.22.1-lzop.patch b/sys-apps/busybox/files/busybox-1.22.1-lzop.patch
new file mode 100644
index 000000000000..d89cc24a5467
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.1-lzop.patch
@@ -0,0 +1,66 @@
+From a9dc7c2f59dc5e92870d2d46316ea5c1f14740e3 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Mon, 30 Jun 2014 10:14:34 +0200
+Subject: [PATCH] lzop: add overflow check
+
+See CVE-2014-4607
+http://www.openwall.com/lists/oss-security/2014/06/26/20
+
+function old new delta
+lzo1x_decompress_safe 1010 1031 +21
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ archival/libarchive/liblzo.h | 2 ++
+ archival/libarchive/lzo1x_d.c | 3 +++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/archival/libarchive/liblzo.h b/archival/libarchive/liblzo.h
+index 843997c..4596620 100644
+--- a/archival/libarchive/liblzo.h
++++ b/archival/libarchive/liblzo.h
+@@ -76,11 +76,13 @@
+ # define TEST_IP (ip < ip_end)
+ # define NEED_IP(x) \
+ if ((unsigned)(ip_end - ip) < (unsigned)(x)) goto input_overrun
++# define TEST_IV(x) if ((x) > (unsigned)0 - (511)) goto input_overrun
+
+ # undef TEST_OP /* don't need both of the tests here */
+ # define TEST_OP 1
+ # define NEED_OP(x) \
+ if ((unsigned)(op_end - op) < (unsigned)(x)) goto output_overrun
++# define TEST_OV(x) if ((x) > (unsigned)0 - (511)) goto output_overrun
+
+ #define HAVE_ANY_OP 1
+
+diff --git a/archival/libarchive/lzo1x_d.c b/archival/libarchive/lzo1x_d.c
+index 9bc1270..40b167e 100644
+--- a/archival/libarchive/lzo1x_d.c
++++ b/archival/libarchive/lzo1x_d.c
+@@ -92,6 +92,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
+ ip++;
+ NEED_IP(1);
+ }
++ TEST_IV(t);
+ t += 15 + *ip++;
+ }
+ /* copy literals */
+@@ -224,6 +225,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
+ ip++;
+ NEED_IP(1);
+ }
++ TEST_IV(t);
+ t += 31 + *ip++;
+ }
+ #if defined(COPY_DICT)
+@@ -265,6 +267,7 @@ int lzo1x_decompress_safe(const uint8_t* in, unsigned in_len,
+ ip++;
+ NEED_IP(1);
+ }
++ TEST_IV(t);
+ t += 7 + *ip++;
+ }
+ #if defined(COPY_DICT)
+--
+2.1.2
+
diff --git a/sys-apps/busybox/files/busybox-1.22.1-nc.patch b/sys-apps/busybox/files/busybox-1.22.1-nc.patch
new file mode 100644
index 000000000000..1ddb4834bd7f
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.1-nc.patch
@@ -0,0 +1,15 @@
+--- busybox-1.22.1/networking/nc_bloaty.c
++++ busybox-1.22.1-nc/networking/nc_bloaty.c
+@@ -175,9 +175,9 @@ enum {
+ OPT_w = (1 << 5),
+ OPT_l = (1 << 6) * ENABLE_NC_SERVER,
+ OPT_k = (1 << 7) * ENABLE_NC_SERVER,
+- OPT_i = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+- OPT_o = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+- OPT_z = (1 << (9+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
++ OPT_i = (1 << (6+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
++ OPT_o = (1 << (7+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
++ OPT_z = (1 << (8+2*ENABLE_NC_SERVER)) * ENABLE_NC_EXTRA,
+ };
+
+ #define o_nflag (option_mask32 & OPT_n)
diff --git a/sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch b/sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch
new file mode 100644
index 000000000000..f46822808a9f
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.22.1-zcat-no-ext.patch
@@ -0,0 +1,64 @@
+From 28dd64a0e1a9cffcde7799f2849b66c0e16bb9cc Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Fri, 10 Jan 2014 14:06:57 +0100
+Subject: [PATCH] libarchive: open_zipped() does not need to check extensions
+ for e.g. gzip
+
+We only need to check for signature-less extensions,
+currently only .lzma. The rest can be happily autodetected.
+
+This fixes "zcat FILE_WITHOUT_GZ_EXT" case, among others.
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+(cherry picked from commit 7c47b560a8fc97956dd8132bd7f1863d83c19866)
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ archival/libarchive/open_transformer.c | 23 +++++++++++------------
+ 1 file changed, 11 insertions(+), 12 deletions(-)
+
+diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
+index 4e98264..1aeba13 100644
+--- a/archival/libarchive/open_transformer.c
++++ b/archival/libarchive/open_transformer.c
+@@ -182,27 +182,26 @@ int FAST_FUNC setup_unzip_on_fd(int fd, int fail_if_not_detected)
+
+ int FAST_FUNC open_zipped(const char *fname)
+ {
+- char *sfx;
+ int fd;
+
+ fd = open(fname, O_RDONLY);
+ if (fd < 0)
+ return fd;
+
+- sfx = strrchr(fname, '.');
+- if (sfx) {
+- sfx++;
+- if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
+- /* .lzma has no header/signature, just trust it */
++ if (ENABLE_FEATURE_SEAMLESS_LZMA) {
++ /* .lzma has no header/signature, can only detect it by extension */
++ char *sfx = strrchr(fname, '.');
++ if (sfx && strcmp(sfx+1, "lzma") == 0) {
+ open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
+- else
+- if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
+- || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
+- || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
+- ) {
+- setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
++ return fd;
+ }
+ }
++ if ((ENABLE_FEATURE_SEAMLESS_GZ)
++ || (ENABLE_FEATURE_SEAMLESS_BZ2)
++ || (ENABLE_FEATURE_SEAMLESS_XZ)
++ ) {
++ setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
++ }
+
+ return fd;
+ }
+--
+2.1.2
+
diff --git a/sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch b/sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch
new file mode 100644
index 000000000000..50fc877b50ca
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.23.1-modprobe-small.patch
@@ -0,0 +1,166 @@
+--- busybox-1.23.1/modutils/modprobe-small.c
++++ busybox-1.23.1-modprobe-small/modutils/modprobe-small.c
+@@ -552,9 +552,23 @@ static int already_loaded(const char *na
+ return ret;
+ }
+ #else
+-#define already_loaded(name) is_rmmod
++#define already_loaded(name) 0
+ #endif
+
++static int rmmod(const char *filename)
++{
++ int r;
++ char modname[MODULE_NAME_LEN];
++
++ filename2modname(filename, modname);
++ r = delete_module(modname, O_NONBLOCK | O_EXCL);
++ dbg1_error_msg("delete_module('%s', O_NONBLOCK | O_EXCL):%d", modname, r);
++ if (r != 0 && !(option_mask32 & OPT_q)) {
++ bb_perror_msg("remove '%s'", modname);
++ }
++ return r;
++}
++
+ /*
+ * Given modules definition and module name (or alias, or symbol)
+ * load/remove the module respecting dependencies.
+@@ -571,26 +585,36 @@ static void process_module(char *name, c
+ module_info **infovec;
+ module_info *info;
+ int infoidx;
+- int is_rmmod = (option_mask32 & OPT_r) != 0;
++ int is_remove = (option_mask32 & OPT_r) != 0;
+
+ dbg1_error_msg("process_module('%s','%s')", name, cmdline_options);
+
+ replace(name, '-', '_');
+
+- dbg1_error_msg("already_loaded:%d is_rmmod:%d", already_loaded(name), is_rmmod);
++ dbg1_error_msg("already_loaded:%d is_remove:%d", already_loaded(name), is_remove);
++
++ if (applet_name[0] == 'r') {
++ /* rmmod.
++ * Does not remove dependencies, no need to scan, just remove.
++ * (compat note: this allows and strips .ko suffix)
++ */
++ rmmod(name);
++ return;
++ }
++
+ /*
+- * We used to have "is_rmmod != already_loaded(name)" check here, but
++ * We used to have "is_remove != already_loaded(name)" check here, but
+ * modprobe -r pci:v00008086d00007010sv00000000sd00000000bc01sc01i80
+ * won't unload modules (there are more than one)
+ * which have this alias.
+ */
+- if (!is_rmmod && already_loaded(name)) {
++ if (!is_remove && already_loaded(name)) {
+ dbg1_error_msg("nothing to do for '%s'", name);
+ return;
+ }
+
+ options = NULL;
+- if (!is_rmmod) {
++ if (!is_remove) {
+ char *opt_filename = xasprintf("/etc/modules/%s", name);
+ options = xmalloc_open_read_close(opt_filename, NULL);
+ if (options)
+@@ -624,7 +648,7 @@ static void process_module(char *name, c
+ 0 /* depth */
+ );
+ dbg1_error_msg("dirscan complete");
+- /* Module was not found, or load failed, or is_rmmod */
++ /* Module was not found, or load failed, or is_remove */
+ if (module_found_idx >= 0) { /* module was found */
+ infovec = xzalloc(2 * sizeof(infovec[0]));
+ infovec[0] = &modinfo[module_found_idx];
+@@ -637,7 +661,7 @@ static void process_module(char *name, c
+
+ if (!infovec) {
+ /* both dirscan and find_alias found nothing */
+- if (!is_rmmod && applet_name[0] != 'd') /* it wasn't rmmod or depmod */
++ if (!is_remove && applet_name[0] != 'd') /* it wasn't rmmod or depmod */
+ bb_error_msg("module '%s' not found", name);
+ //TODO: _and_die()? or should we continue (un)loading modules listed on cmdline?
+ goto ret;
+@@ -651,29 +675,15 @@ static void process_module(char *name, c
+ * a *list* of modinfo pointers from find_alias().
+ */
+
+- /* rmmod or modprobe -r? unload module(s) */
+- if (is_rmmod) {
++ /* modprobe -r? unload module(s) */
++ if (is_remove) {
+ infoidx = 0;
+ while ((info = infovec[infoidx++]) != NULL) {
+- int r;
+- char modname[MODULE_NAME_LEN];
+-
+- filename2modname(
+- bb_get_last_path_component_nostrip(info->pathname), modname);
+- r = delete_module(modname, O_NONBLOCK | O_EXCL);
+- dbg1_error_msg("delete_module('%s', O_NONBLOCK | O_EXCL):%d", modname, r);
++ int r = rmmod(bb_get_last_path_component_nostrip(info->pathname));
+ if (r != 0) {
+- if (!(option_mask32 & OPT_q))
+- bb_perror_msg("remove '%s'", modname);
+- goto ret;
++ goto ret; /* error */
+ }
+ }
+-
+- if (applet_name[0] == 'r') {
+- /* rmmod: do not remove dependencies, exit */
+- goto ret;
+- }
+-
+ /* modprobe -r: we do not stop here -
+ * continue to unload modules on which the module depends:
+ * "-r --remove: option causes modprobe to remove a module.
+@@ -694,7 +704,7 @@ static void process_module(char *name, c
+ }
+ free(deps);
+
+- if (is_rmmod)
++ if (is_remove)
+ continue;
+
+ /* We are modprobe: load it */
+@@ -897,10 +907,10 @@ int modprobe_main(int argc UNUSED_PARAM,
+ }
+
+ #if ENABLE_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE
+- /* If not rmmod, parse possible module options given on command line.
++ /* If not rmmod/-r, parse possible module options given on command line.
+ * insmod/modprobe takes one module name, the rest are parameters. */
+ options = NULL;
+- if ('r' != applet0) {
++ if (!(option_mask32 & OPT_r)) {
+ char **arg = argv;
+ while (*++arg) {
+ /* Enclose options in quotes */
+@@ -911,7 +921,7 @@ int modprobe_main(int argc UNUSED_PARAM,
+ }
+ }
+ #else
+- if ('r' != applet0)
++ if (!(option_mask32 & OPT_r))
+ argv[1] = NULL;
+ #endif
+
+@@ -935,10 +945,11 @@ int modprobe_main(int argc UNUSED_PARAM,
+ }
+
+ /* Try to load modprobe.dep.bb */
+- load_dep_bb();
++ if ('r' != applet0) /* not rmmod */
++ load_dep_bb();
+
+ /* Load/remove modules.
+- * Only rmmod loops here, modprobe has only argv[0] */
++ * Only rmmod/modprobe -r loops here, insmod/modprobe has only argv[0] */
+ do {
+ process_module(*argv, options);
+ } while (*++argv);
diff --git a/sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch b/sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch
new file mode 100644
index 000000000000..13725cb832e7
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.23.1-trylink-flags.patch
@@ -0,0 +1,39 @@
+From 6798564b9e2f1a81b8c2d0cb4add97cb736d982b Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 16 Mar 2015 17:47:01 -0400
+Subject: [PATCH] trylink: respect compiler settings when probing features
+
+The CPPFLAGS/CFLAGS settings might have features that matter, so make
+sure we utilize them when testing the compiler.
+
+URL: https://bugs.gentoo.org/471118
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ scripts/trylink | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/trylink b/scripts/trylink
+index 5a67fcf..48c487b 100755
+--- a/scripts/trylink
++++ b/scripts/trylink
+@@ -49,7 +49,7 @@ check_cc() {
+ local tempname="$(mktemp)"
+ # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :(
+ # "-xc": C language. "/dev/null" is an empty source file.
+- if $CC $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
++ if $CC $CPPFLAGS $CFLAGS $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then
+ echo "$1";
+ else
+ echo "$2";
+@@ -66,7 +66,7 @@ check_libc_is_glibc() {
+ syntax error here
+ #endif
+ " >"$tempname".c
+- if $CC "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
++ if $CC $CPPFLAGS $CFLAGS "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then
+ echo "$2";
+ else
+ echo "$1";
+--
+2.3.2
+
diff --git a/sys-apps/busybox/files/ginit.c b/sys-apps/busybox/files/ginit.c
new file mode 100644
index 000000000000..de98e4ac4110
--- /dev/null
+++ b/sys-apps/busybox/files/ginit.c
@@ -0,0 +1,124 @@
+/*
+ * simple init to bootstrap sep-/usr
+ *
+ * Copyright (C) 2012-2013 Mike Frysinger <vapier@gentoo.org>
+ *
+ * Licensed under GPLv2 or later
+ */
+
+//applet:IF_GINIT(APPLET(ginit, BB_DIR_SBIN, BB_SUID_DROP))
+
+//kbuild:lib-$(CONFIG_GINIT) += ginit.o
+
+//config:config GINIT
+//config: bool "ginit"
+//config: default y
+//config: select MKDIR
+//config: select MDEV
+//config: select MOUNT
+//config: select MOUNTPOINT
+//config: help
+//config: sep-/usr bootstrapper
+
+//usage:#define ginit_trivial_usage NOUSAGE_STR
+//usage:#define ginit_full_usage ""
+
+#include "libbb.h"
+
+#define eprintf(fmt, args...) printf("%s" fmt, "sep-usr init: ", ## args)
+
+static void process_args(char **args)
+{
+ size_t i;
+
+ eprintf("running: ");
+ for (i = 0; args[i]; ++i) {
+ /* String needs to be writable, so dupe it */
+ args[i] = xstrdup(args[i]);
+ printf("'%s' ", args[i]);
+ }
+ printf("\n");
+}
+
+int ginit_main(int argc UNUSED_PARAM, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int ginit_main(int argc UNUSED_PARAM, char **argv)
+{
+ FILE *mntlist;
+ bool ismnted_dev, ismnted_sys, ismnted_usr;
+ struct mntent *mntent;
+
+ /*
+ int fd = open("/dev/console", O_RDWR);
+ if (fd >= 0) {
+ dup2(fd, 0);
+ dup2(fd, 1);
+ dup2(fd, 2);
+ }
+ */
+
+ /* If given an argv[] with an applet name, run it instead.
+ * Makes recovering simple by doing: init=/ginit bb
+ */
+ if (argv[1] && argv[1][0] != '/') {
+ eprintf("running user requested applet %s\n", argv[1]);
+ return spawn_and_wait(argv+1);
+ }
+
+#define saw(argv...) \
+ ({ \
+ static const char *args[] = { argv, NULL }; \
+ /* These casts are fine -- see process_args for mem setup */ \
+ process_args((void *)args); \
+ spawn_and_wait((void *)args); \
+ })
+
+ /* First setup basic /dev */
+ if (saw("mountpoint", "-q", "/dev") != 0) {
+ /* Try /etc/fstab */
+ if (saw("mount", "-n", "/dev"))
+ /* Then devtmpfs */
+ if (saw("mount", "-n", "-t", "devtmpfs", "devtmpfs", "/dev"))
+ /* Finally normal tmpfs */
+ saw("mount", "-n", "-t", "tmpfs", "dev", "/dev");
+ } else {
+ eprintf("%s appears to be mounted; skipping its setup\n", "/dev");
+ }
+
+ /* If /dev is empty (e.g. tmpfs), run mdev to seed things */
+ if (access("/dev/console", F_OK) != 0) {
+ if (saw("mountpoint", "-q", "/sys") != 0) {
+ if (saw("mount", "-n", "/sys"))
+ saw("mount", "-n", "-t", "sysfs", "sysfs", "/sys");
+ } else {
+ eprintf("%s appears to be mounted; skipping its setup\n", "/sys");
+ }
+
+ /* Mount /proc as mdev will fork+exec /proc/self/exe */
+ if (saw("mountpoint", "-q", "/proc") != 0) {
+ /* Try /etc/fstab */
+ if (saw("mount", "-n", "/proc"))
+ saw("mount", "-n", "-t", "proc", "proc", "/proc");
+ }
+
+ saw("mdev", "-s");
+ }
+
+ /* Then seed the stuff we care about */
+ saw("mkdir", "-p", "/dev/pts", "/dev/shm");
+
+ /* Then mount /usr */
+ if (saw("mountpoint", "-q", "/usr") != 0) {
+ saw("mount", "-n", "/usr", "-o", "ro");
+ } else {
+ eprintf("%s appears to be mounted; skipping its setup\n", "/usr");
+ }
+
+ /* Now that we're all done, exec the real init */
+ if (!argv[1]) {
+ argv[0] = (void *)"/sbin/init";
+ argv[1] = NULL;
+ } else
+ ++argv;
+ process_args(argv);
+ return execv(argv[0], argv);
+}
diff --git a/sys-apps/busybox/files/klogd.confd b/sys-apps/busybox/files/klogd.confd
new file mode 100644
index 000000000000..4c16096a4e15
--- /dev/null
+++ b/sys-apps/busybox/files/klogd.confd
@@ -0,0 +1,9 @@
+# Config file for /etc/init.d/busybox-sysklogd
+
+# run "/sbin/klogd --help" to see all possible options.
+
+# activate if you need remote logging
+#rc_need="net"
+
+# send warnings and above to the console
+KLOGD_OPTS="-c 3"
diff --git a/sys-apps/busybox/files/klogd.initd b/sys-apps/busybox/files/klogd.initd
new file mode 100644
index 000000000000..f584ccb7d93c
--- /dev/null
+++ b/sys-apps/busybox/files/klogd.initd
@@ -0,0 +1,12 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/bin/busybox klogd"
+command_args="${KLOGD_OPTS}"
+pidfile="/var/run/klogd.pid"
+
+depend() {
+ need clock hostname
+}
diff --git a/sys-apps/busybox/files/mdev-start.sh b/sys-apps/busybox/files/mdev-start.sh
new file mode 100755
index 000000000000..8784cd5589f6
--- /dev/null
+++ b/sys-apps/busybox/files/mdev-start.sh
@@ -0,0 +1,125 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+find_mdev()
+{
+ if [ -x /sbin/mdev ] ; then
+ echo "/sbin/mdev"
+ else
+ echo "/bin/busybox mdev"
+ fi
+}
+
+populate_mdev()
+{
+ # populate /dev with devices already found by the kernel
+
+ if get_bootparam "nocoldplug" ; then
+ RC_COLDPLUG="no"
+ ewarn "Skipping mdev coldplug as requested in kernel cmdline"
+ fi
+
+ ebegin "Populating /dev with existing devices with mdev -s"
+ $(find_mdev) -s
+ eend $?
+
+ return 0
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # creating /dev/console and /dev/tty1 to be able to write
+ # to $CONSOLE with/without bootsplash before mdev creates it
+ [ -c /dev/console ] || mknod /dev/console c 5 1
+ [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
+
+ # udevd will dup its stdin/stdout/stderr to /dev/null
+ # and we do not want a file which gets buffered in ram
+ [ -c /dev/null ] || mknod /dev/null c 1 3
+
+ # copy over any persistant things
+ if [ -d /lib/mdev/devices ] ; then
+ cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
+ fi
+
+ # Not provided by sysfs but needed
+ ln -snf /proc/self/fd /dev/fd
+ ln -snf fd/0 /dev/stdin
+ ln -snf fd/1 /dev/stdout
+ ln -snf fd/2 /dev/stderr
+ [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
+
+ # Create problematic directories
+ mkdir -p /dev/pts /dev/shm
+}
+
+mount_it_b1()
+{
+ if [ "${RC_USE_FSTAB}" = "yes" ] ; then
+ mntcmd=$(get_mount_fstab /dev)
+ else
+ unset mntcmd
+ fi
+ if [ -n "${mntcmd}" ] ; then
+ try mount -n ${mntcmd}
+ else
+ if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems ; then
+ mntcmd="tmpfs"
+ else
+ mntcmd="ramfs"
+ fi
+ # many video drivers require exec access in /dev #92921
+ try mount -n -t "${mntcmd}" -o exec,nosuid,mode=0755 mdev /dev
+ fi
+}
+mount_it_b2()
+{
+ if fstabinfo --quiet /dev ; then
+ mount -n /dev
+ else
+ # Some devices require exec, Bug #92921
+ mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
+ fi
+}
+mount_it()
+{
+ type fstabinfo && mount_it_b2 || mount_it_b1
+}
+
+main()
+{
+ # Setup temporary storage for /dev
+ ebegin "Mounting /dev for mdev"
+ mount_it
+ eend $?
+
+ # Create a file so that our rc system knows it's still in sysinit.
+ # Existance means init scripts will not directly run.
+ # rc will remove the file when done with sysinit.
+ touch /dev/.rcsysinit
+
+ # Selinux lovin; /selinux should be mounted by selinux-patched init
+ if [ -x /sbin/restorecon ] && [ -c /selinux/null ] ; then
+ restorecon /dev > /selinux/null
+ fi
+
+ seed_dev
+
+ # Setup hotplugging (if possible)
+ if [ -e /proc/sys/kernel/hotplug ] ; then
+ ebegin "Setting up proper hotplug agent"
+ eindent
+ einfo "Setting /sbin/mdev as hotplug agent ..."
+ echo $(find_mdev) > /proc/sys/kernel/hotplug
+ eoutdent
+ eend 0
+ fi
+
+ populate_mdev
+}
+
+main
+
+# vim:ts=4
diff --git a/sys-apps/busybox/files/mdev.initd b/sys-apps/busybox/files/mdev.initd
new file mode 100644
index 000000000000..fbe7a2cd2ebd
--- /dev/null
+++ b/sys-apps/busybox/files/mdev.initd
@@ -0,0 +1,53 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend()
+{
+ provide dev
+ need dev-mount sysfs
+}
+
+find_mdev()
+{
+ if [ -x /sbin/mdev ] ; then
+ echo "/sbin/mdev"
+ else
+ echo "/bin/busybox mdev"
+ fi
+}
+
+populate_mdev()
+{
+ ebegin "Populating /dev with existing devices with mdev -s"
+ $(find_mdev) -s
+ eend $?
+ return 0
+}
+
+seed_dev()
+{
+ # copy over any persistent things
+ if [ -d /lib/mdev/devices ] ; then
+ cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
+ fi
+}
+
+start()
+{
+ seed_dev
+
+ # Setup hotplugging (if possible)
+ if [ -e /proc/sys/kernel/hotplug ] ; then
+ ebegin "Setting up mdev as hotplug agent"
+ echo $(find_mdev) > /proc/sys/kernel/hotplug
+ eend 0
+ fi
+
+ if get_bootparam "nocoldplug" ; then
+ ewarn "Skipping mdev coldplug as requested in kernel cmdline"
+ else
+ populate_mdev
+ fi
+}
diff --git a/sys-apps/busybox/files/mdev.rc b/sys-apps/busybox/files/mdev.rc
new file mode 100755
index 000000000000..df55e250cf16
--- /dev/null
+++ b/sys-apps/busybox/files/mdev.rc
@@ -0,0 +1,9 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+start()
+{
+ . /lib/rcscripts/addons/mdev-start.sh
+}
diff --git a/sys-apps/busybox/files/mdev.rc.1 b/sys-apps/busybox/files/mdev.rc.1
new file mode 100755
index 000000000000..74cc8c68f82d
--- /dev/null
+++ b/sys-apps/busybox/files/mdev.rc.1
@@ -0,0 +1,98 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend()
+{
+ provide dev dev-mount
+ need sysfs
+}
+
+find_mdev()
+{
+ if [ -x /sbin/mdev ] ; then
+ echo "/sbin/mdev"
+ else
+ echo "/bin/busybox mdev"
+ fi
+}
+
+populate_mdev()
+{
+ # populate /dev with devices already found by the kernel
+
+ if get_bootparam "nocoldplug" ; then
+ RC_COLDPLUG="no"
+ ewarn "Skipping mdev coldplug as requested in kernel cmdline"
+ fi
+
+ ebegin "Populating /dev with existing devices with mdev -s"
+ $(find_mdev) -s
+ eend $?
+
+ return 0
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # creating /dev/console and /dev/tty1 to be able to write
+ # to $CONSOLE with/without bootsplash before mdev creates it
+ [ -c /dev/console ] || mknod /dev/console c 5 1
+ [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
+
+ # udevd will dup its stdin/stdout/stderr to /dev/null
+ # and we do not want a file which gets buffered in ram
+ [ -c /dev/null ] || mknod /dev/null c 1 3
+
+ # copy over any persistant things
+ if [ -d /lib/mdev/devices ] ; then
+ cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
+ fi
+
+ # Not provided by sysfs but needed
+ ln -snf /proc/self/fd /dev/fd
+ ln -snf fd/0 /dev/stdin
+ ln -snf fd/1 /dev/stdout
+ ln -snf fd/2 /dev/stderr
+ [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
+
+ # Create problematic directories
+ mkdir -p /dev/pts /dev/shm
+}
+
+mount_it()
+{
+ if fstabinfo --quiet /dev ; then
+ mount -n /dev
+ else
+ # Some devices require exec, Bug #92921
+ mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
+ fi
+}
+
+start()
+{
+ # Setup temporary storage for /dev
+ ebegin "Mounting /dev for mdev"
+ mount_it
+ eend $?
+
+ # Create a file so that our rc system knows it's still in sysinit.
+ # Existance means init scripts will not directly run.
+ # rc will remove the file when done with sysinit.
+ touch /dev/.rcsysinit
+
+ seed_dev
+
+ # Setup hotplugging (if possible)
+ if [ -e /proc/sys/kernel/hotplug ] ; then
+ ebegin "Setting up mdev as hotplug agent"
+ echo $(find_mdev) > /proc/sys/kernel/hotplug
+ eend 0
+ fi
+
+ populate_mdev
+}
diff --git a/sys-apps/busybox/files/mdev/dvbdev b/sys-apps/busybox/files/mdev/dvbdev
new file mode 100644
index 000000000000..f0186c176cd8
--- /dev/null
+++ b/sys-apps/busybox/files/mdev/dvbdev
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# MDEV=dvb0.demux1 -> ADAPTER=dvb0 -> N=0
+ADAPTER=${MDEV%.*}
+N=${ADAPTER#dvb}
+# MDEV=dvb0.demux1 -> DEVB_DEV=demux1
+DVB_DEV=${MDEV#*.}
+
+case "$ACTION" in
+ add|"")
+ mkdir -p dvb/adapter${N}
+ mv ${MDEV} dvb/adapter${N}/${DVB_DEV}
+ ;;
+ remove)
+ rm -f dvb/adapter${N}/${DVB_DEV}
+ rmdir dvb/adapter${N} 2>/dev/null
+ rmdir dvb/ 2>/dev/null
+esac
diff --git a/sys-apps/busybox/files/mdev/ide_links b/sys-apps/busybox/files/mdev/ide_links
new file mode 100644
index 000000000000..be0c95aa9c0e
--- /dev/null
+++ b/sys-apps/busybox/files/mdev/ide_links
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+[ -f /proc/ide/$MDEV/media ] || exit
+
+media=`cat /proc/ide/$MDEV/media`
+for i in $media $media[0-9]* ; do
+ if [ "`readlink $i 2>/dev/null`" = $MDEV ] ; then
+ LINK=$i
+ break
+ fi
+done
+
+# link exist, remove if necessary and exit
+if [ "$LINK" ] ; then
+ [ "$ACTION" = remove ] && rm $LINK
+ exit
+fi
+
+# create a link
+num=`ls $media[0-9]* 2>/dev/null | wc -l`
+ln -sf $MDEV "$media`echo $num`"
+[ -e "$media" ] || ln -sf $MDEV "$media"
+
diff --git a/sys-apps/busybox/files/mdev/usbdev b/sys-apps/busybox/files/mdev/usbdev
new file mode 100644
index 000000000000..ea5b9155736c
--- /dev/null
+++ b/sys-apps/busybox/files/mdev/usbdev
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# script is buggy; until patched just do exit 0
+#exit 0
+
+# add zeros to device or bus
+add_zeros () {
+ case "$(echo $1 | wc -L)" in
+ 1) echo "00$1" ;;
+ 2) echo "0$1" ;;
+ *) echo "$1"
+ esac
+ exit 0
+}
+
+
+# bus and device dirs in /sys
+USB_PATH=$(echo $MDEV | sed -e 's/usbdev\([0-9]\).[0-9]/usb\1/')
+USB_PATH=$(find /sys/devices -type d -name "$USB_PATH")
+USB_DEV_DIR=$(echo $MDEV | sed -e 's/usbdev\([0-9]\).\([0-9]\)/\1-\2/')
+
+# dir names in /dev
+BUS=$(add_zeros $(echo $MDEV | sed -e 's/^usbdev\([0-9]\).[0-9]/\1/'))
+USB_DEV=$(add_zeros $(echo $MDEV | sed -e 's/^usbdev[0-9].\([0-9]\)/\1/'))
+
+
+# try to load the proper driver for usb devices
+case "$ACTION" in
+ add|"")
+ # load usb bus driver
+ for i in $USB_PATH/*/modalias ; do
+ modprobe `cat $i` 2>/dev/null
+ done
+ # load usb device driver if existent
+ if [ -d $USB_PATH/$USB_DEV_DIR ]; then
+ for i in $USB_PATH/$USB_DEV_DIR/*/modalias ; do
+ modprobe `cat $i` 2>/dev/null
+ done
+ fi
+ # move usb device file
+ mkdir -p bus/usb/$BUS
+ mv $MDEV bus/usb/$BUS/$USB_DEV
+ ;;
+ remove)
+ # unload device driver, if device dir is existent
+ if [ -d $USB_PATH/$USB_DEV_DIR ]; then
+ for i in $USB_PATH/$USB_DEV_DIR/*/modalias ; do
+ modprobe -r `cat $i` 2>/dev/null
+ done
+ fi
+ # unload usb bus driver. Does this make sense?
+ # what happens, if two usb devices are plugged in
+ # and one is removed?
+ for i in $USB_PATH/*/modalias ; do
+ modprobe -r `cat $i` 2>/dev/null
+ done
+ # remove device file and possible empty dirs
+ rm -f bus/usb/$BUS/$USB_DEV
+ rmdir bus/usb/$BUS/ 2>/dev/null
+ rmdir bus/usb/ 2>/dev/null
+ rmdir bus/ 2>/dev/null
+esac
diff --git a/sys-apps/busybox/files/mdev/usbdisk_link b/sys-apps/busybox/files/mdev/usbdisk_link
new file mode 100644
index 000000000000..6bb069243f4c
--- /dev/null
+++ b/sys-apps/busybox/files/mdev/usbdisk_link
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# NOTE: since mdev -s only provide $MDEV, don't depend on any hotplug vars.
+
+current=$(readlink usbdisk)
+
+if [ "$current" = "$MDEV" ] && [ "$ACTION" = "remove" ]; then
+ rm -f usbdisk usba1
+fi
+[ -n "$current" ] && exit
+
+if [ -e /sys/block/$MDEV ]; then
+ SYSDEV=$(readlink -f /sys/block/$MDEV/device)
+ # if /sys device path contains '/usb[0-9]' then we assume its usb
+ # also, if it's a usb without partitions we require FAT
+ if [ "${SYSDEV##*/usb[0-9]}" != "$SYSDEV" ]; then
+ # do not create link if there is not FAT
+ dd if=/dev/$MDEV bs=512 count=1 2>/dev/null | strings | grep FAT >/dev/null || exit 0
+
+ ln -sf $MDEV usbdisk
+ # keep this for compat. people have it in fstab
+ ln -sf $MDEV usba1
+ fi
+
+elif [ -e /sys/block/*/$MDEV ] ; then
+ PARENT=$(dirname /sys/block/*/$MDEV)
+ SYSDEV=$(readlink -f $PARENT/device)
+ if [ "${SYSDEV##*/usb[0-9]}" != "$SYSDEV" ]; then
+ ln -sf $MDEV usbdisk
+ # keep this for compat. people have it in fstab
+ ln -sf $MDEV usba1
+ fi
+fi
+
diff --git a/sys-apps/busybox/files/ntpd.confd b/sys-apps/busybox/files/ntpd.confd
new file mode 100644
index 000000000000..f50d4c2e9179
--- /dev/null
+++ b/sys-apps/busybox/files/ntpd.confd
@@ -0,0 +1,6 @@
+# Config file for /etc/init.d/busybox-ntpd
+
+# run "/sbin/ntpd --help" to see all possible options.
+
+# Get time from specified server and run in background
+NTPD_OPTS="-N -p pool.ntp.org"
diff --git a/sys-apps/busybox/files/ntpd.initd b/sys-apps/busybox/files/ntpd.initd
new file mode 100644
index 000000000000..06e37edc1f58
--- /dev/null
+++ b/sys-apps/busybox/files/ntpd.initd
@@ -0,0 +1,13 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/bin/busybox ntpd"
+command_args="${NTPD_OPTS}"
+pidfile="/var/run/ntpd.pid"
+
+depend() {
+ use net dns logger
+ after ntp-client
+}
diff --git a/sys-apps/busybox/files/syslogd.confd b/sys-apps/busybox/files/syslogd.confd
new file mode 100644
index 000000000000..7df6885cedbb
--- /dev/null
+++ b/sys-apps/busybox/files/syslogd.confd
@@ -0,0 +1,9 @@
+# Config file for /etc/init.d/busybox-sysklogd
+
+# run "/sbin/syslogd --help" to see all possible options.
+
+# activate if you need remote logging
+#rc_need="net"
+
+# Log to shared mem buffer (use logread to read it)
+SYSLOGD_OPTS="-C128"
diff --git a/sys-apps/busybox/files/syslogd.initd b/sys-apps/busybox/files/syslogd.initd
new file mode 100644
index 000000000000..b23ca0545871
--- /dev/null
+++ b/sys-apps/busybox/files/syslogd.initd
@@ -0,0 +1,13 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/bin/busybox syslogd"
+command_args="${SYSLOGD_OPTS}"
+pidfile="/var/run/syslogd.pid"
+
+depend() {
+ need clock hostname
+ provide logger
+}
diff --git a/sys-apps/busybox/files/watchdog.confd b/sys-apps/busybox/files/watchdog.confd
new file mode 100644
index 000000000000..bd6aec0a7068
--- /dev/null
+++ b/sys-apps/busybox/files/watchdog.confd
@@ -0,0 +1,9 @@
+# Config file for /etc/init.d/busybox-watchdog
+
+# run "/sbin/watchdog --help" to see all possible options.
+
+# Periodically write to watchdog device
+WATCHDOG_OPTS="/dev/watchdog"
+
+# optionally set the nice-level
+#SSD_NICELEVEL="-20"
diff --git a/sys-apps/busybox/files/watchdog.initd b/sys-apps/busybox/files/watchdog.initd
new file mode 100644
index 000000000000..9949aad126f7
--- /dev/null
+++ b/sys-apps/busybox/files/watchdog.initd
@@ -0,0 +1,8 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/bin/busybox watchdog"
+command_args="${WATCHDOG_OPTS}"
+pidfile="/var/run/watchdog.pid"
diff --git a/sys-apps/busybox/metadata.xml b/sys-apps/busybox/metadata.xml
new file mode 100644
index 000000000000..a781804fc2b8
--- /dev/null
+++ b/sys-apps/busybox/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+<use>
+<flag name="make-symlinks">Create all the appropriate symlinks in /bin and /sbin.</flag>
+<flag name="math">Enable math support in gawk (requires libm)</flag>
+<flag name="mdev">Create the appropriate symlink in /sbin and install mdev.conf and support files</flag>
+<flag name="sep-usr">Support a separate /usr without needing an initramfs by booting with init=/ginit</flag>
+<flag name="static">Make the system rescue shell (/bin/bb) static so you can recover even when glibc is broken</flag>
+<flag name="systemd">Support systemd</flag>
+</use>
+<upstream>
+<remote-id type="cpe">cpe:/a:busybox:busybox</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-apps/byld/Manifest b/sys-apps/byld/Manifest
new file mode 100644
index 000000000000..5419b2c57a7f
--- /dev/null
+++ b/sys-apps/byld/Manifest
@@ -0,0 +1 @@
+DIST byld-1_0_3.tgz 1128317 SHA256 f5206f6eb0d85f6b9435c24e554262b69dede6dd7d24acd9faea1dc77549cde3
diff --git a/sys-apps/byld/byld-1.0.3.ebuild b/sys-apps/byld/byld-1.0.3.ebuild
new file mode 100644
index 000000000000..4ad707e9fc2d
--- /dev/null
+++ b/sys-apps/byld/byld-1.0.3.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="build a Linux distribution on a single floppy"
+HOMEPAGE="http://byld.sourceforge.net/"
+SRC_URI="mirror://sourceforge/byld/byld-${PV//./_}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+IUSE=""
+RESTRICT="strip" #252054
+
+RDEPEND="sys-apps/util-linux"
+
+src_install() {
+ dodoc BYLDING CREDITS README INSTALL FHS PAKING
+ rm MAKEDEV.8 BYLDING CREDITS README INSTALL FHS LICENSE PAKING
+ dodir /usr/lib/${PN}
+ cp -rf * ${D}/usr/lib/${PN}/
+}
+
+pkg_postinst() {
+ einfo "The build scripts have been placed in /usr/lib/${PN}"
+ einfo "For documentation, see /usr/share/doc/${PF}"
+}
diff --git a/sys-apps/byld/metadata.xml b/sys-apps/byld/metadata.xml
new file mode 100644
index 000000000000..b3c425a09720
--- /dev/null
+++ b/sys-apps/byld/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">byld</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/cciss_vol_status/Manifest b/sys-apps/cciss_vol_status/Manifest
new file mode 100644
index 000000000000..5323176b1d0c
--- /dev/null
+++ b/sys-apps/cciss_vol_status/Manifest
@@ -0,0 +1,4 @@
+DIST cciss_vol_status-1.03.tar.gz 86581 SHA256 b3cdcadba4dc8637c70aac9d594e32acbbe2bc323915cce5b2722e631c05c8c0
+DIST cciss_vol_status-1.09.tar.gz 104978 SHA256 93520050c3b1742288b92314585d1c0d4eaed9799747b8fc0c06977bbf5b74e4 SHA512 c773c6addcb26a3c635c28f9ebad7b9a5c2457516ffa87548fe0d3cee5ff864267dbe7c4dfccef0ed1c40d0273a833475ce4c96ba51f755776059daee892d114 WHIRLPOOL a3dcd382d5100c41bd0ff9900a3c6edba5e23a40711fbf9ec2762f596580947e51e31795b3d5a2daf4a299d68f798bba7500b5cb7e607a05f9cc39788abd0f48
+DIST cciss_vol_status-1.10.tar.gz 107233 SHA256 803110bf3f7d49f3b03e299e9a5209eba2661631bd07630672e497a6e182a504 SHA512 2010a9fd90b3e4c1d21ae6946c8085df96d15e4d4ce732d6488034e96f1d029f48d6226190c7422f9d99ab2994315c0514c534bb79aafd52b52bd27498428461 WHIRLPOOL a3b80b9f914621fbcc8251c942638d7eef35dad40fdfe9f795ed2693045e36f3e5c5bf8559f49320679114b9fbde88b75b26cda33d13cdb80c36629df2380478
+DIST cciss_vol_status-1.11.tar.gz 112316 SHA256 98c3c798cd8f322af8c8f18b19be069a137af15fce9e4022edee3ea7371df919 SHA512 20a80367a794a7f805f3b40184e93bd4f85e8ce2a7784eba1d2d68cbffc8299cbe121f9bf25e7112abec1269802f8146f3fc36501fb72536b1aee384e8d32064 WHIRLPOOL 70e7f5aa2f72e14e75df3c98b92bc03505ac770776bce1730c972bdf7f84808467275da93cf89e6eeab3e6af1096d8f51e35ef030a98d45ddcb3394d450fecaf
diff --git a/sys-apps/cciss_vol_status/cciss_vol_status-1.03.ebuild b/sys-apps/cciss_vol_status/cciss_vol_status-1.03.ebuild
new file mode 100644
index 000000000000..61929072e0fa
--- /dev/null
+++ b/sys-apps/cciss_vol_status/cciss_vol_status-1.03.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+IUSE=""
+DESCRIPTION="Shows status of logical drives attached to HP SmartArray controllers"
+HOMEPAGE="http://cciss.sourceforge.net/#cciss_utils"
+LICENSE="GPL-2"
+SRC_URI="mirror://sourceforge/cciss/${P}.tar.gz"
+KEYWORDS="amd64 x86"
+SLOT="0"
+RDEPEND=""
+DEPEND=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+}
diff --git a/sys-apps/cciss_vol_status/cciss_vol_status-1.09-r1.ebuild b/sys-apps/cciss_vol_status/cciss_vol_status-1.09-r1.ebuild
new file mode 100644
index 000000000000..eda2df3233cf
--- /dev/null
+++ b/sys-apps/cciss_vol_status/cciss_vol_status-1.09-r1.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+IUSE=""
+DESCRIPTION="Shows status of logical drives attached to HP SmartArray controllers"
+HOMEPAGE="http://cciss.sourceforge.net/#cciss_utils"
+LICENSE="GPL-2"
+SRC_URI="mirror://sourceforge/cciss/${P}.tar.gz"
+KEYWORDS="amd64 x86"
+SLOT="0"
+RDEPEND=""
+DEPEND=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}/cciss_vol_status.cron" cciss_vol_status
+}
diff --git a/sys-apps/cciss_vol_status/cciss_vol_status-1.09.ebuild b/sys-apps/cciss_vol_status/cciss_vol_status-1.09.ebuild
new file mode 100644
index 000000000000..3237872cad87
--- /dev/null
+++ b/sys-apps/cciss_vol_status/cciss_vol_status-1.09.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+IUSE=""
+DESCRIPTION="Shows status of logical drives attached to HP SmartArray controllers"
+HOMEPAGE="http://cciss.sourceforge.net/#cciss_utils"
+LICENSE="GPL-2"
+SRC_URI="mirror://sourceforge/cciss/${P}.tar.gz"
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+RDEPEND=""
+DEPEND=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+}
diff --git a/sys-apps/cciss_vol_status/cciss_vol_status-1.10.ebuild b/sys-apps/cciss_vol_status/cciss_vol_status-1.10.ebuild
new file mode 100644
index 000000000000..26048498a288
--- /dev/null
+++ b/sys-apps/cciss_vol_status/cciss_vol_status-1.10.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+IUSE=""
+DESCRIPTION="Shows status of logical drives attached to HP SmartArray controllers"
+HOMEPAGE="http://cciss.sourceforge.net/#cciss_utils"
+LICENSE="GPL-2"
+SRC_URI="mirror://sourceforge/cciss/${P}.tar.gz"
+KEYWORDS="amd64 ~ia64 x86"
+SLOT="0"
+RDEPEND=""
+DEPEND=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+ exeinto /etc/cron.hourly
+ newexe "${FILESDIR}/cciss_vol_status.cron" cciss_vol_status
+}
diff --git a/sys-apps/cciss_vol_status/cciss_vol_status-1.11.ebuild b/sys-apps/cciss_vol_status/cciss_vol_status-1.11.ebuild
new file mode 100644
index 000000000000..e6084b45ddfd
--- /dev/null
+++ b/sys-apps/cciss_vol_status/cciss_vol_status-1.11.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+IUSE=""
+DESCRIPTION="Shows status of logical drives attached to HP SmartArray controllers"
+HOMEPAGE="http://cciss.sourceforge.net/#cciss_utils"
+LICENSE="GPL-2"
+SRC_URI="mirror://sourceforge/cciss/${P}.tar.gz"
+KEYWORDS="~amd64 ~ia64 ~x86"
+SLOT="0"
+RDEPEND=""
+DEPEND=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+ exeinto /etc/cron.hourly
+ newexe "${FILESDIR}/cciss_vol_status.cron" cciss_vol_status
+}
diff --git a/sys-apps/cciss_vol_status/files/1.06-strlen-typo.patch b/sys-apps/cciss_vol_status/files/1.06-strlen-typo.patch
new file mode 100644
index 000000000000..a65f29dac087
--- /dev/null
+++ b/sys-apps/cciss_vol_status/files/1.06-strlen-typo.patch
@@ -0,0 +1,12 @@
+diff -uNr cciss_vol_status-1.06.ORIG//cciss_vol_status.c cciss_vol_status-1.06/cciss_vol_status.c
+--- cciss_vol_status-1.06.ORIG//cciss_vol_status.c 2010-05-02 16:33:47.634833662 +0100
++++ cciss_vol_status-1.06/cciss_vol_status.c 2010-05-02 16:34:03.351822015 +0100
+@@ -1004,7 +1004,7 @@
+ if (status < 0)
+ return 0;
+ for (i = 0; prod[i] != NULL; i++) {
+- if (strncmp(std_inq+8, prod[i], strnlen(prod[i])) == 0)
++ if (strncmp(std_inq+8, prod[i], strlen(prod[i])) == 0)
+ return 1;
+ }
+ return 0;
diff --git a/sys-apps/cciss_vol_status/files/cciss_vol_status.cron b/sys-apps/cciss_vol_status/files/cciss_vol_status.cron
new file mode 100644
index 000000000000..8d1175b45678
--- /dev/null
+++ b/sys-apps/cciss_vol_status/files/cciss_vol_status.cron
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+test -x /usr/bin/cciss_vol_status || exit 0
+
+STATUS=0
+
+if [ -d /proc/driver/cciss ]; then
+ DEVS=`awk -F: '/^cciss\/c.*d0/{print "/dev/" $1}' /proc/driver/cciss/cciss*`
+ OUTPUT=`/usr/bin/cciss_vol_status $DEVS`
+ if [ $? -ne 0 ]; then
+ printf "%s\n" "$OUTPUT"
+ exit 1
+ fi
+fi
+# FIXME: This cronjob should also look at the scsi generic nodes
+# (/dev/sg*?) to cover the hpsa driver, fibre-attached MSA1000 family
+# devices, orthehpahcisr software RAID driver (see cciss_vol_status(8)
+# about how to choose the correct nodes -- i don't use these other
+# devices, so i cannot verify how to check them cleanly)
+#
+exit 0
diff --git a/sys-apps/cciss_vol_status/metadata.xml b/sys-apps/cciss_vol_status/metadata.xml
new file mode 100644
index 000000000000..6bfcaebb086a
--- /dev/null
+++ b/sys-apps/cciss_vol_status/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>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">cciss</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/ccs-tools/Manifest b/sys-apps/ccs-tools/Manifest
new file mode 100644
index 000000000000..5468277006dd
--- /dev/null
+++ b/sys-apps/ccs-tools/Manifest
@@ -0,0 +1 @@
+DIST ccs-tools-1.8.3-20130214.tar.gz 227657 SHA256 56bb03f1977346f4c7dc3a0c5da8df4a0451a79558c26564478cb87fbf3e3ade SHA512 256adf873dd99b811f5cf55e6b74e1ccdc2e54a2399724b694f22825c4d5e3167e7768bddc4952363ef835ec2b8405d5704572a9b9e214f3102bf594374325ba WHIRLPOOL d7f200842a10ca2c83a46a933beb7c70436ea36c8aad3569c33392a11360b88dbf7589ac720994fec9d5c49c46f1e1c9f97ec320d2057680a6bb0edf13c066eb
diff --git a/sys-apps/ccs-tools/ccs-tools-1.8.3_p20130214.ebuild b/sys-apps/ccs-tools/ccs-tools-1.8.3_p20130214.ebuild
new file mode 100644
index 000000000000..dcdc98ae6690
--- /dev/null
+++ b/sys-apps/ccs-tools/ccs-tools-1.8.3_p20130214.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 multilib toolchain-funcs
+
+MY_P="${P/_p/-}"
+DESCRIPTION="TOMOYO Linux tools"
+HOMEPAGE="http://tomoyo.sourceforge.jp/"
+SRC_URI="mirror://sourceforge.jp/tomoyo/49693/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RESTRICT="test"
+
+DEPEND="sys-libs/ncurses
+ sys-libs/readline"
+RDEPEND="${DEPEND}
+ sys-apps/which"
+
+S="${WORKDIR}/ccs-tools"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-warnings.patch
+ sed -i \
+ -e "s:gcc:$(tc-getCC):" \
+ -e "s/\(CFLAGS.*:=\).*/\1 ${CFLAGS}/" \
+ -e "s:/usr/lib:/usr/$(get_libdir):g" \
+ -e "s:= /:= ${EPREFIX}/:g" \
+ Include.make || die
+}
+
+src_test() {
+ cd "${S}/kernel_test"
+ emake || die
+ ./testall.sh || die
+}
+
+src_install() {
+ emake INSTALLDIR="${D}" install || die
+ dodoc README.ccs
+}
+
+pkg_postinst() {
+ elog "Execute the following command to setup the initial policy configuration:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+ elog "For more information, please visit http://tomoyo.sourceforge.jp/1.8/"
+ elog
+ elog "This tools are for ccs-patch'ed kernels. There are also sys-apps/tomoyo-tools"
+ elog "which works with TOMOYO 2.x.x versions (already merged into Linux kernel)."
+ elog "If you'd like to try them, please emerge sys-apps/tomoyo-tools instead."
+}
+
+pkg_config() {
+ /usr/$(get_libdir)/ccs/init_policy
+}
diff --git a/sys-apps/ccs-tools/files/ccs-tools-1.8.3_p20130214-warnings.patch b/sys-apps/ccs-tools/files/ccs-tools-1.8.3_p20130214-warnings.patch
new file mode 100644
index 000000000000..8201093bbecb
--- /dev/null
+++ b/sys-apps/ccs-tools/files/ccs-tools-1.8.3_p20130214-warnings.patch
@@ -0,0 +1,22 @@
+diff --git a/usr_sbin/editpolicy_offline.c b/usr_sbin/editpolicy_offline.c
+index dbbd11e..e699cf4 100644
+--- a/usr_sbin/editpolicy_offline.c
++++ b/usr_sbin/editpolicy_offline.c
+@@ -2882,7 +2882,7 @@ static bool ccs_parse_ipaddr_union(struct ccs_acl_param *param,
+ struct ccs_ipaddr_union *ptr)
+ {
+ struct ccs_ip_address_entry e;
+- memset(ptr, 0, sizeof(ptr));
++ memset(ptr, 0, sizeof(*ptr));
+ if (ccs_parse_ip(ccs_read_token(param), &e) == 0) {
+ memmove(&ptr->ip[0], e.min, sizeof(ptr->ip[0]));
+ memmove(&ptr->ip[1], e.max, sizeof(ptr->ip[1]));
+@@ -4745,7 +4745,7 @@ static void ccs_write_control(char *buffer, const size_t buffer_len)
+ *
+ * Returns nothing.
+ */
+-static void ccs_editpolicy_offline_init(coid)
++static void ccs_editpolicy_offline_init(void)
+ {
+ static _Bool first = true;
+ int i;
diff --git a/sys-apps/ccs-tools/metadata.xml b/sys-apps/ccs-tools/metadata.xml
new file mode 100644
index 000000000000..01cfb2cab229
--- /dev/null
+++ b/sys-apps/ccs-tools/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-jp">tomoyo</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/checkpolicy/Manifest b/sys-apps/checkpolicy/Manifest
new file mode 100644
index 000000000000..b87acc90e1c8
--- /dev/null
+++ b/sys-apps/checkpolicy/Manifest
@@ -0,0 +1,3 @@
+DIST checkpolicy-2.2.tar.gz 64458 SHA256 9ff6698f4d4cb59c9c916e348187d533ada4107f90c253ef7304905934e9adf8 SHA512 a6f70e1b6581673af515d7d192237e2d47c0e07bb589c64b92f90f3a450ef8c312eabc2384479faed8bb909b98c15b676cea77e7dcb5304a51314601e93bef59 WHIRLPOOL 18c13139e8b75bb5bd45a9ddbf0c17c07fa86da66e792ece4a1d1204d211766fec27f6fce7db248957e7d2b2847c91b4c9d0ef45cf64e106aee52bc29be7992c
+DIST checkpolicy-2.3.tar.gz 64970 SHA256 90632d11afecb66997971d4c5c5d70dfb02d3969ec610ee2918ba6df99c8207b SHA512 9b10cee8ec9d555c810712131eec0e7e1bf900e4675804b8f57b04988543ba784f4bf76030f196868cef91a1c4ec370f77da12ef9e79362bf7a1cc38c7cafcff WHIRLPOOL 49ca9fa1695bedf141d397ca679ba769b748dc39ec7d462718f6b90af9c31c1da64d1ff67b3b4e426f758a9d305dc9e19d755e1127bfcd5e492dccf09ac75d09
+DIST checkpolicy-2.4.tar.gz 65238 SHA256 9bbdac28a88de4c405c769730863f3adcd266adbfa45881a5de67e3a4895bcd4 SHA512 8c5c22d9510305e7f518d1a5818f5b36895210f48835d8d24a43b2d34e79881cebcc8cd588bb663c0613a4f878db125c22a4b4df3d0f63b8fb8f88350abc61cc WHIRLPOOL b717428b4411e526cc47ed2be88d7e7e4d48153404b90d50e510fd0cc10cc0452661d0b6b0cc200bb09ae1cc040ae59aae68a8c748611db3ca4cd262f8e8f932
diff --git a/sys-apps/checkpolicy/checkpolicy-2.2.ebuild b/sys-apps/checkpolicy/checkpolicy-2.2.ebuild
new file mode 100644
index 000000000000..8cfc1969e608
--- /dev/null
+++ b/sys-apps/checkpolicy/checkpolicy-2.2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs eutils
+
+SEPOL_VER="2.2"
+SEMNG_VER="2.2"
+
+DESCRIPTION="SELinux policy compiler"
+HOMEPAGE="http://userspace.selinuxproject.org"
+SRC_URI="http://userspace.selinuxproject.org/releases/20131030/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
+ >=sys-libs/libsemanage-${SEMNG_VER}
+ sys-devel/flex
+ sys-devel/bison"
+
+RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
+
+src_compile() {
+ emake CC="$(tc-getCC)" YACC="bison -y" || die
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ if use debug; then
+ dobin "${S}/test/dismod"
+ dobin "${S}/test/dispol"
+ fi
+}
+
+pkg_postinst() {
+ einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
+}
diff --git a/sys-apps/checkpolicy/checkpolicy-2.3.ebuild b/sys-apps/checkpolicy/checkpolicy-2.3.ebuild
new file mode 100644
index 000000000000..9803a129eb80
--- /dev/null
+++ b/sys-apps/checkpolicy/checkpolicy-2.3.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 toolchain-funcs eutils
+
+MY_P="${P//_/-}"
+
+SEPOL_VER="2.3"
+SEMNG_VER="2.3"
+
+DESCRIPTION="SELinux policy compiler"
+HOMEPAGE="http://userspace.selinuxproject.org"
+SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20140506/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
+ >=sys-libs/libsemanage-${SEMNG_VER}
+ sys-devel/flex
+ sys-devel/bison"
+
+RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_compile() {
+ emake CC="$(tc-getCC)" YACC="bison -y" || die
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ if use debug; then
+ dobin "${S}/test/dismod"
+ dobin "${S}/test/dispol"
+ fi
+}
+
+pkg_postinst() {
+ einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
+}
diff --git a/sys-apps/checkpolicy/checkpolicy-2.4.ebuild b/sys-apps/checkpolicy/checkpolicy-2.4.ebuild
new file mode 100644
index 000000000000..6c71b0dc1216
--- /dev/null
+++ b/sys-apps/checkpolicy/checkpolicy-2.4.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 toolchain-funcs eutils
+
+MY_P="${P//_/-}"
+
+SEPOL_VER="${PV}"
+SEMNG_VER="${PV}"
+
+DESCRIPTION="SELinux policy compiler"
+HOMEPAGE="http://userspace.selinuxproject.org"
+SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20150202/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
+ >=sys-libs/libsemanage-${SEMNG_VER}
+ sys-devel/flex
+ sys-devel/bison"
+
+RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" YACC="bison -y" LIBDIR="\$(PREFIX)/$(get_libdir)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use debug; then
+ dobin "${S}/test/dismod"
+ dobin "${S}/test/dispol"
+ fi
+}
+
+pkg_postinst() {
+ einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
+}
diff --git a/sys-apps/checkpolicy/checkpolicy-9999.ebuild b/sys-apps/checkpolicy/checkpolicy-9999.ebuild
new file mode 100644
index 000000000000..0d877e0cc8fb
--- /dev/null
+++ b/sys-apps/checkpolicy/checkpolicy-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"
+
+inherit toolchain-funcs eutils
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20150202"
+
+SEPOL_VER="${PV}"
+SEMNG_VER="${PV}"
+
+DESCRIPTION="SELinux policy compiler"
+HOMEPAGE="http://userspace.selinuxproject.org"
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="debug"
+
+DEPEND=">=sys-libs/libsepol-${SEPOL_VER}
+ >=sys-libs/libsemanage-${SEMNG_VER}
+ sys-devel/flex
+ sys-devel/bison"
+
+RDEPEND=">=sys-libs/libsemanage-${SEMNG_VER}"
+
+src_prepare() {
+ epatch_user
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" YACC="bison -y" LIBDIR="\$(PREFIX)/$(get_libdir)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use debug; then
+ dobin "${S}/test/dismod"
+ dobin "${S}/test/dispol"
+ fi
+}
+
+pkg_postinst() {
+ einfo "This checkpolicy can compile version `checkpolicy -V |cut -f 1 -d ' '` policy."
+}
diff --git a/sys-apps/checkpolicy/metadata.xml b/sys-apps/checkpolicy/metadata.xml
new file mode 100644
index 000000000000..92f48e017202
--- /dev/null
+++ b/sys-apps/checkpolicy/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>selinux</herd>
+ <longdescription>SELinux policy compilier</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/checkservice/Manifest b/sys-apps/checkservice/Manifest
new file mode 100644
index 000000000000..085bd005d747
--- /dev/null
+++ b/sys-apps/checkservice/Manifest
@@ -0,0 +1 @@
+DIST checkservice-1.2.0.tar.gz 40614 RMD160 3bbf7dd40752bd29e1295dfea5e626896550e986 SHA1 f06c56c69130ecd4f4ee6a485b0312b9e740d36e SHA256 f949efac9cc03e4fbe2bf6da5322c1e81077376e54297a32d00f73c0cfa5e18a
diff --git a/sys-apps/checkservice/checkservice-1.2.0.ebuild b/sys-apps/checkservice/checkservice-1.2.0.ebuild
new file mode 100644
index 000000000000..4facf835a5b5
--- /dev/null
+++ b/sys-apps/checkservice/checkservice-1.2.0.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Check the status of services running on local/remote machines"
+HOMEPAGE="http://www.linvision.com/checkservice/"
+SRC_URI="http://www.linvision.com/checkservice/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/perl-5.8
+ >=dev-perl/MailTools-1.58
+ >=dev-perl/File-Find-Rule-0.26
+ >=virtual/perl-Getopt-Long-2.34"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ sed -i -e 's:/usr/local:/usr:g' $(grep -rl /usr/local *) || die "sed /usr/local"
+}
+
+src_install() {
+ dodir /var/{log,lock,cache}/checkservice
+ dobin checkservice || die
+
+ insinto /usr/lib/checkservice/check
+ doins plugins/check/* || die "check"
+ insinto /usr/lib/checkservice/warning
+ doins plugins/warning/* || die "warning"
+
+ insinto /usr/lib/perl5/vendor_perl/CS
+ doins lib/CS/* || die "perl5"
+
+ insinto /etc/checkservice/config
+ doins config/{*.mail,*.conf}
+ insinto /etc/checkservice/config/plugins/warning
+ doins config/plugins/warning/*
+
+ doman man/*
+ dodoc INSTALL README TODO checkservice.php cron/checkservice
+}
+
+pkg_postinst() {
+ einfo "If you want a php status page or cron checkservice"
+ einfo "read the INSTALL file in docs directory all files"
+ einfo "and info are there"
+}
diff --git a/sys-apps/checkservice/metadata.xml b/sys-apps/checkservice/metadata.xml
new file mode 100644
index 000000000000..d9cd2cad66c2
--- /dev/null
+++ b/sys-apps/checkservice/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>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/chname/Manifest b/sys-apps/chname/Manifest
new file mode 100644
index 000000000000..94338e8aee38
--- /dev/null
+++ b/sys-apps/chname/Manifest
@@ -0,0 +1 @@
+DIST chname-1.0.tar.gz 998 SHA256 a94d24870491f3a5671292379ba0fee7130a1ff2f7bc99dad04a4daacccb98d5
diff --git a/sys-apps/chname/chname-1.0-r1.ebuild b/sys-apps/chname/chname-1.0-r1.ebuild
new file mode 100644
index 000000000000..9334119fd590
--- /dev/null
+++ b/sys-apps/chname/chname-1.0-r1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="Run a command with a new system hostname"
+HOMEPAGE="http://code.google.com/p/chname"
+SRC_URI="http://chname.googlecode.com/files/chname-1.0.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~x86"
+IUSE=""
+
+DEPEND=">=sys-kernel/linux-headers-2.6.16"
+RDEPEND=""
+
+src_compile() {
+ emake CC=$(tc-getCC) CFLAGS="${CFLAGS} ${LDFLAGS}" chname || die
+}
+
+src_install() {
+ dobin chname
+ doman chname.1
+}
+
+pkg_postinst() {
+ elog "Note: chname requires a or later kernel with CONFIG_UTS_NS=y."
+}
diff --git a/sys-apps/chname/metadata.xml b/sys-apps/chname/metadata.xml
new file mode 100644
index 000000000000..7d6ebf36c141
--- /dev/null
+++ b/sys-apps/chname/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">Run a command with a new system hostname. Requires utsname namespaces.</longdescription>
+ <upstream>
+ <remote-id type="google-code">chname</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/cinit/Manifest b/sys-apps/cinit/Manifest
new file mode 100644
index 000000000000..f114e9b7d200
--- /dev/null
+++ b/sys-apps/cinit/Manifest
@@ -0,0 +1 @@
+DIST cinit-0.2.1.tar.bz2 63545 SHA256 a418d8c4df58ea76130561031d765e1fbfba831d4e10f9c50445de7193b830ab SHA512 fce6a0c06b11a252023f7f0159fdfe4f9f4dc3c1545708997c148ed2f0a451bb68a5b98518fc48083e3518959d28b32b1719a9b89d00af7a997854230fca09d7 WHIRLPOOL fe479f8c4ef27496604079602056eada3a580903bcfa380db7e1aae2e08f5ca5f1fdc12343f8eaa8bd537a419b4c0f69e0c1d29c681a2eb30e23eaeaddeea82a
diff --git a/sys-apps/cinit/cinit-0.2.1.ebuild b/sys-apps/cinit/cinit-0.2.1.ebuild
new file mode 100644
index 000000000000..d8f87ce5dadf
--- /dev/null
+++ b/sys-apps/cinit/cinit-0.2.1.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 toolchain-funcs
+
+DESCRIPTION="a fast, small and simple init with support for profiles"
+HOMEPAGE="http://linux.schottelius.org/cinit/"
+SRC_URI="http://linux.schottelius.org/${PN}/archives/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86"
+IUSE="doc"
+
+src_prepare() {
+ sed -i "/contrib+tools/d" Makefile || die
+ sed -i "/^STRIP/s/strip.*/true/" Makefile.include || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ LD="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} -I." \
+ LDFLAGS="${LDFLAGS}" \
+ STRIP=/bin/true \
+ all
+}
+
+src_install() {
+ emake LD=$(tc-getCC) DESTDIR="${D}" install
+ rm -f "${D}"/sbin/{init,shutdown,reboot}
+ dodoc Changelog CHANGES CREDITS README TODO
+ use doc && dodoc -r doc
+}
diff --git a/sys-apps/cinit/metadata.xml b/sys-apps/cinit/metadata.xml
new file mode 100644
index 000000000000..e96e35b1a37c
--- /dev/null
+++ b/sys-apps/cinit/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>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/sys-apps/clrngd/Manifest b/sys-apps/clrngd/Manifest
new file mode 100644
index 000000000000..7616d69e3d38
--- /dev/null
+++ b/sys-apps/clrngd/Manifest
@@ -0,0 +1 @@
+DIST clrngd-1.0.3.tar.gz 97283 RMD160 1a431b80e4b3350fa5112b8142f708de819aef02 SHA1 1446ff0f712ab46a80d3a4b452cf373e422c578f SHA256 9432765248548e2054389994ba44c87348a3a027f881ebeef2d2d2f73808388a
diff --git a/sys-apps/clrngd/clrngd-1.0.3.ebuild b/sys-apps/clrngd/clrngd-1.0.3.ebuild
new file mode 100644
index 000000000000..7f44166db975
--- /dev/null
+++ b/sys-apps/clrngd/clrngd-1.0.3.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Clock randomness gathering daemon"
+HOMEPAGE="http://echelon.pl/pubs/"
+SRC_URI="http://echelon.pl/pubs/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="sys-devel/gcc"
+RDEPEND=""
+
+src_compile() {
+ econf --bindir=/usr/sbin || die
+ emake || die
+}
+
+src_install() {
+ make DESTDIR=${D} install || die "make install failed"
+ dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README
+ newinitd ${FILESDIR}/clrngd-init.d clrngd
+ newconfd ${FILESDIR}/clrngd-conf.d clrngd
+}
diff --git a/sys-apps/clrngd/files/clrngd-conf.d b/sys-apps/clrngd/files/clrngd-conf.d
new file mode 100644
index 000000000000..d178f5de8ece
--- /dev/null
+++ b/sys-apps/clrngd/files/clrngd-conf.d
@@ -0,0 +1,9 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# This is the interval between runs of the clrngd main loop. It should NOT be
+# less than 60 seconds (the daemon will exit with an error) as the main loop
+# takes at least a minute to run. 240 seconds (4 minutes) is the default and
+# recommended value.
+DELAYTIME="240"
diff --git a/sys-apps/clrngd/files/clrngd-init.d b/sys-apps/clrngd/files/clrngd-init.d
new file mode 100644
index 000000000000..716eaeb86f27
--- /dev/null
+++ b/sys-apps/clrngd/files/clrngd-init.d
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON=clrngd
+OPTS=${DELAYTIME}
+
+start() {
+ ebegin "Starting ${DAEMON}"
+ start-stop-daemon --start --quiet --exec /usr/sbin/${DAEMON} ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${DAEMON}"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/${DAEMON}
+ eend $?
+}
diff --git a/sys-apps/clrngd/metadata.xml b/sys-apps/clrngd/metadata.xml
new file mode 100644
index 000000000000..c6d862855eb5
--- /dev/null
+++ b/sys-apps/clrngd/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>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/cobalt-panel-utils/Manifest b/sys-apps/cobalt-panel-utils/Manifest
new file mode 100644
index 000000000000..4e0e238c86d8
--- /dev/null
+++ b/sys-apps/cobalt-panel-utils/Manifest
@@ -0,0 +1 @@
+DIST cobalt-panel-utils-1.0.2.tar.gz 24552 RMD160 944d3a21e3605766c5389cb9ce0fc99c221a4fbc SHA1 35a636fb078ae08fc54767cc47c49c86769b7ecc SHA256 b8ebc79cac21993576670d56dc36739def5ceb342da1d407710dcc278586c9d8
diff --git a/sys-apps/cobalt-panel-utils/cobalt-panel-utils-1.0.2.ebuild b/sys-apps/cobalt-panel-utils/cobalt-panel-utils-1.0.2.ebuild
new file mode 100644
index 000000000000..db78c6fa6c63
--- /dev/null
+++ b/sys-apps/cobalt-panel-utils/cobalt-panel-utils-1.0.2.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils
+
+DESCRIPTION="LCD and LED panel utilities for the Sun Cobalts"
+HOMEPAGE="http://gentoo.404ster.com/"
+SRC_URI="ftp://www.404ster.com/pub/gentoo-stuff/ebuilds/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~mips x86"
+IUSE="static"
+
+RDEPEND="sys-devel/gettext"
+DEPEND="${DEPEND}
+ sys-devel/autoconf"
+
+src_configure() {
+ sed -i \
+ -e"/^COPTS/s:= := ${CFLAGS} :" \
+ -e"/^LDFLAGS/s:= := ${LDFLAGS} :"\
+ Makefile || die "sed failed"
+}
+
+src_compile() {
+ if use static; then
+ einfo "Building as static executables"
+ export STATIC="-static"
+ fi
+ emake || die
+}
+
+src_install() {
+ into /
+ dosbin "${S}"/lcd-flash "${S}"/lcd-getip "${S}"/lcd-swrite \
+ "${S}"/lcd-write "${S}"/lcd-yesno "${S}"/lcd-setcursor "${S}"/iflink
+ "${S}"/iflinkstatus "${S}"/readbutton || die "dosbin failed"
+
+ dodoc doc/README* doc/CREDITS
+ doman doc/man/*.1
+}
diff --git a/sys-apps/cobalt-panel-utils/metadata.xml b/sys-apps/cobalt-panel-utils/metadata.xml
new file mode 100644
index 000000000000..d7b1942f55b5
--- /dev/null
+++ b/sys-apps/cobalt-panel-utils/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+
+ <longdescription>
+ LCD and LED panel utilities for the Sun Cobalts. Based on panel-utils-pacifica released by Sun.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/collectl/Manifest b/sys-apps/collectl/Manifest
new file mode 100644
index 000000000000..ea3afd156f49
--- /dev/null
+++ b/sys-apps/collectl/Manifest
@@ -0,0 +1,4 @@
+DIST collectl-3.7.3.src.tar.gz 457208 SHA256 93c6c130eb89f0ecba1b1b791e80b7e6746fa82f6c4e770feb486ac8fcc53683 SHA512 4e73fc090685933b89c595b3f9f837c28bfbe1d5c3e7ffb5310db309d529779b106dac4f33f337d8b6686175bf7b4ff5af32cbb15b6469517d6e1ddecb6f34f8 WHIRLPOOL f457bbadd556e2372337f78354d0044773989c5914312b80936040494024f367db471e1d735d9cd72bca18611819dd8062b1f24244b8b002c7a035274c1a8772
+DIST collectl-3.7.4.src.tar.gz 462752 SHA256 798657b8e3626e9e4ed6fe5ae44b8216da49f0bc4bbda52217d2a304e3d7e108 SHA512 f25686fe977e0a3ea45a1980eea87baaa92a2d81ec308838c137d181e2bf182df6cdf453c5c6e7f3f0b2ccd3066d17ab9c4137303b587f55303dd4afe7ae35da WHIRLPOOL e017e293348644d922547bc99904e5434c0286b8b332509cb062ac92c6a11ff8af2a4ceb275fe82dd9dda11c7774ab9e2e344c9ca5a2d6d25b036a3dab893db0
+DIST collectl-4.0.0.src.tar.gz 618232 SHA256 7c2ecddb8ca0d49222590526d84de93b6593410515aca9aa2099d5a903e01221 SHA512 9f42a2a845ed7954f7a4d18b9c517b2beeac75819ce5fb60a9b45d24ec0ebf4dee54f32868a3e7e72d068de4c32741764a46712f2d9cfb8dbe0b54d56f1fec6d WHIRLPOOL eac180bd4533e59f16b5e117593d9132f1bc809a0f498fe08a1cb8ae57a921ecb7a80357f302e335d55c148b8748972ceb3fe01fb109ca6721938d69494ebe90
+DIST collectl-4.0.2.src.tar.gz 618639 SHA256 57474454913709a17ff22e3ac5e3839b7d6596b71aae7f08658f2c73a277622d SHA512 6e4dd377a3c155bcf4bfc613374096365cd9d3af45683408e4872af6814b87b867700ce31077eca8d011d2acd1cf626f9f220d83ef2d0d4dfdf05b80b858f47e WHIRLPOOL ef661ec0481ba4e374e8af3b8cd03a4797c6626523f316eab4456bedc8b4132b3001556b6d358ed614b18c1e7ea8e5ffc9a6ce96e17273f7f5166ab8d3201a16
diff --git a/sys-apps/collectl/collectl-3.7.3.ebuild b/sys-apps/collectl/collectl-3.7.3.ebuild
new file mode 100644
index 000000000000..9abf6c0a7808
--- /dev/null
+++ b/sys-apps/collectl/collectl-3.7.3.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="light-weight performance monitoring tool capable of reporting interactively and logging to disk"
+HOMEPAGE="http://collectl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/collectl/${P}.src.tar.gz"
+
+LICENSE="GPL-2 Artistic"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/perl-5.8.8
+ virtual/perl-Time-HiRes
+ >=dev-perl/Archive-Zip-1.20
+ sys-apps/ethtool
+ sys-apps/pciutils"
+
+src_prepare() {
+ sed -i INSTALL -e "/^DOCDIR/s:doc/collectl:doc/${PF}:" || die
+}
+
+src_install() {
+ DESTDIR="${D}" bash -ex ./INSTALL || die
+
+ rm "${D}"/etc/init.d/* || die
+ newinitd "${FILESDIR}"/collectl.initd-2 collectl
+
+ cd "${D}"/usr/share/doc/${PF} || die
+ dohtml *
+ rm ARTISTIC GPL COPYING *.html *.jpg *.css || die
+}
diff --git a/sys-apps/collectl/collectl-3.7.4.ebuild b/sys-apps/collectl/collectl-3.7.4.ebuild
new file mode 100644
index 000000000000..0b33b92843fb
--- /dev/null
+++ b/sys-apps/collectl/collectl-3.7.4.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="light-weight performance monitoring tool capable of reporting interactively and logging to disk"
+HOMEPAGE="http://collectl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/collectl/${P}.src.tar.gz"
+
+LICENSE="GPL-2 Artistic"
+SLOT="0"
+KEYWORDS="alpha amd64 ia64 x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/perl-5.8.8
+ virtual/perl-Time-HiRes
+ >=dev-perl/Archive-Zip-1.20
+ sys-apps/ethtool
+ sys-apps/pciutils"
+
+src_prepare() {
+ sed -i INSTALL -e "/^DOCDIR/s:doc/collectl:doc/${PF}:" || die
+}
+
+src_install() {
+ DESTDIR="${D}" bash -ex ./INSTALL || die
+
+ rm "${D}"/etc/init.d/* || die
+ newinitd "${FILESDIR}"/collectl.initd-2 collectl
+
+ rm "${D}"/usr/share/${PN}/UNINSTALL || die
+
+ cd "${D}"/usr/share/doc/${PF} || die
+ dohtml *
+ rm ARTISTIC GPL COPYING *.html *.jpg *.css || die
+}
diff --git a/sys-apps/collectl/collectl-4.0.0.ebuild b/sys-apps/collectl/collectl-4.0.0.ebuild
new file mode 100644
index 000000000000..f54ea2761240
--- /dev/null
+++ b/sys-apps/collectl/collectl-4.0.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="light-weight performance monitoring tool capable of reporting interactively and logging to disk"
+HOMEPAGE="http://collectl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/collectl/${P}.src.tar.gz"
+
+LICENSE="GPL-2 Artistic"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/perl-5.8.8
+ virtual/perl-Time-HiRes
+ >=dev-perl/Archive-Zip-1.20
+ sys-apps/ethtool
+ sys-apps/pciutils"
+
+src_prepare() {
+ sed -i INSTALL -e "/^DOCDIR/s:doc/collectl:doc/${PF}:" || die
+}
+
+src_install() {
+ DESTDIR="${D}" bash -ex ./INSTALL || die
+
+ rm "${D}"/etc/init.d/* || die
+ newinitd "${FILESDIR}"/collectl.initd-2 collectl
+
+ rm "${D}"/usr/share/${PN}/UNINSTALL || die
+
+ cd "${D}"/usr/share/doc/${PF} || die
+ dohtml *
+ rm ARTISTIC GPL COPYING *.html *.jpg *.css || die
+}
diff --git a/sys-apps/collectl/collectl-4.0.2.ebuild b/sys-apps/collectl/collectl-4.0.2.ebuild
new file mode 100644
index 000000000000..f54ea2761240
--- /dev/null
+++ b/sys-apps/collectl/collectl-4.0.2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="light-weight performance monitoring tool capable of reporting interactively and logging to disk"
+HOMEPAGE="http://collectl.sourceforge.net/"
+SRC_URI="mirror://sourceforge/collectl/${P}.src.tar.gz"
+
+LICENSE="GPL-2 Artistic"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/perl-5.8.8
+ virtual/perl-Time-HiRes
+ >=dev-perl/Archive-Zip-1.20
+ sys-apps/ethtool
+ sys-apps/pciutils"
+
+src_prepare() {
+ sed -i INSTALL -e "/^DOCDIR/s:doc/collectl:doc/${PF}:" || die
+}
+
+src_install() {
+ DESTDIR="${D}" bash -ex ./INSTALL || die
+
+ rm "${D}"/etc/init.d/* || die
+ newinitd "${FILESDIR}"/collectl.initd-2 collectl
+
+ rm "${D}"/usr/share/${PN}/UNINSTALL || die
+
+ cd "${D}"/usr/share/doc/${PF} || die
+ dohtml *
+ rm ARTISTIC GPL COPYING *.html *.jpg *.css || die
+}
diff --git a/sys-apps/collectl/files/collectl.initd-2 b/sys-apps/collectl/files/collectl.initd-2
new file mode 100755
index 000000000000..4abcf43cee0c
--- /dev/null
+++ b/sys-apps/collectl/files/collectl.initd-2
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="flush"
+
+pidfile="/var/run/collectl.pid"
+command="/usr/bin/collectl"
+command_args="-D"
+
+flush() {
+ einfo "Flushing collectl buffers"
+ start-stop-daemon --signal USR1 --pidfile ${pidfile}
+ eend $?
+}
diff --git a/sys-apps/collectl/metadata.xml b/sys-apps/collectl/metadata.xml
new file mode 100644
index 000000000000..0fdbe9d1fab7
--- /dev/null
+++ b/sys-apps/collectl/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">collectl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/conspy/Manifest b/sys-apps/conspy/Manifest
new file mode 100644
index 000000000000..e88bff8b98a5
--- /dev/null
+++ b/sys-apps/conspy/Manifest
@@ -0,0 +1,2 @@
+DIST conspy-1.10.tar.gz 25211 SHA256 1c8357d80ef55807fddb62c223cb3779deb66aa33f31294ad6e4e2a03a81d7ee SHA512 f22ddff140935f767bff34c8c274ff088ebae049ac61c543ad37fa126bbab2e1cec72bdd93f51cb513d00368b909935491d06a36dbff215f17cdea7a658dbad2 WHIRLPOOL 14b5bd550e70bd76ec21838720444dd8adf86a11fe669ecd3a8a549f261b2f7a9a21263f28d469f921ccf9ec3921cc9fd4481de0f2e815339c3fc46c64469e5f
+DIST conspy-1.8.tar.gz 20116 SHA256 726434eb44b95c564c81df082737948ec4b63d535d5f14975fee8c3fa8eca373 SHA512 ff9bd3064761b4f8eca6554c54bdf479e58798ec2a818ea59f52fa3b1a315f204e869903d0fd359ddd5cf082f8dec1ea40f5721f884b7a344e0320b09397fcf8 WHIRLPOOL 6a2fb33bce77dbddc108244239e210170700b74c5074f493b8a5d3e6079eb512b9b01ab356875ecee08a778337a9973630503dd82e60d85b51a81f4449692363
diff --git a/sys-apps/conspy/conspy-1.10.ebuild b/sys-apps/conspy/conspy-1.10.ebuild
new file mode 100644
index 000000000000..1b8de99d2588
--- /dev/null
+++ b/sys-apps/conspy/conspy-1.10.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+inherit autotools-utils
+
+DESCRIPTION="Remote control for Linux virtual consoles"
+HOMEPAGE="http://conspy.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}-1/${P}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ autotools-utils_src_configure
+
+ mv \
+ "${WORKDIR}"/${P}_build/Makefile-automake \
+ "${WORKDIR}"/${P}_build/Makefile || die
+}
+
+src_install() {
+ dobin "${WORKDIR}"/${P}_build/${PN}
+ doman ${PN}.1
+ dodoc ChangeLog.txt README.txt
+ dohtml ${PN}.html
+}
diff --git a/sys-apps/conspy/conspy-1.8.ebuild b/sys-apps/conspy/conspy-1.8.ebuild
new file mode 100644
index 000000000000..3a2d92554f07
--- /dev/null
+++ b/sys-apps/conspy/conspy-1.8.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 autotools
+
+DESCRIPTION="Remote control for virtual consoles"
+HOMEPAGE="http://ace-host.stuart.id.au/russell/files/conspy"
+SRC_URI="http://ace-host.stuart.id.au/russell/files/${PN}/${P}.tar.gz"
+
+LICENSE="EPL-1.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_install() {
+ default
+ dohtml ${PN}.html
+}
diff --git a/sys-apps/conspy/metadata.xml b/sys-apps/conspy/metadata.xml
new file mode 100644
index 000000000000..effbbf33eac8
--- /dev/null
+++ b/sys-apps/conspy/metadata.xml
@@ -0,0 +1,5 @@
+<?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>
+</pkgmetadata>
diff --git a/sys-apps/coreutils/Manifest b/sys-apps/coreutils/Manifest
new file mode 100644
index 000000000000..af49eabc0cb5
--- /dev/null
+++ b/sys-apps/coreutils/Manifest
@@ -0,0 +1,15 @@
+DIST coreutils-8.20-patches-1.1.tar.xz 19504 SHA256 0a1a3cc578e8872ebc93113edd76d1f1d88fb4d6596a047cfbb6c5fd4e82c22d SHA512 258116ff52d1d28acbedd2383c8d0f488c272b297c4f146231ea45fb76902bb56c9fad2d74d50c22371e67a4178dcff7b65950fcc034f56fc02c3c2ff290224f WHIRLPOOL ae4436a6ae655affbc02ee2d3d6a87345dc7b63b67aaecf01e034d2e40237c6e76b00a909d852f6ea96e348ef43e8e3f6f4c5bdb01aaf6d30a1b51036cbfe31b
+DIST coreutils-8.20.tar.xz 5273788 SHA256 dbcb798764827a0f74be738662ecb516705cf520330cd3d7b2640fdffa499eb2 SHA512 adbeab5af780ae70d2a98a81e96ad2cdfbcbc20153372b0085f6ac75ae9fadff82bd09b460400820057692b4145d7f2d276630b76b0ed509303587972ed175cd WHIRLPOOL 3cf911cf785c6e6acab4f37bc75805687f91fe74d5727782903d242669ee6b7ad444b18395d6808b1f2569703cca1992983d3bfef41f65ea461f6d0aa25908e2
+DIST coreutils-8.21-man.tar.xz 42464 SHA256 0ab87b22a715505051ffb6d94ff01fb45988ba353f0a7c248e7a1c9d79e69815 SHA512 846a995f4ddc2bd20a1a9970fc476db3d3f0f4584fbde981940b81f0c3f4065c0ced7cae71c8518bed9e880143ce734bc98bae5b84da8600e26c32b194176013 WHIRLPOOL a5c424b24223d26a90ddf9b03839fb4311e4e89a408ff982d7b493ea3962dd88e305ecd08c799b554dfe74c19eb37f1f97307a94a4f7c79c84ae8b5f5bd26b12
+DIST coreutils-8.21-patches-1.0.tar.xz 6480 SHA256 3a10abca6e41e654837583b582a831c220a02ad9a6dc2bec66e60f7038a2f632 SHA512 4f19712c2c50cbe3f3abd1c48decd063df250d72344c02796f24a43eac9d6f543be64cb7f48e3716e92db964d93b8cfc08e860f7f79726ccada796fefbe7ddd8 WHIRLPOOL 72fb7908728ffc33d9f6bd360e1bc0d990573c01c2974de5ed842ba15224e9ad137ec24d727659748350886b53ee6da71f3773cf6a5c36bd091919090200294a
+DIST coreutils-8.21.tar.xz 5357988 SHA256 adaa44bdab3fa5eb352e80d8a31fdbf957b78653d0c2cd30d63e161444288e18 SHA512 cf0e5a393b486dd7fd46600dc2928bd2303250f3bce7b2f0de1bb3bf7b0cc3f6e29001b23fda5bbabe7686bf78917cfabe1f81abb602ab41cd406b45021fd229 WHIRLPOOL 4aa93529fc41f52841d82169fc5d8b10095462d24b46a97bff78c1abda865af5cb248cfbb67495c2618b338dd05e33fecf68a677c9ca268abf97eb5d0f1f05ef
+DIST coreutils-8.22-man-r1.tar.xz 42748 SHA256 eb9882286a6355674e607506318ccc9e361b6a985d64073b797fd56a5e0d256c SHA512 b0123e3c8cd037d006a2bb64e8047636329ac3fd3d685db8e52a19e83df87da0428896af9bdcd8f1208f7aad3665ec2a871bbbfa98cbe5293c697431a23d7b4c WHIRLPOOL 7e705060f5af2d28152531ad3b5ae8e6cca2dabdec7dc1a30bcf7b74951462bb58ee610d1e080abc812e1291fae904b3e931a35d3d2566fb7b85f6a37415e04b
+DIST coreutils-8.22-patches-1.0.tar.xz 6492 SHA256 4a2a32429607e0727d6ae114ee9e543c948d6c7710ef99920901e73784cee3f4 SHA512 daf1c2b85619aa9ff7bae02926be39478f439d5555fd4eb3038b62be6cceb7cc6357b4a77a347cb2b4ee08119aa2c3f7deb63d7179407af03f08459d8de38e0b WHIRLPOOL 845dfbf57269f50486862b6236e2a461bf7bccee383365982d4359895d6c9303e467d359aa9862134a965a96a062fa2c748ceb99390bbee09f9b843dbe5bd1ed
+DIST coreutils-8.22-patches-1.1.tar.xz 7840 SHA256 4c45cca7950bbd278db23318916e503bda2df3be3e11c81cd15b55874007ed16 SHA512 7555544041cf4acf5615df76d6e9f9df157dac66059757d587af8f264597e02e8a395fbb920d42623fd40dab9a5ef1dfae2719e300efe491b0eaa2baa3a91f11 WHIRLPOOL ebc9fa35f40473646c2b826cc1bc57e9012fa37f264eb7e6084c0d2cf04f46827c943f9aa80f779a3d99bc07eeb40ffc4ac09109a6324af9882e2b0630d84253
+DIST coreutils-8.22.tar.xz 5335124 SHA256 5b3e94998152c017e6c75d56b9b994188eb71bf46d4038a642cb9141f6ff1212 SHA512 2f14c2cab7001297309b4774bf3d610ecbaaec7d98d68e3792b24d2b52d319c4e30e55f803e56c48b9b9a1b76eb1c9636be5444fe1dc1dbcdd6150cfcb34847f WHIRLPOOL 1b8e3f1cf12f7975e8d80b9ddab132937b2fffaca8c85ac1fefddb5fe277a63a7aa9c6f0f93d8f5a93d5af378b3cf3573222db8e1da918152b9fb7eff1352238
+DIST coreutils-8.23-man.tar.xz 43060 SHA256 d1b16e74b3dba4f313aeebae2c69da205f7d2e6e1c2aa8d39026c860d314ecca SHA512 db5085c783256e30b9878bdce5cf16063aaa51d800d5b40537d5cdea372d095a391e9986e8680c6d94841bc995ab43ac8bc2d23427e6e96263d24b0b5ccc7d12 WHIRLPOOL ef0cae7c1b752c0f81e6f23b0a792804518a5257740fedf7dd70577ec503a64716156a898ed50045987954a6234ba23c9483772830683bb7e4bd0c8a2ec2c142
+DIST coreutils-8.23-patches-1.1.tar.xz 6480 SHA256 daf5d61b36db61d629bf14bf8f04e878f1205c9ae2af5daf37dca3aad5a6fde4 SHA512 8da5f8e9fc47baa060030076c4a2de90013a0d1faad45fe99545e93d50bc079720281f6db5774590fe842c8c56bd8ae97e1d9bf862fae1896760b5e5b686e7a8 WHIRLPOOL 2a8082975e3627454569e57aecb3d1ac6bdef89e16f4f64a88a4ffcbf2b341fe56874b128485ae540270f7a060f9e0f4bd3eecf68e215fb6a5a1c5ac434f7403
+DIST coreutils-8.23.tar.xz 5375612 SHA256 ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d SHA512 a5f4b82ce208cb439d5dbe6f5cf4b19fecff581da210a51c4e3fdd5ffab114d171456d041e20a6996b59185947ac6655096e4b5ca252186e282ae0ae08b7534c WHIRLPOOL 4bd4cd28d6de96218e791c5ed15766e34dfeeb3aeade10e211e3a0e9ffa695e5a716872a915d78b356b3e3635e1e22274d92560301aadaf46a58242dc235d733
+DIST coreutils-8.24-man.tar.xz 42920 SHA256 cf0333b5f134a331e0b46e2ddf90666f8bdc3281c1ca2c7ccbb75b437589ce37 SHA512 9dfe614402bc35c43301ebf97d2d36ac5db1433f48171bda15f2ba76bd9944742665b30a764df0cf773ebcad1845aae57c8e36a1cd3848c1e82a7c996d6cc78a WHIRLPOOL d702a372031fe52262204c00bee641084c099c45150d82abd5915535ab3bbe1efb63c4f00173bb88725ba49126a6ecf368d14b12843b570c08165b757b78710b
+DIST coreutils-8.24-patches-1.1.tar.xz 6688 SHA256 79cb0dc5b58cb97e17b11b5e821ed88fae88f728d9fd07986bbb397824e49c6f SHA512 cf340ccb918e307be8bbfd19a299bcfe5b295a26f59a8eeb8657f5dda1361100a350e996b31097948e63890987a2f83d05d2e7175c6304f4a4812b9974679c2c WHIRLPOOL 3b4d4676b119e4f22a01c8450be13d6eb40720d3c57aac5631454df24814943e6e6024fbdcd27a2b262d42c1446d9c04cbdc163371ff20a4b28d9cd9a77c5c9c
+DIST coreutils-8.24.tar.xz 5649896 SHA256 a2d75286a4b9ef3a13039c2da3868a61be4ee9f17d8ae380a35a97e506972170 SHA512 b42bb233340353647bb9a1c3d9122c1a5379cf3602ba9197c3c935fc899897e7d4685148dfaf93eccc096bee0a9b03416d79dc9bb81d5d2dea6e04ed134a3d1b WHIRLPOOL 68598e0c93375522714b9bc0dd092386a9466725b2b4b5715e2926c5087e1ce887d5e5b8e0b872347a053edcb39ba1f8c6949ee659a06ed554703a0ba07064e2
diff --git a/sys-apps/coreutils/coreutils-8.20.ebuild b/sys-apps/coreutils/coreutils-8.20.ebuild
new file mode 100644
index 000000000000..920490ab6bd8
--- /dev/null
+++ b/sys-apps/coreutils/coreutils-8.20.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+PATCH_VER="1.1"
+DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
+HOMEPAGE="http://www.gnu.org/software/coreutils/"
+SRC_URI="mirror://gnu-alpha/coreutils/${P}.tar.xz
+ mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
+ http://dev.gentoo.org/~ryao/dist/${P}-patches-${PATCH_VER}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd"
+IUSE="acl caps gmp nls selinux static userland_BSD vanilla xattr"
+
+LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
+ caps? ( sys-libs/libcap )
+ gmp? ( dev-libs/gmp[static-libs] )
+ xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+ selinux? ( sys-libs/libselinux )
+ nls? ( >=sys-devel/gettext-0.15 )
+ !app-misc/realpath
+ !<sys-apps/util-linux-2.13
+ !sys-apps/stat
+ !net-mail/base64
+ !sys-apps/mktemp
+ !<app-forensics/tct-1.18-r1
+ !<net-fs/netatalk-2.0.3-r4
+ !<sci-chemistry/ccp4-6.1.1"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-arch/xz-utils"
+
+src_prepare() {
+ if ! use vanilla ; then
+ use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
+ EPATCH_SUFFIX="patch" \
+ PATCHDIR="${WORKDIR}/patch" \
+ EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
+ epatch
+ fi
+
+ # Since we've patched many .c files, the make process will try to
+ # re-build the manpages by running `./bin --help`. When doing a
+ # cross-compile, we can't do that since 'bin' isn't a native bin.
+ # Also, it's not like we changed the usage on any of these things,
+ # so let's just update the timestamps and skip the help2man step.
+ set -- man/*.x
+ touch ${@/%x/1}
+
+ # Avoid perl dep for compiled in dircolors default #348642
+ if ! has_version dev-lang/perl ; then
+ touch src/dircolors.h
+ touch ${@/%x/1}
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
+ export fu_cv_sys_stat_statfs2_bsize=yes #311569
+ export gl_cv_func_realpath_works=yes #416629
+ fi
+
+ export gl_cv_func_mknod_works=yes #409919
+ use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
+ use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
+ use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+ # kill/uptime - procps
+ # groups/su - shadow
+ # hostname - net-tools
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --enable-install-program="arch" \
+ --enable-no-install-program="groups,hostname,kill,su,uptime" \
+ --enable-largefile \
+ $(use caps || echo --disable-libcap) \
+ $(use_enable nls) \
+ $(use_enable acl) \
+ $(use_enable xattr) \
+ $(use_with gmp) \
+ ${myconf}
+}
+
+src_test() {
+ # Non-root tests will fail if the full path isnt
+ # accessible to non-root users
+ chmod -R go-w "${WORKDIR}"
+ chmod a+rx "${WORKDIR}"
+
+ # coreutils tests like to do `mount` and such with temp dirs
+ # so make sure /etc/mtab is writable #265725
+ # make sure /dev/loop* can be mounted #269758
+ mkdir -p "${T}"/mount-wrappers
+ mkwrap() {
+ local w ww
+ for w in "$@" ; do
+ ww="${T}/mount-wrappers/${w}"
+ cat <<-EOF > "${ww}"
+ #!/bin/sh
+ exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
+ EOF
+ chmod a+rx "${ww}"
+ done
+ }
+ mkwrap mount umount
+
+ addwrite /dev/full
+ #export RUN_EXPENSIVE_TESTS="yes"
+ #export FETISH_GROUPS="portage wheel"
+ env PATH="${T}/mount-wrappers:${PATH}" \
+ emake -j1 -k check || die "make check failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog* NEWS README* THANKS TODO
+
+ insinto /etc
+ newins src/dircolors.hin DIR_COLORS || die
+
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ cd "${D}"/usr/bin
+ dodir /bin
+ # move critical binaries into /bin (required by FHS)
+ local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
+ mkdir mknod mv pwd rm rmdir stty sync true uname"
+ mv ${fhs} ../../bin/ || die "could not move fhs bins"
+ # move critical binaries into /bin (common scripts)
+ local com="basename chroot cut dir dirname du env expr head mkfifo
+ mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
+ mv ${com} ../../bin/ || die "could not move common bins"
+ # create a symlink for uname in /usr/bin/ since autotools require it
+ local x
+ for x in ${com} uname ; do
+ dosym /bin/${x} /usr/bin/${x} || die
+ done
+ else
+ # For now, drop the man pages, collides with the ones of the system.
+ rm -rf "${D}"/usr/share/man
+ fi
+}
+
+pkg_postinst() {
+ ewarn "Make sure you run 'hash -r' in your active shells."
+ ewarn "You should also re-source your shell settings for LS_COLORS"
+ ewarn " changes, such as: source /etc/profile"
+
+ # /bin/dircolors sometimes sticks around #224823
+ if [ -e "${ROOT}/usr/bin/dircolors" ] && [ -e "${ROOT}/bin/dircolors" ] ; then
+ if strings "${ROOT}/bin/dircolors" | grep -qs "GNU coreutils" ; then
+ einfo "Deleting orphaned GNU /bin/dircolors for you"
+ rm -f "${ROOT}/bin/dircolors"
+ fi
+ fi
+
+ # Help out users using experimental filesystems
+ if grep -qs btrfs "${ROOT}"/etc/fstab /proc/mounts ; then
+ case $(uname -r) in
+ 2.6.[12][0-9]|2.6.3[0-7]*)
+ ewarn "You are running a system with a buggy btrfs driver."
+ ewarn "Please upgrade your kernel to avoid silent corruption."
+ ewarn "See: https://bugs.gentoo.org/353907"
+ ;;
+ esac
+ fi
+}
diff --git a/sys-apps/coreutils/coreutils-8.21.ebuild b/sys-apps/coreutils/coreutils-8.21.ebuild
new file mode 100644
index 000000000000..f908d261be52
--- /dev/null
+++ b/sys-apps/coreutils/coreutils-8.21.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+PATCH_VER="1.0"
+DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
+HOMEPAGE="http://www.gnu.org/software/coreutils/"
+SRC_URI="mirror://gnu-alpha/coreutils/${P}.tar.xz
+ mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
+ mirror://gentoo/${P}-man.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-man.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~arm-linux ~x86-linux"
+IUSE="acl caps gmp nls selinux static userland_BSD vanilla xattr"
+
+LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
+ caps? ( sys-libs/libcap )
+ gmp? ( dev-libs/gmp[static-libs] )
+ xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+ selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )
+ !app-misc/realpath
+ !<sys-apps/util-linux-2.13
+ !sys-apps/stat
+ !net-mail/base64
+ !sys-apps/mktemp
+ !<app-forensics/tct-1.18-r1
+ !<net-fs/netatalk-2.0.3-r4
+ !<sci-chemistry/ccp4-6.1.1"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-arch/xz-utils"
+
+src_prepare() {
+ if ! use vanilla ; then
+ use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
+ EPATCH_SUFFIX="patch" \
+ PATCHDIR="${WORKDIR}/patch" \
+ EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
+ epatch
+ fi
+
+ # Since we've patched many .c files, the make process will try to
+ # re-build the manpages by running `./bin --help`. When doing a
+ # cross-compile, we can't do that since 'bin' isn't a native bin.
+ # Also, it's not like we changed the usage on any of these things,
+ # so let's just update the timestamps and skip the help2man step.
+ set -- man/*.x
+ touch ${@/%x/1}
+
+ # Avoid perl dep for compiled in dircolors default #348642
+ if ! has_version dev-lang/perl ; then
+ touch src/dircolors.h
+ touch ${@/%x/1}
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
+ export fu_cv_sys_stat_statfs2_bsize=yes #311569
+ export gl_cv_func_realpath_works=yes #416629
+ fi
+
+ export gl_cv_func_mknod_works=yes #409919
+ use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
+ use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
+ use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+ # kill/uptime - procps
+ # groups/su - shadow
+ # hostname - net-tools
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --enable-install-program="arch" \
+ --enable-no-install-program="groups,hostname,kill,su,uptime" \
+ --enable-largefile \
+ $(use caps || echo --disable-libcap) \
+ $(use_enable nls) \
+ $(use_enable acl) \
+ $(use_enable xattr) \
+ $(use_with gmp) \
+ ${myconf}
+}
+
+src_test() {
+ # Non-root tests will fail if the full path isnt
+ # accessible to non-root users
+ chmod -R go-w "${WORKDIR}"
+ chmod a+rx "${WORKDIR}"
+
+ # coreutils tests like to do `mount` and such with temp dirs
+ # so make sure /etc/mtab is writable #265725
+ # make sure /dev/loop* can be mounted #269758
+ mkdir -p "${T}"/mount-wrappers
+ mkwrap() {
+ local w ww
+ for w in "$@" ; do
+ ww="${T}/mount-wrappers/${w}"
+ cat <<-EOF > "${ww}"
+ #!${EPREFIX}/bin/sh
+ exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
+ EOF
+ chmod a+rx "${ww}"
+ done
+ }
+ mkwrap mount umount
+
+ addwrite /dev/full
+ #export RUN_EXPENSIVE_TESTS="yes"
+ #export FETISH_GROUPS="portage wheel"
+ env PATH="${T}/mount-wrappers:${PATH}" \
+ emake -j1 -k check || die "make check failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog* NEWS README* THANKS TODO
+
+ insinto /etc
+ newins src/dircolors.hin DIR_COLORS || die
+
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ cd "${ED}"/usr/bin
+ dodir /bin
+ # move critical binaries into /bin (required by FHS)
+ local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
+ mkdir mknod mv pwd rm rmdir stty sync true uname"
+ mv ${fhs} ../../bin/ || die "could not move fhs bins"
+ # move critical binaries into /bin (common scripts)
+ local com="basename chroot cut dir dirname du env expr head mkfifo
+ mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
+ mv ${com} ../../bin/ || die "could not move common bins"
+ # create a symlink for uname in /usr/bin/ since autotools require it
+ local x
+ for x in ${com} uname ; do
+ dosym /bin/${x} /usr/bin/${x} || die
+ done
+ else
+ # For now, drop the man pages, collides with the ones of the system.
+ rm -rf "${ED}"/usr/share/man
+ fi
+
+}
+
+pkg_postinst() {
+ ewarn "Make sure you run 'hash -r' in your active shells."
+ ewarn "You should also re-source your shell settings for LS_COLORS"
+ ewarn " changes, such as: source /etc/profile"
+
+ # /bin/dircolors sometimes sticks around #224823
+ if [ -e "${EROOT}/usr/bin/dircolors" ] && [ -e "${EROOT}/bin/dircolors" ] ; then
+ if strings "${EROOT}/bin/dircolors" | grep -qs "GNU coreutils" ; then
+ einfo "Deleting orphaned GNU /bin/dircolors for you"
+ rm -f "${EROOT}/bin/dircolors"
+ fi
+ fi
+
+ # Help out users using experimental filesystems
+ if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
+ case $(uname -r) in
+ 2.6.[12][0-9]|2.6.3[0-7]*)
+ ewarn "You are running a system with a buggy btrfs driver."
+ ewarn "Please upgrade your kernel to avoid silent corruption."
+ ewarn "See: https://bugs.gentoo.org/353907"
+ ;;
+ esac
+ fi
+}
diff --git a/sys-apps/coreutils/coreutils-8.22-r1.ebuild b/sys-apps/coreutils/coreutils-8.22-r1.ebuild
new file mode 100644
index 000000000000..fc4505ffb053
--- /dev/null
+++ b/sys-apps/coreutils/coreutils-8.22-r1.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+PATCH_VER="1.1"
+DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
+HOMEPAGE="http://www.gnu.org/software/coreutils/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
+ mirror://gentoo/${P}-man-r1.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-man-r1.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~arm-linux ~x86-linux"
+IUSE="acl caps gmp nls selinux static userland_BSD vanilla xattr"
+
+LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
+ caps? ( sys-libs/libcap )
+ gmp? ( dev-libs/gmp[static-libs] )
+ xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+ selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )
+ !app-misc/realpath
+ !<sys-apps/util-linux-2.13
+ !sys-apps/stat
+ !net-mail/base64
+ !sys-apps/mktemp
+ !<app-forensics/tct-1.18-r1
+ !<net-fs/netatalk-2.0.3-r4
+ !<sci-chemistry/ccp4-6.1.1"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-arch/xz-utils"
+
+src_prepare() {
+ if ! use vanilla ; then
+ use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
+ EPATCH_SUFFIX="patch" \
+ PATCHDIR="${WORKDIR}/patch" \
+ EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
+ epatch
+ fi
+
+ # Since we've patched many .c files, the make process will try to
+ # re-build the manpages by running `./bin --help`. When doing a
+ # cross-compile, we can't do that since 'bin' isn't a native bin.
+ # Also, it's not like we changed the usage on any of these things,
+ # so let's just update the timestamps and skip the help2man step.
+ set -- man/*.x
+ touch ${@/%x/1}
+
+ # Avoid perl dep for compiled in dircolors default #348642
+ if ! has_version dev-lang/perl ; then
+ touch src/dircolors.h
+ touch ${@/%x/1}
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
+ export fu_cv_sys_stat_statfs2_bsize=yes #311569
+ export gl_cv_func_realpath_works=yes #416629
+ fi
+
+ export gl_cv_func_mknod_works=yes #409919
+ use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
+ use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
+ use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+ # kill/uptime - procps
+ # groups/su - shadow
+ # hostname - net-tools
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --enable-install-program="arch" \
+ --enable-no-install-program="groups,hostname,kill,su,uptime" \
+ --enable-largefile \
+ $(use caps || echo --disable-libcap) \
+ $(use_enable nls) \
+ $(use_enable acl) \
+ $(use_enable xattr) \
+ $(use_with gmp) \
+ ${myconf}
+}
+
+src_test() {
+ # Non-root tests will fail if the full path isnt
+ # accessible to non-root users
+ chmod -R go-w "${WORKDIR}"
+ chmod a+rx "${WORKDIR}"
+
+ # coreutils tests like to do `mount` and such with temp dirs
+ # so make sure /etc/mtab is writable #265725
+ # make sure /dev/loop* can be mounted #269758
+ mkdir -p "${T}"/mount-wrappers
+ mkwrap() {
+ local w ww
+ for w in "$@" ; do
+ ww="${T}/mount-wrappers/${w}"
+ cat <<-EOF > "${ww}"
+ #!${EPREFIX}/bin/sh
+ exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
+ EOF
+ chmod a+rx "${ww}"
+ done
+ }
+ mkwrap mount umount
+
+ addwrite /dev/full
+ #export RUN_EXPENSIVE_TESTS="yes"
+ #export FETISH_GROUPS="portage wheel"
+ env PATH="${T}/mount-wrappers:${PATH}" \
+ emake -j1 -k check || die "make check failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog* NEWS README* THANKS TODO
+
+ insinto /etc
+ newins src/dircolors.hin DIR_COLORS || die
+
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ cd "${ED}"/usr/bin
+ dodir /bin
+ # move critical binaries into /bin (required by FHS)
+ local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
+ mkdir mknod mv pwd rm rmdir stty sync true uname"
+ mv ${fhs} ../../bin/ || die "could not move fhs bins"
+ # move critical binaries into /bin (common scripts)
+ local com="basename chroot cut dir dirname du env expr head mkfifo
+ mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
+ mv ${com} ../../bin/ || die "could not move common bins"
+ # create a symlink for uname in /usr/bin/ since autotools require it
+ local x
+ for x in ${com} uname ; do
+ dosym /bin/${x} /usr/bin/${x} || die
+ done
+ else
+ # For now, drop the man pages, collides with the ones of the system.
+ rm -rf "${ED}"/usr/share/man
+ fi
+
+}
+
+pkg_postinst() {
+ ewarn "Make sure you run 'hash -r' in your active shells."
+ ewarn "You should also re-source your shell settings for LS_COLORS"
+ ewarn " changes, such as: source /etc/profile"
+
+ # Help out users using experimental filesystems
+ if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
+ case $(uname -r) in
+ 2.6.[12][0-9]|2.6.3[0-7]*)
+ ewarn "You are running a system with a buggy btrfs driver."
+ ewarn "Please upgrade your kernel to avoid silent corruption."
+ ewarn "See: https://bugs.gentoo.org/353907"
+ ;;
+ esac
+ fi
+}
diff --git a/sys-apps/coreutils/coreutils-8.22.ebuild b/sys-apps/coreutils/coreutils-8.22.ebuild
new file mode 100644
index 000000000000..84e43c2acd14
--- /dev/null
+++ b/sys-apps/coreutils/coreutils-8.22.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+PATCH_VER="1.0"
+DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
+HOMEPAGE="http://www.gnu.org/software/coreutils/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
+ mirror://gentoo/${P}-man-r1.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-man-r1.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~arm-linux ~x86-linux"
+IUSE="acl caps gmp nls selinux static userland_BSD vanilla xattr"
+
+LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
+ caps? ( sys-libs/libcap )
+ gmp? ( dev-libs/gmp[static-libs] )
+ xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+ selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )
+ !app-misc/realpath
+ !<sys-apps/util-linux-2.13
+ !sys-apps/stat
+ !net-mail/base64
+ !sys-apps/mktemp
+ !<app-forensics/tct-1.18-r1
+ !<net-fs/netatalk-2.0.3-r4
+ !<sci-chemistry/ccp4-6.1.1"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-arch/xz-utils"
+
+src_prepare() {
+ if ! use vanilla ; then
+ use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
+ EPATCH_SUFFIX="patch" \
+ PATCHDIR="${WORKDIR}/patch" \
+ EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
+ epatch
+ fi
+
+ # Since we've patched many .c files, the make process will try to
+ # re-build the manpages by running `./bin --help`. When doing a
+ # cross-compile, we can't do that since 'bin' isn't a native bin.
+ # Also, it's not like we changed the usage on any of these things,
+ # so let's just update the timestamps and skip the help2man step.
+ set -- man/*.x
+ touch ${@/%x/1}
+
+ # Avoid perl dep for compiled in dircolors default #348642
+ if ! has_version dev-lang/perl ; then
+ touch src/dircolors.h
+ touch ${@/%x/1}
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
+ export fu_cv_sys_stat_statfs2_bsize=yes #311569
+ export gl_cv_func_realpath_works=yes #416629
+ fi
+
+ export gl_cv_func_mknod_works=yes #409919
+ use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
+ use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
+ use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+ # kill/uptime - procps
+ # groups/su - shadow
+ # hostname - net-tools
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --enable-install-program="arch" \
+ --enable-no-install-program="groups,hostname,kill,su,uptime" \
+ --enable-largefile \
+ $(use caps || echo --disable-libcap) \
+ $(use_enable nls) \
+ $(use_enable acl) \
+ $(use_enable xattr) \
+ $(use_with gmp) \
+ ${myconf}
+}
+
+src_test() {
+ # Non-root tests will fail if the full path isnt
+ # accessible to non-root users
+ chmod -R go-w "${WORKDIR}"
+ chmod a+rx "${WORKDIR}"
+
+ # coreutils tests like to do `mount` and such with temp dirs
+ # so make sure /etc/mtab is writable #265725
+ # make sure /dev/loop* can be mounted #269758
+ mkdir -p "${T}"/mount-wrappers
+ mkwrap() {
+ local w ww
+ for w in "$@" ; do
+ ww="${T}/mount-wrappers/${w}"
+ cat <<-EOF > "${ww}"
+ #!${EPREFIX}/bin/sh
+ exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
+ EOF
+ chmod a+rx "${ww}"
+ done
+ }
+ mkwrap mount umount
+
+ addwrite /dev/full
+ #export RUN_EXPENSIVE_TESTS="yes"
+ #export FETISH_GROUPS="portage wheel"
+ env PATH="${T}/mount-wrappers:${PATH}" \
+ emake -j1 -k check || die "make check failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog* NEWS README* THANKS TODO
+
+ insinto /etc
+ newins src/dircolors.hin DIR_COLORS || die
+
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ cd "${ED}"/usr/bin
+ dodir /bin
+ # move critical binaries into /bin (required by FHS)
+ local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
+ mkdir mknod mv pwd rm rmdir stty sync true uname"
+ mv ${fhs} ../../bin/ || die "could not move fhs bins"
+ # move critical binaries into /bin (common scripts)
+ local com="basename chroot cut dir dirname du env expr head mkfifo
+ mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
+ mv ${com} ../../bin/ || die "could not move common bins"
+ # create a symlink for uname in /usr/bin/ since autotools require it
+ local x
+ for x in ${com} uname ; do
+ dosym /bin/${x} /usr/bin/${x} || die
+ done
+ else
+ # For now, drop the man pages, collides with the ones of the system.
+ rm -rf "${ED}"/usr/share/man
+ fi
+
+}
+
+pkg_postinst() {
+ ewarn "Make sure you run 'hash -r' in your active shells."
+ ewarn "You should also re-source your shell settings for LS_COLORS"
+ ewarn " changes, such as: source /etc/profile"
+
+ # /bin/dircolors sometimes sticks around #224823
+ if [ -e "${EROOT}/usr/bin/dircolors" ] && [ -e "${EROOT}/bin/dircolors" ] ; then
+ if strings "${EROOT}/bin/dircolors" | grep -qs "GNU coreutils" ; then
+ einfo "Deleting orphaned GNU /bin/dircolors for you"
+ rm -f "${EROOT}/bin/dircolors"
+ fi
+ fi
+
+ # Help out users using experimental filesystems
+ if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
+ case $(uname -r) in
+ 2.6.[12][0-9]|2.6.3[0-7]*)
+ ewarn "You are running a system with a buggy btrfs driver."
+ ewarn "Please upgrade your kernel to avoid silent corruption."
+ ewarn "See: https://bugs.gentoo.org/353907"
+ ;;
+ esac
+ fi
+}
diff --git a/sys-apps/coreutils/coreutils-8.23.ebuild b/sys-apps/coreutils/coreutils-8.23.ebuild
new file mode 100644
index 000000000000..61d41f5b29ef
--- /dev/null
+++ b/sys-apps/coreutils/coreutils-8.23.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# To generate the man pages, unpack the upstream tarball and run:
+# ./configure --enable-install-program=arch,coreutils
+# make
+# cd ..
+# tar cf - coreutils-*/man/*.[0-9] | xz > coreutils-<ver>-man.tar.xz
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+PATCH_VER="1.1"
+DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
+HOMEPAGE="http://www.gnu.org/software/coreutils/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
+ mirror://gentoo/${P}-man.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-man.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="acl caps gmp multicall nls selinux static userland_BSD vanilla xattr"
+
+LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
+ caps? ( sys-libs/libcap )
+ gmp? ( dev-libs/gmp[static-libs] )
+ xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+ selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )
+ !app-misc/realpath
+ !<sys-apps/util-linux-2.13
+ !sys-apps/stat
+ !net-mail/base64
+ !sys-apps/mktemp
+ !<app-forensics/tct-1.18-r1
+ !<net-fs/netatalk-2.0.3-r4
+ !<sci-chemistry/ccp4-6.1.1"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-arch/xz-utils"
+
+src_prepare() {
+ if ! use vanilla ; then
+ use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
+ EPATCH_SUFFIX="patch" \
+ PATCHDIR="${WORKDIR}/patch" \
+ EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
+ epatch
+ fi
+
+ # Since we've patched many .c files, the make process will try to
+ # re-build the manpages by running `./bin --help`. When doing a
+ # cross-compile, we can't do that since 'bin' isn't a native bin.
+ # Also, it's not like we changed the usage on any of these things,
+ # so let's just update the timestamps and skip the help2man step.
+ set -- man/*.x
+ touch ${@/%x/1}
+
+ # Avoid perl dep for compiled in dircolors default #348642
+ if ! has_version dev-lang/perl ; then
+ touch src/dircolors.h
+ touch ${@/%x/1}
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
+ export fu_cv_sys_stat_statfs2_bsize=yes #311569
+ export gl_cv_func_realpath_works=yes #416629
+ fi
+
+ export gl_cv_func_mknod_works=yes #409919
+ use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
+ use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
+ use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+ # kill/uptime - procps
+ # groups/su - shadow
+ # hostname - net-tools
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --enable-install-program="arch" \
+ --enable-no-install-program="groups,hostname,kill,su,uptime" \
+ --enable-largefile \
+ $(use caps || echo --disable-libcap) \
+ $(use_enable nls) \
+ $(use_enable acl) \
+ $(use_enable multicall single-binary) \
+ $(use_enable xattr) \
+ $(use_with gmp) \
+ ${myconf}
+}
+
+src_test() {
+ # Non-root tests will fail if the full path isn't
+ # accessible to non-root users
+ chmod -R go-w "${WORKDIR}"
+ chmod a+rx "${WORKDIR}"
+
+ # coreutils tests like to do `mount` and such with temp dirs
+ # so make sure /etc/mtab is writable #265725
+ # make sure /dev/loop* can be mounted #269758
+ mkdir -p "${T}"/mount-wrappers
+ mkwrap() {
+ local w ww
+ for w in "$@" ; do
+ ww="${T}/mount-wrappers/${w}"
+ cat <<-EOF > "${ww}"
+ #!${EPREFIX}/bin/sh
+ exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
+ EOF
+ chmod a+rx "${ww}"
+ done
+ }
+ mkwrap mount umount
+
+ addwrite /dev/full
+ #export RUN_EXPENSIVE_TESTS="yes"
+ #export FETISH_GROUPS="portage wheel"
+ env PATH="${T}/mount-wrappers:${PATH}" \
+ emake -j1 -k check
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ newins src/dircolors.hin DIR_COLORS
+
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ cd "${ED}"/usr/bin
+ dodir /bin
+ # move critical binaries into /bin (required by FHS)
+ local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
+ mkdir mknod mv pwd rm rmdir stty sync true uname"
+ mv ${fhs} ../../bin/ || die "could not move fhs bins"
+ # move critical binaries into /bin (common scripts)
+ local com="basename chroot cut dir dirname du env expr head mkfifo
+ mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
+ mv ${com} ../../bin/ || die "could not move common bins"
+ # create a symlink for uname in /usr/bin/ since autotools require it
+ local x
+ for x in ${com} uname ; do
+ dosym /bin/${x} /usr/bin/${x}
+ done
+ else
+ # For now, drop the man pages, collides with the ones of the system.
+ rm -rf "${ED}"/usr/share/man
+ fi
+
+}
+
+pkg_postinst() {
+ ewarn "Make sure you run 'hash -r' in your active shells."
+ ewarn "You should also re-source your shell settings for LS_COLORS"
+ ewarn " changes, such as: source /etc/profile"
+
+ # Help out users using experimental filesystems
+ if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
+ case $(uname -r) in
+ 2.6.[12][0-9]|2.6.3[0-7]*)
+ ewarn "You are running a system with a buggy btrfs driver."
+ ewarn "Please upgrade your kernel to avoid silent corruption."
+ ewarn "See: https://bugs.gentoo.org/353907"
+ ;;
+ esac
+ fi
+}
diff --git a/sys-apps/coreutils/coreutils-8.24.ebuild b/sys-apps/coreutils/coreutils-8.24.ebuild
new file mode 100644
index 000000000000..a3511ffdfc6a
--- /dev/null
+++ b/sys-apps/coreutils/coreutils-8.24.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# To generate the man pages, unpack the upstream tarball and run:
+# ./configure --enable-install-program=arch,coreutils
+# make
+# cd ..
+# tar cf - coreutils-*/man/*.[0-9] | xz > coreutils-<ver>-man.tar.xz
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+PATCH_VER="1.1"
+DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
+HOMEPAGE="http://www.gnu.org/software/coreutils/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.xz
+ mirror://gentoo/${P}-man.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}-man.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="acl caps gmp multicall nls selinux static userland_BSD vanilla xattr"
+
+LIB_DEPEND="acl? ( sys-apps/acl[static-libs] )
+ caps? ( sys-libs/libcap )
+ gmp? ( dev-libs/gmp[static-libs] )
+ xattr? ( !userland_BSD? ( sys-apps/attr[static-libs] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs]} )
+ selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )
+ !app-misc/realpath
+ !<sys-apps/util-linux-2.13
+ !sys-apps/stat
+ !net-mail/base64
+ !sys-apps/mktemp
+ !<app-forensics/tct-1.18-r1
+ !<net-fs/netatalk-2.0.3-r4
+ !<sci-chemistry/ccp4-6.1.1"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ app-arch/xz-utils"
+
+src_prepare() {
+ if ! use vanilla ; then
+ use_if_iuse unicode || rm -f "${WORKDIR}"/patch/000_all_coreutils-i18n.patch
+ EPATCH_SUFFIX="patch" \
+ PATCHDIR="${WORKDIR}/patch" \
+ EPATCH_EXCLUDE="001_all_coreutils-gen-progress-bar.patch" \
+ epatch
+ fi
+
+ # Since we've patched many .c files, the make process will try to
+ # re-build the manpages by running `./bin --help`. When doing a
+ # cross-compile, we can't do that since 'bin' isn't a native bin.
+ # Also, it's not like we changed the usage on any of these things,
+ # so let's just update the timestamps and skip the help2man step.
+ set -- man/*.x
+ touch ${@/%x/1}
+
+ # Avoid perl dep for compiled in dircolors default #348642
+ if ! has_version dev-lang/perl ; then
+ touch src/dircolors.h
+ touch ${@/%x/1}
+ fi
+}
+
+src_configure() {
+ local myconf=''
+ if tc-is-cross-compiler && [[ ${CHOST} == *linux* ]] ; then
+ export fu_cv_sys_stat_statfs2_bsize=yes #311569
+ export gl_cv_func_realpath_works=yes #416629
+ fi
+
+ export gl_cv_func_mknod_works=yes #409919
+ use static && append-ldflags -static && sed -i '/elf_sys=yes/s:yes:no:' configure #321821
+ use selinux || export ac_cv_{header_selinux_{context,flash,selinux}_h,search_setfilecon}=no #301782
+ use userland_BSD && myconf="${myconf} -program-prefix=g --program-transform-name=s/stat/nustat/"
+ # kill/uptime - procps
+ # groups/su - shadow
+ # hostname - net-tools
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR} (p${PATCH_VER:-0})" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --enable-install-program="arch" \
+ --enable-no-install-program="groups,hostname,kill,su,uptime" \
+ --enable-largefile \
+ $(use caps || echo --disable-libcap) \
+ $(use_enable nls) \
+ $(use_enable acl) \
+ $(use_enable multicall single-binary) \
+ $(use_enable xattr) \
+ $(use_with gmp) \
+ ${myconf}
+}
+
+src_test() {
+ # Non-root tests will fail if the full path isn't
+ # accessible to non-root users
+ chmod -R go-w "${WORKDIR}"
+ chmod a+rx "${WORKDIR}"
+
+ # coreutils tests like to do `mount` and such with temp dirs
+ # so make sure /etc/mtab is writable #265725
+ # make sure /dev/loop* can be mounted #269758
+ mkdir -p "${T}"/mount-wrappers
+ mkwrap() {
+ local w ww
+ for w in "$@" ; do
+ ww="${T}/mount-wrappers/${w}"
+ cat <<-EOF > "${ww}"
+ #!${EPREFIX}/bin/sh
+ exec env SANDBOX_WRITE="\${SANDBOX_WRITE}:/etc/mtab:/dev/loop" $(type -P $w) "\$@"
+ EOF
+ chmod a+rx "${ww}"
+ done
+ }
+ mkwrap mount umount
+
+ addwrite /dev/full
+ #export RUN_EXPENSIVE_TESTS="yes"
+ #export FETISH_GROUPS="portage wheel"
+ env PATH="${T}/mount-wrappers:${PATH}" \
+ emake -j1 -k check
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ newins src/dircolors.hin DIR_COLORS
+
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ cd "${ED}"/usr/bin
+ dodir /bin
+ # move critical binaries into /bin (required by FHS)
+ local fhs="cat chgrp chmod chown cp date dd df echo false ln ls
+ mkdir mknod mv pwd rm rmdir stty sync true uname"
+ mv ${fhs} ../../bin/ || die "could not move fhs bins"
+ # move critical binaries into /bin (common scripts)
+ local com="basename chroot cut dir dirname du env expr head mkfifo
+ mktemp readlink seq sleep sort tail touch tr tty vdir wc yes"
+ mv ${com} ../../bin/ || die "could not move common bins"
+ # create a symlink for uname in /usr/bin/ since autotools require it
+ local x
+ for x in ${com} uname ; do
+ dosym /bin/${x} /usr/bin/${x}
+ done
+ else
+ # For now, drop the man pages, collides with the ones of the system.
+ rm -rf "${ED}"/usr/share/man
+ fi
+
+}
+
+pkg_postinst() {
+ ewarn "Make sure you run 'hash -r' in your active shells."
+ ewarn "You should also re-source your shell settings for LS_COLORS"
+ ewarn " changes, such as: source /etc/profile"
+
+ # Help out users using experimental filesystems
+ if grep -qs btrfs "${EROOT}"/etc/fstab /proc/mounts ; then
+ case $(uname -r) in
+ 2.6.[12][0-9]|2.6.3[0-7]*)
+ ewarn "You are running a system with a buggy btrfs driver."
+ ewarn "Please upgrade your kernel to avoid silent corruption."
+ ewarn "See: https://bugs.gentoo.org/353907"
+ ;;
+ esac
+ fi
+}
diff --git a/sys-apps/coreutils/metadata.xml b/sys-apps/coreutils/metadata.xml
new file mode 100644
index 000000000000..02d1ba75a6d2
--- /dev/null
+++ b/sys-apps/coreutils/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>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:coreutils</remote-id>
+</upstream>
+<use>
+ <flag name='multicall'>Build all tools into a single `coreutils` program akin to busybox to save space</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/cpint/Manifest b/sys-apps/cpint/Manifest
new file mode 100644
index 000000000000..74d673384bb0
--- /dev/null
+++ b/sys-apps/cpint/Manifest
@@ -0,0 +1,2 @@
+DIST cpint116.tgz 20626 SHA256 8bfc3d7add9c860de93154331af30198e06564d5a03aa1f627b239a27d7a8b89
+DIST cpint253.tgz 31143 SHA256 a82d66d38c9cd0e99e7226f5e56598ec41e4b4bf27d5c7c94cad9f96314791fd
diff --git a/sys-apps/cpint/cpint-1.1.6.ebuild b/sys-apps/cpint/cpint-1.1.6.ebuild
new file mode 100644
index 000000000000..57850bfb7db7
--- /dev/null
+++ b/sys-apps/cpint/cpint-1.1.6.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit linux-info
+
+MY_PV=${PV//./}
+
+DESCRIPTION="Linux/390 Interface to z/VM's Control Program"
+HOMEPAGE="http://linuxvm.org/Patches/index.html"
+SRC_URI="http://linuxvm.org/Patches/s390/${PN}${MY_PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="s390"
+IUSE=""
+
+DEPEND=""
+
+src_compile() {
+ emake INCLUDEDIR=-I/usr/src/linux/include || die "emake failed"
+}
+
+src_install() {
+ einstall prefix="${D}" || die
+ rm -rf "${D}"/lib/modules/misc
+ dodoc ChangeLog HOW-TO
+}
diff --git a/sys-apps/cpint/cpint-2.5.3.ebuild b/sys-apps/cpint/cpint-2.5.3.ebuild
new file mode 100644
index 000000000000..4156ebe6da24
--- /dev/null
+++ b/sys-apps/cpint/cpint-2.5.3.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 linux-info eutils
+
+MY_PV=${PV//./}
+
+DESCRIPTION="Linux/390 Interface to z/VM's Control Program"
+HOMEPAGE="http://linuxvm.org/Patches/index.html"
+SRC_URI="http://linuxvm.org/Patches/s390/${PN}${MY_PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="s390"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-prototypes.patch
+ epatch "${FILESDIR}"/${P}-kernel.patch
+
+ # the makefile uses this variable
+ export KERNEL_DIR
+}
+
+src_install() {
+ emake install prefix="${D}"
+ dodoc ChangeLog HOW-TO
+}
diff --git a/sys-apps/cpint/files/cpint-2.5.3-build.patch b/sys-apps/cpint/files/cpint-2.5.3-build.patch
new file mode 100644
index 000000000000..9dacbdb6c7ad
--- /dev/null
+++ b/sys-apps/cpint/files/cpint-2.5.3-build.patch
@@ -0,0 +1,73 @@
+--- cpint-2.5.3/Makefile
++++ cpint-2.5.3/Makefile
+@@ -5,59 +5,29 @@
+ prefix =
+ bindir = /usr/sbin
+ etcdir = /etc
++krndir = /lib/modules/`uname -r`/misc
+
+-COMMAND = hcp mongen monstat actgen diag0
+-
+-tools: $(COMMAND)
++CFLAGS += -Wall
++CPPFLAGS += -I$(KERNEL_DIR)/include
+
+-hcp : hcp.o
+- $(CC) -o $@ $^
++COMMAND = hcp mongen monstat actgen diag0
+
+-hcptest : hcptest.o
+- $(CC) -o $@ $^
++all: $(COMMAND) cpint_mod.ko
+
+-mongen : mongen.o
+- $(CC) -o $@ $^
++cpint_mod.ko:
++ $(MAKE) -C $(KERNEL_DIR) modules SUBDIRS=$(PWD)
+
+-actgen : actgen.o
+- $(CC) -o $@ $^
++tools: $(COMMAND)
+
+ monstat : monstat.o sysinfo.o
+- $(CC) -o $@ $^
+-
+-diag0 : diag0.o
+- $(CC) -o $@ $^
+-
+-hcp.o : hcp.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c hcp.c
+-
+-hcptest.o : hcptest.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c hcptest.c
+-
+-mongen.o : mongen.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c mongen.c
+-
+-monstat.o : monstat.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c monstat.c
+-
+-sysinfo.o : sysinfo.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c sysinfo.c
+-
+-actgen.o : actgen.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c actgen.c
+-
+-diag0.o : diag0.c
+- $(CC) -o $@ $(INCLUDEDIR) -I. -O2 -c diag0.c
+
+ install: $(TARGET)
++ install -d -m 755 ${prefix}${bindir}
+ install -c -m 750 mongen ${prefix}${bindir}
+ install -c -m 750 monstat ${prefix}${bindir}
+ install -c -m 750 hcp ${prefix}${bindir}
+- cp cpint_mod.ko /lib/modules/`uname -r`/kernel/drivers/s390/char/
+- rm -rf /dev/cpcmd /dev/cpmod /dev/cpappl /dev/cpid \
+- /dev/cpint0 /dev/cpint8 /dev/cpint76 /dev/cpint222
+- modprobe -qr cpint_mod
+- depmod -a
++ install -d -m 755 ${prefix}${krndir}
++ install -c -m 644 cpint_mod.ko ${prefix}${krndir}
+
+ clean:
+ rm -rf *.o *~ core mongen monstat actgen hcp diag0 *.ko *.cmd \
diff --git a/sys-apps/cpint/files/cpint-2.5.3-kernel.patch b/sys-apps/cpint/files/cpint-2.5.3-kernel.patch
new file mode 100644
index 000000000000..b4bb7640eb2c
--- /dev/null
+++ b/sys-apps/cpint/files/cpint-2.5.3-kernel.patch
@@ -0,0 +1,43 @@
+--- cpint-2.5.3/cpint.c
++++ cpint-2.5.3/cpint.c
+@@ -131,7 +131,7 @@
+
+ CPInt_Dev *cpint_devices;
+
+-static struct class_simple *cpint_class;
++static struct class *cpint_class;
+
+ /*----------------------------------------------------------*/
+ /* The different file operations */
+@@ -309,7 +309,7 @@
+ /*------------------------------------------------------*/
+ /* Register this device class */
+ /*------------------------------------------------------*/
+- cpint_class = class_simple_create(THIS_MODULE, "cpint");
++ cpint_class = class_create(THIS_MODULE, "cpint");
+ if (IS_ERR(cpint_class)) {
+ printk(KERN_ERR "Error creating cpint class.\n");
+ kfree(cpint_devices);
+@@ -325,7 +325,7 @@
+
+ fopIdx = fopMap[i_dev];
+ if (fopIdx > -1 && !(cpint_devs_map & (1 << fopIdx))) {
+- class_simple_device_add(cpint_class,
++ class_device_create(cpint_class, NULL,
+ MKDEV(cpint_major, i_dev), NULL,
+ cpNames[fopIdx]);
+ cpint_devs_map |= 1 << fopIdx;
+@@ -386,11 +386,11 @@
+
+ fopIdx = fopMap[i_dev];
+ if (fopIdx > -1 && (cpint_devs_map & (1 << fopIdx))) {
+- class_simple_device_remove(MKDEV(cpint_major, i_dev));
++ class_device_destroy(cpint_class, MKDEV(cpint_major, i_dev));
+ }
+ }
+ cpint_devs_map = 0;
+- class_simple_destroy(cpint_class);
++ class_destroy(cpint_class);
+
+ unregister_chrdev(cpint_major, "cpint");
+ for (i_dev = 0; i_dev < CPINT_NR_DEVS; i_dev++) {
diff --git a/sys-apps/cpint/files/cpint-2.5.3-prototypes.patch b/sys-apps/cpint/files/cpint-2.5.3-prototypes.patch
new file mode 100644
index 000000000000..376ee8c4fc87
--- /dev/null
+++ b/sys-apps/cpint/files/cpint-2.5.3-prototypes.patch
@@ -0,0 +1,43 @@
+--- cpint-2.5.3/actgen.c
++++ cpint-2.5.3/actgen.c
+@@ -45,6 +45,7 @@
+ /************************************************************/
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- cpint-2.5.3/diag0.c
++++ cpint-2.5.3/diag0.c
+@@ -46,6 +46,8 @@
+ /************************************************************/
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <sys/ioctl.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- cpint-2.5.3/hcp.c
++++ cpint-2.5.3/hcp.c
+@@ -48,6 +48,8 @@
+ /************************************************************/
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <sys/ioctl.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- cpint-2.5.3/mongen.c
++++ cpint-2.5.3/mongen.c
+@@ -59,6 +59,8 @@
+ /************************************************************/
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <sys/ioctl.h>
+ #include <unistd.h>
+ #include <errno.h>
+ #include <fcntl.h>
diff --git a/sys-apps/cpint/metadata.xml b/sys-apps/cpint/metadata.xml
new file mode 100644
index 000000000000..045daae69a4e
--- /dev/null
+++ b/sys-apps/cpint/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>s390</herd>
+<longdescription>Linux/390 Interface to z/VM's Control Program</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/cpuid/Manifest b/sys-apps/cpuid/Manifest
new file mode 100644
index 000000000000..23c5295a39b0
--- /dev/null
+++ b/sys-apps/cpuid/Manifest
@@ -0,0 +1,3 @@
+DIST cpuid-20130610.src.tar.gz 65801 SHA256 f87e835a83e69013eee09eded0e9c5ac0ea5819d569d3b79680cab2b5ea770f4 SHA512 cb31126a7ba7244d44c3b0d86ad93f3ff0956a59af488a27ed482e549a8f628fedf142ac8f238c32e48946b5c76ceba2f5a0b95a9b4df8bf7354ed4dcdbeb0a7 WHIRLPOOL e82d27e1450e85e53074fa37f42ad5e03a0daf3dd153c5d6a8674c72b2e04f266f59b80f2eb90f3f25e8a8b0f473e8aa1ce4991b9eb8d50e76d6e1ae70665ab2
+DIST cpuid-20140123.src.tar.gz 67882 SHA256 b85aba5696d382f0dba8dc246bd42d09767089d6181a9cd0633d626f079d79ff SHA512 8b205cc539959dcd63326d5de700e090213f5b7cdbd5e25925b8db774001cbd95df7ccb696fda124226380fef69ea7fe0c0885869b0ec7e07b0c340dc0cd8a5b WHIRLPOOL dfcc1b6ea125fb0b6c13b7edd7f6c37592a2acfbc178f4c65cd7ec1577010ec9cc69919af512681e4af048ab028cb8992d1a282435e5b4aace179c40ff607ac4
+DIST cpuid-20150606.src.tar.gz 71882 SHA256 b7607e81e62e4901180d9e2f48fe407033211c3fb300d758a210f746ef518c4e SHA512 6f99266b9720b48ec10f220f8a321d3ed052300960151feb6c45d39b586216745f070241db20afd4d16ac0b3389b634eb31f90c93ea9d12f521012cfe5ab9257 WHIRLPOOL 0c7140b636e7cca8ac0d150cb015170964471a3e00d48f3b7290976c768415773d5741f53937b2773b751a8e830d21e156c3f199de081dd42c50ffd76688e640
diff --git a/sys-apps/cpuid/cpuid-20130610.ebuild b/sys-apps/cpuid/cpuid-20130610.ebuild
new file mode 100644
index 000000000000..909176edf893
--- /dev/null
+++ b/sys-apps/cpuid/cpuid-20130610.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 toolchain-funcs
+
+DESCRIPTION="Utility to get detailed information about the CPU(s) using the
+CPUID instruction"
+HOMEPAGE="http://www.etallen.com/cpuid.html"
+SRC_URI="http://www.etallen.com/${PN}/${P}.src.tar.gz"
+
+KEYWORDS="amd64 x86"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20110305-Makefile.patch
+ epatch "${FILESDIR}"/${PN}-20110305-fPIC.patch #376245
+}
+
+src_compile() {
+ tc-export CC
+ emake
+}
+
+src_install() {
+ emake BUILDROOT="${D}" install
+}
diff --git a/sys-apps/cpuid/cpuid-20140123.ebuild b/sys-apps/cpuid/cpuid-20140123.ebuild
new file mode 100644
index 000000000000..ce80f5c51d41
--- /dev/null
+++ b/sys-apps/cpuid/cpuid-20140123.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 toolchain-funcs
+
+DESCRIPTION="Utility to get detailed information about the CPU(s) using the
+CPUID instruction"
+HOMEPAGE="http://www.etallen.com/cpuid.html"
+SRC_URI="http://www.etallen.com/${PN}/${P}.src.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20110305-Makefile.patch
+ epatch "${FILESDIR}"/${PN}-20110305-fPIC.patch #376245
+}
+
+src_compile() {
+ tc-export CC
+ emake
+}
+
+src_install() {
+ emake BUILDROOT="${D}" install
+}
diff --git a/sys-apps/cpuid/cpuid-20150606.ebuild b/sys-apps/cpuid/cpuid-20150606.ebuild
new file mode 100644
index 000000000000..77863be1a235
--- /dev/null
+++ b/sys-apps/cpuid/cpuid-20150606.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="Utility to get detailed information about the CPU(s) using the
+CPUID instruction"
+HOMEPAGE="http://www.etallen.com/cpuid.html"
+SRC_URI="http://www.etallen.com/${PN}/${P}.src.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20150606-Makefile.patch
+ epatch "${FILESDIR}"/${PN}-20110305-fPIC.patch #376245
+}
+
+src_compile() {
+ tc-export CC
+ emake
+}
+
+src_install() {
+ emake BUILDROOT="${D}" install
+}
diff --git a/sys-apps/cpuid/files/cpuid-20110305-Makefile.patch b/sys-apps/cpuid/files/cpuid-20110305-Makefile.patch
new file mode 100644
index 000000000000..a3aab8a50f66
--- /dev/null
+++ b/sys-apps/cpuid/files/cpuid-20110305-Makefile.patch
@@ -0,0 +1,30 @@
+Index: cpuid-20110305/Makefile
+===================================================================
+--- cpuid-20110305.orig/Makefile
++++ cpuid-20110305/Makefile
+@@ -1,7 +1,3 @@
+-CFLAGS=-g
+-ifneq (,$(findstring arch=i386,$(CFLAGS)))
+-CISA=-m32
+-endif
+ CFL=$(CFLAGS) $(CISA) -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -D_FILE_OFFSET_BITS=64 -DVERSION=$(VERSION)
+
+ PACKAGE=cpuid
+@@ -36,14 +32,14 @@ BUILDROOT=
+ default: $(PROG) $(PROG).man.gz
+
+ $(PROG): cpuid.c Makefile
+- $(CC) $(CFL) -o $@ cpuid.c
++ $(CC) $(CFL) $(LDFLAGS) -o $@ cpuid.c
+
+ $(PROG).man.gz: $(PROG).man
+ gzip < $< > $@
+
+ install: $(PROG) $(PROG).man.gz
+- install -D -s -m 755 $(PROG) $(BUILDROOT)/usr/bin/$(PROG)
+- install -D -m 444 $(PROG).man.gz $(BUILDROOT)/usr/share/man/man1/$(PROG).1.gz
++ install -D -m 755 $(PROG) $(BUILDROOT)/usr/bin/$(PROG)
++ install -D -m 444 $(PROG).man.gz $(BUILDROOT)/usr/share/man/man1/$(PROG).1.gz
+
+ clean:
+ rm -f $(PROG) $(PROG).i386 $(PROG).x86_64
diff --git a/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch b/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch
new file mode 100644
index 000000000000..80cc6774a188
--- /dev/null
+++ b/sys-apps/cpuid/files/cpuid-20110305-fPIC.patch
@@ -0,0 +1,24 @@
+diff -u cpuid-20110305.orig//cpuid.c cpuid-20110305/cpuid.c
+--- cpuid-20110305.orig//cpuid.c 2011-03-04 13:25:16.000000000 -0500
++++ cpuid-20110305/cpuid.c 2011-07-31 01:53:39.647437813 -0400
+@@ -5319,9 +5319,20 @@
+ boolean quiet)
+ {
+ if (cpuid_fd == USE_INSTRUCTION) {
++#if defined(__i386__) && defined(__PIC__)
++ asm("push %%ebx\n"
++ "cpuid\n"
++ "movl %%ebx, %1\n"
++ "pop %%ebx\n"
++#else
+ asm("cpuid"
++#endif
+ : "=a" (words[WORD_EAX]),
++#if defined(__i386__) && defined(__PIC__)
++ "=r" (words[WORD_EBX]),
++#else
+ "=b" (words[WORD_EBX]),
++#endif
+ "=c" (words[WORD_ECX]),
+ "=d" (words[WORD_EDX])
+ : "a" (reg),
diff --git a/sys-apps/cpuid/files/cpuid-20150606-Makefile.patch b/sys-apps/cpuid/files/cpuid-20150606-Makefile.patch
new file mode 100644
index 000000000000..f878977ece91
--- /dev/null
+++ b/sys-apps/cpuid/files/cpuid-20150606-Makefile.patch
@@ -0,0 +1,21 @@
+--- cpuid-20150606/Makefile
++++ cpuid-20150606/Makefile
+@@ -1,9 +1,3 @@
+-CFLAGS+=-g
+-CPPFLAGS?=
+-LDFLAGS?=
+-ifneq (,$(findstring arch=i386,$(CFLAGS)))
+-CISA=-m32
+-endif
+ CFL=$(CPPFLAGS) $(CFLAGS) $(CISA) -Wall -Wshadow -Wcast-align -Wredundant-decls -Wbad-function-cast -Wcast-qual -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -D_FILE_OFFSET_BITS=64 -DVERSION=$(VERSION)
+
+ PACKAGE=cpuid
+@@ -44,7 +38,7 @@
+ gzip < $< > $@
+
+ install: $(PROG) $(PROG).man.gz
+- install -D -s -m 755 $(PROG) $(BUILDROOT)/usr/bin/$(PROG)
++ install -D -m 755 $(PROG) $(BUILDROOT)/usr/bin/$(PROG)
+ install -D -m 444 $(PROG).man.gz $(BUILDROOT)/usr/share/man/man1/$(PROG).1.gz
+
+ clean:
diff --git a/sys-apps/cpuid/metadata.xml b/sys-apps/cpuid/metadata.xml
new file mode 100644
index 000000000000..1508c97d6f8e
--- /dev/null
+++ b/sys-apps/cpuid/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>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <maintainer>
+ <email>rhill@gentoo.org</email>
+ <name>Ryan Hill</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/cracklib-words/Manifest b/sys-apps/cracklib-words/Manifest
new file mode 100644
index 000000000000..6f7e6c52b7eb
--- /dev/null
+++ b/sys-apps/cracklib-words/Manifest
@@ -0,0 +1 @@
+DIST cracklib-words-20080507.gz 4515718 SHA256 e0c7f452c1fd80d551ae4a7d1afa7fa19cbf47c2d6d5dafc1255c1e76502cb71
diff --git a/sys-apps/cracklib-words/cracklib-words-20080507.ebuild b/sys-apps/cracklib-words/cracklib-words-20080507.ebuild
new file mode 100644
index 000000000000..d66f994973db
--- /dev/null
+++ b/sys-apps/cracklib-words/cracklib-words-20080507.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="large set of crack/cracklib dictionaries"
+HOMEPAGE="http://sourceforge.net/projects/cracklib"
+SRC_URI="mirror://sourceforge/cracklib/${P}.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}
+
+src_install() {
+ insinto /usr/share/dict
+ newins ${P} ${PN} || die
+}
+
+pkg_postinst() {
+ if [ "${ROOT}" = "/" ] && type create-cracklib-dict >/dev/null ; then
+ ebegin "Regenerating cracklib dictionary"
+ create-cracklib-dict /usr/share/dict/* > /dev/null
+ eend $?
+ fi
+}
diff --git a/sys-apps/cracklib-words/metadata.xml b/sys-apps/cracklib-words/metadata.xml
new file mode 100644
index 000000000000..42090b9cf925
--- /dev/null
+++ b/sys-apps/cracklib-words/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">cracklib</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/cv/Manifest b/sys-apps/cv/Manifest
new file mode 100644
index 000000000000..eafe0747c5b6
--- /dev/null
+++ b/sys-apps/cv/Manifest
@@ -0,0 +1 @@
+DIST cv-0.4.1.tar.gz 53682 SHA256 e7537b363662060a55e1a59b78a124e76b54c3b64f0bd62c35fd3cb34c725aa9 SHA512 eb64cc44a834805209f93d23f61b270d670f1f2e535a3dbed84bdb9cbb27cec9e077abb1138c8557436baa021d2d7661132c56eae04a36f0a83b3e7a116de7d4 WHIRLPOOL c496d21287b90101720d11ca5b816878e9578f646cf846d0fd3c641d27edf2afb885a6c068850fd10ce629b856afbd15d7703da433f53c74042bc20c3e7a0e4b
diff --git a/sys-apps/cv/cv-0.4.1.ebuild b/sys-apps/cv/cv-0.4.1.ebuild
new file mode 100644
index 000000000000..fa9e8f208ef1
--- /dev/null
+++ b/sys-apps/cv/cv-0.4.1.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 toolchain-funcs
+
+DESCRIPTION="Coreutils Viewer: show progress for cp, rm, dd, and so forth"
+HOMEPAGE="https://github.com/Xfennec/cv"
+SRC_URI="${HOMEPAGE}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+
+RDEPEND="sys-libs/ncurses"
+DEPEND="
+ ${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ sed -i \
+ -e '/LFLAGS/s:-lncurses:$(LDFLAGS) $(shell $(PKG_CONFIG) --libs ncurses):' \
+ -e 's:CFLAGS=-g:CFLAGS+=:' \
+ -e 's:gcc:$(CC):g' \
+ Makefile || die
+ tc-export CC PKG_CONFIG
+}
+
+src_install() {
+ emake PREFIX="${D}/${EPREFIX}/usr" install
+ dodoc README.md
+}
diff --git a/sys-apps/cv/metadata.xml b/sys-apps/cv/metadata.xml
new file mode 100644
index 000000000000..a0e90f5de621
--- /dev/null
+++ b/sys-apps/cv/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>zx2c4@gentoo.org</email>
+ <name>Jason A. Donenfeld</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">Xfennec/cv</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/daemonize/Manifest b/sys-apps/daemonize/Manifest
new file mode 100644
index 000000000000..34e23dce6e74
--- /dev/null
+++ b/sys-apps/daemonize/Manifest
@@ -0,0 +1,3 @@
+DIST daemonize-1.7.4.tar.gz 66005 SHA256 e80bb9299b76b6d7b3bc235b2413961e138e586d777385dcf6cf478cea135525 SHA512 aa5dd1d89650fc4a7e783163852de176877b0e999c4d16950a03a81c0db1477e2994fe8d97d8e2bd61baafb7810522754eade96f3ff0301c1e6ce74f9252d34e WHIRLPOOL 8a72762ec08db2f47686bd8bb2063b986f8379e888571eafdaefe8b2e3e41df979474faa4ebc0f8701f85f2fa73ab805c3b61f88537c71673b52f731436cb3c3
+DIST daemonize-1.7.5.tar.gz 65817 SHA256 11f45bca9a7dd0a72a0059429eaf4f76913659f4c197479f7cdc81d110e7a798 SHA512 8e1c7cf47a2026d13505c83c5987ea7237226e104dd5fdd4d57d006000846b387216b2506604f60c6178a7445493591254696dddbb334d89ee611954a65659ea WHIRLPOOL d0c7e239e962bb7c95e47e76ac183de7d87fd667d2b274e5863592377d7480a3571fd2383a5c70eef3cc349900ec5ee02eea684b3235f5e533f0ad74e98ce3d4
+DIST daemonize-1.7.6.tar.gz 65927 SHA256 b7e86ebb51eeeb9dc3ebd93ae805914801e6a2247e53e7201567eb84e3475c68 SHA512 e0276c504727004edf02f97d3295daca6c9990ae7130c536d388a967ee8711625308eb8ffdd989b6e3e25915038095f4a53b4cf051a6f2a2a397369ea99ab14c WHIRLPOOL 087dcfd90b6e344e94d294dda26c5b9179009aea37074c0b849e062d2646f18c11799f5704000a5715c0835d149ca84376b7746b60d15b523b1cf7a4b77a8634
diff --git a/sys-apps/daemonize/daemonize-1.7.4.ebuild b/sys-apps/daemonize/daemonize-1.7.4.ebuild
new file mode 100644
index 000000000000..f4968a9cb19d
--- /dev/null
+++ b/sys-apps/daemonize/daemonize-1.7.4.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Runs a command as a Unix daemon"
+HOMEPAGE="http://bmc.github.com/daemonize/"
+SRC_URI="http://github.com/bmc/${PN}/tarball/release-${PV} -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DOCS=( README.md CHANGELOG.md )
+
+src_unpack() {
+ unpack ${A}
+ # Workaround commit suffix from github.
+ mv "${WORKDIR}"/bmc-${PN}-* "${S}" || die
+}
+
+src_prepare() {
+ sed -i \
+ -e 's:\($(CC)\) $(CFLAGS) \(.*\.o\):\1 $(LDFLAGS) \2:' \
+ Makefile.in || die
+}
diff --git a/sys-apps/daemonize/daemonize-1.7.5.ebuild b/sys-apps/daemonize/daemonize-1.7.5.ebuild
new file mode 100644
index 000000000000..e480f66980e5
--- /dev/null
+++ b/sys-apps/daemonize/daemonize-1.7.5.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Runs a command as a Unix daemon"
+HOMEPAGE="http://bmc.github.com/daemonize/"
+SRC_URI="http://github.com/bmc/${PN}/tarball/release-${PV} -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DOCS=( README.md CHANGELOG.md )
+
+src_unpack() {
+ unpack ${A}
+ # Workaround commit suffix from github.
+ mv "${WORKDIR}"/bmc-${PN}-* "${S}" || die
+}
+
+src_prepare() {
+ sed -i \
+ -e 's:\($(CC)\) $(CFLAGS) \(.*\.o\):\1 $(LDFLAGS) \2:' \
+ Makefile.in || die
+}
diff --git a/sys-apps/daemonize/daemonize-1.7.6.ebuild b/sys-apps/daemonize/daemonize-1.7.6.ebuild
new file mode 100644
index 000000000000..0630daa5ae3c
--- /dev/null
+++ b/sys-apps/daemonize/daemonize-1.7.6.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="Runs a command as a Unix daemon"
+HOMEPAGE="http://bmc.github.com/daemonize/"
+SRC_URI="http://github.com/bmc/${PN}/tarball/release-${PV} -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DOCS=( README.md CHANGELOG.md )
+
+src_unpack() {
+ unpack ${A}
+ # Workaround commit suffix from github.
+ mv "${WORKDIR}"/bmc-${PN}-* "${S}" || die
+}
+
+src_prepare() {
+ sed -i \
+ -e 's:\($(CC)\) $(CFLAGS) \(.*\.o\):\1 $(LDFLAGS) \2:' \
+ Makefile.in || die
+}
diff --git a/sys-apps/daemonize/metadata.xml b/sys-apps/daemonize/metadata.xml
new file mode 100644
index 000000000000..e0f542b458ae
--- /dev/null
+++ b/sys-apps/daemonize/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="github">bmc/daemonize</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/darwin-miscutils/Manifest b/sys-apps/darwin-miscutils/Manifest
new file mode 100644
index 000000000000..8eb1ccda532b
--- /dev/null
+++ b/sys-apps/darwin-miscutils/Manifest
@@ -0,0 +1,17 @@
+DIST adv_cmds-md-147.1 3623 SHA256 6283a00e52ef6d278afb1fa4d0e8bc7bce8bebff3e6b3da71812fcfdb415592f SHA512 459beb2b7c92b8718c76d744bbabf631bf8c329feb65c9434ce8a023c73ceac2d207c95e39c4b90b095a4724a74096a3d1bed9122883eb54e5311dfc64ffc718 WHIRLPOOL 79ebe5d5a73443665ba8804ff8867f1ad045d8b5df104b1396f00ca8ba4819d1e82ae5b31dffbf26d648748f8bccf5e01be5aba553d7955bbde13cc04be6104b
+DIST adv_cmds-md-147.c 25945 SHA256 089a4ad849da2c1a2b23fbc18dbc6860b26a367f528972d99ea361245a06c882 SHA512 93e70f7d8697652b5a3c661975d21b51545d2eb07de64fd40524fcf0d5016dae9ae1dc63c4a85cb5ad455c8d1c246b7f5f2eac38226dcefbf4cab12b0b1c7592 WHIRLPOOL 4299250fe3d0b475798d139fffcb83e17ab88283099a4d6d0669ee86e58b861b3a5409535aa9310d6729f086334a7a0d703df5b5d81b8816933fb67b6152df89
+DIST developer_cmds-39.tar.gz 155831 SHA256 37d58d783c44694bf869ef8906ea866a7d1798154f3206a1880b8adc154d6d81 SHA512 1c9fcd7933d7264e8f3f537fc7bd9545121b15e2784f23d1bf6c1419adb3a77c175170cab62a44286897aadd3d44ecd799c69424de058c1b3b13b01b5caba44c WHIRLPOOL 954b2f3d4ec3bb792947d398e1c948abaa7a0dca82fd56f08b65b57d7f17c2117597417740a81b443428a3808d55f9b3a77c20cea692ed093bbb5b81e6f7ecc1
+DIST developer_cmds-48.tar.gz 161783 SHA256 212b1102580452576dcaa38c053aa1809ede046ce5712a4c268d964be71a287d SHA512 1c6f6cd918aa895f71a44be5b456b93420054d36c0968ac4333f1947d6ca9679358394d7475df666d919cbd3da841af91b42cdda5815ec4ec1acc019a294a4d5 WHIRLPOOL 3b42a6b22c788cdbad0ef91955fdde1b33cce29950d4154e47d86460e37d1c323d8b14650966d14020541fd025db3ed0cd81b1bbc158f27b00dadf2ac03aef68
+DIST developer_cmds-49.tar.gz 307753 SHA256 db0f2611c8efb0ec781cb8f03878958c589c8953ba9002e051afa4fc3bb6a762 SHA512 3750374c891f6d681829986291d887cacf2c5b1c7a5de94f12c92ded0b3456157b85e57653c6061526d1f6626a7be8a9e6db9c1df09e2bb3e40c7fa20b9b4103 WHIRLPOOL f167e2a95ab2f8325130fe3f418771d9aee09e268e9649bf6230601586ec41d940c52fb4a02b938a30d5059541eccf20845044ef07bef64afdbd5635c15e2073
+DIST developer_cmds-52.1.tar.gz 310160 SHA256 3deb187d7ee6269680f2f9678aa1e7bab3f3911a59b44e99870abb687ccba095 SHA512 280c15f9a48ae650bd8df63792920e557c192bab61e0f314b24f8baa5c0e1feecead8274aa28e0f358b8a99708bcaef8115b4b2439a50e009f6547d23613007a WHIRLPOOL 0c76d6809da42d3ff55d3c1111a0b4de4d1d302a79fd1f70bd77c4f89448b78aab321e686d9aa3203c6170d80bf9af96bfb3f6c7d598807b51d157e12ce8469b
+DIST developer_cmds-53.1.tar.gz 139637 SHA256 f3f6cc44336fae506a5c7ca1e71aeaa00da89b4337298fcd4d13953bbfa6edb8 SHA512 ac15b499d0642332e8deae2f498e5ffb0c64502e2d877bbdfe0fac4118e17fe525b169f3b015cfe8c9f40e2688bd30df4b050fe50eaa706b21a2e62ca9dd4b80 WHIRLPOOL ee747b3f8c56091f77735c2a59e0ef3d9486b5af32c44c2ed382324bf71e7f29f7ac9c8426247f7fdfa63a667acca99f6af1fcc29548fdd73b51706ba41e923e
+DIST developer_cmds-55.tar.gz 139664 SHA256 1760a430552057304ecc2c20bb0acd3683a3a0325f29a1e27065818d2515e91a SHA512 062e4c4a2b1ba4cffe7e850d07f4351c736988958450735f9f653936d64defa3347c9dac7b5fea3dcd25f8efe076133dc9ac3edb4a3e512387d6842bd177c35e WHIRLPOOL cae216847b8e6075fa8051d6d260cc91fff259f81717d19a988ada30e42c8b9728b6ce3330cbcef403639fbf5c52230d20a2272bc1154f3bcf18e3c3f4123ac7
+DIST misc_cmds-18.tar.gz 96635 SHA256 dcc4b199cdb4d40cabd1dd58cc3498878751d9746ad736ada0177a86236d187e SHA512 2f0a7b298179e44a67125a271d9ba62b618d9bd852320fa3f1d1fa724787554d3a1e6cc08845caa2f70214fdf90cc7afdbe08fae648fe94cf8a0fe24ca673f6c WHIRLPOOL 1fc15f192f51f79c0d83234185a7193a3b93d6a09cf65b69cdfc3b3c6aecb54b045886d86bb6ca76c1bb763c46a34d46f0ae1884fba587a00fac92ef0b93711c
+DIST misc_cmds-23.tar.gz 114747 SHA256 150c74e3041db4cb02b1aabddfedb998c152bfba616ed6e24b2b98d025fef785 SHA512 0e02a939c308f4483cf11cb8b21face84f442589e3774b1827ed0ab5064ee2b433a4468ac634051fa0817919f5d39ac1ed56c67b1f5b011b83388a3806ed33c8 WHIRLPOOL 586a091fc6ead5c5398a05e3af1137cf67314e458cb44dc0f60a2099e65f53e4b569dd045c17e0f455f1cc0b4248c94b358cb5b08cf54033dc883f356a058d49
+DIST misc_cmds-27.tar.gz 116351 SHA256 29d1b32dfceaa3364e81d50e10b8ce7721448cb0c8218ecb90491666a00efca4 SHA512 594560b179f7dafc651d3a336d33bcb7075f2199cf4964e95d63164faf19bd50ef3a6095124f0e4f91c50d1bceeb831fcd81ceecf740e2696a8e7445c1a690d2 WHIRLPOOL 6bca894b7ab1c7de9b3453e075060ec4bd35019713641c9527dd562f253eda0cc35f3b9b631bd197c3fc38ffda575701843671e3fae263fa4655455e80e73cd2
+DIST misc_cmds-31.tar.gz 121187 SHA256 1e0cdf2af9b28245af40168fc48e010e260b62fd48ddbcb95e62851d2765f37c SHA512 d49bb8a49c23aa7efaa7db1958676390b4d5ef1b2e57f80b0bea0f10b8b29a6c3ec6d2d7a1248d3af77d382c5113fb3cbf9d3632ca92bb51c01d8c286fd9f25f WHIRLPOOL 1b3d060418ccf353d975696cd7d19354ca2b0b8795f91e185cc467fc2e9fa7683a20e6ce6e70109310e8cfff69b027efbf6e25c159e41102d62bffc36b2754d5
+DIST shell_cmds-118.tar.gz 162145 SHA256 c4628a25407d940717f3e062e48e31bf3de2ce07e006bf909d69f927af92adb4 SHA512 efce064b76087451293a6992b7946fb0811856275796efa9e1e30459edf9eb0462929a1f0d28d189bf7e85fdde4d9e80b8637d042497b1e6e9216c8888d0d57b WHIRLPOOL a1d66933d390a305ea0351e2279cb7c2e7c0d3460fd0e66c642caffa730a7becb51cdc1552f7d024df657c14b53a72426373508259fd57a8f30f3f31d4c18df6
+DIST shell_cmds-149.tar.gz 173740 SHA256 87263d7fc8626da3e12f8ebae458293da7c4b12a0ce591dcf93b638e6519ff43 SHA512 e0f87db828c994bad73e4340f1957378ce5c84419172ed1d6b9d63809b90edfa447cce658e715565c5c2a7d2eaf0a9ee75e24fdb6d86080063621e0f83eb2a77 WHIRLPOOL 191e6852f34efe0390348aca7d2276042c68e04f20e2ccf2eb71e230e0d552ffddbb3a49b34b031d0b41aa941bcd0283305c75dc0bab1dc05a3266437f0a5103
+DIST shell_cmds-162.tar.gz 179189 SHA256 42d5ad4fbcaca83620a3ab709a41b21a18224589c844c716223489418e04e3d6 SHA512 784b6b8b3a90967d79f5a60a23e7f31f7bc92712dac9cdb625770f92b58bd6902669aa19bb59997cc654fcc0e27ddd45f60b1990e7da95d0e6c90fd7f2434f95 WHIRLPOOL cd06c734a1f1ba1169ed72ec99f8072dd0e7b608ad0764857873622c6ea0d9a99fdabd6b2ef2fc87f036dbe34e2caebfd5c6927e2440cb35375ea9c77e40c44e
+DIST shell_cmds-170.tar.gz 212954 SHA256 3f2849de051ae51e7b6cec56d90443f9168a9f9a7b9002cb4b51ece9a817b81c SHA512 b267a9b5e922c9952451ca05e5f9e328504dc46b5776e1a8405f8e41a604d7f184d70742cb6fa6646875bc1789082097c74eabcc151ac5568ba26ed858269ce7 WHIRLPOOL c036eba542fdf07843cd9ef9e781db379c90e95264918596c71f99cff2547ac877e5c3619b53d25e65e0c67a0fb42a3d32755efc6d9f4235b7d714e90047d8b5
+DIST shell_cmds-81.tar.gz 154516 SHA256 64f0e01de9e13b9a1518ccd2cf45486b6159a5fdc562e7d0725e835d495cea81 SHA512 ebb506331a283771d4b4f51769fece93af7703a2a0e118271bd453327db6981d197aebd93e675d019c05c6cff58ed0a0fe58e8fc26eb581ab26cb76c3271d505 WHIRLPOOL 81b668528344155ae4537894de241ff72e19e6a6f50201533a7d8e84a54684b933aa4b0492b11bb62ad78e8bced6bd652acbe029cb17fdd1423edd70ddd6ddc6
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-10.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-10.ebuild
new file mode 100644
index 000000000000..8438cd004f06
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-10.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs eutils
+
+# from 10.8
+MISC_VER=31
+SHELL_VER=170
+# from 10.7.4
+DEV_VER=55
+MD_VER=147 # 148 in 10.8 has no md, bug #428530
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Mountain
+Lion 10.8"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz
+ http://www.opensource.apple.com/source/adv_cmds/adv_cmds-${MD_VER}/md/md.c?txt -> adv_cmds-md-${MD_VER}.c
+ http://www.opensource.apple.com/source/adv_cmds/adv_cmds-${MD_VER}/md/md.1?txt -> adv_cmds-md-${MD_VER}.1"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/shell_cmds-${SHELL_VER} || die
+ epatch "${FILESDIR}"/${PN}-6-w64.patch
+
+ mkdir -p "${S}"/adv_cmds-${MD_VER}/md || die
+ cp "${DISTDIR}"/adv_cmds-md-${MD_VER}.c \
+ "${S}"/adv_cmds-${MD_VER}/md/md.c || die
+ cp "${DISTDIR}"/adv_cmds-md-${MD_VER}.1 \
+ "${S}"/adv_cmds-${MD_VER}/md/md.1 || die
+}
+
+src_compile() {
+ local flags=(
+ ${CFLAGS}
+ -I.
+ -D__FBSDID=__RCSID
+ -Wsystem-headers
+ -Du_int=uint32_t
+ -include stdint.h
+ ${LDFLAGS}
+ )
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in leave units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+ # compile cal separately
+ cd "${TS}/ncal"
+ echo "in ${TS}/ncal:"
+ echo "$(tc-getCC) ${flags[@]} -c calendar.c"
+ $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c easter.c"
+ $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c ncal.c"
+ $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
+ $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ apply getopt hostname jot kill killall \
+ lastcomm renice script shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/w"
+ sed -i -e '/#include <libutil.h>/d' w.c || die
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Snow Leopard version)
+ for t in asa hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}" || die
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+
+ TS=${S}/adv_cmds-${MD_VER}
+ for t in md ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}" || die
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in leave units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+ # copy cal separately
+ cp "${TS}/ncal/cal" "${ED}"/usr/bin/
+ dosym /usr/bin/cal /usr/bin/ncal
+ doman "${TS}/ncal/ncal.1"
+ dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ apply getopt jot killall lastcomm \
+ renice script shlock time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/adv_cmds-${MD_VER}
+ for t in md ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-4-r1.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-4-r1.ebuild
new file mode 100644
index 000000000000..a3f3d356e778
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-4-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs
+
+MISC_VER=18
+SHELL_VER=81
+DEV_VER=39
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Tiger"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_compile() {
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in cal leave lock units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t}" *.c
+ $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
+ done
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ alias apply getopt hostname jot kill killall \
+ lastcomm renice script shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/su"
+ echo "in ${TS}/su:"
+ echo "$(tc-getCC) -lpam -o su su.c"
+ $(tc-getCC) -lpam -o su su.c || die "failed to compile su"
+ cd "${TS}/w"
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) -DSUCKAGE -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) -DSUCKAGE -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Tiger version)
+ for t in asa error hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t}" *.c
+ cd "${TS}/${t}"
+ sed -i -e '/^__FBSDID/d' *.c
+ $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in cal leave lock units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ alias apply getopt jot killall lastcomm \
+ renice script shlock su time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa error hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-5-r1.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-5-r1.ebuild
new file mode 100644
index 000000000000..3a200e7d8250
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-5-r1.ebuild
@@ -0,0 +1,141 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs eutils
+
+MISC_VER=23
+SHELL_VER=118
+DEV_VER=48
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Leopard"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-w.patch
+ epatch "${FILESDIR}"/${P}-error.patch
+ epatch "${FILESDIR}"/${P}-stdlib.patch
+}
+
+src_compile() {
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in leave units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t}" *.c
+ $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
+ done
+ # compile cal separately
+ cd "${TS}/ncal"
+ echo "in ${TS}/ncal:"
+ local flags
+ flags[0]=-I.
+ flags[1]=-D__FBSDID=__RCSID
+ flags[2]=-Wsystem-headers
+ echo "$(tc-getCC) ${flags[@]} -c calendar.c"
+ $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c easter.c"
+ $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c ncal.c"
+ $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
+ $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ alias apply getopt hostname jot kill \
+ lastcomm renice shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ # script and killall need additonal flags
+ for t in \
+ killall script
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/su"
+ echo "in ${TS}/su:"
+ echo "$(tc-getCC) -lpam -o su su.c"
+ $(tc-getCC) -lpam -o su su.c || die "failed to compile su"
+ cd "${TS}/w"
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Leopard version)
+ for t in asa error hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}"
+ sed -i -e '/^__FBSDID/d' *.c
+ echo "$(tc-getCC) -o ${t}" *.c
+ $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in leave units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+ # copy cal separately
+ cp "${TS}/ncal/cal" "${ED}"/usr/bin/
+ dosym /usr/bin/cal /usr/bin/ncal
+ doman "${TS}/ncal/ncal.1"
+ dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ alias apply getopt jot killall lastcomm \
+ renice script shlock su time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa error hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild
new file mode 100644
index 000000000000..83e7ddcfac58
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs eutils
+
+MISC_VER=23
+SHELL_VER=118
+DEV_VER=49
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Leopard"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-5-w.patch
+ epatch "${FILESDIR}"/${PN}-5-stdlib.patch
+ epatch "${FILESDIR}"/${PN}-6-w64.patch
+ cd "${S}"/developer_cmds-${DEV_VER}
+ epatch "${FILESDIR}"/${PN}-5-error.patch
+}
+
+src_compile() {
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in leave units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t}" *.c
+ $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
+ done
+ # compile cal separately
+ cd "${TS}/ncal"
+ echo "in ${TS}/ncal:"
+ local flags
+ flags[0]=-I.
+ flags[1]=-D__FBSDID=__RCSID
+ flags[2]=-Wsystem-headers
+ echo "$(tc-getCC) ${flags[@]} -c calendar.c"
+ $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c easter.c"
+ $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c ncal.c"
+ $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
+ $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ alias apply getopt hostname jot kill \
+ lastcomm renice shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ # script and killall need additonal flags
+ for t in \
+ killall script
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/su"
+ echo "in ${TS}/su:"
+ echo "$(tc-getCC) -lpam -o su su.c"
+ $(tc-getCC) -lpam -o su su.c || die "failed to compile su"
+ cd "${TS}/w"
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Leopard version)
+ for t in asa error hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}"
+ sed -i -e '/^__FBSDID/d' *.c
+ echo "$(tc-getCC) -o ${t}" *.c
+ $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in leave units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+ # copy cal separately
+ cp "${TS}/ncal/cal" "${ED}"/usr/bin/
+ dosym /usr/bin/cal /usr/bin/ncal
+ doman "${TS}/ncal/ncal.1"
+ dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ alias apply getopt jot killall lastcomm \
+ renice script shlock su time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa error hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild
new file mode 100644
index 000000000000..90c34c5df906
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-7.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs eutils
+
+MISC_VER=27
+SHELL_VER=149
+DEV_VER=52.1
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Snow Leopard"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/shell_cmds-${SHELL_VER}
+ epatch "${FILESDIR}"/${PN}-6-w64.patch
+}
+
+src_compile() {
+ local flags=(
+ ${CFLAGS}
+ -I.
+ -D__FBSDID=__RCSID
+ -Wsystem-headers
+ -Du_int=uint32_t
+ -include stdint.h
+ ${LDFLAGS}
+ )
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in leave units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+ # compile cal separately
+ cd "${TS}/ncal"
+ echo "in ${TS}/ncal:"
+ echo "$(tc-getCC) ${flags[@]} -c calendar.c"
+ $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c easter.c"
+ $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c ncal.c"
+ $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
+ $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ alias apply getopt hostname jot kill \
+ lastcomm renice shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ # script and killall need additonal flags
+ for t in \
+ killall script
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/w"
+ sed -i -e '/#include <libutil.h>/d' w.c || die
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Leopard version)
+ for t in asa error hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}"
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in leave units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+ # copy cal separately
+ cp "${TS}/ncal/cal" "${ED}"/usr/bin/
+ dosym /usr/bin/cal /usr/bin/ncal
+ doman "${TS}/ncal/ncal.1"
+ dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ alias apply getopt jot killall lastcomm \
+ renice script shlock time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa error hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-8.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-8.ebuild
new file mode 100644
index 000000000000..2d0ac4fd0d00
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-8.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs eutils
+
+MISC_VER=27
+SHELL_VER=149
+DEV_VER=53.1
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Snow Leopard 10.6.3"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/shell_cmds-${SHELL_VER}
+ epatch "${FILESDIR}"/${PN}-6-w64.patch
+ # deal with OSX Lion
+ cd "${S}"/developer_cmds-${DEV_VER}
+ sed -i -e 's/getline/ugetline/g' unifdef/unifdef.c || die
+}
+
+src_compile() {
+ local flags=(
+ ${CFLAGS}
+ -I.
+ -D__FBSDID=__RCSID
+ -Wsystem-headers
+ -Du_int=uint32_t
+ -include stdint.h
+ ${LDFLAGS}
+ )
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in leave units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+ # compile cal separately
+ cd "${TS}/ncal"
+ echo "in ${TS}/ncal:"
+ echo "$(tc-getCC) ${flags[@]} -c calendar.c"
+ $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c easter.c"
+ $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c ncal.c"
+ $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
+ $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ alias apply getopt hostname jot kill killall \
+ lastcomm renice script shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/w"
+ sed -i -e '/#include <libutil.h>/d' w.c || die
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Snow Leopard version)
+ for t in asa hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}" || die
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in leave units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+ # copy cal separately
+ cp "${TS}/ncal/cal" "${ED}"/usr/bin/
+ dosym /usr/bin/cal /usr/bin/ncal
+ doman "${TS}/ncal/ncal.1"
+ dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ alias apply getopt jot killall lastcomm \
+ renice script shlock time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/darwin-miscutils-9.ebuild b/sys-apps/darwin-miscutils/darwin-miscutils-9.ebuild
new file mode 100644
index 000000000000..b641f648e384
--- /dev/null
+++ b/sys-apps/darwin-miscutils/darwin-miscutils-9.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit toolchain-funcs eutils
+
+MISC_VER=31
+SHELL_VER=162
+DEV_VER=55
+
+DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Lion 10.7"
+HOMEPAGE="http://www.opensource.apple.com/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ cd "${S}"/shell_cmds-${SHELL_VER}
+ epatch "${FILESDIR}"/${PN}-6-w64.patch
+}
+
+src_compile() {
+ local flags=(
+ ${CFLAGS}
+ -I.
+ -D__FBSDID=__RCSID
+ -Wsystem-headers
+ -Du_int=uint32_t
+ -include stdint.h
+ ${LDFLAGS}
+ )
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ # tsort is provided by coreutils
+ for t in leave units calendar; do
+ cd "${TS}/${t}"
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+ # compile cal separately
+ cd "${TS}/ncal"
+ echo "in ${TS}/ncal:"
+ echo "$(tc-getCC) ${flags[@]} -c calendar.c"
+ $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c easter.c"
+ $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -c ncal.c"
+ $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
+ echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
+ $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ # only pick those tools not provided by coreutils, findutils
+ for t in \
+ alias apply getopt hostname jot kill killall \
+ lastcomm renice script shlock time whereis;
+ do
+ echo "in ${TS}/${t}:"
+ echo "$(tc-getCC) ${flags[@]} -o ${t} ${t}.c"
+ cd "${TS}/${t}"
+ $(tc-getCC) ${flags[@]} -o ${t} ${t}.c || die "failed to compile $t"
+ done
+ cd "${TS}/w"
+ sed -i -e '/#include <libutil.h>/d' w.c || die
+ echo "in ${TS}/w:"
+ echo "$(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
+ $(tc-getCC) ${flags[@]} -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
+ || die "failed to compile w"
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ # only pick those tools that do not conflict (no ctags and indent)
+ # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
+ # shell scripts
+ # don't install rpcgen, as it is heavily related to the OS it runs
+ # on (and this is the Snow Leopard version)
+ for t in asa hexdump unifdef what ; do
+ echo "in ${TS}/${t}:"
+ cd "${TS}/${t}" || die
+ echo "$(tc-getCC) ${flags[@]} -o ${t}" *.c
+ $(tc-getCC) ${flags[@]} -o ${t} *.c || die "failed to compile $t"
+ done
+}
+
+src_install() {
+ mkdir -p "${ED}"/bin
+ mkdir -p "${ED}"/usr/bin
+
+ local TS=${S}/misc_cmds-${MISC_VER}
+ for t in leave units calendar ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+ # copy cal separately
+ cp "${TS}/ncal/cal" "${ED}"/usr/bin/
+ dosym /usr/bin/cal /usr/bin/ncal
+ doman "${TS}/ncal/ncal.1"
+ dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
+
+ TS=${S}/shell_cmds-${SHELL_VER}
+ for t in \
+ alias apply getopt jot killall lastcomm \
+ renice script shlock time w whereis;
+ do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
+ [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
+ done
+ cp "${TS}/w/w" "${ED}"/usr/bin/uptime
+ doman "${TS}/w/uptime.1"
+ for t in hostname kill; do
+ cp "${TS}/${t}/${t}" "${ED}"/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+
+ TS=${S}/developer_cmds-${DEV_VER}
+ for t in asa hexdump unifdef what ; do
+ cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
+ doman "${TS}/${t}/${t}.1"
+ done
+}
diff --git a/sys-apps/darwin-miscutils/files/darwin-miscutils-5-error.patch b/sys-apps/darwin-miscutils/files/darwin-miscutils-5-error.patch
new file mode 100644
index 000000000000..391dceb39188
--- /dev/null
+++ b/sys-apps/darwin-miscutils/files/darwin-miscutils-5-error.patch
@@ -0,0 +1,14 @@
+--- developer_cmds-48/error/error.h
++++ developer_cmds-48/error/error.h
+@@ -194,11 +194,7 @@
+ */
+ extern int nerrors;
+ extern Eptr er_head;
+-#ifdef __APPLE__
+-__private_extern__
+-#else
+ extern
+-#endif
+ Eptr *errors;
+ /*
+ * Resources for each of the files mentioned
diff --git a/sys-apps/darwin-miscutils/files/darwin-miscutils-5-stdlib.patch b/sys-apps/darwin-miscutils/files/darwin-miscutils-5-stdlib.patch
new file mode 100644
index 000000000000..0605310bff42
--- /dev/null
+++ b/sys-apps/darwin-miscutils/files/darwin-miscutils-5-stdlib.patch
@@ -0,0 +1,20 @@
+--- misc_cmds-23/leave/leave.c
++++ misc_cmds-23/leave/leave.c
+@@ -34,6 +34,7 @@
+ */
+
+ #include <sys/cdefs.h>
++#include <stdlib.h>
+ #ifndef lint
+ __COPYRIGHT("@(#) Copyright (c) 1980, 1988, 1993\n\
+ The Regents of the University of California. All rights reserved.\n");
+--- shell_cmds-118/alias/alias.c
++++ shell_cmds-118/alias/alias.c
+@@ -3,6 +3,7 @@
+ the shell scripts. It does not lead to any deliverable. Do not remove this
+ file from this (..../shell_cmds/alias) directory.
+ */
++#include <stdlib.h>
+ int main()
+ {
+ exit(0);
diff --git a/sys-apps/darwin-miscutils/files/darwin-miscutils-5-w.patch b/sys-apps/darwin-miscutils/files/darwin-miscutils-5-w.patch
new file mode 100644
index 000000000000..f6db3753d930
--- /dev/null
+++ b/sys-apps/darwin-miscutils/files/darwin-miscutils-5-w.patch
@@ -0,0 +1,10 @@
+--- shell_cmds-118/w/w.c
++++ shell_cmds-118/w/w.c
+@@ -75,7 +75,6 @@
+ #include <kvm.h>
+ #endif
+ #include <langinfo.h>
+-#include <libutil.h>
+ #include <limits.h>
+ #include <locale.h>
+ #include <netdb.h>
diff --git a/sys-apps/darwin-miscutils/files/darwin-miscutils-6-w64.patch b/sys-apps/darwin-miscutils/files/darwin-miscutils-6-w64.patch
new file mode 100644
index 000000000000..77c194e6df9b
--- /dev/null
+++ b/sys-apps/darwin-miscutils/files/darwin-miscutils-6-w64.patch
@@ -0,0 +1,17 @@
+grobian@gentoo.org:
+The provided libresolv library is faulty for 64-bits, or this call is
+doing something wrong. It is highly undocumented, so it feels like
+messing around with some pointers is not going to work. Doing this in
+64-bits mode, at least results in a nice Bus Error.
+
+--- shell_cmds-118/w/w.c
++++ shell_cmds-118/w/w.c
+@@ -262,7 +262,7 @@
+ argc -= optind;
+ argv += optind;
+
+-#if !TARGET_OS_EMBEDDED
++#if !defined(TARGET_OS_EMBEDDED) && !defined(__LP64__)
+ if (!(_res.options & RES_INIT))
+ res_init();
+ _res.retrans = 2; /* resolver timeout to 2 seconds per try */
diff --git a/sys-apps/darwin-miscutils/metadata.xml b/sys-apps/darwin-miscutils/metadata.xml
new file mode 100644
index 000000000000..4561e552bd04
--- /dev/null
+++ b/sys-apps/darwin-miscutils/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>prefix</herd>
+</pkgmetadata>
diff --git a/sys-apps/dbus/Manifest b/sys-apps/dbus/Manifest
new file mode 100644
index 000000000000..93b8c20642ad
--- /dev/null
+++ b/sys-apps/dbus/Manifest
@@ -0,0 +1,3 @@
+DIST dbus-1.8.16.tar.gz 1866436 SHA256 7f795268efd343ff0498786acb35097564390d40b1b6158daf1b4f742b522b07 SHA512 79e0fb21912fe5644e1babf96fc2a64595edef6524ef50d54f6beb8cd0f1224b8484a52a7815494b40bd00bf048176002ab35443c0bb6bd04abdc3c60599f1d5 WHIRLPOOL 5e992caf51c0fb24885099b957ce01205a249118c5db27c5161e6d45ae85a889d7f26d32dfa03a207025e87e233f74c6cffd09a5ccc44d4e598d3d535b8d4247
+DIST dbus-1.8.18.tar.gz 1868625 SHA256 36f2eb9c777a3c71562573da36a147e900a642afcd44d2b0470d992a4898c4f2 SHA512 4995246af3f940b939231a4af6ba743902e1260e1d1cca607d5b36c1cda4e5b1d586dd99e2b45c5058e04cf49e81217c68395fb1b22302438d9acb6a08e7d82e WHIRLPOOL 294ce01e260928388d2ac78e46bb00bc1305486ed11a19fa457d2581845ad15e64ae229ce8b778a3835722a1520ec234b0b8c7691cb3f98744181b652cf14a3c
+DIST dbus-1.8.20.tar.gz 1871722 SHA256 5c4fbf4c64621c96e871da91d2b729a5b00536e116d3c4612a469d924b1b703a SHA512 d63c29267e0445e329dc811e72d7858847fbae260920fd359b1fa889f08dead2a8b380e372718994daa92a262af970d1fcc58034fbcb8ffb3026ab5f30f63067 WHIRLPOOL 9eaf3ab12396159e119cfe3435fc5d160440dab4c4abce4d506450f6db59b72e6e4feba43b1ee9fd304a8e514983186a8e61f3a1f0c917c2c72891f72167201e
diff --git a/sys-apps/dbus/dbus-1.8.16.ebuild b/sys-apps/dbus/dbus-1.8.16.ebuild
new file mode 100644
index 000000000000..1bba9db1416d
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.8.16.ebuild
@@ -0,0 +1,248 @@
+# 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 eutils linux-info flag-o-matic python-any-r1 readme.gentoo systemd virtualx user multilib-minimal
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="http://dbus.freedesktop.org/"
+SRC_URI="http://dbus.freedesktop.org/releases/dbus/${P}.tar.gz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="debug doc selinux static-libs systemd test X"
+
+CDEPEND=">=dev-libs/expat-2
+ selinux? (
+ sys-libs/libselinux
+ )
+ systemd? ( sys-apps/systemd:0= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${CDEPEND}
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ test? (
+ >=dev-libs/glib-2.24
+ ${PYTHON_DEPS}
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-dbus )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+# out of sources build dir for make check
+TBD=${WORKDIR}/${P}-tests-build
+
+pkg_setup() {
+ enewgroup messagebus
+ enewuser messagebus -1 -1 -1 messagebus
+
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # Tests were restricted because of this
+ sed -i \
+ -e 's/.*bus_dispatch_test.*/printf ("Disabled due to excess noise\\n");/' \
+ -e '/"dispatch"/d' \
+ bus/test-main.c || die
+
+ epatch_user
+
+ # required for asneeded patch but also for bug 263909, cross-compile so
+ # don't remove eautoreconf
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local docconf myconf
+
+ # so we can get backtraces from apps
+ case ${CHOST} in
+ *-mingw*)
+ # error: unrecognized command line option '-rdynamic' wrt #488036
+ ;;
+ *)
+ append-flags -rdynamic
+ ;;
+ esac
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
+ # not on an SELinux profile.
+ myconf=(
+ --localstatedir="${EPREFIX}/var"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ $(use_enable static-libs static)
+ $(use_enable debug verbose-mode)
+ --disable-asserts
+ --disable-checks
+ $(use_enable selinux)
+ $(use_enable selinux libaudit)
+ $(use_enable kernel_linux inotify)
+ $(use_enable kernel_FreeBSD kqueue)
+ $(use_enable systemd)
+ --disable-embedded-tests
+ --disable-modular-tests
+ $(use_enable debug stats)
+ --with-session-socket-dir="${EPREFIX}"/tmp
+ --with-system-pid-file="${EPREFIX}"/var/run/dbus.pid
+ --with-system-socket="${EPREFIX}"/var/run/dbus/system_bus_socket
+ --with-dbus-user=messagebus
+ $(use_with X x)
+ "$(systemd_with_unitdir)"
+ )
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ myconf+=(
+ --enable-launchd
+ --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ if multilib_is_native_abi; then
+ docconf=(
+ --enable-xml-docs
+ $(use_enable doc doxygen-docs)
+ )
+ else
+ docconf=(
+ --disable-xml-docs
+ --disable-doxygen-docs
+ )
+ myconf+=(
+ --disable-selinux
+ --disable-libaudit
+ --disable-systemd
+ --without-x
+
+ # expat is used for the daemon only
+ # fake the check for multilib library build
+ ac_cv_lib_expat_XML_ParserCreate_MM=yes
+ )
+ fi
+
+ einfo "Running configure in ${BUILD_DIR}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
+
+ if multilib_is_native_abi && use test; then
+ mkdir "${TBD}" || die
+ cd "${TBD}" || die
+ einfo "Running configure in ${TBD}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" \
+ $(use_enable test asserts) \
+ $(use_enable test checks) \
+ $(use_enable test embedded-tests) \
+ $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
+ fi
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ # after the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ einfo "Running make in ${BUILD_DIR}"
+ emake
+
+ if use test; then
+ einfo "Running make in ${TBD}"
+ emake -C "${TBD}"
+ fi
+ else
+ emake -C dbus libdbus-1.la
+ fi
+}
+
+src_test() {
+ DBUS_VERBOSE=1 Xemake -j1 -C "${TBD}" check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" install-pkgconfigDATA
+ emake DESTDIR="${D}" -C dbus \
+ install-libLTLIBRARIES install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ newinitd "${FILESDIR}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (#77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/80-dbus
+ fi
+
+ # needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/var/run
+
+ dodoc AUTHORS ChangeLog HACKING NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ prune_libtool_files --all
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ # Ensure unique id is generated and put it in /etc wrt #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ dbus-uuidgen --ensure="${EROOT%/}"/etc/machine-id
+ ln -sf "${EROOT%/}"/etc/machine-id "${EROOT%/}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
diff --git a/sys-apps/dbus/dbus-1.8.18.ebuild b/sys-apps/dbus/dbus-1.8.18.ebuild
new file mode 100644
index 000000000000..824ceb85a73f
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.8.18.ebuild
@@ -0,0 +1,252 @@
+# 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 eutils linux-info flag-o-matic python-any-r1 readme.gentoo systemd virtualx user multilib-minimal
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="http://dbus.freedesktop.org/"
+SRC_URI="http://dbus.freedesktop.org/releases/dbus/${P}.tar.gz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="debug doc selinux static-libs systemd test X"
+
+CDEPEND="
+ >=dev-libs/expat-2
+ selinux? (
+ sys-libs/libselinux
+ )
+ systemd? ( sys-apps/systemd:0= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+DEPEND="${CDEPEND}
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ test? (
+ >=dev-libs/glib-2.24:2
+ ${PYTHON_DEPS}
+ )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-dbus )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+# out of sources build dir for make check
+TBD=${WORKDIR}/${P}-tests-build
+
+pkg_setup() {
+ enewgroup messagebus
+ enewuser messagebus -1 -1 -1 messagebus
+
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # Tests were restricted because of this
+ sed -i \
+ -e 's/.*bus_dispatch_test.*/printf ("Disabled due to excess noise\\n");/' \
+ -e '/"dispatch"/d' \
+ bus/test-main.c || die
+
+ epatch_user
+
+ # required for asneeded patch but also for bug 263909, cross-compile so
+ # don't remove eautoreconf
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local docconf myconf
+
+ # so we can get backtraces from apps
+ case ${CHOST} in
+ *-mingw*)
+ # error: unrecognized command line option '-rdynamic' wrt #488036
+ ;;
+ *)
+ append-flags -rdynamic
+ ;;
+ esac
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
+ # not on an SELinux profile.
+ myconf=(
+ --localstatedir="${EPREFIX}/var"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ $(use_enable static-libs static)
+ $(use_enable debug verbose-mode)
+ --disable-asserts
+ --disable-checks
+ $(use_enable selinux)
+ $(use_enable selinux libaudit)
+ $(use_enable kernel_linux inotify)
+ $(use_enable kernel_FreeBSD kqueue)
+ $(use_enable systemd)
+ --disable-embedded-tests
+ --disable-modular-tests
+ $(use_enable debug stats)
+ --with-session-socket-dir="${EPREFIX}"/tmp
+ --with-system-pid-file="${EPREFIX}"/var/run/dbus.pid
+ --with-system-socket="${EPREFIX}"/var/run/dbus/system_bus_socket
+ --with-dbus-user=messagebus
+ $(use_with X x)
+ "$(systemd_with_unitdir)"
+ )
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ myconf+=(
+ --enable-launchd
+ --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ if multilib_is_native_abi; then
+ docconf=(
+ --enable-xml-docs
+ $(use_enable doc doxygen-docs)
+ )
+ else
+ docconf=(
+ --disable-xml-docs
+ --disable-doxygen-docs
+ )
+ myconf+=(
+ --disable-selinux
+ --disable-libaudit
+ --disable-systemd
+ --without-x
+
+ # expat is used for the daemon only
+ # fake the check for multilib library build
+ ac_cv_lib_expat_XML_ParserCreate_MM=yes
+ )
+ fi
+
+ einfo "Running configure in ${BUILD_DIR}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
+
+ if multilib_is_native_abi && use test; then
+ mkdir "${TBD}" || die
+ cd "${TBD}" || die
+ einfo "Running configure in ${TBD}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" \
+ $(use_enable test asserts) \
+ $(use_enable test checks) \
+ $(use_enable test embedded-tests) \
+ $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
+ fi
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ # after the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ einfo "Running make in ${BUILD_DIR}"
+ emake
+
+ if use test; then
+ einfo "Running make in ${TBD}"
+ emake -C "${TBD}"
+ fi
+ else
+ emake -C dbus libdbus-1.la
+ fi
+}
+
+src_test() {
+ DBUS_VERBOSE=1 Xemake -j1 -C "${TBD}" check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" install-pkgconfigDATA
+ emake DESTDIR="${D}" -C dbus \
+ install-libLTLIBRARIES install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ newinitd "${FILESDIR}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (#77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/80-dbus
+ fi
+
+ # needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/var/run
+
+ dodoc AUTHORS ChangeLog HACKING NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ prune_libtool_files --all
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ # Ensure unique id is generated and put it in /etc wrt #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ dbus-uuidgen --ensure="${EROOT%/}"/etc/machine-id
+ ln -sf "${EROOT%/}"/etc/machine-id "${EROOT%/}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
diff --git a/sys-apps/dbus/dbus-1.8.20.ebuild b/sys-apps/dbus/dbus-1.8.20.ebuild
new file mode 100644
index 000000000000..824ceb85a73f
--- /dev/null
+++ b/sys-apps/dbus/dbus-1.8.20.ebuild
@@ -0,0 +1,252 @@
+# 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 eutils linux-info flag-o-matic python-any-r1 readme.gentoo systemd virtualx user multilib-minimal
+
+DESCRIPTION="A message bus system, a simple way for applications to talk to each other"
+HOMEPAGE="http://dbus.freedesktop.org/"
+SRC_URI="http://dbus.freedesktop.org/releases/dbus/${P}.tar.gz"
+
+LICENSE="|| ( AFL-2.1 GPL-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="debug doc selinux static-libs systemd test X"
+
+CDEPEND="
+ >=dev-libs/expat-2
+ selinux? (
+ sys-libs/libselinux
+ )
+ systemd? ( sys-apps/systemd:0= )
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+"
+DEPEND="${CDEPEND}
+ app-text/xmlto
+ app-text/docbook-xml-dtd:4.4
+ virtual/pkgconfig
+ doc? ( app-doc/doxygen )
+ test? (
+ >=dev-libs/glib-2.24:2
+ ${PYTHON_DEPS}
+ )
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-dbus )
+"
+
+DOC_CONTENTS="
+ Some applications require a session bus in addition to the system
+ bus. Please see \`man dbus-launch\` for more information.
+"
+
+# out of sources build dir for make check
+TBD=${WORKDIR}/${P}-tests-build
+
+pkg_setup() {
+ enewgroup messagebus
+ enewuser messagebus -1 -1 -1 messagebus
+
+ use test && python-any-r1_pkg_setup
+
+ if use kernel_linux; then
+ CONFIG_CHECK="~EPOLL"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # Tests were restricted because of this
+ sed -i \
+ -e 's/.*bus_dispatch_test.*/printf ("Disabled due to excess noise\\n");/' \
+ -e '/"dispatch"/d' \
+ bus/test-main.c || die
+
+ epatch_user
+
+ # required for asneeded patch but also for bug 263909, cross-compile so
+ # don't remove eautoreconf
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local docconf myconf
+
+ # so we can get backtraces from apps
+ case ${CHOST} in
+ *-mingw*)
+ # error: unrecognized command line option '-rdynamic' wrt #488036
+ ;;
+ *)
+ append-flags -rdynamic
+ ;;
+ esac
+
+ # libaudit is *only* used in DBus wrt SELinux support, so disable it, if
+ # not on an SELinux profile.
+ myconf=(
+ --localstatedir="${EPREFIX}/var"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
+ $(use_enable static-libs static)
+ $(use_enable debug verbose-mode)
+ --disable-asserts
+ --disable-checks
+ $(use_enable selinux)
+ $(use_enable selinux libaudit)
+ $(use_enable kernel_linux inotify)
+ $(use_enable kernel_FreeBSD kqueue)
+ $(use_enable systemd)
+ --disable-embedded-tests
+ --disable-modular-tests
+ $(use_enable debug stats)
+ --with-session-socket-dir="${EPREFIX}"/tmp
+ --with-system-pid-file="${EPREFIX}"/var/run/dbus.pid
+ --with-system-socket="${EPREFIX}"/var/run/dbus/system_bus_socket
+ --with-dbus-user=messagebus
+ $(use_with X x)
+ "$(systemd_with_unitdir)"
+ )
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ myconf+=(
+ --enable-launchd
+ --with-launchd-agent-dir="${EPREFIX}"/Library/LaunchAgents
+ )
+ fi
+
+ if multilib_is_native_abi; then
+ docconf=(
+ --enable-xml-docs
+ $(use_enable doc doxygen-docs)
+ )
+ else
+ docconf=(
+ --disable-xml-docs
+ --disable-doxygen-docs
+ )
+ myconf+=(
+ --disable-selinux
+ --disable-libaudit
+ --disable-systemd
+ --without-x
+
+ # expat is used for the daemon only
+ # fake the check for multilib library build
+ ac_cv_lib_expat_XML_ParserCreate_MM=yes
+ )
+ fi
+
+ einfo "Running configure in ${BUILD_DIR}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" "${docconf[@]}"
+
+ if multilib_is_native_abi && use test; then
+ mkdir "${TBD}" || die
+ cd "${TBD}" || die
+ einfo "Running configure in ${TBD}"
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" \
+ $(use_enable test asserts) \
+ $(use_enable test checks) \
+ $(use_enable test embedded-tests) \
+ $(has_version dev-libs/dbus-glib && echo --enable-modular-tests)
+ fi
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ # after the compile, it uses a selinuxfs interface to
+ # check if the SELinux policy has the right support
+ use selinux && addwrite /selinux/access
+
+ einfo "Running make in ${BUILD_DIR}"
+ emake
+
+ if use test; then
+ einfo "Running make in ${TBD}"
+ emake -C "${TBD}"
+ fi
+ else
+ emake -C dbus libdbus-1.la
+ fi
+}
+
+src_test() {
+ DBUS_VERBOSE=1 Xemake -j1 -C "${TBD}" check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+ else
+ emake DESTDIR="${D}" install-pkgconfigDATA
+ emake DESTDIR="${D}" -C dbus \
+ install-libLTLIBRARIES install-dbusincludeHEADERS \
+ install-nodist_dbusarchincludeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ newinitd "${FILESDIR}"/dbus.initd dbus
+
+ if use X; then
+ # dbus X session script (#77504)
+ # turns out to only work for GDM (and startx). has been merged into
+ # other desktop (kdm and such scripts)
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/80-dbus
+ fi
+
+ # needs to exist for dbus sessions to launch
+ keepdir /usr/share/dbus-1/services
+ keepdir /etc/dbus-1/{session,system}.d
+ # machine-id symlink from pkg_postinst()
+ keepdir /var/lib/dbus
+ # let the init script create the /var/run/dbus directory
+ rm -rf "${ED}"/var/run
+
+ dodoc AUTHORS ChangeLog HACKING NEWS README doc/TODO
+ readme.gentoo_create_doc
+
+ prune_libtool_files --all
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ # Ensure unique id is generated and put it in /etc wrt #370451 but symlink
+ # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
+ # dependencies with hardcoded paths (although the known ones got fixed already)
+ dbus-uuidgen --ensure="${EROOT%/}"/etc/machine-id
+ ln -sf "${EROOT%/}"/etc/machine-id "${EROOT%/}"/var/lib/dbus/machine-id
+
+ if [[ ${CHOST} == *-darwin* ]]; then
+ local plist="org.freedesktop.dbus-session.plist"
+ elog
+ elog
+ elog "For MacOS/Darwin we now ship launchd support for dbus."
+ elog "This enables autolaunch of dbus at session login and makes"
+ elog "dbus usable under MacOS/Darwin."
+ elog
+ elog "The launchd plist file ${plist} has been"
+ elog "installed in ${EPREFIX}/Library/LaunchAgents."
+ elog "For it to be used, you will have to do all of the following:"
+ elog " + cd ~/Library/LaunchAgents"
+ elog " + ln -s ${EPREFIX}/Library/LaunchAgents/${plist}"
+ elog " + logout and log back in"
+ elog
+ elog "If your application needs a proper DBUS_SESSION_BUS_ADDRESS"
+ elog "specified and refused to start otherwise, then export the"
+ elog "the following to your environment:"
+ elog " DBUS_SESSION_BUS_ADDRESS=\"launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET\""
+ fi
+}
diff --git a/sys-apps/dbus/files/80-dbus b/sys-apps/dbus/files/80-dbus
new file mode 100644
index 000000000000..5593e2cd7390
--- /dev/null
+++ b/sys-apps/dbus/files/80-dbus
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# launches a session dbus instance
+
+dbuslaunch="`which dbus-launch 2>/dev/null`"
+if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
+ if [ -n "$command" ]; then
+ command="$dbuslaunch --exit-with-session $command"
+ else
+ eval `$dbuslaunch --sh-syntax --exit-with-session`
+ fi
+fi
+
diff --git a/sys-apps/dbus/files/dbus.initd b/sys-apps/dbus/files/dbus.initd
new file mode 100644
index 000000000000..58838ccb1796
--- /dev/null
+++ b/sys-apps/dbus/files/dbus.initd
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ ebegin "Starting D-BUS system messagebus"
+ /usr/bin/dbus-uuidgen --ensure=/etc/machine-id
+
+ # We need to test if /var/run/dbus exists, since script will fail if it does not
+ [ ! -e /var/run/dbus ] && mkdir /var/run/dbus
+
+ start-stop-daemon --start --pidfile /var/run/dbus.pid --exec /usr/bin/dbus-daemon -- --system
+ eend $?
+}
+
+stop() {
+ local retval
+
+ ebegin "Stopping D-BUS system messagebus"
+
+ start-stop-daemon --stop --pidfile /var/run/dbus.pid
+ retval=$?
+
+ eend ${retval}
+
+ [ -S /var/run/dbus/system_bus_socket ] && rm -f /var/run/dbus/system_bus_socket
+
+ return ${retval}
+}
+
+reload() {
+ local retval
+
+ ebegin "Reloading D-BUS messagebus config"
+
+ /usr/bin/dbus-send --print-reply --system --type=method_call \
+ --dest=org.freedesktop.DBus \
+ / org.freedesktop.DBus.ReloadConfig > /dev/null
+ retval=$?
+ eend ${retval}
+ return ${retval}
+}
diff --git a/sys-apps/dbus/metadata.xml b/sys-apps/dbus/metadata.xml
new file mode 100644
index 000000000000..70f327cffe8b
--- /dev/null
+++ b/sys-apps/dbus/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>freedesktop</herd>
+ <maintainer>
+ <email>freedesktop-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='systemd'>Build with <pkg>sys-apps/systemd</pkg> at_console support</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:freedesktop:dbus</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/dcfldd/Manifest b/sys-apps/dcfldd/Manifest
new file mode 100644
index 000000000000..e15898b1fb50
--- /dev/null
+++ b/sys-apps/dcfldd/Manifest
@@ -0,0 +1 @@
+DIST dcfldd-1.3.4-1.tar.gz 163141 SHA256 f5143a184da56fd5ac729d6d8cbcf9f5da8e1cf4604aa9fb97c59553b7e6d5f8
diff --git a/sys-apps/dcfldd/dcfldd-1.3.4.1.ebuild b/sys-apps/dcfldd/dcfldd-1.3.4.1.ebuild
new file mode 100644
index 000000000000..42f1a2aa4e3e
--- /dev/null
+++ b/sys-apps/dcfldd/dcfldd-1.3.4.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit versionator
+
+My_PV=$(replace_version_separator 3 '-')
+
+DESCRIPTION="enhanced dd with features for forensics and security"
+HOMEPAGE="http://dcfldd.sourceforge.net/"
+SRC_URI="mirror://sourceforge/dcfldd/${PN}-${My_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}-${My_PV}"
+
+src_install() {
+ make install DESTDIR="${D}" || die "make install failed"
+ dodoc AUTHORS ChangeLog README
+}
diff --git a/sys-apps/dcfldd/metadata.xml b/sys-apps/dcfldd/metadata.xml
new file mode 100644
index 000000000000..961146344a8d
--- /dev/null
+++ b/sys-apps/dcfldd/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>forensics</herd>
+ <upstream>
+ <remote-id type="sourceforge">dcfldd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/dchroot/Manifest b/sys-apps/dchroot/Manifest
new file mode 100644
index 000000000000..62f764be1b3d
--- /dev/null
+++ b/sys-apps/dchroot/Manifest
@@ -0,0 +1 @@
+DIST dchroot_0.12.1.tar.gz 20287 SHA256 b42bf3521299c845345db2ba140af8acddec2b0f1492df481367f8bcf25328c3 SHA512 4c0b9e30c68f7ff953a259b4d21f0fab58b6a15dd8ebf0666267879114c0fce37a9fc38d71e5047003676c1ec4211feb0d2c51aa44def81d0d5a40815fd1c600 WHIRLPOOL 7542e2f77a922216482d489b4b9e630778f01c8313b6b966c36c12909a9111d2cd86b2bb4c393e3cf3f4bae35fd1f78c97162af42e3ee4f30894e5571903b13f
diff --git a/sys-apps/dchroot/dchroot-0.12.1.ebuild b/sys-apps/dchroot/dchroot-0.12.1.ebuild
new file mode 100644
index 000000000000..665be41e5172
--- /dev/null
+++ b/sys-apps/dchroot/dchroot-0.12.1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Utility for managing chroots for non-root users"
+HOMEPAGE="http://packages.debian.org/unstable/admin/dchroot"
+SRC_URI="mirror://debian/pool/main/d/dchroot/dchroot_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/help2man"
+RDEPEND="!dev-util/schroot[dchroot]"
+
+src_prepare() {
+ sed -i \
+ -e '/^all:/s:$: docs:' \
+ -e '/^CFLAGS/s:-O2:@CFLAGS@:' \
+ -e '/@CFLAGS@/ s:@CFLAGS@:@CFLAGS@ @LDFLAGS@:' \
+ Makefile.in || die "sed failed"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc README TODO
+}
diff --git a/sys-apps/dchroot/metadata.xml b/sys-apps/dchroot/metadata.xml
new file mode 100644
index 000000000000..d9cd2cad66c2
--- /dev/null
+++ b/sys-apps/dchroot/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>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/debianutils/Manifest b/sys-apps/debianutils/Manifest
new file mode 100644
index 000000000000..76e283848cd4
--- /dev/null
+++ b/sys-apps/debianutils/Manifest
@@ -0,0 +1,4 @@
+DIST debianutils_4.3.2.tar.gz 201772 SHA256 0062d774306a6acc34d3b855a5c4eeb845653b0cd34dbb5c13aa00b4ecb8af22 SHA512 f174e8b487450d5434835d55fc6008fd596049e075eda07afc06293022d290dcf2c9dbd1fb8f40f1f88c2e3095a7fd9fedfa16992c72e6c2b0cce79faadad9a0 WHIRLPOOL 255fc83df32ca7cfb950d04c96f24610a6f00cb1e515bbb0ca1391fcaec17ff9a37a00a233bb4ff87b66fbd7ac2195aa9423b2bbf6c42c8f9898835bebd486eb
+DIST debianutils_4.3.3.tar.gz 218494 SHA256 2df2571c0530beeb2ea11e9aa2a24ab66dff2a868c8ba5e868278af4ad7afd1d SHA512 c4c19e66bb858b9c0983460e11e54280fc09bbeb84a17a20021437d379b6190c2086107c4120f81a747e82d22ad4b538de2a78ba6a3118c5f5f786261e44b52f WHIRLPOOL b55aa163ea3b99f0d33cd22b9fc9d2820c5533a535a9f105ae772f9ca13c581d399863b542b0d76abb45b5dad50fb2957b7b74ecefcf575abcd18a394e4315e7
+DIST debianutils_4.3.4.tar.gz 223671 SHA256 1739976cb62b85e641ee36859a87dfb8e4c3214e1043b6bb00b56b87e96a19f5 SHA512 28012e85b5c488efecb8e61f61228994ffcfc8ce33bb3f616f08550d5bf86d08778f13f3bb8d893c649144e31d61a7a8b114596c5c5c762ef8552e55b06906c8 WHIRLPOOL f7b21c8d90197f7d65b91e5f9b48f8e51f37c4a657b9d985084803bddf2880be502c579375ded6cbb35b90f3710aa18917763ab231f2a13ccabdb9333c16cad3
+DIST debianutils_4.4.tar.gz 272098 SHA256 190850cdd6b5302e0a1ba1aaed1bc7074d67d3bd8d04c613f242f7145afa53a6 SHA512 78c51a7da586c6f23bf40810fd9bcaedc90648e6043c199f347cf5772f9c83ab646f22c2746ba6eddd7df8d6a31b01dc25f5bcb21a53a173aa5549138d14a9ca WHIRLPOOL 9fe7f16d921247eb74a56a865264d14b0cddb9025c1a4d761798494908c948bce7958ea2ee4db3a1b8800add41596ee9dfe6665603bd26a1c7bfd926a74f7f67
diff --git a/sys-apps/debianutils/debianutils-4.3.2.ebuild b/sys-apps/debianutils/debianutils-4.3.2.ebuild
new file mode 100644
index 000000000000..96c44c4694e1
--- /dev/null
+++ b/sys-apps/debianutils/debianutils-4.3.2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="A selection of tools from Debian"
+HOMEPAGE="http://packages.qa.debian.org/d/debianutils.html"
+SRC_URI="mirror://debian/pool/main/d/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 SMAIL"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="kernel_linux static"
+
+PDEPEND="|| ( >=sys-apps/coreutils-6.10-r1 sys-freebsd/freebsd-ubin )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.4.2-no-bs-namespace.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ default
+}
+
+src_install() {
+ into /
+ dobin tempfile run-parts
+ if use kernel_linux ; then
+ dosbin installkernel
+ fi
+
+ into /usr
+ dosbin savelog
+
+ doman tempfile.1 run-parts.8 savelog.8
+ use kernel_linux && doman installkernel.8
+ cd debian
+ dodoc changelog control
+ keepdir /etc/kernel/postinst.d
+}
diff --git a/sys-apps/debianutils/debianutils-4.3.3.ebuild b/sys-apps/debianutils/debianutils-4.3.3.ebuild
new file mode 100644
index 000000000000..d17342eba583
--- /dev/null
+++ b/sys-apps/debianutils/debianutils-4.3.3.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="A selection of tools from Debian"
+HOMEPAGE="http://packages.qa.debian.org/d/debianutils.html"
+SRC_URI="mirror://debian/pool/main/d/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 SMAIL"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="kernel_linux static"
+
+PDEPEND="|| ( >=sys-apps/coreutils-6.10-r1 sys-freebsd/freebsd-ubin )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.4.2-no-bs-namespace.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ default
+}
+
+src_install() {
+ into /
+ dobin tempfile run-parts
+ if use kernel_linux ; then
+ dosbin installkernel
+ fi
+
+ into /usr
+ dosbin savelog
+
+ doman tempfile.1 run-parts.8 savelog.8
+ use kernel_linux && doman installkernel.8
+ cd debian
+ dodoc changelog control
+ keepdir /etc/kernel/postinst.d
+}
diff --git a/sys-apps/debianutils/debianutils-4.3.4.ebuild b/sys-apps/debianutils/debianutils-4.3.4.ebuild
new file mode 100644
index 000000000000..1f386b75dc68
--- /dev/null
+++ b/sys-apps/debianutils/debianutils-4.3.4.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 eutils flag-o-matic
+
+DESCRIPTION="A selection of tools from Debian"
+HOMEPAGE="http://packages.qa.debian.org/d/debianutils.html"
+SRC_URI="mirror://debian/pool/main/d/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 SMAIL"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="kernel_linux static"
+
+PDEPEND="|| ( >=sys-apps/coreutils-6.10-r1 sys-freebsd/freebsd-ubin )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.4.2-no-bs-namespace.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ default
+}
+
+src_install() {
+ into /
+ dobin tempfile run-parts
+ if use kernel_linux ; then
+ dosbin installkernel
+ fi
+
+ into /usr
+ dosbin savelog
+
+ doman tempfile.1 run-parts.8 savelog.8
+ use kernel_linux && doman installkernel.8
+ cd debian
+ dodoc changelog control
+ keepdir /etc/kernel/postinst.d
+}
diff --git a/sys-apps/debianutils/debianutils-4.4.ebuild b/sys-apps/debianutils/debianutils-4.4.ebuild
new file mode 100644
index 000000000000..126fa01d68ad
--- /dev/null
+++ b/sys-apps/debianutils/debianutils-4.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 eutils flag-o-matic
+
+DESCRIPTION="A selection of tools from Debian"
+HOMEPAGE="http://packages.qa.debian.org/d/debianutils.html"
+SRC_URI="mirror://debian/pool/main/d/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 SMAIL"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+IUSE="kernel_linux static"
+
+PDEPEND="|| ( >=sys-apps/coreutils-6.10-r1 sys-freebsd/freebsd-ubin )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.4.2-no-bs-namespace.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ default
+}
+
+src_install() {
+ into /
+ dobin tempfile run-parts
+ if use kernel_linux ; then
+ dosbin installkernel
+ fi
+
+ into /usr
+ dosbin savelog
+
+ doman tempfile.1 run-parts.8 savelog.8
+ use kernel_linux && doman installkernel.8
+ cd debian
+ dodoc changelog control
+ keepdir /etc/kernel/postinst.d
+}
diff --git a/sys-apps/debianutils/files/debianutils-3.4.2-no-bs-namespace.patch b/sys-apps/debianutils/files/debianutils-3.4.2-no-bs-namespace.patch
new file mode 100644
index 000000000000..94a84b8fb9cd
--- /dev/null
+++ b/sys-apps/debianutils/files/debianutils-3.4.2-no-bs-namespace.patch
@@ -0,0 +1,30 @@
+Allow dots in the names, bug #95173. Patch by Kerin Millar.
+Re-sourced for 3.4.2
+
+--- a/run-parts.8
++++ b/run-parts.8
+@@ -25,9 +25,10 @@
+ .IR directory .
+ Other files and directories are silently ignored.
+
+-If neither the \-\-lsbsysinit option nor the \-\-regex option is given
+-then the names must consist entirely of ASCII upper- and lower-case
+-letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens.
++If neither the \-\-lsbsysinit option nor the \-\-regex option is given then the
++names must consist entirely of ASCII upper- and lower-case letters, ASCII
++digits, ASCII underscores, and ASCII minus-hyphens. However, the name must not
++begin with a period.
+
+ If the \-\-lsbsysinit option is given, then the names must not end
+ in .dpkg\-old or .dpkg\-dist or .dpkg\-new or .dpkg\-tmp, and must
+--- a/run-parts.c
++++ b/run-parts.c
+@@ -501,7 +501,7 @@
+ != 0)
+ pt_regex = &tradre;
+
+- } else if ( (err = regcomp(&classicalre, "^[a-zA-Z0-9_-]+$",
++ } else if ( (err = regcomp(&classicalre, "^[a-zA-Z0-9_-][a-zA-Z0-9._-]+$",
+ REG_EXTENDED | REG_NOSUB)) != 0)
+ pt_regex = &classicalre;
+
diff --git a/sys-apps/debianutils/metadata.xml b/sys-apps/debianutils/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/debianutils/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-apps/diffutils/Manifest b/sys-apps/diffutils/Manifest
new file mode 100644
index 000000000000..49003a7fb2c6
--- /dev/null
+++ b/sys-apps/diffutils/Manifest
@@ -0,0 +1 @@
+DIST diffutils-3.3.tar.xz 1197832 SHA256 a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c SHA512 b04b998717e45e8fd1ba675957dad1909beeed68ffc41c0d9bbaddaf78965f9e63af5a8d8811bb94f33a3cddcad2fe1ad794e52e545def9ce96c092999a74a83 WHIRLPOOL 8fd3b179afdc3fd127cee8829535b0fc6d949443645e8df80fa45c2fa44a732ea652259b644d81a9be14d4c7f7c3b5bad7b8861934a6bc691cd02a34c0200ed3
diff --git a/sys-apps/diffutils/diffutils-3.3.ebuild b/sys-apps/diffutils/diffutils-3.3.ebuild
new file mode 100644
index 000000000000..922ff619ff22
--- /dev/null
+++ b/sys-apps/diffutils/diffutils-3.3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit flag-o-matic
+
+DESCRIPTION="Tools to make diffs and compare files"
+HOMEPAGE="http://www.gnu.org/software/diffutils/"
+SRC_URI="mirror://gnu-alpha/diffutils/${P}.tar.xz
+ mirror://gnu/diffutils/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static"
+
+DEPEND="app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+
+DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
+
+src_prepare() {
+ # Disable gnulib build test that has no impact on the source.
+ # Re-enable w/next version bump (and gnulib is updated). #554728
+ [[ ${PV} != "3.3" ]] && die "re-enable test #554728"
+ echo 'exit 0' > gnulib-tests/test-update-copyright.sh || die
+
+ sed -i 's:@mkdir_p@:@MKDIR_P@:g' po/Makefile.in.in || die #464604
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # Disable automagic dependency over libsigsegv; see bug #312351.
+ export ac_cv_libsigsegv=no
+
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR}" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ $(use_enable nls)
+}
+
+src_test() {
+ # explicitly allow parallel testing
+ emake check
+}
diff --git a/sys-apps/diffutils/metadata.xml b/sys-apps/diffutils/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/diffutils/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-apps/dmapi/Manifest b/sys-apps/dmapi/Manifest
new file mode 100644
index 000000000000..01e9ed5090d6
--- /dev/null
+++ b/sys-apps/dmapi/Manifest
@@ -0,0 +1 @@
+DIST dmapi-2.2.12.tar.gz 367318 SHA256 b18e34f47374f6adf7c164993c26df36986a009b86aa004ef9444102653aea69 SHA512 aa44c0c7857158fed198deb9d1e00abaab549e3c22a7ce0e24e6088146bde56ecf967405b1b61a589460981ddcfaffbb1e9a2e677088efec317e3a7cb44abe4f WHIRLPOOL 5209b3a3b8afaf55eb26588cd8ffe085f58849b0b4a159851c0ffeefa0f8cf5aad53d9bea927099f3fced101e017867c538a081667ad684df5f2ff6685eac19e
diff --git a/sys-apps/dmapi/dmapi-2.2.12-r1.ebuild b/sys-apps/dmapi/dmapi-2.2.12-r1.ebuild
new file mode 100644
index 000000000000..54291171b34a
--- /dev/null
+++ b/sys-apps/dmapi/dmapi-2.2.12-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs multilib multilib-minimal
+
+DESCRIPTION="XFS data management API library"
+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="static-libs"
+
+RDEPEND="sys-fs/xfsprogs"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install install-dev
+ multilib_is_native_abi && gen_usr_ldscript -a dm
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ rm "${ED}"/usr/share/doc/${PF}/COPYING
+}
diff --git a/sys-apps/dmapi/dmapi-2.2.12.ebuild b/sys-apps/dmapi/dmapi-2.2.12.ebuild
new file mode 100644
index 000000000000..7b357aa2f049
--- /dev/null
+++ b/sys-apps/dmapi/dmapi-2.2.12.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs multilib
+
+DESCRIPTION="XFS data management API library"
+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="static-libs"
+
+RDEPEND="sys-fs/xfsprogs"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+}
+
+src_configure() {
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install install-dev
+ gen_usr_ldscript -a dm
+ find "${ED}"/usr '(' -name '*.la' -o -name COPYING ')' -delete
+}
diff --git a/sys-apps/dmapi/metadata.xml b/sys-apps/dmapi/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/dmapi/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-apps/dmidecode/Manifest b/sys-apps/dmidecode/Manifest
new file mode 100644
index 000000000000..8e527c5702dd
--- /dev/null
+++ b/sys-apps/dmidecode/Manifest
@@ -0,0 +1 @@
+DIST dmidecode-2.12.tar.bz2 55191 SHA256 913ff3055d563a62a420789b8ee33b038de9afa18ea61254760ddf8ab87a5088 SHA512 15d5a6dca04de48267f969f6866079915964a8a3abad083b1720a4425723f9c100770d05c0d475df9609c5b54741f231a587761d1beb1ae6de4b2836d60724c4 WHIRLPOOL 139841a9efd07ecfcb012a24e2c3ea00c79d66828a5d5aa1eeb8b230c1b84f310e5f9282403af9f530f7ead41922f7a3e8a6e8b93e46d7403d69975b95d6a406
diff --git a/sys-apps/dmidecode/dmidecode-2.12-r1.ebuild b/sys-apps/dmidecode/dmidecode-2.12-r1.ebuild
new file mode 100644
index 000000000000..fffd494439e1
--- /dev/null
+++ b/sys-apps/dmidecode/dmidecode-2.12-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+DESCRIPTION="DMI (Desktop Management Interface) table related utilities"
+HOMEPAGE="http://www.nongnu.org/dmidecode/"
+SRC_URI="http://savannah.nongnu.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 arm ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-solaris"
+IUSE="selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-dmidecode )"
+DEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV}-supported-smbios-version.patch"
+ sed -i \
+ -e "/^prefix/s:/usr/local:${EPREFIX}/usr:" \
+ -e "/^docdir/s:dmidecode:${PF}:" \
+ -e '/^PROGRAMS !=/d' \
+ Makefile || die
+}
+
+src_compile() {
+ emake \
+ CFLAGS="${CFLAGS} ${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ einfo "dmidecode needs root privileges to read /dev/xsvc"
+ einfo "To make dmidecode useful, either run as root, or chown and setuid the binary."
+ einfo "Note that /usr/sbin/ptrconf and /usr/sbin/ptrdiag give similar"
+ einfo "information without requiring root privileges."
+ fi
+}
diff --git a/sys-apps/dmidecode/files/2.12-supported-smbios-version.patch b/sys-apps/dmidecode/files/2.12-supported-smbios-version.patch
new file mode 100644
index 000000000000..84feaca79ef9
--- /dev/null
+++ b/sys-apps/dmidecode/files/2.12-supported-smbios-version.patch
@@ -0,0 +1,55 @@
+diff -uNr dmidecode-2.12.ORIG/dmidecode.c dmidecode-2.12/dmidecode.c
+--- dmidecode-2.12.ORIG/dmidecode.c 2014-05-06 14:24:27.703057950 +0100
++++ dmidecode-2.12/dmidecode.c 2014-05-06 14:24:43.136058719 +0100
+@@ -69,7 +69,7 @@
+ #define out_of_spec "<OUT OF SPEC>"
+ static const char *bad_index = "<BAD INDEX>";
+
+-#define SUPPORTED_SMBIOS_VER 0x0207
++#define SUPPORTED_SMBIOS_VER 0x0208
+
+ /*
+ * Type-independant Stuff
+@@ -712,7 +712,6 @@
+ { 0x3D, "Opteron 6200" },
+ { 0x3E, "Opteron 4200" },
+ { 0x3F, "FX" },
+-
+ { 0x40, "MIPS" },
+ { 0x41, "MIPS R4000" },
+ { 0x42, "MIPS R4200" },
+@@ -729,7 +728,6 @@
+ { 0x4D, "Opteron 6300" },
+ { 0x4E, "Opteron 3300" },
+ { 0x4F, "FirePro" },
+-
+ { 0x50, "SPARC" },
+ { 0x51, "SuperSPARC" },
+ { 0x52, "MicroSPARC II" },
+@@ -1176,7 +1174,7 @@
+ "Socket LGA1356-3" /* 0x2C */
+ };
+
+- if (code >= 0x01 && code <= 0x2A)
++ if (code >= 0x01 && code <= 0x2C)
+ return upgrade[code - 0x01];
+ return out_of_spec;
+ }
+@@ -2236,7 +2234,7 @@
+ if (code == 0)
+ printf(" Unknown");
+ else
+- printf(" %.3f V", (float)(i16)code / 1000);
++ printf(" %.3f V", (float)code / 1000);
+ }
+
+ static const char *dmi_memory_device_form_factor(u8 code)
+@@ -2338,7 +2336,7 @@
+ {
+ int i;
+
+- for (i = 1; i <= 14; i++)
++ for (i = 1; i <= 15; i++)
+ if (code & (1 << i))
+ printf(" %s", detail[i - 1]);
+ }
diff --git a/sys-apps/dmidecode/metadata.xml b/sys-apps/dmidecode/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/dmidecode/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-apps/dmtcp/Manifest b/sys-apps/dmtcp/Manifest
new file mode 100644
index 000000000000..dcf81fbe5a26
--- /dev/null
+++ b/sys-apps/dmtcp/Manifest
@@ -0,0 +1 @@
+DIST dmtcp-1.2.6.tar.gz 936928 SHA256 ede0ef3544f08befe2b3df45d9087b4bfa02d52074cf805181c857f5de9fbfca SHA512 cc14e344b8a479be436c5ada90d15c3693436a0e009f03755d13cd86c645249e22258eade79c5b92e801866ec7fe5907956d12384bebb8c330450f6ba26c84a0 WHIRLPOOL d64ca8143c9943925c1a85ada9b54fe98da4722d57b42d4298ef1cf35782816d300f9aefa0e67fb3046d1f4fdc7c2fdd74450710e375ce4a78cdeed7e2f6d4f3
diff --git a/sys-apps/dmtcp/dmtcp-1.2.6.ebuild b/sys-apps/dmtcp/dmtcp-1.2.6.ebuild
new file mode 100644
index 000000000000..1ae1ab542fd3
--- /dev/null
+++ b/sys-apps/dmtcp/dmtcp-1.2.6.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit elisp-common eutils multilib
+
+DESCRIPTION="DMTCP is the Distributed MultiThreaded Checkpointing tool"
+HOMEPAGE="http://dmtcp.sourceforge.net/index.html"
+SRC_URI="mirror://sourceforge/dmtcp/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug emacs fast mpi trace"
+
+RDEPEND="sys-libs/readline
+ app-arch/gzip
+ sys-kernel/linux-headers
+ emacs? ( dev-lisp/clisp )
+ mpi? ( virtual/mpi )
+ || ( app-shells/dash
+ app-shells/zsh
+ app-shells/tcsh
+ )"
+
+DEPEND="${RDEPEND}
+ sys-devel/patch"
+
+src_configure() {
+ local myconf="--disable-stale-socket-handling"
+
+ if use debug; then
+ use trace && myconf=" ${myconf} --enable-ptrace-support"
+ myconf=" ${myconf} --disable-pid-virtualization"
+ fi
+
+ use fast && myconf=" ${myconf} --disable-pid-virtualization \
+ --enable-forked-checkpointing \
+ --enable-allocator"
+
+ use mpi && myconf=" ${myconf} --with-mpich=/usr/bin"
+
+ econf $(use_enable debug) $myconf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc TODO QUICK-START ${PN}/README
+
+ dodir /usr/share/${PF}/examples
+ mv "${D}"usr/$(get_libdir)/${PN}/examples "${D}"usr/share/${PF}/examples
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-apps/dmtcp/files/dmtcp-1.2.1-gcc46.patch b/sys-apps/dmtcp/files/dmtcp-1.2.1-gcc46.patch
new file mode 100644
index 000000000000..fd013e3b6ae7
--- /dev/null
+++ b/sys-apps/dmtcp/files/dmtcp-1.2.1-gcc46.patch
@@ -0,0 +1,21 @@
+--- a/dmtcp/src/Makefile.am
++++ b/dmtcp/src/Makefile.am
+@@ -66,7 +66,7 @@
+
+ dmtcp_inspector_SOURCES = dmtcp_inspector.cpp
+
+-dmtcphijack_so_LDFLAGS = -shared -avoid-version -module
++dmtcphijack_so_LDFLAGS = -shared -module
+
+ #dmtcp_nocheckpoint_LDFLAGS = -static
+
+--- a/dmtcp/src/dmtcpalloc.h
++++ b/dmtcp/src/dmtcpalloc.h
+@@ -33,6 +33,7 @@
+ #include <iostream>
+ #include <sstream>
+ #include <fstream>
++#include <cstddef>
+
+ #define DMTCPSTRING dmtcp::string
+ #define DMTCPVECTOR(T) dmtcp::vector<T>
diff --git a/sys-apps/dmtcp/metadata.xml b/sys-apps/dmtcp/metadata.xml
new file mode 100644
index 000000000000..154329b9ce83
--- /dev/null
+++ b/sys-apps/dmtcp/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>dev-tools</herd>
+ <use>
+ <flag name="fast">Enable experimental performance options such as mmap allocator.</flag>
+ <flag name="trace">Enable ptrace support (only valid with debug enabled).</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">dmtcp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/dnotify/Manifest b/sys-apps/dnotify/Manifest
new file mode 100644
index 000000000000..a0944bbb67d1
--- /dev/null
+++ b/sys-apps/dnotify/Manifest
@@ -0,0 +1 @@
+DIST dnotify-0.18.0.tar.gz 187909 RMD160 76836ad6025149d1063b20d438bd81100f818acb SHA1 47e36a7f01c65ea68e3e7955c617bd3187f4d24d SHA256 2c1a1aeb3b6471d9c17b769e86235fed4020f2009c6f6841728b94020df67bf1
diff --git a/sys-apps/dnotify/dnotify-0.18.0.ebuild b/sys-apps/dnotify/dnotify-0.18.0.ebuild
new file mode 100644
index 000000000000..74d8613ac83d
--- /dev/null
+++ b/sys-apps/dnotify/dnotify-0.18.0.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit eutils
+
+DESCRIPTION="Execute a command when the contents of a directory change"
+HOMEPAGE="http://directory.fsf.org/project/dnotify/"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips ppc -sparc x86"
+IUSE="nls"
+
+RDEPEND=""
+DEPEND="nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-nls.patch \
+ "${FILESDIR}"/${P}-glibc-212.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS TODO NEWS README
+}
diff --git a/sys-apps/dnotify/files/dnotify-0.18.0-glibc-212.patch b/sys-apps/dnotify/files/dnotify-0.18.0-glibc-212.patch
new file mode 100644
index 000000000000..6cc6e6f40092
--- /dev/null
+++ b/sys-apps/dnotify/files/dnotify-0.18.0-glibc-212.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/336649
+
+--- src/main.c
++++ src/main.c
+@@ -19,6 +19,7 @@
+
+ #include <config.h>
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #include <sys/wait.h>
+ #include <stdarg.h>
+ #include <errno.h>
diff --git a/sys-apps/dnotify/files/dnotify-0.18.0-nls.patch b/sys-apps/dnotify/files/dnotify-0.18.0-nls.patch
new file mode 100644
index 000000000000..7721ac1ee411
--- /dev/null
+++ b/sys-apps/dnotify/files/dnotify-0.18.0-nls.patch
@@ -0,0 +1,10 @@
+--- src/gettext.h.orig 2006-01-27 18:23:31.000000000 +0100
++++ src/gettext.h 2006-01-27 18:25:07.000000000 +0100
+@@ -24,6 +24,7 @@
+
+ /* Get declarations of GNU message catalog functions. */
+ # include <libintl.h>
++# include <locale.h>
+
+ #else
+
diff --git a/sys-apps/dnotify/metadata.xml b/sys-apps/dnotify/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/dnotify/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-apps/dog/Manifest b/sys-apps/dog/Manifest
new file mode 100644
index 000000000000..938907b76a9d
--- /dev/null
+++ b/sys-apps/dog/Manifest
@@ -0,0 +1 @@
+DIST dog-1.7.tar.gz 30433 RMD160 dd8867a5a8ff7208b92df8bc23a9b6b48cc74816 SHA1 a1af9c76daa0c9768cdf0c31839b3004e6ccc417 SHA256 6c5386d1b6401d6410baa8f0da343de5625cd3d59b6273dcee81997c372522ca
diff --git a/sys-apps/dog/dog-1.7-r4.ebuild b/sys-apps/dog/dog-1.7-r4.ebuild
new file mode 100644
index 000000000000..2bd8abc03dcd
--- /dev/null
+++ b/sys-apps/dog/dog-1.7-r4.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Dog is better than cat"
+# the best HOMEPAGE we have.
+HOMEPAGE="http://packages.gentoo.org/package/sys-apps/dog"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc64-solaris"
+IUSE=""
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-check-ctime.diff \
+ "${FILESDIR}"/${PV}-manpage-touchup.patch \
+ "${FILESDIR}"/${P}-64bit-goodness.patch \
+ "${FILESDIR}"/${P}-strfry.patch
+
+ if [[ "${CHOST}" == *-solaris* ]]
+ then
+ sed -i '/gcc.*-o dog/s/$/ -lsocket/' \
+ Makefile || die "sed Makefile failed"
+ fi
+
+ sed -i \
+ -e 's,^CFLAGS,#CFLAGS,' \
+ -e "s,gcc,$(tc-getCC)," \
+ -e 's:-o dog:$(LDFLAGS) -o dog:g' \
+ Makefile || die "sed Makefile failed"
+}
+
+src_install() {
+ dobin dog || die
+ doman dog.1 || die
+ dodoc README AUTHORS || die
+}
diff --git a/sys-apps/dog/files/1.7-manpage-touchup.patch b/sys-apps/dog/files/1.7-manpage-touchup.patch
new file mode 100644
index 000000000000..324c82696705
--- /dev/null
+++ b/sys-apps/dog/files/1.7-manpage-touchup.patch
@@ -0,0 +1,18 @@
+The correct syntax of the -w option does not have a space between
+the -w and the cols ... the manpage seems to imply differently though
+so let's fix it.
+
+http://bugs.gentoo.org/show_bug.cgi?id=69660
+
+--- dog.1
++++ dog.1
+@@ -8,3 +8,3 @@
+ .B dog
+-[\-AbBeEnstTuv] [\-w cols] [\-l lines]
++[\-AbBeEnstTuv] [\-w<cols>] [\-l lines]
+ [\-\-show\-all] [\-\-number\-nonblank] [\-\-no\-blanks] [\-\-bind=port]
+@@ -64,3 +64,3 @@
+ .TP
+-.I \-w n
++.I \-w<n>
+ Print first n characters of each line (default=80)
diff --git a/sys-apps/dog/files/dog-1.7-64bit-goodness.patch b/sys-apps/dog/files/dog-1.7-64bit-goodness.patch
new file mode 100644
index 000000000000..9143761852c1
--- /dev/null
+++ b/sys-apps/dog/files/dog-1.7-64bit-goodness.patch
@@ -0,0 +1,33 @@
+diff -ur dog-1.7/dog.c dog-1.7-64bit/dog.c
+--- dog-1.7/dog.c 2000-06-21 18:04:43.000000000 +0200
++++ dog-1.7-64bit/dog.c 2005-05-23 10:40:58.613766328 +0200
+@@ -38,22 +38,13 @@
+ #include <limits.h>
+ #include <netdb.h>
+
+-// this is fun
+-#if defined(__alpha)
+-#define uint16 unsigned short
+-#define int16 short
+-#define uint32 unsigned int
+-#define int32 int
+-#define uint64 unsigned long
+-#define int64 long
+-#else
+-#define uint16 unsigned short
+-#define int16 short
+-#define uint32 unsigned long
+-#define int32 long
+-#define uint64 unsigned long long
+-#define int64 long long
+-#endif
++#define uint16 uint16_t
++#define int16 int16_t
++#define uint32 uint32_t
++#define int32 int32_t
++#define uint64 uint64_t
++#define int64 int64_t
++
+ #if defined(__STDC__)
+ #define __dog_signed signed
+ #else
diff --git a/sys-apps/dog/files/dog-1.7-check-ctime.diff b/sys-apps/dog/files/dog-1.7-check-ctime.diff
new file mode 100644
index 000000000000..43f8aa0a8c91
--- /dev/null
+++ b/sys-apps/dog/files/dog-1.7-check-ctime.diff
@@ -0,0 +1,53 @@
+diff --exclude='*~' --exclude='.*' -I '# $Id$
+--- dog-1.7.orig/dog.c 2005-05-13 08:01:37.000000000 -0400
++++ dog-1.7/dog.c 2005-05-13 08:30:38.000000000 -0400
+@@ -36,6 +36,7 @@
+ #include <string.h>
+ #include "getopt.h"
+ #include <limits.h>
++#include <time.h>
+ #include <netdb.h>
+
+ // this is fun
+@@ -1321,26 +1322,35 @@
+ InetSockAddr sa;
+ int newsock;
+ uint32 ipAddr;
+- int k;
++ socklen_t k;
+ time_t curr_time;
+ char curr_date[64];
+
+ k = sizeof(sa);
+ while ((newsock=accept(sock,(struct sockaddr*)&sa,&k)) != -1) {
+ if (!no_bind_header) {
++ char *result = NULL;
+ ipAddr = ntohl(sa.addr);
+ time(&curr_time);
+- strcpy(curr_date,ctime(&curr_time));
++ if (!(result = ctime(&curr_time))) {
++ perror("ctime");
++ goto done;
++ }
++ strncpy(curr_date, result, sizeof(curr_date) - 1);
+ while (!isalnum(curr_date[strlen(curr_date)-1])) {
+ curr_date[strlen(curr_date)-1] = 0;
+ }
+ printf("# %s from %d.%d.%d.%d:%d\n",curr_date,(int)ipAddr>>24,(int)(ipAddr>>16)&0xff,(int)(ipAddr>>8)&0xff,(int)ipAddr&0xff,ntohs(sa.port));
+ }
+- straight_dump = newsock;
+- DumpThings(argc,argv,hang_up_bind ? -1 : newsock);
+- if (hang_up_bind) {
++
++ goto done;
++
++ done:
++ straight_dump = newsock;
++ DumpThings(argc,argv,hang_up_bind ? -1 : newsock);
++ if (hang_up_bind) {
+ close(newsock);
+- }
++ }
+ }
+ }
+
diff --git a/sys-apps/dog/files/dog-1.7-strfry.patch b/sys-apps/dog/files/dog-1.7-strfry.patch
new file mode 100644
index 000000000000..b62b815aed50
--- /dev/null
+++ b/sys-apps/dog/files/dog-1.7-strfry.patch
@@ -0,0 +1,13 @@
+See Gentoo bug 251675. Upstream appears to be dead.
+
+--- dog.c.orig 2009-04-09 23:29:16.307661147 -0500
++++ dog.c 2009-04-09 23:30:11.353664890 -0500
+@@ -552,7 +552,7 @@
+
+ // strfry()
+ #if ALLOW_STRFRY
+- if (opt_strfry) {
++ if (opt_strfry && str_len > 0) {
+ strfry(str);
+ }
+ #endif
diff --git a/sys-apps/dog/metadata.xml b/sys-apps/dog/metadata.xml
new file mode 100644
index 000000000000..40149c995561
--- /dev/null
+++ b/sys-apps/dog/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>shell-tools</herd>
+</pkgmetadata>
diff --git a/sys-apps/dstat/Manifest b/sys-apps/dstat/Manifest
new file mode 100644
index 000000000000..472eb7f68f95
--- /dev/null
+++ b/sys-apps/dstat/Manifest
@@ -0,0 +1,2 @@
+DIST dstat-0.6.9.tar.bz2 74060 SHA256 edb2c17d081ee2b0b4fc2c57c2ed6dc36628853abd76c838026e99b3d1ea897c
+DIST dstat-0.7.2.tar.bz2 85870 SHA256 34a986d9d7c028bd9dcb6b2ef1c740f7220de5c9cf976870a2b62aca23b33bae SHA512 276447c0f5492e4d2ac78f9f5b1d08e3565d26d02a7e6a22ef70f77b20f84d2b9ba806212860886139d401e4dfc2453c0dbc9ed82398ddec0ee75f5999080624 WHIRLPOOL 1f263026b137ac3f6bfb70d8840a52769505a6c55301607a4a6afae36fd084326922bf3f8edf5399df004a3d8f7dce165b5613e6729dc2944e8e6bf1674d2cb4
diff --git a/sys-apps/dstat/dstat-0.6.9-r1.ebuild b/sys-apps/dstat/dstat-0.6.9-r1.ebuild
new file mode 100644
index 000000000000..5f129b427b09
--- /dev/null
+++ b/sys-apps/dstat/dstat-0.6.9-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_DEPEND="2"
+
+inherit python eutils
+
+DESCRIPTION="Versatile replacement for vmstat, iostat and ifstat"
+HOMEPAGE="http://dag.wieers.com/home-made/dstat/"
+SRC_URI="http://dag.wieers.com/home-made/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 hppa ~ia64 ~mips ~ppc ~ppc64 sparc x86"
+IUSE=""
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-CVE-2009-3894.patch # 293497
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc \
+ AUTHORS ChangeLog README TODO \
+ examples/{mstat,read}.py docs/*.txt
+ dohtml docs/*.html
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/dstat
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/dstat
+}
diff --git a/sys-apps/dstat/dstat-0.7.2-r1.ebuild b/sys-apps/dstat/dstat-0.7.2-r1.ebuild
new file mode 100644
index 000000000000..3f93d849ceff
--- /dev/null
+++ b/sys-apps/dstat/dstat-0.7.2-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_DEPEND="2"
+
+inherit python eutils
+
+DESCRIPTION="Versatile replacement for vmstat, iostat and ifstat"
+HOMEPAGE="http://dag.wieers.com/home-made/dstat/"
+SRC_URI="http://dag.wieers.com/home-made/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
+IUSE="wifi"
+
+RDEPEND="wifi? ( net-wireless/python-wifi )"
+DEPEND=""
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_compile() {
+ true
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ python_convert_shebangs 2 "${ED}usr/bin/dstat"
+
+ dodoc \
+ AUTHORS ChangeLog README TODO \
+ examples/{mstat,read}.py docs/*.txt
+ dohtml docs/*.html
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/dstat
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/dstat
+}
diff --git a/sys-apps/dstat/files/dstat-0.6.9-CVE-2009-3894.patch b/sys-apps/dstat/files/dstat-0.6.9-CVE-2009-3894.patch
new file mode 100644
index 000000000000..042552b9a3bd
--- /dev/null
+++ b/sys-apps/dstat/files/dstat-0.6.9-CVE-2009-3894.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/show_bug.cgi?id=293497
+
+Index: dstat-0.6.9/dstat
+===================================================================
+--- dstat-0.6.9.orig/dstat
++++ dstat-0.6.9/dstat
+@@ -28,8 +28,6 @@ try:
+ inspath('/usr/local/share/dstat/')
+ inspath('/usr/share/dstat/')
+ inspath(os.path.abspath(os.path.dirname(sys.argv[0])) + '/plugins/') # binary path + /plugins/
+- inspath(os.getcwd() + '/plugins/') # current path + /plugins/
+- inspath(os.getcwd()) # current path
+ inspath(os.path.expanduser('~/.dstat/')) # home + /.dstat/
+ except KeyboardInterrupt, e:
+ pass
diff --git a/sys-apps/dstat/metadata.xml b/sys-apps/dstat/metadata.xml
new file mode 100644
index 000000000000..4903eb22ef7c
--- /dev/null
+++ b/sys-apps/dstat/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>wschlich@gentoo.org</email>
+ <name>Wolfram Schlich</name>
+ </maintainer>
+ <longdescription>
+Dstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes
+some of the limitations and adds some extra features.
+
+Dstat allows you to view all of your system resources instantly, you can eg.
+compare disk usage in combination with interrupts from your IDE controller, or
+compare the network bandwidth numbers directly with the disk throughput (in the
+same interval).
+ </longdescription>
+ <use>
+ <flag name="wifi">Enable wireless network functions</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/dtc/Manifest b/sys-apps/dtc/Manifest
new file mode 100644
index 000000000000..7fc19d27d520
--- /dev/null
+++ b/sys-apps/dtc/Manifest
@@ -0,0 +1,3 @@
+DIST dtc-1.4.1.tar.xz 107920 SHA256 77992ad8eac7b68f553d0ba58e5b51604ac803d126196c99e3ae38aaae28bb94 SHA512 63df730e65f62b8c9648cfee5461809188f4198cbf98de25fbe5cb7f2f43c405266abb740501740f59847dc6faf0588bcbc734d08ae5430b05c2601e070d6d05 WHIRLPOOL 93e9ed26024e4650bb2de6323ea639a3e52622aa3891a9f9404959b600d2c1cbc633d18e30d3629ac54ae662e8c58a7d0ca7910a9b323cd8dd4ff6e43a3fdf67
+DIST dtc-v1.3.0.tgz 108540 SHA256 4da48956d812e221f68d1d538cd58ca8ed7412af4ab9ef42a702db9173c372fe SHA512 4506eb4c3eaccabbf6773a3b0cbf3b174560e5004cf8af9f88448ad1371d1c57d793f078b2bd99b63714df538e74d6dfe16f112bc8283d412b1026f5f5c8220e WHIRLPOOL 4e87da05024d94998999a5e0090f91e4af4a66937dc6d5deec9bf7dd320fd9e732d30ccb6195dd0ce924c0f3c817d6af4731761e08dbc0e365e85ad8719e7935
+DIST dtc-v1.4.0.tar.xz 105160 SHA256 6df33a5da65fd43e0bc265a6c99104ca2962a97cf2d78171ed10d68e546ce198 SHA512 d0021c27e3614776db72c3d84cf05b98b1c49e14991ce12db6a90e9ac7d8aa248064f071c7a3b5bc9a20e9b22f070187778faa49bb3a5d0916afdfd9a929b743 WHIRLPOOL 366dd030aeaf042a7b60c7f900befaac124799d2db02c272d513615e08b208de26ab678c2dc48187f52f19bc2d5bcdf9b5694521298122706726e11ddaaa2afe
diff --git a/sys-apps/dtc/dtc-1.3.0-r1.ebuild b/sys-apps/dtc/dtc-1.3.0-r1.ebuild
new file mode 100644
index 000000000000..02bacac2b7cd
--- /dev/null
+++ b/sys-apps/dtc/dtc-1.3.0-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+MY_P="${PN}-v${PV}"
+
+inherit multilib toolchain-funcs eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.jdl.com/software/dtc.git"
+ inherit git-2
+else
+ SRC_URI="http://www.jdl.com/software/${MY_P}.tgz"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+fi
+
+DESCRIPTION="Open Firmware device-trees compiler"
+HOMEPAGE="http://git.jdl.com/gitweb/?p=dtc.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND=""
+DEPEND="sys-devel/flex
+ sys-devel/bison"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fdtdump.patch #372895
+ sed -i \
+ -e '/^CFLAGS =/s:=:+=:' \
+ -e '/^CPPFLAGS =/s:=:+=:' \
+ -e 's:-Werror::' \
+ -e 's:-g -Os::' \
+ -e '/^PREFIX =/s:=.*:= /usr:' \
+ -e "/^LIBDIR =/s:=.*:= /usr/$(get_libdir):" \
+ Makefile || die
+ tc-export AR CC
+ export V=1
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use static-libs || find "${ED}" -name '*.a' -delete
+ dodoc Documentation/manual.txt
+}
diff --git a/sys-apps/dtc/dtc-1.3.0.ebuild b/sys-apps/dtc/dtc-1.3.0.ebuild
new file mode 100644
index 000000000000..3ea96bc5d330
--- /dev/null
+++ b/sys-apps/dtc/dtc-1.3.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit toolchain-funcs
+
+MY_P="${PN}-v${PV}"
+
+DESCRIPTION="Open Firmware device-trees compiler"
+HOMEPAGE="http://www.t2-project.org/packages/dtc.html"
+SRC_URI="http://www.jdl.com/software/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc ppc64 x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="sys-devel/flex
+ sys-devel/bison"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i -e "s:CFLAGS =:CFLAGS +=:" \
+ -e "s:CPPFLAGS =:CPPFLAGS +=:" \
+ -e "s:-Werror::" \
+ -e "s:-g -Os::" \
+ Makefile || die
+}
+
+src_compile() {
+ tc-export AR CC
+ emake PREFIX="/usr" LIBDIR="/usr/$(get_libdir)"
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="/usr" LIBDIR="/usr/$(get_libdir)" \
+ install
+ dodoc Documentation/manual.txt
+}
diff --git a/sys-apps/dtc/dtc-1.4.0.ebuild b/sys-apps/dtc/dtc-1.4.0.ebuild
new file mode 100644
index 000000000000..af5971fa62e2
--- /dev/null
+++ b/sys-apps/dtc/dtc-1.4.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+MY_P="${PN}-v${PV}"
+
+inherit multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.jdl.com/software/dtc.git"
+ inherit git-2
+else
+ SRC_URI="http://www.jdl.com/software/${MY_P}.tar.xz"
+ KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86"
+fi
+
+DESCRIPTION="Open Firmware device-trees compiler"
+HOMEPAGE="http://git.jdl.com/gitweb/?p=dtc.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND=""
+DEPEND="app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS =/s:=:+=:' \
+ -e '/^CPPFLAGS =/s:=:+=:' \
+ -e 's:-Werror::' \
+ -e 's:-g -Os::' \
+ -e '/^PREFIX =/s:=.*:= /usr:' \
+ -e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(get_libdir):" \
+ Makefile || die
+ tc-export AR CC
+ export V=1
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use static-libs || find "${ED}" -name '*.a' -delete
+ dodoc Documentation/manual.txt
+}
diff --git a/sys-apps/dtc/dtc-1.4.1-r1.ebuild b/sys-apps/dtc/dtc-1.4.1-r1.ebuild
new file mode 100644
index 000000000000..a4f80e253c20
--- /dev/null
+++ b/sys-apps/dtc/dtc-1.4.1-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib toolchain-funcs eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/software/utils/${PN}/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+fi
+
+DESCRIPTION="Open Firmware device tree compiler"
+HOMEPAGE="http://devicetree.org/Device_Tree_Compiler"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND=""
+DEPEND="app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-missing-syms.patch
+ epatch "${FILESDIR}"/${P}-echo-n.patch
+ sed -i \
+ -e '/^CFLAGS =/s:=:+=:' \
+ -e '/^CPPFLAGS =/s:=:+=:' \
+ -e 's:-Werror::' \
+ -e 's:-g -Os::' \
+ -e "/^PREFIX =/s:=.*:= ${EPREFIX}/usr:" \
+ -e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(get_libdir):" \
+ Makefile || die
+ tc-export AR CC
+ export V=1
+}
+
+src_test() {
+ # Enable parallel tests.
+ emake check
+}
+
+src_install() {
+ default
+ use static-libs || find "${ED}" -name '*.a' -delete
+ dodoc Documentation/manual.txt
+}
diff --git a/sys-apps/dtc/dtc-1.4.1.ebuild b/sys-apps/dtc/dtc-1.4.1.ebuild
new file mode 100644
index 000000000000..97f68422844b
--- /dev/null
+++ b/sys-apps/dtc/dtc-1.4.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/software/utils/${PN}/${P}.tar.xz"
+ KEYWORDS="amd64 arm ~arm64 ppc ppc64 x86"
+fi
+
+DESCRIPTION="Open Firmware device tree compiler"
+HOMEPAGE="http://devicetree.org/Device_Tree_Compiler"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND=""
+DEPEND="app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison"
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS =/s:=:+=:' \
+ -e '/^CPPFLAGS =/s:=:+=:' \
+ -e 's:-Werror::' \
+ -e 's:-g -Os::' \
+ -e "/^PREFIX =/s:=.*:= ${EPREFIX}/usr:" \
+ -e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(get_libdir):" \
+ Makefile || die
+ tc-export AR CC
+ export V=1
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use static-libs || find "${ED}" -name '*.a' -delete
+ dodoc Documentation/manual.txt
+}
diff --git a/sys-apps/dtc/dtc-9999.ebuild b/sys-apps/dtc/dtc-9999.ebuild
new file mode 100644
index 000000000000..7550c05bc8b8
--- /dev/null
+++ b/sys-apps/dtc/dtc-9999.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 toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/software/utils/${PN}/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+fi
+
+DESCRIPTION="Open Firmware device tree compiler"
+HOMEPAGE="http://devicetree.org/Device_Tree_Compiler"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="static-libs"
+
+RDEPEND=""
+DEPEND="app-arch/xz-utils
+ sys-devel/flex
+ sys-devel/bison"
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS =/s:=:+=:' \
+ -e '/^CPPFLAGS =/s:=:+=:' \
+ -e 's:-Werror::' \
+ -e 's:-g -Os::' \
+ -e "/^PREFIX =/s:=.*:= ${EPREFIX}/usr:" \
+ -e "/^LIBDIR =/s:=.*:= \$(PREFIX)/$(get_libdir):" \
+ Makefile || die
+ tc-export AR CC
+ export V=1
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ use static-libs || find "${ED}" -name '*.a' -delete
+ dodoc Documentation/manual.txt
+}
diff --git a/sys-apps/dtc/files/dtc-1.3.0-fdtdump.patch b/sys-apps/dtc/files/dtc-1.3.0-fdtdump.patch
new file mode 100644
index 000000000000..0bb1c8c88742
--- /dev/null
+++ b/sys-apps/dtc/files/dtc-1.3.0-fdtdump.patch
@@ -0,0 +1,118 @@
+https://bugs.gentoo.org/372895
+
+From 8f459c5d72673e1a3a119ac58a7eee56236fca73 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 25 Oct 2011 17:29:24 -0400
+Subject: [PATCH] fdtdump: rename from ftdump
+
+The freetype package already installs a binary named "ftdump", so the dtc
+package conflicts with that. So rename the newer dtc tool to "fdtdump".
+This even makes a bit more sense:
+ ftdump: [F]lat device [T]ree [dump]
+ fdtdump: [F]lat [D]evice [T]ree [dump]
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Acked-by: David Gibson <david@gibson.dropbear.id.au>
+---
+ .gitignore | 2 +-
+ Documentation/manual.txt | 10 +++++-----
+ Makefile | 6 +++---
+ Makefile.utils | 6 +++---
+ ftdump.c => fdtdump.c | 2 +-
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+ rename ftdump.c => fdtdump.c (97%)
+
+diff --git a/Documentation/manual.txt b/Documentation/manual.txt
+index f8a8a7b..14508f3 100644
+--- a/Documentation/manual.txt
++++ b/Documentation/manual.txt
+@@ -21,7 +21,7 @@ III - libfdt
+
+ IV - Utility Tools
+ 1) convert-dtsv0 -- Conversion to Version 1
+- 1) ftdump
++ 1) fdtdump
+
+
+ I - "dtc", the device tree compiler
+@@ -643,10 +643,10 @@ a new file with a "v1" appended the filename.
+ Comments, empty lines, etc. are preserved.
+
+
+-2) ftdump -- Flat Tree dumping utility
++2) fdtdump -- Flat Device Tree dumping utility
+
+-The ftdump program prints a readable version of a flat device tree file.
++The fdtdump program prints a readable version of a flat device tree file.
+
+-The syntax of the ftdump command line is:
++The syntax of the fdtdump command line is:
+
+- ftdump <DTB-file-name>
++ fdtdump <DTB-file-name>
+diff --git a/Makefile b/Makefile
+index b32409b..4582f5d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -109,7 +109,7 @@ include Makefile.utils
+
+ BIN += convert-dtsv0
+ BIN += dtc
+-BIN += ftdump
++BIN += fdtdump
+
+ SCRIPTS = dtdiff
+
+@@ -119,7 +119,7 @@ all: $(BIN) libfdt
+ ifneq ($(DEPTARGETS),)
+ -include $(DTC_OBJS:%.o=%.d)
+ -include $(CONVERT_OBJS:%.o=%.d)
+--include $(FTDUMP_OBJS:%.o=%.d)
++-include $(FDTDUMP_OBJS:%.o=%.d)
+ endif
+
+
+@@ -178,7 +178,7 @@ convert-dtsv0: $(CONVERT_OBJS)
+ @$(VECHO) LD $@
+ $(LINK.c) -o $@ $^
+
+-ftdump: $(FTDUMP_OBJS)
++fdtdump: $(FDTDUMP_OBJS)
+
+
+ #
+diff --git a/Makefile.utils b/Makefile.utils
+index 0ed9297..fae5b00 100644
+--- a/Makefile.ftdump
++++ b/Makefile.ftdump
+@@ -4,8 +4,8 @@
+ # into other systems of Makefiles.
+ #
+
+-FTDUMP_SRCS = \
+- ftdump.c
++FDTDUMP_SRCS = \
++ fdtdump.c
+
+-FTDUMP_GEN_SRCS =
++FDTDUMP_GEN_SRCS =
+
+-FTDUMP_OBJS = $(FTDUMP_SRCS:%.c=%.o) $(FTDUMP_GEN_SRCS:%.c=%.o)
++FDTDUMP_OBJS = $(FDTDUMP_SRCS:%.c=%.o) $(FDTDUMP_GEN_SRCS:%.c=%.o)
+diff --git a/ftdump.c b/fdtdump.c
+similarity index 97%
+rename from ftdump.c
+rename to fdtdump.c
+index cc55fe2..207a46d 100644
+--- a/ftdump.c
++++ b/fdtdump.c
+@@ -1,5 +1,5 @@
+ /*
+- * ftdump.c - Contributed by Pantelis Antoniou <pantelis.antoniou AT gmail.com>
++ * fdtdump.c - Contributed by Pantelis Antoniou <pantelis.antoniou AT gmail.com>
+ */
+
+ #include <stdint.h>
+--
+1.7.12.4
+
diff --git a/sys-apps/dtc/files/dtc-1.4.1-echo-n.patch b/sys-apps/dtc/files/dtc-1.4.1-echo-n.patch
new file mode 100644
index 000000000000..cd45b952a49e
--- /dev/null
+++ b/sys-apps/dtc/files/dtc-1.4.1-echo-n.patch
@@ -0,0 +1,95 @@
+From ed3d76cd1c8f91f5e86424e899448d6221b0f76c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Wed, 6 May 2015 01:53:39 -0400
+Subject: [PATCH] tests: convert `echo -n` to `printf`
+
+The -n option is not standard in POSIX, so convert to printf which should
+work the same in every shell.
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+---
+ tests/run_tests.sh | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/tests/run_tests.sh b/tests/run_tests.sh
+index c870432..0dda54a 100755
+--- a/tests/run_tests.sh
++++ b/tests/run_tests.sh
+@@ -42,20 +42,20 @@ base_run_test() {
+
+ shorten_echo () {
+ limit=32
+- echo -n "$1"
++ printf "$1"
+ shift
+ for x; do
+ if [ ${#x} -le $limit ]; then
+- echo -n " $x"
++ printf " $x"
+ else
+ short=$(echo "$x" | head -c$limit)
+- echo -n " \"$short\"...<${#x} bytes>"
++ printf " \"$short\"...<${#x} bytes>"
+ fi
+ done
+ }
+
+ run_test () {
+- echo -n "$@: "
++ printf "$@: "
+ if [ -n "$VALGRIND" -a -f $1.supp ]; then
+ VGSUPP="--suppressions=$1.supp"
+ fi
+@@ -63,7 +63,7 @@ run_test () {
+ }
+
+ run_sh_test () {
+- echo -n "$@: "
++ printf "$@: "
+ base_run_test sh "$@"
+ }
+
+@@ -106,12 +106,12 @@ wrap_error () {
+
+ run_wrap_error_test () {
+ shorten_echo "$@"
+- echo -n " {!= 0}: "
++ printf " {!= 0}: "
+ base_run_test wrap_error "$@"
+ }
+
+ run_dtc_test () {
+- echo -n "dtc $@: "
++ printf "dtc $@: "
+ base_run_test wrap_test $VALGRIND $DTC "$@"
+ }
+
+@@ -126,7 +126,7 @@ asm_to_so_test () {
+ run_fdtget_test () {
+ expect="$1"
+ shift
+- echo -n "fdtget-runtest.sh "$expect" $@: "
++ printf "fdtget-runtest.sh "$expect" $@: "
+ base_run_test sh fdtget-runtest.sh "$expect" "$@"
+ }
+
+@@ -134,14 +134,14 @@ run_fdtput_test () {
+ expect="$1"
+ shift
+ shorten_echo fdtput-runtest.sh "$expect" "$@"
+- echo -n ": "
++ printf ": "
+ base_run_test sh fdtput-runtest.sh "$expect" "$@"
+ }
+
+ run_fdtdump_test() {
+ file="$1"
+ shorten_echo fdtdump-runtest.sh "$file"
+- echo -n ": "
++ printf ": "
+ base_run_test sh fdtdump-runtest.sh "$file"
+ }
+
+--
+2.4.0
+
diff --git a/sys-apps/dtc/files/dtc-1.4.1-missing-syms.patch b/sys-apps/dtc/files/dtc-1.4.1-missing-syms.patch
new file mode 100644
index 000000000000..7057be7bd8ac
--- /dev/null
+++ b/sys-apps/dtc/files/dtc-1.4.1-missing-syms.patch
@@ -0,0 +1,30 @@
+From a4b093f7366fdb429ca1781144d3985fa50d0fbb Mon Sep 17 00:00:00 2001
+From: Julien Grall <julien.grall@linaro.org>
+Date: Tue, 17 Mar 2015 16:00:34 +0000
+Subject: [PATCH] libfdt: Add missing functions to shared library
+
+The commit 4e76ec7 "libfdt: Add fdt_next_subnode() to permit easy
+subnode iteration" adds new functions (fdt_{first,next}_subnode) but
+forgot to mark them as 'global' in the shared library.
+
+Signed-off-by: Julien Grall <julien.grall@linaro.org>
+---
+ libfdt/version.lds | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libfdt/version.lds b/libfdt/version.lds
+index 80b322b..941208e 100644
+--- a/libfdt/version.lds
++++ b/libfdt/version.lds
+@@ -54,6 +54,8 @@ LIBFDT_1.2 {
+ fdt_get_property_by_offset;
+ fdt_getprop_by_offset;
+ fdt_next_property_offset;
++ fdt_first_subnode;
++ fdt_next_subnode;
+
+ local:
+ *;
+--
+2.4.0
+
diff --git a/sys-apps/dtc/metadata.xml b/sys-apps/dtc/metadata.xml
new file mode 100644
index 000000000000..ccba990cce68
--- /dev/null
+++ b/sys-apps/dtc/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>
+<maintainer>
+ <email>lu_zero@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/ed/Manifest b/sys-apps/ed/Manifest
new file mode 100644
index 000000000000..098f79c08eac
--- /dev/null
+++ b/sys-apps/ed/Manifest
@@ -0,0 +1,3 @@
+DIST ed-1.10.tar.lz 63717 SHA256 9540092c12309b2f4a294fdb8f5bd25f1ad5906a627518486e7733576a637e9a SHA512 b9c59de852609930d2a872f3d9af9ac12be8e80f3d2af49e3626cd909ba46ed4a4260844c636562cd479c5529a116055705260327f61304d8eaf88db6a60059a WHIRLPOOL 7130abba638202e06e078b9e60c9f83e6216fc0cd73891df08eda4a06044b9783a8f974b70dfb8452bdbc7c090bea3776c45b743e7a05bf9988197b51de729d8
+DIST ed-1.11.tar.gz 88303 SHA256 141dba3311e6295898d1b64e86263e40b8e85e3ab4ee4954859a3d3017511041 SHA512 09d86be3442a2e7eba0d1a008752a988324d3fa3e7870c3fffb00cb96f3433b3af3506105a1a6bc97a66754d994f6613c7a233417a4ddc32129adab055ad46b0 WHIRLPOOL 79fcb5436d0bcf9899a9af2abe3911000af136ff28e296ad9c26bf9717bf31f97a843700093baf598f4b5ed892f4a4cdfd2179381fcc4ecd53a55094877f7344
+DIST ed-1.12.tar.gz 87974 SHA256 f2c126d6ec1e5ccfccba05c749d6adf45e84011523ff0c31f595ad41ba892c84 SHA512 546a60e53b45c6416e91239a672e97ee9ce499e4c6d998e278a3870364da0b312e9d3fe681b1c11783d1f3342449502f3ac4d9eb3172c5e7c3b202d82fcb5989 WHIRLPOOL 6d94863786a06f508285ff7e4ca1dbf581a70a109359c101efefe22f070cb3bab46b16bea6110ed9d3894ccdab815ba8b3ff1119ccfe0cf6ea3257e1d27f0980
diff --git a/sys-apps/ed/ed-1.10.ebuild b/sys-apps/ed/ed-1.10.ebuild
new file mode 100644
index 000000000000..241de6ff4df7
--- /dev/null
+++ b/sys-apps/ed/ed-1.10.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs unpacker
+
+DESCRIPTION="Your basic line editor"
+HOMEPAGE="http://www.gnu.org/software/ed/"
+SRC_URI="mirror://gnu/ed/${P}.tar.lz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+DEPEND="$(unpacker_src_uri_depends)
+ sys-apps/texinfo"
+RDEPEND=""
+
+src_configure() {
+ # Upstream configure script is moronic.
+ econf \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${CFLAGS} ${LDFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
+ --bindir="${EPREFIX}/bin"
+}
diff --git a/sys-apps/ed/ed-1.11.ebuild b/sys-apps/ed/ed-1.11.ebuild
new file mode 100644
index 000000000000..206311ba7d47
--- /dev/null
+++ b/sys-apps/ed/ed-1.11.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Your basic line editor"
+HOMEPAGE="http://www.gnu.org/software/ed/"
+#SRC_URI="mirror://gnu/ed/${P}.tar.lz"
+# Using gzip instead -- the filesize diff is small and lzip uncommon #545344
+SRC_URI="http://fossies.org/linux/privat/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+DEPEND="sys-apps/texinfo"
+RDEPEND=""
+
+src_configure() {
+ # Upstream configure script is moronic.
+ econf \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${CFLAGS} ${LDFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
+ --bindir="${EPREFIX}/bin"
+}
diff --git a/sys-apps/ed/ed-1.12.ebuild b/sys-apps/ed/ed-1.12.ebuild
new file mode 100644
index 000000000000..206311ba7d47
--- /dev/null
+++ b/sys-apps/ed/ed-1.12.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Your basic line editor"
+HOMEPAGE="http://www.gnu.org/software/ed/"
+#SRC_URI="mirror://gnu/ed/${P}.tar.lz"
+# Using gzip instead -- the filesize diff is small and lzip uncommon #545344
+SRC_URI="http://fossies.org/linux/privat/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+DEPEND="sys-apps/texinfo"
+RDEPEND=""
+
+src_configure() {
+ # Upstream configure script is moronic.
+ econf \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${CFLAGS} ${LDFLAGS}" \
+ CPPFLAGS="${CPPFLAGS}" \
+ --bindir="${EPREFIX}/bin"
+}
diff --git a/sys-apps/ed/files/ed-1.5-build.patch b/sys-apps/ed/files/ed-1.5-build.patch
new file mode 100644
index 000000000000..83ee9c20cfb6
--- /dev/null
+++ b/sys-apps/ed/files/ed-1.5-build.patch
@@ -0,0 +1,32 @@
+http://lists.gnu.org/archive/html/bug-ed/2008-12/msg00001.html
+
+2007-04-16 Mike Frysinger <vapier@gentoo.org>
+
+ * Do not set CC/CXX/CPPFLAGS/LDFLAGS to "" so that user can
+ override if they so choose.
+ * Only set CFLAGS/CXXFLAGS if user did not specify any.
+
+--- ed-1.0/configure
++++ ed-1.0/configure
+@@ -26,10 +26,6 @@
+ mandir='$(datadir)/man'
+ sysconfdir='$(prefix)/etc'
+ program_prefix=
+-CC=
+-CPPFLAGS=
+-CFLAGS='-Wall -W -O2'
+-LDFLAGS=
+
+ # Loop over all args
+ while [ -n "$1" ] ; do
+@@ -105,6 +101,10 @@
+ esac
+ done
+
++# Defaults if the user did not select any
++if [ x"${CFLAGS+set}" != xset ] ; then
++ CFLAGS='-Wall -W -O2'
++fi
+ # Find the source files, if location was not specified.
+ srcdirtext=
+ if [ -z "${srcdir}" ] ; then
diff --git a/sys-apps/ed/metadata.xml b/sys-apps/ed/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/ed/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-apps/edac-utils/Manifest b/sys-apps/edac-utils/Manifest
new file mode 100644
index 000000000000..64f13b635f4e
--- /dev/null
+++ b/sys-apps/edac-utils/Manifest
@@ -0,0 +1 @@
+DIST edac-utils-0.18.tar.gz 285909 SHA256 2a027dbde6c3095807c9fbfa0025bedad38fc839e9967707c1986089ff4c8750 SHA512 5c81b11c28e8fb3198f2d656171493877393024d9e31233c252d358d8029aa83065e7b66ea87d742518f710466c9ba7dfcf57a1641374ce169cf95fd379101fa WHIRLPOOL e7af26138378e784c36c43d85b0d2449b5d5606d217dc8bc217f0720effb0fd6d5c4ab5b933e3e38cfadd5e5e51b47559d1a947bcc3df2ec8c8138eec7507b58
diff --git a/sys-apps/edac-utils/edac-utils-0.18.ebuild b/sys-apps/edac-utils/edac-utils-0.18.ebuild
new file mode 100644
index 000000000000..9229f96e9564
--- /dev/null
+++ b/sys-apps/edac-utils/edac-utils-0.18.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 eutils
+
+DESCRIPTION="Userspace helper for Linux kernel EDAC drivers"
+HOMEPAGE="https://github.com/grondo/edac-utils"
+SRC_URI="https://github.com/grondo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64"
+IUSE="debug"
+
+DEPEND="sys-fs/sysfsutils"
+RDEPEND="${DEPEND}
+ sys-apps/dmidecode"
+
+src_configure() {
+ econf \
+ --disable-static \
+ $(use_enable debug)
+}
+
+src_install() {
+ default
+
+ # We don't need this init.d file
+ # Modules should be loaded by adding them to /etc/conf.d/modules
+ # The rest is done via the udev-rule
+ rm -rf "${D}/etc/init.d"
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ elog "There must be an entry for your mainboard in /etc/edac/labels.db"
+ elog "in case you want nice labels in /sys/module/*_edac/"
+ elog "Run the following command to check whether such an entry is already available:"
+ elog " edac-ctl --print-labels"
+}
diff --git a/sys-apps/edac-utils/metadata.xml b/sys-apps/edac-utils/metadata.xml
new file mode 100644
index 000000000000..1e6fed43bcf5
--- /dev/null
+++ b/sys-apps/edac-utils/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>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">grondo/edac-utils</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/elfix/Manifest b/sys-apps/elfix/Manifest
new file mode 100644
index 000000000000..71ba474647dc
--- /dev/null
+++ b/sys-apps/elfix/Manifest
@@ -0,0 +1,2 @@
+DIST elfix-0.8.4.tar.gz 374742 SHA256 374be66da3dddef485bbb5e95bfcab6fd0c2db478255bddd10079730ada5260b SHA512 10aacc3fff33c934e2d4487d174a2b0cec10ffb7a35fc72b160c786f82f0355f3a2dea716bc7fb929d2919cc32a26844f37f9d73064b755098bdaa72e8075bda WHIRLPOOL b04e099f188c0b76d8c07abd76559c1313854aa83a03ad69afb72674d93cde6ce538ae10d0fea3be5495937e72a4b98fdd36efbb2e3aa8ff23c1d9f7f943c1ae
+DIST elfix-0.9.0.tar.gz 372014 SHA256 8b547d987edb2f7dc23ddf30f959d7d051a9ed49810f983b8fe6c489fe731cf0 SHA512 fd9bab90d745f77429c902acd2a14f615132731b3c38929dce764f1e5f7ee8f6478a6fef7ce0cb38e7ebd9181ba57965ff0c97da5e01d0fbf2cfb940ed691ebf WHIRLPOOL c09fa2193b990a506cae17f370ec10fa6302e17d2a165e42eceb88644f8a92e297c839ad788204e213d8205695b65557a7dcef5f6417177c434c8d0a34bd5eb7
diff --git a/sys-apps/elfix/elfix-0.8.4.ebuild b/sys-apps/elfix/elfix-0.8.4.ebuild
new file mode 100644
index 000000000000..15bc8083ce0d
--- /dev/null
+++ b/sys-apps/elfix/elfix-0.8.4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="A suite of tools to work with ELF objects on Hardened Gentoo"
+HOMEPAGE="http://www.gentoo.org/proj/en/hardened/pax-quickstart.xml
+ http://dev.gentoo.org/~blueness/elfix/"
+SRC_URI="http://dev.gentoo.org/~blueness/elfix/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="+ptpax +xtpax"
+
+REQUIRED_USE="|| ( ptpax xtpax )"
+
+# These only work with a properly configured PaX kernel
+RESTRICT="test"
+
+DEPEND="~dev-python/pypax-${PV}[ptpax=,xtpax=]
+ ptpax? ( dev-libs/elfutils )
+ xtpax? ( sys-apps/attr )"
+
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ rm -f "${S}/scripts/setup.py"
+ econf --disable-tests \
+ $(use_enable ptpax) \
+ $(use_enable xtpax)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog INSTALL README THANKS TODO
+}
diff --git a/sys-apps/elfix/elfix-0.9.0-r1.ebuild b/sys-apps/elfix/elfix-0.9.0-r1.ebuild
new file mode 100644
index 000000000000..38150a85e180
--- /dev/null
+++ b/sys-apps/elfix/elfix-0.9.0-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="A suite of tools to work with ELF objects on Hardened Gentoo"
+HOMEPAGE="http://www.gentoo.org/proj/en/hardened/pax-quickstart.xml
+ http://dev.gentoo.org/~blueness/elfix/"
+SRC_URI="http://dev.gentoo.org/~blueness/elfix/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE="+ptpax +xtpax"
+
+REQUIRED_USE="|| ( ptpax xtpax )"
+
+# These only work with a properly configured PaX kernel
+RESTRICT="test"
+
+DEPEND="~dev-python/pypax-${PV}[ptpax=,xtpax=]
+ ptpax? ( dev-libs/elfutils )
+ xtpax? ( sys-apps/attr )"
+
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-backport-fix-paxmark_sh.patch
+ epatch "${FILESDIR}"/${P}-backport-fix-revdep-pax.patch
+}
+
+src_configure() {
+ rm -f "${S}/scripts/setup.py"
+ econf --disable-tests \
+ $(use_enable ptpax) \
+ $(use_enable xtpax)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog INSTALL README THANKS TODO
+}
diff --git a/sys-apps/elfix/files/elfix-0.9.0-backport-fix-paxmark_sh.patch b/sys-apps/elfix/files/elfix-0.9.0-backport-fix-paxmark_sh.patch
new file mode 100644
index 000000000000..86be00ee46c2
--- /dev/null
+++ b/sys-apps/elfix/files/elfix-0.9.0-backport-fix-paxmark_sh.patch
@@ -0,0 +1,57 @@
+From 84ca11706f804d6c808d932700a90cc8eaab2f15 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sun, 21 Dec 2014 10:37:00 -0500
+Subject: [PATCH 1/2] scripts/paxmark.sh: source make.conf and properly set
+ PAX_MARKINGS
+
+---
+ ChangeLog | 6 ++++++
+ scripts/paxmark.sh | 6 +++---
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index f64e57a..d9993b1 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2014-12-22
++
++ * scripts/paxmark.sh: remove erroneous elog functions
++ * scripts/paxmark.sh: source /etc/portage/make.conf for PAX_MARKINGS
++ and correct logic to default to PT only if no PAX_MARKINGS are set.
++ Reported by Karl-Johan Karlsson <creideiki+gentoo-hardened@ferretporn.se>
+
+ 2014-10-03
+
+diff --git a/scripts/paxmark.sh b/scripts/paxmark.sh
+index 9ec077a..408e6aa 100755
+--- a/scripts/paxmark.sh
++++ b/scripts/paxmark.sh
+@@ -53,7 +53,6 @@ paxmarksh() {
+ scanelf -Xxz ${flags} "$f" >/dev/null 2>&1
+ #We failed to set PT_PAX flags
+ elif [[ ${PAX_MARKINGS} != "none" ]]; then
+- elog "Failed to set PT_PAX markings -${flags} ${f}."
+ ret=1
+ fi
+ done
+@@ -79,7 +78,6 @@ paxmarksh() {
+
+ #We failed to set XATTR_PAX flags
+ if [[ ${PAX_MARKINGS} != "none" ]]; then
+- elog "Failed to set XATTR_PAX markings -${flags} ${f}."
+ ret=1
+ fi
+ done
+@@ -88,5 +86,7 @@ paxmarksh() {
+ return ${ret}
+ }
+
+-PAX_MARKINGS=${PAX_MARKINGS:="PT XT"}
++MAKE_CONF="/etc/portage/make.conf"
++[[ -e $MAKE_CONF ]] && source $MAKE_CONF
++PAX_MARKINGS=${PAX_MARKINGS:="PT"}
+ paxmarksh "$@"
+--
+2.0.5
+
diff --git a/sys-apps/elfix/files/elfix-0.9.0-backport-fix-revdep-pax.patch b/sys-apps/elfix/files/elfix-0.9.0-backport-fix-revdep-pax.patch
new file mode 100644
index 000000000000..e92769eece76
--- /dev/null
+++ b/sys-apps/elfix/files/elfix-0.9.0-backport-fix-revdep-pax.patch
@@ -0,0 +1,25 @@
+From 581b53b3c1ca3166dc394d1f4b08260bd088c346 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Mon, 22 Dec 2014 12:30:12 -0500
+Subject: [PATCH 2/2] scripts/revdep-pax: change .get_maps() to .get_graph()
+
+---
+ scripts/revdep-pax | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/revdep-pax b/scripts/revdep-pax
+index a718fd6..7c1cf85 100755
+--- a/scripts/revdep-pax
++++ b/scripts/revdep-pax
+@@ -465,7 +465,7 @@ def run_soname(name, verbose, use_soname, mark, allyes, executable_only):
+ shell_path = os.getenv('PATH').split(':')
+
+ (object_linkings, object_reverse_linkings,
+- library2soname, soname2library) = LinkGraph().get_maps()
++ library2soname, soname2library) = LinkGraph().get_graph()
+
+ if use_soname:
+ soname = name
+--
+2.0.5
+
diff --git a/sys-apps/elfix/metadata.xml b/sys-apps/elfix/metadata.xml
new file mode 100644
index 000000000000..870245044b50
--- /dev/null
+++ b/sys-apps/elfix/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>hardened</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name='xtpax'>Enable XATTR_PAX_FLAGS support.</flag>
+ <flag name='ptpax'>Enable PT_PAX_FLAGS support.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/entropy-server/Manifest b/sys-apps/entropy-server/Manifest
new file mode 100644
index 000000000000..520d012e476c
--- /dev/null
+++ b/sys-apps/entropy-server/Manifest
@@ -0,0 +1 @@
+DIST entropy-254.tar.bz2 18516662 SHA256 5e411472eaf7016a68a4aa81ef92dd3aad8403fc65a0ffb09c57b91c959ca3a6 SHA512 3b3e82abad8008720e370b7892b7be1c48aaa6605914db977f68b9a108ada0a4adbaa5b7b50a9a02ba9c8b0bdefadcda1eceee2c7c2abc385b3daf669649e2da WHIRLPOOL 593469b858707e4ceca56146fa1d608141e44dda0a0921ed6a3ec566878c1e3c153410233f088d57db4f8bd9d1c796bd945cbea3ba455572efc05eca42023ce5
diff --git a/sys-apps/entropy-server/entropy-server-254.ebuild b/sys-apps/entropy-server/entropy-server-254.ebuild
new file mode 100644
index 000000000000..8a90ea005fc1
--- /dev/null
+++ b/sys-apps/entropy-server/entropy-server-254.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 bash-completion-r1
+
+DESCRIPTION="Entropy Package Manager server-side tools"
+HOMEPAGE="http://www.sabayon.org"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="+matter"
+
+SRC_URI="mirror://sabayon/sys-apps/entropy-${PV}.tar.bz2"
+
+S="${WORKDIR}/entropy-${PV}/server"
+
+RDEPEND="~sys-apps/entropy-${PV}[${PYTHON_USEDEP}]
+ matter? ( ~app-admin/matter-${PV}[entropy] )
+ ${PYTHON_DEPS}
+ "
+DEPEND="app-text/asciidoc"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ newbashcomp "${S}/eit-completion.bash" eit
+
+ python_optimize "${D}/usr/lib/entropy/server"
+}
diff --git a/sys-apps/entropy-server/metadata.xml b/sys-apps/entropy-server/metadata.xml
new file mode 100644
index 000000000000..7a9ce413fd0d
--- /dev/null
+++ b/sys-apps/entropy-server/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>lxnay@gentoo.org</email>
+ <name>Fabio Erculiani</name>
+ </maintainer>
+ <use>
+ <flag name='matter'>Pull in app-admin/matter</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/sys-apps/entropy/Manifest b/sys-apps/entropy/Manifest
new file mode 100644
index 000000000000..520d012e476c
--- /dev/null
+++ b/sys-apps/entropy/Manifest
@@ -0,0 +1 @@
+DIST entropy-254.tar.bz2 18516662 SHA256 5e411472eaf7016a68a4aa81ef92dd3aad8403fc65a0ffb09c57b91c959ca3a6 SHA512 3b3e82abad8008720e370b7892b7be1c48aaa6605914db977f68b9a108ada0a4adbaa5b7b50a9a02ba9c8b0bdefadcda1eceee2c7c2abc385b3daf669649e2da WHIRLPOOL 593469b858707e4ceca56146fa1d608141e44dda0a0921ed6a3ec566878c1e3c153410233f088d57db4f8bd9d1c796bd945cbea3ba455572efc05eca42023ce5
diff --git a/sys-apps/entropy/entropy-254.ebuild b/sys-apps/entropy/entropy-254.ebuild
new file mode 100644
index 000000000000..4fe9e8d7b03a
--- /dev/null
+++ b/sys-apps/entropy/entropy-254.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit eutils python-single-r1 user
+
+DESCRIPTION="Entropy Package Manager foundation library"
+HOMEPAGE="http://www.sabayon.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86"
+
+IUSE=""
+SRC_URI="mirror://sabayon/${CATEGORY}/${P}.tar.bz2"
+
+RDEPEND=">=app-misc/pax-utils-0.7
+ dev-db/sqlite:3[soundex(+)]
+ net-misc/rsync
+ sys-apps/diffutils
+ sys-apps/sandbox
+ >=sys-apps/portage-2.1.9[${PYTHON_USEDEP}]
+ sys-devel/gettext
+ ${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ dev-util/intltool"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${S}/lib"
+
+REPO_CONFPATH="${ROOT}/etc/entropy/repositories.conf"
+REPO_D_CONFPATH="${ROOT}/etc/entropy/repositories.conf.d"
+ENTROPY_CACHEDIR="${ROOT}/var/lib/entropy/caches"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ # Can:
+ # - update repos
+ # - update security advisories
+ # - handle on-disk cache (atm)
+ enewgroup entropy || die "failed to create entropy group"
+ # Create unprivileged entropy user
+ enewgroup entropy-nopriv || die "failed to create entropy-nopriv group"
+ enewuser entropy-nopriv -1 -1 -1 entropy-nopriv || die "failed to create entropy-nopriv user"
+}
+
+src_install() {
+ emake DESTDIR="${D}" LIBDIR="usr/lib" install || die "make install failed"
+
+ python_optimize "${D}/usr/lib/entropy/lib/entropy"
+}
+
+pkg_postinst() {
+ for ex_conf in "${REPO_D_CONFPATH}"/_entropy_sabayon-limbo.example; do
+ real_conf="${ex_conf%.example}"
+ if [ -f "${real_conf}" ] || [ -f "${real_conf/_}" ]; then
+ # skip installation then
+ continue
+ fi
+ elog "Installing: ${real_conf}"
+ cp "${ex_conf}" "${real_conf}" -p
+ done
+
+ # Copy config file over
+ if [ -f "${REPO_CONFPATH}.example" ] && [ ! -f "${REPO_CONFPATH}" ]; then
+ elog "Copying ${REPO_CONFPATH}.example over to ${REPO_CONFPATH}"
+ cp "${REPO_CONFPATH}.example" "${REPO_CONFPATH}" -p
+ fi
+
+ if [ -d "${ENTROPY_CACHEDIR}" ]; then
+ einfo "Purging current Entropy cache"
+ rm -rf "${ENTROPY_CACHEDIR}"/*
+ fi
+
+ # Fixup Entropy Resources Lock, and /etc/entropy/packages
+ # files permissions. This fixes unprivileged Entropy Library usage
+ local res_file="${ROOT}"/var/lib/entropy/client/database/*/.using_resources
+ if [ -f "${res_file}" ]; then
+ chown root:entropy "${res_file}"
+ chmod g+rw "${res_file}"
+ chmod o+r "${res_file}"
+ fi
+ local pkg_files="package.mask package.unmask package.mask.d package.unmask.d"
+ local pkg_file
+ for pkg_file in ${pkg_files}; do
+ pkg_file="${ROOT}/etc/entropy/packages/${pkg_file}"
+ recursive=""
+ if [ -d "${pkg_file}" ]; then
+ recursive="-R"
+ fi
+ if [ -e "${pkg_file}" ]; then
+ chown ${recursive} root:entropy "${pkg_file}"
+ chmod ${recursive} go+r "${pkg_file}"
+ fi
+ done
+
+ # Setup Entropy Library directories ownership
+ chown root:entropy "${ROOT}/var/lib/entropy" # no recursion
+ chown root:entropy "${ROOT}/var/lib/entropy/client/packages" # no recursion
+ chown root:entropy "${ROOT}/var/log/entropy" # no recursion
+
+ echo
+ elog "If you want to enable Entropy packages delta download support, please"
+ elog "install dev-util/bsdiff."
+ echo
+}
diff --git a/sys-apps/entropy/metadata.xml b/sys-apps/entropy/metadata.xml
new file mode 100644
index 000000000000..187f7a710efe
--- /dev/null
+++ b/sys-apps/entropy/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>lxnay@gentoo.org</email>
+ <name>Fabio Erculiani</name>
+ </maintainer>
+ <use>
+ </use>
+</pkgmetadata>
+
diff --git a/sys-apps/epoch/Manifest b/sys-apps/epoch/Manifest
new file mode 100644
index 000000000000..ee8d4bb3ccb6
--- /dev/null
+++ b/sys-apps/epoch/Manifest
@@ -0,0 +1,8 @@
+DIST epoch-1.0.1.tar.gz 63180 SHA256 40bc17c6d1efcbd709489bcb4920595dde7c4dce49a027487453740eef6a8d8f SHA512 6b2532e86b489eb9e192194bb3d59edd2383e99ceea0bd09c60b64783260171540921a20cf235dd086423d16110b6bbd9974f134c28205635934f1700835d86c WHIRLPOOL 436a11beb0c0ede496ce4ffbf49600e5713962690691c8deb26082f5ff2faea9f5210917ddeca86d1d75e05187fefc39073d4db68144723e2f6d29a7f3980aeb
+DIST epoch-1.0.tar.gz 62623 SHA256 32d858de4c9a5f0996a0561b46dda72e3ac3744a2c65bf6006bb9f8d4aec9e2c SHA512 6d174d6065472c24516d7cbcbd84e51abbec4c062354d6caaf736e167f0a17db5c1c757d5e73222551b26b75aec6649933d55052c831bbabd9bdfd11014ccd5e WHIRLPOOL 6028f6f53d1fdabf360cc2a28542affa8385952009ee44e5855f46b3588654741ed553aa1e9f8275b0cd90b212a9f4bc0f125f57270bbfa5ece9538c4a36acda
+DIST epoch-1.0_rc1.tar.gz 50606 SHA256 074b39766b51a3b59ea4cb9673db3b3ad35e425f2aecf6b5ff880d2651aff7e9 SHA512 cbf8fad0657061b06fa19ae03e666d71fa8a8afab57cf6202570d3b6093f1a5c09aa40dda9798be1dd3a64fc73ed88474b974c98283533f1a1a67f0e6010b6a8 WHIRLPOOL 915698cb9901e9e2d740d13a12e435964cf007d8bee5a8c73dba3c3188939e07a38f1075f88db0dbf761b43982e2a434a66ba42d4c85f82af6c634af4ac6473c
+DIST epoch-1.0_rc2.tar.gz 54826 SHA256 740f32bbf5bae4daf78295c7f237bd4f11da5f9d77430b6bdbb7bea9a742a86b SHA512 f8a835cbcfd391d53f69a7e0ec97bbe3c63e5ae1d4abe19d48f419d131786fbcbc7959fe09059ffd753bfc573bf3b9b7f7ae84797bdf87d545f58289a5c7fcd1 WHIRLPOOL 4efbe5f34d27a1109999d2ad3675a9aa055209f11682f182c984c6f9619b992028e876565ace7e77b93cbcbbee53d96cb6a2a65dd7196e7931da1e5c3d8f4cd6
+DIST epoch-1.1.1.tar.gz 64969 SHA256 98a410ba66952bfc1c326fafd8ceeaf23262e3c3a9768cde4e80f208a37586b2 SHA512 0cfd8ee6c6b211d85d268ef8ac00a029ca4db4931077d81ec82478d7a56e84205f6c7712e58545369b9da2f99e93d99f7f29494c7be902b1f2c16574d6b7b431 WHIRLPOOL d32aaa494f107171ac2ce8cdc8f3349a3d905e2d600239e74221bed84ae65112fbe4344c33f2f4fb123db8478ed7740ab7e662b3fb9d8c262bc564fb1806d1ce
+DIST epoch-1.2.0.tar.gz 66380 SHA256 26147efd855a157d6774111e8171deaa7ce0f8df34ea13910d88fef54bec4b6f SHA512 d017e9f7078bd10596212769a8927f93f0ceb8a34beaf39b7708632bce55f107aa49904de68cfb9ee7aefc40ba28a455a0aecfe7c1afe838bf9e4144ea65544a WHIRLPOOL d49ec73337816b86512757f5a07ca1fbc660bb315e7a997efa36f776806f001fe73e87af4dd0ce0d5a3ba1b8683d775d9783c83072990ffc4c4f9b48dc89d4e7
+DIST epoch-1.2.1.tar.gz 66718 SHA256 9ad6573ca71599f17cf6a567eef902cd1caadb5b5460764ae7bb4e16fa3a9423 SHA512 2d0c767165ec41452d1dabf338c8ea31772f1a8cd1e1dbd60c8469f2f235bb1f0cb60b467189f1fd1079dfc223b0687c1cfe5e729e1142ebc63323b1f9c0cf93 WHIRLPOOL 3c6382f6b2dfd0260f2a036403e995a7bca0b2ceb60a740c3294d736e091c6f9d21541f87a42019bfa25817135ea12bfaf59662ecd2eb85a1e126b9b2ad4c9d7
+DIST epoch_1.2.2.tar.gz 229377 SHA256 3c8bdc4e3ddcaf2410f2c6082cab61f0957dfacf5c14300dadc6c22afd5bca8b SHA512 9e3e38ef95c20237a3db4f47c9464f27e893a665f0692200d89e96b12f6b2e3af9b84d951356b7b354f19ea4fbe372e2e0ba406fdfeb8819914d46cfed3024a3 WHIRLPOOL 1235b63f15435ccdfaf451aca11bd7ab07bc1e0ea148c6430e4b896d7c5838966000c85fabcc03ed86e92a28b46814db80fea528881bce0aa8653af3492d1533
diff --git a/sys-apps/epoch/epoch-1.0.1.ebuild b/sys-apps/epoch/epoch-1.0.1.ebuild
new file mode 100644
index 000000000000..65a09318efb2
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.0.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.0.ebuild b/sys-apps/epoch/epoch-1.0.ebuild
new file mode 100644
index 000000000000..65a09318efb2
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.0_rc1.ebuild b/sys-apps/epoch/epoch-1.0_rc1.ebuild
new file mode 100644
index 000000000000..fa2d19e3ebf5
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.0_rc1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${P}-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.0_rc2.ebuild b/sys-apps/epoch/epoch-1.0_rc2.ebuild
new file mode 100644
index 000000000000..5610bec2df34
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.0_rc2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0_rc1-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.1.1.ebuild b/sys-apps/epoch/epoch-1.1.1.ebuild
new file mode 100644
index 000000000000..65a09318efb2
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.1.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.2.0.ebuild b/sys-apps/epoch/epoch-1.2.0.ebuild
new file mode 100644
index 000000000000..e6b06bfdd67f
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.2.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.2.1.ebuild b/sys-apps/epoch/epoch-1.2.1.ebuild
new file mode 100644
index 000000000000..af7b6bbbfaf7
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.2.1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="https://github.com/Subsentient/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-1.2.2.ebuild b/sys-apps/epoch/epoch-1.2.2.ebuild
new file mode 100644
index 000000000000..6057021a6703
--- /dev/null
+++ b/sys-apps/epoch/epoch-1.2.2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+SRC_URI="http://universe2.us/${PN}_${PV}.tar.gz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+
+S="${WORKDIR}/${PN}_${PV}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/epoch-9999.ebuild b/sys-apps/epoch/epoch-9999.ebuild
new file mode 100644
index 000000000000..27c1d77c884d
--- /dev/null
+++ b/sys-apps/epoch/epoch-9999.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils linux-info git-r3
+
+MY_PV="${PV/rc/RC}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="An init system, a /sbin/init replacement; designed for simplicity"
+HOMEPAGE="http://universe2.us/epoch.html"
+EGIT_REPO_URI="https://github.com/Subsentient/epoch.git"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS=""
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_pretend() {
+ local CONFIG_CHECK="~PROC_FS"
+
+ [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-fix-CFLAGS.patch
+}
+
+src_compile() {
+ NEED_EMPTY_CFLAGS=1 sh ./buildepoch.sh || die "Cannot build epoch."
+}
+
+newepochins() {
+ local type="$1"
+
+ cd ${type} || die "Cannot change directory."
+ for file in * ; do
+ if [[ "${file}" != "epoch" ]] ; then
+ new${type} ${file} epoch-${file}
+ fi
+ done
+ cd .. || die "Cannot change directory."
+}
+
+src_install() {
+ cd built || die "Cannot change directory."
+
+ dosbin sbin/epoch
+
+ # For now, rename to epoch-* until we can blend in with a standard approach.
+ newepochins bin
+ newepochins sbin
+
+ insinto /etc/epoch/
+ newins "${FILESDIR}"/${PN}-1.0_rc1-epoch.conf epoch.conf
+}
+
+pkg_postinst() {
+ elog "Make sure to provide /run and /tmp tmpfs mounts using /etc/fstab."
+ elog ""
+ elog "An example epoch configuration is provided at /etc/epoch/epoch.conf"
+ elog "which starts a minimal needed to use Gentoo."
+ elog ""
+ elog "To use epoch, add this kernel parameter: init=/usr/sbin/epoch-init"
+ elog ""
+ elog "Additional information about epoch is available at"
+ elog "${HOMEPAGE} and configuration documentation at"
+ elog "http://universe2.us/epochconfig.html which is useful reading material."
+ elog ""
+ elog "Its author Subsentient can be contacted at #epoch on irc.freenode.net."
+}
diff --git a/sys-apps/epoch/files/epoch-1.0-fix-CFLAGS.patch b/sys-apps/epoch/files/epoch-1.0-fix-CFLAGS.patch
new file mode 100644
index 000000000000..92842722225a
--- /dev/null
+++ b/sys-apps/epoch/files/epoch-1.0-fix-CFLAGS.patch
@@ -0,0 +1,10 @@
+--- a/buildepoch.sh
++++ b/buildepoch.sh
+@@ -53,6 +53,6 @@
+ }
+
+-NEED_EMPTY_CFLAGS="0"
++NEED_EMPTY_CFLAGS="1"
+ outdir="../built"
+
+ if [ "$CC" == "" ]; then
diff --git a/sys-apps/epoch/files/epoch-1.0_rc1-epoch.conf b/sys-apps/epoch/files/epoch-1.0_rc1-epoch.conf
new file mode 100644
index 000000000000..e0550d48709c
--- /dev/null
+++ b/sys-apps/epoch/files/epoch-1.0_rc1-epoch.conf
@@ -0,0 +1,77 @@
+BootBannerText=Welcome!
+BootBannerColor=RED
+
+Hostname=FILE /etc/hostname
+DefaultRunlevel=boot
+EnableLogging=true
+MountVirtual=procfs sysfs devpts+ devshm+
+
+ObjectID=mountrun
+ ObjectDescription=Mounting /run
+ ObjectStartCommand=mount /run
+ ObjectStartPriority=1
+ ObjectStopPriority=0
+ ObjectEnabled=true
+ ObjectOptions=RAWDESCRIPTION
+ ObjectRunlevels=boot
+
+ObjectID=mounttmp
+ ObjectDescription=Mounting /tmp
+ ObjectStartCommand=mount /tmp
+ ObjectStartPriority=1
+ ObjectStopPriority=0
+ ObjectEnabled=true
+ ObjectOptions=RAWDESCRIPTION
+ ObjectRunlevels=boot
+
+ObjectID=rwfs
+ ObjectDescription=read-write support on /
+ ObjectStartCommand=/bin/mount -o remount,rw /
+ ObjectStopCommand=/bin/mount -o remount,ro /
+ ObjectStartPriority=2
+ ObjectStopPriority=5
+ ObjectEnabled=true
+ ObjectRunlevels=boot
+
+ObjectID=getty1
+ ObjectDescription=agetty on /dev/tty1
+ ObjectStartCommand=agetty --noclear tty1 &
+ ObjectStopCommand=NONE
+ ObjectStartPriority=3
+ ObjectStopPriority=0
+ ObjectEnabled=true
+ ObjectOptions=SERVICE AUTORESTART
+ ObjectRunlevels=boot
+
+ObjectID=extrafs
+ ObjectDescription=extra filesystems and swaps
+ ObjectStartCommand=mount -a && swapon -a
+ ObjectStopCommand=swapoff -a && umount -a -r -t nodevtmpfs,notmpfs,nosysfs,noproc
+ ObjectStartPriority=4
+ ObjectStopPriority=4
+ ObjectEnabled=true
+ ObjectRunlevels=boot
+
+ObjectID=killall5_soft
+ ObjectDescription=Terminating all processes
+ ObjectStopCommand=killall5 -15 && sleep 1
+ ObjectStartPriority=0
+ ObjectStopPriority=1
+ ObjectEnabled=true
+ ObjectOptions=HALTONLY RAWDESCRIPTION
+
+ObjectID=sync
+ ObjectDescription=Syncing
+ ObjectStopCommand=/bin/sync
+ ObjectStartPriority=0
+ ObjectStopPriority=2
+ ObjectEnabled=true
+ ObjectOptions=HALTONLY RAWDESCRIPTION
+
+ObjectID=killall5
+ ObjectDescription=Killing all processes
+ ObjectStopCommand=killall5 -9 && sleep 1
+ ObjectStartPriority=0
+ ObjectStopPriority=3
+ ObjectEnabled=true
+ ObjectOptions=HALTONLY RAWDESCRIPTION
diff --git a/sys-apps/epoch/files/epoch-1.0_rc1-fix-CFLAGS.patch b/sys-apps/epoch/files/epoch-1.0_rc1-fix-CFLAGS.patch
new file mode 100644
index 000000000000..a603c565297f
--- /dev/null
+++ b/sys-apps/epoch/files/epoch-1.0_rc1-fix-CFLAGS.patch
@@ -0,0 +1,11 @@
+--- a/buildepoch.sh
++++ b/buildepoch.sh
+@@ -53,7 +53,7 @@
+ }
+
+ MEMBUS_SIZE_SET="0"
+-NEED_EMPTY_CFLAGS="0"
++NEED_EMPTY_CFLAGS="1"
+ outdir="../built"
+
+ if [ "$CC" == "" ]; then
diff --git a/sys-apps/epoch/metadata.xml b/sys-apps/epoch/metadata.xml
new file mode 100644
index 000000000000..85647838a974
--- /dev/null
+++ b/sys-apps/epoch/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>amynka@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>alicef@gentoo.org</email>
+ <name>Alice Ferrazzi</name>
+ </maintainer>
+ <longdescription>
+ Epoch is an init system (analogous to systemd or upstart)
+ for Linux by Subsentient. It is intended as a lightweight
+ solution for lightweight distributions
+ that don't want a huge mess just to boot up.
+
+ It has one unified configuration file, is very small in size,
+ and it has no external dependencies besides glibc or similar,
+ and although installing a shell for /bin/sh is strongly recommended.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">Subsentient/epoch</remote-id>
+ <doc lang="en">http://universe2.us/epochconfig.html</doc>
+ <bugs-to>https://github.com/Subsentient/epoch/issues</bugs-to>
+ <changelog>https://github.com/Subsentient/epoch/commits/master</changelog>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/etckeeper/Manifest b/sys-apps/etckeeper/Manifest
new file mode 100644
index 000000000000..ab6ad43aeb2a
--- /dev/null
+++ b/sys-apps/etckeeper/Manifest
@@ -0,0 +1,3 @@
+DIST etckeeper-1.11.tar.gz 48100 SHA256 a58b84af8307623f8c59acd6b161bf781909a1dac4b82853baa3098d47decabc SHA512 f9ae79dfee4d97195b0a40ef319d75242662b9717d0293ac9722a7728e22374b6425391e91076ab5e0e4524a16c211511a2857b867d3610ff5c6b2bc561c96a7 WHIRLPOOL 174b857dce5d4ecdb26a01e030c312f57aeb9d1db3eaede5ead4c7e3a08ce05695ca528d226ce1847d28eb14a7360990bb21bb777a710f3b56ab5594ffd01301
+DIST etckeeper-1.18.1.tar.gz 56366 SHA256 80adee6e17bfc41359ffb85a401d9a510ae25956950adbfdd07a0bda36d99e9b SHA512 5b5019d3f8c22ee0486c9102d7dbdc7e86921d432df49c15733e5ed23651c2be87b52e295208be691ef1e44a515d960fcf4f812eaca17f2806e2f5055222ca35 WHIRLPOOL 890b38f761f49a5a4713fa850bc18e09688ed8fb04d9b41f3727f868448fb1ba1ecf92750df777fc6011a3f88abeb8756105fbdc60ebf6fd3e693360764fb27c
+DIST etckeeper-1.18.tar.gz 56203 SHA256 f9d9eedb2b66c4c40e16824e0899755226543b7c124756f5e0168353fc194d36 SHA512 439a3316b938fe78ab8f0032964ea62392098ca37043960995713f5ca698efb1df4e2c57177ebf3036ec1a8652157ecf990316fd68fd6376bb090b3f0bc42131 WHIRLPOOL 27998338d8bdd9cf32ba443b1cffd45e83b9ca77eb84fead4dfff9c1413425435b15b9be7f18360488ce149f2aba208041cd89f1d2d4b6f5bf8fc5e01130641a
diff --git a/sys-apps/etckeeper/etckeeper-1.11-r1.ebuild b/sys-apps/etckeeper/etckeeper-1.11-r1.ebuild
new file mode 100644
index 000000000000..cc387fe2fc9b
--- /dev/null
+++ b/sys-apps/etckeeper/etckeeper-1.11-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils bash-completion-r1 prefix python-r1
+
+DESCRIPTION="A collection of tools to let /etc be stored in a repository"
+HOMEPAGE="http://kitenet.net/~joey/code/etckeeper/"
+SRC_URI="https://github.com/joeyh/etckeeper/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 ~arm x86"
+SLOT="0"
+IUSE="bazaar cron"
+REQUIRED_USE="bazaar? ( ${PYTHON_REQUIRED_USE} )"
+
+VCS_DEPEND="dev-vcs/git
+ dev-vcs/mercurial
+ dev-vcs/darcs"
+DEPEND="bazaar? ( dev-vcs/bzr )"
+RDEPEND="${DEPEND}
+ app-portage/portage-utils
+ cron? ( virtual/cron )
+ bazaar? ( ${PYTHON_DEPS} )
+ !bazaar? ( || ( ${VCS_DEPEND} ) )"
+
+src_prepare(){
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+src_compile() {
+ :
+}
+
+src_install(){
+ emake DESTDIR="${ED}" install
+
+ bzr_install() {
+ ${PYTHON} ./${PN}-bzr/__init__.py install --root="${ED}" ||
+ die "bzr support installation failed!"
+ }
+ use bazaar && python_foreach_impl bzr_install
+
+ if use prefix; then
+ doenvd "${FILESDIR}"/99${PN}
+ eprefixify "${ED%/}"/etc/env.d/99${PN}
+ fi
+
+ newbashcomp bash_completion ${PN}
+ dodoc README TODO
+ docinto examples
+ dodoc "${FILESDIR}"/bashrc
+
+ if use cron ; then
+ exeinto /etc/cron.daily
+ newexe debian/cron.daily etckeeper
+ fi
+}
+
+pkg_postinst(){
+ elog "${PN} supports the following VCS: ${VCS_DEPEND}"
+ elog " dev-vcs/bzr"
+ elog "This ebuild just ensures at least one is installed!"
+ elog "For dev-vcs/bzr you need to enable 'bazaar' useflag."
+ elog
+ elog "You may want to adjust your /etc/portage/bashrc"
+ elog "see the example file in /usr/share/doc/${PF}/examples"
+ elog
+ elog "To initialise your etc-dir as a repository run:"
+ elog "${PN} init -d /etc"
+}
diff --git a/sys-apps/etckeeper/etckeeper-1.18.1.ebuild b/sys-apps/etckeeper/etckeeper-1.18.1.ebuild
new file mode 100644
index 000000000000..404763e640a3
--- /dev/null
+++ b/sys-apps/etckeeper/etckeeper-1.18.1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils bash-completion-r1 prefix python-r1
+
+DESCRIPTION="A collection of tools to let /etc be stored in a repository"
+HOMEPAGE="https://etckeeper.branchable.com/"
+SRC_URI="https://github.com/joeyh/etckeeper/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+IUSE="bazaar cron"
+REQUIRED_USE="bazaar? ( ${PYTHON_REQUIRED_USE} )"
+
+VCS_DEPEND="dev-vcs/git
+ dev-vcs/mercurial
+ dev-vcs/darcs"
+DEPEND="bazaar? ( dev-vcs/bzr )"
+RDEPEND="${DEPEND}
+ app-portage/portage-utils
+ cron? ( virtual/cron )
+ bazaar? ( ${PYTHON_DEPS} )
+ !bazaar? ( || ( ${VCS_DEPEND} ) )"
+
+src_prepare(){
+ epatch "${FILESDIR}"/${PN}-1.18-gentoo.patch
+}
+
+src_compile() {
+ :
+}
+
+src_install(){
+ emake DESTDIR="${ED}" install
+
+ bzr_install() {
+ ${PYTHON} ./${PN}-bzr/__init__.py install --root="${ED}" ||
+ die "bzr support installation failed!"
+ }
+ use bazaar && python_foreach_impl bzr_install
+
+ if use prefix; then
+ doenvd "${FILESDIR}"/99${PN}
+ eprefixify "${ED%/}"/etc/env.d/99${PN}
+ fi
+
+ newbashcomp bash_completion ${PN}
+ dodoc doc/README.mdwn
+ docinto examples
+ newdoc "${FILESDIR}"/bashrc-r1 bashrc
+
+ if use cron ; then
+ exeinto /etc/cron.daily
+ newexe debian/cron.daily etckeeper
+ fi
+}
+
+pkg_postinst(){
+ elog "${PN} supports the following VCS: ${VCS_DEPEND}"
+ elog " dev-vcs/bzr"
+ elog "This ebuild just ensures at least one is installed!"
+ elog "For dev-vcs/bzr you need to enable 'bazaar' useflag."
+ elog
+ elog "You may want to adjust your /etc/portage/bashrc"
+ elog "see the example file in /usr/share/doc/${PF}/examples"
+ elog
+ elog "To initialise your etc-dir as a repository run:"
+ elog "${PN} init -d /etc"
+}
diff --git a/sys-apps/etckeeper/etckeeper-1.18.ebuild b/sys-apps/etckeeper/etckeeper-1.18.ebuild
new file mode 100644
index 000000000000..7b310675edd7
--- /dev/null
+++ b/sys-apps/etckeeper/etckeeper-1.18.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils bash-completion-r1 prefix python-r1
+
+DESCRIPTION="A collection of tools to let /etc be stored in a repository"
+HOMEPAGE="https://etckeeper.branchable.com/"
+SRC_URI="https://github.com/joeyh/etckeeper/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+IUSE="bazaar cron"
+REQUIRED_USE="bazaar? ( ${PYTHON_REQUIRED_USE} )"
+
+VCS_DEPEND="dev-vcs/git
+ dev-vcs/mercurial
+ dev-vcs/darcs"
+DEPEND="bazaar? ( dev-vcs/bzr )"
+RDEPEND="${DEPEND}
+ app-portage/portage-utils
+ cron? ( virtual/cron )
+ bazaar? ( ${PYTHON_DEPS} )
+ !bazaar? ( || ( ${VCS_DEPEND} ) )"
+
+src_prepare(){
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+src_compile() {
+ :
+}
+
+src_install(){
+ emake DESTDIR="${ED}" install
+
+ bzr_install() {
+ ${PYTHON} ./${PN}-bzr/__init__.py install --root="${ED}" ||
+ die "bzr support installation failed!"
+ }
+ use bazaar && python_foreach_impl bzr_install
+
+ if use prefix; then
+ doenvd "${FILESDIR}"/99${PN}
+ eprefixify "${ED%/}"/etc/env.d/99${PN}
+ fi
+
+ newbashcomp bash_completion ${PN}
+ dodoc doc/README.mdwn
+ docinto examples
+ newdoc "${FILESDIR}"/bashrc-r1 bashrc
+
+ if use cron ; then
+ exeinto /etc/cron.daily
+ newexe debian/cron.daily etckeeper
+ fi
+}
+
+pkg_postinst(){
+ elog "${PN} supports the following VCS: ${VCS_DEPEND}"
+ elog " dev-vcs/bzr"
+ elog "This ebuild just ensures at least one is installed!"
+ elog "For dev-vcs/bzr you need to enable 'bazaar' useflag."
+ elog
+ elog "You may want to adjust your /etc/portage/bashrc"
+ elog "see the example file in /usr/share/doc/${PF}/examples"
+ elog
+ elog "To initialise your etc-dir as a repository run:"
+ elog "${PN} init -d /etc"
+}
diff --git a/sys-apps/etckeeper/files/99etckeeper b/sys-apps/etckeeper/files/99etckeeper
new file mode 100644
index 000000000000..9848af2d7713
--- /dev/null
+++ b/sys-apps/etckeeper/files/99etckeeper
@@ -0,0 +1 @@
+ETCKEEPER_CONF_DIR="@GENTOO_PORTAGE_EPREFIX@/etc/etckeeper"
diff --git a/sys-apps/etckeeper/files/bashrc b/sys-apps/etckeeper/files/bashrc
new file mode 100644
index 000000000000..ce53621a22ac
--- /dev/null
+++ b/sys-apps/etckeeper/files/bashrc
@@ -0,0 +1,4 @@
+case "${EBUILD_PHASE}" in
+ preinst|prerm) etckeeper pre-install ;;
+ postinst|postrm) etckeeper post-install ;;
+esac
diff --git a/sys-apps/etckeeper/files/bashrc-r1 b/sys-apps/etckeeper/files/bashrc-r1
new file mode 100644
index 000000000000..f581790ecc85
--- /dev/null
+++ b/sys-apps/etckeeper/files/bashrc-r1
@@ -0,0 +1,4 @@
+case "${EBUILD_PHASE}" in
+ setup|prerm) etckeeper pre-install ;;
+ postinst|postrm) etckeeper post-install ;;
+esac
diff --git a/sys-apps/etckeeper/files/etckeeper-1.11-gentoo.patch b/sys-apps/etckeeper/files/etckeeper-1.11-gentoo.patch
new file mode 100644
index 000000000000..9ac14b9c8337
--- /dev/null
+++ b/sys-apps/etckeeper/files/etckeeper-1.11-gentoo.patch
@@ -0,0 +1,64 @@
+Original patch by Luke-Jr (luke-jr+gentoobugs@utopios.org)
+Minor fixes by Manuel Rueger (mrueg@rueg.eu)
+
+https://bugs.gentoo.org/show_bug.cgi?id=216114
+Gentoo specific additions
+
+--- Makefile
++++ Makefile
+@@ -23,7 +23,6 @@
+ $(INSTALL_DATA) $(CONFFILE) $(DESTDIR)$(etcdir)/etckeeper/etckeeper.conf
+ $(INSTALL_EXE) etckeeper $(DESTDIR)$(bindir)/etckeeper
+ $(INSTALL_DATA) etckeeper.8 $(DESTDIR)$(mandir)/man8/etckeeper.8
+- $(INSTALL_DATA) bash_completion $(DESTDIR)$(etcdir)/bash_completion.d/etckeeper
+ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),apt)
+ $(INSTALL_DATA) apt.conf $(DESTDIR)$(etcdir)/apt/apt.conf.d/05etckeeper
+ mkdir -p $(DESTDIR)$(etcdir)/cruft/filters-unex
+@@ -39,7 +37,6 @@
+ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),zypper)
+ $(INSTALL_DATA) zypper-etckeeper.py $(DESTDIR)$(prefix)/lib/zypp/plugins/commit/zypper-etckeeper.py
+ endif
+- -./etckeeper-bzr/__init__.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** bzr support not installed"
+ echo "** installation successful"
+
+ clean: etckeeper.spec
+--- etckeeper.conf
++++ etckeeper.conf
+@@ -31,11 +31,13 @@
+
+ # The high-level package manager that's being used.
+ # (apt, pacman-g2, yum, zypper etc)
+-HIGHLEVEL_PACKAGE_MANAGER=apt
++# For gentoo this is emerge
++HIGHLEVEL_PACKAGE_MANAGER=emerge
+
+ # The low-level package manager that's being used.
+ # (dpkg, rpm, pacman, pacman-g2, etc)
+-LOWLEVEL_PACKAGE_MANAGER=dpkg
++# For gentoo this is qlist
++LOWLEVEL_PACKAGE_MANAGER=qlist
+
+ # To push each commit to a remote, put the name of the remote here.
+ # (eg, "origin" for git).
+--- list-installed.d/50list-installed
++++ list-installed.d/50list-installed
+@@ -9,4 +9,6 @@
+ rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
+ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
+ pacman -Q
++elif [ "$LOWLEVEL_PACKAGE_MANAGER" = qlist ]; then
++ qlist -ICv
+ fi
+--- update-ignore.d/01update-ignore
++++ update-ignore.d/01update-ignore
+@@ -99,6 +99,10 @@
+ ignore "*.pacorig"
+ ignore "*.pacsave"
+ nl
++ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "qlist" ]; then
++ comment "new and old versions of conffiles, stored by emerge"
++ ignore "*._cfg*"
++ nl
+ fi
+
+ comment "old versions of files"
diff --git a/sys-apps/etckeeper/files/etckeeper-1.18-gentoo.patch b/sys-apps/etckeeper/files/etckeeper-1.18-gentoo.patch
new file mode 100644
index 000000000000..a5018bd77d1a
--- /dev/null
+++ b/sys-apps/etckeeper/files/etckeeper-1.18-gentoo.patch
@@ -0,0 +1,86 @@
+From 385d0e828d57e4998dd62fa34d5d929768fb894d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Manuel=20R=C3=BCger?= <manuel@rueg.eu>
+Date: Sun, 12 Apr 2015 23:39:30 +0200
+Subject: [PATCH] Support Gentoo's package managers.
+
+
+diff --git a/Makefile b/Makefile
+index c95d51a..4be900e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,7 +28,6 @@ install: etckeeper.version
+ mkdir -p $(DESTDIR)$(mandir)/man8
+ $(INSTALL_DATA) etckeeper.8 $(DESTDIR)$(mandir)/man8/etckeeper.8
+ mkdir -p $(DESTDIR)$(etcdir)/bash_completion.d
+- $(INSTALL_DATA) bash_completion $(DESTDIR)$(etcdir)/bash_completion.d/etckeeper
+ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),apt)
+ mkdir -p $(DESTDIR)$(etcdir)/apt/apt.conf.d
+ $(INSTALL_DATA) apt.conf $(DESTDIR)$(etcdir)/apt/apt.conf.d/05etckeeper
+@@ -52,7 +51,6 @@ ifeq ($(HIGHLEVEL_PACKAGE_MANAGER),zypper)
+ mkdir -p $(DESTDIR)$(prefix)/lib/zypp/plugins/commit
+ $(INSTALL) zypper-etckeeper.py $(DESTDIR)$(prefix)/lib/zypp/plugins/commit/zypper-etckeeper.py
+ endif
+- -$(PYTHON) ./etckeeper-bzr/__init__.py install --root=$(DESTDIR) ${PYTHON_INSTALL_OPTS} || echo "** bzr support not installed"
+ echo "** installation successful"
+
+ clean: etckeeper.spec etckeeper.version
+diff --git a/etckeeper.conf b/etckeeper.conf
+index 2aec35e..0a9c88b 100644
+--- a/etckeeper.conf
++++ b/etckeeper.conf
+@@ -31,11 +31,21 @@ DARCS_COMMIT_OPTIONS="-a"
+
+ # The high-level package manager that's being used.
+ # (apt, pacman-g2, yum, dnf, zypper etc)
+-HIGHLEVEL_PACKAGE_MANAGER=apt
++#HIGHLEVEL_PACKAGE_MANAGER=apt
++
++# Gentoo specific:
++# For portage this is emerge
++# For paludis this is cave
++HIGHLEVEL_PACKAGE_MANAGER=emerge
+
+ # The low-level package manager that's being used.
+ # (dpkg, rpm, pacman, pacman-g2, etc)
+-LOWLEVEL_PACKAGE_MANAGER=dpkg
++#LOWLEVEL_PACKAGE_MANAGER=dpkg
++
++# Gentoo specific:
++# For portage this is qlist
++# For paludis this is cave
++LOWLEVEL_PACKAGE_MANAGER=qlist
+
+ # To push each commit to a remote, put the name of the remote here.
+ # (eg, "origin" for git). Space-separated lists of multiple remotes
+diff --git a/list-installed.d/50list-installed b/list-installed.d/50list-installed
+index 2ac569a..91718d4 100755
+--- a/list-installed.d/50list-installed
++++ b/list-installed.d/50list-installed
+@@ -17,5 +17,9 @@ else
+ rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
+ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
+ pacman -Q
++ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = qlist ]; then
++ qlist -ICv
++ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = cave ]; then
++ cave print-packages -r installed
+ fi
+ fi
+diff --git a/update-ignore.d/01update-ignore b/update-ignore.d/01update-ignore
+index 098fab8..88243ea 100755
+--- a/update-ignore.d/01update-ignore
++++ b/update-ignore.d/01update-ignore
+@@ -99,6 +99,10 @@ writefile () {
+ ignore "*.pacorig"
+ ignore "*.pacsave"
+ nl
++ elif [ "$LOWLEVEL_PACKAGE_MANAGER" = "qlist" -o "$LOWLEVEL_PACKAGE_MANAGER" = "cave" ]; then
++ comment "new and old versions of conffiles, stored by emerge"
++ ignore "._cfg*"
++ nl
+ fi
+
+ comment "old versions of files"
+--
+2.3.5
+
diff --git a/sys-apps/etckeeper/metadata.xml b/sys-apps/etckeeper/metadata.xml
new file mode 100644
index 000000000000..8c1183f2a543
--- /dev/null
+++ b/sys-apps/etckeeper/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>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <use>
+ <flag name="bazaar">Support <pkg>dev-vcs/bzr</pkg> based repository
+ </flag>
+ <flag name="cron">Install cron script</flag>
+ </use>
+ <longdescription>etckeeper is a collection of tools to let /etc be stored in
+ a git, mercurial, darcs, or bzr repository. It can hook into portage to
+ automatically commit changes made to /etc during package upgrades. It tracks
+ file metadata that revison control systems do not normally support, but that
+ is important for /etc, such as the permissions of /etc/shadow.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">joeyh/etckeeper</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/ethtool/Manifest b/sys-apps/ethtool/Manifest
new file mode 100644
index 000000000000..a192ab3cd5c5
--- /dev/null
+++ b/sys-apps/ethtool/Manifest
@@ -0,0 +1,12 @@
+DIST ethtool-2.6.39.tar.bz2 169029 SHA256 9c437ddfa0410273a076e414a8818fb322f3cb686aca537b915c868044819df4
+DIST ethtool-3.0.tar.bz2 170196 SHA256 095844d67c1dbe4a2ce3bebc72841475fcee23be0359802e594a202b25ffad7d SHA512 8a1ae1fa50a28c9fd525f19b695b739bc6f896575315a281cc4b751241385c949d8960e402796b5f36450861063546f037516d41daaea099e7b14ff38f4f1fdb WHIRLPOOL e0b2e86b664af0163d8f41b2966205a011056c73cf882cf259ccf5d57958f1e62259059854721f9bd3b15df3209937798334f745db24d39402e90ddd6d350c09
+DIST ethtool-3.10.tar.xz 184888 SHA256 f88d941b63a0e51613bde5498d42f4ee2eefa332064e7a8dd80069a341dc1c40 SHA512 b7a28e70f92854abb47e61cd927d93b2716407b77d20253e0b21d225e7033d466772677215d2c7b1a811504e8d00e438b47abcf2448c79488dc677bb0ce2183b WHIRLPOOL 424933cb753b92cd26b7694f9849b25f206d094097be21c44f5c8a96b2bb256cc45f6d9c86348267e5eb1ed075a1159aabf2caa3867651818847c0600fdd0f73
+DIST ethtool-3.12.1.tar.xz 186744 SHA256 616ec632cddcba7240a23582b05380b69f1b359280e8db3fe3bb46498b621149 SHA512 1e51660ed8c33af4c8509e52d835c906fcb644f841874e360f06a606219ff5f51340bdcb25cdbfff66f982e328c4c51297a3ad9851e9bea52156c20d0ac12526 WHIRLPOOL 73cbf7f0dbce244c834f737efccad6eb5e3bc916db37711348e9c6ff181278b03f166e11b39c36bba5fb80375cf46a65901a4013d9eea6affc39e44975a77295
+DIST ethtool-3.13.tar.xz 193780 SHA256 5a5657e213f100f4aa3f33ee5f5f5907fa3440fed41aae09d0cb21f9ad92e71f SHA512 91afe0ee1e99a6a6212e4e4bca339719d46493b46dae5f1a2f516e1794750c9f46777cc3fa030e88d9694a59dfbd65fa9f24510b808bb8b5b8eaca3215bd60c0 WHIRLPOOL 3b2e432f8ee8110de7abcc794dda7244bd866366e404aab18ca28345df34e8a1fab2ae110c459c9c14fca7f13fe1cb74fe9d75c6d49e9e4614432f6e2d7296aa
+DIST ethtool-3.14.tar.xz 194360 SHA256 434e2b70ef91b186b8287077692163112f6936e8e2aabd9199eb9473ca516707 SHA512 745feeb4fa3bfcee40c9299f7f6102646029e8079f8ed9904a348f09ab5f23b17d929c65cf892d38fe38b629d8dedf8706c1902993da3c24337c52e65bb161de WHIRLPOOL 031a433bfb8f61ec783827a35c2c5d8a5b49afdb918026f7ff3077e4731a448a625dec5f769f92d76aa2388cce725ea45b10f494998a9d1b0875d75e4bde5652
+DIST ethtool-3.15.tar.xz 195440 SHA256 88d3690e255a02363953cc375055b688b162d21efc7ef3836b5447477ce26f9a SHA512 e9f6375d065b83c5142a89a30483fa4a4f90eafe81f690c5f7b33a389b6fa2a16156f222ca932c31596ebfa418009ded755b0d3e09e5fa881f5c58fb57c9a543 WHIRLPOOL 20129f3626c756557b49328dad5b7cf6c3e89210459e46df020a15934db8450ff0ef14d6378e20aae88e94d8d3c5234effb42f9d1d039720e3a62b454d5f68fa
+DIST ethtool-3.16.tar.xz 198760 SHA256 d6e0dd3fa904c3ad87487c66a4a8fde1ebc4194979ca5755df4b2efb247ca286 SHA512 5f3790872eef14c20b4e1c59e9f318f18811022fa2b1c345699c815acf942e91288bb08d6e7d36d8b4f33101e52c832522d5118146f9e0f5d98cdf2f9c0d0d30 WHIRLPOOL 43195f66cfe97c0066bedb05e46342d5da8efc36bdb307d20e787b17777e20d781f7beecb2cbc161ed9d7efdd81c54796a47bbdf927aa761ce64d3bb3f203606
+DIST ethtool-3.18.tar.xz 198780 SHA256 813ffe59fddd2db423c578448b10e33e2e2d4cc2ba780f1f0c603642b20342f6 SHA512 06fba3458c69bd414f5c5edaba006f39e0777614521e5dc37859d1947d3069f7c04f8ea2513f16a930183fb98fc4b6e7cc374a2070787a750673cbf01943eb62 WHIRLPOOL 9c235b7c01f846601a714b8c774e217b1f5f5097dd561adeada940aaeea15f7ccb76232be3536c486fd14486ca5a18f0658bfed2096c173718fc7a188d7ce1ee
+DIST ethtool-3.4.2.tar.bz2 200731 SHA256 e2cb6e7977c804b0fa387ba41a04772d37efeb237f27de59eace06792a47a187 SHA512 43714a643c741ef46132e06f6f407bbf77c7787a6fcfe6b9b73165883ea498890ee23d34662255c6fbaeba924d2f8e8cd5160c33c960492dcf5e4a94d2bb68a9 WHIRLPOOL ffaecb40293f15c2e33f85fc6a6318ce1ce82b5db0395e6a0ead0deb45ef39d765c3dd91e66e4b0e83d33b07b98c5ac30e821f9800fff56b788bb46351ce204c
+DIST ethtool-3.8.tar.xz 184168 SHA256 510df229ffb27bc030bf60d6181a021e9d3707a082d6565b6daae3d352ee2c95 SHA512 ce003286651f225baf631d7a760f910297a5cd083887f8d96dcc302c2597cb5c3774c58ab34ea55fd9c12d17493bab09fc5cddfc6b383235b818198d5e8d751e WHIRLPOOL c0314b0293b43fc8fdaf6462140a7d56e87b9d6bb03cd5eb9589a5bc26ee006c17764e9cb8c36ff4aacaa54ff10bb9971086ac4a9e25c50cebff966eb15e0595
+DIST ethtool-4.0.tar.xz 199548 SHA256 904887acc7d2f9c35dec04eb0e8a727a3205f346af4f4c95560ea3798de5ecff SHA512 708f7df17f04339d1f6e9f80e0e9b4d7855fd71b974a833e5644ee4b7a431032ce70ceac85e37e59847eb0bea4226c0467b12605e16a005f83d75c33367a6ef2 WHIRLPOOL c1649c83146ded3d245d1e96783f1fc79d51f2d2fdbf877eed6968d5c7a37d4bb3855d45d4110369199d95bc8a4b807fe4707265f89e4a8e1e883b843739e322
diff --git a/sys-apps/ethtool/ethtool-2.6.39.ebuild b/sys-apps/ethtool/ethtool-2.6.39.ebuild
new file mode 100644
index 000000000000..a47b539a1cd6
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-2.6.39.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
diff --git a/sys-apps/ethtool/ethtool-3.0.ebuild b/sys-apps/ethtool/ethtool-3.0.ebuild
new file mode 100644
index 000000000000..b88ea5357449
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ppc ppc64 sh ~sparc x86"
+IUSE=""
diff --git a/sys-apps/ethtool/ethtool-3.10.ebuild b/sys-apps/ethtool/ethtool-3.10.ebuild
new file mode 100644
index 000000000000..30d30ded8542
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.10.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.12.1.ebuild b/sys-apps/ethtool/ethtool-3.12.1.ebuild
new file mode 100644
index 000000000000..f51a3a470052
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.12.1.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.13.ebuild b/sys-apps/ethtool/ethtool-3.13.ebuild
new file mode 100644
index 000000000000..77e118c72c59
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.13.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.14.ebuild b/sys-apps/ethtool/ethtool-3.14.ebuild
new file mode 100644
index 000000000000..77e118c72c59
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.14.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.15.ebuild b/sys-apps/ethtool/ethtool-3.15.ebuild
new file mode 100644
index 000000000000..77e118c72c59
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.15.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.16.ebuild b/sys-apps/ethtool/ethtool-3.16.ebuild
new file mode 100644
index 000000000000..77e118c72c59
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.16.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.18.ebuild b/sys-apps/ethtool/ethtool-3.18.ebuild
new file mode 100644
index 000000000000..bc1f28d26e1b
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.18.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-3.4.2.ebuild b/sys-apps/ethtool/ethtool-3.4.2.ebuild
new file mode 100644
index 000000000000..c9ca05ac04a2
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.4.2.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
diff --git a/sys-apps/ethtool/ethtool-3.8.ebuild b/sys-apps/ethtool/ethtool-3.8.ebuild
new file mode 100644
index 000000000000..7743a4fd6213
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-3.8.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/ethtool-4.0.ebuild b/sys-apps/ethtool/ethtool-4.0.ebuild
new file mode 100644
index 000000000000..300b62bef733
--- /dev/null
+++ b/sys-apps/ethtool/ethtool-4.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="Utility for examining and tuning ethernet-based network interfaces"
+HOMEPAGE="http://www.kernel.org/pub/software/network/ethtool/"
+SRC_URI="mirror://kernel/software/network/ethtool/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+DEPEND="app-arch/xz-utils"
diff --git a/sys-apps/ethtool/metadata.xml b/sys-apps/ethtool/metadata.xml
new file mode 100644
index 000000000000..5977c7f15c18
--- /dev/null
+++ b/sys-apps/ethtool/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<longdescription lang="en">
+ ethtool is a Linux utility for controlling network drivers and hardware,
+ particularly for wired Ethernet devices. It can be used to:
+ * Get identification and diagnostic information
+ * Get extended device statistics
+ * Control speed, duplex, autonegotiation and flow control for Ethernet devices
+ * Control checksum offload and other hardware offload features
+ * Control DMA ring sizes and interrupt moderation
+ * Control receive queue selection for multiqueue devices
+ * Upgrade firmware in flash memory
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/fakechroot/Manifest b/sys-apps/fakechroot/Manifest
new file mode 100644
index 000000000000..b7ae94b30a4e
--- /dev/null
+++ b/sys-apps/fakechroot/Manifest
@@ -0,0 +1 @@
+DIST fakechroot_2.17.2.orig.tar.gz 463307 SHA256 038f631c6013b34426ac0b6a38b613083818065b4d20ae87598ea14589ec8c7c SHA512 bcdcf8e77aae46b567acddb80e6817a118c7ef250ba7b6962982e60a6a5e3b8c1eeef950dc33335f31466c3f53ab6b7260bc64a1da9c4b156a44d811ef8cccd0 WHIRLPOOL 69e170a044af5e06494d42a1cd2fa359b9101224bd71f8413949ba0e12396d6a877b82e35734d8c8d0a576e508c47a71ecd2eb6272951cfa95a88298764417c5
diff --git a/sys-apps/fakechroot/fakechroot-2.17.2.ebuild b/sys-apps/fakechroot/fakechroot-2.17.2.ebuild
new file mode 100644
index 000000000000..0aeedf8a5c7e
--- /dev/null
+++ b/sys-apps/fakechroot/fakechroot-2.17.2.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 eutils
+
+DESCRIPTION="Provide a faked chroot environment without requiring root privileges"
+HOMEPAGE="http://fakechroot.alioth.debian.org/"
+SRC_URI="mirror://debian/pool/main/f/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RESTRICT="test"
+
+src_configure() {
+ econf --disable-static
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc NEWS.md README.md THANKS
+ find "${D}" -name '*.la' -exec rm -f '{}' +
+}
diff --git a/sys-apps/fakechroot/metadata.xml b/sys-apps/fakechroot/metadata.xml
new file mode 100644
index 000000000000..4f3f7b2bd973
--- /dev/null
+++ b/sys-apps/fakechroot/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>proxy-maintainers</herd>
+ <maintainer>
+ <email>anthoine.bourgeois@gmail.com</email>
+ <description>Maintainer, assign bugs</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/fakeroot-ng/Manifest b/sys-apps/fakeroot-ng/Manifest
new file mode 100644
index 000000000000..b4949b015fb8
--- /dev/null
+++ b/sys-apps/fakeroot-ng/Manifest
@@ -0,0 +1,3 @@
+DIST fakeroot-ng-0.17-gcc47.patch.xz 8576 SHA256 17e4f38208636ca43064e05a1139186305c212567376f280218dcfda7b35a946 SHA512 053b825e3362683f20867fcb2120e19612537b7f597fefcec913408092d200b31fcf43c2911000dc4710a5b77e0a0c8d93734fe1a9aa42bd503dfc6e75b0d7fb WHIRLPOOL eed844cf50f9d32006694a30a72daa283e637659b94152e4416ce65df96ee8bca0763b2282e1ee86f5ebc8d38677b10286124e6334f7119a8b57adcf66424db1
+DIST fakeroot-ng-0.17.tar.gz 194791 SHA256 b7898db2ba2275b3fe7c38487915b154d1d4ddc994e7be2777e794dc6186bfe1 SHA512 bc6caab529feaf0e75f7ed0c5160ebda87d113c34001cabf20565f51fd66078d4363115ddd32d23106f4b47ce6e85b9defabf108ce2f35280d7b413fa7148686 WHIRLPOOL 28ca3e6626c467b00ce7e26a6bef741dc002971be7c6e839ca3afa981d557e4fbf1fade91a05f5dab503e95549602af275c5735883caf7e94a128f4135bad6ef
+DIST fakeroot-ng-0.18.tar.gz 207870 SHA256 189eacda630752980d40e34b2c01ce23d839daab3d691a4706bb9eac79f7e144 SHA512 8ece6830d229b92537d9c0a2eb42cb9ec4ae6b83453303004dded5eab0707b9ae8eaa2c71aac6ea68226c43cf08db6b0939a9422aab32948f5ecb185ee01d854 WHIRLPOOL 38e2758dd2747056479c1fd920961a10adbc1d8797fb5b02f32167af22de7458c91df36d7ea73305df86ee91d093506f280bde8c23d7b4a6c0e3fa2b36154060
diff --git a/sys-apps/fakeroot-ng/fakeroot-ng-0.17.ebuild b/sys-apps/fakeroot-ng/fakeroot-ng-0.17.ebuild
new file mode 100644
index 000000000000..0c17b9a899f3
--- /dev/null
+++ b/sys-apps/fakeroot-ng/fakeroot-ng-0.17.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A utility to run commands with fake root privileges"
+HOMEPAGE="http://sourceforge.net/projects/fakerootng/"
+SRC_URI="mirror://sourceforge/${PN//-/}/${PF}.tar.gz
+ http://dev.gentoo.org/~ssuominen/${P}-gcc47.patch.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ epatch "${WORKDIR}"/${P}-gcc47.patch
+}
diff --git a/sys-apps/fakeroot-ng/fakeroot-ng-0.18-r1.ebuild b/sys-apps/fakeroot-ng/fakeroot-ng-0.18-r1.ebuild
new file mode 100644
index 000000000000..ca200a202c69
--- /dev/null
+++ b/sys-apps/fakeroot-ng/fakeroot-ng-0.18-r1.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 eutils
+
+DESCRIPTION="A utility to run commands with fake root privileges"
+HOMEPAGE="http://sourceforge.net/projects/fakerootng/"
+SRC_URI="mirror://sourceforge/${PN//-/}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-gcc-4.8.2.patch
+}
diff --git a/sys-apps/fakeroot-ng/fakeroot-ng-0.18.ebuild b/sys-apps/fakeroot-ng/fakeroot-ng-0.18.ebuild
new file mode 100644
index 000000000000..f185b58f7fd5
--- /dev/null
+++ b/sys-apps/fakeroot-ng/fakeroot-ng-0.18.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A utility to run commands with fake root privileges"
+HOMEPAGE="http://sourceforge.net/projects/fakerootng/"
+SRC_URI="mirror://sourceforge/${PN//-/}/${PF}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DOCS="AUTHORS ChangeLog NEWS README"
diff --git a/sys-apps/fakeroot-ng/files/fakeroot-ng-gcc-4.8.2.patch b/sys-apps/fakeroot-ng/files/fakeroot-ng-gcc-4.8.2.patch
new file mode 100644
index 000000000000..50df56d51bdb
--- /dev/null
+++ b/sys-apps/fakeroot-ng/files/fakeroot-ng-gcc-4.8.2.patch
@@ -0,0 +1,10 @@
+--- 1/arch/linux/i386/platform_specific.h
++++ 1/arch/linux/i386/platform_specific.h
+@@ -2,6 +2,7 @@
+ #define PLATFORM_SPECIFIC_H
+
+ #include <asm/ptrace.h>
++#include <sys/types.h>
+ #include <sys/syscall.h>
+ #include <sys/resource.h>
+
diff --git a/sys-apps/fakeroot-ng/metadata.xml b/sys-apps/fakeroot-ng/metadata.xml
new file mode 100644
index 000000000000..0841cba5b9ee
--- /dev/null
+++ b/sys-apps/fakeroot-ng/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>proxy-maintainers</herd>
+ <maintainer>
+ <email>anthoine.bourgeois@gmail.com</email>
+ <description>Maintainer, assign bugs</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">fakerootng</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/fakeroot/Manifest b/sys-apps/fakeroot/Manifest
new file mode 100644
index 000000000000..1e33a114419a
--- /dev/null
+++ b/sys-apps/fakeroot/Manifest
@@ -0,0 +1,4 @@
+DIST fakeroot_1.18.4.orig.tar.bz2 309298 SHA256 0a359efa3e9496c33234b3e9c89306a09bb4da9d33de43c261f1d8447e6ebea2 SHA512 497292fe21d18a37eadd657fbe01db8902f4b8d87d63605928efd59789f4c14737997b9f0abc4d794dbef78066b952064bdb2dd9f0910ec75349d7dd313cd058 WHIRLPOOL cef9846747a7ef1712658cc39c5374a3921dd27b9f9540080c4be7b7eab75722c0710a0640900c51852910b0db2d44d5605f61e5c18981d56abc835269a11626
+DIST fakeroot_1.19.orig.tar.bz2 312304 SHA256 eafa6885535ff57a42248aec090fe17cfa5ca85b62cefa0d13637c9de8996868 SHA512 ff3f50cdf168deafab337d3d98299ccd4129ed2a9befa5f28171d92c2ddfa08c8f42424f32b3fbcbb1f83c16f22952e571946f4152246d08b0d18bab77c458e9 WHIRLPOOL 4fcce88f114a87a07698eede3ab384621bfff4cc3fa478c5b162e95c4901bc75647c7e7c69c8196885d96acd0658b5f3cba50e46973e010d0e4adc3f49729e00
+DIST fakeroot_1.20.2.orig.tar.bz2 326910 SHA256 7c0a164d19db3efa9e802e0fc7cdfeff70ec6d26cdbdc4338c9c2823c5ea230c SHA512 1ac231f995774aa40f43c4325cd9e6de45365963277c32a85776690c3e7fd281ac410f3d91395dc1e5e5ca3b143e89914e048632011a3985ead216e870852231 WHIRLPOOL b39d8682e13d69648f60ff70853b2588b9e638112b8874794e1c6bccb6c060868ee81031887cb7aacf78d2fa2ec9f00c4103655d24406d001e076c43b4ca6c1d
+DIST fakeroot_1.20.orig.tar.bz2 321491 SHA256 2297b7e79487cf0bbc64ff6d3d02446d895e82e2b26467c74fd1119011f6f098 SHA512 b041ab87559f784041f05bfa9d5186ceaafebbcbd03057ede62bf420551e337ceec4b7101854937e206c6389ac2c0719545d5971457edaf564856bb44ce7b4b6 WHIRLPOOL 00b55e38004b3bb843e06299e014fb776150efc398b42099fa1772c4999aa3282a244c0987123f33aee9f844351dd9a31cf6c218c3439aebf1cba2c633a2b7bb
diff --git a/sys-apps/fakeroot/fakeroot-1.18.4.ebuild b/sys-apps/fakeroot/fakeroot-1.18.4.ebuild
new file mode 100644
index 000000000000..9fb41a9a14fc
--- /dev/null
+++ b/sys-apps/fakeroot/fakeroot-1.18.4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A fake root environment by means of LD_PRELOAD and SysV IPC (or TCP) trickery"
+HOMEPAGE="http://packages.qa.debian.org/f/fakeroot.html"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${P/-/_}.orig.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ppc sparc x86 ~amd64-linux ~x86-linux"
+IUSE="acl static-libs test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ acl? ( sys-apps/acl )
+ test? ( app-arch/sharutils )"
+
+DOCS="AUTHORS BUGS DEBUG README doc/README.saving"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.18.4-no-acl_h.patch
+}
+
+src_configure() {
+ export ac_cv_header_sys_acl_h=$(usex acl)
+
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ use static-libs || find "${ED}" -name '*.la' -exec rm -f {} +
+}
diff --git a/sys-apps/fakeroot/fakeroot-1.19.ebuild b/sys-apps/fakeroot/fakeroot-1.19.ebuild
new file mode 100644
index 000000000000..788b77b8a2c8
--- /dev/null
+++ b/sys-apps/fakeroot/fakeroot-1.19.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A fake root environment by means of LD_PRELOAD and SysV IPC (or TCP) trickery"
+HOMEPAGE="http://packages.qa.debian.org/f/fakeroot.html"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${P/-/_}.orig.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ppc sparc x86 ~amd64-linux ~x86-linux"
+IUSE="acl static-libs test"
+
+DEPEND="acl? ( sys-apps/acl )
+ test? ( app-arch/sharutils )
+ sys-libs/libcap"
+
+DOCS="AUTHORS BUGS DEBUG README doc/README.saving"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.19-no-acl_h.patch
+}
+
+src_configure() {
+ export ac_cv_header_sys_acl_h=$(usex acl)
+
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-apps/fakeroot/fakeroot-1.20.2.ebuild b/sys-apps/fakeroot/fakeroot-1.20.2.ebuild
new file mode 100644
index 000000000000..25cbea37a3aa
--- /dev/null
+++ b/sys-apps/fakeroot/fakeroot-1.20.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic
+
+DESCRIPTION="A fake root environment by means of LD_PRELOAD and SysV IPC (or TCP) trickery"
+HOMEPAGE="http://packages.qa.debian.org/f/fakeroot.html"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${P/-/_}.orig.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ppc sparc x86 ~amd64-linux ~x86-linux"
+IUSE="acl debug static-libs test"
+
+DEPEND="acl? ( sys-apps/acl )
+ test? ( app-arch/sharutils )
+ sys-libs/libcap"
+
+DOCS="AUTHORS BUGS DEBUG README doc/README.saving"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.19-no-acl_h.patch
+}
+
+src_configure() {
+ export ac_cv_header_sys_acl_h=$(usex acl)
+
+ use debug && append-cppflags "-DLIBFAKEROOT_DEBUGGING"
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-apps/fakeroot/fakeroot-1.20.ebuild b/sys-apps/fakeroot/fakeroot-1.20.ebuild
new file mode 100644
index 000000000000..7f05451d4270
--- /dev/null
+++ b/sys-apps/fakeroot/fakeroot-1.20.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 flag-o-matic
+
+DESCRIPTION="A fake root environment by means of LD_PRELOAD and SysV IPC (or TCP) trickery"
+HOMEPAGE="http://packages.qa.debian.org/f/fakeroot.html"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${P/-/_}.orig.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="acl debug static-libs test"
+
+DEPEND="acl? ( sys-apps/acl )
+ test? ( app-arch/sharutils )
+ sys-libs/libcap"
+
+DOCS="AUTHORS BUGS DEBUG README doc/README.saving"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.19-no-acl_h.patch
+}
+
+src_configure() {
+ export ac_cv_header_sys_acl_h=$(usex acl)
+
+ use debug && append-cppflags "-DLIBFAKEROOT_DEBUGGING"
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-apps/fakeroot/files/fakeroot-1.18.4-no-acl_h.patch b/sys-apps/fakeroot/files/fakeroot-1.18.4-no-acl_h.patch
new file mode 100644
index 000000000000..dbd9dd7758e9
--- /dev/null
+++ b/sys-apps/fakeroot/files/fakeroot-1.18.4-no-acl_h.patch
@@ -0,0 +1,35 @@
+http://bugs.gentoo.org/424419
+
+--- libfakeroot.c
++++ libfakeroot.c
+@@ -1551,6 +1551,7 @@
+ return fakeroot_disabled;
+ }
+
++#ifdef HAVE_SYS_ACL_H
+ #ifdef HAVE_ACL_T
+ int acl_set_fd(int fd, acl_t acl) {
+ errno = ENOTSUP;
+@@ -1561,6 +1562,7 @@
+ errno = ENOTSUP;
+ return -1;
+ }
++#endif /* HAVE_ACL_T */
+ #endif /* HAVE_SYS_ACL_H */
+
+ #ifdef HAVE_FTS_READ
+--- wrapfunc.inp
++++ wrapfunc.inp
+@@ -167,10 +167,12 @@
+ #endif /* HAVE_UNLINKAT */
+ #endif /* HAVE_FSTATAT */
+
++#ifdef HAVE_SYS_ACL_H
+ #ifdef HAVE_ACL_T
+ acl_set_fd;int;(int fd, acl_t acl);(fd, acl)
+ acl_set_file;int;(const char *path_p, acl_type_t type, acl_t acl);(path_p, type, acl)
+ #endif /* HAVE_ACL_T */
++#endif /* HAVE_SYS_ACL_H */
+
+ #ifdef HAVE_FTS_READ
+ fts_read;FTSENT *;(FTS *ftsp);(ftsp)
diff --git a/sys-apps/fakeroot/files/fakeroot-1.19-no-acl_h.patch b/sys-apps/fakeroot/files/fakeroot-1.19-no-acl_h.patch
new file mode 100644
index 000000000000..d208b8ffa43b
--- /dev/null
+++ b/sys-apps/fakeroot/files/fakeroot-1.19-no-acl_h.patch
@@ -0,0 +1,37 @@
+http://bugs.gentoo.org/424419
+
+--- fakeroot-1.19/libfakeroot.c
++++ fakeroot-1.19/libfakeroot.c
+@@ -1908,6 +1908,7 @@
+ return fakeroot_disabled;
+ }
+
++#ifdef HAVE_SYS_ACL_H
+ #ifdef HAVE_ACL_T
+ acl_t acl_get_fd(int fd) {
+ errno = ENOTSUP;
+@@ -1926,6 +1927,7 @@
+ errno = ENOTSUP;
+ return -1;
+ }
++#endif /* HAVE_ACL_T */
+ #endif /* HAVE_SYS_ACL_H */
+
+ #ifdef HAVE_FTS_READ
+--- fakeroot-1.19/wrapfunc.inp
++++ fakeroot-1.19/wrapfunc.inp
+@@ -206,12 +206,14 @@
+ #endif /* HAVE_UNLINKAT */
+ #endif /* HAVE_FSTATAT */
+
++#ifdef HAVE_SYS_ACL_H
+ #ifdef HAVE_ACL_T
+ acl_get_fd;acl_t;(int fd);(fd)
+ acl_get_file;acl_t;(const char *path_p, acl_type_t type);(path_p, type)
+ acl_set_fd;int;(int fd, acl_t acl);(fd, acl)
+ acl_set_file;int;(const char *path_p, acl_type_t type, acl_t acl);(path_p, type, acl)
+ #endif /* HAVE_ACL_T */
++#endif /* HAVE_SYS_ACL_H */
+
+ #ifdef HAVE_FTS_READ
+ fts_read;FTSENT *;(FTS *ftsp);(ftsp)
diff --git a/sys-apps/fakeroot/metadata.xml b/sys-apps/fakeroot/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/fakeroot/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-apps/fbset/Manifest b/sys-apps/fbset/Manifest
new file mode 100644
index 000000000000..b16b512cd8b9
--- /dev/null
+++ b/sys-apps/fbset/Manifest
@@ -0,0 +1 @@
+DIST fbset-2.1.tar.gz 27721 SHA256 40ff4ab0247b75138a0887ed40f81c1a6184f340b77126c16d074b1075b41c20 SHA512 7e0380760f77b0db7dcc128f6375a3ed8da4b8521d1926faba27812c5cb20e6f1a62f3a539591a81a6b7e7986940db4cd83e03d6de487e0ab7f0760ed1d21b28 WHIRLPOOL a45b2b1031cd9fc626b318a4df1d697ccc710f86eeba9f7013b738a23f7910d4c73ca5b4bad8ed07a18cf5b60aa8d7a3dbb56424bf56a8346f2c7d94fd97d957
diff --git a/sys-apps/fbset/fbset-2.1.ebuild b/sys-apps/fbset/fbset-2.1.ebuild
new file mode 100644
index 000000000000..a4244f2bde06
--- /dev/null
+++ b/sys-apps/fbset/fbset-2.1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="A utility to set the framebuffer videomode"
+HOMEPAGE="http://users.telenet.be/geertu/Linux/fbdev/"
+SRC_URI="http://users.telenet.be/geertu/Linux/fbdev/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
+IUSE="static"
+
+DEPEND="sys-devel/bison
+ sys-devel/flex"
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-build.patch"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ tc-export CC
+ emake || die "emake failed"
+}
+
+src_install() {
+ dobin fbset modeline2fb || die "dobin failed"
+ doman *.[58]
+ dodoc etc/fb.modes.* INSTALL
+}
diff --git a/sys-apps/fbset/files/fbset-2.1-build.patch b/sys-apps/fbset/files/fbset-2.1-build.patch
new file mode 100644
index 000000000000..94a323bb39ac
--- /dev/null
+++ b/sys-apps/fbset/files/fbset-2.1-build.patch
@@ -0,0 +1,21 @@
+Index: fbset-2.1/Makefile
+===================================================================
+--- fbset-2.1.orig/Makefile
++++ fbset-2.1/Makefile
+@@ -2,7 +2,6 @@
+ # Linux Frame Buffer Device Configuration
+ #
+
+-CC = gcc -Wall -O2 -I.
+ BISON = bison -d
+ FLEX = flex
+ INSTALL = install
+@@ -20,6 +19,8 @@ lex.yy.o: lex.yy.c fbset.h modes.tab.h
+ lex.yy.c: modes.l
+ $(FLEX) modes.l
+
++modes.tab.h: modes.tab.c
++
+ modes.tab.c: modes.y
+ $(BISON) modes.y
+
diff --git a/sys-apps/fbset/metadata.xml b/sys-apps/fbset/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/fbset/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-apps/file/Manifest b/sys-apps/file/Manifest
new file mode 100644
index 000000000000..6355ea5e3d1a
--- /dev/null
+++ b/sys-apps/file/Manifest
@@ -0,0 +1,3 @@
+DIST file-5.22.tar.gz 732556 SHA256 c4e3a8e44cb888c5e4b476e738503e37fb9de3b25a38c143e214bfc12109fc0b SHA512 e9f1648c3b490bac642a2a9e01d31a8bd49c3e2a1feea1b25869aa1d5e37aa99bbf3fdc5d301618a8b97aec046f10e400a57f8a1d0dd61d3583830aaf3fcbda8 WHIRLPOOL de9ce9305fd824d85128617e196fe6b02ea470b63eb2a35d31e857f7cf91e09f85166aaa72695aaf4a7516413b3a146db85588e7da65f32b131a477b3dece176
+DIST file-5.23.tar.gz 737618 SHA256 2c8ab3ff143e2cdfb5ecee381752f80a79e0b4cfe9ca4cc6e1c3e5ec15e6157c SHA512 30c4177819bc453854da644122ef5c1b7a9cba9b5ff6ee8e02eb889064203d75ce59cf3b08a41653e72f5567d442062fd65bb08c1670d294d36f10004ab28d5f WHIRLPOOL a222f85317e99929affb5daa3baf4090eadce92fb1f390ee26ccfbfa289309f602075ac0b45205417126979229188b27be553595b03180fb34989381d0b4bddc
+DIST file-5.24.tar.gz 737911 SHA256 802cb3de2e49e88ef97cdcb52cd507a0f25458112752e398445cea102bc750ce SHA512 9b804bbba1a77e183dbd68d4e2380d1d7e8a4dbdc6992adabab0e6fee4689f3ea8d262e5645224f4c97d7aaf988fe55c2a143c776111d9107e519692b81e6e8d WHIRLPOOL cd9efe3b4ae6a2276f431d4d22f959ab26511515d530ee7a698b547d30d89ee10854f1e7f758be068e06c7d40bc27b04ec6e92640faf1a0eb4be17344b713df5
diff --git a/sys-apps/file/file-5.22-r1.ebuild b/sys-apps/file/file-5.22-r1.ebuild
new file mode 100644
index 000000000000..e1583992dd32
--- /dev/null
+++ b/sys-apps/file/file-5.22-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"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+DISTUTILS_OPTIONAL=1
+
+inherit eutils distutils-r1 libtool toolchain-funcs multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/glensc/file.git"
+ inherit autotools git-r3
+else
+ SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz
+ ftp://ftp.gw.com/mirrors/pub/unix/file/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="identify a file's format by scanning binary data for patterns"
+HOMEPAGE="http://www.darwinsys.com/file/"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="python static-libs zlib"
+
+DEPEND="python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r21
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+RDEPEND="${DEPEND}
+ python? ( !dev-python/python-magic )"
+
+src_prepare() {
+ [[ ${PV} == "9999" ]] && eautoreconf
+ elibtoolize
+
+ # don't let python README kill main README #60043
+ mv python/README{,.python}
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=$(usex zlib) \
+ ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_configure() {
+ # when cross-compiling, we need to build up our own file
+ # because people often don't keep matching host/target
+ # file versions #362941
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ mkdir -p "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
+ tc-export_build_env BUILD_C{C,XX}
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=no \
+ ac_cv_lib_z_gzopen=no \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} -static" \
+ CC=${BUILD_CC} \
+ CXX=${BUILD_CXX} \
+ econf --disable-shared
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ emake
+ else
+ emake -C src libmagic.la
+ fi
+}
+
+src_compile() {
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ emake -C "${WORKDIR}"/build/src file
+ PATH="${WORKDIR}/build/src:${PATH}"
+ fi
+ multilib-minimal_src_compile
+
+ use python && cd python && distutils-r1_src_compile
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ default
+ else
+ emake -C src install-{includeHEADERS,libLTLIBRARIES} DESTDIR="${D}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog MAINT README
+
+ use python && cd python && distutils-r1_src_install
+ prune_libtool_files
+}
diff --git a/sys-apps/file/file-5.22.ebuild b/sys-apps/file/file-5.22.ebuild
new file mode 100644
index 000000000000..ce6174b7063a
--- /dev/null
+++ b/sys-apps/file/file-5.22.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+DISTUTILS_OPTIONAL=1
+
+inherit eutils distutils-r1 libtool toolchain-funcs multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/glensc/file.git"
+ inherit autotools git-r3
+else
+ SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz
+ ftp://ftp.gw.com/mirrors/pub/unix/file/${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="identify a file's format by scanning binary data for patterns"
+HOMEPAGE="http://www.darwinsys.com/file/"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="python static-libs zlib"
+
+DEPEND="python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r21
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+RDEPEND="${DEPEND}
+ python? ( !dev-python/python-magic )"
+
+src_prepare() {
+ [[ ${PV} == "9999" ]] && eautoreconf
+ elibtoolize
+
+ # don't let python README kill main README #60043
+ mv python/README{,.python}
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=$(usex zlib) \
+ ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_configure() {
+ # when cross-compiling, we need to build up our own file
+ # because people often don't keep matching host/target
+ # file versions #362941
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ mkdir -p "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
+ tc-export_build_env BUILD_C{C,XX}
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=no \
+ ac_cv_lib_z_gzopen=no \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} -static" \
+ CC=${BUILD_CC} \
+ CXX=${BUILD_CXX} \
+ econf --disable-shared
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ emake
+ else
+ emake -C src libmagic.la
+ fi
+}
+
+src_compile() {
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ emake -C "${WORKDIR}"/build/src file
+ PATH="${WORKDIR}/build/src:${PATH}"
+ fi
+ multilib-minimal_src_compile
+
+ use python && cd python && distutils-r1_src_compile
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ default
+ else
+ emake -C src install-{includeHEADERS,libLTLIBRARIES} DESTDIR="${D}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog MAINT README
+
+ use python && cd python && distutils-r1_src_install
+ prune_libtool_files
+}
diff --git a/sys-apps/file/file-5.23.ebuild b/sys-apps/file/file-5.23.ebuild
new file mode 100644
index 000000000000..e1583992dd32
--- /dev/null
+++ b/sys-apps/file/file-5.23.ebuild
@@ -0,0 +1,105 @@
+# 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} pypy )
+DISTUTILS_OPTIONAL=1
+
+inherit eutils distutils-r1 libtool toolchain-funcs multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/glensc/file.git"
+ inherit autotools git-r3
+else
+ SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz
+ ftp://ftp.gw.com/mirrors/pub/unix/file/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="identify a file's format by scanning binary data for patterns"
+HOMEPAGE="http://www.darwinsys.com/file/"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="python static-libs zlib"
+
+DEPEND="python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r21
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+RDEPEND="${DEPEND}
+ python? ( !dev-python/python-magic )"
+
+src_prepare() {
+ [[ ${PV} == "9999" ]] && eautoreconf
+ elibtoolize
+
+ # don't let python README kill main README #60043
+ mv python/README{,.python}
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=$(usex zlib) \
+ ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_configure() {
+ # when cross-compiling, we need to build up our own file
+ # because people often don't keep matching host/target
+ # file versions #362941
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ mkdir -p "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
+ tc-export_build_env BUILD_C{C,XX}
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=no \
+ ac_cv_lib_z_gzopen=no \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} -static" \
+ CC=${BUILD_CC} \
+ CXX=${BUILD_CXX} \
+ econf --disable-shared
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ emake
+ else
+ emake -C src libmagic.la
+ fi
+}
+
+src_compile() {
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ emake -C "${WORKDIR}"/build/src file
+ PATH="${WORKDIR}/build/src:${PATH}"
+ fi
+ multilib-minimal_src_compile
+
+ use python && cd python && distutils-r1_src_compile
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ default
+ else
+ emake -C src install-{includeHEADERS,libLTLIBRARIES} DESTDIR="${D}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog MAINT README
+
+ use python && cd python && distutils-r1_src_install
+ prune_libtool_files
+}
diff --git a/sys-apps/file/file-5.24.ebuild b/sys-apps/file/file-5.24.ebuild
new file mode 100644
index 000000000000..e1583992dd32
--- /dev/null
+++ b/sys-apps/file/file-5.24.ebuild
@@ -0,0 +1,105 @@
+# 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} pypy )
+DISTUTILS_OPTIONAL=1
+
+inherit eutils distutils-r1 libtool toolchain-funcs multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/glensc/file.git"
+ inherit autotools git-r3
+else
+ SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz
+ ftp://ftp.gw.com/mirrors/pub/unix/file/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="identify a file's format by scanning binary data for patterns"
+HOMEPAGE="http://www.darwinsys.com/file/"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="python static-libs zlib"
+
+DEPEND="python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r21
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+RDEPEND="${DEPEND}
+ python? ( !dev-python/python-magic )"
+
+src_prepare() {
+ [[ ${PV} == "9999" ]] && eautoreconf
+ elibtoolize
+
+ # don't let python README kill main README #60043
+ mv python/README{,.python}
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=$(usex zlib) \
+ ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_configure() {
+ # when cross-compiling, we need to build up our own file
+ # because people often don't keep matching host/target
+ # file versions #362941
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ mkdir -p "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
+ tc-export_build_env BUILD_C{C,XX}
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=no \
+ ac_cv_lib_z_gzopen=no \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} -static" \
+ CC=${BUILD_CC} \
+ CXX=${BUILD_CXX} \
+ econf --disable-shared
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ emake
+ else
+ emake -C src libmagic.la
+ fi
+}
+
+src_compile() {
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ emake -C "${WORKDIR}"/build/src file
+ PATH="${WORKDIR}/build/src:${PATH}"
+ fi
+ multilib-minimal_src_compile
+
+ use python && cd python && distutils-r1_src_compile
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ default
+ else
+ emake -C src install-{includeHEADERS,libLTLIBRARIES} DESTDIR="${D}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog MAINT README
+
+ use python && cd python && distutils-r1_src_install
+ prune_libtool_files
+}
diff --git a/sys-apps/file/file-9999.ebuild b/sys-apps/file/file-9999.ebuild
new file mode 100644
index 000000000000..e1583992dd32
--- /dev/null
+++ b/sys-apps/file/file-9999.ebuild
@@ -0,0 +1,105 @@
+# 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} pypy )
+DISTUTILS_OPTIONAL=1
+
+inherit eutils distutils-r1 libtool toolchain-funcs multilib-minimal
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://github.com/glensc/file.git"
+ inherit autotools git-r3
+else
+ SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz
+ ftp://ftp.gw.com/mirrors/pub/unix/file/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="identify a file's format by scanning binary data for patterns"
+HOMEPAGE="http://www.darwinsys.com/file/"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="python static-libs zlib"
+
+DEPEND="python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r21
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+RDEPEND="${DEPEND}
+ python? ( !dev-python/python-magic )"
+
+src_prepare() {
+ [[ ${PV} == "9999" ]] && eautoreconf
+ elibtoolize
+
+ # don't let python README kill main README #60043
+ mv python/README{,.python}
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=$(usex zlib) \
+ ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_configure() {
+ # when cross-compiling, we need to build up our own file
+ # because people often don't keep matching host/target
+ # file versions #362941
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ mkdir -p "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
+ tc-export_build_env BUILD_C{C,XX}
+ ECONF_SOURCE=${S} \
+ ac_cv_header_zlib_h=no \
+ ac_cv_lib_z_gzopen=no \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} -static" \
+ CC=${BUILD_CC} \
+ CXX=${BUILD_CXX} \
+ econf --disable-shared
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi ; then
+ emake
+ else
+ emake -C src libmagic.la
+ fi
+}
+
+src_compile() {
+ if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then
+ emake -C "${WORKDIR}"/build/src file
+ PATH="${WORKDIR}/build/src:${PATH}"
+ fi
+ multilib-minimal_src_compile
+
+ use python && cd python && distutils-r1_src_compile
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi ; then
+ default
+ else
+ emake -C src install-{includeHEADERS,libLTLIBRARIES} DESTDIR="${D}"
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog MAINT README
+
+ use python && cd python && distutils-r1_src_install
+ prune_libtool_files
+}
diff --git a/sys-apps/file/metadata.xml b/sys-apps/file/metadata.xml
new file mode 100644
index 000000000000..d05cbc00cc09
--- /dev/null
+++ b/sys-apps/file/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>
+ <bugs-to>http://bugs.gw.com/</bugs-to>
+</upstream>
+</pkgmetadata>
diff --git a/sys-apps/findutils/Manifest b/sys-apps/findutils/Manifest
new file mode 100644
index 000000000000..65f4c71f5fa0
--- /dev/null
+++ b/sys-apps/findutils/Manifest
@@ -0,0 +1,3 @@
+DIST findutils-4.4.2.tar.gz 2149838 SHA256 434f32d171cbc0a5e72cfc5372c6fc4cb0e681f8dce566a0de5b6fccd702b62a SHA512 262d0a8301158e6541b9f24e4e043d8d8c1b196b18dbe59c3bedcf17b50c95708e33ab23a07e3bfb947ad495faafffdca3c296fb525794ca60f2dfd682f228c1 WHIRLPOOL 2af1467403ece2f290be6b9f69db013d386427ab553efcf750ce36bf608fab0d37708209c22bf61b8a82f41aa13bf25a247c62f78dc95446290b7a4bd35d3393
+DIST findutils-4.5.12.tar.gz 3236073 SHA256 df859eebad68c216204363f163c0e4200208ce7348f3658564a120e32e4f63de SHA512 d909ca2d3629f871e6f79e99cf547f76ea73dad773972923c177267c272a7c82e308cca22e5c8746e6aca33dee8110f1af390fbe2abf93544e5917e6475ab2f8 WHIRLPOOL 046ef3394c0834800139c1c5a6c9caddbbf36190d27bb28bd2afa212c00bbbef6c959441f2afc36c058d3cee279d3b6c971192ff442e796ee7e72edfb76b2730
+DIST findutils-4.5.14.tar.gz 3536727 SHA256 0de3cf625a5c9f154eee3171e072515ffdde405244dd00502af617ac57b73ae2 SHA512 e26f0d58c316202d99d7dcc1c4d4d40591150dcf198dff2dab0f8ef5e4dc039a5ff42ef536bfc08d860f39ee4bd8215591b4cb460ff45f73007040fc5f99e66b WHIRLPOOL 116b725ffb76562a3f1e9bbfa475a791b873746a7ae362eea1a97f3b701c6e32508eafb10fe47a3ad8f56ef0e67fb04a5d98a7baf5371646945718e7aff5ad60
diff --git a/sys-apps/findutils/files/findutils-4.4.2-gnulib-date-x32.patch b/sys-apps/findutils/files/findutils-4.4.2-gnulib-date-x32.patch
new file mode 100644
index 000000000000..9ff86f6b84a6
--- /dev/null
+++ b/sys-apps/findutils/files/findutils-4.4.2-gnulib-date-x32.patch
@@ -0,0 +1,26 @@
+newer gnulib has rewritten these checks in a way that works for the x32,
+and for the targets we care about, these checks won't return false. so
+just drop them to make our life simpler.
+
+https://sites.google.com/site/x32abi/x32-patches
+
+--- findutils-4.4.2/gnulib/lib/getdate.c.x32 2009-05-10 14:23:57.000000000 -0700
++++ findutils-4.4.2/gnulib/lib/getdate.c 2011-12-05 11:41:18.130675712 -0800
+@@ -114,7 +114,6 @@
+ wraps around, but there's no portable way to check for that at
+ compile-time. */
+ verify (TYPE_IS_INTEGER (time_t));
+-verify (LONG_MIN <= TYPE_MINIMUM (time_t) && TYPE_MAXIMUM (time_t) <= LONG_MAX);
+
+ /* An integer value, and the number of digits in its textual
+ representation. */
+--- findutils-4.4.2/gnulib/lib/mktime.c.x32 2009-05-10 14:25:13.000000000 -0700
++++ findutils-4.4.2/gnulib/lib/mktime.c 2011-12-05 11:49:38.368589386 -0800
+@@ -166,7 +166,5 @@ ydhms_diff (long int year1, long int yda
+ {
+ verify (C99_integer_division, -1 / 2 == 0);
+- verify (long_int_year_and_yday_are_wide_enough,
+- INT_MAX <= LONG_MAX / 2 || TIME_T_MAX <= UINT_MAX);
+
+ /* Compute intervening leap days correctly even if year is negative.
+ Take care to avoid integer overflow here. */
diff --git a/sys-apps/findutils/files/findutils-4.4.2-selinux.diff b/sys-apps/findutils/files/findutils-4.4.2-selinux.diff
new file mode 100644
index 000000000000..66c9c412a0af
--- /dev/null
+++ b/sys-apps/findutils/files/findutils-4.4.2-selinux.diff
@@ -0,0 +1,464 @@
+diff -purN findutils-4.4.2.orig/find/Makefile.am findutils-4.4.2/find/Makefile.am
+--- findutils-4.4.2.orig/find/Makefile.am 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/Makefile.am 2010-04-25 03:58:33.762402367 +0000
+@@ -2,6 +2,7 @@ AUTOMAKE_OPTIONS = std-options
+ localedir = $(datadir)/locale
+ # noinst_PROGRAMS = regexprops
+ # regexprops_SOURCES = regexprops.c
++DEFS = @DEFS@ -I. -I$(srcdir) -I.. -DWITH_SELINUX
+
+ noinst_LIBRARIES = libfindtools.a
+ libfindtools_a_SOURCES = finddata.c fstype.c parser.c pred.c tree.c util.c
+@@ -26,7 +27,7 @@ endif
+
+ EXTRA_DIST = defs.h $(man_MANS)
+ INCLUDES = -I../gnulib/lib -I$(top_srcdir)/lib -I$(top_srcdir)/gnulib/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+-LDADD = ./libfindtools.a ../lib/libfind.a ../gnulib/lib/libgnulib.a @INTLLIBS@ @LIB_CLOCK_GETTIME@ @FINDLIBS@
++LDADD = ./libfindtools.a ../lib/libfind.a ../gnulib/lib/libgnulib.a @INTLLIBS@ @LIB_CLOCK_GETTIME@ @FINDLIBS@ -lselinux
+ man_MANS = find.1
+ SUBDIRS = . testsuite
+
+diff -purN findutils-4.4.2.orig/find/Makefile.in findutils-4.4.2/find/Makefile.in
+--- findutils-4.4.2.orig/find/Makefile.in 2009-05-16 15:28:13.000000000 +0000
++++ findutils-4.4.2/find/Makefile.in 2010-04-25 03:58:33.762402367 +0000
+@@ -275,7 +275,7 @@ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+ CYGPATH_W = @CYGPATH_W@
+ DEFAULT_ARG_SIZE = @DEFAULT_ARG_SIZE@
+-DEFS = @DEFS@
++DEFS = @DEFS@ -I. -I$(srcdir) -I.. -DWITH_SELINUX
+ DEPDIR = @DEPDIR@
+ DIRENT_H = @DIRENT_H@
+ ECHO_C = @ECHO_C@
+@@ -607,7 +607,7 @@ libfindtools_a_SOURCES = finddata.c fsty
+ @WITH_FTS_TRUE@oldfind_SOURCES = find.c
+ @WITH_FTS_FALSE@ftsfind_SOURCES = ftsfind.c
+ EXTRA_DIST = defs.h $(man_MANS)
+-LDADD = ./libfindtools.a ../lib/libfind.a ../gnulib/lib/libgnulib.a @INTLLIBS@ @LIB_CLOCK_GETTIME@ @FINDLIBS@
++LDADD = ./libfindtools.a ../lib/libfind.a ../gnulib/lib/libgnulib.a @INTLLIBS@ @LIB_CLOCK_GETTIME@ @FINDLIBS@ -lselinux
+ man_MANS = find.1
+ SUBDIRS = . testsuite
+ all: all-recursive
+diff -purN findutils-4.4.2.orig/find/defs.h findutils-4.4.2/find/defs.h
+--- findutils-4.4.2.orig/find/defs.h 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/defs.h 2010-04-25 03:58:33.762402367 +0000
+@@ -91,6 +91,9 @@ int get_statinfo PARAMS((const char *pat
+ #define MODE_RWX (S_IXUSR | S_IXGRP | S_IXOTH | MODE_RW)
+ #define MODE_ALL (S_ISUID | S_ISGID | S_ISVTX | MODE_RWX)
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++#endif /*WITH_SELINUX*/
+
+ struct predicate;
+ struct options;
+@@ -315,6 +318,9 @@ struct predicate
+ struct samefile_file_id samefileid; /* samefile */
+ mode_t type; /* type */
+ struct format_val printf_vec; /* printf fprintf fprint ls fls print0 fprint0 print */
++#ifdef WITH_SELINUX
++ security_context_t scontext; /* scontext */
++#endif /*WITH_SELINUX*/
+ } args;
+
+ /* The next predicate in the user input sequence,
+@@ -459,7 +465,9 @@ PREDICATEFUNCTION pred_used;
+ PREDICATEFUNCTION pred_user;
+ PREDICATEFUNCTION pred_writable;
+ PREDICATEFUNCTION pred_xtype;
+-
++#ifdef WITH_SELINUX
++PREDICATEFUNCTION pred_scontext;
++#endif /* WITH_SELINUX */
+
+
+ int launch PARAMS((const struct buildcmd_control *ctl,
+@@ -605,10 +613,13 @@ struct options
+ */
+ unsigned short optimisation_level;
+
+-
+ /* How should we quote filenames in error messages and so forth?
+ */
+ enum quoting_style err_quoting_style;
++
++#ifdef WITH_SELINUX
++ int (*x_getfilecon)();
++#endif /* WITH_SELINUX */
+ };
+ extern struct options options;
+
+diff -purN findutils-4.4.2.orig/find/find.1 findutils-4.4.2/find/find.1
+--- findutils-4.4.2.orig/find/find.1 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/find.1 2010-04-25 03:58:33.762402367 +0000
+@@ -934,6 +934,10 @@ checks the type of the file that
+ .B \-type
+ does not check.
+
++.IP "\-context \fIscontext\fR"
++.IP "\--context \fIscontext\fR"
++(SELinux only) File has the security context \fIscontext\fR.
++
+ .SS ACTIONS
+ .IP "\-delete\fR"
+ Delete files; true if removal succeeded. If the removal failed, an
+@@ -1354,6 +1358,8 @@ File's type (like in
+ U=unknown type (shouldn't happen)
+ .IP %Y
+ File's type (like %y), plus follow symlinks: L=loop, N=nonexistent
++.IP %Z
++(SELinux only) file's security context.
+ .PP
+ A `%' character followed by any other character is discarded, but the
+ other character is printed (don't rely on this, as further format
+diff -purN findutils-4.4.2.orig/find/find.c findutils-4.4.2/find/find.c
+--- findutils-4.4.2.orig/find/find.c 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/find.c 2010-04-25 03:58:33.764899827 +0000
+@@ -1270,7 +1270,7 @@ process_path (char *pathname, char *name
+ static void
+ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, char *parent)
+ {
+- int subdirs_left; /* Number of unexamined subdirs in PATHNAME. */
++ int subdirs_left=0; /* Number of unexamined subdirs in PATHNAME. */
+ boolean subdirs_unreliable; /* if true, cannot use dir link count as subdir limif (if false, it may STILL be unreliable) */
+ unsigned int idx; /* Which entry are we on? */
+ struct stat stat_buf;
+diff -purN findutils-4.4.2.orig/find/parser.c findutils-4.4.2/find/parser.c
+--- findutils-4.4.2.orig/find/parser.c 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/parser.c 2010-04-25 03:58:33.764899827 +0000
+@@ -53,6 +53,13 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++int optionh_getfilecon(const char *name, security_context_t *p);
++int optionl_getfilecon(const char *name, security_context_t *p);
++int optionp_getfilecon(const char *name, security_context_t *p);
++#endif /*WITH_SELINUX*/
++
+ #if ENABLE_NLS
+ # include <libintl.h>
+ # define _(Text) gettext (Text)
+@@ -155,6 +162,9 @@ static boolean parse_noignore_race PARAM
+ static boolean parse_warn PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
+ static boolean parse_xtype PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
+ static boolean parse_quit PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
++#ifdef WITH_SELINUX
++static boolean parse_scontext PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
++#endif /*WITH_SELINUX*/
+
+ boolean parse_print PARAMS((const struct parser_table*, char *argv[], int *arg_ptr));
+
+@@ -340,6 +350,8 @@ static struct parser_table const parse_t
+ {ARG_TEST, "-help", parse_help, NULL}, /* GNU */
+ {ARG_TEST, "version", parse_version, NULL}, /* GNU */
+ {ARG_TEST, "-version", parse_version, NULL}, /* GNU */
++ {ARG_TEST, "context", parse_scontext, pred_scontext}, /* SELinux */
++ {ARG_TEST, "-context", parse_scontext, pred_scontext}, /* SELinux */
+ {0, 0, 0, 0}
+ };
+
+@@ -451,10 +463,16 @@ set_follow_state(enum SymlinkOption opt)
+ case SYMLINK_ALWAYS_DEREF: /* -L */
+ options.xstat = optionl_stat;
+ options.no_leaf_check = true;
++#ifdef WITH_SELINUX
++ options.x_getfilecon = optionl_getfilecon;
++#endif /* WITH_SELINUX */
+ break;
+
+ case SYMLINK_NEVER_DEREF: /* -P (default) */
+ options.xstat = optionp_stat;
++#ifdef WITH_SELINUX
++ options.x_getfilecon = optionp_getfilecon;
++#endif /* WITH_SELINUX */
+ /* Can't turn no_leaf_check off because the user might have specified
+ * -noleaf anyway
+ */
+@@ -463,6 +481,9 @@ set_follow_state(enum SymlinkOption opt)
+ case SYMLINK_DEREF_ARGSONLY: /* -H */
+ options.xstat = optionh_stat;
+ options.no_leaf_check = true;
++#ifdef WITH_SELINUX
++ options.x_getfilecon = optionh_getfilecon;
++#endif /* WITH_SELINUX */
+ }
+ }
+ options.symlink_handling = opt;
+@@ -670,6 +691,94 @@ collect_arg_stat_info(char **argv, int *
+
+ The predicate structure is updated with the new information. */
+
++#ifdef WITH_SELINUX
++
++static int
++fallback_getfilecon(const char *name, security_context_t *p, int prev_rv)
++{
++ /* Our original getfilecon() call failed. Perhaps we can't follow a
++ * symbolic link. If that might be the problem, lgetfilecon() the link.
++ * Otherwise, admit defeat.
++ */
++ switch (errno)
++ {
++ case ENOENT:
++ case ENOTDIR:
++#ifdef DEBUG_STAT
++ fprintf(stderr, "fallback_getfilecon(): getfilecon(%s) failed; falling back on lgetfilecon()\n", name);
++#endif
++ return lgetfilecon(name, p);
++
++ case EACCES:
++ case EIO:
++ case ELOOP:
++ case ENAMETOOLONG:
++#ifdef EOVERFLOW
++ case EOVERFLOW: /* EOVERFLOW is not #defined on UNICOS. */
++#endif
++ default:
++ return prev_rv;
++ }
++}
++
++
++/* optionh_getfilecon() implements the getfilecon operation when the
++ * -H option is in effect.
++ *
++ * If the item to be examined is a command-line argument, we follow
++ * symbolic links. If the getfilecon() call fails on the command-line
++ * item, we fall back on the properties of the symbolic link.
++ *
++ * If the item to be examined is not a command-line argument, we
++ * examine the link itself.
++ */
++int
++optionh_getfilecon(const char *name, security_context_t *p)
++{
++ if (0 == state.curdepth)
++ {
++ /* This file is from the command line; deference the link (if it
++ * is a link).
++ */
++ int rv = getfilecon(name, p);
++ if (0 == rv)
++ return 0; /* success */
++ else
++ return fallback_getfilecon(name, p, rv);
++ }
++ else
++ {
++ /* Not a file on the command line; do not derefernce the link.
++ */
++ return lgetfilecon(name, p);
++ }
++}
++
++/* optionl_getfilecon() implements the getfilecon operation when the
++ * -L option is in effect. That option makes us examine the thing the
++ * symbolic link points to, not the symbolic link itself.
++ */
++int
++optionl_getfilecon(const char *name, security_context_t *p)
++{
++ int rv = getfilecon(name, p);
++ if (0 == rv)
++ return 0; /* normal case. */
++ else
++ return fallback_getfilecon(name, p, rv);
++}
++
++/* optionp_getfilecon() implements the stat operation when the -P
++ * option is in effect (this is also the default). That option makes
++ * us examine the symbolic link itself, not the thing it points to.
++ */
++int
++optionp_getfilecon(const char *name, security_context_t *p)
++{
++ return lgetfilecon(name, p);
++}
++#endif /* WITH_SELINUX */
++
+
+ static boolean
+ parse_and (const struct parser_table* entry, char **argv, int *arg_ptr)
+@@ -1128,6 +1237,10 @@ tests (N can be +N or -N or N): -amin N
+ -readable -writable -executable\n\
+ -wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N\n\
+ -used N -user NAME -xtype [bcdpfls]\n"));
++#ifdef WITH_SELINUX
++ puts (_("\
++ -context CONTEXT\n"));
++#endif /*WITH_SELINUX*/
+ puts (_("\
+ actions: -delete -print0 -printf FORMAT -fprintf FILE FORMAT -print \n\
+ -fprint0 FILE -fprint FILE -ls -fls FILE -prune -quit\n\
+@@ -2552,6 +2665,29 @@ parse_version (const struct parser_table
+ exit (0);
+ }
+
++#ifdef WITH_SELINUX
++
++static boolean
++parse_scontext ( const struct parser_table* entry, char **argv, int *arg_ptr)
++{
++ struct predicate *our_pred;
++
++ if ( (argv == NULL) || (argv[*arg_ptr] == NULL) )
++ return( false );
++
++ our_pred = insert_primary(entry);
++ our_pred->need_stat = false;
++#ifdef DEBUG
++ our_pred->p_name = find_pred_name (pred_scontext);
++#endif /*DEBUG*/
++ our_pred->args.scontext = argv[*arg_ptr];;
++
++ (*arg_ptr)++;
++ return( true );
++}
++
++#endif /*WITH_SELINUX*/
++
+ static boolean
+ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
+ {
+@@ -2803,7 +2939,11 @@ insert_fprintf (struct format_val *vec,
+ if (*scan2 == '.')
+ for (scan2++; ISDIGIT (*scan2); scan2++)
+ /* Do nothing. */ ;
++#ifdef WITH_SELINUX
++ if (strchr ("abcdDfFgGhHiklmMnpPsStuUyYZ", *scan2))
++#else
+ if (strchr ("abcdDfFgGhHiklmMnpPsStuUyY", *scan2))
++#endif
+ {
+ segmentp = make_segment (segmentp, format, scan2 - format,
+ KIND_FORMAT, *scan2, 0,
+diff -purN findutils-4.4.2.orig/find/pred.c findutils-4.4.2/find/pred.c
+--- findutils-4.4.2.orig/find/pred.c 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/pred.c 2010-04-25 03:58:33.764899827 +0000
+@@ -48,6 +48,14 @@
+ #include "error.h"
+ #include "verify.h"
+
++#ifdef WITH_SELINUX
++#include <selinux/selinux.h>
++#endif /*WITH_SELINUX*/
++
++#ifndef FNM_CASEFOLD
++#define FNM_CASEFOLD (1<<4)
++#endif /*FNM_CASEFOLD*/
++
+ #if ENABLE_NLS
+ # include <libintl.h>
+ # define _(Text) gettext (Text)
+@@ -230,6 +238,9 @@ struct pred_assoc pred_table[] =
+ {pred_user, "user "},
+ {pred_writable, "writable "},
+ {pred_xtype, "xtype "},
++#ifdef WITH_SELINUX
++ {pred_scontext, "context"},
++#endif /*WITH_SELINUX*/
+ {0, "none "}
+ };
+ #endif
+@@ -1054,6 +1065,26 @@ do_fprintf(struct format_val *dest,
+ mode_to_filetype(stat_buf->st_mode & S_IFMT));
+ }
+ break;
++#ifdef WITH_SELINUX
++ case 'Z': /* SELinux security context */
++ {
++ security_context_t scontext;
++ int rv;
++ rv = (*options.x_getfilecon)(state.rel_pathname, &scontext);
++
++ if ( rv < 0 ) {
++ fprintf(stderr, "getfileconf(%s): %s",
++ pathname, strerror(errno));
++ fflush(stderr);
++ }
++ else {
++ segment->text[segment->text_len] = 's';
++ checked_fprintf (dest, segment->text, scontext);
++ freecon(scontext);
++ }
++ }
++ break ;
++#endif /* WITH_SELINUX */
+ }
+ /* end of KIND_FORMAT case */
+ break;
+@@ -1844,6 +1875,31 @@ pred_xtype (const char *pathname, struct
+ */
+ return (pred_type (pathname, &sbuf, pred_ptr));
+ }
++
++
++#ifdef WITH_SELINUX
++
++boolean
++pred_scontext (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr)
++{
++ int rv;
++ security_context_t scontext;
++
++ rv = (* options.x_getfilecon)(state.rel_pathname, &scontext);
++
++ if ( rv < 0 ) {
++ (void) fprintf(stderr, "getfilecon(%s): %s\n", pathname, strerror(errno));
++ (void) fflush(stderr);
++ return ( false );
++ }
++
++ rv = (fnmatch(pred_ptr->args.scontext, scontext,0)==0);
++ freecon(scontext);
++ return rv;
++}
++
++#endif /*WITH_SELINUX*/
++
+
+ /* 1) fork to get a child; parent remembers the child pid
+ 2) child execs the command requested
+diff -purN findutils-4.4.2.orig/find/tree.c findutils-4.4.2/find/tree.c
+--- findutils-4.4.2.orig/find/tree.c 2009-05-16 15:17:01.000000000 +0000
++++ findutils-4.4.2/find/tree.c 2010-04-25 03:58:33.764899827 +0000
+@@ -1195,6 +1195,10 @@ build_expression_tree(int argc, char *ar
+ const struct parser_table *entry_close, *entry_print, *entry_open;
+ int i, oldi;
+
++#ifdef WITH_SELINUX
++ int is_selinux_enabled_flag = is_selinux_enabled()>0;
++#endif /* WITH_SELINUX */
++
+ predicates = NULL;
+
+ /* Find where in ARGV the predicates begin by skipping the list of
+@@ -1230,6 +1234,16 @@ build_expression_tree(int argc, char *ar
+ }
+
+ predicate_name = argv[i];
++
++#ifdef WITH_SELINUX
++ if (! is_selinux_enabled_flag) {
++ if ((strncmp(predicate_name,"-context",strlen("-context"))==0) ||
++ (strncmp(predicate_name,"--context",strlen("--context"))==0)) {
++ error (1, 0,_("Error: invalid predicate %s: the kernel is not selinux-enabled.\n"),predicate_name);
++ }
++ }
++#endif
++
+ parse_entry = find_parser (predicate_name);
+ if (parse_entry == NULL)
+ {
+@@ -1434,6 +1448,9 @@ get_new_pred (const struct parser_table
+ last_pred->need_stat = true;
+ last_pred->need_type = true;
+ last_pred->args.str = NULL;
++#ifdef WITH_SELINUX
++ last_pred->args.scontext = NULL;
++#endif
+ last_pred->pred_next = NULL;
+ last_pred->pred_left = NULL;
+ last_pred->pred_right = NULL;
diff --git a/sys-apps/findutils/files/findutils-4.5.14-test-bashisms.patch b/sys-apps/findutils/files/findutils-4.5.14-test-bashisms.patch
new file mode 100644
index 000000000000..0bfe7017b8b4
--- /dev/null
+++ b/sys-apps/findutils/files/findutils-4.5.14-test-bashisms.patch
@@ -0,0 +1,66 @@
+From 284afcb4a01996bb1a56f87da1e7c541fd0a903c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 4 Apr 2015 18:34:51 -0400
+Subject: [PATCH] test: fix bashisms
+
+These test scripts use #!/bin/sh, but then try to use bash-specific
+[[...]] tests. Change them to [...] instead.
+
+Reported-by: Paolo Pedroni <paolo.pedroni@iol.it>
+URL: https://bugs.gentoo.org/531020
+
+* find/testsuite/binary_locations.sh: Change [[...]] to [...].
+* find/testsuite/sv-34079.sh: Likewise.
+---
+ find/testsuite/binary_locations.sh | 6 +++---
+ find/testsuite/sv-34079.sh | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/find/testsuite/binary_locations.sh b/find/testsuite/binary_locations.sh
+index 96943a0..238d57f 100644
+--- a/find/testsuite/binary_locations.sh
++++ b/find/testsuite/binary_locations.sh
+@@ -1,15 +1,15 @@
+ # Source this file, don't execute it.
+
+-if [[ -z "${testname}" ]]; then
++if [ -z "${testname}" ]; then
+ echo 'Please set $testname before sourcing binary_locations.sh.' >&2
+ exit 1
+ fi
+
+ parent="$(cd .. && pwd)"
+-if [[ -f "${parent}/ftsfind" ]]; then
++if [ -f "${parent}/ftsfind" ]; then
+ ftsfind="${parent}/ftsfind"
+ oldfind="${parent}/find"
+-elif [[ -f "${parent}/oldfind" ]]; then
++elif [ -f "${parent}/oldfind" ]; then
+ ftsfind="${parent}/find"
+ oldfind="${parent}/oldfind"
+ else
+diff --git a/find/testsuite/sv-34079.sh b/find/testsuite/sv-34079.sh
+index 5773a3f..928a9af 100755
+--- a/find/testsuite/sv-34079.sh
++++ b/find/testsuite/sv-34079.sh
+@@ -41,7 +41,7 @@ make_test_data() {
+ }
+
+
+-if [[ -n "${RUN_VERY_EXPENSIVE_TESTS}" ]]; then
++if [ -n "${RUN_VERY_EXPENSIVE_TESTS}" ]; then
+ if outdir=$(mktemp -d); then
+ # Create some test files.
+ bad=""
+@@ -64,7 +64,7 @@ if [[ -n "${RUN_VERY_EXPENSIVE_TESTS}" ]]; then
+ bad="failed to set up the test in ${outdir}"
+ fi
+ rm -rf "${outdir}" || exit 1
+- if [[ -n "${bad}" ]]; then
++ if [ -n "${bad}" ]; then
+ echo "${bad}" >&2
+ exit 1
+ fi
+--
+2.3.5
+
diff --git a/sys-apps/findutils/findutils-4.4.2-r1.ebuild b/sys-apps/findutils/findutils-4.4.2-r1.ebuild
new file mode 100644
index 000000000000..276afcfeea6f
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.4.2-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+SELINUX_PATCH="findutils-4.4.2-selinux.diff"
+
+DESCRIPTION="GNU utilities for finding files"
+HOMEPAGE="http://www.gnu.org/software/findutils/"
+SRC_URI="mirror://gnu-alpha/${PN}/${P}.tar.gz
+ mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls selinux static"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-gnulib-date-x32.patch
+
+ # Don't build or install locate because it conflicts with slocate,
+ # which is a secure version of locate. See bug 18729
+ sed -i '/^SUBDIRS/s/locate//' Makefile.in
+
+ use selinux && epatch "${FILESDIR}/${SELINUX_PATCH}"
+}
+
+src_compile() {
+ use static && append-ldflags -static
+
+ local myconf
+ use userland_GNU || myconf=" --program-prefix=g"
+
+ econf \
+ $(use_enable nls) \
+ --libexecdir=/usr/$(get_libdir)/find \
+ ${myconf} \
+ || die "configure failed"
+ emake AR="$(tc-getAR)" || die "make failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc NEWS README TODO ChangeLog
+}
diff --git a/sys-apps/findutils/findutils-4.4.2-r2.ebuild b/sys-apps/findutils/findutils-4.4.2-r2.ebuild
new file mode 100644
index 000000000000..9e7d463ebd6f
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.4.2-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+SELINUX_PATCH="findutils-4.4.2-selinux.diff"
+
+DESCRIPTION="GNU utilities for finding files"
+HOMEPAGE="http://www.gnu.org/software/findutils/"
+SRC_URI="mirror://gnu-alpha/${PN}/${P}.tar.gz
+ mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="debug nls selinux static"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gnulib-date-x32.patch
+
+ # Don't build or install locate because it conflicts with slocate,
+ # which is a secure version of locate. See bug 18729
+ sed -i '/^SUBDIRS/s/locate//' Makefile.in
+
+ use selinux && epatch "${FILESDIR}/${SELINUX_PATCH}"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ program_prefix=$(usex userland_GNU '' g)
+ econf \
+ --program-prefix=${program_prefix} \
+ $(use_enable debug) \
+ $(use_enable nls) \
+ --libexecdir='$(libdir)'/find
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
+
+src_install() {
+ default
+
+ # We don't need this, so punt it.
+ rm "${ED}"/usr/bin/${program_prefix}oldfind || die
+}
diff --git a/sys-apps/findutils/findutils-4.5.12.ebuild b/sys-apps/findutils/findutils-4.5.12.ebuild
new file mode 100644
index 000000000000..267db222cc40
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.5.12.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="GNU utilities for finding files"
+HOMEPAGE="http://www.gnu.org/software/findutils/"
+SRC_URI="mirror://gnu-alpha/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls selinux static"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ # Don't build or install locate because it conflicts with slocate,
+ # which is a secure version of locate. See bug 18729
+ sed -i '/^SUBDIRS/s/locate//' Makefile.in
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ program_prefix=$(usex userland_GNU '' g)
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR}" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --program-prefix=${program_prefix} \
+ $(use_enable nls) \
+ $(use_with selinux) \
+ --libexecdir='$(libdir)'/find
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc NEWS README TODO ChangeLog
+
+ # We don't need this, so punt it.
+ rm "${ED}"/usr/bin/${program_prefix}oldfind \
+ "${ED}"/usr/share/man/man1/${program_prefix}oldfind.1 || die
+}
diff --git a/sys-apps/findutils/findutils-4.5.14-r1.ebuild b/sys-apps/findutils/findutils-4.5.14-r1.ebuild
new file mode 100644
index 000000000000..c520ee26744e
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.5.14-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="GNU utilities for finding files"
+HOMEPAGE="http://www.gnu.org/software/findutils/"
+SRC_URI="mirror://gnu-alpha/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="debug nls selinux static"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-test-bashisms.patch #531020
+ # Don't build or install locate because it conflicts with slocate,
+ # which is a secure version of locate. See bug 18729
+ sed -i '/^SUBDIRS/s/locate//' Makefile.in
+
+ # Disable gnulib build test that has no impact on the source.
+ # Re-enable w/next version bump (and gnulib is updated). #554728
+ [[ ${PV} != "4.5.14" ]] && die "re-enable test #554728"
+ echo 'exit 0' > tests/test-update-copyright.sh || die
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ program_prefix=$(usex userland_GNU '' g)
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR}" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --program-prefix=${program_prefix} \
+ $(use_enable debug) \
+ $(use_enable nls) \
+ $(use_with selinux) \
+ --libexecdir='$(libdir)'/find
+}
+
+src_install() {
+ default
+
+ # We don't need this, so punt it.
+ rm "${ED}"/usr/bin/${program_prefix}oldfind \
+ "${ED}"/usr/share/man/man1/${program_prefix}oldfind.1 || die
+}
diff --git a/sys-apps/findutils/findutils-4.5.14.ebuild b/sys-apps/findutils/findutils-4.5.14.ebuild
new file mode 100644
index 000000000000..267db222cc40
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.5.14.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs multilib
+
+DESCRIPTION="GNU utilities for finding files"
+HOMEPAGE="http://www.gnu.org/software/findutils/"
+SRC_URI="mirror://gnu-alpha/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls selinux static"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ # Don't build or install locate because it conflicts with slocate,
+ # which is a secure version of locate. See bug 18729
+ sed -i '/^SUBDIRS/s/locate//' Makefile.in
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ program_prefix=$(usex userland_GNU '' g)
+ econf \
+ --with-packager="Gentoo" \
+ --with-packager-version="${PVR}" \
+ --with-packager-bug-reports="http://bugs.gentoo.org/" \
+ --program-prefix=${program_prefix} \
+ $(use_enable nls) \
+ $(use_with selinux) \
+ --libexecdir='$(libdir)'/find
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc NEWS README TODO ChangeLog
+
+ # We don't need this, so punt it.
+ rm "${ED}"/usr/bin/${program_prefix}oldfind \
+ "${ED}"/usr/share/man/man1/${program_prefix}oldfind.1 || die
+}
diff --git a/sys-apps/findutils/metadata.xml b/sys-apps/findutils/metadata.xml
new file mode 100644
index 000000000000..b122af87724d
--- /dev/null
+++ b/sys-apps/findutils/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="cpe">cpe:/a:gnu:findutils</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/flashrom/Manifest b/sys-apps/flashrom/Manifest
new file mode 100644
index 000000000000..a33ff6f703cd
--- /dev/null
+++ b/sys-apps/flashrom/Manifest
@@ -0,0 +1,3 @@
+DIST flashrom-0.9.6.1.tar.bz2 368133 SHA256 6f7b588cce74c90b4fe9c9c794de105de76e0323442fb5770b1aeab81e9d560a SHA512 335243ca869a49521b6404004496cdba16f11da4f5321bbc8786635bbc7a0fe7215de2015d67200da68d398ed270d9a2ad9308ca9f762790e39b9f0602e53529 WHIRLPOOL f55f53cc6f06b627d8561e369bca32f1b62dc8de9a35963c01575b31f3190cf1be3b7114db8552b7f9f87c971960f1d16fe284d44e8d2db3da2996431d08598c
+DIST flashrom-0.9.7.tar.bz2 408883 SHA256 5a55212d00791981a9a1cb0cdca9d9e58bea6d399864251e7b410b4d3d6137e9 SHA512 a226c1ac3f9c7822b74ca14b7f9b53013110b2cdb66b1f936593c693ee54f19d643cc3a97a9635c05f2c959aca817668006f609ddb503a84d0bf5d510065674e WHIRLPOOL 97472148f97b86dc3b6661fe0368f492584308a8e86f2376bd3eb6e285a02dfcf231f2d917f30a734e90fbc9baf3899329c04ea245048d647077c50646ecd17d
+DIST flashrom-0.9.8.tar.bz2 473902 SHA256 13dc7c895e583111ecca370363a3527d237d178a134a94b20db7df177c05f934 SHA512 1a1c4513bac7cdf91326ab68b822034101e688bfab0dc0b5698f664fc766027229128c55eed94f302cac05d949647cdec6a103a423c3861b047cf0ff7cc0b509 WHIRLPOOL 61381faeff133065c195e37d9cf9eced6f5ff4c3dc6103abcca8186d11de9e1523e4fcfd173f34dfa44c78ad731db25a771d670bf5cd808f00ed5e80697c5c35
diff --git a/sys-apps/flashrom/flashrom-0.9.6.1.ebuild b/sys-apps/flashrom/flashrom-0.9.6.1.ebuild
new file mode 100644
index 000000000000..cf7ffd954634
--- /dev/null
+++ b/sys-apps/flashrom/flashrom-0.9.6.1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="svn://flashrom.org/flashrom/trunk"
+ inherit subversion
+else
+ SRC_URI="http://download.flashrom.org/releases/${P}.tar.bz2"
+ KEYWORDS="amd64 arm x86"
+fi
+
+DESCRIPTION="Utility for reading, writing, erasing and verifying flash ROM chips"
+HOMEPAGE="http://flashrom.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atahpt +bitbang_spi +buspirate_spi +dediprog doc +drkaiser
++dummy ft2232_spi +gfxnvidia +internal +nic3com +nicintel +nicintel_spi
+nicnatsemi nicrealtek +ogp_spi rayer_spi
++pony_spi +satasii satamv +serprog +wiki"
+
+COMMON_DEPEND="atahpt? ( sys-apps/pciutils )
+ dediprog? ( virtual/libusb:0 )
+ drkaiser? ( sys-apps/pciutils )
+ ft2232_spi? ( dev-embedded/libftdi )
+ gfxnvidia? ( sys-apps/pciutils )
+ internal? ( sys-apps/pciutils )
+ nic3com? ( sys-apps/pciutils )
+ nicintel? ( sys-apps/pciutils )
+ nicintel_spi? ( sys-apps/pciutils )
+ nicnatsemi? ( sys-apps/pciutils )
+ nicrealtek? ( sys-apps/pciutils )
+ rayer_spi? ( sys-apps/pciutils )
+ satasii? ( sys-apps/pciutils )
+ satamv? ( sys-apps/pciutils )
+ ogp_spi? ( sys-apps/pciutils )"
+RDEPEND="${COMMON_DEPEND}
+ internal? ( sys-apps/dmidecode )"
+DEPEND="${COMMON_DEPEND}
+ sys-apps/diffutils"
+
+_flashrom_enable() {
+ local c="CONFIG_${2:-$(echo $1 | tr [:lower:] [:upper:])}"
+ args+=" $c=$(usex $1 yes no)"
+}
+flashrom_enable() {
+ local u
+ for u in "$@" ; do _flashrom_enable $u ; done
+}
+
+src_compile() {
+ local progs=0
+ local args=""
+
+ # Programmer
+ flashrom_enable \
+ atahpt bitbang_spi buspirate_spi dediprog drkaiser \
+ ft2232_spi gfxnvidia nic3com nicintel nicintel_spi nicnatsemi nicrealtek \
+ ogp_spi rayer_spi pony_spi \
+ satasii satamv serprog \
+ internal dummy
+ _flashrom_enable wiki PRINT_WIKI
+
+ # You have to specify at least one programmer, and if you specify more than
+ # one programmer you have to include either dummy or internal in the list.
+ for prog in ${IUSE//[+-]} ; do
+ case ${prog} in
+ internal|dummy|wiki) continue ;;
+ esac
+
+ use ${prog} && : $(( progs++ ))
+ done
+ if [ $progs -ne 1 ] ; then
+ if ! use internal && ! use dummy ; then
+ ewarn "You have to specify at least one programmer, and if you specify"
+ ewarn "more than one programmer, you have to enable either dummy or"
+ ewarn "internal as well. 'internal' will be the default now."
+ args+=" CONFIG_INTERNAL=yes"
+ fi
+ fi
+
+ # WARNERROR=no, bug 347879
+ tc-export AR CC RANLIB
+ emake WARNERROR=no ${args} || die
+}
+
+src_install() {
+ dosbin flashrom || die
+ doman flashrom.8
+ dodoc ChangeLog README
+
+ if use doc; then
+ dodoc Documentation/*.txt
+ fi
+}
diff --git a/sys-apps/flashrom/flashrom-0.9.7.ebuild b/sys-apps/flashrom/flashrom-0.9.7.ebuild
new file mode 100644
index 000000000000..11ecdf371b7a
--- /dev/null
+++ b/sys-apps/flashrom/flashrom-0.9.7.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="svn://flashrom.org/flashrom/trunk"
+ inherit subversion
+else
+ SRC_URI="http://download.flashrom.org/releases/${P}.tar.bz2"
+ KEYWORDS="amd64 arm ~mips x86"
+fi
+
+DESCRIPTION="Utility for reading, writing, erasing and verifying flash ROM chips"
+HOMEPAGE="http://flashrom.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atahpt +bitbang_spi +buspirate_spi +dediprog +drkaiser
++dummy ft2232_spi +gfxnvidia +internal +linux_spi +nic3com +nicintel
++nicintel_spi nicnatsemi nicrealtek +ogp_spi rayer_spi
++pony_spi +satasii satamv +serprog static tools usbblaster +wiki"
+
+LIB_DEPEND="atahpt? ( sys-apps/pciutils[static-libs(+)] )
+ dediprog? ( virtual/libusb:0[static-libs(+)] )
+ drkaiser? ( sys-apps/pciutils[static-libs(+)] )
+ ft2232_spi? ( dev-embedded/libftdi[static-libs(+)] )
+ gfxnvidia? ( sys-apps/pciutils[static-libs(+)] )
+ internal? ( sys-apps/pciutils[static-libs(+)] )
+ nic3com? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel_spi? ( sys-apps/pciutils[static-libs(+)] )
+ nicnatsemi? ( sys-apps/pciutils[static-libs(+)] )
+ nicrealtek? ( sys-apps/pciutils[static-libs(+)] )
+ rayer_spi? ( sys-apps/pciutils[static-libs(+)] )
+ satasii? ( sys-apps/pciutils[static-libs(+)] )
+ satamv? ( sys-apps/pciutils[static-libs(+)] )
+ usbblaster? ( dev-embedded/libftdi[static-libs(+)] )
+ ogp_spi? ( sys-apps/pciutils[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ sys-apps/diffutils"
+RDEPEND+=" internal? ( sys-apps/dmidecode )"
+
+_flashrom_enable() {
+ local c="CONFIG_${2:-$(echo $1 | tr [:lower:] [:upper:])}"
+ args+=" $c=$(usex $1 yes no)"
+}
+flashrom_enable() {
+ local u
+ for u in "$@" ; do _flashrom_enable $u ; done
+}
+
+src_compile() {
+ local progs=0
+ local args=""
+
+ # Programmer
+ flashrom_enable \
+ atahpt bitbang_spi buspirate_spi dediprog drkaiser \
+ ft2232_spi gfxnvidia linux_spi nic3com nicintel \
+ nicintel_spi nicnatsemi nicrealtek ogp_spi rayer_spi \
+ pony_spi satasii satamv serprog usbblaster \
+ internal dummy
+ _flashrom_enable wiki PRINT_WIKI
+ _flashrom_enable static STATIC
+
+ # You have to specify at least one programmer, and if you specify more than
+ # one programmer you have to include either dummy or internal in the list.
+ for prog in ${IUSE//[+-]} ; do
+ case ${prog} in
+ internal|dummy|wiki) continue ;;
+ esac
+
+ use ${prog} && : $(( progs++ ))
+ done
+ if [[ ${progs} -ne 1 ]] ; then
+ if ! use internal && ! use dummy ; then
+ ewarn "You have to specify at least one programmer, and if you specify"
+ ewarn "more than one programmer, you have to enable either dummy or"
+ ewarn "internal as well. 'internal' will be the default now."
+ args+=" CONFIG_INTERNAL=yes"
+ fi
+ fi
+
+ # WARNERROR=no, bug 347879
+ tc-export AR CC RANLIB
+ emake WARNERROR=no ${args}
+}
+
+src_test() {
+ if [[ -d tests ]] ; then
+ pushd tests >/dev/null
+ ./tests.py || die
+ popd >/dev/null
+ fi
+}
+
+src_install() {
+ dosbin flashrom
+ doman flashrom.8
+ dodoc ChangeLog README Documentation/*.txt
+
+ if use tools; then
+ if use amd64; then
+ dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ elif use x86; then
+ dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ fi
+ fi
+}
diff --git a/sys-apps/flashrom/flashrom-0.9.8.ebuild b/sys-apps/flashrom/flashrom-0.9.8.ebuild
new file mode 100644
index 000000000000..d442c9c1f993
--- /dev/null
+++ b/sys-apps/flashrom/flashrom-0.9.8.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="svn://flashrom.org/flashrom/trunk"
+ inherit subversion
+else
+ SRC_URI="http://download.flashrom.org/releases/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+DESCRIPTION="Utility for reading, writing, erasing and verifying flash ROM chips"
+HOMEPAGE="http://flashrom.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+# The defaults match the upstream Makefile.
+# Note: Do not list bitbang_spi as it is not a programmer; it's a backend used
+# by some other spi programmers.
+IUSE_PROGRAMMERS="atahpt +atavia +buspirate_spi dediprog +drkaiser +dummy
++ft2232_spi +gfxnvidia +internal +it8212 +linux_spi mstarddc_spi +nic3com
++nicintel +nicintel_eeprom +nicintel_spi nicnatsemi +nicrealtek +ogp_spi
++pickit2_spi +pony_spi +rayer_spi +satamv +satasii +serprog +usbblaster_spi"
+IUSE="${IUSE_PROGRAMMERS} +internal_dmi static tools +wiki"
+
+LIB_DEPEND="atahpt? ( sys-apps/pciutils[static-libs(+)] )
+ atavia? ( sys-apps/pciutils[static-libs(+)] )
+ dediprog? ( virtual/libusb:0[static-libs(+)] )
+ drkaiser? ( sys-apps/pciutils[static-libs(+)] )
+ ft2232_spi? ( dev-embedded/libftdi[static-libs(+)] )
+ gfxnvidia? ( sys-apps/pciutils[static-libs(+)] )
+ it8212? ( sys-apps/pciutils[static-libs(+)] )
+ internal? ( sys-apps/pciutils[static-libs(+)] )
+ nic3com? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel_eeprom? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel_spi? ( sys-apps/pciutils[static-libs(+)] )
+ nicnatsemi? ( sys-apps/pciutils[static-libs(+)] )
+ nicrealtek? ( sys-apps/pciutils[static-libs(+)] )
+ ogp_spi? ( sys-apps/pciutils[static-libs(+)] )
+ pickit2_spi? ( virtual/libusb:0[static-libs(+)] )
+ rayer_spi? ( sys-apps/pciutils[static-libs(+)] )
+ satamv? ( sys-apps/pciutils[static-libs(+)] )
+ satasii? ( sys-apps/pciutils[static-libs(+)] )
+ usbblaster_spi? ( dev-embedded/libftdi[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ sys-apps/diffutils"
+RDEPEND+=" !internal_dmi? ( sys-apps/dmidecode )"
+
+_flashrom_enable() {
+ local c="CONFIG_${2:-$(echo "$1" | tr [:lower:] [:upper:])}"
+ args+=( "${c}=$(usex $1 yes no)" )
+}
+flashrom_enable() {
+ local u
+ for u ; do _flashrom_enable "${u}" ; done
+}
+
+src_prepare() {
+ sed -i \
+ -e 's:pkg-config:$(PKG_CONFIG):' \
+ Makefile || die
+}
+
+src_compile() {
+ # Help keep things in sync.
+ local sprogs=$(echo $(
+ grep -o 'CONFIG_[A-Z0-9_]*' flashrom.c | \
+ sort -u | \
+ sed 's:^CONFIG_::' | \
+ tr '[:upper:]' '[:lower:]'))
+ local eprogs=$(echo ${IUSE_PROGRAMMERS//[+-]})
+ if [[ ${sprogs} != "${eprogs}" ]] ; then
+ eerror "The ebuild needs to be kept in sync."
+ eerror "IUSE set to: ${eprogs}"
+ eerror "flashrom.c : ${sprogs}"
+ die "sync IUSE to the list of source programmers"
+ fi
+
+ # Turn USE flags into CONFIG_xxx settings.
+ local args=()
+ flashrom_enable ${eprogs}
+ _flashrom_enable wiki PRINT_WIKI
+ _flashrom_enable static STATIC
+
+ # You have to specify at least one programmer, and if you specify more than
+ # one programmer you have to include either dummy or internal in the list.
+ # We pick dummy as the default because internal requires libpci.
+ if ! use internal && ! use dummy ; then
+ if [[ ${#args[@]} -ne 1 ]] ; then
+ ewarn "You have to specify at least one programmer, and if you specify"
+ ewarn "more than one programmer, you have to enable either dummy or"
+ ewarn "internal as well. 'dummy' will be the default now."
+ args+=( CONFIG_DUMMY=yes )
+ fi
+ fi
+
+ tc-export AR CC PKG_CONFIG RANLIB
+ emake WARNERROR=no "${args[@]}"
+}
+
+src_test() {
+ if [[ -d tests ]] ; then
+ pushd tests >/dev/null
+ ./tests.py || die
+ popd >/dev/null
+ fi
+}
+
+src_install() {
+ dosbin flashrom
+ doman flashrom.8
+ dodoc ChangeLog README Documentation/*.txt
+
+ if use tools ; then
+ if use amd64 ; then
+ dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ elif use x86 ; then
+ dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ fi
+ fi
+}
diff --git a/sys-apps/flashrom/flashrom-9999.ebuild b/sys-apps/flashrom/flashrom-9999.ebuild
new file mode 100644
index 000000000000..549680e63a91
--- /dev/null
+++ b/sys-apps/flashrom/flashrom-9999.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="svn://flashrom.org/flashrom/trunk"
+ inherit subversion
+else
+ SRC_URI="http://download.flashrom.org/releases/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+DESCRIPTION="Utility for reading, writing, erasing and verifying flash ROM chips"
+HOMEPAGE="http://flashrom.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+# The defaults match the upstream Makefile.
+# Note: Do not list bitbang_spi as it is not a programmer; it's a backend used
+# by some other spi programmers.
+IUSE_PROGRAMMERS="atahpt +atavia +buspirate_spi dediprog +drkaiser +dummy
++ft2232_spi +gfxnvidia +internal +it8212 +linux_spi mstarddc_spi +nic3com
++nicintel +nicintel_eeprom +nicintel_spi nicnatsemi +nicrealtek +ogp_spi
++pickit2_spi +pony_spi +rayer_spi +satamv +satasii +serprog +usbblaster_spi"
+IUSE="${IUSE_PROGRAMMERS} +internal_dmi static tools +wiki"
+
+LIB_DEPEND="atahpt? ( sys-apps/pciutils[static-libs(+)] )
+ atavia? ( sys-apps/pciutils[static-libs(+)] )
+ dediprog? ( virtual/libusb:0[static-libs(+)] )
+ drkaiser? ( sys-apps/pciutils[static-libs(+)] )
+ ft2232_spi? ( dev-embedded/libftdi[static-libs(+)] )
+ gfxnvidia? ( sys-apps/pciutils[static-libs(+)] )
+ it8212? ( sys-apps/pciutils[static-libs(+)] )
+ internal? ( sys-apps/pciutils[static-libs(+)] )
+ nic3com? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel_eeprom? ( sys-apps/pciutils[static-libs(+)] )
+ nicintel_spi? ( sys-apps/pciutils[static-libs(+)] )
+ nicnatsemi? ( sys-apps/pciutils[static-libs(+)] )
+ nicrealtek? ( sys-apps/pciutils[static-libs(+)] )
+ ogp_spi? ( sys-apps/pciutils[static-libs(+)] )
+ pickit2_spi? ( virtual/libusb:0[static-libs(+)] )
+ rayer_spi? ( sys-apps/pciutils[static-libs(+)] )
+ satamv? ( sys-apps/pciutils[static-libs(+)] )
+ satasii? ( sys-apps/pciutils[static-libs(+)] )
+ usbblaster_spi? ( dev-embedded/libftdi[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ sys-apps/diffutils"
+RDEPEND+=" !internal_dmi? ( sys-apps/dmidecode )"
+
+_flashrom_enable() {
+ local c="CONFIG_${2:-$(echo "$1" | tr [:lower:] [:upper:])}"
+ args+=( "${c}=$(usex $1 yes no)" )
+}
+flashrom_enable() {
+ local u
+ for u ; do _flashrom_enable "${u}" ; done
+}
+
+src_prepare() {
+ sed -i \
+ -e 's:pkg-config:$(PKG_CONFIG):' \
+ Makefile || die
+}
+
+src_compile() {
+ # Help keep things in sync.
+ local sprogs=$(echo $(
+ grep -o 'CONFIG_[A-Z0-9_]*' flashrom.c | \
+ sort -u | \
+ sed 's:^CONFIG_::' | \
+ tr '[:upper:]' '[:lower:]'))
+ local eprogs=$(echo ${IUSE_PROGRAMMERS//[+-]})
+ if [[ ${sprogs} != "${eprogs}" ]] ; then
+ eerror "The ebuild needs to be kept in sync."
+ eerror "IUSE set to: ${eprogs}"
+ eerror "flashrom.c : ${sprogs}"
+ die "sync IUSE to the list of source programmers"
+ fi
+
+ # Turn USE flags into CONFIG_xxx settings.
+ local args=()
+ flashrom_enable ${eprogs}
+ _flashrom_enable wiki PRINT_WIKI
+ _flashrom_enable static STATIC
+
+ # You have to specify at least one programmer, and if you specify more than
+ # one programmer you have to include either dummy or internal in the list.
+ # We pick dummy as the default because internal requires libpci.
+ if ! use internal && ! use dummy ; then
+ if [[ ${#args[@]} -ne 1 ]] ; then
+ ewarn "You have to specify at least one programmer, and if you specify"
+ ewarn "more than one programmer, you have to enable either dummy or"
+ ewarn "internal as well. 'dummy' will be the default now."
+ args+=( CONFIG_DUMMY=yes )
+ fi
+ fi
+
+ tc-export AR CC PKG_CONFIG RANLIB
+ emake WARNERROR=no "${args[@]}"
+}
+
+src_test() {
+ if [[ -d tests ]] ; then
+ pushd tests >/dev/null
+ ./tests.py || die
+ popd >/dev/null
+ fi
+}
+
+src_install() {
+ dosbin flashrom
+ doman flashrom.8
+ dodoc README Documentation/*.txt
+
+ if use tools ; then
+ if use amd64 ; then
+ dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ elif use x86 ; then
+ dosbin util/ich_descriptors_tool/ich_descriptors_tool
+ fi
+ fi
+}
diff --git a/sys-apps/flashrom/metadata.xml b/sys-apps/flashrom/metadata.xml
new file mode 100644
index 000000000000..2501995b300b
--- /dev/null
+++ b/sys-apps/flashrom/metadata.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ </maintainer>
+ <maintainer>
+ <email>peter@stuge.se</email>
+ <description>Please CC on all bugs</description>
+ </maintainer>
+ <use>
+ <flag name="atahpt">Highpoint (HPT) ATA/RAID controller support</flag>
+ <flag name="atavia">Support for VIA VT6421A SATA controllers</flag>
+ <flag name="bitbang_spi">Bitbanging SPI infrastructure</flag>
+ <flag name="buspirate_spi">Enable Bus Pirate SPI programmer</flag>
+ <flag name="dediprog">Dediprog SF100 support</flag>
+ <flag name="drkaiser">Enable Dr. Kaiser programmer</flag>
+ <flag name="dummy">Enable dummy tracing</flag>
+ <flag name="ft2232_spi">Enable ftdi programmer, flashing through FTDI/SPI USB interface</flag>
+ <flag name="gfxnvidia">Enable NVIDIA programmer</flag>
+ <flag name="internal">Enable internal/onboard support</flag>
+ <flag name="internal_dmi">Enable internal DMI decoding rather than use <pkg>sys-apps/dmidecode</pkg></flag>
+ <flag name="it8212">Support for ITE IT8212F ATA/RAID controllers</flag>
+ <flag name="linux_spi">Enable support for Linux userspace spidev interface</flag>
+ <flag name="mstarddc_spi">Support for SPI flash ROMs accessible through DDC in MSTAR-equipped displays</flag>
+ <flag name="nic3com">Enable 3Com NIC programmer</flag>
+ <flag name="nicintel">Support for Intel NICs</flag>
+ <flag name="nicintel_eeprom">Support for EEPROMs on Intel Gigabit network cards</flag>
+ <flag name="nicintel_spi">Support for SPI on Intel NICs</flag>
+ <flag name="nicnatsemi">Support for National Semiconductor NICs</flag>
+ <flag name="nicrealtek">Support for Realtek NICs</flag>
+ <flag name="ogp_spi">Enable support for OGP (Open Graphics Project) SPI flashing</flag>
+ <flag name="pickit2_spi">SUpport for SPI flash ROMs accessible via Microchip PICkit2</flag>
+ <flag name="pony_spi">Enable support for SI-Prog like hardware by Lancos</flag>
+ <flag name="rayer_spi">RayeR SPIPGM hardware support</flag>
+ <flag name="satasii">Enable programmer for SiI SATA controllers</flag>
+ <flag name="satamv">Enable programmer for Marvell SATA controllers</flag>
+ <flag name="serprog">Enable Serial Flasher programmer</flag>
+ <flag name="tools">Install additional tools</flag>
+ <flag name="usbblaster">Enable support for Altera USB-Blaster dongles</flag>
+ <flag name="usbblaster_spi">Enable support for Altera USB-Blaster dongles</flag>
+ <flag name="wiki">Enable wiki informations, like supported devices etc.</flag>
+ </use>
+ <longdescription lang="en">
+flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips. It is designed to flash BIOS/EFI/coreboot/firmware/optionROM images on mainboards, network/graphics/storage controller cards, and various other programmer devices.
+
+ Supports more than 380 flash chips, 260 chipsets, 450 mainboards, 50 PCI devices, 12 USB devices and various parallel/serial port-based programmers.
+ Supports parallel, LPC, FWH and SPI flash interfaces and various chip packages (DIP32, PLCC32, DIP8, SO8/SOIC8, TSOP32, TSOP40, TSOP48, BGA and more)
+ No physical access needed, root access is sufficient (not needed for some programmers).
+ No bootable floppy disk, bootable CD-ROM or other media needed.
+ No keyboard or monitor needed. Simply reflash remotely via SSH.
+ No instant reboot needed. Reflash your chip in a running system, verify it, be happy. The new firmware will be present next time you boot.
+ Crossflashing and hotflashing is possible as long as the flash chips are electrically and logically compatible (same protocol). Great for recovery.
+ Scriptability. Reflash a whole pool of identical machines at the same time from the command line. It is recommended to check flashrom output and error codes.
+ Speed. flashrom is often much faster than most vendor flash tools.
+ Portability. Supports DOS, Linux, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, Solaris, Mac OS X, and other Unix-like OSes. Partial Windows support is available (no internal programmer support at the moment, hence no "BIOS flashing").
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/flock/Manifest b/sys-apps/flock/Manifest
new file mode 100644
index 000000000000..f8b338879199
--- /dev/null
+++ b/sys-apps/flock/Manifest
@@ -0,0 +1 @@
+DIST flock-2.19.tar.gz 5452 SHA256 9716618042a753cc4bd6e787d0886ea5fce8a167d5ce62421cee2c09ea86fbda SHA512 f6b3e88731e343a7845b5354668b24a6c0d4bbf75ba992f73cfdacb814ceb95088371a162935d41ca22fd648493a79f9b3dbfd045af497449fad7ea5c48be21f WHIRLPOOL 5cc9fabbfdc78b9b23c5b60e49d268a5cac392831a48ccad92652034ba5c9f34a5873cc93f293e0eb5c4f0ecdf5f559f72f72f3e8e7ea280e57ab707b7206c4d
diff --git a/sys-apps/flock/flock-2.19.ebuild b/sys-apps/flock/flock-2.19.ebuild
new file mode 100644
index 000000000000..06eab4f4bf91
--- /dev/null
+++ b/sys-apps/flock/flock-2.19.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit freebsd
+
+DESCRIPTION="Manage locks from shell scripts"
+HOMEPAGE="http://svnweb.freebsd.org/ports/head/sysutils/flock/"
+SRC_URI="http://www.zonov.org/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="sys-freebsd/freebsd-mk-defs
+ virtual/pmake"
diff --git a/sys-apps/flock/metadata.xml b/sys-apps/flock/metadata.xml
new file mode 100644
index 000000000000..ecedda4aa2cc
--- /dev/null
+++ b/sys-apps/flock/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-apps/fwcrv/Manifest b/sys-apps/fwcrv/Manifest
new file mode 100644
index 000000000000..321f392cf7bc
--- /dev/null
+++ b/sys-apps/fwcrv/Manifest
@@ -0,0 +1 @@
+DIST fwcrv-0.1.0.tar.gz 76154 RMD160 df46067779b5440ba99da6120a89b8ef0f21f4cb SHA1 8c48a332acbe4def9816549f2c8f47255fb81d8f SHA256 f6585c20149c95a7ea7d3cef8ccf30fe2211ca3d892ce0b265ada4163b351a36
diff --git a/sys-apps/fwcrv/files/fwcrv-0.1.0-endian.patch b/sys-apps/fwcrv/files/fwcrv-0.1.0-endian.patch
new file mode 100644
index 000000000000..565a15736d9b
--- /dev/null
+++ b/sys-apps/fwcrv/files/fwcrv-0.1.0-endian.patch
@@ -0,0 +1,47 @@
+diff -ruN src/functions.c /tmp/src/functions.c
+--- src/functions.c 2002-11-14 23:46:11.000000000 +0100
++++ src.new/functions.c 2006-03-22 11:51:03.000000000 +0100
+@@ -59,7 +59,7 @@
+ byte ParseCommandLineOptions( int ArgCount, char *ArgValue[], byte *Mode, byte *ReadLength )
+ {
+ int i;
+- char *ArgString;
++ unsigned char *ArgString;
+ byte Node_ID;
+
+ Node_ID = 0; // Default Node_ID used is 0
+diff -ruN src/functions.h /tmp/src/functions.h
+--- src/functions.h 2001-06-21 01:11:43.000000000 +0200
++++ src.new/functions.h 2006-03-22 11:47:48.000000000 +0100
+@@ -16,18 +16,29 @@
+ * byte2 = bits 08-15 (on ix86, bits 16-23)
+ * byte3 = bits 00-07 (on ix86, bits 24-31)
+ * *****************************************************************************************************/
++
++#if __BYTE_ORDER == __BIG_ENDIAN
++
++#define QBYTE3( q ) ( (byte) ( q >> 24 ) )
++#define QBYTE2( q ) ( (byte) ( q >> 16 ) )
++#define QBYTE1( q ) ( (byte) ( q >> 8 ) )
++#define QBYTE0( q ) ( (byte) q )
++
++#else
++
+ #define QBYTE0( q ) ( (byte) ( q >> 24 ) )
+ #define QBYTE1( q ) ( (byte) ( q >> 16 ) )
+ #define QBYTE2( q ) ( (byte) ( q >> 8 ) )
+ #define QBYTE3( q ) ( (byte) q )
+
++#endif
++
+ /* Macro pour inverser les octets a l'interieur d'un quadlet */
+ #define QSWAP( q ) ( ( q << 24 ) & 0xFF000000 ) + \
+ ( ( q << 8 ) & 0x00FF0000 ) + \
+ ( ( q >> 8 ) & 0x0000FF00 ) + \
+ ( ( q >> 24 ) & 0x000000FF )
+
+-
+ /* ******************************************************************************************************
+ * ParseCommandLineOptions
+ * Initialisation of the different options passed as arguments on the command line
+
diff --git a/sys-apps/fwcrv/fwcrv-0.1.0.ebuild b/sys-apps/fwcrv/fwcrv-0.1.0.ebuild
new file mode 100644
index 000000000000..f6dceea1b7b7
--- /dev/null
+++ b/sys-apps/fwcrv/fwcrv-0.1.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="FireWire CSR Config ROM Viewer"
+HOMEPAGE="http://www.hugovil.com/en/fwcrv/"
+SRC_URI="http://www.hugovil.com/repository/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 ~ppc"
+IUSE=""
+DEPEND="sys-libs/libraw1394"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-endian.patch
+}
+
+src_compile() {
+ econf || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS README src/testdata.txt TODO
+}
diff --git a/sys-apps/fwcrv/metadata.xml b/sys-apps/fwcrv/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/fwcrv/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-apps/fwts/Manifest b/sys-apps/fwts/Manifest
new file mode 100644
index 000000000000..692b8dc611f0
--- /dev/null
+++ b/sys-apps/fwts/Manifest
@@ -0,0 +1,2 @@
+DIST fwts-V14.12.00.tar.gz 3089700 SHA256 9fbc6d1bb8cff8c445d4b2ad0c080e7711564a35982e8a946156b7258e82f2ec SHA512 594cfdadcef031216807eccbf7f5a741643ff33322d84994027afdd08923fa423e1dd2621b9093034e7ac99cc2147b9dcb8b6f4dc2662b10232e55a3261aa91e WHIRLPOOL 2be8d45034e4337b6366d8fcd535010412f02d25859f041cb348b693c5e92822c1a0806a37b77ea4815899b7f03d946326caaec64e91d8d09baaba5301cae353
+DIST fwts_15.03.01.orig.tar.gz 3097112 SHA256 9926baa672159e7990abcfd10c003db8dc0db6a45212189e00ae217504c1fa26 SHA512 3f27b21d67dd7db64547c19e2d74fc909aa5d64fc3aedf0fbca403111bb5578c97a0c7f930b540bcb48f48da8a47e4e02bd679170d7b003b40a49f8358be6033 WHIRLPOOL 2a347785105c02611cec7566643b2b8d5d81c555737e4f5a34b3564dafb938a3fa0bb4d575e0da4c216fbd518c44fddcd243dc07bbd5b0a8cd7a4321f0e01b9a
diff --git a/sys-apps/fwts/fwts-14.12.00.ebuild b/sys-apps/fwts/fwts-14.12.00.ebuild
new file mode 100644
index 000000000000..eab1f2a1788e
--- /dev/null
+++ b/sys-apps/fwts/fwts-14.12.00.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+DESCRIPTION="Firmware Test Suite"
+HOMEPAGE="https://wiki.ubuntu.com/Kernel/Reference/fwts"
+SRC_URI="http://fwts.ubuntu.com/release/${PN}-V${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-libs/json-c
+ dev-libs/glib:2
+ dev-libs/libpcre
+ sys-apps/pciutils
+ sys-power/iasl
+ sys-power/pmtools
+ sys-apps/dmidecode"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+
+S=${WORKDIR}
+
+src_prepare(){
+ sed -i -e 's/-Wall -Werror/-Wall/' configure.ac {,src/,src/lib/src/}Makefile.am || die
+ sed -i -e 's:/usr/bin/lspci:'$(type -p lspci)':' src/lib/include/fwts_binpaths.h || die
+
+ # Fix json-c includes
+ if has_version '>=dev-libs/json-c-0.10-r1'; then
+ sed -e 's/^#include <json\//#include <json-c\//g' -i \
+ configure.ac \
+ src/acpi/syntaxcheck/syntaxcheck.c \
+ src/lib/include/fwts_json.h \
+ src/lib/src/fwts_klog.c \
+ src/lib/src/fwts_log_json.c \
+ src/utilities/kernelscan.c || die
+ sed -e 's/-ljson/-ljson-c/'\
+ -i src/Makefile.am\
+ src/lib/src/Makefile.am\
+ src/utilities/Makefile.am || die
+ fi
+
+ eautoreconf
+}
diff --git a/sys-apps/fwts/fwts-15.03.01.ebuild b/sys-apps/fwts/fwts-15.03.01.ebuild
new file mode 100644
index 000000000000..0c1ca88e0be5
--- /dev/null
+++ b/sys-apps/fwts/fwts-15.03.01.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+DESCRIPTION="Firmware Test Suite"
+HOMEPAGE="https://wiki.ubuntu.com/Kernel/Reference/fwts"
+SRC_URI="https://launchpad.net/ubuntu/+archive/primary/+files/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND=">=dev-libs/json-c-0.10-r1
+ dev-libs/glib:2
+ dev-libs/libpcre
+ sys-apps/pciutils
+ sys-power/iasl
+ sys-power/pmtools
+ sys-apps/dmidecode"
+DEPEND="${RDEPEND}
+ sys-devel/libtool"
+
+S=${WORKDIR}
+
+src_prepare(){
+ sed -i -e 's/-Wall -Werror/-Wall/' configure.ac {,src/,src/lib/src/}Makefile.am || die
+ sed -i -e 's:/usr/bin/lspci:'$(type -p lspci)':' src/lib/include/fwts_binpaths.h || die
+
+ # Fix json-c includes
+ sed -e 's/^#include <json\//#include <json-c\//g' -i \
+ configure.ac || die
+ sed -e 's/^#include <json.h>/#include <json-c\/json.h>/' \
+ -i src/lib/include/fwts_json.h \
+ src/utilities/kernelscan.c || die
+ sed -e 's/-ljson/-ljson-c/'\
+ -i src/Makefile.am\
+ src/lib/src/Makefile.am\
+ src/utilities/Makefile.am || die
+
+ eautoreconf
+}
diff --git a/sys-apps/fwts/metadata.xml b/sys-apps/fwts/metadata.xml
new file mode 100644
index 000000000000..cfeca1024cfd
--- /dev/null
+++ b/sys-apps/fwts/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>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="launchpad">ubuntu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/fxload/Manifest b/sys-apps/fxload/Manifest
new file mode 100644
index 000000000000..5dcf9c807750
--- /dev/null
+++ b/sys-apps/fxload/Manifest
@@ -0,0 +1 @@
+DIST fxload-2008_10_13.tar.gz 23926 SHA256 0cc8bfd2a7cbba2f68e0c5767477634922287943c91dd9fcf029fc8b9d577858 SHA512 f8a654c51a392ac95672a24962ac3b83ea4e0cb62d51a0696f6bdfdefbc7b5cfb033aa9cd80ee676a6bb00061bd635d7eb3920769f982188d8733c862838bc32 WHIRLPOOL c7242c937babebbbba90294e9b638976ede727f7243f52798b5bf69a9ac2919c819d071e57e5d61f999c6bf5a419d925552e88edde5b35f038a780373ea28277
diff --git a/sys-apps/fxload/fxload-20081013-r1.ebuild b/sys-apps/fxload/fxload-20081013-r1.ebuild
new file mode 100644
index 000000000000..935a5eacedcf
--- /dev/null
+++ b/sys-apps/fxload/fxload-20081013-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
+
+# source maintainers named it fxload-YYYY_MM_DD instead of fxload-YYYYMMDD
+MY_P="${PN}-${PV:0:4}_${PV:4:2}_${PV:6:2}"
+DESCRIPTION="USB firmware uploader"
+HOMEPAGE="http://linux-hotplug.sourceforge.net/"
+SRC_URI="mirror://sourceforge/linux-hotplug/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ia64 ppc ppc64 sparc x86"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i \
+ -e 's:$(CC) -o:$(CC) $(LDFLAGS) -o:' \
+ Makefile || die
+}
+
+src_compile() {
+ tc-export CC
+ emake RPM_OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake prefix="${D}" install
+ dodoc README.txt
+}
diff --git a/sys-apps/fxload/metadata.xml b/sys-apps/fxload/metadata.xml
new file mode 100644
index 000000000000..7dbc2f2a420a
--- /dev/null
+++ b/sys-apps/fxload/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>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">linux-hotplug</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/gawk/Manifest b/sys-apps/gawk/Manifest
new file mode 100644
index 000000000000..aaeb0a1f6369
--- /dev/null
+++ b/sys-apps/gawk/Manifest
@@ -0,0 +1,4 @@
+DIST gawk-3.1.8.tar.bz2 1984129 SHA256 5dbc7b2c4c328711337c2aacd09a122c7313122262e3ff034590f014067412b4 SHA512 a8046c1a5a6ffc8bd90cc6062d97ba6301b7a707f4a34a06355a83aaaea2ccdf4c4476563fc6f444b529a2d8d3a2de2126b53434ba50aad8bd898fb3299904dd WHIRLPOOL e24079d7c2aee57e48db2ef76df4c217ea0fa435304a563c6df8d0442f8a5e5e4cff2141809f68430939d66a3a6eda981edefa94b2b8c85e5f0a3ee7ba8a7649
+DIST gawk-4.0.2.tar.xz 1626808 SHA256 21e1f28c51b5160f0a4bf1a735c6109b46a3bd6a43de808eabc21c17bb026d13 SHA512 069f68b6792521d94d4003764006ad8fbe9a17c60a88212629204d9a5eb3f662903fff6d91dd3c1834597b76c18f9d3231c93a033f456c59c0571ac13eb77b27 WHIRLPOOL 8b2916d964c5fa67a46c0a5fc39d424b03e6b39a3335ad796a224feb760528631199c1ec6ee2b6719bdc014ab190ddf38092211685020c92851d617e6ca08690
+DIST gawk-4.1.2.tar.xz 2279136 SHA256 ea8b53c5834ee27012fecba7273f97fca7104884975cf81ddae6f85c5581f481 SHA512 89aed50a4bd335bd6a3045b1b738c76788f3d8d5745153683c990f021e424c31d8a3b2599f8e57f18f64022d5d1b57f4766ccf1a7d2a1b9fb4b20dabdf099117 WHIRLPOOL 254900ce8ce9992551e89ed5ccf6ba9b0bdb8324643d0c84573404c59d3d756aa64de2d054194d424958f9aa4c52bd9b12ba6185ada0d39b38cd046e1192c336
+DIST gawk-4.1.3.tar.xz 2311268 SHA256 e3cf55e91e31ea2845f8338bedd91e40671fc30e4d82ea147d220e687abda625 SHA512 8b9470a1bba397353f10e4e652e8589a637a49e8235fb39ca7681ae662fd27cd140c193d0634179c800f99e19b0e49aef55dfa6612f9695ba80760a36936a1c3 WHIRLPOOL ddcd0f218a08c7d54beaaa28db3a965c57b1d394dd294f142970cbf3b4777a407bbb491b7442f9e4de0b7435167919e76b16f4c5ab28eb62758a3d44d11a49e1
diff --git a/sys-apps/gawk/files/filefuncs/Makefile b/sys-apps/gawk/files/filefuncs/Makefile
new file mode 100644
index 000000000000..615ae02512ca
--- /dev/null
+++ b/sys-apps/gawk/files/filefuncs/Makefile
@@ -0,0 +1,57 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Author: Martin Schlemmer <azarah@gentoo.org>
+# $Id$
+
+CC ?= gcc
+LD = $(CC)
+
+MAJORVER = 0
+MINORVER = 0.1
+
+AWKINCDIR = /usr/include/awk
+DESTDIR =
+
+TARGET = filefuncs
+TARGET_LIB = $(TARGET).so.$(MAJORVER).$(MINORVER)
+
+LIBDIR = lib
+
+# Gentoo specific cruft, you like it dont ya idiot
+ifdef D
+DESTDIR = $(D)
+endif
+ifdef S
+AWKINCDIR = $(S)
+endif
+
+DOIT = yes
+ifeq ($(USERLAND),Darwin)
+DOIT = no
+endif
+
+ifeq ($(DOIT),yes)
+
+all: $(TARGET_LIB)
+
+$(TARGET).o: $(TARGET).c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -shared -Wall -DHAVE_CONFIG_H -c -O2 -fPIC -I$(AWKINCDIR) $^
+
+$(TARGET_LIB): $(TARGET).o
+ $(LD) $(LDFLAGS) -o $@ -shared -Wl,-soname -Wl,$(TARGET).so.$(MAJORVER) $^
+
+install: $(TARGET_LIB)
+ install -m 0755 -d $(DESTDIR)/$(LIBDIR)/rcscripts
+ install -m 0755 $(TARGET_LIB) $(DESTDIR)/$(LIBDIR)/rcscripts
+ ln -s $(TARGET_LIB) $(DESTDIR)/$(LIBDIR)/rcscripts/$(TARGET).so.$(MAJORVER)
+ ln -s $(TARGET_LIB) $(DESTDIR)/$(LIBDIR)/rcscripts/$(TARGET).so
+
+clean:
+ rm -f $(TARGET)
+ rm -f *.o *~ core
+
+else
+
+all install clean:
+
+endif
diff --git a/sys-apps/gawk/files/filefuncs/filefuncs.c b/sys-apps/gawk/files/filefuncs/filefuncs.c
new file mode 100644
index 000000000000..fcab2a62912d
--- /dev/null
+++ b/sys-apps/gawk/files/filefuncs/filefuncs.c
@@ -0,0 +1,485 @@
+/*
+ * filefuncs.c - Builtin functions that provide initial minimal iterface
+ * to the file system.
+ *
+ * Arnold Robbins, update for 3.1, Mon Nov 23 12:53:39 EST 1998
+ */
+
+/*
+ * Copyright (C) 2001 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK 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.
+ *
+ * GAWK 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
+ */
+
+/*
+ * Copyright 1999-2004 Gentoo Foundation
+ * Distributed under the terms of the GNU General Public License v2
+ * Author: Martin Schlemmer <azarah@gentoo.org>, Nov 2002
+ * $Id$
+ *
+ * Extended with: do_symlink()
+ * do_unlink()
+ * do_mkdir()
+ * do_rmdir()
+ *
+ * for use in the Gentoo rcscripts
+ *
+ */
+
+#include "awk.h"
+
+#include <unistd.h>
+
+/* do_chdir --- provide dynamically loaded chdir() builtin for gawk */
+
+static NODE *
+do_chdir(tree)
+NODE *tree;
+{
+ NODE *newdir;
+ int ret = -1;
+
+ if (do_lint && tree->param_cnt > 1)
+ lintwarn("chdir: called with too many arguments");
+
+ newdir = get_argument(tree, 0);
+ if (newdir != NULL) {
+ (void) force_string(newdir);
+ ret = chdir(newdir->stptr);
+ if (ret < 0)
+ update_ERRNO();
+
+ free_temp(newdir);
+ } else if (do_lint)
+ lintwarn("chdir: called with no arguments");
+
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+/* do_symlink --- provide dynamically loaded symlink() builtin for gawk */
+
+static NODE *
+do_symlink(tree)
+NODE *tree;
+{
+ NODE *oldpath, *newpath;
+ int ret = -1;
+
+ if (do_lint && tree->param_cnt > 2)
+ lintwarn("symlink: called with too many arguments");
+
+ oldpath = get_argument(tree, 0);
+ newpath = get_argument(tree, 1);
+ if ((oldpath != NULL) && (newpath)) {
+ (void) force_string(oldpath);
+ (void) force_string(newpath);
+ ret = symlink(oldpath->stptr, newpath->stptr);
+ if (ret < 0)
+ update_ERRNO();
+
+ free_temp(oldpath);
+ free_temp(newpath);
+ } else if (do_lint)
+ lintwarn("symlink: called with not enough arguments");
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+/* do_unlink --- provide dynamically loaded unlink() builtin for gawk */
+
+static NODE *
+do_unlink(tree)
+NODE *tree;
+{
+ NODE *pathname;
+ int ret = -1;
+
+ if (do_lint && tree->param_cnt > 1)
+ lintwarn("unlink: called with too many arguments");
+
+ pathname = get_argument(tree, 0);
+ if (pathname != NULL) {
+ (void) force_string(pathname);
+ ret = unlink(pathname->stptr);
+ if (ret < 0)
+ update_ERRNO();
+
+ free_temp(pathname);
+ } else if (do_lint)
+ lintwarn("unlink: called with no arguments");
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+/* do_mkdir --- provide dynamically loaded mkdir() builtin for gawk */
+
+static NODE *
+do_mkdir(tree)
+NODE *tree;
+{
+ NODE *pathname, *mode;
+ int ret = -1;
+
+ if (do_lint && tree->param_cnt > 2)
+ lintwarn("mkdir: called with too many arguments");
+
+ pathname = get_argument(tree, 0);
+ mode = get_argument(tree, 1);
+ if ((pathname != NULL) && (mode != NULL)) {
+ (void) force_string(pathname);
+ (void) force_number(mode);
+ ret = mkdir(pathname->stptr, mode->numbr);
+ if (ret < 0)
+ update_ERRNO();
+
+ free_temp(pathname);
+ free_temp(mode);
+ } else if (do_lint)
+ lintwarn("mkdir: called with not enough arguments");
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+/* do_rmdir --- provide dynamically loaded rmdir() builtin for gawk */
+
+static NODE *
+do_rmdir(tree)
+NODE *tree;
+{
+ NODE *pathname;
+ int ret = -1;
+
+ if (do_lint && tree->param_cnt > 1)
+ lintwarn("rmdir: called with too many arguments");
+
+ pathname = get_argument(tree, 0);
+ if (pathname != NULL) {
+ (void) force_string(pathname);
+ ret = rmdir(pathname->stptr);
+ if (ret < 0)
+ update_ERRNO();
+
+ free_temp(pathname);
+ } else if (do_lint)
+ lintwarn("rmdir: called with no arguments");
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+/* format_mode --- turn a stat mode field into something readable */
+
+static char *
+format_mode(fmode)
+unsigned long fmode;
+{
+ static char outbuf[12];
+ int i;
+
+ strcpy(outbuf, "----------");
+ /* first, get the file type */
+ i = 0;
+ switch (fmode & S_IFMT) {
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+ outbuf[i] = 's';
+ break;
+#endif
+#ifdef S_IFLNK
+ case S_IFLNK:
+ outbuf[i] = 'l';
+ break;
+#endif
+ case S_IFREG:
+ outbuf[i] = '-'; /* redundant */
+ break;
+ case S_IFBLK:
+ outbuf[i] = 'b';
+ break;
+ case S_IFDIR:
+ outbuf[i] = 'd';
+ break;
+#ifdef S_IFDOOR /* Solaris weirdness */
+ case S_IFDOOR:
+ outbuf[i] = 'D';
+ break;
+#endif /* S_IFDOOR */
+ case S_IFCHR:
+ outbuf[i] = 'c';
+ break;
+#ifdef S_IFIFO
+ case S_IFIFO:
+ outbuf[i] = 'p';
+ break;
+#endif
+ }
+
+ i++;
+ if ((fmode & S_IRUSR) != 0)
+ outbuf[i] = 'r';
+ i++;
+ if ((fmode & S_IWUSR) != 0)
+ outbuf[i] = 'w';
+ i++;
+ if ((fmode & S_IXUSR) != 0)
+ outbuf[i] = 'x';
+ i++;
+
+ if ((fmode & S_IRGRP) != 0)
+ outbuf[i] = 'r';
+ i++;
+ if ((fmode & S_IWGRP) != 0)
+ outbuf[i] = 'w';
+ i++;
+ if ((fmode & S_IXGRP) != 0)
+ outbuf[i] = 'x';
+ i++;
+
+ if ((fmode & S_IROTH) != 0)
+ outbuf[i] = 'r';
+ i++;
+ if ((fmode & S_IWOTH) != 0)
+ outbuf[i] = 'w';
+ i++;
+ if ((fmode & S_IXOTH) != 0)
+ outbuf[i] = 'x';
+ i++;
+
+ outbuf[i] = '\0';
+
+ if ((fmode & S_ISUID) != 0) {
+ if (outbuf[3] == 'x')
+ outbuf[3] = 's';
+ else
+ outbuf[3] = 'S';
+ }
+
+ /* setgid without execute == locking */
+ if ((fmode & S_ISGID) != 0) {
+ if (outbuf[6] == 'x')
+ outbuf[6] = 's';
+ else
+ outbuf[6] = 'l';
+ }
+
+ if ((fmode & S_ISVTX) != 0) {
+ if (outbuf[9] == 'x')
+ outbuf[9] = 't';
+ else
+ outbuf[9] = 'T';
+ }
+
+ return outbuf;
+}
+
+/* do_stat --- provide a stat() function for gawk */
+
+static NODE *
+do_stat(tree)
+NODE *tree;
+{
+ NODE *file, *array;
+ struct stat sbuf;
+ int ret;
+ NODE **aptr;
+ char *pmode; /* printable mode */
+ char *type = "unknown";
+
+ /* check arg count */
+ if (tree->param_cnt != 2)
+ fatal(
+ "stat: called with incorrect number of arguments (%d), should be 2",
+ tree->param_cnt);
+
+ /* directory is first arg, array to hold results is second */
+ file = get_argument(tree, 0);
+ array = get_argument(tree, 1);
+
+ /* empty out the array */
+ assoc_clear(array);
+
+ /* lstat the file, if error, set ERRNO and return */
+ (void) force_string(file);
+ ret = lstat(file->stptr, & sbuf);
+ if (ret < 0) {
+ update_ERRNO();
+
+ set_value(tmp_number((AWKNUM) ret));
+
+ free_temp(file);
+ return tmp_number((AWKNUM) 0);
+ }
+
+ /* fill in the array */
+ aptr = assoc_lookup(array, tmp_string("name", 4), FALSE);
+ *aptr = dupnode(file);
+
+ aptr = assoc_lookup(array, tmp_string("dev", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_dev);
+
+ aptr = assoc_lookup(array, tmp_string("ino", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_ino);
+
+ aptr = assoc_lookup(array, tmp_string("mode", 4), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_mode);
+
+ aptr = assoc_lookup(array, tmp_string("nlink", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_nlink);
+
+ aptr = assoc_lookup(array, tmp_string("uid", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_uid);
+
+ aptr = assoc_lookup(array, tmp_string("gid", 3), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_gid);
+
+ aptr = assoc_lookup(array, tmp_string("size", 4), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_size);
+
+ aptr = assoc_lookup(array, tmp_string("blocks", 6), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_blocks);
+
+ aptr = assoc_lookup(array, tmp_string("atime", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_atime);
+
+ aptr = assoc_lookup(array, tmp_string("mtime", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_mtime);
+
+ aptr = assoc_lookup(array, tmp_string("ctime", 5), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_ctime);
+
+ /* for block and character devices, add rdev, major and minor numbers */
+ if (S_ISBLK(sbuf.st_mode) || S_ISCHR(sbuf.st_mode)) {
+ aptr = assoc_lookup(array, tmp_string("rdev", 4), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_rdev);
+
+ aptr = assoc_lookup(array, tmp_string("major", 5), FALSE);
+ *aptr = make_number((AWKNUM) major(sbuf.st_rdev));
+
+ aptr = assoc_lookup(array, tmp_string("minor", 5), FALSE);
+ *aptr = make_number((AWKNUM) minor(sbuf.st_rdev));
+ }
+
+#ifdef HAVE_ST_BLKSIZE
+ aptr = assoc_lookup(array, tmp_string("blksize", 7), FALSE);
+ *aptr = make_number((AWKNUM) sbuf.st_blksize);
+#endif /* HAVE_ST_BLKSIZE */
+
+ aptr = assoc_lookup(array, tmp_string("pmode", 5), FALSE);
+ pmode = format_mode(sbuf.st_mode);
+ *aptr = make_string(pmode, strlen(pmode));
+
+ /* for symbolic links, add a linkval field */
+ if (S_ISLNK(sbuf.st_mode)) {
+ char buf[BUFSIZ*2];
+ int linksize;
+
+ linksize = readlink(file->stptr, buf, sizeof buf);
+ /* should make this smarter */
+ if (linksize == sizeof(buf))
+ fatal("size of symbolic link too big");
+ buf[linksize] = '\0';
+
+ aptr = assoc_lookup(array, tmp_string("linkval", 7), FALSE);
+ *aptr = make_string(buf, linksize);
+ }
+
+ /* add a type field */
+ switch (sbuf.st_mode & S_IFMT) {
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+ type = "socket";
+ break;
+#endif
+#ifdef S_IFLNK
+ case S_IFLNK:
+ type = "symlink";
+ break;
+#endif
+ case S_IFREG:
+ type = "file";
+ break;
+ case S_IFBLK:
+ type = "blockdev";
+ break;
+ case S_IFDIR:
+ type = "directory";
+ break;
+#ifdef S_IFDOOR
+ case S_IFDOOR:
+ type = "door";
+ break;
+#endif
+ case S_IFCHR:
+ type = "chardev";
+ break;
+#ifdef S_IFIFO
+ case S_IFIFO:
+ type = "fifo";
+ break;
+#endif
+ }
+
+ aptr = assoc_lookup(array, tmp_string("type", 4), FALSE);
+ *aptr = make_string(type, strlen(type));
+
+ free_temp(file);
+
+ /* Set the return value */
+ set_value(tmp_number((AWKNUM) ret));
+
+ /* Just to make the interpreter happy */
+ return tmp_number((AWKNUM) 0);
+}
+
+/* dlload --- load new builtins in this library */
+
+NODE *
+dlload(tree, dl)
+NODE *tree;
+void *dl;
+{
+ make_builtin("chdir", do_chdir, 1);
+ make_builtin("symlink", do_symlink, 2);
+ make_builtin("unlink", do_unlink, 1);
+ make_builtin("mkdir", do_mkdir, 2);
+ make_builtin("rmdir", do_rmdir, 1);
+ make_builtin("stat", do_stat, 2);
+
+ return tmp_number((AWKNUM) 0);
+}
+
diff --git a/sys-apps/gawk/files/gawk-4.1.0-ports.patch b/sys-apps/gawk/files/gawk-4.1.0-ports.patch
new file mode 100644
index 000000000000..9aba7e8a2df3
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-4.1.0-ports.patch
@@ -0,0 +1,189 @@
+AIX port, bug#490266.
+
+This is from 2 upstream commits:
+
+http://git.savannah.gnu.org/cgit/gawk.git/commit/?h=gawk-4.1-stable&id=21c8b6d547b12942775d675ead2994992285c04c
+http://git.savannah.gnu.org/cgit/gawk.git/commit/?h=gawk-4.1-stable&id=29e3ae329c550b884169b7db20775cd74b95b77a
+
+#diff --git a/extension/ChangeLog b/extension/ChangeLog
+#index e01d6d1..4d1af22 100644
+#--- a/extension/ChangeLog
+#+++ b/extension/ChangeLog
+#@@ -1,3 +1,20 @@
+#+2013-10-23 Michael Haubenwallner <michael.haubenwallner@salomon.at>
+#+
+#+ Fix portability for AIX.
+#+
+#+ * inplace.c (_XOPEN_SOURCE): Define when not defined yet.
+#+ (_XOPEN_SOURCE_EXTENDED): Ditto. Needs to define a number.
+#+
+#+2013-06-10 Arnold D. Robbins <arnold@skeeve.com>
+#+
+#+ * configure.ac (AC_HEADER_MAJOR): New macro added.
+#+ Add check for limits.h header.
+#+ * filefuncs.c: Add the right stuff to get the major/minor macros.
+#+ * readdir.c: Add include of limits.h appropriately wrapped.
+#+
+#+ Thanks to ICHII Takashi <ichii386@schweetheart.jp> for the reports
+#+ and pointers.
+#+
+# 2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
+#
+# * 4.1.0: Release tar ball made.
+#diff --git a/extension/configure.ac b/extension/configure.ac
+#index 53ed588..3ad03ed 100644
+#--- a/extension/configure.ac
+#+++ b/extension/configure.ac
+#@@ -64,7 +64,8 @@ else
+# AC_MSG_RESULT([no])
+# fi
+#
+#-AC_CHECK_HEADERS(dirent.h fnmatch.h time.h sys/time.h sys/select.h)
+#+AC_HEADER_MAJOR
+#+AC_CHECK_HEADERS(dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h)
+#
+# AC_CHECK_FUNCS(fdopendir fnmatch gettimeofday \
+# getdtablesize nanosleep select GetSystemTimeAsFileTime)
+diff --git a/extension/configh.in b/extension/configh.in
+index 9162ce4..02954ee 100644
+--- a/extension/configh.in
++++ b/extension/configh.in
+@@ -66,6 +66,9 @@
+ /* Define to 1 if you have the <inttypes.h> header file. */
+ #undef HAVE_INTTYPES_H
+
++/* Define to 1 if you have the <limits.h> header file. */
++#undef HAVE_LIMITS_H
++
+ /* Define to 1 if you have the <memory.h> header file. */
+ #undef HAVE_MEMORY_H
+
+@@ -109,6 +112,14 @@
+ */
+ #undef LT_OBJDIR
+
++/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
++ */
++#undef MAJOR_IN_MKDEV
++
++/* Define to 1 if `major', `minor', and `makedev' are declared in
++ <sysmacros.h>. */
++#undef MAJOR_IN_SYSMACROS
++
+ /* Name of package */
+ #undef PACKAGE
+
+diff --git a/extension/configure b/extension/configure
+index f848b9b..c3f8f1c 100755
+--- a/extension/configure
++++ b/extension/configure
+@@ -13885,7 +13885,57 @@ else
+ $as_echo "no" >&6; }
+ fi
+
+-for ac_header in dirent.h fnmatch.h time.h sys/time.h sys/select.h
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
++$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
++if ${ac_cv_header_sys_types_h_makedev+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++#include <sys/types.h>
++int
++main ()
++{
++return makedev(0, 0);
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_header_sys_types_h_makedev=yes
++else
++ ac_cv_header_sys_types_h_makedev=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5
++$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }
++
++if test $ac_cv_header_sys_types_h_makedev = no; then
++ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
++if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
++
++$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
++
++fi
++
++
++
++ if test $ac_cv_header_sys_mkdev_h = no; then
++ ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
++if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
++
++$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
++
++fi
++
++
++ fi
++fi
++
++for ac_header in dirent.h fnmatch.h limits.h time.h sys/time.h sys/select.h
+ do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+diff --git a/extension/filefuncs.c b/extension/filefuncs.c
+index 1e8fc8d..9e637aa 100644
+--- a/extension/filefuncs.c
++++ b/extension/filefuncs.c
+@@ -46,6 +46,12 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+
++#ifdef MAJOR_IN_MKDEV
++#include <sys/mkdev.h>
++#elif defined(MAJOR_IN_SYSMACROS)
++#include <sys/sysmacros.h>
++#endif
++
+ #include "gawkapi.h"
+
+ #include "gettext.h"
+diff --git a/extension/inplace.c b/extension/inplace.c
+index ded4746..69d452a 100644
+--- a/extension/inplace.c
++++ b/extension/inplace.c
+@@ -27,8 +27,12 @@
+ #include <config.h>
+ #endif
+
+-#define _XOPEN_SOURCE
+-#define _XOPEN_SOURCE_EXTENDED
++#ifndef _XOPEN_SOURCE
++# define _XOPEN_SOURCE
++#endif
++#ifndef _XOPEN_SOURCE_EXTENDED
++# define _XOPEN_SOURCE_EXTENDED 1
++#endif
+
+ #include <stdio.h>
+ #include <assert.h>
+diff --git a/extension/readdir.c b/extension/readdir.c
+index 5ca4dc6..c2a626a 100644
+--- a/extension/readdir.c
++++ b/extension/readdir.c
+@@ -44,6 +44,10 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+
++#ifdef HAVE_LIMITS_H
++#include <limits.h>
++#endif
++
+ #ifdef HAVE_DIRENT_H
+ #include <dirent.h>
+ #else
diff --git a/sys-apps/gawk/files/gawk-4.1.3-bsd_configure_readline.patch b/sys-apps/gawk/files/gawk-4.1.3-bsd_configure_readline.patch
new file mode 100644
index 000000000000..3bd267efd179
--- /dev/null
+++ b/sys-apps/gawk/files/gawk-4.1.3-bsd_configure_readline.patch
@@ -0,0 +1,63 @@
+http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=ac0ef52fe407b89c7968b927c7b2b513cc13963a
+
+--- gawk-4.1.3/configure 2015-05-19 15:38:35.000000000 +0200
++++ gawk-4.1.3/configure 2015-05-19 15:38:35.000000000 +0200
+@@ -10825,7 +10825,46 @@
+
+ if test $_found_readline = yes ; then
+ case $host_os in
+- *bsd* ) _combo="$_combo -ltermcap"
++ *bsd* ) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
++$as_echo_n "checking for tgetent in -ltermcap... " >&6; }
++if ${ac_cv_lib_termcap_tgetent+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_check_lib_save_LIBS=$LIBS
++LIBS="-ltermcap $LIBS"
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char tgetent ();
++int
++main ()
++{
++return tgetent ();
++ ;
++ return 0;
++}
++_ACEOF
++if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_lib_termcap_tgetent=yes
++else
++ ac_cv_lib_termcap_tgetent=no
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5
++$as_echo "$ac_cv_lib_termcap_tgetent" >&6; }
++if test "x$ac_cv_lib_termcap_tgetent" = xyes; then :
++ _combo="$_combo -ltermcap"
++fi
++
+ ;;
+ esac
+
+--- gawk-4.1.3/m4/readline.m4 2015-04-05 12:19:19.000000000 +0200
++++ gawk-4.1.3/m4/readline.m4 2015-04-05 12:19:19.000000000 +0200
+@@ -92,7 +92,7 @@
+
+ if test $_found_readline = yes ; then
+ case $host_os in
+- *bsd* ) _combo="$_combo -ltermcap"
++ *bsd* ) AC_CHECK_LIB(termcap, tgetent, _combo="$_combo -ltermcap")
+ ;;
+ esac
+ AC_DEFINE(HAVE_LIBREADLINE,1,
diff --git a/sys-apps/gawk/gawk-3.1.8.ebuild b/sys-apps/gawk/gawk-3.1.8.ebuild
new file mode 100644
index 000000000000..3d75e9eb59a4
--- /dev/null
+++ b/sys-apps/gawk/gawk-3.1.8.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="GNU awk pattern-matching language"
+HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
+SRC_URI="mirror://gnu/gawk/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="nls"
+
+RDEPEND="!>=virtual/awk-1"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+SFFS=${WORKDIR}/filefuncs
+
+src_unpack() {
+ unpack ${A}
+
+ # Copy filefuncs module's source over ...
+ cp -r "${FILESDIR}"/filefuncs "${SFFS}" || die "cp failed"
+}
+
+src_prepare() {
+ # use symlinks rather than hardlinks, and disable version links
+ sed -i \
+ -e '/^LN =/s:=.*:= $(LN_S):' \
+ -e '/install-exec-hook:/s|$|\nfoo:|' \
+ Makefile.in doc/Makefile.in
+}
+
+src_configure() {
+ export ac_cv_libsigsegv=no
+ econf \
+ --libexec='$(libdir)/misc' \
+ $(use_enable nls) \
+ --enable-switch
+}
+
+src_compile() {
+ emake || die
+ emake -C "${SFFS}" CC="$(tc-getCC)" || die "filefuncs emake failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ emake -C "${SFFS}" LIBDIR="$(get_libdir)" install || die
+
+ # Keep important gawk in /bin
+ if use userland_GNU ; then
+ dodir /bin
+ mv "${D}"/usr/bin/gawk "${D}"/bin/ || die
+ dosym /bin/gawk /usr/bin/gawk
+
+ # Provide canonical `awk`
+ dosym gawk /bin/awk
+ dosym gawk /usr/bin/awk
+ dosym gawk.1 /usr/share/man/man1/awk.1
+ fi
+
+ # Install headers
+ insinto /usr/include/awk
+ doins *.h || die
+ # We do not want 'acconfig.h' in there ...
+ rm -f "${D}"/usr/include/awk/acconfig.h
+
+ dodoc AUTHORS ChangeLog FUTURES LIMITATIONS NEWS PROBLEMS POSIX.STD README README_d/*.*
+ for x in */ChangeLog ; do
+ newdoc ${x} ${x##*/}.${x%%/*}
+ done
+}
diff --git a/sys-apps/gawk/gawk-4.0.2.ebuild b/sys-apps/gawk/gawk-4.0.2.ebuild
new file mode 100644
index 000000000000..0440ee376106
--- /dev/null
+++ b/sys-apps/gawk/gawk-4.0.2.ebuild
@@ -0,0 +1,74 @@
+# 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="GNU awk pattern-matching language"
+HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
+SRC_URI="mirror://gnu/gawk/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls readline"
+
+# older gawk's provided shared lib for baselayout-1
+RDEPEND="!<sys-apps/baselayout-2.0.1
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ # use symlinks rather than hardlinks, and disable version links
+ sed -i \
+ -e '/^LN =/s:=.*:= $(LN_S):' \
+ -e '/install-exec-hook:/s|$|\nfoo:|' \
+ Makefile.in doc/Makefile.in
+ sed -i '/^pty1:$/s|$|\n_pty1:|' test/Makefile.in #413327
+}
+
+src_configure() {
+ export ac_cv_libsigsegv=no
+ econf \
+ --libexec='$(libdir)/misc' \
+ $(use_enable nls) \
+ $(use_with readline)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ # Install headers
+ insinto /usr/include/awk
+ doins *.h || die
+ rm "${ED}"/usr/include/awk/config.h || die
+
+ dodoc AUTHORS ChangeLog FUTURES LIMITATIONS NEWS PROBLEMS POSIX.STD README README_d/*.*
+ for x in */ChangeLog ; do
+ newdoc ${x} ${x##*/}.${x%%/*}
+ done
+}
+
+pkg_postinst() {
+ # symlink creation here as the links do not belong to gawk, but to any awk
+ if has_version app-admin/eselect \
+ && has_version app-eselect/eselect-awk ; then
+ eselect awk update ifunset
+ else
+ local l
+ for l in "${EROOT}"usr/share/man/man1/gawk.1* "${EROOT}"usr/bin/gawk; do
+ [[ -e ${l} && ! -e ${l/gawk/awk} ]] && ln -s "${l##*/}" "${l/gawk/awk}"
+ done
+ [[ ! -e ${EROOT}bin/awk ]] && ln -s "../usr/bin/gawk" "${EROOT}bin/awk"
+ fi
+}
+
+pkg_postrm() {
+ if has_version app-admin/eselect \
+ && has_version app-eselect/eselect-awk ; then
+ eselect awk update ifunset
+ fi
+}
diff --git a/sys-apps/gawk/gawk-4.1.2.ebuild b/sys-apps/gawk/gawk-4.1.2.ebuild
new file mode 100644
index 000000000000..4a6de0e5adc2
--- /dev/null
+++ b/sys-apps/gawk/gawk-4.1.2.ebuild
@@ -0,0 +1,74 @@
+# 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="GNU awk pattern-matching language"
+HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
+SRC_URI="mirror://gnu/gawk/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="mpfr nls readline"
+
+RDEPEND="mpfr? ( dev-libs/mpfr )
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ # use symlinks rather than hardlinks, and disable version links
+ sed -i \
+ -e '/^LN =/s:=.*:= $(LN_S):' \
+ -e '/install-exec-hook:/s|$|\nfoo:|' \
+ Makefile.in doc/Makefile.in || die
+ sed -i '/^pty1:$/s|$|\n_pty1:|' test/Makefile.in #413327
+ # disable pointless build time hack that breaks cross-compiling #493362
+ sed -i \
+ -e '/check-recursive all-recursive: check-for-shared-lib-support/d' \
+ extension/Makefile.in || die
+}
+
+src_configure() {
+ export ac_cv_libsigsegv=no
+ econf \
+ --libexec='$(libdir)/misc' \
+ $(use_with mpfr) \
+ $(use_enable nls) \
+ $(use_with readline)
+}
+
+src_install() {
+ rm -rf README_d # automatic dodocs barfs
+ default
+
+ # Install headers
+ insinto /usr/include/awk
+ doins *.h || die
+ rm "${ED}"/usr/include/awk/config.h || die
+}
+
+pkg_postinst() {
+ # symlink creation here as the links do not belong to gawk, but to any awk
+ if has_version app-admin/eselect \
+ && has_version app-eselect/eselect-awk ; then
+ eselect awk update ifunset
+ else
+ local l
+ for l in "${EROOT}"usr/share/man/man1/gawk.1* "${EROOT}"usr/bin/gawk; do
+ [[ -e ${l} && ! -e ${l/gawk/awk} ]] && ln -s "${l##*/}" "${l/gawk/awk}"
+ done
+ [[ ! -e ${EROOT}bin/awk ]] && ln -s "../usr/bin/gawk" "${EROOT}bin/awk"
+ fi
+}
+
+pkg_postrm() {
+ if has_version app-admin/eselect \
+ && has_version app-eselect/eselect-awk ; then
+ eselect awk update ifunset
+ fi
+}
diff --git a/sys-apps/gawk/gawk-4.1.3.ebuild b/sys-apps/gawk/gawk-4.1.3.ebuild
new file mode 100644
index 000000000000..262b1b8f64e4
--- /dev/null
+++ b/sys-apps/gawk/gawk-4.1.3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="GNU awk pattern-matching language"
+HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html"
+SRC_URI="mirror://gnu/gawk/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="mpfr nls readline"
+
+RDEPEND="mpfr? ( dev-libs/mpfr:0= )
+ readline? ( sys-libs/readline:0= )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ # use symlinks rather than hardlinks, and disable version links
+ sed -i \
+ -e '/^LN =/s:=.*:= $(LN_S):' \
+ -e '/install-exec-hook:/s|$|\nfoo:|' \
+ Makefile.in doc/Makefile.in || die
+ sed -i '/^pty1:$/s|$|\n_pty1:|' test/Makefile.in #413327
+ # disable pointless build time hack that breaks cross-compiling #493362
+ sed -i \
+ -e '/check-recursive all-recursive: check-for-shared-lib-support/d' \
+ extension/Makefile.in || die
+
+ EPATCH_OPTS="-Z" \
+ epatch "${FILESDIR}/${P}-bsd_configure_readline.patch" #507468
+}
+
+src_configure() {
+ export ac_cv_libsigsegv=no
+ econf \
+ --libexec='$(libdir)/misc' \
+ $(use_with mpfr) \
+ $(use_enable nls) \
+ $(use_with readline)
+}
+
+src_install() {
+ rm -rf README_d # automatic dodocs barfs
+ default
+
+ # Install headers
+ insinto /usr/include/awk
+ doins *.h || die
+ rm "${ED}"/usr/include/awk/config.h || die
+}
+
+pkg_postinst() {
+ # symlink creation here as the links do not belong to gawk, but to any awk
+ if has_version app-admin/eselect \
+ && has_version app-eselect/eselect-awk ; then
+ eselect awk update ifunset
+ else
+ local l
+ for l in "${EROOT}"usr/share/man/man1/gawk.1* "${EROOT}"usr/bin/gawk; do
+ [[ -e ${l} && ! -e ${l/gawk/awk} ]] && ln -s "${l##*/}" "${l/gawk/awk}"
+ done
+ [[ ! -e ${EROOT}bin/awk ]] && ln -s "../usr/bin/gawk" "${EROOT}bin/awk"
+ fi
+}
+
+pkg_postrm() {
+ if has_version app-admin/eselect \
+ && has_version app-eselect/eselect-awk ; then
+ eselect awk update ifunset
+ fi
+}
diff --git a/sys-apps/gawk/metadata.xml b/sys-apps/gawk/metadata.xml
new file mode 100644
index 000000000000..22beef61923b
--- /dev/null
+++ b/sys-apps/gawk/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>
+<use>
+ <flag name='mpfr'>use mpfr for high precision arithmetic (-M / --bignum)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/gentoo-functions/Manifest b/sys-apps/gentoo-functions/Manifest
new file mode 100644
index 000000000000..07da3ad991f2
--- /dev/null
+++ b/sys-apps/gentoo-functions/Manifest
@@ -0,0 +1,5 @@
+DIST consoletype-1.0.sh 616 SHA256 b6f837be496024941b81402e6c11300eb4a53987368c5c6d9afb5fd8b1c34d28 SHA512 ab6edd0035ad2ac855bc7b94679a78aad63f647b906dfda39a9844b676e6cdfc872fd1fc897f6158a5709906905a4da5ce8b4665f9e2bc0bcd1e88bb9ecace07 WHIRLPOOL b2d5f13e7411d8e6b5c4dae875041a95bed3ed7b20e765971b86fd16b1a970e8ad10288683d2efa530ef8568c6c58a07f9fc5a4a1b6b00ee6ed731da90e472ed
+DIST gentoo-functions-0.10.tar.gz 11432 SHA256 709c8b22f404001a512e47a7a4d3192070b3e150fb9d0f943de09736d665b0db SHA512 2622cede032089c7b8a2dec576e848852f9964e0198ab161f0ff5c426c542d0849bd3d30a40c296805bfec90b533c419df43c7975ed85678471483c827ca4cdb WHIRLPOOL 6559c62083eca8a016f005d1003c8a0b6e2c89836c130cec9e0a40575e1604039f669313547c63f6cf84f1a40cdd7249d227c6f0b57f282764df8d20ef239051
+DIST gentoo-functions-0.7.tar.bz2 10656 SHA256 0034ff7a65deb8df902683deb1662ce561b7f76ff8561b4ada46cfb18effc7f3 SHA512 7b7c779daeaa37476be488123222af591b357ce1071d8a68694797ce35c8f9c1492da55e4d3059443eb20e08cc7d88eee0e1914efa2b322628c3660c277f7a64 WHIRLPOOL 4b50d0cf0e355d267c2cb6db18211a8d48f48a248190e38227449ef01e39b3968b10a4276ca22b43af9d40706b804730ac81e6ba83efbfcc426a6781dd007cc1
+DIST gentoo-functions-0.8.tar.bz2 10647 SHA256 89dc0a3289a2e3312efb560e904add13ececdd5eb554151cb30d0b96f1bd8116 SHA512 34f04f5e7ecd888197b6486c131c346a84a6937501f68a54481ec3caacaee86e54345a6c34364a5953c55b1d4aeb4ca2173b70864cdd7b81e74964352132b322 WHIRLPOOL 6ba223987953fa1dd80b79590c5f72ab8b5d0eca47cc1df23559e295f03faa369a372e5c27ed47d19d605dfe072c22c7702f3d4443a8ea2489d25092274670f3
+DIST gentoo-functions-0.9.tar.gz 11439 SHA256 63e51e0288c82912e51c490512c695a2d77b86a3a7e02180e313d19978ba4a2c SHA512 c8b99448f6a295597e135803cd903e81fb3886de9dff725137a341cd667575e5269d3e0369ad3d19cd448ba0716e48b12752462f310f5e8c54e132777ceb684f WHIRLPOOL aa30d196161bec7c1a7bed89dda6faf56d5c7a7fe555ae8ded93a61d9b74551a6db81e696b28e2c7694c8ee2cf58758197d1616e4db31e5bfdc195ac43f70bf5
diff --git a/sys-apps/gentoo-functions/gentoo-functions-0.10.ebuild b/sys-apps/gentoo-functions/gentoo-functions-0.10.ebuild
new file mode 100644
index 000000000000..b278aa927740
--- /dev/null
+++ b/sys-apps/gentoo-functions/gentoo-functions-0.10.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://github.com/gentoo/${PN}.git"
+else
+ SRC_URI="https://github.com/gentoo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="base functions required by all gentoo systems"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ tc-export CC
+ append-lfs-flags
+}
+
+src_install() {
+ emake install DESTDIR="${ED}"
+}
diff --git a/sys-apps/gentoo-functions/gentoo-functions-0.7.ebuild b/sys-apps/gentoo-functions/gentoo-functions-0.7.ebuild
new file mode 100644
index 000000000000..56c6334f5497
--- /dev/null
+++ b/sys-apps/gentoo-functions/gentoo-functions-0.7.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://github.com/gentoo/${PN}.git"
+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 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+inherit toolchain-funcs
+
+DESCRIPTION="base functions required by all gentoo systems"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ tc-export CC
+}
diff --git a/sys-apps/gentoo-functions/gentoo-functions-0.8.ebuild b/sys-apps/gentoo-functions/gentoo-functions-0.8.ebuild
new file mode 100644
index 000000000000..f307bd17c402
--- /dev/null
+++ b/sys-apps/gentoo-functions/gentoo-functions-0.8.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://github.com/gentoo/${PN}.git"
+else
+ SRC_URI="http://dev.gentoo.org/~williamh/dist/${P}.tar.bz2
+ prefix? ( http://dev.gentoo.org/~grobian/distfiles/consoletype-1.0.sh )"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+inherit toolchain-funcs
+
+DESCRIPTION="base functions required by all gentoo systems"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ tc-export CC
+
+ # in prefix, use shell script, for the C-code doesn't compile
+ use prefix && cp "${DISTDIR}"/consoletype-1.0.sh consoletype
+}
+
+src_install() {
+ emake install DESTDIR="${ED}"
+}
diff --git a/sys-apps/gentoo-functions/gentoo-functions-0.9.ebuild b/sys-apps/gentoo-functions/gentoo-functions-0.9.ebuild
new file mode 100644
index 000000000000..f877ef4acdcd
--- /dev/null
+++ b/sys-apps/gentoo-functions/gentoo-functions-0.9.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://github.com/gentoo/${PN}.git"
+else
+ SRC_URI="https://github.com/gentoo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+inherit toolchain-funcs
+
+DESCRIPTION="base functions required by all gentoo systems"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ tc-export CC
+}
+
+src_install() {
+ emake install DESTDIR="${ED}"
+}
diff --git a/sys-apps/gentoo-functions/gentoo-functions-9999.ebuild b/sys-apps/gentoo-functions/gentoo-functions-9999.ebuild
new file mode 100644
index 000000000000..96cc0d0c64db
--- /dev/null
+++ b/sys-apps/gentoo-functions/gentoo-functions-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
+
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://github.com/gentoo/${PN}.git"
+else
+ SRC_URI="https://github.com/gentoo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="base functions required by all gentoo systems"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ tc-export CC
+ append-lfs-flags
+}
+
+src_install() {
+ emake install DESTDIR="${ED}"
+}
diff --git a/sys-apps/gentoo-functions/metadata.xml b/sys-apps/gentoo-functions/metadata.xml
new file mode 100644
index 000000000000..cf7649442a1a
--- /dev/null
+++ b/sys-apps/gentoo-functions/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>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+ </maintainer>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <herd>base-system</herd>
+ <longdescription lang="en">
+ This package contains base shell functions which are required by
+ all Gentoo systems.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">gentoo/gentoo-functions</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/gentoo-systemd-integration/Manifest b/sys-apps/gentoo-systemd-integration/Manifest
new file mode 100644
index 000000000000..5e59ca78471d
--- /dev/null
+++ b/sys-apps/gentoo-systemd-integration/Manifest
@@ -0,0 +1,2 @@
+DIST gentoo-systemd-integration-2.tar.bz2 51951 SHA256 2466a11d9b6f6e8d726cb5549bc1c38d28d6742d596e2b2c455c9089c1baf7fd SHA512 dc962165516612ca0ff41fdbd53a420549967a3952640ae7d37aafdbb3543a9b37a928e0528fcbbce74e0ded970e311c350272856fc8a75d9c8dc94a960e3bbc WHIRLPOOL 0517b515b9d01605c46d95fc3e86bf38c200923e3b7df1dde59b875c3eeef232c7dec38833007a943390631cb8eeb4f7c89e79c4b8dab737eea8c63bb36341bf
+DIST gentoo-systemd-integration-4.tar.bz2 52449 SHA256 7027bd2056449e5ec8f9fc3da81c0f157810d482bfa11be48903643335fc6bde SHA512 2f60a98062fc5b9c7247e5df77b8875e532d28b2b903a2770713bbcfb2706f0f1bd7809396dd49ff1cc41f69d8c3dceaef87909fa8683c458a5f818f5e05a574 WHIRLPOOL f87b8aa01f24fad4ff90e694fa03b718425bbb0c0dc8a00950b0ae81230f3b92255d07efc9161707a35c8f3e0e7664c57b7ae061ccc0d896bfc55a632a8b4f09
diff --git a/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-2.ebuild b/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-2.ebuild
new file mode 100644
index 000000000000..4f63e11be5db
--- /dev/null
+++ b/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-2.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 autotools-utils systemd
+
+DESCRIPTION="systemd integration files for Gentoo"
+HOMEPAGE="https://bitbucket.org/mgorny/gentoo-systemd-integration"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE=""
+
+RDEPEND=">=sys-apps/systemd-207"
+
+src_configure() {
+ local myeconfargs=(
+ "$(systemd_with_unitdir)"
+ # TODO: solve it better in the eclass
+ --with-systemdsystemgeneratordir="$(systemd_get_utildir)"/system-generators
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-4.ebuild b/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-4.ebuild
new file mode 100644
index 000000000000..af14c6a96ad3
--- /dev/null
+++ b/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-4.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils systemd
+
+DESCRIPTION="systemd integration files for Gentoo"
+HOMEPAGE="https://bitbucket.org/mgorny/gentoo-systemd-integration"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE=""
+
+RDEPEND=">=sys-apps/systemd-207
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+src_configure() {
+ local myeconfargs=(
+ "$(systemd_with_unitdir)"
+ # TODO: solve it better in the eclass
+ --with-systemdsystemgeneratordir="$(systemd_get_utildir)"/system-generators
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-9999.ebuild b/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-9999.ebuild
new file mode 100644
index 000000000000..7adc033f3c92
--- /dev/null
+++ b/sys-apps/gentoo-systemd-integration/gentoo-systemd-integration-9999.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#if LIVE
+AUTOTOOLS_AUTORECONF=1
+EGIT_REPO_URI="http://bitbucket.org/mgorny/${PN}.git"
+inherit git-2
+#endif
+
+inherit autotools-utils systemd
+
+DESCRIPTION="systemd integration files for Gentoo"
+HOMEPAGE="https://bitbucket.org/mgorny/gentoo-systemd-integration"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=sys-apps/systemd-207
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+#if LIVE
+SRC_URI=
+KEYWORDS=
+
+DEPEND="${DEPEND}
+ sys-devel/systemd-m4"
+#endif
+
+src_configure() {
+ local myeconfargs=(
+ "$(systemd_with_unitdir)"
+ # TODO: solve it better in the eclass
+ --with-systemdsystemgeneratordir="$(systemd_get_utildir)"/system-generators
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/sys-apps/gentoo-systemd-integration/metadata.xml b/sys-apps/gentoo-systemd-integration/metadata.xml
new file mode 100644
index 000000000000..c46ecee5b0be
--- /dev/null
+++ b/sys-apps/gentoo-systemd-integration/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>systemd@gentoo.org</email>
+ <name>Gentoo systemd team</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="bitbucket">mgorny/gentoo-systemd-integration</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/gnome-disk-utility/Manifest b/sys-apps/gnome-disk-utility/Manifest
new file mode 100644
index 000000000000..e1e84ccd6448
--- /dev/null
+++ b/sys-apps/gnome-disk-utility/Manifest
@@ -0,0 +1,2 @@
+DIST gnome-disk-utility-3.14.0.tar.xz 1426948 SHA256 85ee6453e56c97a5c33b7346849016f31df53f9acbe325a046d269242797d32b SHA512 ce4be64fbd4c72ad2a853a6ee06165b18f5d5e91d69654f2db813aec0d8e8294fc8e0ce84f20638a169468341cce4ca4bb2580d542a5228040df06733a1f2e4f WHIRLPOOL e4d57810527bdcec7f3dba200d6a2c60b15178ce38e6560c4447cfcc3286471cfecabd96fb8f508a3e5a9c3113275051afd478d0b4d7b3a81af3d5d4f3064e59
+DIST gnome-disk-utility-3.16.2.tar.xz 1432332 SHA256 4a495563a0142d2a64d9f573e5333a82d6c3c94ab5c8cd9b1878bfa36ae15353 SHA512 228187c1f3354c3a11dda3d4b85abed3e54bb7e5f105971f5d39f72fa52bcc9b44344c27148c604b2a87ed83942724187af90527e48acb9e9bc888922c34a53b WHIRLPOOL ef0b1b6f2cbeac1533798854796905909b866f45f9377bbd05060df1f615d81e0cb58a2e9d8bfbf3b9bef3d22d24cba45ec8d64ddbe63887bbbce75967ca1969
diff --git a/sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-kill-gsd-automagic.patch b/sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-kill-gsd-automagic.patch
new file mode 100644
index 000000000000..c6d414c0ae97
--- /dev/null
+++ b/sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-kill-gsd-automagic.patch
@@ -0,0 +1,46 @@
+From cfefd62c7f23625fd1b07dacb35681bdf5aafa04 Mon Sep 17 00:00:00 2001
+From: Andreas Henriksson <andreas@fatal.se>
+Date: Fri, 5 Apr 2013 12:42:06 +0200
+Subject: [PATCH 1/2] Avoid needing gsd during build when --disable-gsd-plugin
+ is used
+
+PKG_CHECK_MODULES was previously unconditionally requiring
+gnome-settings-daemon to be available, even when it was later
+not going to be used because the --disable-gsd-plugin configure
+switch was passed.
+
+Move the check to only require g-s-d when it's actually going to be
+used.
+
+While at it, also fix the indentation of the msg_gsd_plugin=yes line.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=697146
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cce9d62..d8f6198 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -120,7 +120,6 @@ PKG_CHECK_MODULES(LIBSECRET1, [libsecret-1 >= $LIBSECRET1_REQUIRED])
+ PKG_CHECK_MODULES(PWQUALITY, [pwquality >= $PWQUALITY_REQUIRED])
+ PKG_CHECK_MODULES(CANBERRA, [libcanberra-gtk3 >= $CANBERRA_REQUIRED])
+ PKG_CHECK_MODULES(LIBDVDREAD, [dvdread >= $LIBDVDREAD_REQUIRED])
+-PKG_CHECK_MODULES(GSD_PLUGIN, [gnome-settings-daemon >= $GSD_PLUGIN_REQUIRED])
+ PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= $LIBNOTIFY_REQUIRED])
+ PKG_CHECK_MODULES(LIBLZMA, [liblzma >= $LIBLZMA_REQUIRED])
+
+@@ -157,7 +156,8 @@ dnl *************************************
+ AC_ARG_ENABLE(gsd_plugin, AS_HELP_STRING([--disable-gsd-plugin],[don't build gnome-settings-daemon plug-in]))
+ msg_gsd_plugin=no
+ if test "x$enable_gsd_plugin" != "xno"; then
+- msg_gsd_plugin=yes
++ msg_gsd_plugin=yes
++ PKG_CHECK_MODULES(GSD_PLUGIN, [gnome-settings-daemon >= $GSD_PLUGIN_REQUIRED])
+ fi
+ AM_CONDITIONAL(USE_GSD_PLUGIN, [test "$msg_gsd_plugin" = "yes"])
+
+--
+1.8.3.2
+
diff --git a/sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-raise-gsd-dependency.patch b/sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-raise-gsd-dependency.patch
new file mode 100644
index 000000000000..f5ff3cec5359
--- /dev/null
+++ b/sys-apps/gnome-disk-utility/files/gnome-disk-utility-3.10.0-raise-gsd-dependency.patch
@@ -0,0 +1,35 @@
+From f05af64dd29a5119f36d0c34f0d6aa9f04567933 Mon Sep 17 00:00:00 2001
+From: Andreas Henriksson <andreas@fatal.se>
+Date: Fri, 5 Apr 2013 12:30:55 +0200
+Subject: [PATCH 2/2] Bump required version of gnome-settings-daemon to 3.8
+
+Reported by Pacho Ramos in https://bugzilla.gnome.org/697146
+and from the references gentoo bug report:
+
+With gnome-base/gnome-settings-daemon-3.6.4:
+
+gdusdmanager.c: At top level:
+gdusdmanager.c:42:1: error: unknown type name 'GduSdClass'
+gdusdmanager.c:80:1: warning: 'gdu_sd_manager_start' defined but not used [-Wunused-function]
+gdusdmanager.c:124:1: warning: 'gdu_sd_manager_new' defined but not used [-Wunused-function]
+make[3]: *** [libgdu_sd_la-gdusdmanager.lo] Error 1
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index d8f6198..2604798 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -109,7 +109,7 @@ LIBSECRET1_REQUIRED=0.7
+ PWQUALITY_REQUIRED=1.0.0
+ CANBERRA_REQUIRED=0.1
+ LIBDVDREAD_REQUIRED=4.2.0
+-GSD_PLUGIN_REQUIRED=3.6
++GSD_PLUGIN_REQUIRED=3.8
+ LIBNOTIFY_REQUIRED=0.7
+ LIBLZMA_REQUIRED=5.0.5
+
+--
+1.8.3.2
+
diff --git a/sys-apps/gnome-disk-utility/gnome-disk-utility-3.14.0.ebuild b/sys-apps/gnome-disk-utility/gnome-disk-utility-3.14.0.ebuild
new file mode 100644
index 000000000000..8e2cad70fb2d
--- /dev/null
+++ b/sys-apps/gnome-disk-utility/gnome-disk-utility-3.14.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+
+inherit autotools eutils gnome2
+
+DESCRIPTION="Disk Utility for GNOME using udisks"
+HOMEPAGE="http://git.gnome.org/browse/gnome-disk-utility"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="fat +gnome systemd"
+KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc x86"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.31:2
+ >=sys-fs/udisks-2.1.1:2
+ >=x11-libs/gtk+-3.12:3
+ >=app-arch/xz-utils-5.0.5
+ >=app-crypt/libsecret-0.7
+ dev-libs/libpwquality
+ systemd? ( >=sys-apps/systemd-44:0= )
+"
+RDEPEND="${COMMON_DEPEND}
+ >=media-libs/libdvdread-4.2.0
+ >=media-libs/libcanberra-0.1[gtk3]
+ >=x11-libs/libnotify-0.7:=
+ >=x11-themes/gnome-icon-theme-symbolic-2.91
+ fat? ( sys-fs/dosfstools )
+ gnome? ( >=gnome-base/gnome-settings-daemon-3.8 )
+"
+DEPEND="${COMMON_DEPEND}
+ >=dev-util/intltool-0.50
+ dev-libs/libxslt
+ gnome-base/gnome-common
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # Fix USE=-gnome, bug #478820
+ epatch "${FILESDIR}"/${PN}-3.10.0-kill-gsd-automagic.patch
+ epatch "${FILESDIR}"/${PN}-3.10.0-raise-gsd-dependency.patch
+
+ eautoreconf
+ gnome2_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ $(use_enable gnome gsd-plugin) \
+ $(use_enable systemd libsystemd-login)
+}
diff --git a/sys-apps/gnome-disk-utility/gnome-disk-utility-3.16.2.ebuild b/sys-apps/gnome-disk-utility/gnome-disk-utility-3.16.2.ebuild
new file mode 100644
index 000000000000..6436197271aa
--- /dev/null
+++ b/sys-apps/gnome-disk-utility/gnome-disk-utility-3.16.2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+
+inherit autotools eutils gnome2
+
+DESCRIPTION="Disk Utility for GNOME using udisks"
+HOMEPAGE="http://git.gnome.org/browse/gnome-disk-utility"
+
+LICENSE="GPL-2+"
+SLOT="0"
+IUSE="fat +gnome systemd"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+
+COMMON_DEPEND="
+ >=dev-libs/glib-2.31:2
+ >=sys-fs/udisks-2.1.1:2
+ >=x11-libs/gtk+-3.12:3
+ >=app-arch/xz-utils-5.0.5
+ >=app-crypt/libsecret-0.7
+ dev-libs/libpwquality
+ systemd? ( >=sys-apps/systemd-44:0= )
+"
+RDEPEND="${COMMON_DEPEND}
+ >=media-libs/libdvdread-4.2.0
+ >=media-libs/libcanberra-0.1[gtk3]
+ >=x11-libs/libnotify-0.7:=
+ >=x11-themes/gnome-icon-theme-symbolic-2.91
+ fat? ( sys-fs/dosfstools )
+ gnome? ( >=gnome-base/gnome-settings-daemon-3.8 )
+"
+DEPEND="${COMMON_DEPEND}
+ >=dev-util/intltool-0.50
+ dev-libs/libxslt
+ gnome-base/gnome-common
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # Fix USE=-gnome, bug #478820
+ epatch "${FILESDIR}"/${PN}-3.10.0-kill-gsd-automagic.patch
+ epatch "${FILESDIR}"/${PN}-3.10.0-raise-gsd-dependency.patch
+
+ eautoreconf
+ gnome2_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ $(use_enable gnome gsd-plugin) \
+ $(use_enable systemd libsystemd-login)
+}
diff --git a/sys-apps/gnome-disk-utility/metadata.xml b/sys-apps/gnome-disk-utility/metadata.xml
new file mode 100644
index 000000000000..7ec8ee75a308
--- /dev/null
+++ b/sys-apps/gnome-disk-utility/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>gnome</herd>
+<use>
+ <flag name='fat'>Include FAT16/FAT32 support
+ (<pkg>sys-fs/dosfstools</pkg>)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/gpet/Manifest b/sys-apps/gpet/Manifest
new file mode 100644
index 000000000000..b2cd49d4d077
--- /dev/null
+++ b/sys-apps/gpet/Manifest
@@ -0,0 +1 @@
+DIST gpet-0.4.tar.bz2 352653 SHA256 ff5c20718624b948062bef77f5083eddef2a7ef7ca66e09a8b003dfa3e9f632d SHA512 e373d57ab67d71fb750ee9af93893d036ff26f764f317328117745a4440c0559c2356866c09acfe579473e950e003744ae0a308df3b284d46097dcfe967c122e WHIRLPOOL db3d834460a06520275c0d5fdc005227e940277b8a0126eae38e483245688dd821370b63d995b131a46a1f43c88138de3d6ebe6a8cf3c5e46d7a3edca51bc358
diff --git a/sys-apps/gpet/gpet-0.4.ebuild b/sys-apps/gpet/gpet-0.4.ebuild
new file mode 100644
index 000000000000..41ab10a9f17a
--- /dev/null
+++ b/sys-apps/gpet/gpet-0.4.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="GTK+ based TOMOYO policy editor"
+HOMEPAGE="http://en.sourceforge.jp/projects/gpet/"
+SRC_URI="mirror://sourceforge.jp/gpet/53178/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="gnome-base/gconf
+ sys-devel/gettext
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/pango"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ virtual/pkgconfig"
diff --git a/sys-apps/gpet/metadata.xml b/sys-apps/gpet/metadata.xml
new file mode 100644
index 000000000000..72088e816671
--- /dev/null
+++ b/sys-apps/gpet/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>naota@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge-jp">gpet</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/gptfdisk/Manifest b/sys-apps/gptfdisk/Manifest
new file mode 100644
index 000000000000..f6f139879dad
--- /dev/null
+++ b/sys-apps/gptfdisk/Manifest
@@ -0,0 +1,2 @@
+DIST gptfdisk-0.8.10.tar.gz 190666 SHA256 73e64151203ae0c347c488358e71ca582bb7fb7f0d66df86b71c42050390eb9b SHA512 3187bc231c3390a86f5b7b32270d5f0d1e6c7bccd9d1cbf100c29f4822afa73362aa1fbdd3b29f20c42d67ec51bd777b7b58b5791e31182b3860915bc695948f WHIRLPOOL f90b95f9f0cfba1b57b7dcfd2e39e475f322fa9ea2a85891ea70877e518bbed96dec8d4f61a8eeae3dbd2d36d276ce4bd2c2781eaa5135058cf544629f4cddbc
+DIST gptfdisk-1.0.0.tar.gz 193521 SHA256 5b66956743a799fc0471cdb032665c1391e82f9c5b3f1d7d726d29fe2ba01d6c SHA512 d60660563268c20737415e1cfd4239fba0cc2ceb4c6ae86cc34e9550d969f9b88ac3d8c862d1790f6d644266b423eeb5d78540eec01a447b722793fba54f6afc WHIRLPOOL d7fbec9fd92eb0a871510f2c25d0057577f73668b68336148af86d549522845dda79423e8ddf306d2128153436467f618decb9b65a19a6bf6e89ce5187c67676
diff --git a/sys-apps/gptfdisk/gptfdisk-0.8.10.ebuild b/sys-apps/gptfdisk/gptfdisk-0.8.10.ebuild
new file mode 100644
index 000000000000..ef98452440a9
--- /dev/null
+++ b/sys-apps/gptfdisk/gptfdisk-0.8.10.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 flag-o-matic toolchain-funcs
+
+DESCRIPTION="GPT partition table manipulator for Linux"
+HOMEPAGE="http://www.rodsbooks.com/gdisk/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="kernel_linux ncurses static"
+
+LIB_DEPEND="dev-libs/popt[static-libs(+)]
+ ncurses? ( >=sys-libs/ncurses-5.7-r7[static-libs(+)] )
+ kernel_linux? ( sys-apps/util-linux[static-libs(+)] )" # libuuid
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ virtual/pkgconfig"
+
+src_prepare() {
+ tc-export CXX PKG_CONFIG
+
+ if ! use ncurses; then
+ sed -i \
+ -e '/^all:/s:cgdisk::' \
+ Makefile || die
+ fi
+
+ sed \
+ -e '/g++/s:=:?=:g' \
+ -e 's:-lncursesw:$(shell $(PKG_CONFIG) --libs ncursesw):g' \
+ -i Makefile || die
+
+ use static && append-ldflags -static
+}
+
+src_install() {
+ dosbin gdisk sgdisk $(usex ncurses cgdisk '') fixparts
+ doman *.8
+ dodoc NEWS README
+}
diff --git a/sys-apps/gptfdisk/gptfdisk-1.0.0.ebuild b/sys-apps/gptfdisk/gptfdisk-1.0.0.ebuild
new file mode 100644
index 000000000000..f96d989e8ea5
--- /dev/null
+++ b/sys-apps/gptfdisk/gptfdisk-1.0.0.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 flag-o-matic toolchain-funcs
+
+DESCRIPTION="GPT partition table manipulator for Linux"
+HOMEPAGE="http://www.rodsbooks.com/gdisk/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="kernel_linux ncurses static"
+
+LIB_DEPEND="dev-libs/popt[static-libs(+)]
+ ncurses? ( >=sys-libs/ncurses-5.7-r7[static-libs(+)] )
+ kernel_linux? ( sys-apps/util-linux[static-libs(+)] )" # libuuid
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ virtual/pkgconfig"
+
+src_prepare() {
+ tc-export CXX PKG_CONFIG
+
+ if ! use ncurses; then
+ sed -i \
+ -e '/^all:/s:cgdisk::' \
+ Makefile || die
+ fi
+
+ sed \
+ -e '/g++/s:=:?=:g' \
+ -e 's:-lncursesw:$(shell $(PKG_CONFIG) --libs ncursesw):g' \
+ -i Makefile || die
+
+ use static && append-ldflags -static
+}
+
+src_install() {
+ dosbin gdisk sgdisk $(usex ncurses cgdisk '') fixparts
+ doman *.8
+ dodoc NEWS README
+}
diff --git a/sys-apps/gptfdisk/metadata.xml b/sys-apps/gptfdisk/metadata.xml
new file mode 100644
index 000000000000..4beceb120b3d
--- /dev/null
+++ b/sys-apps/gptfdisk/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>alexxy@gentoo.org</email>
+ <name>Alexey Shvetsov</name>
+ </maintainer>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gptfdisk</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/gradm/Manifest b/sys-apps/gradm/Manifest
new file mode 100644
index 000000000000..6917fce6e546
--- /dev/null
+++ b/sys-apps/gradm/Manifest
@@ -0,0 +1,3 @@
+DIST gradm-3.1-201506081912.tar.gz 91410 SHA256 436e91a390579b6f96124bb69b2dd3411d8e55267e5208a0479796c6ad51abcc SHA512 99f0bc391e0a5a3f03ab8f72650e8248d66ce36cefe1662c3d960120a6dc61b900f0874f82ec742e33c32de36dfb12642f965fce530e640e7f3a171d60e4ed78 WHIRLPOOL 77966fa7be791d4dc305405e07e2b1d8aa57c51439f1e638ea945400150ff16f45bd2212a1e961b569e62826b7cf3690b4aa1833444019065e2c3a22a10b5734
+DIST gradm-3.1-201507041117.tar.gz 91468 SHA256 098e1978731d456c8c1db696fa0b67d6f1310a87a996083a1b627671b4e0c1f5 SHA512 507d97477a1b28a0097467aba3085759c606a7ef1fd3b91d09cd7ffb9523408276d4fe504c4bb9b036c0ee6066e3edef9ebe0fb17b2d7e1156937fb6ca813daf WHIRLPOOL 392976e30a5e2ed765ab6ba09c8d03935cb6bc0f18519fc7764fc127bf2fe2ba2aa88d5a026e7d1a46d0406af1af60e9045a2ffa677d94fa4e8bd004fbb5ef5a
+DIST gradm-3.1-201507191652.tar.gz 91460 SHA256 2f14c357bf0459e502a4e108b76c3f6240aa484762d07bb1687796b9b9297a50 SHA512 94b655164369d3ae061ae74710db1098e743a435eecdee9faef77b39aa3fe58f552b4479e55c9546b3c25dea194dc490d9442fc404318628c77d1ecd05d6243e WHIRLPOOL 22041c8424bacccdb53eef953b2419a84b24318caac91e137c59b3b88a5ef57d32dfe31dcf8ddb0c36e35b935db0526b9778ac0650d6dfdf612a469ccdc17f78
diff --git a/sys-apps/gradm/files/respect-gentoo-env-r2.patch b/sys-apps/gradm/files/respect-gentoo-env-r2.patch
new file mode 100644
index 000000000000..65d242e48e9e
--- /dev/null
+++ b/sys-apps/gradm/files/respect-gentoo-env-r2.patch
@@ -0,0 +1,42 @@
+diff -Naur gradm2.orig/Makefile gradm2/Makefile
+--- gradm2.orig/Makefile 2013-08-09 16:28:37.000000000 -0400
++++ gradm2/Makefile 2013-08-10 07:57:12.000000000 -0400
+@@ -18,18 +18,18 @@
+ BISON=/usr/bin/bison
+ #YACC := $(shell if [ -x $(BYACC) ]; then echo $(BYACC); else echo $(BISON); fi)
+ YACC=$(BISON)
+-MKNOD=/bin/mknod
++MKNOD=true
+ #for dietlibc
+ #CC=/usr/bin/diet /usr/bin/gcc
+ CC=/usr/bin/gcc
+ FIND=/usr/bin/find
+-STRIP=/usr/bin/strip
++STRIP=true
+ LIBS := $(shell if [ "`uname -m`" != "sparc64" -a "`uname -m`" != "x86_64" ]; then echo "-lfl" ; else echo "" ; fi)
+ OPT_FLAGS := -O2
+ # for older versions of grsecurity, comment the above line and uncomment the below:
+ #OPT_FLAGS := $(shell if [ "`uname -m`" != "sparc64" ] && [ "`uname -m`" != "x86_64" ]; then echo "-O2" ; else echo "-O2 -m64" ; fi)
+-CFLAGS := $(OPT_FLAGS) -Wcast-qual -DGRSEC_DIR=\"$(GRSEC_DIR)\" -D_LARGEFILE64_SOURCE
+-LDFLAGS=
++CFLAGS := $(OPT_FLAGS) -Wcast-qual -DGRSEC_DIR=\"$(GRSEC_DIR)\" -D_LARGEFILE64_SOURCE $(CFLAGS)
++LDFLAGS+=
+ INSTALL = /usr/bin/install -c
+
+ # FHS
+@@ -167,10 +167,11 @@
+ $(MKNOD) -m 0622 $(DESTDIR)/dev/grsec c 1 13 ; \
+ fi \
+ fi
+- @if [ -d $(DESTDIR)/etc/udev/rules.d ] ; then \
+- echo "ACTION!=\"add|change\", GOTO=\"permissions_end\"" > $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
+- echo "KERNEL==\"grsec\", MODE=\"0622\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
+- echo "LABEL=\"permissions_end\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
++ @mkdir -p $(DESTDIR)/lib/udev/rules.d
++ @if [ -d $(DESTDIR)/lib/udev/rules.d ] ; then \
++ echo "ACTION!=\"add|change\", GOTO=\"permissions_end\"" > $(DESTDIR)/lib/udev/rules.d/80-grsec.rules ; \
++ echo "KERNEL==\"grsec\", MODE=\"0622\"" >> $(DESTDIR)/lib/udev/rules.d/80-grsec.rules ; \
++ echo "LABEL=\"permissions_end\"" >> $(DESTDIR)/lib/udev/rules.d/80-grsec.rules ; \
+ fi
+ @if [ -f $(DESTDIR)/sbin/udevadm ] ; then \
+ $(DESTDIR)/sbin/udevadm trigger --action=change ; \
diff --git a/sys-apps/gradm/files/respect-gentoo-env-r3.patch b/sys-apps/gradm/files/respect-gentoo-env-r3.patch
new file mode 100644
index 000000000000..7c899b139745
--- /dev/null
+++ b/sys-apps/gradm/files/respect-gentoo-env-r3.patch
@@ -0,0 +1,42 @@
+diff -Naur gradm2.orig/Makefile gradm2/Makefile
+--- gradm2.orig/Makefile 2013-08-09 16:28:37.000000000 -0400
++++ gradm2/Makefile 2013-08-10 07:57:12.000000000 -0400
+@@ -18,18 +18,18 @@
+ BISON=/usr/bin/bison
+ #YACC := $(shell if [ -x $(BYACC) ]; then echo $(BYACC); else echo $(BISON); fi)
+ YACC=$(BISON)
+-MKNOD=/bin/mknod
++MKNOD=true
+ #for dietlibc
+ #CC=/usr/bin/diet /usr/bin/gcc
+ CC=/usr/bin/gcc
+ FIND=/usr/bin/find
+-STRIP=/usr/bin/strip
++STRIP=true
+ LIBS := $(shell if [ "`uname -m`" != "sparc64" -a "`uname -m`" != "x86_64" ]; then echo "-lfl" ; else echo "" ; fi)
+ OPT_FLAGS := -O2
+ # for older versions of grsecurity, comment the above line and uncomment the below:
+ #OPT_FLAGS := $(shell if [ "`uname -m`" != "sparc64" ] && [ "`uname -m`" != "x86_64" ]; then echo "-O2" ; else echo "-O2 -m64" ; fi)
+-CFLAGS := $(OPT_FLAGS) -fPIE -Wcast-qual -DGRSEC_DIR=\"$(GRSEC_DIR)\" -D_LARGEFILE64_SOURCE
+-LDFLAGS= -pie
++CFLAGS := $(OPT_FLAGS) -fPIE -Wcast-qual -DGRSEC_DIR=\"$(GRSEC_DIR)\" -D_LARGEFILE64_SOURCE $(CFLAGS)
++LDFLAGS+= -pie
+ INSTALL = /usr/bin/install -c
+
+ # FHS
+@@ -167,10 +167,11 @@
+ $(MKNOD) -m 0622 $(DESTDIR)/dev/grsec c 1 13 ; \
+ fi \
+ fi
+- @if [ -d $(DESTDIR)/etc/udev/rules.d ] ; then \
+- echo "ACTION!=\"add|change\", GOTO=\"permissions_end\"" > $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
+- echo "KERNEL==\"grsec\", MODE=\"0622\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
+- echo "LABEL=\"permissions_end\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \
++ @mkdir -p $(DESTDIR)/lib/udev/rules.d
++ @if [ -d $(DESTDIR)/lib/udev/rules.d ] ; then \
++ echo "ACTION!=\"add|change\", GOTO=\"permissions_end\"" > $(DESTDIR)/lib/udev/rules.d/80-grsec.rules ; \
++ echo "KERNEL==\"grsec\", MODE=\"0622\"" >> $(DESTDIR)/lib/udev/rules.d/80-grsec.rules ; \
++ echo "LABEL=\"permissions_end\"" >> $(DESTDIR)/lib/udev/rules.d/80-grsec.rules ; \
+ fi
+ @if [ -f $(DESTDIR)/sbin/udevadm ] ; then \
+ $(DESTDIR)/sbin/udevadm trigger --action=change ; \
diff --git a/sys-apps/gradm/gradm-3.1.201506081912.ebuild b/sys-apps/gradm/gradm-3.1.201506081912.ebuild
new file mode 100644
index 000000000000..15c8a9987271
--- /dev/null
+++ b/sys-apps/gradm/gradm-3.1.201506081912.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit flag-o-matic toolchain-funcs versionator eutils udev
+
+MY_PV="$(replace_version_separator 2 -)"
+
+DESCRIPTION="Administrative interface for the grsecurity Role Based Access Control system"
+HOMEPAGE="http://www.grsecurity.net/"
+SRC_URI="http://dev.gentoo.org/~blueness/hardened-sources/gradm/${PN}-${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86"
+IUSE="pam"
+
+RDEPEND=""
+DEPEND="
+ sys-devel/bison
+ sys-devel/flex
+ pam? ( virtual/pam )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/respect-gentoo-env-r3.patch
+ sed -i -e "s:/lib/udev:$(get_udevdir):" Makefile || die
+}
+
+src_compile() {
+ local target
+ use pam || target="nopam"
+
+ emake ${target} CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ fperms 711 /sbin/gradm
+}
+
+pkg_postinst() {
+ ewarn
+ ewarn "Be sure to set a password with 'gradm -P' before enabling learning mode."
+ ewarn
+}
diff --git a/sys-apps/gradm/gradm-3.1.201507041117.ebuild b/sys-apps/gradm/gradm-3.1.201507041117.ebuild
new file mode 100644
index 000000000000..15c8a9987271
--- /dev/null
+++ b/sys-apps/gradm/gradm-3.1.201507041117.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit flag-o-matic toolchain-funcs versionator eutils udev
+
+MY_PV="$(replace_version_separator 2 -)"
+
+DESCRIPTION="Administrative interface for the grsecurity Role Based Access Control system"
+HOMEPAGE="http://www.grsecurity.net/"
+SRC_URI="http://dev.gentoo.org/~blueness/hardened-sources/gradm/${PN}-${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86"
+IUSE="pam"
+
+RDEPEND=""
+DEPEND="
+ sys-devel/bison
+ sys-devel/flex
+ pam? ( virtual/pam )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/respect-gentoo-env-r3.patch
+ sed -i -e "s:/lib/udev:$(get_udevdir):" Makefile || die
+}
+
+src_compile() {
+ local target
+ use pam || target="nopam"
+
+ emake ${target} CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ fperms 711 /sbin/gradm
+}
+
+pkg_postinst() {
+ ewarn
+ ewarn "Be sure to set a password with 'gradm -P' before enabling learning mode."
+ ewarn
+}
diff --git a/sys-apps/gradm/gradm-3.1.201507191652.ebuild b/sys-apps/gradm/gradm-3.1.201507191652.ebuild
new file mode 100644
index 000000000000..51923e3ff1e6
--- /dev/null
+++ b/sys-apps/gradm/gradm-3.1.201507191652.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit flag-o-matic toolchain-funcs versionator eutils udev
+
+MY_PV="$(replace_version_separator 2 -)"
+
+DESCRIPTION="Administrative interface for the grsecurity Role Based Access Control system"
+HOMEPAGE="http://www.grsecurity.net/"
+SRC_URI="http://dev.gentoo.org/~blueness/hardened-sources/gradm/${PN}-${MY_PV}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="pam"
+
+RDEPEND=""
+DEPEND="
+ sys-devel/bison
+ sys-devel/flex
+ pam? ( virtual/pam )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/respect-gentoo-env-r3.patch
+ sed -i -e "s:/lib/udev:$(get_udevdir):" Makefile || die
+}
+
+src_compile() {
+ local target
+ use pam || target="nopam"
+
+ emake ${target} CC="$(tc-getCC)" OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ fperms 711 /sbin/gradm
+}
+
+pkg_postinst() {
+ ewarn
+ ewarn "Be sure to set a password with 'gradm -P' before enabling learning mode."
+ ewarn
+}
diff --git a/sys-apps/gradm/metadata.xml b/sys-apps/gradm/metadata.xml
new file mode 100644
index 000000000000..e217c3733475
--- /dev/null
+++ b/sys-apps/gradm/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>hardened</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/grep/Manifest b/sys-apps/grep/Manifest
new file mode 100644
index 000000000000..9bd956abcea4
--- /dev/null
+++ b/sys-apps/grep/Manifest
@@ -0,0 +1,2 @@
+DIST grep-2.21-heap_buffer_overrun.patch 3302 SHA256 4bc7e744fd34b268a798daf6a5aa85f55c141747149fa7b015eefbf9318ed478 SHA512 eaea33238f179b17dd152ed27a07c211646d9572be250eb7997c25ea0c8de232d21d8bc1b1e865b26545e6817e5c116e18d9115fb497d39426ac8212839f0f82 WHIRLPOOL 5ead7c22c8fe98289322a03685e9fc04e834a01144c55c9ea3b1970fa61b400ce669e6947cb3564fbbba5c7ddf079fd30e66352e4f6eed888e8fe883e369e601
+DIST grep-2.21.tar.xz 1261548 SHA256 5244a11c00dee8e7e5e714b9aaa053ac6cbfa27e104abee20d3c778e4bb0e5de SHA512 bc894325f89d37413c773d4812cb24180560037ccc8d72c015462043ef3479ea7eefd62557e3a9d191d6d94c68262563d3c68e634acd4e77ba56e96c92805dfd WHIRLPOOL 2272286c10695a51eecafcc5ca8986adb5486d4494b284904f588717c6fb06de37933faa5f62eabf0ecc856334b3a1179b864dedc06f223047471168d2d86bb0
diff --git a/sys-apps/grep/grep-2.21-r1.ebuild b/sys-apps/grep/grep-2.21-r1.ebuild
new file mode 100644
index 000000000000..194baac7d3d5
--- /dev/null
+++ b/sys-apps/grep/grep-2.21-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="GNU regular expression matcher"
+HOMEPAGE="http://www.gnu.org/software/grep/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~polynomial-c/${P}-heap_buffer_overrun.patch"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls pcre static"
+
+LIB_DEPEND="pcre? ( >=dev-libs/libpcre-7.8-r1[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ nls? ( virtual/libintl )
+ virtual/libiconv"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ static? ( ${LIB_DEPEND} )"
+
+DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
+
+src_prepare() {
+ # Disable gnulib build test that has no impact on the source.
+ # Re-enable w/next version bump (and gnulib is updated). #554728
+ [[ ${PV} != "2.21" ]] && die "re-enable test #554728"
+ echo 'exit 0' > gnulib-tests/test-update-copyright.sh || die
+
+ sed -i \
+ -e "s:@SHELL@:${EPREFIX}/bin/sh:g" \
+ src/egrep.sh || die #523898
+
+ epatch "${DISTDIR}/${P}-heap_buffer_overrun.patch"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ # Always use pkg-config to get lib info for pcre.
+ export ac_cv_search_pcre_compile=$(
+ usex pcre "$($(tc-getPKG_CONFIG) --libs $(usex static --static '') libpcre)" ''
+ )
+ econf \
+ --bindir="${EPREFIX}"/bin \
+ $(use_enable nls) \
+ $(use_enable pcre perl-regexp)
+}
diff --git a/sys-apps/grep/metadata.xml b/sys-apps/grep/metadata.xml
new file mode 100644
index 000000000000..c9e284040953
--- /dev/null
+++ b/sys-apps/grep/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="cpe">cpe:/a:gnu:grep</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-apps/groff/Manifest b/sys-apps/groff/Manifest
new file mode 100644
index 000000000000..05932d310e8d
--- /dev/null
+++ b/sys-apps/groff/Manifest
@@ -0,0 +1,3 @@
+DIST groff-1.22.1-japanese.patch.bz2 52968 SHA256 cbdfdd7981f4e4e99839218bb4a6bc1b981cc23e946b6959fef15644d29c9f47 SHA512 883d15dd2f1420a067d35737c45431f33f05bbe3c7e7edab0e119416117b5d096972d71452eae94bfd3df23aa7d6595fc6e65208bd4fba86815162bdf9af8bef WHIRLPOOL e59bee5ddd2136e98b1881e695915e9da91db17fba68fc8508e2bd477a462499f2dfa6f569729a56620301b97e532a8585f9eacdc92ac92cdb87316b4c7687a0
+DIST groff-1.22.2.tar.gz 4019913 SHA256 380864dac4772e0c0d7b1282d25d0c5fd7f63baf45c87c4657afed22a13d2076 SHA512 ea34db53f075b6816827b07ac3d6a19ed50529c939044337eb3124575ac3b41363e1d81bbd5bf552a7a10f6b1dd233d6e7acaf646e18cfe94464c59dc20ffe80 WHIRLPOOL 61f24635140f388672761822c696fb051fc26050da6d7d771a73af112f477cd65d934129786794cd39bc3dcb69a88c8dcb7e4739b980a73d68ec518f54aed861
+DIST groff-1.22.3.tar.gz 4188772 SHA256 3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5 SHA512 c526ab203d13a9c9d110bcd3149fe50d1cd0d309437e9e2731a7ce90d890507ebc0a2331899ecf4dba2938daa756b6094cf76fd347a0ded59797c70ccfd0c95c WHIRLPOOL 671b8f9641d5969d995616b7e7aaa5928cab9658b3017e1d87c39c507e32724350ab81f73475fc159bae0f305d106d944e490f1d7b53b8715a5367dc11140fdb
diff --git a/sys-apps/groff/files/groff-1.19.2-man-unicode-dashes.patch b/sys-apps/groff/files/groff-1.19.2-man-unicode-dashes.patch
new file mode 100644
index 000000000000..d85a8330d274
--- /dev/null
+++ b/sys-apps/groff/files/groff-1.19.2-man-unicode-dashes.patch
@@ -0,0 +1,24 @@
+format dashes as dashes so as to not confuse people
+
+http://bugs.gentoo.org/16108
+http://bugs.gentoo.org/17580
+http://bugs.gentoo.org/121502
+
+--- tmac/man.local
++++ tmac/man.local
+@@ -1,2 +1,6 @@
+ .\" This file is loaded after an-old.tmac.
+ .\" Put any local modifications to an-old.tmac here.
++.if '\*[.T]'utf8' \{\
++. char \- \N'45'
++. char - \N'45'
++.\}
+--- tmac/mdoc.local
++++ tmac/mdoc.local
+@@ -1,2 +1,6 @@
+ .\" This file is loaded after doc.tmac.
+ .\" Put any local modifications to doc.tmac here.
++.if '\*[.T]'utf8' \{\
++. char \- \N'45'
++. char - \N'45'
++.\}
diff --git a/sys-apps/groff/files/groff-1.22.2-parallel-mom.patch b/sys-apps/groff/files/groff-1.22.2-parallel-mom.patch
new file mode 100644
index 000000000000..7cf3c22295d5
--- /dev/null
+++ b/sys-apps/groff/files/groff-1.22.2-parallel-mom.patch
@@ -0,0 +1,96 @@
+From 9f3af719383ab525c86ee0f514e268ef8494330a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 6 Dec 2013 20:40:10 -0500
+Subject: [PATCH] fix parallel build w/gropdf and mom examples
+
+The contrib/mom/examples/ directory uses the helper script from
+src/devices/gropdf/. Currently though, parallel builds might fail
+like so:
+
+...
+make[2]: Entering directory `.../groff-1.22.2/contrib/mom'
+GROFF_COMMAND_PREFIX= GROFF_BIN_PATH="`echo .../groff-1.22.2/src/roff/groff .../groff-1.22.2/src/roff/troff .../groff-1.22.2/src/devices/grops .../groff-1.22.2/src/devices/gropdf | sed -e 's| *|:|g'`" PDFMOM_BIN_PATH=".../groff-1.22.2/src/devices/gropdf" .../groff-1.22.2/src/devices/gropdf/pdfmom -F.../groff-1.22.2/font -F.../groff-1.22.2/font -M.../groff-1.22.2/tmac -M.../groff-1.22.2/tmac -M. examples/letter.mom >examples/letter.pdf
+GROFF_COMMAND_PREFIX= GROFF_BIN_PATH="`echo .../groff-1.22.2/src/roff/groff .../groff-1.22.2/src/roff/troff .../groff-1.22.2/src/devices/grops .../groff-1.22.2/src/devices/gropdf | sed -e 's| *|:|g'`" PDFMOM_BIN_PATH=".../groff-1.22.2/src/devices/gropdf" .../groff-1.22.2/src/devices/gropdf/pdfmom -F.../groff-1.22.2/font -F.../groff-1.22.2/font -M.../groff-1.22.2/tmac -M.../groff-1.22.2/tmac -M. examples/mom-pdf.mom >examples/mom-pdf.pdf
+/bin/sh: .../groff-1.22.2/src/devices/gropdf/pdfmom: No such file or directory
+make[2]: *** [examples/letter.pdf] Error 127
+/bin/sh: .../groff-1.22.2/src/devices/gropdf/pdfmom: No such file or directory
+make[2]: *** [examples/mom-pdf.pdf] Error 127
+make[2]: Leaving directory `.../groff-1.22.2/contrib/mom'
+make[1]: *** [contrib/mom] Error 2
+...
+make[2]: Entering directory `.../groff-1.22.2/src/devices/gropdf'
+sed -f .../groff-1.22.2/arch/misc/shdeps.sed \
+ -e "s|@VERSION@|1.22.2|" \
+ -e "s|@PERLPATH@|/usr/bin/perl|" ./pdfmom.pl >pdfmom
+
+The top level makefile tries to account for this in general with OTHERDIRS,
+but looks like src/devices/gropdf/ was added to this variable (which holds
+contrib/mom/ too) because gropdf installs a shell script, and the other
+prog vars require it to be a dir of things to compile.
+
+Declare a new prog var for holding shell scripts.
+
+URL: http://crbug.com/324116
+URL: https://bugs.gentoo.org/487276
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+2013-12-06 Mike Frysinger <vapier@gentoo.org>
+
+ * Makefile.in (SHPROGDIRS): Declare.
+ (PROGDIRS): Add $(SHPROGDIRS).
+ (OTHERDIRS): Delete src/devices/gropdf.
+ ($(SHPROGDIRS):): Add to existing rule.
+ ($(OTHERDIRS):): Depend on $(SHPROGDIRS).
+---
+ Makefile.in | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index a794de7..8e478af 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -602,12 +602,15 @@ CCPROGDIRS=\
+ src/utils/addftinfo
+ CPROGDIRS=\
+ src/utils/pfbtops
++SHPROGDIRS=\
++ src/devices/gropdf
+ PROGDEPDIRS=\
+ arch/misc
+ PROGDIRS=\
+ $(PROGDEPDIRS) \
+ $(CCPROGDIRS) \
+ $(CPROGDIRS) \
++ $(SHPROGDIRS) \
+ $(XPROGDIRS)
+ DEVDIRS=\
+ font/devps \
+@@ -637,7 +640,6 @@ OTHERDIRS=\
+ contrib/glilypond \
+ contrib/hdtbl \
+ contrib/pdfmark \
+- src/devices/gropdf \
+ font/devpdf \
+ contrib/mom \
+ contrib/gdiffmk
+@@ -778,7 +780,7 @@ $(CCPROGDIRS): FORCE $(LIBDIRS)
+ -f $(top_srcdir)/Makefile.ccpg \
+ -f Makefile.dep $(do)
+
+-$(DEVDIRS) $(XDEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS): FORCE $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS)
++$(DEVDIRS) $(XDEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS) $(SHPROGDIRS): FORCE $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS)
+ @$(ENVSETUP); \
+ if test $(srcdir) = .; then \
+ srcdir=.; \
+@@ -809,7 +811,7 @@ $(GNULIBDIRS): FORCE
+ $(MAKE) ACLOCAL=: AUTOCONF=: AUTOHEADER=: AUTOMAKE=: $(do) ;; \
+ esac
+
+-$(OTHERDIRS): $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS)
++$(OTHERDIRS): $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS) $(SHPROGDIRS)
+
+ $(INCDIRS) $(PROGDEPDIRS) $(OTHERDIRS): FORCE
+ @$(ENVSETUP); \
+--
+1.8.4.3
+
diff --git a/sys-apps/groff/files/groff-1.22.3-parallel-mom.patch b/sys-apps/groff/files/groff-1.22.3-parallel-mom.patch
new file mode 100644
index 000000000000..10661ac27f2c
--- /dev/null
+++ b/sys-apps/groff/files/groff-1.22.3-parallel-mom.patch
@@ -0,0 +1,11 @@
+--- groff-1.22.3/Makefile.in
++++ groff-1.22.3/Makefile.in
+@@ -864,7 +864,7 @@
+ -f $(top_srcdir)/Makefile.ccpg \
+ -f Makefile.dep $(do)
+
+-$(DEVDIRS) $(XDEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS): FORCE \
++$(DEVDIRS) $(XDEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS) $(SHPROGDIRS): FORCE \
+ $(PROGDEPDIRS) $(CCPROGDIRS) $(CPROGDIRS)
+ @$(ENVSETUP); \
+ if test $(srcdir) = .; then \
diff --git a/sys-apps/groff/groff-1.22.2.ebuild b/sys-apps/groff/groff-1.22.2.ebuild
new file mode 100644
index 000000000000..b35c761cca5b
--- /dev/null
+++ b/sys-apps/groff/groff-1.22.2.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="Text formatter used for man pages"
+HOMEPAGE="http://www.gnu.org/software/groff/groff.html"
+SRC_URI="mirror://gnu/groff/${P}.tar.gz
+ linguas_ja? ( http://dev.gentoo.org/~naota/patch/${PN}-1.22.1-japanese.patch.bz2 )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples X linguas_ja"
+
+RDEPEND=">=sys-apps/texinfo-4.7-r1
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXmu
+ x11-libs/libXaw
+ x11-libs/libSM
+ x11-libs/libICE
+ )"
+DEPEND="${RDEPEND}
+ linguas_ja? ( virtual/yacc )"
+
+DOCS=( BUG-REPORT ChangeLog MORE.STUFF NEWS PROBLEMS PROJECTS README REVISION TODO VERSION )
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502
+ epatch "${FILESDIR}"/${PN}-1.22.2-parallel-mom.patch #487276
+
+ # Make sure we can cross-compile this puppy
+ if tc-is-cross-compiler ; then
+ sed -i \
+ -e '/^GROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/groff:' \
+ -e '/^TROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/troff:' \
+ -e '/^GROFF_BIN_PATH=/s:=.*:=:' \
+ -e '/^GROFF_BIN_DIR=/s:=.*:=:' \
+ contrib/*/Makefile.sub \
+ doc/Makefile.in \
+ doc/Makefile.sub || die "cross-compile sed failed"
+ fi
+
+ local pfx=$(usex prefix ' Prefix' '')
+ cat <<-EOF >> tmac/mdoc.local
+ .ds volume-operating-system Gentoo${pfx}
+ .ds operating-system Gentoo${pfx}/${KERNEL}
+ .ds default-operating-system Gentoo${pfx}/${KERNEL}
+ EOF
+
+ if use linguas_ja ; then
+ epatch "${WORKDIR}"/${PN}-1.22.1-japanese.patch #255292 #350534 #450796
+ eautoconf
+ eautoheader
+ fi
+
+ # make sure we don't get a crappy `g' nameprefix on UNIX systems with real
+ # troff (GROFF_G macro runs some test to see, its own troff doesn't satisfy)
+ sed -i -e 's/^[ \t]\+g=g$/g=/' configure || die
+}
+
+src_configure() {
+ econf \
+ --with-appresdir="${EPREFIX}"/usr/share/X11/app-defaults \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_with X x) \
+ $(usex linguas_ja '--enable-japanese' '')
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
+
+src_install() {
+ default
+
+ # The following links are required for man #123674
+ dosym eqn /usr/bin/geqn
+ dosym tbl /usr/bin/gtbl
+
+ if ! use examples ; then
+ rm -rf "${ED}"/usr/share/doc/${PF}/examples
+ rm -f "${ED}"/usr/share/doc/${PF}/pdf/mom-pdf.pdf
+ fi
+}
diff --git a/sys-apps/groff/groff-1.22.3.ebuild b/sys-apps/groff/groff-1.22.3.ebuild
new file mode 100644
index 000000000000..752dbe7f1e12
--- /dev/null
+++ b/sys-apps/groff/groff-1.22.3.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 toolchain-funcs
+
+DESCRIPTION="Text formatter used for man pages"
+HOMEPAGE="http://www.gnu.org/software/groff/groff.html"
+SRC_URI="mirror://gnu/groff/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples X"
+
+RDEPEND=">=sys-apps/texinfo-4.7-r1
+ X? (
+ x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXmu
+ x11-libs/libXaw
+ x11-libs/libSM
+ x11-libs/libICE
+ )"
+DEPEND="${RDEPEND}"
+
+DOCS=( BUG-REPORT ChangeLog MORE.STUFF NEWS PROBLEMS PROJECTS README REVISION TODO VERSION )
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.19.2-man-unicode-dashes.patch #16108 #17580 #121502
+ epatch "${FILESDIR}"/${PN}-1.22.3-parallel-mom.patch #487276
+
+ # Make sure we can cross-compile this puppy
+ if tc-is-cross-compiler ; then
+ sed -i \
+ -e '/^GROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/groff:' \
+ -e '/^TROFFBIN=/s:=.*:=${EPREFIX}/usr/bin/troff:' \
+ -e '/^GROFF_BIN_PATH=/s:=.*:=:' \
+ -e '/^GROFF_BIN_DIR=/s:=.*:=:' \
+ contrib/*/Makefile.sub \
+ doc/Makefile.in \
+ doc/Makefile.sub || die "cross-compile sed failed"
+ fi
+
+ local pfx=$(usex prefix ' Prefix' '')
+ cat <<-EOF >> tmac/mdoc.local
+ .ds volume-operating-system Gentoo${pfx}
+ .ds operating-system Gentoo${pfx}/${KERNEL}
+ .ds default-operating-system Gentoo${pfx}/${KERNEL}
+ EOF
+
+ # make sure we don't get a crappy `g' nameprefix on UNIX systems with real
+ # troff (GROFF_G macro runs some test to see, its own troff doesn't satisfy)
+ sed -i -e 's/^[ \t]\+g=g$/g=/' configure || die
+}
+
+src_configure() {
+ econf \
+ --with-appresdir="${EPREFIX}"/usr/share/X11/app-defaults \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_with X x)
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
+
+src_install() {
+ default
+
+ # The following links are required for man #123674
+ dosym eqn /usr/bin/geqn
+ dosym tbl /usr/bin/gtbl
+
+ use examples || rm -rf "${ED}"/usr/share/doc/${PF}/examples
+}
diff --git a/sys-apps/groff/metadata.xml b/sys-apps/groff/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/groff/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-apps/gscanbus/Manifest b/sys-apps/gscanbus/Manifest
new file mode 100644
index 000000000000..975c5ae1e911
--- /dev/null
+++ b/sys-apps/gscanbus/Manifest
@@ -0,0 +1 @@
+DIST gscanbus-0.8.tar.gz 215739 SHA256 5fd7c9e4b52a91cf3714ed284bf1fbf95ce45efe0413fce78649335f24278135
diff --git a/sys-apps/gscanbus/gscanbus-0.8.ebuild b/sys-apps/gscanbus/gscanbus-0.8.ebuild
new file mode 100644
index 000000000000..a22c52fa23c7
--- /dev/null
+++ b/sys-apps/gscanbus/gscanbus-0.8.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="a little bus scanning, testing, and topology visualizing tool for the Linux IEEE1394 subsystem"
+HOMEPAGE="http://sourceforge.net/projects/gscanbus.berlios/"
+SRC_URI="mirror://sourceforge/${PN}.berlios/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+RDEPEND="sys-libs/libraw1394
+ x11-libs/gtk+:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS README TODO )
diff --git a/sys-apps/gscanbus/metadata.xml b/sys-apps/gscanbus/metadata.xml
new file mode 100644
index 000000000000..e02aded30f16
--- /dev/null
+++ b/sys-apps/gscanbus/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">gscanbus.berlios</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/gsmartcontrol/Manifest b/sys-apps/gsmartcontrol/Manifest
new file mode 100644
index 000000000000..85a7c9d95bb1
--- /dev/null
+++ b/sys-apps/gsmartcontrol/Manifest
@@ -0,0 +1 @@
+DIST gsmartcontrol-0.8.7.tar.bz2 684394 SHA256 708fa803243abb852ed52050fc82cd3592a798c02743342441996e77f19ffec6 SHA512 3258ddcb448460afeef8d617ab5bb4720c9b2444452bc45d6798ec645da4862236fbb3fe0116a1cc904f5353481df87603bd2b6d808f348c250bde3624c8403a WHIRLPOOL 24fb546c7175306c8cdd8906b506471d20668de0cd078a8205ec87eff50ce0eb52dc04b3b05e771f8789ef852e5f97675c7c224ab6450d90a3e2ac3e51578d2a
diff --git a/sys-apps/gsmartcontrol/gsmartcontrol-0.8.7.ebuild b/sys-apps/gsmartcontrol/gsmartcontrol-0.8.7.ebuild
new file mode 100644
index 000000000000..053a68bd3fed
--- /dev/null
+++ b/sys-apps/gsmartcontrol/gsmartcontrol-0.8.7.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit gnome2-utils
+
+DESCRIPTION="Hard disk drive health inspection tool"
+HOMEPAGE="http://gsmartcontrol.sourceforge.net/home/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="|| ( GPL-2 GPL-3 ) Boost-1.0 BSD Unlicense ZLIB"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="test"
+
+COMMON_DEPEND="dev-cpp/gtkmm:2.4
+ dev-libs/libpcre
+ sys-apps/smartmontools"
+RDEPEND="${COMMON_DEPEND}
+ x11-apps/xmessage"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+ test? ( dev-util/gtk-builder-convert )"
+
+DOCS="TODO" # See 'dist_doc_DATA' value in Makefile.am
+
+src_configure() {
+ econf \
+ --docdir=/usr/share/doc/${PF} \
+ $(use test tests)
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/usr/share/doc/${PF}/LICENSE_* || die
+}
+
+pkg_preinst() { gnome2_icon_savelist; }
+pkg_postinst() { gnome2_icon_cache_update; }
+pkg_postrm() { gnome2_icon_cache_update; }
diff --git a/sys-apps/gsmartcontrol/metadata.xml b/sys-apps/gsmartcontrol/metadata.xml
new file mode 100644
index 000000000000..77c4c35f6b24
--- /dev/null
+++ b/sys-apps/gsmartcontrol/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">gsmartcontrol</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/hardened-shadow/Manifest b/sys-apps/hardened-shadow/Manifest
new file mode 100644
index 000000000000..a8cea00a83f3
--- /dev/null
+++ b/sys-apps/hardened-shadow/Manifest
@@ -0,0 +1 @@
+DIST hardened-shadow-0.9.2.tar.gz 393648 SHA256 0561bf7059b3de7e97e968bb71a3ccac3dd944bf96f1d5de87798359e592aa00
diff --git a/sys-apps/hardened-shadow/hardened-shadow-0.9.2.ebuild b/sys-apps/hardened-shadow/hardened-shadow-0.9.2.ebuild
new file mode 100644
index 000000000000..e005e84b1336
--- /dev/null
+++ b/sys-apps/hardened-shadow/hardened-shadow-0.9.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils eutils multilib user
+
+DESCRIPTION="Hardened implementation of user account utilities"
+HOMEPAGE="http://code.google.com/p/hardened-shadow/"
+SRC_URI="http://hardened-shadow.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND="sys-libs/pam
+ !sys-apps/shadow"
+RDEPEND="${DEPEND}
+ >=sys-auth/pambase-20120417"
+
+DOCS=( README )
+
+pkg_setup() {
+ # The hardened-shadow group is needed at src_install time,
+ # so the only place we can create the group is pkg_setup.
+ enewgroup hardened-shadow
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ # Remove pam.d files colliding with pambase.
+ rm -r "${ED}"/etc/pam.d || die
+}
diff --git a/sys-apps/hardened-shadow/metadata.xml b/sys-apps/hardened-shadow/metadata.xml
new file mode 100644
index 000000000000..5dcc2c69c794
--- /dev/null
+++ b/sys-apps/hardened-shadow/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>phajdan.jr@gentoo.org</email>
+ <name>Pawel Hajdan jr</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">hardened-shadow</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/haveged/Manifest b/sys-apps/haveged/Manifest
new file mode 100644
index 000000000000..7bccce58bef0
--- /dev/null
+++ b/sys-apps/haveged/Manifest
@@ -0,0 +1,3 @@
+DIST haveged-1.5.tar.gz 243348 SHA256 f7d5a7e995befd4723811b331854fa53fe558546ba0c1dcb4675698e8db3702f SHA512 57952a79d4535267de15c42511991e2b06021db3b1ea90a45b30c5bd5ac65f6b9b6d66373d981280a3e7c0aff24dd6feae5640394e77f08a893dba5f31d86c91 WHIRLPOOL ef4c5acf8c787e18a436fe34ef2479658f325852e5717ad1a06bf19ecbe485e646a2bb132617417de26982d1d388b90293d3c8c31c0e7a0b0db570be80c5e5a4
+DIST haveged-1.7a.tar.gz 458671 SHA256 8e7b0779bd8a4b9b73769ddaf626918355e2a542d3ac35e5ec31b74a58b9b051 SHA512 e98740315b5c9920ec471587362ffd468d0b0f7183bc002982fbe25dfde2252a89f489e4d7604d7d6d2c14d67f3f0d1044de70ccdeaf587d8bdaacfd55669875 WHIRLPOOL f9f808a17767e33ec4285242ccb2fd41889fbe1ee693bd001d4a08e89bf47131d3f84040b566276522940b2a164aab2062b4c6fca18d0b737406814fc56524a3
+DIST haveged-1.9.1.tar.gz 474845 SHA256 9c2363ed9542a6784ff08e247182137e71f2ddb79e8e6c1ac4ad50d21ced3715 SHA512 267d62cfeb886ea00fa412de1a91a34821460d0f4ad789dcfb3547018300e1cbf480917571b19652f2d449369293031d9534f9533bbf6a59560f4f10608c9cd2 WHIRLPOOL a930d0a007c91dbc3b7c83a1ccfb659f53aa3f151b8b3984dc7208697ddb1f73ce7012c7c968dd5295b2e90e62db03e1c582267c1b8b5230745735f462a1f757
diff --git a/sys-apps/haveged/files/haveged-conf.d b/sys-apps/haveged/files/haveged-conf.d
new file mode 100644
index 000000000000..b469b4d52fdb
--- /dev/null
+++ b/sys-apps/haveged/files/haveged-conf.d
@@ -0,0 +1,10 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+WATERMARK=1024
+
+# -r0 is added always
+HAVEGED_OPTS="-w ${WATERMARK} -v 1"
+
+# vim:ft=gentoo-conf-d:
diff --git a/sys-apps/haveged/files/haveged-init.d.2 b/sys-apps/haveged/files/haveged-init.d.2
new file mode 100644
index 000000000000..bed95f0cc81f
--- /dev/null
+++ b/sys-apps/haveged/files/haveged-init.d.2
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command="/usr/sbin/${SVCNAME}"
+command_args="-r 0 ${HAVEGED_OPTS}"
+pidfile=/var/run/${SVCNAME}.pid
+
+depend() {
+ need localmount
+ use logger
+ provide entropy
+}
+
+# vim:ft=gentoo-init-d:
diff --git a/sys-apps/haveged/files/haveged-init.d.3 b/sys-apps/haveged/files/haveged-init.d.3
new file mode 100644
index 000000000000..7fbe1b6382b6
--- /dev/null
+++ b/sys-apps/haveged/files/haveged-init.d.3
@@ -0,0 +1,17 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile=/run/${SVCNAME}.pid
+
+command="/usr/sbin/${SVCNAME}"
+command_args="-r 0 ${HAVEGED_OPTS} -p ${pidfile}"
+
+depend() {
+ need localmount
+ use logger
+ provide entropy
+}
+
+# vim:ft=gentoo-init-d:
diff --git a/sys-apps/haveged/files/haveged.conf b/sys-apps/haveged/files/haveged.conf
new file mode 100644
index 000000000000..8386a8c3cd3d
--- /dev/null
+++ b/sys-apps/haveged/files/haveged.conf
@@ -0,0 +1,7 @@
+# Copyright 2013-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+WATERMARK=1024
+
+# vim:ft=haveged.conf:
diff --git a/sys-apps/haveged/files/service.gentoo b/sys-apps/haveged/files/service.gentoo
new file mode 100644
index 000000000000..f896ed2a9b7a
--- /dev/null
+++ b/sys-apps/haveged/files/service.gentoo
@@ -0,0 +1,12 @@
+[Unit]
+Description=Entropy Daemon based on the HAVEGE algorithm
+Documentation=man:haveged(8) http://www.issihosts.com/haveged/
+
+[Service]
+Type=forking
+PIDFile=/run/haveged.pid
+EnvironmentFile=/etc/haveged.conf
+ExecStart=/usr/sbin/haveged -w ${WATERMARK} -v 1 -p /run/haveged.pid -r 0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/haveged/haveged-1.5.ebuild b/sys-apps/haveged/haveged-1.5.ebuild
new file mode 100644
index 000000000000..b28b5484f045
--- /dev/null
+++ b/sys-apps/haveged/haveged-1.5.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+DESCRIPTION="A simple entropy daemon using the HAVEGE algorithm"
+HOMEPAGE="http://www.issihosts.com/haveged/"
+SRC_URI="http://www.issihosts.com/haveged/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="sys-devel/gcc"
+RDEPEND="sys-apps/openrc"
+
+src_configure() {
+ econf --bindir=/usr/sbin --enable-nistest
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+ # This is a RedHat init script
+ rm -rf "${D}"/etc/init.d/haveged
+ # Install gentoo ones instead
+ newinitd "${FILESDIR}"/haveged-init.d.2 haveged
+ newconfd "${FILESDIR}"/haveged-conf.d haveged
+}
diff --git a/sys-apps/haveged/haveged-1.7a-r1.ebuild b/sys-apps/haveged/haveged-1.7a-r1.ebuild
new file mode 100644
index 000000000000..8e112f310357
--- /dev/null
+++ b/sys-apps/haveged/haveged-1.7a-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils systemd
+
+DESCRIPTION="A simple entropy daemon using the HAVEGE algorithm"
+HOMEPAGE="http://www.issihosts.com/haveged/"
+SRC_URI="http://www.issihosts.com/haveged/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!<sys-apps/openrc-0.11.8"
+
+src_configure() {
+ local myeconfargs=(
+ --bindir=/usr/sbin
+ --enable-nistest
+ --disable-static
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ # Install gentoo ones instead
+ newinitd "${FILESDIR}"/haveged-init.d.3 haveged
+ newconfd "${FILESDIR}"/haveged-conf.d haveged
+
+ systemd_newunit "${FILESDIR}"/service.gentoo ${PN}.service
+ insinto /etc
+ doins "${FILESDIR}"/haveged.conf
+}
diff --git a/sys-apps/haveged/haveged-1.7a.ebuild b/sys-apps/haveged/haveged-1.7a.ebuild
new file mode 100644
index 000000000000..8d24c73e36fd
--- /dev/null
+++ b/sys-apps/haveged/haveged-1.7a.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 eutils autotools-utils
+
+DESCRIPTION="A simple entropy daemon using the HAVEGE algorithm"
+HOMEPAGE="http://www.issihosts.com/haveged/"
+SRC_URI="http://www.issihosts.com/haveged/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!<sys-apps/openrc-0.11.8"
+
+src_configure() {
+ local myeconfargs=(
+ --bindir=/usr/sbin
+ --enable-nistest
+ --disable-static
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ rm -rf "${D}"/usr/lib*/*.la
+
+ # Install gentoo ones instead
+ newinitd "${FILESDIR}"/haveged-init.d.3 haveged
+ newconfd "${FILESDIR}"/haveged-conf.d haveged
+}
diff --git a/sys-apps/haveged/haveged-1.9.1.ebuild b/sys-apps/haveged/haveged-1.9.1.ebuild
new file mode 100644
index 000000000000..2f058ab9b34f
--- /dev/null
+++ b/sys-apps/haveged/haveged-1.9.1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils systemd
+
+DESCRIPTION="A simple entropy daemon using the HAVEGE algorithm"
+HOMEPAGE="http://www.issihosts.com/haveged/"
+SRC_URI="http://www.issihosts.com/haveged/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="!<sys-apps/openrc-0.11.8"
+
+# threads are broken right now, but eventually
+# we should add $(use_enable threads)
+src_configure() {
+ local myeconfargs=(
+ --bindir=/usr/sbin
+ --enable-nistest
+ --disable-static
+ --disable-threads
+ )
+
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ # Install gentoo ones instead
+ newinitd "${FILESDIR}"/haveged-init.d.3 haveged
+ newconfd "${FILESDIR}"/haveged-conf.d haveged
+
+ systemd_newunit "${FILESDIR}"/service.gentoo ${PN}.service
+ insinto /etc
+ doins "${FILESDIR}"/haveged.conf
+}
diff --git a/sys-apps/haveged/metadata.xml b/sys-apps/haveged/metadata.xml
new file mode 100644
index 000000000000..8f0080c57726
--- /dev/null
+++ b/sys-apps/haveged/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>sysadmin</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/hbaapi/Manifest b/sys-apps/hbaapi/Manifest
new file mode 100644
index 000000000000..f609b7b7c345
--- /dev/null
+++ b/sys-apps/hbaapi/Manifest
@@ -0,0 +1,2 @@
+DIST hbaapi-2.2.Makefile.gz 1356 SHA256 62a4339c732437895932873810d2b4783b9f170b5af5be402f244b0908cefeec SHA512 1d02546c0dc9143baf1538f3b57e23da4a6b9e685e125c279afac252ae6b4dcd4c8890ed888f8177b5e86c3f76dfabcc9a8d489102c6c68a5d80bf5399118545 WHIRLPOOL 1871c0b71739e2ead12d8e3bbbe2b9630c99703b4b6798aa0b1927fa78133d984aa0d349025207108fd571d0d445fedad9717d4d6c7786989bc36cf0ece00021
+DIST hbaapi_src_2.2.tgz 30232 SHA256 c1b64243666e01c82c3f58e2b032fc76cbe6ced92d894bee2ea83ab99fc90c43 SHA512 83d8d3df0208f632016acac65bc03b9610eb47d98e99565e2bdbe543382b141c0b6d148272dffc421a36f16ee511027899ee2b70a04435a6ef221e0bc559e511 WHIRLPOOL cc8089f9ff9c29f594d5bf579e66400692b0f1455547df8cb1918fd83cef0c818d382978553c210cb5762f2c97010818984eb80f2f54a9719ae456e3fd5ab8d3
diff --git a/sys-apps/hbaapi/files/hba.conf b/sys-apps/hbaapi/files/hba.conf
new file mode 100644
index 000000000000..347c24b80e36
--- /dev/null
+++ b/sys-apps/hbaapi/files/hba.conf
@@ -0,0 +1,43 @@
+#
+# This file contains names and references to HBA libraries
+#
+# Format:
+#
+# <library name> <library pathname>
+#
+# The library name should be prepended with the domain of
+# the manufacturer or driver author.
+#
+# 32bit/64bit implementation note:
+# If a 32bit implementation tries to load a 64 bit library,
+# the load will fail with the result that the 64 bit vendor
+# library is ignored.
+# Likewise, if a 64bit implementation tries to load a 32 bit library,
+# the load will fail with the result that the 32 bit vendor
+# library is ignored.
+
+#org.snia.sample32 /usr/lib/libsample.so
+#com.qlogic.qla32 /usr/lib/libhbaapiqla.so
+#com.emulex.lightpulse32 /usr/lib/libhbaapiemu.so
+#com.emulex.lightpulse64 /usr/lib/sparcv9/libhbaapiemu.so
+#JniHbaLib /opt/JNIsnia/Solaris/Jni/32bit/JniHbaLib.so
+#JniHbaLib /opt/JNIsnia/Solaris/Jni/64bit/JniHbaLib.so
+
+#INSERT_LIB_MARKER - Do not edit this line - Gentoo will insert items after this
+
+
+# Set a debug level (depends on compilation switches)
+#
+# Format:
+#
+# "debuglevel" <debug level>
+#
+# 0 is default, 1 show vendor library opens,
+# 2 shows function calls, 3 shows callback events
+#
+# Uncomment the next line to specify a level
+#debuglevel 3
+
+
+
+
diff --git a/sys-apps/hbaapi/files/hbaapi-2.2-qa.patch b/sys-apps/hbaapi/files/hbaapi-2.2-qa.patch
new file mode 100644
index 000000000000..240cc1d2d473
--- /dev/null
+++ b/sys-apps/hbaapi/files/hbaapi-2.2-qa.patch
@@ -0,0 +1,37 @@
+--- hbaapi_src_2.2.orig/HBAAPILIB.c
++++ hbaapi_src_2.2/HBAAPILIB.c
+@@ -30,7 +30,6 @@
+
+ #ifdef WIN32
+ #include <windows.h>
+-#include <string.h>
+ /*
+ * Next define forces entry points in the dll to be exported
+ * See hbaapi.h to see what it does.
+@@ -40,6 +39,7 @@
+ #include <dlfcn.h>
+ #include <strings.h>
+ #endif
++#include <string.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include "hbaapi.h"
+@@ -395,7 +395,7 @@
+ GRAB_MUTEX(&_hbaapi_APSE_mutex);
+ GRAB_MUTEX(&_hbaapi_TE_mutex);
+ GRAB_MUTEX(&_hbaapi_LE_mutex);
+- for(listp = cb_lists_array, found = 0; found == 0, *listp != NULL; listp++) {
++ for(listp = cb_lists_array, found = 0; found == 0 && *listp != NULL; listp++) {
+ lastp = *listp;
+ for(cbp=**listp; cbp != NULL; cbp = cbp->next) {
+ if(cbhandle != (HBA_CALLBACKHANDLE)cbp) {
+--- hbaapi_src_2.2.orig/hbaapitest.c
++++ hbaapi_src_2.2/hbaapitest.c
+@@ -28,6 +28,7 @@
+
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #ifndef WIN32
+ #include <dlfcn.h> /* Dynamic library support for Solaris */
+ #include <time.h>
diff --git a/sys-apps/hbaapi/hbaapi-2.2.ebuild b/sys-apps/hbaapi/hbaapi-2.2.ebuild
new file mode 100644
index 000000000000..faad2eb0c5bf
--- /dev/null
+++ b/sys-apps/hbaapi/hbaapi-2.2.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 eutils toolchain-funcs
+
+MY_PN="${PN}_src"
+MY_P="${MY_PN}_${PV}"
+DESCRIPTION="The Host Bus Adapter API for managing Fibre Channel Host Bus Adapters"
+HOMEPAGE="http://hbaapi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz
+ mirror://gentoo/${P}.Makefile.gz"
+
+LICENSE="SNIA"
+SLOT="0"
+KEYWORDS="~ppc ~x86 ~amd64"
+IUSE=""
+
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ mv "${WORKDIR}"/${P}.Makefile "${S}"/Makefile
+
+ sed -i -e "s/-g -c/${CFLAGS} -c/" \
+ -e "s/-shared/\0 ${LDFLAGS}/" \
+ Makefile || die
+
+ epatch "${FILESDIR}"/${P}-qa.patch
+}
+
+src_compile() {
+ # not parallel safe!
+ emake -j1 CC="$(tc-getCC)" all
+}
+
+src_install() {
+ into /usr
+ dolib.so libHBAAPI.so
+ dosbin hbaapitest
+ insinto /etc
+ doins "${FILESDIR}"/hba.conf
+ dodoc readme.txt
+}
diff --git a/sys-apps/hbaapi/metadata.xml b/sys-apps/hbaapi/metadata.xml
new file mode 100644
index 000000000000..290c474f4b48
--- /dev/null
+++ b/sys-apps/hbaapi/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">hbaapi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/hdparm/Manifest b/sys-apps/hdparm/Manifest
new file mode 100644
index 000000000000..553b42276f2f
--- /dev/null
+++ b/sys-apps/hdparm/Manifest
@@ -0,0 +1,4 @@
+DIST hdparm-9.39.tar.gz 126989 SHA256 72d550af4526aa96f0841c79321a0ee39d636cbaf1f294e52193e90c054b3cea SHA512 7332fb1c03faa9b916864640959d31a355d4c8daebdb97dc941375a2fb2499827546fd1f1cc1435b403da399e5f5a70a30e9384b4499bec8f45c9408ad074b3c WHIRLPOOL cb3ccbab588cf349a39f2df5844444bc0db51f8b3c75fa9068507382b46a92cc32dc3132e325820ea158182de5b65f46de2913bd58fd737a3242b33729d9c7df
+DIST hdparm-9.45.tar.gz 129410 SHA256 23b01caa56a995cf0897877b6aff98ea622a5df255bc2894b1a7693387f38669 SHA512 2692382f16fe9a87b7c9673bea44b8a9512b2449aaf18090f09c9e761fadc153f71d9779d063218f6951797649c0758f97242b7327da6653ea53991bf3da9eb8 WHIRLPOOL 6c424e265b7845afeff26f87654fbefe7d563404f2dee59f976594a87b375124262864305a14655bf5379e77e21bea0d8fb179e099374d7e8f952199f569ee58
+DIST hdparm-9.47.tar.gz 130180 SHA256 4995545e2d4e5a1e6886e5032f353ed9472c17a56a88ee4b1334b142d5b1b757 SHA512 1a5164ef13b276ea0be25ac96710ec6292d73649eb20b2350ae4f3ea77e4816515cdca75316a4bcb8624a0fff725560c4a64fbde63d48b68c44bd02cb76c6a5e WHIRLPOOL 97279536cd14543380d287f5b9cd76934c11358ccdbfce1610ec0c85a522b49913a81926a9b042de776881c3160f4dec81988ca91cce7811f8a216e3736e47e7
+DIST hdparm-9.48.tar.gz 130277 SHA256 ce97b4a71cb04146f54cf6f69787e7f97ddfda9836dc803b459d3b3df3a4fbee SHA512 5b8908a762d892c403406da4798202bed95f035396e3c49f04da910fa53a6b442a7d7c9cb1e5d786d7c8c5a1b681c8d1db10f1bd8dad09600a6f3811fbf8afb7 WHIRLPOOL 4f17e6622a9c6516834b0487c0d73ba7aaaffcd5381cbcf03c01fa936924975c3fb7190052c4d1bba7a0b53a53fc9b910fe4c71440f4a556d533d43ecd474516
diff --git a/sys-apps/hdparm/files/hdparm-conf.d.3 b/sys-apps/hdparm/files/hdparm-conf.d.3
new file mode 100644
index 000000000000..a1ae626b3b05
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-conf.d.3
@@ -0,0 +1,26 @@
+# /etc/conf.d/hdparm: config file for /etc/init.d/hdparm
+
+#
+# Note that options such as -y which force *immediate* power saving options
+# should generally not be placed here. The hdparm init.d script may run at
+# anytime with respect to other init.d scripts that do system wide drive
+# scans (like the hald script), so they will merely get spun right back up.
+# If you wish to use these options, please use the local.start init.d script
+# instead so that you're guaranteed that it will run last.
+#
+
+# You can either set hdparm arguments for each drive using hdX_args,
+# discX_args, cdromX_args and genericX_args, e.g.
+#
+# hda_args="-d1 -X66"
+# disc1_args="-d1"
+# cdrom0_args="-d1"
+
+# or you can set options for all PATA drives
+pata_all_args="-d1"
+
+# or you can set options for all SATA drives
+sata_all_args=""
+
+# or, you can set hdparm options for all drives
+all_args=""
diff --git a/sys-apps/hdparm/files/hdparm-init-8 b/sys-apps/hdparm/files/hdparm-init-8
new file mode 100644
index 000000000000..9bf23850a80d
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-init-8
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before bootmisc
+}
+
+do_hdparm() {
+ local e=
+ eval e=\$${extra_args}
+ [ -z "${args}${all_args}${e}" ] && return 0
+
+ if [ -n "${args:=${all_args} ${e}}" ] ; then
+ local orgdevice=$(readlink -f "${device}")
+ if [ -b "${orgdevice}" ] ; then
+ ebegin "Running hdparm on ${device}"
+ hdparm ${args} "${device}" > /dev/null
+ eend $?
+ fi
+ fi
+}
+
+scan_nondevfs() {
+ # non-devfs compatible system
+ local device
+
+ for device in /dev/hd* /dev/sd* /dev/cdrom* ; do
+ [ -e "${device}" ] || continue
+ case "${device}" in
+ *[0-9]) continue ;;
+ /dev/hd*) extra_args="pata_all_args" ;;
+ /dev/sd*) extra_args="sata_all_args" ;;
+ *) extra_args="_no_xtra_args" ;;
+ esac
+
+ # check that the block device really exists by
+ # opening it for reading
+ local errmsg= status= nomed=1
+ errmsg=$(export LC_ALL=C ; : 2>&1 <"${device}")
+ status=$?
+ case ${errmsg} in
+ *": No medium found") nomed=0;;
+ esac
+ if [ -b "${device}" ] && [ "${status}" = "0" -o "${nomed}" = "0" ] ; then
+ local conf_var="${device##*/}_args"
+ eval args=\$${conf_var}
+ do_hdparm
+ fi
+ done
+}
+
+start() {
+ if get_bootparam "nohdparm" ; then
+ ewarn "Skipping hdparm init as requested in kernel cmdline"
+ return 0
+ fi
+
+ scan_nondevfs
+}
diff --git a/sys-apps/hdparm/hdparm-9.39.ebuild b/sys-apps/hdparm/hdparm-9.39.ebuild
new file mode 100644
index 000000000000..a76d3f57e6c6
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.39.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Utility to change hard drive performance parameters"
+HOMEPAGE="http://sourceforge.net/projects/hdparm/"
+SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
+
+LICENSE="BSD GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+src_prepare() {
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ Makefile || die "sed"
+}
+
+src_compile() {
+ emake STRIP=: CC="$(tc-getCC)"
+}
+
+src_install() {
+ into /
+ dosbin hdparm contrib/idectl
+
+ newinitd "${FILESDIR}"/hdparm-init-8 hdparm
+ newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
+
+ doman hdparm.8
+ dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
+ docinto wiper
+ dodoc wiper/{README.txt,wiper.sh}
+}
diff --git a/sys-apps/hdparm/hdparm-9.45.ebuild b/sys-apps/hdparm/hdparm-9.45.ebuild
new file mode 100644
index 000000000000..58ec50f1ed7f
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.45.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="Utility to change hard drive performance parameters"
+HOMEPAGE="http://sourceforge.net/projects/hdparm/"
+SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
+
+LICENSE="BSD GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static"
+
+src_prepare() {
+ use static && append-ldflags -static
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ Makefile || die "sed"
+}
+
+src_compile() {
+ emake STRIP=: CC="$(tc-getCC)"
+}
+
+src_install() {
+ into /
+ dosbin hdparm contrib/idectl
+
+ newinitd "${FILESDIR}"/hdparm-init-8 hdparm
+ newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
+
+ doman hdparm.8
+ dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
+ docinto wiper
+ dodoc wiper/{README.txt,wiper.sh}
+}
diff --git a/sys-apps/hdparm/hdparm-9.47.ebuild b/sys-apps/hdparm/hdparm-9.47.ebuild
new file mode 100644
index 000000000000..56bf483cb47e
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.47.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="Utility to change hard drive performance parameters"
+HOMEPAGE="http://sourceforge.net/projects/hdparm/"
+SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
+
+LICENSE="BSD GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static"
+
+src_prepare() {
+ use static && append-ldflags -static
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ Makefile || die "sed"
+}
+
+src_compile() {
+ emake STRIP=: CC="$(tc-getCC)"
+}
+
+src_install() {
+ into /
+ dosbin hdparm contrib/idectl
+
+ newinitd "${FILESDIR}"/hdparm-init-8 hdparm
+ newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
+
+ doman hdparm.8
+ dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
+ docinto wiper
+ dodoc wiper/{README.txt,wiper.sh}
+}
diff --git a/sys-apps/hdparm/hdparm-9.48.ebuild b/sys-apps/hdparm/hdparm-9.48.ebuild
new file mode 100644
index 000000000000..56bf483cb47e
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.48.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs flag-o-matic
+
+DESCRIPTION="Utility to change hard drive performance parameters"
+HOMEPAGE="http://sourceforge.net/projects/hdparm/"
+SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
+
+LICENSE="BSD GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static"
+
+src_prepare() {
+ use static && append-ldflags -static
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ Makefile || die "sed"
+}
+
+src_compile() {
+ emake STRIP=: CC="$(tc-getCC)"
+}
+
+src_install() {
+ into /
+ dosbin hdparm contrib/idectl
+
+ newinitd "${FILESDIR}"/hdparm-init-8 hdparm
+ newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
+
+ doman hdparm.8
+ dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
+ docinto wiper
+ dodoc wiper/{README.txt,wiper.sh}
+}
diff --git a/sys-apps/hdparm/metadata.xml b/sys-apps/hdparm/metadata.xml
new file mode 100644
index 000000000000..5124b52e66e1
--- /dev/null
+++ b/sys-apps/hdparm/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">hdparm</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/heirloom-tools/Manifest b/sys-apps/heirloom-tools/Manifest
new file mode 100644
index 000000000000..1b23e0ac46fd
--- /dev/null
+++ b/sys-apps/heirloom-tools/Manifest
@@ -0,0 +1 @@
+DIST heirloom-070715.tar.bz2 1000080 SHA256 eb33f70bcc019b1d0e0a41f1d7552d45c57a16272e4e1c48634ec3e44496a30f SHA512 0b30b0f4c4c92a10ee2da263ea44666f445d96bac86ca4afb7bbb50d8278986e4145a7bcdf3ed9f75611bb956e93e16fc0e19874498ce3ae1a00e6fbb4f910c9 WHIRLPOOL be19c6833970b343f952f28821dea4f3571f6f348841a23b793ea587be65930a7e5fd41fe0ba2b617be343ea520d626e61cb98b7c42e0fe0e78b423c0be3ab83
diff --git a/sys-apps/heirloom-tools/heirloom-tools-070715.ebuild b/sys-apps/heirloom-tools/heirloom-tools-070715.ebuild
new file mode 100644
index 000000000000..aded44391e41
--- /dev/null
+++ b/sys-apps/heirloom-tools/heirloom-tools-070715.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit flag-o-matic toolchain-funcs
+
+# slightly broken
+RESTRICT="test"
+
+DESCRIPTION="Heirloom toolchest - original Unix tools"
+HOMEPAGE="http://heirloom.sourceforge.net/tools.html"
+SRC_URI="http://downloads.sourceforge.net/project/heirloom/heirloom/${PV}/heirloom-${PV}.tar.bz2"
+
+LICENSE="CDDL GPL-2 LGPL-2.1 9base ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="sys-apps/ed
+ sys-libs/zlib[static-libs]"
+RDEPEND=""
+
+S="${WORKDIR}/heirloom-${PV}"
+
+src_compile() {
+ append-cppflags -D_GNU_SOURCE
+ emake -j1 ||die
+}
+
+src_install() {
+ # we don't want to strip here, so use "true" as noop
+ emake STRIP="true" ROOT="${D}" -j1 install || die
+}
+
+pkg_postinst() {
+ elog "You may want to add /usr/5bin or /usr/ucb to \$PATH"
+ elog "to enable using the apps of heirloom toolchest by default."
+ elog "Man pages are installed in /usr/share/man/5man/"
+ elog "You may need to set \$MANPATH to access them."
+}
diff --git a/sys-apps/heirloom-tools/metadata.xml b/sys-apps/heirloom-tools/metadata.xml
new file mode 100644
index 000000000000..24cbb90cf0c4
--- /dev/null
+++ b/sys-apps/heirloom-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>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/help2man/Manifest b/sys-apps/help2man/Manifest
new file mode 100644
index 000000000000..8b80692a70d9
--- /dev/null
+++ b/sys-apps/help2man/Manifest
@@ -0,0 +1,3 @@
+DIST help2man-1.45.1.tar.xz 124236 SHA256 c70fc791e6d13240327955de355244371b00bb1c9e247d5693ed601b716467c2 SHA512 728f8d464369752ac680cafc151f84bc9edddae1fb57621d5179346dd50f735b8ced0b7f46456cb6201e43cfdeb33b3cc155513aa76152889501952277774c08 WHIRLPOOL 1ded36ab4eb934462bba4e1b3d3f6168411931465c8cc60ca0ca86afe505e3fdab6607cefdaed6f38b004d9ce6f91772cfe036c248d2c73fae452f73387a6455
+DIST help2man-1.46.6.tar.xz 171044 SHA256 615ff5ac38369ddb3707c5fd71672ab122639fd9cf6870de172e0127ed632caf SHA512 55bea01b80baf318e4350ee505bf67da9a7e76b7a5cbd861d0fd6e3afe47b82d1de8f1079d0df2f4ea8ec176d6ca95d5c847d8b1c118cf96ab59b06567c1204c WHIRLPOOL 91d4702d69457090ca58074c05763a085e5bd9da162253a14e86c618a619482e44d7d974c7b0fd0139927d5a67b48bc7160f50990bb622984b122d1bb6c7052c
+DIST help2man-1.47.1.tar.xz 179164 SHA256 c59b26f60cb06e45b00e729dea721e7a17220e2c17d800eb428271a750382b06 SHA512 3ac99d2d2384aea9d396c7fb123f17b99c19db8f18085be3516cef56f2ecf06f16e6aa924b41b53f57eca8722dee029939677401dd69358cddc39fc59e0bcf12 WHIRLPOOL 75a21cfc55e2652a02f12075a3609dcb4c9f42fdea02fdbda0757cf2f107602e609f4ed9641351663fe177936353db0cb26b763bae92a83bbd2f6ffe0bf7e941
diff --git a/sys-apps/help2man/files/help2man-1.36.4-respect-LDFLAGS.patch b/sys-apps/help2man/files/help2man-1.36.4-respect-LDFLAGS.patch
new file mode 100644
index 000000000000..e6d1f6f0811e
--- /dev/null
+++ b/sys-apps/help2man/files/help2man-1.36.4-respect-LDFLAGS.patch
@@ -0,0 +1,11 @@
+--- Makefile.in
++++ Makefile.in
+@@ -102,7 +102,7 @@
+
+ preload: $(preload).so
+ $(preload).so: $(srcdir)/$(preload).c
+- $(CC) $(CFLAGS) -o $@ -fPIC -shared $? $(LIBS)
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -fPIC -shared $? $(LIBS)
+
+ man: $(target).1
+ $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m
diff --git a/sys-apps/help2man/files/help2man-1.38.4-linguas.patch b/sys-apps/help2man/files/help2man-1.38.4-linguas.patch
new file mode 100644
index 000000000000..080166c5060c
--- /dev/null
+++ b/sys-apps/help2man/files/help2man-1.38.4-linguas.patch
@@ -0,0 +1,53 @@
+respect user LINGUAS
+
++++ b/Makefile.in
+@@ -16,7 +16,12 @@
+ export VPATH = .:$(srcdir)
+
+ DESTDIR =
+-LINGUAS = $(basename $(notdir $(wildcard $(srcdir)/po/*.po)))
++ALL_LINGUAS = $(basename $(notdir $(wildcard $(srcdir)/po/*.po)))
++ifeq ($(LINGUAS),)
++INSTALL_LINGUAS = $(ALL_LINGUAS)
++else
++INSTALL_LINGUAS = $(filter $(LINGUAS),$(ALL_LINGUAS))
++endif
+
+ CC = @CC@
+ PERL = @PERL@
+@@ -56,7 +62,7 @@
+ $(INSTALL_PROGRAM) $(preload).so $(DESTDIR)$(pkglibdir)
+
+ install_l10n: install_dirs msg_l10n man_l10n
+- for lang in $(LINGUAS); \
++ for lang in $(INSTALL_LINGUAS); \
+ do \
+ $(MKINSTALLDIRS) $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
+ $(INSTALL_DATA) $(call vpath_file,po/$$lang.gmo) \
+@@ -124,7 +130,7 @@
+ $(MAKE) $(target).h2m
+ ./$(target) --include=$(target).h2m --output=$@ ./$(target)
+
+-msg_l10n: $(addprefix po/,$(addsuffix .gmo,$(LINGUAS)))
++msg_l10n: $(addprefix po/,$(addsuffix .gmo,$(ALL_LINGUAS)))
+ po/%.gmo: $(srcdir)/po/%.po
+ test -d po || mkdir po
+ $(MSGFMT) -o $@ $?
+@@ -134,7 +140,7 @@
+ $(MKINSTALLDIRS) localetmp/$$lang/LC_MESSAGES && \
+ $(INSTALL_DATA) po/$$lang.gmo localetmp/$$lang/LC_MESSAGES/$(target).mo
+
+-man_l10n: $(addprefix $(target).,$(addsuffix .1,$(LINGUAS)))
++man_l10n: $(addprefix $(target).,$(addsuffix .1,$(ALL_LINGUAS)))
+ $(target).%.1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL \
+ $(srcdir)/po/%.po
+ lang=$(patsubst $(target).%.1,%,$@); \
+@@ -164,7 +170,7 @@
+ ./config.status
+
+ update-po: $(srcdir)/po/$(target).pot
+- for lang in $(LINGUAS); \
++ for lang in $(ALL_LINGUAS); \
+ do \
+ echo -n "Updating $$lang "; \
+ msgmerge -U $(srcdir)/po/$$lang.po $(srcdir)/po/$(target).pot; \
diff --git a/sys-apps/help2man/files/help2man-1.46.1-linguas.patch b/sys-apps/help2man/files/help2man-1.46.1-linguas.patch
new file mode 100644
index 000000000000..b4631bfa7cd7
--- /dev/null
+++ b/sys-apps/help2man/files/help2man-1.46.1-linguas.patch
@@ -0,0 +1,67 @@
+respect user LINGUAS
+
+--- help2man-1.46.1/Makefile.in
++++ help2man-1.46.1/Makefile.in
+@@ -27,8 +27,15 @@
+ export VPATH = .:$(srcdir)
+
+ DESTDIR =
+-LINGUAS = $(basename $(notdir $(wildcard $(srcdir)/po/*.po)))
+-LINGUAS_TEXI = $(basename $(notdir $(wildcard $(srcdir)/po-texi/*.po)))
++ALL_LINGUAS = $(basename $(notdir $(wildcard $(srcdir)/po/*.po)))
++ALL_LINGUAS_TEXI = $(basename $(notdir $(wildcard $(srcdir)/po-texi/*.po)))
++ifeq ($(LINGUAS),)
++INSTALL_LINGUAS = $(ALL_LINGUAS)
++INSTALL_LINGUAS_TEXI = $(ALL_LINGUAS_TEXI)
++else
++INSTALL_LINGUAS = $(filter $(LINGUAS),$(ALL_LINGUAS))
++INSTALL_LINGUAS_TEXI = $(filter $(LINGUAS),$(ALL_LINGUAS_TEXI))
++endif
+
+ CC = @CC@
+ PERL = @PERL@
+@@ -80,7 +87,7 @@
+
+ install_l10n: install_dirs msg_l10n man_l10n info_l10n
+ set -e; \
+- for lang in $(LINGUAS); \
++ for lang in $(INSTALL_LINGUAS); \
+ do \
+ $(MKINSTALLDIRS) $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
+ $(INSTALL_DATA) $$($(FIND_VPATH) po/$$lang.gmo) \
+@@ -89,7 +96,7 @@
+ $(INSTALL_DATA) $$($(FIND_VPATH) $(target).$$lang.1) \
+ $(DESTDIR)$(mandir)/$$lang/man1/$(target).1; \
+ done; \
+- for lang in $(LINGUAS_TEXI); \
++ for lang in $(INSTALL_LINGUAS_TEXI); \
+ do \
+ $(INSTALL_DATA) $$($(FIND_VPATH) $(target)-$$lang.info) \
+ $(DESTDIR)$(infodir)/$(target)-$$lang.info; \
+@@ -151,7 +158,7 @@
+ $(MAKE) $(target) $(target).h2m
+ ./$(target) --include=$(target).h2m --output=$@ ./$(target)
+
+-msg_l10n: $(addprefix po/,$(addsuffix .gmo,$(LINGUAS)))
++msg_l10n: $(addprefix po/,$(addsuffix .gmo,$(ALL_LINGUAS)))
+ po/%.gmo: $(srcdir)/po/%.po
+ test -d po || mkdir po
+ $(MSGFMT) -o $@ $?
+@@ -161,7 +168,7 @@
+ $(MKINSTALLDIRS) localetmp/$$lang/LC_MESSAGES && \
+ $(INSTALL_DATA) po/$$lang.gmo localetmp/$$lang/LC_MESSAGES/$(target).mo
+
+-man_l10n: $(addprefix $(target).,$(addsuffix .1,$(LINGUAS)))
++man_l10n: $(addprefix $(target).,$(addsuffix .1,$(ALL_LINGUAS)))
+ $(target).%.1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL \
+ $(srcdir)/po/%.po
+ lang=$(patsubst $(target).%.1,%,$@); \
+@@ -184,7 +191,7 @@
+ $(target).info: $(srcdir)/$(target).texi
+ $(MAKEINFO) $? -o $@
+
+-info_l10n: $(addprefix $(target)-,$(addsuffix .info,$(LINGUAS_TEXI)))
++info_l10n: $(addprefix $(target)-,$(addsuffix .info,$(ALL_LINGUAS_TEXI)))
+ $(target)-%.info: $(target)-%.texi
+ $(MAKEINFO) $? -o $@.tmp
+ $(FIXUP_TEXI_TRANS) -o $@ $@.tmp
diff --git a/sys-apps/help2man/help2man-1.45.1.ebuild b/sys-apps/help2man/help2man-1.45.1.ebuild
new file mode 100644
index 000000000000..bb1e88217e30
--- /dev/null
+++ b/sys-apps/help2man/help2man-1.45.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="GNU utility to convert program --help output to a man page"
+HOMEPAGE="http://www.gnu.org/software/help2man/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls"
+
+RDEPEND="dev-lang/perl
+ nls? ( dev-perl/Locale-gettext )"
+DEPEND=${RDEPEND}
+
+DOCS="debian/changelog NEWS README THANKS" #385753
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.36.4-respect-LDFLAGS.patch \
+ "${FILESDIR}"/${PN}-1.38.4-linguas.patch
+}
+
+src_configure() {
+ econf $(use_enable nls)
+}
diff --git a/sys-apps/help2man/help2man-1.46.6.ebuild b/sys-apps/help2man/help2man-1.46.6.ebuild
new file mode 100644
index 000000000000..4b32f3abe7f8
--- /dev/null
+++ b/sys-apps/help2man/help2man-1.46.6.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="GNU utility to convert program --help output to a man page"
+HOMEPAGE="http://www.gnu.org/software/help2man/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls"
+
+RDEPEND="dev-lang/perl
+ nls? ( dev-perl/Locale-gettext )"
+DEPEND=${RDEPEND}
+
+DOCS="debian/changelog NEWS README THANKS" #385753
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.46.1-linguas.patch
+}
+
+src_configure() {
+ # Disable gettext requirement as the release includes the gmo files #555018
+ econf \
+ ac_cv_path_MSGFMT=$(type -P false) \
+ $(use_enable nls)
+}
diff --git a/sys-apps/help2man/help2man-1.47.1.ebuild b/sys-apps/help2man/help2man-1.47.1.ebuild
new file mode 100644
index 000000000000..c2a92484ee35
--- /dev/null
+++ b/sys-apps/help2man/help2man-1.47.1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="GNU utility to convert program --help output to a man page"
+HOMEPAGE="http://www.gnu.org/software/help2man/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls"
+
+RDEPEND="dev-lang/perl
+ nls? ( dev-perl/Locale-gettext )"
+DEPEND=${RDEPEND}
+
+DOCS="debian/changelog NEWS README THANKS" #385753
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-1.46.1-linguas.patch
+}
+
+src_configure() {
+ # Disable gettext requirement as the release includes the gmo files #555018
+ econf \
+ ac_cv_path_MSGFMT=$(type -P false) \
+ $(use_enable nls)
+}
diff --git a/sys-apps/help2man/metadata.xml b/sys-apps/help2man/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/help2man/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-apps/hexdump-esr/Manifest b/sys-apps/hexdump-esr/Manifest
new file mode 100644
index 000000000000..68bc16389595
--- /dev/null
+++ b/sys-apps/hexdump-esr/Manifest
@@ -0,0 +1 @@
+DIST hexdump-1.8.tar.gz 7463 SHA256 ab692ec15b950c9636719f0780abd73988847c4ffbbbc89ab3512dd428737c3d SHA512 a0f0b9f0386b895b0dd07223e93ca72a7d87f4b0ad663d340cea8266ed7e801178b120c6a78b797a9e12412e7b9c76b45b8e395d1892c7ba3956a90dee45db3d WHIRLPOOL 97157396756aef5ff48294dec806d079f8103d92e9281a9fd63dc548467709c5edebe8b1d9684d0c88300d9d3eebba1c47cb47eafdd91dd47a4ceb275f9173eb
diff --git a/sys-apps/hexdump-esr/hexdump-esr-1.8.ebuild b/sys-apps/hexdump-esr/hexdump-esr-1.8.ebuild
new file mode 100644
index 000000000000..b41592eaf74b
--- /dev/null
+++ b/sys-apps/hexdump-esr/hexdump-esr-1.8.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+MY_P="${P/-esr/}"
+
+DESCRIPTION="Eric Raymond's hex dumper"
+HOMEPAGE="http://www.catb.org/~esr/hexdump/"
+SRC_URI="http://www.catb.org/~esr/hexdump/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ia64 ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE=""
+
+S="${WORKDIR}/${MY_P}"
+
+# tests are broken in this release(missing files)
+RESTRICT="test"
+
+src_prepare() {
+ sed -i Makefile \
+ -e "s|-O |${CFLAGS} ${LDFLAGS} |g" \
+ || die "sed on Makefile failed"
+ tc-export CC
+}
+
+src_install() {
+ newbin hexdump ${PN}
+ newman hexdump.1 ${PN}.1
+ dodoc NEWS README
+ dosym ${PN} /usr/bin/hex
+}
diff --git a/sys-apps/hexdump-esr/metadata.xml b/sys-apps/hexdump-esr/metadata.xml
new file mode 100644
index 000000000000..91f4e72fb544
--- /dev/null
+++ b/sys-apps/hexdump-esr/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/hotplug2stdout/Manifest b/sys-apps/hotplug2stdout/Manifest
new file mode 100644
index 000000000000..24ee6768d4ce
--- /dev/null
+++ b/sys-apps/hotplug2stdout/Manifest
@@ -0,0 +1 @@
+DIST hotplug2stdout-1.2.1.tar.gz 7578 SHA256 4d3e2fefe9ae519a1ade33afb293e63e7694f4cc1483729f5ef96315d8823c02 SHA512 51cdef016b8e57324b005fbe633643c36b2e557da369e48471b6969441610c4489c0a49be28080cca17c8d77124c6540877151acde415dab49971f87160df126 WHIRLPOOL fe0999f64c10e19cfc26b4c4cf533f261600110e8682cd360c273b4de30ae0e84d751b388067788fe488754c8d1a699eb42ea7938e378d8db0da4ba7d6d7a032
diff --git a/sys-apps/hotplug2stdout/hotplug2stdout-1.2.1.ebuild b/sys-apps/hotplug2stdout/hotplug2stdout-1.2.1.ebuild
new file mode 100644
index 000000000000..4770bc360ec3
--- /dev/null
+++ b/sys-apps/hotplug2stdout/hotplug2stdout-1.2.1.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="A tool for reading kernel uevent(s) to stdout"
+HOMEPAGE="http://www.bellut.net/projects.html"
+# wget --user puppy --password linux "http://bkhome.org/sources/alphabetical/h/${P}.tar.gz"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+src_prepare() { rm -f ${PN}; }
+src_compile() { $(tc-getCC) ${LDFLAGS} ${CFLAGS} ${CPPFLAGS} ${PN}.c -o ${PN} || die; }
+src_install() { dobin ${PN}; }
diff --git a/sys-apps/hotplug2stdout/metadata.xml b/sys-apps/hotplug2stdout/metadata.xml
new file mode 100644
index 000000000000..c2d865517c00
--- /dev/null
+++ b/sys-apps/hotplug2stdout/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>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/hprofile/Manifest b/sys-apps/hprofile/Manifest
new file mode 100644
index 000000000000..21db0076dd9b
--- /dev/null
+++ b/sys-apps/hprofile/Manifest
@@ -0,0 +1,3 @@
+DIST hprofile-3.0.6.tar.gz 18236 SHA256 23aaa1d6d2cc5b6e8fb3000a19c7cdfeec71abc0d18ce81727a61cabd73d0532 SHA512 86568314a24397d2ec5898dd3061e91a5597eff49679f0533fdcb0d2c9b76cdb131b25fe45167370174d1514ba222a781c0f09f98a1cc5407898e36c30ff677f WHIRLPOOL 41afc8ee3a824ecc07f1f3305d462ac10cb57a89b5defbef3cd562fd5a90289850470b1adad22f9fb2efa03fe6fb45637d97e350d24ccf38a973503e53d55c68
+DIST hprofile-3.1.1.tar.gz 18489 SHA256 dd3a853ad7928673be689d2514a2e9da0981edc216ecf396f612fb0771dbbdad SHA512 b42bf79840270eccf164a0ba2d5def7d50846fa7043319b23be2be3fabece014a031cc4197c2688a6c4f7a542f0e0961ff538ea879eac81a7f03c024a4d023da WHIRLPOOL f4e397221f7736553ee6430cd6aa11936edc44d5605a028d8ab2cf5aa75fba28c5e80e3a9e5456e08f5c9b21ec04ef8d0cead397630eb77995aea012ef2b9015
+DIST hprofile-3.2.2.tar.gz 18983 SHA256 e1f18cfa09d62c429890f5ab9995f144b67304ab6b703bbe23bc00d4779698bb SHA512 169a6c68659ea0d84b89bf25c8421bdfe7d106c77ca7cf80bafe65a4b24a04267729ef617e795adee5bdbcbfb56102a41c2ee7c926027aef69abe4cdee499328 WHIRLPOOL dae307fb2c664a208bd4cd07c1a256a9e2fcef0609f2105085dd5760321c406e3816debdeb51b3b2a3f34f4c8d2d08a8afec9489f2c8d23c44b60e3f5986d32b
diff --git a/sys-apps/hprofile/hprofile-3.0.6.ebuild b/sys-apps/hprofile/hprofile-3.0.6.ebuild
new file mode 100644
index 000000000000..cbebb2e73b0c
--- /dev/null
+++ b/sys-apps/hprofile/hprofile-3.0.6.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Utility to manage hardware, network, power or other profiles (fork)"
+HOMEPAGE="https://github.com/tokiclover/hprofile"
+SRC_URI="https://github.com/tokiclover/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ sed -i '1s:.*:#!/sbin/runscript:' hprofile.initd || die
+ sed -i "/^prefix/s:=.*:=${EPREFIX}/usr:" Makefile || die
+}
diff --git a/sys-apps/hprofile/hprofile-3.1.1.ebuild b/sys-apps/hprofile/hprofile-3.1.1.ebuild
new file mode 100644
index 000000000000..cbebb2e73b0c
--- /dev/null
+++ b/sys-apps/hprofile/hprofile-3.1.1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Utility to manage hardware, network, power or other profiles (fork)"
+HOMEPAGE="https://github.com/tokiclover/hprofile"
+SRC_URI="https://github.com/tokiclover/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ sed -i '1s:.*:#!/sbin/runscript:' hprofile.initd || die
+ sed -i "/^prefix/s:=.*:=${EPREFIX}/usr:" Makefile || die
+}
diff --git a/sys-apps/hprofile/hprofile-3.2.2.ebuild b/sys-apps/hprofile/hprofile-3.2.2.ebuild
new file mode 100644
index 000000000000..cbebb2e73b0c
--- /dev/null
+++ b/sys-apps/hprofile/hprofile-3.2.2.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Utility to manage hardware, network, power or other profiles (fork)"
+HOMEPAGE="https://github.com/tokiclover/hprofile"
+SRC_URI="https://github.com/tokiclover/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+src_prepare() {
+ sed -i '1s:.*:#!/sbin/runscript:' hprofile.initd || die
+ sed -i "/^prefix/s:=.*:=${EPREFIX}/usr:" Makefile || die
+}
diff --git a/sys-apps/hprofile/metadata.xml b/sys-apps/hprofile/metadata.xml
new file mode 100644
index 000000000000..09d45f09dc2f
--- /dev/null
+++ b/sys-apps/hprofile/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">tokiclover/hprofile</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/hwdata-gentoo/Manifest b/sys-apps/hwdata-gentoo/Manifest
new file mode 100644
index 000000000000..2688a68b424f
--- /dev/null
+++ b/sys-apps/hwdata-gentoo/Manifest
@@ -0,0 +1 @@
+DIST hwdata-gentoo-0.4.tar.bz2 149060 SHA256 f3bf3853f33cc20be56770f742428fb29ca97769c5984ad80093d2020136918e SHA512 dd62c51986c83ff5a9338fa20d98827cd44d86e808c9a2a52ff327dcdd941d0faed0ea4f85058485e8fc2f78e0c2fa18d3030e27fded8ed1777832ee789c189a WHIRLPOOL a7b35bf6a5b354f2483d6494a5c3f7a19fa9d61cbb6ad91528a12c947ae5562267c3552632bdb86204f494b8ab56ed583fd532bc928300262ef82d523f0b05d9
diff --git a/sys-apps/hwdata-gentoo/files/0.4-openchrome.patch b/sys-apps/hwdata-gentoo/files/0.4-openchrome.patch
new file mode 100644
index 000000000000..7b0c6e87c9d5
--- /dev/null
+++ b/sys-apps/hwdata-gentoo/files/0.4-openchrome.patch
@@ -0,0 +1,22 @@
+--- a/pcitable
++++ b/pcitable
+@@ -3688,7 +3688,7 @@
+ 0x1106 0x3336 "unknown" "VIA Technologies, Inc.|K8M890CE Host Bridge"
+ 0x1106 0x3337 "unknown" "VIA Technologies Inc.|VT8237A PCI to ISA Bridge"
+ 0x1106 0x3340 "unknown" "VIA Technologies, Inc.|PT900 Host Bridge"
+-0x1106 0x3344 "unknown" "VIA Technologies, Inc.|UniChrome Pro IGP"
++0x1106 0x3344 "Card:S3 UniChrome" "VIA Technologies, Inc.|UniChrome Pro IGP"
+ 0x1106 0x3349 "ahci" "VIA Technologies Inc.|VT8251 AHCI/SATA 4-Port Controller"
+ 0x1106 0x3351 "unknown" "VIA Technologies, Inc.|VT3351 Host Bridge"
+ 0x1106 0x3364 "unknown" "VIA Technologies, Inc.|P4M900 Host Bridge"
+--- a/Cards
++++ b/Cards
+@@ -429,7 +429,7 @@
+ DRIVER s3
+
+ NAME S3 UniChrome
+-DRIVER via
++DRIVER openchrome
+
+ NAME S3 ViRGE (generic)
+ DRIVER s3virge
diff --git a/sys-apps/hwdata-gentoo/hwdata-gentoo-0.4.ebuild b/sys-apps/hwdata-gentoo/hwdata-gentoo-0.4.ebuild
new file mode 100644
index 000000000000..cc99cc4d09ed
--- /dev/null
+++ b/sys-apps/hwdata-gentoo/hwdata-gentoo-0.4.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Data for the hwsetup program"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ http://wolf31o2.org/sources/hwdata/${P}.tar.bz2"
+HOMEPAGE="http://wolf31o2.org"
+
+IUSE="opengl binary-drivers"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86"
+SLOT="0"
+LICENSE="GPL-2"
+
+DEPEND="!sys-apps/hwdata-redhat"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-openchrome.patch
+
+ if use x86 || use amd64
+ then
+ if use opengl && use binary-drivers
+ then
+ continue
+ else
+ sed -e 's/DRIVER fglrx/DRIVER radeon/' \
+ -e 's/DRIVER nvidia/DRIVER nv/' \
+ -i "${S}"/Cards || die
+ fi
+ fi
+}
+
+src_install() {
+ dodoc ChangeLog check-cards
+ insinto /usr/share/hwdata
+ doins Cards MonitorsDB pcitable blacklist
+}
diff --git a/sys-apps/hwdata-gentoo/metadata.xml b/sys-apps/hwdata-gentoo/metadata.xml
new file mode 100644
index 000000000000..013854059a6a
--- /dev/null
+++ b/sys-apps/hwdata-gentoo/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>livecd</herd>
+<use>
+ <flag name='binary-drivers'>Adds support for ATI/NVIDIA binary
+ drivers</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/hwdata-redhat/Manifest b/sys-apps/hwdata-redhat/Manifest
new file mode 100644
index 000000000000..ea2ba5c3b767
--- /dev/null
+++ b/sys-apps/hwdata-redhat/Manifest
@@ -0,0 +1 @@
+DIST hwdata-0.217-1.fc9.src.rpm 735079 SHA256 f2b6f3223cb388b9ff261ca84ed93b9e5eba95be62b7377ff685708351d377ad
diff --git a/sys-apps/hwdata-redhat/files/hwdata-redhat-0.217-python-3.patch b/sys-apps/hwdata-redhat/files/hwdata-redhat-0.217-python-3.patch
new file mode 100644
index 000000000000..f16fddd992c4
--- /dev/null
+++ b/sys-apps/hwdata-redhat/files/hwdata-redhat-0.217-python-3.patch
@@ -0,0 +1,13 @@
+--- check-pci-ids.py
++++ check-pci-ids.py
+@@ -5,8 +5,8 @@
+
+ # Check that the sorting order is preserved in pci.ids
+
+-vendor_id = None
+-device_id = None
++vendor_id = -1
++device_id = -1
+ lineno = 1
+
+ file = open("pci.ids")
diff --git a/sys-apps/hwdata-redhat/hwdata-redhat-0.217.ebuild b/sys-apps/hwdata-redhat/hwdata-redhat-0.217.ebuild
new file mode 100644
index 000000000000..7c1d9740df22
--- /dev/null
+++ b/sys-apps/hwdata-redhat/hwdata-redhat-0.217.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic rpm
+
+# Tag for which Fedora Core version it's from
+FCVER="9"
+# Revision of the RPM. Shouldn't affect us, as we're just grabbing the source
+# tarball out of it
+RPMREV="1"
+
+MY_P="${P/-redhat}"
+DESCRIPTION="Hardware identification and configuration data"
+HOMEPAGE="http://fedora.redhat.com/projects/config-tools/"
+SRC_URI="mirror://fedora-dev/releases/9/Everything/source/SRPMS/${MY_P}-${RPMREV}.fc${FCVER}.src.rpm"
+LICENSE="GPL-2 MIT"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64 ~x86 ~amd64"
+IUSE="test"
+RDEPEND="virtual/modutils
+ !sys-apps/hwdata-gentoo"
+DEPEND="${RDEPEND}
+ test? ( sys-apps/pciutils )"
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ rpm_src_unpack ${A}
+
+ cd "${S}"
+ sed -i -e "s:\(/sbin\/lspci\):/usr\1:g" Makefile || die
+ epatch "${FILESDIR}/${P}-python-3.patch"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ # Don't let it overwrite a udev-installed file
+ rm -rf "${D}"/etc/ || die
+}
diff --git a/sys-apps/hwdata-redhat/metadata.xml b/sys-apps/hwdata-redhat/metadata.xml
new file mode 100644
index 000000000000..59e2b8f78cb5
--- /dev/null
+++ b/sys-apps/hwdata-redhat/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>
+ <name>Default assignee for orphaned packages</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/hwids/Manifest b/sys-apps/hwids/Manifest
new file mode 100644
index 000000000000..b267ad089830
--- /dev/null
+++ b/sys-apps/hwids/Manifest
@@ -0,0 +1,8 @@
+DIST hwids-20141010.tar.gz 1678967 SHA256 2e8d45ef56a086d2e432c05ae348584325f87353c154d3ede294bad5aeba0f27 SHA512 992314a03a745b5766ccbd86c169c67c03f05ffd36188b0a19e6e7c16be2897da820bca471408a2e3834021fab4a995a5316f45b251bf5cff21003f9ffe2e23f WHIRLPOOL f3af13cf659fc5195d3eb167221d9bf04f1431fd19d071d37f7a8c30a1e020589b4e337174f7c3b6985a4869d60618da88226b47f185679a7ffc42ef270a5820
+DIST hwids-20141110.tar.gz 1684662 SHA256 31145832799ff19bc654b2c227d732567d242f9f790ee14313ccec542d2f582f SHA512 c7fa1e38656ca02c5b316bad83590296dcc199985fc8a5a413b7ac46cef325bbb0a3aea60e2f1f250891b43cf38b0a8d477ef546e7cb13e06562fd1f31b23d4a WHIRLPOOL 2136bd4fb437da9d78b0610a1143e4becddc1949cbdad0b09b62314eb028c42a5af83c3b7b13122ce30bea34e9703be3ca819d315bbe75019bf8d7990501f49c
+DIST hwids-20141214.tar.gz 1688002 SHA256 1ff3f5da7745742332beb5636d8eb9083d916365bb308dc0b53f08607f63be6d SHA512 870fe4a553671d837c3f92641f96a0132398976280831a1ff8229b6836c50f6129108baa8fcc965fadd70ad86a77c7577e682e1c29078498b1d1a22099d0e4ef WHIRLPOOL fb94aee0c8c924216bcdbcc171121668b44911ff5b2a2d396b6c5e1172fa549652c56360a9689780a94b9a977f6a9b7ca657b25e9d1502f516bf0ca945613a0d
+DIST hwids-20150107.tar.gz 1709214 SHA256 9e38bb8b7b95be6040c29cb6ba1c109ca58f1feea352806b7387b642562751d9 SHA512 a20117fc41f49e62abd2a5b9f2e66ff1a81353fea8215c7aabc9a5f0918f56afde988e0eb9def87787ceb9e8d680b8f7cd7b225d2fa256294475f20a03ff3f12 WHIRLPOOL d66d7dd7e13304c867c2722947ae7f2bb472506849ed1887f2f1cce6c21d86153fda84aa94dbe0737844aa259ece0c6527abd02066fe62ec156987e5dc243a39
+DIST hwids-20150129.tar.gz 1707029 SHA256 33a7f4dbf14704076b0fe1d0052e86bb618e386a1ff18107097311df44f979d7 SHA512 f514a25aecbae06507580033b6c6a19f1f4e476ae63736080030682d59c31bba440fb9c0c7cca623fe1f5813f211826a2ba958e73f1e348df3fd074123ab4c52 WHIRLPOOL aab753061d6c12306380b03c3567254028b6e079b5c59d38a05d26b27d9d1c82adffc5f28ce01e623a338b7ff3f962a1220277d140caea2e511672d1173d17ae
+DIST hwids-20150417.tar.gz 1724883 SHA256 ef4d3e3f722ef7a2294af3e1c048c735cb0aa604259d54ed704dd7b8275c2569 SHA512 9acbf4ef7907e380bace30c38f1c2cf58e76cd68f258d59eb6d3b0e13287537205310f34783acd276cd7e7964b7f67eb7de8f636abf3419bf7bc9accb07e1761 WHIRLPOOL 33ca057faf1445409c563463271d67715077b27a7b402f2c91b82d893ff7b950e0443fb86611e9ec1d4118767e99d18ce40d9bc73bc1f471af69f163297f5b97
+DIST hwids-20150421.tar.gz 1726968 SHA256 2c3ced90c069392f1f6ccdf7a8541ea2c3d871c575b8b6b02129e62bcec6f6a4 SHA512 3418d48b4f9b2dcb6e221a07ab74c81004866b40aa9d7b5ab0b73d2ed1febbd9e4d3d2d76e0a0e3c9d71c4dd79767c1cffa346d68c91e8fb19bcef3baccb101c WHIRLPOOL 5427dcd0725a5dfc16af441b52ad0bad1bf770a2287f814c6f032b5696062b76b934ca6cf968f45addd5b197c66011da6ddfd3a4b9539103672e1b66d68fb262
+DIST hwids-20150717.tar.gz 1745565 SHA256 5a4769cd0e57a96c2693e7ec3d48f53e493afae58376a1f7124a08844632d917 SHA512 431a3a024512719ed5d53f21291de28bb5f904987fbeb8a90583517e24abcf5e19d9312819f02bcffbb42c0b16e761e4517575a600d1d8102f8373d1a21806d0 WHIRLPOOL 2ef9b880801d1ca94311104193e96f64eef58b7db86ee486614e80e63a1e9c42d9f940aadebd19c708ad0caab9a0be43ffcd44d9288bbce41238a64815d82076
diff --git a/sys-apps/hwids/hwids-20141010.ebuild b/sys-apps/hwids/hwids-20141010.ebuild
new file mode 100644
index 000000000000..c8c03e761ffc
--- /dev/null
+++ b/sys-apps/hwids/hwids-20141010.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20141110.ebuild b/sys-apps/hwids/hwids-20141110.ebuild
new file mode 100644
index 000000000000..70ea57aa9796
--- /dev/null
+++ b/sys-apps/hwids/hwids-20141110.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20141214.ebuild b/sys-apps/hwids/hwids-20141214.ebuild
new file mode 100644
index 000000000000..70ea57aa9796
--- /dev/null
+++ b/sys-apps/hwids/hwids-20141214.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150107.ebuild b/sys-apps/hwids/hwids-20150107.ebuild
new file mode 100644
index 000000000000..77be47870cd3
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150107.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150129.ebuild b/sys-apps/hwids/hwids-20150129.ebuild
new file mode 100644
index 000000000000..3d1604eda984
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150129.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150417.ebuild b/sys-apps/hwids/hwids-20150417.ebuild
new file mode 100644
index 000000000000..77be47870cd3
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150417.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150421-r1.ebuild b/sys-apps/hwids/hwids-20150421-r1.ebuild
new file mode 100644
index 000000000000..c68cf73b51e9
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150421-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+
+ # Create a rules file compatible with older udev.
+ sed -e 's/evdev:name/keyboard:name/' \
+ -e 's/evdev:atkbd:dmi/keyboard:dmi/' \
+ -e 's/evdev:input:b\([^v]*\)v\([^p]*\)p\([^e]*\)\(e.*\)\?/keyboard:usb:v\2p\3/' \
+ -e 's/keyboard:usb:v046DpC52D\*/keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00*/' \
+ -e 's/keyboard:usb:v0458p0708\*/keyboard:usb:v0458p0708d*dc*dsc*dp*ic*isc*ip*in01*/' \
+ udev/60-keyboard.hwdb > udev/61-oldkeyboard.hwdb || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150421.ebuild b/sys-apps/hwids/hwids-20150421.ebuild
new file mode 100644
index 000000000000..77be47870cd3
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150421.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150717-r1.ebuild b/sys-apps/hwids/hwids-20150717-r1.ebuild
new file mode 100644
index 000000000000..c68cf73b51e9
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150717-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+
+ # Create a rules file compatible with older udev.
+ sed -e 's/evdev:name/keyboard:name/' \
+ -e 's/evdev:atkbd:dmi/keyboard:dmi/' \
+ -e 's/evdev:input:b\([^v]*\)v\([^p]*\)p\([^e]*\)\(e.*\)\?/keyboard:usb:v\2p\3/' \
+ -e 's/keyboard:usb:v046DpC52D\*/keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00*/' \
+ -e 's/keyboard:usb:v0458p0708\*/keyboard:usb:v0458p0708d*dc*dsc*dp*ic*isc*ip*in01*/' \
+ udev/60-keyboard.hwdb > udev/61-oldkeyboard.hwdb || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-20150717.ebuild b/sys-apps/hwids/hwids-20150717.ebuild
new file mode 100644
index 000000000000..77be47870cd3
--- /dev/null
+++ b/sys-apps/hwids/hwids-20150717.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/hwids-99999999.ebuild b/sys-apps/hwids/hwids-99999999.ebuild
new file mode 100644
index 000000000000..c68cf73b51e9
--- /dev/null
+++ b/sys-apps/hwids/hwids-99999999.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit udev eutils
+
+DESCRIPTION="Hardware (PCI, USB, OUI, IAB) IDs databases"
+HOMEPAGE="https://github.com/gentoo/hwids"
+if [[ ${PV} == "99999999" ]]; then
+ EGIT_REPO_URI="${HOMEPAGE}.git"
+ inherit git-2
+else
+ SRC_URI="${HOMEPAGE}/archive/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+LICENSE="|| ( GPL-2 BSD ) public-domain"
+SLOT="0"
+IUSE="+net +pci +udev +usb"
+
+DEPEND="udev? (
+ dev-lang/perl
+ >=virtual/udev-206
+)"
+[[ ${PV} == "99999999" ]] && DEPEND+=" udev? ( net-misc/curl )"
+RDEPEND="!<sys-apps/pciutils-3.1.9-r2
+ !<sys-apps/usbutils-005-r1"
+
+S=${WORKDIR}/hwids-${P}
+
+src_prepare() {
+ [[ ${PV} == "99999999" ]] && emake fetch
+
+ sed -i -e '/udevadm hwdb/d' Makefile || die
+
+ # Create a rules file compatible with older udev.
+ sed -e 's/evdev:name/keyboard:name/' \
+ -e 's/evdev:atkbd:dmi/keyboard:dmi/' \
+ -e 's/evdev:input:b\([^v]*\)v\([^p]*\)p\([^e]*\)\(e.*\)\?/keyboard:usb:v\2p\3/' \
+ -e 's/keyboard:usb:v046DpC52D\*/keyboard:usb:v046DpC52Dd*dc*dsc*dp*ic*isc*ip*in00*/' \
+ -e 's/keyboard:usb:v0458p0708\*/keyboard:usb:v0458p0708d*dc*dsc*dp*ic*isc*ip*in01*/' \
+ udev/60-keyboard.hwdb > udev/61-oldkeyboard.hwdb || die
+}
+
+_emake() {
+ emake \
+ NET=$(usex net) \
+ PCI=$(usex pci) \
+ UDEV=$(usex udev) \
+ USB=$(usex usb) \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_install() {
+ _emake install \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ MISCDIR="${EPREFIX}/usr/share/misc" \
+ HWDBDIR="${EPREFIX}$(get_udevdir)/hwdb.d" \
+ DESTDIR="${D}"
+}
+
+pkg_postinst() {
+ if use udev; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ # http://cgit.freedesktop.org/systemd/systemd/commit/?id=1fab57c209035f7e66198343074e9cee06718bda
+ [ "${ROOT:-/}" = "/" ] && udevadm control --reload
+ fi
+}
diff --git a/sys-apps/hwids/metadata.xml b/sys-apps/hwids/metadata.xml
new file mode 100644
index 000000000000..75953f37c7c7
--- /dev/null
+++ b/sys-apps/hwids/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>gregkh@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="net">Install the oui.txt and iab.txt databases</flag>
+ <flag name="pci">Install the pci.ids database</flag>
+ <flag name="usb">Install the usb.ids database</flag>
+ <flag name="udev">Install hwdb.d rules for udev</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">gentoo/hwids</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/hwinfo/Manifest b/sys-apps/hwinfo/Manifest
new file mode 100644
index 000000000000..693c239102e3
--- /dev/null
+++ b/sys-apps/hwinfo/Manifest
@@ -0,0 +1,3 @@
+DIST hwinfo-19.1-1.2.src.rpm 740650 SHA256 77b67512f7a7a027200233b6c89be2b777f96b2a6d742b695cb062f9cf4ec258 SHA512 1e617cac0e2d1872f26ad15b0a4b34474d5e0cc4a9fa715de04b54b829d73b0f54fea99765bf795d759e01e3a84c868149e4e035bef59dcfcc628faa365fee31 WHIRLPOOL e676962b3a1939a575e74372da441b22c15d32745654ba0f8e2420f0687f3e48c355388a2922ddfb07e44396fc5e0100b655ada97eaaaeb9ea53f4d72db99f95
+DIST hwinfo-20.0-1.4.src.rpm 741036 SHA256 466423b00fda00bc5e927352fb8d2f52b4d4e4b298401cd44c48231951c2a26b SHA512 e44dcc0c826630d75b2604f99f6b0ae6c203a52266c2c7e220989424d7a4c99dc34f6157d6e4d385404c0eade3f943f77ddbf007d83b76f132eada6b4bf68cb3 WHIRLPOOL 5a8e56bbf6ab8aa585ff9774d2870f8fb917a3803614795d542bb76862dde72bdc54205b35f0b0a78ff004cd740e10a23916d412c553b95382b2bec9161c54d9
+DIST hwinfo-21.4-1.1.src.rpm 781525 SHA256 8109cf0cc8706b0361be6a9f18ee79fc6a16451c5a7982aed22ae811748d1728 SHA512 bccac7749751924e1e1a8005e6fd783da7114926b6d9b9a1247b3b26dd680848eb2b85b368c312d08b444c8d7b75036d249daf33afc5b7efbbcc09bfbad4b340 WHIRLPOOL e1ce3140a4729006dd7c6e0c7dd7db41596819bcc7a51b774a463dd100e05c9bc5dc0d031b88047bd1d7d93015ab25cc3f769983f8ff14427f96890614b7324a
diff --git a/sys-apps/hwinfo/hwinfo-19.1.ebuild b/sys-apps/hwinfo/hwinfo-19.1.ebuild
new file mode 100644
index 000000000000..512577e1ec6c
--- /dev/null
+++ b/sys-apps/hwinfo/hwinfo-19.1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit multilib rpm toolchain-funcs
+
+DESCRIPTION="hardware detection tool used in SuSE Linux"
+HOMEPAGE="http://www.opensuse.org/"
+SRC_URI="http://download.opensuse.org/source/factory/repo/oss/suse/src/${P}-1.2.src.rpm"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="amd64? ( dev-libs/libx86emu )
+ x86? ( dev-libs/libx86emu )"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.17"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+src_prepare() {
+ # Respect AR variable.
+ sed -i \
+ -e 's:ar r:$(AR) r:' \
+ src/{,isdn,ids,smp,hd}/Makefile || die
+
+ # Avoid -I directories for dbus because HAL is obsolete.
+ sed -i -e '/CFLAGS/d' src/hd/Makefile || die
+ # Respect LDFLAGS.
+ sed -i -e 's:$(CC) -shared:& $(LDFLAGS):' src/Makefile || die
+ sed -i -e 's:$(CC) $(CFLAGS):$(CC) $(LDFLAGS) $(CFLAGS):' src/ids/Makefile || die
+
+ # Respect MAKE variable. Skip forced -pipe and -g. Respect LDFLAGS.
+ sed -i \
+ -e 's:make:$(MAKE):' \
+ -e 's:-pipe -g::' \
+ -e 's:LDFLAGS.*=:LDFLAGS +=:' \
+ Makefile{,.common} || die
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" RPM_OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
+
+ dodoc changelog README
+ doman doc/hwinfo.8
+ insinto /usr/share/doc/${PF}/examples
+ doins doc/example*.c
+}
diff --git a/sys-apps/hwinfo/hwinfo-20.0.ebuild b/sys-apps/hwinfo/hwinfo-20.0.ebuild
new file mode 100644
index 000000000000..b69431b2a6ff
--- /dev/null
+++ b/sys-apps/hwinfo/hwinfo-20.0.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit multilib rpm toolchain-funcs
+
+DESCRIPTION="hardware detection tool used in SuSE Linux"
+HOMEPAGE="http://www.opensuse.org/"
+SRC_URI="http://download.opensuse.org/source/factory/repo/oss/suse/src/${P}-1.4.src.rpm"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="amd64? ( dev-libs/libx86emu )
+ x86? ( dev-libs/libx86emu )"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.17"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+src_prepare() {
+ # Respect AR variable.
+ sed -i \
+ -e 's:ar r:$(AR) r:' \
+ src/{,isdn,ids,smp,hd}/Makefile || die
+
+ # Avoid -I directories for dbus because HAL is obsolete.
+ sed -i -e '/CFLAGS/d' src/hd/Makefile || die
+ # Respect LDFLAGS.
+ sed -i -e 's:$(CC) -shared:& $(LDFLAGS):' src/Makefile || die
+ sed -i -e 's:$(CC) $(CFLAGS):$(CC) $(LDFLAGS) $(CFLAGS):' src/ids/Makefile || die
+
+ # Use linux/pci.h directly. #506876
+ sed -i \
+ -e '/#include.*sys\/pci.h/s:sys/pci.h:linux/pci.h:' \
+ src/hd/*.c || die
+
+ # Respect MAKE variable. Skip forced -pipe and -g. Respect LDFLAGS.
+ sed -i \
+ -e 's:make:$(MAKE):' \
+ -e 's:-pipe -g::' \
+ -e 's:LDFLAGS.*=:LDFLAGS +=:' \
+ Makefile{,.common} || die
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" RPM_OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
+
+ dodoc changelog README
+ doman doc/hwinfo.8
+ insinto /usr/share/doc/${PF}/examples
+ doins doc/example*.c
+}
diff --git a/sys-apps/hwinfo/hwinfo-21.4.ebuild b/sys-apps/hwinfo/hwinfo-21.4.ebuild
new file mode 100644
index 000000000000..bd2364da856b
--- /dev/null
+++ b/sys-apps/hwinfo/hwinfo-21.4.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib rpm toolchain-funcs
+
+DESCRIPTION="hardware detection tool used in SuSE Linux"
+HOMEPAGE="http://www.opensuse.org/"
+SRC_URI="http://download.opensuse.org/source/factory/repo/oss/suse/src/${P}-1.1.src.rpm"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ amd64? ( dev-libs/libx86emu )
+ x86? ( dev-libs/libx86emu )"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.17"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+src_prepare() {
+ # Respect AR variable.
+ sed -i \
+ -e 's:ar r:$(AR) r:' \
+ src/{,isdn,ids,smp,hd}/Makefile || die
+
+ # Avoid -I directories for dbus because HAL is obsolete.
+ sed -i -e '/CFLAGS/d' src/hd/Makefile || die
+ # Respect LDFLAGS.
+ sed -i -e 's:$(CC) -shared:& $(LDFLAGS):' src/Makefile || die
+ sed -i -e 's:$(CC) $(CFLAGS):$(CC) $(LDFLAGS) $(CFLAGS):' src/ids/Makefile || die
+
+ # Use linux/pci.h directly. #506876
+ sed -i \
+ -e '/#include.*sys\/pci.h/s:sys/pci.h:linux/pci.h:' \
+ src/hd/*.c || die
+
+ # Respect MAKE variable. Skip forced -pipe and -g. Respect LDFLAGS.
+ sed -i \
+ -e 's:make:$(MAKE):' \
+ -e 's:-pipe -g::' \
+ -e 's:LDFLAGS.*=:LDFLAGS +=:' \
+ Makefile{,.common} || die
+}
+
+src_compile() {
+ tc-export AR
+ emake CC="$(tc-getCC)" RPM_OPT_FLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
+
+ dodoc changelog README
+ doman doc/*.{1,8}
+ insinto /usr/share/doc/${PF}/examples
+ doins doc/example*.c
+}
diff --git a/sys-apps/hwinfo/metadata.xml b/sys-apps/hwinfo/metadata.xml
new file mode 100644
index 000000000000..557ca512951a
--- /dev/null
+++ b/sys-apps/hwinfo/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>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/hwloc/Manifest b/sys-apps/hwloc/Manifest
new file mode 100644
index 000000000000..a8d4c309c8e2
--- /dev/null
+++ b/sys-apps/hwloc/Manifest
@@ -0,0 +1,7 @@
+DIST hwloc-1.10.0.tar.bz2 3765051 SHA256 b765f72507cf1cc98b398e0ec85b8f30e640bf1cd0a886c286d0b70d648d7be3 SHA512 0f1c011dbafbd4a78566b2ebc26b1c91a0e091e041f6e7996cea6812aeefd7fe4e8e7cb688634157c721dd9deea48ca32de823f8a9e0a1c341853b925a9c89c0 WHIRLPOOL a3eb47450f9e3fc97cb484ad4cab93f4eab10c5039da113029a0e918f654a878f44a9460b4606616d43580ea56ba21fc54ab4fc671b290f480e2e19514e524d7
+DIST hwloc-1.10.1.tar.bz2 3771665 SHA256 35ce13a9a0737d2de1c6facb5c3c0438f7c83b45d6ce652e05ba000f6f2e514a SHA512 47cc1f084730021996ae0c18996e13dde5b991004fe9160bc1e118b6cb0288fe5d65d149450f05bd7b9e13bd6f16dfe82181d1e731dd1b0e46a43fd4435850cc WHIRLPOOL b7e089c1de3f967295768dc2dbc6acec80fa99f66d9340cedf3b02c1d2e869a339fa9fdd71a5f8ef77554ec8622a246abae6ca5f41354790bf09bf2d0d8236d7
+DIST hwloc-1.6.1.tar.bz2 3075453 SHA256 8bb0a13d70852442cfce8883a99113e9238e187a91b3160279e260a10048057b SHA512 9bf613c35e27d7e0e7e4aee39602e949dd035c84ceab37a716c48d9be25f319cd7888448c9771e8a8408dcf958370e9b54f7e1f764349fa5d39c2bd4358032ff WHIRLPOOL a319c94d306e18bd0f9a721eb637df667fc0831e2c84770255736205ba30abb9cc18e4b401cbbd3c419369b1c3aae638253bb826e973ff6c763a233c9c986742
+DIST hwloc-1.6.2.tar.bz2 3066020 SHA256 fd4d47738afc9c5f60d2c35f0963f82feb78bb57f2bc239e84e93ad376169df1 SHA512 3e1a0b28f6f867c82c8d61110afc07cb0019fb8d4284a171cef36346ea9746acab11250f7f382260f8f40d3c28c2517b24f2a222427cb2951149a58a30cb0990 WHIRLPOOL 7f2a9a58f4f7b1aae18f6d50338553eaa8c26e0cd54add29395e8366cfb076ec4e790b3411978c581da1b67342ad14443040e08a766e727a7cf9b27530e356f1
+DIST hwloc-1.7.2.tar.bz2 3165052 SHA256 a0b40c01eead1d4c254ab87c2ec75b8eeb9877331763fbd1e1b81990ad566848 SHA512 e6472fb0639a178683ea7bbef666255a73c1962c360d22490e4aee6642da1d30648d2f057e11b529d91bf76da05d47632331d84dd0a7771c5732cc7cc90e7d7c WHIRLPOOL 6f39a871777e28cfb1f87f6a5c9c7ef02a31bf4a8178f7eeb43ec9eeef42132c8d432d803e66198129017f68228e3aa738a774665d0e8400f5617af81cc61f7c
+DIST hwloc-1.8.1.tar.bz2 3647451 SHA256 976d1edb3ad141e3510c959fb47f415acc95a90170b361b390768512f30ca10d SHA512 3ef7db6e41186b1a3dd2df717d599813401a31f696530ca4196689c85ff8a18ef6f5a11be7feb656e49e0047058beb759c995d9b8a422367d99c52ae5274ee77 WHIRLPOOL 471796a5c32b6582b6b89cff24889826e63a6ed5e75bb3084c749d73b649fa562aa8272889f2218af35cfc93012bd05504017ae7f25447270363c9c7b85638c8
+DIST hwloc-1.9.tar.bz2 3682256 SHA256 24a81ff1c3810f16633bf5ad3fb80cbbaf882e466a788af4301b2911698c4f7e SHA512 6697f02c954525ae6b24fb22e738b8b8383f33bbd941ab757829e7406a96f037edc2841fb50335ec26bc53573e00bf9295c2e8d574b7b3bb687c02189d87fd74 WHIRLPOOL 4eb9d0bfb5c615577f4b2debd49d5c042c4b844362aaac6d757b2ab10d845aeeb9c918e2153d32d51ecb88b9d1fc0818fe1a2a90eed3413d7de88c9ab568929e
diff --git a/sys-apps/hwloc/files/hwloc-1.8.1-gl.patch b/sys-apps/hwloc/files/hwloc-1.8.1-gl.patch
new file mode 100644
index 000000000000..47daa9593377
--- /dev/null
+++ b/sys-apps/hwloc/files/hwloc-1.8.1-gl.patch
@@ -0,0 +1,11 @@
+--- hwloc-1.8.1/config/hwloc.m4.orig 2014-01-30 17:46:58.000000000 +0400
++++ hwloc-1.8.1/config/hwloc.m4 2014-02-27 13:46:28.587238873 +0400
+@@ -948,7 +948,7 @@
+ hwloc_gl_happy=no])
+
+ AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [
+- AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryTargetAttribute], [:], [hwloc_gl_happy=no], [-lXext])
++ AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryTargetAttribute], [:], [hwloc_gl_happy=no], [-lXext -lX11])
+ ], [hwloc_gl_happy=no])
+
+ if test "x$hwloc_gl_happy" = "xyes"; then
diff --git a/sys-apps/hwloc/files/hwloc-gather-topology-fix-lstopo-path-after-install.patch b/sys-apps/hwloc/files/hwloc-gather-topology-fix-lstopo-path-after-install.patch
new file mode 100644
index 000000000000..f383b3ab3a7a
--- /dev/null
+++ b/sys-apps/hwloc/files/hwloc-gather-topology-fix-lstopo-path-after-install.patch
@@ -0,0 +1,26 @@
+From 6d42748f8604f3c1d0ca6cf122e8776b3c153ac4 Mon Sep 17 00:00:00 2001
+From: Brice Goglin <Brice.Goglin@inria.fr>
+Date: Thu, 12 Mar 2015 10:01:13 +0100
+Subject: [PATCH] hwloc-gather-topology: fix lstopo path after install
+
+Broken when utils moved to utils/ subdirectories.
+
+(cherry picked from commit 0a32f719c48fb7dabf4882f8f2477017c25b15a9)
+---
+ NEWS | 1 +
+ tests/linux/Makefile.am | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/linux/Makefile.am b/tests/linux/Makefile.am
+index f0a2f8a..27c261a 100644
+--- a/tests/linux/Makefile.am
++++ b/tests/linux/Makefile.am
+@@ -171,7 +171,7 @@ LOG_COMPILER = $(builddir)/test-topology.sh
+ bin_SCRIPTS = hwloc-gather-topology
+
+ install-exec-hook:
+- $(SED) -e 's/HWLOC_top_builddir\/utils/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp $(DESTDIR)$(bindir)/hwloc-gather-topology
++ $(SED) -e 's/HWLOC_top_builddir\/utils\/lstopo/bindir/' -e '/HWLOC_top_builddir/d' $(DESTDIR)$(bindir)/hwloc-gather-topology > $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp && mv -f $(DESTDIR)$(bindir)/hwloc-gather-topology.tmp $(DESTDIR)$(bindir)/hwloc-gather-topology
+ chmod +x $(DESTDIR)$(bindir)/hwloc-gather-topology
+
+ SUBDIRS = gather
diff --git a/sys-apps/hwloc/hwloc-1.10.0-r2.ebuild b/sys-apps/hwloc/hwloc-1.10.0-r2.ebuild
new file mode 100644
index 000000000000..59925c4ebf8e
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.10.0-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic cuda autotools-utils multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0/5"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="cairo cuda debug gl +numa opencl +pci plugins svg static-libs xml X"
+
+# TODO opencl only works with AMD so no virtual
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ cuda? ( dev-util/nvidia-cuda-toolkit )
+ gl? ( media-video/nvidia-settings )
+ opencl? ( x11-drivers/ati-drivers )
+ pci? (
+ sys-apps/pciutils
+ x11-libs/libpciaccess
+ )
+ plugins? ( dev-libs/libltdl:0 )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+PATCHES=( "${FILESDIR}/${PN}-1.8.1-gl.patch" )
+AUTOTOOLS_AUTORECONF=1
+
+src_prepare() {
+ if use cuda ; then
+ append-cflags -I/opt/cuda/include
+ append-cppflags -I/opt/cuda/include
+ append-ldflags -L/opt/cuda/$(get_libdir)
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ local myeconfargs=(
+ --disable-silent-rules
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable cairo)
+ $(use_enable cuda)
+ $(use_enable debug)
+ $(use_enable gl)
+ $(use_enable opencl)
+ $(use_enable pci)
+ $(use_enable plugins)
+ $(use_enable numa libnuma)
+ $(use_enable xml libxml2)
+ $(use_with X x)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ # Fixed by upstream, but it seems overkill to require an autoregen for what
+ # is just a sed fix.
+ # https://github.com/open-mpi/hwloc/commit/6d42748f8604f3c1d0ca6cf122e8776b3c153ac4?diff=unified
+ sed -i 's|bindir/lstopo/|bindir/|' "${ED}"/usr/bin/hwloc-gather-topology || die
+}
diff --git a/sys-apps/hwloc/hwloc-1.10.0.ebuild b/sys-apps/hwloc/hwloc-1.10.0.ebuild
new file mode 100644
index 000000000000..7820cb16d767
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.10.0.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic cuda autotools-utils multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0/5"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="cairo cuda debug gl +numa opencl +pci plugins svg static-libs xml X"
+
+# TODO opencl only works with AMD so no virtual
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ cuda? ( dev-util/nvidia-cuda-toolkit )
+ gl? ( media-video/nvidia-settings )
+ opencl? ( x11-drivers/ati-drivers )
+ pci? (
+ sys-apps/pciutils
+ x11-libs/libpciaccess
+ )
+ plugins? ( sys-devel/libtool )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+PATCHES=( "${FILESDIR}/${PN}-1.8.1-gl.patch" )
+AUTOTOOLS_AUTORECONF=1
+
+src_prepare() {
+ if use cuda ; then
+ append-cflags -I/opt/cuda/include
+ append-cppflags -I/opt/cuda/include
+ append-ldflags -L/opt/cuda/$(get_libdir)
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ local myeconfargs=(
+ --disable-silent-rules
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable cairo)
+ $(use_enable cuda)
+ $(use_enable debug)
+ $(use_enable gl)
+ $(use_enable opencl)
+ $(use_enable pci)
+ $(use_enable plugins)
+ $(use_enable numa libnuma)
+ $(use_enable xml libxml2)
+ $(use_with X x)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+}
diff --git a/sys-apps/hwloc/hwloc-1.10.1-r1.ebuild b/sys-apps/hwloc/hwloc-1.10.1-r1.ebuild
new file mode 100644
index 000000000000..0f9d22c762ef
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.10.1-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic cuda autotools-multilib multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0/5"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="cairo cuda debug gl +numa opencl +pci plugins svg static-libs xml X"
+
+# TODO opencl only works with AMD so no virtual
+# dev-util/nvidia-cuda-toolkit is always multilib
+
+RDEPEND=">=sys-libs/ncurses-5.9-r3[${MULTILIB_USEDEP}]
+ cairo? ( >=x11-libs/cairo-1.12.14-r4[X?,svg?,${MULTILIB_USEDEP}] )
+ cuda? ( >=dev-util/nvidia-cuda-toolkit-6.5.19-r1 )
+ gl? ( media-video/nvidia-settings )
+ opencl? ( x11-drivers/ati-drivers:* )
+ pci? (
+ >=sys-apps/pciutils-3.3.0-r2[${MULTILIB_USEDEP}]
+ >=x11-libs/libpciaccess-0.13.1-r1[${MULTILIB_USEDEP}]
+ )
+ plugins? ( dev-libs/libltdl:0[${MULTILIB_USEDEP}] )
+ numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )
+ xml? ( >=dev-libs/libxml2-2.9.1-r4[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.8.1-gl.patch"
+ "${FILESDIR}/hwloc-gather-topology-fix-lstopo-path-after-install.patch"
+)
+AUTOTOOLS_AUTORECONF=1
+
+src_prepare() {
+ if use cuda ; then
+ append-cflags -I/opt/cuda/include
+ append-cppflags -I/opt/cuda/include
+ fi
+ autotools-utils_src_prepare
+}
+
+multilib_src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ use cuda && local LDFLAGS="${LDFLAGS} -L/opt/cuda/$(get_libdir)"
+ local myeconfargs=(
+ --disable-silent-rules
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable cairo)
+ $(use_enable cuda)
+ $(use_enable debug)
+ $(multilib_native_use_enable gl)
+ $(multilib_native_use_enable opencl)
+ $(use_enable pci)
+ $(use_enable plugins)
+ $(use_enable numa libnuma)
+ $(use_enable xml libxml2)
+ $(use_with X x)
+ )
+ autotools-utils_src_configure
+}
diff --git a/sys-apps/hwloc/hwloc-1.6.1.ebuild b/sys-apps/hwloc/hwloc-1.6.1.ebuild
new file mode 100644
index 000000000000..49b310691104
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.6.1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux"
+IUSE="cairo debug +numa +pci plugins svg static-libs xml X"
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ pci? ( sys-apps/pciutils )
+ plugins? ( sys-devel/libtool )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable cairo) \
+ $(use_enable debug) \
+ $(use_enable pci) \
+ $(use_enable plugins) \
+ $(use_enable numa libnuma) \
+ $(use_enable static-libs static) \
+ $(use_enable xml libxml2) \
+ $(use_with X x) \
+ --disable-silent-rules
+}
+
+src_install() {
+ default
+ if ! use static-libs; then
+ rm "${D}"/usr/$(get_libdir)/lib${PN}.la
+ use plugins && rm -f "${D}"/usr/$(get_libdir)/${PN}/*.la
+ fi
+}
diff --git a/sys-apps/hwloc/hwloc-1.6.2.ebuild b/sys-apps/hwloc/hwloc-1.6.2.ebuild
new file mode 100644
index 000000000000..d88a63c7fe58
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.6.2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux"
+IUSE="cairo debug +numa +pci plugins svg static-libs xml X"
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ pci? (
+ sys-apps/pciutils
+ x11-libs/libpciaccess
+ )
+ plugins? ( sys-devel/libtool )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable cairo) \
+ $(use_enable debug) \
+ $(use_enable pci) \
+ $(use_enable pci libpci) \
+ $(use_enable plugins) \
+ $(use_enable numa libnuma) \
+ $(use_enable static-libs static) \
+ $(use_enable xml libxml2) \
+ $(use_with X x) \
+ --disable-silent-rules
+}
+
+src_install() {
+ default
+ if ! use static-libs; then
+ rm "${D}"/usr/$(get_libdir)/lib${PN}.la
+ use plugins && rm -f "${D}"/usr/$(get_libdir)/${PN}/*.la
+ fi
+}
diff --git a/sys-apps/hwloc/hwloc-1.7.2.ebuild b/sys-apps/hwloc/hwloc-1.7.2.ebuild
new file mode 100644
index 000000000000..f28b21554d11
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.7.2.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 flag-o-matic multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux"
+IUSE="cairo cuda debug gl +numa opencl +pci plugins svg static-libs xml X"
+
+# TODO opencl only works with AMD so no virtual
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ cuda? ( dev-util/nvidia-cuda-toolkit )
+ gl? ( media-video/nvidia-settings )
+ opencl? ( x11-drivers/ati-drivers )
+ pci? (
+ sys-apps/pciutils
+ x11-libs/libpciaccess
+ )
+ plugins? ( sys-devel/libtool )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+src_prepare() {
+ if use cuda ; then
+ append-cflags -I/opt/cuda/include
+ append-cppflags -I/opt/cuda/include
+ append-ldflags -L/opt/cuda/$(get_libdir)
+ fi
+}
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable cairo) \
+ $(use_enable cuda) \
+ $(use_enable debug) \
+ $(use_enable gl) \
+ $(use_enable opencl) \
+ $(use_enable pci) \
+ $(use_enable pci libpci) \
+ $(use_enable plugins) \
+ $(use_enable numa libnuma) \
+ $(use_enable static-libs static) \
+ $(use_enable xml libxml2) \
+ $(use_with X x) \
+ --disable-silent-rules
+}
+
+src_install() {
+ default
+ if ! use static-libs; then
+ rm "${D}"/usr/$(get_libdir)/lib${PN}.la
+ use plugins && rm -f "${D}"/usr/$(get_libdir)/${PN}/*.la
+ fi
+}
diff --git a/sys-apps/hwloc/hwloc-1.8.1.ebuild b/sys-apps/hwloc/hwloc-1.8.1.ebuild
new file mode 100644
index 000000000000..9bfbd90e2f4a
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.8.1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic cuda autotools-utils multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0/5"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="cairo cuda debug gl +numa opencl +pci plugins svg static-libs xml X"
+
+# TODO opencl only works with AMD so no virtual
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ cuda? ( dev-util/nvidia-cuda-toolkit )
+ gl? ( media-video/nvidia-settings )
+ opencl? ( x11-drivers/ati-drivers )
+ pci? (
+ sys-apps/pciutils
+ x11-libs/libpciaccess
+ )
+ plugins? ( sys-devel/libtool )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+PATCHES=( "${FILESDIR}/${P}-gl.patch" )
+AUTOTOOLS_AUTORECONF=1
+
+src_prepare() {
+ if use cuda ; then
+ append-cflags -I/opt/cuda/include
+ append-cppflags -I/opt/cuda/include
+ append-ldflags -L/opt/cuda/$(get_libdir)
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ local myeconfargs=(
+ --disable-silent-rules
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable cairo)
+ $(use_enable cuda)
+ $(use_enable debug)
+ $(use_enable gl)
+ $(use_enable opencl)
+ $(use_enable pci)
+ $(use_enable pci libpci)
+ $(use_enable plugins)
+ $(use_enable numa libnuma)
+ $(use_enable xml libxml2)
+ $(use_with X x)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+}
diff --git a/sys-apps/hwloc/hwloc-1.9.ebuild b/sys-apps/hwloc/hwloc-1.9.ebuild
new file mode 100644
index 000000000000..e589dac9c507
--- /dev/null
+++ b/sys-apps/hwloc/hwloc-1.9.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic cuda autotools-utils multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="displays the hardware topology in convenient formats"
+HOMEPAGE="http://www.open-mpi.org/projects/hwloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0/5"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="cairo cuda debug gl +numa opencl +pci plugins svg static-libs xml X"
+
+# TODO opencl only works with AMD so no virtual
+
+RDEPEND="sys-libs/ncurses
+ cairo? ( x11-libs/cairo[X?,svg?] )
+ cuda? ( dev-util/nvidia-cuda-toolkit )
+ gl? ( media-video/nvidia-settings )
+ opencl? ( x11-drivers/ati-drivers )
+ pci? (
+ sys-apps/pciutils
+ x11-libs/libpciaccess
+ )
+ plugins? ( sys-devel/libtool )
+ numa? ( sys-process/numactl )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS NEWS README VERSION )
+
+PATCHES=( "${FILESDIR}/${PN}-1.8.1-gl.patch" )
+AUTOTOOLS_AUTORECONF=1
+
+src_prepare() {
+ if use cuda ; then
+ append-cflags -I/opt/cuda/include
+ append-cppflags -I/opt/cuda/include
+ append-ldflags -L/opt/cuda/$(get_libdir)
+ fi
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ export HWLOC_PKG_CONFIG=$(tc-getPKG_CONFIG) #393467
+ local myeconfargs=(
+ --disable-silent-rules
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+ $(use_enable cairo)
+ $(use_enable cuda)
+ $(use_enable debug)
+ $(use_enable gl)
+ $(use_enable opencl)
+ $(use_enable pci)
+ $(use_enable pci libpci)
+ $(use_enable plugins)
+ $(use_enable numa libnuma)
+ $(use_enable xml libxml2)
+ $(use_with X x)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+}
diff --git a/sys-apps/hwloc/metadata.xml b/sys-apps/hwloc/metadata.xml
new file mode 100644
index 000000000000..1c247acae257
--- /dev/null
+++ b/sys-apps/hwloc/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>cluster</herd>
+<longdescription>
+ The Portable Hardware Locality (hwloc) software package provides a portable abstraction
+ (across OS, versions, architectures, ...) of the hierarchical topology of modern architectures,
+ including NUMA memory nodes, sockets, shared caches, cores and simultaneous multithreading.
+ It also gathers various system attributes such as cache and memory information.
+ It primarily aims at helping applications with gathering information about modern computing
+ hardware so as to exploit it accordingly and efficiently.
+</longdescription>
+<use>
+ <flag name='cuda'>Enable CUDA device discovery</flag>
+ <flag name='gl'>Enable GL display device discovery (NVCtrl)</flag>
+ <flag name='numa'>Add support for numa memory allocation</flag>
+ <flag name='opencl'>Enable OpenCL device discovery (AMD only)</flag>
+ <flag name='pci'>Enable PCI device discovery using libpci</flag>
+ <flag name='plugins'>Build hwloc components as plugins so that the hwloc core library does not directly depend on their dependencies (for instance the libpci library)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/hwsetup/Manifest b/sys-apps/hwsetup/Manifest
new file mode 100644
index 000000000000..f38729f843fb
--- /dev/null
+++ b/sys-apps/hwsetup/Manifest
@@ -0,0 +1 @@
+DIST hwsetup_1.2-7.tar.gz 10706 SHA256 aa72b37ce306b5191cabd31eb5f19ab2a5e635697a263c6735d10c7bf99f9589 SHA512 ef252c748ecf1fc17d107fa413a76df5d9daab84b10eb1ca2c5c320207e0be522c4ae6204c1c85c613403e40312c9c876bcab04eeaa1a2e1724b7bb1c6d41a1e WHIRLPOOL 083111b1aa8d3fd547b25fe16fcf10929ed65effbdf5d566a18d652ee339392c335d93d8605e9b52aa9403da9e9c6a2c209f6f317f8e25f218487f867e25184c
diff --git a/sys-apps/hwsetup/files/1.2-3-fastprobe.patch b/sys-apps/hwsetup/files/1.2-3-fastprobe.patch
new file mode 100644
index 000000000000..600b8c4002d6
--- /dev/null
+++ b/sys-apps/hwsetup/files/1.2-3-fastprobe.patch
@@ -0,0 +1,74 @@
+--- a/hwsetup.c
++++ b/hwsetup.c
+@@ -140,14 +140,15 @@
+
+ int syntax(char *option)
+ {
+- printf(VERSION);
++ puts(VERSION);
+ if(option) fprintf(stderr,"hwsetup: Unknown option '%s'\n\n",option);
+- printf("Usage: hwsetup\n"
+- " -v be verbose\n"
+- " -p print rotating prompt\n"
+- " -a ignore audio devices\n"
+- " -s ignore scsi controllers\n"
+- " -n probe only, don't configure anything.\n");
++ puts("Usage: hwsetup\n"
++ "\t\t-v\tbe verbose\n"
++ "\t\t-p\tprint rotating prompt\n"
++ "\t\t-a\tignore audio devices\n"
++ "\t\t-s\tignore scsi controllers\n"
++ "\t\t-n\tprobe only, don't configure anything.\n"
++ "\t\t-f\trun a fast probe.");
+ return option?1:0;
+ }
+
+@@ -425,7 +426,7 @@
+ {
+ signal(SIGALRM,SIG_IGN);
+ fprintf(stderr,"\nWARNING: Autodetection seems to hang,\n"
+- "please check your computers BIOS settings.\n");
++ "please check your computer's BIOS settings.\n");
+ fflush(stderr);
+ if(wpid) { kill(wpid,SIGTERM); usleep(2500000); kill(wpid,SIGKILL); wpid=0; }
+ exit(1); /* exit program */
+@@ -591,12 +592,13 @@
+ return 0;
+ }
+
+-int hw_setup(enum deviceClass dc, int verbose, int probeonly, int skip)
++int hw_setup(enum deviceClass dc, int verbose, int probeonly, int skip, int fastprobe)
+ {
+ int i,mouse=0,cdrom=0,modem=0,scanner=0;
++ int probeopt=fastprobe?PROBE_SAFE:PROBE_ALL;
+ struct device **currentDevs, *d, *serialmouse=NULL, *usbmouse=NULL;
+ if(verbose&VERBOSE_PROMPT) wpid=startwheel();
+- currentDevs=probeDevices(dc,BUS_UNSPEC,PROBE_ALL);
++ currentDevs=probeDevices(dc,BUS_UNSPEC,probeopt);
+ if(verbose&VERBOSE_PROMPT&&wpid>0) { kill(wpid,SIGTERM); wpid=0; usleep(160000); write(2,"\033[0m Done.\n",11); }
+ if(currentDevs==NULL) return -1;
+ check_proc_modules(); /* Get currently loaded module list */
+@@ -650,7 +652,7 @@
+
+ int main(int argc, char **argv)
+ {
+- int i, verbose=0, probeonly=0, skip=0;
++ int i, verbose=0, probeonly=0, skip=0, fast=0;
+ enum deviceClass dc=CLASS_UNSPEC;
+ for(i=1;i<argc;i++)
+ {
+@@ -659,6 +661,7 @@
+ else if(!strcasecmp(argv[i],"-a")) skip|=SKIP_AUDIO;
+ else if(!strcasecmp(argv[i],"-s")) skip|=SKIP_SCSI;
+ else if(!strcasecmp(argv[i],"-n")) probeonly=1;
++ else if(!strcasecmp(argv[i],"-f")) fast=1;
+ else return syntax(argv[i]);
+ }
+ /* Allow SIGTERM, SIGINT: rmmod depends on this. */
+@@ -667,5 +670,5 @@
+ #ifdef BLACKLIST
+ gen_blacklist();
+ #endif
+- return hw_setup(dc,verbose,probeonly,skip);
++ return hw_setup(dc,verbose,probeonly,skip,fast);
+ }
diff --git a/sys-apps/hwsetup/files/1.2-7-dyn_blacklist.patch b/sys-apps/hwsetup/files/1.2-7-dyn_blacklist.patch
new file mode 100644
index 000000000000..efbe0f6abfed
--- /dev/null
+++ b/sys-apps/hwsetup/files/1.2-7-dyn_blacklist.patch
@@ -0,0 +1,62 @@
+--- a/hwsetup.c
++++ b/hwsetup.c
+@@ -51,13 +51,40 @@
+ /* Do not, under any circumstances, load these modules automatically, */
+ /* even if in pcitable. (libkudzu may ignore this, and the KNOPPIX */
+ /* autoconfig scripts may probe them, too) */
+-char *blacklist[] =
++char *blacklist[200][200] =
+ { "apm","agpgart","yenta_socket","i82092","i82365","tcic",
+ "pcmcia_core","ds","ohci1394","hisax", "hisax_fcpcipnp",
+ "hisax_isac","hisax_st5481",
+ /* Winmodems, unusable, can block sound slot */
+ "snd-atiixp-modem", "snd-intel8x0m","snd-via82xx-modem"
+ };
++
++int blacklistsize = 13;
++void gen_blacklist(){
++ int n = 13;
++ int size = 0;
++ char *comment;
++ char module[1024];
++ FILE *stream;
++
++ if((stream = fopen ("/usr/share/hwdata/blacklist", "r")) != (FILE *)0) {
++ while((fgets(module, 1023, stream)) != (char *)0 ) {
++
++ comment = strchr(module, '#');
++ if (comment != 0) *comment = '\0';
++ comment = strchr(module, '\n');
++ if (comment != 0) *comment = '\0';
++ size = strlen(module);
++ if (size < 2) continue;
++ strcat (module , " \0");
++ strcpy(blacklist[n] , module);
++ n++;
++ if ( n == 200 ) break;
++ //printf(module);
++ }
++ blacklistsize = n;
++ }
++}
+ #endif
+
+ /* If a conflicting module in a row is already loaded, the new module will not be probed anymore */
+@@ -547,7 +574,7 @@
+ char *cc;
+ if((m==NULL)||(!strcmp("unknown",m))||(!strcmp("ignore",m))|| check_loaded(m)) return 0;
+ #ifdef BLACKLIST
+- for(i=0;i<(sizeof(blacklist)/sizeof(char*));i++)
++ for(i=0;i<blacklistsize;i++)
+ {
+ if(!modcmp(blacklist[i],m))
+ {
+@@ -781,5 +808,8 @@
+ /* Allow SIGTERM, SIGINT: rmmod depends on this. */
+ signal(SIGTERM,SIG_DFL); signal(SIGINT,SIG_DFL);
+ signal(SIGALRM,alarm_handler); alarm(MAX_TIME);
++#ifdef BLACKLIST
++ gen_blacklist();
++#endif
+ return hw_setup(dc,verbose,probeonly,skip);
+ }
diff --git a/sys-apps/hwsetup/files/1.2-7-gentoo.patch b/sys-apps/hwsetup/files/1.2-7-gentoo.patch
new file mode 100644
index 000000000000..e4fc590393fd
--- /dev/null
+++ b/sys-apps/hwsetup/files/1.2-7-gentoo.patch
@@ -0,0 +1,20 @@
+--- a/hwsetup.c
++++ b/hwsetup.c
+@@ -388,7 +388,7 @@
+ sprintf(fullpath,"%.90s%.32s",xpath,server[i]);
+ if(!exists(fullpath)) continue;
+ strncpy(xi.xserver,server[i],sizeof(xi.xserver));
+- }
++ }
+ }
+ }
+ if((xpos=strstr(d->driver,xorg))!=NULL) /* Check for Xorg */
+@@ -653,7 +653,7 @@
+ int writeconfig(char *name,struct device *d,int verbose)
+ {
+ FILE *f,*k;
+- const char *kconfig="/etc/sysconfig/knoppix";
++ const char *kconfig="/etc/sysconfig/gentoo";
+ char *desc;
+ unlink(name);
+ if((f=fopen(name,"w"))==NULL)
diff --git a/sys-apps/hwsetup/files/1.2-7-openchrome.patch b/sys-apps/hwsetup/files/1.2-7-openchrome.patch
new file mode 100644
index 000000000000..fb80f9dfcb1a
--- /dev/null
+++ b/sys-apps/hwsetup/files/1.2-7-openchrome.patch
@@ -0,0 +1,11 @@
+--- a/hwsetup.c
++++ b/hwsetup.c
+@@ -456,7 +456,7 @@
+ else if(strcasestr(xi.xdesc,"Newport")) strcpy(xi.xmodule,"newport");
+ else if(strcasestr(xi.xdesc,"Siliconmotion")||strcasestr(xi.xdesc,"Silicon Motion")) strcpy(xi.xmodule,"siliconmotion");
+ else if(strcasestr(xi.xdesc,"Chips")) strcpy(xi.xmodule,"chips");
+- else if(strcasestr(xi.xdesc,"VIA ")) strcpy(xi.xmodule,"via");
++ else if(strcasestr(xi.xdesc,"VIA ")) strcpy(xi.xmodule,"openchrome");
+ }
+ else strcpy(xi.xmodule,xvesa4);
+ }
diff --git a/sys-apps/hwsetup/files/1.2-strip.patch b/sys-apps/hwsetup/files/1.2-strip.patch
new file mode 100644
index 000000000000..17de636a5dc7
--- /dev/null
+++ b/sys-apps/hwsetup/files/1.2-strip.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@
+ # define BLACKLIST to avoid loading potentially dangerous modules
+ CFLAGS=-DBLACKLIST -Wall -fPIC
+ OPT=-O2
+-LDFLAGS=-s
++#LDFLAGS=-s
+ LIBS=-lkudzu -lpci
+ CC=gcc
+
diff --git a/sys-apps/hwsetup/hwsetup-1.2-r3.ebuild b/sys-apps/hwsetup/hwsetup-1.2-r3.ebuild
new file mode 100644
index 000000000000..4891f16ea17b
--- /dev/null
+++ b/sys-apps/hwsetup/hwsetup-1.2-r3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs flag-o-matic
+
+MY_PV=${PV}-7
+DESCRIPTION="Hardware setup program from Knoppix - used only on LiveCD"
+HOMEPAGE="http://www.knopper.net/"
+SRC_URI="http://debian-knoppix.alioth.debian.org/sources/${PN}_${MY_PV}.tar.gz"
+#http://developer.linuxtag.net/knoppix/sources/${PN}_${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 -mips ppc ppc64 sparc x86"
+IUSE="zlib"
+
+COMMON_DEPEND="
+ sys-apps/pciutils[zlib?]
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ sys-libs/libkudzu
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ sys-apps/hwdata-gentoo
+"
+
+pkg_setup() {
+ ewarn "This package is designed for use on the LiveCD only and will do "
+ ewarn "unspeakably horrible and unexpected things on a normal system."
+ ewarn "YOU HAVE BEEN WARNED!!!"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${MY_PV}-dyn_blacklist.patch \
+ "${FILESDIR}"/${PV}-3-fastprobe.patch \
+ "${FILESDIR}"/${MY_PV}-gentoo.patch \
+ "${FILESDIR}"/${PV}-strip.patch \
+ "${FILESDIR}"/${MY_PV}-openchrome.patch
+}
+
+src_configure() {
+ if use zlib ; then
+ sed -i \
+ -e '/^LIBS=/s,-lpci,-lz -lpci,g' \
+ Makefile
+ fi
+}
+
+src_compile() {
+ emake LDFLAGS="${LDFLAGS}" OPT="${CFLAGS}" CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX=/usr MANDIR=/usr/share/man
+ dosbin ${PN}
+ keepdir /etc/sysconfig
+}
+
+pkg_postinst() {
+ ewarn "This package is intended for use on the Gentoo release media. If"
+ ewarn "you are not building a CD, remove this package. It will not work"
+ ewarn "properly on a running system, as Gentoo does not use any of the"
+ ewarn "Knoppix-style detection except for CD builds."
+}
diff --git a/sys-apps/hwsetup/metadata.xml b/sys-apps/hwsetup/metadata.xml
new file mode 100644
index 000000000000..88653ddd7172
--- /dev/null
+++ b/sys-apps/hwsetup/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>livecd</herd>
+</pkgmetadata>
diff --git a/sys-apps/i2c-tools/Manifest b/sys-apps/i2c-tools/Manifest
new file mode 100644
index 000000000000..49521827a551
--- /dev/null
+++ b/sys-apps/i2c-tools/Manifest
@@ -0,0 +1,2 @@
+DIST i2c-tools-3.0.2.tar.bz2 62523 SHA256 0b4d6455a30a3264a60b4d3be55855d996d52ea4f162a2f04ffff378e24f98a2 SHA512 7e21660c83328a1f60cb4aa3dcc15ed0c745a426582afb48b09dca86cba0aa8e879eec59f6a029b36932c338395c10a3a88856a712f1680eba88643e6fbacf04 WHIRLPOOL c550374e8dad9d0005da9d16b50b793782dba79963fb2dfc2ca953a61af51af9d91fce227fd7b889a8c36b15352d2da904a8a8c313ddb577b5a7e0b4dc4fcf71
+DIST i2c-tools-3.1.1.tar.bz2 71789 SHA256 14d4d7d60d1c12e43f2befe239c682a5c44c27682f153d4b58c1e392d2db1700 SHA512 b91f89b803e5558d49ce63f42f6542438f4f47927e4ce420cd9df989cab14a5c55d971befed73e8f793b0cf4aa41936c0ef519e5a407dceb2c08964461e803c5 WHIRLPOOL 5d68236a7c6e5075625420d1e9cb0a075e8e064babbb73163a2bf2a5cf2b0b169e1420ab1ef495533c88f53497767f6256b817c49b5d9f1799f3bde6d7e26b24
diff --git a/sys-apps/i2c-tools/files/i2c-tools-3.1.1-python-3.patch b/sys-apps/i2c-tools/files/i2c-tools-3.1.1-python-3.patch
new file mode 100644
index 000000000000..1f3de76052e7
--- /dev/null
+++ b/sys-apps/i2c-tools/files/i2c-tools-3.1.1-python-3.patch
@@ -0,0 +1,129 @@
+support python-3.x
+
+http://comments.gmane.org/gmane.linux.drivers.i2c/11290
+https://bugs.gentoo.org/492632
+
+--- a/py-smbus/smbusmodule.c
++++ b/py-smbus/smbusmodule.c
+@@ -32,15 +32,18 @@
+ #define I2C_SMBUS_I2C_BLOCK_DATA 8
+ #endif
+
+-PyDoc_STRVAR(SMBus_module_doc,
+- "This module defines an object type that allows SMBus transactions\n"
+- "on hosts running the Linux kernel. The host kernel must have I2C\n"
+- "support, I2C device interface support, and a bus adapter driver.\n"
+- "All of these can be either built-in to the kernel, or loaded from\n"
+- "modules.\n"
+- "\n"
+- "Because the I2C device interface is opened R/W, users of this\n"
+- "module usually must have root permissions.\n");
++#define module_doc \
++ "This module defines an object type that allows SMBus transactions\n" \
++ "on hosts running the Linux kernel. The host kernel must have I2C\n" \
++ "support, I2C device interface support, and a bus adapter driver.\n" \
++ "All of these can be either built-in to the kernel, or loaded from\n" \
++ "modules.\n" \
++ "\n" \
++ "Because the I2C device interface is opened R/W, users of this\n" \
++ "module usually must have root permissions.\n"
++#if PY_MAJOR_VERSION <= 2
++PyDoc_STRVAR(SMBus_module_doc, module_doc);
++#endif
+
+ typedef struct {
+ PyObject_HEAD
+@@ -91,7 +94,11 @@ SMBus_dealloc(SMBus *self)
+ PyObject *ref = SMBus_close(self);
+ Py_XDECREF(ref);
+
++#if PY_MAJOR_VERSION >= 3
++ Py_TYPE(self)->tp_free((PyObject*)self);
++#else
+ self->ob_type->tp_free((PyObject *)self);
++#endif
+ }
+
+ #define MAXPATH 16
+@@ -431,11 +438,19 @@ SMBus_list_to_data(PyObject *list, union i2c_smbus_data *data)
+
+ for (ii = 0; ii < len; ii++) {
+ PyObject *val = PyList_GET_ITEM(list, ii);
++#if PY_MAJOR_VERSION >= 3
++ if (!PyLong_Check(val)) {
++#else
+ if (!PyInt_Check(val)) {
++#endif
+ PyErr_SetString(PyExc_TypeError, msg);
+ return 0; /* fail */
+ }
++#if PY_MAJOR_VERSION >= 3
++ data->block[ii+1] = (__u8)PyLong_AS_LONG(val);
++#else
+ data->block[ii+1] = (__u8)PyInt_AS_LONG(val);
++#endif
+ }
+
+ return 1; /* success */
+@@ -633,9 +648,27 @@ static PyGetSetDef SMBus_getset[] = {
+ {NULL},
+ };
+
++#if PY_MAJOR_VERSION >= 3
++static struct PyModuleDef SMBusModule = {
++ PyModuleDef_HEAD_INIT,
++ "smbus.SMBus", /* m_name */
++ module_doc, /* m_doc */
++ -1, /* m_size */
++ NULL, /* m_methods */
++ NULL, /* m_reload */
++ NULL, /* m_traverse */
++ NULL, /* m_clear */
++ NULL, /* m_free */
++};
++#endif
++
+ static PyTypeObject SMBus_type = {
++#if PY_MAJOR_VERSION >= 3
++ PyVarObject_HEAD_INIT(NULL, 0)
++#else
+ PyObject_HEAD_INIT(NULL)
+ 0, /* ob_size */
++#endif
+ "smbus.SMBus", /* tp_name */
+ sizeof(SMBus), /* tp_basicsize */
+ 0, /* tp_itemsize */
+@@ -683,16 +716,32 @@ static PyMethodDef SMBus_module_methods[] = {
+ #define PyMODINIT_FUNC void
+ #endif
+ PyMODINIT_FUNC
+-initsmbus(void)
++#if PY_MAJOR_VERSION >= 3
++PyInit_smbus(void)
++#else
++initsmbus(void)
++#endif
+ {
+ PyObject* m;
+
++#if PY_MAJOR_VERSION >= 3
++ if (PyType_Ready(&SMBus_type) < 0)
++ return NULL;
++
++ m = PyModule_Create(&SMBusModule);
++ if (m == NULL)
++ return NULL;
++#else
+ if (PyType_Ready(&SMBus_type) < 0)
+ return;
+
+ m = Py_InitModule3("smbus", SMBus_module_methods, SMBus_module_doc);
++#endif
+
+ Py_INCREF(&SMBus_type);
+ PyModule_AddObject(m, "SMBus", (PyObject *)&SMBus_type);
++#if PY_MAJOR_VERSION >= 3
++ return m;
++#endif
+ }
+
diff --git a/sys-apps/i2c-tools/i2c-tools-3.0.2.ebuild b/sys-apps/i2c-tools/i2c-tools-3.0.2.ebuild
new file mode 100644
index 000000000000..491419c74ddc
--- /dev/null
+++ b/sys-apps/i2c-tools/i2c-tools-3.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="3"
+PYTHON_DEPEND="python? 2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.* *-jython"
+
+inherit flag-o-matic toolchain-funcs distutils
+
+DESCRIPTION="I2C tools for bus probing, chip dumping, register-level access helpers, EEPROM decoding, and more"
+HOMEPAGE="http://www.lm-sensors.org/wiki/I2CTools"
+SRC_URI="http://dl.lm-sensors.org/i2c-tools/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~sparc x86"
+IUSE="python"
+
+DEPEND="!<sys-apps/lm_sensors-3"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ use python && python_pkg_setup
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" || die
+ if use python ; then
+ cd py-smbus
+ append-cppflags -I../include
+ distutils_src_compile
+ fi
+}
+
+src_install() {
+ emake install prefix="${D}"/usr || die
+ rm -rf "${D}"/usr/include # part of linux-headers
+ dodoc CHANGES README
+ local d
+ for d in eeprom eepromer ; do
+ docinto ${d}
+ dodoc ${d}/README*
+ done
+
+ if use python ; then
+ cd py-smbus
+ docinto py-smbus
+ dodoc README*
+ distutils_src_install
+ fi
+}
+
+pkg_postinst() {
+ use python && distutils_pkg_postinst
+}
+
+pkg_postrm() {
+ use python && distutils_pkg_postrm
+}
diff --git a/sys-apps/i2c-tools/i2c-tools-3.1.1-r1.ebuild b/sys-apps/i2c-tools/i2c-tools-3.1.1-r1.ebuild
new file mode 100644
index 000000000000..45fbeb388af5
--- /dev/null
+++ b/sys-apps/i2c-tools/i2c-tools-3.1.1-r1.ebuild
@@ -0,0 +1,60 @@
+# 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} )
+DISTUTILS_OPTIONAL="1"
+
+inherit flag-o-matic toolchain-funcs distutils-r1
+
+DESCRIPTION="I2C tools for bus probing, chip dumping, register-level access helpers, EEPROM decoding, and more"
+HOMEPAGE="http://www.lm-sensors.org/wiki/I2CTools"
+SRC_URI="http://dl.lm-sensors.org/i2c-tools/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="python"
+
+RDEPEND="!<sys-apps/lm_sensors-3
+ python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.1-python-3.patch #492632
+ use python && distutils-r1_src_prepare
+}
+
+src_configure() {
+ use python && distutils-r1_src_configure
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) CFLAGS="${CFLAGS}"
+ emake -C eepromer CC=$(tc-getCC) CFLAGS="${CFLAGS} -I../include"
+ if use python ; then
+ cd py-smbus || die
+ append-cppflags -I../include
+ distutils-r1_src_compile
+ fi
+}
+
+src_install() {
+ emake install prefix="${D}"/usr
+ dosbin eepromer/eepro{g,m{,er}}
+ rm -rf "${D}"/usr/include # part of linux-headers
+ dodoc CHANGES README
+ local d
+ for d in eeprom eepromer ; do
+ docinto ${d}
+ dodoc ${d}/README*
+ done
+
+ if use python ; then
+ cd py-smbus || die
+ docinto py-smbus
+ dodoc README*
+ distutils-r1_src_install
+ fi
+}
diff --git a/sys-apps/i2c-tools/metadata.xml b/sys-apps/i2c-tools/metadata.xml
new file mode 100644
index 000000000000..4538a68724a6
--- /dev/null
+++ b/sys-apps/i2c-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>
+<maintainer><email>maintainer-needed@gentoo.org</email></maintainer>
+</pkgmetadata>
diff --git a/sys-apps/ibm-powerpc-utils-papr/Manifest b/sys-apps/ibm-powerpc-utils-papr/Manifest
new file mode 100644
index 000000000000..822af16a1c6f
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/Manifest
@@ -0,0 +1,2 @@
+DIST powerpc-utils-papr-1.1.0.tar.gz 202321 SHA256 edd36417a21b19a3e8fd277c93b31fc71309ebde44aa7aa4a7813ce4240b1a16
+DIST powerpc-utils-papr-1.1.6.tar.gz 231283 SHA256 71e1fe04951c62176a8f224d79183e9b87967edb60c07c65f107f93f9b8c6243
diff --git a/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-remove-doc.patch b/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-remove-doc.patch
new file mode 100644
index 000000000000..8a2c27f0f8e8
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-remove-doc.patch
@@ -0,0 +1,14 @@
+--- powerpc-utils-papr-1.1.0.orig/Makefile 2006-03-28 16:07:24.000000000 -0600
++++ powerpc-utils-papr-1.1.0/Makefile 2006-04-19 14:53:25.000000000 -0500
+@@ -20,11 +20,9 @@
+ @$(MAKE) -C doc
+
+ install: all
+- @$(call install_doc,$(FILES),$(DESTDIR))
+ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d install;)
+
+ uninstall:
+- @$(call uninstall_doc,$(FILES),$(DESTDIR))
+ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d uninstall;)
+
+ rpm: all
diff --git a/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-removeinitandvscsis.patch b/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-removeinitandvscsis.patch
new file mode 100644
index 000000000000..a6bb9278f8a9
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.0-removeinitandvscsis.patch
@@ -0,0 +1,23 @@
+--- powerpc-utils-papr-1.1.0.orig/scripts/Makefile 2006-03-28 16:07:24.000000000 -0600
++++ powerpc-utils-papr-1.1.0/scripts/Makefile 2006-04-19 14:53:44.000000000 -0500
+@@ -4,7 +4,7 @@
+
+ include ../rules.mk
+
+-SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump
++SCRIPTS = update_flash hvcsadmin rtas_dump
+
+ RCSCRIPTS = ibmvscsis.sh
+
+@@ -12,11 +12,9 @@
+
+ install: all
+ @$(call install_sbin,$(SCRIPTS),$(DESTDIR))
+- @$(call install_files,$(RCSCRIPTS),755,$(DESTDIR)/etc/init.d)
+
+ uninstall:
+ @$(call uninstall_sbin,$(SCRIPTS),$(DESTDIR))
+- @$(call uninstall_files,$(RCSCRIPTS),$(DESTDIR)/etc/init.d)
+
+ clean:
+ @echo "Cleaning up $(WORK_DIR) files..."
diff --git a/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.6-removeinitandvscsis.patch b/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.6-removeinitandvscsis.patch
new file mode 100644
index 000000000000..b8a31df485b5
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/files/ibm-powerpc-utils-papr-1.1.6-removeinitandvscsis.patch
@@ -0,0 +1,27 @@
+--- powerpc-utils-papr-1.1.6/scripts/Makefile.bak 2010-03-21 15:11:49.590571690 -0400
++++ powerpc-utils-papr-1.1.6/scripts/Makefile 2010-03-21 15:12:48.107232396 -0400
+@@ -4,7 +4,7 @@
+
+ include ../rules.mk
+
+-SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump
++SCRIPTS = update_flash hvcsadmin rtas_dump
+
+ USER_SCRIPTS = amsstat
+
+@@ -18,13 +18,13 @@
+ install: all
+ @$(call install_sbin,$(SCRIPTS),$(DESTDIR))
+ @$(call install_bin,$(USER_SCRIPTS),$(DESTDIR))
+- @$(call install_files,$(RCSCRIPTS),755,$(DESTDIR)/etc/init.d)
++ #@$(call install_files,$(RCSCRIPTS),755,$(DESTDIR)/etc/init.d)
+ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d install;)
+
+ uninstall:
+ @$(call uninstall_sbin,$(SCRIPTS),$(DESTDIR))
+ @$(call uninstall_bin,$(USER_SCRIPTS),$(DESTDIR))
+- @$(call uninstall_files,$(RCSCRIPTS),$(DESTDIR)/etc/init.d)
++ #@$(call uninstall_files,$(RCSCRIPTS),$(DESTDIR)/etc/init.d)
+ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d uninstall;)
+
+ clean:
diff --git a/sys-apps/ibm-powerpc-utils-papr/files/ibmvscsis b/sys-apps/ibm-powerpc-utils-papr/files/ibmvscsis
new file mode 100644
index 000000000000..2a47f2ac0ddd
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/files/ibmvscsis
@@ -0,0 +1,69 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# This file is tasked with testing for the existence of the ibmvscsis driver
+# and configuring the ibmvscsi server properly as indicated by the config file
+# located at /etc/ibmvscsis.conf
+#
+
+DRIVER=ibmvscsis
+SYSFS=/sys/bus/vio/drivers/ibmvscsis
+CONFIG=/etc/ibmvscsis.conf
+
+depend() {
+ need logger
+ provide ibmvscsis
+}
+
+checkconfig() {
+ if [ ! -e ${CONFIG} ] ; then
+ eerror " ${CONFIG} does not exist."
+ return 1
+ fi
+}
+
+checkmodule_load() {
+ # The existence of $SYSFS indicates that the module has been loaded or that
+ # the driver is at least built into the kernel.
+ if [ ! -e ${SYSFS} ] ; then
+ ewarn " Module ${DRIVER} is not loaded, attempting to load it"
+ /sbin/modprobe ${DRIVER} &> /dev/null && return 0
+ eerror " Failed to load module ${DRIVER}"
+ return 1
+ fi
+}
+
+checkmodule() {
+ # The existence of $SYSFS indicates that the module has been loaded or that
+ # the driver is at least built into the kernel.
+ if [ ! -e ${SYSFS} ] ; then
+ eerror " Module ${DRIVER} is not loaded"
+ return 1
+ fi
+}
+
+start() {
+ ebegin "Starting vscsiadmin"
+ checkconfig || return 1
+ checkmodule_load || return 1
+ /usr/sbin/vscsiadmin -start &> /dev/null
+ eend $? "Failed to start vscsiadmin"
+}
+
+stop() {
+ ebegin "Stopping vscsiadmin"
+ checkmodule || return 1
+ /usr/sbin/vscsiadmin -stop &> /dev/null
+ eend $? "Failed to stop vscsiadmin"
+}
+
+status() {
+ checkmodule || return 1
+ /usr/sbin/vscsiadmin -status
+}
+
+restart() {
+ stop
+ start
+}
diff --git a/sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.0.ebuild b/sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.0.ebuild
new file mode 100644
index 000000000000..fa43e01824c9
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P="powerpc-utils-papr-${PV}"
+
+DESCRIPTION="This package provides the utilities which are intended for the maintenance of IBM powerpc platforms"
+SRC_URI="http://powerpc-utils.ozlabs.org/releases/powerpc-utils-papr-${PV}.tar.gz"
+HOMEPAGE="http://powerpc-utils.ozlabs.org/"
+
+S="${WORKDIR}/${MY_P}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+RDEPEND=">=sys-apps/ibm-powerpc-utils-1.1.0
+ sys-libs/librtas
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}"/ibm-powerpc-utils-papr-1.1.0-remove-doc.patch
+ epatch "${FILESDIR}"/ibm-powerpc-utils-papr-1.1.0-removeinitandvscsis.patch
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Compilation failed"
+ dodoc README COPYRIGHT
+ #dodir /etc/init.d
+ #exeinto /etc/init.d
+ #newexe ${FILESDIR}/ibmvscsis ibmvscsis
+}
+
+pkg_postinst() {
+ #einfo "An initscript for managing virtual scsi servers has "
+ #einfo "been install into /etc/init.d/ called ibmviscsis. "
+ #einfo "Before you can use this daemon, you must create a proper "
+ #einfo "/etc/ibmvscsis.conf file."
+ einfo "Support for the IBM Virtual SCSI server (virtual disk) "
+ einfo "is not included in this version of powerpc-utils-papr. "
+ einfo "When the ibmvscsis function is generally available in "
+ einfo "the kernel source trees, it will be added back in."
+}
diff --git a/sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.6.ebuild b/sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.6.ebuild
new file mode 100644
index 000000000000..21f61893f759
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/ibm-powerpc-utils-papr-1.1.6.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P="powerpc-utils-papr-${PV}"
+
+DESCRIPTION="This package provides the utilities which are intended for the maintenance of IBM powerpc platforms"
+SRC_URI="http://powerpc-utils.ozlabs.org/releases/powerpc-utils-papr-${PV}.tar.gz"
+HOMEPAGE="http://powerpc-utils.ozlabs.org/"
+
+S="${WORKDIR}/${MY_P}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+RDEPEND=">=sys-apps/ibm-powerpc-utils-1.1.2
+ sys-libs/librtas
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}"/ibm-powerpc-utils-papr-${PV}-removeinitandvscsis.patch
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Compilation failed"
+}
+
+pkg_postinst() {
+ einfo "Support for the IBM Virtual SCSI server (virtual disk) "
+ einfo "is not included in this version of powerpc-utils-papr. "
+ einfo "When the ibmvscsis function is generally available in "
+ einfo "the kernel source trees, it will be added back in."
+}
diff --git a/sys-apps/ibm-powerpc-utils-papr/metadata.xml b/sys-apps/ibm-powerpc-utils-papr/metadata.xml
new file mode 100644
index 000000000000..f9a5b22fcbec
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils-papr/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>ppc64</herd>
+</pkgmetadata>
diff --git a/sys-apps/ibm-powerpc-utils/Manifest b/sys-apps/ibm-powerpc-utils/Manifest
new file mode 100644
index 000000000000..4ee76812a961
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/Manifest
@@ -0,0 +1,5 @@
+DIST powerpc-utils-1.1.0.tar.gz 49368 SHA256 163886d3d1b59e92323b95461df83712f4cea5f605dda1fffdf1912567f3c94d
+DIST powerpc-utils-1.2.12.tar.gz 347762 SHA256 570173a2712e06cdd34fc6b5c8aef3313909e1efd083f2a77d1053bfa25f4e01 SHA512 a28150c753e65c7595a7ad7a5361560b162c639bc6d385763c57d0c02f2b6e15db7e091be167d3c68aa1378f816a75971c5d60c1997dfa96be4a73f072863649 WHIRLPOOL dca98947543defb2d458d9aa9ff1df2230f82c1e1b058a939ab1c19ce6c44d5449ec9156db67af20356c3c90864ee03e65080a56aa9e80b6e531651d421091ae
+DIST powerpc-utils-1.2.2.tar.gz 345299 SHA256 692fcc928645f7776334999a02f9bdd3d675932fbf6efbfa49950e1bc62c3694
+DIST powerpc-utils-1.2.25.tar.gz 367466 SHA256 2d9a0d4b04ab499ba1362844d65a4e21df0532578a2baa1fe18fff58dc8f32d9 SHA512 33af208dcd6ef9d66b96ec3eadab2eee48017860db9195eea0c59444a5dd414c326e1a737d6c324396219901ea594baaad6f49c8f3c36f5e806b4923d049b14e WHIRLPOOL a4d273ea9be4c8199c1f6ed25f80e6bbc28f3c653a0665196c10f4e95266b1e50835d0886219671f6fef0916de3b679799de6a2a1772ecad77665b386711a5f3
+DIST powerpc-utils-1.2.26.tar.gz 371200 SHA256 61253cb898283e94fcfde641d09722c3e845ebfd98a46f9bc2ad82167ff51592 SHA512 8c8c45128e89cad5bd1a37699a8b628c269b7fe9d5ebc5893ddce8ea8b77252708f5a2a4a454af71224709a44c999446e5d5b7113ba24efc4227b6ff90a1fffd WHIRLPOOL b024a02cf6feb3032b2599e3ceb5091d65631be492ce6ba9d4f5b832aa617293e3192a16be35ffee3765ef3328496712a497a9b8dcefb61a01ec511f71ed80c3
diff --git a/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.1.0-remove-doc.patch b/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.1.0-remove-doc.patch
new file mode 100644
index 000000000000..826c6243b9ad
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/files/ibm-powerpc-utils-1.1.0-remove-doc.patch
@@ -0,0 +1,23 @@
+--- a/Makefile
++++ b/Makefile
+@@ -12,19 +12,12 @@
+ TARBALL_FILES += $(FILES) Changelog
+
+ all:
+- @echo "Building cmds files..."
+- @$(MAKE) -C cmds
+- @echo "Building scripts files..."
+- @$(MAKE) -C scripts
+- @echo "Building doc files..."
+- @$(MAKE) -C doc
++ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d;)
+
+ install: all
+- @$(call install_doc,$(FILES),$(DESTDIR))
+ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d install;)
+
+ uninstall:
+- @$(call uninstall_doc,$(FILES),$(DESTDIR))
+ @$(foreach d,$(SUBDIRS), $(MAKE) -C $d uninstall;)
+
+ rpm: all
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.1.0.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.1.0.ebuild
new file mode 100644
index 000000000000..d536c379bf23
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.1.0.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P="powerpc-utils-${PV}"
+
+DESCRIPTION="This package provides utilities for the maintainance
+of the IBM and Apple powerpc platforms."
+SRC_URI="http://powerpc-utils.ozlabs.org/releases/${MY_P}.tar.gz"
+HOMEPAGE="http://powerpc-utils.ozlabs.org/"
+
+S="${WORKDIR}/${MY_P}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+DEPEND=">=sys-libs/librtas-1.3.1
+sys-devel/bc"
+RDEPEND="!sys-apps/ppc64-utils"
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}"/ibm-powerpc-utils-1.1.0-remove-doc.patch
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Something went wrong"
+# dodoc README COPYRIGHT
+
+}
+
+pkg_postinst() {
+ einfo "If you are running IBM hardware, consider emerging "
+ einfo "sys-apps/ibm-powerpc-utils-papr for additional functions. "
+}
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.12.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.12.ebuild
new file mode 100644
index 000000000000..b4025e25d630
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.12.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P="powerpc-utils-${PV}"
+
+DESCRIPTION="This package provides utilities for the maintainance
+of the IBM and Apple powerpc platforms."
+HOMEPAGE="http://sourceforge.net/projects/powerpc-utils"
+SRC_URI="mirror://sourceforge/powerpc-utils/${MY_P}.tar.gz"
+
+S="${WORKDIR}/${MY_P}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+DEPEND=">=sys-libs/librtas-1.3.5
+ sys-devel/bc"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Something went wrong"
+
+}
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.2.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.2.ebuild
new file mode 100644
index 000000000000..437a59da53d6
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P="powerpc-utils-${PV}"
+
+DESCRIPTION="This package provides utilities for the maintainance
+of the IBM and Apple powerpc platforms."
+HOMEPAGE="http://sourceforge.net/projects/powerpc-utils"
+SRC_URI="mirror://sourceforge/powerpc-utils/${MY_P}.tar.gz"
+
+S="${WORKDIR}/${MY_P}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+DEPEND=">=sys-libs/librtas-1.3.1
+ sys-devel/bc
+ !sys-apps/ibm-powerpc-utils-papr"
+RDEPEND="!sys-apps/ppc64-utils"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Something went wrong"
+
+}
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.25.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.25.ebuild
new file mode 100644
index 000000000000..2833bf435d8a
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.25.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 eutils
+
+DESCRIPTION="This package provides utilities for the maintainance
+of the IBM and Apple powerpc platforms."
+HOMEPAGE="http://sourceforge.net/projects/powerpc-utils"
+SRC_URI="mirror://sourceforge/powerpc-utils/${P//ibm-}.tar.gz"
+IUSE="+rtas"
+
+S="${WORKDIR}/${P//ibm-}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+
+DEPEND="
+ sys-devel/bc
+"
+RDEPEND="
+ rtas? ( >=sys-libs/librtas-1.3.5 )
+ ${DEPEND}
+"
+
+src_configure() {
+ econf $(use_with rtas librtas)
+}
diff --git a/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.26.ebuild b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.26.ebuild
new file mode 100644
index 000000000000..2833bf435d8a
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/ibm-powerpc-utils-1.2.26.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 eutils
+
+DESCRIPTION="This package provides utilities for the maintainance
+of the IBM and Apple powerpc platforms."
+HOMEPAGE="http://sourceforge.net/projects/powerpc-utils"
+SRC_URI="mirror://sourceforge/powerpc-utils/${P//ibm-}.tar.gz"
+IUSE="+rtas"
+
+S="${WORKDIR}/${P//ibm-}"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+
+DEPEND="
+ sys-devel/bc
+"
+RDEPEND="
+ rtas? ( >=sys-libs/librtas-1.3.5 )
+ ${DEPEND}
+"
+
+src_configure() {
+ econf $(use_with rtas librtas)
+}
diff --git a/sys-apps/ibm-powerpc-utils/metadata.xml b/sys-apps/ibm-powerpc-utils/metadata.xml
new file mode 100644
index 000000000000..6035c92dff18
--- /dev/null
+++ b/sys-apps/ibm-powerpc-utils/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>ppc64</herd>
+ <use>
+ <flag name="rtas">Add support for the Run Time Abstraction Services (RTAS)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">powerpc-utils</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/idle3-tools/Manifest b/sys-apps/idle3-tools/Manifest
new file mode 100644
index 000000000000..026c847b5387
--- /dev/null
+++ b/sys-apps/idle3-tools/Manifest
@@ -0,0 +1 @@
+DIST idle3-tools-0.9.1.tgz 21201 SHA256 9778060c7873ad2c9c40db3a7049d8ca22535427b982ff12f5bd519f703f2a02 SHA512 512991fad786684bd127f7ad3af94dcea4e28cd88d52221007436172725b8d2c0c2edd578c4c95bbcd425339ed664b9d81adbabbc2bb8a4a3ea71500e21db01e WHIRLPOOL 7261ff14b374dc23d0e829ed90199b1dffee8fb76a9f547810de7af66c70d1c01ae9266fecf2bfbcc6dc66e37c5726e52fe83a20ec99bac85d2af3f870c8323f
diff --git a/sys-apps/idle3-tools/idle3-tools-0.9.1.ebuild b/sys-apps/idle3-tools/idle3-tools-0.9.1.ebuild
new file mode 100644
index 000000000000..a644b2995c08
--- /dev/null
+++ b/sys-apps/idle3-tools/idle3-tools-0.9.1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit base toolchain-funcs
+
+DESCRIPTION="Read, Set or disable the idle3 timer of Western Digital drives"
+HOMEPAGE="http://idle3-tools.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="-Wall ${CFLAGS}" LDFLAGS="${LDFLAGS}" || die
+}
diff --git a/sys-apps/idle3-tools/metadata.xml b/sys-apps/idle3-tools/metadata.xml
new file mode 100644
index 000000000000..01061b45f70e
--- /dev/null
+++ b/sys-apps/idle3-tools/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ Idle3-tools provides a linux/unix utility that can disable, get and set the value
+ of the infamous idle3 timer found on recent Western Digital Hard Disk Drives. It
+ can be used as an alternative to the official wdidle3.exe proprietary utility,
+ without the need to reboot in a DOS environement. A power off/on cycle of the
+ drive will still be mandatory for new settings to be taken into account.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">idle3-tools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/ifd-gempc/Manifest b/sys-apps/ifd-gempc/Manifest
new file mode 100644
index 000000000000..641ddd533699
--- /dev/null
+++ b/sys-apps/ifd-gempc/Manifest
@@ -0,0 +1 @@
+DIST ifd-gempc-1.0.6.tar.gz 76156 RMD160 95bb5616a110325dea1612a80dec640a5ad2faf1 SHA1 545f427aa62f04cb4dbbb6b99c6caf6caec750f6 SHA256 29f772aed8f0dfaf65c1f539338c728344af2cf50aca6b5652ed4afca65d3da3
diff --git a/sys-apps/ifd-gempc/files/reader.conf b/sys-apps/ifd-gempc/files/reader.conf
new file mode 100644
index 000000000000..74de4a1a60ca
--- /dev/null
+++ b/sys-apps/ifd-gempc/files/reader.conf
@@ -0,0 +1,11 @@
+# Configuration file for pcsc-lite
+#
+
+# GemPC410 reader
+FRIENDLYNAME "GemPC410"
+# Update the following to the right COM port
+DEVICENAME /dev/null
+LIBPATH %PCSC_DRIVERS_DIR%/serial/%libGemPC410%
+CHANNELID 1
+
+# End of file
diff --git a/sys-apps/ifd-gempc/ifd-gempc-1.0.6.ebuild b/sys-apps/ifd-gempc/ifd-gempc-1.0.6.ebuild
new file mode 100644
index 000000000000..3fabcb8a9126
--- /dev/null
+++ b/sys-apps/ifd-gempc/ifd-gempc-1.0.6.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="GemCore based PC/SC reader drivers for pcsc-lite"
+HOMEPAGE="http://ludovic.rousseau.free.fr/softwares/ifd-GemPC"
+LICENSE="GPL-2 BSD"
+KEYWORDS="~amd64 ~ppc ~x86"
+SLOT="0"
+SRC_URI="http://ludovic.rousseau.free.fr/softwares/ifd-GemPC/${P}.tar.gz"
+IUSE=""
+RDEPEND=">=sys-apps/pcsc-lite-1.2.9_beta7
+ =virtual/libusb-0*"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die "emake failed"
+}
+
+src_install () {
+ local pcscdir="$(pkg-config --variable=usbdropdir libpcsclite)"
+ local conf="/etc/reader.conf.d/${PN}.conf"
+ emake CC="$(tc-getCC)" DESTDIR="${D}" install || die "emake install failed"
+ dodoc README*
+ dodir "$(dirname "${conf}")"
+ insinto "$(dirname "${conf}")"
+ newins "${FILESDIR}/reader.conf" "$(basename "${conf}")"
+ sed -e "s:%PCSC_DRIVERS_DIR%:${pcscdir}:g" -e "s:%libGemPC410%:libGemPC410.so.${PV}:g" -i "${D}${conf}"
+}
+
+pkg_postinst() {
+ elog "NOTICE:"
+ elog "1. If you are using GemPC410, modify ${conf}"
+ elog "2. Run update-reader.conf, yes this is a command..."
+ elog "3. Restart pcscd"
+}
+
+pkg_postrm() {
+ #
+ # Without this, pcscd will not start next time.
+ #
+ local conf="/etc/reader.conf.d/${PN}.conf"
+ if ! [[ -f "${conf}" && -f "$(grep LIBPATH "${conf}" | sed 's/LIBPATH *//' | sed 's/ *$//g' | head -n 1)" ]]; then
+ [[ -f "${conf}" ]] && rm "${conf}"
+ update-reader.conf
+ elog "NOTICE:"
+ elog "You need to restart pcscd"
+ fi
+}
diff --git a/sys-apps/ifd-gempc/metadata.xml b/sys-apps/ifd-gempc/metadata.xml
new file mode 100644
index 000000000000..555d15559b19
--- /dev/null
+++ b/sys-apps/ifd-gempc/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>crypto</herd>
+<longdescription>
+ This library provides PC/SC IFD handler implementation for Gemplus GemCore based
+ serial and USB smart cards readers.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/ifplugd/Manifest b/sys-apps/ifplugd/Manifest
new file mode 100644
index 000000000000..6f919e074d41
--- /dev/null
+++ b/sys-apps/ifplugd/Manifest
@@ -0,0 +1 @@
+DIST ifplugd-0.28.tar.gz 142677 SHA256 474754ac4ab32d738cbf2a4a3e87ee0a2c71b9048a38bdcd7df1e4f9fd6541f0
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch
new file mode 100644
index 000000000000..9c2de464bbde
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-interface.patch
@@ -0,0 +1,13 @@
+--- src/interface.c 2004/12/19 00:08:01 114
++++ src/interface.c 2006/03/07 13:15:11 133
+@@ -22,9 +22,9 @@
+ #include <config.h>
+ #endif
+
++#include <sys/types.h>
+ #include <linux/sockios.h>
+ #include <linux/if_ether.h>
+-#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <linux/if.h>
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff
new file mode 100644
index 000000000000..b640543eebc9
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-nlapi.diff
@@ -0,0 +1,12 @@
+diff -urN src/nlapi.c src/nlapi.c
+--- src/nlapi.c 2004-12-20 08:39:14.682706517 -0500
++++ src/nlapi.c 2004-12-20 08:39:50.185734092 -0500
+@@ -86,7 +86,7 @@
+ for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
+ struct callback_info *c;
+
+- if (!NLMSG_OK(p, bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < p->nlmsg_len) {
++ if (!NLMSG_OK(p, (size_t) bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < (size_t) p->nlmsg_len) {
+ daemon_log(LOG_ERR, "NLAPI: Packet too small or truncated!\n");
+ return -1;
+ }
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch
new file mode 100644
index 000000000000..5daa4534eb49
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-noip.patch
@@ -0,0 +1,21 @@
+[PATCH] Allow ifplugd to run when no TCP/IP is available
+
+This simple patch create AF_LOCAL socket instead of AF_INET so if TCP/IP
+is not linked into kernel it still works.
+
+Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
+
+---
+
+diff -urNp ifplugd-0.28.org/src/ifplugd.c ifplugd-0.28/src/ifplugd.c
+--- ifplugd-0.28.org/src/ifplugd.c 2005-06-04 22:21:51.000000000 +0300
++++ ifplugd-0.28/src/ifplugd.c 2007-10-30 05:22:53.000000000 +0200
+@@ -409,7 +409,7 @@ void work(void) {
+ break;
+ }
+
+- if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
++ if ((fd = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) {
+ daemon_log(LOG_ERR, "socket(): %s", strerror(errno));
+ goto finish;
+ }
diff --git a/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch
new file mode 100644
index 000000000000..3c5de8a2e731
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd-0.28-strictalias.patch
@@ -0,0 +1,63 @@
+--- src/interface.c.orig 2007-03-23 13:29:40.000000000 +0000
++++ src/interface.c 2007-03-23 13:30:05.000000000 +0000
+@@ -89,6 +89,10 @@
+
+ interface_status_t interface_detect_beat_mii(int fd, char *iface) {
+ struct ifreq ifr;
++ union {
++ caddr_t *data;
++ unsigned short *usz;
++ } ifd;
+
+ if (interface_auto_up)
+ interface_up(fd, iface);
+@@ -103,7 +107,8 @@
+ return IFSTATUS_ERR;
+ }
+
+- ((unsigned short*) &ifr.ifr_data)[1] = 1;
++ ifd.data = &ifr.ifr_data;
++ *++ifd.usz = 1;
+
+ if (ioctl(fd, SIOCGMIIREG, &ifr) == -1) {
+ if (interface_do_message)
+@@ -112,12 +117,17 @@
+ return IFSTATUS_ERR;
+ }
+
+- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
++ ifd.usz += 2;
++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
+ }
+
+ interface_status_t interface_detect_beat_priv(int fd, char *iface) {
+ struct ifreq ifr;
+-
++ union {
++ caddr_t *data;
++ unsigned short *usz;
++ } ifd;
++
+ if (interface_auto_up)
+ interface_up(fd, iface);
+
+@@ -131,7 +141,8 @@
+ return IFSTATUS_ERR;
+ }
+
+- ((unsigned short*) &ifr.ifr_data)[1] = 1;
++ ifd.data = &ifr.ifr_data;
++ *++ifd.usz = 1;
+
+ if (ioctl(fd, SIOCDEVPRIVATE+1, &ifr) == -1) {
+ if (interface_do_message)
+@@ -140,7 +151,8 @@
+ return IFSTATUS_ERR;
+ }
+
+- return (((unsigned short*) &ifr.ifr_data)[3] & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
++ ifd.usz += 2;
++ return (*ifd.usz & 0x0004) ? IFSTATUS_UP : IFSTATUS_DOWN;
+ }
+
+ interface_status_t interface_detect_beat_ethtool(int fd, char *iface) {
diff --git a/sys-apps/ifplugd/files/ifplugd.action b/sys-apps/ifplugd/files/ifplugd.action
new file mode 100644
index 000000000000..ba4cfd7d20b9
--- /dev/null
+++ b/sys-apps/ifplugd/files/ifplugd.action
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# Gentoo-specific ifplugd.action
+#
+# This file gets called by ifplugd when it wants to bring an interface
+# up or down.
+#
+
+if grep -q initng /proc/1/cmdline
+then
+ EXEC="/sbin/ngc"
+ INITNG="yes"
+else
+ EXEC="/etc/init.d/net.$1"
+ INITNG="no"
+fi
+
+case "$2" in
+ up)
+ if [ "${INITNG}" = "yes" ]
+ then
+ ARGS="-u net/$1"
+ else
+ ARGS="--quiet start"
+ fi
+ ;;
+ down)
+ if [ "${INITNG}" = "yes" ]
+ then
+ ARGS="-d net/$1"
+ else
+ ARGS="--quiet stop"
+ fi
+ ;;
+ *)
+ echo "$0: wrong arguments" >&2
+ echo "Call with <interface> <up|down>" >&2
+ exit 1
+ ;;
+esac
+
+export IN_BACKGROUND=true
+
+if [ -x "${EXEC}" ]
+then
+ ${EXEC} ${ARGS}
+ exit 0
+else
+ logger -t ifplugd.action "Error: Couldn't configure $1, no ${EXEC} !"
+ exit 1
+fi
+
+# vim: set ts=4
diff --git a/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild b/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild
new file mode 100644
index 000000000000..e1ccd87a3029
--- /dev/null
+++ b/sys-apps/ifplugd/ifplugd-0.28-r9.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils
+
+DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
+HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/"
+SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~arm amd64 hppa ppc x86"
+IUSE="doc selinux"
+
+DEPEND="virtual/pkgconfig
+ doc? ( www-client/lynx )
+ >=dev-libs/libdaemon-0.5"
+RDEPEND=">=dev-libs/libdaemon-0.5
+ >=sys-apps/baselayout-1.12
+ selinux? ( sec-policy/selinux-ifplugd )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-nlapi.diff"
+ epatch "${FILESDIR}/${P}-interface.patch"
+ epatch "${FILESDIR}/${P}-strictalias.patch"
+ epatch "${FILESDIR}/${P}-noip.patch"
+}
+
+src_configure() {
+ econf \
+ $(use_enable doc lynx) \
+ --with-initdir=/etc/init.d \
+ --disable-xmltoman \
+ --disable-subversion
+}
+
+src_install() {
+ default
+
+ # Remove init.d configuration as we no longer use it
+ rm -rf "${D}/etc/ifplugd" "${D}/etc/init.d/${PN}"
+
+ exeinto "/etc/${PN}"
+ newexe "${FILESDIR}/${PN}.action" "${PN}.action"
+
+ cd "${S}/doc"
+ dodoc README SUPPORTED_DRIVERS
+ use doc && dohtml *.html *.css
+}
+
+pkg_postinst() {
+ # Warn about old init script
+ einfo "baselayout now starts ifplugd automatically on wired interfaces"
+ einfo "If you do not want this behaviour then add !plug to your modules"
+ einfo "in /etc/conf.d/net like so"
+ einfo " modules=( \"!plug\" )"
+
+ if [ -e "${ROOT}/etc/init.d/ifplugd" -o -e "${ROOT}/etc/conf.d/ifplugd" ] ; then
+ echo
+ ewarn "You should stop the ifplugd service now and remove its init"
+ ewarn "script and config file"
+ if [ "${ROOT}" = "/" ] ; then
+ ewarn " /etc/init.d/ifplugd stop"
+ ewarn " rc-update del ifplugd"
+ ewarn " rm -f /etc/{conf,init}.d/ifplugd"
+ fi
+ fi
+}
diff --git a/sys-apps/ifplugd/metadata.xml b/sys-apps/ifplugd/metadata.xml
new file mode 100644
index 000000000000..26ed76b50d8e
--- /dev/null
+++ b/sys-apps/ifplugd/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>
+ <longdescription lang="en">
+ Brings up/down ethernet ports automatically with cable detection
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/input-utils/Manifest b/sys-apps/input-utils/Manifest
new file mode 100644
index 000000000000..31e5b1dc4220
--- /dev/null
+++ b/sys-apps/input-utils/Manifest
@@ -0,0 +1,2 @@
+DIST input-1.1.tar.gz 21652 SHA256 544636fb0d468cae7de502f7b973a54a3195073328b235b906bd21298694b65b SHA512 dfb89bfdb956fbd80134606e3deda8fbd7d5679513e882ac169adb4f547980dcdec56db4c992f7dda4036c0dbbb4bec0468262893d3c5253de9d3a8b909d81cc WHIRLPOOL a571f9516f9554c7e1c039ef7fc1727fe2cd9dea2a2539fc514ffc80c09d6c34d060783581112b5401229ac5a1518985b6ca4a0bcccaef3fc97ec13b05e1e457
+DIST input-20081014-101501.tar.gz 33797 SHA256 185f31f5776bd81be28ae7984d6d2812420858bed8f6ebfbfeaaa7d6ca62b0e5 SHA512 24ad3b5077b0e32b0ed6d28e84c27089091468d1379645f862c66a1987f079765c5aed850542b3bcec25f6254b681991119332a5b024ff04dd3dbd72e3ae3450 WHIRLPOOL e4daac596d81d5a71c829935d6185bc857a4d1d7971d97a6fc9d3b633f9ceeaf8e269b3fe783f948e0e426c5c2a4fd669b861689dd0d2cfeee32b38aaf3012c8
diff --git a/sys-apps/input-utils/files/input-utils-0.0.1-protocol-mismatch-fix.patch b/sys-apps/input-utils/files/input-utils-0.0.1-protocol-mismatch-fix.patch
new file mode 100644
index 000000000000..007258a5330f
--- /dev/null
+++ b/sys-apps/input-utils/files/input-utils-0.0.1-protocol-mismatch-fix.patch
@@ -0,0 +1,22 @@
+Patch from https://bugs.gentoo.org/attachment.cgi?id=262203&action=diff
+
+--- input.c.orig 2011-02-12 02:29:40.308989368 -0500
++++ input.c 2011-02-12 02:30:21.209265625 -0500
+@@ -46,17 +46,6 @@
+ if (verbose)
+ fprintf(stderr,"%s\n",filename);
+
+- if (-1 == ioctl(fd,EVIOCGVERSION,&version)) {
+- perror("ioctl EVIOCGVERSION");
+- close(fd);
+- return -1;
+- }
+- if (EV_VERSION != version) {
+- fprintf(stderr, "protocol version mismatch (expected %d, got %d)\n",
+- EV_VERSION, version);
+- close(fd);
+- return -1;
+- }
+ return fd;
+ }
+
diff --git a/sys-apps/input-utils/files/input-utils-0.0.1_pre20081014.patch b/sys-apps/input-utils/files/input-utils-0.0.1_pre20081014.patch
new file mode 100644
index 000000000000..796b1bef62d4
--- /dev/null
+++ b/sys-apps/input-utils/files/input-utils-0.0.1_pre20081014.patch
@@ -0,0 +1,116 @@
+This patch is derived from input-utils_0.0.20051128-4.diff.gz
+
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/GNUmakefile input-utils-0.0.20081014/GNUmakefile
+--- input-utils-0.0.20081014.orig/GNUmakefile 2008-10-14 10:27:01.000000000 +0000
++++ input-utils-0.0.20081014/GNUmakefile 2011-07-03 07:49:07.000000000 +0000
+@@ -7,7 +7,7 @@
+ LDLIBS += -lm
+
+ # build
+-TARGETS := lsinput input-events input-kbd input-send input-recv lircd.conf
++TARGETS := lsinput input-events input-kbd lircd.conf
+ HEADERS := EV.h REL.h ABS.h MSC.h LED.h SND.h REP.h KEY.h BTN.h BUS.h SW.h
+
+ # default target
+@@ -45,7 +45,7 @@
+
+ install: build
+ $(INSTALL_DIR) $(bindir) $(mandir)/man8
+- $(INSTALL_BINARY) lsinput input-events input-kbd input-send input-recv $(bindir)
++ $(INSTALL_BINARY) lsinput input-events input-kbd $(bindir)
+ $(INSTALL_DATA) lsinput.man $(mandir)/man8/lsinput.8
+ $(INSTALL_DATA) input-kbd.man $(mandir)/man8/input-kbd.8
+ $(INSTALL_DATA) input-events.man $(mandir)/man8/input-events.8
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/input-events.man input-utils-0.0.20081014/input-events.man
+--- input-utils-0.0.20081014.orig/input-events.man 2005-07-27 14:17:04.000000000 +0000
++++ input-utils-0.0.20081014/input-events.man 2011-07-03 07:48:16.000000000 +0000
+@@ -1,7 +1,7 @@
+ .TH INPUT-EVENTS 8 "July 2005" "" ""
+ .SH NAME
+
+-input-events \- list input devices
++input-events \- print input events
+
+ .SH SYNOPSIS
+ \fBinput\-events \fR [\fB\-t\fR\ \fIsec\fR] [\fB\-g\fR]\ \fIdevnr\fR
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/input.h input-utils-0.0.20081014/input.h
+--- input-utils-0.0.20081014.orig/input.h 2008-10-14 10:27:01.000000000 +0000
++++ input-utils-0.0.20081014/input.h 2011-07-03 07:48:16.000000000 +0000
+@@ -1,7 +1,7 @@
+ #include <inttypes.h>
+
+ #include <sys/ioctl.h>
+-#include "linux-input.h"
++#include <linux/input.h>
+
+ #define ev_name(code) ((code) < EV_MAX && EV_NAME[code] ? EV_NAME[code] : "???")
+ #define ev_type_name(type, code) ((code) < EV_TYPE_MAX[type] && EV_TYPE_NAME[type][code] ? EV_TYPE_NAME[type][code] : "???")
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/input-kbd.c input-utils-0.0.20081014/input-kbd.c
+--- input-utils-0.0.20081014.orig/input-kbd.c 2008-10-14 10:27:01.000000000 +0000
++++ input-utils-0.0.20081014/input-kbd.c 2011-07-03 07:48:16.000000000 +0000
+@@ -36,7 +36,6 @@
+ entry.keycode = KEY_RESERVED;
+ rc = ioctl(fd, EVIOCGKEYCODE, &entry);
+ if (rc < 0) {
+- map->size--;
+ break;
+ }
+ if (map->size >= map->alloc) {
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/lirc.sh input-utils-0.0.20081014/lirc.sh
+--- input-utils-0.0.20081014.orig/lirc.sh 2005-11-28 14:07:00.000000000 +0000
++++ input-utils-0.0.20081014/lirc.sh 2011-07-03 07:48:16.000000000 +0000
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+-INPUT="linux-input.h"
++INPUT="/usr/include/linux/input.h"
+ cat <<EOF
+ begin remote
+ name linux-input-layer
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/lsinput.c input-utils-0.0.20081014/lsinput.c
+--- input-utils-0.0.20081014.orig/lsinput.c 2004-04-21 11:55:44.000000000 +0000
++++ input-utils-0.0.20081014/lsinput.c 2011-07-03 07:48:16.000000000 +0000
+@@ -1,5 +1,6 @@
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <sys/stat.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+
+@@ -10,14 +11,19 @@
+ static void list_devices(void)
+ {
+ int i,fd;
++ char filename[32];
++ struct stat statbuf;
+
+ for (i = 0; i < 32; i++) {
+- /* try to open */
+- fd = device_open(i,1);
+- if (-1 == fd)
+- return;
+- device_info(fd);
+- close(fd);
++ snprintf(filename,sizeof(filename), "/dev/input/event%d",i);
++ if (stat(filename, &statbuf) == 0) {
++ /* try to open */
++ fd = device_open(i,1);
++ if (-1 == fd)
++ return;
++ device_info(fd);
++ close(fd);
++ }
+ }
+ return;
+ }
+diff -Nuar --exclude '*.rej' --exclude '*.orig' input-utils-0.0.20081014.orig/name.sh input-utils-0.0.20081014/name.sh
+--- input-utils-0.0.20081014.orig/name.sh 2004-04-21 11:55:44.000000000 +0000
++++ input-utils-0.0.20081014/name.sh 2011-07-03 07:48:16.000000000 +0000
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+
+ TYPE="$1"
+-INPUT="linux-input.h"
++INPUT="/usr/include/linux/input.h"
+
+ awk "
+ /EV_VERSION/ { next };
diff --git a/sys-apps/input-utils/input-utils-0.0.1_pre20081014.ebuild b/sys-apps/input-utils/input-utils-0.0.1_pre20081014.ebuild
new file mode 100644
index 000000000000..d8a2f5fdf3ca
--- /dev/null
+++ b/sys-apps/input-utils/input-utils-0.0.1_pre20081014.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+MY_P="input-${PV/0.0.1_pre/}-101501"
+
+DESCRIPTION="Small collection of linux input layer utils"
+HOMEPAGE="http://dl.bytesex.org/cvs-snapshots/"
+SRC_URI="http://dl.bytesex.org/cvs-snapshots/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/input"
+
+src_prepare() {
+ # Ported from Debian
+ epatch "${FILESDIR}"/input-utils-0.0.1_pre20081014.patch
+ # version check stuff
+ epatch "${FILESDIR}"/input-utils-0.0.1-protocol-mismatch-fix.patch
+}
+
+src_install() {
+ make install bindir="${D}"/usr/bin mandir="${D}"/usr/share/man STRIP="" || die "make install failed"
+ dodoc lircd.conf
+ dodoc README
+}
diff --git a/sys-apps/input-utils/input-utils-1.1.ebuild b/sys-apps/input-utils/input-utils-1.1.ebuild
new file mode 100644
index 000000000000..a2db4cbe74b3
--- /dev/null
+++ b/sys-apps/input-utils/input-utils-1.1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+MY_PN="input"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Small collection of linux input layer utils"
+HOMEPAGE="https://www.kraxel.org/blog/linux/input/"
+SRC_URI="https://www.kraxel.org/releases/input/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ # Ported from Debian
+ #epatch "${FILESDIR}"/input-utils-0.0.1_pre20081014.patch
+ # version check stuff
+ #epatch "${FILESDIR}"/input-utils-0.0.1-protocol-mismatch-fix.patch
+ :
+}
+
+src_install() {
+ make install bindir="${D}"/usr/bin mandir="${D}"/usr/share/man STRIP="" || die "make install failed"
+ dodoc lircd.conf
+ dodoc README
+}
diff --git a/sys-apps/input-utils/metadata.xml b/sys-apps/input-utils/metadata.xml
new file mode 100644
index 000000000000..582146721cbe
--- /dev/null
+++ b/sys-apps/input-utils/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>zzam@gentoo.org</email>
+<name>Matthias Schwarzott</name>
+</maintainer>
+<maintainer>
+<email>robbat2@gentoo.org</email>
+<name>Robin H. Johnson</name>
+</maintainer>
+<longdescription lang="en">
+This is a collection of utilities which are useful when working with the input
+layer of the Linux kernel (version 2.6 and later). Included are utilities to
+list the input devices known to the kernel, show the input events that are
+received by a device, and query or modify keyboard maps.
+</longdescription>
+</pkgmetadata>
+
diff --git a/sys-apps/install-xattr/Manifest b/sys-apps/install-xattr/Manifest
new file mode 100644
index 000000000000..1a8e8a7dc0b4
--- /dev/null
+++ b/sys-apps/install-xattr/Manifest
@@ -0,0 +1,2 @@
+DIST install-xattr-0.4.tar.bz2 16073 SHA256 d769908e738d876bdd35308e3a9555c97872fb8633255e23eaa5a0d68cd10c6f SHA512 f682da111b9803e0ebe3dbc01bf7b921e0c3b12edce3f0f64b9d70e7e8fc84d586bf9612cd2bdc5c49a300cb4bd40b562f218a98e63951f5644d81aeab468361 WHIRLPOOL 719da63f05be2f277a9c968309306df5071d5804473fbd327d85e320ac8b86813face041098bef33723c5ea5aaa4c2862f47fa9accbc4de51638ddb3500354ba
+DIST install-xattr-0.5.tar.bz2 16136 SHA256 6062fbcb8f463a54be8c2eedff7bd12ab682972d688784054f4abdad4e050834 SHA512 0bbde3a548fc5062041b38f90ac09c402f3cb0aebf4f0c331552fc44d39dd3d5e4d73bca0811de36c53af8afa5d22e543a7c90107d272f2a1b97c819b244eb7c WHIRLPOOL 1aa3a06b069bb12b3933f2dfc81ff5bce8295c93c64421b898b70440427d5dde05f88ccac3eb7361c372a8656b42df8e24592f60bab7acc758bec9c672c81847
diff --git a/sys-apps/install-xattr/install-xattr-0.4.ebuild b/sys-apps/install-xattr/install-xattr-0.4.ebuild
new file mode 100644
index 000000000000..d85a1a9dca6f
--- /dev/null
+++ b/sys-apps/install-xattr/install-xattr-0.4.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+DESCRIPTION="Wrapper to coreutil's install to preserve Filesystem Extended Attributes"
+HOMEPAGE="http://dev.gentoo.org/~blueness/install-xattr/"
+
+inherit toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/elfix.git"
+ KEYWORDS=""
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/install-xattr/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
+ S=${WORKDIR}/${PN}
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+src_prepare() {
+ tc-export CC
+}
+
+src_compile() {
+ if [[ ${PV} == "9999" ]] ; then
+ cd "${WORKDIR}/${P}/misc/${PN}" || die
+ fi
+ default
+}
+
+src_install() {
+ if [[ ${PV} == "9999" ]] ; then
+ cd "${WORKDIR}/${P}/misc/${PN}" || die
+ fi
+ default
+}
+
+# We need to fix how tests are done
+src_test() {
+ true
+}
diff --git a/sys-apps/install-xattr/install-xattr-0.5.ebuild b/sys-apps/install-xattr/install-xattr-0.5.ebuild
new file mode 100644
index 000000000000..d882c819ccae
--- /dev/null
+++ b/sys-apps/install-xattr/install-xattr-0.5.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+DESCRIPTION="Wrapper to coreutil's install to preserve Filesystem Extended Attributes"
+HOMEPAGE="http://dev.gentoo.org/~blueness/install-xattr/"
+
+inherit toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/elfix.git"
+ KEYWORDS="alpha arm hppa ia64 sparc"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/install-xattr/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86"
+ S=${WORKDIR}/${PN}
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+src_prepare() {
+ tc-export CC
+}
+
+src_compile() {
+ if [[ ${PV} == "9999" ]] ; then
+ cd "${WORKDIR}/${P}/misc/${PN}" || die
+ fi
+ default
+}
+
+src_install() {
+ if [[ ${PV} == "9999" ]] ; then
+ cd "${WORKDIR}/${P}/misc/${PN}" || die
+ fi
+ default
+}
+
+# We need to fix how tests are done
+src_test() {
+ true
+}
diff --git a/sys-apps/install-xattr/install-xattr-9999.ebuild b/sys-apps/install-xattr/install-xattr-9999.ebuild
new file mode 100644
index 000000000000..b5baeb7ef650
--- /dev/null
+++ b/sys-apps/install-xattr/install-xattr-9999.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+DESCRIPTION="Wrapper to coreutil's install to preserve Filesystem Extended Attributes"
+HOMEPAGE="http://dev.gentoo.org/~blueness/install-xattr/"
+
+inherit toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/elfix.git"
+ KEYWORDS=""
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~blueness/install-xattr/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ S=${WORKDIR}/${PN}
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+
+src_prepare() {
+ tc-export CC
+}
+
+src_compile() {
+ if [[ ${PV} == "9999" ]] ; then
+ cd "${WORKDIR}/${P}/misc/${PN}" || die
+ fi
+ default
+}
+
+src_install() {
+ if [[ ${PV} == "9999" ]] ; then
+ cd "${WORKDIR}/${P}/misc/${PN}" || die
+ fi
+ default
+}
+
+# We need to fix how tests are done
+src_test() {
+ true
+}
diff --git a/sys-apps/install-xattr/metadata.xml b/sys-apps/install-xattr/metadata.xml
new file mode 100644
index 000000000000..3f1a615f77ac
--- /dev/null
+++ b/sys-apps/install-xattr/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>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+</maintainer>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-apps/intel-performance-counter-monitor/Manifest b/sys-apps/intel-performance-counter-monitor/Manifest
new file mode 100644
index 000000000000..fd3bb760cf56
--- /dev/null
+++ b/sys-apps/intel-performance-counter-monitor/Manifest
@@ -0,0 +1 @@
+DIST IntelPerformanceCounterMonitorV2.8.zip 931374 SHA256 3c51b2fc7b772f16f746ea6fda0471d280c0f27bfd52fa51dd78433ca5a6ca6a SHA512 7dbba8c051663a315dcf79224502d76cb4217a483a4b322f0be938e06b988e290a83b345cb8c60645aceb8283555067c2db529179782432ff77fddd538ef8b8f WHIRLPOOL 159015a5d37c7f64813a31892b615443471571e3d3bdf2d23cc4fba08819142bd4d7bf7565a9e15618ae6825f4c97cb630bb49aeb7bfbf1e5819960b99911905
diff --git a/sys-apps/intel-performance-counter-monitor/intel-performance-counter-monitor-2.8.ebuild b/sys-apps/intel-performance-counter-monitor/intel-performance-counter-monitor-2.8.ebuild
new file mode 100644
index 000000000000..918d13196ffb
--- /dev/null
+++ b/sys-apps/intel-performance-counter-monitor/intel-performance-counter-monitor-2.8.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 versionator fcaps
+
+MY_PN="IntelPerformanceCounterMonitor"
+MY_PV="V2.8"
+MY_P="${MY_PN}${MY_PV}.zip"
+
+DESCRIPTION="Intel Performance Counter Monitor - A better way to measure CPU utilization"
+HOMEPAGE="https://software.intel.com/en-us/articles/intel-performance-counter-monitor-a-better-way-to-measure-cpu-utilization"
+SRC_URI="http://dev.gentoo.org/~dlan/distfiles/${MY_P}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND=">=sys-devel/gcc-4:*"
+
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+CONFIG_CHECK="~X86_MSR ~PERF_EVENTS"
+ERROR_X86_MSR="Intel Performance Counter Monitor, requires X86_MSR to be set in kernel config."
+
+S="${WORKDIR}/IntelPerformanceCounterMonitor${MY_PV}"
+
+src_prepare() {
+ sed -i 's/^#CXXFLAGS += -DPCM_USE_PERF/CXXFLAGS += -DPCM_USE_PERF/' Makefile || die
+}
+
+src_install() {
+ exeinto /usr/bin
+ newexe pcm.x pcm
+ newexe pcm-memory.x pcm-memory
+ newexe pcm-msr.x pcm-msr
+ newexe pcm-numa.x pcm-numa
+ newexe pcm-pcie.x pcm-pcie
+ newexe pcm-power.x pcm-power
+ newexe pcm-sensor.x pcm-sensor
+ newexe pcm-tsx.x pcm-tsx
+}
+
+pkg_postinst() {
+ fcaps CAP_SYS_RAWIO usr/bin/pcm
+ fcaps CAP_SYS_RAWIO usr/bin/pcm-{memory,msr,numa,pcie,power,tsx}
+}
diff --git a/sys-apps/intel-performance-counter-monitor/metadata.xml b/sys-apps/intel-performance-counter-monitor/metadata.xml
new file mode 100644
index 000000000000..c63b19ffc98e
--- /dev/null
+++ b/sys-apps/intel-performance-counter-monitor/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>brendan@horan.hk</email>
+ <name>Brendan 'undersys' Horan</name>
+ <description>Primary Maintainer, Assign bugs to him</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/inxi/Manifest b/sys-apps/inxi/Manifest
new file mode 100644
index 000000000000..e8c0f701c709
--- /dev/null
+++ b/sys-apps/inxi/Manifest
@@ -0,0 +1,2 @@
+DIST inxi-2.2.14.tar.gz 179900 SHA256 c7acc482e860864d69365c2548b2efcfd334432dc053568a4dce37d6699146e5 SHA512 0cc5c1a6d6e3611e3203ca9747477316b6171a8926c33ce4b6f2531fa9c644fa4a7de654e78958efb770fdd0fd1c7ec734bc32e98d9651e3154ab5a2aee58f2d WHIRLPOOL f74ac82c213bc5949da2602d5a38abd061889877ceb6f0e3a2e4988b205d1179e1eac8a42a2402e064773b8ca124cba544e9e37fbb1d1d16b2c4d83e58ce0728
+DIST inxi-2.2.19.tar.gz 181796 SHA256 8611d5c906234b348fc46cd287660b7676a1a5cd85bd38367dad2e0ceb2e92df SHA512 002c33d3cb13269b91732be4f8704b1022d99d46fbb8630bd6f35d8609cbcde22b650da5ff93480a2d1acedfec40b47e8154b757d1a0291eb9d6917009331659 WHIRLPOOL 323b359b0d92959b9504d5a77f6a20194604de98ce8e0bb4f9d5c20610e4787d0247e78e0d93bd01818a906ff421face76704717c4caf1f2313728b66d53aef3
diff --git a/sys-apps/inxi/inxi-2.2.14.ebuild b/sys-apps/inxi/inxi-2.2.14.ebuild
new file mode 100644
index 000000000000..2e9a941885ca
--- /dev/null
+++ b/sys-apps/inxi/inxi-2.2.14.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A newer, better system information script for irc, administration, and system troubleshooters."
+HOMEPAGE="http://code.google.com/p/inxi/"
+SRC_URI="https://inxi.googlecode.com/svn/tarballs/${PN}_${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ >=app-shells/bash-3.0
+ sys-apps/coreutils
+ sys-apps/gawk
+ sys-apps/grep
+ sys-apps/pciutils
+ sys-process/procps
+ sys-apps/sed
+ "
+
+S=${WORKDIR}
+
+src_install() {
+ dobin ${PN}
+ doman ${PN}.1.gz
+}
+
+pkg_postinst() {
+ einfo "To view a short or full system information."
+ einfo "inxi -b for short information."
+ einfo "inxi -F for full information."
+ einfo "inxi also provides verbose levels '-v1 to -v7'."
+ einfo "inxi -h for help."
+}
diff --git a/sys-apps/inxi/inxi-2.2.19.ebuild b/sys-apps/inxi/inxi-2.2.19.ebuild
new file mode 100644
index 000000000000..f2d23b5986a7
--- /dev/null
+++ b/sys-apps/inxi/inxi-2.2.19.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A newer, better system information script for irc, administration, and system troubleshooters."
+HOMEPAGE="http://code.google.com/p/inxi/"
+SRC_URI="https://inxi.googlecode.com/svn/tarballs/${PN}_${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ >=app-shells/bash-3.0
+ sys-apps/coreutils
+ sys-apps/gawk
+ sys-apps/grep
+ sys-apps/pciutils
+ sys-process/procps
+ sys-apps/sed
+ "
+
+S=${WORKDIR}
+
+src_install() {
+ dobin ${PN}
+ doman ${PN}.1.gz
+}
+
+pkg_postinst() {
+ einfo "To view a short or full system information."
+ einfo "inxi -b for short information."
+ einfo "inxi -F for full information."
+ einfo "inxi also provides verbose levels '-v1 to -v7'."
+ einfo "inxi -h for help."
+}
diff --git a/sys-apps/inxi/metadata.xml b/sys-apps/inxi/metadata.xml
new file mode 100644
index 000000000000..61c052a97a13
--- /dev/null
+++ b/sys-apps/inxi/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>dastergon@gentoo.org</email>
+ <name>Pavlos Ratis</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/iotools/Manifest b/sys-apps/iotools/Manifest
new file mode 100644
index 000000000000..d12e009bef08
--- /dev/null
+++ b/sys-apps/iotools/Manifest
@@ -0,0 +1,2 @@
+DIST iotools-1.4.tar.gz 22217 SHA256 56e7348bb5b91f6b93a9b2759993545575eeb3fa5f9203a9cbb95dad9883807b SHA512 10b5f5c4183fb78900c254359b1d40d681519d4b0a79d10795c44d6f1691d73b93d02ede57cf84b5bac67e6083bc5a0de45c464caccbad8b2127a2c53cd7e94b WHIRLPOOL 808ba3b70c602ff0cdfe38ffcf7c1a3c4ab72cacf977ee8db34049159f20b034b48949f0bd70f1b27436f1183dda5cb677338f80afaf65ba1e1a0ec96a973418
+DIST iotools-1.5.tar.gz 23422 SHA256 3186ba296072f644dda881b78d77e3774b79e8cef3e828fffc947d558b08830d SHA512 d298343ee814c8b7d8404bc6af4050df730e89963a7c53798b3d251e94fd2b13e04c36e6da7ec5fd4126ea3a961be26a937910f791844e1b1d5b7dc5aa638c44 WHIRLPOOL 52d5aedf0ae4ee3257e19a6868f792e54b6ac9d79c0816c934b714811e4da0bc288a7f597098fd9ff2ed65f11cf486db1e2db76c85c0ecde0a095e09f24b2fbe
diff --git a/sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch b/sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch
new file mode 100644
index 000000000000..3fde16c6ca01
--- /dev/null
+++ b/sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch
@@ -0,0 +1,22 @@
+http://code.google.com/p/iotools/issues/detail?id=2
+
+--- a/misc.c
++++ b/misc.c
+@@ -149,8 +149,16 @@ cpuid_inline(int cpu, int function, int index, uint32_t *data)
+ }
+
+ asm volatile (
++#ifdef __i386__
++ "xchg %%ebx, %%esi;" /* save ebx (for PIC) */
++ "cpuid;"
++ "xchg %%esi, %%ebx;" /* restore ebx & pass to caller */
++ : "=S" (data[1]),
++#else
+ "cpuid\n\t"
+- : "=a" (data[0]), "=b" (data[1]), "=c" (data[2]), "=d" (data[3])
++ : "=b" (data[1]),
++#endif
++ "=a" (data[0]), "=c" (data[2]), "=d" (data[3])
+ : "0" (function), "2" (index)
+ : "memory"
+ );
diff --git a/sys-apps/iotools/files/iotools-1.4-ldflags.patch b/sys-apps/iotools/files/iotools-1.4-ldflags.patch
new file mode 100644
index 000000000000..242f6912b69a
--- /dev/null
+++ b/sys-apps/iotools/files/iotools-1.4-ldflags.patch
@@ -0,0 +1,13 @@
+http://code.google.com/p/iotools/issues/detail?id=3
+
+--- a/Makefile
++++ b/Makefile
+@@ -44,7 +44,7 @@ OBJS=$(OBJS_TO_BUILD)
+ all: $(BINARY)
+
+ $(BINARY): $(OBJS) iotools.o Makefile
+- $(CC) $(CFLAGS) -o $@ iotools.o $(OBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ iotools.o $(OBJS)
+
+ RUSER ?= root
+ RHOST ?=
diff --git a/sys-apps/iotools/iotools-1.4.ebuild b/sys-apps/iotools/iotools-1.4.ebuild
new file mode 100644
index 000000000000..2a145de079c0
--- /dev/null
+++ b/sys-apps/iotools/iotools-1.4.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Simple commands to access hardware device registers"
+HOMEPAGE="http://code.google.com/p/iotools/"
+SRC_URI="http://iotools.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="static make-symlinks"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cpuid-pic.patch
+ epatch "${FILESDIR}"/${P}-ldflags.patch
+ sed -i 's:-Werror::' Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ STATIC=$(usex static 1 0) \
+ IOTOOLS_DEBUG="${CFLAGS}"
+}
+
+src_install() {
+ dosbin iotools
+
+ # Note: This is done manually because invoking the iotools binary
+ # when cross-compiling will likely fail.
+ local known_cmds="and btr bts busy_loop cmos_read cmos_write cpu_list cpuid io_read16 io_read32 io_read8 io_write16 io_write32 io_write8 mmio_dump mmio_read16 mmio_read32 mmio_read64 mmio_read8 mmio_write16 mmio_write32 mmio_write64 mmio_write8 not or pci_list pci_read16 pci_read32 pci_read8 pci_write16 pci_write32 pci_write8 rdmsr rdtsc runon shl shr smbus_quick smbus_read16 smbus_read8 smbus_readblock smbus_receive_byte smbus_send_byte smbus_write16 smbus_write8 smbus_writeblock wrmsr xor"
+ if ! tc-is-cross-compiler ; then
+ local check_cmds=$(echo $(./iotools --list-cmds 2>/dev/null | grep '^ ' | LC_ALL=C sort))
+ if [[ ${known_cmds} != "${check_cmds:-${known_cmds}}" ]] ; then
+ eerror "known_cmds = ${known_cmds}"
+ eerror "check_cmds = ${check_cmds}"
+ die "need to update known_cmds cache in the ebuild"
+ fi
+ fi
+
+ if use make-symlinks ; then
+ local cmd
+ for cmd in ${known_cmds} ; do
+ dosym iotools /usr/sbin/${cmd}
+ done
+ fi
+}
diff --git a/sys-apps/iotools/iotools-1.5.ebuild b/sys-apps/iotools/iotools-1.5.ebuild
new file mode 100644
index 000000000000..6decae02b896
--- /dev/null
+++ b/sys-apps/iotools/iotools-1.5.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Simple commands to access hardware device registers"
+HOMEPAGE="http://code.google.com/p/iotools/"
+SRC_URI="http://iotools.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc x86"
+IUSE="static make-symlinks"
+
+src_prepare() {
+ sed -i 's:-Werror::' Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ STATIC=$(usex static 1 0) \
+ IOTOOLS_DEBUG="${CFLAGS}"
+}
+
+src_install() {
+ dosbin iotools
+
+ # Note: This is done manually because invoking the iotools binary
+ # when cross-compiling will likely fail.
+ local known_cmds="and btr bts busy_loop cmos_read cmos_write cpu_list mem_dump mem_read16 mem_read32 mem_read64 mem_read8 mem_write16 mem_write32 mem_write64 mem_write8 mmio_dump mmio_read16 mmio_read32 mmio_read64 mmio_read8 mmio_write16 mmio_write32 mmio_write64 mmio_write8 not or pci_list pci_read16 pci_read32 pci_read8 pci_write16 pci_write32 pci_write8 runon shl shr smbus_quick smbus_read16 smbus_read8 smbus_readblock smbus_receive_byte smbus_send_byte smbus_write16 smbus_write8 smbus_writeblock xor"
+ case ${ARCH} in
+ amd64|x86) known_cmds+=" cpuid io_read16 io_read32 io_read8 io_write16 io_write32 io_write8 rdmsr rdtsc wrmsr";;
+ esac
+ if ! tc-is-cross-compiler ; then
+ local sorted_cmds=$(echo $(printf '%s\n' ${known_cmds} | LC_ALL=C sort))
+ local check_cmds=$(echo $(./iotools --list-cmds 2>/dev/null | grep '^ ' | LC_ALL=C sort))
+ if [[ ${sorted_cmds} != "${check_cmds:-${sorted_cmds}}" ]] ; then
+ eerror "known_cmds = ${sorted_cmds}"
+ eerror "check_cmds = ${check_cmds}"
+ die "need to update known_cmds cache in the ebuild"
+ fi
+ fi
+
+ if use make-symlinks ; then
+ local cmd
+ for cmd in ${known_cmds} ; do
+ dosym iotools /usr/sbin/${cmd}
+ done
+ fi
+}
diff --git a/sys-apps/iotools/metadata.xml b/sys-apps/iotools/metadata.xml
new file mode 100644
index 000000000000..8c8fbb191c80
--- /dev/null
+++ b/sys-apps/iotools/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>vapier@gentoo.org</email>
+</maintainer>
+<use>
+ <flag name='make-symlinks'>Generate sub-command symlinks to iotools -- note that a lot are simple like "xor"</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/ipmitool/Manifest b/sys-apps/ipmitool/Manifest
new file mode 100644
index 000000000000..ee5c41a2fac9
--- /dev/null
+++ b/sys-apps/ipmitool/Manifest
@@ -0,0 +1,5 @@
+DIST ipmitool-1.8.11.tar.gz 769964 SHA256 5612f4835d89a6f2cede588eef978a05d63435cf2646256300d9785d8020a13e SHA512 48093790baf2532887ac87de9b55fbe38f46f271b84e6152e6b0ba11170b29aad78dfcd42036389750edbedff325476b8366b3ea1401b97148b8bc8c1bd71e4b WHIRLPOOL 1760b2cb00e0c7bdea4b4a916ff2d7035ca0fff948741897d5aa4f05487a36c1354b156e1b5a613fd3b3b1ce73d04fd48feffb702592421478c231bd7a0cc1fd
+DIST ipmitool-1.8.14.tar.gz 917886 SHA256 fe9bce4587f83fe0fd7c4d86fd3241fe41cb661ebc5c7321128d59cc295874ab SHA512 1376a0d4209e4622f9b0e27d3f3d67d552be936ded92e4e894d2b04871717a585075b54bbb9b91d62b58483ee9b94b5c64e2ecdfcef3c3f818fa6f035fb34216 WHIRLPOOL a16d965218829f1a1b29133e8722272d6062698c546f96de94385b3a62aef5d886e4890ad48ed43f04531a18d806a2a5a798f50ce9dadcb87ba17b2902cffdce
+DIST ipmitool_1.8.11-5ubuntu1.diff.gz 38287 SHA256 b31584ae6394e30b56eff4d4441c344c7ecb6d7a79a5846fd388544f28223775 SHA512 b54c19943bbed0d88831bd3821d05a650d151ddc7aca5cd7c5513bd07361a084595fcf2fa1035c784163d13fbbb9ce4496de478c4b4f730c31b4e2b94933584c WHIRLPOOL fa3c249074c328a8b8dd72f7744181e29ff01669c2226d24f781afffa3ca20301da87860f234eaf445fc74e50d9b149ad107aef1cf801717f33cc342ee037358
+DIST ipmitool_1.8.14-2.debian.tar.xz 14060 SHA256 be038241a77e9bf39e6b04494ba964682341e8de9b775bc98649387056fdf9b0 SHA512 9f4a6333461128d7c35317e2fbfd2061aef526cebffb3ee7ebc1273ca229811687ed469bfbcdc0855d575f5c4084da0cf225fd71380ca682531c23b976232e9f WHIRLPOOL 64b6aad18862288cc98acce5f552b251f22d38371822c5b027d7699468d56d5257235288a29e13c1fc475a5b87eb6a1d13bb77ff769f10e00f0e1c40be4100ec
+DIST ipmitool_1.8.14-4.debian.tar.xz 16452 SHA256 24b57ffec3ca1bda69f82b006a12a3ccd1e643b2e0250c0a670218e1e76a54dc SHA512 f7b464d9167e2c92b9536fee1e0cb66da11f6cdc6f86d7adb3ad5c239f3c1850663ddfd9571561502904daff52b3a57b633c389de697da42e7bfafe8c67a60a9 WHIRLPOOL a559a3c1771fc4e33b817977c8eb23372e27a3d2c1bcbc5eefd3e714bfa0da82d05e597dbb2afc8cbf52b6b5ffcde4273505cad5fedc4b8893809d691fa21fc5
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.confd b/sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.confd
new file mode 100644
index 000000000000..e6a355877b41
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.confd
@@ -0,0 +1,23 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+# /etc/conf.d/ipmievd
+
+# Interfaces:
+# open Linux OpenIPMI Interface
+# imb Intel IMB Interface
+# bmc IPMI v2.0 BMC interface
+# lan IPMI v1.5 LAN Interface
+# lanplus IPMI v2.0 RMCP+ LAN Interface
+
+INTERFACE="open"
+
+# Commands:
+# open Use OpenIPMI for asyncronous notification of events
+# sel Poll SEL for notification of events
+
+COMMAND="open"
+
+# Options.
+
+OPTIONS=""
diff --git a/sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.initd b/sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.initd
new file mode 100644
index 000000000000..463024f33111
--- /dev/null
+++ b/sys-apps/ipmitool/files/ipmitool-1.8.9-ipmievd.initd
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+# /etc/init.d/ipmievd
+
+depend() {
+ use logger
+}
+PN="ipmievd"
+
+start() {
+ /sbin/modprobe -sq ipmi_msghandler
+ /sbin/modprobe -sq ipmi_devintf
+ /sbin/modprobe -sq ipmi_si
+ ebegin "Starting ${PN}"
+ start-stop-daemon --start --pidfile /var/run/${PN}.pid0 --exec /usr/sbin/${PN} -- -I ${INTERFACE} ${OPTIONS} ${COMMAND}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${PN}"
+ start-stop-daemon --stop --pidfile /var/run/${PN}.pid0
+ eend $?
+}
diff --git a/sys-apps/ipmitool/ipmitool-1.8.11-r1.ebuild b/sys-apps/ipmitool/ipmitool-1.8.11-r1.ebuild
new file mode 100644
index 000000000000..7435501240d9
--- /dev/null
+++ b/sys-apps/ipmitool/ipmitool-1.8.11-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="Utility for controlling IPMI enabled devices"
+HOMEPAGE="http://ipmitool.sf.net/"
+DEBIAN_PR="5ubuntu1"
+DEBIAN_P="${P/-/_}"
+DEBIAN_PF="${DEBIAN_P}-${DEBIAN_PR}"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
+ https://launchpad.net/ubuntu/+archive/primary/+files/${DEBIAN_PF}.diff.gz"
+#IUSE="freeipmi openipmi"
+IUSE="openipmi"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ia64 ppc x86"
+LICENSE="BSD"
+
+RDEPEND="dev-libs/openssl"
+DEPEND="${RDEPEND}
+ openipmi? ( sys-libs/openipmi )
+ virtual/os-headers"
+ #freeipmi? ( sys-libs/freeipmi )
+# ipmitool CAN build against || ( sys-libs/openipmi sys-libs/freeipmi )
+# but it doesn't actually need either.
+
+src_prepare() {
+ epatch "${DISTDIR}"/${DEBIAN_PF}.diff.gz
+ for p in $(cat debian/patches/series) ; do
+ epatch debian/patches/$p
+ done
+}
+
+src_configure() {
+ # - LIPMI and BMC are the Solaris libs
+ # - OpenIPMI is unconditionally enabled in the configure as there is compat
+ # code that is used if the library itself is not available
+ # FreeIPMI does build now, but is disabled until the other arches keyword it
+ # `use_enable freeipmi intf-free` \
+ econf \
+ --enable-ipmievd \
+ --enable-ipmishell \
+ --enable-intf-lan \
+ --enable-intf-lanplus \
+ --enable-intf-open \
+ --disable-intf-free \
+ --disable-intf-imb \
+ --disable-intf-lipmi \
+ --disable-intf-bmc \
+ --disable-internal-md5 \
+ --with-kerneldir=/usr --bindir=/usr/sbin \
+ || die "econf failed"
+ # Fix linux/ipmi.h to compile properly. This is a hack since it doesn't
+ # include the below file to define some things.
+ echo "#include <asm/byteorder.h>" >>config.h
+}
+
+src_compile() {
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PACKAGE="${PF}" install || die "emake install failed"
+
+ into /usr
+ dosbin contrib/bmclanconf
+ rm -f "${D}"/usr/share/doc/${PF}/COPYING
+ docinto contrib
+ cd "${S}"/contrib
+ dodoc collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh README
+
+ newinitd "${FILESDIR}"/${PN}-1.8.9-ipmievd.initd ipmievd
+ newconfd "${FILESDIR}"/${PN}-1.8.9-ipmievd.confd ipmievd
+}
diff --git a/sys-apps/ipmitool/ipmitool-1.8.11.ebuild b/sys-apps/ipmitool/ipmitool-1.8.11.ebuild
new file mode 100644
index 000000000000..6aa39529e8a6
--- /dev/null
+++ b/sys-apps/ipmitool/ipmitool-1.8.11.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Utility for controlling IPMI enabled devices"
+HOMEPAGE="http://ipmitool.sf.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+#IUSE="freeipmi openipmi"
+IUSE="openipmi"
+SLOT="0"
+KEYWORDS="amd64 ~ia64 ppc x86"
+LICENSE="BSD"
+
+RDEPEND="dev-libs/openssl"
+DEPEND="${RDEPEND}
+ openipmi? ( sys-libs/openipmi )
+ virtual/os-headers"
+ #freeipmi? ( sys-libs/freeipmi )
+# ipmitool CAN build against || ( sys-libs/openipmi sys-libs/freeipmi )
+# but it doesn't actually need either.
+
+src_compile() {
+ # - LIPMI and BMC are the Solaris libs
+ # - OpenIPMI is unconditionally enabled in the configure as there is compat
+ # code that is used if the library itself is not available
+ # FreeIPMI does build now, but is disabled until the other arches keyword it
+ # `use_enable freeipmi intf-free` \
+ econf \
+ --enable-ipmievd \
+ --enable-ipmishell \
+ --enable-intf-lan \
+ --enable-intf-lanplus \
+ --enable-intf-open \
+ --disable-intf-free \
+ --disable-intf-imb \
+ --disable-intf-lipmi \
+ --disable-intf-bmc \
+ --disable-internal-md5 \
+ --with-kerneldir=/usr --bindir=/usr/sbin \
+ || die "econf failed"
+ # Fix linux/ipmi.h to compile properly. This is a hack since it doesn't
+ # include the below file to define some things.
+ echo "#include <asm/byteorder.h>" >>config.h
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PACKAGE="${PF}" install || die "emake install failed"
+
+ into /usr
+ dosbin contrib/bmclanconf
+ rm -f "${D}"/usr/share/doc/${PF}/COPYING
+ docinto contrib
+ cd "${S}"/contrib
+ dodoc collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh README
+ prepalldocs
+
+ newinitd "${FILESDIR}"/${PN}-1.8.9-ipmievd.initd ipmievd
+ newconfd "${FILESDIR}"/${PN}-1.8.9-ipmievd.confd ipmievd
+}
diff --git a/sys-apps/ipmitool/ipmitool-1.8.14-r1.ebuild b/sys-apps/ipmitool/ipmitool-1.8.14-r1.ebuild
new file mode 100644
index 000000000000..ac2258e2dc1a
--- /dev/null
+++ b/sys-apps/ipmitool/ipmitool-1.8.14-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
+
+DESCRIPTION="Utility for controlling IPMI enabled devices."
+HOMEPAGE="http://ipmitool.sf.net/"
+DEBIAN_PR="4.debian"
+DEBIAN_P="${P/-/_}"
+DEBIAN_PF="${DEBIAN_P}-${DEBIAN_PR}"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
+ https://launchpad.net/ubuntu/+archive/primary/+files/${DEBIAN_PF}.tar.xz"
+#IUSE="freeipmi openipmi status"
+IUSE="openipmi static"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ia64 ppc x86"
+LICENSE="BSD"
+
+RDEPEND="dev-libs/openssl"
+DEPEND="${RDEPEND}
+ openipmi? ( sys-libs/openipmi )
+ virtual/os-headers"
+ #freeipmi? ( sys-libs/freeipmi )
+# ipmitool CAN build against || ( sys-libs/openipmi sys-libs/freeipmi )
+# but it doesn't actually need either.
+
+src_prepare() {
+ [ -d "${S}"/debian ] && mv "${S}"/debian{,.package}
+ ln -s "${WORKDIR}"/debian "${S}"
+ for p in $(cat debian/patches/series) ; do
+ epatch debian/patches/$p
+ done
+}
+
+src_configure() {
+ # - LIPMI and BMC are the Solaris libs
+ # - OpenIPMI is unconditionally enabled in the configure as there is compat
+ # code that is used if the library itself is not available
+ # FreeIPMI does build now, but is disabled until the other arches keyword it
+ # `use_enable freeipmi intf-free` \
+ # --enable-ipmievd is now unconditional
+ econf \
+ $(use_enable static) \
+ --enable-ipmishell \
+ --enable-intf-lan \
+ --enable-intf-lanplus \
+ --enable-intf-open \
+ --enable-intf-serial \
+ --disable-intf-bmc \
+ --disable-intf-dummy \
+ --disable-intf-free \
+ --disable-intf-imb \
+ --disable-intf-lipmi \
+ --disable-internal-md5 \
+ --with-kerneldir=/usr --bindir=/usr/sbin \
+ || die "econf failed"
+ # Fix linux/ipmi.h to compile properly. This is a hack since it doesn't
+ # include the below file to define some things.
+ echo "#include <asm/byteorder.h>" >>config.h
+}
+
+src_compile() {
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PACKAGE="${PF}" install || die "emake install failed"
+
+ into /usr
+ dosbin contrib/bmclanconf
+ rm -f "${D}"/usr/share/doc/${PF}/COPYING
+ docinto contrib
+ cd "${S}"/contrib
+ dodoc collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh README
+
+ newinitd "${FILESDIR}"/${PN}-1.8.9-ipmievd.initd ipmievd
+ newconfd "${FILESDIR}"/${PN}-1.8.9-ipmievd.confd ipmievd
+ # TODO: init script for contrib/bmc-snmp-proxy
+ # TODO: contrib/exchange-bmc-os-info
+}
diff --git a/sys-apps/ipmitool/ipmitool-1.8.14.ebuild b/sys-apps/ipmitool/ipmitool-1.8.14.ebuild
new file mode 100644
index 000000000000..8f079fb631d8
--- /dev/null
+++ b/sys-apps/ipmitool/ipmitool-1.8.14.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="Utility for controlling IPMI enabled devices"
+HOMEPAGE="http://ipmitool.sf.net/"
+DEBIAN_PR="2.debian"
+DEBIAN_P="${P/-/_}"
+DEBIAN_PF="${DEBIAN_P}-${DEBIAN_PR}"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
+ https://launchpad.net/ubuntu/+archive/primary/+files/${DEBIAN_PF}.tar.xz"
+#IUSE="freeipmi openipmi"
+IUSE="openipmi"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~x86"
+LICENSE="BSD"
+
+RDEPEND="dev-libs/openssl"
+DEPEND="${RDEPEND}
+ openipmi? ( sys-libs/openipmi )
+ virtual/os-headers"
+ #freeipmi? ( sys-libs/freeipmi )
+# ipmitool CAN build against || ( sys-libs/openipmi sys-libs/freeipmi )
+# but it doesn't actually need either.
+
+src_prepare() {
+ [ -d "${S}"/debian ] && mv "${S}"/debian{,.package}
+ ln -s "${WORKDIR}"/debian "${S}"
+ for p in $(cat debian/patches/series) ; do
+ epatch debian/patches/$p
+ done
+}
+
+src_configure() {
+ # - LIPMI and BMC are the Solaris libs
+ # - OpenIPMI is unconditionally enabled in the configure as there is compat
+ # code that is used if the library itself is not available
+ # FreeIPMI does build now, but is disabled until the other arches keyword it
+ # `use_enable freeipmi intf-free` \
+ # --enable-ipmievd is now unconditional
+ econf \
+ --enable-ipmishell \
+ --enable-intf-lan \
+ --enable-intf-lanplus \
+ --enable-intf-open \
+ --enable-intf-serial \
+ --disable-intf-bmc \
+ --disable-intf-dummy \
+ --disable-intf-free \
+ --disable-intf-imb \
+ --disable-intf-lipmi \
+ --disable-internal-md5 \
+ --with-kerneldir=/usr --bindir=/usr/sbin \
+ || die "econf failed"
+ # Fix linux/ipmi.h to compile properly. This is a hack since it doesn't
+ # include the below file to define some things.
+ echo "#include <asm/byteorder.h>" >>config.h
+}
+
+src_compile() {
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PACKAGE="${PF}" install || die "emake install failed"
+
+ into /usr
+ dosbin contrib/bmclanconf
+ rm -f "${D}"/usr/share/doc/${PF}/COPYING
+ docinto contrib
+ cd "${S}"/contrib
+ dodoc collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh README
+
+ newinitd "${FILESDIR}"/${PN}-1.8.9-ipmievd.initd ipmievd
+ newconfd "${FILESDIR}"/${PN}-1.8.9-ipmievd.confd ipmievd
+ # TODO: init script for contrib/bmc-snmp-proxy
+ # TODO: contrib/exchange-bmc-os-info
+}
diff --git a/sys-apps/ipmitool/metadata.xml b/sys-apps/ipmitool/metadata.xml
new file mode 100644
index 000000000000..b8bcac27255f
--- /dev/null
+++ b/sys-apps/ipmitool/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>sysadmin</herd>
+ <use>
+ <flag name="openipmi">Use the system OpenIPMI implementation.</flag>
+ <!-- <flag name='freeipmi'>Use the system FreeIPMI implementation.</flag> -->
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ipmitool</remote-id>
+ <remote-id type="launchpad">ubuntu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/ipmiutil/Manifest b/sys-apps/ipmiutil/Manifest
new file mode 100644
index 000000000000..a1480d8a317a
--- /dev/null
+++ b/sys-apps/ipmiutil/Manifest
@@ -0,0 +1,4 @@
+DIST ipmiutil-2.7.7.tar.gz 1506067 SHA256 f899f04106c6098db3acadbbf19ee9c25a44d5c06b865f3eee3d94c6246075aa SHA512 1f01c00ea04bf1f736a6fb795a535eaba91d700488474ed8f65d521cbbf992dc980650f38cc542191b5e37e6011717e62158629e3b51a8dd6f73ac2959627f6e WHIRLPOOL 75eb9efa939a6263068589626c388d69ccc1f335084c0b20aad1f2e13357cecf99e94d9a5fa7af9c7f25d0553222c4d6bed0f167c239d1d7adf09341c58895ec
+DIST ipmiutil-2.8.2.tar.gz 1591876 SHA256 16f2181745030ae1e7110bf0c780760d4b2de0a47f9945c9a52314e4ef520988 SHA512 8af7e81065859eadb15530aed7a533fcb16e46d4adfa57f281bf0aa057b8e2bd520999a73f31fe3fc7f1eb2b617483078ad368772c89bbc30941aadb6be0ecc8 WHIRLPOOL 2343cde4c6c7525bcfd4a9c5454452f7d15f9ccaacf435c6f236b9f026f71319290ff0704cfde423be0609982bbfb5c850b310e7aefbe70dead609f68822ce86
+DIST ipmiutil-2.8.5.tar.gz 1615967 SHA256 6846e6621b9df23b1ed37662c075381dbb082f3e719803c9ef8784dd3154439c SHA512 42a0c50c88bfcfd49da0a1dc4b603eaf07eff041f2401a31421ea8e880b19cfb6ff3f33ceaf5ef044e16e58236390ff32420139ae683f9633b1c06631bc799c3 WHIRLPOOL 6ba37e1c59e28acca89f029ccfb179b5d285d1913930a0670a1c78ebd2f23e4e52910b75cb860d3f704fc9affbfa35ad0d4203a1b32794a957fbd13291e14f66
+DIST ipmiutil-2.9.3.tar.gz 1685718 SHA256 476c23997eba136553bfcbf3606337ffe020671aa8830695ff9d172bc9ed9eb7 SHA512 86d543dbc9ae684e288330e92f8f9b289f2c57311b10de0f2be0797ae7b939cbcd3c2c62f7c80eae5cb89d5ff2d721891619c18dff40ef03b9c870cd26bf6338 WHIRLPOOL 3231fb87e7a608924cb6613688b66292af3a767d3659a0611f22820ed872ec25551a40d74548b5221cc4f588f998c79c3d8cc18c7f4b7b40927139d073499460
diff --git a/sys-apps/ipmiutil/files/ipmiutil-2.9.3-flags.patch b/sys-apps/ipmiutil/files/ipmiutil-2.9.3-flags.patch
new file mode 100644
index 000000000000..25572ffa1b87
--- /dev/null
+++ b/sys-apps/ipmiutil/files/ipmiutil-2.9.3-flags.patch
@@ -0,0 +1,20 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -145,7 +145,7 @@
+ LANPLUS_CRYPTO=""
+ LANPLUS_SAM="no"
+ LD_SAMX=""
+- CFLAGS="-O2"
++# CFLAGS="-O2"
+ SUBDIR_S="doc scripts util"
+ if test "x$cross_compiling" = "xyes"; then
+ # cross-compiling, so link with -static (e.g. Android ARM)
+@@ -270,7 +270,7 @@
+ fi
+ rm -f $tmpc $tmpo >/dev/null 2>&1
+ echo $ECHO_N "checking compile fortify flags ... $ECHO_C"
+- cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
++# cfhard="-fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
+ echo "int main() { return(1); }" >$tmpc
+ gcc -o $tmpo -c $cfhard $tmpc >/dev/null 2>&1
+ if test $? -ne 0 ; then
diff --git a/sys-apps/ipmiutil/files/ipmiutil-2.9.3-tmpdir.patch b/sys-apps/ipmiutil/files/ipmiutil-2.9.3-tmpdir.patch
new file mode 100644
index 000000000000..73004f77aabb
--- /dev/null
+++ b/sys-apps/ipmiutil/files/ipmiutil-2.9.3-tmpdir.patch
@@ -0,0 +1,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -5,7 +5,7 @@
+ BUILDDIR = $(PKGDIR)/BUILD
+ RSPEC = doc/$(PACKAGE).spec
+ PNAME = $(PACKAGE)-$(VERSION)
+-TMPDIR = /var/tmp/$(PNAME)
++#TMPDIR = /var/tmp/$(PNAME)
+ BDIR = $(TMPDIR)-1-root
+ RPMB = rpmbuild
+ # $(RPMB) -bb --buildroot $(BDIR) $(RSPEC)
diff --git a/sys-apps/ipmiutil/ipmiutil-2.7.7.ebuild b/sys-apps/ipmiutil/ipmiutil-2.7.7.ebuild
new file mode 100644
index 000000000000..132bee1d68eb
--- /dev/null
+++ b/sys-apps/ipmiutil/ipmiutil-2.7.7.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit autotools
+
+DESCRIPTION="IPMI Management Utilities"
+HOMEPAGE="http://ipmiutil.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ initto="${D}"/usr/share/doc/${PF}/examples \
+ install
+
+ dodoc AUTHORS ChangeLog NEWS README TODO doc/UserGuide
+}
diff --git a/sys-apps/ipmiutil/ipmiutil-2.8.2.ebuild b/sys-apps/ipmiutil/ipmiutil-2.8.2.ebuild
new file mode 100644
index 000000000000..5e73f00a3341
--- /dev/null
+++ b/sys-apps/ipmiutil/ipmiutil-2.8.2.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 autotools systemd
+
+DESCRIPTION="IPMI Management Utilities"
+HOMEPAGE="http://ipmiutil.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/openssl-1:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+DOCS="AUTHORS ChangeLog NEWS README TODO doc/UserGuide"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-systemd --enable-sha256
+}
+
+src_install() {
+ emake DESTDIR="${D}" sysdto="${D}/$(systemd_get_unitdir)" install
+ rm -rf "${ED}"/etc/init.d # These are only for Fedora
+}
diff --git a/sys-apps/ipmiutil/ipmiutil-2.8.5.ebuild b/sys-apps/ipmiutil/ipmiutil-2.8.5.ebuild
new file mode 100644
index 000000000000..b308286c844f
--- /dev/null
+++ b/sys-apps/ipmiutil/ipmiutil-2.8.5.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit autotools systemd
+
+DESCRIPTION="IPMI Management Utilities"
+HOMEPAGE="http://ipmiutil.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~hppa x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/openssl-1:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-systemd --enable-sha256
+}
+
+src_install() {
+ emake DESTDIR="${D}" sysdto="${D}/$(systemd_get_unitdir)" install
+ dodoc -r AUTHORS ChangeLog NEWS README TODO doc/UserGuide
+
+ rm -r "${ED}"/etc/init.d || die 'remove initscripts failed' # These are only for Fedora
+}
diff --git a/sys-apps/ipmiutil/ipmiutil-2.9.3.ebuild b/sys-apps/ipmiutil/ipmiutil-2.9.3.ebuild
new file mode 100644
index 000000000000..6ff0038441f7
--- /dev/null
+++ b/sys-apps/ipmiutil/ipmiutil-2.9.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 autotools eutils systemd
+
+DESCRIPTION="IPMI Management Utilities"
+HOMEPAGE="http://ipmiutil.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+
+RDEPEND=">=dev-libs/openssl-1:0"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-flags.patch
+ epatch "${FILESDIR}"/${P}-tmpdir.patch
+
+ sed -i -e 's|-O2 -g|$(CFLAGS)|g;s|-g -O2|$(CFLAGS)|g' util/Makefile.am* || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --disable-systemd --enable-sha256
+}
+
+src_install() {
+ emake DESTDIR="${D}" sysdto="${D}/$(systemd_get_unitdir)" install
+ dodoc -r AUTHORS ChangeLog NEWS README TODO doc/UserGuide
+
+ rm -r "${ED}"/etc/init.d || die 'remove initscripts failed' # These are only for Fedora
+}
diff --git a/sys-apps/ipmiutil/metadata.xml b/sys-apps/ipmiutil/metadata.xml
new file mode 100644
index 000000000000..80daff455531
--- /dev/null
+++ b/sys-apps/ipmiutil/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>sysadmin</herd>
+ <upstream>
+ <remote-id type="sourceforge">ipmiutil</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/iproute2/Manifest b/sys-apps/iproute2/Manifest
new file mode 100644
index 000000000000..5593e6572192
--- /dev/null
+++ b/sys-apps/iproute2/Manifest
@@ -0,0 +1,8 @@
+DIST iproute2-2.6.38.tar.bz2 390166 SHA256 47629a4f547f21d94d8e823a87dd8e13042cadecefea2e2dc433e4134fa9aec4 SHA512 b3a0c15c41184554da1b7f2521f5f0586ae0df1a62899afe2514d4adb93f05ecfd10fc964e027ec8f83a990586f5858b0c9fb24ea8c78477ec6c7c51593c54bd WHIRLPOOL bbd3a415c8396adf1ab63f2f3c91591c65809f8da12f6333f6ea66997cbca428ec2339759f53d0bcc41a1e9c85718e598efde0206a000d394560cacc9a78e8cc
+DIST iproute2-3.17.0.tar.xz 440188 SHA256 09e406636e7598e46d5d4f7b928bf5db57049d65dbeb9a496005957ee16f6000 SHA512 1bc261526b0c72fe79b792f0ae497420ac66641dc24a067c903275c63b51b257f540ca6fc6a3d60f93f416c5111841ea53ca28b038e51217a24783171ee4dacd WHIRLPOOL 58bd417385272140260bbd56d379881f7218e789580b874dc9bed06931097a67286f5a63966a730362079aa83903c965dce84575283d656d47a665edbb9599c4
+DIST iproute2-3.19.0.tar.xz 455004 SHA256 e2f9f8c36e166f2ba6c0e1e7a9ad84cdf7c1615b93df49dac44563d7b57fd7b0 SHA512 fc533b6a526cfda234f043ac25302a3206a81ab2a740640b997b6bfb22e6f94ddc21b704191a358ea8721a327ba785e0224a4b4129111ef5008b4003379c3706 WHIRLPOOL 6a0aa1a948286d7dcb3663d787167c27760d756385295bf0ca631920aed50fbd984c19204247097116ef0d4e293c3c8dbe13b0b44c6ec83e7815a7461293c89f
+DIST iproute2-3.3.0.tar.bz2 416353 SHA256 f328ec01bac64854f477b9440b0bbeae91895b4ba266821597ceac6bd1501c3b SHA512 825b473e3fb17cf724bc389bb99dabbdabf9c5bfee89890f723027f3412a82a9c7f77ac8b792a218ff50dd552e31105206ccff1897b68fe201d83e5764032feb WHIRLPOOL 7827cb8d447eb86d89dc14dedecb94d7e1a9fc9380ee2130d28047f834f5b96045226409448a8f159501f9bd20b1eebe7c32ae17d5687c4c071459ae9c807ebc
+DIST iproute2-3.8.0.tar.xz 407608 SHA256 579145749f1aaf60e7c7a5de24b7f00fa2200a961094733c792b4ff139181e4f SHA512 0d93070044f573055a7cc58bd006e476f5b0fcb75cb5d49a37417aa7583e637a92e460947434cef9b9449267e4529c655a23b5ed3d549a2aba128148cb8d4ade WHIRLPOOL bfb29c34953f205f7c801a86a38f58d9352b716504649e61665ced6dd48557291412de5fd8987dbab44fbd397dab4a6b55d6c371c7cbaaea3d6e29269df115df
+DIST iproute2-4.0.0.tar.xz 459364 SHA256 5cd06eb1050b858b308b65705725042bb566fd261135e35a73dafb48cd632618 SHA512 8e0587ed484a9697af99b4f37b460fddd28136b3c19898a11809b1e8ca9a75a18dcc83bc512f5b74361e6128732e69a3e66b3a62c38a5ae5f13c3e18af186be4 WHIRLPOOL 6abdf2b4587abd7a73d2b7692a4bb478ac379dc3a27f564ad78e34f25f06ae5dd9e0e4873c6510d30767a398375dcdcd2da777412c725885e0c3d4bd89c71a9b
+DIST iproute2-4.1.0.tar.xz 495312 SHA256 d1326696c6a8f81ba66aaf48d858005cf280c81d3284d8d2c99748e3d0746146 SHA512 81faa393a2c7bf5286d7b54817646fb3763d66fbda8b6902e137061827fa1d54d58e9e4fb4f8415222f5adc1b0bec77b6ecf94d1b7cc11834283593208fb4209 WHIRLPOOL 938f0f68d74c8c1bef1be005b55b1b652bf74e23671d6fde493819058e1464c0f3931d69d7dbc398f0ed99ce42fa2bcd80c5207fabfdad78389e4e19b8051112
+DIST iproute2-4.1.1.tar.xz 496388 SHA256 73077a989efb934450bd655cbd9aaddaa747cb696c64d0c9a3323768a6a8e66f SHA512 af2e4021faf931d17a67c242c66b4f6a6ce93a69cee5408dd3951d488da511c99d693534e91d0a317bd82dfdcb6a543605cecf2514d512004639db8d17afb93e WHIRLPOOL 24542b56275675609aaad69ca68e89145d4da84ddb2429ae546179a249bcc1213f89168673657966122e01e992763fec053c118fbd69b7db1677ad7be97397b6
diff --git a/sys-apps/iproute2/files/iproute2-2.6.26-ldflags.patch b/sys-apps/iproute2/files/iproute2-2.6.26-ldflags.patch
new file mode 100644
index 000000000000..39e07995da5c
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.26-ldflags.patch
@@ -0,0 +1,15 @@
+respect env LDFLAGS
+
+http://bugs.gentoo.org/236861
+
+--- tc/Makefile
++++ tc/Makefile
+@@ -83,7 +83,7 @@
+ rm -f emp_ematch.yacc.output
+
+ q_atm.so: q_atm.c
+- $(CC) $(CFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
+
+ %.yacc.c: %.y
+ $(YACC) $(YACCFLAGS) -o $@ $<
diff --git a/sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch b/sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch
new file mode 100644
index 000000000000..8eb32280986e
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.29.1-flush.patch
@@ -0,0 +1,224 @@
+https://bugs.gentoo.org/274973
+
+If the routing table that I wanna flush has 60 entries or more, "ip route flush
+table foo" fails with the following error:
+ Failed to send flush request: Success
+ Flush terminated
+
+Patch by Alin Năstac <mrness@gentoo.org>
+
+--- iproute2-2.6.29-1/ip/ipaddress.c
++++ iproute2-2.6.29-1/ip/ipaddress.c
+@@ -37,6 +37,8 @@
+
+ #define MAX_ROUNDS 10
+
++static struct rtnl_handle rth_flush = { .fd = -1 };
++
+ static struct
+ {
+ int ifindex;
+@@ -339,7 +341,7 @@
+
+ static int flush_update(void)
+ {
+- if (rtnl_send_check(&rth, filter.flushb, filter.flushp) < 0) {
++ if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) {
+ perror("Failed to send flush request");
+ return -1;
+ }
+@@ -697,6 +699,9 @@
+ filter.flushp = 0;
+ filter.flushe = sizeof(flushb);
+
++ if (rtnl_open(&rth_flush, 0) < 0)
++ return 1;
++
+ while (round < MAX_ROUNDS) {
+ if (rtnl_wilddump_request(&rth, filter.family, RTM_GETADDR) < 0) {
+ perror("Cannot send dump request");
+@@ -715,18 +720,20 @@
+ printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":"");
+ }
+ fflush(stdout);
++ rtnl_close(&rth_flush);
+ return 0;
+ }
+ round++;
+ if (flush_update() < 0)
+- return 1;
++ break;
+
+ if (show_stats) {
+ printf("\n*** Round %d, deleting %d addresses ***\n", round, filter.flushed);
+ fflush(stdout);
+ }
+ }
+- fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", MAX_ROUNDS); fflush(stderr);
++ fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", round); fflush(stderr);
++ rtnl_close(&rth_flush);
+ return 1;
+ }
+
+--- iproute2-2.6.29-1/ip/ipneigh.c
++++ iproute2-2.6.29-1/ip/ipneigh.c
+@@ -32,6 +32,8 @@
+ #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)
+ #define MAX_ROUNDS 10
+
++static struct rtnl_handle rth_flush = { .fd = -1 };
++
+ static struct
+ {
+ int family;
+@@ -87,7 +89,7 @@
+
+ static int flush_update(void)
+ {
+- if (rtnl_send_check(&rth, filter.flushb, filter.flushp) < 0) {
++ if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) {
+ perror("Failed to send flush request");
+ return -1;
+ }
+@@ -391,6 +393,9 @@
+ filter.flushe = sizeof(flushb);
+ filter.state &= ~NUD_FAILED;
+
++ if (rtnl_open(&rth_flush, 0) < 0)
++ return 1;
++
+ while (round < MAX_ROUNDS) {
+ if (rtnl_wilddump_request(&rth, filter.family, RTM_GETNEIGH) < 0) {
+ perror("Cannot send dump request");
+@@ -409,18 +414,20 @@
+ printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":"");
+ }
+ fflush(stdout);
++ rtnl_close(&rth_flush);
+ return 0;
+ }
+ round++;
+ if (flush_update() < 0)
+- exit(1);
++ break;
++
+ if (show_stats) {
+ printf("\n*** Round %d, deleting %d entries ***\n", round, filter.flushed);
+ fflush(stdout);
+ }
+ }
+- printf("*** Flush not complete bailing out after %d rounds\n",
+- MAX_ROUNDS);
++ fprintf(stderr, "*** Flush remains incomplete after %d rounds. ***\n", round); fflush(stderr);
++ rtnl_close(&rth_flush);
+ return 1;
+ }
+
+--- iproute2-2.6.29-1/ip/iproute.c
++++ iproute2-2.6.29-1/ip/iproute.c
+@@ -37,6 +37,7 @@
+ #define RTAX_RTTVAR RTAX_HOPS
+ #endif
+
++static struct rtnl_handle rth_flush = { .fd = -1 };
+
+ static const char *mx_names[RTAX_MAX+1] = {
+ [RTAX_MTU] = "mtu",
+@@ -112,7 +113,7 @@
+
+ static int flush_update(void)
+ {
+- if (rtnl_send_check(&rth, filter.flushb, filter.flushp) < 0) {
++ if (rtnl_send_check(&rth_flush, filter.flushb, filter.flushp) < 0) {
+ perror("Failed to send flush request");
+ return -1;
+ }
+@@ -1210,6 +1211,9 @@
+ filter.flushp = 0;
+ filter.flushe = sizeof(flushb);
+
++ if (rtnl_open(&rth_flush, 0) < 0)
++ return 1;
++
+ for (;;) {
+ if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
+ perror("Cannot send dump request");
+@@ -1228,6 +1232,7 @@
+ printf("*** Flush is complete after %d round%s ***\n", round, round>1?"s":"");
+ }
+ fflush(stdout);
++ rtnl_close(&rth_flush);
+ return 0;
+ }
+ round++;
+--- iproute2-2.6.29-1/ip/xfrm_policy.c
++++ iproute2-2.6.29-1/ip/xfrm_policy.c
+@@ -756,11 +756,15 @@
+ struct xfrm_buffer xb;
+ char buf[NLMSG_DELETEALL_BUF_SIZE];
+ int i;
++ struct rtnl_handle rth2;
+
+ xb.buf = buf;
+ xb.size = sizeof(buf);
+ xb.rth = &rth;
+
++ if (rtnl_open(&rth2, 0) < 0)
++ exit(1);
++
+ for (i = 0; ; i++) {
+ xb.offset = 0;
+ xb.nlmsg_count = 0;
+@@ -783,7 +787,7 @@
+ break;
+ }
+
+- if (rtnl_send_check(&rth, xb.buf, xb.offset) < 0) {
++ if (rtnl_send_check(&rth2, xb.buf, xb.offset) < 0) {
+ perror("Failed to send delete-all request");
+ exit(1);
+ }
+@@ -793,6 +797,8 @@
+ xb.offset = 0;
+ xb.nlmsg_count = 0;
+ }
++
++ rtnl_close(&rth2);
+ } else {
+ if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETPOLICY) < 0) {
+ perror("Cannot send dump request");
+--- iproute2-2.6.29-1/ip/xfrm_state.c
++++ iproute2-2.6.29-1/ip/xfrm_state.c
+@@ -924,11 +924,15 @@
+ struct xfrm_buffer xb;
+ char buf[NLMSG_DELETEALL_BUF_SIZE];
+ int i;
++ struct rtnl_handle rth2;
+
+ xb.buf = buf;
+ xb.size = sizeof(buf);
+ xb.rth = &rth;
+
++ if (rtnl_open(&rth2, 0) < 0)
++ exit(1);
++
+ for (i = 0; ; i++) {
+ xb.offset = 0;
+ xb.nlmsg_count = 0;
+@@ -951,7 +955,7 @@
+ break;
+ }
+
+- if (rtnl_send_check(&rth, xb.buf, xb.offset) < 0) {
++ if (rtnl_send_check(&rth2, xb.buf, xb.offset) < 0) {
+ perror("Failed to send delete-all request\n");
+ exit(1);
+ }
+@@ -962,6 +966,7 @@
+ xb.nlmsg_count = 0;
+ }
+
++ rtnl_close(&rth2);
+ } else {
+ if (rtnl_wilddump_request(&rth, preferred_family, XFRM_MSG_GETSA) < 0) {
+ perror("Cannot send dump request");
diff --git a/sys-apps/iproute2/files/iproute2-2.6.29.1-hfsc.patch b/sys-apps/iproute2/files/iproute2-2.6.29.1-hfsc.patch
new file mode 100644
index 000000000000..4f39ded905c1
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.29.1-hfsc.patch
@@ -0,0 +1,885 @@
+http://bugs.gentoo.org/291907
+
+This patch was merged from two patches extracted from this thread:
+http://markmail.org/thread/qkd76gpdgefpjlfn
+
+Patch #1.
+This patch adds detailed documentation for HFSC scheduler. It roughly
+follows HFSC paper, but tries to not rely too much on math side of things.
+Post-paper/Linux specific subjects (timer resolution, ul service curve, etc.)
+are also discussed.
+
+
+I've read it many times over, but it's a lengthy chunk of text - so try
+to be understanding in case I made some mistakes.
+
+
+tc-hfsc(7): explains algorithm in detail (very long)
+tc-hfsc(8): explains command line options briefly
+tc(8): adds references to new man pages
+Makefile: adds man7 directory to install target
+q_hfsc.c: minimal help text changes, consistency with tc-hfsc(8)
+
+
+Patch #2.
+This adds generic explanation about size tables.
+
+
+tc-stab(8): Commandline + details
+One thing I'm not sure, is whenever any layer2 data is included in case
+of shaping directly on ppp interface (see the bottom of the man page).
+
+
+tc_stab.c: small fixes to commandline help
+
+
+tc_core.c:
+As kernel part of things relies on cell align which is always set to -1,
+I also added it to userspace computation stage. This way if someone
+specified e.g. 2048 and 512 for mtu and tsize respectively, one wouldn't
+end with tsize supporting mtu 4096 suddenly, New default mtu is also set
+to 2048 (disregarding weirdness of setting mtu to such values).
+
+
+Unless I missed something, this is harmless and feels cleaner, but if it's
+not allowed, documentation will have to be changed back to 2047 + extra
+explanation as well.
+
+--- iproute2/Makefile
++++ iproute2-new/Makefile
+@@ -56,6 +56,8 @@
+ install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
+ install -m 0755 -d $(DESTDIR)$(MANDIR)/man8
+ install -m 0644 $(shell find man/man8 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man8
++ install -m 0755 -d $(DESTDIR)$(MANDIR)/man7
++ install -m 0644 $(shell find man/man7 -maxdepth 1 -type f) $(DESTDIR)$(MANDIR)/man7
+ ln -sf tc-bfifo.8 $(DESTDIR)$(MANDIR)/man8/tc-pfifo.8
+ ln -sf lnstat.8 $(DESTDIR)$(MANDIR)/man8/rtstat.8
+ ln -sf lnstat.8 $(DESTDIR)$(MANDIR)/man8/ctstat.8
+--- iproute2/man/man7/tc-hfsc.7
++++ iproute2-new/man/man7/tc-hfsc.7
+@@ -0,0 +1,525 @@
++.TH HFSC 7 "25 February 2009" iproute2 Linux
++.ce 1
++\fBHIERARCHICAL FAIR SERVICE CURVE\fR
++.
++.SH "HISTORY & INTRODUCTION"
++.
++HFSC \- \fBHierarchical Fair Service Curve\fR was first presented at
++SIGCOMM'97. Developed as a part of ALTQ (ALTernative Queuing) on NetBSD, found
++its way quickly to other BSD systems, and then a few years ago became part of
++the linux kernel. Still, it's not the most popular scheduling algorithm \-
++especially if compared to HTB \- and it's not well documented from enduser's
++perspective. This introduction aims to explain how HFSC works without
++going to deep into math side of things (although some if it will be
++inevitable).
++
++In short HFSC aims to:
++.
++.RS 4
++.IP \fB1)\fR 4
++guarantee precise bandwidth and delay allocation for all leaf classes (realtime
++criterion)
++.IP \fB2)\fR
++allocate excess bandwidth fairly as specified by class hierarchy (linkshare &
++upperlimit criterion)
++.IP \fB3)\fR
++minimize any discrepancy between the service curve and the actual amount of
++service provided during linksharing
++.RE
++.PP
++.
++The main "selling" point of HFSC is feature \fB(1)\fR, which is achieved by
++using nonlinear service curves (more about what it actually is later). This is
++particularly useful in VoIP or games, where not only guarantee of consistent
++bandwidth is important, but initial delay of a data stream as well. Note that
++it matters only for leaf classes (where the actual queues are) \- thus class
++hierarchy is ignored in realtime case.
++
++Feature \fB(2)\fR is well, obvious \- any algorithm featuring class hierarchy
++(such as HTB or CBQ) strives to achieve that. HFSC does that well, although
++you might end with unusual situations, if you define service curves carelessly
++\- see section CORNER CASES for examples.
++
++Feature \fB(3)\fR is mentioned due to the nature of the problem. There may be
++situations where it's either not possible to guarantee service of all curves at
++the same time, and/or it's impossible to do so fairly. Both will be explained
++later. Note that this is mainly related to interior (aka aggregate) classes, as
++the leafs are already handled by \fB(1)\fR. Still \- it's perfectly possible to
++create a leaf class w/o realtime service, and in such case \- the caveats will
++naturally extend to leaf classes as well.
++
++.SH ABBREVIATIONS
++For the remaining part of the document, we'll use following shortcuts:
++.nf
++.RS 4
++
++RT \- realtime
++LS \- linkshare
++UL \- upperlimit
++SC \- service curve
++.fi
++.
++.SH "BASICS OF HFSC"
++.
++To understand how HFSC works, we must first introduce a service curve.
++Overall, it's a nondecreasing function of some time unit, returning amount of
++service (allowed or allocated amount of bandwidth) by some specific point in
++time. The purpose of it should be subconsciously obvious \- if a class was
++allowed to transfer not less than the amount specified by its service curve \-
++then service curve is not violated.
++
++Still \- we need more elaborate criterion than just the above (although in
++most generic case it can be reduced to it). The criterion has to take two
++things into account:
++.
++.RS 4
++.IP \(bu 4
++idling periods
++.IP \(bu
++ability to "look back", so if during current active period service curve is violated, maybe it
++isn't if we count excess bandwidth received during earlier active period(s)
++.RE
++.PP
++Let's define the criterion as follows:
++.RS 4
++.nf
++.IP "\fB(1)\fR" 4
++For each t1, there must exist t0 in set B, so S(t1\-t0)\~<=\~w(t0,t1)
++.fi
++.RE
++.
++.PP
++Here 'w' denotes the amount of service received during some time period between t0
++and t1. B is a set of all times, where a session becomes active after idling
++period (further denoted as 'becoming backlogged'). For a clearer picture,
++imagine two situations:
++.
++.RS 4
++.IP \fBa)\fR 4
++our session was active during two periods, with a small time gap between them
++.IP \fBb)\fR
++as in (a), but with a larger gap
++.RE
++.
++.PP
++Consider \fB(a)\fR \- if the service received during both periods meets
++\fB(1)\fR, then all is good. But what if it doesn't do so during the 2nd
++period ? If the amount of service received during the 1st period is bigger
++than the service curve, then it might compensate for smaller service during
++the 2nd period \fIand\fR the gap \- if the gap is small enough.
++
++If the gap is larger \fB(b)\fR \- then it's less likely to happen (unless the
++excess bandwidth allocated during the 1st part was really large). Still, the
++larger the gap \- the less interesting is what happened in the past (e.g. 10
++minutes ago) \- what matters is the current traffic that just started.
++
++From HFSC's perspective, more interesting is answering the following question:
++when should we start transferring packets, so a service curve of a class is not
++violated. Or rephrasing it: How much X() amount of service should a session
++receive by time t, so the service curve is not violated. Function X() defined
++as below is the basic building block of HFSC, used in: eligible, deadline,
++virtual\-time and fit\-time curves. Of course, X() is based on equation
++\fB(1)\fR and is defined recursively:
++
++.RS 4
++.IP \(bu 4
++At the 1st backlogged period beginning function X is initialized to generic
++service curve assigned to a class
++.IP \(bu
++At any subsequent backlogged period, X() is:
++.nf
++\fBmin(X() from previous period ; w(t0)+S(t\-t0) for t>=t0),\fR
++.fi
++\&... where t0 denotes the beginning of the current backlogged period.
++.RE
++.
++.PP
++HFSC uses either linear, or two\-piece linear service curves. In case of
++linear or two\-piece linear convex functions (first slope < second slope),
++min() in X's definition reduces to the 2nd argument. But in case of two\-piece
++concave functions, the 1st argument might quickly become lesser for some
++t>=t0. Note, that for some backlogged period, X() is defined only from that
++period's beginning. We also define X^(\-1)(w) as smallest t>=t0, for which
++X(t)\~=\~w. We have to define it this way, as X() is usually not an injection.
++
++The above generic X() can be one of the following:
++.
++.RS 4
++.IP "E()" 4
++In realtime criterion, selects packets eligible for sending. If none are
++eligible, HFSC will use linkshare criterion. Eligible time \&'et' is calculated
++with reference to packets' heads ( et\~=\~E^(\-1)(w) ). It's based on RT
++service curve, \fIbut in case of a convex curve, uses its 2nd slope only.\fR
++.IP "D()"
++In realtime criterion, selects the most suitable packet from the ones chosen
++by E(). Deadline time \&'dt' corresponds to packets' tails
++(dt\~=\~D^(\-1)(w+l), where \&'l' is packet's length). Based on RT service
++curve.
++.IP "V()"
++In linkshare criterion, arbitrates which packet to send next. Note that V() is
++function of a virtual time \- see \fBLINKSHARE CRITERION\fR section for
++details. Virtual time \&'vt' corresponds to packets' heads
++(vt\~=\~V^(\-1)(w)). Based on LS service curve.
++.IP "F()"
++An extension to linkshare criterion, used to limit at which speed linkshare
++criterion is allowed to dequeue. Fit\-time 'ft' corresponds to packets' heads
++as well (ft\~=\~F^(\-1)(w)). Based on UL service curve.
++.RE
++
++Be sure to make clean distinction between session's RT, LS and UL service
++curves and the above "utility" functions.
++.
++.SH "REALTIME CRITERION"
++.
++RT criterion \fIignores class hierarchy\fR and guarantees precise bandwidth and
++delay allocation. We say that packet is eligible for sending, when current real
++time is bigger than eligible time. From all packets eligible, the one most
++suited for sending, is the one with the smallest deadline time. Sounds simply,
++but consider following example:
++
++Interface 10mbit, two classes, both with two\-piece linear service curves:
++.RS 4
++.IP \(bu 4
++1st class \- 2mbit for 100ms, then 7mbit (convex \- 1st slope < 2nd slope)
++.IP \(bu
++2nd class \- 7mbit for 100ms, then 2mbit (concave \- 1st slope > 2nd slope)
++.RE
++.PP
++Assume for a moment, that we only use D() for both finding eligible packets,
++and choosing the most fitting one, thus eligible time would be computed as
++D^(\-1)(w) and deadline time would be computed as D^(\-1)(w+l). If the 2nd
++class starts sending packets 1 second after the 1st class, it's of course
++impossible to guarantee 14mbit, as the interface capability is only 10mbit.
++The only workaround in this scenario is to allow the 1st class to send the
++packets earlier that would normally be allowed. That's where separate E() comes
++to help. Putting all the math aside (see HFSC paper for details), E() for RT
++concave service curve is just like D(), but for the RT convex service curve \-
++it's constructed using \fIonly\fR RT service curve's 2nd slope (in our example
++\- 7mbit).
++
++The effect of such E() \- packets will be sent earlier, and at the same time
++D() \fIwill\fR be updated \- so current deadline time calculated from it will
++be bigger. Thus, when the 2nd class starts sending packets later, both the 1st
++and the 2nd class will be eligible, but the 2nd session's deadline time will be
++smaller and its packets will be sent first. When the 1st class becomes idle at
++some later point, the 2nd class will be able to "buffer" up again for later
++active period of the 1st class.
++
++A short remark \- in a situation, where the total amount of bandwidth
++available on the interface is bigger than the allocated total realtime parts
++(imagine interface 10 mbit, but 1mbit/2mbit and 2mbit/1mbit classes), the sole
++speed of the interface could suffice to guarantee the times.
++
++Important part of RT criterion is that apart from updating its D() and E(),
++also V() used by LS criterion is updated. Generally the RT criterion is
++secondary to LS one, and used \fIonly\fR if there's a risk of violating precise
++realtime requirements. Still, the "participation" in bandwidth distributed by
++LS criterion is there, so V() has to be updated along the way. LS criterion can
++than properly compensate for non\-ideal fair sharing situation, caused by RT
++scheduling. If you use UL service curve its F() will be updated as well (UL
++service curve is an extension to LS one \- see \fBUPPERLIMIT CRITERION\fR
++section).
++
++Anyway \- careless specification of LS and RT service curves can lead to
++potentially undesired situations (see CORNER CASES for examples). This wasn't
++the case in HFSC paper where LS and RT service curves couldn't be specified
++separately.
++
++.SH "LINKSHARING CRITERION"
++.
++LS criterion's task is to distribute bandwidth according to specified class
++hierarchy. Contrary to RT criterion, there're no comparisons between current
++real time and virtual time \- the decision is based solely on direct comparison
++of virtual times of all active subclasses \- the one with the smallest vt wins
++and gets scheduled. One immediate conclusion from this fact is that absolute
++values don't matter \- only ratios between them (so for example, two children
++classes with simple linear 1mbit service curves will get the same treatment
++from LS criterion's perspective, as if they were 5mbit). The other conclusion
++is, that in perfectly fluid system with linear curves, all virtual times across
++whole class hierarchy would be equal.
++
++Why is VC defined in term of virtual time (and what is it) ?
++
++Imagine an example: class A with two children \- A1 and A2, both with let's say
++10mbit SCs. If A2 is idle, A1 receives all the bandwidth of A (and update its
++V() in the process). When A2 becomes active, A1's virtual time is already
++\fIfar\fR bigger than A2's one. Considering the type of decision made by LS
++criterion, A1 would become idle for a lot of time. We can workaround this
++situation by adjusting virtual time of the class becoming active \- we do that
++by getting such time "up to date". HFSC uses a mean of the smallest and the
++biggest virtual time of currently active children fit for sending. As it's not
++real time anymore (excluding trivial case of situation where all classes become
++active at the same time, and never become idle), it's called virtual time.
++
++Such approach has its price though. The problem is analogous to what was
++presented in previous section and is caused by non\-linearity of service
++curves:
++.IP 1) 4
++either it's impossible to guarantee both service curves and satisfy fairness
++during certain time periods:
++
++.RS 4
++Recall the example from RT section, slightly modified (with 3mbit slopes
++instead of 2mbit ones):
++
++.IP \(bu 4
++1st class \- 3mbit for 100ms, then 7mbit (convex \- 1st slope < 2nd slope)
++.IP \(bu
++2nd class \- 7mbit for 100ms, then 3mbit (concave \- 1st slope > 2nd slope)
++
++.PP
++They sum up nicely to 10mbit \- interface's capacity. But if we wanted to only
++use LS for guarantees and fairness \- it simply won't work. In LS context,
++only V() is used for making decision which class to schedule. If the 2nd class
++becomes active when the 1st one is in its second slope, the fairness will be
++preserved \- ratio will be 1:1 (7mbit:7mbit), but LS itself is of course
++unable to guarantee the absolute values themselves \- as it would have to go
++beyond of what the interface is capable of.
++.RE
++
++.IP 2) 4
++and/or it's impossible to guarantee service curves of all classes at all
++
++.RS 4
++Even if we didn't use virtual time and allowed a session to be "punished",
++there's a possibility that service curves of all classes couldn't be
++guaranteed for a brief period. Consider following, a bit more complicated
++example:
++
++Root interface, classes A and B with concave and convex curve (summing up to
++root), A1 & A2 (children of A), \fIboth\fR with concave curves summing up to A,
++B1 & B2 (children of B), \fIboth\fR with convex curves summing up to B.
++
++Assume that A2, B1 and B2 are constantly backlogged, and at some later point
++A1 becomes backlogged. We can easily choose slopes, so that even if we
++"punish" A2 for earlier excess bandwidth received, A1 will have no chance of
++getting bandwidth corresponding to its first slope. Following from the above
++example:
++
++.nf
++A \- 7mbit, then 3mbit
++A1 \- 5mbit, then 2mbit
++A2 \- 2mbit, then 1mbit
++
++B \- 3mbit, then 7mbit
++B1 \- 2mbit, then 5mbit
++B2 \- 1mbit, then 2mbit
++.fi
++
++At the point when A1 starts sending, it should get 5mbit to not violate its
++service curve. A2 gets punished and doesn't send at all, B1 and B2 both keep
++sending at their 5mbit and 2mbit. But as you can see, we already are beyond
++interface's capacity \- at 12mbit. A1 could get 3mbit at most. If we used
++virtual times and kept fairness property, A1 and A2 would send at 3mbit
++together with 5:2 ratio (so respectively at ~2.14mbit and ~0.86mbit).
++.RE
++.
++.SH "UPPERLIMIT CRITERION"
++.
++UL criterion is an extensions to LS one, that permits sending packets only
++if current real time is bigger than fit\-time ('ft'). So the modified LS
++criterion becomes: choose the smallest virtual time from all active children,
++such that fit\-time < current real time also holds. Fit\-time is calculated
++from F(), which is based on UL service curve. As you can see, it's role is
++kinda similar to E() used in RT criterion. Also, for obvious reasons \- you
++can't specify UL service curve without LS one.
++
++Main purpose of UL service curve is to limit HFSC to bandwidth available on the
++upstream router (think adsl home modem/router, and linux server as
++nat/firewall/etc. with 100mbit+ connection to mentioned modem/router).
++Typically, it's used to create a single class directly under root, setting
++linear UL service curve to available bandwidth \- and then creating your class
++structure from that class downwards. Of course, you're free to add UL service
++(linear or not) curve to any class with LS criterion.
++
++Important part about UL service curve is, that whenever at some point in time
++a class doesn't qualify for linksharing due to its fit\-time, the next time it
++does qualify, it will update its virtual time to the smallest virtual time of
++all active children fit for linksharing. This way, one of the main things LS
++criterion tries to achieve \- equality of all virtual times across whole
++hierarchy \- is preserved (in perfectly fluid system with only linear curves,
++all virtual times would be equal).
++
++Without that, 'vt' would lag behind other virtual times, and could cause
++problems. Consider interface with capacity 10mbit, and following leaf classes
++(just in case you're skipping this text quickly \- this example shows behavior
++that \f(BIdoesn't happen\fR):
++
++.nf
++A \- ls 5.0mbit
++B \- ls 2.5mbit
++C \- ls 2.5mbit, ul 2.5mbit
++.fi
++
++If B was idle, while A and C were constantly backlogged, they would normally
++(as far as LS criterion is concerned) divide bandwidth in 2:1 ratio. But due
++to UL service curve in place, C would get at most 2.5mbit, and A would get the
++remaining 7.5mbit. The longer the backlogged period, the more virtual times of
++A and C would drift apart. If B became backlogged at some later point in time,
++its virtual time would be set to (A's\~vt\~+\~C's\~vt)/2, thus blocking A from
++sending any traffic, until B's virtual time catches up with A.
++.
++.SH "SEPARATE LS / RT SCs"
++.
++Another difference from original HFSC paper, is that RT and LS SCs can be
++specified separately. Moreover \- leaf classes are allowed to have only either
++RT SC or LS SC. For interior classes, only LS SCs make sense \- Any RT SC will
++be ignored.
++.
++.SH "CORNER CASES"
++.
++Separate service curves for LS and RT criteria can lead to certain traps,
++that come from "fighting" between ideal linksharing and enforced realtime
++guarantees. Those situations didn't exist in original HFSC paper, where
++specifying separate LS / RT service curves was not discussed.
++
++Consider interface with capacity 10mbit, with following leaf classes:
++
++.nf
++A \- ls 5.0mbit, rt 8mbit
++B \- ls 2.5mbit
++C \- ls 2.5mbit
++.fi
++
++Imagine A and C are constantly backlogged. As B is idle, A and C would divide
++bandwidth in 2:1 ratio, considering LS service curve (so in theory \- 6.66 and
++3.33). Alas RT criterion takes priority, so A will get 8mbit and LS will be
++able to compensate class C for only 2 mbit \- this will cause discrepancy
++between virtual times of A and C.
++
++Assume this situation lasts for a lot of time with no idle periods, and
++suddenly B becomes active. B's virtual time will be updated to
++(A's\~vt\~+\~C's\~vt)/2, effectively landing in the middle between A's and C's
++virtual time. The effect \- B, having no RT guarantees, will be punished and
++will not be allowed to transfer until C's virtual time catches up.
++
++If the interface had higher capacity \- for example 100mbit, this example
++would behave perfectly fine though.
++
++Let's look a bit closer at the above example \- it "cleverly" invalidates one
++of the basic things LS criterion tries to achieve \- equality of all virtual
++times across class hierarchy. Leaf classes without RT service curves are
++literally left to their own fate (governed by messed up virtual times).
++
++Also - it doesn't make much sense. Class A will always be guaranteed up to
++8mbit, and this is more than any absolute bandwidth that could happen from its
++LS criterion (excluding trivial case of only A being active). If the bandwidth
++taken by A is smaller than absolute value from LS criterion, the unused part
++will be automatically assigned to other active classes (as A has idling periods
++in such case). The only "advantage" is, that even in case of low bandwidth on
++average, bursts would be handled at the speed defined by RT criterion. Still,
++if extra speed is needed (e.g. due to latency), non linear service curves
++should be used in such case.
++
++In the other words - LS criterion is meaningless in the above example.
++
++You can quickly "workaround" it by making sure each leaf class has RT service
++curve assigned (thus guaranteeing all of them will get some bandwidth), but it
++doesn't make it any more valid.
++.
++.SH "LINUX AND TIMER RESOLUTION"
++.
++In certain situations, the scheduler can throttle itself and setup so
++called watchdog to wakeup dequeue function at some time later. In case of HFSC
++it happens when for example no packet is eligible for scheduling, and UL
++service curve is used to limit the speed at which LS criterion is allowed to
++dequeue packets. It's called throttling, and accuracy of it is dependent on
++how the kernel is compiled.
++
++There're 3 important options in modern kernels, as far as timers' resolution
++goes: \&'tickless system', \&'high resolution timer support' and \&'timer
++frequency'.
++
++If you have \&'tickless system' enabled, then the timer interrupt will trigger
++as slowly as possible, but each time a scheduler throttles itself (or any
++other part of the kernel needs better accuracy), the rate will be increased as
++needed / possible. The ceiling is either \&'timer frequency' if \&'high
++resolution timer support' is not available or not compiled in. Otherwise it's
++hardware dependent and can go \fIfar\fR beyond the highest \&'timer frequency'
++setting available.
++
++If \&'tickless system' is not enabled, the timer will trigger at a fixed rate
++specified by \&'timer frequency' \- regardless if high resolution timers are
++or aren't available.
++
++This is important to keep those settings in mind, as in scenario like: no
++tickless, no HR timers, frequency set to 100hz \- throttling accuracy would be
++at 10ms. It doesn't automatically mean you would be limited to ~0.8mbit/s
++(assuming packets at ~1KB) \- as long as your queues are prepared to cover for
++timer inaccuracy. Of course, in case of e.g. locally generated udp traffic \-
++appropriate socket size is needed as well. Short example to make it more
++understandable (assume hardcore anti\-schedule settings \- HZ=100, no HR
++timers, no tickless):
++
++.nf
++tc qdisc add dev eth0 root handle 1:0 hfsc default 1
++tc class add dev eth0 parent 1:0 classid 1:1 hfsc rt m2 10mbit
++.fi
++
++Assuming packet of ~1KB size and HZ=100, that averages to ~0.8mbit \- anything
++beyond it (e.g. the above example with specified rate over 10x bigger) will
++require appropriate queuing and cause bursts every ~10 ms. As you can
++imagine, any HFSC's RT guarantees will be seriously invalidated by that.
++Aforementioned example is mainly important if you deal with old hardware \- as
++it's particularly popular for home server chores. Even then, you can easily
++set HZ=1000 and have very accurate scheduling for typical adsl speeds.
++
++Anything modern (apic or even hpet msi based timers + \&'tickless system')
++will provide enough accuracy for superb 1gbit scheduling. For example, on one
++of basically cheap dual core AMD boards I have with following settings:
++
++.nf
++tc qdisc add dev eth0 parent root handle 1:0 hfsc default 1
++tc class add dev eth0 paretn 1:0 classid 1:1 hfsc rt m2 300mbit
++.fi
++
++And simple:
++
++.nf
++nc \-u dst.host.com 54321 </dev/zero
++nc \-l \-p 54321 >/dev/null
++.fi
++
++\&...will yield following effects over period of ~10 seconds (taken from
++/proc/interrupts):
++
++.nf
++319: 42124229 0 HPET_MSI\-edge hpet2 (before)
++319: 42436214 0 HPET_MSI\-edge hpet2 (after 10s.)
++.fi
++
++That's roughly 31000/s. Now compare it with HZ=1000 setting. The obvious
++drawback of it is that cpu load can be rather extensive with servicing that
++many timer interrupts. Example with 300mbit RT service curve on 1gbit link is
++particularly ugly, as it requires a lot of throttling with minuscule delays.
++
++Also note that it's just an example showing capability of current hardware.
++The above example (essentially 300mbit TBF emulator) is pointless on internal
++interface to begin with \- you will pretty much always want regular LS service
++curve there, and in such scenario HFSC simply doesn't throttle at all.
++
++300mbit RT service curve (selected columns from mpstat \-P ALL 1):
++
++.nf
++10:56:43 PM CPU %sys %irq %soft %idle
++10:56:44 PM all 20.10 6.53 34.67 37.19
++10:56:44 PM 0 35.00 0.00 63.00 0.00
++10:56:44 PM 1 4.95 12.87 6.93 73.27
++.fi
++
++So, in rare case you need those speeds with only RT service curve, or with UL
++service curve \- remember about drawbacks.
++.
++.SH "LAYER2 ADAPTATION"
++.
++Please refer to \fBtc\-stab\fR(8)
++.
++.SH "SEE ALSO"
++.
++\fBtc\fR(8), \fBtc\-hfsc\fR(8), \fBtc\-stab\fR(8)
++
++Please direct bugreports and patches to: <net...@vger.kernel.org>
++.
++.SH "AUTHOR"
++.
++Manpage created by Michal Soltys (sol...@ziu.info)
+--- iproute2/man/man8/tc.8
++++ iproute2-new/man/man8/tc.8
+@@ -368,12 +368,15 @@
+ .SH SEE ALSO
+ .BR tc-cbq (8),
+ .BR tc-htb (8),
++.BR tc-hfsc (8),
++.BR tc-hfsc (7),
+ .BR tc-sfq (8),
+ .BR tc-red (8),
+ .BR tc-tbf (8),
+ .BR tc-pfifo (8),
+ .BR tc-bfifo (8),
+ .BR tc-pfifo_fast (8),
++.BR tc-stab (8),
+ .br
+ .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
+
+--- iproute2/man/man8/tc-hfsc.8
++++ iproute2-new/man/man8/tc-hfsc.8
+@@ -0,0 +1,61 @@
++.TH HFSC 8 "25 February 2009" iproute2 Linux
++.
++.SH NAME
++HFSC \- Hierarchical Fair Service Curve's control under linux
++.
++.SH SYNOPSIS
++.nf
++tc qdisc add ... hfsc [ \fBdefault\fR CLASSID ]
++
++tc class add ... hfsc [ [ \fBrt\fR SC ] [ \fBls\fR SC ] | [ \fBsc\fR SC ] ] [ \fBul\fR SC ]
++
++\fBrt\fR : realtime service curve
++\fBls\fR : linkshare service curve
++\fBsc\fR : rt+ls service curve
++\fBul\fR : upperlimit service curve
++
++\(bu at least one of \fBrt\fR, \fBls\fR or \fBsc\fR must be specified
++\(bu \fBul\fR can only be specified with \fBls\fR or \fBsc\fR
++.
++.IP "SC := [ [ \fBm1\fR BPS ] \fBd\fR SEC ] \fBm2\fR BPS"
++\fBm1\fR : slope of the first segment
++\fBd\fR : x\-coordinate of intersection
++\fBm2\fR : slope of the second segment
++.PP
++.IP "SC := [ [ \fBumax\fR BYTE ] \fBdmax\fR SEC ] \fBrate\fR BPS"
++\fBumax\fR : maximum unit of work
++\fBdmax\fR : maximum delay
++\fBrate\fR : rate
++.PP
++.fi
++For description of BYTE, BPS and SEC \- please see \fBUNITS\fR
++section of \fBtc\fR(8).
++.
++.SH DESCRIPTION (qdisc)
++HFSC qdisc has only one optional parameter \- \fBdefault\fR. CLASSID specifies
++the minor part of the default classid, where packets not classified by other
++means (e.g. u32 filter, CLASSIFY target of iptables) will be enqueued. If
++\fBdefault\fR is not specified, unclassified packets will be dropped.
++.
++.SH DESCRIPTION (class)
++HFSC class is used to create a class hierarchy for HFSC scheduler. For
++explanation of the algorithm, and the meaning behind \fBrt\fR, \fBls\fR,
++\fBsc\fR and \fBul\fR service curves \- please refer to \fBtc\-hfsc\fR(7).
++
++As you can see in \fBSYNOPSIS\fR, service curve (SC) can be specified in two
++ways. Either as maximum delay for certain amount of work, or as a bandwidth
++assigned for certain amount of time. Obviously, \fBm1\fR is simply
++\fBumax\fR/\fBdmax\fR.
++
++Both \fBm2\fR and \fBrate\fR are mandatory. If you omit other
++parameters, you will specify linear service curve.
++.
++.SH "SEE ALSO"
++.
++\fBtc\fR(8), \fBtc\-hfsc\fR(7), \fBtc\-stab\fR(8)
++
++Please direct bugreports and patches to: <net...@vger.kernel.org>
++.
++.SH "AUTHOR"
++.
++Manpage created by Michal Soltys (sol...@ziu.info)
+--- iproute2/man/man8/tc-stab.8
++++ iproute2-new/man/man8/tc-stab.8
+@@ -0,0 +1,156 @@
++.TH STAB 8 "25 February 2009" iproute2 Linux
++.
++.SH NAME
++tc\-stab \- Generic size table manipulations
++.
++.SH SYNOPSIS
++.nf
++tc qdisc add ... stab \\
++.RS 4
++[ \fBmtu\fR BYTES ] [ \fBtsize\fR SLOTS ] \\
++[ \fBmpu\fR BYTES ] [ \fBoverhead\fR BYTES ] [ \fBlinklayer\fR TYPE ] ...
++.RE
++
++TYPE := adsl | atm | ethernet
++.fi
++
++For the description of BYTES \- please refer to the \fBUNITS\fR
++section of \fBtc\fR(8).
++
++.IP \fBmtu\fR 4
++.br
++maximum packet size we create size table for, assumed 2048 if not specified explicitly
++.IP \fBtsize\fR
++.br
++required table size, assumed 512 if not specified explicitly
++.IP \fBmpu\fR
++.br
++minimum packet size used in computations
++.IP \fBoverhead\fR
++.br
++per\-packet size overhead (can be negative) used in computations
++.IP \fBlinklayer\fR
++.br
++required linklayer adaptation.
++.PP
++.
++.SH DESCRIPTION
++.
++Size tables allow manipulation of packet size, as seen by whole scheduler
++framework (of course, the actual packet size remains the same). Adjusted packet
++size is calculated only once \- when a qdisc enqueues the packet. Initial root
++enqueue initializes it to the real packet's size.
++
++Each qdisc can use different size table, but the adjusted size is stored in
++area shared by whole qdisc hierarchy attached to the interface (technically,
++it's stored in skb). The effect is, that if you have such setup, the last qdisc
++with a stab in a chain "wins". For example, consider HFSC with simple pfifo
++attached to one of its leaf classes. If that pfifo qdisc has stab defined, it
++will override lengths calculated during HFSC's enqueue, and in turn, whenever
++HFSC tries to dequeue a packet, it will use potentially invalid size in its
++calculations. Normal setups will usually include stab defined only on root
++qdisc, but further overriding gives extra flexibility for less usual setups.
++
++Initial size table is calculated by \fBtc\fR tool using \fBmtu\fR and
++\fBtsize\fR parameters. The algorithm sets each slot's size to the smallest
++power of 2 value, so the whole \fBmtu\fR is covered by the size table. Neither
++\fBtsize\fR, nor \fBmtu\fR have to be power of 2 value, so the size
++table will usually support more than is required by \fBmtu\fR.
++
++For example, with \fBmtu\fR\~=\~1500 and \fBtsize\fR\~=\~128, a table with 128
++slots will be created, where slot 0 will correspond to sizes 0\-16, slot 1 to
++17\~\-\~32, \&..., slot 127 to 2033\~\-\~2048. Note, that the sizes
++are shifted 1 byte (normally you would expect 0\~\-\~15, 16\~\-\~31, \&...,
++2032\~\-\~2047). Sizes assigned to each slot depend on \fBlinklayer\fR parameter.
++
++Stab calculation is also safe for an unusual case, when a size assigned to a
++slot would be larger than 2^16\-1 (you will lose the accuracy though).
++
++During kernel part of packet size adjustment, \fBoverhead\fR will be added to
++original size, and after subtracting 1 (to land in the proper slot \- see above
++about shifting by 1 byte) slot will be calculated. If the size would cause
++overflow, more than 1 slot will be used to get the final size. It of course will
++affect accuracy, but it's only a guard against unusual situations.
++
++Currently there're two methods of creating values stored in the size table \-
++ethernet and atm (adsl):
++
++.IP ethernet 4
++.br
++This is basically 1\-1 mapping, so following our example from above
++(disregarding \fBmpu\fR for a moment) slot 0 would have 8, slot 1 would have 16
++and so on, up to slot 127 with 2048. Note, that \fBmpu\fR\~>\~0 must be
++specified, and slots that would get less than specified by \fBmpu\fR, will get
++\fBmpu\fR instead. If you don't specify \fBmpu\fR, the size table will not be
++created at all, although any \fBoverhead\fR value will be respected during
++calculations.
++.IP "atm, adsl"
++.br
++ATM linklayer consists of 53 byte cells, where each of them provides 48 bytes
++for payload. Also all the cells must be fully utilized, thus the last one is
++padded if/as necessary.
++
++When size table is calculated, adjusted size that fits properly into lowest
++amount of cells is assigned to a slot. For example, a 100 byte long packet
++requires three 48\-byte payloads, so the final size would require 3 ATM cells
++\- 159 bytes.
++
++For ATM size tables, 16\~bytes sized slots are perfectly enough. The default
++values of \fBmtu\fR and \fBtsize\fR create 4\~bytes sized slots.
++.PP
++.
++.SH "TYPICAL OVERHEADS"
++The following values are typical for different adsl scenarios (based on
++\fB[1]\fR and \fB[2]\fR):
++
++.nf
++LLC based:
++.RS 4
++PPPoA \- 14 (PPP \- 2, ATM \- 12)
++PPPoE \- 40+ (PPPoE \- 8, ATM \- 18, ethernet 14, possibly FCS \- 4+padding)
++Bridged \- 32 (ATM \- 18, ethernet 14, possibly FCS \- 4+padding)
++IPoA \- 16 (ATM \- 16)
++.RE
++
++VC Mux based:
++.RS 4
++PPPoA \- 10 (PPP \- 2, ATM \- 8)
++PPPoE \- 32+ (PPPoE \- 8, ATM \- 10, ethernet 14, possibly FCS \- 4+padding)
++Bridged \- 24+ (ATM \- 10, ethernet 14, possibly FCS \- 4+padding)
++IPoA \- 8 (ATM \- 8)
++.RE
++.fi
++\p There're few important things regarding the above overheads:
++.
++.IP \(bu 4
++IPoA in LLC case requires SNAP, instead of LLC\-NLPID (see rfc2684) \- this is
++the reason, why it actually takes more space than PPPoA.
++.IP \(bu
++In rare cases, FCS might be preserved on protocols that include ethernet frame
++(Bridged and PPPoE). In such situation, any ethernet specific padding
++guaranteeing 64 bytes long frame size has to be included as well (see rfc2684).
++In the other words, it also guarantees that any packet you send will take
++minimum 2 atm cells. You should set \fBmpu\fR accordingly for that.
++.IP \(bu
++When size table is consulted, and you're shaping traffic for the sake of
++another modem/router, ethernet header (without padding) will already be added
++to initial packet's length. You should compensate for that by subtracting 14
++from the above overheads in such case. If you're shaping directly on the router
++(for example, with speedtouch usb modem) using ppp daemon, layer2 header will
++not be added yet.
++
++For more thorough explanations, please see \fB[1]\fR and \fB[2]\fR.
++.
++.SH "SEE ALSO"
++.
++\fBtc\fR(8), \fBtc\-hfsc\fR(7), \fBtc\-hfsc\fR(8),
++.br
++\fB[1]\fR http://ace\-host.stuart.id.au/russell/files/tc/tc\-atm/
++.br
++\fB[2]\fR http://www.faqs.org/rfcs/rfc2684.html
++
++Please direct bugreports and patches to: <net...@vger.kernel.org>
++.
++.SH "AUTHOR"
++.
++Manpage created by Michal Soltys (sol...@ziu.info)
+--- iproute2/tc/q_hfsc.c
++++ iproute2-new/tc/q_hfsc.c
+@@ -43,7 +43,7 @@
+ fprintf(stderr,
+ "Usage: ... hfsc [ [ rt SC ] [ ls SC ] | [ sc SC ] ] [ ul SC ]\n"
+ "\n"
+- "SC := [ [ m1 BPS ] [ d SEC ] m2 BPS\n"
++ "SC := [ [ m1 BPS ] d SEC ] m2 BPS\n"
+ "\n"
+ " m1 : slope of first segment\n"
+ " d : x-coordinate of intersection\n"
+@@ -57,6 +57,10 @@
+ " dmax : maximum delay\n"
+ " rate : rate\n"
+ "\n"
++ "Remarks:\n"
++ " - at least one of 'rt', 'ls' or 'sc' must be specified\n"
++ " - 'ul' can only be specified with 'ls' or 'sc'\n"
++ "\n"
+ );
+ }
+
+--- iproute2/tc/tc_core.c
++++ iproute2-new/tc/tc_core.c
+@@ -155,12 +155,12 @@
+ }
+
+ if (s->mtu == 0)
+- s->mtu = 2047;
++ s->mtu = 2048;
+ if (s->tsize == 0)
+ s->tsize = 512;
+
+ s->cell_log = 0;
+- while ((s->mtu >> s->cell_log) > s->tsize - 1)
++ while ((s->mtu - 1 >> s->cell_log) > s->tsize - 1)
+ s->cell_log++;
+
+ *stab = malloc(s->tsize * sizeof(__u16));
+--- iproute2/tc/tc_stab.c
++++ iproute2-new/tc/tc_stab.c
+@@ -32,11 +32,15 @@
+ fprintf(stderr,
+ "Usage: ... stab [ mtu BYTES ] [ tsize SLOTS ] [ mpu BYTES ] \n"
+ " [ overhead BYTES ] [ linklayer TYPE ] ...\n"
+- " mtu : max packet size we create rate map for {2047}\n"
++ "TYPE := adsl | atm | ethernet\n"
++ " mtu : max packet size we create size table for {2048}\n"
+ " tsize : how many slots should size table have {512}\n"
+ " mpu : minimum packet size used in rate computations\n"
+ " overhead : per-packet size overhead used in rate computations\n"
+ " linklayer : adapting to a linklayer e.g. atm\n"
++ " mpu : minimum packet size used in size table computations\n"
++ " overhead : per-packet size overhead used in size table computations\n"
++ " linklayer : required linklayer adaptation, (adsl and atm are synonyms)\n"
+ "Example: ... stab overhead 20 linklayer atm\n");
+
+ return;
diff --git a/sys-apps/iproute2/files/iproute2-2.6.35-cached-routes.patch b/sys-apps/iproute2/files/iproute2-2.6.35-cached-routes.patch
new file mode 100644
index 000000000000..821d8c3fae5a
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.35-cached-routes.patch
@@ -0,0 +1,34 @@
+http://bugs.gentoo.org/331447
+
+From c73f3e02f8ae25e5daad0367690a3069895dd8a3 Mon Sep 17 00:00:00 2001
+From: Ulrich Weber <uweber@astaro.com>
+Date: Thu, 12 Aug 2010 11:05:19 +0200
+Subject: [PATCH] iproute2: dont filter cached routes on iproute_get
+
+iproute_get will return cloned routes for IPv4
+and cloned as well non-cloned routes for IPv6.
+
+Therefore RTM_F_CLONED flag should not be checked
+for iproute_get routes. Check in print_route will
+always fail because valid values are 0 and 1.
+
+Signed-off-by: Ulrich Weber <uweber@astaro.com>
+---
+ ip/iproute.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/ip/iproute.c b/ip/iproute.c
+index 711576e..b43933c 100644
+--- a/ip/iproute.c
++++ b/ip/iproute.c
+@@ -1286,6 +1286,7 @@ int iproute_get(int argc, char **argv)
+ memset(&req, 0, sizeof(req));
+
+ iproute_reset_filter();
++ filter.cloned = 2;
+
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
+ req.n.nlmsg_flags = NLM_F_REQUEST;
+--
+1.7.2
+
diff --git a/sys-apps/iproute2/files/iproute2-2.6.35-no-iptables.patch b/sys-apps/iproute2/files/iproute2-2.6.35-no-iptables.patch
new file mode 100644
index 000000000000..a51cf78ac8df
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.35-no-iptables.patch
@@ -0,0 +1,15 @@
+diff --git a/tc/Makefile b/tc/Makefile
+index 3aa9f26..0a827da 100644
+--- a/tc/Makefile
++++ b/tc/Makefile
+@@ -58,7 +58,9 @@ else
+ CFLAGS += -DTC_CONFIG_XT_H
+ TCSO += m_xt_old.so
+ else
+- TCMODULES += m_ipt.o
++ ifneq ($(TC_CONFIG_XT),n)
++ TCMODULES += m_ipt.o
++ endif
+ endif
+ endif
+ endif
diff --git a/sys-apps/iproute2/files/iproute2-2.6.35-no-ipv6.patch b/sys-apps/iproute2/files/iproute2-2.6.35-no-ipv6.patch
new file mode 100644
index 000000000000..d82c8873344c
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.35-no-ipv6.patch
@@ -0,0 +1,27 @@
+https://bugs.gentoo.org/326849
+
+allow ipv6 to be disabled
+
+--- iproute2-2.6.31/ip/iptunnel.c
++++ iproute2-2.6.31/ip/iptunnel.c
+@@ -456,13 +456,6 @@ int do_iptunnel(int argc, char **argv)
+ break;
+ case AF_INET:
+ break;
+- /*
+- * This is silly enough but we have no easy way to make it
+- * protocol-independent because of unarranged structure between
+- * IPv4 and IPv6.
+- */
+- case AF_INET6:
+- return do_ip6tunnel(argc, argv);
+ default:
+ fprintf(stderr, "Unsupported family:%d\n", preferred_family);
+ exit(-1);
+--- iproute2-2.6.31/ip/Makefile
++++ iproute2-2.6.31/ip/Makefile
+@@ -1,4 +1,4 @@
+ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o \
+- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
++ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
+ ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \
diff --git a/sys-apps/iproute2/files/iproute2-2.6.35-xtables.patch b/sys-apps/iproute2/files/iproute2-2.6.35-xtables.patch
new file mode 100644
index 000000000000..748c77bde828
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.35-xtables.patch
@@ -0,0 +1,30 @@
+From 035ea3a8a1c9f67721fa0b53540620c7c49bc8ab Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 21 Nov 2010 16:07:26 -0500
+Subject: [PATCH] m_xt: stop using xtables_set_revision()
+
+iptables dropped the xtables_set_revision() function around version 1.4.9,
+so set the rev directly ourselves. This should be compatible back to the
+original version m_xt itself is designed for.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ tc/m_xt.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tc/m_xt.c b/tc/m_xt.c
+index bfc4937..ede9913 100644
+--- a/tc/m_xt.c
++++ b/tc/m_xt.c
+@@ -88,7 +88,7 @@ build_st(struct xtables_target *target, struct xt_entry_target *t)
+ target->t = xtables_calloc(1, size);
+ target->t->u.target_size = size;
+ strcpy(target->t->u.user.name, target->name);
+- xtables_set_revision(target->t->u.user.name, target->revision);
++ target->t->u.user.revision = target->revision;
+
+ if (target->init != NULL)
+ target->init(target->t);
+--
+1.7.3.1
+
diff --git a/sys-apps/iproute2/files/iproute2-2.6.38-parallel-build.patch b/sys-apps/iproute2/files/iproute2-2.6.38-parallel-build.patch
new file mode 100644
index 000000000000..7966cfce5044
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-2.6.38-parallel-build.patch
@@ -0,0 +1,40 @@
+sent upstream already
+
+From f8a783bbe98b0fe5aaedbf623bc70471b88c9187 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 18 Oct 2011 17:36:55 -0400
+Subject: [PATCH] tc: fix parallel build file with lex/yacc
+
+Building iproute2 in parallel might hit the race failure:
+ emp_ematch.l:2:30: fatal error: emp_ematch.yacc.h:
+ No such file or directory
+ make[1]: *** [emp_ematch.lex.o] Error 1
+
+This is because we currently allow the yacc/lex files to generate and
+compile in parallel. So add a simple dependency to make sure yacc has
+finished before we attempt to compile the lex output.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ tc/Makefile | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/tc/Makefile b/tc/Makefile
+index 08aa4ce..b2ca165 100644
+--- a/tc/Makefile
++++ b/tc/Makefile
+@@ -136,6 +136,11 @@ m_xt_old.so: m_xt_old.c
+ %.lex.c: %.l
+ $(LEX) $(LEXFLAGS) -o$@ $<
+
++# our lexer includes the header from yacc, so make sure
++# we don't attempt to compile it before the header has
++# been generated as part of the yacc step.
++emp_ematch.lex.o: emp_ematch.yacc.c
++
+ ifneq ($(SHARED_LIBS),y)
+
+ tc: static-syms.o
+--
+1.7.6.1
+
diff --git a/sys-apps/iproute2/files/iproute2-3.1.0-mtu.patch b/sys-apps/iproute2/files/iproute2-3.1.0-mtu.patch
new file mode 100644
index 000000000000..fa12dad2d79e
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.1.0-mtu.patch
@@ -0,0 +1,48 @@
+http://bugs.gentoo.org/291907
+
+This patch was merged from two patches extracted from this thread:
+http://markmail.org/thread/qkd76gpdgefpjlfn
+
+tc_stab.c: small fixes to commandline help
+
+
+tc_core.c:
+As kernel part of things relies on cell align which is always set to -1,
+I also added it to userspace computation stage. This way if someone
+specified e.g. 2048 and 512 for mtu and tsize respectively, one wouldn't
+end with tsize supporting mtu 4096 suddenly, New default mtu is also set
+to 2048 (disregarding weirdness of setting mtu to such values).
+
+
+Unless I missed something, this is harmless and feels cleaner, but if it's
+not allowed, documentation will have to be changed back to 2047 + extra
+explanation as well.
+
+--- iproute2/tc/tc_core.c
++++ iproute2/tc/tc_core.c
+@@ -155,12 +155,12 @@
+ }
+
+ if (s->mtu == 0)
+- s->mtu = 2047;
++ s->mtu = 2048;
+ if (s->tsize == 0)
+ s->tsize = 512;
+
+ s->cell_log = 0;
+- while ((s->mtu >> s->cell_log) > s->tsize - 1)
++ while ((s->mtu - 1 >> s->cell_log) > s->tsize - 1)
+ s->cell_log++;
+
+ *stab = malloc(s->tsize * sizeof(__u16));
+--- iproute2/tc/tc_stab.c
++++ iproute2/tc/tc_stab.c
+@@ -32,7 +32,7 @@
+ fprintf(stderr,
+ "Usage: ... stab [ mtu BYTES ] [ tsize SLOTS ] [ mpu BYTES ] \n"
+ " [ overhead BYTES ] [ linklayer TYPE ] ...\n"
+- " mtu : max packet size we create rate map for {2047}\n"
++ " mtu : max packet size we create size table for {2048}\n"
+ " tsize : how many slots should size table have {512}\n"
+ " mpu : minimum packet size used in rate computations\n"
+ " overhead : per-packet size overhead used in rate computations\n"
diff --git a/sys-apps/iproute2/files/iproute2-3.1.0-no-ipv6.patch b/sys-apps/iproute2/files/iproute2-3.1.0-no-ipv6.patch
new file mode 100644
index 000000000000..1282a1b59f9b
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.1.0-no-ipv6.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/326849
+
+allow ipv6 to be disabled
+
+--- a/ip/iptunnel.c
++++ b/ip/iptunnel.c
+@@ -456,13 +456,6 @@ int do_iptunnel(int argc, char **argv)
+ break;
+ case AF_INET:
+ break;
+- /*
+- * This is silly enough but we have no easy way to make it
+- * protocol-independent because of unarranged structure between
+- * IPv4 and IPv6.
+- */
+- case AF_INET6:
+- return do_ip6tunnel(argc, argv);
+ default:
+ fprintf(stderr, "Unsupported family:%d\n", preferred_family);
+ exit(-1);
+--- a/ip/Makefile
++++ b/ip/Makefile
+@@ -1,6 +1,6 @@
+ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
+- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
+- ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o \
++ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
++ ipmaddr.o ipmonitor.o ipmroute.o iptuntap.o \
+ ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
+ iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
+ iplink_macvlan.o iplink_macvtap.o ipl2tp.o
+--- a/ip/ipmonitor.c
++++ b/ip/ipmonitor.c
+@@ -76,7 +76,6 @@ int accept_msg(const struct sockaddr_nl *who,
+ if (n->nlmsg_type == RTM_NEWPREFIX) {
+ if (prefix_banner)
+ fprintf(fp, "[PREFIX]");
+- print_prefix(who, n, arg);
+ return 0;
+ }
+ if (n->nlmsg_type == RTM_NEWRULE || n->nlmsg_type == RTM_DELRULE) {
diff --git a/sys-apps/iproute2/files/iproute2-3.10.0-no-ipv6.patch b/sys-apps/iproute2/files/iproute2-3.10.0-no-ipv6.patch
new file mode 100644
index 000000000000..86d80d2d8742
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.10.0-no-ipv6.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/326849
+
+allow ipv6 to be disabled
+
+--- a/ip/iptunnel.c
++++ b/ip/iptunnel.c
+@@ -629,13 +629,6 @@ int do_iptunnel(int argc, char **argv)
+ break;
+ case AF_INET:
+ break;
+- /*
+- * This is silly enough but we have no easy way to make it
+- * protocol-independent because of unarranged structure between
+- * IPv4 and IPv6.
+- */
+- case AF_INET6:
+- return do_ip6tunnel(argc, argv);
+ default:
+ fprintf(stderr, "Unsupported protocol family: %d\n", preferred_family);
+ exit(-1);
+--- a/ip/Makefile
++++ b/ip/Makefile
+@@ -1,6 +1,6 @@
+ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
+- rtm_map.o iptunnel.o ip6tunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
+- ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o iptuntap.o iptoken.o \
++ rtm_map.o iptunnel.o tunnel.o ipneigh.o ipntable.o iplink.o \
++ ipmaddr.o ipmonitor.o ipmroute.o iptuntap.o iptoken.o \
+ ipxfrm.o xfrm_state.o xfrm_policy.o xfrm_monitor.o \
+ iplink_vlan.o link_veth.o link_gre.o iplink_can.o \
+ iplink_macvlan.o iplink_macvtap.o ipl2tp.o link_vti.o \
+--- a/ip/ipmonitor.c
++++ b/ip/ipmonitor.c
+@@ -96,7 +96,6 @@ static int accept_msg(const struct socka
+ if (n->nlmsg_type == RTM_NEWPREFIX) {
+ if (prefix_banner)
+ fprintf(fp, "[PREFIX]");
+- print_prefix(who, n, arg);
+ return 0;
+ }
+ if (n->nlmsg_type == RTM_NEWRULE || n->nlmsg_type == RTM_DELRULE) {
diff --git a/sys-apps/iproute2/files/iproute2-3.6.0-pkg-config.patch b/sys-apps/iproute2/files/iproute2-3.6.0-pkg-config.patch
new file mode 100644
index 000000000000..fcfee292994b
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.6.0-pkg-config.patch
@@ -0,0 +1,67 @@
+From 99762cbc216bb818e9fcbe37e1abf9b313968615 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 8 Nov 2012 11:31:26 -0500
+Subject: [PATCH] allow pkg-config to be customized
+
+Rather than hard coding `pkg-config`, use ${PKG_CONFIG} so people can
+override it to their specific version (like when cross-compiling).
+
+This is the same way the upstream pkg-config code works.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ configure | 6 ++++--
+ tc/Makefile | 4 ++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 2c2d1c4..0bfedf9 100755
+--- a/configure
++++ b/configure
+@@ -2,6 +2,8 @@
+ # This is not an autconf generated configure
+ #
+ INCLUDE=${1:-"$PWD/include"}
++: ${PKG_CONFIG:=pkg-config}
++echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config
+
+ # Make a temp directory in build tree.
+ TMPDIR=$(mktemp -d config.XXXXXX)
+@@ -51,7 +53,7 @@ int main(int argc, char **argv)
+
+ EOF
+
+-if gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(pkg-config xtables --cflags --libs) -ldl >/dev/null 2>&1
++if gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1
+ then
+ echo "TC_CONFIG_XT:=y" >>Config
+ echo "using xtables"
+@@ -148,7 +150,7 @@ check_ipt()
+
+ check_ipt_lib_dir()
+ {
+- IPT_LIB_DIR=$(pkg-config --variable=xtlibdir xtables)
++ IPT_LIB_DIR=$(${PKG_CONFIG} --variable=xtlibdir xtables)
+ if [ -n "$IPT_LIB_DIR" ]; then
+ echo $IPT_LIB_DIR
+ echo "IPT_LIB_DIR:=$IPT_LIB_DIR" >> Config
+diff --git a/tc/Makefile b/tc/Makefile
+index 389029d..696f891 100644
+--- a/tc/Makefile
++++ b/tc/Makefile
+@@ -135,10 +135,10 @@ q_atm.so: q_atm.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
+
+ m_xt.so: m_xt.c
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$(pkg-config xtables --cflags --libs)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt.so m_xt.c $$($(PKG_CONFIG) xtables --cflags --libs)
+
+ m_xt_old.so: m_xt_old.c
+- $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$(pkg-config xtables --cflags --libs)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -fpic -o m_xt_old.so m_xt_old.c $$($(PKG_CONFIG) xtables --cflags --libs)
+
+ %.yacc.c: %.y
+ $(YACC) $(YACCFLAGS) -o $@ $<
+--
+1.7.12.4
+
diff --git a/sys-apps/iproute2/files/iproute2-3.7.0-clang.patch b/sys-apps/iproute2/files/iproute2-3.7.0-clang.patch
new file mode 100644
index 000000000000..17bb6ac856b3
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.7.0-clang.patch
@@ -0,0 +1,72 @@
+From 048bff6e0206bca33ee70516521f3048e7714752 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 17 Jan 2013 18:00:50 +0000
+Subject: [PATCH] ipxfrm: use alloca to allocate stack space
+
+Clang doesn't support the gcc extension for embeddeding flexible arrays
+inside of structures. Use the slightly more portable alloca().
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ ip/ipxfrm.c | 27 +++++++++++----------------
+ 1 file changed, 11 insertions(+), 16 deletions(-)
+
+diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
+index c7b3420..dda4a7a 100644
+--- a/ip/ipxfrm.c
++++ b/ip/ipxfrm.c
+@@ -25,6 +25,7 @@
+ * Masahide NAKAMURA @USAGI
+ */
+
++#include <alloca.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -555,16 +556,13 @@ static inline void xfrm_algo_print(struct xfrm_algo *algo, int type, int len,
+ static void xfrm_aead_print(struct xfrm_algo_aead *algo, int len,
+ FILE *fp, const char *prefix)
+ {
+- struct {
+- struct xfrm_algo algo;
+- char key[algo->alg_key_len / 8];
+- } base;
++ struct xfrm_algo *base_algo = alloca(sizeof(*base_algo) + algo->alg_key_len / 8);
+
+- memcpy(base.algo.alg_name, algo->alg_name, sizeof(base.algo.alg_name));
+- base.algo.alg_key_len = algo->alg_key_len;
+- memcpy(base.algo.alg_key, algo->alg_key, algo->alg_key_len / 8);
++ memcpy(base_algo->alg_name, algo->alg_name, sizeof(base_algo->alg_name));
++ base_algo->alg_key_len = algo->alg_key_len;
++ memcpy(base_algo->alg_key, algo->alg_key, algo->alg_key_len / 8);
+
+- __xfrm_algo_print(&base.algo, XFRMA_ALG_AEAD, len, fp, prefix, 0);
++ __xfrm_algo_print(base_algo, XFRMA_ALG_AEAD, len, fp, prefix, 0);
+
+ fprintf(fp, " %d", algo->alg_icv_len);
+
+@@ -574,16 +572,13 @@ static void xfrm_aead_print(struct xfrm_algo_aead *algo, int len,
+ static void xfrm_auth_trunc_print(struct xfrm_algo_auth *algo, int len,
+ FILE *fp, const char *prefix)
+ {
+- struct {
+- struct xfrm_algo algo;
+- char key[algo->alg_key_len / 8];
+- } base;
++ struct xfrm_algo *base_algo = alloca(sizeof(*base_algo) + algo->alg_key_len / 8);
+
+- memcpy(base.algo.alg_name, algo->alg_name, sizeof(base.algo.alg_name));
+- base.algo.alg_key_len = algo->alg_key_len;
+- memcpy(base.algo.alg_key, algo->alg_key, algo->alg_key_len / 8);
++ memcpy(base_algo->alg_name, algo->alg_name, sizeof(base_algo->alg_name));
++ base_algo->alg_key_len = algo->alg_key_len;
++ memcpy(base_algo->alg_key, algo->alg_key, algo->alg_key_len / 8);
+
+- __xfrm_algo_print(&base.algo, XFRMA_ALG_AUTH_TRUNC, len, fp, prefix, 0);
++ __xfrm_algo_print(base_algo, XFRMA_ALG_AUTH_TRUNC, len, fp, prefix, 0);
+
+ fprintf(fp, " %d", algo->alg_trunc_len);
+
+--
+1.8.0.2
+
diff --git a/sys-apps/iproute2/files/iproute2-3.7.0-man7.patch b/sys-apps/iproute2/files/iproute2-3.7.0-man7.patch
new file mode 100644
index 000000000000..947714adf832
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.7.0-man7.patch
@@ -0,0 +1,55 @@
+From 18c1de8d742792d43ff81ebff9af5389e5be7cae Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 11 Jan 2013 11:34:08 -0500
+Subject: [PATCH] [iproute2] add man7 to subdirs list
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The man dir misses the man7 as a subdir which means none of the pages
+get installed.
+
+URL: https://bugs.gentoo.org/451166
+Reported-by: Marcin Mirosław <bug@mejor.pl>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ man/Makefile | 2 +-
+ man/man7/Makefile | 13 +++++++++++++
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+ create mode 100644 man/man7/Makefile
+
+diff --git a/man/Makefile b/man/Makefile
+index 67fea05..9a60fa7 100644
+--- a/man/Makefile
++++ b/man/Makefile
+@@ -2,7 +2,7 @@ INSTALL=install
+ INSTALLDIR=install -m 0755 -d
+ INSTALLMAN=install -m 0644
+
+-SUBDIRS = man3 man8
++SUBDIRS = man3 man7 man8
+
+ all:
+ @for subdir in $(SUBDIRS); do $(MAKE) -C $$subdir; done
+diff --git a/man/man7/Makefile b/man/man7/Makefile
+new file mode 100644
+index 0000000..ccfd839
+--- /dev/null
++++ b/man/man7/Makefile
+@@ -0,0 +1,13 @@
++MAN7PAGES = tc-hfsc.7
++
++all:
++
++distclean: clean
++
++clean:
++
++install:
++ $(INSTALLDIR) $(DESTDIR)$(MANDIR)/man7
++ $(INSTALLMAN) $(MAN7PAGES) $(DESTDIR)$(MANDIR)/man7
++
++.PHONY: install clean distclean
+--
+1.8.0.2
+
diff --git a/sys-apps/iproute2/files/iproute2-3.8.0-old-mount-libc.patch b/sys-apps/iproute2/files/iproute2-3.8.0-old-mount-libc.patch
new file mode 100644
index 000000000000..96280e042453
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.8.0-old-mount-libc.patch
@@ -0,0 +1,38 @@
+From 03fdb011dd661315a83998af8af779d8f089e3fe Mon Sep 17 00:00:00 2001
+From: Stephen Hemminger <stephen@networkplumber.org>
+Date: Wed, 17 Apr 2013 13:33:26 -0700
+Subject: [PATCH] ipnetns: fix build on older systems
+
+Debian Squeeze has out of date <sys/mount.h> without the required flags.
+---
+ ip/ipnetns.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/ip/ipnetns.c b/ip/ipnetns.c
+index b047b97..c9bc20a 100644
+--- a/ip/ipnetns.c
++++ b/ip/ipnetns.c
+@@ -29,6 +29,20 @@
+ #define MNT_DETACH 0x00000002 /* Just detach from the tree */
+ #endif /* MNT_DETACH */
+
++/* sys/mount.h may be out too old to have these */
++#ifndef MS_REC
++#define MS_REC 16384
++#endif
++
++#ifndef MS_SLAVE
++#define MS_SLAVE (1 << 19)
++#endif
++
++#ifndef MS_SHARED
++#define MS_SHARED (1 << 20)
++#endif
++
++
+ #ifndef HAVE_SETNS
+ static int setns(int fd, int nstype)
+ {
+--
+1.8.2.1
+
diff --git a/sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch b/sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch
new file mode 100644
index 000000000000..6c6c9a5c4308
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch
@@ -0,0 +1,62 @@
+https://bugs.gentoo.org/546928
+
+From 46679bbbe89699016d31486de7599590d02a5054 Mon Sep 17 00:00:00 2001
+From: Vadim Kochan <vadim4j@gmail.com>
+Date: Mon, 20 Apr 2015 08:33:32 +0300
+Subject: [PATCH] tc util: Fix possible buffer overflow when print class id
+
+Use correct handle buffer length.
+
+Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
+---
+ tc/tc_util.c | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/tc/tc_util.c b/tc/tc_util.c
+index 1d3153d..dc2b70f 100644
+--- a/tc/tc_util.c
++++ b/tc/tc_util.c
+@@ -128,30 +128,31 @@ ok:
+ return 0;
+ }
+
+-int print_tc_classid(char *buf, int len, __u32 h)
++int print_tc_classid(char *buf, int blen, __u32 h)
+ {
+- char handle[40] = {};
++ SPRINT_BUF(handle) = {};
++ int hlen = SPRINT_BSIZE - 1;
+
+ if (h == TC_H_ROOT)
+ sprintf(handle, "root");
+ else if (h == TC_H_UNSPEC)
+- snprintf(handle, len, "none");
++ snprintf(handle, hlen, "none");
+ else if (TC_H_MAJ(h) == 0)
+- snprintf(handle, len, ":%x", TC_H_MIN(h));
++ snprintf(handle, hlen, ":%x", TC_H_MIN(h));
+ else if (TC_H_MIN(h) == 0)
+- snprintf(handle, len, "%x:", TC_H_MAJ(h) >> 16);
++ snprintf(handle, hlen, "%x:", TC_H_MAJ(h) >> 16);
+ else
+- snprintf(handle, len, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
++ snprintf(handle, hlen, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
+
+ if (use_names) {
+ char clname[IDNAME_MAX] = {};
+
+ if (id_to_name(cls_names, h, clname))
+- snprintf(buf, len, "%s#%s", clname, handle);
++ snprintf(buf, blen, "%s#%s", clname, handle);
+ else
+- snprintf(buf, len, "%s", handle);
++ snprintf(buf, blen, "%s", handle);
+ } else {
+- snprintf(buf, len, "%s", handle);
++ snprintf(buf, blen, "%s", handle);
+ }
+
+ return 0;
+--
+2.3.5
+
diff --git a/sys-apps/iproute2/iproute2-2.6.38.ebuild b/sys-apps/iproute2/iproute2-2.6.38.ebuild
new file mode 100644
index 000000000000..57e568aa491f
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-2.6.38.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs flag-o-matic
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb minimal"
+
+RDEPEND="!net-misc/arpd
+ !minimal? ( berkdb? ( sys-libs/db ) )
+ atm? ( net-dialup/linux-atm )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.27
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.6.29.1-hfsc.patch #291907
+ epatch "${FILESDIR}"/${PN}-2.6.38-parallel-build.patch
+
+ sed -i \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ Makefile || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_configure() {
+ echo "TC_CONFIG_ATM:=$(use atm && echo "y" || echo "n")" > Config
+
+ # Use correct iptables dir, #144265 #293709
+ append-cppflags -DIPT_LIB_DIR=\\\"`$(tc-getPKG_CONFIG) xtables --variable=xtlibdir`\\\"
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)"
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ SBINDIR=/sbin \
+ DOCDIR=/usr/share/doc/${PF} \
+ MANDIR=/usr/share/man \
+ install
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/sbin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/sbin/
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-3.17.0.ebuild b/sys-apps/iproute2/iproute2-3.17.0.ebuild
new file mode 100644
index 000000000000..20a236926d99
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-3.17.0.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ !minimal? ( berkdb? ( sys-libs/db ) )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.27
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ ip/ipnetns.c \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-3.19.0.ebuild b/sys-apps/iproute2/iproute2-3.19.0.ebuild
new file mode 100644
index 000000000000..940ee980fc5a
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-3.19.0.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ !minimal? ( berkdb? ( sys-libs/db ) )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.27
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ include/namespace.h \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-3.3.0.ebuild b/sys-apps/iproute2/iproute2-3.3.0.ebuild
new file mode 100644
index 000000000000..864f59be02f0
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-3.3.0.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.bz2"
+ KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.5 )
+ !minimal? ( berkdb? ( sys-libs/db ) )
+ atm? ( net-dialup/linux-atm )"
+DEPEND="${RDEPEND}
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.27
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.1.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ Makefile || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/sbin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/sbin/
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-3.8.0.ebuild b/sys-apps/iproute2/iproute2-3.8.0.ebuild
new file mode 100644
index 000000000000..26a9e61636e5
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-3.8.0.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.16 )
+ !minimal? ( berkdb? ( sys-libs/db ) )
+ atm? ( net-dialup/linux-atm )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.27
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ epatch "${FILESDIR}"/${P}-old-mount-libc.patch #468120
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.1.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-4.0.0-r2.ebuild b/sys-apps/iproute2/iproute2-4.0.0-r2.ebuild
new file mode 100644
index 000000000000..c419af059b38
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-4.0.0-r2.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ berkdb? ( sys-libs/db:= )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+# We require newer linux-headers for ipset support #549948
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-3.7
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ epatch "${FILESDIR}"/${P}-tc-show-buffer-overflow.patch #546928
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ include/namespace.h \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ # We've locked in recent enough kernel headers #549948
+ TC_CONFIG_IPSET := y
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ dobin ip/ip
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-4.1.0.ebuild b/sys-apps/iproute2/iproute2-4.1.0.ebuild
new file mode 100644
index 000000000000..734e2b1f2f38
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-4.1.0.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+RDEPEND="!net-misc/arpd
+ net-libs/libmnl
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ berkdb? ( sys-libs/db:= )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+# We require newer linux-headers for ipset support #549948 and some defines #553876
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-3.16
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ include/namespace.h \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ # We've locked in recent enough kernel headers #549948
+ TC_CONFIG_IPSET := y
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ dobin ip/ip
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-4.1.1.ebuild b/sys-apps/iproute2/iproute2-4.1.1.ebuild
new file mode 100644
index 000000000000..4fb18ee4aac5
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-4.1.1.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+# We could make libmnl optional, but it's tiny, so eh
+RDEPEND="!net-misc/arpd
+ !minimal? ( net-libs/libmnl )
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ berkdb? ( sys-libs/db:= )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+# We require newer linux-headers for ipset support #549948 and some defines #553876
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-3.16
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ include/namespace.h \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ # We've locked in recent enough kernel headers #549948
+ TC_CONFIG_IPSET := y
+ HAVE_MNL := $(usex minimal n y)
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ dobin ip/ip
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/iproute2-9999.ebuild b/sys-apps/iproute2/iproute2-9999.ebuild
new file mode 100644
index 000000000000..9771db4a8dcc
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-9999.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ berkdb? ( sys-libs/db:= )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+# We require newer linux-headers for ipset support #549948
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-3.7
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ epatch "${FILESDIR}"/${P}-tc-show-buffer-overflow.patch #546928
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ include/namespace.h \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc ip:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ # We've locked in recent enough kernel headers #549948
+ TC_CONFIG_IPSET := y
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc ip/ip
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}
diff --git a/sys-apps/iproute2/metadata.xml b/sys-apps/iproute2/metadata.xml
new file mode 100644
index 000000000000..fb2e46a5aecd
--- /dev/null
+++ b/sys-apps/iproute2/metadata.xml
@@ -0,0 +1,10 @@
+<?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='berkdb'>build programs that use berkdb (just arpd)</flag>
+ <flag name='iptables'>include support for iptables filtering</flag>
+ <flag name='minimal'>only install ip and tc programs</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/irqbalance/Manifest b/sys-apps/irqbalance/Manifest
new file mode 100644
index 000000000000..2713c27bb9d6
--- /dev/null
+++ b/sys-apps/irqbalance/Manifest
@@ -0,0 +1,6 @@
+DIST irqbalance-0.56.tbz2 28089 SHA256 516e1bdc5469f0f350e2e9ad2925b221faa4497a608c8d4e28a997938451c5fc SHA512 52575520abeaa4268cfc1bb2c5044cb43704e1981dcdbf3e124fced436222b5a5a9d57ec8082e2a4139bfb5be177aefc11809c6865a2b085f46babeeb541daa2 WHIRLPOOL b0d73af7a80a09635ecab2984bf473d27056a8e6cb562708fa5f19428ad07f8c69362d99ea21e7a2a8522d474d65d41358764682fa3e6e481b10baf465525875
+DIST irqbalance-1.0.4.tar.bz2 286985 SHA256 15725edf4a6f20258620cbd05ebf02d0c25aadd5ffa4871ef8507c9215021c43 SHA512 f61d7cd0690a80cfa2ff249a75db675179d4a945bc784b3af8293200a642b6ac0e0564b8c7b8fc0a63363caf8ebab2a7b50b6699cb53587fafd5b50cf73c0f11 WHIRLPOOL ab1a7717cd1c08ce17ac831d75f934aa0d48653f8c194cf683694c498532a90086de18ee3cc0ee7ad09e4cce442173c94dd98e919b8f169e716eb6ead5f593c6
+DIST irqbalance-1.0.5.tar.gz 350213 SHA256 1123e75224b9c0b63ac85892e920bc4a9c76211278ea3d5d4bcbbde44815685c SHA512 333587c16221532be6a353d628b5f8cc557f7917fb423cfac0092f9a5000cc82b042d37b9c3160f5d37d931e8e50a313278e8e30f2dc65f7db60fdf95664bc06 WHIRLPOOL 7fd5e93c0549011c593dbcad9fd9fe94706ac78d4e394a098b0eb63f6de33225f2358aaf84863c662fb392463dfa97777587753df69c041033dee06f91844aa8
+DIST irqbalance-1.0.6.tar.gz 352325 SHA256 95ac79992e6de501f613c781b0fc8aa17a4aaf6a3d865bb6e15ac6a46c6ab1fd SHA512 be14f89c0f137a0cb9c572bc7fb2360941751e4676b147a9d4a44aeb6242577b7dfaa4aa4810ded05244da59fc6d24f22ab88740a8751685a3177b010259a6f0 WHIRLPOOL dcc51bec29eb78a0e9e777a7c5d254ff338390e44dfc4019edb2a1f1eb85f6eafd9bdd7fdc60903b1f94f70194cc1ab1d61cac68da429a009d1f26bee7d357ef
+DIST irqbalance-1.0.7.tar.gz 41209 SHA256 8c3916780d254b74fb1c7ec22876d63ac01f1b32776d9204a604b73c8f591d2a SHA512 388f982fe620d8df850e6e298a194a5ba1393f29f1b25897bfa79e34f3acb32e762b86e31154e7af614d5d84a38a61b85ff07c0dd2032e1eb6b0e30ea9010612 WHIRLPOOL fdbaa8817aae91bc1960115aa457e4dc92b36f62ba7680e9aac35459072d73f2e30015c616c86ce451ac6cd335406ac2423328232768c893e17e17537c3c951e
+DIST irqbalance-1.0.9.tar.gz 44661 SHA256 f1b8115948bb9f0bc36b9d7143ee8be751a294bc189d311408e753acc37169c3 SHA512 ef3ce9eeec11ec86291e2e3cd701e782ee1fb4ba256e2ea5ea0ea04b373f97ff2eae0a44919127c4dbd7fd805e9e3df3a5e62a3528e4d1c9bbab4db39186b5c5 WHIRLPOOL 7bed3d8dd868b4ad697b997143a59b9101815d0bfc08d1d594248c1fcfeaec22045fbe779605583a89aa7d2c8a54e079317bf8a6e4ef8135fc887e2d1518e706
diff --git a/sys-apps/irqbalance/files/irqbalance-0.56-build.patch b/sys-apps/irqbalance/files/irqbalance-0.56-build.patch
new file mode 100644
index 000000000000..b7202a4701f1
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance-0.56-build.patch
@@ -0,0 +1,16 @@
+http://code.google.com/p/irqbalance/issues/detail?id=8
+http://code.google.com/p/irqbalance/issues/detail?id=13
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -25,7 +25,9 @@
+
+ INCLUDES = -I${top_srcdir}
+ LIBS = $(CAPNG_LDADD) $(GLIB_LIBS)
+-AM_CFLAGS = -g -Os -W -Wall -Wshadow -Wformat -Wundef $(GLIB_CFLAGS) -D_GNU_SOURCE
++AM_CFLAGS = -W -Wall -Wshadow -Wformat -Wundef
++AM_CPPFLAGS = $(GLIB_CFLAGS) -D_GNU_SOURCE
++dist_man_MANS = irqbalance.1
+ noinst_HEADERS = bitmap.h constants.h cpumask.h irqbalance.h non-atomic.h \
+ types.h
+ sbin_PROGRAMS = irqbalance
diff --git a/sys-apps/irqbalance/files/irqbalance.1 b/sys-apps/irqbalance/files/irqbalance.1
new file mode 100644
index 000000000000..c26c709a01d0
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.1
@@ -0,0 +1,64 @@
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Ip \" List item
+.br
+.ie \\n(.$>=3 .ne \\$3
+.el .ne 3
+.IP "\\$1" \\$2
+..
+.TH "IRQBALANCE" 1 "Dec 2006" "Linux" "irqbalance"
+.SH NAME
+irqbalance \- distribute hardware interrupts across processors on a multiprocessor system
+.SH "SYNOPSIS"
+
+.nf
+\fBirqbalance\fR
+.fi
+
+.SH "DESCRIPTION"
+
+.PP
+The purpose of \fBirqbalance\fR is distribute hardware interrupts across processors on a multiprocessor system in order to increase performance\&.
+
+.SH "OPTIONS"
+
+.TP
+.B --oneshot
+Causes irqbalance to be run once, after which the daemon exits
+.TP
+
+.B --debug
+Causes irqbalance to run in the foreground and extra debug information to be printed
+
+.SH "ENVIRONMENT VARIABLES"
+.TP
+.B IRQBALANCE_ONESHOT
+Same as --oneshot
+
+.TP
+.B IRQBALANCE_DEBUG
+Same as --debug
+
+.TP
+.B IRQBALANCE_BANNED_CPUS
+Provides a mask of cpus which irqbalance should ignore and never assign interrupts to
+
+.TP
+.B IRQBALANCE_BANNED_INTERRUPTS
+A list of space delimited IRQ numbers that irqbalance should not touch
+
+.SH "Homepage"
+http://www.irqbalance.org
+
+
diff --git a/sys-apps/irqbalance/files/irqbalance.confd b/sys-apps/irqbalance/files/irqbalance.confd
new file mode 100644
index 000000000000..152dd7988652
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.confd
@@ -0,0 +1,15 @@
+# /etc/conf.d/irqbalance: config file for /etc/init.d/irqbalance
+# These are envvars used by irqbalance itself. For more info,
+# please see the irqbalance manpage.
+
+# Run irqbalance once and then exit
+#IRQBALANCE_ONESHOT="0"
+
+# Include debug messages in output
+#IRQBALANCE_DEBUG="0"
+
+# List of cpus to not include in balancing
+#IRQBALANCE_BANNED_CPUS=""
+
+# List of interrupts to not include in balancing
+#IRQBALANCE_BANNED_INTERRUPTS=""
diff --git a/sys-apps/irqbalance/files/irqbalance.confd-1 b/sys-apps/irqbalance/files/irqbalance.confd-1
new file mode 100644
index 000000000000..2761cfcd3596
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.confd-1
@@ -0,0 +1,19 @@
+# /etc/conf.d/irqbalance: config file for /etc/init.d/irqbalance
+
+# Additional options to pass to irqbalance itself.
+IRQBALANCE_OPTS=""
+
+# These are envvars used by irqbalance itself, so make sure the "export"
+# is retained. For more info, please see the irqbalance manpage.
+
+# Run irqbalance once and then exit
+#export IRQBALANCE_ONESHOT="0"
+
+# Include debug messages in output
+#export IRQBALANCE_DEBUG="0"
+
+# List of cpus to not include in balancing
+#export IRQBALANCE_BANNED_CPUS=""
+
+# List of interrupts to not include in balancing
+#export IRQBALANCE_BANNED_INTERRUPTS=""
diff --git a/sys-apps/irqbalance/files/irqbalance.init-0.55-r2 b/sys-apps/irqbalance/files/irqbalance.init-0.55-r2
new file mode 100644
index 000000000000..476ba7c755ab
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.init-0.55-r2
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start() {
+ ebegin "Starting irqbalance"
+ start-stop-daemon --start --exec /sbin/irqbalance
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping irqbalance"
+ start-stop-daemon --stop --exec /sbin/irqbalance
+ eend $?
+}
diff --git a/sys-apps/irqbalance/files/irqbalance.init.2 b/sys-apps/irqbalance/files/irqbalance.init.2
new file mode 100644
index 000000000000..909800a9b3d9
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.init.2
@@ -0,0 +1,12 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+command="/usr/sbin/irqbalance"
+command_args="${IRQBALANCE_OPTS}"
diff --git a/sys-apps/irqbalance/files/irqbalance.init.3 b/sys-apps/irqbalance/files/irqbalance.init.3
new file mode 100644
index 000000000000..84cdb83af267
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.init.3
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+command="/usr/sbin/irqbalance"
+command_args="${IRQBALANCE_OPTS}"
+
+check_sysfs() {
+ if grep -q MSI /proc/interrupts 2>/dev/null && \
+ test -z "$(find /sys/devices -type d -name msi_irqs 2>/dev/null)"; then
+ eerror "MSI interrupts found in /proc/interrupts but none found in sysfs."
+ eerror "You need to update your kernel."
+ return 1
+ fi
+}
+
+start() {
+ check_sysfs || return 1
+ ebegin "Starting irqbalance"
+ start-stop-daemon --exec ${command} --start -- ${IRQBALANCE_OPTS}
+ eend $?
+}
diff --git a/sys-apps/irqbalance/files/irqbalance.service b/sys-apps/irqbalance/files/irqbalance.service
new file mode 100644
index 000000000000..b7b589f2294c
--- /dev/null
+++ b/sys-apps/irqbalance/files/irqbalance.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=CPU Interrupt Balancer
+
+[Service]
+ExecStart=/usr/sbin/irqbalance --debug
+# --debug implies a lot of cruft
+# but it's the only way to get foregrounding
+StandardOutput=null
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/irqbalance/irqbalance-0.56.ebuild b/sys-apps/irqbalance/irqbalance-0.56.ebuild
new file mode 100644
index 000000000000..68aaa82855b9
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-0.56.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils autotools
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="http://www.irqbalance.org/"
+SRC_URI="https://github.com/Irqbalance/irqbalancefiles/${P}.tbz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="caps"
+
+RDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+ mv cap-ng.m4 acinclude.m4 || die
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --sbindir=/sbin \
+ $(use_with caps libcap-ng)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ newinitd "${FILESDIR}"/irqbalance.init-0.55-r2 irqbalance || die
+ newconfd "${FILESDIR}"/irqbalance.confd irqbalance
+}
diff --git a/sys-apps/irqbalance/irqbalance-1.0.4.ebuild b/sys-apps/irqbalance/irqbalance-1.0.4.ebuild
new file mode 100644
index 000000000000..5671214309e9
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.0.4.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit systemd
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance"
+SRC_URI="https://github.com/Irqbalance/irqbalancefiles/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="caps numa"
+
+RDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )
+ numa? ( sys-process/numactl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_configure() {
+ econf \
+ $(use_with caps libcap-ng) \
+ $(use_enable numa)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/irqbalance.init.2 irqbalance
+ newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+ systemd_dounit "${FILESDIR}"/irqbalance.service
+}
diff --git a/sys-apps/irqbalance/irqbalance-1.0.5-r1.ebuild b/sys-apps/irqbalance/irqbalance-1.0.5-r1.ebuild
new file mode 100644
index 000000000000..02afb7473881
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.0.5-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit systemd linux-info
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance"
+SRC_URI="https://github.com/Irqbalance/irqbalancefiles/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="caps +numa"
+
+RDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )
+ numa? ( sys-process/numactl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_setup() {
+ CONFIG_CHECK="~PCI_MSI"
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ econf \
+ $(use_with caps libcap-ng) \
+ $(use_enable numa)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/irqbalance.init.3 irqbalance
+ newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+ systemd_dounit "${FILESDIR}"/irqbalance.service
+}
diff --git a/sys-apps/irqbalance/irqbalance-1.0.6.ebuild b/sys-apps/irqbalance/irqbalance-1.0.6.ebuild
new file mode 100644
index 000000000000..02afb7473881
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.0.6.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit systemd linux-info
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance"
+SRC_URI="https://github.com/Irqbalance/irqbalancefiles/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="caps +numa"
+
+RDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )
+ numa? ( sys-process/numactl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_setup() {
+ CONFIG_CHECK="~PCI_MSI"
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ econf \
+ $(use_with caps libcap-ng) \
+ $(use_enable numa)
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/irqbalance.init.3 irqbalance
+ newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+ systemd_dounit "${FILESDIR}"/irqbalance.service
+}
diff --git a/sys-apps/irqbalance/irqbalance-1.0.7-r1.ebuild b/sys-apps/irqbalance/irqbalance-1.0.7-r1.ebuild
new file mode 100644
index 000000000000..5efa212aaf3b
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.0.7-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils systemd linux-info
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance"
+SRC_URI="https://github.com/Irqbalance/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="caps +numa selinux"
+
+CDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )
+ numa? ( sys-process/numactl )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-irqbalance )
+"
+
+pkg_setup() {
+ CONFIG_CHECK="~PCI_MSI"
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with caps libcap-ng)
+ $(use_enable numa)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ newinitd "${FILESDIR}"/irqbalance.init.3 irqbalance
+ newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+ systemd_dounit "${FILESDIR}"/irqbalance.service
+}
diff --git a/sys-apps/irqbalance/irqbalance-1.0.7.ebuild b/sys-apps/irqbalance/irqbalance-1.0.7.ebuild
new file mode 100644
index 000000000000..f815943eb6aa
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.0.7.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils systemd linux-info
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance"
+SRC_URI="https://github.com/Irqbalance/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="caps +numa"
+
+RDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )
+ numa? ( sys-process/numactl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_setup() {
+ CONFIG_CHECK="~PCI_MSI"
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with caps libcap-ng)
+ $(use_enable numa)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ newinitd "${FILESDIR}"/irqbalance.init.3 irqbalance
+ newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+ systemd_dounit "${FILESDIR}"/irqbalance.service
+}
diff --git a/sys-apps/irqbalance/irqbalance-1.0.9.ebuild b/sys-apps/irqbalance/irqbalance-1.0.9.ebuild
new file mode 100644
index 000000000000..148cef01811b
--- /dev/null
+++ b/sys-apps/irqbalance/irqbalance-1.0.9.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils systemd linux-info
+
+DESCRIPTION="Distribute hardware interrupts across processors on a multiprocessor system"
+HOMEPAGE="https://github.com/Irqbalance/irqbalance"
+SRC_URI="https://github.com/Irqbalance/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="caps +numa selinux"
+
+CDEPEND="dev-libs/glib:2
+ caps? ( sys-libs/libcap-ng )
+ numa? ( sys-process/numactl )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-irqbalance )
+"
+
+pkg_setup() {
+ CONFIG_CHECK="~PCI_MSI"
+ linux-info_pkg_setup
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with caps libcap-ng)
+ $(use_enable numa)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+ newinitd "${FILESDIR}"/irqbalance.init.3 irqbalance
+ newconfd "${FILESDIR}"/irqbalance.confd-1 irqbalance
+ systemd_dounit "${FILESDIR}"/irqbalance.service
+}
diff --git a/sys-apps/irqbalance/metadata.xml b/sys-apps/irqbalance/metadata.xml
new file mode 100644
index 000000000000..9a4bd53c8a4d
--- /dev/null
+++ b/sys-apps/irqbalance/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="numa">Support balancing IRQs across NUMA nodes</flag>
+ </use>
+ <upstream>
+ <remote-id type="google-code">irqbalance</remote-id>
+ <remote-id type="github">Irqbalance/irqbalance</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/isapnptools/Manifest b/sys-apps/isapnptools/Manifest
new file mode 100644
index 000000000000..a33cf68d0999
--- /dev/null
+++ b/sys-apps/isapnptools/Manifest
@@ -0,0 +1 @@
+DIST isapnptools-1.27.tgz 499639 SHA256 32b1af6188a2b6fc432ab10c58a97985836ffa8d4762a8e9aae9b442a44466f4
diff --git a/sys-apps/isapnptools/files/isapnp.rc b/sys-apps/isapnptools/files/isapnp.rc
new file mode 100644
index 000000000000..1c8eb5509b4c
--- /dev/null
+++ b/sys-apps/isapnptools/files/isapnp.rc
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+check_config() {
+ if [ ! -e /etc/isapnp.conf ] ; then
+ eerror "You need an /etc/isapnp.conf file first"
+ eerror "Theres a sample in docs/isapnptools/txt"
+ return 1
+ fi
+ if [ ! -x /sbin/isapnp ] ; then
+ eerror "You're missing /sbin/isapnp; emerge sys-apps/isapnptools"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ check_config || return 1
+
+ ebegin "Configuring ISA PnP devices"
+ /sbin/isapnp /etc/isapnp.conf
+ eend $?
+}
diff --git a/sys-apps/isapnptools/files/isapnptools-1.26-gcc.patch b/sys-apps/isapnptools/files/isapnptools-1.26-gcc.patch
new file mode 100644
index 000000000000..3d1f2cee9f80
--- /dev/null
+++ b/sys-apps/isapnptools/files/isapnptools-1.26-gcc.patch
@@ -0,0 +1,41 @@
+http://bugs.gentoo.org/117333
+
+--- isapnptools/src/isapnp_main.l
++++ isapnptools/src/isapnp_main.l
+@@ -363,7 +363,6 @@
+ return 0;
+ }
+
+-static unsigned char serial_identifier[NUM_CARDS+1][IDENT_LEN];
+ static char *boardid[NUM_CARDS+1];
+ static unsigned long serno[NUM_CARDS+1];
+
+--- isapnptools/src/callbacks.c
++++ isapnptools/src/callbacks.c
+@@ -49,6 +49,7 @@
+ #include <isapnp/callbacks.h>
+ #endif
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+
+--- isapnptools/src/resource.c
++++ isapnptools/src/resource.c
+@@ -12,6 +12,7 @@
+ alloc_in_range_list() reordered to handle source name by P.Fox
+ */
+
++#define _GNU_SOURCE
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+@@ -285,7 +286,7 @@
+ void allocate_pci_resources( void )
+ {
+ char *line = 0;
+- int lineMax = 0;
++ size_t lineMax = 0;
+
+ FILE *fp = fopen( "/proc/bus/pci/devices", "rt" );
+ if( !fp )
diff --git a/sys-apps/isapnptools/files/isapnptools-1.27-include.patch b/sys-apps/isapnptools/files/isapnptools-1.27-include.patch
new file mode 100644
index 000000000000..a736ccc1eb9d
--- /dev/null
+++ b/sys-apps/isapnptools/files/isapnptools-1.27-include.patch
@@ -0,0 +1,10 @@
+--- src/callbacks.c.org 2001-05-15 22:37:04.000000000 +0200
++++ src/callbacks.c 2011-06-15 05:21:32.292819557 +0200
+@@ -51,6 +51,7 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
++#include <stdlib.h> /* exit() */
+
+ /****************************************************************************/
+
diff --git a/sys-apps/isapnptools/isapnptools-1.27.ebuild b/sys-apps/isapnptools/isapnptools-1.27.ebuild
new file mode 100644
index 000000000000..84dafbcaca4c
--- /dev/null
+++ b/sys-apps/isapnptools/isapnptools-1.27.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils
+
+DESCRIPTION="Tools for configuring ISA PnP devices"
+HOMEPAGE="http://www.roestock.demon.co.uk/isapnptools/"
+SRC_URI="ftp://metalab.unc.edu/pub/Linux/system/hardware/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-include.patch
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodir /sbin
+ mv "${D}"/usr/sbin/isapnp "${D}"/sbin/ || die
+
+ dodoc AUTHORS ChangeLog README NEWS
+ docinto txt
+ dodoc doc/README* doc/*.txt test/*.txt
+ dodoc etc/isapnp.*
+
+ newinitd "${FILESDIR}"/isapnp.rc isapnp
+}
diff --git a/sys-apps/isapnptools/metadata.xml b/sys-apps/isapnptools/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/isapnptools/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-apps/kbd/Manifest b/sys-apps/kbd/Manifest
new file mode 100644
index 000000000000..2687a82e30ea
--- /dev/null
+++ b/sys-apps/kbd/Manifest
@@ -0,0 +1,4 @@
+DIST kbd-1.15.5.tar.gz 1730719 SHA256 e35fa29f690dbbfb721706b2c8edc760c697640904fec65e81194ae8840c5c62 SHA512 725853b0ecde6a38976e2bae5672b8de78bfc90d65a0762695964a6dab729c96be4af778fe7f0f195caae04d630b07a3d0d95c9c928d1a5609e223e47723e58c WHIRLPOOL 431873623d4125b73622894c511711a2153fae498a17dc59851219405c69a641c24bb591fa66001eb4cc7491fc4f90e532661c2bf56f69e2a17dd435d1e14ace
+DIST kbd-2.0.1.tar.xz 951132 SHA256 55407b79e90ee65cdbaff7d3dafd2b53c4fee3a645788ffb582091074a2254af SHA512 8d6f663611a99426a7259909d1276732635edc90e61a4affc4cebbdd8bcb180c91a19c8f90bc1b6511c57abee66d5fa513f13bc05cfb3903ee51b5048577d836 WHIRLPOOL 3be2d1fb0cae1443dbd813a45cd815664e4bab94fa1bc37b0c3054f86846fa3d69c8c1a5e620413da34d65f58a90768eac22cd24972366f2d8d24fafcd094703
+DIST kbd-2.0.2.tar.xz 1023980 SHA256 9dfddabf96012e329c4bebb96a21aeef7c3872f624e96e8156ba542b82aeb912 SHA512 8159383f94242f06c701dfd5400e35bd3a76494a643f738d98c6713bcb20034065b49f31f66e8bf19e6829a30be97fbeee43ed8ad276febb98e28b3bf82972fa WHIRLPOOL e6a5be104b11266f8be9ba653e9e0de701cdf4c56b249af9bc52ea5eea374d1de82e3f4a02214552750adebb8ae21c8c964a4161d661e460f765306920e23849
+DIST kbd-2.0.3.tar.xz 1037036 SHA256 7a899de1c0eb75f3aea737095a736f2375e1cbfbe693fc14a3fe0bfb4649fb5e SHA512 522718859c2a95abee06a50dd0a7cfe7bb9c8f4b3959d54fd9e56cef23acc85b9af85405aa4953f20cd029397412051d72c8b1b0d639ba3a26b4952f89ef6a3f WHIRLPOOL 7534370cd0410119775c564269ada152248c75711332e2d6884d1503cef4f573617d7d7d4bb29c581ee993be2f8e96f6c290feb07bfabbb8c14a12ca6d33841e
diff --git a/sys-apps/kbd/files/kbd-1.15.5-loadkeys-parse.patch b/sys-apps/kbd/files/kbd-1.15.5-loadkeys-parse.patch
new file mode 100644
index 000000000000..c78a22780840
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.15.5-loadkeys-parse.patch
@@ -0,0 +1,90 @@
+https://bugs.gentoo.org/447440
+
+From 7e06e56157e8431d02e1377cdc44230944203d88 Mon Sep 17 00:00:00 2001
+From: Alexey Gladkov <gladkov.alexey@gmail.com>
+Date: Tue, 11 Dec 2012 14:24:44 +0400
+Subject: [PATCH] Fix regression in 16117ce6ab
+
+Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
+---
+ src/loadkeys.analyze.l | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/src/loadkeys.analyze.l b/src/loadkeys.analyze.l
+index c18dcea..f817c78 100644
+--- a/src/loadkeys.analyze.l
++++ b/src/loadkeys.analyze.l
+@@ -307,8 +307,10 @@ To to|To|TO
+ char *s = xstrndup(yytext+1, strlen(yytext)-2);
+ /* use static pathname to store *s ? */
+ open_include(s);
+- yy_pop_state();
+- state_ptr--;
++ while (state_ptr > 0) {
++ yy_pop_state();
++ state_ptr--;
++ }
+ }
+ <INCLSTR>[^"]|\"\"|\"[^"\n]*{Eol} {
+ yyerror(_("expected filename between quotes"));
+@@ -323,7 +325,7 @@ To to|To|TO
+ }
+ {Eol} {
+ line_nr++;
+- if (state_ptr > 0) {
++ while (state_ptr > 0) {
+ yy_pop_state();
+ state_ptr--;
+ }
+@@ -428,8 +430,10 @@ To to|To|TO
+ }
+ <STR>\" {
+ *p = '\0';
+- yy_pop_state();
+- state_ptr--;
++ while (state_ptr > 0) {
++ yy_pop_state();
++ state_ptr--;
++ }
+ return(STRLITERAL);
+ }
+ . {
+--- a/src/loadkeys.analyze.c
++++ b/src/loadkeys.analyze.c
+@@ -1359,8 +1359,10 @@ YY_RULE_SETUP
+ char *s = xstrndup(yytext+1, strlen(yytext)-2);
+ /* use static pathname to store *s ? */
+ open_include(s);
+- yy_pop_state();
+- state_ptr--;
++ while (state_ptr > 0) {
++ yy_pop_state();
++ state_ptr--;
++ }
+ }
+ YY_BREAK
+ case 3:
+@@ -1393,7 +1395,7 @@ YY_RULE_SETUP
+ #line 324 "loadkeys.analyze.l"
+ {
+ line_nr++;
+- if (state_ptr > 0) {
++ while (state_ptr > 0) {
+ yy_pop_state();
+ state_ptr--;
+ }
+@@ -1670,8 +1670,10 @@ YY_RULE_SETUP
+ #line 429 "loadkeys.analyze.l"
+ {
+ *p = '\0';
+- yy_pop_state();
+- state_ptr--;
++ while (state_ptr > 0) {
++ yy_pop_state();
++ state_ptr--;
++ }
+ return(STRLITERAL);
+ }
+ YY_BREAK
+--
+1.8.0.2
diff --git a/sys-apps/kbd/files/kbd-2.0.0-tests.patch b/sys-apps/kbd/files/kbd-2.0.0-tests.patch
new file mode 100644
index 000000000000..6a1c7ea851e3
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-2.0.0-tests.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/485116
+http://lists.altlinux.org/pipermail/kbd/2015-July/000558.html
+
+--- configure.ac
++++ configure.ac
+@@ -11,7 +11,13 @@
+ AC_CONFIG_SRCDIR([src/loadkeys.c])
+ AC_CONFIG_HEADERS(config.h)
+
+-PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
++AC_ARG_ENABLE(tests,
++ AS_HELP_STRING(--enable-tests, [build tests]),
++ [BUILD_TESTS=$enableval],[BUILD_TESTS=no])
++AM_CONDITIONAL(BUILD_TESTS, test "$BUILD_TESTS" = "yes")
++if test "$BUILD_TESTS" = "yes"; then
++ PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
++fi
+
+ m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
+ AM_SILENT_RULES([yes])
+--- Makefile.am
++++ Makefile.am
+@@ -8,7 +8,10 @@
+ CREDITS \
+ contrib docs rc
+
+-SUBDIRS = src data po tests docs
++SUBDIRS = src data po docs
++if BUILD_TESTS
++SUBDIRS += tests
++endif
+
+ kbd-$(VERSION).tar.xz:
+ make distcheck
diff --git a/sys-apps/kbd/files/kbd-2.0.1-big_endian.patch b/sys-apps/kbd/files/kbd-2.0.1-big_endian.patch
new file mode 100644
index 000000000000..f69b7f9c811a
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-2.0.1-big_endian.patch
@@ -0,0 +1,27 @@
+From 363185b72ccb5279fa950a378ebd93c082078d39 Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@iki.fi>
+Date: Sat, 15 Mar 2014 01:32:56 +0200
+Subject: libkeymap: fix kmap on big-endian machines
+
+Currently "loadkeys" does not work properly (no keys are ever changed)
+on big-endian machines (e.g. SPARC and other classic hardware)
+due to incorrect typing. The patch fixes this.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
+
+diff --git a/src/libkeymap/kmap.c b/src/libkeymap/kmap.c
+index e529136..85a3bb3 100644
+--- a/src/libkeymap/kmap.c
++++ b/src/libkeymap/kmap.c
+@@ -37,7 +37,7 @@ int
+ lk_key_exists(struct lk_ctx *ctx, unsigned int k_table, unsigned int k_index)
+ {
+ struct lk_array *map;
+- u_short *key;
++ unsigned int *key;
+
+ map = lk_array_get_ptr(ctx->keymap, k_table);
+ if (!map) {
+--
+cgit v0.10.1
+
diff --git a/sys-apps/kbd/files/kbd-2.0.1-stdarg.patch b/sys-apps/kbd/files/kbd-2.0.1-stdarg.patch
new file mode 100644
index 000000000000..b325af4b1d6a
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-2.0.1-stdarg.patch
@@ -0,0 +1,43 @@
+From 7955ccd650dc3235df3bf6333222c2811dd43141 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 6 Jan 2014 10:27:23 -0500
+Subject: [PATCH] libkeymap: include stdarg.h where used
+
+Some of these headers use va_list but don't include stdarg.h for it.
+
+Reported-by: Anthony Basile <blueness@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ src/libkeymap/contextP.h | 2 ++
+ src/libkeymap/keymap/common.h | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/src/libkeymap/contextP.h b/src/libkeymap/contextP.h
+index e3798e3..8ee3fab 100644
+--- a/src/libkeymap/contextP.h
++++ b/src/libkeymap/contextP.h
+@@ -1,6 +1,8 @@
+ #ifndef LK_CONTEXTP_H
+ #define LK_CONTEXTP_H
+
++#include <stdarg.h>
++
+ #include "keymap.h"
+
+ /**
+diff --git a/src/libkeymap/keymap/common.h b/src/libkeymap/keymap/common.h
+index 6b9cead..987b564 100644
+--- a/src/libkeymap/keymap/common.h
++++ b/src/libkeymap/keymap/common.h
+@@ -6,6 +6,8 @@
+ #ifndef LK_COMMON_H
+ #define LK_COMMON_H
+
++#include <stdarg.h>
++
+ #include <keymap/context.h>
+
+ /** Initializes the structures necessary to read and/or parse keymap.
+--
+1.8.4.3
+
diff --git a/sys-apps/kbd/kbd-1.15.5-r1.ebuild b/sys-apps/kbd/kbd-1.15.5-r1.ebuild
new file mode 100644
index 000000000000..39afe33989fe
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.15.5-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://freshmeat.net/projects/kbd/"
+SRC_URI="ftp://ftp.altlinux.org/pub/people/legion/kbd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls pam"
+
+RDEPEND="pam? ( virtual/pam )"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ default
+ cd "${S}"
+
+ # broken file ... upstream git punted it
+ rm po/es.po
+
+ # Rename conflicting keymaps to have unique names, bug #293228
+ cd "${S}"/data/keymaps/i386
+ mv dvorak/no.map dvorak/no-dvorak.map
+ mv fgGIod/trf.map fgGIod/trf-fgGIod.map
+ mv olpc/es.map olpc/es-olpc.map
+ mv olpc/pt.map olpc/pt-olpc.map
+ mv qwerty/cz.map qwerty/cz-qwerty.map
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-loadkeys-parse.patch #447440
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam vlock)
+}
+
+src_install() {
+ default
+ dohtml doc/*.html
+}
diff --git a/sys-apps/kbd/kbd-2.0.1-r1.ebuild b/sys-apps/kbd/kbd-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..9e7290fd570e
--- /dev/null
+++ b/sys-apps/kbd/kbd-2.0.1-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+SCM=""
+if [[ ${PV} == "9999" ]] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://git.kernel.org/cgit/linux/kernel/git/legion/${PN}.git"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/kbd/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit autotools eutils ${SCM}
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://kbd-project.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls pam test"
+
+RDEPEND="pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-libs/check )"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ default
+ fi
+
+ # Rename conflicting keymaps to have unique names, bug #293228
+ cd "${S}"/data/keymaps/i386 || die
+ mv dvorak/no.map dvorak/no-dvorak.map || die
+ mv fgGIod/trf.map fgGIod/trf-fgGIod.map || die
+ mv olpc/es.map olpc/es-olpc.map || die
+ mv olpc/pt.map olpc/pt-olpc.map || die
+ mv qwerty/cz.map qwerty/cz-qwerty.map || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.0.0-tests.patch #485116
+ epatch "${FILESDIR}"/${P}-stdarg.patch #497200
+ epatch "${FILESDIR}"/${P}-big_endian.patch #508436
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam vlock) \
+ $(use_enable test tests)
+}
+
+src_install() {
+ default
+ dohtml docs/doc/*.html
+}
diff --git a/sys-apps/kbd/kbd-2.0.1.ebuild b/sys-apps/kbd/kbd-2.0.1.ebuild
new file mode 100644
index 000000000000..5f39fcdb1409
--- /dev/null
+++ b/sys-apps/kbd/kbd-2.0.1.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 autotools eutils
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://kbd-project.org/"
+SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/kbd/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="nls pam test"
+
+RDEPEND="pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-libs/check )"
+
+src_unpack() {
+ default
+ cd "${S}"
+
+ # broken file ... upstream git punted it
+ rm po/es.po
+
+ # Rename conflicting keymaps to have unique names, bug #293228
+ cd "${S}"/data/keymaps/i386
+ mv dvorak/no.map dvorak/no-dvorak.map
+ mv fgGIod/trf.map fgGIod/trf-fgGIod.map
+ mv olpc/es.map olpc/es-olpc.map
+ mv olpc/pt.map olpc/pt-olpc.map
+ mv qwerty/cz.map qwerty/cz-qwerty.map
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.0.0-tests.patch #485116
+ epatch "${FILESDIR}"/${P}-stdarg.patch #497200
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam vlock) \
+ $(use_enable test tests)
+}
+
+src_install() {
+ default
+ dohtml docs/doc/*.html
+}
diff --git a/sys-apps/kbd/kbd-2.0.2.ebuild b/sys-apps/kbd/kbd-2.0.2.ebuild
new file mode 100644
index 000000000000..8d8d16b66f15
--- /dev/null
+++ b/sys-apps/kbd/kbd-2.0.2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+SCM=""
+if [[ ${PV} == "9999" ]] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://git.kernel.org/cgit/linux/kernel/git/legion/${PN}.git"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/kbd/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit autotools eutils ${SCM}
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://kbd-project.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls pam test"
+
+RDEPEND="pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-libs/check )"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ default
+ fi
+
+ # Rename conflicting keymaps to have unique names, bug #293228
+ cd "${S}"/data/keymaps/i386 || die
+ mv dvorak/no.map dvorak/no-dvorak.map || die
+ mv fgGIod/trf.map fgGIod/trf-fgGIod.map || die
+ mv olpc/es.map olpc/es-olpc.map || die
+ mv olpc/pt.map olpc/pt-olpc.map || die
+ mv qwerty/cz.map qwerty/cz-qwerty.map || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.0.0-tests.patch #485116
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam vlock) \
+ $(use_enable test tests)
+}
+
+src_install() {
+ default
+ dohtml docs/doc/*.html
+}
diff --git a/sys-apps/kbd/kbd-2.0.3.ebuild b/sys-apps/kbd/kbd-2.0.3.ebuild
new file mode 100644
index 000000000000..9abe5c9b8cc5
--- /dev/null
+++ b/sys-apps/kbd/kbd-2.0.3.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+SCM=""
+if [[ ${PV} == "9999" ]] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://git.kernel.org/cgit/linux/kernel/git/legion/${PN}.git"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/kbd/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit autotools eutils ${SCM}
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://kbd-project.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls pam test"
+
+RDEPEND="pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-libs/check )"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ default
+ fi
+
+ # Rename conflicting keymaps to have unique names, bug #293228
+ cd "${S}"/data/keymaps/i386 || die
+ mv dvorak/no.map dvorak/no-dvorak.map || die
+ mv fgGIod/trf.map fgGIod/trf-fgGIod.map || die
+ mv olpc/es.map olpc/es-olpc.map || die
+ mv olpc/pt.map olpc/pt-olpc.map || die
+ mv qwerty/cz.map qwerty/cz-qwerty.map || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.0.0-tests.patch #485116
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam vlock) \
+ $(use_enable test tests)
+}
+
+src_install() {
+ default
+ dohtml docs/doc/*.html
+}
diff --git a/sys-apps/kbd/kbd-9999.ebuild b/sys-apps/kbd/kbd-9999.ebuild
new file mode 100644
index 000000000000..0ac630952e9b
--- /dev/null
+++ b/sys-apps/kbd/kbd-9999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+SCM=""
+if [[ ${PV} == "9999" ]] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://git.kernel.org/cgit/linux/kernel/git/legion/kbd.git"
+ EGIT_BRANCH="master"
+else
+ SRC_URI="ftp://ftp.kernel.org/pub/linux/utils/kbd/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+inherit autotools eutils ${SCM}
+
+DESCRIPTION="Keyboard and console utilities"
+HOMEPAGE="http://kbd-project.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls pam test"
+
+RDEPEND="pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? ( dev-libs/check )"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ else
+ default
+ fi
+
+ # Rename conflicting keymaps to have unique names, bug #293228
+ cd "${S}"/data/keymaps/i386 || die
+ mv dvorak/no.map dvorak/no-dvorak.map || die
+ mv fgGIod/trf.map fgGIod/trf-fgGIod.map || die
+ mv olpc/es.map olpc/es-olpc.map || die
+ mv olpc/pt.map olpc/pt-olpc.map || die
+ mv qwerty/cz.map qwerty/cz-qwerty.map || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.0.0-tests.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable pam vlock) \
+ $(use_enable test tests)
+}
+
+src_install() {
+ default
+ dohtml docs/doc/*.html
+}
diff --git a/sys-apps/kbd/metadata.xml b/sys-apps/kbd/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/kbd/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-apps/kexec-tools/Manifest b/sys-apps/kexec-tools/Manifest
new file mode 100644
index 000000000000..2958a551adec
--- /dev/null
+++ b/sys-apps/kexec-tools/Manifest
@@ -0,0 +1,3 @@
+DIST kexec-tools-2.0.4.tar.xz 271604 SHA256 e5f5ab00d746eb15b4714eca6a8ec5a1a86a62ce2bbdad1b3000161138a978c6 SHA512 2514f407d9150d2615dffc91a525fb28f159bef92b9543f9802e2618746b7d4c04137668ad8a8d8f0b75f68ed9057d09629ce736b6a061b5cf817b9d904f549e WHIRLPOOL 70ad298512e700cd1cdee7698e4fa68a769d91d3080d5d8387b8362ad49126ad68b0b6dbd1f13305958bdc988f805fa610e487682fd0eb5e4e9bcda0a9022627
+DIST kexec-tools-2.0.8.tar.xz 272648 SHA256 f3abe96fa0793e63936725a4471429f070039a1e81e605deb378747194a50c47 SHA512 94d715cdf779802308f5f8a0bdfae55c1798cc515fd322a490e8b5414763ab4fa924930022baa0689cd001c2431aef4f28f18b3c7b0b7000cdfaa1a159ad5251 WHIRLPOOL 8d13239e153dded9a98f847101d5581fed8e5a51a17961d6156f0135642e589b7e766ecaeef439fca2b69d4a2bc8e8d3f681a78f28d35acf03bc8d6c06f8ab9e
+DIST kexec-tools-2.0.9.tar.xz 272728 SHA256 8ae34a9ceb76350954e1e1e3ca9ab51da15862bd5f2fd14392208e60fb454f71 SHA512 b58f8f0872f1a6a3a93bc67068d7035c4b39e985dafadc573585d92259ff289bf98d5a567293a5286668315ac2158b232919e0c6847fdefc68b7ecbcfab5109e WHIRLPOOL 840d9d17ce9facc131736ef52acabb03bcc6d21f671896ff5603bd8d6bd629519e169ca878a127b863235b236dafd3b29f598424b272f599503bb3f1a5f70050
diff --git a/sys-apps/kexec-tools/files/90_kexec b/sys-apps/kexec-tools/files/90_kexec
new file mode 100644
index 000000000000..40bad423955d
--- /dev/null
+++ b/sys-apps/kexec-tools/files/90_kexec
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+version="$1" ; shift
+image="$1" ; shift
+
+exec sed \
+ -e "s:\"vmlinuz-.*\":\"vmlinuz-${version}\":" \
+ -e "s:/boot/initramfs-.*\.img:/boot/initramfs-${version}\.img:" \
+ -i /etc/kexec.conf
diff --git a/sys-apps/kexec-tools/files/README.Gentoo b/sys-apps/kexec-tools/files/README.Gentoo
new file mode 100644
index 000000000000..7735e3275ba4
--- /dev/null
+++ b/sys-apps/kexec-tools/files/README.Gentoo
@@ -0,0 +1,33 @@
+Usage
+=====
+
+Do
+ $ man 8 kexec
+for full understanding of the underlying kexec command.
+Gentoo offers a wrapper to the bare kexec command through
+/etc/init.d/kexec.
+
+Configuration
+-------------
+
+Configuration is done in /etc/conf.d/kexec, which is self-documented.
+
+Usage
+-----
+
+In Gentoo, kexec is invoked, i.e., the new kernel will be booted when
+rebooting, by reboot (8) command or by pressing Ctrl+Alt+Del.
+
+If you want to use kexec once, just run
+ $ /etc/init.d/kexec start
+
+It'll reserve kexec call at reboot. Later on, you can reboot anytime,
+letting kexec starts another (or the same) kernel. When all is done in
+the runlevel 6 - killing processes, unmounting volumes, etc - kexec
+starts the new kernel instead of doing the normal hardware reboot.
+
+If you want kexec to be run every time you reboot, add it to a runlevel:
+ $ rc-update add kexec <runlevel>
+
+If you want to reboot in the normal way this time, do:
+ $ touch /nokexec
diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.0-respect-LDFLAGS.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.0-respect-LDFLAGS.patch
new file mode 100644
index 000000000000..040d138ece06
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.0-respect-LDFLAGS.patch
@@ -0,0 +1,11 @@
+--- kdump/Makefile
++++ kdump/Makefile
+@@ -18,7 +18,7 @@
+ $(KDUMP): CC=$(TARGET_CC)
+ $(KDUMP): $(KDUMP_OBJS)
+ @$(MKDIR) -p $(@D)
+- $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $(KDUMP_OBJS)
++ $(LINK.o) $(CFLAGS) -o $@ $(KDUMP_OBJS)
+
+ $(KDUMP_MANPAGE): kdump/kdump.8
+ $(MKDIR) -p $(MANDIR)/man8
diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch
new file mode 100644
index 000000000000..6fc73f2db181
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-disable-kexec-test.patch
@@ -0,0 +1,17 @@
+diff --git kexec-tools-2.0.3/kexec_test/Makefile kexec-tools-2.0.3/kexec_test/Makefile
+index fec6210..2ed4d51 100644
+--- kexec-tools-2.0.3/kexec_test/Makefile
++++ kexec-tools-2.0.3/kexec_test/Makefile
+@@ -8,12 +8,6 @@ dist += kexec_test/Makefile $(KEXEC_TEST_SRCS) \
+ kexec_test/x86-setup-legacy-pic.S
+
+ BUILD_KEXEC_TEST = no
+-ifeq ($(ARCH),i386)
+-BUILD_KEXEC_TEST = yes
+-endif
+-ifeq ($(ARCH),x86_64)
+-BUILD_KEXEC_TEST = yes
+-endif
+
+ ifeq ($(BUILD_KEXEC_TEST),yes)
+
diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.4-out-of-source.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-out-of-source.patch
new file mode 100644
index 000000000000..64c6cd8ab419
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.4-out-of-source.patch
@@ -0,0 +1,24 @@
+ Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index c1859d1..1aa8559 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -44,7 +44,7 @@ TARGET_CFLAGS = @TARGET_CFLAGS@
+
+ # Base compiler flags. These are extended by the subcomponent-Makefiles
+ # where necessary.
+-CPPFLAGS = @CPPFLAGS@ -I$(srcdir)/include -I$(srcdir)/util_lib/include \
++CPPFLAGS = @CPPFLAGS@ -I$(top_builddir)/include -I$(srcdir)/include -I$(srcdir)/util_lib/include \
+ -Iinclude/ $($(ARCH)_CPPFLAGS)
+ CFLAGS = @CFLAGS@ -fno-strict-aliasing -Wall -Wstrict-prototypes
+ PURGATORY_EXTRA_CFLAGS = @PURGATORY_EXTRA_CFLAGS@
+@@ -77,6 +77,7 @@ pkgincludedir = $(includedir)/$(PACKAGE_NAME)
+ DESTDIR =
+
+ srcdir = @srcdir@
++top_builddir = @top_builddir@
+ VPATH = .:$(srcdir)
+
+ # install paths
diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.9-hardened.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.9-hardened.patch
new file mode 100644
index 000000000000..01a8b4be933b
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.9-hardened.patch
@@ -0,0 +1,16 @@
+the purgatory subdir gets loaded into the kernel so we need to
+make sure it does not get built with compiler settings like the
+rest of the userland tools. that means no PIC/PIE/SSP/etc...
+
+--- a/purgatory/Makefile
++++ b/purgatory/Makefile
+@@ -47,7 +47,8 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
+ $(PURGATORY): CC=$(TARGET_CC)
+ $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
+ $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+- -Os -fno-builtin -ffreestanding
++ -Os -fno-builtin -ffreestanding \
++ -fno-PIC -fno-PIE -fno-stack-protector
+
+ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ -I$(srcdir)/purgatory/include \
diff --git a/sys-apps/kexec-tools/files/kexec.conf b/sys-apps/kexec-tools/files/kexec.conf
new file mode 100644
index 000000000000..aa829b9c2349
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.conf
@@ -0,0 +1,16 @@
+# Kernel image pathname, relative from /boot.
+KNAME="bzimage"
+
+# Additional arguments passed to kexec (8)
+# Following arguments are support:
+#
+# --reuse-cmdline
+# Use the current boot command line
+#
+# --command-line=string
+# Use a different command line
+#
+# --initrd=file
+# Specify an initrd to use
+#
+KEXEC_OPT_ARGS="--reuse-cmdline"
diff --git a/sys-apps/kexec-tools/files/kexec.conf-2.0.4 b/sys-apps/kexec-tools/files/kexec.conf-2.0.4
new file mode 100644
index 000000000000..b71ea2bae97f
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.conf-2.0.4
@@ -0,0 +1,34 @@
+# Load kexec kernel image into memory during shutdown instead of bootup
+# (default: yes)
+#LOAD_DURING_SHUTDOWN="yes"
+
+# Additional arguments passed to kexec (8)
+#KEXEC_OPT_ARGS=""
+
+# Kernel image partition. Mounted automatically if not.
+# (default: /boot)
+#BOOTPART="/boot"
+
+# Root partition (should be autodetected)
+#ROOTPART="/dev/hda3"
+
+# Kernel image pathname, relative from BOOTPART.
+# If it's one of
+# {kernel-genkernel,bzImage,vmlinuz,kernel}-<currently running kernel version>,
+# or bzImage, vmlinuz (without suffix),
+# then it's automaticaly detected.
+# Setting it to "-" will disable kexec.
+#KNAME="vmlinuz-3.9.0"
+
+# Initrd
+# Same automatic detection restriction as for KNAME apply.
+# initramfs-genkernel-<currently running kernel version>,
+# initrd{,.img}-<currently running kernel version>{,.img}
+# will be detected.
+#INITRD="/boot/fbsplash-emergence-1024x768"
+
+# Kernel parameters (should be autodetected)
+#KPARAM="splash=silent,theme:emergence"
+
+# Do not try to mount /boot
+# DONT_MOUNT_BOOT="yes"
diff --git a/sys-apps/kexec-tools/files/kexec.conf-9999 b/sys-apps/kexec-tools/files/kexec.conf-9999
new file mode 100644
index 000000000000..74f8b891ce54
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.conf-9999
@@ -0,0 +1,18 @@
+# Boot partition
+#BOOTPART="/boot"
+
+# Kernel name
+#KNAME="vmlinuz-2.6.10"
+
+# Root partition (should be autodetected)
+#ROOTPART="/dev/hda3"
+
+# Kernel parameters (should be autodetected)
+#KPARAM="splash=silent,theme:emergence"
+
+# Initrd
+#INITRD="/boot/fbsplash-emergence-1024x768"
+
+# Load kexec kernel image into memory during shutdown instead of bootup
+# (default: yes)
+#LOAD_DURING_SHUTDOWN="yes"
diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.4 b/sys-apps/kexec-tools/files/kexec.init-2.0.4
new file mode 100644
index 000000000000..a7101efbd87e
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4
@@ -0,0 +1,144 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+image_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ for x in "${KNAME:-bzImage}" vmlinuz \
+ bzImage-${kver} vmlinuz-${kver} \
+ kernel-genkernel-${karch}-${kver} \
+ kernel-${kver} kernel-${karch}; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+initrd_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ for x in "${INITRD:-initrd}" \
+ initrd.img-${kver} initrd-${kver}.img \
+ initrd-${kver} initramfs-${kver}.img \
+ initramfs-genkernel-${karch}-${kver} ; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+mount_boot(){
+ local ret
+
+ [ -n ${DONT_MOUNT_BOOT} ] && return 1
+ grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1
+
+ BOOTPART="${BOOTPART:-/boot}"
+ ebegin "Mounting ${BOOTPART}"
+ mount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ return ${ret}
+}
+
+load_image() {
+ local ret
+ if [ "${KNAME}" = "-" ]; then
+ ebegin "Disabling kexec"
+ kexec -u; ret=$?
+ eend ${ret}
+ return ${ret}
+ fi
+
+ BOOTPART="${BOOTPART:-/boot}"
+ local img= initrd="$(initrd_path)" mounted=false initrdopt=
+
+ if ! img="$(image_path)"; then
+ if mount_boot; then
+ if img="$(image_path)"; then
+ mounted=true
+ initrd="$(initrd_path)"
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ umount "${BOOTPART}"
+ return 1
+ fi
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ return 1
+ fi
+ fi
+
+ if [ -n "${INITRD}" ] && \
+ ! [ "${INITRD}" = "${initrd}" ]; then
+ eerror "Requested initrd: ${INITRD}"
+ eerror "could not be found"
+ return 1
+ fi
+
+ [ -n "${ROOTPART}" ] || \
+ ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")"
+
+ [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline"
+
+ [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}"
+
+ local msg=
+ [ -n ${initrd} ] && \
+ msg="with ${initrd}"
+ einfo "Using kernel image ${img} ${msg} for kexec"
+
+ ebegin "Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}"
+ kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt}
+ local res=$?
+
+ ${mounted} && umount "${BOOTPART}"
+ eend ${res}
+ return ${res}
+}
+
+start() {
+ if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then
+ if ! image_path > /dev/null; then
+ ewarn "Cannot find kernel image!"
+ ewarn "Please make sure a valid kernel image is present before reboot."
+ return 0
+ fi
+ else
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+ fi
+}
+
+stop() {
+ [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0
+
+ if ! yesno $RC_REBOOT; then
+ einfo "Not rebooting, so disabling"
+ kexec -u
+ return 0
+ fi
+
+ if [ -f /nokexec ]; then
+ einfo "Not using kexec during reboot"
+ rm -f /nokexec
+ kexec -u
+ return 0
+ fi
+
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+}
diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2 b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2
new file mode 100644
index 000000000000..f1306874297c
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r2
@@ -0,0 +1,165 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+image_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ KNAME="${KNAME:-bzImage}"
+ if [ -e "${KNAME}" ]; then
+ echo "${KNAME}"
+ return 0
+ fi
+ for x in "${KNAME#${BOOTPART}}" vmlinuz \
+ bzImage-${kver} vmlinuz-${kver} \
+ kernel-genkernel-${karch}-${kver} \
+ kernel-${kver} kernel-${karch}; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+initrd_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ INITRD="${INITRD:-initrd}"
+ if [ -e "${INITRD}" ]; then
+ echo "${INITRD}"
+ return 0
+ fi
+ for x in "${INITRD#${BOOTPART}}" \
+ initrd.img-${kver} initrd-${kver}.img \
+ initrd-${kver} initramfs-${kver}.img \
+ initramfs-genkernel-${karch}-${kver} ; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+mount_boot(){
+ local ret
+
+ [ -n "${DONT_MOUNT_BOOT}" ] && return 1
+ grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1
+
+ BOOTPART="${BOOTPART:-/boot}"
+ ebegin "Mounting ${BOOTPART}"
+ mount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ return ${ret}
+}
+
+load_image() {
+ local ret
+ if [ "${KNAME}" = "-" ]; then
+ ebegin "Disabling kexec"
+ kexec -u; ret=$?
+ eend ${ret}
+ return ${ret}
+ fi
+
+ BOOTPART="${BOOTPART:-/boot}"
+ local img= initrd="$(initrd_path)" mounted=false initrdopt=
+
+ if ! img="$(image_path)"; then
+ if mount_boot; then
+ if img="$(image_path)"; then
+ mounted=true
+ initrd="$(initrd_path)"
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ umount "${BOOTPART}"
+ return 1
+ fi
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ return 1
+ fi
+ fi
+
+ if [ -n "${INITRD}" ] && \
+ ! [ "${BOOTPART}/${INITRD#${BOOTPART}}" = "${initrd}" ]; then
+ eerror "Requested initrd: ${INITRD#${BOOTPART}}"
+ eerror "could not be found"
+ return 1
+ fi
+
+ [ -n "${ROOTPART}" ] || \
+ ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")"
+
+ [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline"
+
+ [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}"
+
+ local msg=
+ [ -n "${initrd}" ] && \
+ msg="with ${initrd}"
+ einfo "Using kernel image ${img} ${msg} for kexec"
+
+ ebegin "Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}"
+ kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt}
+ local res=$?
+
+ ${mounted} && umount "${BOOTPART}"
+ eend ${res}
+ return ${res}
+}
+
+start() {
+ if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then
+ local ret=0
+ BOOTPART="${BOOTPART:-/boot}"
+ if mount_boot; then
+ mounted=true
+ fi
+ if ! image_path > /dev/null; then
+ ewarn "Cannot find kernel image!"
+ ewarn "Please make sure a valid kernel image is present before reboot."
+ return 0
+ fi
+ if [ -n "${mounted}" ]; then
+ ebegin "Unmounting ${BOOTPART}"
+ umount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ fi
+ return ${ret}
+ else
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+ fi
+}
+
+stop() {
+ [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0
+
+ if ! yesno $RC_REBOOT; then
+ einfo "Not rebooting, so disabling"
+ kexec -u
+ return 0
+ fi
+
+ if [ -f /nokexec ]; then
+ einfo "Not using kexec during reboot"
+ rm -f /nokexec
+ kexec -u
+ return 0
+ fi
+
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+}
diff --git a/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3 b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3
new file mode 100644
index 000000000000..7aa55af80c00
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.init-2.0.4-r3
@@ -0,0 +1,165 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+image_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ KNAME="${KNAME:-bzImage}"
+ if [ -e "${KNAME}" ]; then
+ echo "${KNAME}"
+ return 0
+ fi
+ for x in "${KNAME#${BOOTPART}}" vmlinuz \
+ bzImage-${kver} vmlinuz-${kver} \
+ kernel-genkernel-${karch}-${kver} \
+ kernel-${kver} kernel-${karch}; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+initrd_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ INITRD="${INITRD:-initrd}"
+ if [ -e "${INITRD}" ]; then
+ echo "${INITRD}"
+ return 0
+ fi
+ for x in "${INITRD#${BOOTPART}}" \
+ initrd.img-${kver} initrd-${kver}.img \
+ initrd-${kver} initramfs-${kver}.img \
+ initramfs-genkernel-${karch}-${kver} ; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+mount_boot(){
+ local ret
+
+ [ "${DONT_MOUNT_BOOT:-no}" = "no" ] || return 1
+ grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1
+
+ BOOTPART="${BOOTPART:-/boot}"
+ ebegin "Mounting ${BOOTPART}"
+ mount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ return ${ret}
+}
+
+load_image() {
+ local ret
+ if [ "${KNAME}" = "-" ]; then
+ ebegin "Disabling kexec"
+ kexec -u; ret=$?
+ eend ${ret}
+ return ${ret}
+ fi
+
+ BOOTPART="${BOOTPART:-/boot}"
+ local img= initrd="$(initrd_path)" mounted=false initrdopt=
+
+ if ! img="$(image_path)"; then
+ if mount_boot; then
+ if img="$(image_path)"; then
+ mounted=true
+ initrd="$(initrd_path)"
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ umount "${BOOTPART}"
+ return 1
+ fi
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ return 1
+ fi
+ fi
+
+ if [ -n "${INITRD}" ] && \
+ ! [ "${BOOTPART}/${INITRD#${BOOTPART}}" = "${initrd}" ]; then
+ eerror "Requested initrd: ${INITRD#${BOOTPART}}"
+ eerror "could not be found"
+ return 1
+ fi
+
+ [ -n "${ROOTPART}" ] || \
+ ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")"
+
+ [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline"
+
+ [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}"
+
+ local msg=
+ [ -n "${initrd}" ] && \
+ msg="with ${initrd}"
+ einfo "Using kernel image ${img} ${msg} for kexec"
+
+ ebegin "Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}"
+ kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt}
+ local res=$?
+
+ ${mounted} && umount "${BOOTPART}"
+ eend ${res}
+ return ${res}
+}
+
+start() {
+ if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then
+ local ret=0
+ BOOTPART="${BOOTPART:-/boot}"
+ if mount_boot; then
+ mounted=true
+ fi
+ if ! image_path > /dev/null; then
+ ewarn "Cannot find kernel image!"
+ ewarn "Please make sure a valid kernel image is present before reboot."
+ return 0
+ fi
+ if [ -n "${mounted}" ]; then
+ ebegin "Unmounting ${BOOTPART}"
+ umount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ fi
+ return ${ret}
+ else
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+ fi
+}
+
+stop() {
+ if ! yesno $RC_REBOOT; then
+ einfo "Not rebooting, so disabling"
+ kexec -u
+ return 0
+ fi
+
+ if [ -f /nokexec ]; then
+ einfo "Not using kexec during reboot"
+ rm -f /nokexec
+ kexec -u
+ return 0
+ fi
+
+ [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0
+
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+}
diff --git a/sys-apps/kexec-tools/files/kexec.init-9999 b/sys-apps/kexec-tools/files/kexec.init-9999
new file mode 100644
index 000000000000..f1306874297c
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.init-9999
@@ -0,0 +1,165 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+image_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ KNAME="${KNAME:-bzImage}"
+ if [ -e "${KNAME}" ]; then
+ echo "${KNAME}"
+ return 0
+ fi
+ for x in "${KNAME#${BOOTPART}}" vmlinuz \
+ bzImage-${kver} vmlinuz-${kver} \
+ kernel-genkernel-${karch}-${kver} \
+ kernel-${kver} kernel-${karch}; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+initrd_path() {
+ local x= kver=$(uname -r) karch=$(uname -m)
+ BOOTPART="${BOOTPART:-/boot}"
+ INITRD="${INITRD:-initrd}"
+ if [ -e "${INITRD}" ]; then
+ echo "${INITRD}"
+ return 0
+ fi
+ for x in "${INITRD#${BOOTPART}}" \
+ initrd.img-${kver} initrd-${kver}.img \
+ initrd-${kver} initramfs-${kver}.img \
+ initramfs-genkernel-${karch}-${kver} ; do
+ if [ -e "${BOOTPART}/${x}" ]; then
+ echo "${BOOTPART}/${x}"
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+mount_boot(){
+ local ret
+
+ [ -n "${DONT_MOUNT_BOOT}" ] && return 1
+ grep -q " ${BOOTPART:-/boot} " /proc/mounts && return 1
+
+ BOOTPART="${BOOTPART:-/boot}"
+ ebegin "Mounting ${BOOTPART}"
+ mount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ return ${ret}
+}
+
+load_image() {
+ local ret
+ if [ "${KNAME}" = "-" ]; then
+ ebegin "Disabling kexec"
+ kexec -u; ret=$?
+ eend ${ret}
+ return ${ret}
+ fi
+
+ BOOTPART="${BOOTPART:-/boot}"
+ local img= initrd="$(initrd_path)" mounted=false initrdopt=
+
+ if ! img="$(image_path)"; then
+ if mount_boot; then
+ if img="$(image_path)"; then
+ mounted=true
+ initrd="$(initrd_path)"
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ umount "${BOOTPART}"
+ return 1
+ fi
+ else
+ eerror "No kernel image found in ${BOOTPART}!"
+ return 1
+ fi
+ fi
+
+ if [ -n "${INITRD}" ] && \
+ ! [ "${BOOTPART}/${INITRD#${BOOTPART}}" = "${initrd}" ]; then
+ eerror "Requested initrd: ${INITRD#${BOOTPART}}"
+ eerror "could not be found"
+ return 1
+ fi
+
+ [ -n "${ROOTPART}" ] || \
+ ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")"
+
+ [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline"
+
+ [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}"
+
+ local msg=
+ [ -n "${initrd}" ] && \
+ msg="with ${initrd}"
+ einfo "Using kernel image ${img} ${msg} for kexec"
+
+ ebegin "Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}"
+ kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt}
+ local res=$?
+
+ ${mounted} && umount "${BOOTPART}"
+ eend ${res}
+ return ${res}
+}
+
+start() {
+ if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then
+ local ret=0
+ BOOTPART="${BOOTPART:-/boot}"
+ if mount_boot; then
+ mounted=true
+ fi
+ if ! image_path > /dev/null; then
+ ewarn "Cannot find kernel image!"
+ ewarn "Please make sure a valid kernel image is present before reboot."
+ return 0
+ fi
+ if [ -n "${mounted}" ]; then
+ ebegin "Unmounting ${BOOTPART}"
+ umount "${BOOTPART}"; ret=$?
+ eend ${ret}
+ fi
+ return ${ret}
+ else
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+ fi
+}
+
+stop() {
+ [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0
+
+ if ! yesno $RC_REBOOT; then
+ einfo "Not rebooting, so disabling"
+ kexec -u
+ return 0
+ fi
+
+ if [ -f /nokexec ]; then
+ einfo "Not using kexec during reboot"
+ rm -f /nokexec
+ kexec -u
+ return 0
+ fi
+
+ ebegin "Configuring kexec"
+ load_image
+ eend $?
+}
diff --git a/sys-apps/kexec-tools/files/kexec.service b/sys-apps/kexec-tools/files/kexec.service
new file mode 100644
index 000000000000..289aae0df0b1
--- /dev/null
+++ b/sys-apps/kexec-tools/files/kexec.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Gracefully restart the box
+Documentation=man:kexec(8)
+After=boot.mount
+Before=shutdown.target umount.target final.target
+ConditionPathExists=!/nokexec
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+EnvironmentFile=/etc/kexec.conf
+ExecStart=/usr/sbin/kexec -l /boot/${KNAME} ${KEXEC_OPT_ARGS}
+ExecStop=/usr/sbin/kexec -l /boot/${KNAME} ${KEXEC_OPT_ARGS}
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild
new file mode 100644
index 000000000000..d99e5f2416d4
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.4-r2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils flag-o-matic linux-info systemd
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/"
+SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KEXEC"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.0-respect-LDFLAGS.patch
+ "${FILESDIR}"/${P}-disable-kexec-test.patch
+ "${FILESDIR}"/${P}-out-of-source.patch
+ )
+
+pkg_setup() {
+ # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+ export ASFLAGS="${CCASFLAGS}"
+ # to disable the -fPIE -pie in the hardened compiler
+ if gcc-specs-pie ; then
+ filter-flags -fPIE
+ append-ldflags -nopie
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with booke)
+ $(use_with lzma)
+ $(use_with xen)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-${PVR} kexec
+ newconfd "${FILESDIR}"/kexec.conf-${PV} kexec
+
+ insinto /etc
+ doins "${FILESDIR}"/kexec.conf
+
+ systemd_dounit "${FILESDIR}"/kexec.service
+}
+
+pkg_postinst() {
+ if systemd_is_booted || has_version sys-apps/systemd; then
+ elog "For systemd support the new config file is"
+ elog " /etc/kexec.conf"
+ elog "Please adopt it to your needs as there is no autoconfig anymore"
+ fi
+}
diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.8.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.8.ebuild
new file mode 100644
index 000000000000..2d42e5c41090
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.8.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils flag-o-matic linux-info systemd
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/"
+SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KEXEC"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
+ "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
+ )
+
+pkg_setup() {
+ # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+ export ASFLAGS="${CCASFLAGS}"
+ # to disable the -fPIE -pie in the hardened compiler
+ if gcc-specs-pie ; then
+ filter-flags -fPIE
+ append-ldflags -nopie
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with booke)
+ $(use_with lzma)
+ $(use_with xen)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-2.0.4-r2 kexec
+ newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
+
+ insinto /etc
+ doins "${FILESDIR}"/kexec.conf
+
+ insinto /etc/kernel/postinst.d
+ doins "${FILESDIR}"/90_kexec
+
+ systemd_dounit "${FILESDIR}"/kexec.service
+}
+
+pkg_postinst() {
+ if systemd_is_booted || has_version sys-apps/systemd; then
+ elog "For systemd support the new config file is"
+ elog " /etc/kexec.conf"
+ elog "Please adopt it to your needs as there is no autoconfig anymore"
+ fi
+}
diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.9-r1.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.9-r1.ebuild
new file mode 100644
index 000000000000..7eecf04aac47
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.9-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils linux-info systemd
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/"
+SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KEXEC"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
+ "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
+ "${FILESDIR}"/${PN}-2.0.9-hardened.patch
+)
+
+pkg_setup() {
+ # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+ export ASFLAGS="${CCASFLAGS}"
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with booke)
+ $(use_with lzma)
+ $(use_with xen)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-2.0.4-r2 kexec
+ newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
+
+ insinto /etc
+ doins "${FILESDIR}"/kexec.conf
+
+ insinto /etc/kernel/postinst.d
+ doins "${FILESDIR}"/90_kexec
+
+ systemd_dounit "${FILESDIR}"/kexec.service
+}
+
+pkg_postinst() {
+ if systemd_is_booted || has_version sys-apps/systemd; then
+ elog "For systemd support the new config file is"
+ elog " /etc/kexec.conf"
+ elog "Please adopt it to your needs as there is no autoconfig anymore"
+ fi
+}
diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.9-r2.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.9-r2.ebuild
new file mode 100644
index 000000000000..f3610aaa02fa
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.9-r2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils linux-info systemd
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/"
+SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KEXEC"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
+ "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
+ "${FILESDIR}"/${PN}-2.0.9-hardened.patch
+)
+
+pkg_setup() {
+ # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+ export ASFLAGS="${CCASFLAGS}"
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with booke)
+ $(use_with lzma)
+ $(use_with xen)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-2.0.4-r3 kexec
+ newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
+
+ insinto /etc
+ doins "${FILESDIR}"/kexec.conf
+
+ insinto /etc/kernel/postinst.d
+ doins "${FILESDIR}"/90_kexec
+
+ systemd_dounit "${FILESDIR}"/kexec.service
+}
+
+pkg_postinst() {
+ if systemd_is_booted || has_version sys-apps/systemd; then
+ elog "For systemd support the new config file is"
+ elog " /etc/kexec.conf"
+ elog "Please adopt it to your needs as there is no autoconfig anymore"
+ fi
+}
diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.9.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.9.ebuild
new file mode 100644
index 000000000000..6634ef54527f
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-2.0.9.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils flag-o-matic linux-info systemd
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/"
+SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KEXEC"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
+ "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
+)
+
+pkg_setup() {
+ # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+ export ASFLAGS="${CCASFLAGS}"
+ # to disable the -fPIE -pie in the hardened compiler
+ if gcc-specs-pie ; then
+ filter-flags -fPIE
+ append-ldflags -nopie
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with booke)
+ $(use_with lzma)
+ $(use_with xen)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-2.0.4-r2 kexec
+ newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
+
+ insinto /etc
+ doins "${FILESDIR}"/kexec.conf
+
+ insinto /etc/kernel/postinst.d
+ doins "${FILESDIR}"/90_kexec
+
+ systemd_dounit "${FILESDIR}"/kexec.service
+}
+
+pkg_postinst() {
+ if systemd_is_booted || has_version sys-apps/systemd; then
+ elog "For systemd support the new config file is"
+ elog " /etc/kexec.conf"
+ elog "Please adopt it to your needs as there is no autoconfig anymore"
+ fi
+}
diff --git a/sys-apps/kexec-tools/kexec-tools-9999.ebuild b/sys-apps/kexec-tools/kexec-tools-9999.ebuild
new file mode 100644
index 000000000000..4eb6a9c067b5
--- /dev/null
+++ b/sys-apps/kexec-tools/kexec-tools-9999.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=true
+
+inherit autotools-utils linux-info systemd git-r3
+
+DESCRIPTION="Load another kernel from the currently executing Linux kernel"
+HOMEPAGE="http://kernel.org/pub/linux/utils/kernel/kexec/"
+SRC_URI=""
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="booke lzma xen zlib"
+
+REQUIRED_USE="lzma? ( zlib )"
+
+DEPEND="
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+CONFIG_CHECK="~KEXEC"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
+ "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
+ "${FILESDIR}"/${PN}-2.0.9-hardened.patch
+)
+
+pkg_setup() {
+ # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
+ export ASFLAGS="${CCASFLAGS}"
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with booke)
+ $(use_with lzma)
+ $(use_with xen)
+ $(use_with zlib)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodoc "${FILESDIR}"/README.Gentoo
+
+ newinitd "${FILESDIR}"/kexec.init-${PV} kexec
+ newconfd "${FILESDIR}"/kexec.conf-${PV} kexec
+
+ insinto /etc
+ doins "${FILESDIR}"/kexec.conf
+
+ insinto /etc/kernel/postinst.d
+ doins "${FILESDIR}"/90_kexec
+
+ systemd_dounit "${FILESDIR}"/kexec.service
+}
+
+pkg_postinst() {
+ if systemd_is_booted || has_version sys-apps/systemd; then
+ elog "For systemd support the new config file is"
+ elog " /etc/kexec.conf"
+ elog "Please adopt it to your needs as there is no autoconfig anymore"
+ fi
+}
diff --git a/sys-apps/kexec-tools/metadata.xml b/sys-apps/kexec-tools/metadata.xml
new file mode 100644
index 000000000000..1443e322b1a8
--- /dev/null
+++ b/sys-apps/kexec-tools/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>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="lzma">Enables support for LZMA compressed kernel images</flag>
+ <flag name="booke">Include support for Book-E memory management</flag>
+ <flag name="xen">Enable extended xen support</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/keyutils/Manifest b/sys-apps/keyutils/Manifest
new file mode 100644
index 000000000000..f984f80c3e31
--- /dev/null
+++ b/sys-apps/keyutils/Manifest
@@ -0,0 +1,3 @@
+DIST keyutils-1.5.5.tar.bz2 63397 SHA256 8fab781fb2d1450b2112a7fbfe6629522ae5a6b901f875a74a201012025a3fc5 SHA512 372a4881ca5cd679de0e6baa4e0e8c61ec8163b9259b018e1eb4db51fca68c0326d82a745abce96d22de367e88c88fa13b8afe438acfb38af799893630d3ba75 WHIRLPOOL 15c03983e18471b97e10f378d97c6e7e9ac7045c1f4721382f500cd8796f4a55575420b515b870ef94714bfb3dc62cb954e66efb2835fcb671c98d2f9ab33ae9
+DIST keyutils-1.5.8.tar.bz2 64880 SHA256 6c7da37272eb39abc2ebafc9ba4a580d7cf8725b61e1db21e508de7ab24b819c SHA512 f69b1acd3bff2a821ce31c6a772eea68dfbe57bb1d6128fa344ab9688c9110733b1432176e42b67648ff3a01200f4adbb92e4577132539b4c4af817027ed8f19 WHIRLPOOL e4c8d18c8ea48346a759f0e379a2bb3e6faf30f9c4a4b794485a612e25bbe86a81833e68e28b2def668faa4ff41d476ed5a6cbf105ef76bb31a02169b879f9b6
+DIST keyutils-1.5.9.tar.bz2 74683 SHA256 4da2c5552c688b65ab14d4fd40fbdf720c8b396d8ece643e040cf6e707e083ae SHA512 d4ee1dabb87844e18bfd8d094a5bc9ce792c96720b71e77961b6c36bb1addb9acea2a7004ddfba1d09b167af908368162312e5c3656b22a6266955bb57b887e2 WHIRLPOOL 0509cce076a32d2f319f596506d4aaeb83e1853ee6337e6a3041e6957e9098f4482ae56a9c6455605b72b3f34701a890e9be666b6fdd752ff14a3d3564dcba19
diff --git a/sys-apps/keyutils/files/keyutils-1.5.5-makefile-fixup.patch b/sys-apps/keyutils/files/keyutils-1.5.5-makefile-fixup.patch
new file mode 100644
index 000000000000..ff4bcfa94d85
--- /dev/null
+++ b/sys-apps/keyutils/files/keyutils-1.5.5-makefile-fixup.patch
@@ -0,0 +1,27 @@
+Raw patch edit based on:
+
+From af14e945bd617bb82ebc4c6c8d4fb948d715f16a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 2 Sep 2011 13:30:30 -0400
+Subject: [PATCH] depend on $(DEVELLIB) not -lkeyutils
+
+---
+ Makefile | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 9e3fa9b..46695d1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -91,7 +91,7 @@
+ $(INSTALL) -D $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME)
+ $(LNS) $(LIBNAME) $(DESTDIR)$(LIBDIR)/$(SONAME)
+ mkdir -p $(DESTDIR)$(USRLIBDIR)
+- $(LNS) $(LIBDIR)/$(SONAME) $(DESTDIR)$(USRLIBDIR)/$(DEVELLIB)
++ $(LNS) $(SONAME) $(DESTDIR)$(LIBDIR)/$(DEVELLIB)
+ $(INSTALL) -D keyctl $(DESTDIR)$(BINDIR)/keyctl
+ $(INSTALL) -D request-key $(DESTDIR)$(SBINDIR)/request-key
+ $(INSTALL) -D request-key-debug.sh $(DESTDIR)$(SHAREDIR)/request-key-debug.sh
+--
+1.7.6
+
diff --git a/sys-apps/keyutils/keyutils-1.5.5.ebuild b/sys-apps/keyutils/keyutils-1.5.5.ebuild
new file mode 100644
index 000000000000..66bdb4d6158e
--- /dev/null
+++ b/sys-apps/keyutils/keyutils-1.5.5.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit multilib eutils toolchain-funcs linux-info
+
+DESCRIPTION="Linux Key Management Utilities"
+HOMEPAGE="http://people.redhat.com/dhowells/keyutils/"
+SRC_URI="http://people.redhat.com/dhowells/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="test"
+
+DEPEND="!prefix? ( >=sys-kernel/linux-headers-2.6.11 )"
+
+pkg_setup() {
+ CONFIG_CHECK="~KEYS"
+ use test && CONFIG_CHECK="${CONFIG_CHECK} ~KEYS_DEBUG_PROC_KEYS"
+ ERROR_KEYS="You must have CONFIG_KEYS to use this package!"
+ ERROR_KEYS_DEBUG_PROC_KEYS="You must have CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.5-makefile-fixup.patch
+ sed -i \
+ -e '1iRPATH=' \
+ -e '/^C.*FLAGS/s|:=|+=|' \
+ -e 's:-Werror::' \
+ -e '/^BUILDFOR/s:=.*:=:' \
+ -e "/^LIBDIR/s:=.*:=/usr/$(get_libdir):" \
+ -e '/^USRLIBDIR/s:=.*:=$(LIBDIR):' \
+ Makefile || die
+
+ # The lsb check is useless, so avoid spurious command not found messages.
+ sed -i -e 's,lsb_release,:,' tests/prepare.inc.sh || die
+ # All the test files are bash, but try to execute via `sh`.
+ sed -i -r \
+ -e 's:([[:space:]])sh([[:space:]]):\1bash\2:' \
+ tests/{Makefile*,*.sh} || die
+ find tests/ -name '*.sh' -exec sed -i '1s:/sh$:/bash:' {} +
+ # Some tests call the kernel which calls userspace, but that will
+ # run the install keyutils rather than the locally compiled one,
+ # so disable round trip tests.
+ rm -rf tests/keyctl/requesting/{bad-args,piped,valid}
+}
+
+src_configure() {
+ tc-export CC
+ tc-export AR
+}
+
+src_test() {
+ # Execute the locally compiled code rather than the
+ # older versions already installed in the system.
+ LD_LIBRARY_PATH=${S} \
+ PATH="${S}:${PATH}" \
+ emake test || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README
+ gen_usr_ldscript -a keyutils
+}
diff --git a/sys-apps/keyutils/keyutils-1.5.8.ebuild b/sys-apps/keyutils/keyutils-1.5.8.ebuild
new file mode 100644
index 000000000000..da9bf6a95591
--- /dev/null
+++ b/sys-apps/keyutils/keyutils-1.5.8.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit multilib eutils toolchain-funcs linux-info
+
+DESCRIPTION="Linux Key Management Utilities"
+HOMEPAGE="http://people.redhat.com/dhowells/keyutils/"
+SRC_URI="http://people.redhat.com/dhowells/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="test"
+
+DEPEND="!prefix? ( >=sys-kernel/linux-headers-2.6.11 )"
+
+pkg_setup() {
+ CONFIG_CHECK="~KEYS"
+ use test && CONFIG_CHECK="${CONFIG_CHECK} ~KEYS_DEBUG_PROC_KEYS"
+ ERROR_KEYS="You must have CONFIG_KEYS to use this package!"
+ ERROR_KEYS_DEBUG_PROC_KEYS="You must have CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.5-makefile-fixup.patch
+ sed -i \
+ -e '1iRPATH=' \
+ -e '/^C.*FLAGS/s|:=|+=|' \
+ -e 's:-Werror::' \
+ -e '/^BUILDFOR/s:=.*:=:' \
+ -e "/^LIBDIR/s:=.*:=/usr/$(get_libdir):" \
+ -e '/^USRLIBDIR/s:=.*:=$(LIBDIR):' \
+ Makefile || die
+
+ # The lsb check is useless, so avoid spurious command not found messages.
+ sed -i -e 's,lsb_release,:,' tests/prepare.inc.sh || die
+ # All the test files are bash, but try to execute via `sh`.
+ sed -i -r \
+ -e 's:([[:space:]])sh([[:space:]]):\1bash\2:' \
+ tests/{Makefile*,*.sh} || die
+ find tests/ -name '*.sh' -exec sed -i '1s:/sh$:/bash:' {} +
+ # Some tests call the kernel which calls userspace, but that will
+ # run the install keyutils rather than the locally compiled one,
+ # so disable round trip tests.
+ rm -rf tests/keyctl/requesting/{bad-args,piped,valid}
+}
+
+src_configure() {
+ tc-export CC
+ tc-export AR
+}
+
+src_test() {
+ # Execute the locally compiled code rather than the
+ # older versions already installed in the system.
+ LD_LIBRARY_PATH=${S} \
+ PATH="${S}:${PATH}" \
+ emake test || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README
+ gen_usr_ldscript -a keyutils
+}
diff --git a/sys-apps/keyutils/keyutils-1.5.9-r1.ebuild b/sys-apps/keyutils/keyutils-1.5.9-r1.ebuild
new file mode 100644
index 000000000000..7c724a7ad5b2
--- /dev/null
+++ b/sys-apps/keyutils/keyutils-1.5.9-r1.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 multilib eutils toolchain-funcs linux-info multilib-minimal
+
+DESCRIPTION="Linux Key Management Utilities"
+HOMEPAGE="http://people.redhat.com/dhowells/keyutils/"
+SRC_URI="http://people.redhat.com/dhowells/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="test"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r1
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="!prefix? ( >=sys-kernel/linux-headers-2.6.11 )"
+
+pkg_setup() {
+ CONFIG_CHECK="~KEYS"
+ use test && CONFIG_CHECK="${CONFIG_CHECK} ~KEYS_DEBUG_PROC_KEYS"
+ ERROR_KEYS="You must have CONFIG_KEYS to use this package!"
+ ERROR_KEYS_DEBUG_PROC_KEYS="You must have CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.5-makefile-fixup.patch
+
+ # The lsb check is useless, so avoid spurious command not found messages.
+ sed -i -e 's,lsb_release,:,' tests/prepare.inc.sh || die
+ # All the test files are bash, but try to execute via `sh`.
+ sed -i -r \
+ -e 's:([[:space:]])sh([[:space:]]):\1bash\2:' \
+ tests/{Makefile*,*.sh} || die
+ find tests/ -name '*.sh' -exec sed -i '1s:/sh$:/bash:' {} +
+ # Some tests call the kernel which calls userspace, but that will
+ # run the install keyutils rather than the locally compiled one,
+ # so disable round trip tests.
+ rm -rf tests/keyctl/requesting/{bad-args,piped,valid}
+
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ tc-export CC
+ tc-export AR
+ sed -i \
+ -e '1iRPATH=' \
+ -e '/^C.*FLAGS/s|:=|+=|' \
+ -e 's:-Werror::' \
+ -e '/^BUILDFOR/s:=.*:=:' \
+ -e "/^LIBDIR/s:=.*:= /usr/$(get_libdir):" \
+ -e '/^USRLIBDIR/s:=.*:=$(LIBDIR):' \
+ -e "s: /: ${EPREFIX}/:g" \
+ Makefile || die
+
+ emake
+}
+
+multilib_src_test() {
+ # Execute the locally compiled code rather than the
+ # older versions already installed in the system.
+ LD_LIBRARY_PATH=${BUILD_DIR} \
+ PATH="${BUILD_DIR}:${PATH}" \
+ emake test
+}
+
+multilib_src_install() {
+ default
+ multilib_is_native_abi && gen_usr_ldscript -a keyutils
+}
+
+multilib_src_install_all() {
+ dodoc README
+}
diff --git a/sys-apps/keyutils/keyutils-1.5.9.ebuild b/sys-apps/keyutils/keyutils-1.5.9.ebuild
new file mode 100644
index 000000000000..be9ffa1da549
--- /dev/null
+++ b/sys-apps/keyutils/keyutils-1.5.9.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit multilib eutils toolchain-funcs linux-info
+
+DESCRIPTION="Linux Key Management Utilities"
+HOMEPAGE="http://people.redhat.com/dhowells/keyutils/"
+SRC_URI="http://people.redhat.com/dhowells/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="test"
+
+DEPEND="!prefix? ( >=sys-kernel/linux-headers-2.6.11 )"
+
+pkg_setup() {
+ CONFIG_CHECK="~KEYS"
+ use test && CONFIG_CHECK="${CONFIG_CHECK} ~KEYS_DEBUG_PROC_KEYS"
+ ERROR_KEYS="You must have CONFIG_KEYS to use this package!"
+ ERROR_KEYS_DEBUG_PROC_KEYS="You must have CONFIG_KEYS_DEBUG_PROC_KEYS to run the package testsuite!"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.5.5-makefile-fixup.patch
+ sed -i \
+ -e '1iRPATH=' \
+ -e '/^C.*FLAGS/s|:=|+=|' \
+ -e 's:-Werror::' \
+ -e '/^BUILDFOR/s:=.*:=:' \
+ -e "/^LIBDIR/s:=.*:=/usr/$(get_libdir):" \
+ -e '/^USRLIBDIR/s:=.*:=$(LIBDIR):' \
+ Makefile || die
+
+ # The lsb check is useless, so avoid spurious command not found messages.
+ sed -i -e 's,lsb_release,:,' tests/prepare.inc.sh || die
+ # All the test files are bash, but try to execute via `sh`.
+ sed -i -r \
+ -e 's:([[:space:]])sh([[:space:]]):\1bash\2:' \
+ tests/{Makefile*,*.sh} || die
+ find tests/ -name '*.sh' -exec sed -i '1s:/sh$:/bash:' {} +
+ # Some tests call the kernel which calls userspace, but that will
+ # run the install keyutils rather than the locally compiled one,
+ # so disable round trip tests.
+ rm -rf tests/keyctl/requesting/{bad-args,piped,valid}
+}
+
+src_configure() {
+ tc-export CC
+ tc-export AR
+}
+
+src_test() {
+ # Execute the locally compiled code rather than the
+ # older versions already installed in the system.
+ LD_LIBRARY_PATH=${S} \
+ PATH="${S}:${PATH}" \
+ emake test
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ dodoc README
+ gen_usr_ldscript -a keyutils
+}
diff --git a/sys-apps/keyutils/metadata.xml b/sys-apps/keyutils/metadata.xml
new file mode 100644
index 000000000000..5f280f821abc
--- /dev/null
+++ b/sys-apps/keyutils/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>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/kmod/Manifest b/sys-apps/kmod/Manifest
new file mode 100644
index 000000000000..7421ceb3810c
--- /dev/null
+++ b/sys-apps/kmod/Manifest
@@ -0,0 +1,2 @@
+DIST kmod-20.tar.xz 437880 SHA256 89c1a1a2193c31f9ebe582640bfa2bd401341dc24119f5a7f702588116fadaa0 SHA512 1026d80486e6c823fc74a439d15a8b1e4a501140f67568165904b43a73130133d6c84075ec8a7981a5d4a187d5fbd21afd197de4e81cc05a66506711865edf96 WHIRLPOOL 938d1ea4d153c04231b89701c7a7f602d31166e5c85bb6f2798ba0a7c22a4961f05bdd8631d985785212e5bf359d1cd12c4088fd9c2a07d8b6b9a77599e84a39
+DIST kmod-21.tar.xz 446460 SHA256 160a9448af74cf75b08d089f37a3e8d1fafa75cce92d1cbe869a753b670d95c0 SHA512 93d9c7eda3a04ed94c6531087614d92b5a65a2e642bd3af017a3a8a458a78a5a57acb1707e35bf3a0aa8f22ab0fa99d34cf4e7dd568f202a18eb49fb52bf78c1 WHIRLPOOL 78aa8c086ed8129b3a686f3b7d46e224c09f018fc85cda041bfac253afa8056e3e403eedbedb81be4c2354075040dcb6a526c2295cc3b393a76cb3896491cea3
diff --git a/sys-apps/kmod/files/kmod-static-nodes-r1 b/sys-apps/kmod/files/kmod-static-nodes-r1
new file mode 100644
index 000000000000..379cbb13c385
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-static-nodes-r1
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Create list of required static device nodes for the current kernel"
+
+depend() {
+ after dev-mount
+ before tmpfiles.dev dev
+ keyword -lxc -systemd-nspawn
+}
+
+start() {
+ ebegin "Creating list of required static device nodes for the current kernel"
+ checkpath -q -d /run/tmpfiles.d
+ kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
+ eend $?
+}
diff --git a/sys-apps/kmod/kmod-20.ebuild b/sys-apps/kmod/kmod-20.ebuild
new file mode 100644
index 000000000000..d1d03d1154b0
--- /dev/null
+++ b/sys-apps/kmod/kmod-20.ebuild
@@ -0,0 +1,190 @@
+# 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 bash-completion-r1 eutils multilib python-r1
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
+ inherit autotools git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/kernel/kmod/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+ inherit libtool
+fi
+
+DESCRIPTION="library and tools for managing linux kernel modules"
+HOMEPAGE="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug doc lzma python static-libs +tools zlib"
+
+# Upstream does not support running the test suite with custom configure flags.
+# I was also told that the test suite is intended for kmod developers.
+# So we have to restrict it.
+# See bug #408915.
+RESTRICT="test"
+
+# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
+RDEPEND="!sys-apps/module-init-tools
+ !sys-apps/modutils
+ !<sys-apps/openrc-0.13.8
+ !<sys-apps/systemd-216-r3
+ lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
+ python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
+DEPEND="${RDEPEND}
+ doc? ( dev-util/gtk-doc )
+ lzma? ( virtual/pkgconfig )
+ python? (
+ dev-python/cython[${PYTHON_USEDEP}]
+ virtual/pkgconfig
+ )
+ zlib? ( virtual/pkgconfig )"
+if [[ ${PV} == 9999* ]]; then
+ DEPEND="${DEPEND}
+ dev-libs/libxslt"
+fi
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DOCS="NEWS README TODO"
+
+src_prepare() {
+ if [ ! -e configure ]; then
+ if use doc; then
+ gtkdocize --copy --docdir libkmod/docs || die
+ else
+ touch libkmod/docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
+ configure || die
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --with-rootlibdir="${EPREFIX}/$(get_libdir)"
+ --enable-shared
+ $(use_enable static-libs static)
+ $(use_enable tools)
+ $(use_enable debug)
+ $(use_enable doc gtk-doc)
+ $(use_with lzma xz)
+ $(use_with zlib)
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ )
+
+ local ECONF_SOURCE="${S}"
+
+ kmod_configure() {
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir econf "${myeconfargs[@]}" "$@"
+ }
+
+ BUILD_DIR="${WORKDIR}/build"
+ kmod_configure --disable-python
+
+ if use python; then
+ python_parallel_foreach_impl kmod_configure --enable-python
+ fi
+}
+
+src_compile() {
+ emake -C "${BUILD_DIR}"
+
+ if use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_compile() {
+ emake -C "${BUILD_DIR}" -f Makefile -f - python \
+ VPATH="${native_builddir}:${S}" \
+ native_builddir="${native_builddir}" \
+ libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
+ <<< 'python: $(pkgpyexec_LTLIBRARIES)'
+ }
+
+ python_foreach_impl python_compile
+ fi
+}
+
+src_install() {
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" install
+ einstalldocs
+
+ if use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_install() {
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" \
+ VPATH="${native_builddir}:${S}" \
+ install-pkgpyexecLTLIBRARIES \
+ install-dist_pkgpyexecPYTHON
+ }
+
+ python_foreach_impl python_install
+ fi
+
+ prune_libtool_files --modules
+
+ if use tools; then
+ local bincmd sbincmd
+ for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do
+ dosym /bin/kmod /sbin/${sbincmd}
+ done
+
+ # These are also usable as normal user
+ for bincmd in lsmod modinfo; do
+ dosym kmod /bin/${bincmd}
+ done
+ fi
+
+ cat <<-EOF > "${T}"/usb-load-ehci-first.conf
+ softdep uhci_hcd pre: ehci_hcd
+ softdep ohci_hcd pre: ehci_hcd
+ EOF
+
+ insinto /lib/modprobe.d
+ doins "${T}"/usb-load-ehci-first.conf #260139
+
+ newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
+}
+
+pkg_postinst() {
+ if [[ -L ${EROOT%/}/etc/runlevels/boot/static-nodes ]]; then
+ ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
+ rm -f "${EROOT%/}"/etc/runlevels/boot/static-nodes
+ fi
+
+ # Add kmod to the runlevel automatically if this is the first install of this package.
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
+ mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
+ fi
+ if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
+ ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
+ fi
+ fi
+
+ if [[ -e ${EROOT%/}/etc/runlevels/sysinit ]]; then
+ if [[ ! -e ${EROOT%/}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
+ ewarn
+ ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
+ ewarn "kernel modules to have required static nodes!"
+ ewarn "Run this command:"
+ ewarn "\trc-update add kmod-static-nodes sysinit"
+ fi
+ fi
+}
diff --git a/sys-apps/kmod/kmod-21.ebuild b/sys-apps/kmod/kmod-21.ebuild
new file mode 100644
index 000000000000..7a52239032e1
--- /dev/null
+++ b/sys-apps/kmod/kmod-21.ebuild
@@ -0,0 +1,190 @@
+# 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 bash-completion-r1 eutils multilib python-r1
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
+ inherit autotools git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/kernel/kmod/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ inherit libtool
+fi
+
+DESCRIPTION="library and tools for managing linux kernel modules"
+HOMEPAGE="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug doc lzma python static-libs +tools zlib"
+
+# Upstream does not support running the test suite with custom configure flags.
+# I was also told that the test suite is intended for kmod developers.
+# So we have to restrict it.
+# See bug #408915.
+RESTRICT="test"
+
+# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
+RDEPEND="!sys-apps/module-init-tools
+ !sys-apps/modutils
+ !<sys-apps/openrc-0.13.8
+ !<sys-apps/systemd-216-r3
+ lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
+ python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
+DEPEND="${RDEPEND}
+ doc? ( dev-util/gtk-doc )
+ lzma? ( virtual/pkgconfig )
+ python? (
+ dev-python/cython[${PYTHON_USEDEP}]
+ virtual/pkgconfig
+ )
+ zlib? ( virtual/pkgconfig )"
+if [[ ${PV} == 9999* ]]; then
+ DEPEND="${DEPEND}
+ dev-libs/libxslt"
+fi
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DOCS="NEWS README TODO"
+
+src_prepare() {
+ if [ ! -e configure ]; then
+ if use doc; then
+ gtkdocize --copy --docdir libkmod/docs || die
+ else
+ touch libkmod/docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
+ configure || die
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --with-rootlibdir="${EPREFIX}/$(get_libdir)"
+ --enable-shared
+ $(use_enable static-libs static)
+ $(use_enable tools)
+ $(use_enable debug)
+ $(use_enable doc gtk-doc)
+ $(use_with lzma xz)
+ $(use_with zlib)
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ )
+
+ local ECONF_SOURCE="${S}"
+
+ kmod_configure() {
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir econf "${myeconfargs[@]}" "$@"
+ }
+
+ BUILD_DIR="${WORKDIR}/build"
+ kmod_configure --disable-python
+
+ if use python; then
+ python_parallel_foreach_impl kmod_configure --enable-python
+ fi
+}
+
+src_compile() {
+ emake -C "${BUILD_DIR}"
+
+ if use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_compile() {
+ emake -C "${BUILD_DIR}" -f Makefile -f - python \
+ VPATH="${native_builddir}:${S}" \
+ native_builddir="${native_builddir}" \
+ libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
+ <<< 'python: $(pkgpyexec_LTLIBRARIES)'
+ }
+
+ python_foreach_impl python_compile
+ fi
+}
+
+src_install() {
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" install
+ einstalldocs
+
+ if use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_install() {
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" \
+ VPATH="${native_builddir}:${S}" \
+ install-pkgpyexecLTLIBRARIES \
+ install-dist_pkgpyexecPYTHON
+ }
+
+ python_foreach_impl python_install
+ fi
+
+ prune_libtool_files --modules
+
+ if use tools; then
+ local bincmd sbincmd
+ for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do
+ dosym /bin/kmod /sbin/${sbincmd}
+ done
+
+ # These are also usable as normal user
+ for bincmd in lsmod modinfo; do
+ dosym kmod /bin/${bincmd}
+ done
+ fi
+
+ cat <<-EOF > "${T}"/usb-load-ehci-first.conf
+ softdep uhci_hcd pre: ehci_hcd
+ softdep ohci_hcd pre: ehci_hcd
+ EOF
+
+ insinto /lib/modprobe.d
+ doins "${T}"/usb-load-ehci-first.conf #260139
+
+ newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
+}
+
+pkg_postinst() {
+ if [[ -L ${EROOT%/}/etc/runlevels/boot/static-nodes ]]; then
+ ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
+ rm -f "${EROOT%/}"/etc/runlevels/boot/static-nodes
+ fi
+
+ # Add kmod to the runlevel automatically if this is the first install of this package.
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
+ mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
+ fi
+ if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
+ ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
+ fi
+ fi
+
+ if [[ -e ${EROOT%/}/etc/runlevels/sysinit ]]; then
+ if [[ ! -e ${EROOT%/}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
+ ewarn
+ ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
+ ewarn "kernel modules to have required static nodes!"
+ ewarn "Run this command:"
+ ewarn "\trc-update add kmod-static-nodes sysinit"
+ fi
+ fi
+}
diff --git a/sys-apps/kmod/kmod-9999.ebuild b/sys-apps/kmod/kmod-9999.ebuild
new file mode 100644
index 000000000000..7a52239032e1
--- /dev/null
+++ b/sys-apps/kmod/kmod-9999.ebuild
@@ -0,0 +1,190 @@
+# 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 bash-completion-r1 eutils multilib python-r1
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
+ inherit autotools git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/kernel/kmod/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ inherit libtool
+fi
+
+DESCRIPTION="library and tools for managing linux kernel modules"
+HOMEPAGE="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
+
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="debug doc lzma python static-libs +tools zlib"
+
+# Upstream does not support running the test suite with custom configure flags.
+# I was also told that the test suite is intended for kmod developers.
+# So we have to restrict it.
+# See bug #408915.
+RESTRICT="test"
+
+# Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
+RDEPEND="!sys-apps/module-init-tools
+ !sys-apps/modutils
+ !<sys-apps/openrc-0.13.8
+ !<sys-apps/systemd-216-r3
+ lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
+ python? ( ${PYTHON_DEPS} )
+ zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
+DEPEND="${RDEPEND}
+ doc? ( dev-util/gtk-doc )
+ lzma? ( virtual/pkgconfig )
+ python? (
+ dev-python/cython[${PYTHON_USEDEP}]
+ virtual/pkgconfig
+ )
+ zlib? ( virtual/pkgconfig )"
+if [[ ${PV} == 9999* ]]; then
+ DEPEND="${DEPEND}
+ dev-libs/libxslt"
+fi
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+DOCS="NEWS README TODO"
+
+src_prepare() {
+ if [ ! -e configure ]; then
+ if use doc; then
+ gtkdocize --copy --docdir libkmod/docs || die
+ else
+ touch libkmod/docs/gtk-doc.make
+ fi
+ eautoreconf
+ else
+ elibtoolize
+ fi
+
+ # Restore possibility of running --enable-static wrt #472608
+ sed -i \
+ -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
+ configure || die
+}
+
+src_configure() {
+ local myeconfargs=(
+ --bindir="${EPREFIX}/bin"
+ --with-rootlibdir="${EPREFIX}/$(get_libdir)"
+ --enable-shared
+ $(use_enable static-libs static)
+ $(use_enable tools)
+ $(use_enable debug)
+ $(use_enable doc gtk-doc)
+ $(use_with lzma xz)
+ $(use_with zlib)
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ )
+
+ local ECONF_SOURCE="${S}"
+
+ kmod_configure() {
+ mkdir -p "${BUILD_DIR}" || die
+ run_in_build_dir econf "${myeconfargs[@]}" "$@"
+ }
+
+ BUILD_DIR="${WORKDIR}/build"
+ kmod_configure --disable-python
+
+ if use python; then
+ python_parallel_foreach_impl kmod_configure --enable-python
+ fi
+}
+
+src_compile() {
+ emake -C "${BUILD_DIR}"
+
+ if use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_compile() {
+ emake -C "${BUILD_DIR}" -f Makefile -f - python \
+ VPATH="${native_builddir}:${S}" \
+ native_builddir="${native_builddir}" \
+ libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
+ <<< 'python: $(pkgpyexec_LTLIBRARIES)'
+ }
+
+ python_foreach_impl python_compile
+ fi
+}
+
+src_install() {
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" install
+ einstalldocs
+
+ if use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_install() {
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" \
+ VPATH="${native_builddir}:${S}" \
+ install-pkgpyexecLTLIBRARIES \
+ install-dist_pkgpyexecPYTHON
+ }
+
+ python_foreach_impl python_install
+ fi
+
+ prune_libtool_files --modules
+
+ if use tools; then
+ local bincmd sbincmd
+ for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do
+ dosym /bin/kmod /sbin/${sbincmd}
+ done
+
+ # These are also usable as normal user
+ for bincmd in lsmod modinfo; do
+ dosym kmod /bin/${bincmd}
+ done
+ fi
+
+ cat <<-EOF > "${T}"/usb-load-ehci-first.conf
+ softdep uhci_hcd pre: ehci_hcd
+ softdep ohci_hcd pre: ehci_hcd
+ EOF
+
+ insinto /lib/modprobe.d
+ doins "${T}"/usb-load-ehci-first.conf #260139
+
+ newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
+}
+
+pkg_postinst() {
+ if [[ -L ${EROOT%/}/etc/runlevels/boot/static-nodes ]]; then
+ ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
+ rm -f "${EROOT%/}"/etc/runlevels/boot/static-nodes
+ fi
+
+ # Add kmod to the runlevel automatically if this is the first install of this package.
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
+ mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
+ fi
+ if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
+ ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
+ fi
+ fi
+
+ if [[ -e ${EROOT%/}/etc/runlevels/sysinit ]]; then
+ if [[ ! -e ${EROOT%/}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
+ ewarn
+ ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
+ ewarn "kernel modules to have required static nodes!"
+ ewarn "Run this command:"
+ ewarn "\trc-update add kmod-static-nodes sysinit"
+ fi
+ fi
+}
diff --git a/sys-apps/kmod/metadata.xml b/sys-apps/kmod/metadata.xml
new file mode 100644
index 000000000000..f2fc4f7f085f
--- /dev/null
+++ b/sys-apps/kmod/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>udev-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='lzma'>Enable support for XZ compressed modules</flag>
+ <flag name='tools'>Install module loading/unloading tools.</flag>
+ <flag name='zlib'>Enable support for gzipped modules</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/lcdsplash/Manifest b/sys-apps/lcdsplash/Manifest
new file mode 100644
index 000000000000..64f457a1ba9c
--- /dev/null
+++ b/sys-apps/lcdsplash/Manifest
@@ -0,0 +1 @@
+DIST lcdsplash-0.3.tar.bz2 8121 RMD160 35f0f071f9893c83e5b95948641f9288e0295e61 SHA1 ac44d851fbaef55230db2e6aee688954292396ca SHA256 0d5db8b897fa6508bbebf7dcc12a5afdf3f48178d72a247d3d8b611c68645c9c
diff --git a/sys-apps/lcdsplash/lcdsplash-0.3.ebuild b/sys-apps/lcdsplash/lcdsplash-0.3.ebuild
new file mode 100644
index 000000000000..1c293fc8c419
--- /dev/null
+++ b/sys-apps/lcdsplash/lcdsplash-0.3.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit multilib
+
+DESCRIPTION="splash Gentoo boot information on LCD's"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="hppa ~mips x86"
+IUSE=""
+
+DEPEND="mips? ( sys-apps/lcdutils )"
+
+S=${WORKDIR}/${PN}
+
+src_install() {
+ insinto /sbin
+ doins splash-functions.sh || die "splash"
+ insinto /$(get_libdir)/rcscripts/lcdsplash
+ doins -r modules/* || die "modules"
+
+ insinto /etc
+ doins lcdsplash.conf || die "conf"
+
+ dodoc README
+}
diff --git a/sys-apps/lcdsplash/metadata.xml b/sys-apps/lcdsplash/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/lcdsplash/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-apps/lcdtest/Manifest b/sys-apps/lcdtest/Manifest
new file mode 100644
index 000000000000..1c98bfd6f1a7
--- /dev/null
+++ b/sys-apps/lcdtest/Manifest
@@ -0,0 +1 @@
+DIST lcdtest-1.18.tar.gz 26886 SHA256 f0b3fa9c5a4bc86eb2713f85f422d328a673ca8f541a6403bfe156afd631200e SHA512 74b0739c5dcc5ff9307ca526b4a6bbd92d6e58a83ceeed5a37a4064e3e4ed0cbdfe7a2a70cd56ba1a7305c3fd72510e10a02098aab11828062a3999cac944ab7 WHIRLPOOL 96abd5864323c45aa2ee6927f96c7f9e401a0007dd6361ffbc14d6609ff75cc55ec2ec93782c732aca6aade645dd3ee94ec49996bf88975fa6bd82fe6106e120
diff --git a/sys-apps/lcdtest/files/1.18-build-system.patch b/sys-apps/lcdtest/files/1.18-build-system.patch
new file mode 100644
index 000000000000..429067259c54
--- /dev/null
+++ b/sys-apps/lcdtest/files/1.18-build-system.patch
@@ -0,0 +1,62 @@
+diff -uNr lcdtest-1.18.ORIG/SConstruct lcdtest-1.18/SConstruct
+--- lcdtest-1.18.ORIG/SConstruct 2013-04-17 14:32:37.735358663 +0100
++++ lcdtest-1.18/SConstruct 2013-04-17 14:33:52.706359788 +0100
+@@ -119,10 +119,10 @@
+ # code
+ #-----------------------------------------------------------------------------
+
+-build_dir = 'build/'
++variant_dir = 'build/'
+
+ SConscript ('src/SConscript',
+- build_dir = build_dir,
++ variant_dir = variant_dir,
+ duplicate = 0,
+ exports = {'env' : env})
+
+@@ -137,7 +137,7 @@
+ #-----------------------------------------------------------------------------
+
+ SConscript ('desktop/SConscript',
+- build_dir = build_dir + '/desktop',
++ variant_dir = variant_dir + '/desktop',
+ duplicate = 0)
+
+ #-----------------------------------------------------------------------------
+diff -uNr lcdtest-1.18.ORIG/src/SConscript lcdtest-1.18/src/SConscript
+--- lcdtest-1.18.ORIG/src/SConscript 2013-04-17 14:32:37.734358663 +0100
++++ lcdtest-1.18/src/SConscript 2013-04-17 14:32:54.194358910 +0100
+@@ -17,6 +17,7 @@
+ # along with this program. If not, see see <http://www.gnu.org/licenses/>.
+
+ import os
++import SCons.Util
+
+ Import('env')
+
+@@ -29,13 +30,18 @@
+
+ objs = [env.Object(src) for src in srcs]
+
+-# respect the environment CFLAGS if given
+-if 'CFLAGS' in ARGUMENTS:
+- env.MergeFlags (ARGUMENTS ['CFLAGS'])
+-elif 'CFLAGS' in os.environ:
+- env.MergeFlags (os.environ ['CFLAGS'])
+-else:
+- env.Append (CCFLAGS = ['-g', '-Wall', '-Wextra'])
++# respect the environments flags if given
++
++if os.environ.has_key('CC'):
++ env['CC'] = os.environ['CC']
++if os.environ.has_key('CFLAGS'):
++ env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
++if os.environ.has_key('CXX'):
++ env['CXX'] = os.environ['CXX']
++if os.environ.has_key('CXXFLAGS'):
++ env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
++if os.environ.has_key('LDFLAGS'):
++ env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
+
+ env.Append (LIBS = ['SDL', 'SDL_image', 'SDL_ttf']);
+
diff --git a/sys-apps/lcdtest/lcdtest-1.18.ebuild b/sys-apps/lcdtest/lcdtest-1.18.ebuild
new file mode 100644
index 000000000000..fbf054bee2be
--- /dev/null
+++ b/sys-apps/lcdtest/lcdtest-1.18.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 scons-utils eutils toolchain-funcs gnome2-utils
+
+DESCRIPTION="Displays test patterns to spot dead/hot pixels on LCD screens"
+HOMEPAGE="http://www.brouhaha.com/~eric/software/lcdtest/"
+SRC_URI="http://www.brouhaha.com/~eric/software/lcdtest/download/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ >=media-libs/libsdl-1.2.7-r2[X,video]
+ >=media-libs/sdl-image-1.2.3-r1
+ >=media-libs/sdl-ttf-2.0.9
+"
+RDEPEND="${DEPEND}
+ media-fonts/liberation-fonts
+"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV}-build-system.patch"
+ epatch_user
+ sed -i -e \
+ "s|/usr/share/fonts/liberation/|/usr/share/fonts/liberation-fonts/|" \
+ src/lcdtest.c || die
+}
+
+src_configure() {
+ tc-export CC
+ myesconsargs=(
+ --prefix="${EPREFIX}/usr"
+ )
+}
+
+src_compile() {
+ escons
+}
+
+src_install() {
+ escons --buildroot="${D}" install
+ dodoc README
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-apps/lcdtest/metadata.xml b/sys-apps/lcdtest/metadata.xml
new file mode 100644
index 000000000000..63248665e28f
--- /dev/null
+++ b/sys-apps/lcdtest/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>base-system</herd>
+<herd>proxy-maintainers</herd>
+<maintainer>
+ <email>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+</maintainer>
+<maintainer>
+ <email>nikoli@gmx.us</email>
+ <name>Nikoli</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/lcdutils/Manifest b/sys-apps/lcdutils/Manifest
new file mode 100644
index 000000000000..0da28332cf3b
--- /dev/null
+++ b/sys-apps/lcdutils/Manifest
@@ -0,0 +1 @@
+DIST lcdutils-0.2.tar.gz 10819 RMD160 6b746cb6616875340054017154400e50b7a423cb SHA1 fb516d07fb868de5642a0aa4696fdeffc6fe480f SHA256 fae6efe705f18fa5cf0b0ecb41ec8d3e009db18d9fcda838e23a1f455d3f2f58
diff --git a/sys-apps/lcdutils/files/include-stdlib.h-for-exit.patch b/sys-apps/lcdutils/files/include-stdlib.h-for-exit.patch
new file mode 100644
index 000000000000..81870496a529
--- /dev/null
+++ b/sys-apps/lcdutils/files/include-stdlib.h-for-exit.patch
@@ -0,0 +1,50 @@
+From 304013f4c81a13fa2aa3a06628e6a1c57248563c Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 13 Jun 2011 23:42:44 -0400
+Subject: [PATCH] include stdlib.h for exit
+
+---
+ buttond.c | 1 +
+ liblcd.c | 1 +
+ putlcd.c | 1 +
+ 3 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/buttond.c b/buttond.c
+index e99b0dd..40a85ae 100644
+--- a/buttond.c
++++ b/buttond.c
+@@ -16,6 +16,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
+ #include <unistd.h>
+diff --git a/liblcd.c b/liblcd.c
+index e8fcacf..39bceea 100644
+--- a/liblcd.c
++++ b/liblcd.c
+@@ -16,6 +16,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+diff --git a/putlcd.c b/putlcd.c
+index c193712..18dc0af 100644
+--- a/putlcd.c
++++ b/putlcd.c
+@@ -16,6 +16,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include "liblcd.h"
+--
+1.7.3.4
+
diff --git a/sys-apps/lcdutils/lcdutils-0.2.ebuild b/sys-apps/lcdutils/lcdutils-0.2.ebuild
new file mode 100644
index 000000000000..35129fdf3922
--- /dev/null
+++ b/sys-apps/lcdutils/lcdutils-0.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Cobalt RaQ/Qube LCD Writing and Button reading utilities"
+HOMEPAGE="http://people.debian.org/~pm/mips-cobalt/"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~mips ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i -e "s:CFLAGS=-O2 -Wall:CFLAGS=${CFLAGS}:g" Makefile
+ epatch "${FILESDIR}"/include-stdlib.h-for-exit.patch
+}
+
+src_compile() {
+ emake distclean || die "distclean failed"
+ emake all || die "all failed"
+}
+
+src_install() {
+ dobin buttond putlcd || die "dobin failed"
+ dodoc ChangeLog || die "dodoc failed"
+}
diff --git a/sys-apps/lcdutils/metadata.xml b/sys-apps/lcdutils/metadata.xml
new file mode 100644
index 000000000000..02914d70e14a
--- /dev/null
+++ b/sys-apps/lcdutils/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>mips</herd>
+ <maintainer>
+ <email>mips@gentoo.org</email>
+ <name>Mips Team</name>
+ </maintainer>
+
+ <longdescription>
+ Provides utilities for Cobalt Microserver systems to write to the LCD and read button input
+ </longdescription>
+</pkgmetadata>
+
diff --git a/sys-apps/less/Manifest b/sys-apps/less/Manifest
new file mode 100644
index 000000000000..3e7e0d126c8a
--- /dev/null
+++ b/sys-apps/less/Manifest
@@ -0,0 +1,6 @@
+DIST code2color-0.2 200711 SHA256 2365c9009b1cc3c30430b88775ec402164df105fd12364871d05dcaed20be954 SHA512 c0ab9f411d5a106c81334343e3c4a63b67d27b95e2d128145e3ac1ee46cd6c228c61796cf96e51826e69b3e465e7bdaa81b1a48cad934c23b310f2ea2ebd8e75 WHIRLPOOL d0207e84a5849c554b1dfc5882ab46d8afc411c7d26e912235ec05565880e6ed0db8449133502234a01ae8f59feae211486b6a523e37859d8404f72fff9b8f93
+DIST less-458.tar.gz 311224 SHA256 e536c7819ede54b3d487f0ffc4c14b3620bed83734d92a81e89f62346db0fcac SHA512 09f4cbd9b7f7969b80dc630d7ec74634ccc19b714b6eef2d9547a1455816ea0d5891cd23f31bd204f41bc4f6c21c721eb35340a259ac20027a444ff549a6f065 WHIRLPOOL b3cdbd5df5d6b36ef40a1b9f6d2a0d9021e544616201fff4ae8cd7dd8b6875f6aae01f08223169e42275ec2c6dcd2d4aa0d47a251b482b9a9913294e471aebe3
+DIST less-476.tar.gz 316352 SHA256 99245fa2945666273056a8f9b54ef096f93ab0ba42dcc918f1d0ad4978629f95 SHA512 7082bbd47520292a5e57e86381e1636c25e7f590dd2949ac5581b5013f5998b9dc0ab54f76ba6a0817a7e3fef22f7e67b095da2033de08b8346b30171490e5ad WHIRLPOOL 6f3cb0803c7691e5cad5b8bc48b711910d05f16d0d831fbea3a65091c7fc5499c59cec37d0ac063722b151ef0bfaab3e4445e64726da6af01317b31c97bb22b8
+DIST less-477.tar.gz 316404 SHA256 b8c55e7032b701d854bbe257286b49a27b1f02205a76e90db7b465e932059bae SHA512 c3e001444eb1adb5ec403d8d3df754ee799112d86e39dc77c13f7c048fc481cd6ad519138e46e98ac855a3f418102d057ccd7d73a92cf3a62c9ae5ac9e049114 WHIRLPOOL 65540e65e1c31c6b8d5fe77c45f249906b8ffad8fa209481f723e386e0c3fc59bfca65e087c5cba60f1a0b8f3c375a9e02175fe43fc20686d68364b0cff927df
+DIST less-478.tar.gz 316439 SHA256 495c7df52199a0c7e6bfbbe7697b2b54f4bf197c8b10b43957762d74483574ce SHA512 f985b427db50f6a488b0ff5b8e94094d093249c0e021b652b728d52deb89749eb9cd688651e76e045f88c4e327e6b7ac888ce70acf41fb5fe10d6742fc21216e WHIRLPOOL c9cfc181705c1c960d7693b7917bfe911b4673d7955a0ec25e1a5ab928de8d41328290155b76fb1525c91e58dccf41d592ab313594d2a8305acad87a21f141c2
+DIST less-479.tar.gz 316484 SHA256 5bf06cb30ee2a2bd1f79f39aa91e46444e7cb19b48c95c4992fa63cfe4527a80 SHA512 56ecfd3c4e586a926e609dabb278eea1554a4a70a1d1d675cea2e9d69ae764f646b25eab197032db6aa571c22a3550ec11a3a7ef556e0d4523092c7a5daaa030 WHIRLPOOL 9b667e1267cd079cbde0a97379495f8f6034be73e0211cb5cae24509671d582fd2e930aa7dd150a1872184eea0e53f5c7fd9decfe4dc1ee38af3b94f3158fd67
diff --git a/sys-apps/less/files/README.Gentoo b/sys-apps/less/files/README.Gentoo
new file mode 100644
index 000000000000..dca832808f1e
--- /dev/null
+++ b/sys-apps/less/files/README.Gentoo
@@ -0,0 +1,22 @@
+This version of less comes with some Gentoo enhancements:
+ - default lesspipe.sh script to "view" files
+ - colorization support
+
+To see what file types are supported, just read the /usr/bin/lesspipe.sh
+script (it's just a plain text bash script).
+
+Colorization support is disabled by default. To enable it, export the
+LESSCOLOR variable to "yes":
+ $ export LESSCOLOR=yes
+
+We also provide a colorization script, 'code2color', that is used by
+default. If you wish to use another script, simply export the LESSCOLORIZER
+variable to name of the script:
+ $ export LESSCOLORIZER=some-other-script
+
+If you want to use the code2color script and the default color schemes are
+not acceptable, you can develop your own schemes and save them in one of
+the following places:
+ /etc/code2color
+ ~/.code2color
+ CODE2COLOR_CONFIG env var
diff --git a/sys-apps/less/files/code2color-0.2.patch b/sys-apps/less/files/code2color-0.2.patch
new file mode 100644
index 000000000000..f8a782504e60
--- /dev/null
+++ b/sys-apps/less/files/code2color-0.2.patch
@@ -0,0 +1,26 @@
+--- code2color
++++ code2color
+@@ -163,11 +163,11 @@
+ # building up the database
+ # newer entries overwrite old ones
+ my @CONFIG_FILES;
+- push @CONFIG_FILES, "/etc/code2html.config";
++ push @CONFIG_FILES, "/etc/code2color";
+ push @CONFIG_FILES,
+- $ENV{'HOME'}."/.code2html.config" if $ENV{'HOME'};
++ $ENV{'HOME'}."/.code2color" if $ENV{'HOME'};
+ push @CONFIG_FILES,
+- split(/:/,$ENV{'CODE2HTML_CONFIG'}) if $ENV{'CODE2HTML_CONFIG'};
++ split(/:/,$ENV{'CODE2COLOR_CONFIG'}) if $ENV{'CODE2COLOR_CONFIG'};
+ push @CONFIG_FILES,
+ split(/:/,$params{'langfile'}) if $params{'langfile'};
+
+@@ -3192,7 +3192,7 @@
+ #
+
+ $LANGUAGE{'shellscript'} = {
+- 'filename' => '\\.(sh|shell)$',
++ 'filename' => '\\.(ebuild|eclass|sh|shell)$',
+ 'regex' => '^\\s*#\\s*![^\\s]*(sh|bash|ash|zsh|ksh)',
+ 'patterns' => [ {
+ 'name' => 'comment',
diff --git a/sys-apps/less/files/less.envd b/sys-apps/less/files/less.envd
new file mode 100644
index 000000000000..b737af921164
--- /dev/null
+++ b/sys-apps/less/files/less.envd
@@ -0,0 +1,2 @@
+LESSOPEN="|lesspipe %s"
+LESS="-R -M --shift 5"
diff --git a/sys-apps/less/files/lesspipe.sh b/sys-apps/less/files/lesspipe.sh
new file mode 100644
index 000000000000..6edaa3ceb452
--- /dev/null
+++ b/sys-apps/less/files/lesspipe.sh
@@ -0,0 +1,274 @@
+#!/bin/bash
+#
+# Preprocessor for 'less'. Used when this environment variable is set:
+# LESSOPEN="|lesspipe %s"
+
+# TODO: handle compressed files better
+
+[[ -n ${LESSDEBUG} ]] && set -x
+
+trap 'exit 0' PIPE
+
+guesscompress() {
+ case "$1" in
+ *.gz|*.z) echo "gunzip -c" ;;
+ *.bz2|*.bz) echo "bunzip2 -c" ;;
+ *.lz) echo "lzip -dc" ;;
+ *.lzma) echo "unlzma -c" ;;
+ *.lzo) echo "lzop -dc" ;;
+ *.xz) echo "xzdec" ;;
+ *) echo "cat" ;;
+ esac
+}
+
+lesspipe_file() {
+ local out=$(file -L -- "$1")
+ local suffix
+ case ${out} in
+ *" 7-zip archive"*) suffix="7z";;
+ *" ar archive"*) suffix="a";;
+ *" CAB-Installer"*) suffix="cab";;
+ *" cpio archive"*) suffix="cpio";;
+ *" ELF "*) suffix="elf";;
+ *" LHa"*archive*) suffix="lha";;
+ *" troff "*) suffix="man";;
+ *" script text"*) suffix="sh";;
+ *" shared object"*) suffix="so";;
+ *" tar archive"*) suffix="tar";;
+ *" Zip archive"*) suffix="zip";;
+ *": data") hexdump -C -- "$1"; return 0;;
+ *) return 1;;
+ esac
+ lesspipe "$1" ".${suffix}"
+ return 0
+}
+
+lesspipe() {
+ local match=$2
+ [[ -z ${match} ]] && match=$1
+
+ local DECOMPRESSOR=$(guesscompress "${match}")
+
+ # User filters
+ if [[ -x ~/.lessfilter ]] ; then
+ ~/.lessfilter "$1" && exit 0
+ fi
+
+ local ignore
+ for ignore in ${LESSIGNORE} ; do
+ [[ ${match} == *.${ignore} ]] && exit 0
+ done
+
+ case "${match}" in
+
+ ### Doc files ###
+ *.[0-9n]|*.man|\
+ *.[0-9n].bz2|*.man.bz2|\
+ *.[0-9n].gz|*.man.gz|\
+ *.[0-9n].lzma|*.man.lzma|\
+ *.[0-9n].xz|*.man.xz|\
+ *.[0-9][a-z].gz|*.[0-9][a-z].gz)
+ local out=$(${DECOMPRESSOR} -- "$1" | file -)
+ case ${out} in
+ *troff*)
+ # Need to make sure we pass path to man or it will try
+ # to locate "$1" in the man search paths
+ if [[ $1 == /* ]] ; then
+ man -- "$1"
+ else
+ man -- "./$1"
+ fi
+ ;;
+ *text*)
+ ${DECOMPRESSOR} -- "$1"
+ ;;
+ *)
+ # We could have matched a library (libc.so.6), so let
+ # `file` figure out what the hell this thing is
+ lesspipe_file "$1"
+ ;;
+ esac
+ ;;
+ *.dvi) dvi2tty "$1" ;;
+ *.ps|*.pdf) ps2ascii "$1" || pstotext "$1" || pdftotext "$1" ;;
+ *.doc) antiword "$1" || catdoc "$1" ;;
+ *.rtf) unrtf --nopict --text "$1" ;;
+ *.conf|*.txt|*.log) ;; # force less to work on these directly #150256
+
+ ### URLs ###
+ ftp://*|http://*|*.htm|*.html)
+ for b in links2 links lynx ; do
+ ${b} -dump "$1" && exit 0
+ done
+ html2text -style pretty "$1"
+ ;;
+
+ ### Tar files ###
+ *.tar|\
+ *.tar.bz2|*.tar.bz|*.tar.gz|*.tar.z|\
+ *.tar.lz|*.tar.tlz|\
+ *.tar.lzma|*.tar.xz)
+ ${DECOMPRESSOR} -- "$1" | tar tvvf -;;
+ *.tbz2|*.tbz|*.tgz|*.tlz|*.txz)
+ lesspipe "$1" "$1".tar.${1##*.t} ;;
+
+ ### Misc archives ###
+ *.bz2|\
+ *.gz|*.z|\
+ *.lz|\
+ *.lzma|*.xz) ${DECOMPRESSOR} -- "$1" ;;
+ *.rpm) rpm -qpivl --changelog -- "$1" || rpm2tar -O "$1" | tar tvvf -;;
+ *.cpi|*.cpio) cpio -itv < "$1" ;;
+ *.ace) unace l "$1" ;;
+ *.arc) arc v "$1" ;;
+ *.arj) unarj l -- "$1" ;;
+ *.cab) cabextract -l -- "$1" ;;
+ *.lha|*.lzh) lha v "$1" ;;
+ *.zoo) zoo -list "$1" || unzoo -l "$1" ;;
+ *.7z|*.exe) 7z l -- "$1" || 7za l -- "$1" || 7zr l -- "$1" ;;
+ *.a) ar tv "$1" ;;
+ *.elf) readelf -a -W -- "$1" ;;
+ *.so) readelf -h -d -s -W -- "$1" ;;
+ *.mo|*.gmo) msgunfmt -- "$1" ;;
+
+ *.rar|.r[0-9][0-9]) unrar l -- "$1" ;;
+
+ *.jar|*.war|*.ear|*.xpi|*.zip)
+ unzip -v "$1" || miniunzip -l "$1" || miniunz -l "$1" || zipinfo -v "$1"
+ ;;
+
+ *.deb|*.udeb)
+ if type -P dpkg > /dev/null ; then
+ dpkg --info "$1"
+ dpkg --contents "$1"
+ else
+ ar tv "$1"
+ ar p "$1" data.tar.gz | tar tzvvf -
+ fi
+ ;;
+
+ ### Filesystems ###
+ *.squashfs) unsquashfs -s "$1" && unsquashfs -ll "$1" ;;
+
+ ### Media ###
+ *.bmp|*.gif|*.jpeg|*.jpg|*.ico|*.pcd|*.pcx|*.png|*.ppm|*.tga|*.tiff|*.tif|*.webp)
+ identify "$1" || file -L -- "$1"
+ ;;
+ *.asf|*.avi|*.mov|*.mp4|*.mpeg|*.mpg|*.qt|*.ram|*.rm|*.webm|*.wmv)
+ midentify "$1" || file -L -- "$1"
+ ;;
+ *.mp3) mp3info "$1" || id3info "$1" ;;
+ *.ogg) ogginfo "$1" ;;
+ *.flac) metaflac --list "$1" ;;
+ *.torrent) torrentinfo "$1" || torrentinfo-console "$1" || ctorrent -x "$1" ;;
+ *.bin|*.cue|*.raw)
+ # not all .bin/.raw files are cd images #285507
+ # fall back to lesspipe_file if .cue doesn't exist, or if
+ # cd-info failed to parse things sanely
+ [[ -e ${1%.*}.cue ]] \
+ && cd-info --no-header --no-device-info "$1" \
+ || lesspipe_file "$1"
+ ;;
+ *.iso)
+ iso_info=$(isoinfo -d -i "$1")
+ echo "${iso_info}"
+ # Joliet output overrides Rock Ridge, so prefer the better Rock
+ case ${iso_info} in
+ *$'\n'"Rock Ridge"*) iso_opts="-R";;
+ *$'\n'"Joliet"*) iso_opts="-J";;
+ *) iso_opts="";;
+ esac
+ isoinfo -l ${iso_opts} -i "$1"
+ ;;
+
+ ### Encryption stuff ###
+ *.crl) openssl crl -hash -text -noout -in "$1" ;;
+ *.csr) openssl req -text -noout -in "$1" ;;
+ *.crt|*.pem) openssl x509 -hash -text -noout -in "$1" ;;
+
+# May not be such a good idea :)
+# ### Device nodes ###
+# /dev/[hs]d[a-z]*)
+# fdisk -l "${1:0:8}"
+# [[ $1 == *hd* ]] && hdparm -I "${1:0:8}"
+# ;;
+
+ ### Everything else ###
+ *)
+ case $(( recur++ )) in
+ # Maybe we didn't match due to case issues ...
+ 0) lesspipe "$1" "$(echo $1 | LC_ALL=C tr '[:upper:]' '[:lower:]')" ;;
+
+ # Maybe we didn't match because the file is named weird ...
+ 1) lesspipe_file "$1" ;;
+ esac
+
+ # So no matches from above ... finally fall back to an external
+ # coloring package. No matching here so we don't have to worry
+ # about keeping in sync with random packages. Any coloring tool
+ # you use should not output errors about unsupported files to
+ # stdout. If it does, it's your problem.
+
+ # Allow people to flip color off if they dont want it
+ case ${LESSCOLOR} in
+ always) LESSCOLOR=2;;
+ [yY][eE][sS]|[yY]|1|true) LESSCOLOR=1;;
+ [nN][oO]|[nN]|0|false) LESSCOLOR=0;;
+ *) LESSCOLOR=0;; # default to no color #188835
+ esac
+ if [[ ${LESSCOLOR} != "0" ]] && [[ -n ${LESSCOLORIZER=code2color} ]] ; then
+ # 2: Only colorize if user forces it ...
+ # 1: ... or we know less will handle raw codes -- this will
+ # not detect -seiRM, so set LESSCOLORIZER yourself
+ if [[ ${LESSCOLOR} == "2" ]] || [[ " ${LESS} " == *" -"[rR]" "* ]] ; then
+ LESSQUIET=true ${LESSCOLORIZER} "$1"
+ fi
+ fi
+
+ # Nothing left to do but let less deal
+ exit 0
+ ;;
+ esac
+}
+
+if [[ -z $1 ]] ; then
+ echo "Usage: lesspipe <file>"
+elif [[ $1 == "-V" || $1 == "--version" ]] ; then
+ Id="cvsid"
+ cat <<-EOF
+ $Id$
+ Copyright 2001-2013 Gentoo Foundation
+ Mike Frysinger <vapier@gentoo.org>
+ (with plenty of ideas stolen from other projects/distros)
+
+
+ EOF
+ less -V
+elif [[ $1 == "-h" || $1 == "--help" ]] ; then
+ cat <<-EOF
+ lesspipe: preprocess files before sending them to less
+
+ Usage: lesspipe <file>
+
+ lesspipe specific settings:
+ LESSCOLOR env - toggle colorizing of output (no/yes/always)
+ LESSCOLORIZER env - program used to colorize output (default: code2color)
+ LESSIGNORE - list of extensions to ignore (don't do anything fancy)
+
+ You can create per-user filters as well by creating the executable file:
+ ~/.lessfilter
+ One argument is passed to it: the file to display.
+
+ To use lesspipe, simply add to your environment:
+ export LESSOPEN="|lesspipe %s"
+
+ Run 'less --help' or 'man less' for more info
+ EOF
+elif [[ -d $1 ]] ; then
+ ls -alF -- "$1"
+else
+ recur=0
+ [[ -n ${LESSDEBUG} ]] \
+ && lesspipe "$1" \
+ || lesspipe "$1" 2> /dev/null
+fi
diff --git a/sys-apps/less/less-458.ebuild b/sys-apps/less/less-458.ebuild
new file mode 100644
index 000000000000..88ccd60bae0e
--- /dev/null
+++ b/sys-apps/less/less-458.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+CODE2COLOR_PV="0.2"
+CODE2COLOR_P="code2color-${CODE2COLOR_PV}"
+DESCRIPTION="Excellent text file viewer"
+HOMEPAGE="http://www.greenwoodsoftware.com/less/"
+SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
+ http://www-zeuthen.desy.de/~friebel/unix/less/code2color -> ${CODE2COLOR_P}"
+
+LICENSE="|| ( GPL-3 BSD-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="pcre unicode"
+
+DEPEND=">=app-misc/editor-wrapper-3
+ >=sys-libs/ncurses-5.2
+ pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/${CODE2COLOR_P} "${S}"/code2color || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${CODE2COLOR_P}.patch
+}
+
+src_configure() {
+ export ac_cv_lib_ncursesw_initscr=$(usex unicode)
+ export ac_cv_lib_ncurses_initscr=$(usex !unicode)
+ econf \
+ --with-regex=$(usex pcre pcre posix) \
+ --with-editor="${EPREFIX}"/usr/libexec/editor
+}
+
+src_install() {
+ default
+
+ dobin code2color
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe
+ dosym lesspipe /usr/bin/lesspipe.sh
+ newenvd "${FILESDIR}"/less.envd 70less
+
+ dodoc "${FILESDIR}"/README.Gentoo
+}
+
+pkg_postinst() {
+ elog "lesspipe offers colorization options. Run 'lesspipe -h' for info."
+}
diff --git a/sys-apps/less/less-476.ebuild b/sys-apps/less/less-476.ebuild
new file mode 100644
index 000000000000..4602bbe70ebb
--- /dev/null
+++ b/sys-apps/less/less-476.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+CODE2COLOR_PV="0.2"
+CODE2COLOR_P="code2color-${CODE2COLOR_PV}"
+DESCRIPTION="Excellent text file viewer"
+HOMEPAGE="http://www.greenwoodsoftware.com/less/"
+SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
+ http://www-zeuthen.desy.de/~friebel/unix/less/code2color -> ${CODE2COLOR_P}"
+
+LICENSE="|| ( GPL-3 BSD-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="pcre unicode"
+
+DEPEND=">=app-misc/editor-wrapper-3
+ >=sys-libs/ncurses-5.2
+ pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/${CODE2COLOR_P} "${S}"/code2color || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${CODE2COLOR_P}.patch
+ chmod a+x configure || die
+}
+
+src_configure() {
+ export ac_cv_lib_ncursesw_initscr=$(usex unicode)
+ export ac_cv_lib_ncurses_initscr=$(usex !unicode)
+ econf \
+ --with-regex=$(usex pcre pcre posix) \
+ --with-editor="${EPREFIX}"/usr/libexec/editor
+}
+
+src_install() {
+ default
+
+ dobin code2color
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe
+ dosym lesspipe /usr/bin/lesspipe.sh
+ newenvd "${FILESDIR}"/less.envd 70less
+
+ dodoc "${FILESDIR}"/README.Gentoo
+}
+
+pkg_postinst() {
+ elog "lesspipe offers colorization options. Run 'lesspipe -h' for info."
+}
diff --git a/sys-apps/less/less-477.ebuild b/sys-apps/less/less-477.ebuild
new file mode 100644
index 000000000000..4602bbe70ebb
--- /dev/null
+++ b/sys-apps/less/less-477.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+CODE2COLOR_PV="0.2"
+CODE2COLOR_P="code2color-${CODE2COLOR_PV}"
+DESCRIPTION="Excellent text file viewer"
+HOMEPAGE="http://www.greenwoodsoftware.com/less/"
+SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
+ http://www-zeuthen.desy.de/~friebel/unix/less/code2color -> ${CODE2COLOR_P}"
+
+LICENSE="|| ( GPL-3 BSD-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="pcre unicode"
+
+DEPEND=">=app-misc/editor-wrapper-3
+ >=sys-libs/ncurses-5.2
+ pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/${CODE2COLOR_P} "${S}"/code2color || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${CODE2COLOR_P}.patch
+ chmod a+x configure || die
+}
+
+src_configure() {
+ export ac_cv_lib_ncursesw_initscr=$(usex unicode)
+ export ac_cv_lib_ncurses_initscr=$(usex !unicode)
+ econf \
+ --with-regex=$(usex pcre pcre posix) \
+ --with-editor="${EPREFIX}"/usr/libexec/editor
+}
+
+src_install() {
+ default
+
+ dobin code2color
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe
+ dosym lesspipe /usr/bin/lesspipe.sh
+ newenvd "${FILESDIR}"/less.envd 70less
+
+ dodoc "${FILESDIR}"/README.Gentoo
+}
+
+pkg_postinst() {
+ elog "lesspipe offers colorization options. Run 'lesspipe -h' for info."
+}
diff --git a/sys-apps/less/less-478.ebuild b/sys-apps/less/less-478.ebuild
new file mode 100644
index 000000000000..21dc22854ac8
--- /dev/null
+++ b/sys-apps/less/less-478.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+CODE2COLOR_PV="0.2"
+CODE2COLOR_P="code2color-${CODE2COLOR_PV}"
+DESCRIPTION="Excellent text file viewer"
+HOMEPAGE="http://www.greenwoodsoftware.com/less/"
+SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
+ http://www-zeuthen.desy.de/~friebel/unix/less/code2color -> ${CODE2COLOR_P}"
+
+LICENSE="|| ( GPL-3 BSD-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="pcre unicode"
+
+DEPEND=">=app-misc/editor-wrapper-3
+ >=sys-libs/ncurses-5.2
+ pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/${CODE2COLOR_P} "${S}"/code2color || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${CODE2COLOR_P}.patch
+ chmod a+x configure || die
+}
+
+src_configure() {
+ export ac_cv_lib_ncursesw_initscr=$(usex unicode)
+ export ac_cv_lib_ncurses_initscr=$(usex !unicode)
+ econf \
+ --with-regex=$(usex pcre pcre posix) \
+ --with-editor="${EPREFIX}"/usr/libexec/editor
+}
+
+src_install() {
+ default
+
+ dobin code2color
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe
+ dosym lesspipe /usr/bin/lesspipe.sh
+ newenvd "${FILESDIR}"/less.envd 70less
+
+ dodoc "${FILESDIR}"/README.Gentoo
+}
+
+pkg_postinst() {
+ elog "lesspipe offers colorization options. Run 'lesspipe -h' for info."
+}
diff --git a/sys-apps/less/less-479.ebuild b/sys-apps/less/less-479.ebuild
new file mode 100644
index 000000000000..4602bbe70ebb
--- /dev/null
+++ b/sys-apps/less/less-479.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+CODE2COLOR_PV="0.2"
+CODE2COLOR_P="code2color-${CODE2COLOR_PV}"
+DESCRIPTION="Excellent text file viewer"
+HOMEPAGE="http://www.greenwoodsoftware.com/less/"
+SRC_URI="http://www.greenwoodsoftware.com/less/${P}.tar.gz
+ http://www-zeuthen.desy.de/~friebel/unix/less/code2color -> ${CODE2COLOR_P}"
+
+LICENSE="|| ( GPL-3 BSD-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="pcre unicode"
+
+DEPEND=">=app-misc/editor-wrapper-3
+ >=sys-libs/ncurses-5.2
+ pcre? ( dev-libs/libpcre )"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ cp "${DISTDIR}"/${CODE2COLOR_P} "${S}"/code2color || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${CODE2COLOR_P}.patch
+ chmod a+x configure || die
+}
+
+src_configure() {
+ export ac_cv_lib_ncursesw_initscr=$(usex unicode)
+ export ac_cv_lib_ncurses_initscr=$(usex !unicode)
+ econf \
+ --with-regex=$(usex pcre pcre posix) \
+ --with-editor="${EPREFIX}"/usr/libexec/editor
+}
+
+src_install() {
+ default
+
+ dobin code2color
+ newbin "${FILESDIR}"/lesspipe.sh lesspipe
+ dosym lesspipe /usr/bin/lesspipe.sh
+ newenvd "${FILESDIR}"/less.envd 70less
+
+ dodoc "${FILESDIR}"/README.Gentoo
+}
+
+pkg_postinst() {
+ elog "lesspipe offers colorization options. Run 'lesspipe -h' for info."
+}
diff --git a/sys-apps/less/metadata.xml b/sys-apps/less/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/less/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-apps/likwid/Manifest b/sys-apps/likwid/Manifest
new file mode 100644
index 000000000000..e8f7a4859361
--- /dev/null
+++ b/sys-apps/likwid/Manifest
@@ -0,0 +1 @@
+DIST likwid-3.1.3.tar.gz 605675 SHA256 05078ec55dce3d4cf1c94832bd289ccbcaee7bdee9a1ea9f6681ccd3f59ece5b SHA512 e31b4498e702d4ddf61e3c123d43f0804ef4cef149bb3732b61e3894aa9d76feb7a2654bbb0467dd30323031122ea01cf17e4f01a33f193e750cdbdfc09741d7 WHIRLPOOL bccfcc68e792f09a66eab99affa81250fbe34d4759a81a4e0bd0af2535e5bb09229bee4bc165986559d14101183e5be9a933273ec9f1a7c5c8da3f97f07f9e8e
diff --git a/sys-apps/likwid/files/likwid-3.1.3-Makefile.patch b/sys-apps/likwid/files/likwid-3.1.3-Makefile.patch
new file mode 100644
index 000000000000..a40d0c3262a2
--- /dev/null
+++ b/sys-apps/likwid/files/likwid-3.1.3-Makefile.patch
@@ -0,0 +1,42 @@
+--- Makefile.org 2015-03-04 16:25:59.942213571 +0800
++++ Makefile 2015-03-04 16:46:05.640278082 +0800
+@@ -87,7 +87,7 @@
+
+ LIKWID_LIB = liblikwid
+ ifeq ($(SHARED_LIBRARY),true)
+-CFLAGS += $(SHARED_CFLAGS) -ggdb
++CFLAGS += $(SHARED_CFLAGS) -g -Wa,--noexecstack
+ DYNAMIC_TARGET_LIB := $(LIKWID_LIB).so
+ TARGET_LIB := $(DYNAMIC_TARGET_LIB)
+ LIBS += -L. -llikwid
+@@ -307,28 +307,8 @@
+ echo "Only root can adjust the privileges of the daemon applications in $(PREFIX)/sbin"; \
+ fi; \
+ done
+- @echo "===> INSTALL man pages to $(MANPREFIX)/man1"
+- @mkdir -p $(MANPREFIX)/man1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-topology.1 > $(MANPREFIX)/man1/likwid-topology.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-features.1 > $(MANPREFIX)/man1/likwid-features.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-perfctr.1 > $(MANPREFIX)/man1/likwid-perfctr.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-powermeter.1 > $(MANPREFIX)/man1/likwid-powermeter.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-pin.1 > $(MANPREFIX)/man1/likwid-pin.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-setFrequencies.1 > $(MANPREFIX)/man1/likwid-setFrequencies.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-bench.1 > $(MANPREFIX)/man1/likwid-bench.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/feedGnuplot.1 > $(MANPREFIX)/man1/feedGnuplot.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-accessD.1 > $(MANPREFIX)/man1/likwid-accessD.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-genCfg.1 > $(MANPREFIX)/man1/likwid-genCfg.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-memsweeper.1 > $(MANPREFIX)/man1/likwid-memsweeper.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-mpirun.1 > $(MANPREFIX)/man1/likwid-mpirun.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-perfscope.1 > $(MANPREFIX)/man1/likwid-perfscope.1
+- @sed -e "s/<VERSION>/$(VERSION)/g" -e "s/<DATE>/$(DATE)/g" < $(DOC_DIR)/likwid-setFreq.1 > $(MANPREFIX)/man1/likwid-setFreq.1
+- @chmod 644 $(MANPREFIX)/man1/likwid-*
+- @echo "===> INSTALL headers to $(PREFIX)/include"
+- @mkdir -p $(PREFIX)/include/likwid
+- @cp -f src/includes/likwid*.h $(PREFIX)/include/
+- @cp -f src/includes/* $(PREFIX)/include/likwid
+- @cp -f GCC/perfmon_group_types.h $(PREFIX)/include/likwid
++ @echo "===> INSTALL man pages"
++ @mkdir -p $(PREFIX)/include/
+ $(FORTRAN_INSTALL)
+ @echo "===> INSTALL libraries to $(PREFIX)/lib"
+ @mkdir -p $(PREFIX)/lib
diff --git a/sys-apps/likwid/files/likwid-3.1.3-fix-gnustack.patch b/sys-apps/likwid/files/likwid-3.1.3-fix-gnustack.patch
new file mode 100644
index 000000000000..6ee4149dd5d7
--- /dev/null
+++ b/sys-apps/likwid/files/likwid-3.1.3-fix-gnustack.patch
@@ -0,0 +1,32 @@
+diff --git a/Makefile b/Makefile
+index eecd4e9..34eee7c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -259,6 +259,7 @@ $(BUILD_DIR)/%.h: $(SRC_DIR)/includes/%.txt
+ $(BUILD_DIR)/%.o: $(BUILD_DIR)/%.pas
+ @echo "===> ASSEMBLE $@"
+ $(Q)$(PAS) -i $(PASFLAGS) -o $(BUILD_DIR)/$*.s $< '$(DEFINES)'
++ @cat fix_gnustack.txt >> $(BUILD_DIR)/$*.s
+ $(Q)$(AS) $(ASFLAGS) $(BUILD_DIR)/$*.s -o $@
+
+ ifeq ($(findstring $(MAKECMDGOALS),clean),)
+diff --git a/fix_gnustack.txt b/fix_gnustack.txt
+new file mode 100644
+index 0000000..965af94
+--- /dev/null
++++ b/fix_gnustack.txt
+@@ -0,0 +1,3 @@
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
+diff --git a/src/loadData.s b/src/loadData.s
+index e176c53..9934f7d 100644
+--- a/src/loadData.s
++++ b/src/loadData.s
+@@ -20,3 +20,6 @@ ret
+ .size _loadData, .-_loadData
+
+
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/sys-apps/likwid/likwid-3.1.3.ebuild b/sys-apps/likwid/likwid-3.1.3.ebuild
new file mode 100644
index 000000000000..f938441d27f0
--- /dev/null
+++ b/sys-apps/likwid/likwid-3.1.3.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+FORTRAN_NEEDED=fortran
+
+inherit eutils fcaps fortran-2 linux-info multilib
+
+DESCRIPTION="A lightweight performance-oriented tool suite for x86 multicore environments"
+HOMEPAGE="https://code.google.com/p/likwid/"
+SRC_URI="http://ftp.fau.de/pub/likwid/likwid-${PV}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="-fortran"
+
+RDEPEND="dev-lang/perl"
+DEPEND="${RDEPEND}
+ sys-apps/sed"
+
+CONFIG_CHECK="~X86_MSR"
+
+FILECAPS=(
+ cap_sys_rawio usr/sbin/likwid-accessD --
+ cap_sys_rawio usr/bin/likwid-{perfctr,bench,powermeter}
+)
+
+src_prepare() {
+ sed -e 's:^PREFIX = .*:PREFIX = '${D}'/usr:' \
+ -e "/^LIBLIKWIDPIN/s|lib/|$(get_libdir)/|" \
+ -i config.mk || die
+ sed -e "s:\$(PREFIX)/lib:\$(PREFIX)/$(get_libdir):" \
+ -i Makefile || die
+
+ sed -e '/LIBS/aSHARED_LFLAGS += -Wl,-soname,$@' \
+ -i make/include_GCC.mk || die
+ sed -e '/^Q/d' -i Makefile || die
+ sed -e 's/<DATE>/12.02.2014/g' \
+ -e "s/VERSION/${PV}/g" \
+ -i doc/* || die
+ sed -e "/exeprog/s|TOSTRING(ACCESSDAEMON)|\"/usr/sbin/likwid-accessD\"|" \
+ -i src/accessClient.c || die
+
+ epatch "${FILESDIR}/${P}-Makefile.patch"
+ epatch "${FILESDIR}/${P}-fix-gnustack.patch"
+}
+
+src_configure() {
+ if use fortran; then
+ sed -i 's:^FORTRAN_INTERFACE = false:FORTRAN_INTERFACE = likwid.mod:' config.mk || die
+ sed -i 's:^FC = ifort:FC = gfortran:' make/include_GCC.mk || die
+ sed -i '/^FCFLAGS/c\FCFLAGS = -J ./ -fsyntax-only' make/include_GCC.mk || die
+ fi
+}
+
+src_install () {
+ default
+ if use fortran; then
+ insinto /usr/include
+ doins likwid.mod
+ fi
+
+ doman doc/*
+}
diff --git a/sys-apps/likwid/metadata.xml b/sys-apps/likwid/metadata.xml
new file mode 100644
index 000000000000..fa053a36fa48
--- /dev/null
+++ b/sys-apps/likwid/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>brendan@horan.hk</email>
+ <name>Brendan Horan</name>
+ <description>Proxy - Maintainer. Assign bugs to him</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/linux-misc-apps/Manifest b/sys-apps/linux-misc-apps/Manifest
new file mode 100644
index 000000000000..a0a0e4d17c67
--- /dev/null
+++ b/sys-apps/linux-misc-apps/Manifest
@@ -0,0 +1,2 @@
+DIST linux-3.18.tar.xz 80934708 SHA256 becc413cc9e6d7f5cc52a3ce66d65c3725bc1d1cc1001f4ce6c32b69eb188cbd SHA512 2f0b72466e9bc538a675738aa416573d41bbbd7e3e2ffd5b5b127afde609ebc278cec5a3c37e73479607e957c13f1b4ed9782a3795e0dcc2cf8e550228594009 WHIRLPOOL 81634af631b7d30ccd1f4798f96f44d9aa0ba6609b73f2747eb6aebaf7a99487fb2dbd45767605186182533cb222bfd9236e8dd5e11a04fdb67c211e4e0a91d6
+DIST linux-3.6.tar.bz2 82296001 SHA256 88ae0a20fd39ecae79db0ce8f9397922fae33c8b06a54ed2c883c861126c9771 SHA512 cbaefc2c4c8ab2251c3345b7b2c88d55a49e3468d8b177b05dd6d96a802efa9a052b1a1ecab8b71298bac97f45259516d88253838332b4fdb4307780ebcddce9 WHIRLPOOL e17e3800951f0c3af21015d1a1c99698d0ef70815bd4f131dd60b30baef70d4c255988857533a9a7c058388c2febfcf02d12cde2a7ed46b24fa85aeb260c0251
diff --git a/sys-apps/linux-misc-apps/files/freefall.confd b/sys-apps/linux-misc-apps/files/freefall.confd
new file mode 100644
index 000000000000..c082615cbcac
--- /dev/null
+++ b/sys-apps/linux-misc-apps/files/freefall.confd
@@ -0,0 +1,6 @@
+# /etc/conf.d/freefall
+
+# The name of the disk device that hpfall should protect.
+# Usually this is 'sda' or 'hda' the primary master.
+
+DISK="sda"
diff --git a/sys-apps/linux-misc-apps/files/freefall.initd b/sys-apps/linux-misc-apps/files/freefall.initd
new file mode 100644
index 000000000000..1df5294534e9
--- /dev/null
+++ b/sys-apps/linux-misc-apps/files/freefall.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 2012-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+checkconfig() {
+ if [ -z "$DISK" ] ; then
+ eerror "You need to setup DISK in /etc/conf.d/freefall first"
+ return 1
+ fi
+
+ if [ ! -b /dev/${DISK} ]; then
+ eerror "Could not find disk /dev/${DISK}!"
+ eerror "Adjust the DISK setting in /etc/conf.d/freefall"
+ return 1
+ fi
+
+ if [ ! -e /sys/block/${DISK}/device/unload_heads ] ; then
+ eerror "No protect entry for ${DISK}!"
+ eerror "Kernel 2.6.28 and above is required"
+ return 1
+ fi
+
+ if [ ! -c /dev/freefall ]; then
+ ebegin "Loading hp_accel module"
+ modprobe hp_accel
+ eend $? || return 1
+ fi
+}
+
+start () {
+ checkconfig || return 1
+
+ ebegin "Starting active hard-drive protection daemon"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/freefall /dev/${DISK}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping active hard-drive protection daemon"
+ start-stop-daemon --stop --quiet \
+ --exec /usr/sbin/freefall
+ eend $?
+}
diff --git a/sys-apps/linux-misc-apps/files/hpfall.confd b/sys-apps/linux-misc-apps/files/hpfall.confd
new file mode 100644
index 000000000000..4f3451b0bff6
--- /dev/null
+++ b/sys-apps/linux-misc-apps/files/hpfall.confd
@@ -0,0 +1,6 @@
+# /etc/conf.d/hpfall
+
+# The name of the disk device that hpfall should protect.
+# Usually this is 'sda' or 'hda' the primary master.
+
+DISK="sda" \ No newline at end of file
diff --git a/sys-apps/linux-misc-apps/files/hpfall.initd b/sys-apps/linux-misc-apps/files/hpfall.initd
new file mode 100644
index 000000000000..5b9a55ba5a8f
--- /dev/null
+++ b/sys-apps/linux-misc-apps/files/hpfall.initd
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+checkconfig() {
+ if [ -z "$DISK" ] ; then
+ eerror "You need to setup DISK in /etc/conf.d/hpfall first"
+ return 1
+ fi
+
+ if [ ! -b /dev/${DISK} ]; then
+ eerror "Could not find disk /dev/${DISK}!"
+ eerror "Adjust the DISK setting in /etc/conf.d/hpfall"
+ return 1
+ fi
+
+ if [ ! -e /sys/block/${DISK}/device/unload_heads ] ; then
+ eerror "No protect entry for ${DISK}!"
+ eerror "Kernel 2.6.28 and above is required"
+ return 1
+ fi
+
+ if [ ! -c /dev/freefall ]; then
+ ebegin "Loading hp_accel module"
+ modprobe hp_accel
+ eend $? || return 1
+ fi
+}
+
+start () {
+ checkconfig || return 1
+
+ ebegin "Starting active hard-drive protection daemon"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/hpfall /dev/${DISK}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping active hard-drive protection daemon"
+ start-stop-daemon --stop --quiet \
+ --exec /usr/sbin/hpfall
+ eend $?
+}
diff --git a/sys-apps/linux-misc-apps/linux-misc-apps-3.18.ebuild b/sys-apps/linux-misc-apps/linux-misc-apps-3.18.ebuild
new file mode 100644
index 000000000000..be86d16228a7
--- /dev/null
+++ b/sys-apps/linux-misc-apps/linux-misc-apps-3.18.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator eutils toolchain-funcs linux-info autotools flag-o-matic
+
+DESCRIPTION="Misc tools bundled with kernel sources"
+HOMEPAGE="http://kernel.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="static-libs tcpd"
+
+MY_PV="${PV/_/-}"
+MY_PV="${MY_PV/-pre/-git}"
+
+LINUX_V=$(get_version_component_range 1-2)
+
+if [ ${PV/_rc} != ${PV} ]; then
+ LINUX_VER=$(get_version_component_range 1-2).$(($(get_version_component_range 3)-1))
+ PATCH_VERSION=$(get_version_component_range 1-3)
+ LINUX_PATCH=patch-${PV//_/-}.xz
+ SRC_URI="mirror://kernel/linux/kernel/v3.x/testing/${LINUX_PATCH}
+ mirror://kernel/linux/kernel/v3.x/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
+elif [ $(get_version_component_count) == 4 ]; then
+ # stable-release series
+ LINUX_VER=$(get_version_component_range 1-3)
+ LINUX_PATCH=patch-${PV}.xz
+ SRC_URI="mirror://kernel/linux/kernel/v3.x/${LINUX_PATCH}"
+else
+ LINUX_VER=${PV}
+fi
+
+LINUX_SOURCES=linux-${LINUX_VER}.tar.xz
+SRC_URI="${SRC_URI} mirror://kernel/linux/kernel/v3.x/${LINUX_SOURCES}"
+
+# pmtools also provides turbostat
+# usbip available in seperate package now
+RDEPEND="sys-apps/hwids
+ >=dev-libs/glib-2.6
+ tcpd? ( sys-apps/tcp-wrappers )
+ !sys-power/pmtools"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/linux-${LINUX_VER}"
+
+# All of these are integrated with the kernel build system,
+# No make install, and ideally build with with the root Makefile
+TARGETS_SIMPLE=(
+ Documentation/accounting/getdelays.c
+ tools/cgroup/cgroup_event_listener.c
+ Documentation/laptops/dslm.c
+ Documentation/laptops/freefall.c
+ Documentation/networking/timestamping/timestamping.c
+ Documentation/watchdog/src/watchdog-simple.c
+ tools/lguest/lguest.c
+ tools/vm/slabinfo.c
+ usr/gen_init_cpio.c
+)
+# tools/vm/page-types.c - broken, header path issue
+# tools/hv/hv_kvp_daemon.c - broken in 3.7 by missing linux/hyperv.h userspace
+# Documentation/networking/ifenslave.c - obsolete
+# Documentation/ptp/testptp.c - pending linux-headers-3.0
+
+# These have a broken make install, no DESTDIR
+TARGET_MAKE_SIMPLE=(
+ tools/firewire:nosy-dump
+ tools/power/x86/turbostat:../../../../turbostat
+ tools/power/x86/x86_energy_perf_policy:x86_energy_perf_policy
+ Documentation/misc-devices/mei:mei-amt-version
+)
+# tools/perf - covered by dev-utils/perf
+# tools/usb - testcases only
+# tools/virtio - testcaes only
+
+ #for _pattern in {Documentation,scripts,tools,usr,include,lib,"arch/*/include",Makefile,Kbuild,Kconfig}; do
+src_unpack() {
+ unpack ${LINUX_SOURCES}
+
+ MY_A=
+ for _AFILE in ${A}; do
+ [[ ${_AFILE} == ${LINUX_SOURCES} ]] && continue
+ [[ ${_AFILE} == ${LINUX_PATCH} ]] && continue
+ MY_A="${MY_A} ${_AFILE}"
+ done
+ [[ -n ${MY_A} ]] && unpack ${MY_A}
+}
+
+src_prepare() {
+ if [[ -n ${LINUX_PATCH} ]]; then
+ epatch "${DISTDIR}"/${LINUX_PATCH}
+ fi
+
+ sed -i \
+ -e '/^nosy-dump.*LDFLAGS/d' \
+ -e '/^nosy-dump.*CFLAGS/d' \
+ -e '/^nosy-dump.*CPPFLAGS/s,CPPFLAGS =,CPPFLAGS +=,g' \
+ "${S}"/tools/firewire/Makefile
+}
+
+kernel_asm_arch() {
+ a="${1:${ARCH}}"
+ case ${a} in
+ # Merged arches
+ x86|amd64) echo x86 ;;
+ ppc*) echo powerpc ;;
+ # Non-merged
+ alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
+ *) die "TODO: Update the code for your asm-ARCH symlink" ;;
+ esac
+}
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ local karch=$(kernel_asm_arch "${ARCH}")
+ # This is the minimal amount needed to start building host binaries.
+ #emake allmodconfig ARCH=${karch}
+ #emake prepare modules_prepare ARCH=${karch}
+ #touch Module.symvers
+
+ # Now we can start building
+ for s in ${TARGETS_SIMPLE[@]} ; do
+ dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
+ einfo "Building $s => $bin"
+ emake -f /dev/null M=${dir} ARCH=${karch} ${s%.c}
+ done
+
+ for t in ${TARGET_MAKE_SIMPLE[@]} ; do
+ dir=${t/:*} target=${t/*:}
+ einfo "Building $dir => $target"
+ emake -C $dir ARCH=${karch} $target
+ done
+}
+
+src_install() {
+ into /usr
+ for s in ${TARGETS_SIMPLE[@]} ; do
+ dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
+ einfo "Installing $s => $bin"
+ dosbin ${dir}/${bin}
+ done
+
+ for t in ${TARGET_MAKE_SIMPLE[@]} ; do
+ dir=${t/:*} target=${t/*:}
+ einfo "Installing $dir => $target"
+ dosbin ${dir}/${target}
+ done
+
+ newconfd "${FILESDIR}"/freefall.confd freefall
+ newinitd "${FILESDIR}"/freefall.initd freefall
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ echo
+ elog "The cpupower utility is maintained separately at sys-power/cpupower"
+ elog "The usbip utility is maintained separately at net-misc/usbip"
+}
diff --git a/sys-apps/linux-misc-apps/linux-misc-apps-3.6-r2.ebuild b/sys-apps/linux-misc-apps/linux-misc-apps-3.6-r2.ebuild
new file mode 100644
index 000000000000..3e02a428b973
--- /dev/null
+++ b/sys-apps/linux-misc-apps/linux-misc-apps-3.6-r2.ebuild
@@ -0,0 +1,185 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit versionator eutils toolchain-funcs linux-info autotools flag-o-matic
+
+DESCRIPTION="Misc tools bundled with kernel sources"
+HOMEPAGE="http://kernel.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="static-libs tcpd"
+
+MY_PV="${PV/_/-}"
+MY_PV="${MY_PV/-pre/-git}"
+
+LINUX_V=$(get_version_component_range 1-2)
+
+if [ ${PV/_rc} != ${PV} ]; then
+ LINUX_VER=$(get_version_component_range 1-2).$(($(get_version_component_range 3)-1))
+ PATCH_VERSION=$(get_version_component_range 1-3)
+ LINUX_PATCH=patch-${PV//_/-}.bz2
+ SRC_URI="mirror://kernel/linux/kernel/v${LINUX_V}/testing/${LINUX_PATCH}
+ mirror://kernel/linux/kernel/v${LINUX_V}/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
+elif [ $(get_version_component_count) == 4 ]; then
+ # stable-release series
+ LINUX_VER=$(get_version_component_range 1-3)
+ LINUX_PATCH=patch-${PV}.bz2
+ SRC_URI="mirror://kernel/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
+else
+ LINUX_VER=${PV}
+fi
+
+LINUX_SOURCES=linux-${LINUX_VER}.tar.bz2
+SRC_URI="${SRC_URI} mirror://kernel/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
+
+# pmtools also provides turbostat
+# sysfsutils and glib for usbip - remove sysfsutils in 3.7 or 3.8
+RDEPEND="sys-apps/hwids
+ >=sys-fs/sysfsutils-2
+ >=dev-libs/glib-2.6
+ tcpd? ( sys-apps/tcp-wrappers )
+ !sys-power/pmtools
+ !net-misc/usbip"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/linux-${LINUX_VER}"
+
+# All of these are integrated with the kernel build system,
+# No make install, and ideally build with with the root Makefile
+TARGETS_SIMPLE=(
+ Documentation/accounting/getdelays.c
+ Documentation/cgroups/cgroup_event_listener.c
+ Documentation/laptops/dslm.c
+ Documentation/laptops/hpfall.c
+ Documentation/networking/timestamping/timestamping.c
+ Documentation/watchdog/src/watchdog-simple.c
+ tools/lguest/lguest.c
+ tools/vm/page-types.c
+ tools/vm/slabinfo.c
+ usr/gen_init_cpio.c
+)
+# tools/hv/hv_kvp_daemon.c - broken in 3.7 by missing linux/hyperv.h userspace
+# Documentation/networking/ifenslave.c - obsolete
+# Documentation/ptp/testptp.c - pending linux-headers-3.0
+
+# These have a broken make install, no DESTDIR
+TARGET_MAKE_SIMPLE=(
+ tools/firewire:nosy-dump
+ tools/power/x86/turbostat:turbostat
+ tools/power/x86/x86_energy_perf_policy:x86_energy_perf_policy
+ Documentation/misc-devices/mei:mei-amt-version
+)
+# tools/perf - covered by dev-utils/perf
+# tools/usb - testcases only
+# tools/virtio - testcaes only
+
+ #for _pattern in {Documentation,scripts,tools,usr,include,lib,"arch/*/include",Makefile,Kbuild,Kconfig}; do
+src_unpack() {
+ unpack ${LINUX_SOURCES}
+
+ MY_A=
+ for _AFILE in ${A}; do
+ [[ ${_AFILE} == ${LINUX_SOURCES} ]] && continue
+ [[ ${_AFILE} == ${LINUX_PATCH} ]] && continue
+ MY_A="${MY_A} ${_AFILE}"
+ done
+ [[ -n ${MY_A} ]] && unpack ${MY_A}
+}
+
+src_prepare() {
+ if [[ -n ${LINUX_PATCH} ]]; then
+ epatch "${DISTDIR}"/${LINUX_PATCH}
+ fi
+
+ pushd drivers/staging/usbip/userspace >/dev/null &&
+ eautoreconf -i -f -v &&
+ popd >/dev/null || die "usbip"
+
+ sed -i \
+ -e '/^nosy-dump.*LDFLAGS/d' \
+ -e '/^nosy-dump.*CFLAGS/d' \
+ -e '/^nosy-dump.*CPPFLAGS/s,CPPFLAGS =,CPPFLAGS +=,g' \
+ "${S}"/tools/firewire/Makefile
+}
+
+kernel_asm_arch() {
+ a="${1:${ARCH}}"
+ case ${a} in
+ # Merged arches
+ x86|amd64) echo x86 ;;
+ ppc*) echo powerpc ;;
+ # Non-merged
+ alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
+ *) die "TODO: Update the code for your asm-ARCH symlink" ;;
+ esac
+}
+
+src_configure() {
+ cd drivers/staging/usbip/userspace && \
+ econf \
+ $(use_enable static-libs static) \
+ $(use tcpd || echo --without-tcp-wrappers) \
+ --with-usbids-dir=/usr/share/misc
+}
+
+src_compile() {
+ local karch=$(kernel_asm_arch "${ARCH}")
+ # This is the minimal amount needed to start building host binaries.
+ #emake allmodconfig ARCH=${karch}
+ #emake prepare modules_prepare ARCH=${karch}
+ #touch Module.symvers
+
+ # Now we can start building
+ for s in ${TARGETS_SIMPLE[@]} ; do
+ dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
+ einfo "Building $s => $bin"
+ emake -f /dev/null M=${dir} ARCH=${karch} ${s%.c}
+ done
+
+ for t in ${TARGET_MAKE_SIMPLE[@]} ; do
+ dir=${t/:*} target=${t/*:}
+ einfo "Building $dir => $target"
+ emake -C $dir ARCH=${karch} $target
+ done
+
+ emake -C drivers/staging/usbip/userspace
+}
+
+src_install() {
+ into /usr
+ for s in ${TARGETS_SIMPLE[@]} ; do
+ dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
+ einfo "Installing $s => $bin"
+ dosbin ${dir}/${bin}
+ done
+
+ for t in ${TARGET_MAKE_SIMPLE[@]} ; do
+ dir=${t/:*} target=${t/*:}
+ einfo "Installing $dir => $target"
+ dosbin ${dir}/${target}
+ done
+
+ pushd drivers/staging/usbip/userspace >/dev/null \
+ || die "Missing usbip/userspace"
+ emake DESTDIR="${D}" install
+
+ newdoc README README.usbip
+ newdoc AUTHORS AUTHORS.usbip
+ dodoc ../usbip_protocol.txt
+ popd >/dev/null
+
+ newconfd "${FILESDIR}"/hpfall.confd hpfall
+ newinitd "${FILESDIR}"/hpfall.initd hpfall
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ echo
+ elog "The cpupower utility is maintained separately at sys-power/cpupower"
+}
diff --git a/sys-apps/linux-misc-apps/metadata.xml b/sys-apps/linux-misc-apps/metadata.xml
new file mode 100644
index 000000000000..c6d862855eb5
--- /dev/null
+++ b/sys-apps/linux-misc-apps/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>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/lkcdutils/Manifest b/sys-apps/lkcdutils/Manifest
new file mode 100644
index 000000000000..85da3b90ebd7
--- /dev/null
+++ b/sys-apps/lkcdutils/Manifest
@@ -0,0 +1,4 @@
+DIST lkcdutils-4.1-1.src.rpm 1502922 SHA256 3482dfca9f7a766eb8d2778640ed72a6fa621915639f6be1a4e1313ac545df71
+DIST lkcdutils-4.1-dhv8.tar.gz 8227 SHA256 1a7a9e6007c338ece8c8c1459af8c02db0ec624bff5f2f71b5dcab4310a998c0
+DIST lkcdutils-4.1-savedump.tar.gz 21626 SHA256 e3bd94c5a8cc4d97885020c841f47c7aec4fc746a6e3b10ab8840a5dfbc2ca82
+DIST lkcdutils-6.2.0.tar.gz 2967595 SHA256 f69d9eb293ad446d61a882e147120ec3d2f55280443efd859d6cdb196b0de22b
diff --git a/sys-apps/lkcdutils/files/lkcdutils-6.2.0-build.patch b/sys-apps/lkcdutils/files/lkcdutils-6.2.0-build.patch
new file mode 100644
index 000000000000..e8330074d9bd
--- /dev/null
+++ b/sys-apps/lkcdutils/files/lkcdutils-6.2.0-build.patch
@@ -0,0 +1,24 @@
+--- a/libsial/Makefile
++++ b/libsial/Makefile
+@@ -53,7 +53,7 @@
+ ./mkbaseop > baseops.c
+ $(CC) $(CFLAGS) -c baseops.c
+
+-mkbaseop.c sial_member.o sial_op.o sial_stat.o sial_type.o y.tab.o : sial.tab.h
++mkbaseop.c sial_api.o sial_member.o sial_op.o sial_stat.o sial_type.o y.tab.o : sial.tab.h
+
+ lex.sial.o: lex.sial.c sial.tab.c sial.h
+ $(CC) $(CFLAGS) -c lex.sial.c
+--- a/libklib/kl_savedump.c
++++ b/libklib/kl_savedump.c
+@@ -24,6 +24,10 @@
+ #include <unistd.h>
+ #include <linux/stddef.h>
+
++#ifndef offsetof
++#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
++#endif
++
+ static int kl_check_type_dev(char *);
+ static int kl_check_type_dir(char *);
+ static int __kl_dump_retrieve_reg(int,int,char*,int,int);
diff --git a/sys-apps/lkcdutils/lkcdutils-4.1.1.ebuild b/sys-apps/lkcdutils/lkcdutils-4.1.1.ebuild
new file mode 100644
index 000000000000..47c6be3e553e
--- /dev/null
+++ b/sys-apps/lkcdutils/lkcdutils-4.1.1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P=${P/4.1.1/4.1}
+DESCRIPTION="Linux Kernel Crash Dumps (LKCD) Utilities"
+HOMEPAGE="http://lkcd.sourceforge.net/ http://oss.software.ibm.com/developerworks/opensource/linux390/june2003_recommended.shtml"
+SRC_URI="http://lkcd.sourceforge.net/download/OLD/4.1.1/lkcdutils/lkcdutils-4.1-1.src.rpm
+ mirror://gentoo/lkcdutils-4.1-savedump.tar.gz
+ mirror://gentoo/lkcdutils-4.1-dhv8.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="s390"
+IUSE=""
+
+DEPEND="app-arch/rpm2targz
+ dev-util/byacc"
+RDEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ ebegin "Unpacking lkcd distribution..."
+ # This is the same as using rpm2targz then extracting 'cept that
+ # it's faster, less work, and less hard disk space. rpmoffset is
+ # provided by the rpm2targz package.
+ i="${DISTDIR}/${PN}-4.1-1.src.rpm"
+ dd ibs=`rpmoffset < ${i}` skip=1 if=$i 2>/dev/null \
+ | gzip -dc | cpio -idmu 2>/dev/null && tar xzf ${PN}-4.1-1.tar.gz
+ eend ${?}
+ assert "Failed to extract lkcd distribution..."
+
+ unpack lkcdutils-4.1-savedump.tar.gz
+ unpack lkcdutils-4.1-dhv8.tar.gz
+ cd "${S}"
+ epatch ../lkcdutils-4.1-savedump.diff
+ epatch ../lkcdutils-4.1-dhv8.diff
+}
+
+src_compile() {
+ ./configure \
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --datadir=/usr/share \
+ --sysconfdir=/etc \
+ --bfd_version=2.14.90 || die "configure failed"
+
+ make || die "make failed"
+}
+
+src_install() {
+ make install ROOT="${D}" || die "install failed"
+ # not needed on s390
+ rm -rf "${D}"/usr/share/sial \
+ "${D}"/usr/lib/libsial.a \
+ "${D}"/usr/include/sial_api.h \
+ "${D}"/usr/include/lkcd/asm/lc_dis.h \
+ "${D}"/etc \
+ "${D}"/sbin/lkcd* \
+ "${D}"/usr/man/man/lkcd*
+ # broken configure script...
+ mv -f "${D}"/usr/man "${D}"/usr/share/man
+}
diff --git a/sys-apps/lkcdutils/lkcdutils-6.2.0.ebuild b/sys-apps/lkcdutils/lkcdutils-6.2.0.ebuild
new file mode 100644
index 000000000000..c61b909da01b
--- /dev/null
+++ b/sys-apps/lkcdutils/lkcdutils-6.2.0.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Linux Kernel Crash Dumps (LKCD) Utilities"
+HOMEPAGE="http://lkcd.sourceforge.net/"
+SRC_URI="mirror://sourceforge/lkcd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~s390"
+IUSE=""
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-build.patch
+}
+
+src_compile() {
+ ./configure \
+ --cflags="${CFLAGS} ${CPPFLAGS}" \
+ --lflags="${LDFLAGS}" \
+ || die
+ emake || die "make failed"
+}
+
+src_install() {
+ emake install ROOT="${D}" || die "install failed"
+ rm -r "${D}"/etc/sysconfig
+}
diff --git a/sys-apps/lkcdutils/metadata.xml b/sys-apps/lkcdutils/metadata.xml
new file mode 100644
index 000000000000..fc290a9782b3
--- /dev/null
+++ b/sys-apps/lkcdutils/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>s390</herd>
+ <maintainer>
+ <email>s390@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">lkcd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/lm_sensors/Manifest b/sys-apps/lm_sensors/Manifest
new file mode 100644
index 000000000000..f39831112d79
--- /dev/null
+++ b/sys-apps/lm_sensors/Manifest
@@ -0,0 +1,3 @@
+DIST lm_sensors-3.3.4.tar.bz2 172226 SHA256 b4608610cb5de4b24e3fe1ae357712e8633a8a929bbb42df5eecc4ccee6ba76d SHA512 a375f747a1687da0fe743d731893156f7983e001725c2d7cd284cefd3e8922deb3dfe542d3c901e3da8fff321633d64180a637d780b5e1bb3f1e9a254c16b7e6 WHIRLPOOL 4011264a56c36ffcfe28d357ceae1929fdf8a21c27bfaba928c9a7b48ef2b8422cd6650981a4c8f220900cc45526ca4bbfda9810b54db0efaf15cdaad4599838
+DIST lm_sensors-3.3.5.tar.bz2 173609 SHA256 5dae6a665e1150159a93743c4ff1943a7efe02cd9d3bb12c4805e7d7adcf4fcf SHA512 0874084c3dd40b93ed05e1955f76e35e78ac3ac2343341d8ab5412fd941ea300b3a4b1320bec3a5bfb07309e82f42cc5dac0a728cdfddac4053d4fdb96dc12e7 WHIRLPOOL f82d0d1a4b7647cf9076f16861024dd65fd97bd34a7498fcc06e851913f5b71805689d915b67a628b6cd7aea2b46225d64df8833550c785236311c9980ac8ed1
+DIST lm_sensors-3.4.0.tar.bz2 175802 SHA256 e0579016081a262dd23eafe1d22b41ebde78921e73a1dcef71e05e424340061f SHA512 993064bd14b855c1ae8c057e89313df5b3d5efe441fb2e8c3e508f42bb15658564df2563fac8fabbdb0d650dfdbc694037736c748d45cb9d85dfb8fb5a3d1ea9 WHIRLPOOL 82ed9b922a352702d974ea075222894c69a081da1fca9e026e3176266bb6a8911fd8fc0cd73f2d9ab3524cd30cfe2e688a015032829cf32d844592debaf9924d
diff --git a/sys-apps/lm_sensors/files/fancontrol-init.d-2 b/sys-apps/lm_sensors/files/fancontrol-init.d-2
new file mode 100644
index 000000000000..0474d12b3208
--- /dev/null
+++ b/sys-apps/lm_sensors/files/fancontrol-init.d-2
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONFIG=/etc/fancontrol
+
+depend() {
+ need localmount
+ use lm_sensors
+}
+
+command=/usr/sbin/fancontrol
+command_arguments="${CONFIG}"
+start_stop_daemon_args="--background"
+pidfile=/var/run/fancontrol.pid
+
+start_pre() {
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Configuration file ${CONFIG} not found"
+ return 1
+ fi
+}
diff --git a/sys-apps/lm_sensors/files/fancontrol.service b/sys-apps/lm_sensors/files/fancontrol.service
new file mode 100644
index 000000000000..c86b498f830c
--- /dev/null
+++ b/sys-apps/lm_sensors/files/fancontrol.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Fan control daemon
+
+[Service]
+PIDFile=/var/run/fancontrol.pid
+ExecStart=/usr/sbin/fancontrol
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/lm_sensors/files/lm_sensors-3-init.d b/sys-apps/lm_sensors/files/lm_sensors-3-init.d
new file mode 100644
index 000000000000..b33814f62665
--- /dev/null
+++ b/sys-apps/lm_sensors/files/lm_sensors-3-init.d
@@ -0,0 +1,105 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+checkconfig() {
+ if [ ! -f /etc/conf.d/lm_sensors ]; then
+ eerror "/etc/conf.d/lm_sensors does not exist, try running sensors-detect"
+ return 1
+ fi
+
+ if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then
+ if [ -z "${MODULE_0}" ]; then
+ eerror "MODULE_0 is not set in /etc/conf.d/lm_sensors, try running sensors-detect"
+ return 1
+ fi
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then
+ einfo "Loading lm_sensors modules..."
+
+ mount | grep sysfs >/dev/null 2>&1
+ if [ ${?} = 0 ]; then
+ if ! ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ); then
+ ebegin " Loading i2c-core"
+ modprobe i2c-core >/dev/null 2>&1
+ if [ ${?} != 0 ]; then
+ eerror " Could not load i2c-core!"
+ eend 1
+ fi
+ ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ) || return 1
+ eend 0
+ fi
+ elif ! [ -e /proc/sys/dev/sensors ]; then
+ ebegin " Loading i2c-proc"
+ modprobe i2c-proc >/dev/null 2>&1
+ if [ ${?} != 0 ]; then
+ eerror " Could not load i2c-proc!"
+ eend 1
+ fi
+ [ -e /proc/sys/dev/sensors ] || return 1
+ eend 0
+ fi
+
+ i=0
+ while true; do
+ module=`eval echo '$'MODULE_${i}`
+ module_args=`eval echo '$'MODULE_${i}_ARGS`
+ if [ -z "${module}" ]; then
+ break
+ fi
+ ebegin " Loading ${module}"
+ modprobe ${module} ${module_args} >/dev/null 2>&1
+ eend $?
+ i=$(($i+1))
+ done
+ fi
+
+ if [ "${INITSENSORS}" = "yes" ]; then
+ if ! [ -f /etc/sensors3.conf ]; then
+ eerror "/etc/sensors3.conf does not exist!"
+ return 1
+ fi
+
+ ebegin "Initializing sensors"
+ /usr/bin/sensors -s >/dev/null 2>&1
+ eend ${?}
+ fi
+}
+
+stop() {
+ checkconfig || return 1
+
+ if [ "${LOADMODULES}" = "yes" -a -f /proc/modules ]; then
+ einfo "Unloading lm_sensors modules..."
+
+ # find the highest possible MODULE_ number
+ i=0
+ while true; do
+ module=`eval echo '$'MODULE_${i}`
+ if [ -z "${module}" ] ; then
+ break
+ fi
+ i=$(($i+1))
+ done
+
+ while [ ${i} -gt 0 ]; do
+ i=$(($i-1))
+ module=`eval echo '$'MODULE_${i}`
+ ebegin " Unloading ${module}"
+ rmmod ${module} >/dev/null 2>&1
+ eend $?
+ done
+
+ if [ -e /proc/sys/dev/sensors ] ; then
+ ebegin " Unloading i2c-proc"
+ rmmod i2c-proc >/dev/null 2>&1
+ eend $?
+ fi
+ fi
+}
diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch
new file mode 100644
index 000000000000..58772f215614
--- /dev/null
+++ b/sys-apps/lm_sensors/files/lm_sensors-3.3.1-sensors-detect-gentoo.patch
@@ -0,0 +1,129 @@
+--- lm_sensors-3.3.1/prog/detect/sensors-detect
++++ lm_sensors-3.3.1/prog/detect/sensors-detect
+@@ -20,6 +20,9 @@
+ # MA 02110-1301 USA.
+ #
+
++# Gentoo specific modifications based on a patch from Rudo Thomas
++# <thomr9am@ss1000.ms.mff.cuni.cz>
++
+ require 5.004;
+
+ use strict;
+@@ -6471,26 +6474,33 @@
+ print MODPROBE_D $configfile;
+ close(MODPROBE_D);
+ } else {
++ print "\nIf you want to load the modules at startup, generate a config file\n",
++ "below and make sure lm_sensors gets started at boot time; e.g\n",
++ "\$ rc-update add lm_sensors default\n";
+ print "To make the sensors modules behave correctly, add these lines to\n".
+- "/etc/modprobe.conf:\n\n";
++ "/etc/modules.d/lm_sensors and run modules-update:\n\n";
+ print "#----cut here----\n".
+ $configfile.
+ "#----cut here----\n\n";
+ }
+ }
+
+- my $have_sysconfig = -d '/etc/sysconfig';
+- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
+- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
+- ($have_sysconfig ? 'YES/no' : 'yes/NO');
+- $_ = <STDIN>;
+- if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
+- unless ($have_sysconfig) {
+- mkdir('/etc/sysconfig', 0777)
+- or die "Sorry, can't create /etc/sysconfig ($!)";
++ my $have_config = -f '/etc/conf.d/lm_sensors';
++ print "\nDo you want to ".($have_config?"overwrite":"generate").
++ " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n",
++ " (".($have_config?"yes/NO":"YES/no")."/s): ";
++ my $reply = <STDIN>;
++
++ if (($have_config and $reply =~ /^\s*[Yy]/) or
++ (not $have_config and not $reply =~ /^\s*[Nn]/) or
++ $reply =~ /^\s*[Ss]/) {
++ my $filename = "/etc/conf.d/lm_sensors";
++ if ($reply =~ /^\s*[Ss]/) {
++ print "Specify the file to store the configuration to: ";
++ $filename = <STDIN>;
+ }
+- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
+- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
++ open(local *SYSCONFIG, ">".$filename)
++ or die "Sorry, can't create $filename ($!).";
+ print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
+ print SYSCONFIG <<'EOT';
+ # This file is sourced by /etc/init.d/lm_sensors and defines the modules to
+@@ -6501,6 +6511,11 @@
+ # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
+
+ EOT
++ print SYSCONFIG
++ "# Load modules at startup\n".
++ "LOADMODULES=yes\n\n".
++ "# Initialize sensors at startup\n".
++ "INITSENSORS=yes\n\n";
+ print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n"
+ if @{$bus_modules};
+ print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n";
+@@ -6509,6 +6524,10 @@
+
+ # For compatibility reasons, modules are also listed individually as variables
+ # MODULE_0, MODULE_1, MODULE_2, etc.
++# Please note that the numbers in MODULE_X must start at 0 and increase in
++# steps of 1. Any number that is missing will make the init script skip the
++# rest of the modules. Use MODULE_X_ARGS for arguments.
++#
+ # You should use BUS_MODULES and HWMON_MODULES instead if possible.
+
+ EOT
+@@ -6519,25 +6538,7 @@
+ }
+ close(SYSCONFIG);
+
+- if (-x "/bin/systemctl" && -d "/lib/systemd/system" &&
+- ! -f "/lib/systemd/system/lm_sensors.service") {
+- print "Copy prog/init/lm_sensors.service to /lib/systemd/system\n".
+- "and run 'systemctl enable lm_sensors.service'\n".
+- "for initialization at boot time.\n";
+- return;
+- }
+-
+- if (-x "/bin/systemctl" &&
+- -f "/lib/systemd/system/lm_sensors.service") {
+- system("/bin/systemctl", "enable", "lm_sensors.service");
+- system("/bin/systemctl", "start", "lm_sensors.service");
+- # All done, don't check for /etc/init.d/lm_sensors
+- return;
+- }
+-
+- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n".
+- "for initialization at boot time.\n"
+- unless -f "/etc/init.d/lm_sensors";
++ print "Done.\n";
+
+ if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") {
+ system("/sbin/insserv", "/etc/init.d/lm_sensors");
+@@ -6551,20 +6552,6 @@
+ "kernel modules.\n\n";
+ }
+ } else {
+- print "To load everything that is needed, add this to one of the system\n".
+- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n";
+- print "#----cut here----\n";
+- if (@{$bus_modules}) {
+- print "# Adapter drivers\n";
+- print "modprobe $_\n" foreach (@{$bus_modules});
+- }
+- print "# Chip drivers\n";
+- print "modprobe $_\n" foreach (@{$hwmon_modules});
+- print((-e '/usr/bin/sensors' ?
+- "/usr/bin/sensors -s\n" :
+- "/usr/local/bin/sensors -s\n").
+- "#----cut here----\n\n");
+-
+ print "If you have some drivers built into your kernel, the list above will\n".
+ "contain too many modules. Skip the appropriate ones! You really\n".
+ "should try these commands right now to make sure everything is\n".
diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch
new file mode 100644
index 000000000000..215969af2cb6
--- /dev/null
+++ b/sys-apps/lm_sensors/files/lm_sensors-3.3.4-sensors-detect-gentoo.patch
@@ -0,0 +1,118 @@
+diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
+index fb17481..bb324c2 100755
+--- a/prog/detect/sensors-detect
++++ b/prog/detect/sensors-detect
+@@ -20,6 +20,9 @@
+ # MA 02110-1301 USA.
+ #
+
++# Gentoo specific modifications based on a patch from Rudo Thomas
++# <thomr9am@ss1000.ms.mff.cuni.cz>
++
+ require 5.004;
+
+ use strict;
+@@ -6671,26 +6674,33 @@ sub write_config
+ print MODPROBE_D $configfile;
+ close(MODPROBE_D);
+ } else {
++ print "\nIf you want to load the modules at startup, generate a config file\n",
++ "below and make sure lm_sensors gets started at boot time; e.g\n",
++ "\$ rc-update add lm_sensors default\n";
+ print "To make the sensors modules behave correctly, add these lines to\n".
+- "/etc/modprobe.conf:\n\n";
++ "/etc/modules.d/lm_sensors and run modules-update:\n\n";
+ print "#----cut here----\n".
+ $configfile.
+ "#----cut here----\n\n";
+ }
+ }
+
+- my $have_sysconfig = -d '/etc/sysconfig';
+- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
+- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
+- ($have_sysconfig ? 'YES/no' : 'yes/NO');
+- $_ = <STDIN>;
+- if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
+- unless ($have_sysconfig) {
+- mkdir('/etc/sysconfig', 0777)
+- or die "Sorry, can't create /etc/sysconfig ($!)";
++ my $have_config = -f '/etc/conf.d/lm_sensors';
++ print "\nDo you want to ".($have_config?"overwrite":"generate").
++ " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n",
++ " (".($have_config?"yes/NO":"YES/no")."/s): ";
++ my $reply = <STDIN>;
++
++ if (($have_config and $reply =~ /^\s*[Yy]/) or
++ (not $have_config and not $reply =~ /^\s*[Nn]/) or
++ $reply =~ /^\s*[Ss]/) {
++ my $filename = "/etc/conf.d/lm_sensors";
++ if ($reply =~ /^\s*[Ss]/) {
++ print "Specify the file to store the configuration to: ";
++ $filename = <STDIN>;
+ }
+- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
+- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
++ open(local *SYSCONFIG, ">".$filename)
++ or die "Sorry, can't create $filename ($!).";
+ print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
+ print SYSCONFIG <<'EOT';
+ # This file is sourced by /etc/init.d/lm_sensors and defines the modules to
+@@ -6701,30 +6711,17 @@ sub write_config
+ # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
+
+ EOT
++ print SYSCONFIG
++ "# Load modules at startup\n".
++ "LOADMODULES=yes\n\n".
++ "# Initialize sensors at startup\n".
++ "INITSENSORS=yes\n\n";
+ print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n"
+ if @{$bus_modules};
+ print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n";
+ close(SYSCONFIG);
+
+- if (-x "/bin/systemctl" && -d "/lib/systemd/system" &&
+- ! -f "/lib/systemd/system/lm_sensors.service") {
+- print "Copy prog/init/lm_sensors.service to /lib/systemd/system\n".
+- "and run 'systemctl enable lm_sensors.service'\n".
+- "for initialization at boot time.\n";
+- return;
+- }
+-
+- if (-x "/bin/systemctl" &&
+- -f "/lib/systemd/system/lm_sensors.service") {
+- system("/bin/systemctl", "enable", "lm_sensors.service");
+- system("/bin/systemctl", "start", "lm_sensors.service");
+- # All done, don't check for /etc/init.d/lm_sensors
+- return;
+- }
+-
+- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n".
+- "for initialization at boot time.\n"
+- unless -f "/etc/init.d/lm_sensors";
++ print "Done.\n";
+
+ if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") {
+ system("/sbin/insserv", "/etc/init.d/lm_sensors");
+@@ -6738,20 +6735,6 @@ EOT
+ "kernel modules.\n\n";
+ }
+ } else {
+- print "To load everything that is needed, add this to one of the system\n".
+- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n";
+- print "#----cut here----\n";
+- if (@{$bus_modules}) {
+- print "# Adapter drivers\n";
+- print "modprobe $_\n" foreach (@{$bus_modules});
+- }
+- print "# Chip drivers\n";
+- print "modprobe $_\n" foreach (@{$hwmon_modules});
+- print((-e '/usr/bin/sensors' ?
+- "/usr/bin/sensors -s\n" :
+- "/usr/local/bin/sensors -s\n").
+- "#----cut here----\n\n");
+-
+ print "If you have some drivers built into your kernel, the list above will\n".
+ "contain too many modules. Skip the appropriate ones! You really\n".
+ "should try these commands right now to make sure everything is\n".
diff --git a/sys-apps/lm_sensors/files/lm_sensors-3.3.5-sensors-detect-gentoo.patch b/sys-apps/lm_sensors/files/lm_sensors-3.3.5-sensors-detect-gentoo.patch
new file mode 100644
index 000000000000..0ea9a02b3f9a
--- /dev/null
+++ b/sys-apps/lm_sensors/files/lm_sensors-3.3.5-sensors-detect-gentoo.patch
@@ -0,0 +1,120 @@
+--- lm_sensors-3.3.5/prog/detect/sensors-detect
++++ lm_sensors-3.3.5/prog/detect/sensors-detect
+@@ -20,6 +20,9 @@
+ # MA 02110-1301 USA.
+ #
+
++# Gentoo specific modifications based on a patch from Rudo Thomas
++# <thomr9am@ss1000.ms.mff.cuni.cz>
++
+ require 5.004;
+
+ use strict;
+@@ -6762,26 +6765,33 @@
+ print MODPROBE_D $configfile;
+ close(MODPROBE_D);
+ } else {
++ print "\nIf you want to load the modules at startup, generate a config file\n",
++ "below and make sure lm_sensors gets started at boot time; e.g\n",
++ "\$ rc-update add lm_sensors default\n";
+ print "To make the sensors modules behave correctly, add these lines to\n".
+- "/etc/modprobe.conf:\n\n";
++ "/etc/modules.d/lm_sensors and run modules-update:\n\n";
+ print "#----cut here----\n".
+ $configfile.
+ "#----cut here----\n\n";
+ }
+ }
+
+- my $have_sysconfig = -d '/etc/sysconfig';
+- printf "Do you want to \%s /etc/sysconfig/lm_sensors? (\%s): ",
+- (-e '/etc/sysconfig/lm_sensors' ? 'overwrite' : 'generate'),
+- ($have_sysconfig ? 'YES/no' : 'yes/NO');
+- $_ = read_answer();
+- if (($have_sysconfig and not m/^\s*n/i) or m/^\s*y/i) {
+- unless ($have_sysconfig) {
+- mkdir('/etc/sysconfig', 0777)
+- or die "Sorry, can't create /etc/sysconfig ($!)";
++ my $have_sysconfig = -f '/etc/conf.d/lm_sensors';
++ printf "Do you want to ".($have_sysconfig?"overwrite":"generate").
++ " /etc/conf.d/lm_sensors? Enter s to specify other file name?\n",
++ " (".($have_sysconfig?"yes/NO":"YES/no")."/s): ";
++ my $reply = read_answer();
++
++ if (($have_sysconfig and $reply =~ /^\s*[Yy]/) or
++ (not $have_sysconfig and not $reply =~ /^\s*[Nn]/) or
++ $reply =~ /^\s*[Ss]/) {
++ my $filename = "/etc/conf.d/lm_sensors";
++ if ($reply =~ /^\s*[Ss]/) {
++ print "Specify the file to store the configuration to: ";
++ $filename = read_answer();
+ }
+- open(local *SYSCONFIG, ">/etc/sysconfig/lm_sensors")
+- or die "Sorry, can't create /etc/sysconfig/lm_sensors ($!)";
++ open(local *SYSCONFIG, ">".$filename)
++ or die "Sorry, can't create $filename ($!).";
+ print SYSCONFIG "# Generated by sensors-detect on " . scalar localtime() . "\n";
+ print SYSCONFIG <<'EOT';
+ # This file is sourced by /etc/init.d/lm_sensors and defines the modules to
+@@ -6792,30 +6802,17 @@
+ # BUS_MODULES for any required bus driver module (for example for I2C or SPI).
+
+ EOT
++ print SYSCONFIG
++ "# Load modules at startup\n".
++ "LOADMODULES=yes\n\n".
++ "# Initialize sensors at startup\n".
++ "INITSENSORS=yes\n\n";
+ print SYSCONFIG "BUS_MODULES=\"", join(" ", @{$bus_modules}), "\"\n"
+ if @{$bus_modules};
+ print SYSCONFIG "HWMON_MODULES=\"", join(" ", @{$hwmon_modules}), "\"\n";
+ close(SYSCONFIG);
+
+- if (-x "/bin/systemctl" && -d "/lib/systemd/system" &&
+- ! -f "/lib/systemd/system/lm_sensors.service") {
+- print "Copy prog/init/lm_sensors.service to /lib/systemd/system\n".
+- "and run 'systemctl enable lm_sensors.service'\n".
+- "for initialization at boot time.\n";
+- return;
+- }
+-
+- if (-x "/bin/systemctl" &&
+- -f "/lib/systemd/system/lm_sensors.service") {
+- system("/bin/systemctl", "enable", "lm_sensors.service");
+- system("/bin/systemctl", "start", "lm_sensors.service");
+- # All done, don't check for /etc/init.d/lm_sensors
+- return;
+- }
+-
+- print "Copy prog/init/lm_sensors.init to /etc/init.d/lm_sensors\n".
+- "for initialization at boot time.\n"
+- unless -f "/etc/init.d/lm_sensors";
++ print "Done.\n";
+
+ if (-x "/sbin/insserv" && -f "/etc/init.d/lm_sensors") {
+ system("/sbin/insserv", "/etc/init.d/lm_sensors");
+@@ -6828,24 +6825,6 @@
+ print "You should now start the lm_sensors service to load the required\n".
+ "kernel modules.\n\n";
+ }
+- } else {
+- print "To load everything that is needed, add this to one of the system\n".
+- "initialization scripts (e.g. /etc/rc.d/rc.local):\n\n";
+- print "#----cut here----\n";
+- if (@{$bus_modules}) {
+- print "# Adapter drivers\n";
+- print "modprobe $_\n" foreach (@{$bus_modules});
+- }
+- print "# Chip drivers\n";
+- print "modprobe $_\n" foreach (@{$hwmon_modules});
+- print((-e '/usr/bin/sensors' ?
+- "/usr/bin/sensors -s\n" :
+- "/usr/local/bin/sensors -s\n").
+- "#----cut here----\n\n");
+-
+- print "You really should try these commands right now to make sure everything\n".
+- "is working properly. Monitoring programs won't work until the needed\n".
+- "modules are loaded.\n\n";
+ }
+ }
+
diff --git a/sys-apps/lm_sensors/files/sensord-4-init.d b/sys-apps/lm_sensors/files/sensord-4-init.d
new file mode 100644
index 000000000000..3734dfede1d9
--- /dev/null
+++ b/sys-apps/lm_sensors/files/sensord-4-init.d
@@ -0,0 +1,22 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONFIG=/etc/sensors3.conf
+
+depend() {
+ need localmount
+ use logger lm_sensors
+}
+
+pidfile=/run/sensord.pid
+command=/usr/sbin/sensord
+command_args="--config-file ${CONFIG} ${SENSORD_OPTIONS} --pid-file ${pidfile}"
+
+start_pre() {
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Configuration file ${CONFIG} not found"
+ return 1
+ fi
+}
diff --git a/sys-apps/lm_sensors/files/sensord-conf.d b/sys-apps/lm_sensors/files/sensord-conf.d
new file mode 100644
index 000000000000..d82841aebd4a
--- /dev/null
+++ b/sys-apps/lm_sensors/files/sensord-conf.d
@@ -0,0 +1,3 @@
+# Extra options to pass to the sensord daemon,
+# see sensord(8) for more information
+SENSORD_OPTIONS=""
diff --git a/sys-apps/lm_sensors/files/sensord.service b/sys-apps/lm_sensors/files/sensord.service
new file mode 100644
index 000000000000..6d272f1efd15
--- /dev/null
+++ b/sys-apps/lm_sensors/files/sensord.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Sensor information logging daemon
+
+[Service]
+PIDFile=/var/run/sensord.pid
+ExecStart=/usr/sbin/sensord
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild b/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild
new file mode 100644
index 000000000000..52ffdff31243
--- /dev/null
+++ b/sys-apps/lm_sensors/lm_sensors-3.3.4-r1.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info multilib systemd toolchain-funcs
+
+DESCRIPTION="Hardware Monitoring user-space utilities"
+HOMEPAGE="http://www.lm-sensors.org/"
+SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~mips ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="sensord static-libs"
+
+RDEPEND="
+ dev-lang/perl
+ sensord? (
+ net-analyzer/rrdtool
+ virtual/logger
+ )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex"
+
+CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C"
+WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use."
+WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled."
+WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors."
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-sensors-detect-gentoo.patch
+
+ use sensord && { sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' Makefile || die; }
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die
+
+ # Fix shipped unit file paths
+ sed -i -e 's:\(^EnvironmentFile=\).*:\1/etc/conf.d/lm_sensors:' \
+ prog/init/lm_sensors.service || die
+
+ use static-libs || { sed -i -e '/^BUILD_STATIC_LIB/d' Makefile || die; }
+}
+
+src_compile() {
+ einfo
+ einfo "You may safely ignore any errors from compilation"
+ einfo "that contain \"No such file or directory\" references."
+ einfo
+
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ MANDIR="${EPREFIX}/usr/share/man" \
+ ETCDIR="${EPREFIX}/etc" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+
+ newinitd "${FILESDIR}"/${PN}-3-init.d ${PN}
+ systemd_dounit prog/init/lm_sensors.service
+
+ newinitd "${FILESDIR}"/fancontrol-init.d-2 fancontrol
+ systemd_dounit "${FILESDIR}"/fancontrol.service
+
+ if use sensord; then
+ newconfd "${FILESDIR}"/sensord-conf.d sensord
+ newinitd "${FILESDIR}"/sensord-4-init.d sensord
+ systemd_dounit "${FILESDIR}"/sensord.service
+ fi
+
+ dodoc CHANGES CONTRIBUTORS INSTALL README \
+ doc/{donations,fancontrol.txt,fan-divisors,libsensors-API.txt,progs,temperature-sensors,vid}
+
+ docinto developers
+ dodoc doc/developers/applications
+}
+
+pkg_postinst() {
+ echo
+ elog "Please run \`/usr/sbin/sensors-detect' in order to setup"
+ elog "/etc/conf.d/${PN}."
+ echo
+ elog "/etc/conf.d/${PN} is vital to the init-script."
+ elog "Please make sure you also add ${PN} to the desired"
+ elog "runlevel. Otherwise your I2C modules won't get loaded"
+ elog "on the next startup."
+ echo
+ elog "You will also need to run the above command if you're upgrading from"
+ elog "<=${PN}-2, as the needed entries in /etc/conf.d/${PN} has"
+ elog "changed."
+ echo
+ elog "Be warned, the probing of hardware in your system performed by"
+ elog "sensors-detect could freeze your system. Also make sure you read"
+ elog "the documentation before running ${PN} on IBM ThinkPads."
+ echo
+ elog "Also make sure you have read:"
+ elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31"
+ echo
+ elog "Please refer to the ${PN} documentation for more information."
+ elog "(http://www.lm-sensors.org/wiki/Documentation)"
+ echo
+}
diff --git a/sys-apps/lm_sensors/lm_sensors-3.3.5.ebuild b/sys-apps/lm_sensors/lm_sensors-3.3.5.ebuild
new file mode 100644
index 000000000000..8c69ed406394
--- /dev/null
+++ b/sys-apps/lm_sensors/lm_sensors-3.3.5.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info multilib systemd toolchain-funcs
+
+DESCRIPTION="Hardware Monitoring user-space utilities"
+HOMEPAGE="http://www.lm-sensors.org/"
+SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha ~amd64 arm ~mips ~ppc ~ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="sensord static-libs"
+
+RDEPEND="
+ dev-lang/perl
+ sensord? (
+ net-analyzer/rrdtool
+ virtual/logger
+ )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex"
+
+CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C"
+WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use."
+WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled."
+WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors."
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-sensors-detect-gentoo.patch
+
+ use sensord && { sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' Makefile || die; }
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die
+
+ # Fix shipped unit file paths
+ sed -i -e 's:\(^EnvironmentFile=\).*:\1/etc/conf.d/lm_sensors:' \
+ prog/init/lm_sensors.service || die
+
+ use static-libs || { sed -i -e '/^BUILD_STATIC_LIB/d' Makefile || die; }
+}
+
+src_compile() {
+ einfo
+ einfo "You may safely ignore any errors from compilation"
+ einfo "that contain \"No such file or directory\" references."
+ einfo
+
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ MANDIR="${EPREFIX}/usr/share/man" \
+ ETCDIR="${EPREFIX}/etc" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+
+ newinitd "${FILESDIR}"/${PN}-3-init.d ${PN}
+ systemd_dounit prog/init/lm_sensors.service
+
+ newinitd "${FILESDIR}"/fancontrol-init.d-2 fancontrol
+ systemd_dounit "${FILESDIR}"/fancontrol.service
+
+ if use sensord; then
+ newconfd "${FILESDIR}"/sensord-conf.d sensord
+ newinitd "${FILESDIR}"/sensord-4-init.d sensord
+ systemd_dounit "${FILESDIR}"/sensord.service
+ fi
+
+ dodoc CHANGES CONTRIBUTORS INSTALL README \
+ doc/{donations,fancontrol.txt,fan-divisors,libsensors-API.txt,progs,temperature-sensors,vid}
+
+ docinto developers
+ dodoc doc/developers/applications
+}
+
+pkg_postinst() {
+ echo
+ elog "Please run \`/usr/sbin/sensors-detect' in order to setup"
+ elog "/etc/conf.d/${PN}."
+ echo
+ elog "/etc/conf.d/${PN} is vital to the init-script."
+ elog "Please make sure you also add ${PN} to the desired"
+ elog "runlevel. Otherwise your I2C modules won't get loaded"
+ elog "on the next startup."
+ echo
+ elog "You will also need to run the above command if you're upgrading from"
+ elog "<=${PN}-2, as the needed entries in /etc/conf.d/${PN} has"
+ elog "changed."
+ echo
+ elog "Be warned, the probing of hardware in your system performed by"
+ elog "sensors-detect could freeze your system. Also make sure you read"
+ elog "the documentation before running ${PN} on IBM ThinkPads."
+ echo
+ elog "Also make sure you have read:"
+ elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31"
+ echo
+ elog "Please refer to the ${PN} documentation for more information."
+ elog "(http://www.lm-sensors.org/wiki/Documentation)"
+ echo
+}
diff --git a/sys-apps/lm_sensors/lm_sensors-3.4.0.ebuild b/sys-apps/lm_sensors/lm_sensors-3.4.0.ebuild
new file mode 100644
index 000000000000..0752370fe836
--- /dev/null
+++ b/sys-apps/lm_sensors/lm_sensors-3.4.0.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils linux-info multilib systemd toolchain-funcs
+
+DESCRIPTION="Hardware Monitoring user-space utilities"
+HOMEPAGE="http://www.lm-sensors.org/"
+SRC_URI="http://dl.lm-sensors.org/lm-sensors/releases/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="sensord static-libs"
+
+RDEPEND="
+ dev-lang/perl
+ sensord? (
+ net-analyzer/rrdtool
+ virtual/logger
+ )"
+DEPEND="${RDEPEND}
+ sys-devel/bison
+ sys-devel/flex"
+
+CONFIG_CHECK="~HWMON ~I2C_CHARDEV ~I2C"
+WARNING_HWMON="${PN} requires CONFIG_HWMON to be enabled for use."
+WARNING_I2C_CHARDEV="sensors-detect requires CONFIG_I2C_CHARDEV to be enabled."
+WARNING_I2C="${PN} requires CONFIG_I2C to be enabled for most sensors."
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.3.5-sensors-detect-gentoo.patch
+
+ use sensord && { sed -i -e 's:^#\(PROG_EXTRA.*\):\1:' Makefile || die; }
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile || die
+
+ # Fix shipped unit file paths
+ sed -i -e 's:\(^EnvironmentFile=\).*:\1/etc/conf.d/lm_sensors:' \
+ prog/init/lm_sensors.service || die
+
+ use static-libs || { sed -i -e '/^BUILD_STATIC_LIB/d' Makefile || die; }
+}
+
+src_compile() {
+ einfo
+ einfo "You may safely ignore any errors from compilation"
+ einfo "that contain \"No such file or directory\" references."
+ einfo
+
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ MANDIR="${EPREFIX}/usr/share/man" \
+ ETCDIR="${EPREFIX}/etc" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+ install
+
+ newinitd "${FILESDIR}"/${PN}-3-init.d ${PN}
+ systemd_dounit prog/init/lm_sensors.service
+
+ newinitd "${FILESDIR}"/fancontrol-init.d-2 fancontrol
+ systemd_dounit "${FILESDIR}"/fancontrol.service
+
+ if use sensord; then
+ newconfd "${FILESDIR}"/sensord-conf.d sensord
+ newinitd "${FILESDIR}"/sensord-4-init.d sensord
+ systemd_dounit "${FILESDIR}"/sensord.service
+ fi
+
+ dodoc CHANGES CONTRIBUTORS INSTALL README \
+ doc/{donations,fancontrol.txt,fan-divisors,libsensors-API.txt,progs,temperature-sensors,vid}
+
+ docinto developers
+ dodoc doc/developers/applications
+}
+
+pkg_postinst() {
+ echo
+ elog "Please run \`/usr/sbin/sensors-detect' in order to setup"
+ elog "/etc/conf.d/${PN}."
+ echo
+ elog "/etc/conf.d/${PN} is vital to the init-script."
+ elog "Please make sure you also add ${PN} to the desired"
+ elog "runlevel. Otherwise your I2C modules won't get loaded"
+ elog "on the next startup."
+ echo
+ elog "You will also need to run the above command if you're upgrading from"
+ elog "<=${PN}-2, as the needed entries in /etc/conf.d/${PN} has"
+ elog "changed."
+ echo
+ elog "Be warned, the probing of hardware in your system performed by"
+ elog "sensors-detect could freeze your system. Also make sure you read"
+ elog "the documentation before running ${PN} on IBM ThinkPads."
+ echo
+ elog "Also make sure you have read:"
+ elog "http://www.lm-sensors.org/wiki/FAQ/Chapter3#Mysensorshavestoppedworkinginkernel2.6.31"
+ echo
+ elog "Please refer to the ${PN} documentation for more information."
+ elog "(http://www.lm-sensors.org/wiki/Documentation)"
+ echo
+}
diff --git a/sys-apps/lm_sensors/metadata.xml b/sys-apps/lm_sensors/metadata.xml
new file mode 100644
index 000000000000..4e32df6e6234
--- /dev/null
+++ b/sys-apps/lm_sensors/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>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <use>
+ <flag name="sensord">Enable sensord - a daemon that can be used to
+ periodically log sensor readings from hardware health-monitoring
+ chips</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/lmctfy/Manifest b/sys-apps/lmctfy/Manifest
new file mode 100644
index 000000000000..c252b93cd7c5
--- /dev/null
+++ b/sys-apps/lmctfy/Manifest
@@ -0,0 +1,4 @@
+DIST lmctfy-0.2.0.tar.gz 2291473 SHA256 b99310179ca36397074ca4719d8611a5cd567db967641214d365cefa95264f41 SHA512 533990025a9a88e2e2a467e571a80a5b057a0ef3523bfc71c155ad81e6a89463d1e1e094323d5dc875f1b86f4d2d2749819d10b8d6c781e06a93bd37747f12be WHIRLPOOL 5d3a71175dc02bc297ab8d7dfae599f70ea5185b815b6de96f21d466372f6c3c13306417a544127fd0b640f87ab5e460d8882e8c1623fa88d3f9d1a890cec836
+DIST lmctfy-0.3.0.tar.gz 2305226 SHA256 7b334456546b590d9298a3204b38ff91acc51409cc1fb2de0e92737faf017384 SHA512 9083af2d2b9ea34e6dbb911a24cf7b8a7fe5aa3a0f464d20115db86b5abac530d24122079f97ea2ef98bf4fb20a3980e598d89f38b570ba796665b0af08339d5 WHIRLPOOL 5371392de1eda88cd9b7f56f0bf032f3f3023201be43d15f4340092a756d1d6039537693ad3326666905ca91336dee251326e0fe5ab9bc4074783f0cd2e3fbce
+DIST lmctfy-0.3.1.tar.gz 2312481 SHA256 a04a52617501d8f486b34e64b34225dc8ef3c18c47ef92c870cd67879e6587b5 SHA512 ab9f2a065a49fae00b540c0592d9356022ba14e0f9dc681731e0757c259f3632a9b34b5fc629eaf2d0943d59e7747af06cfe59a64f447192e8c196a9d41b9522 WHIRLPOOL 40a3198aa7e03f46350ddec8fe7f20f1c8ced8929a10f23b7306967230df18977bb05c725f9817e1fe10e153ab61ac5c58b1ee13516fdc505d7f85ec562e5e53
+DIST lmctfy-0.5.0.tar.gz 2447650 SHA256 1afd0ea7cafe33eaccb6adc47223344a4e6b1d798e27b12a9ab0769918004d9c SHA512 638472b3e8cc98e7ff7ecc48eb0f58fb6a74600db22b7a1962ac3fe137d3549233f3f3b0c97f5783dff6f1851f9c3f9b0607fedea91cb23c1124ed8e2b54aea1 WHIRLPOOL 6f40f84679d3e17310b4678b444abd98ddcffd27a05a715d4590de37d40688292e5f5df5ad3ea8f2a310a1dd5d88ceb0627b88190d07e1aea48c0bae24820843
diff --git a/sys-apps/lmctfy/lmctfy-0.2.0.ebuild b/sys-apps/lmctfy/lmctfy-0.2.0.ebuild
new file mode 100644
index 000000000000..ff7801d21d50
--- /dev/null
+++ b/sys-apps/lmctfy/lmctfy-0.2.0.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Linux application container management from Google"
+HOMEPAGE="https://github.com/google/lmctfy"
+SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND="
+ dev-libs/protobuf
+ dev-cpp/gflags
+ dev-libs/re2
+ "
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ # test deps take too long to compile
+ use test && emake || emake lmctfy liblmctfy.a
+}
+
+src_install() {
+ # silly upstream!
+ mkdir -p "${D}/usr/bin"
+ cp "${S}/bin/lmctfy/cli/lmctfy" "${D}/usr/bin/" || die "Failed to copy cli binary"
+ dolib.a "${S}/bin/liblmctfy.a" || die "Failed to copy library"
+}
diff --git a/sys-apps/lmctfy/lmctfy-0.3.0.ebuild b/sys-apps/lmctfy/lmctfy-0.3.0.ebuild
new file mode 100644
index 000000000000..556ae0e9da2e
--- /dev/null
+++ b/sys-apps/lmctfy/lmctfy-0.3.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 eutils
+
+DESCRIPTION="Linux application container management from Google"
+HOMEPAGE="https://github.com/google/lmctfy"
+SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND="
+ dev-libs/protobuf
+ dev-cpp/gflags
+ dev-libs/re2
+ "
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ # test deps take too long to compile
+ use test && emake || emake lmctfy liblmctfy.a
+}
+
+src_install() {
+ # silly upstream!
+ mkdir -p "${D}/usr/bin"
+ cp "${S}/bin/lmctfy/cli/lmctfy" "${D}/usr/bin/" || die "Failed to copy cli binary"
+ dolib.a "${S}/bin/liblmctfy.a" || die "Failed to copy library"
+}
diff --git a/sys-apps/lmctfy/lmctfy-0.3.1.ebuild b/sys-apps/lmctfy/lmctfy-0.3.1.ebuild
new file mode 100644
index 000000000000..556ae0e9da2e
--- /dev/null
+++ b/sys-apps/lmctfy/lmctfy-0.3.1.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 eutils
+
+DESCRIPTION="Linux application container management from Google"
+HOMEPAGE="https://github.com/google/lmctfy"
+SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="Apache-2.0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND="
+ dev-libs/protobuf
+ dev-cpp/gflags
+ dev-libs/re2
+ "
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ # test deps take too long to compile
+ use test && emake || emake lmctfy liblmctfy.a
+}
+
+src_install() {
+ # silly upstream!
+ mkdir -p "${D}/usr/bin"
+ cp "${S}/bin/lmctfy/cli/lmctfy" "${D}/usr/bin/" || die "Failed to copy cli binary"
+ dolib.a "${S}/bin/liblmctfy.a" || die "Failed to copy library"
+}
diff --git a/sys-apps/lmctfy/lmctfy-0.5.0-r1.ebuild b/sys-apps/lmctfy/lmctfy-0.5.0-r1.ebuild
new file mode 100644
index 000000000000..4a81c9039372
--- /dev/null
+++ b/sys-apps/lmctfy/lmctfy-0.5.0-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
+
+inherit eutils
+
+DESCRIPTION="Linux application container management from Google"
+HOMEPAGE="https://github.com/google/lmctfy"
+SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+COMMON_DEPEND="
+ dev-libs/protobuf
+ >=dev-cpp/gflags-2.1.1
+ dev-libs/re2
+ sys-libs/libapparmor
+ "
+DEPEND="
+ ${COMMON_DEPEND}
+ dev-lang/go:=
+ "
+RDEPEND="${COMMON_DEPEND}"
+
+src_compile() {
+ # test deps take too long to compile
+ use test && emake || emake lmctfy liblmctfy.a
+}
+
+src_install() {
+ dobin bin/lmctfy/cli/lmctfy
+ dolib.a bin/liblmctfy.a
+}
diff --git a/sys-apps/lmctfy/lmctfy-0.5.0.ebuild b/sys-apps/lmctfy/lmctfy-0.5.0.ebuild
new file mode 100644
index 000000000000..4e390ac4313f
--- /dev/null
+++ b/sys-apps/lmctfy/lmctfy-0.5.0.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Linux application container management from Google"
+HOMEPAGE="https://github.com/google/lmctfy"
+SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+DEPEND="
+ dev-libs/protobuf
+ >=dev-cpp/gflags-2.1.1
+ dev-libs/re2
+ dev-lang/go
+ sys-libs/libapparmor
+ "
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ # test deps take too long to compile
+ use test && emake || emake lmctfy liblmctfy.a
+}
+
+src_install() {
+ dobin bin/lmctfy/cli/lmctfy
+ dolib.a bin/liblmctfy.a
+}
diff --git a/sys-apps/lmctfy/metadata.xml b/sys-apps/lmctfy/metadata.xml
new file mode 100644
index 000000000000..56dba6227128
--- /dev/null
+++ b/sys-apps/lmctfy/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>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">google/lmctfy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/lnxhc/Manifest b/sys-apps/lnxhc/Manifest
new file mode 100644
index 000000000000..285a611415e8
--- /dev/null
+++ b/sys-apps/lnxhc/Manifest
@@ -0,0 +1 @@
+DIST lnxhc-1.2.tar.gz 360869 SHA256 a94a748171b812528567a0f7a3c19f048a57463cb0fddb9e152b38e2ed8a66c0 SHA512 200ab6443c3b8f4dd99928d2f18b31e8e05c1f9c1f976052017a643430ed87fa08a399e9e8430eafb2925126bd2d90fc4f65ce1c220d6100b71c31fc0505aab0 WHIRLPOOL aa0b7f1f86bae2fce4da3db40dc97c525fb1d94b86298142675d64654676be391487c33612fb8018cae5b5bb1cedd610696092f8ef1944e4ce446f50bdcddef4
diff --git a/sys-apps/lnxhc/files/lnxhc-1.2-ifconfig-path.patch b/sys-apps/lnxhc/files/lnxhc-1.2-ifconfig-path.patch
new file mode 100644
index 000000000000..89e184704857
--- /dev/null
+++ b/sys-apps/lnxhc/files/lnxhc-1.2-ifconfig-path.patch
@@ -0,0 +1,23 @@
+--- lnxhc-1.2/checks/net_hsi_outbound_errors/definitions
++++ lnxhc-1.2-patched/checks/net_hsi_outbound_errors/definitions
+@@ -9,7 +9,7 @@
+ default = "1"
+
+ [sysinfo ifconfig]
+-program = "/sbin/ifconfig"
++program = "/bin/ifconfig"
+
+ [exception slow_hsi_receivers]
+ severity = medium
+
+--- lnxhc-1.2/checks/net_inbound_errors/definitions 2013-02-06 04:08:55.000000000 -0500
++++ lnxhc-1.2-patched/checks/net_inbound_errors/definitions 2013-05-22 17:13:56.088787813 -0400
+@@ -11,7 +11,7 @@
+ # The above value in percentage
+
+ [sysinfo ifconfig]
+-program = "/sbin/ifconfig"
++program = "/bin/ifconfig"
+
+ [exception limits_exceeded]
+ severity = medium
diff --git a/sys-apps/lnxhc/files/lnxhc-1.2-usrlocal.patch b/sys-apps/lnxhc/files/lnxhc-1.2-usrlocal.patch
new file mode 100644
index 000000000000..fe237502785f
--- /dev/null
+++ b/sys-apps/lnxhc/files/lnxhc-1.2-usrlocal.patch
@@ -0,0 +1,43 @@
+diff -ruN lnxhc-1.2/Makefile lnxhc-1.2-patched/Makefile
+--- lnxhc-1.2/Makefile 2013-02-06 04:14:17.000000000 -0500
++++ lnxhc-1.2-patched/Makefile 2013-02-09 13:39:25.096883794 -0500
+@@ -71,7 +71,6 @@
+ pycheckdir := $(libdir)/python/check
+ exampledir := $(docdir)/examples
+ dbdir1 := $(libdir)
+-dbdir2 := /usr/local/lib/lnxhc
+
+ # Base files
+ binfiles := $(wildcard bin/*)
+@@ -154,7 +153,7 @@
+ $(DESTDIR)$(sysvardir) $(DESTDIR)$(pmdir) \
+ $(DESTDIR)$(checkdir) $(DESTDIR)$(consdir) \
+ $(DESTDIR)$(profiledir) $(DESTDIR)$(dbdir1) \
+- $(DESTDIR)$(dbdir2) $(DESTDIR)$(pmcheckdir) \
++ $(DESTDIR)$(pmcheckdir) \
+ $(DESTDIR)$(pmconsumerdir) $(DESTDIR)$(pydir) \
+ $(DESTDIR)$(pycheckdir) $(DESTDIR)$(exampledir)
+
+@@ -164,7 +163,7 @@
+ $(DESTDIR)$(checkdir) $(DESTDIR)$(consdir) \
+ $(DESTDIR)$(profiledir) $(DESTDIR)$(pycheckdir) \
+ $(DESTDIR)$(pydir) $(DESTDIR)$(libdir) \
+- $(DESTDIR)$(dbdir2) $(DESTDIR)$(exampledir) \
++ $(DESTDIR)$(exampledir) \
+ $(DESTDIR)$(docdir)
+
+ installbase: installdirs
+@@ -184,11 +183,11 @@
+ $(CP) -rp $(examples) $(DESTDIR)$(exampledir)
+ for FILE in $(notdir $(binfiles)) ; do \
+ $(FIXPATH) "$(DESTDIR)/$(bindir)/$${FILE}" "$(libdir)" \
+- "$(dbdir1)" "$(dbdir2)" ; \
++ "$(dbdir1)" ; \
+ done
+ for FILE in $(notdir $(conffiles)) ; do \
+ $(FIXPATH) "$(DESTDIR)/$(confdir)/$${FILE}" "$(libdir)" \
+- "$(dbdir1)" "$(dbdir2)" ; \
++ "$(dbdir1)" ; \
+ done
+
+ uninstallbase:
diff --git a/sys-apps/lnxhc/lnxhc-1.2-r1.ebuild b/sys-apps/lnxhc/lnxhc-1.2-r1.ebuild
new file mode 100644
index 000000000000..478ae56d9502
--- /dev/null
+++ b/sys-apps/lnxhc/lnxhc-1.2-r1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+DESCRIPTION="Linux Health Checker"
+HOMEPAGE="http://lnxhc.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="EPL-1.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=dev-lang/perl-5.8"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-1.2-usrlocal.patch"
+ epatch "${FILESDIR}/${PN}-1.2-ifconfig-path.patch"
+}
diff --git a/sys-apps/lnxhc/metadata.xml b/sys-apps/lnxhc/metadata.xml
new file mode 100644
index 000000000000..69a1599e0a5e
--- /dev/null
+++ b/sys-apps/lnxhc/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>creffett@gentoo.org</email>
+ <name>Chris Reffett</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">lnxhc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/logwatch/Manifest b/sys-apps/logwatch/Manifest
new file mode 100644
index 000000000000..8bbcd3ba2e0f
--- /dev/null
+++ b/sys-apps/logwatch/Manifest
@@ -0,0 +1,3 @@
+DIST logwatch-7.4.0.tar.gz 294398 SHA256 b8fd136a07a6b79962380d68b26328cdccc8b6a20310195e24e39b0bfd3287c4 SHA512 d556a5768ceeedc21396a38f02f2b2d8ca3556de92274038819840a6d41770437673a531d91f54cf3a905b6b4b8d72fa4011b838f81ed04b02265bde39b7b3c7 WHIRLPOOL 7643cb55ed330dacda223d5ff06dca16a29df2a8c50a6f4b2bded1ba764c07126101bce08422e5531cc7dd531960e6dd9a29114ac5e43987a3d2d9b796204d21
+DIST logwatch-7.4.0_p170.tar.gz 455794 SHA256 27f4ae2692190aa96a3af997d66b39a595e9c72e4a078cbdfa7c13f5c885a42f SHA512 6c07cfb20c0bd121b698b48f060d50b45e018b81b2ed78c96d33c5b8cb43fd23a139cf95c64af9c3148c99fe1f9e9d2c0936e1d2ab6dfba105e4ad621db2fcdb WHIRLPOOL 6af221787ce7d71f0c238fbb18d3b272cfe42cb18a3a24a70fbf617f2a6d39fd41d4978dd2c8b67687fa003594300e4beb2fc0b2f0c2425cc1c6fd1d501cda50
+DIST logwatch-7.4.1.tar.gz 464970 SHA256 35ec31f9fe981aaa727b144ab3ff2eb655997d8ccabaf66586458f5dfc3a56eb SHA512 f53400e6654b498371265ade82d51f0625904a33400f7f82b2dc8522ad561c8998fd9f23d569281f031142bb527fc1b38af1d7534fe3b3aef23780b0152e67d4 WHIRLPOOL 947f0796f5313c9eb5aff3cca8b47a861eda3ff0b3b65134a11792ddca2262fbd8fd0bdf83ce430d06efb4905187ca82a6978e6b5ae656ade63a7d181cc3faac
diff --git a/sys-apps/logwatch/files/logwatch b/sys-apps/logwatch/files/logwatch
new file mode 100755
index 000000000000..50ba356d3984
--- /dev/null
+++ b/sys-apps/logwatch/files/logwatch
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -x /usr/sbin/logwatch.pl ] ; then
+ mkdir -p /var/cache/logwatch
+ exec /usr/sbin/logwatch.pl --output mail
+fi
diff --git a/sys-apps/logwatch/files/logwatch-7.4.0-openssh-hpn.patch b/sys-apps/logwatch/files/logwatch-7.4.0-openssh-hpn.patch
new file mode 100644
index 000000000000..7eeed3b59dad
--- /dev/null
+++ b/sys-apps/logwatch/files/logwatch-7.4.0-openssh-hpn.patch
@@ -0,0 +1,19 @@
+Add an 'ignore' line for the HPN patch that we enable on our openssh
+by default.
+
+http://sourceforge.net/tracker/?func=detail&aid=3257504&group_id=312875&atid=1316824
+
+diff --git a/scripts/services/sshd b/scripts/services/sshd
+index a4c3354..50e8cf2 100755
+--- a/scripts/services/sshd
++++ b/scripts/services/sshd
+@@ -290,7 +290,8 @@ while (defined(my $ThisLine = <STDIN>)) {
+ ($ThisLine =~ /^Failed keyboard-interactive for <invalid username> from/ ) or
+ ($ThisLine =~ /^Keyboard-interactive \(PAM\) userauth failed/ ) or
+ ($ThisLine =~ /^debug1: /) or
+- ($ThisLine =~ /Nasty PTR record .* is set up for [\da-fA-F.:]+, ignoring/)
++ ($ThisLine =~ /Nasty PTR record .* is set up for [\da-fA-F.:]+, ignoring/) or
++ ($ThisLine =~ /^SSH: Server;L[Tt]ype: /)
+ ) {
+ # Ignore these
+ } elsif ( my ($Method,$User,$Host,$Port) = ($ThisLine =~ /^Accepted (\S+) for (\S+) from ([\d\.:a-f]+) port (\d+)/) ) {
diff --git a/sys-apps/logwatch/logwatch-7.4.0-r1.ebuild b/sys-apps/logwatch/logwatch-7.4.0-r1.ebuild
new file mode 100644
index 000000000000..71f70a6bd8ca
--- /dev/null
+++ b/sys-apps/logwatch/logwatch-7.4.0-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Analyzes and Reports on system logs"
+HOMEPAGE="http://www.logwatch.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+RDEPEND="virtual/cron
+ virtual/mta
+ virtual/mailx
+ dev-lang/perl
+ dev-perl/Date-Calc
+ dev-perl/DateManip
+ dev-perl/Tie-IxHash
+ dev-perl/Sys-CPU
+ dev-perl/Sys-MemInfo"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-openssh-hpn.patch"
+}
+
+src_install() {
+ dodir /usr/share/logwatch/lib
+ dodir /usr/share/logwatch/scripts/services
+ dodir /usr/share/logwatch/scripts/shared
+ dodir /usr/share/logwatch/default.conf/logfiles
+ dodir /usr/share/logwatch/default.conf/services
+ dodir /usr/share/logwatch/default.conf/html
+ keepdir /etc/logwatch
+ keepdir /var/cache/logwatch
+
+ newsbin scripts/logwatch.pl logwatch.pl
+
+ for i in scripts/logfiles/* ; do
+ exeinto /usr/share/logwatch/$i
+ doexe $i/*
+ done
+
+ exeinto /usr/share/logwatch/lib
+ doexe lib/*.pm
+
+ exeinto /usr/share/logwatch/scripts/services
+ doexe scripts/services/*
+
+ exeinto /usr/share/logwatch/scripts/shared
+ doexe scripts/shared/*
+
+ insinto /usr/share/logwatch/default.conf
+ doins conf/logwatch.conf
+
+ insinto /usr/share/logwatch/default.conf/logfiles
+ doins conf/logfiles/*
+
+ insinto /usr/share/logwatch/default.conf/services
+ doins conf/services/*
+
+ insinto /usr/share/logwatch/default.conf/html
+ doins conf/html/*
+
+ # Make sure logwatch is run before anything else #100243
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/logwatch 00-logwatch
+
+ doman logwatch.8
+ dodoc README HOWTO-Customize-LogWatch
+}
+
+pkg_postinst() {
+ if [[ -e ${ROOT}/etc/cron.daily/logwatch ]] ; then
+ local md5=$(md5sum "${ROOT}"/etc/cron.daily/logwatch)
+ [[ ${md5} == "edb003cbc0686ed4cf37db16025635f3" ]] \
+ && rm -f "${ROOT}"/etc/cron.daily/logwatch \
+ || ewarn "You have two logwatch files in /etc/cron.daily/"
+ fi
+}
diff --git a/sys-apps/logwatch/logwatch-7.4.0.ebuild b/sys-apps/logwatch/logwatch-7.4.0.ebuild
new file mode 100644
index 000000000000..7b2dba0a98bb
--- /dev/null
+++ b/sys-apps/logwatch/logwatch-7.4.0.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Analyzes and Reports on system logs"
+HOMEPAGE="http://www.logwatch.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ppc ppc64 sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="virtual/cron
+ virtual/mta
+ virtual/mailx
+ dev-lang/perl
+ dev-perl/Date-Calc
+ dev-perl/DateManip
+ dev-perl/Tie-IxHash
+ dev-perl/Sys-CPU
+ dev-perl/Sys-MemInfo"
+
+src_install() {
+ dodir /usr/share/logwatch/lib
+ dodir /usr/share/logwatch/scripts/services
+ dodir /usr/share/logwatch/scripts/shared
+ dodir /usr/share/logwatch/default.conf/logfiles
+ dodir /usr/share/logwatch/default.conf/services
+ dodir /usr/share/logwatch/default.conf/html
+ keepdir /etc/logwatch
+ keepdir /var/cache/logwatch
+
+ newsbin scripts/logwatch.pl logwatch.pl || die "dosbin logwatch failed"
+
+ for i in scripts/logfiles/* ; do
+ exeinto /usr/share/logwatch/$i
+ doexe $i/* || die "doexe $i failed"
+ done
+
+ exeinto /usr/share/logwatch/lib
+ doexe lib/*.pm
+
+ exeinto /usr/share/logwatch/scripts/services
+ doexe scripts/services/*
+
+ exeinto /usr/share/logwatch/scripts/shared
+ doexe scripts/shared/*
+
+ insinto /usr/share/logwatch/default.conf
+ doins conf/logwatch.conf
+
+ insinto /usr/share/logwatch/default.conf/logfiles
+ doins conf/logfiles/*
+
+ insinto /usr/share/logwatch/default.conf/services
+ doins conf/services/*
+
+ insinto /usr/share/logwatch/default.conf/html
+ doins conf/html/*
+
+ # Make sure logwatch is run before anything else #100243
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/logwatch 00-logwatch
+
+ doman logwatch.8
+ dodoc README HOWTO-Customize-LogWatch
+}
+
+pkg_postinst() {
+ if [[ -e ${ROOT}/etc/cron.daily/logwatch ]] ; then
+ local md5=$(md5sum "${ROOT}"/etc/cron.daily/logwatch)
+ [[ ${md5} == "edb003cbc0686ed4cf37db16025635f3" ]] \
+ && rm -f "${ROOT}"/etc/cron.daily/logwatch \
+ || ewarn "You have two logwatch files in /etc/cron.daily/"
+ fi
+}
diff --git a/sys-apps/logwatch/logwatch-7.4.0_p170-r1.ebuild b/sys-apps/logwatch/logwatch-7.4.0_p170-r1.ebuild
new file mode 100644
index 000000000000..1e3de9579ab3
--- /dev/null
+++ b/sys-apps/logwatch/logwatch-7.4.0_p170-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="Analyzes and Reports on system logs"
+HOMEPAGE="http://www.logwatch.org/"
+#SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
+SRC_URI="http://dev.gentoo.org/~polynomial-c/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+RDEPEND="virtual/cron
+ virtual/mta
+ virtual/mailx
+ dev-lang/perl
+ dev-perl/Date-Calc
+ dev-perl/DateManip
+ dev-perl/Tie-IxHash
+ dev-perl/Sys-CPU
+ dev-perl/Sys-MemInfo"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P/_p*}-openssh-hpn.patch"
+}
+
+src_install() {
+ dodir /usr/share/logwatch/lib
+ dodir /usr/share/logwatch/scripts/services
+ dodir /usr/share/logwatch/scripts/shared
+ dodir /usr/share/logwatch/default.conf/logfiles
+ dodir /usr/share/logwatch/default.conf/services
+ dodir /usr/share/logwatch/default.conf/html
+ keepdir /etc/logwatch
+ keepdir /var/cache/logwatch
+
+ newsbin scripts/logwatch.pl logwatch.pl
+
+ for i in scripts/logfiles/* ; do
+ exeinto /usr/share/logwatch/$i
+ doexe $i/*
+ done
+
+ exeinto /usr/share/logwatch/lib
+ doexe lib/*.pm
+
+ exeinto /usr/share/logwatch/scripts/services
+ doexe scripts/services/*
+
+ exeinto /usr/share/logwatch/scripts/shared
+ doexe scripts/shared/*
+
+ insinto /usr/share/logwatch/default.conf
+ doins conf/logwatch.conf
+
+ insinto /usr/share/logwatch/default.conf/logfiles
+ doins conf/logfiles/*
+
+ insinto /usr/share/logwatch/default.conf/services
+ doins conf/services/*
+
+ insinto /usr/share/logwatch/default.conf/html
+ doins conf/html/*
+
+ # Make sure logwatch is run before anything else #100243
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/logwatch 00-logwatch
+
+ doman logwatch.8
+ dodoc README HOWTO-Customize-LogWatch
+}
+
+pkg_postinst() {
+ if [[ -e ${ROOT}/etc/cron.daily/logwatch ]] ; then
+ local md5=$(md5sum "${ROOT}"/etc/cron.daily/logwatch)
+ [[ ${md5} == "edb003cbc0686ed4cf37db16025635f3" ]] \
+ && rm -f "${ROOT}"/etc/cron.daily/logwatch \
+ || ewarn "You have two logwatch files in /etc/cron.daily/"
+ fi
+}
diff --git a/sys-apps/logwatch/logwatch-7.4.1.ebuild b/sys-apps/logwatch/logwatch-7.4.1.ebuild
new file mode 100644
index 000000000000..15fe8b2302be
--- /dev/null
+++ b/sys-apps/logwatch/logwatch-7.4.1.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
+
+DESCRIPTION="Analyzes and Reports on system logs"
+HOMEPAGE="http://www.logwatch.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND=""
+RDEPEND="virtual/cron
+ virtual/mta
+ virtual/mailx
+ dev-lang/perl
+ dev-perl/Date-Calc
+ dev-perl/DateManip
+ dev-perl/Tie-IxHash
+ dev-perl/Sys-CPU
+ dev-perl/Sys-MemInfo"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-7.4.0-openssh-hpn.patch
+}
+
+src_install() {
+ dodir /usr/share/logwatch/lib
+ dodir /usr/share/logwatch/scripts/services
+ dodir /usr/share/logwatch/scripts/shared
+ dodir /usr/share/logwatch/default.conf/logfiles
+ dodir /usr/share/logwatch/default.conf/services
+ dodir /usr/share/logwatch/default.conf/html
+ keepdir /etc/logwatch
+
+ newsbin scripts/logwatch.pl logwatch.pl
+
+ exeinto /usr/share/logwatch/lib
+ doexe lib/*.pm
+
+ exeinto /usr/share/logwatch/scripts/services
+ doexe scripts/services/*
+
+ exeinto /usr/share/logwatch/scripts/shared
+ doexe scripts/shared/*
+
+ insinto /usr/share/logwatch/default.conf
+ doins conf/logwatch.conf
+
+ insinto /usr/share/logwatch/default.conf/logfiles
+ doins conf/logfiles/*
+
+ insinto /usr/share/logwatch/default.conf/services
+ doins conf/services/*
+
+ insinto /usr/share/logwatch/default.conf/html
+ doins conf/html/*
+
+ # Make sure logwatch is run before anything else #100243
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/logwatch 00-logwatch
+
+ doman logwatch.8
+ dodoc README HOWTO-Customize-LogWatch
+
+ # Do last due to insopts modification.
+ insinto /usr/share/logwatch/scripts/logfiles
+ insopts -m755
+ doins -r scripts/logfiles/*
+}
+
+pkg_postinst() {
+ if [[ -e ${ROOT}/etc/cron.daily/logwatch ]] ; then
+ local md5=$(md5sum "${ROOT}"/etc/cron.daily/logwatch)
+ [[ ${md5} == "edb003cbc0686ed4cf37db16025635f3" ]] \
+ && rm -f "${ROOT}"/etc/cron.daily/logwatch \
+ || ewarn "You have two logwatch files in /etc/cron.daily/"
+ fi
+}
diff --git a/sys-apps/logwatch/metadata.xml b/sys-apps/logwatch/metadata.xml
new file mode 100644
index 000000000000..b348d7452f58
--- /dev/null
+++ b/sys-apps/logwatch/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">logwatch</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/lomoco/Manifest b/sys-apps/lomoco/Manifest
new file mode 100644
index 000000000000..106ae4627fcf
--- /dev/null
+++ b/sys-apps/lomoco/Manifest
@@ -0,0 +1 @@
+DIST lomoco-1.0.tar.gz 24573 SHA256 e9e537e8bca6186f84b457394a9e934b89c36870c66aa202ed188c7aa24e9dcc SHA512 5cd04c956fe11112be83e8d4ad91e4a8fac1bacd03666e8959ce20f2cc372fc8c53a5ac86b94125088f6b303936f087caafe71248ca8511b6a580f58459aee9f WHIRLPOOL 2bf5368351879f7f77e1dc9a61404a6f23f3ff96a1fa943aad3954741e1492df2833f306b774bc2e44dd63ec0c85c4b8fe3661f48b7d2b82e384b9f12fa82943
diff --git a/sys-apps/lomoco/files/lomoco-1.0-gentoo-hardware-support.patch b/sys-apps/lomoco/files/lomoco-1.0-gentoo-hardware-support.patch
new file mode 100644
index 000000000000..5a5cd7d3fcb9
--- /dev/null
+++ b/sys-apps/lomoco/files/lomoco-1.0-gentoo-hardware-support.patch
@@ -0,0 +1,287 @@
+- Support for other hardware
+- ssr comment in the mouse array.
+- Use of defines for numeric constants to improve code readability.
+- Debian patch integrated
+
+diff -Nuar --exclude '*~' lomoco-1.0.old/src/lomoco.c lomoco-1.0/src/lomoco.c
+--- lomoco-1.0.old/src/lomoco.c 2006-03-01 06:10:05.000000000 -0800
++++ lomoco-1.0/src/lomoco.c 2006-04-30 02:38:05.107430674 -0700
+@@ -32,11 +32,12 @@
+ * model: you can find on the hardware, look for M/N: ...
+ * csr: mouse with receiver (wireless)
+ * res: mouse has resolution control
+- * sms: mouse has smart control
++ * ssr: mouse has smart scroll reporting
++ * sms: mouse has smart scroll
+ * dual: dual receiver (wireless mouse+wireless keyboard)
+ *
+ * product id, name, model, csr, res, ssr, sms, dual */
+-mouse_t mice [] = {
++static mouse_t mice [] = {
+ {0xc00e, "Wheel Mouse Optical", "M-BJ58", 0, 1, 0, 0, 0},
+ {0xc00f, "MouseMan Traveler", "M-BJ79", 0, 1, 0, 0, 0},
+ {0xc012, "MouseMan Dual Optical", "M-BL63B", 0, 1, 0, 0, 0},
+@@ -42,6 +42,7 @@
+ {0xc012, "MouseMan Dual Optical", "M-BL63B", 0, 1, 0, 0, 0},
+ {0xc01d, "MX510 Optical Mouse", "M-BS81A", 0, 1, 1, 1, 0},
+ {0xc01e, "MX518 Optical Mouse", "M-BS81A", 0, 1, 1, 0, 0},
++ {0xc051, "MX518 Optical Mouse", "M-BS81A", 0, 1, 1, 0, 0},
+ {0xc024, "MX300 Optical Mouse", "M-BP82", 0, 1, 0, 0, 0},
+ {0xc01b, "MX310 Optical Mouse", "M-BP86", 0, 1, 0, 0, 0},
+ {0xc025, "MX500 Optical Mouse", "M-BP81A", 0, 1, 1, 1, 0},
+@@ -49,50 +50,37 @@
+ {0xc041, "G5 Laser Gaming Mouse", "M-UAC113", 0, 1, 0, 1, 0},
+ {0xc501, "Mouse Receiver", "C-BA4-MSE", 1, 0, 0, 0, 0},
+ {0xc502, "Dual Receiver", "C-UA3-DUAL", 1, 0, 0, 0, 1},
+- {0xc503, "Receiver for MX900 Receiver", "C-UJ16A", 1, 0, 0, 1, 0},
++ {0xc503, "Receiver for MX900", "C-UJ16A", 1, 0, 0, 1, 0},
+ {0xc504, "Receiver for Cordless Freedom Optical", "C-BD9-DUAL", 1, 0, 0, 0, 1},
+ {0xc505, "Receiver for Cordless Elite Duo", "C-BG17-DUAL", 1, 0, 0, 0, 1},
+ {0xc506, "Receiver for MX700 Optical Mouse", "C-BF16-MSE", 1, 0, 0, 1, 0},
+ {0xc508, "Receiver for Cordless Optical TrackMan", "C-BA4-MSE", 1, 0, 0, 1, 0},
+- {0xc702, "Receiver for Cordless Presenter", "C-UF15", 1, 0, 0, 0, 0},
+- {0xc704, "Receiver for diNovo Media Desktop", "C-BQ16A", 1, 0, 1, 1, 0},
++
++ /* From Michele Noberasco <s4t4n@gentoo.org> */
++ {0xc50a, "Reciveer for Cordless Optical Mouse for Notebooks", "C-BJ27-MSE", 1, 0, 0, 0, 0},
++
++ /* From Robin H. Johnson <robbat2@gentoo.org> */
++ {0xc50b, "Receiver for Cordless Desktop MX", "C-BK16A-DUAL",1, 0, 0, 1, 1},
++
+ /* From Markus Wiesner <m_wiesner@gmx.net> */
+ {0xc50e, "Receiver for MX1000 Laser", "C-BN34", 1, 0, 1, 1, 0},
+ {0xc512, "Receiver for Cordless Desktop MX3100 Laser", "C-BO34", 1, 0, 0, 1, 1},
++
++ {0xc702, "Receiver for Cordless Presenter", "C-UF15", 1, 0, 0, 0, 0},
++ {0xc704, "Receiver for diNovo Media Desktop", "C-BQ16A", 1, 0, 1, 1, 0},
+ {0x0000, NULL, NULL, 0, 0, 0, 0}
+ };
+
+-
+ /*
+- * Description: Query the mouse and report all cordless mouse specific infos
++ * Description: Print out a set of CSR data
+ * e.g. receiver type, mouse type, battery status
+ *
+- * Parameters: mouse_t *m
+- * mouse struct with the mouse specs
+- * struct usb_dev_handle *handle
+- * usb device handle of the mouse
+- * unsigned int addr
+- * address for dual receivers
++ * Parameters: unsigned char* buf
++ * result from query_csr internals
+ *
+ * Return: void
+ */
+-static void query_csr(mouse_t *m, struct usb_dev_handle *handle,
+- unsigned int addr) {
+- unsigned char buf[12] = {0};
+-
+- if (usb_control_msg ( handle,
+- USB_TYPE_VENDOR | USB_ENDPOINT_IN,
+- 0x09,
+- (0x0003 | addr),
+- (0x0000 | addr),
+- (char *) buf,
+- 8,
+- TIMEOUT ) != 8) {
+-
+- perror("Writing to USB device: CSR");
+- exit(EXIT_FAILURE);
+- }
+-
++static void print_csr(unsigned char* buf) {
+ /* We have not obtained blocks P6 P0 P4 P5 P8 P9 PB0 PB1 */
+
+ /* Is a C504 receiver busy? */
+@@ -111,6 +99,7 @@
+ case 0x3c: printf ("C508\n"); break;
+ case 0x3d: printf ("C506\n"); break;
+ case 0x3e: printf ("C505\n"); break;
++ case 0x3f: printf ("C50B\n"); break;
+ case 0x42: printf ("C512\n"); break;
+ default: printf ("Unknown (type %x)\n", P0);
+ }
+@@ -138,6 +127,7 @@
+ case 0x82: printf ("Cordless Optical TrackMan\n"); break;
+ case 0x8A: printf ("MX700 Cordless Optical Mouse\n"); break;
+ case 0x8B: printf ("MX700 Cordless Optical Mouse (2ch)\n"); break;
++ case 0x94: printf ("Cordless Optical Mouse for Notebooks\n"); break;
+ default: printf ("Unknown (type %x)\n", P4);
+ }
+
+@@ -199,6 +189,38 @@
+ }
+ }
+
++/*
++ * Description: Query the mouse and report all cordless mouse specific infos
++ * e.g. receiver type, mouse type, battery status
++ *
++ * Parameters: mouse_t *m
++ * mouse struct with the mouse specs
++ * struct usb_dev_handle *handle
++ * usb device handle of the mouse
++ * unsigned int addr
++ * address for dual receivers
++ *
++ * Return: void
++ */
++static void query_csr(mouse_t *m, struct usb_dev_handle *handle,
++ unsigned int addr) {
++ unsigned char buf[12] = {0};
++
++ if (usb_control_msg ( handle,
++ USB_TYPE_VENDOR | USB_ENDPOINT_IN,
++ REQUEST_MOUSE_CSR,
++ (0x0003 | addr),
++ (0x0000 | addr),
++ (char *) buf,
++ 8,
++ TIMEOUT ) != 8) {
++
++ perror("Writing to USB device: CSR");
++ exit(EXIT_FAILURE);
++ }
++ print_csr(buf);
++
++}
+
+ /*
+ * Description: Query the mouse and report the current resolution
+@@ -218,8 +240,8 @@
+
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR | USB_ENDPOINT_IN,
+- 0x01,
+- (0x000e | addr),
++ REQUEST_MOUSE_GET_RES_SSR,
++ (VALUE_MOUSE_GET_RES | addr),
+ (0x0000 | addr),
+ (char *) buf,
+ 1,
+@@ -255,8 +277,8 @@
+ if (m->has_ssr) {
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR | USB_ENDPOINT_IN,
+- 0x01,
+- (0x0017 | addr),
++ REQUEST_MOUSE_GET_RES_SSR,
++ (VALUE_MOUSE_GET_SSR | addr),
+ (0x0000 | addr),
+ (char*) buf,
+ 1,
+@@ -394,8 +416,8 @@
+ assert ((set_channel == 1) || (set_channel == 2));
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR,
+- 0x02,
+- (0x0008 | addr),
++ REQUEST_MOUSE_PUT_RES_SMS,
++ (VALUE_MOUSE_CHANNEL | addr),
+ ((set_channel - 1) | addr),
+ NULL,
+ 0,
+@@ -412,8 +434,8 @@
+ if (set_unlock) {
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR,
+- 0x02,
+- (0x06 | addr),
++ REQUEST_MOUSE_PUT_RES_SMS,
++ (VALUE_MOUSE_UNLOCK | addr),
+ (0x1 | addr),
+ NULL,
+ 0,
+@@ -430,8 +452,8 @@
+ if (set_lock) {
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR,
+- 0x02,
+- (0x0006 | addr),
++ REQUEST_MOUSE_PUT_RES_SMS,
++ (VALUE_MOUSE_UNLOCK | addr),
+ (0x0000 | addr),
+ NULL,
+ 0,
+@@ -448,8 +470,8 @@
+ if (set_clear) {
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR,
+- 0x09,
+- (0x0004 | addr),
++ REQUEST_MOUSE_CSR,
++ (VALUE_MOUSE_CLEAR | addr),
+ (0x0000 | addr),
+ NULL,
+ 0,
+@@ -483,8 +505,8 @@
+
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR,
+- 0x0002,
+- 0x000e,
++ REQUEST_MOUSE_PUT_RES_SMS,
++ VALUE_MOUSE_PUT_RES,
+ (set_res / 400) + 2,
+ NULL,
+ 0,
+@@ -514,8 +536,8 @@
+ assert ((set_sms == 1) || (set_sms == -1));
+ if (usb_control_msg ( handle,
+ USB_TYPE_VENDOR,
+- 0x02,
+- 0x0017,
++ REQUEST_MOUSE_PUT_RES_SMS,
++ VALUE_MOUSE_PUT_SSR,
+ (set_sms == 1 ? 0x0001 : 0x0000),
+ NULL,
+ 0,
+@@ -641,7 +663,7 @@
+ /* Do we support this device? If so, list it. */
+ if ((m = find_mouse (device)) != NULL) {
+
+- printf ("%s.%s: %04x:%04x %s (%s) Caps: %s%s%s\n",
++ printf ("%s.%s: %04x:%04x %s (%s) Caps: %s%s%s%s\n",
+ device->bus->dirname,
+ device->filename,
+ device->descriptor.idVendor,
+@@ -650,6 +672,7 @@
+ m->model,
+ m->has_csr? "CSR ": "",
+ m->has_res? "RES ": "",
++ m->has_ssr? "SSR ": "",
+ m->has_sms? "SMS ": ""
+ );
+ }
+@@ -667,7 +671,7 @@
+ device->filename,
+ device->descriptor.idVendor,
+ device->descriptor.idProduct,
+- ret ? product : "Unknown"
++ ret > 0 ? product : "Unknown"
+ );
+ continue;
+ }
+diff -Nuar --exclude '*~' lomoco-1.0.old/src/lomoco.h lomoco-1.0/src/lomoco.h
+--- lomoco-1.0.old/src/lomoco.h 2006-03-01 06:10:05.000000000 -0800
++++ lomoco-1.0/src/lomoco.h 2006-04-30 02:34:04.381175920 -0700
+@@ -97,4 +97,17 @@
+ int is_dual;
+ } mouse_t;
+
++
++#define REQUEST_MOUSE_CSR 0x09
++#define VALUE_MOUSE_GET 0x0003
++#define VALUE_MOUSE_CLEAR 0x0004
++#define REQUEST_MOUSE_GET_RES_SSR 0x01
++#define VALUE_MOUSE_GET_RES 0x000e
++#define VALUE_MOUSE_GET_SSR 0x0017
++#define REQUEST_MOUSE_PUT_RES_SMS 0x02
++#define VALUE_MOUSE_UNLOCK 0x0006
++#define VALUE_MOUSE_CHANNEL 0x0008
++#define VALUE_MOUSE_PUT_RES 0x000e
++#define VALUE_MOUSE_PUT_SSR 0x0017
++
+ #endif /* __LOMOCO_H */
diff --git a/sys-apps/lomoco/files/lomoco-1.0-updated-udev.patch b/sys-apps/lomoco/files/lomoco-1.0-updated-udev.patch
new file mode 100644
index 000000000000..783a2d5e712a
--- /dev/null
+++ b/sys-apps/lomoco/files/lomoco-1.0-updated-udev.patch
@@ -0,0 +1,95 @@
+diff --git a/udev/toudev.awk b/udev/toudev.awk
+index 822421d..ada40e5 100644
+--- a/udev/toudev.awk
++++ b/udev/toudev.awk
+@@ -1,15 +1,20 @@
+ #!/bin/awk -f
+ BEGIN {
+ FS = ","
++ print "# udev.rules file for Logitech mouse control using lomoco"
++ print "#"
++ print ""
+ print "ACTION != \"add\", GOTO=\"lomoco_end\""
+- print "SUBSYSTEM != \"usb\", GOTO=\"lomoco_end\""
+- print "SYSFS{idVendor} != \"046d\", GOTO=\"lomoco_end\""
++ print "SUBSYSTEM == \"usb\", ENV{DEVTYPE}==\"usb_device\", GOTO=\"lomoco_start\""
++ print "SUBSYSTEM != \"usb_device\", GOTO=\"lomoco_end\""
++ print ""
++ print "LABEL=\"lomoco_start\""
+ print ""
+ }
+
+ $1 ~ /0xc[a-f0-9][a-f0-9][a-f0-9]/ {
+ print "# " substr($3, index($3, "\"")) ", " $2
+- print "SYSFS{idProduct}==\"" substr($1, index($1, "x")+1) \
++ print "ATTRS{idVendor}==\"046d\", ATTRS{idProduct}==\"" substr($1, index($1, "x")+1) \
+ "\", RUN=\"lomoco\""
+ }
+
+diff --git a/udev/udev.lomoco b/udev/udev.lomoco
+index 9e55511..da896d9 100755
+--- a/udev/udev.lomoco
++++ b/udev/udev.lomoco
+@@ -1,26 +1,36 @@
+-#!/bin/bash
+-
+-case "$DEVPATH" in
+- *usbdev*.*)
+- dev=${DEVPATH##*usbdev}
+- bus=$(printf %03d ${dev%.*})
+- dev=$(printf %03d ${dev#*.})
+-
+- . /etc/sysconfig/logitech_mouse
+-
+- options=
+-
+- if [ -n "$LOGITECH_MOUSE_RESOLUTION" ]; then
+- options="--$LOGITECH_MOUSE_RESOLUTION"
+- fi
+-
+- if [ -z "$LOGITECH_MOUSE_DISABLE_CC" -o "$LOGITECH_MOUSE_DISABLE_CC" = yes ]; then
+- options="$options --no-sms"
+- fi
+-
+- if [ -n "$options" ]; then
+- /usr/bin/lomoco -b $bus -d $dev $options
+- fi
+- ;;
+-esac 2>&1 | /bin/logger -t lomoco
+-
++#!/bin/sh
++#
++# udev helper script for the locomo utility
++#
++
++test -x /usr/bin/lomoco || exit 0
++test -r /etc/lomoco.conf || exit 0
++
++options=
++. /etc/lomoco.conf
++
++if [ -n "$LOGITECH_MOUSE_RESOLUTION" ]; then
++ options="--$LOGITECH_MOUSE_RESOLUTION"
++fi
++
++if [ -z "$LOGITECH_MOUSE_DISABLE_CC" -o "$LOGITECH_MOUSE_DISABLE_CC" = yes ]; then
++ options="$options --no-sms"
++fi
++
++if [ -n "$BUSNUM" ]; then
++ options="$options -b $BUSNUM"
++fi
++
++if [ -n "$DEVNUM" ]; then
++ options="$options -d $DEVNUM"
++fi
++
++if [ -n "$MODEL_ID" ]; then
++ options="$options -p $MODEL_ID"
++fi
++
++if [ -n "$options" ]; then
++ /usr/bin/lomoco $options 2>&1 | \
++ sed -e 's/^[[:blank:]]\+//' -e 's/ \+$//' -e '/^$/ d' | \
++ logger -t lomoco -p daemon.info
++fi
diff --git a/sys-apps/lomoco/files/lomoco-pm-utils-r1 b/sys-apps/lomoco/files/lomoco-pm-utils-r1
new file mode 100644
index 000000000000..602de3d11571
--- /dev/null
+++ b/sys-apps/lomoco/files/lomoco-pm-utils-r1
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+case "$1" in
+ thaw|resume)
+ @UDEVDIR@/lomoco
+ ;;
+esac
diff --git a/sys-apps/lomoco/files/lomoco.conf b/sys-apps/lomoco/files/lomoco.conf
new file mode 100644
index 000000000000..d69c6185bb61
--- /dev/null
+++ b/sys-apps/lomoco/files/lomoco.conf
@@ -0,0 +1,9 @@
+LOGITECH_MOUSE_RESOLUTION=800
+LOGITECH_MOUSE_DISABLE_CC=no
+
+# Use the lsusb output to configure additional parameters bellow
+# Bus <BUSNUM> Device <DEVNUM>: ID 046d:<MODEL_ID> Logitech, Inc. MX510 Optical Mouse
+# Note: DEVNUM is dynamic and not recommened
+#BUSNUM=001
+#DEVNUM=009
+#MODEL_ID=c01d
diff --git a/sys-apps/lomoco/lomoco-1.0-r9.ebuild b/sys-apps/lomoco/lomoco-1.0-r9.ebuild
new file mode 100644
index 000000000000..629ea061fef7
--- /dev/null
+++ b/sys-apps/lomoco/lomoco-1.0-r9.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit autotools eutils multilib toolchain-funcs udev
+
+DESCRIPTION="Lomoco can configure vendor-specific options on Logitech USB mice"
+HOMEPAGE="http://www.lomoco.org/"
+SRC_URI="http://www.lomoco.org/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 x86"
+IUSE=""
+
+RDEPEND="virtual/libusb:0"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ cp -f "${FILESDIR}"/lomoco-pm-utils-r1 "${T}" || die
+ sed -i -e "s|@UDEVDIR@|$(get_udevdir)|" "${T}"/lomoco-pm-utils-r1 || die
+
+ epatch \
+ "${FILESDIR}"/${P}-gentoo-hardware-support.patch \
+ "${FILESDIR}"/${P}-updated-udev.patch
+
+ eautoreconf
+}
+
+src_compile() {
+ emake
+ emake udev-rules
+}
+
+src_install() {
+ default
+
+ insinto "$(get_udevdir)"/rules.d
+ newins udev/lomoco.rules 40-lomoco.rules
+
+ exeinto "$(get_udevdir)"
+ newexe udev/udev.lomoco lomoco
+
+ insinto /etc
+ doins "${FILESDIR}"/lomoco.conf
+
+ exeinto /etc/pm/sleep.d
+ newexe "${T}"/lomoco-pm-utils-r1 lomoco
+}
diff --git a/sys-apps/lomoco/metadata.xml b/sys-apps/lomoco/metadata.xml
new file mode 100644
index 000000000000..a11c7e26e88e
--- /dev/null
+++ b/sys-apps/lomoco/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>anton.bugs@gmail.com</email>
+ <name>Anton Bolshakov</name>
+ <description>Proxy maintainer. Assign bugs to him</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/lsadb/Manifest b/sys-apps/lsadb/Manifest
new file mode 100644
index 000000000000..cfce7ff0d93c
--- /dev/null
+++ b/sys-apps/lsadb/Manifest
@@ -0,0 +1 @@
+DIST lsadb-0.1.3.tgz 7098 RMD160 52f8a70ad855f7fec801f064f2034ce251b779b7 SHA1 8a88a12636672b54f93dd6180e2f61d3dbc806f3 SHA256 eff3a0b0e113f3c97838f542e1761762f544b0a416d73a7f6b7ad0ff2f9326d0
diff --git a/sys-apps/lsadb/files/lsadb-makefile.patch b/sys-apps/lsadb/files/lsadb-makefile.patch
new file mode 100644
index 000000000000..fb396cc85b22
--- /dev/null
+++ b/sys-apps/lsadb/files/lsadb-makefile.patch
@@ -0,0 +1,10 @@
+--- Makefile.bak 2009-11-30 14:31:07.000000000 -0500
++++ Makefile 2009-11-30 14:31:34.000000000 -0500
+@@ -1,6 +1,2 @@
+-
+-
+ lsadb: lsadb.c lsadb.h
+- gcc -Wall -O2 -o $@ $< && strip $@
+-
+-
++ ${CC} -Wall ${CFLAGS} -o $@ $<
diff --git a/sys-apps/lsadb/lsadb-0.1.3.ebuild b/sys-apps/lsadb/lsadb-0.1.3.ebuild
new file mode 100644
index 000000000000..2f3b2766e9f1
--- /dev/null
+++ b/sys-apps/lsadb/lsadb-0.1.3.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Prints out information on all devices attached to the ADB bus"
+HOMEPAGE="http://pbbuttons.berlios.de/projects/lsadb/"
+SRC_URI="mirror://berlios/pub/pbbuttons/${PN}-${PV}.tgz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~ppc"
+IUSE=""
+DEPEND=""
+RDEPEND="$DEPEND"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${PN}-makefile.patch"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die "emake failed"
+}
+
+src_install() {
+ dobin lsadb
+ doman lsadb.1
+ dodoc README
+}
diff --git a/sys-apps/lsadb/metadata.xml b/sys-apps/lsadb/metadata.xml
new file mode 100644
index 000000000000..e75d5a5857f0
--- /dev/null
+++ b/sys-apps/lsadb/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-apps/lsb-release/Manifest b/sys-apps/lsb-release/Manifest
new file mode 100644
index 000000000000..12d1a2310504
--- /dev/null
+++ b/sys-apps/lsb-release/Manifest
@@ -0,0 +1 @@
+DIST lsb-release-1.4.tar.gz 10769 SHA256 99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172 SHA512 84f6f8794380463587005043f601b7a40190cd9e3409abff7f5ce7658cf029a14346eff87838296d90307192bdeff68cc00480c5c04814da7acdb3e220640fde WHIRLPOOL e8e322f3d5fddf589ae1cdc97d143da907aad418ab6099f79e90e988450a3304c58d483e2ba8c80a9a7093f73af515e6c66a1c33881681bef2da70a35c31c28d
diff --git a/sys-apps/lsb-release/files/lsb-release-1.4-os-release.patch b/sys-apps/lsb-release/files/lsb-release-1.4-os-release.patch
new file mode 100644
index 000000000000..830726074c7e
--- /dev/null
+++ b/sys-apps/lsb-release/files/lsb-release-1.4-os-release.patch
@@ -0,0 +1,10 @@
+--- a/lsb_release
++++ b/lsb_release
+@@ -250,6 +250,7 @@
+ CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1 \
+ -name \*$INFO_DISTRIB_SUFFIX \
+ -and ! -name $INFO_LSB_FILE \
++ -and ! -name os-release \
+ -and -type f \
+ 2>/dev/null \
+ | head -1 ) # keep one of the files found (if many)
diff --git a/sys-apps/lsb-release/lsb-release-1.4-r1.ebuild b/sys-apps/lsb-release/lsb-release-1.4-r1.ebuild
new file mode 100644
index 000000000000..e206316caac4
--- /dev/null
+++ b/sys-apps/lsb-release/lsb-release-1.4-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="LSB version query program"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/lsb"
+SRC_URI="mirror://sourceforge/lsb/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+# Perl isn't needed at runtime, it is just used to generate the man page.
+DEPEND="dev-lang/perl"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-os-release.patch # bug 443116
+}
+
+src_install() {
+ emake \
+ prefix="${D}/usr" \
+ mandir="${D}/usr/share/man" \
+ install
+
+ dodir /etc
+ cat > "${D}/etc/lsb-release" <<- EOF
+ DISTRIB_ID="Gentoo"
+ EOF
+}
diff --git a/sys-apps/lsb-release/lsb-release-1.4-r2.ebuild b/sys-apps/lsb-release/lsb-release-1.4-r2.ebuild
new file mode 100644
index 000000000000..8f2ef1240f69
--- /dev/null
+++ b/sys-apps/lsb-release/lsb-release-1.4-r2.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
+
+DESCRIPTION="LSB version query program"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/lsb"
+SRC_URI="mirror://sourceforge/lsb/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+# Perl isn't needed at runtime, it is just used to generate the man page.
+DEPEND="dev-lang/perl"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-os-release.patch # bug 443116
+
+ # use POSIX 'printf' instead of bash 'echo -e', bug #482370
+ sed -i -e "s:echo -e:printf '%b\\\n':g" lsb_release || die
+}
+
+src_install() {
+ emake \
+ prefix="${D}/usr" \
+ mandir="${D}/usr/share/man" \
+ install
+
+ dodir /etc
+ cat > "${D}/etc/lsb-release" <<- EOF
+ DISTRIB_ID="Gentoo"
+ EOF
+}
diff --git a/sys-apps/lsb-release/lsb-release-1.4-r3.ebuild b/sys-apps/lsb-release/lsb-release-1.4-r3.ebuild
new file mode 100644
index 000000000000..01c683f825b0
--- /dev/null
+++ b/sys-apps/lsb-release/lsb-release-1.4-r3.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="LSB version query program"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/lsb"
+SRC_URI="mirror://sourceforge/lsb/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+# Perl isn't needed at runtime, it is just used to generate the man page.
+DEPEND="dev-lang/perl"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-os-release.patch # bug 443116
+
+ # use POSIX 'printf' instead of bash 'echo -e', bug #482370
+ sed -i \
+ -e "s:echo -e:printf '%b\\\n':g" \
+ -e 's:--long:-l:g' \
+ lsb_release || die
+}
+
+src_install() {
+ emake \
+ prefix="${D}/usr" \
+ mandir="${D}/usr/share/man" \
+ install
+
+ dodir /etc
+ cat > "${D}/etc/lsb-release" <<- EOF
+ DISTRIB_ID="Gentoo"
+ EOF
+}
diff --git a/sys-apps/lsb-release/lsb-release-1.4.ebuild b/sys-apps/lsb-release/lsb-release-1.4.ebuild
new file mode 100644
index 000000000000..6987a9620bb8
--- /dev/null
+++ b/sys-apps/lsb-release/lsb-release-1.4.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="LSB version query program"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/lsb"
+SRC_URI="mirror://sourceforge/lsb/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+# Perl isn't needed at runtime, it is just used to generate the man page.
+DEPEND="dev-lang/perl"
+RDEPEND=""
+
+src_install() {
+ emake \
+ prefix="${D}/usr" \
+ mandir="${D}/usr/share/man" \
+ install \
+ || die "emake install failed"
+
+ mkdir -p "${D}/etc"
+ cat > "${D}/etc/lsb-release" <<- EOF
+ DISTRIB_ID="Gentoo"
+ EOF
+}
diff --git a/sys-apps/lsb-release/metadata.xml b/sys-apps/lsb-release/metadata.xml
new file mode 100644
index 000000000000..98edb104f446
--- /dev/null
+++ b/sys-apps/lsb-release/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>jer@gentoo.org</email>
+ <name>Jeroen Roovers</name>
+ </maintainer>
+ <longdescription lang="en">
+ This program forms part of the required functionality of
+ the LSB (Linux Standard Base) specification.
+
+ The program queries the installed state of the distribution
+ to display certain properties such as the version of the
+ LSB against which the distribution claims compliance as
+ well. It can also attempt to display the name and release
+ of the distribution along with an identifier of who produces
+ the distribution.
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">lsb</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/lshw/Manifest b/sys-apps/lshw/Manifest
new file mode 100644
index 000000000000..84a667f93028
--- /dev/null
+++ b/sys-apps/lshw/Manifest
@@ -0,0 +1,2 @@
+DIST lshw-B.02.16.tar.gz 1845891 SHA256 809882429555b93259785cc261dbff04c16c93d064db5f445a51945bc47157cb SHA512 ad3bd3d7b6f36f912265f0853f5aa37158c6d420a90a5e84b3e8fcd8a3c6137f7505cb5361e3eceb49954332d2466c686c946dcda8db0da3d51b3c48e343c2ab WHIRLPOOL 8e3200b726432859965be744c6afa437ffb4b57166084432064621773018b6f997a282ddea813916bc7faeced22a1286044b91bd69422b83372f03cf0878ca2d
+DIST lshw-B.02.17.tar.gz 2005737 SHA256 eb9cc053fa0f1e78685cb695596e73931bfb55d2377e3bc3b8b94aff4c5a489c SHA512 868899dce98e786a08a2134d6e132c388d71ab0f03fa6e10881e14d7a882c1882b46bbc6bd6ddb021cfab87ad6c9fd369453c3916f0b3353027eb2d470e55d9b WHIRLPOOL 5b18df2732e50f38dd8d9168adb6083e9a637cf9596f692a7e6806cda2ad05c777babdbeab470d948604f45bbbf1282be6d9fc68bf5c70741acf2d884e93e749
diff --git a/sys-apps/lshw/files/lshw-02.15b-build.patch b/sys-apps/lshw/files/lshw-02.15b-build.patch
new file mode 100644
index 000000000000..af2b3893ae17
--- /dev/null
+++ b/sys-apps/lshw/files/lshw-02.15b-build.patch
@@ -0,0 +1,116 @@
+--- lshw-B.02.15.orig/src/core/Makefile
++++ lshw-B.02.15/src/core/Makefile
+@@ -1,10 +1,10 @@
+ PACKAGENAME?=lshw
+
+-CXX=c++
++CXX?=c++
+ INCLUDES=
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+-CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+-LDFLAGS=
++CXXFLAGS ?= -g
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ LDSTATIC=
+ LIBS=
+
+--- lshw-B.02.15.orig/src/gui/Makefile
++++ lshw-B.02.15/src/gui/Makefile
+@@ -8,11 +8,11 @@
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+ GTKINCLUDES=$(shell pkg-config gtk+-2.0 --cflags)
+ INCLUDES=-I../core $(GTKINCLUDES)
+-CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
++CXXFLAGS ?= -g
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ CFLAGS=$(CXXFLAGS) $(DEFINES)
+ GTKLIBS=$(shell pkg-config gtk+-2.0 --libs)
+ LIBS=-L../core -llshw -lresolv -lsqlite3 $(GTKLIBS)
+-LDFLAGS=
+ ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+ LDFLAGS+= -Wl,--as-needed
+ endif
+@@ -39,7 +39,6 @@
+ $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ install: all
+- $(STRIP) gtk-$(PACKAGENAME)
+
+ clean:
+ rm -f $(OBJS) gtk-$(PACKAGENAME) gtk-lshw.glade.bak gtk-lshw.gladep.bak interface.c.bak interface.h.bak callbacks.c.bak callbacks.h.bak Makefile.bak
+--- lshw-B.02.15.orig/src/Makefile
++++ lshw-B.02.15/src/Makefile
+@@ -21,11 +21,13 @@
+ CXX?=c++
+ INCLUDES=-I./core/
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+-CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
++CXXFLAGS ?= -g
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ ifeq ($(SQLITE), 1)
+ CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
+ endif
+-LDFLAGS=-L./core/ -g
++LDFLAGS ?= -g
++LDFLAGS += -L./core/
+ ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+ LDFLAGS+= -Wl,--as-needed
+ endif
+@@ -48,18 +50,18 @@
+
+ .PHONY: core
+ core:
+- +make -C core all
++ +$(MAKE) -C core all
+
+ $(PACKAGENAME): core $(PACKAGENAME).o
+ $(CXX) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
+
+ .PHONY: po
+ po:
+- +make -C po all
++ +$(MAKE) -C po all
+
+ .PHONY: gui
+ gui: core
+- +make -C gui all
++ +$(MAKE) -C gui all
+
+ .PHONY: nologo
+ nologo:
+@@ -70,7 +72,6 @@
+
+ $(PACKAGENAME)-static: core core/lib$(PACKAGENAME).a $(PACKAGENAME).o
+ $(CXX) $(LDSTATIC) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
+- $(STRIP) $@
+
+ .PHONY: compressed
+ compressed: $(PACKAGENAME)-compressed
+@@ -93,14 +94,14 @@
+ manuf.txt:
+ wget http://www.ethereal.com/distribution/manuf.txt
+
+-install: all
++install:
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
+ $(INSTALL) -m 0755 $(PACKAGENAME) $(DESTDIR)/$(SBINDIR)
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(MANDIR)/man1
+ $(INSTALL) -m 0644 $(PACKAGENAME).1 $(DESTDIR)/$(MANDIR)/man1
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
+ $(INSTALL) -m 0644 $(DATAFILES) $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
+- make -C po install
++ $(MAKE) -C po install
+
+ install-gui: gui
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
+@@ -110,8 +111,8 @@
+
+ clean:
+ rm -f $(PACKAGENAME).o $(PACKAGENAME) $(PACKAGENAME)-static $(PACKAGENAME)-compressed
+- make -C core clean
+- make -C gui clean
++ $(MAKE) -C core clean
++ $(MAKE) -C gui clean
+
+ .timestamp:
+ date --utc +%Y%m%d%H%M%S > $@
diff --git a/sys-apps/lshw/files/lshw-02.16b-gentoo.patch b/sys-apps/lshw/files/lshw-02.16b-gentoo.patch
new file mode 100644
index 000000000000..dfd2c8983704
--- /dev/null
+++ b/sys-apps/lshw/files/lshw-02.16b-gentoo.patch
@@ -0,0 +1,161 @@
+--- lshw-B.02.16.orig/src/core/Makefile
++++ lshw-B.02.16/src/core/Makefile
+@@ -1,10 +1,9 @@
+ PACKAGENAME?=lshw
+
+-CXX=c++
++CXX?=c++
+ INCLUDES=
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+-CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+-LDFLAGS=
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ LDSTATIC=
+ LIBS=
+
+--- lshw-B.02.16.orig/src/gui/Makefile
++++ lshw-B.02.16/src/gui/Makefile
+@@ -1,5 +1,7 @@
+ PACKAGENAME?=lshw
+
++SQLITE?=0
++
+ CXX?=c++
+ CC?=cc
+ STRIP?=strip
+@@ -8,13 +10,14 @@ OBJCOPY?=objcopy
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+ GTKINCLUDES=$(shell pkg-config gtk+-2.0 --cflags)
+ INCLUDES=-I../core $(GTKINCLUDES)
+-CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ CFLAGS=$(CXXFLAGS) $(DEFINES)
+ GTKLIBS=$(shell pkg-config gtk+-2.0 gmodule-2.0 --libs)
+-LIBS=-L../core -llshw -lresolv -lsqlite3 $(GTKLIBS)
+-LDFLAGS=
+-ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+- LDFLAGS+= -Wl,--as-needed
++LIBS=-L../core -llshw -lresolv $(GTKLIBS)
++
++ifeq ($(SQLITE), 1)
++ CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
++ LIBS+= $(shell pkg-config --libs sqlite3)
+ endif
+
+ OBJS = gtk-lshw.o callbacks.o engine.o print-gui.o stock.o
+@@ -39,8 +42,7 @@ gtk-$(PACKAGENAME): $(OBJS) ../core/libl
+ $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ install: all
+- $(STRIP) gtk-$(PACKAGENAME)
+-
++
+ clean:
+ rm -f $(OBJS) gtk-$(PACKAGENAME) gtk-lshw.glade.bak gtk-lshw.gladep.bak callbacks.c.bak callbacks.h.bak Makefile.bak
+
+--- lshw-B.02.16.orig/src/Makefile
++++ lshw-B.02.16/src/Makefile
+@@ -21,11 +21,11 @@ export SQLITE
+ CXX?=c++
+ INCLUDES=-I./core/
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+-CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ ifeq ($(SQLITE), 1)
+ CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
+ endif
+-LDFLAGS=-L./core/ -g
++LDFLAGS += -L./core/
+ ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+ LDFLAGS+= -Wl,--as-needed
+ endif
+@@ -39,27 +39,25 @@ export CXXFLAGS
+ export LIBS
+ export LDFLAGS
+
+-DATAFILES = pci.ids usb.ids oui.txt manuf.txt
+-
+-all: $(PACKAGENAME) $(PACKAGENAME).1 $(DATAFILES)
++all: $(PACKAGENAME) $(PACKAGENAME).1
+
+ .cc.o:
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+ .PHONY: core
+ core:
+- +make -C core all
++ $(MAKE) -C core all
+
+ $(PACKAGENAME): core $(PACKAGENAME).o
+ $(CXX) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
+
+ .PHONY: po
+ po:
+- +make -C po all
++ $(MAKE) -C po all
+
+ .PHONY: gui
+ gui: core
+- +make -C gui all
++ $(MAKE) -C gui all
+
+ .PHONY: nologo
+ nologo:
+@@ -70,7 +68,6 @@ static: $(PACKAGENAME)-static
+
+ $(PACKAGENAME)-static: core core/lib$(PACKAGENAME).a $(PACKAGENAME).o
+ $(CXX) $(LDSTATIC) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
+- $(STRIP) $@
+
+ .PHONY: compressed
+ compressed: $(PACKAGENAME)-compressed
+@@ -93,14 +90,13 @@ oui.txt:
+ manuf.txt:
+ wget -O $@ http://anonsvn.wireshark.org/wireshark/trunk/manuf
+
+-install: all
++install:
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
+ $(INSTALL) -m 0755 $(PACKAGENAME) $(DESTDIR)/$(SBINDIR)
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(MANDIR)/man1
+ $(INSTALL) -m 0644 $(PACKAGENAME).1 $(DESTDIR)/$(MANDIR)/man1
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
+- $(INSTALL) -m 0644 $(DATAFILES) $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
+- make -C po install
++ $(MAKE) -C po install
+
+ install-gui: gui
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
+@@ -112,8 +108,8 @@ install-gui: gui
+
+ clean:
+ rm -f $(PACKAGENAME).o $(PACKAGENAME) $(PACKAGENAME)-static $(PACKAGENAME)-compressed
+- make -C core clean
+- make -C gui clean
++ $(MAKE) -C core clean
++ $(MAKE) -C gui clean
+
+ .timestamp:
+ date --utc +%Y%m%d%H%M%S > $@
+--- lshw-B.02.16.orig/src/core/pci.cc
++++ lshw-B.02.16/src/core/pci.cc
+@@ -17,7 +17,7 @@ __ID("@(#) $Id
+
+ #define PROC_BUS_PCI "/proc/bus/pci"
+ #define SYS_BUS_PCI "/sys/bus/pci"
+-#define PCIID_PATH DATADIR"/pci.ids:/usr/share/lshw/pci.ids:/usr/local/share/pci.ids:/usr/share/pci.ids:/etc/pci.ids:/usr/share/hwdata/pci.ids:/usr/share/misc/pci.ids"
++#define PCIID_PATH "/usr/share/misc/pci.ids"
+
+ #define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
+ #define PCI_VENDOR_ID 0x00 /* 16 bits */
+--- lshw-B.02.16.orig/src/core/usb.cc
++++ lshw-B.02.16/src/core/usb.cc
+@@ -27,7 +27,7 @@
+
+ #define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
+ #define SYSBUSUSBDEVICES "/sys/bus/usb/devices"
+-#define USBID_PATH DATADIR"/usb.ids:/usr/share/lshw/usb.ids:/usr/local/share/usb.ids:/usr/share/usb.ids:/etc/usb.ids:/usr/share/hwdata/usb.ids:/usr/share/misc/usb.ids"
++#define USBID_PATH "/usr/share/misc/usb.ids"
+
+ #define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
+ #define USB_CLASS_AUDIO 1
diff --git a/sys-apps/lshw/files/lshw-02.17b-fat.patch b/sys-apps/lshw/files/lshw-02.17b-fat.patch
new file mode 100644
index 000000000000..08654fd5af6f
--- /dev/null
+++ b/sys-apps/lshw/files/lshw-02.17b-fat.patch
@@ -0,0 +1,10 @@
+http://bugs.gentoo.org/485496
+
+--- src/core/fat.cc
++++ src/core/fat.cc
+@@ -82,4 +82,5 @@
+ uint8_t pmagic[2];
+ } __attribute__((__packed__)) fat32;
++ char sector[512]; // to make sure the whole struct is at least 512 bytes long
+ } __attribute__((__packed__)) type;
+ } __attribute__((__packed__));
diff --git a/sys-apps/lshw/files/lshw-02.17b-gentoo.patch b/sys-apps/lshw/files/lshw-02.17b-gentoo.patch
new file mode 100644
index 000000000000..1d3d431ec806
--- /dev/null
+++ b/sys-apps/lshw/files/lshw-02.17b-gentoo.patch
@@ -0,0 +1,159 @@
+--- lshw-B.02.17.orig/src/Makefile
++++ lshw-B.02.17/src/Makefile
+@@ -21,11 +21,11 @@
+ CXX?=c++
+ INCLUDES=-I./core/
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+-CXXFLAGS=-g -Wall -g $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ ifeq ($(SQLITE), 1)
+ CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
+ endif
+-LDFLAGS=-L./core/ -g
++LDFLAGS += -L./core/
+ ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+ LDFLAGS+= -Wl,--as-needed
+ endif
+@@ -39,27 +39,25 @@
+ export LIBS
+ export LDFLAGS
+
+-DATAFILES = pci.ids usb.ids oui.txt manuf.txt
+-
+-all: $(PACKAGENAME) $(PACKAGENAME).1 $(DATAFILES)
++all: $(PACKAGENAME) $(PACKAGENAME).1
+
+ .cc.o:
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+ .PHONY: core
+ core:
+- +make -C core all
++ $(MAKE) -C core all
+
+ $(PACKAGENAME): core $(PACKAGENAME).o
+ $(CXX) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
+
+ .PHONY: po
+ po:
+- +make -C po all
++ $(MAKE) -C po all
+
+ .PHONY: gui
+ gui: core
+- +make -C gui all
++ $(MAKE) -C gui all
+
+ .PHONY: nologo
+ nologo:
+@@ -70,7 +68,6 @@
+
+ $(PACKAGENAME)-static: core core/lib$(PACKAGENAME).a $(PACKAGENAME).o
+ $(CXX) $(LDSTATIC) $(LDFLAGS) -o $@ $(PACKAGENAME).o $(LIBS)
+- $(STRIP) $@
+
+ .PHONY: compressed
+ compressed: $(PACKAGENAME)-compressed
+@@ -93,14 +90,13 @@
+ manuf.txt:
+ wget -O $@ http://anonsvn.wireshark.org/wireshark/trunk/manuf
+
+-install: all
++install:
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
+ $(INSTALL) -m 0755 $(PACKAGENAME) $(DESTDIR)/$(SBINDIR)
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(MANDIR)/man1
+ $(INSTALL) -m 0644 $(PACKAGENAME).1 $(DESTDIR)/$(MANDIR)/man1
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
+- $(INSTALL) -m 0644 $(DATAFILES) $(DESTDIR)/$(DATADIR)/$(PACKAGENAME)
+- make -C po install
++ $(MAKE) -C po install
+
+ install-gui: gui
+ $(INSTALL) -d -m 0755 $(DESTDIR)/$(SBINDIR)
+@@ -112,8 +108,8 @@
+
+ clean:
+ rm -f $(PACKAGENAME).o $(PACKAGENAME) $(PACKAGENAME)-static $(PACKAGENAME)-compressed
+- make -C core clean
+- make -C gui clean
++ $(MAKE) -C core clean
++ $(MAKE) -C gui clean
+
+ .timestamp:
+ date --utc +%Y%m%d%H%M%S > $@
+--- lshw-B.02.17.orig/src/core/Makefile
++++ lshw-B.02.17/src/core/Makefile
+@@ -1,10 +1,9 @@
+ PACKAGENAME?=lshw
+
+-CXX=c++
++CXX?=c++
+ INCLUDES=
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+-CXXFLAGS?=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+-LDFLAGS=
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ LDSTATIC=
+ LIBS=
+
+--- lshw-B.02.17.orig/src/core/pci.cc
++++ lshw-B.02.17/src/core/pci.cc
+@@ -17,7 +17,7 @@
+
+ #define PROC_BUS_PCI "/proc/bus/pci"
+ #define SYS_BUS_PCI "/sys/bus/pci"
+-#define PCIID_PATH DATADIR"/pci.ids:/usr/share/lshw/pci.ids:/usr/local/share/pci.ids:/usr/share/pci.ids:/etc/pci.ids:/usr/share/hwdata/pci.ids:/usr/share/misc/pci.ids"
++#define PCIID_PATH "/usr/share/misc/pci.ids"
+
+ #define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */
+ #define PCI_VENDOR_ID 0x00 /* 16 bits */
+--- lshw-B.02.17.orig/src/core/usb.cc
++++ lshw-B.02.17/src/core/usb.cc
+@@ -27,7 +27,7 @@
+
+ #define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
+ #define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
+-#define USBID_PATH DATADIR"/usb.ids:/usr/share/lshw/usb.ids:/usr/local/share/usb.ids:/usr/share/usb.ids:/etc/usb.ids:/usr/share/hwdata/usb.ids:/usr/share/misc/usb.ids"
++#define USBID_PATH "/usr/share/misc/usb.ids"
+
+ #define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
+ #define USB_CLASS_AUDIO 1
+--- lshw-B.02.17.orig/src/gui/Makefile
++++ lshw-B.02.17/src/gui/Makefile
+@@ -1,5 +1,7 @@
+ PACKAGENAME?=lshw
+
++SQLITE?=0
++
+ CXX?=c++
+ CC?=cc
+ STRIP?=strip
+@@ -8,13 +10,14 @@
+ DEFINES=-DPREFIX=\"$(PREFIX)\" -DSBINDIR=\"$(SBINDIR)\" -DMANDIR=\"$(MANDIR)\" -DDATADIR=\"$(DATADIR)\"
+ GTKINCLUDES=$(shell pkg-config gtk+-2.0 --cflags)
+ INCLUDES=-I../core $(GTKINCLUDES)
+-CXXFLAGS=-g -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
++CXXFLAGS += -Wall $(INCLUDES) $(DEFINES) $(RPM_OPT_FLAGS)
+ CFLAGS=$(CXXFLAGS) $(DEFINES)
+ GTKLIBS=$(shell pkg-config gtk+-2.0 gmodule-2.0 --libs)
+-LIBS=-L../core -llshw -lresolv -lsqlite3 $(GTKLIBS)
+-LDFLAGS=
+-ifneq ($(shell $(LD) --help 2| grep -- --as-needed), )
+- LDFLAGS+= -Wl,--as-needed
++LIBS=-L../core -llshw -lresolv $(GTKLIBS)
++
++ifeq ($(SQLITE), 1)
++ CXXFLAGS+= -DSQLITE $(shell pkg-config --cflags sqlite3)
++ LIBS+= $(shell pkg-config --libs sqlite3)
+ endif
+
+ OBJS = gtk-lshw.o callbacks.o engine.o print-gui.o stock.o
+@@ -39,7 +42,6 @@
+ $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+ install: all
+- $(STRIP) gtk-$(PACKAGENAME)
+
+ clean:
+ rm -f $(OBJS) gtk-$(PACKAGENAME) gtk-lshw.glade.bak gtk-lshw.gladep.bak callbacks.c.bak callbacks.h.bak Makefile.bak
diff --git a/sys-apps/lshw/lshw-02.16b-r2.ebuild b/sys-apps/lshw/lshw-02.16b-r2.ebuild
new file mode 100644
index 000000000000..2d49dc80a6e4
--- /dev/null
+++ b/sys-apps/lshw/lshw-02.16b-r2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit flag-o-matic eutils toolchain-funcs
+
+MAJ_PV=${PV:0:${#PV}-1}
+MIN_PVE=${PV:0-1}
+MIN_PV=${MIN_PVE/b/B}
+
+MY_P="$PN-$MIN_PV.$MAJ_PV"
+DESCRIPTION="Hardware Lister"
+HOMEPAGE="http://ezix.org/project/wiki/HardwareLiSter"
+SRC_URI="http://ezix.org/software/files/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="gtk sqlite static"
+
+REQUIRED_USE="static? ( !gtk )"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ sqlite? ( virtual/pkgconfig )"
+RDEPEND="${RDEPEND}
+ sys-apps/hwids"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ # correct gettext behavior
+ if [[ -n "${LINGUAS+x}" ]] ; then
+ local langs
+
+ for i in $(cd po ; echo *.po | sed 's/\.po//') ; do
+ if has ${i} ${LINGUAS} ; then
+ langs += " ${i}"
+ fi
+ done
+ sed -i \
+ -e "/^LANGUAGES =/ s/=.*/= $langs/" \
+ src/po/Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC CXX AR
+ use static && append-ldflags -static
+
+ local sqlite=$(usex sqlite 1 0)
+
+ emake SQLITE=$sqlite all
+ if use gtk ; then
+ emake SQLITE=$sqlite gui
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
+ dodoc README docs/*
+ if use gtk ; then
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install-gui
+ make_desktop_entry /usr/sbin/gtk-lshw "Hardware Lister" "/usr/share/lshw/artwork/logo.svg"
+ fi
+}
diff --git a/sys-apps/lshw/lshw-02.17b-r1.ebuild b/sys-apps/lshw/lshw-02.17b-r1.ebuild
new file mode 100644
index 000000000000..c16dc9abb817
--- /dev/null
+++ b/sys-apps/lshw/lshw-02.17b-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit flag-o-matic eutils toolchain-funcs
+
+MAJ_PV=${PV:0:${#PV}-1}
+MIN_PVE=${PV:0-1}
+MIN_PV=${MIN_PVE/b/B}
+
+MY_P="$PN-$MIN_PV.$MAJ_PV"
+DESCRIPTION="Hardware Lister"
+HOMEPAGE="http://ezix.org/project/wiki/HardwareLiSter"
+SRC_URI="http://ezix.org/software/files/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="gtk sqlite static"
+
+REQUIRED_USE="static? ( !gtk )"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ sqlite? ( virtual/pkgconfig )"
+RDEPEND="${RDEPEND}
+ sys-apps/hwids"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-gentoo.patch \
+ "${FILESDIR}"/${P}-fat.patch
+ # correct gettext behavior
+ if [[ -n "${LINGUAS+x}" ]] ; then
+ local langs
+
+ for i in $(cd src/po ; echo *.po | sed 's/\.po//') ; do
+ if has ${i} ${LINGUAS} ; then
+ langs += " ${i}"
+ fi
+ done
+ sed -i \
+ -e "/^LANGUAGES =/ s/=.*/= $langs/" \
+ src/po/Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC CXX AR
+ use static && append-ldflags -static
+
+ local sqlite=$(usex sqlite 1 0)
+
+ emake SQLITE=$sqlite all
+ if use gtk ; then
+ emake SQLITE=$sqlite gui
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
+ dodoc README docs/*
+ if use gtk ; then
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install-gui
+ make_desktop_entry /usr/sbin/gtk-lshw "Hardware Lister" "/usr/share/lshw/artwork/logo.svg"
+ fi
+}
diff --git a/sys-apps/lshw/lshw-02.17b.ebuild b/sys-apps/lshw/lshw-02.17b.ebuild
new file mode 100644
index 000000000000..a7f7c0b6792f
--- /dev/null
+++ b/sys-apps/lshw/lshw-02.17b.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit flag-o-matic eutils toolchain-funcs
+
+MAJ_PV=${PV:0:${#PV}-1}
+MIN_PVE=${PV:0-1}
+MIN_PV=${MIN_PVE/b/B}
+
+MY_P="$PN-$MIN_PV.$MAJ_PV"
+DESCRIPTION="Hardware Lister"
+HOMEPAGE="http://ezix.org/project/wiki/HardwareLiSter"
+SRC_URI="http://ezix.org/software/files/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="gtk sqlite static"
+
+REQUIRED_USE="static? ( !gtk )"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ sqlite? ( virtual/pkgconfig )"
+RDEPEND="${RDEPEND}
+ sys-apps/hwids"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+ # correct gettext behavior
+ if [[ -n "${LINGUAS+x}" ]] ; then
+ local langs
+
+ for i in $(cd src/po ; echo *.po | sed 's/\.po//') ; do
+ if has ${i} ${LINGUAS} ; then
+ langs += " ${i}"
+ fi
+ done
+ sed -i \
+ -e "/^LANGUAGES =/ s/=.*/= $langs/" \
+ src/po/Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC CXX AR
+ use static && append-ldflags -static
+
+ local sqlite=$(usex sqlite 1 0)
+
+ emake SQLITE=$sqlite all
+ if use gtk ; then
+ emake SQLITE=$sqlite gui
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
+ dodoc README docs/*
+ if use gtk ; then
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install-gui
+ make_desktop_entry /usr/sbin/gtk-lshw "Hardware Lister" "/usr/share/lshw/artwork/logo.svg"
+ fi
+}
diff --git a/sys-apps/lshw/metadata.xml b/sys-apps/lshw/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/lshw/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-apps/lssbus/Manifest b/sys-apps/lssbus/Manifest
new file mode 100644
index 000000000000..1809be1bab1c
--- /dev/null
+++ b/sys-apps/lssbus/Manifest
@@ -0,0 +1 @@
+DIST lssbus-0.1.tar.gz 13576 RMD160 f9fc25011f51f6f534f1883888db41126b3169d5 SHA1 7c2f54e67a5173419c650a31ce001807ae216adc SHA256 d88a03ecfeef505cfbe4444013ea46832cf0a3297c34b87e78c494b0e31896e0
diff --git a/sys-apps/lssbus/lssbus-0.1.ebuild b/sys-apps/lssbus/lssbus-0.1.ebuild
new file mode 100644
index 000000000000..f6a951d2fa0f
--- /dev/null
+++ b/sys-apps/lssbus/lssbus-0.1.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="Small utility for Linux/SPARC that list devices on SBUS"
+HOMEPAGE="http://people.redhat.com/tcallawa/lssbus/"
+SRC_URI="http://people.redhat.com/tcallawa/lssbus/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* sparc"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+src_install() {
+ dosbin lssbus
+ dodoc COPYING README
+}
diff --git a/sys-apps/lssbus/metadata.xml b/sys-apps/lssbus/metadata.xml
new file mode 100644
index 000000000000..343785db6261
--- /dev/null
+++ b/sys-apps/lssbus/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>sparc</herd>
+<maintainer>
+ <email>sparc@gentoo.org</email>
+ <name>Sparc Team</name>
+</maintainer>
+<longdescription>
+lssbus is a tool to list sbus devices in a manner similar to lspci.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/magneto-core/Manifest b/sys-apps/magneto-core/Manifest
new file mode 100644
index 000000000000..520d012e476c
--- /dev/null
+++ b/sys-apps/magneto-core/Manifest
@@ -0,0 +1 @@
+DIST entropy-254.tar.bz2 18516662 SHA256 5e411472eaf7016a68a4aa81ef92dd3aad8403fc65a0ffb09c57b91c959ca3a6 SHA512 3b3e82abad8008720e370b7892b7be1c48aaa6605914db977f68b9a108ada0a4adbaa5b7b50a9a02ba9c8b0bdefadcda1eceee2c7c2abc385b3daf669649e2da WHIRLPOOL 593469b858707e4ceca56146fa1d608141e44dda0a0921ed6a3ec566878c1e3c153410233f088d57db4f8bd9d1c796bd945cbea3ba455572efc05eca42023ce5
diff --git a/sys-apps/magneto-core/magneto-core-254.ebuild b/sys-apps/magneto-core/magneto-core-254.ebuild
new file mode 100644
index 000000000000..d15490f0d8c7
--- /dev/null
+++ b/sys-apps/magneto-core/magneto-core-254.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 multilib
+
+DESCRIPTION="Entropy Package Manager notification applet library"
+HOMEPAGE="http://www.sabayon.org"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+SRC_URI="mirror://sabayon/sys-apps/entropy-${PV}.tar.bz2"
+S="${WORKDIR}/entropy-${PV}/magneto"
+
+DEPEND="~sys-apps/rigo-daemon-${PV}[${PYTHON_USEDEP}]
+ ${PYTHON_DEPS}"
+RDEPEND="${DEPEND}
+ x11-misc/xdg-utils"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_install() {
+ emake DESTDIR="${D}" LIBDIR="usr/lib" magneto-core-install || die "make install failed"
+ python_optimize "${D}/usr/$(get_libdir)/entropy/magneto"
+}
diff --git a/sys-apps/magneto-core/metadata.xml b/sys-apps/magneto-core/metadata.xml
new file mode 100644
index 000000000000..54af5bbe222c
--- /dev/null
+++ b/sys-apps/magneto-core/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>lxnay@gentoo.org</email>
+ <name>Fabio Erculiani</name>
+ </maintainer>
+</pkgmetadata>
+
diff --git a/sys-apps/makedev/Manifest b/sys-apps/makedev/Manifest
new file mode 100644
index 000000000000..7bd3ed305330
--- /dev/null
+++ b/sys-apps/makedev/Manifest
@@ -0,0 +1 @@
+DIST MAKEDEV-3.23-1.tar.gz 122613 SHA256 46cebf1e5e36838a5637bdd2b7af07eb1773599e1288c2d1c777e2875d721965 SHA512 5ca82cdcc4544042ede552370acf6266929fa34d177bd8e831573ccc1c57e06ec87766b9e60a686ec1449b204ae0ac3c048eab32b57ce8d610366219d3a77dbc WHIRLPOOL fa11a2e0a143755af7c877171f67a95f6ea566cf0e9e8218bd412b98e75e50763e06cfc1c659527596a50f39cc905a3484f2fd5578a96d6389c7dc22ecadd103
diff --git a/sys-apps/makedev/files/makedev-3.23.1-headers.patch b/sys-apps/makedev/files/makedev-3.23.1-headers.patch
new file mode 100644
index 000000000000..fac3fb1b711c
--- /dev/null
+++ b/sys-apps/makedev/files/makedev-3.23.1-headers.patch
@@ -0,0 +1,12 @@
+http://bugs.gentoo.org/339674
+
+--- a/MAKEDEV-3.23/sel.h
++++ b/MAKEDEV-3.23/sel.h
+@@ -18,6 +18,7 @@
+ */
+
+ #ifdef MAKEDEV_SELINUX
++#include <limits.h>
+ #include <selinux/selinux.h>
+ static char secontextname[PATH_MAX + 2];
+ static char secontextflag[PATH_MAX + 7];
diff --git a/sys-apps/makedev/makedev-3.23.1.ebuild b/sys-apps/makedev/makedev-3.23.1.ebuild
new file mode 100644
index 000000000000..6cc925cf58af
--- /dev/null
+++ b/sys-apps/makedev/makedev-3.23.1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+MY_PN="MAKEDEV"
+MY_VER=${PV%.*}
+MY_REL=${PV#${MY_VER}.}
+MY_P="${MY_PN}-${MY_VER}"
+DESCRIPTION="program used for creating device files in /dev"
+HOMEPAGE="http://people.redhat.com/nalin/MAKEDEV/"
+SRC_URI="http://people.redhat.com/nalin/MAKEDEV/${MY_P}-${MY_REL}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="build selinux"
+
+RDEPEND="!<sys-apps/baselayout-2.0.0_rc"
+DEPEND=""
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-headers.patch #339674
+}
+
+src_compile() {
+ use selinux && export SELINUX=1
+ emake CC="$(tc-getCC)" OPTFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ # set devdir to makedevdir so we dont have to worry about /dev
+ emake install DESTDIR="${D}" makedevdir=/sbin devdir=/sbin || die
+ dodoc *.txt
+ keepdir /dev
+}
+
+pkg_postinst() {
+ if use build ; then
+ # set up a base set of nodes to make recovery easier #368597
+ "${ROOT}"/sbin/MAKEDEV -c "${ROOT}"/etc/makedev.d \
+ -d "${ROOT}"/dev console hda input ptmx std sd tty
+ # trim useless nodes
+ rm -f "${ROOT}"/dev/fd[0-9]* # floppy
+ rm -f "${ROOT}"/dev/sd[a-d][a-z]* "${ROOT}"/dev/sd[e-z]* # excess sata/scsi
+ rm -f "${ROOT}"/dev/tty[a-zA-Z]* # excess tty
+ fi
+}
diff --git a/sys-apps/makedev/metadata.xml b/sys-apps/makedev/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/makedev/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-apps/man-db/Manifest b/sys-apps/man-db/Manifest
new file mode 100644
index 000000000000..65d14004dacb
--- /dev/null
+++ b/sys-apps/man-db/Manifest
@@ -0,0 +1,3 @@
+DIST man-db-2.6.6.tar.xz 1448576 SHA256 7da90f8d8df91e0e682769d50f4bdb905f525b5d0f01e7e5b8cc3c6da45f66c3 SHA512 7abb8609e1113dd1852076c4c71557c3b376fefa7e42fa39198f7b882f4b3fe733983045742c4b3903be2c953c09c724f735619b4396283a4ed2ad7816aaf4ec WHIRLPOOL e5c7b41afd7374bb1df3024134f9bd8a1af42b5ad63d4e516e946b0e8ccc88bafc055fdba707b0c764030e92748b225a72672bfe07e2bc3e8d78526d17f5ff72
+DIST man-db-2.6.7.1.tar.xz 1452280 SHA256 8d65559838fccca774e3ef7c15c073180c786e728785c735e136297facca41fc SHA512 91e1036701174c5623a4cf4208a93130822dc9c61ffd9c6bf0dddaf7c4c5b2401e6238f60578dfa81a11d67d360cbc4d45af920542fb4a0624c7169b17a618f8 WHIRLPOOL 30c510289d1444b3231704c22ddf2c17b58d4aa8b9e8a94552537fbc971b23f16b2c43a32fa9f85fb7b8eca2fd71a73d52955fcd0ab24ef49d3903832eafecf7
+DIST man-db-2.7.1.tar.xz 1498272 SHA256 c4876204a3fafb4d8ccc1d172c0431ee581d95558cbd6c4e79caca7717049e0e SHA512 246d833bd456a6dd178035b4be37dc810872b6480145d6c2c605deeb664d105b285f61827b739717d6936de28c4275a99ed8fae2d173b16c1c0673b1171a65ce WHIRLPOOL 10c56b861411674f4ca92bafe7c0faf4f6c2cbcc6b2db8f87f2e2ee59152797667619e60ae50cae33ee21ff3e58cb7b10627ce2f16adf65fd8794b0fabb71290
diff --git a/sys-apps/man-db/files/man-db.cron b/sys-apps/man-db/files/man-db.cron
new file mode 100644
index 000000000000..ced63900fca6
--- /dev/null
+++ b/sys-apps/man-db/files/man-db.cron
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Use same perms/settings as the ebuild.
+if [ ! -d /var/cache/man ]; then
+ mkdir -p /var/cache/man
+ chown man:root /var/cache/man
+ chmod 2755 /var/cache/man
+fi
+
+exec nice mandb --quiet
diff --git a/sys-apps/man-db/man-db-2.6.6.ebuild b/sys-apps/man-db/man-db-2.6.6.ebuild
new file mode 100644
index 000000000000..3c9d1959730e
--- /dev/null
+++ b/sys-apps/man-db/man-db-2.6.6.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils user
+
+DESCRIPTION="a man replacement that utilizes berkdb instead of flat files"
+HOMEPAGE="http://www.nongnu.org/man-db/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~arm-linux ~x86-linux"
+IUSE="berkdb +gdbm nls selinux static-libs zlib"
+
+CDEPEND="dev-libs/libpipeline
+ berkdb? ( sys-libs/db )
+ gdbm? ( sys-libs/gdbm )
+ !berkdb? ( !gdbm? ( sys-libs/gdbm ) )
+ sys-apps/groff
+ zlib? ( sys-libs/zlib )
+ !sys-apps/man"
+DEPEND="${CDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ nls? (
+ >=app-text/po4a-0.45
+ sys-devel/gettext
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-mandb )
+"
+
+pkg_setup() {
+ # Create user now as Makefile in src_install does setuid/chown
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+
+ if (use gdbm && use berkdb) || (use !gdbm && use !berkdb) ; then #496150
+ ewarn "Defaulting to USE=gdbm due to ambiguous berkdb/gdbm USE flag settings"
+ fi
+}
+
+src_configure() {
+ export ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ --enable-setuid \
+ --with-sections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ --with-db=$(usex gdbm gdbm $(usex berkdb db gdbm))
+}
+
+src_install() {
+ default
+ dodoc docs/{HACKING,TODO}
+ prune_libtool_files
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/man-db.cron man-db #289884
+
+ keepdir /var/cache/man
+ fowners man:0 /var/cache/man
+ fperms 2755 /var/cache/man
+}
+
+pkg_preinst() {
+ if [[ -f ${EROOT}var/cache/man/whatis ]] ; then
+ einfo "Cleaning ${EROOT}var/cache/man from sys-apps/man"
+ find "${EROOT}"var/cache/man -type f '!' '(' -name index.bt -o -name index.db ')' -delete
+ fi
+ if [[ ! -g ${EROOT}var/cache/man ]] ; then
+ einfo "Resetting permissions on ${EROOT}var/cache/man" #447944
+ mkdir -p "${EROOT}var/cache/man"
+ chown -R man:0 "${EROOT}"var/cache/man
+ find "${EROOT}"var/cache/man -type d '!' -perm /g=s -exec chmod 2755 {} +
+ fi
+}
diff --git a/sys-apps/man-db/man-db-2.6.7.1.ebuild b/sys-apps/man-db/man-db-2.6.7.1.ebuild
new file mode 100644
index 000000000000..5d3dccdba664
--- /dev/null
+++ b/sys-apps/man-db/man-db-2.6.7.1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils user
+
+DESCRIPTION="a man replacement that utilizes berkdb instead of flat files"
+HOMEPAGE="http://www.nongnu.org/man-db/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE="berkdb +gdbm nls selinux static-libs zlib"
+
+CDEPEND=">=dev-libs/libpipeline-1.3.0
+ berkdb? ( sys-libs/db )
+ gdbm? ( sys-libs/gdbm )
+ !berkdb? ( !gdbm? ( sys-libs/gdbm ) )
+ sys-apps/groff
+ zlib? ( sys-libs/zlib )
+ !sys-apps/man"
+DEPEND="${CDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ nls? (
+ >=app-text/po4a-0.45
+ sys-devel/gettext
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-mandb )
+"
+
+pkg_setup() {
+ # Create user now as Makefile in src_install does setuid/chown
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+
+ if (use gdbm && use berkdb) || (use !gdbm && use !berkdb) ; then #496150
+ ewarn "Defaulting to USE=gdbm due to ambiguous berkdb/gdbm USE flag settings"
+ fi
+}
+
+src_configure() {
+ export ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ --enable-setuid \
+ --with-sections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ --with-db=$(usex gdbm gdbm $(usex berkdb db gdbm))
+}
+
+src_install() {
+ default
+ dodoc docs/{HACKING,TODO}
+ prune_libtool_files
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/man-db.cron man-db #289884
+
+ keepdir /var/cache/man
+ fowners man:0 /var/cache/man
+ fperms 2755 /var/cache/man
+}
+
+pkg_preinst() {
+ if [[ -f ${EROOT}var/cache/man/whatis ]] ; then
+ einfo "Cleaning ${EROOT}var/cache/man from sys-apps/man"
+ find "${EROOT}"var/cache/man -type f '!' '(' -name index.bt -o -name index.db ')' -delete
+ fi
+ if [[ ! -g ${EROOT}var/cache/man ]] ; then
+ einfo "Resetting permissions on ${EROOT}var/cache/man" #447944
+ mkdir -p "${EROOT}var/cache/man"
+ chown -R man:0 "${EROOT}"var/cache/man
+ find "${EROOT}"var/cache/man -type d '!' -perm /g=s -exec chmod 2755 {} +
+ fi
+}
diff --git a/sys-apps/man-db/man-db-2.7.1.ebuild b/sys-apps/man-db/man-db-2.7.1.ebuild
new file mode 100644
index 000000000000..30b5a8bd6873
--- /dev/null
+++ b/sys-apps/man-db/man-db-2.7.1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils user versionator
+
+DESCRIPTION="a man replacement that utilizes berkdb instead of flat files"
+HOMEPAGE="http://www.nongnu.org/man-db/"
+SRC_URI="mirror://nongnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
+IUSE="berkdb +gdbm nls selinux static-libs zlib"
+
+CDEPEND=">=dev-libs/libpipeline-1.4.0
+ berkdb? ( sys-libs/db )
+ gdbm? ( sys-libs/gdbm )
+ !berkdb? ( !gdbm? ( sys-libs/gdbm ) )
+ sys-apps/groff
+ zlib? ( sys-libs/zlib )
+ !sys-apps/man"
+DEPEND="${CDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig
+ nls? (
+ >=app-text/po4a-0.45
+ sys-devel/gettext
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-mandb )
+"
+
+pkg_setup() {
+ # Create user now as Makefile in src_install does setuid/chown
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+
+ if (use gdbm && use berkdb) || (use !gdbm && use !berkdb) ; then #496150
+ ewarn "Defaulting to USE=gdbm due to ambiguous berkdb/gdbm USE flag settings"
+ fi
+}
+
+src_configure() {
+ export ac_cv_lib_z_gzopen=$(usex zlib)
+ econf \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ --with-systemdtmpfilesdir="${EPREFIX}"/usr/lib/tmpfiles.d \
+ --enable-setuid \
+ --with-sections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ --with-db=$(usex gdbm gdbm $(usex berkdb db gdbm))
+}
+
+src_install() {
+ default
+ dodoc docs/{HACKING,TODO}
+ prune_libtool_files
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/man-db.cron man-db #289884
+
+ keepdir /var/cache/man
+ fowners man:0 /var/cache/man
+ fperms 2755 /var/cache/man
+}
+
+pkg_preinst() {
+ if [[ -f ${EROOT}var/cache/man/whatis ]] ; then
+ einfo "Cleaning ${EROOT}var/cache/man from sys-apps/man"
+ find "${EROOT}"var/cache/man -type f '!' '(' -name index.bt -o -name index.db ')' -delete
+ fi
+ if [[ ! -g ${EROOT}var/cache/man ]] ; then
+ einfo "Resetting permissions on ${EROOT}var/cache/man" #447944
+ mkdir -p "${EROOT}var/cache/man"
+ chown -R man:0 "${EROOT}"var/cache/man
+ find "${EROOT}"var/cache/man -type d '!' -perm /g=s -exec chmod 2755 {} +
+ fi
+}
+
+pkg_postinst() {
+ if [[ $(get_version_component_range 2 ${REPLACING_VERSIONS}) -lt 7 ]] ; then
+ einfo "Rebuilding man-db from scratch with new database format!"
+ mandb --quiet --create
+ fi
+}
diff --git a/sys-apps/man-db/metadata.xml b/sys-apps/man-db/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/man-db/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-apps/man-pages-posix/Manifest b/sys-apps/man-pages-posix/Manifest
new file mode 100644
index 000000000000..8aa3d8930e67
--- /dev/null
+++ b/sys-apps/man-pages-posix/Manifest
@@ -0,0 +1 @@
+DIST man-pages-posix-2013-a.tar.xz 930736 SHA256 19633a5c75ff7deab35b1d2c3d5b7748e7bd4ef4ab598b647bb7e7f60b90a808 SHA512 e6ec8eb57269fadf368aeaac31b5a98b9c71723d4d5cc189f9c4642d6e865c88e44f77481dccbdb72e31526488eb531f624d455016361687a834ccfcac19fa14 WHIRLPOOL d2dcd2c09e0696f8eaffec7b2c64b73e1fc2965edfd45c2e0b547acb6035ce6ac60cf3cc247dd3754050fc7520adf04e7ba0a411605206cfead2d15d05d67665
diff --git a/sys-apps/man-pages-posix/files/man-pages-2.08-updates.patch b/sys-apps/man-pages-posix/files/man-pages-2.08-updates.patch
new file mode 100644
index 000000000000..b660e9137ed9
--- /dev/null
+++ b/sys-apps/man-pages-posix/files/man-pages-2.08-updates.patch
@@ -0,0 +1,11 @@
+--- man1p/ipcs.1p
++++ man1p/ipcs.1p
+@@ -544,7 +544,7 @@
+ None.
+ .SH SEE ALSO
+ .LP
+-The System Interfaces volume of IEEE\ Std\ 1003.1-2001, \fImsgrcv\fP(),
++\fIipcrm\fP , The System Interfaces volume of IEEE\ Std\ 1003.1-2001, \fImsgrcv\fP(),
+ \fImsgsnd\fP(), \fIsemget\fP(), \fIsemop\fP(), \fIshmat\fP(), \fIshmdt\fP(),
+ \fIshmget\fP()
+ .SH COPYRIGHT
diff --git a/sys-apps/man-pages-posix/man-pages-posix-2013a.ebuild b/sys-apps/man-pages-posix/man-pages-posix-2013a.ebuild
new file mode 100644
index 000000000000..20214606e5e9
--- /dev/null
+++ b/sys-apps/man-pages-posix/man-pages-posix-2013a.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+MY_P="${PN}-${PV:0:4}-${PV:0-1}"
+DESCRIPTION="POSIX man-pages (0p, 1p, 3p)"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/${PN}/${MY_P}.tar.xz"
+
+LICENSE="man-pages-posix-2013"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man !<sys-apps/man-pages-3"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() { :; }
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install DESTDIR="${ED}" || die
+ dodoc man-pages-*.Announce README
+}
diff --git a/sys-apps/man-pages-posix/metadata.xml b/sys-apps/man-pages-posix/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/man-pages-posix/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-apps/man-pages/Manifest b/sys-apps/man-pages/Manifest
new file mode 100644
index 000000000000..03832061efcd
--- /dev/null
+++ b/sys-apps/man-pages/Manifest
@@ -0,0 +1,11 @@
+DIST man-pages-3.75.tar.xz 1293528 SHA256 06aaca0a3958c3fdae3b3cfc3c2a92d54c2a4ceafad8a6d97f67fda14650d2f6 SHA512 fd09bdadbfe6303f1a136b7b51a65cfa0857811e928d7d13b5a090fed045fb69c3889236b98e8ea67c3f42ccf014200f86bf44c0fa5e732b9ccac7393c509c96 WHIRLPOOL 4ea054ea3cd2091784fa1e42e9bed24dec917a7d8d55da8f45fcc2b5c9753aa1770facf00ebdce67eda13e4bd9fb738b40208ff13e80a7cee2eb789ab4f5a831
+DIST man-pages-3.77.tar.xz 1308048 SHA256 fc630f063b4671cece6cffee47d0ad25b871219ffba8bf2784f084512af5954f SHA512 83140224efd007b5e5eddd6b8b2d78ddd505a44d897b07a215ec128041d82523de42eee737d1ac7047b1c0f40a6b8d1fc58bb6e03df6b81e383458431309b46f WHIRLPOOL 9ea997c9e559134c71120f711e5870233ed71e4165a37755a2f6bbb548dc19f647d195245fe336dfbd8a1fa6150667e1794b300c2b5991f05ee145a2725d4a82
+DIST man-pages-3.78.tar.xz 1315792 SHA256 c52897a17fbc6304d3fe273e7eb12d6feff82d460a62290121cfbaf501d3a37e SHA512 fd84bac9c38902c4a0d5e9a781a81ba62aaded06ca1fdb664460fcf93e2b9fb657edd06bdbf2b4ccfd2eb2ff1408e7c7b961c2aae3e9e592c1575489dc3bfd0f WHIRLPOOL a9d6caca7a1141a3068e4aa9e3bd07e3129b539f1f18cec0be11f1ad2bf19b2c56f8b01ba5e2fa559d2f90815446e0d0357dd0db16ea63a8ad4b53034e2ec9e8
+DIST man-pages-3.79.tar.xz 1320688 SHA256 b2d608c8910850c560658370a9acd5d25cb92a686e3e7f3735884922c8aad6be SHA512 7bcfb815222f1665ae5be39c809b309acc0da9cf2712ddaa51a040a31018275cf77adf25571543e640e37f1f7ca1ebe2fcc515930151606f35d4d933b9547efe WHIRLPOOL 897747ad8d8e14a2b38d6c98321a39ff19ea09a02b47e079e9caa8f6d49b8acef5334a7557bffa10adba943451d3b54b5ea561f609e9f81b7edfb99f1e8051cb
+DIST man-pages-3.80.tar.xz 1332548 SHA256 686847880557aec5a4f09bdc12d92185a784baa47c52f53676f06acc4b0d40c2 SHA512 a21be65f566654c3ecaea2b6a4da4db2b83cd64debaeb36c4ff5b4771d70c382fe24c66a025f9e531799a99d0be53a6a28545481c2403dc6193952999c1c84f0 WHIRLPOOL e4a9a39660f99c206469871934d1145b42b88670fb5525bfe329a39e62b2657bf5730ac071fb87e4f3110ecd4f299253979c6b53496c5b378d2ff4a4a37af353
+DIST man-pages-3.81.tar.xz 1344848 SHA256 b5b98411ff4548262d9ab30e1ad68ca1ea228f6c5c51ed5490bd92f00b9cf2c2 SHA512 4f152f4f833f011ce9a39bbf70663dcd565d74a9ccaf10a0c9da810df0efc14227b9ef98edd1087ae722b5d21b827868d32c5c66150953645bd17a3f25ea2fc4 WHIRLPOOL 93fb6f29776dd704c685092eb312d2cc72e267f06dc5787489fa78e2ce99ceec503a632e90de347e55c74f8fbf9bd4a501140cce7395c785f7dec7d58942e0c8
+DIST man-pages-3.82.tar.xz 1357152 SHA256 547273dd0a1c26e5bb2169baa50a7e0e0c93b6e41997729d4d8638a8513018b1 SHA512 d81ddcab7385f2e92db3dc5643d28ca767b2bd96077cdffbe20866bd0a1f0a2811eba6b0f07becbe82110e8ff4f971379d5229995bb99d6eebf9d65ba42bba93 WHIRLPOOL 58323b003dcc02d0c46b941105269a8cd5a74400b7a8160c2c56e78ab93f38b33da70519dd322fe0d953967aa5b9cd325b0fcf9e180ec79d3cc9238af6f36468
+DIST man-pages-3.83.tar.xz 1364196 SHA256 72fce6a1f282146504556ed54b93f06acef77f30114c1c00755b21bb5def7af2 SHA512 48ccca8f3a8f86bf1256e018230a2a9012f0684ac8243fae95ff0bc42cb7289ef577762f890c4ca2115967bde73378b29b7ee23c549653126c052253499827e5 WHIRLPOOL 0a005dc2b58a8e8e983c85725eafd02e0bb3b69835b76fc3ded338102ae68994f168aa7409a1d03e7d5ed4c453210a7122ab1a05a9368a901d540181db343942
+DIST man-pages-4.00.tar.xz 1368256 SHA256 444264eb7e3582f980ee3de073af394182ee6b9d5e03e89c55ba042dc20beba3 SHA512 cec9a539b549c500ec1ed86ec5f1d3e1b11b944a4166cd44e3c5fa0051c597528880809e3cde52dbc95ce5e7eadc3dcb2bf4a9eed1f40ec0401c4e84763a9d55 WHIRLPOOL e4c69f0ee80102339660a9bda9159fe6d4448839015c52855e3e7776f8a2e57f14c9f68502c61609c9d6a46a869f1b24b6b5f2eb7173dfb6e1b9a3346a5da169
+DIST man-pages-4.01.tar.xz 1395072 SHA256 d194b5d4a381724dc291d9f36621ab2cbb51c003d72dcbd95896366db3b8d284 SHA512 9b5680a1b230ba27b8b5277f8da3b06d09cc27b77c858b2deede50e09c455d75b334aa855e8a028e9ff2be10b7872b8e9f3ec1f7b0d17c546af445cadad3a89f WHIRLPOOL 42d029e8299de096ad67b75e5be09836d209130592955df6644d6e4b84d243ee9b69476b52477a217d7bfba4abc9a1a3b97a2553d021e6779fa9b2dfe09626e8
+DIST man-pages-gentoo-2.tar.bz2 5141 SHA256 b7d9423c2069e587deb7671273d4a1ffed7d31b9f95a689b128a759d636762f0 SHA512 6e6524b8ad6f1b8c9b147665ee32af49e05603dac61d433acd6b4f1164adef27cd542898f272b07d8659725013dac59c7f34a858968cc054a4785c945e14a770 WHIRLPOOL dcacb319a54ccd2a965786c816684de286581dee6f7b3f8ba4c97cc368e2e50abc92aad403dbdb7b0c15764accb06cd562046bcf14229ad12be242bb2bc7f651
diff --git a/sys-apps/man-pages/man-pages-3.75.ebuild b/sys-apps/man-pages/man-pages-3.75.ebuild
new file mode 100644
index 000000000000..9349878efcb6
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.75.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.77.ebuild b/sys-apps/man-pages/man-pages-3.77.ebuild
new file mode 100644
index 000000000000..bd78187334d3
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.77.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.78.ebuild b/sys-apps/man-pages/man-pages-3.78.ebuild
new file mode 100644
index 000000000000..9349878efcb6
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.78.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.79.ebuild b/sys-apps/man-pages/man-pages-3.79.ebuild
new file mode 100644
index 000000000000..9349878efcb6
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.79.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.80.ebuild b/sys-apps/man-pages/man-pages-3.80.ebuild
new file mode 100644
index 000000000000..bd78187334d3
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.80.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.81.ebuild b/sys-apps/man-pages/man-pages-3.81.ebuild
new file mode 100644
index 000000000000..9349878efcb6
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.81.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.82.ebuild b/sys-apps/man-pages/man-pages-3.82.ebuild
new file mode 100644
index 000000000000..9349878efcb6
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.82.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-3.83.ebuild b/sys-apps/man-pages/man-pages-3.83.ebuild
new file mode 100644
index 000000000000..9349878efcb6
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-3.83.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+RDEPEND="virtual/man
+ !<dev-libs/libaio-0.3.109-r2" #341953
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-4.00.ebuild b/sys-apps/man-pages/man-pages-4.00.ebuild
new file mode 100644
index 000000000000..0fdde8a33cb7
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-4.00.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+# Block packages that used to install colliding man pages #341953 #548900
+RDEPEND="virtual/man
+ !<sys-apps/attr-2.4.47-r2
+ !<dev-libs/libaio-0.3.109-r2"
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/man-pages-4.01.ebuild b/sys-apps/man-pages/man-pages-4.01.ebuild
new file mode 100644
index 000000000000..100de481e114
--- /dev/null
+++ b/sys-apps/man-pages/man-pages-4.01.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+GENTOO_PATCH=2
+
+DESCRIPTION="A somewhat comprehensive collection of Linux man pages"
+HOMEPAGE="http://www.kernel.org/doc/man-pages/"
+SRC_URI="mirror://kernel/linux/docs/man-pages/Archive/${P}.tar.xz
+ mirror://kernel/linux/docs/man-pages/${P}.tar.xz
+ http://man7.org/linux/man-pages/download/${P}.tar.xz
+ mirror://gentoo/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/man-pages-gentoo-${GENTOO_PATCH}.tar.bz2"
+
+LICENSE="man-pages GPL-2+ BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE_LINGUAS=" da de fr it ja nl pl ro ru zh_CN"
+IUSE="nls ${IUSE_LINGUAS// / linguas_}"
+RESTRICT="binchecks"
+
+# Block packages that used to install colliding man pages #341953 #548900
+RDEPEND="virtual/man
+ !<sys-apps/attr-2.4.47-r2
+ !<dev-libs/libaio-0.3.109-r2"
+PDEPEND="nls? (
+ linguas_da? ( app-i18n/man-pages-da )
+ linguas_de? ( app-i18n/man-pages-de )
+ linguas_fr? ( app-i18n/man-pages-fr )
+ linguas_it? ( app-i18n/man-pages-it )
+ linguas_ja? ( app-i18n/man-pages-ja )
+ linguas_nl? ( app-i18n/man-pages-nl )
+ linguas_pl? ( app-i18n/man-pages-pl )
+ linguas_ro? ( app-i18n/man-pages-ro )
+ linguas_ru? ( app-i18n/man-pages-ru )
+ linguas_zh_CN? ( app-i18n/man-pages-zh_CN )
+ )
+ sys-apps/man-pages-posix"
+
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ emake install prefix="${EPREFIX}/usr" DESTDIR="${D}"
+ dodoc man-pages-*.Announce README Changes*
+
+ # Override with Gentoo specific or additional Gentoo pages
+ cd "${WORKDIR}"/man-pages-gentoo
+ doman */*
+ dodoc README.Gentoo
+}
diff --git a/sys-apps/man-pages/metadata.xml b/sys-apps/man-pages/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/man-pages/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-apps/man/Manifest b/sys-apps/man/Manifest
new file mode 100644
index 000000000000..677fe5cffdaa
--- /dev/null
+++ b/sys-apps/man/Manifest
@@ -0,0 +1 @@
+DIST man-1.6g.tar.gz 256906 SHA256 ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f SHA512 c786fa2201aed92293e5590dc3ad5d550cf14e5059fa274ef7719af86ee4c892e747576495b6dc0a09286e73e2f0f0caf860216e0c8032d9ef13e5d26853048b WHIRLPOOL 1b531476108c27a3993023da430831c2d20f8045a51490d559a7f588f0771931defd7a3a745e9f1f03797e681eea8767aad4a27ab9abdd5d06ad935dc96a5020
diff --git a/sys-apps/man/files/makewhatis.cron b/sys-apps/man/files/makewhatis.cron
new file mode 100644
index 000000000000..bef5ea6d1e2d
--- /dev/null
+++ b/sys-apps/man/files/makewhatis.cron
@@ -0,0 +1,5 @@
+#!/bin/sh
+# this is part of the man package
+# it updates the search database for manpages
+
+exec nice makewhatis -u
diff --git a/sys-apps/man/files/man-1.5m2-apropos.patch b/sys-apps/man/files/man-1.5m2-apropos.patch
new file mode 100644
index 000000000000..9735a5330e88
--- /dev/null
+++ b/sys-apps/man/files/man-1.5m2-apropos.patch
@@ -0,0 +1,16 @@
+Ripped from Fedora
+
+--- man-1.5m2/src/apropos.sh
++++ man-1.5m2/src/apropos.sh
+@@ -19,9 +19,9 @@
+
+ # When man pages in your favorite locale look to grep like binary files
+ # (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
+-aproposgrepopt1='i'
++aproposgrepopt1='ai'
+ aproposgrepopt2=''
+-whatisgrepopt1='iw'
++whatisgrepopt1='aiw'
+ whatisgrepopt2='^'
+ grepopt1=$%apropos_or_whatis%grepopt1
+ grepopt2=$%apropos_or_whatis%grepopt2
diff --git a/sys-apps/man/files/man-1.6-cross-compile.patch b/sys-apps/man/files/man-1.6-cross-compile.patch
new file mode 100644
index 000000000000..184236918b91
--- /dev/null
+++ b/sys-apps/man/files/man-1.6-cross-compile.patch
@@ -0,0 +1,61 @@
+Fix up to work with cross-compiling ... most of these tests only
+need to see if the example compiled, not whether it runs ...
+
+--- configure
++++ configure
+@@ -232,15 +232,13 @@
+
+ echo checking for POSIX.1 header files
+ echo "#include <unistd.h>
+-main() {
+ #ifdef _POSIX_VERSION
+-exit(0);
++main() { exit(0); }
+ #else
+-exit(1);
+-#endif
+-}" > conftest.c
++# error no _POSIX_VERSION
++#endif" > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then
++if test -s conftest ; then
+ DEFS="$DEFS -DPOSIX"
+ fi
+ rm -f conftest conftest.c
+@@ -249,7 +247,7 @@
+ echo "#include <strings.h>
+ main() { exit(0); rindex(0, 0); bzero(0, 0); }" > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then :
++if test -s conftest ; then :
+ else DEFS="$DEFS -DUSG"
+ fi
+ rm -f conftest conftest.c
+@@ -258,7 +256,7 @@
+ echo '#include <sys/types.h>
+ main() { uid_t x; exit(0); }' > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then :
++if test -s conftest ; then :
+ else
+ uid_t=`awk '/pw_uid;/ {print $1}' $INCLUDEDIR/pwd.h`
+ DEFS="$DEFS -Duid_t=${uid_t} -Dgid_t=${uid_t}"
+@@ -291,7 +289,7 @@
+ #endif
+ main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then :
++if test -s conftest ; then :
+ elif test -d /usr/ucblib; then LIBS="$LIBS -L/usr/ucblib -lucb"
+ elif test -f /usr/lib/libPW.a; then LIBS="$LIBS -lPW"
+ else DEFS="$DEFS -DALLOCA_MISSING"
+@@ -321,7 +319,7 @@
+ struct option long_opts[] = { { "", no_argument, NULL, 0 } };
+ main() { exit(0); }' > conftest.c
+ eval $compile
+-if test -s conftest && ./conftest 2>/dev/null; then
++if test -s conftest ; then
+ manpathoption="--path"
+ else
+ manpathoption="-w"
diff --git a/sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch b/sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch
new file mode 100644
index 000000000000..9ecaeb70e16e
--- /dev/null
+++ b/sys-apps/man/files/man-1.6c-cut-duplicate-manpaths.patch
@@ -0,0 +1,83 @@
+http://bugs.gentoo.org/90186
+
+If we have entries in MANPATH that are really symlinks to other entries,
+then many man functions will yield duplicate entries.
+
+Without this patch, we see this behavior:
+$ echo $MANPATH
+/usr/share/man:/usr/man
+$ man --path
+/usr/share/man:/usr/man
+$ ls -ld /usr/share/man /usr/man
+lrwxrwxrwx 1 /usr/man -> /usr/share/man
+drwxr-xr-x 36 /usr/share/man
+$ man -k passwd
+passwd (1) - change user password
+passwd (1) - change user password
+
+With this patch, we get:
+$ echo $MANPATH
+/usr/share/man:/usr/man
+$ man --path
+/usr/share/man
+$ ls -ld /usr/share/man /usr/man
+lrwxrwxrwx 1 /usr/man -> /usr/share/man
+drwxr-xr-x 36 /usr/share/man
+$ man -k passwd
+passwd (1) - change user password
+
+--- man-1.6c/src/manpath.c
++++ man-1.6c/src/manpath.c
+@@ -380,6 +380,44 @@
+ }
+ }
+
++void trim_symlinked_manpaths (void);
++void
++trim_symlinked_manpaths () {
++ /*
++ * Skip symlinks to other entries in path.
++ * Do this after we've built the entire list.
++ */
++ struct stat *stat_cache;
++ size_t i, j, size;
++
++ if (!mandirlist)
++ return;
++
++ for (size = 0; mandirlist[size]; ++size)
++ /* count # of elements */;
++ if (size == 0)
++ return;
++ /* cache stat information for every element */
++ stat_cache = (struct stat *) my_malloc (size * sizeof(*stat_cache));
++ for (i = 0; i < size; ++i)
++ stat(mandirlist[i], &stat_cache[i]);
++
++#define EQU_STAT(s,d) ((s).st_dev == (d).st_dev && (s).st_ino == (d).st_ino)
++ for (i = 0; i < size; ++i) {
++ for (j = i+1; j < size; ++j) {
++ if (EQU_STAT(stat_cache[i], stat_cache[j])) {
++ /* these two entries are the same, so cut out the second one */
++ memmove(mandirlist+j, mandirlist+j+1, (size-j)*sizeof(*mandirlist));
++ memmove(stat_cache+j, stat_cache+j+1, (size-j)*sizeof(*stat_cache));
++ mandirlist[--size] = NULL;
++ --j;
++ }
++ }
++ }
++
++ free(stat_cache);
++}
++
+ void
+ init_manpath () {
+ static int done = 0;
+@@ -391,6 +431,7 @@
+ (manp = getenv ("MANPATH")) == NULL)
+ manp = ""; /* default path */
+ split (manp, to_mandirlist, 0);
++ trim_symlinked_manpaths ();
+ done = 1;
+ }
+ }
diff --git a/sys-apps/man/files/man-1.6e-headers.patch b/sys-apps/man/files/man-1.6e-headers.patch
new file mode 100644
index 000000000000..9c6fd6f43516
--- /dev/null
+++ b/sys-apps/man/files/man-1.6e-headers.patch
@@ -0,0 +1,13 @@
+--- gencat/genlib.c
++++ gencat/genlib.c
+@@ -49,10 +49,8 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
+-#ifdef SYSV
+ #include <sys/types.h>
+ #include <unistd.h>
+-#endif
+
+ #if !defined(__linux__) && !defined(__FreeBSD__)
+ #include <memory.h>
diff --git a/sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch b/sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch
new file mode 100644
index 000000000000..a7d74c32be3a
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-makewhatis-compression-cleanup.patch
@@ -0,0 +1,69 @@
+http://bugs.gentoo.org/331979
+
+patch by William Throwe <wthrowe@mit.edu>
+
+The problem is that a failed match() resets the RSTART variable used to
+extract filename_no_gz (visible in the trailing context of the patch),
+so it is important that no more match() commands are attempted after the
+successful one. Without the scoping, if (for example) the test for .bz2
+succeeds, it prevents testing for .lzma, but doesn't prevent testing for
+.xz. The failing .xz test causes RSTART to be set to zero so
+filename_no_gz becomes the empty string.
+
+--- man-1.6f/src/makewhatis.sh
++++ man-1.6f/src/makewhatis.sh
+@@ -234,7 +234,7 @@
+ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
+
+ function readline() {
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (use_compression) {
+ result = (pipe_cmd | getline);
+ if (result < 0) {
+ print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
+@@ -249,7 +249,7 @@
+ }
+
+ function closeline() {
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (use_compression) {
+ return close(pipe_cmd);
+ } else {
+ return close(filename);
+@@ -263,16 +263,20 @@
+ if (verbose) {
+ print "adding " filename > "/dev/stderr"
+ }
+-
++
+ use_zcat = match(filename,"\\.Z$") ||
+ match(filename,"\\.z$") || match(filename,"\\.gz$");
+- if (!use_zcat)
++ if (!use_zcat) {
+ use_bzcat = match(filename,"\\.bz2");
+- if(!use_bzcat)
+- use_lzcat = match(filename,"\\.lzma");
+- if(!use_lzcat)
+- use_xzcat = match(filename,"\\.xz");
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (!use_bzcat) {
++ use_lzcat = match(filename,"\\.lzma");
++ if (!use_lzcat) {
++ use_xzcat = match(filename,"\\.xz");
++ }
++ }
++ }
++ use_compression = (use_zcat || use_bzcat || use_lzcat || use_xzcat);
++ if (use_compression) {
+ filename_no_gz = substr(filename, 0, RSTART - 1);
+ } else {
+ filename_no_gz = filename;
+@@ -285,7 +289,7 @@
+ actual_section = section;
+ }
+ sub(/\..*/, "", progname);
+- if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
++ if (use_compression) {
+ if (use_zcat) {
+ pipe_cmd = "zcat \"" filename "\"";
+ } else if (use_bzcat) {
diff --git a/sys-apps/man/files/man-1.6f-man2html-compression-2.patch b/sys-apps/man/files/man-1.6f-man2html-compression-2.patch
new file mode 100644
index 000000000000..b79b3a1872f1
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-man2html-compression-2.patch
@@ -0,0 +1,61 @@
+add support for bzip2/lzma to man2html and friends
+
+--- man2html/glimpse_filters
++++ man2html/glimpse_filters
+@@ -1,3 +1,6 @@
++*.bz2 bzip2 -d -c
++*.lzma lzma -d -c
++*.xz xz -d -c
+ *.gz gzip -d -c
+ *.Z gzip -d -c
+
+--- man2html/scripts/cgi-bin/man/man2html
++++ man2html/scripts/cgi-bin/man/man2html
+@@ -93,6 +93,12 @@
+ *.bz2)
+ bzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
+ ;;
++ *.lzma)
++ lzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
++ ;;
++ *.xz)
++ xzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
++ ;;
+ *)
+ "$MAN2HTML" "$LL" "$PAGE"
+ ;;
+@@ -103,6 +106,12 @@
+ elif [ -r "$PAGE".bz2 ]
+ then
+ bzcat "$PAGE".bz2 | "$MAN2HTML" "$LL" -D "$PAGE"
++elif [ -r "$PAGE".lzma ]
++then
++ lzcat "$PAGE".lzma | "$MAN2HTML" "$LL" -D "$PAGE"
++elif [ -r "$PAGE".xz ]
++then
++ xzcat "$PAGE".xz | "$MAN2HTML" "$LL" -D "$PAGE"
+ else
+ "$MAN2HTML" -E "Strange... Cannot find (or read) $PAGE."
+ fi
+--- man2html/scripts/cgi-bin/man/mansearch
++++ man2html/scripts/cgi-bin/man/mansearch
+@@ -153,7 +153,7 @@
+ }
+ print "<DT> <a href=\"" cgipath "/man2html?" fullname "\">";
+ textname = filename;
+- sub(/\.(gz)|Z|z$/, "", textname);
++ sub(/\.([zZ]|gz|bz2|lzma|xz)$/, "", textname);
+ sub(/\./, "(", textname);
+ textname = textname ")";
+ print textname;
+--- man2html/scripts/cgi-bin/man/mansec
++++ man2html/scripts/cgi-bin/man/mansec
+@@ -128,7 +128,7 @@
+ # Print out alphabetic quick index and other links
+ }
+ # Split page.n into "page" and "n" and generate an entry
+- sub(/[.]([zZ]|(gz))$/, "", manpage);
++ sub(/[.]([zZ]|gz|bz2|lzma|xz)$/, "", manpage);
+ match(manpage, /[.][^.]+$/);
+ title = substr(manpage, 1, RSTART - 1);
+ if (section != "all") {
diff --git a/sys-apps/man/files/man-1.6f-parallel-build.patch b/sys-apps/man/files/man-1.6f-parallel-build.patch
new file mode 100644
index 000000000000..41918d9244da
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-parallel-build.patch
@@ -0,0 +1,78 @@
+http://bugs.gentoo.org/207148
+
+patch by Kevin Pyle to fix parallel build issues
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -42,9 +42,12 @@
+ makemsg:
+ $(BUILD_CC) -o makemsg makemsg.c
+
+-msg.c gripedefs.h: ../msgs/mess.en makemsg
++gripedefs.h: ../msgs/mess.en makemsg
+ ./makemsg ../msgs/mess.en gripedefs.h msg.c
+
++# avoid parallel build issues with makemsg
++msg.c: gripedefs.h
++
+ # glob.c does not have prototypes
+ glob.o: glob.c ndir.h
+ $(CC) -c $(CWARNNP) $(CFLAGS) -I. $(DEFS) glob.c
+
+http://bugs.gentoo.org/258916
+
+avoid:
+ make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
+
+--- a/man/Makefile.in
++++ b/man/Makefile.in
+@@ -3,7 +3,7 @@
+ MAN5 = man.conf
+ MAN8 = makewhatis
+ ALL = man.1 whatis.1 apropos.1 man.conf.5
+-MAYBE8 = makewhatis
++MAYBE8 = $(wildcard makewhatis.man)
+
+ .SUFFIXES: .man .1 .5 .8
+
+@@ -21,9 +21,7 @@
+ # Where to put the manual pages.
+ mandir = $(DESTDIR)$(PREFIX)@mandir@$(SLANG)
+
+-all: $(ALL)
+- for i in $(MAYBE8); \
+- do if test -f $$i.man; then make -f ../Makefile $$i.8; fi; done
++all: $(ALL) $(MAYBE8:.man=.8)
+
+ install: $(ALL)
+ mkdir -p $(mandir)/man1 $(mandir)/man5 $(mandir)/man8
+@@ -39,18 +37,17 @@
+
+ spotless:
+
+-subdirs:
+- @for i in @languages@; do if test -d $$i; then echo; \
+- echo "==== Making the `cat $$i.txt` man pages. ===="; \
+- cd $$i; make -f ../Makefile; cd ..; \
+- else echo "==== No $$i man pages found. ===="; fi; done
+-
+-installsubdirs:
+- @for i in @languages@; do if test -d $$i; then echo; \
+- echo "==== Installing the `cat $$i.txt` man pages. ===="; \
+- cd $$i; SLANG=/$$i; if test $$SLANG = /en; then SLANG= ; fi; \
+- export SLANG; make -f ../Makefile install; cd ..; \
+- else echo "==== No $$i man pages found. ===="; fi; done
++MAN_LANGS = $(wildcard @languages@)
++subdirs: $(MAN_LANGS:=_lang_subdir)
++%_lang_subdir:
++ @echo "==== Making the `cat $(@:_lang_subdir=).txt` man pages. ===="
++ $(MAKE) -f ../Makefile -C $(@:_lang_subdir=)
++
++installsubdirs: $(MAN_LANGS:=_lang_installsubdir)
++%_lang_installsubdir:
++ @echo "==== Making the `cat $(@:_lang_installsubdir=).txt` man pages. ===="
++ $(MAKE) -f ../Makefile -C $(@:_lang_installsubdir=) install \
++ SLANG=`s=$(@:_lang_installsubdir=); test $$s = en || echo /$$s`
+
+ cleansubdirs:
+ @for i in ??; do cd $$i; make -f ../Makefile clean; cd ..; done
diff --git a/sys-apps/man/files/man-1.6f-so-search-2.patch b/sys-apps/man/files/man-1.6f-so-search-2.patch
new file mode 100644
index 000000000000..ac42c8df7b37
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-so-search-2.patch
@@ -0,0 +1,34 @@
+improve the uncompressed .so search
+
+--- a/src/man.c
++++ b/src/man.c
+@@ -381,13 +381,23 @@ again:
+ }
+ /*
+ * Some people have compressed man pages, but uncompressed
+- * .so files - we could glob for all possible extensions,
+- * for now: only try .gz
++ * .so files - we should discover this list dynamically, but
++ * for now just hardcode it.
+ */
+- else if (fp == NULL && get_expander(".gz") &&
+- strlen(name)+strlen(".gz") < BUFSIZE) {
+- strcat(name, ".gz");
+- fp = fopen (name, "r");
++ else if (fp == NULL) {
++#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
++ size_t i, name_len = strlen(name);
++ const char *extensions[] = { ".gz", ".bz2", ".lzma", ".xz", ".z", ".Z" };
++ for (i = 0; i < ARRAY_SIZE(extensions); ++i) {
++ const char *comp = extensions[i];
++ name[name_len] = '\0';
++ if (get_expander(comp) && name_len+strlen(comp) < BUFSIZE) {
++ strcat(name, comp);
++ fp = fopen(name, "r");
++ if (fp)
++ break;
++ }
++ }
+ }
+
+ if (fp == NULL) {
diff --git a/sys-apps/man/files/man-1.6f-unicode.patch b/sys-apps/man/files/man-1.6f-unicode.patch
new file mode 100644
index 000000000000..89d3821df3ca
--- /dev/null
+++ b/sys-apps/man/files/man-1.6f-unicode.patch
@@ -0,0 +1,28 @@
+let the active locale work its magic
+
+http://bugs.gentoo.org/146315
+
+--- man-1.6f/configure
++++ man-1.6f/configure
+@@ -473,9 +473,9 @@
+ then
+ if test $Fnroff = "missing"
+ then
+- nroff="nroff -Tlatin1 -mandoc"
++ nroff="nroff -Tascii -c -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -mandoc"
+ fi
+ troff="troff -mandoc"
+ echo "Warning: could not find groff"
+@@ -484,7 +484,7 @@
+ then
+ nroff="$Fgroff -Tlatin1 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -mandoc"
+ fi
+ troff="$Fgroff -Tps -mandoc"
+ jnroff="$Fgroff -Tnippon -mandocj"
+
diff --git a/sys-apps/man/files/man-1.6g-compress.patch b/sys-apps/man/files/man-1.6g-compress.patch
new file mode 100644
index 000000000000..374d80730074
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-compress.patch
@@ -0,0 +1,17 @@
+allow selection of default cache compressor
+
+http://bugs.gentoo.org/205147
+
+--- configure
++++ configure
+@@ -1012,6 +1012,10 @@
+ done
+ done
+
++ if [ x$COMPRESS != x ]; then
++ compress=$COMPRESS
++ fi
++
+ if [ x$default = x ]; then
+ echo ""
+ echo "What program should be used to compress the formatted pages?"
diff --git a/sys-apps/man/files/man-1.6g-echo-escape.patch b/sys-apps/man/files/man-1.6g-echo-escape.patch
new file mode 100644
index 000000000000..96e950a51e86
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-echo-escape.patch
@@ -0,0 +1,15 @@
+avoid using escape sequences in echo as they're not portable
+
+https://bugs.gentoo.org/523874
+
+--- a/src/man.c
++++ b/src/man.c
+@@ -626,7 +626,7 @@ make_roff_command (const char *path, const char *file) {
+ the current position plus 10 lines. This plus setpl()
+ gives us a single page that just contains the whole
+ man page. (William Webber, wew@cs.rmit.edu.au) */
+- strcat(buft, "; echo \".\\\\\\\"\"; echo \".pl \\n(nlu+10\"");
++ strcat(buft, "; echo \".\\\\\\\"\"; echo \".pl \"; echo \"(nlu+10\"");
+ #if 0
+ /* In case this doesnt work for some reason,
+ michaelkjohnson suggests: I've got a simple
diff --git a/sys-apps/man/files/man-1.6g-fbsd.patch b/sys-apps/man/files/man-1.6g-fbsd.patch
new file mode 100644
index 000000000000..ef01a6e01fc0
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-fbsd.patch
@@ -0,0 +1,15 @@
+Fixes compilation in FreeBSD
+
+http://bugs.gentoo.org/138123
+
+--- man-1.6g/gencat/genlib.c
++++ man-1.6g/gencat/genlib.c
+@@ -54,7 +54,7 @@
+ #include <unistd.h>
+ #endif
+
+-#if !defined(__linux__) && !defined(__CYGWIN__)
++#if !defined(__linux__) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
+ #include <memory.h>
+ static int bcopy(src, dst, length)
+ char *src, *dst;
diff --git a/sys-apps/man/files/man-1.6g-xz.patch b/sys-apps/man/files/man-1.6g-xz.patch
new file mode 100644
index 000000000000..fcf91f71d376
--- /dev/null
+++ b/sys-apps/man/files/man-1.6g-xz.patch
@@ -0,0 +1,53 @@
+add support for xz
+
+http://bugs.gentoo.org/302380
+
+--- a/src/makewhatis.sh
++++ b/src/makewhatis.sh
+@@ -230,7 +230,7 @@
+ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
+
+ function readline() {
+- if (use_zcat || use_bzcat || use_lzcat) {
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ result = (pipe_cmd | getline);
+ if (result < 0) {
+ print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
+@@ -245,7 +245,7 @@
+ }
+
+ function closeline() {
+- if (use_zcat || use_bzcat || use_lzcat) {
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ return close(pipe_cmd);
+ } else {
+ return close(filename);
+@@ -266,7 +266,9 @@
+ use_bzcat = match(filename,"\\.bz2");
+ if(!use_bzcat)
+ use_lzcat = match(filename,"\\.lzma");
+- if (use_zcat || use_bzcat || use_lzcat ) {
++ if(!use_lzcat)
++ use_xzcat = match(filename,"\\.xz");
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ filename_no_gz = substr(filename, 0, RSTART - 1);
+ } else {
+ filename_no_gz = filename;
+@@ -279,13 +281,15 @@
+ actual_section = section;
+ }
+ sub(/\..*/, "", progname);
+- if (use_zcat || use_bzcat || use_lzcat) {
++ if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
+ if (use_zcat) {
+ pipe_cmd = "zcat \"" filename "\"";
+ } else if (use_bzcat) {
+ pipe_cmd = "bzcat \"" filename "\"";
+- } else {
++ } else if (use_lzcat) {
+ pipe_cmd = "lzcat \"" filename "\"";
++ } else {
++ pipe_cmd = "xzcat \"" filename "\"";
+ }
+ # try to avoid suspicious stuff
+ if (filename ~ /[;&|`$(]/) {
diff --git a/sys-apps/man/man-1.6g-r1.ebuild b/sys-apps/man/man-1.6g-r1.ebuild
new file mode 100644
index 000000000000..9923c81c5779
--- /dev/null
+++ b/sys-apps/man/man-1.6g-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"
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="Standard commands to read man pages"
+HOMEPAGE="http://primates.ximian.com/~flucifredi/man/"
+SRC_URI="http://primates.ximian.com/~flucifredi/man/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="+lzma nls selinux"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND="|| ( >=sys-apps/groff-1.19.2-r1 app-doc/heirloom-doctools )
+ !sys-apps/man-db
+ !<app-arch/lzma-4.63
+ lzma? ( app-arch/xz-utils )
+ selinux? ( sec-policy/selinux-makewhatis )"
+
+pkg_setup() {
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/man-1.6f-man2html-compression-2.patch
+ epatch "${FILESDIR}"/man-1.6-cross-compile.patch
+ epatch "${FILESDIR}"/man-1.6f-unicode.patch #146315
+ epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
+ epatch "${FILESDIR}"/man-1.5m2-apropos.patch
+ epatch "${FILESDIR}"/man-1.6g-fbsd.patch #138123
+ epatch "${FILESDIR}"/man-1.6e-headers.patch
+ epatch "${FILESDIR}"/man-1.6f-so-search-2.patch
+ epatch "${FILESDIR}"/man-1.6g-compress.patch #205147
+ epatch "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
+ epatch "${FILESDIR}"/man-1.6g-xz.patch #302380
+ epatch "${FILESDIR}"/man-1.6f-makewhatis-compression-cleanup.patch #331979
+ epatch "${FILESDIR}"/man-1.6g-echo-escape.patch #523874
+ # make sure `less` handles escape sequences #287183
+ sed -i -e '/^DEFAULTLESSOPT=/s:"$:R":' configure
+}
+
+echoit() { echo "$@" ; "$@" ; }
+src_configure() {
+ strip-linguas $(eval $(grep ^LANGUAGES= configure) ; echo ${LANGUAGES//,/ })
+
+ unset NLSPATH #175258
+
+ tc-export CC BUILD_CC
+
+ local mylang=
+ if use nls ; then
+ if [[ -z ${LINGUAS} ]] ; then
+ mylang="all"
+ else
+ mylang="${LINGUAS// /,}"
+ fi
+ else
+ mylang="none"
+ fi
+ export COMPRESS
+ if use lzma ; then
+ COMPRESS=/usr/bin/xz
+ else
+ COMPRESS=/bin/bzip2
+ fi
+ echoit \
+ ./configure \
+ -confdir=/etc \
+ +sgid +fhs \
+ +lang ${mylang} \
+ || die "configure failed"
+}
+
+src_install() {
+ unset NLSPATH #175258
+
+ emake PREFIX="${D}" install || die "make install failed"
+ dosym man /usr/bin/manpath
+
+ dodoc LSM README* TODO
+
+ # makewhatis only adds man-pages from the last 24hrs
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/makewhatis.cron makewhatis
+
+ keepdir /var/cache/man
+ diropts -m0775 -g man
+ local mansects=$(grep ^MANSECT "${D}"/etc/man.conf | cut -f2-)
+ for x in ${mansects//:/ } ; do
+ keepdir /var/cache/man/cat${x}
+ done
+}
+
+pkg_postinst() {
+ einfo "Forcing sane permissions onto ${ROOT}var/cache/man (Bug #40322)"
+ chown -R root:man "${ROOT}"/var/cache/man
+ chmod -R g+w "${ROOT}"/var/cache/man
+ [[ -e ${ROOT}/var/cache/man/whatis ]] \
+ && chown root:0 "${ROOT}"/var/cache/man/whatis
+
+ echo
+
+ local f files=$(ls "${ROOT}"/etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
+ for f in ${files} ; do
+ [[ ${f} == */etc/cron.daily/makewhatis ]] && continue
+ [[ $(md5sum "${f}") == "8b2016cc778ed4e2570b912c0f420266 "* ]] \
+ && rm -f "${f}"
+ done
+ files=$(ls "${ROOT}"etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
+ if [[ ${files/$'\n'} != ${files} ]] ; then
+ ewarn "You have multiple makewhatis cron files installed."
+ ewarn "You might want to delete all but one of these:"
+ ewarn ${files}
+ fi
+
+ if has_version app-doc/heirloom-doctools; then
+ ewarn "Please note that the /etc/man.conf file installed will not"
+ ewarn "work with heirloom's nroff by default (yet)."
+ ewarn ""
+ ewarn "Check app-doc/heirloom-doctools elog messages for the proper"
+ ewarn "configuration."
+ fi
+}
diff --git a/sys-apps/man/man-1.6g.ebuild b/sys-apps/man/man-1.6g.ebuild
new file mode 100644
index 000000000000..d36a02632483
--- /dev/null
+++ b/sys-apps/man/man-1.6g.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="Standard commands to read man pages"
+HOMEPAGE="http://primates.ximian.com/~flucifredi/man/"
+SRC_URI="http://primates.ximian.com/~flucifredi/man/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="+lzma nls selinux"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND="|| ( >=sys-apps/groff-1.19.2-r1 app-doc/heirloom-doctools )
+ !sys-apps/man-db
+ !<app-arch/lzma-4.63
+ lzma? ( app-arch/xz-utils )
+ selinux? ( sec-policy/selinux-makewhatis )"
+
+pkg_setup() {
+ enewgroup man 15
+ enewuser man 13 -1 /usr/share/man man
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/man-1.6f-man2html-compression-2.patch
+ epatch "${FILESDIR}"/man-1.6-cross-compile.patch
+ epatch "${FILESDIR}"/man-1.6f-unicode.patch #146315
+ epatch "${FILESDIR}"/man-1.6c-cut-duplicate-manpaths.patch
+ epatch "${FILESDIR}"/man-1.5m2-apropos.patch
+ epatch "${FILESDIR}"/man-1.6g-fbsd.patch #138123
+ epatch "${FILESDIR}"/man-1.6e-headers.patch
+ epatch "${FILESDIR}"/man-1.6f-so-search-2.patch
+ epatch "${FILESDIR}"/man-1.6g-compress.patch #205147
+ epatch "${FILESDIR}"/man-1.6f-parallel-build.patch #207148 #258916
+ epatch "${FILESDIR}"/man-1.6g-xz.patch #302380
+ epatch "${FILESDIR}"/man-1.6f-makewhatis-compression-cleanup.patch #331979
+ # make sure `less` handles escape sequences #287183
+ sed -i -e '/^DEFAULTLESSOPT=/s:"$:R":' configure
+}
+
+echoit() { echo "$@" ; "$@" ; }
+src_configure() {
+ strip-linguas $(eval $(grep ^LANGUAGES= configure) ; echo ${LANGUAGES//,/ })
+
+ unset NLSPATH #175258
+
+ tc-export CC BUILD_CC
+
+ local mylang=
+ if use nls ; then
+ if [[ -z ${LINGUAS} ]] ; then
+ mylang="all"
+ else
+ mylang="${LINGUAS// /,}"
+ fi
+ else
+ mylang="none"
+ fi
+ export COMPRESS
+ if use lzma ; then
+ COMPRESS=/usr/bin/xz
+ else
+ COMPRESS=/bin/bzip2
+ fi
+ echoit \
+ ./configure \
+ -confdir=/etc \
+ +sgid +fhs \
+ +lang ${mylang} \
+ || die "configure failed"
+}
+
+src_install() {
+ unset NLSPATH #175258
+
+ emake PREFIX="${D}" install || die "make install failed"
+ dosym man /usr/bin/manpath
+
+ dodoc LSM README* TODO
+
+ # makewhatis only adds man-pages from the last 24hrs
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/makewhatis.cron makewhatis
+
+ keepdir /var/cache/man
+ diropts -m0775 -g man
+ local mansects=$(grep ^MANSECT "${D}"/etc/man.conf | cut -f2-)
+ for x in ${mansects//:/ } ; do
+ keepdir /var/cache/man/cat${x}
+ done
+}
+
+pkg_postinst() {
+ einfo "Forcing sane permissions onto ${ROOT}var/cache/man (Bug #40322)"
+ chown -R root:man "${ROOT}"/var/cache/man
+ chmod -R g+w "${ROOT}"/var/cache/man
+ [[ -e ${ROOT}/var/cache/man/whatis ]] \
+ && chown root:0 "${ROOT}"/var/cache/man/whatis
+
+ echo
+
+ local f files=$(ls "${ROOT}"/etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
+ for f in ${files} ; do
+ [[ ${f} == */etc/cron.daily/makewhatis ]] && continue
+ [[ $(md5sum "${f}") == "8b2016cc778ed4e2570b912c0f420266 "* ]] \
+ && rm -f "${f}"
+ done
+ files=$(ls "${ROOT}"etc/cron.{daily,weekly}/makewhatis{,.cron} 2>/dev/null)
+ if [[ ${files/$'\n'} != ${files} ]] ; then
+ ewarn "You have multiple makewhatis cron files installed."
+ ewarn "You might want to delete all but one of these:"
+ ewarn ${files}
+ fi
+
+ if has_version app-doc/heirloom-doctools; then
+ ewarn "Please note that the /etc/man.conf file installed will not"
+ ewarn "work with heirloom's nroff by default (yet)."
+ ewarn ""
+ ewarn "Check app-doc/heirloom-doctools elog messages for the proper"
+ ewarn "configuration."
+ fi
+}
diff --git a/sys-apps/man/metadata.xml b/sys-apps/man/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/man/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-apps/mawk/Manifest b/sys-apps/mawk/Manifest
new file mode 100644
index 000000000000..f0fe3d063ca8
--- /dev/null
+++ b/sys-apps/mawk/Manifest
@@ -0,0 +1,5 @@
+DIST mawk-1.3.4-20100625.tgz 304970 SHA256 a8837a66ecee746edc149d7c38686209656c455290a1805c5e05ebad3184d2c9 SHA512 06623b8e647dabffd34d6e655cee72fb8a70eaf70b5cd8165d687c6913fecd868c584306d9b37666e36a473fb6c8dd7c211cdf89fffe1c838eaa826e2865de69 WHIRLPOOL bc375ddfd423fe45a0a89ac5b16a4dbf04ef360cdacc9ca9aa33cceb92e6e9ebfc8447604bf396c5c89529a42555b4d7d55474740a4117717224f983604d1b20
+DIST mawk-1.3.4-20131226.tgz 355479 SHA256 a89956b60c31dcd626271d1c4f17145fe738daa6e7d4b231320ee26d03a946fc SHA512 1e9bce2c738289283b0ed56ed4706eeb42da8951fd2c8d13d8858af15c41bd2bd18d73f0a1de997086089fbfb557f5ff3b033a27acbd11751106fe9f37ed7c5d WHIRLPOOL 94cde6dd9bb3f64bb3a173fbf9673628c1b841ea16fd395049dd6b778a6fe74fc6f5887025f297185843c10dff2820d312b592cf16e91ae79ff729e2902e2fb1
+DIST mawk-1.3.4-20140914.tgz 464855 SHA256 fb8fb2b7a4906c49d5262344835ab96c9e1ca82ad532c15fb81c51a5a77e0e78 SHA512 4083163ea7f7a9507174de292cec3944c44e1c40cca1437e6e6c2a8728e947e91da8b3f03298c52f897ae7617fa1d040e194588e4beb1deae1e7510caab968df WHIRLPOOL 0024fb066e72e03064d06574a60dc552a876f01b0be103137e1cc783c7e56b14250828ffe85904de780012fc8a7255dce2cebdc31b595ef3c921730e3b6e7e3e
+DIST mawk-1.3.4-20141027.tgz 464939 SHA256 a88f50c1a0800ae6d2cedb0672b15bd32cc57e482715ca7c1471fb398e89767a SHA512 6a16f34f8749c42ed4b008e1229718673309041c926ce96cf1739b191af39f5ca6713ca0cfc70bbd86d6f17630c6ca3d5f04c84bede94d2d9469fdac40f38eab WHIRLPOOL 2fc7efd3509e7397abc6b114f97e6fbfb4b543daa98b34cdfa032c98d2908e53797f8d0ea8411b8d824d33ef673f524846c9c80eeb99ff1ea5aea5560b9d7da1
+DIST mawk-1.3.4-20141206.tgz 465025 SHA256 efa092ec3ea5dfd54571e8ba3b0327073f1fa51b8efa0953c2cadd87a87389c8 SHA512 636c863d759c8001fd51dea5fd1bfabed193976e9d7e7d614848bf8b5b4714b16325833099abf33c0a94c9cd746608da10e6e7b1199cd2480cab419f89813814 WHIRLPOOL a10a6517092fe97f0ae23766b055c20b73b26d5fcdf18c50e8a9f571be5d694b01a039d3ce6e7ca6294477d013b6a70ae24f5f48426e827a7673e8282a0bf91b
diff --git a/sys-apps/mawk/files/mawk-1.3.4-cross-compile.patch b/sys-apps/mawk/files/mawk-1.3.4-cross-compile.patch
new file mode 100644
index 000000000000..104bb46d2457
--- /dev/null
+++ b/sys-apps/mawk/files/mawk-1.3.4-cross-compile.patch
@@ -0,0 +1,13 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -104,8 +104,9 @@
+ -@rm -f $@
+ notangle -R'"array.h"' array.w | $(NOIDENT) | cpif array.h
+
++BUILD_CC ?= gcc
+ scancode.c : $(srcdir)/makescan.c scancode.h nstd.h config.h
+- @ECHO_LD@$(CC) $(CFLAGS) $(CPPFLAGS) -o makescan.exe $(srcdir)/makescan.c
++ @ECHO_LD@$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -o makescan.exe $(srcdir)/makescan.c
+ rm -f scancode.c
+ ./makescan.exe > scancode.c
+ rm makescan.exe
diff --git a/sys-apps/mawk/mawk-1.3.4_p20100625.ebuild b/sys-apps/mawk/mawk-1.3.4_p20100625.ebuild
new file mode 100644
index 000000000000..061566eae878
--- /dev/null
+++ b/sys-apps/mawk/mawk-1.3.4_p20100625.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit toolchain-funcs eutils
+
+MY_P=${P/_p/-}
+DESCRIPTION="an (often faster than gawk) awk-interpreter"
+HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
+SRC_URI="ftp://invisible-island.net/mawk/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~hppa ia64 ppc sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.3.4-cross-compile.patch
+ tc-export BUILD_CC
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc ACKNOWLEDGMENT CHANGES INSTALL README
+
+ exeinto /usr/share/doc/${PF}/examples
+ doexe examples/* # avoid compression of dodoc + make executable
+}
diff --git a/sys-apps/mawk/mawk-1.3.4_p20131226.ebuild b/sys-apps/mawk/mawk-1.3.4_p20131226.ebuild
new file mode 100644
index 000000000000..bba32451c649
--- /dev/null
+++ b/sys-apps/mawk/mawk-1.3.4_p20131226.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs eutils
+
+MY_P=${P/_p/-}
+DESCRIPTION="an (often faster than gawk) awk-interpreter"
+HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
+SRC_URI="ftp://invisible-island.net/mawk/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+
+RDEPEND="app-eselect/eselect-awk"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( ACKNOWLEDGMENT CHANGES README )
+
+src_prepare() {
+ tc-export BUILD_CC
+}
+
+src_install() {
+ default
+
+ exeinto /usr/share/doc/${PF}/examples
+ doexe examples/*
+ docompress -x /usr/share/doc/${PF}/examples
+}
+
+pkg_postinst() {
+ eselect awk update ifunset
+}
+
+pkg_postrm() {
+ eselect awk update ifunset
+}
diff --git a/sys-apps/mawk/mawk-1.3.4_p20140914.ebuild b/sys-apps/mawk/mawk-1.3.4_p20140914.ebuild
new file mode 100644
index 000000000000..99b3cb942f19
--- /dev/null
+++ b/sys-apps/mawk/mawk-1.3.4_p20140914.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 eutils
+
+MY_P=${P/_p/-}
+DESCRIPTION="an (often faster than gawk) awk-interpreter"
+HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
+SRC_URI="ftp://invisible-island.net/mawk/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+
+RDEPEND="app-eselect/eselect-awk"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( ACKNOWLEDGMENT CHANGES README )
+
+src_prepare() {
+ tc-export BUILD_CC
+}
+
+src_install() {
+ default
+
+ exeinto /usr/share/doc/${PF}/examples
+ doexe examples/*
+ docompress -x /usr/share/doc/${PF}/examples
+}
+
+pkg_postinst() {
+ eselect awk update ifunset
+}
+
+pkg_postrm() {
+ eselect awk update ifunset
+}
diff --git a/sys-apps/mawk/mawk-1.3.4_p20141027.ebuild b/sys-apps/mawk/mawk-1.3.4_p20141027.ebuild
new file mode 100644
index 000000000000..99b3cb942f19
--- /dev/null
+++ b/sys-apps/mawk/mawk-1.3.4_p20141027.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 eutils
+
+MY_P=${P/_p/-}
+DESCRIPTION="an (often faster than gawk) awk-interpreter"
+HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
+SRC_URI="ftp://invisible-island.net/mawk/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+
+RDEPEND="app-eselect/eselect-awk"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( ACKNOWLEDGMENT CHANGES README )
+
+src_prepare() {
+ tc-export BUILD_CC
+}
+
+src_install() {
+ default
+
+ exeinto /usr/share/doc/${PF}/examples
+ doexe examples/*
+ docompress -x /usr/share/doc/${PF}/examples
+}
+
+pkg_postinst() {
+ eselect awk update ifunset
+}
+
+pkg_postrm() {
+ eselect awk update ifunset
+}
diff --git a/sys-apps/mawk/mawk-1.3.4_p20141206.ebuild b/sys-apps/mawk/mawk-1.3.4_p20141206.ebuild
new file mode 100644
index 000000000000..720265d75c48
--- /dev/null
+++ b/sys-apps/mawk/mawk-1.3.4_p20141206.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
+
+MY_P=${P/_p/-}
+DESCRIPTION="an (often faster than gawk) awk-interpreter"
+HOMEPAGE="http://invisible-island.net/mawk/mawk.html"
+SRC_URI="ftp://invisible-island.net/mawk/${MY_P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
+
+RDEPEND="app-eselect/eselect-awk"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( ACKNOWLEDGMENT CHANGES README )
+
+src_prepare() {
+ tc-export BUILD_CC
+}
+
+src_install() {
+ default
+
+ exeinto /usr/share/doc/${PF}/examples
+ doexe examples/*
+ docompress -x /usr/share/doc/${PF}/examples
+}
+
+pkg_postinst() {
+ eselect awk update ifunset
+}
+
+pkg_postrm() {
+ eselect awk update ifunset
+}
diff --git a/sys-apps/mawk/metadata.xml b/sys-apps/mawk/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/mawk/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-apps/memtest86+/Manifest b/sys-apps/memtest86+/Manifest
new file mode 100644
index 000000000000..ec4eb2992499
--- /dev/null
+++ b/sys-apps/memtest86+/Manifest
@@ -0,0 +1,4 @@
+DIST memtest86+-2.01.tar.gz 165984 SHA256 35ad452f4fd12f07756abccccf1bce70d42596c2c5e9c29247ffc8e0b76bd1ae
+DIST memtest86+-4.00.tar.gz 270327 SHA256 6ec42f549da81b715bfc5c55b93b74774fb5c35f7578c7eecebab3ca37866ca4
+DIST memtest86+-4.20.tar.gz 206044 SHA256 5630ce978d0e6b671891df4253fc5c54659764d0cdfc7515ac0df3d8dd9e8737 SHA512 2213a64cd3036f840dd816dd49b62b0f082e1fbfe64e02f52370f04e39857f042dc8bc0044c1a88ba678e72c1eb8629aa706fabfd3c052e41c29c073f4e8c441 WHIRLPOOL 16b2f0a447516b24e4e29cf526ffc2ba03406105473c1d0cff44d737473b81db0482131385f2a39a5d202b3ccd52300f2c7109adf1b64b8bdb0a5244cb32d2cb
+DIST memtest86+-5.01.tar.gz 214877 SHA256 142127b7953fbd829b1057fb64a78d3340c2b771484230a7347e94530a0d9039 SHA512 d872db35ef733ec8f49094251f2bf6b98cc80eb06d04044be3aecf28d534f24ba293a08b9979b112dbd07cf27368148939a33a32c7010fc9581a3a5b150c94d7 WHIRLPOOL c8e240c8420990c93156fcd407a4b00d350392bbf8e974398b4d51fa219d33012b4e0d60f58cb2dff59c06e36e322467031bc0231d77d4e773d97e30939d3c8f
diff --git a/sys-apps/memtest86+/files/39_memtest86+ b/sys-apps/memtest86+/files/39_memtest86+
new file mode 100644
index 000000000000..14f27a276888
--- /dev/null
+++ b/sys-apps/memtest86+/files/39_memtest86+
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. /usr/share/grub/grub-mkconfig_lib
+
+memtest=/boot/memtest86plus/memtest
+
+if [ -f "${memtest}" ]; then
+ device="$("${grub_probe}" --target=device "${memtest}")"
+ path="$(make_system_path_relative_to_its_root "${memtest}")"
+ cat <<EOF
+menuentry "Memtest86+" {
+EOF
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ cat <<EOF
+ linux16 "${path}"
+}
+EOF
+fi
+
+memtest=/boot/memtest86plus/memtest.netbsd
+
+if [ -f "${memtest}" ]; then
+ device="$("${grub_probe}" --target=device "${memtest}")"
+ path="$(make_system_path_relative_to_its_root "${memtest}")"
+ cat <<EOF
+menuentry "Memtest86+ (netbsd)" {
+EOF
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ cat <<EOF
+ knetbsd "${path}"
+}
+EOF
+fi
diff --git a/sys-apps/memtest86+/files/make-memtest86+-boot-floppy b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy
new file mode 100644
index 000000000000..9c225c740bf4
--- /dev/null
+++ b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy
@@ -0,0 +1,111 @@
+#!/bin/sh
+#
+# Script for making a memtest86 boot floppy using GRUB as bootloader
+#
+
+# (c) 2003 Peter Loje Hansen <pl@2m.dk>
+# - original version
+# (c) 2004 Yann Dirson <dirson@debian.org>
+# - added parameters
+# - ability to work on a floppy image instead of a real floppy
+# - adapted patches from Martin Koeppe <martin@koeppe-net.de>, to use
+# mtools and install full grub
+
+# TODO:
+# - add a flag to generate a default boot entry for (hd0)
+
+set -e
+
+MEMTEST=/boot/memtest86plus/memtest.bin
+FLOPPYIMAGE=/dev/fd0
+GRUBBIN=/sbin/grub
+GRUBLIB=/lib/grub
+MFORMAT=/usr/bin/mformat
+
+arch=$(uname -m)
+
+case "$arch" in
+ i386|i486|i686) GRUBARCH=i386-pc;;
+ x86_64) GRUBARCH=x86_64-pc;;
+ *) error "Unsupported architecture: $arch";;
+esac
+
+error()
+{
+ echo >&2 "$0: $*"
+ exit 1
+}
+
+needsarg()
+{
+ [ $1 -ge 2 ] || error "syntax error"
+}
+
+[ -d $GRUBLIB ] || error "Can't find $GRUBLIB - did you install a recent grub package (0.95+cvs20040624 or later) ?"
+[ -x $MFORMAT ] || error "Can't find mformat - did you install the mtools package ?"
+
+while [ $# -gt 0 ]
+do
+ case "$1" in
+ --help) echo "$0 [--memtest $MEMTEST] [--floppyimage $FLOPPYIMAGE]"; exit 0 ;;
+ --memtest) needsarg $#; MEMTEST="$2"; shift ;;
+ --floppyimage) needsarg $#; FLOPPYIMAGE="$2"; shift ;;
+ *) error "syntax error" ;;
+ esac
+ shift
+done
+
+MOUNTPOINT=$(mktemp -d)
+
+if [ -b "$FLOPPYIMAGE" ]
+then
+ FINALDEV="$FLOPPYIMAGE"
+ FLOPPYIMAGE="$(mktemp)"
+else
+ FINALDEV=""
+fi
+
+echo "* Creating msdos file system"
+echo
+if [ ! -s "$FLOPPYIMAGE" ]; then
+ # unless a non-empty image exists, create a blank one first
+ dd bs=1024 count=1440 if=/dev/zero of="$FLOPPYIMAGE"
+fi
+# FIXME: "-f 1440" should probably be dropped
+mformat -i $FLOPPYIMAGE -f 1440 ::
+
+mmd -i $FLOPPYIMAGE ::/boot
+mmd -i $FLOPPYIMAGE ::/boot/grub
+
+echo
+echo "* Installing GRUB files"
+mcopy -v -i "$FLOPPYIMAGE" - ::/boot/grub/menu.lst <<EOF
+color green/black light-green/black
+default 0
+timeout 10
+title memtest
+kernel (fd0)/boot/memtest.bin
+EOF
+mcopy -v -i "$FLOPPYIMAGE" $GRUBLIB/$GRUBARCH/* ::/boot/grub
+
+echo
+echo "* Installing $MEMTEST"
+mcopy -v -i "$FLOPPYIMAGE" "$MEMTEST" ::/boot/memtest.bin
+
+echo
+echo -n "* Installing GRUB"
+$GRUBBIN --batch --device-map=/dev/null <<EOF
+device (fd0) $FLOPPYIMAGE
+root (fd0)
+setup (fd0)
+quit
+EOF
+
+if [ -n "$FINALDEV" ]; then
+ echo
+ echo "Insert a writable floppy for $FINALDEV and press enter"
+ read FOO
+
+ dd bs=1024 if="$FLOPPYIMAGE" of="$FINALDEV"
+ rm "$FLOPPYIMAGE"
+fi
diff --git a/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1 b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1
new file mode 100644
index 000000000000..e1283e5efc8f
--- /dev/null
+++ b/sys-apps/memtest86+/files/make-memtest86+-boot-floppy.1
@@ -0,0 +1,39 @@
+.\" Man page for make-memtest86+-boot-floppy
+
+.TH make-memtest86+-boot-floppy 1
+
+.SH NAME
+make-memtest86+-boot-floppy \- create a memtest86+ boot-floppy using GRUB.
+
+.SH SYNOPSIS
+
+.B make-memtest86+-boot-floppy [ \-\-memtest
+.I <path to memtest86+-image>
+.B ] [ \-\-floppyimage
+.I <path to floppyimage/device>
+.B ]
+
+.SH DESCRIPTION
+.B make-memtest86+-boot-floppy
+can create a memtest86+ boot floppy using GRUB as the bootloader.
+
+.SH OPTIONS
+
+.IP "\-\-memtest <path to the memtest-image>"
+Path to the memtest86+-image, default is /boot/memtest86+.bin.
+
+.IP "\-\-floppyimage <path to the floppyimage or device>"
+File or device where the boot-image should be written to, default is /dev/fd0.
+
+.IP "\-\-help"
+Display a short message about the options of the tool.
+
+.SH AUTHOR
+This man-page has been written by Thomas Schmidt <thomas@thsnet.de>
+.PP
+Permission is granted to copy, distribute and/or modify this document under
+the terms of the GNU General Public License, Version 2 any
+later version published by the Free Software Foundation.
+.PP
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common\-licenses/GPL.
diff --git a/sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch b/sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch
new file mode 100644
index 000000000000..5a9e06dc06d7
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-1.70-gnu_hash.patch
@@ -0,0 +1,11 @@
+diff -Naurp memtest86+-1.70-orig/memtest_shared.lds memtest86+-1.70/memtest_shared.lds
+--- memtest86+-1.70-orig/memtest_shared.lds 2007-01-27 13:34:16.000000000 +0100
++++ memtest86+-1.70/memtest_shared.lds 2007-01-27 13:41:30.000000000 +0100
+@@ -18,6 +18,7 @@ SECTIONS {
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .hash : { *(.hash) }
++ .gnu.hash : { *(.gnu.hash) }
+ .dynamic : { *(.dynamic) }
+
+ .rel.text : { *(.rel.text .rel.text.*) }
diff --git a/sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch
new file mode 100644
index 000000000000..3b07731daadd
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-2.01-hardcoded_cc.patch
@@ -0,0 +1,30 @@
+diff -Naurp memtest86+-2.01-orig/Makefile memtest86+-2.01/Makefile
+--- memtest86+-2.01-orig/Makefile 2008-03-11 21:04:28.000000000 +0100
++++ memtest86+-2.01/Makefile 2008-03-11 21:05:25.000000000 +0100
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS=-Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC
++CPPFLAGS=-m32
++CFLAGS=-Wall -m32 -march=i486 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++ASFLAGS=-32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o pci.o controller.o random.o extra.o \
+@@ -47,10 +46,10 @@ memtest.bin: memtest_shared.bin bootsect
+ memtest_shared.bin -o memtest.bin
+
+ reloc.o: reloc.c
+- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++ $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie -nopie test.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin
diff --git a/sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch
new file mode 100644
index 000000000000..f2950b64e807
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-4.00-hardcoded_cc.patch
@@ -0,0 +1,30 @@
+diff -Nuar --exclude '*.orig' --exclude '*rej' --exclude '*~' memtest86+-4.00.orig/Makefile memtest86+-4.00/Makefile
+--- memtest86+-4.00.orig/Makefile 2009-09-21 17:35:46.000000000 -0700
++++ memtest86+-4.00/Makefile 2009-09-25 09:04:23.000000000 -0700
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC
++CPPFLAGS=-m32
++CFLAGS=-Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++ASFLAGS=-32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o pci.o controller.o random.o spd.o \
+@@ -47,10 +46,10 @@
+ memtest_shared.bin -o memtest.bin
+
+ reloc.o: reloc.c
+- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++ $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie -nopie test.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin
diff --git a/sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch
new file mode 100644
index 000000000000..2eb750c8dd93
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-4.20-hardcoded_cc.patch
@@ -0,0 +1,30 @@
+diff -Naurp memtest86+-4.10-orig/Makefile memtest86+-4.10/Makefile
+--- memtest86+-4.10-orig/Makefile 2010-06-24 00:27:22.864634431 +0200
++++ memtest86+-4.10/Makefile 2010-06-24 00:28:42.402478590 +0200
+@@ -8,10 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+-CFLAGS= -Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++CFLAGS=-Wall -march=i486 -m32 -O2 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector
++CPPFLAGS=-m32
++ASFLAGS=-32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o pci.o controller.o random.o spd.o \
+@@ -47,10 +46,10 @@ memtest.bin: memtest_shared.bin bootsect
+ memtest_shared.bin -o memtest.bin
+
+ reloc.o: reloc.c
+- $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
++ $(CC) -c $(CFLAGS) -fno-strict-aliasing -fno-stack-protector reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie test.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared memtest_shared.bin
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch b/sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch
new file mode 100644
index 000000000000..ff9b15a9e4e1
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-gcc-473.patch
@@ -0,0 +1,54 @@
+diff -Narup memtest86+-5.01-orig/controller.c memtest86+-5.01/controller.c
+--- memtest86+-5.01-orig/controller.c 2013-08-09 22:01:58.000000000 -0400
++++ memtest86+-5.01/controller.c 2014-06-22 11:01:17.347923472 -0400
+@@ -292,7 +292,7 @@ static void setup_nhm(void)
+
+ /* First, locate the PCI bus where the MCH is located */
+
+- for(i = 0; i < sizeof(possible_nhm_bus); i++) {
++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
+ vid &= 0xFFFF;
+@@ -327,7 +327,7 @@ static void setup_nhm32(void)
+ ctrl.mode = ECC_NONE;
+
+ /* First, locate the PCI bus where the MCH is located */
+- for(i = 0; i < sizeof(possible_nhm_bus); i++) {
++ for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
+ pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
+ vid &= 0xFFFF;
+diff -Narup memtest86+-5.01-orig/io.h memtest86+-5.01/io.h
+--- memtest86+-5.01-orig/io.h 2013-08-09 22:01:58.000000000 -0400
++++ memtest86+-5.01/io.h 2014-06-22 11:00:19.279251873 -0400
+@@ -31,7 +31,7 @@
+ */
+
+ #define __OUT1(s,x) \
+-extern inline void __out##s(unsigned x value, unsigned short port) {
++static inline void __out##s(unsigned x value, unsigned short port) {
+
+ #define __OUT2(s,s1,s2) \
+ __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
+@@ -43,7 +43,7 @@ __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a"
+ __OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; }
+
+ #define __IN1(s) \
+-extern inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
++static inline RETURN_TYPE __in##s(unsigned short port) { RETURN_TYPE _v;
+
+ #define __IN2(s,s1,s2) \
+ __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
+diff -Narup memtest86+-5.01-orig/Makefile memtest86+-5.01/Makefile
+--- memtest86+-5.01-orig/Makefile 2013-08-09 22:01:58.000000000 -0400
++++ memtest86+-5.01/Makefile 2014-06-22 10:59:27.463573842 -0400
+@@ -12,7 +12,7 @@ FDISK=/dev/fd0
+ AS=as -32
+ CC=gcc
+
+-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
++CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
+ -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
diff --git a/sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch b/sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch
new file mode 100644
index 000000000000..f140a7fc6605
--- /dev/null
+++ b/sys-apps/memtest86+/files/memtest86+-5.01-hardcoded_cc.patch
@@ -0,0 +1,16 @@
+--- Makefile.orig 2015-02-01 01:08:33.000000000 +0300
++++ Makefile 2015-02-01 01:10:17.624757244 +0300
+@@ -9,11 +9,10 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
+-
+ CFLAGS= -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin \
+ -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
++CPPFLAGS= -m32
++ASFLAGS= -32
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o cpuid.o linuxbios.o pci.o memsize.o spd.o error.o dmi.o controller.o \
diff --git a/sys-apps/memtest86+/memtest86+-2.01.ebuild b/sys-apps/memtest86+/memtest86+-2.01.ebuild
new file mode 100644
index 000000000000..747415f50430
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-2.01.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot eutils
+
+DESCRIPTION="Memory tester based on memtest86"
+HOMEPAGE="http://www.memtest.org/"
+SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="serial"
+RESTRICT="test"
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-2.01-hardcoded_cc.patch
+ epatch "${FILESDIR}"/${PN}-1.70-gnu_hash.patch
+
+ if use serial ; then
+ sed -e 's/#define SERIAL_CONSOLE_DEFAULT 0/#define SERIAL_CONSOLE_DEFAULT 1/' -i config.h
+ fi
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ insinto /boot/memtest86plus
+ doins memtest.bin || die
+ dodoc README README.build-process
+}
+
+pkg_postinst() {
+ einfo
+ einfo "memtest.bin has been installed in /boot/memtest86plus/"
+ einfo "You may wish to update your bootloader configs"
+ einfo "by adding these lines:"
+
+ einfo " - For grub: (replace '?' with correct numbers for your boot partition)"
+ einfo " > title=Memtest86Plus"
+ einfo " > root (hd?,?)"
+ einfo " > kernel /boot/memtest86plus/memtest.bin"
+
+ einfo " - For lilo:"
+ einfo " > image = /boot/memtest86plus/memtest.bin"
+ einfo " > label = Memtest86Plus"
+ einfo
+}
diff --git a/sys-apps/memtest86+/memtest86+-4.00.ebuild b/sys-apps/memtest86+/memtest86+-4.00.ebuild
new file mode 100644
index 000000000000..17412a02cbab
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-4.00.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+QA_PRESTRIPPED=/boot/memtest86plus/memtest
+
+inherit mount-boot eutils
+
+DESCRIPTION="Memory tester based on memtest86"
+HOMEPAGE="http://www.memtest.org/"
+SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="floppy serial"
+RESTRICT="test"
+
+RDEPEND="floppy? ( >=sys-boot/grub-0.95 sys-fs/mtools )"
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-4.00-hardcoded_cc.patch
+
+ # Merged upstream
+ #epatch "${FILESDIR}"/${PN}-1.70-gnu_hash.patch
+
+ sed -i -e's/$(LD) -s /$(LD) /' Makefile
+ sed -i -e's,0x10000,0x100000,' memtest.lds
+
+ if use serial ; then
+ sed -i -e 's/#define SERIAL_CONSOLE_DEFAULT 0/#define SERIAL_CONSOLE_DEFAULT 1/' config.h
+ fi
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ insinto /boot/memtest86plus
+ newins memtest.bin memtest || die
+ newins memtest memtest.netbsd || die
+ dosym memtest /boot/memtest86plus/memtest.bin
+ dodoc README README.build-process
+
+ if use floppy ; then
+ dobin "${FILESDIR}"/make-memtest86+-boot-floppy
+ doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
+ fi
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ einfo
+ einfo "memtest has been installed in /boot/memtest86plus/"
+ einfo "You may wish to update your bootloader configs"
+ einfo "by adding these lines:"
+ einfo " - For grub: (replace '?' with correct numbers for your boot partition)"
+ einfo " > title=Memtest86Plus"
+ einfo " > root (hd?,?)"
+ einfo " > kernel /boot/memtest86plus/memtest"
+ einfo " or try this if you get grub error 28:"
+ einfo " > title=Memtest86Plus"
+ einfo " > root (hd?,?)"
+ einfo " > kernel --type=netbsd /boot/memtest86plus/memtest.netbsd"
+ einfo
+ einfo " - For lilo:"
+ einfo " > image = /boot/memtest86plus/memtest"
+ einfo " > label = Memtest86Plus"
+ einfo
+}
diff --git a/sys-apps/memtest86+/memtest86+-4.20-r1.ebuild b/sys-apps/memtest86+/memtest86+-4.20-r1.ebuild
new file mode 100644
index 000000000000..bda1e1aae492
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-4.20-r1.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit mount-boot eutils toolchain-funcs
+
+DESCRIPTION="Memory tester based on memtest86"
+HOMEPAGE="http://www.memtest.org/"
+SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="floppy serial"
+
+BOOTDIR=/boot/memtest86plus
+QA_PRESTRIPPED="${BOOTDIR}/memtest.netbsd"
+
+RDEPEND="floppy? ( >=sys-boot/grub-0.95:0 sys-fs/mtools )"
+DEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.20-hardcoded_cc.patch
+
+ sed -i -e 's,0x10000,0x100000,' memtest.lds || die
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+
+ cat - > "${T}"/39_${PN} <<EOF
+#!/bin/sh
+exec tail -n +3 \$0
+
+menuentry "${PN} ${PV}" {
+ linux16 ${BOOTDIR}/memtest
+}
+
+menuentry "${PN} ${PV} (netbsd)" {
+ insmod bsd
+ knetbsd ${BOOTDIR}/memtest.netbsd
+}
+EOF
+
+ tc-export AS CC LD
+}
+
+src_test() { :; }
+
+src_install() {
+ insinto ${BOOTDIR}
+ newins memtest.bin memtest
+ newins memtest memtest.netbsd
+ dosym memtest ${BOOTDIR}/memtest.bin
+
+ exeinto /etc/grub.d
+ doexe "${T}"/39_${PN}
+
+ dodoc README README.build-process FAQ changelog
+
+ if use floppy ; then
+ dobin "${FILESDIR}"/make-memtest86+-boot-floppy
+ doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
+ fi
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ elog
+ elog "memtest has been installed in ${BOOTDIR}/"
+ elog "You may wish to update your bootloader configs"
+ elog "by adding these lines:"
+ elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
+ elog " as /etc/grub.d/39_${PN}"
+ elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
+ elog " > title=${PN}"
+ elog " > root (hd?,?)"
+ elog " > kernel ${BOOTDIR}/memtest"
+ elog " - For lilo:"
+ elog " > image = ${BOOTDIR}/memtest"
+ elog " > label = ${PN}"
+ elog
+}
diff --git a/sys-apps/memtest86+/memtest86+-4.20-r2.ebuild b/sys-apps/memtest86+/memtest86+-4.20-r2.ebuild
new file mode 100644
index 000000000000..06dac9cca1e0
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-4.20-r2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit mount-boot eutils toolchain-funcs
+
+DESCRIPTION="Memory tester based on memtest86"
+HOMEPAGE="http://www.memtest.org/"
+SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="floppy serial"
+
+BOOTDIR=/boot/memtest86plus
+QA_PRESTRIPPED="${BOOTDIR}/memtest.netbsd"
+
+RDEPEND="floppy? ( >=sys-boot/grub-0.95:0 sys-fs/mtools )"
+DEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.20-hardcoded_cc.patch
+
+ sed -i -e 's,0x10000,0x100000,' memtest.lds || die
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+
+ tc-export AS CC LD
+}
+
+src_test() { :; }
+
+src_install() {
+ insinto ${BOOTDIR}
+ newins memtest.bin memtest
+ newins memtest memtest.netbsd
+ dosym memtest ${BOOTDIR}/memtest.bin
+
+ exeinto /etc/grub.d
+ doexe "${FILESDIR}"/39_memtest86+
+
+ dodoc README README.build-process FAQ changelog
+
+ if use floppy ; then
+ dobin "${FILESDIR}"/make-memtest86+-boot-floppy
+ doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
+ fi
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ elog
+ elog "memtest has been installed in ${BOOTDIR}/"
+ elog "You may wish to update your bootloader configs"
+ elog "by adding these lines:"
+ elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
+ elog " as /etc/grub.d/39_${PN}"
+ elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
+ elog " > title=${PN}"
+ elog " > root (hd?,?)"
+ elog " > kernel ${BOOTDIR}/memtest"
+ elog " - For lilo:"
+ elog " > image = ${BOOTDIR}/memtest"
+ elog " > label = ${PN}"
+ elog
+}
diff --git a/sys-apps/memtest86+/memtest86+-5.01-r1.ebuild b/sys-apps/memtest86+/memtest86+-5.01-r1.ebuild
new file mode 100644
index 000000000000..1232c12688c4
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-5.01-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit mount-boot eutils toolchain-funcs
+
+DESCRIPTION="Memory tester based on memtest86"
+HOMEPAGE="http://www.memtest.org/"
+SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="floppy serial"
+
+BOOTDIR=/boot/memtest86plus
+QA_PRESTRIPPED="${BOOTDIR}/memtest.netbsd"
+QA_FLAGS_IGNORED="${BOOTDIR}/memtest.netbsd"
+
+RDEPEND="floppy? ( >=sys-boot/grub-0.95:0 sys-fs/mtools )"
+DEPEND=""
+
+src_prepare() {
+ sed -i -e 's,0x10000,0x100000,' memtest.lds || die
+ sed -e "s/scp memtest.bin root@192.168.0.12:\/srv\/tftp\/mt86plus//g" -i Makefile
+ epatch "${FILESDIR}/${P}-gcc-473.patch" \
+ "${FILESDIR}/${P}-hardcoded_cc.patch"
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+
+ tc-export AS CC LD
+}
+
+src_test() { :; }
+
+src_install() {
+ insinto ${BOOTDIR}
+ newins memtest.bin memtest
+ newins memtest memtest.netbsd
+ dosym memtest ${BOOTDIR}/memtest.bin
+
+ exeinto /etc/grub.d
+ doexe "${FILESDIR}"/39_memtest86+
+
+ dodoc README README.build-process FAQ changelog
+
+ if use floppy ; then
+ dobin "${FILESDIR}"/make-memtest86+-boot-floppy
+ doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
+ fi
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ elog
+ elog "memtest has been installed in ${BOOTDIR}/"
+ elog "You may wish to update your bootloader configs"
+ elog "by adding these lines:"
+ elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
+ elog " as /etc/grub.d/39_${PN}"
+ elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
+ elog " > title=${PN}"
+ elog " > root (hd?,?)"
+ elog " > kernel ${BOOTDIR}/memtest"
+ elog " - For lilo:"
+ elog " > image = ${BOOTDIR}/memtest"
+ elog " > label = ${PN}"
+ elog
+}
diff --git a/sys-apps/memtest86+/memtest86+-5.01.ebuild b/sys-apps/memtest86+/memtest86+-5.01.ebuild
new file mode 100644
index 000000000000..88def26d997e
--- /dev/null
+++ b/sys-apps/memtest86+/memtest86+-5.01.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit mount-boot eutils toolchain-funcs
+
+DESCRIPTION="Memory tester based on memtest86"
+HOMEPAGE="http://www.memtest.org/"
+SRC_URI="http://www.memtest.org/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="floppy serial"
+
+BOOTDIR=/boot/memtest86plus
+QA_PRESTRIPPED="${BOOTDIR}/memtest.netbsd"
+QA_FLAGS_IGNORED="${BOOTDIR}/memtest.netbsd"
+
+RDEPEND="floppy? ( >=sys-boot/grub-0.95:0 sys-fs/mtools )"
+DEPEND=""
+
+src_prepare() {
+ sed -i -e 's,0x10000,0x100000,' memtest.lds || die
+ sed -e "s/scp memtest.bin root@192.168.0.12:\/srv\/tftp\/mt86plus//g" -i Makefile
+ epatch "${FILESDIR}/${P}-gcc-473.patch" \
+ "${FILESDIR}/${P}-hardcoded_cc.patch"
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+
+ cat - > "${T}"/39_${PN} <<EOF
+#!/bin/sh
+exec tail -n +3 \$0
+
+menuentry "${PN} ${PV}" {
+ linux16 ${BOOTDIR}/memtest
+}
+
+menuentry "${PN} ${PV} (netbsd)" {
+ insmod bsd
+ knetbsd ${BOOTDIR}/memtest.netbsd
+}
+EOF
+
+ tc-export AS CC LD
+}
+
+src_test() { :; }
+
+src_install() {
+ insinto ${BOOTDIR}
+ newins memtest.bin memtest
+ newins memtest memtest.netbsd
+ dosym memtest ${BOOTDIR}/memtest.bin
+
+ exeinto /etc/grub.d
+ doexe "${T}"/39_${PN}
+
+ dodoc README README.build-process FAQ changelog
+
+ if use floppy ; then
+ dobin "${FILESDIR}"/make-memtest86+-boot-floppy
+ doman "${FILESDIR}"/make-memtest86+-boot-floppy.1
+ fi
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ elog
+ elog "memtest has been installed in ${BOOTDIR}/"
+ elog "You may wish to update your bootloader configs"
+ elog "by adding these lines:"
+ elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
+ elog " as /etc/grub.d/39_${PN}"
+ elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
+ elog " > title=${PN}"
+ elog " > root (hd?,?)"
+ elog " > kernel ${BOOTDIR}/memtest"
+ elog " - For lilo:"
+ elog " > image = ${BOOTDIR}/memtest"
+ elog " > label = ${PN}"
+ elog
+}
diff --git a/sys-apps/memtest86+/metadata.xml b/sys-apps/memtest86+/metadata.xml
new file mode 100644
index 000000000000..d7975494757f
--- /dev/null
+++ b/sys-apps/memtest86+/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>
+<use>
+ <flag name='serial'>Compile with serial console support</flag>
+ <flag name='floppy'>Install a script to create floppy disks containing memtest86+ binaries.</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/memtest86/Manifest b/sys-apps/memtest86/Manifest
new file mode 100644
index 000000000000..d00c7355f805
--- /dev/null
+++ b/sys-apps/memtest86/Manifest
@@ -0,0 +1,3 @@
+DIST memtest86-3.3.tar.gz 137922 SHA256 f4580d15636b18885709c8aca06759a512911b2efa76d28de2389165dfb9548c
+DIST memtest86-4.3.6-src.tar.gz 125475 SHA256 bbe2e2d13cd9f8a39232bd4f0fa70e01e1614515aeae7fac08755628a8d77361 SHA512 42f4478deca9550692ca36d704037b7eb85ca979a6d0f3f0ee3ed88cdfc7b10652340fc986135c3bf4403b6b6f5355f838a3cb1030758f68b2327bb1ff7030f0 WHIRLPOOL 166415dd84b8cc23958255058277d8a0ed67e351e506dfad6a119d207d436b72d7deff20db116b89bf2c82400e9a22b77554f20344cd1a838b5933671f95a53d
+DIST memtest86-4.3.7-src.tar.gz 125583 SHA256 784bf81107a8f8dbf06eadf5d8cc9f57a3249cade67c0635fea8b0e8691a96e7 SHA512 f1cee9085e157b399869222310c65e8094c028565d2b21fe40fd485505b988d20cff49b2c56559181ac114c39089b60c6eacb9aa5d7652df78b3f8e7530cb644 WHIRLPOOL 55283adb62b47f95e689e61e3bebdb65c51712b2d54e4cae0b012ffc4bb11f68309ad2a6ed31c911586e4e5ea5261d117fa827265935ce6e4f7341c58e5dc833
diff --git a/sys-apps/memtest86/files/39_memtest86 b/sys-apps/memtest86/files/39_memtest86
new file mode 100644
index 000000000000..a736bce6a316
--- /dev/null
+++ b/sys-apps/memtest86/files/39_memtest86
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. /usr/share/grub/grub-mkconfig_lib
+
+memtest=/boot/memtest86/memtest
+
+if [ -f "${memtest}" ]; then
+ device="$("${grub_probe}" --target=device "${memtest}")"
+ path="$(make_system_path_relative_to_its_root "${memtest}")"
+ cat <<EOF
+menuentry "MemTest86" {
+EOF
+ prepare_grub_to_access_device "${device}" | grub_add_tab
+ cat <<EOF
+ linux16 "${path}"
+}
+EOF
+fi
diff --git a/sys-apps/memtest86/files/memtest86-3.2-solar.patch b/sys-apps/memtest86/files/memtest86-3.2-solar.patch
new file mode 100644
index 000000000000..fa7effbeaac4
--- /dev/null
+++ b/sys-apps/memtest86/files/memtest86-3.2-solar.patch
@@ -0,0 +1,27 @@
+--- Makefile.orig 2004-11-12 07:16:25.000000000 -0500
++++ Makefile 2005-01-10 21:35:19.000000000 -0500
+@@ -12,7 +12,7 @@
+ #
+ # gcc compiler options, these settings should suffice
+ #
+-CCFLAGS=-Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding
++CCFLAGS=-Wall -march=i486 -m32 -Os -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector
+
+ AS=as -32
+
+@@ -21,10 +21,13 @@
+ all: memtest.bin memtest
+
+ reloc.o: reloc.c
+- $(CC) -c -m32 -fPIC -Wall -O -fno-strict-aliasing reloc.c
++ $(CC) -c -m32 -fPIC -Wall -O -fno-strict-aliasing reloc.c -fno-stack-protector
++
++random.o:
++ $(CC) -c $(CCFLAGS) -fPIC random.c
+
+ test.o: test.c test.h defs.h config.h
+- $(CC) -c $(CCFLAGS) test.c
++ $(CC) -c $(CCFLAGS) -fno-PIC test.c
+
+ main.o: main.c test.h defs.h
+ $(CC) -c $(CCFLAGS) -fPIC main.c
diff --git a/sys-apps/memtest86/files/memtest86-3.3-funky-test.patch b/sys-apps/memtest86/files/memtest86-3.3-funky-test.patch
new file mode 100644
index 000000000000..68fd355b2e08
--- /dev/null
+++ b/sys-apps/memtest86/files/memtest86-3.3-funky-test.patch
@@ -0,0 +1,15 @@
+i can only guess at what this test was trying to accomplish ...
+
+ive submitted this upstream
+
+--- main.c
++++ main.c
+@@ -465,7 +465,7 @@
+ }
+ compute_segments(window);
+ window = 0;
+- for (v->pass_ticks=0, i=0; i<DEFTESTS != NULL; i++) {
++ for (v->pass_ticks=0, i=0; i<DEFTESTS; i++) {
+
+ /* Test to see if this test is selected for execution */
+ if (v->testsel >= 0) {
diff --git a/sys-apps/memtest86/files/memtest86-3.3-gnu-hash.patch b/sys-apps/memtest86/files/memtest86-3.3-gnu-hash.patch
new file mode 100644
index 000000000000..397b2c8bbee7
--- /dev/null
+++ b/sys-apps/memtest86/files/memtest86-3.3-gnu-hash.patch
@@ -0,0 +1,12 @@
+sent upstream already ...
+
+--- memtest_shared.lds
++++ memtest_shared.lds
+@@ -19,6 +19,7 @@
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .hash : { *(.hash) }
++ .gnu.hash : { *(.gnu.hash) }
+ .dynamic : { *(.dynamic) }
+
+ .rel.text : { *(.rel.text .rel.text.*) }
diff --git a/sys-apps/memtest86/files/memtest86-4.0-build.patch b/sys-apps/memtest86/files/memtest86-4.0-build.patch
new file mode 100644
index 000000000000..7dfd6c2f6aae
--- /dev/null
+++ b/sys-apps/memtest86/files/memtest86-4.0-build.patch
@@ -0,0 +1,41 @@
+--- a/Makefile
++++ b/Makefile
+@@ -8,11 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
++ASFLAGS=-32
+
+-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
+- -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
++CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector $(SMP_FL)
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o linuxbios.o memsize.o error.o smp.o cpuid.o vmem.o random.o
+@@ -23,7 +21,7 @@
+ # symbols and then link it dynamically so I have full
+ # relocation information
+ memtest_shared: $(OBJS) memtest_shared.lds Makefile
+- $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds \
++ $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds -m elf_i386 \
+ -o $@ $(OBJS) && \
+ $(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS)
+
+@@ -50,7 +48,7 @@
+ $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c $(CFLAGS:-fPIC=) -o $@ $<
+
+ random.o: random.c
+ $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
+@@ -72,3 +70,6 @@
+ dos: all
+ cat mt86+_loader memtest.bin > memtest.exe
+
++head.o: head.s
++bootsect.o: bootsect.s
++setup.o: setup.s
diff --git a/sys-apps/memtest86/files/memtest86-4.3.3-build-nopie.patch b/sys-apps/memtest86/files/memtest86-4.3.3-build-nopie.patch
new file mode 100644
index 000000000000..adbbe6f86dc7
--- /dev/null
+++ b/sys-apps/memtest86/files/memtest86-4.3.3-build-nopie.patch
@@ -0,0 +1,47 @@
+diff -Naur src.orig/Makefile src/Makefile
+--- src.orig/Makefile 2013-10-10 16:52:14.292140058 -0400
++++ src/Makefile 2013-10-10 16:51:37.431138380 -0400
+@@ -8,11 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
++ASFLAGS=-32
+
+-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
+- -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
++CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector -fno-pie $(SMP_FL)
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o memsize.o error.o smp.o cpuid.o vmem.o random.o
+@@ -23,7 +21,7 @@
+ # symbols and then link it dynamically so I have full
+ # relocation information
+ memtest_shared: $(OBJS) memtest_shared.lds Makefile
+- $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds \
++ $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds -m elf_i386 \
+ -o $@ $(OBJS) && \
+ $(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS)
+
+@@ -50,10 +48,10 @@
+ $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c $(CFLAGS:-fPIC=) -o $@ $<
+
+ random.o: random.c
+- $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
++ $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding -fno-stack-protector -fno-pie random.c
+
+ clean:
+ rm -f *.o *.s *.iso memtest.bin memtest memtest_shared \
+@@ -72,3 +70,7 @@
+ dos: all
+ cat mt86+_loader memtest.bin > memtest.exe
+
++head.o: head.s
++bootsect.o: bootsect.s
++setup.o: setup.s
++
diff --git a/sys-apps/memtest86/files/memtest86-4.3.3-build.patch b/sys-apps/memtest86/files/memtest86-4.3.3-build.patch
new file mode 100644
index 000000000000..2c5906ad5cad
--- /dev/null
+++ b/sys-apps/memtest86/files/memtest86-4.3.3-build.patch
@@ -0,0 +1,43 @@
+diff -uNr src.orig/Makefile src/Makefile
+--- src.orig/Makefile 2013-10-10 19:35:27.354179645 +0100
++++ src/Makefile 2013-10-10 19:38:07.344184547 +0100
+@@ -8,11 +8,9 @@
+ #
+ FDISK=/dev/fd0
+
+-AS=as -32
+-CC=gcc
++ASFLAGS=-32
+
+-CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin \
+- -ffreestanding -fPIC $(SMP_FL) -fno-stack-protector
++CFLAGS= -Wall -march=i486 -m32 -O1 -fomit-frame-pointer -fno-builtin -ffreestanding -fPIC -fno-stack-protector $(SMP_FL)
+
+ OBJS= head.o reloc.o main.o test.o init.o lib.o patn.o screen_buffer.o \
+ config.o memsize.o error.o smp.o cpuid.o vmem.o random.o
+@@ -23,7 +21,7 @@
+ # symbols and then link it dynamically so I have full
+ # relocation information
+ memtest_shared: $(OBJS) memtest_shared.lds Makefile
+- $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds \
++ $(LD) --warn-constructors --warn-common -static -T memtest_shared.lds -m elf_i386 \
+ -o $@ $(OBJS) && \
+ $(LD) -shared -Bsymbolic -T memtest_shared.lds -o $@ $(OBJS)
+
+@@ -50,7 +48,7 @@
+ $(CC) -c $(CFLAGS) -fno-strict-aliasing reloc.c
+
+ test.o: test.c
+- $(CC) -c -Wall -march=i486 -m32 -O0 -fomit-frame-pointer -fno-builtin -ffreestanding test.c
++ $(CC) -c $(CFLAGS:-fPIC=) -o $@ $<
+
+ random.o: random.c
+ $(CC) -c -Wall -march=i486 -m32 -O3 -fomit-frame-pointer -fno-builtin -ffreestanding random.c
+@@ -72,3 +70,7 @@
+ dos: all
+ cat mt86+_loader memtest.bin > memtest.exe
+
++head.o: head.s
++bootsect.o: bootsect.s
++setup.o: setup.s
++
diff --git a/sys-apps/memtest86/memtest86-3.3.ebuild b/sys-apps/memtest86/memtest86-3.3.ebuild
new file mode 100644
index 000000000000..c908800ffc89
--- /dev/null
+++ b/sys-apps/memtest86/memtest86-3.3.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit mount-boot eutils
+
+DESCRIPTION="A stand alone memory test for x86 computers"
+HOMEPAGE="http://www.memtest86.com/"
+SRC_URI="http://www.memtest86.com/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="serial"
+RESTRICT="test"
+
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-3.2-solar.patch #66630
+ epatch "${FILESDIR}"/${P}-funky-test.patch
+ epatch "${FILESDIR}"/${P}-gnu-hash.patch
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+}
+
+src_install() {
+ insinto /boot/memtest86
+ doins memtest.bin || die "doins failed"
+ dodoc README README.build-process
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ einfo
+ einfo "memtest.bin has been installed in /boot/memtest86/"
+ einfo "You may wish to update your bootloader configs"
+ einfo "by adding these lines:"
+ einfo " - For grub: (replace '?' with correct numbers for your boot partition)"
+ einfo " > root (hd?,?)"
+ einfo " > title=Memtest86"
+ einfo " > kernel /boot/memtest86/memtest.bin"
+ einfo " - For lilo:"
+ einfo " > image = /boot/memtest86/memtest.bin"
+ einfo " > label = Memtest86"
+ einfo
+}
diff --git a/sys-apps/memtest86/memtest86-4.3.6.ebuild b/sys-apps/memtest86/memtest86-4.3.6.ebuild
new file mode 100644
index 000000000000..7a543827d99a
--- /dev/null
+++ b/sys-apps/memtest86/memtest86-4.3.6.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit mount-boot eutils toolchain-funcs
+
+DESCRIPTION="A stand alone memory test for x86 computers"
+HOMEPAGE="http://www.memtest86.com/"
+SRC_URI="http://www.memtest86.com/downloads/${P}-src.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="serial"
+S="${WORKDIR}/src"
+
+BOOTDIR=/boot/memtest86
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.3.3-build-nopie.patch #66630 + #206726
+
+ sed -i -e 's,0x10000,0x100000,' memtest.lds || die
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+
+ tc-export AS CC LD
+}
+
+src_test() { :; }
+
+src_install() {
+ insinto ${BOOTDIR}
+ newins memtest.bin memtest
+ dosym memtest ${BOOTDIR}/memtest.bin
+
+ exeinto /etc/grub.d
+ doexe "${FILESDIR}"/39_memtest86
+
+ dodoc README README.build-process README.background
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ elog
+ elog "memtest has been installed in ${BOOTDIR}/"
+ elog "You may wish to update your bootloader configs"
+ elog "by adding these lines:"
+ elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
+ elog " as /etc/grub/39_${PN}"
+ elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
+ elog " > title=${PN}"
+ elog " > root (hd?,?)"
+ elog " > kernel ${BOOTDIR}/memtest"
+ elog " - For lilo:"
+ elog " > image = ${BOOTDIR}/memtest"
+ elog " > label = ${PN}"
+ elog
+}
diff --git a/sys-apps/memtest86/memtest86-4.3.7.ebuild b/sys-apps/memtest86/memtest86-4.3.7.ebuild
new file mode 100644
index 000000000000..7a543827d99a
--- /dev/null
+++ b/sys-apps/memtest86/memtest86-4.3.7.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit mount-boot eutils toolchain-funcs
+
+DESCRIPTION="A stand alone memory test for x86 computers"
+HOMEPAGE="http://www.memtest86.com/"
+SRC_URI="http://www.memtest86.com/downloads/${P}-src.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="serial"
+S="${WORKDIR}/src"
+
+BOOTDIR=/boot/memtest86
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.3.3-build-nopie.patch #66630 + #206726
+
+ sed -i -e 's,0x10000,0x100000,' memtest.lds || die
+
+ if use serial ; then
+ sed -i \
+ -e '/^#define SERIAL_CONSOLE_DEFAULT/s:0:1:' \
+ config.h \
+ || die "sed failed"
+ fi
+
+ tc-export AS CC LD
+}
+
+src_test() { :; }
+
+src_install() {
+ insinto ${BOOTDIR}
+ newins memtest.bin memtest
+ dosym memtest ${BOOTDIR}/memtest.bin
+
+ exeinto /etc/grub.d
+ doexe "${FILESDIR}"/39_memtest86
+
+ dodoc README README.build-process README.background
+}
+
+pkg_postinst() {
+ mount-boot_pkg_postinst
+ elog
+ elog "memtest has been installed in ${BOOTDIR}/"
+ elog "You may wish to update your bootloader configs"
+ elog "by adding these lines:"
+ elog " - For grub2 just run grub-mkconfig, a configuration file is installed"
+ elog " as /etc/grub/39_${PN}"
+ elog " - For grub legacy: (replace '?' with correct numbers for your boot partition)"
+ elog " > title=${PN}"
+ elog " > root (hd?,?)"
+ elog " > kernel ${BOOTDIR}/memtest"
+ elog " - For lilo:"
+ elog " > image = ${BOOTDIR}/memtest"
+ elog " > label = ${PN}"
+ elog
+}
diff --git a/sys-apps/memtest86/metadata.xml b/sys-apps/memtest86/metadata.xml
new file mode 100644
index 000000000000..6865707310d8
--- /dev/null
+++ b/sys-apps/memtest86/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>
+<use>
+ <flag name='serial'>Compile with serial console support</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/memtester/Manifest b/sys-apps/memtester/Manifest
new file mode 100644
index 000000000000..9235a7b5da29
--- /dev/null
+++ b/sys-apps/memtester/Manifest
@@ -0,0 +1,2 @@
+DIST memtester-4.2.2.tar.gz 20952 SHA256 a494569d58d642c796332a1b7f3b4b86845b52da66c15c96fbeecd74e48dae8e SHA512 9ddff98e3173583e3edd50fb5e8a951f20956a75768231c8576d33d091776f22eeb15717a8b87e968e9c49211c83551d518f62ad3a1b0ee1db76152fee925bfa WHIRLPOOL 5de1bab98cb6d0bc2b49f75608fed4f46f36616ff070587a2b06592e36b26db6a0d9389fec6aca59f087f1dc5e1ee6b1d0a146ee6942a4286af4525c3b3a0364
+DIST memtester-4.3.0.tar.gz 22113 SHA256 f9dfe2fd737c38fad6535bbab327da9a21f7ce4ea6f18c7b3339adef6bf5fd88 SHA512 045bcc73855706ff03e8ca65297a0d6e5b5ac02f99dae0f17cef1310b403efcb78d9a7295eca6d2de703b0a7b2f71b58a37f5a42040f01fc77a321a8d2205888 WHIRLPOOL 6f4389ba575134c9407939f9852bacbd29868da380a1df5a43dba9437e96c17b7cf8637ddbff971250d7dc78f42fc7f3235541d17f4b5879a46a9ab9ada7f2a8
diff --git a/sys-apps/memtester/memtester-4.2.2.ebuild b/sys-apps/memtester/memtester-4.2.2.ebuild
new file mode 100644
index 000000000000..bdce08738fe7
--- /dev/null
+++ b/sys-apps/memtester/memtester-4.2.2.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="userspace utility for testing the memory subsystem for faults"
+HOMEPAGE="http://pyropus.ca/software/memtester/"
+SRC_URI="http://pyropus.ca/software/memtester/${P}.tar.gz
+ http://pyropus.ca/software/memtester/old-versions/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ia64 ~mips ppc ppc64 ~sparc x86"
+IUSE=""
+
+src_prepare() {
+ echo "$(tc-getCC) ${CFLAGS} ${CPPFLAGS} -DPOSIX -c" > conf-cc
+ echo "$(tc-getCC) ${CFLAGS} ${LDFLAGS}" > conf-ld
+}
+
+src_install() {
+ dosbin memtester
+ doman memtester.8
+ dodoc BUGS CHANGELOG README README.tests
+}
diff --git a/sys-apps/memtester/memtester-4.3.0.ebuild b/sys-apps/memtester/memtester-4.3.0.ebuild
new file mode 100644
index 000000000000..e1f4318b2f68
--- /dev/null
+++ b/sys-apps/memtester/memtester-4.3.0.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="userspace utility for testing the memory subsystem for faults"
+HOMEPAGE="http://pyropus.ca/software/memtester/"
+SRC_URI="http://pyropus.ca/software/memtester/${P}.tar.gz
+ http://pyropus.ca/software/memtester/old-versions/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ppc ppc64 sparc x86"
+IUSE=""
+
+src_prepare() {
+ echo "$(tc-getCC) ${CFLAGS} ${CPPFLAGS} -DPOSIX -c" > conf-cc
+ echo "$(tc-getCC) ${CFLAGS} ${LDFLAGS}" > conf-ld
+}
+
+src_install() {
+ dosbin memtester
+ doman memtester.8
+ dodoc BUGS CHANGELOG README README.tests
+}
diff --git a/sys-apps/memtester/metadata.xml b/sys-apps/memtester/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/memtester/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-apps/metadata.xml b/sys-apps/metadata.xml
new file mode 100644
index 000000000000..e780a8953053
--- /dev/null
+++ b/sys-apps/metadata.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sys-apps category contains various core system applications, and
+ some non-core system applications which have not yet been moved out into
+ other sys- categories.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sys-apps contiene varios paquetes esenciales del sistema, y
+ algunos paquetes no esenciales que aún no han sido movidos a otras
+ categorías sys-.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sys-apps enthält sowohl Programme die Bestandteil des Basissystems sind,
+ als auch Applikationen die noch nicht in eine der anderen sys- Kategorien eingeordnet
+ wurden.
+ </longdescription>
+ <longdescription lang="ja">
+ sys-appsカテゴリには様々なコアシステムアプリケーションの他、まだ他のsys-カテゴリに
+ 移動されていないシステムアプリケーションが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De sys-apps categorie bevat kerenbestanddelen van het systeem, en bepaalde
+ niet-kern toepassingen die nog niet in andere categorien zijn geplaatst.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sys-apps chứa các phần mềm hệ thống cốt lõi, và vài phần mềm
+ hệ thống không phải cốt lõi mà chưa được chuyển sang các nhóm sys- khác.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sys-apps contiene vari pacchetti essenziali per il sistema, e alcuni pacchetti
+ non essenziali che non sono ancora stati spostati in altre categorie sys-.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sys-apps contém vários pacotes essenciais do sistema, e
+ algumas aplicações não-centrais que ainda não foram colocadas em
+ outras categorias sys-.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sys-apps zawiera programy systemowe oraz inne dodatkowe
+ programy, których jeszcze nie przeniesiono do kategorii sys-.
+ </longdescription>
+</catmetadata>
+
diff --git a/sys-apps/microcode-ctl/Manifest b/sys-apps/microcode-ctl/Manifest
new file mode 100644
index 000000000000..542af0778941
--- /dev/null
+++ b/sys-apps/microcode-ctl/Manifest
@@ -0,0 +1,3 @@
+DIST microcode_ctl-1.23.tar.xz 755448 SHA256 1a06416f56d54b748258499e1599e75bab6bbee82ac834982ecec0276e5992eb SHA512 f33b4fd43c39b3d4e9b6eb9a12285c7ea26ee43e6c4aa1e45f9aa92a0d2b7d55d1a950ee82d8aea5c86faa15dd1e85e829719b6c772a2c09f262bea630bc7edb WHIRLPOOL 09c4698ab72efbf6240f6c6461549311d01941d53dd81e9f5a08749535d589b0ea24c01999b13f5208626b639aa4611fbbf9c2d5a1fb203689b4405e37aa8b9a
+DIST microcode_ctl-1.27.tar.xz 856240 SHA256 bfaa2847954c6149912e4c7b8b5b5504fdbe09213c4efcf25d37e632a2a55f99 SHA512 ac4bce583f756b777488605687fe1bef0038763ed4a0afc51b454140f00caf04ef8a6d790d95684aa82c857f9cefd59b2413b96ad3d0c349da4b88166c5aa556 WHIRLPOOL b8b3b8094c0f1719126fe8208a7292adf9370633bce773cfd2684e5f207341e3cf6c51272520adfdeb0213ee2927d72d6565d840a3e240cf094d1707e38b27f6
+DIST microcode_ctl-1.28.tar.xz 876760 SHA256 be015f6c7aff736b01d0d57b7f9345aebcca6dd73e5c9026a6ad8a9c09107de2 SHA512 ed5deb0f96c895b7783c23a1c91d2e03f713a793a21140b049e1b5f08f553dce103b4a11016ebd5076424b1032342d009d952e0089badfea2e91ad486d2cf7f8 WHIRLPOOL eddabcf355b219564604fdf3ecfb94670df6d78412051f23b0c7024bad05fc18eb11eccfe84f3a7b4aff8e52e504c32f304e3e9b5762db05b189407421deb050
diff --git a/sys-apps/microcode-ctl/files/microcode_ctl.conf.d b/sys-apps/microcode-ctl/files/microcode_ctl.conf.d
new file mode 100644
index 000000000000..0505a80ae92b
--- /dev/null
+++ b/sys-apps/microcode-ctl/files/microcode_ctl.conf.d
@@ -0,0 +1,11 @@
+# /etc/conf.d/microcode_ctl
+
+# Device to pass to microcode_ctl
+
+MICROCODE_DEV="/dev/cpu/microcode"
+
+
+# Should we try to unload the microcode module after we
+# update the cpu microcode ?
+
+MICROCODE_UNLOAD="yes"
diff --git a/sys-apps/microcode-ctl/files/microcode_ctl.rc b/sys-apps/microcode-ctl/files/microcode_ctl.rc
new file mode 100644
index 000000000000..da6be097e577
--- /dev/null
+++ b/sys-apps/microcode-ctl/files/microcode_ctl.rc
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+depend() {
+ need localmount
+}
+
+start() {
+ local ret
+
+ # Make sure the kernel supports the microcode device ...
+ # if it doesnt, try to modprobe the kernel module
+ grep -qs ' microcode$' /proc/misc || modprobe -q microcode
+
+ ebegin "Updating microcode"
+ microcode_ctl -qu -d ${MICROCODE_DEV}
+ ret=$?
+ eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'"
+
+ [ "${MICROCODE_UNLOAD}" = "yes" ] && rmmod microcode >/dev/null 2>&1
+
+ return ${ret}
+}
diff --git a/sys-apps/microcode-ctl/files/microcode_ctl.rc-r1 b/sys-apps/microcode-ctl/files/microcode_ctl.rc-r1
new file mode 100644
index 000000000000..e23347fb1df8
--- /dev/null
+++ b/sys-apps/microcode-ctl/files/microcode_ctl.rc-r1
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+depend() {
+ need localmount
+}
+
+start() {
+ local ret
+
+ # Make sure the kernel supports the microcode device ...
+ # if it doesnt, try to modprobe the kernel module
+ grep -qs ' microcode$' /proc/misc || modprobe -q microcode
+
+ ebegin "Updating microcode"
+ microcode_ctl -qu -f /lib/firmware/microcode.dat -d ${MICROCODE_DEV}
+ ret=$?
+ eend ${ret} "Failed to update microcode via '${MICROCODE_DEV}'"
+
+ [ "${MICROCODE_UNLOAD}" = "yes" ] && rmmod microcode >/dev/null 2>&1
+
+ return ${ret}
+}
diff --git a/sys-apps/microcode-ctl/metadata.xml b/sys-apps/microcode-ctl/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/microcode-ctl/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-apps/microcode-ctl/microcode-ctl-1.23.ebuild b/sys-apps/microcode-ctl/microcode-ctl-1.23.ebuild
new file mode 100644
index 000000000000..1d9e1b2a52b5
--- /dev/null
+++ b/sys-apps/microcode-ctl/microcode-ctl-1.23.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 linux-info toolchain-funcs
+
+MY_P=${PN/-/_}-${PV}
+DESCRIPTION="Intel processor microcode update utility"
+HOMEPAGE="https://fedorahosted.org/microcode_ctl/"
+SRC_URI="https://fedorahosted.org/released/${PN/-/_}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="selinux"
+
+DEPEND=""
+RDEPEND=">=sys-apps/microcode-data-20090330
+ selinux? ( sec-policy/selinux-cpucontrol )"
+
+S=${WORKDIR}/${MY_P}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
+}
+
+src_install() {
+ dosbin microcode_ctl
+ doman microcode_ctl.8
+ dodoc Changelog README
+
+ newinitd "${FILESDIR}"/microcode_ctl.rc-r1 microcode_ctl
+ newconfd "${FILESDIR}"/microcode_ctl.conf.d microcode_ctl
+}
+
+pkg_postinst() {
+ # Just a friendly warning
+ if ! linux_config_exists || ! linux_chkconfig_present MICROCODE; then
+ echo
+ ewarn "Your kernel must include microcode update support."
+ ewarn " Processor type and features --->"
+ ewarn " <*> /dev/cpu/microcode - microcode support"
+ echo
+ fi
+ elog "Microcode updates will be lost at every reboot."
+ elog "You can use the init.d script to update at boot time."
+}
diff --git a/sys-apps/microcode-ctl/microcode-ctl-1.27.ebuild b/sys-apps/microcode-ctl/microcode-ctl-1.27.ebuild
new file mode 100644
index 000000000000..bb90b80a5ce1
--- /dev/null
+++ b/sys-apps/microcode-ctl/microcode-ctl-1.27.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 linux-info toolchain-funcs
+
+MY_P=${PN/-/_}-${PV}
+DESCRIPTION="Intel processor microcode update utility"
+HOMEPAGE="https://fedorahosted.org/microcode_ctl/"
+SRC_URI="https://fedorahosted.org/released/${PN/-/_}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="selinux"
+
+DEPEND=""
+RDEPEND=">=sys-apps/microcode-data-20090330
+ selinux? ( sec-policy/selinux-cpucontrol )"
+
+S=${WORKDIR}/${MY_P}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
+}
+
+src_install() {
+ dosbin microcode_ctl
+ doman microcode_ctl.8
+ dodoc Changelog README
+
+ newinitd "${FILESDIR}"/microcode_ctl.rc-r1 microcode_ctl
+ newconfd "${FILESDIR}"/microcode_ctl.conf.d microcode_ctl
+}
+
+pkg_postinst() {
+ # Just a friendly warning
+ if ! linux_config_exists || ! linux_chkconfig_present MICROCODE; then
+ echo
+ ewarn "Your kernel must include microcode update support."
+ ewarn " Processor type and features --->"
+ ewarn " <*> /dev/cpu/microcode - microcode support"
+ echo
+ fi
+ elog "Microcode updates will be lost at every reboot."
+ elog "You can use the init.d script to update at boot time."
+}
diff --git a/sys-apps/microcode-ctl/microcode-ctl-1.28.ebuild b/sys-apps/microcode-ctl/microcode-ctl-1.28.ebuild
new file mode 100644
index 000000000000..bb90b80a5ce1
--- /dev/null
+++ b/sys-apps/microcode-ctl/microcode-ctl-1.28.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 linux-info toolchain-funcs
+
+MY_P=${PN/-/_}-${PV}
+DESCRIPTION="Intel processor microcode update utility"
+HOMEPAGE="https://fedorahosted.org/microcode_ctl/"
+SRC_URI="https://fedorahosted.org/released/${PN/-/_}/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="selinux"
+
+DEPEND=""
+RDEPEND=">=sys-apps/microcode-data-20090330
+ selinux? ( sec-policy/selinux-cpucontrol )"
+
+S=${WORKDIR}/${MY_P}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} ${CPPFLAGS} ${LDFLAGS}"
+}
+
+src_install() {
+ dosbin microcode_ctl
+ doman microcode_ctl.8
+ dodoc Changelog README
+
+ newinitd "${FILESDIR}"/microcode_ctl.rc-r1 microcode_ctl
+ newconfd "${FILESDIR}"/microcode_ctl.conf.d microcode_ctl
+}
+
+pkg_postinst() {
+ # Just a friendly warning
+ if ! linux_config_exists || ! linux_chkconfig_present MICROCODE; then
+ echo
+ ewarn "Your kernel must include microcode update support."
+ ewarn " Processor type and features --->"
+ ewarn " <*> /dev/cpu/microcode - microcode support"
+ echo
+ fi
+ elog "Microcode updates will be lost at every reboot."
+ elog "You can use the init.d script to update at boot time."
+}
diff --git a/sys-apps/microcode-data/Manifest b/sys-apps/microcode-data/Manifest
new file mode 100644
index 000000000000..2fe33baa9f37
--- /dev/null
+++ b/sys-apps/microcode-data/Manifest
@@ -0,0 +1,4 @@
+DIST microcode-20140430.tgz 785594 SHA256 2e67767fd561164a2b09831020c2d36600ad336a9c0c117f1964edef284e4351 SHA512 12954522629ce15c4b95c158b6288b3877a3d1f87bea838f8138e53987ef1b6c0edc7a8cbb802a981ccca178b70b4323907aafa7479c0c2fed4497f6fb7bbc1c WHIRLPOOL 92bb063bc14308568ef8a872de54ad99946eb9ec42ac890b11b6cf1f8c07667d386f030a7459cd168652044d87686b61e06ff5a2bcd582c704de6b3b621dbaa2
+DIST microcode-20140624.tgz 787237 SHA256 b4662ac780438a7b2d87e6d26a7066feb807f37c6e5b6fa147089f4edb02ea37 SHA512 c774006aae639e7fae90bc1f5d8308b407e7cd3b7d0da6e35577560bf6201c2b15f7d7b6b0cd727c50be1e9d508b484b067856631fa2598498982109bff0e44c WHIRLPOOL 6051d4a7547e6f74c653d332c54a4711838b670d2707408de7dccddb5d1409994417bae26ce5ec2f72d91b613e14a3381ded301027995bca1fb746baf85000c4
+DIST microcode-20140913.tgz 830537 SHA256 ea6c0ee21d1fbf261f093176a78089c21411e5fe0e2c35b258cedf2b39987e15 SHA512 e179fe0001b1157cc95aee39185f51fd182d53c1bdb30bfc95bc3a70795c32012050f3a4adf06735a77d8ef9c703a330c6a2610b73b70f09f5760e31d39cb89c WHIRLPOOL de56d52d184dd2f21e0ca41dca0bb5b539758de614f4e0eb8e7c8281e97ea6dfcc33c50a3fec7262112dc11e8a78b458b3d7ef8c8b5579d500d358393911565d
+DIST microcode-20150121.tgz 850761 SHA256 23353b93bb421971496cea5e9f9d390ce0ed22580a8cc45ae7b3b322dcd8f6b3 SHA512 f62edd1b666cf381605613766d7e123f0c6debee4448c0ff0882d33c144ad2174656d2501a449f24eb3e4708259e7ec0ff42810739b7d1f34a6a1d9950d17bc4 WHIRLPOOL 573368845333aee9ca23a98cc6711cc22da5b5893a3c29df292df281a024ad9b50ab4893cc0a44b65e86f388fc55e2c53cd0f99a619c3315dd4db5e090b91319
diff --git a/sys-apps/microcode-data/files/intel-microcode2ucode.c b/sys-apps/microcode-data/files/intel-microcode2ucode.c
new file mode 100644
index 000000000000..caad0323e805
--- /dev/null
+++ b/sys-apps/microcode-data/files/intel-microcode2ucode.c
@@ -0,0 +1,163 @@
+/*
+ * Convert Intel microcode.dat into individual ucode files
+ * named: intel-ucode/$family-$model-$stepping
+ *
+ * The subdir intel-ucode/ is created in the current working
+ * directory. We get multiple ucodes in the same file, so they
+ * are appended to an existing file. Make sure the directory
+ * is empty before every run of the converter.
+ *
+ * Kay Sievers <kay.sievers@vrfy.org>
+ */
+
+
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <inttypes.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+struct microcode_header_intel {
+ unsigned int hdrver;
+ unsigned int rev;
+ unsigned int date;
+ unsigned int sig;
+ unsigned int cksum;
+ unsigned int ldrver;
+ unsigned int pf;
+ unsigned int datasize;
+ unsigned int totalsize;
+ unsigned int reserved[3];
+};
+
+union mcbuf {
+ struct microcode_header_intel hdr;
+ unsigned int i[0];
+ char c[0];
+};
+
+int main(int argc, char *argv[])
+{
+ char *filename = "/lib/firmware/microcode.dat";
+ FILE *f;
+ char line[LINE_MAX];
+ char buf[4000000];
+ union mcbuf *mc;
+ size_t bufsize, count, start;
+ int rc = EXIT_SUCCESS;
+
+ if (argv[1] != NULL)
+ filename = argv[1];
+
+ count = 0;
+ mc = (union mcbuf *) buf;
+ f = fopen(filename, "re");
+ if (f == NULL) {
+ printf("open %s: %m\n", filename);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+ if (sscanf(line, "%x, %x, %x, %x",
+ &mc->i[count],
+ &mc->i[count + 1],
+ &mc->i[count + 2],
+ &mc->i[count + 3]) != 4)
+ continue;
+ count += 4;
+ }
+ fclose(f);
+
+ bufsize = count * sizeof(int);
+ printf("%s: %lu(%luk) bytes, %zu integers\n",
+ filename,
+ bufsize,
+ bufsize / 1024,
+ count);
+
+ if (bufsize < sizeof(struct microcode_header_intel))
+ goto out;
+
+ mkdir("intel-ucode", 0750);
+
+ start = 0;
+ for (;;) {
+ size_t size;
+ unsigned int family, model, stepping;
+ unsigned int year, month, day;
+
+ mc = (union mcbuf *) &buf[start];
+
+ if (mc->hdr.totalsize)
+ size = mc->hdr.totalsize;
+ else
+ size = 2000 + sizeof(struct microcode_header_intel);
+
+ if (mc->hdr.ldrver != 1 || mc->hdr.hdrver != 1) {
+ printf("unknown version/format:\n");
+ rc = EXIT_FAILURE;
+ break;
+ }
+
+ /*
+ * 0- 3 stepping
+ * 4- 7 model
+ * 8-11 family
+ * 12-13 type
+ * 16-19 extended model
+ * 20-27 extended family
+ */
+ family = (mc->hdr.sig >> 8) & 0xf;
+ if (family == 0xf)
+ family += (mc->hdr.sig >> 20) & 0xff;
+ model = (mc->hdr.sig >> 4) & 0x0f;
+ if (family == 0x06)
+ model += ((mc->hdr.sig >> 16) & 0x0f) << 4;
+ stepping = mc->hdr.sig & 0x0f;
+
+ year = mc->hdr.date & 0xffff;
+ month = mc->hdr.date >> 24;
+ day = (mc->hdr.date >> 16) & 0xff;
+
+ asprintf(&filename, "intel-ucode/%02x-%02x-%02x", family, model, stepping);
+ printf("\n");
+ printf("%s\n", filename);
+ printf("signature: 0x%02x\n", mc->hdr.sig);
+ printf("flags: 0x%02x\n", mc->hdr.pf);
+ printf("revision: 0x%02x\n", mc->hdr.rev);
+ printf("date: %04x-%02x-%02x\n", year, month, day);
+ printf("size: %zu\n", size);
+
+ f = fopen(filename, "ae");
+ if (f == NULL) {
+ printf("open %s: %m\n", filename);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+ if (fwrite(mc, size, 1, f) != 1) {
+ printf("write %s: %m\n", filename);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+ fclose(f);
+ free(filename);
+
+ start += size;
+ if (start >= bufsize)
+ break;
+ }
+ printf("\n");
+out:
+ return rc;
+}
diff --git a/sys-apps/microcode-data/metadata.xml b/sys-apps/microcode-data/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/microcode-data/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-apps/microcode-data/microcode-data-20140430.ebuild b/sys-apps/microcode-data/microcode-data-20140430.ebuild
new file mode 100644
index 000000000000..f1ab23ccac05
--- /dev/null
+++ b/sys-apps/microcode-data/microcode-data-20140430.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="23829"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die
+}
+
+src_compile() {
+ tc-env_build emake intel-microcode2ucode
+ ./intel-microcode2ucode microcode.dat || die
+}
+
+src_install() {
+ insinto /lib/firmware
+ doins -r microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-apps/microcode-data/microcode-data-20140624.ebuild b/sys-apps/microcode-data/microcode-data-20140624.ebuild
new file mode 100644
index 000000000000..d4244ae50ecb
--- /dev/null
+++ b/sys-apps/microcode-data/microcode-data-20140624.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="23984"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die
+}
+
+src_compile() {
+ tc-env_build emake intel-microcode2ucode
+ ./intel-microcode2ucode microcode.dat || die
+}
+
+src_install() {
+ insinto /lib/firmware
+ doins -r microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-apps/microcode-data/microcode-data-20140913.ebuild b/sys-apps/microcode-data/microcode-data-20140913.ebuild
new file mode 100644
index 000000000000..66a3907c115a
--- /dev/null
+++ b/sys-apps/microcode-data/microcode-data-20140913.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="24290"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die
+}
+
+src_compile() {
+ tc-env_build emake intel-microcode2ucode
+ ./intel-microcode2ucode microcode.dat || die
+}
+
+src_install() {
+ insinto /lib/firmware
+ doins -r microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-apps/microcode-data/microcode-data-20150121.ebuild b/sys-apps/microcode-data/microcode-data-20150121.ebuild
new file mode 100644
index 000000000000..6100e6e56464
--- /dev/null
+++ b/sys-apps/microcode-data/microcode-data-20150121.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+# Find updates by searching and clicking the first link (hopefully it's the one):
+# http://www.intel.com/content/www/us/en/search.html?keyword=Processor+Microcode+Data+File
+
+NUM="24661"
+DESCRIPTION="Intel IA32 microcode update data"
+HOMEPAGE="http://inertiawar.com/microcode/ https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=${NUM}"
+SRC_URI="http://downloadmirror.intel.com/${NUM}/eng/microcode-${PV}.tgz"
+
+LICENSE="intel-ucode"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="!<sys-apps/microcode-ctl-1.17-r2" #268586
+
+S=${WORKDIR}
+
+src_unpack() {
+ default
+ cp "${FILESDIR}"/intel-microcode2ucode.c ./ || die
+}
+
+src_compile() {
+ tc-env_build emake intel-microcode2ucode
+ ./intel-microcode2ucode microcode.dat || die
+}
+
+src_install() {
+ insinto /lib/firmware
+ doins -r microcode.dat intel-ucode
+}
+
+pkg_postinst() {
+ elog "The microcode available for Intel CPUs has been updated. You'll need"
+ elog "to reload the code into your processor. If you're using the init.d:"
+ elog "/etc/init.d/microcode_ctl restart"
+}
diff --git a/sys-apps/minised/Manifest b/sys-apps/minised/Manifest
new file mode 100644
index 000000000000..949d09216e99
--- /dev/null
+++ b/sys-apps/minised/Manifest
@@ -0,0 +1,2 @@
+DIST minised-1.13.tar.gz 28695 SHA256 f3af89011061a018a88490abfb0354ad5e395e98f51bc18bdbcd5712c682eaed
+DIST minised-1.14.tar.gz 29746 SHA256 fb68e5ca7bf1d1ed49afe10ea6d7e555f1bea20df60600fd306b39818058a133 SHA512 29815e6cde7a2070868c34ea8dffd70110aac6390ebda420c7cda856e7659ac0f2155cabbc05fd09dce26ed2b762f4850ce463c7db948b063cfd7c05d106ef98 WHIRLPOOL 17305959cd0166069ed36ed86b3d3083e4052ca0c5b9c0b39f2b67390aae3ff962917cbbde91e6a574b0aa7b0af688fda67e1ded1d50d10dec0d5c630c4dc418
diff --git a/sys-apps/minised/metadata.xml b/sys-apps/minised/metadata.xml
new file mode 100644
index 000000000000..80f59b50e3e5
--- /dev/null
+++ b/sys-apps/minised/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>embedded</herd>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-apps/minised/minised-1.13.ebuild b/sys-apps/minised/minised-1.13.ebuild
new file mode 100644
index 000000000000..c462388aabfc
--- /dev/null
+++ b/sys-apps/minised/minised-1.13.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="a smaller, cheaper, faster SED implementation"
+HOMEPAGE="http://www.exactcode.de/oss/minised/"
+SRC_URI="http://dl.exactcode.de/oss/minised/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+src_compile() {
+ tc-export CC
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc BUGS README
+}
diff --git a/sys-apps/minised/minised-1.14.ebuild b/sys-apps/minised/minised-1.14.ebuild
new file mode 100644
index 000000000000..edd9bc7693aa
--- /dev/null
+++ b/sys-apps/minised/minised-1.14.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="a smaller, cheaper, faster SED implementation"
+HOMEPAGE="http://www.exactcode.de/oss/minised/"
+SRC_URI="http://dl.exactcode.de/oss/minised/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+src_prepare() {
+ tc-export CC
+}
diff --git a/sys-apps/miscfiles/Manifest b/sys-apps/miscfiles/Manifest
new file mode 100644
index 000000000000..c26e4d5f9eff
--- /dev/null
+++ b/sys-apps/miscfiles/Manifest
@@ -0,0 +1,5 @@
+DIST UnicodeData-5.2.0.txt.bz2 159460 SHA256 0b4b03725d313f0cc1056b80a4ea6d30a3b0a959316228c60b7a05e958d90486 SHA512 65573a2ad50d6964d593928d34e4315b2dbf7a7b49a480e5bc8a10025975280bb097ea670fb979d6c1da7d8911049313220712dc9ac5d5aa34e85c9193411fdc WHIRLPOOL 72b613fe5a578069b5e2933bb7155ded918602af4fe0063dd86e355c430840844f36feb6960fbc07863ec706cc57801e6e28dfd04ba1a0d872d17c46695c5b58
+DIST UnicodeData-6.0.0.txt.xz 126812 SHA256 5ddb4746fe92abbeeae7ff3fc1401383797cdfaa252b63045053520140a93855 SHA512 4923c2a21ae7d430f77fc3b8b78f84eec80370595e6ae57b3cf5bad4ac71a16b3b540e83939be7d3dffdfc3d774744ef161dc87d4a7258eca13b1a2f2e7db0a4 WHIRLPOOL 50d4f1e6cb59a2d4e691f26282336254b446a812221f4fdee6cfcad2d932462573d46b96bcf7fd0fd07a41a6d1b591a56d8f8cd56a1a18ab3876bc79e28994f7
+DIST UnicodeData-6.1.0.txt.xz 129972 SHA256 044c7f014c601ec4602d8e19c1541a952e2c7e30930c623acc65b1f45acb170a SHA512 9ada361d915f3883e673c6e55f351c7411dc970e180e7e0b05fef498c2f80a5a29bfd6c22513ff4b6b6c4c9fba5c77f0aca2dd54c7a76d3fa9b78623b1fdd93f WHIRLPOOL b052639f5ffe6acab1b875ee55aa917ed6f526deffce1f12f15530f1dd44d3cbb259516c40c725f7a35838d7ecb68f5452e099aef904d0763720cde87cebebf1
+DIST miscfiles-1.4.2.tar.gz 1524786 SHA256 b699ca60d61475578f1f9adb28e6d6e6b649fcf1bdd25aaec7d96b358c0701e6 SHA512 e5cfdb82d9f8901016daff874efce0616bfaaae12cc3587b6bf950df2bd19fa80f2286f69e10ddbb413d5bc632bf91e4165b0187f8cfb5a0d98882ac9b2cccc2 WHIRLPOOL 2867bbfdde83a50cf8666f34c72f8364955eb21df86b891b3f740489c87fe72cf0d3b50c63c938b836889a26080f856531a6ceda6dd4691788c4c9a2ad240c77
+DIST miscfiles-1.5.tar.gz 1585293 SHA256 6aaaa8898b0f6dac18bcaa5492874a6cd1243ffbe7a6dd347ca8f3ec3642a500 SHA512 d7ab23a709539278cce59e0c32bfcb3a0f11dc52ef537e3823e72382962af7f4fedb8b957f39ff1da51a93a00e3c4f6ec29f7332d7879c77fd7f4ec0ee4f82aa WHIRLPOOL 3d134944fcf75231f682d05320ad9b198b99f9eb4c27a949b67e724cb3b16181afedd61e83bcdb672fb7df516d8cdc43310209a07108b35fdb40ea9025be297a
diff --git a/sys-apps/miscfiles/files/miscfiles-1.3-Makefile.diff b/sys-apps/miscfiles/files/miscfiles-1.3-Makefile.diff
new file mode 100644
index 000000000000..011d1731acd1
--- /dev/null
+++ b/sys-apps/miscfiles/files/miscfiles-1.3-Makefile.diff
@@ -0,0 +1,18 @@
+--- Makefile.in.orig 2003-03-08 17:26:28.000000000 +0200
++++ Makefile.in 2003-03-08 17:28:59.000000000 +0200
+@@ -60,6 +60,7 @@
+ $(INSTALL_DATA) $(srcdir)/dict-README $(datadir)/dict/README
+ rm -f $(datadir)/dict/words
+ ln $(datadir)/dict/web2 $(datadir)/dict/words
++ ln $(datadir)/dict/web2a $(datadir)/dict/extra.words
+ for i in $(miscfiles); do \
+ $(INSTALL_DATA) $(srcdir)/$$i $(datadir)/misc/$$i ; \
+ done
+@@ -80,6 +81,7 @@
+ rm -f $(datadir)/dict/$$i ; \
+ done
+ rm -f $(datadir)/dict/README $(datadir)/dict/words
++ rm -f $(datadir)/dict/extra.words
+ for i in $(miscfiles); do \
+ rm -f $(datadir)/misc/$$i ; \
+ done
diff --git a/sys-apps/miscfiles/metadata.xml b/sys-apps/miscfiles/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/miscfiles/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-apps/miscfiles/miscfiles-1.4.2-r1.ebuild b/sys-apps/miscfiles/miscfiles-1.4.2-r1.ebuild
new file mode 100644
index 000000000000..4527f23f7e3b
--- /dev/null
+++ b/sys-apps/miscfiles/miscfiles-1.4.2-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils
+
+UNI_PV=5.2.0
+DESCRIPTION="Miscellaneous files"
+HOMEPAGE="http://savannah.gnu.org/projects/miscfiles/"
+# updated unicode data file from:
+# http://www.unicode.org/Public/${UNI_PV}/ucd/UnicodeData.txt
+SRC_URI="mirror://gnu/miscfiles/${P}.tar.gz
+ mirror://gentoo/UnicodeData-${UNI_PV}.txt.bz2"
+
+LICENSE="GPL-2 unicode"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="minimal"
+# Collides with older versions/revisions
+RDEPEND="!<sys-freebsd/freebsd-share-7.2-r1"
+
+src_prepare() {
+ mv "${WORKDIR}"/UnicodeData-${UNI_PV}.txt unicode || die
+ epatch "${FILESDIR}"/miscfiles-1.3-Makefile.diff
+}
+
+src_install() {
+ emake install prefix="${ED}/usr" || die
+ dodoc NEWS ORIGIN README dict-README
+ rm -f "${ED}"/usr/share/dict/README
+
+ if use minimal ; then
+ cd "${ED}"/usr/share/dict
+ rm -f words extra.words
+ gzip -9 *
+ ln -s web2.gz words
+ ln -s web2a.gz extra.words
+ ln -s connectives{.gz,}
+ ln -s propernames{.gz,}
+ cd ..
+ rm -r misc rfc
+ fi
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == "/" ]] && type -P create-cracklib-dict >/dev/null ; then
+ ebegin "Regenerating cracklib dictionary"
+ create-cracklib-dict "${EPREFIX}"/usr/share/dict/* > /dev/null
+ eend $?
+ fi
+}
diff --git a/sys-apps/miscfiles/miscfiles-1.5-r1.ebuild b/sys-apps/miscfiles/miscfiles-1.5-r1.ebuild
new file mode 100644
index 000000000000..022064cfd346
--- /dev/null
+++ b/sys-apps/miscfiles/miscfiles-1.5-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+UNI_PV=6.1.0
+DESCRIPTION="Miscellaneous files"
+HOMEPAGE="http://savannah.gnu.org/projects/miscfiles/"
+# http://www.unicode.org/Public/${UNI_PV}/ucd/UnicodeData.txt
+SRC_URI="mirror://gnu/miscfiles/${P}.tar.gz
+ mirror://gentoo/UnicodeData-${UNI_PV}.txt.xz"
+
+LICENSE="GPL-2 unicode"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="minimal"
+
+# Collides with older versions/revisions
+RDEPEND="!<sys-freebsd/freebsd-share-7.2-r1"
+DEPEND="app-arch/xz-utils"
+
+src_prepare() {
+ mv "${WORKDIR}"/UnicodeData-${UNI_PV}.txt unicode || die
+}
+
+src_configure() {
+ econf --datadir="${EPREFIX}"/usr/share/misc
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc NEWS ORIGIN README dict-README
+
+ # not sure if this is still needed ...
+ dodir /usr/share/dict
+ cd "${ED}"/usr/share/misc
+ mv $(awk '$1=="dictfiles"{$1="";$2="";print}' "${S}"/Makefile) ../dict/ || die
+ cd ../dict
+ ln -s web2 words || die
+ ln -s web2a extra.words || die
+
+ if use minimal ; then
+ cd "${ED}"/usr/share/dict
+ rm -f words extra.words
+ gzip -9 *
+ ln -s web2.gz words
+ ln -s web2a.gz extra.words
+ ln -s connectives{.gz,}
+ ln -s propernames{.gz,}
+ cd ..
+ rm -r misc rfc
+ fi
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == "/" ]] && type -P create-cracklib-dict >/dev/null ; then
+ ebegin "Regenerating cracklib dictionary"
+ create-cracklib-dict "${EPREFIX}"/usr/share/dict/* > /dev/null
+ eend $?
+ fi
+}
diff --git a/sys-apps/miscfiles/miscfiles-1.5.ebuild b/sys-apps/miscfiles/miscfiles-1.5.ebuild
new file mode 100644
index 000000000000..ce519b167a14
--- /dev/null
+++ b/sys-apps/miscfiles/miscfiles-1.5.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+UNI_PV=6.0.0
+DESCRIPTION="Miscellaneous files"
+HOMEPAGE="http://savannah.gnu.org/projects/miscfiles/"
+# http://www.unicode.org/Public/${UNI_PV}/ucd/UnicodeData.txt
+SRC_URI="mirror://gnu/miscfiles/${P}.tar.gz
+ mirror://gentoo/UnicodeData-${UNI_PV}.txt.xz"
+
+LICENSE="GPL-2 unicode"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x86-solaris"
+IUSE="minimal"
+
+# Collides with older versions/revisions
+RDEPEND="!<sys-freebsd/freebsd-share-7.2-r1"
+DEPEND="app-arch/xz-utils"
+
+src_prepare() {
+ mv "${WORKDIR}"/UnicodeData-${UNI_PV}.txt unicode || die
+}
+
+src_configure() {
+ econf --datadir="${EPREFIX}"/usr/share/misc || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc NEWS ORIGIN README dict-README
+
+ # not sure if this is still needed ...
+ dodir /usr/share/dict
+ cd "${ED}"/usr/share/misc
+ mv $(awk '$1=="dictfiles"{$1="";$2="";print}' "${S}"/Makefile) ../dict/ || die
+ cd ../dict
+ ln -s web2 words || die
+ ln -s web2a extra.words || die
+
+ if use minimal ; then
+ cd "${ED}"/usr/share/dict
+ rm -f words extra.words
+ gzip -9 *
+ ln -s web2.gz words
+ ln -s web2a.gz extra.words
+ ln -s connectives{.gz,}
+ ln -s propernames{.gz,}
+ cd ..
+ rm -r misc rfc
+ fi
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == "/" ]] && type -P create-cracklib-dict >/dev/null ; then
+ ebegin "Regenerating cracklib dictionary"
+ create-cracklib-dict "${EPREFIX}"/usr/share/dict/* > /dev/null
+ eend $?
+ fi
+}
diff --git a/sys-apps/mlocate/Manifest b/sys-apps/mlocate/Manifest
new file mode 100644
index 000000000000..9fc2073ef19b
--- /dev/null
+++ b/sys-apps/mlocate/Manifest
@@ -0,0 +1 @@
+DIST mlocate-0.26.tar.xz 359204 SHA256 3063df79fe198fb9618e180c54baf3105b33d88fe602ff2d8570aaf944f1263e SHA512 b1207047e30a551cba39e70812439b554def567ebe9b8b81fed6f26435bb575beafe4875a21cd72876eadd85da4e7bfc942eb28b17c430b537c351690364837f WHIRLPOOL 7f0a2df135ce2ec74f2a113e7f88b29f3964aa53fff1c47eb9aa44df4447d7b41b59615571a7626a3b7395208df75641d407b7a9456e590338962cde85093129
diff --git a/sys-apps/mlocate/files/mlocate-cron.conf b/sys-apps/mlocate/files/mlocate-cron.conf
new file mode 100644
index 000000000000..f207344a9e6c
--- /dev/null
+++ b/sys-apps/mlocate/files/mlocate-cron.conf
@@ -0,0 +1,9 @@
+# nice value to run at: see -n in nice(1)
+NICE="19"
+
+# ionice class to run at: see -c in ionice(1)
+# you have to install sys-apps/util-linux manually
+IONICE_CLASS="2"
+
+# ionice priority to run at: see -n in ionice(1)
+IONICE_PRIORITY="7"
diff --git a/sys-apps/mlocate/files/mlocate.cron-r2 b/sys-apps/mlocate/files/mlocate.cron-r2
new file mode 100644
index 000000000000..51cb504977e2
--- /dev/null
+++ b/sys-apps/mlocate/files/mlocate.cron-r2
@@ -0,0 +1,48 @@
+#! /bin/sh
+set -e
+
+# check if we run on battery and if so then don't run
+if which on_ac_power >/dev/null 2>&1; then
+ ON_BATTERY=0
+ on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
+ if [ "${ON_BATTERY}" -eq 1 ]; then
+ exit 0
+ fi
+fi
+
+# check if we are already running (lockfile)
+LOCKFILE="/var/lock/mlocate.daily.lock"
+if [ -e "${LOCKFILE}" ]; then
+ echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb."
+ exit 1
+fi
+touch "${LOCKFILE}"
+# trap the lockfile only if we really run the updatedb
+trap "rm -f ${LOCKFILE}" EXIT
+
+# source the user specified variables
+if [ -f /etc/mlocate-cron.conf ]; then
+ . /etc/mlocate-cron.conf
+fi
+
+# check the config file
+NODEVS=""
+if [ ! -f /etc/updatedb.conf ]; then
+ NODEVS=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "rootfs" { print $2 }')
+fi
+
+# alter the priority of the updatedb process
+if [ -x /usr/bin/renice ]; then
+ /usr/bin/renice +${NICE:-19} -p $$ > /dev/null 2>&1
+fi
+if [ -x /usr/bin/ionice ] && /usr/bin/ionice -c3 true 2>/dev/null; then
+ /usr/bin/ionice -c${IONICE_CLASS:-2} -n${IONICE_PRIORITY:-7} -p $$ > /dev/null 2>&1
+fi
+
+# run the updatedb if possible
+if [ -x /usr/bin/updatedb ]; then
+ /usr/bin/updatedb -f "${NODEVS}"
+else
+ echo >&2 "Warning: \"/usr/bin/updatedb\" is not executable, unable to run updatedb."
+ exit 0
+fi
diff --git a/sys-apps/mlocate/files/updatedb.conf b/sys-apps/mlocate/files/updatedb.conf
new file mode 100644
index 000000000000..3501ee30163d
--- /dev/null
+++ b/sys-apps/mlocate/files/updatedb.conf
@@ -0,0 +1,17 @@
+# /etc/updatedb.conf: config file for slocate
+# $Id$
+
+# This file sets variables that are used by updatedb.
+# For more info, see the updatedb.conf(5) manpage.
+
+# Filesystems that are pruned from updatedb database
+PRUNEFS="afs anon_inodefs auto autofs bdev binfmt binfmt_misc cgroup cifs coda configfs cramfs cpuset debugfs devfs devpts devtmpfs ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs"
+
+# Paths which are pruned from updatedb database
+PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool"
+
+# Folder names that are pruned from updatedb database
+PRUNENAMES=".git .hg .svn CVS"
+
+# Skip bind mounts.
+PRUNE_BIND_MOUNTS="yes"
diff --git a/sys-apps/mlocate/metadata.xml b/sys-apps/mlocate/metadata.xml
new file mode 100644
index 000000000000..67bbc5a3f787
--- /dev/null
+++ b/sys-apps/mlocate/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>fauli@gentoo.org</email>
+ <name>Christian Faulhammer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/mlocate/mlocate-0.26-r1.ebuild b/sys-apps/mlocate/mlocate-0.26-r1.ebuild
new file mode 100644
index 000000000000..41bf8dfcceb1
--- /dev/null
+++ b/sys-apps/mlocate/mlocate-0.26-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils user toolchain-funcs
+
+DESCRIPTION="Merging locate is an utility to index and quickly search for files"
+HOMEPAGE="https://fedorahosted.org/mlocate/"
+SRC_URI="https://fedorahosted.org/releases/m/l/mlocate/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls selinux"
+
+RDEPEND="!sys-apps/slocate
+ !sys-apps/rlocate
+ selinux? ( sec-policy/selinux-slocate )"
+DEPEND="app-arch/xz-utils
+ nls? ( sys-devel/gettext )
+"
+
+pkg_setup() {
+ enewgroup locate
+}
+
+src_configure() {
+ econf $(use_enable nls)
+}
+
+src_compile() {
+ emake groupname=locate AR="$(tc-getAR)"
+}
+
+src_install() {
+ emake groupname=locate DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog README NEWS
+
+ insinto /etc
+ doins "${FILESDIR}"/updatedb.conf
+ doins "${FILESDIR}"/mlocate-cron.conf
+ fperms 0644 /etc/{updatedb,mlocate-cron}.conf
+
+ insinto /etc/cron.daily
+ newins "${FILESDIR}"/mlocate.cron-r2 mlocate
+ fperms 0755 /etc/cron.daily/mlocate
+
+ fowners 0:locate /usr/bin/locate
+ fperms go-r,g+s /usr/bin/locate
+
+ keepdir /var/lib/mlocate
+ chown -R 0:locate "${ED}"/var/lib/mlocate
+ fperms 0750 /var/lib/mlocate
+}
+
+pkg_postinst() {
+ elog "The database for the locate command is generated daily by a cron job,"
+ elog "if you install for the first time you can run the updatedb command manually now."
+ elog
+ elog "Note that the /etc/updatedb.conf file is generic,"
+ elog "please customize it to your system requirements."
+}
diff --git a/sys-apps/modutils/Manifest b/sys-apps/modutils/Manifest
new file mode 100644
index 000000000000..bc4977da1dd3
--- /dev/null
+++ b/sys-apps/modutils/Manifest
@@ -0,0 +1 @@
+DIST modutils-2.4.27.tar.bz2 234963 RMD160 3179d364106859cf6dbd1fad82d8356337634735 SHA1 fa268b48d98e0efab349d45fa7fb2372d58320c1 SHA256 ab4c9191645f9ffb455ae7c014d8c45339c13a1d0f6914817cfbf30a0bc56bf0
diff --git a/sys-apps/modutils/files/modutils-2.4.27-alias.patch b/sys-apps/modutils/files/modutils-2.4.27-alias.patch
new file mode 100644
index 000000000000..1fefffb62f85
--- /dev/null
+++ b/sys-apps/modutils/files/modutils-2.4.27-alias.patch
@@ -0,0 +1,86 @@
+Taken from Debian.
+
+Update misc alias cruft.
+
+--- util/alias.h
++++ util/alias.h
+@@ -52,7 +52,11 @@
+ "binfmt--310 binfmt_java",
+
+ "block-major-1 rd",
++#if defined(__s390__) || defined(__s390x__) || defined(__ia64__) || defined(__powerpc__)
++ "block-major-2 off",
++#else
+ "block-major-2 floppy",
++#endif
+ "block-major-3 ide-probe-mod",
+ "block-major-7 loop",
+ "block-major-8 sd_mod",
+@@ -107,6 +111,7 @@
+ /* /dev/sunmouse Sun mouse */
+ /* /dev/beep Fancy beep device */
+ /* /dev/modreq Kernel module load request */
++ "char-major-10-116 snd",
+ "char-major-10-130 wdt", /* /dev/watchdog Watchdog timer port */
+ "char-major-10-131 wdt", /* /dev/temperature Machine internal temperature */
+ /* /dev/hwtrap Hardware fault trap */
+@@ -116,7 +121,11 @@
+ "char-major-10-144 nvram", /* from Tigran Aivazian <tigran@sco.COM> */
+ "char-major-10-157 applicom", /* from David Woodhouse <dwmw2@infradead.org> */
+ "char-major-10-175 agpgart", /* /dev/agpgart GART AGP mapping access */
++ "char-major-10-181 toshiba",
++ "char-major-10-183 hw_random",
+ "char-major-10-184 microcode", /* Tigran Aivazian <tigran@veritas.com> */
++ "char-major-10-187 irnet",
++ "char-major-10-189 ussp",
+ "char-major-10-200 tun", /* Universal TUN/TAP device driver */
+ "char-major-10-250 hci_vhci",
+
+@@ -179,6 +203,11 @@
+ /* next two from <dairiki@matthews.dairiki.org> Thanks! */
+ "net-pf-17 af_packet",
+ "net-pf-19 off", /* acorn econet */
++ "net-pf-20 atm",
++ "net-pf-23 irda",
++ "net-pf-24 pppoe",
++ "net-pf-25 wanrouter",
++ "net-pf-26 llc",
+
+ "net-pf-31 bluez",
+
+@@ -199,6 +228,10 @@
+ "bt-proto-2 sco",
+ "bt-proto-3 rfcomm",
+ "bt-proto-4 bnep",
++ "bt-proto-5 cmtp",
++ "bt-proto-6 hidp",
++ "bt-proto-7 avdtp",
++
+
+ "plip0 plip",
+ "plip1 plip",
+@@ -228,6 +261,7 @@
+ "ppp-compress-21 bsd_comp",
+ "ppp-compress-24 ppp_deflate",
+ "ppp-compress-26 ppp_deflate",
++ "ppp ppp_async", /* for 2.4 */
+
+ #ifndef __sparc__
+ "parport_lowlevel parport_pc",
+@@ -271,9 +305,6 @@
+ */
+ char *above[] =
+ {
+- "hid keybdev mousedev",
+- "usbmouse hid",
+- "wacom evdev",
+ NULL /* marks the end of the list! */
+ };
+
+@@ -284,7 +315,6 @@
+ */
+ char *below[] =
+ {
+- "ov518_decomp ov511",
+ NULL /* marks the end of the list! */
+ };
diff --git a/sys-apps/modutils/files/modutils-2.4.27-flex.patch b/sys-apps/modutils/files/modutils-2.4.27-flex.patch
new file mode 100644
index 000000000000..c07e929b8b42
--- /dev/null
+++ b/sys-apps/modutils/files/modutils-2.4.27-flex.patch
@@ -0,0 +1,37 @@
+Taken from Debian.
+
+Build with newer flex versions.
+
+--- modutils-2.4.27.0.orig/genksyms/lex.l
++++ modutils-2.4.27.0/genksyms/lex.l
+@@ -130,6 +130,7 @@
+
+ static int suppress_type_lookup, dont_want_brace_phrase;
+ static struct string_list *next_node;
++ static int next_token = 0;
+
+ int token, count = 0;
+ struct string_list *cur_node;
+@@ -144,7 +145,12 @@
+ }
+
+ repeat:
+- token = yylex1();
++ if (next_token != 0) {
++ token = next_token;
++ next_token = 0;
++ }
++ else
++ token = yylex1();
+
+ if (token == 0)
+ return 0;
+@@ -425,7 +431,7 @@
+ {
+ /* Put back the token we just read so's we can find it again
+ after registering the expression. */
+- unput(token);
++ next_token = token;
+
+ lexstate = ST_NORMAL;
+ token = EXPRESSION_PHRASE;
diff --git a/sys-apps/modutils/files/modutils-2.4.27-gcc.patch b/sys-apps/modutils/files/modutils-2.4.27-gcc.patch
new file mode 100644
index 000000000000..3f90a9b2b2de
--- /dev/null
+++ b/sys-apps/modutils/files/modutils-2.4.27-gcc.patch
@@ -0,0 +1,280 @@
+Fix building with newer gcc versions.
+
+Most changes taken from Debian.
+
+--- obj/obj_ia64.c
++++ obj/obj_ia64.c
+@@ -127,6 +127,7 @@
+ return (*(bundle + 1) >> 23) & 0x1ffffffffff;
+
+ default:
++ ;
+ }
+ return (-1);
+ }
+--- depmod/depmod.c
++++ depmod/depmod.c
+@@ -1133,7 +1133,7 @@
+
+ for (ksym = ksyms; so_far < nksyms; ++so_far, ksym++) {
+ if (strncmp((char *)ksym->name, "GPLONLY_", 8) == 0)
+- ((char *)ksym->name) += 8;
++ ksym->name = ((char *)ksym->name) + 8;
+ assert(n_syms < MAX_MAP_SYM);
+ symtab[n_syms++] = addsym((char *)ksym->name, mod, SYM_DEFINED, 0);
+ }
+@@ -1265,7 +1265,7 @@
+ * error. Use the error() routine but do not count
+ * any errors. Remove in 2.5.
+ */
+- int save_errors = errors;
++ int save_errors = error_count;
+ if (!quiet && nberr == 0)
+ error("*** Unresolved symbols in %s",
+ ptmod->name);
+@@ -1274,7 +1274,7 @@
+ nberr++;
+ if (flag_unresolved_error)
+ ret = 1;
+- errors = save_errors;
++ error_count = save_errors;
+ }
+ }
+ verbose("%s\n", ptmod->name + skipchars);
+@@ -1675,6 +1675,6 @@
+ #else
+ int main(int argc, char **argv)
+ {
+- return depmod_main(argc, argv) || errors;
++ return depmod_main(argc, argv) || error_count;
+ }
+ #endif /* defined(COMMON_3264) && defined(ONLY_32) */
+--- genksyms/genksyms.c
++++ genksyms/genksyms.c
+@@ -45,7 +45,7 @@
+ int flag_debug, flag_dump_defs, flag_warnings;
+ int checksum_version = 1, kernel_version = version(2,0,0);
+
+-static int errors;
++static int num_errors;
+ static int nsyms;
+
+ static struct symbol *expansion_trail;
+@@ -458,7 +458,7 @@
+ va_end(args);
+ putc('\n', stderr);
+
+- errors++;
++ num_errors++;
+ }
+ }
+
+@@ -476,7 +476,7 @@
+ va_end(args);
+ putc('\n', stderr);
+
+- errors++;
++ num_errors++;
+ }
+ }
+
+@@ -597,5 +597,5 @@
+ nsyms, HASH_BUCKETS, (double)nsyms / (double)HASH_BUCKETS);
+ }
+
+- return errors != 0;
++ return num_errors != 0;
+ }
+--- include/util.h
++++ include/util.h
+@@ -39,8 +39,8 @@
+ extern int xftw(const char *directory, xftw_func_t);
+
+ /* Error logging */
+-extern int log;
+-extern int errors;
++extern int logging;
++extern int error_count;
+ extern const char *error_file;
+
+ extern int flag_verbose;
+--- insmod/insmod.c
++++ insmod/insmod.c
+@@ -275,7 +275,7 @@
+ if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) {
+ gplonly_seen = 1;
+ if (gpl)
+- ((char *)s->name) += 8;
++ s->name = ((char *)s->name) + 8;
+ else
+ continue;
+ }
+@@ -1679,7 +1679,7 @@
+ error_file = "insmod";
+
+ /* To handle repeated calls from combined modprobe */
+- errors = optind = 0;
++ error_count = optind = 0;
+
+ /* Process the command line. */
+ while ((o = getopt_long(argc, argv, "fhkLmnpqrsSvVxXyYNe:o:O:P:R:",
+@@ -2064,7 +2064,7 @@
+ goto out;
+ /**** No symbols or sections to be changed after kallsyms above ***/
+
+- if (errors)
++ if (error_count)
+ goto out;
+
+ /* If we were just checking, we made it. */
+@@ -2123,10 +2123,10 @@
+ test_read.m.read_start = m_addr + sizeof(struct module);
+ test_read.m.read_end = test_read.m.read_start + sizeof(test_read.data);
+ if (sys_init_module(m_name, (struct module *) &test_read)) {
+- int old_errors = errors;
++ int old_errors = error_count;
+ error("has persistent data but the kernel is too old to support it."
+ " Expect errors during rmmod as well");
+- errors = old_errors;
++ error_count = old_errors;
+ }
+ }
+
+@@ -2152,7 +2152,7 @@
+ #else
+ init_module(m_name, f, m_size, blob_name, noload, flag_load_map);
+ #endif
+- if (errors) {
++ if (error_count) {
+ if (!noload)
+ delete_module(m_name);
+ goto out;
+--- insmod/kallsyms.c
++++ insmod/kallsyms.c
+@@ -80,7 +80,7 @@
+ error_file = "kallsyms";
+
+ /* To handle repeated calls from combined modprobe */
+- errors = optind = 0;
++ error_count = optind = 0;
+
+ /* Process the command line. */
+ while ((c = getopt_long(argc, argv, "Vh",
+--- insmod/modprobe.c
++++ insmod/modprobe.c
+@@ -1023,7 +1023,7 @@
+ if (quiet)
+ my_argv[my_argc++] = "-q";
+
+- if (log)
++ if (logging)
+ my_argv[my_argc++] = "-s";
+
+ if (insmod_opt) {
+--- insmod/rmmod.c
++++ insmod/rmmod.c
+@@ -261,9 +261,9 @@
+ read_parm.m.read_start = mp->sym->value;
+ read_parm.m.read_end = read_parm.m.read_start + datasize;
+ if (sys_init_module(module, (struct module *) &read_parm)) {
+- int old_errors = errors;
++ int old_errors = error_count;
+ error("has persistent data but the kernel is too old to support it.");
+- errors = old_errors;
++ error_count = old_errors;
+ return(0);
+ }
+
+--- util/logger.c
++++ util/logger.c
+@@ -31,10 +31,10 @@
+
+ /*======================================================================*/
+
+-int log;
++int logging;
+ static int silent;
+
+-int errors;
++int error_count;
+ const char *error_file;
+ const char *program_name;
+
+@@ -75,7 +75,7 @@
+
+ if (silent)
+ ;
+- else if (log) {
++ else if (logging) {
+ char buf[2*PATH_MAX];
+ int n;
+
+@@ -100,7 +100,7 @@
+ putc('\n', stderr);
+ }
+
+- errors++;
++ error_count++;
+ }
+
+ void lprintf(const char *fmt,...)
+@@ -108,7 +108,7 @@
+ va_list args;
+
+ if (silent);
+- else if (log) {
++ else if (logging) {
+ char buf[2*PATH_MAX];
+ va_start(args, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, args);
+@@ -132,5 +132,5 @@
+ #ifdef STOREMSG
+ atexit(dumpmsg);
+ #endif
+- log = 1;
++ logging = 1;
+ }
+--- obj/obj_kallsyms.c
++++ obj/obj_kallsyms.c
+@@ -200,8 +200,8 @@
+
+ /* Initial contents, header + one entry per input section. No strings. */
+ osec->header.sh_size = sizeof(*a_hdr) + loaded*sizeof(*a_sec);
+- a_hdr = (struct kallsyms_header *) osec->contents =
+- xmalloc(osec->header.sh_size);
++ osec->contents = xmalloc(osec->header.sh_size);
++ a_hdr = (struct kallsyms_header *) osec->contents;
+ memset(osec->contents, 0, osec->header.sh_size);
+ a_hdr->size = sizeof(*a_hdr);
+ a_hdr->sections = loaded;
+@@ -275,8 +275,8 @@
+ a_hdr->symbol_off +
+ a_hdr->symbols*a_hdr->symbol_size +
+ strings_size - strings_left;
+- a_hdr = (struct kallsyms_header *) osec->contents =
+- xrealloc(a_hdr, a_hdr->total_size);
++ osec->contents = xrealloc(a_hdr, a_hdr->total_size);
++ a_hdr = (struct kallsyms_header *) osec->contents;
+ p = (char *)a_hdr + a_hdr->symbol_off;
+ memcpy(p, symbols, a_hdr->symbols*a_hdr->symbol_size);
+ free(symbols);
+--- obj/obj_ppc.c
++++ obj/obj_ppc.c
+@@ -25,6 +25,7 @@
+ #include <obj.h>
+ #include <util.h>
+ #include <assert.h>
++#include <stdlib.h>
+
+
+ /*======================================================================*/
+@@ -255,7 +256,8 @@
+ archdata_sec->header.sh_size = 0;
+ sec = obj_find_section(f, "__ftr_fixup");
+ if (sec) {
+- ad = (struct archdata *) (archdata_sec->contents) = xmalloc(sizeof(*ad));
++ archdata_sec->contents = xmalloc(sizeof(*ad));
++ ad = (struct archdata *) (archdata_sec->contents);
+ memset(ad, 0, sizeof(*ad));
+ archdata_sec->header.sh_size = sizeof(*ad);
+ ad->__start___ftr_fixup = sec->header.sh_addr;
diff --git a/sys-apps/modutils/files/modutils-2.4.27-no-nested-function.patch b/sys-apps/modutils/files/modutils-2.4.27-no-nested-function.patch
new file mode 100644
index 000000000000..7af4599c7154
--- /dev/null
+++ b/sys-apps/modutils/files/modutils-2.4.27-no-nested-function.patch
@@ -0,0 +1,43 @@
+Patch by the PaX team to get rid of executable stacks.
+
+--- modutils/insmod/insmod.c
++++ modutils/insmod/insmod.c
+@@ -366,18 +366,21 @@ static void hide_special_symbols(struct
+ sym->info = ELFW(ST_INFO) (STB_LOCAL, ELFW(ST_TYPE) (sym->info));
+ }
+
++static struct obj_file *load_map_file;
++
++static int load_map_cmp(const void *a, const void *b) {
++ struct obj_symbol **as = (struct obj_symbol **) a;
++ struct obj_symbol **bs = (struct obj_symbol **) b;
++ unsigned long aa = obj_symbol_final_value(load_map_file, *as);
++ unsigned long ba = obj_symbol_final_value(load_map_file, *bs);
++ return aa < ba ? -1 : aa > ba ? 1 : 0;
++}
++
+ static void print_load_map(struct obj_file *f)
+ {
+ struct obj_symbol *sym;
+ struct obj_symbol **all, **p;
+ struct obj_section *sec;
+- int load_map_cmp(const void *a, const void *b) {
+- struct obj_symbol **as = (struct obj_symbol **) a;
+- struct obj_symbol **bs = (struct obj_symbol **) b;
+- unsigned long aa = obj_symbol_final_value(f, *as);
+- unsigned long ba = obj_symbol_final_value(f, *bs);
+- return aa < ba ? -1 : aa > ba ? 1 : 0;
+- }
+ int i, nsyms, *loaded;
+
+ /* Report on the section layout. */
+@@ -425,7 +428,9 @@ static void print_load_map(struct obj_fi
+ *p++ = sym;
+
+ /* Sort them by final value. */
++ load_map_file = f;
+ qsort(all, nsyms, sizeof(struct obj_file *), load_map_cmp);
++ load_map_file = NULL;
+
+ /* And list them. */
+ lprintf("\nSymbols:");
diff --git a/sys-apps/modutils/metadata.xml b/sys-apps/modutils/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/modutils/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-apps/modutils/modutils-2.4.27-r1.ebuild b/sys-apps/modutils/modutils-2.4.27-r1.ebuild
new file mode 100644
index 000000000000..e878f2845150
--- /dev/null
+++ b/sys-apps/modutils/modutils-2.4.27-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Standard kernel module utilities for linux-2.4 and older"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/modutils/"
+SRC_URI="mirror://kernel/linux/utils/kernel/${PN}/v2.4/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+RDEPEND="!sys-apps/module-init-tools
+ !sys-apps/kmod"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-alias.patch
+ epatch "${FILESDIR}"/${P}-gcc.patch
+ epatch "${FILESDIR}"/${P}-flex.patch
+ epatch "${FILESDIR}"/${P}-no-nested-function.patch
+}
+
+src_configure() {
+ econf \
+ --prefix=/ \
+ --disable-strip \
+ --enable-insmod-static \
+ --disable-zlib
+}
+
+src_install() {
+ einstall prefix="${D}"
+ rm -r "${ED}"/usr/share/man/man2 || die
+ dodoc CREDITS ChangeLog NEWS README TODO
+}
diff --git a/sys-apps/more/Manifest b/sys-apps/more/Manifest
new file mode 100644
index 000000000000..569b7a1eb5bb
--- /dev/null
+++ b/sys-apps/more/Manifest
@@ -0,0 +1 @@
+DIST util-linux-2.12r.tar.bz2 1370907 SHA256 b8e499b338ce9fbd1fb315194b26540ec823c0afc46c9e145ac7a3e38ad57e6b
diff --git a/sys-apps/more/files/more-2.12r-freebsd.patch b/sys-apps/more/files/more-2.12r-freebsd.patch
new file mode 100644
index 000000000000..09a1ac60f717
--- /dev/null
+++ b/sys-apps/more/files/more-2.12r-freebsd.patch
@@ -0,0 +1,65 @@
+diff -Nur util-linux-2.12r.orig/text-utils/Makefile util-linux-2.12r/text-utils/Makefile
+--- util-linux-2.12r.orig/text-utils/Makefile 2007-06-14 13:37:07 -0600
++++ util-linux-2.12r/text-utils/Makefile 2007-06-14 15:11:01 -0600
+@@ -30,13 +30,19 @@
+ CFLAGS:=$(CFLAGS) -DPGNOBELL
+ endif
+
++# On FreeBSD, we need to include libcompat (more uses re_comp & re_exec)
++OS=$(shell uname)
++ifeq "$(OS)" "FreeBSD"
++ LIBCOMPAT=-lcompat
++endif
++
+ all: $(BIN) $(USRBIN)
+
+ # more and pg and ul use curses - maybe we can't compile them
+ ifeq "$(HAVE_NCURSES)" "yes"
+ # Have ncurses - make more and pg and ul
+ more pg ul:
+- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBCURSES)
++ $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBCURSES) $(LIBCOMPAT)
+ more: more.o $(LIB)/xstrncpy.o
+ pg: pg.o
+ ul: ul.o
+diff -Nur util-linux-2.12r.orig/text-utils/more.c util-linux-2.12r/text-utils/more.c
+--- util-linux-2.12r.orig/text-utils/more.c 2007-06-14 13:37:07 -0600
++++ util-linux-2.12r/text-utils/more.c 2007-06-14 13:28:34 -0600
+@@ -63,6 +63,16 @@
+ #include <regex.h>
+ #undef _REGEX_RE_COMP
+
++/* Include limits.h on FreeBSD */
++#ifdef __FreeBSD__
++#include <limits.h>
++#endif
++
++/* Define CBAUD for FreeBSD */
++#ifndef CBAUD
++#define CBAUD 0010017
++#endif
++
+ #define VI "vi" /* found on the user's path */
+
+ #define Fopen(s,m) (Currline = 0,file_pos=0,fopen(s,m))
+@@ -1560,7 +1570,7 @@
+ }
+ if (feof (file)) {
+ if (!no_intty) {
+-#ifndef __linux__
++#if !defined(__linux__) && !defined(__FreeBSD__)
+ /* No longer in libc 4.5.8. . . */
+ file->_flags &= ~STDIO_S_EOF_SEEN; /* why doesn't fseek do this ??!!??! */
+ #endif
+@@ -1805,7 +1815,11 @@
+ tcgetattr(fileno(stderr), &otty);
+ savetty0 = otty;
+ slow_tty = (otty.c_cflag & CBAUD) < B1200;
++#ifdef __FreeBSD__
++ hardtabs = 1;
++#else
+ hardtabs = (otty.c_oflag & TABDLY) != XTABS;
++#endif
+ if (!no_tty) {
+ otty.c_lflag &= ~(ICANON|ECHO);
+ otty.c_cc[VMIN] = 1;
diff --git a/sys-apps/more/metadata.xml b/sys-apps/more/metadata.xml
new file mode 100644
index 000000000000..d9cd2cad66c2
--- /dev/null
+++ b/sys-apps/more/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>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/more/more-2.12r.ebuild b/sys-apps/more/more-2.12r.ebuild
new file mode 100644
index 000000000000..fb2699e53c73
--- /dev/null
+++ b/sys-apps/more/more-2.12r.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Primitive text file viewer"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+SRC_URI="mirror://kernel/linux/utils/util-linux/util-linux-${PV}.tar.bz2"
+S=${WORKDIR}/util-linux-${PV}
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64-fbsd ~x86-fbsd"
+IUSE="static nls selinux"
+
+RDEPEND="!static? ( >=sys-libs/ncurses-5.2-r2 )
+ selinux? ( sys-libs/libselinux )
+ !sys-apps/util-linux"
+DEPEND="${RDEPEND}
+ static? ( >=sys-libs/ncurses-5.2-r2[static-libs] )
+ nls? ( sys-devel/gettext )"
+
+yesno() { use $1 && echo yes || echo no; }
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-freebsd.patch
+
+ # Enable random features
+ local mconfigs="MCONFIG"
+ sed -i \
+ -e "/^HAVE_SELINUX=/s:no:$(yesno selinux):" \
+ -e "/^DISABLE_NLS=/s:no:$(yesno !nls):" \
+ -e "/^HAVE_KILL=/s:no:yes:" \
+ -e "/^HAVE_SLN=/s:no:yes:" \
+ -e "/^HAVE_TSORT/s:no:yes:" \
+ -e "s:-pipe -O2 \$(CPUOPT) -fomit-frame-pointer:${CFLAGS}:" \
+ -e "s:CPU=.*:CPU=${CHOST%%-*}:" \
+ -e "s:SUIDMODE=.*4755:SUIDMODE=4711:" \
+ ${mconfigs} || die "MCONFIG sed"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ export CC="$(tc-getCC)"
+
+ econf || die "configure failed"
+}
+
+src_compile() {
+ emake -C lib xstrncpy.o || die "emake xstrncpy.o failed"
+ emake -C text-utils more || die "emake more failed"
+}
+
+src_install() {
+ exeinto /bin
+ doexe text-utils/more || die
+ doman text-utils/more.1 || die
+ dodoc HISTORY MAINTAINER README VERSION
+}
diff --git a/sys-apps/moreutils/Manifest b/sys-apps/moreutils/Manifest
new file mode 100644
index 000000000000..f2988ac52299
--- /dev/null
+++ b/sys-apps/moreutils/Manifest
@@ -0,0 +1,7 @@
+DIST moreutils_0.50.tar.gz 46952 SHA256 4df833f17c2c6781c1d500ac51455af1929db5aeb96d06e45b00489393b37714 SHA512 d83a0552693cf32509b5ea2bf781e5f415d6a78470200234f1f18197d2d1f7ffefb0eed0a5cb09737211dc35009d175cf261651a7d9af99ead7df2b2161b9e54 WHIRLPOOL ac74c23824d76e97b410bde0e345f358fa8817e55e94380bdb5b1906d4d737853885238bd346397cfbc4baa29e9e6a756c4c6b8c1c2af1e7a070da2d0841ab5a
+DIST moreutils_0.51.tar.gz 47404 SHA256 579e1e61f874d105ec3b6cf898a3ce7e487a58773a44769ce34c2fc7315cb141 SHA512 d81e2a51d5a7740590bebef7db929a0296f73fe3d58a58e3524cbe8392b3ba8c77769136327784bda0c23558a2b4109ec84c263a48abfa3a1fbdaeef12e877aa WHIRLPOOL 7fbbae5937ca9e634ba888fa99090c534f7c43618ab227f06725d68f36294816ecbdb2e81bdb66db95d2486ca39135f7ea86220dd793e2bbd36f6a6d4e25e79e
+DIST moreutils_0.52.tar.gz 47511 SHA256 c4bcf2f5bac09312ed5aa48d2cecd77a1c9609017b7a2acb2ac9fdd197480ffb SHA512 a2d9380bcaa1cefc1c1c744e71bf551fadeee4a76d7fac67051d4ca746e8f8df2a1c0a8e5721b430223958208189931168885777a5a0cb1ca66dc74421ef5b1b WHIRLPOOL e78fc1d9299e1dd2c333e895323566dac25cbe513d5ecddbfeee6104d1d925a4e67d3bcf1195dd4faf44b025e7619d15a4c257fc37150bc77bff42bfe9cb8b5a
+DIST moreutils_0.53.tar.gz 47613 SHA256 4f1842467759b6747f28a624c317a315f0b54a44440d2c8e2eec4d10144696fc SHA512 ea4eec3f66b14d86898da178dc3b7900ea4b266a8118e6b2decb2dd01217ae5918d4b45b952366be12a27b8b83791ec877ec0749e3272e6adb4fb1f14b706bf1 WHIRLPOOL b9d7f14fd1b77bb7f2bbc6ccbfeb07a0af743509809ecb2f1b9a448ecaf0a5f517cca384e3792e149b95679054cc27d73ffb9c5dd71c9c735fd0a4921960980b
+DIST moreutils_0.54.orig.tar.gz 45575 SHA256 50281c4d6bbbc8ab08f881c44a01c367049a09c19b7375023dec2543493b529f SHA512 c398ed126e5735356688654ee361063cbe8dbd76ff28aa856feb87c0a1fe812d78c2cd1ee84b029180c45161720659669960362583744ad4c9e3105c2575a2a1 WHIRLPOOL 0911b70552bcd2d542503fd3b1f84362f62b5a4719fff8aa4452774e735a28ff86f674f85ce66285fdb14e8397a65f857cfc4b86a27d81b27df9eaf8f1a8dee8
+DIST moreutils_0.55.orig.tar.gz 46500 SHA256 da9d5cd145ceea967a65dd50031d168d66199c3eb41b9390b57f35d4a5808ab5 SHA512 9a64057015cb9d1f957c438a35efc57c09438a033d0e58aed5e7fc0cd3c125df91b075a2f14b78d75c7e89b3b41fdba573b4cf41aba08bef7230f5a8794ee1a3 WHIRLPOOL 595692ac0d3ef5eee5323d682bd2a9e722fae2f33ef63199539d5612cc9b9a6c9a8eb96561149e13f03a6df4587532a231f7b00ff45694e2752b0753bd17efee
+DIST moreutils_0.56.orig.tar.gz 46704 SHA256 ec4b7a1e1d1e1d6ec606d2877301ec06c6cf4091776687d9b76f4d019705e77f SHA512 1793619f791fa2da9d233e0ee90ba4d843ced638f059406bec84f476a1300df33288fc34452a2912de7006e1ba2a75492785024148fad6c8372987147fb8616f WHIRLPOOL 21eecda882856d0c4ee2fa744a9a10a8ac71333f64d592277fcb93cd6ed14bf59003dd16a2a8985f27556344e884d60e2c28556fd024638e3ce30f7397aa5bd1
diff --git a/sys-apps/moreutils/files/moreutils-0.47-dtd-path.patch b/sys-apps/moreutils/files/moreutils-0.47-dtd-path.patch
new file mode 100644
index 000000000000..fe3b290ca61f
--- /dev/null
+++ b/sys-apps/moreutils/files/moreutils-0.47-dtd-path.patch
@@ -0,0 +1,99 @@
+--- moreutils/errno.docbook
++++ moreutils/errno.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/ifdata.docbook
++++ moreutils/ifdata.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/ifne.docbook
++++ moreutils/ifne.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/isutf8.docbook
++++ moreutils/isutf8.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/lckdo.docbook
++++ moreutils/lckdo.docbook
+@@ -8,7 +8,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/mispipe.docbook
++++ moreutils/mispipe.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/parallel.docbook
++++ moreutils/parallel.docbook
+@@ -7,7 +7,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/pee.docbook
++++ moreutils/pee.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
+--- moreutils/sponge.docbook
++++ moreutils/sponge.docbook
+@@ -21,7 +21,7 @@
+ -->
+
+ <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+-"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
++"file://@GENTOO_PORTAGE_EPREFIX@/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd"
+ []>
+
+ <refentry>
diff --git a/sys-apps/moreutils/metadata.xml b/sys-apps/moreutils/metadata.xml
new file mode 100644
index 000000000000..c788db534783
--- /dev/null
+++ b/sys-apps/moreutils/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>gregkh@gentoo.org</email>
+ <name>Greg Kroah-Hartman</name>
+</maintainer>
+<maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+</maintainer>
+<use>
+ <flag name='perl'>Install scripts written in Perl</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/moreutils/moreutils-0.50.ebuild b/sys-apps/moreutils/moreutils-0.50.ebuild
new file mode 100644
index 000000000000..68f5ef3fae4f
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.50.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 toolchain-funcs prefix
+
+DESCRIPTION="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ~ppc ~ppc64 x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.47-dtd-path.patch
+ eprefixify *.docbook
+
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/moreutils/moreutils-0.51.ebuild b/sys-apps/moreutils/moreutils-0.51.ebuild
new file mode 100644
index 000000000000..70a13f71c110
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.51.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/moreutils/moreutils-0.52.ebuild b/sys-apps/moreutils/moreutils-0.52.ebuild
new file mode 100644
index 000000000000..70a13f71c110
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.52.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/moreutils/moreutils-0.53.ebuild b/sys-apps/moreutils/moreutils-0.53.ebuild
new file mode 100644
index 000000000000..70a13f71c110
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.53.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/moreutils/moreutils-0.54.ebuild b/sys-apps/moreutils/moreutils-0.54.ebuild
new file mode 100644
index 000000000000..eb319399b3b1
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.54.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="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+src_prepare() {
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/moreutils/moreutils-0.55.ebuild b/sys-apps/moreutils/moreutils-0.55.ebuild
new file mode 100644
index 000000000000..c0eafcc02891
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.55.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+src_prepare() {
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/moreutils/moreutils-0.56.ebuild b/sys-apps/moreutils/moreutils-0.56.ebuild
new file mode 100644
index 000000000000..c0eafcc02891
--- /dev/null
+++ b/sys-apps/moreutils/moreutils-0.56.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="a growing collection of the unix tools that nobody thought to write thirty years ago"
+HOMEPAGE="http://joeyh.name/code/moreutils/"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~x86 ~x86-linux"
+IUSE="+doc +perl"
+
+RDEPEND="
+ perl? (
+ dev-lang/perl
+ dev-perl/IPC-Run
+ dev-perl/Time-Duration
+ dev-perl/TimeDate
+ )"
+DEPEND="
+ doc? (
+ dev-lang/perl
+ >=app-text/docbook2X-0.8.8-r2
+ app-text/docbook-xml-dtd:4.4
+ )"
+
+src_prepare() {
+ # don't build manpages
+ if ! use doc ; then
+ sed -i -e '/^all:/s/$(MANS)//' -e '/man1/d' Makefile || die
+ fi
+
+ # don't install perl scripts
+ if ! use perl ; then
+ sed -i -e '/PERLSCRIPTS/d' Makefile || die
+ fi
+}
+
+src_compile() {
+ tc-export CC
+ emake CFLAGS="${CFLAGS}" DOCBOOK2XMAN=docbook2man.pl PREFIX="${EPREFIX}/usr"
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" INSTALL_BIN=install install
+
+ # sys-process is more advanced than parallel from moreutils, rename it
+ if use doc; then
+ mv "${ED}"usr/share/man/man1/{,${PN}_}parallel.1 || die
+ fi
+ mv "${ED}"usr/bin/{,${PN}_}parallel || die
+}
diff --git a/sys-apps/most/Manifest b/sys-apps/most/Manifest
new file mode 100644
index 000000000000..9ae65ec729bb
--- /dev/null
+++ b/sys-apps/most/Manifest
@@ -0,0 +1 @@
+DIST most-5.0.0a.tar.bz2 131130 SHA256 94cb5a2e71b6b9063116f4398a002a757e59cd1499f1019dde8874f408485aa9 SHA512 0c101777250a15ed9cbe0bfbaa17d0ac5ef973a7e0730d096bd931ba578dbcbd4f244305c99a50bc8fd8aa1937b621a97a6452b3821fee7d72f33a02da278e5d WHIRLPOOL 26beeeed2b46b06edb5dcfb8cf009070964e74e42e78a29068c343b5863764e4b8fa8e8457481523589f37f72171b3be4b603d071fba80ad756dd9c3cdbac374
diff --git a/sys-apps/most/files/most-5.0.0a-donot-hardcode-path.patch b/sys-apps/most/files/most-5.0.0a-donot-hardcode-path.patch
new file mode 100644
index 000000000000..37e786c26b0c
--- /dev/null
+++ b/sys-apps/most/files/most-5.0.0a-donot-hardcode-path.patch
@@ -0,0 +1,33 @@
+Author: Benda Xu <heroxbd@gentoo.org>
+Date: 2014-12-08
+Forwarded: John E. Davis <jed@jedsoft.org>
+
+cp or rm does not necessarily reside in /bin. If it does, /bin is
+in $PATH by convention. In either case, hardcoding /bin/cp or /bin/rm
+is not a good idea.
+
+Index: most-5.0.0a/src/Makefile.in
+===================================================================
+--- most-5.0.0a.orig/src/Makefile.in
++++ most-5.0.0a/src/Makefile.in
+@@ -61,7 +61,7 @@ $(OBJDIR):
+ -mkdir $(OBJDIR)
+ #
+ $(CONFIG_H) : $(SRCDIR)/sysconf.h
+- /bin/cp $(SRCDIR)/sysconf.h $(CONFIG_H)
++ cp $(SRCDIR)/sysconf.h $(CONFIG_H)
+ #
+ slangversion: $(OBJDIR)/chkslang
+ $(OBJDIR)/chkslang $(EXEC) 20000
+@@ -75,9 +75,9 @@ $(SRCDIR)/version.h: $(SRCDIR)/../change
+ fi
+ #
+ clean:
+- /bin/rm -f $(OBJDIR)/* *~
++ rm -f $(OBJDIR)/* *~
+ distclean: clean
+- /bin/rm -rf $(OBJDIR) Makefile sysconf.h
++ rm -rf $(OBJDIR) Makefile sysconf.h
+ installdirs:
+ $(MKINSDIR) $(DEST_DOCDIR)
+ $(MKINSDIR) $(DEST_MANDIR)/man1
diff --git a/sys-apps/most/files/most-5.0.0a-no-explicit-termcap.patch b/sys-apps/most/files/most-5.0.0a-no-explicit-termcap.patch
new file mode 100644
index 000000000000..f858f56f7bc1
--- /dev/null
+++ b/sys-apps/most/files/most-5.0.0a-no-explicit-termcap.patch
@@ -0,0 +1,216 @@
+Author: Benda Xu <heroxbd@gentoo.org>
+Date: 2014-12-08
+Forwarded: John E. Davis <jed@jedsoft.org>
+
+"most" completely replies on slang to access terminfo/termcap, by
+SLtt_get_terminfo() and friends.
+
+Nothing should be considered by most but to find slang. Therefore it
+should not link against libtermcap in any case.
+
+ * configure.ac: remove JD_TERMCAP
+ * configure: regenerate with autoconf-2.61
+ * src/Makefile.in: remove libtermcap linking
+
+Index: most-5.0.0a/autoconf/configure.ac
+===================================================================
+--- most-5.0.0a.orig/autoconf/configure.ac
++++ most-5.0.0a/autoconf/configure.ac
+@@ -62,7 +62,6 @@ getpgrp tcgetpgrp \
+ )
+
+ JD_SET_OBJ_SRC_DIR
+-JD_TERMCAP
+ JD_WITH_LIBRARY(slang)
+ JD_GCC_WARNINGS
+ JD_GET_MODULES(src/modules.lis)
+Index: most-5.0.0a/configure
+===================================================================
+--- most-5.0.0a.orig/configure
++++ most-5.0.0a/configure
+@@ -700,8 +700,6 @@ X_EXTRA_LIBS
+ SRCDIR
+ OBJDIR
+ ELFDIR
+-TERMCAP
+-MISC_TERMINFO_DIRS
+ SLANG_LIB
+ SLANG_INC
+ PROGRAM_OFILES
+@@ -9064,13 +9062,11 @@ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+-#include <sys/types.h> /* for off_t */
+- #include <stdio.h>
++#include <stdio.h>
+ int
+ main ()
+ {
+-int (*fp) (FILE *, off_t, int) = fseeko;
+- return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
++return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+ ;
+ return 0;
+ }
+@@ -9110,13 +9106,11 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+ #define _LARGEFILE_SOURCE 1
+-#include <sys/types.h> /* for off_t */
+- #include <stdio.h>
++#include <stdio.h>
+ int
+ main ()
+ {
+-int (*fp) (FILE *, off_t, int) = fseeko;
+- return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
++return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+ ;
+ return 0;
+ }
+@@ -9777,42 +9771,6 @@ OBJDIR=$SRCDIR/"$ARCH"objs
+ ELFDIR=$SRCDIR/elf"$ARCH"objs
+
+
+-{ echo "$as_me:$LINENO: checking for Terminfo" >&5
+-echo $ECHO_N "checking for Terminfo... $ECHO_C" >&6; }
+-MISC_TERMINFO_DIRS="$FINKPREFIX/share/terminfo"
+-if test ! -d $MISC_TERMINFO_DIRS
+-then
+- MISC_TERMINFO_DIRS=""
+-fi
+-
+-JD_Terminfo_Dirs="/usr/lib/terminfo \
+- /usr/share/terminfo \
+- /usr/share/lib/terminfo \
+- /usr/local/lib/terminfo \
+- $MISC_TERMINFO_DIRS"
+-
+-TERMCAP=-ltermcap
+-
+-for terminfo_dir in $JD_Terminfo_Dirs
+-do
+- if test -d $terminfo_dir
+- then
+- { echo "$as_me:$LINENO: result: yes" >&5
+-echo "${ECHO_T}yes" >&6; }
+- TERMCAP=""
+- break
+- fi
+-done
+-if test "$TERMCAP"; then
+- { echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6; }
+- cat >>confdefs.h <<\_ACEOF
+-#define USE_TERMCAP 1
+-_ACEOF
+-
+-fi
+-
+-
+ if test "X$jd_prefix" = "X"
+ then
+ jd_prefix=$ac_default_prefix
+@@ -10858,8 +10816,6 @@ X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim
+ SRCDIR!$SRCDIR$ac_delim
+ OBJDIR!$OBJDIR$ac_delim
+ ELFDIR!$ELFDIR$ac_delim
+-TERMCAP!$TERMCAP$ac_delim
+-MISC_TERMINFO_DIRS!$MISC_TERMINFO_DIRS$ac_delim
+ SLANG_LIB!$SLANG_LIB$ac_delim
+ SLANG_INC!$SLANG_INC$ac_delim
+ PROGRAM_OFILES!$PROGRAM_OFILES$ac_delim
+@@ -10868,9 +10824,10 @@ PROGRAM_HFILES!$PROGRAM_HFILES$ac_delim
+ PROGRAM_OBJECTS!$PROGRAM_OBJECTS$ac_delim
+ PROGRAM_ELFOBJECTS!$PROGRAM_ELFOBJECTS$ac_delim
+ LIBOBJS!$LIBOBJS$ac_delim
++LTLIBOBJS!$LTLIBOBJS$ac_delim
+ _ACEOF
+
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
++ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+@@ -10906,50 +10863,6 @@ CEOF$ac_eof
+ _ACEOF
+
+
+-ac_delim='%!_!# '
+-for ac_last_try in false false false false false :; do
+- cat >conf$$subs.sed <<_ACEOF
+-LTLIBOBJS!$LTLIBOBJS$ac_delim
+-_ACEOF
+-
+- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then
+- break
+- elif $ac_last_try; then
+- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+- { (exit 1); exit 1; }; }
+- else
+- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+- fi
+-done
+-
+-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+-if test -n "$ac_eof"; then
+- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+- ac_eof=`expr $ac_eof + 1`
+-fi
+-
+-cat >>$CONFIG_STATUS <<_ACEOF
+-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+-_ACEOF
+-sed '
+-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+-s/^/s,@/; s/!/@,|#_!!_#|/
+-:n
+-t n
+-s/'"$ac_delim"'$/,g/; t
+-s/$/\\/; p
+-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+-' >>$CONFIG_STATUS <conf$$subs.sed
+-rm -f conf$$subs.sed
+-cat >>$CONFIG_STATUS <<_ACEOF
+-:end
+-s/|#_!!_#|//g
+-CEOF$ac_eof
+-_ACEOF
+-
+-
+ # VPATH may cause trouble with some makes, so we remove $(srcdir),
+ # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+ # trailing colons and then remove the whole line if VPATH becomes empty
+@@ -11193,7 +11106,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t
+ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+ s&@INSTALL@&$ac_INSTALL&;t t
+ $ac_datarootdir_hack
+-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
++" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
+
+ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+Index: most-5.0.0a/src/Makefile.in
+===================================================================
+--- most-5.0.0a.orig/src/Makefile.in
++++ most-5.0.0a/src/Makefile.in
+@@ -3,7 +3,6 @@ CFLAGS = @CFLAGS@ @SLANG_DLL_CFLAGS@
+ LDFLAGS = @LDFLAGS@
+ SLANG_INC = @SLANG_INC@
+ SLANG_LIB = @SLANG_LIB@ -lslang
+-MISCLIBS = @TERMCAP@
+ RPATH = @RPATH@
+
+ #-----------------------------------------------------------------------------
+@@ -44,7 +43,7 @@ EXEC = most
+ CONFIG_H = config.h
+ INCS = $(SLANG_INC)
+ ALL_CFLAGS = $(CFLAGS) -Dunix $(INCS)
+-EXECLIBS = $(RPATH) $(SLANG_LIB) $(MISCLIBS) -lm
++EXECLIBS = $(RPATH) $(SLANG_LIB) -lm
+ #
+ most_O_DEP = $(SRCDIR)/version.h
+ UPDATE_VERSION_SCRIPT = $(HOME)/bin/update_changes_version
diff --git a/sys-apps/most/metadata.xml b/sys-apps/most/metadata.xml
new file mode 100644
index 000000000000..f23b9cae1593
--- /dev/null
+++ b/sys-apps/most/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>shell-tools</herd>
+</pkgmetadata>
diff --git a/sys-apps/most/most-5.0.0a-r1.ebuild b/sys-apps/most/most-5.0.0a-r1.ebuild
new file mode 100644
index 000000000000..d6cfd9955f5c
--- /dev/null
+++ b/sys-apps/most/most-5.0.0a-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 eutils
+
+DESCRIPTION="Paging program that displays, one windowful at a time, the contents of a file"
+HOMEPAGE="ftp://space.mit.edu/pub/davis/most"
+SRC_URI="ftp://space.mit.edu/pub/davis/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~mips ppc sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND=">=sys-libs/slang-2.1.3"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-5.0.0a-no-explicit-termcap.patch
+ epatch "${FILESDIR}"/${PN}-5.0.0a-donot-hardcode-path.patch
+ sed -i -e 's:$(INSTALL) -s:$(INSTALL):' src/Makefile.in || die
+ export MAKEOPTS+=" -j1"
+}
+
+src_configure() {
+ unset ARCH
+ econf
+}
+
+src_install() {
+ emake DESTDIR="${D}" DOC_DIR="${EPREFIX}/usr/share/doc/${PF}" \
+ install
+}
diff --git a/sys-apps/mount-gtk/Manifest b/sys-apps/mount-gtk/Manifest
new file mode 100644
index 000000000000..0a9d18f75063
--- /dev/null
+++ b/sys-apps/mount-gtk/Manifest
@@ -0,0 +1 @@
+DIST mount-gtk-1.4.2.tar.gz 232132 SHA256 755a4aae98c8c14c909dfc8da2e46f32ce720137edecdb3d8fcdc99fa02dbd03 SHA512 90fa174238d19bf009f5863e5571030091681038ddbfdc06c7a39f8859b78d9864b398899d66463d0f8a189e484201c7a32753b38898e0f5d55970feb85420ba WHIRLPOOL 17ea7baab7df013116e0c302c9fe9810c8a6d941e9de79cf05e3e9826a69fbc0ff49efb8d44d64658c472439019119b47adf7bab51a198616b5abda9708c47ea
diff --git a/sys-apps/mount-gtk/files/mount-gtk-1.4.2-c++11.patch b/sys-apps/mount-gtk/files/mount-gtk-1.4.2-c++11.patch
new file mode 100644
index 000000000000..f2898a0d2ca8
--- /dev/null
+++ b/sys-apps/mount-gtk/files/mount-gtk-1.4.2-c++11.patch
@@ -0,0 +1,31 @@
+http://bugs.gentoo.org/484264
+
+--- configure.ac
++++ configure.ac
+@@ -27,6 +27,7 @@
+ AC_LANG_CPLUSPLUS dnl switch to C++
+ AC_TYPE_SIZE_T
+ AC_CHECK_TYPES(ssize_t)
++AX_CHECK_COMPILE_FLAG([-std=c++11], [CXXFLAGS="$CXXFLAGS -std=c++11"])
+ AC_CHECK_RANGE_FOR_SUPPORT
+ AC_CHECK_LAMBDA_SUPPORT
+
+--- m4/ax_check_compile_flag.m4
++++ m4/ax_check_compile_flag.m4
+@@ -0,0 +1,16 @@
++# This macro is part of autoconf-archive with license GPL-3 or any later version
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++ [AS_VAR_SET(CACHEVAR,[yes])],
++ [AS_VAR_SET(CACHEVAR,[no])])
++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
++ [m4_default([$2], :)],
++ [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/sys-apps/mount-gtk/metadata.xml b/sys-apps/mount-gtk/metadata.xml
new file mode 100644
index 000000000000..e734d7e194fd
--- /dev/null
+++ b/sys-apps/mount-gtk/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>desktop-misc</herd>
+ <maintainer>
+ <email>ssuominen@gentoo.org</email>
+ <name>Samuli Suominen</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">mount-gtk</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/mount-gtk/mount-gtk-1.4.2.ebuild b/sys-apps/mount-gtk/mount-gtk-1.4.2.ebuild
new file mode 100644
index 000000000000..7945e065f7ed
--- /dev/null
+++ b/sys-apps/mount-gtk/mount-gtk-1.4.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 autotools eutils flag-o-matic
+
+DESCRIPTION="GTK+ based UDisks2 frontend"
+HOMEPAGE="http://mount-gtk.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/glib-2.28
+ sys-fs/udisks:2
+ x11-libs/c++-gtk-utils:0
+ x11-libs/libX11
+ x11-libs/libnotify:="
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS BUGS ChangeLog )
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-c++11.patch
+ sed -i -e 's:AC_CONFIG_HEADER:&S:' configure.ac || die
+ eautoreconf
+}
+
+src_configure() {
+ # acinclude.m4 is broken and environment flags override these:
+ append-cxxflags -fexceptions -frtti -fsigned-char -fno-check-new -pthread
+ econf --docdir=/usr/share/doc/${PF}
+}
diff --git a/sys-apps/mouseemu/Manifest b/sys-apps/mouseemu/Manifest
new file mode 100644
index 000000000000..6c8c00787ebd
--- /dev/null
+++ b/sys-apps/mouseemu/Manifest
@@ -0,0 +1,2 @@
+DIST mouseemu-0.15.tar.gz 13958 SHA256 bbef220a814931f8ee482c82dfd63ad0a8ec895fc7df7bac1a1ada880d59af59
+DIST mouseemu.tar.gz 12019 SHA256 67d5015d2859a58794208278178eabb7b189cb9da106628085c75c7a50f7ee9c
diff --git a/sys-apps/mouseemu/files/mouseemu-0.12-fix.diff b/sys-apps/mouseemu/files/mouseemu-0.12-fix.diff
new file mode 100644
index 000000000000..993f7633e127
--- /dev/null
+++ b/sys-apps/mouseemu/files/mouseemu-0.12-fix.diff
@@ -0,0 +1,48 @@
+--- mouseemu-0.12.orig/Makefile
++++ mouseemu-0.12/Makefile
+@@ -1,6 +1,6 @@
+ all:
+- gcc -Wall -I/usr/src/linux/include -g -o mouseemu mouseemu.c
++ gcc -Wall -g -o mouseemu mouseemu.c
+ clean:
+ rm -f *.o core* mouseemu
+ install:
+- cp -f mouseemu /usr/sbin/
++ cp -f mouseemu $(DESTDIR)/usr/sbin/
+--- mouseemu-0.12.orig/mouseemu.conf
++++ mouseemu-0.12/mouseemu.conf
+@@ -0,0 +1,10 @@
++# Mouseemu Configuration File
++# Each uncommented line is read by the mouseemu initscript
++# (/etc/init.d/mouseemu). If you use mouseemu without the
++# initscript, source this file in your .bashrc/.cshrc/.zshrc
++# Keycodes can be found using the "showkey" program.
++
++#MID_CLICK="-middle 0 68" # F10 with no modifier
++#RIGHT_CLICK="-right 0 87" # F11 with no modifier
++#SCROLL="-scroll 56" # Alt key
++#TYPING_BLOCK="-typing-block 300" # block mouse for 300ms after a keypress
+--- mouseemu-0.12.orig/mouseemu.c
++++ mouseemu-0.12/mouseemu.c
+@@ -428,7 +428,7 @@
+ "\t[-nofork]\n",
+ argv[0]);
+ printf("Key codes can be found in "
+- "/usr/src/linux/include/linux.h,\n"
++ "/usr/src/linux/include/linux/input.h,\n"
+ "or by using `showkey` in console.\n"
+ "Use decimal values. BTN_LEFT(272) is usable as "
+ "B2_KEY or B3_KEY.\n\n");
+--- mouseemu-0.12.orig/mouseemu.init.gentoo.old
++++ mouseemu-0.12/mouseemu.init.gentoo
+@@ -13,6 +13,10 @@
+
+ start() {
+ ebegin "Starting mouseemu"
++ # Source configuration file /etc/mouseemu.conf
++ if [ -f /etc/mouseemu.conf ] ; then
++ . /etc/mouseemu.conf
++ fi
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/mouseemu -- \
+ $MID_CLICK $RIGHT_CLICK $SCROLL $TYPING_BLOCK > /var/log/mouseemu.log
diff --git a/sys-apps/mouseemu/files/mouseemu-0.13-fix.patch b/sys-apps/mouseemu/files/mouseemu-0.13-fix.patch
new file mode 100644
index 000000000000..f4d0aa981762
--- /dev/null
+++ b/sys-apps/mouseemu/files/mouseemu-0.13-fix.patch
@@ -0,0 +1,14 @@
+diff -Naur ../mouseemu.orig/mouseemu.conf ./mouseemu.conf
+--- ../mouseemu.orig/mouseemu.conf 1970-01-01 01:00:00.000000000 +0100
++++ ./mouseemu.conf 2005-02-14 09:10:30.236462888 +0100
+@@ -0,0 +1,10 @@
++# Mouseemu Configuration File
++# Each uncommented line is read by the mouseemu initscript
++# (/etc/init.d/mouseemu). If you use mouseemu without the
++# initscript, source this file in your .bashrc/.cshrc/.zshrc
++# Keycodes can be found using the "showkey" program.
++
++#MID_CLICK="-middle 0 68" # F10 with no modifier
++#RIGHT_CLICK="-right 0 87" # F11 with no modifier
++#SCROLL="-scroll 56" # Alt key
++#TYPING_BLOCK="-typing-block 300" # block mouse for 300ms after a keypress
diff --git a/sys-apps/mouseemu/files/mouseemu-0.15-build.patch b/sys-apps/mouseemu/files/mouseemu-0.15-build.patch
new file mode 100644
index 000000000000..882d66fa7750
--- /dev/null
+++ b/sys-apps/mouseemu/files/mouseemu-0.15-build.patch
@@ -0,0 +1,9 @@
+--- Makefile
++++ Makefile
+@@ -1,5 +1,5 @@
+ all:
+- gcc -Wall -g -o mouseemu mouseemu.c
++ gcc -Wall $(CFLAGS) $(LDFLAGS) -o mouseemu mouseemu.c
+ clean:
+ rm -f *.o core* mouseemu
+ install:
diff --git a/sys-apps/mouseemu/metadata.xml b/sys-apps/mouseemu/metadata.xml
new file mode 100644
index 000000000000..034c09eb248a
--- /dev/null
+++ b/sys-apps/mouseemu/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-apps/mouseemu/mouseemu-0.12.ebuild b/sys-apps/mouseemu/mouseemu-0.12.ebuild
new file mode 100644
index 000000000000..b0c33169a8e8
--- /dev/null
+++ b/sys-apps/mouseemu/mouseemu-0.12.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Emulates scrollwheel, right- & left-click for one-button mice/touchpads"
+HOMEPAGE="http://geekounet.org/powerbook/"
+SRC_URI="http://geekounet.org/powerbook/files/${PN}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ppc"
+IUSE=""
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ mv ${WORKDIR}/${PN} ${WORKDIR}/${P}
+ epatch ${FILESDIR}/${P}-fix.diff
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ dosbin mouseemu
+ dodoc README COPYING
+ newinitd mouseemu.init.gentoo mouseemu
+ insinto /etc
+ doins mouseemu.conf
+}
+
+pkg_postinst() {
+ einfo "For mouseemu to work you need uinput support in your kernel:"
+ einfo " CONFIG_INPUT_UINPUT=y"
+ einfo "(Device Drivers->Input device support->Misc->User level driver support)"
+ einfo "Don't forget to add mouseemu to your default runlevel:"
+ einfo " rc-update add mouseemu default"
+ einfo "Configuration is in /etc/mouseemu.conf."
+}
diff --git a/sys-apps/mouseemu/mouseemu-0.15.ebuild b/sys-apps/mouseemu/mouseemu-0.15.ebuild
new file mode 100644
index 000000000000..42a1873fc250
--- /dev/null
+++ b/sys-apps/mouseemu/mouseemu-0.15.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Emulates scrollwheel, right- & left-click for one-button mice/touchpads"
+HOMEPAGE="http://geekounet.org/powerbook/"
+SRC_URI="http://geekounet.org/powerbook/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~ppc"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-0.13-fix.patch
+ epatch "${FILESDIR}"/${PN}-0.15-build.patch
+}
+
+src_install() {
+ dosbin mouseemu || die
+ dodoc README
+ newinitd mouseemu.init.gentoo mouseemu
+ insinto /etc
+ doins mouseemu.conf
+}
+
+pkg_postinst() {
+ einfo "For mouseemu to work you need uinput support in your kernel:"
+ einfo " CONFIG_INPUT_UINPUT=y"
+ einfo "(Device Drivers->Input device support->Misc->User level driver support)"
+ einfo "Don't forget to add mouseemu to your default runlevel:"
+ einfo " rc-update add mouseemu default"
+ einfo "Configuration is in /etc/mouseemu.conf."
+}
diff --git a/sys-apps/msr-tools/Manifest b/sys-apps/msr-tools/Manifest
new file mode 100644
index 000000000000..19fc9289b823
--- /dev/null
+++ b/sys-apps/msr-tools/Manifest
@@ -0,0 +1,2 @@
+DIST msr-tools-1.2.tar.gz 3382 SHA256 5184cdcabd3e88e37023a5ca5a1c3d5cac22f17c7f2e47023336738209f1e94a SHA512 5f4265a1ab4b2dd78e7e964e2f3eb26997ccf1eac8abb273b18ffc9e5f6671c4983d99b8f734ef6b80a82c3eb75b672fbb4769f84e5df8a398f835f5f6194971 WHIRLPOOL ce5bbd25a1392d864288141df972af1f71062e6a11e819d28b6236890cdf6d92c63245a2a76c533f2c708ec8bcb847d1f7a93532f00fa687aae8c060f99c4b33
+DIST msr-tools_1.2-3.diff.gz 2276 SHA256 da0f4e9f4822a1b715190f4302f4cdeeb6545da7daebf82ab8ea299d62f1593c SHA512 eeaa35e45356042cb93ce0d1473dfebacbe9cf9099498827220bd5ec0036c88ee5c9842d602b5d147b2a0f2030358e9a02cec5bc77e4eb45e23b7ff2804fd6bd WHIRLPOOL 8e32d3adc4396e2136a96dc507495029b0d03105810a9bc08abe15f5c48db39ff30b432f928c19796b0fb885122d8775727a23a140bf7e4ddaf2258d4cef311b
diff --git a/sys-apps/msr-tools/metadata.xml b/sys-apps/msr-tools/metadata.xml
new file mode 100644
index 000000000000..07339f6f0ce8
--- /dev/null
+++ b/sys-apps/msr-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>kensington@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/msr-tools/msr-tools-1.2.ebuild b/sys-apps/msr-tools/msr-tools-1.2.ebuild
new file mode 100644
index 000000000000..208075366290
--- /dev/null
+++ b/sys-apps/msr-tools/msr-tools-1.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
+CONFIG_CHECK="~X86_MSR"
+DEB_P="msr-tools_1.2-3"
+
+inherit eutils linux-info toolchain-funcs
+
+DESCRIPTION="Utilities allowing the read and write of CPU model-specific registers (MSR)"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/cpu/msr-tools/"
+SRC_URI="http://dev.gentoo.org/~kensington/distfiles/${P}.tar.gz mirror://debian/pool/main/m/${PN}/${DEB_P}.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+src_prepare() {
+ epatch "${WORKDIR}"/${DEB_P}.diff
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dosbin rdmsr
+ dosbin wrmsr
+
+ doman ${P}/debian/rdmsr.1 ${P}/debian/wrmsr.1
+}
diff --git a/sys-apps/mtree/Manifest b/sys-apps/mtree/Manifest
new file mode 100644
index 000000000000..d9e708d679c0
--- /dev/null
+++ b/sys-apps/mtree/Manifest
@@ -0,0 +1,2 @@
+DIST mtree-1.0.1.tar.gz 110979 SHA256 9f3283fc7b8b4961a611c8c66e1d873a4936fe0039998863ea9d116601a730c3 SHA512 47897a1763ba02d095d9d7179ffb513ca847c5e9bde27908a4ef94feced2d59baef6f95f8024cfce3c5f47e4f7b7ae64e283ce1589b2e3826fd14b13f88d4990 WHIRLPOOL 35c83ef93fed86b480b1be170c7b90d11f86a2b806270c559ccedbab2597706cb820dbd4e31dc053b3070bac9a73f09cbdc5549dd70f959ef9ccbcc7164b915d
+DIST mtree-1.0.tar.gz 107599 SHA256 d58e180e48f298caf0ae0e9153b77b7a025898b7e978d51587a63318b0e3692f
diff --git a/sys-apps/mtree/files/mtree-1.5-gcc4.patch b/sys-apps/mtree/files/mtree-1.5-gcc4.patch
new file mode 100644
index 000000000000..a57feed85085
--- /dev/null
+++ b/sys-apps/mtree/files/mtree-1.5-gcc4.patch
@@ -0,0 +1,29 @@
+Index: bootstrap-pkgsrc/digest/sha2.h
+===================================================================
+--- bootstrap-pkgsrc.orig/digest/sha2.h
++++ bootstrap-pkgsrc/digest/sha2.h
+@@ -99,21 +99,21 @@ void SHA256_Init(SHA256_CTX *);
+ void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t);
+ void SHA256_Final(u_int8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
+ char* SHA256_End(SHA256_CTX*, u_char *);
+-char* SHA256_Data(const u_int8_t*, size_t, u_char *);
++char* SHA256_Data(const u_char*, size_t, u_char *);
+ char *SHA256_File(char *, char *);
+
+ void SHA384_Init(SHA384_CTX*);
+ void SHA384_Update(SHA384_CTX*, const u_int8_t*, size_t);
+ void SHA384_Final(u_int8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
+ char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
+-char* SHA384_Data(const u_int8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
++char* SHA384_Data(const u_char*, size_t, char[SHA384_DIGEST_STRING_LENGTH]);
+ char *SHA384_File(char *, char *);
+
+ void SHA512_Init(SHA512_CTX*);
+ void SHA512_Update(SHA512_CTX*, const u_int8_t*, size_t);
+ void SHA512_Final(u_int8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
+ char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
+-char* SHA512_Data(const u_int8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
++char* SHA512_Data(const u_char*, size_t, char[SHA512_DIGEST_STRING_LENGTH]);
+ char *SHA512_File(char *, char *);
+
+ #endif /* SHA2_USE_INTTYPES_H */
diff --git a/sys-apps/mtree/files/mtree-2007.4+glibc-2.8.patch b/sys-apps/mtree/files/mtree-2007.4+glibc-2.8.patch
new file mode 100644
index 000000000000..998715766f65
--- /dev/null
+++ b/sys-apps/mtree/files/mtree-2007.4+glibc-2.8.patch
@@ -0,0 +1,25 @@
+Index: pkgsrc/pkgtools/libnbcompat/files/nbcompat/limits.h
+===================================================================
+--- pkgsrc.orig/pkgtools/libnbcompat/files/nbcompat/limits.h
++++ pkgsrc/pkgtools/libnbcompat/files/nbcompat/limits.h
+@@ -43,6 +43,11 @@
+ # include <limits.h>
+ #endif
+
++/* Needed for glibc 2.8 */
++#ifdef HAVE_SYS_PARAM_H
++# include <sys/param.h>
++#endif
++
+ /*
+ * Declare functions and macros that may be missing in <limits.h>.
+ */
+@@ -77,4 +82,8 @@
+ # define UID_MAX 2147483647U /* max value for a uid_t (2^31-2) */
+ #endif
+
++#if !defined(ARG_MAX) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) )
++# define ARG_MAX sysconf(_SC_ARG_MAX)
++#endif
++
+ #endif /* !_NBCOMPAT_LIMITS_H_ */
diff --git a/sys-apps/mtree/metadata.xml b/sys-apps/mtree/metadata.xml
new file mode 100644
index 000000000000..659da0ca93c2
--- /dev/null
+++ b/sys-apps/mtree/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-apps/mtree/mtree-1.0.1.ebuild b/sys-apps/mtree/mtree-1.0.1.ebuild
new file mode 100644
index 000000000000..59f2affe7a8d
--- /dev/null
+++ b/sys-apps/mtree/mtree-1.0.1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools
+
+DESCRIPTION="Directory hierarchy mapping tool from FreeBSD"
+HOMEPAGE="http://code.google.com/p/mtree-port/"
+SRC_URI="http://mtree-port.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+src_prepare() {
+ # don't install unneeded docs
+ sed -i '/doc_DATA=/d' Makefile.am || die
+ eautoreconf
+}
+
+src_install() {
+ default
+
+ # avoid conflict with app-arch/libarchive
+ rm "${ED}usr/share/man/man5/mtree.5"
+}
diff --git a/sys-apps/mtree/mtree-1.0.ebuild b/sys-apps/mtree/mtree-1.0.ebuild
new file mode 100644
index 000000000000..15ffa3656718
--- /dev/null
+++ b/sys-apps/mtree/mtree-1.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="Directory hierarchy mapping tool from FreeBSD"
+HOMEPAGE="http://code.google.com/p/mtree-port/"
+SRC_URI="http://mtree-port.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+src_install()
+{
+
+ default_src_install
+
+ # Avoid conflict with app-arch/libarchive
+ rm "${ED}usr/share/man/man5/mtree.5"
+
+}
diff --git a/sys-apps/nawk/Manifest b/sys-apps/nawk/Manifest
new file mode 100644
index 000000000000..7e5f8ec12c60
--- /dev/null
+++ b/sys-apps/nawk/Manifest
@@ -0,0 +1 @@
+DIST nawk-20121220.tar.gz 88970 SHA256 8dc092165c5a4e1449f964286483d06d0dbfba4b0bd003cb5dab30de8f6d9b83 SHA512 1dd62e1aa4c8cfad7ce599b10d88e9b450ecae3217cf8327cc0f3ce77d0d0dcb731101b8f211066462d46dc4ef23e20ccd7f70d799d7d48940026abe8fa79d4f WHIRLPOOL 6d8effe600eaf49c9bce79b027732909992f606ba89e771ad041f5ef3b32a44e7b0fa41576fdeb3e220f1e4859e2701397946fa90cb0ee4a334eb0178fabee91
diff --git a/sys-apps/nawk/files/nawk-20121220-parallel-build.patch b/sys-apps/nawk/files/nawk-20121220-parallel-build.patch
new file mode 100644
index 000000000000..45a3e5624a40
--- /dev/null
+++ b/sys-apps/nawk/files/nawk-20121220-parallel-build.patch
@@ -0,0 +1,61 @@
+--- makefile.orig 2013-02-06 10:26:36.452829647 -0700
++++ makefile 2013-02-07 09:12:13.293898947 -0700
+@@ -44,7 +44,7 @@
+ LISTING = awk.h proto.h awkgram.y lex.c b.c main.c maketab.c parse.c \
+ lib.c run.c tran.c
+
+-SHIP = README FIXES $(SOURCE) ytab[ch].bak makefile \
++SHIP = README FIXES $(SOURCE) makefile \
+ awk.1
+
+ a.out: ytab.o $(OFILES)
+@@ -52,11 +52,15 @@
+
+ $(OFILES): awk.h ytab.h proto.h
+
+-ytab.o: awk.h proto.h awkgram.y
++#Clear dependency for parallel build: (make -j)
++#YACC generated y.tab.c and y.tab.h at the same time
++#this needs to be a static pattern rules otherwise multiple target
++#are mapped onto multiple executions of yacc, which overwrite
++#each others outputs.
++y%.c y%.h: awk.h proto.h awkgram.y
+ $(YACC) $(YFLAGS) awkgram.y
+- mv y.tab.c ytab.c
+- mv y.tab.h ytab.h
+- $(CC) $(CFLAGS) -c ytab.c
++ mv y.$*.c y$*.c
++ mv y.$*.h y$*.h
+
+ proctab.c: maketab
+ ./maketab >proctab.c
+@@ -64,23 +68,23 @@
+ maketab: ytab.h maketab.c
+ $(CC) $(CFLAGS) maketab.c -o maketab
+
+-bundle:
++bundle: $(SHIP)
+ @cp ytab.h ytabh.bak
+ @cp ytab.c ytabc.bak
+- @bundle $(SHIP)
++ @bundle $(SHIP) ytabh.bak ytabc.bak
+
+-tar:
++tar: $(SHIP)
+ @cp ytab.h ytabh.bak
+ @cp ytab.c ytabc.bak
+ @bundle $(SHIP) >awk.shar
+- @tar cf awk.tar $(SHIP)
++ @tar cf awk.tar $(SHIP) ytabh.bak ytabc.bak
+ gzip awk.tar
+ ls -l awk.tar.gz
+- @zip awk.zip $(SHIP)
++ @zip awk.zip $(SHIP) ytabh.bak ytabc.bak
+ ls -l awk.zip
+
+ names:
+ @echo $(LISTING)
+
+ clean:
+- rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda # proctab.c
++ rm -f a.out *.o *.obj maketab maketab.exe *.bb *.bbg *.da *.gcov *.gcno *.gcda ytab.c ytab.h # proctab.c
diff --git a/sys-apps/nawk/metadata.xml b/sys-apps/nawk/metadata.xml
new file mode 100644
index 000000000000..6ce7863fe532
--- /dev/null
+++ b/sys-apps/nawk/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>ottxor@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-apps/nawk/nawk-20121220-r2.ebuild b/sys-apps/nawk/nawk-20121220-r2.ebuild
new file mode 100644
index 000000000000..ad4ea9ed8eb9
--- /dev/null
+++ b/sys-apps/nawk/nawk-20121220-r2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Brian Kernighan's pattern scanning and processing language"
+HOMEPAGE="http://cm.bell-labs.com/cm/cs/awkbook/index.html"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-macos"
+IUSE=""
+
+RDEPEND="app-eselect/eselect-awk
+ !sys-freebsd/freebsd-ubin"
+DEPEND="${RDEPEND}
+ virtual/yacc"
+
+S="${WORKDIR}"
+
+src_prepare() {
+ rm -f ytab.[hc]
+ epatch "${FILESDIR}/${P}"-parallel-build.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" CPPFLAGS=-DHAS_ISBLANK ALLOC="${LDFLAGS}" YACC=$(type -p yacc) YFLAGS="-d"
+}
+
+src_install() {
+ newbin a.out "${PN}"
+ sed -e 's/awk/nawk/g' \
+ -e 's/AWK/NAWK/g' \
+ -e 's/Awk/Nawk/g' \
+ awk.1 > "${PN}".1 || die "manpage patch failed"
+ doman "${PN}".1
+ dodoc README FIXES
+}
+
+pkg_postinst() {
+ eselect awk update ifunset
+}
+
+pkg_postrm() {
+ eselect awk update ifunset
+}
diff --git a/sys-apps/nca/Manifest b/sys-apps/nca/Manifest
new file mode 100644
index 000000000000..b3a2b81ff177
--- /dev/null
+++ b/sys-apps/nca/Manifest
@@ -0,0 +1 @@
+DIST nca-0.9.0.tar.gz 818721 SHA256 407144394f6f90e818c7ce992a691c4e99983defbe9de63f6a0adaa93a36ae03 SHA512 375dc747414af7e8971a9112fa6a4583dd543f6f4b3a84b2c16f45ee2487363929c2eed3c1837687b802161c630443885e6da20ac738017d219e9a608b4d700c WHIRLPOOL 60c726e918e3684fe9dc45eacbfb2aa264f7ea1fd71e46eacc2020252e5cf6b333345c000eb8efafba65965fe184ff1ad4cbc87886a623831476f18c052953d9
diff --git a/sys-apps/nca/files/ncad.initd b/sys-apps/nca/files/ncad.initd
new file mode 100644
index 000000000000..5e7fff2fed87
--- /dev/null
+++ b/sys-apps/nca/files/ncad.initd
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet --exec /sbin/ncad
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --retry 5 --quiet --exec /sbin/ncad
+ eend ${?}
+}
diff --git a/sys-apps/nca/metadata.xml b/sys-apps/nca/metadata.xml
new file mode 100644
index 000000000000..b09d87bd4291
--- /dev/null
+++ b/sys-apps/nca/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ nca connects a pseudo terminal to the console's virtual terminals
+ (/dev/tty0...n) that are normally only accessible to someone with
+ local keyboard access. It is particularly useful in conjunction with
+ ncad since it then provides remote console access via SSH; with some
+ appropriate system start up scripts, ncad can be started immediately
+ the root filesystem has been mounted read-only, providing a cheap,
+ and only marginally inferior alternative to a serial console.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/nca/nca-0.9.0.ebuild b/sys-apps/nca/nca-0.9.0.ebuild
new file mode 100644
index 000000000000..0c7bc45b2a05
--- /dev/null
+++ b/sys-apps/nca/nca-0.9.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Network Console on Acid"
+HOMEPAGE="http://www.xenoclast.org/nca/"
+SRC_URI="http://www.xenoclast.org/nca/download/${P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ sys-libs/zlib"
+
+DEPEND="dev-lang/perl
+ ${RDEPEND}"
+
+src_prepare() {
+ sed -i -e "s:^\([[:space:]]\+\$(MAKE) install\):\1 DESTDIR=\$(DESTDIR):g" \
+ -e "s:=\(\$(CFLAGS)\):=\"\1\":g" -e "s:=\(\$(CC)\):=\"\1\":g" Makefile
+
+ sed -i -e "s:-s sshd:sshd:g" ncad.patch
+}
+
+src_compile() {
+ emake -j1 CFLAGS="${CFLAGS}" CC=$(tc-getCC) || die "emake failed"
+}
+
+src_install() {
+ dodir /sbin
+ emake BINDIR="${D}sbin" MANDIR="${D}usr/share/man" SYSCONF_DIR="${D}etc" \
+ DESTDIR="${D}" install_nca install_ssh install_man
+
+ newinitd "${FILESDIR}/ncad.initd" ncad
+ dodoc ChangeLog README* rc/ncad.template
+}
diff --git a/sys-apps/net-tools/Manifest b/sys-apps/net-tools/Manifest
new file mode 100644
index 000000000000..b7001214930b
--- /dev/null
+++ b/sys-apps/net-tools/Manifest
@@ -0,0 +1,5 @@
+DIST net-tools-1.60_p20130513023548-patches-1.tar.xz 3352 SHA256 926240c304e20a0ab966c3d278703a6ef8e7833a54aaf636598854450bd01f4e SHA512 6dd3eef6469a18581a98fc91f424b418f3875cd0eff86724d6bdbacca1b83d1229a567a184b82e0187d01a428ea6be933d53090796b5c7d301009b2e211c4531 WHIRLPOOL fb638e122f85e95fda35b77336fbb5d4f6e89c5f5a5b76d759bd08f53eb0741feb9c7221940b836e0e7f5c60bd312d99d823c3af89340d6e254f1be96e34d2ce
+DIST net-tools-1.60_p20130513023548-patches-2.tar.xz 14780 SHA256 4eba8545c64db6d2b0eedca45ff7346e4c0b6f1b526ca31b2db6462a0ec0be1b SHA512 6cb4ce7324bae696997839492edd3578e8c9971395de5d499a735ef6421aacc37d24311ada4b94e596c61b55660e2a4babb58f2403ef83da7ac32d2ccbf23201 WHIRLPOOL 200f0a5a88c1e637d183dd098ec1077ee565f0cac1b021b9500a803e2717143184d2c6c597158d73867331b1dc5e474e4858654b6927c314522cd228f660c00a
+DIST net-tools-1.60_p20130513023548.tar.xz 196684 SHA256 e4f47c0736c5d73853f3bbfd30bec1922465f7a2b5bce25e5067774bac1d716d SHA512 d01404ac461f93fbd304f6c67a8dcc642b833f3653b97a5c2ecf3774bfef8489d6aa5631dbefe432a6675e2ce20e88ce1b9888a9ec055198076970505afd1f1b WHIRLPOOL 24e5917bb790d683507d9406213e0ee0ca94c36fcca469ff0ab7fa4c30517cb29a4cfafb98fdedf3a4ba94baa3f66da48ae3a2f359e522b9d42e6e1c599772fa
+DIST net-tools-1.60_p20141019041918-patches-1.tar.xz 3352 SHA256 12e79c866c532ba75c0367397f664799f90ab8901bc906429b67939e8e6b354f SHA512 139f8c2990e5be44c17c2c5c4a900d2d2a8cdb5c067a8fe822b20b964045a24bc1138f7656291bc4db80ecddaa24e2e2655c018925d7b214651284443df550f9 WHIRLPOOL 3e33a3d5e0209360c7d90e4741a1b2be662e3c9d1c8a1f8a7283bff98642934fd26da296c5ed4a064915fa1a1006ee8f94fedc07d86bda48ed9624fc9946d190
+DIST net-tools-1.60_p20141019041918.tar.xz 197684 SHA256 22d1fb8acfa0b1e92d3c5dd3f544770b107df72f32f5b16232e65045c5efd2d0 SHA512 5fb02e181f3fec0a62a8ec8f1e6b0549d711d70d292491a2721d7f19f1a3b07d41fd0c8f503809435cd1a1b1999bcf5690402acc51f06ac6d626e11fef590e2e WHIRLPOOL c34f0c7363cc445e2457ccbf796947b60f74a063ed299840f755c6c023b8eb2cd46cdf42e1f9ca7530170e0b32dd14477e64ce50ec089e4a8b5d3e6bf65456ec
diff --git a/sys-apps/net-tools/metadata.xml b/sys-apps/net-tools/metadata.xml
new file mode 100644
index 000000000000..0c72e81d0315
--- /dev/null
+++ b/sys-apps/net-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>base-system</herd>
+<use>
+ <flag name='old-output'>use old ifconfig output style (useful for when new output breaks scripts)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/net-tools/net-tools-1.60_p20130513023548-r1.ebuild b/sys-apps/net-tools/net-tools-1.60_p20130513023548-r1.ebuild
new file mode 100644
index 000000000000..c66e8f600e26
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20130513023548-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
+ inherit git-2
+else
+ PATCH_VER="2"
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls old-output selinux static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ selinux? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+maint_pkg_create() {
+ cd /usr/local/src/net-tools
+ #git-update
+ local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
+ local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
+ local p="${PN}-${pv}"
+ git archive --prefix="${p}/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
+ tar cf - ${p}/ | xz > ${p}.tar.xz
+ popd >/dev/null
+
+ local patches="${p}-patches-${PATCH_VER:-1}"
+ local d="${T}/${patches}"
+ mkdir "${d}"
+ git format-patch -o "${d}" master..gentoo > /dev/null
+ echo "From http://cgit.gentoo.org/proj/net-tools.git" > "${d}"/README
+ tar cf - -C "${T}" ${d##*/} | xz > "${T}"/${patches}.tar.xz
+ rm -rf "${d}"
+
+ du -b "${T}"/*.tar.xz
+}
+
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
+
+set_opt() {
+ local opt=$1 ans
+ shift
+ ans=$("$@" && echo y || echo n)
+ einfo "Setting option ${opt} to ${ans}"
+ sed -i \
+ -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
+ config.in || die
+}
+
+src_prepare() {
+ if [[ -n ${PATCH_VER} ]] ; then
+ use old-output || EPATCH_EXCLUDE="0001-revert-621a2f376334f8097604b9fee5783e0f1141e66d-for-.patch"
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch "${WORKDIR}"/${P}-patches-${PATCH_VER}
+ fi
+}
+
+src_configure() {
+ set_opt I18N use nls
+ set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
+ set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
+ set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
+ set_opt SELINUX use selinux
+ if use static ; then
+ append-flags -static
+ append-ldflags -static
+ fi
+ tc-export AR CC
+ yes "" | ./configure.sh config.in || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README README.ipv6 TODO
+}
+
+pkg_postinst() {
+ einfo "etherwake and such have been split into net-misc/ethercard-diag"
+}
diff --git a/sys-apps/net-tools/net-tools-1.60_p20130513023548-r2.ebuild b/sys-apps/net-tools/net-tools-1.60_p20130513023548-r2.ebuild
new file mode 100644
index 000000000000..e4272062b373
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20130513023548-r2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
+ inherit git-2
+else
+ PATCH_VER="2"
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls old-output selinux static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ selinux? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+maint_pkg_create() {
+ cd /usr/local/src/net-tools
+ #git-update
+ local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
+ local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
+ local p="${PN}-${pv}"
+ git archive --prefix="${p}/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
+ tar cf - ${p}/ | xz > ${p}.tar.xz
+ popd >/dev/null
+
+ local patches="${p}-patches-${PATCH_VER:-1}"
+ local d="${T}/${patches}"
+ mkdir "${d}"
+ git format-patch -o "${d}" master..gentoo > /dev/null
+ echo "From http://cgit.gentoo.org/proj/net-tools.git" > "${d}"/README
+ tar cf - -C "${T}" ${d##*/} | xz > "${T}"/${patches}.tar.xz
+ rm -rf "${d}"
+
+ du -b "${T}"/*.tar.xz
+}
+
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
+
+set_opt() {
+ local opt=$1 ans
+ shift
+ ans=$("$@" && echo y || echo n)
+ einfo "Setting option ${opt} to ${ans}"
+ sed -i \
+ -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
+ config.in || die
+}
+
+src_prepare() {
+ if [[ -n ${PATCH_VER} ]] ; then
+ use old-output || EPATCH_EXCLUDE="0001-revert-621a2f376334f8097604b9fee5783e0f1141e66d-for-.patch"
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch "${WORKDIR}"/${P}-patches-${PATCH_VER}
+ fi
+}
+
+src_configure() {
+ set_opt I18N use nls
+ set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
+ set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
+ set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
+ set_opt HAVE_SELINUX use selinux
+ if use static ; then
+ append-flags -static
+ append-ldflags -static
+ fi
+ tc-export AR CC
+ yes "" | ./configure.sh config.in || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README README.ipv6 TODO
+}
+
+pkg_postinst() {
+ einfo "etherwake and such have been split into net-misc/ethercard-diag"
+}
diff --git a/sys-apps/net-tools/net-tools-1.60_p20130513023548.ebuild b/sys-apps/net-tools/net-tools-1.60_p20130513023548.ebuild
new file mode 100644
index 000000000000..7670f816592b
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20130513023548.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
+ inherit git-2
+else
+ PATCH_VER="1"
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls old-output selinux static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ selinux? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+maint_pkg_create() {
+ cd /usr/local/src/net-tools
+ #git-update
+ local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
+ local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
+ local p="${PN}-${pv}"
+ git archive --prefix="${p}/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
+ tar cf - ${p}/ | xz > ${p}.tar.xz
+ popd >/dev/null
+
+ local patches="${p}-patches-${PATCH_VER:-1}"
+ local d="${T}/${patches}"
+ mkdir "${d}"
+ git format-patch -o "${d}" master..gentoo > /dev/null
+ echo "From http://cgit.gentoo.org/proj/net-tools.git" > "${d}"/README
+ tar cf - -C "${T}" ${d##*/} | xz > "${T}"/${patches}.tar.xz
+ rm -rf "${d}"
+
+ du -b "${T}"/*.tar.xz
+}
+
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
+
+set_opt() {
+ local opt=$1 ans
+ shift
+ ans=$("$@" && echo y || echo n)
+ einfo "Setting option ${opt} to ${ans}"
+ sed -i \
+ -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
+ config.in || die
+}
+
+src_prepare() {
+ if [[ -n ${PATCH_VER} ]] ; then
+ use old-output || EPATCH_EXCLUDE="0001-revert-621a2f376334f8097604b9fee5783e0f1141e66d-for-.patch"
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch "${WORKDIR}"/${P}-patches-${PATCH_VER}
+ fi
+}
+
+src_configure() {
+ set_opt I18N use nls
+ set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
+ set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
+ set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
+ set_opt SELINUX use selinux
+ if use static ; then
+ append-flags -static
+ append-ldflags -static
+ fi
+ tc-export AR CC
+ yes "" | ./configure.sh config.in || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README README.ipv6 TODO
+}
+
+pkg_postinst() {
+ einfo "etherwake and such have been split into net-misc/ethercard-diag"
+}
diff --git a/sys-apps/net-tools/net-tools-1.60_p20141019041918-r1.ebuild b/sys-apps/net-tools/net-tools-1.60_p20141019041918-r1.ebuild
new file mode 100644
index 000000000000..dc3136881a05
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20141019041918-r1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
+ inherit git-2
+else
+ PATCH_VER="1"
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls old-output selinux static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ selinux? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+maint_pkg_create() {
+ cd /usr/local/src/net-tools
+ #git-update
+ local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
+ local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
+ local p="${PN}-${pv}"
+ git archive --prefix="${p}/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
+ tar cf - ${p}/ | xz > ${p}.tar.xz
+ popd >/dev/null
+
+ local patches="${p}-patches-${PATCH_VER:-1}"
+ local d="${T}/${patches}"
+ mkdir "${d}"
+ git format-patch -o "${d}" master..gentoo > /dev/null
+ echo "From http://cgit.gentoo.org/proj/net-tools.git" > "${d}"/README
+ tar cf - -C "${T}" ${d##*/} | xz > "${T}"/${patches}.tar.xz
+ rm -rf "${d}"
+
+ du -b "${T}"/*.tar.xz
+}
+
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
+
+set_opt() {
+ local opt=$1 ans
+ shift
+ ans=$("$@" && echo y || echo n)
+ einfo "Setting option ${opt} to ${ans}"
+ sed -i \
+ -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
+ config.in || die
+}
+
+src_prepare() {
+ if [[ -n ${PATCH_VER} ]] ; then
+ use old-output || EPATCH_EXCLUDE="0001-revert-621a2f376334f8097604b9fee5783e0f1141e66d-for-.patch"
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch "${WORKDIR}"/${P}-patches-${PATCH_VER}
+ fi
+}
+
+src_configure() {
+ set_opt I18N use nls
+ set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
+ set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
+ set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
+ set_opt HAVE_SELINUX use selinux
+ if use static ; then
+ append-flags -static
+ append-ldflags -static
+ fi
+ tc-export AR CC
+ yes "" | ./configure.sh config.in || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README README.ipv6 TODO
+}
+
+pkg_postinst() {
+ einfo "etherwake and such have been split into net-misc/ethercard-diag"
+}
diff --git a/sys-apps/net-tools/net-tools-1.60_p20141019041918.ebuild b/sys-apps/net-tools/net-tools-1.60_p20141019041918.ebuild
new file mode 100644
index 000000000000..c31d362927a1
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20141019041918.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
+ inherit git-2
+else
+ PATCH_VER="1"
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls old-output selinux static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ selinux? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+maint_pkg_create() {
+ cd /usr/local/src/net-tools
+ #git-update
+ local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
+ local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
+ local p="${PN}-${pv}"
+ git archive --prefix="${p}/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
+ tar cf - ${p}/ | xz > ${p}.tar.xz
+ popd >/dev/null
+
+ local patches="${p}-patches-${PATCH_VER:-1}"
+ local d="${T}/${patches}"
+ mkdir "${d}"
+ git format-patch -o "${d}" master..gentoo > /dev/null
+ echo "From http://cgit.gentoo.org/proj/net-tools.git" > "${d}"/README
+ tar cf - -C "${T}" ${d##*/} | xz > "${T}"/${patches}.tar.xz
+ rm -rf "${d}"
+
+ du -b "${T}"/*.tar.xz
+}
+
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
+
+set_opt() {
+ local opt=$1 ans
+ shift
+ ans=$("$@" && echo y || echo n)
+ einfo "Setting option ${opt} to ${ans}"
+ sed -i \
+ -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
+ config.in || die
+}
+
+src_prepare() {
+ if [[ -n ${PATCH_VER} ]] ; then
+ use old-output || EPATCH_EXCLUDE="0001-revert-621a2f376334f8097604b9fee5783e0f1141e66d-for-.patch"
+ EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" epatch "${WORKDIR}"/${P}-patches-${PATCH_VER}
+ fi
+}
+
+src_configure() {
+ set_opt I18N use nls
+ set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
+ set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
+ set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
+ set_opt SELINUX use selinux
+ if use static ; then
+ append-flags -static
+ append-ldflags -static
+ fi
+ tc-export AR CC
+ yes "" | ./configure.sh config.in || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README README.ipv6 TODO
+}
+
+pkg_postinst() {
+ einfo "etherwake and such have been split into net-misc/ethercard-diag"
+}
diff --git a/sys-apps/net-tools/net-tools-9999.ebuild b/sys-apps/net-tools/net-tools-9999.ebuild
new file mode 100644
index 000000000000..9e95d99f3b5f
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-9999.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools"
+ inherit git-2
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls selinux static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ selinux? ( virtual/pkgconfig )
+ app-arch/xz-utils"
+
+maint_pkg_create() {
+ cd /usr/local/src/net-tools
+ #git-update
+ local stamp=$(date --date="$(git log -n1 --pretty=format:%ci master)" -u +%Y%m%d%H%M%S)
+ local pv="${PV/_p*}_p${stamp}"; pv=${pv/9999/1.60}
+ local p="${PN}-${pv}"
+ git archive --prefix="${p}/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" */Makefile || die
+ tar cf - ${p}/ | xz > ${p}.tar.xz
+ popd >/dev/null
+
+ du -b "${T}"/*.tar.xz
+}
+
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} ]] && maint_pkg_create ; }
+
+set_opt() {
+ local opt=$1 ans
+ shift
+ ans=$("$@" && echo y || echo n)
+ einfo "Setting option ${opt} to ${ans}"
+ sed -i \
+ -e "/^bool.* ${opt} /s:[yn]$:${ans}:" \
+ config.in || die
+}
+
+src_configure() {
+ set_opt I18N use nls
+ set_opt HAVE_HWIB has_version '>=sys-kernel/linux-headers-2.6'
+ set_opt HAVE_HWTR has_version '<sys-kernel/linux-headers-3.5'
+ set_opt HAVE_HWSTRIP has_version '<sys-kernel/linux-headers-3.6'
+ set_opt HAVE_SELINUX use selinux
+ if use static ; then
+ append-flags -static
+ append-ldflags -static
+ fi
+ tc-export AR CC
+ yes "" | ./configure.sh config.in || die
+}
diff --git a/sys-apps/netboot-base/Manifest b/sys-apps/netboot-base/Manifest
new file mode 100644
index 000000000000..57aefa6dbc1a
--- /dev/null
+++ b/sys-apps/netboot-base/Manifest
@@ -0,0 +1 @@
+DIST netboot-base-20050110.tar.bz2 4313 RMD160 1dd44d31d8315c25c0b6545a54dbcd270583fb8e SHA1 fed12df406df215f738ffe087463db3c7626f9f5 SHA256 0b756d457c6ac705548b903a30685860f3403f7389f6325f0460b7603d9d9bf8
diff --git a/sys-apps/netboot-base/metadata.xml b/sys-apps/netboot-base/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/netboot-base/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-apps/netboot-base/netboot-base-20050110.ebuild b/sys-apps/netboot-base/netboot-base-20050110.ebuild
new file mode 100644
index 000000000000..5a3e56379e40
--- /dev/null
+++ b/sys-apps/netboot-base/netboot-base-20050110.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="Baselayout for netboot systems"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI="http://dev.gentoo.org/~vapier/${P}.tar.bz2
+ mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha arm hppa ~mips ppc sh sparc x86"
+IUSE=""
+
+DEPEND=""
+
+S=${WORKDIR}
+
+pkg_setup() {
+ [[ ${ROOT} = "/" ]] && die "refusing to emerge to /"
+}
+
+src_compile() {
+ $(tc-getCC) ${CFLAGS} src/consoletype.c -o sbin/consoletype || die
+ $(tc-getSTRIP) --strip-unneeded sbin/consoletype
+}
+
+src_install() {
+ rm -r src
+ cp -r * "${D}"/ || die
+}
+
+pkg_preinst() {
+ [[ ${ROOT} = "/" ]] && die "refusing to install to /"
+}
+
+pkg_postinst() {
+ cd "${ROOT}"
+ mkdir -p bin dev etc lib mnt proc sbin var
+ mkdir -p var/log
+ mkdir -p mnt/gentoo
+ ln -s . usr
+ ln -s . share
+}
diff --git a/sys-apps/netkit-base/Manifest b/sys-apps/netkit-base/Manifest
new file mode 100644
index 000000000000..568da5e34489
--- /dev/null
+++ b/sys-apps/netkit-base/Manifest
@@ -0,0 +1 @@
+DIST netkit-base-0.17.tar.gz 56473 SHA256 16dd81625ebfc8f5dcb0dfd2e6bac223aad325a9405d66a556fe349446b3c332
diff --git a/sys-apps/netkit-base/files/003_all_netkit-base-0.17-gcc4.patch b/sys-apps/netkit-base/files/003_all_netkit-base-0.17-gcc4.patch
new file mode 100644
index 000000000000..266df811fd77
--- /dev/null
+++ b/sys-apps/netkit-base/files/003_all_netkit-base-0.17-gcc4.patch
@@ -0,0 +1,11 @@
+--- netkit-base-0.17/inetd/servtab.c
++++ netkit-base-0.17/inetd/servtab.c
+@@ -771,7 +771,7 @@
+ return;
+ }
+
+-#define SWAP(type, a, b) {type c=(type)a; (type)a=(type)b; (type)b=(type)c;}
++#define SWAP(type, a, b) {type c=(type)a; a=(type)b; b=(type)c;}
+
+ /*
+ * sep->se_wait may be holding the pid of a daemon
diff --git a/sys-apps/netkit-base/files/004_all_netkit-base-0.17-misc-fixes.patch b/sys-apps/netkit-base/files/004_all_netkit-base-0.17-misc-fixes.patch
new file mode 100644
index 000000000000..9492d715e20f
--- /dev/null
+++ b/sys-apps/netkit-base/files/004_all_netkit-base-0.17-misc-fixes.patch
@@ -0,0 +1,54 @@
+--- netkit-base-0.17/inetd/builtins.c
++++ netkit-base-0.17/inetd/builtins.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <time.h>
+
+ #include "servtab.h"
+ #include "builtins.h"
+--- netkit-base-0.17/inetd/inetd.c
++++ netkit-base-0.17/inetd/inetd.c
+@@ -869,8 +869,8 @@
+ int on = 1;
+
+ if ((sep->se_fd = socket(sep->se_family, sep->se_socktype, 0)) < 0) {
+- syslog(LOG_ERR, "%s: socket: %m", service_name(sep),
+- sep->se_service, sep->se_proto);
++ syslog(LOG_ERR, "%s: socket: %m", service_name(sep));
++/* sep->se_service, sep->se_proto); */
+
+ if (errno == EMFILE) {
+ syslog(LOG_ALERT,
+@@ -888,8 +888,8 @@
+ syslog(LOG_ERR, "setsockopt (SO_REUSEADDR): %m");
+ #undef turnon
+ if (bind(sep->se_fd, &sep->se_ctrladdr, sep->se_ctrladdr_size) < 0) {
+- syslog(LOG_ERR, "%s: bind: %m", service_name(sep),
+- sep->se_service, sep->se_proto);
++ syslog(LOG_ERR, "%s: bind: %m", service_name(sep));
++/* sep->se_service, sep->se_proto); */
+ (void) close(sep->se_fd);
+ sep->se_fd = -1;
+ if (!timingout) {
+@@ -938,8 +938,8 @@
+ }
+ m = sizeof(sn);
+ if (getsockname(sep->se_fd, (struct sockaddr *)&sn, &m) < 0) {
+- syslog(LOG_ERR, "%s: getsockname: %m", service_name(sep),
+- sep->se_service, sep->se_proto);
++ syslog(LOG_ERR, "%s: getsockname: %m", service_name(sep));
++/* sep->se_service, sep->se_proto); */
+ return;
+ }
+
+@@ -1026,7 +1026,7 @@
+ if (rl.rlim_cur <= rlim_ofile_cur) {
+ syslog(LOG_ERR,
+ "bump_nofile: cannot extend file limit, max = %d",
+- rl.rlim_cur);
++ (int)rl.rlim_cur);
+ return -1;
+ }
+
diff --git a/sys-apps/netkit-base/files/005_all_netkit-base-0.17-no-rpc.patch b/sys-apps/netkit-base/files/005_all_netkit-base-0.17-no-rpc.patch
new file mode 100644
index 000000000000..3981b50e76e1
--- /dev/null
+++ b/sys-apps/netkit-base/files/005_all_netkit-base-0.17-no-rpc.patch
@@ -0,0 +1,26 @@
+the rpc logic here isn't terribly useful, so just punt it
+
+http://bugs.gentoo.org/371395
+
+--- a/inetd/inetd.c
++++ b/inetd/inetd.c
+@@ -158,8 +158,8 @@
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_clnt.h>
+ #undef __wait
+-#endif
+ #include <rpc/pmap_clnt.h>
++#endif
+
+ #ifndef MIN
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
+--- a/inetd/inetd.h
++++ b/inetd/inetd.h
+@@ -4,7 +4,6 @@
+
+ #define RETRYTIME (60*10) /* retry time after bind/server fail */
+
+-#define RPC /* Use SunRPC */
+
+
+ /* globals */
diff --git a/sys-apps/netkit-base/files/inetd.rc6 b/sys-apps/netkit-base/files/inetd.rc6
new file mode 100644
index 000000000000..652362507fc3
--- /dev/null
+++ b/sys-apps/netkit-base/files/inetd.rc6
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting inetd"
+ (
+ # workaround for #25754
+ unset -f `declare -F | sed 's:declare -f::g'`
+ start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
+ )
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping inetd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/inetd.pid
+ eend $?
+}
diff --git a/sys-apps/netkit-base/metadata.xml b/sys-apps/netkit-base/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/netkit-base/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-apps/netkit-base/netkit-base-0.17-r9.ebuild b/sys-apps/netkit-base/netkit-base-0.17-r9.ebuild
new file mode 100644
index 000000000000..f40d8f0ce8ea
--- /dev/null
+++ b/sys-apps/netkit-base/netkit-base-0.17-r9.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Old-style inetd"
+HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/"
+SRC_URI="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 sparc x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/*.patch
+}
+
+src_configure() {
+ tc-export CC
+ ./configure || die
+ sed -i \
+ -e "/^CFLAGS=/s:=.*:=${CFLAGS} -Wall -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline:" \
+ -e "/^LDFLAGS=/s:=.*:=${LDFLAGS}:" \
+ MCONFIG || die
+}
+
+src_install() {
+ sed -i \
+ -e 's:in\.telnetd$:in.telnetd -L /usr/sbin/telnetlogin:' \
+ etc.sample/inetd.conf
+
+ dosbin inetd/inetd
+ doman inetd/inetd.8
+ newinitd "${FILESDIR}"/inetd.rc6 inetd
+
+ dodoc BUGS ChangeLog README
+ docinto samples
+ dodoc etc.sample/*
+}
diff --git a/sys-apps/netloc/Manifest b/sys-apps/netloc/Manifest
new file mode 100644
index 000000000000..3d0b16f4d4ef
--- /dev/null
+++ b/sys-apps/netloc/Manifest
@@ -0,0 +1 @@
+DIST netloc-0.5.tar.gz 474646 SHA256 41a8d31097b9aeabff89596b42bd3d4590f6b7552378a0fc80ec7a02823c5d1a SHA512 88600c59302cd8e5ed024373a57b27e54b288288091ed0ab3852bee59c255a8b520d38c59d64f6c1eafe307f0d5e61d64c799a92e9695c42ecc1e33dcc2df6ba WHIRLPOOL d83dbe17bcea2c083ded5c364e344b904799fd6405a38e52318d9d88f041ee47b50383fd038003b2e558b36577544779c118c509de29cc1e2027314cf3b8b8b1
diff --git a/sys-apps/netloc/metadata.xml b/sys-apps/netloc/metadata.xml
new file mode 100644
index 000000000000..91d88c8a551c
--- /dev/null
+++ b/sys-apps/netloc/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>
+<longdescription>
+ The Portable Network Locality (netloc) software package provides network topology discovery tools, and an abstract representation of those networks topologies for a range of network types and configurations. It is provided as a companion to the Portable Hardware Locality (hwloc) package. These two software packages work together to provide a comprehensive view of the HPC system topology, spanning from the processor cores in one server to the cores in another – including the complex network(s) in between.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/netloc/netloc-0.5.ebuild b/sys-apps/netloc/netloc-0.5.ebuild
new file mode 100644
index 000000000000..8334b28a948d
--- /dev/null
+++ b/sys-apps/netloc/netloc-0.5.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 multilib versionator
+
+MY_PV=v$(get_version_component_range 1-2)
+
+DESCRIPTION="Portable Network Locality (netloc)"
+HOMEPAGE="http://www.open-mpi.org/projects/netloc/"
+SRC_URI="http://www.open-mpi.org/software/${PN}/${MY_PV}/downloads/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="
+ dev-libs/jansson
+ sys-apps/hwloc"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ econf \
+ --with-jansson="${EPREFIX}/usr" \
+ --with-hwloc="${EPREFIX}/usr"
+}
diff --git a/sys-apps/netplug/Manifest b/sys-apps/netplug/Manifest
new file mode 100644
index 000000000000..ebf69a0f3b6f
--- /dev/null
+++ b/sys-apps/netplug/Manifest
@@ -0,0 +1 @@
+DIST netplug-1.2.9.2.tar.bz2 22332 SHA256 5180dfd9a7d3d0633a027b0a04f01b45a6a64623813cd48bd54423b90814864e SHA512 b68a00eb8874ec7dd6aa9f7b7f529a6e1d9ecece4b798c8cee996b7f3534c556656f642de0ac4b2a6d06fbaf18e3bfaab00934a9292b95939a4935e673e9ca8c WHIRLPOOL 51d54d4c7784b82b71b3a8964c9df3f17e8df1b21b11a95250f911c6f0917aabab1bf0fe5117884623b3222b1df0c443ce4416ad74f63c0d761f762e5f39216f
diff --git a/sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch b/sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch
new file mode 100644
index 000000000000..de5cba2cb08d
--- /dev/null
+++ b/sys-apps/netplug/files/netplug-1.2.9-ignore-wireless.patch
@@ -0,0 +1,37 @@
+--- netplug-1.2.9/main.c
++++ netplug-1.2.9/main.c
+@@ -36,6 +36,10 @@
+
+ #include "netplug.h"
+
++/* Support old kernels without wireless */
++#ifndef IFLA_WIRELESS
++#define IFLA_WIRELESS (IFLA_MASTER + 1)
++#endif /* IFLA_WIRELESS */
+
+ int use_syslog;
+ static char *pid_file;
+@@ -63,6 +67,14 @@
+
+ parse_rtattrs(attrs, IFLA_MAX, IFLA_RTA(info), len);
+
++ /* Ignore wireless messages */
++ if (attrs[IFLA_WIRELESS] != NULL
++ && hdr->nlmsg_type == RTM_NEWLINK
++ && info->ifi_change == 0) {
++ do_log(LOG_DEBUG, "Ignoring wireless netlink message");
++ return 0;
++ }
++
+ if (attrs[IFLA_IFNAME] == NULL) {
+ do_log(LOG_ERR, "No interface name");
+ return -1;
+@@ -71,7 +83,7 @@
+ char *name = RTA_DATA(attrs[IFLA_IFNAME]);
+
+ if (!if_match(name)) {
+- do_log(LOG_INFO, "%s: ignoring event", name);
++ do_log(LOG_DEBUG, "%s: ignoring event", name);
+ return 0;
+ }
+
diff --git a/sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch b/sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch
new file mode 100644
index 000000000000..0a3b991a82bf
--- /dev/null
+++ b/sys-apps/netplug/files/netplug-1.2.9-remove-nest.patch
@@ -0,0 +1,187 @@
+This patch replaces the for_each_iface nested funtion with a macro so that we
+don't have an executable stack and work correctly on NX capable hardware.
+See http://www.gentoo.org/proj/en/hardened/gnu-stack.xml for more information.
+
+Patch by Diego Pettenò (flameeyes@gentoo.org)
+
+Index: netplug-1.2.9/if_info.c
+===================================================================
+--- netplug-1.2.9.orig/if_info.c
++++ netplug-1.2.9/if_info.c
+@@ -29,8 +29,7 @@
+
+ #include "netplug.h"
+
+-#define INFOHASHSZ 16 /* must be a power of 2 */
+-static struct if_info *if_info[INFOHASHSZ];
++struct if_info *if_info[INFOHASHSZ];
+
+ static const char *
+ statename(enum ifstate s)
+@@ -95,17 +94,6 @@ flags_str(char *buf, unsigned int fl)
+ return buf;
+ }
+
+-void
+-for_each_iface(int (*func)(struct if_info *))
+-{
+- for(int i = 0; i < INFOHASHSZ; i++) {
+- for(struct if_info *info = if_info[i]; info != NULL; info = info->next) {
+- if ((*func)(info))
+- return;
+- }
+- }
+-}
+-
+ /* Reevaluate the state machine based on the current state and flag settings */
+ void
+ ifsm_flagpoll(struct if_info *info)
+@@ -284,6 +272,14 @@ ifsm_flagchange(struct if_info *info, un
+ info->lastchange = time(0);
+ }
+
++int find_pid(struct if_info *i, pid_t pid, struct if_info **info) {
++ if (i->worker == pid) {
++ *info = i;
++ return 1;
++ }
++ return 0;
++}
++
+ /* handle a script termination and update the state accordingly */
+ void ifsm_scriptdone(pid_t pid, int exitstatus)
+ {
+@@ -291,16 +287,8 @@ void ifsm_scriptdone(pid_t pid, int exit
+ struct if_info *info;
+ assert(WIFEXITED(exitstatus) || WIFSIGNALED(exitstatus));
+
+- int find_pid(struct if_info *i) {
+- if (i->worker == pid) {
+- info = i;
+- return 1;
+- }
+- return 0;
+- }
+-
+ info = NULL;
+- for_each_iface(find_pid);
++ for_each_iface(find_pid, pid, &info);
+
+ if (info == NULL) {
+ do_log(LOG_INFO, "Unexpected child %d exited with status %d",
+Index: netplug-1.2.9/main.c
+===================================================================
+--- netplug-1.2.9.orig/main.c
++++ netplug-1.2.9/main.c
+@@ -164,6 +164,23 @@ child_handler(int sig, siginfo_t *info,
+ write(child_handler_pipe[1], &ce, sizeof(ce));
+ }
+
++int pollflags_state(struct if_info *info, int sockfd) {
++ struct ifreq ifr;
++
++ if (!if_match(info->name))
++ return 0;
++
++ memcpy(ifr.ifr_name, info->name, sizeof(ifr.ifr_name));
++ if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0)
++ do_log(LOG_ERR, "%s: can't get flags: %m", info->name);
++ else {
++ ifsm_flagchange(info, ifr.ifr_flags);
++ ifsm_flagpoll(info);
++ }
++
++ return 0;
++}
++
+ /* Poll the existing interface state, so we can catch any state
+ changes for which we may not have neen a netlink message. */
+ static void
+@@ -180,28 +197,20 @@ poll_interfaces(void)
+ close_on_exec(sockfd);
+ }
+
+- int pollflags(struct if_info *info) {
+- struct ifreq ifr;
+-
+- if (!if_match(info->name))
+- return 0;
+-
+- memcpy(ifr.ifr_name, info->name, sizeof(ifr.ifr_name));
+- if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0)
+- do_log(LOG_ERR, "%s: can't get flags: %m", info->name);
+- else {
+- ifsm_flagchange(info, ifr.ifr_flags);
+- ifsm_flagpoll(info);
+- }
+-
+- return 0;
+- }
+-
+- for_each_iface(pollflags);
++ for_each_iface(pollflags_state, sockfd);
+ }
+
+ int debug = 0;
+
++/* Run over each of the interfaces we know and care about, and
++ make sure the state machine has done the appropriate thing
++ for their current state. */
++int poll_flags_check(struct if_info *i) {
++ if (if_match(i->name))
++ ifsm_flagpoll(i);
++ return 0;
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+@@ -331,17 +340,7 @@ main(int argc, char *argv[])
+ { child_handler_pipe[0], POLLIN, 0 },
+ };
+
+- {
+- /* Run over each of the interfaces we know and care about, and
+- make sure the state machine has done the appropriate thing
+- for their current state. */
+- int poll_flags(struct if_info *i) {
+- if (if_match(i->name))
+- ifsm_flagpoll(i);
+- return 0;
+- }
+- for_each_iface(poll_flags);
+- }
++ for_each_iface(poll_flags_check);
+
+ for(;;) {
+ int ret;
+Index: netplug-1.2.9/netplug.h
+===================================================================
+--- netplug-1.2.9.orig/netplug.h
++++ netplug-1.2.9/netplug.h
+@@ -28,6 +28,9 @@
+
+ #define NP_SCRIPT NP_SCRIPT_DIR "/netplug"
+
++#define INFOHASHSZ 16 /* must be a power of 2 */
++extern struct if_info *if_info[INFOHASHSZ];
++
+ /* configuration */
+
+ void read_config(char *filename);
+@@ -83,7 +86,14 @@ struct if_info *if_info_update_interface
+ struct rtattr *attrs[]);
+ int if_info_save_interface(struct nlmsghdr *hdr, void *arg);
+ void parse_rtattrs(struct rtattr *tb[], int max, struct rtattr *rta, int len);
+-void for_each_iface(int (*func)(struct if_info *));
++
++#define for_each_iface(func, ...) \
++ for(int i = 0; i < INFOHASHSZ; i++) { \
++ for(struct if_info *each_iface = if_info[i]; each_iface != NULL; each_iface = each_iface->next) { \
++ if (func (each_iface, ##__VA_ARGS__)) \
++ break; \
++ } \
++ }
+
+ void ifsm_flagpoll(struct if_info *info);
+ void ifsm_flagchange(struct if_info *info, unsigned int newflags);
diff --git a/sys-apps/netplug/files/netplug-2 b/sys-apps/netplug/files/netplug-2
new file mode 100755
index 000000000000..539f1465516a
--- /dev/null
+++ b/sys-apps/netplug/files/netplug-2
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# Gentoo-specific netplug script
+#
+# This file gets called by netplug when it wants to bring an interface
+# up or down.
+#
+
+IFACE="$1"
+ACTION="$2"
+
+EXEC="/etc/init.d/net.${IFACE}"
+
+case "${ACTION}" in
+ in)
+ ARGS="--quiet start"
+ ;;
+ out)
+ ARGS="--quiet stop"
+ ;;
+ probe)
+ # Do nothing as we should already be up
+ exit 0
+ ;;
+ *)
+ echo "$0: wrong arguments" >&2
+ echo "Call with <interface> <in|out|probe>" >&2
+ exit 1
+ ;;
+esac
+
+export IN_BACKGROUND=true
+
+if [ -x "${EXEC}" ]
+then
+ ${EXEC} ${ARGS}
+ exit 0
+else
+ logger -t netplug "Error: Couldn't configure ${IFACE}, no ${EXEC} !"
+ exit 1
+fi
diff --git a/sys-apps/netplug/metadata.xml b/sys-apps/netplug/metadata.xml
new file mode 100644
index 000000000000..786355e6ed0d
--- /dev/null
+++ b/sys-apps/netplug/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>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <longdescription lang="en">
+ Brings up/down ethernet ports automatically with cable detection
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/netplug/netplug-1.2.9.2-r1.ebuild b/sys-apps/netplug/netplug-1.2.9.2-r1.ebuild
new file mode 100644
index 000000000000..03d4dada07aa
--- /dev/null
+++ b/sys-apps/netplug/netplug-1.2.9.2-r1.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 eutils toolchain-funcs
+
+DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
+HOMEPAGE="http://www.red-bean.com/~bos/"
+SRC_URI="http://www.red-bean.com/~bos/netplug/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc sparc x86"
+IUSE="debug doc"
+
+DEPEND="doc? ( app-text/ghostscript-gpl
+ media-gfx/graphviz )"
+RDEPEND=""
+
+src_prepare() {
+ # Remove debug flags from CFLAGS
+ if ! use debug; then
+ sed -i -e "s/ -ggdb3//" Makefile || die
+ fi
+
+ # Remove -O3 and -Werror from CFLAGS
+ sed -i -e "s/ -O3//" -e "s/ -Werror//" Makefile || die
+
+ # Remove nested functions, #116140
+ epatch "${FILESDIR}/${PN}-1.2.9-remove-nest.patch"
+
+ # Ignore wireless events
+ epatch "${FILESDIR}/${PN}-1.2.9-ignore-wireless.patch"
+}
+
+src_compile() {
+ tc-export CC
+ emake CC="${CC}"
+
+ if use doc; then
+ emake -C docs/
+ fi
+}
+
+src_install() {
+ into /
+ dosbin netplugd
+ doman man/man8/netplugd.8
+
+ dodir /etc/netplug.d
+ exeinto /etc/netplug.d
+ newexe "${FILESDIR}/netplug-2" netplug
+
+ dodir /etc/netplug
+ echo "eth*" > "${D}"/etc/netplug/netplugd.conf || die
+
+ dodoc ChangeLog NEWS README TODO
+
+ if use doc; then
+ dodoc docs/state-machine.ps
+ fi
+}
diff --git a/sys-apps/newrelic-sysmond/Manifest b/sys-apps/newrelic-sysmond/Manifest
new file mode 100644
index 000000000000..7950ed38dcdc
--- /dev/null
+++ b/sys-apps/newrelic-sysmond/Manifest
@@ -0,0 +1 @@
+DIST newrelic-sysmond-1.1.2.124-linux.tar.gz 2177939 SHA256 b77424b5dd98d38537503cfe49d772e9a8c220f436d87682010f03b5d3950b46 SHA512 beda4b9c3fc089a9cd836790a074f886a65980ee7b471d9e5fb54f56f369ef69172f00661962ae57482f2bffbc84bb27f9484dc01ca7b6a3b5d9a4ad7cf8c4b6 WHIRLPOOL 4ab79112c13f7fd00c28f0237ea6453694cf01d5d1ca9c145d4ffc6d152306febfb5108cb8a692b7a3c0906b0b957fbd115b998ca91adf3140f7a059bd6e9f0a
diff --git a/sys-apps/newrelic-sysmond/files/newrelic-sysmond.rc b/sys-apps/newrelic-sysmond/files/newrelic-sysmond.rc
new file mode 100644
index 000000000000..20b7d1d6ca15
--- /dev/null
+++ b/sys-apps/newrelic-sysmond/files/newrelic-sysmond.rc
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting NewRelic System Monitor"
+ start-stop-daemon --start \
+ --user newrelic \
+ --exec /usr/sbin/nrsysmond -- \
+ -c /etc/newrelic/nrsysmond.cfg \
+ -p /var/run/newrelic/nrsysmond.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping NewRelic System Monitor"
+ start-stop-daemon --stop --pidfile /var/run/newrelic/nrsysmond.pid
+ eend $?
+}
diff --git a/sys-apps/newrelic-sysmond/metadata.xml b/sys-apps/newrelic-sysmond/metadata.xml
new file mode 100644
index 000000000000..4b139df1fa91
--- /dev/null
+++ b/sys-apps/newrelic-sysmond/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>
+ </maintainer>
+ <longdescription>NewRelic System Monitor</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/newrelic-sysmond/newrelic-sysmond-1.1.2.124.ebuild b/sys-apps/newrelic-sysmond/newrelic-sysmond-1.1.2.124.ebuild
new file mode 100644
index 000000000000..33d232cdae3b
--- /dev/null
+++ b/sys-apps/newrelic-sysmond/newrelic-sysmond-1.1.2.124.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit user
+
+DESCRIPTION="NewRelic System Monitor"
+HOMEPAGE="http://www.newrelic.com/"
+SRC_URI="http://download.newrelic.com/server_monitor/release/${P}-linux.tar.gz"
+
+LICENSE="newrelic Apache-2.0 MIT ISC openssl GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+RESTRICT="strip"
+
+S="${WORKDIR}/${P}-linux"
+
+pkg_setup() {
+ enewgroup newrelic
+ enewuser newrelic -1 -1 -1 newrelic
+}
+
+src_install() {
+ if [[ "${ARCH}" == "amd64" ]]; then
+ NR_ARCH="x64"
+ elif [[ "${ARCH}" == "x86" ]]; then
+ NR_ARCH="x86"
+ else
+ die "Unsupported architecture (${ARCH})"
+ fi
+
+ dosbin "scripts/nrsysmond-config"
+ newsbin "daemon/nrsysmond.${NR_ARCH}" "nrsysmond"
+ newinitd "${FILESDIR}/newrelic-sysmond.rc" "newrelic-sysmond"
+
+ keepdir "/etc/newrelic"
+ insinto "/etc/newrelic"
+ doins nrsysmond.cfg
+
+ keepdir "/var/run/newrelic"
+ fowners newrelic.newrelic "/var/run/newrelic"
+ fperms 0775 "/var/run/newrelic"
+
+ keepdir "/var/log/newrelic"
+ fowners newrelic.newrelic "/var/log/newrelic"
+ fperms 0775 "/var/log/newrelic"
+
+ dodoc INSTALL.txt LICENSE.txt
+}
+
+pkg_postinst() {
+ elog "Remember to set your license key via:"
+ elog "$ nrsysmond-config --set license_key=\$YOUR_KEY"
+}
diff --git a/sys-apps/noexec/Manifest b/sys-apps/noexec/Manifest
new file mode 100644
index 000000000000..ad9f29acc96b
--- /dev/null
+++ b/sys-apps/noexec/Manifest
@@ -0,0 +1 @@
+DIST noexec-1.1.0.tar.gz 157097 SHA256 452744d3221cefe15b7d22560526d611923ad13fbfc1796486c3af37d8d09a51
diff --git a/sys-apps/noexec/metadata.xml b/sys-apps/noexec/metadata.xml
new file mode 100644
index 000000000000..3c9f4a4bc12b
--- /dev/null
+++ b/sys-apps/noexec/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">noexec</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/noexec/noexec-1.1.0.ebuild b/sys-apps/noexec/noexec-1.1.0.ebuild
new file mode 100644
index 000000000000..197fa74336ab
--- /dev/null
+++ b/sys-apps/noexec/noexec-1.1.0.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="a package for preventing processes from using exec system calls"
+HOMEPAGE="http://noexec.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ppc x86"
+IUSE=""
+
+DEPEND=">=sys-libs/glibc-2.3.2-r9"
+
+src_install() {
+ make install DESTDIR=${D} || die "installation failed"
+ dodoc AUTHORS BUGS ChangeLog NEWS README
+}
diff --git a/sys-apps/openrc/Manifest b/sys-apps/openrc/Manifest
new file mode 100644
index 000000000000..e065e97686a0
--- /dev/null
+++ b/sys-apps/openrc/Manifest
@@ -0,0 +1,10 @@
+DIST openrc-0.13.11.tar.bz2 150680 SHA256 30edffa8b39d5e68129ddd9e8cd8dfde8ca8cfafc8b470124d7323a32a4a443c SHA512 1dd9d86f5f2f13e196d2724b978c0aaabf7a73c487bf2f8f759d82c856faa754b612d5252dacedb042ba308ff7e9a745dea88b78654a693c39f5d720f0f92ada WHIRLPOOL 2849260c60811e88467b2d0916afa37bc4c7a6e2159abf70a2f5bad2cf97586b801993f45ed86145dfecbc93166298c6302a78602bbfe1957d2f159a3cde11dc
+DIST openrc-0.14.tar.bz2 155903 SHA256 fc7144811cd84b7a0d3786120e98cdd8c8ea31040f4665be67dac6da4fb8c6aa SHA512 44ead70f7a254d6f789090d09d03d931beb3ebce8e204feae5054d87921453aa6e8182c8f1f1cac0977ab0723d2a9cc0c09c482136c244d626ce32ea89e0bee4 WHIRLPOOL 4dfd551f4e94f50d1feed5a3157b9de36b4d8a0ab30dd886c864df3e273009f561e2048c8f077c6518caac09b44ac1b963a5b514beaa8a8699724598142b0352
+DIST openrc-0.15.1.tar.bz2 156774 SHA256 b125e0a9b54f7829b19529fe6d90005dfd2c01b4f96da3b03847b34d6dc77cac SHA512 287759e0b0deffb7698bb9e1ad82279504ad1f2d2e5333660a83b66618e2b807c98c2d6289c455f2137f2de09028147722c1c757c6afe12e49cc16ef8d86144f WHIRLPOOL 19d5af87296436a776aeffe8bab09d48bc90f40a1b08412c06a01231608296a11e17ff6bd1c04462d5c8fa405fd4336269d3db2e9678443dac8c67982f61ba94
+DIST openrc-0.15.tar.bz2 156099 SHA256 157c58ce1ff83b79a4063c44958c8070b15c9700fb7454827c8515091c3abeb6 SHA512 938e2688c865b0c0886273eb987a9289e74ef7f0ec93aef0a3ec51111b11e0ddb6afd9c752fba08f6a5e2d089d783e0e6a40d978cd0f104449d6c333dbe79e87 WHIRLPOOL d7872a266570d4ef76a564619e57070a18e1286233417e8cf78e8a7f35f8073bfbd7b85c94f5331f8647fc395d4f32b8256ec934dbe18f1b4642c50a42a342b0
+DIST openrc-0.16.1.tar.bz2 158448 SHA256 0654d88b5789abf0ada04548058edf1fc9ba61f16f063bc061bb720e20d7989a SHA512 4e197d2b6d46a15ebf7bf7ffcd1ec7711fec43a9243ad852d3a3d04f5a978045b8f0e58806b4428fe310be0e069654c13d49713754ff5306c2b4637ae31f2028 WHIRLPOOL 58c455d734ec7562a17571a8e5adeb71d63c58ca932dccafd3474c16551220ed2715dfe1cb481f02e221bc26e206704f081df50562e0e62e0f84007714bffe51
+DIST openrc-0.16.2.tar.bz2 158753 SHA256 77b2c0f435b457a7f40fb607ee5bbf6fccd93362580d07bc96ef692cc7ddac46 SHA512 baf3b00b4fb3e418e2863b09a40dd722cbcc52e3381dc08acc0876984881b2cbeb70a078cc697bffbdaaa8d268d457efd3ce72a4e122be3ec74f3138fec0e936 WHIRLPOOL 708d949cbe99ca6e879c657f884d2b4f2e3455352c7daca3e2a3449b1a2f972fe2e371a4b38bed929471080c59f2715c07d7f1d4ea686051e30b17b6a20699e8
+DIST openrc-0.16.3.tar.bz2 158844 SHA256 6f2d5293f82591183391362fdbcb6b24b6a07c74f9e565db6d0ebf77189e5262 SHA512 1c41edf7e061947895a260dc5a4cf856af5ac62ef41d3b7c6bb1eef09bc5bfb3f9e4d0957cabad635068db18286658843b3ad02e2831b63f5a2957246736e337 WHIRLPOOL ff4c147b566077e55386c1ef386d3659bcc8ce8a2211ba4961468039cf9b4b2088cab606934db4e378eb10a96f46bec35f0a46ec069c942ad42167ceb1776385
+DIST openrc-0.16.4.tar.bz2 158599 SHA256 6771257e208da2e4d20b4ac2e3e7f065eb8873566644ff385e9dbd6bc5221d21 SHA512 8ade50cdb8c2e05e00e917f848e96bfee54bb4ac77bf50af8c5ab66e2e01f8a5c2621123087945feaa9b15ad84a5936e23cc489a2bb7127c2b118a5a0695ee6e WHIRLPOOL 706d7b1101927ff89afb01ad766f491db94ff04f574bc7b69349b6ab0334ed5d2cd5ee2d8041cf5a0ba00f5a6a3596502835fa132c668533772a42737f0e2412
+DIST openrc-0.16.tar.bz2 157924 SHA256 969ce450bb095a406ef14362572633b14c8696b57d67361394c5951704273ce3 SHA512 3ff3958bf480ec6bf97e50c8911c382dc855322a74d57b65da975e98d8b76debda971826d15803be96f2ae9c7fd5ebf4cf0c43013663a042224a9c49377614f8 WHIRLPOOL 5e6bb11b907a2fe3812653354950b0ec4e13571981580d03d2ee9b93dc8a68ce128ee1ec7560557adbc90af44aa881648aae51e15bb0f0990ca338ffb3c6c814
+DIST openrc-0.17.tar.bz2 160533 SHA256 45818d9ef4659e8dd924a1468a091255c305daee5417f94d9515f0e125298b30 SHA512 6e69b036d113f066b0dd0bfe55e019328e0e77cff6c93f0a3e55751aa0a72411aa3b1efe8b4327e156a9612e4155863b0a81c9eda043c12904bb36e861b71399 WHIRLPOOL de45daf6f4aebe632ea9fcb46408e63f0aed6c9b9129fb5510f348f20cf1c62aa42e7dce47a7f19a441696596fa57494642e7334a42c415fdbc865cb80a18eff
diff --git a/sys-apps/openrc/files/openrc-0.8.3-ccwgroup.patch b/sys-apps/openrc/files/openrc-0.8.3-ccwgroup.patch
new file mode 100644
index 000000000000..14ecd5f837d2
--- /dev/null
+++ b/sys-apps/openrc/files/openrc-0.8.3-ccwgroup.patch
@@ -0,0 +1,57 @@
+From c427d3c1fec89f6a9281dccdc123bad73af80804 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 28 Jun 2011 00:02:11 -0400
+Subject: [PATCH] net: ccwgroup: smooth up/down process
+
+We need to bring the link up ourselves after we've properly configured
+the device. The common code tries to bring the link up itself, but it
+does so before things are configured, and so it ends up failing.
+
+When shutting down, we need to wait for the kernel to finish destroying
+the interface. Otherwise, when doing a restart, openrc is quick enough
+to tell the kernel to destroy things, but then start trying to bring it
+back up before the kernel has finished.
+
+X-Gentoo-Bug: 367467
+X-Gentoo-Bug-URL: http://bugs.gentoo.org/367467
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ net/ccwgroup.sh | 14 ++++++++++++--
+ 1 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/net/ccwgroup.sh b/net/ccwgroup.sh
+index 248b159..60cd25f 100644
+--- a/net/ccwgroup.sh
++++ b/net/ccwgroup.sh
+@@ -58,6 +58,11 @@ ccwgroup_pre_start()
+ echo "${val}" > /sys/devices/${ccw_type}/${first}/${var}
+ done
+ eend $?
++
++ # Now that we've properly configured the device, we can run
++ # bring the interface up. Common code tried to do this already,
++ # but it failed because we didn't setup sysfs yet.
++ _up
+ }
+
+ ccwgroup_pre_stop()
+@@ -88,9 +93,14 @@ ccwgroup_post_stop()
+ local device="$(service_get_value ccwgroup_device)"
+ [ -z "${device}" ] && return 0
+ local ccw_type="$(service_get_value ccwgroup_type)"
++ local path="/sys/devices/${ccw_type}/${device}"
+
+ einfo "Disabling ccwgroup/${ccw_type} on ${IFACE}"
+- echo "0" >/sys/devices/${ccw_type}/"${device}"/online
+- echo "1" >/sys/devices/${ccw_type}/"${device}"/ungroup
++ if echo "0" >"${path}"/online &&
++ echo "1" >"${path}"/ungroup ; then
++ # The device doesn't disappear right away which breaks
++ # restart, or a quick start up, so wait around.
++ while [ -e "${path}" ] ; do :; done
++ fi
+ eend $?
+ }
+--
+1.7.5.3
+
diff --git a/sys-apps/openrc/files/openrc-0.8.3-deprecation_warning.patch b/sys-apps/openrc/files/openrc-0.8.3-deprecation_warning.patch
new file mode 100644
index 000000000000..1aa7315b0b12
--- /dev/null
+++ b/sys-apps/openrc/files/openrc-0.8.3-deprecation_warning.patch
@@ -0,0 +1,33 @@
+From 24ba7955634dd571a4c34dd712dc8a592eea4d73 Mon Sep 17 00:00:00 2001
+From: Joe Harvell <jharvell@dogpad.net>
+Date: Mon, 27 Jun 2011 23:20:47 +0200
+Subject: [PATCH] Only print the deprecation warning for --chuid/-c when using it
+
+The deprecation warning has been printed when using the replecement functions as
+well, bug 373243.
+---
+ src/rc/start-stop-daemon.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
+index b5c2b6e..3017701 100644
+--- a/src/rc/start-stop-daemon.c
++++ b/src/rc/start-stop-daemon.c
+@@ -788,12 +788,11 @@ start_stop_daemon(int argc, char **argv)
+ background = true;
+ break;
+
+- case 'u': /* --user <username>|<uid> */
+ case 'c': /* --chuid <username>|<uid> */
+- {
+ /* DEPRECATED */
+ ewarn("WARNING: -c/--chuid is deprecated and will be removed in the future, please use -u/--user instead");
+-
++ case 'u': /* --user <username>|<uid> */
++ {
+ p = optarg;
+ tmp = strsep(&p, ":");
+ changeuser = xstrdup(tmp);
+--
+1.7.3.4
+
diff --git a/sys-apps/openrc/files/openrc-9999-msg-style.patch b/sys-apps/openrc/files/openrc-9999-msg-style.patch
new file mode 100644
index 000000000000..ac325bb79bcf
--- /dev/null
+++ b/sys-apps/openrc/files/openrc-9999-msg-style.patch
@@ -0,0 +1,81 @@
+From 1e307244138c8f650ab37bffa7b3cc3e3b39cd64 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 24 Mar 2008 01:48:19 -0400
+Subject: [PATCH] restore old e* func output
+
+Gentoo has always used the sytle:
+ * moo ... [ ok ]
+Latest openrc now does:
+* moo... [ok]
+
+Realistically, 4 spaces out of 80 on reduced terminals doesn't make any
+sort of realistic difference and it's been just fine for the last 10
+years, so keep the default behavior.
+---
+ src/libeinfo/libeinfo.c | 15 ++++++---------
+ 1 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
+index 8a7613c..234b1af 100644
+--- a/src/libeinfo/libeinfo.c
++++ b/src/libeinfo/libeinfo.c
+@@ -643,7 +643,7 @@ static int EINFO_PRINTF(3, 0)
+ fprintf(f, "\n");
+ if (_eprefix)
+ fprintf(f, "%s%s%s|", _ecolor(f, color), _eprefix, _ecolor(f, ECOLOR_NORMAL));
+- fprintf(f, "%s*%s ", _ecolor(f, color), _ecolor(f, ECOLOR_NORMAL));
++ fprintf(f, " %s*%s ", _ecolor(f, color), _ecolor(f, ECOLOR_NORMAL));
+ retval += _eindent(f);
+ va_copy(ap, va);
+ retval += vfprintf(f, fmt, ap) + 3;
+@@ -800,7 +800,7 @@ ebegin(const char *EINFO_RESTRICT fmt, ...)
+ va_start(ap, fmt);
+ retval = _einfovn(fmt, ap);
+ va_end(ap);
+- retval += printf("...");
++ retval += printf(" ...");
+ if (colour_terminal(stdout))
+ retval += printf("\n");
+ LASTCMD("ebegin");
+@@ -817,7 +817,7 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
+ if (!msg)
+ return;
+
+- cols = get_term_columns(fp) - (strlen(msg) + 3);
++ cols = get_term_columns(fp) - (strlen(msg) + 5);
+
+ /* cons25 is special - we need to remove one char, otherwise things
+ * do not align properly at all. */
+@@ -831,18 +831,15 @@ _eend(FILE * EINFO_RESTRICT fp, int col, ECOLOR color, const char *msg)
+ if (term_is_cons25)
+ cols--;
+
+- /* If extra spacing is required around msg, then please change
+- * via a runtime knob and leave this default as is as it saves 2
+- * valuable columns when running on 80 column screens. */
+ if (cols > 0 && colour_terminal(fp)) {
+- fprintf(fp, "%s%s %s[%s%s%s]%s\n", up, tgoto(goto_column, 0, cols),
++ fprintf(fp, "%s%s %s[%s %s %s]%s\n", up, tgoto(goto_column, 0, cols),
+ ecolor(ECOLOR_BRACKET), ecolor(color), msg,
+ ecolor(ECOLOR_BRACKET), ecolor(ECOLOR_NORMAL));
+ } else {
+ if (col > 0)
+ for (i = 0; i < cols - col; i++)
+ fprintf(fp, " ");
+- fprintf(fp, " [%s]\n", msg);
++ fprintf(fp, " [ %s ]\n", msg);
+ }
+ }
+
+@@ -1030,7 +1027,7 @@ ebeginv(const char *EINFO_RESTRICT fmt, ...)
+
+ va_start(ap, fmt);
+ retval = _einfovn(fmt, ap);
+- retval += printf("...");
++ retval += printf(" ...");
+ if (colour_terminal(stdout))
+ retval += printf("\n");
+ va_end(ap);
+--
+1.6.6.rc3
+
diff --git a/sys-apps/openrc/files/openrc-9999-pause.patch b/sys-apps/openrc/files/openrc-9999-pause.patch
new file mode 100644
index 000000000000..bf2c94f8dbec
--- /dev/null
+++ b/sys-apps/openrc/files/openrc-9999-pause.patch
@@ -0,0 +1,29 @@
+From e82772a6b6d4374e81b7e19a593ffdef16753418 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 21 Dec 2009 09:02:35 -0500
+Subject: [PATCH] restore init.d pause option
+
+---
+ src/rc/runscript.c | 6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/src/rc/runscript.c b/src/rc/runscript.c
+index 5939dae..7147902 100644
+--- a/src/rc/runscript.c
++++ b/src/rc/runscript.c
+@@ -1316,6 +1316,12 @@ runscript(int argc, char **argv)
+ prefix = NULL;
+ retval = svc_exec("status", NULL);
+ } else {
++ if (strcmp(optarg, "pause") == 0) {
++ ewarn("WARNING: 'pause' is deprecated; please use '--nodeps stop'");
++ deps = false;
++ optarg = "stop";
++ }
++
+ if (strcmp(optarg, "conditionalrestart") == 0 ||
+ strcmp(optarg, "condrestart") == 0)
+ {
+--
+1.6.6.rc3
+
diff --git a/sys-apps/openrc/files/openrc.logrotate b/sys-apps/openrc/files/openrc.logrotate
new file mode 100644
index 000000000000..5e5e64b9b191
--- /dev/null
+++ b/sys-apps/openrc/files/openrc.logrotate
@@ -0,0 +1,4 @@
+/var/log/rc.log {
+ missingok
+ notifempty
+}
diff --git a/sys-apps/openrc/files/start-stop-daemon.pam b/sys-apps/openrc/files/start-stop-daemon.pam
new file mode 100644
index 000000000000..2127f6a70d57
--- /dev/null
+++ b/sys-apps/openrc/files/start-stop-daemon.pam
@@ -0,0 +1,2 @@
+account required pam_permit.so
+session include system-services
diff --git a/sys-apps/openrc/metadata.xml b/sys-apps/openrc/metadata.xml
new file mode 100644
index 000000000000..8c3b63ef0966
--- /dev/null
+++ b/sys-apps/openrc/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>openrc</herd>
+ <use>
+ <flag name="audit">enable support for Linux audit subsystem</flag>
+ <flag name="netifrc">enable Gentoo's network stack (net.* scripts)</flag>
+ <flag name="newnet">enable the new network stack (experimental)</flag>
+ <flag name="tools">build optional tools</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/openrc/openrc-0.13.11.ebuild b/sys-apps/openrc/openrc-0.13.11.ebuild
new file mode 100644
index 000000000000..699e9b234963
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.13.11.ebuild
@@ -0,0 +1,332 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? ( sys-libs/libselinux )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/git.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKPAM=$(usev pam)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog README README.busybox README.history \
+ FEATURE-REMOVAL-SCHEDULE
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.14.ebuild b/sys-apps/openrc/openrc-0.14.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.14.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.15.1.ebuild b/sys-apps/openrc/openrc-0.15.1.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.15.1.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.15.ebuild b/sys-apps/openrc/openrc-0.15.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.15.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.16.1.ebuild b/sys-apps/openrc/openrc-0.16.1.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.16.1.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.16.2.ebuild b/sys-apps/openrc/openrc-0.16.2.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.16.2.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.16.3.ebuild b/sys-apps/openrc/openrc-0.16.3.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.16.3.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.16.4.ebuild b/sys-apps/openrc/openrc-0.16.4.ebuild
new file mode 100644
index 000000000000..233f89416d30
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.16.4.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.16.ebuild b/sys-apps/openrc/openrc-0.16.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.16.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-0.17.ebuild b/sys-apps/openrc/openrc-0.17.ebuild
new file mode 100644
index 000000000000..233f89416d30
--- /dev/null
+++ b/sys-apps/openrc/openrc-0.17.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/openrc/openrc-9999.ebuild b/sys-apps/openrc/openrc-9999.ebuild
new file mode 100644
index 000000000000..2458eece2a06
--- /dev/null
+++ b/sys-apps/openrc/openrc-9999.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic multilib pam toolchain-funcs
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://www.gentoo.org/proj/en/base/openrc/"
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="git://github.com/OpenRC/${PN}.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 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="audit debug elibc_glibc ncurses pam newnet prefix +netifrc selinux static-libs
+ tools unicode kernel_linux kernel_FreeBSD"
+
+COMMON_DEPEND="kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd ) )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ tools? ( dev-lang/perl )
+ audit? ( sys-process/audit )
+ kernel_linux? (
+ sys-process/psmisc
+ !<sys-process/procps-3.3.9-r2
+ )
+ selinux? (
+ sys-apps/policycoreutils
+ sys-libs/libselinux
+ )
+ !<sys-apps/baselayout-2.1-r1
+ !<sys-fs/udev-init-scripts-27"
+DEPEND="${COMMON_DEPEND}
+ virtual/os-headers
+ ncurses? ( virtual/pkgconfig )"
+RDEPEND="${COMMON_DEPEND}
+ !prefix? (
+ kernel_linux? ( || ( >=sys-apps/sysvinit-2.86-r6 sys-process/runit ) )
+ kernel_FreeBSD? ( sys-freebsd/freebsd-sbin )
+ )
+ selinux? (
+ sec-policy/selinux-base-policy
+ sec-policy/selinux-openrc
+ )
+"
+
+PDEPEND="netifrc? ( net-misc/netifrc )"
+
+src_prepare() {
+ sed -i 's:0444:0644:' mk/sys.mk || die
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-${EGIT_VERSION:0:6}"
+ sed -i "/^GITVER[[:space:]]*=/s:=.*:=${ver}:" mk/gitver.mk || die
+ fi
+
+ # Allow user patches to be applied without modifying the ebuild
+ epatch_user
+}
+
+src_compile() {
+ unset LIBDIR #266688
+
+ MAKE_ARGS="${MAKE_ARGS}
+ LIBNAME=$(get_libdir)
+ LIBEXECDIR=${EPREFIX}/$(get_libdir)/rc
+ MKNET=$(usex newnet)
+ MKSELINUX=$(usex selinux)
+ MKAUDIT=$(usex audit)
+ MKPAM=$(usev pam)
+ MKSTATICLIBS=$(usex static-libs)
+ MKTOOLS=$(usex tools)"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+ use prefix && MAKE_ARGS="${MAKE_ARGS} MKPREFIX=yes PREFIX=${EPREFIX}"
+ export DEBUG=$(usev debug)
+ export MKTERMCAP=$(usev ncurses)
+
+ tc-export CC AR RANLIB
+ emake ${MAKE_ARGS}
+}
+
+# set_config <file> <option name> <yes value> <no value> test
+# a value of "#" will just comment out the option
+set_config() {
+ local file="${ED}/$1" var=$2 val com
+ eval "${@:5}" && val=$3 || val=$4
+ [[ ${val} == "#" ]] && com="#" && val='\2'
+ sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
+}
+
+set_config_yes_no() {
+ set_config "$1" "$2" YES NO "${@:3}"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install
+
+ # move the shared libs back to /usr so ldscript can install
+ # more of a minimal set of files
+ # disabled for now due to #270646
+ #mv "${ED}"/$(get_libdir)/lib{einfo,rc}* "${ED}"/usr/$(get_libdir)/ || die
+ #gen_usr_ldscript -a einfo rc
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ if ! use kernel_linux; then
+ keepdir /$(get_libdir)/rc/init.d
+ fi
+ keepdir /$(get_libdir)/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ cp -PR "${ED}"/etc/runlevels "${ED}"/usr/share/${PN} || die
+ rm -rf "${ED}"/etc/runlevels
+
+ # Setup unicode defaults for silly unicode users
+ set_config_yes_no /etc/rc.conf unicode use unicode
+
+ # Cater to the norm
+ set_config_yes_no /etc/conf.d/keymaps windowkeys '(' use x86 '||' use amd64 ')'
+
+ # On HPPA, do not run consolefont by default (bug #222889)
+ if use hppa; then
+ rm -f "${ED}"/usr/share/openrc/runlevels/boot/consolefont
+ fi
+
+ # Support for logfile rotation
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/openrc.logrotate openrc
+
+ # install the gentoo pam.d file
+ newpamd "${FILESDIR}"/start-stop-daemon.pam start-stop-daemon
+
+ # install documentation
+ dodoc ChangeLog *.md
+ if use newnet; then
+ dodoc README.newnet
+ fi
+}
+
+add_boot_init() {
+ local initd=$1
+ local runlevel=${2:-boot}
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e "${ED}"/etc/init.d/${initd} || -e "${EROOT}"etc/init.d/${initd} ]] \
+ || return
+ [[ -e "${EROOT}"etc/runlevels/${runlevel}/${initd} ]] && return
+
+ # if runlevels dont exist just yet, then create it but still flag
+ # to pkg_postinst that it needs real setup #277323
+ if [[ ! -d "${EROOT}"etc/runlevels/${runlevel} ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/${runlevel}
+ touch "${EROOT}"etc/runlevels/.add_boot_init.created
+ fi
+
+ elog "Auto-adding '${initd}' service to your ${runlevel} runlevel"
+ ln -snf /etc/init.d/${initd} "${EROOT}"etc/runlevels/${runlevel}/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${EROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${EROOT}"${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f LIBDIR=$(get_libdir)
+
+ # avoid default thrashing in conf.d files when possible #295406
+ if [[ -e "${EROOT}"etc/conf.d/hostname ]] ; then
+ (
+ unset hostname HOSTNAME
+ source "${EROOT}"etc/conf.d/hostname
+ : ${hostname:=${HOSTNAME}}
+ [[ -n ${hostname} ]] && set_config /etc/conf.d/hostname hostname "${hostname}"
+ )
+ fi
+
+ # set default interactive shell to sulogin if it exists
+ set_config /etc/rc.conf rc_shell /sbin/sulogin "#" test -e /sbin/sulogin
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # swapfiles was added in 0.9.9 and needed in boot (february 2012)
+ has_version ">=sys-apps/openrc-0.9.9" || add_boot_init swapfiles
+
+ if ! has_version ">=sys-apps/openrc-0.11"; then
+ add_boot_init sysfs sysinit
+ fi
+
+ if ! has_version ">=sys-apps/openrc-0.11.3" ; then
+ migrate_udev_mount_script
+ add_boot_init tmpfiles.setup boot
+ fi
+
+ # these were added in 0.12.
+ if ! has_version ">=sys-apps/openrc-0.12"; then
+ add_boot_init loopback
+ add_boot_init tmpfiles.dev sysinit
+
+ # ensure existing /etc/conf.d/net is not removed
+ # undoes the hack to get around CONFIG_PROTECT in openrc-0.11.8 and earlier
+ # this needs to stay in openrc ebuilds for a long time. :(
+ # Added in 0.12.
+ if [[ -f "${EROOT}"etc/conf.d/net ]]; then
+ einfo "Modifying conf.d/net to keep it from being removed"
+ cat <<-EOF >>"${EROOT}"etc/conf.d/net
+
+# The network scripts are now part of net-misc/netifrc
+# In order to avoid sys-apps/${P} from removing this file, this comment was
+# added; you can safely remove this comment. Please see
+# /usr/share/doc/netifrc*/README* for more information.
+EOF
+ fi
+ fi
+ has_version ">=sys-apps/openrc-0.14" || add_boot_init binfmt
+}
+
+# >=OpenRC-0.11.3 requires udev-mount to be in the sysinit runlevel with udev.
+migrate_udev_mount_script() {
+ if [ -e "${EROOT}"etc/runlevels/sysinit/udev -a \
+ ! -e "${EROOT}"etc/runlevels/sysinit/udev-mount ]; then
+ add_boot_init udev-mount sysinit
+ fi
+ return 0
+}
+
+pkg_postinst() {
+ local LIBDIR=$(get_libdir)
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e "${EROOT}"etc/runlevels ]] || [[ -e "${EROOT}"etc/runlevels/.add_boot_init.created ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels "${EROOT}"etc
+ rm -f "${EROOT}"etc/runlevels/.add_boot_init.created
+ else
+ if [[ ! -e "${EROOT}"etc/runlevels/sysinit/devfs ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/sysinit
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/sysinit/* \
+ "${EROOT}"etc/runlevels/sysinit
+ fi
+ if [[ ! -e "${EROOT}"etc/runlevels/shutdown/mount-ro ]] ; then
+ mkdir -p "${EROOT}"etc/runlevels/shutdown
+ cp -RPp "${EROOT}"usr/share/${PN}/runlevels/shutdown/* \
+ "${EROOT}"etc/runlevels/shutdown
+ fi
+ fi
+
+ if use hppa; then
+ elog "Setting the console font does not work on all HPPA consoles."
+ elog "You can still enable it by running:"
+ elog "# rc-update add consolefont boot"
+ fi
+
+ # Handle the conf.d/local.{start,stop} -> local.d transition
+ if path_exists -o "${EROOT}"etc/conf.d/local.{start,stop} ; then
+ elog "Moving your ${EROOT}etc/conf.d/local.{start,stop}"
+ elog "files to ${EROOT}etc/local.d"
+ mv "${EROOT}"etc/conf.d/local.start "${EROOT}"etc/local.d/baselayout1.start
+ mv "${EROOT}"etc/conf.d/local.stop "${EROOT}"etc/local.d/baselayout1.stop
+ chmod +x "${EROOT}"etc/local.d/*{start,stop}
+ fi
+
+ if use kernel_linux && [[ "${EROOT}" = "/" ]]; then
+ if ! /$(get_libdir)/rc/sh/migrate-to-run.sh; then
+ ewarn "The dependency data could not be migrated to /run/openrc."
+ ewarn "This means you need to reboot your system."
+ fi
+ fi
+
+ # update the dependency tree after touching all files #224171
+ [[ "${EROOT}" = "/" ]] && "${EROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if ! use newnet && ! use netifrc; then
+ ewarn "You have emerged OpenRc without network support. This"
+ ewarn "means you need to SET UP a network manager such as"
+ ewarn " net-misc/netifrc, net-misc/dhcpcd, net-misc/wicd,"
+ ewarn "net-misc/NetworkManager, or net-misc/badvpn."
+ ewarn "Or, you have the option of emerging openrc with the newnet"
+ ewarn "use flag and configuring /etc/conf.d/network and"
+ ewarn "/etc/conf.d/staticroute if you only use static interfaces."
+ ewarn
+ fi
+
+ if use newnet && [ ! -e "${EROOT}"etc/runlevels/boot/network ]; then
+ ewarn "Please add the network service to your boot runlevel"
+ ewarn "as soon as possible. Not doing so could leave you with a system"
+ ewarn "without networking."
+ ewarn
+ fi
+
+ ewarn "In this version of OpenRC, the loopback interface no longer"
+ ewarn "satisfies the net virtual."
+ ewarn "If you have services now which do not start because of this,"
+ ewarn "They can be fixed by adding rc_need=\"!net\""
+ ewarn "to the ${EROOT}etc/conf.d/<servicename> file."
+ ewarn "You should also file a bug against the service asking that"
+ ewarn "need net be dropped from the dependencies."
+ ewarn "The bug you file should block the following tracker:"
+ ewarn "https://bugs.gentoo.org/show_bug.cgi?id=439092"
+ ewarn
+
+ # Updated for 0.13.2.
+ ewarn "Bug https://bugs.gentoo.org/show_bug.cgi?id=427996 was not"
+ ewarn "fixed correctly in earlier versions of OpenRC."
+ ewarn "The correct fix is implemented in this version, but that"
+ ewarn "means netmount needs to be added to the default runlevel if"
+ ewarn "you are using nfs file systems."
+ ewarn
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+}
diff --git a/sys-apps/pacman/Manifest b/sys-apps/pacman/Manifest
new file mode 100644
index 000000000000..586b4e22dd1a
--- /dev/null
+++ b/sys-apps/pacman/Manifest
@@ -0,0 +1,2 @@
+DIST pacman-4.0.1.tar.gz 1897685 SHA256 04f6822b31022100de6cd0a1905b199bbd1eaf878ef0726b6242ee032f3c33b1
+DIST pacman-4.0.3.tar.gz 1961839 SHA256 a48696ae51aaccf31a69ea7916ba9b06e7836eb933b8a281c666729c9d55ce25 SHA512 a1c7607470f0c54affe09a1b0491cdc310f37accaf782489439fd80f85b7b0ae313c477f5f3075ddef86234364b2b317e9f6abe618722b603cc9808fbba2b326 WHIRLPOOL f01c0ee89e471fbf08d71abe6e1413d7102ce6b20d20a1658a88f4600df01e9485420975ef698765b2f358e83dffe84d68df0891a6d888a35826254db33856ed
diff --git a/sys-apps/pacman/files/pacman-4.0.0-gpgme.patch b/sys-apps/pacman/files/pacman-4.0.0-gpgme.patch
new file mode 100644
index 000000000000..ab0f57c7a162
--- /dev/null
+++ b/sys-apps/pacman/files/pacman-4.0.0-gpgme.patch
@@ -0,0 +1,45 @@
+From fc732def0944aac5c7b18860b4f46444e6d50044 Mon Sep 17 00:00:00 2001
+From: Nathan Phillip Brink <binki@gentoo.org>
+Date: Mon, 17 Oct 2011 21:01:22 +0000
+Subject: [PATCH] Use AM_GPGME_PATH macro from gpgme instead of home-built gpgme detection.
+
+Fixes compilation on Gentoo, where CPPFLAGS=-I/usr/include/gpgme is
+necessary.
+---
+ configure.ac | 20 ++++++++++++--------
+ 1 files changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c23da75..87cd359 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -161,14 +161,18 @@ AM_CONDITIONAL([HAVE_LIBSSL], [test "x$with_openssl" = "xyes"])
+ # Check for gpgme
+ AC_MSG_CHECKING(whether to link with libgpgme)
+ AS_IF([test "x$with_gpgme" != "xno"],
+- [AC_MSG_RESULT(yes)
+- AC_CHECK_LIB([gpgme], [gpgme_check_version], ,
+- [if test "x$with_gpgme" != "xcheck"; then
+- AC_MSG_FAILURE([--with-ggpme was given, but -lgpgme was not found])
+- fi],
+- [-lgpgme])
+- with_gpgme=$ac_cv_lib_gpgme_gpgme_check_version],
+- AC_MSG_RESULT(no))
++ [AC_MSG_RESULT([yes])],
++ [AC_MSG_RESULT([no])])
++AS_IF([test "x$with_gpgme" != "xno"],
++ [AM_PATH_GPGME([],
++ [LIBS="$LIBS $GPGME_LIBS"
++ CPPFLAGS="$CPPFLAGS $GPGME_CPPFLAGS"
++ CFLAGS="$CFLAGS $GPGME_CFLAGS"
++ with_gpgme=yes
++ AC_DEFINE([HAVE_LIBGPGME], [1], [Define if gpgme should be used to provide GPG signature support.])],
++ [AS_IF([test "x$with_gpgme" != "xcheck"],
++ [AC_MSG_FAILURE([--with-gpgme was given, but gpgme was not found])])
++ with_gpgme=no])])
+ AM_CONDITIONAL([HAVE_LIBGPGME], [test "x$with_gpgme" = "xyes"])
+
+ # Checks for header files.
+--
+1.7.3.4
+
diff --git a/sys-apps/pacman/metadata.xml b/sys-apps/pacman/metadata.xml
new file mode 100644
index 000000000000..4581cf002bfb
--- /dev/null
+++ b/sys-apps/pacman/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>binki@gentoo.org</email>
+ <name>Nathan Phillip Brink</name>
+ </maintainer>
+ <use>
+ <flag name="gpg">Support verifying packages signed with GPG using <pkg>app-crypt/gpgme</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/pacman/pacman-4.0.1.ebuild b/sys-apps/pacman/pacman-4.0.1.ebuild
new file mode 100644
index 000000000000..490936328c51
--- /dev/null
+++ b/sys-apps/pacman/pacman-4.0.1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools autotools-utils bash-completion-r1 eutils
+
+DESCRIPTION="Archlinux's binary package manager"
+HOMEPAGE="http://archlinux.org/pacman/"
+SRC_URI="ftp://ftp.archlinux.org/other/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="curl debug doc gpg test"
+
+COMMON_DEPEND="app-arch/libarchive
+ dev-libs/openssl
+ virtual/libiconv
+ virtual/libintl
+ sys-devel/gettext
+ curl? ( net-misc/curl )
+ gpg? ( app-crypt/gpgme )"
+RDEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils"
+# autoconf macros from gpgme requied unconditionally
+DEPEND="${COMMON_DEPEND}
+ app-crypt/gpgme
+ doc? ( app-doc/doxygen
+ app-text/asciidoc )
+ test? ( dev-lang/python )"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Adds AM_GPGME_PATH call which requires app-crypt/gpgme to be
+ # DEPENDed on unconditionally:
+ epatch "${FILESDIR}"/${PN}-4.0.0-gpgme.patch
+
+ # Remove a line that adds -Werror in ./configure when --enable-debug
+ # is passed:
+ sed -i -e '/-Werror/d' configure.ac || die "-Werror"
+
+ # autopoint is unwilling to replace m4/gettext.m4 with the correct
+ # version even though it'll gladly replace */po/Makefile.in.in,
+ # creating an inconsistency between gettext m4 macros and
+ # Makefile.in.in. Also, AM_MKINSTALLDIRS apparently doesn't exist
+ # anymore, so we need newer gettext macros. #420469
+ rm m4/gettext.m4 || die
+ sed -i -e '/AM_GNU_GETTEXT_VERSION/s/0\.13\.1/0.18.1/' configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --localstatedir=/var
+ --disable-git-version
+ --with-openssl
+ # Help protect user from shooting his/her Gentoo installation in
+ # its foot.
+ --with-root-dir="${EPREFIX}"/var/chroot/archlinux
+ $(use_enable debug)
+ $(use_enable doc)
+ $(use_enable doc doxygen)
+ $(use_with curl libcurl)
+ $(use_with gpg gpgme)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodir /etc/pacman.d
+ newbashcomp "${AUTOTOOLS_BUILD_DIR}"/contrib/bash_completion pacman
+}
+
+pkg_postinst() {
+ einfo "Please see http://ohnopub.net/~ohnobinki/gentoo/arch/ for information"
+ einfo "about setting up an archlinux chroot."
+}
diff --git a/sys-apps/pacman/pacman-4.0.3-r1.ebuild b/sys-apps/pacman/pacman-4.0.3-r1.ebuild
new file mode 100644
index 000000000000..5d6ab57ac40a
--- /dev/null
+++ b/sys-apps/pacman/pacman-4.0.3-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_COMPAT=( python2_7 )
+inherit autotools autotools-utils bash-completion-r1 eutils python-any-r1
+
+DESCRIPTION="Archlinux's binary package manager"
+HOMEPAGE="http://archlinux.org/pacman/"
+SRC_URI="ftp://ftp.archlinux.org/other/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="curl debug doc gpg test"
+
+COMMON_DEPEND="app-arch/libarchive
+ dev-libs/openssl
+ virtual/libiconv
+ virtual/libintl
+ sys-devel/gettext
+ curl? ( net-misc/curl )
+ gpg? ( app-crypt/gpgme )"
+RDEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils"
+# autoconf macros from gpgme requied unconditionally
+# makepkg collision with old bash-completion
+DEPEND="${COMMON_DEPEND}
+ app-crypt/gpgme
+ doc? ( app-doc/doxygen
+ app-text/asciidoc )
+ test? ( ${PYTHON_DEPS} )
+ !<=app-shells/bash-completion-2.1-r90"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Adds AM_GPGME_PATH call which requires app-crypt/gpgme to be
+ # DEPENDed on unconditionally:
+ epatch "${FILESDIR}"/${PN}-4.0.0-gpgme.patch
+
+ # Remove a line that adds -Werror in ./configure when --enable-debug
+ # is passed:
+ sed -i -e '/-Werror/d' configure.ac || die "-Werror"
+
+ # autopoint is unwilling to replace m4/gettext.m4 with the correct
+ # version even though it'll gladly replace */po/Makefile.in.in,
+ # creating an inconsistency between gettext m4 macros and
+ # Makefile.in.in. Also, AM_MKINSTALLDIRS apparently doesn't exist
+ # anymore, so we need newer gettext macros. #420469
+ rm m4/gettext.m4 || die
+ sed -i -e '/AM_GNU_GETTEXT_VERSION/s/0\.13\.1/0.18.1/' configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --localstatedir=/var
+ --disable-git-version
+ --with-openssl
+ # Help protect user from shooting his/her Gentoo installation in
+ # its foot.
+ --with-root-dir="${EPREFIX}"/var/chroot/archlinux
+ $(use_enable debug)
+ $(use_enable doc)
+ $(use_enable doc doxygen)
+ $(use_with curl libcurl)
+ $(use_with gpg gpgme)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodir /etc/pacman.d
+ newbashcomp "${AUTOTOOLS_BUILD_DIR}"/contrib/bash_completion pacman
+ bashcomp_alias pacman pacman-key makepkg
+}
+
+pkg_postinst() {
+ einfo "Please see http://ohnopub.net/~ohnobinki/gentoo/arch/ for information"
+ einfo "about setting up an archlinux chroot."
+}
diff --git a/sys-apps/pacman/pacman-4.0.3.ebuild b/sys-apps/pacman/pacman-4.0.3.ebuild
new file mode 100644
index 000000000000..490936328c51
--- /dev/null
+++ b/sys-apps/pacman/pacman-4.0.3.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools autotools-utils bash-completion-r1 eutils
+
+DESCRIPTION="Archlinux's binary package manager"
+HOMEPAGE="http://archlinux.org/pacman/"
+SRC_URI="ftp://ftp.archlinux.org/other/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="curl debug doc gpg test"
+
+COMMON_DEPEND="app-arch/libarchive
+ dev-libs/openssl
+ virtual/libiconv
+ virtual/libintl
+ sys-devel/gettext
+ curl? ( net-misc/curl )
+ gpg? ( app-crypt/gpgme )"
+RDEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils"
+# autoconf macros from gpgme requied unconditionally
+DEPEND="${COMMON_DEPEND}
+ app-crypt/gpgme
+ doc? ( app-doc/doxygen
+ app-text/asciidoc )
+ test? ( dev-lang/python )"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Adds AM_GPGME_PATH call which requires app-crypt/gpgme to be
+ # DEPENDed on unconditionally:
+ epatch "${FILESDIR}"/${PN}-4.0.0-gpgme.patch
+
+ # Remove a line that adds -Werror in ./configure when --enable-debug
+ # is passed:
+ sed -i -e '/-Werror/d' configure.ac || die "-Werror"
+
+ # autopoint is unwilling to replace m4/gettext.m4 with the correct
+ # version even though it'll gladly replace */po/Makefile.in.in,
+ # creating an inconsistency between gettext m4 macros and
+ # Makefile.in.in. Also, AM_MKINSTALLDIRS apparently doesn't exist
+ # anymore, so we need newer gettext macros. #420469
+ rm m4/gettext.m4 || die
+ sed -i -e '/AM_GNU_GETTEXT_VERSION/s/0\.13\.1/0.18.1/' configure.ac || die
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --localstatedir=/var
+ --disable-git-version
+ --with-openssl
+ # Help protect user from shooting his/her Gentoo installation in
+ # its foot.
+ --with-root-dir="${EPREFIX}"/var/chroot/archlinux
+ $(use_enable debug)
+ $(use_enable doc)
+ $(use_enable doc doxygen)
+ $(use_with curl libcurl)
+ $(use_with gpg gpgme)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ dodir /etc/pacman.d
+ newbashcomp "${AUTOTOOLS_BUILD_DIR}"/contrib/bash_completion pacman
+}
+
+pkg_postinst() {
+ einfo "Please see http://ohnopub.net/~ohnobinki/gentoo/arch/ for information"
+ einfo "about setting up an archlinux chroot."
+}
diff --git a/sys-apps/paludis/Manifest b/sys-apps/paludis/Manifest
new file mode 100644
index 000000000000..cc1091304cef
--- /dev/null
+++ b/sys-apps/paludis/Manifest
@@ -0,0 +1,4 @@
+DIST paludis-1.4.2.tar.bz2 1791385 SHA256 ac342d908572e97968abcdd806ba9f390585a06f8da213b34374475972cb2611 SHA512 1176812683453e61897005612f525aad42b38063ff680e645ee840d63c3ffe866578f4c2756f85f7d8bea5be8ca70d3ad1713c0ea2de9e18a76135251126c109 WHIRLPOOL 72b7391b242cebd78883e43ad82d736825841de64a2e4675a7b43a751a51edd3da8acdf37888b5112f4c9aa22c0137502e519cb81b6a1085681a4d860dafcd1c
+DIST paludis-2.0.0.tar.bz2 1787616 SHA256 9e635d86e655658d31adde5813f5fcad2982b5fe8847c3c565eca7d28a1ec639 SHA512 e1df4d0617b4e021d1b63181517c0ecb9ece55669226c6ea0bba318b6899277c09a8d8ccc11ef673a3f27e77302c84702df4ae7568b44a87e0b138e346623728 WHIRLPOOL 90dcd765ebc864d14e569a01071fe3effae3c4424cf7f3004ce1f273c721c512697c6100e3b775d34732640bd770220fe5304f4d2b5e67f2de86c9f04c9ffe97
+DIST paludis-2.2.0.tar.bz2 1786405 SHA256 0b0bcb14a6539874d274c72e6a7b9825aa80fa083c2b61e1d5b14daf24829346 SHA512 9b4dd4613ec31683021d6fc5b5eb094024ceada47c41e09d1f0cb86f1de5b621869756401ba14ec0ec5f5dd20a5f8bf5b596c3891724bb9c245400b5fef4961f WHIRLPOOL 9cd602561b38e1bb6fc3d9baa5452c63a394c1e51faf299d8d1e82dad9a53969f14be542dac3f90974fcdf08c16c267cfdf45273c5244f378f9a2b7b6288bd97
+DIST paludis-2.4.0.tar.bz2 1787689 SHA256 f47b4bb5503dc127022453b15ca811dec22ee2f04c3c3b76ed1c5a83dbe1af1f SHA512 5fbb15d2285c892fdf19288b8838c51ec2439817a9abc685b8692ff4a3ddf76632d3ab51b2e0298c8eacf00f8b00f4e66b47b34db12844cd4eb77cbfb87ca32e WHIRLPOOL d9dc107886b8bf09bb203704d559dd030190b8390607964578c3f2e10a5c5cd4400146ffed894a968143761fc8149796d37597274b34b8414133b26c7252345b
diff --git a/sys-apps/paludis/files/paludis-2.0.0-fix-format-security.patch b/sys-apps/paludis/files/paludis-2.0.0-fix-format-security.patch
new file mode 100644
index 000000000000..40d2f3ad4953
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-2.0.0-fix-format-security.patch
@@ -0,0 +1,66 @@
+commit f777dadef601434550aa3fb411eebab04ad07103
+Author: David Leverton <levertond@googlemail.com>
+Date: Wed Aug 27 21:10:59 2014 +0100
+
+ Fix build with -Werror=format-security
+
+ Fixes: Gentoo#521326
+
+diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
+index 587601c..d58a8d0 100644
+--- a/ruby/paludis_ruby.cc
++++ b/ruby/paludis_ruby.cc
+@@ -173,19 +173,19 @@ void paludis::ruby::exception_to_ruby_exception(const std::exception & ee)
+ rb_raise(rb_eRuntimeError, "Unexpected paludis::InternalError: %s (%s)",
+ dynamic_cast<const paludis::InternalError *>(&ee)->message().c_str(), ee.what());
+ else if (0 != dynamic_cast<const paludis::GotASetNotAPackageDepSpec *>(&ee))
+- rb_raise(c_got_a_set_not_a_package_dep_spec, dynamic_cast<const paludis::GotASetNotAPackageDepSpec *>(&ee)->message().c_str());
++ rb_raise(c_got_a_set_not_a_package_dep_spec, "%s", dynamic_cast<const paludis::GotASetNotAPackageDepSpec *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::BadVersionSpecError *>(&ee))
+- rb_raise(c_bad_version_spec_error, dynamic_cast<const paludis::BadVersionSpecError *>(&ee)->message().c_str());
++ rb_raise(c_bad_version_spec_error, "%s", dynamic_cast<const paludis::BadVersionSpecError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::SetNameError *>(&ee))
+- rb_raise(c_set_name_error, dynamic_cast<const paludis::SetNameError *>(&ee)->message().c_str());
++ rb_raise(c_set_name_error, "%s", dynamic_cast<const paludis::SetNameError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::PackageNamePartError *>(&ee))
+- rb_raise(c_package_name_part_error, dynamic_cast<const paludis::PackageNamePartError *>(&ee)->message().c_str());
++ rb_raise(c_package_name_part_error, "%s", dynamic_cast<const paludis::PackageNamePartError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::CategoryNamePartError *>(&ee))
+- rb_raise(c_category_name_part_error, dynamic_cast<const paludis::CategoryNamePartError *>(&ee)->message().c_str());
++ rb_raise(c_category_name_part_error, "%s", dynamic_cast<const paludis::CategoryNamePartError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::NameError *>(&ee))
+- rb_raise(c_name_error, dynamic_cast<const paludis::NameError *>(&ee)->message().c_str());
++ rb_raise(c_name_error, "%s", dynamic_cast<const paludis::NameError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::PackageDepSpecError *>(&ee))
+- rb_raise(c_package_dep_spec_error, dynamic_cast<const paludis::PackageDepSpecError *>(&ee)->message().c_str());
++ rb_raise(c_package_dep_spec_error, "%s", dynamic_cast<const paludis::PackageDepSpecError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::AmbiguousPackageNameError *>(&ee))
+ {
+ VALUE ex_args[2];
+@@ -198,19 +198,19 @@ void paludis::ruby::exception_to_ruby_exception(const std::exception & ee)
+ rb_exc_raise(rb_class_new_instance(2, ex_args, c_ambiguous_package_name_error));
+ }
+ else if (0 != dynamic_cast<const paludis::NoSuchPackageError *>(&ee))
+- rb_raise(c_no_such_package_error, dynamic_cast<const paludis::NoSuchPackageError *>(&ee)->message().c_str());
++ rb_raise(c_no_such_package_error, "%s", dynamic_cast<const paludis::NoSuchPackageError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::NoSuchRepositoryError *>(&ee))
+- rb_raise(c_no_such_repository_error, dynamic_cast<const paludis::NoSuchRepositoryError *>(&ee)->message().c_str());
++ rb_raise(c_no_such_repository_error, "%s", dynamic_cast<const paludis::NoSuchRepositoryError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::ConfigFileError *>(&ee))
+- rb_raise(c_config_file_error, dynamic_cast<const paludis::ConfigFileError *>(&ee)->message().c_str());
++ rb_raise(c_config_file_error, "%s", dynamic_cast<const paludis::ConfigFileError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::ConfigurationError *>(&ee))
+- rb_raise(c_configuration_error, dynamic_cast<const paludis::ConfigurationError *>(&ee)->message().c_str());
++ rb_raise(c_configuration_error, "%s", dynamic_cast<const paludis::ConfigurationError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::ActionFailedError *>(&ee))
+- rb_raise(c_action_failed_error, dynamic_cast<const paludis::ActionFailedError *>(&ee)->message().c_str());
++ rb_raise(c_action_failed_error, "%s", dynamic_cast<const paludis::ActionFailedError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::ActionAbortedError *>(&ee))
+- rb_raise(c_action_aborted_error, dynamic_cast<const paludis::ActionAbortedError *>(&ee)->message().c_str());
++ rb_raise(c_action_aborted_error, "%s", dynamic_cast<const paludis::ActionAbortedError *>(&ee)->message().c_str());
+ else if (0 != dynamic_cast<const paludis::BadVersionOperatorError *>(&ee))
+- rb_raise(c_bad_version_operator_error, dynamic_cast<const paludis::BadVersionOperatorError *>(&ee)->message().c_str());
++ rb_raise(c_bad_version_operator_error, "%s", dynamic_cast<const paludis::BadVersionOperatorError *>(&ee)->message().c_str());
+
+ else if (0 != dynamic_cast<const paludis::Exception *>(&ee))
+ rb_raise(rb_eRuntimeError, "Caught paludis::Exception: %s (%s)",
diff --git a/sys-apps/paludis/files/paludis-2.2.0-check-IUSE_EFFECTIVE-in-EAPI-5.patch b/sys-apps/paludis/files/paludis-2.2.0-check-IUSE_EFFECTIVE-in-EAPI-5.patch
new file mode 100644
index 000000000000..1950f697f001
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-2.2.0-check-IUSE_EFFECTIVE-in-EAPI-5.patch
@@ -0,0 +1,88 @@
+From bfb1bd7682b4a678cfa7dccb87d1f49d842317ac Mon Sep 17 00:00:00 2001
+From: David Leverton <levertond@googlemail.com>
+Date: Sat, 21 Mar 2015 20:04:30 +0000
+Subject: Only check IUSE_EFFECTIVE for EAPI 5
+
+In other EAPIs the value isn't set by C++, and therefore may leak in
+from the calling environment.
+
+diff --git a/paludis/repositories/e/ebuild/0/list_functions.bash b/paludis/repositories/e/ebuild/0/list_functions.bash
+index 0c5d91a..4998c2b 100644
+--- a/paludis/repositories/e/ebuild/0/list_functions.bash
++++ b/paludis/repositories/e/ebuild/0/list_functions.bash
+@@ -37,13 +37,6 @@ usev()
+
+ useq()
+ {
+- if [[ -n "${IUSE_EFFECTIVE:+x}" ]] ; then
+- local i=( $IUSE_EFFECTIVE )
+- if ! hasq ${1#!} "${i[@]#[+-]}" ; then
+- die "Flag '${1#!}' is not included in IUSE_EFFECTIVE=\"${IUSE_EFFECTIVE}\""
+- fi
+- fi
+-
+ if [[ "${1:0:1}" == "!" ]] ; then
+ ! hasq "${1#!}" "${USE}"
+ else
+diff --git a/paludis/repositories/e/ebuild/5/Makefile.am b/paludis/repositories/e/ebuild/5/Makefile.am
+index fbcb919..ced4e53 100644
+--- a/paludis/repositories/e/ebuild/5/Makefile.am
++++ b/paludis/repositories/e/ebuild/5/Makefile.am
+@@ -7,6 +7,7 @@ libexecprog5dir = $(libexecdir)/paludis/5
+ libexecprog5_SCRIPTS = \
+ src_test.bash \
+ usex.bash \
++ list_functions.bash \
+ output_functions.bash
+
+ TESTS =
+diff --git a/paludis/repositories/e/ebuild/5/list_functions.bash b/paludis/repositories/e/ebuild/5/list_functions.bash
+new file mode 100644
+index 0000000..7cb22ad
+--- /dev/null
++++ b/paludis/repositories/e/ebuild/5/list_functions.bash
+@@ -0,0 +1,41 @@
++#!/usr/bin/env bash
++# vim: set sw=4 sts=4 et :
++
++# Copyright (c) 2006, 2009, 2012 Ciaran McCreesh
++# Copyright (c) 2015 David Leverton
++#
++# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
++# Gentoo Foundation and distributed under the terms of the GNU General
++# Public License v2.
++#
++# This file is part of the Paludis package manager. Paludis is free software;
++# you can redistribute it and/or modify it under the terms of the GNU General
++# Public License, version 2, as published by the Free Software Foundation.
++#
++# Paludis 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
++
++ebuild_load_module --older list_functions
++
++useq()
++{
++ if [[ -n "${IUSE_EFFECTIVE:+x}" ]] ; then
++ local i=( $IUSE_EFFECTIVE )
++ if ! hasq ${1#!} "${i[@]#[+-]}" ; then
++ die "Flag '${1#!}' is not included in IUSE_EFFECTIVE=\"${IUSE_EFFECTIVE}\""
++ fi
++ fi
++
++ if [[ "${1:0:1}" == "!" ]] ; then
++ ! hasq "${1#!}" "${USE}"
++ else
++ hasq "${1}" "${USE}"
++ fi
++}
++
+--
+cgit v0.10.2
+
diff --git a/sys-apps/paludis/files/paludis-2.2.0-filter-EBUILD_PHASE_FUNC.patch b/sys-apps/paludis/files/paludis-2.2.0-filter-EBUILD_PHASE_FUNC.patch
new file mode 100644
index 000000000000..dc46726909c2
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-2.2.0-filter-EBUILD_PHASE_FUNC.patch
@@ -0,0 +1,22 @@
+From dccb65acba7684c97675473fec5120e3aa55d2d0 Mon Sep 17 00:00:00 2001
+From: David Leverton <levertond@googlemail.com>
+Date: Sun, 29 Mar 2015 18:36:02 +0100
+Subject: Fix EBUILD_PHASE_FUNC leakage
+
+
+diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
+index 24a93d4..b856bad 100755
+--- a/paludis/repositories/e/ebuild/ebuild.bash
++++ b/paludis/repositories/e/ebuild/ebuild.bash
+@@ -76,7 +76,7 @@ ebuild_sanitise_envvars
+ # fancy fake variables
+ EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE IUSE_EFFECTIVE SRC_URI DOWNLOADS RESTRICT \
+ LICENSE LICENCES KEYWORDS INHERITED PROVIDE HOMEPAGE DESCRIPTION DEPENDENCIES \
+- E_IUSE E_DEPEND E_RDEPEND E_PDEPEND PLATFORMS DEFINED_PHASES \
++ E_IUSE E_DEPEND E_RDEPEND E_PDEPEND PLATFORMS DEFINED_PHASES EBUILD_PHASE_FUNC \
+ MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
+ GENERATED_USING GENERATED_TIME GENERATED_FROM_REPOSITORY BINARY_PLATFORMS REMOTE_IDS \
+ SUMMARY BUGS_TO UPSTREAM_DOCUMENTATION UPSTREAM_CHANGELOG \
+--
+cgit v0.10.2
+
diff --git a/sys-apps/paludis/files/paludis-2.2.0-filter-IUSE_EFFECTIVE.patch b/sys-apps/paludis/files/paludis-2.2.0-filter-IUSE_EFFECTIVE.patch
new file mode 100644
index 000000000000..2e56e6b3b122
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-2.2.0-filter-IUSE_EFFECTIVE.patch
@@ -0,0 +1,31 @@
+From ef6930e03428ec512c9d564886c06078e5238d45 Mon Sep 17 00:00:00 2001
+From: David Leverton <levertond@googlemail.com>
+Date: Sat, 21 Mar 2015 19:38:52 +0000
+Subject: Add IUSE_EFFECTIVE to EBUILD_METADATA_VARIABLES{,_FROM_CPLUSPLUS}
+
+
+diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
+index f4387e1..24a93d4 100755
+--- a/paludis/repositories/e/ebuild/ebuild.bash
++++ b/paludis/repositories/e/ebuild/ebuild.bash
+@@ -74,7 +74,7 @@ ebuild_sanitise_envvars
+
+ # The list below should include all variables from all EAPIs, along with any
+ # fancy fake variables
+-EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI DOWNLOADS RESTRICT \
++EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE IUSE_EFFECTIVE SRC_URI DOWNLOADS RESTRICT \
+ LICENSE LICENCES KEYWORDS INHERITED PROVIDE HOMEPAGE DESCRIPTION DEPENDENCIES \
+ E_IUSE E_DEPEND E_RDEPEND E_PDEPEND PLATFORMS DEFINED_PHASES \
+ MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
+@@ -82,7 +82,7 @@ EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI DOWNLOADS RESTRIC
+ SUMMARY BUGS_TO UPSTREAM_DOCUMENTATION UPSTREAM_CHANGELOG \
+ UPSTREAM_RELEASE_NOTES PROPERTIES PALUDIS_DECLARED_FUNCTIONS SLOT EAPI OPTIONS USE \
+ PALUDIS_EBUILD_RDEPEND_WAS_SET PALUDIS_EBUILD_DEPEND REQUIRED_USE SCM_REVISION"
+-EBUILD_METADATA_VARIABLES_FROM_CPLUSPLUS="SLOT EAPI OPTIONS USE"
++EBUILD_METADATA_VARIABLES_FROM_CPLUSPLUS="SLOT EAPI OPTIONS USE IUSE_EFFECTIVE"
+
+ shopt -s expand_aliases
+ [[ -z ${PALUDIS_SHELL_OPTIONS} && unset == ${PALUDIS_SHELL_OPTIONS-unset} ]] &&
+--
+cgit v0.10.2
+
diff --git a/sys-apps/paludis/files/paludis-2.2.0-fix-MERGE_TYPE.patch b/sys-apps/paludis/files/paludis-2.2.0-fix-MERGE_TYPE.patch
new file mode 100644
index 000000000000..2ef1a48ed52a
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-2.2.0-fix-MERGE_TYPE.patch
@@ -0,0 +1,81 @@
+From 96768e54e2fdfc526edd2e939f20203e43b25a36 Mon Sep 17 00:00:00 2001
+From: David Leverton <levertond@googlemail.com>
+Date: Sun, 1 Mar 2015 15:22:32 +0000
+Subject: Fix MERGE_TYPE
+
+Unfortunately the test cases were broken in the same way as the
+feature itself, so it wasn't caught.
+
+Fixes: ticket:1323
+
+diff --git a/paludis/repositories/e/e_repository_TEST_4.cc b/paludis/repositories/e/e_repository_TEST_4.cc
+index a59014d..caccf2c 100644
+--- a/paludis/repositories/e/e_repository_TEST_4.cc
++++ b/paludis/repositories/e/e_repository_TEST_4.cc
+@@ -301,7 +301,6 @@ TEST(ERepository, EAPI4MergeType)
+ n::replacing() = std::make_shared<PackageIDSequence>(),
+ n::want_phase() = &want_all_phases
+ ));
+- ::setenv("EXPECTED_MERGE_TYPE", "source", 1);
+
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-4::test-repo",
+@@ -371,7 +370,6 @@ TEST(ERepository, EAPI4MergeTypeBin)
+ n::replacing() = std::make_shared<PackageIDSequence>(),
+ n::want_phase() = &want_all_phases
+ ));
+- ::setenv("EXPECTED_MERGE_TYPE", "buildonly", 1);
+
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-bin-4::test-repo",
+@@ -389,7 +387,6 @@ TEST(ERepository, EAPI4MergeTypeBin)
+ n::replacing() = std::make_shared<PackageIDSequence>(),
+ n::want_phase() = &want_all_phases
+ ));
+- ::setenv("EXPECTED_MERGE_TYPE", "binary", 1);
+
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/merge-type-bin-4::binrepo",
+diff --git a/paludis/repositories/e/e_repository_TEST_4_setup.sh b/paludis/repositories/e/e_repository_TEST_4_setup.sh
+index 81b6593..0c28acc 100755
+--- a/paludis/repositories/e/e_repository_TEST_4_setup.sh
++++ b/paludis/repositories/e/e_repository_TEST_4_setup.sh
+@@ -956,6 +956,8 @@ KEYWORDS="test"
+
+ S="${WORKDIR}"
+
++EXPECTED_MERGE_TYPE=source
++
+ pkg_setup() {
+ if [[ ${EXPECTED_MERGE_TYPE} != ${MERGE_TYPE} ]] ; then
+ die ${EXPECTED_MERGE_TYPE} is not ${MERGE_TYPE}
+@@ -975,10 +977,13 @@ KEYWORDS="test"
+
+ S="${WORKDIR}"
+
++EXPECTED_MERGE_TYPE=buildonly
++
+ pkg_setup() {
+ if [[ ${EXPECTED_MERGE_TYPE} != ${MERGE_TYPE} ]] ; then
+ die ${EXPECTED_MERGE_TYPE} is not ${MERGE_TYPE}
+ fi
++ EXPECTED_MERGE_TYPE=binary
+ }
+ END
+ mkdir -p "cat/required-use-all-good" || exit 1
+diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
+index a88554b..f4387e1 100755
+--- a/paludis/repositories/e/ebuild/ebuild.bash
++++ b/paludis/repositories/e/ebuild/ebuild.bash
+@@ -304,7 +304,7 @@ ebuild_scrub_environment()
+ echo "\${!${PALUDIS_CLIENT_UPPER}_CMDLINE_*} ${PALUDIS_CLIENT_UPPER}_OPTIONS" )
+
+ unset -v CATEGORY PN PV P PNV PVR PF PNVR
+- unset -v ebuild EBUILD
++ unset -v ebuild EBUILD MERGE_TYPE
+ unset -v $(
+ for v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ${PALUDIS_BRACKET_MERGED_VARIABLES} ; do
+ echo E_${v}
+--
+cgit v0.10.2
+
diff --git a/sys-apps/paludis/files/paludis-2.2.0-fix-PWD-handling.patch b/sys-apps/paludis/files/paludis-2.2.0-fix-PWD-handling.patch
new file mode 100644
index 000000000000..663e94d54979
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-2.2.0-fix-PWD-handling.patch
@@ -0,0 +1,30 @@
+From f9b2434560399b00f7de479474f8f22fc0271e77 Mon Sep 17 00:00:00 2001
+From: Georgi Georgiev <chutz@gg3.net>
+Date: Tue, 10 Mar 2015 00:38:36 +0900
+Subject: PWD is a special variable, we should leave its value alone
+
+Bash sets the value of PWD to the current working directory. It is not a
+good idea to change that variable without actually changing the
+directory. This would happen if the working directory changes between
+saving and loading the environment (saving - when building a PBIN, and
+loading - when installing it for example), so better let bash handle
+this variable.
+
+Fixes: ticket:1325
+
+diff --git a/paludis/repositories/e/ebuild/source_functions.bash b/paludis/repositories/e/ebuild/source_functions.bash
+index 58b9327..5bfb251 100755
+--- a/paludis/repositories/e/ebuild/source_functions.bash
++++ b/paludis/repositories/e/ebuild/source_functions.bash
+@@ -37,7 +37,7 @@ ebuild_need_extglob()
+ ebuild_safe_source()
+ {
+ set -- "${@}" '[^a-zA-Z_]*' '*[^a-zA-Z0-9_]*' \
+- EUID PPID UID FUNCNAME GROUPS SHELLOPTS BASHOPTS BASHPID IFS \
++ EUID PPID UID FUNCNAME GROUPS SHELLOPTS BASHOPTS BASHPID IFS PWD \
+ 'BASH_@(ARGC|ARGV|LINENO|SOURCE|VERSINFO|REMATCH)' \
+ 'BASH_COMPLETION?(_DIR)' 'bash+([0-9])?([a-z])' \
+ EBUILD_KILL_PID PALUDIS_LOADSAVEENV_DIR PALUDIS_DO_NOTHING_SANDBOXY SANDBOX_ACTIVE \
+--
+cgit v0.10.2
+
diff --git a/sys-apps/paludis/metadata.xml b/sys-apps/paludis/metadata.xml
new file mode 100644
index 000000000000..93c3ebe9295a
--- /dev/null
+++ b/sys-apps/paludis/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jdhore@gentoo.org</email>
+ <name>Jeff Horelick</name>
+ </maintainer>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="pbins">Enable binary package support. Adds dependency upon
+ <pkg>app-arch/libarchive</pkg></flag>
+ <flag name="pink">Use a less boring colourscheme than the default</flag>
+ <flag name='search-index'>Enable cave search --index. Requires sqlite.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/paludis/paludis-1.4.2-r1.ebuild b/sys-apps/paludis/paludis-1.4.2-r1.ebuild
new file mode 100644
index 000000000000..4751880ddb26
--- /dev/null
+++ b/sys-apps/paludis/paludis-1.4.2-r1.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit bash-completion-r1 eutils python-single-r1 user
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.exherbo.org/"
+SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
+
+IUSE="doc pbins pink python ruby search-index test xml"
+LICENSE="GPL-2 vim"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2.13
+ >=app-shells/bash-3.2
+ >=sys-devel/gcc-4.4
+ dev-libs/libpcre[cxx]
+ sys-apps/file
+ pbins? ( >=app-arch/libarchive-3.1.2[xattr] )
+ python? (
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
+ ruby? ( dev-lang/ruby:1.9 )
+ xml? ( >=dev-libs/libxml2-2.6 )
+ search-index? ( >=dev-db/sqlite-3 )"
+
+DEPEND="${COMMON_DEPEND}
+ doc? (
+ || ( >=app-doc/doxygen-1.5.3 <=app-doc/doxygen-1.5.1 )
+ python? (
+ dev-python/epydoc[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}] )
+ ruby? ( dev-ruby/syntax )
+ )
+ virtual/pkgconfig
+ test? ( >=dev-cpp/gtest-1.6.0-r1 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+PDEPEND="app-eselect/eselect-package-manager"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if id paludisbuild >/dev/null 2>/dev/null ; then
+ if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
+ eerror "The 'paludisbuild' user is now expected to be a member of the"
+ eerror "'tty' group. You should add the user to this group before"
+ eerror "upgrading Paludis."
+ die "Please add paludisbuild to tty group"
+ fi
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ) ]]
+ then
+ eerror "Paludis requires at least gcc 4.4 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "Paludis requires at least gcc 4.4"
+ fi
+ fi
+}
+
+pkg_setup() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # The package explicitly wants ruby1.9, so fix the script on it.
+ # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
+ sed -i -e '1s/ruby/&19/' ruby/demos/*.rb || die
+
+ epatch_user
+}
+
+src_configure() {
+ local myeconfargs=(
+ --htmldir=/usr/share/doc/${PF}/html
+
+ $(use_enable doc doxygen)
+ $(use_enable pbins)
+ $(use_enable pink)
+ $(use_enable ruby)
+ $(use ruby && use_enable doc ruby-doc)
+ $(use_enable python)
+ $(use python && use_enable doc python-doc)
+ $(use_enable xml)
+ $(use_enable search-index)
+ $(use_enable test gtest)
+
+ --enable-prebuilt-documentation
+ --enable-vim
+ --enable-visibility
+ --with-config-framework=eselect
+ --with-environments=default,portage
+ --with-vim-install-dir=/usr/share/vim/vimfiles
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ dobashcomp bash-completion/cave
+
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_cave
+}
+
+src_test() {
+ # Work around Portage bugs
+ local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ local -x BASH_ENV=/dev/null
+
+ if [[ ${EUID} == 0 ]] ; then
+ # hate
+ local -x PALUDIS_REDUCED_UID=0
+ local -x PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! nonfatal emake check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ local pm
+ if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
+ pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
+ fi
+
+ if [[ ${pm} != paludis ]] ; then
+ elog "If you are using paludis or cave as your primary package manager,"
+ elog "you should consider running:"
+ elog " eselect package-manager set paludis"
+ fi
+}
diff --git a/sys-apps/paludis/paludis-2.0.0.ebuild b/sys-apps/paludis/paludis-2.0.0.ebuild
new file mode 100644
index 000000000000..e1bd370d4e0c
--- /dev/null
+++ b/sys-apps/paludis/paludis-2.0.0.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit bash-completion-r1 eutils python-single-r1 user
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.exherbo.org/"
+SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
+
+IUSE="doc pbins pink python ruby search-index test xml"
+LICENSE="GPL-2 vim"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86"
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2.13
+ >=app-shells/bash-3.2
+ dev-libs/libpcre[cxx]
+ sys-apps/file
+ pbins? ( >=app-arch/libarchive-3.1.2 )
+ python? (
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
+ ruby? ( dev-lang/ruby:1.9 )
+ search-index? ( >=dev-db/sqlite-3 )
+ xml? ( >=dev-libs/libxml2-2.6 )"
+
+DEPEND="${COMMON_DEPEND}
+ >=app-text/asciidoc-8.6.3
+ app-text/htmltidy
+ app-text/xmlto
+ >=sys-devel/gcc-4.7
+ doc? (
+ || (
+ >=app-doc/doxygen-1.5.3
+ <=app-doc/doxygen-1.5.1 )
+ python? (
+ dev-python/sphinx[${PYTHON_USEDEP}] )
+ ruby? ( dev-ruby/syntax )
+ )
+ virtual/pkgconfig
+ test? ( >=dev-cpp/gtest-1.6.0-r1 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+PDEPEND="app-eselect/eselect-package-manager"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if id paludisbuild >/dev/null 2>/dev/null ; then
+ if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
+ eerror "The 'paludisbuild' user is now expected to be a member of the"
+ eerror "'tty' group. You should add the user to this group before"
+ eerror "upgrading Paludis."
+ die "Please add paludisbuild to tty group"
+ fi
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ) ]]
+ then
+ eerror "Paludis requires at least gcc 4.7 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "Paludis requires at least gcc 4.7"
+ fi
+ fi
+}
+
+pkg_setup() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # The package explicitly wants ruby1.9, so fix the script on it.
+ # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
+ sed -i -e '1s/ruby/&19/' ruby/demos/*.rb || die
+ epatch "${FILESDIR}/${P}-fix-format-security.patch"
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=(
+ --htmldir=/usr/share/doc/${PF}/html
+
+ $(use_enable doc doxygen)
+ $(use_enable test gtest)
+ $(use_enable pbins)
+ $(use_enable pink)
+ $(use_enable python)
+ $(use python && use_enable doc python-doc)
+ $(use_enable ruby)
+ $(use ruby && use_enable doc ruby-doc)
+ $(use_enable search-index)
+ $(use_enable xml)
+
+ --enable-vim
+ --enable-visibility
+ --with-config-framework=eselect
+ --with-environments=default,portage
+ --with-vim-install-dir=/usr/share/vim/vimfiles
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ dobashcomp bash-completion/cave
+
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_cave
+}
+
+src_test() {
+ # Work around Portage bugs
+ local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ local -x BASH_ENV=/dev/null
+
+ if [[ ${EUID} == 0 ]] ; then
+ # hate
+ local -x PALUDIS_REDUCED_UID=0
+ local -x PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! nonfatal emake check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ local pm
+ if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
+ pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
+ fi
+
+ if [[ ${pm} != paludis ]] ; then
+ elog "If you are using paludis or cave as your primary package manager,"
+ elog "you should consider running:"
+ elog " eselect package-manager set paludis"
+ fi
+}
diff --git a/sys-apps/paludis/paludis-2.2.0-r2.ebuild b/sys-apps/paludis/paludis-2.2.0-r2.ebuild
new file mode 100644
index 000000000000..98a4d23763b9
--- /dev/null
+++ b/sys-apps/paludis/paludis-2.2.0-r2.ebuild
@@ -0,0 +1,169 @@
+# 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 bash-completion-r1 eutils python-single-r1 user
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.exherbo.org/"
+SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
+
+IUSE="doc pbins pink python ruby search-index test xml"
+LICENSE="GPL-2 vim"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2.13
+ >=app-shells/bash-3.2
+ dev-libs/libpcre[cxx]
+ sys-apps/file
+ pbins? ( >=app-arch/libarchive-3.1.2 )
+ python? (
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
+ ruby? ( dev-lang/ruby:1.9 )
+ search-index? ( >=dev-db/sqlite-3 )
+ xml? ( >=dev-libs/libxml2-2.6 )"
+
+DEPEND="${COMMON_DEPEND}
+ >=app-text/asciidoc-8.6.3
+ app-text/htmltidy
+ app-text/xmlto
+ >=sys-devel/gcc-4.7
+ doc? (
+ || (
+ >=app-doc/doxygen-1.5.3
+ <=app-doc/doxygen-1.5.1 )
+ python? (
+ dev-python/sphinx[${PYTHON_USEDEP}] )
+ ruby? ( dev-ruby/syntax )
+ )
+ virtual/pkgconfig
+ test? ( >=dev-cpp/gtest-1.6.0-r1 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+PDEPEND="app-eselect/eselect-package-manager"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if id paludisbuild >/dev/null 2>/dev/null ; then
+ if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
+ eerror "The 'paludisbuild' user is now expected to be a member of the"
+ eerror "'tty' group. You should add the user to this group before"
+ eerror "upgrading Paludis."
+ die "Please add paludisbuild to tty group"
+ fi
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ) ]]
+ then
+ eerror "Paludis requires at least gcc 4.7 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "Paludis requires at least gcc 4.7"
+ fi
+ fi
+}
+
+pkg_setup() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # The package explicitly wants ruby1.9, so fix the script on it.
+ # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
+ sed -i -e '1s/ruby/&19/' ruby/demos/*.rb || die
+
+ local PATCHES=(
+ "${FILESDIR}"/${P}-fix-MERGE_TYPE.patch
+ "${FILESDIR}"/${P}-fix-PWD-handling.patch
+ "${FILESDIR}"/${P}-filter-IUSE_EFFECTIVE.patch
+ "${FILESDIR}"/${P}-check-IUSE_EFFECTIVE-in-EAPI-5.patch
+ "${FILESDIR}"/${P}-filter-EBUILD_PHASE_FUNC.patch
+ )
+
+ epatch "${PATCHES[@]}"
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --htmldir=/usr/share/doc/${PF}/html
+
+ $(use_enable doc doxygen)
+ $(use_enable test gtest)
+ $(use_enable pbins)
+ $(use_enable pink)
+ $(use_enable python)
+ $(use python && use_enable doc python-doc)
+ $(use_enable ruby)
+ $(use ruby && use_enable doc ruby-doc)
+ $(use_enable search-index)
+ $(use_enable xml)
+
+ --enable-vim
+ --with-config-framework=eselect
+ --with-environments=default,portage
+ --with-vim-install-dir=/usr/share/vim/vimfiles
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ dobashcomp bash-completion/cave
+
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_cave
+}
+
+src_test() {
+ # Work around Portage bugs
+ local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ local -x BASH_ENV=/dev/null
+
+ if [[ ${EUID} == 0 ]] ; then
+ # hate
+ local -x PALUDIS_REDUCED_UID=0
+ local -x PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! nonfatal emake -k check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ local pm
+ if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
+ pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
+ fi
+
+ if [[ ${pm} != paludis ]] ; then
+ elog "If you are using paludis or cave as your primary package manager,"
+ elog "you should consider running:"
+ elog " eselect package-manager set paludis"
+ fi
+}
diff --git a/sys-apps/paludis/paludis-2.2.0.ebuild b/sys-apps/paludis/paludis-2.2.0.ebuild
new file mode 100644
index 000000000000..d8a064be865d
--- /dev/null
+++ b/sys-apps/paludis/paludis-2.2.0.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit bash-completion-r1 eutils python-single-r1 user
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.exherbo.org/"
+SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
+
+IUSE="doc pbins pink python ruby search-index test xml"
+LICENSE="GPL-2 vim"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2.13
+ >=app-shells/bash-3.2
+ dev-libs/libpcre[cxx]
+ sys-apps/file
+ pbins? ( >=app-arch/libarchive-3.1.2 )
+ python? (
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
+ ruby? ( dev-lang/ruby:1.9 )
+ search-index? ( >=dev-db/sqlite-3 )
+ xml? ( >=dev-libs/libxml2-2.6 )"
+
+DEPEND="${COMMON_DEPEND}
+ >=app-text/asciidoc-8.6.3
+ app-text/htmltidy
+ app-text/xmlto
+ >=sys-devel/gcc-4.7
+ doc? (
+ || (
+ >=app-doc/doxygen-1.5.3
+ <=app-doc/doxygen-1.5.1 )
+ python? (
+ dev-python/sphinx[${PYTHON_USEDEP}] )
+ ruby? ( dev-ruby/syntax )
+ )
+ virtual/pkgconfig
+ test? ( >=dev-cpp/gtest-1.6.0-r1 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+PDEPEND="app-eselect/eselect-package-manager"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if id paludisbuild >/dev/null 2>/dev/null ; then
+ if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
+ eerror "The 'paludisbuild' user is now expected to be a member of the"
+ eerror "'tty' group. You should add the user to this group before"
+ eerror "upgrading Paludis."
+ die "Please add paludisbuild to tty group"
+ fi
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ) ]]
+ then
+ eerror "Paludis requires at least gcc 4.7 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "Paludis requires at least gcc 4.7"
+ fi
+ fi
+}
+
+pkg_setup() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # The package explicitly wants ruby1.9, so fix the script on it.
+ # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
+ sed -i -e '1s/ruby/&19/' ruby/demos/*.rb || die
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=(
+ --htmldir=/usr/share/doc/${PF}/html
+
+ $(use_enable doc doxygen)
+ $(use_enable test gtest)
+ $(use_enable pbins)
+ $(use_enable pink)
+ $(use_enable python)
+ $(use python && use_enable doc python-doc)
+ $(use_enable ruby)
+ $(use ruby && use_enable doc ruby-doc)
+ $(use_enable search-index)
+ $(use_enable xml)
+
+ --enable-vim
+ --with-config-framework=eselect
+ --with-environments=default,portage
+ --with-vim-install-dir=/usr/share/vim/vimfiles
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ dobashcomp bash-completion/cave
+
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_cave
+}
+
+src_test() {
+ # Work around Portage bugs
+ local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ local -x BASH_ENV=/dev/null
+
+ if [[ ${EUID} == 0 ]] ; then
+ # hate
+ local -x PALUDIS_REDUCED_UID=0
+ local -x PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! nonfatal emake check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ local pm
+ if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
+ pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
+ fi
+
+ if [[ ${pm} != paludis ]] ; then
+ elog "If you are using paludis or cave as your primary package manager,"
+ elog "you should consider running:"
+ elog " eselect package-manager set paludis"
+ fi
+}
diff --git a/sys-apps/paludis/paludis-2.4.0.ebuild b/sys-apps/paludis/paludis-2.4.0.ebuild
new file mode 100644
index 000000000000..725f7214e172
--- /dev/null
+++ b/sys-apps/paludis/paludis-2.4.0.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+# matching profile defaults for now
+RUBY_VER=2.0
+
+inherit bash-completion-r1 eutils python-single-r1 user
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.exherbo.org/"
+SRC_URI="http://paludis.exherbo.org/download/${P}.tar.bz2"
+
+IUSE="doc pbins pink python ruby search-index test xml"
+LICENSE="GPL-2 vim"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2.13
+ >=app-shells/bash-3.2
+ dev-libs/libpcre[cxx]
+ sys-apps/file
+ pbins? ( >=app-arch/libarchive-3.1.2 )
+ python? (
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
+ ruby? ( dev-lang/ruby:${RUBY_VER} )
+ search-index? ( >=dev-db/sqlite-3 )
+ xml? ( >=dev-libs/libxml2-2.6 )"
+
+DEPEND="${COMMON_DEPEND}
+ >=app-text/asciidoc-8.6.3
+ app-text/htmltidy
+ app-text/xmlto
+ >=sys-devel/gcc-4.7
+ doc? (
+ || (
+ >=app-doc/doxygen-1.5.3
+ <=app-doc/doxygen-1.5.1 )
+ python? (
+ dev-python/sphinx[${PYTHON_USEDEP}] )
+ ruby? ( dev-ruby/syntax[ruby_targets_ruby${RUBY_VER/./}] )
+ )
+ virtual/pkgconfig
+ test? ( >=dev-cpp/gtest-1.6.0-r1 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+PDEPEND="app-eselect/eselect-package-manager"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if id paludisbuild >/dev/null 2>/dev/null ; then
+ if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
+ eerror "The 'paludisbuild' user is now expected to be a member of the"
+ eerror "'tty' group. You should add the user to this group before"
+ eerror "upgrading Paludis."
+ die "Please add paludisbuild to tty group"
+ fi
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ) ]]
+ then
+ eerror "Paludis requires at least gcc 4.7 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "Paludis requires at least gcc 4.7"
+ fi
+ fi
+}
+
+pkg_setup() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Fix the script shebang on Ruby scripts.
+ # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
+ sed -i -e "1s/ruby/&${RUBY_VER/./}/" ruby/demos/*.rb || die
+
+ epatch_user
+}
+
+src_configure() {
+ local myconf=(
+ --htmldir=/usr/share/doc/${PF}/html
+
+ $(use_enable doc doxygen)
+ $(use_enable test gtest)
+ $(use_enable pbins)
+ $(use_enable pink)
+ $(use_enable python)
+ $(use python && use_enable doc python-doc)
+ $(use_enable ruby)
+ $(use ruby && use_enable doc ruby-doc)
+ --with-ruby-version="${RUBY_VER}"
+ $(use_enable search-index)
+ $(use_enable xml)
+
+ --enable-vim
+ --with-config-framework=eselect
+ --with-environments=default,portage
+ --with-vim-install-dir=/usr/share/vim/vimfiles
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ dobashcomp bash-completion/cave
+
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_cave
+}
+
+src_test() {
+ # Work around Portage bugs
+ local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ local -x BASH_ENV=/dev/null
+
+ if [[ ${EUID} == 0 ]] ; then
+ # hate
+ local -x PALUDIS_REDUCED_UID=0
+ local -x PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! nonfatal emake -k check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ local pm
+ if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
+ pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
+ fi
+
+ if [[ ${pm} != paludis ]] ; then
+ elog "If you are using paludis or cave as your primary package manager,"
+ elog "you should consider running:"
+ elog " eselect package-manager set paludis"
+ fi
+}
diff --git a/sys-apps/paludis/paludis-9999.ebuild b/sys-apps/paludis/paludis-9999.ebuild
new file mode 100644
index 000000000000..1501384e1c76
--- /dev/null
+++ b/sys-apps/paludis/paludis-9999.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+EGIT_REPO_URI='git://git.exherbo.org/paludis/paludis.git'
+PYTHON_COMPAT=( python2_7 )
+# matching profile defaults for now
+RUBY_VER=2.0
+
+inherit autotools bash-completion-r1 eutils git-r3 python-single-r1 user
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.exherbo.org/"
+SRC_URI=""
+
+IUSE="doc pbins pink python ruby search-index test xml"
+LICENSE="GPL-2 vim"
+SLOT="0"
+KEYWORDS=""
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2.13
+ >=app-shells/bash-3.2
+ dev-libs/libpcre[cxx]
+ sys-apps/file
+ pbins? ( >=app-arch/libarchive-3.1.2 )
+ python? (
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.41.0[python,${PYTHON_USEDEP}] )
+ ruby? ( dev-lang/ruby:${RUBY_VER} )
+ search-index? ( >=dev-db/sqlite-3 )
+ xml? ( >=dev-libs/libxml2-2.6 )"
+
+DEPEND="${COMMON_DEPEND}
+ >=app-text/asciidoc-8.6.3
+ app-text/htmltidy
+ app-text/xmlto
+ >=sys-devel/gcc-4.7
+ doc? (
+ || (
+ >=app-doc/doxygen-1.5.3
+ <=app-doc/doxygen-1.5.1 )
+ python? (
+ dev-python/sphinx[${PYTHON_USEDEP}] )
+ ruby? ( dev-ruby/syntax[ruby_targets_ruby${RUBY_VER/./}] )
+ )
+ virtual/pkgconfig
+ test? ( >=dev-cpp/gtest-1.6.0-r1 )"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+PDEPEND="app-eselect/eselect-package-manager"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if id paludisbuild >/dev/null 2>/dev/null ; then
+ if ! groups paludisbuild | grep --quiet '\<tty\>' ; then
+ eerror "The 'paludisbuild' user is now expected to be a member of the"
+ eerror "'tty' group. You should add the user to this group before"
+ eerror "upgrading Paludis."
+ die "Please add paludisbuild to tty group"
+ fi
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ) ]]
+ then
+ eerror "Paludis requires at least gcc 4.7 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "Paludis requires at least gcc 4.7"
+ fi
+ fi
+}
+
+pkg_setup() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild,tty"
+
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Fix the script shebang on Ruby scripts.
+ # https://bugs.gentoo.org/show_bug.cgi?id=439372#c2
+ sed -i -e "1s/ruby/&${RUBY_VER/./}/" ruby/demos/*.rb || die
+
+ ./autotools_prepare.bash || die
+ eautoreconf
+ epatch_user
+}
+
+src_configure() {
+ local myconf=(
+ --htmldir=/usr/share/doc/${PF}/html
+
+ $(use_enable doc doxygen)
+ $(use_enable test gtest)
+ $(use_enable pbins)
+ $(use_enable pink)
+ $(use_enable python)
+ $(use python && use_enable doc python-doc)
+ $(use_enable ruby)
+ $(use ruby && use_enable doc ruby-doc)
+ --with-ruby-version="${RUBY_VER}"
+ $(use_enable search-index)
+ $(use_enable xml)
+
+ --enable-vim
+ --with-config-framework=eselect
+ --with-environments=default,portage
+ --with-vim-install-dir=/usr/share/vim/vimfiles
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ dobashcomp bash-completion/cave
+
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_cave
+}
+
+src_test() {
+ # Work around Portage bugs
+ local -x PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ local -x BASH_ENV=/dev/null
+
+ if [[ ${EUID} == 0 ]] ; then
+ # hate
+ local -x PALUDIS_REDUCED_UID=0
+ local -x PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! nonfatal emake -k check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ local pm
+ if [[ -f ${ROOT}/etc/env.d/50package-manager ]] ; then
+ pm=$( source "${ROOT}"/etc/env.d/50package-manager ; echo "${PACKAGE_MANAGER}" )
+ fi
+
+ if [[ ${pm} != paludis ]] ; then
+ elog "If you are using paludis or cave as your primary package manager,"
+ elog "you should consider running:"
+ elog " eselect package-manager set paludis"
+ fi
+}
diff --git a/sys-apps/paxctl/Manifest b/sys-apps/paxctl/Manifest
new file mode 100644
index 000000000000..124f10239944
--- /dev/null
+++ b/sys-apps/paxctl/Manifest
@@ -0,0 +1,3 @@
+DIST paxctl-0.7.tar.bz2 7642 SHA256 f7077784ca5695bf74061e6f66b86db855e0dcaa1fc94e6251f6ecd0b879cdc8 SHA512 d715d7466c5d5b402a7b6c44257b959c81234b8b72dc3bad4ad1080f66da784b348e73fadd3b2072ddec6c6b08f042a35cbf9d63cb890ef9efceb1e2e8d56d0a WHIRLPOOL f8bec0f10f134021fb1f6ca201719e4ad8893e07f81e7e0fa5c835cde423d2fe726cfab7f122352cfcd0788a3cfe415b8c754f65502a701f5adbc60c87959cf8
+DIST paxctl-0.8.tar.gz 8027 SHA256 b5022768ed011a95bfe1770804349bf22a6973220997687d9a9ac58263aeef80 SHA512 9357601a96a7780bf900621e8b88e8e7cd323159084f62f30cd6967319fffabe08efff3596612fd05a1daf639610bb15d998f4a954c980ab4f45c9a0cc80037c WHIRLPOOL 52e107950d8efd107e22d2a25a8edf97d79dda832b9c222493d1c7dd693846da6dd5b287fc90bc6eb7034686f654159fdb5422df97026da182b7e97537f2be36
+DIST paxctl-0.9.tar.gz 8109 SHA256 a330ddd812688169802a3ba29e5e3b19956376b8f6f73b8d7e9586eb04423c2e SHA512 4048544bd05ed6eb37866034ade8482b8d017110ed9a639f220e8d2e32bb3dfb6c913a986c8fd41829e88efa793f7552eaa2a6d6b2af533c44a5754a5ab8650f WHIRLPOOL a117a73a9dd3e256da0d0f2a4b7a103af212e4522498909bc6b843f16922a7f3f1aaa10ed9240c38627cb204c51303d95c8895449aafbfffea4cb6200faf53aa
diff --git a/sys-apps/paxctl/metadata.xml b/sys-apps/paxctl/metadata.xml
new file mode 100644
index 000000000000..e217c3733475
--- /dev/null
+++ b/sys-apps/paxctl/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>hardened</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/paxctl/paxctl-0.7-r2.ebuild b/sys-apps/paxctl/paxctl-0.7-r2.ebuild
new file mode 100644
index 000000000000..f67f1383e348
--- /dev/null
+++ b/sys-apps/paxctl/paxctl-0.7-r2.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 toolchain-funcs eutils
+
+DESCRIPTION="Manages various PaX related program header flags for Elf32, Elf64, binaries"
+SRC_URI="http://pax.grsecurity.net/${P}.tar.bz2"
+HOMEPAGE="http://pax.grsecurity.net"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+LICENSE="GPL-2"
+SLOT="0"
+
+DEPEND=">=sys-devel/binutils-2.14.90.0.8-r1"
+RDEPEND=""
+
+src_prepare() {
+ sed \
+ "s:--owner 0 --group 0::g" \
+ -i Makefile || die
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_install () {
+ emake DESTDIR="${ED}" install
+ dodoc README ChangeLog
+}
diff --git a/sys-apps/paxctl/paxctl-0.8.ebuild b/sys-apps/paxctl/paxctl-0.8.ebuild
new file mode 100644
index 000000000000..35c1c1aafcf1
--- /dev/null
+++ b/sys-apps/paxctl/paxctl-0.8.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 toolchain-funcs eutils
+
+DESCRIPTION="Manages various PaX related program header flags for Elf32, Elf64, binaries"
+SRC_URI="http://pax.grsecurity.net/${P}.tar.gz"
+HOMEPAGE="http://pax.grsecurity.net"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+LICENSE="GPL-2"
+SLOT="0"
+
+DEPEND=">=sys-devel/binutils-2.14.90.0.8-r1"
+RDEPEND=""
+
+src_prepare() {
+ sed \
+ "s:--owner 0 --group 0::g" \
+ -i Makefile || die
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_install () {
+ emake DESTDIR="${ED}" install
+ dodoc README ChangeLog
+}
diff --git a/sys-apps/paxctl/paxctl-0.9.ebuild b/sys-apps/paxctl/paxctl-0.9.ebuild
new file mode 100644
index 000000000000..8e02da60a64a
--- /dev/null
+++ b/sys-apps/paxctl/paxctl-0.9.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Manages various PaX related program header flags for Elf32, Elf64, binaries"
+SRC_URI="http://pax.grsecurity.net/${P}.tar.gz"
+HOMEPAGE="http://pax.grsecurity.net"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+LICENSE="GPL-2"
+SLOT="0"
+
+DEPEND=">=sys-devel/binutils-2.14.90.0.8-r1"
+RDEPEND=""
+
+src_prepare() {
+ sed \
+ "s:--owner 0 --group 0::g" \
+ -i Makefile || die
+ epatch_user
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+}
+
+src_install () {
+ emake DESTDIR="${ED}" install
+ dodoc README ChangeLog
+}
diff --git a/sys-apps/paxctld/Manifest b/sys-apps/paxctld/Manifest
new file mode 100644
index 000000000000..d83f9b890f92
--- /dev/null
+++ b/sys-apps/paxctld/Manifest
@@ -0,0 +1 @@
+DIST paxctld_1.0.orig.tar.gz 14708 SHA256 b16173d88f631cfb34eb617f7b1a015e989eeb8c100987ef58203bc28d89ddb4 SHA512 244233681704885b081b16b6c23312df4be7f9962bfcf1196e54ff4be2fbdbaa1832c3115998d27e20a7af463a888c5756148929da12f6028a4dd26327c64bd3 WHIRLPOOL cb4d54508ae5aa2aebd63b32bf32cf1d4e4807e85c7bee6e36c23a5257fac09945e7bff8dce85e9eca2c67182c26f17f7b34ce1b6a25685c4d09febf61463a76
diff --git a/sys-apps/paxctld/metadata.xml b/sys-apps/paxctld/metadata.xml
new file mode 100644
index 000000000000..e217c3733475
--- /dev/null
+++ b/sys-apps/paxctld/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>hardened</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/paxctld/paxctld-1.0.ebuild b/sys-apps/paxctld/paxctld-1.0.ebuild
new file mode 100644
index 000000000000..26106e85b21e
--- /dev/null
+++ b/sys-apps/paxctld/paxctld-1.0.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+DESCRIPTION="PaX flags maintenance daemon"
+HOMEPAGE="http://www.grsecurity.net/"
+SRC_URI="http://dev.gentoo.org/~blueness/hardened-sources/paxctld/${PN}_${PV}.orig.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="pam"
+
+RDEPEND=""
+DEPEND=""
+
+src_prepare() {
+ # Respect Gentoo flags and don't strip
+ sed -i \
+ -e '/^CC/d' \
+ -e '/^CFLAGS/d' \
+ -e '/^LDFLAGS/d' \
+ -e '/STRIP/d' \
+ Makefile
+}
diff --git a/sys-apps/pciutils/Manifest b/sys-apps/pciutils/Manifest
new file mode 100644
index 000000000000..1ee6d826701d
--- /dev/null
+++ b/sys-apps/pciutils/Manifest
@@ -0,0 +1,4 @@
+DIST pciutils-3.2.0.tar.gz 357003 SHA256 84e705bff712b128a942117565a3506bd4b8bf841d397c1962c6255169762f71 SHA512 ce619bca35c529f947b883858164584db9fd16be05b44bd20d7f30b73246076b8c80a9e0ff3f7b2c27366a08043488ccfee98dd3cb43e3c5ee8962efaa056fd1 WHIRLPOOL fda9efb423ba444b460986b82b89feb3e5940d63774377eab4dce6ed1a1c690824192ca25d04a4f34960412ddedbdb9c874dace2256ccd1dede61ee99618b418
+DIST pciutils-3.2.1.tar.gz 367046 SHA256 b31131b721fa26378b4af61b1c49986ff40fe590bc210545b210b6b774337858 SHA512 b8b2983743728eebe9f26de3b96fc8242853bbcac07df02684510c9a3ac43b0258601f5063d16fb09407cadcda7e5778a41f57423d031244f66e34041c4dbf02 WHIRLPOOL 877cfa1d28df52389179eb5ec7bc1dab7fc1677574f2694d5ca8fe33bb76dcae04a2b25b3f0cc704dd9fe6d4cf4206671799f49aa92476e9f3f74e2ca108ff1f
+DIST pciutils-3.3.0.tar.gz 424967 SHA256 4b576a1c2570046fda83fa2c5488661de698874ab04fd8e06eef4b6ab806d58a SHA512 bd8c1177dfd59250f573e22c933df1673af1489758218aeb73d1b480954993fc34e7f67ae7f1a257e8b23044f7f52a806fe37947f6ea20a39e30471d9a8a4085 WHIRLPOOL 67f99d6130344e866601f5e14ff28f0929812d7d5d36e2485e51d00d1c61a514288bb8b899703a50b90e886668a485a013b40be98475a52fbc20896d08229976
+DIST pciutils-3.3.1.tar.gz 393912 SHA256 02beeb14503707c5a3293fe084c18e12e6937c0d4dd1e29e6bcb6b12f124df46 SHA512 4f8b0e62cfd0ffad1674be13c95f5581bc0037ed9843f9866b13eea6fa2703bb39bb878e96df805972f4e9bac36fc67a0a313c463f0764218211f1276cef36b2 WHIRLPOOL 315f1f4f5b98e6e90e3a6af9a8a03acf9732eb5b6de02ced53b32bdaca67360153ee4db1551729e3534d25c81ce2308d89c0715e0554552d029cbb3f18786ff6
diff --git a/sys-apps/pciutils/files/conf.d-pciparm b/sys-apps/pciutils/files/conf.d-pciparm
new file mode 100644
index 000000000000..f036b15ad20c
--- /dev/null
+++ b/sys-apps/pciutils/files/conf.d-pciparm
@@ -0,0 +1,28 @@
+# PCI tweaking article:
+# http://www.gentoo.org/doc/en/articles/hardware-stability-p2.xml
+#
+# Apply to all devices:
+# PCIPARM_ALL="...."
+# Cards also can be addressed by vid:pid or by bus:slot.func
+# (see setpci man page relative to -d and -s options)
+# PCIPARM_(BUS|VENDOR)_#="...."
+# Where # is sequentially numbered from zero.
+
+# Examples:
+# "open up" the PCI bus by allowing fairly long bursts
+# for all devices, increasing performance
+# (equivalent to: setpci -v -d *:* latency_timer=b0)
+#PCIPARM_ALL="latency_timer=b0"
+
+# maximize latency timers for network and audio,
+# allowing them to transmit more data per burst,
+# preventing buffer over/under-run conditions
+#PCIPARM_BUS_0="00:04.0 latency_timer=ff"
+#PCIPARM_BUS_1="01:04.0 latency_timer=ff"
+#PCIPARM_VENDOR_0="1057:3410 latency_timer=ff"
+
+# -v : whether to be verbose about changes
+# -D : dry-run, no commit
+# -f : do not warn if the change is already set
+# (see the setpci manpage for more advanced options)
+SETPCI_OPT="-f"
diff --git a/sys-apps/pciutils/files/init.d-pciparm b/sys-apps/pciutils/files/init.d-pciparm
new file mode 100644
index 000000000000..d7973bf81412
--- /dev/null
+++ b/sys-apps/pciutils/files/init.d-pciparm
@@ -0,0 +1,80 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ before bootmisc hdparm
+ after localmount
+}
+
+checkconfig() {
+ if [ ! -f /etc/conf.d/pciparm ]; then
+ ewarn "/etc/conf.d/pciparm does not exist, skipping"
+ return 1
+ fi
+
+ if [ -z "${PCIPARM_ALL}" -a -z "${PCIPARM_BUS_0}" -a -z "${PCIPARM_VENDOR_0}" ]; then
+ ewarn "None of PCIPARM_ALL, PCIPARM_BUS_* or PCIPARM_VENDOR_* set in /etc/conf.d/pciparm"
+ return 1
+ fi
+}
+
+do_setpci() {
+ #ewarn "do_setpci: /usr/sbin/setpci $SETPCI_OPT $@"
+ SWITCH=$1
+ SPEC_ID=$2
+ shift 2
+ case "$SWITCH" in
+ -d) DESC=vendor ;;
+ -s) DESC=bus ;;
+ *) eerror "Unknown setpci type: $SWITCH" ; return 1 ;;
+ esac
+
+ if [ -z "$SPEC_ID" ]; then
+ eerror "Missing device specifier!"
+ return 1
+ fi
+ if [ -z "$*" ]; then
+ eerror "Missing configuration to set for ($DESC) $SPEC_ID!"
+ return 1
+ fi
+
+ ebegin "Setting PCI params for ($DESC) $SPEC_ID to $@"
+ /usr/sbin/setpci $SETPCI_OPT $SWITCH $SPEC_ID "$@"
+ rc=$?
+ eend $rc
+ return $rc
+}
+
+do_setpci_array() {
+ name=$1
+ shift
+ i=0
+ while true; do
+ eval opt="\$${name}_$i"
+ # End of loop
+ [ -z "${opt}" ] && break
+ # Pass in all other parameters here, in case we want to use multiple
+ # arguments later.
+ do_setpci "$@" $opt #|| return 1
+ i=$(($i+1))
+ done
+}
+
+start() {
+ if get_bootparam "nopciparm" ; then
+ ewarn "Skipping pciparm init as requested in kernel cmdline"
+ return 0
+ fi
+
+ checkconfig || return 1
+
+ # We do not exit after any errors presently, because it might be a
+ # stability-related fix after a failure.
+ [ -n "$PCIPARM_ALL" ] && \
+ do_setpci -d '*:*' $PCIPARM_ALL #|| return 1
+
+ do_setpci_array PCIPARM_BUS -s #|| return 1
+ do_setpci_array PCIPARM_VENDOR -d #|| return 1
+}
diff --git a/sys-apps/pciutils/files/pciutils-3.1.9-static-pc.patch b/sys-apps/pciutils/files/pciutils-3.1.9-static-pc.patch
new file mode 100644
index 000000000000..9e63b7ecd661
--- /dev/null
+++ b/sys-apps/pciutils/files/pciutils-3.1.9-static-pc.patch
@@ -0,0 +1,13 @@
+make sure all lib entries get into libs.private in the .pc file
+
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -61,7 +61,7 @@ $(PCILIBPC): libpci.pc.in
+ -e 's,@LIBDIR@,$(LIBDIR),' \
+ -e 's,@IDSDIR@,$(IDSDIR),' \
+ -e 's,@VERSION@,$(VERSION),' \
+- -e 's,@LDLIBS@,$(LDLIBS),'
++ -e 's,@LDLIBS@,$(LDLIBS) $(LIB_LDLIBS),'
+
+ init.o: init.c $(INCL)
+ access.o: access.c $(INCL)
diff --git a/sys-apps/pciutils/metadata.xml b/sys-apps/pciutils/metadata.xml
new file mode 100644
index 000000000000..aab71979be31
--- /dev/null
+++ b/sys-apps/pciutils/metadata.xml
@@ -0,0 +1,10 @@
+<?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='dns'>Enable support for querying the central database of PCI IDs using DNS</flag>
+ <flag name='kmod'>Enable <pkg>sys-apps/kmod</pkg> support for the -k switch in lspci command</flag>
+ <flag name='zlib'>Support compressed pci.ids database</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/pciutils/pciutils-3.2.0.ebuild b/sys-apps/pciutils/pciutils-3.2.0.ebuild
new file mode 100644
index 000000000000..e722377e3f81
--- /dev/null
+++ b/sys-apps/pciutils/pciutils-3.2.0.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Various utilities dealing with the PCI bus"
+HOMEPAGE="http://mj.ucw.cz/sw/pciutils/ http://git.kernel.org/?p=utils/pciutils/pciutils.git"
+SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="+kmod static-libs zlib"
+
+# Have the sub-libs in RDEPEND with [static-libs] since, logically,
+# our libssl.a depends on libz.a/etc... at runtime.
+LIB_DEPEND="zlib? ( sys-libs/zlib[static-libs(+)] )"
+DEPEND="kmod? ( sys-apps/kmod )
+ static-libs? ( ${LIB_DEPEND} )
+ !static-libs? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+RDEPEND="${DEPEND}
+ sys-apps/hwids"
+DEPEND="${DEPEND}
+ kmod? ( virtual/pkgconfig )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.9-static-pc.patch
+
+ if use static-libs ; then
+ cp -pPR "${S}" "${S}.static" || die
+ fi
+}
+
+pemake() {
+ emake \
+ HOST="${CHOST}" \
+ CROSS_COMPILE="${CHOST}-" \
+ CC="$(tc-getCC)" \
+ DNS="yes" \
+ IDSDIR='$(SHAREDIR)/misc' \
+ MANDIR='$(SHAREDIR)/man' \
+ PREFIX="${EPREFIX}/usr" \
+ SHARED="yes" \
+ STRIP="" \
+ ZLIB=$(usex zlib) \
+ PCI_COMPRESSED_IDS=0 \
+ PCI_IDS=pci.ids \
+ LIBDIR="\${PREFIX}/$(get_libdir)" \
+ LIBKMOD="$(usex kmod)" \
+ "$@"
+}
+
+src_compile() {
+ pemake OPT="${CFLAGS}" all
+ if use static-libs ; then
+ pemake \
+ -C "${S}.static" \
+ OPT="${CFLAGS}" \
+ SHARED="no" \
+ lib/libpci.a
+ fi
+}
+
+src_install() {
+ pemake DESTDIR="${D}" install install-lib
+ use static-libs && dolib.a "${S}.static/lib/libpci.a"
+ dodoc ChangeLog README TODO
+
+ rm "${ED}"/usr/sbin/update-pciids "${ED}"/usr/share/misc/pci.ids \
+ "${ED}"/usr/share/man/man8/update-pciids.8*
+
+ newinitd "${FILESDIR}"/init.d-pciparm pciparm
+ newconfd "${FILESDIR}"/conf.d-pciparm pciparm
+}
+
+pkg_postinst() {
+ if [[ ${REPLACING_VERSIONS} ]] && [[ ${REPLACING_VERSIONS} < 3.2.0 ]]; then
+ elog "The 'network-cron' USE flag is gone; if you want a more up-to-date"
+ elog "pci.ids file, you should use sys-apps/hwids-99999999 (live ebuild)."
+ fi
+}
diff --git a/sys-apps/pciutils/pciutils-3.2.1.ebuild b/sys-apps/pciutils/pciutils-3.2.1.ebuild
new file mode 100644
index 000000000000..6ef3781e5e8a
--- /dev/null
+++ b/sys-apps/pciutils/pciutils-3.2.1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="Various utilities dealing with the PCI bus"
+HOMEPAGE="http://mj.ucw.cz/sw/pciutils/ http://git.kernel.org/?p=utils/pciutils/pciutils.git"
+SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="dns +kmod static-libs zlib"
+
+# Have the sub-libs in RDEPEND with [static-libs] since, logically,
+# our libssl.a depends on libz.a/etc... at runtime.
+LIB_DEPEND="zlib? ( sys-libs/zlib[static-libs(+)] )"
+DEPEND="kmod? ( sys-apps/kmod )
+ static-libs? ( ${LIB_DEPEND} )
+ !static-libs? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+RDEPEND="${DEPEND}
+ sys-apps/hwids"
+DEPEND="${DEPEND}
+ kmod? ( virtual/pkgconfig )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.9-static-pc.patch
+
+ if use static-libs ; then
+ cp -pPR "${S}" "${S}.static" || die
+ fi
+}
+
+pemake() {
+ emake \
+ HOST="${CHOST}" \
+ CROSS_COMPILE="${CHOST}-" \
+ CC="$(tc-getCC)" \
+ DNS=$(usex dns) \
+ IDSDIR='$(SHAREDIR)/misc' \
+ MANDIR='$(SHAREDIR)/man' \
+ PREFIX="${EPREFIX}/usr" \
+ SHARED="yes" \
+ STRIP="" \
+ ZLIB=$(usex zlib) \
+ PCI_COMPRESSED_IDS=0 \
+ PCI_IDS=pci.ids \
+ LIBDIR="\${PREFIX}/$(get_libdir)" \
+ LIBKMOD=$(usex kmod) \
+ "$@"
+}
+
+src_compile() {
+ pemake OPT="${CFLAGS}" all
+ if use static-libs ; then
+ pemake \
+ -C "${S}.static" \
+ OPT="${CFLAGS}" \
+ SHARED="no" \
+ lib/libpci.a
+ fi
+}
+
+src_install() {
+ pemake DESTDIR="${D}" install install-lib
+ use static-libs && dolib.a "${S}.static/lib/libpci.a"
+ dodoc ChangeLog README TODO
+
+ rm "${ED}"/usr/sbin/update-pciids "${ED}"/usr/share/misc/pci.ids \
+ "${ED}"/usr/share/man/man8/update-pciids.8*
+
+ newinitd "${FILESDIR}"/init.d-pciparm pciparm
+ newconfd "${FILESDIR}"/conf.d-pciparm pciparm
+}
+
+pkg_postinst() {
+ if [[ ${REPLACING_VERSIONS} ]] && [[ ${REPLACING_VERSIONS} < 3.2.0 ]]; then
+ elog "The 'network-cron' USE flag is gone; if you want a more up-to-date"
+ elog "pci.ids file, you should use sys-apps/hwids-99999999 (live ebuild)."
+ fi
+}
diff --git a/sys-apps/pciutils/pciutils-3.3.0-r2.ebuild b/sys-apps/pciutils/pciutils-3.3.0-r2.ebuild
new file mode 100644
index 000000000000..9025dbf7fb71
--- /dev/null
+++ b/sys-apps/pciutils/pciutils-3.3.0-r2.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs multilib-minimal
+
+DESCRIPTION="Various utilities dealing with the PCI bus"
+HOMEPAGE="http://mj.ucw.cz/sw/pciutils/ http://git.kernel.org/?p=utils/pciutils/pciutils.git"
+SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="dns +kmod static-libs +udev zlib"
+
+# Have the sub-libs in RDEPEND with [static-libs] since, logically,
+# our libssl.a depends on libz.a/etc... at runtime.
+LIB_DEPEND="zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+),${MULTILIB_USEDEP}] )"
+DEPEND="kmod? ( sys-apps/kmod )
+ static-libs? ( ${LIB_DEPEND} )
+ !static-libs? ( ${LIB_DEPEND//static-libs(+),} )
+ udev? ( >=virtual/libudev-208[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}
+ sys-apps/hwids
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${DEPEND}
+ kmod? ( virtual/pkgconfig )"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pci/config.h )
+
+switch_config() {
+ [[ $# -ne 2 ]] && return 1
+ local opt=$1 val=$2
+
+ sed "s@^\(${opt}=\).*\$@\1${val}@" -i Makefile || die
+ return 0
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.9-static-pc.patch
+
+ if use static-libs ; then
+ cp -pPR "${S}" "${S}.static" || die
+ mv "${S}.static" "${S}/static" || die
+ fi
+
+ multilib_copy_sources
+}
+
+pemake() {
+ emake \
+ HOST="${CHOST}" \
+ CROSS_COMPILE="${CHOST}-" \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ RANLIB="$(tc-getRANLIB)" \
+ DNS=$(usex dns) \
+ IDSDIR='$(SHAREDIR)/misc' \
+ MANDIR='$(SHAREDIR)/man' \
+ PREFIX="${EPREFIX}/usr" \
+ SHARED="yes" \
+ STRIP="" \
+ ZLIB=$(usex zlib) \
+ PCI_COMPRESSED_IDS=0 \
+ PCI_IDS=pci.ids \
+ LIBDIR="\${PREFIX}/$(get_libdir)" \
+ LIBKMOD=$(multilib_native_usex kmod) \
+ HWDB=$(usex udev) \
+ "$@"
+}
+
+multilib_src_compile() {
+ pemake OPT="${CFLAGS}" all
+ if use static-libs ; then
+ pemake \
+ -C "${BUILD_DIR}/static" \
+ OPT="${CFLAGS}" \
+ SHARED="no" \
+ lib/libpci.a
+ fi
+}
+
+multilib_src_install() {
+ pemake DESTDIR="${D}" install install-lib
+ use static-libs && dolib.a "${BUILD_DIR}/static/lib/libpci.a"
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog README TODO
+
+ rm "${ED}"/usr/sbin/update-pciids "${ED}"/usr/share/misc/pci.ids \
+ "${ED}"/usr/share/man/man8/update-pciids.8*
+
+ newinitd "${FILESDIR}"/init.d-pciparm pciparm
+ newconfd "${FILESDIR}"/conf.d-pciparm pciparm
+}
+
+pkg_postinst() {
+ if [[ ${REPLACING_VERSIONS} ]] && [[ ${REPLACING_VERSIONS} < 3.2.0 ]]; then
+ elog "The 'network-cron' USE flag is gone; if you want a more up-to-date"
+ elog "pci.ids file, you should use sys-apps/hwids-99999999 (live ebuild)."
+ fi
+}
diff --git a/sys-apps/pciutils/pciutils-3.3.1.ebuild b/sys-apps/pciutils/pciutils-3.3.1.ebuild
new file mode 100644
index 000000000000..b08c2c617235
--- /dev/null
+++ b/sys-apps/pciutils/pciutils-3.3.1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs multilib-minimal
+
+DESCRIPTION="Various utilities dealing with the PCI bus"
+HOMEPAGE="http://mj.ucw.cz/sw/pciutils/ http://git.kernel.org/?p=utils/pciutils/pciutils.git"
+SRC_URI="ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="dns +kmod static-libs +udev zlib"
+
+# Have the sub-libs in RDEPEND with [static-libs] since, logically,
+# our libssl.a depends on libz.a/etc... at runtime.
+LIB_DEPEND="zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+),${MULTILIB_USEDEP}] )"
+DEPEND="kmod? ( sys-apps/kmod )
+ static-libs? ( ${LIB_DEPEND} )
+ !static-libs? ( ${LIB_DEPEND//static-libs(+),} )
+ udev? ( >=virtual/libudev-208[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}
+ sys-apps/hwids
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r14
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+DEPEND="${DEPEND}
+ kmod? ( virtual/pkgconfig )"
+
+MULTILIB_WRAPPED_HEADERS=( /usr/include/pci/config.h )
+
+switch_config() {
+ [[ $# -ne 2 ]] && return 1
+ local opt=$1 val=$2
+
+ sed "s@^\(${opt}=\).*\$@\1${val}@" -i Makefile || die
+ return 0
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.9-static-pc.patch
+
+ if use static-libs ; then
+ cp -pPR "${S}" "${S}.static" || die
+ mv "${S}.static" "${S}/static" || die
+ fi
+
+ multilib_copy_sources
+}
+
+pemake() {
+ emake \
+ HOST="${CHOST}" \
+ CROSS_COMPILE="${CHOST}-" \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ RANLIB="$(tc-getRANLIB)" \
+ DNS=$(usex dns) \
+ IDSDIR='$(SHAREDIR)/misc' \
+ MANDIR='$(SHAREDIR)/man' \
+ PREFIX="${EPREFIX}/usr" \
+ SHARED="yes" \
+ STRIP="" \
+ ZLIB=$(usex zlib) \
+ PCI_COMPRESSED_IDS=0 \
+ PCI_IDS=pci.ids \
+ LIBDIR="\${PREFIX}/$(get_libdir)" \
+ LIBKMOD=$(multilib_native_usex kmod) \
+ HWDB=$(usex udev) \
+ "$@"
+}
+
+multilib_src_compile() {
+ pemake OPT="${CFLAGS}" all
+ if use static-libs ; then
+ pemake \
+ -C "${BUILD_DIR}/static" \
+ OPT="${CFLAGS}" \
+ SHARED="no" \
+ lib/libpci.a
+ fi
+}
+
+multilib_src_install() {
+ pemake DESTDIR="${D}" install install-lib
+ use static-libs && dolib.a "${BUILD_DIR}/static/lib/libpci.a"
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog README TODO
+
+ rm "${ED}"/usr/sbin/update-pciids "${ED}"/usr/share/misc/pci.ids \
+ "${ED}"/usr/share/man/man8/update-pciids.8*
+
+ newinitd "${FILESDIR}"/init.d-pciparm pciparm
+ newconfd "${FILESDIR}"/conf.d-pciparm pciparm
+}
+
+pkg_postinst() {
+ if [[ ${REPLACING_VERSIONS} ]] && [[ ${REPLACING_VERSIONS} < 3.2.0 ]]; then
+ elog "The 'network-cron' USE flag is gone; if you want a more up-to-date"
+ elog "pci.ids file, you should use sys-apps/hwids-99999999 (live ebuild)."
+ fi
+}
diff --git a/sys-apps/pcmciautils/Manifest b/sys-apps/pcmciautils/Manifest
new file mode 100644
index 000000000000..877c7506345d
--- /dev/null
+++ b/sys-apps/pcmciautils/Manifest
@@ -0,0 +1,2 @@
+DIST pcmciautils_018-8.debian.tar.gz 11213 SHA256 597879403120c4c258e5c064a2f695aad133529503d66aac0973a02e80756f36 SHA512 8a00d776e208b43d01fe22b9d4e889bc1b2c5982aa1bf225bdd613ffb0f5b37f5266ccc1cb91df9ac49c4ee3e3653ebb29807b61fff53c585e2cfed5aa2cd9e9 WHIRLPOOL 32083f28e4adbf0034df13bfde6936f885b54b22295e2603dc4992188d2ef9366dfc77358766d9cfb8eb31501c8949f1ba043e079d858f6822ac5cc7ad673296
+DIST pcmciautils_018.orig.tar.gz 48516 SHA256 b94b71347fa11b7c0eb8dae034b5f7f649b135ffacb80cf60572a5bcb118f095 SHA512 f0af1fc6155686ae61c1c85a6451b032088a3880dfbc05c1d1ed33ca8e975745f9d4bedb0f3ee0a1252461aa008bed8014c73ff850cddd89d930524a6d68d47d WHIRLPOOL c74aa10632748bbd28af892c767c59486ddf1cfa3e1c418e3c727a4867d8905af1770696b2ed9bd15c967fc911aad3b4494d923b42e768bd8c87a364e1aa0e77
diff --git a/sys-apps/pcmciautils/metadata.xml b/sys-apps/pcmciautils/metadata.xml
new file mode 100644
index 000000000000..eb1b6a8a8a78
--- /dev/null
+++ b/sys-apps/pcmciautils/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></maintainer>
+<use>
+ <flag name='staticsocket'>Add support for static sockets</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/pcmciautils/pcmciautils-018_p8-r1.ebuild b/sys-apps/pcmciautils/pcmciautils-018_p8-r1.ebuild
new file mode 100644
index 000000000000..409b157da962
--- /dev/null
+++ b/sys-apps/pcmciautils/pcmciautils-018_p8-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic linux-info toolchain-funcs udev
+
+DEB_REV=${PV#*_p}
+MY_PV=${PV%_p*}
+
+DESCRIPTION="PCMCIA userspace utilities for Linux"
+HOMEPAGE="http://packages.qa.debian.org/pcmciautils"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${MY_PV}.orig.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${MY_PV}-${DEB_REV}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~sh ~x86"
+IUSE="debug staticsocket"
+
+RDEPEND="virtual/modutils"
+DEPEND="${RDEPEND}
+ virtual/yacc
+ sys-devel/flex"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ CONFIG_CHECK="~PCMCIA"
+ linux-info_pkg_setup
+
+ kernel_is lt 2 6 32 && ewarn "${P} requires at least kernel 2.6.32."
+
+ mypcmciaopts=(
+ STARTUP=$(usex staticsocket false true)
+ exec_prefix=/usr
+ UDEV=true
+ DEBUG=false
+ STATIC=false
+ V=true
+ udevdir="$(get_udevdir)"
+ CC="$(tc-getCC)"
+ LD="$(tc-getCC)"
+ AR="$(tc-getAR)"
+ STRIP=true
+ RANLIB="$(tc-getRANLIB)"
+ OPTIMIZATION="${CFLAGS} ${CPPFLAGS}"
+ DESTDIR="${D}"
+ )
+
+ use debug && append-cppflags -DDEBUG
+}
+
+src_prepare() {
+ epatch \
+ "${WORKDIR}"/debian/patches/no-modprobe-rules.patch \
+ "${WORKDIR}"/debian/patches/remove-libsysfs-dep.patch
+
+ sed -i \
+ -e '/CFLAGS/s:-fomit-frame-pointer::' \
+ -e '/dir/s:sbin:bin:g' \
+ Makefile || die
+}
+
+src_compile() {
+ emake "${mypcmciaopts[@]}"
+}
+
+src_install() {
+ emake "${mypcmciaopts[@]}" install
+
+ dodoc doc/*.txt
+}
diff --git a/sys-apps/pcmciautils/pcmciautils-018_p8.ebuild b/sys-apps/pcmciautils/pcmciautils-018_p8.ebuild
new file mode 100644
index 000000000000..536a92b5dd0e
--- /dev/null
+++ b/sys-apps/pcmciautils/pcmciautils-018_p8.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic linux-info toolchain-funcs udev
+
+DEB_REV=${PV#*_p}
+MY_PV=${PV%_p*}
+
+DESCRIPTION="PCMCIA userspace utilities for Linux"
+HOMEPAGE="http://packages.qa.debian.org/pcmciautils"
+SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${MY_PV}.orig.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${MY_PV}-${DEB_REV}.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ppc sh x86"
+IUSE="debug staticsocket"
+
+RDEPEND="virtual/modutils"
+DEPEND="${RDEPEND}
+ virtual/yacc
+ sys-devel/flex"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ CONFIG_CHECK="~PCMCIA"
+ linux-info_pkg_setup
+
+ kernel_is lt 2 6 32 && ewarn "${P} requires at least kernel 2.6.32."
+
+ mypcmciaopts=(
+ STARTUP=$(usex staticsocket true false)
+ exec_prefix=/usr
+ UDEV=true
+ DEBUG=false
+ STATIC=false
+ V=true
+ udevdir="$(get_udevdir)"
+ CC="$(tc-getCC)"
+ LD="$(tc-getCC)"
+ AR="$(tc-getAR)"
+ STRIP=true
+ RANLIB="$(tc-getRANLIB)"
+ OPTIMIZATION="${CFLAGS} ${CPPFLAGS}"
+ DESTDIR="${D}"
+ )
+
+ use debug && append-cppflags -DDEBUG
+}
+
+src_prepare() {
+ epatch \
+ "${WORKDIR}"/debian/patches/no-modprobe-rules.patch \
+ "${WORKDIR}"/debian/patches/remove-libsysfs-dep.patch
+
+ sed -i \
+ -e '/CFLAGS/s:-fomit-frame-pointer::' \
+ -e '/dir/s:sbin:bin:g' \
+ Makefile || die
+}
+
+src_compile() {
+ emake "${mypcmciaopts[@]}"
+}
+
+src_install() {
+ emake "${mypcmciaopts[@]}" install
+
+ dodoc doc/*.txt
+}
diff --git a/sys-apps/pcsc-lite/Manifest b/sys-apps/pcsc-lite/Manifest
new file mode 100644
index 000000000000..10f2be86b8e1
--- /dev/null
+++ b/sys-apps/pcsc-lite/Manifest
@@ -0,0 +1,3 @@
+DIST pcsc-lite-1.8.12.tar.bz2 580449 SHA256 f2c30a2aba6805f2859ede5f2eca351ca6c495a18d5d36d74c63e7898b353c51 SHA512 b0ed94187052e0ff73030ecf9f5165d4f8dc4a7f1eb05c6c57c0e5552ae6699c53f12cd72e09812de3c55be86a08ab060a92ad08b5db2686dfa1afbaca336d87 WHIRLPOOL c6feed97170a640b6ee86e2188a124995acf73f618cfc5d4f1cf68a7f8da5955330a255b211606ebb5d50d58a4cfad859a7004fddf06c6476838458e3b7162c3
+DIST pcsc-lite-1.8.13.tar.bz2 584083 SHA256 f315047e808d63a3262c4a040f77548af2e04d1fd707e0c2759369b926fbbc3b SHA512 ce45b48fa0da568690e25f80c8b37c201f8a6eb411c7d12a55748af16eda1d8b39984261f562c5af50ff79d7476597e3363097cb5f0b6ca8fa009d9321d02023 WHIRLPOOL 6bf25e06e26583a8a5ac7f2e7c53f85f3aee0942d838c11afa40c2c95ef4dae805a00c813a11e5eb20221f2a2004608da6fea48b00d6edd661cc728e68d1989f
+DIST pcsc-lite-1.8.8.tar.bz2 551751 SHA256 fe66354a7e738d3ef8b4e572c7e447b85894da9262381fbf004e8abcc12885e7 SHA512 02b0ce81fb1f3a0358967825499ff3687bd7375ac6b0ff892f23c0980864046330a3db6b1296aa7a4baa135f94a8b85112518a2584de3b522bd2b8dc58894658 WHIRLPOOL 70ddcba8d0386a4887353fb3e49b69527bec8f24da01cd45cb9e60a67249c5a63172081cbff9a3cf7025cbe991b37ad8cb9b479b4c69e873ffe948d12fb913dc
diff --git a/sys-apps/pcsc-lite/files/99-pcscd-hotplug.rules b/sys-apps/pcsc-lite/files/99-pcscd-hotplug.rules
new file mode 100644
index 000000000000..936434acf657
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/99-pcscd-hotplug.rules
@@ -0,0 +1,7 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# We add this here so that it runs after ccid's and ifd-gempc's rules;
+# if we just added a pcscd-owned device, we hotplug the pcscd service.
+ACTION=="add", ENV{PCSCD}=="1", GROUP="pcscd", RUN+="/bin/env IN_HOTPLUG=1 /etc/init.d/pcscd --quiet start"
diff --git a/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-nopolkit.patch b/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-nopolkit.patch
new file mode 100644
index 000000000000..82fdb00d9ff1
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-nopolkit.patch
@@ -0,0 +1,35 @@
+Index: pcsc-lite-1.8.11/configure.ac
+===================================================================
+--- pcsc-lite-1.8.11.orig/configure.ac
++++ pcsc-lite-1.8.11/configure.ac
+@@ -284,16 +284,15 @@ fi
+ POLKIT_MINIMUM=0.111
+ AC_ARG_ENABLE(polkit,
+ AS_HELP_STRING([--enable-polkit],
+- [Build with polkit support]),
+- use_polkit=$withval, use_polkit=no)
+-if test "$use_polkit" != "no"; then
+- PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= $POLKIT_MINIMUM], [use_polkit=yes], [use_polkit=no])
+- if test "$use_polkit" != "no";then
++ [Build with polkit support]))
++if test "x$enable_polkit" != "xno"; then
++ PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= $POLKIT_MINIMUM], [enable_polkit=yes], [enable_polkit=no])
++ if test "$enable_polkit" != "no";then
+ AC_DEFINE([HAVE_POLKIT], 1, [Build polkit access control support])
+ polkit_policy_dir=$($PKG_CONFIG polkit-gobject-1 --variable=policydir)
+ AC_SUBST(POLICY_DIR, [$polkit_policy_dir])
+ else
+- use_polkit=no
++ enable_polkit=no
+ AC_MSG_ERROR([[
+ ***
+ *** polkit >= $POLKIT_MINIMUM was not found. Access control will be disabled.
+@@ -301,7 +300,7 @@ if test "$use_polkit" != "no"; then
+ *** ]])
+ fi
+ fi
+-AM_CONDITIONAL(ENABLE_POLKIT, test "$use_polkit" != "no")
++AM_CONDITIONAL(ENABLE_POLKIT, test "$enable_polkit" != "no")
+
+ # --with-systemdsystemunitdir=DIR
+ AC_ARG_WITH([systemdsystemunitdir],
diff --git a/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch b/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch
new file mode 100644
index 000000000000..e7a7b515820e
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcsc-lite-1.8.11-polkit-pcscd.patch
@@ -0,0 +1,20 @@
+Index: pcsc-lite-1.8.11/doc/org.debian.pcsc-lite.policy
+===================================================================
+--- pcsc-lite-1.8.11.orig/doc/org.debian.pcsc-lite.policy
++++ pcsc-lite-1.8.11/doc/org.debian.pcsc-lite.policy
+@@ -15,6 +15,7 @@
+ <allow_inactive>auth_admin</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
++ <annotate key="org.freedesktop.policykit.owner">unix-user:pcscd</annotate>
+ </action>
+
+ <action id="org.debian.pcsc-lite.access_card">
+@@ -25,6 +26,7 @@
+ <allow_inactive>auth_admin</allow_inactive>
+ <allow_active>yes</allow_active>
+ </defaults>
++ <annotate key="org.freedesktop.policykit.owner">unix-user:pcscd</annotate>
+ </action>
+
+ </policyconfig>
diff --git a/sys-apps/pcsc-lite/files/pcscd-init.5 b/sys-apps/pcsc-lite/files/pcscd-init.5
new file mode 100644
index 000000000000..4ff7dfdd58c0
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcscd-init.5
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+name="PC/SC Daemon"
+
+pidfile=/var/run/pcscd/pcscd.pid
+
+command=/usr/sbin/pcscd
+command_args="${EXTRA_OPTS}"
+
+start_stop_daemon_args="--user pcscd:pcscd"
+
+depend() {
+ need localmount
+ after udev openct
+ use logger
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o pcscd:pcscd /var/run/pcscd
+}
diff --git a/sys-apps/pcsc-lite/files/pcscd-init.6 b/sys-apps/pcsc-lite/files/pcscd-init.6
new file mode 100644
index 000000000000..35b3038f201f
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcscd-init.6
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+name="PC/SC Daemon"
+
+pidfile=/run/pcscd/pcscd.pid
+
+command=/usr/sbin/pcscd
+command_args="${EXTRA_OPTS}"
+
+start_stop_daemon_args="--user pcscd:pcscd"
+
+depend() {
+ need localmount
+ after udev openct
+ use logger
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o pcscd:pcscd /run/pcscd
+}
diff --git a/sys-apps/pcsc-lite/files/pcscd-init.7 b/sys-apps/pcsc-lite/files/pcscd-init.7
new file mode 100644
index 000000000000..b47e1df402d5
--- /dev/null
+++ b/sys-apps/pcsc-lite/files/pcscd-init.7
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+name="PC/SC Daemon"
+
+pidfile=/run/pcscd/pcscd.pid
+
+command=/usr/sbin/pcscd
+command_args="${EXTRA_OPTS}"
+
+start_stop_daemon_args="--user pcscd:pcscd"
+
+depend() {
+ need localmount
+ after udev openct dbus
+ use logger
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o pcscd:pcscd /run/pcscd
+}
diff --git a/sys-apps/pcsc-lite/metadata.xml b/sys-apps/pcsc-lite/metadata.xml
new file mode 100644
index 000000000000..d4fe6b8b20e7
--- /dev/null
+++ b/sys-apps/pcsc-lite/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>crypto</herd>
+ <longdescription>
+ PC/SC Architecture smartcard middleware library
+ </longdescription>
+
+ <use>
+ <flag name='libusb' restrict="&gt;=sys-apps/pcsc-lite-1.8.0">
+ Use <pkg>dev-libs/libusb</pkg> detection to hotplug new
+ smartcard readers. This flag should only be enabled if you're
+ running a non-Linux kernel or you don't want to use
+ <pkg>sys-fs/udev</pkg>.
+ </flag>
+
+ <flag name='udev'>
+ Use <pkg>sys-fs/udev</pkg> rules to handle devices' permissions
+ and hotplug support. Unless you know what you're doing do not
+ disable this flag on Linux kernels. This is provided as an
+ option for completeness.
+ </flag>
+
+ <flag name='policykit'>
+ Uses <pkg>sys-auth/polkit</pkg> to restrict access to smartcard readers or
+ smartcars to given users.
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/pcsc-lite/pcsc-lite-1.8.12-r1.ebuild b/sys-apps/pcsc-lite/pcsc-lite-1.8.12-r1.ebuild
new file mode 100644
index 000000000000..04e55a708c90
--- /dev/null
+++ b/sys-apps/pcsc-lite/pcsc-lite-1.8.12-r1.ebuild
@@ -0,0 +1,106 @@
+# 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 eutils python-single-r1 multilib systemd udev user
+
+DESCRIPTION="PC/SC Architecture smartcard middleware library"
+HOMEPAGE="http://pcsclite.alioth.debian.org/"
+
+STUPID_NUM="4115"
+MY_P="${PN}-${PV/_/-}"
+SRC_URI="http://alioth.debian.org/download.php/file/${STUPID_NUM}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+# GPL-2 is there for the init script; everything else comes from
+# upstream.
+LICENSE="BSD ISC MIT GPL-3+ GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+
+# This is called libusb so that it doesn't fool people in thinking that
+# it is _required_ for USB support. Otherwise they'll disable udev and
+# that's going to be worse.
+IUSE="libusb policykit selinux +udev"
+
+REQUIRED_USE="^^ ( udev libusb )"
+
+CDEPEND="${PYTHON_DEPS}
+ libusb? ( virtual/libusb:1 )
+ udev? ( virtual/udev )
+ policykit? ( >=sys-auth/polkit-0.111 )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !<app-crypt/ccid-1.4.1-r1
+ !<sys-apps/baselayout-2
+ !<sys-apps/openrc-0.11.8
+ selinux? ( sec-policy/selinux-pcscd )
+"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+
+ enewgroup openct # make sure it exists
+ enewgroup pcscd
+ enewuser pcscd -1 -1 /run/pcscd pcscd,openct
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.8.11-polkit-pcscd.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-maintainer-mode \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb" \
+ --enable-ipcdir=/run/pcscd \
+ $(use_enable udev libudev) \
+ $(use_enable libusb) \
+ $(use_enable policykit polkit) \
+ "$(systemd_with_unitdir)" \
+ ${myconf}
+}
+
+DOCS=( AUTHORS DRIVERS HELP README SECURITY ChangeLog )
+
+src_install() {
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/pcscd-init.7 pcscd
+
+ if use udev; then
+ insinto "$(get_udevdir)"/rules.d
+ doins "${FILESDIR}"/99-pcscd-hotplug.rules
+ fi
+
+ python_fix_shebang "${ED}/usr/bin"
+}
+
+pkg_postinst() {
+ elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
+ elog "the pcscd group, to avoid running as root."
+ elog ""
+ elog "This also means you need the newest drivers available so that the"
+ elog "devices get the proper owner."
+ elog ""
+ elog "Furthermore, a conf.d file is no longer installed by default, as"
+ elog "the default configuration does not require one. If you need to"
+ elog "pass further options to pcscd, create a file and set the"
+ elog "EXTRA_OPTS variable."
+ elog ""
+ if use udev; then
+ elog "Hotplug support is provided by udev rules; you only need to tell"
+ elog "the init system to hotplug it, by setting this variable in"
+ elog "/etc/rc.conf:"
+ elog ""
+ elog " rc_hotplug=\"pcscd\""
+ fi
+}
diff --git a/sys-apps/pcsc-lite/pcsc-lite-1.8.13-r1.ebuild b/sys-apps/pcsc-lite/pcsc-lite-1.8.13-r1.ebuild
new file mode 100644
index 000000000000..22185112dbc6
--- /dev/null
+++ b/sys-apps/pcsc-lite/pcsc-lite-1.8.13-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1 multilib systemd udev user autotools-multilib
+
+DESCRIPTION="PC/SC Architecture smartcard middleware library"
+HOMEPAGE="http://pcsclite.alioth.debian.org/"
+
+STUPID_NUM="4126"
+MY_P="${PN}-${PV/_/-}"
+SRC_URI="http://alioth.debian.org/download.php/file/${STUPID_NUM}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+# GPL-2 is there for the init script; everything else comes from
+# upstream.
+LICENSE="BSD ISC MIT GPL-3+ GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+
+# This is called libusb so that it doesn't fool people in thinking that
+# it is _required_ for USB support. Otherwise they'll disable udev and
+# that's going to be worse.
+IUSE="libusb policykit selinux +udev"
+
+REQUIRED_USE="^^ ( udev libusb )"
+
+# No dependencies need the MULTILIB_DEPS because the libraries are actually
+# standalone, the deps are only needed for the daemon itself.
+CDEPEND="${PYTHON_DEPS}
+ libusb? ( virtual/libusb:1 )
+ udev? ( virtual/udev )
+ policykit? ( >=sys-auth/polkit-0.111 )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !<app-crypt/ccid-1.4.1-r1
+ !<sys-apps/baselayout-2
+ !<sys-apps/openrc-0.11.8
+ selinux? ( sec-policy/selinux-pcscd )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.8.11-polkit-pcscd.patch
+)
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+
+ enewgroup openct # make sure it exists
+ enewgroup pcscd
+ enewuser pcscd -1 -1 /run/pcscd pcscd,openct
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ --disable-maintainer-mode
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb"
+ --enable-ipcdir=/run/pcscd
+ $(multilib_native_use_enable udev libudev)
+ $(multilib_native_use_enable libusb)
+ $(multilib_native_use_enable policykit polkit)
+ "$(systemd_with_unitdir)"
+ )
+ autotools-utils_src_configure
+}
+
+DOCS=( AUTHORS DRIVERS HELP README SECURITY ChangeLog )
+
+multilib_src_install_all() {
+ einstalldocs
+
+ newinitd "${FILESDIR}"/pcscd-init.7 pcscd
+
+ if use udev; then
+ insinto "$(get_udevdir)"/rules.d
+ doins "${FILESDIR}"/99-pcscd-hotplug.rules
+ fi
+
+ python_fix_shebang "${ED}/usr/bin"
+}
+
+pkg_postinst() {
+ elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
+ elog "the pcscd group, to avoid running as root."
+ elog ""
+ elog "This also means you need the newest drivers available so that the"
+ elog "devices get the proper owner."
+ elog ""
+ elog "Furthermore, a conf.d file is no longer installed by default, as"
+ elog "the default configuration does not require one. If you need to"
+ elog "pass further options to pcscd, create a file and set the"
+ elog "EXTRA_OPTS variable."
+ elog ""
+ if use udev; then
+ elog "Hotplug support is provided by udev rules; you only need to tell"
+ elog "the init system to hotplug it, by setting this variable in"
+ elog "/etc/rc.conf:"
+ elog ""
+ elog " rc_hotplug=\"pcscd\""
+ fi
+}
diff --git a/sys-apps/pcsc-lite/pcsc-lite-1.8.13.ebuild b/sys-apps/pcsc-lite/pcsc-lite-1.8.13.ebuild
new file mode 100644
index 000000000000..5568233b1c89
--- /dev/null
+++ b/sys-apps/pcsc-lite/pcsc-lite-1.8.13.ebuild
@@ -0,0 +1,106 @@
+# 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 eutils python-single-r1 multilib systemd udev user
+
+DESCRIPTION="PC/SC Architecture smartcard middleware library"
+HOMEPAGE="http://pcsclite.alioth.debian.org/"
+
+STUPID_NUM="4126"
+MY_P="${PN}-${PV/_/-}"
+SRC_URI="http://alioth.debian.org/download.php/file/${STUPID_NUM}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+# GPL-2 is there for the init script; everything else comes from
+# upstream.
+LICENSE="BSD ISC MIT GPL-3+ GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+
+# This is called libusb so that it doesn't fool people in thinking that
+# it is _required_ for USB support. Otherwise they'll disable udev and
+# that's going to be worse.
+IUSE="libusb policykit selinux +udev"
+
+REQUIRED_USE="^^ ( udev libusb )"
+
+CDEPEND="${PYTHON_DEPS}
+ libusb? ( virtual/libusb:1 )
+ udev? ( virtual/udev )
+ policykit? ( >=sys-auth/polkit-0.111 )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !<app-crypt/ccid-1.4.1-r1
+ !<sys-apps/baselayout-2
+ !<sys-apps/openrc-0.11.8
+ selinux? ( sec-policy/selinux-pcscd )
+"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+
+ enewgroup openct # make sure it exists
+ enewgroup pcscd
+ enewuser pcscd -1 -1 /run/pcscd pcscd,openct
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.8.11-polkit-pcscd.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-maintainer-mode \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb" \
+ --enable-ipcdir=/run/pcscd \
+ $(use_enable udev libudev) \
+ $(use_enable libusb) \
+ $(use_enable policykit polkit) \
+ "$(systemd_with_unitdir)" \
+ ${myconf}
+}
+
+DOCS=( AUTHORS DRIVERS HELP README SECURITY ChangeLog )
+
+src_install() {
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/pcscd-init.7 pcscd
+
+ if use udev; then
+ insinto "$(get_udevdir)"/rules.d
+ doins "${FILESDIR}"/99-pcscd-hotplug.rules
+ fi
+
+ python_fix_shebang "${ED}/usr/bin"
+}
+
+pkg_postinst() {
+ elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
+ elog "the pcscd group, to avoid running as root."
+ elog ""
+ elog "This also means you need the newest drivers available so that the"
+ elog "devices get the proper owner."
+ elog ""
+ elog "Furthermore, a conf.d file is no longer installed by default, as"
+ elog "the default configuration does not require one. If you need to"
+ elog "pass further options to pcscd, create a file and set the"
+ elog "EXTRA_OPTS variable."
+ elog ""
+ if use udev; then
+ elog "Hotplug support is provided by udev rules; you only need to tell"
+ elog "the init system to hotplug it, by setting this variable in"
+ elog "/etc/rc.conf:"
+ elog ""
+ elog " rc_hotplug=\"pcscd\""
+ fi
+}
diff --git a/sys-apps/pcsc-lite/pcsc-lite-1.8.8-r1.ebuild b/sys-apps/pcsc-lite/pcsc-lite-1.8.8-r1.ebuild
new file mode 100644
index 000000000000..f2f7e96936ed
--- /dev/null
+++ b/sys-apps/pcsc-lite/pcsc-lite-1.8.8-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib systemd udev user
+
+DESCRIPTION="PC/SC Architecture smartcard middleware library"
+HOMEPAGE="http://pcsclite.alioth.debian.org/"
+
+STUPID_NUM="3862"
+MY_P="${PN}-${PV/_/-}"
+SRC_URI="http://alioth.debian.org/download.php/${STUPID_NUM}/${MY_P}.tar.bz2"
+S="${WORKDIR}/${MY_P}"
+
+# GPL-2 is there for the init script; everything else comes from
+# upstream.
+LICENSE="BSD ISC MIT GPL-3+ GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+
+# This is called libusb so that it doesn't fool people in thinking that
+# it is _required_ for USB support. Otherwise they'll disable udev and
+# that's going to be worse.
+IUSE="libusb selinux +udev"
+
+REQUIRED_USE="^^ ( udev libusb )"
+
+CDEPEND="libusb? ( virtual/libusb:1 )
+ udev? ( virtual/udev )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !<app-crypt/ccid-1.4.1-r1
+ !<sys-apps/baselayout-2
+ !<sys-apps/openrc-0.11.8
+ selinux? ( sec-policy/selinux-pcscd )
+"
+
+pkg_setup() {
+ enewgroup openct # make sure it exists
+ enewgroup pcscd
+ enewuser pcscd -1 -1 /run/pcscd pcscd,openct
+}
+
+src_configure() {
+ econf \
+ --disable-maintainer-mode \
+ --disable-silent-rules \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-usbdropdir="${EPREFIX}/usr/$(get_libdir)/readers/usb" \
+ --enable-ipcdir=/run/pcscd \
+ $(use_enable udev libudev) \
+ $(use_enable libusb) \
+ "$(systemd_with_unitdir)" \
+ ${myconf}
+}
+
+DOCS=( AUTHORS DRIVERS HELP README SECURITY ChangeLog )
+
+src_install() {
+ default
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/pcscd-init.6 pcscd
+
+ if use udev; then
+ insinto "$(get_udevdir)"/rules.d
+ doins "${FILESDIR}"/99-pcscd-hotplug.rules
+ fi
+}
+
+pkg_postinst() {
+ elog "Starting from version 1.6.5, pcsc-lite will start as user nobody in"
+ elog "the pcscd group, to avoid running as root."
+ elog ""
+ elog "This also means you need the newest drivers available so that the"
+ elog "devices get the proper owner."
+ elog ""
+ elog "Furthermore, a conf.d file is no longer installed by default, as"
+ elog "the default configuration does not require one. If you need to"
+ elog "pass further options to pcscd, create a file and set the"
+ elog "EXTRA_OPTS variable."
+ elog ""
+ if use udev; then
+ elog "Hotplug support is provided by udev rules; you only need to tell"
+ elog "the init system to hotplug it, by setting this variable in"
+ elog "/etc/rc.conf:"
+ elog ""
+ elog " rc_hotplug=\"pcscd\""
+ fi
+}
diff --git a/sys-apps/pcsc-slb-rf72-drv/Manifest b/sys-apps/pcsc-slb-rf72-drv/Manifest
new file mode 100644
index 000000000000..e4b23a7aeac1
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/Manifest
@@ -0,0 +1 @@
+DIST slb_rf72-drv-1.1.0.tar.gz 53110 SHA256 9b1abb82fa805377472d158b79bea58abf3532b0559de540ff448b6d8939835c SHA512 93fd5dc9e38d89a0ae3f8c5adcdf2b4cefd8caabf7cac0e0551795b8b4190031ae7c7e30962dc90c6e8c5fcec6db99d4d14f00b8a7787ec043e366ef344ebd9e WHIRLPOOL ac987862bc7f54f4cfcdb56dae4b1d844d32b553955524f2a3d53678fa915e58ed0e5cf96c87035d7e33ee4cd859734e120c857dd480b6de6828e36e86229078
diff --git a/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch
new file mode 100644
index 000000000000..dd386b686bc8
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build-new.patch
@@ -0,0 +1,24 @@
+diff -urNp slb_rf72.org/ifdhandler.c slb_rf72/ifdhandler.c
+--- slb_rf72.org/ifdhandler.c 2001-08-23 17:19:22.000000000 +0300
++++ slb_rf72/ifdhandler.c 2006-10-07 12:57:43.000000000 +0200
+@@ -37,6 +37,7 @@
+ #ifdef HAVE_PTHREAD_H
+ #include <pthread.h>
+ #endif
++#include <openct/ctapi.h>
+
+ /*
+ * Not exported constants definition
+diff -urNp slb_rf72.org/Makefile slb_rf72/Makefile
+--- slb_rf72.org/Makefile 2001-09-05 18:22:00.000000000 +0300
++++ slb_rf72/Makefile 2006-10-07 13:05:20.000000000 +0200
+@@ -16,7 +16,7 @@ clean:
+ rm -f test *.o *.lo *.so
+
+ lib: $(OBJ)
+- $(LD) -G ifdhandler.o lib/libctapi.a -o libslb_rf72.so
++ $(CC) $(LDFLAGS) -shared `pkg-config --libs-only-L libopenct` -lopenctapi ifdhandler.o -o libslb_rf72.so
+
+ ifdhandler.o: ifdhandler.h ifdhandler.c
+- $(CC) $(CFLAGS) -c ifdhandler.c $(INCLUDES)
++ $(CC) $(CFLAGS) `pkg-config --cflags libopenct` -fPIC -DHAVE_PTHREAD_H -c ifdhandler.c $(INCLUDES)
diff --git a/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch
new file mode 100644
index 000000000000..0e6a7db2baf0
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/files/pcsc-slb-rf72-drv-1.1.0-build.patch
@@ -0,0 +1,24 @@
+diff -urNp slb_rf72.org/ifdhandler.c slb_rf72/ifdhandler.c
+--- slb_rf72.org/ifdhandler.c 2001-08-23 17:19:22.000000000 +0300
++++ slb_rf72/ifdhandler.c 2006-10-07 12:57:43.000000000 +0200
+@@ -37,6 +37,7 @@
+ #ifdef HAVE_PTHREAD_H
+ #include <pthread.h>
+ #endif
++#include <openct/ctapi.h>
+
+ /*
+ * Not exported constants definition
+diff -urNp slb_rf72.org/Makefile slb_rf72/Makefile
+--- slb_rf72.org/Makefile 2001-09-05 18:22:00.000000000 +0300
++++ slb_rf72/Makefile 2006-10-07 13:05:20.000000000 +0200
+@@ -16,7 +16,7 @@ clean:
+ rm -f test *.o *.lo *.so
+
+ lib: $(OBJ)
+- $(LD) -G ifdhandler.o lib/libctapi.a -o libslb_rf72.so
++ $(CC) -shared `pkg-config --libs-only-L libopenct` -lopenctapi ifdhandler.o -o libslb_rf72.so
+
+ ifdhandler.o: ifdhandler.h ifdhandler.c
+- $(CC) $(CFLAGS) -c ifdhandler.c $(INCLUDES)
++ $(CC) $(CFLAGS) `pkg-config --cflags libopenct` -fPIC -DHAVE_PTHREAD_H -c ifdhandler.c $(INCLUDES)
diff --git a/sys-apps/pcsc-slb-rf72-drv/files/reader.conf b/sys-apps/pcsc-slb-rf72-drv/files/reader.conf
new file mode 100644
index 000000000000..fbf7898ba65e
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/files/reader.conf
@@ -0,0 +1,11 @@
+# Configuration file for pcsc-lite
+#
+
+# Schlumberger Reflex 72 reader
+FRIENDLYNAME "Schlumberger Reflex 72"
+# Update the following to the right COM port
+DEVICENAME /dev/null
+LIBPATH %PCSC_DRIVERS_DIR%/serial/libslb_rf72.so
+CHANNELID 1
+
+# End of file
diff --git a/sys-apps/pcsc-slb-rf72-drv/metadata.xml b/sys-apps/pcsc-slb-rf72-drv/metadata.xml
new file mode 100644
index 000000000000..d68fe974c15a
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/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>crypto</herd>
+</pkgmetadata>
diff --git a/sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r1.ebuild b/sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r1.ebuild
new file mode 100644
index 000000000000..ba52cc43a30c
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+MY_P="slb_rf72"
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="Schlumberger Reflex 72 Serial Smartcard Reader"
+HOMEPAGE="http://www.linuxnet.com/sourcedrivers.html"
+LICENSE="all-rights-reserved BSD LGPL-2.1+"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+SLOT="0"
+SRC_URI="http://www.linuxnet.com/drivers/readers/files/slb_rf72-drv-1.1.0.tar.gz"
+RESTRICT="mirror bindist"
+
+RDEPEND="sys-apps/pcsc-lite
+ dev-libs/openct"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}/${P}-build.patch"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" || die
+}
+
+src_install () {
+ local pcscdir="$(pkg-config --variable=usbdropdir libpcsclite)"
+ local conf="/etc/reader.conf.d/${PN}.conf"
+
+ dodoc ERRATA README
+
+ dodir "${pcscdir}/serial"
+ insinto "${pcscdir}/serial"
+ insopts -m755
+ doins libslb_rf72.so
+
+ dodir "$(dirname "${conf}")"
+ insinto "$(dirname "${conf}")"
+ newins "${FILESDIR}/reader.conf" "$(basename "${conf}")"
+ sed -i "s#%PCSC_DRIVERS_DIR%#${pcscdir}#g" "${D}/${conf}"
+
+ einfo "NOTICE:"
+ einfo "1. modify ${conf}"
+ einfo "2. run update-reader.conf, yes this is a command..."
+ einfo "3. restart pcscd"
+}
+
+pkg_postrm() {
+ #
+ # Without this, pcscd will not start next time.
+ #
+ local conf="/etc/reader.conf.d/${PN}.conf"
+ if ! [ -f "$(grep LIBPATH "${conf}" | sed 's/LIBPATH *//' | sed 's/ *$//g' | head -n 1)" ]; then
+ rm "${conf}"
+ update-reader.conf
+ einfo "NOTICE:"
+ einfo "You need to restart pcscd"
+ fi
+}
diff --git a/sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r2.ebuild b/sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r2.ebuild
new file mode 100644
index 000000000000..7af68a538a39
--- /dev/null
+++ b/sys-apps/pcsc-slb-rf72-drv/pcsc-slb-rf72-drv-1.1.0-r2.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+MY_P="slb_rf72"
+S=${WORKDIR}/${MY_P}
+DESCRIPTION="Schlumberger Reflex 72 Serial Smartcard Reader"
+HOMEPAGE="http://www.linuxnet.com/sourcedrivers.html"
+LICENSE="all-rights-reserved BSD LGPL-2.1+"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+SLOT="0"
+SRC_URI="http://www.linuxnet.com/drivers/readers/files/slb_rf72-drv-1.1.0.tar.gz"
+RESTRICT="mirror bindist"
+
+RDEPEND="sys-apps/pcsc-lite
+ dev-libs/openct"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-build-new.patch"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" || die
+}
+
+src_install () {
+ local pcscdir="$(pkg-config --variable=usbdropdir libpcsclite)"
+ local conf="/etc/reader.conf.d/${PN}.conf"
+
+ dodoc ERRATA README || die
+
+ dodir "${pcscdir}/serial" || die
+ insinto "${pcscdir}/serial"
+ insopts -m755
+ doins libslb_rf72.so || die
+
+ dodir "$(dirname "${conf}")" || die
+ insinto "$(dirname "${conf}")"
+ newins "${FILESDIR}/reader.conf" "$(basename "${conf}")" || die
+ sed -i "s#%PCSC_DRIVERS_DIR%#${pcscdir}#g" "${D}/${conf}" || die
+
+ einfo "NOTICE:"
+ einfo "1. modify ${conf}"
+ einfo "2. run update-reader.conf, yes this is a command..."
+ einfo "3. restart pcscd"
+}
+
+pkg_postrm() {
+ #
+ # Without this, pcscd will not start next time.
+ #
+ local conf="/etc/reader.conf.d/${PN}.conf"
+ if ! [ -f "$(grep LIBPATH "${conf}" | sed 's/LIBPATH *//' | sed 's/ *$//g' | head -n 1)" ]; then
+ rm "${conf}"
+ update-reader.conf
+ einfo "NOTICE:"
+ einfo "You need to restart pcscd"
+ fi
+}
diff --git a/sys-apps/pcsc-tools/Manifest b/sys-apps/pcsc-tools/Manifest
new file mode 100644
index 000000000000..6ab630b9e70c
--- /dev/null
+++ b/sys-apps/pcsc-tools/Manifest
@@ -0,0 +1,2 @@
+DIST pcsc-tools-1.4.22.tar.gz 109458 SHA256 615592dd56627bd0ff3650608bb7eefe3e9f43cc18ca2d805ebf0bf74d30f307 SHA512 cb4bea7bd75e98fda5ff44e3fd680a479cddb3edd6c632951346d2a87329386b55203dc3f2f29d484c23ee4c6cb8f741aaa6b94dd16095b86c7f88f057015cf5 WHIRLPOOL 2f4141034f013970bd43050c70d24e9ab7ee076a29d86d939cc0dc250b4431b6515f04a3e21f179e015c6d80312a70e07101732085e84bf48f5645e7de306c08
+DIST pcsc-tools-1.4.23.tar.gz 114495 SHA256 69ca7bb6ee23ef99e2696451f2f56072dd74adcc43272d89fd757ac8f7de4fe2 SHA512 b94fd467ded600f6ad47510225d325635a227f2bbbe8dbb191fee31a3ccaff951d0ea4a7184765912f00dbf4725b5fcbc478b769fc0dd4369eab0a8c1d627f93 WHIRLPOOL 7ca4c25af05d4f8bebe5a73a3d4e9409d882c42816a25139d218c85ff2464382637ea2049bf176b73ba65a7d483075f23c2087b4a28bf9b38c0102538ca07467
diff --git a/sys-apps/pcsc-tools/files/smartcard.cron b/sys-apps/pcsc-tools/files/smartcard.cron
new file mode 100644
index 000000000000..314f46f107ef
--- /dev/null
+++ b/sys-apps/pcsc-tools/files/smartcard.cron
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+SRC=http://ludovic.rousseau.free.fr/softwares/pcsc-tools/smartcard_list.txt
+DEST=/usr/share/pcsc/smartcard_list.txt
+
+touch ${DEST} >/dev/null 2>&1 || exit 1
+
+if ! wget --quiet --no-timestamping -O "${DEST}".new "$SRC"; then
+ rm -f "${DEST}".new
+fi
+
+chmod a+r "${DEST}".new
+mv "${DEST}".new "${DEST}"
diff --git a/sys-apps/pcsc-tools/metadata.xml b/sys-apps/pcsc-tools/metadata.xml
new file mode 100644
index 000000000000..c6a053218727
--- /dev/null
+++ b/sys-apps/pcsc-tools/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>crypto</herd>
+ <longdescription>User tools for PC/SC SmartCard access (including pcsc_scan and the gscriptor GUI).</longdescription>
+
+ <use>
+ <flag name='network-cron'>Monthly cronjob the update-smartcard_list script</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/pcsc-tools/pcsc-tools-1.4.22.ebuild b/sys-apps/pcsc-tools/pcsc-tools-1.4.22.ebuild
new file mode 100644
index 000000000000..f00141faee11
--- /dev/null
+++ b/sys-apps/pcsc-tools/pcsc-tools-1.4.22.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils fdo-mime multilib toolchain-funcs
+
+DESCRIPTION="PC/SC Architecture smartcard tools"
+HOMEPAGE="http://ludovic.rousseau.free.fr/softwares/pcsc-tools/"
+SRC_URI="http://ludovic.rousseau.free.fr/softwares/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+IUSE="gtk network-cron"
+
+RDEPEND=">=sys-apps/pcsc-lite-1.4.14"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ dev-perl/pcsc-perl
+ gtk? ( dev-perl/gtk2-perl )"
+
+src_prepare() {
+ sed -i -e 's:-Wall -O2:$(CFLAGS):g' Makefile
+}
+
+src_compile() {
+ # explicitly only build the pcsc_scan application, or the man
+ # pages will be gzipped first, and then unpacked.
+ emake pcsc_scan CC=$(tc-getCC)
+}
+
+src_install() {
+ # install manually, makes it much easier since the Makefile
+ # requires fiddling with
+ dobin ATR_analysis scriptor pcsc_scan
+ doman pcsc_scan.1 scriptor.1p ATR_analysis.1p
+
+ dodoc README Changelog
+
+ if use gtk; then
+ domenu gscriptor.desktop
+ dobin gscriptor
+ doman gscriptor.1p
+ fi
+
+ if use network-cron ; then
+ exeinto /etc/cron.monthly
+ newexe "${FILESDIR}"/smartcard.cron update-smartcard_list
+ fi
+
+ insinto /usr/share/pcsc
+ doins smartcard_list.txt
+}
+
+pkg_postinst() {
+ use gtk && fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sys-apps/pcsc-tools/pcsc-tools-1.4.23.ebuild b/sys-apps/pcsc-tools/pcsc-tools-1.4.23.ebuild
new file mode 100644
index 000000000000..f00141faee11
--- /dev/null
+++ b/sys-apps/pcsc-tools/pcsc-tools-1.4.23.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils fdo-mime multilib toolchain-funcs
+
+DESCRIPTION="PC/SC Architecture smartcard tools"
+HOMEPAGE="http://ludovic.rousseau.free.fr/softwares/pcsc-tools/"
+SRC_URI="http://ludovic.rousseau.free.fr/softwares/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86"
+IUSE="gtk network-cron"
+
+RDEPEND=">=sys-apps/pcsc-lite-1.4.14"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ dev-perl/pcsc-perl
+ gtk? ( dev-perl/gtk2-perl )"
+
+src_prepare() {
+ sed -i -e 's:-Wall -O2:$(CFLAGS):g' Makefile
+}
+
+src_compile() {
+ # explicitly only build the pcsc_scan application, or the man
+ # pages will be gzipped first, and then unpacked.
+ emake pcsc_scan CC=$(tc-getCC)
+}
+
+src_install() {
+ # install manually, makes it much easier since the Makefile
+ # requires fiddling with
+ dobin ATR_analysis scriptor pcsc_scan
+ doman pcsc_scan.1 scriptor.1p ATR_analysis.1p
+
+ dodoc README Changelog
+
+ if use gtk; then
+ domenu gscriptor.desktop
+ dobin gscriptor
+ doman gscriptor.1p
+ fi
+
+ if use network-cron ; then
+ exeinto /etc/cron.monthly
+ newexe "${FILESDIR}"/smartcard.cron update-smartcard_list
+ fi
+
+ insinto /usr/share/pcsc
+ doins smartcard_list.txt
+}
+
+pkg_postinst() {
+ use gtk && fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ fdo-mime_desktop_database_update
+}
diff --git a/sys-apps/pkgcore/Manifest b/sys-apps/pkgcore/Manifest
new file mode 100644
index 000000000000..9fee77687204
--- /dev/null
+++ b/sys-apps/pkgcore/Manifest
@@ -0,0 +1 @@
+DIST pkgcore-0.9.1.tar.gz 570633 SHA256 d5f556c7dcf69aa45f8bc80c95cc5273de389d21ab7932a1cd8babcd5aa2fc10 SHA512 3cd221070369af07729afa2af5bba20a544d2d58913a6e8d7da90b7a59d043fec906b7276032194cc5c86d84417793ba732f326a342b5ac439f1f2bf6b14a262 WHIRLPOOL f39f927f0334be9ab95ed6bf6b8074f707fcee57eb124dc25b48bdc40c4743959fa9826e7cec593f082233624335d753f09990ce3faf7a798abf442c8879bbda
diff --git a/sys-apps/pkgcore/metadata.xml b/sys-apps/pkgcore/metadata.xml
new file mode 100644
index 000000000000..1190705cdba4
--- /dev/null
+++ b/sys-apps/pkgcore/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>
+ <use>
+ <flag name="doc">Build and install API docs.</flag>
+ </use>
+ <upstream>
+ <remote-id type="pypi">pkgcore</remote-id>
+ <remote-id type="github">pkgcore/pkgcore</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/pkgcore/pkgcore-0.9.1.ebuild b/sys-apps/pkgcore/pkgcore-0.9.1.ebuild
new file mode 100644
index 000000000000..89575fdf4f54
--- /dev/null
+++ b/sys-apps/pkgcore/pkgcore-0.9.1.ebuild
@@ -0,0 +1,83 @@
+# 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
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/pkgcore/pkgcore.git"
+ inherit git-r3
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+fi
+
+DESCRIPTION="pkgcore package manager"
+HOMEPAGE="https://github.com/pkgcore/pkgcore"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+IUSE="doc test"
+
+RDEPEND=">=dev-python/snakeoil-0.6.4[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
+"
+
+pkg_setup() {
+ # disable snakeoil 2to3 caching...
+ unset PY2TO3_CACHEDIR
+
+ mydistutilsargs=(
+ build
+ --disable-html-docs
+ --disable-man-pages
+ )
+}
+
+python_compile_all() {
+ esetup.py $(use doc && echo 'build_docs')
+
+ if [[ ${PV} == *9999 ]]; then
+ esetup.py build_man
+ ln -s "${BUILD_DIR}/sphinx/man" man || die
+ fi
+
+ # symlinks generated manpages into source root
+ # dead symlinks are tolerated
+ ln -s "${BUILD_DIR}/sphinx/html" html || die
+}
+
+python_test() {
+ esetup.py test
+}
+
+src_install() {
+ mydistutilsargs+=(
+ install
+ --disable-html-docs
+ --disable-man-pages
+ )
+
+ distutils-r1_src_install
+}
+
+python_install_all() {
+ local cmds=(
+ install_man
+ )
+ use doc && cmds+=(
+ install_docs --path="${ED%/}"/usr/share/doc/${PF}/html
+ )
+
+ distutils-r1_python_install "${cmds[@]}"
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ python_foreach_impl pplugincache
+}
diff --git a/sys-apps/pkgcore/pkgcore-9999.ebuild b/sys-apps/pkgcore/pkgcore-9999.ebuild
new file mode 100644
index 000000000000..fca70364cc08
--- /dev/null
+++ b/sys-apps/pkgcore/pkgcore-9999.ebuild
@@ -0,0 +1,75 @@
+# 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
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/pkgcore/pkgcore.git"
+ inherit git-r3
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+fi
+
+DESCRIPTION="pkgcore package manager"
+HOMEPAGE="https://github.com/pkgcore/pkgcore"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+IUSE="doc test"
+
+if [[ ${PV} == *9999 ]] ; then
+ SPHINX="dev-python/sphinx[${PYTHON_USEDEP}]"
+else
+ SPHINX="doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
+fi
+RDEPEND="=dev-python/snakeoil-9999[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ ${SPHINX}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]
+ test? ( $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7) )
+"
+
+pkg_setup() {
+ # disable snakeoil 2to3 caching...
+ unset PY2TO3_CACHEDIR
+}
+
+python_compile_all() {
+ if [[ ${PV} == *9999 ]]; then
+ esetup.py build_man
+ ln -s "${BUILD_DIR}/sphinx/man" man || die
+ fi
+
+ if use doc; then
+ esetup.py build_docs
+ ln -s "${BUILD_DIR}/sphinx/html" html || die
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install_all() {
+ local cmds=(
+ install_man
+ )
+ use doc && cmds+=(
+ install_docs --path="${ED%/}"/usr/share/doc/${PF}/html
+ )
+
+ distutils-r1_python_install "${cmds[@]}"
+ distutils-r1_python_install_all
+
+ insinto /usr/share/zsh/site-functions
+ doins completion/zsh/*
+}
+
+pkg_postinst() {
+ python_foreach_impl pplugincache
+}
diff --git a/sys-apps/pmount-gui/Manifest b/sys-apps/pmount-gui/Manifest
new file mode 100644
index 000000000000..f366ad045855
--- /dev/null
+++ b/sys-apps/pmount-gui/Manifest
@@ -0,0 +1 @@
+DIST pmount-gui-0_pre20130806.tar.xz 5132 SHA256 d08d3b717528f574eef8c29503e3f1d3b788b17e9997fbce643cf88265a25aea SHA512 97871dcfbd14a26f93186b8e08d5512c6b7d6fbf76c94a9e4f0f8e74404ce7a8e1139bb5d3fd432fb1b228ff48f9f56195124839431f6a5d3d82f43165a2b5ce WHIRLPOOL 6f51624ca294f1a24d1895e9a0a0698113e26893a25dbc443dadad6de25060965aed6ec314a7f942a3d5bbcc12b28160c0cfa864c47bca0a97356e30d950ece3
diff --git a/sys-apps/pmount-gui/metadata.xml b/sys-apps/pmount-gui/metadata.xml
new file mode 100644
index 000000000000..731225048652
--- /dev/null
+++ b/sys-apps/pmount-gui/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-apps/pmount-gui/pmount-gui-0_pre20130806.ebuild b/sys-apps/pmount-gui/pmount-gui-0_pre20130806.ebuild
new file mode 100644
index 000000000000..be93bf3f42a9
--- /dev/null
+++ b/sys-apps/pmount-gui/pmount-gui-0_pre20130806.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+if [ ${PV} = 9999* ]; then
+ EGIT_REPO_URI="git://git.tdb.fi/pmount-gui"
+ inherit git-2
+else
+ SRC_URI="http://dev.gentoo.org/~ssuominen/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+inherit toolchain-funcs
+
+DESCRIPTION="A simple graphical frontend for pmount"
+HOMEPAGE="http://git.tdb.fi/?p=pmount-gui:a=summary"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+COMMON_DEPEND="x11-libs/gtk+:2"
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/pmount
+ virtual/udev"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+src_compile() {
+ emake CC="$(tc-getCC) ${CFLAGS} ${LDFLAGS}"
+}
+
+src_install() {
+ dobin ${PN}
+ dodoc README.txt
+}
diff --git a/sys-apps/pmount/Manifest b/sys-apps/pmount/Manifest
new file mode 100644
index 000000000000..c511235b05c7
--- /dev/null
+++ b/sys-apps/pmount/Manifest
@@ -0,0 +1 @@
+DIST pmount_0.9.99-alpha.orig.tar.bz2 364282 SHA256 ca06bd0c429d3db9382433f378d07bf763534f70fe71015322678e321b0679e5 SHA512 12105674f099afb82302c0960f4f50a4bc75382071940e897d9c65b57a0f4de1fafdaa2a4c05f0fa5cba55453ae0c21376b9891353cad1afa88e5fbd9f63d5e9 WHIRLPOOL 18172b606f20f1b95ff0b60fa5c83de14c04fa2b774598fdf1ef21746c0cc77c63469ed436d752d7a172e90847b38635b08e3e80db28294fdf3d102408cbdfc9
diff --git a/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch b/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch
new file mode 100644
index 000000000000..93d0555f0f3d
--- /dev/null
+++ b/sys-apps/pmount/files/pmount-0.9.19-testsuite-missing-dir.patch
@@ -0,0 +1,43 @@
+From d3f14cfd82cae939d9c487e9cb1a2973dc9b9a4f Mon Sep 17 00:00:00 2001
+From: Romain Perier <mrpouet@gentoo.org>
+Date: Wed, 23 Sep 2009 19:37:55 +0200
+Subject: [PATCH] Fix testsuite due to missing sub-directory (see gitweb on upstream)
+
+---
+ tests/check_fstab/a | 1 +
+ tests/check_fstab/d | 1 +
+ tests/check_fstab/fstab | 6 ++++++
+ 3 files changed, 8 insertions(+), 0 deletions(-)
+ create mode 100644 tests/check_fstab/a
+ create mode 100644 tests/check_fstab/d
+ create mode 100644 tests/check_fstab/fstab
+
+diff --git a/tests/check_fstab/a b/tests/check_fstab/a
+new file mode 100644
+index 0000000..d16d1c5
+--- /dev/null
++++ tests/check_fstab/a
+@@ -0,0 +1 @@
++This file is a 'dummy device file' for the fstab check
+diff --git a/tests/check_fstab/d b/tests/check_fstab/d
+new file mode 100644
+index 0000000..d16d1c5
+--- /dev/null
++++ tests/check_fstab/d
+@@ -0,0 +1 @@
++This file is a 'dummy device file' for the fstab check
+diff --git a/tests/check_fstab/fstab b/tests/check_fstab/fstab
+new file mode 100644
+index 0000000..8ba6f6c
+--- /dev/null
++++ tests/check_fstab/fstab
+@@ -0,0 +1,6 @@
++# A dummy fstab file for
++
++# <file system> <mount point> <type> <options> <dump> <pass>
++check_fstab/a /test1 ext3 defaults 0 0
++check_fstab/e /test2 ext3 defaults 0 0
++
+--
+1.6.5.rc1
+
diff --git a/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch b/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch
new file mode 100644
index 000000000000..c96fc0554522
--- /dev/null
+++ b/sys-apps/pmount/files/pmount-0.9.99_alpha-locale-regex.patch
@@ -0,0 +1,22 @@
+http://bugs.gentoo.org/416985
+
+--- src/conffile.c
++++ src/conffile.c
+@@ -372,7 +372,7 @@ static int cf_prepare_regexps()
+ /* A regexp matching a boolean value*/
+
+ if( regcomp(&declaration_RE,
+- "^[[:blank:]]*([-a-zA-Z_]+)[[:blank:]]*"
++ "^[[:blank:]]*([-[:alpha:]_]+)[[:blank:]]*"
+ "=[[:blank:]]*(.*)$",
+ REG_EXTENDED )) {
+ perror(_("Could not compile regular expression for boolean values"));
+@@ -392,7 +392,7 @@ static int cf_prepare_regexps()
+ }
+
+ if( regcomp(&uint_RE,
+- "^[[:blank:]]*([a-zA-Z_]+)[[:blank:]]*"
++ "^[[:blank:]]*([[:alpha:]_]+)[[:blank:]]*"
+ "=[[:blank:]]*([0-9]+)$",
+ REG_EXTENDED )) {
+ perror(_("Could not compile regular expression for integer values"));
diff --git a/sys-apps/pmount/files/pmount.bash-completion b/sys-apps/pmount/files/pmount.bash-completion
new file mode 100644
index 000000000000..31b63020910c
--- /dev/null
+++ b/sys-apps/pmount/files/pmount.bash-completion
@@ -0,0 +1,94 @@
+#-*- mode: shell-script;-*-
+#
+# Bash Completion snippet for the pmount command
+# Copyright (c) Eduard Bloch, 2009-2011
+#
+# Supports most (all?) of the possible option sets of version 0.9.18 except of
+# too many device/directory arguments, the charset search can also be improved
+#
+# Inputs:
+# $1 -- name of the command whose arguments are being completed
+# $2 -- word being completed
+# $3 -- word preceding the word being completed
+# $COMP_LINE -- current command line
+# $COMP_PONT -- cursor position
+# $COMP_WORDS -- array containing individual words in the current
+# command line
+# $COMP_CWORD -- index into ${COMP_WORDS} of the word containing the
+# current cursor position
+# Output:
+# COMPREPLY array variable contains possible completions
+
+_pmount() {
+
+ local cur prev options devices fslist
+
+ options=' -r --read-only -w --read-write -s --sync -A --noatime -e --exec \
+ -t filesystem --type filesystem -c charset --charset charset -u umask \
+ --umask umask --dmask dmask --fmask fmask -p file --passphrase file \
+ -h --help -d --debug -V --version'
+ fslist=' ascii cp1250 cp1251 cp1255 cp437 cp737 cp775 cp850 cp852 cp855 cp857 cp860 cp861 cp862 cp863 cp864 cp865 cp866 cp869 cp874 cp932 cp936 cp949 cp950 euc-jp iso8859-1 iso8859-13 iso8859-14 iso8859-15 iso8859-2 iso8859-3 iso8859-4 iso8859-5 iso8859-6 iso8859-7 iso8859-9 koi8-r koi8-ru koi8-u utf8'
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ case "$prev" in
+ -@(t|-type))
+ COMPREPLY=( $( grep "^[[:space:]]$cur" /proc/filesystems ) )
+ return 0
+ ;;
+
+ -@(c|-charset))
+ COMPREPLY=( $( compgen -W "$fslist" -- $cur ) )
+ return 0
+ ;;
+ -@(u|d|-umask|-dmask))
+ COMPREPLY=( ${cur}0 ${cur}1 ${cur}2 ${cur}3 ${cur}4 ${cur}5 ${cur}6 ${cur}7 )
+ return 0
+ ;;
+
+ -@(p|-passphrase))
+ _filedir
+ return 0
+ ;;
+
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W "$options" -- $cur ) )
+ else
+ devices="$( command ls $(grep -v '^[[:space:]]*#' /etc/pmount.allow ) $(grep 1 /sys/block/*/removable | sed -e 's,/sys/block/,/dev/,;s,/removable:1,*,') 2>/dev/null | sort -u | sed -e 's,\(^/dev/\)\(.*\),\1\2 \2,' )"
+ COMPREPLY=( $( compgen -W "$devices" -- $cur ) )
+ fi
+
+ return 0
+}
+
+
+_pumount() {
+
+ local cur prev options devices mdir
+
+ mdir="$(readlink -f /media)"
+
+ options=' -l --luks-force -h --help -d --debug --version'
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W "$options" -- $cur ) )
+ else
+ devices="$( grep $mdir /proc/mounts | sed -e 's,.*/$mdir/,,;s,\ .*,,;s,\(.*\),\1\n/dev/\1,;s,/dev//dev,/dev,' )"
+ COMPREPLY=( $( compgen -W "$devices" -- $cur ) )
+ fi
+
+ return 0
+}
+
+complete -F _pmount $filenames pmount
+complete -F _pumount $filenames pumount
+
diff --git a/sys-apps/pmount/metadata.xml b/sys-apps/pmount/metadata.xml
new file mode 100644
index 000000000000..5cb9324943ab
--- /dev/null
+++ b/sys-apps/pmount/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>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r3.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r3.ebuild
new file mode 100644
index 000000000000..184d07a7dfa8
--- /dev/null
+++ b/sys-apps/pmount/pmount-0.9.99_alpha-r3.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils user
+
+DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user"
+HOMEPAGE="http://pmount.alioth.debian.org/"
+SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2"
+#SRC_URI="http://alioth.debian.org/frs/download.php/3530/${P/_/-}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86"
+IUSE="crypt"
+
+RDEPEND=">=sys-apps/util-linux-2.17.2
+ crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext"
+
+S=${WORKDIR}/${P/_/-}
+
+pkg_setup() {
+ enewgroup plugdev
+}
+
+src_prepare() {
+ # Restore default value from pmount <= 0.9.23 wrt #393633
+ sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die
+
+ cat <<-EOF > po/POTFILES.skip
+ src/conffile.c
+ src/configuration.c
+ src/loop.c
+ EOF
+
+ epatch \
+ "${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch \
+ "${FILESDIR}"/${P}-locale-regex.patch
+}
+
+src_configure() {
+ econf --disable-hal
+}
+
+src_test() {
+ local testdir=${S}/tests/check_fstab
+
+ ln -s $testdir/a $testdir/b && ln -s $testdir/d $testdir/c && \
+ ln -s $testdir/c $testdir/e \
+ || die "Unable to create fake symlinks required for testsuite"
+
+ emake check
+}
+
+src_install () {
+ # Must be run SETUID+SETGID, bug #250106
+ exeinto /usr/bin
+ exeopts -m 6710 -g plugdev
+ doexe src/{p,pu}mount
+
+ dodoc AUTHORS ChangeLog TODO
+ doman man/{{p,pu}mount.1,pmount.conf.5}
+
+ insinto /etc
+ doins etc/pmount.{allow,conf}
+
+ keepdir /media #501772
+}
+
+pkg_postinst() {
+ elog
+ elog "This package has been installed setuid and setgid."
+
+ elog "The permissions are as such that only users that belong to the plugdev"
+ elog "group are allowed to run this. But if a script run by root mounts a"
+ elog "device, members of the plugdev group will have access to it."
+ elog
+ elog "Please add your user to the plugdev group to be able to mount USB drives"
+}
diff --git a/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild b/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild
new file mode 100644
index 000000000000..f5052e7fe24a
--- /dev/null
+++ b/sys-apps/pmount/pmount-0.9.99_alpha-r5.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils user bash-completion-r1
+
+DESCRIPTION="Policy based mounter that gives the ability to mount removable devices as a user"
+HOMEPAGE="http://pmount.alioth.debian.org/"
+SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV/_/-}.orig.tar.bz2"
+#SRC_URI="http://alioth.debian.org/frs/download.php/3530/${P/_/-}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="crypt"
+
+RDEPEND=">=sys-apps/util-linux-2.17.2
+ crypt? ( >=sys-fs/cryptsetup-1.0.6-r2 )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext"
+
+S=${WORKDIR}/${P/_/-}
+
+pkg_setup() {
+ enewgroup plugdev
+}
+
+src_prepare() {
+ # Restore default value from pmount <= 0.9.23 wrt #393633
+ sed -i -e '/^not_physically_logged_allow/s:=.*:= yes:' etc/pmount.conf || die
+
+ cat <<-EOF > po/POTFILES.skip
+ src/conffile.c
+ src/configuration.c
+ src/loop.c
+ EOF
+
+ epatch \
+ "${FILESDIR}"/${PN}-0.9.19-testsuite-missing-dir.patch \
+ "${FILESDIR}"/${P}-locale-regex.patch
+}
+
+src_configure() {
+ econf --disable-hal
+}
+
+src_test() {
+ local testdir=${S}/tests/check_fstab
+
+ ln -s $testdir/a $testdir/b && ln -s $testdir/d $testdir/c && \
+ ln -s $testdir/c $testdir/e \
+ || die "Unable to create fake symlinks required for testsuite"
+
+ emake check
+}
+
+src_install () {
+ # Must be run SETUID+SETGID, bug #250106
+ exeinto /usr/bin
+ exeopts -m 6710 -g plugdev
+ doexe src/{p,pu}mount
+
+ dodoc AUTHORS ChangeLog TODO
+ doman man/{{p,pu}mount.1,pmount.conf.5}
+
+ insinto /etc
+ doins etc/pmount.{allow,conf}
+
+ keepdir /media #501772
+
+ newbashcomp "${FILESDIR}/${PN}.bash-completion" "${PN}"
+ bashcomp_alias pmount pumount
+}
+
+pkg_postinst() {
+ elog
+ elog "This package has been installed setuid and setgid."
+
+ elog "The permissions are as such that only users that belong to the plugdev"
+ elog "group are allowed to run this. But if a script run by root mounts a"
+ elog "device, members of the plugdev group will have access to it."
+ elog
+ elog "Please add your user to the plugdev group to be able to mount USB drives"
+}
diff --git a/sys-apps/policycoreutils/Manifest b/sys-apps/policycoreutils/Manifest
new file mode 100644
index 000000000000..b62aabfc9e14
--- /dev/null
+++ b/sys-apps/policycoreutils/Manifest
@@ -0,0 +1,8 @@
+DIST patchbundle-policycoreutils-2.2.5-gentoo-r1.tar.gz 7287 SHA256 cb6915c46a5e6789f95ac254d34b1d890055b31ded61596ffb5bf925aa8c446a SHA512 be6eeaf4927d80f2c198ecc4fbe88a3e960380a0de532155eff3a12157df0615e7b3ffbc09e984df08fb32ce5b62f75147559a093b620a98d9ff836ad07b18b0 WHIRLPOOL de7e0348abc45713ede926d79f26bb8590c41db6f984ff8f29a01b933f6e3c38531682f10a0d7de73f8b26994ac9a476bd9d54fc36fb45689f7ad9eca5206f09
+DIST patchbundle-policycoreutils-3.tar.gz 7294 SHA256 44db261c87f583a7620690fc5041d8a21b1c935e741fe7b594aa2cc958e3deb7 SHA512 24e4c73e97441a1042618f6a4179d71672c81f821ffc2f97a54116bf6b33a93bd7f3e2030dbdb362da5e2a7d8936604e5b0283261c7b2447cc4f7594966c73bc WHIRLPOOL d38416ff9707d7d2bbf04f5d582944a87d27de06f3d70677341d38dacc6501dd78ef01fd8a7bb044d49b1f2a8c95181e2cb1b4b81dae49819409dbcf9d7abcb7
+DIST policycoreutils-2.2.5.tar.gz 4948944 SHA256 bbf850a8c3c2f371f439d6525663eecdd3a737acd594d2f27f8d8f3a07830cc4 SHA512 88a32fbbede56f3e717394f134212ed9df9b06cbb5532168ccc03ef2a465f4320b54a561348ea5c319b5b641f7661565ad29fbdc5aae50190a6d21d076cf2c3f WHIRLPOOL 0eb0e0c7e1fc1514cb28bbda7a10066ad23a9ccfecc92dee606e3f0e71632e07fe1c4ba7ac89993adf15e9520fc9e527e16d623d56b4e96cc882bf82dea4cb14
+DIST policycoreutils-2.3.tar.gz 4984980 SHA256 864cfaee58b5d2f15b140c354e59666e57143293c89f2b2e85bc0d0e4beefcd2 SHA512 3256849d13856ec47ac85470632a57e26952c5dafffb51df4eb8e32467196ff3ef725cc582798727fe45fd6284c1893d12eae2c89088ae1758ad39faec385659 WHIRLPOOL 1dd9bfd67ebb744b8c47144966f09d8361e9018e8d941355080c274b9ac891c18eb95771f3dc8b136683224bc5f12f3fb58fa00666b5815d65e7141c31d9293d
+DIST policycoreutils-2.4.tar.gz 5004280 SHA256 b819f876f12473783ccce9f63b9a79cd77177477cd6d46818441f808cc4c3479 SHA512 0eb0ea569c1699ed78e5e9798d9f182b3a8bfa6dcd387bcc78923755b3a1cad982673db88857745154d3769d44402b87e52d5fe3024874001f61f783aa25cce6 WHIRLPOOL d101080973ef6248617b5bca9d8b76e59008061b3411aec4ed95343af09b941a34acb3bb0001da5468595c4c37684ab6f34204e18ccb3cbbd5b3d31df0cb5e7f
+DIST policycoreutils-extra-1.31.tar.bz2 16080 SHA256 ad0a78d96fd01aa51fe774e1701bd23934cd72182b2bad68112006f0ea17cc7b SHA512 520f93f1a2ce3c60a1d192b09cb9a968d207fbc6ab1f01861be95a50b65264f706335620ccbca48ce38f81581a4cf5128e5db9e5b0564460c9f05f04038abfba WHIRLPOOL 56e713b9bd8f1af1496f383f45f1ef8d373b3f45148237bfd28c016f4becaa87d932b363d165b46c657ea3a08503e7bc60b1c5a5a2a814a659770bedf33d4202
+DIST policycoreutils-extra-1.33.tar.bz2 16191 SHA256 743c3930277102f5545907314b21e98955e88be7972e30264c6cb5dca370b788 SHA512 3f6f19ae33d5b1043f2979fb3e79bc061767f7051cbd0981e5c5663b4391fa29544b2184b384c9fce7b4100623bc776748d77a01865dcee78b0756d73ee10886 WHIRLPOOL e74b9c3a6dff563b81bf3ce85119fbdfc658191ac063763f2916a7dcd90584f98cbccd1d6cd5ef3aecb00366a82c949c62ab9b907cb98800cb53d3e9ab63b492
+DIST policycoreutils-extra-1.34.tar.bz2 12107 SHA256 56ae2aac57bf104d6a8a7837b25de7978b25e0642744ef95e6e6d483201aa4ca SHA512 b1db6d70cf864023f22583e5bd24c85e796f1541f9c1bc878dd55309464b27346e05e414db3ef81bef2dfe8c8d7d7063ee7e0422878f38a3db56c67d9468b89d WHIRLPOOL 8b094818bed0e438ce4258428afa054cb561f53e303d84e171881add5952cfc0fa577bce2765294905dac8ddd5560906904958f35c96afce0f357feb5333646d
diff --git a/sys-apps/policycoreutils/files/0001-policycoreutils-pp-add-roletype-statements-for-both-.patch b/sys-apps/policycoreutils/files/0001-policycoreutils-pp-add-roletype-statements-for-both-.patch
new file mode 100644
index 000000000000..6ed451649e3e
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0001-policycoreutils-pp-add-roletype-statements-for-both-.patch
@@ -0,0 +1,61 @@
+From 7a09af2123bc0d86787ef82fc2ff43810f1712c0 Mon Sep 17 00:00:00 2001
+From: Steve Lawrence <slawrence@tresys.com>
+Date: Wed, 19 Nov 2014 11:21:42 -0500
+Subject: [PATCH 1/2] policycoreutils: pp: add roletype statements for both
+ declared and required type/typeattributes
+
+Currently, roletype statements are only added for types when they are
+declared (not required). This means that in policy like:
+
+ require {
+ type foo_t;
+ }
+ type bar_t;
+ role staff_r types foo_t, bar_t;
+
+only bar_t is associated with staff_r. This patch moves the code that
+generates roletype statements for types to outside the SCOPE_DECL check
+so that roletype statements are generated for all types, regardless of
+the required/declared scope. It further moves the code outside of the
+type/typeattribute flavor check so that roletype statements are also
+generated for typeattributes.
+
+Reported-by: Sven Vermeulen <sven.vermeulen@siphos.be>
+Signed-off-by: Steve Lawrence <slawrence@tresys.com>
+Reviewed-by: Yuli Khodorkovskiy <ykhodorkovskiy@tresys.com>
+Tested-by: Jason Zaman <jason@perfinion.com>
+---
+ policycoreutils/hll/pp/pp.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/policycoreutils/hll/pp/pp.c b/policycoreutils/hll/pp/pp.c
+index b1ef27f..4b9f310 100644
+--- a/policycoreutils/hll/pp/pp.c
++++ b/policycoreutils/hll/pp/pp.c
+@@ -2083,6 +2083,11 @@ static int type_to_cil(int indent, struct policydb *pdb, struct avrule_block *UN
+ cil_println(indent, "(typeattributeset " GEN_REQUIRE_ATTR " %s)", key);
+ }
+
++ rc = roletype_role_in_ancestor_to_cil(pdb, decl_stack, key, indent);
++ if (rc != 0) {
++ goto exit;
++ }
++
+ switch(type->flavor) {
+ case TYPE_TYPE:
+ if (scope == SCOPE_DECL) {
+@@ -2090,11 +2095,6 @@ static int type_to_cil(int indent, struct policydb *pdb, struct avrule_block *UN
+ // object_r is implicit in checkmodule, but not with CIL,
+ // create it as part of base
+ cil_println(indent, "(roletype " DEFAULT_OBJECT " %s)", key);
+-
+- rc = roletype_role_in_ancestor_to_cil(pdb, decl_stack, key, indent);
+- if (rc != 0) {
+- goto exit;
+- }
+ }
+
+ if (type->flags & TYPE_FLAGS_PERMISSIVE) {
+--
+2.0.4
+
diff --git a/sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch b/sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch
new file mode 100644
index 000000000000..52a34bd1f47b
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0010-remove-sesandbox-support.patch
@@ -0,0 +1,9 @@
+diff -uNr policycoreutils-2.4-rc2.orig/Makefile policycoreutils-2.4-rc2/Makefile
+--- policycoreutils-2.4-rc2.orig/Makefile 2014-08-28 20:13:23.212622408 +0200
++++ policycoreutils-2.4-rc2/Makefile 2014-08-28 20:14:24.136624808 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init sandbox secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
++SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
+
+ INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
+
diff --git a/sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch b/sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch
new file mode 100644
index 000000000000..a3eeaed901d5
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0020-disable-autodetection-of-pam-and-audit.patch
@@ -0,0 +1,108 @@
+diff -uNr policycoreutils-2.2.1.orig/newrole/Makefile policycoreutils-2.2.1/newrole/Makefile
+--- policycoreutils-2.2.1.orig/newrole/Makefile 2013-11-04 21:37:27.197018032 +0100
++++ policycoreutils-2.2.1/newrole/Makefile 2013-11-04 21:37:47.602018075 +0100
+@@ -4,8 +4,8 @@
+ MANDIR ?= $(PREFIX)/share/man
+ ETCDIR ?= $(DESTDIR)/etc
+ LOCALEDIR = /usr/share/locale
+-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
+-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
++PAMH ?= no
++AUDITH ?= no
+ # Enable capabilities to permit newrole to generate audit records.
+ # This will make newrole a setuid root program.
+ # The capabilities used are: CAP_AUDIT_WRITE.
+@@ -24,7 +24,7 @@
+ EXTRA_OBJS =
+ override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
+ LDLIBS += -lselinux -L$(PREFIX)/lib
+-ifeq ($(PAMH), /usr/include/security/pam_appl.h)
++ifeq ($(PAMH), yes)
+ override CFLAGS += -DUSE_PAM
+ EXTRA_OBJS += hashtab.o
+ LDLIBS += -lpam -lpam_misc
+@@ -32,7 +32,7 @@
+ override CFLAGS += -D_XOPEN_SOURCE=500
+ LDLIBS += -lcrypt
+ endif
+-ifeq ($(AUDITH), /usr/include/libaudit.h)
++ifeq ($(AUDITH), yes)
+ override CFLAGS += -DUSE_AUDIT
+ LDLIBS += -laudit
+ endif
+@@ -49,7 +49,7 @@
+ IS_SUID=y
+ endif
+ ifeq ($(IS_SUID),y)
+- MODE := 4555
++ MODE := 0555
+ LDLIBS += -lcap-ng
+ else
+ MODE := 0555
+@@ -66,7 +66,7 @@
+ test -d $(MANDIR)/man1 || install -m 755 -d $(MANDIR)/man1
+ install -m $(MODE) newrole $(BINDIR)
+ install -m 644 newrole.1 $(MANDIR)/man1/
+-ifeq ($(PAMH), /usr/include/security/pam_appl.h)
++ifeq ($(PAMH), yes)
+ test -d $(ETCDIR)/pam.d || install -m 755 -d $(ETCDIR)/pam.d
+ ifeq ($(LSPP_PRIV),y)
+ install -m 644 newrole-lspp.pamd $(ETCDIR)/pam.d/newrole
+diff -uNr policycoreutils-2.2.1.orig/run_init/Makefile policycoreutils-2.2.1/run_init/Makefile
+--- policycoreutils-2.2.1.orig/run_init/Makefile 2013-11-04 21:37:27.115018032 +0100
++++ policycoreutils-2.2.1/run_init/Makefile 2013-11-04 21:37:47.603018075 +0100
+@@ -5,20 +5,20 @@
+ MANDIR ?= $(PREFIX)/share/man
+ ETCDIR ?= $(DESTDIR)/etc
+ LOCALEDIR ?= /usr/share/locale
+-PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
+-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
++PAMH ?= no
++AUDITH ?= no
+
+ CFLAGS ?= -Werror -Wall -W
+ override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
+ LDLIBS += -lselinux -L$(PREFIX)/lib
+-ifeq ($(PAMH), /usr/include/security/pam_appl.h)
++ifeq ($(PAMH), yes)
+ override CFLAGS += -DUSE_PAM
+ LDLIBS += -lpam -lpam_misc
+ else
+ override CFLAGS += -D_XOPEN_SOURCE=500
+ LDLIBS += -lcrypt
+ endif
+-ifeq ($(AUDITH), /usr/include/libaudit.h)
++ifeq ($(AUDITH), yes)
+ override CFLAGS += -DUSE_AUDIT
+ LDLIBS += -laudit
+ endif
+@@ -38,7 +38,7 @@
+ install -m 755 open_init_pty $(SBINDIR)
+ install -m 644 run_init.8 $(MANDIR)/man8/
+ install -m 644 open_init_pty.8 $(MANDIR)/man8/
+-ifeq ($(PAMH), /usr/include/security/pam_appl.h)
++ifeq ($(PAMH), yes)
+ install -m 644 run_init.pamd $(ETCDIR)/pam.d/run_init
+ endif
+
+diff -uNr policycoreutils-2.2.1.orig/setfiles/Makefile policycoreutils-2.2.1/setfiles/Makefile
+--- policycoreutils-2.2.1.orig/setfiles/Makefile 2013-11-04 21:37:27.198018032 +0100
++++ policycoreutils-2.2.1/setfiles/Makefile 2013-11-04 21:37:47.603018075 +0100
+@@ -3,7 +3,7 @@
+ SBINDIR ?= $(DESTDIR)/sbin
+ MANDIR = $(PREFIX)/share/man
+ LIBDIR ?= $(PREFIX)/lib
+-AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
++AUDITH ?= no
+
+ PROGRESS_STEP=$(shell grep "^\#define STAR_COUNT" restore.h | awk -S '{ print $$3 }')
+ ABORT_ON_ERRORS=$(shell grep "^\#define ABORT_ON_ERRORS" setfiles.c | awk -S '{ print $$3 }')
+@@ -12,7 +12,7 @@
+ override CFLAGS += -I$(PREFIX)/include
+ LDLIBS = -lselinux -lsepol -L$(LIBDIR)
+
+-ifeq ($(AUDITH), /usr/include/libaudit.h)
++ifeq ($(AUDITH), yes)
+ override CFLAGS += -DUSE_AUDIT
+ LDLIBS += -laudit
+ endif
diff --git a/sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch b/sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch
new file mode 100644
index 000000000000..6a31e255a952
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0030-make-inotify-check-use-flag-triggered.patch
@@ -0,0 +1,14 @@
+diff -uNr policycoreutils-2.4-rc2.orig/Makefile policycoreutils-2.4-rc2/Makefile
+--- policycoreutils-2.4-rc2.orig/Makefile 2014-08-28 20:22:45.230644554 +0200
++++ policycoreutils-2.4-rc2/Makefile 2014-08-28 20:27:08.642654934 +0200
+@@ -1,8 +1,8 @@
+ SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
+
+-INOTIFYH = $(shell ls /usr/include/sys/inotify.h 2>/dev/null)
++INOTIFYH ?= no
+
+-ifeq (${INOTIFYH}, /usr/include/sys/inotify.h)
++ifeq (${INOTIFYH}, yes)
+ SUBDIRS += restorecond
+ endif
+
diff --git a/sys-apps/policycoreutils/files/0040-reverse-access-check-in-run_init.patch b/sys-apps/policycoreutils/files/0040-reverse-access-check-in-run_init.patch
new file mode 100644
index 000000000000..f53b456720ef
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0040-reverse-access-check-in-run_init.patch
@@ -0,0 +1,12 @@
+diff -uNr policycoreutils-2.2.1.orig/run_init/run_init.c policycoreutils-2.2.1/run_init/run_init.c
+--- policycoreutils-2.2.1.orig/run_init/run_init.c 2013-11-04 21:40:27.490018417 +0100
++++ policycoreutils-2.2.1/run_init/run_init.c 2013-11-04 21:40:57.088018480 +0100
+@@ -406,7 +406,7 @@
+ new_context);
+ exit(-1);
+ }
+- if (! access("/usr/sbin/open_init_pty", X_OK)) {
++ if (access("/usr/sbin/open_init_pty", X_OK) != 0) {
+ if (execvp(argv[1], argv + 1)) {
+ perror("execvp");
+ exit(-1);
diff --git a/sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch b/sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch
new file mode 100644
index 000000000000..7d438983bb7e
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch
@@ -0,0 +1,11 @@
+diff -uNr policycoreutils-2.2.1.orig/load_policy/Makefile policycoreutils-2.2.1/load_policy/Makefile
+--- policycoreutils-2.2.1.orig/load_policy/Makefile 2013-11-04 21:41:28.289018546 +0100
++++ policycoreutils-2.2.1/load_policy/Makefile 2013-11-04 21:43:31.118018808 +0100
+@@ -19,7 +19,6 @@
+ test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
+ install -m 644 load_policy.8 $(MANDIR)/man8/
+ -mkdir -p $(USRSBINDIR)
+- -ln -sf $(SBINDIR)/load_policy $(USRSBINDIR)/load_policy
+
+ clean:
+ -rm -f $(TARGETS) *.o
diff --git a/sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch b/sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch
new file mode 100644
index 000000000000..68033c705cd5
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0110-build-mcstrans-bug-472912.patch
@@ -0,0 +1,64 @@
+diff -uNr policycoreutils-2.4-rc2.orig/Makefile policycoreutils-2.4-rc2/Makefile
+--- policycoreutils-2.4-rc2.orig/Makefile 2014-08-28 20:31:19.563664821 +0200
++++ policycoreutils-2.4-rc2/Makefile 2014-08-28 20:32:25.900667435 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll
++SUBDIRS = sepolicy setfiles semanage load_policy newrole run_init secon audit2allow sestatus semodule_package semodule semodule_link semodule_expand semodule_deps sepolgen-ifgen setsebool scripts po man gui hll mcstrans
+
+ INOTIFYH ?= n
+
+diff -uNr policycoreutils-2.4-rc2.orig/mcstrans/src/Makefile policycoreutils-2.4-rc2/mcstrans/src/Makefile
+--- policycoreutils-2.4-rc2.orig/mcstrans/src/Makefile 2014-08-28 20:31:19.562664821 +0200
++++ policycoreutils-2.4-rc2/mcstrans/src/Makefile 2014-08-28 20:33:39.345670329 +0200
+@@ -1,23 +1,10 @@
+ ARCH = $(shell uname -i)
+-ifeq "$(ARCH)" "x86_64"
+- # In case of 64 bit system, use these lines
+- LIBDIR=/usr/lib64
+-else
+-ifeq "$(ARCH)" "i686"
+- # In case of 32 bit system, use these lines
+- LIBDIR=/usr/lib
+-else
+-ifeq "$(ARCH)" "i386"
+- # In case of 32 bit system, use these lines
+- LIBDIR=/usr/lib
+-endif
+-endif
+-endif
+ # Installation directories.
+ PREFIX ?= $(DESTDIR)/usr
+ SBINDIR ?= $(DESTDIR)/sbin
+ INITDIR ?= $(DESTDIR)/etc/rc.d/init.d
+ SYSTEMDDIR ?= $(DESTDIR)/usr/lib/systemd
++LIBDIR ?= $(PREFIX)/lib
+
+ PROG_SRC=mcstrans.c mcscolor.c mcstransd.c mls_level.c
+ PROG_OBJS= $(patsubst %.c,%.o,$(PROG_SRC))
+diff -uNr policycoreutils-2.4-rc2.orig/mcstrans/utils/Makefile policycoreutils-2.4-rc2/mcstrans/utils/Makefile
+--- policycoreutils-2.4-rc2.orig/mcstrans/utils/Makefile 2014-08-28 20:31:19.556664821 +0200
++++ policycoreutils-2.4-rc2/mcstrans/utils/Makefile 2014-08-28 20:34:14.145671701 +0200
+@@ -3,22 +3,7 @@
+ BINDIR ?= $(PREFIX)/sbin
+
+ ARCH = $(shell uname -i)
+-ifeq "$(ARCH)" "x86_64"
+- # In case of 64 bit system, use these lines
+- LIBDIR=/usr/lib64
+-else
+-ifeq "$(ARCH)" "i686"
+- # In case of 32 bit system, use these lines
+- LIBDIR=/usr/lib
+-else
+-ifeq "$(ARCH)" "i386"
+- # In case of 32 bit system, use these lines
+- LIBDIR=/usr/lib
+-endif
+-endif
+-endif
+-
+-
++LIBDIR ?= $(PREFIX)/lib
+ CFLAGS ?= -Wall
+ override CFLAGS += -I../src -D_GNU_SOURCE
+ LDLIBS += -L../src ../src/mcstrans.o ../src/mls_level.o -lselinux -lpcre $(LIBDIR)/libsepol.a
diff --git a/sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch b/sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch
new file mode 100644
index 000000000000..cf50664264e1
--- /dev/null
+++ b/sys-apps/policycoreutils/files/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch
@@ -0,0 +1,11 @@
+diff -uNr policycoreutils-2.4-rc2.orig/mcstrans/src/mcscolor.c policycoreutils-2.4-rc2/mcstrans/src/mcscolor.c
+--- policycoreutils-2.4-rc2.orig/mcstrans/src/mcscolor.c 2014-08-28 21:26:25.125795076 +0200
++++ policycoreutils-2.4-rc2/mcstrans/src/mcscolor.c 2014-08-28 21:27:03.509796589 +0200
+@@ -11,6 +11,7 @@
+ #include <syslog.h>
+ #include <selinux/selinux.h>
+ #include <selinux/context.h>
++#include <selinux/av_permissions.h>
+ #include "mcstrans.h"
+
+ /* Define data structures */
diff --git a/sys-apps/policycoreutils/metadata.xml b/sys-apps/policycoreutils/metadata.xml
new file mode 100644
index 000000000000..7190ed6251d1
--- /dev/null
+++ b/sys-apps/policycoreutils/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>selinux</herd>
+ <longdescription>
+ Policycoreutils contains the policy core utilities that are required
+ for basic operation of a SELinux system. These utilities include
+ load_policy to load policies, setfiles to label filesystems, newrole
+ to switch roles, and run_init to run /etc/init.d scripts in the proper
+ context.
+
+ Gentoo-specific tools include rlpkg for relabeling packages by name,
+ avc_toggle to toggle between enforcing and permissive modes, and
+ avc_enforcing to query the current mode of the system, enforcing or
+ permissive.
+ </longdescription>
+ <use>
+ <flag name="audit">Enable support for <pkg>sys-process/audit</pkg> and use the audit_* functions (like audit_getuid instead of getuid())</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:redhat:policycoreutils</remote-id>
+ <remote-id type="github">SELinuxProject/selinux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/policycoreutils/policycoreutils-2.2.5-r4.ebuild b/sys-apps/policycoreutils/policycoreutils-2.2.5-r4.ebuild
new file mode 100644
index 000000000000..dedb7573d4c3
--- /dev/null
+++ b/sys-apps/policycoreutils/policycoreutils-2.2.5-r4.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit multilib python-r1 toolchain-funcs eutils
+
+EXTRAS_VER="1.31"
+SEMNG_VER="2.2"
+SELNX_VER="2.2"
+SEPOL_VER="2.2"
+
+IUSE="audit pam dbus"
+
+DESCRIPTION="SELinux core utilities"
+HOMEPAGE="http://userspace.selinuxproject.org"
+SRC_URI="http://userspace.selinuxproject.org/releases/20131030/${P}.tar.gz
+http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${P}-gentoo-r1.tar.gz
+ mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
+ >=sys-libs/glibc-2.4
+ >=sys-libs/libcap-1.10-r10
+ >=sys-libs/libsemanage-${SEMNG_VER}[python]
+ sys-libs/libcap-ng
+ >=sys-libs/libsepol-${SEPOL_VER}
+ sys-devel/gettext
+ dev-python/ipy
+ dbus? (
+ sys-apps/dbus
+ dev-libs/dbus-glib
+ )
+ audit? ( >=sys-process/audit-1.5.1 )
+ pam? ( sys-libs/pam )
+ ${PYTHON_DEPS}"
+
+### libcgroup -> seunshare
+### dbus -> restorecond
+
+# pax-utils for scanelf used by rlpkg
+RDEPEND="${COMMON_DEPS}
+ dev-python/sepolgen
+ app-misc/pax-utils"
+
+DEPEND="${COMMON_DEPS}"
+
+S1="${WORKDIR}/${P}"
+S2="${WORKDIR}/policycoreutils-extra"
+
+src_prepare() {
+ # rlpkg is more useful than fixfiles
+ sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 1 failed"
+ sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 2 failed"
+
+ EPATCH_MULTI_MSG="Applying policycoreutils patches ... " \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
+ EPATCH_FORCE="yes" \
+ epatch
+
+ epatch_user
+
+ python_copy_sources
+ # Our extra code is outside the regular directory, so set it to the extra
+ # directory. We really should optimize this as it is ugly, but the extra
+ # code is needed for Gentoo at the same time that policycoreutils is present
+ # (so we cannot use an additional package for now).
+ S="${S2}"
+ python_copy_sources
+}
+
+src_compile() {
+ local use_audit="n";
+ local use_pam="n";
+ local use_dbus="n";
+ local use_sesandbox="n";
+
+ use audit && use_audit="y";
+ use pam && use_pam="y";
+ use dbus && use_dbus="y";
+
+ building() {
+ emake -C "${BUILD_DIR}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" CC="$(tc-getCC)" PYLIBVER="${EPYTHON}" || die
+ }
+ S="${S1}" # Regular policycoreutils
+ python_foreach_impl building
+ S="${S2}" # Extra set
+ python_foreach_impl building
+}
+
+src_install() {
+ local use_audit="n";
+ local use_pam="n";
+ local use_dbus="n";
+ local use_sesandbox="n";
+
+ use audit && use_audit="y";
+ use pam && use_pam="y";
+ use dbus && use_dbus="y";
+
+ # Python scripts are present in many places. There are no extension modules.
+ installation-policycoreutils() {
+ einfo "Installing policycoreutils"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" AUDIT_LOG_PRIV="y" PYLIBVER="${EPYTHON}" install || return 1
+ }
+
+ installation-extras() {
+ einfo "Installing policycoreutils-extra"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="${use_dbus}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
+ }
+
+ S="${S1}" # policycoreutils
+ python_foreach_impl installation-policycoreutils
+ S="${S2}" # extras
+ python_foreach_impl installation-extras
+ S="${S1}" # back for later
+
+ # remove redhat-style init script
+ rm -fR "${D}/etc/rc.d"
+
+ # compatibility symlinks
+ dosym /sbin/setfiles /usr/sbin/setfiles
+ dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
+
+ # location for permissive definitions
+ dodir /var/lib/selinux
+ keepdir /var/lib/selinux
+
+ # Set version-specific scripts
+ for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
+ python_replicate_script "${ED}/usr/bin/${pyscript}"
+ done
+ for pyscript in semanage rlpkg; do
+ python_replicate_script "${ED}/usr/sbin/${pyscript}"
+ done
+
+ dodir /usr/share/doc/${PF}/mcstrans/examples
+ cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
+}
+
+pkg_postinst() {
+ elog "Previous versions of policycoreutils optionally installed sesandbox support."
+ elog "However, due to the possible unsafe state of seunshare (CVE-2014-3215) and the"
+ elog "fact that sesandbox (called 'sandbox' upstream but collides with Portage sandbox)"
+ elog "has not been supported in Gentoo for a while (for one, our policies do not provide"
+ elog "sandboxing support) we have discontinued providing the sandbox related files."
+}
diff --git a/sys-apps/policycoreutils/policycoreutils-2.3-r3.ebuild b/sys-apps/policycoreutils/policycoreutils-2.3-r3.ebuild
new file mode 100644
index 000000000000..99accc5b3a70
--- /dev/null
+++ b/sys-apps/policycoreutils/policycoreutils-2.3-r3.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit multilib python-r1 toolchain-funcs eutils
+
+MY_P="${P//_/-}"
+
+EXTRAS_VER="1.33"
+SEMNG_VER="2.3"
+SELNX_VER="2.3"
+SEPOL_VER="2.3"
+PATCHBUNDLE="3"
+
+IUSE="audit pam dbus"
+
+DESCRIPTION="SELinux core utilities"
+HOMEPAGE="http://userspace.selinuxproject.org"
+SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20140506/${MY_P}.tar.gz
+http://dev.gentoo.org/~swift/patches/policycoreutils/patchbundle-${PN}-${PATCHBUNDLE}.tar.gz
+ mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+COMMON_DEPS=">=sys-libs/libselinux-${SELNX_VER}[python]
+ >=sys-libs/glibc-2.4
+ >=sys-libs/libcap-1.10-r10
+ >=sys-libs/libsemanage-${SEMNG_VER}[python]
+ sys-libs/libcap-ng
+ >=sys-libs/libsepol-${SEPOL_VER}
+ sys-devel/gettext
+ dev-python/ipy
+ dbus? (
+ sys-apps/dbus
+ dev-libs/dbus-glib
+ )
+ audit? ( >=sys-process/audit-1.5.1 )
+ pam? ( sys-libs/pam )
+ ${PYTHON_DEPS}"
+
+### libcgroup -> seunshare
+### dbus -> restorecond
+
+# pax-utils for scanelf used by rlpkg
+RDEPEND="${COMMON_DEPS}
+ dev-python/sepolgen
+ app-misc/pax-utils"
+
+DEPEND="${COMMON_DEPS}"
+
+S="${WORKDIR}/${MY_P}"
+S1="${WORKDIR}/${MY_P}"
+S2="${WORKDIR}/policycoreutils-extra"
+
+src_prepare() {
+ # rlpkg is more useful than fixfiles
+ sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 1 failed"
+ sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 2 failed"
+
+ EPATCH_MULTI_MSG="Applying policycoreutils patches ... " \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_SOURCE="${WORKDIR}/gentoo-patches" \
+ EPATCH_FORCE="yes" \
+ epatch
+
+ epatch_user
+
+ python_copy_sources
+ # Our extra code is outside the regular directory, so set it to the extra
+ # directory. We really should optimize this as it is ugly, but the extra
+ # code is needed for Gentoo at the same time that policycoreutils is present
+ # (so we cannot use an additional package for now).
+ S="${S2}"
+ python_copy_sources
+}
+
+src_compile() {
+ local use_audit="n";
+ local use_pam="n";
+ local use_dbus="n";
+ local use_sesandbox="n";
+
+ use audit && use_audit="y";
+ use pam && use_pam="y";
+ use dbus && use_dbus="y";
+
+ building() {
+ emake -C "${BUILD_DIR}" AUDIT_LOG_PRIVS="y" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" CC="$(tc-getCC)" PYLIBVER="${EPYTHON}" || die
+ }
+ S="${S1}" # Regular policycoreutils
+ python_foreach_impl building
+ S="${S2}" # Extra set
+ python_foreach_impl building
+}
+
+src_install() {
+ local use_audit="n";
+ local use_pam="n";
+ local use_dbus="n";
+ local use_sesandbox="n";
+
+ use audit && use_audit="y";
+ use pam && use_pam="y";
+ use dbus && use_dbus="y";
+
+ # Python scripts are present in many places. There are no extension modules.
+ installation-policycoreutils() {
+ einfo "Installing policycoreutils"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" AUDITH="${use_audit}" PAMH="${use_pam}" INOTIFYH="${use_dbus}" SESANDBOX="${use_sesandbox}" AUDIT_LOG_PRIV="y" PYLIBVER="${EPYTHON}" install || return 1
+ python_optimize
+ }
+
+ installation-extras() {
+ einfo "Installing policycoreutils-extra"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="${use_dbus}" SHLIBDIR="${D}$(get_libdir)/rc" install || return 1
+ python_optimize
+ }
+
+ S="${S1}" # policycoreutils
+ python_foreach_impl installation-policycoreutils
+ S="${S2}" # extras
+ python_foreach_impl installation-extras
+ S="${S1}" # back for later
+
+ # remove redhat-style init script
+ rm -fR "${D}/etc/rc.d"
+
+ # compatibility symlinks
+ dosym /sbin/setfiles /usr/sbin/setfiles
+ dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
+
+ # location for permissive definitions
+ dodir /var/lib/selinux
+ keepdir /var/lib/selinux
+
+ # Set version-specific scripts
+ for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
+ python_replicate_script "${ED}/usr/bin/${pyscript}"
+ done
+ for pyscript in semanage rlpkg; do
+ python_replicate_script "${ED}/usr/sbin/${pyscript}"
+ done
+
+ dodir /usr/share/doc/${PF}/mcstrans/examples
+ cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
+}
diff --git a/sys-apps/policycoreutils/policycoreutils-2.4-r1.ebuild b/sys-apps/policycoreutils/policycoreutils-2.4-r1.ebuild
new file mode 100644
index 000000000000..39515e962535
--- /dev/null
+++ b/sys-apps/policycoreutils/policycoreutils-2.4-r1.ebuild
@@ -0,0 +1,159 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit multilib python-r1 toolchain-funcs eutils bash-completion-r1
+
+MY_P="${P//_/-}"
+
+MY_RELEASEDATE="20150202"
+EXTRAS_VER="1.34"
+SEMNG_VER="${PV}"
+SELNX_VER="${PV}"
+SEPOL_VER="${PV}"
+
+IUSE="audit pam dbus"
+
+DESCRIPTION="SELinux core utilities"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz
+ http://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python]
+ >=sys-libs/glibc-2.4
+ >=sys-libs/libcap-1.10-r10:=
+ >=sys-libs/libsemanage-${SEMNG_VER}:=[python]
+ sys-libs/libcap-ng:=
+ >=sys-libs/libsepol-${SEPOL_VER}:=
+ sys-devel/gettext
+ dev-python/ipy[${PYTHON_USEDEP}]
+ dbus? (
+ sys-apps/dbus
+ dev-libs/dbus-glib:=
+ )
+ audit? ( >=sys-process/audit-1.5.1 )
+ pam? ( sys-libs/pam:= )
+ ${PYTHON_DEPS}"
+
+### libcgroup -> seunshare
+### dbus -> restorecond
+
+# pax-utils for scanelf used by rlpkg
+RDEPEND="${DEPEND}
+ dev-python/sepolgen
+ app-misc/pax-utils
+ !<sys-apps/openrc-0.14"
+
+S1="${WORKDIR}/${MY_P}"
+S2="${WORKDIR}/policycoreutils-extra"
+S="${S1}"
+
+src_prepare() {
+ epatch "${FILESDIR}/0010-remove-sesandbox-support.patch"
+ epatch "${FILESDIR}/0020-disable-autodetection-of-pam-and-audit.patch"
+ epatch "${FILESDIR}/0030-make-inotify-check-use-flag-triggered.patch"
+ epatch "${FILESDIR}/0040-reverse-access-check-in-run_init.patch"
+ epatch "${FILESDIR}/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch"
+ epatch "${FILESDIR}/0110-build-mcstrans-bug-472912.patch"
+ epatch "${FILESDIR}/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch"
+
+ # rlpkg is more useful than fixfiles
+ sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 1 failed"
+ sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 2 failed"
+
+ epatch_user
+
+ sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
+
+ python_copy_sources
+ # Our extra code is outside the regular directory, so set it to the extra
+ # directory. We really should optimize this as it is ugly, but the extra
+ # code is needed for Gentoo at the same time that policycoreutils is present
+ # (so we cannot use an additional package for now).
+ S="${S2}"
+ python_copy_sources
+}
+
+src_compile() {
+ building() {
+ emake -C "${BUILD_DIR}" \
+ AUDIT_LOG_PRIVS="y" \
+ AUDITH="$(usex audit)" \
+ PAMH="$(usex pam)" \
+ INOTIFYH="$(usex dbus)" \
+ SESANDBOX="n" \
+ CC="$(tc-getCC)" \
+ PYLIBVER="${EPYTHON}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)"
+ }
+ S="${S1}" # Regular policycoreutils
+ python_foreach_impl building
+ S="${S2}" # Extra set
+ python_foreach_impl building
+}
+
+src_install() {
+ # Python scripts are present in many places. There are no extension modules.
+ installation-policycoreutils() {
+ einfo "Installing policycoreutils"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" \
+ AUDITH="$(usex audit)" \
+ PAMH="$(usex pam)" \
+ INOTIFYH="$(usex dbus)" \
+ SESANDBOX="n" \
+ AUDIT_LOG_PRIV="y" \
+ PYLIBVER="${EPYTHON}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ install
+ python_optimize
+ }
+
+ installation-extras() {
+ einfo "Installing policycoreutils-extra"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="$(usex dbus)" SHLIBDIR="${D}$(get_libdir)/rc" install
+ python_optimize
+ }
+
+ S="${S1}" # policycoreutils
+ python_foreach_impl installation-policycoreutils
+ S="${S2}" # extras
+ python_foreach_impl installation-extras
+ S="${S1}" # back for later
+
+ # remove redhat-style init script
+ rm -fR "${D}/etc/rc.d" || die
+
+ # compatibility symlinks
+ dosym /sbin/setfiles /usr/sbin/setfiles
+ bashcomp_alias setsebool getsebool
+
+ # location for policy definitions
+ dodir /var/lib/selinux
+ keepdir /var/lib/selinux
+
+ # Set version-specific scripts
+ for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
+ python_replicate_script "${ED}/usr/bin/${pyscript}"
+ done
+ for pyscript in semanage rlpkg; do
+ python_replicate_script "${ED}/usr/sbin/${pyscript}"
+ done
+
+ dodir /usr/share/doc/${PF}/mcstrans/examples
+ cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples" || die
+}
+
+pkg_postinst() {
+ # The selinux_gentoo init script is no longer needed with recent OpenRC
+ elog "The selinux_gentoo init script has been removed in this version as it is not required after OpenRC 0.13."
+}
diff --git a/sys-apps/policycoreutils/policycoreutils-2.4.ebuild b/sys-apps/policycoreutils/policycoreutils-2.4.ebuild
new file mode 100644
index 000000000000..642ddd910313
--- /dev/null
+++ b/sys-apps/policycoreutils/policycoreutils-2.4.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="xml"
+
+inherit multilib python-r1 toolchain-funcs eutils
+
+MY_P="${P//_/-}"
+
+EXTRAS_VER="1.33"
+SEMNG_VER="${PV}"
+SELNX_VER="${PV}"
+SEPOL_VER="${PV}"
+
+IUSE="audit pam dbus"
+
+DESCRIPTION="SELinux core utilities"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20150202/${MY_P}.tar.gz
+ mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+DEPEND=">=sys-libs/libselinux-${SELNX_VER}[python]
+ >=sys-libs/glibc-2.4
+ >=sys-libs/libcap-1.10-r10
+ >=sys-libs/libsemanage-${SEMNG_VER}[python]
+ sys-libs/libcap-ng
+ >=sys-libs/libsepol-${SEPOL_VER}
+ sys-devel/gettext
+ dev-python/ipy[${PYTHON_USEDEP}]
+ dbus? (
+ sys-apps/dbus
+ dev-libs/dbus-glib
+ )
+ audit? ( >=sys-process/audit-1.5.1 )
+ pam? ( sys-libs/pam )
+ ${PYTHON_DEPS}"
+
+### libcgroup -> seunshare
+### dbus -> restorecond
+
+# pax-utils for scanelf used by rlpkg
+RDEPEND="${DEPEND}
+ dev-python/sepolgen
+ app-misc/pax-utils"
+
+S="${WORKDIR}/${MY_P}"
+S1="${WORKDIR}/${MY_P}"
+S2="${WORKDIR}/policycoreutils-extra"
+
+src_prepare() {
+ epatch "${FILESDIR}/0010-remove-sesandbox-support.patch"
+ epatch "${FILESDIR}/0020-disable-autodetection-of-pam-and-audit.patch"
+ epatch "${FILESDIR}/0030-make-inotify-check-use-flag-triggered.patch"
+ epatch "${FILESDIR}/0040-reverse-access-check-in-run_init.patch"
+ epatch "${FILESDIR}/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch"
+ epatch "${FILESDIR}/0110-build-mcstrans-bug-472912.patch"
+ epatch "${FILESDIR}/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch"
+
+ # rlpkg is more useful than fixfiles
+ sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 1 failed"
+ sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 2 failed"
+
+ epatch_user
+
+ python_copy_sources
+ # Our extra code is outside the regular directory, so set it to the extra
+ # directory. We really should optimize this as it is ugly, but the extra
+ # code is needed for Gentoo at the same time that policycoreutils is present
+ # (so we cannot use an additional package for now).
+ S="${S2}"
+ python_copy_sources
+}
+
+src_compile() {
+ building() {
+ emake -C "${BUILD_DIR}" \
+ AUDIT_LOG_PRIVS="y" \
+ AUDITH="$(usex audit)" \
+ PAMH="$(usex pam)" \
+ INOTIFYH="$(usex dbus)" \
+ SESANDBOX="n" \
+ CC="$(tc-getCC)" \
+ PYLIBVER="${EPYTHON}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)"
+ }
+ S="${S1}" # Regular policycoreutils
+ python_foreach_impl building
+ S="${S2}" # Extra set
+ python_foreach_impl building
+}
+
+src_install() {
+ # Python scripts are present in many places. There are no extension modules.
+ installation-policycoreutils() {
+ einfo "Installing policycoreutils"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" AUDITH="$(usex audit)" PAMH="$(usex pam)" INOTIFYH="$(usex dbus)" SESANDBOX="n" AUDIT_LOG_PRIV="y" PYLIBVER="${EPYTHON}" install
+ python_optimize
+ }
+
+ installation-extras() {
+ einfo "Installing policycoreutils-extra"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="$(usex dbus)" SHLIBDIR="${D}$(get_libdir)/rc" install
+ python_optimize
+ }
+
+ S="${S1}" # policycoreutils
+ python_foreach_impl installation-policycoreutils
+ S="${S2}" # extras
+ python_foreach_impl installation-extras
+ S="${S1}" # back for later
+
+ # remove redhat-style init script
+ rm -fR "${D}/etc/rc.d"
+
+ # compatibility symlinks
+ dosym /sbin/setfiles /usr/sbin/setfiles
+ dosym /$(get_libdir)/rc/runscript_selinux.so /$(get_libdir)/rcscripts/runscript_selinux.so
+
+ # location for policy definitions
+ dodir /var/lib/selinux
+ keepdir /var/lib/selinux
+
+ # Set version-specific scripts
+ for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
+ python_replicate_script "${ED}/usr/bin/${pyscript}"
+ done
+ for pyscript in semanage rlpkg; do
+ python_replicate_script "${ED}/usr/sbin/${pyscript}"
+ done
+
+ dodir /usr/share/doc/${PF}/mcstrans/examples
+ cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples"
+}
+
+pkg_postinst() {
+ # The selinux_gentoo init script is no longer needed with recent OpenRC
+ elog "The selinux_gentoo init script will be removed in future versions since it is not needed with OpenRC 0.13."
+}
diff --git a/sys-apps/policycoreutils/policycoreutils-9999.ebuild b/sys-apps/policycoreutils/policycoreutils-9999.ebuild
new file mode 100644
index 000000000000..6ec0006fc0d0
--- /dev/null
+++ b/sys-apps/policycoreutils/policycoreutils-9999.ebuild
@@ -0,0 +1,191 @@
+# 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} )
+PYTHON_REQ_USE="xml"
+
+inherit multilib python-r1 toolchain-funcs eutils bash-completion-r1
+
+MY_P="${P//_/-}"
+
+MY_RELEASEDATE="20150202"
+EXTRAS_VER="1.34"
+SEMNG_VER="${PV}"
+SELNX_VER="${PV}"
+SEPOL_VER="${PV}"
+
+IUSE="audit pam dbus"
+
+DESCRIPTION="SELinux core utilities"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ SRC_URI="http://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
+ S1="${WORKDIR}/${MY_P}/${PN}"
+ S2="${WORKDIR}/policycoreutils-extra"
+ S="${S1}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz
+ http://dev.gentoo.org/~perfinion/distfiles/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
+ KEYWORDS="~amd64 ~x86"
+ S1="${WORKDIR}/${MY_P}"
+ S2="${WORKDIR}/policycoreutils-extra"
+ S="${S1}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+DEPEND=">=sys-libs/libselinux-${SELNX_VER}:=[python]
+ >=sys-libs/glibc-2.4
+ >=sys-libs/libcap-1.10-r10:=
+ >=sys-libs/libsemanage-${SEMNG_VER}:=[python]
+ sys-libs/libcap-ng:=
+ >=sys-libs/libsepol-${SEPOL_VER}:=
+ sys-devel/gettext
+ dev-python/ipy[${PYTHON_USEDEP}]
+ dbus? (
+ sys-apps/dbus
+ dev-libs/dbus-glib:=
+ )
+ audit? ( >=sys-process/audit-1.5.1 )
+ pam? ( sys-libs/pam:= )
+ ${PYTHON_DEPS}"
+
+### libcgroup -> seunshare
+### dbus -> restorecond
+
+# pax-utils for scanelf used by rlpkg
+RDEPEND="${DEPEND}
+ dev-python/sepolgen
+ app-misc/pax-utils
+ !<sys-apps/openrc-0.14"
+
+src_unpack() {
+ # Override default one because we need the SRC_URI ones even in case of 9999 ebuilds
+ if [[ ${PV} == 9999 ]] ; then
+ git-r3_src_unpack
+ fi
+ if [ -n ${A} ] ; then
+ S="${S2}"
+ unpack ${A};
+ fi
+}
+
+src_prepare() {
+ S="${S1}"
+ cd "${S}" || die "Failed to switch to ${S}"
+ if [[ ${PV} != 9999 ]] ; then
+ # If needed for live ebuilds please use /etc/portage/patches
+ epatch "${FILESDIR}/0010-remove-sesandbox-support.patch"
+ epatch "${FILESDIR}/0020-disable-autodetection-of-pam-and-audit.patch"
+ epatch "${FILESDIR}/0030-make-inotify-check-use-flag-triggered.patch"
+ epatch "${FILESDIR}/0040-reverse-access-check-in-run_init.patch"
+ epatch "${FILESDIR}/0070-remove-symlink-attempt-fails-with-gentoo-sandbox-approach.patch"
+ epatch "${FILESDIR}/0110-build-mcstrans-bug-472912.patch"
+ epatch "${FILESDIR}/0120-build-failure-for-mcscolor-for-CONTEXT__CONTAINS.patch"
+ fi
+
+ # rlpkg is more useful than fixfiles
+ sed -i -e '/^all/s/fixfiles//' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 1 failed"
+ sed -i -e '/fixfiles/d' "${S}/scripts/Makefile" \
+ || die "fixfiles sed 2 failed"
+
+ epatch_user
+
+ sed -i 's/-Werror//g' "${S1}"/*/Makefile || die "Failed to remove Werror"
+
+ python_copy_sources
+ # Our extra code is outside the regular directory, so set it to the extra
+ # directory. We really should optimize this as it is ugly, but the extra
+ # code is needed for Gentoo at the same time that policycoreutils is present
+ # (so we cannot use an additional package for now).
+ S="${S2}"
+ python_copy_sources
+}
+
+src_compile() {
+ building() {
+ emake -C "${BUILD_DIR}" \
+ AUDIT_LOG_PRIVS="y" \
+ AUDITH="$(usex audit)" \
+ PAMH="$(usex pam)" \
+ INOTIFYH="$(usex dbus)" \
+ SESANDBOX="n" \
+ CC="$(tc-getCC)" \
+ PYLIBVER="${EPYTHON}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)"
+ }
+ S="${S1}" # Regular policycoreutils
+ python_foreach_impl building
+ S="${S2}" # Extra set
+ python_foreach_impl building
+}
+
+src_install() {
+ # Python scripts are present in many places. There are no extension modules.
+ installation-policycoreutils() {
+ einfo "Installing policycoreutils"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" \
+ AUDITH="$(usex audit)" \
+ PAMH="$(usex pam)" \
+ INOTIFYH="$(usex dbus)" \
+ SESANDBOX="n" \
+ AUDIT_LOG_PRIV="y" \
+ PYLIBVER="${EPYTHON}" \
+ LIBDIR="\$(PREFIX)/$(get_libdir)" \
+ install
+ python_optimize
+ }
+
+ installation-extras() {
+ einfo "Installing policycoreutils-extra"
+ emake -C "${BUILD_DIR}" DESTDIR="${D}" INOTIFYH="$(usex dbus)" SHLIBDIR="${D}$(get_libdir)/rc" install
+ python_optimize
+ }
+
+ S="${S1}" # policycoreutils
+ python_foreach_impl installation-policycoreutils
+ S="${S2}" # extras
+ python_foreach_impl installation-extras
+ S="${S1}" # back for later
+
+ # remove redhat-style init script
+ rm -fR "${D}/etc/rc.d" || die
+
+ # compatibility symlinks
+ dosym /sbin/setfiles /usr/sbin/setfiles
+ bashcomp_alias setsebool getsebool
+
+ # location for policy definitions
+ dodir /var/lib/selinux
+ keepdir /var/lib/selinux
+
+ # Set version-specific scripts
+ for pyscript in audit2allow sepolgen-ifgen sepolicy chcat; do
+ python_replicate_script "${ED}/usr/bin/${pyscript}"
+ done
+ for pyscript in semanage rlpkg; do
+ python_replicate_script "${ED}/usr/sbin/${pyscript}"
+ done
+
+ dodir /usr/share/doc/${PF}/mcstrans/examples
+ cp -dR "${S1}"/mcstrans/share/examples/* "${D}/usr/share/doc/${PF}/mcstrans/examples" || die
+}
+
+pkg_postinst() {
+ # The selinux_gentoo init script is no longer needed with recent OpenRC
+ elog "The selinux_gentoo init script has been removed in this version as it is not required after OpenRC 0.13."
+
+ for POLICY_TYPE in ${POLICY_TYPES} ; do
+ # There have been some changes to the policy store, rebuilding now.
+ # https://marc.info/?l=selinux&m=143757277819717&w=2
+ einfo "Rebuilding store ${POLICY_TYPE} (without re-loading)."
+ semodule -s "${POLICY_TYPE}" -n -B || die "Failed to rebuild policy store ${POLICY_TYPE}"
+ done
+}
diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
new file mode 100644
index 000000000000..cc09e51995e2
--- /dev/null
+++ b/sys-apps/portage/Manifest
@@ -0,0 +1,4 @@
+DIST portage-2.2.14.tar.bz2 896674 SHA256 8dd65971e0f1c31dca922b0f7be06e622aabbed8d012d056ff25a169fc9946d8 SHA512 c8724b42d9932adf6065ff9f9c3bb3d22ec3258dcdb23e041ce704f2c7b634d459a36764f3ec5aa4613843733c70725025af10439816c538ec12837db50dc1ab WHIRLPOOL 82bb660fcc1f0bb4639b53829cf8207fc40ee01a0cb9935ad46fb5039f0558fbbbb3af3d12d208289e9701e0874d77a7990911fd50fe04806948c6c6955625fc
+DIST portage-2.2.18.tar.bz2 942561 SHA256 e0d54f2fbcdc8b5fce716475183fa6e889b6fa8178c92d65a850df73f1636560 SHA512 be4f95bc04a61cdb371fc66a03d2183961bfd458e9b2b89cf8cab8c9e70bde4119be266177d947e31429627609ed75a75c21abfe4b674ca529632d5728e8e8a6 WHIRLPOOL f334bf5198d2214de557a046ed3217e23d48d8f8d7d64fb0bd2611dd5c8725139eaf7d1e1065f822d8816f3979e86d6a6f8df4d2f4605df0b5c157d6bbf09a6d
+DIST portage-2.2.20.tar.bz2 950293 SHA256 483ce0b20960840f6499452ca4ef7df36fde08f835dcadf3cdd118c1ff7207a4 SHA512 fffb43a4c25a70cae071246fde7e379107535e607b9e8dd9fb513315a10750db92209bb436f532930a44cac06ba43aade06a7c2b0a1d675fd816968ba0fce7ae WHIRLPOOL aa1e560007cdafebd2bf56964d61e55a91fef4be5cd9bc50560891140287f6827ecda9d99e31ceb4e5a64691863fde325b51594cfdcfe88eb260fba47dad5fb9
+DIST portage-2.2.8.tar.bz2 874672 SHA256 c1074e01173df5384e003598dbc5f64f09e92f83fd26faab2f88f9f0bc64aa7e SHA512 acc47d94ff8c08e5a7bf2d4c4e600863430dd1e7d0bb8b4254d6477a498933cae663db84debf9487d2243c2cba689629ef8e8b6cf108e10d40e89e8e8d7e1257 WHIRLPOOL d54290ede8d3d85e5211cda7e86ed740178121ef2f47cf0858c27941d8679d29c11445befff962986d40a47ded50d0d4654de19e7d4aef3fdf2546655a0d6fe2
diff --git a/sys-apps/portage/files/README.RESCUE b/sys-apps/portage/files/README.RESCUE
new file mode 100644
index 000000000000..70c494ebb81b
--- /dev/null
+++ b/sys-apps/portage/files/README.RESCUE
@@ -0,0 +1,2 @@
+Please see http://www.gentoo.org/proj/en/portage/doc/manually-fixing-portage.xml
+for a recovery guide for a broken portage installation.
diff --git a/sys-apps/portage/metadata.xml b/sys-apps/portage/metadata.xml
new file mode 100644
index 000000000000..68283d8e67c0
--- /dev/null
+++ b/sys-apps/portage/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <bugs-to>mailto:dev-portage@gentoo.org</bugs-to>
+ <changelog>https://gitweb.gentoo.org/proj/portage.git/plain/RELEASE-NOTES</changelog>
+ <doc>https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/Portage</doc>
+ </upstream>
+ <maintainer>
+ <email>dev-portage@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="epydoc">Build html API documentation with epydoc.</flag>
+ <flag name="ipc">Use inter-process communication between portage and running ebuilds.</flag>
+ <flag name="pypy2_0">Use pypy-c2.0 as Python interpreter.</flag>
+ <flag name="python2">Use python2 as Python interpreter.</flag>
+ <flag name="python3">Use python3 as Python interpreter.</flag>
+ <flag name="xattr">Preserve extended attributes (filesystem-stored metadata) when installing files. Usually only required for hardened systems.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/portage/portage-2.2.14.ebuild b/sys-apps/portage/portage-2.2.14.ebuild
new file mode 100644
index 000000000000..75f0cbf2bdb0
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.14.ebuild
@@ -0,0 +1,352 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=(
+ pypy
+ python3_3 python3_4
+ python2_7
+)
+# Note: substituted below
+PYTHON_REQ_USE='bzip2(+)'
+
+inherit distutils-r1 multilib
+
+DESCRIPTION="Portage is the package management and distribution system for Gentoo"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ~ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+
+DEPEND="!build? ( ${PYTHON_DEPS//bzip2(+)/ssl(+),bzip2(+)} )
+ dev-lang/python-exec:2
+ >=sys-apps/sed-4.0.5 sys-devel/patch
+ doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
+ epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
+# Require sandbox-2.2 for bug #288863.
+# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
+# quite slow, so it's not considered in the dependencies as an alternative to
+# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
+# for now, don't pull in xattr deps for other kernels.
+# For whirlpool hash, require python[ssl] (bug #425046).
+# For compgen, require bash[readline] (bug #445576).
+RDEPEND="
+ dev-lang/python-exec:2
+ !build? (
+ >=sys-apps/sed-4.0.5
+ app-shells/bash:0[readline]
+ >=app-admin/eselect-1.2
+ )
+ elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
+ elibc_glibc? ( >=sys-apps/sandbox-2.2 )
+ elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
+ >=app-misc/pax-utils-0.1.17
+ selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
+ xattr? ( kernel_linux? (
+ >=sys-apps/install-xattr-0.3
+ $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
+ python2_7 pypy)
+ ) )
+ !<app-admin/logrotate-3.8.0"
+PDEPEND="
+ !build? (
+ >=net-misc/rsync-2.6.4
+ userland_GNU? ( >=sys-apps/coreutils-6.4 )
+ )"
+# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
+# NOTE: FEATURES=installsources requires debugedit and rsync
+
+REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
+
+SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+TARBALL_PV=${PV}
+SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
+ $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ if ! use ipc ; then
+ einfo "Disabling ipc..."
+ sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
+ -i pym/_emerge/AbstractEbuildProcess.py || \
+ die "failed to patch AbstractEbuildProcess.py"
+ fi
+
+ if use xattr && use kernel_linux ; then
+ einfo "Adding FEATURES=xattr to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ if [[ -n ${EPREFIX} ]] ; then
+ einfo "Setting portage.const.EPREFIX ..."
+ sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
+ -i pym/portage/const.py || \
+ die "Failed to patch portage.const.EPREFIX"
+
+ einfo "Prefixing shebangs ..."
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find . -type f -print0)
+
+ einfo "Adjusting make.globals ..."
+ sed -e "s|\(/usr/portage\)|${EPREFIX}\\1|" \
+ -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adjusting repos.conf ..."
+ sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
+ -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
+ -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
+ -i cnf/repos.conf || die "sed failed"
+
+ einfo "Adding FEATURES=force-prefix to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.example.${ARCH}".diff ]; then
+ patch make.conf.example "make.conf.example.${ARCH}".diff || \
+ die "Failed to patch make.conf.example"
+ else
+ eerror ""
+ eerror "Portage does not have an arch-specific configuration for this arch."
+ eerror "Please notify the arch maintainer about this issue. Using generic."
+ eerror ""
+ fi
+}
+
+python_compile_all() {
+ local targets=()
+ use doc && targets+=( docbook )
+ use epydoc && targets+=( epydoc )
+
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install() {
+ # Install sbin scripts to bindir for python-exec linking
+ # they will be relocated in pkg_preinst()
+ distutils-r1_python_install \
+ --system-prefix="${EPREFIX}/usr" \
+ --bindir="$(python_get_scriptdir)" \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
+ --sbindir="$(python_get_scriptdir)" \
+ --sysconfdir="${EPREFIX}/etc" \
+ "${@}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ local targets=()
+ use doc && targets+=( install_docbook )
+ use epydoc && targets+=( install_epydoc )
+
+ # install docs
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+
+ # Due to distutils/python-exec limitations
+ # these must be installed to /usr/bin.
+ local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
+ einfo "Moving admin scripts to the correct directory"
+ dodir /usr/sbin
+ for target in ${sbin_relocations}; do
+ einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
+ mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
+ done
+}
+
+pkg_preinst() {
+ # comment out sanity test until it is fixed to work
+ # with the new PORTAGE_PYM_PATH
+ #if [[ $ROOT == / ]] ; then
+ ## Run some minimal tests as a sanity check.
+ #local test_runner=$(find "${ED}" -name runTests)
+ #if [[ -n $test_runner && -x $test_runner ]] ; then
+ #einfo "Running preinst sanity tests..."
+ #"$test_runner" || die "preinst sanity tests failed"
+ #fi
+ #fi
+
+ # elog dir must exist to avoid logrotate error for bug #415911.
+ # This code runs in preinst in order to bypass the mapping of
+ # portage:portage to root:root which happens after src_install.
+ keepdir /var/log/portage/elog
+ # This is allowed to fail if the user/group are invalid for prefix users.
+ if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
+ chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.1.13" || \
+ {
+ has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
+ has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
+ } ; then
+ USERPRIV_UPGRADE=true
+ USERSYNC_UPGRADE=true
+ REPOS_CONF_UPGRADE=true
+ REPOS_CONF_SYNC=
+ type -P portageq >/dev/null 2>&1 && \
+ REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
+ else
+ USERPRIV_UPGRADE=false
+ USERSYNC_UPGRADE=false
+ REPOS_CONF_UPGRADE=false
+ fi
+}
+
+get_ownership() {
+ case ${USERLAND} in
+ BSD)
+ stat -f '%Su:%Sg' "${1}"
+ ;;
+ *)
+ stat -c '%U:%G' "${1}"
+ ;;
+ esac
+}
+
+new_config_protect() {
+ # Generate a ._cfg file even if the target file
+ # does not exist, ensuring that the user will
+ # notice the config change.
+ local basename=${1##*/}
+ local dirname=${1%/*}
+ local i=0
+ while true ; do
+ local filename=$(
+ echo -n "${dirname}/._cfg"
+ printf "%04d" ${i}
+ echo -n "_${basename}"
+ )
+ [[ -e ${filename} ]] || break
+ (( i++ ))
+ done
+ echo "${filename}"
+}
+
+pkg_postinst() {
+
+ if ${REPOS_CONF_UPGRADE} ; then
+ einfo "Generating repos.conf"
+ local repo_name=
+ [[ -f ${PORTDIR}/profiles/repo_name ]] && \
+ repo_name=$(< "${PORTDIR}/profiles/repo_name")
+ if [[ -z ${REPOS_CONF_SYNC} ]] ; then
+ REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
+ fi
+ local sync_type=
+ [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
+
+ if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
+ sync_type=cvs
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
+ fi
+
+ cat <<-EOF > "${T}/repos.conf"
+ [DEFAULT]
+ main-repo = ${repo_name:-gentoo}
+
+ [${repo_name:-gentoo}]
+ location = ${PORTDIR:-${EPREFIX}/usr/portage}
+ sync-type = ${sync_type:-rsync}
+ sync-uri = ${REPOS_CONF_SYNC}
+ EOF
+
+ [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
+
+ local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
+ if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
+ dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
+ fi
+ # Don't install the config update if the desired repos.conf directory
+ # and config file exist, since users may accept it blindly and break
+ # their config (bug #478726).
+ [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
+ mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
+
+ if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
+ einfo "Generating make.conf PORTDIR setting for backward compatibility"
+ for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
+ [[ -e ${dest} ]] && break
+ done
+ [[ -d ${dest} ]] && dest=${dest}/portdir.conf
+ rm -rf "${T}/make.conf"
+ [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
+ cat <<-EOF >> "${T}/make.conf"
+
+ # Set PORTDIR for backward compatibility with various tools:
+ # gentoo-bashcomp - bug #478444
+ # euse - bug #474574
+ # euses and ufed - bug #478318
+ PORTDIR="${EPREFIX}/usr/portage"
+ EOF
+ mkdir -p "${dest%/*}"
+ mv "${T}/make.conf" "$(new_config_protect "${dest}")"
+ fi
+ fi
+
+ local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
+
+ if ${USERSYNC_UPGRADE} && \
+ [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
+ local ownership=$(get_ownership "${PORTDIR}")
+ if [[ -n ${ownership} ]] ; then
+ einfo "Adjusting PORTDIR permissions for usersync"
+ find "${PORTDIR}" -path "${distdir%/}" -prune -o \
+ ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
+ -exec chown "${ownership}" {} +
+ fi
+ fi
+
+ # Do this last, since it could take a long time if there
+ # are lots of live sources, and the user may be tempted
+ # to kill emerge while it is running.
+ if ${USERPRIV_UPGRADE} && \
+ [[ -d ${distdir} && -w ${distdir} ]] ; then
+ local ownership=$(get_ownership "${distdir}")
+ if [[ ${ownership#*:} == portage ]] ; then
+ einfo "Adjusting DISTDIR permissions for userpriv"
+ find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
+ -exec chown -R portage:portage {} +
+ fi
+ fi
+}
diff --git a/sys-apps/portage/portage-2.2.18.ebuild b/sys-apps/portage/portage-2.2.18.ebuild
new file mode 100644
index 000000000000..51cdf92ae181
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.18.ebuild
@@ -0,0 +1,352 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=(
+ pypy
+ python3_3 python3_4
+ python2_7
+)
+# Note: substituted below
+PYTHON_REQ_USE='bzip2(+)'
+
+inherit distutils-r1 multilib
+
+DESCRIPTION="Portage is the package management and distribution system for Gentoo"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+
+DEPEND="!build? ( ${PYTHON_DEPS//bzip2(+)/ssl(+),bzip2(+)} )
+ dev-lang/python-exec:2
+ >=sys-apps/sed-4.0.5 sys-devel/patch
+ doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
+ epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
+# Require sandbox-2.2 for bug #288863.
+# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
+# quite slow, so it's not considered in the dependencies as an alternative to
+# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
+# for now, don't pull in xattr deps for other kernels.
+# For whirlpool hash, require python[ssl] (bug #425046).
+# For compgen, require bash[readline] (bug #445576).
+RDEPEND="
+ dev-lang/python-exec:2
+ !build? (
+ >=sys-apps/sed-4.0.5
+ app-shells/bash:0[readline]
+ >=app-admin/eselect-1.2
+ )
+ elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
+ elibc_glibc? ( >=sys-apps/sandbox-2.2 )
+ elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
+ >=app-misc/pax-utils-0.1.17
+ selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
+ xattr? ( kernel_linux? (
+ >=sys-apps/install-xattr-0.3
+ $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
+ python2_7 pypy)
+ ) )
+ !<app-admin/logrotate-3.8.0"
+PDEPEND="
+ !build? (
+ >=net-misc/rsync-2.6.4
+ userland_GNU? ( >=sys-apps/coreutils-6.4 )
+ )"
+# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
+# NOTE: FEATURES=installsources requires debugedit and rsync
+
+REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
+
+SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+TARBALL_PV=${PV}
+SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
+ $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ if ! use ipc ; then
+ einfo "Disabling ipc..."
+ sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
+ -i pym/_emerge/AbstractEbuildProcess.py || \
+ die "failed to patch AbstractEbuildProcess.py"
+ fi
+
+ if use xattr && use kernel_linux ; then
+ einfo "Adding FEATURES=xattr to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ if [[ -n ${EPREFIX} ]] ; then
+ einfo "Setting portage.const.EPREFIX ..."
+ sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
+ -i pym/portage/const.py || \
+ die "Failed to patch portage.const.EPREFIX"
+
+ einfo "Prefixing shebangs ..."
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find . -type f -print0)
+
+ einfo "Adjusting make.globals ..."
+ sed -e "s|\(/usr/portage\)|${EPREFIX}\\1|" \
+ -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adjusting repos.conf ..."
+ sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
+ -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
+ -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
+ -i cnf/repos.conf || die "sed failed"
+
+ einfo "Adding FEATURES=force-prefix to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.example.${ARCH}".diff ]; then
+ patch make.conf.example "make.conf.example.${ARCH}".diff || \
+ die "Failed to patch make.conf.example"
+ else
+ eerror ""
+ eerror "Portage does not have an arch-specific configuration for this arch."
+ eerror "Please notify the arch maintainer about this issue. Using generic."
+ eerror ""
+ fi
+}
+
+python_compile_all() {
+ local targets=()
+ use doc && targets+=( docbook )
+ use epydoc && targets+=( epydoc )
+
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install() {
+ # Install sbin scripts to bindir for python-exec linking
+ # they will be relocated in pkg_preinst()
+ distutils-r1_python_install \
+ --system-prefix="${EPREFIX}/usr" \
+ --bindir="$(python_get_scriptdir)" \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
+ --sbindir="$(python_get_scriptdir)" \
+ --sysconfdir="${EPREFIX}/etc" \
+ "${@}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ local targets=()
+ use doc && targets+=( install_docbook )
+ use epydoc && targets+=( install_epydoc )
+
+ # install docs
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+
+ # Due to distutils/python-exec limitations
+ # these must be installed to /usr/bin.
+ local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
+ einfo "Moving admin scripts to the correct directory"
+ dodir /usr/sbin
+ for target in ${sbin_relocations}; do
+ einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
+ mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
+ done
+}
+
+pkg_preinst() {
+ # comment out sanity test until it is fixed to work
+ # with the new PORTAGE_PYM_PATH
+ #if [[ $ROOT == / ]] ; then
+ ## Run some minimal tests as a sanity check.
+ #local test_runner=$(find "${ED}" -name runTests)
+ #if [[ -n $test_runner && -x $test_runner ]] ; then
+ #einfo "Running preinst sanity tests..."
+ #"$test_runner" || die "preinst sanity tests failed"
+ #fi
+ #fi
+
+ # elog dir must exist to avoid logrotate error for bug #415911.
+ # This code runs in preinst in order to bypass the mapping of
+ # portage:portage to root:root which happens after src_install.
+ keepdir /var/log/portage/elog
+ # This is allowed to fail if the user/group are invalid for prefix users.
+ if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
+ chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.1.13" || \
+ {
+ has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
+ has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
+ } ; then
+ USERPRIV_UPGRADE=true
+ USERSYNC_UPGRADE=true
+ REPOS_CONF_UPGRADE=true
+ REPOS_CONF_SYNC=
+ type -P portageq >/dev/null 2>&1 && \
+ REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
+ else
+ USERPRIV_UPGRADE=false
+ USERSYNC_UPGRADE=false
+ REPOS_CONF_UPGRADE=false
+ fi
+}
+
+get_ownership() {
+ case ${USERLAND} in
+ BSD)
+ stat -f '%Su:%Sg' "${1}"
+ ;;
+ *)
+ stat -c '%U:%G' "${1}"
+ ;;
+ esac
+}
+
+new_config_protect() {
+ # Generate a ._cfg file even if the target file
+ # does not exist, ensuring that the user will
+ # notice the config change.
+ local basename=${1##*/}
+ local dirname=${1%/*}
+ local i=0
+ while true ; do
+ local filename=$(
+ echo -n "${dirname}/._cfg"
+ printf "%04d" ${i}
+ echo -n "_${basename}"
+ )
+ [[ -e ${filename} ]] || break
+ (( i++ ))
+ done
+ echo "${filename}"
+}
+
+pkg_postinst() {
+
+ if ${REPOS_CONF_UPGRADE} ; then
+ einfo "Generating repos.conf"
+ local repo_name=
+ [[ -f ${PORTDIR}/profiles/repo_name ]] && \
+ repo_name=$(< "${PORTDIR}/profiles/repo_name")
+ if [[ -z ${REPOS_CONF_SYNC} ]] ; then
+ REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
+ fi
+ local sync_type=
+ [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
+
+ if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
+ sync_type=cvs
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
+ fi
+
+ cat <<-EOF > "${T}/repos.conf"
+ [DEFAULT]
+ main-repo = ${repo_name:-gentoo}
+
+ [${repo_name:-gentoo}]
+ location = ${PORTDIR:-${EPREFIX}/usr/portage}
+ sync-type = ${sync_type:-rsync}
+ sync-uri = ${REPOS_CONF_SYNC}
+ EOF
+
+ [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
+
+ local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
+ if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
+ dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
+ fi
+ # Don't install the config update if the desired repos.conf directory
+ # and config file exist, since users may accept it blindly and break
+ # their config (bug #478726).
+ [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
+ mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
+
+ if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
+ einfo "Generating make.conf PORTDIR setting for backward compatibility"
+ for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
+ [[ -e ${dest} ]] && break
+ done
+ [[ -d ${dest} ]] && dest=${dest}/portdir.conf
+ rm -rf "${T}/make.conf"
+ [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
+ cat <<-EOF >> "${T}/make.conf"
+
+ # Set PORTDIR for backward compatibility with various tools:
+ # gentoo-bashcomp - bug #478444
+ # euse - bug #474574
+ # euses and ufed - bug #478318
+ PORTDIR="${EPREFIX}/usr/portage"
+ EOF
+ mkdir -p "${dest%/*}"
+ mv "${T}/make.conf" "$(new_config_protect "${dest}")"
+ fi
+ fi
+
+ local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
+
+ if ${USERSYNC_UPGRADE} && \
+ [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
+ local ownership=$(get_ownership "${PORTDIR}")
+ if [[ -n ${ownership} ]] ; then
+ einfo "Adjusting PORTDIR permissions for usersync"
+ find "${PORTDIR}" -path "${distdir%/}" -prune -o \
+ ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
+ -exec chown "${ownership}" {} +
+ fi
+ fi
+
+ # Do this last, since it could take a long time if there
+ # are lots of live sources, and the user may be tempted
+ # to kill emerge while it is running.
+ if ${USERPRIV_UPGRADE} && \
+ [[ -d ${distdir} && -w ${distdir} ]] ; then
+ local ownership=$(get_ownership "${distdir}")
+ if [[ ${ownership#*:} == portage ]] ; then
+ einfo "Adjusting DISTDIR permissions for userpriv"
+ find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
+ -exec chown -R portage:portage {} +
+ fi
+ fi
+}
diff --git a/sys-apps/portage/portage-2.2.20.ebuild b/sys-apps/portage/portage-2.2.20.ebuild
new file mode 100644
index 000000000000..2f4822e2530a
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.20.ebuild
@@ -0,0 +1,365 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=(
+ pypy
+ python3_3 python3_4
+ python2_7
+)
+# Note: substituted below
+PYTHON_REQ_USE='bzip2(+)'
+
+inherit distutils-r1 multilib
+
+DESCRIPTION="Portage is the package management and distribution system for Gentoo"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+
+DEPEND="!build? ( ${PYTHON_DEPS//bzip2(+)/ssl(+),bzip2(+)} )
+ >=app-arch/tar-1.27
+ dev-lang/python-exec:2
+ >=sys-apps/sed-4.0.5 sys-devel/patch
+ doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
+ epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
+# Require sandbox-2.2 for bug #288863.
+# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
+# quite slow, so it's not considered in the dependencies as an alternative to
+# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
+# for now, don't pull in xattr deps for other kernels.
+# For whirlpool hash, require python[ssl] (bug #425046).
+# For compgen, require bash[readline] (bug #445576).
+RDEPEND="
+ >=app-arch/tar-1.27
+ dev-lang/python-exec:2
+ !build? (
+ >=sys-apps/sed-4.0.5
+ app-shells/bash:0[readline]
+ >=app-admin/eselect-1.2
+ )
+ elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
+ elibc_glibc? ( >=sys-apps/sandbox-2.2 )
+ elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
+ >=app-misc/pax-utils-0.1.17
+ selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
+ xattr? ( kernel_linux? (
+ >=sys-apps/install-xattr-0.3
+ $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
+ python2_7 pypy)
+ ) )
+ !<app-admin/logrotate-3.8.0"
+PDEPEND="
+ !build? (
+ >=net-misc/rsync-2.6.4
+ userland_GNU? ( >=sys-apps/coreutils-6.4 )
+ )"
+# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
+# NOTE: FEATURES=installsources requires debugedit and rsync
+
+REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
+
+SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+TARBALL_PV=${PV}
+SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
+ $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ if ! use ipc ; then
+ einfo "Disabling ipc..."
+ sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
+ -i pym/_emerge/AbstractEbuildProcess.py || \
+ die "failed to patch AbstractEbuildProcess.py"
+ fi
+
+ if use xattr && use kernel_linux ; then
+ einfo "Adding FEATURES=xattr to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ if [[ -n ${EPREFIX} ]] ; then
+ einfo "Setting portage.const.EPREFIX ..."
+ sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
+ -i pym/portage/const.py || \
+ die "Failed to patch portage.const.EPREFIX"
+
+ einfo "Prefixing shebangs ..."
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find . -type f -print0)
+
+ einfo "Adjusting make.globals ..."
+ sed -e "s|\(/usr/portage\)|${EPREFIX}\\1|" \
+ -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adjusting repos.conf ..."
+ sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
+ -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
+ -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
+ -i cnf/repos.conf || die "sed failed"
+
+ einfo "Adding FEATURES=force-prefix to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.example.${ARCH}".diff ]; then
+ patch make.conf.example "make.conf.example.${ARCH}".diff || \
+ die "Failed to patch make.conf.example"
+ else
+ eerror ""
+ eerror "Portage does not have an arch-specific configuration for this arch."
+ eerror "Please notify the arch maintainer about this issue. Using generic."
+ eerror ""
+ fi
+}
+
+python_compile_all() {
+ local targets=()
+ use doc && targets+=( docbook )
+ use epydoc && targets+=( epydoc )
+
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install() {
+ # Install sbin scripts to bindir for python-exec linking
+ # they will be relocated in pkg_preinst()
+ distutils-r1_python_install \
+ --system-prefix="${EPREFIX}/usr" \
+ --bindir="$(python_get_scriptdir)" \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
+ --sbindir="$(python_get_scriptdir)" \
+ --sysconfdir="${EPREFIX}/etc" \
+ "${@}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ local targets=()
+ use doc && targets+=( install_docbook )
+ use epydoc && targets+=( install_epydoc )
+
+ # install docs
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+
+ # Due to distutils/python-exec limitations
+ # these must be installed to /usr/bin.
+ local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
+ einfo "Moving admin scripts to the correct directory"
+ dodir /usr/sbin
+ for target in ${sbin_relocations}; do
+ einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
+ mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
+ done
+}
+
+pkg_preinst() {
+ # comment out sanity test until it is fixed to work
+ # with the new PORTAGE_PYM_PATH
+ #if [[ $ROOT == / ]] ; then
+ ## Run some minimal tests as a sanity check.
+ #local test_runner=$(find "${ED}" -name runTests)
+ #if [[ -n $test_runner && -x $test_runner ]] ; then
+ #einfo "Running preinst sanity tests..."
+ #"$test_runner" || die "preinst sanity tests failed"
+ #fi
+ #fi
+
+ # elog dir must exist to avoid logrotate error for bug #415911.
+ # This code runs in preinst in order to bypass the mapping of
+ # portage:portage to root:root which happens after src_install.
+ keepdir /var/log/portage/elog
+ # This is allowed to fail if the user/group are invalid for prefix users.
+ if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
+ chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
+ fi
+
+ if has_version "<${CATEGORY}/${PN}-2.1.13" || \
+ {
+ has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
+ has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
+ } ; then
+ USERPRIV_UPGRADE=true
+ USERSYNC_UPGRADE=true
+ REPOS_CONF_UPGRADE=true
+ REPOS_CONF_SYNC=
+ type -P portageq >/dev/null 2>&1 && \
+ REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
+ else
+ USERPRIV_UPGRADE=false
+ USERSYNC_UPGRADE=false
+ REPOS_CONF_UPGRADE=false
+ fi
+}
+
+get_ownership() {
+ case ${USERLAND} in
+ BSD)
+ stat -f '%Su:%Sg' "${1}"
+ ;;
+ *)
+ stat -c '%U:%G' "${1}"
+ ;;
+ esac
+}
+
+new_config_protect() {
+ # Generate a ._cfg file even if the target file
+ # does not exist, ensuring that the user will
+ # notice the config change.
+ local basename=${1##*/}
+ local dirname=${1%/*}
+ local i=0
+ while true ; do
+ local filename=$(
+ echo -n "${dirname}/._cfg"
+ printf "%04d" ${i}
+ echo -n "_${basename}"
+ )
+ [[ -e ${filename} ]] || break
+ (( i++ ))
+ done
+ echo "${filename}"
+}
+
+pkg_postinst() {
+
+ if ${REPOS_CONF_UPGRADE} ; then
+ einfo "Generating repos.conf"
+ local repo_name=
+ [[ -f ${PORTDIR}/profiles/repo_name ]] && \
+ repo_name=$(< "${PORTDIR}/profiles/repo_name")
+ if [[ -z ${REPOS_CONF_SYNC} ]] ; then
+ REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
+ fi
+ local sync_type=
+ [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
+
+ if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
+ sync_type=cvs
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
+ fi
+
+ cat <<-EOF > "${T}/repos.conf"
+ [DEFAULT]
+ main-repo = ${repo_name:-gentoo}
+
+ [${repo_name:-gentoo}]
+ location = ${PORTDIR:-${EPREFIX}/usr/portage}
+ sync-type = ${sync_type:-rsync}
+ sync-uri = ${REPOS_CONF_SYNC}
+ EOF
+
+ [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
+
+ local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
+ if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
+ dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
+ fi
+ # Don't install the config update if the desired repos.conf directory
+ # and config file exist, since users may accept it blindly and break
+ # their config (bug #478726).
+ [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
+ mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
+
+ if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
+ einfo "Generating make.conf PORTDIR setting for backward compatibility"
+ for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
+ [[ -e ${dest} ]] && break
+ done
+ [[ -d ${dest} ]] && dest=${dest}/portdir.conf
+ rm -rf "${T}/make.conf"
+ [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
+ cat <<-EOF >> "${T}/make.conf"
+
+ # Set PORTDIR for backward compatibility with various tools:
+ # gentoo-bashcomp - bug #478444
+ # euse - bug #474574
+ # euses and ufed - bug #478318
+ PORTDIR="${EPREFIX}/usr/portage"
+ EOF
+ mkdir -p "${dest%/*}"
+ mv "${T}/make.conf" "$(new_config_protect "${dest}")"
+ fi
+ fi
+
+ local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
+
+ if ${USERSYNC_UPGRADE} && \
+ [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
+ local ownership=$(get_ownership "${PORTDIR}")
+ if [[ -n ${ownership} ]] ; then
+ einfo "Adjusting PORTDIR permissions for usersync"
+ find "${PORTDIR}" -path "${distdir%/}" -prune -o \
+ ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
+ -exec chown "${ownership}" {} +
+ fi
+ fi
+
+ # Do this last, since it could take a long time if there
+ # are lots of live sources, and the user may be tempted
+ # to kill emerge while it is running.
+ if ${USERPRIV_UPGRADE} && \
+ [[ -d ${distdir} && -w ${distdir} ]] ; then
+ local ownership=$(get_ownership "${distdir}")
+ if [[ ${ownership#*:} == portage ]] ; then
+ einfo "Adjusting DISTDIR permissions for userpriv"
+ find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
+ -exec chown -R portage:portage {} +
+ fi
+ fi
+
+ einfo ""
+ einfo "The 'websync' module has now been properly renamed to 'webrsync'"
+ einfo "Please update your repos.conf/gentoo.conf file if needed."
+ einfo ""
+ einfo "This release of portage removed the new squashfs sync module "
+ einfo "introduced in portage-2.2.19."
+ einfo "Look for it to be released as an installable portage module soon."
+ einfo "This will allow it to develop at it's own pace partially independant"
+ einfo "of portage"
+ einfo ""
+}
diff --git a/sys-apps/portage/portage-2.2.8-r2.ebuild b/sys-apps/portage/portage-2.2.8-r2.ebuild
new file mode 100644
index 000000000000..07cf97ac9e63
--- /dev/null
+++ b/sys-apps/portage/portage-2.2.8-r2.ebuild
@@ -0,0 +1,574 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Require EAPI 2 since we now require at least python-2.6 (for python 3
+# syntax support) which also requires EAPI 2.
+EAPI=2
+PYTHON_COMPAT=(
+ pypy2_0
+ python3_2 python3_3 python3_4
+ python2_6 python2_7
+)
+inherit eutils multilib
+
+DESCRIPTION="Portage is the package management and distribution system for Gentoo"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_ru pypy2_0 python2 python3 selinux xattr"
+
+for _pyimpl in ${PYTHON_COMPAT[@]} ; do
+ IUSE+=" python_targets_${_pyimpl}"
+done
+unset _pyimpl
+
+# Import of the io module in python-2.6 raises ImportError for the
+# thread module if threading is disabled.
+python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
+ !pypy2_0? ( !python2? ( !python3? (
+ || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
+ ) ) )
+ pypy2_0? ( !python2? ( !python3? ( virtual/pypy:2.0[bzip2] ) ) )
+ python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
+python_dep="${python_dep_ssl//\[ssl\]}"
+python_dep="${python_dep//,ssl}"
+python_dep="${python_dep//ssl,}"
+
+python_dep="${python_dep}
+ python_targets_pypy2_0? ( virtual/pypy:2.0 )
+ python_targets_python2_6? ( dev-lang/python:2.6 )
+ python_targets_python2_7? ( dev-lang/python:2.7 )
+ python_targets_python3_2? ( dev-lang/python:3.2 )
+ python_targets_python3_3? ( dev-lang/python:3.3 )
+ python_targets_python3_4? ( dev-lang/python:3.4 )
+"
+
+# The pysqlite blocker is for bug #282760.
+# make-3.82 is for bug #455858
+DEPEND="${python_dep}
+ >=sys-devel/make-3.82
+ >=sys-apps/sed-4.0.5 sys-devel/patch
+ doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
+ epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
+# Require sandbox-2.2 for bug #288863.
+# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
+# quite slow, so it's not considered in the dependencies as an alternative to
+# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
+# for now, don't pull in xattr deps for other kernels.
+# For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
+# For compgen, require bash[readline] (bug #445576).
+RDEPEND="${python_dep}
+ !build? ( >=sys-apps/sed-4.0.5
+ app-shells/bash:0[readline]
+ >=app-admin/eselect-1.2
+ || ( ${python_dep_ssl} dev-python/python-mhash )
+ )
+ elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
+ elibc_glibc? ( >=sys-apps/sandbox-2.2 )
+ elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
+ >=app-misc/pax-utils-0.1.17
+ selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
+ xattr? ( kernel_linux? (
+ $(for python_impl in python{2_6,2_7,3_2} pypy2_0; do
+ echo "python_targets_${python_impl}? ( dev-python/pyxattr[python_targets_${python_impl}] )"
+ done) ) )
+ !<app-admin/logrotate-3.8.0"
+PDEPEND="
+ !build? (
+ >=net-misc/rsync-2.6.4
+ userland_GNU? ( >=sys-apps/coreutils-6.4 )
+ )"
+# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
+# NOTE: FEATURES=installsources requires debugedit and rsync
+
+SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+PV_PL="2.1.2"
+PATCHVER_PL=""
+TARBALL_PV=${PV}
+SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
+ $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
+
+PATCHVER=
+[[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
+if [ -n "${PATCHVER}" ]; then
+ SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
+ $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
+fi
+
+S="${WORKDIR}"/${PN}-${TARBALL_PV}
+S_PL="${WORKDIR}"/${PN}-${PV_PL}
+
+compatible_python_is_selected() {
+ [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
+}
+
+current_python_has_xattr() {
+ [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
+ local PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
+ [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
+ "${PYTHON}" -c 'import xattr' 2>/dev/null
+}
+
+call_with_python_impl() {
+ [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
+ env EPYTHON=${EPYTHON} "$@"
+}
+
+get_python_interpreter() {
+ [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
+ local impl=$1 python
+ case "${impl}" in
+ python*)
+ python=${impl/_/.}
+ ;;
+ pypy*)
+ python=${impl/_/.}
+ python=${python/pypy/pypy-c}
+ ;;
+ *)
+ die "Unrecognized python target: ${impl}"
+ esac
+ echo ${python}
+}
+
+get_python_sitedir() {
+ [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
+ local impl=$1
+ local site_dir=usr/$(get_libdir)/${impl/_/.}/site-packages
+ [[ -d ${EROOT:-${ROOT}}${site_dir} ]] || \
+ ewarn "site-packages dir missing for ${impl}: ${EROOT:-${ROOT}}${site_dir}"
+ echo "/${site_dir}"
+}
+
+python_compileall() {
+ [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
+ local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
+ local d_image=${D}${d#/}
+ [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}"
+ case "${EPYTHON}" in
+ python*)
+ "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
+ # Note: Using -OO breaks emaint, since it requires __doc__,
+ # and __doc__ is None when -OO is used.
+ "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die
+ ;;
+ pypy*)
+ "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
+ ;;
+ *)
+ die "Unrecognized EPYTHON value: ${EPYTHON}"
+ esac
+}
+
+pkg_setup() {
+ if use python2 && use python3 ; then
+ ewarn "Both python2 and python3 USE flags are enabled, but only one"
+ ewarn "can be in the shebangs. Using python3."
+ fi
+ if use pypy2_0 && use python3 ; then
+ ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
+ ewarn "can be in the shebangs. Using python3."
+ fi
+ if use pypy2_0 && use python2 ; then
+ ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
+ ewarn "can be in the shebangs. Using python2"
+ fi
+ if ! use pypy2_0 && ! use python2 && ! use python3 && \
+ ! compatible_python_is_selected ; then
+ ewarn "Attempting to select a compatible default python interpreter"
+ local x success=0
+ for x in "${EPREFIX}"/usr/bin/python2.* ; do
+ x=${x#${EPREFIX}/usr/bin/python2.}
+ if [[ $x -ge 6 ]] 2>/dev/null ; then
+ eselect python set python2.$x
+ if compatible_python_is_selected ; then
+ elog "Default python interpreter is now set to python-2.$x"
+ success=1
+ break
+ fi
+ fi
+ done
+ if [ $success != 1 ] ; then
+ eerror "Unable to select a compatible default python interpreter!"
+ die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
+ fi
+ fi
+
+ # We use EPYTHON to designate the active python interpreter,
+ # but we only export when needed, via call_with_python_impl.
+ EPYTHON=python
+ export -n EPYTHON
+ if use python3; then
+ EPYTHON=python3
+ elif use python2; then
+ EPYTHON=python2
+ elif use pypy2_0; then
+ EPYTHON=pypy-c2.0
+ fi
+}
+
+src_prepare() {
+ if [ -n "${PATCHVER}" ] ; then
+ if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
+ rm "$S/bin/ebuild-helpers/portageq" \
+ || die "failed to remove portageq helper symlink"
+ fi
+ epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
+ fi
+ einfo "Setting portage.VERSION to ${PVR} ..."
+ sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
+ die "Failed to patch portage.VERSION"
+ sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
+ die "Failed to patch VERSION in doc/fragment/version"
+ sed -e "1s/VERSION/${PVR}/" -i $(find man -type f) || \
+ die "Failed to patch VERSION in man page headers"
+
+ if ! use ipc ; then
+ einfo "Disabling ipc..."
+ sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
+ -i pym/_emerge/AbstractEbuildProcess.py || \
+ die "failed to patch AbstractEbuildProcess.py"
+ fi
+
+ if use xattr && use kernel_linux ; then
+ einfo "Adding FEATURES=xattr to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ local set_shebang=
+ if use python3; then
+ set_shebang=python3
+ elif use python2; then
+ set_shebang=python2
+ elif use pypy2_0; then
+ set_shebang=pypy-c2.0
+ fi
+ if [[ -n ${set_shebang} ]] ; then
+ einfo "Converting shebangs for ${set_shebang}..."
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!/usr/bin/python"* ]] ; then
+ sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find . -type f -print0)
+ fi
+
+ if [[ -n ${EPREFIX} ]] ; then
+ einfo "Setting portage.const.EPREFIX ..."
+ sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
+ -i pym/portage/const.py || \
+ die "Failed to patch portage.const.EPREFIX"
+
+ einfo "Prefixing shebangs ..."
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find . -type f -print0)
+
+ einfo "Adjusting make.globals ..."
+ sed -e "s|\(/usr/portage\)|${EPREFIX}\\1|" \
+ -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adjusting repos.conf ..."
+ sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
+ -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
+ -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
+ -i cnf/repos.conf || die "sed failed"
+
+ einfo "Adding FEATURES=force-prefix to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.example.${ARCH}".diff ]; then
+ patch make.conf.example "make.conf.example.${ARCH}".diff || \
+ die "Failed to patch make.conf.example"
+ else
+ eerror ""
+ eerror "Portage does not have an arch-specific configuration for this arch."
+ eerror "Please notify the arch maintainer about this issue. Using generic."
+ eerror ""
+ fi
+}
+
+src_compile() {
+ if use doc; then
+ call_with_python_impl \
+ emake docbook || die
+ fi
+
+ if use epydoc; then
+ einfo "Generating api docs"
+ call_with_python_impl \
+ emake epydoc || die
+ fi
+}
+
+src_test() {
+ # make files executable, in case they were created by patch
+ find bin -type f | xargs chmod +x
+ call_with_python_impl \
+ emake test || die
+}
+
+src_install() {
+ call_with_python_impl \
+ emake DESTDIR="${D}" \
+ sysconfdir="${EPREFIX}/etc" \
+ prefix="${EPREFIX}/usr" \
+ install || die
+
+ # Use dodoc for compression, since the Makefile doesn't do that.
+ dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
+
+ # Allow external portage API consumers to import portage python modules
+ # (this used to be done with PYTHONPATH setting in /etc/env.d).
+ # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
+ # site-packages, and compile with the corresponding interpreter.
+ local impl files mod_dir dest_mod_dir python relative_path x
+ for impl in "${PYTHON_COMPAT[@]}" ; do
+ use "python_targets_${impl}" || continue
+ if use build && [[ ${ROOT} == / &&
+ ! -x ${EPREFIX}/usr/bin/$(get_python_interpreter ${impl}) ]] ; then
+ # Tolerate --nodeps at beginning of stage1 for catalyst
+ ewarn "skipping python_targets_${impl}, interpreter not found"
+ continue
+ fi
+ while read -r mod_dir ; do
+ cd "${ED:-${D}}usr/lib/portage/pym/${mod_dir}" || die
+ files=$(echo *.py)
+ if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
+ # __pycache__ directories contain no py files
+ continue
+ fi
+ dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir}
+ dodir "${dest_mod_dir}" || die
+ relative_path=../../../lib/portage/pym/${mod_dir}
+ x=/${mod_dir}
+ while [ -n "${x}" ] ; do
+ relative_path=../${relative_path}
+ x=${x%/*}
+ done
+ for x in ${files} ; do
+ dosym "${relative_path}/${x}" \
+ "${dest_mod_dir}/${x}" || die
+ done
+ done < <(cd "${ED:-${D}}"usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*")
+ cd "${S}" || die
+ EPYTHON=$(get_python_interpreter ${impl}) \
+ python_compileall "$(get_python_sitedir ${impl})"
+ done
+
+ # Compile /usr/lib/portage/pym with the active interpreter, since portage
+ # internal commands force this directory to the beginning of sys.path.
+ python_compileall /usr/lib/portage/pym
+}
+
+pkg_preinst() {
+ if [[ $ROOT == / ]] ; then
+ # Run some minimal tests as a sanity check.
+ local test_runner=$(find "${ED:-${D}}" -name runTests)
+ if [[ -n $test_runner && -x $test_runner ]] ; then
+ einfo "Running preinst sanity tests..."
+ "$test_runner" || die "preinst sanity tests failed"
+ fi
+ fi
+
+ if use xattr && ! current_python_has_xattr ; then
+ ewarn "For optimal performance in xattr handling, install"
+ ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
+ ewarn "enable USE=python3 for $CATEGORY/$PN."
+ fi
+
+ # elog dir must exist to avoid logrotate error for bug #415911.
+ # This code runs in preinst in order to bypass the mapping of
+ # portage:portage to root:root which happens after src_install.
+ keepdir /var/log/portage/elog
+ # This is allowed to fail if the user/group are invalid for prefix users.
+ if chown portage:portage "${ED:-${D}}"var/log/portage{,/elog} 2>/dev/null ; then
+ chmod g+s,ug+rwx "${ED:-${D}}"var/log/portage{,/elog}
+ fi
+
+ # If portage-2.1.6 is installed and the preserved_libs_registry exists,
+ # assume that the NEEDED.ELF.2 files have already been generated.
+ has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
+ ! { [ -e "${EROOT:-${ROOT}}"var/lib/portage/preserved_libs_registry ] && \
+ has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ; } \
+ && NEEDED_REBUILD_UPGRADE=true || NEEDED_REBUILD_UPGRADE=false
+
+ if has_version "<${CATEGORY}/${PN}-2.1.13" || \
+ {
+ has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
+ has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
+ } ; then
+ USERPRIV_UPGRADE=true
+ USERSYNC_UPGRADE=true
+ REPOS_CONF_UPGRADE=true
+ REPOS_CONF_SYNC=
+ type -P portageq >/dev/null 2>&1 && \
+ REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
+ else
+ USERPRIV_UPGRADE=false
+ USERSYNC_UPGRADE=false
+ REPOS_CONF_UPGRADE=false
+ fi
+}
+
+get_ownership() {
+ case ${USERLAND} in
+ BSD)
+ stat -f '%Su:%Sg' "${1}"
+ ;;
+ *)
+ stat -c '%U:%G' "${1}"
+ ;;
+ esac
+}
+
+new_config_protect() {
+ # Generate a ._cfg file even if the target file
+ # does not exist, ensuring that the user will
+ # notice the config change.
+ local basename=${1##*/}
+ local dirname=${1%/*}
+ local i=0
+ while true ; do
+ local filename=$(
+ echo -n "${dirname}/._cfg"
+ printf "%04d" ${i}
+ echo -n "_${basename}"
+ )
+ [[ -e ${filename} ]] || break
+ (( i++ ))
+ done
+ echo "${filename}"
+}
+
+pkg_postinst() {
+
+ if ${REPOS_CONF_UPGRADE} ; then
+ einfo "Generating repos.conf"
+ local repo_name=
+ [[ -f ${PORTDIR}/profiles/repo_name ]] && \
+ repo_name=$(< "${PORTDIR}/profiles/repo_name")
+ if [[ -z ${REPOS_CONF_SYNC} ]] ; then
+ REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
+ fi
+ local sync_type=
+ [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
+
+ if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
+ sync_type=cvs
+ REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
+ fi
+
+ cat <<-EOF > "${T}/repos.conf"
+ [DEFAULT]
+ main-repo = ${repo_name:-gentoo}
+
+ [${repo_name:-gentoo}]
+ location = ${PORTDIR:-${EPREFIX}/usr/portage}
+ sync-type = ${sync_type:-rsync}
+ sync-uri = ${REPOS_CONF_SYNC}
+ EOF
+
+ [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
+
+ local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
+ if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
+ dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
+ fi
+ # Don't install the config update if the desired repos.conf directory
+ # and config file exist, since users may accept it blindly and break
+ # their config (bug #478726).
+ [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
+ mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
+
+ if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
+ einfo "Generating make.conf PORTDIR setting for backward compatibility"
+ for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
+ [[ -e ${dest} ]] && break
+ done
+ [[ -d ${dest} ]] && dest=${dest}/portdir.conf
+ rm -rf "${T}/make.conf"
+ [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
+ cat <<-EOF >> "${T}/make.conf"
+
+ # Set PORTDIR for backward compatibility with various tools:
+ # gentoo-bashcomp - bug #478444
+ # euse - bug #474574
+ # euses and ufed - bug #478318
+ PORTDIR="${EPREFIX}/usr/portage"
+ EOF
+ mkdir -p "${dest%/*}"
+ mv "${T}/make.conf" "$(new_config_protect "${dest}")"
+ fi
+ fi
+
+ if ${NEEDED_REBUILD_UPGRADE} ; then
+ einfo "rebuilding NEEDED.ELF.2 files"
+ local cpv filename line newline
+ for cpv in "${EROOT:-${ROOT}}var/db/pkg"/*/*; do
+ [[ -f "${cpv}/NEEDED" && ! -f "${cpv}/NEEDED.ELF.2" ]] || continue
+ while read -r line; do
+ filename=${line% *}
+ newline=$(scanelf -BF "%a;%F;%S;%r;%n" "${ROOT%/}${filename}")
+ newline=${newline// - }
+ [[ ${#ROOT} -gt 1 ]] && newline=${newline/${ROOT%/}}
+ echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
+ done < "${cpv}/NEEDED"
+ done
+ fi
+
+ local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
+
+ if ${USERSYNC_UPGRADE} && \
+ [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
+ local ownership=$(get_ownership "${PORTDIR}")
+ if [[ -n ${ownership} ]] ; then
+ einfo "Adjusting PORTDIR permissions for usersync"
+ find "${PORTDIR}" -path "${distdir%/}" -prune -o \
+ ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
+ -exec chown "${ownership}" {} +
+ fi
+ fi
+
+ # Do this last, since it could take a long time if there
+ # are lots of live sources, and the user may be tempted
+ # to kill emerge while it is running.
+ if ${USERPRIV_UPGRADE} && \
+ [[ -d ${distdir} && -w ${distdir} ]] ; then
+ local ownership=$(get_ownership "${distdir}")
+ if [[ ${ownership#*:} == portage ]] ; then
+ einfo "Adjusting DISTDIR permissions for userpriv"
+ find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
+ -exec chown -R portage:portage {} +
+ fi
+ fi
+}
diff --git a/sys-apps/portage/portage-9999.ebuild b/sys-apps/portage/portage-9999.ebuild
new file mode 100644
index 000000000000..004138f0de59
--- /dev/null
+++ b/sys-apps/portage/portage-9999.ebuild
@@ -0,0 +1,243 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=(
+ pypy
+ python3_3 python3_4
+ python2_7
+)
+# Note: substituted below
+PYTHON_REQ_USE='bzip2(+)'
+
+inherit distutils-r1 git-r3 multilib
+
+DESCRIPTION="Portage is the package management and distribution system for Gentoo"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
+
+LICENSE="GPL-2"
+KEYWORDS=""
+SLOT="0"
+IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
+
+DEPEND="!build? ( ${PYTHON_DEPS//bzip2(+)/ssl(+),bzip2(+)} )
+ >=app-arch/tar-1.27
+ dev-lang/python-exec:2
+ >=sys-apps/sed-4.0.5 sys-devel/patch
+ doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
+ epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
+# Require sandbox-2.2 for bug #288863.
+# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
+# quite slow, so it's not considered in the dependencies as an alternative to
+# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
+# for now, don't pull in xattr deps for other kernels.
+# For whirlpool hash, require python[ssl] (bug #425046).
+# For compgen, require bash[readline] (bug #445576).
+RDEPEND="
+ >=app-arch/tar-1.27
+ dev-lang/python-exec:2
+ !build? (
+ >=sys-apps/sed-4.0.5
+ app-shells/bash:0[readline]
+ >=app-admin/eselect-1.2
+ )
+ elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
+ elibc_glibc? ( >=sys-apps/sandbox-2.2 )
+ elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
+ >=app-misc/pax-utils-0.1.17
+ selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
+ xattr? ( kernel_linux? (
+ >=sys-apps/install-xattr-0.3
+ $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
+ python2_7 pypy)
+ ) )
+ !<app-admin/logrotate-3.8.0"
+PDEPEND="
+ !build? (
+ >=net-misc/rsync-2.6.4
+ userland_GNU? ( >=sys-apps/coreutils-6.4 )
+ )"
+# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
+# NOTE: FEATURES=installsources requires debugedit and rsync
+
+REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
+
+SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
+
+prefix_src_archives() {
+ local x y
+ for x in ${@}; do
+ for y in ${SRC_ARCHIVES}; do
+ echo ${y}/${x}
+ done
+ done
+}
+
+EGIT_REPO_URI="git://anongit.gentoo.org/proj/portage.git
+ https://github.com/gentoo/portage.git"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ if ! use ipc ; then
+ einfo "Disabling ipc..."
+ sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
+ -i pym/_emerge/AbstractEbuildProcess.py || \
+ die "failed to patch AbstractEbuildProcess.py"
+ fi
+
+ if use xattr && use kernel_linux ; then
+ einfo "Adding FEATURES=xattr to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ if [[ -n ${EPREFIX} ]] ; then
+ einfo "Setting portage.const.EPREFIX ..."
+ sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
+ -i pym/portage/const.py || \
+ die "Failed to patch portage.const.EPREFIX"
+
+ einfo "Prefixing shebangs ..."
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find . -type f -print0)
+
+ einfo "Adjusting make.globals ..."
+ sed -e "s|\(/usr/portage\)|${EPREFIX}\\1|" \
+ -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
+ -i cnf/make.globals || die "sed failed"
+
+ einfo "Adjusting repos.conf ..."
+ sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
+ -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
+ -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
+ -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
+ -i cnf/repos.conf || die "sed failed"
+
+ einfo "Adding FEATURES=force-prefix to make.globals ..."
+ echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
+ || die "failed to append to make.globals"
+ fi
+
+ cd "${S}/cnf" || die
+ if [ -f "make.conf.example.${ARCH}".diff ]; then
+ patch make.conf.example "make.conf.example.${ARCH}".diff || \
+ die "Failed to patch make.conf.example"
+ else
+ eerror ""
+ eerror "Portage does not have an arch-specific configuration for this arch."
+ eerror "Please notify the arch maintainer about this issue. Using generic."
+ eerror ""
+ fi
+}
+
+python_compile_all() {
+ local targets=()
+ use doc && targets+=( docbook )
+ use epydoc && targets+=( epydoc )
+
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+}
+
+python_test() {
+ esetup.py test
+}
+
+python_install() {
+ # Install sbin scripts to bindir for python-exec linking
+ # they will be relocated in pkg_preinst()
+ distutils-r1_python_install \
+ --system-prefix="${EPREFIX}/usr" \
+ --bindir="$(python_get_scriptdir)" \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
+ --sbindir="$(python_get_scriptdir)" \
+ --sysconfdir="${EPREFIX}/etc" \
+ "${@}"
+}
+
+python_install_all() {
+ distutils-r1_python_install_all
+
+ local targets=()
+ use doc && targets+=( install_docbook )
+ use epydoc && targets+=( install_epydoc )
+
+ # install docs
+ if [[ ${targets[@]} ]]; then
+ esetup.py "${targets[@]}"
+ fi
+
+ # Due to distutils/python-exec limitations
+ # they must be installed to /usr/bin.
+ local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
+ einfo "Moving admin scripts to the correct directory"
+ dodir /usr/sbin
+ for target in ${sbin_relocations}; do
+ einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
+ mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
+ done
+}
+
+pkg_preinst() {
+ # comment out sanity test until it is fixed to work
+ # with the new PORTAGE_PYM_PATH
+ #if [[ $ROOT == / ]] ; then
+ ## Run some minimal tests as a sanity check.
+ #local test_runner=$(find "${ED}" -name runTests)
+ #if [[ -n $test_runner && -x $test_runner ]] ; then
+ #einfo "Running preinst sanity tests..."
+ #"$test_runner" || die "preinst sanity tests failed"
+ #fi
+ #fi
+
+ # elog dir must exist to avoid logrotate error for bug #415911.
+ # This code runs in preinst in order to bypass the mapping of
+ # portage:portage to root:root which happens after src_install.
+ keepdir /var/log/portage/elog
+ # This is allowed to fail if the user/group are invalid for prefix users.
+ if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
+ chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
+ fi
+}
+
+pkg_postinst() {
+ einfo "This version of portage now has the new plugin-sync system"
+ einfo "An additional 'auto-sync = yes' setting is needed for each repo"
+ einfo "you wish 'emerge --sync' to sync"
+ einfo "The default setting is 'no'"
+ einfo "The primary sync action is now controlled via the emaint command"
+ einfo "The emaint sync module is more flexible in its capabilities"
+ einfo "It is similar to layman's -s and -S options"
+ einfo ""
+ einfo " 'emerge --sync' is now equivalent to 'emaint sync -a'"
+ einfo ""
+ einfo "run 'emaint sync --auto' to sync all auto-sync enabled repos"
+ einfo " options are:"
+ einfo " -A, --allrepos Sync all repos that have a sync-url defined"
+ einfo " -a, --auto Sync auto-sync enabled repos only"
+ einfo " -r REPO, --repo REPO Sync the specified repo"
+ einfo " even if 'auto-sync = no' is set"
+ einfo ""
+ einfo "Currently installed sync-type modules include:"
+ einfo " rsync, git, cvs, svn, websync"
+ einfo " the websync module currently runs emerge-webrsync for you"
+ einfo ""
+ einfo "For sync module specifications: https://wiki.gentoo.org/wiki/Project:Portage/Sync"
+ einfo ""
+}
diff --git a/sys-apps/powerpc-utils/Manifest b/sys-apps/powerpc-utils/Manifest
new file mode 100644
index 000000000000..ade3fe0e3c48
--- /dev/null
+++ b/sys-apps/powerpc-utils/Manifest
@@ -0,0 +1,3 @@
+DIST powerpc-utils-cleanup.patch.bz2 7255 RMD160 361b792b9770d369e4a88941594f679967ea0fdc SHA1 b9443bc46999d2953409665dc1b24fa2978db7ee SHA256 05592c22230afdef79c92556c2161262ec32cee3feaf29e666bf29ba0ef9b39f
+DIST powerpc-utils_1.1.3-18.diff.gz 27252 RMD160 ec806ada35999fafed571606c9b676f74c9f7040 SHA1 bdff200bc9280b17aa3a8cde52d9784eb7b4fb89 SHA256 7cb699d5e647fe39a9cc1a0276a9e9dc381061a8ecba13671ce8bc1f1037edf4
+DIST powerpc-utils_1.1.3.orig.tar.gz 25104 RMD160 86eacaf0a7f022a850b6540b09220dacb49d0949 SHA1 049baa3dcb879a89afc4da0ee0b90d279bad3b24 SHA256 fde422d13e75d0154fa5d9d94ba3c74f4a91dc0f8ba0351e675ee99eeaddbe95
diff --git a/sys-apps/powerpc-utils/metadata.xml b/sys-apps/powerpc-utils/metadata.xml
new file mode 100644
index 000000000000..034c09eb248a
--- /dev/null
+++ b/sys-apps/powerpc-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>ppc</herd>
+</pkgmetadata>
diff --git a/sys-apps/powerpc-utils/powerpc-utils-1.1.3.18-r2.ebuild b/sys-apps/powerpc-utils/powerpc-utils-1.1.3.18-r2.ebuild
new file mode 100644
index 000000000000..af5af52adfbd
--- /dev/null
+++ b/sys-apps/powerpc-utils/powerpc-utils-1.1.3.18-r2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils versionator toolchain-funcs
+
+BASEVER=$(get_version_component_range 1-3)
+DEBREV=$(get_version_component_range 4)
+
+DESCRIPTION="PowerPC utilities including nvsetenv, and additional OldWorld apps"
+SRC_URI="http://http.us.debian.org/debian/pool/main/p/powerpc-utils/${PN}_${BASEVER}.orig.tar.gz
+ http://http.us.debian.org/debian/pool/main/p/powerpc-utils/${PN}_${BASEVER}-${DEBREV}.diff.gz
+ mirror://gentoo/${PN}-cleanup.patch.bz2"
+
+HOMEPAGE="http://http.us.debian.org/debian/pool/main/p/powerpc-utils/"
+KEYWORDS="-* ppc ppc64"
+IUSE=""
+DEPEND=""
+RDEPEND="${DEPEND}"
+SLOT="0"
+LICENSE="GPL-2"
+
+S="${WORKDIR}/pmac-utils"
+
+src_prepare() {
+ epatch "${WORKDIR}"/${PN}_${BASEVER}-${DEBREV}.diff
+ epatch "${WORKDIR}"/${PN}-cleanup.patch
+
+ # use users CFLAGS, LDFLAGS and CC, bug 280400
+ sed -i -e "/LDFLAGS =/d" -e "/CC\t=/d" -e "s/CFLAGS\t=/CFLAGS +=/" \
+ -e "s/-g -O2/-Wstrict-prototypes/" Makefile || die "sed failed"
+}
+
+src_compile() {
+ tc-export CC
+ emake || die "emake failed"
+}
+
+src_install() {
+ into /usr
+ dosbin autoboot backlight bootsched clock fblevel fdeject fnset \
+ || die "dosbin failed"
+ dosbin macos mousemode nvsetenv nvsetvol nvvideo sndvolmix trackpad \
+ || die "dosbin failed"
+ doman autoboot.8 bootsched.8 clock.8 fblevel.8 fdeject.8 macos.8 \
+ || die "doman failed"
+ doman mousemode.8 nvsetenv.8 nvsetvol.8 nvvideo.8 sndvolmix.8 trackpad.8 \
+ || die "doman failed"
+
+ ewarn "The lsprop utility has been moved into the ibm-powerpc-utils package."
+}
diff --git a/sys-apps/prctl/Manifest b/sys-apps/prctl/Manifest
new file mode 100644
index 000000000000..ca46511e5ae6
--- /dev/null
+++ b/sys-apps/prctl/Manifest
@@ -0,0 +1 @@
+DIST prctl-1.5.tar.gz 17507 SHA256 b3fed2cec8721518179355d1a443c4be58f73ea224aa4c0cc4ba30ec87479687
diff --git a/sys-apps/prctl/metadata.xml b/sys-apps/prctl/metadata.xml
new file mode 100644
index 000000000000..dc84e004c37a
--- /dev/null
+++ b/sys-apps/prctl/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>ia64</herd>
+ <upstream>
+ <remote-id type="sourceforge">prctl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/prctl/prctl-1.5.ebuild b/sys-apps/prctl/prctl-1.5.ebuild
new file mode 100644
index 000000000000..097f166d4cb7
--- /dev/null
+++ b/sys-apps/prctl/prctl-1.5.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit toolchain-funcs
+
+DESCRIPTION="Tool to query and modify process behavior"
+HOMEPAGE="http://sourceforge.net/projects/prctl/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha ia64"
+IUSE=""
+
+RDEPEND=""
+DEPEND="sys-apps/groff"
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dobin prctl
+ doman prctl.1
+ dodoc ChangeLog
+}
diff --git a/sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in b/sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in
new file mode 100644
index 000000000000..f3439afa076a
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/files/prefix-chain-wrapper.in
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+
+link_dirs=()
+opts=()
+chost="@GENTOO_PORTAGE_CHOST@"
+prefix="@GENTOO_PORTAGE_EPREFIX@"
+absprefix=${prefix}
+if [[ ${CHOST} == *"-winnt"* ]]; then
+ # we may get called from windows binary, like pkgdata in dev-libs/icu
+ # in this case, PATH elements get the "/dev/fs/C/WINDOWS/SUA" prefix
+ absprefix=$(winpath2unix "$(unixpath2win "${absprefix}")")
+fi
+mode=link
+orig_args=("$@")
+
+for opt in "$@"; do
+ case "$opt" in
+ -L) link_dirs=("${link_dirs[@]}" "-L$1"); shift ;;
+ -L*) link_dirs=("${link_dirs[@]}" "${opt}") ;;
+ *)
+ case "${opt}" in
+ -v)
+ # -v done right: only use mode version if -v is the _only_
+ # argument on the command line.
+ [[ ${#orig_args[@]} -gt 1 ]] || mode=version
+ ;;
+ --version) mode=version ;;
+ -c|-E|-S) mode=compile ;;
+ -print-search-dirs) mode=dirs ;;
+ esac
+ opts=("${opts[@]}" "${opt}")
+ ;;
+ esac
+done
+
+save_ifs=$IFS
+IFS=':'
+new_path=
+for p in $PATH; do
+ IFS=$save_ifs
+ [[ "${p#${absprefix}}" != "${p}" ]] && continue
+ if [[ -z "${new_path}" ]]; then
+ new_path="${p}"
+ else
+ new_path="${new_path}:${p}"
+ fi
+done
+IFS=$save_ifs
+
+PATH=${new_path}
+
+# toolchain-prefix-wrapper's ld-wrapper understands '-R' for aix and hpux too.
+# parity (winnt) understands -rpath only ...
+case "${chost}" in
+*-winnt*) rpath_opt="-Wl,-rpath," ;;
+*) rpath_opt="-Wl,-R," ;;
+esac
+
+pfx_link=("-L${prefix}/usr/lib" "-L${prefix}/lib")
+pfx_link_r=("${rpath_opt}${prefix}/lib" "${rpath_opt}${prefix}/usr/lib")
+pfx_comp=("-I${prefix}/include" "-I${prefix}/usr/include")
+
+case "$mode" in
+link) exec "$(basename $0)" "${link_dirs[@]}" "${pfx_link[@]}" "${opts[@]}" "${pfx_comp[@]}" "${pfx_link_r[@]}" ;;
+compile) exec "$(basename $0)" "${link_dirs[@]}" "${opts[@]}" "${pfx_comp[@]}" ;;
+version) exec "$(basename $0)" "${orig_args[@]}" ;;
+dirs)
+ "$(basename $0)" "${orig_args[@]}" | while read line; do
+ if [[ "${line}" == "libraries: ="* ]]; then
+ echo "libraries: =${prefix}/usr/lib:${prefix}/lib:${line#"libraries: ="}"
+ else
+ echo "${line}"
+ fi
+ done
+ ;;
+*) echo "cannot infer $0's mode from comamnd line arguments"; exit 1 ;;
+esac
+
diff --git a/sys-apps/prefix-chain-utils/files/startprefix.in b/sys-apps/prefix-chain-utils/files/startprefix.in
new file mode 100644
index 000000000000..1b84ed3c28e1
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/files/startprefix.in
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+
+. "@GENTOO_PORTAGE_EPREFIX@"/sbin/functions.sh
+einfo "entering chained prefix @GENTOO_PORTAGE_EPREFIX@ ..."
+
+# inform profiles very early of us beeing interactive (or at least,
+# we will _start_ an interactive shell, so we want the according bits.)
+set -i
+
+. "@GENTOO_PORTAGE_EPREFIX@"/etc/profile
+
+# if there is no local portage, foreign portage instances need to know
+# where to merge to - and thus we need to set EPREFIX.
+# the other way round, if there is a local portage, EPREFIX may not
+# point anywhere else than to our local EPREFIX or be unset...
+
+# DISABLED: this is done by etc/profile now, to be able to start a
+# prefix environment by sourcing etc/profile.
+
+#if [[ -x "@GENTOO_PORTAGE_EPREFIX@"/usr/bin/emerge ]]; then
+# if [[ -n "${EPREFIX}" ]] && [[ "${EPREFIX}" != "@GENTOO_PORTAGE_EPREFIX@" ]]; then
+# ewarn "EPREFIX is set. this will render portage unusable, unsetting"
+# unset EPREFIX
+# fi
+#else
+# export EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+#fi
+
+# a common problem: the child has no less installed, but baselayout insists
+# on setting PAGER to EPREFIX/usr/bin/less. everything gets back to normal
+# when unsetting PAGER in this case.
+if [[ ! -x "${PAGER}" ]]; then
+ unset PAGER
+fi
+
+bash --noprofile
+einfo "leaving chained prefix @GENTOO_PORTAGE_EPREFIX@ ..."
+
diff --git a/sys-apps/prefix-chain-utils/metadata.xml b/sys-apps/prefix-chain-utils/metadata.xml
new file mode 100644
index 000000000000..46dee96f4e7a
--- /dev/null
+++ b/sys-apps/prefix-chain-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>prefix</herd>
+</pkgmetadata>
diff --git a/sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r5.ebuild b/sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r5.ebuild
new file mode 100644
index 000000000000..9591c27b5934
--- /dev/null
+++ b/sys-apps/prefix-chain-utils/prefix-chain-utils-0.2-r5.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit prefix
+
+DESCRIPTION="Chained EPREFIX utilities and wrappers"
+HOMEPAGE="http://dev.gentoo.org/~mduft"
+SRC_URI=""
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~ppc-aix ~ia64-hpux ~x86-interix ~x86-linux ~sparc-solaris ~x86-solaris ~x86-winnt"
+IUSE=""
+
+DEPEND=""
+RDEPEND="sys-devel/gcc-config"
+
+src_install() {
+ cp "${FILESDIR}"/*.in "${T}"
+ eprefixify "${T}"/*.in
+
+ for x in "${T}"/*.in; do
+ mv ${x} ${x%.in}
+ done
+
+ # install toolchain wrapper.
+ wrapperdir=/usr/${CHOST}/gcc-bin/${CHOST}-prefix-chain-wrapper/${PV}
+ wrappercfg=${CHOST}-prefix-chain-wrapper-${PV}
+
+ exeinto $wrapperdir
+ sed -i -e "s,@GENTOO_PORTAGE_CHOST@,${CHOST},g" "${T}"/prefix-chain-wrapper
+ doexe "${T}"/prefix-chain-wrapper
+
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-gcc
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-g++
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-cpp
+ dosym $wrapperdir/prefix-chain-wrapper $wrapperdir/${CHOST}-c++
+
+ dosym $wrapperdir/${CHOST}-gcc $wrapperdir/gcc
+ dosym $wrapperdir/${CHOST}-g++ $wrapperdir/g++
+ dosym $wrapperdir/${CHOST}-cpp $wrapperdir/cpp
+ dosym $wrapperdir/${CHOST}-c++ $wrapperdir/c++
+
+ # LDPATH is required to keep gcc-config happy :(
+ cat > "${T}"/$wrappercfg <<EOF
+GCC_PATH="${EPREFIX}/$wrapperdir"
+LDPATH="${EPREFIX}/$wrapperdir"
+EOF
+
+ insinto /etc/env.d/gcc
+ doins "${T}"/$wrappercfg
+
+ # install startprefix script.
+ exeinto /
+ doexe "${T}"/startprefix
+}
diff --git a/sys-apps/preload/Manifest b/sys-apps/preload/Manifest
new file mode 100644
index 000000000000..c7ae629147a0
--- /dev/null
+++ b/sys-apps/preload/Manifest
@@ -0,0 +1 @@
+DIST preload-0.6.4.tar.gz 140750 SHA256 d0a558e83cb29a51d9d96736ef39f4b4e55e43a589ad1aec594a048ca22f816b SHA512 ffb533059b8c9cd171b0d02d52fc8c9bc45284fb16e12b9698ab74345d0e4f66cee61e17922074f7fbfaa90db254e473f815718fc72a689bb55346fcda9e823c WHIRLPOOL dcee78e1933689e0860cee1b641625182c1cd35a30a71cb11d12dbd68dd513f7a49f69134f6623baa7fa9ab85f81fb45324ffd20aa191aac23ee054f939bb0d6
diff --git a/sys-apps/preload/files/00-patch-configure.diff b/sys-apps/preload/files/00-patch-configure.diff
new file mode 100644
index 000000000000..0fa5feb47b1f
--- /dev/null
+++ b/sys-apps/preload/files/00-patch-configure.diff
@@ -0,0 +1,15 @@
+--- configure.ac~ 2009-04-15 23:47:52.000000000 +0200
++++ configure.ac 2010-03-29 17:59:39.000000000 +0200
+@@ -54,9 +54,9 @@
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.14)
+
+ # Directories we need.
+-pkgdocdir='${datadir}/doc/'${PACKAGE_NAME}-${PACKAGE_VERSION}
+-initddir='${sysconfdir}/rc.d/init.d'
+-sysconfigdir='${sysconfdir}/sysconfig'
++pkgdocdir='${datadir}/doc/'${PF}
++initddir='${sysconfdir}/init.d'
++sysconfigdir='${sysconfdir}/conf.d'
+ logrotatedir='${sysconfdir}/logrotate.d'
+ logdir='${localstatedir}/log'
+ subsysdir='${localstatedir}/lock/subsys'
diff --git a/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch b/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch
new file mode 100644
index 000000000000..2143ba3cc15e
--- /dev/null
+++ b/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch
@@ -0,0 +1,64 @@
+From 63cbd8862714a97c8ef752041dc8c351ba4fae1d Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Mon, 28 Jul 2008 19:50:22 +0200
+Subject: [PATCH] Early restart of forking readahead children
+
+This patch adds ability to wait_for_children() to restart
+forking new readahead children as soon as a slot becomes
+available which should make the effect of parallelism even
+more effective. Previous situation was:
+
+Wait for all children to exit as soon as the high water mark
+was reached. This resulted in 30 processes in peak, wait for
+them to reach 0 processes. Start another 30 processes in
+peak, wait again etc.
+
+New situation is: Start a new process as soon as a previous
+process exited which keeps the peak at 30 processes until
+the readahead list is finished.
+
+This introduces a new parameter to wait_for_children() which
+tells it to leave now more than XY processes running when
+returning.
+---
+ src/readahead.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index c169e81..7617449 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -103,10 +103,10 @@ map_block_compare (const preload_map_t **pa, const preload_map_t **pb)
+ static int procs = 0;
+
+ static void
+-wait_for_children (void)
++wait_for_children (int maxprocs)
+ {
+ /* wait for child processes to terminate */
+- while (procs > 0)
++ while (procs >= maxprocs)
+ {
+ int status;
+ if (wait (&status) > 0)
+@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length)
+ int maxprocs = conf->system.maxprocs;
+
+ if (procs >= maxprocs)
+- wait_for_children ();
++ wait_for_children (maxprocs);
+
+ if (maxprocs > 0)
+ {
+@@ -257,7 +257,7 @@ preload_readahead (preload_map_t **files, int file_count)
+ path = NULL;
+ }
+
+- wait_for_children ();
++ wait_for_children (0);
+
+ return processed;
+ }
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch b/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch
new file mode 100644
index 000000000000..20ba67a1bb4b
--- /dev/null
+++ b/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch
@@ -0,0 +1,29 @@
+From 97814f566aeb84f60031008c3dda5457ba176fe7 Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Mon, 28 Jul 2008 20:57:06 +0200
+Subject: [PATCH] Create short overlapping io bursts
+
+Modify the wait_for_children() mechanism to create short
+burst instead of constant flow of new io requests. This
+is more fair and should enable the kernel to rearrange
+io requests better.
+---
+ src/readahead.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index 7617449..466961d 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length)
+ int maxprocs = conf->system.maxprocs;
+
+ if (procs >= maxprocs)
+- wait_for_children (maxprocs);
++ wait_for_children (maxprocs >> 1);
+
+ if (maxprocs > 0)
+ {
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch b/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch
new file mode 100644
index 000000000000..dc37548638a5
--- /dev/null
+++ b/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch
@@ -0,0 +1,27 @@
+From 536714622135e53db3f8a5673db32c5de9620aa8 Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Tue, 29 Jul 2008 08:15:55 +0200
+Subject: [PATCH] Fix wait_for_children() loop
+
+Brain damage repaired: One should not wait while zero or
+more children exist... That's always the case. :-(
+---
+ src/readahead.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index 466961d..08d9f4f 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -106,7 +106,7 @@ static void
+ wait_for_children (int maxprocs)
+ {
+ /* wait for child processes to terminate */
+- while (procs >= maxprocs)
++ while (procs > maxprocs)
+ {
+ int status;
+ if (wait (&status) > 0)
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/02-patch-preload_conf.diff b/sys-apps/preload/files/02-patch-preload_conf.diff
new file mode 100644
index 000000000000..70055c3bbb0f
--- /dev/null
+++ b/sys-apps/preload/files/02-patch-preload_conf.diff
@@ -0,0 +1,21 @@
+diff -urN preload-0.6.orig/src/preload.conf.in preload-0.6/src/preload.conf.in
+--- preload-0.6.orig/src/preload.conf.in 2008-07-24 02:02:11.000000000 +0200
++++ preload-0.6/src/preload.conf.in 2008-07-24 16:32:28.565184094 +0200
+@@ -132,7 +132,7 @@
+ # preload doesn't special-handle device files internally.
+ #
+ # default: (empty list, accept all)
+-mapprefix = /usr/;/lib;/var/cache/;!/
++mapprefix = /usr/;/lib;/var/cache/;/opt/;/home/;!/
+
+ # exeprefix:
+ #
+@@ -141,7 +141,7 @@
+ # files instead of maps.
+ #
+ # default: (empty list, accept all)
+-exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;!/
++exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;/opt/;/usr/libexec/;!/
+
+ # maxprocs
+ #
diff --git a/sys-apps/preload/files/02-patch-preload_sysconfig.diff b/sys-apps/preload/files/02-patch-preload_sysconfig.diff
new file mode 100644
index 000000000000..84308b6e14d8
--- /dev/null
+++ b/sys-apps/preload/files/02-patch-preload_sysconfig.diff
@@ -0,0 +1,39 @@
+diff -urN preload-0.6.4.orig/preload.sysconfig preload-0.6.4/preload.sysconfig
+--- preload-0.6.4.orig/preload.sysconfig 2008-10-23 03:08:20.000000000 +0200
++++ preload-0.6.4/preload.sysconfig 2009-05-01 13:51:03.493828659 +0200
+@@ -1,10 +1,30 @@
++# Copyright 1999-2008 Gentoo Foundation
++# $Id$
++# preload configuration file
++
++PIDFILE="/var/run/preload.pid"
++
++# verbosity. 0-10, Default is 1.
++#PRELOAD_VERBOSITY="1"
++
++# set this for niceness. Default is 15. Valid ranges are from -20 to 19. See
++# nice(1) man page.
++#PRELOAD_NICE="15"
++
++# log file (default is /var/log/preload.log )
++#PRELOAD_LOGFILE="/var/log/preload.log"
++
++# preload state file (default location is /var/lib/preload/preload.state )
++# Empty (commented out) means no state is saved.
++PRELOAD_STATEFILE="/var/lib/preload/preload.state"
++
+ # Miminum memory that the system should have for preload to be launched.
+-# In megabytes.
+-MIN_MEMORY="256"
++# In megabytes. Currently unused.
++#MIN_MEMORY="256"
+
+ # Command-line arguments to pass to the daemon. Read preload(8) man page
+ # for available options.
+-PRELOAD_OPTS="--verbose 1"
++#PRELOAD_OPTS="--verbose 1"
+
+-# Option to call ionice with. Leave empty to skip ionice.
+-IONICE_OPTS="-c3"
++# Option to call ionice with. Leave empty to use defaults.
++#IONICE_OPTS="-c3"
diff --git a/sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch b/sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch
new file mode 100644
index 000000000000..61db50692524
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch
@@ -0,0 +1,31 @@
+--- src/Makefile.am~ 2009-04-15 23:46:04.000000000 +0200
++++ src/Makefile.am 2010-04-09 12:56:45.000000000 +0200
+@@ -54,23 +54,11 @@
+
+ dist_man_MANS = preload.8
+
+-$(srcdir)/preload.8: cmdline.c ../configure.ac preload.8.i
+- $(MAKE) $(AM_MAKEFLAGS) preload
+- @echo "Creating $@ using help2man(1)"
+- @$(top_builddir)/missing --run \
+- help2man --no-info --section=8 --include=preload.8.i \
+- --help-option="-H" --output="$@.tmp" \
+- --name 'Adaptive readahead daemon' ./preload \
+- && mv "$@.tmp" "$@" \
+- || ($(RM) "$@"; \
+- echo Failed to update preload.8, the man page may be outdated >&2; \
+- (test -f "$@" || echo help2man is required to generate this file. >> "$@"));
+-
+-install-data-hook:
+- @cd "$(DESTDIR)$(man8dir)" && gzip -c preload.8 > preload.8.gz.tmp && mv preload.8.gz.tmp preload.8.gz && $(RM) preload.8
+-
+-uninstall-hook:
+- $(RM) "$(DESTDIR)$(man8dir)/preload.8.gz"
++preload.8: preload preload.8.i
++ help2man \
++ --no-info --section=8 --include=preload.8.i \
++ --help-option="-H" --output="$@" \
++ --name 'Adaptive readahead daemon' ./preload
+
+ ######################################################################
+
diff --git a/sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch b/sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch
new file mode 100644
index 000000000000..0f41780c31e4
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch
@@ -0,0 +1,21 @@
+--- src/Makefile.am~ 2010-04-09 12:56:45.000000000 +0200
++++ src/Makefile.am 2010-04-09 12:58:36.000000000 +0200
+@@ -8,8 +8,6 @@
+ -DLOGDIR='"${logdir}"' \
+ -DPKGLOCALSTATEDIR='"${pkglocalstatedir}"'
+
+-preload.o cmdline.o preload.8: Makefile
+-
+ sbin_PROGRAMS = preload
+
+ preload_SOURCES = \
+@@ -64,8 +62,7 @@
+
+ MAINTAINERCLEANFILES += preload.conf.debug
+
+-preload.conf.debug:
+- $(MAKE) $(AM_MAKEFLAGS) preload.conf
++preload.conf.debug: preload.conf
+ cp preload.conf preload.conf.debug
+
+ RUNPREQ = preload preload.conf.debug
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in b/sys-apps/preload/files/preload-0.6.4.init.in
new file mode 100644
index 000000000000..664cc9b09983
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+
+PIDFILE="/var/run/@PACKAGE@.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ ebegin "Dumping config and state for @PACKAGE@"
+ kill -USR1 $(<${PIDFILE})
+ kill -USR2 $(<${PIDFILE})
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading @PACKAGE@"
+ kill -HUP $(<${PIDFILE})
+ eend $?
+}
+
+start() {
+ ebegin "Starting @PACKAGE@"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # IMPORTANT: Let ssd do the backgrounding so we immediatly get a valid
+ # pid file in the next step (ionice)
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec @sbindir@/@PACKAGE@ -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} ${PRELOAD_OPTS} -f
+
+ IONICE=$(which ionice)
+ if [ -x "$IONICE" ]; then
+ IONICE_OPTS=${IONICE_OPTS:--c3}
+ $IONICE ${IONICE_OPTS} -p$(<${PIDFILE})
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping @PACKAGE@ (this may take while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in-r1 b/sys-apps/preload/files/preload-0.6.4.init.in-r1
new file mode 100755
index 000000000000..8a6351940743
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in-r1
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+
+description='Start/stop the preload daemon'
+extra_started_commands='dump reload'
+description_dump='Dump the config and state of the daemon (to the logfile)'
+description_reload='Reload the daemon'
+
+PIDFILE="/var/run/preload.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ local pid
+ pid=$(cat ${PIDFILE})
+
+ ebegin "Dumping the config and state of preload"
+ if [ -n "${pid}" ]; then
+ kill -USR1 ${pid}
+ kill -USR2 ${pid}
+ fi
+ eend ${?} && \
+ einfo "These should have been written to ${PRELOAD_LOGFILE:-/var/log/preload.log}"
+}
+
+reload() {
+ ebegin "Reloading preload"
+ kill -HUP $(cat ${PIDFILE})
+ eend ${?}
+}
+
+start() {
+ local ionice
+
+ ebegin "Starting preload"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # First try to start with ionice; if that fails, try without.
+ for ionice in "ionice ${IONICE_OPTS:--c3}" ''; do
+ # Avoid 'ionice not found' errors
+ ${ionice:-true} >/dev/null 2>&1 || continue
+
+ ${ionice} start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec /usr/sbin/preload -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} \
+ -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} \
+ -s ${PRELOAD_STATEFILE:-""} \
+ ${PRELOAD_OPTS} -f \
+ && break
+ done
+
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping preload (this may take a while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend ${?}
+}
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in-r2 b/sys-apps/preload/files/preload-0.6.4.init.in-r2
new file mode 100755
index 000000000000..bf1b18e53541
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in-r2
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+
+description='Start/stop the preload daemon'
+extra_started_commands='dump reload'
+description_dump='Dump the config and state of the daemon (to the logfile)'
+description_reload='Reload the daemon'
+
+PIDFILE="/var/run/preload.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ local pid
+ pid=$(cat ${PIDFILE})
+
+ ebegin "Dumping the config and state of preload"
+ if [ -n "${pid}" ]; then
+ kill -USR1 ${pid}
+ kill -USR2 ${pid}
+ fi
+ eend ${?} && \
+ einfo "These should have been written to ${PRELOAD_LOGFILE:-/var/log/preload.log}"
+}
+
+reload() {
+ ebegin "Reloading preload"
+ kill -HUP $(cat ${PIDFILE})
+ eend ${?}
+}
+
+start() {
+ local ionice
+
+ ebegin "Starting preload"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # First try to start with ionice; if that fails, try without.
+ for ionice in "ionice ${IONICE_OPTS:--c3}" ''; do
+ # Avoid 'ionice not found' errors
+ ${ionice} true >/dev/null 2>&1 || continue
+
+ ${ionice} start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec /usr/sbin/preload -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} \
+ -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} \
+ -s ${PRELOAD_STATEFILE:-""} \
+ ${PRELOAD_OPTS} -f \
+ && break
+ done
+
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping preload (this may take a while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend ${?}
+}
diff --git a/sys-apps/preload/metadata.xml b/sys-apps/preload/metadata.xml
new file mode 100644
index 000000000000..e14703d34f93
--- /dev/null
+++ b/sys-apps/preload/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>pacho@gentoo.org</email>
+ </maintainer>
+ <longdescription> preload is an adaptive readahead daemon. It monitors applications that users run, and by analyzing this data, predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times. </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">preload</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/preload/preload-0.6.4-r3.ebuild b/sys-apps/preload/preload-0.6.4-r3.ebuild
new file mode 100644
index 000000000000..0c091d1e614a
--- /dev/null
+++ b/sys-apps/preload/preload-0.6.4-r3.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils autotools
+
+DESCRIPTION="Adaptive readahead daemon"
+HOMEPAGE="http://sourceforge.net/projects/preload/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="vanilla"
+
+WANT_AUTOCONF="2.56"
+
+RDEPEND=">=dev-libs/glib-2.6:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-apps/help2man"
+
+src_prepare() {
+ epatch "${FILESDIR}"/00-patch-configure.diff
+ epatch "${FILESDIR}"/02-patch-preload_conf.diff
+ epatch "${FILESDIR}"/02-patch-preload_sysconfig.diff
+ epatch "${FILESDIR}"/${PN}-0.6.4-use-help2man-as-usual.patch
+ epatch "${FILESDIR}"/${PN}-0.6.4-use-make-dependencies.patch
+ use vanilla || epatch "${FILESDIR}"/000{1,2,3}-*.patch
+ cat "${FILESDIR}"/preload-0.6.4.init.in-r2 > preload.init.in || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --localstatedir=/var
+}
+
+src_install() {
+ default
+
+ # Remove log and state file from image or they will be
+ # truncated during merge
+ rm "${ED}"/var/lib/preload/preload.state || die "cleanup failed"
+ rm "${ED}"/var/log/preload.log || die "cleanup failed"
+ keepdir /var/lib/preload
+ keepdir /var/log
+}
+
+pkg_postinst() {
+ if [ "$(rc-config list default | grep preload)" = "" ] ; then
+ elog "You probably want to add preload to the default runlevel like so:"
+ elog "# rc-update add preload default"
+ fi
+
+ if has_version sys-fs/e4rat; then
+ elog "It appears you have sys-fs/e4rat installed. This may"
+ elog "has negative effects on it. You may want to disable preload"
+ elog "when using sys-fs/e4rat."
+ elog "http://e4rat.sourceforge.net/wiki/index.php/Main_Page#Debian.2FUbuntu"
+
+ fi
+}
diff --git a/sys-apps/proot/Manifest b/sys-apps/proot/Manifest
new file mode 100644
index 000000000000..cd23e12ea8ea
--- /dev/null
+++ b/sys-apps/proot/Manifest
@@ -0,0 +1,5 @@
+DIST proot-3.2.2.tar.gz 171047 SHA256 481296465027c48de8b8779c4cdad57948c765139f2a17b25590068b8d21a111 SHA512 baf8df06a463978f0faf36f9d81935d6583b99b7e8c54b8ac330478ed92bb3a5d5cd624e028247c50bb9bc6fbe1300c5736a38c0aff250b23614aa52f922dfdd WHIRLPOOL 426c1b2ee6f6ee9ecc3f0b056d3baaf5269c894c302449dca263a1fe45c94d2e76bc07592fd88b9556554550653495fe1ce81e5021b1487e65239026fd23b962
+DIST proot-4.0.1.tar.gz 218732 SHA256 fbb92835f6d4f4cf0560709a852bdb2880611d3b0398b65e9036fabe9857645e SHA512 df6ea412856268af65ed5fd3ede8ae099c70e9b08d7875e3e2d8e44e9d4288de93e3844aa361db0b7b579b68b5e7a983989ec0742a6d31d7bef889f739db2158 WHIRLPOOL 640dde65a3b2f24777e292a90c35ff9489fa508054bf8a7752b5e5adbdb25c9fc17d300ebb344473194942b4bf60bdaab5f2ccd743a4bab0798d629573cec6df
+DIST proot-4.0.3.tar.gz 222716 SHA256 743e253c11d737ddaa0904774b3a9a9f01b5a22778b65076437282ffdc7638cb SHA512 1c74219d44ea79a4573c6dd21a5b62df8e93522886cadb1175044b782f40a711193af348763663d24ab634fbe13b67264f0bff061a980947810e38850d0133f8 WHIRLPOOL ffc6088c65cbe535c465e9839df34fa45eb6986a766f1ec86dbf6b655363817b3e0c21bd5863537797da4a91eb770d9e9267321f13715a7597173613a73117ee
+DIST proot-5.0.0.tar.gz 250005 SHA256 e3f4f38132416e0306fe8e7e225f037e1630665231c65a659969f7c0555483a7 SHA512 0617142d5bfe40329c12f5cbe3c850d01b82f10a8b44d63acb64e7e880af652fb60d05610fb91ce317353986eb30f031d82114661e5d58a38696d242ccd366ee WHIRLPOOL f2027f953046ed84e9095f599d4b414a5ec0c6b91544a66ebeaaaa5e48359dc44f91823aae237227f90a682b2c8290e718198ec74dfd9d7f74404b154f0ffc1f
+DIST proot-5.1.0.tar.gz 253251 SHA256 50fcb882662b2de3e64e603b68d1af75e920d480191a49e11c0cb63d50040386 SHA512 26be26d405a8bcbe94377c3e9c18a571e4b61e3074f0716b0db3517d147d9d4a07c80f7312171cf9580ac7748e72e688efaf1b8e4a0ca3bfc31c802aa351346f WHIRLPOOL 0642496dc5adba8e3e08bfc0c994fa173bfcfaa4b17c4f0586498fbbc62b06afaaa98156bd4ea95530a88b5d436cdf4acb66cced9bff428515c1bd3b3317f19a
diff --git a/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch b/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch
new file mode 100644
index 000000000000..43c0d03d978a
--- /dev/null
+++ b/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch
@@ -0,0 +1,19 @@
+--- src/execve/ldso.c 2013-01-23 16:22:37.870287856 +0400
++++ src/execve/ldso.c 2013-01-23 16:31:40.219283675 +0400
+@@ -285,16 +285,10 @@
+ /* 6. /lib, /usr/lib + /usr/local/lib */
+ if (IS_CLASS32(elf_header))
+ status = add_host_ldso_paths(host_ldso_paths,
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+- "/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:"
+-#endif
+ "/lib32:/usr/lib32:/usr/local/lib32"
+ ":/lib:/usr/lib:/usr/local/lib");
+ else
+ status = add_host_ldso_paths(host_ldso_paths,
+-#if defined(ARCH_X86_64)
+- "/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:"
+-#endif
+ "/lib64:/usr/lib64:/usr/local/lib64"
+ ":/lib:/usr/lib:/usr/local/lib");
+ if (status < 0)
diff --git a/sys-apps/proot/files/proot-3.2.1-makefile.patch b/sys-apps/proot/files/proot-3.2.1-makefile.patch
new file mode 100644
index 000000000000..854c48ef0817
--- /dev/null
+++ b/sys-apps/proot/files/proot-3.2.1-makefile.patch
@@ -0,0 +1,11 @@
+--- src/GNUmakefile.orig 2013-12-06 10:47:18.554784621 +0400
++++ src/GNUmakefile 2013-12-06 10:47:43.129785804 +0400
+@@ -9,7 +9,7 @@
+ CC = gcc
+ LD = $(CC)
+ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)
+-CFLAGS += -Wall -Wextra -O2
++CFLAGS += -Wall -Wextra
+ LDFLAGS += -ltalloc
+
+ OBJECTS = \
diff --git a/sys-apps/proot/files/proot-3.2.2-build-care.patch b/sys-apps/proot/files/proot-3.2.2-build-care.patch
new file mode 100644
index 000000000000..c52a39cf787b
--- /dev/null
+++ b/sys-apps/proot/files/proot-3.2.2-build-care.patch
@@ -0,0 +1,20 @@
+Skip check for building care, patch by Patrick Lauer <patrick AT gentoo.org>
+
+--- src/GNUmakefile 2014-02-25 16:42:04.336863622 +0800
++++ src/GNUmakefile.new 2014-02-25 16:42:26.063050467 +0800
+@@ -54,15 +54,6 @@
+ all: proot
+
+ ######################################################################
+-# Sanity checks
+-
+-ifneq (,$(findstring care,$(MAKECMDGOALS)))
+-ifneq ($(CARE_BUILD_ENV),ok)
+-$(error care is supposed to be built with: http://build.reproducible.io)
+-endif
+-endif
+-
+-######################################################################
+ # Beautified output
+
+ quiet_GEN = @echo " GEN $@"; $(GEN)
diff --git a/sys-apps/proot/files/proot-4.0.1-argv.patch b/sys-apps/proot/files/proot-4.0.1-argv.patch
new file mode 100644
index 000000000000..df580563458c
--- /dev/null
+++ b/sys-apps/proot/files/proot-4.0.1-argv.patch
@@ -0,0 +1,125 @@
+commit 520fa3601c36dd0a3c84e310bd2a1189259000bd
+Author: Cédric VINCENT <cedric.vincent@st.com>
+Date: Thu Aug 7 14:29:37 2014 +0200
+
+ Don't dereference argv[0] when launching a script through a symlink.
+
+ Reported-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+ Ref: https://bugs.gentoo.org/show_bug.cgi?id=517496
+
+ Also, don't complain about non-regular or non-executable files that
+ are not explicitely candidates.
+
+diff --git a/src/path/path.c b/src/path/path.c
+index 4225876..ecdef70 100644
+--- a/src/path/path.c
++++ b/src/path/path.c
+@@ -219,17 +219,21 @@ int which(Tracee *tracee, const char *paths, char host_path[PATH_MAX], char *con
+ /* Is the command available without any $PATH look-up? */
+ status = realpath2(tracee, host_path, command, true);
+ if (status == 0 && stat(host_path, &statr) == 0) {
+- if (!S_ISREG(statr.st_mode)) {
++ if (is_explicit && !S_ISREG(statr.st_mode)) {
+ notice(tracee, ERROR, USER, "'%s' is not a regular file", command);
+ return -EACCES;
+ }
+
+- if ((statr.st_mode & S_IXUSR) == 0) {
++ if (is_explicit && (statr.st_mode & S_IXUSR) == 0) {
+ notice(tracee, ERROR, USER, "'%s' is not executable", command);
+ return -EACCES;
+ }
+
+ found = true;
++
++ /* Don't dereference the final component to preserve
++ * argv0 in case it is a symlink to script. */
++ (void) realpath2(tracee, host_path, command, false);
+ }
+ else
+ found = false;
+@@ -274,8 +278,12 @@ int which(Tracee *tracee, const char *paths, char host_path[PATH_MAX], char *con
+ if (status == 0
+ && stat(host_path, &statr) == 0
+ && S_ISREG(statr.st_mode)
+- && (statr.st_mode & S_IXUSR) != 0)
+- return 0;
++ && (statr.st_mode & S_IXUSR) != 0) {
++ /* Don't dereference the final component to preserve
++ * argv0 in case it is a symlink to script. */
++ (void) realpath2(tracee, host_path, path, false);
++ return 0;
++ }
+ } while (*(cursor - 1) != '\0');
+
+ not_found:
+diff --git a/src/tracee/event.c b/src/tracee/event.c
+index 70668d6..5905c43 100644
+--- a/src/tracee/event.c
++++ b/src/tracee/event.c
+@@ -92,7 +92,7 @@ int launch_process(Tracee *tracee)
+ * guest rootfs. Note: Valgrind can't handle execve(2) on
+ * "foreign" binaries (ENOEXEC) but can handle execvp(3) on such
+ * binaries. */
+- execvp(tracee->exe, tracee->cmdline);
++ execv(tracee->exe, tracee->cmdline);
+ return -errno;
+
+ default: /* parent */
+diff --git a/tests/test-713b6910.sh b/tests/test-713b6910.sh
+new file mode 100644
+index 0000000..82e01fd
+--- /dev/null
++++ b/tests/test-713b6910.sh
+@@ -0,0 +1,51 @@
++if [ -z `which mcookie` ] || [ -z `which rm` ] || [ -z `which cat` ] || [ -z `which chmod` ] || [ -z `which ln` ] || [ -z `which grep` ] || [ -z `which mkdir` ] || [ ! -x ${ROOTFS}/bin/readlink ]; then
++ exit 125;
++fi
++
++######################################################################
++
++TMP1=/tmp/$(mcookie)
++TMP2=/tmp/$(mcookie)
++TMP3=/tmp/$(mcookie)
++TMP4=/tmp/$(mcookie)
++
++rm -fr ${TMP1} ${TMP2} ${TMP3} ${TMP4}
++
++######################################################################
++
++cat > ${TMP1} <<'EOF'
++#!/bin/sh
++echo $0
++EOF
++
++chmod +x ${TMP1}
++ln -s ${TMP1} ${TMP2}
++
++${PROOT} ${TMP2} | grep -v ${TMP1}
++${PROOT} ${TMP2} | grep ${TMP2}
++
++######################################################################
++
++mkdir -p ${TMP3}
++cd ${TMP3}
++
++ln -s $(which true) false
++! ${PROOT} false
++
++echo "#!$(which false)" > true
++chmod a-x true
++${PROOT} true
++
++######################################################################
++
++ln -s ${ROOTFS}/bin/readlink ${TMP4}
++
++TEST1=$(${PROOT} ${ROOTFS}/bin/readlink /proc/self/exe)
++TEST2=$(${PROOT} ${TMP4} /proc/self/exe)
++
++test "${TEST1}" = "${TEST2}"
++
++######################################################################
++
++cd /
++rm -fr ${TMP1} ${TMP2} ${TMP3} ${TMP4}
diff --git a/sys-apps/proot/metadata.xml b/sys-apps/proot/metadata.xml
new file mode 100644
index 000000000000..29676beeb874
--- /dev/null
+++ b/sys-apps/proot/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>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <longdescription lang="en">
+ PRoot is a user-space implementation of chroot, mount --bind, and binfmt_misc.
+ This means that users don't need any privilege or setup to do things like: using an arbitrary directory as the new root filesystem,
+ making files accessible somewhere else in the filesystem hierarchy, or executing programs built for another CPU architecture
+ transparently through QEMU user-mode.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">cedric-vincent/PRoot</remote-id>
+ <maintainer>
+ <email>gentoo@reproducible.io</email>
+ <name>Cédric Vincent</name>
+ </maintainer>
+ </upstream>
+ <use>
+ <flag name="care">Build dynamic CARE binary (more info - http://reproducible.io/)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/proot/proot-3.2.2-r1.ebuild b/sys-apps/proot/proot-3.2.2-r1.ebuild
new file mode 100644
index 000000000000..393ddf068bb7
--- /dev/null
+++ b/sys-apps/proot/proot-3.2.2-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils pax-utils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch" \
+ "${FILESDIR}/${P}-build-care.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(usex care "care" "" "" "")
+}
+
+src_install() {
+ if use care; then
+ # Workaround for bug #493416
+ pax-mark -Emp src/care
+ dobin src/care
+ fi
+ # Workaround for bug #493416
+ pax-mark -Emp src/proot
+
+ dobin src/proot
+ doman doc/proot.1
+ dodoc doc/*.txt doc/articles/*
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-4.0.1.ebuild b/sys-apps/proot/proot-4.0.1.ebuild
new file mode 100644
index 000000000000..be756664b273
--- /dev/null
+++ b/sys-apps/proot/proot-4.0.1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch" \
+ "${FILESDIR}/${PN}-3.2.2-build-care.patch" \
+ "${FILESDIR}/${PN}-4.0.1-argv.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ use care && dobin src/care
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-4.0.3.ebuild b/sys-apps/proot/proot-4.0.3.ebuild
new file mode 100644
index 000000000000..9ab5a080e935
--- /dev/null
+++ b/sys-apps/proot/proot-4.0.3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ if use care; then
+ dobin src/care
+ dodoc doc/care/*.txt
+ fi
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-5.0.0.ebuild b/sys-apps/proot/proot-5.0.0.ebuild
new file mode 100644
index 000000000000..9ab5a080e935
--- /dev/null
+++ b/sys-apps/proot/proot-5.0.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ if use care; then
+ dobin src/care
+ dodoc doc/care/*.txt
+ fi
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-5.1.0.ebuild b/sys-apps/proot/proot-5.1.0.ebuild
new file mode 100644
index 000000000000..9ab5a080e935
--- /dev/null
+++ b/sys-apps/proot/proot-5.1.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ if use care; then
+ dobin src/care
+ dodoc doc/care/*.txt
+ fi
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/pv/Manifest b/sys-apps/pv/Manifest
new file mode 100644
index 000000000000..870c01da6bfe
--- /dev/null
+++ b/sys-apps/pv/Manifest
@@ -0,0 +1 @@
+DIST pv-1.6.0.tar.bz2 107723 SHA256 0ece824e0da27b384d11d1de371f20cafac465e038041adab57fcf4b5036ef8d SHA512 bd405901812ca50b910adbcf1d2c540dc0b8612f03687866734a79cfa5b5b8100024c18a1d1413c6613e1f2085989cbb77907da89bec7eda37cdeaa7597129d5 WHIRLPOOL 51312339fa1815a61f58fa0f49b0538289d0308b17c5d03c4c6a7e371052e9911d09cb7a9c1eb032b797a3f56eaa7e5dbfecaf6fb2c1faf3fd1b34c298782c1f
diff --git a/sys-apps/pv/metadata.xml b/sys-apps/pv/metadata.xml
new file mode 100644
index 000000000000..e021cd5922f5
--- /dev/null
+++ b/sys-apps/pv/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>jer@gentoo.org</email>
+ <name>Jeroen Roovers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">pipeviewer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/pv/pv-1.6.0-r1.ebuild b/sys-apps/pv/pv-1.6.0-r1.ebuild
new file mode 100644
index 000000000000..4afd5f03fe22
--- /dev/null
+++ b/sys-apps/pv/pv-1.6.0-r1.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 linux-info toolchain-funcs
+
+DESCRIPTION="Pipe Viewer: a tool for monitoring the progress of data through a pipe"
+HOMEPAGE="http://www.ivarch.com/programs/pv.shtml"
+SRC_URI="http://www.ivarch.com/programs/sources/${P}.tar.bz2"
+
+LICENSE="Artistic-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc64-solaris ~x86-solaris"
+IUSE="debug nls"
+
+PV_LINGUAS=( de fr pl pt )
+IUSE+=" ${PV_LINGUAS[@]/#/linguas_}"
+
+DOCS=( README doc/NEWS doc/TODO )
+
+pkg_setup() {
+ if use kernel_linux; then
+ CONFIG_CHECK="~SYSVIPC"
+ ERROR_SYSVIPC="You will need to enable CONFIG_SYSVIPC in your kernel to use the --remote option."
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ sed -i configure -e 's|CFLAGS="-g -Wall"|:|g' || die
+ # These should produce the same end result (working `pv`).
+ sed -i \
+ -e 's:$(LD) $(LDFLAGS) -o:$(AR) rc:' \
+ autoconf/make/modules.mk~ || die
+}
+
+src_configure() {
+ tc-export AR
+ local lingua
+ for lingua in ${PV_LINGUAS[@]}; do
+ if ! use linguas_${lingua}; then
+ sed -i configure -e "/ALL_LINGUAS=/s:${lingua}::g" || die
+ fi
+ done
+ econf $(use_enable debug debugging) $(use_enable nls)
+}
+
+src_test() {
+ sed -i -e 's:usleep 200000 || ::g' tests/019-remote-cksum || die
+ default
+}
diff --git a/sys-apps/pv/pv-1.6.0.ebuild b/sys-apps/pv/pv-1.6.0.ebuild
new file mode 100644
index 000000000000..4cbc0b19af47
--- /dev/null
+++ b/sys-apps/pv/pv-1.6.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit toolchain-funcs
+
+DESCRIPTION="Pipe Viewer: a tool for monitoring the progress of data through a pipe"
+HOMEPAGE="http://www.ivarch.com/programs/pv.shtml"
+SRC_URI="http://www.ivarch.com/programs/sources/${P}.tar.bz2"
+
+LICENSE="Artistic-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc64-solaris ~x86-solaris"
+IUSE="debug nls"
+
+PV_LINGUAS=( de fr pl pt )
+IUSE+=" ${PV_LINGUAS[@]/#/linguas_}"
+
+DOCS=( README doc/NEWS doc/TODO )
+
+src_prepare() {
+ sed -i configure -e 's|CFLAGS="-g -Wall"|:|g' || die
+ # These should produce the same end result (working `pv`).
+ sed -i \
+ -e 's:$(LD) $(LDFLAGS) -o:$(AR) rc:' \
+ autoconf/make/modules.mk~ || die
+}
+
+src_configure() {
+ tc-export AR
+ local lingua
+ for lingua in ${PV_LINGUAS[@]}; do
+ if ! use linguas_${lingua}; then
+ sed -i configure -e "/ALL_LINGUAS=/s:${lingua}::g" || die
+ fi
+ done
+ econf $(use_enable debug debugging) $(use_enable nls)
+}
+
+src_test() {
+ sed -i -e 's:usleep 200000 || ::g' tests/019-remote-cksum || die
+ default
+}
diff --git a/sys-apps/pyrenamer/Manifest b/sys-apps/pyrenamer/Manifest
new file mode 100644
index 000000000000..6db5a63f5648
--- /dev/null
+++ b/sys-apps/pyrenamer/Manifest
@@ -0,0 +1 @@
+DIST pyrenamer-0.6.0.tar.gz 255793 SHA256 57afbabd4814efa2378de9b6d84808986eb269bd54d13467f8cf20e0122dc92a SHA512 86bf38005c7f6e57546bb2aa7c2f52fd3ad98fb6500b73cc3ed911f221ff0f66262da8500e73ae7c759c5d725221b1226a63226bb37ead28a1ac47a7fdae7a10 WHIRLPOOL fa5ec1429f689c9395f1fba59668e225a7dba79d33410e01af646ff1b255c58caf8dcf4f6e2b72f911a34a923c774aaecbc9ee717dfd2e420fbba2367224739a
diff --git a/sys-apps/pyrenamer/metadata.xml b/sys-apps/pyrenamer/metadata.xml
new file mode 100644
index 000000000000..9ac1055df02a
--- /dev/null
+++ b/sys-apps/pyrenamer/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>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+</maintainer>
+ <use>
+ <flag name='music'>Enable support for renaming music</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/pyrenamer/pyrenamer-0.6.0-r2.ebuild b/sys-apps/pyrenamer/pyrenamer-0.6.0-r2.ebuild
new file mode 100644
index 000000000000..9b44762151bf
--- /dev/null
+++ b/sys-apps/pyrenamer/pyrenamer-0.6.0-r2.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1 gnome2
+
+DESCRIPTION="Mass rename files"
+HOMEPAGE="http://www.infinicode.org/code/pyrenamer/"
+SRC_URI="http://www.infinicode.org/code/${PN}/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="music"
+
+# TODO: Missing support for >=dev-python/eyeD3-0.7.x API that could
+# be used as alternative to app-misc/hachoir-metadata with || ( )
+RDEPEND="dev-python/pygtk:2[${PYTHON_USEDEP}]
+ dev-python/gconf-python[${PYTHON_USEDEP}]
+ music? ( app-misc/hachoir-metadata[${PYTHON_USEDEP}] )"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ python_fix_shebang .
+ gnome2_src_prepare
+}
diff --git a/sys-apps/qcontrol/Manifest b/sys-apps/qcontrol/Manifest
new file mode 100644
index 000000000000..f4e853a15345
--- /dev/null
+++ b/sys-apps/qcontrol/Manifest
@@ -0,0 +1,2 @@
+DIST qcontrol_0.4.2-6.diff.gz 11426 RMD160 a5fbfffb13b123a5bceff57ad5065910ab287b5a SHA1 c8a4828fd987b66ba09758b2b72a5db2c7571b6d SHA256 11d45cebfe217a8bc0a0dbfc641fc098510c4b521cc83b993bd1fd493b834625
+DIST qcontrol_0.4.2.orig.tar.gz 18344 RMD160 511de9ca71df47c8004c345483f2114911b73637 SHA1 942027d7f26da368fa1f34b0bd4fecffa808b211 SHA256 efe7311cdd460a51475d22f737540e7bb3c4303e5eba97b782d765c8f1e67055
diff --git a/sys-apps/qcontrol/files/0.4.2-Makefile.patch b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
new file mode 100644
index 000000000000..ad3701c549eb
--- /dev/null
+++ b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
@@ -0,0 +1,22 @@
+--- Makefile.orig 2011-04-02 20:44:05.021252507 +0200
++++ Makefile 2011-04-02 20:45:21.751248966 +0200
+@@ -1,5 +1,4 @@
+-CFLAGS=-Os -Wall -I /usr/include/lua5.1
+-LDFLAGS=-llua5.1 -lpthread
++LDFLAGS=-llua -lpthread
+ LDFLAGS_UDEB=-lpthread -lm -ldl
+ SOURCES=qcontrol.c ts209.c ts219.c ts409.c ts41x.c evdev.c
+ OBJECTS=$(SOURCES:.c=.o)
+@@ -8,10 +7,10 @@
+ all: $(SOURCES) $(EXECUTABLE) qcontrol.udeb
+
+ $(EXECUTABLE): $(OBJECTS)
+- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
+
+ qcontrol.udeb: $(OBJECTS)
+- $(CC) $(LDFLAGS_UDEB) $(OBJECTS) /usr/lib/liblua5.1.a -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS_UDEB) $(OBJECTS) /usr/lib/liblua.a -o $@
+
+ .cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
diff --git a/sys-apps/qcontrol/files/conf.d b/sys-apps/qcontrol/files/conf.d
new file mode 100644
index 000000000000..6a732c48e2ff
--- /dev/null
+++ b/sys-apps/qcontrol/files/conf.d
@@ -0,0 +1,5 @@
+# /etc/conf.d/qcontrol: config file for /etc/init.d/qcontrol
+
+# Set to "no" to suppress the sounding of the buzzer
+#SOUND_BUZZER=no
+
diff --git a/sys-apps/qcontrol/files/init.d b/sys-apps/qcontrol/files/init.d
new file mode 100644
index 000000000000..ce2a6493d03f
--- /dev/null
+++ b/sys-apps/qcontrol/files/init.d
@@ -0,0 +1,74 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Header: $
+
+# Init script from Debian
+
+depend() {
+ after local
+}
+
+start() {
+ einfo "System boot completed"
+ if [ ! -c /dev/input/by-path/platform-gpio-keys-event- ]; then
+ eerror "qcontrol error: gpio_keys device not available"
+ return 1
+ fi
+ start-stop-daemon --start --quiet --background --pidfile /var/run/qcontrol.pid --make-pidfile --exec /usr/sbin/qcontrol -- -d
+ # Change status led to show green
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219")
+ qcontrol statusled greenon || true
+ qcontrol powerled on || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ "QNAP TS-409" | "QNAP TS-41x")
+ qcontrol statusled greenon || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ *)
+ eerror "qcontrol error: device is not supported"
+ ;;
+ esac
+ start-stop-daemon --stop --quiet --pidfile /var/run/qcontrol.pid --name qcontrol
+ rm /var/run/qcontrol.sock
+}
+
+stop() {
+ einfo "Shutting down system"
+ if [ ! -c /dev/input/by-path/platform-gpio-keys-event- ]; then
+ eerror "qcontrol error: gpio_keys device not available"
+ return 1
+ fi
+ start-stop-daemon --start --quiet --background --pidfile /var/run/qcontrol.pid --make-pidfile --exec /usr/sbin/qcontrol -- -d
+ # Change status led to show red
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219")
+ qcontrol statusled rednon || true
+ qcontrol powerled 1hz || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ "QNAP TS-409" | "QNAP TS-41x")
+ qcontrol statusled redon || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ *)
+ eerror "qcontrol error: device is not supported"
+ ;;
+ esac
+ start-stop-daemon --stop --quiet --pidfile /var/run/qcontrol.pid --name qcontrol
+ rm /var/run/qcontrol.sock
+}
diff --git a/sys-apps/qcontrol/metadata.xml b/sys-apps/qcontrol/metadata.xml
new file mode 100644
index 000000000000..56901798a2dd
--- /dev/null
+++ b/sys-apps/qcontrol/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>arm</herd>
+<herd>embedded</herd>
+<maintainer>
+ <email>armin76@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
new file mode 100644
index 000000000000..d4b5068e3092
--- /dev/null
+++ b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Allows to send commands to some microcontrollers, for example to change leds or sound a buzzer"
+HOMEPAGE="http://qnap.nas-central.org/index.php/PIC_Control_Software"
+SRC_URI="mirror://debian/pool/main/q/qcontrol/${P/-/_}.orig.tar.gz
+ mirror://debian/pool/main/q/qcontrol/${P/-/_}-6.diff.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="arm"
+IUSE=""
+
+DEPEND=">=dev-lang/lua-5.1"
+RDEPEND="${DEPEND}"
+
+src_unpack () {
+ unpack ${A}
+ cd "${WORKDIR}"
+
+ epatch *.diff
+
+ cd "${S}"
+ epatch debian/patches/*.patch
+
+ epatch "${FILESDIR}"/${PV}-Makefile.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" qcontrol || die "emake failed"
+}
+
+src_install() {
+ dosbin qcontrol
+ doman "${S}"/debian/qcontrol.1
+
+ insinto /etc/qcontrol
+ doins "${S}"/debian/configs/*.lua
+
+ newconfd "${FILESDIR}"/conf.d qcontrol
+ newinitd "${FILESDIR}"/init.d qcontrol
+}
+
+pkg_postinst() {
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209")
+ dosym /etc/qcontrol/ts209.lua /etc/qcontrol.conf ;;
+ "QNAP TS-119/TS-219")
+ dosym /etc/qcontrol/ts219.lua /etc/qcontrol.conf ;;
+ "QNAP TS-409")
+ dosym /etc/qcontrol/ts409.lua /etc/qcontrol.conf ;;
+ "QNAP TS-41x")
+ dosym /etc/qcontrol/ts41x.lua /etc/qcontrol.conf ;;
+ *)
+ ewarn "Your device is unsupported" ;;
+ esac
+}
diff --git a/sys-apps/qdiskusage/Manifest b/sys-apps/qdiskusage/Manifest
new file mode 100644
index 000000000000..b711ecd62789
--- /dev/null
+++ b/sys-apps/qdiskusage/Manifest
@@ -0,0 +1 @@
+DIST 107012-QDiskUsage-1.0.4.zip 79148 SHA256 4b6e28af09a4ea45c698da9f5128856be837feea4c898b9338b957bc8a8288df
diff --git a/sys-apps/qdiskusage/metadata.xml b/sys-apps/qdiskusage/metadata.xml
new file mode 100644
index 000000000000..1d7818888617
--- /dev/null
+++ b/sys-apps/qdiskusage/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>qt</herd>
+<longdescription lang="en">
+</longdescription>
+</pkgmetadata>
+
diff --git a/sys-apps/qdiskusage/qdiskusage-1.0.4.ebuild b/sys-apps/qdiskusage/qdiskusage-1.0.4.ebuild
new file mode 100644
index 000000000000..6866eb826dc5
--- /dev/null
+++ b/sys-apps/qdiskusage/qdiskusage-1.0.4.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+inherit eutils qt4-r2
+
+MY_PN="QDiskUsage"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Qt4 Graphical Disk Usage Analyzer"
+HOMEPAGE="http://www.qt-apps.org/content/show.php/QDiskUsage?content=107012"
+SRC_URI="http://qt-apps.org/CONTENT/content-files/107012-${MY_P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+RDEPEND="dev-qt/qtgui:4"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S="${WORKDIR}/${MY_P}"
+
+src_install(){
+ newicon icon.png ${PN}.png || die "newicon failed"
+ newbin ${MY_PN} ${PN} || die "newbin failed"
+ dodoc README || die "dodoc failed"
+ make_desktop_entry ${PN} "QDiskUsage" ${PN}
+}
diff --git a/sys-apps/qingy/Manifest b/sys-apps/qingy/Manifest
new file mode 100644
index 000000000000..83b2c7d59e2a
--- /dev/null
+++ b/sys-apps/qingy/Manifest
@@ -0,0 +1,4 @@
+DIST qingy-1.0.0-consolekit-pam.patch.gz 9263 SHA256 ef1ccfb66e65d78aec93b8356e23f18a78641f2eba775af8acdd83305f7975e4 SHA512 e69743173ea0ff27265dca789f4203b58c271ec6acfeac1ffd87738a3a693f1393778ca70be5d0c8a3e461edfa350047cef3941d8e85679f7c930f3b63c1eeb1 WHIRLPOOL 038c5e77984d451305c522c72a009e235b11d599e8aa79314290c7973322a72d8cf8f8e146813907f4e6d1d76e502c958bddf3a81385c7019dfd987f908efd6c
+DIST qingy-1.0.0-screensavers.patch.gz 17372 SHA256 586e1d6e615252d7870789ed2a8438ca3a97efa5ecd71806811aa81dde7c5841 SHA512 563a146acf92d7a4757abd8f537ca912882501d4ef407a3f0ce44f2b334da2872edafe8b489acfc6e4fdafefb60992f8ca13c322047311e5ff16eed091827d64 WHIRLPOOL 18389cf6666e1ae8a4df700c8ee9bec1ed3eec8e3d4342ea837bc45ffccbaeaa53686961732882707e92df59c010f2a8c9ee5a33737b8eb86a6c5eb9742b6b75
+DIST qingy-1.0.0.tar.bz2 611393 SHA256 de4b4b398d5ba81ab2544729864676a04ddc6ae818b357ee09a8770293740cd3 SHA512 79af86de9d1530f429f21a32ef6542987f62f6b5461fe5ba6553deb4fcf36d5746cdb3c6ae8d7c08ace298dd4304cb90a11203239ac7f5c2093c3c5b80f34b54 WHIRLPOOL 6282fc649d2be91adae544732cef0e10ca77083b18c9cd2fdd3c6369061f797903e98bac34e01095ed7e060a3f12845d6d5523f3ff9e7979c3105dc8388aa24c
+DIST qingy-gentoo-theme-2.1.tar.bz2 150702 SHA256 1b770255577ed3fc89e1cfdf5019990bf4deffab26201e095084dd5bd97bf093 SHA512 4e5e35f3f14c831e3a383e846018cd39b07761c7f1977f94923ae8889383a3cc5f63cd061b85174c076488e697018ff58bdac3ddaeefab352a3058700a130abd WHIRLPOOL 2ef7e404a1e14229c895cb96de0dd3749e0e9837b884f2f16b71a741140586a56f52a85d2e942bc2963af2ea174d134d811e72655995285f827a16df9c671147
diff --git a/sys-apps/qingy/files/50qingy-gentoo.el b/sys-apps/qingy/files/50qingy-gentoo.el
new file mode 100644
index 000000000000..bcb814bda0b7
--- /dev/null
+++ b/sys-apps/qingy/files/50qingy-gentoo.el
@@ -0,0 +1,7 @@
+
+;; qingy site initialisation file
+
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'qingy-mode "qingy-mode"
+ "Major mode for editing Qingy settings and themes" t)
+(add-to-list 'auto-mode-alist '("/\\(?:settings\\|theme\\)$" . qingy-mode))
diff --git a/sys-apps/qingy/files/qingy-1.0.0-tinfo.patch b/sys-apps/qingy/files/qingy-1.0.0-tinfo.patch
new file mode 100644
index 000000000000..f752996c92f5
--- /dev/null
+++ b/sys-apps/qingy/files/qingy-1.0.0-tinfo.patch
@@ -0,0 +1,42 @@
+Use ncurses.pc to get Libs: instead of using AC_CHECK_LIB because ncurses can be configured
+to have separate termcap library called libtinfo; and we need both -ltinfo and -lncurses for
+linking since symbols are used from both
+
+http://bugs.gentoo.org/459650
+
+--- configure.in
++++ configure.in
+@@ -125,12 +125,7 @@
+ # End compile emacs stuff
+
+ # Check for ncurses
+- HEADERS="curses.h term.h"
+- NCURSESLIB=""
+- AC_CHECK_HEADERS([$HEADERS],,[AC_MSG_ERROR([$HEADERS_ERROR_MESSAGE])],)
+- AC_CHECK_LIB(ncurses, setupterm, [NCURSESLIB="-lncurses"],[AC_MSG_ERROR([$LIBRARIES_ERROR_MESSAGE])] , )
+- AC_CHECK_LIB(ncurses, tputs, [NCURSESLIB="-lncurses"],[AC_MSG_ERROR([$LIBRARIES_ERROR_MESSAGE])] , )
+- AC_SUBST(NCURSESLIB)
++ PKG_CHECK_MODULES(NCURSES, ncurses, [], [AC_MSG_ERROR([$LIBRARIES_ERROR_MESSAGE])])
+ # End check for ncurses
+
+ # Check for PAM support
+--- src/libraries/Makefile.am
++++ src/libraries/Makefile.am
+@@ -4,7 +4,7 @@
+ INCLUDES = -I../.. -I../
+ BUILT_SOURCES = parse_settings.h
+
+-AM_CFLAGS = -DSETTINGS_DIR=\"$(sysconfdir)/qingy\" -DSBINDIR=\"$(sbindir)/\"
++AM_CFLAGS = -DSETTINGS_DIR=\"$(sysconfdir)/qingy\" -DSBINDIR=\"$(sbindir)/\" $(NCURSES_CFLAGS)
+
+ if !WANT_STATIC
+ pkglib_LTLIBRARIES = libqingy.la
+@@ -35,7 +35,7 @@
+ EXTRA_libqingy_la_SOURCES = \
+ crypto_openssl.c crypto_libgcrypt.c crypto.h
+
+-libqingy_la_LIBADD = @PASSWDLIB@ @CRYPTOLIB@ @NCURSESLIB@ @XLIBS@
++libqingy_la_LIBADD = @PASSWDLIB@ @CRYPTOLIB@ @XLIBS@ $(NCURSES_LIBS)
+ libqingy_la_LDFLAGS = -release @VERSION@
+
+ libqingy_static_la_SOURCES = $(libqingy_la_SOURCES)
diff --git a/sys-apps/qingy/files/qingy-logrotate b/sys-apps/qingy/files/qingy-logrotate
new file mode 100644
index 000000000000..f4acb30bc657
--- /dev/null
+++ b/sys-apps/qingy/files/qingy-logrotate
@@ -0,0 +1,6 @@
+/var/log/qingy.log {
+ missingok
+ rotate 5
+ size 100k
+ weekly
+}
diff --git a/sys-apps/qingy/files/qingy_at.service b/sys-apps/qingy/files/qingy_at.service
new file mode 100644
index 000000000000..b321d224a152
--- /dev/null
+++ b/sys-apps/qingy/files/qingy_at.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Qingy on %I
+Documentation=info:qingy
+After=systemd-user-sessions.service plymouth-quit-wait.service
+
+[Service]
+Environment=TERM=linux
+ExecStart=/sbin/qingy %I -n
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+KillMode=process
+IgnoreSIGPIPE=no
+
+[Install]
+Alias=getty.target.wants/qingy@tty1.service
diff --git a/sys-apps/qingy/metadata.xml b/sys-apps/qingy/metadata.xml
new file mode 100644
index 000000000000..0ed2678f8537
--- /dev/null
+++ b/sys-apps/qingy/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>
+ <use>
+ <flag name="consolekit">Enable native consolekit support</flag>
+ <flag name="opensslcrypt">Encrypt communications between qingy and its GUI
+ using <pkg>dev-libs/openssl</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">qingy</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/qingy/qingy-1.0.0-r1.ebuild b/sys-apps/qingy/qingy-1.0.0-r1.ebuild
new file mode 100644
index 000000000000..28df23839ab8
--- /dev/null
+++ b/sys-apps/qingy/qingy-1.0.0-r1.ebuild
@@ -0,0 +1,132 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools elisp-common eutils pam
+
+GENTOO_THEME_VERSION=2.1
+
+DESCRIPTION="a DirectFB getty replacement"
+HOMEPAGE="http://qingy.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2
+ http://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-screensavers.patch.gz
+ http://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-consolekit-pam.patch.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="consolekit crypt directfb emacs gpm opensslcrypt pam static X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7:=
+ opensslcrypt? ( dev-libs/openssl:0= )
+ crypt? ( >=dev-libs/libgcrypt-1.2.1:0= )
+ directfb? ( >=dev-libs/DirectFB-1.4.2[fbcon,jpeg,png,truetype] )
+ emacs? ( virtual/emacs )
+ pam? ( >=sys-libs/pam-0.75-r11 )
+ X? (
+ x11-libs/libX11:=
+ x11-libs/libXScrnSaver:=
+ x11-proto/scrnsaverproto
+ )"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4.1.4-r1
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ consolekit? (
+ sys-auth/consolekit
+ sys-apps/dbus )
+ pam? ( sys-auth/pambase )"
+
+SITEFILE=50${PN}-gentoo.el
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-tinfo.patch
+ # bug #359637 and bug #462634 - fixes from upstream
+ epatch "${DISTDIR}"/${P}-screensavers.patch.gz
+ # bug #372675 - fix from upstream
+ epatch "${DISTDIR}"/${P}-consolekit-pam.patch.gz
+ eautoreconf
+}
+
+src_configure() {
+ local crypto_support="--disable-crypto"
+ local emacs_support="--disable-emacs --without-lispdir"
+
+ if use crypt && use opensslcrypt; then
+ echo
+ ewarn "You can have openssl or libgcrypt as a crypto library, not both."
+ ewarn "Using libgcrypt now..."
+ echo
+ fi
+
+ use emacs && emacs_support="--enable-emacs --with-lispdir=${SITELISP}/${PN}"
+ use opensslcrypt && crypto_support="--enable-crypto=openssl"
+ use crypt && crypto_support="--enable-crypto=libgcrypt"
+ econf \
+ --sbindir=/sbin \
+ --disable-optimizations \
+ $(use_enable consolekit) \
+ $(use_enable pam) \
+ $(use_enable static static-build) \
+ $(use_enable gpm gpm-lock) \
+ $(use_enable X x-support) \
+ $(use_enable directfb DirectFB-support ) \
+ ${crypto_support} \
+ ${emacs_support}
+}
+
+src_install() {
+ # Copy documentation manually as make install only installs info files
+ # INSTALL is left because it contains also configuration informations
+ dodoc AUTHORS ChangeLog INSTALL NEWS README THANKS TODO
+
+ # Install the program
+ emake DESTDIR="${D}" install
+
+ # Set the settings file umask to 600, in case somebody
+ # wants to make use of the autologin feature
+ /bin/chmod 600 "${D}"/etc/qingy/settings
+
+ # Install Gentoo theme
+ dodir /usr/share/${PN}/themes/gentoo
+ cp "${WORKDIR}"/gentoo/* "${D}"/usr/share/${PN}/themes/gentoo || die
+
+ # Alter config file so that it uses our theme
+ sed -i 's/theme = "default"/theme = "gentoo"/' "${D}"/etc/${PN}/settings
+
+ # Install log rotation policy
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}-logrotate ${PN}
+
+ use emacs && elisp-site-file-install "${FILESDIR}"/${SITEFILE}
+
+ rm "${D}"/etc/pam.d/qingy
+ pamd_mimic system-local-login qingy auth account password session
+}
+
+pkg_postinst() {
+ einfo "In order to use qingy you must first edit your /etc/inittab"
+ einfo "Check the documentation at ${HOMEPAGE}"
+ einfo "for instructions on how to do that."
+ echo
+ einfo "Also, make sure to adjust qingy settings file (/etc/qingy/settings)"
+ einfo "to your preferences/machine configuration..."
+
+ if use crypt; then
+ echo
+ einfo "You will have to create a key pair using 'qingy-keygen'"
+ echo
+ ewarn "Note that sometimes a generated key-pair may pass the internal tests"
+ ewarn "but fail to work properly. You will get a 'regenerate your keys'"
+ ewarn "message. If this is your case, please remove /etc/qingy/public_key"
+ ewarn "and /etc/qingy/private_key and run qingy-keygen again..."
+ fi
+
+ use emacs && echo && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-apps/qingy/qingy-1.0.0-r2.ebuild b/sys-apps/qingy/qingy-1.0.0-r2.ebuild
new file mode 100644
index 000000000000..2b5951b29369
--- /dev/null
+++ b/sys-apps/qingy/qingy-1.0.0-r2.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools elisp-common eutils pam systemd
+
+GENTOO_THEME_VERSION=2.1
+
+DESCRIPTION="a DirectFB getty replacement"
+HOMEPAGE="http://qingy.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2
+ http://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-screensavers.patch.gz
+ http://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-consolekit-pam.patch.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="consolekit crypt directfb emacs gpm opensslcrypt pam static X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7:=
+ opensslcrypt? ( dev-libs/openssl:0= )
+ crypt? ( >=dev-libs/libgcrypt-1.2.1:0= )
+ directfb? ( >=dev-libs/DirectFB-1.4.2[fbcon,jpeg,png,truetype] )
+ emacs? ( virtual/emacs )
+ pam? ( >=sys-libs/pam-0.75-r11 )
+ X? (
+ x11-libs/libX11:=
+ x11-libs/libXScrnSaver:=
+ x11-proto/scrnsaverproto
+ )"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4.1.4-r1
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ consolekit? (
+ sys-auth/consolekit
+ sys-apps/dbus )
+ pam? ( sys-auth/pambase )"
+
+SITEFILE=50${PN}-gentoo.el
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-tinfo.patch
+ # bug #359637 and bug #462634 - fixes from upstream
+ epatch "${DISTDIR}"/${P}-screensavers.patch.gz
+ # bug #372675 - fix from upstream
+ epatch "${DISTDIR}"/${P}-consolekit-pam.patch.gz
+ eautoreconf
+}
+
+src_configure() {
+ local crypto_support="--disable-crypto"
+ local emacs_support="--disable-emacs --without-lispdir"
+
+ if use crypt && use opensslcrypt; then
+ echo
+ ewarn "You can have openssl or libgcrypt as a crypto library, not both."
+ ewarn "Using libgcrypt now..."
+ echo
+ fi
+
+ use emacs && emacs_support="--enable-emacs --with-lispdir=${SITELISP}/${PN}"
+ use opensslcrypt && crypto_support="--enable-crypto=openssl"
+ use crypt && crypto_support="--enable-crypto=libgcrypt"
+ econf \
+ --sbindir=/sbin \
+ --disable-optimizations \
+ $(use_enable consolekit) \
+ $(use_enable pam) \
+ $(use_enable static static-build) \
+ $(use_enable gpm gpm-lock) \
+ $(use_enable X x-support) \
+ $(use_enable directfb DirectFB-support ) \
+ ${crypto_support} \
+ ${emacs_support}
+}
+
+src_install() {
+ # Copy documentation manually as make install only installs info files
+ # INSTALL is left because it contains also configuration informations
+ dodoc AUTHORS ChangeLog INSTALL NEWS README THANKS TODO
+
+ # Install the program
+ emake DESTDIR="${D}" install
+
+ # Set the settings file umask to 600, in case somebody
+ # wants to make use of the autologin feature
+ /bin/chmod 600 "${D}"/etc/qingy/settings
+
+ # Install Gentoo theme
+ dodir /usr/share/${PN}/themes/gentoo
+ cp "${WORKDIR}"/gentoo/* "${D}"/usr/share/${PN}/themes/gentoo || die
+
+ # Alter config file so that it uses our theme
+ sed -i 's/theme = "default"/theme = "gentoo"/' "${D}"/etc/${PN}/settings
+
+ # Install log rotation policy
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}-logrotate ${PN}
+
+ use emacs && elisp-site-file-install "${FILESDIR}"/${SITEFILE}
+
+ rm "${D}"/etc/pam.d/qingy
+ pamd_mimic system-local-login qingy auth account password session
+
+ systemd_newunit "${FILESDIR}/${PN}_at.service" "${PN}@.service"
+}
+
+pkg_postinst() {
+ einfo "In order to use qingy you must first edit your /etc/inittab"
+ einfo "Check the documentation at ${HOMEPAGE}"
+ einfo "for instructions on how to do that."
+ echo
+ einfo "Also, make sure to adjust qingy settings file (/etc/qingy/settings)"
+ einfo "to your preferences/machine configuration..."
+
+ if use crypt; then
+ echo
+ einfo "You will have to create a key pair using 'qingy-keygen'"
+ echo
+ ewarn "Note that sometimes a generated key-pair may pass the internal tests"
+ ewarn "but fail to work properly. You will get a 'regenerate your keys'"
+ ewarn "message. If this is your case, please remove /etc/qingy/public_key"
+ ewarn "and /etc/qingy/private_key and run qingy-keygen again..."
+ fi
+
+ use emacs && echo && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-apps/qingy/qingy-1.0.0.ebuild b/sys-apps/qingy/qingy-1.0.0.ebuild
new file mode 100644
index 000000000000..f1d5674546e4
--- /dev/null
+++ b/sys-apps/qingy/qingy-1.0.0.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit autotools elisp-common eutils pam
+
+GENTOO_THEME_VERSION=2.1
+
+DESCRIPTION="a DirectFB getty replacement"
+HOMEPAGE="http://qingy.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ mirror://gentoo/${PN}-gentoo-theme-${GENTOO_THEME_VERSION}.tar.bz2
+ http://dev.gentoo.org/~gienah/2big4tree/sys-apps/qingy/${P}-screensavers.patch.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="crypt directfb emacs gpm opensslcrypt pam static X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7:=
+ opensslcrypt? ( dev-libs/openssl:0= )
+ crypt? ( >=dev-libs/libgcrypt-1.2.1:0= )
+ directfb? ( >=dev-libs/DirectFB-1.4.2[fbcon,jpeg,png,truetype] )
+ emacs? ( virtual/emacs )
+ pam? ( >=sys-libs/pam-0.75-r11 )
+ X? (
+ x11-libs/libX11:=
+ x11-libs/libXScrnSaver:=
+ x11-proto/scrnsaverproto
+ )"
+DEPEND="${RDEPEND}
+ >=sys-apps/sed-4.1.4-r1
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ pam? ( sys-auth/pambase )"
+
+SITEFILE=50${PN}-gentoo.el
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-tinfo.patch
+ # bug #359637 and bug #462634 - fixes from upstream
+ epatch "${DISTDIR}"/${P}-screensavers.patch.gz
+ eautoreconf
+}
+
+src_configure() {
+ local crypto_support="--disable-crypto"
+ local emacs_support="--disable-emacs --without-lispdir"
+
+ if use crypt && use opensslcrypt; then
+ echo
+ ewarn "You can have openssl or libgcrypt as a crypto library, not both."
+ ewarn "Using libgcrypt now..."
+ echo
+ fi
+
+ use emacs && emacs_support="--enable-emacs --with-lispdir=${SITELISP}/${PN}"
+ use opensslcrypt && crypto_support="--enable-crypto=openssl"
+ use crypt && crypto_support="--enable-crypto=libgcrypt"
+ econf \
+ --sbindir=/sbin \
+ --disable-optimizations \
+ $(use_enable pam) \
+ $(use_enable static static-build) \
+ $(use_enable gpm gpm-lock) \
+ $(use_enable X x-support) \
+ $(use_enable directfb DirectFB-support ) \
+ ${crypto_support} \
+ ${emacs_support}
+}
+
+src_install() {
+ # Copy documentation manually as make install only installs info files
+ # INSTALL is left because it contains also configuration informations
+ dodoc AUTHORS ChangeLog INSTALL NEWS README THANKS TODO
+
+ # Install the program
+ emake DESTDIR="${D}" install
+
+ # Set the settings file umask to 600, in case somebody
+ # wants to make use of the autologin feature
+ /bin/chmod 600 "${D}"/etc/qingy/settings
+
+ # Install Gentoo theme
+ dodir /usr/share/${PN}/themes/gentoo
+ cp "${WORKDIR}"/gentoo/* "${D}"/usr/share/${PN}/themes/gentoo || die
+
+ # Alter config file so that it uses our theme
+ sed -i 's/theme = "default"/theme = "gentoo"/' "${D}"/etc/${PN}/settings
+
+ # Install log rotation policy
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}-logrotate ${PN}
+
+ use emacs && elisp-site-file-install "${FILESDIR}"/${SITEFILE}
+
+ rm "${D}"/etc/pam.d/qingy
+ pamd_mimic system-local-login qingy auth account password session
+}
+
+pkg_postinst() {
+ einfo "In order to use qingy you must first edit your /etc/inittab"
+ einfo "Check the documentation at ${HOMEPAGE}"
+ einfo "for instructions on how to do that."
+ echo
+ einfo "Also, make sure to adjust qingy settings file (/etc/qingy/settings)"
+ einfo "to your preferences/machine configuration..."
+
+ if use crypt; then
+ echo
+ einfo "You will have to create a key pair using 'qingy-keygen'"
+ echo
+ ewarn "Note that sometimes a generated key-pair may pass the internal tests"
+ ewarn "but fail to work properly. You will get a 'regenerate your keys'"
+ ewarn "message. If this is your case, please remove /etc/qingy/public_key"
+ ewarn "and /etc/qingy/private_key and run qingy-keygen again..."
+ fi
+
+ use emacs && echo && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-apps/raidutils/Manifest b/sys-apps/raidutils/Manifest
new file mode 100644
index 000000000000..5e949cda93ef
--- /dev/null
+++ b/sys-apps/raidutils/Manifest
@@ -0,0 +1,2 @@
+DIST raidutils-0.0.6.tar.bz2 968898 SHA256 ac350f60b9635d952a7a5664effa59e418ada9ad3deba66d46e6e0a094966d65 SHA512 8d6fc74a4fc20188a00b3ea8b91048ee9108bb772efd4b1e5d141f4d674cbb9a04a76f9a414f4ae74d09d58d672e2f7aa8c1476715bf5aa94c3ec7eeb105f892 WHIRLPOOL 43dae37e8bb956bc1235397b9c7e5088edde379042f962bbdc2528007192595a1f8aaab1d88d36cff45332ae48b199c3bf2cbc238a1c3932511b4c4d159d0873
+DIST raidutils-rpm.patch.bz2 6809 SHA256 adf851e55aac1a0acf7fd47dac36bbf76396154fa6f52fb98615473139d77651 SHA512 3d0f9e4b3722e26de835dedf86e00f2f7b56a885d5ac677bc1f0fc5009f5bafaf4c3ce67ae6abf1007973edb9273acea97e40e4d5bd3244d097c60c4c39b0f91 WHIRLPOOL 0d34038e4f0f5980782af6d37deed6ef19a1ec5c6d32fd9788760400ba528fe229775436f43930f85bbf3e261e15466fe61bb17d38346312b51bfff7be6fd420
diff --git a/sys-apps/raidutils/files/raidutils-0.0.6-gcc45.patch b/sys-apps/raidutils/files/raidutils-0.0.6-gcc45.patch
new file mode 100644
index 000000000000..91c52270ee40
--- /dev/null
+++ b/sys-apps/raidutils/files/raidutils-0.0.6-gcc45.patch
@@ -0,0 +1,14 @@
+--- raidutil/flash.cpp
++++ raidutil/flash.cpp
+@@ -177,11 +177,7 @@
+ {
+ ENTER( "Flash::Flash(" );
+
+-#if defined _DPT_UNIXWARE || defined _DPT_SCO
+ Flash( right.source, right.Resync, right.hba_Num );
+-#else
+- Flash::Flash( right.source, right.Resync, right.hba_Num );
+-#endif
+
+ EXIT();
+ }
diff --git a/sys-apps/raidutils/metadata.xml b/sys-apps/raidutils/metadata.xml
new file mode 100644
index 000000000000..a05cc354f72f
--- /dev/null
+++ b/sys-apps/raidutils/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ Suite of programs to manage some I2O-compliant RAID controllers; in
+ particular some Adaptec hardware; to be very specific those using the
+ dpt_i2o kernel module or CONFIG_SCSI_DPT_I2O driver. One can create/delete a
+ RAID array, add/remove a hot spare drive to/from an array, activate/silence
+ the alarm, and query array/disk status.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/raidutils/raidutils-0.0.6-r2.ebuild b/sys-apps/raidutils/raidutils-0.0.6-r2.ebuild
new file mode 100644
index 000000000000..cf9650d77487
--- /dev/null
+++ b/sys-apps/raidutils/raidutils-0.0.6-r2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Utilities to manage i2o/dtp RAID controllers"
+HOMEPAGE="http://i2o.shadowconnect.com/"
+# http://cvs.fedoraproject.org/viewvc/rpms/raidutils/devel/
+SRC_URI="http://i2o.shadowconnect.com/raidutils/${P}.tar.bz2
+ mirror://gentoo/${PN}-rpm.patch.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="static-libs"
+
+DEPEND=">=sys-kernel/linux-headers-2.6"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${WORKDIR}"/${PN}-rpm.patch \
+ "${FILESDIR}"/${P}-gcc45.patch
+}
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ $(use_enable static-libs static)
+}
+
+src_compile() {
+ emake -j1 || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS
+ find "${D}" -name '*.la' -delete
+}
diff --git a/sys-apps/razercfg/Manifest b/sys-apps/razercfg/Manifest
new file mode 100644
index 000000000000..e95bed526192
--- /dev/null
+++ b/sys-apps/razercfg/Manifest
@@ -0,0 +1,8 @@
+DIST razercfg-0.23.tar.bz2 69425 SHA256 44bdc48588c504a937d811e84a0ecb054e35d3e2e4980d7d76b3ea8c2f0d1b43 SHA512 79c795870efa960b42abc70710b4bebe793acb9e732943207ca4b34d35ba926af4877993db888829dbacedbe327324fba0ab2ef82ced1d653b4aee23e154fd8b WHIRLPOOL 11c57842daeb241d19b3546db0c4b3a98e59b565176f89227dd159f31b3037ce08130014dc35ae4db5dc81744a94a405252787b6a42c67129857f81f6eb0411c
+DIST razercfg-0.24.tar.bz2 69302 SHA256 dd47e370a440c485e888a1f66bec467fffb2833db8ea433d102c5c12f914cccf SHA512 a86614d1ac1ab5cf329bea36c9b7d974d4de9d7014bccbd55cf45a7b2c72b312ce6d74680127af97413344c77148b9b51614949bcb8e483b18dbbf4f5d5a7cf9 WHIRLPOOL 2e4c277083aea3cfb9ca64a88874e57329d8f924f4b664575d3678e1123e424d4d462920d042e8b2c20c7fc305060979b8e7e4eb89fc0e026ba45c1e9699ab4a
+DIST razercfg-0.25.tar.bz2 69489 SHA256 a826d9793ad5be5048a227f4c23c168e554cbb939e67584dd5e5a4f63a4829f9 SHA512 70b5252563567faa10a7b3b5cd2a93e89d0a77511f6335a1888dd3cc999b88c1328b0a03bd4b2c990abae5aff0b63de252cb4fd0e5a9afde1c7ca375a33f7203 WHIRLPOOL 3e8b577efbaf3c28baec528a226f4b3ab631de795207c277b81fced841dec3aaaed3882b3efabbbca7997f8b2b6eedb749950ab159c7b2f0f00a5cd71d4a1feb
+DIST razercfg-0.26.tar.bz2 70843 SHA256 79c8f9d39033ef65bd1b33086c08a05026ba07ee04c5445b41a4981c070cadf8 SHA512 6e6c60f31ceaf6189c6dfd0b90d9dab4a262dcc184429f7bbf2a8e1f54e3c1a012615d676312acc964a0f7942a47f8479985a3677f656afa12903c54d6aee056 WHIRLPOOL 3ba9fdfaea4533f312d2d281b4425ca66691e184dbd5769fa141b468febf6f5dba1016f77b076ab74a5ff934ad866204483b0570bb9f8d76dddd588ea43d9608
+DIST razercfg-0.29.tar.bz2 71786 SHA256 b737b4335808cb36b95019678554adea278f9295c5b53e958424c82fce529fbf SHA512 04d64023955dc08cf9b33c02542b596eb18372be3b259591ff59de85510846bca919c370180c3e997632e78785cdf42aa4d2cbeab0bceb09ab694d0b4e84362f WHIRLPOOL 2afe6e15e8b91771548ae94a51b511a901a68b1a31d9a4e840cfc5d4120226dc785a7c7d64e154a1a2c0070fa118736ad72ad49d5497e8f386fce633e6da2a46
+DIST razercfg-0.30.tar.bz2 71779 SHA256 bfc4dc858be5627833aa1ae1cdbbf1a85b77afaed5d61113de4bd6e8797ca527 SHA512 090e8efcccc65d6c94fe23033046148669cd089c23287dbe4c7d9eaf655f1ee7c8a2e6a5bc118af0088bced1674a45f12af46331796768790367a38ed24a1590 WHIRLPOOL e41e063fdd8da1bf78fe97af6f4d4fffefb068c81a2dd5219e9f488e498b166dacbd1fa358826e90e0a996005d01223ae0475a28b434cab0d760c0c0d277f8b1
+DIST razercfg-0.31.tar.bz2 77741 SHA256 f43b7de119e4e9333c17aacfd800e30598e7958c11ad82fddcaf9bda5c1dc3f6 SHA512 8173631f3b2dcc0e2da94aa9b1e6e86c4c296a7e8faf5e534dbbbd47a57e80f0af258143644fc498c9beb0c088b7ecf61e7af0e27e2b6760af009f58a639a0bb WHIRLPOOL 6f7d0bbefbb4284d4e35ef753ebfa93b8c08eb277930cc86af7776ea1147d97ee23c53a75bb55958b2050290548aa975ab4e9f457b03ff95d602474ad7bfdd22
+DIST razercfg-0.32.tar.bz2 77778 SHA256 753c9b8cc60e3b5481d65d168d0d0f2737e83e2dacbbeb2684517a096064e2e1 SHA512 696baf66eec5d241918a073bd381018cb60bbccaa95e5889059e2b5f6ccc03270e1d414d947358d672cfa4a5a01a9e36e5f92d706807d6a7c2c3f8e2797d38f7 WHIRLPOOL 7761f88671cfde24ca9a705df658118bf5b69244c1fae8bf358601159203dcbd2f7774552c3fb794268e0031c4a4092c5848d6f324fb029b03551c49ba161f0a
diff --git a/sys-apps/razercfg/files/razerd.init.d b/sys-apps/razercfg/files/razerd.init.d
new file mode 100644
index 000000000000..86847b24468a
--- /dev/null
+++ b/sys-apps/razercfg/files/razerd.init.d
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+}
+
+PIDFILE=/var/run/razerd/razerd.pid
+
+start() {
+ ebegin "Starting razerd"
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec /usr/sbin/razerd \
+ -- --background --pidfile ${PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping razerd"
+ start-stop-daemon --stop --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/sys-apps/razercfg/files/razerd.init.d-r1 b/sys-apps/razercfg/files/razerd.init.d-r1
new file mode 100644
index 000000000000..8c3c8f4d3816
--- /dev/null
+++ b/sys-apps/razercfg/files/razerd.init.d-r1
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+}
+
+PIDFILE=/run/razerd/razerd.pid
+
+start() {
+ ebegin "Starting razerd"
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec /usr/sbin/razerd \
+ -- --background --pidfile ${PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping razerd"
+ start-stop-daemon --stop --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/sys-apps/razercfg/files/razerd.init.d-r2 b/sys-apps/razercfg/files/razerd.init.d-r2
new file mode 100644
index 000000000000..4fab076cd206
--- /dev/null
+++ b/sys-apps/razercfg/files/razerd.init.d-r2
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use logger
+}
+
+PIDFILE=/run/razerd/razerd.pid
+
+start() {
+ ebegin "Starting razerd"
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --exec /usr/bin/razerd \
+ -- --background --pidfile ${PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping razerd"
+ start-stop-daemon --stop --pidfile ${PIDFILE}
+ eend $?
+}
+
diff --git a/sys-apps/razercfg/metadata.xml b/sys-apps/razercfg/metadata.xml
new file mode 100644
index 000000000000..98006eca5a09
--- /dev/null
+++ b/sys-apps/razercfg/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>joker@gentoo.org</email>
+<name>Christian Birchinger</name>
+</maintainer>
+<longdescription>
+Utility to for advanced configuration of the following Razer mice: Copperhead
+Lachesis (Classic), DeathAdder (Classic, 3500 DPI, Black Edition, 2013), Taipan
+Naga (Classic, 2012, 2014, Hex), Krait, Boomslang CE. The tool architecture is
+based on "razerd", which is a background daemon doing all of the lowlevel
+privilege hardware accesses. The user interface tools are "razercfg", a
+commandline tool; and "qrazercfg", a QT4 based graphical device configuration
+tool.
+</longdescription>
+<use>
+ <flag name='pm-utils'>Installs the pm-utils hooks for suspend/resume and
+ requires <pkg>sys-power/pm-utils</pkg></flag>
+ <flag name='qt4'>Installs a qt UI. Requires <pkg>dev-python/pyside</pkg></flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/razercfg/razercfg-0.23.ebuild b/sys-apps/razercfg/razercfg-0.23.ebuild
new file mode 100644
index 000000000000..06f6fb907e1a
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.23.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 x86"
+IUSE="+pm-utils qt4"
+
+RDEPEND="${DEPEND}
+ pm-utils? ( sys-power/pm-utils )
+ qt4? ( dev-python/PyQt4 )"
+
+DEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e '/udevadm control/{N;d}' \
+ -e "s:/etc/udev/rules.d/:$(get_udevdir)/rules.d/:" \
+ -e 's:01-razer-udev.rules:40-razercfg.rules:' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r1 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+
+ python_fix_shebang "${ED}"usr/bin
+}
+
+pkg_postinst() {
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+}
diff --git a/sys-apps/razercfg/razercfg-0.24.ebuild b/sys-apps/razercfg/razercfg-0.24.ebuild
new file mode 100644
index 000000000000..f039583bba15
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.24.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4"
+
+RDEPEND="${DEPEND}
+ pm-utils? ( sys-power/pm-utils )
+ qt4? ( dev-python/PyQt4 )"
+
+DEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e '/udevadm control/{N;d}' \
+ -e "s:/etc/udev/rules.d/:$(get_udevdir)/rules.d/:" \
+ -e 's:01-razer-udev.rules:40-razercfg.rules:' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+
+ # Fixed in upstream git 106edc5dbe4dff2825f6126528afc2268d92158e
+ sed -i \
+ -e 's:$$INSTDIR$$/bin/:$$INSTDIR$$/sbin/:' \
+ razerd.service.template \
+ || die "sed failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r1 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+
+ python_fix_shebang "${ED}"usr/bin
+}
+
+pkg_postinst() {
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+}
diff --git a/sys-apps/razercfg/razercfg-0.25.ebuild b/sys-apps/razercfg/razercfg-0.25.ebuild
new file mode 100644
index 000000000000..1ea43b15813a
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.25.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4"
+
+RDEPEND="${DEPEND}
+ pm-utils? ( sys-power/pm-utils )
+ qt4? ( dev-python/PyQt4 )"
+
+DEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e '/udevadm control/{N;d}' \
+ -e "s:/etc/udev/rules.d/:$(get_udevdir)/rules.d/:" \
+ -e 's:01-razer-udev.rules:40-razercfg.rules:' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r1 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+
+ python_fix_shebang "${ED}"usr/bin
+}
+
+pkg_postinst() {
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+}
diff --git a/sys-apps/razercfg/razercfg-0.26.ebuild b/sys-apps/razercfg/razercfg-0.26.ebuild
new file mode 100644
index 000000000000..34e55b73d8e7
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.26.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python3_3 )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4"
+
+RDEPEND="qt4? ( >=dev-python/pyside-1.2.1[${PYTHON_USEDEP}] )
+ pm-utils? ( sys-power/pm-utils )"
+
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+src_prepare() {
+ sed -i \
+ -e '/udevadm control/{N;d}' \
+ -e '/systemctl/{N;d}' \
+ -e "s:/etc/udev/rules.d/:$(get_udevdir)/rules.d/:" \
+ -e 's:01-razer-udev.rules:40-razercfg.rules:' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ CMakeLists.txt \
+ || die "sed failed"
+
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e "s:DESTINATION lib:DESTINATION $(get_libdir):" \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} -DPYTHON='${PYTHON}'"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r2 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+}
+
+pkg_postinst() {
+ udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ if [[ -e "${ROOT}"usr/bin/pyrazer.pyc ]]; then
+ echo
+ eerror "A stale ${ROOT}usr/bin/pyrazer.pyc exists and will prevent"
+ eerror "the Python frontends from working until removed manually."
+ echo
+ fi
+}
diff --git a/sys-apps/razercfg/razercfg-0.29.ebuild b/sys-apps/razercfg/razercfg-0.29.ebuild
new file mode 100644
index 000000000000..1b5466b59036
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.29.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python3_3 )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4 systemd +udev"
+
+RDEPEND="qt4? ( >=dev-python/pyside-1.2.1[${PYTHON_USEDEP}] )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/udev )
+ pm-utils? ( sys-power/pm-utils )"
+
+DEPEND="virtual/pkgconfig
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+
+src_prepare() {
+ sed -i \
+ -e '/udevadm control/{N;d}' \
+ -e '/systemctl/{N;d}' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ CMakeLists.txt \
+ || die "sed failed"
+
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e "s:DESTINATION lib:DESTINATION $(get_libdir):" \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} -DPYTHON='${PYTHON}'"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r2 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+}
+
+pkg_postinst() {
+ use udev && udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ if [[ -e "${ROOT}"usr/bin/pyrazer.pyc ]]; then
+ echo
+ eerror "A stale ${ROOT}usr/bin/pyrazer.pyc exists and will prevent"
+ eerror "the Python frontends from working until removed manually."
+ echo
+ fi
+}
diff --git a/sys-apps/razercfg/razercfg-0.30.ebuild b/sys-apps/razercfg/razercfg-0.30.ebuild
new file mode 100644
index 000000000000..876c8ba0757d
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.30.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{3_3,3_4} )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4 systemd +udev"
+
+RDEPEND="qt4? ( >=dev-python/pyside-1.2.1[${PYTHON_USEDEP}] )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/udev )
+ pm-utils? ( sys-power/pm-utils )
+ virtual/libusb:1"
+
+DEPEND="virtual/pkgconfig
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ virtual/libusb:1"
+
+src_prepare() {
+ sed -i \
+ -e '/udevadm control/{N;d}' \
+ -e '/systemctl/{N;d}' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ CMakeLists.txt \
+ || die "sed failed"
+
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e "s:DESTINATION lib:DESTINATION $(get_libdir):" \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} -DPYTHON='${PYTHON}'"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r2 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+}
+
+pkg_postinst() {
+ use udev && udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ if [[ -e "${ROOT}"usr/bin/pyrazer.pyc ]]; then
+ echo
+ eerror "A stale ${ROOT}usr/bin/pyrazer.pyc exists and will prevent"
+ eerror "the Python frontends from working until removed manually."
+ echo
+ fi
+}
diff --git a/sys-apps/razercfg/razercfg-0.31.ebuild b/sys-apps/razercfg/razercfg-0.31.ebuild
new file mode 100644
index 000000000000..876c8ba0757d
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.31.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{3_3,3_4} )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4 systemd +udev"
+
+RDEPEND="qt4? ( >=dev-python/pyside-1.2.1[${PYTHON_USEDEP}] )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/udev )
+ pm-utils? ( sys-power/pm-utils )
+ virtual/libusb:1"
+
+DEPEND="virtual/pkgconfig
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ virtual/libusb:1"
+
+src_prepare() {
+ sed -i \
+ -e '/udevadm control/{N;d}' \
+ -e '/systemctl/{N;d}' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ CMakeLists.txt \
+ || die "sed failed"
+
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e "s:DESTINATION lib:DESTINATION $(get_libdir):" \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} -DPYTHON='${PYTHON}'"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r2 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+}
+
+pkg_postinst() {
+ use udev && udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ if [[ -e "${ROOT}"usr/bin/pyrazer.pyc ]]; then
+ echo
+ eerror "A stale ${ROOT}usr/bin/pyrazer.pyc exists and will prevent"
+ eerror "the Python frontends from working until removed manually."
+ echo
+ fi
+}
diff --git a/sys-apps/razercfg/razercfg-0.32.ebuild b/sys-apps/razercfg/razercfg-0.32.ebuild
new file mode 100644
index 000000000000..876c8ba0757d
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.32.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{3_3,3_4} )
+
+inherit cmake-utils multilib eutils udev python-single-r1
+
+DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
+
+HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4 systemd +udev"
+
+RDEPEND="qt4? ( >=dev-python/pyside-1.2.1[${PYTHON_USEDEP}] )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/udev )
+ pm-utils? ( sys-power/pm-utils )
+ virtual/libusb:1"
+
+DEPEND="virtual/pkgconfig
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ virtual/libusb:1"
+
+src_prepare() {
+ sed -i \
+ -e '/udevadm control/{N;d}' \
+ -e '/systemctl/{N;d}' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ CMakeLists.txt \
+ || die "sed failed"
+
+ sed -i \
+ -e '/ldconfig/{N;d}' \
+ -e "s:DESTINATION lib:DESTINATION $(get_libdir):" \
+ librazer/CMakeLists.txt \
+ || die "sed failed"
+}
+
+src_configure() {
+ mycmakeargs="${mycmakeargs} -DPYTHON='${PYTHON}'"
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+ newinitd "${FILESDIR}"/razerd.init.d-r2 razerd
+ dodoc README razer.conf
+
+ if ! use qt4; then
+ rm "${D}"/usr/bin/qrazercfg
+ else
+ make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
+ fi
+
+ use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
+}
+
+pkg_postinst() {
+ use udev && udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+
+ if [[ -e "${ROOT}"usr/bin/pyrazer.pyc ]]; then
+ echo
+ eerror "A stale ${ROOT}usr/bin/pyrazer.pyc exists and will prevent"
+ eerror "the Python frontends from working until removed manually."
+ echo
+ fi
+}
diff --git a/sys-apps/readahead-list/Manifest b/sys-apps/readahead-list/Manifest
new file mode 100644
index 000000000000..c54c0dc37f94
--- /dev/null
+++ b/sys-apps/readahead-list/Manifest
@@ -0,0 +1 @@
+DIST readahead-list-1.20060421.1016.tar.bz2 108337 SHA256 b031f92e89756f4fd19ad2860f5d6ede80e57ddd1e973376c49e43fe142a6a82
diff --git a/sys-apps/readahead-list/files/conf.d-readahead-list b/sys-apps/readahead-list/files/conf.d-readahead-list
new file mode 100644
index 000000000000..2a79bec158a8
--- /dev/null
+++ b/sys-apps/readahead-list/files/conf.d-readahead-list
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+# Copyright 2005 Robin H. Johnson <robbat2@orbis-terrarum.net>
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# this list is intended for usage very early
+READAHEAD_LIST_exec_sbin_rc="/etc/readahead-list/exec_sbin_rc"
+
+# per-runlevel
+READAHEAD_LIST_runlevel_boot="/etc/readahead-list/runlevel-boot"
+READAHEAD_LIST_runlevel_default="/etc/readahead-list/runlevel-default"
+
+READAHEAD_LIST_call_early="${!READAHEAD_LIST_exec_sbin_rc} ${!READAHEAD_LIST_runlevel_boot}"
+READAHEAD_LIST_call_main="${!READAHEAD_LIST_runlevel_default}"
+
+# vim: ts=4 sw=4
diff --git a/sys-apps/readahead-list/files/init.d-readahead-list b/sys-apps/readahead-list/files/init.d-readahead-list
new file mode 100644
index 000000000000..c2a90aceff0b
--- /dev/null
+++ b/sys-apps/readahead-list/files/init.d-readahead-list
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 2005 Robin H. Johnson <robbat2@orbis-terrarum.net>
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ after localmount
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+ before clock bootmisc consolefont keymaps rmnologin serial urandom
+}
+
+start() {
+ # force reading
+ source /etc/conf.d/readahead-list
+
+ f="${READAHEAD_LIST_call_main}"
+ ebegin "readahead(2): ${f}"
+ /sbin/readahead-list ${f}
+ eend $?
+}
+
+# vim: ts=4 sw=4
diff --git a/sys-apps/readahead-list/files/init.d-readahead-list-early b/sys-apps/readahead-list/files/init.d-readahead-list-early
new file mode 100644
index 000000000000..d6a936febb6c
--- /dev/null
+++ b/sys-apps/readahead-list/files/init.d-readahead-list-early
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 2005 Robin H. Johnson <robbat2@orbis-terrarum.net>
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+
+depend() {
+ after checkroot
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+ before hostname modules domainname crypto-loop checkfs localmount
+}
+
+start() {
+ # force reading
+ source /etc/conf.d/readahead-list
+ f="${READAHEAD_LIST_call_early}"
+ ebegin "readahead(2): ${f}"
+ /sbin/readahead-list ${f}
+ eend $?
+}
+
+# vim: ts=4 sw=4
diff --git a/sys-apps/readahead-list/files/readahead-list-1.20060421.1016-gcc-4.3.patch b/sys-apps/readahead-list/files/readahead-list-1.20060421.1016-gcc-4.3.patch
new file mode 100644
index 000000000000..6264bbad9525
--- /dev/null
+++ b/sys-apps/readahead-list/files/readahead-list-1.20060421.1016-gcc-4.3.patch
@@ -0,0 +1,10 @@
+--- src/filelist-order.cxx
++++ src/filelist-order.cxx
+@@ -19,6 +19,7 @@
+ #include <iostream>
+ #include <fstream>
+ #include <vector>
++#include <cstdlib>
+
+ #include <assert.h>
+ #include <string.h>
diff --git a/sys-apps/readahead-list/metadata.xml b/sys-apps/readahead-list/metadata.xml
new file mode 100644
index 000000000000..c530161e6cdb
--- /dev/null
+++ b/sys-apps/readahead-list/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>Upstream author as well as maintainer for Gentoo.</description>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/readahead-list/readahead-list-1.20060421.1016-r1.ebuild b/sys-apps/readahead-list/readahead-list-1.20060421.1016-r1.ebuild
new file mode 100644
index 000000000000..5f5d38b9e3bf
--- /dev/null
+++ b/sys-apps/readahead-list/readahead-list-1.20060421.1016-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit base
+
+DESCRIPTION="Preloads files into the page cache to accelerate program loading"
+HOMEPAGE="http://www.orbis-terrarum.net"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+PATCHES=( "${FILESDIR}/${P}-gcc-4.3.patch" )
+
+src_compile() {
+ econf --sbindir=/sbin || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ # init scripts
+ #cd "${S}/contrib/init/gentoo/"
+ newinitd "${FILESDIR}"/init.d-readahead-list readahead-list
+ newinitd "${FILESDIR}"/init.d-readahead-list-early readahead-list-early
+ newconfd "${FILESDIR}"/conf.d-readahead-list readahead-list
+
+ # default config
+ insinto /etc/readahead-list
+ cd "${S}/contrib/data"
+ newins readahead.runlevel-default.list runlevel-default
+ newins readahead.runlevel-boot.list runlevel-boot
+ newins readahead._sbin_rc.list exec_sbin_rc
+
+ # docs
+ cd "${S}"
+ dodoc README
+ if use doc; then
+ docinto scripts
+ dodoc contrib/scripts/*
+ fi
+ # clean up a bit
+ find "${D}/usr/share/doc/${PF}/" -type f -name 'Makefile*' -exec rm -f \{\} \;
+}
+
+pkg_postinst() {
+ einfo "You should add readahead-list to your runlevels:"
+ einfo " rc-update add readahead-list-early boot"
+ einfo " rc-update add readahead-list boot"
+ einfo "Also consider customizing the lists in /etc/readahead-list"
+ einfo "for maximum performance gain."
+}
diff --git a/sys-apps/readahead-list/readahead-list-1.20060421.1016.ebuild b/sys-apps/readahead-list/readahead-list-1.20060421.1016.ebuild
new file mode 100644
index 000000000000..8b39923d5ca9
--- /dev/null
+++ b/sys-apps/readahead-list/readahead-list-1.20060421.1016.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit base
+
+DESCRIPTION="Preloads files into the page cache to accelerate program loading"
+HOMEPAGE="http://www.orbis-terrarum.net"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="doc"
+
+# I'm not entirely certain about this
+# need to check if other libc variants provide readahead(2)
+RDEPEND=""
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+PATCHES=( "${FILESDIR}/${P}-gcc-4.3.patch" )
+
+src_compile() {
+ econf --sbindir=/sbin || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ # init scripts
+ cd "${S}/contrib/init/gentoo/"
+ newinitd init.d-readahead-list readahead-list
+ newinitd init.d-readahead-list-early readahead-list-early
+ newconfd conf.d-readahead-list readahead-list
+
+ # default config
+ insinto /etc/readahead-list
+ cd "${S}/contrib/data"
+ newins readahead.runlevel-default.list runlevel-default
+ newins readahead.runlevel-boot.list runlevel-boot
+ newins readahead._sbin_rc.list exec_sbin_rc
+
+ # docs
+ cd "${S}"
+ dodoc README
+ if use doc; then
+ docinto scripts
+ dodoc contrib/scripts/*
+ fi
+ # clean up a bit
+ find "${D}/usr/share/doc/${PF}/" -type f -name 'Makefile*' -exec rm -f \{} \;
+}
+
+pkg_postinst() {
+ einfo "You should add readahead-list to your runlevels:"
+ einfo " rc-update add readahead-list-early boot"
+ einfo " rc-update add readahead-list boot"
+ einfo "Also consider customizing the lists in /etc/readahead-list"
+ einfo "for maximum performance gain."
+}
diff --git a/sys-apps/rename/Manifest b/sys-apps/rename/Manifest
new file mode 100644
index 000000000000..db91aca88bbd
--- /dev/null
+++ b/sys-apps/rename/Manifest
@@ -0,0 +1 @@
+DIST rename-1.3.tar.gz 83854 SHA256 02aed28f46b22213490a94b8490ee2a84b12c0962db33b4ea88c8c67a7adb8f4 SHA512 7959ef0417d02aecd23200fbc226acd0cc34595d16efdb931657c2292ec2a0b9ff794406b6baa5234db5c95b1eae8a1dcf1862936a40e66bb70710154c89e5dd WHIRLPOOL 83355f3dbbcb5f4c0af603a73c086dcaed662a7d087999331b5a4b73435f7e06221d8fe953c9f263a925dfa0d491c51c2b961fcd308db50241b49a353e17c4d2
diff --git a/sys-apps/rename/files/rename-1.3-build.patch b/sys-apps/rename/files/rename-1.3-build.patch
new file mode 100644
index 000000000000..942a2c142159
--- /dev/null
+++ b/sys-apps/rename/files/rename-1.3-build.patch
@@ -0,0 +1,11 @@
+--- Makefile.in
++++ Makefile.in
+@@ -16,7 +16,7 @@
+ all: rename
+
+ rename: $(OBJS)
+- $(CC) $(CFLAGS) -o $@ $^
++ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
+
+ static: $(OBJS)
diff --git a/sys-apps/rename/files/rename-1.3-gcc44.patch b/sys-apps/rename/files/rename-1.3-gcc44.patch
new file mode 100644
index 000000000000..0cbd3966748b
--- /dev/null
+++ b/sys-apps/rename/files/rename-1.3-gcc44.patch
@@ -0,0 +1,16 @@
+diff -NrU5 rename-1.3.original/rename.c rename-1.3/rename.c
+--- rename-1.3.original/rename.c 2009-06-14 00:21:43.000000000 -0600
++++ rename-1.3/rename.c 2009-06-14 00:22:21.000000000 -0600
+@@ -63,11 +63,11 @@
+ #endif
+ #endif
+
+ #if HAVE_REGEX_H
+ #include <regex.h>
+-#elif
++#else
+ #include "regex.h"
+ #endif
+
+ #if HAVE_GETOPT_H
+ #include <getopt.h>
diff --git a/sys-apps/rename/files/rename-1.3-rename.patch b/sys-apps/rename/files/rename-1.3-rename.patch
new file mode 100644
index 000000000000..52a3d9acf6c8
--- /dev/null
+++ b/sys-apps/rename/files/rename-1.3-rename.patch
@@ -0,0 +1,95 @@
+--- rename/rename.c
++++ rename/rename.c
+@@ -594,7 +594,7 @@
+ } else {
+ rs = rename(oldp, new);
+ if (rs < 0)
+- perror("rename");
++ perror("renamexm");
+ else if (attr & MOD_VERBO)
+ printf("ok\n");
+
+@@ -628,8 +628,8 @@
+ {
+
+ char *help = "\
+-Usage: rename SOURCE DEST\n\
+- or: rename [OPTION] file ...\n\
++Usage: renamexm SOURCE DEST\n\
++ or: renamexm [OPTION] file ...\n\
+ Rename SOURCE to DEST, or substitute characters match the specified pattern\n\
+ in the filename.\n\
+ \n\
+--- rename/rename.1
++++ rename/rename.1
+@@ -1,16 +1,16 @@
+ .TH NAME SECTION
+ .SH Name
+-rename \- file rename tool
++renamexm \- file rename tool
+
+ .SH SYNOPSIS
+-.B rename
++.B renamexm
+ .I OldName NewName
+ .P
+-.B rename
++.B renamexm
+ .I [options] files ...
+
+ .SH DESCRIPTION
+ This
+-.I rename
++.I renamexm
+ is a quick and powerful tool for
+ .I upcasing,
+@@ -276,5 +276,5 @@
+ .SH EXAMPLES
+ .TP
+-.I rename foo food
++.I renamexm foo food
+ Change file 'foo' to 'food', just like
+ .I mv(1)
+@@ -282,23 +282,23 @@
+
+ .TP
+-.I rename -lR *
++.I renamexm -lR *
+ To lowcase all filenames, directories and filenames and directories under
+ subdirectories.
+
+ .TP
+-.I rename -s/abc/xyz/gi *.c
++.I renamexm -s/abc/xyz/gi *.c
+ Substitute all 'abc' substrings appeared in C sources files with 'xyz',
+ ignoring case.
+
+ .TP
+-.I rename -vs/.c/.cpp/s *.c
++.I renamexm -vs/.c/.cpp/s *.c
+ Change C sources suffix to C++ sources suffix, with verbose information.
+
+ .TP
+-.I rename -s/abc/12345/bi *
++.I renamexm -s/abc/12345/bi *
+ Find the last occurrence of 'abc' and replace it with '12345', ignoring case.
+
+ .TP
+-.I rename -o guest -R /home/custom
++.I renamexm -o guest -R /home/custom
+ change the owner of the file '/home/custom' to 'guest'. The 'guest' should
+ be an effective user in the current system. If '/home/custom' is a directory,
+@@ -306,5 +306,5 @@
+
+ .TP
+-.I rename -s/^[A-Z].*file/nofile/r *
++.I renamexm -s/^[A-Z].*file/nofile/r *
+ The target substring starts with a capital letter, and ends with string 'file'.
+ There are 0 or any numbers of characters between the capital letter and 'file'.
+@@ -312,5 +312,5 @@
+
+ .TP
+-.I rename -s/^[A-Z].+file/nofile/eg *
++.I renamexm -s/^[A-Z].+file/nofile/eg *
+ Similar to last example, except it uses extended regular expression, such as
+ the '+' metacharacter, and replaces all matching strings with 'nofile'.
diff --git a/sys-apps/rename/metadata.xml b/sys-apps/rename/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/rename/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-apps/rename/rename-1.3-r1.ebuild b/sys-apps/rename/rename-1.3-r1.ebuild
new file mode 100644
index 000000000000..0e3e57632631
--- /dev/null
+++ b/sys-apps/rename/rename-1.3-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"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="tool for easily renaming files"
+HOMEPAGE="http://rename.sourceforge.net/"
+SRC_URI="http://${PN}/sourceforge.net/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS/s:-O3:@CFLAGS@:' \
+ -e '/strip /s:.*::' \
+ Makefile.in || die
+ epatch "${FILESDIR}"/${P}-rename.patch
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-gcc44.patch
+ tc-export CC
+}
+
+src_install() {
+ newbin rename renamexm
+ newman rename.1 renamexm.1
+ dodoc README ChangeLog
+}
+
+pkg_postinst() {
+ ewarn "This has been renamed to 'renamexm' to avoid"
+ ewarn "a naming conflict with sys-apps/util-linux."
+}
diff --git a/sys-apps/rename/rename-1.3.ebuild b/sys-apps/rename/rename-1.3.ebuild
new file mode 100644
index 000000000000..dc7024cba714
--- /dev/null
+++ b/sys-apps/rename/rename-1.3.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="tool for easily renaming files"
+HOMEPAGE="http://rename.sourceforge.net/"
+SRC_URI="http://${PN}/sourceforge.net/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i \
+ -e '/^CFLAGS/s:-O3:@CFLAGS@:' \
+ -e '/strip /s:.*::' \
+ Makefile.in
+ epatch "${FILESDIR}"/${P}-rename.patch
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-gcc44.patch
+ tc-export CC
+}
+
+src_install() {
+ newbin rename renamexm || die
+ newman rename.1 renamexm.1
+ dodoc README ChangeLog
+}
+
+pkg_postinst() {
+ ewarn "This has been renamed to 'renamexm' to avoid"
+ ewarn "a naming conflict with sys-apps/util-linux."
+}
diff --git a/sys-apps/renameutils/Manifest b/sys-apps/renameutils/Manifest
new file mode 100644
index 000000000000..638cc012c9f7
--- /dev/null
+++ b/sys-apps/renameutils/Manifest
@@ -0,0 +1 @@
+DIST renameutils-0.12.0.tar.gz 954114 SHA256 cbd2f002027ccf5a923135c3f529c6d17fabbca7d85506a394ca37694a9eb4a3
diff --git a/sys-apps/renameutils/files/renameutils-0.12.0-autopoint.patch b/sys-apps/renameutils/files/renameutils-0.12.0-autopoint.patch
new file mode 100644
index 000000000000..858a5565f0ae
--- /dev/null
+++ b/sys-apps/renameutils/files/renameutils-0.12.0-autopoint.patch
@@ -0,0 +1,12 @@
+diff --git a/configure.ac b/configure.ac
+index 58feccb..86dbe49 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,6 +24,7 @@ gl_INIT
+
+ # Gettext
+ AM_GNU_GETTEXT([external])
++AM_GNU_GETTEXT_VERSION(0.18)
+
+ # Checks for libraries.
+ OL_LIB_READLINE
diff --git a/sys-apps/renameutils/files/renameutils-0.12.0-typo.patch b/sys-apps/renameutils/files/renameutils-0.12.0-typo.patch
new file mode 100644
index 000000000000..2a5dd6a2101c
--- /dev/null
+++ b/sys-apps/renameutils/files/renameutils-0.12.0-typo.patch
@@ -0,0 +1,13 @@
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 21a1cb7..6cd9d08 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -49,7 +49,7 @@ all-local:
+ @[ -f icp ] || (echo $(LN_S) icmd icp ; $(LN_S) icmd icp)
+
+ install-exec-local:
+- $(mkdir_p) $(DESTDIR)($bindir)
++ $(mkdir_p) $(DESTDIR)$(bindir)
+ @[ -f $(DESTDIR)$(bindir)/qmv ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv)
+ @[ -f $(DESTDIR)$(bindir)/qcp ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp)
+ @[ -f $(DESTDIR)$(bindir)/imv ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/imv ; $(LN_S) icmd $(DESTDIR)$(bindir)/imv)
diff --git a/sys-apps/renameutils/files/renameutils-0.9.0-destdir.patch b/sys-apps/renameutils/files/renameutils-0.9.0-destdir.patch
new file mode 100644
index 000000000000..44d7304ac5c3
--- /dev/null
+++ b/sys-apps/renameutils/files/renameutils-0.9.0-destdir.patch
@@ -0,0 +1,29 @@
+--- src/Makefile.am-orig 2008-04-02 23:00:22.000000000 +0200
++++ src/Makefile.am 2008-04-02 22:59:47.000000000 +0200
+@@ -46,17 +46,18 @@
+ @[ -f icp ] || (echo $(LN_S) icmd icp ; $(LN_S) icmd icp)
+
+ install-exec-local:
+- @[ -f $(bindir)/qmv ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv)
+- @[ -f $(bindir)/qcp ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp)
+- @[ -f $(bindir)/imv ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/imv ; $(LN_S) icmd $(DESTDIR)$(bindir)/imv)
+- @[ -f $(bindir)/icp ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/icp ; $(LN_S) icmd $(DESTDIR)$(bindir)/icp)
++ $(mkdir_p) $(DESTDIR)$(bindir)
++ @[ -f $(DESTDIR)$(bindir)/qmv ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv)
++ @[ -f $(DESTDIR)$(bindir)/qcp ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp)
++ @[ -f $(DESTDIR)$(bindir)/imv ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/imv ; $(LN_S) icmd $(DESTDIR)$(bindir)/imv)
++ @[ -f $(DESTDIR)$(bindir)/icp ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/icp ; $(LN_S) icmd $(DESTDIR)$(bindir)/icp)
+
+ install-data-local:
+ $(mkdir_p) $(DESTDIR)$(man1dir)
+- @[ -f $(man1dir)/qmv.1 ] || (echo $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qmv.1 ; $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qmv.1)
+- @[ -f $(man1dir)/qcp.1 ] || (echo $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qcp.1 ; $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qcp.1)
+- @[ -f $(man1dir)/imv.1 ] || (echo $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/imv.1 ; $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/imv.1)
+- @[ -f $(man1dir)/icp.1 ] || (echo $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/icp.1 ; $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/icp.1)
++ @[ -f $(DESTDIR)$(man1dir)/qmv.1 ] || (echo $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qmv.1 ; $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qmv.1)
++ @[ -f $(DESTDIR)$(man1dir)/qcp.1 ] || (echo $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qcp.1 ; $(LN_S) qcmd.1 $(DESTDIR)$(man1dir)/qcp.1)
++ @[ -f $(DESTDIR)$(man1dir)/imv.1 ] || (echo $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/imv.1 ; $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/imv.1)
++ @[ -f $(DESTDIR)$(man1dir)/icp.1 ] || (echo $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/icp.1 ; $(LN_S) icmd.1 $(DESTDIR)$(man1dir)/icp.1)
+
+ clean-local:
+ rm -f qmv qcp imv icp qmv.1 qcp.1 imv.1 icp.1
diff --git a/sys-apps/renameutils/metadata.xml b/sys-apps/renameutils/metadata.xml
new file mode 100644
index 000000000000..6a4d99b2e8dc
--- /dev/null
+++ b/sys-apps/renameutils/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>dev-zero@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/renameutils/renameutils-0.12.0.ebuild b/sys-apps/renameutils/renameutils-0.12.0.ebuild
new file mode 100644
index 000000000000..407402547359
--- /dev/null
+++ b/sys-apps/renameutils/renameutils-0.12.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit autotools eutils
+
+DESCRIPTION="Use your favorite text editor to rename files"
+HOMEPAGE="http://www.nongnu.org/renameutils/"
+SRC_URI="http://savannah.nongnu.org/download/renameutils/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="nls"
+
+DEPEND=">=sys-libs/readline-5.0-r2"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${P}-typo.patch" \
+ "${FILESDIR}/${P}-autopoint.patch"
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable nls)
+}
diff --git a/sys-apps/rescan-scsi-bus/Manifest b/sys-apps/rescan-scsi-bus/Manifest
new file mode 100644
index 000000000000..5b28516757c6
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/Manifest
@@ -0,0 +1,3 @@
+DIST rescan-scsi-bus.sh-1.29 15654 SHA256 355f30d15b44159389baabac496882243974c9df4054d8a69ca2141822af8466 SHA512 dc6bfc5b8c4948c193bcf2522e6f4dedaacf9a9283eaedc9c3bcef0cf3db57a3ed8f3a95b8501853a75e1c83ad28850b291a76217b4c57690e663f3dc63587d7 WHIRLPOOL 1704b669a762b7f0a83afb394ad786dd9ae174a39a2e04325b83dbd2c4dfa58d3af9f94aaf1ce3c205ea44ac5ba8b8b8050916ebe6f7bce3b5d18a8ee539b288
+DIST rescan-scsi-bus.sh-1.56 22469 SHA256 d84a89a1f9162ca7711c5b1f18f4c036a41c231d15b4feeba0b50f815dcaf43d SHA512 bdd27471568b1ce8b4d9ccc6783f294d141d56c5d5fa5ad46a7ffe983efd46877e25ff67b7869edb4e22ad182d47140c2167a58b80a141f4b3dde9c7e10ae57b WHIRLPOOL 5ef7d71a653742c3ded4a4e3f570886e9161f7eab59692e57f46ecf0531de3c891d872328d0d5dc73fe67a90945e28bd9d08bbb15aad43f5e00a62084f87468d
+DIST rescan-scsi-bus.sh-1.57 22575 SHA256 91c3ffbbf27d799cb1adacc026a5a8f31d5d107b0adedc41e4b7d6af9fb3e70f SHA512 93a061af852e5f9dd3d64ad62692809a11d8ffaac68f5ce08ba1a4fd9201fc66a0a5482d3e6da6e5c36fb00805fa4f7483fc2c85c5aaf6bfc190690ccf7bc733 WHIRLPOOL 2568f857cd315d5b0c9259c6d0afa2ac5871c959ff77c1b408d734ba46860e0ec3bcadd8eed76d02e95ab87fd768fcfa707cf559c291ab45b1f65cff526fd421
diff --git a/sys-apps/rescan-scsi-bus/files/rescan-scsi-bus-1.25-support-sysfs-only-systems.patch b/sys-apps/rescan-scsi-bus/files/rescan-scsi-bus-1.25-support-sysfs-only-systems.patch
new file mode 100644
index 000000000000..7d890d0d5f66
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/files/rescan-scsi-bus-1.25-support-sysfs-only-systems.patch
@@ -0,0 +1,14 @@
+--- rescan-scsi-bus.sh.orig 2008-01-15 01:01:21.316547000 -0800
++++ rescan-scsi-bus.sh 2008-01-15 01:02:02.704184735 -0800
+@@ -444,7 +444,10 @@
+ echo $result
+ }
+
+-if test ! -d /proc/scsi/; then
++# /proc/scsi may not exist in new 2.6 kernels without CONFIG_SCSI_PROC_FS
++if test -d /proc/scsi/ || test -d /sys/bus/scsi/; then
++ :
++else
+ echo "Error: SCSI subsystem not active"
+ exit 1
+ fi
diff --git a/sys-apps/rescan-scsi-bus/metadata.xml b/sys-apps/rescan-scsi-bus/metadata.xml
new file mode 100644
index 000000000000..035bc6b0e2cd
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/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>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.29.ebuild b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.29.ebuild
new file mode 100644
index 000000000000..c90b62a6f937
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.29.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Script to rescan the SCSI bus without rebooting"
+HOMEPAGE="http://www.garloff.de/kurt/linux/"
+SCRIPT_NAME="${PN}.sh"
+SRC_NAME="${SCRIPT_NAME}-${PV}"
+SRC_URI="http://www.garloff.de/kurt/linux/${SRC_NAME}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=sys-apps/sg3_utils-1.24
+ virtual/modutils
+ app-shells/bash"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ einfo "Unpacking into ${WORKDIR}/"
+ cp -f "${DISTDIR}"/${SRC_NAME} "${WORKDIR}"/${SCRIPT_NAME}
+ #epatch "${FILESDIR}"/${P}-support-sysfs-only-systems.patch
+}
+
+src_compile() {
+ einfo "Nothing to compile"
+}
+
+src_install() {
+ into /usr
+ dosbin ${SCRIPT_NAME}
+ # Some scripts look for this without the trailing .sh
+ # Some look for it with the trailing .sh, so have a symlink
+ dosym ${SCRIPT_NAME} /usr/sbin/${PN}
+}
diff --git a/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.56.ebuild b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.56.ebuild
new file mode 100644
index 000000000000..53a3150b0cc8
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.56.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+DESCRIPTION="Script to rescan the SCSI bus without rebooting"
+HOMEPAGE="http://www.garloff.de/kurt/linux/"
+SCRIPT_NAME="${PN}.sh"
+SRC_NAME="${SCRIPT_NAME}-${PV}"
+SRC_URI="http://www.garloff.de/kurt/linux/${SRC_NAME}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=sys-apps/sg3_utils-1.24
+ virtual/modutils
+ app-shells/bash"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ einfo "Unpacking into ${WORKDIR}/"
+ cp -f "${DISTDIR}"/${SRC_NAME} "${WORKDIR}"/${SCRIPT_NAME}
+ #epatch "${FILESDIR}"/${P}-support-sysfs-only-systems.patch
+}
+
+src_compile() {
+ einfo "Nothing to compile"
+}
+
+src_install() {
+ into /usr
+ dosbin ${SCRIPT_NAME}
+ # Some scripts look for this without the trailing .sh
+ # Some look for it with the trailing .sh, so have a symlink
+ dosym ${SCRIPT_NAME} /usr/sbin/${PN}
+}
diff --git a/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57-r1.ebuild b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57-r1.ebuild
new file mode 100644
index 000000000000..b75e81bbf260
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57-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 eutils
+
+DESCRIPTION="Script to rescan the SCSI bus without rebooting"
+HOMEPAGE="http://www.garloff.de/kurt/linux/"
+SCRIPT_NAME="${PN}.sh"
+SRC_NAME="${SCRIPT_NAME}-${PV}"
+SRC_URI="http://www.garloff.de/kurt/linux/${SRC_NAME}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86" # alpha hppa ppc64 sparc
+
+RDEPEND=">=sys-apps/sg3_utils-1.24
+ app-admin/killproc
+ virtual/modutils
+ app-shells/bash"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp -f "${DISTDIR}"/${SRC_NAME} "${WORKDIR}"/${SCRIPT_NAME}
+}
+
+src_install() {
+ into /usr
+ dosbin ${SCRIPT_NAME}
+ # Some scripts look for this without the trailing .sh
+ # Some look for it with the trailing .sh, so have a symlink
+ dosym ${SCRIPT_NAME} /usr/sbin/${PN}
+}
diff --git a/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57.ebuild b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57.ebuild
new file mode 100644
index 000000000000..a7609810e962
--- /dev/null
+++ b/sys-apps/rescan-scsi-bus/rescan-scsi-bus-1.57.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 eutils
+
+DESCRIPTION="Script to rescan the SCSI bus without rebooting"
+HOMEPAGE="http://www.garloff.de/kurt/linux/"
+SCRIPT_NAME="${PN}.sh"
+SRC_NAME="${SCRIPT_NAME}-${PV}"
+SRC_URI="http://www.garloff.de/kurt/linux/${SRC_NAME}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+
+RDEPEND=">=sys-apps/sg3_utils-1.24
+ virtual/modutils
+ app-shells/bash"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp -f "${DISTDIR}"/${SRC_NAME} "${WORKDIR}"/${SCRIPT_NAME}
+}
+
+src_install() {
+ into /usr
+ dosbin ${SCRIPT_NAME}
+ # Some scripts look for this without the trailing .sh
+ # Some look for it with the trailing .sh, so have a symlink
+ dosym ${SCRIPT_NAME} /usr/sbin/${PN}
+}
diff --git a/sys-apps/restartd/Manifest b/sys-apps/restartd/Manifest
new file mode 100644
index 000000000000..7300cba59a27
--- /dev/null
+++ b/sys-apps/restartd/Manifest
@@ -0,0 +1 @@
+DIST restartd_0.2.2.tar.gz 13777 RMD160 4358d38d984f9ca5643fa87c802be493d89177c2 SHA1 c3c4fedb57649d4af165e3560b4162caef95c144 SHA256 38e69e8f21b6b004f3469cea9cd073048cc9b3b3ef52a0a11a8f10e0dc44c182
diff --git a/sys-apps/restartd/metadata.xml b/sys-apps/restartd/metadata.xml
new file mode 100644
index 000000000000..d9cd2cad66c2
--- /dev/null
+++ b/sys-apps/restartd/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>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/restartd/restartd-0.2.2.ebuild b/sys-apps/restartd/restartd-0.2.2.ebuild
new file mode 100644
index 000000000000..20dcc15d3eff
--- /dev/null
+++ b/sys-apps/restartd/restartd-0.2.2.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+MY_PV=${PV/_alpha/.a-}
+DESCRIPTION="A daemon for checking your running and not running processes"
+HOMEPAGE="http://packages.debian.org/unstable/utils/restartd"
+SRC_URI="mirror://debian/pool/main/r/restartd/${PN}_${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+src_prepare() {
+ sed -i Makefile -e 's|-o restartd|$(LDFLAGS) &|g' || die "sed Makefile"
+}
+
+src_compile() {
+ emake CC=$(tc-getCC) C_ARGS="${CFLAGS}" || die
+}
+
+src_install() {
+ dodir /etc /usr/sbin /usr/share/man/man8 /usr/share/man/fr/man8/
+ emake DESTDIR="${D}" install || die
+}
diff --git a/sys-apps/rigo-daemon/Manifest b/sys-apps/rigo-daemon/Manifest
new file mode 100644
index 000000000000..520d012e476c
--- /dev/null
+++ b/sys-apps/rigo-daemon/Manifest
@@ -0,0 +1 @@
+DIST entropy-254.tar.bz2 18516662 SHA256 5e411472eaf7016a68a4aa81ef92dd3aad8403fc65a0ffb09c57b91c959ca3a6 SHA512 3b3e82abad8008720e370b7892b7be1c48aaa6605914db977f68b9a108ada0a4adbaa5b7b50a9a02ba9c8b0bdefadcda1eceee2c7c2abc385b3daf669649e2da WHIRLPOOL 593469b858707e4ceca56146fa1d608141e44dda0a0921ed6a3ec566878c1e3c153410233f088d57db4f8bd9d1c796bd945cbea3ba455572efc05eca42023ce5
diff --git a/sys-apps/rigo-daemon/metadata.xml b/sys-apps/rigo-daemon/metadata.xml
new file mode 100644
index 000000000000..187f7a710efe
--- /dev/null
+++ b/sys-apps/rigo-daemon/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>lxnay@gentoo.org</email>
+ <name>Fabio Erculiani</name>
+ </maintainer>
+ <use>
+ </use>
+</pkgmetadata>
+
diff --git a/sys-apps/rigo-daemon/rigo-daemon-254.ebuild b/sys-apps/rigo-daemon/rigo-daemon-254.ebuild
new file mode 100644
index 000000000000..aeb9388cf8f0
--- /dev/null
+++ b/sys-apps/rigo-daemon/rigo-daemon-254.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-single-r1
+
+MY_PN="RigoDaemon"
+DESCRIPTION="Entropy Client DBus Services, aka RigoDaemon"
+HOMEPAGE="http://www.sabayon.org"
+LICENSE="GPL-3"
+
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+SRC_URI="mirror://sabayon/sys-apps/entropy-${PV}.tar.bz2"
+
+S="${WORKDIR}/entropy-${PV}/rigo/${MY_PN}"
+
+DEPEND="${PYTHON_DEPS}"
+RDEPEND="${PYTHON_DEPS}
+ dev-python/dbus-python
+ dev-python/pygobject:3
+ ~sys-apps/entropy-${PV}[${PYTHON_USEDEP}]
+ sys-auth/polkit[introspection]
+ sys-devel/gettext"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ python_optimize "${D}/usr/lib/rigo/${MY_PN}"
+}
+
+pkg_preinst() {
+ # ask RigoDaemon to shutdown, if running
+ # TODO: this will be removed in future
+ local shutdown_exec=${EROOT}/usr/lib/rigo/${MY_PN}/shutdown.py
+ [[ -x "${shutdown_exec}" ]] && "${shutdown_exec}"
+}
diff --git a/sys-apps/rkflashtool/Manifest b/sys-apps/rkflashtool/Manifest
new file mode 100644
index 000000000000..e3cb5198608e
--- /dev/null
+++ b/sys-apps/rkflashtool/Manifest
@@ -0,0 +1 @@
+DIST rkflashtool-5.1-src.tar.xz 10548 SHA256 b802b4bd634a614df23f45f65cda8620695282e2646fb5eacd6a69001a110ed6 SHA512 0dbe69dc7fc224e91e170d5630e770e82257121c2215c6e196b2a8450a9e22bab583b57de50acb9aaad223b9d216b731a92260638c648018c319917705983fb2 WHIRLPOOL 6b1de8a5365e55eadb21d2c96c229a2876b31ae9c4a9dade50bebb8eb4e2cc5642ce33213b150487ca546215d47d2cd062f73b958508a6569f3f85c8c396017d
diff --git a/sys-apps/rkflashtool/files/rkflashtool-5.1-missing-version.h b/sys-apps/rkflashtool/files/rkflashtool-5.1-missing-version.h
new file mode 100644
index 000000000000..bfffda893a2f
--- /dev/null
+++ b/sys-apps/rkflashtool/files/rkflashtool-5.1-missing-version.h
@@ -0,0 +1,5 @@
+#ifndef RKFLASHTOOL_VERSION_H
+#define RKFLASHTOOL_VERSION_H
+#define RKFLASHTOOL_VERSION_MAJOR 5
+#define RKFLASHTOOL_VERSION_MINOR 1
+#endif
diff --git a/sys-apps/rkflashtool/metadata.xml b/sys-apps/rkflashtool/metadata.xml
new file mode 100644
index 000000000000..8104459971ba
--- /dev/null
+++ b/sys-apps/rkflashtool/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>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">rkflashtool</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/rkflashtool/rkflashtool-5.1.ebuild b/sys-apps/rkflashtool/rkflashtool-5.1.ebuild
new file mode 100644
index 000000000000..a3988d7f386c
--- /dev/null
+++ b/sys-apps/rkflashtool/rkflashtool-5.1.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 toolchain-funcs
+
+DESCRIPTION="Tool for flashing Rockchip devices"
+HOMEPAGE="http://sourceforge.net/projects/rkflashtool/"
+SRC_URI="mirror://sourceforge/project/${PN}/${P}/${P}-src.tar.xz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+S=${WORKDIR}/${P}-src
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}"
+
+src_prepare(){
+ cp "${FILESDIR}"/${P}-missing-version.h version.h || die
+ sed -i -e "s/CC =/CC ?=/"\
+ -e "s/CFLAGS =/CFLAGS ?=/"\
+ -e "s/LDFLAGS =/LDFLAGS ?=/" Makefile || die
+ tc-export CC
+}
+
+src_install(){
+ dodoc README
+ dobin ${PN} rkcrc rkflashtool rkmisc rkpad rkparameters rkparametersblock rkunpack rkunsign
+}
diff --git a/sys-apps/rng-tools/Manifest b/sys-apps/rng-tools/Manifest
new file mode 100644
index 000000000000..e8ef399c125d
--- /dev/null
+++ b/sys-apps/rng-tools/Manifest
@@ -0,0 +1,2 @@
+DIST rng-tools-4.tar.gz 110943 SHA256 b71bdfd4222c05e8316001556be90e1606f2a1bac3efde60153bd84e873cc195 SHA512 328627a9ede924026c7a7c391b04be05f098d713d35f7f38d939d52b794853b4f6db3ae125568710ab5a59640236b343f3e9fc0f735806b020cc675c02f80b08 WHIRLPOOL da58bc7d3b7d9cdf6d83d258717f22ba3552482a690311fa2c820e4ce125a5e6c6e498e0b63461ed6c9dc16dff77b2cb47377933845fb9397efa205183346e5b
+DIST rng-tools-5.tar.gz 122182 SHA256 60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e SHA512 58047c37cad4f5f1210b696e4dba122878f78e57d05d9cb822f79234240ecce31efd2d39061fea1eb5b2e81d48d8c3bf6b92d06451f1ce5d5db7117704e89c50 WHIRLPOOL 073dbeb9d27189db44658a9f25657b93a320b125fbfc8230f7ce7849b8e7c1f7802b4c3a53de3417525b02739194fab8a6e5eb03d5db317a23deb275d72fbb21
diff --git a/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch b/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch
new file mode 100644
index 000000000000..5ff34da861b4
--- /dev/null
+++ b/sys-apps/rng-tools/files/fix-textrels-on-PIC-x86.patch
@@ -0,0 +1,71 @@
+From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86
+
+This patch fixes the assembly in rdrand_asm.S so it won't generate textrels on PIC systems.
+The main fixes are in the use of leal in SETPTR for such systems, the rest is the usual PIC
+support stuff.
+
+This should fix Gentoo bug #469962
+
+This patch is released under the GPLv2 or a higher version license as is the original file
+as long as reference to the author and the tester are included in the final code.
+
+Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=469962
+Upstream-status: Not sent yet
+Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+Reported-by: cilly <cilly@cilly.mine.nu>
+Tested-by: Anthony Basile <blueness@gentoo.org>
+
+--- rng-tools/rdrand_asm.S
++++ rng-tools/rdrand_asm.S
+@@ -49,6 +49,7 @@
+ ret
+ ENDPROC(x86_rdrand_nlong)
+
++#define INIT_PIC()
+ #define SETPTR(var,ptr) leaq var(%rip),ptr
+ #define PTR0 %rdi
+ #define PTR1 %rsi
+@@ -84,7 +85,16 @@
+ ret
+ ENDPROC(x86_rdrand_nlong)
+
++#if defined(__PIC__)
++#undef __i686 /* gcc builtin define gets in our way */
++#define INIT_PIC() \
++ call __i686.get_pc_thunk.bx ; \
++ addl $_GLOBAL_OFFSET_TABLE_, %ebx
++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr
++#else
++#define INIT_PIC()
+ #define SETPTR(var,ptr) movl $(var),ptr
++#endif
+ #define PTR0 %eax
+ #define PTR1 %edx
+ #define PTR2 %ecx
+@@ -101,6 +111,7 @@
+ movl 8(%ebp), %eax
+ movl 12(%ebp), %edx
+ #endif
++ INIT_PIC()
+
+ SETPTR(aes_round_keys, PTR2)
+
+@@ -166,6 +177,17 @@
+ #endif
+ ret
+ ENDPROC(x86_aes_mangle)
++
++#if defined(__i386__) && defined(__PIC__)
++ .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
++.globl __i686.get_pc_thunk.bx
++ .hidden __i686.get_pc_thunk.bx
++ .type __i686.get_pc_thunk.bx,@function
++__i686.get_pc_thunk.bx:
++ movl (%esp), %ebx
++ ret
++#endif
++
+ /*
+ * AES round keys for an arbitrary key:
+ * 00102030405060708090A0B0C0D0E0F0
diff --git a/sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch b/sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch
new file mode 100644
index 000000000000..5fa5f0b4ecf7
--- /dev/null
+++ b/sys-apps/rng-tools/files/rng-tools-5-fix-textrels-on-PIC-x86.patch
@@ -0,0 +1,100 @@
+From: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+Subject: [PATCH] Fix assemby textrels on rdrand_asm.S on PIC x86
+
+This patch updates the fixes in the assembly in rdrand_asm.S in
+sys-apps/rng-tools-5 so it won't generate textrels on PIC systems.
+The main fixes are in the use of leal in SETPTR for such systems, the rest is
+the usual PIC support stuff.
+
+This should fix Gentoo bug #469962 and help fix #518210
+
+This patch is released under the GPLv2 or a higher version license as is the
+original file as long as the author and the tester are credited.
+
+Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=469962
+Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=518210
+Upstream-status: Not sent yet
+Signed-off-by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+Reported-by: cilly <cilly@cilly.mine.nu>
+Reported-by: Manuel Rüger <mrueg@gentoo.org>
+Tested-by: Anthony Basile <blueness@gentoo.org>
+
+--- rng-tools/rdrand_asm.S
++++ rng-tools/rdrand_asm.S
+@@ -2,6 +2,7 @@
+ * Copyright (c) 2011-2014, Intel Corporation
+ * Authors: Fenghua Yu <fenghua.yu@intel.com>,
+ * H. Peter Anvin <hpa@linux.intel.com>
++ * PIC code by: Francisco Blas Izquierdo Riera (klondike) <klondike@gentoo.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+@@ -174,7 +175,19 @@
+ jmp 4b
+ ENDPROC(x86_rdseed_or_rdrand_bytes)
+
++#if defined(__PIC__)
++#define INIT_PIC() \
++ pushl %ebx ; \
++ call __x86.get_pc_thunk.bx ; \
++ addl $_GLOBAL_OFFSET_TABLE_, %ebx
++#define END_PIC() \
++ popl %ebx
++#define SETPTR(var,ptr) leal (var)@GOTOFF(%ebx),ptr
++#else
++#define INIT_PIC()
++#define END_PIC()
+ #define SETPTR(var,ptr) movl $(var),ptr
++#endif
+ #define PTR0 %eax
+ #define PTR1 %edx
+ #define PTR2 %ecx
+@@ -190,6 +203,7 @@
+ movl 8(%ebp), %eax
+ movl 12(%ebp), %edx
+ push %esi
++ INIT_PIC()
+ #endif
+ movl $512, CTR3 /* Number of rounds */
+
+@@ -280,6 +294,7 @@
+ movdqa %xmm7, (7*16)(PTR1)
+
+ #ifdef __i386__
++ END_PIC()
+ pop %esi
+ pop %ebp
+ #endif
+@@ -294,6 +309,7 @@
+ push %ebp
+ mov %esp, %ebp
+ movl 8(%ebp), %eax
++ INIT_PIC()
+ #endif
+
+ SETPTR(aes_round_keys, PTR1)
+@@ -323,6 +339,7 @@
+ call 1f
+
+ #ifdef __i386__
++ END_PIC()
+ pop %ebp
+ #endif
+ ret
+@@ -343,6 +360,16 @@
+
+ ENDPROC(x86_aes_expand_key)
+
++#if defined(__i386__) && defined(__PIC__)
++ .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
++ .globl __x86.get_pc_thunk.bx
++ .hidden __x86.get_pc_thunk.bx
++ .type __x86.get_pc_thunk.bx, @function
++__x86.get_pc_thunk.bx:
++ movl (%esp), %ebx
++ ret
++#endif
++
+ .bss
+ .balign 64
+ aes_round_keys:
diff --git a/sys-apps/rng-tools/files/rngd-confd-4.1 b/sys-apps/rng-tools/files/rngd-confd-4.1
new file mode 100644
index 000000000000..77e5db583458
--- /dev/null
+++ b/sys-apps/rng-tools/files/rngd-confd-4.1
@@ -0,0 +1,22 @@
+# /etc/conf.d/rngd
+
+# Please see "/usr/sbin/rngd --help" and "man rngd" for more information
+
+# If a single device is preferred, then specify it here, otherwise we will
+# search for suitable devices.
+#DEVICE=
+
+# Random step (Number of bytes written to random-device at a time):
+STEP=64
+
+# Should TPM be avoided?
+# NO_TPM=0
+
+# Should RDRAND be avoided? Please note that unless this is commented
+# out, RDRAND _will_ be disabled, as any value will cause it to be
+# disabled.
+# NO_DRNG=1
+
+# Fill watermark
+# 0 <= n <= `sysctl kernel.random.poolsize`
+WATERMARK=2048
diff --git a/sys-apps/rng-tools/files/rngd-initd-4.1 b/sys-apps/rng-tools/files/rngd-initd-4.1
new file mode 100644
index 000000000000..edc61d4316f6
--- /dev/null
+++ b/sys-apps/rng-tools/files/rngd-initd-4.1
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ after urandom
+ provide entropy
+}
+
+# Do NOT add /dev/tpm to this.
+DEFAULT_DEVICE="/dev/hw_random* /dev/hwrandom* /dev/i810_rng /dev/hwrng*"
+
+find_device() {
+ local d
+ # The echo is to cause globbing
+ for d in $(echo ${DEFAULT_DEVICE}) ; do
+ [ -e "${d}" ] && echo "${d}"
+ done
+}
+
+RNG_DEVICE="${DEVICE:-$(find_device)}"
+
+command=/usr/sbin/rngd
+pidfile="/var/run/${SVCNAME}.pid"
+command_args="--pid-file ${pidfile} --background --random-step ${STEP:-64} ${NO_TPM:+--no-tpm=1} ${NO_DRNG:+--no-drng=1} --fill-watermark ${WATERMARK} ${RNG_DEVICE:+--rng-device ${RNG_DEVICE}}"
+start_stop_daemon_args="--wait 1000"
+retry="SIGKILL/5000"
diff --git a/sys-apps/rng-tools/files/rngd-initd-r1-4.1 b/sys-apps/rng-tools/files/rngd-initd-r1-4.1
new file mode 100644
index 000000000000..1e63c847d370
--- /dev/null
+++ b/sys-apps/rng-tools/files/rngd-initd-r1-4.1
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ after urandom
+ provide entropy
+}
+
+# Do NOT add /dev/tpm to this.
+DEFAULT_DEVICE="/dev/hw_random* /dev/hwrandom* /dev/i810_rng /dev/hwrng*"
+
+command=/usr/sbin/rngd
+pidfile="/var/run/${SVCNAME}.pid"
+command_args="--pid-file ${pidfile} --background --random-step ${STEP:-64} ${NO_TPM:+--no-tpm=1} \
+ ${NO_DRNG:+--no-drng=1} --fill-watermark ${WATERMARK} ${DEVICE:+--rng-device ${DEVICE}}"
+start_stop_daemon_args="--wait 1000"
+retry="SIGKILL/5000"
diff --git a/sys-apps/rng-tools/files/rngd.service b/sys-apps/rng-tools/files/rngd.service
new file mode 100644
index 000000000000..04793437e2d7
--- /dev/null
+++ b/sys-apps/rng-tools/files/rngd.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Hardware RNG Entropy Gatherer Daemon
+
+[Service]
+ExecStart=/usr/sbin/rngd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/rng-tools/files/test-for-argp.patch b/sys-apps/rng-tools/files/test-for-argp.patch
new file mode 100644
index 000000000000..129a522e5686
--- /dev/null
+++ b/sys-apps/rng-tools/files/test-for-argp.patch
@@ -0,0 +1,43 @@
+On glibc systems, argp is provided by libc. However, on
+uclibc and other systems which lack argp in their C library,
+argp might be provided by a stand alone library, libargp.
+This patch adds tests to the build system to find who provides
+argp.
+
+X-Gentoo-Bug: 292191
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=292191
+Reported-by: Ed Wildgoose <gentoo@wildgooses.com>
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+
+
+--- configure.ac.orig 2012-05-26 22:45:42.753478198 +0000
++++ configure.ac 2012-05-27 00:36:23.175844081 +0000
+@@ -47,6 +47,28 @@
+ dnl Checks for optional library functions
+ dnl -------------------------------------
+
++dnl First check if we have argp available from libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <argp.h>],
++ [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
++ )],
++ [libc_has_argp="true"],
++ [libc_has_argp="false"]
++)
++
++dnl If libc doesn't provide argp, then test for libargp
++if test "$libc_has_argp" = "false" ; then
++ AC_MSG_WARN("libc does not have argp")
++ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
++
++ if test "$have_argp" = "false"; then
++ AC_MSG_ERROR("no libargp found")
++ else
++ LIBS+=" -largp"
++ fi
++fi
++
+ dnl -----------------
+ dnl Configure options
+ dnl -----------------
diff --git a/sys-apps/rng-tools/metadata.xml b/sys-apps/rng-tools/metadata.xml
new file mode 100644
index 000000000000..582bac6aefed
--- /dev/null
+++ b/sys-apps/rng-tools/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>idella4@gentoo.org</email>
+ <name>Ian Delaney</name>
+ </maintainer>
+ <maintainer>
+ <email>gokturk@binghamton.edu</email>
+ <name>Gokturk Yuksek</name>
+ <description>Proxy maintainer, CC him on bugs.</description>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">gkernel</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/rng-tools/rng-tools-4-r7.ebuild b/sys-apps/rng-tools/rng-tools-4-r7.ebuild
new file mode 100644
index 000000000000..323f0459b7e2
--- /dev/null
+++ b/sys-apps/rng-tools/rng-tools-4-r7.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 autotools systemd toolchain-funcs
+
+DESCRIPTION="Daemon to use hardware random number generators"
+HOMEPAGE="http://gkernel.sourceforge.net/"
+SRC_URI="mirror://sourceforge/gkernel/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ia64 ppc x86"
+IUSE="selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-rngd )"
+DEPEND=""
+
+src_prepare() {
+ echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am
+ epatch "${FILESDIR}"/test-for-argp.patch
+ epatch "${FILESDIR}"/fix-textrels-on-PIC-x86.patch
+ eautoreconf
+
+ sed -i '/^AR /d' Makefile.in
+ tc-export AR
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/rngd-initd-4.1 rngd
+ newconfd "${FILESDIR}"/rngd-confd-4.1 rngd
+ systemd_dounit "${FILESDIR}"/rngd.service
+}
diff --git a/sys-apps/rng-tools/rng-tools-5.ebuild b/sys-apps/rng-tools/rng-tools-5.ebuild
new file mode 100644
index 000000000000..fb83acfa2f2c
--- /dev/null
+++ b/sys-apps/rng-tools/rng-tools-5.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools systemd toolchain-funcs
+
+DESCRIPTION="Daemon to use hardware random number generators"
+HOMEPAGE="http://gkernel.sourceforge.net/"
+SRC_URI="mirror://sourceforge/gkernel/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ppc ~x86"
+IUSE="selinux"
+
+DEPEND="dev-libs/libgcrypt:0
+ dev-libs/libgpg-error"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-rngd )"
+
+src_prepare() {
+ echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am
+ epatch "${FILESDIR}"/test-for-argp.patch\
+ "${FILESDIR}"/${P}-fix-textrels-on-PIC-x86.patch
+ eautoreconf
+
+ sed -i '/^AR /d' Makefile.in || die
+ tc-export AR
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/rngd-initd-4.1 rngd
+ newconfd "${FILESDIR}"/rngd-confd-4.1 rngd
+ systemd_dounit "${FILESDIR}"/rngd.service
+}
diff --git a/sys-apps/roccat-tools/Manifest b/sys-apps/roccat-tools/Manifest
new file mode 100644
index 000000000000..9f4e27d8a9ac
--- /dev/null
+++ b/sys-apps/roccat-tools/Manifest
@@ -0,0 +1,2 @@
+DIST roccat-tools-3.4.0.tar.bz2 2548969 SHA256 4f0e91b3cfc5be6b2c71d8a1dc77bce27c8ef180166d85f01b8383fbe05d9cb3 SHA512 7064f2095d14a496f99713b04024e0d05bfe6000f84c24a73bc48151f1d58dca94b4042fba3118787da87fc9efdfd7f42519cbdf27af34fdbb2cacd03f02b92d WHIRLPOOL b401e14dcfcb19e799905b8582ab471ab732674eef3007474dd3edee62c08b4c6e84d04d7924e0be6b96fe76ce4f3f910129dfb5b6a450b97922bf4c68945087
+DIST roccat-tools-3.5.0.tar.bz2 2549533 SHA256 b940702f4005f81fec673e187328a1506d0d77ba27ecac35588b0a0e3313347d SHA512 d86f5a9c76f6c907a6d9353b710b1a24f495b12165ac6750db30a927361d19362fb975ca1fb3ca090cc17942aaa05064b7064d371d6c1ca365c08efce9663f51 WHIRLPOOL 8fbdcf96d675c2a129ff013732a3cb55e2a5426f9ab4df71496d9e3cfeabc2b6d673921ba8b9b24a4278376c0249d9e45b54ff26899de8f2cfc5980d7e37181a
diff --git a/sys-apps/roccat-tools/files/README.gentoo b/sys-apps/roccat-tools/files/README.gentoo
new file mode 100644
index 000000000000..55bc7407e314
--- /dev/null
+++ b/sys-apps/roccat-tools/files/README.gentoo
@@ -0,0 +1,17 @@
+To allow users to use all features add them to the 'roccat' group
+To allow udev to detect your device without reboot, run
+# udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
+*************************
+*** Upstream message: ***
+*************************
+* Some devices (Arvo, Kone) need uinput for some features. To use it as normal
+* user you can either create an extra group like uinput-users and add yourself
+* to this group (as described above) or reuse group roccat.
+* Create a file like /etc/udev/rules.d/90-uinput.rules containing the line
+* KERNEL=="uinput", GROUP="uinput-users", MODE="0660"
+* and replace the group name with your choice.
+
+* In addition, you need to enable CONFIG_INPUT_UINPUT in your kernel
+
+* Do a logout/login to apply your new group ownership and replug your device
+* and everything should work as expected.
diff --git a/sys-apps/roccat-tools/metadata.xml b/sys-apps/roccat-tools/metadata.xml
new file mode 100644
index 000000000000..d89f5d95cc75
--- /dev/null
+++ b/sys-apps/roccat-tools/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>dpisklov@gmail.com</email>
+ <name>Dmitry Pisklov</name>
+ <description>Proxy maintainer. Assign bugs to him</description>
+ </maintainer>
+ <use>
+ <flag name="lua">Build support for Lua scripting for RyosMKPro ripple effects</flag>
+ <flag name="lua51">Build support for Lua scripting for RyosMKPro ripple effects - support lua 5.1</flag>
+ <flag name="lua52">Build support for Lua scripting for RyosMKPro ripple effects - support lua 5.2</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">roccat</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/roccat-tools/roccat-tools-3.4.0.ebuild b/sys-apps/roccat-tools/roccat-tools-3.4.0.ebuild
new file mode 100644
index 000000000000..f92e790407eb
--- /dev/null
+++ b/sys-apps/roccat-tools/roccat-tools-3.4.0.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo cmake-utils gnome2-utils udev user
+
+DESCRIPTION="Utility for advanced configuration of Roccat devices"
+
+HOMEPAGE="http://roccat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/roccat/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE_INPUT_DEVICES="
+ input_devices_roccat_arvo
+ input_devices_roccat_isku
+ input_devices_roccat_iskufx
+ input_devices_roccat_kone
+ input_devices_roccat_koneplus
+ input_devices_roccat_konepure
+ input_devices_roccat_konepuremilitary
+ input_devices_roccat_konepureoptical
+ input_devices_roccat_konextd
+ input_devices_roccat_konextdoptical
+ input_devices_roccat_kovaplus
+ input_devices_roccat_lua
+ input_devices_roccat_pyra
+ input_devices_roccat_savu
+ input_devices_roccat_ryosmk
+ input_devices_roccat_ryostkl
+ input_devices_roccat_tyon
+"
+IUSE="${IUSE_INPUT_DEVICES} lua"
+REQUIRED_USE="
+ lua? ( input_devices_roccat_ryosmk )
+"
+
+RDEPEND="
+ >=dev-libs/libgaminggear-0.10
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ media-libs/libcanberra
+ virtual/libusb:1
+ dev-libs/dbus-glib
+ virtual/libgudev:=
+ lua? ( || ( dev-lang/lua:5.1 dev-lang/lua:0 ) )
+"
+
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ enewgroup roccat
+}
+
+src_configure() {
+ local UDEVDIR="$(get_udevdir)"/rules.d
+ local MODELS=${INPUT_DEVICES//roccat_/}
+ mycmakeargs=(
+ -DDEVICES=${MODELS// /;} \
+ -DUDEVDIR="${UDEVDIR/"//"//}"
+ )
+ if use lua ; then
+ mycmakeargs+=( -DWITH_LUA=5.1 )
+ fi
+ cmake-utils_src_configure
+}
+src_install() {
+ cmake-utils_src_install
+ local stat_dir=/var/lib/roccat
+ keepdir $stat_dir
+ fowners root:roccat $stat_dir
+ fperms 2770 $stat_dir
+ readme.gentoo_src_install
+}
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+pkg_postinst() {
+ gnome2_icon_cache_update
+ readme.gentoo_print_elog
+ ewarn
+ ewarn "Starting from version 3.0.0, executables were renamed and now prefixed with 'roccat',"
+ ewarn "so konextdconfig is now roccatkonextdconfig and so on"
+ ewarn "Everything that was ryos is now ryosmk to distinguish it from the ryostkl product range"
+ ewarn
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-apps/roccat-tools/roccat-tools-3.5.0-r1.ebuild b/sys-apps/roccat-tools/roccat-tools-3.5.0-r1.ebuild
new file mode 100644
index 000000000000..6d4b090064a3
--- /dev/null
+++ b/sys-apps/roccat-tools/roccat-tools-3.5.0-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo cmake-utils gnome2-utils udev user
+
+DESCRIPTION="Utility for advanced configuration of Roccat devices"
+
+HOMEPAGE="http://roccat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/roccat/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE_INPUT_DEVICES="
+ input_devices_roccat_arvo
+ input_devices_roccat_isku
+ input_devices_roccat_iskufx
+ input_devices_roccat_kone
+ input_devices_roccat_koneplus
+ input_devices_roccat_konepure
+ input_devices_roccat_konepuremilitary
+ input_devices_roccat_konepureoptical
+ input_devices_roccat_konextd
+ input_devices_roccat_konextdoptical
+ input_devices_roccat_kovaplus
+ input_devices_roccat_lua
+ input_devices_roccat_pyra
+ input_devices_roccat_savu
+ input_devices_roccat_ryosmk
+ input_devices_roccat_ryostkl
+ input_devices_roccat_tyon
+"
+IUSE="${IUSE_INPUT_DEVICES} lua lua51 lua52"
+REQUIRED_USE="
+ lua? ( input_devices_roccat_ryosmk )
+ lua? ( ^^ ( lua51 lua52 ) )
+"
+
+RDEPEND="
+ >=dev-libs/libgaminggear-0.10
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ media-libs/libcanberra
+ virtual/libusb:1
+ dev-libs/dbus-glib
+ virtual/libgudev:=
+ lua51? ( || ( dev-lang/lua:5.1 dev-lang/lua:0 ) )
+ lua52? ( dev-lang/lua:5.2 )
+"
+
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ enewgroup roccat
+}
+
+src_configure() {
+ local UDEVDIR="$(get_udevdir)"/rules.d
+ local MODELS=${INPUT_DEVICES//roccat_/}
+ mycmakeargs=(
+ -DDEVICES=${MODELS// /;} \
+ -DUDEVDIR="${UDEVDIR/"//"//}"
+ )
+ if use lua51 ; then
+ mycmakeargs+=( -DWITH_LUA=5.1 )
+ elif use lua52 ; then
+ mycmakeargs+=( -DWITH_LUA=5.2 )
+ fi
+ cmake-utils_src_configure
+}
+src_install() {
+ cmake-utils_src_install
+ local stat_dir=/var/lib/roccat
+ keepdir $stat_dir
+ fowners root:roccat $stat_dir
+ fperms 2770 $stat_dir
+ readme.gentoo_src_install
+}
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+pkg_postinst() {
+ gnome2_icon_cache_update
+ readme.gentoo_print_elog
+ ewarn
+ ewarn "Starting from version 3.0.0, executables were renamed and now prefixed with 'roccat',"
+ ewarn "so konextdconfig is now roccatkonextdconfig and so on"
+ ewarn "Everything that was ryos is now ryosmk to distinguish it from the ryostkl product range"
+ ewarn
+ ewarn "In version 3.5.0-r1 the support for Lua as a scripting language for RyosMKPro"
+ ewarn "ripple effects has been changed. Now in combination with USE=lua to enable it"
+ ewarn "one also needs to put additional use flag depending on which lua version is wanted - "
+ ewarn "it can be USE=lua51 for Lua 5.1 or USE=lua52 for 5.2"
+ ewarn
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-apps/roccat-tools/roccat-tools-3.5.0.ebuild b/sys-apps/roccat-tools/roccat-tools-3.5.0.ebuild
new file mode 100644
index 000000000000..f92e790407eb
--- /dev/null
+++ b/sys-apps/roccat-tools/roccat-tools-3.5.0.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo cmake-utils gnome2-utils udev user
+
+DESCRIPTION="Utility for advanced configuration of Roccat devices"
+
+HOMEPAGE="http://roccat.sourceforge.net/"
+SRC_URI="mirror://sourceforge/roccat/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE_INPUT_DEVICES="
+ input_devices_roccat_arvo
+ input_devices_roccat_isku
+ input_devices_roccat_iskufx
+ input_devices_roccat_kone
+ input_devices_roccat_koneplus
+ input_devices_roccat_konepure
+ input_devices_roccat_konepuremilitary
+ input_devices_roccat_konepureoptical
+ input_devices_roccat_konextd
+ input_devices_roccat_konextdoptical
+ input_devices_roccat_kovaplus
+ input_devices_roccat_lua
+ input_devices_roccat_pyra
+ input_devices_roccat_savu
+ input_devices_roccat_ryosmk
+ input_devices_roccat_ryostkl
+ input_devices_roccat_tyon
+"
+IUSE="${IUSE_INPUT_DEVICES} lua"
+REQUIRED_USE="
+ lua? ( input_devices_roccat_ryosmk )
+"
+
+RDEPEND="
+ >=dev-libs/libgaminggear-0.10
+ x11-libs/gtk+:2
+ x11-libs/libnotify
+ media-libs/libcanberra
+ virtual/libusb:1
+ dev-libs/dbus-glib
+ virtual/libgudev:=
+ lua? ( || ( dev-lang/lua:5.1 dev-lang/lua:0 ) )
+"
+
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ enewgroup roccat
+}
+
+src_configure() {
+ local UDEVDIR="$(get_udevdir)"/rules.d
+ local MODELS=${INPUT_DEVICES//roccat_/}
+ mycmakeargs=(
+ -DDEVICES=${MODELS// /;} \
+ -DUDEVDIR="${UDEVDIR/"//"//}"
+ )
+ if use lua ; then
+ mycmakeargs+=( -DWITH_LUA=5.1 )
+ fi
+ cmake-utils_src_configure
+}
+src_install() {
+ cmake-utils_src_install
+ local stat_dir=/var/lib/roccat
+ keepdir $stat_dir
+ fowners root:roccat $stat_dir
+ fperms 2770 $stat_dir
+ readme.gentoo_src_install
+}
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+pkg_postinst() {
+ gnome2_icon_cache_update
+ readme.gentoo_print_elog
+ ewarn
+ ewarn "Starting from version 3.0.0, executables were renamed and now prefixed with 'roccat',"
+ ewarn "so konextdconfig is now roccatkonextdconfig and so on"
+ ewarn "Everything that was ryos is now ryosmk to distinguish it from the ryostkl product range"
+ ewarn
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/sys-apps/rsbac-admin/Manifest b/sys-apps/rsbac-admin/Manifest
new file mode 100644
index 000000000000..8a83d9cef250
--- /dev/null
+++ b/sys-apps/rsbac-admin/Manifest
@@ -0,0 +1,3 @@
+DIST rsbac-admin-1.4.6.tar.bz2 325844 SHA256 5edde3c5f84a3ebca8ff2c1164665dd4386d8cae1e215cd0784b613867ef03c1
+DIST rsbac-admin-1.4.7.tar.xz 267640 SHA256 d9fff603e6d4bd9b70cca3cae626aa1559863a22a8cacf8c1f7a38d91f8f088a SHA512 7ccdd1e9a87ebf5c0739975d58bcc60462d7c59c2b59bd5b0c9cd31b746e7cb90e2890245882f65b202aa61660b36507c6d895632ca12ecf4d626d560fed8901 WHIRLPOOL faad1a9900ba5e3926bf2a8c398cf03a4dc366a78051f800d8116fdd00a20381b9da48896b6cb808c492cd15019fbe0ede701ca92796cdf9ac907b85274f7a10
+DIST rsbac-admin-1.4.8.tar.xz 261512 SHA256 1e34b54702a4c8dfb2fc5d99a034dd7d3d9968e707dc51ac88c773cf9e0de5ed SHA512 4fe147d81f4dfe7a364557d07707ac5e218fbfc5658f2f1b14462edee377f10e778edb4535988210740fc68951cc05ac17bc3949fbae6803f3c25770b4be462e WHIRLPOOL 5caf07862d1dec309ab6978934b1fb007fe1bfaf711b6bf15df3f680103cb392b40a95c28c805ab552d07ccac67d103eea13894057d879b506e913b57bbe3a2f
diff --git a/sys-apps/rsbac-admin/files/nsswitch.conf b/sys-apps/rsbac-admin/files/nsswitch.conf
new file mode 100644
index 000000000000..43c5b172f0ab
--- /dev/null
+++ b/sys-apps/rsbac-admin/files/nsswitch.conf
@@ -0,0 +1,24 @@
+# /etc/nsswitch.conf:
+
+passwd: compat rsbac [NOTFOUND=continue SUCCESS=continue]
+shadow: compat rsbac
+group: compat rsbac [NOTFOUND=continue SUCCESS=continue]
+
+# passwd: db files nis
+# shadow: db files nis
+# group: db files nis
+
+hosts: files dns
+networks: files dns
+
+services: db files
+protocols: db files
+rpc: db files
+ethers: db files
+
+netmasks: files
+netgroup: files
+bootparams: files
+
+automount: files
+aliases: files
diff --git a/sys-apps/rsbac-admin/files/rklogd b/sys-apps/rsbac-admin/files/rklogd
new file mode 100644
index 000000000000..9dd2a6270d49
--- /dev/null
+++ b/sys-apps/rsbac-admin/files/rklogd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+daemon="rklogd"
+rsbac_info="/proc/rsbac-info"
+
+start() {
+ ebegin "Starting rklogd"
+
+ local ret
+ if [ -d "${rsbac_info}" ]; then
+ if type run-jail >/dev/null 2>&1; then
+ $(which run-jail) $daemon start-stop-daemon --start --exec $(which ${daemon})
+ else
+ start-stop-daemon --start --exec $(which ${daemon})
+ fi
+ ret=$?
+ else
+ ewarn "No rsbac-info directory avaible."
+ ret=1
+ fi
+
+ eend $ret
+}
+
+stop() {
+ ebegin "Stopping rklogd"
+ start-stop-daemon --stop --exec $(which ${daemon})
+ eend $?
+}
diff --git a/sys-apps/rsbac-admin/files/rsbac.conf b/sys-apps/rsbac-admin/files/rsbac.conf
new file mode 100644
index 000000000000..e646c003898a
--- /dev/null
+++ b/sys-apps/rsbac-admin/files/rsbac.conf
@@ -0,0 +1,8 @@
+# RSBAC menu configuration
+# Thu Jun 17 01:36:19 CEST 2004
+RSBACMOD="PAX DAZ FF RC ACL AUTH CAP JAIL RES "
+DIALOG="dialog"
+# RSBACLANG is not set
+TMPDIR="/tmp"
+# RSBACPATH is not set
+# RSBACLOGFILE is not set
diff --git a/sys-apps/rsbac-admin/metadata.xml b/sys-apps/rsbac-admin/metadata.xml
new file mode 100644
index 000000000000..cb485827c1ce
--- /dev/null
+++ b/sys-apps/rsbac-admin/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>hardened</herd>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <longdescription lang="en">
+ Administrative tool for RSBAC system
+ </longdescription>
+ <use>
+ <flag name="rklogd">Enabled deprecated RSBAC kernel logger</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/rsbac-admin/rsbac-admin-1.4.6-r1.ebuild b/sys-apps/rsbac-admin/rsbac-admin-1.4.6-r1.ebuild
new file mode 100644
index 000000000000..8f5ce2dccb16
--- /dev/null
+++ b/sys-apps/rsbac-admin/rsbac-admin-1.4.6-r1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Rule Set Based Access Control (RSBAC) Admin Tools"
+HOMEPAGE="http://www.rsbac.org/"
+SRC_URI="http://www.rsbac.org/dl.php?file=code/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# using rklogd is deprecated but offer the option since it is fully removed
+# from source
+IUSE="pam rklogd"
+
+DEPEND="
+ dev-util/dialog
+ pam? ( sys-libs/pam )
+ sys-apps/baselayout
+ >=sys-libs/ncurses-5.2"
+
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ local rsbacmakeargs="libs tools"
+ use rklogd && rsbacmakeargs="${rsbacmakeargs} rklogd"
+ use pam && rsbacmakeargs="${rsbacmakeargs} pam nss"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) ${rsbacmakeargs}
+}
+
+src_install() {
+ local rsbacinstallargs="headers-install libs-install tools-install"
+ use rklogd && rsbacinstallargs="${rsbacinstallargs} rklogd-install"
+ use pam && rsbacinstallargs="${rsbacinstallargs} pam-install nss-install"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) DESTDIR="${D}" ${rsbacinstallargs}
+
+ use rklogd && doinitd "${FILESDIR}"/rklogd
+
+ insinto /etc
+ doins "${FILESDIR}"/rsbac.conf
+
+ #FHS compliance
+ dodir /usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/librsbac.{,l}a "${D}"/usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/libnss_rsbac.{,l}a "${D}"/usr/$(get_libdir)
+ gen_usr_ldscript librsbac.so
+ gen_usr_ldscript libnss_rsbac.so
+}
+
+pkg_postinst() {
+ einfo "********************************************************************************"
+ einfo "You have to add a security user to your system if you have not already done so."
+ einfo "The name could be 'secoff' or 'security' and, if you did not change the default"
+ einfo "uid in the RSBAC kernel configuration, then the following will work:"
+ einfo
+ einfo " groupadd -g 400 security"
+ einfo " useradd -g 400 -u 400 security"
+ einfo
+ einfo "We suggest you run a separate copy of syslog-ng (for example) to log RSBAC"
+ einfo "messages as user 'audit' (uid 404) instead of using the deprecated rklogd."
+ einfo "See"
+ einfo
+ einfo " http://www.rsbac.org/documentation/administration_examples/syslog-ng"
+ einfo
+ einfo "for more information."
+ einfo "********************************************************************************"
+}
diff --git a/sys-apps/rsbac-admin/rsbac-admin-1.4.6.ebuild b/sys-apps/rsbac-admin/rsbac-admin-1.4.6.ebuild
new file mode 100644
index 000000000000..ec800f62cd6a
--- /dev/null
+++ b/sys-apps/rsbac-admin/rsbac-admin-1.4.6.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit user multilib toolchain-funcs
+
+DESCRIPTION="Rule Set Based Access Control (RSBAC) Admin Tools"
+HOMEPAGE="http://www.rsbac.org/"
+SRC_URI="http://www.rsbac.org/dl.php?file=code/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="pam"
+
+DEPEND="
+ dev-util/dialog
+ pam? ( sys-libs/pam )
+ sys-apps/baselayout"
+
+RDEPEND="
+ ${DEPEND}
+ >=sys-libs/ncurses-5.2"
+
+src_compile() {
+ local rsbacmakeargs="libs tools"
+ use pam && rsbacmakeargs="${makeargs} pam nss"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) ${rsbacmakeargs}
+}
+
+src_install() {
+ local rsbacinstallargs="headers-install libs-install tools-install"
+ use pam && rsbacinstallargs="${rsbacinstallargs} pam-install nss-install"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) DESTDIR="${D}" ${rsbacinstallargs}
+
+ insinto /etc
+ doins "${FILESDIR}"/rsbac.conf
+ doins "${FILESDIR}"/nsswitch.conf
+
+ dodir /secoff
+ keepdir /secoff
+
+ dodir /var/log/rsbac
+ keepdir /var/log/rsbac
+
+ #FHS compliance
+ dodir /usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/librsbac.{,l}a "${D}"/usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/libnss_rsbac.{,l}a "${D}"/usr/$(get_libdir)
+ gen_usr_ldscript librsbac.so
+ gen_usr_ldscript libnss_rsbac.so
+}
+
+pkg_postinst() {
+ enewgroup secoff 400
+ enewuser secoff 400 /bin/bash /secoff secoff
+ enewgroup audit 404
+ enewuser audit 404 -1 /dev/null audit
+
+ chmod 700 /secoff /var/log/rsbac
+ chown secoff:secoff -R /secoff
+
+ einfo "It is suggested to run (for example) a separate copy of syslog-ng to"
+ einfo "log RSBAC messages, as user audit (uid 404) instead of using the deprecated"
+ einfo "rklogd. See http://www.rsbac.org/documentation/administration_examples/syslog-ng"
+ einfo "for more information."
+}
diff --git a/sys-apps/rsbac-admin/rsbac-admin-1.4.7.ebuild b/sys-apps/rsbac-admin/rsbac-admin-1.4.7.ebuild
new file mode 100644
index 000000000000..90ceb6fefcab
--- /dev/null
+++ b/sys-apps/rsbac-admin/rsbac-admin-1.4.7.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Rule Set Based Access Control (RSBAC) Admin Tools"
+HOMEPAGE="http://www.rsbac.org/"
+SRC_URI="http://download.rsbac.org/code/${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# using rklogd is deprecated but offer the option since it is fully removed
+# from source
+IUSE="pam rklogd"
+
+DEPEND="
+ dev-util/dialog
+ pam? ( sys-libs/pam )
+ sys-apps/baselayout
+ >=sys-libs/ncurses-5.2"
+
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ local rsbacmakeargs="libs tools"
+ use rklogd && rsbacmakeargs="${rsbacmakeargs} rklogd"
+ use pam && rsbacmakeargs="${rsbacmakeargs} pam nss"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) ${rsbacmakeargs}
+}
+
+src_install() {
+ local rsbacinstallargs="headers-install libs-install tools-install"
+ use rklogd && rsbacinstallargs="${rsbacinstallargs} rklogd-install"
+ use pam && rsbacinstallargs="${rsbacinstallargs} pam-install nss-install"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) DESTDIR="${D}" ${rsbacinstallargs}
+
+ use rklogd && doinitd "${FILESDIR}"/rklogd
+
+ insinto /etc
+ doins "${FILESDIR}"/rsbac.conf
+
+ #FHS compliance
+ dodir /usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/librsbac.{,l}a "${D}"/usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/libnss_rsbac.{,l}a "${D}"/usr/$(get_libdir)
+ gen_usr_ldscript librsbac.so
+ gen_usr_ldscript libnss_rsbac.so
+}
+
+pkg_postinst() {
+ einfo "********************************************************************************"
+ einfo "You have to add a security user to your system if you have not already done so."
+ einfo "The name could be 'secoff' or 'security' and, if you did not change the default"
+ einfo "uid in the RSBAC kernel configuration, then the following will work:"
+ einfo
+ einfo " groupadd -g 400 security"
+ einfo " useradd -g 400 -u 400 security"
+ einfo
+ einfo "We suggest you run a separate copy of syslog-ng (for example) to log RSBAC"
+ einfo "messages as user 'audit' (uid 404) instead of using the deprecated rklogd."
+ einfo "See"
+ einfo
+ einfo " http://www.rsbac.org/documentation/administration_examples/syslog-ng"
+ einfo
+ einfo "for more information."
+ einfo "********************************************************************************"
+}
diff --git a/sys-apps/rsbac-admin/rsbac-admin-1.4.8.ebuild b/sys-apps/rsbac-admin/rsbac-admin-1.4.8.ebuild
new file mode 100644
index 000000000000..8c985209f283
--- /dev/null
+++ b/sys-apps/rsbac-admin/rsbac-admin-1.4.8.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Rule Set Based Access Control (RSBAC) Admin Tools"
+HOMEPAGE="http://www.rsbac.org/"
+SRC_URI="http://download.rsbac.org/code/${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# using rklogd is deprecated but offer the option since it is fully removed
+# from source
+IUSE="pam rklogd"
+
+DEPEND="
+ dev-util/dialog
+ pam? ( sys-libs/pam )
+ sys-apps/baselayout
+ >=sys-libs/ncurses-5.2"
+
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ local rsbacmakeargs="libs tools"
+ use rklogd && rsbacmakeargs="${rsbacmakeargs} rklogd"
+ use pam && rsbacmakeargs="${rsbacmakeargs} pam nss"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) ${rsbacmakeargs}
+}
+
+src_install() {
+ local rsbacinstallargs="headers-install libs-install tools-install"
+ use rklogd && rsbacinstallargs="${rsbacinstallargs} rklogd-install"
+ use pam && rsbacinstallargs="${rsbacinstallargs} pam-install nss-install"
+ emake PREFIX=/usr LIBDIR=/$(get_libdir) DESTDIR="${D}" ${rsbacinstallargs}
+
+ use rklogd && doinitd "${FILESDIR}"/rklogd
+
+ insinto /etc
+ doins "${FILESDIR}"/rsbac.conf
+
+ #FHS compliance
+ dodir /usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/librsbac.{,l}a "${D}"/usr/$(get_libdir)
+ mv "${D}"/$(get_libdir)/libnss_rsbac.{,l}a "${D}"/usr/$(get_libdir)
+ gen_usr_ldscript librsbac.so
+ gen_usr_ldscript libnss_rsbac.so
+}
+
+pkg_postinst() {
+ einfo "********************************************************************************"
+ einfo "You have to add a security user to your system if you have not already done so."
+ einfo "The name could be 'secoff' or 'security' and, if you did not change the default"
+ einfo "uid in the RSBAC kernel configuration, then the following will work:"
+ einfo
+ einfo " groupadd -g 400 security"
+ einfo " useradd -g 400 -u 400 security"
+ einfo
+ einfo "We suggest you run a separate copy of syslog-ng (for example) to log RSBAC"
+ einfo "messages as user 'audit' (uid 404) instead of using the deprecated rklogd."
+ einfo "See"
+ einfo
+ einfo " http://www.rsbac.org/documentation/administration_examples/syslog-ng"
+ einfo
+ einfo "for more information."
+ einfo "********************************************************************************"
+}
diff --git a/sys-apps/s390-tools/Manifest b/sys-apps/s390-tools/Manifest
new file mode 100644
index 000000000000..e38a00073660
--- /dev/null
+++ b/sys-apps/s390-tools/Manifest
@@ -0,0 +1,4 @@
+DIST e2fsprogs-1.41.3.tar.gz 4365234 SHA256 ce77edae680d090cb8275eca9be282bdbc5fbef028d7bf6f772fb4f04b578d7a
+DIST linux-2.6.27.tar.bz2 50355835 SHA256 0e99bf9e83f4d1ae0c656741a84dfddfa9c4d2469cf35475f5939d02dc3e4393
+DIST s390-tools-1.17.0.tar.bz2 608123 SHA256 4026a93851771c957a880f331ca73d469c171777ed8e79d3027a0877b3220112 SHA512 5d5b82f56ff0990c42b1db15115db5b6924680c7985e20572232ae5f85438b6c28bd25502d162f718b07e24d6837ec3bd15dd5b38a783692d2ead48c4fd2af92 WHIRLPOOL ae885ff376313afecc48159fa952b126e606408c1cb299959763be0d093e7cec8c45bd72b265e819143c131e735ab5c13e7d31f3039c9359da4d0fa52a014c46
+DIST s390-tools-1.23.1.tar.bz2 625295 SHA256 11175b1d7d0c10832dc0295880656f9e10866f004c07770379052a9f7c6ffd8f SHA512 c1f0fe79cfcbf6217e1aba74172e7644eee25f8886b70885e8558ad48342d6b41b35cefd398c3f5ff430d382ea6103b93ed8f666f0038d4f5abc3c3bc787d0eb WHIRLPOOL 501e0233a1f463bd156b2ab199bc75a30fccb4630c62654c4769eb5592e88735bfb718eeaae22b130e380b91b0c16e28f526763263cebbb8ccc45e0fca350fd8
diff --git a/sys-apps/s390-tools/files/s390-tools-1.13.0-build.patch b/sys-apps/s390-tools/files/s390-tools-1.13.0-build.patch
new file mode 100644
index 000000000000..0676a5bb410a
--- /dev/null
+++ b/sys-apps/s390-tools/files/s390-tools-1.13.0-build.patch
@@ -0,0 +1,153 @@
+ - fix errors in subdir makes
+ - parallelize subdir runs
+ - cleanup flag handling
+
+--- a/Makefile
++++ b/Makefile
+@@ -9,19 +9,19 @@
+ vmconvert vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
+ ziomon iucvterm hyptop cmsfs-fuse
+
+-all: subdirs_make
++SUB_DIRS_ALL = $(patsubst %,subdirs_all_%,$(SUB_DIRS))
++SUB_DIRS_CLEAN = $(patsubst %,subdirs_clean_%,$(SUB_DIRS))
++SUB_DIRS_INSTALL = $(patsubst %,subdirs_install_%,$(SUB_DIRS))
+
+-subdirs_make:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- ( cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH); cd .. ); \
+- done
++all: $(SUB_DIRS_ALL)
+
+-clean:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- ( cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) clean; cd .. ); \
+- done
++_subdir = $(patsubst subdirs_%,%,$@)
++subdir = $(shell expr $(_subdir) : '[^_]*_\(.*\)')
++subtarget = $(shell expr $(_subdir) : '\([^_]*\)_.*')
++subdirs_%:
++ $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) -C $(subdir) $(subtarget)
++
++clean: $(SUB_DIRS_CLEAN)
+
+ install:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- ( cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) install; cd .. ); \
+- done
++ $(MAKE) $(SUB_DIRS_INSTALL)
+--- a/common.mak
++++ b/common.mak
+@@ -17,10 +17,10 @@
+ # Cross Compiling Support
+ CROSS_COMPILE =
+ AS = $(call echocmd," AS ",/$@)$(CROSS_COMPILE)as
+-LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc
++LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc $(CFLAGS) $(LDFLAGS)
+ LD = $(call echocmd," LD ",/$@)$(CROSS_COMPILE)ld
+ CC = $(call echocmd," CC ",/$@)$(CROSS_COMPILE)gcc
+-LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++
++LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++ $(CXXFLAGS) $(LDFLAGS)
+ CXX = $(call echocmd," CXX ",/$@)$(CROSS_COMPILE)g++
+ CPP = $(call echocmd," CPP ",/$@)$(CROSS_COMPILE)gcc -E
+ AR = $(call echocmd," AR ",/$@)$(CROSS_COMPILE)ar
+@@ -41,14 +41,13 @@
+ ZFCPDUMP_RD = zfcpdump.rd
+ export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
+
+-CFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+- -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
+- -g $(OPT_FLAGS)
+-CXXFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+- -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
+- -g $(OPT_FLAGS)
++CFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CXXFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CPPFLAGS += \
++ -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
++ -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
++ -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR)
++export CPPFLAGS
+
+ # make G=1
+ # Compile tools so that gcov can be used to collect code coverage data.
+@@ -76,7 +75,7 @@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
+
+ %: %.o
+- $(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
++ $(LINK) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+ all:
+
+--- a/zfcpdump/ramdisk/Makefile
++++ b/zfcpdump/ramdisk/Makefile
+@@ -12,16 +12,14 @@
+
+ all: $(ZFCPDUMP_RD)
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I../../include
++LDFLAGS += -static
++LDLIBS += -lz
+
+ $(ZFCPDUMP_RD): zfcp_dumper
+ /bin/sh ./create_rd.sh $(ARCH)
+
+-zfcp_dumper: zfcp_dumper.o
+- $(CC) -o zfcp_dumper -static zfcp_dumper.o -lz
+-
+ zfcp_dumper.o: zfcp_dumper.c zfcp_dumper.h
+- $(CC) $(CFLAGS) -c -I../../include zfcp_dumper.c
+
+ install: $(ZFCPDUMP_RD)
+ /bin/sh ./create_rd.sh -i
+@@ -29,6 +27,3 @@
+ clean clobber:
+ /bin/sh ./create_rd.sh -r
+ rm -f *.o
+-
+-%.o: %.c
+- $(CC) $(CFLAGS) -c -o $@ $<
+--- a/zfcpdump_v2/Makefile
++++ b/zfcpdump_v2/Makefile
+@@ -6,12 +6,13 @@
+ LINUX_DIR := linux-$(LINUX_VERSION)
+ E2FSPROGS := e2fsprogs-1.41.3
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DGZIP_SUPPORT
++LDFLAGS += -static
++LDLIBS += -lz
+
+ all: zfcpdump.image
+
+ zfcpdump: zfcpdump.c zfcpdump.h
+- $(CC) $(CFLAGS) -D GZIP_SUPPORT -static -o $@ zfcpdump.c -lz
+
+ e2fsck:
+ tar xfzv $(E2FSPROGS).tar.gz
+--- a/zipl/boot/Makefile
++++ b/zipl/boot/Makefile
+@@ -3,9 +3,8 @@
+
+ S390_TOOLS_VERSION_EBCDIC := $(shell echo -n $(S390_TOOLS_RELEASE) | dd conv=ebcdic 2> /dev/null | hexdump -v -e '/1 "0x%02x,"' | sed 's/.$$//')
+
+-CFLAGS += -I../include -D__ASSEMBLY__ \
++CPPFLAGS += -I../include -D__ASSEMBLY__ \
+ -DS390_TOOLS_VERSION_EBCDIC=$(S390_TOOLS_VERSION_EBCDIC)
+-LDFLAGS = -O2
+ FILES := fba0.bin fba2.bin eckd0.bin eckd1a.bin eckd1b.bin eckd2.bin \
+ eckd2dump.bin tapedump.bin stage3.bin tape0.bin fba2dump.bin \
+ eckd2mvdump.bin
+@@ -16,7 +15,7 @@
+ %: %.S
+
+ %.o: %.S
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+ %.exec: %.o
+ @STAGE=$$( \
diff --git a/sys-apps/s390-tools/files/s390-tools-1.13.0-larl.patch b/sys-apps/s390-tools/files/s390-tools-1.13.0-larl.patch
new file mode 100644
index 000000000000..7bf6cf41e94c
--- /dev/null
+++ b/sys-apps/s390-tools/files/s390-tools-1.13.0-larl.patch
@@ -0,0 +1,67 @@
+https://bugs.gentoo.org/391433
+
+You reported a zipl build problem for 31 bit:
+http://marc.info/?l=linux-s390&m=132307473025493&w=2
+
+The following patch (for s390-tools-1.15.0) should fix this problem:
+---
+From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
+Subject: zipl: Do not use larl for 31 bit code
+
+The larl instruction is not available for pre z900 machines in 31 bit mode.
+In order to be able to compile zipl also for that machines, with this
+patch the larl instruction is replaced by instructions that work on
+older machines.
+
+Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
+---
+ zipl/boot/dumpcommon.S | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/zipl/boot/dumpcommon.S
++++ b/zipl/boot/dumpcommon.S
+@@ -1005,7 +1005,7 @@ _count_mem_32:
+ mr %r2,%r1 # mem size in bytes in %r3
+
+ st %r3,.Ldh_real_mem_size+4-0b(%r13)
+- larl %r7,.Lmem_upper_limit+4
++ l %r7,.Lmem_upper_limit_addr-0b(%r13)
+ l %r6,0(%r7) # check if we have an upper limit
+ clr %r3,%r6
+ bl .Lsavemem-0b(%r13)
+@@ -1018,13 +1018,15 @@ _count_mem_32:
+
+ clr %r6,%r3
+ bne .Lexit-0b(%r13)
+- larl %r2,.Lmsg_mem_limit_set # print mem limit warning
++ la %r2,.Lmsg_mem_limit_set-0b(%r13) # print mem limit warning
+ bras %r14,_sclp_print
+ .Lexit:
+ lm %r6,%r15,120(%r15)
+ br %r14
+ .Lonemb:
+ .int 0x100000
++.Lmem_upper_limit_addr:
++ .long .Lmem_upper_limit+4
+
+
+ # expand Macros
+
+> it fixes most of them, but seems there's still one left :)
+
+Ok, try this one:
+---
+ zipl/boot/tapedump.S | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/zipl/boot/tapedump.S
++++ b/zipl/boot/tapedump.S
+@@ -532,7 +532,7 @@ _dump_mem_32:
+ # Cartridge full
+
+ la %r2,EMEM
+- larl %r14,_panik_32
++ l %r14,.Lpanik_32-0b(%r13)
+ basr %r14,%r14
+
+ 1: # All memory written
diff --git a/sys-apps/s390-tools/files/s390-tools-1.16.0-build.patch b/sys-apps/s390-tools/files/s390-tools-1.16.0-build.patch
new file mode 100644
index 000000000000..5cead716cf0b
--- /dev/null
+++ b/sys-apps/s390-tools/files/s390-tools-1.16.0-build.patch
@@ -0,0 +1,153 @@
+ - fix errors in subdir makes
+ - parallelize subdir runs
+ - cleanup flag handling
+
+--- a/Makefile
++++ b/Makefile
+@@ -9,19 +9,19 @@
+ vmconvert vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
+ ziomon iucvterm hyptop cmsfs-fuse
+
+-all: subdirs_make
++SUB_DIRS_ALL = $(patsubst %,subdirs_all_%,$(SUB_DIRS))
++SUB_DIRS_CLEAN = $(patsubst %,subdirs_clean_%,$(SUB_DIRS))
++SUB_DIRS_INSTALL = $(patsubst %,subdirs_install_%,$(SUB_DIRS))
+
+-subdirs_make:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH); cd ..; \
+- done
++all: $(SUB_DIRS_ALL)
+
+-clean:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) clean; cd ..; \
+- done
++_subdir = $(patsubst subdirs_%,%,$@)
++subdir = $(shell expr $(_subdir) : '[^_]*_\(.*\)')
++subtarget = $(shell expr $(_subdir) : '\([^_]*\)_.*')
++subdirs_%:
++ $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) -C $(subdir) $(subtarget)
++
++clean: $(SUB_DIRS_CLEAN)
+
+ install:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) install; cd ..; \
+- done
++ $(MAKE) $(SUB_DIRS_INSTALL)
+--- a/common.mak
++++ b/common.mak
+@@ -17,10 +17,10 @@
+ # Cross Compiling Support
+ CROSS_COMPILE =
+ AS = $(call echocmd," AS ",/$@)$(CROSS_COMPILE)as
+-LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc
++LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc $(CFLAGS) $(LDFLAGS)
+ LD = $(call echocmd," LD ",/$@)$(CROSS_COMPILE)ld
+ CC = $(call echocmd," CC ",/$@)$(CROSS_COMPILE)gcc
+-LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++
++LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++ $(CXXFLAGS) $(LDFLAGS)
+ CXX = $(call echocmd," CXX ",/$@)$(CROSS_COMPILE)g++
+ CPP = $(call echocmd," CPP ",/$@)$(CROSS_COMPILE)gcc -E
+ AR = $(call echocmd," AR ",/$@)$(CROSS_COMPILE)ar
+@@ -41,14 +41,13 @@
+ ZFCPDUMP_RD = zfcpdump.rd
+ export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
+
+-CFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+- -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
+- -g $(OPT_FLAGS)
+-CXXFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+- -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
+- -g $(OPT_FLAGS)
++CFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CXXFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CPPFLAGS += \
++ -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
++ -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
++ -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR)
++export CPPFLAGS
+
+ # make G=1
+ # Compile tools so that gcov can be used to collect code coverage data.
+@@ -76,7 +75,7 @@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
+
+ %: %.o
+- $(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
++ $(LINK) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+ all:
+
+--- a/zfcpdump/ramdisk/Makefile
++++ b/zfcpdump/ramdisk/Makefile
+@@ -12,16 +12,14 @@
+
+ all: $(ZFCPDUMP_RD)
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I../../include
++LDFLAGS += -static
++LDLIBS += -lz
+
+ $(ZFCPDUMP_RD): zfcp_dumper
+ /bin/sh ./create_rd.sh $(ARCH)
+
+-zfcp_dumper: zfcp_dumper.o
+- $(CC) -o zfcp_dumper -static zfcp_dumper.o -lz
+-
+ zfcp_dumper.o: zfcp_dumper.c zfcp_dumper.h
+- $(CC) $(CFLAGS) -c -I../../include zfcp_dumper.c
+
+ install: $(ZFCPDUMP_RD)
+ /bin/sh ./create_rd.sh -i
+@@ -29,6 +27,3 @@
+ clean clobber:
+ /bin/sh ./create_rd.sh -r
+ rm -f *.o
+-
+-%.o: %.c
+- $(CC) $(CFLAGS) -c -o $@ $<
+--- a/zfcpdump_v2/Makefile
++++ b/zfcpdump_v2/Makefile
+@@ -6,12 +6,13 @@
+ LINUX_DIR := linux-$(LINUX_VERSION)
+ E2FSPROGS := e2fsprogs-1.41.3
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DGZIP_SUPPORT
++LDFLAGS += -static
++LDLIBS += -lz
+
+ all: zfcpdump.image
+
+ zfcpdump: zfcpdump.c zfcpdump.h
+- $(CC) $(CFLAGS) -D GZIP_SUPPORT -static -o $@ zfcpdump.c -lz
+
+ e2fsck:
+ tar xfzv $(E2FSPROGS).tar.gz
+--- a/zipl/boot/Makefile
++++ b/zipl/boot/Makefile
+@@ -3,9 +3,8 @@
+
+ S390_TOOLS_VERSION_EBCDIC := $(shell echo -n $(S390_TOOLS_RELEASE) | dd conv=ebcdic 2> /dev/null | hexdump -v -e '/1 "0x%02x,"' | sed 's/.$$//')
+
+-CFLAGS += -I../include -D__ASSEMBLY__ \
++CPPFLAGS += -I../include -D__ASSEMBLY__ \
+ -DS390_TOOLS_VERSION_EBCDIC=$(S390_TOOLS_VERSION_EBCDIC)
+-LDFLAGS = -O2
+ FILES := fba0.bin fba2.bin eckd0.bin eckd1a.bin eckd1b.bin eckd2.bin \
+ eckd2dump.bin tapedump.bin stage3.bin tape0.bin fba2dump.bin \
+ eckd2mvdump.bin
+@@ -16,7 +15,7 @@
+ %: %.S
+
+ %.o: %.S
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+ %.exec: %.o
+ @STAGE=$$( \
diff --git a/sys-apps/s390-tools/files/s390-tools-1.23.1-build.patch b/sys-apps/s390-tools/files/s390-tools-1.23.1-build.patch
new file mode 100644
index 000000000000..1733f13f78e0
--- /dev/null
+++ b/sys-apps/s390-tools/files/s390-tools-1.23.1-build.patch
@@ -0,0 +1,153 @@
+ - fix errors in subdir makes
+ - parallelize subdir runs
+ - cleanup flag handling
+
+--- a/Makefile
++++ b/Makefile
+@@ -9,19 +9,19 @@
+ vmconvert vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
+ ziomon iucvterm hyptop cmsfs-fuse qethqoat
+
+-all: subdirs_make
++SUB_DIRS_ALL = $(patsubst %,subdirs_all_%,$(SUB_DIRS))
++SUB_DIRS_CLEAN = $(patsubst %,subdirs_clean_%,$(SUB_DIRS))
++SUB_DIRS_INSTALL = $(patsubst %,subdirs_install_%,$(SUB_DIRS))
+
+-subdirs_make:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH); cd ..; \
+- done
++all: $(SUB_DIRS_ALL)
+
+-clean:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) clean; cd ..; \
+- done
++_subdir = $(patsubst subdirs_%,%,$@)
++subdir = $(shell expr $(_subdir) : '[^_]*_\(.*\)')
++subtarget = $(shell expr $(_subdir) : '\([^_]*\)_.*')
++subdirs_%:
++ $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) -C $(subdir) $(subtarget)
++
++clean: $(SUB_DIRS_CLEAN)
+
+ install:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) install; cd ..; \
+- done
++ $(MAKE) $(SUB_DIRS_INSTALL)
+--- a/common.mak
++++ b/common.mak
+@@ -17,10 +17,10 @@
+ # Cross Compiling Support
+ CROSS_COMPILE =
+ AS = $(call echocmd," AS ",/$@)$(CROSS_COMPILE)as
+-LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc
++LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc $(CFLAGS) $(LDFLAGS)
+ LD = $(call echocmd," LD ",/$@)$(CROSS_COMPILE)ld
+ CC = $(call echocmd," CC ",/$@)$(CROSS_COMPILE)gcc
+-LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++
++LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++ $(CXXFLAGS) $(LDFLAGS)
+ CXX = $(call echocmd," CXX ",/$@)$(CROSS_COMPILE)g++
+ CPP = $(call echocmd," CPP ",/$@)$(CROSS_COMPILE)gcc -E
+ AR = $(call echocmd," AR ",/$@)$(CROSS_COMPILE)ar
+@@ -41,14 +41,13 @@
+ ZFCPDUMP_RD = zfcpdump.rd
+ export ZFCPDUMP_DIR ZFCPDUMP_IMAGE ZFCPDUMP_RD
+
+-CFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+- -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
+- -g $(OPT_FLAGS)
+-CXXFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
+- -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR) \
+- -g $(OPT_FLAGS)
++CFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CXXFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CPPFLAGS += \
++ -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
++ -DS390_TOOLS_LIBDIR=$(TOOLS_LIBDIR) \
++ -DS390_TOOLS_SYSCONFDIR=$(SYSCONFDIR)
++export CPPFLAGS
+
+ # make G=1
+ # Compile tools so that gcov can be used to collect code coverage data.
+@@ -76,7 +75,7 @@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
+
+ %: %.o
+- $(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
++ $(LINK) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+ all:
+
+--- a/zfcpdump/ramdisk/Makefile
++++ b/zfcpdump/ramdisk/Makefile
+@@ -12,16 +12,14 @@
+
+ all: $(ZFCPDUMP_RD)
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I../../include
++LDFLAGS += -static
++LDLIBS += -lz
+
+ $(ZFCPDUMP_RD): zfcp_dumper
+ /bin/sh ./create_rd.sh $(ARCH)
+
+-zfcp_dumper: zfcp_dumper.o
+- $(CC) -o zfcp_dumper -static zfcp_dumper.o -lz
+-
+ zfcp_dumper.o: zfcp_dumper.c zfcp_dumper.h
+- $(CC) $(CFLAGS) -c -I../../include zfcp_dumper.c
+
+ install: $(ZFCPDUMP_RD)
+ /bin/sh ./create_rd.sh -i
+@@ -29,6 +27,3 @@
+ clean clobber:
+ /bin/sh ./create_rd.sh -r
+ rm -f *.o
+-
+-%.o: %.c
+- $(CC) $(CFLAGS) -c -o $@ $<
+--- a/zfcpdump_v2/Makefile
++++ b/zfcpdump_v2/Makefile
+@@ -6,12 +6,13 @@
+ LINUX_DIR := linux-$(LINUX_VERSION)
+ E2FSPROGS := e2fsprogs-1.41.3
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DGZIP_SUPPORT
++LDFLAGS += -static
++LDLIBS += -lz
+
+ all: zfcpdump.image
+
+ zfcpdump: zfcpdump.c zfcpdump.h
+- $(CC) $(CFLAGS) -D GZIP_SUPPORT -static -o $@ zfcpdump.c -lz
+
+ e2fsck:
+ tar xfzv $(E2FSPROGS).tar.gz
+--- a/zipl/boot/Makefile
++++ b/zipl/boot/Makefile
+@@ -3,9 +3,8 @@
+
+ S390_TOOLS_VERSION_EBCDIC := $(shell echo -n $(S390_TOOLS_RELEASE) | dd conv=ebcdic 2> /dev/null | hexdump -v -e '/1 "0x%02x,"' | sed 's/.$$//')
+
+-CFLAGS += -I../include -D__ASSEMBLY__ \
++CPPFLAGS += -I../include -D__ASSEMBLY__ \
+ -DS390_TOOLS_VERSION_EBCDIC=$(S390_TOOLS_VERSION_EBCDIC)
+-LDFLAGS = -O2
+ FILES := fba0.bin fba1b.bin fba2.bin \
+ eckd0_ldl.bin eckd0_cdl.bin \
+ eckd1.bin eckd1b.bin eckd2.bin \
+@@ -16,7 +15,7 @@
+ %: %.S
+
+ %.o: %.S
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+ %.exec: %.o
+ @STAGE=$$( \
diff --git a/sys-apps/s390-tools/files/s390-tools-1.9.0-build.patch b/sys-apps/s390-tools/files/s390-tools-1.9.0-build.patch
new file mode 100644
index 000000000000..38d3e3f954d0
--- /dev/null
+++ b/sys-apps/s390-tools/files/s390-tools-1.9.0-build.patch
@@ -0,0 +1,156 @@
+ - fix errors in subdir makes
+ - parallelize subdir runs
+ - cleanup flag handling
+
+--- a/Makefile
++++ b/Makefile
+@@ -9,19 +9,19 @@
+ vmconvert vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
+ ziomon iucvterm cmsfs-fuse
+
+-all: subdirs_make
++SUB_DIRS_ALL = $(patsubst %,subdirs_all_%,$(SUB_DIRS))
++SUB_DIRS_CLEAN = $(patsubst %,subdirs_clean_%,$(SUB_DIRS))
++SUB_DIRS_INSTALL = $(patsubst %,subdirs_install_%,$(SUB_DIRS))
+
+-subdirs_make:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- ( cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH); cd .. ); \
+- done
++all: $(SUB_DIRS_ALL)
+
+-clean:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- ( cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) clean; cd .. ); \
+- done
++_subdir = $(patsubst subdirs_%,%,$@)
++subdir = $(shell expr $(_subdir) : '[^_]*_\(.*\)')
++subtarget = $(shell expr $(_subdir) : '\([^_]*\)_.*')
++subdirs_%:
++ $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) -C $(subdir) $(subtarget)
++
++clean: $(SUB_DIRS_CLEAN)
+
+ install:
+- set -e ; for dir in $(SUB_DIRS) ; do \
+- ( cd $$dir ; $(MAKE) TOPDIR=$(TOPDIR) ARCH=$(ARCH) install; cd .. ); \
+- done
++ $(MAKE) $(SUB_DIRS_INSTALL)
+--- a/common.mak
++++ b/common.mak
+@@ -17,10 +17,10 @@
+ # Cross Compiling Support
+ CROSS_COMPILE =
+ AS = $(call echocmd," AS ",/$@)$(CROSS_COMPILE)as
+-LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc
++LINK = $(call echocmd," LINK ",/$@)$(CROSS_COMPILE)gcc $(CFLAGS) $(LDFLAGS)
+ LD = $(call echocmd," LD ",/$@)$(CROSS_COMPILE)ld
+ CC = $(call echocmd," CC ",/$@)$(CROSS_COMPILE)gcc
+-LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++
++LINKXX = $(call echocmd," LINKXX ",/$@)$(CROSS_COMPILE)g++ $(CXXFLAGS) $(LDFLAGS)
+ CXX = $(call echocmd," CXX ",/$@)$(CROSS_COMPILE)g++
+ CPP = $(call echocmd," CPP ",/$@)$(CROSS_COMPILE)gcc -E
+ AR = $(call echocmd," AR ",/$@)$(CROSS_COMPILE)ar
+@@ -41,11 +41,10 @@
+ else
+ WARNFLAGS = -W -Wall
+ endif
+-CFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -g $(OPT_FLAGS)
+-CXXFLAGS = $(WARNFLAGS) -O3 -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
+- -g $(OPT_FLAGS)
+-export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP INSTALL CFLAGS
++CFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CXXFLAGS += $(WARNFLAGS) $(OPT_FLAGS)
++CPPFLAGS += -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE)
++export AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP INSTALL CFLAGS CXXFLAGS CPPFLAGS
+
+ # Support alternate install root
+ INSTROOT =
+@@ -76,7 +75,7 @@
+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
+
+ %: %.o
+- $(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
++ $(LINK) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+ all:
+
+--- a/zfcpdump/ramdisk/Makefile
++++ b/zfcpdump/ramdisk/Makefile
+@@ -12,16 +12,14 @@
+
+ all: $(ZFCPDUMP_RD)
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I../../include
++LDFLAGS += -static
++LDLIBS += -lz
+
+ $(ZFCPDUMP_RD): zfcp_dumper
+ /bin/sh ./create_rd.sh $(ARCH)
+
+-zfcp_dumper: zfcp_dumper.o
+- $(CC) -o zfcp_dumper -static zfcp_dumper.o -lz
+-
+ zfcp_dumper.o: zfcp_dumper.c zfcp_dumper.h
+- $(CC) $(CFLAGS) -c -I../../include zfcp_dumper.c
+
+ install: $(ZFCPDUMP_RD)
+ /bin/sh ./create_rd.sh -i
+@@ -29,6 +27,3 @@
+ clean clobber:
+ /bin/sh ./create_rd.sh -r
+ rm -f *.o
+-
+-%.o: %.c
+- $(CC) $(CFLAGS) -c -o $@ $<
+--- a/zfcpdump_v2/Makefile
++++ b/zfcpdump_v2/Makefile
+@@ -6,12 +6,13 @@
+ LINUX_DIR := linux-$(LINUX_VERSION)
+ E2FSPROGS := e2fsprogs-1.41.3
+
+-CFLAGS += -D_FILE_OFFSET_BITS=64
++CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DGZIP_SUPPORT
++LDFLAGS += -static
++LDLIBS += -lz
+
+ all: zfcpdump.image
+
+ zfcpdump: zfcpdump.c zfcpdump.h
+- $(CC) $(CFLAGS) -D GZIP_SUPPORT -static -o $@ zfcpdump.c -lz
+
+ e2fsck:
+ tar xfzv $(E2FSPROGS).tar.gz
+--- a/zipl/boot/Makefile
++++ b/zipl/boot/Makefile
+@@ -3,9 +3,8 @@
+
+ S390_TOOLS_VERSION_EBCDIC := $(shell echo -n $(S390_TOOLS_RELEASE) | dd conv=ebcdic 2> /dev/null | hexdump -v -e '/1 "0x%02x,"' | sed 's/.$$//')
+
+-CFLAGS += -I../include -D__ASSEMBLY__ \
++CPPFLAGS += -I../include -D__ASSEMBLY__ \
+ -DS390_TOOLS_VERSION_EBCDIC=$(S390_TOOLS_VERSION_EBCDIC)
+-LDFLAGS = -O2
+ FILES := fba0.bin fba2.bin eckd0.bin eckd1a.bin eckd1b.bin eckd2.bin \
+ eckd2dump.bin tapedump.bin stage3.bin tape0.bin fba2dump.bin \
+ eckd2mvdump.bin
+@@ -16,7 +15,7 @@
+ %: %.S
+
+ %.o: %.S
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+ %.exec: %.o
+ @STAGE=$$( \
+@@ -34,7 +33,7 @@
+ 2) SFLAGS="-nostdlib -Wl,-Ttext,0x2000";; \
+ 3) SFLAGS="-nostdlib -Wl,-Ttext,0xA000";; \
+ esac; \
+- $(LINK) $(LDFLAGS) -o $@ $$SFLAGS $<
++ $(LINK) -o $@ $$SFLAGS $<
+
+ %.bin: %.exec
+ $(OBJCOPY) -O binary --only-section=.text $< $@
diff --git a/sys-apps/s390-tools/metadata.xml b/sys-apps/s390-tools/metadata.xml
new file mode 100644
index 000000000000..87e1df2ef2d4
--- /dev/null
+++ b/sys-apps/s390-tools/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>s390</herd>
+ <maintainer>
+ <email>s390@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+A set of user space utilities that should be used together with the
+zSeries (s390) Linux kernel and device drivers
+</longdescription>
+ <use>
+ <flag name="fuse">build cmsfs-fuse to read files stored on a z/VM CMS disk</flag>
+ <flag name="zfcpdump">build the kernel disk dumping utility</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">e2fsprogs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/s390-tools/s390-tools-1.17.0.ebuild b/sys-apps/s390-tools/s390-tools-1.17.0.ebuild
new file mode 100644
index 000000000000..6c026774d659
--- /dev/null
+++ b/sys-apps/s390-tools/s390-tools-1.17.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils udev
+
+# look at zfcpdump_v2/README
+E2FSPROGS_P=e2fsprogs-1.41.3
+LINUX_P=linux-2.6.27
+
+DESCRIPTION="User space utilities for the zSeries (s390) Linux kernel and device drivers"
+HOMEPAGE="http://www.ibm.com/developerworks/linux/linux390/s390-tools.html"
+SRC_URI="http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/${P}.tar.bz2
+ zfcpdump? (
+ mirror://sourceforge/e2fsprogs/${E2FSPROGS_P}.tar.gz
+ mirror://kernel/linux/kernel/v2.6/${LINUX_P}.tar.bz2
+ )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* s390"
+IUSE="fuse snmp zfcpdump"
+
+RDEPEND="fuse? ( sys-fs/fuse )
+ snmp? ( net-analyzer/net-snmp )"
+DEPEND="${RDEPEND}
+ dev-util/indent
+ app-admin/genromfs"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.16.0-build.patch
+
+ use snmp || sed -i -e 's:osasnmpd::' Makefile
+ use fuse || { sed -i -e 's:cmsfs-fuse::' Makefile; export WITHOUT_FUSE=1; }
+
+ if use zfcpdump ; then
+ local x
+ for x in ${E2FSPROGS_P}.tar.gz ${LINUX_P}.tar.bz2 ; do
+ ln -s "${DISTDIR}"/${x} zfcpdump_v2/${x} || die "ln ${x}"
+ done
+ sed -i -e '/^ZFCPDUMP_DIR/s:local/::' common.mak
+ sed -i -e '/^SUB_DIRS/s:=:=zfcpdump_v2 :' Makefile
+ fi
+
+ export MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake install INSTROOT="${D}" USRBINDIR="${D}/sbin"
+ dodoc README
+ udev_dorules etc/udev/rules.d/*.rules
+}
diff --git a/sys-apps/s390-tools/s390-tools-1.23.1.ebuild b/sys-apps/s390-tools/s390-tools-1.23.1.ebuild
new file mode 100644
index 000000000000..67e52b804acf
--- /dev/null
+++ b/sys-apps/s390-tools/s390-tools-1.23.1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils udev
+
+# look at zfcpdump_v2/README
+E2FSPROGS_P=e2fsprogs-1.41.3
+LINUX_P=linux-2.6.27
+
+DESCRIPTION="User space utilities for the zSeries (s390) Linux kernel and device drivers"
+HOMEPAGE="http://www.ibm.com/developerworks/linux/linux390/s390-tools.html"
+SRC_URI="http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/${P}.tar.bz2
+ zfcpdump? (
+ mirror://sourceforge/e2fsprogs/${E2FSPROGS_P}.tar.gz
+ mirror://kernel/linux/kernel/v2.6/${LINUX_P}.tar.bz2
+ )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* s390"
+IUSE="fuse snmp zfcpdump"
+
+RDEPEND="fuse? ( sys-fs/fuse )
+ snmp? ( net-analyzer/net-snmp )"
+DEPEND="${RDEPEND}
+ dev-util/indent
+ app-admin/genromfs"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.23.1-build.patch
+
+ use snmp || sed -i -e 's:osasnmpd::' Makefile
+ use fuse || { sed -i -e 's:cmsfs-fuse::' Makefile; export WITHOUT_FUSE=1; }
+
+ if use zfcpdump ; then
+ local x
+ for x in ${E2FSPROGS_P}.tar.gz ${LINUX_P}.tar.bz2 ; do
+ ln -s "${DISTDIR}"/${x} zfcpdump_v2/${x} || die "ln ${x}"
+ done
+ sed -i -e '/^ZFCPDUMP_DIR/s:local/::' common.mak
+ sed -i -e '/^SUB_DIRS/s:=:=zfcpdump_v2 :' Makefile
+ fi
+
+ export MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake install INSTROOT="${D}" USRBINDIR="${D}/sbin"
+ dodoc README
+ udev_dorules etc/udev/rules.d/*.rules
+}
diff --git a/sys-apps/s6/Manifest b/sys-apps/s6/Manifest
new file mode 100644
index 000000000000..272611d7bf8a
--- /dev/null
+++ b/sys-apps/s6/Manifest
@@ -0,0 +1 @@
+DIST s6-2.1.3.0.tar.gz 181237 SHA256 73057df188f1ac8db186b96298c0cb6081199aa73d3f2f8d5fabdbbe21c3ea04 SHA512 f5b962fb9f36a910fd8b56b1158cc28d1dab808f22f6beb309b8c23dab1863409aaecd2e3806b51ec34aef1c70f117d3b8af4c7167e0e854f6925fe278cdcaca WHIRLPOOL 03283a6c2a8a9419bf7e27a9e6c46fe2fe9ad0cbb384f4da0efaec56f5066ab36d20b00aae7a81408ca7b94a1325625feb83173e99e9ff9e85f28be69e6ba2c7
diff --git a/sys-apps/s6/metadata.xml b/sys-apps/s6/metadata.xml
new file mode 100644
index 000000000000..86b621740cd9
--- /dev/null
+++ b/sys-apps/s6/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>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+ </maintainer>
+ <longdescription lang="en">
+ S6 is a small suite of programs for UNIX designed to allow
+ service supervision similar to daemontools or runit.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/s6/s6-2.1.3.0.ebuild b/sys-apps/s6/s6-2.1.3.0.ebuild
new file mode 100644
index 000000000000..49d101fd644e
--- /dev/null
+++ b/sys-apps/s6/s6-2.1.3.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib
+
+DESCRIPTION="skarnet.org's small and secure supervision software suite"
+HOMEPAGE="http://www.skarnet.org/software/s6/"
+SRC_URI="http://www.skarnet.org/software/${PN}/${P}.tar.gz"
+
+LICENSE="ISC"
+SLOT="0"
+KEYWORDS="amd64 ~x86"
+IUSE="static"
+
+DEPEND=">=sys-devel/make-4.0
+ static? (
+ >=dev-lang/execline-2.1.1.0[static-libs]
+ >=dev-libs/skalibs-2.3.2.0[static-libs]
+ )
+ !static? (
+ >=dev-lang/execline-2.1.1.0
+ >=dev-libs/skalibs-2.3.2.0
+ )
+ "
+RDEPEND="
+ !static? (
+ >=dev-lang/execline-2.1.1.0
+ >=dev-libs/skalibs-2.3.2.0
+ )
+ "
+
+src_prepare()
+{
+ # Remove QA warning about LDFLAGS addition
+ sed -i "s~tryldflag LDFLAGS_AUTO -Wl,--hash-style=both~:~" "${S}/configure" || die
+}
+
+src_configure()
+{
+ econf \
+ $(use_enable !static shared) \
+ $(use_enable static allstatic) \
+ $(use_enable static) \
+ --bindir=/bin \
+ --sbindir=/sbin \
+ --dynlibdir=/$(get_libdir) \
+ --libdir=/usr/$(get_libdir)/${PN} \
+ --datadir=/etc \
+ --sysdepdir=/usr/$(get_libdir)/${PN} \
+ --with-dynlib=/$(get_libdir) \
+ --with-sysdeps=/usr/$(get_libdir)/skalibs
+}
+
+src_compile()
+{
+ emake DESTDIR="${D}"
+}
+
+src_install()
+{
+ default
+ dodoc -r examples
+ dohtml -r doc/*
+}
diff --git a/sys-apps/salinfo/Manifest b/sys-apps/salinfo/Manifest
new file mode 100644
index 000000000000..b013aa5cb0d5
--- /dev/null
+++ b/sys-apps/salinfo/Manifest
@@ -0,0 +1 @@
+DIST salinfo-1.2.tar.gz 40511 SHA256 4c5b19a38d29b9e2883fc9f5ef3a5e9198c4a323b7cd1b35da21e86f392e1498 SHA512 6a92eb6ff38965a93ea61f034ba3607b871b7250cb640ced21b0eabaf94214ad2df78a3fb059fa0c61eb7aa90a6fc4e592ea852b89629b259c36d2b17fb7c4ca WHIRLPOOL d831aa5f773d51ff8170d6c102b211887e49bf24636f9f85dbc0154a393211fa3716f78b1b9e39013ce454336333ff184fbee28fbc047057dd31832fcb5eb236
diff --git a/sys-apps/salinfo/files/salinfo-1.2-build.patch b/sys-apps/salinfo/files/salinfo-1.2-build.patch
new file mode 100644
index 000000000000..848b363939af
--- /dev/null
+++ b/sys-apps/salinfo/files/salinfo-1.2-build.patch
@@ -0,0 +1,47 @@
+--- a/Makefile
++++ b/Makefile
+@@ -1,3 +1,4 @@
++prefix = $(DESTDIR)
+ mandir := /usr/share/man
+ sbindir := /usr/sbin
+ logdir := /var/log/salinfo
+@@ -5,7 +6,7 @@ initdir := /etc/rc.d/init.d
+ sysconfigdir := /etc/sysconfig
+ logrotate := /etc/logrotate.d
+
+-CFLAGS += -Wall -g -O2 $(EXTRA_CFLAGS)
++CFLAGS += -Wall $(EXTRA_CFLAGS)
+ export CFLAGS
+
+ ifneq ($(VPATH),)
+--- a/sal.h
++++ b/sal.h
+@@ -27,6 +27,8 @@
+ * Keith Owens <kaos@sgi.com>
+ */
+
++#include <asm/fpu.h>
++
+ #include "efi.h"
+ #include "pal.h"
+
+--- a/salinfo_decode.c
++++ b/salinfo_decode.c
+@@ -303,7 +303,7 @@ log_dropped_records(void)
+ snprintf(line, sizeof(line), ", %d %s",
+ dropped_all[i]->dropped, dropped_all[i]->name);
+ dropped_all[i]->dropped = 0;
+- strncat(log, line, sizeof(log));
++ strncat(log, line, sizeof(log) - strlen(log));
+ }
+ }
+ syslog(LOG_NOTICE, "%s", log);
+@@ -424,7 +424,7 @@ talk_to_sal (void)
+ int fd;
+ char filename[PATH_MAX];
+ snprintf(filename, sizeof(filename), "%s/%s/.check", directory, rd[i]);
+- if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC)) < 0) {
++ if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) {
+ perror(filename);
+ goto out;
+ }
diff --git a/sys-apps/salinfo/metadata.xml b/sys-apps/salinfo/metadata.xml
new file mode 100644
index 000000000000..fe15722775f2
--- /dev/null
+++ b/sys-apps/salinfo/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>ia64</herd>
+</pkgmetadata>
diff --git a/sys-apps/salinfo/salinfo-1.2.ebuild b/sys-apps/salinfo/salinfo-1.2.ebuild
new file mode 100644
index 000000000000..2af829959d3b
--- /dev/null
+++ b/sys-apps/salinfo/salinfo-1.2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="decode Itanium SAL records (e.g. various hardware errors)"
+HOMEPAGE="https://www.kernel.org/pub/linux/kernel/people/helgaas/"
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ia64"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-build.patch
+}
+
+src_configure() {
+ tc-export CC
+}
+
+src_install() {
+ default
+ rm -rf "${ED}"/etc/{rc.d,sysconfig} "${ED}"/var || die
+}
diff --git a/sys-apps/sandbox/Manifest b/sys-apps/sandbox/Manifest
new file mode 100644
index 000000000000..42aa4b15b3b0
--- /dev/null
+++ b/sys-apps/sandbox/Manifest
@@ -0,0 +1,5 @@
+DIST sandbox-1.6.tar.lzma 307014 SHA256 52cfd286da3d5d51f3b6e012e409e931b21e32b4f2f16ba5677e46328680f4f4 SHA512 f470599a67443fa107612fef1cc73b64b3146003ae21bb5ae5abd852c4c37aec93ac09be646fda9d55d4c3aeef0cf28a42fa675f2acbb53c1d903e400538ba4c WHIRLPOOL 7c7fbe57cc831d0eb7853476e264a85bb8113620948e761563a872d3d55fd3c0ff063332397199001ea9dcb8258f348b827f337b876b2a26f727f10abbc8f712
+DIST sandbox-2.3.tar.xz 344260 SHA256 8670f7508453c2fd300ca29ad2eb457691c3df01c4c22fa27d4a7c880fd291d5 SHA512 06ddaa6dc0822474c263650e95284af6cb69c60c9443b5caaf95af8140283f937d5594849064847fe3a4ad89b29b6ef6d6e909a9b85bb5d7fcf8b427d0e9c7e4 WHIRLPOOL 5d3f45a0bbb1aeffb8c83f8978bea65764aa438a5abcb50c66b5f66232d972bde84013694f6806fcc0026cd6d37420c69655d66ec5984a1c6f71a68dcfc95d11
+DIST sandbox-2.4.tar.xz 344664 SHA256 450599cb3052296d42f81a04dbbda82d220415fc2d16f5dc6e26b042d580fd3e SHA512 c0f8b789bcabd48e03a20a97c9daa82c48f264d7641ecfa51dff7a2d2c34be398cf1db6235eb0211bf0fa78b07bd6e633e06bc102904bf9dd8a95f9fde1ca615 WHIRLPOOL 22f0f55f6e638275781ab5afa29b1a7f5e7f3335a3d2ff37d9fcce0bf9284b271bf1d69b98bcd4b06fdb9ff1528d044f9fb111a58c2a1a5ce33cbe28c0cb869d
+DIST sandbox-2.5.tar.xz 355680 SHA256 c0e98767fb70750d79591a6d08f81d5c2f13ce783bf94bd90677022e9103878a SHA512 7b870295bb78c1da5550b650a3983d93e503935a8e8452a29a5c6310cc2c2d569a898ea1534e2c670b4a3e5607504fac55f69da6878e0adc9c2c65a5476b4fb0 WHIRLPOOL 887d36638111b09d77674002c07ebad84c24bc4f645d9fb78e180a6c6e7407eb3fb6857877bc152e0cefb676f01df60b20857b8487ce28ff3e4438aef744fe53
+DIST sandbox-2.6.tar.xz 366356 SHA256 95615c5879dfc419713f22ba5506a2802a50ea0ce8a2f57c656354f2e50b1c4d SHA512 32ba7fb675c67fdc8bc52da1db7ed6878e5fea8753accb30d9aca00f708e0dde03287b5962caf5ef031bea6934d6ef3e18404b015c70ebd551d3fd8109ad2371 WHIRLPOOL bab2d015fb0de92a2266408ca7941c8fb66b599179040cfc727ffce5b2424a9722dc55ba89d198e3361044d8cb357314205488d2a980c7b8af063fd8940f0c03
diff --git a/sys-apps/sandbox/files/0001-libsandbox-handle-more-at-functions.patch b/sys-apps/sandbox/files/0001-libsandbox-handle-more-at-functions.patch
new file mode 100644
index 000000000000..09462b7e1b64
--- /dev/null
+++ b/sys-apps/sandbox/files/0001-libsandbox-handle-more-at-functions.patch
@@ -0,0 +1,42 @@
+From 25425878243c5ca1ff21e6f479e585c60b943930 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 30 Mar 2009 19:56:29 -0400
+Subject: [PATCH] libsandbox: handle more *at functions
+
+Add some more *at functions to the main checking code.
+
+URL: http://bugs.gentoo.org/264320
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Reported-by: Harald van Dijk <truedfx@gentoo.org>
+---
+ libsandbox/libsandbox.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
+index 88248af..c3f0b55 100644
+--- a/libsandbox/libsandbox.c
++++ b/libsandbox/libsandbox.c
+@@ -681,15 +681,20 @@ static int check_access(sbcontext_t *sbcontext, int sb_nr, const char *func,
+ sb_nr == SB_NR_CREAT ||
+ sb_nr == SB_NR_CREAT64 ||
+ sb_nr == SB_NR_MKDIR ||
++ sb_nr == SB_NR_MKDIRAT ||
+ sb_nr == SB_NR_MKNOD ||
+ sb_nr == SB_NR_MKNODAT ||
+ sb_nr == SB_NR__XMKNOD ||
+ sb_nr == SB_NR___XMKNOD ||
+ sb_nr == SB_NR___XMKNODAT ||
+ sb_nr == SB_NR_MKFIFO ||
++ sb_nr == SB_NR_MKFIFOAT ||
+ sb_nr == SB_NR_LINK ||
++ sb_nr == SB_NR_LINKAT ||
+ sb_nr == SB_NR_SYMLINK ||
++ sb_nr == SB_NR_SYMLINKAT ||
+ sb_nr == SB_NR_RENAME ||
++ sb_nr == SB_NR_RENAMEAT ||
+ sb_nr == SB_NR_LUTIMES ||
+ sb_nr == SB_NR_UTIMENSAT ||
+ sb_nr == SB_NR_UTIME ||
+--
+1.6.2
+
diff --git a/sys-apps/sandbox/files/09sandbox b/sys-apps/sandbox/files/09sandbox
new file mode 100644
index 000000000000..9181eb068caf
--- /dev/null
+++ b/sys-apps/sandbox/files/09sandbox
@@ -0,0 +1 @@
+CONFIG_PROTECT_MASK="/etc/sandbox.d"
diff --git a/sys-apps/sandbox/files/sandbox-1.6-disable-pthread.patch b/sys-apps/sandbox/files/sandbox-1.6-disable-pthread.patch
new file mode 100644
index 000000000000..490bc41c0eed
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-1.6-disable-pthread.patch
@@ -0,0 +1,37 @@
+http://bugs.gentoo.org/263657
+
+disable pthread locks ... this is how stable has always worked, so there
+wont be any regressions ...
+
+diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c
+index 034d0e7..595d17f 100644
+--- a/libsandbox/libsandbox.c
++++ b/libsandbox/libsandbox.c
+@@ -814,9 +814,6 @@
+ return result;
+ }
+
+-/* Need to protect the global sbcontext structure */
+-static pthread_mutex_t sb_syscall_lock = PTHREAD_MUTEX_INITIALIZER;
+-
+ bool before_syscall(int dirfd, int sb_nr, const char *func, const char *file, int flags)
+ {
+ int old_errno = errno;
+@@ -843,8 +840,6 @@
+ file = at_file_buf;
+ }
+
+- pthread_mutex_lock(&sb_syscall_lock);
+-
+ if (!sb_init) {
+ init_context(&sbcontext);
+ sb_init = true;
+@@ -885,8 +880,6 @@
+
+ result = check_syscall(&sbcontext, sb_nr, func, file, flags);
+
+- pthread_mutex_unlock(&sb_syscall_lock);
+-
+ if (0 == result) {
+ if ((NULL != getenv(ENV_SANDBOX_PID)) && (is_env_on(ENV_SANDBOX_ABORT)))
+
diff --git a/sys-apps/sandbox/files/sandbox-1.6-disable-qa-static.patch b/sys-apps/sandbox/files/sandbox-1.6-disable-qa-static.patch
new file mode 100644
index 000000000000..754ef01968c9
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-1.6-disable-qa-static.patch
@@ -0,0 +1,13 @@
+sandbox-1.7 traces static apps so disable the qa notice as it just scares
+users ... dont want scary stuff in stable!
+
+--- libsandbox/wrapper-funcs/__wrapper_exec.c
++++ libsandbox/wrapper-funcs/__wrapper_exec.c
+@@ -221,7 +221,6 @@
+ if (!FUNCTION_SANDBOX_SAFE(path))
+ return result;
+
+- sb_check_exec(path, argv);
+ }
+ #endif
+
diff --git a/sys-apps/sandbox/files/sandbox-2.6-check-empty-paths-at.patch b/sys-apps/sandbox/files/sandbox-2.6-check-empty-paths-at.patch
new file mode 100644
index 000000000000..e4dc5290ed50
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-check-empty-paths-at.patch
@@ -0,0 +1,201 @@
+From dd726dcc6a95355d0e0cc949018d9c8aefc89a02 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 24 Dec 2012 19:41:49 -0500
+Subject: [PATCH 1/2] libsandbox: reject "" paths with *at funcs before
+ checking the dirfd
+
+When it comes to processing errors, an empty path is checked before
+an invalid dirfd. Make sure sandbox matches that behavior for the
+random testsuites out there that look for this.
+
+URL: https://bugs.gentoo.org/346929
+Reported-by: Marien Zwart <marienz@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libsandbox/wrapper-funcs/__pre_check.c | 2 ++
+ libsandbox/wrapper-funcs/mkdirat_pre_check.c | 17 +++++------------
+ libsandbox/wrapper-funcs/openat_pre_check.c | 15 ++++-----------
+ libsandbox/wrapper-funcs/unlinkat_pre_check.c | 17 +++++------------
+ libsandbox/wrappers.h | 2 ++
+ tests/mkdirat-3.sh | 7 +++++++
+ tests/mkdirat.at | 1 +
+ tests/openat-2.sh | 9 +++++++++
+ tests/openat.at | 1 +
+ tests/unlinkat-4.sh | 7 +++++++
+ tests/unlinkat.at | 1 +
+ 11 files changed, 44 insertions(+), 35 deletions(-)
+ create mode 100755 tests/mkdirat-3.sh
+ create mode 100755 tests/openat-2.sh
+ create mode 100755 tests/unlinkat-4.sh
+
+diff --git a/libsandbox/wrapper-funcs/__pre_check.c b/libsandbox/wrapper-funcs/__pre_check.c
+index 2d5711f..28ad91f 100644
+--- a/libsandbox/wrapper-funcs/__pre_check.c
++++ b/libsandbox/wrapper-funcs/__pre_check.c
+@@ -20,3 +20,5 @@
+ #if SB_NR_UNLINK != SB_NR_UNDEF && SB_NR_UNLINKAT == SB_NR_UNDEF
+ # include "unlinkat_pre_check.c"
+ #endif
++
++#include "__pre_at_check.c"
+diff --git a/libsandbox/wrapper-funcs/mkdirat_pre_check.c b/libsandbox/wrapper-funcs/mkdirat_pre_check.c
+index 77a65df..0b48d1f 100644
+--- a/libsandbox/wrapper-funcs/mkdirat_pre_check.c
++++ b/libsandbox/wrapper-funcs/mkdirat_pre_check.c
+@@ -1,20 +1,13 @@
+ bool sb_mkdirat_pre_check(const char *func, const char *pathname, int dirfd)
+ {
+ char canonic[SB_PATH_MAX];
+- char dirfd_path[SB_PATH_MAX];
+
+ save_errno();
+
+- /* Expand the dirfd path first */
+- switch (resolve_dirfd_path(dirfd, pathname, dirfd_path, sizeof(dirfd_path))) {
+- case -1:
+- sb_debug_dyn("EARLY FAIL: %s(%s) @ resolve_dirfd_path: %s\n",
+- func, pathname, strerror(errno));
+- return false;
+- case 0:
+- pathname = dirfd_path;
+- break;
+- }
++ /* Check incoming args against common *at issues */
++ char dirfd_path[SB_PATH_MAX];
++ if (!sb_common_at_pre_check(func, &pathname, dirfd, dirfd_path, sizeof(dirfd_path)))
++ return false;
+
+ /* Then break down any relative/symlink paths */
+ if (-1 == canonicalize(pathname, canonic))
+diff --git a/libsandbox/wrapper-funcs/openat_pre_check.c b/libsandbox/wrapper-funcs/openat_pre_check.c
+index 0127708..5fd5eaa 100644
+--- a/libsandbox/wrapper-funcs/openat_pre_check.c
++++ b/libsandbox/wrapper-funcs/openat_pre_check.c
+@@ -15,17 +15,10 @@ bool sb_openat_pre_check(const char *func, const char *pathname, int dirfd, int
+
+ save_errno();
+
+- /* Expand the dirfd path first */
++ /* Check incoming args against common *at issues */
+ char dirfd_path[SB_PATH_MAX];
+- switch (resolve_dirfd_path(dirfd, pathname, dirfd_path, sizeof(dirfd_path))) {
+- case -1:
+- sb_debug_dyn("EARLY FAIL: %s(%s) @ resolve_dirfd_path: %s\n",
+- func, pathname, strerror(errno));
+- return false;
+- case 0:
+- pathname = dirfd_path;
+- break;
+- }
++ if (!sb_common_at_pre_check(func, &pathname, dirfd, dirfd_path, sizeof(dirfd_path)))
++ return false;
+
+ /* Doesn't exist -> skip permission checks */
+ struct stat st;
+diff --git a/libsandbox/wrapper-funcs/unlinkat_pre_check.c b/libsandbox/wrapper-funcs/unlinkat_pre_check.c
+index 9f5e7d7..c004d15 100644
+--- a/libsandbox/wrapper-funcs/unlinkat_pre_check.c
++++ b/libsandbox/wrapper-funcs/unlinkat_pre_check.c
+@@ -1,20 +1,13 @@
+ bool sb_unlinkat_pre_check(const char *func, const char *pathname, int dirfd)
+ {
+ char canonic[SB_PATH_MAX];
+- char dirfd_path[SB_PATH_MAX];
+
+ save_errno();
+
+- /* Expand the dirfd path first */
+- switch (resolve_dirfd_path(dirfd, pathname, dirfd_path, sizeof(dirfd_path))) {
+- case -1:
+- sb_debug_dyn("EARLY FAIL: %s(%s) @ resolve_dirfd_path: %s\n",
+- func, pathname, strerror(errno));
+- return false;
+- case 0:
+- pathname = dirfd_path;
+- break;
+- }
++ /* Check incoming args against common *at issues */
++ char dirfd_path[SB_PATH_MAX];
++ if (!sb_common_at_pre_check(func, &pathname, dirfd, dirfd_path, sizeof(dirfd_path)))
++ return false;
+
+ /* Then break down any relative/symlink paths */
+ if (-1 == canonicalize(pathname, canonic))
+diff --git a/libsandbox/wrappers.h b/libsandbox/wrappers.h
+index 5b97787..0aa58bb 100644
+--- a/libsandbox/wrappers.h
++++ b/libsandbox/wrappers.h
+@@ -28,5 +28,7 @@ attribute_hidden bool sb_mkdirat_pre_check (const char *func, const char *pathn
+ attribute_hidden bool sb_openat_pre_check (const char *func, const char *pathname, int dirfd, int flags);
+ attribute_hidden bool sb_openat64_pre_check (const char *func, const char *pathname, int dirfd, int flags);
+ attribute_hidden bool sb_unlinkat_pre_check (const char *func, const char *pathname, int dirfd);
++attribute_hidden bool sb_common_at_pre_check(const char *func, const char **pathname, int dirfd,
++ char *dirfd_path, size_t dirfd_path_len);
+
+ #endif
+--
+1.8.1.2
+
+From 0b8a6d9773cc0e6d86bf1187f46817d5716698fe Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 24 Dec 2012 19:41:49 -0500
+Subject: [PATCH 2/2] libsandbox: reject "" paths with *at funcs before
+ checking the dirfd [missing file]
+
+When it comes to processing errors, an empty path is checked before
+an invalid dirfd. Make sure sandbox matches that behavior for the
+random testsuites out there that look for this.
+
+Forgot to `git add` in the previous commit :/.
+
+URL: https://bugs.gentoo.org/346929
+Reported-by: Marien Zwart <marienz@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libsandbox/wrapper-funcs/__pre_at_check.c | 34 +++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
+ create mode 100644 libsandbox/wrapper-funcs/__pre_at_check.c
+
+diff --git a/libsandbox/wrapper-funcs/__pre_at_check.c b/libsandbox/wrapper-funcs/__pre_at_check.c
+new file mode 100644
+index 0000000..f72c40c
+--- /dev/null
++++ b/libsandbox/wrapper-funcs/__pre_at_check.c
+@@ -0,0 +1,34 @@
++/*
++ * common *at() pre-checks.
++ *
++ * Copyright 1999-2012 Gentoo Foundation
++ * Licensed under the GPL-2
++ */
++
++/* We assume the parent has nested use with save/restore errno */
++bool sb_common_at_pre_check(const char *func, const char **pathname, int dirfd,
++ char *dirfd_path, size_t dirfd_path_len)
++{
++ /* the empty path name should fail with ENOENT before any dirfd
++ * checks get a chance to run #346929
++ */
++ if (*pathname && *pathname[0] == '\0') {
++ errno = ENOENT;
++ sb_debug_dyn("EARLY FAIL: %s(%s): %s\n",
++ func, *pathname, strerror(errno));
++ return false;
++ }
++
++ /* Expand the dirfd path first */
++ switch (resolve_dirfd_path(dirfd, *pathname, dirfd_path, dirfd_path_len)) {
++ case -1:
++ sb_debug_dyn("EARLY FAIL: %s(%s) @ resolve_dirfd_path: %s\n",
++ func, *pathname, strerror(errno));
++ return false;
++ case 0:
++ *pathname = dirfd_path;
++ break;
++ }
++
++ return true;
++}
+--
+1.8.1.2
+
diff --git a/sys-apps/sandbox/files/sandbox-2.6-desktop.patch b/sys-apps/sandbox/files/sandbox-2.6-desktop.patch
new file mode 100644
index 000000000000..fbecb0727f97
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-desktop.patch
@@ -0,0 +1,30 @@
+From 00044ab0c8aaaabf048b5ff0ec2da5b3d7d25752 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 17 Nov 2012 14:14:26 -0500
+Subject: [PATCH] sandbox.desktop: drop .svg from Icon field
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+URL: http://bugs.gentoo.org/443672
+Reported-by: Petteri Räty <betelgeuse@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ data/sandbox.desktop | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/data/sandbox.desktop b/data/sandbox.desktop
+index 5b5b576..27a887e 100644
+--- a/data/sandbox.desktop
++++ b/data/sandbox.desktop
+@@ -5,6 +5,6 @@ Type=Application
+ Comment=launch a sandboxed shell ... useful for debugging ebuilds
+ Exec=sandbox
+ TryExec=sandbox
+-Icon=sandbox.svg
++Icon=sandbox
+ Categories=Development;
+ Terminal=true
+--
+1.8.1.2
+
diff --git a/sys-apps/sandbox/files/sandbox-2.6-gcc-5.patch b/sys-apps/sandbox/files/sandbox-2.6-gcc-5.patch
new file mode 100644
index 000000000000..fd87d6a272a5
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-gcc-5.patch
@@ -0,0 +1,13 @@
+fix building w/gcc-5
+
+--- a/libsandbox/Makefile.in
++++ b/libsandbox/Makefile.in
+@@ -68,7 +68,7 @@ sb_nr.h: symbols.h $(SB_NR_FILE)
+
+ TRACE_MAKE_HEADER = \
+ $(SB_AWK) $(GEN_TRACE_SCRIPT) -v MODE=gen | \
+- $(COMPILE) -E -include $(top_srcdir)/headers.h - $$f | \
++ $(COMPILE) -E -P -include $(top_srcdir)/headers.h - $$f | \
+ $(SB_AWK) $(GEN_TRACE_SCRIPT) -v syscall_prefix=$$t > $$header
+ trace_syscalls.h: $(GEN_TRACE_SCRIPT) Makefile
+ if SB_SCHIZO
diff --git a/sys-apps/sandbox/files/sandbox-2.6-log-var.patch b/sys-apps/sandbox/files/sandbox-2.6-log-var.patch
new file mode 100644
index 000000000000..bfea9e55e288
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-log-var.patch
@@ -0,0 +1,51 @@
+From 853b42c86432eefc6d4cfba86197fb37d446366d Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 3 Mar 2013 05:34:09 -0500
+Subject: [PATCH] sandbox: accept SANDBOX_LOG vars whatever their values
+
+Commit 40abb498ca4a24495fe34e133379382ce8c3eaca subtly broke the sandbox
+with portage. It changed how the sandbox log env var was accessed by
+moving from getenv() to get_sandbox_log(). The latter has path checking
+and will kick out values that contain a slash. That means every time a
+new process starts, a new sandbox log path will be generated, and when a
+program triggers a violation, it'll write to the new file. Meanwhile,
+portage itself watches the original one which never gets updated.
+
+This code has been around forever w/out documentation, and I can't think
+of a reason we need it. So punt it.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libsbutil/get_sandbox_log.c | 14 +++++---------
+ 1 file changed, 5 insertions(+), 9 deletions(-)
+
+diff --git a/libsbutil/get_sandbox_log.c b/libsbutil/get_sandbox_log.c
+index a79b399..bdb4278 100644
+--- a/libsbutil/get_sandbox_log.c
++++ b/libsbutil/get_sandbox_log.c
+@@ -21,17 +21,13 @@ static void _get_sb_log(char *path, const char *tmpdir, const char *env, const c
+
+ sandbox_log_env = getenv(env);
+
+- if (sandbox_log_env && is_env_on(ENV_SANDBOX_TESTING)) {
+- /* When testing, just use what the env says to */
++ if (sandbox_log_env) {
++ /* If the env is viable, roll with it. We aren't really
++ * about people breaking the security of the sandbox by
++ * exporting SANDBOX_LOG=/dev/null.
++ */
+ strncpy(path, sandbox_log_env, SB_PATH_MAX);
+ } else {
+- /* THIS CHUNK BREAK THINGS BY DOING THIS:
+- * SANDBOX_LOG=/tmp/sandbox-app-admin/superadduser-1.0.7-11063.log
+- */
+- if ((NULL != sandbox_log_env) &&
+- (NULL != strchr(sandbox_log_env, '/')))
+- sandbox_log_env = NULL;
+-
+ snprintf(path, SB_PATH_MAX, "%s%s%s%s%d%s",
+ SANDBOX_LOG_LOCATION, prefix,
+ (sandbox_log_env == NULL ? "" : sandbox_log_env),
+--
+1.8.1.2
+
diff --git a/sys-apps/sandbox/files/sandbox-2.6-no-pch.patch b/sys-apps/sandbox/files/sandbox-2.6-no-pch.patch
new file mode 100644
index 000000000000..fe2274927f43
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-no-pch.patch
@@ -0,0 +1,29 @@
+gcc crashes when trying to use pch under hardened kernels
+
+http://bugs.gentoo.org/425524
+
+--- Makefile.in
++++ Makefile.in
+@@ -300,7 +300,7 @@
+ src \
+ tests
+
+-SANDBOX_PCH = headers.h.gch libsandbox/headers.h.gch libsbutil/headers.h.gch
++SANDBOX_PCH =
+ BUILT_SOURCES = $(SANDBOX_PCH)
+ noinst_LTLIBRARIES = libpch.la
+ nodist_libpch_la_SOURCES = $(SANDBOX_PCH)
+@@ -862,10 +862,9 @@
+ $(builddir)/headers.h.gch: headers.h
+ $(AM_V_GEN)$(COMPILE) -c -o $@.o $< && $(GCH_CP)
+
+-libsbutil: libsbutil/headers.h.gch
+-libsandbox: libsbutil libsandbox/headers.h.gch
+-src: libsbutil headers.h.gch
+-tests: src headers.h.gch
++libsandbox: libsbutil
++src: libsbutil
++tests: src
+
+ ChangeLog:
+ touch ChangeLog
diff --git a/sys-apps/sandbox/files/sandbox-2.6-open-nofollow.patch b/sys-apps/sandbox/files/sandbox-2.6-open-nofollow.patch
new file mode 100644
index 000000000000..0101ece2c2bc
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-open-nofollow.patch
@@ -0,0 +1,54 @@
+From 45fa8714a1d35e6555083d88a71851ada2aacac4 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 24 Dec 2012 18:46:29 -0500
+Subject: [PATCH] libsandbox: handle open(O_NOFOLLOW)
+
+We don't check for O_NOFOLLOW in the open wrappers, so we end up
+returning the wrong error when operating on broken symlinks.
+
+URL: https://bugs.gentoo.org/413441
+Reported-by: Marien Zwart <marienz@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libsandbox/wrapper-funcs/__64_post.h | 1 +
+ libsandbox/wrapper-funcs/__64_pre.h | 1 +
+ libsandbox/wrapper-funcs/openat_pre_check.c | 2 +-
+ tests/open-2.sh | 10 ++++++++++
+ tests/open.at | 1 +
+ 5 files changed, 14 insertions(+), 1 deletion(-)
+ create mode 100755 tests/open-2.sh
+
+diff --git a/libsandbox/wrapper-funcs/__64_post.h b/libsandbox/wrapper-funcs/__64_post.h
+index 2fd2182..82d2a16 100644
+--- a/libsandbox/wrapper-funcs/__64_post.h
++++ b/libsandbox/wrapper-funcs/__64_post.h
+@@ -1,3 +1,4 @@
+ #undef SB64
+ #undef stat
++#undef lstat
+ #undef off_t
+diff --git a/libsandbox/wrapper-funcs/__64_pre.h b/libsandbox/wrapper-funcs/__64_pre.h
+index 2132110..0b34b25 100644
+--- a/libsandbox/wrapper-funcs/__64_pre.h
++++ b/libsandbox/wrapper-funcs/__64_pre.h
+@@ -1,3 +1,4 @@
+ #define SB64
+ #define stat stat64
++#define lstat lstat64
+ #define off_t off64_t
+diff --git a/libsandbox/wrapper-funcs/openat_pre_check.c b/libsandbox/wrapper-funcs/openat_pre_check.c
+index c827ee6..0127708 100644
+--- a/libsandbox/wrapper-funcs/openat_pre_check.c
++++ b/libsandbox/wrapper-funcs/openat_pre_check.c
+@@ -29,7 +29,7 @@ bool sb_openat_pre_check(const char *func, const char *pathname, int dirfd, int
+
+ /* Doesn't exist -> skip permission checks */
+ struct stat st;
+- if (-1 == stat(pathname, &st)) {
++ if (((flags & O_NOFOLLOW) ? lstat(pathname, &st) : stat(pathname, &st)) == -1) {
+ sb_debug_dyn("EARLY FAIL: %s(%s): %s\n",
+ func, pathname, strerror(errno));
+ return false;
+--
+1.8.1.2
+
diff --git a/sys-apps/sandbox/files/sandbox-2.6-static-close-fd.patch b/sys-apps/sandbox/files/sandbox-2.6-static-close-fd.patch
new file mode 100644
index 000000000000..7fc0972507b4
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-static-close-fd.patch
@@ -0,0 +1,93 @@
+From a3ff1534945c3898332b2481c9fd355dfbd56e1f Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 23 Jun 2012 11:52:51 -0700
+Subject: [PATCH] libsandbox: clean up open file handles in parent tracing
+ process
+
+Currently, if a non-static app sets up a pipe (with cloexec enabled) and
+executes a static app, the handle to that pipe is left open in the parent
+process. This causes trouble when the parent is waiting for that to be
+closed immediately.
+
+Since none of the fds in the forked parent process matter to us, we can
+just go ahead and clean up all fds before we start tracing the child.
+
+URL: http://bugs.gentoo.org/364877
+Reported-by: Victor Stinner <victor.stinner@haypocalc.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libsandbox/trace.c | 3 +-
+ libsbutil/sb_close.c | 26 +++++++++++-
+ libsbutil/sbutil.h | 1 +
+ tests/Makefile.am | 2 +
+ tests/pipe-fork_static_tst.c | 18 +++++++++
+ tests/pipe-fork_tst.c | 95 ++++++++++++++++++++++++++++++++++++++++++++
+ tests/script-9.sh | 5 +++
+ tests/script.at | 1 +
+ 8 files changed, 149 insertions(+), 2 deletions(-)
+ create mode 100644 tests/pipe-fork_static_tst.c
+ create mode 100644 tests/pipe-fork_tst.c
+ create mode 100755 tests/script-9.sh
+
+diff --git a/libsandbox/trace.c b/libsandbox/trace.c
+index 32ad2d6..dfbab18 100644
+--- a/libsandbox/trace.c
++++ b/libsandbox/trace.c
+@@ -504,8 +504,9 @@ void trace_main(const char *filename, char *const argv[])
+ /* Not all kernel versions support this, so ignore return */
+ ptrace(PTRACE_SETOPTIONS, trace_pid, NULL, (void *)PTRACE_O_TRACESYSGOOD);
+ #endif
++ sb_close_all_fds();
+ trace_loop();
+- return;
++ sb_ebort("ISE: child should have quit, as should we\n");
+ }
+
+ sb_debug("child setting up ...");
+diff --git a/libsbutil/sb_close.c b/libsbutil/sb_close.c
+index 17a4560..5379197 100644
+--- a/libsbutil/sb_close.c
++++ b/libsbutil/sb_close.c
+@@ -29,3 +29,27 @@ int sb_close(int fd)
+
+ return res;
+ }
++
++/* Quickly close all the open fds (good for daemonization) */
++void sb_close_all_fds(void)
++{
++ DIR *dirp;
++ struct dirent *de;
++ int dfd, fd;
++ const char *fd_dir = sb_get_fd_dir();
++
++ dirp = opendir(fd_dir);
++ if (!dirp)
++ sb_ebort("could not process %s\n", fd_dir);
++ dfd = dirfd(dirp);
++
++ while ((de = readdir(dirp)) != NULL) {
++ if (de->d_name[0] == '.')
++ continue;
++ fd = atoi(de->d_name);
++ if (fd != dfd)
++ close(fd);
++ }
++
++ closedir(dirp);
++}
+diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
+index 02b88cb..479734b 100644
+--- a/libsbutil/sbutil.h
++++ b/libsbutil/sbutil.h
+@@ -97,6 +97,7 @@ int sb_open(const char *path, int flags, mode_t mode);
+ size_t sb_read(int fd, void *buf, size_t count);
+ size_t sb_write(int fd, const void *buf, size_t count);
+ int sb_close(int fd);
++void sb_close_all_fds(void);
+ int sb_copy_file_to_fd(const char *file, int ofd);
+
+ /* Reliable output */
+--
+1.8.1.2
+
diff --git a/sys-apps/sandbox/files/sandbox-2.6-trace-hppa.patch b/sys-apps/sandbox/files/sandbox-2.6-trace-hppa.patch
new file mode 100644
index 000000000000..7e7382286577
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-trace-hppa.patch
@@ -0,0 +1,27 @@
+From 7b01f6103a9baddaf0252e7f850a4cef91a48b67 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 6 Jul 2012 14:58:16 -0400
+Subject: [PATCH] libsandbox: fix hppa trace code
+
+URL: https://bugs.gentoo.org/425062
+Reported-by: Jeroen Roovers <jer@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ libsandbox/trace/linux/hppa.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libsandbox/trace/linux/hppa.c b/libsandbox/trace/linux/hppa.c
+index d23b0d1..5414354 100644
+--- a/libsandbox/trace/linux/hppa.c
++++ b/libsandbox/trace/linux/hppa.c
+@@ -1,5 +1,5 @@
+-#define trace_reg_sysnum (20 * 4) /* PT_GR20 */
+-#define trace_reg_ret (28 * 4) /* PT_GR28 */
++#define trace_reg_sysnum gr[20]
++#define trace_reg_ret gr[28]
+
+ static unsigned long trace_arg(void *vregs, int num)
+ {
+--
+1.7.9.7
+
diff --git a/sys-apps/sandbox/metadata.xml b/sys-apps/sandbox/metadata.xml
new file mode 100644
index 000000000000..9e13eaea5173
--- /dev/null
+++ b/sys-apps/sandbox/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+
+<!-- portage lacks a herd. correct this when we have one. -->
+
+<maintainer>
+ <email>sandbox@gentoo.org</email>
+ <description>Sandbox Maintainers</description>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/sandbox/sandbox-1.6-r2.ebuild b/sys-apps/sandbox/sandbox-1.6-r2.ebuild
new file mode 100644
index 000000000000..c62785bae1c7
--- /dev/null
+++ b/sys-apps/sandbox/sandbox-1.6-r2.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#
+# don't monkey with this ebuild unless contacting portage devs.
+# period.
+#
+
+inherit eutils flag-o-matic toolchain-funcs multilib unpacker
+
+DESCRIPTION="sandbox'd LD_PRELOAD hack"
+HOMEPAGE="http://www.gentoo.org/proj/en/portage/sandbox/"
+SRC_URI="mirror://gentoo/${P}.tar.lzma
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.lzma"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd -x86-fbsd"
+IUSE=""
+
+DEPEND="app-arch/xz-utils
+ >=app-misc/pax-utils-0.1.19" #265376
+RDEPEND=""
+
+EMULTILIB_PKG="true"
+has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
+
+sandbox_death_notice() {
+ ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
+ ewarn "FEATURES=-sandbox emerge sandbox"
+}
+
+src_unpack() {
+ unpacker_src_unpack
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-disable-qa-static.patch
+ epatch "${FILESDIR}"/${P}-disable-pthread.patch
+ epatch "${FILESDIR}"/0001-libsandbox-handle-more-at-functions.patch
+}
+
+src_compile() {
+ filter-lfs-flags #90228
+
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ mkdir "${WORKDIR}/build-${ABI}"
+ cd "${WORKDIR}/build-${ABI}"
+
+ multilib_toolchain_setup ${ABI}
+
+ einfo "Configuring sandbox for ABI=${ABI}..."
+ ECONF_SOURCE="../${P}/" \
+ econf ${myconf} || die
+ einfo "Building sandbox for ABI=${ABI}..."
+ emake || die
+ done
+ ABI=${OABI}
+}
+
+src_test() {
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Checking sandbox for ABI=${ABI}..."
+ emake check || die "make check failed for ${ABI}"
+ done
+ ABI=${OABI}
+}
+
+src_install() {
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Installing sandbox for ABI=${ABI}..."
+ emake DESTDIR="${D}" install || die "make install failed for ${ABI}"
+ done
+ ABI=${OABI}
+
+ doenvd "${FILESDIR}"/09sandbox
+
+ keepdir /var/log/sandbox
+ fowners root:portage /var/log/sandbox
+ fperms 0770 /var/log/sandbox
+
+ cd "${S}"
+ dodoc AUTHORS ChangeLog* NEWS README
+}
+
+pkg_preinst() {
+ chown root:portage "${D}"/var/log/sandbox
+ chmod 0770 "${D}"/var/log/sandbox
+
+ local old=$(find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
+ if [[ -n ${old} ]] ; then
+ elog "Removing old sandbox libraries for you:"
+ elog ${old//${ROOT}}
+ find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -exec rm -fv {} \;
+ fi
+}
+
+pkg_postinst() {
+ chmod 0755 "${ROOT}"/etc/sandbox.d #265376
+}
diff --git a/sys-apps/sandbox/sandbox-2.3-r1.ebuild b/sys-apps/sandbox/sandbox-2.3-r1.ebuild
new file mode 100644
index 000000000000..33880b226e7d
--- /dev/null
+++ b/sys-apps/sandbox/sandbox-2.3-r1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#
+# don't monkey with this ebuild unless contacting portage devs.
+# period.
+#
+
+inherit eutils flag-o-matic toolchain-funcs multilib unpacker
+
+DESCRIPTION="sandbox'd LD_PRELOAD hack"
+HOMEPAGE="http://www.gentoo.org/proj/en/portage/sandbox/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd -x86-fbsd"
+IUSE="multilib"
+
+DEPEND="app-arch/xz-utils
+ >=app-misc/pax-utils-0.1.19" #265376
+RDEPEND=""
+
+EMULTILIB_PKG="true"
+has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
+
+sandbox_death_notice() {
+ ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
+ ewarn "FEATURES=-sandbox emerge sandbox"
+}
+
+sb_get_install_abis() { use multilib && get_install_abis || echo ${ABI:-default} ; }
+
+src_compile() {
+ filter-lfs-flags #90228
+
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ mkdir "${WORKDIR}/build-${ABI}"
+ cd "${WORKDIR}/build-${ABI}"
+
+ use multilib && multilib_toolchain_setup ${ABI}
+
+ einfo "Configuring sandbox for ABI=${ABI}..."
+ ECONF_SOURCE="../${P}/" \
+ econf ${myconf} || die
+ einfo "Building sandbox for ABI=${ABI}..."
+ emake || die
+ done
+ ABI=${OABI}
+}
+
+src_test() {
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Checking sandbox for ABI=${ABI}..."
+ emake check || die "make check failed for ${ABI}"
+ done
+ ABI=${OABI}
+}
+
+src_install() {
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Installing sandbox for ABI=${ABI}..."
+ emake DESTDIR="${D}" install || die "make install failed for ${ABI}"
+ insinto /etc/sandbox.d #333131
+ doins etc/sandbox.d/00default || die
+ done
+ ABI=${OABI}
+
+ doenvd "${FILESDIR}"/09sandbox
+
+ # fix 00default install #333131
+ rm "${D}"/etc/sandbox.d/*.in || die
+
+ keepdir /var/log/sandbox
+ fowners root:portage /var/log/sandbox
+ fperms 0770 /var/log/sandbox
+
+ cd "${S}"
+ dodoc AUTHORS ChangeLog* NEWS README
+}
+
+pkg_preinst() {
+ chown root:portage "${D}"/var/log/sandbox
+ chmod 0770 "${D}"/var/log/sandbox
+
+ local old=$(find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
+ if [[ -n ${old} ]] ; then
+ elog "Removing old sandbox libraries for you:"
+ elog ${old//${ROOT}}
+ find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -exec rm -fv {} \;
+ fi
+}
+
+pkg_postinst() {
+ chmod 0755 "${ROOT}"/etc/sandbox.d #265376
+}
diff --git a/sys-apps/sandbox/sandbox-2.4.ebuild b/sys-apps/sandbox/sandbox-2.4.ebuild
new file mode 100644
index 000000000000..ec5de60c3a8b
--- /dev/null
+++ b/sys-apps/sandbox/sandbox-2.4.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#
+# don't monkey with this ebuild unless contacting portage devs.
+# period.
+#
+
+inherit eutils flag-o-matic toolchain-funcs multilib unpacker
+
+DESCRIPTION="sandbox'd LD_PRELOAD hack"
+HOMEPAGE="http://www.gentoo.org/proj/en/portage/sandbox/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd -x86-fbsd"
+IUSE="multilib"
+
+DEPEND="app-arch/xz-utils
+ >=app-misc/pax-utils-0.1.19" #265376
+RDEPEND=""
+
+EMULTILIB_PKG="true"
+has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
+
+sandbox_death_notice() {
+ ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
+ ewarn "FEATURES=-sandbox emerge sandbox"
+}
+
+sb_get_install_abis() { use multilib && get_install_abis || echo ${ABI:-default} ; }
+
+src_compile() {
+ filter-lfs-flags #90228
+
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ mkdir "${WORKDIR}/build-${ABI}"
+ cd "${WORKDIR}/build-${ABI}"
+
+ use multilib && multilib_toolchain_setup ${ABI}
+
+ einfo "Configuring sandbox for ABI=${ABI}..."
+ ECONF_SOURCE="../${P}/" \
+ econf ${myconf} || die
+ einfo "Building sandbox for ABI=${ABI}..."
+ emake || die
+ done
+ ABI=${OABI}
+}
+
+src_test() {
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Checking sandbox for ABI=${ABI}..."
+ emake check || die "make check failed for ${ABI}"
+ done
+ ABI=${OABI}
+}
+
+src_install() {
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Installing sandbox for ABI=${ABI}..."
+ emake DESTDIR="${D}" install || die "make install failed for ${ABI}"
+ insinto /etc/sandbox.d #333131
+ doins etc/sandbox.d/00default || die
+ done
+ ABI=${OABI}
+
+ doenvd "${FILESDIR}"/09sandbox
+
+ keepdir /var/log/sandbox
+ fowners root:portage /var/log/sandbox
+ fperms 0770 /var/log/sandbox
+
+ cd "${S}"
+ dodoc AUTHORS ChangeLog* NEWS README
+}
+
+pkg_preinst() {
+ chown root:portage "${D}"/var/log/sandbox
+ chmod 0770 "${D}"/var/log/sandbox
+
+ local old=$(find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
+ if [[ -n ${old} ]] ; then
+ elog "Removing old sandbox libraries for you:"
+ elog ${old//${ROOT}}
+ find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -exec rm -fv {} \;
+ fi
+}
+
+pkg_postinst() {
+ chmod 0755 "${ROOT}"/etc/sandbox.d #265376
+}
diff --git a/sys-apps/sandbox/sandbox-2.5.ebuild b/sys-apps/sandbox/sandbox-2.5.ebuild
new file mode 100644
index 000000000000..1e8271016d4f
--- /dev/null
+++ b/sys-apps/sandbox/sandbox-2.5.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#
+# don't monkey with this ebuild unless contacting portage devs.
+# period.
+#
+
+inherit eutils flag-o-matic toolchain-funcs multilib unpacker multiprocessing
+
+DESCRIPTION="sandbox'd LD_PRELOAD hack"
+HOMEPAGE="http://www.gentoo.org/proj/en/portage/sandbox/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd -x86-fbsd"
+IUSE="multilib"
+
+DEPEND="app-arch/xz-utils
+ >=app-misc/pax-utils-0.1.19" #265376
+RDEPEND=""
+
+EMULTILIB_PKG="true"
+has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
+
+sandbox_death_notice() {
+ ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
+ ewarn "FEATURES=-sandbox emerge sandbox"
+}
+
+sb_get_install_abis() { use multilib && get_install_abis || echo ${ABI:-default} ; }
+
+sb_foreach_abi() {
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Running $1 for ABI=${ABI}..."
+ "$@"
+ done
+ ABI=${OABI}
+}
+
+sb_configure() {
+ mkdir "${WORKDIR}/build-${ABI}"
+ cd "${WORKDIR}/build-${ABI}"
+
+ use multilib && multilib_toolchain_setup ${ABI}
+
+ einfo "Configuring sandbox for ABI=${ABI}..."
+ ECONF_SOURCE="../${P}/" \
+ econf ${myconf} || die
+}
+
+sb_compile() {
+ emake || die
+}
+
+src_compile() {
+ filter-lfs-flags #90228
+
+ # Run configures in parallel!
+ multijob_init
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ multijob_child_init sb_configure
+ done
+ ABI=${OABI}
+ multijob_finish
+
+ sb_foreach_abi sb_compile
+}
+
+sb_test() {
+ emake check TESTSUITEFLAGS="--jobs=$(makeopts_jobs)" || die
+}
+
+src_test() {
+ sb_foreach_abi sb_test
+}
+
+sb_install() {
+ emake DESTDIR="${D}" install || die
+ insinto /etc/sandbox.d #333131
+ doins etc/sandbox.d/00default || die
+}
+
+src_install() {
+ sb_foreach_abi sb_install
+
+ doenvd "${FILESDIR}"/09sandbox
+
+ keepdir /var/log/sandbox
+ fowners root:portage /var/log/sandbox
+ fperms 0770 /var/log/sandbox
+
+ cd "${S}"
+ dodoc AUTHORS ChangeLog* NEWS README
+}
+
+pkg_preinst() {
+ chown root:portage "${D}"/var/log/sandbox
+ chmod 0770 "${D}"/var/log/sandbox
+
+ local old=$(find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
+ if [[ -n ${old} ]] ; then
+ elog "Removing old sandbox libraries for you:"
+ elog ${old//${ROOT}}
+ find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -exec rm -fv {} \;
+ fi
+}
+
+pkg_postinst() {
+ chmod 0755 "${ROOT}"/etc/sandbox.d #265376
+}
diff --git a/sys-apps/sandbox/sandbox-2.6-r1.ebuild b/sys-apps/sandbox/sandbox-2.6-r1.ebuild
new file mode 100644
index 000000000000..8d23317553c1
--- /dev/null
+++ b/sys-apps/sandbox/sandbox-2.6-r1.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+#
+# don't monkey with this ebuild unless contacting portage devs.
+# period.
+#
+
+inherit eutils flag-o-matic toolchain-funcs multilib unpacker multiprocessing
+
+DESCRIPTION="sandbox'd LD_PRELOAD hack"
+HOMEPAGE="http://www.gentoo.org/proj/en/portage/sandbox/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd -x86-fbsd"
+IUSE="multilib"
+
+DEPEND="app-arch/xz-utils
+ >=app-misc/pax-utils-0.1.19" #265376
+RDEPEND=""
+
+EMULTILIB_PKG="true"
+has sandbox_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS="${EBUILD_DEATH_HOOKS} sandbox_death_notice"
+
+sandbox_death_notice() {
+ ewarn "If configure failed with a 'cannot run C compiled programs' error, try this:"
+ ewarn "FEATURES=-sandbox emerge sandbox"
+}
+
+sb_get_install_abis() { use multilib && get_install_abis || echo ${ABI:-default} ; }
+
+sb_foreach_abi() {
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ cd "${WORKDIR}/build-${ABI}"
+ einfo "Running $1 for ABI=${ABI}..."
+ "$@"
+ done
+ ABI=${OABI}
+}
+
+src_unpack() {
+ unpacker
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-trace-hppa.patch #425062
+ epatch "${FILESDIR}"/${P}-log-var.patch
+ epatch "${FILESDIR}"/${P}-static-close-fd.patch #364877
+ epatch "${FILESDIR}"/${P}-desktop.patch #443672
+ epatch "${FILESDIR}"/${P}-open-nofollow.patch #413441
+ epatch "${FILESDIR}"/${P}-check-empty-paths-at.patch #346929
+ epatch "${FILESDIR}"/${P}-no-pch.patch #425524
+ epatch "${FILESDIR}"/${P}-gcc-5.patch
+ epatch_user
+}
+
+sb_configure() {
+ mkdir "${WORKDIR}/build-${ABI}"
+ cd "${WORKDIR}/build-${ABI}"
+
+ use multilib && multilib_toolchain_setup ${ABI}
+
+ einfo "Configuring sandbox for ABI=${ABI}..."
+ ECONF_SOURCE="../${P}/" \
+ econf ${myconf} || die
+}
+
+sb_compile() {
+ emake || die
+}
+
+src_compile() {
+ filter-lfs-flags #90228
+
+ # Run configures in parallel!
+ multijob_init
+ local OABI=${ABI}
+ for ABI in $(sb_get_install_abis) ; do
+ multijob_child_init sb_configure
+ done
+ ABI=${OABI}
+ multijob_finish
+
+ sb_foreach_abi sb_compile
+}
+
+sb_test() {
+ emake check TESTSUITEFLAGS="--jobs=$(makeopts_jobs)" || die
+}
+
+src_test() {
+ sb_foreach_abi sb_test
+}
+
+sb_install() {
+ emake DESTDIR="${D}" install || die
+ insinto /etc/sandbox.d #333131
+ doins etc/sandbox.d/00default || die
+}
+
+src_install() {
+ sb_foreach_abi sb_install
+
+ doenvd "${FILESDIR}"/09sandbox
+
+ keepdir /var/log/sandbox
+ fowners root:portage /var/log/sandbox
+ fperms 0770 /var/log/sandbox
+
+ cd "${S}"
+ dodoc AUTHORS ChangeLog* NEWS README
+}
+
+pkg_preinst() {
+ chown root:portage "${D}"/var/log/sandbox
+ chmod 0770 "${D}"/var/log/sandbox
+
+ local old=$(find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*')
+ if [[ -n ${old} ]] ; then
+ elog "Removing old sandbox libraries for you:"
+ elog ${old//${ROOT}}
+ find "${ROOT}"/lib* -maxdepth 1 -name 'libsandbox*' -exec rm -fv {} \;
+ fi
+}
+
+pkg_postinst() {
+ chmod 0755 "${ROOT}"/etc/sandbox.d #265376
+}
diff --git a/sys-apps/sdparm/Manifest b/sys-apps/sdparm/Manifest
new file mode 100644
index 000000000000..999538ea43d3
--- /dev/null
+++ b/sys-apps/sdparm/Manifest
@@ -0,0 +1,3 @@
+DIST sdparm-1.07.tgz 309317 SHA256 c1d257ba97f37f99a602e889a73e4c62f9b374c5b979e33fc06963462f0c0e41 SHA512 2ae898e8088e1a65c11987ec813128a0f6d74345b5e460ac6cb375844483e2991647671f2d3fadcc7d7b85256c64128db05e5a169b7dad8fb83cddc06fb0ee6c WHIRLPOOL 21e5b8c9c08c2ae864c4f7d89a271cf5a9b13faf9e16a7739ef8d6165664ce682b74e521a306b07afd8e3ca356fd372a78619db72d6196dbc2e10abe4c2ff66b
+DIST sdparm-1.08.tgz 325255 SHA256 376b78a414b1a9c47f3f13dbeb963e7a3ec7be126f83927d6856b5f7ac425e57 SHA512 ae3ed5f0286447affe60a4e73887d5d3ffdae3afff0e5d2a7f34a89f3686272dde818b2a7ba4b930082744e8fcf75b1793c5bd9ee83a3bef2c4ae239aaf2eb4a WHIRLPOOL 939f27d343407b20dd33f7e37c15983dcf5f2fd6db953a5603a93561b3ed5ce3f5339aa69e6550ba4f7421067e0531ca6d5760518f120dc20398417721bbdb96
+DIST sdparm-1.09.tgz 348129 SHA256 7294f44173ac0946f1de8af02b1bdb0bd648079245396589397a2b0d3abc42d3 SHA512 c26caedd1e8906cc47468279d5924315cbf42b929d1e348d6054971693475fc9c47becdcc5fbdf583efd6b46298671358237eb4049cac4cae8a43278eb30dae2 WHIRLPOOL 0c7e15e9e1ec1909020a3c6bfc4c3f676acbb1cd98aad9ccde1d43d2702573a963d78610e1ae6da215a48d1c8dcb36cd564909483ceab3712e06c1b6b3139e9b
diff --git a/sys-apps/sdparm/metadata.xml b/sys-apps/sdparm/metadata.xml
new file mode 100644
index 000000000000..442859c58982
--- /dev/null
+++ b/sys-apps/sdparm/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>
+ <longdescription>
+ Utility to output and modify parameters on a SCSI device, like hdparm.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/sdparm/sdparm-1.07.ebuild b/sys-apps/sdparm/sdparm-1.07.ebuild
new file mode 100644
index 000000000000..35c2591e0bed
--- /dev/null
+++ b/sys-apps/sdparm/sdparm-1.07.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility to output and modify parameters on a SCSI device, like hdparm"
+HOMEPAGE="http://sg.danny.cz/sg/sdparm.html"
+SRC_URI="http://sg.danny.cz/sg/p/${P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+# Older releases contain a conflicting sas_disk_blink
+RDEPEND="!<sys-apps/sg3_utils-1.28"
+
+src_install() {
+ emake install DESTDIR="${D}"
+ dodoc AUTHORS ChangeLog CREDITS README notes.txt
+ dosbin scripts/sas*
+
+ # These don't exist yet. Someone wanna copy hdparm's and make them work? :)
+# newinitd ${FILESDIR}/sdparm-init-7 sdparm
+# newconfd ${FILESDIR}/sdparm-conf.d.3 sdparm
+}
diff --git a/sys-apps/sdparm/sdparm-1.08-r1.ebuild b/sys-apps/sdparm/sdparm-1.08-r1.ebuild
new file mode 100644
index 000000000000..2ea280aabc96
--- /dev/null
+++ b/sys-apps/sdparm/sdparm-1.08-r1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility to output and modify parameters on a SCSI device, like hdparm"
+HOMEPAGE="http://sg.danny.cz/sg/sdparm.html"
+SRC_URI="http://sg.danny.cz/sg/p/${P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+# Older releases contain a conflicting sas_disk_blink
+RDEPEND=">=sys-apps/sg3_utils-1.28"
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS ChangeLog CREDITS README notes.txt )
+
+src_configure() {
+ # sdparm ships with a local copy of this lib, but will use the system copy if it
+ # detects it (see the README file). Force the use of the system lib. #479578
+ export ac_cv_lib_sgutils2_sg_ll_inquiry=yes
+ default
+}
+
+src_install() {
+ default
+
+ # These don't exist yet. Someone wanna copy hdparm's and make them work? :)
+ #newinitd ${FILESDIR}/sdparm-init-7 sdparm
+ #newconfd ${FILESDIR}/sdparm-conf.d.3 sdparm
+}
diff --git a/sys-apps/sdparm/sdparm-1.09.ebuild b/sys-apps/sdparm/sdparm-1.09.ebuild
new file mode 100644
index 000000000000..477a3fd69a14
--- /dev/null
+++ b/sys-apps/sdparm/sdparm-1.09.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility to output and modify parameters on a SCSI device, like hdparm"
+HOMEPAGE="http://sg.danny.cz/sg/sdparm.html"
+SRC_URI="http://sg.danny.cz/sg/p/${P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+# Older releases contain a conflicting sas_disk_blink
+RDEPEND=">=sys-apps/sg3_utils-1.39"
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS ChangeLog CREDITS README notes.txt )
+
+src_configure() {
+ # sdparm ships with a local copy of this lib, but will use the system copy if it
+ # detects it (see the README file). Force the use of the system lib. #479578
+ export ac_cv_lib_sgutils2_sg_ll_inquiry=yes
+ default
+}
+
+src_install() {
+ default
+
+ # These don't exist yet. Someone wanna copy hdparm's and make them work? :)
+ #newinitd ${FILESDIR}/sdparm-init-7 sdparm
+ #newconfd ${FILESDIR}/sdparm-conf.d.3 sdparm
+}
diff --git a/sys-apps/secilc/metadata.xml b/sys-apps/secilc/metadata.xml
new file mode 100644
index 000000000000..26d91deeb59f
--- /dev/null
+++ b/sys-apps/secilc/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>selinux</herd>
+ <longdescription>
+ The SELinux CIL Compiler is a compiler that converts the CIL language as
+ described on the CIL design wiki into a kernel binary policy file.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">SELinuxProject/selinux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/secilc/secilc-9999.ebuild b/sys-apps/secilc/secilc-9999.ebuild
new file mode 100644
index 000000000000..b463377b308f
--- /dev/null
+++ b/sys-apps/secilc/secilc-9999.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs eutils
+
+MY_P="${P//_/-}"
+MY_RELEASEDATE="20150202"
+
+SEPOL_VER="${PV}"
+
+DESCRIPTION="SELinux Common Intermediate Language (CIL) Compiler"
+HOMEPAGE="https://github.com/SELinuxProject/selinux/wiki"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/SELinuxProject/selinux.git"
+ S="${WORKDIR}/${MY_P}/${PN}"
+else
+ SRC_URI="https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/${MY_RELEASEDATE}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+DEPEND="
+ app-text/xmlto
+ >=sys-libs/libsepol-${SEPOL_VER}
+ "
+RDEPEND="
+ >=sys-libs/libsepol-${SEPOL_VER}
+ "
+
+# tests are not meant to be run outside of the
+# full SELinux userland repo
+RESTRICT="test"
+
+src_prepare() {
+ epatch_user
+}
diff --git a/sys-apps/sed/Manifest b/sys-apps/sed/Manifest
new file mode 100644
index 000000000000..f48a47f136ec
--- /dev/null
+++ b/sys-apps/sed/Manifest
@@ -0,0 +1,2 @@
+DIST sed-4.2.1.tar.bz2 899091 SHA256 2ac3b36ca37bfeb43c4ef4025778cd66d89c77abb843d90552a515a7c9d2948f SHA512 273d4d0b3dd41a3966260fbe261a20110a2a4c0749e11a080f4fc8694e47b605cb977f2535b20b92d57b1b74129df092ba47f4184951dbc3f0f14fd9b91b7bfd WHIRLPOOL 426b244431cb00a8c8f7320f22cf0a5de3165a43d9d6fb8343163e1d4054d61b2737a697ebe54311cf5d2d2f696d2f07877a41b8710ad80d96a7d5138fff07e1
+DIST sed-4.2.2.tar.bz2 1059414 SHA256 f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7 SHA512 dbbb0bb348fac54612d29182c09c88bda7096dea03bd94f03c580c24146e65a06db12808c6a1a9adc94548fa3843511e3e80b251cb07142110cf149eab23f573 WHIRLPOOL d816657c51a2718c2b309455facaff50c9da08b79d20985ab1d61faa5b42bffa0b33ea7d3368a8cdaa6079891cfc27cdab38788563c8323081580b4478c7e2b5
diff --git a/sys-apps/sed/files/sed-4.1.5-alloca.patch b/sys-apps/sed/files/sed-4.1.5-alloca.patch
new file mode 100644
index 000000000000..89679c5362e3
--- /dev/null
+++ b/sys-apps/sed/files/sed-4.1.5-alloca.patch
@@ -0,0 +1,14 @@
+fix building on BSD systems which often do not have alloca.h
+
+--- sed-4.1.5/lib/regex_internal.h
++++ sed-4.1.5/lib/regex_internal.h
+@@ -410,7 +410,9 @@ static unsigned int re_string_context_at
+ #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
+ #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
+
++#ifdef HAVE_ALLOCA_H
+ #include <alloca.h>
++#endif
+
+ #ifndef _LIBC
+ # if HAVE_ALLOCA
diff --git a/sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch b/sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch
new file mode 100644
index 000000000000..dfd9206d3bf4
--- /dev/null
+++ b/sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch
@@ -0,0 +1,45 @@
+http://bugs.gentoo.org/284403
+
+From 20f68fb1abe862a98bc0378e5bb54d94bb98b8fe Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <bonzini@gnu.org>
+Date: Thu, 15 Oct 2009 19:56:12 +0200
+Subject: [PATCH] handle incomplete sequences as if they were invalid
+
+2009-10-15 Paolo Bonzini <bonzini@gnu.org>
+ WANG Yunfeng <uhuruh@gmail.com>
+
+ * sed/execute.c (str_append, str_append_modified): Handle incomplete
+ sequences as if they were invalid.
+---
+ ChangeLog | 6 ++++++
+ NEWS | 4 +++-
+ sed/execute.c | 6 +++---
+ 3 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/sed/execute.c b/sed/execute.c
+index 66cb809..d5903be 100644
+--- a/sed/execute.c
++++ b/sed/execute.c
+@@ -254,8 +254,8 @@ str_append(to, string, length)
+ {
+ size_t n = MBRLEN (string, length, &to->mbstate);
+
+- /* An invalid sequence is treated like a singlebyte character. */
+- if (n == (size_t) -1)
++ /* An invalid or imcomplete sequence is treated like a singlebyte character. */
++ if (n == (size_t) -1 || n == (size_t) -2)
+ {
+ memset (&to->mbstate, 0, sizeof (to->mbstate));
+ n = 1;
+@@ -341,7 +341,7 @@ str_append_modified(to, string, length, type)
+ /* Copy the new wide character to the end of the string. */
+ n = WCRTOMB (to->active + to->length, wc, &to->mbstate);
+ to->length += n;
+- if (n == -1)
++ if (n == -1 || n == -2)
+ {
+ fprintf (stderr, "Case conversion produced an invalid character!");
+ abort ();
+--
+1.7.3.1
+
diff --git a/sys-apps/sed/metadata.xml b/sys-apps/sed/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/sed/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-apps/sed/sed-4.2.1-r1.ebuild b/sys-apps/sed/sed-4.2.1-r1.ebuild
new file mode 100644
index 000000000000..6c002dca6bf7
--- /dev/null
+++ b/sys-apps/sed/sed-4.2.1-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Super-useful stream editor"
+HOMEPAGE="http://sed.sourceforge.net/"
+SRC_URI="mirror://gnu/sed/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="acl nls selinux static"
+
+RDEPEND="acl? ( virtual/acl )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_bootstrap_sed() {
+ # make sure system-sed works #40786
+ export NO_SYS_SED=""
+ if ! type -p sed > /dev/null ; then
+ NO_SYS_SED="!!!"
+ ./bootstrap.sh || die "couldnt bootstrap"
+ cp sed/sed "${T}"/ || die "couldnt copy"
+ export PATH="${PATH}:${T}"
+ make clean || die "couldnt clean"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-4.1.5-alloca.patch
+ epatch "${FILESDIR}"/${P}-handle-incomplete-sequences-as-if-they-were-invalid.patch #284403
+ # don't use sed here if we have to recover a broken host sed
+}
+
+src_compile() {
+ src_bootstrap_sed
+ # this has to be after the bootstrap portion
+ sed -i \
+ -e '/docdir =/s:=.*/doc:= $(datadir)/doc/'${PF}'/html:' \
+ doc/Makefile.in || die "sed html doc"
+
+ local myconf= bindir=/bin
+ if ! use userland_GNU ; then
+ myconf="--program-prefix=g"
+ bindir=/usr/bin
+ fi
+
+ export ac_cv_search_setfilecon=$(usex selinux -lselinux)
+ export ac_cv_header_selinux_{context,selinux}_h=$(usex selinux)
+ use static && append-ldflags -static
+ econf \
+ --bindir=${bindir} \
+ $(use_enable acl) \
+ $(use_enable nls) \
+ ${myconf}
+ emake || die "build failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "Install failed"
+ dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog
+}
diff --git a/sys-apps/sed/sed-4.2.2.ebuild b/sys-apps/sed/sed-4.2.2.ebuild
new file mode 100644
index 000000000000..f6a48783d4da
--- /dev/null
+++ b/sys-apps/sed/sed-4.2.2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Super-useful stream editor"
+HOMEPAGE="http://sed.sourceforge.net/"
+SRC_URI="mirror://gnu/sed/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="acl nls selinux static"
+
+RDEPEND="acl? ( virtual/acl )
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_bootstrap_sed() {
+ # make sure system-sed works #40786
+ export NO_SYS_SED=""
+ if ! type -p sed > /dev/null ; then
+ NO_SYS_SED="!!!"
+ ./bootstrap.sh || die "couldnt bootstrap"
+ cp sed/sed "${T}"/ || die "couldnt copy"
+ export PATH="${PATH}:${T}"
+ make clean || die "couldnt clean"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-4.1.5-alloca.patch
+ # don't use sed here if we have to recover a broken host sed
+}
+
+src_compile() {
+ src_bootstrap_sed
+ # this has to be after the bootstrap portion
+ sed -i \
+ -e '/docdir =/s:=.*/doc:= $(datadir)/doc/'${PF}'/html:' \
+ doc/Makefile.in || die "sed html doc"
+
+ local myconf= bindir=/bin
+ if ! use userland_GNU ; then
+ myconf="--program-prefix=g"
+ bindir=/usr/bin
+ fi
+
+ # Should be able to drop this hack in next release. #333887
+ tc-is-cross-compiler && export gl_cv_func_working_acl_get_file=yes
+ export ac_cv_search_setfilecon=$(usex selinux -lselinux)
+ export ac_cv_header_selinux_{context,selinux}_h=$(usex selinux)
+ use static && append-ldflags -static
+ econf \
+ --bindir=${bindir} \
+ $(use_enable acl) \
+ $(use_enable nls) \
+ ${myconf}
+ emake || die "build failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "Install failed"
+ dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog
+}
diff --git a/sys-apps/servicelog/Manifest b/sys-apps/servicelog/Manifest
new file mode 100644
index 000000000000..990ffa877866
--- /dev/null
+++ b/sys-apps/servicelog/Manifest
@@ -0,0 +1,3 @@
+DIST servicelog-1.0.1.tar.gz 159034 SHA256 3043c24569c118a02f8c25f27098011e73a5af80ae6a75cdb18f2a63c4fa1537
+DIST servicelog-1.1.11.tar.gz 318874 SHA256 1eb5b8bd4d56a35b770eb83c7b8773e4f8c9faa6793b9db3f22056c33184ba80 SHA512 45adabe828a2e700b0920cc89fa4f93ac923cbf0249facbd52e23e1507d3daf12a2e4f2b093539286cebf8291266b2cbdcfea1c17f83a75c537c368885fd398c WHIRLPOOL c07ba8a5b7b23c475f55055af638e386ae9ef7628224faee15960c40c013f8a77686e461b323c4d1ddf282dffa237409c3887c6752fb31be821bdf7319c9f6af
+DIST servicelog-1.1.13.tar.gz 357637 SHA256 195fe080ea5d465d6b1164c0d46ada83654938f0ad7bc805fe4f28d9af602ffa SHA512 2c9b2705825a98fbae3bc1c35f8acd014e5234d316d4c00fcceeb86b9263080fe525dfe71553c935092f8787b7125a3ed39c0cf07c069c56d1e816748698aa94 WHIRLPOOL 35ddabc190274422bcad05f1a32d9b8df67aea3e5ee0a14a9270aae5cec5a3a5c4f87581a2c472c2f996cb0bb560b44a0e14aba19b7849c3f6a9f38f153be0bb
diff --git a/sys-apps/servicelog/metadata.xml b/sys-apps/servicelog/metadata.xml
new file mode 100644
index 000000000000..09b995174c26
--- /dev/null
+++ b/sys-apps/servicelog/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">linux-diag</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/servicelog/servicelog-1.0.1.ebuild b/sys-apps/servicelog/servicelog-1.0.1.ebuild
new file mode 100644
index 000000000000..fc0299e1432a
--- /dev/null
+++ b/sys-apps/servicelog/servicelog-1.0.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+S=${WORKDIR}/${PN}-${PV}
+DESCRIPTION="Provides utilities for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="ppc ppc64"
+IUSE=""
+
+DEPEND="sys-libs/libservicelog"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_compile() {
+ econf
+}
+src_install () {
+ emake install DESTDIR="${D}"
+ dodoc ChangeLog
+}
diff --git a/sys-apps/servicelog/servicelog-1.1.11.ebuild b/sys-apps/servicelog/servicelog-1.1.11.ebuild
new file mode 100644
index 000000000000..d204430d45de
--- /dev/null
+++ b/sys-apps/servicelog/servicelog-1.1.11.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+S=${WORKDIR}/${PN}-${PV}
+DESCRIPTION="Provides utilities for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+
+DEPEND="sys-libs/libservicelog"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_compile() {
+ econf
+}
+src_install () {
+ emake install DESTDIR="${D}"
+ dodoc ChangeLog
+}
diff --git a/sys-apps/servicelog/servicelog-1.1.13.ebuild b/sys-apps/servicelog/servicelog-1.1.13.ebuild
new file mode 100644
index 000000000000..fc6c4d07ec69
--- /dev/null
+++ b/sys-apps/servicelog/servicelog-1.1.13.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+S=${WORKDIR}/${PN}-${PV}
+DESCRIPTION="Provides utilities for logging service-related events"
+SRC_URI="mirror://sourceforge/linux-diag/${P}.tar.gz"
+HOMEPAGE="http://linux-diag.sourceforge.net/servicelog/"
+
+SLOT="0"
+LICENSE="IBM"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+
+DEPEND="sys-libs/libservicelog"
+
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_compile() {
+ econf
+}
+src_install () {
+ emake install DESTDIR="${D}"
+ dodoc ChangeLog
+}
diff --git a/sys-apps/setserial/Manifest b/sys-apps/setserial/Manifest
new file mode 100644
index 000000000000..2f1b8f00d3af
--- /dev/null
+++ b/sys-apps/setserial/Manifest
@@ -0,0 +1 @@
+DIST setserial-2.17.tar.gz 52437 RMD160 91b87e203f9469dc9c5586652a5231a10cf53cc8 SHA1 68824494a0b5700f7e999564a59358bf34f79eb1 SHA256 7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a
diff --git a/sys-apps/setserial/files/serial-2.17-r4 b/sys-apps/setserial/files/serial-2.17-r4
new file mode 100755
index 000000000000..974cf9382852
--- /dev/null
+++ b/sys-apps/setserial/files/serial-2.17-r4
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+start() {
+ [ ! -e /etc/serial.conf ] && return 0
+
+ grep -v "^#\|^ \|^$\|^stty" /etc/serial.conf | while read device args
+ do
+ ebegin "Setting ${device} to $args"
+ setserial -b ${device} ${args}
+ eend $?
+ done
+ grep "^stty" /etc/serial.conf | while read x device args
+ do
+ ebegin "Setting (stty) ${device} to $args"
+ stty -F ${device} ${args}
+ eend $?
+ done
+
+ return 0
+}
diff --git a/sys-apps/setserial/files/setserial-2.17-build.patch b/sys-apps/setserial/files/setserial-2.17-build.patch
new file mode 100644
index 000000000000..d3f3d69cead6
--- /dev/null
+++ b/sys-apps/setserial/files/setserial-2.17-build.patch
@@ -0,0 +1,11 @@
+--- Makefile.in
++++ Makefile.in
+@@ -20,7 +20,7 @@
+ all: setserial setserial.cat
+
+ setserial: setserial.c
+- $(CC) $(CFLAGS) $(DEFS) $(INCS) setserial.c -o setserial
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DEFS) $(INCS) setserial.c -o setserial
+
+ setserial.cat: setserial.8
+ nroff -man setserial.8 > setserial.cat
diff --git a/sys-apps/setserial/files/setserial-2.17-hayes-esp.patch b/sys-apps/setserial/files/setserial-2.17-hayes-esp.patch
new file mode 100644
index 000000000000..72783553c214
--- /dev/null
+++ b/sys-apps/setserial/files/setserial-2.17-hayes-esp.patch
@@ -0,0 +1,15 @@
+recent versions of linux have dropped the hayes esp driver
+
+http://bugs.gentoo.org/309883
+
+--- a/setserial.c
++++ b/setserial.c
+@@ -21,6 +21,8 @@
+ #endif
+ #ifdef HAVE_LINUX_HAYESESP_H
+ #include <linux/hayesesp.h>
++#else
++#undef TIOCGHAYESESP
+ #endif
+ #include <linux/serial.h>
+
diff --git a/sys-apps/setserial/files/setserial-2.17-headers.patch b/sys-apps/setserial/files/setserial-2.17-headers.patch
new file mode 100644
index 000000000000..a6d5f38e3e60
--- /dev/null
+++ b/sys-apps/setserial/files/setserial-2.17-headers.patch
@@ -0,0 +1,12 @@
+--- setserial.c
++++ setserial.c
+@@ -15,6 +15,9 @@
+ #include <termios.h>
+ #include <string.h>
+ #include <errno.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
+
+ #ifdef HAVE_ASM_IOCTLS_H
+ #include <asm/ioctls.h>
diff --git a/sys-apps/setserial/files/setserial-2.17-manpage-updates.patch b/sys-apps/setserial/files/setserial-2.17-manpage-updates.patch
new file mode 100644
index 000000000000..02f4a454a3d5
--- /dev/null
+++ b/sys-apps/setserial/files/setserial-2.17-manpage-updates.patch
@@ -0,0 +1,36 @@
+--- setserial-2.17/setserial.8.in
++++ setserial-2.17/setserial.8.in
+@@ -34,7 +34,7 @@
+ program should be used. Typically it is called from an
+-.I rc.serial
++.I serial
+ script, which is usually run out of
+-.IR /etc/rc.local .
++.IR /etc/init.d/ .
+
+ The
+ .I device
+@@ -78,7 +78,7 @@
+ .B \-b
+ When reporting the configuration of a serial device, print a summary
+ of the device's configuration, which might be suitable for printing
+-during the bootup process, during the /etc/rc script.
++during the bootup process, in the /etc/init.d/serial script.
+ .TP
+ .B \-G
+ Print out the configuration information of the serial port in a form which
+@@ -504,12 +504,9 @@
+ CAUTION: Configuring a serial port to use an incorrect I/O port
+ can lock up your machine.
+ .SH FILES
+-.BR /etc/rc.local
+-.BR /etc/rc.serial
++.BR /etc/serial.conf
+ .SH "SEE ALSO"
+-.BR tty (4),
+-.BR ttys (4),
+-kernel/chr_drv/serial.c
++.BR tty (4)
+ .SH AUTHOR
+ The original version of setserial was written by Rick Sladkey
+ (jrs@world.std.com), and was modified by Michael K. Johnson
diff --git a/sys-apps/setserial/files/setserial-2.17-spelling.patch b/sys-apps/setserial/files/setserial-2.17-spelling.patch
new file mode 100644
index 000000000000..49ac5f41e72b
--- /dev/null
+++ b/sys-apps/setserial/files/setserial-2.17-spelling.patch
@@ -0,0 +1,7 @@
+Ripped from Fedora.
+
+--- setserial-2.17/setserial.c
++++ setserial-2.17/setserial.c
+@@ -710,1 +710,1 @@
+- fprintf(stderr, "\t spd_normal\tuse 38.4kb when a buad rate of 38.4kb is selected\n");
++ fprintf(stderr, "\t spd_normal\tuse 38.4kb when a baud rate of 38.4kb is selected\n");
diff --git a/sys-apps/setserial/metadata.xml b/sys-apps/setserial/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/setserial/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-apps/setserial/setserial-2.17-r4.ebuild b/sys-apps/setserial/setserial-2.17-r4.ebuild
new file mode 100644
index 000000000000..e15f4fb1483f
--- /dev/null
+++ b/sys-apps/setserial/setserial-2.17-r4.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Configure your serial ports with it"
+HOMEPAGE="http://setserial.sourceforge.net/"
+SRC_URI="ftp://tsx-11.mit.edu/pub/linux/sources/sbin/${P}.tar.gz
+ ftp://ftp.sunsite.org.uk/Mirrors/tsx-11.mit.edu/pub/linux/sources/sbin/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-spelling.patch
+ epatch "${FILESDIR}"/${P}-manpage-updates.patch
+ epatch "${FILESDIR}"/${P}-headers.patch
+ epatch "${FILESDIR}"/${P}-build.patch
+ epatch "${FILESDIR}"/${P}-hayes-esp.patch #309883
+}
+
+src_compile() {
+ tc-export CC
+ econf || die
+ emake setserial || die
+}
+
+src_install() {
+ doman setserial.8
+ into /
+ dobin setserial || die
+
+ insinto /etc
+ doins serial.conf
+ newinitd "${FILESDIR}"/serial-2.17-r4 serial
+
+ dodoc README
+ docinto txt
+ dodoc Documentation/*
+}
diff --git a/sys-apps/sg3_utils/Manifest b/sys-apps/sg3_utils/Manifest
new file mode 100644
index 000000000000..73bfecd91d58
--- /dev/null
+++ b/sys-apps/sg3_utils/Manifest
@@ -0,0 +1,2 @@
+DIST sg3_utils-1.40.tgz 1179730 SHA256 44a9ecfd3af018fa9f3586067a8fa5f4874451c3d773d74436d262a7e530ee83 SHA512 cf4909c46d509ea7c1c8930d81df2b20ce56c56092830f017e69fa4ce7eddb395ae1d17f51657d8dfb539fdd78229223e54e0db2d61d2612d23313cd6846043a WHIRLPOOL d092fdd6ab46da73cda9bf2b0a85dc468bb222a443ca20e8d2f55ad91ed83b8a523fbd4946cd2e40874a56673085629227996f1f5e686273c8d2d44093797687
+DIST sg3_utils-1.41.tgz 1194212 SHA256 c4e2893c36df1ee5b07840ab7c22129544f5dc8a55f7cc8815c9cd8e44ec31c0 SHA512 ceca778a2f4d16dd341dd47cc1d92df5bc85d7f75d75e6b7c1a99c31e03e98103a18abf624880172e162bd0b751f760f0e919cbbb989303a9e1fbe9ff3eb1f46 WHIRLPOOL 9476f0f180879f1386b824b367314648d616b6925ff7b735760f25de6e086e38efa0eb12dd8fb9f9305eb367f7d8c2053ceabc83fc6270492357abce25de9784
diff --git a/sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch b/sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch
new file mode 100644
index 000000000000..a82ab6add9a4
--- /dev/null
+++ b/sys-apps/sg3_utils/files/sg3_utils-1.26-stdint.patch
@@ -0,0 +1,31 @@
+From: Ed Catmur <ed@catmur.co.uk>
+Gentoo-Bug: 229653
+X-Gentoo-URL: http://bugs.gentoo.org/show_bug.cgi?id=229653
+X-Gentoo-URL: http://bugs.gentoo.org/attachment.cgi?id=158565&action=view
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+For uint64_t to be available, <stdint.h> must be included:
+http://www.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html
+
+--- include/sg_cmds_basic.h 2008/06/26 23:27:40 1.1
++++ include/sg_cmds_basic.h 2008/06/26 23:28:06
+@@ -30,6 +30,8 @@
+ *
+ */
+
++#include <stdint.h>
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+--- include/sg_cmds_extra.h 2008/06/26 23:27:40 1.1
++++ include/sg_cmds_extra.h 2008/06/26 23:29:02
+@@ -30,6 +30,8 @@
+ *
+ */
+
++#include <stdint.h>
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/sys-apps/sg3_utils/metadata.xml b/sys-apps/sg3_utils/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/sg3_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>base-system</herd>
+</pkgmetadata>
diff --git a/sys-apps/sg3_utils/sg3_utils-1.40.ebuild b/sys-apps/sg3_utils/sg3_utils-1.40.ebuild
new file mode 100644
index 000000000000..20b078e83b01
--- /dev/null
+++ b/sys-apps/sg3_utils/sg3_utils-1.40.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib
+
+DESCRIPTION="Apps for querying the sg SCSI interface"
+HOMEPAGE="http://sg.danny.cz/sg/"
+SRC_URI="http://sg.danny.cz/sg/p/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="static-libs"
+
+DEPEND="sys-devel/libtool"
+RDEPEND=""
+PDEPEND=">=sys-apps/rescan-scsi-bus-1.24"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.26-stdint.patch
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ dodoc COVERAGE doc/README examples/*.txt
+ newdoc scripts/README README.scripts
+
+ # Better fix for bug 231089; some packages look for sgutils2
+ local path lib
+ path="/usr/$(get_libdir)"
+ for lib in "${ED}"${path}/libsgutils2.*; do
+ lib=${lib##*/}
+ dosym "${lib}" "${path}/${lib/libsgutils2/libsgutils}"
+ done
+
+ prune_libtool_files
+}
diff --git a/sys-apps/sg3_utils/sg3_utils-1.41.ebuild b/sys-apps/sg3_utils/sg3_utils-1.41.ebuild
new file mode 100644
index 000000000000..b55a109957e0
--- /dev/null
+++ b/sys-apps/sg3_utils/sg3_utils-1.41.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib
+
+DESCRIPTION="Apps for querying the sg SCSI interface"
+HOMEPAGE="http://sg.danny.cz/sg/"
+SRC_URI="http://sg.danny.cz/sg/p/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="static-libs"
+
+DEPEND="sys-devel/libtool"
+RDEPEND=""
+PDEPEND=">=sys-apps/rescan-scsi-bus-1.24"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.26-stdint.patch
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ dodoc COVERAGE doc/README examples/*.txt
+ newdoc scripts/README README.scripts
+
+ # Better fix for bug 231089; some packages look for sgutils2
+ local path lib
+ path="/usr/$(get_libdir)"
+ for lib in "${ED}"${path}/libsgutils2.*; do
+ lib=${lib##*/}
+ dosym "${lib}" "${path}/${lib/libsgutils2/libsgutils}"
+ done
+
+ prune_libtool_files
+}
diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest
new file mode 100644
index 000000000000..79bdd081a86e
--- /dev/null
+++ b/sys-apps/shadow/Manifest
@@ -0,0 +1,2 @@
+DIST shadow-4.1.5.1.tar.bz2 2193325 SHA256 aa32333748d68b58ed3a83625f0165e0f6b9dc4639e6377c9300c6bf4fe978fb SHA512 c3bc605de1ca5b774b80d0d92cef5d4c0d5b4a206acadcf5a819f195453093bfe7990d7e32b98799180847ae4fadecfc7876c8ee7297f343acce2230d805d02c WHIRLPOOL 08751597b5b57057f0a3141be97204df49fada25adf0a9f43106a4099ce1b06fec6e90592e43ff1d789bf0a7e16a40b45f29830879ea5c71e9f5a1a81e7a7357
+DIST shadow-4.2.1.tar.xz 1594536 SHA256 3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41 SHA512 7a14bf8e08126f0402e37b6e4c559615ced7cf829e39156d929ed05cd8813de48a77ff1f7f6fe707da04cf662a2e9e84c22d63d88dd1ed13f935fde594db95f0 WHIRLPOOL 032857f5fae8486cc3dd11303bfa7da55019000ce8ad7bac2f398f9f9764c8659e20a1547d05c5e4f366db749a52afb3083017faf14f6a72ee48345dcd1f86aa
diff --git a/sys-apps/shadow/files/default/useradd b/sys-apps/shadow/files/default/useradd
new file mode 100644
index 000000000000..ae81dbb3a02b
--- /dev/null
+++ b/sys-apps/shadow/files/default/useradd
@@ -0,0 +1,7 @@
+# useradd defaults file
+GROUP=100
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/bash
+SKEL=/etc/skel
diff --git a/sys-apps/shadow/files/login_defs_pam.sed b/sys-apps/shadow/files/login_defs_pam.sed
new file mode 100644
index 000000000000..ba308ba9abeb
--- /dev/null
+++ b/sys-apps/shadow/files/login_defs_pam.sed
@@ -0,0 +1,24 @@
+/^FAILLOG_ENAB/b comment
+/^LASTLOG_ENAB/b comment
+/^MAIL_CHECK_ENAB/b comment
+/^OBSCURE_CHECKS_ENAB/b comment
+/^PORTTIME_CHECKS_ENAB/b comment
+/^QUOTAS_ENAB/b comment
+/^MOTD_FILE/b comment
+/^FTMP_FILE/b comment
+/^NOLOGINS_FILE/b comment
+/^ENV_HZ/b comment
+/^PASS_MIN_LEN/b comment
+/^SU_WHEEL_ONLY/b comment
+/^CRACKLIB_DICTPATH/b comment
+/^PASS_CHANGE_TRIES/b comment
+/^PASS_ALWAYS_WARN/b comment
+/^CHFN_AUTH/b comment
+/^ENVIRON_FILE/b comment
+
+b exit
+
+: comment
+ s:^:#:
+
+: exit
diff --git a/sys-apps/shadow/files/pam.d-include/passwd b/sys-apps/shadow/files/pam.d-include/passwd
new file mode 100644
index 000000000000..960b32eab3eb
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/passwd
@@ -0,0 +1,8 @@
+#%PAM-1.0
+
+auth sufficient pam_rootok.so
+auth include system-auth
+
+account include system-auth
+
+password include system-auth
diff --git a/sys-apps/shadow/files/pam.d-include/shadow b/sys-apps/shadow/files/pam.d-include/shadow
new file mode 100644
index 000000000000..743b2f0260d6
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/shadow
@@ -0,0 +1,8 @@
+#%PAM-1.0
+
+auth sufficient pam_rootok.so
+auth required pam_permit.so
+
+account include system-auth
+
+password required pam_permit.so
diff --git a/sys-apps/shadow/files/securetty b/sys-apps/shadow/files/securetty
new file mode 100644
index 000000000000..55ce54ddc790
--- /dev/null
+++ b/sys-apps/shadow/files/securetty
@@ -0,0 +1,36 @@
+# /etc/securetty: list of terminals on which root is allowed to login.
+# See securetty(5) and login(1).
+console
+
+vc/0
+vc/1
+vc/2
+vc/3
+vc/4
+vc/5
+vc/6
+vc/7
+vc/8
+vc/9
+vc/10
+vc/11
+vc/12
+tty0
+tty1
+tty2
+tty3
+tty4
+tty5
+tty6
+tty7
+tty8
+tty9
+tty10
+tty11
+tty12
+
+tts/0
+ttyS0
+ttyS1
+ttyS2
+ttyS3
diff --git a/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch
new file mode 100644
index 000000000000..efcb33dbd9ef
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch
@@ -0,0 +1,10 @@
+--- shadow-4.1.3/libmisc/chkname.c
++++ shadow-4.1.3/libmisc/chkname.c
+@@ -66,6 +66,7 @@
+ ( ('0' <= *name) && ('9' >= *name) ) ||
+ ('_' == *name) ||
+ ('-' == *name) ||
++ ('.' == *name) ||
+ ( ('$' == *name) && ('\0' == *(name + 1)) )
+ )) {
+ return false;
diff --git a/sys-apps/shadow/files/shadow-4.2.1-cross-size-checks.patch b/sys-apps/shadow/files/shadow-4.2.1-cross-size-checks.patch
new file mode 100644
index 000000000000..f067caab204d
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.2.1-cross-size-checks.patch
@@ -0,0 +1,41 @@
+From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@aura-online.co.uk>
+Date: Sat, 23 Aug 2014 09:46:39 +0100
+Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF
+
+This built-in check is simpler than the previous method and, most
+importantly, works when cross-compiling.
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+---
+ configure.in | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 1a3f841..4a4d6d0 100644
+--- a/configure.in
++++ b/configure.in
+@@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then
+ dnl
+ dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
+ dnl
+- AC_RUN_IFELSE([AC_LANG_SOURCE([
+-#include <sys/types.h>
+-int main(void) {
+- uid_t u;
+- gid_t g;
+- return (sizeof u < 4) || (sizeof g < 4);
+-}
+- ])], [id32bit="yes"], [id32bit="no"])
+-
+- if test "x$id32bit" = "xyes"; then
++ AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"])
++ AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"])
++
++ if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then
+ AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
+ enable_subids="yes"
+ else
+--
+2.3.6
+
diff --git a/sys-apps/shadow/metadata.xml b/sys-apps/shadow/metadata.xml
new file mode 100644
index 000000000000..59792273c6dc
--- /dev/null
+++ b/sys-apps/shadow/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>
+<herd>pam</herd> <!-- only for USE=pam -->
+<use>
+ <flag name='audit'>Enable support for <pkg>sys-process/audit</pkg></flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:debian:shadow</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-apps/shadow/shadow-4.1.5.1-r1.ebuild b/sys-apps/shadow/shadow-4.1.5.1-r1.ebuild
new file mode 100644
index 000000000000..b2cd97dd918d
--- /dev/null
+++ b/sys-apps/shadow/shadow-4.1.5.1-r1.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils libtool toolchain-funcs pam multilib
+
+DESCRIPTION="Utilities to deal with user accounts"
+HOMEPAGE="http://shadow.pld.org.pl/ http://pkg-shadow.alioth.debian.org/"
+SRC_URI="http://pkg-shadow.alioth.debian.org/releases/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="acl audit cracklib nls pam selinux skey xattr"
+
+RDEPEND="acl? ( sys-apps/acl )
+ audit? ( sys-process/audit )
+ cracklib? ( >=sys-libs/cracklib-2.7-r3 )
+ pam? ( virtual/pam )
+ skey? ( sys-auth/skey )
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ sys-libs/libsemanage
+ )
+ nls? ( virtual/libintl )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${RDEPEND}
+ pam? ( >=sys-auth/pambase-20120417 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch #22920
+ epatch_user
+ elibtoolize
+}
+
+src_configure() {
+ tc-is-cross-compiler && export ac_cv_func_setpgrp_void=yes
+ econf \
+ --without-group-name-max-length \
+ --without-tcb \
+ --enable-shared=no \
+ --enable-static=yes \
+ $(use_with acl) \
+ $(use_with audit) \
+ $(use_with cracklib libcrack) \
+ $(use_with pam libpam) \
+ $(use_with skey) \
+ $(use_with selinux) \
+ $(use_enable nls) \
+ $(use_with elibc_glibc nscd) \
+ $(use_with xattr attr)
+ has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
+}
+
+set_login_opt() {
+ local comment="" opt=$1 val=$2
+ [[ -z ${val} ]] && comment="#"
+ sed -i -r \
+ -e "/^#?${opt}/s:.*:${comment}${opt} ${val}:" \
+ "${D}"/etc/login.defs
+ local res=$(grep "^${comment}${opt}" "${D}"/etc/login.defs)
+ einfo ${res:-Unable to find ${opt} in /etc/login.defs}
+}
+
+src_install() {
+ emake DESTDIR="${D}" suidperms=4711 install
+
+ # Remove libshadow and libmisc; see bug 37725 and the following
+ # comment from shadow's README.linux:
+ # Currently, libshadow.a is for internal use only, so if you see
+ # -lshadow in a Makefile of some other package, it is safe to
+ # remove it.
+ rm -f "${D}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la}
+
+ insinto /etc
+ # Using a securetty with devfs device names added
+ # (compat names kept for non-devfs compatibility)
+ insopts -m0600 ; doins "${FILESDIR}"/securetty
+ if ! use pam ; then
+ insopts -m0600
+ doins etc/login.access etc/limits
+ fi
+ # Output arch-specific cruft
+ local devs
+ case $(tc-arch) in
+ ppc*) devs="hvc0 hvsi0 ttyPSC0";;
+ hppa) devs="ttyB0";;
+ arm) devs="ttyFB0 ttySAC0 ttySAC1 ttySAC2 ttySAC3 ttymxc0 ttymxc1 ttymxc2 ttymxc3 ttyO0 ttyO1 ttyO2";;
+ sh) devs="ttySC0 ttySC1";;
+ esac
+ [[ -n ${devs} ]] && printf '%s\n' ${devs} >> "${D}"/etc/securetty
+
+ # needed for 'useradd -D'
+ insinto /etc/default
+ insopts -m0600
+ doins "${FILESDIR}"/default/useradd
+
+ # move passwd to / to help recover broke systems #64441
+ mv "${D}"/usr/bin/passwd "${D}"/bin/
+ dosym /bin/passwd /usr/bin/passwd
+
+ cd "${S}"
+ insinto /etc
+ insopts -m0644
+ newins etc/login.defs login.defs
+
+ if ! use pam ; then
+ set_login_opt MAIL_CHECK_ENAB no
+ set_login_opt SU_WHEEL_ONLY yes
+ set_login_opt CRACKLIB_DICTPATH /usr/$(get_libdir)/cracklib_dict
+ set_login_opt LOGIN_RETRIES 3
+ set_login_opt ENCRYPT_METHOD SHA512
+ else
+ dopamd "${FILESDIR}"/pam.d-include/shadow
+
+ for x in chpasswd chgpasswd newusers; do
+ newpamd "${FILESDIR}"/pam.d-include/passwd ${x}
+ done
+
+ for x in chage chsh chfn \
+ user{add,del,mod} group{add,del,mod} ; do
+ newpamd "${FILESDIR}"/pam.d-include/shadow ${x}
+ done
+
+ # comment out login.defs options that pam hates
+ local opt
+ for opt in \
+ CHFN_AUTH \
+ CRACKLIB_DICTPATH \
+ ENV_HZ \
+ ENVIRON_FILE \
+ FAILLOG_ENAB \
+ FTMP_FILE \
+ LASTLOG_ENAB \
+ MAIL_CHECK_ENAB \
+ MOTD_FILE \
+ NOLOGINS_FILE \
+ OBSCURE_CHECKS_ENAB \
+ PASS_ALWAYS_WARN \
+ PASS_CHANGE_TRIES \
+ PASS_MIN_LEN \
+ PORTTIME_CHECKS_ENAB \
+ QUOTAS_ENAB \
+ SU_WHEEL_ONLY
+ do
+ set_login_opt ${opt}
+ done
+
+ sed -i -f "${FILESDIR}"/login_defs_pam.sed \
+ "${D}"/etc/login.defs
+
+ # remove manpages that pam will install for us
+ # and/or don't apply when using pam
+ find "${D}"/usr/share/man \
+ '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
+ -exec rm {} +
+
+ # Remove pam.d files provided by pambase.
+ rm "${D}"/etc/pam.d/{login,passwd,su} || die
+ fi
+
+ # Remove manpages that are handled by other packages
+ find "${D}"/usr/share/man \
+ '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
+ -exec rm {} +
+
+ cd "${S}"
+ dodoc ChangeLog NEWS TODO
+ newdoc README README.download
+ cd doc
+ dodoc HOWTO README* WISHLIST *.txt
+}
+
+pkg_preinst() {
+ rm -f "${ROOT}"/etc/pam.d/system-auth.new \
+ "${ROOT}/etc/login.defs.new"
+}
+
+pkg_postinst() {
+ # Enable shadow groups.
+ if [ ! -f "${ROOT}"/etc/gshadow ] ; then
+ if grpck -r -R "${ROOT}" 2>/dev/null ; then
+ grpconv -R "${ROOT}"
+ else
+ ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
+ ewarn "run 'grpconv' afterwards!"
+ fi
+ fi
+
+ einfo "The 'adduser' symlink to 'useradd' has been dropped."
+}
diff --git a/sys-apps/shadow/shadow-4.2.1-r1.ebuild b/sys-apps/shadow/shadow-4.2.1-r1.ebuild
new file mode 100644
index 000000000000..b58fa8f97c91
--- /dev/null
+++ b/sys-apps/shadow/shadow-4.2.1-r1.ebuild
@@ -0,0 +1,211 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils libtool toolchain-funcs pam multilib autotools
+
+DESCRIPTION="Utilities to deal with user accounts"
+HOMEPAGE="http://shadow.pld.org.pl/ http://pkg-shadow.alioth.debian.org/"
+SRC_URI="http://pkg-shadow.alioth.debian.org/releases/${P}.tar.xz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="acl audit cracklib nls pam selinux skey xattr"
+# Taken from the man/Makefile.am file.
+LANGS=( cs da de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW )
+IUSE+=" $(printf 'linguas_%s ' ${LANGS[*]})"
+
+RDEPEND="acl? ( sys-apps/acl )
+ audit? ( sys-process/audit )
+ cracklib? ( >=sys-libs/cracklib-2.7-r3 )
+ pam? ( virtual/pam )
+ skey? ( sys-auth/skey )
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ sys-libs/libsemanage
+ )
+ nls? ( virtual/libintl )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+RDEPEND="${RDEPEND}
+ pam? ( >=sys-auth/pambase-20150213 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch #22920
+ epatch "${FILESDIR}"/${P}-cross-size-checks.patch
+ epatch_user
+ # https://github.com/shadow-maint/shadow/pull/5
+ mv configure.{in,ac} || die
+ eautoreconf
+ #elibtoolize
+}
+
+src_configure() {
+ tc-is-cross-compiler && export ac_cv_func_setpgrp_void=yes
+ econf \
+ --without-group-name-max-length \
+ --without-tcb \
+ --enable-shared=no \
+ --enable-static=yes \
+ $(use_with acl) \
+ $(use_with audit) \
+ $(use_with cracklib libcrack) \
+ $(use_with pam libpam) \
+ $(use_with skey) \
+ $(use_with selinux) \
+ $(use_enable nls) \
+ $(use_with elibc_glibc nscd) \
+ $(use_with xattr attr)
+ has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
+
+ if use nls ; then
+ local l langs="po" # These are the pot files.
+ for l in ${LANGS[*]} ; do
+ use linguas_${l} && langs+=" ${l}"
+ done
+ sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die
+ fi
+}
+
+set_login_opt() {
+ local comment="" opt=$1 val=$2
+ if [[ -z ${val} ]]; then
+ comment="#"
+ sed -i \
+ -e "/^${opt}\>/s:^:#:" \
+ "${ED}"/etc/login.defs || die
+ else
+ sed -i -r \
+ -e "/^#?${opt}\>/s:.*:${opt} ${val}:" \
+ "${ED}"/etc/login.defs
+ fi
+ local res=$(grep "^${comment}${opt}\>" "${ED}"/etc/login.defs)
+ einfo "${res:-Unable to find ${opt} in /etc/login.defs}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" suidperms=4711 install
+
+ # Remove libshadow and libmisc; see bug 37725 and the following
+ # comment from shadow's README.linux:
+ # Currently, libshadow.a is for internal use only, so if you see
+ # -lshadow in a Makefile of some other package, it is safe to
+ # remove it.
+ rm -f "${ED}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la}
+
+ insinto /etc
+ if ! use pam ; then
+ insopts -m0600
+ doins etc/login.access etc/limits
+ fi
+
+ # needed for 'useradd -D'
+ insinto /etc/default
+ insopts -m0600
+ doins "${FILESDIR}"/default/useradd
+
+ # move passwd to / to help recover broke systems #64441
+ mv "${ED}"/usr/bin/passwd "${ED}"/bin/ || die
+ dosym /bin/passwd /usr/bin/passwd
+
+ cd "${S}"
+ insinto /etc
+ insopts -m0644
+ newins etc/login.defs login.defs
+
+ set_login_opt CREATE_HOME yes
+ if ! use pam ; then
+ set_login_opt MAIL_CHECK_ENAB no
+ set_login_opt SU_WHEEL_ONLY yes
+ set_login_opt CRACKLIB_DICTPATH /usr/$(get_libdir)/cracklib_dict
+ set_login_opt LOGIN_RETRIES 3
+ set_login_opt ENCRYPT_METHOD SHA512
+ set_login_opt CONSOLE
+ else
+ dopamd "${FILESDIR}"/pam.d-include/shadow
+
+ for x in chpasswd chgpasswd newusers; do
+ newpamd "${FILESDIR}"/pam.d-include/passwd ${x}
+ done
+
+ for x in chage chsh chfn \
+ user{add,del,mod} group{add,del,mod} ; do
+ newpamd "${FILESDIR}"/pam.d-include/shadow ${x}
+ done
+
+ # comment out login.defs options that pam hates
+ local opt sed_args=()
+ for opt in \
+ CHFN_AUTH \
+ CONSOLE \
+ CRACKLIB_DICTPATH \
+ ENV_HZ \
+ ENVIRON_FILE \
+ FAILLOG_ENAB \
+ FTMP_FILE \
+ LASTLOG_ENAB \
+ MAIL_CHECK_ENAB \
+ MOTD_FILE \
+ NOLOGINS_FILE \
+ OBSCURE_CHECKS_ENAB \
+ PASS_ALWAYS_WARN \
+ PASS_CHANGE_TRIES \
+ PASS_MIN_LEN \
+ PORTTIME_CHECKS_ENAB \
+ QUOTAS_ENAB \
+ SU_WHEEL_ONLY
+ do
+ set_login_opt ${opt}
+ sed_args+=( -e "/^#${opt}\>/b pamnote" )
+ done
+ sed -i "${sed_args[@]}" \
+ -e 'b exit' \
+ -e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \
+ -e ': exit' \
+ "${ED}"/etc/login.defs || die
+
+ # remove manpages that pam will install for us
+ # and/or don't apply when using pam
+ find "${ED}"/usr/share/man \
+ '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
+ -delete
+
+ # Remove pam.d files provided by pambase.
+ rm "${ED}"/etc/pam.d/{login,passwd,su} || die
+ fi
+
+ # Remove manpages that are handled by other packages
+ find "${ED}"/usr/share/man \
+ '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
+ -delete
+
+ cd "${S}"
+ dodoc ChangeLog NEWS TODO
+ newdoc README README.download
+ cd doc
+ dodoc HOWTO README* WISHLIST *.txt
+}
+
+pkg_preinst() {
+ rm -f "${EROOT}"/etc/pam.d/system-auth.new \
+ "${EROOT}/etc/login.defs.new"
+}
+
+pkg_postinst() {
+ # Enable shadow groups.
+ if [ ! -f "${EROOT}"/etc/gshadow ] ; then
+ if grpck -r -R "${EROOT}" 2>/dev/null ; then
+ grpconv -R "${EROOT}"
+ else
+ ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
+ ewarn "run 'grpconv' afterwards!"
+ fi
+ fi
+
+ einfo "The 'adduser' symlink to 'useradd' has been dropped."
+}
diff --git a/sys-apps/shadow/shadow-4.2.1.ebuild b/sys-apps/shadow/shadow-4.2.1.ebuild
new file mode 100644
index 000000000000..bab46d9e95ce
--- /dev/null
+++ b/sys-apps/shadow/shadow-4.2.1.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils libtool toolchain-funcs pam multilib
+
+DESCRIPTION="Utilities to deal with user accounts"
+HOMEPAGE="http://shadow.pld.org.pl/ http://pkg-shadow.alioth.debian.org/"
+SRC_URI="http://pkg-shadow.alioth.debian.org/releases/${P}.tar.xz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="acl audit cracklib nls pam selinux skey xattr"
+
+RDEPEND="acl? ( sys-apps/acl )
+ audit? ( sys-process/audit )
+ cracklib? ( >=sys-libs/cracklib-2.7-r3 )
+ pam? ( virtual/pam )
+ skey? ( sys-auth/skey )
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ sys-libs/libsemanage
+ )
+ nls? ( virtual/libintl )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+RDEPEND="${RDEPEND}
+ pam? ( >=sys-auth/pambase-20120417 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch #22920
+ epatch_user
+ elibtoolize
+}
+
+src_configure() {
+ tc-is-cross-compiler && export ac_cv_func_setpgrp_void=yes
+ econf \
+ --without-group-name-max-length \
+ --without-tcb \
+ --enable-shared=no \
+ --enable-static=yes \
+ $(use_with acl) \
+ $(use_with audit) \
+ $(use_with cracklib libcrack) \
+ $(use_with pam libpam) \
+ $(use_with skey) \
+ $(use_with selinux) \
+ $(use_enable nls) \
+ $(use_with elibc_glibc nscd) \
+ $(use_with xattr attr)
+ has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
+}
+
+set_login_opt() {
+ local comment="" opt=$1 val=$2
+ [[ -z ${val} ]] && comment="#"
+ sed -i -r \
+ -e "/^#?${opt}/s:.*:${comment}${opt} ${val}:" \
+ "${ED}"/etc/login.defs
+ local res=$(grep "^${comment}${opt}" "${ED}"/etc/login.defs)
+ einfo ${res:-Unable to find ${opt} in /etc/login.defs}
+}
+
+src_install() {
+ emake DESTDIR="${D}" suidperms=4711 install
+
+ # Remove libshadow and libmisc; see bug 37725 and the following
+ # comment from shadow's README.linux:
+ # Currently, libshadow.a is for internal use only, so if you see
+ # -lshadow in a Makefile of some other package, it is safe to
+ # remove it.
+ rm -f "${ED}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la}
+
+ insinto /etc
+ # Using a securetty with devfs device names added
+ # (compat names kept for non-devfs compatibility)
+ insopts -m0600 ; doins "${FILESDIR}"/securetty
+ if ! use pam ; then
+ insopts -m0600
+ doins etc/login.access etc/limits
+ fi
+ # Output arch-specific cruft
+ local devs
+ case $(tc-arch) in
+ ppc*) devs="hvc0 hvsi0 ttyPSC0";;
+ hppa) devs="ttyB0";;
+ arm) devs="ttyFB0 ttySAC0 ttySAC1 ttySAC2 ttySAC3 ttymxc0 ttymxc1 ttymxc2 ttymxc3 ttyO0 ttyO1 ttyO2";;
+ sh) devs="ttySC0 ttySC1";;
+ esac
+ [[ -n ${devs} ]] && printf '%s\n' ${devs} >> "${ED}"/etc/securetty
+
+ # needed for 'useradd -D'
+ insinto /etc/default
+ insopts -m0600
+ doins "${FILESDIR}"/default/useradd
+
+ # move passwd to / to help recover broke systems #64441
+ mv "${ED}"/usr/bin/passwd "${ED}"/bin/ || die
+ dosym /bin/passwd /usr/bin/passwd
+
+ cd "${S}"
+ insinto /etc
+ insopts -m0644
+ newins etc/login.defs login.defs
+
+ if ! use pam ; then
+ set_login_opt MAIL_CHECK_ENAB no
+ set_login_opt SU_WHEEL_ONLY yes
+ set_login_opt CRACKLIB_DICTPATH /usr/$(get_libdir)/cracklib_dict
+ set_login_opt LOGIN_RETRIES 3
+ set_login_opt ENCRYPT_METHOD SHA512
+ else
+ dopamd "${FILESDIR}"/pam.d-include/shadow
+
+ for x in chpasswd chgpasswd newusers; do
+ newpamd "${FILESDIR}"/pam.d-include/passwd ${x}
+ done
+
+ for x in chage chsh chfn \
+ user{add,del,mod} group{add,del,mod} ; do
+ newpamd "${FILESDIR}"/pam.d-include/shadow ${x}
+ done
+
+ # comment out login.defs options that pam hates
+ local opt
+ for opt in \
+ CHFN_AUTH \
+ CRACKLIB_DICTPATH \
+ ENV_HZ \
+ ENVIRON_FILE \
+ FAILLOG_ENAB \
+ FTMP_FILE \
+ LASTLOG_ENAB \
+ MAIL_CHECK_ENAB \
+ MOTD_FILE \
+ NOLOGINS_FILE \
+ OBSCURE_CHECKS_ENAB \
+ PASS_ALWAYS_WARN \
+ PASS_CHANGE_TRIES \
+ PASS_MIN_LEN \
+ PORTTIME_CHECKS_ENAB \
+ QUOTAS_ENAB \
+ SU_WHEEL_ONLY
+ do
+ set_login_opt ${opt}
+ done
+
+ sed -i -f "${FILESDIR}"/login_defs_pam.sed \
+ "${ED}"/etc/login.defs
+
+ # remove manpages that pam will install for us
+ # and/or don't apply when using pam
+ find "${ED}"/usr/share/man \
+ '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
+ -delete
+
+ # Remove pam.d files provided by pambase.
+ rm "${ED}"/etc/pam.d/{login,passwd,su} || die
+ fi
+
+ # Remove manpages that are handled by other packages
+ find "${ED}"/usr/share/man \
+ '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
+ -delete
+
+ cd "${S}"
+ dodoc ChangeLog NEWS TODO
+ newdoc README README.download
+ cd doc
+ dodoc HOWTO README* WISHLIST *.txt
+}
+
+pkg_preinst() {
+ rm -f "${EROOT}"/etc/pam.d/system-auth.new \
+ "${EROOT}/etc/login.defs.new"
+}
+
+pkg_postinst() {
+ # Enable shadow groups.
+ if [ ! -f "${EROOT}"/etc/gshadow ] ; then
+ if grpck -r -R "${EROOT}" 2>/dev/null ; then
+ grpconv -R "${EROOT}"
+ else
+ ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
+ ewarn "run 'grpconv' afterwards!"
+ fi
+ fi
+
+ einfo "The 'adduser' symlink to 'useradd' has been dropped."
+}
diff --git a/sys-apps/smartmontools/Manifest b/sys-apps/smartmontools/Manifest
new file mode 100644
index 000000000000..6128fd7ce336
--- /dev/null
+++ b/sys-apps/smartmontools/Manifest
@@ -0,0 +1,2 @@
+DIST smartmontools-6.3.tar.gz 809790 SHA256 a777065d1a5965d71b3672e054b09b7696200ec73aaf45ab636f34016538fe19 SHA512 59f13ca510618a65d4d227978fbcf9d0f67efbf75c425357ff79b283db650e1fc2ffb27cd37c32dc963c43130a2b982ef7b50e11673c92ae5a4369965fabe524 WHIRLPOOL 4574df8f2e01b1ef7b7874f0376021c6cce2ddd152de5d3db4c055d2e134d77d9a1cbbb372f43525f3ee2fcde2857c27f5feca96c7056dce4b5f86d7324a2087
+DIST smartmontools-6.4.tar.gz 822539 SHA256 eab75600c1eda9c34b13097db71138ab376f3dad8a6a4667fb4d1d081feb7a85 SHA512 366cd55ec668da1ca8a3d9ba79d5bee6e0c59032936b7f2f161f8fbb1c9f869c505d715cc10562b6241f808bb8b534feaf9d9fd752f6cb1593ee893611742adc WHIRLPOOL 72af8a0a4754bd75da9e98a008c64c083579fe27bdbd0655da81c8fe7a258dbc305cafd05f2f21d1954918ab8ff040cf1d54b916a1ce82fb8da64ba2e49b4de0
diff --git a/sys-apps/smartmontools/files/smartd-r1.rc b/sys-apps/smartmontools/files/smartd-r1.rc
new file mode 100644
index 000000000000..336bc4ea9be9
--- /dev/null
+++ b/sys-apps/smartmontools/files/smartd-r1.rc
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/run/smartd.pid"
+command="/usr/sbin/smartd"
+command_args="-p ${pidfile} ${SMARTD_OPTS}"
+extra_started_commands="reload"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+start_pre() {
+ if [ ! -f "/etc/smartd.conf" ] ; then
+ eerror "You should setup your /etc/smartd.conf file!"
+ eerror "See the smartd.conf(5) manpage."
+ return 1
+ fi
+ return 0
+}
+
+reload() {
+ ebegin "Reloading configuration"
+ start-stop-daemon --signal HUP --pidfile ${pidfile} ${command##*/}
+ eend $?
+}
diff --git a/sys-apps/smartmontools/files/smartd.confd b/sys-apps/smartmontools/files/smartd.confd
new file mode 100644
index 000000000000..4b7db4dfd827
--- /dev/null
+++ b/sys-apps/smartmontools/files/smartd.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/smartd: config file for /etc/init.d/smartd
+
+# Insert any other options needed
+SMARTD_OPTS=""
diff --git a/sys-apps/smartmontools/metadata.xml b/sys-apps/smartmontools/metadata.xml
new file mode 100644
index 000000000000..0eea617543ba
--- /dev/null
+++ b/sys-apps/smartmontools/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>
+ <use>
+ <flag name="minimal">Do not install the monitoring daemon and associated scripts.</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">smartmontools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/smartmontools/smartmontools-6.3.ebuild b/sys-apps/smartmontools/smartmontools-6.3.ebuild
new file mode 100644
index 000000000000..2792ca62dbbf
--- /dev/null
+++ b/sys-apps/smartmontools/smartmontools-6.3.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 flag-o-matic systemd
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools"
+ ESVN_PROJECT="smartmontools"
+ inherit subversion autotools
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.) monitoring tools"
+HOMEPAGE="http://smartmontools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="caps minimal selinux static"
+
+DEPEND="
+ caps? (
+ static? ( sys-libs/libcap-ng[static-libs] )
+ !static? ( sys-libs/libcap-ng )
+ )
+ selinux? (
+ sys-libs/libselinux
+ )"
+RDEPEND="${DEPEND}
+ !minimal? ( virtual/mailx )
+ selinux? ( sec-policy/selinux-smartmon )
+"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ #./autogen.sh
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ use minimal && einfo "Skipping the monitoring daemon for minimal build."
+ use static && append-ldflags -static
+ # The build installs /etc/init.d/smartd, but we clobber it
+ # in our src_install, so no need to manually delete it.
+ econf \
+ --with-docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --with-initscriptdir="${EPREFIX}/etc/init.d" \
+ $(use_with caps libcap-ng) \
+ $(use_with selinux) \
+ $(systemd_with_unitdir)
+}
+
+src_install() {
+ if use minimal ; then
+ dosbin smartctl
+ doman smartctl.8
+ else
+ default
+ newinitd "${FILESDIR}"/smartd-r1.rc smartd
+ newconfd "${FILESDIR}"/smartd.confd smartd
+ fi
+}
diff --git a/sys-apps/smartmontools/smartmontools-6.4.ebuild b/sys-apps/smartmontools/smartmontools-6.4.ebuild
new file mode 100644
index 000000000000..157de5e15589
--- /dev/null
+++ b/sys-apps/smartmontools/smartmontools-6.4.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic systemd
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools"
+ ESVN_PROJECT="smartmontools"
+ inherit subversion autotools
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS="alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.) monitoring tools"
+HOMEPAGE="http://smartmontools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="caps minimal selinux static"
+
+DEPEND="
+ caps? (
+ static? ( sys-libs/libcap-ng[static-libs] )
+ !static? ( sys-libs/libcap-ng )
+ )
+ selinux? (
+ sys-libs/libselinux
+ )"
+RDEPEND="${DEPEND}
+ !minimal? ( virtual/mailx )
+ selinux? ( sec-policy/selinux-smartmon )
+"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ #./autogen.sh
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ use minimal && einfo "Skipping the monitoring daemon for minimal build."
+ use static && append-ldflags -static
+ # The build installs /etc/init.d/smartd, but we clobber it
+ # in our src_install, so no need to manually delete it.
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --with-initscriptdir="${EPREFIX}/etc/init.d" \
+ $(use_with caps libcap-ng) \
+ $(use_with selinux) \
+ $(systemd_with_unitdir)
+}
+
+src_install() {
+ if use minimal ; then
+ dosbin smartctl
+ doman smartctl.8
+ else
+ default
+ newinitd "${FILESDIR}"/smartd-r1.rc smartd
+ newconfd "${FILESDIR}"/smartd.confd smartd
+ fi
+}
diff --git a/sys-apps/smartmontools/smartmontools-9999.ebuild b/sys-apps/smartmontools/smartmontools-9999.ebuild
new file mode 100644
index 000000000000..241fec4f456a
--- /dev/null
+++ b/sys-apps/smartmontools/smartmontools-9999.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 flag-o-matic systemd
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools"
+ ESVN_PROJECT="smartmontools"
+ inherit subversion autotools
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-freebsd ~x86-linux ~x64-macos"
+fi
+
+DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.) monitoring tools"
+HOMEPAGE="http://smartmontools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="caps minimal selinux static"
+
+DEPEND="caps? ( sys-libs/libcap-ng )
+ selinux? (
+ sys-libs/libselinux
+ )"
+RDEPEND="${DEPEND}
+ !minimal? ( virtual/mailx )
+ selinux? ( sec-policy/selinux-smartmon )
+"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ #./autogen.sh
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ use minimal && einfo "Skipping the monitoring daemon for minimal build."
+ use static && append-ldflags -static
+ # The build installs /etc/init.d/smartd, but we clobber it
+ # in our src_install, so no need to manually delete it.
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --with-initscriptdir="${EPREFIX}/etc/init.d" \
+ $(use_with caps libcap-ng) \
+ $(use_with selinux) \
+ $(systemd_with_unitdir)
+}
+
+src_install() {
+ if use minimal ; then
+ dosbin smartctl
+ doman smartctl.8
+ else
+ default
+ newinitd "${FILESDIR}"/smartd-r1.rc smartd
+ newconfd "${FILESDIR}"/smartd.confd smartd
+ fi
+}
diff --git a/sys-apps/sparc-utils/Manifest b/sys-apps/sparc-utils/Manifest
new file mode 100644
index 000000000000..1165d09aad3b
--- /dev/null
+++ b/sys-apps/sparc-utils/Manifest
@@ -0,0 +1,2 @@
+DIST sparc-utils_1.9-3.diff.gz 10337 RMD160 5703203291f2ff607366064b098646d08e40b873 SHA1 3f0788d2ef2b42a57ca4c80b03a5b04c16b1a5f0 SHA256 f4ffae1a89fc816689da1ad2b50e776bbc079cf2212a0e539949e8a04c5ed983
+DIST sparc-utils_1.9.orig.tar.gz 110080 RMD160 9827d9ff7cb4f06d4fb3709593e341e6a3b71a2e SHA1 5dc670e0849b89a2c4c46783528133d46e03ec4b SHA256 b652bc27f95dcf10a7626b1d2943a1084e1e0b7f9bd3a97f9a46b6688370fe4b
diff --git a/sys-apps/sparc-utils/files/audioctl.init b/sys-apps/sparc-utils/files/audioctl.init
new file mode 100644
index 000000000000..6aa1871aca9f
--- /dev/null
+++ b/sys-apps/sparc-utils/files/audioctl.init
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+checkconfig() {
+ if [ -z "${PARAMS}" ]
+ then
+ eerror "Please make sure that /etc/conf.d/audioctl has \$PARAMS set"
+ return 1
+ fi
+}
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting audioctl"
+ if [ -n "${DEVICE}" ]; then
+ /usr/bin/audioctl -f ${DEVICE} -nw ${PARAMS}
+ else
+ /usr/bin/audioctl -nw ${PARAMS}
+ fi
+ eend $?
+}
diff --git a/sys-apps/sparc-utils/metadata.xml b/sys-apps/sparc-utils/metadata.xml
new file mode 100644
index 000000000000..3c434d165f08
--- /dev/null
+++ b/sys-apps/sparc-utils/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>sparc</herd>
+<maintainer>
+ <email>sparc@gentoo.org</email>
+ <name>Sparc Team</name>
+</maintainer>
+<longdescription>
+sparc-utils is a set of utilities from Debian GNU/Linux that includes;
+audioctl, elftoaout, piggyback, piggyback64, prtconf, and eeprom.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/sparc-utils/sparc-utils-1.9-r4.ebuild b/sys-apps/sparc-utils/sparc-utils-1.9-r4.ebuild
new file mode 100644
index 000000000000..5b50f6951d84
--- /dev/null
+++ b/sys-apps/sparc-utils/sparc-utils-1.9-r4.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Various sparc utilities from Debian GNU/Linux"
+HOMEPAGE="http://packages.debian.org/sparc-utils"
+SRC_URI="mirror://debian/pool/main/s/${PN}/${PN}_${PV}.orig.tar.gz
+ mirror://debian/pool/main/s/${PN}/${PN}_${PV}-3.diff.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* sparc"
+IUSE=""
+
+DEPEND="virtual/os-headers"
+RDEPEND="|| ( >=sys-apps/util-linux-2.13-r1 sys-apps/setarch )"
+
+S=${WORKDIR}/${P}.orig
+
+# NOTE: If a system has >=sys-kernel/linux-headers-2.6.0, don't build audioctl
+# as the SPARC sound drivers have been replaced by their ALSA equivalents
+
+pkg_setup() {
+ has_version '>=sys-kernel/linux-headers-2.6.0' && \
+ einfo "Linux 2.6 kernel headers detected, not building audioctl"
+}
+
+src_unpack() {
+ unpack ${A}
+ epatch ${WORKDIR}/${PN}_${PV}-3.diff
+ sed -i -e 's:#include <linux/elf.h>:#include <elf.h>:' \
+ ${S}/elftoaout*/elftoaout.c
+}
+
+src_compile() {
+ emake -C elftoaout-2.3 CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die
+ emake -C src piggyback piggyback64 CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die
+ emake -C prtconf-1.3 CC="$(tc-getCC)" all || die
+ has_version '>=sys-kernel/linux-headers-2.6.0' || \
+ emake -C audioctl-1.3 CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ # since the debian/piggyback64.1 manpage is a pointer to the
+ # debian/piggyback.1 manpage, copy debian/piggyback.1 to
+ # debian/piggyback64.1
+
+ cp ${S}/debian/piggyback.1 ${S}/debian/piggyback64.1
+
+ dobin elftoaout-2.3/elftoaout || die
+ dobin src/piggyback || die
+ dobin src/piggyback64 || die
+ dosbin prtconf-1.3/prtconf || die
+ dosbin prtconf-1.3/eeprom || die
+
+ if ! has_version '>=sys-kernel/linux-headers-2.6.0'; then
+ dobin audioctl-1.3/audioctl || die
+ newinitd "${FILESDIR}"/audioctl.init audioctl || die
+ newconfd debian/audioctl.def audioctl || die
+ doman audioctl-1.3/audioctl.1
+ fi
+
+ doman elftoaout-2.3/elftoaout.1
+ doman prtconf-1.3/prtconf.8
+ doman prtconf-1.3/eeprom.8
+ doman debian/piggyback.1
+ doman debian/piggyback64.1
+}
+
+pkg_postinst() {
+ ewarn "In order to have /usr/sbin/eeprom, make sure you build /dev/openprom"
+ ewarn "device support (CONFIG_SUN_OPENPROMIO) into the kernel, or as a"
+ ewarn "module (and that the module is loaded)."
+}
diff --git a/sys-apps/spu-tools/Manifest b/sys-apps/spu-tools/Manifest
new file mode 100644
index 000000000000..33437dae396f
--- /dev/null
+++ b/sys-apps/spu-tools/Manifest
@@ -0,0 +1,2 @@
+DIST spu-tools-2.2.80-95.tar.gz 19917 SHA256 bfa467ddf036b1148978d251fdd5a1dd89dece3cf3895c7875f1ae61482fffc2
+DIST spu-tools-2.3.0.135.tar.gz 21580 SHA256 358ab3ee3511530ce330331f3e9d60dd93333616ef003ecad443500d60c11494
diff --git a/sys-apps/spu-tools/metadata.xml b/sys-apps/spu-tools/metadata.xml
new file mode 100644
index 000000000000..16fed8ff6fb6
--- /dev/null
+++ b/sys-apps/spu-tools/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>lu_zero@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">libspe</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/spu-tools/spu-tools-2.2.80_p95.ebuild b/sys-apps/spu-tools/spu-tools-2.2.80_p95.ebuild
new file mode 100644
index 000000000000..30095ed4cb85
--- /dev/null
+++ b/sys-apps/spu-tools/spu-tools-2.2.80_p95.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+MY_P=${P/_p/-}
+
+DESCRIPTION="CELL spu ps and top alike utilities"
+HOMEPAGE="http://sourceforge/projects/libspe"
+SRC_URI="mirror://sourceforge/libspe/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="ppc ppc64"
+IUSE=""
+
+DEPEND="sys-libs/ncurses
+ sys-apps/help2man"
+RDEPEND="sys-libs/ncurses"
+
+S="${WORKDIR}/${PN}/src"
+
+src_compile() {
+ emake all || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="$D" install || die
+}
diff --git a/sys-apps/spu-tools/spu-tools-2.3.0.135.ebuild b/sys-apps/spu-tools/spu-tools-2.3.0.135.ebuild
new file mode 100644
index 000000000000..1e496454942c
--- /dev/null
+++ b/sys-apps/spu-tools/spu-tools-2.3.0.135.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+MY_P=${P/_p/-}
+
+DESCRIPTION="CELL spu ps and top alike utilities"
+HOMEPAGE="http://sourceforge/projects/libspe"
+SRC_URI="mirror://sourceforge/libspe/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~ppc ~ppc64"
+IUSE=""
+
+DEPEND="sys-libs/ncurses
+ sys-apps/help2man"
+RDEPEND="sys-libs/ncurses"
+
+S="${WORKDIR}/${PN}/src"
+
+src_compile() {
+ emake all || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="$D" install || die
+}
diff --git a/sys-apps/stroke/Manifest b/sys-apps/stroke/Manifest
new file mode 100644
index 000000000000..624ca8bc9ba5
--- /dev/null
+++ b/sys-apps/stroke/Manifest
@@ -0,0 +1 @@
+DIST stroke-0.1.3.tar.gz 180438 SHA256 3c96fee2272fe37900d3f7c8cd2373170b47bc6856f0052d43d5793b6a680a05
diff --git a/sys-apps/stroke/metadata.xml b/sys-apps/stroke/metadata.xml
new file mode 100644
index 000000000000..954ef749dcb0
--- /dev/null
+++ b/sys-apps/stroke/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">stroke</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/stroke/stroke-0.1.3.ebuild b/sys-apps/stroke/stroke-0.1.3.ebuild
new file mode 100644
index 000000000000..532e24b8e9c5
--- /dev/null
+++ b/sys-apps/stroke/stroke-0.1.3.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit base
+
+DESCRIPTION="A powerful tool to change file timestamps (including ctimes)"
+HOMEPAGE="http://stroke.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DOCS=( AUTHORS ChangeLog README TODO )
diff --git a/sys-apps/superiotool/Manifest b/sys-apps/superiotool/Manifest
new file mode 100644
index 000000000000..e6ec40d8a1cc
--- /dev/null
+++ b/sys-apps/superiotool/Manifest
@@ -0,0 +1 @@
+DIST superiotool-6637.tar.xz 27364 RMD160 6a54fe45717a15bc3751455c310a16e3fa34ee9e SHA1 4e0c5c4c9778edd86443dcaf84cc102da351410c SHA256 e21e091c7679c2eeac66aa49499c02587d64a41b3b36449f4ec06dafc8f0ba21
diff --git a/sys-apps/superiotool/files/make-tarball.sh b/sys-apps/superiotool/files/make-tarball.sh
new file mode 100755
index 000000000000..3711db140db3
--- /dev/null
+++ b/sys-apps/superiotool/files/make-tarball.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+. /etc/init.d/functions.sh
+
+svnrev() { svn info "$1" | awk '$1 == "Revision:" { print $NF }'; }
+
+PN=superiotool
+SVN_ROOT=${2:-/usr/local/src}
+srcdir=${SVN_ROOT}/${PN}
+PV=${1:-$(svnrev "${srcdir}")}
+
+P=${PN}-${PV}
+T=/tmp
+
+if [[ -d ${srcdir} ]] ; then
+ cd "${T}" || die
+
+ rm -rf ${P}
+
+ ebegin "Exporting ${srcdir} ${PV} to ${P}"
+ svn export -q -r ${PV} ${srcdir} ${P}
+ eend $? || die
+
+ ebegin "Creating ${P}.tar.xz"
+ tar cf - ${P} | xz > ${P}.tar.xz
+ eend $?
+
+ einfo "Tarball now ready at: ${T}/${P}.tar.xz"
+else
+ einfo "You need to run:"
+ einfo " cd ${base}"
+ einfo " svn co svn://coreboot.org/coreboot/trunk/util/superiotool"
+ die "need svn checkout dir"
+fi
diff --git a/sys-apps/superiotool/metadata.xml b/sys-apps/superiotool/metadata.xml
new file mode 100644
index 000000000000..8c509c1d6234
--- /dev/null
+++ b/sys-apps/superiotool/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>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ </maintainer>
+ <maintainer>
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="pci">Support for PCI-attached "Super I/Os" (e.g. in VIA VT82686A/B).</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/superiotool/superiotool-6637.ebuild b/sys-apps/superiotool/superiotool-6637.ebuild
new file mode 100644
index 000000000000..b5c936ac721b
--- /dev/null
+++ b/sys-apps/superiotool/superiotool-6637.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ ESVN_REPO_URI="svn://coreboot.org/coreboot/trunk/util/${PN}"
+ inherit subversion
+ SRC_URI=""
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="util to detect Super I/O chips and functionality"
+HOMEPAGE="http://www.coreboot.org/Superiotool"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="pci"
+
+RDEPEND="pci? ( sys-apps/pciutils )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+
+src_prepare() {
+ sed -i \
+ -e 's:-Werror ::' \
+ -e 's:-O2 ::' \
+ -e 's:\s\+\?-lz\s\+\?::' \
+ -e "/^CONFIG_PCI =/s:=.*:=$(usex pci yes no):" \
+ -e '/PREFIX/s:=.*:= /usr:' \
+ Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ SVNDEF="-D'SUPERIOTOOL_VERSION=\"${ESVN_WC_REVISION}\"'"
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+ dodoc README
+}
diff --git a/sys-apps/superiotool/superiotool-99999999.ebuild b/sys-apps/superiotool/superiotool-99999999.ebuild
new file mode 100644
index 000000000000..b5c936ac721b
--- /dev/null
+++ b/sys-apps/superiotool/superiotool-99999999.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ ESVN_REPO_URI="svn://coreboot.org/coreboot/trunk/util/${PN}"
+ inherit subversion
+ SRC_URI=""
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+DESCRIPTION="util to detect Super I/O chips and functionality"
+HOMEPAGE="http://www.coreboot.org/Superiotool"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="pci"
+
+RDEPEND="pci? ( sys-apps/pciutils )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+
+src_prepare() {
+ sed -i \
+ -e 's:-Werror ::' \
+ -e 's:-O2 ::' \
+ -e 's:\s\+\?-lz\s\+\?::' \
+ -e "/^CONFIG_PCI =/s:=.*:=$(usex pci yes no):" \
+ -e '/PREFIX/s:=.*:= /usr:' \
+ Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ SVNDEF="-D'SUPERIOTOOL_VERSION=\"${ESVN_WC_REVISION}\"'"
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+ dodoc README
+}
diff --git a/sys-apps/syscriptor/Manifest b/sys-apps/syscriptor/Manifest
new file mode 100644
index 000000000000..3edbb4e7c513
--- /dev/null
+++ b/sys-apps/syscriptor/Manifest
@@ -0,0 +1 @@
+DIST syscriptor-1.5.15.tar.bz2 58732 SHA256 74c8bedc473e3b55171b6e2fdc4ed694983fdfa36a213c1356f6ad49872b62ef
diff --git a/sys-apps/syscriptor/metadata.xml b/sys-apps/syscriptor/metadata.xml
new file mode 100644
index 000000000000..85abe371265a
--- /dev/null
+++ b/sys-apps/syscriptor/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">syscriptor</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/syscriptor/syscriptor-1.5.15.ebuild b/sys-apps/syscriptor/syscriptor-1.5.15.ebuild
new file mode 100644
index 000000000000..a4b366d79ab2
--- /dev/null
+++ b/sys-apps/syscriptor/syscriptor-1.5.15.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DESCRIPTION="display misc information about your hardware"
+HOMEPAGE="http://syscriptor.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ppc x86"
+IUSE=""
+
+S=${WORKDIR}/${PN}
+
+src_install () {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS CREDITS ChangeLog HISTORY NEWS README TODO
+}
diff --git a/sys-apps/syslog-notify/Manifest b/sys-apps/syslog-notify/Manifest
new file mode 100644
index 000000000000..c8011db72e04
--- /dev/null
+++ b/sys-apps/syslog-notify/Manifest
@@ -0,0 +1 @@
+DIST syslog-notify-0.2.tar.bz2 77178 SHA256 d554e1cd5c5e5399e313674e8f296185cd2f33877d4b2b63a4e4a57ce27fa159 SHA512 724696d9ecfe34ebea5cd37d122b1151a376fc57d747b4f3bf35ab897a9afddd5565dd174c9c576ba10c8441cd57cdf48141d0dab5b35c5ab27e766d10d27b6b WHIRLPOOL eeefd92ffd7f22debeea1591509d1b74dbba0a782df4c7b731d17b6a9a6e5283a28a3c060dd474ee30fd6fccfa85c94cfc6726679ccec3082d4f5e0bd3469721
diff --git a/sys-apps/syslog-notify/metadata.xml b/sys-apps/syslog-notify/metadata.xml
new file mode 100644
index 000000000000..5e3a61a90139
--- /dev/null
+++ b/sys-apps/syslog-notify/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>hwoarang@gentoo.org</email>
+<name>Markos Chandras</name>
+</maintainer>
+<longdescription lang="en">
+</longdescription>
+</pkgmetadata>
+
diff --git a/sys-apps/syslog-notify/syslog-notify-0.2.ebuild b/sys-apps/syslog-notify/syslog-notify-0.2.ebuild
new file mode 100644
index 000000000000..6d94ccbd4599
--- /dev/null
+++ b/sys-apps/syslog-notify/syslog-notify-0.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit readme.gentoo
+
+DESCRIPTION="Notifications for syslog entries via libnotify"
+HOMEPAGE="http://jtniehof.github.com/syslog-notify/"
+SRC_URI="mirror://github/jtniehof/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND=">=x11-libs/libnotify-0.7"
+RDEPEND="${DEPEND}
+ || ( app-admin/syslog-ng app-admin/rsyslog )"
+
+pkg_setup() {
+ DOCS="AUTHORS CHANGELOG HACKING README"
+ DISABLE_AUTOFORMATTING="yes"
+ DOC_CONTENTS="Add the following options on your /etc/syslog-ng/syslog-ng.conf
+file:
+# destination notify { pipe("/var/spool/syslog-notify"); };
+# log { source(src); destination(notify);};
+
+Remember to restart syslog-ng before starting syslog-notify."
+}
+
+src_install() {
+ default
+ dodir /var/spool
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ mkfifo "${EROOT}"/var/spool/syslog-notify
+ readme.gentoo_print_elog
+}
diff --git a/sys-apps/systemd-readahead/Manifest b/sys-apps/systemd-readahead/Manifest
new file mode 100644
index 000000000000..bb18cddab249
--- /dev/null
+++ b/sys-apps/systemd-readahead/Manifest
@@ -0,0 +1 @@
+DIST systemd-216.tar.xz 3612960 SHA256 945d3db7d840d6ffe98aa68394428e13317161ae79905397faab6671619728f3 SHA512 f4eee6664368168eafd61939f1355ac21c7eeecce6247de98ef36f40bb6a942d12c006ced4ee15f3d8f11699c194990222d5a5115b45f2aa81f2a1abafebbdd2 WHIRLPOOL 505e09b55209a4f9d8cec077970571b2e1298e8db02946a6c79df139dece9d1a08e46c86ef6c8053274abfd46c9a5ea09157f5bc9dc1f7461322c596e84ef494
diff --git a/sys-apps/systemd-readahead/metadata.xml b/sys-apps/systemd-readahead/metadata.xml
new file mode 100644
index 000000000000..8a0f59154c4c
--- /dev/null
+++ b/sys-apps/systemd-readahead/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-apps/systemd-readahead/systemd-readahead-216.ebuild b/sys-apps/systemd-readahead/systemd-readahead-216.ebuild
new file mode 100644
index 000000000000..4a091da4966a
--- /dev/null
+++ b/sys-apps/systemd-readahead/systemd-readahead-216.ebuild
@@ -0,0 +1,161 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit systemd toolchain-funcs udev
+
+DESCRIPTION="Split of readahead systemd implementation"
+HOMEPAGE="http://dev.gentoo.org/~pacho/systemd-readahead.html"
+SRC_URI="http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz"
+
+LICENSE="LGPL-2.1 MIT"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86"
+IUSE=""
+
+S=${WORKDIR}/systemd-${PV}
+
+RDEPEND=">=sys-apps/systemd-217:="
+DEPEND="${RDEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-kernel/linux-headers-3.8
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # systemd-notify no longer supports readahead playing
+ sed -i -e 's:ExecStart=@SYSTEMD_NOTIFY@ --readahead=done:ExecStart=/bin/touch /run/systemd/readahead/done:' \
+ units/systemd-readahead-done.service.in || die
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ --enable-readahead
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # Disable most of the stuff
+ --disable-efi
+ --disable-ima
+ --disable-acl
+ --disable-apparmor
+ --disable-audit
+ --disable-libcryptsetup
+ --disable-libcurl
+ --disable-gtk-doc
+ --disable-elfutils
+ --disable-gcrypt
+ --disable-gudev
+ --disable-microhttpd
+ --disable-gnutls
+ --disable-libidn
+ --disable-introspection
+ --disable-kdbus
+ --disable-kmod
+ --disable-lz4
+ --disable-xz
+ --disable-pam
+ --disable-polkit
+ --without-python
+ --disable-python-devel
+ --disable-qrencode
+ --disable-seccomp
+ --disable-selinux
+ --disable-tests
+ --disable-dbus
+
+ --disable-smack
+ --disable-blkid
+ --disable-multi-seat-x
+ --disable-myhostname
+
+ # Disable optional binaries
+ --disable-backlight
+ --disable-binfmt
+ --disable-bootchart
+ --disable-coredump
+ --disable-firstboot
+ --disable-hostnamed
+ --disable-localed
+ --disable-logind
+ --disable-machined
+ --disable-networkd
+ --disable-quotacheck
+ --disable-randomseed
+ --disable-resolved
+ --disable-rfkill
+ --disable-sysusers
+ --disable-timedated
+ --disable-timesyncd
+ --disable-tmpfiles
+ --disable-vconsole
+
+ # not supported (avoid automagic deps in the future)
+ --disable-chkconfig
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+ --with-dbusinterfacedir="${EPREFIX}/usr/share/dbus-1/interfaces"
+ )
+
+ # Work around bug 463846.
+ tc-export CC
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ echo 'BUILT_SOURCES: $(BUILT_SOURCES)' > "${T}"/Makefile.extra
+ emake -f Makefile -f "${T}"/Makefile.extra BUILT_SOURCES
+
+ emake systemd-readahead
+ emake units/systemd-readahead-{drop,collect,replay,done}.service units/systemd-readahead-done.timer
+ emake man/{sd-readahead.3,sd_readahead.3,systemd-readahead-replay.service.8}
+}
+
+src_test() {
+ einfo "No specific tests for this"
+}
+
+src_install() {
+ # Install main app
+ exeinto /usr/lib/systemd/
+ doexe systemd-readahead
+
+ # Install unit files
+ systemd_dounit units/systemd-readahead-{drop,collect,replay,done}.service units/systemd-readahead-done.timer
+
+ # Install manpages and aliases
+ doman man/{sd-readahead.3,sd_readahead.3,systemd-readahead-replay.service.8}
+ newman man/systemd-readahead-replay.service.8 systemd-readahead-collect.service.8
+ newman man/systemd-readahead-replay.service.8 systemd-readahead-done.service.8
+ newman man/systemd-readahead-replay.service.8 systemd-readahead-done.timer.8
+ newman man/systemd-readahead-replay.service.8 systemd-readahead.8
+
+ # Install docs
+ dodoc TODO README
+}
diff --git a/sys-apps/systemd-sysv-utils/Manifest b/sys-apps/systemd-sysv-utils/Manifest
new file mode 100644
index 000000000000..e51dca880c60
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/Manifest
@@ -0,0 +1,5 @@
+DIST systemd-208.tar.xz 2382904 SHA256 aa64fa864466fd5727005c55d61c092828b94b4f857272c0b503695022146390 SHA512 c21989b747f5e73ba2311919e1ae558132e4ab2e0d8715c25f51e5e90069e147a52e04280c736ecca6b675af7d79def576171a9b08aaeda45fcd52bcdca011cb WHIRLPOOL e86fdbf96c75c4c94c9507900a5696ff811f5439e0cb45bdc765dc42c62a855c9d2e7d3414df7ec7e18013d937c9148e42c861d0e28e8b4c2fabebd234fbee03
+DIST systemd-212.tar.xz 2722692 SHA256 652906b43704fe705cb47757ea9bbbf3c1ab4a1d55ea38b0013a6f2d0863f2c2 SHA512 3e6dac77785cb2f928886886f92cdd11ed00a4db1453699e0102d3ecffa03d1795f44df10239105e4b2b039f0e3e4b5d44c9f876f25c10a6dc4f7e1fbf87c333 WHIRLPOOL 31d1a967435963155c60ca5016f207aa105e9ddcb7d73e9fcde20f7e1fb66701384b81ee01134bf4d75dfa1ea0d412bb352ff11ac6f8c05e836135baf94bbe37
+DIST systemd-215.tar.xz 2888652 SHA256 ce76a3c05e7d4adc806a3446a5510c0c9b76a33f19adc32754b69a0945124505 SHA512 58de0bf7c43c309c2f8e4b7af16b46608a4ea39cbb280496fe5d43d76ea25545484f4ef62efce18be487c69134e4a038d8787f2c262484f92f7fc6feb3ae2f11 WHIRLPOOL 07389822b9f09cd91f360f3cbdcd0b5bf46ba1750dd1a4ad44fd2813436ef40b447b954d33582ffe83aebde618ecbeac4d2f3231d8afbf3975caf84f52b1053a
+DIST systemd-216.tar.xz 3612960 SHA256 945d3db7d840d6ffe98aa68394428e13317161ae79905397faab6671619728f3 SHA512 f4eee6664368168eafd61939f1355ac21c7eeecce6247de98ef36f40bb6a942d12c006ced4ee15f3d8f11699c194990222d5a5115b45f2aa81f2a1abafebbdd2 WHIRLPOOL 505e09b55209a4f9d8cec077970571b2e1298e8db02946a6c79df139dece9d1a08e46c86ef6c8053274abfd46c9a5ea09157f5bc9dc1f7461322c596e84ef494
+DIST systemd-217.tar.xz 3694524 SHA256 a031e6fbcdc7077b37338bae8074d9428ee2fa98033beb4923a62871890f7498 SHA512 7a0b13330b621ec179499018bfbe9619a91cdbd120ae2067e19cbb9bbc25c80dd0f80aac217d823be1332054439bc9b2153ac78fc1eb231fa0fd55cb3bf7a70f WHIRLPOOL f22674a629b7b928875b6b06b0cffaf5874cdcb90c44787279cd8ff2a798e5bc525c1058f8b2bfe746d100c4d7686e36a6f604276d5735f7554122e4caad6689
diff --git a/sys-apps/systemd-sysv-utils/metadata.xml b/sys-apps/systemd-sysv-utils/metadata.xml
new file mode 100644
index 000000000000..fe305d209585
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/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>systemd@gentoo.org</email>
+ <name>Gentoo systemd team</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/systemd-sysv-utils/systemd-sysv-utils-208.ebuild b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-208.ebuild
new file mode 100644
index 000000000000..657b57ed6121
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-208.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_P=systemd-${PV}
+
+DESCRIPTION="sysvinit compatibility symlinks and manpages"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+# new enough util-linux to have tools that were provided by sysvinit
+# earlier.
+RDEPEND="!sys-apps/sysvinit
+ >=sys-apps/systemd-201
+ >=sys-apps/util-linux-2.24.1-r2"
+
+S=${WORKDIR}/${MY_P}/man
+
+src_install() {
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ doman ${app}.8
+ dosym ../usr/bin/systemctl /sbin/${app}
+ done
+
+ newman init.1 init.8
+ dosym ../usr/lib/systemd/systemd /sbin/init
+}
diff --git a/sys-apps/systemd-sysv-utils/systemd-sysv-utils-212.ebuild b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-212.ebuild
new file mode 100644
index 000000000000..1412c7c1ab72
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-212.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_P=systemd-${PV}
+
+DESCRIPTION="sysvinit compatibility symlinks and manpages"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+# new enough util-linux to have tools that were provided by sysvinit
+# earlier.
+RDEPEND="!sys-apps/sysvinit
+ >=sys-apps/systemd-201
+ >=sys-apps/util-linux-2.24.1-r2"
+
+S=${WORKDIR}/${MY_P}/man
+
+src_install() {
+ : ${ROOTPREFIX=/usr}
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ doman ${app}.8
+ dosym "..${ROOTPREFIX}/bin/systemctl" /sbin/${app}
+ done
+
+ newman init.1 init.8
+ dosym "..${ROOTPREFIX}/lib/systemd/systemd" /sbin/init
+}
diff --git a/sys-apps/systemd-sysv-utils/systemd-sysv-utils-215.ebuild b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-215.ebuild
new file mode 100644
index 000000000000..7d2412d15cda
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-215.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_P=systemd-${PV}
+
+DESCRIPTION="sysvinit compatibility symlinks and manpages"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE=""
+
+# new enough util-linux to have tools that were provided by sysvinit
+# earlier.
+RDEPEND="!sys-apps/sysvinit
+ >=sys-apps/systemd-201
+ >=sys-apps/util-linux-2.24.1-r2"
+
+S=${WORKDIR}/${MY_P}/man
+
+src_install() {
+ : ${ROOTPREFIX=/usr}
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ doman ${app}.8
+ dosym "..${ROOTPREFIX}/bin/systemctl" /sbin/${app}
+ done
+
+ newman init.1 init.8
+ dosym "..${ROOTPREFIX}/lib/systemd/systemd" /sbin/init
+}
diff --git a/sys-apps/systemd-sysv-utils/systemd-sysv-utils-216.ebuild b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-216.ebuild
new file mode 100644
index 000000000000..1412c7c1ab72
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-216.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_P=systemd-${PV}
+
+DESCRIPTION="sysvinit compatibility symlinks and manpages"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+# new enough util-linux to have tools that were provided by sysvinit
+# earlier.
+RDEPEND="!sys-apps/sysvinit
+ >=sys-apps/systemd-201
+ >=sys-apps/util-linux-2.24.1-r2"
+
+S=${WORKDIR}/${MY_P}/man
+
+src_install() {
+ : ${ROOTPREFIX=/usr}
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ doman ${app}.8
+ dosym "..${ROOTPREFIX}/bin/systemctl" /sbin/${app}
+ done
+
+ newman init.1 init.8
+ dosym "..${ROOTPREFIX}/lib/systemd/systemd" /sbin/init
+}
diff --git a/sys-apps/systemd-sysv-utils/systemd-sysv-utils-217.ebuild b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-217.ebuild
new file mode 100644
index 000000000000..1412c7c1ab72
--- /dev/null
+++ b/sys-apps/systemd-sysv-utils/systemd-sysv-utils-217.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MY_P=systemd-${PV}
+
+DESCRIPTION="sysvinit compatibility symlinks and manpages"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+# new enough util-linux to have tools that were provided by sysvinit
+# earlier.
+RDEPEND="!sys-apps/sysvinit
+ >=sys-apps/systemd-201
+ >=sys-apps/util-linux-2.24.1-r2"
+
+S=${WORKDIR}/${MY_P}/man
+
+src_install() {
+ : ${ROOTPREFIX=/usr}
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ doman ${app}.8
+ dosym "..${ROOTPREFIX}/bin/systemctl" /sbin/${app}
+ done
+
+ newman init.1 init.8
+ dosym "..${ROOTPREFIX}/lib/systemd/systemd" /sbin/init
+}
diff --git a/sys-apps/systemd-ui/Manifest b/sys-apps/systemd-ui/Manifest
new file mode 100644
index 000000000000..467f94d50994
--- /dev/null
+++ b/sys-apps/systemd-ui/Manifest
@@ -0,0 +1 @@
+DIST systemd-ui-3.tar.xz 153680 SHA256 455e65000abf39bbccd937786b5f0d7c76ea631b6f28d7142f007fa141338dad SHA512 babc81dc6c205b3b95d19b4c762e2658c02942db884384f25324f63b4dca3cdafdb1b12e1a63ff33f9ff0c8152529cc700a1173c888cf4f6e3a9f0992889c9cd WHIRLPOOL 8f4f9b07c9debf2396581652ea8192bea954a25b8bd94157b0f7f836a6290c62b1ed82df61bdb48a3597774337ce3f4cfdd60c8799e73db92b25a35c9f3e5ab0
diff --git a/sys-apps/systemd-ui/files/systemd-ui-3-vala-0.24.patch b/sys-apps/systemd-ui/files/systemd-ui-3-vala-0.24.patch
new file mode 100644
index 000000000000..ce5df6c75ce9
--- /dev/null
+++ b/sys-apps/systemd-ui/files/systemd-ui-3-vala-0.24.patch
@@ -0,0 +1,35 @@
+From 282a352dff49c13e185d826af2a248b55988bc32 Mon Sep 17 00:00:00 2001
+From: Michael Biebl <biebl@debian.org>
+Date: Tue, 29 Apr 2014 20:20:51 +0000
+Subject: Fix ambiguity between `GLib.Notification' and `Notify.Notification'
+
+Notification is both defined by Notify and the latest GLib, resulting in
+a build failure. Use Notify.Notification instead to avoid this
+ambiguity.
+
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746130
+---
+diff --git a/src/gnome-ask-password-agent.vala b/src/gnome-ask-password-agent.vala
+index 571cd94..f3887dd 100644
+--- a/src/gnome-ask-password-agent.vala
++++ b/src/gnome-ask-password-agent.vala
+@@ -80,7 +80,7 @@ public class MyStatusIcon : StatusIcon {
+ string socket;
+
+ PasswordDialog password_dialog;
+- Notification n;
++ Notify.Notification n;
+
+ public MyStatusIcon() throws GLib.Error {
+ GLib.Object(icon_name : "dialog-password");
+@@ -183,7 +183,7 @@ public class MyStatusIcon : StatusIcon {
+ }
+ set_from_icon_name(icon);
+
+- n = new Notification(title, message, icon);
++ n = new Notify.Notification(title, message, icon);
+ n.set_timeout(5000);
+ n.closed.connect(() => {
+ set_visible(true);
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/sys-apps/systemd-ui/metadata.xml b/sys-apps/systemd-ui/metadata.xml
new file mode 100644
index 000000000000..fe305d209585
--- /dev/null
+++ b/sys-apps/systemd-ui/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>systemd@gentoo.org</email>
+ <name>Gentoo systemd team</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/systemd-ui/systemd-ui-3.ebuild b/sys-apps/systemd-ui/systemd-ui-3.ebuild
new file mode 100644
index 000000000000..60875aa42aa8
--- /dev/null
+++ b/sys-apps/systemd-ui/systemd-ui-3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# Needed per https://bugs.freedesktop.org/show_bug.cgi?id=69643#c5
+VALA_MIN_API_VERSION=0.22
+
+inherit autotools-utils systemd vala
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="
+ !sys-apps/systemd[gtk]
+ >=dev-libs/glib-2.26:2
+ dev-libs/libgee:0.8
+ sys-apps/dbus
+ x11-libs/gtk+:3
+ >=x11-libs/libnotify-0.7
+"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ $(vala_depend)
+"
+
+# Due to vala being broken.
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+PATCHES=( "${FILESDIR}/${P}-vala-0.24.patch" )
+
+src_prepare() {
+ # Force the rebuild of .vala sources
+ touch src/*.vala || die
+
+ # Fix hardcoded path in .vala.
+ sed -i -e "s^/lib/systemd^$(systemd_get_utildir)^g" src/*.vala || die
+
+ autotools-utils_src_prepare
+ vala_src_prepare
+}
diff --git a/sys-apps/systemd-ui/systemd-ui-9999.ebuild b/sys-apps/systemd-ui/systemd-ui-9999.ebuild
new file mode 100644
index 000000000000..8812d56b4097
--- /dev/null
+++ b/sys-apps/systemd-ui/systemd-ui-9999.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+#if LIVE
+AUTOTOOLS_AUTORECONF=yes
+EGIT_REPO_URI="git://anongit.freedesktop.org/systemd/${PN}
+ http://cgit.freedesktop.org/systemd/${PN}/"
+
+inherit git-2
+#endif
+
+# Needed per https://bugs.freedesktop.org/show_bug.cgi?id=69643#c5
+VALA_MIN_API_VERSION=0.22
+
+inherit autotools-utils systemd vala
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!sys-apps/systemd[gtk]
+ >=dev-libs/glib-2.26
+ dev-libs/libgee:0.8
+ sys-apps/dbus
+ x11-libs/gtk+:3
+ >=x11-libs/libnotify-0.7"
+
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ $(vala_depend)"
+
+#if LIVE
+SRC_URI=
+KEYWORDS=
+
+DEPEND="${DEPEND}
+ app-text/docbook-xml-dtd:4.2"
+#endif
+
+# Due to vala being broken.
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+src_prepare() {
+ # Force the rebuild of .vala sources
+ touch src/*.vala || die
+
+ # Fix hardcoded path in .vala.
+ sed -i -e "s^/lib/systemd^$(systemd_get_utildir)^g" src/*.vala || die
+
+ autotools-utils_src_prepare
+ vala_src_prepare
+}
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest
new file mode 100644
index 000000000000..aa6147444e58
--- /dev/null
+++ b/sys-apps/systemd/Manifest
@@ -0,0 +1,11 @@
+DIST systemd-216.tar.xz 3612960 SHA256 945d3db7d840d6ffe98aa68394428e13317161ae79905397faab6671619728f3 SHA512 f4eee6664368168eafd61939f1355ac21c7eeecce6247de98ef36f40bb6a942d12c006ced4ee15f3d8f11699c194990222d5a5115b45f2aa81f2a1abafebbdd2 WHIRLPOOL 505e09b55209a4f9d8cec077970571b2e1298e8db02946a6c79df139dece9d1a08e46c86ef6c8053274abfd46c9a5ea09157f5bc9dc1f7461322c596e84ef494
+DIST systemd-218.tar.xz 3782276 SHA256 1b0768b53b6c6d813a93a4b8fe1f80cf53561b09075010a97c7aa08eee3fd59b SHA512 c183cce8532ccb4716b84587c96a626eea390202a5469b9d89c8cee7f703e40d7c584e05f29501d375b8cd2a1409d011de564df16f54e27f66b3c3007a6e5bd4 WHIRLPOOL 4d0bcf3ddfecd3354d9f4ab13851f8da6baf31e89e64d3b1ac671159f16f23597d88cc2525aece2f867c140fc97e80bce086a5af91f84b8095e2503c13995e6d
+DIST systemd-219_p112.tar.xz 3944604 SHA256 8394ca0d55b05cb07c2187da8b614f3cb4eacc297c501dd09a31dad18acf28ea SHA512 480526ff45a8588b3a572ccc455d6357208093f5dae858947182f6e9e4595c1f612d1b661eff41f39f5df6ad0dcb6b0a08b08c15125baf1cf07402ac18a5130b WHIRLPOOL cf1ea60dc59a2a3f54cb66d24a529b742bd403f996a9e8f132fd9f9dc551308ee233fec4fec3e8feb7a657ccdd25e56a6e0756633a1c76a9c427588b262558d9
+DIST systemd-220-gentoo-r2.tar.xz 7008 SHA256 9d40328056437d0ad799ef6c659e1017cba482888b8f03b8b4628990d79b2a20 SHA512 b0c45d73ee0d0be114f48f4e071a596d6d069c04c8012761aae33658fe569f6ab89e6df370101432484c288b79eb1aef6f0e6c586ce0237c455c7ba6e23d3ab7 WHIRLPOOL 2b017f5d453bd485203a613f6cad424067cb4f561c070e3b2574fdfa1877da3ab45e98d647eec463df8c625c2ce13d7289f439f5ac7a76c2d4f44b256a834d24
+DIST systemd-220-src-boot-efi.tar.xz 19024 SHA256 63aa064938e6d295a2ac4b308876c161aff9eddd1d2012cec0ce00d9b8423469 SHA512 33f8b7d2d09c7dc2f9c55791ab855e3b1763a17db8dd534f67bc4b116def905c2782039e38bb93cd071b198ef582b1d923a5eb15b97a0d6983cb0afffdccdef9 WHIRLPOOL 675654d1fe5c021d7f9ec10d439ccd959812e69b0b816cbdb12508516e41be416a0e7adcb556f49aa7abfaceba4f682ccd353628ddf87cc8d507e5e75ea750b8
+DIST systemd-220.tar.xz 4036028 SHA256 3659588c40221ee7257502c0735491f72796dbe17be560013f6d310deb446332 SHA512 c309b4309f8b8d2d97450fb281053feec7b89227626b69e37f3a0d2154c2810c217e58e218f17da11c04f703c6196cec21c4afdcf63879bc736bbdca058a5da5 WHIRLPOOL 2f8974eacb706987e85c7907a517f6b2d47b009f9259a36375537c8bd09bc4774c81e8dc853aa83e644d7c1b579f5113d0bb8a504c7caa5a9240750f9936d561
+DIST systemd-221.tar.xz 4010048 SHA256 085e088650afbfc688ccb13459aedb1fbc7c8810358605b076301f472d51cc4f SHA512 db2552674f1d656e0398b461b42738fcad40dd64700700a7041650581981e7ac563652ef45b859f73a74058bf0a428c26402b5356cfe50b59c20c2678441ab0f WHIRLPOOL 00939e03a780972ef9ce3a8833ed150c067d86094ea11b92baba42469969653ed8f156744fcde1809df6b127f48e82d73391aec9340146829d83312a40cfb138
+DIST systemd-222.tar.gz 4015599 SHA256 b49f51f9855127987adc98aad3b6d608e4e53eaa029b629f2ea2089ce0234f34 SHA512 83f0acf0ca90c89c902c268af6eef4b61380a30380013cbe89c929357959f51682cd3961a6a4f772abc09d5ca09404ae290edf2c3253fab1b20dc2b5b3ecde47 WHIRLPOOL dd0151034de374b072e70448e7a9ff47693df0190e8a2a11488593400d3d7e53e0a91d86037d027c750584089e6c68e58c437647d608a72f8826f091e3253879
+DIST systemd-224.tar.gz 3868075 SHA256 0d7ac1532a57639fbc828f8a5051a090883c6ad2908618a7a13ab386db831bfc SHA512 7717d340c6de11afd589234b7ec8952fe2ffcd05829622bd7ea8e008870c0e3b83eb1eaf20e85ffffa7adafc9c0c0b94fd93784510792109240e22e6b963f198 WHIRLPOOL 645b08ff0c20994b17b8ed585fb0eef682336961d7fedf25031fa4dc89a4d9a2b58c254e0f9baeedcb228435316fdfb562f9fefd21e5a63f94499d2f1040e093
+DIST systemd.conf.m4-v219 1493 SHA256 90ee489b6e34945e5cda27a269e1247644382084f5a145a2df691282007c6768 SHA512 a117c40229af3ba2a0cec4c3db01728c3cab49bb6403fc84cb34f8a09979d98f7a200cd28bf2bbc7a71cbad856edf31190fba30a9d5810c55911746457bbf31a WHIRLPOOL a1604a4fdf5e2d4a4505252859c64d0a3c131b4bb371cff8c75331438f291f138d2732d939947988ab95b040e377412db84fbf6c45866fee028a2aac70e8eb9f
+DIST unifont-8.0.01.hex.gz 938016 SHA256 f67cffeb5e8a0ce5ad2c19a6f289a4e7c8caa0b8c624368adaf8571994c3ec1c SHA512 23aa0228da186b2f6575c1f06101f58713dfb98193ad3772405668d4e3e18d4c1e0fea40639b237dd3a5f4dee6dea90aed85fea3c28165fdfeeace79a2059e6f WHIRLPOOL 23069b019ca1aa9e33df4ce7a728d399090670b85e37029d45f9a0125d13f965039c7e5b9cd6bc633ef259780286f0e6a596b410c1fc144f1f1205e69e36c5cb
diff --git a/sys-apps/systemd/files/215-0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch b/sys-apps/systemd/files/215-0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
new file mode 100644
index 000000000000..b29c10de0c93
--- /dev/null
+++ b/sys-apps/systemd/files/215-0001-always-check-for-__BYTE_ORDER-__BIG_ENDIAN-when-chec.patch
@@ -0,0 +1,116 @@
+From 28f6bb18cdea297164763db94e2366ca4857c9c7 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Fri, 11 Jul 2014 15:56:16 +0200
+Subject: [PATCH 1/2] always check for __BYTE_ORDER == __BIG_ENDIAN when
+ checking for endianess
+
+Let's always stick to glibc's way to determine byte order, and not mix
+autoconf-specific checks with gcc checks.
+---
+ src/shared/architecture.h | 12 ++++++------
+ src/shared/gpt.h | 4 ++--
+ src/shared/time-dst.c | 6 +++---
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/src/shared/architecture.h b/src/shared/architecture.h
+index 4821d5d..58e97e5 100644
+--- a/src/shared/architecture.h
++++ b/src/shared/architecture.h
+@@ -80,7 +80,7 @@ Architecture uname_architecture(void);
+ # define native_architecture() ARCHITECTURE_X86
+ # define LIB_ARCH_TUPLE "i386-linux-gnu"
+ #elif defined(__powerpc64__)
+-# if defined(WORDS_BIGENDIAN)
++# if __BYTE_ORDER == __BIG_ENDIAN
+ # define native_architecture() ARCHITECTURE_PPC64
+ # define LIB_ARCH_TUPLE "ppc64-linux-gnu"
+ # else
+@@ -88,7 +88,7 @@ Architecture uname_architecture(void);
+ # error "Missing LIB_ARCH_TUPLE for PPC64LE"
+ # endif
+ #elif defined(__powerpc__)
+-# if defined(WORDS_BIGENDIAN)
++# if __BYTE_ORDER == __BIG_ENDIAN
+ # define native_architecture() ARCHITECTURE_PPC
+ # define LIB_ARCH_TUPLE "powerpc-linux-gnu"
+ # else
+@@ -117,7 +117,7 @@ Architecture uname_architecture(void);
+ # define native_architecture() ARCHITECTURE_SPARC
+ # define LIB_ARCH_TUPLE "sparc-linux-gnu"
+ #elif defined(__mips64__)
+-# if defined(WORDS_BIGENDIAN)
++# if __BYTE_ORDER == __BIG_ENDIAN
+ # define native_architecture() ARCHITECTURE_MIPS64
+ # error "Missing LIB_ARCH_TUPLE for MIPS64"
+ # else
+@@ -125,7 +125,7 @@ Architecture uname_architecture(void);
+ # error "Missing LIB_ARCH_TUPLE for MIPS64_LE"
+ # endif
+ #elif defined(__mips__)
+-# if defined(WORDS_BIGENDIAN)
++# if __BYTE_ORDER == __BIG_ENDIAN
+ # define native_architecture() ARCHITECTURE_MIPS
+ # define LIB_ARCH_TUPLE "mips-linux-gnu"
+ # else
+@@ -136,7 +136,7 @@ Architecture uname_architecture(void);
+ # define native_architecture() ARCHITECTURE_ALPHA
+ # define LIB_ARCH_TUPLE "alpha-linux-gnu"
+ #elif defined(__aarch64__)
+-# if defined(WORDS_BIGENDIAN)
++# if __BYTE_ORDER == __BIG_ENDIAN
+ # define native_architecture() ARCHITECTURE_ARM64_BE
+ # define LIB_ARCH_TUPLE "aarch64_be-linux-gnu"
+ # else
+@@ -144,7 +144,7 @@ Architecture uname_architecture(void);
+ # define LIB_ARCH_TUPLE "aarch64-linux-gnu"
+ # endif
+ #elif defined(__arm__)
+-# if defined(WORDS_BIGENDIAN)
++# if __BYTE_ORDER == __BIG_ENDIAN
+ # define native_architecture() ARCHITECTURE_ARM_BE
+ # if defined(__ARM_EABI__)
+ # if defined(__ARM_PCS_VFP)
+diff --git a/src/shared/gpt.h b/src/shared/gpt.h
+index 64090e0..278940b 100644
+--- a/src/shared/gpt.h
++++ b/src/shared/gpt.h
+@@ -42,10 +42,10 @@
+ # define GPT_ROOT_NATIVE GPT_ROOT_X86
+ #endif
+
+-#if defined(__aarch64__) && !defined(WORDS_BIGENDIAN)
++#if defined(__aarch64__) && (__BYTE_ORDER != __BIG_ENDIAN)
+ # define GPT_ROOT_NATIVE GPT_ROOT_ARM_64
+ # define GPT_ROOT_SECONDARY GPT_ROOT_ARM
+-#elif defined(__arm__) && !defined(WORDS_BIGENDIAN)
++#elif defined(__arm__) && (__BYTE_ORDER != __BIG_ENDIAN)
+ # define GPT_ROOT_NATIVE GPT_ROOT_ARM
+ #endif
+
+diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c
+index ceca2fa..6195b11 100644
+--- a/src/shared/time-dst.c
++++ b/src/shared/time-dst.c
+@@ -207,8 +207,8 @@ read_again:
+ if (type_idxs[i] >= num_types)
+ return -EINVAL;
+
+- if (BYTE_ORDER == BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
+- : sizeof(time_t) == 4 || trans_width == 4) {
++ if (__BYTE_ORDER == __BIG_ENDIAN ? sizeof(time_t) == 8 && trans_width == 4
++ : sizeof(time_t) == 4 || trans_width == 4) {
+ /* Decode the transition times, stored as 4-byte integers in
+ network (big-endian) byte order. We work from the end of
+ the array so as not to clobber the next element to be
+@@ -216,7 +216,7 @@ read_again:
+ i = num_transitions;
+ while (i-- > 0)
+ transitions[i] = decode((char *)transitions + i * 4);
+- } else if (BYTE_ORDER != BIG_ENDIAN && sizeof(time_t) == 8) {
++ } else if (__BYTE_ORDER != __BIG_ENDIAN && sizeof(time_t) == 8) {
+ /* Decode the transition times, stored as 8-byte integers in
+ network (big-endian) byte order. */
+ for (i = 0; i < num_transitions; ++i)
+--
+1.8.5.5
+
diff --git a/sys-apps/systemd/files/215-0002-endian-explicitly-include-endian.h-wherever-we-want-.patch b/sys-apps/systemd/files/215-0002-endian-explicitly-include-endian.h-wherever-we-want-.patch
new file mode 100644
index 000000000000..71acac1b00d7
--- /dev/null
+++ b/sys-apps/systemd/files/215-0002-endian-explicitly-include-endian.h-wherever-we-want-.patch
@@ -0,0 +1,53 @@
+From 2281422746c00d2803911f2b4699eee6bc87ee04 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Fri, 11 Jul 2014 16:13:13 +0200
+Subject: [PATCH 2/2] endian: explicitly include endian.h wherever we want to
+ use __BYTE_ORDER
+
+---
+ src/libsystemd/sd-bus/bus-protocol.h | 1 +
+ src/shared/architecture.h | 2 ++
+ src/shared/gpt.h | 2 ++
+ 3 files changed, 5 insertions(+)
+
+diff --git a/src/libsystemd/sd-bus/bus-protocol.h b/src/libsystemd/sd-bus/bus-protocol.h
+index 5046d17..4f46468 100644
+--- a/src/libsystemd/sd-bus/bus-protocol.h
++++ b/src/libsystemd/sd-bus/bus-protocol.h
+@@ -21,6 +21,7 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <endian.h>
+
+ /* Endianness */
+
+diff --git a/src/shared/architecture.h b/src/shared/architecture.h
+index 58e97e5..38780d1 100644
+--- a/src/shared/architecture.h
++++ b/src/shared/architecture.h
+@@ -21,6 +21,8 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <endian.h>
++
+ #include "util.h"
+
+ /* A cleaned up architecture definition. We don't want to get lost in
+diff --git a/src/shared/gpt.h b/src/shared/gpt.h
+index 278940b..ef3444f 100644
+--- a/src/shared/gpt.h
++++ b/src/shared/gpt.h
+@@ -19,6 +19,8 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#include <endian.h>
++
+ #include "sd-id128.h"
+
+ /* We only support root disk discovery for x86, x86-64 and ARM for
+--
+1.8.5.5
+
diff --git a/sys-apps/systemd/files/215-0003-udev-exclude-MD-from-block-device-ownership-event-lo.patch b/sys-apps/systemd/files/215-0003-udev-exclude-MD-from-block-device-ownership-event-lo.patch
new file mode 100644
index 000000000000..c730242c961e
--- /dev/null
+++ b/sys-apps/systemd/files/215-0003-udev-exclude-MD-from-block-device-ownership-event-lo.patch
@@ -0,0 +1,54 @@
+From 9d17a215fb30cb3e49db516a39c9bec2159004a7 Mon Sep 17 00:00:00 2001
+From: Kay Sievers <kay@vrfy.org>
+Date: Thu, 24 Jul 2014 23:37:35 +0200
+Subject: [PATCH 3/3] 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-apps/systemd/files/216-lz4-build.patch b/sys-apps/systemd/files/216-lz4-build.patch
new file mode 100644
index 000000000000..65fe45cb50f9
--- /dev/null
+++ b/sys-apps/systemd/files/216-lz4-build.patch
@@ -0,0 +1,19 @@
+commit 10893a5cfa7d792ba171282c2ec46b85ed6aae0c
+Author: Gustavo Sverzut Barbieri <gustavo.barbieri@intel.com>
+Date: Thu Sep 25 18:08:02 2014 -0300
+
+ journal: build fix when LZ4 is enabled but XZ is not
+
+diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
+index da2ef3b..6b4bf0d 100644
+--- a/src/journal/journal-file.h
++++ b/src/journal/journal-file.h
+@@ -78,7 +78,7 @@ typedef struct JournalFile {
+
+ Hashmap *chain_cache;
+
+-#ifdef HAVE_XZ
++#if defined(HAVE_XZ) || defined(HAVE_LZ4)
+ void *compress_buffer;
+ size_t compress_buffer_size;
+ #endif
diff --git a/sys-apps/systemd/files/216-tmpfiles-setup-dev.patch b/sys-apps/systemd/files/216-tmpfiles-setup-dev.patch
new file mode 100644
index 000000000000..1fa4a3e7ecae
--- /dev/null
+++ b/sys-apps/systemd/files/216-tmpfiles-setup-dev.patch
@@ -0,0 +1,21 @@
+From 8c94052ee543c3598a3c7b0c46688150aa2c6168 Mon Sep 17 00:00:00 2001
+From: Tom Gundersen <teg@jklm.no>
+Date: Mon, 27 Oct 2014 17:15:42 +0100
+Subject: units: tmpfiles-setup-dev - allow unsafe file creation to happen in
+ /dev at boot
+
+This will allow us to mark static device nodes with '!' to indicate that they should only be created at early boot.
+
+diff --git a/units/systemd-tmpfiles-setup-dev.service.in b/units/systemd-tmpfiles-setup-dev.service.in
+index f3833fd..0123a03 100644
+--- a/units/systemd-tmpfiles-setup-dev.service.in
++++ b/units/systemd-tmpfiles-setup-dev.service.in
+@@ -17,4 +17,4 @@ ConditionCapability=CAP_SYS_MODULE
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+-ExecStart=@rootbindir@/systemd-tmpfiles --prefix=/dev --create
++ExecStart=@rootbindir@/systemd-tmpfiles --prefix=/dev --create --boot
+--
+cgit v0.10.2
+
diff --git a/sys-apps/systemd/files/217-systemd-consoled.service.in b/sys-apps/systemd/files/217-systemd-consoled.service.in
new file mode 100644
index 000000000000..fd7938aa8ba2
--- /dev/null
+++ b/sys-apps/systemd/files/217-systemd-consoled.service.in
@@ -0,0 +1,15 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Console Manager and Terminal Emulator
+
+[Service]
+Type=notify
+Restart=always
+RestartSec=0
+ExecStart=@rootlibexecdir@/systemd-consoled
diff --git a/sys-apps/systemd/files/218-Dont-enable-audit-by-default.patch b/sys-apps/systemd/files/218-Dont-enable-audit-by-default.patch
new file mode 100644
index 000000000000..f44b4be85d50
--- /dev/null
+++ b/sys-apps/systemd/files/218-Dont-enable-audit-by-default.patch
@@ -0,0 +1,30 @@
+From: Martin Pitt <martin.pitt@ubuntu.com>
+Date: Sun, 28 Dec 2014 12:49:35 +0100
+Subject: Don't enable audit by default
+
+It causes flooding of dmesg and syslog, suppressing actually important
+messages.
+
+Don't enable it for now, until a better solution is found:
+http://lists.freedesktop.org/archives/systemd-devel/2014-December/026591.html
+
+Bug-Debian: https://bugs.debian.org/773528
+---
+ src/journal/journald-audit.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
+index 69742fa..25ef743 100644
+--- a/src/journal/journald-audit.c
++++ b/src/journal/journald-audit.c
+@@ -542,10 +542,5 @@ int server_open_audit(Server *s) {
+ if (r < 0)
+ return log_error_errno(r, "Failed to add audit fd to event loop: %m");
+
+- /* We are listening now, try to enable audit */
+- r = enable_audit(s->audit_fd, true);
+- if (r < 0)
+- log_warning_errno(r, "Failed to issue audit enable call: %m");
+-
+ return 0;
+ }
diff --git a/sys-apps/systemd/files/224-0001-networkd-fix-neworkd-crash.patch b/sys-apps/systemd/files/224-0001-networkd-fix-neworkd-crash.patch
new file mode 100644
index 000000000000..0e73ddec0196
--- /dev/null
+++ b/sys-apps/systemd/files/224-0001-networkd-fix-neworkd-crash.patch
@@ -0,0 +1,28 @@
+From 49f6e11e89b46bacf7b26f6da3921abc1c2faa80 Mon Sep 17 00:00:00 2001
+From: Susant Sahani <ssahani@gmail.com>
+Date: Sun, 2 Aug 2015 00:16:02 +0530
+Subject: [PATCH] networkd: fix neworkd crash
+
+fix issue #827
+
+hostname should be init to NULL.
+---
+ src/network/networkd-dhcp4.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
+index 4aa301b..5454bdd 100644
+--- a/src/network/networkd-dhcp4.c
++++ b/src/network/networkd-dhcp4.c
+@@ -468,7 +468,7 @@ static int dhcp_lease_acquired(sd_dhcp_client *client, Link *link) {
+ }
+
+ if (link->network->dhcp_hostname) {
+- const char *hostname;
++ const char *hostname = NULL;
+
+ if (!link->network->hostname)
+ r = sd_dhcp_lease_get_hostname(lease, &hostname);
+--
+2.5.0
+
diff --git a/sys-apps/systemd/files/compile-unifont.py b/sys-apps/systemd/files/compile-unifont.py
new file mode 100644
index 000000000000..5464c53e7f9a
--- /dev/null
+++ b/sys-apps/systemd/files/compile-unifont.py
@@ -0,0 +1,119 @@
+# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
+#
+# This file is part of systemd.
+#
+# Copyright 2013-2014 David Herrmann <dh.herrmann@gmail.com>
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+#
+# Parse a unifont.hex file and produce a compressed binary-format.
+#
+
+from __future__ import print_function
+import re
+import sys
+import fileinput
+import struct
+
+#
+# Write "bits" array as binary output.
+#
+
+
+write = getattr(sys.stdout, 'buffer', sys.stdout).write
+
+def write_bin_entry(entry):
+ l = len(entry)
+ if l != 32 and l != 64:
+ entry = "0" * 64
+ l = 0
+ elif l < 64:
+ entry += "0" * (64 - l)
+
+ write(struct.pack('B', int(l / 32))) # width
+ write(struct.pack('B', 0)) # padding
+ write(struct.pack('H', 0)) # padding
+ write(struct.pack('I', 0)) # padding
+
+ i = 0
+ for j in range(0, 16):
+ for k in range(0, 2):
+ if l <= k * 16 * 2:
+ c = 0
+ else:
+ c = int(entry[i:i+2], 16)
+ i += 2
+
+ write(struct.pack('B', c))
+
+def write_bin(bits):
+ write(struct.pack('B', 0x44)) # ASCII: 'D'
+ write(struct.pack('B', 0x56)) # ASCII: 'V'
+ write(struct.pack('B', 0x44)) # ASCII: 'D'
+ write(struct.pack('B', 0x48)) # ASCII: 'H'
+ write(struct.pack('B', 0x52)) # ASCII: 'R'
+ write(struct.pack('B', 0x4d)) # ASCII: 'M'
+ write(struct.pack('B', 0x55)) # ASCII: 'U'
+ write(struct.pack('B', 0x46)) # ASCII: 'F'
+ write(struct.pack('<I', 0)) # compatible-flags
+ write(struct.pack('<I', 0)) # incompatible-flags
+ write(struct.pack('<I', 32)) # header-size
+ write(struct.pack('<H', 8)) # glyph-header-size
+ write(struct.pack('<H', 2)) # glyph-stride
+ write(struct.pack('<Q', 32)) # glyph-body-size
+
+ # write glyphs
+ for idx in range(len(bits)):
+ write_bin_entry(bits[idx])
+
+#
+# Parse hex file into "bits" array
+#
+
+def parse_hex_line(bits, line):
+ m = re.match(r"^([0-9A-Fa-f]+):([0-9A-Fa-f]+)$", line)
+ if m == None:
+ return
+
+ idx = int(m.group(1), 16)
+ val = m.group(2)
+
+ # insert skipped lines
+ for i in range(len(bits), idx):
+ bits.append("")
+
+ bits.insert(idx, val)
+
+def parse_hex():
+ bits = []
+
+ for line in sys.stdin:
+ if not line:
+ continue
+ if line.startswith("#"):
+ continue
+
+ parse_hex_line(bits, line)
+
+ return bits
+
+#
+# In normal mode we simply read line by line from standard-input and write the
+# binary-file to standard-output.
+#
+
+if __name__ == "__main__":
+ bits = parse_hex()
+ write_bin(bits)
diff --git a/sys-apps/systemd/metadata.xml b/sys-apps/systemd/metadata.xml
new file mode 100644
index 000000000000..1e6a5da4a4f4
--- /dev/null
+++ b/sys-apps/systemd/metadata.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>systemd@gentoo.org</email>
+ <name>Gentoo systemd team</name>
+ </maintainer>
+ <use>
+ <flag name="apparmor">Enable AppArmor support</flag>
+ <flag name="audit">Enable support for <pkg>sys-process/audit</pkg></flag>
+ <!-- TODO: drop reference to systemd-import once the oldest release in tree is >218 -->
+ <flag name="curl">Enable support for uploading journals; required to build systemd-import/systemd-pull</flag>
+ <flag name="cryptsetup">Enable cryptsetup tools (includes unit generator for crypttab)</flag>
+ <flag name="firmware-loader">Enable user-space firmware loader (for kernels prior to 3.8)</flag>
+ <flag name="gnuefi">Enable EFI boot manager and stub loader (built using <pkg>sys-boot/gnu-efi</pkg>)</flag>
+ <flag name="elfutils">Enable coredump stacktraces in the journal</flag>
+ <!-- TODO: drop reference to systemd-import once the oldest release in tree is >218 -->
+ <flag name="gcrypt">Enable sealing of journal files using gcrypt; required to build systemd-import/systemd-pull</flag>
+ <flag name="gudev">enable libudev gobject interface</flag>
+ <flag name="http">Enable embedded HTTP server in journald</flag>
+ <flag name="importd">Enable import daemon</flag>
+ <flag name="kdbus">Connect to kernel dbus (KDBUS) instead of userspace dbus if available</flag>
+ <flag name="kmod">Enable kernel module loading via <pkg>sys-apps/kmod</pkg></flag>
+ <flag name="lz4">Enable lz4 compression for the journal</flag>
+ <flag name="nat">Enable support for network address translation in networkd</flag>
+ <flag name="qrcode">Enable qrcode output support in journal</flag>
+ <flag name="sysv-utils">Install sysvinit compatibility symlinks and manpages for init, telinit, halt, poweroff, reboot, runlevel, and shutdown</flag>
+ <flag name="terminal">Enable experimental userspace virtual terminal support</flag>
+ <flag name="vanilla">Disable Gentoo-specific behavior and compatibility quirks</flag>
+ <flag name="xkb">Validate XKB keymap in logind</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">systemd/systemd</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/systemd/systemd-216-r3.ebuild b/sys-apps/systemd/systemd-216-r3.ebuild
new file mode 100644
index 000000000000..99aae12868aa
--- /dev/null
+++ b/sys-apps/systemd/systemd-216-r3.ebuild
@@ -0,0 +1,496 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="acl apparmor audit cryptsetup curl doc elfutils +firmware-loader gcrypt gudev http
+ idn introspection kdbus +kmod lz4 lzma pam policykit python qrcode +seccomp
+ selinux ssl sysv-utils test vanilla"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.20:0=
+ sys-libs/libcap:0=
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ pam? ( virtual/pam:= )
+ python? ( ${PYTHON_DEPS} )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit
+ >=sys-apps/util-linux-2.24.1-r2 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ || (
+ >=sys-apps/util-linux-2.22
+ <sys-apps/sysvinit-2.88-r4
+ )
+ !sys-auth/nss-myhostname
+ !sys-fs/udev
+ gudev? ( !dev-libs/libgudev )"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ python? ( dev-python/lxml[${PYTHON_USEDEP}] )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+PATCHES=(
+ "${FILESDIR}/216-lz4-build.patch"
+ "${FILESDIR}/216-tmpfiles-setup-dev.patch"
+)
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS ~DEVTMPFS ~DMIID
+ ~EPOLL ~FANOTIFY ~FHANDLE ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS
+ ~SECCOMP ~SIGNALFD ~SYSFS ~TIMERFD ~TMPFS_XATTR ~DEVPTS_MULTIPLE_INSTANCES
+ ~!IDE ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2
+ ~!GRKERNSEC_PROC"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+ use firmware-loader || CONFIG_CHECK+=" ~!FW_LOADER_USER_HELPER"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ if ! use firmware-loader && kernel_is -lt 3 8; then
+ ewarn "You seem to be using kernel older than 3.8. Those kernel versions"
+ ewarn "require systemd with USE=firmware-loader to support loading"
+ ewarn "firmware. Missing this flag may cause some hardware not to work."
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_native_enable() {
+ if multilib_is_native_abi; then
+ echo "--enable-${1}"
+ else
+ echo "--disable-${1}"
+ fi
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(use_enable gudev)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable introspection)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_with python)
+ $(multilib_native_use_enable python python-devel)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+
+ # Disable optional binaries for non-native abis
+ $(multilib_native_enable backlight)
+ $(multilib_native_enable binfmt)
+ $(multilib_native_enable bootchart)
+ $(multilib_native_enable coredump)
+ $(multilib_native_enable firstboot)
+ $(multilib_native_enable hostnamed)
+ $(multilib_native_enable localed)
+ $(multilib_native_enable logind)
+ $(multilib_native_enable machined)
+ $(multilib_native_enable networkd)
+ $(multilib_native_enable quotacheck)
+ $(multilib_native_enable randomseed)
+ $(multilib_native_enable readahead)
+ $(multilib_native_enable resolved)
+ $(multilib_native_enable rfkill)
+ $(multilib_native_enable sysusers)
+ $(multilib_native_enable timedated)
+ $(multilib_native_enable timesyncd)
+ $(multilib_native_enable tmpfiles)
+ $(multilib_native_enable vconsole)
+
+ # not supported (avoid automagic deps in the future)
+ --disable-chkconfig
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+ --with-dbusinterfacedir="${EPREFIX}/usr/share/dbus-1/interfaces"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ if use firmware-loader; then
+ myeconfargs+=(
+ --with-firmware-path="/lib/firmware/updates:/lib/firmware"
+ )
+ fi
+
+ if ! multilib_is_native_abi; then
+ myeconfargs+=(
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ )
+ fi
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ # prerequisites for gudev
+ use gudev && emake src/gudev/gudev{enumtypes,marshal}.{c,h}
+
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-libgudev_includeHEADERS
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service
+ rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service
+ rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-timesyncd.service
+ rm -rf "${D}"/etc/systemd/system/network-online.target.wants
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-218-r3.ebuild b/sys-apps/systemd/systemd-218-r3.ebuild
new file mode 100644
index 000000000000..a68aa1953280
--- /dev/null
+++ b/sys-apps/systemd/systemd-218-r3.ebuild
@@ -0,0 +1,460 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="acl apparmor audit cryptsetup curl doc elfutils gcrypt gudev http
+ idn introspection kdbus +kmod +lz4 lzma pam policykit python qrcode +seccomp
+ selinux ssl sysv-utils terminal test vanilla xkb"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.25:0=
+ sys-libs/libcap:0=
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ pam? ( virtual/pam:= )
+ python? ( ${PYTHON_DEPS} )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ terminal? ( >=dev-libs/libevdev-1.2:0=
+ >=x11-libs/libxkbcommon-0.5:0=
+ >=x11-libs/libdrm-2.4:0= )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev
+ gudev? ( !dev-libs/libgudev )"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ python? ( dev-python/lxml[${PYTHON_USEDEP}] )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+PATCHES=( "${FILESDIR}/218-Dont-enable-audit-by-default.patch" )
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # missing in tarball
+ cp "${FILESDIR}"/217-systemd-consoled.service.in \
+ units/user/systemd-consoled.service.in || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(use_enable gudev)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable introspection)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_with python)
+ $(multilib_native_use_enable python python-devel)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable terminal)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # not supported (avoid automagic deps in the future)
+ --disable-chkconfig
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+ --with-dbusinterfacedir="${EPREFIX}/usr/share/dbus-1/interfaces"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ if ! multilib_is_native_abi; then
+ myeconfargs+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ )
+ fi
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ # prerequisites for gudev
+ use gudev && emake src/gudev/gudev{enumtypes,marshal}.{c,h}
+
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-libgudev_includeHEADERS
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-219_p112.ebuild b/sys-apps/systemd/systemd-219_p112.ebuild
new file mode 100644
index 000000000000..62267af94fa6
--- /dev/null
+++ b/sys-apps/systemd/systemd-219_p112.ebuild
@@ -0,0 +1,473 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://dev.gentoo.org/~floppym/dist/${P}.tar.xz
+ http://cgit.freedesktop.org/systemd/systemd/plain/tmpfiles.d/systemd.conf.m4?id=v219 -> systemd.conf.m4-v219"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="acl apparmor audit cryptsetup curl doc elfutils gcrypt gudev http
+ idn importd introspection kdbus +kmod +lz4 lzma nat pam policykit python
+ qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.25:0=
+ sys-libs/libcap:0=
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ python? ( ${PYTHON_DEPS} )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ terminal? ( >=dev-libs/libevdev-1.2:0=
+ >=x11-libs/libxkbcommon-0.5:0=
+ >=x11-libs/libdrm-2.4:0= )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev
+ gudev? ( !dev-libs/libgudev )"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ python? ( dev-python/lxml[${PYTHON_USEDEP}] )
+ terminal? ( media-fonts/unifont[utils(+)] )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+PATCHES=( "${FILESDIR}/218-Dont-enable-audit-by-default.patch" )
+S=${WORKDIR}/systemd-219
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ unpack ${P}.tar.xz
+ cp "${DISTDIR}/systemd.conf.m4-v219" "${S}/tmpfiles.d/systemd.conf.m4" || die
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(use_enable gudev)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(multilib_native_use_enable introspection)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_with python)
+ $(multilib_native_use_enable python python-devel)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable terminal)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # not supported (avoid automagic deps in the future)
+ --disable-chkconfig
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ if ! multilib_is_native_abi; then
+ myeconfargs+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ )
+ fi
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ # prerequisites for gudev
+ use gudev && emake src/gudev/gudev{enumtypes,marshal}.{c,h}
+
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-libgudev_includeHEADERS
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-220-r2.ebuild b/sys-apps/systemd/systemd-220-r2.ebuild
new file mode 100644
index 000000000000..2687fef7a43d
--- /dev/null
+++ b/sys-apps/systemd/systemd-220-r2.ebuild
@@ -0,0 +1,494 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz
+ http://dev.gentoo.org/~floppym/dist/systemd-220-src-boot-efi.tar.xz
+ http://dev.gentoo.org/~floppym/dist/systemd-220-gentoo-r2.tar.xz"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+IUSE="acl apparmor audit cryptsetup curl doc elfutils gcrypt gnuefi gudev http
+ idn importd introspection kdbus +kmod +lz4 lzma nat pam policykit python
+ qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.25:0=
+ sys-libs/libcap:0=
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ gudev? ( >=dev-libs/glib-2.34.3:2=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ introspection? ( >=dev-libs/gobject-introspection-1.31.1:0= )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ python? ( ${PYTHON_DEPS} )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ terminal? ( >=dev-libs/libevdev-1.2:0=
+ >=x11-libs/libxkbcommon-0.5:0=
+ >=x11-libs/libdrm-2.4:0= )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev
+ gudev? ( !dev-libs/libgudev )"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ doc? ( >=dev-util/gtk-doc-1.18 )
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ python? ( dev-python/lxml[${PYTHON_USEDEP}] )
+ terminal? ( media-fonts/unifont[utils(+)] )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+PATCHES=( "${FILESDIR}/218-Dont-enable-audit-by-default.patch" )
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ # http://lists.freedesktop.org/archives/systemd-devel/2015-May/032149.html
+ rm src/journal/audit_type-to-name.h src/udev/keyboard-keys-from-name.gperf || die
+
+ cp "${FILESDIR}"/compile-unifont.py tools/compile-unifont.py || die
+ chmod +x tools/compile-unifont.py || die
+
+ EPATCH_FORCE=yes EPATCH_SUFFIX=patch epatch
+
+ [[ -e src/libsystemd-terminal/unifont-glyph-array.bin ]] || die
+ touch src/libsystemd-terminal/unifont-glyph-array.bin || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable doc gtk-doc)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(use_enable gudev)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(multilib_native_use_enable introspection)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_with python)
+ $(multilib_native_use_enable python python-devel)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable terminal)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # not supported (avoid automagic deps in the future)
+ --disable-chkconfig
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ if ! multilib_is_native_abi; then
+ myeconfargs+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ )
+ fi
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ # prerequisites for gudev
+ use gudev && emake src/gudev/gudev{enumtypes,marshal}.{c,h}
+
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-libgudev_includeHEADERS
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-221.ebuild b/sys-apps/systemd/systemd-221.ebuild
new file mode 100644
index 000000000000..a80e5e302773
--- /dev/null
+++ b/sys-apps/systemd/systemd-221.ebuild
@@ -0,0 +1,489 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+if [[ ${PV} == 9999 ]]; then
+ AUTOTOOLS_AUTORECONF=yes
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+ inherit git-r3
+else
+ SRC_URI="http://www.freedesktop.org/software/systemd/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+fi
+
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-single-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit python
+ qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
+
+REQUIRED_USE="importd? ( curl gcrypt lzma )
+ python? ( ${PYTHON_REQUIRED_USE} )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=
+ sys-libs/libcap:0=
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ python? ( ${PYTHON_DEPS} )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ terminal? ( >=dev-libs/libevdev-1.2:0=
+ >=x11-libs/libxkbcommon-0.5:0=
+ >=x11-libs/libdrm-2.4:0= )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ python? ( dev-python/lxml[${PYTHON_USEDEP}] )
+ terminal? ( media-fonts/unifont[utils(+)] )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+if [[ ${PV} == 9999 ]]; then
+ DEPEND+=" ${PYTHON_DEPS}"
+ REQUIRED_USE+=" ${PYTHON_REQUIRED_USE}"
+fi
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ if [[ ${PV} != 9999 ]]; then
+ # Update the timestamp on this to avoid rebuilding it.
+ [[ -e src/libsystemd-terminal/unifont-glyph-array.bin ]] || die "File missing from tarball"
+ touch src/libsystemd-terminal/unifont-glyph-array.bin || die
+ fi
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ if [[ ${PV} == 9999 ]] || use python; then
+ python_setup
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_with python)
+ $(multilib_native_use_enable python python-devel)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable terminal)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ if ! multilib_is_native_abi; then
+ myeconfargs+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ )
+ fi
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-222-r1.ebuild b/sys-apps/systemd/systemd-222-r1.ebuild
new file mode 100644
index 000000000000..6ae721003ff6
--- /dev/null
+++ b/sys-apps/systemd/systemd-222-r1.ebuild
@@ -0,0 +1,480 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+fi
+UNIFONT=unifont-8.0.01
+SRC_URI+=" terminal? ( http://unifoundry.com/pub/${UNIFONT}/font-builds/${UNIFONT}.hex.gz )"
+
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-any-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit
+ qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
+
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=[${MULTILIB_USEDEP}]
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}]
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ terminal? ( >=dev-libs/libevdev-1.2:0=
+ >=x11-libs/libxkbcommon-0.5:0=
+ >=x11-libs/libdrm-2.4:0= )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20150417[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ terminal? ( ${PYTHON_DEPS} )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+PATCHES=( "${FILESDIR}/218-Dont-enable-audit-by-default.patch" )
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
+src_unpack() {
+ default
+ [[ ${PV} != 9999 ]] || git-r3_src_unpack
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ if use terminal; then
+ python_setup
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for gcc-4.7, bug 554454.
+ cc_cv_CFLAGS__Werror_shadow=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+ # Moved to dev-python/python-systemd
+ --disable-python-devel
+ --without-python
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable terminal)
+ $(multilib_native_use_with terminal unifont "${WORKDIR}/${UNIFONT}.hex")
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-222.ebuild b/sys-apps/systemd/systemd-222.ebuild
new file mode 100644
index 000000000000..da54f38c5ede
--- /dev/null
+++ b/sys-apps/systemd/systemd-222.ebuild
@@ -0,0 +1,482 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+fi
+UNIFONT=unifont-8.0.01
+SRC_URI+=" terminal? ( http://unifoundry.com/pub/${UNIFONT}/font-builds/${UNIFONT}.hex.gz )"
+
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam python-any-r1 systemd toolchain-funcs udev \
+ user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit
+ qrcode +seccomp selinux ssl sysv-utils terminal test vanilla xkb"
+
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=
+ sys-libs/libcap:0=
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ terminal? ( >=dev-libs/libevdev-1.2:0=
+ >=x11-libs/libxkbcommon-0.5:0=
+ >=x11-libs/libdrm-2.4:0= )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20130717-r1[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ terminal? ( ${PYTHON_DEPS} )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ if use terminal; then
+ python_setup
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for gcc-4.7, bug 554454.
+ cc_cv_CFLAGS__Werror_shadow=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+ # Moved to dev-python/python-systemd
+ --disable-python-devel
+ --without-python
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable terminal)
+ $(multilib_native_use_with terminal unifont "${WORKDIR}/${UNIFONT}.hex")
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ if ! multilib_is_native_abi; then
+ myeconfargs+=(
+ MOUNT_{CFLAGS,LIBS}=' '
+
+ ac_cv_search_cap_init=
+ ac_cv_header_sys_capability_h=yes
+ )
+ fi
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-224-r1.ebuild b/sys-apps/systemd/systemd-224-r1.ebuild
new file mode 100644
index 000000000000..7d4b2b79fa97
--- /dev/null
+++ b/sys-apps/systemd/systemd-224-r1.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+fi
+
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam systemd toolchain-funcs udev user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit
+ qrcode +seccomp selinux ssl sysv-utils test vanilla xkb"
+
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=[${MULTILIB_USEDEP}]
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}]
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20150417[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+PATCHES=(
+ "${FILESDIR}/218-Dont-enable-audit-by-default.patch"
+ "${FILESDIR}/224-0001-networkd-fix-neworkd-crash.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
+src_unpack() {
+ default
+ [[ ${PV} != 9999 ]] || git-r3_src_unpack
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for gcc-4.7, bug 554454.
+ cc_cv_CFLAGS__Werror_shadow=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+ --without-python
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sockets.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+reenable_unit() {
+ if systemctl is-enabled --root="${ROOT}" "$1" &> /dev/null; then
+ ebegin "Re-enabling $1"
+ systemctl reenable --root="${ROOT}" "$1"
+ eend $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ # Re-enable systemd-networkd for socket activation
+ reenable_unit systemd-networkd.service
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-224.ebuild b/sys-apps/systemd/systemd-224.ebuild
new file mode 100644
index 000000000000..a7df2642b7cb
--- /dev/null
+++ b/sys-apps/systemd/systemd-224.ebuild
@@ -0,0 +1,476 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+fi
+
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam systemd toolchain-funcs udev user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit
+ qrcode +seccomp selinux ssl sysv-utils test vanilla xkb"
+
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=[${MULTILIB_USEDEP}]
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}]
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20150417[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+PATCHES=( "${FILESDIR}/218-Dont-enable-audit-by-default.patch" )
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
+src_unpack() {
+ default
+ [[ ${PV} != 9999 ]] || git-r3_src_unpack
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for gcc-4.7, bug 554454.
+ cc_cv_CFLAGS__Werror_shadow=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+ --without-python
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sockets.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+reenable_unit() {
+ if systemctl is-enabled --root="${ROOT}" "$1" &> /dev/null; then
+ ebegin "Re-enabling $1"
+ systemctl reenable --root="${ROOT}" "$1"
+ eend $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ # Re-enable systemd-networkd for socket activation
+ reenable_unit systemd-networkd.service
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/systemd/systemd-9999.ebuild b/sys-apps/systemd/systemd-9999.ebuild
new file mode 100644
index 000000000000..a7df2642b7cb
--- /dev/null
+++ b/sys-apps/systemd/systemd-9999.ebuild
@@ -0,0 +1,476 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=yes
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="https://github.com/systemd/systemd.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~ia64 ~x86"
+fi
+
+inherit autotools-utils bash-completion-r1 linux-info multilib \
+ multilib-minimal pam systemd toolchain-funcs udev user
+
+DESCRIPTION="System and service manager for Linux"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/systemd"
+
+LICENSE="GPL-2 LGPL-2.1 MIT public-domain"
+SLOT="0/2"
+IUSE="acl apparmor audit cryptsetup curl elfutils gcrypt gnuefi http
+ idn importd +kdbus +kmod +lz4 lzma nat pam policykit
+ qrcode +seccomp selinux ssl sysv-utils test vanilla xkb"
+
+REQUIRED_USE="importd? ( curl gcrypt lzma )"
+
+MINKV="3.8"
+
+COMMON_DEPEND=">=sys-apps/util-linux-2.26:0=[${MULTILIB_USEDEP}]
+ sys-libs/libcap:0=[${MULTILIB_USEDEP}]
+ !<sys-libs/glibc-2.16
+ acl? ( sys-apps/acl:0= )
+ apparmor? ( sys-libs/libapparmor:0= )
+ audit? ( >=sys-process/audit-2:0= )
+ cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= )
+ curl? ( net-misc/curl:0= )
+ elfutils? ( >=dev-libs/elfutils-0.158:0= )
+ gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] )
+ http? (
+ >=net-libs/libmicrohttpd-0.9.33:0=
+ ssl? ( >=net-libs/gnutls-3.1.4:0= )
+ )
+ idn? ( net-dns/libidn:0= )
+ importd? (
+ app-arch/bzip2:0=
+ sys-libs/zlib:0=
+ )
+ kmod? ( >=sys-apps/kmod-15:0= )
+ lz4? ( >=app-arch/lz4-0_p119:0=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] )
+ nat? ( net-firewall/iptables:0= )
+ pam? ( virtual/pam:= )
+ qrcode? ( media-gfx/qrencode:0= )
+ seccomp? ( sys-libs/libseccomp:0= )
+ selinux? ( sys-libs/libselinux:0= )
+ sysv-utils? (
+ !sys-apps/systemd-sysv-utils
+ !sys-apps/sysvinit )
+ xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+
+# baselayout-2.2 has /run
+RDEPEND="${COMMON_DEPEND}
+ >=sys-apps/baselayout-2.2
+ !sys-auth/nss-myhostname
+ !sys-fs/eudev
+ !sys-fs/udev"
+
+# sys-apps/dbus: the daemon only (+ build-time lib dep for tests)
+PDEPEND=">=sys-apps/dbus-1.6.8-r1:0[systemd]
+ >=sys-apps/hwids-20150417[udev]
+ >=sys-fs/udev-init-scripts-25
+ policykit? ( sys-auth/polkit )
+ !vanilla? ( sys-apps/gentoo-systemd-integration )"
+
+# Newer linux-headers needed by ia64, bug #480218
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils:0
+ dev-util/gperf
+ >=dev-util/intltool-0.50
+ >=sys-apps/coreutils-8.16
+ >=sys-devel/binutils-2.23.1
+ >=sys-devel/gcc-4.6
+ >=sys-kernel/linux-headers-${MINKV}
+ ia64? ( >=sys-kernel/linux-headers-3.9 )
+ virtual/pkgconfig
+ gnuefi? ( >=sys-boot/gnu-efi-3.0.2 )
+ test? ( >=sys-apps/dbus-1.6.8-r1:0 )"
+
+if [[ -n ${AUTOTOOLS_AUTORECONF} ]]; then
+ DEPEND+="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xml-dtd:4.5
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt:0
+ >=dev-libs/libgcrypt-1.4.5:0"
+fi
+
+PATCHES=( "${FILESDIR}/218-Dont-enable-audit-by-default.patch" )
+
+pkg_pretend() {
+ local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS
+ ~DEVPTS_MULTIPLE_INSTANCES ~DEVTMPFS ~DMIID ~EPOLL ~FANOTIFY ~FHANDLE
+ ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SECCOMP ~SIGNALFD ~SYSFS
+ ~TIMERFD ~TMPFS_XATTR
+ ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED
+ ~!SYSFS_DEPRECATED_V2"
+
+ use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL"
+ kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG"
+
+ 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
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if [[ $(gcc-major-version) -lt 4
+ || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]]
+ then
+ eerror "systemd requires at least gcc 4.6 to build. Please switch the active"
+ eerror "gcc version using gcc-config."
+ die "systemd requires at least gcc 4.6"
+ fi
+ fi
+
+ if [[ ${MERGE_TYPE} != buildonly ]]; then
+ if kernel_is -lt ${MINKV//./ }; then
+ ewarn "Kernel version at least ${MINKV} required"
+ fi
+
+ check_extra_config
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
+src_unpack() {
+ default
+ [[ ${PV} != 9999 ]] || git-r3_src_unpack
+}
+
+src_prepare() {
+ # Bug 463376
+ sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ # Keep using the one where the rules were installed.
+ MY_UDEVDIR=$(get_udevdir)
+ # Fix systems broken by bug #509454.
+ [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ # disable -flto since it is an optimization flag
+ # and makes distcc less effective
+ cc_cv_CFLAGS__flto=no
+
+ # Workaround for gcc-4.7, bug 554454.
+ cc_cv_CFLAGS__Werror_shadow=no
+
+ # Workaround for bug 516346
+ --enable-dependency-tracking
+
+ --disable-maintainer-mode
+ --localstatedir=/var
+ --with-pamlibdir=$(getpam_mod_dir)
+ # avoid bash-completion dep
+ --with-bashcompletiondir="$(get_bashcompdir)"
+ # make sure we get /bin:/sbin in $PATH
+ --enable-split-usr
+ # For testing.
+ --with-rootprefix="${ROOTPREFIX-/usr}"
+ --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)"
+ # disable sysv compatibility
+ --with-sysvinit-path=
+ --with-sysvrcnd-path=
+ # no deps
+ --enable-efi
+ --enable-ima
+ --without-python
+
+ # Optional components/dependencies
+ $(multilib_native_use_enable acl)
+ $(multilib_native_use_enable apparmor)
+ $(multilib_native_use_enable audit)
+ $(multilib_native_use_enable cryptsetup libcryptsetup)
+ $(multilib_native_use_enable curl libcurl)
+ $(multilib_native_use_enable elfutils)
+ $(use_enable gcrypt)
+ $(multilib_native_use_enable gnuefi)
+ $(multilib_native_use_enable http microhttpd)
+ $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls)
+ $(multilib_native_use_enable idn libidn)
+ $(multilib_native_use_enable importd)
+ $(multilib_native_use_enable importd bzip2)
+ $(multilib_native_use_enable importd zlib)
+ $(use_enable kdbus)
+ $(multilib_native_use_enable kmod)
+ $(use_enable lz4)
+ $(use_enable lzma xz)
+ $(multilib_native_use_enable nat libiptc)
+ $(multilib_native_use_enable pam)
+ $(multilib_native_use_enable policykit polkit)
+ $(multilib_native_use_enable qrcode qrencode)
+ $(multilib_native_use_enable seccomp)
+ $(multilib_native_use_enable selinux)
+ $(multilib_native_use_enable test tests)
+ $(multilib_native_use_enable test dbus)
+ $(multilib_native_use_enable xkb xkbcommon)
+
+ # hardcode a few paths to spare some deps
+ QUOTAON=/usr/sbin/quotaon
+ QUOTACHECK=/usr/sbin/quotacheck
+
+ # TODO: we may need to restrict this to gcc
+ EFI_CC="$(tc-getCC)"
+
+ # dbus paths
+ --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d"
+ --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services"
+ --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services"
+
+ --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
+ )
+
+ # Work around bug 463846.
+ tc-export CC
+
+ autotools-utils_src_configure
+}
+
+multilib_src_compile() {
+ local mymakeopts=(
+ udevlibexecdir="${MY_UDEVDIR}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}"
+ else
+ echo 'gentoo: $(BUILT_SOURCES)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ echo 'gentoo: $(lib_LTLIBRARIES) $(pkgconfiglib_DATA)' | \
+ emake "${mymakeopts[@]}" -f Makefile -f - gentoo
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi || continue
+
+ default
+}
+
+multilib_src_install() {
+ local mymakeopts=(
+ # automake fails with parallel libtool relinking
+ # https://bugs.gentoo.org/show_bug.cgi?id=491398
+ -j1
+
+ udevlibexecdir="${MY_UDEVDIR}"
+ dist_udevhwdb_DATA=
+ DESTDIR="${D}"
+ )
+
+ if multilib_is_native_abi; then
+ emake "${mymakeopts[@]}" install
+ else
+ mymakeopts+=(
+ install-libLTLIBRARIES
+ install-pkgconfiglibDATA
+ install-includeHEADERS
+ # safe to call unconditionally, 'installs' empty list
+ install-pkgincludeHEADERS
+ )
+
+ emake "${mymakeopts[@]}"
+ fi
+
+ # install compat pkg-config files
+ # Change dbus to >=sys-apps/dbus-1.8.8 if/when this is dropped.
+ local pcfiles=( src/compat-libs/libsystemd-{daemon,id128,journal,login}.pc )
+ emake "${mymakeopts[@]}" install-pkgconfiglibDATA \
+ pkgconfiglib_DATA="${pcfiles[*]}"
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+ einstalldocs
+
+ if use sysv-utils; then
+ for app in halt poweroff reboot runlevel shutdown telinit; do
+ dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app}
+ done
+ dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init
+ else
+ # we just keep sysvinit tools, so no need for the mans
+ rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \
+ || die
+ rm "${D}"/usr/share/man/man1/init.1 || die
+ fi
+
+ # Disable storing coredumps in journald, bug #433457
+ mv "${D}"/usr/lib/sysctl.d/50-coredump.conf{,.disabled} || die
+
+ # Preserve empty dirs in /etc & /var, bug #437008
+ keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \
+ /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \
+ /var/log/journal/remote
+
+ # Symlink /etc/sysctl.conf for easy migration.
+ dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf
+
+ # If we install these symlinks, there is no way for the sysadmin to remove them
+ # permanently.
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die
+ rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die
+ rm -r "${D}"/etc/systemd/system/network-online.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sockets.target.wants || die
+ rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die
+}
+
+migrate_locale() {
+ local envd_locale_def="${EROOT%/}/etc/env.d/02locale"
+ local envd_locale=( "${EROOT%/}"/etc/env.d/??locale )
+ local locale_conf="${EROOT%/}/etc/locale.conf"
+
+ if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then
+ # If locale.conf does not exist...
+ if [[ -e ${envd_locale} ]]; then
+ # ...either copy env.d/??locale if there's one
+ ebegin "Moving ${envd_locale} to ${locale_conf}"
+ mv "${envd_locale}" "${locale_conf}"
+ eend ${?} || FAIL=1
+ else
+ # ...or create a dummy default
+ ebegin "Creating ${locale_conf}"
+ cat > "${locale_conf}" <<-EOF
+ # This file has been created by the sys-apps/systemd ebuild.
+ # See locale.conf(5) and localectl(1).
+
+ # LANG=${LANG}
+ EOF
+ eend ${?} || FAIL=1
+ fi
+ fi
+
+ if [[ ! -L ${envd_locale} ]]; then
+ # now, if env.d/??locale is not a symlink (to locale.conf)...
+ if [[ -e ${envd_locale} ]]; then
+ # ...warn the user that he has duplicate locale settings
+ ewarn
+ ewarn "To ensure consistent behavior, you should replace ${envd_locale}"
+ ewarn "with a symlink to ${locale_conf}. Please migrate your settings"
+ ewarn "and create the symlink with the following command:"
+ ewarn "ln -s -n -f ../locale.conf ${envd_locale}"
+ ewarn
+ else
+ # ...or just create the symlink if there's nothing here
+ ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink"
+ ln -n -s ../locale.conf "${envd_locale_def}"
+ eend ${?} || FAIL=1
+ fi
+ fi
+}
+
+migrate_net_name_slot() {
+ # 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="${EROOT%/}"/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
+ net_move=no
+ elif [[ -f ${net_name_slot} && $(sed -e "/^#/d" -e "/^\W*$/d" ${net_name_slot} | wc -l) == 0 ]]; then
+ net_move=yes
+ elif [[ -L ${net_name_slot} && $(readlink ${net_name_slot}) == /dev/null ]]; then
+ net_move=yes
+ net_name_slot_sym=yes
+ 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 $? || FAIL=1
+ fi
+}
+
+reenable_unit() {
+ if systemctl is-enabled --root="${ROOT}" "$1" &> /dev/null; then
+ ebegin "Re-enabling $1"
+ systemctl reenable --root="${ROOT}" "$1"
+ eend $? || FAIL=1
+ fi
+}
+
+pkg_postinst() {
+ newusergroup() {
+ enewgroup "$1"
+ enewuser "$1" -1 -1 -1 "$1"
+ }
+
+ enewgroup input
+ enewgroup systemd-journal
+ newusergroup systemd-bus-proxy
+ newusergroup systemd-journal-gateway
+ newusergroup systemd-journal-remote
+ newusergroup systemd-journal-upload
+ newusergroup systemd-network
+ newusergroup systemd-resolve
+ newusergroup systemd-timesync
+ use http && newusergroup systemd-journal-gateway
+
+ systemd_update_catalog
+
+ # Keep this here in case the database format changes so it gets updated
+ # when required. Despite that this file is owned by sys-apps/hwids.
+ if has_version "sys-apps/hwids[udev]"; then
+ udevadm hwdb --update --root="${ROOT%/}"
+ fi
+
+ udev_reload || FAIL=1
+
+ # Bug 465468, make sure locales are respect, and ensure consistency
+ # between OpenRC & systemd
+ migrate_locale
+
+ # Migrate 80-net-name-slot.rules -> 80-net-setup-link.rules
+ migrate_net_name_slot
+
+ # Re-enable systemd-networkd for socket activation
+ reenable_unit systemd-networkd.service
+
+ if [[ ${FAIL} ]]; then
+ eerror "One of the postinst commands failed. Please check the postinst output"
+ eerror "for errors. You may need to clean up your system and/or try installing"
+ eerror "systemd again."
+ eerror
+ fi
+
+ if [[ $(readlink "${ROOT}"/etc/resolv.conf) == */run/systemd/network/resolv.conf ]]; then
+ ewarn "resolv.conf is now generated by systemd-resolved. To use it, enable"
+ ewarn "systemd-resolved.service, and create a symlink from /etc/resolv.conf"
+ ewarn "to /run/systemd/resolve/resolv.conf"
+ ewarn
+ fi
+}
+
+pkg_prerm() {
+ # If removing systemd completely, remove the catalog database.
+ if [[ ! ${REPLACED_BY_VERSION} ]]; then
+ rm -f -v "${EROOT}"/var/lib/systemd/catalog/database
+ fi
+}
diff --git a/sys-apps/sysvinit/Manifest b/sys-apps/sysvinit/Manifest
new file mode 100644
index 000000000000..e6b150cb487d
--- /dev/null
+++ b/sys-apps/sysvinit/Manifest
@@ -0,0 +1 @@
+DIST sysvinit-2.88dsf.tar.bz2 105551 SHA256 60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519 SHA512 0bd8eeb124e84fdfa8e621b05f796804ee69a9076b65f5115826bfa814ac1d5d28d31a5c22ebe77c86a93b2288edf4891adc0afaecc4de656c4ecda8a83807bf WHIRLPOOL f4809e19ea2c72c733d3c09a4964d7a6e67b091d1f1d9ef276515b2f138148bfbf516034d3fb1009289f9520f2fbe9e29687f432bba06fb437ebd6e2b9ef570c
diff --git a/sys-apps/sysvinit/files/inittab-2.87 b/sys-apps/sysvinit/files/inittab-2.87
new file mode 100644
index 000000000000..1fcb8bb2ce75
--- /dev/null
+++ b/sys-apps/sysvinit/files/inittab-2.87
@@ -0,0 +1,58 @@
+#
+# /etc/inittab: This file describes how the INIT process should set up
+# the system in a certain run-level.
+#
+# Author: Miquel van Smoorenburg, <miquels@cistron.nl>
+# Modified by: Patrick J. Volkerding, <volkerdi@ftp.cdrom.com>
+# Modified by: Daniel Robbins, <drobbins@gentoo.org>
+# Modified by: Martin Schlemmer, <azarah@gentoo.org>
+# Modified by: Mike Frysinger, <vapier@gentoo.org>
+# Modified by: Robin H. Johnson, <robbat2@gentoo.org>
+#
+# $Id$
+
+# Default runlevel.
+id:3:initdefault:
+
+# System initialization, mount local filesystems, etc.
+si::sysinit:/sbin/rc sysinit
+
+# Further system initialization, brings up the boot runlevel.
+rc::bootwait:/sbin/rc boot
+
+l0:0:wait:/sbin/rc shutdown
+l0s:0:wait:/sbin/halt -dhp
+l1:1:wait:/sbin/rc single
+l2:2:wait:/sbin/rc nonetwork
+l3:3:wait:/sbin/rc default
+l4:4:wait:/sbin/rc default
+l5:5:wait:/sbin/rc default
+l6:6:wait:/sbin/rc reboot
+l6r:6:wait:/sbin/reboot -dk
+#z6:6:respawn:/sbin/sulogin
+
+# new-style single-user
+su0:S:wait:/sbin/rc single
+su1:S:wait:/sbin/sulogin
+
+# TERMINALS
+c1:12345:respawn:/sbin/agetty 38400 tty1 linux
+c2:2345:respawn:/sbin/agetty 38400 tty2 linux
+c3:2345:respawn:/sbin/agetty 38400 tty3 linux
+c4:2345:respawn:/sbin/agetty 38400 tty4 linux
+c5:2345:respawn:/sbin/agetty 38400 tty5 linux
+c6:2345:respawn:/sbin/agetty 38400 tty6 linux
+
+# SERIAL CONSOLES
+#s0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt100
+#s1:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100
+
+# What to do at the "Three Finger Salute".
+ca:12345:ctrlaltdel:/sbin/shutdown -r now
+
+# Used by /etc/init.d/xdm to control DM startup.
+# Read the comments in /etc/init.d/xdm for more
+# info. Do NOT remove, as this will start nothing
+# extra at boot if /etc/init.d/xdm is not added
+# to the "default" runlevel.
+x:a:once:/etc/X11/startDM.sh
diff --git a/sys-apps/sysvinit/files/reboot.sh b/sys-apps/sysvinit/files/reboot.sh
new file mode 100755
index 000000000000..3e50f71cc83b
--- /dev/null
+++ b/sys-apps/sysvinit/files/reboot.sh
@@ -0,0 +1,11 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+opts="-dpk"
+[ "${RC_DOWN_INTERFACE}" = "yes" ] && opts="${opts}i"
+
+/sbin/reboot "${opts}" 2>/dev/null
+
+# hmm, if the above failed, that's kind of odd ...
+# so let's force a reboot
+/sbin/reboot -f
diff --git a/sys-apps/sysvinit/files/shutdown.sh b/sys-apps/sysvinit/files/shutdown.sh
new file mode 100755
index 000000000000..502ef5273cd6
--- /dev/null
+++ b/sys-apps/sysvinit/files/shutdown.sh
@@ -0,0 +1,13 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+opts="-d"
+[ "${INIT_HALT}" != "HALT" ] && opts="${opts}p"
+[ "${RC_DOWN_INTERFACE}" = "yes" ] && opts="${opts}i"
+[ "${RC_DOWN_HARDDISK}" = "yes" ] && opts="${opts}h"
+
+/sbin/halt "${opts}"
+
+# hmm, if the above failed, that's kind of odd ...
+# so let's force a halt
+/sbin/halt -f
diff --git a/sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch b/sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch
new file mode 100644
index 000000000000..4948806d9eb9
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.86-kexec.patch
@@ -0,0 +1,142 @@
+halt: add a -k kexec flag
+
+--- a/man/halt.8
++++ b/man/halt.8
+@@ -40,6 +40,7 @@ halt, reboot, poweroff \- stop the system.
+ .RB [ \-d ]
+ .RB [ \-f ]
+ .RB [ \-i ]
++.RB [ \-k ]
+ .br
+ .B /sbin/poweroff
+ .RB [ \-n ]
+@@ -83,6 +84,8 @@ Put all hard drives on the system in stand-by mode just before halt or power-off
+ .IP \fB\-p\fP
+ When halting the system, switch off the power. This is the default when halt is
+ called as \fBpoweroff\fP.
++.IP \fB\-k\fP
++Try to reboot using \fBkexec\fP, if kernel supports it.
+ .\"}}}
+ .\"{{{ Diagnostics
+ .SH DIAGNOSTICS
+--- a/src/halt.c
++++ b/src/halt.c
+@@ -8,7 +8,7 @@
+ * execute an "shutdown -r". This is for compatibility with
+ * sysvinit 2.4.
+ *
+- * Usage: halt [-n] [-w] [-d] [-f] [-h] [-i] [-p]
++ * Usage: halt [-n] [-w] [-d] [-f] [-h] [-i] [-p] [-k]
+ * -n: don't sync before halting the system
+ * -w: only write a wtmp reboot record and exit.
+ * -d: don't write a wtmp record.
+@@ -16,6 +16,7 @@
+ * -h: put harddisks in standby mode
+ * -i: shut down all network interfaces.
+ * -p: power down the system (if possible, otherwise halt).
++ * -k: reboot the system using kexec.
+ *
+ * Reboot and halt are both this program. Reboot
+ * is just a link to halt. Invoking the program
+@@ -74,8 +75,10 @@ extern void write_wtmp(char *user, char *id, int pid, int type, char *line);
+ */
+ void usage(void)
+ {
+- fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s\n",
+- progname, strcmp(progname, "halt") ? "" : " [-p]");
++ fprintf(stderr, "usage: %s [-n] [-w] [-d] [-f] [-h] [-i]%s%s\n",
++ progname,
++ strcmp(progname, "halt") ? "" : " [-p]",
++ strcmp(progname, "reboot") ? "" : " [-k]");
+ fprintf(stderr, "\t-n: don't sync before halting the system\n");
+ fprintf(stderr, "\t-w: only write a wtmp reboot record and exit.\n");
+ fprintf(stderr, "\t-d: don't write a wtmp record.\n");
+@@ -84,6 +87,8 @@ void usage(void)
+ fprintf(stderr, "\t-i: shut down all network interfaces.\n");
+ if (!strcmp(progname, "halt"))
+ fprintf(stderr, "\t-p: power down the system (if possible, otherwise halt).\n");
++ if (!strcmp(progname, "reboot"))
++ fprintf(stderr, "\t-k: reboot the system using kexec.\n");
+ exit(1);
+ }
+
+@@ -182,6 +187,7 @@ int main(int argc, char **argv)
+ int do_ifdown = 0;
+ int do_hddown = 0;
+ int do_poweroff = 0;
++ int do_kexec = 0;
+ int c;
+ char *tm = NULL;
+
+@@ -201,7 +207,7 @@ int main(int argc, char **argv)
+ /*
+ * Get flags
+ */
+- while((c = getopt(argc, argv, ":ihdfnpwt:")) != EOF) {
++ while((c = getopt(argc, argv, ":ihdfnpwkt:")) != EOF) {
+ switch(c) {
+ case 'n':
+ do_sync = 0;
+@@ -225,6 +231,9 @@ int main(int argc, char **argv)
+ case 'p':
+ do_poweroff = 1;
+ break;
++ case 'k':
++ do_kexec = 1;
++ break;
+ case 't':
+ tm = optarg;
+ break;
+@@ -242,10 +251,24 @@ int main(int argc, char **argv)
+ (void)chdir("/");
+
+ if (!do_hard && !do_nothing) {
++ c = get_runlevel();
++
++ /*
++ * We can't reboot using kexec through this path.
++ */
++ if (c != '6' && do_reboot && do_kexec) {
++ fprintf(stderr, "ERROR: using -k at this"
++ " runlevel requires also -f\n"
++ " (You probably want instead to reboot"
++ " normally and let your reboot\n"
++ " script, usually /etc/init.d/reboot,"
++ " specify -k)\n");
++ exit(1);
++ }
++
+ /*
+ * See if we are in runlevel 0 or 6.
+ */
+- c = get_runlevel();
+ if (c != '0' && c != '6')
+ do_shutdown(do_reboot ? "-r" : "-h", tm);
+ }
+@@ -277,6 +300,15 @@ int main(int argc, char **argv)
+ if (do_nothing) exit(0);
+
+ if (do_reboot) {
++ /*
++ * kexec or reboot
++ */
++ if (do_kexec)
++ init_reboot(BMAGIC_KEXEC);
++
++ /*
++ * Fall through if failed
++ */
+ init_reboot(BMAGIC_REBOOT);
+ } else {
+ /*
+--- a/src/reboot.h
++++ b/src/reboot.h
+@@ -47,5 +47,8 @@
+ # define BMAGIC_POWEROFF BMAGIC_HALT
+ #endif
+
++/* for kexec support */
++#define BMAGIC_KEXEC 0x45584543
++
+ #define init_reboot(magic) reboot(magic)
+
diff --git a/sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch b/sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch
new file mode 100644
index 000000000000..b8e403f629f7
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.86-shutdown-single.patch
@@ -0,0 +1,36 @@
+This patch makes shutdown use the Single User runlevel by default so
+the gettys are shutdown too.
+
+Roy Marples <uberlord@gentoo.org>
+
+--- a/man/shutdown.8
++++ b/man/shutdown.8
+@@ -44,7 +44,7 @@ mail and news processing programs a chance to exit cleanly, etc.
+ \fBshutdown\fP does its job by signalling the \fBinit\fP process,
+ asking it to change the runlevel.
+ Runlevel \fB0\fP is used to halt the system, runlevel \fB6\fP is used
+-to reboot the system, and runlevel \fB1\fP is used to put to system into
++to reboot the system, and runlevel \fBS\fP is used to put to system into
+ a state where administrative tasks can be performed; this is the default
+ if neither the \fI-h\fP or \fI-r\fP flag is given to \fBshutdown\fP.
+ To see which actions are taken on halt or reboot see the appropriate
+--- a/src/shutdown.c
++++ b/src/shutdown.c
+@@ -506,7 +506,7 @@ int main(int argc, char **argv)
+ usage();
+ exit(1);
+ }
+- strcpy(down_level, "1");
++ strcpy(down_level, "S");
+ halttype = NULL;
+
+ /* Process the options. */
+@@ -685,6 +685,8 @@ int main(int argc, char **argv)
+ strcpy(newstate, "for reboot");
+ break;
+ case '1':
++ case 'S':
++ case 's':
+ strcpy(newstate, "to maintenance mode");
+ break;
+ default:
diff --git a/sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch b/sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch
new file mode 100644
index 000000000000..22f463cddb51
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.88-makefile.patch
@@ -0,0 +1,60 @@
+http://savannah.nongnu.org/bugs/index.php?29758
+
+From 2b7d90f04cdd0e343f413c5c7672615926c02706 Mon Sep 17 00:00:00 2001
+From: wfink <wfink@456724a4-4300-0410-8514-c89748c515a2>
+Date: Tue, 4 May 2010 07:50:12 +0000
+Subject: [PATCH] Fix sysvinit bug #29758
+
+git-svn-id: svn://svn.sv.gnu.org/sysvinit/sysvinit/trunk@87 456724a4-4300-0410-8514-c89748c515a2
+
+diff --git a/src/Makefile b/src/Makefile
+index e2b8028..19675c5 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -92,9 +92,9 @@ all: $(BIN) $(SBIN) $(USRBIN)
+ init: LDLIBS += $(INITLIBS) $(STATIC)
+ init: init.o init_utmp.o
+
+-halt: halt.o ifdown.o hddown.o utmp.o reboot.h
++halt: halt.o ifdown.o hddown.o utmp.o
+
+-last: last.o oldutmp.h
++last: last.o
+
+ mesg: mesg.o
+
+@@ -109,7 +109,7 @@ sulogin: sulogin.o
+
+ wall: dowall.o wall.o
+
+-shutdown: dowall.o shutdown.o utmp.o reboot.h
++shutdown: dowall.o shutdown.o utmp.o
+
+ bootlogd: LDLIBS += -lutil
+ bootlogd: bootlogd.o
+@@ -118,14 +118,22 @@ sulogin.o: CPPFLAGS += $(SELINUX_DEF)
+ sulogin.o: sulogin.c
+
+ init.o: CPPFLAGS += $(SELINUX_DEF)
+-init.o: init.c init.h set.h reboot.h initreq.h
++init.o: init.c init.h initreq.h paths.h reboot.h set.h
+
+-utmp.o: utmp.c init.h
++utmp.o:
+
+ init_utmp.o: CPPFLAGS += -DINIT_MAIN
+-init_utmp.o: utmp.c init.h
++init_utmp.o: utmp.c init.h initreq.h paths.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
++utmpdump.o: utmpdump.c oldutmp.h
++
++shutdown.o: shutdown.c paths.h reboot.h initreq.h init.h
++
++halt.o: halt.c reboot.h
++
++last.o: last.c oldutmp.h
++
+ cleanobjs:
+ rm -f *.o *.bak
+
diff --git a/sys-apps/sysvinit/files/sysvinit-2.88-selinux.patch b/sys-apps/sysvinit/files/sysvinit-2.88-selinux.patch
new file mode 100644
index 000000000000..91b7435b25ac
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.88-selinux.patch
@@ -0,0 +1,38 @@
+http://svn.savannah.nongnu.org/viewvc?view=rev&root=sysvinit&revision=90
+https://bugs.gentoo.org/326697
+
+--- sysvinit/trunk/src/init.c 2010/05/07 15:16:26 89
++++ sysvinit/trunk/src/init.c 2010/05/17 09:44:34 90
+@@ -54,10 +54,6 @@
+
+ #ifdef WITH_SELINUX
+ # include <selinux/selinux.h>
+-# include <sys/mount.h>
+-# ifndef MNT_DETACH /* present in glibc 2.10, missing in 2.7 */
+-# define MNT_DETACH 2
+-# endif
+ #endif
+
+ #ifdef __i386__
+@@ -2872,11 +2868,9 @@
+
+ #ifdef WITH_SELINUX
+ if (getenv("SELINUX_INIT") == NULL) {
+- const int rc = mount("proc", "/proc", "proc", 0, 0);
+- if (is_selinux_enabled() > 0) {
+- putenv("SELINUX_INIT=YES");
+- if (rc == 0) umount2("/proc", MNT_DETACH);
++ if (is_selinux_enabled() != 1) {
+ if (selinux_init_load_policy(&enforce) == 0) {
++ putenv("SELINUX_INIT=YES");
+ execv(myname, argv);
+ } else {
+ if (enforce > 0) {
+@@ -2887,7 +2881,6 @@
+ }
+ }
+ }
+- if (rc == 0) umount2("/proc", MNT_DETACH);
+ }
+ #endif
+ /* Start booting. */
diff --git a/sys-apps/sysvinit/files/sysvinit-2.88-shutdown-h.patch b/sys-apps/sysvinit/files/sysvinit-2.88-shutdown-h.patch
new file mode 100644
index 000000000000..716999c39c3b
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.88-shutdown-h.patch
@@ -0,0 +1,65 @@
+other inits have moved to not requiring the -h flag when used with -H/-P.
+modify sysvinit to be the same since it really doesn't matter.
+
+https://bugs.gentoo.org/449354
+
+patch by Doug Goldstein
+
+--- sysvinit-2.88dsf/man/shutdown.8
++++ sysvinit-2.88dsf/man/shutdown.8
+@@ -66,16 +66,15 @@
+ .\"}}}
+ .\"{{{ -h
+ .IP \fB\-h\fP
+-Halt or power off after shutdown.
++Equivalent to -P, unless -H is specified.
+ .\"}}}
+ .\"{{{ -P
+ .IP \fB\-P\fP
+-Halt action is to turn off the power.
++Action is to power-off the machine.
+ .\"}}}
+ .\"{{{ -H
+ .IP \fB\-H\fP
+-Modifier to the -h flag. Halt action is to halt or drop into boot
+-monitor on systems that support it. Must be used with the -h flag.
++Action is to halt the machine.
+ .\"}}}
+ .\"{{{ -f
+ .IP \fB\-f\fP
+--- sysvinit-2.88dsf/src/shutdown.c
++++ sysvinit-2.88dsf/src/shutdown.c
+@@ -514,9 +514,11 @@
+ switch(c) {
+ case 'H':
+ halttype = "HALT";
++ down_level[0] = '0';
+ break;
+ case 'P':
+ halttype = "POWERDOWN";
++ down_level[0] = '0';
+ break;
+ case 'a': /* Access control. */
+ useacl = 1;
+@@ -532,6 +534,8 @@
+ break;
+ case 'h': /* Halt after shutdown */
+ down_level[0] = '0';
++ if (!halttype)
++ halttype = "POWERDOWN";
+ break;
+ case 'f': /* Don't perform fsck after next boot */
+ fastboot = 1;
+@@ -565,12 +569,6 @@
+ }
+ }
+
+- if (NULL != halttype && down_level[0] != '0') {
+- fprintf(stderr, "shutdown: -H and -P flags can only be used along with -h flag.\n");
+- usage();
+- exit(1);
+- }
+-
+ /* Do we need to use the shutdown.allow file ? */
+ if (useacl && (fp = fopen(SDALLOW, "r")) != NULL) {
+
diff --git a/sys-apps/sysvinit/metadata.xml b/sys-apps/sysvinit/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/sysvinit/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-apps/sysvinit/sysvinit-2.88-r4.ebuild b/sys-apps/sysvinit/sysvinit-2.88-r4.ebuild
new file mode 100644
index 000000000000..011e31783420
--- /dev/null
+++ b/sys-apps/sysvinit/sysvinit-2.88-r4.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="/sbin/init - parent of all processes"
+HOMEPAGE="http://savannah.nongnu.org/projects/sysvinit"
+SRC_URI="mirror://nongnu/${PN}/${P}dsf.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="selinux ibm static kernel_FreeBSD"
+
+RDEPEND="
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ sec-policy/selinux-shutdown
+ )
+ !>=sys-apps/util-linux-2.23"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+S=${WORKDIR}/${P}dsf
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.86-kexec.patch #80220
+ epatch "${FILESDIR}"/${PN}-2.86-shutdown-single.patch #158615
+ epatch "${FILESDIR}"/${P}-makefile.patch #319197
+ epatch "${FILESDIR}"/${P}-selinux.patch #326697
+ sed -i '/^CPPFLAGS =$/d' src/Makefile || die
+
+ # mountpoint/sulogin/utmpdump have moved to util-linux
+ sed -i -r \
+ -e '/^(USR)?S?BIN/s:\<(mountpoint|sulogin|utmpdump)\>::g' \
+ -e '/^MAN[18]/s:\<(mountpoint|sulogin|utmpdump)[.][18]\>::g' \
+ src/Makefile || die
+
+ # Mung inittab for specific architectures
+ cd "${WORKDIR}"
+ cp "${FILESDIR}"/inittab-2.87 inittab || die "cp inittab"
+ local insert=()
+ use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
+ use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
+ use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
+ use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
+ use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
+ if use ibm ; then
+ insert+=(
+ '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
+ '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
+ )
+ fi
+ (use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab
+ if use kernel_FreeBSD ; then
+ sed -i \
+ -e 's/linux/cons25/g' \
+ -e 's/ttyS0/cuaa0/g' \
+ -e 's/ttyS1/cuaa1/g' \
+ inittab #121786
+ fi
+ if use x86 || use amd64 ; then
+ sed -i \
+ -e '/ttyS[01]/s:9600:115200:' \
+ inittab
+ fi
+ if [[ ${#insert[@]} -gt 0 ]] ; then
+ printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
+ fi
+}
+
+src_compile() {
+ local myconf
+
+ tc-export CC
+ append-lfs-flags
+ export DISTRO= #381311
+ use static && append-ldflags -static
+ use selinux && myconf=WITH_SELINUX=yes
+ emake -C src ${myconf} || die
+}
+
+src_install() {
+ emake -C src install ROOT="${D}"
+ dodoc README doc/*
+
+ insinto /etc
+ doins "${WORKDIR}"/inittab
+
+ doinitd "${FILESDIR}"/{reboot,shutdown}.sh
+}
+
+pkg_postinst() {
+ # Reload init to fix unmounting problems of / on next reboot.
+ # This is really needed, as without the new version of init cause init
+ # not to quit properly on reboot, and causes a fsck of / on next reboot.
+ if [[ ${ROOT} == / ]] ; then
+ # Do not return an error if this fails
+ /sbin/telinit U &>/dev/null
+ fi
+}
diff --git a/sys-apps/sysvinit/sysvinit-2.88-r5.ebuild b/sys-apps/sysvinit/sysvinit-2.88-r5.ebuild
new file mode 100644
index 000000000000..a885d324179a
--- /dev/null
+++ b/sys-apps/sysvinit/sysvinit-2.88-r5.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="/sbin/init - parent of all processes"
+HOMEPAGE="http://savannah.nongnu.org/projects/sysvinit"
+SRC_URI="mirror://nongnu/${PN}/${P}dsf.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="selinux ibm static kernel_FreeBSD"
+
+RDEPEND="
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ sec-policy/selinux-shutdown
+ )"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+S=${WORKDIR}/${P}dsf
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.86-kexec.patch #80220
+ epatch "${FILESDIR}"/${PN}-2.86-shutdown-single.patch #158615
+ epatch "${FILESDIR}"/${P}-makefile.patch #319197
+ epatch "${FILESDIR}"/${P}-selinux.patch #326697
+ epatch "${FILESDIR}"/${P}-shutdown-h.patch #449354
+ sed -i '/^CPPFLAGS =$/d' src/Makefile || die
+
+ # mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux
+ sed -i -r \
+ -e '/^(USR)?S?BIN/s:\<(mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \
+ -e '/^MAN[18]/s:\<(mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \
+ src/Makefile || die
+
+ # Mung inittab for specific architectures
+ cd "${WORKDIR}"
+ cp "${FILESDIR}"/inittab-2.87 inittab || die "cp inittab"
+ local insert=()
+ use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
+ use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
+ use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
+ use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
+ use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
+ if use ibm ; then
+ insert+=(
+ '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
+ '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
+ )
+ fi
+ (use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab
+ if use kernel_FreeBSD ; then
+ sed -i \
+ -e 's/linux/cons25/g' \
+ -e 's/ttyS0/cuaa0/g' \
+ -e 's/ttyS1/cuaa1/g' \
+ inittab #121786
+ fi
+ if use x86 || use amd64 ; then
+ sed -i \
+ -e '/ttyS[01]/s:9600:115200:' \
+ inittab
+ fi
+ if [[ ${#insert[@]} -gt 0 ]] ; then
+ printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
+ fi
+}
+
+src_compile() {
+ local myconf
+
+ tc-export CC
+ append-lfs-flags
+ export DISTRO= #381311
+ use static && append-ldflags -static
+ use selinux && myconf=WITH_SELINUX=yes
+ emake -C src ${myconf} || die
+}
+
+src_install() {
+ emake -C src install ROOT="${D}"
+ dodoc README doc/*
+
+ insinto /etc
+ doins "${WORKDIR}"/inittab
+
+ doinitd "${FILESDIR}"/{reboot,shutdown}.sh
+}
+
+pkg_postinst() {
+ # Reload init to fix unmounting problems of / on next reboot.
+ # This is really needed, as without the new version of init cause init
+ # not to quit properly on reboot, and causes a fsck of / on next reboot.
+ if [[ ${ROOT} == / ]] ; then
+ # Do not return an error if this fails
+ /sbin/telinit U &>/dev/null
+ fi
+
+ elog "The mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to sys-apps/util-linux."
+}
diff --git a/sys-apps/sysvinit/sysvinit-2.88-r6.ebuild b/sys-apps/sysvinit/sysvinit-2.88-r6.ebuild
new file mode 100644
index 000000000000..8f02b5554fbd
--- /dev/null
+++ b/sys-apps/sysvinit/sysvinit-2.88-r6.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="/sbin/init - parent of all processes"
+HOMEPAGE="http://savannah.nongnu.org/projects/sysvinit"
+SRC_URI="mirror://nongnu/${PN}/${P}dsf.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="selinux ibm static kernel_FreeBSD"
+
+RDEPEND="
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ sec-policy/selinux-shutdown
+ )"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+S=${WORKDIR}/${P}dsf
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.86-kexec.patch #80220
+ epatch "${FILESDIR}"/${PN}-2.86-shutdown-single.patch #158615
+ epatch "${FILESDIR}"/${P}-makefile.patch #319197
+ epatch "${FILESDIR}"/${P}-selinux.patch #326697
+ epatch "${FILESDIR}"/${P}-shutdown-h.patch #449354
+ sed -i '/^CPPFLAGS =$/d' src/Makefile || die
+
+ # mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux
+ sed -i -r \
+ -e '/^(USR)?S?BIN/s:\<(mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \
+ -e '/^MAN[18]/s:\<(mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \
+ src/Makefile || die
+
+ # pidof has moved to >=procps-3.3.9
+ sed -i -r \
+ -e '/\/bin\/pidof/d' \
+ -e '/^MAN8/s:\<pidof.8\>::g' \
+ src/Makefile || die
+
+ # Mung inittab for specific architectures
+ cd "${WORKDIR}"
+ cp "${FILESDIR}"/inittab-2.87 inittab || die "cp inittab"
+ local insert=()
+ use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
+ use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
+ use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
+ use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
+ use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
+ if use ibm ; then
+ insert+=(
+ '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
+ '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
+ )
+ fi
+ (use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab
+ if use kernel_FreeBSD ; then
+ sed -i \
+ -e 's/linux/cons25/g' \
+ -e 's/ttyS0/cuaa0/g' \
+ -e 's/ttyS1/cuaa1/g' \
+ inittab #121786
+ fi
+ if use x86 || use amd64 ; then
+ sed -i \
+ -e '/ttyS[01]/s:9600:115200:' \
+ inittab
+ fi
+ if [[ ${#insert[@]} -gt 0 ]] ; then
+ printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
+ fi
+}
+
+src_compile() {
+ local myconf
+
+ tc-export CC
+ append-lfs-flags
+ export DISTRO= #381311
+ use static && append-ldflags -static
+ use selinux && myconf=WITH_SELINUX=yes
+ emake -C src ${myconf} || die
+}
+
+src_install() {
+ emake -C src install ROOT="${D}"
+ dodoc README doc/*
+
+ insinto /etc
+ doins "${WORKDIR}"/inittab
+
+ doinitd "${FILESDIR}"/{reboot,shutdown}.sh
+}
+
+pkg_postinst() {
+ # Reload init to fix unmounting problems of / on next reboot.
+ # This is really needed, as without the new version of init cause init
+ # not to quit properly on reboot, and causes a fsck of / on next reboot.
+ if [[ ${ROOT} == / ]] ; then
+ # Do not return an error if this fails
+ /sbin/telinit U &>/dev/null
+ fi
+
+ elog "The mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to sys-apps/util-linux."
+ elog "The pidof tool has been moved to sys-process/procps."
+}
diff --git a/sys-apps/sysvinit/sysvinit-2.88-r7.ebuild b/sys-apps/sysvinit/sysvinit-2.88-r7.ebuild
new file mode 100644
index 000000000000..78340f7edb45
--- /dev/null
+++ b/sys-apps/sysvinit/sysvinit-2.88-r7.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="/sbin/init - parent of all processes"
+HOMEPAGE="http://savannah.nongnu.org/projects/sysvinit"
+SRC_URI="mirror://nongnu/${PN}/${P}dsf.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="selinux ibm static kernel_FreeBSD"
+
+CDEPEND="
+ selinux? (
+ >=sys-libs/libselinux-1.28
+ )"
+DEPEND="${CDEPEND}
+ virtual/os-headers"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-shutdown )
+"
+
+S=${WORKDIR}/${P}dsf
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.86-kexec.patch #80220
+ epatch "${FILESDIR}"/${PN}-2.86-shutdown-single.patch #158615
+ epatch "${FILESDIR}"/${P}-makefile.patch #319197
+ epatch "${FILESDIR}"/${P}-selinux.patch #326697
+ epatch "${FILESDIR}"/${P}-shutdown-h.patch #449354
+ sed -i '/^CPPFLAGS =$/d' src/Makefile || die
+
+ # last/lastb/mesg/mountpoint/sulogin/utmpdump/wall have moved to util-linux
+ sed -i -r \
+ -e '/^(USR)?S?BIN/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)\>::g' \
+ -e '/^MAN[18]/s:\<(last|lastb|mesg|mountpoint|sulogin|utmpdump|wall)[.][18]\>::g' \
+ src/Makefile || die
+
+ # pidof has moved to >=procps-3.3.9
+ sed -i -r \
+ -e '/\/bin\/pidof/d' \
+ -e '/^MAN8/s:\<pidof.8\>::g' \
+ src/Makefile || die
+
+ # Mung inittab for specific architectures
+ cd "${WORKDIR}"
+ cp "${FILESDIR}"/inittab-2.87 inittab || die "cp inittab"
+ local insert=()
+ use ppc && insert=( '#psc0:12345:respawn:/sbin/agetty 115200 ttyPSC0 linux' )
+ use arm && insert=( '#f0:12345:respawn:/sbin/agetty 9600 ttyFB0 vt100' )
+ use arm64 && insert=( 'f0:12345:respawn:/sbin/agetty 9600 ttyAMA0 vt100' )
+ use hppa && insert=( 'b0:12345:respawn:/sbin/agetty 9600 ttyB0 vt100' )
+ use s390 && insert=( 's0:12345:respawn:/sbin/agetty 38400 console dumb' )
+ if use ibm ; then
+ insert+=(
+ '#hvc0:2345:respawn:/sbin/agetty -L 9600 hvc0'
+ '#hvsi:2345:respawn:/sbin/agetty -L 19200 hvsi0'
+ )
+ fi
+ (use arm || use mips || use sh || use sparc) && sed -i '/ttyS0/s:#::' inittab
+ if use kernel_FreeBSD ; then
+ sed -i \
+ -e 's/linux/cons25/g' \
+ -e 's/ttyS0/cuaa0/g' \
+ -e 's/ttyS1/cuaa1/g' \
+ inittab #121786
+ fi
+ if use x86 || use amd64 ; then
+ sed -i \
+ -e '/ttyS[01]/s:9600:115200:' \
+ inittab
+ fi
+ if [[ ${#insert[@]} -gt 0 ]] ; then
+ printf '%s\n' '' '# Architecture specific features' "${insert[@]}" >> inittab
+ fi
+}
+
+src_compile() {
+ local myconf
+
+ tc-export CC
+ append-lfs-flags
+ export DISTRO= #381311
+ use static && append-ldflags -static
+ use selinux && myconf=WITH_SELINUX=yes
+ emake -C src ${myconf} || die
+}
+
+src_install() {
+ emake -C src install ROOT="${D}"
+ dodoc README doc/*
+
+ insinto /etc
+ doins "${WORKDIR}"/inittab
+
+ # dead symlink
+ rm -f "${D}"/usr/bin/lastb
+
+ doinitd "${FILESDIR}"/{reboot,shutdown}.sh
+}
+
+pkg_postinst() {
+ # Reload init to fix unmounting problems of / on next reboot.
+ # This is really needed, as without the new version of init cause init
+ # not to quit properly on reboot, and causes a fsck of / on next reboot.
+ if [[ ${ROOT} == / ]] ; then
+ # Do not return an error if this fails
+ /sbin/telinit U &>/dev/null
+ fi
+
+ elog "The last/lastb/mesg/mountpoint/sulogin/utmpdump/wall tools have been moved to"
+ elog "sys-apps/util-linux. The pidof tool has been moved to sys-process/procps."
+}
diff --git a/sys-apps/tcp-wrappers/Manifest b/sys-apps/tcp-wrappers/Manifest
new file mode 100644
index 000000000000..9e1a95c03de4
--- /dev/null
+++ b/sys-apps/tcp-wrappers/Manifest
@@ -0,0 +1,2 @@
+DIST tcp-wrappers_7.6.q-22.debian.tar.gz 41730 SHA256 0ff28337c5effe4f91e7ea43ddd65fc629c06922326f5ef2804f70943be64fb3 SHA512 cee45f265c34ec1c4e9e81d54be636dcd9702964f9cf5bb076f72d6772d2dbc638d2ef366560b51c24a216724807826bb3b7bf9d5d0f5c0923b71de7d0b002a8 WHIRLPOOL 4a22c083d3bfe18af020ea48663ab3eb5a77d613665bbeb935daffcce64641d66f5c32a88ef4e4dbf8b4edfe9d71bfc4e35601451d065c10806ea726430d2aa8
+DIST tcp_wrappers_7.6.tar.gz 99438 SHA256 9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d SHA512 2d9d003791f8d00912a36ae00579e2b8dd7ad8a7bf8eae259659bcaf5365b150540ff6c93c91765872c76041579b7a02b6e3c64528fb7f8235680399ba1d9dac WHIRLPOOL e04861d03a49dd6d6d5cd9eba86732a40e79deff39d981a5e883bcfae4979c6e1c2a388eabd84691927b159e606a5649073473a717cb62c12cbd8546d75635bf
diff --git a/sys-apps/tcp-wrappers/files/hosts.allow.example b/sys-apps/tcp-wrappers/files/hosts.allow.example
new file mode 100644
index 000000000000..c473eb95155e
--- /dev/null
+++ b/sys-apps/tcp-wrappers/files/hosts.allow.example
@@ -0,0 +1,17 @@
+# For more information, please see the hosts.allow(5) manpage
+
+# Rule format:
+# daemon : client list
+# The value for 'daemon' is determined by the name of the binary.
+# OpenSSH runs as 'sshd' so you would use 'sshd' for 'daemon'.
+# Client list can be a list of ip's or hostnames.
+
+# Allow only sshd connections from ips matching 192.168.0.*
+#sshd: 192.168.0.
+
+# Only allow sendmail connections from the localhost
+#sendmail: localhost
+
+# Allow everyone from foobar.edu to access everything except for
+# the terminalserver
+#ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
diff --git a/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch
new file mode 100644
index 000000000000..328a4a102618
--- /dev/null
+++ b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch
@@ -0,0 +1,295 @@
+--- a/options.c
++++ b/options.c
+@@ -34,6 +34,8 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- a/safe_finger.c
++++ b/safe_finger.c
+@@ -20,6 +20,11 @@
+
+ /* System libraries */
+
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <sys/wait.h>
++#include <grp.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <signal.h>
+@@ -27,7 +31,7 @@
+ #include <ctype.h>
+ #include <pwd.h>
+
+-extern void exit();
++int pipe_stdin(char **argv);
+
+ /* Local stuff */
+
+--- a/scaffold.c
++++ b/scaffold.c
+@@ -10,6 +10,7 @@
+
+ /* System libraries. */
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -27,7 +27,4 @@
+ #endif
+
+-#ifndef INET6
+-extern char *malloc();
+-#endif
+
+ /* Application-specific. */
+--- a/shell_cmd.c
++++ b/shell_cmd.c
+@@ -14,6 +14,10 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
++#include <fcntl.h>
++#include <sys/wait.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <signal.h>
+@@ -25,8 +25,6 @@
+ #include <syslog.h>
+ #include <string.h>
+
+-extern void exit();
+-
+ /* Local stuff. */
+
+ #include "tcpd.h"
+--- a/tcpdchk.c
++++ b/tcpdchk.c
+@@ -20,6 +20,8 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #ifdef INET6
+@@ -35,10 +36,7 @@
+ #include <netdb.h>
+ #include <string.h>
+
+-extern int errno;
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
++int cidr_mask_addr(char *str);
+
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+--- a/clean_exit.c
++++ b/clean_exit.c
+@@ -13,8 +13,8 @@
+ #endif
+
+ #include <stdio.h>
+-
+-extern void exit();
++#include <unistd.h>
++#include <stdlib.h>
+
+ #include "tcpd.h"
+
+--- a/hosts_access.c
++++ b/hosts_access.c
+@@ -23,6 +23,7 @@
+
+ /* System libraries. */
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #ifdef INT32_T
+ typedef uint32_t u_int32_t;
+@@ -43,8 +44,8 @@
+ #include <netdb.h>
+ #endif
+
+-extern char *fgets();
+-extern int errno;
++static int match_pattern_ylo(const char *s, const char *pattern);
++int cidr_mask_addr(char *str);
+
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+--- a/inetcf.c
++++ b/inetcf.c
+@@ -9,15 +9,14 @@
+ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
+ #endif
+
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+
+-extern int errno;
+-extern void exit();
+-
++#include "scaffold.h"
+ #include "tcpd.h"
+ #include "inetcf.h"
+
+--- a/percent_x.c
++++ b/percent_x.c
+@@ -16,12 +16,12 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+
+-extern void exit();
+-
+ /* Local stuff. */
+
+ #include "tcpd.h"
+--- a/rfc931.c
++++ b/rfc931.c
+@@ -15,6 +15,7 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <sys/types.h>
+--- a/tcpd.c
++++ b/tcpd.c
+@@ -16,6 +16,7 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+@@ -39,6 +39,8 @@
+ #include "patchlevel.h"
+ #include "tcpd.h"
+
++void fix_options(struct request_info *request);
++
+ int allow_severity = SEVERITY; /* run-time adjustable */
+ int deny_severity = LOG_WARNING; /* ditto */
+
+--- a/tcpdmatch.c
++++ b/tcpdmatch.c
+@@ -19,6 +19,8 @@
+
+ /* System libraries. */
+
++#include <unistd.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
+@@ -30,9 +32,6 @@
+ #include <setjmp.h>
+ #include <string.h>
+
+-extern void exit();
+-extern int optind;
+-extern char *optarg;
+
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+--- a/update.c
++++ b/update.c
+@@ -19,6 +19,7 @@
+
+ /* System libraries */
+
++#include <unistd.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+--- a/misc.c
++++ b/misc.c
+@@ -14,11 +14,10 @@
+ #include <arpa/inet.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+
+ #include "tcpd.h"
+
+-extern char *fgets();
+-
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -32,6 +32,7 @@
+
+ /* fix_options - get rid of IP-level socket options */
+
++void
+ fix_options(request)
+ struct request_info *request;
+ {
+@@ -38,11 +38,8 @@
+ #ifdef IP_OPTIONS
+ unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+ char lbuf[BUFFER_SIZE], *lp;
+-#ifdef __GLIBC__
+- size_t optsize = sizeof(optbuf), ipproto;
+-#else
+- int optsize = sizeof(optbuf), ipproto;
+-#endif
++ socklen_t optsize = sizeof(optbuf);
++ int ipproto;
+ struct protoent *ip;
+ int fd = request->fd;
+ unsigned int opt;
+--- a/socket.c
++++ b/socket.c
+@@ -95,11 +95,7 @@
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
+ #endif
+-#ifdef __GLIBC__
+- size_t len;
+-#else
+- int len;
+-#endif
++ socklen_t len;
+ char buf[BUFSIZ];
+ int fd = request->fd;
+
+@@ -430,11 +426,7 @@
+ #else
+ struct sockaddr_in sin;
+ #endif
+-#ifdef __GLIBC__
+- size_t size = sizeof(sin);
+-#else
+- int size = sizeof(sin);
+-#endif
++ socklen_t size;
+
+ /*
+ * Eat up the not-yet received datagram. Some systems insist on a
diff --git a/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch
new file mode 100644
index 000000000000..4a6847621c57
--- /dev/null
+++ b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch
@@ -0,0 +1,35 @@
+--- tcp_wrappers_7.6/tcpd.c.bug11881
++++ tcp_wrappers_7.6/tcpd.c
+@@ -60,10 +60,10 @@
+ */
+
+ if (argv[0][0] == '/') {
+- strcpy(path, argv[0]);
++ strncpy(path, argv[0], sizeof(path));
+ argv[0] = strrchr(argv[0], '/') + 1;
+ } else {
+- sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
++ snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
+ }
+
+ /*
+--- tcp_wrappers_7.6/eval.c.bug11881
++++ tcp_wrappers_7.6/eval.c
+@@ -111,7 +111,7 @@
+ return (hostinfo);
+ #endif
+ if (STR_NE(eval_user(request), unknown)) {
+- sprintf(both, "%s@%s", request->user, hostinfo);
++ snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo);
+ return (both);
+ } else {
+ return (hostinfo);
+@@ -128,7 +128,7 @@
+ char *daemon = eval_daemon(request);
+
+ if (STR_NE(host, unknown)) {
+- sprintf(both, "%s@%s", daemon, host);
++ snprintf(both, sizeof(both), "%s@%s", daemon, host);
+ return (both);
+ } else {
+ return (daemon);
diff --git a/sys-apps/tcp-wrappers/metadata.xml b/sys-apps/tcp-wrappers/metadata.xml
new file mode 100644
index 000000000000..0f754bf9a300
--- /dev/null
+++ b/sys-apps/tcp-wrappers/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>
+<use>
+ <flag name='netgroups'>
+ Support matching NIS (host) netgroup names via the @netgroup syntax
+ (if you don't know what this means, you most likely do not need it)
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r1.ebuild b/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r1.ebuild
new file mode 100644
index 000000000000..1496b094bcb1
--- /dev/null
+++ b/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs versionator flag-o-matic multilib-minimal
+
+MY_PV=$(get_version_component_range 1-2)
+DEB_PV=$(get_version_component_range 3)
+MY_P="${PN//-/_}_${MY_PV}"
+DESCRIPTION="TCP Wrappers"
+HOMEPAGE="ftp://ftp.porcupine.org/pub/security/index.html"
+SRC_URI="ftp://ftp.porcupine.org/pub/security/${MY_P}.tar.gz
+ mirror://debian/pool/main/t/${PN}/${PN}_${MY_PV}.q-${DEB_PV}.debian.tar.gz"
+
+LICENSE="tcp_wrappers_license"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="ipv6 netgroups static-libs"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ EPATCH_OPTS="-p1" \
+ epatch $(sed -e 's:^:../debian/patches/:' ../debian/patches/series)
+ epatch "${FILESDIR}"/${PN}-7.6-headers.patch
+ epatch "${FILESDIR}"/${PN}-7.6-redhat-bug11881.patch
+
+ multilib_copy_sources
+}
+
+temake() {
+ local mycppflags="-DHAVE_WEAKSYMS -DHAVE_STRERROR -DSYS_ERRLIST_DEFINED"
+ use ipv6 && mycppflags+=" -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len"
+ emake \
+ REAL_DAEMON_DIR="${EPREFIX}"/usr/sbin \
+ TLI= VSYSLOG= PARANOID= BUGS= \
+ AUTH="-DALWAYS_RFC931" \
+ AUX_OBJ="weak_symbols.o" \
+ DOT="-DAPPEND_DOT" \
+ HOSTNAME="-DALWAYS_HOSTNAME" \
+ NETGROUP=$(usex netgroups -DNETGROUPS "") \
+ STYLE="-DPROCESS_OPTIONS" \
+ LIBS=$(usex netgroups -lnsl "") \
+ LIB=$(usex static-libs libwrap.a "") \
+ AR="$(tc-getAR)" ARFLAGS=rc \
+ CC="$(tc-getCC)" \
+ RANLIB="$(tc-getRANLIB)" \
+ COPTS="${CFLAGS} ${CPPFLAGS} ${mycppflags}" \
+ LDFLAGS="${LDFLAGS}" \
+ "$@" || die
+}
+
+multilib_src_configure() {
+ tc-export AR RANLIB
+ temake config-check
+}
+
+multilib_src_compile() {
+ temake all
+}
+
+multilib_src_install() {
+ into /usr
+ use static-libs && dolib.a libwrap.a
+ dolib.so shared/libwrap.so*
+
+ insinto /usr/include
+ doins tcpd.h
+
+ if multilib_is_native_abi; then
+ gen_usr_ldscript -a wrap
+ dosbin tcpd tcpdchk tcpdmatch safe_finger try-from
+ fi
+}
+
+multilib_src_install_all() {
+ doman *.[358]
+ dosym hosts_access.5 /usr/share/man/man5/hosts.allow.5
+ dosym hosts_access.5 /usr/share/man/man5/hosts.deny.5
+
+ insinto /etc
+ newins "${FILESDIR}"/hosts.allow.example hosts.allow
+
+ dodoc BLURB CHANGES DISCLAIMER README*
+}
+
+pkg_preinst() {
+ # don't clobber people with our default example config
+ [[ -e ${EROOT}/etc/hosts.allow ]] && cp -pP "${EROOT}"/etc/hosts.allow "${ED}"/etc/hosts.allow
+}
diff --git a/sys-apps/texinfo/Manifest b/sys-apps/texinfo/Manifest
new file mode 100644
index 000000000000..c78b9d966ef7
--- /dev/null
+++ b/sys-apps/texinfo/Manifest
@@ -0,0 +1,3 @@
+DIST texinfo-4.13.tar.lzma 1563777 SHA256 6d28b0ceae866e3536142fc552e7a3bc9f84c8303119c25731b2478eef64c9e5 SHA512 bded399ed5fcf97dfa72d9486df91ecfc501301d83929b09b230aee2b8ad6994b7d7b5965b04d43de729cee30575b2334cf75879ad0a61c4b781ccc16d6c12db WHIRLPOOL 6ef9d5e47cae7c6a94272e35bafe0716e617691b6b549a59ef8f95244f1b9a94e9adb79db38cf8e23166a43e84725e3eb01c971c8894bc4201aa743a44170c35
+DIST texinfo-5.2.tar.xz 3812944 SHA256 5471ef683a64588a7cfef46ef2bdd3fbcbca89d847e10832612293f105e44eda SHA512 6f9c5142db3b155bd601149b5632807b3c20dcfa7006ce5f7e120e6fc4b2174a3f4671c18232c040ffd69ebfb5950be5c563ac5cc08b88d03eb5a9f1b0f96c04 WHIRLPOOL 609f0c2ac4deccf85f99cae3f681ce3892c7822988a84970171dec0f1224052861b3ac3fac97e666016bac4469b0e8446133c775a20f7201ff6dffa90fc84290
+DIST texinfo-6.0.tar.xz 4086712 SHA256 11ba4358696e8be3b3c7cfc88b89cf69525791aeabf0ee0a59ca58ebbd3471e4 SHA512 36f82288dfb7c2385630043faf75ccef5af625952d792c669c5eea673ae5b3474c148041bf1935f87ddeaae7114103731277e715d0d510c6fb41e0211ab12494 WHIRLPOOL 1d1facd5670321aca908407f65ff6a8769f3d7528c4535d77cf3fc6d948d766acc1e3f592e74554c427fca51a9e54048d54774586543d6316b664ac3c92d06c8
diff --git a/sys-apps/texinfo/files/texinfo-4.13-accentenc-test.patch b/sys-apps/texinfo/files/texinfo-4.13-accentenc-test.patch
new file mode 100644
index 000000000000..ad470faf0d47
--- /dev/null
+++ b/sys-apps/texinfo/files/texinfo-4.13-accentenc-test.patch
@@ -0,0 +1,17 @@
+Fails in UTF-8 locales with grep-2.6
+
+https://bugs.gentoo.org/322151
+https://savannah.gnu.org/bugs/index.php?31068
+
+--- a/makeinfo/tests/accentenc
++++ b/makeinfo/tests/accentenc
+@@ -1,7 +1,8 @@
+ #!/bin/sh
+ # Test encoded accent info output.
+
+-unset TEXINFO_OUTPUT
++unset TEXINFO_OUTPUT LANG LANGUAGE
++LC_ALL=POSIX; export LC_ALL
+ : ${srcdir=.}
+ input=`basename $0`.txi
+ output=`basename $0`.info
diff --git a/sys-apps/texinfo/files/texinfo-4.13-docbook.patch b/sys-apps/texinfo/files/texinfo-4.13-docbook.patch
new file mode 100644
index 000000000000..0622b94f987b
--- /dev/null
+++ b/sys-apps/texinfo/files/texinfo-4.13-docbook.patch
@@ -0,0 +1,66 @@
+--- texinfo-4.13.orig/makeinfo/cmds.c 2008-05-22 05:11:34.000000000 -0700
++++ texinfo-4.13/makeinfo/cmds.c 2012-05-23 18:31:57.108264307 -0700
+@@ -1560,7 +1560,7 @@ cm_setfilename (void)
+ char *filename;
+ get_rest_of_line (1, &filename);
+ /* warning ("`@%s %s' encountered and ignored", command, filename); */
+- if (xml)
++ if (xml && !docbook)
+ add_word_args ("<setfilename>%s</setfilename>", filename);
+ free (filename);
+ }
+--- texinfo-4.13.orig/makeinfo/node.c 2008-07-05 16:59:47.000000000 -0700
++++ texinfo-4.13/makeinfo/node.c 2012-05-23 17:02:46.517345024 -0700
+@@ -1233,10 +1233,12 @@ cm_anchor (int arg)
+ }
+ else if (xml || docbook)
+ {
++ char *id = xml_id(anchor);
+ xml_insert_element_with_attribute (ANCHOR, START,
+ docbook ? "id=\"%s\"" : "name=\"%s\"",
+- anchor);
++ id);
+ xml_insert_element (ANCHOR, END);
++ free(id);
+ }
+
+ /* Save it in the tag table. */
+--- texinfo-4.13.orig/makeinfo/xml.c 2008-02-12 17:00:55.000000000 -0800
++++ texinfo-4.13/makeinfo/xml.c 2012-05-23 17:20:13.698858895 -0700
+@@ -586,21 +586,27 @@ static int in_indexterm = 0;
+ char *
+ xml_id (char *id)
+ {
+- char *tem = xmalloc (strlen (id) + 1);
++ /* Get an extra space to accomodate adding an i-prefix. */
++ char *tem = xmalloc (strlen (id) + 2);
+ char *p = tem;
+- strcpy (tem, id);
++
++ /* First character cannot be a number, '-' or '.'. Just always add
++ an i if we're not starting with a alphanumeric character
++ already, to simplify the code.
++ */
++ if (!isalpha(*id))
++ {
++ *p++ = 'i';
++ }
++
++ strcpy (p, id);
++
+ while (*p)
+ {
+- if (strchr (":\" \t\f\r\n", *p))
++ if (!isalnum (*p) && !strchr (":_.-", *p))
+ *p = '-';
+ p++;
+ }
+- p = tem;
+-
+- /* First character cannot be a number. Clearly we should make this
+- dependent on the actual numeral found. */
+- if (strchr ("0123456789", *p))
+- *p = 'i';
+
+ return tem;
+ }
diff --git a/sys-apps/texinfo/files/texinfo-4.13-texi2dvi-regexp-range.patch b/sys-apps/texinfo/files/texinfo-4.13-texi2dvi-regexp-range.patch
new file mode 100644
index 000000000000..01b0746defa5
--- /dev/null
+++ b/sys-apps/texinfo/files/texinfo-4.13-texi2dvi-regexp-range.patch
@@ -0,0 +1,23 @@
+Fix texi2dvi problem with egrep in some locales.
+This patch is taken from the texinfo CVS repository, but stripped of
+keyword substitutions to make it apply to a wider range of source code
+revisions.
+
+Fix suggested by Martin von Gagern on 2010-03-29, committed by Karl Berry.
+
+References:
+http://bugs.gentoo.org/311885
+http://thread.gmane.org/gmane.comp.tex.texinfo.bugs/5023
+http://cvs.savannah.gnu.org/viewvc/texinfo/util/texi2dvi?root=texinfo&r1=1.157&r2=1.158
+
+--- util/texi2dvi 2010/02/09 18:37:08 1.157
++++ util/texi2dvi 2010/03/30 23:13:37 1.158
+@@ -1848,7 +1848,7 @@
+
+ # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex),
+ # prepend `./' in order to avoid that the tools take it as an option.
+- echo "$command_line_filename" | $EGREP '^(/|[A-z]:/)' >&6 \
++ echo "$command_line_filename" | $EGREP '^(/|[A-Za-z]:/)' >&6 \
+ || command_line_filename="./$command_line_filename"
+
+ # See if the file exists. If it doesn't we're in trouble since, even
diff --git a/sys-apps/texinfo/files/texinfo-4.13-tinfo.patch b/sys-apps/texinfo/files/texinfo-4.13-tinfo.patch
new file mode 100644
index 000000000000..10a557a303dd
--- /dev/null
+++ b/sys-apps/texinfo/files/texinfo-4.13-tinfo.patch
@@ -0,0 +1,24 @@
+http://bugs.gentoo.org/457556
+
+--- configure.ac
++++ configure.ac
+@@ -130,7 +130,7 @@
+ # rather ncurses. So we check for it.
+ TERMLIBS=
+ # Check for termlib before termcap because Solaris termcap needs libucb.
+-TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
++TERMLIB_VARIANTS="tinfo ncurses curses termlib termcap terminfo"
+ for termlib in ${TERMLIB_VARIANTS}; do
+ AC_CHECK_LIB(${termlib}, tgetent,
+ [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
+--- configure
++++ configure
+@@ -17477,7 +17477,7 @@
+ # rather ncurses. So we check for it.
+ TERMLIBS=
+ # Check for termlib before termcap because Solaris termcap needs libucb.
+-TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
++TERMLIB_VARIANTS="tinfo ncurses curses termlib termcap terminfo"
+ for termlib in ${TERMLIB_VARIANTS}; do
+ as_ac_Lib=`$as_echo "ac_cv_lib_${termlib}''_tgetent" | $as_tr_sh`
+ { $as_echo "$as_me:$LINENO: checking for tgetent in -l${termlib}" >&5
diff --git a/sys-apps/texinfo/files/texinfo-4.13-xz.patch b/sys-apps/texinfo/files/texinfo-4.13-xz.patch
new file mode 100644
index 000000000000..f5bb023be559
--- /dev/null
+++ b/sys-apps/texinfo/files/texinfo-4.13-xz.patch
@@ -0,0 +1,130 @@
+https://bugs.gentoo.org/269742
+
+From bfae00d02b5fb3a2ce34c09d2dbf0ca2f96b154f Mon Sep 17 00:00:00 2001
+From: Karl Berry <karl@gnu.org>
+Date: Sat, 14 Mar 2009 17:57:41 +0000
+Subject: [PATCH] support xz compression, http://tukaani.org/xz
+
+---
+ ChangeLog | 6 ++++++
+ NEWS | 4 ++++
+ doc/info-stnd.texi | 34 +++++++++++++++++-----------------
+ info/filesys.c | 1 +
+ install-info/install-info.c | 29 +++++++++++++++++++++++++----
+ 5 files changed, 53 insertions(+), 21 deletions(-)
+
+2009-03-14 Karl Berry <karl@gnu.org>
+
+ * info/filesys.c (compress_suffixes): add .xz/unxz.
+
+ * info/filesys.h (DEFAULT_INFOPATH): include PATH by default.
+
+diff --git a/doc/info-stnd.texi b/doc/info-stnd.texi
+index 2bd67f3..c730cff 100644
+--- a/doc/info-stnd.texi
++++ b/doc/info-stnd.texi
+@@ -202,21 +202,21 @@ directory.
+ @cindex Info files, compressed
+ In every directory Info tries, if @var{filename} is not found, Info
+ looks for it with a number of known extensions of Info files@footnote{
+-@file{.info}, @file{-info}, @file{/index}, and @file{.inf}.}. For every
+-known extension, Info looks for a compressed file, if a regular file
+-isn't found. Info supports files compressed with @code{gzip},
+-@code{bzip2}, @code{compress} and @code{yabba} programs; it calls
+-@code{gunzip}, @code{bunzip2}, @code{uncompress} and @code{unyabba},
+-accordingly, to decompress such files. Compressed Info files are
+-assumed to have @file{.z}, @file{.gz}, @file{.bz2}, @file{.Z}, or
+-@file{.Y} extensions, possibly in addition to one of the known Info
+-files extensions@footnote{The MS-DOS version allows for the Info
+-extension, such as @code{.inf}, and the short compressed file
+-extensions, such as @file{.z} and @file{.gz}, to be merged into a single
+-extension, since DOS doesn't allow more than a single dot in the
+-basename of a file. Thus, on MS-DOS, if Info looks for @file{bison},
+-file names like @file{bison.igz} and @file{bison.inz} will be found and
+-decompressed by @code{gunzip}.}.
++@file{.info}, @file{-info}, @file{/index}, and @file{.inf}.}. For
++every known extension, Info looks for a compressed file, if a regular
++file isn't found. Info supports files compressed with @code{gzip},
++@code{xz}, @code{bzip2}, @code{lzma}, @code{compress} and @code{yabba}
++programs, assumed to have @file{.z}, @file{.gz}, @file{.xz},
++@file{.bz2}, @file{.lzma}, @file{.Z}, or @file{.Y} extensions,
++possibly after one of the known Info files extensions.
++
++On MS-DOS, Info allows for the Info extension, such as @code{.inf},
++and the short compressed file extensions, such as @file{.z} and
++@file{.gz}, to be merged into a single extension, since DOS doesn't
++allow more than a single dot in the basename of a file. Thus, on
++MS-DOS, if Info looks for @file{bison}, file names like
++@file{bison.igz} and @file{bison.inz} will be found and decompressed
++by @code{gunzip}.
+
+ @item --help
+ @itemx -h
+diff --git a/info/filesys.c b/info/filesys.c
+index fdd18a8..5e795bc 100644
+--- a/info/filesys.c
++++ b/info/filesys.c
+@@ -55,6 +55,7 @@ static char *info_suffixes[] = {
+
+ static COMPRESSION_ALIST compress_suffixes[] = {
+ { ".gz", "gunzip" },
++ { ".xz", "unxz" },
+ { ".bz2", "bunzip2" },
+ { ".z", "gunzip" },
+ { ".lzma", "unlzma" },
+diff --git a/install-info/install-info.c b/install-info/install-info.c
+index 24669b3..0f18ca4 100644
+--- a/install-info/install-info.c
++++ b/install-info/install-info.c
+@@ -400,6 +400,11 @@ strip_info_suffix (char *fname)
+ len -= 3;
+ ret[len] = 0;
+ }
++ else if (len > 3 && FILENAME_CMP (ret + len - 3, ".xz") == 0)
++ {
++ len -= 3;
++ ret[len] = 0;
++ }
+ else if (len > 4 && FILENAME_CMP (ret + len - 4, ".bz2") == 0)
+ {
+ len -= 4;
+@@ -659,6 +664,12 @@ open_possibly_compressed_file (char *filename,
+ {
+ *opened_filename = concat (filename, ".gz", "");
+ f = fopen (*opened_filename, FOPEN_RBIN);
++ }
++ if (!f)
++ {
++ *opened_filename = concat (filename, ".xz", "");
++ f = fopen (*opened_filename, FOPEN_RBIN);
++ }
+ if (!f)
+ {
+ free (*opened_filename);
+@@ -702,7 +712,6 @@ open_possibly_compressed_file (char *filename,
+ else
+ pfatal_with_name (filename);
+ }
+- }
+
+ /* Read first few bytes of file rather than relying on the filename.
+ If the file is shorter than this it can't be usable anyway. */
+@@ -727,6 +736,15 @@ open_possibly_compressed_file (char *filename,
+ #else
+ *compression_program = "gzip";
+ #endif
++
++ else if (data[0] == '\xFD' && data[1] == '7' && data[2] == 'z'
++ && data[3] == 'X' && data[4] == 'Z' && data[5] == 0)
++#ifndef STRIP_DOT_EXE
++ *compression_program = "xz.exe";
++#else
++ *compression_program = "xz";
++#endif
++
+ else if (data[0] == 'B' && data[1] == 'Z' && data[2] == 'h')
+ #ifndef STRIP_DOT_EXE
+ *compression_program = "bzip2.exe";
+--
+1.7.4.rc2
+
diff --git a/sys-apps/texinfo/metadata.xml b/sys-apps/texinfo/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/texinfo/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-apps/texinfo/texinfo-4.13-r2.ebuild b/sys-apps/texinfo/texinfo-4.13-r2.ebuild
new file mode 100644
index 000000000000..719b8051f0b1
--- /dev/null
+++ b/sys-apps/texinfo/texinfo-4.13-r2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="The GNU info program and utilities"
+HOMEPAGE="http://www.gnu.org/software/texinfo/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.lzma"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+RDEPEND="!=app-text/tetex-2*
+ >=sys-libs/ncurses-5.2-r2
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-xz.patch #269742
+ touch doc/install-info.1 #354589
+ epatch "${FILESDIR}"/${P}-texi2dvi-regexp-range.patch #311885
+ epatch "${FILESDIR}"/${P}-accentenc-test.patch
+ # waiting to be sent upstream for my copyright assignment form to be
+ # ready - Flameeyes
+ epatch "${FILESDIR}"/${P}-docbook.patch
+ epatch "${FILESDIR}"/${P}-tinfo.patch #457556
+ # timestamps must be newer than configure.ac touched by ${P}-tinfo.patch
+ touch doc/{texi2dvi,texi2pdf,pdftexi2dvi}.1 #354589
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf $(use_enable nls)
+}
+
+src_compile() {
+ # Make cross-compiler safe (#196041)
+ if tc-is-cross-compiler ; then
+ emake -C tools/gnulib/lib || die
+ fi
+
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ dodoc AUTHORS ChangeLog INTRODUCTION NEWS README TODO
+ newdoc info/README README.info
+ newdoc makeinfo/README README.makeinfo
+}
diff --git a/sys-apps/texinfo/texinfo-5.2.ebuild b/sys-apps/texinfo/texinfo-5.2.ebuild
new file mode 100644
index 000000000000..d0944ce2464e
--- /dev/null
+++ b/sys-apps/texinfo/texinfo-5.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic
+
+DESCRIPTION="The GNU info program and utilities"
+HOMEPAGE="http://www.gnu.org/software/texinfo/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+RDEPEND="!=app-text/tetex-2*
+ >=sys-libs/ncurses-5.2-r2
+ dev-lang/perl
+ dev-perl/libintl-perl
+ dev-perl/Unicode-EastAsianWidth
+ dev-perl/Text-Unidecode
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --with-external-libintl-perl \
+ --with-external-Unicode-EastAsianWidth \
+ --with-external-Text-Unidecode \
+ $(use_enable nls)
+}
+
+src_install() {
+ default
+ newdoc info/README README.info
+}
diff --git a/sys-apps/texinfo/texinfo-6.0.ebuild b/sys-apps/texinfo/texinfo-6.0.ebuild
new file mode 100644
index 000000000000..0434fa4ae80f
--- /dev/null
+++ b/sys-apps/texinfo/texinfo-6.0.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic
+
+DESCRIPTION="The GNU info program and utilities"
+HOMEPAGE="http://www.gnu.org/software/texinfo/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+RDEPEND="!=app-text/tetex-2*
+ >=sys-libs/ncurses-5.2-r2
+ dev-lang/perl
+ dev-perl/libintl-perl
+ dev-perl/Unicode-EastAsianWidth
+ dev-perl/Text-Unidecode
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )"
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --with-external-libintl-perl \
+ --with-external-Unicode-EastAsianWidth \
+ --with-external-Text-Unidecode \
+ $(use_enable nls)
+}
+
+src_install() {
+ default
+ newdoc info/README README.info
+}
diff --git a/sys-apps/the_silver_searcher/Manifest b/sys-apps/the_silver_searcher/Manifest
new file mode 100644
index 000000000000..fa7b65f182e2
--- /dev/null
+++ b/sys-apps/the_silver_searcher/Manifest
@@ -0,0 +1 @@
+DIST the_silver_searcher-0.29.1.tar.gz 65821 SHA256 779eb781751fd3dc07bff3b88f4475ed78eea3fa7b21139d8230d17c31db072a SHA512 648efe0cd52092ee5d036c7d024c7e2d1ce728c5f80ea9447356f2e31cdbbe96fee67b968a9d66c2b3739f1fc8f6d639452019c6fdeb5996e0d74e9549729fe5 WHIRLPOOL 0dd3934daaf42e1414363ae2b4409bb2187a9c6bbfb76c6cc9337c07129c9d744fe71a3c1d9670531ac92fe9ae4793a5bfad35185b6e697ccfc1d571f1055985
diff --git a/sys-apps/the_silver_searcher/metadata.xml b/sys-apps/the_silver_searcher/metadata.xml
new file mode 100644
index 000000000000..9b7b6dec471a
--- /dev/null
+++ b/sys-apps/the_silver_searcher/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>jdhore@gentoo.org</email>
+ <name>Jeff Horelick</name>
+ </maintainer>
+ <maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">ggreer/the_silver_searcher</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/the_silver_searcher/the_silver_searcher-0.29.1.ebuild b/sys-apps/the_silver_searcher/the_silver_searcher-0.29.1.ebuild
new file mode 100644
index 000000000000..91c674e760b8
--- /dev/null
+++ b/sys-apps/the_silver_searcher/the_silver_searcher-0.29.1.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 autotools bash-completion-r1
+
+DESCRIPTION="A code-searching tool similar to ack, but faster"
+HOMEPAGE="http://github.com/ggreer/the_silver_searcher"
+SRC_URI="https://github.com/ggreer/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~hppa ~mips ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="lzma zlib"
+
+RDEPEND="dev-libs/libpcre
+ lzma? ( app-arch/xz-utils )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="README.md"
+
+src_prepare() {
+ sed -i '/^dist_bashcomp/d' Makefile.am || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable lzma) \
+ $(use_enable zlib)
+}
+
+src_install() {
+ default
+ newbashcomp ag.bashcomp.sh ag
+}
diff --git a/sys-apps/timer_entropyd/Manifest b/sys-apps/timer_entropyd/Manifest
new file mode 100644
index 000000000000..c949a3a62587
--- /dev/null
+++ b/sys-apps/timer_entropyd/Manifest
@@ -0,0 +1 @@
+DIST timer_entropyd-0.2.tgz 8323 SHA256 0cf2b976b78c1b1169a4bec5a6fc71d8b118de927bc05002686376a61f73989a SHA512 789f19c2652781593b9ce91c584eab4ef9210bb47f1afb6186311416a67c84235ed1a163ffdc017b6d50ff706bf7ff6a84013b4b31fe6c09eabe95a484805898 WHIRLPOOL 8fa8233d8a867f7f5290ba1fbd39a2ed80756cfe0948fcc5038c256b4f62b39bd1592a639e6c13ce11c481a9a85288dd30568fd082c36bd09f6ad5986c421d15
diff --git a/sys-apps/timer_entropyd/files/timer_entropyd-0.1-syslog.patch b/sys-apps/timer_entropyd/files/timer_entropyd-0.1-syslog.patch
new file mode 100644
index 000000000000..91be4a2ffdf0
--- /dev/null
+++ b/sys-apps/timer_entropyd/files/timer_entropyd-0.1-syslog.patch
@@ -0,0 +1,28 @@
+From 51dc916e4466d0033728dd14f318203f995b3ad0 Mon Sep 17 00:00:00 2001
+From: Jeremy Olexa <darkside@gentoo.org>
+Date: Tue, 5 Apr 2011 14:19:49 +0000
+Subject: [PATCH] Move syslog call to ifdef _DEBUG
+
+In order to prevent logfile spamming (once every 7 seconds), move the
+syslog call only be used if compiled with -D_DEBUG
+---
+ main.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/main.c b/main.c
+index 13b95dd..781b321 100644
+--- a/main.c
++++ b/main.c
+@@ -66,8 +66,8 @@ int main(int argc, char *argv[])
+
+ kernel_rng_add_entropy(bytes, sizeof(bytes), cur_n_bits);
+
+- syslog(LOG_DEBUG, "added %d bits of entropy data", cur_n_bits);
+ #ifdef _DEBUG
++ syslog(LOG_DEBUG, "added %d bits of entropy data", cur_n_bits);
+ printf("added %d bits of entropy data\n", cur_n_bits);
+ #endif
+
+--
+1.7.3.4
+
diff --git a/sys-apps/timer_entropyd/files/timer_entropyd.initd.1 b/sys-apps/timer_entropyd/files/timer_entropyd.initd.1
new file mode 100644
index 000000000000..865310967043
--- /dev/null
+++ b/sys-apps/timer_entropyd/files/timer_entropyd.initd.1
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+command=/usr/libexec/timer_entropyd
+
+depend() {
+ need localmount
+ before net
+ use logger
+
+ provide entropy
+}
diff --git a/sys-apps/timer_entropyd/metadata.xml b/sys-apps/timer_entropyd/metadata.xml
new file mode 100644
index 000000000000..8470912434a8
--- /dev/null
+++ b/sys-apps/timer_entropyd/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>proxy-maintainers</herd>
+ <maintainer>
+ <email>pavel.stratil-jun@fenix.cz</email>
+ <description>Proxied co-maintainer, assign bugs to him</description>
+ </maintainer>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='debug'>Enable printf debugging and logging to the syslog at DEBUG level</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/timer_entropyd/timer_entropyd-0.2.ebuild b/sys-apps/timer_entropyd/timer_entropyd-0.2.ebuild
new file mode 100644
index 000000000000..46fd74996360
--- /dev/null
+++ b/sys-apps/timer_entropyd/timer_entropyd-0.2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="A timer-based entropy generator"
+HOMEPAGE="http://www.vanheusden.com/te/"
+SRC_URI="http://www.vanheusden.com/te/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="debug selinux"
+
+RDEPEND="selinux? ( sec-policy/selinux-entropyd )"
+
+src_prepare() {
+ sed -i -e 's:-O2::' Makefile || die
+ epatch "${FILESDIR}"/${PN}-0.1-syslog.patch
+}
+
+src_compile() {
+ use debug && append-cppflags -D_DEBUG
+
+ tc-export CC
+ emake DEBUG= || die
+}
+
+src_install() {
+ exeinto /usr/libexec
+ doexe ${PN}
+ dodoc Changes readme.txt
+ newinitd "${FILESDIR}/timer_entropyd.initd.1" ${PN} || die
+}
+
+pkg_postinst() {
+ elog "To start ${PN} at boot do rc-update add ${PN} default"
+ elog "To start ${PN} now do /etc/init.d/${PN} start"
+ elog "To check the amount of entropy, cat /proc/sys/kernel/random/entropy_avail"
+}
diff --git a/sys-apps/tomoyo-tools/Manifest b/sys-apps/tomoyo-tools/Manifest
new file mode 100644
index 000000000000..ef34726748c4
--- /dev/null
+++ b/sys-apps/tomoyo-tools/Manifest
@@ -0,0 +1 @@
+DIST tomoyo-tools-2.5.0-20130214.tar.gz 210892 SHA256 78344506be3108804c76108e2eb193d4eb556983649c8f11f76ad69eda69b1ee SHA512 1ba6f6b3a3d4e644e6ee742beb64b09c6d527f130b1fe6d09a2e19760ced26f540ac8cc1e6f83fddacc3ef8844c3c23425191e4e0098c8b72b5ba3086adc9dc4 WHIRLPOOL edb912dbcfc784d2845cf8c9f81499e6089e67e98e1478b7dd096406cf2d1abfd314f15caf4248fc388fc667f14fa25f6d694652d156a45a6a9d337fc50fed80
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-gentoo.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-gentoo.patch
new file mode 100644
index 000000000000..33c73bc10dc8
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-gentoo.patch
@@ -0,0 +1,14 @@
+diff -Naur tomoyo-tools.orig/tomoyo_init_policy.c tomoyo-tools/tomoyo_init_policy.c
+--- tomoyo-tools.orig/tomoyo_init_policy.c 2009-07-27 15:00:00.000000000 +0900
++++ tomoyo-tools/tomoyo_init_policy.c 2009-07-29 01:56:32.000000000 +0900
+@@ -1238,6 +1259,10 @@
+ echo("file_pattern /etc/gshadow.\\$");
+ echo("file_pattern /etc/passwd.\\$");
+ echo("file_pattern /etc/shadow.\\$");
++ echo("file_pattern /etc/group.edit");
++ echo("file_pattern /etc/gshadow.edit");
++ echo("file_pattern /etc/passwd.edit");
++ echo("file_pattern /etc/shadow.edit");
+ echo("file_pattern /var/cache/logwatch/logwatch.\\*/");
+ echo("file_pattern /var/cache/logwatch/logwatch.\\*/\\*");
+ echo("file_pattern /var/tmp/sqlite_\\*");
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-ldflags.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-ldflags.patch
new file mode 100644
index 000000000000..d0ea10af002a
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.2.0_p20120414-ldflags.patch
@@ -0,0 +1,17 @@
+diff --git a/Makefile b/Makefile
+index d84a02b..e1cb36b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -39,10 +39,10 @@ CFLAGS=-Wall -O2 -pipe -fomit-frame-pointer -march=core2 -mcx16 -msahf -maes -mp
+ sleep 10
+
+ tomoyotools: tomoyotools.src/*.c tomoyotools.src/*.h /usr/include/curses.h
+- $(CC) $(CFLAGS) -o tomoyotools tomoyotools.src/*.c -lncurses -DCOLOR_ON
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyotools tomoyotools.src/*.c -lncurses -DCOLOR_ON
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f $(MAIN_FILES) $(MISC_FILES)
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20110929-gentoo.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20110929-gentoo.patch
new file mode 100644
index 000000000000..7e005702e6a0
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20110929-gentoo.patch
@@ -0,0 +1,16 @@
+This is tomoyo-tools-2.2.0_p20090727-gentoo.patch blindly ported to 2.3.0.
+Every other change is included by now.
+
+--- usr_lib_tomoyo/init_policy.c 2011-01-17 22:50:05.241899861 +0100
++++ usr_lib_tomoyo/init_policy.c 2011-01-17 22:51:00.172806713 +0100
+@@ -1106,6 +1106,10 @@
+ echo("file_pattern /etc/gshadow.\\$");
+ echo("file_pattern /etc/passwd.\\$");
+ echo("file_pattern /etc/shadow.\\$");
++ echo("file_pattern /etc/group.edit");
++ echo("file_pattern /etc/gshadow.edit");
++ echo("file_pattern /etc/passwd.edit");
++ echo("file_pattern /etc/shadow.edit");
+ echo("file_pattern /var/cache/logwatch/logwatch.\\*/");
+ echo("file_pattern /var/cache/logwatch/logwatch.\\*/\\*");
+ echo("file_pattern /var/tmp/sqlite_\\*");
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20120414-flags-parallel.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20120414-flags-parallel.patch
new file mode 100644
index 000000000000..54c7963a9a60
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.3.0_p20120414-flags-parallel.patch
@@ -0,0 +1,82 @@
+--- a/Include.make
++++ b/Include.make
+@@ -1,4 +1,4 @@
+ USRSBINDIR := /usr/sbin
+ USRLIBDIR := /usr/lib
+ MAN8 := /usr/share/man/man8
+-CFLAGS := -Wall -O2 ${shell $(CC) -Wno-pointer-sign -S -o /dev/null -x c - < /dev/null > /dev/null 2>&1 && echo "-Wno-pointer-sign"}
++CFLAGS := -Wall ${shell $(CC) -Wno-pointer-sign -S -o /dev/null -x c - < /dev/null > /dev/null 2>&1 && echo "-Wno-pointer-sign"}
+--- a/kernel_test/Makefile
++++ b/kernel_test/Makefile
+@@ -3,20 +3,18 @@ ALL_FILES = tomoyo_filesystem_test tomoyo_file_test tomoyo_rewrite_test newns to
+ all: $(ALL_FILES)
+ chmod 755 testall.sh
+
+-CC=gcc
+-
+-CFLAGS=-Wall -O2 ${shell $(CC) -Wno-pointer-sign -S -o /dev/null -x c - < /dev/null > /dev/null 2>&1 && echo "-Wno-pointer-sign"}
++CFLAGS += -Wall ${shell $(CC) -Wno-pointer-sign -S -o /dev/null -x c - < /dev/null > /dev/null 2>&1 && echo "-Wno-pointer-sign"}
+
+ #
+ # Tools for kernel testing.
+ #
+
+ tomoyo_new_test: tomoyo_new_test.c include.h
+- $(CC) $(CFLAGS) -o tomoyo_new_test tomoyo_new_test.c -lutil
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo_new_test tomoyo_new_test.c -lutil
+ chmod 700 tomoyo_new_test
+
+ .c: include.h
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+ chmod 700 $@
+
+ #
+--- a/sbin/Makefile
++++ b/sbin/Makefile
+@@ -9,7 +9,7 @@ install: all
+ cp -af --remove-destination $(BUILD_FILES) $(INSTALLDIR)/sbin/
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+--- a/usr_lib_tomoyo/Makefile
++++ b/usr_lib_tomoyo/Makefile
+@@ -9,7 +9,7 @@ install: all
+ cp -af --remove-destination $(BUILD_FILES) tomoyotools.conf ../README.tomoyo ../COPYING.tomoyo $(INSTALLDIR)/usr/lib/tomoyo/
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_sbin/Makefile b/usr_sbin/Makefile
+index cdaf507..2b7c4f0 100644
+--- a/usr_sbin/Makefile
++++ b/usr_sbin/Makefile
+@@ -14,17 +14,17 @@ $(BUILD_FILES): libtomoyotools.so
+ sleep 10
+
+ libtomoyotools.so: tomoyotools.c tomoyotools.h
+- $(CC) $(CFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.1 -o libtomoyotools.so.1.0.1
++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.1 -o libtomoyotools.so.1.0.1
+ ln -sf libtomoyotools.so.1.0.1 libtomoyotools.so
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $< -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -ltomoyotools -L.
+
+ tomoyo-editpolicy: tomoyotools.h editpolicy*.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
+
+ tomoyo-queryd: tomoyotools.h tomoyo-queryd.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
+
+ install: all
+ mkdir -p $(INSTALLDIR)/usr/sbin $(INSTALLDIR)/usr/lib
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.4.0_p20110929-flags-parallel.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.4.0_p20110929-flags-parallel.patch
new file mode 100644
index 000000000000..a2f084ae15e5
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.4.0_p20110929-flags-parallel.patch
@@ -0,0 +1,87 @@
+diff --git a/Include.make b/Include.make
+index 3f85e61..c34ba28 100644
+--- a/Include.make
++++ b/Include.make
+@@ -1,7 +1,5 @@
+-CC := gcc
+ INSTALL := install
+ SBINDIR := /sbin
+ USRSBINDIR := /usr/sbin
+ USRLIBDIR := /usr/lib
+ MAN8 := /usr/share/man/man8
+-CFLAGS := -Wall -O2
+diff --git a/kernel_test/Makefile b/kernel_test/Makefile
+index 2559b4b..ef599a2 100644
+--- a/kernel_test/Makefile
++++ b/kernel_test/Makefile
+@@ -10,16 +10,14 @@ all: $(ALL_FILES)
+
+ $(ALL_FILES): include.h
+
+-CC=gcc
+-
+-CFLAGS=-Wall -O2
++CFLAGS += -Wall -O2
+
+ #
+ # Tools for kernel testing.
+ #
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ #
+ # Delete all test programs.
+diff --git a/sbin/Makefile b/sbin/Makefile
+index 0f53bc6..0e8e42e 100644
+--- a/sbin/Makefile
++++ b/sbin/Makefile
+@@ -9,7 +9,7 @@ install: all
+ $(INSTALL) -m 0700 $(BUILD_FILES) $(INSTALLDIR)$(SBINDIR)
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_lib_tomoyo/Makefile b/usr_lib_tomoyo/Makefile
+index 94020ee..f20ae40 100644
+--- a/usr_lib_tomoyo/Makefile
++++ b/usr_lib_tomoyo/Makefile
+@@ -11,7 +11,7 @@ install: all
+ $(INSTALL) -m 0644 ../README.tomoyo ../COPYING.tomoyo $(INSTALLDIR)/$(USRLIBDIR)/tomoyo/
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_sbin/Makefile b/usr_sbin/Makefile
+index fa715b0..5b991db 100644
+--- a/usr_sbin/Makefile
++++ b/usr_sbin/Makefile
+@@ -15,17 +15,17 @@ $(BUILD_FILES): libtomoyotools.so
+ sleep 10
+
+ libtomoyotools.so: tomoyotools.c tomoyotools.h
+- $(CC) $(CFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.2 -o libtomoyotools.so.2.0.2
++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.2 -o libtomoyotools.so.2.0.2
+ ln -sf libtomoyotools.so.2.0.2 libtomoyotools.so
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $< -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -ltomoyotools -L.
+
+ tomoyo-editpolicy: tomoyotools.h editpolicy*.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
+
+ tomoyo-queryd: tomoyotools.h tomoyo-queryd.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
+
+ install: all
+ mkdir -p -m 0755 $(INSTALLDIR)$(USRLIBDIR)
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20120414-flags-parallel.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20120414-flags-parallel.patch
new file mode 100644
index 000000000000..55583e1ddc58
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20120414-flags-parallel.patch
@@ -0,0 +1,87 @@
+diff --git a/Include.make b/Include.make
+index 3f85e61..c34ba28 100644
+--- a/Include.make
++++ b/Include.make
+@@ -1,7 +1,5 @@
+-CC := gcc
+ INSTALL := install
+ SBINDIR := /sbin
+ USRSBINDIR := /usr/sbin
+ USRLIBDIR := /usr/lib
+ MAN8 := /usr/share/man/man8
+-CFLAGS := -Wall -O2
+diff --git a/kernel_test/Makefile b/kernel_test/Makefile
+index 2559b4b..ef599a2 100644
+--- a/kernel_test/Makefile
++++ b/kernel_test/Makefile
+@@ -10,16 +10,14 @@ all: $(ALL_FILES)
+
+ $(ALL_FILES): include.h
+
+-CC=gcc
+-
+-CFLAGS=-Wall -O2
++CFLAGS += -Wall -O2
+
+ #
+ # Tools for kernel testing.
+ #
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ #
+ # Delete all test programs.
+diff --git a/sbin/Makefile b/sbin/Makefile
+index 0f53bc6..0e8e42e 100644
+--- a/sbin/Makefile
++++ b/sbin/Makefile
+@@ -9,7 +9,7 @@ install: all
+ $(INSTALL) -m 0700 $(BUILD_FILES) $(INSTALLDIR)$(SBINDIR)
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_lib_tomoyo/Makefile b/usr_lib_tomoyo/Makefile
+index 94020ee..f20ae40 100644
+--- a/usr_lib_tomoyo/Makefile
++++ b/usr_lib_tomoyo/Makefile
+@@ -11,7 +11,7 @@ install: all
+ $(INSTALL) -m 0644 ../README.tomoyo ../COPYING.tomoyo $(INSTALLDIR)/$(USRLIBDIR)/tomoyo/
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_sbin/Makefile b/usr_sbin/Makefile
+index fa715b0..5b991db 100644
+--- a/usr_sbin/Makefile
++++ b/usr_sbin/Makefile
+@@ -15,17 +15,17 @@ $(BUILD_FILES): libtomoyotools.so
+ sleep 10
+
+ libtomoyotools.so: tomoyotools.c tomoyotools.h
+- $(CC) $(CFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.3 -o libtomoyotools.so.3.0.1
++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.3 -o libtomoyotools.so.3.0.1
+ ln -sf libtomoyotools.so.3.0.1 libtomoyotools.so
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $< -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -ltomoyotools -L.
+
+ tomoyo-editpolicy: tomoyotools.h editpolicy*.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
+
+ tomoyo-queryd: tomoyotools.h tomoyo-queryd.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
+
+ install: all
+ mkdir -p -m 0755 $(INSTALLDIR)$(USRLIBDIR)
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-flags-parallel.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-flags-parallel.patch
new file mode 100644
index 000000000000..55583e1ddc58
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-flags-parallel.patch
@@ -0,0 +1,87 @@
+diff --git a/Include.make b/Include.make
+index 3f85e61..c34ba28 100644
+--- a/Include.make
++++ b/Include.make
+@@ -1,7 +1,5 @@
+-CC := gcc
+ INSTALL := install
+ SBINDIR := /sbin
+ USRSBINDIR := /usr/sbin
+ USRLIBDIR := /usr/lib
+ MAN8 := /usr/share/man/man8
+-CFLAGS := -Wall -O2
+diff --git a/kernel_test/Makefile b/kernel_test/Makefile
+index 2559b4b..ef599a2 100644
+--- a/kernel_test/Makefile
++++ b/kernel_test/Makefile
+@@ -10,16 +10,14 @@ all: $(ALL_FILES)
+
+ $(ALL_FILES): include.h
+
+-CC=gcc
+-
+-CFLAGS=-Wall -O2
++CFLAGS += -Wall -O2
+
+ #
+ # Tools for kernel testing.
+ #
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ #
+ # Delete all test programs.
+diff --git a/sbin/Makefile b/sbin/Makefile
+index 0f53bc6..0e8e42e 100644
+--- a/sbin/Makefile
++++ b/sbin/Makefile
+@@ -9,7 +9,7 @@ install: all
+ $(INSTALL) -m 0700 $(BUILD_FILES) $(INSTALLDIR)$(SBINDIR)
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_lib_tomoyo/Makefile b/usr_lib_tomoyo/Makefile
+index 94020ee..f20ae40 100644
+--- a/usr_lib_tomoyo/Makefile
++++ b/usr_lib_tomoyo/Makefile
+@@ -11,7 +11,7 @@ install: all
+ $(INSTALL) -m 0644 ../README.tomoyo ../COPYING.tomoyo $(INSTALLDIR)/$(USRLIBDIR)/tomoyo/
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $<
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
+
+ clean:
+ rm -f -- $(BUILD_FILES)
+diff --git a/usr_sbin/Makefile b/usr_sbin/Makefile
+index fa715b0..5b991db 100644
+--- a/usr_sbin/Makefile
++++ b/usr_sbin/Makefile
+@@ -15,17 +15,17 @@ $(BUILD_FILES): libtomoyotools.so
+ sleep 10
+
+ libtomoyotools.so: tomoyotools.c tomoyotools.h
+- $(CC) $(CFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.3 -o libtomoyotools.so.3.0.1
++ $(CC) $(CFLAGS) $(LDFLAGS) -fPIC tomoyotools.c -shared -Wl,-soname,libtomoyotools.so.3 -o libtomoyotools.so.3.0.1
+ ln -sf libtomoyotools.so.3.0.1 libtomoyotools.so
+
+ .c:
+- $(CC) $(CFLAGS) -o $@ $< -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -ltomoyotools -L.
+
+ tomoyo-editpolicy: tomoyotools.h editpolicy*.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-editpolicy editpolicy*.c -lncurses -ltomoyotools -L. -DCOLOR_ON
+
+ tomoyo-queryd: tomoyotools.h tomoyo-queryd.c readline.h /usr/include/curses.h libtomoyotools.so
+- $(CC) $(CFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
++ $(CC) $(CFLAGS) $(LDFLAGS) -o tomoyo-queryd tomoyo-queryd.c -lncurses -ltomoyotools -L.
+
+ install: all
+ mkdir -p -m 0755 $(INSTALLDIR)$(USRLIBDIR)
diff --git a/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-warnings.patch b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-warnings.patch
new file mode 100644
index 000000000000..8201093bbecb
--- /dev/null
+++ b/sys-apps/tomoyo-tools/files/tomoyo-tools-2.5.0_p20130214-warnings.patch
@@ -0,0 +1,22 @@
+diff --git a/usr_sbin/editpolicy_offline.c b/usr_sbin/editpolicy_offline.c
+index dbbd11e..e699cf4 100644
+--- a/usr_sbin/editpolicy_offline.c
++++ b/usr_sbin/editpolicy_offline.c
+@@ -2882,7 +2882,7 @@ static bool ccs_parse_ipaddr_union(struct ccs_acl_param *param,
+ struct ccs_ipaddr_union *ptr)
+ {
+ struct ccs_ip_address_entry e;
+- memset(ptr, 0, sizeof(ptr));
++ memset(ptr, 0, sizeof(*ptr));
+ if (ccs_parse_ip(ccs_read_token(param), &e) == 0) {
+ memmove(&ptr->ip[0], e.min, sizeof(ptr->ip[0]));
+ memmove(&ptr->ip[1], e.max, sizeof(ptr->ip[1]));
+@@ -4745,7 +4745,7 @@ static void ccs_write_control(char *buffer, const size_t buffer_len)
+ *
+ * Returns nothing.
+ */
+-static void ccs_editpolicy_offline_init(coid)
++static void ccs_editpolicy_offline_init(void)
+ {
+ static _Bool first = true;
+ int i;
diff --git a/sys-apps/tomoyo-tools/metadata.xml b/sys-apps/tomoyo-tools/metadata.xml
new file mode 100644
index 000000000000..7ac93924f73b
--- /dev/null
+++ b/sys-apps/tomoyo-tools/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>naota@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge-jp">tomoyo</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/tomoyo-tools/tomoyo-tools-2.5.0_p20130214.ebuild b/sys-apps/tomoyo-tools/tomoyo-tools-2.5.0_p20130214.ebuild
new file mode 100644
index 000000000000..3180cef1d5a5
--- /dev/null
+++ b/sys-apps/tomoyo-tools/tomoyo-tools-2.5.0_p20130214.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs
+
+MY_P="${P/_p/-}"
+DESCRIPTION="TOMOYO Linux tools"
+HOMEPAGE="http://tomoyo.sourceforge.jp/"
+SRC_URI="mirror://sourceforge.jp/tomoyo/53357/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+COMMON_DEPEND="sys-libs/ncurses"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+ !sys-apps/ccs-tools"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-warnings.patch
+
+ # Fix libdir
+ sed -i \
+ -e "s:/usr/lib:/usr/$(get_libdir):g" \
+ Include.make || die
+
+ # tinfo
+ sed -i \
+ -e 's|-lncurses|$(shell ${PKG_CONFIG} --libs ncurses)|g' \
+ usr_sbin/Makefile || die
+
+ echo "CONFIG_PROTECT=\"/usr/$(get_libdir)/tomoyo/conf\"" > "${T}/50${PN}"
+
+ tc-export CC PKG_CONFIG
+}
+
+src_install() {
+ dodir /usr/"$(get_libdir)"
+
+ emake INSTALLDIR="${D}" install
+
+ doenvd "${T}/50${PN}"
+
+ # Fix out-of-place readme and license
+ rm "${D}"/usr/$(get_libdir)/tomoyo/{COPYING.tomoyo,README.tomoyo} || die
+ dodoc README.tomoyo || die
+}
+
+pkg_postinst() {
+ elog "Execute the following command to setup the initial policy configuration:"
+ elog
+ elog "emerge --config =${CATEGORY}/${PF}"
+ elog
+ elog "For more information, please visit the following."
+ elog
+ elog "http://tomoyo.sourceforge.jp/"
+}
+
+pkg_config() {
+ /usr/$(get_libdir)/tomoyo/init_policy
+}
diff --git a/sys-apps/toybox/Manifest b/sys-apps/toybox/Manifest
new file mode 100644
index 000000000000..1a4d5a692a44
--- /dev/null
+++ b/sys-apps/toybox/Manifest
@@ -0,0 +1,7 @@
+DIST toybox-0.4.7.tar.bz2 464545 SHA256 56392d602c21a3c9e05f94a64e194ff6467cb8e98ee10c4735e9d659a42c66d1 SHA512 77fa2eb7775d2f9fda5053048f902b91597ca5f1898f1819dc4308b7f6d10b96a09979d4f9853345598d30cce5c773f441454c97472920fffe3abf1cb4234741 WHIRLPOOL 270b25188291d06fb490268aa9e3efa26fe6cb6ca2fd2d3fef43f40c3ecbc6bd69a6303f487ce29e2078c6fc24e71c09de5c8e1e4743bb597f7d02b6f62460f9
+DIST toybox-0.4.8.tar.bz2 492065 SHA256 44fedc94ad4666daecddb6df9082709d68c9ff5950c625215158875c87561be7 SHA512 4b82d0c85e7137c65e4d89dee247852e80e6d6917e5ed55a13a513cfa08a63bc815a1dd2eb685faecdd15ddd5c61dcc01578f49fadbf23db65a78a26acb1441e WHIRLPOOL b8386bd379322b30ad428bab2bb4a03bacb58e505021f19e97808e341e19f0b18146f36bf2c1caeb10f4db59743832f65d41a8fe703683bdbdf2f78125b20ded
+DIST toybox-0.4.9.tar.bz2 526704 SHA256 e6dc9052826a3bdae1923e3301c9e3542e890af5ed66534052943f8412255bff SHA512 e1788ecc5eaf8a92b05c6469c3aca2465eba6ca782df9479beb438e8f18a7dbc53c8533b47e95a792f1f803fde9f542ad216a214853a490c5a53a235b63e0a2c WHIRLPOOL 92422d0ab0493aabc2129ca2c397d0ff65a07f9d3aedf440622bdc02d5bdd30f0a713f0cf23bb5e10d30d5de46dfc5cdaaa561794b78afb31b5544383e072e4b
+DIST toybox-0.5.0.tar.bz2 564512 SHA256 2718b42154be041435df48d5b5140f4e307767c36b1017e0c8d0da7f75b327a7 SHA512 a5ca0d3ab70c63b6d4310c2a3b79ebb2e267aceaee7251682b5e7606d7c848e8213e8d905c2349dda511ccd0a5f7253b9b16150f74fe71f95efa49101d497843 WHIRLPOOL afebeabb471aad89e5c2cbccea660a09cf93e09817f106bbbf5941ba194e7dbd033011a3ad8e7a7a7f1329f22ffcf60ba6732f9bc0023cbf15f33fd7003e553d
+DIST toybox-0.5.1.tar.bz2 588987 SHA256 83baa69a26e03a920ea7e91fbeb9016178990450d4144d1a244275b44346a12c SHA512 4abab27ef1d3ecedc1b419ea7421c032bdb9bd375a808e8400eda6c409665b41f35bef959087b863bb661d54962fb8ce78ed1d74285040837611dfdb7c715d03 WHIRLPOOL 8b098073ca7a604205e6c1857fedacab1c42785281cd05fe76bb654a54fea77beb588d7f9bd575be9c2c12fe03ae6598ba2f31b683f1bafdf249d26b8b953df8
+DIST toybox-0.5.2.tar.gz 685909 SHA256 dec7f6433ee0e130f224fc63760b347ad0572280c4de32f1aaefbee813a79a00 SHA512 76b20c70a1568b03c32e5670f8fbc517b4d528c21e74fc44ce1241cb494ad329f8e3412bf6501521ad2c19d07f89046fba2c37f8a07f4aba1e0ebe1346d9c83d WHIRLPOOL 168b2039c02fd8381a8c5c4353ed1d365a4ed941477b5b1acb21f6330d4f8e0785c69511edd187de790d0d6b65a9d34218a01ca25747558a0890f5f4c7f6f44b
+DIST toybox-0.6.0.tar.gz 710572 SHA256 d0b9788f61b9f9cbc685eabc0bd89b6925201ecb15a0cb4fbbd5fbf658b99991 SHA512 ddbd2252cd64a3508b9cd9d8a0a574805583b5b9c3861c153d25e8a394115c28b5a58d02a5aa7d7f58b9b9f3effcd33ac3f55788e0f3c4ad4265233f49c6f3ff WHIRLPOOL 0a83bc9895fd0c43ac541afdbfb6caaa294639646c82e70090fd40b77cf5943009188bb8f1b12b1af82d9bb94dd345892b36a5f7849d7154d34efa0b1f1a5f17
diff --git a/sys-apps/toybox/metadata.xml b/sys-apps/toybox/metadata.xml
new file mode 100644
index 000000000000..6719fcd2bb35
--- /dev/null
+++ b/sys-apps/toybox/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>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/toybox/toybox-0.4.7.ebuild b/sys-apps/toybox/toybox-0.4.7.ebuild
new file mode 100644
index 000000000000..3115de279b02
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.4.7.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 eutils
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+src_configure() {
+ :;
+}
+
+src_compile() {
+ emake || die
+}
+
+src_test() {
+ emake test || die
+}
+
+src_install() {
+ mkdir -p "${D}/usr/bin"
+ cp toybox "${D}/usr/bin" || die
+}
diff --git a/sys-apps/toybox/toybox-0.4.8.ebuild b/sys-apps/toybox/toybox-0.4.8.ebuild
new file mode 100644
index 000000000000..5f2e9aaefb38
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.4.8.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 eutils
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+src_configure() {
+ make defconfig
+}
+
+src_compile() {
+ emake
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ mkdir -p "${D}/usr/bin"
+ cp toybox "${D}/usr/bin" || die
+}
diff --git a/sys-apps/toybox/toybox-0.4.9-r1.ebuild b/sys-apps/toybox/toybox-0.4.9-r1.ebuild
new file mode 100644
index 000000000000..14e1632143c2
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.4.9-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils savedconfig toolchain-funcs
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+src_prepare() {
+ sed -i -e 's/LOCALE/LC_ALL/' scripts/make.sh || die
+ restore_config .config
+ export CC="$(tc-getCC)"
+ export HOSTCC="$(tc-getCC)"
+}
+
+src_configure() {
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ ewarn "Could not locate user configfile, so we will save a default one"
+ emake defconfig > /dev/null
+ fi
+}
+
+src_compile() {
+ emake toybox_unstripped V=1
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ save_config .config
+ newbin toybox_unstripped toybox
+}
diff --git a/sys-apps/toybox/toybox-0.4.9.ebuild b/sys-apps/toybox/toybox-0.4.9.ebuild
new file mode 100644
index 000000000000..133b749a36af
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.4.9.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 eutils
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+
+src_configure() {
+ make defconfig
+}
+
+src_compile() {
+ emake toybox_unstripped
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ mkdir -p "${D}/usr/bin"
+ cp toybox "${D}/usr/bin" || die
+}
diff --git a/sys-apps/toybox/toybox-0.5.0.ebuild b/sys-apps/toybox/toybox-0.5.0.ebuild
new file mode 100644
index 000000000000..0d306d4dd079
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.5.0.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multiprocessing savedconfig toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/gfto/toybox.git"
+else
+ SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ epatch_user
+ restore_config .config
+}
+
+src_configure() {
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ einfo "Could not locate user configfile, so we will save a default one"
+ emake defconfig > /dev/null
+ fi
+}
+
+src_compile() {
+ tc-export CC STRIP
+ export HOSTCC=$(tc-getBUILD_CC)
+ unset CROSS_COMPILE
+ export CPUS=$(makeopts_jobs)
+ emake V=1
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ save_config .config
+ newbin toybox_unstripped toybox
+}
diff --git a/sys-apps/toybox/toybox-0.5.1.ebuild b/sys-apps/toybox/toybox-0.5.1.ebuild
new file mode 100644
index 000000000000..0d306d4dd079
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.5.1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multiprocessing savedconfig toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/gfto/toybox.git"
+else
+ SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ epatch_user
+ restore_config .config
+}
+
+src_configure() {
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ einfo "Could not locate user configfile, so we will save a default one"
+ emake defconfig > /dev/null
+ fi
+}
+
+src_compile() {
+ tc-export CC STRIP
+ export HOSTCC=$(tc-getBUILD_CC)
+ unset CROSS_COMPILE
+ export CPUS=$(makeopts_jobs)
+ emake V=1
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ save_config .config
+ newbin toybox_unstripped toybox
+}
diff --git a/sys-apps/toybox/toybox-0.5.2.ebuild b/sys-apps/toybox/toybox-0.5.2.ebuild
new file mode 100644
index 000000000000..71beeaa77fe1
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.5.2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multiprocessing savedconfig toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/gfto/toybox.git"
+else
+ SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ epatch_user
+ restore_config .config
+}
+
+src_configure() {
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ einfo "Could not locate user configfile, so we will save a default one"
+ emake defconfig > /dev/null
+ fi
+}
+
+src_compile() {
+ tc-export CC STRIP
+ export HOSTCC=$(tc-getBUILD_CC)
+ unset CROSS_COMPILE
+ export CPUS=$(makeopts_jobs)
+ emake V=1
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ save_config .config
+ newbin toybox_unstripped toybox
+}
diff --git a/sys-apps/toybox/toybox-0.6.0.ebuild b/sys-apps/toybox/toybox-0.6.0.ebuild
new file mode 100644
index 000000000000..4e44b3a2e724
--- /dev/null
+++ b/sys-apps/toybox/toybox-0.6.0.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 multiprocessing savedconfig toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/gfto/toybox.git"
+else
+ SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+S=${WORKDIR}
+
+src_prepare() {
+ epatch_user
+ restore_config .config
+}
+
+src_configure() {
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ einfo "Could not locate user configfile, so we will save a default one"
+ emake defconfig > /dev/null
+ fi
+}
+
+src_compile() {
+ tc-export CC STRIP
+ export HOSTCC=$(tc-getBUILD_CC)
+ unset CROSS_COMPILE
+ export CPUS=$(makeopts_jobs)
+ emake V=1
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ save_config .config
+ newbin toybox_unstripped toybox
+}
diff --git a/sys-apps/toybox/toybox-9999.ebuild b/sys-apps/toybox/toybox-9999.ebuild
new file mode 100644
index 000000000000..24a03b22bd7b
--- /dev/null
+++ b/sys-apps/toybox/toybox-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
+
+inherit eutils multiprocessing savedconfig toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/landley/toybox.git"
+else
+ SRC_URI="http://landley.net/code/toybox/downloads/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+# makefile is stupid
+RESTRICT="test"
+
+DESCRIPTION="Common linux commands in a multicall binary"
+HOMEPAGE="http://landley.net/code/toybox/"
+
+# The source code does not explicitly say that it's BSD, but the author has repeatedly said it
+LICENSE="BSD-2"
+SLOT="0"
+IUSE=""
+
+src_prepare() {
+ epatch_user
+ restore_config .config
+}
+
+src_configure() {
+ if [ -f .config ]; then
+ yes "" | emake -j1 oldconfig > /dev/null
+ return 0
+ else
+ einfo "Could not locate user configfile, so we will save a default one"
+ emake defconfig > /dev/null
+ fi
+}
+
+src_compile() {
+ tc-export CC STRIP
+ export HOSTCC=$(tc-getBUILD_CC)
+ unset CROSS_COMPILE
+ export CPUS=$(makeopts_jobs)
+ emake V=1
+}
+
+src_test() {
+ emake test
+}
+
+src_install() {
+ save_config .config
+ newbin toybox_unstripped toybox
+}
diff --git a/sys-apps/tuned/Manifest b/sys-apps/tuned/Manifest
new file mode 100644
index 000000000000..c72573fc2b9a
--- /dev/null
+++ b/sys-apps/tuned/Manifest
@@ -0,0 +1,3 @@
+DIST tuned-2.4.1.tar.bz2 81052 SHA256 fd2514ec269387c7c555b5d12534ce258ecdb021cd66f64c5678eea7dcbda54f SHA512 12106f441cda10d1ddb5d4fc4e64be7100ec2b1d48117a9c83bbc11e093a59c1a5e8effa22ea563481b66748db38ebb8a493dbb1e4707b16f6f3cae2de966bf1 WHIRLPOOL 21011bbdfb170c5f85313a5cfd7c26bf7e57a3693a0a56c0a096b788b2fee6d390e7391b1083ec5fd610d34caf1985ffa310b6befc7950080cf99931db99430d
+DIST tuned-2.5.0.tar.bz2 95651 SHA256 2d7fe44626d236b158b0259938d757846d2455f5a91ab6412a134e6ac2db7feb SHA512 59d3014cc2c04f2cffbde02f46fdbce223bff827fba1c07e5dd5e821fc9d7ea2867c24c5d5fc42ef294fb31d24cad3c8715fec7d3113b25ce316b457fd40bc22 WHIRLPOOL 4e48dfc4fd89de061a099ccfef70103d4920f3eb06ccb09e767e525bafcae700386b47b776009488f0e8c0bdfdf0ddac2bf72cf8a1b9f3935879fb1691d08c0a
+DIST tuned-2.5.1.tar.bz2 96319 SHA256 7eccf1d0807e8e0774e7969f9dbe5173cd85b2449f1f259a3b31ecb022cfbe88 SHA512 5d818f15a439f85fa26cefcc3dcc7968d23f3f29f26bbf99480ccbde90d87d6f5f81709820232b127d435c30d59a00c9d50f630c7c2b83f249f485c3f50305a5 WHIRLPOOL 55ec1e65925a1e06fee2dffb2ff004503a2e2d53933c530bbac081e30180684760fac16da79039a77751c36983c641b920473d9ef2ee8235dd4415f6d986f468
diff --git a/sys-apps/tuned/files/tuned.initd b/sys-apps/tuned/files/tuned.initd
new file mode 100644
index 000000000000..3ebdef3daa26
--- /dev/null
+++ b/sys-apps/tuned/files/tuned.initd
@@ -0,0 +1,17 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+TUNED_PIDFILE="/run/tuned.pid"
+TUNED_LOGFILE="/var/log/tuned.log"
+
+command="/usr/sbin/tuned"
+command_args="-d --pid ${TUNED_PIDFILE} --log ${TUNED_LOGFILE}"
+pidfile=${TUNED_PIDFILE}
+
+description="tuned is a daemon for monitoring and adaptive tuning of system devices."
+
+depend() {
+ need dbus
+}
diff --git a/sys-apps/tuned/metadata.xml b/sys-apps/tuned/metadata.xml
new file mode 100644
index 000000000000..c2491ca20b16
--- /dev/null
+++ b/sys-apps/tuned/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>dlan@gentoo.org</email>
+ <name>Yixun Lan</name>
+</maintainer>
+<longdescription lang="en">
+A tool that performs monitoring and adaptive configuration of the system
+according to selected profile.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/tuned/tuned-2.4.1.ebuild b/sys-apps/tuned/tuned-2.4.1.ebuild
new file mode 100644
index 000000000000..38ae2c657733
--- /dev/null
+++ b/sys-apps/tuned/tuned-2.4.1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit python-single-r1 systemd
+
+DESCRIPTION="Daemon for monitoring and adaptive tuning of system devices"
+HOMEPAGE="https://fedorahosted.org/tuned/"
+SRC_URI="https://fedorahosted.org/releases/t/u/tuned/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+COMMON_DEPEND="${PYTHON_DEPS}
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/decorator[${PYTHON_USEDEP}]
+ dev-python/pyudev[${PYTHON_USEDEP}]
+"
+DEPEND="${COMMON_DEPEND}"
+RDEPEND="${COMMON_DEPEND}
+ sys-power/powertop
+ dev-util/systemtap
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_prepare() {
+ sed -i \
+ -e "/^UNITDIR = /s:\$(shell rpm --eval '%{_unitdir}'):$(systemd_get_unitdir):" \
+ -e "/\$(DESTDIR)\/run\/tuned/d" \
+ Makefile ||die
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/tuned.initd tuned
+
+ python_fix_shebang "${ED}"
+}
diff --git a/sys-apps/tuned/tuned-2.5.0.ebuild b/sys-apps/tuned/tuned-2.5.0.ebuild
new file mode 100644
index 000000000000..4060a0a6d74f
--- /dev/null
+++ b/sys-apps/tuned/tuned-2.5.0.ebuild
@@ -0,0 +1,45 @@
+# 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 systemd
+
+DESCRIPTION="Daemon for monitoring and adaptive tuning of system devices"
+HOMEPAGE="https://fedorahosted.org/tuned/"
+SRC_URI="https://fedorahosted.org/releases/t/u/tuned/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+COMMON_DEPEND="${PYTHON_DEPS}
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/decorator[${PYTHON_USEDEP}]
+ dev-python/pyudev[${PYTHON_USEDEP}]
+"
+DEPEND="${COMMON_DEPEND}"
+RDEPEND="${COMMON_DEPEND}
+ sys-power/powertop
+ dev-util/systemtap
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_prepare() {
+ sed -i \
+ -e "/^UNITDIR = /s:\$(shell rpm --eval '%{_unitdir}'):$(systemd_get_unitdir):" \
+ -e "/\$(DESTDIR)\/run\/tuned/d" \
+ Makefile ||die
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/tuned.initd tuned
+
+ python_fix_shebang "${ED}"
+}
diff --git a/sys-apps/tuned/tuned-2.5.1.ebuild b/sys-apps/tuned/tuned-2.5.1.ebuild
new file mode 100644
index 000000000000..4060a0a6d74f
--- /dev/null
+++ b/sys-apps/tuned/tuned-2.5.1.ebuild
@@ -0,0 +1,45 @@
+# 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 systemd
+
+DESCRIPTION="Daemon for monitoring and adaptive tuning of system devices"
+HOMEPAGE="https://fedorahosted.org/tuned/"
+SRC_URI="https://fedorahosted.org/releases/t/u/tuned/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+COMMON_DEPEND="${PYTHON_DEPS}
+ dev-python/configobj[${PYTHON_USEDEP}]
+ dev-python/decorator[${PYTHON_USEDEP}]
+ dev-python/pyudev[${PYTHON_USEDEP}]
+"
+DEPEND="${COMMON_DEPEND}"
+RDEPEND="${COMMON_DEPEND}
+ sys-power/powertop
+ dev-util/systemtap
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_prepare() {
+ sed -i \
+ -e "/^UNITDIR = /s:\$(shell rpm --eval '%{_unitdir}'):$(systemd_get_unitdir):" \
+ -e "/\$(DESTDIR)\/run\/tuned/d" \
+ Makefile ||die
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/tuned.initd tuned
+
+ python_fix_shebang "${ED}"
+}
diff --git a/sys-apps/turbotail/Manifest b/sys-apps/turbotail/Manifest
new file mode 100644
index 000000000000..d6de1ef4a20e
--- /dev/null
+++ b/sys-apps/turbotail/Manifest
@@ -0,0 +1 @@
+DIST turbotail-0.3.tgz 6515 RMD160 74d91f5fe616b11b0aa7928b9a336943c08fb788 SHA1 8499eda3f92b06693e4ff309ad51007ffb7f28ea SHA256 d6b1f367de3952359f91da78de4eca01a285b37203530a7ee245b1a2e4a5a179
diff --git a/sys-apps/turbotail/metadata.xml b/sys-apps/turbotail/metadata.xml
new file mode 100644
index 000000000000..659da0ca93c2
--- /dev/null
+++ b/sys-apps/turbotail/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-apps/turbotail/turbotail-0.3-r1.ebuild b/sys-apps/turbotail/turbotail-0.3-r1.ebuild
new file mode 100644
index 000000000000..75175ae42ba2
--- /dev/null
+++ b/sys-apps/turbotail/turbotail-0.3-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit toolchain-funcs
+
+DESCRIPTION="Drop-in replacement for 'tail' which uses the kernel DNOTIFY-api"
+HOMEPAGE="http://www.vanheusden.com/turbotail/"
+SRC_URI="http://www.vanheusden.com/${PN}/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
+IUSE="fam"
+
+DEPEND="fam? ( virtual/fam )"
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ local myconf mylibs
+ if use fam; then
+ myconf="-DUSE_FAM"
+ mylibs="-lfam"
+ else
+ myconf="-DUSE_DNOTIFY"
+ fi
+
+ echo "$(tc-getCC) ${CFLAGS} ${myconf} -DVERSION=\"${PV}\" -c ${PN}.c"
+ $(tc-getCC) ${CFLAGS} ${myconf} -DVERSION=\"${PV}\" -c ${PN}.c || die
+ echo "$(tc-getCC) ${CFLAGS} ${LDFLAGS} -o ${PN} ${PN}.o ${mylibs}"
+ $(tc-getCC) ${CFLAGS} ${LDFLAGS} -o ${PN} ${PN}.o ${mylibs} || die
+}
+
+src_install() {
+ dobin turbotail
+ dodoc readme.txt
+}
diff --git a/sys-apps/turbotail/turbotail-0.3.ebuild b/sys-apps/turbotail/turbotail-0.3.ebuild
new file mode 100644
index 000000000000..0e651c23f5d9
--- /dev/null
+++ b/sys-apps/turbotail/turbotail-0.3.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="drop-in replacement for 'tail' which uses the kernel DNOTIFY-api"
+HOMEPAGE="http://www.vanheusden.com/turbotail/"
+SRC_URI="http://www.vanheusden.com/${PN}/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 hppa ~ppc ~sparc ~x86"
+IUSE="fam"
+
+DEPEND="fam? ( virtual/fam )"
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ local myconf
+ if use fam; then
+ myconf="-DUSE_FAM -lfam"
+ else
+ myconf="-DUSE_DNOTIFY"
+ fi
+
+ echo "$(tc-getCC) ${myconf} -DVERSION=\"${PV}\" ${PN}.c -o ${PN}"
+ $(tc-getCC) ${myconf} -DVERSION=\"${PV}\" ${PN}.c -o ${PN} \
+ || die "compile failed"
+}
+
+src_install() {
+ dobin turbotail || die "install failed"
+ dodoc readme.txt
+}
diff --git a/sys-apps/tuxonice-userui/Manifest b/sys-apps/tuxonice-userui/Manifest
new file mode 100644
index 000000000000..f2a9ef7aaadd
--- /dev/null
+++ b/sys-apps/tuxonice-userui/Manifest
@@ -0,0 +1,2 @@
+DIST tuxonice-userui-1.1.tar 3317760 SHA256 dfbd5c9f5b07c17502a3d96df58be38d53268b088f095186d955e9bba4324d3a SHA512 b837e3302437ccfcc7e984817c52576be27c774681abc18b1ad34990eab342b5d11ec13cf48cfef07f419f425c111715843c7ca427a1d4778bd48f1d7352684a WHIRLPOOL c15bb0c0ea17bc9f34343175450919361afd22feea06a4d6e013fabff8a9aee1c1d0fe8cffb87ebc56080e823bd608fe377f81e96b916c71c06971a28722738a
+DIST tuxonice-userui_1.1-2~exp1.debian.tar.gz 7628 SHA256 042936fe036563706d9db6e04750d890706dde8d90d51dfcbf64a7328653f427 SHA512 5aebc331452f9d8cac3f3d4db9fcc04c5a68759df2236a70a9fdf5c6e03da27170b1db71031b4b9bb2939c4e5a98c4755d26b6ebf0f81362a71c35e77b688f0b WHIRLPOOL 47b3dd3c6aa310200f04902b62861f0abd98656133432ab1b160ad03e7f79838ab1adac7c9be8b6c5302267b92890f5a712cf41cf7917e480b4009b8efedbc1c
diff --git a/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-Makefiles.patch b/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-Makefiles.patch
new file mode 100644
index 000000000000..8cc315f92082
--- /dev/null
+++ b/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-Makefiles.patch
@@ -0,0 +1,45 @@
+diff -Nru tuxonice-userui-1.0.vanilla/Makefile tuxonice-userui-1.0/Makefile
+--- tuxonice-userui-1.0.vanilla/Makefile 2009-04-04 13:37:13.000000000 +0200
++++ tuxonice-userui-1.0/Makefile 2009-04-05 14:13:23.000000000 +0200
+@@ -32,15 +32,15 @@
+ all: $(TARGETS)
+
+ fbsplash:
+- make -C $@ all
++ $(MAKE) -C $@ all
+
+ usplash:
+- make -C $@ all
++ $(MAKE) -C $@ all
+
+ tuxoniceui_text: $(CORE_OBJECTS) userui_text.o
+ $(CC) $(LDFLAGS) -static $^ -o $@
+
+-tuxoniceui_fbsplash: fbsplash $(CORE_OBJECTS) fbsplash/userui_fbsplash.o
++tuxoniceui_fbsplash: fbsplash $(CORE_OBJECTS)
+ $(CC) $(LDFLAGS) -static $(CORE_OBJECTS) fbsplash/userui_fbsplash.o -o $@ $(FBSPLASH_LIBS)
+
+ tuxoniceui_usplash: usplash $(CORE_OBJECTS) usplash/userui_usplash.o
+@@ -48,8 +48,8 @@
+
+ clean:
+ $(RM) *.o $(TARGETS)
+- make -C fbsplash clean
+- make -C usplash clean
++ $(MAKE) -C fbsplash clean
++ $(MAKE) -C usplash clean
+
+ $(INSTDIR)/%: %
+ strip $<
+diff -Nru tuxonice-userui-1.0.vanilla/fbsplash/Makefile tuxonice-userui-1.0/fbsplash/Makefile
+--- tuxonice-userui-1.0.vanilla/fbsplash/Makefile 2009-04-04 13:37:13.000000000 +0200
++++ tuxonice-userui-1.0/fbsplash/Makefile 2009-04-05 14:14:53.000000000 +0200
+@@ -6,7 +6,7 @@
+ parse.o mng_callbacks.o mng_render.o render.o ttf.o
+ SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
+
+-all: $(TARGET)
++all: $(TARGET) $(OBJECTS)
+
+ userui_fbsplash.o: $(OBJECTS)
+ $(CC) $(LDFLAGS) -r -nostdlib -nostartfiles $(SPLASH_LDLIBS) $^ -o $@
diff --git a/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch b/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch
new file mode 100644
index 000000000000..bfe6d0a5e50e
--- /dev/null
+++ b/sys-apps/tuxonice-userui/files/tuxonice-userui-1.0-libpng15.patch
@@ -0,0 +1,88 @@
+--- fbsplash/image.c
++++ fbsplash/image.c
+@@ -112,29 +112,29 @@
+ png_init_io(png_ptr, fp);
+ png_read_info(png_ptr, info_ptr);
+
+- if (cmap && info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) {
++ if (cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_PALETTE) {
+ printerr("Could not read file %s. Not a palette-based image.\n", filename);
+ goto failed;
+ }
+
+- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY ||
++ png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA)
+ png_set_gray_to_rgb(png_ptr);
+
+- if (info_ptr->bit_depth == 16)
++ if (png_get_bit_depth(png_ptr, info_ptr) == 16)
+ png_set_strip_16(png_ptr);
+
+- if (!want_alpha && info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
++ if (!want_alpha && png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA)
+ png_set_strip_alpha(png_ptr);
+
+ #ifndef TARGET_KERNEL
+- if (!(info_ptr->color_type & PNG_COLOR_MASK_ALPHA) & want_alpha) {
++ if (!(png_get_color_type(png_ptr, info_ptr) & PNG_COLOR_MASK_ALPHA) & want_alpha) {
+ png_set_add_alpha(png_ptr, 0xff, PNG_FILLER_AFTER);
+ }
+ #endif
+ png_read_update_info(png_ptr, info_ptr);
+
+- if (!cmap && info_ptr->color_type != PNG_COLOR_TYPE_RGB && info_ptr->color_type != PNG_COLOR_TYPE_RGBA) {
++ if (!cmap && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_RGB && png_get_color_type(png_ptr, info_ptr) != PNG_COLOR_TYPE_RGBA) {
+ printerr("Could not read file %s. Not an RGB image.\n", filename);
+ goto failed;
+ }
+@@ -150,12 +150,12 @@
+
+ rowbytes = png_get_rowbytes(png_ptr, info_ptr);
+
+- if ((width && *width && info_ptr->width != *width) || (height && *height && info_ptr->height != *height)) {
++ if ((width && *width && png_get_image_width(png_ptr, info_ptr) != *width) || (height && *height && png_get_image_height(png_ptr, info_ptr) != *height)) {
+ printerr("Image size mismatch: %s.\n", filename);
+ goto failed;
+ } else {
+- *width = info_ptr->width;
+- *height = info_ptr->height;
++ *width = png_get_image_width(png_ptr, info_ptr);
++ *height = png_get_image_height(png_ptr, info_ptr);
+ }
+
+ *data = malloc(fb_var.xres * fb_var.yres * bytespp);
+@@ -171,11 +171,11 @@
+ goto failed;
+ }
+
+- for (i = 0; i < info_ptr->height; i++) {
++ for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) {
+ if (cmap) {
+- row_pointer = *data + info_ptr->width * i;
++ row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i;
+ } else if (want_alpha) {
+- row_pointer = *data + info_ptr->width * i * 4;
++ row_pointer = *data + png_get_image_width(png_ptr, info_ptr) * i * 4;
+ } else {
+ row_pointer = buf;
+ }
+@@ -184,7 +184,7 @@
+
+ if (cmap) {
+ int h = 256 - cmap->len;
+- t = *data + info_ptr->width * i;
++ t = *data + png_get_image_width(png_ptr, info_ptr) * i;
+
+ if (h) {
+ /* Move the colors up by 'h' offset. This is used because fbcon
+@@ -196,7 +196,7 @@
+
+ /* We only need to convert the image if we the alpha channel is not required */
+ } else if (!want_alpha) {
+- truecolor2fb((truecolor*)buf, *data + info_ptr->width * bytespp * i, info_ptr->width, i, 0);
++ truecolor2fb((truecolor*)buf, *data + png_get_image_width(png_ptr, info_ptr) * bytespp * i, png_get_image_width(png_ptr, info_ptr), i, 0);
+ }
+ }
+
diff --git a/sys-apps/tuxonice-userui/files/tuxonice-userui-1.1-freetype-2.5.patch b/sys-apps/tuxonice-userui/files/tuxonice-userui-1.1-freetype-2.5.patch
new file mode 100644
index 000000000000..f86f99a650fd
--- /dev/null
+++ b/sys-apps/tuxonice-userui/files/tuxonice-userui-1.1-freetype-2.5.patch
@@ -0,0 +1,38 @@
+From ed1b73cf2f073f39200be79c633deb292cb8d4af Mon Sep 17 00:00:00 2001
+From: Damjan Georgievski <gdamjan@gmail.com>
+Date: Mon, 6 Jan 2014 03:06:18 +0100
+Subject: [PATCH] fix #includes for recent freetype versions
+
+---
+ fbsplash/ttf.c | 3 +--
+ fbsplash/ttf.h | 3 +--
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/fbsplash/ttf.c b/fbsplash/ttf.c
+index 384f400..1dd841c 100644
+--- a/fbsplash/ttf.c
++++ b/fbsplash/ttf.c
+@@ -27,8 +27,7 @@
+ #include <assert.h>
+
+ #include <ft2build.h>
+-#include <freetype/ftoutln.h>
+-#include <freetype/ttnameid.h>
++#include FT_FREETYPE_H
+
+ #include "splash.h"
+
+diff --git a/fbsplash/ttf.h b/fbsplash/ttf.h
+index 034bb9e..6a4da9d 100644
+--- a/fbsplash/ttf.h
++++ b/fbsplash/ttf.h
+@@ -1,8 +1,7 @@
+ #ifndef _TTF_H
+ #define _TTF_H
+ #include <ft2build.h>
+-#include <freetype/ftoutln.h>
+-#include <freetype/ttnameid.h>
++#include FT_FREETYPE_H
+
+ #define CACHED_METRICS 0x10
+ #define CACHED_BITMAP 0x01
diff --git a/sys-apps/tuxonice-userui/metadata.xml b/sys-apps/tuxonice-userui/metadata.xml
new file mode 100644
index 000000000000..5fdec1dea043
--- /dev/null
+++ b/sys-apps/tuxonice-userui/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>arfrever.fta@gmail.com</email>
+ <name>Arfrever Frehtes Taifersar Arahesis</name>
+ </maintainer>
+ <herd>proxy-maintainers</herd>
+ <use>
+ <flag name='fbsplash'>Add support for framebuffer splash</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/tuxonice-userui/tuxonice-userui-1.1-r2.ebuild b/sys-apps/tuxonice-userui/tuxonice-userui-1.1-r2.ebuild
new file mode 100644
index 000000000000..ed0a880e02cc
--- /dev/null
+++ b/sys-apps/tuxonice-userui/tuxonice-userui-1.1-r2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User Interface for TuxOnIce"
+HOMEPAGE="http://www.tuxonice.net"
+SRC_URI="http://tuxonice.net/files/${P}.tar.gz -> ${P}.tar
+ mirror://debian/pool/main/t/${PN}/${PN}_${PV}-2~exp1.debian.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="fbsplash"
+
+DEPEND="fbsplash? (
+ >=app-arch/bzip2-1.0.6-r3[static-libs]
+ >=media-gfx/splashutils-1.5.2.1
+ media-libs/freetype[static-libs]
+ media-libs/libmng
+ >=media-libs/libpng-1.4.8[static-libs]
+ virtual/jpeg
+ )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ local d=${WORKDIR}/debian/patches
+ EPATCH_SOURCE=${d} epatch $(<"${d}"/series)
+ epatch "${FILESDIR}"/${P}-freetype-2.5.patch
+ sed -i -e 's/make/$(MAKE)/' Makefile || die
+ sed -i -e 's/ -O3//' Makefile fbsplash/Makefile usplash/Makefile || die
+}
+
+src_compile() {
+ # Package contain binaries
+ emake clean
+
+ use fbsplash && export USE_FBSPLASH=1
+ emake CC="$(tc-getCC)" tuxoniceui
+}
+
+src_install() {
+ into /
+ dosbin tuxoniceui
+ dodoc AUTHORS ChangeLog KERNEL_API README TODO USERUI_API
+}
+
+pkg_postinst() {
+ if use fbsplash; then
+ einfo
+ elog "You must create a symlink from /etc/splash/tuxonice"
+ elog "to the theme you want tuxonice to use, e.g.:"
+ elog
+ elog " # ln -sfn /etc/splash/emergence /etc/splash/tuxonice"
+ if [[ ${REPLACING_VERSIONS} < 1.1 ]]; then
+ einfo
+ elog "You must refer to '/sbin/tuxoniceui -f' instead of /sbin/tuxoniceui_fbsplash'"
+ elog "in all places you set it."
+ fi
+ fi
+ einfo
+ einfo "Please see /usr/share/doc/${PF}/README.* for further"
+ einfo "instructions."
+ einfo
+}
diff --git a/sys-apps/uam/Manifest b/sys-apps/uam/Manifest
new file mode 100644
index 000000000000..8eceed5c018f
--- /dev/null
+++ b/sys-apps/uam/Manifest
@@ -0,0 +1,3 @@
+DIST uam-0.3.1.tar.bz2 59632 SHA256 3f3b43d1aa7d58908d417fa5d35424b91c247c90a2bbec58c5f20198dfac9a5d SHA512 bcd7a37701eb73bf3443d1fa98372fc0788cb3101619265c012d010f83e2cccc17fa8bc033704396707aa6de9caf0a80c9637dd7c7d1f86b01fd844967dac5a5 WHIRLPOOL 55d0fdd5638eaeff95789cb43bdcb86e7fa9d3190445ece0830e8d74cb95cb868a2e902dc3897ad62e46d42e29e7d229dafc8c5e2fa6ef7d693baeee680a7f2c
+DIST uam-0.3.2.tar.bz2 60508 SHA256 f2aa2f98b2b270802d1b5d76d369cbf7615ae458a3fbc9a4f8d1f21623bf2170 SHA512 4a4ee9286b3762227fc5a03a10998cb3b4a2f110cd648bb2ed45f400e31218a17d3929c83450e9190255bda1f22f4001a7f33842999b79c27aa12fc11f286273 WHIRLPOOL 9ca2af7f823191aed523f1a0c44c59d1bfa70755c63fad6fe793ca808fe0f0409ee61f435a6db0f938b00cf38cf9230be8d2c22a45805396d5a19fbfe4d58376
+DIST uam-0.3.tar.bz2 58143 SHA256 fd31989ea9837edf9f26d07cf954f65fbbc00b0c97184fc84670f365df6c270b SHA512 6b5ce8b37ea7b430a492c4411ac005d6555e49bbc4849ae03c5bb16e7dd89e8cac32349dfa0507f01cc6b22bdb111eda69471141da4952f8425f9390035c6085 WHIRLPOOL 47874c1184cf08c3cd53b6e9cd5c7d1ed7ed33466974e23c6fb14cd2612c605567a034902f2ebea1f9e49c56c962b6eebc8e34a3b8fa6f055539f487ff056496
diff --git a/sys-apps/uam/metadata.xml b/sys-apps/uam/metadata.xml
new file mode 100644
index 000000000000..9ac331c9a557
--- /dev/null
+++ b/sys-apps/uam/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>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <longdescription>
+ A set of udev rules and scripts to mount USB media automatically
+ as soon as they are inserted. Features flexible configuration,
+ including mountpoint naming rules, and hooks.
+ </longdescription>
+ <upstream>
+ <maintainer status="active">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <bugs-to>https://bitbucket.org/mgorny/uam/issues/</bugs-to>
+ <remote-id type="bitbucket">mgorny/uam</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/uam/uam-0.3.1.ebuild b/sys-apps/uam/uam-0.3.1.ebuild
new file mode 100644
index 000000000000..b9c413bd2649
--- /dev/null
+++ b/sys-apps/uam/uam-0.3.1.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 autotools-utils udev user
+
+DESCRIPTION="Simple udev-based automounter for removable USB media"
+HOMEPAGE="https://bitbucket.org/mgorny/uam/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_postinst() {
+ # The plugdev group is created by pam, pmount and many other ebuilds
+ # in gx86. As we don't want to depend on any of them (even pmount is
+ # optional), we create it ourself too.
+ enewgroup plugdev
+
+ elog "To be able to access uam-mounted filesystems, you have to be"
+ elog "a member of the 'plugdev' group."
+ elog
+ elog "Note that uam doesn't provide any way to allow unprivileged user"
+ elog "to manually umount devices. The upstream suggested solution"
+ elog "is to use [sys-apps/pmount]. If you don't feel like installing"
+ elog "additional tools, remember to sync before removing your USB stick."
+ elog
+ elog "If you'd like uam to mount ejectable media like CDs/DVDs, you need"
+ elog "to enable in-kernel media polling, e.g.:"
+ elog " echo 5000 > /sys/module/block/parameters/events_dfl_poll_msecs"
+ elog "where 5000 would mean a poll will occur every 5 seconds."
+ elog
+ elog "If you'd like to receive libnotify-based notifications, you need"
+ elog "to install the [x11-misc/sw-notify-send] tool."
+
+ udev_reload
+}
diff --git a/sys-apps/uam/uam-0.3.2.ebuild b/sys-apps/uam/uam-0.3.2.ebuild
new file mode 100644
index 000000000000..1efc74887912
--- /dev/null
+++ b/sys-apps/uam/uam-0.3.2.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 autotools-utils udev user
+
+DESCRIPTION="Simple udev-based automounter for removable USB media"
+HOMEPAGE="https://bitbucket.org/mgorny/uam/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+pkg_postinst() {
+ # The plugdev group is created by pam, pmount and many other ebuilds
+ # in gx86. As we don't want to depend on any of them (even pmount is
+ # optional), we create it ourself too.
+ enewgroup plugdev
+
+ elog "To be able to access uam-mounted filesystems, you have to be"
+ elog "a member of the 'plugdev' group."
+ elog
+ elog "Note that uam doesn't provide any way to allow unprivileged user"
+ elog "to manually umount devices. The upstream suggested solution"
+ elog "is to use [sys-apps/pmount]. If you don't feel like installing"
+ elog "additional tools, remember to sync before removing your USB stick."
+ elog
+ elog "If you'd like uam to mount ejectable media like CDs/DVDs, you need"
+ elog "to enable in-kernel media polling, e.g.:"
+ elog " echo 5000 > /sys/module/block/parameters/events_dfl_poll_msecs"
+ elog "where 5000 would mean a poll will occur every 5 seconds."
+ elog
+ elog "If you'd like to receive libnotify-based notifications, you need"
+ elog "to install the [x11-misc/sw-notify-send] tool."
+
+ udev_reload
+}
diff --git a/sys-apps/uam/uam-0.3.ebuild b/sys-apps/uam/uam-0.3.ebuild
new file mode 100644
index 000000000000..e435b5181420
--- /dev/null
+++ b/sys-apps/uam/uam-0.3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils user
+
+DESCRIPTION="Simple udev-based automounter for removable USB media"
+HOMEPAGE="https://bitbucket.org/mgorny/uam/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( NEWS README )
+
+pkg_postinst() {
+ # The plugdev group is created by pam, pmount and many other ebuilds
+ # in gx86. As we don't want to depend on any of them (even pmount is
+ # optional), we create it ourself too.
+ enewgroup plugdev
+
+ elog "To be able to access uam-mounted filesystems, you have to be"
+ elog "a member of the 'plugdev' group."
+ elog
+ elog "Note that uam doesn't provide any way to allow unprivileged user"
+ elog "to manually umount devices. The upstream suggested solution"
+ elog "is to use [sys-apps/pmount]. If you don't feel like installing"
+ elog "additional tools, remember to sync before removing your USB stick."
+ elog
+ elog "If you'd like uam to mount ejectable media like CDs/DVDs, you need"
+ elog "to enable in-kernel media polling, e.g.:"
+ elog " echo 5000 > /sys/module/block/parameters/events_dfl_poll_msecs"
+ elog "where 5000 would mean a poll will occur every 5 seconds."
+ elog
+ elog "If you'd like to receive libnotify-based notifications, you need"
+ elog "to install the [x11-misc/sw-notify-send] tool."
+
+ if [[ -e "${EROOT}"/dev/.udev ]]; then
+ ebegin "Calling udev to reload its rules"
+ udevadm control --reload-rules
+ eend $?
+ fi
+}
diff --git a/sys-apps/uam/uam-9999.ebuild b/sys-apps/uam/uam-9999.ebuild
new file mode 100644
index 000000000000..caec43f14f3a
--- /dev/null
+++ b/sys-apps/uam/uam-9999.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#if LIVE
+AUTOTOOLS_AUTORECONF=yes
+EGIT_REPO_URI="http://bitbucket.org/mgorny/${PN}.git"
+
+inherit git-r3
+#endif
+
+inherit autotools-utils udev user
+
+DESCRIPTION="Simple udev-based automounter for removable USB media"
+HOMEPAGE="https://bitbucket.org/mgorny/uam/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+#if LIVE
+KEYWORDS=
+SRC_URI=
+#endif
+
+pkg_postinst() {
+ # The plugdev group is created by pam, pmount and many other ebuilds
+ # in gx86. As we don't want to depend on any of them (even pmount is
+ # optional), we create it ourself too.
+ enewgroup plugdev
+
+ elog "To be able to access uam-mounted filesystems, you have to be"
+ elog "a member of the 'plugdev' group."
+ elog
+ elog "Note that uam doesn't provide any way to allow unprivileged user"
+ elog "to manually umount devices. The upstream suggested solution"
+ elog "is to use [sys-apps/pmount]. If you don't feel like installing"
+ elog "additional tools, remember to sync before removing your USB stick."
+ elog
+ elog "If you'd like uam to mount ejectable media like CDs/DVDs, you need"
+ elog "to enable in-kernel media polling, e.g.:"
+ elog " echo 5000 > /sys/module/block/parameters/events_dfl_poll_msecs"
+ elog "where 5000 would mean a poll will occur every 5 seconds."
+ elog
+ elog "If you'd like to receive libnotify-based notifications, you need"
+ elog "to install the [x11-misc/sw-notify-send] tool."
+
+ udev_reload
+}
diff --git a/sys-apps/ucspi-proxy/Manifest b/sys-apps/ucspi-proxy/Manifest
new file mode 100644
index 000000000000..5195bf9c1465
--- /dev/null
+++ b/sys-apps/ucspi-proxy/Manifest
@@ -0,0 +1,3 @@
+DIST ucspi-proxy-0.97.tar.gz 26717 SHA256 14f76fc17b63143245b6a6af86d0d2159c7552e89da40009cccab397cdf8a93b
+DIST ucspi-proxy-0.98.tar.gz 35278 SHA256 bcdae7bc9443f1410b53808839c5af4ce41a398ef17a32287a76749f052f54d2 SHA512 db767fd19825753107965a3f8a7e8c588e053fb911b3cbe1060684e6100244f9ce720f73e97bdfb26a3af00f6dda2a011866f7e5008ff7edca71b0fe3319da1b WHIRLPOOL 8adc0d4a5ded66cc4aaceb6e98563b6dff8ae126add1b03e078da9d5463a9ba5d9529f7039e75527f46e1996c3920c7f5711b32b94e0ced5d0ef277d12f53f56
+DIST ucspi-proxy-0.99.tar.gz 35537 SHA256 42943e978f51875e587567c552d349e058b983723c0d80756d1816e3ad560beb SHA512 5bed82bd0db2501c3de8b38e23a07c39bf9937b9ce95166cf1822a6bd5551aec945dc01d6ba716d7ce35f4aa7f2a126d860d31f7df2d807f1f4eb5e355e93164 WHIRLPOOL 983cb72b72a1dba1b221a54f0bc314b8a016d3a3fea94b2e9996903d87b223b93b417bf306ba6a9fe418b08fa1c7fab743e63a5ae75712c9685b90e5f4d4dfd3
diff --git a/sys-apps/ucspi-proxy/metadata.xml b/sys-apps/ucspi-proxy/metadata.xml
new file mode 100644
index 000000000000..2b14dbd77d85
--- /dev/null
+++ b/sys-apps/ucspi-proxy/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>
+<longdescription lang="en">
+This package contains a proxy program that passes data back and forth
+between two connections set up by a UCSPI server and a UCSPI client.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/ucspi-proxy/ucspi-proxy-0.97.ebuild b/sys-apps/ucspi-proxy/ucspi-proxy-0.97.ebuild
new file mode 100644
index 000000000000..145443c6b172
--- /dev/null
+++ b/sys-apps/ucspi-proxy/ucspi-proxy-0.97.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit toolchain-funcs
+
+DESCRIPTION="A proxy program for two connections set up by a UCSPI server and a UCSPI client"
+HOMEPAGE="http://untroubled.org/ucspi-proxy/"
+SRC_URI="${HOMEPAGE}archive/${P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+IUSE=""
+DEPEND=">=dev-libs/bglibs-1.025"
+RDEPEND="${DEPEND}"
+
+src_compile() {
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+ echo "${D}/usr/bin" > conf-bin
+ echo "${D}/usr/share/man/" > conf-man
+ echo "/usr/include/bglibs/" > conf-bgincs
+ echo "/usr/lib/bglibs/" > conf-bglibs
+ emake || die
+}
+
+src_install() {
+ einstall || die
+ dodoc ANNOUNCEMENT NEWS README TODO
+}
diff --git a/sys-apps/ucspi-proxy/ucspi-proxy-0.98.ebuild b/sys-apps/ucspi-proxy/ucspi-proxy-0.98.ebuild
new file mode 100644
index 000000000000..294ee53df0ec
--- /dev/null
+++ b/sys-apps/ucspi-proxy/ucspi-proxy-0.98.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit toolchain-funcs multilib
+
+DESCRIPTION="proxy program for two connections set up by a UCSPI server and a UCSPI client"
+HOMEPAGE="http://untroubled.org/ucspi-proxy/"
+SRC_URI="http://untroubled.org/ucspi-proxy/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/bglibs-1.106"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -i -e '/^>bin$/ac:::755::ucspi-proxy' INSTHIER
+}
+
+src_configure() {
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+ echo "${D}/usr/bin" > conf-bin
+ echo "${D}/usr/share/man" > conf-man
+ echo "/usr/include/bglibs" > conf-bgincs
+ echo "/usr/$(get_libdir)/bglibs" > conf-bglibs
+}
+
+src_install() {
+ einstall || die
+ dodoc ANNOUNCEMENT NEWS README TODO
+}
diff --git a/sys-apps/ucspi-proxy/ucspi-proxy-0.99.ebuild b/sys-apps/ucspi-proxy/ucspi-proxy-0.99.ebuild
new file mode 100644
index 000000000000..846228186593
--- /dev/null
+++ b/sys-apps/ucspi-proxy/ucspi-proxy-0.99.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 toolchain-funcs multilib
+
+DESCRIPTION="proxy program for two connections set up by a UCSPI server and a UCSPI client"
+HOMEPAGE="http://untroubled.org/ucspi-proxy/"
+SRC_URI="http://untroubled.org/ucspi-proxy/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/bglibs-1.106"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ sed -i -e '/^>bin$/ac:::755::ucspi-proxy' INSTHIER
+}
+
+src_configure() {
+ echo "$(tc-getCC) ${CFLAGS}" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS}" > conf-ld
+ echo "${D}/usr/bin" > conf-bin
+ echo "${D}/usr/share/man" > conf-man
+ echo "/usr/include/bglibs" > conf-bgincs
+ echo "/usr/$(get_libdir)/bglibs" > conf-bglibs
+}
diff --git a/sys-apps/ucspi-ssl/Manifest b/sys-apps/ucspi-ssl/Manifest
new file mode 100644
index 000000000000..f169828b2b8a
--- /dev/null
+++ b/sys-apps/ucspi-ssl/Manifest
@@ -0,0 +1 @@
+DIST ucspi-ssl-0.94.tgz 112640 SHA256 343c0281269d88650823eb053fe80bf34b81f52c12b895f27534706b983a23b4 SHA512 a2b7fcea0da4c99a02cd0cf9402d59e55309a65031232e8afc9f29134be268c2e385840f5616c2046649a3f421563f1abcb707a8a8e93c7d29e7aef4a368b604 WHIRLPOOL 1ef3f5b447810eab97532b7fabaf94c56ddd0818a51f1149ec31ad2265c8899e90c3cf5c497a1c3570fc83918576abca2103132db3a494181ea2a872590fadb2
diff --git a/sys-apps/ucspi-ssl/metadata.xml b/sys-apps/ucspi-ssl/metadata.xml
new file mode 100644
index 000000000000..adbdc3c6c190
--- /dev/null
+++ b/sys-apps/ucspi-ssl/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>proxy-maintainers</herd>
+ <maintainer>
+ <email>powerman-asdf@yandex.ru</email>
+ <description>Primary maintainer</description>
+ <name>Alex Efros</name>
+ </maintainer>
+<longdescription>sslserver and sslclient are command-line tools for building SSL
+client-server applications. They conform to the UNIX Client-Server Program
+Interface, UCSPI.</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/ucspi-ssl/ucspi-ssl-0.94-r1.ebuild b/sys-apps/ucspi-ssl/ucspi-ssl-0.94-r1.ebuild
new file mode 100644
index 000000000000..04681e2b5433
--- /dev/null
+++ b/sys-apps/ucspi-ssl/ucspi-ssl-0.94-r1.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 fixheadtails qmail
+
+DESCRIPTION="Command-line tools for building SSL client-server applications"
+HOMEPAGE="http://www.fehcom.de/ipnet/ucspi-ssl.html"
+SRC_URI="http://www.fehcom.de/ipnet/ucspi-ssl/${P}.tgz"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+IUSE="perl"
+
+DEPEND="
+ >=dev-libs/openssl-0.9.6g:=
+ perl? ( dev-lang/perl:= )
+"
+RDEPEND="
+ ${DEPEND}
+ sys-apps/ucspi-tcp
+"
+
+S="${WORKDIR}"/host/superscript.com/net/${P}/src
+
+src_prepare() {
+ ht_fix_all
+ sed -i -e 's:HOME/command:/usr/bin:' sslcat.sh sslconnect.sh https\@.sh || die
+ sed -i -e 's:auto:gcc:' conf-cc || die
+ sed -i -e 's:-m64::' conf-ld || die
+
+ qmail_set_cc
+
+ echo "/usr/bin" > conf-tcpbin || die
+ echo "/usr/" > home || die
+ echo "/usr/share/ca-certificates/" > conf-cadir || die
+ echo "${QMAIL_HOME}/control/dh1024.pem" > conf-dhfile || die
+}
+
+src_compile() {
+ # build fails without setting to j1
+ emake -j1
+}
+
+src_install() {
+ dodoc ../doc/*
+ doman ../man/*.*
+ dobin sslserver sslclient sslcat sslconnect https\@ || die
+ use perl && dobin sslperl
+}
diff --git a/sys-apps/ucspi-tcp/Manifest b/sys-apps/ucspi-tcp/Manifest
new file mode 100644
index 000000000000..c5e1d64219c9
--- /dev/null
+++ b/sys-apps/ucspi-tcp/Manifest
@@ -0,0 +1,5 @@
+DIST ucspi-rss.diff 1828 SHA256 5101354eb86d8e11edefd7b83df4e9c274a55b845f4cb2ce36dda912aced56f4 SHA512 643514c57570fc0b4e817b07e6d26e831cec5b4657c3d1b9948bd90267fe370a340b911897d575eb94192e24ba71a03ac68ceb2774ef7c0e7ff819c5b4285bc3 WHIRLPOOL 9fd5735f31de2918b0bd8c5e9d9ff19af5f90a02328d4932c08ab72872257cac8b531ad15d61504eb111112f59581fc96e78e63973c4fe9d21316e20972c9bda
+DIST ucspi-tcp-0.88-ipv6.diff19.bz2 22632 SHA256 35952cd290d714452c840580126004cbae8db65b1632df67ac9c8fad7d1f9ace SHA512 58e38f9437b03aab121c5c1b9260806b5abd5a72bf22d14468955d6ff7ad2fb2ab285cb7a37b5dc3a568389aa02b8b3ecff0026b49a097ea86cfd340f2b38000 WHIRLPOOL 9d7dffc707011c178b2a2245598005ef0c20b2dad86ff9c34f5ccebe2a4702c8dda1e32103a85dc9b60d8343a05af1f1b333b59b00a02e5611c1d16bc593fe87
+DIST ucspi-tcp-0.88-man.tar.gz 7562 SHA256 09b1dd69ca3722b62c030abb27df9560cb72ff5d6247e4628e0c61e957b408ef SHA512 e779d6d6b24a3af0edc362def229c657c704143e5f1dfba8d16d26b3e6bcacb9c8ceaabcccac61485a4719221c144bc0c36ebca5182985dca85a6d72101d4146 WHIRLPOOL de321315bd7998af4fe7a85c7cd27dc62de7b1977e64f8a703e6e08ff69f451da8b20c34a8e2251bd63c535244799ddb1afdeff8bff7d98303e99dfd4e455f06
+DIST ucspi-tcp-0.88-rblspp.patch 6565 SHA256 68aeeb8482be71d9b7dd15d97a2855af34b6b8401fa598207f8de93ccdbb03e9 SHA512 f3212d9d3bb59ec3b1f2b2bd09a80dce1eeeaf082dea68f18350a3aef818ef221eccfeb4dc7afff5c3f9e59003ec40f5e37fff86a2a5ab3145be1fe81297c990 WHIRLPOOL e49c04147269076416a74f5951e398ef71b76a5c825f527fc85e9b3be68b061f353f5bfe01a9ff92c26a7cd11a30273cafc353ed491f1fa0897c4cef3e7ae72a
+DIST ucspi-tcp-0.88.tar.gz 53019 SHA256 4a0615cab74886f5b4f7e8fd32933a07b955536a3476d74ea087a3ea66a23e9c SHA512 44efbd477dacf31d39fc970e2d2f74526dc815b905742f6127f0d5c80928ecc7e743089eaab0492386a58d5b97905113fbe8bbc7214ae179b7be27966b7566c7 WHIRLPOOL 6e15e0139b10a5668af0ae7bfa903556f39f81bb42c12255c0b8738a14e9be92f1775600b318fb0926aea295b25e6383428200191237393bfaa69d5da5d909eb
diff --git a/sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch b/sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch
new file mode 100644
index 000000000000..e6c8ba32f9d0
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch
@@ -0,0 +1,27 @@
+--- a/Makefile
++++ b/Makefile
+@@ -394,12 +394,14 @@
+ ) > load
+ chmod 755 load
+
++AR ?= ar
++RANLIB ?= ranlib
+ makelib: \
+ warn-auto.sh systype
+ ( cat warn-auto.sh; \
+ echo 'main="$$1"; shift'; \
+ echo 'rm -f "$$main"'; \
+- echo 'ar cr "$$main" $${1+"$$@"}'; \
++ echo '$(AR) cr "$$main" $${1+"$$@"}'; \
+ case "`cat systype`" in \
+ sunos-5.*) ;; \
+ unix_sv*) ;; \
+@@ -408,7 +410,7 @@
+ dgux-*) ;; \
+ hp-ux-*) ;; \
+ sco*) ;; \
+- *) echo 'ranlib "$$main"' ;; \
++ *) echo '$(RANLIB) "$$main"' ;; \
+ esac \
+ ) > makelib
+ chmod 755 makelib
diff --git a/sys-apps/ucspi-tcp/files/0.88-bigendian.patch b/sys-apps/ucspi-tcp/files/0.88-bigendian.patch
new file mode 100644
index 000000000000..c5884b883c13
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-bigendian.patch
@@ -0,0 +1,18 @@
+https://bugs.gentoo.org/18892
+
+patch by Michael Hanselmann <hansmi@gentoo.org>
+
+--- a/tcpserver.c
++++ b/tcpserver.c
+@@ -422,7 +422,11 @@
+ se = getservbyname(x,"tcp");
+ if (!se)
+ strerr_die3x(111,FATAL,"unable to figure out port number for ",x);
++#if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN
++ localport = ntohs(se->s_port);
++#else
+ uint16_unpack_big((char*)&se->s_port,&localport);
++#endif
+ }
+
+ if (!*argv) usage();
diff --git a/sys-apps/ucspi-tcp/files/0.88-errno.patch b/sys-apps/ucspi-tcp/files/0.88-errno.patch
new file mode 100644
index 000000000000..0d15819b9390
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-errno.patch
@@ -0,0 +1,13 @@
+http://bugs.gentoo.org/16804
+
+--- a/error.h
++++ b/error.h
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
diff --git a/sys-apps/ucspi-tcp/files/0.88-exit.patch b/sys-apps/ucspi-tcp/files/0.88-exit.patch
new file mode 100644
index 000000000000..4925441b49d2
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-exit.patch
@@ -0,0 +1,10 @@
+Index: ucspi-tcp-0.88/tcprulescheck.c
+===================================================================
+--- ucspi-tcp-0.88.orig/tcprulescheck.c
++++ ucspi-tcp-0.88/tcprulescheck.c
+@@ -1,3 +1,5 @@
++#include <unistd.h>
++
+ #include "byte.h"
+ #include "buffer.h"
+ #include "strerr.h"
diff --git a/sys-apps/ucspi-tcp/files/0.88-large-responses.patch b/sys-apps/ucspi-tcp/files/0.88-large-responses.patch
new file mode 100644
index 000000000000..65fd8f534ef9
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-large-responses.patch
@@ -0,0 +1,26 @@
+12 Aug 2003; Robin H. Johnson <robbat2@gentoo.org>:
+
+allow larger responses
+
+--- a/rblsmtpd.c
++++ b/rblsmtpd.c
+@@ -163,7 +163,7 @@ void rblsmtpd(void)
+ else
+ if (!stralloc_copys(&message,"553 ")) nomem();
+
+- if (text.len > 200) text.len = 200;
++ if (text.len > 500) text.len = 500;
+ if (!stralloc_cat(&message,&text)) nomem();
+ for (i = 0;i < message.len;++i)
+ if ((message.s[i] < 32) || (message.s[i] > 126))
+--- a/rblspp.c
++++ b/rblspp.c
+@@ -142,7 +142,7 @@ void rblspp(void)
+ else
+ if (!stralloc_copys(&message,"E553 ")) nomem();
+
+- if (text.len > 200) text.len = 200;
++ if (text.len > 500) text.len = 500;
+ if (!stralloc_cat(&message,&text)) nomem();
+ for (i = 0;i < message.len;++i)
+ if ((message.s[i] < 32) || (message.s[i] > 126))
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch b/sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch
new file mode 100644
index 000000000000..7faa51260ab5
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch
@@ -0,0 +1,89 @@
+rely on standard POSIX headers to fix globs of warnings
+
+requires 0.88-protos.patch first
+
+--- a/FILES
++++ b/FILES
+@@ -222,7 +222,6 @@ dns_nd6.c
+ dns_sortip6.c
+ fmt_xlong.c
+ ip6_fmt.c
+-ip6_scan.c
+ scan_0x.c
+ socket_accept6.c
+ socket_bind6.c
+--- a/TARGETS
++++ b/TARGETS
+@@ -177,7 +177,6 @@ dns_nd6.o
+ dns_sortip6.o
+ fmt_xlong.o
+ ip6_fmt.o
+-ip6_scan.o
+ scan_0x.o
+ socket_accept6.o
+ socket_bind6.o
+--- a/ip6.h
++++ b/ip6.h
+@@ -4,10 +4,10 @@
+ #include "byte.h"
+
+ extern unsigned int scan_ip6(const char *src,char *ip);
+-extern unsigned int fmt_ip6(char *dest,const char *ip);
++extern unsigned int ip6_fmt(char *dest,char ip[16]);
+
+ extern unsigned int scan_ip6_flat(const char *src,char *);
+-extern unsigned int fmt_ip6_flat(char *dest,const char *);
++extern unsigned int ip6_fmt_flat(char *dest,char[16]);
+
+ /*
+ ip6 address syntax: (h = hex digit), no leading '0' required
+--- a/remoteinfo6.c
++++ b/remoteinfo6.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "fmt.h"
+ #include "buffer.h"
+ #include "socket.h"
+@@ -5,11 +6,12 @@
+ #include "iopause.h"
+ #include "timeoutconn.h"
+ #include "remoteinfo.h"
++#include "readwrite.h"
+
+ static struct taia now;
+ static struct taia deadline;
+
+-static int mywrite(int fd,char *buf,int len)
++static ssize_t mywrite(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+@@ -27,7 +29,7 @@ static int mywrite(int fd,char *buf,int len)
+ return write(fd,buf,len);
+ }
+
+-static int myread(int fd,char *buf,int len)
++static ssize_t myread(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+--- a/socket_tcp6.c
++++ b/socket_tcp6.c
+@@ -3,6 +3,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include "ndelay.h"
+ #include "socket.h"
+ #include "haveip6.h"
+--- a/dns.h
++++ b/dns.h
+@@ -87,6 +87,7 @@ extern int dns_ip4_qualify(stralloc *,stralloc *,const stralloc *);
+ extern int dns_ip6_qualify_rules(stralloc *,stralloc *,const stralloc *,const stralloc *);
+ extern int dns_ip6_qualify(stralloc *,stralloc *,const stralloc *);
+
++extern int dns_name6(stralloc *,char [16]);
+ extern int dns_name6_domain(char *,char *);
+ #define DNS_NAME6_DOMAIN (4*16+11)
+
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch b/sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch
new file mode 100644
index 000000000000..328f0369ebaf
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch
@@ -0,0 +1,36 @@
+rely on standard POSIX headers to fix globs of warnings
+
+fixes that overlap with the ipv6 patch
+
+--- a/error.h
++++ b/error.h
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
+--- a/dns_random.c
++++ b/dns_random.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "dns.h"
+ #include "taia.h"
+ #include "uint32.h"
+--- a/dns_rcrw.c
++++ b/dns_rcrw.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "taia.h"
+ #include "env.h"
+ #include "byte.h"
+--- a/dns_transmit.c
++++ b/dns_transmit.c
+@@ -1,3 +1,4 @@
++#include <sys/socket.h>
+ #include "socket.h"
+ #include "alloc.h"
+ #include "error.h"
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch b/sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch
new file mode 100644
index 000000000000..8007ce19b323
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch
@@ -0,0 +1,11 @@
+rely on standard POSIX headers to fix globs of warnings
+
+requires 0.88-protos.patch first
+
+--- a/rblspp.c
++++ b/rblspp.c
+@@ -1,3 +1,4 @@
++#include <stdlib.h>
+ #include "byte.h"
+ #include "str.h"
+ #include "scan.h"
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos.patch b/sys-apps/ucspi-tcp/files/0.88-protos.patch
new file mode 100644
index 000000000000..050fd1dd9d66
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos.patch
@@ -0,0 +1,544 @@
+rely on standard POSIX headers to fix globs of warnings
+
+--- a/tcprulescheck.c
++++ b/tcprulescheck.c
+@@ -1,3 +1,5 @@
++#include <unistd.h>
++
+ #include "byte.h"
+ #include "buffer.h"
+ #include "strerr.h"
+--- a/buffer.c
++++ b/buffer.c
+@@ -1,6 +1,6 @@
+ #include "buffer.h"
+
+-void buffer_init(buffer *s,int (*op)(),int fd,char *buf,unsigned int len)
++void buffer_init(buffer *s,ssize_t (*op)(),int fd,char *buf,unsigned int len)
+ {
+ s->x = buf;
+ s->fd = fd;
+--- a/buffer.h
++++ b/buffer.h
+@@ -1,6 +1,8 @@
+ #ifndef BUFFER_H
+ #define BUFFER_H
+
++#include <sys/types.h>
++
+ typedef struct buffer {
+ char *x;
+ unsigned int p;
+@@ -13,7 +15,7 @@ typedef struct buffer {
+ #define BUFFER_INSIZE 8192
+ #define BUFFER_OUTSIZE 8192
+
+-extern void buffer_init(buffer *,int (*)(),int,char *,unsigned int);
++extern void buffer_init(buffer *,ssize_t (*)(),int,char *,unsigned int);
+
+ extern int buffer_flush(buffer *);
+ extern int buffer_put(buffer *,char *,unsigned int);
+--- a/exit.h
++++ b/exit.h
+@@ -1,6 +1,6 @@
+ #ifndef EXIT_H
+ #define EXIT_H
+
+-extern void _exit();
++#include <unistd.h>
+
+ #endif
+--- a/install.c
++++ b/install.c
+@@ -1,3 +1,4 @@
++#include <sys/stat.h>
+ #include "buffer.h"
+ #include "strerr.h"
+ #include "error.h"
+--- a/readwrite.h
++++ b/readwrite.h
+@@ -1,7 +1,6 @@
+ #ifndef READWRITE_H
+ #define READWRITE_H
+
+-extern int read();
+-extern int write();
++#include <unistd.h>
+
+ #endif
+
+--- a/auto-str.c
++++ b/auto-str.c
+@@ -5,6 +5,7 @@
+ char bspace[256];
+ buffer b = BUFFER_INIT(write,1,bspace,sizeof bspace);
+
++#define puts _puts
+ void puts(char *s)
+ {
+ if (buffer_puts(&b,s) == -1) _exit(111);
+--- a/buffer.h
++++ b/buffer.h
+@@ -8,7 +8,7 @@ typedef struct buffer {
+ unsigned int p;
+ unsigned int n;
+ int fd;
+- int (*op)();
++ ssize_t (*op)();
+ } buffer;
+
+ #define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
+--- a/fd_copy.c
++++ b/fd_copy.c
+@@ -1,4 +1,5 @@
+ #include <fcntl.h>
++#include <unistd.h>
+ #include "fd.h"
+
+ int fd_copy(int to,int from)
+--- a/fd_move.c
++++ b/fd_move.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "fd.h"
+
+ int fd_move(int to,int from)
+--- a/socket_tcp.c
++++ b/socket_tcp.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- a/chkshsgr.c
++++ b/chkshsgr.c
+@@ -1,8 +1,9 @@
++#include <grp.h>
+ #include "exit.h"
+
+ main()
+ {
+- short x[4];
++ gid_t x[4];
+
+ x[0] = x[1] = 0;
+ if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
+--- a/prot.c
++++ b/prot.c
+@@ -1,10 +1,10 @@
+ #include "hasshsgr.h"
+ #include "prot.h"
+
+-int prot_gid(int gid)
++int prot_gid(gid_t gid)
+ {
+ #ifdef HASSHORTSETGROUPS
+- short x[2];
++ gid_t x[2];
+ x[0] = gid; x[1] = 73; /* catch errors */
+ if (setgroups(1,x) == -1) return -1;
+ #else
+@@ -13,7 +13,7 @@ int prot_gid(int gid)
+ return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
+ }
+
+-int prot_uid(int uid)
++int prot_uid(uid_t uid)
+ {
+ return setuid(uid);
+ }
+--- a/prot.h
++++ b/prot.h
+@@ -1,7 +1,10 @@
+ #ifndef PROT_H
+ #define PROT_H
+
+-extern int prot_gid(int);
+-extern int prot_uid(int);
++#include <unistd.h>
++#include <grp.h>
++
++extern int prot_gid(gid_t);
++extern int prot_uid(uid_t);
+
+ #endif
+--- a/fixcrio.c
++++ b/fixcrio.c
+@@ -6,6 +6,7 @@
+ #include "exit.h"
+ #include "iopause.h"
+ #include "pathexec.h"
++#include "fd.h"
+
+ #define FATAL "fixcrio: fatal: "
+
+--- a/hier.c
++++ b/hier.c
+@@ -1,5 +1,9 @@
+ #include "auto_home.h"
+
++extern void h(char *, int, int, int);
++extern void d(char *, char *, int, int, int);
++extern void c(char *, char *, char *, int, int, int);
++
+ void hier()
+ {
+ h(auto_home,-1,-1,02755);
+--- a/mconnect-io.c
++++ b/mconnect-io.c
+@@ -1,3 +1,4 @@
++#include <signal.h>
+ #include "sig.h"
+ #include "wait.h"
+ #include "fork.h"
+@@ -12,7 +13,7 @@ buffer bout;
+ char inbuf[512];
+ buffer bin;
+
+-int myread(int fd,char *buf,int len)
++ssize_t myread(int fd,char *buf,int len)
+ {
+ buffer_flush(&bout);
+ return read(fd,buf,len);
+--- a/tcprules.c
++++ b/tcprules.c
+@@ -1,3 +1,4 @@
++#include <stdio.h>
+ #include "strerr.h"
+ #include "stralloc.h"
+ #include "getln.h"
+@@ -6,6 +7,8 @@
+ #include "fmt.h"
+ #include "byte.h"
+ #include "cdb_make.h"
++#include "open.h"
++#include "scan.h"
+
+ #define FATAL "tcprules: fatal: "
+
+--- a/pathexec_run.c
++++ b/pathexec_run.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "error.h"
+ #include "stralloc.h"
+ #include "str.h"
+--- a/recordio.c
++++ b/recordio.c
+@@ -8,6 +8,7 @@
+ #include "fmt.h"
+ #include "iopause.h"
+ #include "pathexec.h"
++#include "fd.h"
+
+ #define FATAL "recordio: fatal: "
+
+--- a/seek_set.c
++++ b/seek_set.c
+@@ -1,7 +1,6 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include "seek.h"
+
+-#define SET 0 /* sigh */
+-
+ int seek_set(int fd,seek_pos pos)
+-{ if (lseek(fd,(off_t) pos,SET) == -1) return -1; return 0; }
++{ if (lseek(fd,(off_t) pos,SEEK_SET) == -1) return -1; return 0; }
+--- a/socket_udp.c
++++ b/socket_udp.c
+@@ -2,6 +2,7 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <unistd.h>
+ #include "ndelay.h"
+ #include "socket.h"
+
+--- a/tcprulescheck.c
++++ b/tcprulescheck.c
+@@ -5,6 +5,7 @@
+ #include "strerr.h"
+ #include "env.h"
+ #include "rules.h"
++#include "open.h"
+
+ void found(char *data,unsigned int datalen)
+ {
+
+the prototypes are added near the top to avoid conflicts w/ipv6 patch
+
+--- a/socket.h
++++ b/socket.h
+@@ -3,6 +3,9 @@
+ #ifndef SOCKET_H
+ #define SOCKET_H
+
++extern int socket_tcpnodelay(int);
++extern int socket_ipoptionskill(int);
++
+ #include "uint16.h"
+
+ extern int socket_tcp(void);
+--- a/remoteinfo.c
++++ b/remoteinfo.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "fmt.h"
+ #include "buffer.h"
+ #include "socket.h"
+@@ -5,11 +6,12 @@
+ #include "iopause.h"
+ #include "timeoutconn.h"
+ #include "remoteinfo.h"
++#include "readwrite.h"
+
+ static struct taia now;
+ static struct taia deadline;
+
+-static int mywrite(int fd,char *buf,int len)
++static ssize_t mywrite(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+@@ -27,7 +29,7 @@ static int mywrite(int fd,char *buf,int len)
+ return write(fd,buf,len);
+ }
+
+-static int myread(int fd,char *buf,int len)
++static ssize_t myread(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+--- a/alloc.c
++++ b/alloc.c
+@@ -1,7 +1,5 @@
+ #include "alloc.h"
+ #include "error.h"
+-extern char *malloc();
+-extern void free();
+
+ #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
+ #define SPACE 2048 /* must be multiple of ALIGNMENT */
+--- a/alloc.h
++++ b/alloc.h
+@@ -1,8 +1,10 @@
+ #ifndef ALLOC_H
+ #define ALLOC_H
+
+-extern /*@null@*//*@out@*/char *alloc();
+-extern void alloc_free();
++#include <stdlib.h>
++
++extern /*@null@*//*@out@*/char *alloc(unsigned int);
++extern void alloc_free(char *);
+ extern int alloc_re();
+
+ #endif
+--- a/buffer_0.c
++++ b/buffer_0.c
+@@ -1,7 +1,7 @@
+ #include "readwrite.h"
+ #include "buffer.h"
+
+-int buffer_0_read(fd,buf,len) int fd; char *buf; int len;
++ssize_t buffer_0_read(fd,buf,len) int fd; char *buf; int len;
+ {
+ if (buffer_flush(buffer_1) == -1) return -1;
+ return read(fd,buf,len);
+--- a/buffer_get.c
++++ b/buffer_get.c
+@@ -2,7 +2,7 @@
+ #include "byte.h"
+ #include "error.h"
+
+-static int oneread(int (*op)(),int fd,char *buf,unsigned int len)
++static int oneread(ssize_t (*op)(),int fd,char *buf,unsigned int len)
+ {
+ int r;
+
+--- a/buffer_put.c
++++ b/buffer_put.c
+@@ -3,7 +3,7 @@
+ #include "byte.h"
+ #include "error.h"
+
+-static int allwrite(int (*op)(),int fd,char *buf,unsigned int len)
++static int allwrite(ssize_t (*op)(),int fd,char *buf,unsigned int len)
+ {
+ int w;
+
+--- a/case.h
++++ b/case.h
+@@ -4,7 +4,7 @@
+ extern void case_lowers(char *);
+ extern void case_lowerb(char *,unsigned int);
+ extern int case_diffs(char *,char *);
+-extern int case_diffb(char *,unsigned int,char *);
++extern int case_diffb(const char *,unsigned int,const char *);
+ extern int case_starts(char *,char *);
+ extern int case_startb(char *,unsigned int,char *);
+
+--- a/case_diffb.c
++++ b/case_diffb.c
+@@ -1,6 +1,6 @@
+ #include "case.h"
+
+-int case_diffb(register char *s,register unsigned int len,register char *t)
++int case_diffb(register const char *s,register unsigned int len,const register char *t)
+ {
+ register unsigned char x;
+ register unsigned char y;
+--- a/open.h
++++ b/open.h
+@@ -1,10 +1,10 @@
+ #ifndef OPEN_H
+ #define OPEN_H
+
+-extern int open_read(char *);
+-extern int open_excl(char *);
+-extern int open_append(char *);
+-extern int open_trunc(char *);
+-extern int open_write(char *);
++extern int open_read(const char *);
++extern int open_excl(const char *);
++extern int open_append(const char *);
++extern int open_trunc(const char *);
++extern int open_write(const char *);
+
+ #endif
+--- a/open_read.c
++++ b/open_read.c
+@@ -2,5 +2,5 @@
+ #include <fcntl.h>
+ #include "open.h"
+
+-int open_read(char *fn)
++int open_read(const char *fn)
+ { return open(fn,O_RDONLY | O_NDELAY); }
+--- a/open_trunc.c
++++ b/open_trunc.c
+@@ -2,5 +2,5 @@
+ #include <fcntl.h>
+ #include "open.h"
+
+-int open_trunc(char *fn)
++int open_trunc(const char *fn)
+ { return open(fn,O_WRONLY | O_NDELAY | O_TRUNC | O_CREAT,0644); }
+--- a/open_write.c
++++ b/open_write.c
+@@ -2,5 +2,5 @@
+ #include <fcntl.h>
+ #include "open.h"
+
+-int open_write(char *fn)
++int open_write(const char *fn)
+ { return open(fn,O_WRONLY | O_NDELAY); }
+--- a/openreadclose.c
++++ b/openreadclose.c
+@@ -3,7 +3,7 @@
+ #include "readclose.h"
+ #include "openreadclose.h"
+
+-int openreadclose(char *fn,stralloc *sa,unsigned int bufsize)
++int openreadclose(const char *fn,stralloc *sa,unsigned int bufsize)
+ {
+ int fd;
+ fd = open_read(fn);
+--- a/openreadclose.h
++++ b/openreadclose.h
+@@ -3,6 +3,6 @@
+
+ #include "stralloc.h"
+
+-extern int openreadclose(char *,stralloc *,unsigned int);
++extern int openreadclose(const char *,stralloc *,unsigned int);
+
+ #endif
+--- a/stralloc.h
++++ b/stralloc.h
+@@ -7,7 +7,7 @@ GEN_ALLOC_typedef(stralloc,char,s,len,a)
+
+ extern int stralloc_ready(stralloc *,unsigned int);
+ extern int stralloc_readyplus(stralloc *,unsigned int);
+-extern int stralloc_copy(stralloc *,stralloc *);
++extern int stralloc_copy(stralloc *,const stralloc *);
+ extern int stralloc_cat(stralloc *,stralloc *);
+ extern int stralloc_copys(stralloc *,const char *);
+ extern int stralloc_cats(stralloc *,const char *);
+--- a/stralloc_copy.c
++++ b/stralloc_copy.c
+@@ -1,7 +1,7 @@
+ #include "byte.h"
+ #include "stralloc.h"
+
+-int stralloc_copy(stralloc *sato,stralloc *safrom)
++int stralloc_copy(stralloc *sato,const stralloc *safrom)
+ {
+ return stralloc_copyb(sato,safrom->s,safrom->len);
+ }
+--- a/taia.h
++++ b/taia.h
+@@ -19,7 +19,7 @@ extern double taia_frac(struct taia *);
+ extern void taia_add(struct taia *,struct taia *,struct taia *);
+ extern void taia_sub(struct taia *,struct taia *,struct taia *);
+ extern void taia_half(struct taia *,struct taia *);
+-extern int taia_less(struct taia *,struct taia *);
++extern int taia_less(const struct taia *,const struct taia *);
+
+ #define TAIA_PACK 16
+ extern void taia_pack(char *,struct taia *);
+--- a/taia_less.c
++++ b/taia_less.c
+@@ -2,7 +2,7 @@
+
+ /* XXX: breaks tai encapsulation */
+
+-int taia_less(struct taia *t,struct taia *u)
++int taia_less(const struct taia *t,const struct taia *u)
+ {
+ if (t->sec.x < u->sec.x) return 1;
+ if (t->sec.x > u->sec.x) return 0;
+--- a/uint32.h1
++++ b/uint32.h1
+@@ -5,7 +5,7 @@ typedef unsigned int uint32;
+
+ extern void uint32_pack(char *,uint32);
+ extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(char *,uint32 *);
+-extern void uint32_unpack_big(char *,uint32 *);
++extern void uint32_unpack(const char *,uint32 *);
++extern void uint32_unpack_big(const char *,uint32 *);
+
+ #endif
+--- a/uint32.h2
++++ b/uint32.h2
+@@ -5,7 +5,7 @@ typedef unsigned long uint32;
+
+ extern void uint32_pack(char *,uint32);
+ extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(char *,uint32 *);
+-extern void uint32_unpack_big(char *,uint32 *);
++extern void uint32_unpack(const char *,uint32 *);
++extern void uint32_unpack_big(const char *,uint32 *);
+
+ #endif
+--- a/uint32_unpack.c
++++ b/uint32_unpack.c
+@@ -1,6 +1,6 @@
+ #include "uint32.h"
+
+-void uint32_unpack(char s[4],uint32 *u)
++void uint32_unpack(const char s[4],uint32 *u)
+ {
+ uint32 result;
+
+@@ -15,7 +15,7 @@ void uint32_unpack(char s[4],uint32 *u)
+ *u = result;
+ }
+
+-void uint32_unpack_big(char s[4],uint32 *u)
++void uint32_unpack_big(const char s[4],uint32 *u)
+ {
+ uint32 result;
+
diff --git a/sys-apps/ucspi-tcp/files/0.88-rblsmtpd-ignore-on-RELAYCLIENT.patch b/sys-apps/ucspi-tcp/files/0.88-rblsmtpd-ignore-on-RELAYCLIENT.patch
new file mode 100644
index 000000000000..cd75a71000c7
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-rblsmtpd-ignore-on-RELAYCLIENT.patch
@@ -0,0 +1,25 @@
+--- rblsmtpd.c 2005-01-30 16:28:09.000000000 +0100
++++ rblsmtpd.c 2005-01-30 16:30:52.000000000 +0100
+@@ -195,6 +195,7 @@
+ {
+ int flagwantdefaultrbl = 1;
+ char *x;
++ char *y;
+ int opt;
+
+ ip_init();
+@@ -213,6 +214,13 @@
+ }
+ }
+
++ y = env_get("RELAYCLIENT");
++ if (y) {
++ if (!*y) {
++ decision = 1;
++ }
++ }
++
+ while ((opt = getopt(argc,argv,"bBcCt:r:a:")) != opteof)
+ switch(opt) {
+ case 'b': flagrblbounce = 1; break;
+
diff --git a/sys-apps/ucspi-tcp/files/0.88-tcprules.patch b/sys-apps/ucspi-tcp/files/0.88-tcprules.patch
new file mode 100644
index 000000000000..2986fdeed0f2
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-tcprules.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/90679
+
+patch by Michael Hanselmann <hansmi@gentoo.org>
+
+--- a/tcprules.c
++++ b/tcprules.c
+@@ -127,6 +127,9 @@
+ for (;;) {
+ int tmp;
+ tmp = byte_chr(x + colon,len - colon,':');
++ if (colon == 0 && tmp == len) {
++ strerr_die2x(111, FATAL, "Unable to find colon on non-empty line.");
++ }
+ colon += tmp;
+ if (colon == len) continue;
+ if (byte_equal(x+colon+1,4,"deny") || byte_equal(x+colon+1,5,"allow")) break;
diff --git a/sys-apps/ucspi-tcp/files/0.88-uint-headers.patch b/sys-apps/ucspi-tcp/files/0.88-uint-headers.patch
new file mode 100644
index 000000000000..3b637f56b292
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-uint-headers.patch
@@ -0,0 +1,133 @@
+use stdint.h rather than hand guessing the underlying size
+
+--- a/tryulong32.c
++++ /dev/null
+@@ -1,11 +0,0 @@
+-main()
+-{
+- unsigned long u;
+- u = 1;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- if (!u) _exit(0);
+- _exit(1);
+-}
+--- a/tryulong64.c
++++ /dev/null
+@@ -1,11 +0,0 @@
+-main()
+-{
+- unsigned long u;
+- u = 1;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- if (!u) _exit(1);
+- _exit(0);
+-}
+--- a/uint32.h1
++++ /dev/null
+@@ -1,11 +0,0 @@
+-#ifndef UINT32_H
+-#define UINT32_H
+-
+-typedef unsigned int uint32;
+-
+-extern void uint32_pack(char *,uint32);
+-extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(const char *,uint32 *);
+-extern void uint32_unpack_big(const char *,uint32 *);
+-
+-#endif
+--- a/uint32.h2
++++ /dev/null
+@@ -1,11 +0,0 @@
+-#ifndef UINT32_H
+-#define UINT32_H
+-
+-typedef unsigned long uint32;
+-
+-extern void uint32_pack(char *,uint32);
+-extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(const char *,uint32 *);
+-extern void uint32_unpack_big(const char *,uint32 *);
+-
+-#endif
+--- a/uint64.h1
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#ifndef UINT64_H
+-#define UINT64_H
+-
+-/* sysdep: -ulong64 */
+-
+-typedef unsigned long long uint64;
+-
+-#endif
+--- a/uint64.h2
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#ifndef UINT64_H
+-#define UINT64_H
+-
+-/* sysdep: +ulong64 */
+-
+-typedef unsigned long uint64;
+-
+-#endif
+--- /dev/null
++++ b/uint32.h
+@@ -0,0 +1,12 @@
++#ifndef UINT32_H
++#define UINT32_H
++
++#include <stdint.h>
++typedef uint32_t uint32;
++
++extern void uint32_pack(char *,uint32);
++extern void uint32_pack_big(char *,uint32);
++extern void uint32_unpack(const char *,uint32 *);
++extern void uint32_unpack_big(const char *,uint32 *);
++
++#endif
+--- /dev/null
++++ b/uint64.h
+@@ -0,0 +1,8 @@
++#ifndef UINT64_H
++#define UINT64_H
++
++#include <stdint.h>
++
++typedef uint64_t uint64;
++
++#endif
+--- a/Makefile
++++ b/Makefile
+@@ -788,13 +788,6 @@ uint16_unpack.o: \
+ compile uint16_unpack.c uint16.h
+ ./compile uint16_unpack.c
+
+-uint32.h: \
+-tryulong32.c compile load uint32.h1 uint32.h2
+- ( ( ./compile tryulong32.c && ./load tryulong32 && \
+- ./tryulong32 ) >/dev/null 2>&1 \
+- && cat uint32.h2 || cat uint32.h1 ) > uint32.h
+- rm -f tryulong32.o tryulong32
+-
+ uint32_pack.o: \
+ compile uint32_pack.c uint32.h
+ ./compile uint32_pack.c
+@@ -803,10 +796,6 @@ uint32_unpack.o: \
+ compile uint32_unpack.c uint32.h
+ ./compile uint32_unpack.c
+
+-uint64.h: \
+-choose compile load tryulong64.c uint64.h1 uint64.h2
+- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
+-
+ unix.a: \
+ makelib alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
+ buffer_copy.o buffer_get.o buffer_put.o env.o error.o error_str.o \
diff --git a/sys-apps/ucspi-tcp/files/tcprules-Makefile b/sys-apps/ucspi-tcp/files/tcprules-Makefile
new file mode 100644
index 000000000000..dc686f2b554c
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/tcprules-Makefile
@@ -0,0 +1,11 @@
+-include Makefile.*
+.PHONY: all
+.SUFFIXES:
+.SUFFIXES: .cdb
+
+all: $(CDBS)
+ @echo = CDBLIST: $(CDBS)
+
+%.cdb:: %
+ @echo + Rebuilding $* from $<
+ tcprules $@ $@.tmp < $<
diff --git a/sys-apps/ucspi-tcp/metadata.xml b/sys-apps/ucspi-tcp/metadata.xml
new file mode 100644
index 000000000000..692f0c880548
--- /dev/null
+++ b/sys-apps/ucspi-tcp/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>qmail</herd>
+ <longdescription>
+ ucspi-tcp is a replacement for inetd. It consists of tcpserver and
+ tcpclient. tcpserver can listen on sockets and start programs in an
+ inetd like fashion except that information like the IP address and
+ remote port are communicated via environment variables. tcpclient makes
+ a TCP connection and runs a program of your choice. It sets up the same
+ environment variables as tcpserver.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r17.ebuild b/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r17.ebuild
new file mode 100644
index 000000000000..8a21100cceb2
--- /dev/null
+++ b/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r17.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils fixheadtails flag-o-matic qmail
+
+DESCRIPTION="Collection of tools for managing UNIX services"
+HOMEPAGE="http://cr.yp.to/ucspi-tcp.html"
+SRC_URI="
+ http://cr.yp.to/${PN}/${P}.tar.gz
+ mirror://qmail/ucspi-rss.diff
+ http://smarden.org/pape/djb/manpages/${P}-man.tar.gz
+ http://xs3.b92.net/tomislavr/${P}-rblspp.patch
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
+IUSE="qmail-spp selinux"
+RESTRICT="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ !app-doc/ucspi-tcp-man
+ selinux? ( sec-policy/selinux-ucspitcp )"
+
+pkg_setup() {
+ if [[ -n "${UCSPI_TCP_PATCH_DIR}" ]]; then
+ eerror
+ eerror "The UCSPI_TCP_PATCH_DIR variable for custom patches"
+ eerror "has been removed from ${PN}. If you need custom patches"
+ eerror "you should create a copy of this ebuild in an overlay."
+ eerror
+ die "UCSPI_TCP_PATCH_DIR is not supported anymore"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PV}-errno.patch
+ epatch "${FILESDIR}"/${PV}-exit.patch
+ epatch "${DISTDIR}"/ucspi-rss.diff
+ epatch "${FILESDIR}"/${PV}-rblsmtpd-ignore-on-RELAYCLIENT.patch
+ epatch "${DISTDIR}"/${P}-rblspp.patch
+
+ ht_fix_file Makefile
+
+ # gcc-3.4.5 and other several versions contain a bug on some platforms that
+ # cause this error:
+ # tcpserver: fatal: temporarily unable to figure out IP address for 0.0.0.0: file does not exist
+ # To work around this, we use -O1 here instead.
+ replace-flags -O? -O1
+
+ qmail_set_cc
+ echo "/usr/" > conf-home
+
+ # allow larger responses
+ sed -i -e 's|if (text.len > 200) text.len = 200;|if (text.len > 500) text.len = 500;|g' \
+ rblsmtpd.c rblspp.c
+}
+
+src_compile() {
+ emake || die
+}
+
+src_install() {
+ dobin tcpserver tcprules tcprulescheck argv0 recordio tcpclient *\@ \
+ tcpcat mconnect mconnect-io addcr delcr fixcrio rblsmtpd || die
+
+ if use qmail-spp; then
+ insinto "${QMAIL_HOME}"/plugins
+ insopts -m 755
+ doins rblspp
+ fi
+
+ doman "${WORKDIR}"/${P}-man/*.[1-8]
+ dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
+
+ insinto /etc/tcprules.d/
+ newins "${FILESDIR}"/tcprules-Makefile Makefile
+}
+
+pkg_postinst() {
+ einfo
+ einfo "We have started a move to get all tcprules files into"
+ einfo "/etc/tcprules.d/, where we have provided a Makefile to"
+ einfo "easily update the CDB file."
+ einfo
+}
diff --git a/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild b/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild
new file mode 100644
index 000000000000..1c274f629448
--- /dev/null
+++ b/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils qmail
+
+DESCRIPTION="Collection of tools for managing UNIX services"
+HOMEPAGE="http://cr.yp.to/ucspi-tcp.html"
+SRC_URI="
+ http://cr.yp.to/${PN}/${P}.tar.gz
+ mirror://qmail/ucspi-rss.diff
+ http://smarden.org/pape/djb/manpages/${P}-man.tar.gz
+ http://xs3.b92.net/tomislavr/${P}-rblspp.patch
+ ipv6? ( http://www.fefe.de/ucspi/${P}-ipv6.diff19.bz2 )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
+IUSE="ipv6 qmail-spp selinux"
+RESTRICT="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ !app-doc/ucspi-tcp-man
+ selinux? ( sec-policy/selinux-ucspitcp )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-protos.patch
+ if use ipv6; then
+ epatch "${WORKDIR}"/${P}-ipv6.diff19
+ epatch "${FILESDIR}"/${PV}-protos-ipv6.patch
+ epatch "${FILESDIR}"/${PV}-tcprules.patch #135571
+ epatch "${FILESDIR}"/${PV}-bigendian.patch #18892
+ else
+ epatch "${FILESDIR}"/${PV}-protos-no-ipv6.patch
+ fi
+ epatch "${DISTDIR}"/ucspi-rss.diff
+ epatch "${FILESDIR}"/${PV}-rblsmtpd-ignore-on-RELAYCLIENT.patch
+ epatch "${DISTDIR}"/${P}-rblspp.patch
+ epatch "${FILESDIR}"/${PV}-protos-rblspp.patch
+ epatch "${FILESDIR}"/${PV}-large-responses.patch
+ epatch "${FILESDIR}"/${PV}-uint-headers.patch
+ epatch "${FILESDIR}"/${PV}-ar-ranlib.patch
+
+ epatch_user
+}
+
+src_configure() {
+ qmail_set_cc
+ # The AR/RANLIB logic probably should get moved to the qmail eclass.
+ # See also the patch above for generating the "makelib" script.
+ tc-export AR RANLIB
+
+ echo "${EPREFIX}/usr/" > conf-home
+}
+
+src_install() {
+ dobin tcpserver tcprules tcprulescheck argv0 recordio tcpclient *\@ \
+ tcpcat mconnect mconnect-io addcr delcr fixcrio rblsmtpd
+
+ if use qmail-spp; then
+ insinto "${QMAIL_HOME}"/plugins
+ insopts -m 755
+ doins rblspp
+ fi
+
+ doman "${WORKDIR}"/${P}-man/*.[1-8]
+ dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
+
+ insinto /etc/tcprules.d
+ newins "${FILESDIR}"/tcprules-Makefile Makefile
+}
diff --git a/sys-apps/ucspi-unix/Manifest b/sys-apps/ucspi-unix/Manifest
new file mode 100644
index 000000000000..283c72b97461
--- /dev/null
+++ b/sys-apps/ucspi-unix/Manifest
@@ -0,0 +1 @@
+DIST ucspi-unix-0.36.tar.gz 14175 RMD160 21185525ac0161c14ca917ecfc3ac289ef8f398d SHA1 f5ced751f1829a896fbd854987fd7774eb338a75 SHA256 428d23fcc91b4dd66f64932978cd26316b82d2599cff7a512690ff1ec9df02e2
diff --git a/sys-apps/ucspi-unix/files/ucspi-unix-0.36-fix-parallel-build.patch b/sys-apps/ucspi-unix/files/ucspi-unix-0.36-fix-parallel-build.patch
new file mode 100644
index 000000000000..94fc07cb0022
--- /dev/null
+++ b/sys-apps/ucspi-unix/files/ucspi-unix-0.36-fix-parallel-build.patch
@@ -0,0 +1,19 @@
+--- Makefile.orig 2010-01-14 14:42:14.000000000 +0100
++++ Makefile 2010-01-14 14:42:42.000000000 +0100
+@@ -41,14 +41,14 @@
+ ./load insthier -linstaller
+ mv insthier installer
+
+-instcheck: load insthier.o
++instcheck: load insthier.o installer instshow
+ ./load insthier -linstcheck
+ mv insthier instcheck
+
+ insthier.o: compile insthier.c conf_bin.c conf_man.c
+ ./compile insthier.c
+
+-instshow: load insthier.o
++instshow: load insthier.o installer
+ ./load insthier -linstshow
+ mv insthier instshow
+
diff --git a/sys-apps/ucspi-unix/files/ucspi-unix-0.36-include-sys_socket.h.patch b/sys-apps/ucspi-unix/files/ucspi-unix-0.36-include-sys_socket.h.patch
new file mode 100644
index 000000000000..0d96450911c5
--- /dev/null
+++ b/sys-apps/ucspi-unix/files/ucspi-unix-0.36-include-sys_socket.h.patch
@@ -0,0 +1,11 @@
+diff -Naur ucspi-unix-0.36.orig/env.c ucspi-unix-0.36/env.c
+--- ucspi-unix-0.36.orig/env.c 2002-06-10 23:12:06.000000000 +0200
++++ ucspi-unix-0.36/env.c 2008-11-06 16:31:09.000000000 +0100
+@@ -2,6 +2,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <sysdeps.h>
++#include <sys/socket.h>
+
+ extern const char* utoa(unsigned long);
+
diff --git a/sys-apps/ucspi-unix/files/ucspi-unix-gentoo-head.patch b/sys-apps/ucspi-unix/files/ucspi-unix-gentoo-head.patch
new file mode 100644
index 000000000000..fa360e53c1f1
--- /dev/null
+++ b/sys-apps/ucspi-unix/files/ucspi-unix-gentoo-head.patch
@@ -0,0 +1,33 @@
+--- ucspi-unix-0.36/Makefile.orig 2003-12-26 18:50:34.000000000 -0500
++++ ucspi-unix-0.36/Makefile 2003-12-26 18:50:56.000000000 -0500
+@@ -18,18 +18,18 @@
+ ( echo '#!/bin/sh'; \
+ echo 'source=$$1; shift'; \
+ echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \
+- echo exec `head -1 conf-cc` '-I. -o $${base}.o -c $$source $${1+"$$@"}'; \
++ echo exec `head -n 1 conf-cc` '-I. -o $${base}.o -c $$source $${1+"$$@"}'; \
+ ) >compile
+ chmod 755 compile
+
+ conf_bin.c: conf-bin
+- head -1 conf-bin | \
++ head -n 1 conf-bin | \
+ sed -e 's/"/\\"/g' \
+ -e 's/^/const char conf_bin[] = "/' \
+ -e 's/$$/";/' >conf_bin.c
+
+ conf_man.c: conf-man
+- head -1 conf-man | \
++ head -n 1 conf-man | \
+ sed -e 's/"/\\"/g' \
+ -e 's/^/const char conf_man[] = "/' \
+ -e 's/$$/";/' >conf_man.c
+@@ -55,7 +55,7 @@
+ load: conf-ld
+ ( echo '#!/bin/sh';\
+ echo 'main="$$1"; shift';\
+- echo exec `head -1 conf-ld` '-o "$$main" "$$main.o" $${1+"$$@"}' -lsysdeps;\
++ echo exec `head -n 1 conf-ld` '-o "$$main" "$$main.o" $${1+"$$@"}' -lsysdeps;\
+ ) >load
+ chmod 755 load
+
diff --git a/sys-apps/ucspi-unix/metadata.xml b/sys-apps/ucspi-unix/metadata.xml
new file mode 100644
index 000000000000..ada679eb0fd6
--- /dev/null
+++ b/sys-apps/ucspi-unix/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>
+<longdescription lang="en">
+This package contains UNIX domain socket client and server programs that
+conform to UCSPI, the UNIX Client-Server Program Interface.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-apps/ucspi-unix/ucspi-unix-0.36-r2.ebuild b/sys-apps/ucspi-unix/ucspi-unix-0.36-r2.ebuild
new file mode 100644
index 000000000000..cad99b829a4f
--- /dev/null
+++ b/sys-apps/ucspi-unix/ucspi-unix-0.36-r2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A ucspi implementation for unix sockets"
+HOMEPAGE="http://untroubled.org/ucspi-unix/"
+SRC_URI="${HOMEPAGE}archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc sparc x86"
+IUSE=""
+
+DEPEND=">=dev-libs/bglibs-1.019-r1"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-gentoo-head.patch
+}
+
+src_compile() {
+ use kernel_linux && PEERCRED="-DHASPEERCRED=1"
+ echo "$(tc-getCC) ${CFLAGS} -I/usr/lib/bglibs/include ${PEERCRED}" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS} -L/usr/lib/bglibs/lib" > conf-ld
+ make || die #don't use emake b/c of jobserver
+}
+
+src_install() {
+ dobin unixserver unixclient unixcat || die
+ doman unixserver.1 unixclient.1
+ dodoc ANNOUNCEMENT NEWS PROTOCOL README TODO
+}
diff --git a/sys-apps/ucspi-unix/ucspi-unix-0.36-r3.ebuild b/sys-apps/ucspi-unix/ucspi-unix-0.36-r3.ebuild
new file mode 100644
index 000000000000..ffbc0bcafdff
--- /dev/null
+++ b/sys-apps/ucspi-unix/ucspi-unix-0.36-r3.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A ucspi implementation for unix sockets"
+HOMEPAGE="http://untroubled.org/ucspi-unix/"
+SRC_URI="http://untroubled.org/ucspi-unix/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc ~sparc x86"
+IUSE=""
+
+DEPEND=">=dev-libs/bglibs-1.019-r1"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-gentoo-head.patch
+ epatch "${FILESDIR}"/${P}-include-sys_socket.h.patch
+}
+
+src_compile() {
+ use kernel_linux && PEERCRED="-DHASPEERCRED=1"
+ echo "$(tc-getCC) ${CFLAGS} -I/usr/lib/bglibs/include ${PEERCRED} -D_GNU_SOURCE" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS} -L/usr/lib/bglibs/lib" > conf-ld
+ # fails parallel build, bug #297986
+ emake -j1 || die
+}
+
+src_install() {
+ dobin unixserver unixclient unixcat || die
+ doman unixserver.1 unixclient.1
+ dodoc ANNOUNCEMENT NEWS PROTOCOL README TODO
+}
diff --git a/sys-apps/ucspi-unix/ucspi-unix-0.36-r4.ebuild b/sys-apps/ucspi-unix/ucspi-unix-0.36-r4.ebuild
new file mode 100644
index 000000000000..58359b625708
--- /dev/null
+++ b/sys-apps/ucspi-unix/ucspi-unix-0.36-r4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="A ucspi implementation for unix sockets"
+HOMEPAGE="http://untroubled.org/ucspi-unix/"
+SRC_URI="http://untroubled.org/ucspi-unix/archive/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND=">=dev-libs/bglibs-1.106"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-gentoo-head.patch
+ epatch "${FILESDIR}"/${P}-include-sys_socket.h.patch
+ epatch "${FILESDIR}"/${P}-fix-parallel-build.patch
+}
+
+src_configure() {
+ local has_peercred
+ use kernel_linux && has_peercred="-DHASPEERCRED=1"
+
+ echo "$(tc-getCC) ${CFLAGS} -I/usr/include/bglibs ${has_peercred} -D_GNU_SOURCE" > conf-cc
+ echo "$(tc-getCC) ${LDFLAGS} -L/usr/$(get_libdir)/bglibs" > conf-ld
+}
+
+src_install() {
+ dobin unixserver unixclient unixcat || die
+ doman unixserver.1 unixclient.1
+ dodoc ANNOUNCEMENT NEWS PROTOCOL README TODO
+}
diff --git a/sys-apps/udevil/Manifest b/sys-apps/udevil/Manifest
new file mode 100644
index 000000000000..0abb1d6eb7b7
--- /dev/null
+++ b/sys-apps/udevil/Manifest
@@ -0,0 +1,3 @@
+DIST udevil-0.4.1.tar.xz 299636 SHA256 2ade0860d549455c73447f9b0d661c333e6f7fabe01008bebdc3045500feb057 SHA512 e67a1645b859b2a11671b3c78d093596f7151aa6e30d28622ad1620633297edcf423823a472ead9c703c9de7a9768c59999ea0ed65578d7fd2975a1408c13fc6 WHIRLPOOL b690861bfa5661a49fe4b9194488364d4ac28266764a04a774bc593f5fdf81098e5c237553d80426165b0271c48a53e977160a3defcf68c78fe21134fb7d40fd
+DIST udevil-0.4.3.tar.gz 474453 SHA256 c49d2644baf87182c160550d708f75fe1253a2ceb749148e9148d7f1cfbc6209 SHA512 7fc04a8166d189dab73e7ef0ed8d9db6d98dc74c9ae41a9ce2ee1a29b34d3ca6379fce96e89a5cbc9a10bf88167934710827487fe59c9f7c438832bbefc16adf WHIRLPOOL 17e56ca0026deb24d5d00718b83fe9fe49437f6f037ee91075542c70f46b993f8060fc4ccc9a1bf54b8cff90fad8706f4cd72f1a37794c8f9ad0086ff86d3597
+DIST udevil-0.4.4.tar.gz 477254 SHA256 ad2fd8375bd62622718a04235e9772119459089938dbb78e657955e595822b7c SHA512 adce4916e06d1cc4965521abbcbc2901e53930691167f431cb18e28d3ef8bde740e95a6a5f40dfc58dfd7b4b661b4475d3dd2b6174a5d7a55ae7c65629b82327 WHIRLPOOL 6bd7b5e6792e9f556113260a86f1aa29b795a0d7ddc577f86fd286d2a95515ac32e80bdfc4677a1aa59b0efcbddd8e40eec83db4e63439e8d1fead6061b64bec
diff --git a/sys-apps/udevil/files/udevil-0.4.1-automake-1.13.patch b/sys-apps/udevil/files/udevil-0.4.1-automake-1.13.patch
new file mode 100644
index 000000000000..44da794b195b
--- /dev/null
+++ b/sys-apps/udevil/files/udevil-0.4.1-automake-1.13.patch
@@ -0,0 +1,11 @@
+--- udevil-0.4.1/configure.ac
++++ udevil-0.4.1/configure.ac
+@@ -1,7 +1,7 @@
+ AC_PREREQ(2.52)
+
+ AC_INIT(src/udevil.c)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ AC_CONFIG_SRCDIR(src)
+ AM_INIT_AUTOMAKE(udevil, 0.4.1)
+
diff --git a/sys-apps/udevil/files/udevil-0.4.1-flags.patch b/sys-apps/udevil/files/udevil-0.4.1-flags.patch
new file mode 100644
index 000000000000..166a4357e9f3
--- /dev/null
+++ b/sys-apps/udevil/files/udevil-0.4.1-flags.patch
@@ -0,0 +1,46 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Sun Oct 21 19:33:04 UTC 2012
+Subject: build system
+
+ respect flags where possible
+
+--- configure.ac
++++ configure.ac
+@@ -18,26 +18,6 @@
+
+
+ dnl linker optimizations
+-AC_MSG_CHECKING([whether $LD accepts --as-needed])
+-case `$LD --as-needed -v 2>&1 </dev/null` in
+-*GNU* | *'with BFD'*)
+- LDFLAGS="$LDFLAGS -Wl,--as-needed"
+- AC_MSG_RESULT([yes])
+- ;;
+-*)
+- AC_MSG_RESULT([no])
+- ;;
+-esac
+-AC_MSG_CHECKING([whether $LD accepts -O1])
+-case `$LD -O1 -v 2>&1 </dev/null` in
+-*GNU* | *'with BFD'*)
+- LDFLAGS="$LDFLAGS -Wl,-O1"
+- AC_MSG_RESULT([yes])
+- ;;
+-*)
+- AC_MSG_RESULT([no])
+- ;;
+-esac
+ AC_MSG_CHECKING([whether $LD accepts -Bsymbolic-functions])
+ case `$LD -Bsymbolic-functions -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+@@ -49,10 +29,6 @@
+ ;;
+ esac
+
+-dnl advanced compiler tweaking
+-CPPFLAGS="$CPPFLAGS -fstrict-aliasing -fmessage-length=0"
+-
+-
+ # program paths
+ AC_ARG_WITH(mount-prog,
+ AC_HELP_STRING([--with-mount-prog=PATH], [Path to mount program (default: /bin/mount)]),
diff --git a/sys-apps/udevil/files/udevil-0.4.3-flags.patch b/sys-apps/udevil/files/udevil-0.4.3-flags.patch
new file mode 100644
index 000000000000..166a4357e9f3
--- /dev/null
+++ b/sys-apps/udevil/files/udevil-0.4.3-flags.patch
@@ -0,0 +1,46 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Sun Oct 21 19:33:04 UTC 2012
+Subject: build system
+
+ respect flags where possible
+
+--- configure.ac
++++ configure.ac
+@@ -18,26 +18,6 @@
+
+
+ dnl linker optimizations
+-AC_MSG_CHECKING([whether $LD accepts --as-needed])
+-case `$LD --as-needed -v 2>&1 </dev/null` in
+-*GNU* | *'with BFD'*)
+- LDFLAGS="$LDFLAGS -Wl,--as-needed"
+- AC_MSG_RESULT([yes])
+- ;;
+-*)
+- AC_MSG_RESULT([no])
+- ;;
+-esac
+-AC_MSG_CHECKING([whether $LD accepts -O1])
+-case `$LD -O1 -v 2>&1 </dev/null` in
+-*GNU* | *'with BFD'*)
+- LDFLAGS="$LDFLAGS -Wl,-O1"
+- AC_MSG_RESULT([yes])
+- ;;
+-*)
+- AC_MSG_RESULT([no])
+- ;;
+-esac
+ AC_MSG_CHECKING([whether $LD accepts -Bsymbolic-functions])
+ case `$LD -Bsymbolic-functions -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+@@ -49,10 +29,6 @@
+ ;;
+ esac
+
+-dnl advanced compiler tweaking
+-CPPFLAGS="$CPPFLAGS -fstrict-aliasing -fmessage-length=0"
+-
+-
+ # program paths
+ AC_ARG_WITH(mount-prog,
+ AC_HELP_STRING([--with-mount-prog=PATH], [Path to mount program (default: /bin/mount)]),
diff --git a/sys-apps/udevil/files/udevil-0.4.4-stat.patch b/sys-apps/udevil/files/udevil-0.4.4-stat.patch
new file mode 100644
index 000000000000..22e41d467821
--- /dev/null
+++ b/sys-apps/udevil/files/udevil-0.4.4-stat.patch
@@ -0,0 +1,11 @@
+Fixes bug #552072. Thanks Helmut Jarausch.
+--- src/device-info.h
++++ src/device-info.h
+@@ -14,6 +14,7 @@
+ #include <libudev.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <sys/stat.h>
+
+ // intltool
+ #include <glib/gi18n.h>
diff --git a/sys-apps/udevil/metadata.xml b/sys-apps/udevil/metadata.xml
new file mode 100644
index 000000000000..0bd37e4f04e2
--- /dev/null
+++ b/sys-apps/udevil/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>zlg@gentoo.org</email>
+ <name>Daniel Campbell</name>
+ </maintainer>
+ <maintainer>
+ <email>ThyArmageddon+Gentoo@Gmail.com</email>
+ <name>Elijah El Lazkani</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">IgnorantGuru/udevil</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/udevil/udevil-0.4.1.ebuild b/sys-apps/udevil/udevil-0.4.1.ebuild
new file mode 100644
index 000000000000..e9a85143d218
--- /dev/null
+++ b/sys-apps/udevil/udevil-0.4.1.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools user
+
+DESCRIPTION="mount and unmount removable devices without a password"
+HOMEPAGE="http://ignorantguru.github.com/udevil/"
+SRC_URI="http://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=app-shells/bash-4.0
+ dev-libs/glib:2
+ sys-apps/util-linux
+ virtual/acl
+ >=virtual/udev-143"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+pkg_setup(){
+ enewgroup plugdev
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-{flags,automake-1.13}.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-setfacl-prog="$(type -P setfacl)" \
+ --enable-systemd
+}
+
+src_install() {
+ default
+ fowners root:plugdev /usr/bin/udevil
+ fperms 4754 /usr/bin/udevil
+}
+
+pkg_postinst() {
+ einfo
+ elog "Please add your user to the plugdev group"
+ elog "to be able to use ${PN} as a user"
+ elog
+ elog "Optional dependencies:"
+ elog " gnome-extra/zenity (devmon popups)"
+ elog " net-fs/davfs2 (mount WebDAV resources)"
+ elog " net-fs/cifs-utils (mounting samba shares)"
+ elog " net-fs/curlftpfs (mounting ftp shares)"
+ elog " net-fs/nfs-utils (mounting nfs shares)"
+ elog " sys-fs/sshfs-fuse (mounting sftp shares)"
+ elog " virtual/eject (eject via devmon)"
+ if ! has_version 'sys-fs/udisks' ; then
+ elog
+ elog "When using ${PN} without udisks, and without the udisks-daemon running,"
+ elog "you may need to enable kernel polling for device media changes to be detected."
+ elog "See http://ignorantguru.github.com/${PN}/#polling"
+ has_version '<virtual/udev-173' && ewarn "You need at least udev-173"
+ kernel_is lt 2 6 38 && ewarn "You need at least kernel 2.6.38"
+ einfo
+ fi
+}
diff --git a/sys-apps/udevil/udevil-0.4.3.ebuild b/sys-apps/udevil/udevil-0.4.3.ebuild
new file mode 100644
index 000000000000..41dea7cf1953
--- /dev/null
+++ b/sys-apps/udevil/udevil-0.4.3.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools user
+
+DESCRIPTION="mount and unmount removable devices without a password"
+HOMEPAGE="http://ignorantguru.github.com/udevil/"
+SRC_URI="https://github.com/IgnorantGuru/udevil/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=app-shells/bash-4.0
+ dev-libs/glib:2
+ sys-apps/util-linux
+ virtual/acl
+ >=virtual/udev-143"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+pkg_setup(){
+ enewgroup plugdev
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-flags.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-setfacl-prog="$(type -P setfacl)" \
+ --enable-systemd
+}
+
+src_install() {
+ default
+ fowners root:plugdev /usr/bin/udevil
+ fperms 4754 /usr/bin/udevil
+}
+
+pkg_postinst() {
+ einfo
+ elog "Please add your user to the plugdev group"
+ elog "to be able to use ${PN} as a user"
+ elog
+ elog "Optional dependencies:"
+ elog " gnome-extra/zenity (devmon popups)"
+ elog " net-fs/davfs2 (mount WebDAV resources)"
+ elog " net-fs/cifs-utils (mounting samba shares)"
+ elog " net-fs/curlftpfs (mounting ftp shares)"
+ elog " net-fs/nfs-utils (mounting nfs shares)"
+ elog " sys-fs/sshfs-fuse (mounting sftp shares)"
+ elog " virtual/eject (eject via devmon)"
+ if ! has_version 'sys-fs/udisks' ; then
+ elog
+ elog "When using ${PN} without udisks, and without the udisks-daemon running,"
+ elog "you may need to enable kernel polling for device media changes to be detected."
+ elog "See http://ignorantguru.github.com/${PN}/#polling"
+ has_version '<virtual/udev-173' && ewarn "You need at least udev-173"
+ kernel_is lt 2 6 38 && ewarn "You need at least kernel 2.6.38"
+ einfo
+ fi
+}
diff --git a/sys-apps/udevil/udevil-0.4.4-r1.ebuild b/sys-apps/udevil/udevil-0.4.4-r1.ebuild
new file mode 100644
index 000000000000..50e6751d3fee
--- /dev/null
+++ b/sys-apps/udevil/udevil-0.4.4-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools user
+
+DESCRIPTION="mount and unmount removable devices without a password"
+HOMEPAGE="http://ignorantguru.github.com/udevil/"
+SRC_URI="https://github.com/IgnorantGuru/udevil/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=app-shells/bash-4.0:*
+ dev-libs/glib:2
+ sys-apps/util-linux
+ virtual/acl
+ >=virtual/udev-143"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+pkg_setup(){
+ enewgroup plugdev
+}
+
+src_prepare() {
+ # This works for 0.4.4 too, no sense copying the patch
+ epatch "${FILESDIR}"/${PN}-0.4.3-flags.patch
+ epatch "${FILESDIR}"/${P}-stat.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-setfacl-prog="$(type -P setfacl)" \
+ --enable-systemd
+}
+
+src_install() {
+ default
+ fowners root:plugdev /usr/bin/udevil
+ fperms 4754 /usr/bin/udevil
+}
+
+pkg_postinst() {
+ einfo
+ elog "Please add your user to the plugdev group"
+ elog "to be able to use ${PN} as a user"
+ elog
+ elog "Optional dependencies:"
+ elog " gnome-extra/zenity (devmon popups)"
+ elog " net-fs/davfs2 (mount WebDAV resources)"
+ elog " net-fs/cifs-utils (mounting samba shares)"
+ elog " net-fs/curlftpfs (mounting ftp shares)"
+ elog " net-fs/nfs-utils (mounting nfs shares)"
+ elog " sys-fs/sshfs-fuse (mounting sftp shares)"
+ elog " virtual/eject (eject via devmon)"
+ if ! has_version 'sys-fs/udisks' ; then
+ elog
+ elog "When using ${PN} without udisks, and without the udisks-daemon running,"
+ elog "you may need to enable kernel polling for device media changes to be detected."
+ elog "See http://ignorantguru.github.com/${PN}/#polling"
+ has_version '<virtual/udev-173' && ewarn "You need at least udev-173"
+ kernel_is lt 2 6 38 && ewarn "You need at least kernel 2.6.38"
+ einfo
+ fi
+}
diff --git a/sys-apps/udevil/udevil-0.4.4.ebuild b/sys-apps/udevil/udevil-0.4.4.ebuild
new file mode 100644
index 000000000000..5023bba1eb28
--- /dev/null
+++ b/sys-apps/udevil/udevil-0.4.4.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils autotools user
+
+DESCRIPTION="mount and unmount removable devices without a password"
+HOMEPAGE="http://ignorantguru.github.com/udevil/"
+SRC_URI="https://github.com/IgnorantGuru/udevil/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=">=app-shells/bash-4.0:*
+ dev-libs/glib:2
+ sys-apps/util-linux
+ virtual/acl
+ >=virtual/udev-143"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+pkg_setup(){
+ enewgroup plugdev
+}
+
+src_prepare() {
+ # This works for 0.4.4 too, no sense copying the patch
+ epatch "${FILESDIR}"/${PN}-0.4.3-flags.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --with-setfacl-prog="$(type -P setfacl)" \
+ --enable-systemd
+}
+
+src_install() {
+ default
+ fowners root:plugdev /usr/bin/udevil
+ fperms 4754 /usr/bin/udevil
+}
+
+pkg_postinst() {
+ einfo
+ elog "Please add your user to the plugdev group"
+ elog "to be able to use ${PN} as a user"
+ elog
+ elog "Optional dependencies:"
+ elog " gnome-extra/zenity (devmon popups)"
+ elog " net-fs/davfs2 (mount WebDAV resources)"
+ elog " net-fs/cifs-utils (mounting samba shares)"
+ elog " net-fs/curlftpfs (mounting ftp shares)"
+ elog " net-fs/nfs-utils (mounting nfs shares)"
+ elog " sys-fs/sshfs-fuse (mounting sftp shares)"
+ elog " virtual/eject (eject via devmon)"
+ if ! has_version 'sys-fs/udisks' ; then
+ elog
+ elog "When using ${PN} without udisks, and without the udisks-daemon running,"
+ elog "you may need to enable kernel polling for device media changes to be detected."
+ elog "See http://ignorantguru.github.com/${PN}/#polling"
+ has_version '<virtual/udev-173' && ewarn "You need at least udev-173"
+ kernel_is lt 2 6 38 && ewarn "You need at least kernel 2.6.38"
+ einfo
+ fi
+}
diff --git a/sys-apps/uevt/Manifest b/sys-apps/uevt/Manifest
new file mode 100644
index 000000000000..6e92fe048e5e
--- /dev/null
+++ b/sys-apps/uevt/Manifest
@@ -0,0 +1 @@
+DIST uevt-2.3.tar.bz2 787807 SHA256 504daa8c1ff1475ad545a86432d3bd98af4f7ee8570c6aa2b54bedf80d57f0dc SHA512 69baeae514cc34b95f1c908000509d37ce0dff58fbdeffb911f13f1800c4f0fb8de1f9e6f0622836c04f2614bae3a17402d3448236e8ff6b3eadde038a34c1a8 WHIRLPOOL 93bf4a1c9854569c7287ab59a7c668453ebbcb093423acd375f9c089234ab9950e336cb736ad94266aa61b0e598e671fabddfb93973cbdb94e7e29a6a30c789b
diff --git a/sys-apps/uevt/files/uevt-2.3-support_for_more_than_one_CPU.patch b/sys-apps/uevt/files/uevt-2.3-support_for_more_than_one_CPU.patch
new file mode 100644
index 000000000000..87e72c81e726
--- /dev/null
+++ b/sys-apps/uevt/files/uevt-2.3-support_for_more_than_one_CPU.patch
@@ -0,0 +1,220 @@
+From 69d2f45e234190fbfb37745ea05ab88547a3de96 Mon Sep 17 00:00:00 2001
+From: Elentir <elentir@frugalware.org>
+Date: Wed, 29 Aug 2012 03:41:38 +0000
+Subject: fix for processors with more than 2 cores
+
+---
+diff --git a/src/helpers/uevt-cpu-helper.vala b/src/helpers/uevt-cpu-helper.vala
+index 89df7db..81283ff 100644
+--- a/src/helpers/uevt-cpu-helper.vala
++++ b/src/helpers/uevt-cpu-helper.vala
+@@ -21,9 +21,9 @@ using Posix;
+
+ namespace UEvtCpuHelper
+ {
+- string[] availcpulist;
++ int cpunumber;
+
+- private string[] uevt_cpu_helper_detect_cpu_number()
++ private int uevt_cpu_helper_detect_cpu_number()
+ {
+ string prescpu = "";
+ GLib.File file = File.new_for_path("/sys/devices/system/cpu/present");
+@@ -38,17 +38,17 @@ namespace UEvtCpuHelper
+
+ string[] availcpu = prescpu.split("-", 0);
+
+- return availcpu;
++ return int.parse(availcpu[1]);
+ }
+
+- private string uevt_cpu_helper_get_cpu_max_freq(string cpu_num)
++ private string uevt_cpu_helper_get_cpu_max_freq(int cpu_num)
+ {
+ string freq = "";
+
+- if(!(cpu_num in availcpulist))
++ if(cpu_num > cpunumber)
+ return "";
+
+- GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_max_freq"
++ GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq"
+ .printf(cpu_num));
+
+ try {
+@@ -61,14 +61,14 @@ namespace UEvtCpuHelper
+ return freq;
+ }
+
+- private string uevt_cpu_helper_get_cpu_min_freq(string cpu_num)
++ private string uevt_cpu_helper_get_cpu_min_freq(int cpu_num)
+ {
+ string freq = "";
+
+- if(!(cpu_num in availcpulist))
++ if(cpu_num > cpunumber)
+ return "";
+
+- GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_min_freq"
++ GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_min_freq"
+ .printf(cpu_num));
+
+ try {
+@@ -81,14 +81,14 @@ namespace UEvtCpuHelper
+ return freq;
+ }
+
+- private string uevt_cpu_helper_get_frequency(string cpu_num)
++ private string uevt_cpu_helper_get_frequency(int cpu_num)
+ {
+ string freq = "";
+
+- if(!(cpu_num in availcpulist))
++ if(cpu_num > cpunumber)
+ return "";
+
+- GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_cur_freq"
++ GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq"
+ .printf(cpu_num));
+
+ try {
+@@ -101,7 +101,7 @@ namespace UEvtCpuHelper
+ return freq;
+ }
+
+- private void uevt_cpu_helper_set_frequency(string cpu_num, string newfreq)
++ private void uevt_cpu_helper_set_frequency(int cpu_num, string newfreq)
+ {
+ string newfreqstring = newfreq.to_string();
+
+@@ -110,7 +110,7 @@ namespace UEvtCpuHelper
+ return;
+ }
+
+- FILE file = FILE.open("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_setspeed"
++ FILE file = FILE.open("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_setspeed"
+ .printf(cpu_num), "w");
+ file.puts(newfreq);
+
+@@ -119,20 +119,20 @@ namespace UEvtCpuHelper
+
+ private void uevt_cpu_helper_set_global_frequency(string newfrequency)
+ {
+- foreach(string cpu in availcpulist)
++ for(int cpu = 0; cpu <= cpunumber; cpu++)
+ uevt_cpu_helper_set_frequency(cpu, newfrequency);
+
+ return;
+ }
+
+- private string[] uevt_cpu_helper_get_available_cpu_freqs(string cpu_num)
++ private string[] uevt_cpu_helper_get_available_cpu_freqs(int cpu_num)
+ {
+ string[] freqs = {};
+
+- if(!(cpu_num in availcpulist))
++ if(cpu_num > cpunumber)
+ return {};
+
+- GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_available_frequencies"
++ GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_available_frequencies"
+ .printf(cpu_num));
+
+ try {
+@@ -147,14 +147,14 @@ namespace UEvtCpuHelper
+ return freqs;
+ }
+
+- private string[] uevt_cpu_helper_get_available_governors(string cpu_num)
++ private string[] uevt_cpu_helper_get_available_governors(int cpu_num)
+ {
+ string[] govs = {};
+
+- if(!(cpu_num in availcpulist))
++ if(cpu_num > cpunumber)
+ return {};
+
+- GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_available_governors"
++ GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_available_governors"
+ .printf(cpu_num));
+
+ try {
+@@ -169,14 +169,14 @@ namespace UEvtCpuHelper
+ return govs;
+ }
+
+- private string uevt_cpu_helper_get_governor(string cpu_num)
++ private string uevt_cpu_helper_get_governor(int cpu_num)
+ {
+ string gov = "";
+
+- if(!(cpu_num in availcpulist))
++ if(cpu_num > cpunumber)
+ return "";
+
+- GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_governor"
++ GLib.File file = File.new_for_path("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor"
+ .printf(cpu_num));
+
+ try {
+@@ -189,14 +189,14 @@ namespace UEvtCpuHelper
+ return gov;
+ }
+
+- private void uevt_cpu_helper_set_governor(string cpu_num, string newgovernor)
++ private void uevt_cpu_helper_set_governor(int cpu_num, string newgovernor)
+ {
+ if(!(newgovernor in uevt_cpu_helper_get_available_governors(cpu_num))) {
+ Posix.stdout.printf("Unrecognized governor %s\n", newgovernor);
+ return;
+ }
+
+- FILE file = FILE.open("/sys/devices/system/cpu/cpu%s/cpufreq/scaling_governor"
++ FILE file = FILE.open("/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor"
+ .printf(cpu_num), "w");
+ file.puts(newgovernor);
+
+@@ -205,7 +205,7 @@ namespace UEvtCpuHelper
+
+ private void uevt_cpu_helper_set_global_governor(string newgovernor)
+ {
+- foreach(string cpu in availcpulist)
++ for(int cpu = 0; cpu <= cpunumber; cpu++)
+ uevt_cpu_helper_set_governor(cpu, newgovernor);
+
+ return;
+@@ -215,7 +215,7 @@ namespace UEvtCpuHelper
+ {
+ string minfreq;
+
+- foreach(string cpu in availcpulist) {
++ for(int cpu = 0; cpu <= cpunumber; cpu++) {
+ minfreq = uevt_cpu_helper_get_cpu_min_freq(cpu);
+ uevt_cpu_helper_set_frequency(cpu, minfreq);
+ }
+@@ -227,7 +227,7 @@ namespace UEvtCpuHelper
+ {
+ string maxfreq;
+
+- foreach(string cpu in availcpulist) {
++ for(int cpu = 0; cpu <= cpunumber; cpu++) {
+ maxfreq = uevt_cpu_helper_get_cpu_max_freq(cpu);
+ uevt_cpu_helper_set_frequency(cpu, maxfreq);
+ }
+@@ -242,11 +242,11 @@ namespace UEvtCpuHelper
+ return 1;
+ }
+
+- availcpulist = uevt_cpu_helper_detect_cpu_number();
++ cpunumber = uevt_cpu_helper_detect_cpu_number();
+
+ if(args[1] == "show-infos") {
+- foreach(string cpu in availcpulist) {
+- Posix.stdout.printf("CPU %s : current governor %s, current frequency %s\n",
++ for(int cpu = 0; cpu <= cpunumber; cpu++) {
++ Posix.stdout.printf("CPU %d : current governor %s, current frequency %s\n",
+ cpu,
+ uevt_cpu_helper_get_governor(cpu),
+ uevt_cpu_helper_get_frequency(cpu));
+--
+cgit v0.9.0.3
diff --git a/sys-apps/uevt/files/uevt-2.3-vala-0.24.patch b/sys-apps/uevt/files/uevt-2.3-vala-0.24.patch
new file mode 100644
index 000000000000..9cb0917b180f
--- /dev/null
+++ b/sys-apps/uevt/files/uevt-2.3-vala-0.24.patch
@@ -0,0 +1,13 @@
+http://bugs.gentoo.org/509512
+
+--- src/uevt-notify.vala
++++ src/uevt-notify.vala
+@@ -51,7 +51,7 @@
+ if(notify != true)
+ return;
+
+- Notification notif = new Notification(head, Markup.escape_text(body), icon);
++ Notify.Notification notif = new Notify.Notification(head, Markup.escape_text(body), icon);
+
+ try {
+ notif.show();
diff --git a/sys-apps/uevt/metadata.xml b/sys-apps/uevt/metadata.xml
new file mode 100644
index 000000000000..40838bc36783
--- /dev/null
+++ b/sys-apps/uevt/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-apps/uevt/uevt-2.3-r1.ebuild b/sys-apps/uevt/uevt-2.3-r1.ebuild
new file mode 100644
index 000000000000..a9942628497e
--- /dev/null
+++ b/sys-apps/uevt/uevt-2.3-r1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+VALA_MIN_API_VERSION="0.16"
+inherit eutils vala
+
+DESCRIPTION="UPower/UDisks Event, a lightweight desktop-independent power and disk manager"
+HOMEPAGE="http://elentir.sleipnir.fr/ http://git.sleipnir.fr/uevt/"
+SRC_URI="http://ftp.sleipnir.fr/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+COMMON_DEPEND=">=dev-libs/glib-2.28
+ x11-libs/gtk+:2
+ >=x11-libs/libnotify-0.7"
+# Prefer sys-power/upower-pm-utils because there is no Hibernate/Suspend otherwise
+RDEPEND="${COMMON_DEPEND}
+ >=sys-fs/udisks-1.0.5:0
+ || ( sys-power/upower-pm-utils >=sys-power/upower-0.9.23 )"
+DEPEND="${COMMON_DEPEND}
+ $(vala_depend)
+ dev-util/intltool
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+DOCS="AUTHORS ChangeLog README"
+
+pkg_setup() {
+ export VALAC="$(type -P valac-${UEVT_VALA_VERSION})"
+}
+
+src_prepare() {
+ # http://git.sleipnir.fr/uevt/commit/?id=69d2f45e234190fbfb37745ea05ab88547a3de96
+ epatch \
+ "${FILESDIR}"/${P}-support_for_more_than_one_CPU.patch \
+ "${FILESDIR}"/${P}-vala-0.24.patch
+
+ # See http://bugs.gentoo.org/ wrt #428438
+ echo src/configurator.c >> po/POTFILES.skip
+ echo src/power-infos.c >> po/POTFILES.skip
+
+ vala_src_prepare
+}
+
+pkg_postinst() {
+ has_version '>=sys-power/upower-0.99.0' && \
+ ewarn "This version of UEvt doesn't support Hibernate/Suspend with UPower >= 0.99.0"
+}
diff --git a/sys-apps/ultracopier/Manifest b/sys-apps/ultracopier/Manifest
new file mode 100644
index 000000000000..c6537ce2974c
--- /dev/null
+++ b/sys-apps/ultracopier/Manifest
@@ -0,0 +1 @@
+DIST ultracopier-src-0.2.0.16.tar.bz2 430736 SHA256 3c965899c491ddaa7381de805a62557d224a70c3379f68bb2a24f4bf07d36f30
diff --git a/sys-apps/ultracopier/metadata.xml b/sys-apps/ultracopier/metadata.xml
new file mode 100644
index 000000000000..e8b6c80fb348
--- /dev/null
+++ b/sys-apps/ultracopier/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>
+<longdescription lang="en">
+</longdescription>
+</pkgmetadata>
+
diff --git a/sys-apps/ultracopier/ultracopier-0.2.0.16.ebuild b/sys-apps/ultracopier/ultracopier-0.2.0.16.ebuild
new file mode 100644
index 000000000000..7b9dd9fa2e03
--- /dev/null
+++ b/sys-apps/ultracopier/ultracopier-0.2.0.16.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils qt4-r2
+
+DESCRIPTION="Advanced file copying tool"
+HOMEPAGE="http://ultracopier.first-world.info/"
+SRC_URI="http://files.first-world.info/${PN}/${PV}/${PN}-src-${PV}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="dev-qt/qtgui:4"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ local debugl=0
+ use debug && debugl=100
+ sed -i -e "s/\(DEBUG_ULTRACOPIER\) 0/\1 ${debugl}/" src/var.h || die
+}
+
+src_install() {
+ dodoc CHANGELOG README || die
+
+ cd src || die
+ rm -f lang/en* lang/*.ts || die
+ rm -Rf styles/kde3 || die
+
+ dobin ${PN} || die
+ newicon other/${PN}-128x128.png ${PN}.png || die
+ domenu other/${PN}.desktop || die
+
+ insinto /usr/share/${PN}
+ doins -r lang styles || die
+}
diff --git a/sys-apps/unscd/Manifest b/sys-apps/unscd/Manifest
new file mode 100644
index 000000000000..6e55ad97e79a
--- /dev/null
+++ b/sys-apps/unscd/Manifest
@@ -0,0 +1,2 @@
+DIST nscd-0.51.c 73007 SHA256 c915df72749c3fa89baa81291f40bd529512d28d484a75bcb9f8de053f9884ff SHA512 e506eca97f430191507bf41e7c9a696354bfaf14eb754467d007273931e47cef323f1ddbeffb48579c9a9a393a0256bd925576f3c88f9596879dd376b67c95fb WHIRLPOOL 9006c68a1154cd76e85b7177dd5cca301dfd3e95654f9cc6beb1a6ca4623c097b12163a135462355363bf72ef973478590380e2631b2340aed827c955ec34ac8
+DIST nscd-0.52.c 73144 SHA256 4c1f83dcd120469fceef749050cb29fa666fa4666bd308dfe92e933a4c200d55 SHA512 ba48410309fced9b8d9f929c52b39ca9a8caaf451fe73742bde7d4a4ab9980bc0f353551e19c846e96d6cb8a71e3c5edc7ddddf76cce0613282f0d01fde0612f WHIRLPOOL d98e305ee99da16e50dc379991fa3083f9608cb4ae9fbd50f03f50c0ae3d2eae8dc352fdc7fa690e47b36edd7b9c8c7cb029bd69c579d07310481b742634f0cd
diff --git a/sys-apps/unscd/files/unscd-tmpfiles.conf b/sys-apps/unscd/files/unscd-tmpfiles.conf
new file mode 100644
index 000000000000..b5f25f6c5bb1
--- /dev/null
+++ b/sys-apps/unscd/files/unscd-tmpfiles.conf
@@ -0,0 +1 @@
+d /run/nscd 0755 root root -
diff --git a/sys-apps/unscd/files/unscd.initd b/sys-apps/unscd/files/unscd.initd
new file mode 100755
index 000000000000..3fcb52b2c9c8
--- /dev/null
+++ b/sys-apps/unscd/files/unscd.initd
@@ -0,0 +1,40 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ use dns ldap net slapd
+}
+
+checkconfig() {
+ if [ ! -d /var/run/nscd ] ; then
+ mkdir -p /var/run/nscd
+ chmod 755 /var/run/nscd
+ fi
+ if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
+ echo ""
+ ewarn "nscd run dir is not world readable, you should reset the perms:"
+ ewarn "chmod 755 /var/run/nscd"
+ ewarn "chmod a+rw /var/run/nscd/socket"
+ echo ""
+ ewarn "To disable this warning, set 'NSCD_PERMS_OK=1' in /etc/conf.d/unscd"
+ echo ""
+ fi
+}
+
+start() {
+ checkconfig
+
+ ebegin "Starting Name Service Cache Daemon (unscd)"
+ start-stop-daemon --start --quiet \
+ --exec /usr/sbin/unscd --pidfile /var/run/nscd/nscd.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down Name Service Cache Daemon (unscd)"
+ start-stop-daemon --stop --quiet \
+ --exec /usr/sbin/unscd --pidfile /var/run/nscd/nscd.pid
+ eend $?
+}
diff --git a/sys-apps/unscd/files/unscd.initd-r1 b/sys-apps/unscd/files/unscd.initd-r1
new file mode 100644
index 000000000000..55262fdfb11a
--- /dev/null
+++ b/sys-apps/unscd/files/unscd.initd-r1
@@ -0,0 +1,16 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+name="Name Service Cache Daemon (unscd)"
+command="/usr/sbin/unscd"
+pidfile="/run/nscd/nscd.pid"
+
+depend() {
+ use dns ldap net slapd
+}
+
+start_pre() {
+ checkpath -d --quiet --mode 755 /run/nscd
+}
diff --git a/sys-apps/unscd/files/unscd.service b/sys-apps/unscd/files/unscd.service
new file mode 100644
index 000000000000..d7c932b9587d
--- /dev/null
+++ b/sys-apps/unscd/files/unscd.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Name Service Cache Daemon (unscd)
+Wants=ldap.service network-online.target slapd.service
+After=ldap.service network-online.target nss-lookup.target nss-user-lookup.target slapd.service
+
+[Service]
+Type=forking
+PIDFile=/run/nscd/nscd.pid
+ExecStart=/usr/sbin/unscd
+ExecStop=/usr/sbin/nscd --shutdown
+ExecReload=/usr/sbin/nscd -i passwd
+ExecReload=/usr/sbin/nscd -i group
+ExecReload=/usr/sbin/nscd -i hosts
+ExecReload=/usr/sbin/nscd -i services
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/unscd/metadata.xml b/sys-apps/unscd/metadata.xml
new file mode 100644
index 000000000000..686dc818edb9
--- /dev/null
+++ b/sys-apps/unscd/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>toolchain</herd>
+</pkgmetadata>
diff --git a/sys-apps/unscd/unscd-0.51.ebuild b/sys-apps/unscd/unscd-0.51.ebuild
new file mode 100644
index 000000000000..a2375ee106cf
--- /dev/null
+++ b/sys-apps/unscd/unscd-0.51.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs
+
+DESCRIPTION="simple & stable nscd replacement"
+HOMEPAGE="http://busybox.net/~vda/unscd/README"
+SRC_URI="http://busybox.net/~vda/unscd/nscd-${PV}.c"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="sys-libs/glibc[nscd(+)]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${DISTDIR}"/nscd-${PV}.c unscd.c || die
+}
+
+src_compile() {
+ tc-export CC
+ emake unscd
+}
+
+src_install() {
+ newinitd "${FILESDIR}"/unscd.initd unscd
+ dosbin unscd
+}
diff --git a/sys-apps/unscd/unscd-0.52-r2.ebuild b/sys-apps/unscd/unscd-0.52-r2.ebuild
new file mode 100644
index 000000000000..4127deb95d78
--- /dev/null
+++ b/sys-apps/unscd/unscd-0.52-r2.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit systemd toolchain-funcs
+
+DESCRIPTION="simple & stable nscd replacement"
+HOMEPAGE="http://busybox.net/~vda/unscd/README"
+SRC_URI="http://busybox.net/~vda/unscd/nscd-${PV}.c"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="sys-libs/glibc[nscd(+)]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${DISTDIR}"/nscd-${PV}.c ${PN}.c || die
+}
+
+src_compile() {
+ tc-export CC
+ emake unscd
+}
+
+src_install() {
+ newinitd "${FILESDIR}"/unscd.initd-r1 unscd
+ systemd_newtmpfilesd "${FILESDIR}"/unscd-tmpfiles.conf unscd.conf
+ systemd_dounit "${FILESDIR}"/unscd.service
+ dosbin unscd
+}
diff --git a/sys-apps/usb_modeswitch/Manifest b/sys-apps/usb_modeswitch/Manifest
new file mode 100644
index 000000000000..c9daa9c81974
--- /dev/null
+++ b/sys-apps/usb_modeswitch/Manifest
@@ -0,0 +1,10 @@
+DIST usb-modeswitch-1.2.7.tar.bz2 259738 SHA256 f61e63e544575f4757b8f9d22416d63ebd5a24c7876c7b0539026a98601f9c7d SHA512 d1c033809e22e25aa089af0f1df6ad0db848fa1a6f98bf552f3a4b86189301cfb1ec1563158ce63b7539ea8c2302257de67fa7766e7ebd1c4c7c9a6fdbe149a5 WHIRLPOOL de9db037ff8d983b56bd14a1ea94b948f550c96bdc62b52cbdfe882d2cf27f4ba5d5d0c5c0e66609d318eb55e37c1b5a61de3d8eb7540dd6aa3be4ed11471887
+DIST usb-modeswitch-2.1.0.tar.bz2 261428 SHA256 53fd6927843817c30b17c496443a31c0e5df52a88b6c4b2c2c2bef6e976e40de SHA512 9aa80edf6ace56503347030f8881d327491d7cce065ae4a7b91463833ee0c67ab87cb8018da6075ee563d94ec019b97ea69ac9c4f29afce743bac480121ae668 WHIRLPOOL 00ba131f2f74379f6f2f411053b4b84fb70a8854c077ac1c6ac2cc87ed6e7f9a0098315d2a4d816c2dd4cf8f92c06375de73562d14e454936ac4785505f92430
+DIST usb-modeswitch-2.1.1.tar.bz2 261358 SHA256 5ad1134e142502f52f034c1e3f148386d334ddb70e744be96a5174d303dc2542 SHA512 582323b27d875bfe05f0337f2548b77e4b3cc9ab2b644eecefd377f021e2cb1283aae3100f8fba6dccb5f9172ee57cd2d2175d3ff6e17744f18b0e2df0a24d89 WHIRLPOOL f7b279a9c127319bfb56ba99cd82941f9e1dc32a181d2b3c536f4cb55bf114bed200f27064dacaaa3128becaedf637158fc3911aa3b887ba98ef1bb026b1a7e2
+DIST usb-modeswitch-2.2.0.tar.bz2 261888 SHA256 2752103de171ed5f6c8d6a6e3e73e16c9ee3e8e394dd39c5991f7680eb908a3a SHA512 1311365c580035361e961ffefb84acf88771aae17d4b084733f2e0d10ac2ad770cf7d3b64c1c6cc400f19082530b425714f3afb88d10d6023e3798261a982e67 WHIRLPOOL 0e9e2bca6e72c9f34a18c82ba52d02b3281f3a016a5fdab251f7556b4d4aa04936c22a08e97d13985e2cf2d416ee0d51a5cf9494d0e9a449022259025b9d187c
+DIST usb-modeswitch-2.2.3.tar.bz2 263038 SHA256 d1a0d9a9e7411f07796611881a8f264daa946e2a28418abed34639b3583d7593 SHA512 f6d30e251bd4a1d6459cb7ac3594d204c21e0ca22ab0fa44ea675176751e4a2f08a4f42ce2ec0d2caf0bbca56438800327f7e5e16832e383263a4002941fa869 WHIRLPOOL c8a0c1c7bad335da8a9c2d87202ba5ac897d1d469c95c45c1677c41d04256dd97a4577eafd48104d135c5d15cda7c9bc287ecf38b457d4b2d4cce29471931a6e
+DIST usb-modeswitch-data-20130807.tar.bz2 23890 SHA256 a3114e2c1f38eed3ad0067df30e53a96313908a9539a8ea5d94a4d35651699eb SHA512 179669c3ac9077d1727298f55500e886386bb4b01d4f8fe6425bde2ec4f1f394fa0a16a4cc8e91a6a5a82e804b5fa10af2009db1bc7c34bfb759202e63574cd9 WHIRLPOOL 0794dd0a90104425a8cc790d9059f4fc3c874819c67663f7e541bac165b2420c20acca1b9e5275acb68d091c0c493f32934acb75a0a5993cd1e6fdc364065308
+DIST usb-modeswitch-data-20140129.tar.bz2 24189 SHA256 1ce641a76ab01b155beeec9ead3427a5f52b798af197024fdfb3d0190f5feb0d SHA512 74bf90f69ea4e5c1b94de0629e82c1bdf056afec96f152ac35874beafd4cbd0d6b6a0868a6aa72e3064a87fc7e3a58ff56f477649cd6e570782290191accaf2c WHIRLPOOL 86651bc9055e8c4107ce72bf5d54820aa09cc5b1cf51daebca6c5b817ea255b070d9249744f07b03306940259e93a57a91c74dcecc63195f33dbb2db0e6d70f5
+DIST usb-modeswitch-data-20140327.tar.bz2 24273 SHA256 8f9f53c0871239b41d9cf377f528c9de8feddc31c391bd2ed903e17a28e983c7 SHA512 de499f3381a470d73c4781f2f24e0c9d9e059a6f3dd3a73a72125719bb8ce6b687d611f6300531407d2815ea10867cd3a3d2b99bfbf489bc6ac47a0665f8d0fd WHIRLPOOL b4ebca281c626a762c040b15b131b43fbb9732b550620619af418781ea1242ea8e57fa4fb8de36d6c992ebdf8a78f973d1d7fb41482d179d5da88b0c5380071c
+DIST usb-modeswitch-data-20140529.tar.bz2 27383 SHA256 53889157937109e04dafe897c098ec94f3f44f9c0c83fc6ec8417aa9a587e536 SHA512 e0ac311ae09dcf41b45e9434bf43e7964ec0a32ac68024216ddfb6d6fd9d3b484cbe663ec081841e11a4af80e50fce12f1a06e0249aa229558085886c0f25809 WHIRLPOOL 64c4f5c63a85a55ca21f530c3bd3eb50756c5a596f96f85bbadf152e34becf90cc29a2b368a77f3e65bbfff36241ffdd6c09cf50692f730c62567162ab200102
+DIST usb-modeswitch-data-20150627.tar.bz2 29918 SHA256 826096cb35a487c6e924b1318074988457220b5e72812e5393597950dd9eefc2 SHA512 0d1f7a5844d5a8d50e03b842adc2add5c3c4025fd034df6355312b399e714c7df2f5cd01c497e36c6a09744c4376bf4e2af6eef2aebaa1154086fce57a0bce62 WHIRLPOOL cdbd9489a1674645b6d2db2ace43353e813e30d10d30439aac87b232a0496d2424ecafb04faa1ca514be27cbd408880f1b5c323df3ed046e071d87a2091236f8
diff --git a/sys-apps/usb_modeswitch/metadata.xml b/sys-apps/usb_modeswitch/metadata.xml
new file mode 100644
index 000000000000..01048769a16b
--- /dev/null
+++ b/sys-apps/usb_modeswitch/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>freedesktop</herd>
+ <use>
+ <flag name='jimtcl'>Use <pkg>dev-lang/jimtcl</pkg> instead of <pkg>dev-lang/tcl</pkg> for smaller memory footprint</flag>
+ </use>
+ <maintainer>
+ <email>rafaelmartins@gentoo.org</email>
+ <name>Rafael G. Martins</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/usb_modeswitch/usb_modeswitch-1.2.7_p20130807.ebuild b/sys-apps/usb_modeswitch/usb_modeswitch-1.2.7_p20130807.ebuild
new file mode 100644
index 000000000000..529dd75314ee
--- /dev/null
+++ b/sys-apps/usb_modeswitch/usb_modeswitch-1.2.7_p20130807.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils linux-info toolchain-funcs udev
+
+MY_PN=${PN/_/-}
+MY_P=${MY_PN}-${PV/_p*}
+DATA_VER=${PV/*_p}
+
+DESCRIPTION="USB_ModeSwitch is a tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
+HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/ http://www.draisberghof.de/usb_modeswitch/device_reference.txt"
+SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
+ http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+IUSE="jimtcl"
+
+COMMON_DEPEND="virtual/udev
+ virtual/libusb:0
+ !<sys-apps/kmod-12-r1"
+RDEPEND="${COMMON_DEPEND}
+ jimtcl? ( dev-lang/jimtcl )
+ !jimtcl? ( dev-lang/tcl:0 )" # usb_modeswitch script is tcl
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="~USB_SERIAL"
+
+src_prepare() {
+ sed -i -e '/install.*BIN/s:-s::' Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ UDEVDIR="${D}/$(get_udevdir)" \
+ $(usex jimtcl install-shared install)
+
+ dodoc ChangeLog README
+
+ pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
+ emake \
+ DESTDIR="${D}" \
+ RULESDIR="${D}/$(get_udevdir)/rules.d" \
+ files-install db-install
+ docinto data
+ dodoc ChangeLog README
+ popd >/dev/null
+}
diff --git a/sys-apps/usb_modeswitch/usb_modeswitch-2.1.0_p20140129.ebuild b/sys-apps/usb_modeswitch/usb_modeswitch-2.1.0_p20140129.ebuild
new file mode 100644
index 000000000000..7bebe27180f4
--- /dev/null
+++ b/sys-apps/usb_modeswitch/usb_modeswitch-2.1.0_p20140129.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 linux-info toolchain-funcs udev systemd
+
+MY_PN=${PN/_/-}
+MY_P=${MY_PN}-${PV/_p*}
+DATA_VER=${PV/*_p}
+
+DESCRIPTION="USB_ModeSwitch is a tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
+HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/ http://www.draisberghof.de/usb_modeswitch/device_reference.txt"
+SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
+ http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+IUSE="jimtcl"
+
+COMMON_DEPEND="virtual/udev
+ virtual/libusb:1"
+RDEPEND="${COMMON_DEPEND}
+ jimtcl? ( dev-lang/jimtcl )
+ !jimtcl? ( dev-lang/tcl:0 )" # usb_modeswitch script is tcl
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="~USB_SERIAL"
+
+src_prepare() {
+ sed -i -e '/install.*BIN/s:-s::' Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ SYSDIR="${D}/$(systemd_get_unitdir)" \
+ UDEVDIR="${D}/$(get_udevdir)" \
+ $(usex jimtcl install-shared install)
+
+ # Even if we set SYSDIR above, the Makefile is causing automagic detection of `systemctl` binary,
+ # which is why we need to force the .service file to be installed:
+ systemd_dounit ${PN}@.service
+
+ dodoc ChangeLog README
+
+ pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
+ emake \
+ DESTDIR="${D}" \
+ RULESDIR="${D}/$(get_udevdir)/rules.d" \
+ files-install db-install
+ docinto data
+ dodoc ChangeLog README
+ popd >/dev/null
+}
diff --git a/sys-apps/usb_modeswitch/usb_modeswitch-2.1.1_p20140327.ebuild b/sys-apps/usb_modeswitch/usb_modeswitch-2.1.1_p20140327.ebuild
new file mode 100644
index 000000000000..909a6bb6d5e8
--- /dev/null
+++ b/sys-apps/usb_modeswitch/usb_modeswitch-2.1.1_p20140327.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 linux-info toolchain-funcs udev systemd
+
+MY_PN=${PN/_/-}
+MY_P=${MY_PN}-${PV/_p*}
+DATA_VER=${PV/*_p}
+
+DESCRIPTION="USB_ModeSwitch is a tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
+HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/ http://www.draisberghof.de/usb_modeswitch/device_reference.txt"
+SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
+ http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="jimtcl"
+
+COMMON_DEPEND="virtual/udev
+ virtual/libusb:1"
+RDEPEND="${COMMON_DEPEND}
+ jimtcl? ( dev-lang/jimtcl )
+ !jimtcl? ( dev-lang/tcl:0 )" # usb_modeswitch script is tcl
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="~USB_SERIAL"
+
+src_prepare() {
+ sed -i -e '/install.*BIN/s:-s::' Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ SYSDIR="${D}/$(systemd_get_unitdir)" \
+ UDEVDIR="${D}/$(get_udevdir)" \
+ $(usex jimtcl install-shared install)
+
+ # Even if we set SYSDIR above, the Makefile is causing automagic detection of `systemctl` binary,
+ # which is why we need to force the .service file to be installed:
+ systemd_dounit ${PN}@.service
+
+ dodoc ChangeLog README
+
+ pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
+ emake \
+ DESTDIR="${D}" \
+ RULESDIR="${D}/$(get_udevdir)/rules.d" \
+ files-install db-install
+ docinto data
+ dodoc ChangeLog README
+ popd >/dev/null
+}
diff --git a/sys-apps/usb_modeswitch/usb_modeswitch-2.2.0_p20140529.ebuild b/sys-apps/usb_modeswitch/usb_modeswitch-2.2.0_p20140529.ebuild
new file mode 100644
index 000000000000..7bebe27180f4
--- /dev/null
+++ b/sys-apps/usb_modeswitch/usb_modeswitch-2.2.0_p20140529.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 linux-info toolchain-funcs udev systemd
+
+MY_PN=${PN/_/-}
+MY_P=${MY_PN}-${PV/_p*}
+DATA_VER=${PV/*_p}
+
+DESCRIPTION="USB_ModeSwitch is a tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
+HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/ http://www.draisberghof.de/usb_modeswitch/device_reference.txt"
+SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
+ http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+IUSE="jimtcl"
+
+COMMON_DEPEND="virtual/udev
+ virtual/libusb:1"
+RDEPEND="${COMMON_DEPEND}
+ jimtcl? ( dev-lang/jimtcl )
+ !jimtcl? ( dev-lang/tcl:0 )" # usb_modeswitch script is tcl
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="~USB_SERIAL"
+
+src_prepare() {
+ sed -i -e '/install.*BIN/s:-s::' Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ SYSDIR="${D}/$(systemd_get_unitdir)" \
+ UDEVDIR="${D}/$(get_udevdir)" \
+ $(usex jimtcl install-shared install)
+
+ # Even if we set SYSDIR above, the Makefile is causing automagic detection of `systemctl` binary,
+ # which is why we need to force the .service file to be installed:
+ systemd_dounit ${PN}@.service
+
+ dodoc ChangeLog README
+
+ pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
+ emake \
+ DESTDIR="${D}" \
+ RULESDIR="${D}/$(get_udevdir)/rules.d" \
+ files-install db-install
+ docinto data
+ dodoc ChangeLog README
+ popd >/dev/null
+}
diff --git a/sys-apps/usb_modeswitch/usb_modeswitch-2.2.3_p20150627.ebuild b/sys-apps/usb_modeswitch/usb_modeswitch-2.2.3_p20150627.ebuild
new file mode 100644
index 000000000000..909a6bb6d5e8
--- /dev/null
+++ b/sys-apps/usb_modeswitch/usb_modeswitch-2.2.3_p20150627.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 linux-info toolchain-funcs udev systemd
+
+MY_PN=${PN/_/-}
+MY_P=${MY_PN}-${PV/_p*}
+DATA_VER=${PV/*_p}
+
+DESCRIPTION="USB_ModeSwitch is a tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
+HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/ http://www.draisberghof.de/usb_modeswitch/device_reference.txt"
+SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
+ http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="jimtcl"
+
+COMMON_DEPEND="virtual/udev
+ virtual/libusb:1"
+RDEPEND="${COMMON_DEPEND}
+ jimtcl? ( dev-lang/jimtcl )
+ !jimtcl? ( dev-lang/tcl:0 )" # usb_modeswitch script is tcl
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+CONFIG_CHECK="~USB_SERIAL"
+
+src_prepare() {
+ sed -i -e '/install.*BIN/s:-s::' Makefile || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ SYSDIR="${D}/$(systemd_get_unitdir)" \
+ UDEVDIR="${D}/$(get_udevdir)" \
+ $(usex jimtcl install-shared install)
+
+ # Even if we set SYSDIR above, the Makefile is causing automagic detection of `systemctl` binary,
+ # which is why we need to force the .service file to be installed:
+ systemd_dounit ${PN}@.service
+
+ dodoc ChangeLog README
+
+ pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
+ emake \
+ DESTDIR="${D}" \
+ RULESDIR="${D}/$(get_udevdir)/rules.d" \
+ files-install db-install
+ docinto data
+ dodoc ChangeLog README
+ popd >/dev/null
+}
diff --git a/sys-apps/usbmon/Manifest b/sys-apps/usbmon/Manifest
new file mode 100644
index 000000000000..26cb2324dc12
--- /dev/null
+++ b/sys-apps/usbmon/Manifest
@@ -0,0 +1 @@
+DIST usbmon-6.tar.gz 16796 SHA256 32a804ccdd7af002c3e44e7c8abb0e7e1b6ccd6c7b9a70c7371cd5558d07e459 SHA512 4ee41379196b86697a5156d4411860ba31540b98e50165c65f873e22eee1c3caadbc73a2c61903531f968797eca8e7f95490255a0820dc0778fba82c7eb260f5 WHIRLPOOL f985043dcba6fe2f0401f3588298b5a393d07cdd0745a93c684d3510550286a0a8dda7873954ef24e41cbb63679e4fa3093e15e583aef953ed939d50c40d5970
diff --git a/sys-apps/usbmon/metadata.xml b/sys-apps/usbmon/metadata.xml
new file mode 100644
index 000000000000..4f84c8541bd7
--- /dev/null
+++ b/sys-apps/usbmon/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>robbat2@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/usbmon/usbmon-6-r1.ebuild b/sys-apps/usbmon/usbmon-6-r1.ebuild
new file mode 100644
index 000000000000..00de00180335
--- /dev/null
+++ b/sys-apps/usbmon/usbmon-6-r1.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 toolchain-funcs
+
+DESCRIPTION="Userland for USB monitoring framework"
+HOMEPAGE="http://people.redhat.com/zaitcev/linux/"
+SRC_URI="${HOMEPAGE}/${P}.tar.gz"
+
+LICENSE="GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~amd64"
+IUSE=""
+
+DEPEND="!=sys-apps/usbutils-0.72-r2"
+
+src_prepare() {
+ sed \
+ -e '/CFLAGS =/s, = , \+= ,g' \
+ -e 's:-O2::g' \
+ -i "${S}"/Makefile || die
+ tc-export CC
+}
+
+src_install() {
+ dosbin ${PN}
+ doman ${PN}.8
+ dodoc README
+}
diff --git a/sys-apps/usbredir/Manifest b/sys-apps/usbredir/Manifest
new file mode 100644
index 000000000000..6b42a693a782
--- /dev/null
+++ b/sys-apps/usbredir/Manifest
@@ -0,0 +1,6 @@
+DIST usbredir-0.4.3.tar.bz2 299163 SHA256 f2cbcc67926c2275837143485407a57cf4c3fda52d199cbb58f73d57a6988f9c SHA512 ed27bb4e70e063bd06339943b670f33b2aa3653d64e1a9cc0c52d74356e5c523f0812446f830ea85af8a95b4019ee27304baa7618ce9c0de56ed7401f2d39b94 WHIRLPOOL 3e8293bd9decd33b08f38edfa53a73caa1001f84f4c47bb32dc3cf6fb7c9ecd629d0ec7289518a9044b6363bf6923054d23b398279266be7de15e319d383520d
+DIST usbredir-0.4.4.tar.bz2 301660 SHA256 252c9031ab9db200d3e4f55f99e7ba0a35f576e1f3ff07e53895e7151d2457d5 SHA512 09f84779f9cc8a181d99d1f69864056ea38af1e0ffb8339489732b3e1d525c73101f7f630a8e6108dbae0e29cd1a30327e627b11c629fcc0077dc4234c294461 WHIRLPOOL 7d19f7d7308060d507588f0607a7d7d8837ff9eba06d177a4b4ddcae0715940a3d694a1b1c7fc46063ce8be6e0bcc0ab741baadf8156e8e16b3f3f47df42ab07
+DIST usbredir-0.5.1.tar.bz2 305067 SHA256 e0ce8b9503d463f9077310e8d0d00cd50e8972f4814dc4643f652506d4a9129b SHA512 b9aaced69716b673fb8ed41679c234a0c0453935694bfec2209cb6924ed88efebd9c9be7dffb516cf3d7848c7e5a99623062fe236e9056285b9876701718d033 WHIRLPOOL 495da31fe25f77b868b489b5598518adff2b6aae6824ad3db68266f3262ed690ec86925666013e1a679386be78cefec548dc772948ca760fa176041c912e0cd2
+DIST usbredir-0.5.tar.bz2 303095 SHA256 3f855dd70b3af0e8fd8ab7ab6b7e45f51bd4a28b4ef606e8349b7b2188edb201 SHA512 326f02bc7b29dacd61f7acdd8c76dd61d0294d47f164bf4f8241bc04ba5da5280ab4ebc0e413d3b4f482db0fb7159486d30beae2fcd4434676ad85045ac3f461 WHIRLPOOL 2fc79c541990419e42803f91db2dc62bc3161c798b27ac3a1d2923ed749af52dbd51cf3454d74f6665b468862d8580e34a4f2bc8877a1fedeebb9b501f62edea
+DIST usbredir-0.6.tar.bz2 305887 SHA256 028184960044ea4124030000b3c55a35c3238835116e3a0fbcaff449df2c8edf SHA512 2c5b6ea2580ab983b8087d0c7c0bf9dffb7ebff84928c01fec3bf44a08fc530db7719f0b33953e486fdc11763123a3eb9349a79b0241269ad9e6b16c6ef5bb9f WHIRLPOOL 1a67aaaf5baa1a3fb2e67667451262d3b1337a0163977c2157ad08d505ab1e5995771629005506a4ea463bc7743c69a3f28185b64475dd5c0d80f96b305f4242
+DIST usbredir-0.7.tar.bz2 317216 SHA256 0a63a0712b5dc62be9cca44f97270fea5d1ec1fe7dde0c11dc74a01c8e2006aa SHA512 f615fc52f195c7159d16b551f6ecd9426f2aad64222f24b964fbd66fbf59498d80d4d5cf851cc1be9ddd27a9d962afa05970e1379f1ef02e8ac304235e82ad4a WHIRLPOOL 3f7ad0bcde1a109fcc9b32c23019d6078a1ea1c8d72998ce2d3b0c42278a953cfb739c74f21b5083c4e3da8f558ad0e60a82db540c3e1da1a89fd52d9208ff2b
diff --git a/sys-apps/usbredir/metadata.xml b/sys-apps/usbredir/metadata.xml
new file mode 100644
index 000000000000..87124c273692
--- /dev/null
+++ b/sys-apps/usbredir/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>base-system</herd>
+<herd>qemu</herd>
+</pkgmetadata>
diff --git a/sys-apps/usbredir/usbredir-0.4.3.ebuild b/sys-apps/usbredir/usbredir-0.4.3.ebuild
new file mode 100644
index 000000000000..227461c03d04
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-0.4.3.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="static-libs"
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+src_prepare() {
+ sed -i -e 's:-Werror::' configure || die
+}
+
+src_configure() {
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ rm -f "${ED}"/usr/lib*/lib*.la
+}
diff --git a/sys-apps/usbredir/usbredir-0.4.4.ebuild b/sys-apps/usbredir/usbredir-0.4.4.ebuild
new file mode 100644
index 000000000000..75aa8bd0448a
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-0.4.4.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~arm x86"
+IUSE="static-libs"
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+src_configure() {
+ # http://bugs.freedesktop.org/show_bug.cgi?id=54643
+ append-cflags -Wno-error
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ prune_libtool_files
+}
diff --git a/sys-apps/usbredir/usbredir-0.5.1.ebuild b/sys-apps/usbredir/usbredir-0.5.1.ebuild
new file mode 100644
index 000000000000..a8e7176e722e
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-0.5.1.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 eutils flag-o-matic
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="static-libs"
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+src_configure() {
+ # http://bugs.freedesktop.org/show_bug.cgi?id=54643
+ append-cflags -Wno-error
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ # noinst_PROGRAMS
+ dobin usbredirtestclient/usbredirtestclient
+
+ prune_libtool_files
+}
diff --git a/sys-apps/usbredir/usbredir-0.5.ebuild b/sys-apps/usbredir/usbredir-0.5.ebuild
new file mode 100644
index 000000000000..a8e7176e722e
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-0.5.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 eutils flag-o-matic
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="static-libs"
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+src_configure() {
+ # http://bugs.freedesktop.org/show_bug.cgi?id=54643
+ append-cflags -Wno-error
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ # noinst_PROGRAMS
+ dobin usbredirtestclient/usbredirtestclient
+
+ prune_libtool_files
+}
diff --git a/sys-apps/usbredir/usbredir-0.6.ebuild b/sys-apps/usbredir/usbredir-0.6.ebuild
new file mode 100644
index 000000000000..8406382aa87f
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-0.6.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 flag-o-matic
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="static-libs"
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+src_configure() {
+ # http://bugs.freedesktop.org/show_bug.cgi?id=54643
+ append-cflags -Wno-error
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ # noinst_PROGRAMS
+ dobin usbredirtestclient/usbredirtestclient
+}
diff --git a/sys-apps/usbredir/usbredir-0.7.ebuild b/sys-apps/usbredir/usbredir-0.7.ebuild
new file mode 100644
index 000000000000..97f63c6fdc46
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-0.7.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 flag-o-matic
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+SRC_URI="http://spice-space.org/download/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/libusb-1.0.19"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+src_configure() {
+ # http://bugs.freedesktop.org/show_bug.cgi?id=54643
+ append-cflags -Wno-error
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ # noinst_PROGRAMS
+ dobin usbredirtestclient/.libs/usbredirtestclient
+}
diff --git a/sys-apps/usbredir/usbredir-9999.ebuild b/sys-apps/usbredir/usbredir-9999.ebuild
new file mode 100644
index 000000000000..104622ce0aa9
--- /dev/null
+++ b/sys-apps/usbredir/usbredir-9999.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 eutils flag-o-matic autotools git-2
+
+DESCRIPTION="A simple TCP daemon and set of libraries for the usbredir protocol (redirecting USB traffic)"
+HOMEPAGE="http://spice-space.org/page/UsbRedir"
+EGIT_REPO_URI="http://anongit.freedesktop.org/git/spice/usbredir.git"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS=""
+IUSE="static-libs"
+
+RDEPEND="virtual/libusb:1"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS="ChangeLog README* TODO *.txt"
+
+EGIT_BOOTSTRAP="eautoreconf"
+
+src_configure() {
+ # http://bugs.freedesktop.org/show_bug.cgi?id=54643
+ append-cflags -Wno-error
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ # noinst_PROGRAMS
+ dobin usbredirtestclient/usbredirtestclient
+}
diff --git a/sys-apps/usbutils/Manifest b/sys-apps/usbutils/Manifest
new file mode 100644
index 000000000000..19bf2928615e
--- /dev/null
+++ b/sys-apps/usbutils/Manifest
@@ -0,0 +1,2 @@
+DIST usbutils-007.tar.xz 418264 SHA256 7593a01724bbc0fd9fe48e62bc721ceb61c76654f1d7b231b3c65f6dfbbaefa4 SHA512 ee5c9ae4b39747139dbf2c0295d0556c2087002a99c1a1c6de9b87714c0ed37c277471794f0c53b15f4f9e4323527eb5d15d7e1197f73e04f2de6978d3d85987 WHIRLPOOL 4374ba416f2bd8678ebfed25e7d5f2fccc5e49abf80716b3b96915601e801ab07686905d5c45e9ae7e7bb40c16084e97a24afc9c35d0ca743e877eea320ab9af
+DIST usbutils-008.tar.xz 287052 SHA256 44741af0bae9d402a0ef160a29b2fa700bb656ab5e0a4b3343d51249c2a44c8c SHA512 ab1ad36467ff79ff5ab0b924620001612cae44def58c05ade01a4e58d8a4d48df61c09faba49a20497b7d6314045bbaf137b51a9f4e6b65ed0ea3bb339bf1c45 WHIRLPOOL 47898f8f0c8a93a200777e5006ec36c2bc805e126974ba415edc21983db9d35d3b8ec4a6be28359a36e5adda95cc4c8bc37ba4b651a9065e249b8ffe4c6b70aa
diff --git a/sys-apps/usbutils/files/usbutils-006-stdint.patch b/sys-apps/usbutils/files/usbutils-006-stdint.patch
new file mode 100644
index 000000000000..3aecbdfec04c
--- /dev/null
+++ b/sys-apps/usbutils/files/usbutils-006-stdint.patch
@@ -0,0 +1,32 @@
+https://sourceforge.net/p/digimend/bugs/41/
+
+--- a/usbhid-dump/lib/iface.c
++++ b/usbhid-dump/lib/iface.c
+@@ -30,6 +30,7 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <stdint.h>
+ #include <string.h>
+
+ bool
+--- a/usbhid-dump/lib/iface_list.c
++++ b/usbhid-dump/lib/iface_list.c
+@@ -30,6 +30,7 @@
+ #include <assert.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <stdint.h>
+
+ bool
+ uhd_iface_list_valid(const uhd_iface *list)
+--- a/usbhid-dump/src/usbhid-dump.c
++++ b/usbhid-dump/src/usbhid-dump.c
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ #include <getopt.h>
+ #include <stdio.h>
++#include <stdint.h>
+
+ /* Define LIBUSB_CALL for libusb <= 1.0.8 */
+ #ifndef LIBUSB_CALL
diff --git a/sys-apps/usbutils/metadata.xml b/sys-apps/usbutils/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/usbutils/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-apps/usbutils/usbutils-007.ebuild b/sys-apps/usbutils/usbutils-007.ebuild
new file mode 100644
index 000000000000..b4cd87bf5fc4
--- /dev/null
+++ b/sys-apps/usbutils/usbutils-007.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 base python-single-r1
+
+DESCRIPTION="USB enumeration utilities"
+HOMEPAGE="http://linux-usb.sourceforge.net/"
+SRC_URI="mirror://kernel/linux/utils/usb/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python zlib"
+
+RDEPEND="virtual/libusb:1=
+ zlib? ( sys-libs/zlib:= )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ sys-apps/hwids
+ python? ( ${PYTHON_DEPS} )"
+PATCHES=( "${FILESDIR}"/${PN}-006-stdint.patch )
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ base_src_prepare
+ sed -i -e '/^usbids/s:/usr/share:/usr/share/misc:' lsusb.py || die
+ use python && python_fix_shebang lsusb.py
+}
+
+src_configure() {
+ econf \
+ --datarootdir="${EPREFIX}/usr/share" \
+ --datadir="${EPREFIX}/usr/share/misc" \
+ --disable-usbids \
+ $(use_enable zlib)
+}
+
+src_install() {
+ default
+ newdoc usbhid-dump/NEWS NEWS.usbhid-dump
+
+ use python || rm -f "${ED}"/usr/bin/lsusb.py
+}
diff --git a/sys-apps/usbutils/usbutils-008-r1.ebuild b/sys-apps/usbutils/usbutils-008-r1.ebuild
new file mode 100644
index 000000000000..d76c85534866
--- /dev/null
+++ b/sys-apps/usbutils/usbutils-008-r1.ebuild
@@ -0,0 +1,50 @@
+# 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
+
+DESCRIPTION="USB enumeration utilities"
+HOMEPAGE="http://linux-usb.sourceforge.net/"
+SRC_URI="mirror://kernel/linux/utils/usb/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+CDEPEND="virtual/libusb:1=
+ virtual/libudev:="
+DEPEND="${CDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ sys-apps/hwids
+ python? ( ${PYTHON_DEPS} )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-006-stdint.patch
+ sed -i -e '/^usbids/s:/usr/share:/usr/share/misc:' lsusb.py || die
+ use python && python_fix_shebang lsusb.py
+}
+
+src_configure() {
+ econf \
+ --datarootdir="${EPREFIX}/usr/share" \
+ --datadir="${EPREFIX}/usr/share/misc"
+}
+
+src_install() {
+ default
+ newdoc usbhid-dump/NEWS NEWS.usbhid-dump
+
+ use python || rm -f "${ED}"/usr/bin/lsusb.py
+}
diff --git a/sys-apps/usbutils/usbutils-008.ebuild b/sys-apps/usbutils/usbutils-008.ebuild
new file mode 100644
index 000000000000..71328fd75882
--- /dev/null
+++ b/sys-apps/usbutils/usbutils-008.ebuild
@@ -0,0 +1,52 @@
+# 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
+
+DESCRIPTION="USB enumeration utilities"
+HOMEPAGE="http://linux-usb.sourceforge.net/"
+SRC_URI="mirror://kernel/linux/utils/usb/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="python zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="virtual/libusb:1=
+ zlib? ( sys-libs/zlib:= )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ sys-apps/hwids
+ python? ( ${PYTHON_DEPS} )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-006-stdint.patch
+ sed -i -e '/^usbids/s:/usr/share:/usr/share/misc:' lsusb.py || die
+ use python && python_fix_shebang lsusb.py
+}
+
+src_configure() {
+ econf \
+ --datarootdir="${EPREFIX}/usr/share" \
+ --datadir="${EPREFIX}/usr/share/misc" \
+ --disable-usbids \
+ $(use_enable zlib)
+}
+
+src_install() {
+ default
+ newdoc usbhid-dump/NEWS NEWS.usbhid-dump
+
+ use python || rm -f "${ED}"/usr/bin/lsusb.py
+}
diff --git a/sys-apps/usermode-utilities/Manifest b/sys-apps/usermode-utilities/Manifest
new file mode 100644
index 000000000000..9017b8dfcc69
--- /dev/null
+++ b/sys-apps/usermode-utilities/Manifest
@@ -0,0 +1 @@
+DIST uml_utilities_20070815.tar.bz2 50159 SHA256 f815f591a1c177729546969acf720958c5fd72b8d4d36bae26fdc5b64669b60e SHA512 a246ca04bcba2282ceb976e69399f496cc85d14ee13c1e4704f943d7fcef032eda92e9e8c4341f6e8878c6353ed97c7f77b283e62e152987c792a7a6258f1d1a WHIRLPOOL 343e755da98d3d6a714a7c26cc917b01af7fc737c4a24806ad04c902e5a919cfdd831c3b18d7a2c5c7a271266f58d167ab9a788543b5a0f5671b9a6b639a37b1
diff --git a/sys-apps/usermode-utilities/files/usermode-utilities-20070815-humfsify-owner.patch b/sys-apps/usermode-utilities/files/usermode-utilities-20070815-humfsify-owner.patch
new file mode 100644
index 000000000000..9d02498052f0
--- /dev/null
+++ b/sys-apps/usermode-utilities/files/usermode-utilities-20070815-humfsify-owner.patch
@@ -0,0 +1,12 @@
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/humfsify/Makefile tools-20070815/humfsify/Makefile
+--- tools-20070815.orig/humfsify/Makefile 2006-05-25 14:37:01.000000000 -0400
++++ tools-20070815/humfsify/Makefile 2011-05-02 11:04:32.531034342 -0400
+@@ -4,7 +4,7 @@ all:
+
+ install:
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -o 0755 $(BIN) $(DESTDIR)$(BIN_DIR)
++ install -m 0755 $(BIN) $(DESTDIR)$(BIN_DIR)
+
+ clean:
+ rm -f *~
diff --git a/sys-apps/usermode-utilities/files/usermode-utilities-20070815-rollup.patch b/sys-apps/usermode-utilities/files/usermode-utilities-20070815-rollup.patch
new file mode 100644
index 000000000000..f88e20663f5b
--- /dev/null
+++ b/sys-apps/usermode-utilities/files/usermode-utilities-20070815-rollup.patch
@@ -0,0 +1,101 @@
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/jail/Makefile tools-20070815/jail/Makefile
+--- tools-20070815.orig/jail/Makefile 2006-02-27 14:51:46.000000000 -0500
++++ tools-20070815/jail/Makefile 2010-08-04 22:17:56.869103217 -0400
+@@ -11,7 +11,7 @@ $(BIN) : $(OBJS)
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(SBIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(SBIN_DIR)
++ install $(BIN) $(DESTDIR)$(SBIN_DIR)
+
+ clean :
+ rm -rf *~ $(BIN) $(OBJS) cell[0-9]* core* tty_log_cell*
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/jailtest/Makefile tools-20070815/jailtest/Makefile
+--- tools-20070815.orig/jailtest/Makefile 2006-02-27 14:52:53.000000000 -0500
++++ tools-20070815/jailtest/Makefile 2010-08-04 22:17:56.870032258 -0400
+@@ -14,4 +14,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/mconsole/Makefile tools-20070815/mconsole/Makefile
+--- tools-20070815.orig/mconsole/Makefile 2006-02-27 15:03:01.000000000 -0500
++++ tools-20070815/mconsole/Makefile 2010-08-04 22:17:56.916031770 -0400
+@@ -15,4 +15,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/moo/Makefile tools-20070815/moo/Makefile
+--- tools-20070815.orig/moo/Makefile 2006-02-27 15:08:49.000000000 -0500
++++ tools-20070815/moo/Makefile 2010-08-04 22:17:56.938282085 -0400
+@@ -23,4 +23,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/port-helper/Makefile tools-20070815/port-helper/Makefile
+--- tools-20070815.orig/port-helper/Makefile 2006-02-27 15:18:40.000000000 -0500
++++ tools-20070815/port-helper/Makefile 2010-08-04 22:17:56.938282085 -0400
+@@ -15,4 +15,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(LIB_DIR)
+- install -s $(BIN) $(DESTDIR)$(LIB_DIR)
++ install $(BIN) $(DESTDIR)$(LIB_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/tunctl/Makefile tools-20070815/tunctl/Makefile
+--- tools-20070815.orig/tunctl/Makefile 2006-02-27 15:19:52.000000000 -0500
++++ tools-20070815/tunctl/Makefile 2010-08-04 22:17:56.939282225 -0400
+@@ -14,4 +14,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/umlfs/Makefile tools-20070815/umlfs/Makefile
+--- tools-20070815.orig/umlfs/Makefile 2006-02-27 16:11:25.000000000 -0500
++++ tools-20070815/umlfs/Makefile 2010-08-04 22:17:56.940282085 -0400
+@@ -16,4 +16,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/uml_net/Makefile tools-20070815/uml_net/Makefile
+--- tools-20070815.orig/uml_net/Makefile 2006-02-27 15:19:52.000000000 -0500
++++ tools-20070815/uml_net/Makefile 2010-08-04 22:23:40.459151826 -0400
+@@ -2,6 +2,7 @@ TUNTAP = $(shell [ -e /usr/include/linux
+
+ BIN = uml_net
+ CFLAGS ?= -g -Wall
++LDFLAGS += -Wl,-z,now
+ override CFLAGS += $(TUNTAP)
+
+ BIN_DIR ?= /usr/bin
+@@ -22,4 +23,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s -m 04755 $(BIN) $(DESTDIR)$(BIN_DIR)
++ install -m 04755 $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/uml_switch/Makefile tools-20070815/uml_switch/Makefile
+--- tools-20070815.orig/uml_switch/Makefile 2006-02-27 15:20:26.000000000 -0500
++++ tools-20070815/uml_switch/Makefile 2010-08-04 22:17:56.942283133 -0400
+@@ -21,4 +21,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
+diff '--exclude-from=/home/dang/.scripts/diffrc' -up -ruN tools-20070815.orig/watchdog/Makefile tools-20070815/watchdog/Makefile
+--- tools-20070815.orig/watchdog/Makefile 2006-02-27 15:55:34.000000000 -0500
++++ tools-20070815/watchdog/Makefile 2010-08-04 22:17:56.943282225 -0400
+@@ -14,4 +14,4 @@ clean :
+
+ install : $(BIN)
+ install -d $(DESTDIR)$(BIN_DIR)
+- install -s $(BIN) $(DESTDIR)$(BIN_DIR)
++ install $(BIN) $(DESTDIR)$(BIN_DIR)
diff --git a/sys-apps/usermode-utilities/metadata.xml b/sys-apps/usermode-utilities/metadata.xml
new file mode 100644
index 000000000000..7741f8287f94
--- /dev/null
+++ b/sys-apps/usermode-utilities/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>
+<use>
+ <flag name='fuse'>Build tools (currently umlmount) needing fuse</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/usermode-utilities/usermode-utilities-20070815-r3.ebuild b/sys-apps/usermode-utilities/usermode-utilities-20070815-r3.ebuild
new file mode 100644
index 000000000000..b6ae228bc591
--- /dev/null
+++ b/sys-apps/usermode-utilities/usermode-utilities-20070815-r3.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
+
+DESCRIPTION="Tools for use with Usermode Linux virtual machines"
+HOMEPAGE="http://user-mode-linux.sourceforge.net/"
+SRC_URI="http://user-mode-linux.sourceforge.net/uml_utilities_${PV}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+IUSE="fuse"
+
+RDEPEND="fuse? ( sys-fs/fuse )
+ sys-libs/readline:0="
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}"/tools-${PV}
+
+src_prepare() {
+ # Merge previous patches with fix for bug #331099
+ epatch "${FILESDIR}"/${P}-rollup.patch
+ # Fix owner of humfsify; bug #364531
+ epatch "${FILESDIR}"/${P}-humfsify-owner.patch
+ sed -i -e 's:-o \$(BIN):$(LDFLAGS) -o $(BIN):' "${S}"/*/Makefile || die "LDFLAGS sed failed"
+ sed -i -e 's:-o \$@:$(LDFLAGS) -o $@:' "${S}"/moo/Makefile || die "LDFLAGS sed (moo) failed"
+ if ! use fuse; then
+ einfo "Skipping build of umlmount to avoid sys-fs/fuse dependency."
+ sed -i -e 's/\<umlfs\>//' Makefile || die "sed to remove sys-fs/fuse dependency failed"
+ fi
+}
+
+src_compile() {
+ tc-export AR CC
+ emake CFLAGS="${CFLAGS} ${CPPFLAGS} -DTUNTAP -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -g -Wall" all
+}
diff --git a/sys-apps/utempter/Manifest b/sys-apps/utempter/Manifest
new file mode 100644
index 000000000000..c2858cdd5e7c
--- /dev/null
+++ b/sys-apps/utempter/Manifest
@@ -0,0 +1 @@
+DIST utempter-0.5.5-6.src.rpm 21099 SHA256 617c28d579fa54349b8a706e8346c2442f2ef39523db7e0501701a0919651f3c
diff --git a/sys-apps/utempter/files/utempter-0.5.5.6-build.patch b/sys-apps/utempter/files/utempter-0.5.5.6-build.patch
new file mode 100644
index 000000000000..8fbfb111196f
--- /dev/null
+++ b/sys-apps/utempter/files/utempter-0.5.5.6-build.patch
@@ -0,0 +1,11 @@
+--- Makefile
++++ Makefile
+@@ -37,7 +37,7 @@
+ ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(SOMAJOR)
+
+ $(SHAREDLIB): utmpintf.os
+- $(CC) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
++ $(CC) $(LDFLAGS) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
+
+ utmpintf.o: utmpintf.c utempter.h
+
diff --git a/sys-apps/utempter/files/utempter-0.5.5.6-no_utmpx.patch b/sys-apps/utempter/files/utempter-0.5.5.6-no_utmpx.patch
new file mode 100644
index 000000000000..8644db837f4a
--- /dev/null
+++ b/sys-apps/utempter/files/utempter-0.5.5.6-no_utmpx.patch
@@ -0,0 +1,38 @@
+--- utempter-0.5.5/utempter.c.mps 2004-12-11 14:54:06.000000000 +0100
++++ utempter-0.5.5/utempter.c 2004-12-11 14:57:46.000000000 +0100
+@@ -11,7 +11,9 @@
+ #include <sys/stat.h>
+ #include <sys/sysmacros.h>
+ #include <utmp.h>
++#ifndef __UCLIBC__
+ #include <utmpx.h>
++#endif
+ #include <unistd.h>
+
+ static void usage(void) {
+@@ -82,7 +84,11 @@
+ }
+
+ int main(int argc, const char ** argv) {
++#ifndef __UCLIBC__
+ struct utmpx utx;
++#else
++ struct utmp utx;
++#endif
+ int add;
+ const char * device, * host;
+ struct passwd * pw;
+@@ -154,8 +160,13 @@
+
+ gettimeofday(&utx.ut_tv, NULL);
+
++#ifndef __UCLIBC__
+ pututxline(&utx);
+ updwtmpx(_PATH_WTMP, &utx);
++#else
++ pututline(&utx);
++ updwtmp(_PATH_WTMP, &utx);
++#endif
+
+ return 0;
+ }
diff --git a/sys-apps/utempter/files/utempter-0.5.5.6-soname-makefile-fix.patch b/sys-apps/utempter/files/utempter-0.5.5.6-soname-makefile-fix.patch
new file mode 100644
index 000000000000..123c77eb357c
--- /dev/null
+++ b/sys-apps/utempter/files/utempter-0.5.5.6-soname-makefile-fix.patch
@@ -0,0 +1,22 @@
+--- Makefile.orig 2005-04-15 08:54:32.000000000 -0400
++++ Makefile 2005-04-15 08:56:17.000000000 -0400
+@@ -5,6 +5,10 @@
+ CVSROOT=$(shell cat CVS/Root)
+ # major number of the .so lib
+ SOMAJOR = 0
++# minor number of the .so lib
++SOMINOR = 5
++# micro number of the .so lib
++SOMICRO = 5
+
+ SHAREDLIB = lib$(NAME).so
+ SONAME = $(SHAREDLIB).$(SOMAJOR)
+@@ -29,6 +33,8 @@
+ install -m 644 utempter.h $(RPM_BUILD_ROOT)/usr/include
+ install -m 644 $(SHAREDLIB) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(VERSION)
+ ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB)
++ ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(SOMAJOR).$(SOMINOR)
++ ln -sf $(SHAREDLIB).$(VERSION) $(RPM_BUILD_ROOT)/$(LIBDIR)/$(SHAREDLIB).$(SOMAJOR)
+
+ $(SHAREDLIB): utmpintf.os
+ $(CC) -o $@ -shared -Wl,-soname,$(SONAME) $^ -lc
diff --git a/sys-apps/utempter/metadata.xml b/sys-apps/utempter/metadata.xml
new file mode 100644
index 000000000000..5aafc105dd09
--- /dev/null
+++ b/sys-apps/utempter/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>base-system</herd>
+ <herd>x11</herd>
+</pkgmetadata>
diff --git a/sys-apps/utempter/utempter-0.5.5.6.ebuild b/sys-apps/utempter/utempter-0.5.5.6.ebuild
new file mode 100644
index 000000000000..56c86ef66878
--- /dev/null
+++ b/sys-apps/utempter/utempter-0.5.5.6.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit rpm eutils user
+
+MY_P=${P%.*}-${PV##*.}
+S=${WORKDIR}/${P%.*}
+DESCRIPTION="App that allows non-privileged apps to write utmp (login) info"
+HOMEPAGE="http://www.redhat.com/"
+SRC_URI="mirror://gentoo/${MY_P}.src.rpm"
+
+LICENSE="|| ( MIT LGPL-2 )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
+IUSE=""
+
+RDEPEND="!sys-libs/libutempter
+ !dev-python/utmp"
+
+pkg_setup() {
+ enewgroup utmp 406
+}
+
+src_unpack() {
+ rpm_src_unpack
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-soname-makefile-fix.patch
+ epatch "${FILESDIR}"/${P}-no_utmpx.patch
+ epatch "${FILESDIR}"/${P}-build.patch
+}
+
+src_compile() {
+ emake RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" || die
+}
+
+src_install() {
+ emake \
+ RPM_BUILD_ROOT="${D}" \
+ LIBDIR=/usr/$(get_libdir) \
+ install || die
+ dobin utmp || die
+
+ fowners root:utmp /usr/sbin/utempter
+ fperms 2755 /usr/sbin/utempter
+}
+
+pkg_postinst() {
+ if [ -f "${ROOT}"/var/log/wtmp ] ; then
+ chown root:utmp "${ROOT}"/var/log/wtmp
+ chmod 664 "${ROOT}"/var/log/wtmp
+ fi
+ if [ -f "${ROOT}"/var/run/utmp ] ; then
+ chown root:utmp "${ROOT}"/var/run/utmp
+ chmod 664 "${ROOT}"/var/run/utmp
+ fi
+}
diff --git a/sys-apps/util-linux/Manifest b/sys-apps/util-linux/Manifest
new file mode 100644
index 000000000000..2fa166266b13
--- /dev/null
+++ b/sys-apps/util-linux/Manifest
@@ -0,0 +1,7 @@
+DIST util-linux-2.24.1.tar.xz 3543692 SHA256 835eb6232cfab0118ef2e4fd649de0ba9f5bd1b8cbf9a7d4d84594541dec8410 SHA512 5636e1c57bd57954518e90ff0f079810cc2927f52bb925dde556ce2744a088577f8adbc19c19b2bd079efd253406767faa44d1de5f557e024762522e647f044b WHIRLPOOL 25862a85788eb1c275c7e06f3d2be8e6a9605811665e06a4b21d1e274fc4a5e19dd03e5c52061ee5d98ce8c86ba757a7f8076683edb603ad0c43c05ab5e52a51
+DIST util-linux-2.24.2.tar.xz 3586580 SHA256 1243d6c07f1c5b38aa4c3814c81a71c24cba7dafe08942916bf216a90a460ff0 SHA512 a0c03876ef19fa09e434e3e5362fb3f3e0a254b3b39a623ac7a9a207d06afce00366792244ed0fac86931f8340c046620660f33c3444a07a12037182fc191240 WHIRLPOOL 4b8185e1832145c050a8aa0761ae017d846ed58cd7e07710e4c32bf92a8f6e530bddb56dab70c8025eddb4cafafed79e658b0aced3a190b61b508078a438a9ed
+DIST util-linux-2.25.1.tar.xz 3695172 SHA256 4701305ae22790c3a92ce48e50794fa05b7ee01f4227f419a171c100d08986e8 SHA512 a670cb4318beed0a455efb339ebea6ec7c5d672e15877e7e25cae2ec9c0795fbe4275b6c85a590467c3de92ab2f64cdcd0427c9a2a6e4c6b76f563592fb7be8d WHIRLPOOL 44c17bd3ad0b05c47bb955b934011b460c3992ea5d5b43977d2001b245820b775e16bedbaa10ff9c223d59b0809674884c76f0dc34d707864d17b49b4deaab9d
+DIST util-linux-2.25.2.tar.xz 3703644 SHA256 e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6 SHA512 cf8c5bde78f844425150c2a81bdecb87aa57bcd5cebd177a78160835627f58037fa2cfe4db26fd8f35eedb3beb499a91492a297a27d065465e2ea0c6218dc387 WHIRLPOOL dd1685f2e694bf3de95acc3ba3170d231426c18c3395a867c815bbd3ab5ee0f07567b49d0ae083ce669c89db711e39fd2b990bc7321985ec2279d78816ec5258
+DIST util-linux-2.26.1.tar.xz 3859740 SHA256 22dc1c957262e2cbdfb4d524a63d5cd4f219d3ac9b5eab570fc771076799bb6e SHA512 9321793b3fa219ffc46e10639b9e45094c3cae6c48be4b80e652d9768f40dcedbd49342e17345b61c85f46540a7bd93d118a8e226c315e112bb2e959e2855ad9 WHIRLPOOL 1bcd5c3c14c278ec3b10535546706b6830a283fd72e7d1933101bf1ab6ec5b03d9ff7a53745d34a97cbb4d7d1b0e35852bb841be4b53a55c2aca07624bf06fbd
+DIST util-linux-2.26.2.tar.xz 3863868 SHA256 0e29bda142528a48a0a953c39ff63093651a4809042e1790fbd6aa8663fd9666 SHA512 1cb8e2f32882b3f496d31c250a45cfb61bedb79f7a2802b358c23134d4257fa9bc9cde8888cfa1aaba12109f82b93345c6dc0bec2d11629ffa084f2a4476a91b WHIRLPOOL 699ff057f9930fe53f44090817c64ffe089345e7aba4c836e18cd3d2088881add805640b0e41b8d60bc08e3632be919025417feb9c2ddda454c87821a59122ed
+DIST util-linux-2.26.tar.xz 3847960 SHA256 a23c6f39dea0ed215ccd589509ffc7bb6f706f6e1a04760f493fb0fd7e93c489 SHA512 af07d49a433fce683da7bdf9aea5693ad108aa16166e0147716175bd779fe5090029617dd7db153bc0f5efcf7bdd377761a616efd4cca90a87bf317132ede88c WHIRLPOOL 4f7c9463bfe1523819671824de26e051c496c86884ca34b25208762179345c799fe61e566228ebfcbca2f2b63163539e37b06e438a58f562cf7b53f954564150
diff --git a/sys-apps/util-linux/files/crypto-loop.confd b/sys-apps/util-linux/files/crypto-loop.confd
new file mode 100644
index 000000000000..6a8843462082
--- /dev/null
+++ b/sys-apps/util-linux/files/crypto-loop.confd
@@ -0,0 +1,9 @@
+# /etc/conf.d/crypto-loop: Configuration file for /etc/init.d/crypto-loop
+
+# More info can be found in the init.d script
+
+# Specify loopback configurations here. The format of this file is
+# shown in the following commented-out example. One line per loopback
+# configuration. For possible hash values, see `man hashalot`.
+
+# loop=/dev/loop0 hash='' cipher=serpent keysize=256 device=/dev/system/test other=''
diff --git a/sys-apps/util-linux/files/crypto-loop.initd b/sys-apps/util-linux/files/crypto-loop.initd
new file mode 100755
index 000000000000..2f6470d6b7bf
--- /dev/null
+++ b/sys-apps/util-linux/files/crypto-loop.initd
@@ -0,0 +1,70 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ if [ -x /etc/init.d/root ]; then
+ need root
+ else
+ need checkroot
+ fi
+ need modules
+ before localmount
+}
+
+start() {
+ local status="0"
+
+ ebegin "Starting crypto loop devices"
+
+ if [ -e /etc/conf.d/crypto-loop ] ; then
+ egrep "^loop" /etc/conf.d/crypto-loop | \
+ while read loopline ; do
+ eval ${loopline}
+
+ local configured=$(awk -v MOUNT="${device}" \
+ '($2 == MOUNT) { print "yes" }' /proc/mounts)
+
+ if [ "${configured}" != "yes" ] ; then
+ einfo " Loop ${loop} on device ${device} (cipher ${cipher}, key size ${keysize}): "
+
+ if [ -n "${hash}" ] ; then
+ /usr/sbin/hashalot -n ${keysize} ${hash} </dev/tty|\
+ /sbin/losetup -p 0 -e ${cipher}-${keysize} ${loop} ${device} ${other}
+ else
+ /sbin/losetup -e ${cipher}-${keysize} ${loop} ${device} ${other}
+ fi
+
+ if [ $? -ne 0 ] ; then
+ ewarn "Failure configuring ${loop}. Skipping."
+ status=1
+ fi
+ else
+ ewarn " Loop ${loop} on device ${device} are already configured"
+ fi
+ done
+ fi
+ ewend ${status} "Failed to start some loop devices."
+
+ # We do not fail if some loop devices did not start ...
+ return 0
+}
+
+stop() {
+ local status="0"
+ for loop in $(ls /dev/loop[0-9] 2>/dev/null) ; do
+ losetup ${loop} > /dev/null 2>&1
+ if [ $? -eq 0 ] ; then
+ ( umount ${loop} || swapoff "${loop}" ) >/dev/null 2>&1
+ if ! /sbin/losetup -d ${loop} > /dev/null 2>&1; then
+ ewarn "Failure deconfiguring ${loop}."
+ status=1
+ fi
+ fi
+ done
+ ewend ${status}
+}
+
+
+# vim:ts=4
diff --git a/sys-apps/util-linux/files/util-linux-2.24-fix-fdisk-on-alpha.patch b/sys-apps/util-linux/files/util-linux-2.24-fix-fdisk-on-alpha.patch
new file mode 100644
index 000000000000..f01a55d6e662
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24-fix-fdisk-on-alpha.patch
@@ -0,0 +1,13 @@
+--- libfdisk/src/bsd.c.orig 2014-06-11 10:15:47.000000000 +0200
++++ libfdisk/src/bsd.c 2014-06-11 10:16:18.000000000 +0200
+@@ -787,8 +787,10 @@
+ case 0x06: /* DOS 16-bit >=32M */
+ case 0xe1: /* DOS access */
+ case 0xe3: /* DOS R/O */
++#if !defined (__alpha__)
+ case 0xf2: /* DOS secondary */
+ return BSD_FS_MSDOS;
++#endif
+ case 0x07: /* OS/2 HPFS */
+ return BSD_FS_HPFS;
+ default:
diff --git a/sys-apps/util-linux/files/util-linux-2.24-last-tests.patch b/sys-apps/util-linux/files/util-linux-2.24-last-tests.patch
new file mode 100644
index 000000000000..77cf478e398a
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24-last-tests.patch
@@ -0,0 +1,86 @@
+https://bugs.gentoo.org/501408
+
+From 3c76515abd2e80dc1da03041eb868b8c1e596fb1 Mon Sep 17 00:00:00 2001
+From: Sami Kerola <kerolasa@iki.fi>
+Date: Sun, 16 Feb 2014 23:54:18 +0000
+Subject: [PATCH] tests: align last.1 with recent phantom detection
+
+None existing account is not still-logged-in but gone mysteriously,
+assuming wtmp logout markup is missing.
+
+Signed-off-by: Sami Kerola <kerolasa@iki.fi>
+---
+ tests/expected/last/last | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/expected/last/last b/tests/expected/last/last
+index 2ff5cc1..dfb140b 100644
+--- a/tests/expected/last/last
++++ b/tests/expected/last/last
+@@ -1,6 +1,6 @@
+ ~~~ basic output ~~~
+ rick long never-gonna-logo Thu Jan 1 00:00 - 03:14 (24855+03:14)
+-torvalds linux hobby Mon Aug 26 00:57 still logged in
++torvalds linux hobby Mon Aug 26 00:57 gone - no logout
+ reboot system boot system-name Wed Aug 28 18:00 still running
+ reboot system boot system-name Wed Aug 28 16:00 - 17:00 (01:00)
+ IPv4 root dns-server Wed Aug 28 13:00 - 14:00 (01:00)
+@@ -17,7 +17,7 @@ accounti foo nine Wed Aug 28 03:00 - 04:00 (01:00)
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ include system ~~~
+ rick long never-gonna-logo Thu Jan 1 00:00 - 03:14 (24855+03:14)
+-torvalds linux hobby Mon Aug 26 00:57 still logged in
++torvalds linux hobby Mon Aug 26 00:57 gone - no logout
+ reboot system boot system-name Wed Aug 28 18:00 still running
+ shutdown system down system-name Wed Aug 28 17:00 - 18:00 (01:00)
+ reboot system boot system-name Wed Aug 28 16:00 - 17:00 (01:00)
+@@ -47,16 +47,16 @@ IPv4 root Wed Aug 28 13:00 - 14:00 (01:00) a.root-servers.net
+
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ show ip ~~~
+-torvalds linux 128.214.205.14 Mon Aug 26 00:57 still logged in
++torvalds linux 128.214.205.14 Mon Aug 26 00:57 gone - no logout
+
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ no host ~~~
+-torvalds linux Mon Aug 26 00:57 still logged in
++torvalds linux Mon Aug 26 00:57 gone - no logout
+
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ full times ~~~
+ rick long never-gonna-logo Thu Jan 1 00:00:00 1970 - Tue Jan 19 03:14:07 2038 (24855+03:14)
+-torvalds linux hobby Mon Aug 26 00:57:08 1991 still logged in
++torvalds linux hobby Mon Aug 26 00:57:08 1991 gone - no logout
+ reboot system boot system-name Wed Aug 28 18:00:00 2013 still running
+ reboot system boot system-name Wed Aug 28 16:00:00 2013 - Wed Aug 28 17:00:00 2013 (01:00)
+ IPv4 root dns-server Wed Aug 28 13:00:00 2013 - Wed Aug 28 14:00:00 2013 (01:00)
+@@ -73,7 +73,7 @@ accounti foo nine Wed Aug 28 03:00:00 2013 - Wed Aug 28 04:
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ no time ~~~
+ rick long never-gonna-logo (24855+03:14)
+-torvalds linux hobby logged in
++torvalds linux hobby - no logout
+ reboot system boot system-name running
+ reboot system boot system-name (01:00)
+ IPv4 root dns-server (01:00)
+@@ -90,7 +90,7 @@ accounti foo nine (01:00)
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ iso-8601 time ~~~
+ rick long never-gonna-logout 1970-01-01T00:00:00+0000 - 2038-01-19T03:14:07+0000 (24855+03:14)
+-torvalds linux hobby 1991-08-26T00:57:08+0000 still logged in
++torvalds linux hobby 1991-08-26T00:57:08+0000 gone - no logout
+ reboot system boot system-name 2013-08-28T18:00:00+0000 still running
+ reboot system boot system-name 2013-08-28T16:00:00+0000 - 2013-08-28T17:00:00+0000 (01:00)
+ IPv4 root dns-server 2013-08-28T13:00:00+0000 - 2013-08-28T14:00:00+0000 (01:00)
+@@ -115,7 +115,7 @@ accounti foo nine Wed Aug 28 03:00 - 04:00 (01:00)
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ present ~~~
+ rick long never-gonna-logo Thu Jan 1 00:00 - 03:14 (24855+03:14)
+-torvalds linux hobby Mon Aug 26 00:57 still logged in
++torvalds linux hobby Mon Aug 26 00:57 gone - no logout
+ runlevel foo one Wed Aug 28 11:00 - 12:00 (01:00)
+
+ wtmp begins Wed Aug 28 03:00:00 2013
+--
+1.8.5.5
+
diff --git a/sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch b/sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch
new file mode 100644
index 000000000000..5148053d27e3
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch
@@ -0,0 +1,41 @@
+From 6b55612b9ad1193a042f3c3a1d9216e63b0d2907 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 22 Dec 2013 18:17:15 -0500
+Subject: [PATCH] tests: last: skip when last is not enabled
+
+References: https://bugs.gentoo.org/489794
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ tests/ts/last/ipv6 | 2 ++
+ tests/ts/last/last | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/tests/ts/last/ipv6 b/tests/ts/last/ipv6
+index 8e2b01e..60b72bd 100755
+--- a/tests/ts/last/ipv6
++++ b/tests/ts/last/ipv6
+@@ -18,6 +18,8 @@ TS_DESC="last ipv6"
+ . $TS_TOPDIR/functions.sh
+ ts_init "$*"
+
++[ -x $TS_CMD_LAST ] || ts_skip "last not enabled"
++
+ export LANG=C
+ export TZ=GMT
+
+diff --git a/tests/ts/last/last b/tests/ts/last/last
+index 4ad38cb..83b7f8d 100755
+--- a/tests/ts/last/last
++++ b/tests/ts/last/last
+@@ -18,6 +18,8 @@ TS_DESC="last"
+ . $TS_TOPDIR/functions.sh
+ ts_init "$*"
+
++[ -x $TS_CMD_LAST ] || ts_skip "last not enabled"
++
+ export LANG=C
+ export TZ=GMT
+
+--
+1.8.4.3
+
diff --git a/sys-apps/util-linux/files/util-linux-2.25-parallel-setarch.patch b/sys-apps/util-linux/files/util-linux-2.25-parallel-setarch.patch
new file mode 100644
index 000000000000..e694af548575
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-parallel-setarch.patch
@@ -0,0 +1,33 @@
+From 762b4d8691c46964dfc0d40dab772191538c807a Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Sun, 3 May 2015 23:37:04 -0400
+Subject: [PATCH] build-sys: fix parallel builds w/setarch links
+
+The symlink generation tries to write to the sys-utils/ subdir but does
+not make sure that dir exists. This can sometimes lead to parallel build
+failures when building out-of-tree like:
+...
+echo ".so man8/setarch.8" > sys-utils/linux64.8
+/bin/bash: sys-utils/linux64.8: No such file or directory
+Makefile:11503: recipe for target 'sys-utils/linux64.8' failed
+make: *** [sys-utils/linux64.8] Error 1
+
+URL: https://bugs.gentoo.org/511812
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+---
+ sys-utils/Makemodule.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -10806,6 +10806,7 @@ install-exec-hook:
+ @BUILD_VIPW_TRUE@ cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
+
+ @BUILD_SETARCH_TRUE@$(SETARCH_MAN_LINKS):
++@BUILD_SETARCH_TRUE@ $(AM_V_at) test -d $(dir $@) || mkdir -p $(dir $@)
+ @BUILD_SETARCH_TRUE@ $(AM_V_GEN)echo ".so man8/setarch.8" > $@
+
+ @BUILD_SETARCH_TRUE@install-exec-hook-setarch:
+--
+2.4.0
+
diff --git a/sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch b/sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch
new file mode 100644
index 000000000000..f994a74a6696
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25.1-blkid-probe-fix.patch
@@ -0,0 +1,43 @@
+From 00749bc366fe6106df918660a92a388cfff4f35f Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Tue, 7 Oct 2014 12:44:34 +0200
+Subject: [PATCH] libblkid: zeroize errno on blkid_probe_get_buffer() success
+
+Since 37f4060225df0591ab8e1dd676dbc8115d900d4f prober functions are
+sensitive to errno, it seems more robust to set errno=0 with in
+blkid_probe_get_buffer() on success than set the zero on all places
+where we call blkid_probe_get_buffer().
+
+Addresses: https://github.com/karelzak/util-linux/issues/119
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ libblkid/src/probe.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
+index 4fea3cc..3f7e43b 100644
+--- a/libblkid/src/probe.c
++++ b/libblkid/src/probe.c
+@@ -539,8 +539,10 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
+ struct list_head *p;
+ struct blkid_bufinfo *bf = NULL;
+
+- if (pr->size <= 0)
++ if (pr->size <= 0) {
++ errno = EINVAL;
+ return NULL;
++ }
+
+ if (pr->parent &&
+ pr->parent->devno == pr->devno &&
+@@ -602,6 +604,7 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
+ list_add_tail(&bf->bufs, &pr->buffers);
+ }
+
++ errno = 0;
+ return off ? bf->data + (off - bf->off) : bf->data;
+ }
+
+--
+2.1.2
+
diff --git a/sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch b/sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch
new file mode 100644
index 000000000000..85c48114dbd2
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/522288
+
+From a95987423c4d7781a14ffda34f082086cd51f4f7 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 24 Oct 2014 12:08:22 -0400
+Subject: [PATCH] bash-completion: fix runuser install
+
+The runuser symlink used to depend on su being enabled, but a refactoring
+broke that. So if you build with runuser enabled but not su, you end up
+with a broken symlink. Rework the logic so it works in both cases.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ bash-completion/Makemodule.am | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am
+index 271a6db..045c2d5 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -11071,7 +10823,8 @@
+ @BUILD_MOUNT_TRUE@@MAKEINSTALL_DO_SETUID_TRUE@ chmod 4755 $(DESTDIR)$(bindir)/umount
+
+ @BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@install-data-hook-bashcomp-runuser::
+-@BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@ ln -sf su $(DESTDIR)$(bashcompletiondir)/runuser
++@BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@@BUILD_SU_TRUE@ ln -sf su $(DESTDIR)$(bashcompletiondir)/runuser
++@BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@@BUILD_SU_FALSE@ cp $(top_srcdir)/bash-completion/su $(DESTDIR)$(bashcompletiondir)/runuser
+
+ clean-local-tests:
+ rm -rf $(top_builddir)/tests/output $(top_builddir)/tests/diff
+--
+2.1.2
+
diff --git a/sys-apps/util-linux/metadata.xml b/sys-apps/util-linux/metadata.xml
new file mode 100644
index 000000000000..8caf3fdd5a1d
--- /dev/null
+++ b/sys-apps/util-linux/metadata.xml
@@ -0,0 +1,20 @@
+<?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='caps'>build setpriv helper (run programs with diff capabilities)</flag>
+ <flag name='cramfs'>build mkfs/fsck helpers for cramfs filesystems</flag>
+ <flag name='cytune'>build cytune for Cyclades-Z multiport serial cards</flag>
+ <flag name='fdformat'>build fdformat (floppy disk format)</flag>
+ <flag name='pam'>build runuser helper</flag>
+ <flag name='suid'>
+ install mount/umount as setuid so non-root users may mount/umount devices,
+ and wall/write as setgid so non-root users can notify other users
+ </flag>
+ <flag name='tty-helpers'>install the mesg/wall/write tools for talking to local users</flag>
+</use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:andries_brouwer:util-linux</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/util-linux/util-linux-2.24.1-r2.ebuild b/sys-apps/util-linux/util-linux-2.24.1-r2.ebuild
new file mode 100644
index 000000000000..7a4d58759964
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.24.1-r2.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 python-single-r1
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 m68k ~mips ~ppc ~ppc64 s390 sh ~sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="bash-completion caps +cramfs cytune fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( sys-libs/libselinux )
+ slang? ( sys-libs/slang )
+ udev? ( virtual/udev )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ epatch "${FILESDIR}"/${PN}-2.24-skip-last-tests.patch #491742
+ epatch "${FILESDIR}"/${PN}-2.24-last-tests.patch #501408
+ # http://marc.info/?l=util-linux-ng&m=140223032032288&w=2
+ epatch "${FILESDIR}"/${PN}-2.24-fix-fdisk-on-alpha.patch
+ find tests/ -name bigyear -delete #489794
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.c
+}
+
+src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(usex pam) #485486
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --enable-fs-paths-extra=/usr/sbin:/bin:/usr/bin \
+ $(use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ $(use_enable bash-completion) \
+ $(use_enable caps setpriv) \
+ $(use_enable cramfs) \
+ $(use_enable cytune) \
+ $(use_enable fdformat) \
+ --with-ncurses=$(usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(use_enable tty-helpers wall) \
+ $(use_enable tty-helpers write) \
+ $(use_enable suid makeinstall-chown) \
+ $(use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(use_with slang) \
+ $(use_enable static-libs static) \
+ $(use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ use python && python_optimize
+
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount uuid
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.24.1-r3.ebuild b/sys-apps/util-linux/util-linux-2.24.1-r3.ebuild
new file mode 100644
index 000000000000..802a83849364
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.24.1-r3.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="bash-completion caps +cramfs cytune fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ udev? ( virtual/udev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ epatch "${FILESDIR}"/${PN}-2.24-skip-last-tests.patch #491742
+ epatch "${FILESDIR}"/${PN}-2.24-last-tests.patch #501408
+ # http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/9237
+ epatch "${FILESDIR}"/${PN}-2.24-fix-fdisk-on-alpha.patch
+ find tests/ -name bigyear -delete #489794
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ ECONF_SOURCE=${S} \
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --enable-fs-paths-extra=/usr/sbin:/bin:/usr/bin \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ $(multilib_native_use_enable bash-completion) \
+ $(multilib_native_use_enable caps setpriv) \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable cytune) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.24.2.ebuild b/sys-apps/util-linux/util-linux-2.24.2.ebuild
new file mode 100644
index 000000000000..8611c22e0efe
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.24.2.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs cytune fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ udev? ( virtual/udev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ epatch "${FILESDIR}"/${PN}-2.24-last-tests.patch #501408
+ # http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/9237
+ epatch "${FILESDIR}"/${PN}-2.24-fix-fdisk-on-alpha.patch
+ find tests/ -name bigyear -delete #489794
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable cytune) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.25.1-r1.ebuild b/sys-apps/util-linux/util-linux-2.25.1-r1.ebuild
new file mode 100644
index 000000000000..86dd9a675b02
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.1-r1.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ udev? ( virtual/udev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-blkid-probe-fix.patch
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.25.1.ebuild b/sys-apps/util-linux/util-linux-2.25.1.ebuild
new file mode 100644
index 000000000000..e2be221570df
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.1.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ udev? ( virtual/udev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.25.2-r1.ebuild b/sys-apps/util-linux/util-linux-2.25.2-r1.ebuild
new file mode 100644
index 000000000000..851ea3c3baed
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.2-r1.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/udev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-runuser-bash-completion.patch #522288
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.25.2-r2.ebuild b/sys-apps/util-linux/util-linux-2.25.2-r2.ebuild
new file mode 100644
index 000000000000..a2f2aa3d0f03
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.2-r2.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/libudev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-runuser-bash-completion.patch #522288
+ epatch "${FILESDIR}"/${PN}-2.25-parallel-setarch.patch #511812
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ # The scanf test in a run-time test which fails while cross-compiling.
+ # Blindly assume a POSIX setup since we require libmount, and libmount
+ # itself fails when the scanf test fails. #531856
+ tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ --docdir='${datarootdir}'/doc/${PF} \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.25.2.ebuild b/sys-apps/util-linux/util-linux-2.25.2.ebuild
new file mode 100644
index 000000000000..ee8c3e41cffc
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.2.ebuild
@@ -0,0 +1,174 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ udev? ( virtual/udev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-runuser-bash-completion.patch #522288
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.26.1-r1.ebuild b/sys-apps/util-linux/util-linux-2.26.1-r1.ebuild
new file mode 100644
index 000000000000..f16b9789a710
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.26.1-r1.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/libudev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ --docdir='${datarootdir}'/doc/${PF} \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS install-nodist_fdiskincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.26.1.ebuild b/sys-apps/util-linux/util-linux-2.26.1.ebuild
new file mode 100644
index 000000000000..f9b8df0a11b1
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.26.1.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/libudev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ --docdir='${datarootdir}'/doc/${PF} \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS install-nodist_fdiskincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.26.2.ebuild b/sys-apps/util-linux/util-linux-2.26.2.ebuild
new file mode 100644
index 000000000000..cd8859751d81
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.26.2.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2:=[unicode?] )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/libudev:= )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ # The scanf test in a run-time test which fails while cross-compiling.
+ # Blindly assume a POSIX setup since we require libmount, and libmount
+ # itself fails when the scanf test fails. #531856
+ tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ --docdir='${datarootdir}'/doc/${PF} \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS install-nodist_fdiskincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-2.26.ebuild b/sys-apps/util-linux/util-linux-2.26.ebuild
new file mode 100644
index 000000000000..f9b8df0a11b1
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.26.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/libudev )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ --docdir='${datarootdir}'/doc/${PF} \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS install-nodist_fdiskincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/util-linux/util-linux-9999.ebuild b/sys-apps/util-linux/util-linux-9999.ebuild
new file mode 100644
index 000000000000..cd8859751d81
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-9999.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+ python-single-r1 multilib-minimal systemd
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+ inherit git-2 autotools
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid systemd test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r7
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ !<app-shells/bash-completion-1.3-r2
+ caps? ( sys-libs/libcap-ng )
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2:=[unicode?] )
+ pam? ( sys-libs/pam )
+ python? ( ${PYTHON_DEPS} )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ slang? ( sys-libs/slang )
+ systemd? ( sys-apps/systemd )
+ udev? ( virtual/libudev:= )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bc )
+ virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ if [[ ${PV} == 9999 ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ elibtoolize
+}
+
+lfs_fallocate_test() {
+ # Make sure we can use fallocate with LFS #300307
+ cat <<-EOF > "${T}"/fallocate.${ABI}.c
+ #define _GNU_SOURCE
+ #include <fcntl.h>
+ main() { return fallocate(0, 0, 0, 0); }
+ EOF
+ append-lfs-flags
+ $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+ || export ac_cv_func_fallocate=no
+ rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+ lfs_fallocate_test
+ # The scanf test in a run-time test which fails while cross-compiling.
+ # Blindly assume a POSIX setup since we require libmount, and libmount
+ # itself fails when the scanf test fails. #531856
+ tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
+ export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+ export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
+ # We manually set --libdir to the default since on prefix, econf will set it to
+ # a value which the configure script does not recognize. This makes it set the
+ # usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+ --libdir='${prefix}/'"$(get_libdir)" \
+ --docdir='${datarootdir}'/doc/${PF} \
+ $(multilib_native_use_enable nls) \
+ --enable-agetty \
+ --with-bashcompletiondir="$(get_bashcompdir)" \
+ --enable-bash-completion \
+ $(multilib_native_use_enable caps setpriv) \
+ --disable-chfn-chsh \
+ $(multilib_native_use_enable cramfs) \
+ $(multilib_native_use_enable fdformat) \
+ --with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-login \
+ $(multilib_native_use_enable tty-helpers mesg) \
+ --disable-nologin \
+ --enable-partx \
+ $(multilib_native_use_with python) \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ $(multilib_native_use_enable tty-helpers wall) \
+ $(multilib_native_use_enable tty-helpers write) \
+ $(multilib_native_use_enable suid makeinstall-chown) \
+ $(multilib_native_use_enable suid makeinstall-setuid) \
+ $(use_with selinux) \
+ $(multilib_native_use_with slang) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with systemd) \
+ --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no") \
+ $(multilib_native_use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ # build libraries only
+ emake -f Makefile -f - mylibs \
+ <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+ install-pkgconfigDATA install-uuidincHEADERS \
+ install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+ install-nodist_smartcolsincHEADERS install-nodist_fdiskincHEADERS
+ fi
+
+ if multilib_is_native_abi; then
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount smartcols uuid
+
+ use python && python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ if ! use tty-helpers; then
+ elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+ fi
+
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+ fi
+}
diff --git a/sys-apps/v86d/Manifest b/sys-apps/v86d/Manifest
new file mode 100644
index 000000000000..9b48736a550c
--- /dev/null
+++ b/sys-apps/v86d/Manifest
@@ -0,0 +1 @@
+DIST v86d-0.1.10.tar.bz2 69819 SHA256 634964ae18ef68c8493add2ce150e3b4502badeb0d9194b4bd81241d25e6735c
diff --git a/sys-apps/v86d/metadata.xml b/sys-apps/v86d/metadata.xml
new file mode 100644
index 000000000000..9c1506a1eb33
--- /dev/null
+++ b/sys-apps/v86d/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>
+<use>
+ <flag name='x86emu'>Use x86emu for Video BIOS calls</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/v86d/v86d-0.1.10.ebuild b/sys-apps/v86d/v86d-0.1.10.ebuild
new file mode 100644
index 000000000000..5b6cd7d9f7e7
--- /dev/null
+++ b/sys-apps/v86d/v86d-0.1.10.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils flag-o-matic linux-info multilib
+
+DESCRIPTION="A daemon to run x86 code in an emulated environment"
+HOMEPAGE="http://dev.gentoo.org/~spock/projects/uvesafb/"
+SRC_URI="http://dev.gentoo.org/~spock/projects/uvesafb/archive/${P/_/-}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="debug x86emu"
+
+DEPEND="dev-libs/klibc"
+RDEPEND=""
+
+S="${WORKDIR}/${P//_*/}"
+
+pkg_setup() {
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ if [ -z "$(grep V86D ${ROOT}/usr/$(get_libdir)/klibc/include/linux/connector.h)" ]; then
+ eerror "You need to compile klibc against a kernel tree patched with uvesafb"
+ eerror "prior to merging this package."
+ die "Kernel not patched with uvesafb."
+ fi
+}
+
+src_configure() {
+ ./configure --with-klibc $(use_with debug) $(use_with x86emu) || die
+}
+
+src_compile() {
+ # Disable stack protector, as it does not work with klibc (bug #346397).
+ filter-flags -fstack-protector -fstack-protector-all
+ emake KDIR="${KV_DIR}" || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ dodoc README ChangeLog
+
+ insinto /usr/share/${PN}
+ doins misc/initramfs
+}
+
+pkg_postinst() {
+ elog "If you wish to place v86d into an initramfs image, you might want to use"
+ elog "'/usr/share/${PN}/initramfs' in your kernel's CONFIG_INITRAMFS_SOURCE."
+}
diff --git a/sys-apps/vbetool/Manifest b/sys-apps/vbetool/Manifest
new file mode 100644
index 000000000000..a2f0cdf04bae
--- /dev/null
+++ b/sys-apps/vbetool/Manifest
@@ -0,0 +1 @@
+DIST vbetool-1.1.tar.gz 182826 SHA256 4d26ddc43144593742349e69481e3536ce3482faaa9ad4494fdc7c8b7662f954 SHA512 09d8713516f074fe8e901ab3e24aba7e8b9ddf459b3ee3394b7604e4489a70a27c6dc3604cf1284c49233dba908f00da746c583562af2bc93b6df8ff413efd96 WHIRLPOOL 9b6d6b616c0b074e49c80291e48e2c951e83a2981780cf942ca535f2909e7e83a0d7cf1f9efdc6cea779a5db688635bb7a3740c3bd77a80a268776dea9b1d147
diff --git a/sys-apps/vbetool/files/vbetool-1.0-build.patch b/sys-apps/vbetool/files/vbetool-1.0-build.patch
new file mode 100644
index 000000000000..69d2f7b341ba
--- /dev/null
+++ b/sys-apps/vbetool/files/vbetool-1.0-build.patch
@@ -0,0 +1,18 @@
+Index: vbetool-1.0/Makefile.am
+===================================================================
+--- vbetool-1.0.orig/Makefile.am
++++ vbetool-1.0/Makefile.am
+@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = foreign
+
+ sbin_PROGRAMS = vbetool
+
+-vbetool_LDADD = $(libdir)/libpci.a
++vbetool_LDADD = -lpci -lz -lx86
+
+ man_MANS = vbetool.1
+ vbetool_SOURCES = vbetool.c $(x86)
+@@ -14,4 +14,3 @@ maintainer-clean-local:
+ $(RM) Makefile.in aclocal.m4 config.h.in stamp-h.in configure
+
+ AM_CFLAGS = -g -Wall -pedantic -std=gnu99
+-AM_LDFLAGS = -lz -lx86
diff --git a/sys-apps/vbetool/metadata.xml b/sys-apps/vbetool/metadata.xml
new file mode 100644
index 000000000000..ad3f22a0b39f
--- /dev/null
+++ b/sys-apps/vbetool/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>x11</herd>
+<maintainer>
+ <email>robbat2@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/vbetool/vbetool-1.1.ebuild b/sys-apps/vbetool/vbetool-1.1.ebuild
new file mode 100644
index 000000000000..b201b640ff97
--- /dev/null
+++ b/sys-apps/vbetool/vbetool-1.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils autotools
+
+DESCRIPTION="Run real-mode video BIOS code to alter hardware state (i.e. reinitialize video card)"
+HOMEPAGE="http://www.codon.org.uk/~mjg59/vbetool/"
+SRC_URI="http://www.codon.org.uk/~mjg59/vbetool/download/vbetool-1.1.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="sys-libs/zlib
+ sys-apps/pciutils
+ >=dev-libs/libx86-1.1-r1"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.0-build.patch
+ eaclocal # temp fix for #439614
+ eautoreconf
+}
+
+src_configure() {
+ econf --with-x86emu
+}
diff --git a/sys-apps/watchdog/Manifest b/sys-apps/watchdog/Manifest
new file mode 100644
index 000000000000..300c92b8fbea
--- /dev/null
+++ b/sys-apps/watchdog/Manifest
@@ -0,0 +1,2 @@
+DIST watchdog-5.13.tar.gz 201202 SHA256 141e0faf3ee4d8187a6ff4e00b18ef7b7a4ce432a2d4c8a6e6fdc62507fc6eb0 SHA512 ff68bc748446c060c86362105013d3ccf741e165d497d743a986d2dd28027e0290c83a67317d603d095a5d79c840991224aaa31b1bd2b66f6e858d3a35536d1f WHIRLPOOL 00c511d4a66d6adc3ad499b9348837261d672088527637db9a0b535550a3ce5cdf2b8fdf2a05ac039fb9111c81b8e9578dceddf759de418d305d5ffddf257584
+DIST watchdog-5.14.tar.gz 216384 SHA256 620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1 SHA512 ccfaca7a68a47cff42dbeae047dfa691e1cfc23851f9ca0634ea6315ff55a13cdbb0020bde7df38b702c82c0535ad41f520617dd639037e171701a6b0f8991aa WHIRLPOOL 5520e0a4970a20c25780d507260380acf2056828bad8702de98039876526c39a40f884eb1b684cf39386479e6d40c08f3134b138cc6caf51b4150289a364239c
diff --git a/sys-apps/watchdog/files/watchdog-conf.d b/sys-apps/watchdog/files/watchdog-conf.d
new file mode 100644
index 000000000000..60c7843d0cdd
--- /dev/null
+++ b/sys-apps/watchdog/files/watchdog-conf.d
@@ -0,0 +1,6 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# for more info, see watchdog(8)
+WATCHDOG_OPTS=""
diff --git a/sys-apps/watchdog/files/watchdog-init.d b/sys-apps/watchdog/files/watchdog-init.d
new file mode 100644
index 000000000000..fdfe66b9c2ae
--- /dev/null
+++ b/sys-apps/watchdog/files/watchdog-init.d
@@ -0,0 +1,48 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+ use logger
+}
+
+get_config() {
+ set -- ${WATCHDOG_OPTS}
+ while [ -n "$1" ] ; do
+ if [ "$1" = "-c" -o "$1" = "--config-file" ] ; then
+ echo $2
+ return
+ fi
+ shift
+ done
+ echo /etc/watchdog.conf
+}
+
+get_delay() {
+ # man this is fugly
+ sed -n \
+ -e '1{x;s:.*:10:;x}' \
+ -e 's:#.*::' \
+ -e 's:^[[:space:]]*::' \
+ -e '/^interval/{s:.*=::;h}' \
+ -e '${g;p}' \
+ $(get_config)
+}
+
+start() {
+ ebegin "Starting watchdog"
+ start-stop-daemon --start \
+ --exec /usr/sbin/watchdog --pidfile /var/run/watchdog.pid \
+ -- ${WATCHDOG_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping watchdog"
+ start-stop-daemon --stop \
+ --exec /usr/sbin/watchdog --pidfile /var/run/watchdog.pid \
+ --retry $(get_delay)
+ eend $?
+}
diff --git a/sys-apps/watchdog/files/watchdog.service b/sys-apps/watchdog/files/watchdog.service
new file mode 100644
index 000000000000..9ec1076e6689
--- /dev/null
+++ b/sys-apps/watchdog/files/watchdog.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=watchdog daemon
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/watchdog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/watchdog/metadata.xml b/sys-apps/watchdog/metadata.xml
new file mode 100644
index 000000000000..65d570ff1c20
--- /dev/null
+++ b/sys-apps/watchdog/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>
+ <use>
+ <flag name="nfs">enable support for checking nfs mounts</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">watchdog</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/watchdog/watchdog-5.13-r1.ebuild b/sys-apps/watchdog/watchdog-5.13-r1.ebuild
new file mode 100644
index 000000000000..b79ee95d1741
--- /dev/null
+++ b/sys-apps/watchdog/watchdog-5.13-r1.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 toolchain-funcs flag-o-matic systemd
+
+DESCRIPTION="A software watchdog and /dev/watchdog daemon"
+HOMEPAGE="http://sourceforge.net/projects/watchdog/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm m68k ~mips ppc s390 sh ~sparc x86"
+IUSE="nfs"
+
+DEPEND="nfs? ( net-libs/libtirpc )"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ if use nfs ; then
+ tc-export PKG_CONFIG
+ append-cppflags $(${PKG_CONFIG} libtirpc --cflags)
+ export LIBS+=" $(${PKG_CONFIG} libtirpc --libs)"
+ fi
+ econf $(use_enable nfs)
+}
+
+src_install() {
+ default
+ docinto examples
+ dodoc examples/*
+
+ newconfd "${FILESDIR}"/${PN}-conf.d ${PN}
+ newinitd "${FILESDIR}"/${PN}-init.d ${PN}
+ systemd_dounit "${FILESDIR}"/watchdog.service
+}
diff --git a/sys-apps/watchdog/watchdog-5.14.ebuild b/sys-apps/watchdog/watchdog-5.14.ebuild
new file mode 100644
index 000000000000..712a0dc0babd
--- /dev/null
+++ b/sys-apps/watchdog/watchdog-5.14.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit toolchain-funcs flag-o-matic systemd
+
+DESCRIPTION="A software watchdog and /dev/watchdog daemon"
+HOMEPAGE="http://sourceforge.net/projects/watchdog/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm m68k ~mips ppc s390 sh ~sparc x86"
+IUSE="nfs"
+
+DEPEND="nfs? ( net-libs/libtirpc )"
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ if use nfs ; then
+ tc-export PKG_CONFIG
+ append-cppflags $(${PKG_CONFIG} libtirpc --cflags)
+ export LIBS+=" $(${PKG_CONFIG} libtirpc --libs)"
+ fi
+ econf $(use_enable nfs)
+}
+
+src_install() {
+ default
+ docinto examples
+ dodoc examples/*
+
+ newconfd "${FILESDIR}"/${PN}-conf.d ${PN}
+ newinitd "${FILESDIR}"/${PN}-init.d ${PN}
+ systemd_dounit "${FILESDIR}"/watchdog.service
+}
diff --git a/sys-apps/which/Manifest b/sys-apps/which/Manifest
new file mode 100644
index 000000000000..4ff718fec18e
--- /dev/null
+++ b/sys-apps/which/Manifest
@@ -0,0 +1,2 @@
+DIST which-2.20.tar.gz 135372 SHA256 d417b65c650d88ad26a208293c1c6e3eb60d4b6d847f01ff8f66aca63e2857f8 SHA512 29445cd6072814d3a6179b53b8f9e7e3fc8a27b77315f2a04171e177397b91ff80a97db8806fc6b1f08dab8cbca6f208d9d7845858268b121b3af396a4a9062e WHIRLPOOL 35ca3dfc47e6112a2827188b979bc19d369f69f5841dca445039036e6fa5423b0e4e9efddd370f92da16a3873523bf37f7bdf68b748fc78e5b7991290875c49d
+DIST which-2.21.tar.gz 149305 SHA256 f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad SHA512 d2f04a5c5291f2d7d1226982da7cf999d36cfe24d3f7bda145508efcfb359511251d3c68b860c0ddcedd66b15a0587b648a35ab6d1f173707565305c506dfc61 WHIRLPOOL e1712d2f2b48467300f5947d0a72c0cf759bc33001661ba41cd57cefe21cb9974cc318748d76ff73c71fb869c4d7a445973ad95777ab380f673c85095360fd57
diff --git a/sys-apps/which/metadata.xml b/sys-apps/which/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/which/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-apps/which/which-2.20-r1.ebuild b/sys-apps/which/which-2.20-r1.ebuild
new file mode 100644
index 000000000000..640bfed058a2
--- /dev/null
+++ b/sys-apps/which/which-2.20-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Prints out location of specified executables that are in your path"
+HOMEPAGE="https://carlowood.github.io/which/"
+SRC_URI="https://carlowood.github.io/which/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+src_prepare() {
+ append-lfs-flags
+}
+
+src_configure() {
+ tc-export AR
+ default
+}
diff --git a/sys-apps/which/which-2.21.ebuild b/sys-apps/which/which-2.21.ebuild
new file mode 100644
index 000000000000..6eabd01a7a59
--- /dev/null
+++ b/sys-apps/which/which-2.21.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Prints out location of specified executables that are in your path"
+HOMEPAGE="https://carlowood.github.io/which/"
+SRC_URI="https://carlowood.github.io/which/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+src_prepare() {
+ append-lfs-flags
+}
+
+src_configure() {
+ tc-export AR
+ default
+}
diff --git a/sys-apps/x86info/Manifest b/sys-apps/x86info/Manifest
new file mode 100644
index 000000000000..e138b652a433
--- /dev/null
+++ b/sys-apps/x86info/Manifest
@@ -0,0 +1 @@
+DIST x86info-1.30.tgz 95727 RMD160 38a5502d4364b45fcf610bbbdf7ac4e0d05cf498 SHA1 a5c63b1f4b2bf70db0919316198f6871d940fc0c SHA256 fe3009850e93a9c5fa38ed6bf74d72686043329fead8f1b2be4b5943d4fc9428
diff --git a/sys-apps/x86info/files/1.21-pic.patch b/sys-apps/x86info/files/1.21-pic.patch
new file mode 100644
index 000000000000..ddf24b293e14
--- /dev/null
+++ b/sys-apps/x86info/files/1.21-pic.patch
@@ -0,0 +1,15 @@
+diff -Nuar x86info-1.21.orig/bench/benchmarks.c x86info-1.21/bench/benchmarks.c
+--- x86info-1.21.orig/bench/benchmarks.c 2007-11-26 17:53:58.278467889 -0800
++++ x86info-1.21/bench/benchmarks.c 2007-11-26 17:54:32.014318066 -0800
+@@ -19,7 +19,10 @@
+ #ifdef __linux__
+ TIME(asm volatile("int $0x80" :"=a" (tmp) :"0" (__NR_getppid)), "int 0x80");
+ #endif
+- TIME(asm volatile("cpuid": : :"ax", "dx", "cx", "bx"), "cpuid");
++ TIME(asm volatile("movl %%ebx,%%edi\n"
++ "cpuid\n"
++ "movl %%edi,%%ebx\n"
++ : : :"%eax", "%edx", "%ecx", "%edi"), "cpuid");
+
+ TIME(asm volatile("addl $1,0(%esp)"), "addl");
+ TIME(asm volatile("lock ; addl $1,0(%esp)"), "locked add");
diff --git a/sys-apps/x86info/files/x86info-1.24-pic.patch b/sys-apps/x86info/files/x86info-1.24-pic.patch
new file mode 100644
index 000000000000..5cbd3a586f8e
--- /dev/null
+++ b/sys-apps/x86info/files/x86info-1.24-pic.patch
@@ -0,0 +1,33 @@
+http://bugs.gentoo.org/270388
+
+--- cpuid.c
++++ cpuid.c
+@@ -62,12 +62,28 @@
+ sched_setaffinity(getpid(), sizeof(set), &set);
+ }
+
++#ifdef __PIC__
++ /* GCC on i386 bitches if you clobber ebx. So hide it behind
++ * gcc's back. */
++ asm(
++ "movl %%ebx,%%edi\n"
++ "cpuid\n"
++ "movl %%ebx,%1\n"
++ "movl %%edi,%%ebx\n"
++ : "=a" (a),
++ "=m" (b),
++ "+c" (c),
++ "=d" (d)
++ : "0" ((unsigned int)idx)
++ : "edi");
++#else
+ asm("cpuid"
+ : "=a" (a),
+ "=b" (b),
+ "+c" (c),
+ "=d" (d)
+ : "0" ((unsigned int)idx));
++#endif
+
+ if (eax!=NULL)
+ *eax = a;
diff --git a/sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch b/sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch
new file mode 100644
index 000000000000..54208cab0843
--- /dev/null
+++ b/sys-apps/x86info/files/x86info-1.29-parallel-make-cleanup.patch
@@ -0,0 +1,13 @@
+diff -Nuar x86info-1.29.orig/Makefile x86info-1.29/Makefile
+--- x86info-1.29.orig/Makefile 2011-04-05 22:54:04.000000000 +0000
++++ x86info-1.29/Makefile 2011-05-15 18:19:42.204228978 +0000
+@@ -12,7 +12,8 @@
+ LSMSR_TMP_HEADERS=AMD/k8.h AMD/fam10h.h AMD/fam11h.h generic_msr.h
+
+ %.h: %.regs scripts/createheader.py
+- python scripts/createheader.py $< `basename $< .regs` >$@
++ python scripts/createheader.py $< `basename $< .regs` >$@.tmp ; \
++ mv $@.tmp $@
+
+ LSMSR_SRC = \
+ lsmsr.c \
diff --git a/sys-apps/x86info/files/x86info-modules.conf-rc b/sys-apps/x86info/files/x86info-modules.conf-rc
new file mode 100644
index 000000000000..58f112007202
--- /dev/null
+++ b/sys-apps/x86info/files/x86info-modules.conf-rc
@@ -0,0 +1,9 @@
+# $Id$
+#
+# Aliases needed for x86info to probe data
+# these are so the modules auto-load as needed
+#
+alias char-major-202 msr
+alias char-major-203 cpuid
+alias /dev/cpu/*/msr msr
+alias /dev/cpu/*/cpuid cpuid
diff --git a/sys-apps/x86info/metadata.xml b/sys-apps/x86info/metadata.xml
new file mode 100644
index 000000000000..e2a0d741c0f6
--- /dev/null
+++ b/sys-apps/x86info/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>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-apps/x86info/x86info-1.30.ebuild b/sys-apps/x86info/x86info-1.30.ebuild
new file mode 100644
index 000000000000..15eb5d9c3909
--- /dev/null
+++ b/sys-apps/x86info/x86info-1.30.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit eutils flag-o-matic linux-info toolchain-funcs
+
+DESCRIPTION="Dave Jones' handy, informative x86 CPU diagnostic utility"
+HOMEPAGE="http://www.codemonkey.org.uk/projects/x86info/"
+SRC_URI="http://www.codemonkey.org.uk/projects/x86info/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils"
+DEPEND="${RDEPEND}"
+
+CONFIG_CHECK="~MTRR ~X86_CPUID"
+
+src_prepare() {
+ epatch "${FILESDIR}"/1.21-pic.patch
+ epatch "${FILESDIR}"/${PN}-1.24-pic.patch #270388
+ epatch "${FILESDIR}"/${PN}-1.29-parallel-make-cleanup.patch
+}
+
+src_compile() {
+ # These flags taken from the 1.29 ebuild
+ append-flags -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls
+ append-ldflags -Wl,-z,relro,-z,now
+ emake x86info lsmsr \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} ${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}" \
+ || die "emake failed"
+}
+
+src_install() {
+ dobin x86info lsmsr || die
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/x86info-modules.conf-rc x86info.conf
+
+ dodoc TODO README
+ doman x86info.1 lsmsr.8
+ insinto /usr/share/doc/${PF}
+ doins -r results
+ prepalldocs
+}
+
+pkg_preinst() {
+ if [ -a "${ROOT}"/etc/modules.d/x86info ] && [ ! -a "${ROOT}"/etc/modprobe.d/x86info ] ; then
+ elog "Moving x86info from /etc/modules.d/ to /etc/modprobe.d/"
+ mv "${ROOT}"/etc/{modules,modprobe}.d/x86info
+ fi
+ if [ -a "${ROOT}"/etc/modprobe.d/x86info ] && [ ! -a "${ROOT}"/etc/modprobe.d/x86info.conf ] ; then
+ elog "Adding .conf suffix to x86info in /etc/modprobe.d/"
+ mv "${ROOT}"/etc/modprobe.d/x86info{,.conf}
+ fi
+}
diff --git a/sys-apps/xinetd/Manifest b/sys-apps/xinetd/Manifest
new file mode 100644
index 000000000000..1bba7b72e7a1
--- /dev/null
+++ b/sys-apps/xinetd/Manifest
@@ -0,0 +1 @@
+DIST xinetd-2.3.15.tar.gz 309774 SHA256 bf4e060411c75605e4dcbdf2ac57c6bd9e1904470a2f91e01ba31b50a80a5be3 SHA512 9d6fee1fbc90329629d84086ae7de5cd51c25af7b68e52aa704d6f74bee5f0e3d54ca1bcf780f90f74ddc8d336ae0abb5e5e368d43c426a26b8dd2c4676d26aa WHIRLPOOL 5bcf69b2cfac3b3713648da666e4c98d62caea4c506be9dc5cc84f1acdc643812460a158b092705274d7452d394d3f2c03b5635f135f5d900bb6a5406f0350c2
diff --git a/sys-apps/xinetd/files/xinetd-2.3.14-DESTDIR.patch b/sys-apps/xinetd/files/xinetd-2.3.14-DESTDIR.patch
new file mode 100644
index 000000000000..2ebdf4c4f1b0
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd-2.3.14-DESTDIR.patch
@@ -0,0 +1,27 @@
+--- Makefile.in.orig 2005-10-29 22:08:54.000000000 -0400
++++ Makefile.in 2005-10-29 22:09:32.000000000 -0400
+@@ -75,15 +75,15 @@
+
+ install: build
+ for i in $(DAEMONDIR) $(BINDIR) $(MANDIR)/man5 $(MANDIR)/man8 ; do \
+- test -d $$i || mkdir -p $$i ; done
+- $(INSTALL_CMD) -m 755 xinetd/xinetd $(DAEMONDIR)
+- $(INSTALL_CMD) -m 755 xinetd/itox $(DAEMONDIR)
+- $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DAEMONDIR)
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(MANDIR)/man5/xinetd.conf.5
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man8/xinetd.log.8
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(MANDIR)/man8/xinetd.8
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(MANDIR)/man8/itox.8
+- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(MANDIR)/man8/xconv.pl.8
++ test -d $(DESTDIR)$$i || mkdir -p $(DESTDIR)$$i ; done
++ $(INSTALL_CMD) -m 755 xinetd/xinetd $(DESTDIR)$(DAEMONDIR)
++ $(INSTALL_CMD) -m 755 xinetd/itox $(DESTDIR)$(DAEMONDIR)
++ $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DESTDIR)$(DAEMONDIR)
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(DESTDIR)$(MANDIR)/man8/xinetd.log.8
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(DESTDIR)$(MANDIR)/man8/xinetd.8
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(DESTDIR)$(MANDIR)/man8/itox.8
++ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(DESTDIR)$(MANDIR)/man8/xconv.pl.8
+ @echo "You must put your xinetd.conf in /etc/xinetd.conf"
+ @echo "There is a sample config file in xinetd/sample.conf and you can"
+ @echo "use xconv.pl to convert your old inetd.conf file to an xinetd format"
diff --git a/sys-apps/xinetd/files/xinetd-2.3.14-config.patch b/sys-apps/xinetd/files/xinetd-2.3.14-config.patch
new file mode 100644
index 000000000000..c368dea56e1b
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd-2.3.14-config.patch
@@ -0,0 +1,9 @@
+--- contrib/xinetd.conf
++++ contrib/xinetd.conf
+@@ -22,5 +22,5 @@
+ #
+ # no_access =
+-# only_from =
++ only_from = localhost
+ # max_load = 0
+ cps = 50 10
diff --git a/sys-apps/xinetd/files/xinetd-2.3.14-install-contrib.patch b/sys-apps/xinetd/files/xinetd-2.3.14-install-contrib.patch
new file mode 100644
index 000000000000..c1717e43902f
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd-2.3.14-install-contrib.patch
@@ -0,0 +1,24 @@
+--- xinetd-2.3.14/Makefile.in
++++ xinetd-2.3.14/Makefile.in
+@@ -9,6 +9,7 @@
+ DESTDIR =
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
++ETCDIR = @sysconfdir@
+ DAEMONDIR = @sbindir@
+ MANDIR = @mandir@
+ topdir = @top_srcdir@
+@@ -97,7 +98,12 @@
+ rm -f $(MANDIR)/man8/xinetd.log.8
+ rm -f $(MANDIR)/man8/xinetd.8
+ rm -f $(MANDIR)/man8/itox.8
+-
++
++install-contrib:
++ test -d $(DESTDIR)$(ETCDIR)/xinetd.d || mkdir -p $(DESTDIR)$(ETCDIR)/xinetd.d
++ $(INSTALL_CMD) -m 644 contrib/xinetd.conf $(DESTDIR)$(ETCDIR)
++ $(INSTALL_CMD) -m 644 contrib/xinetd.d/* $(DESTDIR)$(ETCDIR)/xinetd.d
++
+ distclean: clean
+ rm -f config.cache config.log Makefile config.status xinetd/itox
+ rm -f config.h @srcdir@/libs/include/* @srcdir@/libs/man/*
diff --git a/sys-apps/xinetd/files/xinetd.confd b/sys-apps/xinetd/files/xinetd.confd
new file mode 100644
index 000000000000..ae211f3d8fcc
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd.confd
@@ -0,0 +1,3 @@
+# /etc/conf.d/xinetd: config file for /etc/init.d/xinetd
+
+XINETD_OPTS="-stayalive -reuse"
diff --git a/sys-apps/xinetd/files/xinetd.rc6 b/sys-apps/xinetd/files/xinetd.rc6
new file mode 100644
index 000000000000..57cee363f869
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd.rc6
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload dump check"
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting xinetd"
+ start-stop-daemon --start --exec /usr/sbin/xinetd -- \
+ -pidfile /var/run/xinetd.pid ${XINETD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping xinetd"
+ start-stop-daemon --stop --quiet --pidfile /var/run/xinetd.pid
+ eend $?
+}
+
+do_sig() {
+ local sig=$1 ; shift
+ ebegin "$*"
+ start-stop-daemon --signal ${sig} --pidfile /var/run/xinetd.pid
+ eend $?
+}
+reload() { do_sig HUP "Reloading configuration" ; }
+dump() { do_sig USR1 "Dumping configuration" ; }
+check() { do_sig IOT "Performing Consistency Check" ; }
diff --git a/sys-apps/xinetd/files/xinetd.service b/sys-apps/xinetd/files/xinetd.service
new file mode 100644
index 000000000000..c6f6271fd97b
--- /dev/null
+++ b/sys-apps/xinetd/files/xinetd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=A secure replacement for inetd
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/xinetd -dontfork
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-apps/xinetd/metadata.xml b/sys-apps/xinetd/metadata.xml
new file mode 100644
index 000000000000..ec64a3227cf0
--- /dev/null
+++ b/sys-apps/xinetd/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>
+<use>
+ <flag name='rpc'>support RPC services</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/xinetd/xinetd-2.3.15-r1.ebuild b/sys-apps/xinetd/xinetd-2.3.15-r1.ebuild
new file mode 100644
index 000000000000..cb82dc35bb64
--- /dev/null
+++ b/sys-apps/xinetd/xinetd-2.3.15-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic systemd toolchain-funcs
+
+DESCRIPTION="powerful replacement for inetd"
+HOMEPAGE="http://www.xinetd.org/"
+SRC_URI="http://www.xinetd.org/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="perl rpc tcpd"
+
+DEPEND="tcpd? ( >=sys-apps/tcp-wrappers-7.6-r2 )
+ rpc? ( net-libs/libtirpc )"
+RDEPEND="${DEPEND}
+ perl? ( dev-lang/perl )"
+DEPEND="${DEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.3.14-DESTDIR.patch
+ epatch "${FILESDIR}"/${PN}-2.3.14-install-contrib.patch
+ epatch "${FILESDIR}"/${PN}-2.3.14-config.patch
+ find -name Makefile.in -exec sed -i 's:\<ar\>:$(AR):' {} +
+}
+
+src_configure() {
+ if ! use rpc ; then
+ append-cppflags -DNO_RPC
+ export ac_cv_header_{rpc_{rpc,rpcent,pmap_clnt},netdb}_h=no
+ fi
+ tc-export AR PKG_CONFIG
+ LIBS=$(${PKG_CONFIG} --libs libtirpc) \
+ econf \
+ $(use_with tcpd libwrap) \
+ --with-loadavg
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install install-contrib
+ use perl || rm -f "${ED}"/usr/sbin/xconv.pl
+
+ newinitd "${FILESDIR}"/xinetd.rc6 xinetd
+ newconfd "${FILESDIR}"/xinetd.confd xinetd
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ newdoc contrib/xinetd.conf xinetd.conf.dist.sample
+ dodoc AUDIT INSTALL README TODO CHANGELOG
+}
diff --git a/sys-apps/xmbmon/Manifest b/sys-apps/xmbmon/Manifest
new file mode 100644
index 000000000000..955aa9c48142
--- /dev/null
+++ b/sys-apps/xmbmon/Manifest
@@ -0,0 +1,2 @@
+DIST xmbmon205.tar.gz 142987 RMD160 5097801803ac13082c59fa9db9036098de11de82 SHA1 4fc4b1442a6e638b2c5cbcf9b26ca17465b0da70 SHA256 65b10ebfe53585ac22d6a31d8ef3fea552cb266cf2c124c00421dec1df5a4a4f
+DIST xmbmon205_fflush.patch 242 RMD160 563b7e2b2eb3b5ed0f18aeb1d2d5e85c9d2f0435 SHA1 690bce2bca8215eaa223fed5737b68900d2fbc71 SHA256 f837f465861ce46e4a90d1d3c7a680c1904f7fb91e14efcbad22313c90e2cdc7
diff --git a/sys-apps/xmbmon/files/mbmon.confd b/sys-apps/xmbmon/files/mbmon.confd
new file mode 100644
index 000000000000..01cc0ff6e5f0
--- /dev/null
+++ b/sys-apps/xmbmon/files/mbmon.confd
@@ -0,0 +1,10 @@
+# /etc/conf.d/mbmon
+
+# Port to listen on.
+
+MBMON_PORT="12912"
+
+# These are default options to use with gkrellm2.
+# See the mbmon(1) manpage for more info.
+
+MBMON_OPTS="-r"
diff --git a/sys-apps/xmbmon/files/mbmon.rc b/sys-apps/xmbmon/files/mbmon.rc
new file mode 100644
index 000000000000..6ca761f5e42f
--- /dev/null
+++ b/sys-apps/xmbmon/files/mbmon.rc
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+start() {
+ einfo "Start Mother Board Monitor"
+ mbmon \
+ -P ${MBMON_PORT} \
+ ${MBMON_OPTS}
+ eend $?
+}
+
+stop() {
+ einfo "Stop Mother Board Monitor"
+ start-stop-daemon --stop --pidfile /var/run/mbmon.pid
+ local ret=$?
+ rm -f /var/run/mbmon.pid
+ eend ${ret}
+}
diff --git a/sys-apps/xmbmon/files/xmbmon-2.0.5-amd64.patch b/sys-apps/xmbmon/files/xmbmon-2.0.5-amd64.patch
new file mode 100644
index 000000000000..27b150e9b0ba
--- /dev/null
+++ b/sys-apps/xmbmon/files/xmbmon-2.0.5-amd64.patch
@@ -0,0 +1,24 @@
+diff -Naur xmbmon205.orig/configure xmbmon205/configure
+--- xmbmon205.orig/configure 2004-08-13 16:22:18.000000000 +0900
++++ xmbmon205/configure 2005-02-05 11:02:02.496163477 +0900
+@@ -3489,7 +3489,7 @@
+ i?86-*-freebsd*)
+ CC=cc
+ ;;
+- i?86-*-linux-*)
++ i?86-*-linux-* | x86_64-*-linux-*)
+ CC=gcc
+ HOSTDEF="-DLINUX"
+ ;;
+diff -Naur xmbmon205.orig/configure.in xmbmon205/configure.in
+--- xmbmon205.orig/configure.in 2004-08-13 16:06:31.000000000 +0900
++++ xmbmon205/configure.in 2005-02-05 11:01:35.414957216 +0900
+@@ -19,7 +19,7 @@
+ i?86-*-freebsd*)
+ CC=cc
+ ;;
+- i?86-*-linux-*)
++ i?86-*-linux-* | x86_64-*-linux-*)
+ CC=gcc
+ HOSTDEF="-DLINUX"
+ ;;
diff --git a/sys-apps/xmbmon/files/xmbmon-2.0.5-loopback.patch b/sys-apps/xmbmon/files/xmbmon-2.0.5-loopback.patch
new file mode 100644
index 000000000000..5a28b52f9ea2
--- /dev/null
+++ b/sys-apps/xmbmon/files/xmbmon-2.0.5-loopback.patch
@@ -0,0 +1,40 @@
+Listen on loopback only with the -l option
+
+patch by Mike Frysinger
+
+--- mbmon.c
++++ mbmon.c
+@@ -41,4 +41,5 @@
+ static const char *MyName = "mbmon";
+ int port = 0;
++uint32_t listen_addr = INADDR_ANY;
+
+ int usage(void)
+@@ -61,4 +62,5 @@
+ " -c count: repeat <count> times and exit\n"
+ " -P port: run in daemon mode, using given port for clients\n"
++" -l: listen on local interface only\n"
+ " -T|F [1-7]: print Temperature|Fanspeed according to following styles\n"
+ " style1: data1\\n\n"
+@@ -318,5 +320,5 @@
+ while ((ch = getopt(argc,argv,"VSIAfdDYe:p:s:c:T:F:tunNirh")) != -1) {
+ #else
+- while ((ch = getopt(argc,argv,"VSIAfdDYe:p:c:T:F:tunNirhP:")) != -1) {
++ while ((ch = getopt(argc,argv,"VSIAfdDYe:p:c:T:F:tunNirhlP:")) != -1) {
+ #endif
+ switch(ch) {
+@@ -371,4 +373,7 @@
+ probe_request = optarg;
+ break;
++ case 'l':
++ listen_addr = INADDR_LOOPBACK;
++ break;
+ case 'P':
+ port = atoi (optarg);
+@@ -458,5 +463,5 @@
+ server.sin_family = AF_INET;
+ server.sin_port = htons (port);
+- server.sin_addr.s_addr = INADDR_ANY;
++ server.sin_addr.s_addr = htonl(listen_addr);
+ if (bind (fd, (struct sockaddr *) &server, sizeof (server)) < 0) {
+ perror("bind");
diff --git a/sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch b/sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch
new file mode 100644
index 000000000000..aecb5e7a9b7c
--- /dev/null
+++ b/sys-apps/xmbmon/files/xmbmon-2.0.5-pid.patch
@@ -0,0 +1,31 @@
+Write a pid when we daemonize
+
+patch by Mike Frysinger
+
+--- mbmon.c
++++ mbmon.c
+@@ -229,4 +229,5 @@
+ static void daemonize()
+ {
++ pid_t pid;
+ int fd;
+ struct sigaction sa_ign, sa_save;
+@@ -247,5 +248,5 @@
+ sigaction(SIGHUP, &sa_ign, &sa_save);
+
+- switch (fork()) {
++ switch ((pid=fork())) {
+ case 0:
+ break;
+@@ -259,4 +260,11 @@
+
+ default:
++ {
++ FILE *f = fopen("/var/run/mbmon.pid", "w");
++ if (f != NULL) {
++ fprintf(f, "%i", pid);
++ fclose(f);
++ }
++ }
+ exit(0);
+ /* NOTREACHED */
diff --git a/sys-apps/xmbmon/metadata.xml b/sys-apps/xmbmon/metadata.xml
new file mode 100644
index 000000000000..96a2d586367d
--- /dev/null
+++ b/sys-apps/xmbmon/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-apps/xmbmon/xmbmon-2.0.5-r1.ebuild b/sys-apps/xmbmon/xmbmon-2.0.5-r1.ebuild
new file mode 100644
index 000000000000..92ef5f4546da
--- /dev/null
+++ b/sys-apps/xmbmon/xmbmon-2.0.5-r1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils
+
+MY_P=${PN}${PV//.}
+DESCRIPTION="Mother Board Monitor Program for X Window System"
+HOMEPAGE="http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/download.html"
+SRC_URI="http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/xmbmon/${MY_P}.tar.gz
+ http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/xmbmon/${MY_P}_fflush.patch"
+# http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/xmbmon/${MY_P}_A7N8X-VM.patch
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 x86 ~x86-fbsd"
+IUSE="X"
+
+DEPEND="X? ( x11-libs/libXt
+ x11-libs/libSM
+ x11-libs/libX11
+ x11-libs/libICE )"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # epatch ${DISTDIR}/${MY_P}_A7N8X-VM.patch
+ epatch "${DISTDIR}"/${MY_P}_fflush.patch
+ epatch "${FILESDIR}"/${P}-amd64.patch
+ epatch "${FILESDIR}"/${P}-pid.patch
+ epatch "${FILESDIR}"/${P}-loopback.patch
+ sed -i \
+ -e "/^CFLAGS=/s/-O3/${CFLAGS}/" \
+ -e '/^LDFLAGS=-s$/d' \
+ Makefile.in || die
+ sed -i \
+ -e '/^[[:space:]]*CC=gcc/s,.*,:;,' \
+ configure || die
+}
+
+src_compile() {
+ econf || die "Configure failed"
+ emake mbmon || die "Make mbmon failed"
+ if use X ; then
+ emake xmbmon || die "Make xmbmon failed"
+ fi
+}
+
+src_install() {
+ dosbin mbmon || die "mbmon failed"
+ doman mbmon.1
+ dodoc ChangeLog* ReadMe* mbmon-rrd.pl
+
+ if use X ; then
+ dosbin xmbmon || die "xmbmon failed"
+ doman xmbmon.1x
+ insinto /etc/X11/app-defaults/
+ newins xmbmon.resources XMBmon
+ fi
+
+ newinitd "${FILESDIR}"/mbmon.rc mbmon
+ newconfd "${FILESDIR}"/mbmon.confd mbmon
+}
+
+pkg_postinst() {
+ echo
+ einfo "These programs access SMBus/ISA-IO ports without any kind"
+ einfo "of checking. It is, therefore, very dangerous and may cause"
+ einfo "a system-crash. Make sure you read ReadMe,"
+ einfo "section 4, 'How to use!'"
+ echo
+}
diff --git a/sys-apps/yum/Manifest b/sys-apps/yum/Manifest
new file mode 100644
index 000000000000..b70b9c24bc89
--- /dev/null
+++ b/sys-apps/yum/Manifest
@@ -0,0 +1 @@
+DIST yum-3.4.3_p20130218.tar.gz 1389537 SHA256 efc2daeca86ddc893eb0489342686eb4a2b2cbbd1a75fd42fd27624225494ce7 SHA512 b450c6133443f674bd60f59633d5669d9f88e60930657891f428ce8f1bdcf7124a86ed756a6a5912b9237788854331022119a6bfb1d5cac8d8fdc3de11b1020e WHIRLPOOL 18bcff3b9f2e991f255ac5bc07937e67c20df46ec88fff1481e5f64fc36f97e5d741cfb378c4731a1721f1d0a9beb6f9d37a5f91b59055cfcb21ac06fce819b6
diff --git a/sys-apps/yum/metadata.xml b/sys-apps/yum/metadata.xml
new file mode 100644
index 000000000000..6b829015b14f
--- /dev/null
+++ b/sys-apps/yum/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>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ Automatic updater and package installer/remover for rpm
+ systems
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-apps/yum/yum-3.4.3_p20130218-r1.ebuild b/sys-apps/yum/yum-3.4.3_p20130218-r1.ebuild
new file mode 100644
index 000000000000..727290ba75cd
--- /dev/null
+++ b/sys-apps/yum/yum-3.4.3_p20130218-r1.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+MY_PV="a119004"
+MY_P="${PN}-${MY_PV}"
+
+inherit eutils multilib python-single-r1
+
+DESCRIPTION="automatic updater and package installer/remover for rpm systems"
+HOMEPAGE="http://yum.baseurl.org/"
+SRC_URI="http://dev.gentoo.org/~creffett/distfiles/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="test"
+
+RDEPEND="${PYTHON_DEPS}
+ app-arch/rpm[${PYTHON_USEDEP}]
+ dev-python/sqlitecachec[${PYTHON_USEDEP}]
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
+ dev-python/pyliblzma[${PYTHON_USEDEP}]
+ dev-python/urlgrabber[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ test? ( dev-python/nose[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ sed -i -e 's/make/$(MAKE)/' Makefile || die
+ sed -i -e "s:lib:$(get_libdir):g" rpmUtils/Makefile yum/Makefile || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ python_optimize "${D%/}$(python_get_sitedir)" "${ED%/}/usr/share/yum-cli"
+ rm -r "${ED%/}/etc/rc.d" || die
+}
diff --git a/sys-apps/yum/yum-3.4.3_p20130218.ebuild b/sys-apps/yum/yum-3.4.3_p20130218.ebuild
new file mode 100644
index 000000000000..7ba98ba2e925
--- /dev/null
+++ b/sys-apps/yum/yum-3.4.3_p20130218.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+MY_PV="a119004"
+MY_P="${PN}-${MY_PV}"
+
+inherit eutils multilib python-single-r1
+
+DESCRIPTION="automatic updater and package installer/remover for rpm systems"
+HOMEPAGE="http://yum.baseurl.org/"
+SRC_URI="http://dev.gentoo.org/~creffett/distfiles/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="test"
+
+RDEPEND="${PYTHON_DEPS}
+ app-arch/rpm[${PYTHON_USEDEP}]
+ dev-python/sqlitecachec[${PYTHON_USEDEP}]
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
+ dev-python/urlgrabber[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ test? ( dev-python/nose[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ sed -i -e 's/make/$(MAKE)/' Makefile || die
+ sed -i -e "s:lib:$(get_libdir):g" rpmUtils/Makefile yum/Makefile || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install
+ python_optimize "${D%/}$(python_get_sitedir)" "${ED%/}/usr/share/yum-cli"
+ rm -r "${ED%/}/etc/rc.d" || die
+}
diff --git a/sys-apps/zorroutils/Manifest b/sys-apps/zorroutils/Manifest
new file mode 100644
index 000000000000..9c5aecd08c6b
--- /dev/null
+++ b/sys-apps/zorroutils/Manifest
@@ -0,0 +1 @@
+DIST zorroutils-0.04.tar.gz 12205 SHA256 5aca30dec4f29b918d6b899d0467c95e4b9d0016dd7c647e9022bd7d4864676c
diff --git a/sys-apps/zorroutils/files/zorroutils-0.04-20021014.diff b/sys-apps/zorroutils/files/zorroutils-0.04-20021014.diff
new file mode 100644
index 000000000000..70edf2fce1d7
--- /dev/null
+++ b/sys-apps/zorroutils/files/zorroutils-0.04-20021014.diff
@@ -0,0 +1,62 @@
+diff -Nru zorroutils-0.04.orig/zorro.ids zorroutils-0.04/zorro.ids
+--- zorroutils-0.04.orig/zorro.ids 2000-09-28 20:45:47.000000000 +0200
++++ zorroutils-0.04/zorro.ids 2002-10-14 15:08:58.000000000 +0200
+@@ -4,7 +4,7 @@
+ # Maintained by Geert Uytterhoeven <zorro@linux-m68k.org>
+ # If you have any new entries, please send them to the maintainer.
+ #
+-# $Id$
++# $Id$
+ #
+
+ # Manufacturers and Products. Please keep sorted.
+@@ -42,7 +42,7 @@
+ 5000 A2620 68020 [Accelerator and RAM Expansion]
+ 5100 A2630 68030 [Accelerator and RAM Expansion]
+ 5400 A4091 [SCSI Host Adapter]
+- 5a00 A2065 [Ethernet Card]]
++ 5a00 A2065 [Ethernet Card]
+ 6000 Romulator Card
+ 6100 A3000 Test Fixture [Miscellaneous Expansion Card]
+ 6700 A2386-SX [ISA Bus Bridge]
+@@ -56,7 +56,7 @@
+ 02ff Kolff Computer Supplies
+ 0000 KCS Power PC [ISA Bus Bridge]
+ 03ec Cardco Ltd.
+- 0400 Kronos 2000 [SCSI Host Adapter]]
++ 0400 Kronos 2000 [SCSI Host Adapter]
+ 0c00 A1000 [SCSI Host Adapter]
+ 0e00 Escort [SCSI Host Adapter]
+ f500 A2410 HiRes [Graphics Card]
+@@ -229,6 +229,7 @@
+ 0a00 Impact Series II [RAM Expansion]
+ 081e Interworks Network
+ 0820 Hardital Synthesis
++ 0100 Super Big Bang [Accelerator, SCSI Host Adapter and RAM Expansion]
+ 1400 TQM 68030+68882 [Accelerator]
+ 0828 Applied Engineering
+ 1000 DL2000 [Modem]
+@@ -363,7 +364,13 @@
+ 1300 Warp Engine 40xx [Accelerator, SCSI Host Adapter and RAM Expansion]
+ 089e ElBox Computer
+ 0600 1200/4 [RAM Expansion]
+- 1900 PowerFlyer [IDE Interface]
++ 0800 FastATA 1200 [IDE Interface]
++ 1200 FastATA 1200 [IDE Interface]
++ 1300 FastATA 1200 [IDE Interface]
++ 1800 FastATA 1200 [IDE Interface]
++ 1900 FastATA 4000 [IDE Interface]
++ 1d00 FastATA 4000 [IDE Interface]
++ 1e00 FastATA ZIV [IDE Interface]
+ 0a00 Harms Professional
+ 1000 030 Plus [Accelerator]
+ d000 3500 Professional [Accelerator and RAM Expansion]
+@@ -383,7 +390,7 @@
+ ff00 Pixel64 RAM [Graphics Card]
+ 1212 Individual Computers
+ 0000 Buddha [IDE Interface]
+- 1700 X-Surf [Ethernet Card]
++ 1700 X-Surf [Ethernet Card and IDE Interface]
+ 2a00 Catweasel [IDE Interface and Floppy Controller]
+ 1248 Kupke
+ 0100 Golem HD 3000 [HD Controller]
diff --git a/sys-apps/zorroutils/files/zorroutils-gentoo.diff b/sys-apps/zorroutils/files/zorroutils-gentoo.diff
new file mode 100644
index 000000000000..a0a7e44872bc
--- /dev/null
+++ b/sys-apps/zorroutils/files/zorroutils-gentoo.diff
@@ -0,0 +1,6 @@
+diff -Nru zorroutils-0.04.orig/zorroutils.h zorroutils-0.04/zorroutils.h
+--- zorroutils-0.04.orig/zorroutils.h 2000-09-28 20:46:14.000000000 +0200
++++ zorroutils-0.04/zorroutils.h 2006-09-16 18:08:17.000000000 +0200
+@@ -16,1 +16,1 @@
+-#define ZORRO_ID_DB "/usr/share/zorro.ids"
++#define ZORRO_ID_DB "/usr/share/misc/zorro.ids"
diff --git a/sys-apps/zorroutils/metadata.xml b/sys-apps/zorroutils/metadata.xml
new file mode 100644
index 000000000000..53b13c9739c3
--- /dev/null
+++ b/sys-apps/zorroutils/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>proxy-maintainers</herd>
+<maintainer>
+ <email>m68k@gentoo.org</email>
+</maintainer>
+<maintainer>
+ <email>gentoo@kolla.no</email>
+ <name>Kolbjørn Barmen</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-apps/zorroutils/zorroutils-0.04.ebuild b/sys-apps/zorroutils/zorroutils-0.04.ebuild
new file mode 100644
index 000000000000..c2c6431724e6
--- /dev/null
+++ b/sys-apps/zorroutils/zorroutils-0.04.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Zorro bus utility for Amigas running 2.1 and later kernels"
+HOMEPAGE="http://users.telenet.be/geertu/Download/#zorro"
+SRC_URI="http://users.telenet.be/geertu/Download/${P}.tar.gz"
+IUSE=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="m68k ~ppc"
+
+DEPEND=""
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}"/${PN}-0.04-20021014.diff
+ epatch "${FILESDIR}"/${PN}-gentoo.diff
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die
+}
+
+src_install() {
+ dosbin lszorro
+ doman *.8
+
+ insinto /usr/share/misc
+ doins zorro.ids
+}