aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-06-11 18:16:08 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-06-11 18:16:08 -0400
commit8eddda8072add075ebf56cf6d288bc1450d6b5f8 (patch)
tree373e2d36142a298a821f6643c097007aa38aa29f
downloadmusl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.gz
musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.bz2
musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.zip
Initial migration from hardened-dev::musl
-rw-r--r--README6
-rw-r--r--app-crypt/shash/Manifest7
-rw-r--r--app-crypt/shash/files/0.2.6-manpage-fixes.patch30
-rw-r--r--app-crypt/shash/files/shash-0.2.6-binary-files.patch34
-rw-r--r--app-crypt/shash/files/shash-0.2.6-missing-includes.patch27
-rw-r--r--app-crypt/shash/files/shash.bash-completion40
-rw-r--r--app-crypt/shash/metadata.xml10
-rw-r--r--app-crypt/shash/shash-0.2.6-r99.ebuild37
-rw-r--r--app-editors/emacs-vcs/Manifest3
-rw-r--r--app-editors/emacs-vcs/emacs-vcs-25.0.9999-r99.ebuild365
-rw-r--r--app-editors/emacs-vcs/files/emacs-vcs-musl.patch89
-rw-r--r--app-editors/emacs-vcs/metadata.xml46
-rw-r--r--app-editors/emacs/Manifest10
-rw-r--r--app-editors/emacs/emacs-24.4-r99.ebuild348
-rw-r--r--app-editors/emacs/files/emacs-24.3-alloc-invalid-frees.patch58
-rw-r--r--app-editors/emacs/files/emacs-24.3-stderr.patch11
-rw-r--r--app-editors/emacs/files/emacs-24.4-configure.patch10
-rw-r--r--app-editors/emacs/files/emacs-24.4-lisp.patch10
-rw-r--r--app-editors/emacs/files/emacs-24.4-preload-hack.patch11
-rw-r--r--app-editors/emacs/files/preload.c88
-rw-r--r--app-editors/emacs/metadata.xml46
-rw-r--r--app-emulation/qemu/Manifest24
-rw-r--r--app-emulation/qemu/files/65-kvm.rules1
-rw-r--r--app-emulation/qemu/files/bridge.conf14
-rw-r--r--app-emulation/qemu/files/qemu-1.5.3-openpty.patch12
-rw-r--r--app-emulation/qemu/files/qemu-1.7.0-cflags.patch11
-rw-r--r--app-emulation/qemu/files/qemu-1.7.0-ffsll.patch19
-rw-r--r--app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch12
-rw-r--r--app-emulation/qemu/files/qemu-2.0.0-F_SHLCK-and-F_EXLCK.patch23
-rw-r--r--app-emulation/qemu/files/qemu-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch37
-rw-r--r--app-emulation/qemu/files/qemu-2.1.0-CVE-2014-5388.patch36
-rw-r--r--app-emulation/qemu/files/qemu-2.1.1-readlink-self.patch81
-rw-r--r--app-emulation/qemu/files/qemu-2.1.2-vnc-sanitize-bits.patch50
-rw-r--r--app-emulation/qemu/files/qemu-2.2.0-_sigev_un.patch12
-rw-r--r--app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch241
-rw-r--r--app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch58
-rw-r--r--app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch86
-rw-r--r--app-emulation/qemu/files/qemu-9999-cflags.patch13
-rw-r--r--app-emulation/qemu/files/qemu-9999-virtfs-proxy-helper-accept.patch30
-rw-r--r--app-emulation/qemu/files/qemu-binfmt.initd-r1129
-rw-r--r--app-emulation/qemu/files/qemu-kvm-1.43
-rw-r--r--app-emulation/qemu/metadata.xml57
-rw-r--r--app-emulation/qemu/qemu-2.1.2-r99.ebuild600
-rw-r--r--app-emulation/qemu/qemu-2.2.1-r99.ebuild610
-rw-r--r--app-emulation/wine/Manifest15
-rw-r--r--app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch40
-rw-r--r--app-emulation/wine/files/wine-1.5.19-file_h.patch12
-rw-r--r--app-emulation/wine/files/wine-1.5.19-getdents.patch12
-rw-r--r--app-emulation/wine/files/wine-1.5.26-winegcc.patch59
-rw-r--r--app-emulation/wine/files/wine-1.6-memset-O3.patch21
-rw-r--r--app-emulation/wine/files/wine-1.6.2-ipx.patch20
-rw-r--r--app-emulation/wine/files/wine-1.7.2-osmesa-check.patch38
-rw-r--r--app-emulation/wine/metadata.xml27
-rw-r--r--app-emulation/wine/wine-1.6.2-r99.ebuild443
-rw-r--r--app-office/libreoffice/Manifest22
-rw-r--r--app-office/libreoffice/files/libreoffice-4.3.5.2-remove-bashisms.patch38
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4-system-pyuno.patch44
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.0.3-gcc-4.9-Os-link-failure.patch80
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.0.3-telepathy-build-fix.patch40
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch56
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.1.2-fix-includes.patch31
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch192
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.1.2-linux-musl.patch68
-rw-r--r--app-office/libreoffice/files/libreoffice-4.4.1.2-musl-fix-execinfo.patch24
-rw-r--r--app-office/libreoffice/libreoffice-4.4.1.2-r99.ebuild619
-rw-r--r--app-office/libreoffice/metadata.xml20
-rw-r--r--app-text/hunspell/Manifest7
-rw-r--r--app-text/hunspell/files/hunspell-1.3-renameexes.patch135
-rw-r--r--app-text/hunspell/files/hunspell-1.3.2-static-lib.patch9
-rw-r--r--app-text/hunspell/files/hunspell-1.3.3-multibyte-chars.patch59
-rw-r--r--app-text/hunspell/files/hunspell-9999-error_h.patch37
-rw-r--r--app-text/hunspell/hunspell-1.3.3-r99.ebuild89
-rw-r--r--app-text/hunspell/metadata.xml5
-rw-r--r--app-text/texlive-core/Manifest111
-rw-r--r--app-text/texlive-core/files/texlive-core-2012-pmx-sysdep.patch11
-rw-r--r--app-text/texlive-core/files/texmf-update2010165
-rw-r--r--app-text/texlive-core/metadata.xml16
-rw-r--r--app-text/texlive-core/texlive-core-2012-r99.ebuild352
-rw-r--r--dev-lang/ruby/Manifest10
-rw-r--r--dev-lang/ruby/files/ruby-1.9.3_p484-add-asm_ioctl_h.patch11
-rw-r--r--dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch11
-rw-r--r--dev-lang/ruby/files/ruby-uclibc-isnan-isinf.patch24
-rw-r--r--dev-lang/ruby/metadata.xml30
-rw-r--r--dev-lang/ruby/ruby-1.9.3_p484.ebuild220
-rw-r--r--dev-lang/ruby/ruby-2.0.0_p353.ebuild228
-rw-r--r--dev-libs/boehm-gc/Manifest8
-rw-r--r--dev-libs/boehm-gc/boehm-gc-7.2e-r99.ebuild61
-rw-r--r--dev-libs/boehm-gc/boehm-gc-7.4.2-r99.ebuild48
-rw-r--r--dev-libs/boehm-gc/files/boehm-gc-7.2e-automake-1.13.patch13
-rw-r--r--dev-libs/boehm-gc/files/boehm-gc-7.2e-os_dep.patch11
-rw-r--r--dev-libs/boehm-gc/files/boehm-gc-7.4.2-getcontext.patch12
-rw-r--r--dev-libs/boehm-gc/metadata.xml12
-rw-r--r--dev-libs/gmp/Manifest6
-rw-r--r--dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch20
-rw-r--r--dev-libs/gmp/files/gmp-5.1.3-secure-plt.patch17
-rw-r--r--dev-libs/gmp/gmp-5.1.3-r99.ebuild120
-rw-r--r--dev-libs/gmp/metadata.xml8
-rw-r--r--dev-libs/libgamin/Manifest14
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-G_CONST_RETURN-removal.patch67
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-armel-features.patch47
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-compilewarnings.patch22
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-crosscompile-fix.patch38
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-deadlock.patch65
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-disable_python_static_library.patch13
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-fix-pthread-mutex.patch11
-rw-r--r--dev-libs/libgamin/files/libgamin-0.1.10-noinst-lib.patch76
-rw-r--r--dev-libs/libgamin/libgamin-0.1.10-r99.ebuild142
-rw-r--r--dev-libs/libgamin/metadata.xml8
-rw-r--r--dev-libs/libxml2/Manifest32
-rw-r--r--dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch66
-rw-r--r--dev-libs/libxml2/files/libxml2-2.8.0-xmlParseAttValueComplex-underflow.patch25
-rw-r--r--dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch91
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-disable_static_modules.patch21
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-excessive-entity-expansion.patch156
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-large-file-parse.patch56
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-manual-python.patch45
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-nsclean.patch27
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-rand_seed.patch31
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-remove-redundant-pthread-defs.patch19
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-streaming-validation.patch54
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-thread-alloc.patch65
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.0-thread-portability.patch37
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-compression-detection.patch126
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-external-param-entities.patch39
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-icu-pkgconfig.patch26
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-missing-break.patch25
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-non-ascii-cr-lf.patch168
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-python-2.6.patch32
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-python3.patch50
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-python3a.patch55
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.1-xmllint-postvalid.patch32
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.2-icu-pkgconfig.patch26
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.2-revert-missing-initialization.patch26
-rw-r--r--dev-libs/libxml2/libxml2-2.9.1-r999.ebuild214
-rw-r--r--dev-libs/libxml2/libxml2-2.9.2-r99.ebuild209
-rw-r--r--dev-libs/libxml2/metadata.xml8
-rw-r--r--dev-libs/nspr/Manifest14
-rw-r--r--dev-libs/nspr/files/nspr-4.10.6-no-getprotobyname_r.patch11
-rw-r--r--dev-libs/nspr/files/nspr-4.10.6-solaris.patch32
-rw-r--r--dev-libs/nspr/files/nspr-4.7.0-prtime.patch26
-rw-r--r--dev-libs/nspr/files/nspr-4.7.1-solaris.patch14
-rw-r--r--dev-libs/nspr/files/nspr-4.8.4-darwin-install_name.patch25
-rw-r--r--dev-libs/nspr/files/nspr-4.8.9-link-flags.patch28
-rw-r--r--dev-libs/nspr/files/nspr-4.9.5_nspr_config.patch12
-rw-r--r--dev-libs/nspr/metadata.xml5
-rw-r--r--dev-libs/nspr/nspr-4.10.6-r99.ebuild112
-rw-r--r--dev-libs/nspr/nspr-4.10.7-r99.ebuild117
-rw-r--r--dev-libs/nspr/nspr-4.10.8-r99.ebuild117
-rw-r--r--dev-libs/nss/Manifest14
-rw-r--r--dev-libs/nss/files/nss-3.14.2-solaris-gcc.patch24
-rw-r--r--dev-libs/nss/files/nss-3.15-gentoo-fixup-warnings.patch10
-rw-r--r--dev-libs/nss/files/nss-3.15-gentoo-fixups.patch238
-rw-r--r--dev-libs/nss/files/nss-3.15.4-enable-pem.patch13
-rw-r--r--dev-libs/nss/files/nss-3.16-musl.patch13
-rw-r--r--dev-libs/nss/files/nss-3.17.1-gentoo-fixups.patch241
-rw-r--r--dev-libs/nss/metadata.xml16
-rw-r--r--dev-libs/nss/nss-3.16-r99.ebuild271
-rw-r--r--dev-libs/nss/nss-3.17.4-r99.ebuild322
-rw-r--r--dev-libs/openssl/Manifest15
-rwxr-xr-xdev-libs/openssl/files/gentoo.config-1.0.1160
-rw-r--r--dev-libs/openssl/files/openssl-1.0.0a-ldflags.patch29
-rw-r--r--dev-libs/openssl/files/openssl-1.0.0d-windres.patch76
-rw-r--r--dev-libs/openssl/files/openssl-1.0.0h-pkg-config.patch34
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1-parallel-build.patch354
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1-x32.patch79
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1c-force-termios.patch69
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1e-s_client-verify.patch18
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1f-revert-alpha-perl-generation.patch84
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1h-ipv6.patch642
-rw-r--r--dev-libs/openssl/files/openssl-1.0.1l-CVE-2015-0286.patch356
-rw-r--r--dev-libs/openssl/metadata.xml13
-rw-r--r--dev-libs/openssl/openssl-1.0.1l-r99.ebuild261
-rw-r--r--dev-scheme/guile/Manifest8
-rw-r--r--dev-scheme/guile/files/50guile-gentoo.el1
-rw-r--r--dev-scheme/guile/files/guile-1.8.8-fix_guile-config.patch14
-rw-r--r--dev-scheme/guile/files/guile-1.8.8-gcc46.patch39
-rw-r--r--dev-scheme/guile/files/guile-1.8.8-makeinfo-5.patch71
-rw-r--r--dev-scheme/guile/files/guile-1.8.8-os_dep.patch10
-rw-r--r--dev-scheme/guile/guile-1.8.8-r99.ebuild113
-rw-r--r--dev-scheme/guile/metadata.xml18
-rw-r--r--dev-tex/luatex/Manifest10
-rw-r--r--dev-tex/luatex/files/jmpbuf.patch21
-rw-r--r--dev-tex/luatex/files/kpathsea2012.patch28
-rw-r--r--dev-tex/luatex/files/poppler018.patch160
-rw-r--r--dev-tex/luatex/files/poppler020.patch75
-rw-r--r--dev-tex/luatex/files/poppler022.patch388
-rw-r--r--dev-tex/luatex/files/remove-zlib-version-check.patch23
-rw-r--r--dev-tex/luatex/luatex-0.70.1-r99.ebuild121
-rw-r--r--dev-tex/luatex/metadata.xml10
-rw-r--r--dev-util/strace/Manifest4
-rw-r--r--dev-util/strace/files/strace-4.8-musl.patch168
-rw-r--r--dev-util/strace/metadata.xml10
-rw-r--r--dev-util/strace/strace-4.8-r99.ebuild49
-rw-r--r--dev-vcs/cvs/Manifest15
-rw-r--r--dev-vcs/cvs/cvs-1.12.12-r99.ebuild86
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-block-requests.patch140
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-cvs-gnulib-vasnprintf.patch34
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-cvsbug-tmpfix.patch22
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-install-sh.patch12
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-mktime-x32.patch29
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-openat.patch21
-rw-r--r--dev-vcs/cvs/files/cvs-1.12.12-regex.patch11
-rw-r--r--dev-vcs/cvs/files/cvs.pam-include-1.12.124
-rw-r--r--dev-vcs/cvs/files/cvspserver.xinetd.d14
-rw-r--r--dev-vcs/cvs/metadata.xml8
-rw-r--r--eclass/toolchain.eclass2262
-rw-r--r--gnome-base/libgtop/Manifest6
-rw-r--r--gnome-base/libgtop/files/libgtop-musl.patch27
-rw-r--r--gnome-base/libgtop/libgtop-2.28.5-r99.ebuild35
-rw-r--r--gnome-base/libgtop/libgtop-2.30.0-r99.ebuild34
-rw-r--r--gnome-base/libgtop/metadata.xml9
-rw-r--r--mail-client/mailx-support/Manifest6
-rw-r--r--mail-client/mailx-support/files/mailx-support-20030215-gentoo.patch66
-rw-r--r--mail-client/mailx-support/files/mailx-support-20060102-add-sys_file_h.patch9
-rw-r--r--mail-client/mailx-support/files/mailx-support-20060102-respect-ldflags.patch18
-rw-r--r--mail-client/mailx-support/mailx-support-20060102-r99.ebuild39
-rw-r--r--mail-client/mailx-support/metadata.xml5
-rw-r--r--mail-mta/exim/Manifest27
-rw-r--r--mail-mta/exim/exim-4.84-r99.ebuild513
-rw-r--r--mail-mta/exim/files/auth_conf.sub25
-rw-r--r--mail-mta/exim/files/exim-4.14-tail.patch11
-rw-r--r--mail-mta/exim/files/exim-4.20-maildir.patch14
-rw-r--r--mail-mta/exim/files/exim-4.69-r1.27021.patch48
-rw-r--r--mail-mta/exim/files/exim-4.74-localscan_dlopen.patch262
-rw-r--r--mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch22
-rw-r--r--mail-mta/exim/files/exim-4.76-crosscompile.patch15
-rw-r--r--mail-mta/exim/files/exim-4.76-dsn.patch18
-rw-r--r--mail-mta/exim/files/exim-4.77-as-needed-ldflags.patch144
-rw-r--r--mail-mta/exim/files/exim-4.77-makefile-freebsd.patch48
-rw-r--r--mail-mta/exim/files/exim-4.80-spool-mail-group.patch27
-rw-r--r--mail-mta/exim/files/exim-4.82-makefile-freebsd.patch45
-rw-r--r--mail-mta/exim/files/exim-submission.socket10
-rw-r--r--mail-mta/exim/files/exim-submission_at.service11
-rw-r--r--mail-mta/exim/files/exim.confd5
-rw-r--r--mail-mta/exim/files/exim.logrotate9
-rw-r--r--mail-mta/exim/files/exim.rc830
-rw-r--r--mail-mta/exim/files/exim.rc946
-rw-r--r--mail-mta/exim/files/exim.service12
-rw-r--r--mail-mta/exim/files/exim.socket10
-rw-r--r--mail-mta/exim/files/exim_482_dsn_1_3.patch1212
-rw-r--r--mail-mta/exim/files/exim_at.service7
-rw-r--r--mail-mta/exim/metadata.xml50
-rw-r--r--media-gfx/sane-backends/Manifest13
-rw-r--r--media-gfx/sane-backends/files/niash_array_index.patch140
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch40
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch84
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch11
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch37
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch11
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch42
-rw-r--r--media-gfx/sane-backends/files/saned10
-rw-r--r--media-gfx/sane-backends/files/saned.confd2
-rw-r--r--media-gfx/sane-backends/files/saned.initd12
-rw-r--r--media-gfx/sane-backends/metadata.xml8
-rw-r--r--media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild329
-rw-r--r--media-libs/alsa-lib/Manifest7
-rw-r--r--media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild79
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch27
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch24
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch40
-rw-r--r--media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch35
-rw-r--r--media-libs/alsa-lib/metadata.xml14
-rw-r--r--media-libs/libmpdclient/Manifest4
-rw-r--r--media-libs/libmpdclient/files/libmpdclient-2.9-missing_headers.patch20
-rw-r--r--media-libs/libmpdclient/libmpdclient-2.9-r99.ebuild38
-rw-r--r--media-libs/libmpdclient/metadata.xml9
-rw-r--r--media-libs/libv4l/Manifest5
-rw-r--r--media-libs/libv4l/files/libv4l-1.0.0-configure.patch27
-rw-r--r--media-libs/libv4l/files/libv4l-1.0.0-off_t.patch11
-rw-r--r--media-libs/libv4l/libv4l-1.0.0-r99.ebuild66
-rw-r--r--media-libs/libv4l/metadata.xml28
-rw-r--r--media-libs/mesa/Manifest10
-rw-r--r--media-libs/mesa/files/eselect-mesa.conf.8.138
-rw-r--r--media-libs/mesa/files/eselect-mesa.conf.9.239
-rw-r--r--media-libs/mesa/files/glx_ro_text_segm.patch28
-rw-r--r--media-libs/mesa/files/mesa-10-pthread.patch24
-rw-r--r--media-libs/mesa/files/mesa-10.2-dont-require-llvm-for-r300.patch11
-rw-r--r--media-libs/mesa/files/mesa-10.3.7-dont-use-clrsb.patch36
-rw-r--r--media-libs/mesa/files/mesa-9.1.6-fpclassify.patch11
-rw-r--r--media-libs/mesa/mesa-10.3.7-r1.ebuild538
-rw-r--r--media-libs/mesa/metadata.xml29
-rw-r--r--media-libs/netpbm/Manifest10
-rwxr-xr-xmedia-libs/netpbm/files/make-tarball.sh50
-rw-r--r--media-libs/netpbm/files/netpbm-10.31-build.patch50
-rw-r--r--media-libs/netpbm/files/netpbm-10.51.00-getline.patch145
-rw-r--r--media-libs/netpbm/files/netpbm-10.51.00-pnmconvol-nooffset.patch83
-rw-r--r--media-libs/netpbm/files/netpbm-10.51.00-ppmtompeg-free.patch35
-rw-r--r--media-libs/netpbm/files/netpbm-10.51.00-underlinking.patch16
-rw-r--r--media-libs/netpbm/metadata.xml8
-rw-r--r--media-libs/netpbm/netpbm-10.51.00-r99.ebuild178
-rw-r--r--media-sound/mpg123/Manifest4
-rw-r--r--media-sound/mpg123/files/mpg123-largefile.patch10
-rw-r--r--media-sound/mpg123/metadata.xml15
-rw-r--r--media-sound/mpg123/mpg123-1.15.4-r99.ebuild88
-rw-r--r--media-video/ffmpeg/Manifest8
-rw-r--r--media-video/ffmpeg/ffmpeg-1.2.6-r99.ebuild305
-rw-r--r--media-video/ffmpeg/ffmpeg-2.2.14-r99.ebuild375
-rw-r--r--media-video/ffmpeg/files/dirac_arith_hardened.patch36
-rw-r--r--media-video/ffmpeg/files/ffmpeg-1.2.6-strerror_r.patch10
-rw-r--r--media-video/ffmpeg/files/ladspadl.patch25
-rw-r--r--media-video/ffmpeg/metadata.xml43
-rw-r--r--metadata/layout.conf1
-rw-r--r--net-dialup/ppp/ChangeLog1306
-rw-r--r--net-dialup/ppp/Manifest10
-rw-r--r--net-dialup/ppp/files/README.mpls15
-rw-r--r--net-dialup/ppp/files/modules.ppp10
-rw-r--r--net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.patch44
-rw-r--r--net-dialup/ppp/files/ppp-2.4.7-musl.patch179
-rw-r--r--net-dialup/ppp/metadata.xml30
-rw-r--r--net-dialup/ppp/ppp-2.4.7-r99.ebuild226
-rw-r--r--net-firewall/iptables/Manifest16
-rw-r--r--net-firewall/iptables/files/ip6tables-1.4.13.confd19
-rw-r--r--net-firewall/iptables/files/iptables-1.4.13-r1.init130
-rw-r--r--net-firewall/iptables/files/iptables-1.4.13.confd19
-rw-r--r--net-firewall/iptables/files/iptables-1.4.20-musl.patch304
-rw-r--r--net-firewall/iptables/files/iptables-1.4.21-musl.patch136
-rw-r--r--net-firewall/iptables/files/systemd/ip6tables-restore.service14
-rw-r--r--net-firewall/iptables/files/systemd/ip6tables-store.service11
-rw-r--r--net-firewall/iptables/files/systemd/ip6tables.service6
-rw-r--r--net-firewall/iptables/files/systemd/iptables-restore.service14
-rw-r--r--net-firewall/iptables/files/systemd/iptables-store.service11
-rw-r--r--net-firewall/iptables/files/systemd/iptables.service6
-rw-r--r--net-firewall/iptables/iptables-1.4.20-r99.ebuild93
-rw-r--r--net-firewall/iptables/iptables-1.4.21-r99.ebuild94
-rw-r--r--net-firewall/iptables/metadata.xml23
-rw-r--r--net-fs/cifs-utils/Manifest5
-rw-r--r--net-fs/cifs-utils/cifs-utils-6.1-r99.ebuild111
-rw-r--r--net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch44
-rw-r--r--net-fs/cifs-utils/files/cifs-utils-6.1-paths.h.patch10
-rw-r--r--net-fs/cifs-utils/metadata.xml16
-rw-r--r--net-libs/liblockfile/Manifest7
-rw-r--r--net-libs/liblockfile/files/Makefile.Darwin.in80
-rw-r--r--net-libs/liblockfile/files/liblockfile-1.06-respectflags.patch18
-rw-r--r--net-libs/liblockfile/files/liblockfile-1.09-no-ldconfig.patch20
-rw-r--r--net-libs/liblockfile/files/liblockfile-orphan-file.patch19
-rw-r--r--net-libs/liblockfile/liblockfile-1.09-r99.ebuild49
-rw-r--r--net-libs/liblockfile/metadata.xml5
-rw-r--r--net-libs/libnfsidmap/Manifest6
-rw-r--r--net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch12
-rw-r--r--net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch115
-rw-r--r--net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch22
-rw-r--r--net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild48
-rw-r--r--net-libs/libnfsidmap/metadata.xml5
-rw-r--r--net-libs/libtirpc/Manifest12
-rw-r--r--net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch85
-rw-r--r--net-libs/libtirpc/files/0002-Misc-header-fixes.patch40
-rw-r--r--net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch618
-rw-r--r--net-libs/libtirpc/files/0004-fix_DECLS.patch1226
-rw-r--r--net-libs/libtirpc/files/0005-fix_remaining_issues.patch14
-rw-r--r--net-libs/libtirpc/files/0006-fix_queue_h_include.patch44
-rw-r--r--net-libs/libtirpc/files/0007-no-des.patch29
-rw-r--r--net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch29
-rw-r--r--net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild74
-rw-r--r--net-libs/libtirpc/metadata.xml5
-rw-r--r--net-libs/webkit-gtk/Manifest19
-rwxr-xr-xnet-libs/webkit-gtk/files/gir-paxctl-lt-wrapper33
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch10
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch67
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.4-unittests-build.patch103
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.5-gir-nvidia-hangs.patch95
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch20
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-malloc.patch20
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch12
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.5-sparc64-build.patch23
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.2.6-musl-remove-execinfo.patch37
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch20
-rw-r--r--net-libs/webkit-gtk/files/webkit-gtk-2.4.1-musl-remove-execinfo.patch37
-rw-r--r--net-libs/webkit-gtk/metadata.xml13
-rw-r--r--net-libs/webkit-gtk/webkit-gtk-2.2.6-r99.ebuild271
-rw-r--r--net-libs/webkit-gtk/webkit-gtk-2.4.1-r99.ebuild274
-rw-r--r--net-libs/webkit-gtk/webkit-gtk-2.4.3-r99.ebuild274
-rw-r--r--net-misc/dhcp/Manifest35
-rw-r--r--net-misc/dhcp/dhcp-4.3.1-r99.ebuild256
-rw-r--r--net-misc/dhcp/dhcp-4.3.2-r99.ebuild256
-rw-r--r--net-misc/dhcp/files/dhcp-3.0-fix-perms.patch15
-rw-r--r--net-misc/dhcp/files/dhcp-3.0-paranoia.patch207
-rw-r--r--net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch70
-rw-r--r--net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch77
-rw-r--r--net-misc/dhcp/files/dhcp-4.0-dhclient-ntp.patch216
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch31
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch14
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-bind-disable.patch13
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch14
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-dhclient-resolvconf.patch409
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch113
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch46
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch29
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch72
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch19
-rw-r--r--net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch15
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch411
-rw-r--r--net-misc/dhcp/files/dhcp-4.3.2-fix-compilation-for-musl.patch44
-rw-r--r--net-misc/dhcp/files/dhcpd.conf228
-rwxr-xr-xnet-misc/dhcp/files/dhcpd.init5115
-rw-r--r--net-misc/dhcp/files/dhcpd.tmpfiles2
-rw-r--r--net-misc/dhcp/files/dhcpd4.service11
-rw-r--r--net-misc/dhcp/files/dhcpd6.service11
-rw-r--r--net-misc/dhcp/files/dhcrelay.conf16
-rwxr-xr-xnet-misc/dhcp/files/dhcrelay.init334
-rw-r--r--net-misc/dhcp/files/dhcrelay4.service10
-rw-r--r--net-misc/dhcp/files/dhcrelay4.service.conf3
-rw-r--r--net-misc/dhcp/files/dhcrelay6.conf8
-rw-r--r--net-misc/dhcp/files/dhcrelay6.service10
-rw-r--r--net-misc/dhcp/files/dhcrelay6.service.conf6
-rw-r--r--net-misc/dhcp/metadata.xml14
-rw-r--r--net-misc/iputils/Manifest19
-rw-r--r--net-misc/iputils/files/021109-uclibc-no-ether_ntohost.patch24
-rw-r--r--net-misc/iputils/files/iputils-20100418-makefile.patch35
-rw-r--r--net-misc/iputils/files/iputils-20100418-printf-size.patch62
-rw-r--r--net-misc/iputils/files/iputils-20100418-so_mark.patch22
-rw-r--r--net-misc/iputils/files/iputils-20101006-owl-pingsock.diff224
-rw-r--r--net-misc/iputils/files/iputils-20121221-add-bits_types_h.patch94
-rw-r--r--net-misc/iputils/files/iputils-20121221-crypto-build.patch35
-rw-r--r--net-misc/iputils/files/iputils-20121221-fix-header-order.patch18
-rw-r--r--net-misc/iputils/files/iputils-20121221-fix-init-elemnt.patch23
-rw-r--r--net-misc/iputils/files/iputils-20121221-fix-musl-headers.patch89
-rw-r--r--net-misc/iputils/files/iputils-20121221-makefile.patch61
-rw-r--r--net-misc/iputils/files/iputils-20121221-openssl.patch92
-rw-r--r--net-misc/iputils/files/iputils-20121221-owl-pingsock.diff224
-rw-r--r--net-misc/iputils/files/iputils-20121221-printf-size.patch64
-rw-r--r--net-misc/iputils/files/iputils-20121221-remove-rdisc-glibc-assumption.patch30
-rw-r--r--net-misc/iputils/iputils-20121221-r99.ebuild109
-rw-r--r--net-misc/iputils/metadata.xml11
-rw-r--r--net-misc/openssh/Manifest23
-rw-r--r--net-misc/openssh/files/openssh-4.7_p1-GSSAPI-dns.patch127
-rw-r--r--net-misc/openssh/files/openssh-6.3_p1-x509-hpn14v2-glue.patch51
-rw-r--r--net-misc/openssh/files/openssh-6.4_p1-x509-glue.patch30
-rw-r--r--net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch21
-rw-r--r--net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch67
-rw-r--r--net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch17
-rw-r--r--net-misc/openssh/files/openssh-6.7_p1-sctp-x509-glue.patch42
-rw-r--r--net-misc/openssh/files/openssh-6.7_p1-sshd-gssapi-multihomed.patch162
-rw-r--r--net-misc/openssh/files/openssh-6.7_p1-x509-glue.patch46
-rw-r--r--net-misc/openssh/files/openssh-6.7p1-avoid-exit.patch441
-rw-r--r--net-misc/openssh/files/sshd.confd21
-rw-r--r--net-misc/openssh/files/sshd.pam_include.24
-rwxr-xr-xnet-misc/openssh/files/sshd.rc6.487
-rw-r--r--net-misc/openssh/files/sshd.service11
-rw-r--r--net-misc/openssh/files/sshd.socket10
-rw-r--r--net-misc/openssh/files/sshd_at.service8
-rw-r--r--net-misc/openssh/metadata.xml34
-rw-r--r--net-misc/openssh/openssh-6.7_p1-r99.ebuild330
-rw-r--r--net-misc/openvpn/Manifest15
-rw-r--r--net-misc/openvpn/files/2.3.6-disable-compression.patch18
-rw-r--r--net-misc/openvpn/files/2.3.6-musl-compat.patch14
-rw-r--r--net-misc/openvpn/files/2.3.6-null-cipher.patch46
-rw-r--r--net-misc/openvpn/files/65openvpn1
-rwxr-xr-xnet-misc/openvpn/files/down.sh33
-rw-r--r--net-misc/openvpn/files/openvpn-2.1.conf18
-rwxr-xr-xnet-misc/openvpn/files/openvpn-2.1.init133
-rw-r--r--net-misc/openvpn/files/openvpn.init63
-rw-r--r--net-misc/openvpn/files/openvpn.service12
-rw-r--r--net-misc/openvpn/files/openvpn.tmpfile1
-rwxr-xr-xnet-misc/openvpn/files/up.sh100
-rw-r--r--net-misc/openvpn/metadata.xml22
-rw-r--r--net-misc/openvpn/openvpn-2.3.6-r99.ebuild137
-rw-r--r--net-misc/openvpn/openvpn-9999.ebuild126
-rw-r--r--net-misc/radvd/Manifest10
-rw-r--r--net-misc/radvd/files/radvd-1.9.1.init71
-rw-r--r--net-misc/radvd/files/radvd-2.10-musl-libc-fix.patch87
-rw-r--r--net-misc/radvd/files/radvd.conf11
-rw-r--r--net-misc/radvd/files/radvd.service15
-rw-r--r--net-misc/radvd/files/radvd.tmpfilesd1
-rw-r--r--net-misc/radvd/metadata.xml12
-rw-r--r--net-misc/radvd/radvd-2.10-r99.ebuild72
-rw-r--r--net-misc/radvd/radvd-2.11-r99.ebuild73
-rw-r--r--net-news/newsbeuter/Manifest4
-rw-r--r--net-news/newsbeuter/files/newsbeuter-2.8-musl.patch43
-rw-r--r--net-news/newsbeuter/metadata.xml12
-rw-r--r--net-news/newsbeuter/newsbeuter-2.8-r99.ebuild59
-rw-r--r--net-wireless/bluez/Manifest14
-rw-r--r--net-wireless/bluez/bluez-5.23-r99.ebuild205
-rw-r--r--net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch58
-rw-r--r--net-wireless/bluez/files/0001-emulator-serial.c-use-posix_openpt-instead-of-getpt.patch37
-rw-r--r--net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch38
-rw-r--r--net-wireless/bluez/files/0001-tools-Fix-compilation-errors-with-musl.patch189
-rw-r--r--net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch29
-rw-r--r--net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch47
-rw-r--r--net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch25
-rw-r--r--net-wireless/bluez/files/bluetooth-init.d-r321
-rw-r--r--net-wireless/bluez/files/bluez-5.23-use-posix_openpt.patch20
-rwxr-xr-xnet-wireless/bluez/files/bluez-plugdev.patch14
-rwxr-xr-xnet-wireless/bluez/files/rfcomm-init.d-r235
-rw-r--r--net-wireless/bluez/metadata.xml21
-rw-r--r--net-wireless/crda/Manifest5
-rw-r--r--net-wireless/crda/crda-1.1.2-r3.ebuild49
-rw-r--r--net-wireless/crda/files/crda-1.1.2-missing-include.patch10
-rw-r--r--net-wireless/crda/files/libnl31-support.diff60
-rw-r--r--net-wireless/crda/metadata.xml16
-rw-r--r--profiles/repo_name1
-rw-r--r--sys-apps/attr/Manifest9
-rw-r--r--sys-apps/attr/attr-2.4.46-r99.ebuild55
-rw-r--r--sys-apps/attr/attr-2.4.47-r99.ebuild70
-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/files/attr-2.4.46-ifdef_cplusplus.patch24
-rw-r--r--sys-apps/attr/metadata.xml5
-rw-r--r--sys-apps/busybox/Manifest37
-rw-r--r--sys-apps/busybox/busybox-1.21.0-r99.ebuild304
-rw-r--r--sys-apps/busybox/busybox-1.22.1-r99.ebuild304
-rw-r--r--sys-apps/busybox/busybox-1.23.0-r99.ebuild305
-rw-r--r--sys-apps/busybox/busybox-1.23.1-r99.ebuild308
-rw-r--r--sys-apps/busybox/busybox-1.23.2-r99.ebuild308
-rw-r--r--sys-apps/busybox/files/busybox-1.19.0-bb.patch22
-rw-r--r--sys-apps/busybox/files/busybox-1.21.0-ifconfig.patch11
-rw-r--r--sys-apps/busybox/files/busybox-1.21.0-iplink.patch12
-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.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/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.xml13
-rw-r--r--sys-apps/findutils/Manifest9
-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-gnulib-musl.patch18
-rw-r--r--sys-apps/findutils/files/findutils-4.4.2-selinux.diff464
-rw-r--r--sys-apps/findutils/files/findutils-4.5.12-gnulib-musl.patch132
-rw-r--r--sys-apps/findutils/findutils-4.4.2-r99.ebuild55
-rw-r--r--sys-apps/findutils/findutils-4.5.12-r99.ebuild51
-rw-r--r--sys-apps/findutils/metadata.xml8
-rw-r--r--sys-apps/hdparm/Manifest9
-rw-r--r--sys-apps/hdparm/files/hdparm-9.39-musl.patch50
-rw-r--r--sys-apps/hdparm/files/hdparm-9.45-musl.patch35
-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-r99.ebuild42
-rw-r--r--sys-apps/hdparm/hdparm-9.45-r99.ebuild42
-rw-r--r--sys-apps/hdparm/metadata.xml5
-rw-r--r--sys-apps/iproute2/Manifest15
-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.19.0-musl.patch22
-rw-r--r--sys-apps/iproute2/files/iproute2-3.8.0-musl-headers.patch81
-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-fix-build-with-musl.patch24
-rw-r--r--sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch62
-rw-r--r--sys-apps/iproute2/iproute2-3.19.0-r99.ebuild126
-rw-r--r--sys-apps/iproute2/iproute2-3.8.0-r99.ebuild118
-rw-r--r--sys-apps/iproute2/iproute2-4.0.0-r99.ebuild126
-rw-r--r--sys-apps/iproute2/metadata.xml9
-rw-r--r--sys-apps/kbd/Manifest10
-rw-r--r--sys-apps/kbd/files/kbd-1.15.5-fix-struct_winsize-collision.patch11
-rw-r--r--sys-apps/kbd/files/kbd-1.15.5-loadkeys-parse.patch90
-rw-r--r--sys-apps/kbd/files/kbd-1.15.5-musl-headers-error.patch115
-rw-r--r--sys-apps/kbd/files/kbd-2.0.0-tests.patch31
-rw-r--r--sys-apps/kbd/files/kbd-2.0.2-musl-headers-error.patch147
-rw-r--r--sys-apps/kbd/kbd-1.15.5-r99.ebuild52
-rw-r--r--sys-apps/kbd/kbd-2.0.2-r99.ebuild64
-rw-r--r--sys-apps/kbd/metadata.xml5
-rw-r--r--sys-apps/keyutils/Manifest5
-rw-r--r--sys-apps/keyutils/files/keyutils-1.5.5-makefile-fixup.patch27
-rw-r--r--sys-apps/keyutils/files/keyutils-1.5.9-UINT_MAX.patch12
-rw-r--r--sys-apps/keyutils/keyutils-1.5.9-r99.ebuild83
-rw-r--r--sys-apps/keyutils/metadata.xml8
-rw-r--r--sys-apps/kmod/Manifest5
-rw-r--r--sys-apps/kmod/files/kmod-19-strndupa.patch23
-rw-r--r--sys-apps/kmod/files/kmod-static-nodes-r119
-rw-r--r--sys-apps/kmod/kmod-19-r99.ebuild192
-rw-r--r--sys-apps/kmod/metadata.xml11
-rw-r--r--sys-apps/ldconfig/Manifest3
-rw-r--r--sys-apps/ldconfig/files/ldconfig-0.1141
-rw-r--r--sys-apps/ldconfig/ldconfig-0.1.ebuild34
-rw-r--r--sys-apps/ldconfig/metadata.xml8
-rw-r--r--sys-apps/net-tools/Manifest11
-rw-r--r--sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch93
-rw-r--r--sys-apps/net-tools/metadata.xml8
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20120127084908-r99.ebuild99
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20130513023548-r99.ebuild97
-rw-r--r--sys-apps/net-tools/net-tools-1.60_p20141019041918-r99.ebuild97
-rw-r--r--sys-apps/pciutils/Manifest7
-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/files/pciutils-3.2.0-io.patch14
-rw-r--r--sys-apps/pciutils/metadata.xml9
-rw-r--r--sys-apps/pciutils/pciutils-3.2.0.ebuild85
-rw-r--r--sys-apps/sandbox/Manifest13
-rw-r--r--sys-apps/sandbox/files/09sandbox1
-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-include-PROTECTED-symbols.patch12
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-log-var.patch51
-rw-r--r--sys-apps/sandbox/files/sandbox-2.6-musl.patch48
-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-2.6-r999.ebuild138
-rw-r--r--sys-apps/shadow/Manifest21
-rw-r--r--sys-apps/shadow/files/default/useradd7
-rw-r--r--sys-apps/shadow/files/login.defs212
-rw-r--r--sys-apps/shadow/files/login.pamd.36
-rw-r--r--sys-apps/shadow/files/login_defs.awk32
-rw-r--r--sys-apps/shadow/files/login_defs_pam.sed24
-rw-r--r--sys-apps/shadow/files/pam.d-include/login12
-rw-r--r--sys-apps/shadow/files/pam.d-include/other9
-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/pam.d-include/su32
-rw-r--r--sys-apps/shadow/files/pam.d-include/su-openpam14
-rw-r--r--sys-apps/shadow/files/pam.d-include/system-auth14
-rw-r--r--sys-apps/shadow/files/pam.d-include/system-auth-1.114
-rw-r--r--sys-apps/shadow/files/securetty33
-rw-r--r--sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch10
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5.1-fix-RUSEROK.patch12
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5.1-fix-struct_in_addr-collision.patch12
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5.1-include-sys-socket.patch13
-rw-r--r--sys-apps/shadow/metadata.xml12
-rw-r--r--sys-apps/shadow/shadow-4.1.5.1-r99.ebuild198
-rw-r--r--sys-apps/sysvinit/Manifest12
-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-musl.patch10
-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-r999.ebuild113
-rw-r--r--sys-apps/tcp-wrappers/Manifest11
-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/files/tcp-wrappers-7.6-remove-DECLS.patch19
-rw-r--r--sys-apps/tcp-wrappers/files/tcp-wrappers-7.6.22-remove-DECLS.patch22
-rw-r--r--sys-apps/tcp-wrappers/metadata.xml11
-rw-r--r--sys-apps/tcp-wrappers/tcp-wrappers-7.6-r99.ebuild77
-rw-r--r--sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r99.ebuild99
-rw-r--r--sys-apps/util-linux/Manifest18
-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/ttydefaults.h38
-rw-r--r--sys-apps/util-linux/files/util-linux-2.23.1-musl.patch110
-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.24.1-musl.patch30
-rw-r--r--sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch40
-rw-r--r--sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch81
-rw-r--r--sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch14
-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.xml19
-rw-r--r--sys-apps/util-linux/util-linux-2.24.1-r99.ebuild147
-rw-r--r--sys-apps/util-linux/util-linux-2.25-r99.ebuild176
-rw-r--r--sys-apps/util-linux/util-linux-2.25.2-r99.ebuild175
-rw-r--r--sys-auth/polkit/Manifest4
-rw-r--r--sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch86
-rw-r--r--sys-auth/polkit/metadata.xml11
-rw-r--r--sys-auth/polkit/polkit-0.112-r99.ebuild123
-rw-r--r--sys-block/parted/Manifest6
-rw-r--r--sys-block/parted/files/parted-3.2-devmapper.patch60
-rw-r--r--sys-block/parted/files/parted-3.2-fix-includes.patch10
-rw-r--r--sys-block/parted/files/parted-3.2-po4a-mandir.patch11
-rw-r--r--sys-block/parted/metadata.xml17
-rw-r--r--sys-block/parted/parted-3.2-r99.ebuild57
-rw-r--r--sys-boot/efibootmgr/Manifest4
-rw-r--r--sys-boot/efibootmgr/efibootmgr-0.11.0-r99.ebuild37
-rw-r--r--sys-boot/efibootmgr/files/efibootmgr-use-linux-pci-header.patch17
-rw-r--r--sys-boot/efibootmgr/metadata.xml20
-rw-r--r--sys-devel/gcc/Manifest30
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk314
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la335
-rwxr-xr-xsys-devel/gcc/files/c8920
-rwxr-xr-xsys-devel/gcc/files/c9921
-rw-r--r--sys-devel/gcc/files/fix_libtool_files.sh68
-rw-r--r--sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch61
-rw-r--r--sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch171
-rw-r--r--sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch51
-rw-r--r--sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch11
-rw-r--r--sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch70
-rw-r--r--sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch12
-rw-r--r--sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch43
-rw-r--r--sys-devel/gcc/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/gcc/files/gcc-spec-env-r1.patch87
-rw-r--r--sys-devel/gcc/files/gcc-spec-env.patch42
-rw-r--r--sys-devel/gcc/files/mkinfodir233
-rw-r--r--sys-devel/gcc/gcc-4.7.4-r99.ebuild63
-rw-r--r--sys-devel/gcc/gcc-4.8.4-r99.ebuild64
-rw-r--r--sys-devel/gcc/metadata.xml27
-rw-r--r--sys-devel/gdb/Manifest7
-rw-r--r--sys-devel/gdb/files/gdb-7.4-linux-nat.patch32
-rw-r--r--sys-devel/gdb/files/gdb-7.5.1-amd64-linux-nat.patch11
-rw-r--r--sys-devel/gdb/files/gdb-7.6-linux-low-threaddb.patch34
-rw-r--r--sys-devel/gdb/gdb-7.7.1-r99.ebuild213
-rw-r--r--sys-devel/gdb/metadata.xml11
-rw-r--r--sys-devel/llvm/Manifest18
-rw-r--r--sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch18
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-install.patch57
-rw-r--r--sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch42
-rw-r--r--sys-devel/llvm/files/llvm-3.2-nodoctargz.patch45
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch43
-rw-r--r--sys-devel/llvm/files/llvm-3.5-gentoo-install.patch83
-rw-r--r--sys-devel/llvm/files/llvm-3.5-musl-clang-support.patch59
-rw-r--r--sys-devel/llvm/files/llvm-3.5-musl-compiler-rt.patch58
-rw-r--r--sys-devel/llvm/files/llvm-3.5-musl-fixes.patch77
-rw-r--r--sys-devel/llvm/files/llvm-3.5-musl-support.patch67
-rw-r--r--sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch39
-rw-r--r--sys-devel/llvm/llvm-3.5.0-r99.ebuild531
-rw-r--r--sys-devel/llvm/metadata.xml28
-rw-r--r--sys-devel/m4/Manifest6
-rw-r--r--sys-devel/m4/files/m4-1.4.16-fix-test-readlink.patch11
-rw-r--r--sys-devel/m4/files/m4-1.4.16-gnulib-musl.patch18
-rw-r--r--sys-devel/m4/files/m4-1.4.16-no-gets.patch24
-rw-r--r--sys-devel/m4/m4-1.4.16-r99.ebuild53
-rw-r--r--sys-devel/m4/metadata.xml5
-rw-r--r--sys-fs/dosfstools/Manifest5
-rw-r--r--sys-fs/dosfstools/dosfstools-3.0.28-r99.ebuild29
-rw-r--r--sys-fs/dosfstools/files/dosfstools-3.0.27-Fix-format-string-in-check.c.patch25
-rw-r--r--sys-fs/dosfstools/files/dosfstools-3.0.28-fix_build_with_musl.patch25
-rw-r--r--sys-fs/dosfstools/metadata.xml5
-rw-r--r--sys-fs/encfs/Manifest5
-rw-r--r--sys-fs/encfs/encfs-1.7.4-r99.ebuild44
-rw-r--r--sys-fs/encfs/files/encfs-1.7.4-encfsctl.patch10
-rw-r--r--sys-fs/encfs/files/encfs-1.7.4-r68:69.patch31
-rw-r--r--sys-fs/encfs/metadata.xml11
-rw-r--r--sys-fs/fuse/Manifest6
-rw-r--r--sys-fs/fuse/files/fuse-2.9.3-includes.patch66
-rw-r--r--sys-fs/fuse/files/fuse-fbsd.init23
-rw-r--r--sys-fs/fuse/files/fuse.init35
-rw-r--r--sys-fs/fuse/fuse-2.9.3-r99.ebuild88
-rw-r--r--sys-fs/fuse/metadata.xml8
-rw-r--r--sys-fs/lvm2/Manifest30
-rw-r--r--sys-fs/lvm2/files/clvmd.confd-2.02.399
-rwxr-xr-xsys-fs/lvm2/files/clvmd.rc-2.02.39146
-rw-r--r--sys-fs/lvm2/files/device-mapper.conf-1.02.22-r31
-rw-r--r--sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2147
-rw-r--r--sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2111
-rw-r--r--sys-fs/lvm2/files/dmeventd.initd-2.02.67-r126
-rw-r--r--sys-fs/lvm2/files/dmtab12
-rw-r--r--sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r239
-rw-r--r--sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r246
-rw-r--r--sys-fs/lvm2/files/lvm.confd-2.02.28-r25
-rw-r--r--sys-fs/lvm2/files/lvm.rc-2.02.105-r297
-rw-r--r--sys-fs/lvm2/files/lvm.rc-2.02.95-r296
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch93
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch32
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch104
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch50
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch104
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch72
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch42
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch18
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch15
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch63
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch47
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch11
-rw-r--r--sys-fs/lvm2/files/lvm2-fix-stdio-usage.patch111
-rw-r--r--sys-fs/lvm2/files/lvm2-musl-fixes.patch33
-rwxr-xr-xsys-fs/lvm2/files/lvmetad.initd-2.02.105-r213
-rw-r--r--sys-fs/lvm2/lvm2-2.02.110-r99.ebuild275
-rw-r--r--sys-fs/lvm2/metadata.xml24
-rw-r--r--sys-fs/squashfs-tools/Manifest6
-rw-r--r--sys-fs/squashfs-tools/files/squashfs-tools-4.2-missing-includes.patch10
-rw-r--r--sys-fs/squashfs-tools/metadata.xml8
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-4.2-r99.ebuild59
-rw-r--r--sys-fs/squashfs-tools/squashfs-tools-4.3-r99.ebuild61
-rw-r--r--sys-fs/xfsdump/Manifest6
-rw-r--r--sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch22
-rw-r--r--sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch14
-rw-r--r--sys-fs/xfsdump/files/xfsdump-3.1.4-compat-musl.patch36
-rw-r--r--sys-fs/xfsdump/metadata.xml5
-rw-r--r--sys-fs/xfsdump/xfsdump-3.1.4-r99.ebuild45
-rw-r--r--sys-fs/xfsprogs/ChangeLog783
-rw-r--r--sys-fs/xfsprogs/Manifest7
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-3.2.2-add-limits-h.patch10
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-3.2.2-musl-compat.patch154
-rw-r--r--sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch108
-rw-r--r--sys-fs/xfsprogs/metadata.xml5
-rw-r--r--sys-fs/xfsprogs/xfsprogs-3.2.2-r99.ebuild100
-rw-r--r--sys-kernel/linux-headers/Manifest7
-rw-r--r--sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch12
-rw-r--r--sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch61
-rw-r--r--sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch39
-rw-r--r--sys-kernel/linux-headers/linux-headers-3.18-r99.ebuild57
-rw-r--r--sys-kernel/linux-headers/metadata.xml8
-rw-r--r--sys-libs/efivar/Manifest4
-rw-r--r--sys-libs/efivar/efivar-0.15-r99.ebuild27
-rw-r--r--sys-libs/efivar/files/efivar-0.15-portability.patch29
-rw-r--r--sys-libs/efivar/metadata.xml14
-rw-r--r--sys-libs/gdbm/Manifest4
-rw-r--r--sys-libs/gdbm/gdbm-1.11-r99.ebuild70
-rw-r--r--sys-libs/gdbm/metadata.xml9
-rw-r--r--sys-libs/libcap-ng/Manifest6
-rw-r--r--sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch11
-rw-r--r--sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild117
-rw-r--r--sys-libs/libcap-ng/libcap-ng-0.7.4-r99.ebuild93
-rw-r--r--sys-libs/libcap-ng/metadata.xml10
-rw-r--r--sys-libs/libutempter/Manifest4
-rw-r--r--sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch81
-rw-r--r--sys-libs/libutempter/libutempter-1.1.6-r99.ebuild72
-rw-r--r--sys-libs/libutempter/metadata.xml6
-rw-r--r--sys-libs/pam/Manifest7
-rw-r--r--sys-libs/pam/files/pam-1.1.8-doc-install.patch142
-rw-r--r--sys-libs/pam/files/pam-1.1.8-fix-compat.patch21
-rw-r--r--sys-libs/pam/files/pam-1.1.8-innetgr.patch54
-rw-r--r--sys-libs/pam/metadata.xml32
-rw-r--r--sys-libs/pam/pam-1.1.8-r99.ebuild205
-rw-r--r--sys-libs/readline/Manifest12
-rw-r--r--sys-libs/readline/files/readline-5.0-no_rpath.patch13
-rw-r--r--sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch24
-rw-r--r--sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch14
-rw-r--r--sys-libs/readline/metadata.xml5
-rw-r--r--sys-libs/readline/readline-6.2_p4-r99.ebuild110
-rw-r--r--sys-libs/readline/readline-6.2_p5-r99.ebuild154
-rw-r--r--sys-libs/talloc/Manifest6
-rw-r--r--sys-libs/talloc/files/talloc-remove-check-bsd-strtoll.patch24
-rw-r--r--sys-libs/talloc/metadata.xml12
-rw-r--r--sys-libs/talloc/talloc-2.0.8-r99.ebuild67
-rw-r--r--sys-libs/talloc/talloc-2.1.0-r99.ebuild67
-rw-r--r--sys-libs/tdb/Manifest6
-rw-r--r--sys-libs/tdb/files/tdb-remove-check-bsd-strtoll.patch25
-rw-r--r--sys-libs/tdb/metadata.xml9
-rw-r--r--sys-libs/tdb/tdb-1.2.11-r99.ebuild46
-rw-r--r--sys-libs/tdb/tdb-1.2.12-r99.ebuild44
-rw-r--r--sys-libs/tevent/Manifest11
-rw-r--r--sys-libs/tevent/files/add-py-file-0.9.14.patch32
-rw-r--r--sys-libs/tevent/files/add-py-file.patch32
-rw-r--r--sys-libs/tevent/files/tevent-remove-check-bsd-strtoll.patch24
-rw-r--r--sys-libs/tevent/files/tevent-version.patch27
-rw-r--r--sys-libs/tevent/metadata.xml9
-rw-r--r--sys-libs/tevent/tevent-0.9.19-r99.ebuild44
-rw-r--r--sys-libs/tevent/tevent-0.9.20-r99.ebuild44
-rw-r--r--sys-libs/tevent/tevent-0.9.21-r99.ebuild44
-rw-r--r--sys-process/cronie/Manifest8
-rw-r--r--sys-process/cronie/cronie-1.4.12-r99.ebuild87
-rw-r--r--sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch15
-rw-r--r--sys-process/cronie/files/cronie-1.2-cron.deny5
-rw-r--r--sys-process/cronie/files/cronie-1.3-crontab16
-rw-r--r--sys-process/cronie/files/cronie-1.3-initd14
-rw-r--r--sys-process/cronie/files/cronie-1.4.3-pamd9
-rw-r--r--sys-process/cronie/metadata.xml20
-rw-r--r--sys-process/lsof/Manifest9
-rw-r--r--sys-process/lsof/files/lsof-4.85-arg.c.patch30
-rw-r--r--sys-process/lsof/files/lsof-4.85-cross.patch33
-rw-r--r--sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch11
-rw-r--r--sys-process/lsof/files/lsof-4.87-remove-glibc-check.patch15
-rw-r--r--sys-process/lsof/lsof-4.85-r99.ebuild81
-rw-r--r--sys-process/lsof/lsof-4.87-r99.ebuild98
-rw-r--r--sys-process/lsof/metadata.xml8
-rw-r--r--sys-process/procps/Manifest14
-rw-r--r--sys-process/procps/files/procps-3.3.6-error_at_line.patch12
-rw-r--r--sys-process/procps/files/procps-3.3.8-kill-neg-pid.patch46
-rw-r--r--sys-process/procps/files/procps-3.3.8-no-GLOB_TILDE.patch12
-rw-r--r--sys-process/procps/files/procps-3.3.8-no-error_h.patch54
-rw-r--r--sys-process/procps/files/procps-3.3.9-configure.patch13
-rw-r--r--sys-process/procps/files/procps-3.3.9-no-error_h.patch64
-rw-r--r--sys-process/procps/metadata.xml8
-rw-r--r--sys-process/procps/procps-3.3.10-r99.ebuild63
-rw-r--r--sys-process/procps/procps-3.3.8-r99.ebuild56
-rw-r--r--sys-process/procps/procps-3.3.9-r99.ebuild56
-rw-r--r--sys-process/psmisc/Manifest4
-rw-r--r--sys-process/psmisc/files/psmisc-22.21-add-limits_h.patch11
-rw-r--r--sys-process/psmisc/metadata.xml5
-rw-r--r--sys-process/psmisc/psmisc-22.21-r99.ebuild56
-rw-r--r--www-client/firefox/Manifest100
-rw-r--r--www-client/firefox/files/1130164.patch68
-rw-r--r--www-client/firefox/files/1130175.patch33
-rw-r--r--www-client/firefox/files/1130710.patch57
-rw-r--r--www-client/firefox/files/basename.patch25
-rw-r--r--www-client/firefox/files/crashreporter.patch358
-rw-r--r--www-client/firefox/files/firefox-35.0-gmp-clearkey-sprintf.patch10
-rw-r--r--www-client/firefox/files/fts.patch480
-rw-r--r--www-client/firefox/files/gentoo-default-prefs.js-117
-rw-r--r--www-client/firefox/files/icon/firefox.desktop9
-rw-r--r--www-client/firefox/files/libstagefright-cdefs.patch21
-rw-r--r--www-client/firefox/files/profiler-gettid.patch51
-rw-r--r--www-client/firefox/files/sandbox-cdefs.patch21
-rw-r--r--www-client/firefox/files/sctp-36.patch52
-rw-r--r--www-client/firefox/files/sctp.patch58
-rw-r--r--www-client/firefox/files/sipcc.patch159
-rw-r--r--www-client/firefox/files/updater.patch42
-rw-r--r--www-client/firefox/files/xpcom-blocksize.patch22
-rw-r--r--www-client/firefox/firefox-37.0.1-r99.ebuild421
-rw-r--r--www-client/firefox/metadata.xml26
-rw-r--r--www-misc/htdig/Manifest7
-rw-r--r--www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch20
-rw-r--r--www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch61
-rw-r--r--www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch15
-rw-r--r--www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch26
-rw-r--r--www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild68
-rw-r--r--www-misc/htdig/metadata.xml5
-rw-r--r--x11-apps/sessreg/Manifest4
-rw-r--r--x11-apps/sessreg/files/sessreg-1.0.8-missing_path_wtmpx.patch12
-rw-r--r--x11-apps/sessreg/metadata.xml5
-rw-r--r--x11-apps/sessreg/sessreg-1.0.8-r99.ebuild19
-rw-r--r--x11-base/xorg-server/Manifest21
-rw-r--r--x11-base/xorg-server/files/xdm-setup.initd-114
-rw-r--r--x11-base/xorg-server/files/xdm.confd-410
-rw-r--r--x11-base/xorg-server/files/xdm.initd-10226
-rw-r--r--x11-base/xorg-server/files/xdm.initd-11231
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch75
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch11
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch60
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch53
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.14.3-musl.patch31
-rw-r--r--x11-base/xorg-server/files/xorg-server-disable-acpi.patch31
-rw-r--r--x11-base/xorg-server/files/xorg-sets.conf6
-rw-r--r--x11-base/xorg-server/metadata.xml17
-rw-r--r--x11-base/xorg-server/xorg-server-1.14.3-r99.ebuild251
-rw-r--r--x11-base/xorg-server/xorg-server-1.15.0-r99.ebuild254
-rw-r--r--x11-base/xorg-server/xorg-server-1.15.2-r99.ebuild257
-rw-r--r--x11-base/xorg-server/xorg-server-1.16.4-r99.ebuild259
-rw-r--r--x11-libs/libpciaccess/Manifest7
-rw-r--r--x11-libs/libpciaccess/files/libpciaccess-0.13.2-arm.patch11
-rw-r--r--x11-libs/libpciaccess/files/libpciaccess-0.13.2-limits.patch10
-rw-r--r--x11-libs/libpciaccess/libpciaccess-0.13.2-r99.ebuild44
-rw-r--r--x11-libs/libpciaccess/libpciaccess-0.13.3-r99.ebuild40
-rw-r--r--x11-libs/libpciaccess/metadata.xml5
-rw-r--r--x11-misc/slim/Manifest16
-rw-r--r--x11-misc/slim/files/Xsession-r3158
-rw-r--r--x11-misc/slim/files/slim-1.3.5-arm.patch11
-rw-r--r--x11-misc/slim/files/slim-1.3.5-disable-ck-for-systemd.patch122
-rw-r--r--x11-misc/slim/files/slim-1.3.6-add-missing-libgen_h.patch11
-rw-r--r--x11-misc/slim/files/slim-1.3.6-config.diff77
-rw-r--r--x11-misc/slim/files/slim-1.3.6-drop-zlib.patch10
-rw-r--r--x11-misc/slim/files/slim-1.3.6-fix-slimlock-nopam-v2.patch26
-rw-r--r--x11-misc/slim/files/slim-1.3.6-honour-cflags.patch14
-rw-r--r--x11-misc/slim/files/slim-1.3.6-libslim-cmake-fixes.patch33
-rw-r--r--x11-misc/slim/files/slim-1.3.6-session-chooser.patch115
-rw-r--r--x11-misc/slim/files/slim-1.3.6-strip-systemd-unit-install.patch13
-rw-r--r--x11-misc/slim/files/slim-1.3.6-systemd-session.patch29
-rw-r--r--x11-misc/slim/files/slim.logrotate9
-rw-r--r--x11-misc/slim/metadata.xml12
-rw-r--r--x11-misc/slim/slim-1.3.6-r99.ebuild123
947 files changed, 63657 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 00000000..c078176e
--- /dev/null
+++ b/README
@@ -0,0 +1,6 @@
+This is the README only for the musl branch. See the README in main branch
+for information about the entire overlay.
+
+This overlay/branch is to set up a profile for musl based system.
+
+See: http://www.etalabs.net/musl/
diff --git a/app-crypt/shash/Manifest b/app-crypt/shash/Manifest
new file mode 100644
index 00000000..ca2d4a3b
--- /dev/null
+++ b/app-crypt/shash/Manifest
@@ -0,0 +1,7 @@
+AUX 0.2.6-manpage-fixes.patch 1451 SHA256 12619eaba8cfd99917658139306fb8c0ff087f10ce05bd285aa3c8e66f88e317 SHA512 10dbcfa52a7df57ef68dc58f21e1b2931adf0479697e13f99c56ccfbbd1c79188751d1ce7e2b160261170a678a4130a71a6b531820aa59e4ddbd131d5d9cb551 WHIRLPOOL 11b4d1aaf6feae4dd00d7abfbe704fcb8ba665d0de46de724098fa57b60960060c6df7661c9e3735c9ccd5865ab6c66cad3527395fec4279822e114dc59ab92d
+AUX shash-0.2.6-binary-files.patch 898 SHA256 e06660afe1afb338bf4f209d39ac33c412ecc6fb22feec684c0a7b5fd80f46a6 SHA512 47f299097b8a9907ccfe2f877c42ab8f76f02546211643573796b378d67dd7941518341f8fd07e646c1aa11a665ddbca6ae113a4d58f6995007d9b5aec171d8b WHIRLPOOL 0bbe198601dd7b1ce55719936d8670975505b9b31baa68f0663d25c9988026587b8bc1dcfb18d188b598298715f57716c334b875ac6ff5075ff3a79dc121e7f9
+AUX shash-0.2.6-missing-includes.patch 483 SHA256 c00017237b6f6176424f9738ec7d97ecdde8994916aaa62d0138d7901cc1131d SHA512 3adf22d3a886d703a51d614f1106f20bf3f7b068e416317ba5cbd4def91f60b31a6737c11d7f44a44c48e1a713df4b2074b3ad68653be5dd117486148fbab81e WHIRLPOOL 1932da3b2905b6405d5bfa5dfea878a584f01b2e9b41859b8adf559987e9a822f0075822744f7c23b9f57f7228cc8f3931e4e02c3c17637b436c8ec2ea41b239
+AUX shash.bash-completion 993 SHA256 5f3d0bb5a202ba3365c81945ec2f0318893f1f372f11c8b4d7bc524888d8d228 SHA512 6b646fc5de7bc8279d49541f7375f6212e314fef3c9bc2a992d38e0b78031d9476ae396bdd527f39380bdb0342c8d27e46e4a01e3c1f5877c3fbd8ad49346393 WHIRLPOOL 5e693b82a794a482365797d1f72adca00015a5302b6b12da0ab91dd06bc15357eee9942766c000278af6b5574f3f5f564cba1d37189b0c0571615f796912286c
+DIST shash-0.2.6.tar.gz 105641 SHA256 6abf13eb1c3b4b6ef0f07e5425d10ed2abaad1d08c327647feb3506e76ced9dc SHA512 340a59bd16b3e5069a076b56f8fe24d2306a6ddd5e6ad564c5e17a992d8e279a7109ba39bd5caa8438a0e85b4f94cb0878228f7aefe38221ff6efa80df64086b WHIRLPOOL 8b809f5fddc98def54907fee8af424937c747f341dd0eaa6fd0c1057858c4dce7d117dfbc729cdd951c53e68a363d3339e9db4e2de1677620bbb9a94a810e8a5
+EBUILD shash-0.2.6-r99.ebuild 1044 SHA256 7a21c9fcf8d17d37b6b1b4b6384cfb6056dd48559695da3987db1b10e73ebb6d SHA512 de04a45b2d33020db9edbe1b0048e805feebfba65ce3bea053006fcf9b89acea6baf1c4bf392386123c9fda6704c6952c75174dd41608bee6fa9cf7c087b2175 WHIRLPOOL 03f2a69d8a97350bbdbf0a52f6e0f71c269dded1d0144ec85dd5eebfa8d13d3e9281c08e76dee76e1a77e321357a5bcc0434a167f8f73e1cad9769c70ef992e1
+MISC metadata.xml 423 SHA256 c700cda1fdc97248759b263259be6f558ebaaca339417f227bce282e1bfaf0f0 SHA512 24491d06bd39df6f4ad1d85a121f2a62b65db3a1b12db01ad9f390c752a8663483828dbd467d6eea8f8d585c2acd621c91d4a6c75b073cf9ae57fe72c0bb3b92 WHIRLPOOL f59da151f4f0f459f69004df56da565079a31ed08b2833fea10cd66a431a4cf0f45a5664622751ba8d801c45c900a498d34876c5fcb270f8ff53cf6a01a5ad42
diff --git a/app-crypt/shash/files/0.2.6-manpage-fixes.patch b/app-crypt/shash/files/0.2.6-manpage-fixes.patch
new file mode 100644
index 00000000..0376e15c
--- /dev/null
+++ b/app-crypt/shash/files/0.2.6-manpage-fixes.patch
@@ -0,0 +1,30 @@
+diff -pruN shash-0.2.6/doc/shash.1 shash-0.2.6-r1/doc/shash.1
+--- shash-0.2.6/doc/shash.1 2004-09-18 09:51:04.004647112 +0100
++++ shash-0.2.6-r1/doc/shash.1 2004-09-18 09:57:26.062565480 +0100
+@@ -31,7 +31,7 @@ Because of this shash also supports HMAC
+ a mechanism for message authentication using cryptographic hash functions.
+ So shash can use a key with a hash algorithm to produce hashes that can only
+ be verified with the key. This way you can securely check (i.e. you are sure
+-that nobody can modify the mac, without beeing detected)
++that nobody can modify the mac, without being detected)
+ if files in a filesystem were altered.
+
+ If the list of files and digests, that shash produces, is stored as
+@@ -72,7 +72,7 @@ Suppress some not critical warnings.
+ .TP
+ .B \-b
+ Use binary mode. In unix environment, only difference between this and
+-the normal mode is an asterix preceding the filename in the output.
++the normal mode is an asterisk preceding the filename in the output.
+ .TP
+ .B \-c
+ Check the checksum of all files listed in
+@@ -94,7 +94,7 @@ Enter the keyword via the command line.
+ keyword instead of prompting for it. Keep in mind that someone
+ may see the command you are executing and so your key.
+ .TP
+-.B \-c --config FILE
++.B \-i --config FILE
+ Use the specified configuration file. The default is .shashrc
+ in your home directory. The format of the configuration
+ file is the same as the parameters. An example file is:
diff --git a/app-crypt/shash/files/shash-0.2.6-binary-files.patch b/app-crypt/shash/files/shash-0.2.6-binary-files.patch
new file mode 100644
index 00000000..1eb0cba1
--- /dev/null
+++ b/app-crypt/shash/files/shash-0.2.6-binary-files.patch
@@ -0,0 +1,34 @@
+--- shash-0.2.6/src/shash.c
++++ shash-0.2.6/src/shash.c
+@@ -631,11 +631,11 @@
+
+ if (nosalt == FALSE && hmac == 1) {
+ if (sscanf
+- (linebuf, "%s %s %s\n", hexbuffer, buffer,
+- buffer2) < 2) {
++ (linebuf, "%s %s *%s\n", hexbuffer, buffer,
++ buffer2) != 3) {
+ if (sscanf
+- (linebuf, "%s %s *%s\n", hexbuffer,
+- buffer, buffer2) < 2)
++ (linebuf, "%s %s %s\n", hexbuffer,
++ buffer, buffer2) != 3)
+ continue;
+ }
+
+@@ -648,11 +648,11 @@
+ key = pass2key(algorithm, keymode_buffer, &keylen, password, plen);
+
+ } else {
+- if (sscanf(linebuf, "%s %s\n", buffer, buffer2) ==
+- 0) {
++ if (sscanf(linebuf, "%s *%s\n", buffer, buffer2) !=
++ 2) {
+ if (sscanf
+- (linebuf, "%s *%s\n", buffer,
+- buffer2) == 0)
++ (linebuf, "%s %s\n", buffer,
++ buffer2) != 2)
+ continue;
+ }
+
diff --git a/app-crypt/shash/files/shash-0.2.6-missing-includes.patch b/app-crypt/shash/files/shash-0.2.6-missing-includes.patch
new file mode 100644
index 00000000..1d579341
--- /dev/null
+++ b/app-crypt/shash/files/shash-0.2.6-missing-includes.patch
@@ -0,0 +1,27 @@
+--- a/shash-0.2.6/src/errors.c
++++ b/shash-0.2.6/src/errors.c
+@@ -1,4 +1,5 @@
+ #include <defines.h>
++#include <stdio.h>
+
+ extern int quiet;
+
+--- a/shash-0.2.6/src/random.c
++++ b/shash-0.2.6/src/random.c
+@@ -18,6 +18,8 @@
+ #define DEFINES_H
+ #include <defines.h>
+ #endif
++#include <stdlib.h>
++#include <stdio.h>
+
+ #ifdef HAVE_DEV_RANDOM
+
+--- a/shash-0.2.6/src/extra.c
++++ b/shash-0.2.6/src/extra.c
+@@ -1,4 +1,5 @@
+ #include <defines.h>
++#include <strings.h>
+
+ #ifdef HAVE_STAT
+
diff --git a/app-crypt/shash/files/shash.bash-completion b/app-crypt/shash/files/shash.bash-completion
new file mode 100644
index 00000000..d57701fc
--- /dev/null
+++ b/app-crypt/shash/files/shash.bash-completion
@@ -0,0 +1,40 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/shash/files/shash.bash-completion,v 1.2 2006/10/13 15:00:13 swegener Exp $
+#
+# shash(1) completion.
+
+have shash &&
+_shash() {
+ local cur prev
+
+ COMPREPLY=()
+ cur=${COMP_WORDS[COMP_CWORD]}
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ case "${prev}" in
+ -c|--config)
+ _filedir
+ return 0 ;;
+ -o|--keymode)
+ COMPREPLY=( $( compgen -W "$( shash --listkeygen | tail -n +2 )" \
+ -- ${cur} ) )
+ return ;;
+ -a|--algorithm)
+ COMPREPLY=( $( compgen -W "$( shash --list )" \
+ -- ${cur} ) )
+ return ;;
+ *)
+ ;;
+ esac
+
+ COMPREPLY=( $( compgen -W '-V -q -m -d -c -b -t -o -i -a -l -k -h -v \
+ -L \
+ --verbose --quiet --nosalt --time --hmac --doublecheck \
+ --check --binary --text --keymode --config --algorithm \
+ --list --key --listkeygen --help --version --license' \
+ -- ${cur} ) )
+ _filedir
+ return 0
+} &&
+complete -F _shash ${filenames} shash
diff --git a/app-crypt/shash/metadata.xml b/app-crypt/shash/metadata.xml
new file mode 100644
index 00000000..c6d43950
--- /dev/null
+++ b/app-crypt/shash/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>swegener@gentoo.org</email>
+ <name>Sven Wegener</name>
+ <description>primary maintainer</description>
+ </maintainer>
+ <longdescription>shash is a command-line interface for libmhash and is used to generate or check digests or MACs of files.</longdescription>
+</pkgmetadata>
diff --git a/app-crypt/shash/shash-0.2.6-r99.ebuild b/app-crypt/shash/shash-0.2.6-r99.ebuild
new file mode 100644
index 00000000..97cd443d
--- /dev/null
+++ b/app-crypt/shash/shash-0.2.6-r99.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/shash/shash-0.2.6-r1.ebuild,v 1.25 2014/01/18 05:39:58 vapier Exp $
+
+inherit bash-completion eutils
+
+DESCRIPTION="Generate or check digests or MACs of files"
+HOMEPAGE="http://mcrypt.hellug.gr/shash/"
+SRC_URI="ftp://mcrypt.hellug.gr/pub/mcrypt/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="static"
+
+DEPEND=">=app-crypt/mhash-0.8.18-r1"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PV}-manpage-fixes.patch
+ epatch "${FILESDIR}"/${P}-binary-files.patch
+ epatch "${FILESDIR}"/${P}-missing-includes.patch
+}
+
+src_compile() {
+ econf $(use_enable static static-link) || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die "install failed"
+ dodoc AUTHORS ChangeLog INSTALL NEWS doc/sample.shashrc doc/FORMAT
+ dobashcompletion "${FILESDIR}"/shash.bash-completion ${PN}
+}
diff --git a/app-editors/emacs-vcs/Manifest b/app-editors/emacs-vcs/Manifest
new file mode 100644
index 00000000..e3536c6d
--- /dev/null
+++ b/app-editors/emacs-vcs/Manifest
@@ -0,0 +1,3 @@
+AUX emacs-vcs-musl.patch 2344 SHA256 2e4072282384a42646e1beb50cc1354e24ceab67128e41ebb23549f2466545fe SHA512 d581f5c964d6ae3a2b31acb5c60469086ab36404ea853403cc9b7137e8941f09e77be0966153f0d960fe2cfc3238b6a7467c9648ba00e1610eb4c29086187c56 WHIRLPOOL 58dd2cb23ad0c34eb8ee97bfa5b817ef1d0e102b7b49dd3451ddf5406318f28ea21ea8ce76a6461980ebf69780d02e266b2d928502151b703177985505f2ef2c
+EBUILD emacs-vcs-25.0.9999-r99.ebuild 11391 SHA256 1594a79f30e045667b29744905ee50d482b4ee29bd4af50e6f3e95bbcfddad2d SHA512 cf3bfb19d185051ff0bb7e23f596fa085d906ce3ac8af2d9081236309470e972c09c02587bc0a0471527d33aa9ceafbad5140d609aea341c32a5e7beaf02f910 WHIRLPOOL f159c76f27c13f45d56be7a11ce961c801a0009ab3a44e1f203f1a61a7fe25022f4aa8bf9e3f55d61f037c8e6ff381e59c426c8461cd91e7d235c932f0613f1f
+MISC metadata.xml 2489 SHA256 21b3602d37aa25bca31b05ea810b37ee2192f4e53b8f8daeb814d9dca59d03d7 SHA512 4f3d663cd61253ae3390c55c5974dd3cc22dbf1306a823c3cb71794d09eaf28d7727c7e24f66f02dbd8d3845894f3a8cafa5ddaf330c1bbb7f99d8130ece077c WHIRLPOOL bcefdded503fa9cebea943952d3f56847002cb5ddc10f5adbd774301b648d1b12a09da7e493694f9cbbb19e8b53b66132cbd2e0141ded41b226415cfdbbcf8f6
diff --git a/app-editors/emacs-vcs/emacs-vcs-25.0.9999-r99.ebuild b/app-editors/emacs-vcs/emacs-vcs-25.0.9999-r99.ebuild
new file mode 100644
index 00000000..e67f48fb
--- /dev/null
+++ b/app-editors/emacs-vcs/emacs-vcs-25.0.9999-r99.ebuild
@@ -0,0 +1,365 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs-vcs/emacs-vcs-25.0.9999-r1.ebuild,v 1.3 2014/12/29 11:28:11 ulm Exp $
+
+EAPI=5
+
+inherit autotools elisp-common eutils flag-o-matic multilib readme.gentoo
+
+if [[ ${PV##*.} = 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git://git.sv.gnu.org/emacs.git"
+ EGIT_BRANCH="master"
+ EGIT_CHECKOUT_DIR="${WORKDIR}/emacs"
+ S="${EGIT_CHECKOUT_DIR}"
+else
+ SRC_URI="http://dev.gentoo.org/~ulm/distfiles/emacs-${PV}.tar.xz
+ mirror://gnu-alpha/emacs/pretest/emacs-${PV}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~ppc ~x86"
+ # FULL_VERSION keeps the full version number, which is needed in
+ # order to determine some path information correctly for copy/move
+ # operations later on
+ FULL_VERSION="${PV%%_*}"
+ #S="${WORKDIR}/emacs-${FULL_VERSION}"
+ S="${WORKDIR}/emacs"
+fi
+
+DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
+HOMEPAGE="http://www.gnu.org/software/emacs/"
+
+LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
+SLOT="25"
+IUSE="acl alsa aqua athena dbus games gconf gfile gif gnutls gpm gsettings gtk +gtk3 gzip-el hesiod imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif pax_kernel png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
+REQUIRED_USE="?? ( aqua X )"
+
+RDEPEND="sys-libs/ncurses
+ >=app-eselect/eselect-emacs-1.16
+ >=app-emacs/emacs-common-gentoo-1.4-r1[games?,X?]
+ net-libs/liblockfile
+ acl? ( virtual/acl )
+ alsa? ( media-libs/alsa-lib )
+ dbus? ( sys-apps/dbus )
+ gfile? ( >=dev-libs/glib-2.28.6 )
+ gnutls? ( net-libs/gnutls )
+ gpm? ( sys-libs/gpm )
+ hesiod? ( net-dns/hesiod )
+ kerberos? ( virtual/krb5 )
+ libxml2? ( >=dev-libs/libxml2-2.2.0 )
+ selinux? ( sys-libs/libselinux )
+ zlib? ( sys-libs/zlib )
+ X? (
+ x11-libs/libXmu
+ x11-libs/libXt
+ x11-misc/xbitmaps
+ gconf? ( >=gnome-base/gconf-2.26.2 )
+ gsettings? ( >=dev-libs/glib-2.28.6 )
+ gif? ( media-libs/giflib )
+ jpeg? ( virtual/jpeg:0= )
+ png? ( >=media-libs/libpng-1.4:0= )
+ svg? ( >=gnome-base/librsvg-2.0 )
+ tiff? ( media-libs/tiff )
+ xpm? ( x11-libs/libXpm )
+ imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
+ xft? (
+ media-libs/fontconfig
+ media-libs/freetype
+ x11-libs/libXft
+ m17n-lib? (
+ >=dev-libs/libotf-0.9.4
+ >=dev-libs/m17n-lib-1.5.1
+ )
+ )
+ gtk? (
+ gtk3? ( x11-libs/gtk+:3 )
+ !gtk3? ( x11-libs/gtk+:2 )
+ )
+ !gtk? (
+ motif? ( >=x11-libs/motif-2.3:0 )
+ !motif? (
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( athena? ( x11-libs/libXaw ) )
+ )
+ )
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ gzip-el? ( app-arch/gzip )
+ pax_kernel? (
+ sys-apps/attr
+ sys-apps/paxctl
+ )"
+
+if [[ ${PV##*.} = 9999 ]]; then
+ DEPEND="${DEPEND}
+ sys-apps/texinfo"
+fi
+
+EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
+SITEFILE="20${PN}-${SLOT}-gentoo.el"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-musl.patch
+
+ if [[ ${PV##*.} = 9999 ]]; then
+ FULL_VERSION=$(sed -n 's/^AC_INIT([^,]*,[ \t]*\([^ \t,)]*\).*/\1/p' \
+ configure.ac)
+ [[ ${FULL_VERSION} ]] || die "Cannot determine current Emacs version"
+ einfo "Emacs branch: ${EGIT_BRANCH}"
+ einfo "Commit: ${EGIT_VERSION}"
+ einfo "Emacs version number: ${FULL_VERSION}"
+ [[ ${FULL_VERSION} =~ ^${PV%.*}(\..*)?$ ]] \
+ || die "Upstream version number changed to ${FULL_VERSION}"
+ fi
+
+ epatch_user
+
+ # Fix filename reference in redirected man page
+ sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
+ || die "unable to sed ctags.1"
+
+ AT_M4DIR=m4 eautoreconf
+}
+
+src_configure() {
+ strip-flags
+ filter-flags -pie #526948
+
+ if use sh; then
+ replace-flags "-O[1-9]" -O0 #262359
+ elif use ia64; then
+ replace-flags "-O[2-9]" -O1 #325373
+ else
+ replace-flags "-O[3-9]" -O2
+ fi
+
+ local myconf
+
+ if use alsa; then
+ use sound || ewarn \
+ "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
+ myconf+=" --with-sound=alsa"
+ else
+ myconf+=" --with-sound=$(usex sound oss)"
+ fi
+
+ if use X; then
+ myconf+=" --with-x --without-ns"
+ myconf+=" $(use_with gconf)"
+ myconf+=" $(use_with gsettings)"
+ myconf+=" $(use_with toolkit-scroll-bars)"
+ myconf+=" $(use_with gif)"
+ myconf+=" $(use_with jpeg)"
+ myconf+=" $(use_with png)"
+ myconf+=" $(use_with svg rsvg)"
+ myconf+=" $(use_with tiff)"
+ myconf+=" $(use_with xpm)"
+ myconf+=" $(use_with imagemagick)"
+
+ if use xft; then
+ myconf+=" --with-xft"
+ myconf+=" $(use_with m17n-lib libotf)"
+ myconf+=" $(use_with m17n-lib m17n-flt)"
+ else
+ myconf+=" --without-xft"
+ myconf+=" --without-libotf --without-m17n-flt"
+ use m17n-lib && ewarn \
+ "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
+ fi
+
+ local f
+ if use gtk; then
+ einfo "Configuring to build with GIMP Toolkit (GTK+)"
+ myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
+ for f in motif Xaw3d athena; do
+ use ${f} && ewarn \
+ "USE flag \"${f}\" has no effect if \"gtk\" is set."
+ done
+ elif use motif; then
+ einfo "Configuring to build with Motif toolkit"
+ myconf+=" --with-x-toolkit=motif"
+ for f in Xaw3d athena; do
+ use ${f} && ewarn \
+ "USE flag \"${f}\" has no effect if \"motif\" is set."
+ done
+ elif use athena || use Xaw3d; then
+ einfo "Configuring to build with Athena/Lucid toolkit"
+ myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
+ else
+ einfo "Configuring to build with no toolkit"
+ myconf+=" --with-x-toolkit=no"
+ fi
+ elif use aqua; then
+ einfo "Configuring to build with Nextstep (Cocoa) support"
+ myconf+=" --with-ns --disable-ns-self-contained"
+ myconf+=" --without-x"
+ else
+ myconf+=" --without-x --without-ns"
+ fi
+
+ # Save version information in the Emacs binary. It will be available
+ # in variable "system-configuration-options".
+ myconf+=" GENTOO_PACKAGE=${CATEGORY}/${PF}"
+ if [[ ${PV##*.} = 9999 ]]; then
+ myconf+=" EGIT_BRANCH=${EGIT_BRANCH} EGIT_VERSION=${EGIT_VERSION}"
+ fi
+
+ econf \
+ --program-suffix="-${EMACS_SUFFIX}" \
+ --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
+ --localstatedir="${EPREFIX}"/var \
+ --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
+ --with-gameuser="${GAMES_USER_DED:-games}" \
+ --without-compress-install \
+ --with-file-notification=$(usev gfile || usev inotify || echo no) \
+ $(use_enable acl) \
+ $(use_with dbus) \
+ $(use_with gnutls) \
+ $(use_with gpm) \
+ $(use_with hesiod) \
+ $(use_with kerberos) $(use_with kerberos kerberos5) \
+ $(use_with libxml2 xml2) \
+ $(use_with selinux) \
+ $(use_with wide-int) \
+ $(use_with zlib) \
+ ${myconf}
+}
+
+src_compile() {
+ export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
+ emake
+}
+
+src_install () {
+ emake DESTDIR="${D}" NO_BIN_LINK=t install
+
+ mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
+ || die "moving emacs executable failed"
+ mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
+ || die "moving emacs man page failed"
+
+ # move info dir to avoid collisions with the dir file generated by portage
+ mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
+ || die "moving info dir failed"
+ touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
+ docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
+
+ # avoid collision between slots, see bug #169033 e.g.
+ rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
+ rm -rf "${ED}"/usr/share/{appdata,applications,icons}
+ rm -rf "${ED}"/var
+
+ # remove unused <version>/site-lisp dir
+ rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
+
+ # remove COPYING file (except for etc/COPYING used by describe-copying)
+ rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
+
+ if use gzip-el; then
+ # compress .el files when a corresponding .elc exists
+ find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
+ -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
+ assert "gzip .el failed"
+ fi
+
+ local cdir
+ if use source; then
+ cdir="/usr/share/emacs/${FULL_VERSION}/src"
+ insinto "${cdir}"
+ # This is not meant to install all the source -- just the
+ # C source you might find via find-function
+ doins src/*.{c,h,m}
+ elif has installsources ${FEATURES}; then
+ cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
+ fi
+
+ sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF
+ X
+ ;;; ${PN}-${SLOT} site-lisp configuration
+ X
+ (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
+ Y (setq find-function-C-source-directory
+ Y "${EPREFIX}${cdir}")
+ X (let ((path (getenv "INFOPATH"))
+ X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
+ X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
+ X (and path
+ X ;; move Emacs Info dir before anything else in /usr/share/info
+ X (let* ((p (cons nil (split-string path ":" t))) (q p))
+ X (while (and (cdr q) (not (string-match re (cadr q))))
+ X (setq q (cdr q)))
+ X (setcdr q (cons dir (delete dir (cdr q))))
+ X (setq Info-directory-list (prune-directory-list (cdr p)))))))
+ EOF
+ elisp-site-file-install "${T}/${SITEFILE}" || die
+
+ dodoc README BUGS CONTRIBUTE
+
+ if use aqua; then
+ dodir /Applications/Gentoo
+ rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
+ mv nextstep/Emacs.app \
+ "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
+ fi
+
+ DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
+ through the Emacs eselect module, which also redirects man and info
+ pages. Therefore, several Emacs versions can be installed at the
+ same time. \"man emacs.eselect\" for details.
+ \\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
+ strongly recommended that you use app-admin/emacs-updater to rebuild
+ all byte-compiled elisp files of the installed Emacs packages."
+ use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
+ Installing media-fonts/font-adobe-{75,100}dpi on the X server's
+ machine would satisfy basic Emacs requirements under X11.
+ See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
+ for how to enable anti-aliased fonts."
+ use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
+ \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
+ it into /Applications by yourself."
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # move Info dir file to correct name
+ local infodir=/usr/share/info/${EMACS_SUFFIX} f
+ if [[ -f ${ED}${infodir}/dir.orig ]]; then
+ mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
+ elif [[ -d "${ED}"${infodir} ]]; then
+ # this should not happen in EAPI 4
+ ewarn "Regenerating Info directory index in ${infodir} ..."
+ rm -f "${ED}"${infodir}/dir{,.*}
+ for f in "${ED}"${infodir}/*; do
+ if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
+ install-info --info-dir="${ED}"${infodir} "${f}" \
+ || die "install-info failed"
+ fi
+ done
+ fi
+}
+
+pkg_postinst() {
+ elisp-site-regen
+
+ local pvr
+ for pvr in ${REPLACING_VERSIONS}; do
+ [[ ${pvr%%[-_]*} = 24.[12] ]] && FORCE_PRINT_ELOG=1
+ done
+ readme.gentoo_print_elog
+
+ if use livecd; then
+ # force an update of the emacs symlink for the livecd/dvd,
+ # because some microemacs packages set it with USE=livecd
+ eselect emacs update
+ elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
+ # refresh symlinks in case any installed files have changed
+ eselect emacs set ${EMACS_SUFFIX}
+ else
+ eselect emacs update ifunset
+ fi
+}
+
+pkg_postrm() {
+ elisp-site-regen
+ eselect emacs update ifunset
+}
diff --git a/app-editors/emacs-vcs/files/emacs-vcs-musl.patch b/app-editors/emacs-vcs/files/emacs-vcs-musl.patch
new file mode 100644
index 00000000..95a2c268
--- /dev/null
+++ b/app-editors/emacs-vcs/files/emacs-vcs-musl.patch
@@ -0,0 +1,89 @@
+http://www.openwall.com/lists/musl/2015/02/03/1
+
+--- emacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86/configure.ac
++++ emacs/configure.ac
+@@ -2092,7 +2092,7 @@
+
+ system_malloc=$emacs_cv_sanitize_address
+
+-hybrid_malloc=
++hybrid_malloc=yes
+
+ case "$opsys" in
+ ## darwin ld insists on the use of malloc routines in the System framework.
+--- emacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86/src/Makefile.in
++++ emacs/src/Makefile.in
+@@ -373,6 +373,7 @@
+ region-cache.o sound.o atimer.o \
+ doprnt.o intervals.o textprop.o composite.o xml.o $(NOTIFY_OBJ) \
+ profiler.o decompress.o \
++ sheap.o \
+ $(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ) \
+ $(W32_OBJ) $(WINDOW_SYSTEM_OBJ) $(XGSELOBJ)
+ obj = $(base_obj) $(NS_OBJC_OBJ)
+--- emacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86/src/gmalloc.c
++++ emacs/src/gmalloc.c
+@@ -72,7 +72,7 @@
+ #define free gfree
+ #endif /* HYBRID_MALLOC */
+
+-#ifdef CYGWIN
++//#ifdef CYGWIN
+ extern void *bss_sbrk (ptrdiff_t size);
+ extern int bss_sbrk_did_unexec;
+ extern char bss_sbrk_buffer[];
+@@ -80,7 +80,7 @@
+ #define DUMPED bss_sbrk_did_unexec
+ #define ALLOCATED_BEFORE_DUMPING(P) \
+ ((P) < bss_sbrk_buffer_end && (P) >= (void *) bss_sbrk_buffer)
+-#endif
++//#endif
+
+ #ifdef __cplusplus
+ extern "C"
+@@ -1525,16 +1525,19 @@
+ __default_morecore (ptrdiff_t increment)
+ {
+ void *result;
+-#if defined (CYGWIN)
++//#if defined (CYGWIN)
+ if (!DUMPED)
+ {
+ return bss_sbrk (increment);
+ }
+-#endif
++//#endif
++#if 0
+ result = (void *) __sbrk (increment);
+ if (result == (void *) -1)
+ return NULL;
+ return result;
++#endif
++ return NULL;
+ }
+ /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+
+--- emacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86/src/print.c
++++ emacs/src/print.c
+@@ -755,7 +755,7 @@
+ print_output_debug_flag = x;
+ }
+
+-#if defined (GNU_LINUX)
++#if defined (GNU_LINUX) && defined (__GLIBC__)
+
+ /* This functionality is not vitally important in general, so we rely on
+ non-portable ability to use stderr as lvalue. */
+--- emacs-4188e3cc2bc69e75d4387b369e72e89fecc46a86/src/unexelf.c
++++ emacs/src/unexelf.c
+@@ -632,6 +632,9 @@
+ off_t new_file_size;
+ void *new_break;
+
++ extern int bss_sbrk_did_unexec;
++ bss_sbrk_did_unexec = 1;
++
+ /* Pointers to the base of the image of the two files. */
+ caddr_t old_base, new_base;
+
+
diff --git a/app-editors/emacs-vcs/metadata.xml b/app-editors/emacs-vcs/metadata.xml
new file mode 100644
index 00000000..88ecff51
--- /dev/null
+++ b/app-editors/emacs-vcs/metadata.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>emacs</herd>
+<longdescription>
+ GNU Emacs is an extensible, customizable text editor - and more. At its core
+ is an interpreter for Emacs Lisp, a dialect of the Lisp programming language
+ with extensions to support text editing. The features of GNU Emacs include:
+ * Content-sensitive editing modes, including syntax coloring, for a variety
+ of file types including plain text, source code, and HTML.
+ * Complete built-in documentation, including a tutorial for new users.
+ * Full Unicode support for nearly all human languages and their scripts.
+ * Highly customizable, using Emacs Lisp code or a graphical interface.
+ * A large number of extensions that add other functionality, including a
+ project planner, mail and news reader, debugger interface, calendar, and
+ more. Many of these extensions are distributed with GNU Emacs; others are
+ available separately.
+</longdescription>
+<use>
+ <flag name='athena'>Enable the MIT Athena widget set
+ (<pkg>x11-libs/libXaw</pkg>)</flag>
+ <flag name='games'>Support shared score files for games</flag>
+ <flag name='gconf'>Use <pkg>gnome-base/gconf</pkg> to read the system
+ font name</flag>
+ <flag name='gfile'>Use gfile (<pkg>dev-libs/glib</pkg>) for file
+ notification</flag>
+ <flag name='gsettings'>Use gsettings (<pkg>dev-libs/glib</pkg>) to read the
+ system font name</flag>
+ <flag name='gtk3'>Link against version 3 of the GIMP Toolkit instead of
+ version 2 (<pkg>x11-libs/gtk+</pkg>)</flag>
+ <flag name='gzip-el'>Compress bundled Emacs Lisp source</flag>
+ <flag name='hesiod'>Enable support for <pkg>net-dns/hesiod</pkg></flag>
+ <flag name='imagemagick'>Use <pkg>media-gfx/imagemagick</pkg> for image
+ processing</flag>
+ <flag name='libxml2'>Use <pkg>dev-libs/libxml2</pkg> to parse XML instead
+ of the internal Lisp implementations</flag>
+ <flag name='pax_kernel'>Enable building under a PaX enabled kernel</flag>
+ <flag name='source'>Install C source files and make them available for
+ find-function</flag>
+ <flag name='toolkit-scroll-bars'>Use the selected toolkit's scrollbars in
+ preference to Emacs' own scrollbars</flag>
+ <flag name='wide-int'>Prefer wide Emacs integers (typically 62-bit).
+ This option has an effect only on architectures where "long" and
+ "long long" types have different size.</flag>
+</use>
+</pkgmetadata>
diff --git a/app-editors/emacs/Manifest b/app-editors/emacs/Manifest
new file mode 100644
index 00000000..1bf6570b
--- /dev/null
+++ b/app-editors/emacs/Manifest
@@ -0,0 +1,10 @@
+AUX emacs-24.3-alloc-invalid-frees.patch 1312 SHA256 f9d44c64663d546bfd1010230f8f7cdfdbce1d7320bf166d86045ff00ec6d498 SHA512 197c2146a2c6a820b8d01fa48e306c8ee083c2407d83589e0b18be8453e03438be1c64a010c06b9d68f2393ae4cccf86780ce8b17cd42335847f91f671ffaf2d WHIRLPOOL 2eb68ff289594b56117a26001b556c808336805771d62344183f9387aa459cb549e90476ae3f0216f0d42cdc1610b5de729d9cb8d19fb2cce679b39c196c7603
+AUX emacs-24.3-stderr.patch 277 SHA256 1fc337fac4e28cf20eed65f88cfcf94b46339408cceadc8a0d17bce969ae6d3a SHA512 370cb1d053530824050eec6b9f02f0eed0e91270940551712f7308ffd4657bba39513d9ab94d47306bbac1e507283a97326e6f366e47f64d093e794a25684b56 WHIRLPOOL 8ad5ab8c6cdaea01fcd784ef3993fbdd9c8e00d2f6aa12c70fc63a8da0e7e1513be45f74aa7b415c1b488cc73c9a1d2fc1f5c0283bfc0ad0a3417bd183bbb92d
+AUX emacs-24.4-configure.patch 334 SHA256 696710ea84e88a364bd89c9c66393b01b2b8782d2bd0fc08166e64b67b24b0fe SHA512 d75df3a772713e08b45759b58c92944a1719ce291069f111d296b15c7de86f7a9a89d023fa3ccd191390d8a79a671d0a60116f039cf6f57ebeeb7baa14f7af29 WHIRLPOOL 6420f6a5f8009096aa71f2e64d920dec6a1436bbb83c26c2a0d4180555b6e251ebfa92be801ddcf70bd840cb9afd56f99a84ad50be7361289baefe83e35ca52b
+AUX emacs-24.4-lisp.patch 421 SHA256 da45d30d4e305ba5220749d3ac884aaeac395bc896839a5e7a24fb112912cbff SHA512 7dda7632f7af4207c94bf2b4384d07bb13ef4562ade02393c668b35ff48d7b64d95a9c05d8700c2ba272abf69e8b9c38a690b10afa86b8857a2ba34cb344f3a3 WHIRLPOOL 28e3346a1b47f8421d56ec37005a806828f1f6995cd4dc213ac8a6011457a7d1d0524f8418a2801e176c5ea09cb5910cd6432a55c592d679f7752c3df23ca339
+AUX emacs-24.4-preload-hack.patch 343 SHA256 289febdc960bee609514fe5291fb3d60cc9b505345853370aa94b9bd9ccb5fd2 SHA512 ee765cc9f3a84b48c00a0c8a36934af6da737fa6b9f9d993e0e5e1c8b9f05cf7b1f96c260daba10e4b4df149abcf8ea125cf8d6ebbe5e2c0d508007e381ecd6b WHIRLPOOL f5c1c6313392325949edc955d9f1b3dc74395ff18cd214f5bef6f8f77ce1975233c870101a03d5218da007a61f3107474ef461d129313b00b07da762970b749a
+AUX preload.c 1868 SHA256 3498abf641e809c06bf6a265d54880e93ee31f7abf81210856b6dbef7d267129 SHA512 6268255b7afa8455ad7ce63ef6f01a7d114b53fbb3dc557b187de0ee6514b33b3419d70b8d7984dc289f5eed075a30b508133147821f77c4345df5cbd62e616e WHIRLPOOL 0c72d97de94cf5e1cf6a8ee4f8f42800d63f35465ea22f8c409857620ecc37e304ff6c2c4670659a063e5f275488fcdd1b45226d9d0130c4506480df7708bff6
+DIST emacs-24.4-patches-3.tar.xz 3780 SHA256 2dd1ba1e9cca9121731d14da30ecf3eb720c07e9644a7b9d75e3f02ebc2089d7 SHA512 dde60b26a7dffca1f80937af406ec8a7b4dd8c2563f57c290629acc4767ef38075fcc42ca62c5f172c972fc3cb6c2c0539d3db641386edc68a842bc6cf81237c WHIRLPOOL 3da7034ac9ce495f57ad5bd82f6f8a4d8a4baddd4126b6753423f5cf58aa01873838e22b2908b8c2e4cd48590dd7fb7ea3a520e1bf43be7d0eaf02583bdc9f6f
+DIST emacs-24.4.tar.xz 39733124 SHA256 47e391170db4ca0a3c724530c7050655f6d573a711956b4cd84693c194a9d4fd SHA512 f51f88a4736a3f153ef01f3ad710571e967cd3d0c0112b066169a4040725d370ec29b14a4ca8fa3e3f4c657c726ba8e64c3ac4e390b8e911ea47a3afb5ac755c WHIRLPOOL eae38c2382731fecf0ccf8f717f8c96cc130d01a893ff560caecde903294eb843660492761ea8cce9920b79bfc55e821921924e27c040f25355110f56cd2255b
+EBUILD emacs-24.4-r99.ebuild 10876 SHA256 e18a2aef4781db69b22df4d9963634a45c168ee438553a873e6dc329b44eb96b SHA512 a15fcc4c4d5e47ed5816643b16edac238ee38632c516b80015add0a0f00c446846c17ff65967c59a2ce70411f4c60d2815efd561b172afe0b5e2c7267c534d18 WHIRLPOOL 8d84d3eb30eeae27e2bcb455b6073ec90ea22299d1737d47bd2ebaf722ca82f647f2bd0ea7bbeccafb2784b09dd244c1cb5b3c6ed53d0e09472deb28bd223369
+MISC metadata.xml 2489 SHA256 21b3602d37aa25bca31b05ea810b37ee2192f4e53b8f8daeb814d9dca59d03d7 SHA512 4f3d663cd61253ae3390c55c5974dd3cc22dbf1306a823c3cb71794d09eaf28d7727c7e24f66f02dbd8d3845894f3a8cafa5ddaf330c1bbb7f99d8130ece077c WHIRLPOOL bcefdded503fa9cebea943952d3f56847002cb5ddc10f5adbd774301b648d1b12a09da7e493694f9cbbb19e8b53b66132cbd2e0141ded41b226415cfdbbcf8f6
diff --git a/app-editors/emacs/emacs-24.4-r99.ebuild b/app-editors/emacs/emacs-24.4-r99.ebuild
new file mode 100644
index 00000000..472fb434
--- /dev/null
+++ b/app-editors/emacs/emacs-24.4-r99.ebuild
@@ -0,0 +1,348 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-editors/emacs/emacs-24.4-r2.ebuild,v 1.1 2015/01/23 20:38:44 ulm Exp $
+
+EAPI=5
+
+inherit elisp-common eutils flag-o-matic multilib readme.gentoo
+
+DESCRIPTION="The extensible, customizable, self-documenting real-time display editor"
+HOMEPAGE="http://www.gnu.org/software/emacs/"
+SRC_URI="mirror://gnu/emacs/${P}.tar.xz
+ http://dev.gentoo.org/~ulm/emacs/${P}-patches-3.tar.xz"
+
+LICENSE="GPL-3+ FDL-1.3+ BSD HPND MIT W3C unicode PSF-2"
+SLOT="24"
+KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
+IUSE="acl alsa aqua athena dbus games gconf gfile gif gnutls gpm gsettings gtk +gtk3 gzip-el hesiod imagemagick +inotify jpeg kerberos libxml2 livecd m17n-lib motif pax_kernel png selinux sound source svg tiff toolkit-scroll-bars wide-int X Xaw3d xft +xpm zlib"
+REQUIRED_USE="?? ( aqua X )"
+
+RDEPEND="sys-libs/ncurses
+ >=app-eselect/eselect-emacs-1.16
+ >=app-emacs/emacs-common-gentoo-1.4-r1[games?,X?]
+ net-libs/liblockfile
+ acl? ( virtual/acl )
+ alsa? ( media-libs/alsa-lib )
+ dbus? ( sys-apps/dbus )
+ gfile? ( >=dev-libs/glib-2.28.6 )
+ gnutls? ( net-libs/gnutls )
+ gpm? ( sys-libs/gpm )
+ hesiod? ( net-dns/hesiod )
+ kerberos? ( virtual/krb5 )
+ libxml2? ( >=dev-libs/libxml2-2.2.0 )
+ selinux? ( sys-libs/libselinux )
+ zlib? ( sys-libs/zlib )
+ X? (
+ x11-libs/libXmu
+ x11-libs/libXt
+ x11-misc/xbitmaps
+ gconf? ( >=gnome-base/gconf-2.26.2 )
+ gsettings? ( >=dev-libs/glib-2.28.6 )
+ gif? ( media-libs/giflib )
+ jpeg? ( virtual/jpeg:0= )
+ png? ( >=media-libs/libpng-1.4:0= )
+ svg? ( >=gnome-base/librsvg-2.0 )
+ tiff? ( media-libs/tiff )
+ xpm? ( x11-libs/libXpm )
+ imagemagick? ( >=media-gfx/imagemagick-6.6.2 )
+ xft? (
+ media-libs/fontconfig
+ media-libs/freetype
+ x11-libs/libXft
+ m17n-lib? (
+ >=dev-libs/libotf-0.9.4
+ >=dev-libs/m17n-lib-1.5.1
+ )
+ )
+ gtk? (
+ gtk3? ( x11-libs/gtk+:3 )
+ !gtk3? ( x11-libs/gtk+:2 )
+ )
+ !gtk? (
+ motif? ( >=x11-libs/motif-2.3:0 )
+ !motif? (
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( athena? ( x11-libs/libXaw ) )
+ )
+ )
+ )"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ gzip-el? ( app-arch/gzip )
+ pax_kernel? (
+ sys-apps/attr
+ sys-apps/paxctl
+ )"
+
+RDEPEND="${RDEPEND}
+ !<app-editors/emacs-vcs-${PV}"
+
+EMACS_SUFFIX="${PN/emacs/emacs-${SLOT}}"
+SITEFILE="20${PN}-${SLOT}-gentoo.el"
+# FULL_VERSION keeps the full version number, which is needed in
+# order to determine some path information correctly for copy/move
+# operations later on
+FULL_VERSION="${PV%%_*}"
+S="${WORKDIR}/emacs-${FULL_VERSION}"
+
+src_prepare() {
+ EPATCH_SUFFIX=patch epatch
+
+ epatch "${FILESDIR}/${PN}-24.3-stderr.patch"
+ epatch "${FILESDIR}/${PN}-24.3-alloc-invalid-frees.patch"
+ epatch "${FILESDIR}/${PN}-24.4-configure.patch"
+ epatch "${FILESDIR}/${PN}-24.4-preload-hack.patch"
+ epatch "${FILESDIR}/${PN}-24.4-lisp.patch"
+
+ epatch_user
+
+ # Fix filename reference in redirected man page
+ sed -i -e "/^\\.so/s/etags/&-${EMACS_SUFFIX}/" doc/man/ctags.1 \
+ || die "unable to sed ctags.1"
+
+ #AT_M4DIR=m4 eautoreconf
+}
+
+src_configure() {
+ strip-flags
+ filter-flags -pie #526948
+
+ if use sh; then
+ replace-flags "-O[1-9]" -O0 #262359
+ elif use ia64; then
+ replace-flags "-O[2-9]" -O1 #325373
+ else
+ replace-flags "-O[3-9]" -O2
+ fi
+
+ local myconf
+
+ if use alsa; then
+ use sound || ewarn \
+ "USE flag \"alsa\" overrides \"-sound\"; enabling sound support."
+ myconf+=" --with-sound=alsa"
+ else
+ myconf+=" --with-sound=$(usex sound oss)"
+ fi
+
+ if use X; then
+ myconf+=" --with-x --without-ns"
+ myconf+=" $(use_with gconf)"
+ myconf+=" $(use_with gsettings)"
+ myconf+=" $(use_with toolkit-scroll-bars)"
+ myconf+=" $(use_with gif)"
+ myconf+=" $(use_with jpeg)"
+ myconf+=" $(use_with png)"
+ myconf+=" $(use_with svg rsvg)"
+ myconf+=" $(use_with tiff)"
+ myconf+=" $(use_with xpm)"
+ myconf+=" $(use_with imagemagick)"
+
+ if use xft; then
+ myconf+=" --with-xft"
+ myconf+=" $(use_with m17n-lib libotf)"
+ myconf+=" $(use_with m17n-lib m17n-flt)"
+ else
+ myconf+=" --without-xft"
+ myconf+=" --without-libotf --without-m17n-flt"
+ use m17n-lib && ewarn \
+ "USE flag \"m17n-lib\" has no effect if \"xft\" is not set."
+ fi
+
+ local f
+ if use gtk; then
+ einfo "Configuring to build with GIMP Toolkit (GTK+)"
+ myconf+=" --with-x-toolkit=$(usex gtk3 gtk3 gtk2)"
+ for f in motif Xaw3d athena; do
+ use ${f} && ewarn \
+ "USE flag \"${f}\" has no effect if \"gtk\" is set."
+ done
+ elif use motif; then
+ einfo "Configuring to build with Motif toolkit"
+ myconf+=" --with-x-toolkit=motif"
+ for f in Xaw3d athena; do
+ use ${f} && ewarn \
+ "USE flag \"${f}\" has no effect if \"motif\" is set."
+ done
+ elif use athena || use Xaw3d; then
+ einfo "Configuring to build with Athena/Lucid toolkit"
+ myconf+=" --with-x-toolkit=lucid $(use_with Xaw3d xaw3d)"
+ else
+ einfo "Configuring to build with no toolkit"
+ myconf+=" --with-x-toolkit=no"
+ fi
+ elif use aqua; then
+ einfo "Configuring to build with Nextstep (Cocoa) support"
+ myconf+=" --with-ns --disable-ns-self-contained"
+ myconf+=" --without-x"
+ else
+ myconf+=" --without-x --without-ns"
+ fi
+
+ # Save version information in the Emacs binary. It will be available
+ # in variable "system-configuration-options".
+ myconf+=" GENTOO_PACKAGE=${CATEGORY}/${PF}"
+
+ econf \
+ --program-suffix="-${EMACS_SUFFIX}" \
+ --infodir="${EPREFIX}"/usr/share/info/${EMACS_SUFFIX} \
+ --localstatedir="${EPREFIX}"/var \
+ --enable-locallisppath="${EPREFIX}/etc/emacs:${EPREFIX}${SITELISP}" \
+ --with-gameuser="${GAMES_USER_DED:-games}" \
+ --without-compress-install \
+ --with-file-notification=$(usev gfile || usev inotify || echo no) \
+ $(use_enable acl) \
+ $(use_with dbus) \
+ $(use_with gnutls) \
+ $(use_with gpm) \
+ $(use_with hesiod) \
+ $(use_with kerberos) $(use_with kerberos kerberos5) \
+ $(use_with libxml2 xml2) \
+ $(use_with selinux) \
+ $(use_with wide-int) \
+ $(use_with zlib) \
+ ${myconf}
+}
+
+src_compile() {
+ echo $S
+ $(tc-getCC) -shared -fPIC -o preload.so "${FILESDIR}/preload.c" || die
+
+ export SANDBOX_ON=0 # for the unbelievers, see Bug #131505
+ emake
+}
+
+src_install () {
+ emake DESTDIR="${D}" NO_BIN_LINK=t install
+
+ mv "${ED}"/usr/bin/{emacs-${FULL_VERSION}-,}${EMACS_SUFFIX} \
+ || die "moving emacs executable failed"
+ mv "${ED}"/usr/share/man/man1/{emacs-,}${EMACS_SUFFIX}.1 \
+ || die "moving emacs man page failed"
+
+ # move info dir to avoid collisions with the dir file generated by portage
+ mv "${ED}"/usr/share/info/${EMACS_SUFFIX}/dir{,.orig} \
+ || die "moving info dir failed"
+ touch "${ED}"/usr/share/info/${EMACS_SUFFIX}/.keepinfodir
+ docompress -x /usr/share/info/${EMACS_SUFFIX}/dir.orig
+
+ # avoid collision between slots, see bug #169033 e.g.
+ rm "${ED}"/usr/share/emacs/site-lisp/subdirs.el
+ rm -rf "${ED}"/usr/share/{applications,icons}
+ rm -rf "${ED}"/var
+
+ # remove unused <version>/site-lisp dir
+ rm -rf "${ED}"/usr/share/emacs/${FULL_VERSION}/site-lisp
+
+ # remove COPYING file (except for etc/COPYING used by describe-copying)
+ rm "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp/COPYING
+
+ if use gzip-el; then
+ # compress .el files when a corresponding .elc exists
+ find "${ED}"/usr/share/emacs/${FULL_VERSION}/lisp -type f \
+ -name "*.elc" -print | sed 's/\.elc$/.el/' | xargs gzip -9n
+ assert "gzip .el failed"
+ fi
+
+ local cdir
+ if use source; then
+ cdir="/usr/share/emacs/${FULL_VERSION}/src"
+ insinto "${cdir}"
+ # This is not meant to install all the source -- just the
+ # C source you might find via find-function
+ doins src/*.{c,h,m}
+ elif has installsources ${FEATURES}; then
+ cdir="/usr/src/debug/${CATEGORY}/${PF}/${S#"${WORKDIR}/"}/src"
+ fi
+
+ sed -e "${cdir:+#}/^Y/d" -e "s/^[XY]//" >"${T}/${SITEFILE}" <<-EOF
+ X
+ ;;; ${PN}-${SLOT} site-lisp configuration
+ X
+ (when (string-match "\\\\\`${FULL_VERSION//./\\\\.}\\\\>" emacs-version)
+ Y (setq find-function-C-source-directory
+ Y "${EPREFIX}${cdir}")
+ X (let ((path (getenv "INFOPATH"))
+ X (dir "${EPREFIX}/usr/share/info/${EMACS_SUFFIX}")
+ X (re "\\\\\`${EPREFIX}/usr/share/info\\\\>"))
+ X (and path
+ X ;; move Emacs Info dir before anything else in /usr/share/info
+ X (let* ((p (cons nil (split-string path ":" t))) (q p))
+ X (while (and (cdr q) (not (string-match re (cadr q))))
+ X (setq q (cdr q)))
+ X (setcdr q (cons dir (delete dir (cdr q))))
+ X (setq Info-directory-list (prune-directory-list (cdr p)))))))
+ EOF
+ elisp-site-file-install "${T}/${SITEFILE}" || die
+
+ dodoc README BUGS
+
+ if use aqua; then
+ dodir /Applications/Gentoo
+ rm -rf "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app
+ mv nextstep/Emacs.app \
+ "${ED}"/Applications/Gentoo/Emacs${EMACS_SUFFIX#emacs}.app || die
+ fi
+
+ DOC_CONTENTS="You can set the version to be started by /usr/bin/emacs
+ through the Emacs eselect module, which also redirects man and info
+ pages. Therefore, several Emacs versions can be installed at the
+ same time. \"man emacs.eselect\" for details.
+ \\n\\nIf you upgrade from Emacs version 24.2 or earlier, then it is
+ strongly recommended that you use app-admin/emacs-updater to rebuild
+ all byte-compiled elisp files of the installed Emacs packages."
+ use X && DOC_CONTENTS+="\\n\\nYou need to install some fonts for Emacs.
+ Installing media-fonts/font-adobe-{75,100}dpi on the X server's
+ machine would satisfy basic Emacs requirements under X11.
+ See also https://wiki.gentoo.org/wiki/Xft_support_for_GNU_Emacs
+ for how to enable anti-aliased fonts."
+ use aqua && DOC_CONTENTS+="\\n\\nEmacs${EMACS_SUFFIX#emacs}.app is in
+ \"${EPREFIX}/Applications/Gentoo\". You may want to copy or symlink
+ it into /Applications by yourself."
+ readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+ # move Info dir file to correct name
+ local infodir=/usr/share/info/${EMACS_SUFFIX} f
+ if [[ -f ${ED}${infodir}/dir.orig ]]; then
+ mv "${ED}"${infodir}/dir{.orig,} || die "moving info dir failed"
+ elif [[ -d "${ED}"${infodir} ]]; then
+ # this should not happen in EAPI 4
+ ewarn "Regenerating Info directory index in ${infodir} ..."
+ rm -f "${ED}"${infodir}/dir{,.*}
+ for f in "${ED}"${infodir}/*; do
+ if [[ ${f##*/} != *-[0-9]* && -e ${f} ]]; then
+ install-info --info-dir="${ED}"${infodir} "${f}" \
+ || die "install-info failed"
+ fi
+ done
+ fi
+}
+
+pkg_postinst() {
+ elisp-site-regen
+
+ local pvr
+ for pvr in ${REPLACING_VERSIONS}; do
+ [[ ${pvr%%[-_]*} = 24.[12] ]] && FORCE_PRINT_ELOG=1
+ done
+ readme.gentoo_print_elog
+
+ if use livecd; then
+ # force an update of the emacs symlink for the livecd/dvd,
+ # because some microemacs packages set it with USE=livecd
+ eselect emacs update
+ elif [[ $(readlink "${EROOT}"/usr/bin/emacs) = ${EMACS_SUFFIX} ]]; then
+ # refresh symlinks in case any installed files have changed
+ eselect emacs set ${EMACS_SUFFIX}
+ else
+ eselect emacs update ifunset
+ fi
+}
+
+pkg_postrm() {
+ elisp-site-regen
+ eselect emacs update ifunset
+}
diff --git a/app-editors/emacs/files/emacs-24.3-alloc-invalid-frees.patch b/app-editors/emacs/files/emacs-24.3-alloc-invalid-frees.patch
new file mode 100644
index 00000000..1638e5fc
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.3-alloc-invalid-frees.patch
@@ -0,0 +1,58 @@
+From http://www.openwall.com/lists/musl/2015/02/03/1
+
+--- emacs-24.3.orig/src/alloc.c
++++ emacs-24.3/src/alloc.c
+@@ -47,6 +47,13 @@
+
+ #include <verify.h>
+
++static void *initial_brk;
++__attribute__((__constructor__))
++static void init()
++{
++ initial_brk = sbrk(0);
++}
++
+ /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
+ Doable only if GC_MARK_STACK. */
+ #if ! GC_MARK_STACK
+@@ -699,6 +706,14 @@
+ {
+ void *val;
+
++ if (block && block < initial_brk) {
++ size_t len = (char *)initial_brk - (char *)block;
++ if (len > size) len = size;
++ void *p = xmalloc(size);
++ memcpy(p, block, len);
++ return p;
++ }
++
+ MALLOC_BLOCK_INPUT;
+ /* We must call malloc explicitly when BLOCK is 0, since some
+ reallocs don't do this. */
+@@ -720,6 +735,7 @@
+ void
+ xfree (void *block)
+ {
++ if (block < initial_brk) return;
+ if (!block)
+ return;
+ MALLOC_BLOCK_INPUT;
+@@ -910,6 +926,7 @@
+ static void
+ lisp_free (void *block)
+ {
++ if (block < initial_brk) return;
+ MALLOC_BLOCK_INPUT;
+ free (block);
+ #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
+@@ -1117,6 +1134,8 @@
+ {
+ struct ablock *ablock = block;
+ struct ablocks *abase = ABLOCK_ABASE (ablock);
++
++ if (block < initial_brk) return;
+
+ MALLOC_BLOCK_INPUT;
+ #if GC_MARK_STACK && !defined GC_MALLOC_CHECK
diff --git a/app-editors/emacs/files/emacs-24.3-stderr.patch b/app-editors/emacs/files/emacs-24.3-stderr.patch
new file mode 100644
index 00000000..a3beb9fc
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.3-stderr.patch
@@ -0,0 +1,11 @@
+--- a/emacs-24.3/src/print.c
++++ b/emacs-24.3/src/print.c
+@@ -733,7 +733,7 @@
+ print_output_debug_flag = x;
+ }
+
+-#if defined (GNU_LINUX)
++#if 0
+
+ /* This functionality is not vitally important in general, so we rely on
+ non-portable ability to use stderr as lvalue. */
diff --git a/app-editors/emacs/files/emacs-24.4-configure.patch b/app-editors/emacs/files/emacs-24.4-configure.patch
new file mode 100644
index 00000000..8c630091
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.4-configure.patch
@@ -0,0 +1,10 @@
+--- a/configure.ac 2015-02-03 20:27:53.649248696 -0100
++++ b/configure.ac 2015-02-03 20:29:40.708910266 -0100
+@@ -2004,6 +2004,7 @@
+ ## darwin ld insists on the use of malloc routines in the System framework.
+ darwin|sol2-10) system_malloc=yes ;;
+ esac
++system_malloc=yes
+
+ GMALLOC_OBJ=
+ if test "${system_malloc}" = "yes"; then
diff --git a/app-editors/emacs/files/emacs-24.4-lisp.patch b/app-editors/emacs/files/emacs-24.4-lisp.patch
new file mode 100644
index 00000000..bc8a3f7f
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.4-lisp.patch
@@ -0,0 +1,10 @@
+--- a/src/lisp.h 2015-02-03 20:42:39.233177373 -0100
++++ b/src/lisp.h 2015-02-03 20:44:01.780145394 -0100
+@@ -270,6 +270,7 @@
+ This can be used in #if, e.g., '#if VAL_MAX < UINTPTR_MAX' below. */
+ #define VAL_MAX (EMACS_INT_MAX >> (GCTYPEBITS - 1))
+
++#define USE_LSB_TAG 1
+ /* Unless otherwise specified, use USE_LSB_TAG on systems where: */
+ #ifndef USE_LSB_TAG
+ /* 1. We know malloc returns a multiple of 8. */
diff --git a/app-editors/emacs/files/emacs-24.4-preload-hack.patch b/app-editors/emacs/files/emacs-24.4-preload-hack.patch
new file mode 100644
index 00000000..8bed0bd1
--- /dev/null
+++ b/app-editors/emacs/files/emacs-24.4-preload-hack.patch
@@ -0,0 +1,11 @@
+--- a/src/Makefile.in 2014-05-26 16:50:55.000000000 -0100
++++ b/src/Makefile.in 2015-02-03 20:25:11.915270649 -0100
+@@ -292,7 +292,7 @@
+
+ GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
+
+-RUN_TEMACS = ./temacs
++RUN_TEMACS = LD_PRELOAD=../preload.so ./temacs
+
+ ## Invoke ../nt/addsection for MinGW, ":" elsewhere.
+ TEMACS_POST_LINK = @TEMACS_POST_LINK@
diff --git a/app-editors/emacs/files/preload.c b/app-editors/emacs/files/preload.c
new file mode 100644
index 00000000..65cdceff
--- /dev/null
+++ b/app-editors/emacs/files/preload.c
@@ -0,0 +1,88 @@
+// http://www.openwall.com/lists/musl/2015/02/03/1
+#include <pthread.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlfcn.h>
+#include <unistd.h>
+#include <stdio.h>
+
+static void *(*real_malloc)(size_t);
+static void *initial_brk;
+
+static pthread_once_t once_control[1];
+static void once_func()
+{
+ real_malloc = dlsym(RTLD_NEXT, "malloc");
+ initial_brk = sbrk(0);
+}
+
+static int cmp(const void *a, const void *b)
+{
+ void *aa = *(void **)a, *bb = *(void **)b;
+ return aa < bb ? -1 : aa > bb ? 1 : 0;
+}
+
+void *malloc(size_t n)
+{
+ size_t i, j, k;
+ pthread_once(once_control, once_func);
+ if (n < 100000 || n > (size_t)-1/2) {
+ void *p;
+ do p = real_malloc(n);
+ while (p > sbrk(0) || (p && p < initial_brk));
+ return p;
+ }
+ size_t cnt = n/16384;
+ void **list = real_malloc(sizeof *list * cnt);
+ if (!list) return 0;
+ for (i=0; i<cnt; i++) list[i] = 0;
+ for (i=0; i<cnt; i++) {
+ list[i] = real_malloc(65536 - 2*sizeof(size_t));
+ if (!list[i]) goto fail;
+ if (i<cnt/4) continue;
+ size_t base = 0;
+ qsort(list, i+1, sizeof(void *), cmp);
+ for (j=0; j<i; j++) {
+ char *p = list[base];
+ char *s = list[j];
+ char *z = list[j+1];
+ if (z-s > 65536) {
+ base = j+1;
+ continue;
+ }
+ if (z-p < n+64) {
+ continue;
+ }
+ for (k=0; k<base; k++) free(list[k]);
+ *(size_t *)(p-sizeof(size_t)) = z-p | 1;
+ *(size_t *)(z-2*sizeof(size_t)) = z-p | 1;
+ for (k=j+1; k<i+1; k++) free(list[k]);
+ free(list);
+ return p;
+ }
+ }
+fail:
+ for (i=0; i<cnt; i++) free(list[i]);
+ free(list);
+ return 0;
+}
+
+void *calloc(size_t n, size_t m)
+{
+ if ((size_t)-1/n <= m) n *= m;
+ else n = (size_t)-1;
+ void *p = malloc(n);
+ if (p) memset(p, 0, n);
+ return p;
+}
+
+void *realloc(void *p, size_t n)
+{
+ void *q = malloc(n);
+ if (!q) return 0;
+ size_t l = *(size_t *)((char *)p - sizeof(size_t)) & -8;
+ memcpy(q, p, l<n ? l : n);
+ free(p);
+ return q;
+}
diff --git a/app-editors/emacs/metadata.xml b/app-editors/emacs/metadata.xml
new file mode 100644
index 00000000..88ecff51
--- /dev/null
+++ b/app-editors/emacs/metadata.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>emacs</herd>
+<longdescription>
+ GNU Emacs is an extensible, customizable text editor - and more. At its core
+ is an interpreter for Emacs Lisp, a dialect of the Lisp programming language
+ with extensions to support text editing. The features of GNU Emacs include:
+ * Content-sensitive editing modes, including syntax coloring, for a variety
+ of file types including plain text, source code, and HTML.
+ * Complete built-in documentation, including a tutorial for new users.
+ * Full Unicode support for nearly all human languages and their scripts.
+ * Highly customizable, using Emacs Lisp code or a graphical interface.
+ * A large number of extensions that add other functionality, including a
+ project planner, mail and news reader, debugger interface, calendar, and
+ more. Many of these extensions are distributed with GNU Emacs; others are
+ available separately.
+</longdescription>
+<use>
+ <flag name='athena'>Enable the MIT Athena widget set
+ (<pkg>x11-libs/libXaw</pkg>)</flag>
+ <flag name='games'>Support shared score files for games</flag>
+ <flag name='gconf'>Use <pkg>gnome-base/gconf</pkg> to read the system
+ font name</flag>
+ <flag name='gfile'>Use gfile (<pkg>dev-libs/glib</pkg>) for file
+ notification</flag>
+ <flag name='gsettings'>Use gsettings (<pkg>dev-libs/glib</pkg>) to read the
+ system font name</flag>
+ <flag name='gtk3'>Link against version 3 of the GIMP Toolkit instead of
+ version 2 (<pkg>x11-libs/gtk+</pkg>)</flag>
+ <flag name='gzip-el'>Compress bundled Emacs Lisp source</flag>
+ <flag name='hesiod'>Enable support for <pkg>net-dns/hesiod</pkg></flag>
+ <flag name='imagemagick'>Use <pkg>media-gfx/imagemagick</pkg> for image
+ processing</flag>
+ <flag name='libxml2'>Use <pkg>dev-libs/libxml2</pkg> to parse XML instead
+ of the internal Lisp implementations</flag>
+ <flag name='pax_kernel'>Enable building under a PaX enabled kernel</flag>
+ <flag name='source'>Install C source files and make them available for
+ find-function</flag>
+ <flag name='toolkit-scroll-bars'>Use the selected toolkit's scrollbars in
+ preference to Emacs' own scrollbars</flag>
+ <flag name='wide-int'>Prefer wide Emacs integers (typically 62-bit).
+ This option has an effect only on architectures where "long" and
+ "long long" types have different size.</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest
new file mode 100644
index 00000000..c77f5c35
--- /dev/null
+++ b/app-emulation/qemu/Manifest
@@ -0,0 +1,24 @@
+AUX 65-kvm.rules 40 SHA256 c16a8dc7855880b2651f1a3ff488ecc54d4ac1036c71fffd5007021d8d18a7c5 SHA512 98aad2a2f212a7ac0ee5b60a9c92744fa462bce5f26594845c7a31d692aaaca2d52cb57bdbede7dfc60b9862c2a6510665dbb03215d5cf76e62516a283decdd6 WHIRLPOOL 937de93a23930f6b8533f0c3e0dd249c99ddf7d54446dea857607266ac0a4b435c5b4a52b2986b138bace9c0a7ade66f94116b38e2bc4767ead54bd11baf0920
+AUX bridge.conf 454 SHA256 a51850dd39923f3482e4c575b48ad9fef9c9ebb2f2176225da399b79ce48c69d SHA512 a907ee86b81a1b61033bb7621ded65112504131ef7b698c53e4014b958ee6fc79e66f63069015a01e41362cb70a7d0ed26dd9a03033cf776f4846f0e1f8f1533 WHIRLPOOL 8fcbd4abf9b8f7ca3d16fe0eaf17196ebf708dfecf85ce0f020e0de22b64905114f7b310f361826c81bb961c6b1bbbf984bff1e595bb949993b8966ccb222c35
+AUX qemu-1.5.3-openpty.patch 256 SHA256 885ff6391fc7a106b41f7d29ff103c083ecc34580ddd68918c0398bacff43aad SHA512 e5e1900d015880977fcad370b79d5030c782edf2a5794d082796714f95b431447e7d38558ffdfae5af5f7d5d5d6dc2ba3af27e0cee644a72b62651a4570009e4 WHIRLPOOL 894593cd57a96a619b53574e5e86ba72b62659e525cb615522e7ee9ff856454b7d0aee5f9c8cf08641efa5245aba3577808ec8858f4ea73f30483313eb315204
+AUX qemu-1.7.0-cflags.patch 300 SHA256 8f35e55c4bae93e82f9580eabe2d6a2d4660bd05343e1f4e6c33815deeede91e SHA512 54446cb555b623b2306f8a323713e4dfb1b8b7bbf3af3771d5b62e164e0672cc21cbe44f08ca8b58052523e8d629e16355a44ebb544a999a44d11ac3af671f1c WHIRLPOOL b903b4abefeeb09a2ab2d1ee224de5d3694f99f50aacfe33882fce0c1c87c23dae4d57b001d1c35cc96fffa93d43fac4a8ab30a3e45fe1f380580162c0332e78
+AUX qemu-1.7.0-ffsll.patch 560 SHA256 d211b937e4c50d50c680cf7e4450079a3b3924857849d7a99da4e3adac708aa8 SHA512 00594c276865ae9d3c1b748ebcf3e5d88b8a4b10e1700b215f22de5dbd6ba06bb9ad9b461bc93ba3b8794418d4197d3af45ef5eb46b9c1829afa9ca0b1eacf13 WHIRLPOOL 475307753a39fab1bf2e82602068f9992978cf74f9c3374369d1c0329592248b31830135d07d1386d8a66a7bf539a33551ac9de04478e5a2efe4d8385689e61d
+AUX qemu-1.7.0-sigset_t.patch 403 SHA256 081866f22ed90e9e4bfb91fed7b213d923d369dcfdec229fcc8120074d9ba18a SHA512 65106e0d6f3e0b8bd8623d54d9f8795d422dcae90f682025e0b71aa56e0668c24babbbebddebb0f88227e97447c50b840bcea234d264c58a438e04ea3cfa3095 WHIRLPOOL 32a6c3dc3a967dc0882914b5cf7e10cba3be7925ae0a8ed0e85690d5c12e055544240e44efaf9ab9ce3de6620f12127331d3dd46c6ea03a4bb4d56e17d68e9db
+AUX qemu-2.0.0-F_SHLCK-and-F_EXLCK.patch 563 SHA256 99de67d610ad13a1dcf6c67a3c2b5b87fb909220173a956435737f9bea3c371b SHA512 a29e9a889388a6627ed492a79e66514ffb5e64f9479646982091811548fc2a9bf6682104a6c774d83e645e4b1db39e491afd4efce789fe164623442a7f3e5d00 WHIRLPOOL d3aab06099de263c22f4c71810a3b2cb8602d17731ec76674cd1415e539306555a7b96b789f0daad473600dfa04a83224ff603f7b9a9ac63a4902f74d0e9deb5
+AUX qemu-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch 930 SHA256 6af6cf9044997710a6d0fbdba30a35c8d775e30d30c032ec97db672f75ec88ac SHA512 ec84b27648c01c6e58781295dcd0c2ff8e5a635f9836ef50c1da5d0ed125db1afc4cb5b01cb97606d6dd8f417acba93e1560d9a32ca29161a4bb730b302440ea WHIRLPOOL 06b9dd5251ac03405c97b1f5a623b4d86bda2f72fbcd52b90ae4d11a0cfb59cae62df2cb6189405fbe53ab05ff2b7ca8165fda239dbfe5f31ed70abb53b3b9f3
+AUX qemu-2.1.0-CVE-2014-5388.patch 1093 SHA256 df7c11ffb519f9a4c0db177359c5fe9772d5463fbd61d29905b8177e598d6887 SHA512 1f0c4b5b306f85a9a796b906cdd79106ea87a07217aee5b84ac45db0235440b55484591eeb4d0c05fbae6011879ac957304e82cb8a7b58ee77c550e32602367f WHIRLPOOL 33a09191ba765f72764ce5396e9a14c8f900efaf7e1707d535cadca38c46bf0dde0e99f6e8f0f37bd58ae512049edf78977976678088a1dc4d26f544e90cfc29
+AUX qemu-2.1.1-readlink-self.patch 2933 SHA256 3133ec1a0f0126d3362c9420602a1fdfc76fafacac8b41f5bd755e7542ee4188 SHA512 7ee06e119007e6dc08f254cbfdcc6de1c914181f60e69434190fe507a80b7d0f9e8682f0213d447481f39e145fcb0be2e118516238addb5c4326533fc0db143f WHIRLPOOL 54edcb4510546c69dedf78a2070f22e7ef2809b35a66dc2e5d356f2f1b22eea8baa5b17ed4a4d9860ee6b864fac92eb9d1bbb6daeb6e2d80e3cc702f32039996
+AUX qemu-2.1.2-vnc-sanitize-bits.patch 1279 SHA256 ef1e748fd9ffa0eb8ef412e6ea3cc96522e0ca91cf7201e6702d260ca50cbac5 SHA512 7e1a744928eb8edb76b18e58cf94da38ad1030f49ceb38f5e081d852573f8f314f998639c8e97fee27a53f51abe495b27406daa02b670a620ab2db165a47429e WHIRLPOOL bc024286739b56038bfebd6c2ad71addd9565a833f21a7a48cadbe7403c3e93c889cb2223d044448634cc93b6dc45a268299ea1b5b18c09b3477bb6e12fb0506
+AUX qemu-2.2.0-_sigev_un.patch 636 SHA256 f3b9a4d6162c553f3110ad22716305818e2130e2ff5d628faf044fc58a5e3cb5 SHA512 f72b879daede5184904f64cabb276de96299a37a93fce444d09e9068671009e95a5e5d6b815ec41a5db5b3807de14d470a56bba5806ffd4dfec577577b046ccb WHIRLPOOL 9453ad4966e10d504f3e867fd984642a3c1ee3ae847b5ca56196fd1f9e6c0f2d7b52ca07446212af72fef6d0ded1527a5eb306fa6cd915e8dd9ce11523362bac
+AUX qemu-2.2.1-CVE-2015-1779-1.patch 8631 SHA256 17ea04bb0571f3a346eb25ce2d61fd7053515767adedfde567fd39205993c600 SHA512 191dde0754b9466d87cf99a578ac07f0902f373156f4d5ff98540b9099a6fa8e29ba4ca9d4a5a21ae5dbba2b80c36600ea0bd2c31fa0c8734926514015166ab8 WHIRLPOOL 2be2f490eb32857b2b218761df3580bc31eb5a89bf1b289a048e9fd489cdb024869399481345b5ecb09a45c4fbf1ee4639062ae1fdbee9781e66ca6cc8af4cac
+AUX qemu-2.2.1-CVE-2015-1779-2.patch 2318 SHA256 4c0966520bf09df25d99c883f94037e765406dd4097dd704e66361bb07f73679 SHA512 7a85bc8e00c60c6c36790d1169f0d84d2c75fe81c1700b4f764ddcb0d0587d4b6d228d80e65fead035e3ab99449aad2f559071edf9145ff7a755506f3ff05b0e WHIRLPOOL 078388c50367d41c810a02aa795b6ad0df381582bdd2725ae125243ee5921aa4057494f063a7de49da6b6f6343f37a3c83d96ef6d92c22e722972c8e4ea968dc
+AUX qemu-2.3.0-CVE-2015-3456.patch 2853 SHA256 efac61bf9c20d5d08ef47bc9d51be5c8bd519f1d970ba3c3506c5760bf807e7d SHA512 5fed59ae67a962d187418f4bd57cebe901f9bcba817694b5e2a57daf77c34a406ed7c1f278e12d813304e58c48a24493b4e001a9ee4045bab2608f1730715ac7 WHIRLPOOL 9ad5237aa1bbe46a8493e331bb9c2152c36f9c877582485e1cf811b09430bad97a9f3b6bc52face7e4287f9c9fe4f1891de154a62ba93ea454c3ed9d44e8f729
+AUX qemu-9999-cflags.patch 347 SHA256 fe3bcbe83e81225b2c722578a0a976fcb724419d5208bbd6d02fb543e80b7e12 SHA512 e1b8be744170d61a2155b23a8394db01f8af6dc70ec033e71b2ff46f72975704836d42b96d7904e5d462289c5f8f24317f2fb28698f18a77ab1de02829e585eb WHIRLPOOL 2d972c7e40292f424fd37a4c1af04d2be095c215211ec2e1d15d8457df553342ffc02a7d39985f817fbbf5342e422d30e439c35a925341cf9b852ca7ff15a308
+AUX qemu-9999-virtfs-proxy-helper-accept.patch 973 SHA256 91cc9e024aa09ea3dd23ec52c561047656acc89f0ad0d5ddccce354c1ac4d282 SHA512 031cb1c35b479b18032f56a07fa2fa6d392a7f0919acd3636bf122ab7f75dcfbb5fc0e26e18a8a31a9888409f81c2e08438a1af999232418d940167c5031a92b WHIRLPOOL ea4dc08230289a147fd55d0bd9e32896cd4491130084fc45b4043f41caf611f07d4587cc485e6d25ba3f6fbc66939ed8faf3c2017bf33ab10e1885277fa3f6ff
+AUX qemu-binfmt.initd-r1 7023 SHA256 3572c110c6f217754e638796400a5901910a2e61b8818c8569f8258b103ebcc6 SHA512 773af64fef164c00945acf5881e64a10141aa8fdc85491e57bf8dcc7c800a4f81879527998a0896a42f921edcbf5f741beb31ac2a82e45cba506c7b8461733c8 WHIRLPOOL 30382fe347248683e989c2b7fbd804ce26173b313746d80467029b2ad3594f414628f7537120b168a0e700c424d3525528eb632b07e16544c2fd07f418f3187c
+AUX qemu-kvm-1.4 68 SHA256 8b1adf198129f001e75a2311fc420c168094d1084d2163cdf6a32b3b23c96137 SHA512 706fab4d155c410acc292e67fb354ce7dcd17f7e33f2ca8c9c44035ea128f8d36f89e27cf87ebe22721f5676be9e7f2ae5484fd000183c8ffd7854e02eb3d120 WHIRLPOOL ef795330b592cef8e3d92f52a77eb77a671e6aa1a47d07531917b5c1c09e72e5df1a44aea939b086e0a3c5ef2a5cea9223556a46ceae73e55300475c42f07067
+DIST qemu-2.1.2.tar.bz2 23563255 SHA256 fd10f5e45cf5a736fa5a3e1c279ae9821534e700beb7d1aab88a07648a394885 SHA512 73ef758c82b23eec649c807bee8937d7fbf267278f7777adbdb22b738672543b826d211a4b523f38cee3e2b01f05ccf40a75756fc19c911362988d8e86d5cd58 WHIRLPOOL 5703d0aa8bb4366bb7aeb44fa4f3d1b54f188de42cd8c82e894584f627802b80a3dde1aa3b15fe8602a1891ec61ac66b3cd44ec031385cca88768f375c15b554
+DIST qemu-2.2.1.tar.bz2 24483500 SHA256 4617154c6ef744b83e10b744e392ad111dd351d435d6563ce24d8da75b1335a0 SHA512 970ead0c92fc04502c6d3a8dbfafa5797667b3d276a1a25ddbe991d20d8e17a588905ecbffa77fb3b9d12e481ac3776ca4c38fe89a5e4c96dc2fb045214bfa9f WHIRLPOOL 9226ce4a4f5c7247d6ab34eb8b45c9a91416ee5849dbe25b9d15cddbd6aba2b8da77280f6055d363a81ddec515d28bf501351cb7e21ecfb4bfe42cdb7e349788
+EBUILD qemu-2.1.2-r99.ebuild 18542 SHA256 3e1df3e683e3e0f98abef9d912cccb8292be1d5ac96de4982c16829f209f3451 SHA512 0338892629e480794ecc6201f6eda7259201f9add8f6e1c3f7487826455398d30dd0d78fc794b73bd73bd206b7ae2810f3d5ed74abbc435a9685c3429173fea1 WHIRLPOOL 4167e7c6d0810c93a926c84fd3fa4b46624881205ad2eae3f11e5a03bfb8231c3e265bd986bf24b8e1f7eaf41e6a2f3c8964d416e0ac95ab406383aa4d0c6e28
+EBUILD qemu-2.2.1-r99.ebuild 18744 SHA256 15c5267816cbc7798b2aa0c342bd0a0254550d2fdb1497f3237aa33b53c8c59f SHA512 c7c90792a79fbf226e41f8dd61d5f3b1046a1e9c130d3216a0c29d374a09ec5aa8575e2578b843f37fd04645e2804ae91298924d307aff25922d7461bf52fe78 WHIRLPOOL ef73221242451e8772598ee1b0e346f4aa94ec59c1daf58ca9ac35d49e431c687ca5d80155e4e5846a3f76d35330a1043f9ae9018c19e0e1fc828711298aebae
+MISC metadata.xml 3774 SHA256 45d220d5c3fedecb5c318e2ab1fa796391f5fd3db09e4ef218b3bc7cb3cb10e1 SHA512 90b16206b5398b4044132d930b417372e1d305a93b062c895bc3b46ae64a19aa96d2471b5838f960cca7c6c30ce58571f332731f02eaeee17e4204469c5d6330 WHIRLPOOL f5498b8cb14aeeacdfd1da30c26ceca282bba3042a6288496d624d91c3c26c1bed34c42374db04e06378c8efd78010d3bef76c41c1aa529ccf17cec513ed1fa8
diff --git a/app-emulation/qemu/files/65-kvm.rules b/app-emulation/qemu/files/65-kvm.rules
new file mode 100644
index 00000000..c2f7317a
--- /dev/null
+++ b/app-emulation/qemu/files/65-kvm.rules
@@ -0,0 +1 @@
+KERNEL=="kvm", GROUP="kvm", MODE="0660"
diff --git a/app-emulation/qemu/files/bridge.conf b/app-emulation/qemu/files/bridge.conf
new file mode 100644
index 00000000..2bde37e2
--- /dev/null
+++ b/app-emulation/qemu/files/bridge.conf
@@ -0,0 +1,14 @@
+# This should have the following permissions: root:qemu 0640
+
+# allow br0
+# Uncommenting the above would allow users in the 'qemu' group
+# to add devices to 'br0'
+
+# allow virbr0
+# Uncommenting the above would allow users in the 'qemu' group
+# to add devices to 'virbr0'
+
+# include /etc/qemu/bob.conf
+# Uncommenting the above would allow users in the 'bob' group
+# to have permissions defined in it, iff it has the following
+# permissions: root:bob 0640
diff --git a/app-emulation/qemu/files/qemu-1.5.3-openpty.patch b/app-emulation/qemu/files/qemu-1.5.3-openpty.patch
new file mode 100644
index 00000000..5c71c5b1
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-1.5.3-openpty.patch
@@ -0,0 +1,12 @@
+Patch taken from sabotage linux
+--- qemu-1.7.0.org/util/qemu-openpty.c
++++ qemu-1.7.0/util/qemu-openpty.c
+@@ -47,6 +47,8 @@
+ #elif defined CONFIG_SOLARIS
+ # include <termios.h>
+ # include <stropts.h>
++#else
++# include <termios.h>
+ #endif
+
+ #ifdef __sun__
diff --git a/app-emulation/qemu/files/qemu-1.7.0-cflags.patch b/app-emulation/qemu/files/qemu-1.7.0-cflags.patch
new file mode 100644
index 00000000..cd003f6d
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-1.7.0-cflags.patch
@@ -0,0 +1,11 @@
+--- a/configure
++++ b/configure
+@@ -3131,8 +3131,6 @@ fi
+ if test "$gcov" = "yes" ; then
+ CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+ LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$debug" = "no" ; then
+- CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+ fi
+
+
diff --git a/app-emulation/qemu/files/qemu-1.7.0-ffsll.patch b/app-emulation/qemu/files/qemu-1.7.0-ffsll.patch
new file mode 100644
index 00000000..481bd72c
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-1.7.0-ffsll.patch
@@ -0,0 +1,19 @@
+taken from sabotage linux
+--- qemu-1.7.0.org/hw/virtio/vhost.c
++++ qemu-1.7.0/hw/virtio/vhost.c
+@@ -22,6 +22,15 @@
+ #include "exec/address-spaces.h"
+ #include "hw/virtio/virtio-bus.h"
+
++#ifndef HAVE_FFSLL
++static int ffsll(long long i) {
++ unsigned long long x = i & -i;
++ if (x <= 0xffffffff) return ffs (i);
++ else return 32 + ffs (i >> 32);
++}
++#endif
++
++
+ static void vhost_dev_sync_region(struct vhost_dev *dev,
+ MemoryRegionSection *section,
+ uint64_t mfirst, uint64_t mlast,
diff --git a/app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch b/app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch
new file mode 100644
index 00000000..1d5d1730
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-1.7.0-sigset_t.patch
@@ -0,0 +1,12 @@
+taken from sabotage linux
+--- qemu-1.7.0.org/linux-user/syscall.c
++++ qemu-1.7.0/linux-user/syscall.c
+@@ -400,7 +400,7 @@
+ #endif
+ #define __NR_sys_ppoll __NR_ppoll
+ _syscall5(int, sys_ppoll, struct pollfd *, fds, nfds_t, nfds,
+- struct timespec *, timeout, const __sigset_t *, sigmask,
++ struct timespec *, timeout, const sigset_t *, sigmask,
+ size_t, sigsetsize)
+ #endif
+
diff --git a/app-emulation/qemu/files/qemu-2.0.0-F_SHLCK-and-F_EXLCK.patch b/app-emulation/qemu/files/qemu-2.0.0-F_SHLCK-and-F_EXLCK.patch
new file mode 100644
index 00000000..fb5ad597
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.0.0-F_SHLCK-and-F_EXLCK.patch
@@ -0,0 +1,23 @@
+Copied from Alpine Linux
+
+This patch was not upstreamed to qemu as those should probably be
+defined in musl libc.
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index c8989b6..00ed747 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -114,6 +114,13 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
+
+ #include "qemu.h"
+
++#ifndef F_SHLCK
++#define F_SHLCK 8
++#endif
++#ifndef F_EXLCK
++#define F_EXLCK 4
++#endif
++
+ #define CLONE_NPTL_FLAGS2 (CLONE_SETTLS | \
+ CLONE_PARENT_SETTID | CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)
+
diff --git a/app-emulation/qemu/files/qemu-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch b/app-emulation/qemu/files/qemu-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
new file mode 100644
index 00000000..7ea1dba6
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
@@ -0,0 +1,37 @@
+From 3e231fa7a2dc66e2ef06ac44f4f719b08fc0c67e Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue, 29 Apr 2014 15:51:31 +0200
+Subject: [PATCH 6/6] linux-user/signal.c: define __SIGRTMIN/MAX for non-GNU
+ platforms
+
+The __SIGRTMIN and __SIGRTMAX are glibc internals and are not available
+on all platforms, so we define those if they are missing.
+
+This is needed for musl libc.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ linux-user/signal.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/linux-user/signal.c b/linux-user/signal.c
+index 7d6246f..6019dbb 100644
+--- a/linux-user/signal.c
++++ b/linux-user/signal.c
+@@ -32,6 +32,13 @@
+
+ //#define DEBUG_SIGNAL
+
++#ifndef __SIGRTMIN
++#define __SIGRTMIN 32
++#endif
++#ifndef __SIGRTMAX
++#define __SIGRTMAX (NSIG-1)
++#endif
++
+ static struct target_sigaltstack target_sigaltstack_used = {
+ .ss_sp = 0,
+ .ss_size = 0,
+--
+1.9.2
+
diff --git a/app-emulation/qemu/files/qemu-2.1.0-CVE-2014-5388.patch b/app-emulation/qemu/files/qemu-2.1.0-CVE-2014-5388.patch
new file mode 100644
index 00000000..26a012be
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.1.0-CVE-2014-5388.patch
@@ -0,0 +1,36 @@
+https://bugs.gentoo.org/520688
+
+From fa365d7cd11185237471823a5a33d36765454e16 Mon Sep 17 00:00:00 2001
+From: Gonglei <arei.gonglei@huawei.com>
+Date: Wed, 20 Aug 2014 13:52:30 +0800
+Subject: [PATCH] pcihp: fix possible array out of bounds
+
+Prevent out-of-bounds array access on
+acpi_pcihp_pci_status.
+
+Signed-off-by: Gonglei <arei.gonglei@huawei.com>
+Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
+Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Cc: qemu-stable@nongnu.org
+Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
+---
+ hw/acpi/pcihp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
+index fae663a..34dedf1 100644
+--- a/hw/acpi/pcihp.c
++++ b/hw/acpi/pcihp.c
+@@ -231,7 +231,7 @@ static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size)
+ uint32_t val = 0;
+ int bsel = s->hotplug_select;
+
+- if (bsel < 0 || bsel > ACPI_PCIHP_MAX_HOTPLUG_BUS) {
++ if (bsel < 0 || bsel >= ACPI_PCIHP_MAX_HOTPLUG_BUS) {
+ return 0;
+ }
+
+--
+2.0.0
+
diff --git a/app-emulation/qemu/files/qemu-2.1.1-readlink-self.patch b/app-emulation/qemu/files/qemu-2.1.1-readlink-self.patch
new file mode 100644
index 00000000..451a9682
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.1.1-readlink-self.patch
@@ -0,0 +1,81 @@
+fix already in upstream
+
+From f17f4989fa193fa8279474c5462289a3cfe69aea Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@chromium.org>
+Date: Fri, 8 Aug 2014 09:40:25 +0900
+Subject: [PATCH] linux-user: fix readlink handling with magic exe symlink
+
+The current code always returns the length of the path when it should
+be returning the number of bytes it wrote to the output string.
+
+Further, readlink is not supposed to append a NUL byte, but the current
+snprintf logic will always do just that.
+
+Even further, if you pass in a length of 0, you're suppoesd to get back
+an error (EINVAL), but the current logic just returns 0.
+
+Further still, if there was an error reading the symlink, we should not
+go ahead and try to read the target buffer as it is garbage.
+
+Simple test for the first two issues:
+$ cat test.c
+int main() {
+ char buf[50];
+ size_t len;
+ for (len = 0; len < 10; ++len) {
+ memset(buf, '!', sizeof(buf));
+ ssize_t ret = readlink("/proc/self/exe", buf, len);
+ buf[20] = '\0';
+ printf("readlink(/proc/self/exe, {%s}, %zu) = %zi\n", buf, len, ret);
+ }
+ return 0;
+}
+
+Now compare the output of the native:
+$ gcc test.c -o /tmp/x
+$ /tmp/x
+$ strace /tmp/x
+
+With what qemu does:
+$ armv7a-cros-linux-gnueabi-gcc test.c -o /tmp/x -static
+$ qemu-arm /tmp/x
+$ qemu-arm -strace /tmp/x
+
+Signed-off-by: Mike Frysinger <vapier@chromium.org>
+Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
+---
+ linux-user/syscall.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index fccf9f0..7c108ab 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -6636,11 +6636,22 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ p2 = lock_user(VERIFY_WRITE, arg2, arg3, 0);
+ if (!p || !p2) {
+ ret = -TARGET_EFAULT;
++ } else if (!arg3) {
++ /* Short circuit this for the magic exe check. */
++ ret = -TARGET_EINVAL;
+ } else if (is_proc_myself((const char *)p, "exe")) {
+ char real[PATH_MAX], *temp;
+ temp = realpath(exec_path, real);
+- ret = temp == NULL ? get_errno(-1) : strlen(real) ;
+- snprintf((char *)p2, arg3, "%s", real);
++ /* Return value is # of bytes that we wrote to the buffer. */
++ if (temp == NULL) {
++ ret = get_errno(-1);
++ } else {
++ /* Don't worry about sign mismatch as earlier mapping
++ * logic would have thrown a bad address error. */
++ ret = MIN(strlen(real), arg3);
++ /* We cannot NUL terminate the string. */
++ memcpy(p2, real, ret);
++ }
+ } else {
+ ret = get_errno(readlink(path(p), p2, arg3));
+ }
+--
+2.0.0
+
diff --git a/app-emulation/qemu/files/qemu-2.1.2-vnc-sanitize-bits.patch b/app-emulation/qemu/files/qemu-2.1.2-vnc-sanitize-bits.patch
new file mode 100644
index 00000000..34f136f5
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.1.2-vnc-sanitize-bits.patch
@@ -0,0 +1,50 @@
+https://bugs.gentoo.org/527088
+
+From e6908bfe8e07f2b452e78e677da1b45b1c0f6829 Mon Sep 17 00:00:00 2001
+From: Petr Matousek <pmatouse@redhat.com>
+Date: Mon, 27 Oct 2014 12:41:44 +0100
+Subject: [PATCH] vnc: sanitize bits_per_pixel from the client
+
+bits_per_pixel that are less than 8 could result in accessing
+non-initialized buffers later in the code due to the expectation
+that bytes_per_pixel value that is used to initialize these buffers is
+never zero.
+
+To fix this check that bits_per_pixel from the client is one of the
+values that the rfb protocol specification allows.
+
+This is CVE-2014-7815.
+
+Signed-off-by: Petr Matousek <pmatouse@redhat.com>
+
+[ kraxel: apply codestyle fix ]
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ ui/vnc.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/ui/vnc.c b/ui/vnc.c
+index 0fe6eff..8bca597 100644
+--- a/ui/vnc.c
++++ b/ui/vnc.c
+@@ -2026,6 +2026,16 @@ static void set_pixel_format(VncState *vs,
+ return;
+ }
+
++ switch (bits_per_pixel) {
++ case 8:
++ case 16:
++ case 32:
++ break;
++ default:
++ vnc_client_error(vs);
++ return;
++ }
++
+ vs->client_pf.rmax = red_max;
+ vs->client_pf.rbits = hweight_long(red_max);
+ vs->client_pf.rshift = red_shift;
+--
+2.1.2
+
diff --git a/app-emulation/qemu/files/qemu-2.2.0-_sigev_un.patch b/app-emulation/qemu/files/qemu-2.2.0-_sigev_un.patch
new file mode 100644
index 00000000..5827c2e0
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.2.0-_sigev_un.patch
@@ -0,0 +1,12 @@
+diff -ur a/qemu-2.2.0/linux-user/syscall.c b/qemu-2.2.0/linux-user/syscall.c
+--- a/qemu-2.2.0/linux-user/syscall.c 2014-12-09 15:45:43.000000000 -0100
++++ b/qemu-2.2.0/linux-user/syscall.c 2015-03-16 19:09:49.050386155 -0100
+@@ -5033,7 +5033,7 @@
+ host_sevp->sigev_signo =
+ target_to_host_signal(tswap32(target_sevp->sigev_signo));
+ host_sevp->sigev_notify = tswap32(target_sevp->sigev_notify);
+- host_sevp->_sigev_un._tid = tswap32(target_sevp->_sigev_un._tid);
++ ((int*)(&host_sevp->sigev_notify))[1] = tswap32(target_sevp->_sigev_un._tid);
+
+ unlock_user_struct(target_sevp, target_addr, 1);
+ return 0;
diff --git a/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch
new file mode 100644
index 00000000..35ef8fde
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-1.patch
@@ -0,0 +1,241 @@
+From a2bebfd6e09d285aa793cae3fb0fc3a39a9fee6e Mon Sep 17 00:00:00 2001
+From: "Daniel P. Berrange" <berrange@redhat.com>
+Date: Mon, 23 Mar 2015 22:58:21 +0000
+Subject: [PATCH] CVE-2015-1779: incrementally decode websocket frames
+
+The logic for decoding websocket frames wants to fully
+decode the frame header and payload, before allowing the
+VNC server to see any of the payload data. There is no
+size limit on websocket payloads, so this allows a
+malicious network client to consume 2^64 bytes in memory
+in QEMU. It can trigger this denial of service before
+the VNC server even performs any authentication.
+
+The fix is to decode the header, and then incrementally
+decode the payload data as it is needed. With this fix
+the websocket decoder will allow at most 4k of data to
+be buffered before decoding and processing payload.
+
+Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
+
+[ kraxel: fix frequent spurious disconnects, suggested by Peter Maydell ]
+
+ @@ -361,7 +361,7 @@ int vncws_decode_frame_payload(Buffer *input,
+ - *payload_size = input->offset;
+ + *payload_size = *payload_remain;
+
+[ kraxel: fix 32bit build ]
+
+ @@ -306,7 +306,7 @@ struct VncState
+ - uint64_t ws_payload_remain;
+ + size_t ws_payload_remain;
+
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ ui/vnc-ws.c | 105 ++++++++++++++++++++++++++++++++++++++++--------------------
+ ui/vnc-ws.h | 9 ++++--
+ ui/vnc.h | 2 ++
+ 3 files changed, 80 insertions(+), 36 deletions(-)
+
+diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
+index 85dbb7e..0b7de4e 100644
+--- a/ui/vnc-ws.c
++++ b/ui/vnc-ws.c
+@@ -107,7 +107,7 @@ long vnc_client_read_ws(VncState *vs)
+ {
+ int ret, err;
+ uint8_t *payload;
+- size_t payload_size, frame_size;
++ size_t payload_size, header_size;
+ VNC_DEBUG("Read websocket %p size %zd offset %zd\n", vs->ws_input.buffer,
+ vs->ws_input.capacity, vs->ws_input.offset);
+ buffer_reserve(&vs->ws_input, 4096);
+@@ -117,18 +117,39 @@ long vnc_client_read_ws(VncState *vs)
+ }
+ vs->ws_input.offset += ret;
+
+- /* make sure that nothing is left in the ws_input buffer */
++ ret = 0;
++ /* consume as much of ws_input buffer as possible */
+ do {
+- err = vncws_decode_frame(&vs->ws_input, &payload,
+- &payload_size, &frame_size);
+- if (err <= 0) {
+- return err;
++ if (vs->ws_payload_remain == 0) {
++ err = vncws_decode_frame_header(&vs->ws_input,
++ &header_size,
++ &vs->ws_payload_remain,
++ &vs->ws_payload_mask);
++ if (err <= 0) {
++ return err;
++ }
++
++ buffer_advance(&vs->ws_input, header_size);
+ }
++ if (vs->ws_payload_remain != 0) {
++ err = vncws_decode_frame_payload(&vs->ws_input,
++ &vs->ws_payload_remain,
++ &vs->ws_payload_mask,
++ &payload,
++ &payload_size);
++ if (err < 0) {
++ return err;
++ }
++ if (err == 0) {
++ return ret;
++ }
++ ret += err;
+
+- buffer_reserve(&vs->input, payload_size);
+- buffer_append(&vs->input, payload, payload_size);
++ buffer_reserve(&vs->input, payload_size);
++ buffer_append(&vs->input, payload, payload_size);
+
+- buffer_advance(&vs->ws_input, frame_size);
++ buffer_advance(&vs->ws_input, payload_size);
++ }
+ } while (vs->ws_input.offset > 0);
+
+ return ret;
+@@ -265,15 +286,14 @@ void vncws_encode_frame(Buffer *output, const void *payload,
+ buffer_append(output, payload, payload_size);
+ }
+
+-int vncws_decode_frame(Buffer *input, uint8_t **payload,
+- size_t *payload_size, size_t *frame_size)
++int vncws_decode_frame_header(Buffer *input,
++ size_t *header_size,
++ size_t *payload_remain,
++ WsMask *payload_mask)
+ {
+ unsigned char opcode = 0, fin = 0, has_mask = 0;
+- size_t header_size = 0;
+- uint32_t *payload32;
++ size_t payload_len;
+ WsHeader *header = (WsHeader *)input->buffer;
+- WsMask mask;
+- int i;
+
+ if (input->offset < WS_HEAD_MIN_LEN + 4) {
+ /* header not complete */
+@@ -283,7 +303,7 @@ int vncws_decode_frame(Buffer *input, uint8_t **payload,
+ fin = (header->b0 & 0x80) >> 7;
+ opcode = header->b0 & 0x0f;
+ has_mask = (header->b1 & 0x80) >> 7;
+- *payload_size = header->b1 & 0x7f;
++ payload_len = header->b1 & 0x7f;
+
+ if (opcode == WS_OPCODE_CLOSE) {
+ /* disconnect */
+@@ -300,40 +320,57 @@ int vncws_decode_frame(Buffer *input, uint8_t **payload,
+ return -2;
+ }
+
+- if (*payload_size < 126) {
+- header_size = 6;
+- mask = header->u.m;
+- } else if (*payload_size == 126 && input->offset >= 8) {
+- *payload_size = be16_to_cpu(header->u.s16.l16);
+- header_size = 8;
+- mask = header->u.s16.m16;
+- } else if (*payload_size == 127 && input->offset >= 14) {
+- *payload_size = be64_to_cpu(header->u.s64.l64);
+- header_size = 14;
+- mask = header->u.s64.m64;
++ if (payload_len < 126) {
++ *payload_remain = payload_len;
++ *header_size = 6;
++ *payload_mask = header->u.m;
++ } else if (payload_len == 126 && input->offset >= 8) {
++ *payload_remain = be16_to_cpu(header->u.s16.l16);
++ *header_size = 8;
++ *payload_mask = header->u.s16.m16;
++ } else if (payload_len == 127 && input->offset >= 14) {
++ *payload_remain = be64_to_cpu(header->u.s64.l64);
++ *header_size = 14;
++ *payload_mask = header->u.s64.m64;
+ } else {
+ /* header not complete */
+ return 0;
+ }
+
+- *frame_size = header_size + *payload_size;
++ return 1;
++}
++
++int vncws_decode_frame_payload(Buffer *input,
++ size_t *payload_remain, WsMask *payload_mask,
++ uint8_t **payload, size_t *payload_size)
++{
++ size_t i;
++ uint32_t *payload32;
+
+- if (input->offset < *frame_size) {
+- /* frame not complete */
++ *payload = input->buffer;
++ /* If we aren't at the end of the payload, then drop
++ * off the last bytes, so we're always multiple of 4
++ * for purpose of unmasking, except at end of payload
++ */
++ if (input->offset < *payload_remain) {
++ *payload_size = input->offset - (input->offset % 4);
++ } else {
++ *payload_size = *payload_remain;
++ }
++ if (*payload_size == 0) {
+ return 0;
+ }
+-
+- *payload = input->buffer + header_size;
++ *payload_remain -= *payload_size;
+
+ /* unmask frame */
+ /* process 1 frame (32 bit op) */
+ payload32 = (uint32_t *)(*payload);
+ for (i = 0; i < *payload_size / 4; i++) {
+- payload32[i] ^= mask.u;
++ payload32[i] ^= payload_mask->u;
+ }
+ /* process the remaining bytes (if any) */
+ for (i *= 4; i < *payload_size; i++) {
+- (*payload)[i] ^= mask.c[i % 4];
++ (*payload)[i] ^= payload_mask->c[i % 4];
+ }
+
+ return 1;
+diff --git a/ui/vnc-ws.h b/ui/vnc-ws.h
+index ef229b7..14d4230 100644
+--- a/ui/vnc-ws.h
++++ b/ui/vnc-ws.h
+@@ -83,7 +83,12 @@ long vnc_client_read_ws(VncState *vs);
+ void vncws_process_handshake(VncState *vs, uint8_t *line, size_t size);
+ void vncws_encode_frame(Buffer *output, const void *payload,
+ const size_t payload_size);
+-int vncws_decode_frame(Buffer *input, uint8_t **payload,
+- size_t *payload_size, size_t *frame_size);
++int vncws_decode_frame_header(Buffer *input,
++ size_t *header_size,
++ size_t *payload_remain,
++ WsMask *payload_mask);
++int vncws_decode_frame_payload(Buffer *input,
++ size_t *payload_remain, WsMask *payload_mask,
++ uint8_t **payload, size_t *payload_size);
+
+ #endif /* __QEMU_UI_VNC_WS_H */
+diff --git a/ui/vnc.h b/ui/vnc.h
+index e19ac39..3f7c6a9 100644
+--- a/ui/vnc.h
++++ b/ui/vnc.h
+@@ -306,6 +306,8 @@ struct VncState
+ #ifdef CONFIG_VNC_WS
+ Buffer ws_input;
+ Buffer ws_output;
++ size_t ws_payload_remain;
++ WsMask ws_payload_mask;
+ #endif
+ /* current output mode information */
+ VncWritePixels *write_pixels;
+--
+2.3.5
+
diff --git a/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch
new file mode 100644
index 00000000..c7a8c8b3
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.2.1-CVE-2015-1779-2.patch
@@ -0,0 +1,58 @@
+From 2cdb5e142fb93e875fa53c52864ef5eb8d5d8b41 Mon Sep 17 00:00:00 2001
+From: "Daniel P. Berrange" <berrange@redhat.com>
+Date: Mon, 23 Mar 2015 22:58:22 +0000
+Subject: [PATCH] CVE-2015-1779: limit size of HTTP headers from websockets
+ clients
+
+The VNC server websockets decoder will read and buffer data from
+websockets clients until it sees the end of the HTTP headers,
+as indicated by \r\n\r\n. In theory this allows a malicious to
+trick QEMU into consuming an arbitrary amount of RAM. In practice,
+because QEMU runs g_strstr_len() across the buffered header data,
+it will spend increasingly long burning CPU time searching for
+the substring match and less & less time reading data. So while
+this does cause arbitrary memory growth, the bigger problem is
+that QEMU will be burning 100% of available CPU time.
+
+A novnc websockets client typically sends headers of around
+512 bytes in length. As such it is reasonable to place a 4096
+byte limit on the amount of data buffered while searching for
+the end of HTTP headers.
+
+Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ ui/vnc-ws.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
+index 0b7de4e..62eb97f 100644
+--- a/ui/vnc-ws.c
++++ b/ui/vnc-ws.c
+@@ -81,8 +81,11 @@ void vncws_handshake_read(void *opaque)
+ VncState *vs = opaque;
+ uint8_t *handshake_end;
+ long ret;
+- buffer_reserve(&vs->ws_input, 4096);
+- ret = vnc_client_read_buf(vs, buffer_end(&vs->ws_input), 4096);
++ /* Typical HTTP headers from novnc are 512 bytes, so limiting
++ * total header size to 4096 is easily enough. */
++ size_t want = 4096 - vs->ws_input.offset;
++ buffer_reserve(&vs->ws_input, want);
++ ret = vnc_client_read_buf(vs, buffer_end(&vs->ws_input), want);
+
+ if (!ret) {
+ if (vs->csock == -1) {
+@@ -99,6 +102,9 @@ void vncws_handshake_read(void *opaque)
+ vncws_process_handshake(vs, vs->ws_input.buffer, vs->ws_input.offset);
+ buffer_advance(&vs->ws_input, handshake_end - vs->ws_input.buffer +
+ strlen(WS_HANDSHAKE_END));
++ } else if (vs->ws_input.offset >= 4096) {
++ VNC_DEBUG("End of headers not found in first 4096 bytes\n");
++ vnc_client_error(vs);
+ }
+ }
+
+--
+2.3.5
+
diff --git a/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch
new file mode 100644
index 00000000..87697d08
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.3.0-CVE-2015-3456.patch
@@ -0,0 +1,86 @@
+https://bugs.gentoo.org/549404
+
+From e907746266721f305d67bc0718795fedee2e824c Mon Sep 17 00:00:00 2001
+From: Petr Matousek <pmatouse@redhat.com>
+Date: Wed, 6 May 2015 09:48:59 +0200
+Subject: [PATCH] fdc: force the fifo access to be in bounds of the allocated buffer
+
+During processing of certain commands such as FD_CMD_READ_ID and
+FD_CMD_DRIVE_SPECIFICATION_COMMAND the fifo memory access could
+get out of bounds leading to memory corruption with values coming
+from the guest.
+
+Fix this by making sure that the index is always bounded by the
+allocated memory.
+
+This is CVE-2015-3456.
+
+Signed-off-by: Petr Matousek <pmatouse@redhat.com>
+Reviewed-by: John Snow <jsnow@redhat.com>
+Signed-off-by: John Snow <jsnow@redhat.com>
+---
+ hw/block/fdc.c | 17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/hw/block/fdc.c b/hw/block/fdc.c
+index f72a392..d8a8edd 100644
+--- a/hw/block/fdc.c
++++ b/hw/block/fdc.c
+@@ -1497,7 +1497,7 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl)
+ {
+ FDrive *cur_drv;
+ uint32_t retval = 0;
+- int pos;
++ uint32_t pos;
+
+ cur_drv = get_cur_drv(fdctrl);
+ fdctrl->dsr &= ~FD_DSR_PWRDOWN;
+@@ -1506,8 +1506,8 @@ static uint32_t fdctrl_read_data(FDCtrl *fdctrl)
+ return 0;
+ }
+ pos = fdctrl->data_pos;
++ pos %= FD_SECTOR_LEN;
+ if (fdctrl->msr & FD_MSR_NONDMA) {
+- pos %= FD_SECTOR_LEN;
+ if (pos == 0) {
+ if (fdctrl->data_pos != 0)
+ if (!fdctrl_seek_to_next_sect(fdctrl, cur_drv)) {
+@@ -1852,10 +1852,13 @@ static void fdctrl_handle_option(FDCtrl *fdctrl, int direction)
+ static void fdctrl_handle_drive_specification_command(FDCtrl *fdctrl, int direction)
+ {
+ FDrive *cur_drv = get_cur_drv(fdctrl);
++ uint32_t pos;
+
+- if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) {
++ pos = fdctrl->data_pos - 1;
++ pos %= FD_SECTOR_LEN;
++ if (fdctrl->fifo[pos] & 0x80) {
+ /* Command parameters done */
+- if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) {
++ if (fdctrl->fifo[pos] & 0x40) {
+ fdctrl->fifo[0] = fdctrl->fifo[1];
+ fdctrl->fifo[2] = 0;
+ fdctrl->fifo[3] = 0;
+@@ -1955,7 +1958,7 @@ static uint8_t command_to_handler[256];
+ static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value)
+ {
+ FDrive *cur_drv;
+- int pos;
++ uint32_t pos;
+
+ /* Reset mode */
+ if (!(fdctrl->dor & FD_DOR_nRESET)) {
+@@ -2004,7 +2007,9 @@ static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value)
+ }
+
+ FLOPPY_DPRINTF("%s: %02x\n", __func__, value);
+- fdctrl->fifo[fdctrl->data_pos++] = value;
++ pos = fdctrl->data_pos++;
++ pos %= FD_SECTOR_LEN;
++ fdctrl->fifo[pos] = value;
+ if (fdctrl->data_pos == fdctrl->data_len) {
+ /* We now have all parameters
+ * and will be able to treat the command
+--
+1.7.0.4
+
diff --git a/app-emulation/qemu/files/qemu-9999-cflags.patch b/app-emulation/qemu/files/qemu-9999-cflags.patch
new file mode 100644
index 00000000..08a6c9fa
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-9999-cflags.patch
@@ -0,0 +1,13 @@
+diff --git a/configure b/configure
+index 82f6e71..7e19aaf 100755
+--- a/configure
++++ b/configure
+@@ -3131,8 +3131,6 @@ fi
+ if test "$gcov" = "yes" ; then
+ CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
+ LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+-elif test "$debug" = "no" ; then
+- CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
+ fi
+
+
diff --git a/app-emulation/qemu/files/qemu-9999-virtfs-proxy-helper-accept.patch b/app-emulation/qemu/files/qemu-9999-virtfs-proxy-helper-accept.patch
new file mode 100644
index 00000000..f8a5249f
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-9999-virtfs-proxy-helper-accept.patch
@@ -0,0 +1,30 @@
+From c5970614489e385e69667f1f323421442a7a46c0 Mon Sep 17 00:00:00 2001
+From: Tim Comer <comer0@gmail.com>
+Date: Sat, 19 Apr 2014 12:51:42 -0400
+Subject: [PATCH] virtfs-proxy-helper: fix call to accept
+
+The current code calls accept() without initializing the size parameter
+which means the accept call might write too much to the stack.
+
+URL: https://bugs.gentoo.org/486714
+Signed-off-by: Tim Comer <comer0@gmail.com>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ fsdev/virtfs-proxy-helper.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
+index bfecb87..cd291d3 100644
+--- a/fsdev/virtfs-proxy-helper.c
++++ b/fsdev/virtfs-proxy-helper.c
+@@ -760,6 +760,7 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)
+ return -1;
+ }
+
++ size = sizeof(qemu);
+ client = accept(sock, (struct sockaddr *)&qemu, &size);
+ if (client < 0) {
+ do_perror("accept");
+--
+1.9.2
+
diff --git a/app-emulation/qemu/files/qemu-binfmt.initd-r1 b/app-emulation/qemu/files/qemu-binfmt.initd-r1
new file mode 100644
index 00000000..4b1dba51
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-binfmt.initd-r1
@@ -0,0 +1,129 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/files/qemu-binfmt.initd-r1,v 1.3 2013/02/17 22:05:22 vapier Exp $
+
+# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
+
+depend() {
+ after procfs
+}
+
+start() {
+ ebegin "Registering qemu-user binaries"
+
+ if [ ! -d /proc/sys/fs/binfmt_misc ] ; then
+ modprobe -q binfmt_misc
+ fi
+
+ if [ ! -d /proc/sys/fs/binfmt_misc ] ; then
+ eend $? "You need support for 'misc binaries' in your kernel!" || return
+ fi
+
+ if [ ! -f /proc/sys/fs/binfmt_misc/register ] ; then
+ mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc >/dev/null 2>&1
+ eend $? || return
+ fi
+
+ # probe cpu type
+ cpu=`uname -m`
+ case "$cpu" in
+ i386|i486|i586|i686|i86pc|BePC|x86_64)
+ cpu="i386"
+ ;;
+ m68k)
+ cpu="m68k"
+ ;;
+ mips*)
+ cpu="mips"
+ ;;
+ "Power Macintosh"|ppc|ppc64)
+ cpu="ppc"
+ ;;
+ armv[4-9]*)
+ cpu="arm"
+ ;;
+ sparc*)
+ cpu="sparc"
+ ;;
+ esac
+
+ # register the interpreter for each cpu except for the native one
+ if [ $cpu != "i386" -a -x "/usr/bin/qemu-i386" ] ; then
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:P' > /proc/sys/fs/binfmt_misc/register
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "alpha" -a -x "/usr/bin/qemu-alpha" ] ; then
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-arm" ] ; then
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "arm" -a -x "/usr/bin/qemu-armeb" ] ; then
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sparc" -a -x "/usr/bin/qemu-sparc" ] ; then
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "ppc" -a -x "/usr/bin/qemu-ppc" ] ; then
+ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "m68k" -a -x "/usr/bin/qemu-m68k" ] ; then
+ echo 'Please check cpu value and header information for m68k!'
+ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips" ] ; then
+ # FIXME: We could use the other endianness on a MIPS host.
+ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsel" ] ; then
+ echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32" ] ; then
+ echo ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mipsn32el" ] ; then
+ echo ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64" ] ; then
+ echo ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "mips" -a -x "/usr/bin/qemu-mips64el" ] ; then
+ echo ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4" ] ; then
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "sh" -a -x "/usr/bin/qemu-sh4eb" ] ; then
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ if [ $cpu != "s390x" -a -x "/usr/local/bin/qemu-s390x" ] ; then
+ echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x:P' > /proc/sys/fs/binfmt_misc/register
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Unregistering qemu-user binaries"
+ local arches
+
+ arches="${arches} i386 i486"
+ arches="${arches} alpha"
+ arches="${arches} arm armeb"
+ arches="${arches} sparc"
+ arches="${arches} ppc"
+ arches="${arches} m68k"
+ arches="${arches} mips mipsel mipsn32 mipsn32el mips64 mips64el"
+ arches="${arches} sh4 sh4eb"
+ arches="${arches} s390x"
+
+ for a in ${arches}; do
+ if [ -f /proc/sys/fs/binfmt_misc/$a ] ; then
+ echo '-1' > /proc/sys/fs/binfmt_misc/$a
+ fi
+ done
+
+ eend $?
+}
+
+# vim: ts=4 :
diff --git a/app-emulation/qemu/files/qemu-kvm-1.4 b/app-emulation/qemu/files/qemu-kvm-1.4
new file mode 100644
index 00000000..08da00b8
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-kvm-1.4
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /usr/bin/qemu-system-x86_64 -machine accel=kvm "$@"
diff --git a/app-emulation/qemu/metadata.xml b/app-emulation/qemu/metadata.xml
new file mode 100644
index 00000000..87667db9
--- /dev/null
+++ b/app-emulation/qemu/metadata.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>qemu</herd>
+ <maintainer>
+ <email>cardoe@gentoo.org</email>
+ <name>Doug Goldstein</name>
+ </maintainer>
+ <use>
+ <flag name='accessibility'>Adds support for braille displays using brltty</flag>
+ <flag name='aio'>Enables support for Linux's Async IO</flag>
+ <flag name='alsa'>Enable alsa output for sound emulation</flag>
+ <flag name='curl'>Support ISOs / -cdrom directives vis HTTP or HTTPS.</flag>
+ <flag name='fdt'>Enables firmware device tree support</flag>
+ <flag name='glusterfs'>Enables GlusterFS cluster fileystem via
+ <pkg>sys-cluster/glusterfs</pkg></flag>
+ <flag name='iscsi'>Enable direct iSCSI support via
+ <pkg>net-libs/libiscsi</pkg> instead of indirectly via the Linux
+ block layer that <pkg>sys-block/open-iscsi</pkg> does.</flag>
+ <flag name='ncurses'>Enable the ncurses-based console</flag>
+ <flag name='nfs'>Enable NFS support</flag>
+ <flag name='numa'>Enable NUMA support</flag>
+ <flag name='pin-upstream-blobs'>Pin the versions of BIOS firmware to the version included in the upstream release.
+ This is needed to sanely support migration/suspend/resume/snapshotting/etc... of instances.
+ When the blobs are different, random corruption/bugs/crashes/etc... may be observed.</flag>
+ <flag name='pulseaudio'>Enable pulseaudio output for sound emulation</flag>
+ <flag name='rbd'>Enable rados block device backend support, see http://ceph.newdream.net/wiki/QEMU-RBD</flag>
+ <flag name='sdl'>Enable the SDL-based console</flag>
+ <flag name='seccomp'>Utilize <pkg>sys-libs/libseccomp</pkg> to enable kernel filtering of system calls to prevent malicious guests from doing damage.</flag>
+ <flag name='spice'>Enable Spice protocol support via <pkg>app-emulation/spice</pkg></flag>
+ <flag name='ssh'>Enable SSH based block device support via <pkg>net-libs/libssh2</pkg></flag>
+ <flag name='static-softmmu'>Builds the Software MMU (system) targets as static binaries</flag>
+ <flag name='static-user'>Build the User targets as static binaries</flag>
+ <flag name='static'>Enables both 'static-softmmu' and 'static-user'</flag>
+ <flag name='snappy'>Enable support for snappy compression</flag>
+ <flag name='systemtap'>Enable SystemTAP/DTrace tracing</flag>
+ <flag name='tci'>Enable the TCG Interpreter which can speed up or slowdown workloads depending on the host and guest CPUs being emulated. In the future it will be a runtime option but for now its compile time.</flag>
+ <flag name='tls'>Enable TLS support for the VNC console server.
+ For 1.4 and newer this also enables WebSocket support.
+ For 2.0 and newer this also enables disk quorum support.</flag>
+ <flag name='jpeg'>Enable jpeg image support for the VNC console server</flag>
+ <flag name='png'>Enable png image support for the VNC console server</flag>
+ <flag name='usb'>Enable USB passthrough via <pkg>dev-libs/libusb</pkg></flag>
+ <flag name="usbredir">Use <pkg>sys-apps/usbredir</pkg> to redirect USB
+ devices to another machine over TCP</flag>
+ <flag name='uuid'>Enable UUID support in the vdi block driver</flag>
+ <flag name='vde'>Enable VDE-based networking</flag>
+ <flag name='vhost-net'>Enable accelerated networking using vhost-net, see http://www.linux-kvm.org/page/VhostNet</flag>
+ <flag name='virtfs'>Enable VirtFS via virtio-9p-pci / fsdev. See http://wiki.qemu.org/Documentation/9psetup</flag>
+ <flag name='xattr'>Add support for getting and setting POSIX extended attributes, through
+ <pkg>sys-apps/attr</pkg>. Requisite for the virtfs backend.
+ </flag>
+ <flag name='xen'>Enables support for Xen backends</flag>
+ <flag name='xfs'>Support xfsctl() notification and syncing for XFS backed
+ virtual disks.</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/qemu/qemu-2.1.2-r99.ebuild b/app-emulation/qemu/qemu-2.1.2-r99.ebuild
new file mode 100644
index 00000000..4a1c813a
--- /dev/null
+++ b/app-emulation/qemu/qemu-2.1.2-r99.ebuild
@@ -0,0 +1,600 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-2.1.2-r1.ebuild,v 1.4 2014/11/08 18:09:33 ago Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+PYTHON_REQ_USE="ncurses,readline"
+
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
+ user udev fcaps readme.gentoo pax-utils
+
+BACKPORTS=
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
+
+LICENSE="GPL-2 LGPL-2 BSD-2"
+SLOT="0"
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
+gtk infiniband iscsi +jpeg \
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
++png pulseaudio python \
+rbd sasl +seccomp sdl selinux smartcard snappy spice ssh static static-softmmu \
+static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
+virtfs +vnc xattr xen xfs"
+
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
+x86_64"
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
+
+use_targets="
+ $(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
+ $(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
+"
+IUSE+=" ${use_targets}"
+
+# Require at least one softmmu or user target.
+# Block USE flag configurations known to not work.
+REQUIRED_USE="|| ( ${use_targets} )
+ ${PYTHON_REQUIRED_USE}
+ qemu_softmmu_targets_arm? ( fdt )
+ qemu_softmmu_targets_microblaze? ( fdt )
+ qemu_softmmu_targets_ppc? ( fdt )
+ qemu_softmmu_targets_ppc64? ( fdt )
+ static? ( static-softmmu static-user )
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk )
+ virtfs? ( xattr )"
+
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
+#
+# The attr lib isn't always linked in (although the USE flag is always
+# respected). This is because qemu supports using the C library's API
+# when available rather than always using the extranl library.
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ xattr? ( sys-apps/attr[static-libs(+)] )"
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
+ >=x11-libs/pixman-0.28.0[static-libs(+)]
+ aio? ( dev-libs/libaio[static-libs(+)] )
+ caps? ( sys-libs/libcap-ng[static-libs(+)] )
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
+ fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
+ infiniband? ( sys-infiniband/librdmacm[static-libs(+)] )
+ jpeg? ( virtual/jpeg[static-libs(+)] )
+ lzo? ( dev-libs/lzo:2[static-libs(+)] )
+ ncurses? ( sys-libs/ncurses[static-libs(+)] )
+ nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
+ numa? ( sys-process/numactl[static-libs(+)] )
+ png? ( media-libs/libpng[static-libs(+)] )
+ rbd? ( sys-cluster/ceph[static-libs(+)] )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
+ sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
+ seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
+ snappy? ( app-arch/snappy[static-libs(+)] )
+ spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] )
+ ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
+ tls? ( net-libs/gnutls[static-libs(+)] )
+ usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] )
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
+ vde? ( net-misc/vde[static-libs(+)] )
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
+X86_FIRMWARE_DEPEND="
+ >=sys-firmware/ipxe-1.0.0_p20130624
+ pin-upstream-blobs? (
+ ~sys-firmware/seabios-1.7.5
+ ~sys-firmware/sgabios-0.1_pre8
+ ~sys-firmware/vgabios-0.7a
+ )
+ !pin-upstream-blobs? (
+ sys-firmware/seabios
+ sys-firmware/sgabios
+ sys-firmware/vgabios
+ )"
+CDEPEND="!static-softmmu? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} )
+ !static-user? ( ${USER_LIB_DEPEND//\[static-libs(+)]} )
+ qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
+ qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
+ accessibility? ( app-accessibility/brltty )
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ bluetooth? ( net-wireless/bluez )
+ gtk? (
+ x11-libs/gtk+:3
+ x11-libs/vte:2.90
+ )
+ iscsi? ( net-libs/libiscsi )
+ opengl? ( virtual/opengl )
+ pulseaudio? ( media-sound/pulseaudio )
+ python? ( ${PYTHON_DEPS} )
+ sdl? ( media-libs/libsdl[X] )
+ smartcard? ( dev-libs/nss !app-emulation/libcacard )
+ spice? ( >=app-emulation/spice-protocol-0.12.3 )
+ systemtap? ( dev-util/systemtap )
+ usbredir? ( >=sys-apps/usbredir-0.6 )
+ virtfs? ( sys-libs/libcap )
+ xen? ( app-emulation/xen-tools )"
+DEPEND="${CDEPEND}
+ dev-lang/perl
+ =dev-lang/python-2*
+ sys-apps/texinfo
+ virtual/pkgconfig
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
+ gtk? ( nls? ( sys-devel/gettext ) )
+ static-softmmu? ( ${SOFTMMU_LIB_DEPEND} )
+ static-user? ( ${USER_LIB_DEPEND} )
+ test? (
+ dev-libs/glib[utils]
+ sys-devel/bc
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-qemu )
+"
+
+STRIP_MASK="/usr/share/qemu/palcode-clipper"
+
+QA_PREBUILT="
+ usr/share/qemu/openbios-ppc
+ usr/share/qemu/openbios-sparc64
+ usr/share/qemu/openbios-sparc32
+ usr/share/qemu/palcode-clipper
+ usr/share/qemu/s390-ccw.img
+ usr/share/qemu/u-boot.e500
+"
+
+QA_WX_LOAD="usr/bin/qemu-i386
+ usr/bin/qemu-x86_64
+ usr/bin/qemu-alpha
+ usr/bin/qemu-arm
+ usr/bin/qemu-cris
+ usr/bin/qemu-m68k
+ usr/bin/qemu-microblaze
+ usr/bin/qemu-microblazeel
+ usr/bin/qemu-mips
+ usr/bin/qemu-mipsel
+ usr/bin/qemu-or32
+ usr/bin/qemu-ppc
+ usr/bin/qemu-ppc64
+ usr/bin/qemu-ppc64abi32
+ usr/bin/qemu-sh4
+ usr/bin/qemu-sh4eb
+ usr/bin/qemu-sparc
+ usr/bin/qemu-sparc64
+ usr/bin/qemu-armeb
+ usr/bin/qemu-sparc32plus
+ usr/bin/qemu-s390x
+ usr/bin/qemu-unicore32"
+
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
+you have the kernel module loaded before running kvm. The easiest way to
+ensure that the kernel module is loaded is to load it on boot.\n
+For AMD CPUs the module is called 'kvm-amd'\n
+For Intel CPUs the module is called 'kvm-intel'\n
+Please review /etc/conf.d/modules for how to load these\n\n
+Make sure your user is in the 'kvm' group\n
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+qemu_support_kvm() {
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
+ use qemu_softmmu_targets_s390x; then
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is lt 2 6 25; then
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
+ elif use kernel_linux; then
+ if ! linux_config_exists; then
+ eerror "Unable to check your kernel for KVM support"
+ else
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
+ ERROR_KVM="You must enable KVM in your kernel to continue"
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
+ ERROR_KVM_AMD+=" your kernel configuration."
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
+ ERROR_TUN+=" into your kernel or loaded as a module to use the"
+ ERROR_TUN+=" virtual network device if using -net tap."
+ ERROR_BRIDGE="You will also need support for 802.1d"
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
+ ERROR_VHOST_NET+=" support"
+
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
+ fi
+
+ use python && CONFIG_CHECK+=" ~DEBUG_FS"
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat"
+
+ # Now do the actual checks setup above
+ check_extra_config
+ fi
+ fi
+
+ if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
+ eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
+ eerror "instances are still pointing to it. Please update your"
+ eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
+ eerror "and the right system binary (e.g. qemu-system-x86_64)."
+ die "update your virt configs to not use qemu-kvm"
+ fi
+}
+
+pkg_setup() {
+ enewgroup kvm 78
+}
+
+src_prepare() {
+ # Alter target makefiles to accept CFLAGS set via flag-o
+ sed -i -r \
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+ Makefile Makefile.target || die
+
+ # Cheap hack to disable gettext .mo generation.
+ use nls || rm -f po/*.po
+
+ epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
+ epatch "${FILESDIR}"/${PN}-2.1.1-readlink-self.patch
+ epatch "${FILESDIR}"/${PN}-2.1.2-vnc-sanitize-bits.patch #527088
+ epatch "${FILESDIR}"/${PN}-2.0.0-F_SHLCK-and-F_EXLCK.patch #for musl
+ epatch "${FILESDIR}"/${PN}-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch #for musl
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ # Fix ld and objcopy being called directly
+ tc-export AR LD OBJCOPY
+
+ # Verbose builds
+ MAKEOPTS+=" V=1"
+
+ epatch_user
+}
+
+##
+# configures qemu based on the build directory and the build type
+# we are using.
+#
+qemu_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local buildtype=$1
+ local builddir=$2
+ local static_flag="static-${buildtype}"
+
+ # audio options
+ local audio_opts="oss"
+ use alsa && audio_opts="alsa,${audio_opts}"
+ use sdl && audio_opts="sdl,${audio_opts}"
+ use pulseaudio && audio_opts="pa,${audio_opts}"
+
+ local conf_opts=(
+ --prefix=/usr
+ --sysconfdir=/etc
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}/html
+ --disable-bsd-user
+ --disable-guest-agent
+ --disable-strip
+ --disable-werror
+ --python="${PYTHON}"
+ --cc="$(tc-getCC)"
+ --cxx="$(tc-getCXX)"
+ --host-cc="$(tc-getBUILD_CC)"
+ $(use_enable debug debug-info)
+ $(use_enable debug debug-tcg)
+ --enable-docs
+ $(use_enable tci tcg-interpreter)
+ $(use_enable xattr attr)
+ )
+
+ # Disable options not used by user targets as the default configure
+ # options will autoprobe and try to link in a bunch of unused junk.
+ conf_softmmu() {
+ if [[ ${buildtype} == "user" ]] ; then
+ echo "--disable-${2:-$1}"
+ else
+ use_enable "$@"
+ fi
+ }
+ conf_opts+=(
+ $(conf_softmmu accessibility brlapi)
+ $(conf_softmmu aio linux-aio)
+ $(conf_softmmu bluetooth bluez)
+ $(conf_softmmu caps cap-ng)
+ $(conf_softmmu curl)
+ $(conf_softmmu fdt)
+ $(conf_softmmu glusterfs)
+ $(conf_softmmu gtk)
+ $(conf_softmmu infiniband rdma)
+ $(conf_softmmu iscsi libiscsi)
+ $(conf_softmmu jpeg vnc-jpeg)
+ $(conf_softmmu kernel_linux kvm)
+ $(conf_softmmu lzo)
+ $(conf_softmmu ncurses curses)
+ $(conf_softmmu nfs libnfs)
+ $(conf_softmmu numa)
+ $(conf_softmmu opengl glx)
+ $(conf_softmmu png vnc-png)
+ $(conf_softmmu rbd)
+ $(conf_softmmu sasl vnc-sasl)
+ $(conf_softmmu sdl)
+ $(conf_softmmu seccomp)
+ $(conf_softmmu smartcard smartcard-nss)
+ $(conf_softmmu snappy)
+ $(conf_softmmu spice)
+ $(conf_softmmu ssh libssh2)
+ $(conf_softmmu tls quorum)
+ $(conf_softmmu tls vnc-tls)
+ $(conf_softmmu tls vnc-ws)
+ $(conf_softmmu usb libusb)
+ $(conf_softmmu usbredir usb-redir)
+ $(conf_softmmu uuid)
+ $(conf_softmmu vde)
+ $(conf_softmmu vhost-net)
+ $(conf_softmmu virtfs)
+ $(conf_softmmu vnc)
+ $(conf_softmmu xen)
+ $(conf_softmmu xen xen-pci-passthrough)
+ $(conf_softmmu xfs xfsctl)
+ )
+
+ case ${buildtype} in
+ user)
+ conf_opts+=(
+ --enable-linux-user
+ --disable-system
+ --target-list="${user_targets}"
+ --disable-blobs
+ --disable-tools
+ )
+ ;;
+ softmmu)
+ conf_opts+=(
+ --disable-linux-user
+ --enable-system
+ --target-list="${softmmu_targets}"
+ --with-system-pixman
+ --audio-drv-list="${audio_opts}"
+ )
+ use gtk && conf_opts+=( --with-gtkabi=3.0 )
+ ;;
+ esac
+
+ # Add support for SystemTAP
+ use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
+
+ # We always want to attempt to build with PIE support as it results
+ # in a more secure binary. But it doesn't work with static or if
+ # the current GCC doesn't have PIE support.
+ if use ${static_flag}; then
+ conf_opts+=( --static --disable-pie )
+ else
+ gcc-specs-pie && conf_opts+=( --enable-pie )
+ fi
+
+ einfo "./configure ${conf_opts[*]}"
+ cd "${builddir}"
+ ../configure "${conf_opts[@]}" || die "configure failed"
+
+ # FreeBSD's kernel does not support QEMU assigning/grabbing
+ # host USB devices yet
+ use kernel_FreeBSD && \
+ sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
+}
+
+src_configure() {
+ local target
+
+ python_export_best
+
+ softmmu_targets= softmmu_bins=()
+ user_targets= user_bins=()
+
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do
+ if use "qemu_softmmu_targets_${target}"; then
+ softmmu_targets+=",${target}-softmmu"
+ softmmu_bins+=( "qemu-system-${target}" )
+ fi
+ done
+
+ for target in ${IUSE_USER_TARGETS} ; do
+ if use "qemu_user_targets_${target}"; then
+ user_targets+=",${target}-linux-user"
+ user_bins+=( "qemu-${target}" )
+ fi
+ done
+
+ [[ -n ${softmmu_targets} ]] && \
+ einfo "Building the following softmmu targets: ${softmmu_targets}"
+
+ [[ -n ${user_targets} ]] && \
+ einfo "Building the following user targets: ${user_targets}"
+
+ if [[ -n ${softmmu_targets} ]]; then
+ mkdir "${S}/softmmu-build"
+ qemu_src_configure "softmmu" "${S}/softmmu-build"
+ fi
+
+ if [[ -n ${user_targets} ]]; then
+ mkdir "${S}/user-build"
+ qemu_src_configure "user" "${S}/user-build"
+ fi
+}
+
+src_compile() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ default
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ default
+ fi
+}
+
+src_test() {
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ pax-mark m */qemu-system-* #515550
+ emake -j1 check
+ emake -j1 check-report.html
+ fi
+}
+
+qemu_python_install() {
+ python_domodule "${S}/scripts/qmp/qmp.py"
+
+ python_doscript "${S}/scripts/kvm/kvm_stat"
+ python_doscript "${S}/scripts/kvm/vmxcap"
+ python_doscript "${S}/scripts/qmp/qmp-shell"
+ python_doscript "${S}/scripts/qmp/qemu-ga-client"
+}
+
+src_install() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ emake DESTDIR="${ED}" install
+
+ # Install binfmt handler init script for user targets
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ emake DESTDIR="${ED}" install
+
+ # This might not exist if the test failed. #512010
+ [[ -e check-report.html ]] && dohtml check-report.html
+
+ if use kernel_linux; then
+ udev_dorules "${FILESDIR}"/65-kvm.rules
+ fi
+
+ if use python; then
+ python_foreach_impl qemu_python_install
+ fi
+ fi
+
+ # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
+ pushd "${ED}"/usr/bin >/dev/null
+ pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
+ popd >/dev/null
+
+ # Install config file example for qemu-bridge-helper
+ insinto "/etc/qemu"
+ doins "${FILESDIR}/bridge.conf"
+
+ # Remove the docdir placed qmp-commands.txt
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
+
+ cd "${S}"
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
+ newdoc pc-bios/README README.pc-bios
+ dodoc docs/qmp/*.txt
+
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one
+ rm "${ED}/usr/share/qemu/bios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
+ fi
+
+ # Remove vgabios since we're using the vgabios packaged one
+ if [[ -n ${softmmu_targets} ]]; then
+ rm "${ED}/usr/share/qemu/vgabios.bin"
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
+ fi
+
+ # Remove sgabios since we're using the sgabios packaged one
+ rm "${ED}/usr/share/qemu/sgabios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
+ fi
+
+ # Remove iPXE since we're using the iPXE packaged one
+ rm "${ED}"/usr/share/qemu/pxe-*.rom
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
+ fi
+ fi
+
+ qemu_support_kvm && readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ if qemu_support_kvm; then
+ readme.gentoo_print_elog
+ ewarn "Migration from qemu-kvm instances and loading qemu-kvm created"
+ ewarn "save states has been removed starting with the 1.6.2 release"
+ ewarn
+ ewarn "It is recommended that you migrate any VMs that may be running"
+ ewarn "on qemu-kvm to a host with a newer qemu and regenerate"
+ ewarn "any saved states with a newer qemu."
+ ewarn
+ ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x"
+
+ if use x86 || use amd64; then
+ ewarn
+ ewarn "The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer"
+ ewarn "installed. In order to use kvm acceleration, pass the flag"
+ ewarn "-enable-kvm when running your system target."
+ fi
+ fi
+
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
+ if use virtfs && [ -n "${softmmu_targets}" ]; then
+ local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
+ fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
+ fi
+}
+
+pkg_info() {
+ echo "Using:"
+ echo " $(best_version app-emulation/spice-protocol)"
+ echo " $(best_version sys-firmware/ipxe)"
+ echo " $(best_version sys-firmware/seabios)"
+ if has_version sys-firmware/seabios[binary]; then
+ echo " USE=binary"
+ else
+ echo " USE=''"
+ fi
+ echo " $(best_version sys-firmware/vgabios)"
+}
diff --git a/app-emulation/qemu/qemu-2.2.1-r99.ebuild b/app-emulation/qemu/qemu-2.2.1-r99.ebuild
new file mode 100644
index 00000000..5b8baf15
--- /dev/null
+++ b/app-emulation/qemu/qemu-2.2.1-r99.ebuild
@@ -0,0 +1,610 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu/qemu-2.2.1-r2.ebuild,v 1.3 2015/05/14 07:09:58 ago Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ncurses,readline"
+
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
+ user udev fcaps readme.gentoo pax-utils
+
+BACKPORTS=
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+ inherit git-2
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="amd64 ~ppc ~ppc64 x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
+
+LICENSE="GPL-2 LGPL-2 BSD-2"
+SLOT="0"
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
+gtk infiniband iscsi +jpeg \
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
++png pulseaudio python \
+rbd sasl +seccomp sdl selinux smartcard snappy spice ssh static static-softmmu \
+static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
+virtfs +vnc xattr xen xfs"
+
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
+x86_64"
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb xtensa xtensaeb"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 sparc32plus"
+
+use_targets="
+ $(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
+ $(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
+"
+IUSE+=" ${use_targets}"
+
+# Require at least one softmmu or user target.
+# Block USE flag configurations known to not work.
+REQUIRED_USE="|| ( ${use_targets} )
+ ${PYTHON_REQUIRED_USE}
+ qemu_softmmu_targets_arm? ( fdt )
+ qemu_softmmu_targets_microblaze? ( fdt )
+ qemu_softmmu_targets_ppc? ( fdt )
+ qemu_softmmu_targets_ppc64? ( fdt )
+ static? ( static-softmmu static-user )
+ static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk )
+ virtfs? ( xattr )"
+
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
+#
+# The attr lib isn't always linked in (although the USE flag is always
+# respected). This is because qemu supports using the C library's API
+# when available rather than always using the extranl library.
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
+ sys-libs/zlib[static-libs(+)]
+ xattr? ( sys-apps/attr[static-libs(+)] )"
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
+ >=x11-libs/pixman-0.28.0[static-libs(+)]
+ aio? ( dev-libs/libaio[static-libs(+)] )
+ caps? ( sys-libs/libcap-ng[static-libs(+)] )
+ curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
+ fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
+ infiniband? ( sys-infiniband/librdmacm:=[static-libs(+)] )
+ jpeg? ( virtual/jpeg:=[static-libs(+)] )
+ lzo? ( dev-libs/lzo:2[static-libs(+)] )
+ ncurses? ( sys-libs/ncurses[static-libs(+)] )
+ nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
+ numa? ( sys-process/numactl[static-libs(+)] )
+ png? ( media-libs/libpng:0=[static-libs(+)] )
+ rbd? ( sys-cluster/ceph[static-libs(+)] )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
+ sdl? ( >=media-libs/libsdl-1.2.11[static-libs(+)] )
+ seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
+ snappy? ( app-arch/snappy[static-libs(+)] )
+ spice? ( >=app-emulation/spice-0.12.0[static-libs(+)] )
+ ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
+ tls? ( net-libs/gnutls[static-libs(+)] )
+ usb? ( >=dev-libs/libusb-1.0.18[static-libs(+)] )
+ uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
+ vde? ( net-misc/vde[static-libs(+)] )
+ xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
+X86_FIRMWARE_DEPEND="
+ >=sys-firmware/ipxe-1.0.0_p20130624
+ pin-upstream-blobs? (
+ ~sys-firmware/seabios-1.7.5
+ ~sys-firmware/sgabios-0.1_pre8
+ ~sys-firmware/vgabios-0.7a
+ )
+ !pin-upstream-blobs? (
+ sys-firmware/seabios
+ sys-firmware/sgabios
+ sys-firmware/vgabios
+ )"
+CDEPEND="!static-softmmu? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} )
+ !static-user? ( ${USER_LIB_DEPEND//\[static-libs(+)]} )
+ qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
+ qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
+ accessibility? ( app-accessibility/brltty )
+ alsa? ( >=media-libs/alsa-lib-1.0.13 )
+ bluetooth? ( net-wireless/bluez )
+ gtk? (
+ x11-libs/gtk+:3
+ x11-libs/vte:2.90
+ )
+ iscsi? ( net-libs/libiscsi )
+ opengl? ( virtual/opengl )
+ pulseaudio? ( media-sound/pulseaudio )
+ python? ( ${PYTHON_DEPS} )
+ sdl? ( media-libs/libsdl[X] )
+ smartcard? ( dev-libs/nss !app-emulation/libcacard )
+ spice? ( >=app-emulation/spice-protocol-0.12.3 )
+ systemtap? ( dev-util/systemtap )
+ usbredir? ( >=sys-apps/usbredir-0.6 )
+ virtfs? ( sys-libs/libcap )
+ xen? ( app-emulation/xen-tools )"
+DEPEND="${CDEPEND}
+ dev-lang/perl
+ =dev-lang/python-2*
+ sys-apps/texinfo
+ virtual/pkgconfig
+ kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
+ gtk? ( nls? ( sys-devel/gettext ) )
+ static-softmmu? ( ${SOFTMMU_LIB_DEPEND} )
+ static-user? ( ${USER_LIB_DEPEND} )
+ test? (
+ dev-libs/glib[utils]
+ sys-devel/bc
+ )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-qemu )
+"
+
+STRIP_MASK="/usr/share/qemu/palcode-clipper"
+
+QA_PREBUILT="
+ usr/share/qemu/openbios-ppc
+ usr/share/qemu/openbios-sparc64
+ usr/share/qemu/openbios-sparc32
+ usr/share/qemu/palcode-clipper
+ usr/share/qemu/s390-ccw.img
+ usr/share/qemu/u-boot.e500
+"
+
+QA_WX_LOAD="usr/bin/qemu-i386
+ usr/bin/qemu-x86_64
+ usr/bin/qemu-alpha
+ usr/bin/qemu-arm
+ usr/bin/qemu-cris
+ usr/bin/qemu-m68k
+ usr/bin/qemu-microblaze
+ usr/bin/qemu-microblazeel
+ usr/bin/qemu-mips
+ usr/bin/qemu-mipsel
+ usr/bin/qemu-or32
+ usr/bin/qemu-ppc
+ usr/bin/qemu-ppc64
+ usr/bin/qemu-ppc64abi32
+ usr/bin/qemu-sh4
+ usr/bin/qemu-sh4eb
+ usr/bin/qemu-sparc
+ usr/bin/qemu-sparc64
+ usr/bin/qemu-armeb
+ usr/bin/qemu-sparc32plus
+ usr/bin/qemu-s390x
+ usr/bin/qemu-unicore32"
+
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
+you have the kernel module loaded before running kvm. The easiest way to
+ensure that the kernel module is loaded is to load it on boot.\n
+For AMD CPUs the module is called 'kvm-amd'\n
+For Intel CPUs the module is called 'kvm-intel'\n
+Please review /etc/conf.d/modules for how to load these\n\n
+Make sure your user is in the 'kvm' group\n
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+qemu_support_kvm() {
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
+ use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
+ use qemu_softmmu_targets_s390x; then
+ return 0
+ fi
+
+ return 1
+}
+
+pkg_pretend() {
+ if use kernel_linux && kernel_is lt 2 6 25; then
+ eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
+ elif use kernel_linux; then
+ if ! linux_config_exists; then
+ eerror "Unable to check your kernel for KVM support"
+ else
+ CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
+ ERROR_KVM="You must enable KVM in your kernel to continue"
+ ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
+ ERROR_KVM_AMD+=" your kernel configuration."
+ ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
+ ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
+ ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
+ ERROR_TUN+=" into your kernel or loaded as a module to use the"
+ ERROR_TUN+=" virtual network device if using -net tap."
+ ERROR_BRIDGE="You will also need support for 802.1d"
+ ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
+ use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
+ ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
+ ERROR_VHOST_NET+=" support"
+
+ if use amd64 || use x86 || use amd64-linux || use x86-linux; then
+ CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
+ fi
+
+ use python && CONFIG_CHECK+=" ~DEBUG_FS"
+ ERROR_DEBUG_FS="debugFS support required for kvm_stat"
+
+ # Now do the actual checks setup above
+ check_extra_config
+ fi
+ fi
+
+ if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
+ eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
+ eerror "instances are still pointing to it. Please update your"
+ eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
+ eerror "and the right system binary (e.g. qemu-system-x86_64)."
+ die "update your virt configs to not use qemu-kvm"
+ fi
+}
+
+pkg_setup() {
+ enewgroup kvm 78
+ python_setup
+}
+
+src_prepare() {
+ # Alter target makefiles to accept CFLAGS set via flag-o
+ sed -i -r \
+ -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+ Makefile Makefile.target || die
+
+ # Cheap hack to disable gettext .mo generation.
+ use nls || rm -f po/*.po
+
+ epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
+ epatch "${FILESDIR}"/${P}-CVE-2015-1779-1.patch #544328
+ epatch "${FILESDIR}"/${P}-CVE-2015-1779-2.patch #544328
+ epatch "${FILESDIR}"/${PN}-2.3.0-CVE-2015-3456.patch #549404
+
+ # Patching for musl
+ epatch "${FILESDIR}"/${PN}-2.0.0-F_SHLCK-and-F_EXLCK.patch
+ epatch "${FILESDIR}"/${PN}-2.0.0-linux-user-signal.c-define-__SIGRTMIN-MAX-for-non-GN.patch
+ epatch "${FILESDIR}"/${PN}-2.2.0-_sigev_un.patch
+
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ # Fix ld and objcopy being called directly
+ tc-export AR LD OBJCOPY
+
+ # Verbose builds
+ MAKEOPTS+=" V=1"
+
+ epatch_user
+}
+
+##
+# configures qemu based on the build directory and the build type
+# we are using.
+#
+qemu_src_configure() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ local buildtype=$1
+ local builddir=$2
+ local static_flag="static-${buildtype}"
+
+ # audio options
+ local audio_opts="oss"
+ use alsa && audio_opts="alsa,${audio_opts}"
+ use sdl && audio_opts="sdl,${audio_opts}"
+ use pulseaudio && audio_opts="pa,${audio_opts}"
+
+ local conf_opts=(
+ --prefix=/usr
+ --sysconfdir=/etc
+ --libdir=/usr/$(get_libdir)
+ --docdir=/usr/share/doc/${PF}/html
+ --disable-bsd-user
+ --disable-guest-agent
+ --disable-strip
+ --disable-werror
+ --python="${PYTHON}"
+ --cc="$(tc-getCC)"
+ --cxx="$(tc-getCXX)"
+ --host-cc="$(tc-getBUILD_CC)"
+ $(use_enable debug debug-info)
+ $(use_enable debug debug-tcg)
+ --enable-docs
+ $(use_enable tci tcg-interpreter)
+ $(use_enable xattr attr)
+ )
+
+ # Disable options not used by user targets as the default configure
+ # options will autoprobe and try to link in a bunch of unused junk.
+ conf_softmmu() {
+ if [[ ${buildtype} == "user" ]] ; then
+ echo "--disable-${2:-$1}"
+ else
+ use_enable "$@"
+ fi
+ }
+ conf_opts+=(
+ $(conf_softmmu accessibility brlapi)
+ $(conf_softmmu aio linux-aio)
+ $(conf_softmmu bluetooth bluez)
+ $(conf_softmmu caps cap-ng)
+ $(conf_softmmu curl)
+ $(conf_softmmu fdt)
+ $(conf_softmmu glusterfs)
+ $(conf_softmmu gtk)
+ $(conf_softmmu infiniband rdma)
+ $(conf_softmmu iscsi libiscsi)
+ $(conf_softmmu jpeg vnc-jpeg)
+ $(conf_softmmu kernel_linux kvm)
+ $(conf_softmmu lzo)
+ $(conf_softmmu ncurses curses)
+ $(conf_softmmu nfs libnfs)
+ $(conf_softmmu numa)
+ $(conf_softmmu opengl glx)
+ $(conf_softmmu png vnc-png)
+ $(conf_softmmu rbd)
+ $(conf_softmmu sasl vnc-sasl)
+ $(conf_softmmu sdl)
+ $(conf_softmmu seccomp)
+ $(conf_softmmu smartcard smartcard-nss)
+ $(conf_softmmu snappy)
+ $(conf_softmmu spice)
+ $(conf_softmmu ssh libssh2)
+ $(conf_softmmu tls quorum)
+ $(conf_softmmu tls vnc-tls)
+ $(conf_softmmu tls vnc-ws)
+ $(conf_softmmu usb libusb)
+ $(conf_softmmu usbredir usb-redir)
+ $(conf_softmmu uuid)
+ $(conf_softmmu vde)
+ $(conf_softmmu vhost-net)
+ $(conf_softmmu virtfs)
+ $(conf_softmmu vnc)
+ $(conf_softmmu xen)
+ $(conf_softmmu xen xen-pci-passthrough)
+ $(conf_softmmu xfs xfsctl)
+ )
+
+ case ${buildtype} in
+ user)
+ conf_opts+=(
+ --enable-linux-user
+ --disable-system
+ --target-list="${user_targets}"
+ --disable-blobs
+ --disable-tools
+ )
+ ;;
+ softmmu)
+ conf_opts+=(
+ --disable-linux-user
+ --enable-system
+ --target-list="${softmmu_targets}"
+ --with-system-pixman
+ --audio-drv-list="${audio_opts}"
+ )
+ use gtk && conf_opts+=( --with-gtkabi=3.0 )
+ ;;
+ esac
+
+ # Add support for SystemTAP
+ use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
+
+ # We always want to attempt to build with PIE support as it results
+ # in a more secure binary. But it doesn't work with static or if
+ # the current GCC doesn't have PIE support.
+ if use ${static_flag}; then
+ conf_opts+=( --static --disable-pie )
+ else
+ gcc-specs-pie && conf_opts+=( --enable-pie )
+ fi
+
+ einfo "../configure ${conf_opts[*]}"
+ cd "${builddir}"
+ ../configure "${conf_opts[@]}" || die "configure failed"
+
+ # FreeBSD's kernel does not support QEMU assigning/grabbing
+ # host USB devices yet
+ use kernel_FreeBSD && \
+ sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
+}
+
+src_configure() {
+ local target
+
+ python_export_best
+
+ softmmu_targets= softmmu_bins=()
+ user_targets= user_bins=()
+
+ for target in ${IUSE_SOFTMMU_TARGETS} ; do
+ if use "qemu_softmmu_targets_${target}"; then
+ softmmu_targets+=",${target}-softmmu"
+ softmmu_bins+=( "qemu-system-${target}" )
+ fi
+ done
+
+ for target in ${IUSE_USER_TARGETS} ; do
+ if use "qemu_user_targets_${target}"; then
+ user_targets+=",${target}-linux-user"
+ user_bins+=( "qemu-${target}" )
+ fi
+ done
+
+ [[ -n ${softmmu_targets} ]] && \
+ einfo "Building the following softmmu targets: ${softmmu_targets}"
+
+ [[ -n ${user_targets} ]] && \
+ einfo "Building the following user targets: ${user_targets}"
+
+ if [[ -n ${softmmu_targets} ]]; then
+ mkdir "${S}/softmmu-build"
+ qemu_src_configure "softmmu" "${S}/softmmu-build"
+ fi
+
+ if [[ -n ${user_targets} ]]; then
+ mkdir "${S}/user-build"
+ qemu_src_configure "user" "${S}/user-build"
+ fi
+}
+
+src_compile() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ default
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ default
+ fi
+}
+
+src_test() {
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ pax-mark m */qemu-system-* #515550
+ emake -j1 check
+ emake -j1 check-report.html
+ fi
+}
+
+qemu_python_install() {
+ python_domodule "${S}/scripts/qmp/qmp.py"
+
+ python_doscript "${S}/scripts/kvm/kvm_stat"
+ python_doscript "${S}/scripts/kvm/vmxcap"
+ python_doscript "${S}/scripts/qmp/qmp-shell"
+ python_doscript "${S}/scripts/qmp/qemu-ga-client"
+}
+
+src_install() {
+ if [[ -n ${user_targets} ]]; then
+ cd "${S}/user-build"
+ emake DESTDIR="${ED}" install
+
+ # Install binfmt handler init script for user targets
+ newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
+ fi
+
+ if [[ -n ${softmmu_targets} ]]; then
+ cd "${S}/softmmu-build"
+ emake DESTDIR="${ED}" install
+
+ # This might not exist if the test failed. #512010
+ [[ -e check-report.html ]] && dohtml check-report.html
+
+ if use kernel_linux; then
+ udev_dorules "${FILESDIR}"/65-kvm.rules
+ fi
+
+ if use python; then
+ python_foreach_impl qemu_python_install
+ fi
+ fi
+
+ # Disable mprotect on the qemu binaries as they use JITs to be fast #459348
+ pushd "${ED}"/usr/bin >/dev/null
+ pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
+ popd >/dev/null
+
+ # Install config file example for qemu-bridge-helper
+ insinto "/etc/qemu"
+ doins "${FILESDIR}/bridge.conf"
+
+ # Remove the docdir placed qmp-commands.txt
+ mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
+
+ cd "${S}"
+ dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
+ newdoc pc-bios/README README.pc-bios
+ dodoc docs/qmp/*.txt
+
+ # Remove SeaBIOS since we're using the SeaBIOS packaged one
+ rm "${ED}/usr/share/qemu/bios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
+ fi
+
+ # Remove vgabios since we're using the vgabios packaged one
+ if [[ -n ${softmmu_targets} ]]; then
+ rm "${ED}/usr/share/qemu/vgabios.bin"
+ rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
+ rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
+ rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
+ rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
+ dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
+ dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
+ dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
+ dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
+ fi
+
+ # Remove sgabios since we're using the sgabios packaged one
+ rm "${ED}/usr/share/qemu/sgabios.bin"
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
+ fi
+
+ # Remove iPXE since we're using the iPXE packaged one
+ rm "${ED}"/usr/share/qemu/pxe-*.rom
+ if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+ dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
+ dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
+ dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
+ dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
+ dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
+ dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
+ fi
+ fi
+
+ qemu_support_kvm && readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ if qemu_support_kvm; then
+ readme.gentoo_print_elog
+ ewarn "Migration from qemu-kvm instances and loading qemu-kvm created"
+ ewarn "save states has been removed starting with the 1.6.2 release"
+ ewarn
+ ewarn "It is recommended that you migrate any VMs that may be running"
+ ewarn "on qemu-kvm to a host with a newer qemu and regenerate"
+ ewarn "any saved states with a newer qemu."
+ ewarn
+ ewarn "qemu-kvm was the primary qemu provider in Gentoo through 1.2.x"
+
+ if use x86 || use amd64; then
+ ewarn
+ ewarn "The /usr/bin/kvm and /usr/bin/qemu-kvm wrappers are no longer"
+ ewarn "installed. In order to use kvm acceleration, pass the flag"
+ ewarn "-enable-kvm when running your system target."
+ fi
+ fi
+
+ if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
+ udev_reload
+ fi
+
+ fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
+ if use virtfs && [ -n "${softmmu_targets}" ]; then
+ local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
+ fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
+ fi
+}
+
+pkg_info() {
+ echo "Using:"
+ echo " $(best_version app-emulation/spice-protocol)"
+ echo " $(best_version sys-firmware/ipxe)"
+ echo " $(best_version sys-firmware/seabios)"
+ if has_version sys-firmware/seabios[binary]; then
+ echo " USE=binary"
+ else
+ echo " USE=''"
+ fi
+ echo " $(best_version sys-firmware/vgabios)"
+}
diff --git a/app-emulation/wine/Manifest b/app-emulation/wine/Manifest
new file mode 100644
index 00000000..7dcc72b9
--- /dev/null
+++ b/app-emulation/wine/Manifest
@@ -0,0 +1,15 @@
+AUX wine-1.4_rc2-multilib-portage.patch 1256 SHA256 9d0acd304d11d1bf73f56699754aaa1bfe1facba90648ee330fdbe08d9ff4938 SHA512 ac0b29e2b4c9b04bb6694a4e4da654446f68efbf90cda6809b45dad51e6679ac5410398763fde7e9505ef959493a037aa588cee58d14906563a4746702d2b0e9 WHIRLPOOL 8ea26266c327bc8313eca9b5d39c9741b226037750ca2d1d33262420093e05c306e7f004656c362c3c50b330d050cf9e5fceaa2b024a82809aae8b3617b0ae18
+AUX wine-1.5.19-file_h.patch 309 SHA256 e94e711bbee19bc152653183c89245a8615686838a8f5cdeee264a0d8464190f SHA512 3bb1463d4fea35d047a1abff99c7dd3bb5ed4e5b1d3b095139d118ea74c4813d39de6a28ca30f7cf24e40670fcca43f7ae5a71d5a5cad43806a7dfdfd8f431a7 WHIRLPOOL 519dee8641d0b03e9140aed954c05e2584bd41c1903b60a6fef9002a6c1f3211b8d213e66dead9f76647789f1fdbac62e0ec5d78b63a9cc98d96c9129573fec5
+AUX wine-1.5.19-getdents.patch 460 SHA256 85981b6fa8b5b980ffb9e3f1e4cd25af469b929020d6a7768d045a3ad43bfea3 SHA512 af114c50fa0ac1499515d1d0c5cbd28fada4a59a79b3f92ea2b994af0fb96d78a9b9a2ed4d241f4d403c4743864988245c3ec87dd4e6207a8c06792d576042bc WHIRLPOOL 8e9e620ae304442355eb4db0a4cf10e4c4a35993c87ebe17837d85285114f65147442378a7dacc7db16d77673835ff656e2043791befc8b5bfdd03542426263b
+AUX wine-1.5.26-winegcc.patch 1808 SHA256 91c1012059b93a421b2eae9f2ea46b7b327d6d3d58ba0cb47021c8a57f6d8228 SHA512 fce9daf40a96f4a7502c249a30107c8dfc5d8edd4a171b863d2bf14c3ad46d18e4c29932ab4a6ede7da5d589d777b962d2f577f5360ee4db8019d71362c51d47 WHIRLPOOL 71cbe36c6bac87071472541b7f5cd3ed1b08f05479bc0016262b3f86e75738e467dad197563b4898f2b24fd0ab4e27c40dce04f244a3e7f5ea1582b4db1c5cc2
+AUX wine-1.6-memset-O3.patch 695 SHA256 1f04496713e8a401ba068702c5c3e104b18635bfb54808e5641a3c48a9b9bad4 SHA512 ad7231f8dedf98f9e9b91fcb8bbe72a716d78285127b0c33396de0b1e17a191f91f9a4a377c0e90671bb5f4e57bfb087ef7e80c9537c6c73b3c9bb90b3885968 WHIRLPOOL 91689c31054b896609493e2b0b4fe67e3d752d889f4ccae9c3e15229543341998809fd19a2040457e04fbdbd45505f0f2b49052844004193872713053d7239f8
+AUX wine-1.6.2-ipx.patch 453 SHA256 db4eb14336e2bb57916fd0b1fe07e0db5515cf9bb2e9b99d0a8097da86e009dd SHA512 17117c5f0e48a7bf2b98d50f4b672b68fe07cb3b610329d279b2fe6b1077c6d0984af93a7105b4979cbb19dd984d07206446ef2158af98fe6492578a11b554ed WHIRLPOOL 46c7ba0855d75178e02fd6c55d2fcfb73708232bb0ceeb200c49d4a4c6dbf0c3eee99467fc42b939d3e9c5c81aff22a72f94c716ff4f75d15bf5aaf6e196aa87
+AUX wine-1.7.2-osmesa-check.patch 1740 SHA256 5264ac291435eb64c70cef4bdccbf8d4448472b4f014ab15ede35bcceebb6579 SHA512 4738a381923df7b45ea68092efb7ccb967907976d6d2f8bb0167af4211c377a73e296481b94092ac232f9ae09edf21447da92a134ebfff9b32acdd9e20340b95 WHIRLPOOL 95a90f8ff5a649833b39cb28de997c3b516cd09a53cf71d616c4fd412dfa6e71c47a1255a4d0597d85a62966cd9d6b9fae1c21c88e67d8650d31d414fca8fd42
+DIST wine-1.6.2.tar.bz2 21252985 SHA256 f0ab9eede5a0ccacbf6e50682649f9377b9199e49cf55641f1787cf72405acbe SHA512 81c83566dc2cab276ab7b9cfb5edc5fbca0f003dcb78044a0197c9a4d9a05a40f9045e5b4981c9219c3c39dab52fe519ef3cb338d79ee01e1fe66e3c056e8397 WHIRLPOOL 7d2d995a9996d63e17ff3ef5871f3818945dcd90c4a22798506f0d0c31ed999462bc5718f5cc562b9da64fdd7af6b240380bfa2901eabd23fb036aebfc7c554c
+DIST wine-gentoo-2013.06.24.tar.bz2 85442 SHA256 bfbf6b25e98f717320de2ede467e3628fbc749d936b8449f8477c9dc6f41e04b SHA512 b6819889314f6a6ea16c1332f4b177c43623116763969c31b23b61754cd304dd085f5d3eafbe847159331eb97dddd9b4c10699430129ea4a71da418c1fe175f0 WHIRLPOOL 227e0ac6569736d4ad5813cef49f775dae956f4fc9255de95753d5d3cba1bf6cf3db31d23d3702bb54d2e60c5a6f779b602f0efb2096e4c827c924565b273d00
+DIST wine-mono-0.0.8.msi 46967296 SHA256 3dfc23bbc29015e4e538dab8b83cb825d3248a0e5cf3b3318503ee7331115402 SHA512 d3009f2301b0a006136e880025a736f24612faa7a954956896124ec7282d35b678f02658e8be12b1c02ee217e594a2c728a9258c36ccb346b186a4781951adbd WHIRLPOOL 1d4b2e88ebab1f603326a238cc908982c7e135a33340087e8645572838d2b6034764e9fe787bb890792dea4c0531d26f9a6a811a7c200edb99ab82f975179389
+DIST wine_gecko-2.21-x86.msi 20871680 SHA256 f01fafa6d7aab995c38add77315c4cbc2f32f52d5d6a9350056f42b62d631fd8 SHA512 f4ca9ca5b876dc39e906991e58c6da8ef4103782f83ba781ff27556c0ebdab7fe10c14f0551e900442a5d57a2c619da6e5ed6ed42323edcdd55ce9789c4c83ac WHIRLPOOL d1db97175b047652499c97c968b71c08c5b44774423f22ae626f89b4dde3d03b46295e5caae228f1f8614209e943e8246854b478eef3abb186e8de4c341b0a0d
+DIST wine_gecko-2.21-x86_64.msi 21646336 SHA256 bc370bdc899f66d98f31c4d410a6952aa82c0c9c0a0ec27f2a11243c9b412c3f SHA512 2a48a7697beba4e45816a9eff09e181de353d8c93e02a70108fa77d27136cd5cd75b21c42caa7702a09f86544669ae2bbfc6975b1fc0d7fcb20150a4bc4ea514 WHIRLPOOL 2fce9b9a190a52c173551d47428dd8b8dc54d5878682733e0006a3f06f216cd9f47a88ada49f92fa5697ece8b2942a88f937bd2722b4cb85d2c35c19bda29b85
+DIST winepulse-patches-1.7.8.tar.bz2 49140 SHA256 0fd31ea7fec8817561a7b304bbfad6bdd014eb566b0c533e15773064bca555ad SHA512 18c88d4da37714d0216c01929eb92c99161fdf7024d8516512fc2585bc8d5a700fb1b5eb9fb667149e104305f366c867973f41b688a04f63e7cce76f5d85389a WHIRLPOOL 60dfeeb1d51c9ea7730ff1e9263d44fbcf3509e6ae68df1e3d30d965999f19525979f64617494bb1c3e1712c7117f30bebfbcbc75b1b08ba1f1e033720b0cacc
+EBUILD wine-1.6.2-r99.ebuild 12826 SHA256 4f302089b05c65462b349de65c089fa34284f54c026991bbd15e182ad7058e3b SHA512 8a6b8682e7bfa5630708700d163ec8b88d3fe7689d39b0656f9c1659498b350591639c317c3fad154b996cff68318ed34e35e848e5dd4acdf523f8f94c90724d WHIRLPOOL 0c3f9d00311831694fba9f617429b7d329a3c20e62b0619aff32389b2a0e6fb118d3e8a55ae4490955bcb782236b797f91654d378dcfc69b37d5d6c07301abc2
+MISC metadata.xml 1953 SHA256 2becaaae79e9ffafcc9684186dae88d35e8f539dd4df27905ff142ccc0967b05 SHA512 f0d2e74db8ea4ec5b054096dd5e1aa14b4bb2cb42e8ab0fdb09ebfd409be16fad40846eaac258fe09d97bedfd0923333c64726627c47b514ec4cb6ab9b6160b7 WHIRLPOOL b8792b59de097d4c9491c5b778ac0d9630766e1b57f804359a9765f2801c3d1071ce95fbb0bb2797d273c2e1cdd0c76bd30cff0dc3d79c426a3b4c56a1f8b0f0
diff --git a/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch b/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch
new file mode 100644
index 00000000..be6ffc56
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.4_rc2-multilib-portage.patch
@@ -0,0 +1,40 @@
+https://bugs.gentoo.org/show_bug.cgi?id=395615
+
+Explicitly add the required -m32/m64 to *FLAGS; this overrides any
+arch-specific -m* flags that may have been appended by multilib-portage.
+
+Even though -m32/m64 is now added to *FLAGS, -m32/m64 still has to be
+explicitly added to CC and CXX due to wine's build system. For example,
+winegcc saves the build-time value of CC and uses it at runtime.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -133,12 +133,18 @@
+ then
+ CC="$CC -m64"
+ CXX="$CXX -m64"
++ CFLAGS="$CFLAGS -m64"
++ LDFLAGS="$LDFLAGS -m64"
++ CXXFLAGS="$CXXFLAGS -m64"
+ host_cpu="x86_64"
+ notice_platform="64-bit "
+ AC_SUBST(TARGETFLAGS,"-m64")
+ else
+ CC="$CC -m32"
+ CXX="$CXX -m32"
++ CFLAGS="$CFLAGS -m32"
++ LDFLAGS="$LDFLAGS -m32"
++ CXXFLAGS="$CXXFLAGS -m32"
+ host_cpu="i386"
+ notice_platform="32-bit "
+ AC_SUBST(TARGETFLAGS,"-m32")
+@@ -150,6 +156,9 @@
+ then
+ CC="$CC -m32"
+ CXX="$CXX -m32"
++ CFLAGS="$CFLAGS -m32"
++ LDFLAGS="$LDFLAGS -m32"
++ CXXFLAGS="$CXXFLAGS -m32"
+ AC_MSG_CHECKING([whether $CC works])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM()],AC_MSG_RESULT([yes]),
+ [AC_MSG_RESULT([no])
diff --git a/app-emulation/wine/files/wine-1.5.19-file_h.patch b/app-emulation/wine/files/wine-1.5.19-file_h.patch
new file mode 100644
index 00000000..aa2aca4f
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.5.19-file_h.patch
@@ -0,0 +1,12 @@
+taken from sabotage linux
+--- wine-1.5.19/server/file.h 2012-12-07 19:17:32.000000000 +0000
++++ wine-1.5.19.patched/server/file.h 2012-12-19 03:29:07.092000002 +0000
+@@ -22,7 +22,7 @@
+ #define __WINE_SERVER_FILE_H
+
+ #include "object.h"
+-
++#include <fcntl.h>
+ struct fd;
+ struct mapping;
+ struct async_queue;
diff --git a/app-emulation/wine/files/wine-1.5.19-getdents.patch b/app-emulation/wine/files/wine-1.5.19-getdents.patch
new file mode 100644
index 00000000..b1b5dad0
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.5.19-getdents.patch
@@ -0,0 +1,12 @@
+taken from sabotage linux
+--- wine-1.5.19/dlls/ntdll/directory.c 2012-12-07 19:17:32.000000000 +0000
++++ wine-1.5.19.patched/dlls/ntdll/directory.c 2012-12-19 04:47:29.148000002 +0000
+@@ -119,7 +119,7 @@
+ char d_name[256];
+ } KERNEL_DIRENT64;
+
+-static inline int getdents64( int fd, char *de, unsigned int size )
++static inline int BUG_getdents64( int fd, char *de, unsigned int size )
+ {
+ return syscall( SYS_getdents64, fd, de, size );
+ }
diff --git a/app-emulation/wine/files/wine-1.5.26-winegcc.patch b/app-emulation/wine/files/wine-1.5.26-winegcc.patch
new file mode 100644
index 00000000..2045e343
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.5.26-winegcc.patch
@@ -0,0 +1,59 @@
+http://bugs.gentoo.org/260726
+
+diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
+index 16b4165..5c77267 100644
+--- a/tools/winebuild/main.c
++++ b/tools/winebuild/main.c
+@@ -48,10 +48,13 @@ int link_ext_symbols = 0;
+ int force_pointer_size = 0;
+ int unwind_tables = 0;
+
++#undef FORCE_POINTER_SIZE
+ #ifdef __i386__
+ enum target_cpu target_cpu = CPU_x86;
++#define FORCE_POINTER_SIZE
+ #elif defined(__x86_64__)
+ enum target_cpu target_cpu = CPU_x86_64;
++#define FORCE_POINTER_SIZE
+ #elif defined(__powerpc__)
+ enum target_cpu target_cpu = CPU_POWERPC;
+ #elif defined(__arm__)
+@@ -611,6 +614,10 @@ int main(int argc, char **argv)
+ signal( SIGTERM, exit_on_signal );
+ signal( SIGINT, exit_on_signal );
+
++#ifdef FORCE_POINTER_SIZE
++ force_pointer_size = sizeof(size_t);
++#endif
++
+ output_file = stdout;
+ argv = parse_options( argc, argv, spec );
+
+diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
+index 06aa200..c44d2e3 100644
+--- a/tools/winegcc/winegcc.c
++++ b/tools/winegcc/winegcc.c
+@@ -213,10 +213,13 @@ struct options
+ strarray* files;
+ };
+
++#undef FORCE_POINTER_SIZE
+ #ifdef __i386__
+ static const enum target_cpu build_cpu = CPU_x86;
++#define FORCE_POINTER_SIZE
+ #elif defined(__x86_64__)
+ static const enum target_cpu build_cpu = CPU_x86_64;
++#define FORCE_POINTER_SIZE
+ #elif defined(__powerpc__)
+ static const enum target_cpu build_cpu = CPU_POWERPC;
+ #elif defined(__arm__)
+@@ -1258,6 +1261,9 @@ int main(int argc, char **argv)
+ opts.linker_args = strarray_alloc();
+ opts.compiler_args = strarray_alloc();
+ opts.winebuild_args = strarray_alloc();
++#ifdef FORCE_POINTER_SIZE
++ opts.force_pointer_size = sizeof(size_t);
++#endif
+
+ /* determine the processor type */
+ if (strendswith(argv[0], "winecpp")) opts.processor = proc_cpp;
diff --git a/app-emulation/wine/files/wine-1.6-memset-O3.patch b/app-emulation/wine/files/wine-1.6-memset-O3.patch
new file mode 100644
index 00000000..75372f86
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.6-memset-O3.patch
@@ -0,0 +1,21 @@
+Avoid "undefined reference to `memset'" error when building with
+USE=custom-cflags and -O3 in CFLAGS with gcc-4.8.
+
+See:
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888
+http://bugs.winehq.org/show_bug.cgi?id=33521
+https://bugs.gentoo.org/show_bug.cgi?id=480508
+
+diff --git a/configure.ac b/configure.ac
+index d8033cf..fe7cc7d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1767,6 +1767,7 @@ then
+
+ dnl Check for some compiler flags
+ WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")])
++ WINE_TRY_CFLAGS([-fno-tree-loop-distribute-patterns])
+ WINE_TRY_CFLAGS([-fno-strict-aliasing])
+ dnl clang needs to be told to fail on unknown options
+ saved_CFLAGS=$CFLAGS
diff --git a/app-emulation/wine/files/wine-1.6.2-ipx.patch b/app-emulation/wine/files/wine-1.6.2-ipx.patch
new file mode 100644
index 00000000..9b515b4c
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.6.2-ipx.patch
@@ -0,0 +1,20 @@
+--- a/wine-1.6.2/dlls/ws2_32/socket.c
++++ b/wine-1.6.2/dlls/ws2_32/socket.c
+@@ -2835,7 +2835,7 @@
+ return SOCKET_ERROR;
+ } /* end switch(optname) */
+ }/* end case WS_SOL_SOCKET */
+-#ifdef HAS_IPX
++#if 0
+ case NSPROTO_IPX:
+ {
+ struct WS_sockaddr_ipx addr;
+@@ -4372,7 +4372,7 @@
+ }
+ break; /* case WS_SOL_SOCKET */
+
+-#ifdef HAS_IPX
++#if 0
+ case NSPROTO_IPX:
+ switch(optname)
+ {
diff --git a/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch b/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch
new file mode 100644
index 00000000..e20ea2c2
--- /dev/null
+++ b/app-emulation/wine/files/wine-1.7.2-osmesa-check.patch
@@ -0,0 +1,38 @@
+From b7eb1ff48dd1210aa3e1002afc503d5df75d50b9 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 7 Aug 2012 01:29:01 -0400
+Subject: [PATCH] Do not check for libGL symbols when checking libOSMesa
+
+If mesa had been built with shared glapi, glAccum is not available in
+libOSMesa without explicitly linking to libGL. In addition, in
+mesa-8.0.x and earlier, libOSMesa needs to be explicitly linked to
+libglapi if mesa was built with shared glapi, see
+https://bugs.gentoo.org/show_bug.cgi?id=399813
+And in mesa-8.1.x, libOSMesa in addition needs libdl, libpthread, and
+libstdc++, see https://bugs.gentoo.org/show_bug.cgi?id=431832
+---
+ configure.ac | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 66b4dd6..0303d87 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1213,7 +1213,13 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c
+
+ if test "x$with_osmesa" != "xno"
+ then
+- WINE_CHECK_SONAME(OSMesa,glAccum,,,[$X_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[$X_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ if test "x$ac_cv_lib_soname_OSMesa" = "x"; then
++ osmesa_save_CC=$CC
++ CC=$CXX
++ WINE_CHECK_SONAME(OSMesa,OSMesaCreateContext,,,[-lglapi -lpthread -ldl $X_LIBS $XLIB -lm $X_EXTRA_LIBS])
++ CC=$osmesa_save_CC
++ fi
+ WINE_NOTICE_WITH(osmesa,[test "x$ac_cv_lib_soname_OSMesa" = "x"],
+ [libOSMesa ${notice_platform}development files not found (or too old), OpenGL rendering in bitmaps won't be supported.])
+ fi
+--
+1.8.3.2
+
diff --git a/app-emulation/wine/metadata.xml b/app-emulation/wine/metadata.xml
new file mode 100644
index 00000000..86bc416d
--- /dev/null
+++ b/app-emulation/wine/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>wine</herd>
+<longdescription>
+Wine is an Open Source implementation of the Windows API on top of X and Unix.
+
+Think of Wine as a compatibility layer for running Windows programs. Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code, however Wine can optionally use native Windows DLLs if they are available. Wine provides both a development toolkit for porting Windows source code to Unix as well as a program loader, allowing many unmodified Windows programs to run on x86-based Unixes, including Linux, FreeBSD, and Solaris.
+</longdescription>
+<use>
+ <flag name='capi'>Enable ISDN support via CAPI</flag>
+ <flag name='custom-cflags'>Bypass strip-flags; use at your own peril</flag>
+ <flag name='dos'>Pull in <pkg>games-emulation/dosbox</pkg> to run DOS applications</flag>
+ <flag name='gecko'>Add support for the Gecko engine when using iexplore</flag>
+ <flag name='mono'>Add support for .NET using Wine's Mono add-on</flag>
+ <flag name='opencl'>Enable OpenCL support</flag>
+ <flag name='osmesa'>Add support for OpenGL in bitmaps using libOSMesa</flag>
+ <flag name='perl'>Install helpers written in perl (winedump/winemaker)</flag>
+ <flag name='prelink'>Run prelink on DLLs during build -- do not disable if you do not know what this means as it can break things at runtime</flag>
+ <flag name='realtime'>Pull in <pkg>sys-auth/rtkit</pkg> for low-latency pulseaudio support</flag>
+ <flag name='run-exes'>Use Wine to open and run .EXE and .MSI files</flag>
+ <flag name='samba'>Add support for NTLM auth. see
+ http://wiki.winehq.org/NtlmAuthSetupGuide and
+ http://wiki.winehq.org/NtlmSigningAndSealing</flag>
+ <flag name='udisks'>Support dynamic storage devices using <pkg>sys-fs/udisks</pkg></flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/wine/wine-1.6.2-r99.ebuild b/app-emulation/wine/wine-1.6.2-r99.ebuild
new file mode 100644
index 00000000..ea68ee21
--- /dev/null
+++ b/app-emulation/wine/wine-1.6.2-r99.ebuild
@@ -0,0 +1,443 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/wine/wine-1.6.2.ebuild,v 1.3 2014/03/12 05:16:55 phajdan.jr Exp $
+
+EAPI="5"
+
+AUTOTOOLS_AUTORECONF=1
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools-multilib eutils fdo-mime flag-o-matic gnome2-utils l10n multilib pax-utils toolchain-funcs virtualx
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://source.winehq.org/git/wine.git"
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ MY_P="${PN}-${PV/_/-}"
+ SRC_URI="mirror://sourceforge/${PN}/Source/${MY_P}.tar.bz2"
+ KEYWORDS="-* x86"
+ S=${WORKDIR}/${MY_P}
+fi
+
+GV="2.21"
+MV="0.0.8"
+PULSE_PATCHES="winepulse-patches-1.7.8"
+WINE_GENTOO="wine-gentoo-2013.06.24"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+ gecko? (
+ abi_x86_32? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86.msi )
+ abi_x86_64? ( mirror://sourceforge/${PN}/Wine%20Gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ )
+ mono? ( mirror://sourceforge/${PN}/Wine%20Mono/${MV}/wine-mono-${MV}.msi )
+ pulseaudio? ( http://dev.gentoo.org/~tetromino/distfiles/${PN}/${PULSE_PATCHES}.tar.bz2 )
+ http://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg lcms ldap +mono mp3 ncurses nls odbc openal opencl +opengl osmesa oss +perl +png +prelink pulseaudio +realtime +run-exes samba scanner selinux +ssl test +threads +truetype +udisks v4l +X xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+ test? ( abi_x86_32 )
+ elibc_glibc? ( threads )
+ mono? ( abi_x86_32 )
+ osmesa? ( opengl )" #286560
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+NATIVE_DEPEND="
+ truetype? ( >=media-libs/freetype-2.0.0 )
+ capi? ( net-dialup/capi4k-utils )
+ ncurses? ( >=sys-libs/ncurses-5.2:= )
+ udisks? ( sys-apps/dbus )
+ fontconfig? ( media-libs/fontconfig:= )
+ gphoto2? ( media-libs/libgphoto2:= )
+ openal? ( media-libs/openal:= )
+ gstreamer? ( media-libs/gstreamer:0.10 media-libs/gst-plugins-base:0.10 )
+ X? (
+ x11-libs/libXcursor
+ x11-libs/libXext
+ x11-libs/libXrandr
+ x11-libs/libXi
+ x11-libs/libXxf86vm
+ )
+ xinerama? ( x11-libs/libXinerama )
+ alsa? ( media-libs/alsa-lib )
+ cups? ( net-print/cups:= )
+ opencl? ( virtual/opencl )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )
+ gsm? ( media-sound/gsm:= )
+ jpeg? ( virtual/jpeg:0= )
+ ldap? ( net-nds/openldap:= )
+ lcms? ( media-libs/lcms:2= )
+ mp3? ( >=media-sound/mpg123-1.5.0 )
+ nls? ( sys-devel/gettext )
+ odbc? ( dev-db/unixODBC:= )
+ osmesa? ( media-libs/mesa[osmesa] )
+ pulseaudio? ( media-sound/pulseaudio )
+ xml? ( dev-libs/libxml2 dev-libs/libxslt )
+ scanner? ( media-gfx/sane-backends:= )
+ ssl? ( net-libs/gnutls:= )
+ png? ( media-libs/libpng:0= )
+ v4l? ( media-libs/libv4l )
+ xcomposite? ( x11-libs/libXcomposite )"
+
+COMMON_DEPEND="
+ !amd64? ( ${NATIVE_DEPEND} )
+ amd64? (
+ abi_x86_64? ( ${NATIVE_DEPEND} )
+ abi_x86_32? (
+ truetype? ( || (
+ >=app-emulation/emul-linux-x86-xlibs-2.1[development]
+ >=media-libs/freetype-2.0.0[abi_x86_32]
+ ) )
+ ncurses? ( || (
+ app-emulation/emul-linux-x86-baselibs[development]
+ sys-libs/ncurses[abi_x86_32]
+ ) )
+ udisks? ( || (
+ >=app-emulation/emul-linux-x86-baselibs-20130224[development]
+ sys-apps/dbus[abi_x86_32]
+ ) )
+ fontconfig? ( || (
+ app-emulation/emul-linux-x86-xlibs[development]
+ media-libs/fontconfig[abi_x86_32]
+ ) )
+ gphoto2? (
+ app-emulation/emul-linux-x86-medialibs[development]
+ )
+ openal? ( || (
+ app-emulation/emul-linux-x86-sdl[development]
+ media-libs/openal[abi_x86_32]
+ ) )
+ gstreamer? (
+ app-emulation/emul-linux-x86-gstplugins
+ app-emulation/emul-linux-x86-medialibs[development]
+ )
+ X? ( || (
+ app-emulation/emul-linux-x86-xlibs[development]
+ (
+ x11-libs/libXcursor[abi_x86_32]
+ x11-libs/libXext[abi_x86_32]
+ x11-libs/libXrandr[abi_x86_32]
+ x11-libs/libXi[abi_x86_32]
+ x11-libs/libXxf86vm[abi_x86_32]
+ )
+ ) )
+ xinerama? ( || (
+ app-emulation/emul-linux-x86-xlibs[development]
+ x11-libs/libXinerama[abi_x86_32]
+ ) )
+ alsa? ( || (
+ app-emulation/emul-linux-x86-soundlibs[alsa,development]
+ media-libs/alsa-lib[abi_x86_32]
+ ) )
+ cups? ( app-emulation/emul-linux-x86-baselibs )
+ opencl? ( virtual/opencl[abi_x86_32] )
+ opengl? ( || (
+ app-emulation/emul-linux-x86-opengl[development]
+ (
+ virtual/glu[abi_x86_32]
+ virtual/opengl[abi_x86_32]
+ )
+ ) )
+ gsm? ( || (
+ app-emulation/emul-linux-x86-soundlibs[development]
+ media-sound/gsm[abi_x86_32]
+ ) )
+ jpeg? ( || (
+ app-emulation/emul-linux-x86-baselibs[development]
+ virtual/jpeg:0[abi_x86_32]
+ ) )
+ ldap? ( app-emulation/emul-linux-x86-baselibs[development] )
+ lcms? ( || (
+ app-emulation/emul-linux-x86-baselibs[development]
+ media-libs/lcms:2[abi_x86_32]
+ ) )
+ mp3? ( || (
+ app-emulation/emul-linux-x86-soundlibs[development]
+ >=media-sound/mpg123-1.5.0[abi_x86_32]
+ ) )
+ nls? ( || (
+ app-emulation/emul-linux-x86-baselibs[development]
+ sys-devel/gettext[abi_x86_32]
+ ) )
+ odbc? ( app-emulation/emul-linux-x86-db[development] )
+ osmesa? ( || (
+ >=app-emulation/emul-linux-x86-opengl-20121028[development]
+ media-libs/mesa[osmesa,abi_x86_32]
+ ) )
+ pulseaudio? ( || (
+ app-emulation/emul-linux-x86-soundlibs[development]
+ >=media-sound/pulseaudio-4.0-r1[abi_x86_32]
+ ) )
+ xml? ( || (
+ >=app-emulation/emul-linux-x86-baselibs-20130224[development]
+ (
+ dev-libs/libxml2[abi_x86_32]
+ dev-libs/libxslt[abi_x86_32]
+ )
+ ) )
+ scanner? ( app-emulation/emul-linux-x86-medialibs[development] )
+ ssl? ( app-emulation/emul-linux-x86-baselibs[development] )
+ png? ( || (
+ app-emulation/emul-linux-x86-baselibs[development]
+ media-libs/libpng:0[abi_x86_32]
+ ) )
+ v4l? ( || (
+ app-emulation/emul-linux-x86-medialibs[development]
+ media-libs/libv4l[abi_x86_32]
+ ) )
+ xcomposite? ( || (
+ app-emulation/emul-linux-x86-xlibs[development]
+ x11-libs/libXcomposite[abi_x86_32]
+ ) )
+ )
+ )"
+
+RDEPEND="${COMMON_DEPEND}
+ dos? ( games-emulation/dosbox )
+ perl? ( dev-lang/perl dev-perl/XML-Simple )
+ samba? ( >=net-fs/samba-3.0.25 )
+ selinux? ( sec-policy/selinux-wine )
+ udisks? ( sys-fs/udisks:2 )
+ pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+
+DEPEND="${COMMON_DEPEND}
+ amd64? ( abi_x86_32? ( !abi_x86_64? ( ${NATIVE_DEPEND} ) ) )
+ X? (
+ x11-proto/inputproto
+ x11-proto/xextproto
+ x11-proto/xf86vidmodeproto
+ )
+ xinerama? ( x11-proto/xineramaproto )
+ prelink? ( sys-devel/prelink )
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
+ sys-devel/flex"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+ if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
+ eerror "You need gcc-4.4+ to build 64-bit wine"
+ eerror
+ return 1
+ fi
+
+ if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
+ eerror
+ return 1
+ fi
+}
+
+pkg_pretend() {
+ wine_build_environment_check || die
+}
+
+pkg_setup() {
+ wine_build_environment_check || die
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ else
+ unpack ${MY_P}.tar.bz2
+ fi
+
+ use pulseaudio && unpack "${PULSE_PATCHES}.tar.bz2"
+ unpack "${WINE_GENTOO}.tar.bz2"
+
+ l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+ local md5="$(md5sum server/protocol.def)"
+ local PATCHES=(
+ "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+ "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
+ "${FILESDIR}"/${PN}-1.7.2-osmesa-check.patch #429386
+ "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+ "${FILESDIR}"/${PN}-1.5.19-getdents.patch #for musl
+ "${FILESDIR}"/${PN}-1.5.19-file_h.patch #for musl
+ "${FILESDIR}"/${PN}-1.6.2-ipx.patch #for musl
+ )
+ use pulseaudio && PATCHES+=(
+ "../${PULSE_PATCHES}"/*.patch #421365
+ )
+
+ autotools-utils_src_prepare
+
+ if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+ einfo "server/protocol.def was patched; running tools/make_requests"
+ tools/make_requests || die #432348
+ fi
+ sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+ if ! use run-exes; then
+ sed -i '/^MimeType/d' tools/wine.desktop || die #117785
+ fi
+
+ # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+ cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+ l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+do_configure() {
+ local myeconfargs=( "${myeconfargs[@]}" )
+
+ if use amd64; then
+ if [[ ${ABI} == amd64 ]]; then
+ myeconfargs+=( --enable-win64 )
+ else
+ myeconfargs+=( --disable-win64 )
+ fi
+
+ # Note: using --with-wine64 results in problems with multilib.eclass
+ # CC/LD hackery. We're using separate tools instead.
+ fi
+
+ autotools-utils_src_configure
+}
+
+src_configure() {
+ export LDCONFIG=/bin/true
+ use custom-cflags || strip-flags
+
+ append-cppflags -DNETDB_INTERNAL=-1
+
+ local myeconfargs=( # common
+ --sysconfdir=/etc/wine
+ $(use_with alsa)
+ $(use_with capi)
+ $(use_with lcms cms)
+ $(use_with cups)
+ $(use_with ncurses curses)
+ $(use_with udisks dbus)
+ $(use_with fontconfig)
+ $(use_with ssl gnutls)
+ $(use_with gphoto2 gphoto)
+ $(use_with gsm)
+ $(use_with gstreamer)
+ --without-hal
+ $(use_with jpeg)
+ $(use_with ldap)
+ $(use_with mp3 mpg123)
+ $(use_with nls gettext)
+ $(use_with openal)
+ $(use_with opencl)
+ $(use_with opengl)
+ $(use_with osmesa)
+ $(use_with oss)
+ $(use_with png)
+ $(use_with threads pthread)
+ $(use_with scanner sane)
+ $(use_enable test tests)
+ $(use_with truetype freetype)
+ $(use_with v4l)
+ $(use_with X x)
+ $(use_with xcomposite)
+ $(use_with xinerama)
+ $(use_with xml)
+ $(use_with xml xslt)
+ )
+
+ use pulseaudio && myeconfargs+=( --with-pulse )
+
+ if use amd64 && use abi_x86_32; then
+ # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+ # set AR and RANLIB to make QA scripts happy; #483342
+ tc-export PKG_CONFIG AR RANLIB
+ fi
+
+ multilib_parallel_foreach_abi do_configure
+}
+
+src_compile() {
+ autotools-multilib_src_compile depend
+ autotools-multilib_src_compile all
+}
+
+src_test() {
+ if [[ $(id -u) == 0 ]]; then
+ ewarn "Skipping tests since they cannot be run under the root user."
+ ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+ return
+ fi
+
+ # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+ multilib_toolchain_setup x86
+ local BUILD_DIR="${S}-${ABI}"
+ cd "${BUILD_DIR}" || die
+ WINEPREFIX="${T}/.wine-${ABI}" Xemake test
+}
+
+src_install() {
+ local DOCS=( ANNOUNCE AUTHORS README )
+ add_locale_docs() {
+ local locale_doc="documentation/README.$1"
+ [[ ! -e ${locale_doc} ]] || DOCS=( "${DOCS[@]}" ${locale_doc} )
+ }
+ l10n_for_each_locale_do add_locale_docs
+ autotools-multilib_src_install
+
+ emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+ if use gecko ; then
+ insinto /usr/share/wine/gecko
+ use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+ use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+ fi
+ if use mono ; then
+ insinto /usr/share/wine/mono
+ doins "${DISTDIR}"/wine-mono-${MV}.msi
+ fi
+ if ! use perl ; then
+ rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+ fi
+
+ use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+ use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+ if use abi_x86_64 && ! use abi_x86_32; then
+ dosym /usr/bin/wine{64,} # 404331
+ dosym /usr/bin/wine{64,}-preloader
+ fi
+
+ # respect LINGUAS when installing man pages, #469418
+ for l in de fr pl; do
+ use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+ done
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+}
diff --git a/app-office/libreoffice/Manifest b/app-office/libreoffice/Manifest
new file mode 100644
index 00000000..e5d64887
--- /dev/null
+++ b/app-office/libreoffice/Manifest
@@ -0,0 +1,22 @@
+AUX libreoffice-4.3.5.2-remove-bashisms.patch 1330 SHA256 b477a07738fae7dadd324f1b792707cdda35b1f477cee43386b8a71ddbd090ea SHA512 850c1a252b141c6b32737f12766d7d6d9f0028eddcbc0b63bcfcaa70555a3a23f9e798c339176188c56e3769c1583a0b8c78feeade4f1120b0ddb2d02e2de6ed WHIRLPOOL ae5b0febeee433b82a55e130625ec52f8dbd859dfa39e4130ec16d7ca2deef061bd9c8a34e9ce96fdf3c6b18bf4c5fa48a382dfb7c22c069678ebaffd4252cba
+AUX libreoffice-4.4-system-pyuno.patch 1598 SHA256 444ba9a06a548952cd82f7ea2ff17e5bd7b04788dc894ef5376bf3440749de9e SHA512 043c78f923b941a1e8985ee16d8e6b23859207eac0f4fdc52fedbce0103d62309aa7aae14e19f8bb26bef9d4213dee9871fcc3770f99be84f3405573e32ced78 WHIRLPOOL 51f85f39847a587551b6887362557771a81b6abc59b926eace36f8e2eb61cd4895486c28d44fe38e77fc1b77b0ed4e142d65f4793bf2161c9d0c5c0abeca07f7
+AUX libreoffice-4.4.0.3-gcc-4.9-Os-link-failure.patch 4304 SHA256 33c662ee9a0645b2827c3810f373b5fd84eafbfc9a0fb434cc8d0973daa4ae13 SHA512 6f001ce7dbca593a9c1c91e375df7e0631c2bdf87f84b3ec03fcfb460a698beaa2e99d5a79669aa2de549c47ba8faeb74947d855685db4475fd6f818ac38c5f2 WHIRLPOOL 488b28df2db267affcbe4b6ec956312b7da52d3deb51f64ee2e49388b2f29909c9994a8f597727a72383c81973c115539a8a47d74f5efeaa370aee2eada8367f
+AUX libreoffice-4.4.0.3-telepathy-build-fix.patch 1503 SHA256 d23431960aa3898331b0e80f827c2eb224c3586bdaf9d2bb9dc10e2aa58ae6f3 SHA512 cf76698e851e31646ad7e6f9547d8c0917a047fa93b5132d00f0ea246945344f3e1df2376a9e3ffcd7ee7a4a200e24e213330482fddf50fc47558b5a9b949426 WHIRLPOOL 92e870da0ea77954d2b04e39887909a0cf20fe4277388be0074c01fac5c7adfa1cfed84333b3e7ae26f7866082bb1711ba453f877b8bc2b390d74a17d41830c0
+AUX libreoffice-4.4.1.2-add-kde4-open-url-script.patch 2144 SHA256 d35630cffc304652ad4e7df6d88dbd2ea499ae7a904a6b4c6a7eec9570ebee23 SHA512 2999f66d65e50cd06f8df1a48727407a6f4d0259d5d7dffedb3b750ed4876f93374b1a1a0aaa7d8e223e3a25ccbf05ca05d1a919fe36fc0eee0f7cd956a5949d WHIRLPOOL dbdd05bd29dcc37c94ee67ba4b1856b970a735af2ee3a468440f1edcb760a008fef2f62fb43ce2fef3626953786456652c8b606dea2b24650c72c1be66a976ef
+AUX libreoffice-4.4.1.2-fix-includes.patch 1149 SHA256 2044d4c997472a46e95c68fa8bec19c1424e9074fad05df9f1c0d220dec00281 SHA512 15defc8362fb0e53db32b75d9c4ece73e1ee8bd1cc05b4dd8f072f808e6943b385a5415513b237d3daa130dedce3c6ac6370e05ec0b4a25065ce27aadd269e92 WHIRLPOOL a643af5504f09003409cdbb4e9445481b448fc67c35ef5dc2e35a71301b138c3007e1d78f4bac6128137e37c41d4c6363447eeee44b6aeba8ac68729e4661ea7
+AUX libreoffice-4.4.1.2-improve-KDE4FilePicker.patch 5561 SHA256 b9ff37b20bd73011cda137d1dce5ef87c79972718019ae16e525bf5c1fd9cc56 SHA512 3deb4211367320fcbe59acc62083245267b7637758a06996d0e14f4db1e37c53fa282363de83177fd0b756e736d725cbbbfeac2059254bfa02748c23ecf8e4df WHIRLPOOL 6acf13a6d271fdc5f549028eb8c032f41e55c9e128c7c11f97931b6cbdd3c621ae76e58b1ea0bae343afd4b51b6deadd932db893f4134ed01b4b56cd8d63a4e4
+AUX libreoffice-4.4.1.2-linux-musl.patch 1962 SHA256 5cf5a446e5769f6a2df01c5c10702514fe9178334d1e53d3c7df843ca72c6fa2 SHA512 5fb4d5bf5cab21a0c95a9e51a4a138b427a08677c34bc14287c3eb74926b606345d5185c76bbe8957043d79dc33d46cf4aaa5182642c7fb9136dc48ed9e7fabb WHIRLPOOL 3e089da32a5425f1e892c80635489fde99198a5b15e1be94b996c49f2cf77e45144f624d68d9c11aef921bce0ce0ac632d52af348335ba5d61ae6049e9c4282b
+AUX libreoffice-4.4.1.2-musl-fix-execinfo.patch 736 SHA256 7171dfa651a7ee81b4e13a9fd9131428d9a65af138cac4cb428ae6c3e4bcb1f3 SHA512 567123f990c4a47c2e4cebf99f3486150740015e647ca2b2521e606f3350fc55ceda6c7ac031302da34e8fc90747d66619334fcfda4e7b8998456fe3619ab860 WHIRLPOOL d25df4d89e5739f3586296569345c38d44aeb59c1f6ed83ddd9c76139e6e5b639506c5d761838c2faa70e8a30bb6b68b15c4bdf3255f7658542f70c91bffeb32
+DIST 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip 3519470 SHA256 d30b13f4ba2e3b6a2d4f020c0dee0a9fb9fc6fbcc2d561f36b78da4bf3802370 SHA512 a231eba4a1baca11766ef292ab45e302081115477fe23018652882923308856835cf8c9ecba61a5cf22543474ccef3136965d794a90c9e4e9e6dcc21f9af6e1a WHIRLPOOL c4b3b0c3e10171155e1d3431e8ab9b495dbf2fb924882024306bfb53f533f5b0231c06f47e3cfa77052013a816ea4cc5f237cc76fdb44a048fb6d5c177729aec
+DIST 185d60944ea767075d27247c3162b3bc-unowinreg.dll 12288 SHA256 eafde646a7dbe46d20c291685b0beac2382174d78d66ee990e229a1bf6e6cec6 SHA512 854b8ae29b57b40ba6bb6ff66e723a0e8dad053fcc2849f0ad763cd8a31352f4aeba9636fd4e3f0f2a0cd985a6f49b4261b9ace68d6be821ed42cfa7a73eb13c WHIRLPOOL 16eb79e3674250fcb760b9698b4980414052d20f720d946701d1915c9b8915b4af75378668653d29581b77c19fcdba8f51d1f834c286cfcefcf4a420f8fcc1d5
+DIST 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz 1652670 SHA256 390a5085651828b8fe12aa978b200f59b9155eedbb91a4be89bf7cf39eefdd4a SHA512 5664203e6426880041cdb227e91f79f00d2ca7ae28c6997f61b72cc599aac55838d082d2b2b551bd7a228424c350ddea5d41599b8ca58d444a2cd46c9206ea91 WHIRLPOOL 6486c48b73a4f79760b443cfd397b704eca0fd32b72304ae7e7cfa0f43583b0af15c7384548b5215ae57513ed8366c8f3a74630ab466ba19a63b346af8c5eaca
+DIST 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip 9796 SHA256 64585ac36a81291a58269ec5347e7e3e2e8596dbacb9221015c208191333c6e1 SHA512 4a48f1e32907fb2dee601cda3cd7a0d7198b2d51f2a572b647f1e93f901fd511eef3567676e52dfb1723a2cdfbc01f2015ca0bb22903b0bc1476dd618cc9aa8a WHIRLPOOL a5156d06323699d2cbf539f14f5f44f54ebf33e86c7f14e98acd4c6e29c3e496f91dd6792401148ffa32e3dcb1cd4f087ed804e306b241cef86de0aa347d25d4
+DIST 4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 555291 SHA256 b0adb8e71aef80751b999c9c055e419a625c4a05184e407aef2aee28752ad8cb SHA512 1e8a39205f21206d239871bd636f17768eb3997e08ba065c1111a537564bec2b4e97bcb2f7cd9e652a1d9b4f31cb0662010303c393aedc84b920bb5f41b27be8 WHIRLPOOL d809712c3fcaca922d64f67a14d9dc3e750ecf359687c7ba0e8c6c7fc7750e43721a21ce29d5a3b0b87b83bfe7b71947e701ba4aed0a337ec35ecbb22d8dec34
+DIST 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip 1521926 SHA256 1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131df34e21753 SHA512 ec5ae23c8fe2f5efc377f7a9665039afadf28b4d8f2791379296766a5fbc9a3bf7548f9b0e3b3b07762229ec733a92ccbb69791ee0318c9c6f78f8e847253d3f WHIRLPOOL 8e446eb44188046b0e90694feba232f42c2e9f13d0f43783a18de37c94b86ff919b994931125c5d8001ecd320c1f4db5da482847304aa61646600a3bb33144b4
+DIST a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip 23150 SHA256 75823776fb51a9c526af904f1503a7afaaab900fba83eda64f8a41073724c870 SHA512 2d3835f7ac356805025cafedcad97faa48d0f5da386e6ac7b7451030059df8e2fdb0861ade07a576ebf9fb5b88a973585ab0437944b06aac9289d6898ba8586a WHIRLPOOL 60b98d9af2c83c0cf12a5a60ba30957d335b8b967cac07971e1edbc787b9caecd4b3c5bb480e8b38fe8109c1cf74439ebafae130c976182c2c15399f38f5d28c
+DIST d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz 16525605 SHA256 1f188ac03a8aa4663223eca8c82f91a55293d066d67127082e29a7dba1a98c9f SHA512 d08a7fe432e8df47d1d8992a45bb5f33149cb75b90eb74b2f2e457628d21a94b17eae0045096b053d2a866bf7710c775581c3e417b5dfaf66601aa18071b7305 WHIRLPOOL 95dc6ec0fb293c3538c1d51241283edf4e21647dcfd10229233ab7c3f13f7c78e6bb02c4d292a7cd2a2ec95575d775f0395e837bbc88ab4ddbaa5adfd62be2f0
+DIST libreoffice-4.4.1.2.tar.xz 164055640 SHA256 4ed40b6554674dc0b010af0599b94066334fe80f3dc8a3fb34543f9d847b475d SHA512 0a7166ec0f3ce920e3473af14bb48568e88cb03f4c9a9d1c93fde70ca7f8518fcbb2e9e1df3177ed05408253b1737f7702e714553dd0c05c110a71ac27deace6 WHIRLPOOL ec85d5e56d4d96fdcc48d9a855c394d64404d189ae6e3f34ee8c1cab5226608dee78f29664d9f2fd2747357debe0505377189520594e0b19b8264cd00ac87990
+DIST libreoffice-branding-gentoo-0.8.tar.xz 151568 SHA256 22722121be062742624e0634beae92289c75e6a99ed507d3bf0a05c5164e3c69 SHA512 785031a699b1d1895ce4b50ffc3ddf645f3a0ef9acdf37facfd18cf75db9484cb8f53a50abb63d6006ead76a80b6ff5aa99661063245ebb84bd64013d713de7f WHIRLPOOL 1f36652a52d501d6548cfa9aa013b3e3a1867aa2b0693d2274cf7816d4aa4e0cde3c7096cc71ed47cf74e5f96da2757bf537f553021f8fd86939accb227bf538
+DIST libreoffice-help-4.4.1.2.tar.xz 1875832 SHA256 07be8ca80e3552668f496584c2d9fbc3cce8a5e3947531c62c67bdf1bbb95d10 SHA512 a955c512535f85bfd21b03fa17c6431e7190002497c66f39022a0a37c022a81c6a07da2b212d9a844b11c28d0802f8ac75086ebfeff51d36ef962394c911d4e8 WHIRLPOOL 04d9f0794fd3677a5642197dd7abcb2e6d687adf4c6320ea2ddfc2a4fdaba3f07e18d04ac489a2e73c9c8fc247bc50aaa9f2bbc672664d4c03a7992eb31af720
+EBUILD libreoffice-4.4.1.2-r99.ebuild 19294 SHA256 31183c9cfcd6956d96026a48c678c3bec7890f26954076c347a64ec17fd02406 SHA512 7e757e98ada7cc4a30077edd10aeba25605d0c852d3d75cfc496f946c01c9250efc6a40375cb0832ff2326047f5638404e6e878ea734edd999469dbf853997ad WHIRLPOOL 7154e18bcb9a2a5f6285239e3bc90ac6595a25751a1872077ac072e401f5867231afa5c55ac8d4da17880c13a1f1759661e9055c5e800c55a8ec309e4cd8b6c4
+MISC metadata.xml 1170 SHA256 94d12aad619c0489c65857246c536b65ae98f1cd7fd698fc0cc3a59972887c6e SHA512 3baf086b2cb75fd88d1044df055e443d46824041d9741172769707f25b7e284ce96dd16292454c1321e0078546dd694770c4111669a4ad394cea7c5e4b5e1a5f WHIRLPOOL 4c326355000a944206b8b85a8a40f7467fb6012d38b2934c8534003e4a4c20046363fd6fa07f189a5cf082887771e581a28cf2910d78a1158f11be37324f7c87
diff --git a/app-office/libreoffice/files/libreoffice-4.3.5.2-remove-bashisms.patch b/app-office/libreoffice/files/libreoffice-4.3.5.2-remove-bashisms.patch
new file mode 100644
index 00000000..370b4aaa
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.3.5.2-remove-bashisms.patch
@@ -0,0 +1,38 @@
+From f53e79acd0d42f5c41e1104056af9cf23e9e2e2a Mon Sep 17 00:00:00 2001
+From: "Andreas K. Huettel (dilfridge)" <dilfridge@gentoo.org>
+Date: Sun, 4 Jan 2015 15:33:35 +0100
+Subject: [PATCH] Replace bash-specific code from configure.ac, fixes build for
+ sh=dash users
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Original patch by Rémi Cardona <remi@gentoo.org>
+
+Change-Id: I815567df8a868c3997e8ac357b8529fded28c950
+Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=525454
+Reviewed-on: https://gerrit.libreoffice.org/13731
+Reviewed-by: Caolán McNamara <caolanm@redhat.com>
+Tested-by: Caolán McNamara <caolanm@redhat.com>
+---
+ configure.ac | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8aa33d0..5dbe640 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11483,9 +11483,8 @@ test_font_map()
+ FONTFILE_LOWER="$(echo $FONTFILE | $AWK '{print tolower($0)}')"
+
+ TESTEXPR="'${FONTFILE_LOWER}' = '$(echo $FONT | $AWK '{print tolower($0)}').ttf'"
+- while true ; do
++ while test "$#" -ge 1 ; do
+ MAPPING="$(echo $1 | $AWK '{print tolower($0)}')"; shift
+- test -n "$MAPPING" || break
+ TESTEXPR="${TESTEXPR} -o '${FONTFILE_LOWER}' = '$MAPPING-regular.ttf'"
+ done
+ if test $TESTEXPR
+--
+2.3.0
+
diff --git a/app-office/libreoffice/files/libreoffice-4.4-system-pyuno.patch b/app-office/libreoffice/files/libreoffice-4.4-system-pyuno.patch
new file mode 100644
index 00000000..1cf8e192
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4-system-pyuno.patch
@@ -0,0 +1,44 @@
+diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh
+index a259bf6..672fa23 100755
+--- a/desktop/scripts/soffice.sh
++++ b/desktop/scripts/soffice.sh
+@@ -129,6 +129,9 @@ if echo "$checks" | grep -q "cc" ; then
+ exit 1;
+ fi
+
++PYTHONPATH=$sd_prog${PYTHONPATH+:$PYTHONPATH}
++export PYTHONPATH
++
+ case "`uname -s`" in
+ NetBSD|OpenBSD|FreeBSD|DragonFly)
+ # this is a temporary hack until we can live with the default search paths
+diff --git a/pyuno/source/module/uno.py b/pyuno/source/module/uno.py
+index 4ff2606..6a05eed 100644
+--- a/pyuno/source/module/uno.py
++++ b/pyuno/source/module/uno.py
+@@ -16,8 +16,12 @@
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ #
++import os
+ import sys
+
++sys.path.append('%eprefix%/usr/%libdir%/libreoffice/program')
++if getattr(os.environ, 'URE_BOOTSTRAP', None) is None:
++ os.environ['URE_BOOTSTRAP'] = "vnd.sun.star.pathname:%eprefix%/usr/%libdir%/libreoffice/program/fundamentalrc"
+ import pyuno
+
+ try:
+diff --git a/pyuno/source/officehelper.py b/pyuno/source/officehelper.py
+index 99d3b03..704edab 100755
+--- a/pyuno/source/officehelper.py
++++ b/pyuno/source/officehelper.py
+@@ -44,7 +44,7 @@ def bootstrap():
+ if "UNO_PATH" in os.environ:
+ sOffice = os.environ["UNO_PATH"]
+ else:
+- sOffice = "" # lets hope for the best
++ sOffice = "%eprefix%/usr/%libdir%/libreoffice/program"
+ sOffice = os.path.join(sOffice, "soffice")
+ if platform.startswith("win"):
+ sOffice += ".exe"
diff --git a/app-office/libreoffice/files/libreoffice-4.4.0.3-gcc-4.9-Os-link-failure.patch b/app-office/libreoffice/files/libreoffice-4.4.0.3-gcc-4.9-Os-link-failure.patch
new file mode 100644
index 00000000..0f39688e
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.0.3-gcc-4.9-Os-link-failure.patch
@@ -0,0 +1,80 @@
+From 0e4b1d2127957459b79f41a96f1fa0061d399b3b Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl@redhat.com>
+Date: Sat, 14 Feb 2015 00:17:06 +0100
+Subject: tdf#78174: toolkit: work around GCC 4.9 -Os link failure
+
+A build with gcc (GCC) 4.9.2 20141101 (Red Hat 4.9.2-1) for 32-bit x86
+fails because of these undefined symbols:
+
+> nm --demangle workdir/CxxObject/svx/source/fmcomp/fmgridif.o | grep
+ \\bWindowListenerMultiplexer::acquire
+ U non-virtual thunk to WindowListenerMultiplexer::acquire()
+
+They should probably be generated inline. Work around by out-lining the
+definition of the methods.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64812
+
+Change-Id: I318f7c39bdf1243be385bc6dc0a47862b22e92c5
+(cherry picked from commit 6b3aa0fe4094e87290bd33a30bd6cd99ee78ce38)
+Reviewed-on: https://gerrit.libreoffice.org/14509
+Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
+Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
+
+diff --git a/include/toolkit/helper/macros.hxx b/include/toolkit/helper/macros.hxx
+index e048e75..b212dff 100644
+--- a/include/toolkit/helper/macros.hxx
++++ b/include/toolkit/helper/macros.hxx
+@@ -112,8 +112,8 @@ class ClassName : public ListenerMultiplexerBase, public InterfaceName \
+ public: \
+ ClassName( ::cppu::OWeakObject& rSource ); \
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
+- void SAL_CALL acquire() throw() SAL_OVERRIDE { ListenerMultiplexerBase::acquire(); } \
+- void SAL_CALL release() throw() SAL_OVERRIDE { ListenerMultiplexerBase::release(); } \
++ void SAL_CALL acquire() throw() SAL_OVERRIDE; \
++ void SAL_CALL release() throw() SAL_OVERRIDE; \
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+
+@@ -124,8 +124,8 @@ class TOOLKIT_DLLPUBLIC ClassName : public ListenerMultiplexerBase, public Inter
+ public: \
+ ClassName( ::cppu::OWeakObject& rSource ); \
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
+- void SAL_CALL acquire() throw() SAL_OVERRIDE { ListenerMultiplexerBase::acquire(); } \
+- void SAL_CALL release() throw() SAL_OVERRIDE { ListenerMultiplexerBase::release(); } \
++ void SAL_CALL acquire() throw() SAL_OVERRIDE; \
++ void SAL_CALL release() throw() SAL_OVERRIDE; \
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+
+@@ -140,6 +140,8 @@ ClassName::ClassName( ::cppu::OWeakObject& rSource ) \
+ : ListenerMultiplexerBase( rSource ) \
+ { \
+ } \
++void SAL_CALL ClassName::acquire() throw() { ListenerMultiplexerBase::acquire(); } \
++void SAL_CALL ClassName::release() throw() { ListenerMultiplexerBase::release(); } \
+ ::com::sun::star::uno::Any ClassName::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) \
+ { \
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, \
+diff --git a/toolkit/source/helper/listenermultiplexer.cxx b/toolkit/source/helper/listenermultiplexer.cxx
+index 797fad2..b109c5f 100644
+--- a/toolkit/source/helper/listenermultiplexer.cxx
++++ b/toolkit/source/helper/listenermultiplexer.cxx
+@@ -47,6 +47,15 @@ EventListenerMultiplexer::EventListenerMultiplexer( ::cppu::OWeakObject& rSource
+ {
+ }
+
++void SAL_CALL EventListenerMultiplexer::acquire() throw ()
++{
++ return ListenerMultiplexerBase::acquire();
++}
++void SAL_CALL EventListenerMultiplexer::release() throw ()
++{
++ return ListenerMultiplexerBase::release();
++}
++
+ // ::com::sun::star::uno::XInterface
+ ::com::sun::star::uno::Any EventListenerMultiplexer::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception)
+ {
+--
+cgit v0.10.2
diff --git a/app-office/libreoffice/files/libreoffice-4.4.0.3-telepathy-build-fix.patch b/app-office/libreoffice/files/libreoffice-4.4.0.3-telepathy-build-fix.patch
new file mode 100644
index 00000000..2833385a
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.0.3-telepathy-build-fix.patch
@@ -0,0 +1,40 @@
+From 623b38fa5769f8cdec10b54b2a600bc4c4e077e6 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon@redhat.com>
+Date: Sun, 11 Jan 2015 13:08:37 +0100
+Subject: OSL_ENSURE was not declared in this scope
+
+Change-Id: I426c0feee7b76fe02473e07fa209a61967af3e99
+
+diff --git a/tubes/source/conference.cxx b/tubes/source/conference.cxx
+index 86986fc..df4a63f 100644
+--- a/tubes/source/conference.cxx
++++ b/tubes/source/conference.cxx
+@@ -248,7 +248,7 @@ static void channel_closed_cb( TpChannel *channel, gpointer user_data, GObject *
+
+ void TeleConference::setChannel( TpAccount *pAccount, TpDBusTubeChannel* pChannel )
+ {
+- OSL_ENSURE( !mpChannel, "TeleConference::setChannel: already have channel");
++ SAL_WARN_IF( mpChannel, "tubes", "TeleConference::setChannel: already have channel");
+ if (mpChannel)
+ g_object_unref( mpChannel);
+ if (mpAccount)
+@@ -297,7 +297,7 @@ bool TeleConference::offerTube()
+ {
+ INFO_LOGGER( "TeleConference::offerTube");
+
+- OSL_ENSURE( mpChannel, "TeleConference::offerTube: no channel");
++ SAL_WARN_IF( !mpChannel, "tubes", "TeleConference::offerTube: no channel");
+ if (!mpChannel)
+ return false;
+
+@@ -319,7 +319,7 @@ bool TeleConference::setTube( GDBusConnection* pTube)
+ {
+ INFO_LOGGER( "TeleConference::setTube");
+
+- OSL_ENSURE( !pImpl->mpTube, "TeleConference::setTube: already tubed");
++ SAL_WARN_IF( pImpl->mpTube, "tubes", "TeleConference::setTube: already tubed");
+
+ pImpl->mpTube = pTube;
+
+--
+cgit v0.10.2
diff --git a/app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch b/app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch
new file mode 100644
index 00000000..d4c4d28b
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch
@@ -0,0 +1,56 @@
+From f7db2461292be3e23f5b3af47e488eaa8105d8db Mon Sep 17 00:00:00 2001
+From: Jan-Marek Glogowski <glogow@fbihome.de>
+Date: Wed, 26 Nov 2014 13:35:42 +0100
+Subject: Add kde4-open-url script
+
+Adds a KDE4 specific URL processing script.
+
+Change-Id: I0116fa95f076a5772e88c616e93de542fe4fe4e4
+
+diff --git a/shell/Package_scripts_kde.mk b/shell/Package_scripts_kde.mk
+index c5e4978..162bcc5 100644
+--- a/shell/Package_scripts_kde.mk
++++ b/shell/Package_scripts_kde.mk
+@@ -9,6 +9,12 @@
+
+ $(eval $(call gb_Package_Package,shell_scripts_kde,$(SRCDIR)/shell/source/unix/misc))
+
++ifeq ($(ENABLE_KDE),TRUE)
+ $(eval $(call gb_Package_add_file,shell_scripts_kde,$(LIBO_BIN_FOLDER)/kde-open-url,kde-open-url.sh))
++endif
++
++ifeq ($(ENABLE_KDE4),TRUE)
++$(eval $(call gb_Package_add_file,shell_scripts_kde,$(LIBO_BIN_FOLDER)/kde4-open-url,kde4-open-url.sh))
++endif
+
+ # vim: set shiftwidth=4 tabstop=4 noexpandtab:
+diff --git a/shell/source/unix/misc/kde4-open-url.sh b/shell/source/unix/misc/kde4-open-url.sh
+new file mode 100755
+index 0000000..e5b8125
+--- /dev/null
++++ b/shell/source/unix/misc/kde4-open-url.sh
+@@ -0,0 +1,22 @@
++#!/bin/sh
++#
++# This file is part of the LibreOffice project.
++#
++# This Source Code Form is subject to the terms of the Mozilla Public
++# License, v. 2.0. If a copy of the MPL was not distributed with this
++# file, You can obtain one at http://mozilla.org/MPL/2.0/.
++#
++# This file incorporates work covered by the following license notice:
++#
++# Licensed to the Apache Software Foundation (ASF) under one or more
++# contributor license agreements. See the NOTICE file distributed
++# with this work for additional information regarding copyright
++# ownership. The ASF licenses this file to you under the Apache
++# License, Version 2.0 (the "License"); you may not use this file
++# except in compliance with the License. You may obtain a copy of
++# the License at http://www.apache.org/licenses/LICENSE-2.0 .
++#
++
++# use kde-open or xdg-open if available, falling back to our own open-url
++kde-open "$1" 2>/dev/null || xdg-open "$1" 2>/dev/null || `dirname "$0"`/open-url "$1" 2>/dev/null
++exit 0
+--
+cgit v0.10.2
diff --git a/app-office/libreoffice/files/libreoffice-4.4.1.2-fix-includes.patch b/app-office/libreoffice/files/libreoffice-4.4.1.2-fix-includes.patch
new file mode 100644
index 00000000..b1f1b441
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.1.2-fix-includes.patch
@@ -0,0 +1,31 @@
+--- libreoffice-4.4.0.3/vcl/inc/headless/svpinst.hxx 2015-02-02 20:38:46.879497689 -0200
++++ libreoffice-4.4.0.3/vcl/inc/headless/svpinst.hxx 2015-02-02 20:38:55.482831474 -0200
+@@ -32,6 +32,7 @@
+ #include <list>
+
+ #include <time.h>
++#include <sys/time.h>
+
+ #define VIRTUAL_DESKTOP_WIDTH 1024
+ #define VIRTUAL_DESKTOP_HEIGHT 768
+--- libreoffice-4.4.0.3/vcl/unx/generic/gdi/cairotextrender.cxx 2015-02-02 21:19:22.822959064 -0200
++++ libreoffice-4.4.0.3/vcl/unx/generic/gdi/cairotextrender.cxx 2015-02-02 21:19:48.312960404 -0200
+@@ -18,6 +18,7 @@
+ */
+
+ #include "cairotextrender.hxx"
++#include "generic/glyphcache.hxx"
+
+ #include <basegfx/polygon/b2dpolypolygon.hxx>
+ #include <vcl/settings.hxx>
+--- libreoffice-4.4.0.3/sd/source/ui/remotecontrol/BluetoothServer.cxx 2015-02-03 08:42:36.590056362 -0200
++++ libreoffice-4.4.0.3/sd/source/ui/remotecontrol/BluetoothServer.cxx 2015-02-03 08:42:46.030056456 -0200
+@@ -22,7 +22,7 @@
+ #include <dbus/dbus.h>
+ #include <errno.h>
+ #include <fcntl.h>
+- #include <sys/unistd.h>
++ #include <unistd.h>
+ #include <sys/socket.h>
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
diff --git a/app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch b/app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch
new file mode 100644
index 00000000..61e036ee
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch
@@ -0,0 +1,192 @@
+Merged upstream commits:
+
+6fc55b9abd783b624241d56e34751ea495adbd7d "KDE4: actually apply file dialog operation mode"
+b613270a730ace29dd1b16b29be2222b34f34a5d "KDE4: improve default load and save dialog titles"
+
+
+diff -u b/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
+--- b/vcl/unx/kde4/KDE4FilePicker.cxx
++++ b/vcl/unx/kde4/KDE4FilePicker.cxx
+@@ -58,6 +58,8 @@
+
+ #include "generic/geninst.h"
+
++#include "svids.hrc"
++
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::ui::dialogs;
+ using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
+@@ -109,7 +111,6 @@
+
+ KDE4FilePicker::KDE4FilePicker( const uno::Reference<uno::XComponentContext>& )
+ : KDE4FilePicker_Base(_helperMutex)
+- , _resMgr( ResMgr::CreateResMgr("fps_office") )
+ , allowRemoteUrls( false )
+ {
+ _extraControls = new QWidget();
+@@ -128,8 +129,7 @@
+ #endif
+
+ setMultiSelectionMode( false );
+- //default mode
+- _dialog->setOperationMode(KFileDialog::Opening);
++ _dialog->setConfirmOverwrite( true );
+
+ // XExecutableDialog functions
+ connect( this, SIGNAL( setTitleSignal( const OUString & ) ),
+@@ -202,7 +202,6 @@
+ SalYieldMutexReleaser aReleaser;
+ return Q_EMIT cleanupProxySignal();
+ }
+- delete _resMgr;
+ delete _dialog;
+ }
+
+@@ -524,6 +523,24 @@
+ return toOUString(label);
+ }
+
++QString KDE4FilePicker::getResString( sal_Int16 aRedId )
++{
++ QString aResString;
++
++ if( aRedId < 0 )
++ return aResString;
++
++ try
++ {
++ aResString = toQString(ResId(aRedId, *ImplGetResMgr()).toString());
++ }
++ catch(...)
++ {
++ }
++
++ return aResString.replace('~', '&');
++}
++
+ void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
+ {
+ QWidget* widget = 0;
+@@ -532,37 +549,37 @@
+ switch (controlId)
+ {
+ case CHECKBOX_AUTOEXTENSION:
+- resId = STR_SVT_FILEPICKER_AUTO_EXTENSION;
++ resId = STR_FPICKER_AUTO_EXTENSION;
+ break;
+ case CHECKBOX_PASSWORD:
+- resId = STR_SVT_FILEPICKER_PASSWORD;
++ resId = STR_FPICKER_PASSWORD;
+ break;
+ case CHECKBOX_FILTEROPTIONS:
+- resId = STR_SVT_FILEPICKER_FILTER_OPTIONS;
++ resId = STR_FPICKER_FILTER_OPTIONS;
+ break;
+ case CHECKBOX_READONLY:
+- resId = STR_SVT_FILEPICKER_READONLY;
++ resId = STR_FPICKER_READONLY;
+ break;
+ case CHECKBOX_LINK:
+- resId = STR_SVT_FILEPICKER_INSERT_AS_LINK;
++ resId = STR_FPICKER_INSERT_AS_LINK;
+ break;
+ case CHECKBOX_PREVIEW:
+- resId = STR_SVT_FILEPICKER_SHOW_PREVIEW;
++ resId = STR_FPICKER_SHOW_PREVIEW;
+ break;
+ case CHECKBOX_SELECTION:
+- resId = STR_SVT_FILEPICKER_SELECTION;
++ resId = STR_FPICKER_SELECTION;
+ break;
+ case PUSHBUTTON_PLAY:
+- resId = STR_SVT_FILEPICKER_PLAY;
++ resId = STR_FPICKER_PLAY;
+ break;
+ case LISTBOX_VERSION:
+- resId = STR_SVT_FILEPICKER_VERSION;
++ resId = STR_FPICKER_VERSION;
+ break;
+ case LISTBOX_TEMPLATE:
+- resId = STR_SVT_FILEPICKER_TEMPLATES;
++ resId = STR_FPICKER_TEMPLATES;
+ break;
+ case LISTBOX_IMAGE_TEMPLATE:
+- resId = STR_SVT_FILEPICKER_IMAGE_TEMPLATE;
++ resId = STR_FPICKER_IMAGE_TEMPLATE;
+ break;
+ case LISTBOX_VERSION_LABEL:
+ case LISTBOX_TEMPLATE_LABEL:
+@@ -581,16 +598,7 @@
+ case CHECKBOX_PREVIEW:
+ case CHECKBOX_SELECTION:
+ {
+- QString label;
+-
+- if (_resMgr && resId != -1)
+- {
+- OUString s(ResId(resId, *_resMgr).toString());
+- label = toQString(s);
+- label.replace("~", "&");
+- }
+-
+- widget = new QCheckBox(label, _extraControls);
++ widget = new QCheckBox(getResString(resId), _extraControls);
+
+ // the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
+ // code, but the checkbox is hidden and ignored
+@@ -719,8 +727,22 @@
+ 1 );
+ }
+
+- _dialog->setOperationMode(operationMode);
+- _dialog->setConfirmOverwrite(true);
++ _dialog->setOperationMode( operationMode );
++
++ sal_Int16 resId = -1;
++ switch (_dialog->operationMode())
++ {
++ case KFileDialog::Opening:
++ resId = STR_FPICKER_OPEN;
++ break;
++ case KFileDialog::Saving:
++ resId = STR_FPICKER_SAVE;
++ break;
++ default:
++ break;
++ }
++
++ _dialog->setCaption(getResString(resId));
+ }
+
+ void SAL_CALL KDE4FilePicker::cancel()
+only in patch2:
+unchanged:
+--- a/vcl/unx/kde4/KDE4FilePicker.hxx
++++ b/vcl/unx/kde4/KDE4FilePicker.hxx
+@@ -41,8 +41,6 @@ class KFileDialog;
+ class QWidget;
+ class QLayout;
+
+-class ResMgr;
+-
+ typedef ::cppu::WeakComponentImplHelper5
+ < ::com::sun::star::ui::dialogs::XFilePicker2
+ , ::com::sun::star::ui::dialogs::XFilePicker3
+@@ -61,8 +59,6 @@ protected:
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
+
+- ResMgr *_resMgr;
+-
+ //the dialog to display
+ KFileDialog* _dialog;
+
+@@ -225,6 +221,8 @@ private:
+ //add a custom control widget to the file dialog
+ void addCustomControl(sal_Int16 controlId);
+
++ QString getResString( sal_Int16 aRedId );
++
+ private Q_SLOTS:
+ void cleanupProxy();
+ void checkProtocol();
diff --git a/app-office/libreoffice/files/libreoffice-4.4.1.2-linux-musl.patch b/app-office/libreoffice/files/libreoffice-4.4.1.2-linux-musl.patch
new file mode 100644
index 00000000..5c8ab529
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.1.2-linux-musl.patch
@@ -0,0 +1,68 @@
+--- libreoffice-4.4.0.3/configure.ac.orig 2015-01-22 22:05:28.000000000 -0200
++++ libreoffice-4.4.0.3/configure.ac 2015-02-02 20:11:20.639411153 -0200
+@@ -569,7 +569,7 @@
+ fi
+ ;;
+
+-linux-gnu*|k*bsd*-gnu*)
++linux-gnu*|linux-musl*|k*bsd*-gnu*)
+ test_gtk=yes
+ build_gstreamer_1_0=yes
+ build_gstreamer_0_10=yes
+@@ -4058,7 +4058,7 @@
+ esac
+ ;;
+
+-linux-gnu*)
++linux-gnu*|linux-musl*)
+ COM=GCC
+ GUIBASE=unx
+ OS=LINUX
+@@ -6967,7 +6967,7 @@
+ test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
+ ;;
+
+- linux-gnu*)
++ linux-gnu*|linux-musl*)
+ JAVAINC="-I$JAVA_HOME/include"
+ JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
+ test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
+@@ -9429,21 +9429,6 @@
+ fi
+ AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
+
+-dnl ***************************************
+-dnl testing libc version for Linux...
+-dnl ***************************************
+-if test "$_os" = "Linux"; then
+- AC_MSG_CHECKING([whether libc is >= 2.1.1])
+- exec 6>/dev/null # no output
+- AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
+- exec 6>&1 # output on again
+- if test "$HAVE_LIBC"; then
+- AC_MSG_RESULT([yes])
+- else
+- AC_MSG_ERROR([no, upgrade libc])
+- fi
+-fi
+-
+ dnl =========================================
+ dnl Check for the Windows SDK.
+ dnl =========================================
+@@ -12741,7 +12726,7 @@
+
+ case "$host_os" in
+
+- aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
++ aix*|dragonfly*|freebsd*|linux-gnu*|linux-musl*|*netbsd*|openbsd*)
+ if test "$ENABLE_JAVA" != "" -a "$JDK"!="gcj"; then
+ pathmunge "$JAVA_HOME/bin" "after"
+ fi
+@@ -12789,7 +12774,6 @@
+ esac
+
+ pathmunge "$SRC_ROOT/solenv/bin" "before"
+- pathmunge "." "before"
+ fi
+
+ AC_SUBST(LO_PATH)
diff --git a/app-office/libreoffice/files/libreoffice-4.4.1.2-musl-fix-execinfo.patch b/app-office/libreoffice/files/libreoffice-4.4.1.2-musl-fix-execinfo.patch
new file mode 100644
index 00000000..01fca6fb
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-4.4.1.2-musl-fix-execinfo.patch
@@ -0,0 +1,24 @@
+diff -ru sal.orig/osl/unx/backtrace.h sal/osl/unx/backtrace.h
+--- a/sal/osl/unx/backtrace.h 2015-01-22 22:05:28.000000000 -0200
++++ b/sal/osl/unx/backtrace.h 2015-02-02 17:06:27.765494731 -0200
+@@ -47,7 +47,7 @@
+
+ #endif /* defined SOLARIS || FREEBSD || NETBSD || OPENBSD */
+
+-#if defined (LINUX)
++#if defined (LINUX) && defined (__GLIBC__)
+ #include <execinfo.h>
+ #endif
+
+diff -ru sal.orig/osl/unx/signal.cxx sal/osl/unx/signal.cxx
+--- a/sal/osl/unx/signal.cxx 2015-01-22 22:05:28.000000000 -0200
++++ b/sal/osl/unx/signal.cxx 2015-02-02 17:06:53.495496086 -0200
+@@ -36,7 +36,7 @@
+
+ #endif /* MACOSX */
+
+-#ifdef LINUX
++#if defined (LINUX) && defined (__GLIBC__)
+ #include <execinfo.h>
+ #include <link.h>
+ #define INCLUDE_BACKTRACE
diff --git a/app-office/libreoffice/libreoffice-4.4.1.2-r99.ebuild b/app-office/libreoffice/libreoffice-4.4.1.2-r99.ebuild
new file mode 100644
index 00000000..cbf69a74
--- /dev/null
+++ b/app-office/libreoffice/libreoffice-4.4.1.2-r99.ebuild
@@ -0,0 +1,619 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-office/libreoffice/libreoffice-4.4.1.2.ebuild,v 1.6 2015/04/11 20:43:16 dilfridge Exp $
+
+EAPI=5
+
+KDE_REQUIRED="optional"
+QT_MINIMAL="4.7.4"
+KDE_SCM="git"
+CMAKE_REQUIRED="never"
+
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+PYTHON_REQ_USE="threads,xml"
+
+# experimental ; release ; old
+# Usually the tarballs are moved a lot so this should make
+# everyone happy.
+DEV_URI="
+ http://dev-builds.libreoffice.org/pre-releases/src
+ http://download.documentfoundation.org/libreoffice/src/${PV:0:5}/
+ http://download.documentfoundation.org/libreoffice/old/${PV}/
+"
+EXT_URI="http://ooo.itc.hu/oxygenoffice/download/libreoffice"
+ADDONS_URI="http://dev-www.libreoffice.org/src/"
+
+BRANDING="${PN}-branding-gentoo-0.8.tar.xz"
+# PATCHSET="${P}-patchset-01.tar.xz"
+
+[[ ${PV} == *9999* ]] && SCM_ECLASS="git-r3"
+inherit base multiprocessing autotools bash-completion-r1 check-reqs eutils java-pkg-opt-2 kde4-base pax-utils python-single-r1 multilib toolchain-funcs flag-o-matic versionator ${SCM_ECLASS}
+unset SCM_ECLASS
+
+DESCRIPTION="LibreOffice, a full office productivity suite"
+HOMEPAGE="http://www.libreoffice.org"
+SRC_URI="branding? ( http://dev.gentoo.org/~dilfridge/distfiles/${BRANDING} )"
+[[ -n ${PATCHSET} ]] && SRC_URI+=" http://dev.gentooexperimental.org/~scarabeus/${PATCHSET}"
+
+# Split modules following git/tarballs
+# Core MUST be first!
+# Help is used for the image generator
+MODULES="core help"
+# Only release has the tarballs
+if [[ ${PV} != *9999* ]]; then
+ for i in ${DEV_URI}; do
+ for mod in ${MODULES}; do
+ if [[ ${mod} == core ]]; then
+ SRC_URI+=" ${i}/${P}.tar.xz"
+ else
+ SRC_URI+=" ${i}/${PN}-${mod}-${PV}.tar.xz"
+ fi
+ done
+ unset mod
+ done
+ unset i
+fi
+unset DEV_URI
+
+# Really required addons
+# These are bundles that can't be removed for now due to huge patchsets.
+# If you want them gone, patches are welcome.
+ADDONS_SRC+=" ${ADDONS_URI}/d62650a6f908e85643e557a236ea989c-vigra1.6.0.tar.gz"
+ADDONS_SRC+=" ${ADDONS_URI}/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz" # modifies source code
+ADDONS_SRC+=" collada? ( ${ADDONS_URI}/4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 )"
+ADDONS_SRC+=" java? ( ${ADDONS_URI}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip )"
+ADDONS_SRC+=" libreoffice_extensions_wiki-publisher? ( ${ADDONS_URI}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip )" # no release for 8 years, should we package it?
+ADDONS_SRC+=" libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip )" # Does not build with 1.6 rhino at all
+ADDONS_SRC+=" libreoffice_extensions_scripting-javascript? ( ${ADDONS_URI}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip )" # requirement of rhino
+ADDONS_SRC+=" odk? ( http://download.go-oo.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll )" # not packageable
+SRC_URI+=" ${ADDONS_SRC}"
+
+unset ADDONS_URI
+unset EXT_URI
+unset ADDONS_SRC
+
+IUSE="bluetooth +branding coinmp collada +cups dbus debug eds firebird gltf gnome gstreamer
++gtk gtk3 jemalloc kde mysql odk postgres telepathy test vlc"
+
+LO_EXTS="nlpsolver scripting-beanshell scripting-javascript wiki-publisher"
+# Unpackaged separate extensions:
+# diagram: lo has 0.9.5 upstream is weirdly patched 0.9.4 -> wtf?
+# hunart: only on ooo extensions -> fubared download path somewhere on sf
+# numbertext, typo, validator, watch-window: ^^
+# oooblogger: no homepage or anything
+# Extensions that need extra work:
+for lo_xt in ${LO_EXTS}; do
+ IUSE+=" libreoffice_extensions_${lo_xt}"
+done
+unset lo_xt
+
+LICENSE="|| ( LGPL-3 MPL-1.1 )"
+SLOT="0"
+[[ ${PV} == *9999* ]] || \
+KEYWORDS="amd64 ~arm x86 ~amd64-linux ~x86-linux"
+
+COMMON_DEPEND="
+ ${PYTHON_DEPS}
+ app-arch/zip
+ app-arch/unzip
+ >=app-text/hunspell-1.3.2-r3
+ app-text/mythes
+ >=app-text/libabw-0.1.0
+ >=app-text/libexttextcat-3.2
+ >=app-text/libebook-0.1.1
+ >=app-text/libetonyek-0.1.1
+ app-text/liblangtag
+ >=app-text/libmspub-0.1.0
+ >=app-text/libmwaw-0.3.4
+ >=app-text/libodfgen-0.1.0
+ app-text/libwpd:0.10[tools]
+ app-text/libwpg:0.3
+ >=app-text/libwps-0.3.0
+ >=app-text/poppler-0.16:=[xpdf-headers(+),cxx]
+ >=dev-cpp/clucene-2.3.3.4-r2
+ =dev-cpp/libcmis-0.5*
+ dev-db/unixODBC
+ >=dev-libs/boost-1.55:=
+ dev-libs/expat
+ >=dev-libs/hyphen-2.7.1
+ >=dev-libs/icu-4.8.1.1:=
+ >=dev-libs/liborcus-0.7.0
+ >=dev-libs/librevenge-0.0.1
+ >=dev-libs/nspr-4.8.8
+ >=dev-libs/nss-3.12.9
+ >=dev-lang/perl-5.0
+ >=dev-libs/openssl-1.0.0d:0
+ >=dev-libs/redland-1.0.16
+ media-gfx/graphite2
+ >=media-libs/fontconfig-2.8.0
+ media-libs/freetype:2
+ >=media-libs/glew-1.10
+ >=media-libs/harfbuzz-0.9.18:=[icu(+)]
+ media-libs/lcms:2
+ >=media-libs/libpng-1.4:0=
+ >=media-libs/libcdr-0.1.0
+ >=media-libs/libfreehand-0.1.0
+ media-libs/libpagemaker
+ >=media-libs/libvisio-0.1.0
+ >=net-misc/curl-7.21.4
+ net-libs/neon
+ net-nds/openldap
+ sci-mathematics/lpsolve
+ virtual/jpeg:0
+ >=x11-libs/cairo-1.10.0[X]
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ virtual/glu
+ virtual/opengl
+ bluetooth? ( net-wireless/bluez )
+ coinmp? ( sci-libs/coinor-mp )
+ collada? ( >=media-libs/opencollada-1.2.2_p20150207 )
+ cups? ( net-print/cups )
+ dbus? ( >=dev-libs/dbus-glib-0.92 )
+ eds? ( gnome-extra/evolution-data-server )
+ firebird? ( >=dev-db/firebird-2.5 )
+ gltf? ( media-libs/libgltf )
+ gnome? ( gnome-base/gconf:2 )
+ gtk? (
+ x11-libs/gdk-pixbuf[X]
+ >=x11-libs/gtk+-2.24:2
+ )
+ gtk3? ( >=x11-libs/gtk+-3.2:3 )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+ jemalloc? ( dev-libs/jemalloc )
+ libreoffice_extensions_scripting-beanshell? ( >=dev-java/bsh-2.0_beta4 )
+ libreoffice_extensions_scripting-javascript? ( dev-java/rhino:1.6 )
+ libreoffice_extensions_wiki-publisher? (
+ dev-java/commons-codec:0
+ dev-java/commons-httpclient:3
+ dev-java/commons-lang:2.1
+ dev-java/commons-logging:0
+ dev-java/tomcat-servlet-api:3.0
+ )
+ mysql? ( >=dev-db/mysql-connector-c++-1.1.0 )
+ postgres? ( >=dev-db/postgresql-9.0[kerberos] )
+ telepathy? (
+ dev-libs/glib:2
+ >=net-libs/telepathy-glib-0.18.0
+ >=x11-libs/gtk+-2.24:2
+ )
+"
+
+RDEPEND="${COMMON_DEPEND}
+ !app-office/libreoffice-bin
+ !app-office/libreoffice-bin-debug
+ !<app-office/openoffice-bin-3.4.0-r1
+ !app-office/openoffice
+ media-fonts/libertine
+ media-fonts/liberation-fonts
+ media-fonts/urw-fonts
+ java? ( >=virtual/jre-1.6 )
+ kde? ( || ( $(add_kdeapps_dep kioclient) $(add_kdebase_dep kioclient) ) )
+ vlc? ( media-video/vlc )
+"
+
+if [[ ${PV} != *9999* ]]; then
+ PDEPEND="=app-office/libreoffice-l10n-$(get_version_component_range 1-2)*"
+else
+ # Translations are not reliable on live ebuilds
+ # rather force people to use english only.
+ PDEPEND="!app-office/libreoffice-l10n"
+fi
+
+# FIXME: cppunit should be moved to test conditional
+# after everything upstream is under gbuild
+# as dmake execute tests right away
+DEPEND="${COMMON_DEPEND}
+ >=dev-libs/libatomic_ops-7.2d
+ >=dev-libs/libxml2-2.7.8
+ dev-libs/libxslt
+ dev-perl/Archive-Zip
+ dev-util/cppunit
+ >=dev-util/gperf-3
+ dev-util/intltool
+ >=dev-util/mdds-0.10.3:=
+ media-libs/glm
+ net-misc/npapi-sdk
+ >=sys-apps/findutils-4.4.2
+ sys-devel/bison
+ sys-apps/coreutils
+ sys-devel/flex
+ sys-devel/gettext
+ >=sys-devel/make-3.82
+ sys-devel/ucpp
+ sys-libs/zlib
+ virtual/pkgconfig
+ x11-libs/libXt
+ x11-libs/libXtst
+ x11-proto/randrproto
+ x11-proto/xextproto
+ x11-proto/xineramaproto
+ x11-proto/xproto
+ java? (
+ >=virtual/jdk-1.6
+ >=dev-java/ant-core-1.7
+ )
+ odk? ( >=app-doc/doxygen-1.8.4 )
+ test? ( dev-util/cppunit )
+"
+
+PATCHES=(
+ # not upstreamable stuff
+ "${FILESDIR}/${PN}-4.4-system-pyuno.patch"
+
+ # from 4.4 branch
+ "${FILESDIR}/${PN}-4.4.0.3-gcc-4.9-Os-link-failure.patch" # bug 538348
+
+ # from master branch
+ "${FILESDIR}/${PN}-4.4.0.3-telepathy-build-fix.patch"
+ "${FILESDIR}/${PN}-4.4.1.2-add-kde4-open-url-script.patch"
+ "${FILESDIR}/${PN}-4.4.1.2-improve-KDE4FilePicker.patch"
+ "${FILESDIR}/${PN}-4.3.5.2-remove-bashisms.patch" # bug 525454
+ "${FILESDIR}/${PN}-4.4.1.2-musl-fix-execinfo.patch"
+ "${FILESDIR}/${PN}-4.4.1.2-fix-includes.patch"
+ "${FILESDIR}/${PN}-4.4.1.2-linux-musl.patch"
+)
+
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ bluetooth? ( dbus )
+ collada? ( gltf )
+ gnome? ( gtk )
+ eds? ( gnome )
+ telepathy? ( gtk )
+ libreoffice_extensions_nlpsolver? ( java )
+ libreoffice_extensions_scripting-beanshell? ( java )
+ libreoffice_extensions_scripting-javascript? ( java )
+ libreoffice_extensions_wiki-publisher? ( java )
+"
+
+CHECKREQS_MEMORY="512M"
+CHECKREQS_DISK_BUILD="6G"
+
+pkg_pretend() {
+ local pgslot
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ check-reqs_pkg_pretend
+
+ if [[ $(gcc-major-version) -lt 4 ]] || \
+ ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ]] ) \
+ ; then
+ eerror "Compilation with gcc older than 4.6 is not supported"
+ die "Too old gcc found."
+ fi
+ fi
+
+ # Ensure pg version but we have to be sure the pg is installed (first
+ # install on clean system)
+ if use postgres && has_version dev-db/postgresql; then
+ pgslot=$(postgresql-config show)
+ if [[ ${pgslot//.} < 90 ]] ; then
+ eerror "PostgreSQL slot must be set to 9.0 or higher."
+ eerror " postgresql-config set 9.0"
+ die "PostgreSQL slot is not set to 9.0 or higher."
+ fi
+ fi
+}
+
+pkg_setup() {
+ java-pkg-opt-2_pkg_setup
+ kde4-base_pkg_setup
+ python-single-r1_pkg_setup
+
+ [[ ${MERGE_TYPE} != binary ]] && check-reqs_pkg_setup
+}
+
+src_unpack() {
+ local mod mod2 dest tmplfile tmplname mypv
+
+ [[ -n ${PATCHSET} ]] && unpack ${PATCHSET}
+ use branding && unpack "${BRANDING}"
+
+ if [[ ${PV} != *9999* ]]; then
+ unpack "${P}.tar.xz"
+ for mod in ${MODULES}; do
+ [[ ${mod} == core ]] && continue
+ unpack "${PN}-${mod}-${PV}.tar.xz"
+ done
+ else
+ for mod in ${MODULES}; do
+ mypv=${PV/.9999}
+ [[ ${mypv} != ${PV} ]] && EGIT_BRANCH="${PN}-${mypv/./-}"
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${P}"
+ [[ ${mod} != core ]] && EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}-${mod}-${PV}"
+ EGIT_REPO_URI="git://anongit.freedesktop.org/${PN}/${mod}"
+ git-r3_src_unpack
+ if [[ ${mod} != core ]]; then
+ mod2=${mod}
+ # mapping does not match on help
+ [[ ${mod} == help ]] && mod2="helpcontent2"
+ mkdir -p "${S}/${mod2}/" || die
+ mv -n "${WORKDIR}/${PN}-${mod}-${PV}"/* "${S}/${mod2}" || die
+ rm -rf "${WORKDIR}/${PN}-${mod}-${PV}"
+ fi
+ done
+ unset EGIT_CHECKOUT_DIR EGIT_REPO_URI EGIT_BRANCH
+ fi
+}
+
+src_prepare() {
+ # optimization flags
+ export GMAKE_OPTIONS="${MAKEOPTS}"
+ # System python 2.7 enablement:
+ export PYTHON_CFLAGS=$(python_get_CFLAGS)
+ export PYTHON_LIBS=$(python_get_LIBS)
+
+ if use collada; then
+ export OPENCOLLADA_CFLAGS="-I/usr/include/opencollada/COLLADABaseUtils -I/usr/include/opencollada/COLLADAFramework -I/usr/include/opencollada/COLLADASaxFrameworkLoader -I/usr/include/opencollada/GeneratedSaxParser"
+ export OPENCOLLADA_LIBS="-L /usr/$(get_libdir)/opencollada -lOpenCOLLADABaseUtils -lOpenCOLLADAFramework -lOpenCOLLADASaxFrameworkLoader -lGeneratedSaxParser"
+ fi
+
+ # patchset
+ if [[ -n ${PATCHSET} ]]; then
+ EPATCH_FORCE="yes" \
+ EPATCH_SOURCE="${WORKDIR}/${PATCHSET/.tar.xz/}" \
+ EPATCH_SUFFIX="patch" \
+ epatch
+ fi
+
+ base_src_prepare
+
+ AT_M4DIR="m4" eautoreconf
+ # hack in the autogen.sh
+ touch autogen.lastrun
+
+ # system pyuno mess
+ sed \
+ -e "s:%eprefix%:${EPREFIX}:g" \
+ -e "s:%libdir%:$(get_libdir):g" \
+ -i pyuno/source/module/uno.py \
+ -i pyuno/source/officehelper.py || die
+ # sed in the tests
+ sed -i \
+ -e 's#all : build unitcheck#all : build#g' \
+ solenv/gbuild/Module.mk || die
+ sed -i \
+ -e 's#check: dev-install subsequentcheck#check: unitcheck slowcheck dev-install subsequentcheck#g' \
+ -e 's#Makefile.gbuild all slowcheck#Makefile.gbuild all#g' \
+ Makefile.in || die
+
+ if use branding; then
+ # hack...
+ mv -v "${WORKDIR}/branding-intro.png" "${S}/icon-themes/galaxy/brand/intro.png" || die
+ fi
+}
+
+src_configure() {
+ local java_opts
+ local internal_libs
+ local lo_ext
+ local ext_opts
+
+ # sane: just sane.h header that is used for scan in writer, not
+ # linked or anything else, worthless to depend on
+ # vigra: just uses templates from there
+ # it is serious pain in the ass for packaging
+ # should be replaced by boost::gil if someone interested
+ internal_libs+="
+ --without-system-sane
+ --without-system-vigra
+ "
+
+ # libreoffice extensions handling
+ for lo_xt in ${LO_EXTS}; do
+ if [[ "${lo_xt}" == "scripting-beanshell" || "${lo_xt}" == "scripting-javascript" ]]; then
+ ext_opts+=" $(use_enable libreoffice_extensions_${lo_xt} ${lo_xt})"
+ else
+ ext_opts+=" $(use_enable libreoffice_extensions_${lo_xt} ext-${lo_xt})"
+ fi
+ done
+
+ if use java; then
+ # hsqldb: system one is too new
+ java_opts="
+ --without-junit
+ --without-system-hsqldb
+ --with-ant-home="${ANT_HOME}"
+ --with-jdk-home=$(java-config --jdk-home 2>/dev/null)
+ --with-jvm-path="${EPREFIX}/usr/lib/"
+ "
+
+ use libreoffice_extensions_scripting-beanshell && \
+ java_opts+=" --with-beanshell-jar=$(java-pkg_getjar bsh bsh.jar)"
+
+ use libreoffice_extensions_scripting-javascript && \
+ java_opts+=" --with-rhino-jar=$(java-pkg_getjar rhino-1.6 js.jar)"
+
+ if use libreoffice_extensions_wiki-publisher; then
+ java_opts+="
+ --with-commons-codec-jar=$(java-pkg_getjar commons-codec commons-codec.jar)
+ --with-commons-httpclient-jar=$(java-pkg_getjar commons-httpclient-3 commons-httpclient.jar)
+ --with-commons-lang-jar=$(java-pkg_getjar commons-lang-2.1 commons-lang.jar)
+ --with-commons-logging-jar=$(java-pkg_getjar commons-logging commons-logging.jar)
+ --with-servlet-api-jar=$(java-pkg_getjar tomcat-servlet-api-3.0 servlet-api.jar)
+ "
+ fi
+ fi
+
+ # system headers/libs/...: enforce using system packages
+ # --enable-cairo: ensure that cairo is always required
+ # --enable-graphite: disabling causes build breakages
+ # --enable-*-link: link to the library rather than just dlopen on runtime
+ # --enable-release-build: build the libreoffice as release
+ # --disable-fetch-external: prevent dowloading during compile phase
+ # --disable-gnome-vfs: old gnome virtual fs support
+ # --disable-kdeab: kde3 adressbook
+ # --disable-kde: kde3 support
+ # --disable-systray: quickstarter does not actually work at all so do not
+ # promote it
+ # --enable-extension-integration: enable any extension integration support
+ # --without-{fonts,myspell-dicts,ppsd}: prevent install of sys pkgs
+ # --disable-report-builder: too much java packages pulled in without pkgs
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}/" \
+ --with-system-headers \
+ --with-system-libs \
+ --with-system-jars \
+ --with-system-dicts \
+ --enable-cairo-canvas \
+ --enable-graphite \
+ --enable-largefile \
+ --enable-mergelibs \
+ --enable-neon \
+ --enable-python=system \
+ --enable-randr \
+ --enable-randr-link \
+ --enable-release-build \
+ --disable-hardlink-deliver \
+ --disable-ccache \
+ --disable-crashdump \
+ --disable-dependency-tracking \
+ --disable-epm \
+ --disable-fetch-external \
+ --disable-gnome-vfs \
+ --disable-gstreamer-0-10 \
+ --disable-report-builder \
+ --disable-kdeab \
+ --disable-kde \
+ --disable-online-update \
+ --disable-systray \
+ --with-alloc=$(use jemalloc && echo "jemalloc" || echo "system") \
+ --with-build-version="Gentoo official package" \
+ --enable-extension-integration \
+ --with-external-dict-dir="${EPREFIX}/usr/share/myspell" \
+ --with-external-hyph-dir="${EPREFIX}/usr/share/myspell" \
+ --with-external-thes-dir="${EPREFIX}/usr/share/myspell" \
+ --with-external-tar="${DISTDIR}" \
+ --with-lang="" \
+ --with-parallelism=$(makeopts_jobs) \
+ --with-system-ucpp \
+ --with-vendor="Gentoo Foundation" \
+ --with-x \
+ --without-fonts \
+ --without-myspell-dicts \
+ --without-help \
+ --with-helppack-integration \
+ --without-sun-templates \
+ $(use_enable bluetooth sdremote-bluetooth) \
+ $(use_enable coinmp) \
+ $(use_enable collada) \
+ $(use_enable cups) \
+ $(use_enable debug) \
+ $(use_enable dbus) \
+ $(use_enable eds evolution2) \
+ $(use_enable firebird firebird-sdbc) \
+ $(use_enable gltf) \
+ $(use_enable gnome gconf) \
+ $(use_enable gnome gio) \
+ $(use_enable gnome lockdown) \
+ $(use_enable gstreamer gstreamer-1-0) \
+ $(use_enable gtk) \
+ $(use_enable gtk3) \
+ $(use_enable kde kde4) \
+ $(use_enable mysql ext-mariadb-connector) \
+ $(use_enable odk) \
+ $(use_enable postgres postgresql-sdbc) \
+ $(use_enable telepathy) \
+ $(use_enable vlc) \
+ $(use_with coinmp system-coinmp) \
+ $(use_with collada system-opencollada) \
+ $(use_with gltf system-libgltf) \
+ $(use_with java) \
+ $(use_with mysql system-mysql-cppconn) \
+ $(use_with odk doxygen) \
+ ${internal_libs} \
+ ${java_opts} \
+ ${ext_opts}
+}
+
+src_compile() {
+ # more and more LO stuff tries to use OpenGL, including tests during build
+ # bug 501508, bug 540624, bug 545974 and probably more
+ addpredict /dev/dri
+ addpredict /dev/ati
+ addpredict /dev/nvidiactl
+
+ # hack for offlinehelp, this needs fixing upstream at some point
+ # it is broken because we send --without-help
+ # https://bugs.freedesktop.org/show_bug.cgi?id=46506
+ (
+ grep "^export" "${S}/config_host.mk" > "${T}/config_host.mk"
+ source "${T}/config_host.mk" 2&> /dev/null
+
+ local path="${WORKDIR}/helpcontent2/source/auxiliary/"
+ mkdir -p "${path}" || die
+
+ echo "perl \"${S}/helpcontent2/helpers/create_ilst.pl\" -dir=icon-themes/galaxy/res/helpimg > \"${path}/helpimg.ilst\""
+ perl "${S}/helpcontent2/helpers/create_ilst.pl" \
+ -dir=icon-themes/galaxy/res/helpimg \
+ > "${path}/helpimg.ilst"
+ [[ -s "${path}/helpimg.ilst" ]] || ewarn "The help images list is empty, something is fishy, report a bug."
+ )
+
+ local target
+ use test && target="build" || target="build-nocheck"
+
+ # this is not a proper make script
+ make ${target} || die
+}
+
+src_test() {
+ make unitcheck || die
+ make slowcheck || die
+}
+
+src_install() {
+ # This is not Makefile so no buildserver
+ make DESTDIR="${D}" distro-pack-install -o build -o check || die
+
+ # Fix bash completion placement
+ newbashcomp "${ED}"/etc/bash_completion.d/libreoffice.sh ${PN}
+ bashcomp_alias \
+ libreoffice \
+ unopkg loimpress lobase localc lodraw lomath lowriter lofromtemplate loweb loffice
+ rm -rf "${ED}"/etc/ || die
+
+ if use branding; then
+ insinto /usr/$(get_libdir)/${PN}/program
+ newins "${WORKDIR}/branding-sofficerc" sofficerc
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/$(get_libdir)/${PN}/program/sofficerc" > "${ED}"/etc/env.d/99${PN}
+ fi
+
+ # Hack for offlinehelp, this needs fixing upstream at some point.
+ # It is broken because we send --without-help
+ # https://bugs.freedesktop.org/show_bug.cgi?id=46506
+ insinto /usr/$(get_libdir)/libreoffice/help
+ doins xmlhelp/util/*.xsl
+
+ # Remove desktop files for support to old installs that can't parse mime
+ rm -rf "${ED}"/usr/share/mimelnk/
+
+ # FIXME: Hack add missing file
+ insinto /usr/$(get_libdir)/${PN}/program
+ doins "${S}"/instdir/program/libsaxlo.so
+
+ pax-mark -m "${ED}"/usr/$(get_libdir)/libreoffice/program/soffice.bin
+ pax-mark -m "${ED}"/usr/$(get_libdir)/libreoffice/program/unopkg.bin
+}
+
+pkg_preinst() {
+ # Cache updates - all handled by kde eclass for all environments
+ kde4-base_pkg_preinst
+}
+
+pkg_postinst() {
+ kde4-base_pkg_postinst
+
+ use java || \
+ ewarn 'If you plan to use lbase application you should enable java or you will get various crashes.'
+}
+
+pkg_postrm() {
+ kde4-base_pkg_postrm
+}
diff --git a/app-office/libreoffice/metadata.xml b/app-office/libreoffice/metadata.xml
new file mode 100644
index 00000000..757568b8
--- /dev/null
+++ b/app-office/libreoffice/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>openoffice</herd>
+ <longdescription>LibreOffice is a fork of OpenOffice.org.
+This ebuild allows you to compile it yourself. Unfortunately this
+compilation can take up to a day depending on the speed of your
+computer. It will however make a snappier openoffice than the binary
+version</longdescription>
+ <use>
+ <flag name="coinmp">Use sci-libs/coinor-mp as alternative solver</flag>
+ <flag name="collada">Enable Collada for rendering 3D models stored in *.dae and *.kmz format</flag>
+ <flag name="gltf">Use media-libs/libgltf for inserting 3D models in the glTF format into presentations</flag>
+ <flag name="gtk3">Enable highly experimental gtk3 frontend</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> for allocations</flag>
+ <flag name="odk">Build the Office Development Kit</flag>
+ <flag name="telepathy">Enable document colaboration features using telepathy communication framework.</flag>
+ <flag name="vlc">Use <pkg>media-video/vlc</pkg> for video embedding</flag>
+ </use>
+</pkgmetadata>
diff --git a/app-text/hunspell/Manifest b/app-text/hunspell/Manifest
new file mode 100644
index 00000000..311f5855
--- /dev/null
+++ b/app-text/hunspell/Manifest
@@ -0,0 +1,7 @@
+AUX hunspell-1.3-renameexes.patch 5337 SHA256 4cbeae9c782a2114d09d7920b1dfe355f37711ecd895d800a6b460bb87184f89 SHA512 26cab6d31a22c33e96a118e2b0905bd26e7d224737fab9f4d02f8ed4729032202de37b0d9e42500b0ba8912109bb47eec0e47ed712e9b3a082c9f8a24db52588 WHIRLPOOL 633f1204fa824bdb0507914e13894c7bf68a07438f86bd1baddb2ae884792487816cdda94214fcfff005080ebe9dd352282f38c9e5db86daef1bd04491ad1960
+AUX hunspell-1.3.2-static-lib.patch 451 SHA256 7259ea8f23a4d2717e85f62e3276cbcc23af292f6e77daddeb23bd93dbde0528 SHA512 923ff9f5cc7d32fba73755eaed537af43b95ee8050865c623f6552bcadee4acf9d23d2fcbdba1ffefe648fff05f92c5af5e4b067e31fc306d9258d64eba45ced WHIRLPOOL 1e1dc1cd8cc65d19c215c9ed13b366d84287d29d21cfd3d0d3c2467c7e656bf91c92567d12c6ac8a77f8dd2d902e60611d34e190d53026e04034efc84069fd1b
+AUX hunspell-1.3.3-multibyte-chars.patch 1866 SHA256 1a2f0c6fd79894fa5f556c1715bc4bd05f2409b1d778bc2f597e3d44dc64f457 SHA512 a5b3b2a7b93bf5c5cdf446ae4a85e88e6bf1244c05437df29734241507e715f18ca5967de708f20ab569b55c646f85f4277c1112c867321edfd105a946c7bf9c WHIRLPOOL df9418af8941e8cba06a6b4b63369324fbad358b4c4bface9385f720ac91881150cd832e3c0f5665bc35ae5cd02da9c978233d1254d0ff45370516db58997563
+AUX hunspell-9999-error_h.patch 881 SHA256 8755794dbe59cf8540b077866d1dd604dad950e80c19b5999d584f23cfc967bb SHA512 9ed53121f07f9735cf4383deee5bbaffce75f85cfd9b7df26e7067713da05d6fb3cf7e6dd617aa2420b2780e556fa39230d1cbf20eba833120f3cc80026e2957 WHIRLPOOL 03382d367a546d3d9649748ee3d67f4ee6d590b6f607092b3373e07a0da309abedf3c5f66ea6dba6756eda858cf208746ab91daeb3f04fb4268a65539ffad748
+DIST hunspell-1.3.3.tar.gz 986081 SHA256 a7b2c0de0e2ce17426821dc1ac8eb115029959b3ada9d80a81739fa19373246c SHA512 7599981d002a4a032c41c83f6287243a4942b0e25c408049a3ba86c16f63ce964800a3ac325ace0402b0d7256690c4a4151a66f19a8f58cc455af0498bb1af04 WHIRLPOOL c10f7f7b326ce886bd031da29e9e04a1f4a5914f24cbe75061ed539958e7a8efaa4d4ea16f2b17437c63d97d6f558a27c092bc43c9f56c75078667d5344402f8
+EBUILD hunspell-1.3.3-r99.ebuild 2566 SHA256 37fced96b540099f4cd94f6295ab3c47ef8806dbb6c3f959f1554dd8248e79a6 SHA512 f6870ec7ec8b2307996742987d971a3ac4a3d05006c606f3c386ae7385f10d150ea3837896267001e692db3a365f5aeb803cf645fe3ec1b2cbde8a6ccca1565a WHIRLPOOL 8e0201aed2cdd898a796e05e3e903abad95c733d3a4d08451f8cdc625498a58ce044cb6355acb12242f38fc60a19348afeec29ff728c807cea996e332a3fb96e
+MISC metadata.xml 208 SHA256 98f8aa3fb70533eeab6b09d5bc30bd8f649ec13d9b04363490082fb87bb6032e SHA512 d5a7f3cb2fe57f8d7783ba358068648b122d9f5de81a17bff61ce600e42b6487e6f7e2a62c8be95cc7021cb3ea88716824b1ad0565da922ea753bea2417b3d3d WHIRLPOOL e38a6cdef2acb3efdc182efde482593790f773ab3bb9b66cced3af47e4ab39368757e17c4352c6cacaefa338341db88c3bcc3ffcd32aabd7984c5b19051a7bb7
diff --git a/app-text/hunspell/files/hunspell-1.3-renameexes.patch b/app-text/hunspell/files/hunspell-1.3-renameexes.patch
new file mode 100644
index 00000000..70c5b748
--- /dev/null
+++ b/app-text/hunspell/files/hunspell-1.3-renameexes.patch
@@ -0,0 +1,135 @@
+=== modified file 'src/tools/Makefile.am'
+--- src/tools/Makefile.am 2011-05-24 15:55:29 +0000
++++ src/tools/Makefile.am 2011-05-24 15:58:36 +0000
+@@ -1,4 +1,4 @@
+-bin_PROGRAMS=analyze chmorph hunspell munch unmunch hzip hunzip
++bin_PROGRAMS=hunspell-analyze hunspell-chmorph hunspell hunspell-munch hunspell-unmunch hzip hunzip
+
+ INCLUDES=-I${top_srcdir}/src/hunspell -I${top_srcdir}/src/parsers
+
+@@ -6,8 +6,8 @@
+ hunzip_SOURCES=hunzip.cxx
+ hunzip_LDADD = ../hunspell/libhunspell-1.3.la
+
+-munch_SOURCES=munch.c munch.h
+-unmunch_SOURCES=unmunch.c unmunch.h
++hunspell_munch_SOURCES=munch.c munch.h
++hunspell_unmunch_SOURCES=unmunch.c unmunch.h
+
+ example_SOURCES=example.cxx
+ example_LDADD = ../hunspell/libhunspell-1.3.la
+@@ -16,11 +16,11 @@
+ hunspell_LDADD = @LIBINTL@ @LIBICONV@ ../parsers/libparsers.a \
+ ../hunspell/libhunspell-1.3.la @CURSESLIB@ @READLINELIB@
+
+-analyze_SOURCES=analyze.cxx
+-analyze_LDADD = ../hunspell/libhunspell-1.3.la
++hunspell_analyze_SOURCES=analyze.cxx
++hunspell_analyze_LDADD = ../hunspell/libhunspell-1.3.la
+
+-chmorph_SOURCES=chmorph.cxx
+-chmorph_LDADD = ../parsers/libparsers.a ../hunspell/libhunspell-1.3.la
++hunspell_chmorph_SOURCES=chmorph.cxx
++hunspell_chmorph_LDADD = ../parsers/libparsers.a ../hunspell/libhunspell-1.3.la
+
+ noinst_PROGRAMS=example
+
+
+=== modified file 'src/tools/chmorph.cxx'
+--- src/tools/chmorph.cxx 2011-05-24 15:55:29 +0000
++++ src/tools/chmorph.cxx 2011-05-24 16:00:54 +0000
+@@ -19,11 +19,11 @@
+ for (int i = 1; i < 6; i++)
+ if (!argv[i]) {
+ fprintf(stderr,
+- "chmorph - change affixes by morphological analysis and generation\n"
+- "correct syntax is:\nchmorph affix_file "
++ "hunspell-chmorph - change affixes by morphological analysis and generation\n"
++ "correct syntax is:\nhunspell-chmorph affix_file "
+ "dictionary_file file_to_convert STRING1 STRING2\n"
+ "STRINGS may be arbitrary parts of the morphological descriptions\n"
+- "example: chmorph hu.aff hu.dic hu.txt SG_2 SG_3 "
++ "example: hunspell-chmorph hu.aff hu.dic hu.txt SG_2 SG_3 "
+ " (convert informal Hungarian second person texts to formal third person texts)\n");
+ exit(1);
+ }
+
+=== modified file 'src/tools/example.cxx'
+--- src/tools/example.cxx 2011-05-24 15:55:29 +0000
++++ src/tools/example.cxx 2011-05-24 15:55:37 +0000
+@@ -17,8 +17,8 @@
+ /* first parse the command line options */
+
+ if (argc < 4) {
+- fprintf(stderr,"example (now it works with more dictionary files):\n");
+- fprintf(stderr,"example affix_file dictionary_file(s) file_of_words_to_check\n");
++ fprintf(stderr,"hunspell-example (now it works with more dictionary files):\n");
++ fprintf(stderr,"hunspell-example affix_file dictionary_file(s) file_of_words_to_check\n");
+ exit(1);
+ }
+
+
+=== modified file 'src/tools/munch.c'
+--- src/tools/munch.c 2011-05-24 15:55:29 +0000
++++ src/tools/munch.c 2011-05-24 15:55:37 +0000
+@@ -42,14 +42,14 @@
+ wf = mystrdup(argv[1]);
+ } else {
+ fprintf(stderr,"correct syntax is:\n");
+- fprintf(stderr,"munch word_list_file affix_file\n");
++ fprintf(stderr,"hunspell-munch word_list_file affix_file\n");
+ exit(1);
+ }
+ if (argv[2]) {
+ af = mystrdup(argv[2]);
+ } else {
+ fprintf(stderr,"correct syntax is:\n");
+- fprintf(stderr,"munch word_list_file affix_file\n");
++ fprintf(stderr,"hunspell-munch word_list_file affix_file\n");
+ exit(1);
+ }
+
+
+=== modified file 'src/tools/unmunch.c'
+--- src/tools/unmunch.c 2011-05-24 15:55:29 +0000
++++ src/tools/unmunch.c 2011-05-24 15:55:37 +0000
+@@ -39,14 +39,14 @@
+ wf = mystrdup(argv[1]);
+ } else {
+ fprintf(stderr,"correct syntax is:\n");
+- fprintf(stderr,"unmunch dic_file affix_file\n");
++ fprintf(stderr,"hunspell-unmunch dic_file affix_file\n");
+ exit(1);
+ }
+ if (argv[2]) {
+ af = mystrdup(argv[2]);
+ } else {
+ fprintf(stderr,"correct syntax is:\n");
+- fprintf(stderr,"unmunch dic_file affix_file\n");
++ fprintf(stderr,"hunspell-unmunch dic_file affix_file\n");
+ exit(1);
+ }
+
+
+=== modified file 'tests/test.sh'
+--- tests/test.sh 2011-05-24 15:55:29 +0000
++++ tests/test.sh 2011-05-24 15:55:37 +0000
+@@ -34,7 +34,7 @@
+ shopt -s expand_aliases
+
+ alias hunspell='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la ../src/tools/hunspell'
+-alias analyze='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la ../src/tools/analyze'
++alias analyze='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la ../src/tools/hunspell-analyze'
+
+ if [ "$VALGRIND" != "" ]; then
+ rm -f $TEMPDIR/test.pid*
+@@ -43,7 +43,7 @@
+ fi
+
+ alias hunspell='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la valgrind --tool=$VALGRIND --leak-check=yes --show-reachable=yes --log-file=$TEMPDIR/test.pid ../src/tools/hunspell'
+- alias analyze='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la valgrind --tool=$VALGRIND --leak-check=yes --show-reachable=yes --log-file=$TEMPDIR/test.pid ../src/tools/analyze'
++ alias analyze='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la valgrind --tool=$VALGRIND --leak-check=yes --show-reachable=yes --log-file=$TEMPDIR/test.pid ../src/tools/hunspell-analyze'
+ fi
+
+ # Tests good words
+
diff --git a/app-text/hunspell/files/hunspell-1.3.2-static-lib.patch b/app-text/hunspell/files/hunspell-1.3.2-static-lib.patch
new file mode 100644
index 00000000..b6cc9233
--- /dev/null
+++ b/app-text/hunspell/files/hunspell-1.3.2-static-lib.patch
@@ -0,0 +1,9 @@
+diff -urN hunspell-1.3.2.old/src/parsers/Makefile.am hunspell-1.3.2/src/parsers/Makefile.am
+--- hunspell-1.3.2.old/src/parsers/Makefile.am 2011-09-15 11:50:40.251441126 +0200
++++ hunspell-1.3.2/src/parsers/Makefile.am 2011-09-17 06:06:50.469615528 +0200
+@@ -1,4 +1,4 @@
+-lib_LIBRARIES=libparsers.a
++noinst_LIBRARIES=libparsers.a
+ libparsers_a_SOURCES=firstparser.cxx htmlparser.cxx \
+ latexparser.cxx manparser.cxx \
+ textparser.cxx
diff --git a/app-text/hunspell/files/hunspell-1.3.3-multibyte-chars.patch b/app-text/hunspell/files/hunspell-1.3.3-multibyte-chars.patch
new file mode 100644
index 00000000..848bc8fe
--- /dev/null
+++ b/app-text/hunspell/files/hunspell-1.3.3-multibyte-chars.patch
@@ -0,0 +1,59 @@
+http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7781#31
+https://bugs.gentoo.org/518740
+
+--- src/tools/hunspell.cxx
++++ src/tools/hunspell.cxx
+@@ -710,13 +748,22 @@ if (pos >= 0) {
+ fflush(stdout);
+ } else {
+ char ** wlst = NULL;
+- int ns = pMS[d]->suggest(&wlst, token);
++ int byte_offset = parser->get_tokenpos() + pos;
++ int char_offset = 0;
++ if (strcmp(io_enc, "UTF-8") == 0) {
++ for (int i = 0; i < byte_offset; i++) {
++ if ((buf[i] & 0xc0) != 0x80)
++ char_offset++;
++ }
++ } else {
++ char_offset = byte_offset;
++ }
++ int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d]));
+ if (ns == 0) {
+- fprintf(stdout,"# %s %d", token,
+- parser->get_tokenpos() + pos);
++ fprintf(stdout,"# %s %d", token, char_offset);
+ } else {
+ fprintf(stdout,"& %s %d %d: ", token, ns,
+- parser->get_tokenpos() + pos);
++ char_offset);
+ fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], io_enc));
+ }
+ for (int j = 1; j < ns; j++) {
+@@ -745,13 +792,23 @@ if (pos >= 0) {
+ if (root) free(root);
+ } else {
+ char ** wlst = NULL;
++ int byte_offset = parser->get_tokenpos() + pos;
++ int char_offset = 0;
++ if (strcmp(io_enc, "UTF-8") == 0) {
++ for (int i = 0; i < byte_offset; i++) {
++ if ((buf[i] & 0xc0) != 0x80)
++ char_offset++;
++ }
++ } else {
++ char_offset = byte_offset;
++ }
+ int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d]));
+ if (ns == 0) {
+ fprintf(stdout,"# %s %d", chenc(token, io_enc, ui_enc),
+- parser->get_tokenpos() + pos);
++ char_offset);
+ } else {
+ fprintf(stdout,"& %s %d %d: ", chenc(token, io_enc, ui_enc), ns,
+- parser->get_tokenpos() + pos);
++ char_offset);
+ fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], ui_enc));
+ }
+ for (int j = 1; j < ns; j++) {
+
diff --git a/app-text/hunspell/files/hunspell-9999-error_h.patch b/app-text/hunspell/files/hunspell-9999-error_h.patch
new file mode 100644
index 00000000..9e1208f9
--- /dev/null
+++ b/app-text/hunspell/files/hunspell-9999-error_h.patch
@@ -0,0 +1,37 @@
+http://sourceforge.net/p/hunspell/bugs/264/
+
+diff --git a/src/tools/munch.c b/src/tools/munch.c
+index 52e7c51..dd42fed 100644
+--- a/src/tools/munch.c
++++ b/src/tools/munch.c
+@@ -10,8 +10,10 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <limits.h>
+-#if defined(__linux__) && !defined(__ANDROID__)
++#if HAVE_ERROR_H
+ #include <error.h>
++#endif
++#if defined(__linux__) && !defined(__ANDROID__)
+ #include <errno.h>
+ #include <sys/mman.h>
+ #endif
+diff --git a/src/tools/unmunch.c b/src/tools/unmunch.c
+index c1d07a8..53915f5 100644
+--- a/src/tools/unmunch.c
++++ b/src/tools/unmunch.c
+@@ -11,8 +11,10 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+-#if defined(__linux__) && !defined(__ANDROID__)
++#if HAVE_ERROR_H
+ #include <error.h>
++#endif
++#if defined(__linux__) && !defined(__ANDROID__)
+ #include <errno.h>
+ #include <sys/mman.h>
+ #endif
+--
+2.0.5
+
diff --git a/app-text/hunspell/hunspell-1.3.3-r99.ebuild b/app-text/hunspell/hunspell-1.3.3-r99.ebuild
new file mode 100644
index 00000000..86989d1e
--- /dev/null
+++ b/app-text/hunspell/hunspell-1.3.3-r99.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/hunspell/hunspell-1.3.3.ebuild,v 1.4 2014/12/02 20:49:12 maekke Exp $
+
+EAPI=5
+inherit eutils multilib autotools flag-o-matic versionator
+
+MY_P=${PN}-${PV/_beta/b}
+
+DESCRIPTION="Hunspell spell checker - an improved replacement for myspell in OOo"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+HOMEPAGE="http://hunspell.sourceforge.net/"
+
+SLOT="0"
+LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
+IUSE="ncurses nls readline static-libs"
+KEYWORDS="~alpha ~amd64 arm hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+
+RDEPEND="
+ ncurses? ( sys-libs/ncurses )
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+# describe properly mi
+LANGS="af bg ca cs cy da de el en eo es et fo fr ga gl he hr hu ia id is it km
+ku lt lv mk ms nb nl nn pl pt pt_BR ro ru sk sl sq sv sw tn uk zu"
+
+DICT_DEP="app-dicts/myspell-en"
+for lang in ${LANGS}; do
+ if [[ ${lang} == de ]] ; then
+ DICT_DEP+=" linguas_de? (
+ || (
+ app-dicts/myspell-de
+ app-dicts/myspell-de-alt
+ )
+ )"
+ else
+ DICT_DEP+=" linguas_${lang}? ( app-dicts/myspell-${lang/pt_BR/pt-br} )"
+ fi
+ IUSE+=" linguas_${lang}"
+done
+PDEPEND="${DICT_DEP}"
+
+unset lang LANGS DICT_DEP
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=(
+ AUTHORS ChangeLog NEWS README THANKS TODO license.hunspell
+ AUTHORS.myspell README.myspell license.myspell
+)
+
+src_prepare() {
+ # Upstream package creates some executables which names are too generic
+ # to be placed in /usr/bin - this patch prefixes them with 'hunspell-'.
+ # It modifies a Makefile.am file, hence eautoreconf.
+ epatch "${FILESDIR}"/${PN}-1.3-renameexes.patch \
+ "${FILESDIR}"/${PN}-1.3.3-multibyte-chars.patch
+
+ epatch "${FILESDIR}"/${PN}-9999-error_h.patch
+
+ eautoreconf
+}
+
+src_configure() {
+ # missing somehow, and I am too lazy to fix it properly
+ [[ ${CHOST} == *-darwin* ]] && append-libs -liconv
+
+ # I wanted to put the include files in /usr/include/hunspell.
+ # You can do that, libreoffice can find them anywhere, just
+ # ping me when you do so ; -- scarabeus
+ econf \
+ $(use_enable nls) \
+ $(use_with ncurses ui) \
+ $(use_with readline readline) \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ prune_libtool_files --all
+
+ #342449
+ pushd "${ED}"/usr/$(get_libdir)/ >/dev/null
+ ln -s lib${PN}{-$(get_major_version).$(get_version_component_range 2).so.0.0.0,.so}
+ popd >/dev/null
+}
diff --git a/app-text/hunspell/metadata.xml b/app-text/hunspell/metadata.xml
new file mode 100644
index 00000000..4538a687
--- /dev/null
+++ b/app-text/hunspell/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/app-text/texlive-core/Manifest b/app-text/texlive-core/Manifest
new file mode 100644
index 00000000..dd97094b
--- /dev/null
+++ b/app-text/texlive-core/Manifest
@@ -0,0 +1,111 @@
+AUX texlive-core-2012-pmx-sysdep.patch 270 SHA256 420546ee115103a31ccd7e58a009c8096def20de1fdfbd43e1f11ece8b5a6b1d SHA512 26de95f2df5fbc44616df78cedd09bf2fefe83d1a74a969c53bf95c57c653c21412cd6b6c691055318c7c5d6b95835f683c9029fc47133cfbb4f4f593f48679f WHIRLPOOL 35559dfc4cf6817e6afad1b485d9c8c3b9d6b4d16e25b58038b4c41b67cb32f9e525beade4180618170564512deb6433a1efd1959f4b6cadb2fa7d8bbf374b69
+AUX texmf-update2010 5163 SHA256 b19566f0c8032a7f24ee0ead26d627e306ee360aa8a5948a1256bc2760f89856 SHA512 e89bb321b438a70c23db587ac092cb8a98c783157c42bf1df80dce00e10c58741b5a6c685a3ee5511b61f4a2a98b833faf3d6d8f8dc24ab2e4a4342875d8454c WHIRLPOOL c62b97abaadf95b1452851ac88a7575001ca09f4e26f8e582f6fffde0b90c5fdafc0d78f3ec030152bd34a7cec44e5ae2ad2bab46d978dabb90a69d4b6f95b41
+DIST texlive-20120701-source.tar.xz 131904044 SHA256 9666617d5dac3e82578e696835cc9f251ee0a56d162d86dff08659ac5dcb6c81 SHA512 0e8653aa21094e079900d17256f0768ac5514690a3725d96923d5fdc7633484d611441df1af8c674b38b9ce6a8845a9004976cd00635742dfc6837aa433caf5f WHIRLPOOL 9d570a1bd58cca8baed399ab53eb767c7c3db607c00363ce563e14dfccdd235703c538e6a651aa7f2934adf21f8477775f1547f9e7f3d957b89af644c89bcb57
+DIST texlive-core-patches-39.tar.xz 3056 SHA256 685705f1994b751df42738cb542a6ca0b4adbc013275318667c634665b8bd25b SHA512 95e7161820a648d667c2a69bd74c1d24a20670128889d1ebbec2e700b0459d84bb4d96b2d9f355e519d9efe0e126689b29225af1a184e5a06e0cb398fefc7cc3 WHIRLPOOL 24359dbca04f3e9f9c09a9afc195dd6858da2284947cbebaa770e73ef78276059f9d2e3c8a95c5005971fa64be76367a55887f1f94e423e7d0ca227d5573dc95
+DIST texlive-module-a2ping-2012.tar.xz 31124 SHA256 37b769091af7c7c9f95c52f92cbc26b22f72dc0de5ecb0e9e37cf1482438605a SHA512 b4f74f037d1113d204d3f0e34c8418e354ae002ab09e8c326458bf7c9c9a9bfa3211317e03bb7e69d7f2e83a2b22851410287477176dab5288dacf5a9ec4a8a6 WHIRLPOOL 5e76ab0e818c3e20d8211c35230a9ee1084f1de830c988b1ed9707036481582540aa97c6ee9e31b0dd1ee2a8346dc3b81197d8c0489563122bba2dd7dffe5fe1
+DIST texlive-module-a2ping.doc-2012.tar.xz 17520 SHA256 8652f4aa2017b079854798845f32e824782d608d208463dc0751de3d4d1f0546 SHA512 8ac3e783e8dd336cbaaef845a6422ac5e51629a14c902a994975dfabe734e383745dd0bf6a5c03863ea5c7d57439b1f0a83be1db6297a56c2ee0f8e110b27d4c WHIRLPOOL 2a15b7e65c52901ca224be147209284885dfd4f70ede38cb4129fda2145602df081aae556d1091e5a3a721d4b6dc99794c2c80f1f92161328742e9ce1943a54e
+DIST texlive-module-asymptote-2012.tar.xz 266772 SHA256 e6fd94edbbed89403a3e90a03112266fe5c576dccc5fe9f91983db6ac5d548ae SHA512 4c27081cd4318a05a06ef7b0fa7cd8126feba72df390044299bb94b620103ea38c45da78d2a22566e244173ceb6a07d62b68d91dd9db1c4a06662da8eeea8f08 WHIRLPOOL 60666fac7387bdd28686c8611e314ef1b2f270b5865641af64df80951829675c0a2b3c3473d08febe6c0f1bbfb833a05aec55221e25dda13129afee051e2bd47
+DIST texlive-module-asymptote.doc-2012.tar.xz 1720260 SHA256 b8eda3e53f4b16d7ca435a683e5f71ff2668fa1d89c934713bfefb8b8f1ec693 SHA512 f7d49538f4bb538a62f4d6a80578d55e957fa193691b88bba21df30cd722b60b72b5951bbcb2adb53082ae08f476093a27d66e0124b9b26fe95a6b0133058223 WHIRLPOOL 75fc89dd3ca3bbeb5852fdd2c5c70c3f9e6a0c1523f8267d5e72fbd8ad693704201c08c5b3dac7eea765d890101dd939cecfc415853279a4dfe022286f514cd0
+DIST texlive-module-bibtex8-2012.tar.xz 9204 SHA256 b8d21905744b56a61d30b13f112fcd4983de6e5847d7cb8b25695bf6cea1a4b1 SHA512 49c47a12641ce6628e83d698d775d8be1602af4c9454f677ad7de156d6c441b95df0a880e2eaa0fd0179eea430b60fdf1c49659df04d62332ab4d90021f557be WHIRLPOOL 20110f0d377a2f90157d8ab75f6fccc1df652d1226e8df1b0cff3a6fe1b5f52ded105b33cd79e4de31459f9deca6b6f1f39eafe31601aa81bba9f4e41adcca93
+DIST texlive-module-bibtex8.doc-2012.tar.xz 13412 SHA256 dc29cd4d4440b025572c29828c075d32d7cd9a9e12b66154dfd19372781dd5a1 SHA512 5e26aa539c10ae5c1d473197c78cba24343b0ed0c6c26c488c24ab85a46ef55fd88a3626d264a4ae823d75c9fd50f1500867c0d14c971eb5db5e98580cf6bea6 WHIRLPOOL cf6328332c897d03f136c0dc30e72373ec908e05798a53d4314c7577f21da6945db1d11a8f2222c2a0d73e6fb0d6349ce822094df5d492d9dc1995c2e3d88d1d
+DIST texlive-module-bundledoc-2012.tar.xz 11924 SHA256 3c2e2f6f10c0eb64569610d6be9585fd3e6bdea80266d883883c404696fcb1c3 SHA512 8f0929a050e45e5bd3b4b02953f1dc714ca5ac39e400d895b56bb38c9d057ac3b715078fca875115d983e5436561323f4fea61b1119b00c7916100e6c88ec8a4 WHIRLPOOL 6954830845c4a5b63986898c3de937163796586c342e56b936b71a925ba1fb14c1210fc90aef3b549cf7e35a992a57a4396a1eb0744c7cf58f150395d5f587e0
+DIST texlive-module-bundledoc.doc-2012.tar.xz 36772 SHA256 13f72b6be42642a6088d04a0af507f90c3a83b9767b4dcea0a3b1f8b7f6c2b9e SHA512 7bffe7f51c65a76417026f1472c75d66443fd011125eb2e5be2b337331aadbae7c38164b2f0b9a68a97866ecbc8b65196e6d17a7d693faf6c181528db39bd1a8 WHIRLPOOL 97817a21bc11305a0d66eeade6accea4ce1b01bcbed905608eb50b775093be05b826ff33e7069d7041622372d59b56e9ffc04cf28ca842cd761abea863bd4f1d
+DIST texlive-module-collection-binextra-2012.tar.xz 716 SHA256 b1d4d65db934062bb0a23090582dfb056c78da1ff9b912c11c6bf0bc823d4fbf SHA512 5ed7c43b2bfa6d78d212b7c13914e60f3d943e429fd10f2db8a7c38f59dfe5b41d621199d5be368d5b90ba3950970d8b6bce698647d55f94f1324ddb88fc7935 WHIRLPOOL 75eb941d17ae05174307ef66d8f848a07265d233d6c439cf2c9d5ba22c91285cf281961fb5a954afd166399032dcfc453ad5f954153336e70fd9ae41dc34a312
+DIST texlive-module-ctanify-2012.tar.xz 7632 SHA256 34f4610d5c5af994135deafcf69d077264258c3af5201e4aff3322dd53f033dd SHA512 2676863e394d0af6139dd23d48325d05d174a55d9b6d0b5c5f8372e1edb25a87459fa86a59429a3720e68068b62e0d4472c293103969d660304bbe58b62af8e1 WHIRLPOOL 72684fdfb88b4f317da38aa8eb71d0e1e65149778d23833bd8b2777130dfde81d1cd28807f32a5a088d93914bd2fef3b7ff3f2c1952208c237a944a8ab923018
+DIST texlive-module-ctanify.doc-2012.tar.xz 30072 SHA256 b24a0f5c1fc4dd639eb5b35c83a0630c169d99fe102d1d815143ae1db89bc3ab SHA512 1789f0df0413e95171bfedada165a75b5979974f8d4e1c06e8069797725f028583c2d660d40c18c5beee4cce4dfd1e553ac35eab2ab5e6ecad7b88b07bd2f1ac WHIRLPOOL f287db185dc47f25c4f40ecc53ad0f0ab230ece114639d811d2029ff59930c73d2cc56c6cb82a5fcf4d2f4a5182915d465aaab7ebc87caede0b45a36678b9e28
+DIST texlive-module-ctanupload-2012.tar.xz 5036 SHA256 81f6abc7641abe3f0bcb095b9e4b224ace39d4e18d1cf56904929cbb7c7a528b SHA512 435853b386277dffc2aca6dab8831dada20d0251dc0d7038fa4b1ebe174b24be9c0fc5b778d7dfa64ce405f0eec7babff5eacb2a00d033ccd773d21378c4fd12 WHIRLPOOL 4f32f56b7dee3c9cc7f1334f2d0c8a639dc63bde6559a15db2f12c5271752ed1774e08fbb2d3bb443051b78ad68651915d40bd04c146edc346de00cfec098aa0
+DIST texlive-module-ctanupload.doc-2012.tar.xz 174960 SHA256 e0efab1639eb866f9933a0541e3097d05b353e0dd2e702b41b7aea72cb8b207c SHA512 c9bdc567b1cda8de9f9e00eb2cd617738fc52344abc46b749209abf80e1ec3f6b713db715a977756b8bea977bbbff34927ff9c112d4b9b1e2043dc9c9f578def WHIRLPOOL 9e994a83c3620f979a7044d37d4f6013672caf412a04e45f05ca2a7833c82b3621305090a6217e71588542ab182aa779daf112343d56674b8eeb3cf68190cb03
+DIST texlive-module-ctie-2012.tar.xz 396 SHA256 5d4a1c8bfd7a66a4fbabf544d377ae4b5be7b646fbd1a60c137bb404e8218da8 SHA512 44cb74a97ecf5241dceb53816bc0543109aba19aaa832c6da6311c09939ac6c5dea82d7358ff589ac6132c7c1ab2c88b6234ca8439b44431cb63c70665b9bc7e WHIRLPOOL 54245c841e3d33c5925a508fddd47fdadff680ca0ec0c61f14a16ef8b0663f9ca111417d66b37197fbbe895b91245165e0ffb0a45d6449ec37ea71a6fd3decbc
+DIST texlive-module-ctie.doc-2012.tar.xz 4020 SHA256 2cbd9e444e9d362b9c1235eb55027089cd8997e4ac2610d32f3aae46d6390071 SHA512 4a1f9d68904028a6dd460ec68b5828450ace6633426bbb30ccee3ae4707efce98bf16e2fe47ab9f100df198b7552b858383a2cab054a153e9cd6742237931418 WHIRLPOOL 57430a94c8b6104f94b379c3bb7608fdf8b4d5824c8a90f7e49dd458a4e617908397abe61a4f6475c378f5e9738d78b78262e34968df6e56abdabb9a17832c31
+DIST texlive-module-cweb-2012.tar.xz 12656 SHA256 05faf9ea203b2d4682dd02b24d8f85d6078a27310b906a9c157a541ded6bc892 SHA512 f55baba71d7dd6f1f6ad194f14afbb58b870edd6298029e1c06394c953aabd2edfecf9e2b934ad084b8b399bc1aea50d72753f957851c157d68f0edbc88e998b WHIRLPOOL 52c839dc70095f9240d43c508572b609355c3d1dc825e0992ecc97a66e38205df78f19e297d1d61113737cdbfff2eb58b20681629b1d5d7d3d5d8213d623964d
+DIST texlive-module-cweb.doc-2012.tar.xz 60928 SHA256 6bbdbb926d7cb440481fab75f0bdf26bb847c438e1968e113a63fe338af1c1c7 SHA512 4537b9255ee980b3411e8a9a6a91a5567c6483cbc2bde63e9e7a659dce84bd09a275dd628d98632504973430bc5d0423419cde0e0faf26b62c3bd9ffe86c8cdc WHIRLPOOL 2ee72e160d858b04bebdcd638a999881dd2c0a90ff435b4ab2a64b29796b26340a7546e4f8c7ddb668ce2352791e155b1d7074140e0855e1793799f8d8dba886
+DIST texlive-module-de-macro-2012.tar.xz 7836 SHA256 1030513f0c87641e111b1ea25312e4738be53d76cb00b1ea97e79c92a9b97513 SHA512 14dfeea1a2c7f8fb79456eca64b156fd1f7e92342f67fe9f81e3893ccf209d472eec20b52f65d07164a21310330dcdcc12032ae43c753aa0dc96640db608a18e WHIRLPOOL dacde22c15e1bb790a31426b4a6d7398af20cc3783158e4e59f45165635517621175a123d58680a15297da8b24e9da1a1fb3f8ee4820a03302913a9df44b907b
+DIST texlive-module-de-macro.doc-2012.tar.xz 49764 SHA256 2ff01a5888b2fdf5bd524d2fb007eae0128c9fe2395097f11003b2f9be6bcf84 SHA512 b6ebe5da1e68829cacc9026a30e6a54e5e97f67202005d9d0d0052f2c2032d9a625ad17aee4e16295426094d64c2ed5970aa8c2d7cacb181e471bb52001d8ba0 WHIRLPOOL 63ad4993278af278001c6deac922fdca224e2dddc7ff87e1f8850554531d642a8c3406868513b4ed3d5383b2ed41fd88e9bed3535ec255ed4024a9e192bb48af
+DIST texlive-module-dtl-2012.tar.xz 20192 SHA256 4e614ca961716ee879e449f3fff0323bb7494c07cf8a62332429cbc3ef193ebf SHA512 a4e555e99694063004bde02c877cd3a65ae40dcb70e067eea9408118822b583bd32aec01d2f263e7bde67794538735775c70a9de039d4454bff3a314bbe59b9d WHIRLPOOL 2035cef66deaf20bc8305cb84b50fe7b3af17fdc96a05d1c9ca96d9764e927c77a72da56614bc3e418fbff3d86b7b3a2f9adee81ab529aa27cb626bfeb377c37
+DIST texlive-module-dvi2tty-2012.tar.xz 10220 SHA256 b5c8b7118979901af41fb15f6e5c7901a5c577131dd467440b7ea7ef971f49dc SHA512 518b73cf96feb19a2f4d7b4281c429f0b949d9fc0981e5ab149ce537c47e1a892897deec5b7ef5047eae8b7d91750b4d5a6b77fe7df4d7c076c24cecb9fcc7ea WHIRLPOOL 5f445623b292bb33ffc3f1d9796e5246400144aac7dd7eaf7876bebcefe8daf64ad3d4b1481a91cd99d17661454e8ae8d313bfc964d284284cf699b57a1b22df
+DIST texlive-module-dvi2tty.doc-2012.tar.xz 2628 SHA256 ef7115fbb35ed0faab443329dbfc309e1dd8bedc759920bacb03ff8aaeba96bb SHA512 fdf0becddceaa470e304fae0883ce0eb30d2bb69400eeeb8aae411f5218ad955be92a193c7ca51ae7af2baa9345032c9e5d1578d57efc6a5a367077e28f16922 WHIRLPOOL 3268d77309f6de6d1b54c14bd5a03b2cdd6ada56089486fd381f2f04cce6ba0a35febb1a25de04ae32152c47ea9d4cb75f6a9beade035448bdea78eca3a5b1f6
+DIST texlive-module-dviasm-2012.tar.xz 8140 SHA256 900135c4a175fc84d4610db83023823eb0ae45ba8b7a1a8e087ca35908363559 SHA512 ea096b73396f9d96563858714704b8399e1e21f1f815ed141582ece4a2ada2d1f61c94c339f5769489a02149c55cd8838f6bd099729207c065da2577934aa11a WHIRLPOOL 9dc2c351cf0100ca42673b1f39d67e4e82bbff2d0ed2001635c44d78d6f5d1e0d2bcc94d6726f4b23b03e05a56aa9d216956fa07e884e459de958212a0f69769
+DIST texlive-module-dvicopy-2012.tar.xz 516 SHA256 ed4189c34495d0061af11ec077719360220810952b721e3fce42db48b70a574c SHA512 731a0cab9bb10dcb2a668fae348bce470ca0de4df26412534e1cfd7881f9b9c60b952f0a260c3bcf2812558d319dbe4065586dbbc37d1cc8cd580cb33dba5208 WHIRLPOOL da48e776c4dfe4cb7f7ae7d6d6c88fd4b2ad666c0a9e9707ca7cf99926ecc690c799ecd2437022e691e1660ff315cf6b97a26e0049adb37b9f1aa440c67614a6
+DIST texlive-module-dvicopy.doc-2012.tar.xz 3624 SHA256 2d013d37e5fdc89d948651a2ac8723e6de5870702305fd961992eac3f4ed8a14 SHA512 71cb1cb89b3232ed678405020efd6cb131a85ae173cfaf7401996fdf11ba2a9e977b3fd363366dc4147519582ca3b4a3d77ee1f7d3fee573f1a3741f984c5821 WHIRLPOOL 4c07227a1e6f15b8d5c41ff1023f78d458704c215d2efeaf2da923f3e0cf7ad6c39adbdec1f65e7e90c4e5be66a97250ae6ca82cab9e1d4bd54d437d8c84f552
+DIST texlive-module-dvidvi-2012.tar.xz 8504 SHA256 a53635fd86ff5acd5f6fc2adc3532221b24e9dd9dd4d89c955abbc9b0c3c67c1 SHA512 148a3b55a22109a139aee1e3c3815a76bb1608bd974cbe3ecaff6893938eee3c529e123d5c1d7ce81fae3fdd5d0cb7f80c786e7ea1d395e753a41e153ab52329 WHIRLPOOL 7f143230308f45d9f6a7ff8dcb7eb95932d2b47f7b1b153d222166d83f48c9b992c19eb8004f5fa7e1782f433f495fbffc44c81dfac1ea3a36fe29cce38855a0
+DIST texlive-module-dviljk-2012.tar.xz 532 SHA256 cb6f792772923d1643d27f6fd3b048a736aac97f1b892ddb2a04514ee7e71580 SHA512 f47000a47d395cabad868d95c4f9e1fc698c2f89f84c187759993467b5a17c366cb6adaa704d2dd5b11c01dc8141d7f2fba1f7a88f7f2bd85c319e504bf3c62a WHIRLPOOL 4abb6338b87083697ff3dfad80ee75f881f5922b1a406ff7d4f362aed9fe0328e78d05313d20828b4b6bb704744aad0c3d2a282952922a8b78d1313b09436b93
+DIST texlive-module-dviljk.doc-2012.tar.xz 36752 SHA256 49b8d91242f14f5d7a76128230874ca574221f585b0ad36ba731f207e0490680 SHA512 cd8c8efab075a08143113bbc794b4787ccd023d26a037defb5b50a3bdfcf9e2d73cff4907e8a5b64430d55bc59a2748f0a503c6da554f044b39301f9ee5a7478 WHIRLPOOL cc7146ee4e93643ef2fe738686589a7b2e5c98e66f1da99785bebf7912dc4ce7da055d711691696bb6ba22c6b4733bef13491afbb782e24b5a57ff6a30316edf
+DIST texlive-module-dvipng-2012.tar.xz 888 SHA256 e6d656a282b2ddda2cb7af9f5a2b0eeef87e233dd4b3784b815d104e344d7ba6 SHA512 c6cd5b1249e22bc5efe44f05a8adcb414f176b184481b63f294f5497eeb7aaea439c89e4b851e490b47d0e878d2c6548272e006b19a21029a326805d29e621f0 WHIRLPOOL 8c2de0ec7aa70be7c282ab4542863285c6cce9678030f5d0502818f0d3089b77d906dbe50497fd10425ba5c072e15f6729cf857c041eaf8b86fe2785b2bd04b9
+DIST texlive-module-dvipng.doc-2012.tar.xz 271968 SHA256 f96e47547c0bb25a455118d60b61fc0760567e3aa3b4f21899ebe3f246145bfe SHA512 397cc3a4649fc8214722e479c12a7957f8ab1a64cc79b3142ea39469145533db7be1a29e249e2132feba00fa6f44401d79fe017845981ef64b709a95cd0b02f8 WHIRLPOOL 4942b4379af005e3d985aa63d656e868688d48733ed627b7f2a16bd8492d8eb4a7631cc82e57e643600dc626ece4e0e4849fcceadd6de1f3f1862de251c9b1dc
+DIST texlive-module-dvipos-2012.tar.xz 244 SHA256 bf09bf25b045366f113cd672c6772c5bdc752edf8d0281b7d9fb48064d88b852 SHA512 6acd58097ca1881458a453aefcd641d6467329d0e667f94afa81db45c4ce3c0eda8458894757a789334d0788090ec09caa57c36ca81804ea9d79efe6c9ffebaf WHIRLPOOL e96a866ed79c190c87ec6405271aadc1b9df7e21cfe6bc30eed9e93bec423ecf4581ecb5b34cb2279f528b56d4df2cc8b6c7e982cfde942cd33d88c24dffe25f
+DIST texlive-module-dvipos.doc-2012.tar.xz 7484 SHA256 83e96b1248279eb30cbfa6d11339179b39be5b29c8d691c1966687cedc9f7e24 SHA512 35c273cf568bfdef10d226b6a4d8b6b9d2f506ebf25dac722ab3eb37e0d4474cc0d44ed2b9abf51575ced461eacff4ea9f471424241e635e91525a69fa753a90 WHIRLPOOL 84f912f5c8f7e3125486e6cf17377bad9342f7b9310b9a320fd828b3d72189420df78f60daaa55d0a6e8076919f3a7b34014ddec00a2c81737ba55a0f9c5348b
+DIST texlive-module-findhyph-2012.tar.xz 3552 SHA256 a4db5b3646c1cbeeb059b59d8b90e262aab639b967161aaeffec34a977313b42 SHA512 3a29ece70678fd55cc5d519bd01e6d03aad134f94edf178be628254410ce5b63d233f2a0cfee2dd703a0cf498673e8af71245b004bc3d4fcce23ef8583cfa312 WHIRLPOOL 3edfc9f1ccb3d0f9a518b7d4d2f6d2d73c57981f4a5dc519aa0f009f8f8579019e45ce0500cd92477d7e6a8fe20512ab31aac871e101474c1d46915c72e205dc
+DIST texlive-module-findhyph.doc-2012.tar.xz 11648 SHA256 8aa34aca58919491758585695c44973ba9a3a4694036da5d1d2117daf2ccc324 SHA512 f0cadb13d32f52be2d6951d09274a7b84a722377ffb125e785963e0f58fb352d323c839adfdd6b98e4e97d71e7a92761eed994cf7b3d74bd98c114bbb708e7c5 WHIRLPOOL 7666a2699dc86e249380655a9a80e475a5b4efbdb965544767990aae408f938982313d87d8760435d9274f0f54441dd69bf0e67ed9dd57546779ac110b2b8fc3
+DIST texlive-module-fragmaster-2012.tar.xz 6860 SHA256 e8cb437c9fb126e7738ac473f8be8184bfb56628e45817bb004878d8f2c55b0f SHA512 df1867cd0662a81b9aa681dcbda5df76d5a0520ec73778a605d82d24c864e60b89252074de6bacb6448011a24a359691b2089cb810ecb6224291e7715e465003 WHIRLPOOL 2c6503acffa34ff730bd6a87eb80cec4e0cfeb9355776763a0ce05c4c08815932d15750bf444ded93ddc8950d16976622ed7bfc665727f540c078099be0ee8b7
+DIST texlive-module-fragmaster.doc-2012.tar.xz 80316 SHA256 29221709348c9a90d5640c53d222fa39360bc838b3c4d8bdefd8ab45f3a1d2b7 SHA512 dba1fe9625d93d274c78126396d3ea552db3c0f86c79c528e9972e4f046e4668f0149e1230ead860c4435f2103531a760b1d6ed66dad61bd81afe4f513cc6589 WHIRLPOOL 2a608ab7adf41c0c31fcb3cdcc10d8830ff63fdbd4995442c56911941ae7ff74e8c95f73905c4b86afc9eef3d0e7eb6398f8d83bbf2cfe0205f41021f5f6899b
+DIST texlive-module-gsftopk-2012.tar.xz 3416 SHA256 ef55b77a7b9953efe22322534479311454db95eecf9b22f3a7a5a4e7743f8fad SHA512 8fce72b6d89d898ef9666ccfe3cfb90fbb6e888c8196d1ca540d76b3b6c1d3ffe65d36975f19021adb4c1a019d3f682ba0a502927cb6718b50f54bb7f86d5d09 WHIRLPOOL 020c6c1bc7a3f30356cb5738d651e5eb774d70fa39b06cd04de9532a0a20c5e53fa7509f36767187519ac576e102f1de600b0771d0128df2a356a05e3b285e82
+DIST texlive-module-gsftopk.doc-2012.tar.xz 12284 SHA256 f733c347cd3de19f1641fdd033f661cf6176300a36b7b36334e3ba24da988c42 SHA512 7f8156713be8d8c48d05afe91fa3f0cd52e4dfbd4c547cceaef4ab52818f0e7da6c890431f3fa1b83646c52862582390542d23fe9f4306d876447d72a5d28c35 WHIRLPOOL 5a0e30e13b6da6f5c3184e28c46de4d53b6234be517bdca43e4852d2c0fdd7ff36085790e6c22afc215092800e32bc4bc21f0535b900b9522efca7f64b815f9a
+DIST texlive-module-hyphen-base-2012.tar.xz 21960 SHA256 95e5e126a12eec9f47fbc74f46774688c9f76bc5b7e4ed3e1764c092296dd658 SHA512 4feaaff8aece9a6f61712da7bec594a6aa3698d45ce5e1b0e0ba9d0a24ebe8d15cdfcac63338a2bfacbd2d4f0948057c9bff089f6a947fccf0f8f23667985e57 WHIRLPOOL 11577e904c4e7e769c9df64b7fdd6f2919f75e173751ab0f4d8a74389236e54304080576a2924f533824ac90fe787347863ef28b7592f1dc24b59bc2d5795afa
+DIST texlive-module-hyphenex-2012.tar.xz 7004 SHA256 0abfcbef069282b935a99d8f1ddf347d31386e8f2e4e99e565ccc18d36362a57 SHA512 04b9c172b5118482e99485e463a8c8120d9544c285a17a08b94f30d79510e23f85bcb953cd3a9e17134f5af20e9ba8787a018a59f4891a73887070b2544370b1 WHIRLPOOL a8693346a7a9cb069cdca78a7e09dba870fa1132a7ce78efee4a81b41b781ff5fc73bd3af2c4c6c9b317633a789f6d09df6e034a4d09bf382013f7edcfb5f3eb
+DIST texlive-module-hyphenex.source-2012.tar.xz 188484 SHA256 c16d36140bf1b387195ed9e17a5adb42a1e764b62e27ba5dc46717a5af744684 SHA512 d7e3c9ff8633d9e42888f5bbf7250dcddcbe7943ab37a76c714988bb1e09fdba61a47f447c857c7d851b6965d6708420b7756a31cb00a97af9ea79da47429cd8 WHIRLPOOL 7f21394e8186d0baea844b58e3da0f2836cc7ad0258152f8e63de2e3aa77751083cbd6f359096d58fe80cf60931ee218cfbe67255aa8c076d487db1ddb32c3d9
+DIST texlive-module-installfont-2012.tar.xz 4668 SHA256 6eb206658b5b6d7918a4c950c412c3a6f1c9ba7ea22218dfe2f7d5198991193b SHA512 5568125313095fe4998ac8e3728af8dedaea569828261d7754b88d90b3b6a9ae15095a54e0f1321babdf6e35e7fa21e8add891512e92c98e0bfeb291ca77d4b0 WHIRLPOOL 3d003a3d8cb5a18c76b240e9fd4ab344cd89c824b11f58b45f2270dc98dc8fe92f4584ed4d741d0c15f3278d7965993e9d98cfd253343d02dcad5e8ccb4bb124
+DIST texlive-module-installfont.doc-2012.tar.xz 55356 SHA256 55481ee55673a6c88d4fa54ea7e2e2a33929ecc9c54c50ba2621f1e28ae83da7 SHA512 8d7d620942c1ea07de33adfc108f7981e7a75f231a7d9cf5b8cfc68115d38481edffc494038b967d54d5d9be16c844a990d0e33e55e48c07a5591f591928d8f4 WHIRLPOOL dc6edfd760b58591aa36bb7cd6e10d69a15c5bc4e268a6156b8bd0eb29e3762f86e29e12806b140e738681e3ccf95510baf418633299beadb44f0a48edc3e0d6
+DIST texlive-module-lacheck-2012.tar.xz 7672 SHA256 da244f7fc997f01a3975873e346848104d8931c359da3930da5a17de2207ef55 SHA512 672af827322d928b1f7c2b1141b41be00e3ccc5f7176b9a016321cf36f3b8f8bc45bf94eeaa488cf81a1df11d9dd8e1953d6d14cd0e8fc1b1d065e00dc0fbda6 WHIRLPOOL 367dd055a15ae90f9dc0108aa77f85b555789ad5a786ed8f8a708be58d2ad32ed522d9bfc7952a473bbb06ea7e1070cc1e9e3650fe05daba8b3229d485c1559a
+DIST texlive-module-latex2man-2012.tar.xz 13612 SHA256 71556df54881d875093869f3b51ea9eb023f6436ab90abb2f5fb9c9dd7d3cdd4 SHA512 c725acf8bea1f4b20ccb88f9cc92bcbce5891a36f678b20a5b8e879c7063127703e3d0f26f31cfd3c1195b79270eafbd238809752a6990ae673bf3214396e9d5 WHIRLPOOL cfbb8f42feac0caa9373f2370bd5202cff32fab077b3f753c709e63db9d7645300e3539c13cc3ce3b0ac1d6eb24b3466bfd11865f462d56828d32e1368cd392b
+DIST texlive-module-latex2man.doc-2012.tar.xz 206808 SHA256 052de7f987169c3da05b427b88aa1f19a6b9f1ec7d1e82bdfcc5017d6b81985d SHA512 89912228d2398739b1b79035e21d4d556333821e04e321c7d80dc77068fcaa3d60031f9900c7e15e06759e52f3795ced680efe97f3c1f567c36b024646184fcb WHIRLPOOL 977f524453e1986840fe9c4a3a4c5fb74f56679ae724b7922241b449efd7d8e04fd2645156ae7a633d5f23b9383ba449cffa5370678eca303a3f9d90380feedf
+DIST texlive-module-latexfileversion-2012.tar.xz 1632 SHA256 2ddaecef290af87fd5916ffbf317826fccc9fbd0dbf290a0f4671bc013efd50b SHA512 953a3e288d24b5da9fdb497934a5e2d8a599a9b47c2e36626573a1dfb7b746cec89645da13a76a6da0a38178b2680e4ab0f9f559aab6ac4560e42d008020652e WHIRLPOOL a717abe781a8fd1f4ca46b082275ee73253efaeaf5ff88ad9d3ad0a81e6c768e98aa72d5c4c8efa3bd67c2b3f8b3a1e3caf77a7f1df171c7186d3b71e7b110cb
+DIST texlive-module-latexfileversion.doc-2012.tar.xz 924 SHA256 28398106056beaeabdad85347412b6b410fedcb8c24d7787715583a4b5c0f849 SHA512 fb8d04bfea0618dc85cd28c9ae02927ef4e1b56ba7f99c611b042f8dc7c6bd958f4faa1fc7a74b31b26be9890dec5b2cff8c65d9f7b063d8d1c1d7ccab58dbb4 WHIRLPOOL 7cba3bfd82246f3ac62f19288088da1b6bd7687a948c6788dda95799ef9ca276a1410d52b1e1d55125dfc366dd858af9159cea9cfab5c953ce9d4553f3b4f39e
+DIST texlive-module-latexpand-2012.tar.xz 2736 SHA256 87bdfa48354cdecd8b764cd92578ba435fe4c7c6ee326cfebee2849e309d7273 SHA512 87848e0bbb6f127b648055c8b1887729f3af4172d88723077bbb03e5dd743cd2223aaff653f2630eebbed6b393d686b0fc642d8d995356b3abf3d7d1ce181d6f WHIRLPOOL ee2e8750e15c5ed6120324dddd10c0c52f6acb087a0aa7c38883a9d26c559753dcb6046015502520b81de3ebc6db8dce88b8660a6d38873533655264e4457058
+DIST texlive-module-latexpand.doc-2012.tar.xz 1464 SHA256 fe82dd255b50b3685f84169e33e8c22b2f20b362097ff8fa00e8a2a489b46c2c SHA512 754fba616e3dfbfb6361208178c8f96f8432b3a6f131e091eec9d9cd1c9df09d3473e6d0f084d954b5b4896255c8cc52b590e9a0808212eece7aa4a6b1cd1522 WHIRLPOOL 2988f096311d2676030f114a427dd2a9a4d0fae5ba7efd19366872cd9a47e8cdd4c50e9f338d4d4f56d7abc441541bcf1a5ddeacb47f1f41f055b0aa6f2bca23
+DIST texlive-module-listings-ext-2012.tar.xz 4836 SHA256 5d1f4d2cc4225b68804b31dc29722d9c2664329c71fa2723320bea3023959814 SHA512 57a7a11107c3fac7db7b3bc248bc028fadc7ebc6172ad778811139c5221f374e47a3fcfefac86c842a7a2f149623ee806158d316832d26cd1bdc2449f65a6c86 WHIRLPOOL 3fa4c95ac3d5f7bb973a2f3e180783787e73faaa2976429f66a54842ac5f648b969a9a180a2d817cc0c2d34fd4212a42bba12784f8c4184f3fb128581dcf567f
+DIST texlive-module-listings-ext.doc-2012.tar.xz 103700 SHA256 84c08b130604716ef30673c106bae49977d67562a63d094dc342141df1c6ff62 SHA512 2418493a7109dd502f740524afe77e1abb8835ddd1b69b669c8eba1dad784920bbd0965ef09769d4bdd6ca629c9dabadb92a88e4ed99fee3f900194440878d91 WHIRLPOOL 775ecd425f18181b08897a3bcba18eb9eb4fc8d0aff814d5a98e6d0e0b5997f65afb79123269b651c0cd87ed4f0bff6de4708bf20c96f9d34c1f688060079739
+DIST texlive-module-listings-ext.source-2012.tar.xz 22648 SHA256 d4241ac0478d7e0d5a4ec1d83597cb2516775daa8562ea9786e70e3bbec6bcad SHA512 bbfa7e1b5b78ebb3a7fc473eec2cad3f65f1a0506cf9c52fc1d2b57d173a42b412f63eac6f09ce57ea1d674ae28bc59c0d1ffaa6d7f5315f384286a5dea67161 WHIRLPOOL 8fdf6040edb2b3b2feb692d7405c32d3321ba56c459e4c617fa82ca44ad626f48413ba8172a74998deb92dfd3845dcb74eacc64ecfd131d3df530b4e34c7d1d4
+DIST texlive-module-match_parens-2012.tar.xz 2024 SHA256 2769656ae953929145514d7de503b06a78afb73b6cf5ecb19b71318e83598887 SHA512 639acc4053168cd5a6bbc651e5169af3be16bc3e4912ea0e339391b43afeef070886efd8d9e4195738da0a524aa39dc73407055df5b02f11c64278dc909e195d WHIRLPOOL a061f1b21371bcfd81a7c5e6897aee9e0af1d0eef959e50f29183724ce412f816e88c6358a1294bd1f587c8a375ef56f6b88a01e87b40f7486771194e8f88ea0
+DIST texlive-module-match_parens.doc-2012.tar.xz 55432 SHA256 42446879b938bf585e2c382889798db71d84a022fd32a56b5f1af237f1daa23a SHA512 6fa9c568bc1e2cc5cb80667604a80e0902083e2d0c6b090c3f5656ff1eabe51f643ad19314af2f47f1a929d4eca084e1f22ac18e3630183f00dc0ef3f697fedc WHIRLPOOL 92a193dd78f07e7982a30a77fa9029fd9baa3a1e85bde3c6a1beaa9726ac6d039cb9eb2dbdf29fddeeeb4f95a81ae3e747699b334879d9982f50d0514710be66
+DIST texlive-module-mkjobtexmf-2012.tar.xz 7436 SHA256 5f135bf892ea4e087cfab58fa7a89dd37a96ae8eb12c655c2aed6307df73b5b5 SHA512 dc799e6fd30e55264934f69ac450761255b9d330ff37700d004037e79bc0fa15669bdbf2c3e5bfbdb2530cfbb383bb3e503292edc4360fc95bdaf9f907d69e0b WHIRLPOOL 4d5a546085afc5f636de01e80799664719a312e63c05e310b8d319412ce00a4466898e560c55c5501d1e99d396a606cd5880dbe530ad4eea9a4700a8af6763a6
+DIST texlive-module-mkjobtexmf.doc-2012.tar.xz 80296 SHA256 c304acdeb07363584f35c788e43c8b5f8d1d9f16f57ea240383f5136bbd7e6dc SHA512 83b9706720d19e286b4fb608cd4a33023c325beb3899a4173eb7294dfc0229a25cbd16c25426640222389acde537e489c17554af40e343ccb75f744c429ec398 WHIRLPOOL 111a79e225cc1c133a3844ca682c6bb5edefa91f51dadb4347c834669e5ba6623ece2d6b1d4da81a7155635fa81851e2e4e3622edd933ffd65ec734879ed5f71
+DIST texlive-module-mkjobtexmf.source-2012.tar.xz 19828 SHA256 a538d190a1dc754a1eb3ece98db92e22149ba16c9a2535f18d0202258b98ead6 SHA512 dccb2812216dafd0b750a30b0e3ffda318bc58646301918a593fef3c9bc01ace93fa96e6529dfdd11c79efce4d654b36c4de20affcdc38b8a58629ce67c731b7 WHIRLPOOL 6072dec2df1c582b2a00061c72bc2bcce72220487f49b1b1a854c0f8b08a3e354c4e105a2ebc03da7fb2fc001df0b70767bd52d56e9c25c74db1049e554594d0
+DIST texlive-module-patgen-2012.tar.xz 520 SHA256 6ee316500de675ba31f12037536756ea60a957e6c96d6397714843403aad0c94 SHA512 d5821734f4e5d948416faa60224ef918d402868f98724d11c31b4ab0688f2a168c76678ab6c9c4c8f23e94379d5cf3693396397e73c76a0a42046487e47b7be2 WHIRLPOOL 4e85f096cdb44413054be3e493aca673f297b2d3c891a31aad5ec7cf6b2c7575b8998ee69c72a871b4eb29e1894c333fe2460da1dcd07808820a66bfb3648e10
+DIST texlive-module-patgen.doc-2012.tar.xz 11320 SHA256 4a06f64590a0802916fe4ba6e02a96f9ea923314814cebd542ddb4392107ec89 SHA512 3144f4a12c0a701e36af201492a1fc571a3fecd2b7597da14252e6ed2688e32408e7120e13a265c1a8e0ba9b972434350d219dcefb4b29d56f6c56c0b2cb12d3 WHIRLPOOL 444f73a6680f1c8fa10243ef9b46c86af1866635fda21fd08dc07d72624e3917657845898730a13abb7fa4da1618862e14355c87e2cdc29cd368f479a2f22326
+DIST texlive-module-pdfcrop-2012.tar.xz 10232 SHA256 250e88f10c576b55ddf14dd813ff46827cf79b71ede0a13869d380e13d667693 SHA512 a554461d0ff0f5c24b0df7589641a1891a43afd10f5a636ca02e9a379596a4481137bd1ffcf1c487a5fbb3166972439b949fc6a902a13242b9e160f81807607c WHIRLPOOL 3fdec0a74d250c772a8f9753b3c9a8a67b94a4d6dee08d858ac8093557abf97765a790b2879d155693c7ea6f5fca194c026db519b7be8a6cdf90c62ba55f609d
+DIST texlive-module-pdfcrop.doc-2012.tar.xz 4172 SHA256 7d0c943d40e0b7cfece71e596ff936ca6b2f965a82e5b649e515d3869a23a68a SHA512 67f2757330e1c398807b1c5a68e9abba363242da6a86ae5207253416c49f51e0870ec69c4140d794d011b328b0c82ad02c9ba0e8b7964cd6341e070a6029e165 WHIRLPOOL 26ab675a082034d9cf6045b0e769f61213b890c29af54c62c068707c651b5d8f10b95a1b91b99821c4e3bdf01fc5e2f9a15b2643ce2d4e704f83e345bb023604
+DIST texlive-module-pdftools-2012.tar.xz 1852 SHA256 efb622b1cf0960642e220272549c5ca0a23a3c6730d455adf91cd67dd6af26ca SHA512 5668ab9ce28b9fc241b5a197123492f0b9b6d274024fa97473b1ff5ebf3a664a6a28bdf01d4010e0053a5172d3d29ab69d61e344df66fcb1260aeb25d7514029 WHIRLPOOL 3a44b881895c08d363fc9ace46103b5847571b0760fb89723e909f68d833ee207677127163bdb6892fa9030d9ff9d82c18dc65a2e29bb3209adf73193ccf8084
+DIST texlive-module-pdftools.doc-2012.tar.xz 20552 SHA256 d03e998d7426aae4453c7de986c0813a19dacb494607efef64013654c6fbcd71 SHA512 098448bb139ede15c77e00a070b4514a160ee9f2d2a9a3f737bbbbeaef864d12599c2a12f674a161ed3508fa5322af08732b22bf7fa944539954d45d3a05ee27 WHIRLPOOL 765697f53eb6c599eb350d4143c4ddf0f3618fafd5d37d8fbbe421746ffeb925882c774b6bc246aa2efbd9967b7794935088e38c649402bcb1f3fbd93e12c4fe
+DIST texlive-module-pkfix-2012.tar.xz 7544 SHA256 283779b6b577c27c3ba1e31c2452f8db4171d4e773dfe4ff36e9bfc666107552 SHA512 cac0c15c8d80f88d2a3e35b9e919c55deac28431d5e48377521e51530c139ef3cff02ad2bd05bf8190d007d8fd23f8c5baa14ef295205705c0454b126a426993 WHIRLPOOL 20cbf7e7850a5b98db28c17181bb602514d2bb1ed139571483557e48405a4d7a70dd22dc85137658489af6bdbb63195c62d25c7f75b82319393e060ae93369fa
+DIST texlive-module-pkfix-helper-2012.tar.xz 16704 SHA256 e3049572cc5dd1983b0f1f8da3d10a4e46f0d82c4996238a5a0582ce66f73815 SHA512 83cb2f4b4d03a03b96652b636592948f3cdfaef4ee75ef614914c3e147832115507f9c3b20c5b425c50a45c010d92fdd8e5dd96d839d09e1ac3480a25442bfe7 WHIRLPOOL 335d2e61906583fd621d5b4064ef81e19bbbfd25431c5f20427cad74f1f05da797e03e73ade297c516398072e3761827852ea729ab77a746a7837f7fb1eab20d
+DIST texlive-module-pkfix-helper.doc-2012.tar.xz 641432 SHA256 f84ce630e0e1bedd97b2570e4f9bb6eff68df8bfc93fa10770b287802337f4f8 SHA512 cc19d846abd9352f6b263c6c13716d0d8e2ad6a8ca0d8ab140abc8521be70b542f2102673d21774d3b44a8a2189ab7368604e2ef39e4a70d0c8e235d06a6a216 WHIRLPOOL c62eb47b2170f09bc4ff4fcf725f5409782cc90277e33285e5441ebb9d2ca42a0c5174412421df92d39c949ec2fd4ffdcf94aa3c397e1a8100cc510ac7ff0b47
+DIST texlive-module-pkfix.doc-2012.tar.xz 4372 SHA256 c24ab52d1abb0fab5423217cc7a186550c29f0039de951dfcbbaa347c136ede3 SHA512 69ff250d59bf212c97aa3f5f99d17e4a0c273da5bf79e29c5925abf9f91cb22f6dd607b2bf29142d24744b9e2bcfce1c0e516ae205ab67272402d27205e6583f WHIRLPOOL 0b81183f4bf1e1b10428a991871988e1b7871af63e39bf4b6813cebd5e5ad349185808b76309e0b378f795475d8875c99a76072a67c7f35cf3a0b05971700492
+DIST texlive-module-purifyeps-2012.tar.xz 6204 SHA256 4ce55367dcb2fed6ff4eece633b49c9490639d9fe69f178ee5222e821584bd7f SHA512 894fee48158002532b09b1a56d4bd115053de156b3886fdf00c43e3da737ffda7c7f0c1d250bc5637c28ecd47864b0982357d51a06512ecd5aa68179a8ad992c WHIRLPOOL 744251218978a6c4f36dc05ebd21bcb30549e9fda91712f1867728c182ac4e2493d7d0e8eb9fab3f6356be8d502caf8eb2319d9f0e3850923807aabb94539f2f
+DIST texlive-module-purifyeps.doc-2012.tar.xz 15056 SHA256 ee7c35e244cc480f1076aaebb33e04b67f9055ace62697217e97dae5321c7094 SHA512 bccca2497560e12ecb27f087d43e7fe76f2fa137aa3ba8c0c6f6a1c45148c7ec679da9593bcb38136b8da2c00708419fffb1030205db610dcb86bf527f99b101 WHIRLPOOL 82701b317aa5a8bb27cf84a02151b69cb84a44baec421751492520949f3b69bdc788676482836f7c2296105e7d08606074810661a39401c93760dc34178515d4
+DIST texlive-module-seetexk-2012.tar.xz 17752 SHA256 43083988b2e804e3347c01f83aa821c97eee585be1c47d19baf93adb8aa327a4 SHA512 79b5e3821b96c3e1e8d28bc2fc5ccff71f47f8de7cacad62a372d193cf747dbc2de6cbd5483410e941d9144b702d85640994d074eed1c6d9fad62dcff85402bb WHIRLPOOL b9aaf862da61078abc7c75ac8d494af19e27d0a534e30ced3fab86fe2f956b3aae15781120b94770505e34c0e3778ef53005daa62ddfe43a939f7de1f5ef35eb
+DIST texlive-module-sty2dtx-2012.tar.xz 7408 SHA256 2a4d2fc1bc38306e25e3b0e09b0c941133e2397f542d8462aefa18749dbd5df5 SHA512 463c1e3beb66186549f19157e139b38ee239593b0f342450aa6fdff7db21d01f62e0621485cf76dbb4679a58d8aa956a8074cff5e143d1b972dadef11801a1ef WHIRLPOOL 4ef82c5b7e416d199b28a2dbb2b81c3986765cecafdc15dbe8cf65ecbde9c75b8031b5832c4830f5feae24c748eb520a59bdc618368293c93c10024f730dec99
+DIST texlive-module-sty2dtx.doc-2012.tar.xz 2352 SHA256 cc0c229ee78fc845e3cf290ec51bcc97d7e42656dcd4bf15bd84a32f3257fe01 SHA512 281b89240fb06419b3cf6ca3bd760ea266af9ab2fe4181522bb0aacbf9f2ba120acac9aed35008655c1960831f7943f3f8397b12d2dd2185ea80f618c4835c8b WHIRLPOOL f0e7110d628c06a5696ab2489dc9b4c74dc8ceba67bc6fb3671f9dffb91791be8e53743d75d53f03172a28a1b82f476e96f6ee37a8734b3d2028382a710f0398
+DIST texlive-module-synctex-2012.tar.xz 244 SHA256 91e8a2c3e58e78b86ea8e8d468987689ba2a3e6f8467f251dfb546925326e119 SHA512 55121e02cc9e40b0ef92002e856dc9c2e7d405d0d27da5fe86f78262c68f0999c90f514ed4447d2ea6abb93dd12c97d9207f941ab5bf4b80d52848a1fc9cf82a WHIRLPOOL 6303d9c5eb790521a39f372ac9e35304af88ba7ebeeddc55f9ee675f32f8d81747b061f1fa69a53e75a31af9cfc65abfab58c150efa220d1f1f342d86d38b7e1
+DIST texlive-module-synctex.doc-2012.tar.xz 10040 SHA256 c6755bb228c6a0375ff6f86597d5270edde9d4ecd339a13e3bc1be3db533b8d1 SHA512 58ca83e420a432f73e1d3283612eefbc66a0886d8942e40a2189cf19573a96b16b798d9b8ab0ac85f5b503c6895a0c54cd56067afbe579f5a88d3ae211437a1e WHIRLPOOL 2c594ba17072e721556403693b1d9725fcb77c7208bc685b3945377eb44348d8965a009eccdeb68169c3959349981d9186a660e74ca7451c346b3c10064c0711
+DIST texlive-module-tetex-2012.tar.xz 28912 SHA256 955c31b297b55383112b83e1a97907bde4581cad9c33680e4cc23e4a400b09fb SHA512 5b3f72b0af4eb5045398a29dd343ab5a71d0336cd7f509e3cb48682d3c5e8d19c0d8e7d13ef43113d9354ce2461e6f6ceac700cec5e47db42bb1a1ea0504a00d WHIRLPOOL 95c341c3140101b02e7e880fe73f50317224b6ecd2869abe3a3bb7cc73701cde8673a510a15841de09a15fd803f9ea573ceea06cb3f89b9d7b20e1f76f9100a6
+DIST texlive-module-tetex.doc-2012.tar.xz 332676 SHA256 52df76e6f2ae85a7ff623b217d403093d9f7285b5d83f0da6e2f6c44c6f18bc9 SHA512 78564c72baac0fea6bf24a3b6a252324dc5c841b2962dd887536700f288f0499f4061223a7b6000c660fd95652a35773c9c8ca3a63c28b7cf8b15e007eb4c7c1 WHIRLPOOL 812540b4cd69c72e4be680249190d02c4c9c8d464494bf8d4be2ac0cb9796db7a3631b6db6d530cb0279b55ac3320fa1b8da3265ceb6a5c4ad08e3613114516f
+DIST texlive-module-texconfig-2012.tar.xz 4288 SHA256 2fcce61c0effa2f68827c5fd5ab0c3ba380af7753aa14a031994a8c1fc47ea55 SHA512 b5ba72bb63b8b84d8c6e7740c3f68bc6fc2711b3cd21497f2f1d7fabc11cb75d6424c9da6d9bbfb4d9d26be2f9122435cb0cba7db6fb1a87a1549b9a00abe9f2 WHIRLPOOL 0365966f7af2eae780ea112a146c7b64099de369ba3e17342ee2f6ae2c9621f1201fe799801d40203b83ce97c0437fd3c64518ae38fc751c0be3edece45033a3
+DIST texlive-module-texconfig.doc-2012.tar.xz 9636 SHA256 13e27160eb4e0960b799cded221cea2a4e8393d3bf1a6c5f94f7c92050ee2d5a SHA512 05391817506b629d0b56fba0cb57607868789ec84de4318a6bba7e66b3366bf7e12b1c858c2e50e14e7dc660699190fc6ece061319eb790249b7399cfde7113a WHIRLPOOL a42d35e2be90e0ec251ef9c9674bc29f2ff93f19cb1820152b94439806e31d5e60c6a414a57a133bbad5f9e32464c3436ddefe9ee6a7a45d57689eb8c1044509
+DIST texlive-module-texcount-2012.tar.xz 25832 SHA256 00022e51fcddccbde4a466c6b6eadd8a64e33ea4cbda51adf39fb1d4a71ea792 SHA512 a622fc0b894a8c7d03f2693bc381876eedf8ca29153a858ffebfd12fd6a60587d8a4bda44b62c1e2ff8e28de44c8c9cf30fa6e9fd2506b13a57a482b674055e5 WHIRLPOOL 21568fd0d531ffa6d041c3cfe1170139cbb974c8e91719ffedbcfa13d3d4488a1f77e8bc6135974c1dcabe4a4a6e79ff719caead127689abfd101939e29e6329
+DIST texlive-module-texcount.doc-2012.tar.xz 319296 SHA256 a8a210821752e28b074cdab8cb0d47c31921a3dcde73622c428e688b34099c3b SHA512 34352740007638c7169d979527021c9cb2bdca2a46b295be2ba11b289c3c28a3b6f526d3158a30e7be37255b6abd97573f5d58f46abc2afb2293162c0a5a163a WHIRLPOOL fac3dadb136b69b38ab6b86bdc75b90691b90a4ce7668fbd7c4c135d9d378c1641f840fb2057fb2aabb595f7b774c2378a2c966496a030d568eeb5ae883ebdaf
+DIST texlive-module-texdef-2012.tar.xz 9268 SHA256 b8cc200f47ad4906f877269262e4b1b4d7478cb8df3e28edab0600370932576d SHA512 da34a7f6d7d2f799f9796dc743559be7dc911f7a9049cd3ad133f350bfd5ae32ec1698bffcfb78b2fede3a9ca6ce079b096c4cb5a67c6ec8083930671c8034a8 WHIRLPOOL c1d67a25b896e1055f818211620bc10c90ba2558ff8dbaf568c21aaff5a0cb2e6f40b06890e244ec1e004a83c867a91139fe95318d37f8bde07a068e5f5c482e
+DIST texlive-module-texdef.doc-2012.tar.xz 249876 SHA256 c3b1ad688072d50bae69f0c7afe4d9fc6c5b506eb347fd0cad49a4eea5a3bc88 SHA512 eb7eceae35dff2d5d25062aaad91dbb14df5a15d26b58dabc4678696c2de43c1089587e6a36ce3fe25be95ed97a81754284878fcb6efd3fa7a5bd4d70e415c45 WHIRLPOOL 4de8370a756c2bb793a22a04988c6e27b939514562e2c36d8cbca6a501cc5759e0d2928da990a9083fd7c24fc7fdc6f158af6a7aba3f93037f8d2e0bfb0b5d97
+DIST texlive-module-texdef.source-2012.tar.xz 3892 SHA256 0f87b3f86695a80388a30e649cbc344c4a262722d67c0921f9e9510269a9775d SHA512 05882ffe5c863a710e4d36190bf50cb2544c211282d852898a94dabe8b287be5b3d46647fa1bcffe8fe0e699f5e021b3e5ccd67fb10c4107ec79dc96d4fac02f WHIRLPOOL f1bb84d112bddbcb14cc90e0bc109a642d0bff103a5a021f3a057e606bf006d4e96a4366f2e8f09996ac8c8b15800705a02a7cfd454093dbcc9bd4de15441e39
+DIST texlive-module-texdiff-2012.tar.xz 7136 SHA256 55b7e1a2d206704e2385e708d21de60f4edfb02824dfa393f3e5f186f8bb1aa7 SHA512 13f34d6607987d2a129d6f56538f9378fef3c584d9b8212e34cb01e274a93c60f56b9b333de8e176dbd5e26b8a4f7765af29a5231d7adaf6408bdf9624fc37ee WHIRLPOOL 85cbaff6827cff79270c53baf47f337bac0376766d720de586e6a3885ecd971927b2a90f55ad79d12f597b790373f103af7c3a6eebebc731d2dd11d3a0ffb4f6
+DIST texlive-module-texdiff.doc-2012.tar.xz 10296 SHA256 07f4b8852f229cd8654bf1f1a8c8f1033ed325ef5d50a1c458334860d7e133b5 SHA512 58d22225e2d55b6871b51516cd916044ad888dfd4d8c0d19153e8432ed665379e486d562f1c3234d0f141f578c1ca6273ca870b9bb8c5dbd0b2c5eadb12dea43 WHIRLPOOL 39d7906db0bb02cdaf979e82f57c5553a81e2f4980f978f2bc58415813d1d889e0bdaa3f318ec9cd7f904c21686137ad354676bef6dab0741a844a08cb876cd4
+DIST texlive-module-texdirflatten-2012.tar.xz 3076 SHA256 fa0a9c9f2acf2725b333f2dc6193c25c9240070fb5a854b4bb3cf5aad74ef011 SHA512 8047dc5cefab8d8fbb6d53fb12e3602339209477a015c0dd52581a824f5f6722bd8cc50d25ce370d9e16886cd23d02c5119b9a2c36b01fe3d41f79f852091f8d WHIRLPOOL f3835aa66fd1e828db82a4b1e3f2229dc6658f4a312cc3f8151acdd71b3eec03f10d5eb09c0bcfb21534249449013dbe23943d160537b05fd6bbc2e73d806e4f
+DIST texlive-module-texdirflatten.doc-2012.tar.xz 5616 SHA256 c04f1bd709b81ee1a98373ab5886cb740dd1250e3c0fe6dab5f1e54d05e5457c SHA512 c64f7bc95d2d6aea0a1967689ffba9df62d7c9013a8f6b36a52f4ff358de86ee5b13f4e0eb396c3cbdb6dc2f7dbfccf06e37d00250baa9860d9b22ad365d7c61 WHIRLPOOL 74a56dec1452bfd7adb3c87079eb7e91d01420118a0e6e14c58eb59ec07677a2ad5b694e2c9d4f7bf9760b90a9d187ad88aa8bc93eb2ae476c2a2e5d8be8306a
+DIST texlive-module-texdoc-2012.tar.xz 167440 SHA256 fd3f130e32265cb80712175398401c9ca6dbb5f1bafb97e5f4586d8ddbc77f11 SHA512 9ab9cd99c477cf4b174822b02d17267fccba4d06190228802f013c94b6f2d6b6a3170059e91bc60ce09de48d8a38e80c9f1c0dd5dcd655b2d16fa957e23e1bb0 WHIRLPOOL 1c0353341cc43e9029c77b9eab764e8acd3d6486b3f2ea71865d6a2e58647dcef76dd965ace908b955ce0c1dc85ea02991161c136c75390d10f7c173393dffce
+DIST texlive-module-texdoc.doc-2012.tar.xz 140348 SHA256 671ecf24020dc5090cb053054558c23738e0b1b25ae7d8ae9282cd896a490435 SHA512 8e4d4175127090bcf0ac7ca61df19263c7fb5bedc1bfa88100bee4889c3278dfb07d11cf297bca5c72dd00749ffa0f13bdcb8133ae362cbc52f1e53ee2ca8678 WHIRLPOOL 42746cd14b2375c9692fbcc45314eafd4559a5dbb83088b7852f0e2b4b99e025c2544f5140de5e401daf3a9298418d7629f77359a6fa9d97befef2fffab5d775
+DIST texlive-module-texlive.infra-2012.tar.xz 201208 SHA256 5fe00631127b70ce82a76d70f3b1b71bef0eacef875bf3558c136a76943cdc04 SHA512 7f665d9a1bd17c96085829f56560fce1021e27e33a5448bac38b4f80c0632592038e1f867cc72ad28a8164dbbd460b1d9c63a4c29f6d2419c9f59eec4f897c0f WHIRLPOOL e4b6619a7bbc863388d2e568755abef3b953e632b701f8767e801bb7ece28f87920b1af61066721a7b5e1b8934dd4a153f7ed3a16b5ddcb3b3ce8a8de3aaca17
+DIST texlive-module-texlive.infra.doc-2012.tar.xz 87012 SHA256 a4c83ff198dd01e1fb892367e56e9acd306cc931f1a3163956dba8f32d7dccf8 SHA512 144986792b7f47fcac25a246ac910b0e10f12e827944a4e5f2a005611f2f15e3d295f3ecc41e8722255aa46c1d8fff774614d7440e0f916feec5fa493ff348cf WHIRLPOOL c3e71f58d8e5fd66c4441270bc93ee82f3bac012cd7826efce404e4d523d3c3d217f62d635968db46c9bb91662ce827d32d24c154e8f1f763ac2c2bfda252a47
+DIST texlive-module-texliveonfly-2012.tar.xz 6144 SHA256 81d276b4f7e9a4579ce889a0a4722ffbe1a0b1ced16aa06426acda9c2e73c71f SHA512 a43746ea789f47536e6066ee3bb0e1ac3c06e4cf026c0b0af730e1c6fa4a16fcce251a87f0f06500d85f4c0bccb8269480865b62c28be9c1334e6178d6e03071 WHIRLPOOL 7f99a942a644a18e9184cbaa80738dd9a5d24e2b54c01eb023b5a4bd3b7975bf6f4bfbc51ad15bad5503f21193fb6203174f06d1a360b114f5a8a07633c8636b
+DIST texlive-module-texliveonfly.doc-2012.tar.xz 704 SHA256 939e915e8639bbe6419d6443536c9a4993f0994fbb084bc1d27603c28c3ddd46 SHA512 5faeadea23eaa50c8609a1059af31ca4149fd90a5c2ba3ff501a0b8559d2504e52093cab79115754c1038ef932ea96f7cdd378d325940bde3984c3d3637b774d WHIRLPOOL bf063ce33355db4e0b82e568305f1e84acf403b294dd5fdfc2f3b048b6f1020d0a6f6932a839d27959836b0fe61c15cf8bd4e6cdb3164d70f1e641f8f398ceb8
+DIST texlive-module-texloganalyser-2012.tar.xz 3476 SHA256 84d5c1df6d597cda2d459f70c7e37df4564999c8c75bfbf693bb5539414f6605 SHA512 c42593a18f238a5007fb8383d2d5a0d83928fbb57cdefc31fc6cf1e3bce89950f74ab3123f17ffebaef6152fabbc056a09a197b5067466e3cfc3f3c418ee71ce WHIRLPOOL 37ad6ba475d30edc7a4f5d9dfa0a312100665563cea1da55b976620c8a14584a7dc427d0eb61a1ab6a393ac4510b9b7ae859b374fec053f90580c7cfa93e6d7f
+DIST texlive-module-texloganalyser.doc-2012.tar.xz 512 SHA256 d600cb9a3ac8fc3eedffff7286d9c299651a5a578be7e7d8940733a6e08ee57a SHA512 a5c250da447c2e3128f50b3af48f9cd6d4b4d40206e45f901bcec80e70edb00b3317bc7e50a3431847b8d888a592b2bfb391b3367f04de6f75bbe3429c24ee25 WHIRLPOOL ed8dc3b142b619773847e6e5b426141aa09eef564ae9e14eac4f6e2df3ab654d766f76beefca337e7ece3e0b1a333baca6774f9252ea455cd5150a0a92a5f26f
+DIST texlive-module-texware-2012.tar.xz 572 SHA256 7c197689311939d78570437749d9fecfad8cfdabc226844241c5a0dbac2fda0a SHA512 4af0857bcee2d093f2e634e9f3327ce75b9388311a1ebf2492c869089aa50f7e8122df647a31354686d5b09614cf1be969cb1a9804859817c856802f321f7dbe WHIRLPOOL 0216a6e22e7e970d45645917c906d0a5b3120ca895a84360dd5a7279d7aa40b19afb7dda4bd1c2684053829b48ba2f25c26126fcc8c1fcb767737614e1260df2
+DIST texlive-module-texware.doc-2012.tar.xz 6948 SHA256 321ed8b5818ab709d63bd44a0de5f5e7f1bd8c1f7515564702f6602a1d310902 SHA512 e8b5bd96ea141af268105617b1bc8a232bba1f28fc5c4b79ee95f652face666d0e09455fe12a911f1bbb20bdef5b61554749fe6d0143791a0b74af41455ee719 WHIRLPOOL 7d1358b15d2b2afff1844bcac6bfffece23485d880363151d7e8ae08afccbc7dce6392b26e91821d11e01b57ab5134f8491cc0f91de8e21f4de4893af3de42f9
+DIST texlive-module-tie-2012.tar.xz 484 SHA256 53b2013f1102c46a29fd7d9b2a00f4b97c53d1dd9e4803874288cacdec123651 SHA512 e4b88a9ef25223e97eea8f8c3a5c23beb552577f4f5119972950d37301f69410c3633fbde2270c624e4985af651b49ed6d3d494a646fb96c311d26932e6491c6 WHIRLPOOL 597d10e964b2131db276607b6d08fe6898f55b7f988a97a11428b4fb39db0290c65bda9d1e3487148e3410bada3fe8d31f3229995abc5beafc15bd189a417241
+DIST texlive-module-tie.doc-2012.tar.xz 3596 SHA256 690eb0767df2e857fff31ea05a8f76a0eba56be8369a09dfffe2497154ac6e10 SHA512 a7ce197a90a7ce5fc69a6ad7eb0a7b97f196722b9817e8cff1b93201cb903b7d99ec4924e68ef4ff94edc42cf9a58c6a9e98b44e869bfc0f961569a6d010ce77 WHIRLPOOL 6656b9a8e10695bbdc9d197795982928f090a91206375df25c55c61512cb1fc69c5373d20611e07a3fbc0fef0019e4c2c260e8f3984d03afa287c8c14c12d3af
+DIST texlive-module-tpic2pdftex-2012.tar.xz 436 SHA256 14fd8c2714f0815278071dee9978d4c96905a93ae2bd1e6c7125886a0bea0d6b SHA512 5146bc48613f2f375ee374f3c26ac299ccd9fa494b84c8288e899e1e602166bae36fdc5f9e32d5d4c146abbfd3098607008b126b7773ca1420e6e57f23e385a9 WHIRLPOOL d5441ede8e3cb02c1c35801b4ddb369070af63bea3c051f56639bd823c1eb39a2100a2c2db7b8546c7f00c5adc9964302391f40a9a72c9b038bef5f3fa3581ea
+DIST texlive-module-tpic2pdftex.doc-2012.tar.xz 41912 SHA256 e26daa43d1b81fcf8227d48013b893012f6726e4a6b81ed27dbe111f3dd5f77d SHA512 d3f5d3737fd2f8a588d4c27fc31351f2c638ee5ad2dda27a64d1d83b1549082286a3752ce5a24baa76e8d0731470684fb834522861502a5834e4b6bf0e0c0076 WHIRLPOOL 5275507e68d75692b3ca83d9eef692d805e6ff411fd167c6f6c8d25a8933a450f695f0c85214efd2f1c52598a792bfc66626d49b13513b7c22ef4fe88137ea6d
+DIST texlive-module-typeoutfileinfo-2012.tar.xz 1436 SHA256 784014d721f6a42db2f0c530a1cbd9882c126a56c50533c8e2706aa2c470f9cf SHA512 87d5801fe18ccf7db381e681335b03614711234a761d9f890ade8936df3ce871796f580e6759c981df4de66b06cf0ef60311c31648fe3ee9749c651eb43d4f27 WHIRLPOOL 2e141711ba3ec1a0d315466871311c6040996c78421176a385086b2da413870f2c3543517f96da88e7d43868b11332bc140d444baa743f67a387100b353d7d78
+DIST texlive-module-web-2012.tar.xz 512 SHA256 bdbe20eaa1816032f99905145fb01631a9d9c2e2ca8051f9b4863ef1687d03ce SHA512 6ed075516647f0df3a287ebf4648c65b933cb59517a8d41a5c63b902fada13bf27485e5e0f51e59c338901aeccdc5913f4d7cac9e7ea2f7d027463e51b356358 WHIRLPOOL 10abf739da5fdeff3842721ecb34caec64ffc012554ba9ebd1450546fe13cb127268c2f512dc2d1db2408197dbf652c6be98c9581c4a7e8fb808ec4e91f9129d
+DIST texlive-module-web.doc-2012.tar.xz 11508 SHA256 c0023456ff68d89ecccf5d368c8bb19a4e90baccdda814bfe332213031d09440 SHA512 664c1b1579bfd346c6dd14f1df5919105e945e8f7e29fb0a49158e2fb9b8fc33432d6b206bdda7560991d82f577dea7decd52378405e0fec75c450addec2d765 WHIRLPOOL a546a7a57723820bb68b1152b62656e976af59390013091cfc00e9635d6bfbe223b3848f691aa7d443f342f236f8c1b126b67be6df801379ea2ecdbb23319cac
+EBUILD texlive-core-2012-r99.ebuild 11172 SHA256 3ccefa931726aa7c7d2f07d18aefb7cbb581d6ff722586e1d24937ae81f33773 SHA512 628ab5f9a29e0d5e8055dde1db0f29be0e4981d1d1d0ff677c293f5256a6bac3f2cb2724635044dde99c1b5f2a6beda6eec8bca5141d0f0071af25f01d4cfa0a WHIRLPOOL 22b132032f5712eb60a0bf60d151756e0560459d620619ad087b5f1b4b7fd9a7c512c50177932c75d217c648954c75ecbeaaa7e8014b9d95cd389d0eee9b8bc9
+MISC metadata.xml 448 SHA256 ddaca86e81c2eaf01ff5e7d613777a6c2231ed0f09646cb303e23b0e90c08d02 SHA512 c414f498afa7c6effabb5c21f85c1fca64271e9d8a429e15e86661c8b7f12adac0beb6b90c74a7309cfe9d20e639c818dc2a2045b4c315c0924583f0e71dca4b WHIRLPOOL d0537703ae9ac1a072795b05ee90b1e06d4f1dcb61b0e5adbac05f91db442a44846f909e63840518790d765c71b9a6314f58602d1489cb482ca7b7826cd88ee1
diff --git a/app-text/texlive-core/files/texlive-core-2012-pmx-sysdep.patch b/app-text/texlive-core/files/texlive-core-2012-pmx-sysdep.patch
new file mode 100644
index 00000000..b42c6b8b
--- /dev/null
+++ b/app-text/texlive-core/files/texlive-core-2012-pmx-sysdep.patch
@@ -0,0 +1,11 @@
+--- a/texlive-20120701-source/utils/pmx/pmx-2.6.18/libf2c/sysdep1.h
++++ b/texlive-20120701-source/utils/pmx/pmx-2.6.18/libf2c/sysdep1.h
+@@ -10,7 +10,7 @@
+
+ #ifdef __linux__
+ #define USE_LARGEFILE
+-#define OFF_T __off64_t
++#define OFF_T off64_t
+ #endif
+
+ #ifdef _AIX43
diff --git a/app-text/texlive-core/files/texmf-update2010 b/app-text/texlive-core/files/texmf-update2010
new file mode 100644
index 00000000..a877823e
--- /dev/null
+++ b/app-text/texlive-core/files/texmf-update2010
@@ -0,0 +1,165 @@
+#!/bin/bash
+#
+# Utility to update Gentoo TeXLive distribution configuration files
+#
+
+echo "Configuring TeXLive ..."
+
+PATH=/bin:/usr/bin
+
+# Fix for all those with altered umask for root
+umask 022
+
+# Make sure we have a correct environment, bug #30432
+# The list of env. vars is taken from the INSTALL file
+for texvar in AFMFONTS BIBINPUTS BSTINPUTS DVILJFONTS DVIPSFONTS \
+ DVIPSHEADERS GFFONTS GLYPHFONTS INDEXSTYLE MFBASES MFINPUTS \
+ MFPOOL MFTINPUTS MPINPUTS MPMEMS MPPOOL MPSUPPORT OCPINPUTS \
+ OFMFONTS OPLFONTS OTPINPUTS OVFFONTS OVPFONTS PKFONTS PSHEADERS \
+ T1FONTS T1INPUTS TEXBIB TEXCONFIG TEXDOCS TEXFONTMAPS TEXFONTS \
+ TEXFORMATS TEXINDEXSTYLE TEXINPUTS TEXMFCNF TEXMFDBS TEXMFINI \
+ TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS TEXSOURCES TFMFONTS TRFONTS \
+ VFFONTS XDVIFONTS XDVIVFS ; do
+
+ if [ "${!texvar}" ]; then
+ if ! $(echo ${!texvar} | grep '^:\|::\|:$' &>/dev/null) ; then
+ export ${texvar}="${!texvar}:"
+ fi
+ fi
+done
+
+if [ "$TEXINPUTS" ]; then
+ if $(echo ${TEXINPUTS} | grep '/usr/share/texmf' &>/dev/null) ; then
+ export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|/usr/share/texmf/*:\?||g')
+ elif $(echo ${TEXINPUTS} | grep '/var/lib/texmf' &>/dev/null) ; then
+ export TEXINPUTS=$(echo ${TEXINPUTS} | sed -e 's|/var/lib/texmf/*:\?||g')
+ fi
+fi
+
+MKTEMP_COMMAND="mktemp -t tmp.XXXXXXXXXX"
+DIFF_COMMAND="cmp -s"
+TEMP_FILE="`${MKTEMP_COMMAND}`"
+
+if [ -z "${TEMP_FILE}" ]; then
+ exit
+fi
+
+# check whether config files for fmtutil and updmap have changed
+STATUS_FMTUTIL="0"
+STATUS_UPDMAP="0"
+
+if [ -d /etc/texmf/texmf.d ]; then
+ echo "Generating /etc/texmf/web2c/texmf.cnf from /etc/texmf/texmf.d ..."
+ cat /etc/texmf/texmf.d/*.cnf > "/etc/texmf/web2c/texmf.cnf"
+fi
+
+if [ -d /etc/texmf/fmtutil.d ]; then
+ echo "Generating /etc/texmf/web2c/fmtutil.cnf from /etc/texmf/fmtutil.d ..."
+ if [ -f /etc/texmf/web2c/fmtutil.cnf ]; then
+ cp -f /etc/texmf/web2c/fmtutil.cnf ${TEMP_FILE}
+ else
+ touch ${TEMP_FILE}
+ fi
+ cat /etc/texmf/fmtutil.d/*.cnf > "/etc/texmf/web2c/fmtutil.cnf"
+ ${DIFF_COMMAND} /etc/texmf/web2c/fmtutil.cnf ${TEMP_FILE}
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+else
+# if no regeneration took place:
+# always regenerate the formats to be on the safe side
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}3"
+fi
+
+if [ -d /etc/texmf/updmap.d ]; then
+ if [ -f /etc/texmf/web2c/updmap.cfg ]; then
+ cp -f /etc/texmf/web2c/updmap.cfg ${TEMP_FILE}
+ else
+ touch ${TEMP_FILE}
+ fi
+ echo "Generating /etc/texmf/web2c/updmap.cfg from /etc/texmf/updmap.d ..."
+ cat /etc/texmf/updmap.d/*.cfg > "/etc/texmf/web2c/updmap.cfg"
+ ${DIFF_COMMAND} /etc/texmf/web2c/updmap.cfg ${TEMP_FILE}
+ STATUS_UPDMAP="${STATUS_UPDMAP}$?"
+else
+# if no regeneration could be done:
+# always regenerate the maps to be on the safe side
+ STATUS_UPDMAP="${STATUS_UPDMAP}3"
+fi
+
+echo "Generating ls-R files"
+mktexlsr &>/dev/null
+
+# Generate language.dat file, from texlive install-pkg.sh
+X=`kpsewhich language.dat`
+Z=`dirname $X`
+if [ -n "$X" -a -f "$Z/language.dat" -a -f "$Z/language.us" ] ; then
+ echo "Generating language.dat file"
+
+ # Save the old one, we will check if it has changed
+ cp -f "$Z/language.dat" "${TEMP_FILE}"
+
+ cat "$Z/language.us" > "$Z/language.dat"
+ for i in /etc/texmf/language.dat.d/language.*.dat; do
+ [ -f "$i" ] && cat "$i" >> "$Z/language.dat"
+ done
+
+ ${DIFF_COMMAND} "$Z/language.dat" "${TEMP_FILE}"
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+fi
+
+# Generate language.def file.
+if [ -n "$X" -a -f "$Z/language.def" -a -f "$Z/language.us.def" ] ; then
+ echo "Generating language.def file"
+
+ # Save the old one, we will check if it has changed
+ cp -f "$Z/language.def" "${TEMP_FILE}"
+
+ cat "$Z/language.us.def" > "$Z/language.def"
+ for i in /etc/texmf/language.def.d/language.*.def; do
+ [ -f "$i" ] && cat "$i" >> "$Z/language.def"
+ done
+ cat << EOF >> "$Z/language.def"
+%%% No changes may be made beyond this point.
+
+\uselanguage {USenglish} %%% This MUST be the last line of the file.
+EOF
+
+ ${DIFF_COMMAND} "$Z/language.def" "${TEMP_FILE}"
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+fi
+
+# Generate language.dat.lua file.
+if [ -n "$X" -a -f "$Z/language.dat.lua" -a -f "$Z/language.us.lua" ] ; then
+ echo "Generating language.dat.lua file"
+
+ # Save the old one, we will check if it has changed
+ cp -f "$Z/language.dat.lua" "${TEMP_FILE}"
+
+ cat "$Z/language.us.lua" > "$Z/language.dat.lua"
+ for i in /etc/texmf/language.dat.lua.d/language.*.dat.lua; do
+ [ -f "$i" ] && cat "$i" >> "$Z/language.dat.lua"
+ done
+ printf "}\n" >> "$Z/language.dat.lua"
+
+ ${DIFF_COMMAND} "$Z/language.dat.lua" "${TEMP_FILE}"
+ STATUS_FMTUTIL="${STATUS_FMTUTIL}$?"
+fi
+
+if [ "${STATUS_FMTUTIL}" -ne 0 ] ; then
+ echo "Generating format files ..."
+ fmtutil-sys --all &>/dev/null
+else
+ echo "Skipping format files, since they are unchanged"
+fi
+
+if [ "${STATUS_UPDMAP}" -ne 0 ] ; then
+ echo "Generating font maps..."
+ updmap-sys &>/dev/null
+else
+ echo "Skipping font maps, since they are unchanged"
+fi
+
+rm -f ${TEMP_FILE}
+
+echo
+echo "Use 'texconfig font ro'(rw) to disable (enable) font generation for users"
+echo
diff --git a/app-text/texlive-core/metadata.xml b/app-text/texlive-core/metadata.xml
new file mode 100644
index 00000000..68edcb81
--- /dev/null
+++ b/app-text/texlive-core/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>tex</herd>
+ <maintainer>
+ <email>aballier@gentoo.org</email>
+ <name>Alexis Ballier</name>
+ </maintainer>
+ <longdescription lang="en">
+ TeXLive core binaries
+ </longdescription>
+ <use>
+ <flag name='xetex'>Add support for XeTeX: a TeX system with Unicode and modern font technologies.</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/app-text/texlive-core/texlive-core-2012-r99.ebuild b/app-text/texlive-core/texlive-core-2012-r99.ebuild
new file mode 100644
index 00000000..0d3c0dd6
--- /dev/null
+++ b/app-text/texlive-core/texlive-core-2012-r99.ebuild
@@ -0,0 +1,352 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/texlive-core/texlive-core-2012-r1.ebuild,v 1.17 2013/05/30 16:32:17 aballier Exp $
+
+EAPI=5
+
+#TL_UPSTREAM_PATCHLEVEL="1"
+PATCHLEVEL="39"
+TL_SOURCE_VERSION=20120701
+
+inherit eutils flag-o-matic toolchain-funcs libtool texlive-common
+
+MY_PV=${PN%-core}-${TL_SOURCE_VERSION}-source
+
+DESCRIPTION="A complete TeX distribution"
+HOMEPAGE="http://tug.org/texlive/"
+SLOT="0"
+LICENSE="GPL-2 LPPL-1.3c TeX"
+
+SRC_URI="mirror://gentoo/${MY_PV}.tar.xz"
+
+# Fetch patches
+SRC_URI="${SRC_URI} mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.xz"
+# mirror://gentoo/texlive-core-upstream-patches-${TL_UPSTREAM_PATCHLEVEL}.tar.xz"
+
+TL_CORE_BINEXTRA_MODULES="
+ a2ping asymptote bibtex8 bundledoc ctanify ctanupload ctie cweb de-macro dtl
+ dvi2tty dviasm dvicopy dvidvi dviljk dvipng dvipos findhyph fragmaster
+ hyphenex installfont lacheck latex2man latexfileversion latexpand
+ listings-ext match_parens mkjobtexmf patgen pdfcrop pdftools pkfix
+ pkfix-helper purifyeps seetexk sty2dtx synctex texcount texdef texdiff
+ texdirflatten texdoc texliveonfly texloganalyser texware tie tpic2pdftex
+ typeoutfileinfo web collection-binextra
+ "
+TL_CORE_BINEXTRA_DOC_MODULES="
+ a2ping.doc asymptote.doc bibtex8.doc bundledoc.doc ctanify.doc
+ ctanupload.doc ctie.doc cweb.doc de-macro.doc dvi2tty.doc dvicopy.doc
+ dviljk.doc dvipng.doc dvipos.doc findhyph.doc fragmaster.doc installfont.doc
+ latex2man.doc latexfileversion.doc latexpand.doc listings-ext.doc
+ match_parens.doc mkjobtexmf.doc patgen.doc pdfcrop.doc pdftools.doc
+ pkfix.doc pkfix-helper.doc purifyeps.doc sty2dtx.doc synctex.doc
+ texcount.doc texdef.doc texdiff.doc texdirflatten.doc texdoc.doc
+ texliveonfly.doc texloganalyser.doc texware.doc tie.doc tpic2pdftex.doc
+ typeoutfileinfo web.doc
+ "
+TL_CORE_BINEXTRA_SRC_MODULES="hyphenex.source listings-ext.source mkjobtexmf.source texdef.source"
+
+TL_CORE_EXTRA_MODULES="tetex hyphen-base texconfig gsftopk texlive.infra ${TL_CORE_BINEXTRA_MODULES}"
+TL_CORE_EXTRA_DOC_MODULES="tetex.doc texconfig.doc gsftopk.doc texlive.infra.doc ${TL_CORE_BINEXTRA_DOC_MODULES}"
+TL_CORE_EXTRA_SRC_MODULES="${TL_CORE_BINEXTRA_SRC_MODULES}"
+
+for i in ${TL_CORE_EXTRA_MODULES}; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.xz"
+done
+
+SRC_URI="${SRC_URI} doc? ( "
+for i in ${TL_CORE_EXTRA_DOC_MODULES}; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.xz"
+done
+SRC_URI="${SRC_URI} )"
+SRC_URI="${SRC_URI} source? ( "
+for i in ${TL_CORE_EXTRA_SRC_MODULES}; do
+ SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.tar.xz"
+done
+SRC_URI="${SRC_URI} )"
+
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="cjk X doc source tk xetex"
+
+MODULAR_X_DEPEND="X? (
+ x11-libs/libXmu
+ x11-libs/libXp
+ x11-libs/libXpm
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXaw
+ x11-libs/libXfont
+ )"
+
+COMMON_DEPEND="${MODULAR_X_DEPEND}
+ !app-text/ptex
+ !app-text/tetex
+ !<app-text/texlive-2007
+ !app-text/xetex
+ !<dev-texlive/texlive-basic-2009
+ !<dev-texlive/texlive-metapost-2011
+ !app-text/dvibook
+ sys-libs/zlib
+ >=media-libs/libpng-1.2.43-r2:0=
+ >=app-text/poppler-0.12.3-r3:=
+ xetex? (
+ app-text/teckit
+ media-libs/fontconfig
+ media-libs/freetype:2
+ media-libs/silgraphite
+ )
+ >=dev-libs/kpathsea-6.1.0_p20120701
+ cjk? ( >=dev-libs/ptexenc-1.2.0_p20120701 )"
+
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig
+ sys-apps/ed
+ sys-devel/flex
+ app-arch/xz-utils"
+
+RDEPEND="${COMMON_DEPEND}
+ >=app-text/ps2pkm-1.5_p20120701
+ >=app-text/dvipsk-5.992_p20120701
+ >=dev-tex/bibtexu-3.71_p20120701
+ virtual/perl-Getopt-Long
+ xetex? ( >=app-text/xdvipdfmx-0.7.8_p20120701 )
+ tk? ( dev-perl/perl-tk )"
+
+# texdoc needs luatex.
+PDEPEND=">=dev-tex/luatex-0.70"
+
+S="${WORKDIR}/${P}_build"
+B="${WORKDIR}/${MY_PV}"
+
+src_unpack() {
+ unpack ${A}
+ mkdir -p "${S}" || die "failed to create build dir"
+}
+
+src_prepare() {
+ mv "${WORKDIR}"/texmf* "${B}" || die "failed to move texmf files"
+
+ cd "${B}"
+ #EPATCH_MULTI_MSG="Applying patches from upstream bugfix branch..." EPATCH_SUFFIX="patch" epatch "${WORKDIR}/gentoo_branch2011_patches"
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches"
+
+ epatch "${FILESDIR}"/${PN}-2012-pmx-sysdep.patch
+
+ elibtoolize
+}
+
+src_configure() {
+ # It fails on alpha without this
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ # Bug #265232 and bug #414271:
+ if use hppa; then
+ append-cppflags "-DU_IS_BIG_ENDIAN=1"
+ fi
+
+ # Too many regexps use A-Z a-z constructs, what causes problems with locales
+ # that don't have the same alphabetical order than ascii. Bug #242430
+ # So we set LC_ALL to C in order to avoid problems.
+ export LC_ALL=C
+ tc-export CC CXX AR RANLIB
+ ECONF_SOURCE="${B}" \
+ econf -C \
+ --bindir=/usr/bin \
+ --datadir="${S}" \
+ --with-system-freetype2 \
+ --with-freetype2-include=/usr/include \
+ --with-system-zlib \
+ --with-system-libpng \
+ --with-system-xpdf \
+ --with-system-poppler \
+ --with-system-teckit \
+ --with-teckit-includes=/usr/include/teckit \
+ --with-system-graphite \
+ --with-system-kpathsea \
+ --with-system-icu \
+ --with-system-ptexenc \
+ --without-texinfo \
+ --disable-dialog \
+ --disable-multiplatform \
+ --enable-epsfwin \
+ --enable-mftalkwin \
+ --enable-regiswin \
+ --enable-tektronixwin \
+ --enable-unitermwin \
+ --with-ps=gs \
+ --disable-psutils \
+ --disable-t1utils \
+ --enable-ipc \
+ --disable-biber \
+ --disable-bibtexu \
+ --disable-dvipng \
+ --disable-dvipsk \
+ --disable-dvipdfmx \
+ --disable-chktex \
+ --disable-lcdf-typetools \
+ --disable-pdfopen \
+ --disable-ps2eps \
+ --disable-ps2pkm \
+ --disable-detex \
+ --disable-ttf2pk \
+ --disable-tex4htk \
+ --disable-cjkutils \
+ --disable-xdvik \
+ --disable-xindy \
+ --disable-luatex \
+ --disable-dvi2tty \
+ --disable-dvisvgm \
+ --disable-vlna \
+ --disable-xdvipdfmx \
+ --enable-shared \
+ --disable-native-texlive-build \
+ --disable-largefile \
+ $(use_enable xetex) \
+ $(use_enable cjk ptex) \
+ $(use_enable cjk eptex) \
+ $(use_enable cjk uptex) \
+ $(use_enable cjk euptex) \
+ $(use_enable cjk mendexk) \
+ $(use_enable cjk makejvf) \
+ $(use_with X x)
+}
+
+src_compile() {
+ emake SHELL=/bin/sh texmf=${TEXMF_PATH:-/usr/share/texmf} || die "emake failed"
+
+ cd "${B}"
+ # Mimic updmap --syncwithtrees to enable only fonts installed
+ # Code copied from updmap script
+ for i in `egrep '^(Mixed)?Map' "texmf/web2c/updmap.cfg" | sed 's@.* @@'`; do
+ texlive-common_is_file_present_in_texmf "$i" || echo "$i"
+ done > "${T}/updmap_update"
+ {
+ sed 's@/@\\/@g; s@^@/^MixedMap[ ]*@; s@$@$/s/^/#! /@' <"${T}/updmap_update"
+ sed 's@/@\\/@g; s@^@/^Map[ ]*@; s@$@$/s/^/#! /@' <"${T}/updmap_update"
+ } > "${T}/updmap_update2"
+ sed -f "${T}/updmap_update2" "texmf/web2c/updmap.cfg" > "${T}/updmap_update3"\
+ && cat "${T}/updmap_update3" > "texmf/web2c/updmap.cfg"
+}
+
+src_test() {
+ ewarn "Due to modular layout of texlive ebuilds,"
+ ewarn "It would not make much sense to use tests into the ebuild"
+ ewarn "And tests would fail anyway"
+ ewarn "Alternatively you can try to compile any tex file"
+ ewarn "Tex warnings should be considered as errors and reported"
+ ewarn "You can also run fmtutil-sys --all and check for errors/warnings there"
+}
+
+src_install() {
+ dodir ${TEXMF_PATH:-/usr/share/texmf}/web2c
+ emake DESTDIR="${D}" texmf="${D}${TEXMF_PATH:-/usr/share/texmf}" run_texlinks="true" run_mktexlsr="true" install || die "install failed"
+
+ cd "${B}"
+ dodir /usr/share # just in case
+ cp -pR texmf{,-dist} "${D}/usr/share/" || die "failed to install texmf trees"
+ cp -pR "${WORKDIR}"/tlpkg "${D}/usr/share/" || die "failed to install tlpkg files"
+
+ newsbin "${FILESDIR}/texmf-update2010" texmf-update
+
+ # When X is disabled mf-nowin doesn't exist but some scripts expect it to
+ # exist. Instead, it is called mf, so we symlink it to please everything.
+ use X || dosym mf /usr/bin/mf-nowin
+
+ docinto texk
+ cd "${B}/texk"
+ dodoc ChangeLog README || die "failed to install texk docs"
+
+ docinto dviljk
+ cd "${B}/texk/dviljk"
+ dodoc ChangeLog README NEWS || die "failed to install dviljk docs"
+
+ docinto makeindexk
+ cd "${B}/texk/makeindexk"
+ dodoc ChangeLog NOTES README || die "failed to install makeindexk docs"
+
+ docinto web2c
+ cd "${B}/texk/web2c"
+ dodoc ChangeLog NEWS PROJECTS README || die "failed to install web2c docs"
+
+ use doc || rm -rf "${D}/usr/share/texmf/doc"
+ use doc || rm -rf "${D}/usr/share/texmf-dist/doc"
+
+ dodir /etc/env.d
+ echo 'CONFIG_PROTECT_MASK="/etc/texmf/web2c /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d"' > "${D}/etc/env.d/98texlive"
+ # populate /etc/texmf
+ keepdir /etc/texmf/web2c
+
+ # take care of updmap.cfg and language.d files
+ keepdir /etc/texmf/{updmap.d,language.dat.d,language.def.d,language.dat.lua.d}
+
+ mv "${D}${TEXMF_PATH}/web2c/updmap.cfg" "${D}/etc/texmf/updmap.d/00updmap.cfg" || die "moving updmap.cfg failed"
+
+ # Remove fmtutil.cnf, it will be regenerated from /etc/texmf/fmtutil.d files
+ # by texmf-update
+ rm -f "${D}${TEXMF_PATH}/web2c/fmtutil.cnf"
+ # Remove bundled and invalid updmap.cfg
+ rm -f "${D}/usr/share/texmf-dist/web2c/updmap.cfg"
+
+ texlive-common_handle_config_files
+
+ keepdir /usr/share/texmf-site
+
+ # the virtex symlink is not installed
+ # The links has to be relative, since the targets
+ # is not present at this stage and MacOS doesn't
+ # like non-existing targets
+ dosym tex /usr/bin/virtex
+ dosym pdftex /usr/bin/pdfvirtex
+
+ # Remove texdoctk if we don't want it
+ if ! use tk ; then
+ rm -f "${D}/usr/bin/texdoctk" "${D}/usr/share/texmf/scripts/tetex/texdoctk.pl" "${D}/usr/share/man/man1/texdoctk.1" || die "failed to remove texdoc tk!"
+ fi
+
+ # Rename mpost to leave room for mplib
+ mv "${D}/usr/bin/mpost" "${D}/usr/bin/mpost-${P}"
+ dosym "mpost-${P}" /usr/bin/mpost
+
+ # Ditto for pdftex
+ mv "${D}/usr/bin/pdftex" "${D}/usr/bin/pdftex-${P}"
+ dosym "pdftex-${P}" /usr/bin/pdftex
+}
+
+pkg_preinst() {
+ # Remove stray files to keep the upgrade path sane
+ if has_version =app-text/texlive-core-2007* ; then
+ for i in pdftex/pdflatex aleph/aleph aleph/lamed omega/lambda omega/omega xetex/xetex xetex/xelatex tex/tex pdftex/etex pdftex/pdftex pdftex/pdfetex ; do
+ for j in log fmt ; do
+ local file="${ROOT}/var/lib/texmf/web2c/${i}.${j}"
+ if [ -f "${file}" ] ; then
+ elog "Removing stray ${file} from TeXLive 2007 install."
+ rm -f "${file}"
+ fi
+ done
+ done
+ for j in base log ; do
+ local file="${ROOT}/var/lib/texmf/web2c/metafont/mf.${j}"
+ if [ -f "${file}" ] ; then
+ elog "Removing stray ${file} from TeXLive 2007 install."
+ rm -f "${file}"
+ fi
+ done
+ fi
+}
+
+pkg_postinst() {
+ etexmf-update
+
+ elog
+ elog "If you have configuration files in /etc/texmf to merge,"
+ elog "please update them and run /usr/sbin/texmf-update."
+ elog
+ ewarn "If you are migrating from an older TeX distribution"
+ ewarn "Please make sure you have read:"
+ ewarn "http://www.gentoo.org/proj/en/tex/texlive-migration-guide.xml"
+ ewarn "in order to avoid possible problems"
+ elog
+ elog "TeXLive has been split in various ebuilds. If you are missing a"
+ elog "package to process your TeX documents, you can install"
+ elog "dev-tex/texmfind to easily search for them."
+ elog
+}
diff --git a/dev-lang/ruby/Manifest b/dev-lang/ruby/Manifest
new file mode 100644
index 00000000..1e2c57c3
--- /dev/null
+++ b/dev-lang/ruby/Manifest
@@ -0,0 +1,10 @@
+AUX ruby-1.9.3_p484-add-asm_ioctl_h.patch 320 SHA256 d9f2357a68dfee36e5c3b428dce82234d4bcd42cf134b24d01150946e1af8c9d SHA512 8f55b2749ca63ff1b3f3b0dd0ac548f7de29bc470871637ffb666a534910b089c4290b71df57108a380b22fd92c9c230c65354d0dbad81e70a654b4a94134d89 WHIRLPOOL b4c2aff2ce64ede5cdd0b2c70180067b0c9a8300d6d7d88ca9c3bb3645053c27229c27ed9ea67b243598c7671465e1d5ab5d2e3bec85977fac7eb421733ea8a7
+AUX ruby-add-asm_ioctl_h.patch 338 SHA256 82fa2b35c1a1ae05aaf7e849bd7b6068951f65609a35de1f88fcf83f254666f2 SHA512 eba8f362cda01fed4d38515a1ce03e4c462ddb6adf686de76b3d91bc5d5484661b7be5a9080624a9fa87fffff27b65c746d7ec94d4e27dbef2f9b321fc286be1 WHIRLPOOL 9c1ac98344cd44a3f9523e7dc723ab6dceab3c1c569d2656d03fdbe7677207bbe52ed5436dcd405c33c16d623333219aa6492dcb76d94b0cf833305589312ae2
+AUX ruby-uclibc-isnan-isinf.patch 720 SHA256 5e49c26f78079c1252cafee1cd91707a051f0d3c88e78900cfed05e159b25385 SHA512 ded0075f00121ba7ad3f9927534f870a61d8270d145d603a32c6cb60160a66d8afe7257904a1f787fe8af33a459c51679dbb87a3a1a16681eda434a386300750 WHIRLPOOL ab4eab44b70d5cea0f26a585b5d57ce9461bb273059107121aaa96eaa00bb507d89bc3c17aed24f1909d4ce1bee9fbb185f4f0a789c42ecdd79a96693308b05b
+DIST ruby-1.9.3-p484.tar.bz2 10041514 SHA256 0fdc6e860d0023ba7b94c7a0cf1f7d32908b65b526246de9dfd5bb39d0d7922b SHA512 2c3ef8b6022027d444bd709b1a5db96a7a692e2e3aa895df4fceae101f9689a31f02583703bb0483d80659bbd4555fbb4b9b57ceb2351508fab8cd10ff28f14d WHIRLPOOL 1b1174e012bff8d047db2da654dcf535486bfd1593b8e2f6fc888603c8ed6b41bd72625ff4eeaaa645ae01a81f7edbf62f0345b61eeda02d73743572af3f6b85
+DIST ruby-2.0.0-p353.tar.bz2 10730412 SHA256 3de4e4d9aff4682fa4f8ed2b70bd0d746fae17452fc3d3a8e8f505ead9105ad9 SHA512 52aa64c5991e61cc49c2062672554353bc88ab563da93a1d1591257153c2f6d8de02417a33d7a585eb0102f1079a993e46671fb6c97c62eac8615de567b575f2 WHIRLPOOL 8d3b616838290095ab389d32caa48941e9146676730975f2868d42cf43dd5f6ff6a26bb6ca1499a164a5c743e4f5c3ad122c1bed18556d85da98b821d66caf89
+DIST ruby-patches-1.9.3_p484.tar.bz2 2154 SHA256 c1c40f2b1f186a05774fd15c3566d722a5ab1af5b93a7c73f2d3c247d604fd73 SHA512 fdb07393439dfcc97e5d4ecd12059ef69983b23588079e1292cec1c93544524a67265e4f61f75d20ac540ee9f9ace730a584462f94bea4919124a3264e6f0ae1 WHIRLPOOL 422b7bfcbdb564fd89ae9536c15d78442ad5597c7728f84f2523a751a862807a92a77779cfdd42fcdd20569726f401e391e33c1666b0455432ddff228ea674fc
+DIST ruby-patches-2.0.0_p353.tar.bz2 1929 SHA256 4feee409319dbcac7525fb9c1c76c36888a62ee0623c117ae532bf765845f0f9 SHA512 95cf20e26e43a1515843d74c558e3344ae33b7383362c1742a115c1b3e6d09e1ed947df8ab7fee6275e96c920bd0ef880647da70165ddccd40d0995ff43aae64 WHIRLPOOL 869055dd0e14af0dc285a11d95a891ab4686e1d16960d46728ddf680eee58d42570f64d058b88d30805b732b082c354a36dac5a816a7ce5f3034d1b22237aa5a
+EBUILD ruby-1.9.3_p484.ebuild 6114 SHA256 e49b4636f44f156aeb7d3b62e29400d4513438826b99a7256e85a6a2317f9423 SHA512 a2cfc5448ed98f7471e3b204a1756f0825866ab3ff317590887be1c193699cbbd9ba038da0c6ab7637a382494b9ec159dc9eaad744b7ff7f5315f18c3b067142 WHIRLPOOL 17a52f969ecb0883a30c84611cf7e7e69887d67eead030de08b837785452471c989b401348d2cc66f99cf8b27e672523d3b330ee0b243f6c4fb4146d71465111
+EBUILD ruby-2.0.0_p353.ebuild 6547 SHA256 7c4861a783a86c578aedad435ec5d0946743fcdfc2a38f4435f19328dcc700c3 SHA512 87311b5499308f23dadbcf592f9f4b7b7cd0e4e3e21912276165daeb882e4f8f0707fecc077f0d7c4e2eb818bc1528845d9d3341669a352ca0b84dbe5ac34058 WHIRLPOOL b5ff381030b0e2fc89e717c6bce42bfa99d31d7304d5dd31791a87e9acd0b0564603e500ac552d46a125dfadd5ea66ba1b3e90d21b0a33ef7164ded542ec882c
+MISC metadata.xml 995 SHA256 b802a8c15353181ea4a0f93666e89dbf1cc3f01947311ef9a8cb1663281f257a SHA512 d9aac8c61fcec88cb5ab856bc9f2f16b5e428d8df610b5d56edc6f908ad178790423c1fdebd23e3ff3b210d78389e775b684e9c2a973d86cd701dafa81b51442 WHIRLPOOL 2a28317957c87d390479e4a6ac8ab121200dbaa2bd7de98f58031c17e670c8f096a2c8d9909cc2ca0d02b437ca0b1c61a789a66b39b32ffd731454c2a6e4b65e
diff --git a/dev-lang/ruby/files/ruby-1.9.3_p484-add-asm_ioctl_h.patch b/dev-lang/ruby/files/ruby-1.9.3_p484-add-asm_ioctl_h.patch
new file mode 100644
index 00000000..a15fe991
--- /dev/null
+++ b/dev-lang/ruby/files/ruby-1.9.3_p484-add-asm_ioctl_h.patch
@@ -0,0 +1,11 @@
+diff -Nuar ruby-1.9.3-p484.orig/io.c ruby-1.9.3-p484/io.c
+--- ruby-1.9.3-p484.orig/io.c 2013-10-31 14:03:20.000000000 +0000
++++ ruby-1.9.3-p484/io.c 2014-02-23 13:43:42.508302443 +0000
+@@ -17,6 +17,7 @@
+ #include "internal.h"
+ #include <ctype.h>
+ #include <errno.h>
++#include <asm/ioctl.h>
+
+ #define free(x) xfree(x)
+
diff --git a/dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch b/dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch
new file mode 100644
index 00000000..9fef9e8e
--- /dev/null
+++ b/dev-lang/ruby/files/ruby-add-asm_ioctl_h.patch
@@ -0,0 +1,11 @@
+diff -Nuar ruby-2.0.0-p353.orig/io.c ruby-2.0.0-p353/io.c
+--- ruby-2.0.0-p353.orig/io.c 2013-10-04 17:30:50.000000000 +0000
++++ ruby-2.0.0-p353/io.c 2014-02-23 13:22:06.038406133 +0000
+@@ -19,6 +19,7 @@
+ #include "id.h"
+ #include <ctype.h>
+ #include <errno.h>
++#include <asm/ioctl.h>
+ #include "ruby_atomic.h"
+
+ #define free(x) xfree(x)
diff --git a/dev-lang/ruby/files/ruby-uclibc-isnan-isinf.patch b/dev-lang/ruby/files/ruby-uclibc-isnan-isinf.patch
new file mode 100644
index 00000000..47ecb2fe
--- /dev/null
+++ b/dev-lang/ruby/files/ruby-uclibc-isnan-isinf.patch
@@ -0,0 +1,24 @@
+diff -Naur ruby-2.0.0-p247.orig/missing/isinf.c ruby-2.0.0-p247/missing/isinf.c
+--- ruby-2.0.0-p247.orig/missing/isinf.c 2011-05-15 07:55:52.000000000 -0400
++++ ruby-2.0.0-p247/missing/isinf.c 2013-09-09 15:28:47.750452951 -0400
+@@ -52,6 +52,8 @@
+ static double one (void) { return 1.0; }
+ static double inf (void) { return one() / zero(); }
+
++#undef isinf
++
+ int
+ isinf(double n)
+ {
+diff -Naur ruby-2.0.0-p247.orig/missing/isnan.c ruby-2.0.0-p247/missing/isnan.c
+--- ruby-2.0.0-p247.orig/missing/isnan.c 2010-07-28 04:12:01.000000000 -0400
++++ ruby-2.0.0-p247/missing/isnan.c 2013-09-09 15:28:32.791451837 -0400
+@@ -4,6 +4,8 @@
+
+ static int double_ne(double n1, double n2);
+
++#undef isnan
++
+ int
+ isnan(double n)
+ {
diff --git a/dev-lang/ruby/metadata.xml b/dev-lang/ruby/metadata.xml
new file mode 100644
index 00000000..e46ab14c
--- /dev/null
+++ b/dev-lang/ruby/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ruby</herd>
+ <use>
+ <flag name='rubytests'>
+ Install ruby tests that can only be run after ruby is installed
+ </flag>
+
+ <flag name='readline'>
+ Use the <pkg>sys-libs/readline</pkg> library to provide the
+ readline extension, used for instance by the irb tool. This flag
+ is meaningful only if the libedit USE flag is disabled.
+
+ If neither libedit nor readline USE flags are enabled, the
+ readline extension will not be built (and irb will lose line
+ editing functionality).
+ </flag>
+
+ <flag name='yaml'>
+ Use the <pkg>dev-libs/libyaml</pkg> library to build the psych
+ extension, available since Ruby 1.9.2_rc2, in alternative to the
+ bundled syck-based parser.
+ </flag>
+
+ <flag name='rdoc'>
+ Install <pkg>dev-ruby/rdoc</pkg> after installing Ruby.
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-lang/ruby/ruby-1.9.3_p484.ebuild b/dev-lang/ruby/ruby-1.9.3_p484.ebuild
new file mode 100644
index 00000000..d860a042
--- /dev/null
+++ b/dev-lang/ruby/ruby-1.9.3_p484.ebuild
@@ -0,0 +1,220 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-1.9.3_p484.ebuild,v 1.12 2014/01/26 09:27:14 jlec Exp $
+
+EAPI=4
+
+#PATCHSET=1
+
+inherit autotools eutils flag-o-matic multilib versionator
+
+RUBYPL=$(get_version_component_range 4)
+
+MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
+S=${WORKDIR}/${MY_P}
+
+SLOT=$(get_version_component_range 1-2)
+MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
+# 1.9.3 still uses 1.9.1
+RUBYVERSION=1.9.1
+
+if [[ -n ${PATCHSET} ]]; then
+ if [[ ${PVR} == ${PV} ]]; then
+ PATCHSET="${PV}-r0.${PATCHSET}"
+ else
+ PATCHSET="${PVR}.${PATCHSET}"
+ fi
+else
+ PATCHSET="${PVR}"
+fi
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="http://www.ruby-lang.org/"
+SRC_URI="mirror://ruby/1.9/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl tk xemacs ncurses +readline +yaml" #libedit
+
+# libedit support is removed everywhere because of this upstream bug:
+# http://redmine.ruby-lang.org/issues/show/3698
+
+RDEPEND="
+ berkdb? ( sys-libs/db )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ socks5? ( >=net-proxy/dante-1.1.13 )
+ tk? (
+ <dev-lang/tcl-8.6[threads]
+ <dev-lang/tk-8.6[threads]
+ )
+ ncurses? ( sys-libs/ncurses )
+ readline? ( sys-libs/readline )
+ yaml? ( dev-libs/libyaml )
+ virtual/libffi
+ sys-libs/zlib
+ >=app-eselect/eselect-ruby-20100402
+ !<dev-ruby/rdoc-3.9.4
+ !<dev-ruby/rubygems-1.8.10-r1"
+# libedit? ( dev-libs/libedit )
+# !libedit? ( readline? ( sys-libs/readline ) )
+
+DEPEND="${RDEPEND}"
+PDEPEND="
+ >=dev-ruby/rubygems-1.8.10-r1[ruby_targets_ruby19]
+ rdoc? ( >=dev-ruby/rdoc-3.9.4[ruby_targets_ruby19] )
+ xemacs? ( app-xemacs/ruby-modes )"
+
+src_prepare() {
+ EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}/patches"
+
+ epatch "${FILESDIR}"/${P}-add-asm_ioctl_h.patch
+ einfo "Unbundling gems..."
+ cd "$S"
+ rm -r \
+ {bin,lib}/rake lib/rake.rb man/rake.1 \
+ ext/json \
+ bin/gem || die "removal failed"
+
+ # Fix a hardcoded lib path in configure script
+ sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
+ configure.in || die "sed failed"
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=
+
+ # -fomit-frame-pointer makes ruby segfault, see bug #150413.
+ filter-flags -fomit-frame-pointer
+ # In many places aliasing rules are broken; play it safe
+ # as it's risky with newer compilers to leave it as it is.
+ append-flags -fno-strict-aliasing
+ # SuperH needs this
+ use sh && append-flags -mieee
+
+ # Socks support via dante
+ if use socks5 ; then
+ # Socks support can't be disabled as long as SOCKS_SERVER is
+ # set and socks library is present, so need to unset
+ # SOCKS_SERVER in that case.
+ unset SOCKS_SERVER
+ fi
+
+ # Increase GC_MALLOC_LIMIT if set (default is 8000000)
+ if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+ append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+ fi
+
+ # ipv6 hack, bug 168939. Needs --enable-ipv6.
+ use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
+
+# if use libedit; then
+# einfo "Using libedit to provide readline extension"
+# myconf="${myconf} --enable-libedit --with-readline"
+# elif use readline; then
+# einfo "Using readline to provide readline extension"
+# myconf="${myconf} --with-readline"
+# else
+# myconf="${myconf} --without-readline"
+# fi
+ myconf="${myconf} $(use_with readline)"
+
+ INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+ --program-suffix=${MY_SUFFIX} \
+ --with-soname=ruby${MY_SUFFIX} \
+ --enable-shared \
+ --enable-pthread \
+ $(use_enable socks5 socks) \
+ $(use_enable doc install-doc) \
+ --enable-ipv6 \
+ $(use_enable debug) \
+ $(use_with berkdb dbm) \
+ $(use_with gdbm) \
+ $(use_with ssl openssl) \
+ $(use_with tk) \
+ $(use_with ncurses curses) \
+ $(use_with yaml psych) \
+ ${myconf} \
+ --enable-option-checking=no \
+ || die "econf failed"
+}
+
+src_compile() {
+ emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
+}
+
+src_test() {
+ emake -j1 V=1 test || die "make test failed"
+
+ elog "Ruby's make test has been run. Ruby also ships with a make check"
+ elog "that cannot be run until after ruby has been installed."
+ elog
+ if use rubytests; then
+ elog "You have enabled rubytests, so they will be installed to"
+ elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
+ elog "than root, and you must place them into a writeable directory."
+ elog "Then call: "
+ elog
+ elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
+ else
+ elog "Enable the rubytests USE flag to install the make check tests"
+ fi
+}
+
+src_install() {
+ # Ruby is involved in the install process, we don't want interference here.
+ unset RUBYOPT
+
+ local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+ LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+ RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+ for d in $(find "${S}/ext" -type d) ; do
+ RUBYLIB="${RUBYLIB}:$d"
+ done
+ export LD_LIBRARY_PATH RUBYLIB
+
+ emake V=1 DESTDIR="${D}" install || die "make install failed"
+
+ # Remove installed rubygems copy
+ rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+ rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+ rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+ if use doc; then
+ make DESTDIR="${D}" install-doc || die "make install-doc failed"
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r sample
+ fi
+
+ dodoc ChangeLog NEWS doc/NEWS* README* ToDo || die
+
+ if use rubytests; then
+ pushd test
+ insinto /usr/share/${PN}-${SLOT}/test
+ doins -r .
+ popd
+ fi
+}
+
+pkg_postinst() {
+ if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
+ eselect ruby set ruby${MY_SUFFIX}
+ fi
+
+ elog
+ elog "To switch between available Ruby profiles, execute as root:"
+ elog "\teselect ruby set ruby(18|19|...)"
+ elog
+}
+
+pkg_postrm() {
+ eselect ruby cleanup
+}
diff --git a/dev-lang/ruby/ruby-2.0.0_p353.ebuild b/dev-lang/ruby/ruby-2.0.0_p353.ebuild
new file mode 100644
index 00000000..abdcc8ea
--- /dev/null
+++ b/dev-lang/ruby/ruby-2.0.0_p353.ebuild
@@ -0,0 +1,228 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ruby/ruby-2.0.0_p353.ebuild,v 1.6 2013/12/15 17:44:01 ago Exp $
+
+EAPI=5
+
+#PATCHSET=1
+
+inherit autotools eutils flag-o-matic multilib versionator
+
+RUBYPL=$(get_version_component_range 4)
+
+MY_P="${PN}-$(get_version_component_range 1-3)-${RUBYPL:-0}"
+S=${WORKDIR}/${MY_P}
+
+SLOT=$(get_version_component_range 1-2)
+MY_SUFFIX=$(delete_version_separator 1 ${SLOT})
+RUBYVERSION=2.0.0
+
+if [[ -n ${PATCHSET} ]]; then
+ if [[ ${PVR} == ${PV} ]]; then
+ PATCHSET="${PV}-r0.${PATCHSET}"
+ else
+ PATCHSET="${PVR}.${PATCHSET}"
+ fi
+else
+ PATCHSET="${PVR}"
+fi
+
+DESCRIPTION="An object-oriented scripting language"
+HOMEPAGE="http://www.ruby-lang.org/"
+SRC_URI="mirror://ruby/2.0/${MY_P}.tar.bz2
+ http://dev.gentoo.org/~flameeyes/ruby-team/${PN}-patches-${PATCHSET}.tar.bz2"
+
+LICENSE="|| ( Ruby-BSD BSD-2 )"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="berkdb debug doc examples gdbm ipv6 +rdoc rubytests socks5 ssl tk xemacs ncurses +readline"
+
+RDEPEND="
+ berkdb? ( sys-libs/db )
+ gdbm? ( sys-libs/gdbm )
+ ssl? ( dev-libs/openssl )
+ socks5? ( >=net-proxy/dante-1.1.13 )
+ tk? ( dev-lang/tk[threads] )
+ ncurses? ( sys-libs/ncurses )
+ readline? ( sys-libs/readline )
+ dev-libs/libyaml
+ virtual/libffi
+ sys-libs/zlib
+ >=app-eselect/eselect-ruby-20100402
+ !<dev-ruby/rdoc-3.9.4
+ !<dev-ruby/rubygems-1.8.10-r1"
+
+DEPEND="${RDEPEND}"
+PDEPEND="
+ >=dev-ruby/rubygems-2.0.2[ruby_targets_ruby20]
+ >=dev-ruby/json-1.7.7[ruby_targets_ruby20]
+ >=dev-ruby/rake-0.9.6[ruby_targets_ruby20]
+ rdoc? ( >=dev-ruby/rdoc-4.0.0[ruby_targets_ruby20] )
+ xemacs? ( app-xemacs/ruby-modes )"
+
+src_prepare() {
+ EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}/patches"
+
+ epatch "${FILESDIR}"/${PN}-uclibc-isnan-isinf.patch
+ epatch "${FILESDIR}"/${PN}-add-asm_ioctl_h.patch
+
+ # We can no longer unbundle all of rake because rubygems now depends
+ # on this. We leave the actual rake code around to bootstrap
+ # rubygems, but remove the bits that would cause a file collision.
+ einfo "Unbundling gems..."
+ cd "$S"
+ rm -r \
+ {bin,lib}/rake lib/rake.rb man/rake.1 \
+ bin/gem || die "removal failed"
+
+ # Fix a hardcoded lib path in configure script
+ sed -i -e "s:\(RUBY_LIB_PREFIX=\"\${prefix}/\)lib:\1$(get_libdir):" \
+ configure.in || die "sed failed"
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=
+
+ # -fomit-frame-pointer makes ruby segfault, see bug #150413.
+ filter-flags -fomit-frame-pointer
+ # In many places aliasing rules are broken; play it safe
+ # as it's risky with newer compilers to leave it as it is.
+ append-flags -fno-strict-aliasing
+ # SuperH needs this
+ use sh && append-flags -mieee
+
+ # Socks support via dante
+ if use socks5 ; then
+ # Socks support can't be disabled as long as SOCKS_SERVER is
+ # set and socks library is present, so need to unset
+ # SOCKS_SERVER in that case.
+ unset SOCKS_SERVER
+ fi
+
+ # Increase GC_MALLOC_LIMIT if set (default is 8000000)
+ if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
+ append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
+ fi
+
+ # ipv6 hack, bug 168939. Needs --enable-ipv6.
+ use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
+
+# if use libedit; then
+# einfo "Using libedit to provide readline extension"
+# myconf="${myconf} --enable-libedit --with-readline"
+# elif use readline; then
+# einfo "Using readline to provide readline extension"
+# myconf="${myconf} --with-readline"
+# else
+# myconf="${myconf} --without-readline"
+# fi
+ myconf="${myconf} $(use_with readline)"
+
+ INSTALL="${EPREFIX}/usr/bin/install -c" econf \
+ --program-suffix=${MY_SUFFIX} \
+ --with-soname=ruby${MY_SUFFIX} \
+ --enable-shared \
+ --enable-pthread \
+ --enable-psych \
+ --disable-rpath \
+ $(use_enable socks5 socks) \
+ $(use_enable doc install-doc) \
+ --enable-ipv6 \
+ $(use_enable debug) \
+ $(use_with berkdb dbm) \
+ $(use_with gdbm) \
+ $(use_with ssl openssl) \
+ $(use_with tk) \
+ $(use_with ncurses curses) \
+ ${myconf} \
+ --enable-option-checking=no \
+ || die "econf failed"
+}
+
+src_compile() {
+ emake V=1 EXTLDFLAGS="${LDFLAGS}" || die "emake failed"
+}
+
+src_test() {
+ emake -j1 V=1 test || die "make test failed"
+
+ elog "Ruby's make test has been run. Ruby also ships with a make check"
+ elog "that cannot be run until after ruby has been installed."
+ elog
+ if use rubytests; then
+ elog "You have enabled rubytests, so they will be installed to"
+ elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
+ elog "than root, and you must place them into a writeable directory."
+ elog "Then call: "
+ elog
+ elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
+ else
+ elog "Enable the rubytests USE flag to install the make check tests"
+ fi
+}
+
+src_install() {
+ # Remove the remaining bundled gems. We do this late in the process
+ # since they are used during the build to e.g. create the
+ # documentation.
+ rm -rf ext/json || die
+
+ # Ruby is involved in the install process, we don't want interference here.
+ unset RUBYOPT
+
+ local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
+
+ LD_LIBRARY_PATH="${D}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
+ RUBYLIB="${S}:${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
+ for d in $(find "${S}/ext" -type d) ; do
+ RUBYLIB="${RUBYLIB}:$d"
+ done
+ export LD_LIBRARY_PATH RUBYLIB
+
+ emake V=1 DESTDIR="${D}" install || die "make install failed"
+
+ # Remove installed rubygems copy
+ rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
+ rm -r "${D}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
+ rm -r "${D}/usr/bin/"{ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
+
+ if use doc; then
+ make DESTDIR="${D}" install-doc || die "make install-doc failed"
+ fi
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r sample
+ fi
+
+ dosym "libruby${MY_SUFFIX}$(get_libname ${PV%_*})" \
+ "/usr/$(get_libdir)/libruby$(get_libname ${PV%.*})"
+ dosym "libruby${MY_SUFFIX}$(get_libname ${PV%_*})" \
+ "/usr/$(get_libdir)/libruby$(get_libname ${PV%_*})"
+
+ dodoc ChangeLog NEWS doc/NEWS* README* || die
+
+ if use rubytests; then
+ pushd test
+ insinto /usr/share/${PN}-${SLOT}/test
+ doins -r .
+ popd
+ fi
+}
+
+pkg_postinst() {
+ if [[ ! -n $(readlink "${ROOT}"usr/bin/ruby) ]] ; then
+ eselect ruby set ruby${MY_SUFFIX}
+ fi
+
+ elog
+ elog "To switch between available Ruby profiles, execute as root:"
+ elog "\teselect ruby set ruby(18|19|...)"
+ elog
+}
+
+pkg_postrm() {
+ eselect ruby cleanup
+}
diff --git a/dev-libs/boehm-gc/Manifest b/dev-libs/boehm-gc/Manifest
new file mode 100644
index 00000000..ec6279c4
--- /dev/null
+++ b/dev-libs/boehm-gc/Manifest
@@ -0,0 +1,8 @@
+AUX boehm-gc-7.2e-automake-1.13.patch 372 SHA256 efa9b39464a8ed36f5356370095b3cdf6370a003c3a707a7fe38743123c97f52 SHA512 19efd52b91b985b31e190b77e5370fb510ad582a54868bb1a7fe54ae57e0625df113ad059a6d636a10f314624137704af8e193460b55c8ba422b9255aadae020 WHIRLPOOL ea4d66c521ea43b17ef40c76dbc3eb661cf5cd52a9c1716a7e9c4b2d766ff3e890902880973486efc9ec130e534d74082f606d89a6cfb6304e271e1e95df76ca
+AUX boehm-gc-7.2e-os_dep.patch 407 SHA256 542083b9cf9194f3aa3589312fa8d664892455f648e5cfd2b5cacde36a254b57 SHA512 732cc0364842498f3968f4f59dfde10877e3378f21460ecdb1efe0bb496fbad498f48b05f757195b85b5e2bcaeb7484376d19a9b7be5ddf01e6563c263486324 WHIRLPOOL 1ad1588d9005a865f0ea11be0edad96a660182534181e2b309ee5b1d756b836c92abe76258b8e1ad5110d0539bf5bf9f87154628f0973a886aa231ce9599a1f3
+AUX boehm-gc-7.4.2-getcontext.patch 517 SHA256 f27464a770418089d89392deec74083d95e40d55dfd4ab361fd6e6ded00184af SHA512 6ee653373c54d7845d8bbb5377da1a53a0505965c08e4905ad74d4d885f14ab161da74038799ef1240466c93d5b5f6756eeacfe3da76ec0c45a292b7bf2d2548 WHIRLPOOL a8475c653f1094c25aec53188901f003cfd1e0959a6820fd750db801882365ca6ba8780aa84288ea27b8cf4f5438e962a660b4e1d99763a85acd83e0a4c8778c
+DIST gc-7.2e.tar.gz 1291186 SHA256 09315b48a82d600371207691126ad058c04677281ac318d86fa84c98c3c9af4b SHA512 80d1d50e38714b4f198743cd8cd5ab80a35cfbb7f5f9d66c89f40319604e989125870f010d4499876978594a5823d7b61213224a68da8664b9e4f8e14076c999 WHIRLPOOL bac6bac3dde1ed136403450d335a33e7ffc692575871d19edaa322a523046a7f6dc75331ffec02a8e36a2f056e6422331c6a40fb5bfb5cfc23c70819a9e03447
+DIST gc-7.4.2.tar.gz 1082597 SHA256 63320ad7c45460e4a40e03f5aa4c6893783f21a16416c3282b994f933312afa2 SHA512 2e21516addf268780641ee55c0cb3ecc2d96fa963faffee5beadcade9c6bf1ee49ee1a75b076b5d49ddde7c839fb94f4c3623ca8412d14c2a5bf6ca30d424a72 WHIRLPOOL 139fb9fbaef30f30f54940d99832b2eb936015620f59ee51b58a45e12d03cb9b05d75d8f91a6d706bafad9498894e77a7205d64f422bf2a4b64be2e9a8a13d90
+EBUILD boehm-gc-7.2e-r99.ebuild 1443 SHA256 9ad9be2db137ec833c334a6daf38efcff6c43cba944acffec21f71e91f944c28 SHA512 0b4759911af4e7541f4e5efb391672310be50ca1af89e3da405b6bfa5af6d3ea5b0f43eb9e4661b819a926a4e19f3f179fa8ffe2b69b1847652f4b24e87867fe WHIRLPOOL 106a70f844882b2bbb4db583700abb975e219ebd2b76cdb453ea9c9c276a8fb8bb3e05c62d77d6a85de375a4d8e35669f1ae91acc8a1cad0db84a6af8b067b45
+EBUILD boehm-gc-7.4.2-r99.ebuild 1128 SHA256 7b3c271c10db79bae20d8db4497397123c63194f5e4f98698f6183403152a5ca SHA512 2e55c59065692f77f51c360cf70b0d44acdbdd5cd6af96e4aeb8fde6afea2846c93e76c5e09e84643a144b2f120295048e41bbae490837e8176b83b47c6e8942 WHIRLPOOL b8437ac8c064f567e520f27ea098eabca20718924fb9981d129a24c7ea91e99a24bbc35898298e856da7fbd6256dcff93c86380b9edbada683860ce9ed3e03b1
+MISC metadata.xml 323 SHA256 89f79fff509fba289ac7cc3d2771227d296068554e21ed81292a91962a22772e SHA512 5b8ceb484d6e4d64b80690b33e49720d2f6c49e73cd7669caeef71c5730e5acb24c74437512321af3abf63a2b1e0d907a0335ab46a89332023758f4ce157c6e4 WHIRLPOOL 4068508aab2a8466c423cd24184d9b96c9ecf73d26cdec4735990daf495a1e49050bf8333a458f63c51b4bd06e2b56702db443048c3caa931b444e6c00769c1e
diff --git a/dev-libs/boehm-gc/boehm-gc-7.2e-r99.ebuild b/dev-libs/boehm-gc/boehm-gc-7.2e-r99.ebuild
new file mode 100644
index 00000000..a9c1e83a
--- /dev/null
+++ b/dev-libs/boehm-gc/boehm-gc-7.2e-r99.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/boehm-gc/boehm-gc-7.2e.ebuild,v 1.9 2014/01/18 20:05:46 ago Exp $
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic
+
+MY_P="gc-${PV/_/}"
+
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector"
+HOMEPAGE="http://www.hpl.hp.com/personal/Hans_Boehm/gc/"
+SRC_URI="http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/${MY_P}.tar.gz"
+
+LICENSE="boehm-gc"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="cxx static-libs threads"
+
+DEPEND=">=dev-libs/libatomic_ops-7.2
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P/e}"
+
+src_prepare() {
+ rm -r libatomic_ops || die
+
+ append-cppflags -DNO_GETCONTEXT
+
+ epatch "${FILESDIR}"/${P}-automake-1.13.patch
+ epatch "${FILESDIR}"/${PN}-7.2e-os_dep.patch
+ eautoreconf
+}
+
+src_configure() {
+ local config=(
+ --with-libatomic-ops
+ $(use_enable cxx cplusplus)
+ $(use_enable static-libs static)
+ $(use threads || echo --disable-threads)
+ )
+ econf "${config[@]}"
+}
+
+src_install() {
+ default
+
+ rm -r "${ED}"/usr/share/gc || die
+
+ # dist_noinst_HEADERS
+ insinto /usr/include/gc
+ doins include/{cord.h,ec.h,javaxfc.h}
+ insinto /usr/include/gc/private
+ doins include/private/*.h
+
+ dodoc README.QUICK doc/README{.environment,.linux,.macros} doc/barrett_diagram
+ dohtml doc/*.html
+ newman doc/gc.man GC_malloc.1
+
+ use static-libs || prune_libtool_files #457872
+}
diff --git a/dev-libs/boehm-gc/boehm-gc-7.4.2-r99.ebuild b/dev-libs/boehm-gc/boehm-gc-7.4.2-r99.ebuild
new file mode 100644
index 00000000..b46debaf
--- /dev/null
+++ b/dev-libs/boehm-gc/boehm-gc-7.4.2-r99.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/boehm-gc/boehm-gc-7.4.2.ebuild,v 1.4 2015/02/21 12:19:01 ago Exp $
+
+EAPI=5
+
+inherit eutils
+
+MY_P="gc-${PV}"
+
+DESCRIPTION="The Boehm-Demers-Weiser conservative garbage collector"
+HOMEPAGE="http://www.hboehm.info/gc/"
+SRC_URI="http://www.hboehm.info/gc/gc_source/${MY_P}.tar.gz"
+
+LICENSE="boehm-gc"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="cxx static-libs threads"
+
+DEPEND=">=dev-libs/libatomic_ops-7.4
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-7.2e-os_dep.patch
+ epatch "${FILESDIR}"/${PN}-7.4.2-getcontext.patch
+}
+
+src_configure() {
+ local config=(
+ --with-libatomic-ops
+ $(use_enable cxx cplusplus)
+ $(use_enable static-libs static)
+ $(use threads || echo --disable-threads)
+ )
+ econf "${config[@]}"
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files
+
+ rm -r "${ED}"/usr/share/gc || die
+ dodoc README.QUICK doc/README{.environment,.linux,.macros}
+ dohtml doc/*.html
+ newman doc/gc.man GC_malloc.1
+}
diff --git a/dev-libs/boehm-gc/files/boehm-gc-7.2e-automake-1.13.patch b/dev-libs/boehm-gc/files/boehm-gc-7.2e-automake-1.13.patch
new file mode 100644
index 00000000..e987c42a
--- /dev/null
+++ b/dev-libs/boehm-gc/files/boehm-gc-7.2e-automake-1.13.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index ee6693d..d258252 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,7 +26,7 @@ AC_PREREQ(2.64)
+ AC_REVISION($Revision: 1.1 $)
+ GC_SET_VERSION
+ AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc])
+-AM_CONFIG_HEADER([include/private/config.h])
++AC_CONFIG_HEADER([include/private/config.h])
+ AM_MAINTAINER_MODE
+
+ AC_SUBST(PACKAGE)
diff --git a/dev-libs/boehm-gc/files/boehm-gc-7.2e-os_dep.patch b/dev-libs/boehm-gc/files/boehm-gc-7.2e-os_dep.patch
new file mode 100644
index 00000000..602cfef7
--- /dev/null
+++ b/dev-libs/boehm-gc/files/boehm-gc-7.2e-os_dep.patch
@@ -0,0 +1,11 @@
+taken from sabotage linux
+--- gc-7.2.org/os_dep.c 2013-01-03 17:13:21.878000003 +0000
++++ gc-7.2/os_dep.c 2013-01-04 07:57:17.766000002 +0000
+@@ -26,6 +26,7 @@
+ # define __KERNEL__
+ # include <asm/signal.h>
+ # undef __KERNEL__
++# elif 1
+ # else
+ /* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
+ /* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
diff --git a/dev-libs/boehm-gc/files/boehm-gc-7.4.2-getcontext.patch b/dev-libs/boehm-gc/files/boehm-gc-7.4.2-getcontext.patch
new file mode 100644
index 00000000..d694b84a
--- /dev/null
+++ b/dev-libs/boehm-gc/files/boehm-gc-7.4.2-getcontext.patch
@@ -0,0 +1,12 @@
+diff -ur a/gc-7.4.2/mach_dep.c b/gc-7.4.2/mach_dep.c
+--- a/gc-7.4.2/mach_dep.c 2014-06-03 08:08:02.000000000 -0200
++++ b/gc-7.4.2/mach_dep.c 2015-04-10 10:54:48.500634001 -0200
+@@ -218,7 +218,7 @@
+
+ # if defined(HAVE_PUSH_REGS)
+ GC_push_regs();
+-# elif defined(UNIX_LIKE) && !defined(NO_GETCONTEXT)
++# elif 0
+ /* Older versions of Darwin seem to lack getcontext(). */
+ /* ARM and MIPS Linux often doesn't support a real */
+ /* getcontext(). */
diff --git a/dev-libs/boehm-gc/metadata.xml b/dev-libs/boehm-gc/metadata.xml
new file mode 100644
index 00000000..89de9807
--- /dev/null
+++ b/dev-libs/boehm-gc/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>sera@gentoo.org</email>
+ <name>Ralph Sennhauser</name>
+ </maintainer>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-libs/gmp/Manifest b/dev-libs/gmp/Manifest
new file mode 100644
index 00000000..31ebc91d
--- /dev/null
+++ b/dev-libs/gmp/Manifest
@@ -0,0 +1,6 @@
+AUX gmp-4.1.4-noexecstack.patch 474 SHA256 68601777151a1628d7bc839eddd037685c5d2e76c9453166890a5eb3cf6000c3 SHA512 74b8b68061a1a5ac0f8b163974834465e86e930884e1a9cd15c4c948fdae95ffdcbb6e0210d56df6d0dcf1ccbe13dbdfe45552e645c3fdea6454747731b63bc8 WHIRLPOOL d8a0f81d4e97f6996bf68dd3d5488762e221f43a26e1cbff27adb372a40075d35fbb0e956ccd45c8b320a900d284f16d0649293cc907daab45d02cb30e74373b
+AUX gmp-5.1.3-secure-plt.patch 445 SHA256 6f3b512ad1a693c738155a9fc60d05576b6a9ca0de569bc937f98aa423b421ba SHA512 ec9b98f4dc1ad4b6ecdf4ebb5599bcaeee8d88b0f377a5b06ca0731049172712de1471c5fc1c7c3a5e38f72341047d7a561c70e203e2fb099de02350b406254a WHIRLPOOL 59e90fb588d70e543451e2e7728e1786e3004454ceb4869115c2d2c1164d46189eae035ef64f0fb0b053305fdada1052ce7285b678a7a688a88b422eb4af43d3
+DIST gmp-5.1.3.tar.xz 1818812 SHA256 dee2eda37f4ff541f30019932db0c37f6f77a30ba3609234933b1818f9b07071 SHA512 44bbec2b2a6480d4c9a9a633cca4fe0de966c13bc08bdcd8b934d81e21f3dfacaecf273f149dc613d365277d280ecee43cffdafaec1bd1239a7ed903f8658b5b WHIRLPOOL 0c4365a129136655046a8e46c4e2487a981c03de97ec47899f752cbd6e61661c6068b19c547acce8436f7a9af91396545c9bf7aa9de73a0f29384bbfebef927f
+DIST gmp-man-5.1.3.pdf 1159009 SHA256 56b0e21329f46ef1d59c1f191afc82c59f8b72273a8131ed9b5000b7d0689c38 SHA512 ba6a4b0bd2b5ee4d284dd13e9c5531fcb9cfbbbc80f40df458d73c80a1aa250b750cfdd5039998e8b0c7259a8b4d24bd0c7b59a90108f9b680bee62e6948d59e WHIRLPOOL ade206d7e1f543ed028f51e247067eec4511bd0f2499103e1e6296fad2bf50c4f8e09cf7688cc5dd56ee572cf889508ac7918f85e5f91d29d088882f7734a4e0
+EBUILD gmp-5.1.3-r99.ebuild 3089 SHA256 61aa3568d2f4d744ebbe1124cd78cfd59af1d850d77d254b482be4b0b13357a5 SHA512 98ae1ccc1ecc4c5da575f8244e6d3a21d9ee40f65fffb97355659a4e21a24c95b2ef5304e256f149b35aaebbbd13f9c2e79a1a847cbcf17d5512449c23640fb8 WHIRLPOOL c474042bea0425f6a3c3c30bff1075ea35108e471d2ac6195f80aff655332dadbf8d97a9957e4a28152721e3a5185be547f848b5e09729f8eb7faef668b94976
+MISC metadata.xml 315 SHA256 f6cfb0b2b72dab3e088b68df3d21db3f8463b30571e6de17d1431a57f1bc8d26 SHA512 109d0cbf90eff7264eb6502397024425664d8349229ba334797fcca61852e92ea2c3064579c4765793a69e2811a44ffa63b3091f2ffa5a433dc22ab308a2bcba WHIRLPOOL 3320121476ba2740ee9ee338374cccc853990f229e0cb3a23b5c0ed3e925485f5fd4b797b04ec4ae419eadfc5b9a057dcd9435fe507cca65560e09ad158c1ffb
diff --git a/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch b/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch
new file mode 100644
index 00000000..093bec1a
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-4.1.4-noexecstack.patch
@@ -0,0 +1,20 @@
+fixed executable stack
+
+http://bugs.gentoo.org/115038
+
+--- gmp-4.1.4/configure
++++ gmp-4.1.4/configure
+@@ -21689,6 +21689,13 @@
+ fi
+ echo "')" >> $gmp_configm4
+ echo "define(\`__CONFIG_M4_INCLUDED__')" >> $gmp_configm4
++# Gentoo hack
++case $host_os in
++ *linux*)
++ echo '.section .note.GNU-stack,"",%progbits' >> $gmp_configm4
++ echo '.previous' >> $gmp_configm4
++ ;;
++esac
+
+ # Create Makefiles
+ # FIXME: Upcoming version of autoconf/automake may not like broken lines.
diff --git a/dev-libs/gmp/files/gmp-5.1.3-secure-plt.patch b/dev-libs/gmp/files/gmp-5.1.3-secure-plt.patch
new file mode 100644
index 00000000..7fe67528
--- /dev/null
+++ b/dev-libs/gmp/files/gmp-5.1.3-secure-plt.patch
@@ -0,0 +1,17 @@
+Make it work with secure_plt
+diff -ru a/gmp-5.1.3/mpn/powerpc32/elf.m4 b/gmp-5.1.3/mpn/powerpc32/elf.m4
+--- a/gmp-5.1.3/mpn/powerpc32/elf.m4
++++ b/gmp-5.1.3/mpn/powerpc32/elf.m4
+@@ -41,8 +41,10 @@
+ m4_assert_numargs(2)
+ `ifdef(`PIC',`
+ mflr r0
+- bl _GLOBAL_OFFSET_TABLE_@local-4
+- mflr $1
++ bcl 20, 31, 1f
++1: mflr $1
++ addis $1, $1, (_GLOBAL_OFFSET_TABLE_-1b)@ha
++ addi $1, $1, (_GLOBAL_OFFSET_TABLE_-1b)@l
+ mtlr r0
+ lwz $1, $2@got($1)
+ ',`
diff --git a/dev-libs/gmp/gmp-5.1.3-r99.ebuild b/dev-libs/gmp/gmp-5.1.3-r99.ebuild
new file mode 100644
index 00000000..5620a887
--- /dev/null
+++ b/dev-libs/gmp/gmp-5.1.3-r99.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/gmp/gmp-5.1.3-r1.ebuild,v 1.19 2014/05/14 14:41:58 ago Exp $
+
+EAPI="4"
+
+inherit flag-o-matic eutils libtool toolchain-funcs multilib-minimal
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="Library for arithmetic on arbitrary precision integers, rational numbers, and floating-point numbers"
+HOMEPAGE="http://gmplib.org/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
+ ftp://ftp.gmplib.org/pub/${MY_P}/${MY_P}.tar.xz
+ doc? ( http://gmplib.org/${PN}-man-${MY_PV}.pdf )"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="ppc"
+IUSE="doc cxx pgo static-libs"
+
+DEPEND="sys-devel/m4
+ app-arch/xz-utils"
+RDEPEND="abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r1
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+)"
+
+S=${WORKDIR}/${MY_P}
+
+DOCS=( AUTHORS ChangeLog NEWS README doc/configuration doc/isa_abi_headache )
+HTML_DOCS=( doc )
+MULTILIB_WRAPPED_HEADERS=( /usr/include/gmp.h )
+
+src_prepare() {
+ [[ -d ${FILESDIR}/${PV} ]] && EPATCH_SUFFIX="diff" EPATCH_FORCE="yes" epatch "${FILESDIR}"/${PV}
+ epatch "${FILESDIR}"/${PN}-4.1.4-noexecstack.patch
+
+ epatch "${FILESDIR}"/${PN}-5.1.3-secure-plt.patch
+
+ # note: we cannot run autotools here as gcc depends on this package
+ elibtoolize
+
+ # GMP uses the "ABI" env var during configure as does Gentoo (econf).
+ # So, to avoid patching the source constantly, wrap things up.
+ mv configure configure.wrapped || die
+ cat <<-\EOF > configure
+ #!/bin/sh
+ exec env ABI="$GMPABI" "$0.wrapped" "$@"
+ EOF
+ chmod a+rx configure
+}
+
+multilib_src_configure() {
+ # Because of our 32-bit userland, 1.0 is the only HPPA ABI that works
+ # http://gmplib.org/manual/ABI-and-ISA.html#ABI-and-ISA (bug #344613)
+ if [[ ${CHOST} == hppa2.0-* ]] ; then
+ export GMPABI="1.0"
+ fi
+
+ # ABI mappings (needs all architectures supported)
+ case ${ABI} in
+ 32|x86) GMPABI=32;;
+ 64|amd64|n64) GMPABI=64;;
+ [onx]32) GMPABI=${ABI};;
+ esac
+ export GMPABI
+
+ tc-export CC
+ ECONF_SOURCE="${S}" econf \
+ --localstatedir=/var/state/gmp \
+ --enable-shared \
+ $(use_enable cxx) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ emake
+
+ if use pgo ; then
+ emake -j1 -C tune tuneup
+ ebegin "Trying to generate tuned data"
+ ./tune/tuneup | tee gmp.mparam.h.new
+ if eend $(( 0 + ${PIPESTATUS[*]/#/+} )) ; then
+ mv gmp.mparam.h.new gmp-mparam.h || die
+ emake clean
+ emake
+ fi
+ fi
+}
+
+multilib_src_test() {
+ emake check
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ # should be a standalone lib
+ rm -f "${D}"/usr/$(get_libdir)/libgmp.la
+ # this requires libgmp
+ local la="${D}/usr/$(get_libdir)/libgmpxx.la"
+ use static-libs \
+ && sed -i 's:/[^ ]*/libgmp.la:-lgmp:' "${la}" \
+ || rm -f "${la}"
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ use doc && cp "${DISTDIR}"/gmp-man-${MY_PV}.pdf "${D}"/usr/share/doc/${PF}/
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libgmp.so.3
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libgmp.so.3
+}
diff --git a/dev-libs/gmp/metadata.xml b/dev-libs/gmp/metadata.xml
new file mode 100644
index 00000000..b419bd1e
--- /dev/null
+++ b/dev-libs/gmp/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>toolchain</herd>
+<use>
+ <flag name='pgo'>after building gmp, run some tests against to produce faster libraries -- this option will double the compile time</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-libs/libgamin/Manifest b/dev-libs/libgamin/Manifest
new file mode 100644
index 00000000..3e28cef4
--- /dev/null
+++ b/dev-libs/libgamin/Manifest
@@ -0,0 +1,14 @@
+AUX libgamin-0.1.10-G_CONST_RETURN-removal.patch 2470 SHA256 adddd1f54bb33669d9163398308ebb732f33b6c12b1363a0dcf765ff28fc30ad SHA512 56cf8439d64c3856cc768a0d6aa67e00e82579b0db60b1f25b195024eec1628f61013718f3139910735eafa15e05f4fabe4373ebac053778abb1c89201c6cf0c WHIRLPOOL 425495ec6bb9cc5993631b9c5ef24d33261f71e9a039120a373235bae3cb386b8a938cd06714a6fba57a2378f868d372b063efc325bc98faa43b3c136c4d00b1
+AUX libgamin-0.1.10-armel-features.patch 1490 SHA256 6b6faf3084ca2ddf577575395172901d637a96e5db8dd42bc5268d58a767d30e SHA512 fe6365489428ca9206a36b8dea495d5c4beb381fe43dd49aa2fa022f8ea34d8068275ce42f41211ef7ce8bb2c1dce952673d4b2e72eec5be00161fa8f8bcb2a5 WHIRLPOOL 935fde8a3683a1cb9f7f44307fe136a7f8251982501e54209625bee681d8ef23cfbf27d5f8b127da200a800c778b91013124ddd8caf970810c018d7f44dc356a
+AUX libgamin-0.1.10-compilewarnings.patch 526 SHA256 dfca2bee08ba14c873a6bcd732359dd7e3a9372d6d9fb82378194d7a73a30e68 SHA512 f413fbd5db1e0412d1fabe6b46e049d347735cf6db7a7ca1eecc9ede1b299a7e622be3c508df40990159e05470d285069a0fa4e2cfcf6fd80378d0aa2b69fd0f WHIRLPOOL ae2277d225551e1b7bbaa897b675b51e561b8e3f71a2456dafea4d7cf697437534aedf286ae9399e8445aca83c02dedd5ce2ac3d9c085293210e3c0bf9af2dea
+AUX libgamin-0.1.10-crosscompile-fix.patch 764 SHA256 27e92227c19a6ae61336f66cefe7d44fca43fe7e0c8122fe32c313b4d848f28c SHA512 11aca975f98d9364bfdd8e28162f922a96493012fb3c6c704115d33155b2a2e9bbd20aba64354db922f16c3589b88a07091590a5bd6aa806582b9b7875ba8e23 WHIRLPOOL 61c2c95cd7874eb106fcb1e474a10e21ce79d0c10220520810d904e4dac106ccfe12a09782d0ea7cb42c7369a1226fca9b7f4d826e5f62140713ea6a8ac967c2
+AUX libgamin-0.1.10-deadlock.patch 2090 SHA256 75cee6cb0210cec02be1e042454f561da20724c55810f968b0a5f4972f9cbfd5 SHA512 c0a4a318eb78b9666930e9d1a6fac5e7762f38796e5892d849c893df524310408020ea75fb02a4d79000be3440435ae640340cf2a3dd43fa031df5787762f8de WHIRLPOOL 9d5b26134ccd1e13c25f5bfe3295bdec7c1a8cdd73f21b1cb65ff50dc910e533c3ac5b28508cb7f93a15096e365aa25cdaf9f32d8d76cadf435215b8aebdb090
+AUX libgamin-0.1.10-disable_python_static_library.patch 340 SHA256 460306119bc6be6fd19d173eadfa28493fc72e90fceaf3ee49b50fee50a4f5d1 SHA512 8d11f4b891bfc9e1aa6ba99aa485279b29c0a0f154742349035032c5122ae6ef29da5e5f0482791a7b1f7bceebd2bc871f14c3eb96f1947ad791b8036e488b00 WHIRLPOOL 59fb95c4acb5f14897f274d1ad72bf0ddd67a0e905f4098894e2d56767c3930a99b4a459c0bcab607917b0305dab1ca516c8158ce9700c6de88648995e688be1
+AUX libgamin-0.1.10-fix-pthread-mutex.patch 417 SHA256 bfd5ee42e385367718a4dac8ab318f9a5881ab8b669e4020f87aacaef16a2f8e SHA512 70628fc39521ea8bc4a40b009d0881f6ee540334a31b2f0cb67dde0f75808c69feb78088ad24c3c4a0dec9fa59e87960fd81d1a2e56963ce9268d0a5e14f88e8 WHIRLPOOL e2268fe0e7ee84d4b5656ff392717c1888e6438a24132ccc701a9a3b19ad1717409df7ccc2945cdd350ce79630e3debc4b28da5d857323a128f8ad0892d8f4bb
+AUX libgamin-0.1.10-noinst-lib.patch 2207 SHA256 e19ede71d259fbe5888c06635441365a48687034b24c5f15edd808a7cbd9cdc7 SHA512 ba7ce391f4da1a6b4c75941b8440a72f483b6f2597592f64ddca720bf46b1269e64a20a27da9c35b134100a121990d84e28ac737cffef48e90974a017ba3a4cb WHIRLPOOL d3605973df5f148d03d65a6660925dd2c1bca5bda9574714fb3259f630341cdeb3d5d7c73986fa0a6eacb0f34c584eb25c8f6ed431d1b95df21a974241678124
+DIST gamin-0.1.10.tar.bz2 452194 SHA256 a59948b20ce2f14136c013f155abb8c8d51db2ea167c063ff33461e453fec10a SHA512 ccdbc06eeb958ed2d888aee3fcadbadf00e9e6566802adee82035e0762ac3351ed2a2983eabe07503ddde2ddf035185c6cd98cbece2feadaaa36e8f656a38306 WHIRLPOOL 49ca0e192d8f5e28d6ffbb201b98b0f2c736554447b37c50eaa6e76e499ab77d696cf585c96c6a38f94c2589c634e694daf2e4969ffddbbb245b07b8a6e7b2d8
+DIST gamin-0.1.9-freebsd.patch.bz2 4635 SHA256 fcd1a6655d1c7cd86db6102931a4da1c22bc85f1c4692959c1a966fec5231723 SHA512 a9d9a8e4d85b289df6f87bf2b966ff262281db0d7e6094deb4f2c179f12c6cc3e387c1e1c28306a9fb54f2eb2837f9bdd3a34b2bb68db8abfdbecc7492e9730b WHIRLPOOL 462173a33e8f804b71c6991aa5925a5c9a6ee83f80b13967369c5c45721069e629c052e5daebfc3fb03bbad4d3054b523afb6e430db997581f3ff942f7da3180
+DIST libgamin-0.1.10-opensolaris.patch.bz2 16955 SHA256 9cb1bde5a34888ce4de4c4894c7d31dbfdbfb3279007b9eddf2da35510f6a9b5 SHA512 fd1cfc5a6b5ba429622f8d426cfba0e3c1c05c3677fb58c53af39b4030ae56f3f71caf63eb5ecb16169c2f7e8c79a32d7d440857c2c7fd3a259cf8312a9b2004 WHIRLPOOL 3efbf3781a55f44f383e573db4a3b3df731e9f77608d73db4ff3027eae0bda6abb6eae022c094735c0d8d2a85e224a980436d8557f9350bb1558b40d99280701
+DIST pkg-config-0.28.tar.gz 1931203 SHA256 6b6eb31c6ec4421174578652c7e141fdaae2dabad1021f420d8713206ac1f845 SHA512 6eafa5ca77c5d44cd15f48457a5e96fcea2555b66d8e35ada5ab59864a0aa03d441e15f54ab9c6343693867b3b490f392c75b7d9312f024c9b7ec6a0194d8320 WHIRLPOOL db4ddb4ce61724e629931c5ffccb4d7a551b4dc0f4efed5a966822307e4b5a786adee5705dd80ec0a9aa32cb1af9ad9615e307360e131fc34688207216161486
+EBUILD libgamin-0.1.10-r99.ebuild 4061 SHA256 4a309ff64993ee78ef757487a6c2eeb9b23201744b1db70906eaf7279889b4c4 SHA512 34fea1f9327fd1b75e6d0c123d75801d6d0f0963c7ddfc057c780fc4e9682c5ba5aee5ee80c71cecd1504d6c1cd76e1bf1efb5e8244d267e00289aea7e37d4ad WHIRLPOOL caf86538b138ae0ab10f71969f05694fed401e45956144b8e5f13153f29f364395b6be2a7ae6d1d50a1a91e87f4df720fbd931898f80f9af01f02771a9f790d7
+MISC metadata.xml 234 SHA256 3018e3b31ed690a57bfc14e35699dd20ea3b352fc28b918f699e6955b57a2d97 SHA512 eed880663c66280f6688f896bd6b82d600cac0063eb79da7b1be0fe3bf866e7289edb389a505dfbf45bd9c7e5282748dadd7bf3477759788c1024300796545c3 WHIRLPOOL 79028c7efb93b6255351aebe7f35d1587d07ec1405e8fbee4fd874e42e57e6d10368b0f4ab60c89e115493a094f36af8be1bc2fe79fc2d34daae83dc0f8d7b16
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-G_CONST_RETURN-removal.patch b/dev-libs/libgamin/files/libgamin-0.1.10-G_CONST_RETURN-removal.patch
new file mode 100644
index 00000000..087312f5
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-G_CONST_RETURN-removal.patch
@@ -0,0 +1,67 @@
+From 2a9d32734a2e5125ae77de6c75789e1c6ee24dbe Mon Sep 17 00:00:00 2001
+From: Maciej Piechotka <uzytkownik2@gmail.com>
+Date: Tue, 13 Sep 2011 09:47:05 +0200
+Subject: [PATCH] Fix compilation of recent glib removing G_CONST_RETURN
+
+---
+ server/gam_node.c | 2 +-
+ server/gam_node.h | 2 +-
+ server/gam_subscription.c | 2 +-
+ server/gam_subscription.h | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/server/gam_node.c b/server/gam_node.c
+index 02358ba..d0302d2 100644
+--- a/server/gam_node.c
++++ b/server/gam_node.c
+@@ -122,7 +122,7 @@ gam_node_set_is_dir(GamNode * node, gboolean is_dir)
+ * it has finished with the string. If it must keep it longer, it
+ * should makes its own copy. The returned string must not be freed.
+ */
+-G_CONST_RETURN char *
++const char *
+ gam_node_get_path(GamNode * node)
+ {
+ g_assert(node);
+diff --git a/server/gam_node.h b/server/gam_node.h
+index 02c8692..83349a8 100644
+--- a/server/gam_node.h
++++ b/server/gam_node.h
+@@ -58,7 +58,7 @@ gboolean gam_node_is_dir (GamNode *node);
+ void gam_node_set_is_dir (GamNode *node,
+ gboolean is_dir);
+
+-G_CONST_RETURN char *gam_node_get_path (GamNode *node);
++const char *gam_node_get_path (GamNode *node);
+
+ GList *gam_node_get_subscriptions (GamNode *node);
+
+diff --git a/server/gam_subscription.c b/server/gam_subscription.c
+index dfa3273..4675b34 100644
+--- a/server/gam_subscription.c
++++ b/server/gam_subscription.c
+@@ -141,7 +141,7 @@ gam_subscription_pathlen(GamSubscription * sub)
+ * @param sub the GamSubscription
+ * @returns The path being monitored. It should not be freed.
+ */
+-G_CONST_RETURN char *
++const char *
+ gam_subscription_get_path(GamSubscription * sub)
+ {
+ if (sub == NULL)
+diff --git a/server/gam_subscription.h b/server/gam_subscription.h
+index d894fbe..e6b4e15 100644
+--- a/server/gam_subscription.h
++++ b/server/gam_subscription.h
+@@ -21,7 +21,7 @@ int gam_subscription_pathlen (GamSubscription *sub);
+
+ int gam_subscription_get_reqno (GamSubscription *sub);
+
+-G_CONST_RETURN char *gam_subscription_get_path (GamSubscription *sub);
++const char *gam_subscription_get_path (GamSubscription *sub);
+
+ GamListener *gam_subscription_get_listener (GamSubscription *sub);
+
+--
+1.7.6.1
+
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-armel-features.patch b/dev-libs/libgamin/files/libgamin-0.1.10-armel-features.patch
new file mode 100644
index 00000000..fdfcbd7e
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-armel-features.patch
@@ -0,0 +1,47 @@
+From 05dcfcd69848e119c6a30d363bc41e896029f8af Mon Sep 17 00:00:00 2001
+From: Sebastian Dröge <slomo@debian.org>
+Date: Tue, 15 Dec 2009 12:24:25 +0000
+Subject: Bug 588338 - Enable linux specific features on armel
+
+---
+diff --git a/configure.in b/configure.in
+index b0bbaec..e4b684e 100644
+--- a/configure.in
++++ b/configure.in
+@@ -176,7 +176,7 @@ fi
+
+ dnl check what OS we're on
+ #AM_CONDITIONAL(HAVE_LINUX, test x$target_os = xlinux-gnu)
+-if test x$target_os = xlinux-gnu; then
++if test x$target_os = xlinux-gnu -o x$target_os = xlinux-gnueabi; then
+ AC_DEFINE([HAVE_LINUX],[],[Whether we are using linux or not])
+ fi
+
+@@ -223,7 +223,7 @@ fi
+ dnl check if inotify backend is enabled
+ AM_CONDITIONAL(ENABLE_INOTIFY, test x$inotify = xtrue)
+
+-if test x$os = xlinux-gnu; then
++if test x$os = xlinux-gnu -o x$os = xlinux-gnueabi; then
+ AC_ARG_ENABLE(dnotify,
+ AC_HELP_STRING([--disable-dnotify], [Disable the DNotify backend]),
+ [dnotify="${enableval}"], [dnotify=true])
+@@ -297,10 +297,12 @@ else
+ fi
+
+ dnl Use weak symbols on linux/gcc to avoid imposing libpthreads to apps
+-if test x$os = xlinux-gnu -a x$WITH_THREADS = x1 ; then
+- if test "${CC}" = "gcc" ; then
+- echo Use weak symbols !
+- THREAD_LIBS=
++if test x$os = xlinux-gnu -o x$os = xlinux-gnueabi ; then
++ if test x$WITH_THREADS = x1 ; then
++ if test "${CC}" = "gcc" ; then
++ echo Use weak symbols !
++ THREAD_LIBS=
++ fi
+ fi
+ fi
+ AC_SUBST(THREAD_LIBS)
+--
+cgit v0.9.0.2
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-compilewarnings.patch b/dev-libs/libgamin/files/libgamin-0.1.10-compilewarnings.patch
new file mode 100644
index 00000000..d3e09313
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-compilewarnings.patch
@@ -0,0 +1,22 @@
+--- gamin-0.1.9/lib/gam_error.h.1 2007-08-15 01:09:13.000000000 +0200
++++ gamin-0.1.9/lib/gam_error.h 2007-08-15 01:09:27.000000000 +0200
+@@ -47,6 +47,9 @@
+
+ int gam_errno(void);
+
++void gam_error_init(void);
++void gam_error_check(void);
++
+ #ifdef GAM_DEBUG_ENABLED
+
+ #ifdef GAMIN_DEBUG_API
+@@ -70,9 +73,6 @@
+ const char* format, ...);
+ #define GAM_DEBUG if (gam_debug_active) gam_debug
+
+-void gam_error_init(void);
+-void gam_error_check(void);
+-
+ #else
+ /*
+ * no debug, redefine the macro empty content
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-crosscompile-fix.patch b/dev-libs/libgamin/files/libgamin-0.1.10-crosscompile-fix.patch
new file mode 100644
index 00000000..ce3a15b5
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-crosscompile-fix.patch
@@ -0,0 +1,38 @@
+--- configure.in.orig 2009-04-26 23:00:43.445135823 +0300
++++ configure.in 2009-04-26 23:25:04.042489243 +0300
+@@ -389,8 +389,7 @@
+
+ AC_MSG_CHECKING(abstract socket namespace)
+ AC_LANG_PUSH(C)
+-AC_RUN_IFELSE([AC_LANG_PROGRAM(
+-[[
++AC_TRY_RUN([
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -398,8 +397,8 @@
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #include <errno.h>
+-]],
+-[[
++
++int main() {
+ int listen_fd;
+ struct sockaddr_un addr;
+
+@@ -424,9 +423,11 @@
+ }
+ else
+ exit (0);
+-]])],
+- [have_abstract_sockets=yes],
+- [have_abstract_sockets=no])
++}
++],
++have_abstract_sockets=yes,
++have_abstract_sockets=no,
++have_abstract_sockets=no)
+ AC_LANG_POP(C)
+ AC_MSG_RESULT($have_abstract_sockets)
+
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-deadlock.patch b/dev-libs/libgamin/files/libgamin-0.1.10-deadlock.patch
new file mode 100644
index 00000000..9f2b2a51
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-deadlock.patch
@@ -0,0 +1,65 @@
+From cc14440eface093548cb3bc7814da11d9a99d283 Mon Sep 17 00:00:00 2001
+From: Anssi Hannula <anssi@mageia.org>
+Date: Wed, 4 Jan 2012 00:23:55 +0200
+Subject: [PATCH] fix possible server deadlock in ih_sub_cancel
+
+ih_sub_foreach() calls ih_sub_cancel() while inotify_lock is locked.
+However, ih_sub_cancel() locks it again, and locking GMutex recursively
+causes undefined behaviour.
+
+Fix that by removing locking from ih_sub_cancel() as ih_sub_foreach()
+is its only user. Also make the function static so that it won't
+accidentally get used by other files without locking (inotify-helper.h
+is an internal server header).
+
+This should fix the intermittent deadlocks I've been experiencing
+causing KDE applications to no longer start, and probably also
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542361
+---
+ server/inotify-helper.c | 7 ++-----
+ server/inotify-helper.h | 1 -
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/server/inotify-helper.c b/server/inotify-helper.c
+index d77203e..0789fa4 100644
+--- a/server/inotify-helper.c
++++ b/server/inotify-helper.c
+@@ -123,13 +123,11 @@ ih_sub_add (ih_sub_t * sub)
+
+ /**
+ * Cancels a subscription which was being monitored.
++ * inotify_lock must be held when calling.
+ */
+-gboolean
++static gboolean
+ ih_sub_cancel (ih_sub_t * sub)
+ {
+- G_LOCK(inotify_lock);
+-
+-
+ if (!sub->cancelled)
+ {
+ IH_W("cancelling %s\n", sub->pathname);
+@@ -140,7 +138,6 @@ ih_sub_cancel (ih_sub_t * sub)
+ sub_list = g_list_remove (sub_list, sub);
+ }
+
+- G_UNLOCK(inotify_lock);
+ return TRUE;
+ }
+
+diff --git a/server/inotify-helper.h b/server/inotify-helper.h
+index 5d3b6d0..d36b5fd 100644
+--- a/server/inotify-helper.h
++++ b/server/inotify-helper.h
+@@ -34,7 +34,6 @@ gboolean ih_startup (event_callback_t ecb,
+ found_callback_t fcb);
+ gboolean ih_running (void);
+ gboolean ih_sub_add (ih_sub_t *sub);
+-gboolean ih_sub_cancel (ih_sub_t *sub);
+
+ /* Return FALSE from 'f' if the subscription should be cancelled */
+ void ih_sub_foreach (void *callerdata, gboolean (*f)(ih_sub_t *sub, void *callerdata));
+--
+1.7.7.2
+
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-disable_python_static_library.patch b/dev-libs/libgamin/files/libgamin-0.1.10-disable_python_static_library.patch
new file mode 100644
index 00000000..562fc071
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-disable_python_static_library.patch
@@ -0,0 +1,13 @@
+--- python/Makefile.am
++++ python/Makefile.am
+@@ -10,8 +10,9 @@
+ python_LTLIBRARIES = _gamin.la
+
+ _gamin_la_SOURCES = gamin.c
++_gamin_la_CFLAGS = -shared
+ _gamin_la_LIBADD = $(top_builddir)/libgamin/libgamin-1.la
+-_gamin_la_LDFLAGS = -module -avoid-version
++_gamin_la_LDFLAGS = -module -avoid-version -shared
+
+ python_PYTHON = gamin.py
+
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-fix-pthread-mutex.patch b/dev-libs/libgamin/files/libgamin-0.1.10-fix-pthread-mutex.patch
new file mode 100644
index 00000000..c8c5b000
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-fix-pthread-mutex.patch
@@ -0,0 +1,11 @@
+--- gamin-0.1.10.orig/libgamin/gam_data.c
++++ gamin-0.1.10/libgamin/gam_data.c
+@@ -470,7 +470,7 @@
+ }
+ if (is_threaded > 0) {
+ pthread_mutexattr_init(&attr);
+-#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP)
++#if defined(linux) && defined(PTHREAD_MUTEX_RECURSIVE_NP)
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ #else
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
diff --git a/dev-libs/libgamin/files/libgamin-0.1.10-noinst-lib.patch b/dev-libs/libgamin/files/libgamin-0.1.10-noinst-lib.patch
new file mode 100644
index 00000000..1f2fcff6
--- /dev/null
+++ b/dev-libs/libgamin/files/libgamin-0.1.10-noinst-lib.patch
@@ -0,0 +1,76 @@
+From e68aacc084d65fd0780991265444061b24422bd0 Mon Sep 17 00:00:00 2001
+From: Remi Cardona <remi@gentoo.org>
+Date: Mon, 20 Oct 2008 19:17:36 +0200
+Subject: [PATCH] make libgamin_shared a "noinst" libtool helper lib
+
+---
+ lib/Makefile.am | 4 ++--
+ libgamin/Makefile.am | 15 ++-------------
+ server/Makefile.am | 2 +-
+ 3 files changed, 5 insertions(+), 16 deletions(-)
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 3e2289c..af2152a 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -7,9 +7,9 @@ if GAMIN_DEBUG
+ INCLUDES += -DGAM_DEBUG_ENABLED
+ endif
+
+-lib_LIBRARIES = libgamin_shared.a
++noinst_LTLIBRARIES = libgamin_shared.la
+
+-libgamin_shared_a_SOURCES = \
++libgamin_shared_la_SOURCES = \
+ gam_event.c \
+ gam_event.h \
+ gam_error.c \
+diff --git a/libgamin/Makefile.am b/libgamin/Makefile.am
+index 35aa740..14fc06b 100644
+--- a/libgamin/Makefile.am
++++ b/libgamin/Makefile.am
+@@ -25,19 +25,9 @@ libgamin_1_la_SOURCES = \
+ gam_data.h \
+ gam_fork.c \
+ gam_fork.h \
+- gam_protocol.h \
+- gam_error.c \
+- gam_event.c
++ gam_protocol.h
+
+-gam_error.c: $(top_srcdir)/lib/gam_error.c
+- @(cp $(top_srcdir)/lib/gam_error.c gam_error.c)
+-
+-gam_event.c: $(top_srcdir)/lib/gam_event.c
+- @(cp $(top_srcdir)/lib/gam_event.c gam_event.c)
+-
+-CLEANFILES=gam_error.c gam_event.c
+-
+-libgamin_1_la_LIBADD =
++libgamin_1_la_LIBADD = $(top_builddir)/lib/libgamin_shared.la
+
+ libgamin_1_la_LDFLAGS = -Wl,--version-script=$(srcdir)/gamin_sym.version \
+ -version-info @GAMIN_VERSION_INFO@ @THREAD_LIBS@
+@@ -54,6 +44,5 @@ noinst_PROGRAMS= gamin
+
+ gamin_SOURCES = gamin.c
+ gamin_LDFLAGS =
+-gamin_DEPENDENCIES = $(DEPS) libgamin-1.la
+ gamin_LDADD= $(LDADDS) libgamin-1.la
+
+diff --git a/server/Makefile.am b/server/Makefile.am
+index 37aed8b..6aa5e02 100644
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -80,7 +80,7 @@ endif
+
+ gam_server_LDFLAGS =
+ gam_server_DEPENDENCIES = $(DEPS)
+-gam_server_LDADD= $(top_builddir)/lib/libgamin_shared.a $(LDADDS) $(DAEMON_LIBS)
++gam_server_LDADD= $(top_builddir)/lib/libgamin_shared.la $(LDADDS) $(DAEMON_LIBS)
+
+ if ENABLE_HURD_MACH_NOTIFY
+ gam_server_LDADD += -lports -lthreads
+--
+1.6.0.2
+
diff --git a/dev-libs/libgamin/libgamin-0.1.10-r99.ebuild b/dev-libs/libgamin/libgamin-0.1.10-r99.ebuild
new file mode 100644
index 00000000..176ddde5
--- /dev/null
+++ b/dev-libs/libgamin/libgamin-0.1.10-r99.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libgamin/libgamin-0.1.10-r5.ebuild,v 1.12 2014/12/06 16:40:07 ago Exp $
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+GNOME_ORG_MODULE="gamin"
+GNOME_TARBALL_SUFFIX="bz2"
+
+inherit autotools eutils flag-o-matic libtool python-r1 gnome.org multilib-minimal
+
+DESCRIPTION="Library providing the FAM File Alteration Monitor API"
+HOMEPAGE="http://www.gnome.org/~veillard/gamin/"
+SRC_URI="${SRC_URI}
+ mirror://gentoo/gamin-0.1.9-freebsd.patch.bz2
+ http://dev.gentoo.org/~grobian/patches/libgamin-0.1.10-opensolaris.patch.bz2
+ http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="debug kernel_linux python static-libs"
+
+RESTRICT="test" # needs gam-server
+
+RDEPEND="!app-admin/fam
+ !<app-admin/gamin-0.1.10"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ mv "${WORKDIR}"/pkg-config-*/pkg.m4 "${WORKDIR}"/ || die
+
+ # Fix QA warnings, bug #257281, upstream #466791
+ epatch "${FILESDIR}"/${PN}-0.1.10-compilewarnings.patch
+
+ if [[ ${CHOST} != *-solaris* ]] ; then
+ # Fix compile warnings; bug #188923
+ epatch "${DISTDIR}"/gamin-0.1.9-freebsd.patch.bz2
+ else
+ # (Open)Solaris necessary patches (changes configure.in), unfortunately
+ # conflicts with freebsd patch and breaks some linux installs so it must
+ # only be applied if on solaris.
+ epatch "${DISTDIR}"/${P}-opensolaris.patch.bz2
+ fi
+
+ # Fix collision problem due to intermediate library, upstream bug #530635
+ epatch "${FILESDIR}"/${PN}-0.1.10-noinst-lib.patch
+
+ # Fix compilation with latest glib, bug #382783
+ epatch "${FILESDIR}/${PN}-0.1.10-G_CONST_RETURN-removal.patch"
+
+ # Fix crosscompilation issues, bug #267604
+ epatch "${FILESDIR}/${PN}-0.1.10-crosscompile-fix.patch"
+
+ # Enable linux specific features on armel, upstream bug #588338
+ epatch "${FILESDIR}/${P}-armel-features.patch"
+
+ # Fix possible server deadlock in ih_sub_cancel, upstream bug #667230
+ epatch "${FILESDIR}/${PN}-0.1.10-deadlock.patch"
+
+ # Drop DEPRECATED flags
+ sed -i -e 's:-DG_DISABLE_DEPRECATED:$(NULL):g' server/Makefile.am || die
+
+ # Build only shared version of Python module.
+ epatch "${FILESDIR}"/${PN}-0.1.10-disable_python_static_library.patch
+
+ # Fix build on musl
+ epatch "${FILESDIR}"/${PN}-0.1.10-fix-pthread-mutex.patch
+
+ sed -i \
+ -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \
+ -e 's:AM_PROG_CC_STDC:AC_PROG_CC:' \
+ configure.in || die #466962
+
+ # autoconf is required as the user-cflags patch modifies configure.in
+ # however, elibtoolize is also required, so when the above patch is
+ # removed, replace the following call with a call to elibtoolize
+ AT_M4DIR="${WORKDIR}" eautoreconf
+}
+
+multilib_src_configure() {
+ local myconf=(
+ $(use_enable static-libs static)
+ --disable-debug
+ --disable-server
+ $(use_enable kernel_linux inotify)
+ $(use_enable debug debug-api)
+ --without-python
+ )
+ local ECONF_SOURCE=${S}
+
+ econf "${myconf[@]}"
+ if multilib_is_native_abi && use python; then
+ python_configure() {
+ mkdir -p "${BUILD_DIR}" || die
+ cd "${BUILD_DIR}" || die
+ econf "${myconf[@]}" --with-python
+ }
+
+ python_parallel_foreach_impl python_configure
+ fi
+}
+
+multilib_src_compile() {
+ default
+
+ if multilib_is_native_abi && use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_compile() {
+ emake -C "${BUILD_DIR}"/python \
+ VPATH="${native_builddir}/python:${S}/python" \
+ _gamin_la_LIBADD="${native_builddir}/libgamin/libgamin-1.la"
+ }
+
+ python_foreach_impl python_compile
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+
+ if multilib_is_native_abi && use python; then
+ local native_builddir=${BUILD_DIR}
+
+ python_install() {
+ emake -C "${BUILD_DIR}"/python \
+ DESTDIR="${D}" install \
+ VPATH="${native_builddir}/python:${S}/python"
+ }
+
+ python_foreach_impl python_install
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc AUTHORS ChangeLog README TODO NEWS doc/*txt
+ dohtml doc/*
+
+ prune_libtool_files --all
+}
diff --git a/dev-libs/libgamin/metadata.xml b/dev-libs/libgamin/metadata.xml
new file mode 100644
index 00000000..8c868061
--- /dev/null
+++ b/dev-libs/libgamin/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>freedesktop</herd>
+<maintainer>
+<email>freedesktop-bugs@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
new file mode 100644
index 00000000..6de1868e
--- /dev/null
+++ b/dev-libs/libxml2/Manifest
@@ -0,0 +1,32 @@
+AUX libxml2-2.7.1-catalog_path.patch 2209 SHA256 b3343f0611f9cb6e55bf62047a988653e3e9cc50f194b18adbc330b455236290 SHA512 99c1953865c560d2b7a01cf5fd61b1c5150857f3df8a9753ca583f6ff0a99e01c02d2586bb12220a615cf9c40a540dbe0d17996c0547bc0d20cbeefd6b45682d WHIRLPOOL 9b4daf434b38a0ae8103f02625ae033e7a94012a18cabc981f34b93fe8b422477905b74cfee300eb6a37e1af8bd358dd84804a5d0b6be8645ae9ee3e4c6fcd9b
+AUX libxml2-2.8.0-xmlParseAttValueComplex-underflow.patch 692 SHA256 fd86a145f57c425f00d55a0ac515442ecb22a76462a256797a7b1d385953997f SHA512 1ef15347ddf7c34649b7664a2f9164f906ce2d4019280c2543d7209010626f3aadbba9abafb26b4bce64f6c51cfad417a1a5a4caab4a836989f753f05083cb3d WHIRLPOOL 582f19fa221fc6815ec977c6c8e74fcd5556299c10791f1be6eee1db4bfc11f509e02c157ae5afbe6cda89cf694dd82aae367425bee8e029408063d013b315df
+AUX libxml2-2.8.0_rc1-winnt.patch 2392 SHA256 c18b2c15550b3ff4709a85cd18d16368928319b1b7fd8875dc34acd67076b134 SHA512 e78d010c82f18386b4f0ff84497585755b43416563bccd11f8e4dbf0153ca8842934fe05dce6c2373d8360574a2165795a78ea991682aed9610000d2bfcb0164 WHIRLPOOL a87eefa17ad113ae4aed14744715b4e1781e0869a3bb789bdf4f243bdb3687d0d4b6ee2addc85bf5b2f86b9d1cc442d946f0329011f033e3a7855ae0ad79b745
+AUX libxml2-2.9.0-disable_static_modules.patch 837 SHA256 745a4c7006874fbbbf30bd4ed07622a496445bf848a60f5ad5100889016f482a SHA512 7ced4510bcd3380f2910cac7420ab727de931939b9012f4ba034b66b32803f4e773fd81850451aa8a24530cc2d0898cebb3a329b42ab3c5daa41be63ae4303ec WHIRLPOOL 1584c94b2f8c583caa84a2ee8e2b23e31a3ef7060dba7f6c0c73fcdf7ec529e9cdc33294781465779ca7d7e6ef5265d7c0d158947ca5b3a7ba0a083333453a67
+AUX libxml2-2.9.0-excessive-entity-expansion.patch 5358 SHA256 a2675ed02fa9c28931c200eaa10f54ed167b8e7571d0d1c649db07fe3992c205 SHA512 a4ca8a2935be8357fef64f8fea7d590a90d840c92467d4254d9a250c83741f8c46ae1733f8a53badf929c4608fe82296790c343f2cebb8357dcb1ae5f593bbf9 WHIRLPOOL 278250976bb251382144c35e42912272259824862ce1a8078e2f2864fef369bd9d3845ad5d52ed0a04e3078aca6cc0ecbb6888fa0090203a76a331c8d4c4baa4
+AUX libxml2-2.9.0-large-file-parse.patch 1597 SHA256 c7ae7c9e94720f7ef1adfc5e60b0559a7a0ca0b302e8058b994f0b84b97f9ab6 SHA512 e049379b2e8cc26f6a6e348842eaa3955005834f61d56c53538ee0bd8a7cdda5cc51df8ed590a37799b1e04e692c2ef0954fb5728fb848a2e9d62162e5a761db WHIRLPOOL e360313cbf9b88f3fb6e80da44232a4d5ca84a43a9528fd2c5f102a4b47cee2da093fef24733afd958fb1c57df89d2ed30d079262b75be747e6e5ead8b3f2976
+AUX libxml2-2.9.0-manual-python.patch 1409 SHA256 647023249861bece60c719c49421a539342ab11a9c9023ee3175e29faaa24974 SHA512 1e06c52c729752d5bb72ac57ec0aa5c384eed49f79d38088eb9514c0a15c0f433309cd60ebfabbe75bf6166d93d1c7eb2a5ba6fd44a18bea8583590fdbcb3f11 WHIRLPOOL ec9653cab65af8833fef1264fe96ceeb8863047a3f699b8e69afbe8e5e47ef50e4e589a62d305d58352f560507cb606e45e1be5603b3b3758474fa192bb51506
+AUX libxml2-2.9.0-nsclean.patch 806 SHA256 3f135045a44423e7e50269bbc2464af50a86f33beef08bb0af6922091b39c9f2 SHA512 6cdf243fe5424a0506645930c7fa1fe38bb43d712bec6f5d88ffb3abfb70ce9af1414ddbde3c5266af53bd3a6a8ef26c5322ae701853ec008a53b9f6dc8b79c5 WHIRLPOOL 92ff510b095214b1a548abe0c19b475cf5d8885a8feec5e804e5e351a468bf5e30af9bacc2744da66b6a488661d9763f8fba1e6ee1de60f7e7602a45415561e0
+AUX libxml2-2.9.0-rand_seed.patch 845 SHA256 3a7c229c664aade8eb454da19f90cae3d9927d4c76859c85070da13c36565f7a SHA512 caca91890785959317943aae8b21dbed4bbc3a93cbee8d52101ee38f554ca464bb423962c4f52adf515361bdaf655b6bd3a664ff7503e8777f0cb9d4938d6eed WHIRLPOOL a3404a6311b433927c44467263235faf407437efbb52fc95d8fc65b42e1ad44b8c0c7181b07e0251aa186c07e74d6350b3568407c0e09a185659740bbe5e668d
+AUX libxml2-2.9.0-remove-redundant-pthread-defs.patch 489 SHA256 8f6c26a2db7c2a8cd01ad306df61da67fb1b4a3a4e7ec4d4761b57e1a59ff7f7 SHA512 815222f9f6adf04168172d4d3bc28af83024f2ea105a25eb08168260995bf1d42b390bbed73457f8e21f673099944e679808464cd30a9c90b381732a200949aa WHIRLPOOL 404018374329e276e0e8859017ae94ce4894cf54c62680295d3cf6f63c7783cfbcdbba65c111ced2caf78ede4f9e10f923552cfc8e6dd321b816fced50ef46bd
+AUX libxml2-2.9.0-streaming-validation.patch 1639 SHA256 295f3012c24d96fca5c38ca32449e3651ed85e1592db910631c7ef380b515d26 SHA512 efa42db1bae6cef4ad078d8550939a18f2e796499d428038ac1c1028466b8472963f26ade3142e89a4475c9a0c54daec0909510e7080b34538ff89ad2e82a3f1 WHIRLPOOL 188cc683b6631bb0d01ba941cf2405802cbd02ea7eb8b1a772a8511f948467f53e5a60e0463fab516c4fb11517eb7fa1e4e2d1856a537348ccbf473deae2b2fe
+AUX libxml2-2.9.0-thread-alloc.patch 1819 SHA256 ab0e44f05903ea70babeff17aaac09f344c9ce069264ecb4f27f9a6929c6af73 SHA512 80308f3f0087bcc0f08848e10c75b6333247f960190940e7a20575ce41d382fbd46350b0b8631a6c877f8edb06bcc930659c9e9e8ea71bc381f0a4287c22c935 WHIRLPOOL 24c4ba69c70ff949848795418cbfe59326c09a0b90126c67853fe7ee39854a824c56e092e7dacfe6a969eb4d451e6d2354c382c03e6d5c657eab07a50c14babe
+AUX libxml2-2.9.0-thread-portability.patch 1385 SHA256 0839bbd63e3eaa083e91e34d3c8a04700d2dc1e8242117f27d941bd16cfd9e32 SHA512 e07933f7c6a2170c822652c2216f90a60f3334a67d6ffa01e3ed9958842b0634bb4c0bb32d410dcbf99f82b091d8398adb4cf3e0666efa62a29084e1f7111ff8 WHIRLPOOL 29301cdc15e4ac04f3f03bf15099a4c70492b6b77f1bd3461613ac465311aabdb2c4dbcdefce5a2494fbbec155079fb50bd1b86904759df3c92734265ea8e405
+AUX libxml2-2.9.1-compression-detection.patch 3415 SHA256 02497f74371338b681e372b3fa6cdb3d24aa675caaa7a2e50fcf9bb117f29951 SHA512 28e1b914d60dea06d72de0523d289a4dca82ab3c505d796a223880fecebe22578369400a31f5d0f6ac02375e171ccb96368c0eb06ddaa67d9be377fc37c03357 WHIRLPOOL ca3eddb2ae8cdd088bb6b6a62c697a56d149a1134b892d2108d20baed4f4d951b8709604ac9d1b6cb8d6371a41b730c01e295de463242c6986401e25b518e622
+AUX libxml2-2.9.1-external-param-entities.patch 1374 SHA256 4066788b3c1b3be48ff8e79c35096c9cbe9c08d1da8d74d75d2a5992ba27a764 SHA512 020ba4c532776e09f4e2084419a532c75f4545235c080af9ffa9934703b6485fa32156ae7b287e13c219a47c6ce01a13298c448d8d61d905b5446d5cef1c4e5a WHIRLPOOL 661ca93431638c1025e56513e63ffa146a5fb9c9c48b11445e034e344cfe223bc03123b90a90b552cee005ce1fde82949f279cf5f96e9cfe85a74e5c506086b8
+AUX libxml2-2.9.1-icu-pkgconfig.patch 653 SHA256 e4a02666bd25e0771dcfa75edd4b22c4d2035c4c47f47f29f30b925a58bc38f7 SHA512 3d63f1f19b06a3edc92024e6b057a9d6c47274659ebebe59d20bc8e2fb62c902f19b1407aeb0903fa618aff4f43093997621dfc05dfef780df65db7d6bc2c44d WHIRLPOOL 28502cbd819bb6aedce3059ae6482cefab895053ff5dbf0d79aeb69663c77ffd38bee18a07a0e67d92424c32b6911089ba877c7a68b5badd91a321fe59dc59f5
+AUX libxml2-2.9.1-missing-break.patch 670 SHA256 98681d90b279174160e8bd3901f468544a7956d163c86473a60756be05191bad SHA512 2efee76fffd0da39e197b9a51bcc3925323ae4e1e861f55daec9ae7872166b24ed207970ef8573d306c267215f1ddf5439b45f2cb6b6d308bf749b22accf5c97 WHIRLPOOL f51d55103ad2060c883091e23554e5d70724fa4b2a58767b6d15143f447f445aa09df1ad7ac022f84d53f5339478e4f9ab8624918ab61f44402e6f59b2a7785e
+AUX libxml2-2.9.1-non-ascii-cr-lf.patch 5842 SHA256 1613e564814437ab1ddc28cb468cdebaff7e46587b364a4a6c7904c7b8da78b9 SHA512 1db9a31c1457e5ca6cb4397eb898a93e8985f1c73a5e213cbc1b70bc569fcef08c77af2f9123ed5b814903acda6cdf2e8b38434c81665f4456c8de4adb9345eb WHIRLPOOL adf9bb6dbff21494439589dc4f7b41d0719e0905811acc6719f637deffc0257f5aaf82534b8bf7761793a4ab7ecb12232a3de9d86c01391e6137043dbda22678
+AUX libxml2-2.9.1-python-2.6.patch 912 SHA256 5a6e6def4dda78be1f44eb72c0e108f9c5deb4e74324d7845d024d643042c0b7 SHA512 9bf67f06301e1c59b232b00540305cf570b9dc32e8ac7b91d7bcfe188a668dfa6e5cfa13399267f9683ff484df317433536ad1a4d0c49a4ed068ea55d841cee2 WHIRLPOOL 99de5f267813e0f6ae13e408bc6e596bdd228cf7b72f3f38e2edeceff4ed6fc1ad1a2b1ee1e1d85bd4d3a7f9a27e215e8d1d7f264f3a2e25e3d8313dfd46d3d7
+AUX libxml2-2.9.1-python3.patch 1328 SHA256 3702b2aec5e40b906358d13c11864fa0933b83f908f634171310e912bd6c2cd9 SHA512 29bbc4c4e58d8a5f24b6c58f61b3adef916becd2ba0a4c098faf5e889d0537d7f696237045b47a239b323babf637aa220f964d18cc047b8fb1bd3bf3b829d85c WHIRLPOOL ace0531053dbf8b0d8bafeb8ea03e1ff972608cc44dee8b238163264d43e8e8ffff8550066b30946b8f9a185f05f58b3a7e0892939802a0fc54e0a2c6963d0f0
+AUX libxml2-2.9.1-python3a.patch 1745 SHA256 0df91eae57ccd8db35c80ae479ea155c1b1cb28d6793b0526792a0d02c835028 SHA512 0d5b253af29fa88c1d7011d9f977283fd37aa6899689fad00b4c05cb7aa412fbaffcdc514a03a3da69708e5b347aa7519a901ffa2ae3fa271e9bca53efd802af WHIRLPOOL 61e8a7cd40ddfa89e6997bd47a8d9491e3f6bd15208c6448f6c2d61c99de4c4da6da6257d95eefeed7399cc768de0fb3658f3a441e8c78983cf91ed77b107c85
+AUX libxml2-2.9.1-xmllint-postvalid.patch 1167 SHA256 68e8448e81f56a2ce5e6f87d6330197e1afc8fd95f65705cd90a97f4613e2b7c SHA512 90f1cf6bc58fde94538f3fcc0f9ab8de97443ebafaeb96a4420ac107d4d3ab6c795544db774b3ad58fabc96098dfca7e4f3c8a51384b35cd2ccd02e6310ef98e WHIRLPOOL 220a58c6dc64054d4b925fd59c8cb93950e04eae0d528ddd20950611e1807868f12a88cf2fc537aaaaaacf427429b74653598d20afd796fd01afcd1663ef56ff
+AUX libxml2-2.9.2-icu-pkgconfig.patch 653 SHA256 b7e0e8ce27990d1ad8ef8eb3372a6cb9f8d7de5b0674613082ec3f6cdf214af1 SHA512 516fe55dc1500146e3fb1b8cf1c567aca668f54e65d7b595694cf668278217f0c2c82a03201dcdb463f8d5adda2620b42176a799bbaf2e1521500f8ed3971601 WHIRLPOOL f49a55065ab1a7d4159aa32b3182ae79c0b1d753f4aa81ef109eb38a2baa86c53a2ac98c391eebf0d1152206ec967adc1e4b41d6bbdabe3e6de791360d5c17af
+AUX libxml2-2.9.2-revert-missing-initialization.patch 715 SHA256 160258250f519b9d71e7d4ba913df6b2ba6109e1ac533bd19a3061ffbe82cd18 SHA512 cdad2b866684cc3193a5f3254339659e28ab4af988ba257ac0c41d42bf18c82665127cc705d36313f3bd4e5d6e1bb5bab0e966e9068398c62755ba54adea6b17 WHIRLPOOL 9addff866a02bee035b7aeccd4bd50baa74b0104c166cf02927fd779c92e41b119896a7fb2dcd0e255c7614018a80585b37f954ec36ae1a5871e0f885baff187
+DIST libxml2-2.9.1.tar.gz 5172503 SHA256 fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb SHA512 7b10de749485bc2eb2108063e97d89e70d6fbb78b1bf195ab5528c8c64e79483d55223a49d95934f4e00b00e906c18bdd34344703ffe158dcf08096905a44c1b WHIRLPOOL 5d2874527b637e666ca6afe710991aecb60c490de38edbe09a703c8e80c776d3f121544cc383146c336d46c573f3a3c9a2491c6c9cd5f22c5474d66dcb8ecf9b
+DIST libxml2-2.9.2.tar.gz 5444991 SHA256 5178c30b151d044aefb1b08bf54c3003a0ac55c59c866763997529d60770d5bc SHA512 a4e3b20e2efceed39c20379b32b746d4a1cf65c0cf7719d26c9bf7483c1f04a4e5a442ae2f36dc4ae8a4d011b67cfb58d9f6d0be034fa3e897a49059c9289565 WHIRLPOOL d7a77cb6ad49533cf62f6a759668e297a60dd7f70c9e13b29f682c64dfb25ae46eb9db552500130f40e3f969897bda996001d18236a4630e3713f6dd5acbe686
+DIST xmlts20080827.tar.gz 638940 SHA256 96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d WHIRLPOOL 50835380c3ea208df0bf9ce032ed2df69c4c6cb5a53ffdd39a08fb4f1d166f311b2ef2fe0d9911ae1ebff92aeb42f6ea55e727dfe0b7a3b95e6c7240315b3eda
+DIST xsts-2002-01-16.tar.gz 6894439 SHA256 55e5c08db29946a91ea8e70e8f2418d3fd30d8b6777941dfba7f54726ffd9914 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288 WHIRLPOOL 84dd51959460a4f8aa582d57ad39229c546ca7fe155012c57c368b59f5d31400d8b940a343a7320058330ca611303139cacdffed514783f96406ac5366026b11
+DIST xsts-2004-01-14.tar.gz 2761085 SHA256 09bdf9f81f381ebf9bc158a9472e498e896f7a02eb7461146e9abe1b9493ca17 SHA512 32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe WHIRLPOOL c46a3bf7d6dd771757f4304995cc177cf51c6cdd0e9778851fc13d3809c7b984690b4f273b3e075abe018110968eb7fc78f5b83170d3e18bacf00a4ed64b213d
+EBUILD libxml2-2.9.1-r999.ebuild 6603 SHA256 b3167a30d64ebaae7f546c05bf0c6a919618a1f2b45f66af3468dad4ae9bbcd7 SHA512 50adc82e2530845312a056b1c7d24f5c4d9fae3c45e0cf14c622c7c7c68b6229a14f86e706b382e36851e5a3f1d149c00c12935416e2833121c950a45dcfb25d WHIRLPOOL 5ecfadbc4433ec21082f76af8570d8a1eec43df7cc560fd9ca8b4abea98a4f972a0b08f5a4ab5de8640b084b40ca8c2f93b009f318336103cdb91bc33bb07701
+EBUILD libxml2-2.9.2-r99.ebuild 6274 SHA256 4a1ca9821bcda948725aecc5d6d95f4d924059f6d6a769aa34d3fafded7d7435 SHA512 faf3c74ea9063e8ada8ff852b3d209e0e3f1b5ee6e19c8f63bccb04352dfe2841a7600f37d5b2146694af4d06e73dbe06794ed650a7f03779a3998a4d874fd64 WHIRLPOOL 394e335e559e84084ef0560acdc0cba5095b9de72960381c47385737f3080300c399b8eed3c960c69cb938130e87196142e27b4dccab672f2a8762532917ae27
+MISC metadata.xml 240 SHA256 5dcdc1a8fd86d82f00a60bb322fb4f8a579d75ec7be2398164435197ab3903df SHA512 d673fbe248c2fcdf401f91f8d0e15587fd9f94c604d62f7864931f379b35a3ffc20264ae9668661a0d09693cd42db30c7f74fcb606da812312e394272acfeec8 WHIRLPOOL 4d2cc2b44bc446377dc659162e9f638650e82564a3328b0b23c1e6f197e88b9ae545d8778c69829a6f268e8b5f7d0db1b0aee1e3d8aedd909d1d756dc4aa94c3
diff --git a/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch b/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch
new file mode 100644
index 00000000..25ea4783
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch
@@ -0,0 +1,66 @@
+--- catalog.c
++++ catalog.c
+@@ -68,10 +68,10 @@
+ #define XML_URN_PUBID "urn:publicid:"
+ #define XML_CATAL_BREAK ((xmlChar *) -1)
+ #ifndef XML_XML_DEFAULT_CATALOG
+-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
++#define XML_XML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"
+ #endif
+ #ifndef XML_SGML_DEFAULT_CATALOG
+-#define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog"
++#define XML_SGML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/sgml/catalog"
+ #endif
+
+ #if defined(_WIN32) && defined(_MSC_VER)
+@@ -76,7 +76,7 @@
+
+ #if defined(_WIN32) && defined(_MSC_VER)
+ #undef XML_XML_DEFAULT_CATALOG
+-static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog";
++static char XML_XML_DEFAULT_CATALOG[256] = "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog";
+ #if defined(_WIN32_WCE)
+ /* Windows CE don't have a A variant */
+ #define GetModuleHandleA GetModuleHandle
+--- xmlcatalog.c
++++ xmlcatalog.c
+@@ -43,7 +43,7 @@
+
+
+ #ifndef XML_SGML_DEFAULT_CATALOG
+-#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
++#define XML_SGML_DEFAULT_CATALOG "@GENTOO_PORTAGE_EPREFIX@/etc/sgml/catalog"
+ #endif
+
+ /************************************************************************
+--- runtest.c
++++ runtest.c
+@@ -2747,7 +2747,7 @@
+ */
+ static int
+ uripMatch(const char * URI) {
+- if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog")))
++ if ((URI == NULL) || (!strcmp(URI, "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog")))
+ return(0);
+ /* Verify we received the escaped URL */
+ if (strcmp(urip_rcvsURLs[urip_current], URI))
+@@ -2766,7 +2766,7 @@
+ */
+ static void *
+ uripOpen(const char * URI) {
+- if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog")))
++ if ((URI == NULL) || (!strcmp(URI, "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog")))
+ return(NULL);
+ /* Verify we received the escaped URL */
+ if (strcmp(urip_rcvsURLs[urip_current], URI))
+--- xmllint.c
++++ xmllint.c
+@@ -103,7 +103,7 @@
+ #endif
+
+ #ifndef XML_XML_DEFAULT_CATALOG
+-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
++#define XML_XML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"
+ #endif
+
+ typedef enum {
diff --git a/dev-libs/libxml2/files/libxml2-2.8.0-xmlParseAttValueComplex-underflow.patch b/dev-libs/libxml2/files/libxml2-2.8.0-xmlParseAttValueComplex-underflow.patch
new file mode 100644
index 00000000..be9cfee0
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.8.0-xmlParseAttValueComplex-underflow.patch
@@ -0,0 +1,25 @@
+From 6a36fbe3b3e001a8a840b5c1fdd81cefc9947f0d Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Mon, 29 Oct 2012 10:39:55 +0800
+Subject: [PATCH] Fix potential out of bound access
+
+---
+ parser.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/parser.c b/parser.c
+index 0d8d7f2..bd634e9 100644
+--- a/parser.c
++++ b/parser.c
+@@ -4076,7 +4076,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
+ goto error;
+
+ if ((in_space) && (normalize)) {
+- while (buf[len - 1] == 0x20) len--;
++ while ((len > 0) && (buf[len - 1] == 0x20)) len--;
+ }
+ buf[len] = 0;
+ if (RAW == '<') {
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch b/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch
new file mode 100644
index 00000000..cce3ecb0
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch
@@ -0,0 +1,91 @@
+From 168e20836fe9614dd2dd4b42006c17a783f11c48 Mon Sep 17 00:00:00 2001
+From: Markus Duft <mduft@gentoo.org>
+Date: Thu, 20 Nov 2008 11:04:33 -0500
+Subject: [PATCH] Fix for ~x86-winnt
+
+[Alexandre Rostovtsev <tetromino@gentoo.org>: port to 2.8.0-rc1]
+---
+ dict.c | 2 +-
+ include/wsockcompat.h | 2 +-
+ nanohttp.c | 2 +-
+ xmlIO.c | 4 ++++
+ 4 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/dict.c b/dict.c
+index 3579f64..71e7bc6 100644
+--- a/dict.c
++++ b/dict.c
+@@ -47,7 +47,7 @@
+ #else
+ #ifdef HAVE_INTTYPES_H
+ #include <inttypes.h>
+-#elif defined(WIN32)
++#elif defined(WIN32) || defined (__PARITY__)
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+diff --git a/include/wsockcompat.h b/include/wsockcompat.h
+index c762a64..1ed822b 100644
+--- a/include/wsockcompat.h
++++ b/include/wsockcompat.h
+@@ -27,7 +27,7 @@
+ #endif
+ #endif
+
+-#if defined( __MINGW32__ ) || defined( _MSC_VER )
++#if defined( __MINGW32__ ) || defined( _MSC_VER ) || defined(__PARITY__)
+ /* Include <errno.h> here to ensure that it doesn't get included later
+ * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */
+ #include <errno.h>
+diff --git a/nanohttp.c b/nanohttp.c
+index 2437fed..dbe97a7 100644
+--- a/nanohttp.c
++++ b/nanohttp.c
+@@ -74,7 +74,7 @@
+ #define XML_SOCKLEN_T unsigned int
+ #endif
+
+-#if defined(__MINGW32__) || defined(_WIN32_WCE)
++#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(__PARITY__)
+ #ifndef _WINSOCKAPI_
+ #define _WINSOCKAPI_
+ #endif
+diff --git a/xmlIO.c b/xmlIO.c
+index 73a995d..99562f6 100644
+--- a/xmlIO.c
++++ b/xmlIO.c
+@@ -47,6 +47,7 @@
+ #include <winnls.h> /* for CP_UTF8 */
+ #endif
+
++#ifndef __PARITY__
+ /* Figure a portable way to know if a file is a directory. */
+ #ifndef HAVE_STAT
+ # ifdef HAVE__STAT
+@@ -82,6 +83,7 @@
+ # endif
+ # endif
+ #endif
++#endif /* __PARITY__ */
+
+ #include <libxml/xmlmemory.h>
+ #include <libxml/parser.h>
+@@ -657,6 +659,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info)
+ {
+ #ifdef HAVE_STAT
+ int retval = -1;
++#ifndef __PARITY__
+ wchar_t *wPath;
+
+ wPath = __xmlIOWin32UTF8ToWChar(path);
+@@ -665,6 +668,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info)
+ retval = _wstat(wPath,info);
+ xmlFree(wPath);
+ }
++#endif
+ /* maybe path in native encoding */
+ if(retval < 0)
+ retval = stat(path,info);
+--
+1.7.8.6
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-disable_static_modules.patch b/dev-libs/libxml2/files/libxml2-2.9.0-disable_static_modules.patch
new file mode 100644
index 00000000..a7a8215d
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-disable_static_modules.patch
@@ -0,0 +1,21 @@
+diff --git a/python/Makefile.am b/python/Makefile.am
+index 4a8b5d5..b976893 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -19,13 +19,14 @@ if WITH_PYTHON
+ AM_CPPFLAGS = \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/include \
+- -I$(PYTHON_INCLUDES)
++ -I$(PYTHON_INCLUDES) \
++ -shared
+
+ python_LTLIBRARIES = libxml2mod.la
+
+ libxml2mod_la_SOURCES = libxml.c libxml_wrap.h libxml2-py.h libxml2-py.c types.c
+ libxml2mod_la_LIBADD = $(top_builddir)/libxml2.la $(CYGWIN_EXTRA_PYTHON_LIBADD) $(WIN32_EXTRA_PYTHON_LIBADD) $(PYTHON_LIBS) -lpython$(PYTHON_VERSION)
+-libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version
++libxml2mod_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) -module -avoid-version -shared
+
+ BUILT_SOURCES = libxml2-export.c libxml2-py.h libxml2-py.c
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-excessive-entity-expansion.patch b/dev-libs/libxml2/files/libxml2-2.9.0-excessive-entity-expansion.patch
new file mode 100644
index 00000000..d7ff539d
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-excessive-entity-expansion.patch
@@ -0,0 +1,156 @@
+From 23f05e0c33987d6605387b300c4be5da2120a7ab Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Tue, 19 Feb 2013 10:21:49 +0800
+Subject: [PATCH] Detect excessive entities expansion upon replacement
+
+If entities expansion in the XML parser is asked for,
+it is possble to craft relatively small input document leading
+to excessive on-the-fly content generation.
+This patch accounts for those replacement and stop parsing
+after a given threshold. it can be bypassed as usual with the
+HUGE parser option.
+---
+ include/libxml/parser.h | 1 +
+ parser.c | 44 ++++++++++++++++++++++++++++++++++++++------
+ parserInternals.c | 2 ++
+ 3 files changed, 41 insertions(+), 6 deletions(-)
+
+diff --git a/include/libxml/parser.h b/include/libxml/parser.h
+index e1346e4..3f5730d 100644
+--- a/include/libxml/parser.h
++++ b/include/libxml/parser.h
+@@ -310,6 +310,7 @@ struct _xmlParserCtxt {
+ xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */
+
+ int input_id; /* we need to label inputs */
++ unsigned long sizeentcopy; /* volume of entity copy */
+ };
+
+ /**
+diff --git a/parser.c b/parser.c
+index 91f8c90..ddf3b5b 100644
+--- a/parser.c
++++ b/parser.c
+@@ -122,7 +122,7 @@ xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID,
+ */
+ static int
+ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
+- xmlEntityPtr ent)
++ xmlEntityPtr ent, size_t replacement)
+ {
+ size_t consumed = 0;
+
+@@ -130,7 +130,24 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
+ return (0);
+ if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
+ return (1);
+- if (size != 0) {
++ if (replacement != 0) {
++ if (replacement < XML_MAX_TEXT_LENGTH)
++ return(0);
++
++ /*
++ * If the volume of entity copy reaches 10 times the
++ * amount of parsed data and over the large text threshold
++ * then that's very likely to be an abuse.
++ */
++ if (ctxt->input != NULL) {
++ consumed = ctxt->input->consumed +
++ (ctxt->input->cur - ctxt->input->base);
++ }
++ consumed += ctxt->sizeentities;
++
++ if (replacement < XML_PARSER_NON_LINEAR * consumed)
++ return(0);
++ } else if (size != 0) {
+ /*
+ * Do the check based on the replacement size of the entity
+ */
+@@ -176,7 +193,6 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
+ */
+ return (0);
+ }
+-
+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+ return (1);
+ }
+@@ -2743,7 +2759,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
+ while (*current != 0) { /* non input consuming loop */
+ buffer[nbchars++] = *current++;
+ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) {
+- if (xmlParserEntityCheck(ctxt, nbchars, ent))
++ if (xmlParserEntityCheck(ctxt, nbchars, ent, 0))
+ goto int_error;
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
+ }
+@@ -2785,7 +2801,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
+ while (*current != 0) { /* non input consuming loop */
+ buffer[nbchars++] = *current++;
+ if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) {
+- if (xmlParserEntityCheck(ctxt, nbchars, ent))
++ if (xmlParserEntityCheck(ctxt, nbchars, ent, 0))
+ goto int_error;
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
+ }
+@@ -7203,7 +7219,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+ xmlFreeNodeList(list);
+ return;
+ }
+- if (xmlParserEntityCheck(ctxt, 0, ent)) {
++ if (xmlParserEntityCheck(ctxt, 0, ent, 0)) {
+ xmlFreeNodeList(list);
+ return;
+ }
+@@ -7361,6 +7377,13 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+ xmlNodePtr nw = NULL, cur, firstChild = NULL;
+
+ /*
++ * We are copying here, make sure there is no abuse
++ */
++ ctxt->sizeentcopy += ent->length;
++ if (xmlParserEntityCheck(ctxt, 0, ent, ctxt->sizeentcopy))
++ return;
++
++ /*
+ * when operating on a reader, the entities definitions
+ * are always owning the entities subtree.
+ if (ctxt->parseMode == XML_PARSE_READER)
+@@ -7400,6 +7423,14 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+ } else if ((list == NULL) || (ctxt->inputNr > 0)) {
+ xmlNodePtr nw = NULL, cur, next, last,
+ firstChild = NULL;
++
++ /*
++ * We are copying here, make sure there is no abuse
++ */
++ ctxt->sizeentcopy += ent->length;
++ if (xmlParserEntityCheck(ctxt, 0, ent, ctxt->sizeentcopy))
++ return;
++
+ /*
+ * Copy the entity child list and make it the new
+ * entity child list. The goal is to make sure any
+@@ -14767,6 +14798,7 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt)
+ ctxt->catalogs = NULL;
+ ctxt->nbentities = 0;
+ ctxt->sizeentities = 0;
++ ctxt->sizeentcopy = 0;
+ xmlInitNodeInfoSeq(&ctxt->node_seq);
+
+ if (ctxt->attsDefault != NULL) {
+diff --git a/parserInternals.c b/parserInternals.c
+index 02032d5..f8a7041 100644
+--- a/parserInternals.c
++++ b/parserInternals.c
+@@ -1719,6 +1719,8 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
+ ctxt->charset = XML_CHAR_ENCODING_UTF8;
+ ctxt->catalogs = NULL;
+ ctxt->nbentities = 0;
++ ctxt->sizeentities = 0;
++ ctxt->sizeentcopy = 0;
+ ctxt->input_id = 1;
+ xmlInitNodeInfoSeq(&ctxt->node_seq);
+ return(0);
+--
+1.8.1.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-large-file-parse.patch b/dev-libs/libxml2/files/libxml2-2.9.0-large-file-parse.patch
new file mode 100644
index 00000000..61de4d62
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-large-file-parse.patch
@@ -0,0 +1,56 @@
+From 153cf15905cf4ec080612ada6703757d10caba1e Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Fri, 26 Oct 2012 13:50:47 +0800
+Subject: [PATCH] Fix large parse of file from memory
+
+https://bugzilla.redhat.com/show_bug.cgi?id=862969
+The new code trying to detect excessive input lookup would
+just get wrong sometimes in the case of very large file parsed
+directly from memory.
+---
+ libxml.h | 2 ++
+ parser.c | 1 +
+ xmlIO.c | 2 +-
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/libxml.h b/libxml.h
+index efe285b..7558b5f 100644
+--- a/libxml.h
++++ b/libxml.h
+@@ -91,6 +91,8 @@ void __xmlGlobalInitMutexDestroy(void);
+ int __xmlRandom(void);
+ #endif
+
++int xmlNop(void);
++
+ #ifdef IN_LIBXML
+ #ifdef __GNUC__
+ #ifdef PIC
+diff --git a/parser.c b/parser.c
+index 43f53d9..0d8d7f2 100644
+--- a/parser.c
++++ b/parser.c
+@@ -2025,6 +2025,7 @@ static void xmlSHRINK (xmlParserCtxtPtr ctxt) {
+ static void xmlGROW (xmlParserCtxtPtr ctxt) {
+ if ((((ctxt->input->end - ctxt->input->cur) > XML_MAX_LOOKUP_LIMIT) ||
+ ((ctxt->input->cur - ctxt->input->base) > XML_MAX_LOOKUP_LIMIT)) &&
++ ((ctxt->input->buf) && (ctxt->input->buf->readcallback != xmlNop)) &&
+ ((ctxt->options & XML_PARSE_HUGE) == 0)) {
+ xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup");
+ ctxt->instate = XML_PARSER_EOF;
+diff --git a/xmlIO.c b/xmlIO.c
+index f8f438b..44254e4 100644
+--- a/xmlIO.c
++++ b/xmlIO.c
+@@ -800,7 +800,7 @@ xmlCheckFilename (const char *path)
+ return 1;
+ }
+
+-static int
++int
+ xmlNop(void) {
+ return(0);
+ }
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-manual-python.patch b/dev-libs/libxml2/files/libxml2-2.9.0-manual-python.patch
new file mode 100644
index 00000000..2ebb4f04
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-manual-python.patch
@@ -0,0 +1,45 @@
+From 2a74d41325c9e8043a2beec8b957ddf66f57cfd5 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Tue, 18 Dec 2012 02:09:14 -0500
+Subject: [PATCH] build/test/install python bindings manually
+
+To support building for multiple python ABIs, we want to skip checks for
+python in configure, and build/test/install python bindings manually.
+---
+ configure.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 3d5f48b..b467c51 100644
+--- a/configure.in
++++ b/configure.in
+@@ -748,7 +748,7 @@ PYTHON_INCLUDES=
+ PYTHON_SITE_PACKAGES=
+ PYTHON_TESTS=
+ pythondir=
+-if test "$with_python" != "no" ; then
++if false ; then
+ if test -x "$with_python/bin/python"
+ then
+ echo Found python in $with_python/bin/python
+@@ -823,7 +823,7 @@ if test "$with_python" != "no" ; then
+ else
+ PYTHON=
+ fi
+-AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
++AM_CONDITIONAL(WITH_PYTHON, test "$with_python" != "no")
+ if test "$PYTHON_INCLUDES" != ""
+ then
+ PYTHON_SUBDIR=python
+@@ -1429,7 +1429,7 @@ else
+ echo "Enabled Schemas/Relax-NG support"
+ WITH_SCHEMAS=1
+ TEST_SCHEMAS="Schemastests Relaxtests"
+- if test "$PYTHON_INCLUDES" != "" ; then
++ if test "$with_python" != "no" ; then
+ PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests"
+ fi
+ with_regexps=yes
+--
+1.8.0.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-nsclean.patch b/dev-libs/libxml2/files/libxml2-2.9.0-nsclean.patch
new file mode 100644
index 00000000..994363fa
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-nsclean.patch
@@ -0,0 +1,27 @@
+From 711b15d545713b3a34a51ce8163d1162533647c9 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Thu, 25 Oct 2012 19:23:26 +0800
+Subject: [PATCH] Fix a bug in the nsclean option of the parser
+
+Raised as a side effect of:
+https://bugzilla.gnome.org/show_bug.cgi?id=663844
+---
+ parser.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/parser.c b/parser.c
+index 19f1217..43f53d9 100644
+--- a/parser.c
++++ b/parser.c
+@@ -1540,7 +1540,7 @@ nsPush(xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *URL)
+ {
+ if (ctxt->options & XML_PARSE_NSCLEAN) {
+ int i;
+- for (i = 0;i < ctxt->nsNr;i += 2) {
++ for (i = ctxt->nsNr - 2;i >= 0;i -= 2) {
+ if (ctxt->nsTab[i] == prefix) {
+ /* in scope */
+ if (ctxt->nsTab[i + 1] == URL)
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-rand_seed.patch b/dev-libs/libxml2/files/libxml2-2.9.0-rand_seed.patch
new file mode 100644
index 00000000..7798a2c7
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-rand_seed.patch
@@ -0,0 +1,31 @@
+From e7715a5963afebfb027120db6914926ec9a7373d Mon Sep 17 00:00:00 2001
+From: Wouter Van Rooy <rooywo@vasco.com>
+Date: Fri, 14 Sep 2012 14:39:42 +0800
+Subject: [PATCH] rand_seed should be static in dict.c
+
+For https://bugzilla.gnome.org/show_bug.cgi?id=683933
+rand_seed should be a static variable in dict.c
+
+We ran into a problem with another library that exports rand_seed as a
+function. Combined with 2.7.8 this was not a problem but later versions
+have this problem.
+---
+ dict.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dict.c b/dict.c
+index 9935a25..164c7f2 100644
+--- a/dict.c
++++ b/dict.c
+@@ -143,7 +143,7 @@ static int xmlDictInitialized = 0;
+ /*
+ * Internal data for random function, protected by xmlDictMutex
+ */
+-unsigned int rand_seed = 0;
++static unsigned int rand_seed = 0;
+ #endif
+ #endif
+
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-remove-redundant-pthread-defs.patch b/dev-libs/libxml2/files/libxml2-2.9.0-remove-redundant-pthread-defs.patch
new file mode 100644
index 00000000..f02f650b
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-remove-redundant-pthread-defs.patch
@@ -0,0 +1,19 @@
+diff -Naur libxml2-2.9.0.orig/threads.c libxml2-2.9.0/threads.c
+--- libxml2-2.9.0.orig/threads.c 2013-07-06 19:58:28.098680769 +0000
++++ libxml2-2.9.0/threads.c 2013-07-06 21:40:17.672022393 +0000
+@@ -47,6 +47,7 @@
+ #ifdef HAVE_PTHREAD_H
+
+ static int libxml_is_threaded = -1;
++#if 0
+ #ifdef __GNUC__
+ #ifdef linux
+ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
+@@ -90,6 +91,7 @@
+ #endif
+ #endif /* linux */
+ #endif /* __GNUC__ */
++#endif
+ #endif /* HAVE_PTHREAD_H */
+
+ /*
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-streaming-validation.patch b/dev-libs/libxml2/files/libxml2-2.9.0-streaming-validation.patch
new file mode 100644
index 00000000..5fa2d6f0
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-streaming-validation.patch
@@ -0,0 +1,54 @@
+From 6c91aa384f48ff6d406553a6dd47fd556c1ef2e6 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Thu, 25 Oct 2012 15:33:59 +0800
+Subject: [PATCH] Fix a regression in 2.9.0 breaking validation while
+ streaming
+
+https://bugzilla.gnome.org/show_bug.cgi?id=684774
+with help from Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
+---
+ SAX2.c | 2 +-
+ parser.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/SAX2.c b/SAX2.c
+index a24abc8..3eea39a 100644
+--- a/SAX2.c
++++ b/SAX2.c
+@@ -2202,7 +2202,7 @@ xmlSAX2StartElementNs(void *ctx,
+ (ctxt->myDoc->intSubset->elements == NULL) &&
+ (ctxt->myDoc->intSubset->attributes == NULL) &&
+ (ctxt->myDoc->intSubset->entities == NULL)))) {
+- xmlErrValid(ctxt, XML_ERR_NO_DTD,
++ xmlErrValid(ctxt, XML_DTD_NO_DTD,
+ "Validation failed: no DTD found !", NULL, NULL);
+ ctxt->validate = 0;
+ }
+diff --git a/parser.c b/parser.c
+index 28b0d80..19f1217 100644
+--- a/parser.c
++++ b/parser.c
+@@ -11633,7 +11633,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
+ "PP: Parsing internal subset\n");
+ #endif
+ ctxt->inSubset = 1;
+- ctxt->progressive = 1;
++ ctxt->progressive = 0;
+ ctxt->checkIndex = 0;
+ xmlParseDocTypeDecl(ctxt);
+ if (RAW == '[') {
+@@ -12219,7 +12219,10 @@ xmldecl_done:
+ }
+ ctxt->instate = XML_PARSER_EOF;
+ }
+- return((xmlParserErrors) ctxt->errNo);
++ if (ctxt->wellFormed == 0)
++ return((xmlParserErrors) ctxt->errNo);
++ else
++ return(0);
+ }
+
+ /************************************************************************
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-thread-alloc.patch b/dev-libs/libxml2/files/libxml2-2.9.0-thread-alloc.patch
new file mode 100644
index 00000000..2d0d5f78
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-thread-alloc.patch
@@ -0,0 +1,65 @@
+From 0ad948ede2b5060a144c72e4e27c38d24a272ef4 Mon Sep 17 00:00:00 2001
+From: Tim Starling <tstarling@wikimedia.org>
+Date: Mon, 29 Oct 2012 13:41:55 +1100
+Subject: [PATCH] Define LIBXML_THREAD_ALLOC_ENABLED via xmlversion.h
+
+Otherwise, direct calls to xmlFree() etc. from the application will
+use a different set of allocation functions to what was used to allocate
+the memory internally.
+---
+ configure.in | 4 +++-
+ include/libxml/xmlversion.h.in | 9 +++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 6da057c..245c033 100644
+--- a/configure.in
++++ b/configure.in
+@@ -954,6 +954,7 @@ WITH_THREADS=0
+ THREAD_CFLAGS=""
+ TEST_THREADS=""
+ THREADS_W32=""
++WITH_THREAD_ALLOC=0
+
+ if test "$with_threads" = "no" ; then
+ echo Disabling multithreaded support
+@@ -1017,7 +1018,7 @@ else
+ fi
+ fi
+ if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then
+- THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED"
++ WITH_THREAD_ALLOC=1
+ fi
+
+ AC_SUBST(THREAD_LIBS)
+@@ -1025,6 +1026,7 @@ AC_SUBST(BASE_THREAD_LIBS)
+ AC_SUBST(WITH_THREADS)
+ AC_SUBST(THREAD_CFLAGS)
+ AC_SUBST(TEST_THREADS)
++AC_SUBST(WITH_THREAD_ALLOC)
+ AM_CONDITIONAL([THREADS_W32],[test -n "$THREADS_W32"])
+
+ dnl
+diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
+index c98e7ca..00a836f 100644
+--- a/include/libxml/xmlversion.h.in
++++ b/include/libxml/xmlversion.h.in
+@@ -98,6 +98,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
+ #endif
+
+ /**
++ * LIBXML_THREAD_ALLOC_ENABLED:
++ *
++ * Whether the allocation hooks are per-thread
++ */
++#if @WITH_THREAD_ALLOC@
++#define LIBXML_THREAD_ALLOC_ENABLED
++#endif
++
++/**
+ * LIBXML_TREE_ENABLED:
+ *
+ * Whether the DOM like tree manipulation API support is configured in
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.0-thread-portability.patch b/dev-libs/libxml2/files/libxml2-2.9.0-thread-portability.patch
new file mode 100644
index 00000000..a85d6129
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.0-thread-portability.patch
@@ -0,0 +1,37 @@
+From 3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e Mon Sep 17 00:00:00 2001
+From: Friedrich Haubensak <hsk@fli-leibniz.de>
+Date: Wed, 12 Sep 2012 17:34:53 +0200
+Subject: [PATCH] Fix a thread portability problem
+
+cannot compile libxml2-2.9.0 using studio 12.1 compiler on solaris 10
+
+I.M.O. structure initializer (as PTHREAD_ONCE_INIT) cannot be used in
+a structure assignment anyway
+---
+ threads.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/threads.c b/threads.c
+index f206149..7e85a26 100644
+--- a/threads.c
++++ b/threads.c
+@@ -146,6 +146,7 @@ struct _xmlRMutex {
+ static pthread_key_t globalkey;
+ static pthread_t mainthread;
+ static pthread_once_t once_control = PTHREAD_ONCE_INIT;
++static pthread_once_t once_control_init = PTHREAD_ONCE_INIT;
+ static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER;
+ #elif defined HAVE_WIN32_THREADS
+ #if defined(HAVE_COMPILER_TLS)
+@@ -915,7 +916,7 @@ xmlCleanupThreads(void)
+ #ifdef HAVE_PTHREAD_H
+ if ((libxml_is_threaded) && (pthread_key_delete != NULL))
+ pthread_key_delete(globalkey);
+- once_control = PTHREAD_ONCE_INIT;
++ once_control = once_control_init;
+ #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+ if (globalkey != TLS_OUT_OF_INDEXES) {
+ xmlGlobalStateCleanupHelperParams *p;
+--
+1.8.0
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-compression-detection.patch b/dev-libs/libxml2/files/libxml2-2.9.1-compression-detection.patch
new file mode 100644
index 00000000..16ea5c19
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-compression-detection.patch
@@ -0,0 +1,126 @@
+From 63588f476f2dc89d4c6ef70a474d7230fbf4d45e Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Fri, 10 May 2013 14:01:46 +0800
+Subject: [PATCH] Fix a regression in xmlGetDocCompressMode()
+
+The switch to xzlib had for consequence that the compression
+level of the input was not gathered anymore in ctxt->input->buf,
+then the parser compression flags was left to -1 and propagated
+to the resulting document.
+Fix the I/O layer to get compression detection in xzlib,
+then carry it in the input buffer and the resulting document
+
+ This should fix
+ https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3456
+---
+ parser.c | 4 ++++
+ xmlIO.c | 17 +++++++++++++++++
+ xzlib.c | 25 +++++++++++++++++++++++++
+ xzlib.h | 1 +
+ 4 files changed, 47 insertions(+)
+
+diff --git a/parser.c b/parser.c
+index 1d478c3..4a442bb 100644
+--- a/parser.c
++++ b/parser.c
+@@ -10681,6 +10681,10 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
+ ctxt->sax->startDocument(ctxt->userData);
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(-1);
++ if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
++ (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
++ ctxt->myDoc->compression = ctxt->input->buf->compressed;
++ }
+
+ /*
+ * The Misc part of the Prolog
+diff --git a/xmlIO.c b/xmlIO.c
+index 847cb7e..fc4e111 100644
+--- a/xmlIO.c
++++ b/xmlIO.c
+@@ -2669,6 +2669,12 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
+ #endif
+ }
+ #endif
++#ifdef HAVE_LZMA_H
++ if ((xmlInputCallbackTable[i].opencallback == xmlXzfileOpen) &&
++ (strcmp(URI, "-") != 0)) {
++ ret->compressed = __libxml2_xzcompressed(context);
++ }
++#endif
+ }
+ else
+ xmlInputCallbackTable[i].closecallback (context);
+@@ -3325,6 +3331,17 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
+ if (res < 0) {
+ return(-1);
+ }
++
++ /*
++ * try to establish compressed status of input if not done already
++ */
++ if (in->compressed == -1) {
++#ifdef HAVE_LZMA_H
++ if (in->readcallback == xmlXzfileRead)
++ in->compressed = __libxml2_xzcompressed(in->context);
++#endif
++ }
++
+ len = res;
+ if (in->encoder != NULL) {
+ unsigned int use;
+diff --git a/xzlib.c b/xzlib.c
+index 928bd17..150e803 100644
+--- a/xzlib.c
++++ b/xzlib.c
+@@ -182,12 +182,37 @@ xz_open(const char *path, int fd, const char *mode ATTRIBUTE_UNUSED)
+ return (xzFile) state;
+ }
+
++static int
++xz_compressed(xzFile f) {
++ xz_statep state;
++
++ if (f == NULL)
++ return(-1);
++ state = (xz_statep) f;
++ if (state->init <= 0)
++ return(-1);
++
++ switch (state->how) {
++ case COPY:
++ return(0);
++ case GZIP:
++ case LZMA:
++ return(1);
++ }
++ return(-1);
++}
++
+ xzFile
+ __libxml2_xzopen(const char *path, const char *mode)
+ {
+ return xz_open(path, -1, mode);
+ }
+
++int
++__libxml2_xzcompressed(xzFile f) {
++ return xz_compressed(f);
++}
++
+ xzFile
+ __libxml2_xzdopen(int fd, const char *mode)
+ {
+diff --git a/xzlib.h b/xzlib.h
+index 43c75e1..29ba55e 100644
+--- a/xzlib.h
++++ b/xzlib.h
+@@ -15,4 +15,5 @@ xzFile __libxml2_xzopen(const char *path, const char *mode);
+ xzFile __libxml2_xzdopen(int fd, const char *mode);
+ int __libxml2_xzread(xzFile file, void *buf, unsigned len);
+ int __libxml2_xzclose(xzFile file);
++int __libxml2_xzcompressed(xzFile f);
+ #endif /* LIBXML2_XZLIB_H */
+--
+1.8.3.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-external-param-entities.patch b/dev-libs/libxml2/files/libxml2-2.9.1-external-param-entities.patch
new file mode 100644
index 00000000..81f692fc
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-external-param-entities.patch
@@ -0,0 +1,39 @@
+From 9cd1c3cfbd32655d60572c0a413e017260c854df Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Tue, 22 Apr 2014 15:30:56 +0800
+Subject: [PATCH] Do not fetch external parameter entities
+
+Unless explicitely asked for when validating or replacing entities
+with their value. Problem pointed out by Daniel Berrange <berrange@redhat.com>
+---
+ parser.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/parser.c b/parser.c
+index 9347ac9..c0dea05 100644
+--- a/parser.c
++++ b/parser.c
+@@ -2598,6 +2598,20 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
+ xmlCharEncoding enc;
+
+ /*
++ * Note: external parsed entities will not be loaded, it is
++ * not required for a non-validating parser, unless the
++ * option of validating, or substituting entities were
++ * given. Doing so is far more secure as the parser will
++ * only process data coming from the document entity by
++ * default.
++ */
++ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
++ ((ctxt->options & XML_PARSE_NOENT) == 0) &&
++ ((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
++ (ctxt->validate == 0))
++ return;
++
++ /*
+ * handle the extra spaces added before and after
+ * c.f. http://www.w3.org/TR/REC-xml#as-PE
+ * this is done independently.
+--
+1.9.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-icu-pkgconfig.patch b/dev-libs/libxml2/files/libxml2-2.9.1-icu-pkgconfig.patch
new file mode 100644
index 00000000..ab330389
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-icu-pkgconfig.patch
@@ -0,0 +1,26 @@
+diff --git a/configure.in b/configure.in
+index 7374564..13c8d4e 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1444,19 +1444,11 @@ XML_LIBTOOLLIBS="libxml2.la"
+ AC_SUBST(WITH_ICONV)
+
+ WITH_ICU=0
+-ICU_LIBS=""
+ if test "$with_icu" != "yes" ; then
+ echo Disabling ICU support
+ else
+- ICU_CONFIG=icu-config
+- if ${ICU_CONFIG} --cflags >/dev/null 2>&1
+- then
+- ICU_LIBS=`${ICU_CONFIG} --ldflags`
+- WITH_ICU=1
+- echo Enabling ICU support
+- else
+- AC_MSG_ERROR([libicu config program icu-config not found])
+- fi
++ PKG_CHECK_MODULES(ICU, icu-i18n)
++ WITH_ICU=1
+ fi
+ AC_SUBST(WITH_ICU)
+ AC_SUBST(ICU_LIBS)
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-missing-break.patch b/dev-libs/libxml2/files/libxml2-2.9.1-missing-break.patch
new file mode 100644
index 00000000..57665323
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-missing-break.patch
@@ -0,0 +1,25 @@
+From 10ec19ab0a49936ca8ca0d6962d24d3f889960a5 Mon Sep 17 00:00:00 2001
+From: dcb <dcb314@hotmail.com>
+Date: Thu, 2 May 2013 16:11:46 +0800
+Subject: [PATCH] Fix missing break on last() function for attributes
+
+pointed out by cppcheck
+---
+ python/libxml.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/python/libxml.c b/python/libxml.c
+index 03cfb9f..3338b83 100644
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -2683,6 +2683,7 @@ libxml_last(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
+ xmlAttrPtr attr = (xmlAttrPtr) cur;
+
+ res = attr->last;
++ break;
+ }
+ default:
+ res = NULL;
+--
+1.8.3.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-non-ascii-cr-lf.patch b/dev-libs/libxml2/files/libxml2-2.9.1-non-ascii-cr-lf.patch
new file mode 100644
index 00000000..51a92ada
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-non-ascii-cr-lf.patch
@@ -0,0 +1,168 @@
+From dcc19503193c71596278a252064a8ce66331b3cd Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Wed, 22 May 2013 22:56:45 +0200
+Subject: [PATCH] Fix a parsing bug on non-ascii element and CR/LF usage
+
+https://bugzilla.gnome.org/show_bug.cgi?id=698550
+
+Somehow the behaviour of the internal parser routine changed
+slightly when encountering CR/LF, which led to a bug when
+parsing document with non-ascii Names
+---
+ parser.c | 6 +++++-
+ result/japancrlf.xml | 4 ++++
+ result/japancrlf.xml.rde | 7 +++++++
+ result/japancrlf.xml.rdr | 7 +++++++
+ result/japancrlf.xml.sax | 11 +++++++++++
+ result/japancrlf.xml.sax2 | 11 +++++++++++
+ result/noent/japancrlf.xml | 4 ++++
+ test/japancrlf.xml | 6 ++++++
+ 8 files changed, 55 insertions(+), 1 deletion(-)
+ create mode 100644 result/japancrlf.xml
+ create mode 100644 result/japancrlf.xml.rde
+ create mode 100644 result/japancrlf.xml.rdr
+ create mode 100644 result/japancrlf.xml.sax
+ create mode 100644 result/japancrlf.xml.sax2
+ create mode 100644 result/noent/japancrlf.xml
+ create mode 100644 test/japancrlf.xml
+
+diff --git a/parser.c b/parser.c
+index 4a442bb..4739add 100644
+--- a/parser.c
++++ b/parser.c
+@@ -3404,6 +3404,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ int len = 0, l;
+ int c;
+ int count = 0;
++ const xmlChar *end; /* needed because CUR_CHAR() can move cur on \r\n */
+
+ #ifdef DEBUG
+ nbParseNCNameComplex++;
+@@ -3413,6 +3414,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ * Handler for more complex cases
+ */
+ GROW;
++ end = ctxt->input->cur;
+ c = CUR_CHAR(l);
+ if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
+ (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) {
+@@ -3434,12 +3436,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ }
+ len += l;
+ NEXTL(l);
++ end = ctxt->input->cur;
+ c = CUR_CHAR(l);
+ if (c == 0) {
+ count = 0;
+ GROW;
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
++ end = ctxt->input->cur;
+ c = CUR_CHAR(l);
+ }
+ }
+@@ -3448,7 +3452,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
+ return(NULL);
+ }
+- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
++ return(xmlDictLookup(ctxt->dict, end - len, len));
+ }
+
+ /**
+diff --git a/result/japancrlf.xml b/result/japancrlf.xml
+new file mode 100644
+index 0000000..60b307c
+--- /dev/null
++++ b/result/japancrlf.xml
+@@ -0,0 +1,4 @@
++<?xml version="1.0"?>
++<入力メッセージ xmlns="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826">
++ <c8c:Ele xmlns:c8c="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826"/>
++</入力メッセージ>
+diff --git a/result/japancrlf.xml.rde b/result/japancrlf.xml.rde
+new file mode 100644
+index 0000000..0bc5af7
+--- /dev/null
++++ b/result/japancrlf.xml.rde
+@@ -0,0 +1,7 @@
++0 1 入力メッセージ 0 0
++1 14 #text 0 1
++
++1 1 c8c:Ele 1 0
++1 14 #text 0 1
++
++0 15 入力メッセージ 0 0
+diff --git a/result/japancrlf.xml.rdr b/result/japancrlf.xml.rdr
+new file mode 100644
+index 0000000..0bc5af7
+--- /dev/null
++++ b/result/japancrlf.xml.rdr
+@@ -0,0 +1,7 @@
++0 1 入力メッセージ 0 0
++1 14 #text 0 1
++
++1 1 c8c:Ele 1 0
++1 14 #text 0 1
++
++0 15 入力メッセージ 0 0
+diff --git a/result/japancrlf.xml.sax b/result/japancrlf.xml.sax
+new file mode 100644
+index 0000000..c3bbdc6
+--- /dev/null
++++ b/result/japancrlf.xml.sax
+@@ -0,0 +1,11 @@
++SAX.setDocumentLocator()
++SAX.startDocument()
++SAX.startElement(入力メッセージ, xmlns='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826')
++SAX.characters(
++ , 2)
++SAX.startElement(c8c:Ele, xmlns:c8c='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826')
++SAX.endElement(c8c:Ele)
++SAX.characters(
++, 1)
++SAX.endElement(入力メッセージ)
++SAX.endDocument()
+diff --git a/result/japancrlf.xml.sax2 b/result/japancrlf.xml.sax2
+new file mode 100644
+index 0000000..878eae4
+--- /dev/null
++++ b/result/japancrlf.xml.sax2
+@@ -0,0 +1,11 @@
++SAX.setDocumentLocator()
++SAX.startDocument()
++SAX.startElementNs(入力メッセージ, NULL, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 1, xmlns='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 0, 0)
++SAX.characters(
++ , 2)
++SAX.startElementNs(Ele, c8c, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 1, xmlns:c8c='http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826', 0, 0)
++SAX.endElementNs(Ele, c8c, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826')
++SAX.characters(
++, 1)
++SAX.endElementNs(入力メッセージ, NULL, 'http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826')
++SAX.endDocument()
+diff --git a/result/noent/japancrlf.xml b/result/noent/japancrlf.xml
+new file mode 100644
+index 0000000..60b307c
+--- /dev/null
++++ b/result/noent/japancrlf.xml
+@@ -0,0 +1,4 @@
++<?xml version="1.0"?>
++<入力メッセージ xmlns="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826">
++ <c8c:Ele xmlns:c8c="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826"/>
++</入力メッセージ>
+diff --git a/test/japancrlf.xml b/test/japancrlf.xml
+new file mode 100644
+index 0000000..480cb2d
+--- /dev/null
++++ b/test/japancrlf.xml
+@@ -0,0 +1,6 @@
++<入力メッセージ
++ xmlns="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826">
++ <c8c:Ele
++ xmlns:c8c="http://schemas.cordys.com/webapps/1.0/bpm/c8c8b82a-0ac0-3d19-01e2-bda74af9b826"
++ />
++</入力メッセージ>
+\ No newline at end of file
+--
+1.8.3.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-python-2.6.patch b/dev-libs/libxml2/files/libxml2-2.9.1-python-2.6.patch
new file mode 100644
index 00000000..c79709db
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-python-2.6.patch
@@ -0,0 +1,32 @@
+From 722923bc9b788f028e4221c77138fc66735a3113 Mon Sep 17 00:00:00 2001
+From: Petr Sumbera <petr.sumbera@oracle.com>
+Date: Fri, 3 May 2013 22:25:38 +0800
+Subject: [PATCH] Fix for compilation with python 2.6.8
+
+Remap PyCapsule to PyCObject based on the macro being available
+instead of using the python version
+---
+ python/libxml_wrap.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/python/libxml_wrap.h b/python/libxml_wrap.h
+index a9b9739..53a0618 100644
+--- a/python/libxml_wrap.h
++++ b/python/libxml_wrap.h
+@@ -34,11 +34,11 @@
+ #define PyBytes_AsString PyString_AsString
+ #define PyBytes_AS_STRING PyString_AS_STRING
+ #define PyBytes_GET_SIZE PyString_GET_SIZE
+-
++#endif
++#ifndef PyCapsule_New
+ #define PyCapsule_New PyCObject_FromVoidPtrAndDesc
+ #define PyCapsule_CheckExact PyCObject_Check
+ #define PyCapsule_GetPointer(o, n) PyCObject_GetDesc((o))
+-
+ #endif
+ #endif
+
+--
+1.8.3.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-python3.patch b/dev-libs/libxml2/files/libxml2-2.9.1-python3.patch
new file mode 100644
index 00000000..5c4e83da
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-python3.patch
@@ -0,0 +1,50 @@
+From 927faac6113b625a9a3423eef8f144fc7d9a8547 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Wed, 10 Jul 2013 23:00:54 -0400
+Subject: [PATCH] python: fix drv_libxml2.py for python3 compatibility
+
+https://bugzilla.gnome.org/show_bug.cgi?id=703979
+---
+ python/drv_libxml2.py | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/python/drv_libxml2.py b/python/drv_libxml2.py
+index e43fb1d..c9075e6 100644
+--- a/python/drv_libxml2.py
++++ b/python/drv_libxml2.py
+@@ -34,12 +34,20 @@ TODO
+
+ """
+
+-__author__ = u"Stphane Bidoul <sbi@skynet.be>"
++__author__ = "Stphane Bidoul <sbi@skynet.be>"
+ __version__ = "0.3"
+
++import sys
+ import codecs
+-from types import StringType, UnicodeType
+-StringTypes = (StringType,UnicodeType)
++
++if sys.version < "3":
++ __author__ = codecs.unicode_escape_decode(__author__)[0]
++
++ from types import StringType, UnicodeType
++ StringTypes = (StringType,UnicodeType)
++
++else:
++ StringTypes = (str)
+
+ from xml.sax._exceptions import *
+ from xml.sax import xmlreader, saxutils
+@@ -65,7 +73,7 @@ def _d(s):
+
+ try:
+ import libxml2
+-except ImportError, e:
++except ImportError as e:
+ raise SAXReaderNotAvailable("libxml2 not available: " \
+ "import error was: %s" % e)
+
+--
+1.8.3.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-python3a.patch b/dev-libs/libxml2/files/libxml2-2.9.1-python3a.patch
new file mode 100644
index 00000000..d07a1e28
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-python3a.patch
@@ -0,0 +1,55 @@
+From 6dd7775f3506741093890d99f09c242e0b34b55f Mon Sep 17 00:00:00 2001
+From: Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail..com>
+Date: Fri, 12 Jul 2013 11:18:11 +0800
+Subject: [PATCH] Another round of fixes for older versions of Python
+
+---
+ python/drv_libxml2.py | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/python/drv_libxml2.py b/python/drv_libxml2.py
+index c9075e6..c2ec3e2 100644
+--- a/python/drv_libxml2.py
++++ b/python/drv_libxml2.py
+@@ -40,14 +40,12 @@ __version__ = "0.3"
+ import sys
+ import codecs
+
+-if sys.version < "3":
++if sys.version_info[0] < 3:
+ __author__ = codecs.unicode_escape_decode(__author__)[0]
+
+- from types import StringType, UnicodeType
+- StringTypes = (StringType,UnicodeType)
+-
++ StringTypes = (str, unicode)
+ else:
+- StringTypes = (str)
++ StringTypes = str
+
+ from xml.sax._exceptions import *
+ from xml.sax import xmlreader, saxutils
+@@ -73,9 +71,9 @@ def _d(s):
+
+ try:
+ import libxml2
+-except ImportError as e:
++except ImportError:
+ raise SAXReaderNotAvailable("libxml2 not available: " \
+- "import error was: %s" % e)
++ "import error was: %s" % sys.exc_info()[1])
+
+ class Locator(xmlreader.Locator):
+ """SAX Locator adapter for libxml2.xmlTextReaderLocator"""
+@@ -142,7 +140,7 @@ class LibXml2Reader(xmlreader.XMLReader):
+ self.__parsing = 1
+ try:
+ # prepare source and create reader
+- if type(source) in StringTypes:
++ if isinstance(source, StringTypes):
+ reader = libxml2.newTextReaderFilename(source)
+ else:
+ source = saxutils.prepare_input_source(source)
+--
+1.8.3.2
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.1-xmllint-postvalid.patch b/dev-libs/libxml2/files/libxml2-2.9.1-xmllint-postvalid.patch
new file mode 100644
index 00000000..7ce2f3b9
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.1-xmllint-postvalid.patch
@@ -0,0 +1,32 @@
+From 7c3c663e4f844aaecbb0cfc29567fe2ee9506fc4 Mon Sep 17 00:00:00 2001
+From: Alexandre Rostovtsev <tetromino@gentoo.org>
+Date: Fri, 16 May 2014 22:46:00 -0400
+Subject: [PATCH] xmllint: a posteriori validation needs to load exernal
+ entities
+
+For https://bugzilla.gnome.org/show_bug.cgi?id=730290
+---
+ xmllint.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/xmllint.c b/xmllint.c
+index 9d46ac5..b142b3b 100644
+--- a/xmllint.c
++++ b/xmllint.c
+@@ -3530,7 +3530,12 @@ main(int argc, char **argv) {
+ xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
+ if (noent != 0) xmlSubstituteEntitiesDefault(1);
+ #ifdef LIBXML_VALID_ENABLED
+- if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
++ /* If we will validate only a posteriori, ensure that entities get loaded,
++ * but suppress validation messages during initial parsing */
++ if (postvalid != 0 && valid == 0)
++ options |= XML_PARSE_DTDVALID | XML_PARSE_NOERROR | XML_PARSE_NOWARNING;
++ else if (valid != 0)
++ xmlDoValidityCheckingDefaultValue = 1;
+ #endif /* LIBXML_VALID_ENABLED */
+ if ((htmlout) && (!nowrap)) {
+ xmlGenericError(xmlGenericErrorContext,
+--
+1.9.3
+
diff --git a/dev-libs/libxml2/files/libxml2-2.9.2-icu-pkgconfig.patch b/dev-libs/libxml2/files/libxml2-2.9.2-icu-pkgconfig.patch
new file mode 100644
index 00000000..7a84fac5
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.2-icu-pkgconfig.patch
@@ -0,0 +1,26 @@
+diff --git a/configure.in b/configure.in
+index 7374564..13c8d4e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1444,19 +1444,11 @@ XML_LIBTOOLLIBS="libxml2.la"
+ AC_SUBST(WITH_ICONV)
+
+ WITH_ICU=0
+-ICU_LIBS=""
+ if test "$with_icu" != "yes" ; then
+ echo Disabling ICU support
+ else
+- ICU_CONFIG=icu-config
+- if ${ICU_CONFIG} --cflags >/dev/null 2>&1
+- then
+- ICU_LIBS=`${ICU_CONFIG} --ldflags`
+- WITH_ICU=1
+- echo Enabling ICU support
+- else
+- AC_MSG_ERROR([libicu config program icu-config not found])
+- fi
++ PKG_CHECK_MODULES(ICU, icu-i18n)
++ WITH_ICU=1
+ fi
+ AC_SUBST(WITH_ICU)
+ AC_SUBST(ICU_LIBS)
diff --git a/dev-libs/libxml2/files/libxml2-2.9.2-revert-missing-initialization.patch b/dev-libs/libxml2/files/libxml2-2.9.2-revert-missing-initialization.patch
new file mode 100644
index 00000000..d98b3821
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.2-revert-missing-initialization.patch
@@ -0,0 +1,26 @@
+From f65128f38289d77ff322d63aef2858cc0a819c34 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Fri, 17 Oct 2014 17:13:41 +0800
+Subject: Revert "Missing initialization for the catalog module"
+
+This reverts commit 054c716ea1bf001544127a4ab4f4346d1b9947e7.
+As this break xmlcatalog command
+https://bugzilla.redhat.com/show_bug.cgi?id=1153753
+
+diff --git a/parser.c b/parser.c
+index 1d93967..67c9dfd 100644
+--- a/parser.c
++++ b/parser.c
+@@ -14830,9 +14830,6 @@ xmlInitParser(void) {
+ #ifdef LIBXML_XPATH_ENABLED
+ xmlXPathInit();
+ #endif
+-#ifdef LIBXML_CATALOG_ENABLED
+- xmlInitializeCatalog();
+-#endif
+ xmlParserInitialized = 1;
+ #ifdef LIBXML_THREAD_ENABLED
+ }
+--
+cgit v0.10.1
+
diff --git a/dev-libs/libxml2/libxml2-2.9.1-r999.ebuild b/dev-libs/libxml2/libxml2-2.9.1-r999.ebuild
new file mode 100644
index 00000000..fa345758
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.1-r999.ebuild
@@ -0,0 +1,214 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/libxml2-2.9.1-r4.ebuild,v 1.12 2014/06/24 19:59:48 vapier Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3,3_4} )
+PYTHON_REQ_USE="xml"
+
+inherit libtool flag-o-matic eutils python-r1 autotools prefix multilib-minimal
+
+DESCRIPTION="Version 2 of the library to manipulate XML files"
+HOMEPAGE="http://www.xmlsoft.org/"
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="debug examples icu ipv6 lzma python readline static-libs test"
+
+XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
+XSTS_NAME_1="xmlschema2002-01-16"
+XSTS_NAME_2="xmlschema2004-01-14"
+XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
+XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
+XMLCONF_TARBALL="xmlts20080827.tar.gz"
+
+SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+ test? (
+ ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+ ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+ http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
+
+COMMON_DEPEND=">=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
+ icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ readline? ( sys-libs/readline:= )
+"
+RDEPEND="${COMMON_DEPEND}
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r6
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )
+"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gtk-doc-am
+ virtual/pkgconfig
+ hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
+"
+
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+src_unpack() {
+ # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR,
+ # as they are needed as tarballs in ${S}/xstc instead and not unpacked
+ unpack ${P/_rc/-rc}.tar.gz
+ cd "${S}"
+
+ if use test; then
+ cp "${DISTDIR}/${XSTS_TARBALL_1}" \
+ "${DISTDIR}/${XSTS_TARBALL_2}" \
+ "${S}"/xstc/ \
+ || die "Failed to install test tarballs"
+ unpack ${XMLCONF_TARBALL}
+ fi
+}
+
+src_prepare() {
+ DOCS=( AUTHORS ChangeLog NEWS README* TODO* )
+
+ # Patches needed for prefix support
+ epatch "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+ epatch "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
+
+ eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+# epunt_cxx # if we don't eautoreconf
+
+ # Important patches from 2.9.2
+ epatch "${FILESDIR}/${P}-missing-break.patch" \
+ "${FILESDIR}/${P}-python-2.6.patch" \
+ "${FILESDIR}/${P}-compression-detection.patch" \
+ "${FILESDIR}/${P}-non-ascii-cr-lf.patch" \
+ "${FILESDIR}/${PN}-2.9.1-python3.patch" \
+ "${FILESDIR}/${PN}-2.9.1-python3a.patch"
+
+ # Security fixes from 2.9.2
+ epatch "${FILESDIR}/${P}-external-param-entities.patch"
+
+ # https://bugzilla.gnome.org/show_bug.cgi?id=730290
+ epatch "${FILESDIR}/${PN}-2.9.1-xmllint-postvalid.patch"
+
+ # Please do not remove, as else we get references to PORTAGE_TMPDIR
+ # in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
+ # We now need to run eautoreconf at the end to prevent maintainer mode.
+# elibtoolize
+
+ # Use pkgconfig to find icu to properly support multilib
+ epatch "${FILESDIR}/${PN}-2.9.1-icu-pkgconfig.patch"
+
+ epatch "${FILESDIR}/${PN}-2.9.0-remove-redundant-pthread-defs.patch"
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # filter seemingly problematic CFLAGS (#26320)
+ filter-flags -fprefetch-loop-arrays -funroll-loops
+
+ # USE zlib support breaks gnome2
+ # (libgnomeprint for instance fails to compile with
+ # fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
+
+ # The meaning of the 'debug' USE flag does not apply to the --with-debug
+ # switch (enabling the libxml2 debug module). See bug #100898.
+
+ # --with-mem-debug causes unusual segmentation faults (bug #105120).
+
+ libxml2_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-html-subdir=${PF}/html \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ $(use_with debug run-debug) \
+ $(use_with icu) \
+ $(use_with lzma) \
+ $(use_enable ipv6) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with readline) \
+ $(multilib_native_use_with readline history) \
+ "$@"
+ }
+
+ libxml2_py_configure() {
+ mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
+ run_in_build_dir libxml2_configure "--with-python=${PYTHON}" # odd build system
+ }
+
+ libxml2_configure --without-python # build python bindings separately
+
+ if multilib_is_native_abi && use python; then
+ python_parallel_foreach_impl libxml2_py_configure
+ fi
+}
+
+multilib_src_compile() {
+ default
+ if multilib_is_native_abi && use python; then
+ local native_builddir=${BUILD_DIR}
+ python_foreach_impl libxml2_py_emake top_builddir="${native_builddir}" all
+ fi
+}
+
+multilib_src_test() {
+ default
+ multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" \
+ EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install
+
+ if multilib_is_native_abi && use python; then
+ python_foreach_impl libxml2_py_emake DESTDIR="${D}" install
+ python_foreach_impl python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ # on windows, xmllint is installed by interix libxml2 in parent prefix.
+ # this is the version to use. the native winnt version does not support
+ # symlinks, which makes repoman fail if the portage tree is linked in
+ # from another location (which is my default). -- mduft
+ if [[ ${CHOST} == *-winnt* ]]; then
+ rm -rf "${ED}"/usr/bin/xmllint
+ rm -rf "${ED}"/usr/bin/xmlcatalog
+ fi
+
+ rm -rf "${ED}"/usr/share/doc/${P}
+ einstalldocs
+
+ if ! use python; then
+ rm -rf "${ED}"/usr/share/doc/${PF}/python
+ rm -rf "${ED}"/usr/share/doc/${PN}-python-${PV}
+ fi
+
+ if ! use examples; then
+ rm -rf "${ED}/usr/share/doc/${PF}/examples"
+ rm -rf "${ED}/usr/share/doc/${PF}/python/examples"
+ fi
+
+ prune_libtool_files --modules
+}
+
+pkg_postinst() {
+ # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not
+ # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887.
+ if [[ "${ROOT}" != "/" ]]; then
+ elog "Skipping XML catalog creation for stage building (bug #208887)."
+ else
+ # need an XML catalog, so no-one writes to a non-existent one
+ CATALOG="${EROOT}etc/xml/catalog"
+
+ # we dont want to clobber an existing catalog though,
+ # only ensure that one is there
+ # <obz@gentoo.org>
+ if [[ ! -e ${CATALOG} ]]; then
+ [[ -d "${EROOT}etc/xml" ]] || mkdir -p "${EROOT}etc/xml"
+ "${EPREFIX}"/usr/bin/xmlcatalog --create > "${CATALOG}"
+ einfo "Created XML catalog in ${CATALOG}"
+ fi
+ fi
+}
+
+libxml2_py_emake() {
+ pushd "${BUILD_DIR}/python" > /dev/null || die
+ emake "$@"
+ popd > /dev/null
+}
diff --git a/dev-libs/libxml2/libxml2-2.9.2-r99.ebuild b/dev-libs/libxml2/libxml2-2.9.2-r99.ebuild
new file mode 100644
index 00000000..99b89f08
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.2-r99.ebuild
@@ -0,0 +1,209 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libxml2/libxml2-2.9.2.ebuild,v 1.1 2014/10/18 08:23:48 pacho Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3,3_4} )
+PYTHON_REQ_USE="xml"
+
+inherit libtool flag-o-matic eutils python-r1 autotools prefix multilib-minimal
+
+DESCRIPTION="Version 2 of the library to manipulate XML files"
+HOMEPAGE="http://www.xmlsoft.org/"
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="debug examples icu ipv6 lzma python readline static-libs test"
+
+XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
+XSTS_NAME_1="xmlschema2002-01-16"
+XSTS_NAME_2="xmlschema2004-01-14"
+XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
+XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
+XMLCONF_TARBALL="xmlts20080827.tar.gz"
+
+SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+ test? (
+ ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+ ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+ http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
+
+COMMON_DEPEND="
+ >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
+ icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ readline? ( sys-libs/readline:= )
+"
+RDEPEND="${COMMON_DEPEND}
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r6
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )
+"
+DEPEND="${COMMON_DEPEND}
+ dev-util/gtk-doc-am
+ virtual/pkgconfig
+ hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
+"
+
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/xml2-config
+)
+
+src_unpack() {
+ # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR,
+ # as they are needed as tarballs in ${S}/xstc instead and not unpacked
+ unpack ${P/_rc/-rc}.tar.gz
+ cd "${S}"
+
+ if use test; then
+ cp "${DISTDIR}/${XSTS_TARBALL_1}" \
+ "${DISTDIR}/${XSTS_TARBALL_2}" \
+ "${S}"/xstc/ \
+ || die "Failed to install test tarballs"
+ unpack ${XMLCONF_TARBALL}
+ fi
+}
+
+src_prepare() {
+ DOCS=( AUTHORS ChangeLog NEWS README* TODO* )
+
+ # Patches needed for prefix support
+ epatch "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+ epatch "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
+
+ eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+# epunt_cxx # if we don't eautoreconf
+
+ # Important patches from master
+ epatch \
+ "${FILESDIR}/${PN}-2.9.2-revert-missing-initialization.patch"
+
+ # Please do not remove, as else we get references to PORTAGE_TMPDIR
+ # in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
+ # We now need to run eautoreconf at the end to prevent maintainer mode.
+# elibtoolize
+
+ # Use pkgconfig to find icu to properly support multilib, upstream bug #738751
+ epatch "${FILESDIR}/${PN}-2.9.2-icu-pkgconfig.patch"
+
+ epatch "${FILESDIR}/${PN}-2.9.0-remove-redundant-pthread-defs.patch"
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # filter seemingly problematic CFLAGS (#26320)
+ filter-flags -fprefetch-loop-arrays -funroll-loops
+
+ # USE zlib support breaks gnome2
+ # (libgnomeprint for instance fails to compile with
+ # fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
+
+ # The meaning of the 'debug' USE flag does not apply to the --with-debug
+ # switch (enabling the libxml2 debug module). See bug #100898.
+
+ # --with-mem-debug causes unusual segmentation faults (bug #105120).
+
+ libxml2_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-html-subdir=${PF}/html \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ $(use_with debug run-debug) \
+ $(use_with icu) \
+ $(use_with lzma) \
+ $(use_enable ipv6) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with readline) \
+ $(multilib_native_use_with readline history) \
+ "$@"
+ }
+
+ libxml2_py_configure() {
+ mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
+ run_in_build_dir libxml2_configure "--with-python=${PYTHON}" # odd build system
+ }
+
+ libxml2_configure --without-python # build python bindings separately
+
+ if multilib_is_native_abi && use python; then
+ python_parallel_foreach_impl libxml2_py_configure
+ fi
+}
+
+multilib_src_compile() {
+ default
+ if multilib_is_native_abi && use python; then
+ local native_builddir=${BUILD_DIR}
+ python_foreach_impl libxml2_py_emake top_builddir="${native_builddir}" all
+ fi
+}
+
+multilib_src_test() {
+ default
+ multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" \
+ EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install
+
+ if multilib_is_native_abi && use python; then
+ python_foreach_impl libxml2_py_emake DESTDIR="${D}" install
+ python_foreach_impl python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ # on windows, xmllint is installed by interix libxml2 in parent prefix.
+ # this is the version to use. the native winnt version does not support
+ # symlinks, which makes repoman fail if the portage tree is linked in
+ # from another location (which is my default). -- mduft
+ if [[ ${CHOST} == *-winnt* ]]; then
+ rm -rf "${ED}"/usr/bin/xmllint
+ rm -rf "${ED}"/usr/bin/xmlcatalog
+ fi
+
+ rm -rf "${ED}"/usr/share/doc/${P}
+ einstalldocs
+
+ if ! use python; then
+ rm -rf "${ED}"/usr/share/doc/${PF}/python
+ rm -rf "${ED}"/usr/share/doc/${PN}-python-${PV}
+ fi
+
+ if ! use examples; then
+ rm -rf "${ED}/usr/share/doc/${PF}/examples"
+ rm -rf "${ED}/usr/share/doc/${PF}/python/examples"
+ fi
+
+ prune_libtool_files --modules
+}
+
+pkg_postinst() {
+ # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not
+ # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887.
+ if [[ "${ROOT}" != "/" ]]; then
+ elog "Skipping XML catalog creation for stage building (bug #208887)."
+ else
+ # need an XML catalog, so no-one writes to a non-existent one
+ CATALOG="${EROOT}etc/xml/catalog"
+
+ # we dont want to clobber an existing catalog though,
+ # only ensure that one is there
+ # <obz@gentoo.org>
+ if [[ ! -e ${CATALOG} ]]; then
+ [[ -d "${EROOT}etc/xml" ]] || mkdir -p "${EROOT}etc/xml"
+ "${EPREFIX}"/usr/bin/xmlcatalog --create > "${CATALOG}"
+ einfo "Created XML catalog in ${CATALOG}"
+ fi
+ fi
+}
+
+libxml2_py_emake() {
+ pushd "${BUILD_DIR}/python" > /dev/null || die
+ emake "$@"
+ popd > /dev/null
+}
diff --git a/dev-libs/libxml2/metadata.xml b/dev-libs/libxml2/metadata.xml
new file mode 100644
index 00000000..1c0594f6
--- /dev/null
+++ b/dev-libs/libxml2/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>gnome</herd>
+<upstream>
+ <remote-id type="cpe">cpe:/a:xmlsoft:libxml2</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/dev-libs/nspr/Manifest b/dev-libs/nspr/Manifest
new file mode 100644
index 00000000..f91299b0
--- /dev/null
+++ b/dev-libs/nspr/Manifest
@@ -0,0 +1,14 @@
+AUX nspr-4.10.6-no-getprotobyname_r.patch 408 SHA256 56a69e868c4e0c4fd9aaaadda8a62537ec23d1881abb784b9c50def0ab247162 SHA512 a7c2389013f02a7e670f59b1a47ef0aaae8a3e5fd6eb264588d5f2cacf187295c1a456ef5ba851b6032be3d95c0047b6171f90f26612a4e201de2e68f494e349 WHIRLPOOL eb1baa09a281b77c5d8f4865550a0950b34a21d64c0050fea48e4da086cc1085c30a219644b454ffd3bcbc5482df006d29b95450aa48a530921f9420692b4378
+AUX nspr-4.10.6-solaris.patch 1023 SHA256 c9baea43015c0f8fe436b2fef044b542d5ea05ad795accd022a21dd6953298bf SHA512 f6bd055f0945cf21e333489c9ddb230cb568ad24dc11173a6aa5c09883ca83a2e40aa70ff48e846fc5f36e8b5dabda91d32bcc04495b4d6d78ff95223d2803fc WHIRLPOOL 7525fd90818bc98247e5afed56ad62eca9b4860f821cce97b50d7e97ef4a8a1a1ed320652aaa85fe191cb50d29399c96e72300a549590ec8ae192ead990c0657
+AUX nspr-4.7.0-prtime.patch 964 SHA256 3fd4f3c68257dced021c0bfa00245d0da2d6c64205135b1cc89f96a3375dffc7 SHA512 f8e09dda87e1d4a226fcf48ebc2cdfb20e67c351ffd227603b150636b19df49471ca0c617005e515ccee715df248363ed2e2162563ea6bce978e8607b6aba001 WHIRLPOOL 0090d17ebc287a39d18dbe531dc31522601ce4fc32ddd9a45bd9024987c328aa9fab7c7606673a1220c9b8602ee76c7f58bd7c4d3d639e8edb356d4d0efbd32e
+AUX nspr-4.7.1-solaris.patch 516 SHA256 e47a0abb5b106af38fdfab2ca8661b4a1596d48ff7ca988280728dc6b8a49447 SHA512 864b842e77353b29f7d0b44cdd64d1a0f613fafa2d074f10adc30a1f1c2b69c5270646c25faa64a7b072e3f7d0f68134fe23eeaafd7bdf46d12f889074a8ef78 WHIRLPOOL b2caa24d39bb372a184a60f1a775d6787b6d6aec65db5d32772de5c70953b4a53ab6244b569bd5c1da63f5a6e00a7a50da6bd7e807085e3f3483aa90810ffe64
+AUX nspr-4.8.4-darwin-install_name.patch 1102 SHA256 ca17efc9a60f4372b5da9c29ddf1143726381b9825907f8e3162974224636fab SHA512 1c62eaea00c4eebe6885bfffca41131cfd5cd1c848d7564ccae32a39f012834684b2d3113dcb1a3d4607629dbec9909d6754491dc7caa977203e6010623fef4d WHIRLPOOL 1f5674fe691d75dbf7b9549d58700fef973a8fd6f805a389727843ffb336392587833bbb19af9c22b1388b3d3dcd2c760978676c9a55d894b646e029f8ba7280
+AUX nspr-4.8.9-link-flags.patch 995 SHA256 f986c69ff6250f54eb291339ab5503e73cc5cc68af4c3c3ed5a25812bf47b610 SHA512 3c20019b5a378bc0cec1925c2324fc1b72bd1427e9262065952632c406bc6a8f9303fc55aabad472713f5e8656973db5c503dd9072ea01283a6f671dcd26b049 WHIRLPOOL 695310cfd54140b2c333f0b6556d8c049441b246a006cc885d2149a6d73d8d6223964d47d5af87c949ab2693fd320c4ecf67fd120b09862972a39df0cc00c7ca
+AUX nspr-4.9.5_nspr_config.patch 445 SHA256 7414eaac7630ba3aa9f3c44b439471abb195c96796f78cf5ddfd4e10c68389e8 SHA512 3d3dc60b4bb4a6b469e992239ca7e5702949880bbe3e603691bf7cab199a80e6b9fd89aa3184c26d99185b43785f6f2f7a9a16e061080e13ca02146dd2f172bf WHIRLPOOL d807bc98ca6f47d943f0b6f9a4d33dee387eddf9ae4a9d6a8863697d96c82ae1560d871b76c866b6a85b4eb1d31e9e9f1ce59caa4f66c02bd68a913f822d5a16
+DIST nspr-4.10.6.tar.gz 1131328 SHA256 df69ac8b0126f11907792384468adf42712b1d6db9772f4aa20c6d471594644a SHA512 a527a7123b4291903ac69899a82ea7e82a1945550b37f59199140a80d917540fb280172adeabf0fa09420debfd0d39c89c417166cd0a50e1eb6f1929a2a7460d WHIRLPOOL 6f7f422f50343f177896d9243a9ae89878823e92ffd3511131546a32b3cf481c9af34f5fef43c8a7c1d5974fc0959e1fa06ddd67133034563e06128e50a6f1f2
+DIST nspr-4.10.7.tar.gz 1131171 SHA256 389af5cfa863ea9bc6de7b30c15f8a4f9bddd8002f8c6fdc8b33caef43893938 SHA512 bc845b3983ed280dc691e81e08b94b34b8c175e18d455f9e1558a862045df29a3e5c7df291dff7caa0f9d4a9c7e5dd7eb316018f09b9ed444e91502d5a46013e WHIRLPOOL 7bdb1b0d52d2f14403cf93251ad7f6437d59532f50f5b41da9b3ec66f00f1875d624175301920b2f1a251fa27dd4953e15d4da20c131cd5b7b2d049606850869
+DIST nspr-4.10.8.tar.gz 1131130 SHA256 507ea57c525c0c524dae4857a642b4ef5c9d795518754c7f83422d22fe544a15 SHA512 f14e3bd46cd1dee9d7163adbf3b09a450ea8c6c65499c5b6696eba7e85b6b12d3f90561a1dfe0dc0dc5fe1b14758b4191e546d9f0e29a66f33c69dd6ed6f50d9 WHIRLPOOL 67be897d54e2446d563cfe505047b23880025bd3f1ea5492964f8d286f56776e41a8e63bd9d197d3115efae0d63bd0c7005fb9fc56abdfce0702c27e6a9e872c
+EBUILD nspr-4.10.6-r99.ebuild 3651 SHA256 1f472f6ac45e1a54ec19dc611a35c6137a1f90c6150bc550d6efd01672887aa3 SHA512 3f273242477cc73f8e9bd5383de4eacb1717ecc6fb426bcbd419588aba9a6eccbd5becca5eb0701e8b3102453942261ce62351d1ef9fae15f1e6e502c53785d4 WHIRLPOOL 9d02deca69c64093d1752bcd1c0cf4da33efd745c1cd5853d2d9899fb9a1b66936572dec9c2902beb5ffe5e941d1b2fc689a7c1cdeb8bff4abc3ffe36fff15f0
+EBUILD nspr-4.10.7-r99.ebuild 3833 SHA256 a65bb3ddb3f164155588a032e761364add95db58e233fe3b1e8a3791cda736a0 SHA512 8fc3989d9bdef095dcf6cc786f27351f38565597f3ec09a03e6ba88dfe2d9cfae015057ed683a51e5e730ab692f8d56024bb2957043ee649f93b44b8ca77c4b9 WHIRLPOOL cf25879b36ed141b13a48bfdce900b970ea8256c97db22e06b992ad1b137818014a74c9f2757fe10c082cb0add92c55704e4c35ca9b81d01bd883c0b6afae06f
+EBUILD nspr-4.10.8-r99.ebuild 3833 SHA256 a65bb3ddb3f164155588a032e761364add95db58e233fe3b1e8a3791cda736a0 SHA512 8fc3989d9bdef095dcf6cc786f27351f38565597f3ec09a03e6ba88dfe2d9cfae015057ed683a51e5e730ab692f8d56024bb2957043ee649f93b44b8ca77c4b9 WHIRLPOOL cf25879b36ed141b13a48bfdce900b970ea8256c97db22e06b992ad1b137818014a74c9f2757fe10c082cb0add92c55704e4c35ca9b81d01bd883c0b6afae06f
+MISC metadata.xml 160 SHA256 0cc5126362a12cee42ec1197c528a804cf36859329dd2c6d9225726831d14b8b SHA512 ed6f709d55351c1b69f2b43ada124fcc2f8969f8c3867073bb0c68aa502f16247cbcd78734a891e4d1a509d334f6805e5267d2088cd03f3408a636ad9aedc2bb WHIRLPOOL e6bf1791838158287debcc3160dd075dcdf88bc1b33060aefe4687b4451108e55b6f8021fc36f07ab85c4e37a4225444cc2804cf40bd61ba49726bbf12fa4e38
diff --git a/dev-libs/nspr/files/nspr-4.10.6-no-getprotobyname_r.patch b/dev-libs/nspr/files/nspr-4.10.6-no-getprotobyname_r.patch
new file mode 100644
index 00000000..40f38a58
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.10.6-no-getprotobyname_r.patch
@@ -0,0 +1,11 @@
+--- a/nspr-4.10.6/nspr/pr/src/misc/prnetdb.c 2014-06-05 23:42:08.000000000 -0200
++++ b/nspr-4.10.6/nspr/pr/src/misc/prnetdb.c 2014-07-29 19:02:42.037638550 -0200
+@@ -65,8 +65,6 @@
+ || (defined(LINUX) && defined(_REENTRANT) \
+ && !(defined(__GLIBC__) && __GLIBC__ >= 2) \
+ && !defined(ANDROID))
+-#define _PR_HAVE_GETPROTO_R
+-#define _PR_HAVE_GETPROTO_R_POINTER
+ #endif
+
+ #if defined(OSF1) \
diff --git a/dev-libs/nspr/files/nspr-4.10.6-solaris.patch b/dev-libs/nspr/files/nspr-4.10.6-solaris.patch
new file mode 100644
index 00000000..3ae8052e
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.10.6-solaris.patch
@@ -0,0 +1,32 @@
+* drop Solaris linker stuff
+
+--- nspr-4.7.4/mozilla/nsprpub/configure.in
++++ nspr-4.7.4/mozilla/nsprpub/configure.in
+@@ -1988,26 +1988,14 @@
+ CPU_ARCH=`uname -p`
+ MDCPUCFG_H=_solaris.cfg
+ PR_MD_CSRCS=solaris.c
+- LD=/usr/ccs/bin/ld
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+ RESOLVE_LINK_SYMBOLS=1
+- case "${OS_RELEASE}" in
+- 5.8|5.9)
+- ;;
+- *)
+- # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
+- USE_B_DIRECT=1
+- ;;
+- esac
+ if test -n "$GNU_CC"; then
+ DSO_CFLAGS=-fPIC
+ if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
+ GCC_USE_GNU_LD=1
+ fi
+- DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
+- if test -n "$USE_B_DIRECT"; then
+- DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
+- fi
++ DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
+ else
+ DSO_CFLAGS=-KPIC
+ DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
diff --git a/dev-libs/nspr/files/nspr-4.7.0-prtime.patch b/dev-libs/nspr/files/nspr-4.7.0-prtime.patch
new file mode 100644
index 00000000..ac509ef2
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.7.0-prtime.patch
@@ -0,0 +1,26 @@
+--- mozilla/nsprpub/pr/src/misc/prtime.c.orig 2007-09-14 19:41:08.000000000 +0200
++++ mozilla/nsprpub/pr/src/misc/prtime.c 2007-09-14 19:42:17.000000000 +0200
+@@ -1536,7 +1536,7 @@
+ case TT_EET: zone_offset = 2 * 60; break;
+ case TT_JST: zone_offset = 9 * 60; break;
+ default:
+- PR_ASSERT (0);
++ return PR_FAILURE;
+ break;
+ }
+ }
+@@ -1578,11 +1578,12 @@
+ struct tm localTime;
+ time_t secs;
+
+- PR_ASSERT(result->tm_month > -1 &&
++ if (!(result->tm_month > -1 &&
+ result->tm_mday > 0 &&
+ result->tm_hour > -1 &&
+ result->tm_min > -1 &&
+- result->tm_sec > -1);
++ result->tm_sec > -1))
++ return PR_FAILURE;
+
+ /*
+ * To obtain time_t from a tm structure representing the local
diff --git a/dev-libs/nspr/files/nspr-4.7.1-solaris.patch b/dev-libs/nspr/files/nspr-4.7.1-solaris.patch
new file mode 100644
index 00000000..5d9e810a
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.7.1-solaris.patch
@@ -0,0 +1,14 @@
+Same magic as haubi did for glib compilation, which works again here
+resolving a linker problem on Solaris with GNU ld. Bug #222625
+
+--- mozilla/nsprpub/pr/src/Makefile.in.orig 2008-06-22 22:24:56.671065000 +0200
++++ mozilla/nsprpub/pr/src/Makefile.in 2008-06-23 14:38:52.320417000 +0200
+@@ -95,7 +95,7 @@
+ endif
+
+ ifdef USE_PTHREADS
+-OS_LIBS = -lpthread ${LIBRT} -lsocket -lnsl -ldl -lc
++OS_LIBS = -pthread ${LIBRT} -lsocket -lnsl -ldl -lc
+ else
+ ifdef LOCAL_THREADS_ONLY
+ OS_LIBS = -lsocket -lnsl -ldl -lc
diff --git a/dev-libs/nspr/files/nspr-4.8.4-darwin-install_name.patch b/dev-libs/nspr/files/nspr-4.8.4-darwin-install_name.patch
new file mode 100644
index 00000000..1258b608
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.8.4-darwin-install_name.patch
@@ -0,0 +1,25 @@
+Don't use @executable_path, it messed up linking against nspr from e.g.
+nss.
+
+--- mozilla/nsprpub/configure.in
++++ mozilla/nsprpub/configure.in
+@@ -1007,7 +1007,7 @@
+ ;;
+ esac
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
++ DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name $(libdir)/$@ -headerpad_max_install_names'
+ _OPTIMIZE_FLAGS=-O2
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+ STRIP="$STRIP -x -S"
+--- mozilla/nsprpub/configure
++++ mozilla/nsprpub/configure
+@@ -1007,7 +1007,7 @@
+ ;;
+ esac
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
++ DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name $(libdir)/$@ -headerpad_max_install_names'
+ _OPTIMIZE_FLAGS=-O2
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+ STRIP="$STRIP -x -S"
diff --git a/dev-libs/nspr/files/nspr-4.8.9-link-flags.patch b/dev-libs/nspr/files/nspr-4.8.9-link-flags.patch
new file mode 100644
index 00000000..dd3b132c
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.8.9-link-flags.patch
@@ -0,0 +1,28 @@
+Use CFLAGS when linking. Some flags can add functionality to generated
+code that requires extra libs to be linked in (eg. libgomp when using
+autoparallelization). Other flags are required when building and linking
+(eg. -flto).
+
+https://bugs.gentoo.org/365975
+
+--- a/mozilla/nsprpub/config/autoconf.mk.in
++++ b/mozilla/nsprpub/config/autoconf.mk.in
+@@ -81,6 +81,7 @@ OS_DLLFLAGS = @OS_DLLFLAGS@
+ DLLFLAGS = @DLLFLAGS@
+ EXEFLAGS = @EXEFLAGS@
+ OPTIMIZER = @OPTIMIZER@
++LD_CFLAGS = @CFLAGS@
+
+ PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
+ PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
+--- a/mozilla/nsprpub/config/config.mk
++++ b/mozilla/nsprpub/config/config.mk
+@@ -72,7 +72,7 @@ NOMD_CFLAGS = $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
+ NOMD_CCFLAGS = $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
+ $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
+
+-LDFLAGS = $(OS_LDFLAGS)
++LDFLAGS = $(LD_CFLAGS) $(OS_LDFLAGS)
+
+ # Enable profile-guided optimization
+ ifdef MOZ_PROFILE_GENERATE
diff --git a/dev-libs/nspr/files/nspr-4.9.5_nspr_config.patch b/dev-libs/nspr/files/nspr-4.9.5_nspr_config.patch
new file mode 100644
index 00000000..d4f9a7e5
--- /dev/null
+++ b/dev-libs/nspr/files/nspr-4.9.5_nspr_config.patch
@@ -0,0 +1,12 @@
+diff -urN a/mozilla/nsprpub/config/nspr-config.in b/mozilla/nsprpub/config/nspr-config.in
+--- a/mozilla/nsprpub/config/nspr-config.in 2012-03-06 07:13:39.000000000 -0600
++++ b/mozilla/nsprpub/config/nspr-config.in 2013-02-16 20:53:53.893489345 -0600
+@@ -126,7 +126,7 @@
+ fi
+
+ if test "$echo_libs" = "yes"; then
+- libdirs=-L$libdir
++ libdirs=""
+ if test -n "$lib_plds"; then
+ libdirs="$libdirs -lplds${major_version}"
+ fi
diff --git a/dev-libs/nspr/metadata.xml b/dev-libs/nspr/metadata.xml
new file mode 100644
index 00000000..74d92579
--- /dev/null
+++ b/dev-libs/nspr/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>mozilla</herd>
+</pkgmetadata>
diff --git a/dev-libs/nspr/nspr-4.10.6-r99.ebuild b/dev-libs/nspr/nspr-4.10.6-r99.ebuild
new file mode 100644
index 00000000..1f485a3a
--- /dev/null
+++ b/dev-libs/nspr/nspr-4.10.6-r99.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.10.6-r1.ebuild,v 1.4 2014/06/19 03:15:41 tetromino Exp $
+
+EAPI=5
+WANT_AUTOCONF="2.5"
+
+inherit autotools eutils multilib toolchain-funcs versionator multilib-minimal
+
+MIN_PV="$(get_version_component_range 2)"
+
+DESCRIPTION="Netscape Portable Runtime"
+HOMEPAGE="http://www.mozilla.org/projects/nspr/"
+SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/${P}.tar.gz"
+
+LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ~ppc ~x86"
+IUSE="debug"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r12
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/nspr-config
+)
+
+src_prepare() {
+ cd "${S}"/nspr || die
+ epatch "${FILESDIR}"/${PN}-4.7.0-prtime.patch
+ epatch "${FILESDIR}"/${PN}-4.7.1-solaris.patch
+ epatch "${FILESDIR}"/${PN}-4.10.6-solaris.patch
+ epatch "${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch
+ epatch "${FILESDIR}"/${PN}-4.8.9-link-flags.patch
+ # We do not need to pass -L$libdir via nspr-config --libs
+ epatch "${FILESDIR}"/${PN}-4.9.5_nspr_config.patch
+
+ epatch "${FILESDIR}"/${PN}-4.10.6-no-getprotobyname_r.patch
+
+ # We must run eautoconf to regenerate configure
+ eautoconf
+
+ # make sure it won't find Perl out of Prefix
+ sed -i -e "s/perl5//g" "${S}"/nspr/configure || die
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
+ "${S}"/nspr/config/rules.mk || die
+}
+
+multilib_src_configure() {
+ # We use the standard BUILD_xxx but nspr uses HOST_xxx
+ tc-export_build_env BUILD_CC
+ export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS}
+ tc-export AR CC CXX RANLIB
+ [[ ${CBUILD} != ${CHOST} ]] \
+ && export CROSS_COMPILE=1 \
+ || unset CROSS_COMPILE
+
+ local myconf=()
+
+ # The configure has some fancy --enable-{{n,x}32,64bit} switches
+ # that trigger some code conditional to platform & arch. This really
+ # matters for the few common arches (x86, ppc) but we pass a little
+ # more of them to be future-proof.
+
+ # use ABI first, this will work for most cases
+ case "${ABI}" in
+ alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86) ;;
+ n32) myconf+=( --enable-n32 );;
+ x32) myconf+=( --enable-x32 );;
+ s390x|*64) myconf+=( --enable-64bit );;
+ default) # no abi actually set, fall back to old check
+ einfo "Running a short build test to determine 64bit'ness"
+ echo > "${T}"/test.c || die
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die
+ case $(file "${T}"/test.o) in
+ *32-bit*x86-64*) myconf+=( --enable-x32 );;
+ *64-bit*|*ppc64*|*x86_64*) myconf+=( --enable-64bit );;
+ *32-bit*|*ppc*|*i386*) ;;
+ *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
+ esac ;;
+ *) ;;
+ esac
+
+ # Ancient autoconf needs help finding the right tools.
+ LC_ALL="C" ECONF_SOURCE="${S}/nspr" \
+ ac_cv_path_AR="${AR}" \
+ econf \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ $(use_enable debug) \
+ $(use_enable !debug optimize) \
+ "${myconf[@]}"
+}
+
+multilib_src_install() {
+ # Their build system is royally confusing, as usual
+ MINOR_VERSION=${MIN_PV} # Used for .so version
+ emake DESTDIR="${D}" install
+
+ einfo "removing static libraries as upstream has requested!"
+ rm -f "${ED}"/usr/$(get_libdir)/*.a || die "failed to remove static libraries."
+
+ # install nspr-config
+ dobin config/nspr-config
+
+ # Remove stupid files in /usr/bin
+ rm "${ED}"/usr/bin/prerr.properties || die "failed to cleanup unneeded files"
+}
diff --git a/dev-libs/nspr/nspr-4.10.7-r99.ebuild b/dev-libs/nspr/nspr-4.10.7-r99.ebuild
new file mode 100644
index 00000000..ed0bb52c
--- /dev/null
+++ b/dev-libs/nspr/nspr-4.10.7-r99.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.10.7-r1.ebuild,v 1.3 2014/12/10 19:34:49 ago Exp $
+
+EAPI=5
+WANT_AUTOCONF="2.5"
+
+inherit autotools eutils multilib toolchain-funcs versionator multilib-minimal
+
+MIN_PV="$(get_version_component_range 2)"
+
+DESCRIPTION="Netscape Portable Runtime"
+HOMEPAGE="http://www.mozilla.org/projects/nspr/"
+SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/${P}.tar.gz"
+
+LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="debug"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r12
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/nspr-config
+)
+
+src_prepare() {
+ cd "${S}"/nspr || die
+ epatch "${FILESDIR}"/${PN}-4.7.0-prtime.patch
+ epatch "${FILESDIR}"/${PN}-4.7.1-solaris.patch
+ epatch "${FILESDIR}"/${PN}-4.10.6-solaris.patch
+ epatch "${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch
+ epatch "${FILESDIR}"/${PN}-4.8.9-link-flags.patch
+ # We do not need to pass -L$libdir via nspr-config --libs
+ epatch "${FILESDIR}"/${PN}-4.9.5_nspr_config.patch
+
+ epatch "${FILESDIR}"/${PN}-4.10.6-no-getprotobyname_r.patch
+
+ # We must run eautoconf to regenerate configure
+ eautoconf
+
+ # make sure it won't find Perl out of Prefix
+ sed -i -e "s/perl5//g" "${S}"/nspr/configure || die
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
+ "${S}"/nspr/config/rules.mk || die
+}
+
+multilib_src_configure() {
+ # We use the standard BUILD_xxx but nspr uses HOST_xxx
+ tc-export_build_env BUILD_CC
+ export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS}
+ tc-export AR CC CXX RANLIB
+ [[ ${CBUILD} != ${CHOST} ]] \
+ && export CROSS_COMPILE=1 \
+ || unset CROSS_COMPILE
+
+ local myconf=()
+
+ # The configure has some fancy --enable-{{n,x}32,64bit} switches
+ # that trigger some code conditional to platform & arch. This really
+ # matters for the few common arches (x86, ppc) but we pass a little
+ # more of them to be future-proof.
+
+ # use ABI first, this will work for most cases
+ case "${ABI}" in
+ alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86) ;;
+ n32) myconf+=( --enable-n32 );;
+ x32) myconf+=( --enable-x32 );;
+ s390x|*64) myconf+=( --enable-64bit );;
+ default) # no abi actually set, fall back to old check
+ einfo "Running a short build test to determine 64bit'ness"
+ echo > "${T}"/test.c || die
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die
+ case $(file "${T}"/test.o) in
+ *32-bit*x86-64*) myconf+=( --enable-x32 );;
+ *64-bit*|*ppc64*|*x86_64*) myconf+=( --enable-64bit );;
+ *32-bit*|*ppc*|*i386*) ;;
+ *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
+ esac ;;
+ *) ;;
+ esac
+
+ # Ancient autoconf needs help finding the right tools.
+ LC_ALL="C" ECONF_SOURCE="${S}/nspr" \
+ ac_cv_path_AR="${AR}" \
+ econf \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ $(use_enable debug) \
+ $(use_enable !debug optimize) \
+ "${myconf[@]}"
+}
+
+multilib_src_install() {
+ # Their build system is royally confusing, as usual
+ MINOR_VERSION=${MIN_PV} # Used for .so version
+ emake DESTDIR="${D}" install
+
+ einfo "removing static libraries as upstream has requested!"
+ rm -f "${ED}"/usr/$(get_libdir)/*.a || die "failed to remove static libraries."
+
+ # install nspr-config
+ dobin config/nspr-config
+
+ # Remove stupid files in /usr/bin
+ rm "${ED}"/usr/bin/prerr.properties || die
+
+ # This is used only to generate prerr.c and prerr.h at build time.
+ # No other projects use it, and we don't want to depend on perl.
+ # Talked to upstream and they agreed w/punting.
+ rm "${ED}"/usr/bin/compile-et.pl || die
+}
diff --git a/dev-libs/nspr/nspr-4.10.8-r99.ebuild b/dev-libs/nspr/nspr-4.10.8-r99.ebuild
new file mode 100644
index 00000000..ed0bb52c
--- /dev/null
+++ b/dev-libs/nspr/nspr-4.10.8-r99.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/nspr/nspr-4.10.7-r1.ebuild,v 1.3 2014/12/10 19:34:49 ago Exp $
+
+EAPI=5
+WANT_AUTOCONF="2.5"
+
+inherit autotools eutils multilib toolchain-funcs versionator multilib-minimal
+
+MIN_PV="$(get_version_component_range 2)"
+
+DESCRIPTION="Netscape Portable Runtime"
+HOMEPAGE="http://www.mozilla.org/projects/nspr/"
+SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/${P}.tar.gz"
+
+LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="debug"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r12
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/nspr-config
+)
+
+src_prepare() {
+ cd "${S}"/nspr || die
+ epatch "${FILESDIR}"/${PN}-4.7.0-prtime.patch
+ epatch "${FILESDIR}"/${PN}-4.7.1-solaris.patch
+ epatch "${FILESDIR}"/${PN}-4.10.6-solaris.patch
+ epatch "${FILESDIR}"/${PN}-4.8.4-darwin-install_name.patch
+ epatch "${FILESDIR}"/${PN}-4.8.9-link-flags.patch
+ # We do not need to pass -L$libdir via nspr-config --libs
+ epatch "${FILESDIR}"/${PN}-4.9.5_nspr_config.patch
+
+ epatch "${FILESDIR}"/${PN}-4.10.6-no-getprotobyname_r.patch
+
+ # We must run eautoconf to regenerate configure
+ eautoconf
+
+ # make sure it won't find Perl out of Prefix
+ sed -i -e "s/perl5//g" "${S}"/nspr/configure || die
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(MKSHLIB) \$(OBJS)/\$(MKSHLIB) \$(LDFLAGS) \$(OBJS)/g' \
+ "${S}"/nspr/config/rules.mk || die
+}
+
+multilib_src_configure() {
+ # We use the standard BUILD_xxx but nspr uses HOST_xxx
+ tc-export_build_env BUILD_CC
+ export HOST_CC=${BUILD_CC} HOST_CFLAGS=${BUILD_CFLAGS} HOST_LDFLAGS=${BUILD_LDFLAGS}
+ tc-export AR CC CXX RANLIB
+ [[ ${CBUILD} != ${CHOST} ]] \
+ && export CROSS_COMPILE=1 \
+ || unset CROSS_COMPILE
+
+ local myconf=()
+
+ # The configure has some fancy --enable-{{n,x}32,64bit} switches
+ # that trigger some code conditional to platform & arch. This really
+ # matters for the few common arches (x86, ppc) but we pass a little
+ # more of them to be future-proof.
+
+ # use ABI first, this will work for most cases
+ case "${ABI}" in
+ alpha|arm|hppa|m68k|o32|ppc|s390|sh|sparc|x86) ;;
+ n32) myconf+=( --enable-n32 );;
+ x32) myconf+=( --enable-x32 );;
+ s390x|*64) myconf+=( --enable-64bit );;
+ default) # no abi actually set, fall back to old check
+ einfo "Running a short build test to determine 64bit'ness"
+ echo > "${T}"/test.c || die
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die
+ case $(file "${T}"/test.o) in
+ *32-bit*x86-64*) myconf+=( --enable-x32 );;
+ *64-bit*|*ppc64*|*x86_64*) myconf+=( --enable-64bit );;
+ *32-bit*|*ppc*|*i386*) ;;
+ *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
+ esac ;;
+ *) ;;
+ esac
+
+ # Ancient autoconf needs help finding the right tools.
+ LC_ALL="C" ECONF_SOURCE="${S}/nspr" \
+ ac_cv_path_AR="${AR}" \
+ econf \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ $(use_enable debug) \
+ $(use_enable !debug optimize) \
+ "${myconf[@]}"
+}
+
+multilib_src_install() {
+ # Their build system is royally confusing, as usual
+ MINOR_VERSION=${MIN_PV} # Used for .so version
+ emake DESTDIR="${D}" install
+
+ einfo "removing static libraries as upstream has requested!"
+ rm -f "${ED}"/usr/$(get_libdir)/*.a || die "failed to remove static libraries."
+
+ # install nspr-config
+ dobin config/nspr-config
+
+ # Remove stupid files in /usr/bin
+ rm "${ED}"/usr/bin/prerr.properties || die
+
+ # This is used only to generate prerr.c and prerr.h at build time.
+ # No other projects use it, and we don't want to depend on perl.
+ # Talked to upstream and they agreed w/punting.
+ rm "${ED}"/usr/bin/compile-et.pl || die
+}
diff --git a/dev-libs/nss/Manifest b/dev-libs/nss/Manifest
new file mode 100644
index 00000000..5816e33e
--- /dev/null
+++ b/dev-libs/nss/Manifest
@@ -0,0 +1,14 @@
+AUX nss-3.14.2-solaris-gcc.patch 659 SHA256 d6ac2638602fcf5d73020efb616c2c16d5775d3a75122cc1681c944ddcd0a07f SHA512 5703fa0d6cd793f9622c331983499ce35f696b71589cac347e2a72d4d377ab53d97f79d9b1396bf1f255a933067ebe2f0e4fb6fca9cc5f3c179275d42a6be9f8 WHIRLPOOL b5f49f0a860598cf508ce7ea97165840ab5c068a00f213591d41101c12ec1e5afbffdbad7c3a1d69ef52c34f4d00da0d1aef4a80829f21209c60908e21a2663a
+AUX nss-3.15-gentoo-fixup-warnings.patch 177 SHA256 3bb300d8448f769beb97b110a0fe764160c866368f630e790c8599c1d75d70bb SHA512 2d79c0203c46ec52195983d4378bb0f13348cc32b5c6b83140b6ac91d644073f5d42785a23476b07cd1f058309d8616aef9faae7c59b2f3e1b843abbaacacdc4 WHIRLPOOL 96565a7ba9f40b010f1825722aa2a5990daf7cfee09cbad1e4cb022c8aaf664ba26cfbb923b7bbe41b99bc3fcc6d03f8b265f8fd922c02dc3bbc450d3fadfcba
+AUX nss-3.15-gentoo-fixups.patch 5255 SHA256 eba46da3424640a0f16c7b07e526c373f3739dbfe6fb1e5a2af4d7b7fb83e4e2 SHA512 a1968a1e77a34a9ec4718b48435190c698cb960fb138a23a2f136b08ca50e221b2d5a729d69210eafcc7aafe12f3e02b329c7a878c1e9e308c3e737c2e7a1b71 WHIRLPOOL 54ff1716c8b016d38b83aa82c8473bea468710ed72d237ca0ea1d6201c39e141b7f32938c8a9f870c4693421f42751ce6f6c4bafd1d80a53e3bd17170ccf5f7a
+AUX nss-3.15.4-enable-pem.patch 243 SHA256 eec796bbc845b123f97bcf1f351495ec1645a2d015e6f6bcdb1e088d02f5d1e6 SHA512 b8f942ced3ff6cea1d54934e0e68ad589585f3fd42934046d0b57563fd4e24b50ad550db391346768abdd9848c3457a532fe3b7495862454f9a52a4603e92f9c WHIRLPOOL 0cd2428516e8a63d64c20b94153f079c4cefd96c05155fa27ecb4cba68419e5efebd32d6ab4820b072fea173e66b5816d8cc238f2a328616f5b7752c60e3998e
+AUX nss-3.16-musl.patch 352 SHA256 8e04dbf5088adaf121379350f58510b52a594c9a3725cd62fd4282c0069dac76 SHA512 4a8d53c5ff847bb32b0e0c79d072fe45525110773e1e36299ac5ba0d0a046e73360681208f0b64c0a36a9ec3da8a2776ca659b8a5446fe0abf17cd7da131d594 WHIRLPOOL 5e9bb130b9aa7c1fb939e1953a6a5aa38fec2cd80953e33efd2333e7e242dc7a7a575309fa3b3e067d97acb0eca41bb954beb5cab1fba1b1d1d23c576fbaea1b
+AUX nss-3.17.1-gentoo-fixups.patch 5415 SHA256 b28efbafe7be3adec9fba08fa79e28052982ae8ec8ffd8d0850be22ff1def134 SHA512 f3e64aee5b5c3c3135caa414baa76bded87737c807e69525b2214b8b44e53cf9a837275b39892ef8ecfe05ff26fd06f199c2e8b192479716ae2e80ff34b52f10 WHIRLPOOL 3c9bf7c872a72955a6e83901f3a20febcba80e14a924fc83e4845882225027bdb17263bc9824f87535937dab48c2d49bbc44e114dd13b8c32d4bd222dc5fa6fd
+DIST nss-3.14.1-add_spi+cacerts_ca_certs.patch 25018 SHA256 82ca25982828fd7153ad15fc6e81408c115476eeeb4045d3a71469380b56824b SHA512 2aafbd972b073061bfd66a66a4b50060691957f2910f716f7a69d22d655c499f186f05db2101bea5248a00949f339327ba8bfffec024c61c8ee908766201ae00 WHIRLPOOL c9fe397e316dac7983b187acf7227078ebd8f8da5df53f77f2564489e85f123c4d2afb88d56e8dc14b9ebfffe8a71ade4724b3c1ea683c5c4c487cb3a64eda43
+DIST nss-3.16.tar.gz 6378110 SHA256 2bb4faa200962caacf0454f1e870e74aa9a543809e5c440f7978bcce58e0bfe8 SHA512 e3dcde8213f7f131fe2f714ff2f45c6d7b9b2167e51dbf0e1a750cc4f83d9fa35e69408850de6600f55fbc9e26b29dc344548cb64849d6e3252476eadd7ee57f WHIRLPOOL d30b53ec36cacff9756b43780d904e32760cd5d0b75f1888b6fb80e0a87ce828f4e6189de63880ddce90bdf5d90123ff7e9fdf600f4df02ce59702898f08c11e
+DIST nss-3.17.4.tar.gz 6924699 SHA256 1d98ad1881a4237ec98cbe472fc851480f0b0e954dfe224d047811fb96ff9d79 SHA512 dfc44e28c303743a72b4553f471089bc991c3cb61d5f3071082c16400d5e4f216f84a2e44536570316fe0e798c14ca370c875dad791a873034595b9e4dd70b89 WHIRLPOOL bb6e1027c5237d12fe58b4c520536022d8d4e83183a78c3421fd46bf9c3503b1f0ca4644240e383f216ec1e5174c0ae4148372db68fb9f1c10275954559d5bbf
+DIST nss-pem-015ae754dd9f6fbcd7e52030ec9732eb27fc06a8.tar.bz2 27506 SHA256 50d9ec26a75835e900302f631456e278e13d4b435b8f98aa69f79dd439ddc6ab SHA512 0158a140f112a905f7db5a4f4d04f49f6742db1d2665ddf6c32913c367f0b93a57f86ba13b9883a42a528aff44c48196941d7c0fd7a27005db6adaf07802e501 WHIRLPOOL 279ef11d2d6f0cb7c192189d64bc6971cdada7417b93a65a3ff0ba4548b736b53b9812803024c2349114e94e0864f2b58c23812687ed3f75cf28334b0f6e11ac
+DIST nss-pem-3ade37c5c4ca5a6094e3f4b2e4591405db1867dd.tar.bz2 28849 SHA256 0388cb01d6158fad92b6ee13241531c7dba66a4be64e85160ded212c3febadc4 SHA512 6994bd7435ad0cff9f5aed509c5f7ea438a6829188bea94d57020e8df6d75631b289363b6f68c3c96da67c958af967c624147d3604b734d8f0b57688f74e7c95 WHIRLPOOL a168e137981f4bc4cc6735bcc234b3fe14ea0cc91768926cdaae3f124ba1dfcd06be029c3805ded20df600c8655bb2d97beb69a0c6b7f2441e7ee4c651cd7868
+EBUILD nss-3.16-r99.ebuild 7627 SHA256 c0418d057c241578340af4ff8f5b0258767a1af28f2361b092da74ccb7bde6b7 SHA512 1b1088b3c1cb60132c8e8299bf731cf57f9d396d14dbd936e66135440058c207ee9024de50fe14d913c6a322e3114c8cc0549804225a70a950f815bd1853158e WHIRLPOOL aed12b2a5bd0a9659df07ae4b3ba9b12b30c126829a4f18d4eb742c40f76d53751cf21a6ef90ebc8428dcd7529e7f9f671346bd17cbf4b0ca6e730a65dd84c08
+EBUILD nss-3.17.4-r99.ebuild 9064 SHA256 1b981c03c85a47231f4542ced6356995458a36949b1c04eeb9143010d3625f31 SHA512 ccd1cc9a70b27435e4403786d1734a2d14c9512bfda2611d359e6b960c8b44c38ebcbaaea17856e9c995b55e138099961ecdb41595877a83069a48e7bff5941d WHIRLPOOL accf33d921a4f875534ca093c499b20f41429b76d5af3a4fe50d975e6082e100247048080386ebc6d48a42f2b40bda75bd1a89bc9f41b4a2836b33ce80cb768c
+MISC metadata.xml 545 SHA256 d3a7dfb4b9f063b343b42b3002d3722ee44aea8a47154fa2158533aa94a5a258 SHA512 4da88948d5b637093646300bab0105c642968b2c9693939be6b75b5d24f02bd9b2cc5f13ae18594b9b00fa8dfe02e5d6959c13021124cd027007649787aec750 WHIRLPOOL 0879625ef92b2db563e5a1b434176bab08846e815fbf0c963a23b3ca228b3525dc80f6e7940a303fc1dd47403416c67811ed09d00f29a431abc4979865b67ff9
diff --git a/dev-libs/nss/files/nss-3.14.2-solaris-gcc.patch b/dev-libs/nss/files/nss-3.14.2-solaris-gcc.patch
new file mode 100644
index 00000000..a23725da
--- /dev/null
+++ b/dev-libs/nss/files/nss-3.14.2-solaris-gcc.patch
@@ -0,0 +1,24 @@
+--- nss-3.14.2/mozilla/security/coreconf/SunOS5.mk
++++ nss-3.14.2/mozilla/security/coreconf/SunOS5.mk
+@@ -5,6 +5,9 @@
+
+ include $(CORE_DEPTH)/coreconf/UNIX.mk
+
++NS_USE_GCC = 1
++GCC_USE_GNU_LD = 1
++
+ # Sun's WorkShop defines v8, v8plus and v9 architectures.
+ # gcc on Solaris defines v8 and v9 "cpus".
+ # gcc's v9 is equivalent to Workshop's v8plus.
+@@ -71,11 +74,6 @@
+ NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
+
+ MKSHLIB = $(CC) $(DSO_LDOPTS) $(RPATH)
+-ifdef NS_USE_GCC
+-ifeq (GNU,$(findstring GNU,$(shell `$(CC) -print-prog-name=ld` -v 2>&1)))
+- GCC_USE_GNU_LD = 1
+-endif
+-endif
+ ifdef MAPFILE
+ ifdef NS_USE_GCC
+ ifdef GCC_USE_GNU_LD
diff --git a/dev-libs/nss/files/nss-3.15-gentoo-fixup-warnings.patch b/dev-libs/nss/files/nss-3.15-gentoo-fixup-warnings.patch
new file mode 100644
index 00000000..3ce2c0e4
--- /dev/null
+++ b/dev-libs/nss/files/nss-3.15-gentoo-fixup-warnings.patch
@@ -0,0 +1,10 @@
+--- nss-3.15/nss/coreconf/Linux.mk
++++ nss-3.15/nss/coreconf/Linux.mk
+@@ -116,6 +116,7 @@
+ OPTIMIZER += -gdwarf-2
+ endif
+ endif
++OPTIMIZER += -fno-strict-aliasing
+ endif
+
+
diff --git a/dev-libs/nss/files/nss-3.15-gentoo-fixups.patch b/dev-libs/nss/files/nss-3.15-gentoo-fixups.patch
new file mode 100644
index 00000000..9314d5f2
--- /dev/null
+++ b/dev-libs/nss/files/nss-3.15-gentoo-fixups.patch
@@ -0,0 +1,238 @@
+--- nss/config/Makefile
++++ nss/config/Makefile
+@@ -0,0 +1,40 @@
++CORE_DEPTH = ..
++DEPTH = ..
++
++include $(CORE_DEPTH)/coreconf/config.mk
++
++NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
++NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
++NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
++PREFIX = /usr
++
++all: export libs
++
++export:
++ # Create the nss.pc file
++ mkdir -p $(DIST)/lib/pkgconfig
++ sed -e "s,@prefix@,$(PREFIX)," \
++ -e "s,@exec_prefix@,\$${prefix}," \
++ -e "s,@libdir@,\$${prefix}/lib64," \
++ -e "s,@includedir@,\$${prefix}/include/nss," \
++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
++ nss.pc.in > nss.pc
++ chmod 0644 nss.pc
++ ln -sf ../../../../config/nss.pc $(DIST)/lib/pkgconfig
++
++ # Create the nss-config script
++ mkdir -p $(DIST)/bin
++ sed -e "s,@prefix@,$(PREFIX)," \
++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
++ nss-config.in > nss-config
++ chmod 0755 nss-config
++ ln -sf ../../../config/nss-config $(DIST)/bin
++
++libs:
++
++dummy: all export libs
++
+--- nss/config/nss-config.in
++++ nss/config/nss-config.in
+@@ -0,0 +1,145 @@
++#!/bin/sh
++
++prefix=@prefix@
++
++major_version=@NSS_MAJOR_VERSION@
++minor_version=@NSS_MINOR_VERSION@
++patch_version=@NSS_PATCH_VERSION@
++
++usage()
++{
++ cat <<EOF
++Usage: nss-config [OPTIONS] [LIBRARIES]
++Options:
++ [--prefix[=DIR]]
++ [--exec-prefix[=DIR]]
++ [--includedir[=DIR]]
++ [--libdir[=DIR]]
++ [--version]
++ [--libs]
++ [--cflags]
++Dynamic Libraries:
++ nss
++ ssl
++ smime
++ nssutil
++EOF
++ exit $1
++}
++
++if test $# -eq 0; then
++ usage 1 1>&2
++fi
++
++lib_ssl=yes
++lib_smime=yes
++lib_nss=yes
++lib_nssutil=yes
++
++while test $# -gt 0; do
++ case "$1" in
++ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
++ *) optarg= ;;
++ esac
++
++ case $1 in
++ --prefix=*)
++ prefix=$optarg
++ ;;
++ --prefix)
++ echo_prefix=yes
++ ;;
++ --exec-prefix=*)
++ exec_prefix=$optarg
++ ;;
++ --exec-prefix)
++ echo_exec_prefix=yes
++ ;;
++ --includedir=*)
++ includedir=$optarg
++ ;;
++ --includedir)
++ echo_includedir=yes
++ ;;
++ --libdir=*)
++ libdir=$optarg
++ ;;
++ --libdir)
++ echo_libdir=yes
++ ;;
++ --version)
++ echo ${major_version}.${minor_version}.${patch_version}
++ ;;
++ --cflags)
++ echo_cflags=yes
++ ;;
++ --libs)
++ echo_libs=yes
++ ;;
++ ssl)
++ lib_ssl=yes
++ ;;
++ smime)
++ lib_smime=yes
++ ;;
++ nss)
++ lib_nss=yes
++ ;;
++ nssutil)
++ lib_nssutil=yes
++ ;;
++ *)
++ usage 1 1>&2
++ ;;
++ esac
++ shift
++done
++
++# Set variables that may be dependent upon other variables
++if test -z "$exec_prefix"; then
++ exec_prefix=`pkg-config --variable=exec_prefix nss`
++fi
++if test -z "$includedir"; then
++ includedir=`pkg-config --variable=includedir nss`
++fi
++if test -z "$libdir"; then
++ libdir=`pkg-config --variable=libdir nss`
++fi
++
++if test "$echo_prefix" = "yes"; then
++ echo $prefix
++fi
++
++if test "$echo_exec_prefix" = "yes"; then
++ echo $exec_prefix
++fi
++
++if test "$echo_includedir" = "yes"; then
++ echo $includedir
++fi
++
++if test "$echo_libdir" = "yes"; then
++ echo $libdir
++fi
++
++if test "$echo_cflags" = "yes"; then
++ echo -I$includedir
++fi
++
++if test "$echo_libs" = "yes"; then
++ libdirs=""
++ if test -n "$lib_ssl"; then
++ libdirs="$libdirs -lssl${major_version}"
++ fi
++ if test -n "$lib_smime"; then
++ libdirs="$libdirs -lsmime${major_version}"
++ fi
++ if test -n "$lib_nss"; then
++ libdirs="$libdirs -lnss${major_version}"
++ fi
++ if test -n "$lib_nssutil"; then
++ libdirs="$libdirs -lnssutil${major_version}"
++ fi
++ echo $libdirs
++fi
++
+--- nss/config/nss.pc.in
++++ nss/config/nss.pc.in
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: NSS
++Description: Network Security Services
++Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
++Requires: nspr >= 4.8
++Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3
++Cflags: -I${includedir}
++
+--- nss/Makefile
++++ nss/Makefile
+@@ -44,7 +44,7 @@
+ # (7) Execute "local" rules. (OPTIONAL). #
+ #######################################################################
+
+-nss_build_all: build_nspr all
++nss_build_all: all
+
+ nss_clean_all: clobber_nspr clobber
+
+@@ -103,12 +103,6 @@
+ --with-dist-prefix='$(NSPR_PREFIX)' \
+ --with-dist-includedir='$(NSPR_PREFIX)/include'
+
+-build_nspr: $(NSPR_CONFIG_STATUS)
+- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
+-
+-clobber_nspr: $(NSPR_CONFIG_STATUS)
+- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) clobber
+-
+ build_docs:
+ $(MAKE) -C $(CORE_DEPTH)/doc
+
+--- nss/manifest.mn
++++ nss/manifest.mn
+@@ -10,4 +10,4 @@
+
+ RELEASE = nss
+
+-DIRS = coreconf lib cmd
++DIRS = coreconf lib cmd config
diff --git a/dev-libs/nss/files/nss-3.15.4-enable-pem.patch b/dev-libs/nss/files/nss-3.15.4-enable-pem.patch
new file mode 100644
index 00000000..8e610243
--- /dev/null
+++ b/dev-libs/nss/files/nss-3.15.4-enable-pem.patch
@@ -0,0 +1,13 @@
+Patches taken from http://pkgs.fedoraproject.org/cgit/nss.git/
+
+--- nss/lib/ckfw/manifest.mn.libpem
++++ nss/lib/ckfw/manifest.mn
+@@ -5,7 +5,7 @@
+
+ CORE_DEPTH = ../..
+
+-DIRS = builtins
++DIRS = builtins pem
+
+ PRIVATE_EXPORTS = \
+ ck.h \
diff --git a/dev-libs/nss/files/nss-3.16-musl.patch b/dev-libs/nss/files/nss-3.16-musl.patch
new file mode 100644
index 00000000..4dde4ae4
--- /dev/null
+++ b/dev-libs/nss/files/nss-3.16-musl.patch
@@ -0,0 +1,13 @@
+--- a/nss-3.16/nss/lib/dbm/config/config.mk
++++ b/nss-3.16/nss/lib/dbm/config/config.mk
+@@ -25,10 +25,6 @@
+ DEFINES += -DHAVE_SNPRINTF
+ endif
+
+-ifeq (,$(filter-out IRIX Linux,$(OS_TARGET)))
+-DEFINES += -DHAVE_SYS_CDEFS_H
+-endif
+-
+ ifeq (,$(filter-out DGUX NCR ReliantUNIX SCO_SV SCOOS UNIXWARE,$(OS_TARGET)))
+ DEFINES += -DHAVE_SYS_BYTEORDER_H
+ endif
diff --git a/dev-libs/nss/files/nss-3.17.1-gentoo-fixups.patch b/dev-libs/nss/files/nss-3.17.1-gentoo-fixups.patch
new file mode 100644
index 00000000..26b488ac
--- /dev/null
+++ b/dev-libs/nss/files/nss-3.17.1-gentoo-fixups.patch
@@ -0,0 +1,241 @@
+--- nss-3.17.1/nss/config/Makefile
++++ nss-3.17.1/nss/config/Makefile
+@@ -0,0 +1,40 @@
++CORE_DEPTH = ..
++DEPTH = ..
++
++include $(CORE_DEPTH)/coreconf/config.mk
++
++NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
++NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
++NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
++PREFIX = /usr
++
++all: export libs
++
++export:
++ # Create the nss.pc file
++ mkdir -p $(DIST)/lib/pkgconfig
++ sed -e "s,@prefix@,$(PREFIX)," \
++ -e "s,@exec_prefix@,\$${prefix}," \
++ -e "s,@libdir@,\$${prefix}/lib64," \
++ -e "s,@includedir@,\$${prefix}/include/nss," \
++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
++ nss.pc.in > nss.pc
++ chmod 0644 nss.pc
++ ln -sf ../../../../config/nss.pc $(DIST)/lib/pkgconfig
++
++ # Create the nss-config script
++ mkdir -p $(DIST)/bin
++ sed -e "s,@prefix@,$(PREFIX)," \
++ -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
++ -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
++ -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
++ nss-config.in > nss-config
++ chmod 0755 nss-config
++ ln -sf ../../../config/nss-config $(DIST)/bin
++
++libs:
++
++dummy: all export libs
++
+--- nss-3.17.1/nss/config/nss-config.in
++++ nss-3.17.1/nss/config/nss-config.in
+@@ -0,0 +1,145 @@
++#!/bin/sh
++
++prefix=@prefix@
++
++major_version=@NSS_MAJOR_VERSION@
++minor_version=@NSS_MINOR_VERSION@
++patch_version=@NSS_PATCH_VERSION@
++
++usage()
++{
++ cat <<EOF
++Usage: nss-config [OPTIONS] [LIBRARIES]
++Options:
++ [--prefix[=DIR]]
++ [--exec-prefix[=DIR]]
++ [--includedir[=DIR]]
++ [--libdir[=DIR]]
++ [--version]
++ [--libs]
++ [--cflags]
++Dynamic Libraries:
++ nss
++ ssl
++ smime
++ nssutil
++EOF
++ exit $1
++}
++
++if test $# -eq 0; then
++ usage 1 1>&2
++fi
++
++lib_ssl=yes
++lib_smime=yes
++lib_nss=yes
++lib_nssutil=yes
++
++while test $# -gt 0; do
++ case "$1" in
++ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
++ *) optarg= ;;
++ esac
++
++ case $1 in
++ --prefix=*)
++ prefix=$optarg
++ ;;
++ --prefix)
++ echo_prefix=yes
++ ;;
++ --exec-prefix=*)
++ exec_prefix=$optarg
++ ;;
++ --exec-prefix)
++ echo_exec_prefix=yes
++ ;;
++ --includedir=*)
++ includedir=$optarg
++ ;;
++ --includedir)
++ echo_includedir=yes
++ ;;
++ --libdir=*)
++ libdir=$optarg
++ ;;
++ --libdir)
++ echo_libdir=yes
++ ;;
++ --version)
++ echo ${major_version}.${minor_version}.${patch_version}
++ ;;
++ --cflags)
++ echo_cflags=yes
++ ;;
++ --libs)
++ echo_libs=yes
++ ;;
++ ssl)
++ lib_ssl=yes
++ ;;
++ smime)
++ lib_smime=yes
++ ;;
++ nss)
++ lib_nss=yes
++ ;;
++ nssutil)
++ lib_nssutil=yes
++ ;;
++ *)
++ usage 1 1>&2
++ ;;
++ esac
++ shift
++done
++
++# Set variables that may be dependent upon other variables
++if test -z "$exec_prefix"; then
++ exec_prefix=`pkg-config --variable=exec_prefix nss`
++fi
++if test -z "$includedir"; then
++ includedir=`pkg-config --variable=includedir nss`
++fi
++if test -z "$libdir"; then
++ libdir=`pkg-config --variable=libdir nss`
++fi
++
++if test "$echo_prefix" = "yes"; then
++ echo $prefix
++fi
++
++if test "$echo_exec_prefix" = "yes"; then
++ echo $exec_prefix
++fi
++
++if test "$echo_includedir" = "yes"; then
++ echo $includedir
++fi
++
++if test "$echo_libdir" = "yes"; then
++ echo $libdir
++fi
++
++if test "$echo_cflags" = "yes"; then
++ echo -I$includedir
++fi
++
++if test "$echo_libs" = "yes"; then
++ libdirs=""
++ if test -n "$lib_ssl"; then
++ libdirs="$libdirs -lssl${major_version}"
++ fi
++ if test -n "$lib_smime"; then
++ libdirs="$libdirs -lsmime${major_version}"
++ fi
++ if test -n "$lib_nss"; then
++ libdirs="$libdirs -lnss${major_version}"
++ fi
++ if test -n "$lib_nssutil"; then
++ libdirs="$libdirs -lnssutil${major_version}"
++ fi
++ echo $libdirs
++fi
++
+--- nss-3.17.1/nss/config/nss.pc.in
++++ nss-3.17.1/nss/config/nss.pc.in
+@@ -0,0 +1,12 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: NSS
++Description: Network Security Services
++Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
++Requires: nspr >= 4.8
++Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3
++Cflags: -I${includedir}
++
+--- nss-3.17.1/nss/Makefile
++++ nss-3.17.1/nss/Makefile
+@@ -44,7 +44,7 @@
+ # (7) Execute "local" rules. (OPTIONAL). #
+ #######################################################################
+
+-nss_build_all: build_nspr all
++nss_build_all: all
+
+ nss_clean_all: clobber_nspr clobber
+
+@@ -109,12 +109,6 @@
+ --with-dist-prefix='$(NSPR_PREFIX)' \
+ --with-dist-includedir='$(NSPR_PREFIX)/include'
+
+-build_nspr: $(NSPR_CONFIG_STATUS)
+- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
+-
+-clobber_nspr: $(NSPR_CONFIG_STATUS)
+- $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) clobber
+-
+ build_docs:
+ $(MAKE) -C $(CORE_DEPTH)/doc
+
+--- nss-3.17.1/nss/manifest.mn
++++ nss-3.17.1/nss/manifest.mn
+@@ -10,7 +10,7 @@
+
+ RELEASE = nss
+
+-DIRS = coreconf lib cmd
++DIRS = coreconf lib cmd config
+
+ ifdef NSS_BUILD_GTESTS
+ DIRS += external_tests
diff --git a/dev-libs/nss/metadata.xml b/dev-libs/nss/metadata.xml
new file mode 100644
index 00000000..36dc8317
--- /dev/null
+++ b/dev-libs/nss/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>mozilla</herd>
+<use>
+ <flag name='cacert'>
+ Include root certs from CAcert (http://http://www.cacert.org/) and
+ Software in the Public Interest (http://www.spi-inc.org/)
+ </flag>
+ <flag name='nss-pem'>Add support for libnsspem</flag>
+ <flag name='utils'>Install utilities included with the library</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:mozilla:nss</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/dev-libs/nss/nss-3.16-r99.ebuild b/dev-libs/nss/nss-3.16-r99.ebuild
new file mode 100644
index 00000000..0446b331
--- /dev/null
+++ b/dev-libs/nss/nss-3.16-r99.ebuild
@@ -0,0 +1,271 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.16.ebuild,v 1.13 2014/07/24 10:58:18 polynomial-c Exp $
+
+EAPI=5
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+NSPR_VER="4.10"
+RTM_NAME="NSS_${PV//./_}_RTM"
+# Rev of https://git.fedorahosted.org/cgit/nss-pem.git
+PEM_GIT_REV="3ade37c5c4ca5a6094e3f4b2e4591405db1867dd"
+PEM_P="${PN}-pem-${PEM_GIT_REV}"
+
+DESCRIPTION="Mozilla's Network Security Services library that implements PKI support"
+HOMEPAGE="http://www.mozilla.org/projects/security/pki/nss/"
+SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz
+ cacert? ( http://dev.gentoo.org/~anarchy/patches/${PN}-3.14.1-add_spi+cacerts_ca_certs.patch )
+ nss-pem? ( https://git.fedorahosted.org/cgit/nss-pem.git/snapshot/${PEM_P}.tar.bz2 )"
+
+LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+cacert +nss-pem utils"
+
+DEPEND="virtual/pkgconfig
+ >=dev-libs/nspr-${NSPR_VER}"
+RDEPEND=">=dev-libs/nspr-${NSPR_VER}
+ >=dev-db/sqlite-3.5
+ sys-libs/zlib"
+
+RESTRICT="test"
+
+S="${WORKDIR}/${P}/${PN}"
+
+src_setup() {
+ export LC_ALL="C"
+}
+
+src_unpack() {
+ unpack ${A}
+ if use nss-pem ; then
+ mv "${PEM_P}"/nss/lib/ckfw/pem/ "${S}"/lib/ckfw/ || die
+ fi
+}
+
+src_prepare() {
+ # Custom changes for gentoo
+ epatch "${FILESDIR}/${PN}-3.15-gentoo-fixups.patch"
+ epatch "${FILESDIR}/${PN}-3.15-gentoo-fixup-warnings.patch"
+ epatch "${FILESDIR}/${PN}-3.16-musl.patch"
+ use cacert && epatch "${DISTDIR}/${PN}-3.14.1-add_spi+cacerts_ca_certs.patch"
+ use nss-pem && epatch "${FILESDIR}/${PN}-3.15.4-enable-pem.patch"
+ epatch "${FILESDIR}/nss-3.14.2-solaris-gcc.patch"
+ cd coreconf
+ # hack nspr paths
+ echo 'INCLUDES += -I$(DIST)/include/dbm' \
+ >> headers.mk || die "failed to append include"
+
+ # modify install path
+ sed -e 's:SOURCE_PREFIX = $(CORE_DEPTH)/\.\./dist:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \
+ -i source.mk
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk
+
+ # Ensure we stay multilib aware
+ sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" "${S}"/config/Makefile
+
+ # Fix pkgconfig file for Prefix
+ sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \
+ "${S}"/config/Makefile
+
+ # use host shlibsign if need be #436216
+ if tc-is-cross-compiler ; then
+ sed -i \
+ -e 's:"${2}"/shlibsign:shlibsign:' \
+ "${S}"/cmd/shlibsign/sign.sh
+ fi
+
+ # dirty hack
+ cd "${S}"
+ sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \
+ lib/ssl/config.mk
+ sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \
+ cmd/platlibs.mk
+}
+
+nssarch() {
+ # Most of the arches are the same as $ARCH
+ local t=${1:-${CHOST}}
+ case ${t} in
+ aarch64*)echo "aarch64";;
+ hppa*) echo "parisc";;
+ i?86*) echo "i686";;
+ x86_64*) echo "x86_64";;
+ *) tc-arch ${t};;
+ esac
+}
+
+nssbits() {
+ local cc="${1}CC" cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS"
+ echo > "${T}"/test.c || die
+ ${!cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}"/test.o || die
+ case $(file "${T}"/test.o) in
+ *32-bit*x86-64*) echo USE_X32=1;;
+ *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;;
+ *32-bit*|*ppc*|*i386*) ;;
+ *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";;
+ esac
+}
+
+src_compile() {
+ strip-flags
+
+ tc-export AR RANLIB {BUILD_,}{CC,PKG_CONFIG}
+ local makeargs=(
+ CC="${CC}"
+ AR="${AR} rc \$@"
+ RANLIB="${RANLIB}"
+ OPTIMIZER=
+ $(nssbits)
+ )
+
+ # Take care of nspr settings #436216
+ append-cppflags $(${PKG_CONFIG} nspr --cflags)
+ append-ldflags $(${PKG_CONFIG} nspr --libs-only-L)
+ unset NSPR_INCLUDE_DIR
+ export NSPR_LIB_DIR=${T}/fake-dir
+
+ # Do not let `uname` be used.
+ if use kernel_linux ; then
+ makeargs+=(
+ OS_TARGET=Linux
+ OS_RELEASE=2.6
+ OS_TEST="$(nssarch)"
+ )
+ fi
+
+ export BUILD_OPT=1
+ export NSS_USE_SYSTEM_SQLITE=1
+ export NSDISTMODE=copy
+ export NSS_ENABLE_ECC=1
+ export XCFLAGS="${CFLAGS} ${CPPFLAGS}"
+ export FREEBL_NO_DEPEND=1
+ export ASFLAGS=""
+
+ local d
+
+ # Build the host tools first.
+ LDFLAGS="${BUILD_LDFLAGS}" \
+ XCFLAGS="${BUILD_CFLAGS}" \
+ emake -j1 -C coreconf \
+ CC="${BUILD_CC}" \
+ $(nssbits BUILD_)
+ makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" )
+
+ # Then build the target tools.
+ for d in . lib/dbm ; do
+ emake -j1 "${makeargs[@]}" -C ${d}
+ done
+}
+
+# Altering these 3 libraries breaks the CHK verification.
+# All of the following cause it to break:
+# - stripping
+# - prelink
+# - ELF signing
+# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html
+# Either we have to NOT strip them, or we have to forcibly resign after
+# stripping.
+#local_libdir="$(get_libdir)"
+#export STRIP_MASK="
+# */${local_libdir}/libfreebl3.so*
+# */${local_libdir}/libnssdbm3.so*
+# */${local_libdir}/libsoftokn3.so*"
+
+export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3"
+
+generate_chk() {
+ local shlibsign="$1"
+ local libdir="$2"
+ einfo "Resigning core NSS libraries for FIPS validation"
+ shift 2
+ local i
+ for i in ${NSS_CHK_SIGN_LIBS} ; do
+ local libname=lib${i}.so
+ local chkname=lib${i}.chk
+ "${shlibsign}" \
+ -i "${libdir}"/${libname} \
+ -o "${libdir}"/${chkname}.tmp \
+ && mv -f \
+ "${libdir}"/${chkname}.tmp \
+ "${libdir}"/${chkname} \
+ || die "Failed to sign ${libname}"
+ done
+}
+
+cleanup_chk() {
+ local libdir="$1"
+ shift 1
+ local i
+ for i in ${NSS_CHK_SIGN_LIBS} ; do
+ local libfname="${libdir}/lib${i}.so"
+ # If the major version has changed, then we have old chk files.
+ [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \
+ && rm -f "${libfname}.chk"
+ done
+}
+
+src_install() {
+ cd "${S}"/dist
+
+ dodir /usr/$(get_libdir)
+ cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed"
+ # We generate these after stripping the libraries, else they don't match.
+ #cp -L */lib/*.chk "${ED}"/usr/$(get_libdir) || die "copying chk files failed"
+ cp -L */lib/libcrmf.a "${ED}"/usr/$(get_libdir) || die "copying libs failed"
+
+ # Install nss-config and pkgconfig file
+ dodir /usr/bin
+ cp -L */bin/nss-config "${ED}"/usr/bin
+ dodir /usr/$(get_libdir)/pkgconfig
+ cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig
+
+ # all the include files
+ insinto /usr/include/nss
+ doins public/nss/*.h
+
+ local f nssutils
+ # Always enabled because we need it for chk generation.
+ nssutils="shlibsign"
+ if use utils; then
+ # The tests we do not need to install.
+ #nssutils_test="bltest crmftest dbtest dertimetest
+ #fipstest remtest sdrtest"
+ nssutils="addbuiltin atob baddbdir btoa certcgi certutil checkcert
+ cmsutil conflict crlutil derdump digest makepqg mangle modutil multinit
+ nonspr10 ocspclnt oidcalc p7content p7env p7sign p7verify pk11mode
+ pk12util pp rsaperf selfserv shlibsign signtool signver ssltap strsclnt
+ symkeyutil tstclnt vfychain vfyserv"
+ fi
+ cd "${S}"/dist/*/bin/
+ for f in ${nssutils}; do
+ dobin ${f}
+ done
+
+ # Prelink breaks the CHK files. We don't have any reliable way to run
+ # shlibsign after prelink.
+ local l libs=() liblist
+ for l in ${NSS_CHK_SIGN_LIBS} ; do
+ libs+=("${EPREFIX}/usr/$(get_libdir)/lib${l}.so")
+ done
+ liblist=$(printf '%s:' "${libs[@]}")
+ echo -e "PRELINK_PATH_MASK=${liblist%:}" > "${T}/90nss"
+ doenvd "${T}/90nss"
+}
+
+pkg_postinst() {
+ # We must re-sign the libraries AFTER they are stripped.
+ local shlibsign="${EROOT}/usr/bin/shlibsign"
+ # See if we can execute it (cross-compiling & such). #436216
+ "${shlibsign}" -h >&/dev/null
+ if [[ $? -gt 1 ]] ; then
+ shlibsign="shlibsign"
+ fi
+ generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir)
+}
+
+pkg_postrm() {
+ cleanup_chk "${EROOT}"/usr/$(get_libdir)
+}
diff --git a/dev-libs/nss/nss-3.17.4-r99.ebuild b/dev-libs/nss/nss-3.17.4-r99.ebuild
new file mode 100644
index 00000000..7b76db2e
--- /dev/null
+++ b/dev-libs/nss/nss-3.17.4-r99.ebuild
@@ -0,0 +1,322 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.17.4.ebuild,v 1.3 2015/03/26 11:36:48 ago Exp $
+
+EAPI=5
+inherit eutils flag-o-matic multilib toolchain-funcs multilib-minimal
+
+NSPR_VER="4.10.6-r1"
+RTM_NAME="NSS_${PV//./_}_RTM"
+# Rev of https://git.fedorahosted.org/cgit/nss-pem.git
+PEM_GIT_REV="015ae754dd9f6fbcd7e52030ec9732eb27fc06a8"
+PEM_P="${PN}-pem-${PEM_GIT_REV}"
+
+DESCRIPTION="Mozilla's Network Security Services library that implements PKI support"
+HOMEPAGE="http://www.mozilla.org/projects/security/pki/nss/"
+SRC_URI="ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz
+ cacert? ( http://dev.gentoo.org/~anarchy/patches/${PN}-3.14.1-add_spi+cacerts_ca_certs.patch )
+ nss-pem? ( https://git.fedorahosted.org/cgit/nss-pem.git/snapshot/${PEM_P}.tar.bz2 )"
+
+LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+cacert +nss-pem utils"
+
+DEPEND=">=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+ >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}]"
+RDEPEND=">=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}]
+ >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}]
+ >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r12
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+RESTRICT="test"
+
+S="${WORKDIR}/${P}/${PN}"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/nss-config
+)
+
+src_unpack() {
+ unpack ${A}
+ if use nss-pem ; then
+ mv "${PEM_P}"/nss/lib/ckfw/pem/ "${S}"/lib/ckfw/ || die
+ fi
+}
+
+src_prepare() {
+ # Custom changes for gentoo
+ epatch "${FILESDIR}/${PN}-3.17.1-gentoo-fixups.patch"
+ epatch "${FILESDIR}/${PN}-3.15-gentoo-fixup-warnings.patch"
+ use cacert && epatch "${DISTDIR}/${PN}-3.14.1-add_spi+cacerts_ca_certs.patch"
+ use nss-pem && epatch "${FILESDIR}/${PN}-3.15.4-enable-pem.patch"
+ epatch "${FILESDIR}/nss-3.14.2-solaris-gcc.patch"
+ epatch "${FILESDIR}/nss-3.16-musl.patch"
+
+ pushd coreconf >/dev/null || die
+ # hack nspr paths
+ echo 'INCLUDES += -I$(DIST)/include/dbm' \
+ >> headers.mk || die "failed to append include"
+
+ # modify install path
+ sed -e '/CORE_DEPTH/s:SOURCE_PREFIX.*$:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \
+ -i source.mk || die
+
+ # Respect LDFLAGS
+ sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk
+ popd >/dev/null || die
+
+ # Fix pkgconfig file for Prefix
+ sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \
+ config/Makefile || die
+
+ # use host shlibsign if need be #436216
+ if tc-is-cross-compiler ; then
+ sed -i \
+ -e 's:"${2}"/shlibsign:shlibsign:' \
+ cmd/shlibsign/sign.sh || die
+ fi
+
+ # dirty hack
+ sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \
+ lib/ssl/config.mk || die
+ sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \
+ cmd/platlibs.mk || die
+
+ multilib_copy_sources
+
+ strip-flags
+}
+
+multilib_src_configure() {
+ # Ensure we stay multilib aware
+ sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" config/Makefile || die
+}
+
+nssarch() {
+ # Most of the arches are the same as $ARCH
+ local t=${1:-${CHOST}}
+ case ${t} in
+ aarch64*)echo "aarch64";;
+ hppa*) echo "parisc";;
+ i?86*) echo "i686";;
+ x86_64*) echo "x86_64";;
+ *) tc-arch ${t};;
+ esac
+}
+
+nssbits() {
+ local cc cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS"
+ if [[ ${1} == BUILD_ ]]; then
+ cc=$(tc-getBUILD_CC)
+ else
+ cc=$(tc-getCC)
+ fi
+ echo > "${T}"/test.c || die
+ ${cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}/${1}test.o" || die
+ case $(file "${T}/${1}test.o") in
+ *32-bit*x86-64*) echo USE_X32=1;;
+ *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;;
+ *32-bit*|*ppc*|*i386*) ;;
+ *) die "Failed to detect whether ${cc} builds 64bits or 32bits, disable distcc if you're using it, please";;
+ esac
+}
+
+multilib_src_compile() {
+ # use ABI to determine bit'ness, or fallback if unset
+ local buildbits mybits
+ case "${ABI}" in
+ n32) mybits="USE_N32=1";;
+ x32) mybits="USE_X32=1";;
+ s390x|*64) mybits="USE_64=1";;
+ ${DEFAULT_ABI})
+ einfo "Running compilation test to determine bit'ness"
+ mybits=$(nssbits)
+ ;;
+ esac
+ # bitness of host may differ from target
+ if tc-is-cross-compiler; then
+ buildbits=$(nssbits BUILD_)
+ fi
+
+ local makeargs=(
+ CC="$(tc-getCC)"
+ AR="$(tc-getAR) rc \$@"
+ RANLIB="$(tc-getRANLIB)"
+ OPTIMIZER=
+ ${mybits}
+ )
+
+ # Take care of nspr settings #436216
+ local myCPPFLAGS="${CPPFLAGS} $($(tc-getPKG_CONFIG) nspr --cflags)"
+ unset NSPR_INCLUDE_DIR
+
+ # Do not let `uname` be used.
+ if use kernel_linux ; then
+ makeargs+=(
+ OS_TARGET=Linux
+ OS_RELEASE=2.6
+ OS_TEST="$(nssarch)"
+ )
+ fi
+
+ export BUILD_OPT=1
+ export NSS_USE_SYSTEM_SQLITE=1
+ export NSDISTMODE=copy
+ export NSS_ENABLE_ECC=1
+ export FREEBL_NO_DEPEND=1
+ export ASFLAGS=""
+
+ local d
+
+ # Build the host tools first.
+ LDFLAGS="${BUILD_LDFLAGS}" \
+ XCFLAGS="${BUILD_CFLAGS}" \
+ NSPR_LIB_DIR="${T}/fakedir" \
+ emake -j1 -C coreconf \
+ CC="$(tc-getBUILD_CC)" \
+ ${buildbits:-${mybits}}
+ makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" )
+
+ # Then build the target tools.
+ for d in . lib/dbm ; do
+ CPPFLAGS="${myCPPFLAGS}" \
+ XCFLAGS="${CFLAGS} ${CPPFLAGS}" \
+ NSPR_LIB_DIR="${T}/fakedir" \
+ emake -j1 "${makeargs[@]}" -C ${d}
+ done
+}
+
+# Altering these 3 libraries breaks the CHK verification.
+# All of the following cause it to break:
+# - stripping
+# - prelink
+# - ELF signing
+# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html
+# Either we have to NOT strip them, or we have to forcibly resign after
+# stripping.
+#local_libdir="$(get_libdir)"
+#export STRIP_MASK="
+# */${local_libdir}/libfreebl3.so*
+# */${local_libdir}/libnssdbm3.so*
+# */${local_libdir}/libsoftokn3.so*"
+
+export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3"
+
+generate_chk() {
+ local shlibsign="$1"
+ local libdir="$2"
+ einfo "Resigning core NSS libraries for FIPS validation"
+ shift 2
+ local i
+ for i in ${NSS_CHK_SIGN_LIBS} ; do
+ local libname=lib${i}.so
+ local chkname=lib${i}.chk
+ "${shlibsign}" \
+ -i "${libdir}"/${libname} \
+ -o "${libdir}"/${chkname}.tmp \
+ && mv -f \
+ "${libdir}"/${chkname}.tmp \
+ "${libdir}"/${chkname} \
+ || die "Failed to sign ${libname}"
+ done
+}
+
+cleanup_chk() {
+ local libdir="$1"
+ shift 1
+ local i
+ for i in ${NSS_CHK_SIGN_LIBS} ; do
+ local libfname="${libdir}/lib${i}.so"
+ # If the major version has changed, then we have old chk files.
+ [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \
+ && rm -f "${libfname}.chk"
+ done
+}
+
+multilib_src_install() {
+ pushd dist >/dev/null || die
+
+ dodir /usr/$(get_libdir)
+ cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed"
+ cp -L -t "${ED}"/usr/$(get_libdir) */lib/{libcrmf,libfreebl}.a || die "copying libs failed"
+
+ # Install nss-config and pkgconfig file
+ dodir /usr/bin
+ cp -L */bin/nss-config "${ED}"/usr/bin || die
+ dodir /usr/$(get_libdir)/pkgconfig
+ cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig || die
+
+ # create an nss-softokn.pc from nss.pc for libfreebl and some private headers
+ # bug 517266
+ sed -e 's#Libs:#Libs: -lfreebl#' \
+ -e 's#Cflags:#Cflags: -I${includedir}/private#' \
+ */lib/pkgconfig/nss.pc >"${ED}"/usr/$(get_libdir)/pkgconfig/nss-softokn.pc \
+ || die "could not create nss-softokn.pc"
+
+ # all the include files
+ insinto /usr/include/nss
+ doins public/nss/*.h
+ insinto /usr/include/nss/private
+ doins private/nss/{blapi,alghmac}.h
+
+ popd >/dev/null || die
+
+ local f nssutils
+ # Always enabled because we need it for chk generation.
+ nssutils="shlibsign"
+
+ if multilib_is_native_abi ; then
+ if use utils; then
+ # The tests we do not need to install.
+ #nssutils_test="bltest crmftest dbtest dertimetest
+ #fipstest remtest sdrtest"
+ nssutils="addbuiltin atob baddbdir btoa certcgi certutil checkcert
+ cmsutil conflict crlutil derdump digest makepqg mangle modutil multinit
+ nonspr10 ocspclnt oidcalc p7content p7env p7sign p7verify pk11mode
+ pk12util pp rsaperf selfserv shlibsign signtool signver ssltap strsclnt
+ symkeyutil tstclnt vfychain vfyserv"
+ fi
+ pushd dist/*/bin >/dev/null || die
+ for f in ${nssutils}; do
+ dobin ${f}
+ done
+ popd >/dev/null || die
+ fi
+
+ # Prelink breaks the CHK files. We don't have any reliable way to run
+ # shlibsign after prelink.
+ local l libs=() liblist
+ for l in ${NSS_CHK_SIGN_LIBS} ; do
+ libs+=("${EPREFIX}/usr/$(get_libdir)/lib${l}.so")
+ done
+ liblist=$(printf '%s:' "${libs[@]}")
+ echo -e "PRELINK_PATH_MASK=${liblist%:}" > "${T}/90nss-${ABI}"
+ doenvd "${T}/90nss-${ABI}"
+}
+
+pkg_postinst() {
+ multilib_pkg_postinst() {
+ # We must re-sign the libraries AFTER they are stripped.
+ local shlibsign="${EROOT}/usr/bin/shlibsign"
+ # See if we can execute it (cross-compiling & such). #436216
+ "${shlibsign}" -h >&/dev/null
+ if [[ $? -gt 1 ]] ; then
+ shlibsign="shlibsign"
+ fi
+ generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir)
+ }
+
+ multilib_foreach_abi multilib_pkg_postinst
+}
+
+pkg_postrm() {
+ multilib_pkg_postrm() {
+ cleanup_chk "${EROOT}"/usr/$(get_libdir)
+ }
+
+ multilib_foreach_abi multilib_pkg_postrm
+}
diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
new file mode 100644
index 00000000..81ccc7ab
--- /dev/null
+++ b/dev-libs/openssl/Manifest
@@ -0,0 +1,15 @@
+AUX gentoo.config-1.0.1 4784 SHA256 26d1b360f094dd4e1acf47c3e830b52343c0f778dcd8f2c5b6c213b7e5192d13 SHA512 605e86cc68bbce5405b359098cc0a5abdc071a36462ca868d2fce57cabd928536fbcb0f5dea7318c96b3f9fca39b8c303601fff4442a8e68d7f99254180980e7 WHIRLPOOL eb7540c99ad4bbc60a3decd30e9d7d3816bb7cdd948c9c76950b278acec34a4737f1afaf543e9e524ea0cef8ae26008c065bef44129673e40ccaec9509052575
+AUX openssl-1.0.0a-ldflags.patch 1095 SHA256 2489ffbae4af11e1642d54992c404ca81b0c2a9c169032281f4f7778d945836f SHA512 d5a3f90ca0e9755940da525b8daba5b5d09b2b251863e9ca4f2b3b0a5db461e0aa25b2ae7a7d36d13a92ff64f2a37d4809b70aff9672c0f43398369bc7099979 WHIRLPOOL b7c2fbc833be856388110f2ac891976903e7c5dd4030249bcd79f915ae94fa93bff955ff3eaaf4a4bab306a09512bd861099c2738f5af7027174b79d023f7261
+AUX openssl-1.0.0d-windres.patch 2912 SHA256 e5dbfd6af69bc3f69b51787cf1f6245207be9824dfffbdd9b4e278772ed8ab32 SHA512 d7a0238edea29aac7d20dca0778c67f8ae4dc0da190e5277e1b3519ae536f2c44533ac5dc1cbcd138bc4277ad669b13fca316bd962f26e2cb387f2ad3fd0111b WHIRLPOOL d62156820e55898d0a0393473c6ad8e49c5aa7bb9d3fc7043795de7102c3003d5f8b874c751e03cf832e306ac290790e871e1318bb830b3558a43e09be5b45b4
+AUX openssl-1.0.0h-pkg-config.patch 1363 SHA256 dbbcc175f02e5edced01a13dd1e7d35dc4322c0970f78a7fd781a6c0766886af SHA512 c2f7a68c96098bd742235a40f27d6b1e5a0ebece53ca32dd0be74b85210479064efa1d5dc76e457b786067185768492fab2ed53762a22c511c2a2e3d43ed137b WHIRLPOOL 7f795dbed2124d8d2d126886d106675662f09b8e79c70fa2af3298486fdb75b7f1285dc17a53daf985bd4af1e58c36e13e49f46d18af860f0dabad1b3898c3b0
+AUX openssl-1.0.1-parallel-build.patch 10614 SHA256 f3aa674880ffa53a891d3f9054a1ff162c4461b3ec160a365990275907636259 SHA512 439015b3b007adfbab047a1e3e12a9700030779a593bba1a30e9554c7c02eb1cffe9acb089546954e87163847cf86b13130abf9646eb5d00a2ff725b534f84d5 WHIRLPOOL 673f6f045765effb9ded607bf8116a81e7bfeee78ba0e8a34892081c272239a2b75fbb14f4c48b61d93593fac8e1b1e8bef7223f4cc64e8443e19c8f337ab6bc
+AUX openssl-1.0.1-x32.patch 3273 SHA256 a4f05b8757e225a05a9c5a3ea485159066760d878c9ee54c4eaf61760e33c6cf SHA512 6bed57fe2fbe2d0ced1279b53804d94426a679d5d6b80ad7d0ed18523a7fda397e02038032c08cdd4e6034f9ff6e82cad365ff2a724d49d91467cf2b77f47752 WHIRLPOOL 1366632e7dc1c6e54efc5b9791bf24833d20e7a61ca29aa38d31b5b9629febf926a29742e370b7cd6767c810c0a1676100ca9169f0d836dfd19ff0b2c29e49c1
+AUX openssl-1.0.1c-force-termios.patch 1849 SHA256 3c5a65f2961e5fd0031b0fabe0021f8531e901a5c8674c03d2b03157a184998b SHA512 6f938fc0778040104bd7d9fdf08e1200f25337089fdb0c2df935b6f5144849be550c66a9a83699bbec5b32304de5fea2ded325505412e2e4d3439dd49ed05db9 WHIRLPOOL 44f080f5f2ba75421495865486fbacc92a1d1b32100f1c4b384430957179b49ed0e91472832db12758504c87ffca2455a03db9d56da61532f5baffdefd94b390
+AUX openssl-1.0.1e-s_client-verify.patch 592 SHA256 6f540fce663eefbe68cee16ad7d8d561d6c898eeb4180c2f4a4caa7e43c6d0c9 SHA512 117b1017e1259667078d3ccdcd9fd46357c6f85cf2702794f49c612b37acdc044fe88f871dbe46fcad9ed4cd8aaaaee800dddb5286203322802efd7549a43b68 WHIRLPOOL 70a4cc36b1dcb24d7e9bcef016684fb2394977f7f20aa332ebd0aa15e3f4c16c74563d2fc0ba8d70669f6cc9a13bf8a30cdb28ebafe2d102cd2859a4e32c38d7
+AUX openssl-1.0.1f-revert-alpha-perl-generation.patch 3102 SHA256 6e502275b32ac0eca80f28448ae1bb88506f9135258f420fd857ea0b9b485778 SHA512 c80439da3d268e70fd492d0ca73c0a17ddb088b9330610794a338d1921ee13dad9caca4c81ca103b82a7541c8712f77e51f352ec1b1b02789d9aed291acb0cdc WHIRLPOOL cb760366c8759b1c78c5307134bb48c4fc12b1556276c2ef55455ea54725d20cb433ade966a7453f512d2feb5ae89a9798078ab535e4605366633a8e003c7ac6
+AUX openssl-1.0.1h-ipv6.patch 17788 SHA256 7adeeb88cc544f8b210efbe2baff48fccf5029b582dff7010ae70e0e1f097d7b SHA512 0f0990d4294abcb5f3e51c84080883046a054c710b57a23f99b3323727d5e9aeb5ddeb6b6c2565b4be364f7c21419c90ce5288154e404cd663678f87e0d1c259 WHIRLPOOL cfe7a2e141a4a6252ffcfe215b16dd1082bc14a757dad7eb01bb9819de41ef0ee51a4b2dbf110c27b52e483341c337bf4d1f77f4f9f3172d2fee9e348c30af7e
+AUX openssl-1.0.1l-CVE-2015-0286.patch 10790 SHA256 3d234f4b7bd79b7de1a6fe2f42016531732c81dcb73af45edc5b280858d32cb8 SHA512 432a9e556df26e3f0059f53556dbc088cfe7e30e2c38354e7a7879bb4db204330702ab8050b9b31b3ef48badb8f0abdbf047445b71aa0c4c96f5aeb0bf16f9df WHIRLPOOL c4834efebdca3bee769819fee40099f2d83f4282db98a96da853164dae2639adaef18fe3caf87801f52e53b47752a99fd693aab66239e30344b714119c4c1c7a
+DIST openssl-1.0.1l.tar.gz 4429979 SHA256 b2cf4d48fe5d49f240c61c9e624193a6f232b5ed0baf010681e725963c40d1d4 SHA512 27fe42f33815a3aafff75f2b9a5604c328fe5945c5cecaca74e5d2c2a1e066d64ddcc1fdb14b54fc7523cc730ab8a57d7d56b2879c289e86673f91fee0cca65e WHIRLPOOL 79f5698585c68ba647fcdfc4b342a43d06d69230658ca1bc265dd10d8da939c3e27b9a4125bd2adfbf50002b1dddef18be086dfc23a5050e69fb77350131909f
+DIST openssl-c_rehash.sh.1.7 4167 SHA256 4999ee79892f52bd6a4a7baba9fac62262454d573bbffd72685d3aae9e48cee0 SHA512 55e8c2e827750a4f375cb83c86bfe2d166c01ffa5d7e9b16657b72b38b747c8985dd2c98f854c911dfbbee2ff3e92aff39fdf089d979b2e3534b7685ee8b80da WHIRLPOOL c88f06a3b8651f76b6289552cccceb64e13f6697c5f0ce3ff114c781ce1c218912b8ee308af9d087cd76a9600fdacda1953175bff07d7d3eb21b0c0b7f4f1ce1
+EBUILD openssl-1.0.1l-r99.ebuild 8833 SHA256 504c1a324da6c341f0d63b164965dca49ada307969ffe20e8cb78d401f4bd2c6 SHA512 70f0c39b0c02082a29939c1f5b25a23115ca5bfe3e843f9c0a3ebca9df7ffc4091b18fd144421cd90bd99e3146f9487451da5d7e20724d9f182cfdddebe3d589 WHIRLPOOL c9b4067bedc5464b934673b17eb1d6738aedbc196ae5513236ce4f40f9866e8732b18e7d6d37b856dd87975db9b6851cac74b3af87627442786914192d026f2a
+MISC metadata.xml 537 SHA256 dfb61bab6de1d7e943f92be14ed54fb9275d568a11d6ba29e395f23f547603ee SHA512 0417c438c7f9586c7bbe7694707fec94f2ecf6fb59e36bc87d707fab0b24346a6c9fac5e58c69302e767cd8a7e50a508cdb2430b2cdf8fcc88921286e09756e1 WHIRLPOOL 0f21bab1258c7ee675c27cb7d78a90985437dc8d001a232661657549cebd9f2f26802686435bdd3a1346c5a0ff14bfffa740d6ded2288dc211ad0183f5b3f686
diff --git a/dev-libs/openssl/files/gentoo.config-1.0.1 b/dev-libs/openssl/files/gentoo.config-1.0.1
new file mode 100755
index 00000000..bbc1aa95
--- /dev/null
+++ b/dev-libs/openssl/files/gentoo.config-1.0.1
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/files/gentoo.config-1.0.1,v 1.1 2013/05/21 17:53:19 vapier Exp $
+#
+# Openssl doesn't play along nicely with cross-compiling
+# like autotools based projects, so let's teach it new tricks.
+#
+# Review the bundled 'config' script to see why kind of targets
+# we can pass to the 'Configure' script.
+
+
+# Testing routines
+if [[ $1 == "test" ]] ; then
+ for c in \
+ "arm-gentoo-linux-uclibc |linux-generic32 -DL_ENDIAN" \
+ "armv5b-linux-gnu |linux-armv4 -DB_ENDIAN" \
+ "x86_64-pc-linux-gnu |linux-x86_64" \
+ "alpha-linux-gnu |linux-alpha-gcc" \
+ "alphaev56-unknown-linux-gnu |linux-alpha+bwx-gcc" \
+ "i686-pc-linux-gnu |linux-elf" \
+ "whatever-gentoo-freebsdX.Y |BSD-generic32" \
+ "i686-gentoo-freebsdX.Y |BSD-x86-elf" \
+ "sparc64-alpha-freebsdX.Y |BSD-sparc64" \
+ "ia64-gentoo-freebsd5.99234 |BSD-ia64" \
+ "x86_64-gentoo-freebsdX.Y |BSD-x86_64" \
+ "hppa64-aldsF-linux-gnu5.3 |linux-generic32 -DB_ENDIAN" \
+ "powerpc-gentOO-linux-uclibc |linux-ppc" \
+ "powerpc64-unk-linux-gnu |linux-ppc64" \
+ "x86_64-apple-darwinX |darwin64-x86_64-cc" \
+ "powerpc64-apple-darwinX |darwin64-ppc-cc" \
+ "i686-apple-darwinX |darwin-i386-cc" \
+ "i386-apple-darwinX |darwin-i386-cc" \
+ "powerpc-apple-darwinX |darwin-ppc-cc" \
+ "i586-pc-winnt |winnt-parity" \
+ "s390-ibm-linux-gnu |linux-generic32 -DB_ENDIAN" \
+ "s390x-linux-gnu |linux64-s390x" \
+ ;do
+ CHOST=${c/|*}
+ ret_want=${c/*|}
+ ret_got=$(CHOST=${CHOST} "$0")
+
+ if [[ ${ret_want} == "${ret_got}" ]] ; then
+ echo "PASS: ${CHOST}"
+ else
+ echo "FAIL: ${CHOST}"
+ echo -e "\twanted: ${ret_want}"
+ echo -e "\twe got: ${ret_got}"
+ fi
+ done
+ exit 0
+fi
+[[ -z ${CHOST} && -n $1 ]] && CHOST=$1
+
+
+# Detect the operating system
+case ${CHOST} in
+ *-aix*) system="aix";;
+ *-darwin*) system="darwin";;
+ *-freebsd*) system="BSD";;
+ *-hpux*) system="hpux";;
+ *-linux*) system="linux";;
+ *-solaris*) system="solaris";;
+ *-winnt*) system="winnt";;
+ x86_64-*-mingw*) system="mingw64";;
+ *mingw*) system="mingw";;
+ *) exit 0;;
+esac
+
+
+# Compiler munging
+compiler="gcc"
+if [[ ${CC} == "ccc" ]] ; then
+ compiler=${CC}
+fi
+
+
+# Detect target arch
+machine=""
+chost_machine=${CHOST%%-*}
+case ${system} in
+linux)
+ case ${chost_machine}:${ABI} in
+ alphaev56*|\
+ alphaev[678]*)machine=alpha+bwx-${compiler};;
+ alpha*) machine=alpha-${compiler};;
+ armv[4-9]*b*) machine="armv4 -DB_ENDIAN";;
+ armv[4-9]*) machine="armv4 -DL_ENDIAN";;
+ arm*b*) machine="generic32 -DB_ENDIAN";;
+ arm*) machine="generic32 -DL_ENDIAN";;
+ avr*) machine="generic32 -DL_ENDIAN";;
+ bfin*) machine="generic32 -DL_ENDIAN";;
+ # hppa64*) machine=parisc64;;
+ hppa*) machine="generic32 -DB_ENDIAN";;
+ i[0-9]86*|\
+ x86_64*:x86) machine=elf;;
+ ia64*) machine=ia64;;
+ m68*) machine="generic32 -DB_ENDIAN";;
+ mips*el*) machine="generic32 -DL_ENDIAN";;
+ mips*) machine="generic32 -DB_ENDIAN";;
+ powerpc64*) machine=ppc64;;
+ powerpc*) machine=ppc;;
+ # sh64*) machine=elf;;
+ sh*b*) machine="generic32 -DB_ENDIAN";;
+ sh*) machine="generic32 -DL_ENDIAN";;
+ sparc*v7*) machine="generic32 -DB_ENDIAN";;
+ sparc64*) machine=sparcv9;;
+ sparc*) machine=sparcv8;;
+ s390x*) machine=s390x system=linux64;;
+ s390*) machine="generic32 -DB_ENDIAN";;
+ x86_64*:x32) machine=x32;;
+ x86_64*) machine=x86_64;;
+ esac
+ ;;
+BSD)
+ case ${chost_machine} in
+ alpha*) machine=generic64;;
+ i[6-9]86*) machine=x86-elf;;
+ ia64*) machine=ia64;;
+ sparc64*) machine=sparc64;;
+ x86_64*) machine=x86_64;;
+ *) machine=generic32;;
+ esac
+ ;;
+aix)
+ machine=${compiler}
+ ;;
+darwin)
+ case ${chost_machine} in
+ powerpc64) machine=ppc-cc; system=${system}64;;
+ powerpc) machine=ppc-cc;;
+ i?86*) machine=i386-cc;;
+ x86_64) machine=x86_64-cc; system=${system}64;;
+ esac
+ ;;
+hpux)
+ case ${chost_machine} in
+ ia64) machine=ia64-${compiler} ;;
+ esac
+ ;;
+solaris)
+ case ${chost_machine} in
+ i386) machine=x86-${compiler} ;;
+ x86_64*) machine=x86_64-${compiler}; system=${system}64;;
+ sparcv9*) machine=sparcv9-${compiler}; system=${system}64;;
+ sparc*) machine=sparcv8-${compiler};;
+ esac
+ ;;
+winnt)
+ machine=parity
+ ;;
+mingw*)
+ # special case ... no xxx-yyy style name
+ echo ${system}
+ ;;
+esac
+
+
+# If we have something, show it
+[[ -n ${machine} ]] && echo ${system}-${machine}
diff --git a/dev-libs/openssl/files/openssl-1.0.0a-ldflags.patch b/dev-libs/openssl/files/openssl-1.0.0a-ldflags.patch
new file mode 100644
index 00000000..7ba39846
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.0a-ldflags.patch
@@ -0,0 +1,29 @@
+http://bugs.gentoo.org/181438
+http://bugs.gentoo.org/327421
+https://rt.openssl.org/Ticket/Display.html?id=3332&user=guest&pass=guest
+
+make sure we respect LDFLAGS
+
+also make sure we don't add useless -rpath flags to the system libdir
+
+--- Makefile.org
++++ Makefile.org
+@@ -189,6 +189,7 @@
+ MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
+ DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
+ MAKEDEPPROG='$(MAKEDEPPROG)' \
++ LDFLAGS='${LDFLAGS}' \
+ SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
+ KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \
+ ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
+--- Makefile.shared
++++ Makefile.shared
+@@ -153,7 +153,7 @@
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+
+-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
++DO_GNU_APP=LDFLAGS="$(LDFLAGS) $(CFLAGS)"
+
+ #This is rather special. It's a special target with which one can link
+ #applications without bothering with any features that have anything to
diff --git a/dev-libs/openssl/files/openssl-1.0.0d-windres.patch b/dev-libs/openssl/files/openssl-1.0.0d-windres.patch
new file mode 100644
index 00000000..0b360d2b
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.0d-windres.patch
@@ -0,0 +1,76 @@
+URL: http://rt.openssl.org/Ticket/Display.html?id=2558&user=guest&pass=guest
+Subject: make windres controllable via build env var settings
+
+atm, the windres code in openssl is only usable via the cross-compile prefix
+option unlike all the other build tools. so add support for the standard $RC
+/ $WINDRES env vars as well.
+
+Index: Configure
+===================================================================
+RCS file: /usr/local/src/openssl/CVSROOT/openssl/Configure,v
+retrieving revision 1.621.2.40
+diff -u -p -r1.621.2.40 Configure
+--- Configure 30 Nov 2010 22:19:26 -0000 1.621.2.40
++++ Configure 4 Jul 2011 23:12:32 -0000
+@@ -1094,6 +1094,7 @@ my $shared_extension = $fields[$idx_shar
+ my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib];
+ my $ar = $ENV{'AR'} || "ar";
+ my $arflags = $fields[$idx_arflags];
++my $windres = $ENV{'RC'} || $ENV{'WINDRES'} || "windres";
+ my $multilib = $fields[$idx_multilib];
+
+ # if $prefix/lib$multilib is not an existing directory, then
+@@ -1511,12 +1512,14 @@ while (<IN>)
+ s/^AR=\s*/AR= \$\(CROSS_COMPILE\)/;
+ s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/;
+ s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/;
++ s/^WINDRES=\s*/WINDRES= \$\(CROSS_COMPILE\)/;
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc";
+ }
+ else {
+ s/^CC=.*$/CC= $cc/;
+ s/^AR=\s*ar/AR= $ar/;
+ s/^RANLIB=.*/RANLIB= $ranlib/;
++ s/^WINDRES=.*/WINDRES= $windres/;
+ s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
+ }
+ s/^CFLAG=.*$/CFLAG= $cflags/;
+Index: Makefile.org
+===================================================================
+RCS file: /usr/local/src/openssl/CVSROOT/openssl/Makefile.org,v
+retrieving revision 1.295.2.10
+diff -u -p -r1.295.2.10 Makefile.org
+--- Makefile.org 27 Jan 2010 16:06:58 -0000 1.295.2.10
++++ Makefile.org 4 Jul 2011 23:13:08 -0000
+@@ -66,6 +66,7 @@ EXE_EXT=
+ ARFLAGS=
+ AR=ar $(ARFLAGS) r
+ RANLIB= ranlib
++WINDRES= windres
+ NM= nm
+ PERL= perl
+ TAR= tar
+@@ -180,6 +181,7 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESS
+ CC='$(CC)' CFLAG='$(CFLAG)' \
+ AS='$(CC)' ASFLAG='$(CFLAG) -c' \
+ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
++ WINDRES='$(WINDRES)' \
+ CROSS_COMPILE='$(CROSS_COMPILE)' \
+ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
+ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
+Index: Makefile.shared
+===================================================================
+RCS file: /usr/local/src/openssl/CVSROOT/openssl/Makefile.shared,v
+retrieving revision 1.72.2.4
+diff -u -p -r1.72.2.4 Makefile.shared
+--- Makefile.shared 21 Aug 2010 11:36:49 -0000 1.72.2.4
++++ Makefile.shared 4 Jul 2011 23:13:52 -0000
+@@ -293,7 +293,7 @@ link_a.cygwin:
+ fi; \
+ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \
+ $(PERL) util/mkrc.pl $$dll_name | \
+- $(CROSS_COMPILE)windres -o rc.o; \
++ $(WINDRES) -o rc.o; \
+ extras="$$extras rc.o"; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
diff --git a/dev-libs/openssl/files/openssl-1.0.0h-pkg-config.patch b/dev-libs/openssl/files/openssl-1.0.0h-pkg-config.patch
new file mode 100644
index 00000000..66fd8220
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.0h-pkg-config.patch
@@ -0,0 +1,34 @@
+https://rt.openssl.org/Ticket/Display.html?id=3332&user=guest&pass=guest
+
+depend on other pc files rather than encoding library info directly in
+every pkg-config file
+
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -335,11 +335,11 @@ libssl.pc: Makefile
+ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
+ echo 'includedir=$${prefix}/include'; \
+ echo ''; \
+- echo 'Name: OpenSSL'; \
++ echo 'Name: OpenSSL-libssl'; \
+ echo 'Description: Secure Sockets Layer and cryptography libraries'; \
+ echo 'Version: '$(VERSION); \
+- echo 'Requires: '; \
+- echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
++ echo 'Requires.private: libcrypto'; \
++ echo 'Libs: -L$${libdir} -lssl'; \
+ echo 'Libs.private: $(EX_LIBS)'; \
+ echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
+
+@@ -352,10 +353,7 @@ openssl.pc: Makefile
+ echo 'Name: OpenSSL'; \
+ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
+ echo 'Version: '$(VERSION); \
+- echo 'Requires: '; \
+- echo 'Libs: -L$${libdir} -lssl -lcrypto'; \
+- echo 'Libs.private: $(EX_LIBS)'; \
+- echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
++ echo 'Requires: libssl libcrypto' ) > openssl.pc
+
+ Makefile: Makefile.org Configure config
+ @echo "Makefile is older than Makefile.org, Configure or config."
diff --git a/dev-libs/openssl/files/openssl-1.0.1-parallel-build.patch b/dev-libs/openssl/files/openssl-1.0.1-parallel-build.patch
new file mode 100644
index 00000000..19f859ab
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1-parallel-build.patch
@@ -0,0 +1,354 @@
+http://rt.openssl.org/Ticket/Display.html?id=2084
+
+--- a/Makefile.org
++++ b/Makefile.org
+@@ -247,17 +247,17 @@
+ build_libs: build_crypto build_ssl build_engines
+
+ build_crypto:
+- @dir=crypto; target=all; $(BUILD_ONE_CMD)
++ +@dir=crypto; target=all; $(BUILD_ONE_CMD)
+-build_ssl:
++build_ssl: build_crypto
+- @dir=ssl; target=all; $(BUILD_ONE_CMD)
++ +@dir=ssl; target=all; $(BUILD_ONE_CMD)
+-build_engines:
++build_engines: build_crypto
+- @dir=engines; target=all; $(BUILD_ONE_CMD)
++ +@dir=engines; target=all; $(BUILD_ONE_CMD)
+-build_apps:
++build_apps: build_libs
+- @dir=apps; target=all; $(BUILD_ONE_CMD)
++ +@dir=apps; target=all; $(BUILD_ONE_CMD)
+-build_tests:
++build_tests: build_libs
+- @dir=test; target=all; $(BUILD_ONE_CMD)
++ +@dir=test; target=all; $(BUILD_ONE_CMD)
+-build_tools:
++build_tools: build_libs
+- @dir=tools; target=all; $(BUILD_ONE_CMD)
++ +@dir=tools; target=all; $(BUILD_ONE_CMD)
+
+ all_testapps: build_libs build_testapps
+ build_testapps:
+@@ -497,9 +497,9 @@
+ dist_pem_h:
+ (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
+
+-install: all install_docs install_sw
++install: install_docs install_sw
+
+-install_sw:
++install_dirs:
+ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
+ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
+ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \
+@@ -508,6 +508,13 @@
+ $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
+ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
+ $(INSTALL_PREFIX)$(OPENSSLDIR)/private
++ @$(PERL) $(TOP)/util/mkdir-p.pl \
++ $(INSTALL_PREFIX)$(MANDIR)/man1 \
++ $(INSTALL_PREFIX)$(MANDIR)/man3 \
++ $(INSTALL_PREFIX)$(MANDIR)/man5 \
++ $(INSTALL_PREFIX)$(MANDIR)/man7
++
++install_sw: install_dirs
+ @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
+ do \
+ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+@@ -511,7 +511,7 @@
+ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
+ done;
+- @set -e; target=install; $(RECURSIVE_BUILD_CMD)
++ +@set -e; target=install; $(RECURSIVE_BUILD_CMD)
+ @set -e; liblist="$(LIBS)"; for i in $$liblist ;\
+ do \
+ if [ -f "$$i" ]; then \
+@@ -593,12 +600,7 @@
+ done; \
+ done
+
+-install_docs:
+- @$(PERL) $(TOP)/util/mkdir-p.pl \
+- $(INSTALL_PREFIX)$(MANDIR)/man1 \
+- $(INSTALL_PREFIX)$(MANDIR)/man3 \
+- $(INSTALL_PREFIX)$(MANDIR)/man5 \
+- $(INSTALL_PREFIX)$(MANDIR)/man7
++install_docs: install_dirs
+ @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \
+ here="`pwd`"; \
+ filecase=; \
+--- a/Makefile.shared
++++ b/Makefile.shared
+@@ -105,6 +105,7 @@ LINK_SO= \
+ SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
++ [ -e $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX ] && exit 0; \
+ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${SHAREDCMD} $${SHAREDFLAGS} \
+ -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \
+@@ -122,6 +124,7 @@ SYMLINK_SO= \
+ done; \
+ fi; \
+ if [ -n "$$SHLIB_SOVER" ]; then \
++ [ -e "$$SHLIB$$SHLIB_SUFFIX" ] || \
+ ( $(SET_X); rm -f $$SHLIB$$SHLIB_SUFFIX; \
+ ln -s $$prev $$SHLIB$$SHLIB_SUFFIX ); \
+ fi; \
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -85,11 +85,11 @@
+ @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
+
+ subdirs:
+- @target=all; $(RECURSIVE_MAKE)
++ +@target=all; $(RECURSIVE_MAKE)
+
+ files:
+ $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
+- @target=files; $(RECURSIVE_MAKE)
++ +@target=files; $(RECURSIVE_MAKE)
+
+ links:
+ @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
+@@ -100,7 +100,7 @@
+ # lib: $(LIB): are splitted to avoid end-less loop
+ lib: $(LIB)
+ @touch lib
+-$(LIB): $(LIBOBJ)
++$(LIB): $(LIBOBJ) | subdirs
+ $(AR) $(LIB) $(LIBOBJ)
+ $(RANLIB) $(LIB) || echo Never mind.
+
+@@ -110,7 +110,7 @@
+ fi
+
+ libs:
+- @target=lib; $(RECURSIVE_MAKE)
++ +@target=lib; $(RECURSIVE_MAKE)
+
+ install:
+ @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+@@ -119,7 +119,7 @@
+ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
+ done;
+- @target=install; $(RECURSIVE_MAKE)
++ +@target=install; $(RECURSIVE_MAKE)
+
+ lint:
+ @target=lint; $(RECURSIVE_MAKE)
+--- a/engines/Makefile
++++ b/engines/Makefile
+@@ -72,7 +72,7 @@
+
+ all: lib subdirs
+
+-lib: $(LIBOBJ)
++lib: $(LIBOBJ) | subdirs
+ @if [ -n "$(SHARED_LIBS)" ]; then \
+ set -e; \
+ for l in $(LIBNAMES); do \
+@@ -89,7 +89,7 @@
+
+ subdirs:
+ echo $(EDIRS)
+- @target=all; $(RECURSIVE_MAKE)
++ +@target=all; $(RECURSIVE_MAKE)
+
+ files:
+ $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
+@@ -128,7 +128,7 @@
+ mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
+ done; \
+ fi
+- @target=install; $(RECURSIVE_MAKE)
++ +@target=install; $(RECURSIVE_MAKE)
+
+ tags:
+ ctags $(SRC)
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -123,7 +123,7 @@
+ tags:
+ ctags $(SRC)
+
+-tests: exe apps $(TESTS)
++tests: exe $(TESTS)
+
+ apps:
+ @(cd ..; $(MAKE) DIRS=apps all)
+@@ -365,109 +365,109 @@
+ link_app.$${shlib_target}
+
+ $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
+- @target=$(RSATEST); $(BUILD_CMD)
++ +@target=$(RSATEST); $(BUILD_CMD)
+
+ $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
+- @target=$(BNTEST); $(BUILD_CMD)
++ +@target=$(BNTEST); $(BUILD_CMD)
+
+ $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
+- @target=$(ECTEST); $(BUILD_CMD)
++ +@target=$(ECTEST); $(BUILD_CMD)
+
+ $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
+- @target=$(EXPTEST); $(BUILD_CMD)
++ +@target=$(EXPTEST); $(BUILD_CMD)
+
+ $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
+- @target=$(IDEATEST); $(BUILD_CMD)
++ +@target=$(IDEATEST); $(BUILD_CMD)
+
+ $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
+- @target=$(MD2TEST); $(BUILD_CMD)
++ +@target=$(MD2TEST); $(BUILD_CMD)
+
+ $(SHATEST)$(EXE_EXT): $(SHATEST).o $(DLIBCRYPTO)
+- @target=$(SHATEST); $(BUILD_CMD)
++ +@target=$(SHATEST); $(BUILD_CMD)
+
+ $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
+- @target=$(SHA1TEST); $(BUILD_CMD)
++ +@target=$(SHA1TEST); $(BUILD_CMD)
+
+ $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
+- @target=$(SHA256TEST); $(BUILD_CMD)
++ +@target=$(SHA256TEST); $(BUILD_CMD)
+
+ $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
+- @target=$(SHA512TEST); $(BUILD_CMD)
++ +@target=$(SHA512TEST); $(BUILD_CMD)
+
+ $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
+- @target=$(RMDTEST); $(BUILD_CMD)
++ +@target=$(RMDTEST); $(BUILD_CMD)
+
+ $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
+- @target=$(MDC2TEST); $(BUILD_CMD)
++ +@target=$(MDC2TEST); $(BUILD_CMD)
+
+ $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
+- @target=$(MD4TEST); $(BUILD_CMD)
++ +@target=$(MD4TEST); $(BUILD_CMD)
+
+ $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
+- @target=$(MD5TEST); $(BUILD_CMD)
++ +@target=$(MD5TEST); $(BUILD_CMD)
+
+ $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
+- @target=$(HMACTEST); $(BUILD_CMD)
++ +@target=$(HMACTEST); $(BUILD_CMD)
+
+ $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
+- @target=$(WPTEST); $(BUILD_CMD)
++ +@target=$(WPTEST); $(BUILD_CMD)
+
+ $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
+- @target=$(RC2TEST); $(BUILD_CMD)
++ +@target=$(RC2TEST); $(BUILD_CMD)
+
+ $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
+- @target=$(BFTEST); $(BUILD_CMD)
++ +@target=$(BFTEST); $(BUILD_CMD)
+
+ $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
+- @target=$(CASTTEST); $(BUILD_CMD)
++ +@target=$(CASTTEST); $(BUILD_CMD)
+
+ $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
+- @target=$(RC4TEST); $(BUILD_CMD)
++ +@target=$(RC4TEST); $(BUILD_CMD)
+
+ $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
+- @target=$(RC5TEST); $(BUILD_CMD)
++ +@target=$(RC5TEST); $(BUILD_CMD)
+
+ $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
+- @target=$(DESTEST); $(BUILD_CMD)
++ +@target=$(DESTEST); $(BUILD_CMD)
+
+ $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
+- @target=$(RANDTEST); $(BUILD_CMD)
++ +@target=$(RANDTEST); $(BUILD_CMD)
+
+ $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
+- @target=$(DHTEST); $(BUILD_CMD)
++ +@target=$(DHTEST); $(BUILD_CMD)
+
+ $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
+- @target=$(DSATEST); $(BUILD_CMD)
++ +@target=$(DSATEST); $(BUILD_CMD)
+
+ $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
+- @target=$(METHTEST); $(BUILD_CMD)
++ +@target=$(METHTEST); $(BUILD_CMD)
+
+ $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
+- @target=$(SSLTEST); $(FIPS_BUILD_CMD)
++ +@target=$(SSLTEST); $(FIPS_BUILD_CMD)
+
+ $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
+- @target=$(ENGINETEST); $(BUILD_CMD)
++ +@target=$(ENGINETEST); $(BUILD_CMD)
+
+ $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
+- @target=$(EVPTEST); $(BUILD_CMD)
++ +@target=$(EVPTEST); $(BUILD_CMD)
+
+ $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
+- @target=$(ECDSATEST); $(BUILD_CMD)
++ +@target=$(ECDSATEST); $(BUILD_CMD)
+
+ $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
+- @target=$(ECDHTEST); $(BUILD_CMD)
++ +@target=$(ECDHTEST); $(BUILD_CMD)
+
+ $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
+- @target=$(IGETEST); $(BUILD_CMD)
++ +@target=$(IGETEST); $(BUILD_CMD)
+
+ $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO)
+- @target=$(JPAKETEST); $(BUILD_CMD)
++ +@target=$(JPAKETEST); $(BUILD_CMD)
+
+ $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO)
+- @target=$(ASN1TEST); $(BUILD_CMD)
++ +@target=$(ASN1TEST); $(BUILD_CMD)
+
+ $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
+- @target=$(SRPTEST); $(BUILD_CMD)
++ +@target=$(SRPTEST); $(BUILD_CMD)
+
+ #$(AESTEST).o: $(AESTEST).c
+ # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c
+@@ -480,7 +480,7 @@
+ # fi
+
+ dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
+- @target=dummytest; $(BUILD_CMD)
++ +@target=dummytest; $(BUILD_CMD)
+
+ # DO NOT DELETE THIS LINE -- make depend depends on it.
+
+--- a/crypto/objects/Makefile
++++ b/crypto/objects/Makefile
+@@ -44,11 +44,11 @@ obj_dat.h: obj_dat.pl obj_mac.h
+ # objects.pl both reads and writes obj_mac.num
+ obj_mac.h: objects.pl objects.txt obj_mac.num
+ $(PERL) objects.pl objects.txt obj_mac.num obj_mac.h
+- @sleep 1; touch obj_mac.h; sleep 1
+
+-obj_xref.h: objxref.pl obj_xref.txt obj_mac.num
++# This doesn't really need obj_mac.h, but since that rule reads & writes
++# obj_mac.num, we can't run in parallel with it.
++obj_xref.h: objxref.pl obj_xref.txt obj_mac.num obj_mac.h
+ $(PERL) objxref.pl obj_mac.num obj_xref.txt > obj_xref.h
+- @sleep 1; touch obj_xref.h; sleep 1
+
+ files:
+ $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
diff --git a/dev-libs/openssl/files/openssl-1.0.1-x32.patch b/dev-libs/openssl/files/openssl-1.0.1-x32.patch
new file mode 100644
index 00000000..5106cb6e
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1-x32.patch
@@ -0,0 +1,79 @@
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=51bfed2e26fc13a66e8b5710aa2ce1d7a04af721
+
+UpstreamStatus: Pending
+
+Received from H J Liu @ Intel
+Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13
+
+ported the patch to the 1.0.0e version
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
+Index: openssl-1.0.0e/Configure
+===================================================================
+--- openssl-1.0.0e.orig/Configure
++++ openssl-1.0.0e/Configure
+@@ -393,6 +393,7 @@ my %table=(
+ "debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
++"linux-x32", "gcc:-DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "dist", "cc:-O::(unknown)::::::",
+
+ # Basic configs that should work on any (32 and less bit) box
+Index: openssl-1.0.0e/crypto/bn/asm/x86_64-gcc.c
+===================================================================
+--- openssl-1.0.0e.orig/crypto/bn/asm/x86_64-gcc.c
++++ openssl-1.0.0e/crypto/bn/asm/x86_64-gcc.c
+@@ -55,7 +55,7 @@
+ * machine.
+ */
+
+-#ifdef _WIN64
++#if defined _WIN64 || !defined __LP64__
+ #define BN_ULONG unsigned long long
+ #else
+ #define BN_ULONG unsigned long
+@@ -192,9 +192,9 @@ BN_ULONG bn_add_words (BN_ULONG *rp, con
+ asm (
+ " subq %2,%2 \n"
+ ".p2align 4 \n"
+- "1: movq (%4,%2,8),%0 \n"
+- " adcq (%5,%2,8),%0 \n"
+- " movq %0,(%3,%2,8) \n"
++ "1: movq (%q4,%2,8),%0 \n"
++ " adcq (%q5,%2,8),%0 \n"
++ " movq %0,(%q3,%2,8) \n"
+ " leaq 1(%2),%2 \n"
+ " loop 1b \n"
+ " sbbq %0,%0 \n"
+@@ -215,9 +215,9 @@ BN_ULONG bn_sub_words (BN_ULONG *rp, con
+ asm (
+ " subq %2,%2 \n"
+ ".p2align 4 \n"
+- "1: movq (%4,%2,8),%0 \n"
+- " sbbq (%5,%2,8),%0 \n"
+- " movq %0,(%3,%2,8) \n"
++ "1: movq (%q4,%2,8),%0 \n"
++ " sbbq (%q5,%2,8),%0 \n"
++ " movq %0,(%q3,%2,8) \n"
+ " leaq 1(%2),%2 \n"
+ " loop 1b \n"
+ " sbbq %0,%0 \n"
+Index: openssl-1.0.0e/crypto/bn/bn.h
+===================================================================
+--- openssl-1.0.0e.orig/crypto/bn/bn.h
++++ openssl-1.0.0e/crypto/bn/bn.h
+@@ -172,6 +172,13 @@ extern "C" {
+ # endif
+ #endif
+
++/* Address type. */
++#ifdef _WIN64
++#define BN_ADDR unsigned long long
++#else
++#define BN_ADDR unsigned long
++#endif
++
+ /* assuming long is 64bit - this is the DEC Alpha
+ * unsigned long long is only 64 bits :-(, don't define
+ * BN_LLONG for the DEC Alpha */
diff --git a/dev-libs/openssl/files/openssl-1.0.1c-force-termios.patch b/dev-libs/openssl/files/openssl-1.0.1c-force-termios.patch
new file mode 100644
index 00000000..79519539
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1c-force-termios.patch
@@ -0,0 +1,69 @@
+diff -Nuar openssl-1.0.1c.orig/crypto/ui/ui_openssl.c openssl-1.0.1c/crypto/ui/ui_openssl.c
+--- openssl-1.0.1c.orig/crypto/ui/ui_openssl.c 2012-02-11 23:38:49.000000000 +0000
++++ openssl-1.0.1c/crypto/ui/ui_openssl.c 2013-07-06 14:40:50.642615149 +0000
+@@ -178,65 +178,11 @@
+ * TERMIO, TERMIOS, VMS, MSDOS and SGTTY
+ */
+
+-#if defined(__sgi) && !defined(TERMIOS)
+-# define TERMIOS
+-# undef TERMIO
+-# undef SGTTY
+-#endif
+-
+-#if defined(linux) && !defined(TERMIO)
+-# undef TERMIOS
+-# define TERMIO
+-# undef SGTTY
+-#endif
+-
+-#ifdef _LIBC
+-# undef TERMIOS
+-# define TERMIO
+-# undef SGTTY
+-#endif
+-
+-#if !defined(TERMIO) && !defined(TERMIOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(MAC_OS_GUSI_SOURCE)
+-# undef TERMIOS
+-# undef TERMIO
+-# define SGTTY
+-#endif
+-
+-#if defined(OPENSSL_SYS_VXWORKS)
+-#undef TERMIOS
+-#undef TERMIO
+-#undef SGTTY
+-#endif
+-
+-#if defined(OPENSSL_SYS_NETWARE)
+-#undef TERMIOS
+-#undef TERMIO
+-#undef SGTTY
+-#endif
+-
+-#ifdef TERMIOS
+ # include <termios.h>
+ # define TTY_STRUCT struct termios
+ # define TTY_FLAGS c_lflag
+ # define TTY_get(tty,data) tcgetattr(tty,data)
+ # define TTY_set(tty,data) tcsetattr(tty,TCSANOW,data)
+-#endif
+-
+-#ifdef TERMIO
+-# include <termio.h>
+-# define TTY_STRUCT struct termio
+-# define TTY_FLAGS c_lflag
+-# define TTY_get(tty,data) ioctl(tty,TCGETA,data)
+-# define TTY_set(tty,data) ioctl(tty,TCSETA,data)
+-#endif
+-
+-#ifdef SGTTY
+-# include <sgtty.h>
+-# define TTY_STRUCT struct sgttyb
+-# define TTY_FLAGS sg_flags
+-# define TTY_get(tty,data) ioctl(tty,TIOCGETP,data)
+-# define TTY_set(tty,data) ioctl(tty,TIOCSETP,data)
+-#endif
+
+ #if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && !defined(OPENSSL_SYS_SUNOS)
+ # include <sys/ioctl.h>
diff --git a/dev-libs/openssl/files/openssl-1.0.1e-s_client-verify.patch b/dev-libs/openssl/files/openssl-1.0.1e-s_client-verify.patch
new file mode 100644
index 00000000..03e4f599
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1e-s_client-verify.patch
@@ -0,0 +1,18 @@
+https://bugs.gentoo.org/472584
+http://rt.openssl.org/Ticket/Display.html?id=2387&user=guest&pass=guest
+
+fix verification handling in s_client. when loading paths, make sure
+we properly fallback to setting the default paths.
+
+--- a/apps/s_client.c
++++ b/apps/s_client.c
+@@ -899,7 +899,7 @@
+ if (!set_cert_key_stuff(ctx,cert,key))
+ goto end;
+
+- if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) ||
++ if ((!SSL_CTX_load_verify_locations(ctx,CAfile,CApath)) &&
+ (!SSL_CTX_set_default_verify_paths(ctx)))
+ {
+ /* BIO_printf(bio_err,"error setting default verify locations\n"); */
+
diff --git a/dev-libs/openssl/files/openssl-1.0.1f-revert-alpha-perl-generation.patch b/dev-libs/openssl/files/openssl-1.0.1f-revert-alpha-perl-generation.patch
new file mode 100644
index 00000000..1a942d27
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1f-revert-alpha-perl-generation.patch
@@ -0,0 +1,84 @@
+https://bugs.gentoo.org/499086
+https://rt.openssl.org/Ticket/Display.html?id=3333&user=guest&pass=guest
+
+when gcc is given a .s file and told to preprocess it, it outputs nothing
+
+From a2976461784ce463fc7f336cd0dce607d21c2fad Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 25 Jan 2014 05:44:47 -0500
+Subject: [PATCH] Revert "Make Makefiles OSF-make-friendly."
+
+This reverts commit d1cf23ac86c05b22b8780e2c03b67230564d2d34.
+---
+ crypto/Makefile | 4 +---
+ crypto/bn/Makefile | 4 +---
+ crypto/evp/Makefile | 2 +-
+ crypto/modes/Makefile | 5 +----
+ crypto/sha/Makefile | 4 +---
+ util/shlib_wrap.sh | 6 +-----
+ 6 files changed, 6 insertions(+), 19 deletions(-)
+
+diff --git a/crypto/Makefile b/crypto/Makefile
+index b253f50..1de9d5f 100644
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -86,9 +86,7 @@ ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@
+ ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
+ pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
+ alphacpuid.s: alphacpuid.pl
+- (preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
+- $(PERL) alphacpuid.pl > $$preproc && \
+- $(CC) -E $$preproc > $@ && rm $$preproc)
++ $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
+
+ subdirs:
+ @target=all; $(RECURSIVE_MAKE)
+diff --git a/crypto/bn/Makefile b/crypto/bn/Makefile
+index b62b676..6c03363 100644
+--- a/crypto/bn/Makefile
++++ b/crypto/bn/Makefile
+@@ -136,9 +136,7 @@ ppc-mont.s: asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@
+ ppc64-mont.s: asm/ppc64-mont.pl;$(PERL) asm/ppc64-mont.pl $(PERLASM_SCHEME) $@
+
+ alpha-mont.s: asm/alpha-mont.pl
+- (preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
+- $(PERL) asm/alpha-mont.pl > $$preproc && \
+- $(CC) -E $$preproc > $@ && rm $$preproc)
++ $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
+
+ # GNU make "catch all"
+ %-mont.S: asm/%-mont.pl; $(PERL) $< $(PERLASM_SCHEME) $@
+diff --git a/crypto/modes/Makefile b/crypto/modes/Makefile
+index ce0dcd6..88ac65e 100644
+--- a/crypto/modes/Makefile
++++ b/crypto/modes/Makefile
+@@ -55,10 +55,7 @@ aesni-gcm-x86_64.s: asm/aesni-gcm-x86_64.pl
+ ghash-sparcv9.s: asm/ghash-sparcv9.pl
+ $(PERL) asm/ghash-sparcv9.pl $@ $(CFLAGS)
+ ghash-alpha.s: asm/ghash-alpha.pl
+- (preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
+- $(PERL) asm/ghash-alpha.pl > $$preproc && \
+- $(CC) -E $$preproc > $@ && rm $$preproc)
+-
++ $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
+ ghash-parisc.s: asm/ghash-parisc.pl
+ $(PERL) asm/ghash-parisc.pl $(PERLASM_SCHEME) $@
+
+diff --git a/crypto/sha/Makefile b/crypto/sha/Makefile
+index 64eab6c..63fba69 100644
+--- a/crypto/sha/Makefile
++++ b/crypto/sha/Makefile
+@@ -60,9 +60,7 @@ sha256-armv4.S: asm/sha256-armv4.pl
+ $(PERL) $< $(PERLASM_SCHEME) $@
+
+ sha1-alpha.s: asm/sha1-alpha.pl
+- (preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
+- $(PERL) asm/sha1-alpha.pl > $$preproc && \
+- $(CC) -E $$preproc > $@ && rm $$preproc)
++ $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
+
+ # Solaris make has to be explicitly told
+ sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@
+--
+1.8.5.3
+
diff --git a/dev-libs/openssl/files/openssl-1.0.1h-ipv6.patch b/dev-libs/openssl/files/openssl-1.0.1h-ipv6.patch
new file mode 100644
index 00000000..10c1ba22
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1h-ipv6.patch
@@ -0,0 +1,642 @@
+http://rt.openssl.org/Ticket/Display.html?id=2051&user=guest&pass=guest
+
+Forward ported from openssl-1.0.1e-ipv6.patch
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+
+--- openssl-1.0.1h/apps/s_apps.h
++++ openssl-1.0.1h/apps/s_apps.h
+@@ -148,7 +148,7 @@
+ #define PORT_STR "4433"
+ #define PROTOCOL "tcp"
+
+-int do_server(int port, int type, int *ret, int (*cb) (char *hostname, int s, unsigned char *context), unsigned char *context);
++int do_server(int port, int type, int *ret, int (*cb) (char *hostname, int s, unsigned char *context), unsigned char *context, int use_ipv4, int use_ipv6);
+ #ifdef HEADER_X509_H
+ int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
+ #endif
+@@ -156,7 +156,7 @@
+ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file);
+ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key);
+ #endif
+-int init_client(int *sock, char *server, int port, int type);
++int init_client(int *sock, char *server, int port, int type, int use_ipv4, int use_ipv6);
+ int should_retry(int i);
+ int extract_port(char *str, short *port_ptr);
+ int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
+--- openssl-1.0.1h/apps/s_client.c
++++ openssl-1.0.1h/apps/s_client.c
+@@ -285,6 +285,10 @@
+ {
+ BIO_printf(bio_err,"usage: s_client args\n");
+ BIO_printf(bio_err,"\n");
++ BIO_printf(bio_err," -4 - use IPv4 only\n");
++#if OPENSSL_USE_IPV6
++ BIO_printf(bio_err," -6 - use IPv6 only\n");
++#endif
+ BIO_printf(bio_err," -host host - use -connect instead\n");
+ BIO_printf(bio_err," -port port - use -connect instead\n");
+ BIO_printf(bio_err," -connect host:port - who to connect to (default is %s:%s)\n",SSL_HOST_NAME,PORT_STR);
+@@ -568,6 +572,7 @@
+ int sbuf_len,sbuf_off;
+ fd_set readfds,writefds;
+ short port=PORT;
++ int use_ipv4, use_ipv6;
+ int full_log=1;
+ char *host=SSL_HOST_NAME;
+ char *cert_file=NULL,*key_file=NULL;
+@@ -613,7 +618,11 @@
+ #endif
+ char *sess_in = NULL;
+ char *sess_out = NULL;
+- struct sockaddr peer;
++#if OPENSSL_USE_IPV6
++ struct sockaddr_storage peer;
++#else
++ struct sockaddr_in peer;
++#endif
+ int peerlen = sizeof(peer);
+ int enable_timeouts = 0 ;
+ long socket_mtu = 0;
+@@ -628,6 +637,12 @@
+
+ meth=SSLv23_client_method();
+
++ use_ipv4 = 1;
++#if OPENSSL_USE_IPV6
++ use_ipv6 = 1;
++#else
++ use_ipv6 = 0;
++#endif
+ apps_startup();
+ c_Pause=0;
+ c_quiet=0;
+@@ -949,6 +964,18 @@
+ jpake_secret = *++argv;
+ }
+ #endif
++ else if (strcmp(*argv,"-4") == 0)
++ {
++ use_ipv4 = 1;
++ use_ipv6 = 0;
++ }
++#if OPENSSL_USE_IPV6
++ else if (strcmp(*argv,"-6") == 0)
++ {
++ use_ipv4 = 0;
++ use_ipv6 = 1;
++ }
++#endif
+ #ifndef OPENSSL_NO_SRTP
+ else if (strcmp(*argv,"-use_srtp") == 0)
+ {
+@@ -1260,7 +1287,7 @@
+
+ re_start:
+
+- if (init_client(&s,host,port,socket_type) == 0)
++ if (init_client(&s,host,port,socket_type,use_ipv4,use_ipv6) == 0)
+ {
+ BIO_printf(bio_err,"connect:errno=%d\n",get_last_socket_error());
+ SHUTDOWN(s);
+@@ -1286,7 +1313,7 @@
+ {
+
+ sbio=BIO_new_dgram(s,BIO_NOCLOSE);
+- if (getsockname(s, &peer, (void *)&peerlen) < 0)
++ if (getsockname(s, (struct sockaddr *)&peer, (void *)&peerlen) < 0)
+ {
+ BIO_printf(bio_err, "getsockname:errno=%d\n",
+ get_last_socket_error());
+--- openssl-1.0.1h/apps/s_server.c
++++ openssl-1.0.1h/apps/s_server.c
+@@ -560,6 +560,10 @@
+ BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
+ # endif
+ #endif
++ BIO_printf(bio_err," -4 - use IPv4 only\n");
++#if OPENSSL_USE_IPV6
++ BIO_printf(bio_err," -6 - use IPv6 only\n");
++#endif
+ BIO_printf(bio_err," -keymatexport label - Export keying material using label\n");
+ BIO_printf(bio_err," -keymatexportlen len - Export len bytes of keying material (default 20)\n");
+ }
+@@ -947,6 +951,7 @@
+ int state=0;
+ const SSL_METHOD *meth=NULL;
+ int socket_type=SOCK_STREAM;
++ int use_ipv4, use_ipv6;
+ ENGINE *e=NULL;
+ char *inrand=NULL;
+ int s_cert_format = FORMAT_PEM, s_key_format = FORMAT_PEM;
+@@ -975,6 +980,12 @@
+ #endif
+ meth=SSLv23_server_method();
+
++ use_ipv4 = 1;
++#if OPENSSL_USE_IPV6
++ use_ipv6 = 1;
++#else
++ use_ipv6 = 0;
++#endif
+ local_argc=argc;
+ local_argv=argv;
+
+@@ -1323,6 +1334,18 @@
+ jpake_secret = *(++argv);
+ }
+ #endif
++ else if (strcmp(*argv,"-4") == 0)
++ {
++ use_ipv4 = 1;
++ use_ipv6 = 0;
++ }
++#if OPENSSL_USE_IPV6
++ else if (strcmp(*argv,"-6") == 0)
++ {
++ use_ipv4 = 0;
++ use_ipv6 = 1;
++ }
++#endif
+ #ifndef OPENSSL_NO_SRTP
+ else if (strcmp(*argv,"-use_srtp") == 0)
+ {
+@@ -1881,9 +1904,9 @@
+ BIO_printf(bio_s_out,"ACCEPT\n");
+ (void)BIO_flush(bio_s_out);
+ if (www)
+- do_server(port,socket_type,&accept_socket,www_body, context);
++ do_server(port,socket_type,&accept_socket,www_body, context, use_ipv4, use_ipv6);
+ else
+- do_server(port,socket_type,&accept_socket,sv_body, context);
++ do_server(port,socket_type,&accept_socket,sv_body, context, use_ipv4, use_ipv6);
+ print_stats(bio_s_out,ctx);
+ ret=0;
+ end:
+--- openssl-1.0.1h/apps/s_socket.c
++++ openssl-1.0.1h/apps/s_socket.c
+@@ -97,16 +97,16 @@
+ #include "netdb.h"
+ #endif
+
+-static struct hostent *GetHostByName(char *name);
++static struct hostent *GetHostByName(char *name, int domain);
+ #if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
+ static void ssl_sock_cleanup(void);
+ #endif
+ static int ssl_sock_init(void);
+-static int init_client_ip(int *sock,unsigned char ip[4], int port, int type);
+-static int init_server(int *sock, int port, int type);
+-static int init_server_long(int *sock, int port,char *ip, int type);
++static int init_client_ip(int *sock,unsigned char *ip, int port, int type, int domain);
++static int init_server(int *sock, int port, int type, int use_ipv4, int use_ipv6);
++static int init_server_long(int *sock, int port,char *ip, int type, int use_ipv4, int use_ipv6);
+ static int do_accept(int acc_sock, int *sock, char **host);
+-static int host_ip(char *str, unsigned char ip[4]);
++static int host_ip(char *str, unsigned char *ip, int domain);
+
+ #ifdef OPENSSL_SYS_WIN16
+ #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
+@@ -234,38 +234,68 @@
+ return(1);
+ }
+
+-int init_client(int *sock, char *host, int port, int type)
++int init_client(int *sock, char *host, int port, int type, int use_ipv4, int use_ipv6)
+ {
++#if OPENSSL_USE_IPV6
++ unsigned char ip[16];
++#else
+ unsigned char ip[4];
++#endif
+
+- memset(ip, '\0', sizeof ip);
+- if (!host_ip(host,&(ip[0])))
+- return 0;
+- return init_client_ip(sock,ip,port,type);
+- }
+-
+-static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
+- {
+- unsigned long addr;
++ if (use_ipv4)
++ if (host_ip(host,ip,AF_INET))
++ return(init_client_ip(sock,ip,port,type,AF_INET));
++#if OPENSSL_USE_IPV6
++ if (use_ipv6)
++ if (host_ip(host,ip,AF_INET6))
++ return(init_client_ip(sock,ip,port,type,AF_INET6));
++#endif
++ return 0;
++ }
++
++static int init_client_ip(int *sock, unsigned char ip[4], int port, int type, int domain)
++ {
++#if OPENSSL_USE_IPV6
++ struct sockaddr_storage them;
++ struct sockaddr_in *them_in = (struct sockaddr_in *)&them;
++ struct sockaddr_in6 *them_in6 = (struct sockaddr_in6 *)&them;
++#else
+ struct sockaddr_in them;
++ struct sockaddr_in *them_in = &them;
++#endif
++ socklen_t addr_len;
+ int s,i;
+
+ if (!ssl_sock_init()) return(0);
+
+ memset((char *)&them,0,sizeof(them));
+- them.sin_family=AF_INET;
+- them.sin_port=htons((unsigned short)port);
+- addr=(unsigned long)
+- ((unsigned long)ip[0]<<24L)|
+- ((unsigned long)ip[1]<<16L)|
+- ((unsigned long)ip[2]<< 8L)|
+- ((unsigned long)ip[3]);
+- them.sin_addr.s_addr=htonl(addr);
++ if (domain == AF_INET)
++ {
++ addr_len = (socklen_t)sizeof(struct sockaddr_in);
++ them_in->sin_family=AF_INET;
++ them_in->sin_port=htons((unsigned short)port);
++#ifndef BIT_FIELD_LIMITS
++ memcpy(&them_in->sin_addr.s_addr, ip, 4);
++#else
++ memcpy(&them_in->sin_addr, ip, 4);
++#endif
++ }
++ else
++#if OPENSSL_USE_IPV6
++ {
++ addr_len = (socklen_t)sizeof(struct sockaddr_in6);
++ them_in6->sin6_family=AF_INET6;
++ them_in6->sin6_port=htons((unsigned short)port);
++ memcpy(&(them_in6->sin6_addr), ip, sizeof(struct in6_addr));
++ }
++#else
++ return(0);
++#endif
+
+ if (type == SOCK_STREAM)
+- s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
++ s=socket(domain,SOCK_STREAM,SOCKET_PROTOCOL);
+ else /* ( type == SOCK_DGRAM) */
+- s=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
++ s=socket(domain,SOCK_DGRAM,IPPROTO_UDP);
+
+ if (s == INVALID_SOCKET) { perror("socket"); return(0); }
+
+@@ -277,29 +307,27 @@
+ if (i < 0) { closesocket(s); perror("keepalive"); return(0); }
+ }
+ #endif
+-
+- if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1)
++ if (connect(s,(struct sockaddr *)&them,addr_len) == -1)
+ { closesocket(s); perror("connect"); return(0); }
+ *sock=s;
+ return(1);
+ }
+
+-int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, unsigned char *context), unsigned char *context)
++int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, unsigned char *context), unsigned char *context, int use_ipv4, int use_ipv6)
+ {
+ int sock;
+ char *name = NULL;
+ int accept_socket = 0;
+ int i;
+
+- if (!init_server(&accept_socket,port,type)) return(0);
+-
++ if (!init_server(&accept_socket,port,type, use_ipv4, use_ipv6)) return(0);
+ if (ret != NULL)
+ {
+ *ret=accept_socket;
+ /* return(1);*/
+ }
+- for (;;)
+- {
++ for (;;)
++ {
+ if (type==SOCK_STREAM)
+ {
+ if (do_accept(accept_socket,&sock,&name) == 0)
+@@ -322,41 +350,88 @@
+ }
+ }
+
+-static int init_server_long(int *sock, int port, char *ip, int type)
++static int init_server_long(int *sock, int port, char *ip, int type, int use_ipv4, int use_ipv6)
+ {
+ int ret=0;
++ int domain;
++#if OPENSSL_USE_IPV6
++ struct sockaddr_storage server;
++ struct sockaddr_in *server_in = (struct sockaddr_in *)&server;
++ struct sockaddr_in6 *server_in6 = (struct sockaddr_in6 *)&server;
++#else
+ struct sockaddr_in server;
++ struct sockaddr_in *server_in = &server;
++#endif
++ socklen_t addr_len;
+ int s= -1;
+
++ if (!use_ipv4 && !use_ipv6)
++ goto err;
++#if OPENSSL_USE_IPV6
++ /* we are fine here */
++#else
++ if (use_ipv6)
++ goto err;
++#endif
+ if (!ssl_sock_init()) return(0);
+
+- memset((char *)&server,0,sizeof(server));
+- server.sin_family=AF_INET;
+- server.sin_port=htons((unsigned short)port);
+- if (ip == NULL)
+- server.sin_addr.s_addr=INADDR_ANY;
+- else
+-/* Added for T3E, address-of fails on bit field (beckman@acl.lanl.gov) */
+-#ifndef BIT_FIELD_LIMITS
+- memcpy(&server.sin_addr.s_addr,ip,4);
++#if OPENSSL_USE_IPV6
++ domain = use_ipv6 ? AF_INET6 : AF_INET;
+ #else
+- memcpy(&server.sin_addr,ip,4);
++ domain = AF_INET;
+ #endif
+-
+- if (type == SOCK_STREAM)
+- s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
+- else /* type == SOCK_DGRAM */
+- s=socket(AF_INET, SOCK_DGRAM,IPPROTO_UDP);
++ if (type == SOCK_STREAM)
++ s=socket(domain,SOCK_STREAM,SOCKET_PROTOCOL);
++ else /* type == SOCK_DGRAM */
++ s=socket(domain, SOCK_DGRAM,IPPROTO_UDP);
+
+ if (s == INVALID_SOCKET) goto err;
+ #if defined SOL_SOCKET && defined SO_REUSEADDR
++ {
++ int j = 1;
++ setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
++ (void *) &j, sizeof j);
++ }
++#endif
++#if OPENSSL_USE_IPV6
++ if ((use_ipv4 == 0) && (use_ipv6 == 1))
++ {
++ const int on = 1;
++
++ setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
++ (const void *) &on, sizeof(int));
++ }
++#endif
++ if (domain == AF_INET)
++ {
++ addr_len = (socklen_t)sizeof(struct sockaddr_in);
++ memset(server_in, 0, sizeof(struct sockaddr_in));
++ server_in->sin_family=AF_INET;
++ server_in->sin_port = htons((unsigned short)port);
++ if (ip == NULL)
++ server_in->sin_addr.s_addr = htonl(INADDR_ANY);
++ else
++/* Added for T3E, address-of fails on bit field (beckman@acl.lanl.gov) */
++#ifndef BIT_FIELD_LIMITS
++ memcpy(&server_in->sin_addr.s_addr, ip, 4);
++#else
++ memcpy(&server_in->sin_addr, ip, 4);
++#endif
++ }
++#if OPENSSL_USE_IPV6
++ else
+ {
+- int j = 1;
+- setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+- (void *) &j, sizeof j);
++ addr_len = (socklen_t)sizeof(struct sockaddr_in6);
++ memset(server_in6, 0, sizeof(struct sockaddr_in6));
++ server_in6->sin6_family = AF_INET6;
++ server_in6->sin6_port = htons((unsigned short)port);
++ if (ip == NULL)
++ server_in6->sin6_addr = in6addr_any;
++ else
++ memcpy(&server_in6->sin6_addr, ip, sizeof(struct in6_addr));
+ }
+ #endif
+- if (bind(s,(struct sockaddr *)&server,sizeof(server)) == -1)
++ if (bind(s, (struct sockaddr *)&server, addr_len) == -1)
+ {
+ #ifndef OPENSSL_SYS_WINDOWS
+ perror("bind");
+@@ -375,16 +450,23 @@
+ return(ret);
+ }
+
+-static int init_server(int *sock, int port, int type)
++static int init_server(int *sock, int port, int type, int use_ipv4, int use_ipv6)
+ {
+- return(init_server_long(sock, port, NULL, type));
++ return(init_server_long(sock, port, NULL, type, use_ipv4, use_ipv6));
+ }
+
+ static int do_accept(int acc_sock, int *sock, char **host)
+ {
+ int ret;
+ struct hostent *h1,*h2;
+- static struct sockaddr_in from;
++#if OPENSSL_USE_IPV6
++ struct sockaddr_storage from;
++ struct sockaddr_in *from_in = (struct sockaddr_in *)&from;
++ struct sockaddr_in6 *from_in6 = (struct sockaddr_in6 *)&from;
++#else
++ struct sockaddr_in from;
++ struct sockaddr_in *from_in = &from;
++#endif
+ int len;
+ /* struct linger ling; */
+
+@@ -431,13 +513,23 @@
+ */
+
+ if (host == NULL) goto end;
++#if OPENSSL_USE_IPV6
++ if (from.ss_family == AF_INET)
++#else
++ if (from.sin_family == AF_INET)
++#endif
+ #ifndef BIT_FIELD_LIMITS
+- /* I should use WSAAsyncGetHostByName() under windows */
+- h1=gethostbyaddr((char *)&from.sin_addr.s_addr,
+- sizeof(from.sin_addr.s_addr),AF_INET);
++ /* I should use WSAAsyncGetHostByName() under windows */
++ h1=gethostbyaddr((char *)&from_in->sin_addr.s_addr,
++ sizeof(from_in->sin_addr.s_addr), AF_INET);
+ #else
+- h1=gethostbyaddr((char *)&from.sin_addr,
+- sizeof(struct in_addr),AF_INET);
++ h1=gethostbyaddr((char *)&from_in->sin_addr,
++ sizeof(struct in_addr), AF_INET);
++#endif
++#if OPENSSL_USE_IPV6
++ else
++ h1=gethostbyaddr((char *)&from_in6->sin6_addr,
++ sizeof(struct in6_addr), AF_INET6);
+ #endif
+ if (h1 == NULL)
+ {
+@@ -455,16 +547,25 @@
+ }
+ BUF_strlcpy(*host,h1->h_name,strlen(h1->h_name)+1);
+
+- h2=GetHostByName(*host);
++#if OPENSSL_USE_IPV6
++ h2=GetHostByName(*host, from.ss_family);
++#else
++ h2=GetHostByName(*host, from.sin_family);
++#endif
++
+ if (h2 == NULL)
+ {
+ BIO_printf(bio_err,"gethostbyname failure\n");
+ closesocket(ret);
+ return(0);
+ }
+- if (h2->h_addrtype != AF_INET)
++#if OPENSSL_USE_IPV6
++ if (h2->h_addrtype != from.ss_family)
++#else
++ if (h2->h_addrtype != from.sin_family)
++#endif
+ {
+- BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
++ BIO_printf(bio_err,"gethostbyname addr address is not correct\n");
+ closesocket(ret);
+ return(0);
+ }
+@@ -480,7 +581,7 @@
+ char *h,*p;
+
+ h=str;
+- p=strchr(str,':');
++ p=strrchr(str,':');
+ if (p == NULL)
+ {
+ BIO_printf(bio_err,"no port defined\n");
+@@ -488,7 +589,7 @@
+ }
+ *(p++)='\0';
+
+- if ((ip != NULL) && !host_ip(str,ip))
++ if ((ip != NULL) && !host_ip(str,ip,AF_INET))
+ goto err;
+ if (host_ptr != NULL) *host_ptr=h;
+
+@@ -499,48 +600,58 @@
+ return(0);
+ }
+
+-static int host_ip(char *str, unsigned char ip[4])
++static int host_ip(char *str, unsigned char *ip, int domain)
+ {
+- unsigned int in[4];
++ unsigned int in[4];
++ unsigned long l;
+ int i;
+
+- if (sscanf(str,"%u.%u.%u.%u",&(in[0]),&(in[1]),&(in[2]),&(in[3])) == 4)
++ if ((domain == AF_INET) &&
++ (sscanf(str,"%u.%u.%u.%u",&(in[0]),&(in[1]),&(in[2]),&(in[3])) == 4))
+ {
++
+ for (i=0; i<4; i++)
+ if (in[i] > 255)
+ {
+ BIO_printf(bio_err,"invalid IP address\n");
+ goto err;
+ }
+- ip[0]=in[0];
+- ip[1]=in[1];
+- ip[2]=in[2];
+- ip[3]=in[3];
+- }
++ l=htonl((in[0]<<24L)|(in[1]<<16L)|(in[2]<<8L)|in[3]);
++ memcpy(ip, &l, 4);
++ return 1;
++ }
++#if OPENSSL_USE_IPV6
++ else if ((domain == AF_INET6) &&
++ (inet_pton(AF_INET6, str, ip) == 1))
++ return 1;
++#endif
+ else
+ { /* do a gethostbyname */
+ struct hostent *he;
+
+ if (!ssl_sock_init()) return(0);
+
+- he=GetHostByName(str);
++ he=GetHostByName(str,domain);
+ if (he == NULL)
+ {
+ BIO_printf(bio_err,"gethostbyname failure\n");
+ goto err;
+ }
+ /* cast to short because of win16 winsock definition */
+- if ((short)he->h_addrtype != AF_INET)
++ if ((short)he->h_addrtype != domain)
+ {
+- BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
++ BIO_printf(bio_err,"gethostbyname addr family is not correct\n");
+ return(0);
+ }
+- ip[0]=he->h_addr_list[0][0];
+- ip[1]=he->h_addr_list[0][1];
+- ip[2]=he->h_addr_list[0][2];
+- ip[3]=he->h_addr_list[0][3];
++ if (domain == AF_INET)
++ memset(ip, 0, 4);
++#if OPENSSL_USE_IPV6
++ else
++ memset(ip, 0, 16);
++#endif
++ memcpy(ip, he->h_addr_list[0], he->h_length);
++ return 1;
+ }
+- return(1);
+ err:
+ return(0);
+ }
+@@ -577,7 +688,7 @@
+ static unsigned long ghbn_hits=0L;
+ static unsigned long ghbn_miss=0L;
+
+-static struct hostent *GetHostByName(char *name)
++static struct hostent *GetHostByName(char *name, int domain)
+ {
+ struct hostent *ret;
+ int i,lowi=0;
+@@ -592,14 +703,20 @@
+ }
+ if (ghbn_cache[i].order > 0)
+ {
+- if (strncmp(name,ghbn_cache[i].name,128) == 0)
++ if ((strncmp(name,ghbn_cache[i].name,128) == 0) &&
++ (ghbn_cache[i].ent.h_addrtype == domain))
+ break;
+ }
+ }
+ if (i == GHBN_NUM) /* no hit*/
+ {
+ ghbn_miss++;
+- ret=gethostbyname(name);
++ if (domain == AF_INET)
++ ret=gethostbyname(name);
++#if OPENSSL_USE_IPV6
++ else
++ ret=gethostbyname2(name, AF_INET6);
++#endif
+ if (ret == NULL) return(NULL);
+ /* else add to cache */
+ if(strlen(name) < sizeof ghbn_cache[0].name)
diff --git a/dev-libs/openssl/files/openssl-1.0.1l-CVE-2015-0286.patch b/dev-libs/openssl/files/openssl-1.0.1l-CVE-2015-0286.patch
new file mode 100644
index 00000000..811f573a
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-1.0.1l-CVE-2015-0286.patch
@@ -0,0 +1,356 @@
+--- openssl-1.0.1l/crypto/asn1/a_type.c
++++ openssl-1.0.1l/crypto/asn1/a_type.c
+@@ -124,6 +124,9 @@
+ case V_ASN1_OBJECT:
+ result = OBJ_cmp(a->value.object, b->value.object);
+ break;
++ case V_ASN1_BOOLEAN:
++ result = a->value.boolean - b->value.boolean;
++ break;
+ case V_ASN1_NULL:
+ result = 0; /* They do not have content. */
+ break;
+--- openssl-1.0.1l/crypto/asn1/tasn_dec.c
++++ openssl-1.0.1l/crypto/asn1/tasn_dec.c
+@@ -130,11 +130,17 @@
+ {
+ ASN1_TLC c;
+ ASN1_VALUE *ptmpval = NULL;
+- if (!pval)
+- pval = &ptmpval;
+ asn1_tlc_clear_nc(&c);
+- if (ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0)
+- return *pval;
++ if (pval && *pval && it->itype == ASN1_ITYPE_PRIMITIVE)
++ ptmpval = *pval;
++ if (ASN1_item_ex_d2i(&ptmpval, in, len, it, -1, 0, 0, &c) > 0) {
++ if (pval && it->itype != ASN1_ITYPE_PRIMITIVE) {
++ if (*pval)
++ ASN1_item_free(*pval, it);
++ *pval = ptmpval;
++ }
++ return ptmpval;
++ }
+ return NULL;
+ }
+
+@@ -311,9 +317,16 @@
+ if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
+ goto auxerr;
+
+- /* Allocate structure */
+- if (!*pval && !ASN1_item_ex_new(pval, it))
+- {
++ if (*pval) {
++ /* Free up and zero CHOICE value if initialised */
++ i = asn1_get_choice_selector(pval, it);
++ if ((i >= 0) && (i < it->tcount)) {
++ tt = it->templates + i;
++ pchptr = asn1_get_field_ptr(pval, tt);
++ ASN1_template_free(pchptr, tt);
++ asn1_set_choice_selector(pval, -1, it);
++ }
++ } else if (!ASN1_item_ex_new(pval, it)) {
+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I,
+ ERR_R_NESTED_ASN1_ERROR);
+ goto err;
+@@ -407,6 +420,17 @@
+ if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
+ goto auxerr;
+
++ /* Free up and zero any ADB found */
++ for (i = 0, tt = it->templates; i < it->tcount; i++, tt++) {
++ if (tt->flags & ASN1_TFLG_ADB_MASK) {
++ const ASN1_TEMPLATE *seqtt;
++ ASN1_VALUE **pseqval;
++ seqtt = asn1_do_adb(pval, tt, 1);
++ pseqval = asn1_get_field_ptr(pval, seqtt);
++ ASN1_template_free(pseqval, seqtt);
++ }
++ }
++
+ /* Get each field entry */
+ for (i = 0, tt = it->templates; i < it->tcount; i++, tt++)
+ {
+--- openssl-1.0.1l/crypto/pkcs7/pk7_doit.c
++++ openssl-1.0.1l/crypto/pkcs7/pk7_doit.c
+@@ -272,6 +272,25 @@
+ PKCS7_RECIP_INFO *ri=NULL;
+ ASN1_OCTET_STRING *os=NULL;
+
++ if (p7 == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAINIT, PKCS7_R_INVALID_NULL_POINTER);
++ return NULL;
++ }
++ /*
++ * The content field in the PKCS7 ContentInfo is optional, but that really
++ * only applies to inner content (precisely, detached signatures).
++ *
++ * When reading content, missing outer content is therefore treated as an
++ * error.
++ *
++ * When creating content, PKCS7_content_new() must be called before
++ * calling this method, so a NULL p7->d is always an error.
++ */
++ if (p7->d.ptr == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAINIT, PKCS7_R_NO_CONTENT);
++ return NULL;
++ }
++
+ i=OBJ_obj2nid(p7->type);
+ p7->state=PKCS7_S_HEADER;
+
+@@ -433,6 +452,16 @@
+ unsigned char *ek = NULL, *tkey = NULL;
+ int eklen = 0, tkeylen = 0;
+
++ if (p7 == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATADECODE, PKCS7_R_INVALID_NULL_POINTER);
++ return NULL;
++ }
++
++ if (p7->d.ptr == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATADECODE, PKCS7_R_NO_CONTENT);
++ return NULL;
++ }
++
+ i=OBJ_obj2nid(p7->type);
+ p7->state=PKCS7_S_HEADER;
+
+@@ -752,6 +781,16 @@
+ STACK_OF(PKCS7_SIGNER_INFO) *si_sk=NULL;
+ ASN1_OCTET_STRING *os=NULL;
+
++ if (p7 == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAFINAL, PKCS7_R_INVALID_NULL_POINTER);
++ return 0;
++ }
++
++ if (p7->d.ptr == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAFINAL, PKCS7_R_NO_CONTENT);
++ return 0;
++ }
++
+ EVP_MD_CTX_init(&ctx_tmp);
+ i=OBJ_obj2nid(p7->type);
+ p7->state=PKCS7_S_HEADER;
+@@ -796,6 +835,7 @@
+ /* If detached data then the content is excluded */
+ if(PKCS7_type_is_data(p7->d.sign->contents) && p7->detached) {
+ M_ASN1_OCTET_STRING_free(os);
++ os = NULL;
+ p7->d.sign->contents->d.data = NULL;
+ }
+ break;
+@@ -806,6 +846,7 @@
+ if(PKCS7_type_is_data(p7->d.digest->contents) && p7->detached)
+ {
+ M_ASN1_OCTET_STRING_free(os);
++ os = NULL;
+ p7->d.digest->contents->d.data = NULL;
+ }
+ break;
+@@ -878,24 +919,31 @@
+ M_ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, md_len);
+ }
+
+- if (!PKCS7_is_detached(p7) && !(os->flags & ASN1_STRING_FLAG_NDEF))
+- {
++ if (!PKCS7_is_detached(p7)) {
++ /*
++ * NOTE(emilia): I think we only reach os == NULL here because detached
++ * digested data support is broken.
++ */
++ if (os == NULL)
++ goto err;
++ if (!(os->flags & ASN1_STRING_FLAG_NDEF)) {
+ char *cont;
+ long contlen;
+- btmp=BIO_find_type(bio,BIO_TYPE_MEM);
+- if (btmp == NULL)
+- {
+- PKCS7err(PKCS7_F_PKCS7_DATAFINAL,PKCS7_R_UNABLE_TO_FIND_MEM_BIO);
+- goto err;
+- }
++ btmp = BIO_find_type(bio, BIO_TYPE_MEM);
++ if (btmp == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAFINAL, PKCS7_R_UNABLE_TO_FIND_MEM_BIO);
++ goto err;
++ }
+ contlen = BIO_get_mem_data(btmp, &cont);
+- /* Mark the BIO read only then we can use its copy of the data
++ /*
++ * Mark the BIO read only then we can use its copy of the data
+ * instead of making an extra copy.
+ */
+ BIO_set_flags(btmp, BIO_FLAGS_MEM_RDONLY);
+ BIO_set_mem_eof_return(btmp, 0);
+ ASN1_STRING_set0(os, (unsigned char *)cont, contlen);
+- }
++ }
++ }
+ ret=1;
+ err:
+ EVP_MD_CTX_cleanup(&ctx_tmp);
+@@ -971,6 +1019,16 @@
+ STACK_OF(X509) *cert;
+ X509 *x509;
+
++ if (p7 == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAVERIFY, PKCS7_R_INVALID_NULL_POINTER);
++ return 0;
++ }
++
++ if (p7->d.ptr == NULL) {
++ PKCS7err(PKCS7_F_PKCS7_DATAVERIFY, PKCS7_R_NO_CONTENT);
++ return 0;
++ }
++
+ if (PKCS7_type_is_signed(p7))
+ {
+ cert=p7->d.sign->cert;
+--- openssl-1.0.1l/crypto/pkcs7/pk7_lib.c
++++ openssl-1.0.1l/crypto/pkcs7/pk7_lib.c
+@@ -71,6 +71,7 @@
+
+ switch (cmd)
+ {
++ /* NOTE(emilia): does not support detached digested data. */
+ case PKCS7_OP_SET_DETACHED_SIGNATURE:
+ if (nid == NID_pkcs7_signed)
+ {
+@@ -459,6 +460,8 @@
+
+ STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7)
+ {
++ if (p7 == NULL || p7->d.ptr == NULL)
++ return NULL;
+ if (PKCS7_type_is_signed(p7))
+ {
+ return(p7->d.sign->signer_info);
+--- openssl-1.0.1l/doc/crypto/d2i_X509.pod
++++ openssl-1.0.1l/doc/crypto/d2i_X509.pod
+@@ -199,6 +199,12 @@
+ persist if they are not present in the new one. As a result the use
+ of this "reuse" behaviour is strongly discouraged.
+
++Current versions of OpenSSL will not modify B<*px> if an error occurs.
++If parsing succeeds then B<*px> is freed (if it is not NULL) and then
++set to the value of the newly decoded structure. As a result B<*px>
++B<must not> be allocated on the stack or an attempt will be made to
++free an invalid pointer.
++
+ i2d_X509() will not return an error in many versions of OpenSSL,
+ if mandatory fields are not initialized due to a programming error
+ then the encoded structure may contain invalid data or omit the
+@@ -210,7 +216,9 @@
+
+ d2i_X509(), d2i_X509_bio() and d2i_X509_fp() return a valid B<X509> structure
+ or B<NULL> if an error occurs. The error code that can be obtained by
+-L<ERR_get_error(3)|ERR_get_error(3)>.
++L<ERR_get_error(3)|ERR_get_error(3)>. If the "reuse" capability has been used
++with a valid X509 structure being passed in via B<px> then the object is not
++modified in the event of error.
+
+ i2d_X509() returns the number of bytes successfully encoded or a negative
+ value if an error occurs. The error code can be obtained by
+--- openssl-1.0.1l/ssl/s2_lib.c
++++ openssl-1.0.1l/ssl/s2_lib.c
+@@ -488,7 +488,7 @@
+
+ OPENSSL_assert(s->session->master_key_length >= 0
+ && s->session->master_key_length
+- < (int)sizeof(s->session->master_key));
++ <= (int)sizeof(s->session->master_key));
+ EVP_DigestUpdate(&ctx,s->session->master_key,s->session->master_key_length);
+ EVP_DigestUpdate(&ctx,&c,1);
+ c++;
+--- openssl-1.0.1l/ssl/s2_srvr.c
++++ openssl-1.0.1l/ssl/s2_srvr.c
+@@ -454,10 +454,6 @@
+ SSLerr(SSL_F_GET_CLIENT_MASTER_KEY,SSL_R_NO_PRIVATEKEY);
+ return(-1);
+ }
+- i=ssl_rsa_private_decrypt(s->cert,s->s2->tmp.enc,
+- &(p[s->s2->tmp.clear]),&(p[s->s2->tmp.clear]),
+- (s->s2->ssl2_rollback)?RSA_SSLV23_PADDING:RSA_PKCS1_PADDING);
+-
+ is_export=SSL_C_IS_EXPORT(s->session->cipher);
+
+ if (!ssl_cipher_get_evp(s->session,&c,&md,NULL,NULL,NULL))
+@@ -475,21 +471,59 @@
+ else
+ ek=5;
+
++ /*
++ * The format of the CLIENT-MASTER-KEY message is
++ * 1 byte message type
++ * 3 bytes cipher
++ * 2-byte clear key length (stored in s->s2->tmp.clear)
++ * 2-byte encrypted key length (stored in s->s2->tmp.enc)
++ * 2-byte key args length (IV etc)
++ * clear key
++ * encrypted key
++ * key args
++ *
++ * If the cipher is an export cipher, then the encrypted key bytes
++ * are a fixed portion of the total key (5 or 8 bytes). The size of
++ * this portion is in |ek|. If the cipher is not an export cipher,
++ * then the entire key material is encrypted (i.e., clear key length
++ * must be zero).
++ */
++ if ((!is_export && s->s2->tmp.clear != 0) ||
++ (is_export && s->s2->tmp.clear + ek != EVP_CIPHER_key_length(c))) {
++ ssl2_return_error(s, SSL2_PE_UNDEFINED_ERROR);
++ SSLerr(SSL_F_GET_CLIENT_MASTER_KEY,SSL_R_BAD_LENGTH);
++ return -1;
++ }
++ /*
++ * The encrypted blob must decrypt to the encrypted portion of the key.
++ * Decryption can't be expanding, so if we don't have enough encrypted
++ * bytes to fit the key in the buffer, stop now.
++ */
++ if ((is_export && s->s2->tmp.enc < ek) ||
++ (!is_export && s->s2->tmp.enc < EVP_CIPHER_key_length(c))) {
++ ssl2_return_error(s,SSL2_PE_UNDEFINED_ERROR);
++ SSLerr(SSL_F_GET_CLIENT_MASTER_KEY,SSL_R_LENGTH_TOO_SHORT);
++ return -1;
++ }
++
++ i = ssl_rsa_private_decrypt(s->cert, s->s2->tmp.enc,
++ &(p[s->s2->tmp.clear]),
++ &(p[s->s2->tmp.clear]),
++ (s->s2->ssl2_rollback) ? RSA_SSLV23_PADDING :
++ RSA_PKCS1_PADDING);
++
+ /* bad decrypt */
+ #if 1
+ /* If a bad decrypt, continue with protocol but with a
+ * random master secret (Bleichenbacher attack) */
+- if ((i < 0) ||
+- ((!is_export && (i != EVP_CIPHER_key_length(c)))
+- || (is_export && ((i != ek) || (s->s2->tmp.clear+(unsigned int)i !=
+- (unsigned int)EVP_CIPHER_key_length(c))))))
+- {
++ if ((i < 0) || ((!is_export && i != EVP_CIPHER_key_length(c))
++ || (is_export && i != ek))) {
+ ERR_clear_error();
+ if (is_export)
+ i=ek;
+ else
+ i=EVP_CIPHER_key_length(c);
+- if (RAND_pseudo_bytes(p,i) <= 0)
++ if (RAND_pseudo_bytes(&p[s->s2->tmp.clear], i) <= 0)
+ return 0;
+ }
+ #else
+@@ -513,7 +547,8 @@
+ }
+ #endif
+
+- if (is_export) i+=s->s2->tmp.clear;
++ if (is_export)
++ i = EVP_CIPHER_key_length(c);
+
+ if (i > SSL_MAX_MASTER_KEY_LENGTH)
+ {
diff --git a/dev-libs/openssl/metadata.xml b/dev-libs/openssl/metadata.xml
new file mode 100644
index 00000000..84ddb514
--- /dev/null
+++ b/dev-libs/openssl/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='bindist'>Disable EC/RC5 algorithms (as they seem to be patented)</flag>
+ <flag name='rfc3779'>Enable support for RFC 3779 (X.509 Extensions for IP Addresses and AS Identifiers)</flag>
+ <flag name='tls-heartbeat'>Enable the Heartbeat Extension in TLS and DTLS</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:openssl:openssl</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/dev-libs/openssl/openssl-1.0.1l-r99.ebuild b/dev-libs/openssl/openssl-1.0.1l-r99.ebuild
new file mode 100644
index 00000000..aca6816a
--- /dev/null
+++ b/dev-libs/openssl/openssl-1.0.1l-r99.ebuild
@@ -0,0 +1,261 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-1.0.1l-r1.ebuild,v 1.5 2015/03/19 18:03:39 vapier Exp $
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
+
+REV="1.7"
+DESCRIPTION="full-strength general purpose cryptography library (including SSL and TLS)"
+HOMEPAGE="http://www.openssl.org/"
+SRC_URI="mirror://openssl/source/${P}.tar.gz
+ http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/${PN}/${PN}-c_rehash.sh?rev=${REV} -> ${PN}-c_rehash.sh.${REV}"
+
+LICENSE="openssl"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="bindist gmp kerberos rfc3779 cpu_flags_x86_sse2 static-libs test +tls-heartbeat vanilla zlib"
+RESTRICT="!bindist? ( bindist )"
+
+# The blocks are temporary just to make sure people upgrade to a
+# version that lack runtime version checking. We'll drop them in
+# the future.
+RDEPEND="gmp? ( >=dev-libs/gmp-5.1.3-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
+ kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140406-r3
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )
+ !<net-misc/openssh-5.9_p1-r4
+ !<net-libs/neon-0.29.6-r1"
+DEPEND="${RDEPEND}
+ sys-apps/diffutils
+ >=dev-lang/perl-5
+ test? ( sys-devel/bc )"
+PDEPEND="app-misc/ca-certificates"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ SSL_CNF_DIR="/etc/ssl"
+ sed \
+ -e "/^DIR=/s:=.*:=${EPREFIX}${SSL_CNF_DIR}:" \
+ -e "s:SSL_CMD=/usr:SSL_CMD=${EPREFIX}/usr:" \
+ "${DISTDIR}"/${PN}-c_rehash.sh.${REV} \
+ > "${WORKDIR}"/c_rehash || die #416717
+}
+
+MULTILIB_WRAPPED_HEADERS=(
+ usr/include/openssl/opensslconf.h
+)
+
+src_prepare() {
+ # Make sure we only ever touch Makefile.org and avoid patching a file
+ # that gets blown away anyways by the Configure script in src_configure
+ rm -f Makefile
+
+ if ! use vanilla ; then
+ epatch "${FILESDIR}"/${PN}-1.0.0a-ldflags.patch #327421
+ epatch "${FILESDIR}"/${PN}-1.0.0d-windres.patch #373743
+ epatch "${FILESDIR}"/${PN}-1.0.0h-pkg-config.patch
+ epatch "${FILESDIR}"/${PN}-1.0.1-parallel-build.patch
+ epatch "${FILESDIR}"/${PN}-1.0.1-x32.patch
+ epatch "${FILESDIR}"/${PN}-1.0.1h-ipv6.patch
+ epatch "${FILESDIR}"/${PN}-1.0.1e-s_client-verify.patch #472584
+ epatch "${FILESDIR}"/${PN}-1.0.1f-revert-alpha-perl-generation.patch #499086
+ epatch "${FILESDIR}"/${PN}-1.0.1l-CVE-2015-0286.patch #543552
+ epatch "${FILESDIR}"/${PN}-1.0.1c-force-termios.patch
+ epatch_user #332661
+ fi
+
+ # disable fips in the build
+ # make sure the man pages are suffixed #302165
+ # don't bother building man pages if they're disabled
+ sed -i \
+ -e '/DIRS/s: fips : :g' \
+ -e '/^MANSUFFIX/s:=.*:=ssl:' \
+ -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
+ -e $(has noman FEATURES \
+ && echo '/^install:/s:install_docs::' \
+ || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
+ Makefile.org \
+ || die
+ # show the actual commands in the log
+ sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
+
+ # since we're forcing $(CC) as makedep anyway, just fix
+ # the conditional as always-on
+ # helps clang (#417795), and versioned gcc (#499818)
+ sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
+
+ # quiet out unknown driver argument warnings since openssl
+ # doesn't have well-split CFLAGS and we're making it even worse
+ # and 'make depend' uses -Werror for added fun (#417795 again)
+ [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
+
+ # allow openssl to be cross-compiled
+ cp "${FILESDIR}"/gentoo.config-1.0.1 gentoo.config || die
+ chmod a+rx gentoo.config
+
+ append-flags -fno-strict-aliasing
+ append-flags $(test-flags-CC -Wa,--noexecstack)
+
+ sed -i '1s,^:$,#!'${EPREFIX}'/usr/bin/perl,' Configure #141906
+ # The config script does stupid stuff to prompt the user. Kill it.
+ sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
+ ./config --test-sanity || die "I AM NOT SANE"
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ unset APPS #197996
+ unset SCRIPTS #312551
+ unset CROSS_COMPILE #311473
+
+ tc-export CC AR RANLIB RC
+
+ # Clean out patent-or-otherwise-encumbered code
+ # Camellia: Royalty Free http://en.wikipedia.org/wiki/Camellia_(cipher)
+ # IDEA: Expired http://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
+ # EC: ????????? ??/??/2015 http://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
+ # MDC2: Expired http://en.wikipedia.org/wiki/MDC-2
+ # RC5: 5,724,428 03/03/2015 http://en.wikipedia.org/wiki/RC5
+
+ use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
+ echoit() { echo "$@" ; "$@" ; }
+
+ local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
+
+ # See if our toolchain supports __uint128_t. If so, it's 64bit
+ # friendly and can use the nicely optimized code paths. #460790
+ local ec_nistp_64_gcc_128
+ # Disable it for now though #469976
+ #if ! use bindist ; then
+ # echo "__uint128_t i;" > "${T}"/128.c
+ # if ${CC} ${CFLAGS} -c "${T}"/128.c -o /dev/null >&/dev/null ; then
+ # ec_nistp_64_gcc_128="enable-ec_nistp_64_gcc_128"
+ # fi
+ #fi
+
+ local sslout=$(./gentoo.config)
+ einfo "Use configuration ${sslout:-(openssl knows best)}"
+ local config="Configure"
+ [[ -z ${sslout} ]] && config="config"
+
+ echoit \
+ ./${config} \
+ ${sslout} \
+ $(use cpu_flags_x86_sse2 || echo "no-sse2") \
+ enable-camellia \
+ $(use_ssl !bindist ec) \
+ ${ec_nistp_64_gcc_128} \
+ enable-idea \
+ enable-mdc2 \
+ $(use_ssl !bindist rc5) \
+ enable-tlsext \
+ $(use_ssl gmp gmp -lgmp) \
+ $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
+ $(use_ssl rfc3779) \
+ $(use_ssl tls-heartbeat heartbeats) \
+ $(use_ssl zlib) \
+ --prefix="${EPREFIX}"/usr \
+ --openssldir="${EPREFIX}"${SSL_CNF_DIR} \
+ --libdir=$(get_libdir) \
+ shared threads \
+ || die
+
+ # Clean out hardcoded flags that openssl uses
+ local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
+ -e 's:^CFLAG=::' \
+ -e 's:-fomit-frame-pointer ::g' \
+ -e 's:-O[0-9] ::g' \
+ -e 's:-march=[-a-z0-9]* ::g' \
+ -e 's:-mcpu=[-a-z0-9]* ::g' \
+ -e 's:-m[a-z0-9]* ::g' \
+ )
+ sed -i \
+ -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
+ -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
+ Makefile || die
+}
+
+multilib_src_compile() {
+ # depend is needed to use $confopts; it also doesn't matter
+ # that it's -j1 as the code itself serializes subdirs
+ emake -j1 depend
+ emake all
+ # rehash is needed to prep the certs/ dir; do this
+ # separately to avoid parallel build issues.
+ emake rehash
+}
+
+multilib_src_test() {
+ emake -j1 test
+}
+
+multilib_src_install() {
+ emake INSTALL_PREFIX="${D}" install
+}
+
+multilib_src_install_all() {
+ dobin "${WORKDIR}"/c_rehash #333117
+ dodoc CHANGES* FAQ NEWS README doc/*.txt doc/c-indentation.el
+ dohtml -r doc/*
+ use rfc3779 && dodoc engines/ccgost/README.gost
+
+ # This is crappy in that the static archives are still built even
+ # when USE=static-libs. But this is due to a failing in the openssl
+ # build system: the static archives are built as PIC all the time.
+ # Only way around this would be to manually configure+compile openssl
+ # twice; once with shared lib support enabled and once without.
+ use static-libs || rm -f "${ED}"/usr/lib*/lib*.a
+
+ # create the certs directory
+ dodir ${SSL_CNF_DIR}/certs
+ cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die
+ rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired}
+
+ # Namespace openssl programs to prevent conflicts with other man pages
+ cd "${ED}"/usr/share/man
+ local m d s
+ for m in $(find . -type f | xargs grep -L '#include') ; do
+ d=${m%/*} ; d=${d#./} ; m=${m##*/}
+ [[ ${m} == openssl.1* ]] && continue
+ [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
+ mv ${d}/{,ssl-}${m}
+ # fix up references to renamed man pages
+ sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m}
+ ln -s ssl-${m} ${d}/openssl-${m}
+ # locate any symlinks that point to this man page ... we assume
+ # that any broken links are due to the above renaming
+ for s in $(find -L ${d} -type l) ; do
+ s=${s##*/}
+ rm -f ${d}/${s}
+ ln -s ssl-${m} ${d}/ssl-${s}
+ ln -s ssl-${s} ${d}/openssl-${s}
+ done
+ done
+ [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
+
+ dodir /etc/sandbox.d #254521
+ echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
+
+ diropts -m0700
+ keepdir ${SSL_CNF_DIR}/private
+}
+
+pkg_preinst() {
+ has_version ${CATEGORY}/${PN}:0.9.8 && return 0
+ preserve_old_lib /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
+}
+
+pkg_postinst() {
+ ebegin "Running 'c_rehash ${EROOT%/}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069"
+ c_rehash "${EROOT%/}${SSL_CNF_DIR}/certs" >/dev/null
+ eend $?
+
+ has_version ${CATEGORY}/${PN}:0.9.8 && return 0
+ preserve_old_lib_notify /usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.8
+}
diff --git a/dev-scheme/guile/Manifest b/dev-scheme/guile/Manifest
new file mode 100644
index 00000000..8a638cae
--- /dev/null
+++ b/dev-scheme/guile/Manifest
@@ -0,0 +1,8 @@
+AUX 50guile-gentoo.el 38 SHA256 f34ea07a3270a25cce3430e4781df47d9903052c9f3a4ea24efb64b1e63bd115 SHA512 5c00bcabe2d7cc03013dc7a54b2c653940c08098ca5646d7c73624cb1ca04376ae9dcf88a7166b1925c69f0c5d192d90f6bd790fdef8ed8c3b0f9d163c987da5 WHIRLPOOL cc5e2fd5081f5fb0018e1fa461c0802c7c90891accc55c02c2935dd3d413c5f8941e918af9341040526b037be4c34dab26008dfca91c153c11fca41338f77c14
+AUX guile-1.8.8-fix_guile-config.patch 494 SHA256 08e4d837a663fc27b037e64f8dd89d89ababb3ed13f1e7845109a0f901f3b0c4 SHA512 3ef2bcb31d5b80dfa2f23b8802b98af713230e59aafe773ca3fd847fbdc7759ebb2d19cead1b6b362a6fa504dfff0c2036d5359aa82b601d664eb2a49a98c970 WHIRLPOOL f6ccd01b09a7aab46fab36464ab49539c9dddb954cc2d1ed709074175273df306d8527bae0d3d83f212903693af00fdf087533611ea416036b1c557ebc0fd283
+AUX guile-1.8.8-gcc46.patch 1004 SHA256 9f11b3095ed4aa622a58e3a0805e49f56c258e81c9813c5053cea980cd93948b SHA512 0ace93548dde387c344e13f083d79227cd09506e0cf58ac0892f25c43bfcefe9071e83912b921fba120262884fa92aaabe4d07f8337d89b6da73f0f2c077dcfa WHIRLPOOL cf2ff22da564656387c7a42985d8c4fd004ff411739e1a081f71931c458287bf1166079f5a39b842f7e8b988e62e24e04d541e125340f0256c62b23de602d80b
+AUX guile-1.8.8-makeinfo-5.patch 2361 SHA256 f1bfbe27280f6105735a2b4f0cf7883a9a825d4df756b74663112612b7a72438 SHA512 a69ed6cf2fd87c6f3d61cc914eed960fcdebaa151778b1ecf04f1774e6dddf07d17bf90fb3243a08e8c231e391843201d0ba26debedef33199d8dd75f8cbcd09 WHIRLPOOL c392c00f99d68cba17db8f14c68dc153f9cf146a3a6e197c4101959e93eb634a451cf8cdf957216f1c24fafcebf377a93e81682d5c0692506a0dd4c7ac00fa48
+AUX guile-1.8.8-os_dep.patch 440 SHA256 e4b54c94aa2087495dc0b4a93e004cc053e5018bbb556c8ea5b674977ea31a52 SHA512 df1681a3e311de4c3f7d4097ab4f92990d1a36f4f47507e967252039479822be9a82d64d483b0f1025c3ecf0ff070d8c7a30ccc4ef0d19db0895f5b9622019c7 WHIRLPOOL 412b0509fdc78b8bd28ee6236c94ed213c95b1da4a666ac1cfef824746ab7dae5cc10bc159d38070c8a17e3363b8f289f27bb6804f50870936ba939116b88a13
+DIST guile-1.8.8.tar.gz 3956654 SHA256 c3471fed2e72e5b04ad133bbaaf16369e8360283679bcf19800bc1b381024050 SHA512 ede6feb90cd419d8763feb8c5169275490a653919573c4dfced025b74cf591072b3a10ffb9a3f6ee3fe7b0a0956ffcf434e0859b421455c8349cea56bf427db0 WHIRLPOOL 104810030b5dae16805595a5b398e5a7e600771b64b08d5ff686036e2f273dcec3829a16e4cdb1dbb9db5813f2e225476f83e0535a789bc570fc2fc15a76dbe2
+EBUILD guile-1.8.8-r99.ebuild 2887 SHA256 e41d065f3078343f312b15e604b32ebce47be2498741d60ad56892761355085d SHA512 c431c0de268aa5ecdfa86eb910e954cffebe4dc408c8107ebbe6011c64f9250617541a70a07ebbf5bffc86d0ae5025ebb3f470c689f4815c59403ca5bb653cd3 WHIRLPOOL 1e6844b0ee7f5d8a85d039d1a5459051c840363b840ac81785bc6fb5802b58c88efbc8ccf14f0a736f8704fd0b319faf2a01e92115e5b24b03e759e7b36a3111
+MISC metadata.xml 939 SHA256 bec92c2558ecc371364a598a582a19b43dff9a809fe732d150e9b209b76f17ca SHA512 ca2dd2db48025f250b4ddaeea40a6119c00bdbc7c6d8167f274fffa9155ae64083a3ccb1cff272abd3cdfc108f555f9f04beb10532ce7174db50ce96d0a4f1eb WHIRLPOOL 75f94d8db3b573829322c06a6a388775cb9b6302624c345f492a650b6ac644d2a48021b16b436786e138eb8753f9ed3354df4e5944bd92f2a3b7b4819ff91155
diff --git a/dev-scheme/guile/files/50guile-gentoo.el b/dev-scheme/guile/files/50guile-gentoo.el
new file mode 100644
index 00000000..431f7e90
--- /dev/null
+++ b/dev-scheme/guile/files/50guile-gentoo.el
@@ -0,0 +1 @@
+(add-to-list 'load-path "@SITELISP@")
diff --git a/dev-scheme/guile/files/guile-1.8.8-fix_guile-config.patch b/dev-scheme/guile/files/guile-1.8.8-fix_guile-config.patch
new file mode 100644
index 00000000..2b04426e
--- /dev/null
+++ b/dev-scheme/guile/files/guile-1.8.8-fix_guile-config.patch
@@ -0,0 +1,14 @@
+diff -ruN 1/configure.in 2/configure.in
+--- 1/configure.in 2010-12-13 17:24:39.000000000 +0000
++++ 2/configure.in 2011-04-29 11:53:39.000000000 +0000
+@@ -1522,8 +1522,8 @@
+ #######################################################################
+
+ dnl Tell guile-config what flags guile users should compile and link with.
+-GUILE_LIBS="$LDFLAGS $LIBS"
+-GUILE_CFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
++GUILE_LIBS="$LIBS"
++GUILE_CFLAGS="$PTHREAD_CFLAGS"
+ AC_SUBST(GUILE_LIBS)
+ AC_SUBST(GUILE_CFLAGS)
+
diff --git a/dev-scheme/guile/files/guile-1.8.8-gcc46.patch b/dev-scheme/guile/files/guile-1.8.8-gcc46.patch
new file mode 100644
index 00000000..b06a0e59
--- /dev/null
+++ b/dev-scheme/guile/files/guile-1.8.8-gcc46.patch
@@ -0,0 +1,39 @@
+Backported upstream patch to fix SIGSEGV with gcc-4.6
+
+http://git.savannah.gnu.org/cgit/guile.git/commit/?h=branch_release-1-8&id=62bc1072c19e81bb0f9e42a5034e7ab8c27d3b94
+https://bugs.gentoo.org/show_bug.cgi?id=424475
+--- a/configure.in
++++ b/configure.in
+@@ -1199,23 +1199,20 @@
+ AC_RUN_IFELSE([AC_LANG_SOURCE(
+ [AC_INCLUDES_DEFAULT
+ int
+-find_stack_direction ()
++find_stack_direction (int *addr, int depth)
+ {
+- static char *addr = 0;
+- auto char dummy;
+- if (addr == 0)
+- {
+- addr = &dummy;
+- return find_stack_direction ();
+- }
+- else
+- return (&dummy > addr) ? 1 : -1;
++ int dir, dummy = 0;
++ if (! addr)
++ addr = &dummy;
++ *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
++ dir = depth ? find_stack_direction (addr, depth - 1) : 0;
++ return dir + dummy;
+ }
+
+ int
+-main ()
++main (int argc, char **argv)
+ {
+- return find_stack_direction () < 0;
++ return find_stack_direction (0, argc + !argv + 20) < 0;
+ }])],
+ [SCM_I_GSC_STACK_GROWS_UP=1],
+ [],
diff --git a/dev-scheme/guile/files/guile-1.8.8-makeinfo-5.patch b/dev-scheme/guile/files/guile-1.8.8-makeinfo-5.patch
new file mode 100644
index 00000000..9f3a02c1
--- /dev/null
+++ b/dev-scheme/guile/files/guile-1.8.8-makeinfo-5.patch
@@ -0,0 +1,71 @@
+From 937da0f2604ea208ec56517c5a41e582f316a246 Mon Sep 17 00:00:00 2001
+From: Cyprien Nicolas <cyp@fulax.fr>
+Date: Thu, 18 Apr 2013 23:45:23 +0200
+Subject: [PATCH] Fix texinfo files for makeinfo-5.1
+
+---
+ doc/ref/api-options.texi | 2 +-
+ doc/ref/api-utility.texi | 2 +-
+ doc/ref/fdl.texi | 2 +-
+ doc/ref/gh.texi | 4 ++--
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/doc/ref/api-options.texi b/doc/ref/api-options.texi
+index 7b7a6e0..6ce7291 100644
+--- a/doc/ref/api-options.texi
++++ b/doc/ref/api-options.texi
+@@ -377,9 +377,9 @@ configure @emph{reading}, @emph{printing}, @emph{debugging} or
+ * User level options interfaces::
+ * Reader options::
+ * Printing options::
+-* Debugger options::
+ * Evaluator options::
+ * Evaluator trap options::
++* Debugger options::
+ * Examples of option use::
+ @end menu
+
+diff --git a/doc/ref/api-utility.texi b/doc/ref/api-utility.texi
+index 4a90212..9a4f3cc 100644
+--- a/doc/ref/api-utility.texi
++++ b/doc/ref/api-utility.texi
+@@ -657,7 +657,7 @@ Return 1 if @var{x} is a Scheme-level hook, 0 otherwise.
+ @end deftypefn
+
+
+-@subsubsection Handling Scheme-level hooks from C code
++@subsubheading Handling Scheme-level hooks from C code
+
+ Here is an example of how to handle Scheme-level hooks from C code using
+ the above functions.
+diff --git a/doc/ref/fdl.texi b/doc/ref/fdl.texi
+index 17fe148..4866055 100644
+--- a/doc/ref/fdl.texi
++++ b/doc/ref/fdl.texi
+@@ -408,7 +408,7 @@ as a draft) by the Free Software Foundation.
+ @end enumerate
+
+ @page
+-@appendixsubsec ADDENDUM: How to use this License for your documents
++@appendixsec ADDENDUM: How to use this License for your documents
+
+ To use this License in a document you have written, include a copy of
+ the License in the document and put the following copyright and
+diff --git a/doc/ref/gh.texi b/doc/ref/gh.texi
+index 95dfd92..bbd3af1 100644
+--- a/doc/ref/gh.texi
++++ b/doc/ref/gh.texi
+@@ -995,8 +995,8 @@ These correspond to the Scheme @code{(cons a b)} and @code{(list l0 l1
+
+ @deftypefun SCM gh_car (SCM @var{obj})
+ @deftypefunx SCM gh_cdr (SCM @var{obj})
+-@dots{}
+-
++@deftypefunx SCM gh_c[ad][ad]r (SCM @var{obj})
++@deftypefunx SCM gh_c[ad][ad][ad]r (SCM @var{obj})
+ @deftypefunx SCM gh_c[ad][ad][ad][ad]r (SCM @var{obj})
+ These correspond to the Scheme @code{(caadar ls)} procedures etc @dots{}
+ @end deftypefun
+--
+1.8.2.1
+
diff --git a/dev-scheme/guile/files/guile-1.8.8-os_dep.patch b/dev-scheme/guile/files/guile-1.8.8-os_dep.patch
new file mode 100644
index 00000000..9fab8dae
--- /dev/null
+++ b/dev-scheme/guile/files/guile-1.8.8-os_dep.patch
@@ -0,0 +1,10 @@
+--- a/guile-1.8.8/libguile/gc_os_dep.c
++++ b/guile-1.8.8/libguile/gc_os_dep.c
+@@ -1472,6 +1472,7 @@
+ /* has the right declaration for glibc 2.1. */
+ # include <sigcontext.h>
+ # endif /* 0 == __GLIBC_MINOR__ */
++# elif 1
+ # else /* not 2 <= __GLIBC__ */
+ /* libc5 doesn't have <sigcontext.h>: go directly with the kernel */
+ /* one. Check LINUX_VERSION_CODE to see which we should reference. */
diff --git a/dev-scheme/guile/guile-1.8.8-r99.ebuild b/dev-scheme/guile/guile-1.8.8-r99.ebuild
new file mode 100644
index 00000000..abfa46e7
--- /dev/null
+++ b/dev-scheme/guile/guile-1.8.8-r99.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-scheme/guile/guile-1.8.8-r1.ebuild,v 1.16 2013/04/24 22:53:08 pchrist Exp $
+
+EAPI=3
+inherit eutils autotools flag-o-matic elisp-common
+
+DESCRIPTION="Scheme interpreter"
+HOMEPAGE="http://www.gnu.org/software/guile/"
+SRC_URI="mirror://gnu/guile/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="networking +regex discouraged +deprecated emacs nls debug-freelist debug-malloc debug +threads"
+RESTRICT="!regex? ( test )"
+
+DEPEND="
+ >=dev-libs/gmp-4.1
+ >=sys-devel/libtool-1.5.6
+ sys-devel/gettext
+ emacs? ( virtual/emacs )"
+RDEPEND="${DEPEND}"
+
+# Guile seems to contain some slotting support, /usr/share/guile/ is slotted,
+# but there are lots of collisions. Most in /usr/share/libguile. Therefore
+# I'm slotting this in the same slot as guile-1.6* for now.
+SLOT="12"
+MAJOR="1.8"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-fix_guile-config.patch" \
+ "${FILESDIR}/${P}-gcc46.patch" \
+ "${FILESDIR}/${P}-os_dep.patch" \
+ "${FILESDIR}/${P}-makeinfo-5.patch"
+ sed \
+ -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g" \
+ -e "/AM_PROG_CC_STDC/d" \
+ -i guile-readline/configure.in
+ eautoreconf
+}
+
+src_configure() {
+ # see bug #178499
+ filter-flags -ftree-vectorize
+
+ #will fail for me if posix is disabled or without modules -- hkBst
+ econf \
+ --disable-error-on-warning \
+ --disable-static \
+ --enable-posix \
+ $(use_enable networking) \
+ $(use_enable regex) \
+ $(use deprecated || use_enable discouraged) \
+ $(use_enable deprecated) \
+ $(use_enable emacs elisp) \
+ $(use_enable nls) \
+ --disable-rpath \
+ $(use_enable debug-freelist) \
+ $(use_enable debug-malloc) \
+ $(use_enable debug guile-debug) \
+ $(use_with threads) \
+ --with-modules \
+ EMACS=no
+}
+
+src_compile() {
+ emake || die "make failed"
+
+ # Above we have disabled the build system's Emacs support;
+ # for USE=emacs we compile (and install) the files manually
+ if use emacs; then
+ cd emacs
+ elisp-compile *.el || die
+ fi
+}
+
+src_install() {
+ einstall || die "install failed"
+
+ dodoc AUTHORS ChangeLog GUILE-VERSION HACKING NEWS README THANKS || die
+
+ # texmacs needs this, closing bug #23493
+ dodir /etc/env.d
+ echo "GUILE_LOAD_PATH=\"${EPREFIX}/usr/share/guile/${MAJOR}\"" > "${ED}"/etc/env.d/50guile
+
+ # necessary for registering slib, see bug 206896
+ keepdir /usr/share/guile/site
+
+ if use emacs; then
+ elisp-install ${PN} emacs/*.{el,elc} || die
+ elisp-site-file-install "${FILESDIR}/50${PN}-gentoo.el" || die
+ fi
+}
+
+pkg_postinst() {
+ [ "${EROOT}" == "/" ] && pkg_config
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
+
+pkg_config() {
+ if has_version dev-scheme/slib; then
+ einfo "Registering slib with guile"
+ install_slib_for_guile
+ fi
+}
+
+_pkg_prerm() {
+ rm -f "${EROOT}"/usr/share/guile/site/slibcat
+}
diff --git a/dev-scheme/guile/metadata.xml b/dev-scheme/guile/metadata.xml
new file mode 100644
index 00000000..a3d993de
--- /dev/null
+++ b/dev-scheme/guile/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>scheme</herd>
+ <longdescription lang="en">
+Guile is a library designed to help programmers create flexible applications. Using Guile in an application allows programmers to write plug-ins, or modules (there are many names, but the concept is essentially the same) and users to use them to have an application fit their needs.
+ </longdescription>
+ <use>
+ <flag name='debug-freelist'>Include garbage collector freelist debugging
+ code</flag>
+ <flag name='debug-malloc'>Include malloc debugging code</flag>
+ <flag name='deprecated'>Enable deprecated features</flag>
+ <flag name='discouraged'> (implied by deprecated) enable merely discouraged
+ features</flag>
+ <flag name='networking'>Include networking interfaces</flag>
+ <flag name='regex'> Include regular expression interfaces</flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-tex/luatex/Manifest b/dev-tex/luatex/Manifest
new file mode 100644
index 00000000..f3b2870a
--- /dev/null
+++ b/dev-tex/luatex/Manifest
@@ -0,0 +1,10 @@
+AUX jmpbuf.patch 892 SHA256 247b507c9b5381166d4c5d8566c7443b6199a606acaa7a0138cb5e6e44b975f3 SHA512 519194f99167955b2bac6d97b9cc8217f2107a2edd039ec468112474c41e80aa0ed4319450437420f1a8b0161a54873c273aa5b9262a0f7558b3359bc569f906 WHIRLPOOL e7849be1484ce8e8d591b39a599a33eea8c4fc369ff897434398ec581f718ebd5ac53958ec0d4ed9d6dd3f082b91246ef7cdd337a9becf09358f88ab2a6c2f55
+AUX kpathsea2012.patch 944 SHA256 afb87b3c1cb9317666a7f45b6ecd6ad1078896d56b91fca7bfe6aa1c75ada495 SHA512 d72bce55c2494622fd15703f483c058245c96c8b2aa03d6fa02b112be827ddfe8a0013ee0c3710bb3e1313b631bf436f70ce99d383f11f4d2b51915752c59960 WHIRLPOOL 39c93138b416d79a55d1e5a464afe8363c9902abff50397d88bad623ec298e970490fd93dd8ed4d4c1a8e9788da300f265da550bf2ab6149b41351027998b107
+AUX poppler018.patch 5041 SHA256 98317c41cab055cde67fd1eefa6c79fa8ec0ac2b36d93a094abe9eb8e834221c SHA512 e8b1660cb6674a8d2f68f29022d0ea33ca00795c8360a9656c5ad84776c86d3ab0a3c0895632957c5ed93fcab96e11e6bc7eb1a03df518122fcc3fa574b095ee WHIRLPOOL 0a14b110479acbe5d31a40642b53e0bcf03226acac19596f5dc885ff8a7a9c83895d8409044e96630bc66cf77ea915ce41f580a43dc48df423519dc0a9226335
+AUX poppler020.patch 2909 SHA256 ffec5fd2e311841ee355deabfe13b37fdaea781608e95a2a5ab037d1cdd04ea8 SHA512 9517efce4ede9b792f27647ec4ed95d447572a9cbb3ee58e089b658ccc55bbb6a7843768b5962a4535ed77ab364e73f4fd1248e92a5a480ce30429303664f385 WHIRLPOOL db89a3e07ace603aea4abf71a97cd26f0b16c60b939f0c361db77d8af22c03b0003440e38164a0052258a8fbaceb283bac401a8254fa0b42e71179b715151f06
+AUX poppler022.patch 12617 SHA256 4b19ef98d1142e775efa4ea3911b720f9d524c813a512d7673c8441a34e2488c SHA512 998c948bc02014bf1e79e9c8ee2c7681568b827c467f15eed0ec90342d65f43ec36b9acaf7cdf51404234eab14337122d330adc647ce97b3c299a2c368bf9a9a WHIRLPOOL 5a4c34a509c9368d5235ff5674ed243c78e16c0fafc5134da95884f7d18dc4678e7126e6cfccf9a27eac96bcae23b8c96a6b1aa84c60bf3efdf2249461d7dff8
+AUX remove-zlib-version-check.patch 938 SHA256 5c569bab0ccecc38e89f0bfeeaeabb921ce2fe38e17ecd0d7da11a75c0ed9d19 SHA512 1d19fb396af846a2ffa9ab7ffcf20d363956921cec92d6b03e499e26bac3802a8ca874b982c25ef99a560af48f0d85b0a36ac5786f7c3129abba3b8d9e38c780 WHIRLPOOL 2b06826e5f8bd2bc50b933a7636b5185bd21b44e2c5aad54e4e641bd39c74a29235928f3a6e36d551b679dac6ca2fa8c969447c520805807a487b6bd0b82c79c
+DIST luatex-beta-0.70.1-doc.tar.bz2 1048489 SHA256 4f1d24777725a606efbf5d7a59064245c46fb29b8066236c6b48fb423a595606 SHA512 eb4de91a80a6afccf5cca5cb05d5c1378a60ec35763e5ef5e9dbadaa2a276758a446e01d66e76a78e91442274778c10c73458b513af903e7221d90beb644afa9 WHIRLPOOL 97142a3a3c23d01f3b21963690f7362edf0c7f0de1ad77295361122a81c92459cb2ecd36baaea3588b7ad4f8b81c5dfa81d22df7a5529cb5b8b2b39fe6ce84be
+DIST luatex-beta-0.70.1.tar.bz2 8181155 SHA256 c641a4ba1535ede6ee8e2a958d8c4b436f5979c5be6f3f51d3dec5b4df6bb6ed SHA512 e04a9b96f349bf9036ef4c01746dee96ebf245cd4da6b719f546223e05cb98fb844e20878a64f80f42c77e220fac01ee2d97ad56939c1fb3af44faab53c603cb WHIRLPOOL 63dfdf182d3f1aadd6fc802e424b3791eda4df7eb8d707ad719d2ad0f97946b365316f6b9caed2362d5827280e9ddf2e750c8beeb61277dac72bffaed06a4fc9
+EBUILD luatex-0.70.1-r99.ebuild 3626 SHA256 9bd5bfa58565b7c52a240e195cee3a5b6285ffbf05f2046f5c8935470eb114df SHA512 806d5b55947d7c41defbb89af65e6723a851f2a7c0ab4c603bc4329f9833f3e577bb7e91c344f20cd4f25766a08f8bba8d03d6b6e15a9f2547aa621305615380 WHIRLPOOL 9fbc5060c778ed603cb716ea86e9cc201c29aabb4dbe2f722bad4ad9248caef6a45f0746645ef735b1c5632a425ee32d1d86e97c1993593cecace0f2f4c02e0d
+MISC metadata.xml 336 SHA256 126018a4822f911e52afe63656a10f2a7b0b938ea106f2a2caef00bdc18a845f SHA512 d998dbfe23cbb7f60db7b876e8ac3d039281ad9568aeb45a494774eb65468392523cdfc1b5cc8b621fc9a2f2f7f33dc3e351d1cf902f9ecf3f122534ef4767e0 WHIRLPOOL 3350c9964adc178cb58ee77019669fa51899cd71734ae1ff8f4646d1f9e141973c9f686f43e5995f1a7258d92bd173176dc0d9c3d8bcc09b96c37a0b7a0fb4a2
diff --git a/dev-tex/luatex/files/jmpbuf.patch b/dev-tex/luatex/files/jmpbuf.patch
new file mode 100644
index 00000000..ec8a41bd
--- /dev/null
+++ b/dev-tex/luatex/files/jmpbuf.patch
@@ -0,0 +1,21 @@
+--- a/luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua51/lcoco.c
++++ b/luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua51/lcoco.c
+@@ -340,14 +340,14 @@
+
+ #elif defined(__arm__) || defined(__ARM__)
+
+-#if __GLIBC__ == 2 || defined(__UCLIBC__) /* arm-linux-glibc2 */
++#if 1
+ #ifndef __JMP_BUF_SP
+ #define __JMP_BUF_SP ((sizeof(__jmp_buf)/sizeof(int))-2)
+ #endif
+ #define COCO_PATCHCTX(coco, buf, func, stack, a0) \
+- buf->__jmpbuf[__JMP_BUF_SP+1] = (int)(func); /* pc */ \
+- buf->__jmpbuf[__JMP_BUF_SP] = (int)(stack); /* sp */ \
+- buf->__jmpbuf[__JMP_BUF_SP-1] = 0; /* fp */ \
++ ((__jmp_buf *)buf)[__JMP_BUF_SP+1] = (int)(func); /* pc */ \
++ ((__jmp_buf *)buf)[__JMP_BUF_SP] = (int)(stack); /* sp */ \
++ ((__jmp_buf *)buf)[__JMP_BUF_SP-1] = 0; /* fp */ \
+ stack[0] = (size_t)(a0);
+ #define COCO_STACKADJUST 2
+ #define COCO_MAIN_PARAM int _a, int _b, int _c, int _d, lua_State *L
diff --git a/dev-tex/luatex/files/kpathsea2012.patch b/dev-tex/luatex/files/kpathsea2012.patch
new file mode 100644
index 00000000..80c356d9
--- /dev/null
+++ b/dev-tex/luatex/files/kpathsea2012.patch
@@ -0,0 +1,28 @@
+From TeX Live svn rev 23421.
+Remove unnecessary headers. Fixes build with kpathsea from TeX Live 2012.
+
+
+Index: source/texk/web2c/luatexdir/luatex.c
+===================================================================
+--- source/texk/web2c/luatexdir/luatex.c (revision 23420)
++++ source/texk/web2c/luatexdir/luatex.c (revision 23421)
+@@ -32,7 +32,6 @@
+ #include <kpathsea/readable.h>
+ #include <kpathsea/variable.h>
+ #include <kpathsea/absolute.h>
+-#include <kpathsea/recorder.h>
+ #ifdef WIN32
+ #include <kpathsea/concatn.h>
+ #endif
+Index: source/texk/web2c/lib/texmfmp.c
+===================================================================
+--- source/texk/web2c/lib/texmfmp.c (revision 23420)
++++ source/texk/web2c/lib/texmfmp.c (revision 23421)
+@@ -17,7 +17,6 @@
+ #include <kpathsea/readable.h>
+ #include <kpathsea/variable.h>
+ #include <kpathsea/absolute.h>
+-#include <kpathsea/recorder.h>
+ #ifdef WIN32
+ #include <kpathsea/concatn.h>
+ #endif
diff --git a/dev-tex/luatex/files/poppler018.patch b/dev-tex/luatex/files/poppler018.patch
new file mode 100644
index 00000000..d2125385
--- /dev/null
+++ b/dev-tex/luatex/files/poppler018.patch
@@ -0,0 +1,160 @@
+by Martin von Gagern
+https://bugs.gentoo.org/show_bug.cgi?id=384875
+http://thread.gmane.org/gmane.comp.tex.luatex/2630
+
+--- luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua/lepdflib.cc
++++ luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua/lepdflib.cc
+@@ -89,7 +89,6 @@ new_poppler_userdata(AnnotBorder);
+ new_poppler_userdata(Annots);
+ new_poppler_userdata(Array);
+ new_poppler_userdata(Catalog);
+-new_poppler_userdata(EmbFile);
+ new_poppler_userdata(Dict);
+ //new_poppler_userdata(GooString);
+ new_poppler_userdata(LinkDest);
+@@ -393,7 +392,7 @@ static int m_Annot__gc(lua_State * L)
+ printf("\n===== Annot GC ===== uin=<%p>\n", uin);
+ #endif
+ if (uin->atype == ALLOC_LEPDF)
+- delete(Annot *) uin->d;
++ ((Annot *) uin->d)->decRefCnt();
+ return 0;
+ }
+
+@@ -408,34 +407,6 @@ static const struct luaL_Reg Annot_m[] =
+ };
+
+ //**********************************************************************
+-// AnnotBorderStyle
+-
+-m_poppler_get_DOUBLE(AnnotBorderStyle, getWidth);
+-
+-m_poppler__tostring(AnnotBorderStyle);
+-
+-static int m_Annots__gc(lua_State * L)
+-{
+- udstruct *uin;
+- uin = (udstruct *) luaL_checkudata(L, 1, M_Annots);
+- if (uin->pd != NULL && uin->pd->pc != uin->pc)
+- pdfdoc_changed_error(L);
+-#ifdef DEBUG
+- printf("\n===== Annots GC ===== uin=<%p>\n", uin);
+-#endif
+- if (uin->atype == ALLOC_LEPDF)
+- delete(Annots *) uin->d;
+- return 0;
+-}
+-
+-static const struct luaL_Reg AnnotBorderStyle_m[] = {
+- {"getWidth", m_AnnotBorderStyle_getWidth},
+- {"__tostring", m_AnnotBorderStyle__tostring},
+- {"__gc", m_Annots__gc},
+- {NULL, NULL} // sentinel
+-};
+-
+-//**********************************************************************
+ // Annots
+
+ m_poppler_get_INT(Annots, getNumAnnots);
+@@ -683,31 +654,6 @@ static int m_Catalog_findDest(lua_State
+
+ m_poppler_get_poppler(Catalog, Object, getDests);
+ m_poppler_get_INT(Catalog, numEmbeddedFiles);
+-
+-static int m_Catalog_embeddedFile(lua_State * L)
+-{
+- EmbFile *ef;
+- int i, len;
+- udstruct *uin, *uout;
+- uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
+- if (uin->pd != NULL && uin->pd->pc != uin->pc)
+- pdfdoc_changed_error(L);
+- i = luaL_checkint(L, 2);
+- len = ((Catalog *) uin->d)->numEmbeddedFiles();
+- if (i > 0 && i <= len) {
+- ef = ((Catalog *) uin->d)->embeddedFile(i - 1);
+- if (ef != NULL) {
+- uout = new_EmbFile_userdata(L);
+- uout->d = ef;
+- uout->pc = uin->pc;
+- uout->pd = uin->pd;
+- } else
+- lua_pushnil(L);
+- } else
+- lua_pushnil(L);
+- return 1;
+-}
+-
+ m_poppler_get_INT(Catalog, numJS);
+
+ static int m_Catalog_getJS(lua_State * L)
+@@ -749,7 +695,6 @@ static const struct luaL_Reg Catalog_m[]
+ {"findDest", m_Catalog_findDest},
+ {"getDests", m_Catalog_getDests},
+ {"numEmbeddedFiles", m_Catalog_numEmbeddedFiles},
+- {"embeddedFile", m_Catalog_embeddedFile},
+ {"numJS", m_Catalog_numJS},
+ {"getJS", m_Catalog_getJS},
+ {"getOutline", m_Catalog_getOutline},
+@@ -759,49 +704,6 @@ static const struct luaL_Reg Catalog_m[]
+ };
+
+ //**********************************************************************
+-// EmbFile
+-
+-m_poppler_get_GOOSTRING(EmbFile, name);
+-m_poppler_get_GOOSTRING(EmbFile, description);
+-m_poppler_get_INT(EmbFile, size);
+-m_poppler_get_GOOSTRING(EmbFile, modDate);
+-m_poppler_get_GOOSTRING(EmbFile, createDate);
+-m_poppler_get_GOOSTRING(EmbFile, checksum);
+-m_poppler_get_GOOSTRING(EmbFile, mimeType);
+-
+-static int m_EmbFile_streamObject(lua_State * L)
+-{
+- udstruct *uin, *uout;
+- uin = (udstruct *) luaL_checkudata(L, 1, M_EmbFile);
+- if (uin->pd != NULL && uin->pd->pc != uin->pc)
+- pdfdoc_changed_error(L);
+- uout = new_Object_userdata(L);
+- uout->d = new Object(); // automatic init to type "none"
+- ((EmbFile *) uin->d)->streamObject().copy((Object *) uout->d);
+- uout->pc = uin->pc;
+- uout->pd = uin->pd;
+- return 1;
+-}
+-
+-m_poppler_get_BOOL(EmbFile, isOk);
+-
+-m_poppler__tostring(EmbFile);
+-
+-static const struct luaL_Reg EmbFile_m[] = {
+- {"name", m_EmbFile_name},
+- {"description", m_EmbFile_description},
+- {"size", m_EmbFile_size},
+- {"modDate", m_EmbFile_modDate},
+- {"createDate", m_EmbFile_createDate},
+- {"checksum", m_EmbFile_checksum},
+- {"mimeType", m_EmbFile_mimeType},
+- {"streamObject", m_EmbFile_streamObject},
+- {"isOk", m_EmbFile_isOk},
+- {"__tostring", m_EmbFile__tostring},
+- {NULL, NULL} // sentinel
+-};
+-
+-//**********************************************************************
+ // Dict
+
+ static int m_Dict_incRef(lua_State * L)
+@@ -2683,11 +2585,9 @@ int luaopen_epdf(lua_State * L)
+ {
+ register_meta(Annot);
+ // TODO register_meta(AnnotBorder);
+- register_meta(AnnotBorderStyle);
+ register_meta(Annots);
+ register_meta(Array);
+ register_meta(Catalog);
+- register_meta(EmbFile);
+ register_meta(Dict);
+ register_meta(GooString);
+ register_meta(LinkDest);
diff --git a/dev-tex/luatex/files/poppler020.patch b/dev-tex/luatex/files/poppler020.patch
new file mode 100644
index 00000000..d3db830d
--- /dev/null
+++ b/dev-tex/luatex/files/poppler020.patch
@@ -0,0 +1,75 @@
+https://bugs.gentoo.org/show_bug.cgi?id=416545
+build with poppler-0.20 by Rafał Mużyło
+
+--- source/texk/web2c/luatexdir/lua/lepdflib.cc 2012-05-18 16:23:53.000000000 +0200
++++ source/texk/web2c/luatexdir/lua/lepdflib.cc 2012-05-18 17:43:12.959843483 +0200
+@@ -151,7 +151,7 @@ static int l_new_Annot(lua_State * L)
+ pdfdoc_changed_error(L);
+ uout = new_Annot_userdata(L);
+ uout->d =
+- new Annot((XRef *) uxref->d, (Dict *) udict->d, (Catalog *) ucatalog->d,
++ new Annot(udict->pd->doc, (Dict *) udict->d,
+ (Object *) uref->d);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uxref->pc;
+@@ -173,7 +173,7 @@ static int l_new_Annots(lua_State * L)
+ pdfdoc_changed_error(L);
+ uout = new_Annots_userdata(L);
+ uout->d =
+- new Annots((XRef *) uxref->d, (Catalog *) ucatalog->d,
++ new Annots(uannotsobj->pd->doc,
+ (Object *) uannotsobj->d);
+ uout->atype = ALLOC_LEPDF;
+ uout->pc = uxref->pc;
+@@ -363,7 +363,7 @@ static int m_##type##__tostring(lua_Stat
+ // Annot
+
+ m_poppler_get_BOOL(Annot, isOk);
+-m_poppler_get_OBJECT(Annot, getAppearance);
++m_poppler_get_OBJECT(Annot, getAppearanceResDict);
+ m_poppler_get_poppler(Annot, AnnotBorder, getBorder);
+
+ static int m_Annot_match(lua_State * L)
+@@ -398,7 +398,7 @@ static int m_Annot__gc(lua_State * L)
+
+ static const struct luaL_Reg Annot_m[] = {
+ {"isOk", m_Annot_isOk},
+- {"getAppearance", m_Annot_getAppearance},
++ {"getAppearanceResDict", m_Annot_getAppearanceResDict},
+ {"getBorder", m_Annot_getBorder},
+ {"match", m_Annot_match},
+ {"__tostring", m_Annot__tostring},
+@@ -1249,7 +1249,7 @@ static int m_Object_getType(lua_State *
+
+ static int m_Object_getTypeName(lua_State * L)
+ {
+- char *s;
++ const char *s;
+ udstruct *uin;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+@@ -1936,7 +1936,7 @@ static int m_Page_getLinks(lua_State * L
+ if ((uin->pd != NULL && uin->pd->pc != uin->pc)
+ || (ucat->pd != NULL && ucat->pd->pc != ucat->pd->pc))
+ pdfdoc_changed_error(L);
+- links = ((Page *) uin->d)->getLinks((Catalog *) ucat->d);
++ links = ((Page *) uin->d)->getLinks();
+ if (links != NULL) {
+ uout = new_Links_userdata(L);
+ uout->d = links;
+@@ -2531,7 +2531,6 @@ m_poppler_get_INT(XRef, getNumObjects);
+ m_poppler_get_INT(XRef, getRootNum);
+ m_poppler_get_INT(XRef, getRootGen);
+ // getStreamEnd
+-m_poppler_get_INT(XRef, getSize);
+ // getEntry
+ m_poppler_get_poppler(XRef, Object, getTrailerDict);
+
+@@ -2558,7 +2557,6 @@ static const struct luaL_Reg XRef_m[] =
+ {"getRootNum", m_XRef_getRootNum},
+ {"getRootGen", m_XRef_getRootGen},
+ //
+- {"getSize", m_XRef_getSize},
+ {"getTrailerDict", m_XRef_getTrailerDict},
+ {"__tostring", m_XRef__tostring},
+ {NULL, NULL} // sentinel
diff --git a/dev-tex/luatex/files/poppler022.patch b/dev-tex/luatex/files/poppler022.patch
new file mode 100644
index 00000000..223cbcb2
--- /dev/null
+++ b/dev-tex/luatex/files/poppler022.patch
@@ -0,0 +1,388 @@
+Patch updating lepdflib.cc to upstream revision 4415, which basically removes
+part of the exported interface and thereby circumvents the changes in
+poppler-0.20 -> 0.22. Experimental, rebased on our existing Gentoo patches
+poppler-0.18.patch and poppler-0.20.patch. Here to solve bug 449538.
+
+diff -ruN luatex-beta-0.70.1.gentoo/source/texk/web2c/luatexdir/lua/lepdflib.cc
+luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua/lepdflib.cc
+--- luatex-beta-0.70.1.gentoo/source/texk/web2c/luatexdir/lua/lepdflib.cc 2013-03-10 13:31:22.000000000 +0100
++++ luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua/lepdflib.cc 2013-03-10 13:47:24.000000000 +0100
+@@ -1,7 +1,7 @@
+ /* lepdflib.cc
+
+- Copyright 2009-2011 Taco Hoekwater <taco@luatex.org>
+- Copyright 2009-2011 Hartmut Henkel <hartmut@luatex.org>
++ Copyright 2009-2012 Taco Hoekwater <taco@luatex.org>
++ Copyright 2009-2012 Hartmut Henkel <hartmut@luatex.org>
+
+ This file is part of LuaTeX.
+
+@@ -49,15 +49,13 @@
+ //**********************************************************************
+
+ #define M_Annot "Annot"
+-#define M_AnnotBorder "AnnotBorder"
+-#define M_AnnotBorderStyle "AnnotBorderStyle"
+ #define M_Annots "Annots"
+ #define M_Array "Array"
+ #define M_Catalog "Catalog"
+-#define M_EmbFile "EmbFile"
+ #define M_Dict "Dict"
+ #define M_GooString "GooString"
+ #define M_LinkDest "LinkDest"
++#define M_Link "Link"
+ #define M_Links "Links"
+ #define M_Object "Object"
+ #define M_Page "Page"
+@@ -65,8 +63,8 @@
+ #define M_PDFRectangle "PDFRectangle"
+ #define M_Ref "Ref"
+ #define M_Stream "Stream"
+-#define M_XRef "XRef"
+ #define M_XRefEntry "XRefEntry"
++#define M_XRef "XRef"
+
+ //**********************************************************************
+
+@@ -84,13 +82,9 @@
+ new_poppler_userdata(PDFDoc);
+
+ new_poppler_userdata(Annot);
+-new_poppler_userdata(AnnotBorder);
+-//new_poppler_userdata(AnnotBorderStyle);
+-new_poppler_userdata(Annots);
+ new_poppler_userdata(Array);
+ new_poppler_userdata(Catalog);
+ new_poppler_userdata(Dict);
+-//new_poppler_userdata(GooString);
+ new_poppler_userdata(LinkDest);
+ new_poppler_userdata(Links);
+ new_poppler_userdata(Object);
+@@ -99,7 +93,6 @@
+ new_poppler_userdata(Ref);
+ new_poppler_userdata(Stream);
+ new_poppler_userdata(XRef);
+-//new_poppler_userdata(XRefEntry);
+
+ //**********************************************************************
+
+@@ -134,53 +127,6 @@
+ return 1; // doc path
+ }
+
+-static int l_new_Annot(lua_State * L)
+-{
+- udstruct *uxref, *udict, *ucatalog, *uref, *uout;
+- uxref = (udstruct *) luaL_checkudata(L, 1, M_XRef);
+- udict = (udstruct *) luaL_checkudata(L, 2, M_Dict);
+- ucatalog = (udstruct *) luaL_checkudata(L, 3, M_Catalog);
+- uref = (udstruct *) luaL_checkudata(L, 4, M_Ref);
+- if (uxref->pd != ucatalog->pd || uxref->pd != udict->pd
+- || uxref->pd != uref->pd)
+- pdfdoc_differs_error(L);
+- if ((uxref->pd != NULL && uxref->pd->pc != uxref->pc) ||
+- (ucatalog->pd != NULL && ucatalog->pd->pc != ucatalog->pc) ||
+- (udict->pd != NULL && udict->pd->pc != udict->pc) ||
+- (uref->pd != NULL && uref->pd->pc != uref->pc))
+- pdfdoc_changed_error(L);
+- uout = new_Annot_userdata(L);
+- uout->d =
+- new Annot(udict->pd->doc, (Dict *) udict->d,
+- (Object *) uref->d);
+- uout->atype = ALLOC_LEPDF;
+- uout->pc = uxref->pc;
+- uout->pd = uxref->pd;
+- return 1;
+-}
+-
+-static int l_new_Annots(lua_State * L)
+-{
+- udstruct *uxref, *ucatalog, *uannotsobj, *uout;
+- uxref = (udstruct *) luaL_checkudata(L, 1, M_XRef);
+- ucatalog = (udstruct *) luaL_checkudata(L, 2, M_Catalog);
+- uannotsobj = (udstruct *) luaL_checkudata(L, 3, M_Object);
+- if (uxref->pd != ucatalog->pd || uxref->pd != uannotsobj->pd)
+- pdfdoc_differs_error(L);
+- if ((uxref->pd != NULL && uxref->pd->pc != uxref->pc)
+- || (ucatalog->pd != NULL && ucatalog->pd->pc != ucatalog->pc)
+- || (uannotsobj->pd != NULL && uannotsobj->pd->pc != uannotsobj->pc))
+- pdfdoc_changed_error(L);
+- uout = new_Annots_userdata(L);
+- uout->d =
+- new Annots(uannotsobj->pd->doc,
+- (Object *) uannotsobj->d);
+- uout->atype = ALLOC_LEPDF;
+- uout->pc = uxref->pc;
+- uout->pd = uxref->pd;
+- return 1;
+-}
+-
+ static int l_new_Array(lua_State * L)
+ {
+ udstruct *uxref, *uout;
+@@ -235,8 +181,6 @@
+
+ static const struct luaL_Reg epdflib[] = {
+ {"open", l_open_PDFDoc},
+- {"Annot", l_new_Annot},
+- {"Annots", l_new_Annots},
+ {"Array", l_new_Array},
+ {"Dict", l_new_Dict},
+ {"Object", l_new_Object},
+@@ -359,12 +303,26 @@
+ return 1; \
+ }
+
++#define m_poppler_check_string(in, function) \
++static int m_##in##_##function(lua_State * L) \
++{ \
++ const char *s; \
++ udstruct *uin; \
++ uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
++ if (uin->pd != NULL && uin->pd->pc != uin->pc) \
++ pdfdoc_changed_error(L); \
++ s = luaL_checkstring(L, 2); \
++ if (((in *) uin->d)->function((char *) s)) \
++ lua_pushboolean(L, 1); \
++ else \
++ lua_pushboolean(L, 0); \
++ return 1; \
++}
++
+ //**********************************************************************
+ // Annot
+
+ m_poppler_get_BOOL(Annot, isOk);
+-m_poppler_get_OBJECT(Annot, getAppearanceResDict);
+-m_poppler_get_poppler(Annot, AnnotBorder, getBorder);
+
+ static int m_Annot_match(lua_State * L)
+ {
+@@ -398,8 +356,6 @@
+
+ static const struct luaL_Reg Annot_m[] = {
+ {"isOk", m_Annot_isOk},
+- {"getAppearanceResDict", m_Annot_getAppearanceResDict},
+- {"getBorder", m_Annot_getBorder},
+ {"match", m_Annot_match},
+ {"__tostring", m_Annot__tostring},
+ {"__gc", m_Annot__gc},
+@@ -654,6 +610,7 @@
+
+ m_poppler_get_poppler(Catalog, Object, getDests);
+ m_poppler_get_INT(Catalog, numEmbeddedFiles);
++
+ m_poppler_get_INT(Catalog, numJS);
+
+ static int m_Catalog_getJS(lua_State * L)
+@@ -770,20 +727,7 @@
+ return 0;
+ }
+
+-static int m_Dict_is(lua_State * L)
+-{
+- const char *s;
+- udstruct *uin;
+- uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
+- if (uin->pd != NULL && uin->pd->pc != uin->pc)
+- pdfdoc_changed_error(L);
+- s = luaL_checkstring(L, 2);
+- if (((Dict *) uin->d)->is((char *) s))
+- lua_pushboolean(L, 1);
+- else
+- lua_pushboolean(L, 0);
+- return 1;
+-}
++m_poppler_check_string(Dict, is);
+
+ static int m_Dict_lookup(lua_State * L)
+ {
+@@ -894,6 +838,8 @@
+ return 1;
+ }
+
++m_poppler_check_string(Dict, hasKey);
++
+ m_poppler__tostring(Dict);
+
+ static const struct luaL_Reg Dict_m[] = {
+@@ -910,6 +856,7 @@
+ {"getKey", m_Dict_getKey},
+ {"getVal", m_Dict_getVal},
+ {"getValNF", m_Dict_getValNF},
++ {"hasKey", m_Dict_hasKey},
+ {"__tostring", m_Dict__tostring},
+ {NULL, NULL} // sentinel
+ };
+@@ -1017,9 +964,13 @@
+ //**********************************************************************
+ // Links
+
++m_poppler_get_INT(Links, getNumLinks);
++
+ m_poppler__tostring(Links);
+
+ static const struct luaL_Reg Links_m[] = {
++ {"getNumLinks", m_Links_getNumLinks},
++ //{"getLink", m_Links_getLink},
+ {"__tostring", m_Links__tostring},
+ {NULL, NULL} // sentinel
+ };
+@@ -1925,28 +1876,6 @@
+ m_poppler_get_poppler(Page, Dict, getResourceDict);
+ m_poppler_get_OBJECT(Page, getAnnots);
+
+-static int m_Page_getLinks(lua_State * L)
+-{
+- Links *links;
+- udstruct *uin, *ucat, *uout;
+- uin = (udstruct *) luaL_checkudata(L, 1, M_Page);
+- ucat = (udstruct *) luaL_checkudata(L, 2, M_Catalog);
+- if (uin->pd != NULL && ucat->pd != NULL && uin->pd != ucat->pd)
+- pdfdoc_differs_error(L);
+- if ((uin->pd != NULL && uin->pd->pc != uin->pc)
+- || (ucat->pd != NULL && ucat->pd->pc != ucat->pd->pc))
+- pdfdoc_changed_error(L);
+- links = ((Page *) uin->d)->getLinks();
+- if (links != NULL) {
+- uout = new_Links_userdata(L);
+- uout->d = links;
+- uout->pc = uin->pc;
+- uout->pd = uin->pd;
+- } else
+- lua_pushnil(L);
+- return 1;
+-}
+-
+ m_poppler_get_OBJECT(Page, getContents);
+
+ m_poppler__tostring(Page);
+@@ -1973,7 +1902,6 @@
+ {"getSeparationInfo", m_Page_getSeparationInfo},
+ {"getResourceDict", m_Page_getResourceDict},
+ {"getAnnots", m_Page_getAnnots},
+- {"getLinks", m_Page_getLinks},
+ {"getContents", m_Page_getContents},
+ {"__tostring", m_Page__tostring},
+ {NULL, NULL} // sentinel
+@@ -2158,19 +2086,23 @@
+
+ static int m_PDFDoc_getLinks(lua_State * L)
+ {
+- int i;
++ int i, pages;
+ Links *links;
+ udstruct *uin, *uout;
+ uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
+ if (uin->pd != NULL && uin->pd->pc != uin->pc)
+ pdfdoc_changed_error(L);
+ i = luaL_checkint(L, 2);
+- links = ((PdfDocument *) uin->d)->doc->getLinks(i);
+- if (links != NULL) {
+- uout = new_Links_userdata(L);
+- uout->d = links;
+- uout->pc = uin->pc;
+- uout->pd = uin->pd;
++ pages = ((PdfDocument *) uin->d)->doc->getNumPages();
++ if (i > 0 && i <= pages) {
++ links = ((PdfDocument *) uin->d)->doc->getLinks(i);
++ if (links != NULL) {
++ uout = new_Links_userdata(L);
++ uout->d = links;
++ uout->pc = uin->pc;
++ uout->pd = uin->pd;
++ } else
++ lua_pushnil(L);
+ } else
+ lua_pushnil(L);
+ return 1;
+@@ -2249,6 +2181,8 @@
+ m_PDFDoc_INT(getPDFMajorVersion);
+ m_PDFDoc_INT(getPDFMinorVersion);
+
++m_poppler__tostring(PDFDoc);
++
+ static int m_PDFDoc__gc(lua_State * L)
+ {
+ udstruct *uin;
+@@ -2292,6 +2226,7 @@
+ {"getDocInfoNF", m_PDFDoc_getDocInfoNF},
+ {"getPDFMajorVersion", m_PDFDoc_getPDFMajorVersion},
+ {"getPDFMinorVersion", m_PDFDoc_getPDFMinorVersion},
++ {"__tostring", m_PDFDoc__tostring},
+ {"__gc", m_PDFDoc__gc}, // finalizer
+ {NULL, NULL} // sentinel
+ };
+@@ -2437,11 +2372,6 @@
+ "Flate", "JBIG2", "JPX", "Weird", NULL
+ };
+
+-#if 0
+-static const char *StreamColorSpaceModeNames[] =
+- { "CSNone", "CSDeviceGray", "CSDeviceRGB", "CSDeviceCMYK", NULL };
+-#endif
+-
+ m_poppler_get_INT(Stream, getKind);
+
+ static int m_Stream_getKindName(lua_State * L)
+@@ -2527,11 +2457,26 @@
+ m_poppler_get_OBJECT(XRef, getDocInfo);
+ m_poppler_get_OBJECT(XRef, getDocInfoNF);
+ m_poppler_get_INT(XRef, getNumObjects);
+-// getLastXRefPos
+ m_poppler_get_INT(XRef, getRootNum);
+ m_poppler_get_INT(XRef, getRootGen);
+ // getStreamEnd
+-// getEntry
++
++static int m_XRef_getNumEntry(lua_State * L)
++{
++ int i, offset;
++ udstruct *uin;
++ uin = (udstruct *) luaL_checkudata(L, 1, M_XRef);
++ if (uin->pd != NULL && uin->pd->pc != uin->pc)
++ pdfdoc_changed_error(L);
++ offset = luaL_checkint(L, 2);
++ i = ((XRef *) uin->d)->getNumEntry(offset);
++ if (i >= 0)
++ lua_pushinteger(L, i);
++ else
++ lua_pushnil(L);
++ return 1;
++}
++
+ m_poppler_get_poppler(XRef, Object, getTrailerDict);
+
+ m_poppler__tostring(XRef);
+@@ -2553,10 +2498,10 @@
+ {"getDocInfo", m_XRef_getDocInfo},
+ {"getDocInfoNF", m_XRef_getDocInfoNF},
+ {"getNumObjects", m_XRef_getNumObjects},
+- //
+ {"getRootNum", m_XRef_getRootNum},
+ {"getRootGen", m_XRef_getRootGen},
+- //
++ // {"getStreamEnd", m_XRef_getStreamEnd},
++ {"getNumEntry", m_XRef_getNumEntry},
+ {"getTrailerDict", m_XRef_getTrailerDict},
+ {"__tostring", m_XRef__tostring},
+ {NULL, NULL} // sentinel
+@@ -2565,7 +2510,10 @@
+ //**********************************************************************
+ // XRefEntry
+
++m_poppler__tostring(XRefEntry);
++
+ static const struct luaL_Reg XRefEntry_m[] = {
++ {"__tostring", m_XRefEntry__tostring},
+ {NULL, NULL} // sentinel
+ };
+
+@@ -2582,7 +2530,6 @@
+ int luaopen_epdf(lua_State * L)
+ {
+ register_meta(Annot);
+- // TODO register_meta(AnnotBorder);
+ register_meta(Annots);
+ register_meta(Array);
+ register_meta(Catalog);
diff --git a/dev-tex/luatex/files/remove-zlib-version-check.patch b/dev-tex/luatex/files/remove-zlib-version-check.patch
new file mode 100644
index 00000000..98508501
--- /dev/null
+++ b/dev-tex/luatex/files/remove-zlib-version-check.patch
@@ -0,0 +1,23 @@
+Let soname dictate the ABI and do not check for minor/micro which requires
+needless rebuilds after every zlib update. By Ulrich Müller.
+
+https://bugs.gentoo.org/show_bug.cgi?id=310487
+http://www.ntg.nl/pipermail/dev-luatex/2012-July/004534.html
+
+--- luatex-beta-0.70.1-orig/source/texk/web2c/luatexdir/luazlib/lzlib.c
++++ luatex-beta-0.70.1/source/texk/web2c/luatexdir/luazlib/lzlib.c
+@@ -549,14 +549,6 @@
+
+ /* ====================================================================== */
+
+- /* make sure header and library version are consistent */
+- const char* version = zlibVersion();
+- if (strncmp(version, ZLIB_VERSION, 5))
+- {
+- lua_pushfstring(L, "zlib library version does not match - header: %s, library: %s", ZLIB_VERSION, version);
+- lua_error(L);
+- }
+-
+ /* create new metatable for zlib compression structures */
+ luaL_newmetatable(L, ZSTREAMMETA);
+ lua_pushliteral(L, "__index");
diff --git a/dev-tex/luatex/luatex-0.70.1-r99.ebuild b/dev-tex/luatex/luatex-0.70.1-r99.ebuild
new file mode 100644
index 00000000..ae454731
--- /dev/null
+++ b/dev-tex/luatex/luatex-0.70.1-r99.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-tex/luatex/luatex-0.70.1-r2.ebuild,v 1.12 2013/08/14 11:24:49 patrick Exp $
+
+EAPI=5
+
+inherit libtool eutils texlive-common
+
+DESCRIPTION="An extended version of pdfTeX using Lua as an embedded scripting language."
+HOMEPAGE="http://www.luatex.org/"
+SRC_URI="http://foundry.supelec.fr/gf/download/frsrelease/392/1730/${PN}-beta-${PV}.tar.bz2
+ http://foundry.supelec.fr/gf/download/frsrelease/392/1732/${PN}-beta-${PV}-doc.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="doc"
+
+RDEPEND="dev-libs/zziplib
+ >=media-libs/libpng-1.4
+ app-text/poppler:=[xpdf-headers(+)]
+ sys-libs/zlib
+ >=dev-libs/kpathsea-6.0.1_p20110627"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S="${WORKDIR}/${PN}-beta-${PV}/source"
+PRELIBS="libs/obsdcompat"
+#texk/kpathsea"
+#kpathsea_extraconf="--disable-shared --disable-largefile"
+
+src_prepare() {
+ has_version '>=app-text/poppler-0.18.0:0' && epatch "${FILESDIR}/poppler018.patch"
+ has_version '>=app-text/poppler-0.20.0:0' && epatch "${FILESDIR}/poppler020.patch"
+ has_version '>=app-text/poppler-0.22.0:0' && epatch "${FILESDIR}/poppler022.patch"
+ epatch "${FILESDIR}/kpathsea2012.patch" \
+ "${FILESDIR}/remove-zlib-version-check.patch" \
+ "${FILESDIR}/jmpbuf.patch"
+ S="${S}/build-aux" elibtoolize --shallow
+}
+
+src_configure() {
+ # Too many regexps use A-Z a-z constructs, what causes problems with locales
+ # that don't have the same alphabetical order than ascii. Bug #244619
+ # So we set LC_ALL to C in order to avoid problems.
+ export LC_ALL=C
+
+ local myconf
+ myconf=""
+ #has_version '>=app-text/texlive-core-2009' && myconf="--with-system-kpathsea"
+
+ cd "${S}/texk/web2c"
+ econf \
+ --disable-cxx-runtime-hack \
+ --disable-all-pkgs \
+ --disable-mp \
+ --disable-ptex \
+ --disable-tex \
+ --disable-mf \
+ --disable-largefile \
+ --disable-ipc \
+ --disable-shared \
+ --enable-luatex \
+ --enable-dump-share \
+ --without-mf-x-toolkit \
+ --without-x \
+ --with-system-kpathsea \
+ --with-kpathsea-includes="${EPREFIX}"/usr/include \
+ --with-system-gd \
+ --with-system-libpng \
+ --with-system-teckit \
+ --with-system-zlib \
+ --with-system-t1lib \
+ --with-system-xpdf \
+ --with-system-poppler \
+ --with-system-zziplib \
+ --disable-multiplatform
+
+ for i in ${PRELIBS} ; do
+ einfo "Configuring $i"
+ local j=$(basename $i)_extraconf
+ local myconf
+ eval myconf=\${$j}
+ cd "${S}/${i}"
+ econf ${myconf}
+ done
+}
+
+src_compile() {
+ texk/web2c/luatexdir/getluatexsvnversion.sh || die
+ for i in ${PRELIBS} ; do
+ cd "${S}/${i}"
+ emake || die "failed to build ${i}"
+ done
+ cd "${WORKDIR}/${PN}-beta-${PV}/source/texk/web2c"
+ emake luatex || die "failed to build luatex"
+}
+
+src_install() {
+ cd "${WORKDIR}/${PN}-beta-${PV}/source/texk/web2c"
+ emake DESTDIR="${D}" bin_PROGRAMS="luatex" SUBDIRS="" nodist_man_MANS="" \
+ install-exec-am || die
+
+ dodoc "${WORKDIR}/${PN}-beta-${PV}/README" || die
+ doman "${WORKDIR}/texmf/doc/man/man1/"*.1 || die
+ if use doc ; then
+ dodoc "${WORKDIR}/${PN}-beta-${PV}/manual/"*.pdf || die
+ dodoc "${WORKDIR}/texmf/doc/man/man1/"*.pdf || die
+ fi
+}
+
+pkg_postinst() {
+ if ! has_version '>=dev-texlive/texlive-basic-2008' ; then
+ elog "Note that this package does not install many files, mainly just the"
+ elog "${PN} executable, which needs other files in order to be"
+ elog "useful. Please consider installing a recent TeX distribution such as"
+ elog "TeX Live 2008 or later to take advantage of the full power of"
+ elog "${PN} ."
+ fi
+ efmtutil-sys
+}
diff --git a/dev-tex/luatex/metadata.xml b/dev-tex/luatex/metadata.xml
new file mode 100644
index 00000000..1d2fc95b
--- /dev/null
+++ b/dev-tex/luatex/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>tex</herd>
+<longdescription lang="en">
+An experimental pdfTeX extension that is to eventually
+become its successor. It is developed by a subset of the
+current pdfTeX team.
+</longdescription>
+</pkgmetadata>
diff --git a/dev-util/strace/Manifest b/dev-util/strace/Manifest
new file mode 100644
index 00000000..8a02f404
--- /dev/null
+++ b/dev-util/strace/Manifest
@@ -0,0 +1,4 @@
+AUX strace-4.8-musl.patch 5023 SHA256 f9b03b807681841b7fa0062235b597628af0e9b7ddad8582f08ab660b0e492bc SHA512 cf539cd9fa51c58b23e65a3c299f25efbe5d3c0475c758858b700138323c876a881f137c448f3a3e3a70acc5373374a4a1f8ad1372a6be73ae336c98f7ff1608 WHIRLPOOL 73261a65a9fb1054f66e4f4f1ac9cdac831f97c338c3cc8a1d8d16ac1f7a642e6ec7c982500ad75543344c4624dcde3b59203e86376d7370bcfad49274f82653
+DIST strace-4.8.tar.xz 441712 SHA256 f492291f07a7c805c07a8395cce1ea054a6401ad414f4cc12185672215e1d7f8 SHA512 c3316382f60cd4d02eec1eef46a0ef2d000afbccf2c176a6fec652e1b3391685f0e33f184497cb3ccf54d72d460471a4945d3a864fb5bce1f45f32fdf132cfe3 WHIRLPOOL 0ca28920b73d3b70a87bffff77c9af6bb9179f0918589f90613e68a499f84cc399e306b4f1832e1dd9e825c94671fcb69a5f08f6c64e6000411553e0b911e6d2
+EBUILD strace-4.8-r99.ebuild 1226 SHA256 3943f34c983aa262c147bc64eeafb84d952486f8ee1eef9fcb66554cdb87efa7 SHA512 5ddd3c86e43d552843d1c5348e25c296e2c2406e3c609b33d193aca635b9e7b099399a122dbd3c4f8637f8bd3e71b9cb4d01c26834f55ae2005273fa3395a36f WHIRLPOOL 155f210d0402bca92d5017547eb7fead1f8f3c507d4e67cdce84ba2cf6185f47af854be279266c7067968ce0f53f7016abfc1f955f9e0d7da56ff6a79608e081
+MISC metadata.xml 305 SHA256 bd45e0108da45e19fd1d940ab451b2195fb9dc21d4c397435e2ca9c1848845ce SHA512 fb6e6f53e8754da30643d9fb07a30c2a11d0cdd91fe1b62498396d040242e5f164477715d84a2a89a1fb757a861a8cc8fa3a2ca67e85dc71ac436a5b4b07a56e WHIRLPOOL 0d316f0a6985a4c4b2b83a5a495e206d9a6b2cc53d5f4924cb9111bd9fab5d993cb550dc60e2fbadefff30bb386a786b78831745725f1bbed77f490f9c1dc87e
diff --git a/dev-util/strace/files/strace-4.8-musl.patch b/dev-util/strace/files/strace-4.8-musl.patch
new file mode 100644
index 00000000..ac9cf562
--- /dev/null
+++ b/dev-util/strace/files/strace-4.8-musl.patch
@@ -0,0 +1,168 @@
+taken from sabotage linux
+diff -ru strace-4.8.orig/defs.h strace-4.8/defs.h
+--- strace-4.8.orig/defs.h 2013-05-14 14:10:42.000000000 +0000
++++ strace-4.8/defs.h 2013-09-20 14:30:38.785856744 +0000
+@@ -155,7 +155,7 @@
+ || defined(METAG) \
+ || defined(TILE) \
+ || defined(XTENSA) \
+- ) && defined(__GLIBC__)
++ ) && defined(__linux__)
+ # include <sys/ptrace.h>
+ #else
+ /* Work around awkward prototype in ptrace.h. */
+@@ -222,7 +222,7 @@
+ # define PTRACE_EVENT_EXIT 6
+ #endif
+
+-#if !defined(__GLIBC__)
++#if !defined(__GLIBC__) && !defined(PTRACE_PEEKUSER)
+ # define PTRACE_PEEKUSER PTRACE_PEEKUSR
+ # define PTRACE_POKEUSER PTRACE_POKEUSR
+ #endif
+diff -ru strace-4.8.orig/desc.c strace-4.8/desc.c
+--- strace-4.8.orig/desc.c 2013-05-01 22:39:10.000000000 +0000
++++ strace-4.8/desc.c 2013-09-20 14:30:38.795856744 +0000
+@@ -299,7 +299,7 @@
+ #ifdef X32
+ tprintf(", start=%lld, len=%lld", fl.l_start, fl.l_len);
+ #else
+- tprintf(", start=%ld, len=%ld", fl.l_start, fl.l_len);
++ tprintf(", start=%ld, len=%ld", (long) fl.l_start, (long) fl.l_len);
+ #endif
+ if (getlk)
+ tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
+diff -ru strace-4.8.orig/file.c strace-4.8/file.c
+--- strace-4.8.orig/file.c 2013-05-06 18:23:01.000000000 +0000
++++ strace-4.8/file.c 2013-09-20 14:30:38.795856744 +0000
+@@ -632,7 +632,7 @@
+ return 0;
+ }
+
+-#if _LFS64_LARGEFILE
++#if defined _LFS64_LARGEFILE || defined HAVE_LONG_LONG_OFF_T
+ int
+ sys_truncate64(struct tcb *tcp)
+ {
+@@ -654,7 +654,7 @@
+ return 0;
+ }
+
+-#if _LFS64_LARGEFILE
++#if defined _LFS64_LARGEFILE || defined HAVE_LONG_LONG_OFF_T
+ int
+ sys_ftruncate64(struct tcb *tcp)
+ {
+@@ -2322,7 +2322,7 @@
+ return 0;
+ }
+
+-#if _LFS64_LARGEFILE
++#if defined _LFS64_LARGEFILE || defined HAVE_LONG_LONG_OFF_T
+ int
+ sys_getdents64(struct tcb *tcp)
+ {
+diff -ru strace-4.8.orig/net.c strace-4.8/net.c
+--- strace-4.8.orig/net.c 2013-05-17 22:20:02.000000000 +0000
++++ strace-4.8/net.c 2013-09-20 14:30:38.805856744 +0000
+@@ -95,12 +95,14 @@
+ #endif
+
+ /* Under Linux these are enums so we can't test for them with ifdef. */
++#if !defined(IPPROTO_MAX)
+ #define IPPROTO_EGP IPPROTO_EGP
+ #define IPPROTO_PUP IPPROTO_PUP
+ #define IPPROTO_IDP IPPROTO_IDP
+ #define IPPROTO_IGMP IPPROTO_IGMP
+ #define IPPROTO_RAW IPPROTO_RAW
+ #define IPPROTO_MAX IPPROTO_MAX
++#endif
+
+ static const struct xlat domains[] = {
+ #ifdef PF_UNSPEC
+diff -ru strace-4.8.orig/process.c strace-4.8/process.c
+--- strace-4.8.orig/process.c 2013-05-17 22:22:19.000000000 +0000
++++ strace-4.8/process.c 2013-09-20 14:30:38.805856744 +0000
+@@ -2857,7 +2857,7 @@
+ if (umove(tcp, tcp->u_arg[2], &p) < 0)
+ tprintf(", %#lx", tcp->u_arg[2]);
+ else
+- tprintf(", { %d }", p.__sched_priority);
++ tprintf(", { %d }", p.sched_priority);
+ }
+ return 0;
+ }
+@@ -2872,7 +2872,7 @@
+ if (umove(tcp, tcp->u_arg[1], &p) < 0)
+ tprintf("%#lx", tcp->u_arg[1]);
+ else
+- tprintf("{ %d }", p.__sched_priority);
++ tprintf("{ %d }", p.sched_priority);
+ }
+ return 0;
+ }
+@@ -2885,7 +2885,7 @@
+ if (umove(tcp, tcp->u_arg[1], &p) < 0)
+ tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
+ else
+- tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
++ tprintf("%d, { %d }", (int) tcp->u_arg[0], p.sched_priority);
+ }
+ return 0;
+ }
+diff -ru strace-4.8.orig/signal.c strace-4.8/signal.c
+--- strace-4.8.orig/signal.c 2013-05-23 13:41:23.000000000 +0000
++++ strace-4.8/signal.c 2013-09-20 14:30:38.815856744 +0000
+@@ -59,6 +59,7 @@
+ #ifdef IA64
+ # include <asm/ptrace_offsets.h>
+ #endif
++#include <asm/ptrace.h>
+
+ #if defined(SPARC) || defined(SPARC64) || defined(MIPS)
+ typedef struct {
+diff -ru strace-4.8.orig/strace.c strace-4.8/strace.c
+--- strace-4.8.orig/strace.c 2013-05-28 21:49:16.000000000 +0000
++++ strace-4.8/strace.c 2013-09-20 14:30:38.815856744 +0000
+@@ -506,7 +506,7 @@
+ perror_msg_and_die("dup2");
+ close(fds[0]);
+ }
+- execl(_PATH_BSHELL, "sh", "-c", command, NULL);
++ execl(_PATH_BSHELL, "sh", "-c", command, (void*) 0);
+ perror_msg_and_die("Can't execute '%s'", _PATH_BSHELL);
+ }
+
+diff -ru strace-4.8.orig/syscall.c strace-4.8/syscall.c
+--- strace-4.8.orig/syscall.c 2013-05-14 14:10:42.000000000 +0000
++++ strace-4.8/syscall.c 2013-09-20 14:30:38.825856744 +0000
+@@ -72,13 +72,7 @@
+ # include <elf.h>
+ #endif
+
+-#if defined(AARCH64)
+-# include <asm/ptrace.h>
+-#endif
+-
+-#if defined(XTENSA)
+-# include <asm/ptrace.h>
+-#endif
++#include <asm/ptrace.h>
+
+ #ifndef ERESTARTSYS
+ # define ERESTARTSYS 512
+diff -ru strace-4.8.orig/time.c strace-4.8/time.c
+--- strace-4.8.orig/time.c 2012-05-01 21:17:51.000000000 +0000
++++ strace-4.8/time.c 2013-09-20 14:32:49.165856719 +0000
+@@ -774,7 +774,11 @@
+ /* _pad[0] is the _tid field which might not be
+ present in the userlevel definition of the
+ struct. */
++#if defined(__GLIBC__)
+ tprintf("{%d}", sev._sigev_un._pad[0]);
++#else
++ tprintf("{%d}", (int) sev.__pad[0]);
++#endif
+ else if (sev.sigev_notify == SIGEV_THREAD)
+ tprintf("{%p, %p}", sev.sigev_notify_function,
+ sev.sigev_notify_attributes);
diff --git a/dev-util/strace/metadata.xml b/dev-util/strace/metadata.xml
new file mode 100644
index 00000000..3134acb4
--- /dev/null
+++ b/dev-util/strace/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="aio">
+ Enable <pkg>dev-libs/libaio</pkg> support for tracing Asynchronous I/O operations
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-util/strace/strace-4.8-r99.ebuild b/dev-util/strace/strace-4.8-r99.ebuild
new file mode 100644
index 00000000..2d1c7455
--- /dev/null
+++ b/dev-util/strace/strace-4.8-r99.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/strace/strace-4.8.ebuild,v 1.5 2014/02/20 13:36:59 jer Exp $
+
+EAPI="4"
+
+inherit flag-o-matic eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://strace.git.sourceforge.net/gitroot/strace/strace"
+ inherit git-2 autotools
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+ KEYWORDS="amd64 arm ~mips ppc x86"
+fi
+
+DESCRIPTION="A useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="http://sourceforge.net/projects/strace/"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="aio +perl static"
+
+# strace only uses the header from libaio to decode structs
+DEPEND="aio? ( >=dev-libs/libaio-0.3.106 )
+ sys-kernel/linux-headers"
+RDEPEND=""
+
+src_prepare() {
+ if epatch_user || [[ ! -e configure ]] ; then
+ # git generation
+ eautoreconf
+ [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+ fi
+
+ epatch ${FILESDIR}/${P}-musl.patch
+ export ac_cv_have_long_long_off_t=yes
+
+ filter-lfs-flags # configure handles this sanely
+ use static && append-ldflags -static
+
+ export ac_cv_header_libaio_h=$(usex aio)
+}
+
+src_install() {
+ default
+ use perl || rm "${ED}"/usr/bin/strace-graph
+ dodoc CREDITS
+}
diff --git a/dev-vcs/cvs/Manifest b/dev-vcs/cvs/Manifest
new file mode 100644
index 00000000..2bece116
--- /dev/null
+++ b/dev-vcs/cvs/Manifest
@@ -0,0 +1,15 @@
+AUX cvs-1.12.12-block-requests.patch 4006 SHA256 70bbf745815d1e01582329160a10f5cdd9c11051e4e62d331686dd5124e01294 SHA512 541545ffc64c4f2303b7e8f6cae2cdff0437452e4bcf94b2149d51e43710096e17f024c1a8ed32433560ea51ecef2aba2f3e6bfaef8fa9e4ad2f2436649884d1 WHIRLPOOL 4c56980ea0d307789ace423e7fcafb86c82429f82cfbe6d873706f95e6e2554e06268540d23b9718113e5182b83b01bb22d02ae649e27feaac1dfd09b38fa892
+AUX cvs-1.12.12-cvs-gnulib-vasnprintf.patch 1092 SHA256 f38e6bbb0fd8b783b654ac775183a1cb24e3987698fdbd706a8d5fa59a45f945 SHA512 6c0be276f6e86dbe3646ada02ea57194b8c7d1e4d76c5faeb06750435599aa4125253bdf7af6232f53807977acb34aba093bc8bfa2ce98389c5ee80b2fd6e05d WHIRLPOOL 0b5dd5ee3c11fae83688d900db2ce678870c79b753c1ffde9aa11a6fe18286af7e24d57f2ce28ffcdbfb42172a0e87baed58047497248ffb1a37acca93ad716f
+AUX cvs-1.12.12-cvsbug-tmpfix.patch 624 SHA256 061c26d140e1195200f1cc76217b2e7c2ff7f0c4dcbbb31124b386e8e756938e SHA512 29014631f5595dbf51a47032a19a23e545190dd8d40d77a71d363cee07a9ae38263b67db52a512436a9a7b37a7f5ff4daafa4a0a9f3c29bcfeb71ecff74408b7 WHIRLPOOL 09d53fa26159defe56cdbd414b699bd7c5be07f36b0b5addd367b393985bd7c98f14189db5b2793af0fc37d052f21af1f97c3775d46d71cebdfff15c447a9d5a
+AUX cvs-1.12.12-install-sh.patch 495 SHA256 9c2fc03b42804f8edb3a5a6f9c9e80bd68924f265ce52d196c3b5c759ba42f8a SHA512 7e468d41c1eb23c0a62b605e6e48cffc004e8f386a87a9696dd73b36702c74aad529f5cba7280dee1100027b6e1e907adad257cc446ca3ad734fa40d47e4ff72 WHIRLPOOL 1eaf9e7ccab89cd0d2c95440da0454779b13d6efc4b2a773d41f58998353a2670134344d6a97379103f3ba6e8b6c96c93db0b6229821bb8c12ce037a3b7ddb64
+AUX cvs-1.12.12-mktime-x32.patch 916 SHA256 107b0adceda7c8b7b8e89604f38ea0e7a903420dc58dbf22c5eeac947d63d0e1 SHA512 4a58c0f94de8e19c2de1930b7e5e04816e79a86885c89b792616a4c43f6e12aef271005ae59ae0d5788a910ba97735ccdf35f0ef5faafc2e3c50a9858b8f6216 WHIRLPOOL 5ca4316ee5a272efabe6da249476f6f916851fa92338368616aff03f380b2cd290391faa455e914e423ce74a00122336e6bfa93236a8412c1f32103040e3038a
+AUX cvs-1.12.12-openat.patch 761 SHA256 5b9fc46c2ee46d9136ddfc8d0baaac6087d8cae40fa5521815c3c2e372f25b9f SHA512 b0a7abc785169705d2f0668a8af706f93ee3eba3d050d555689577962283e54f6bd186e662b64c65f926cf72dff76a37259181338707d641ee0f20591ba62805 WHIRLPOOL 31c9eb71d9d8cf5dff05e48c054e29b720702c6c12cafd7a2dd9687578bb1c441cf5e90c355b9164dee6b14f6c5cb7a2f4ad7d9ff4831f3ce2f02f82ffd082f7
+AUX cvs-1.12.12-regex.patch 396 SHA256 0f8a66e61d92a0a9c23854a2b0f16f75f056cc804003a89428ae59d6ac48109a SHA512 0ea01d1df9e5f91c36d475639db10a22eb52fa7d23cc687482c09489d7ae19a4e5917476c61b7de15fe037775bef92aa206e01e58c26f7dd4ce7b02675eac40c WHIRLPOOL c6f3a33520dff71b4d91b5d4ed281db0bc4f671bf7c0f507052f9e7a202b2a65ac97c9b70c840cdc634dc07fb7600534744d5ff948f383ece2661c0fe4a4cbed
+AUX cvs.pam-include-1.12.12 106 SHA256 8291f84c2d76269e7be6487ae1db7212e67ee7313d35e6b0cebcd01e30d155af SHA512 1e72da3f959433e59d0153ff09e53a79bb68793506456e38d7070ffe4fcf6d596fdc3740dd2325d626a8dbd356dd11d93fbd5f220515f2435a94b90bb5833fb9 WHIRLPOOL 4580958cbd6955c5fc3e84d4b5c5877c2e94c5a3de326f6936c641cda43a588196871b43280cdbe16c8274049a08eb73ac7067a5166b1f613770f4ea24afc5eb
+AUX cvspserver.xinetd.d 282 SHA256 71b62c4f278ed17bf3cac8eacb2bfb17b6125bfe77f83b46fa5742395b74ef5f SHA512 6845a5fc38ed9d8f9194f14137066c3f2640f09ebc1dce7e9fa7c49761534003e5b1c59593496ba9f88a6c9b1196980bc145a2e2fdcbf662360d1b1ca8821411 WHIRLPOOL 949abc87f0d7c8f104ce8a896fdfd94e3db8f60d5aaa948d3358e348b17de942f19ba68fe545ec2af0026643d7b5efd5bc3bc26ccc7da47c70c544d01879646a
+DIST cederqvist-1.12.12.html.tar.bz2 137581 SHA256 6bdd66581ec363e05313a14db27cd3c201b547cdfc9ea2f8edde74e78301f0f6 SHA512 c4f6bdc294b719c1c9f6e8b7d1d4faa9e2aafccd37924e9d4772f8d802da3e7f5ae1778b295989db256b23bb1d0914023db7237adaf07833caaee499ae6b6fa3 WHIRLPOOL 41dd1e0d944a02eeca10539b87b5cfcadbf4fd5923c872aa86e5673bb6a98f774d5378e8b4f1c2e6c6a62e6dc6a4d02c69b5e51ad03da899903070effd62adc9
+DIST cederqvist-1.12.12.pdf 1252423 SHA256 211c5792d24bfd5694f23bc217a161d880bfb2447c41016fab6f657168b041ce SHA512 aa90b76664ca103cf41831a5595d5e99df9fd87633aa5a500569f43854ca6e409a26b655f02ed59cde1c37ce88c40e06f3b3376ad71fdc9487032c3f0898706a WHIRLPOOL 88d015117c05716df6d0cdc763f16dc488f0641624475e9bd33478485dd32e36a7ee5c49a1789ebdd173e665ae5963e75975342d7308e8e453adb65dd31ec6c5
+DIST cederqvist-1.12.12.ps 1262208 SHA256 0e14189614e2c5ead49bfe0ecd187239f8adc3e66371b49d52163be821e44cab SHA512 9a061ef90c664fbb4f882644f72c4f80ffbe0233b6b364511b1c7f18f0a53383980a6ddda326b6df1f2fe1899aed3225de89b55a65a1d9101ba81d1c10c067e2 WHIRLPOOL fb1616ca734e51a626713e7e78786ecbff18378966c2c131f6992df248096d38e850123449d3a5a6aa111ee209f90ef48848da7366b21cb6befeccf07ce54ab6
+DIST cvs-1.12.12.tar.bz2 3197171 SHA256 9fb9176d268b9019768fc57dedc2920c28fbeda5ba224c2348550d4f25043edc SHA512 31c679b77b887e02d9c8c381b0dfb42f1207ef4ca806cd92843638eb2126ed032e99bda70a3e20ea2a029670ff39c40088a43435632e381739e6c2f978e6f4bb WHIRLPOOL 74257976cdb957e86fb9fb7e54fc8c0b7210f72136ce05327203d935195e7a3bdda0c1d616dc04cb1d6495cb038ca7275e88488eddb5d936c1cfceb94583278c
+EBUILD cvs-1.12.12-r99.ebuild 2685 SHA256 aaeb076ab464014cf792edcc58071af9b26b1410ceda58da6d30e246ae0b675f SHA512 4562508693eaaf9d4df68ec7e8d22394ec7d640421fbdbb1145b011ec8b91ae2def4c2bb5a6581a43b38cee316bdfb2f135ab80486f0178e65e784dd5bad2568 WHIRLPOOL 7819b6029a7e046a28c45d35e8107975eff02570015639207ea8e7dd224748347da01b10ad6a3c5459c7388bfc924b355b1bfc27ae68ddceda9a2ac01c4d862a
+MISC metadata.xml 234 SHA256 ce7beba20d6099be006550fb74bb9e74628a9d6967c7ceb096ab99959df47a02 SHA512 a3496fff78817806f0d26ead02e33ecffa0461ae98d6d5cc1f4e2720668acbba89393516a25135bf779d46d8fd0b13c4ee83d31c825e5a199647533da746f613 WHIRLPOOL 6bbde883caeeae98119e6d7dc741843c5087f4e2629d65afbe02a778579b9fc58b24c8485ffadf432bc768e3f91998cdf5dfd819157ab5ca33fe3b157441ffbf
diff --git a/dev-vcs/cvs/cvs-1.12.12-r99.ebuild b/dev-vcs/cvs/cvs-1.12.12-r99.ebuild
new file mode 100644
index 00000000..955a67a1
--- /dev/null
+++ b/dev-vcs/cvs/cvs-1.12.12-r99.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/cvs/cvs-1.12.12-r6.ebuild,v 1.4 2014/01/19 10:30:16 vapier Exp $
+
+inherit eutils pam toolchain-funcs
+
+DESCRIPTION="Concurrent Versions System - source code revision control tools"
+HOMEPAGE="http://www.nongnu.org/cvs/"
+
+SRC_URI="mirror://gnu/non-gnu/cvs/source/feature/${PV}/${P}.tar.bz2
+ doc? ( mirror://gnu/non-gnu/cvs/source/feature/${PV}/cederqvist-${PV}.html.tar.bz2
+ mirror://gnu/non-gnu/cvs/source/feature/${PV}/cederqvist-${PV}.pdf
+ mirror://gnu/non-gnu/cvs/source/feature/${PV}/cederqvist-${PV}.ps )"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+
+IUSE="crypt doc kerberos nls pam server"
+
+DEPEND=">=sys-libs/zlib-1.1.4
+ kerberos? ( virtual/krb5 )
+ pam? ( virtual/pam )"
+
+src_unpack() {
+ unpack ${P}.tar.bz2
+ use doc && unpack cederqvist-${PV}.html.tar.bz2
+ EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${P}-cvsbug-tmpfix.patch
+ epatch "${FILESDIR}"/${P}-openat.patch
+ EPATCH_OPTS="-p1 -d ${S}" epatch "${FILESDIR}"/${P}-block-requests.patch
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-cvs-gnulib-vasnprintf.patch
+ epatch "${FILESDIR}"/${P}-install-sh.patch
+ epatch "${FILESDIR}"/${P}-regex.patch
+ epatch "${FILESDIR}"/${P}-mktime-x32.patch # 395641
+ use server || elog "If you want any CVS server functionality, you MUST emerge with USE=server!"
+}
+
+src_compile() {
+ if tc-is-cross-compiler ; then
+ # Sane defaults when cross-compiling (as these tests want to
+ # try and execute code).
+ export cvs_cv_func_printf_ptr="yes"
+ fi
+ econf \
+ --with-external-zlib \
+ --with-tmpdir=/tmp \
+ $(use_enable crypt encryption) \
+ $(use_with kerberos gssapi) \
+ $(use_enable nls) \
+ $(use_enable pam) \
+ $(use_enable server) \
+ || die
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ insinto /etc/xinetd.d
+ newins "${FILESDIR}"/cvspserver.xinetd.d cvspserver || die "newins failed"
+
+ dodoc BUGS ChangeLog* DEVEL* FAQ HACKING \
+ MINOR* NEWS PROJECTS README* TESTS TODO
+
+ # Not installed into emacs site-lisp because it clobbers the normal C
+ # indentations.
+ dodoc cvs-format.el || die "dodoc failed"
+
+ use server && newdoc "${FILESDIR}"/cvs-1.12.12-cvs-custom.c cvs-custom.c
+
+ if use doc; then
+ dodoc "${DISTDIR}"/cederqvist-${PV}.pdf
+ dodoc "${DISTDIR}"/cederqvist-${PV}.ps
+ tar xjf "${DISTDIR}"/cederqvist-${PV}.html.tar.bz2
+ dohtml -r cederqvist-${PV}.html/*
+ cd "${D}"/usr/share/doc/${PF}/html/
+ ln -s cvs.html index.html
+ fi
+
+ newpamd "${FILESDIR}"/cvs.pam-include-1.12.12 cvs
+}
+
+src_test() {
+ einfo "FEATURES=\"maketest\" has been disabled for dev-vcs/cvs"
+}
diff --git a/dev-vcs/cvs/files/cvs-1.12.12-block-requests.patch b/dev-vcs/cvs/files/cvs-1.12.12-block-requests.patch
new file mode 100644
index 00000000..9c9b49db
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-block-requests.patch
@@ -0,0 +1,140 @@
+Author: Robin H. Johnson <robbat2@gentoo.org>
+Date: 2006-08-09
+
+This patch allows a CVS server to deny usage of specific commands, based on
+input in the environment.
+
+Just set the CVS_BLOCK_REQUESTS env var with all of the commands you want,
+seperated by spaces. Eg:
+CVS_BLOCK_REQUESTS="Gzip-stream gzip-file-contents"
+would block ALL usage of compression.
+
+Please see the array 'struct request requests[]' in src/server.c for a full
+list of commands.
+
+Please note that if you block any commands marked as RQ_ESSENTIAL, CVS clients
+may fail! (This includes 'ci'!).
+
+See the companion cvs-custom.c for a wrapper that can enforce the environment variable for pserver setups.
+
+Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
+
+diff -Nuar --exclude '*~' -U 10 cvs-1.12.12.orig/src/server.c cvs-1.12.12/src/server.c
+--- cvs-1.12.12.orig/src/server.c 2005-04-14 14:13:29.000000000 +0000
++++ cvs-1.12.12/src/server.c 2006-08-09 01:40:44.000000000 +0000
+@@ -5836,43 +5836,90 @@
+ #undef REQ_LINE
+ };
+ #endif /* SERVER_SUPPORT or CLIENT_SUPPORT */
+
+
+
+ #ifdef SERVER_SUPPORT
+ /*
+ * This server request is not ignored by the secondary.
+ */
++
++/* Hack by Robin H. Johnson <robbat2@gentoo.org>.
++ * Allow the server ENV to specify what request types are to be ignored.
++ */
++
++static char blocked_requests[BUFSIZ] = " ";
++
++static void build_blocked_requests() {
++ char *tmp = getenv("CVS_BLOCK_REQUESTS");
++
++ if (tmp != NULL && strlen(tmp) > 0) {
++ // move to our custom buffer
++ strncat(blocked_requests, tmp, sizeof(blocked_requests)-strlen(blocked_requests));
++ //add a space on the end as well for searching
++ strncat(blocked_requests, " ", sizeof(blocked_requests)-strlen(blocked_requests));
++ }
++
++ // now blocked_requests contains the list of every request that we do not
++ // want to serve
++}
++
++// returns 0 if we should serve this request
++// use as if(checker(FOO)) continue;
++static int serve_valid_requests_checker(char *reqname) {
++ char needle[BUFSIZ] = " ";
++ char *tmp;
++
++ if(!blocked_requests || strlen(blocked_requests) < 2)
++ return 0;
++
++ // we want to look for ' 'reqname' '
++ snprintf(needle, sizeof(needle), " %s ", reqname);
++
++ // now do the search
++ tmp = strstr(blocked_requests, needle);
++
++ if (tmp != NULL)
++ return 1;
++
++ return 0;
++
++}
++
+ static void
+ serve_valid_requests (char *arg)
+ {
+ struct request *rq;
+
+ /* Since this is processed in the first pass, don't reprocess it in the
+ * second.
+ *
+ * We still print errors since new errors could have been generated in the
+ * second pass.
+ */
+ if (print_pending_error ()
+ #ifdef PROXY_SUPPORT
+ || reprocessing
+ #endif /* PROXY_SUPPORT */
+ )
+ return;
++
++ build_blocked_requests();
+
+ buf_output0 (buf_to_net, "Valid-requests");
+ for (rq = requests; rq->name != NULL; rq++)
+ {
+ if (rq->func != NULL)
+ {
++ if(serve_valid_requests_checker(rq->name))
++ continue;
+ buf_append_char (buf_to_net, ' ');
+ buf_output0 (buf_to_net, rq->name);
+ }
+ }
+ buf_output0 (buf_to_net, "\nok\n");
+
+ /* The client is waiting for the list of valid requests, so we
+ must send the output now. */
+ buf_flush (buf_to_net, 1);
+ }
+@@ -6353,20 +6400,24 @@
+ cmd += len;
+ else if (cmd[len] == ' ')
+ cmd += len + 1;
+ else
+ /*
+ * The first len characters match, but it's a different
+ * command. e.g. the command is "cooperate" but we matched
+ * "co".
+ */
+ continue;
++ // Ignore commands that we are supposed to ignore.
++ if(serve_valid_requests_checker(rq->name))
++ continue;
++
+
+ if (!(rq->flags & RQ_ROOTLESS)
+ && current_parsed_root == NULL)
+ {
+ /* For commands which change the way in which data
+ is sent and received, for example Gzip-stream,
+ this does the wrong thing. Since the client
+ assumes that everything is being compressed,
+ unconditionally, there is no way to give this
+ error to the client without turning on
diff --git a/dev-vcs/cvs/files/cvs-1.12.12-cvs-gnulib-vasnprintf.patch b/dev-vcs/cvs/files/cvs-1.12.12-cvs-gnulib-vasnprintf.patch
new file mode 100644
index 00000000..d7d6e6bb
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-cvs-gnulib-vasnprintf.patch
@@ -0,0 +1,34 @@
+http://bugs.gentoo.org/213833
+
+commit 913c09becd9df89dbd9b9f386e7f35c240d5efe8
+Author: Bruno Haible <bruno@clisp.org>
+Date: Fri Oct 19 01:50:42 2007 +0200
+
+ Don't use %n on glibc >= 2.3 systems.
+
+diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
+index f563823..5d818aa 100644
+--- a/lib/vasnprintf.c
++++ b/lib/vasnprintf.c
+@@ -3385,9 +3385,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
+ #endif
+ *p = dp->conversion;
+ #if USE_SNPRINTF
++# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))
+ p[1] = '%';
+ p[2] = 'n';
+ p[3] = '\0';
++# else
++ /* On glibc2 systems from glibc >= 2.3 - probably also older
++ ones - we know that snprintf's returns value conforms to
++ ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
++ Therefore we can avoid using %n in this situation.
++ On glibc2 systems from 2004-10-18 or newer, the use of %n
++ in format strings in writable memory may crash the program
++ (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
++ in this situation. */
++ p[1] = '\0';
++# endif
+ #else
+ p[1] = '\0';
+ #endif
diff --git a/dev-vcs/cvs/files/cvs-1.12.12-cvsbug-tmpfix.patch b/dev-vcs/cvs/files/cvs-1.12.12-cvsbug-tmpfix.patch
new file mode 100644
index 00000000..fcd4431e
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-cvsbug-tmpfix.patch
@@ -0,0 +1,22 @@
+Index: cvs-1.12.12/src/cvsbug.in
+===================================================================
+--- cvs-1.12.12.orig/src/cvsbug.in
++++ cvs-1.12.12/src/cvsbug.in
+@@ -109,14 +109,14 @@ elif [ -f /bin/domainname ]; then
+ /usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" |
+ cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
+ ORIGINATOR="`cat $TEMP`"
+- rm -f $TEMP
++ > $TEMP
+ fi
+ fi
+
+ if [ "$ORIGINATOR" = "" ]; then
+ grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP
+ ORIGINATOR="`cat $TEMP`"
+- rm -f $TEMP
++ > $TEMP
+ fi
+
+ if [ -n "$ORGANIZATION" ]; then
+
diff --git a/dev-vcs/cvs/files/cvs-1.12.12-install-sh.patch b/dev-vcs/cvs/files/cvs-1.12.12-install-sh.patch
new file mode 100644
index 00000000..825c0ee6
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-install-sh.patch
@@ -0,0 +1,12 @@
+diff -ur a/build-aux/install-sh b/build-aux/install-sh
+--- a/build-aux/install-sh 2006-03-25 20:04:46 +0000
++++ b/build-aux/install-sh 2007-09-14 10:53:29 +0100
+@@ -246,7 +246,7 @@
+ fi
+
+ if test -n "$dir_arg"; then
+- $doit $mkdircmd "$dst" \
++ { test -d "$dst" || $doit $mkdircmd -p "$dst"; } \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
diff --git a/dev-vcs/cvs/files/cvs-1.12.12-mktime-x32.patch b/dev-vcs/cvs/files/cvs-1.12.12-mktime-x32.patch
new file mode 100644
index 00000000..948fa4d7
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-mktime-x32.patch
@@ -0,0 +1,29 @@
+back port changes from upstream gnulib to make this work on x32
+
+https://bugs.gentoo.org/395641
+
+--- cvs-1.12.12/lib/mktime.c
++++ cvs-1.12.12/lib/mktime.c
+@@ -115,6 +115,13 @@
+ #define TM_YEAR_BASE 1900
+ verify (base_year_is_a_multiple_of_100, TM_YEAR_BASE % 100 == 0);
+
++#if INT_MAX <= LONG_MAX / 2
++typedef long int long_int;
++#else
++typedef long long int long_int;
++#endif
++verify (long_int_is_wide_enough, INT_MAX == INT_MAX * (long_int) 2 / 2);
++
+ /* Return 1 if YEAR + TM_YEAR_BASE is a leap year. */
+ static inline int
+ leapyear (long int year)
+@@ -167,8 +174,6 @@
+ int year0, int yday0, int hour0, int min0, int sec0)
+ {
+ 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/dev-vcs/cvs/files/cvs-1.12.12-openat.patch b/dev-vcs/cvs/files/cvs-1.12.12-openat.patch
new file mode 100644
index 00000000..fdb406a4
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-openat.patch
@@ -0,0 +1,21 @@
+Index: cvs-1.12.12/lib/openat.c
+===================================================================
+--- cvs-1.12.12.orig/lib/openat.c
++++ cvs-1.12.12/lib/openat.c
+@@ -55,9 +55,13 @@ rpl_openat (int fd, char const *filename
+ va_list arg;
+ va_start (arg, flags);
+
+- /* Assume that mode_t is passed compatibly with mode_t's type
+- after argument promotion. */
+- mode = va_arg (arg, mode_t);
++ /* If mode_t is narrower than int, use the promoted type (int),
++ not mode_t. Use sizeof to guess whether mode_t is nerrower;
++ we don't know of any practical counterexamples. */
++ if (sizeof (mode_t) < sizeof (int))
++ mode = va_arg (arg, int);
++ else
++ mode = va_arg (arg, mode_t);
+
+ va_end (arg);
+ }
diff --git a/dev-vcs/cvs/files/cvs-1.12.12-regex.patch b/dev-vcs/cvs/files/cvs-1.12.12-regex.patch
new file mode 100644
index 00000000..4e699532
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs-1.12.12-regex.patch
@@ -0,0 +1,11 @@
+--- a/cvs-1.12.12/lib/regex.c
++++ b/cvs-1.12.12/lib/regex.c
+@@ -8184,7 +8184,7 @@
+ if (msg_size > errbuf_size)
+ {
+ #if defined HAVE_MEMPCPY || defined _LIBC
+- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
++ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+ #else
+ memcpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
diff --git a/dev-vcs/cvs/files/cvs.pam-include-1.12.12 b/dev-vcs/cvs/files/cvs.pam-include-1.12.12
new file mode 100644
index 00000000..f401ec08
--- /dev/null
+++ b/dev-vcs/cvs/files/cvs.pam-include-1.12.12
@@ -0,0 +1,4 @@
+#%PAM-1.0
+auth include system-auth
+account include system-auth
+session include system-auth
diff --git a/dev-vcs/cvs/files/cvspserver.xinetd.d b/dev-vcs/cvs/files/cvspserver.xinetd.d
new file mode 100644
index 00000000..0f2edb09
--- /dev/null
+++ b/dev-vcs/cvs/files/cvspserver.xinetd.d
@@ -0,0 +1,14 @@
+service cvspserver
+{
+ disable = yes
+ socket_type = stream
+ wait = no
+ user = root
+ log_type = FILE /var/log/cvspserver
+ protocol = tcp
+ env = HOME=/var/cvsroot
+ log_on_failure += USERID
+ port = 2401
+ server = /usr/bin/cvs
+ server_args = -f --allow-root=/var/cvsroot pserver
+}
diff --git a/dev-vcs/cvs/metadata.xml b/dev-vcs/cvs/metadata.xml
new file mode 100644
index 00000000..44327501
--- /dev/null
+++ b/dev-vcs/cvs/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>cvs-utils</herd>
+ <use>
+ <flag name="server">Enable server support</flag>
+ </use>
+</pkgmetadata>
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
new file mode 100644
index 00000000..f6e451a7
--- /dev/null
+++ b/eclass/toolchain.eclass
@@ -0,0 +1,2262 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.635 2014/08/05 01:41:01 floppym Exp $
+
+# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
+
+DESCRIPTION="The GNU Compiler Collection"
+HOMEPAGE="http://gcc.gnu.org/"
+RESTRICT="strip" # cross-compilers need controlled stripping
+
+inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs versionator
+
+if [[ ${PV} == *_pre9999* ]] ; then
+ EGIT_REPO_URI="git://gcc.gnu.org/git/gcc.git"
+ # naming style:
+ # gcc-4.7.1_pre9999 -> gcc-4_7-branch
+ # Note that the micro version is required or lots of stuff will break.
+ # To checkout master set gcc_LIVE_BRANCH="master" in the ebuild before
+ # inheriting this eclass.
+ EGIT_BRANCH="${PN}-${PV%.?_pre9999}-branch"
+ EGIT_BRANCH=${EGIT_BRANCH//./_}
+ inherit git-2
+fi
+
+FEATURES=${FEATURES/multilib-strict/}
+
+EXPORTED_FUNCTIONS="pkg_setup src_unpack src_compile src_test src_install pkg_postinst pkg_postrm"
+case ${EAPI:-0} in
+ 0|1) ;;
+ 2|3) EXPORTED_FUNCTIONS+=" src_prepare src_configure" ;;
+ 4*|5*) EXPORTED_FUNCTIONS+=" pkg_pretend src_prepare src_configure" ;;
+ *) die "I don't speak EAPI ${EAPI}."
+esac
+EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
+
+#---->> globals <<----
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} = ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+: ${TARGET_ABI:=${ABI}}
+: ${TARGET_MULTILIB_ABIS:=${MULTILIB_ABIS}}
+: ${TARGET_DEFAULT_ABI:=${DEFAULT_ABI}}
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+# General purpose version check. Without a second arg matches up to minor version (x.x.x)
+tc_version_is_at_least() {
+ version_is_at_least "$1" "${2:-${GCC_RELEASE_VER}}"
+}
+
+# General purpose version range check
+# Note that it matches up to but NOT including the second version
+tc_version_is_between() {
+ tc_version_is_at_least "${1}" && ! tc_version_is_at_least "${2}"
+}
+
+GCC_PV=${TOOLCHAIN_GCC_PV:-${PV}}
+GCC_PVR=${GCC_PV}
+[[ ${PR} != "r0" ]] && GCC_PVR=${GCC_PVR}-${PR}
+GCC_RELEASE_VER=$(get_version_component_range 1-3 ${GCC_PV})
+GCC_BRANCH_VER=$(get_version_component_range 1-2 ${GCC_PV})
+GCCMAJOR=$(get_version_component_range 1 ${GCC_PV})
+GCCMINOR=$(get_version_component_range 2 ${GCC_PV})
+GCCMICRO=$(get_version_component_range 3 ${GCC_PV})
+[[ ${BRANCH_UPDATE-notset} == "notset" ]] && \
+ BRANCH_UPDATE=$(get_version_component_range 4 ${GCC_PV})
+
+# According to gcc/c-cppbuiltin.c, GCC_CONFIG_VER MUST match this regex.
+# ([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)?
+GCC_CONFIG_VER=${GCC_CONFIG_VER:-$(replace_version_separator 3 '-' ${GCC_PV})}
+
+# Pre-release support
+if [[ ${GCC_PV} == *_pre* ]] ; then
+ PRERELEASE=${GCC_PV/_pre/-}
+elif [[ ${GCC_PV} == *_alpha* ]] ; then
+ SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_alpha}
+elif [[ ${GCC_PV} == *_beta* ]] ; then
+ SNAPSHOT=${GCC_BRANCH_VER}-${GCC_PV##*_beta}
+elif [[ ${GCC_PV} == *_rc* ]] ; then
+ SNAPSHOT=${GCC_PV%_rc*}-RC-${GCC_PV##*_rc}
+fi
+
+if [[ ${SNAPSHOT} == 5.0-* ]] ; then
+ # The gcc-5 release has dropped the .0 for some reason.
+ SNAPSHOT=${SNAPSHOT/5.0/5}
+fi
+
+export GCC_FILESDIR=${GCC_FILESDIR:-${FILESDIR}}
+
+PREFIX=${TOOLCHAIN_PREFIX:-/usr}
+
+if tc_version_is_at_least 3.4.0 ; then
+ LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}}
+else
+ LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc-lib/${CTARGET}/${GCC_CONFIG_VER}}
+fi
+INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include}
+
+if is_crosscompile ; then
+ BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}}
+else
+ BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}}
+fi
+
+DATAPATH=${TOOLCHAIN_DATAPATH:-${PREFIX}/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}}
+
+# Dont install in /usr/include/g++-v3/, but in gcc internal directory.
+# We will handle /usr/include/g++-v3/ with gcc-config ...
+STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VER/\.*/}}
+
+#---->> LICENSE+SLOT+IUSE logic <<----
+
+if tc_version_is_at_least 4.6 ; then
+ LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.3+"
+elif tc_version_is_at_least 4.4 ; then
+ LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) FDL-1.2+"
+elif tc_version_is_at_least 4.3 ; then
+ LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
+elif tc_version_is_at_least 4.2 ; then
+ LICENSE="GPL-3+ LGPL-2.1+ || ( GPL-3+ libgcc libstdc++ ) FDL-1.2+"
+elif tc_version_is_at_least 3.3 ; then
+ LICENSE="GPL-2+ LGPL-2.1+ FDL-1.2+"
+else
+ LICENSE="GPL-2+ LGPL-2.1+ FDL-1.1+"
+fi
+
+IUSE="multislot regression-test vanilla"
+IUSE_DEF=( nls nptl )
+
+if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
+ IUSE+=" altivec"
+ IUSE_DEF+=( cxx fortran )
+ [[ -n ${PIE_VER} ]] && IUSE+=" nopie"
+ [[ -n ${HTB_VER} ]] && IUSE+=" boundschecking"
+ [[ -n ${D_VER} ]] && IUSE+=" d"
+ [[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
+ tc_version_is_at_least 3 && IUSE+=" doc gcj awt hardened multilib objc"
+ tc_version_is_at_least 4.0 && IUSE+=" objc-gc"
+ tc_version_is_between 4.0 4.9 && IUSE+=" mudflap"
+ tc_version_is_at_least 4.1 && IUSE+=" libssp objc++"
+ tc_version_is_at_least 4.2 && IUSE_DEF+=( openmp )
+ tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
+ tc_version_is_at_least 4.6 && IUSE+=" graphite"
+ tc_version_is_at_least 4.7 && IUSE+=" go"
+ tc_version_is_at_least 4.8 && IUSE_DEF+=( sanitize )
+fi
+
+[[ ${EAPI:-0} != 0 ]] && IUSE_DEF=( "${IUSE_DEF[@]/#/+}" )
+IUSE+=" ${IUSE_DEF[*]}"
+
+# Support upgrade paths here or people get pissed
+if ! tc_version_is_at_least 4.7 || use multislot ; then
+ SLOT="${GCC_CONFIG_VER}"
+else
+ SLOT="${GCC_BRANCH_VER}"
+fi
+
+#---->> DEPEND <<----
+
+RDEPEND="sys-libs/zlib
+ nls? ( virtual/libintl )"
+
+tc_version_is_at_least 3 && RDEPEND+=" virtual/libiconv"
+
+if tc_version_is_at_least 4 ; then
+ GMP_MPFR_DEPS=">=dev-libs/gmp-4.3.2 >=dev-libs/mpfr-2.4.2"
+ if tc_version_is_at_least 4.3 ; then
+ RDEPEND+=" ${GMP_MPFR_DEPS}"
+ elif in_iuse fortran ; then
+ RDEPEND+=" fortran? ( ${GMP_MPFR_DEPS} )"
+ fi
+fi
+
+tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1"
+
+if in_iuse graphite ; then
+ if tc_version_is_at_least 4.8 ; then
+ RDEPEND+="
+ graphite? (
+ >=dev-libs/cloog-0.18.0
+ >=dev-libs/isl-0.11.1
+ )"
+ else
+ RDEPEND+="
+ graphite? (
+ >=dev-libs/cloog-ppl-0.15.10
+ >=dev-libs/ppl-0.11
+ )"
+ fi
+fi
+
+DEPEND="${RDEPEND}
+ >=sys-devel/bison-1.875
+ >=sys-devel/flex-2.5.4
+ nls? ( sys-devel/gettext )
+ regression-test? (
+ >=dev-util/dejagnu-1.4.4
+ >=sys-devel/autogen-5.5.4
+ )"
+
+if in_iuse gcj ; then
+ GCJ_DEPS=">=media-libs/libart_lgpl-2.1"
+ GCJ_GTK_DEPS="
+ x11-libs/libXt
+ x11-libs/libX11
+ x11-libs/libXtst
+ x11-proto/xproto
+ x11-proto/xextproto
+ =x11-libs/gtk+-2*
+ virtual/pkgconfig
+ amd64? ( multilib? (
+ app-emulation/emul-linux-x86-gtklibs
+ app-emulation/emul-linux-x86-xlibs
+ ) )
+ "
+ tc_version_is_at_least 3.4 && GCJ_GTK_DEPS+=" x11-libs/pango"
+ tc_version_is_at_least 4.2 && GCJ_DEPS+=" app-arch/zip app-arch/unzip"
+ DEPEND+=" gcj? ( awt? ( ${GCJ_GTK_DEPS} ) ${GCJ_DEPS} )"
+fi
+
+PDEPEND=">=sys-devel/gcc-config-1.7"
+
+#---->> S + SRC_URI essentials <<----
+
+# Set the source directory depending on whether we're using
+# a prerelease, snapshot, or release tarball.
+S=$(
+ if [[ -n ${PRERELEASE} ]] ; then
+ echo ${WORKDIR}/gcc-${PRERELEASE}
+ elif [[ -n ${SNAPSHOT} ]] ; then
+ echo ${WORKDIR}/gcc-${SNAPSHOT}
+ else
+ echo ${WORKDIR}/gcc-${GCC_RELEASE_VER}
+ fi
+)
+
+gentoo_urls() {
+ local devspace="HTTP~vapier/dist/URI HTTP~rhill/dist/URI
+ HTTP~halcy0n/patches/URI HTTP~zorry/patches/gcc/URI"
+ devspace=${devspace//HTTP/http:\/\/dev.gentoo.org\/}
+ echo mirror://gentoo/$1 ${devspace//URI/$1}
+}
+
+# This function handles the basics of setting the SRC_URI for a gcc ebuild.
+# To use, set SRC_URI with:
+#
+# SRC_URI="$(get_gcc_src_uri)"
+#
+# Other than the variables normally set by portage, this function's behavior
+# can be altered by setting the following:
+#
+# SNAPSHOT
+# If set, this variable signals that we should be using a snapshot of
+# gcc. It is expected to be in the format "YYYY-MM-DD". Note that if
+# the ebuild has a _pre suffix, this variable is ignored and the
+# prerelease tarball is used instead.
+#
+# BRANCH_UPDATE
+# If set, this variable signals that we should be using the main
+# release tarball (determined by ebuild version) and applying a
+# CVS branch update patch against it. The location of this branch
+# update patch is assumed to be in ${GENTOO_TOOLCHAIN_BASE_URI}.
+# Just like with SNAPSHOT, this variable is ignored if the ebuild
+# has a _pre suffix.
+#
+# PATCH_VER
+# PATCH_GCC_VER
+# This should be set to the version of the gentoo patch tarball.
+# The resulting filename of this tarball will be:
+# gcc-${PATCH_GCC_VER:-${GCC_RELEASE_VER}}-patches-${PATCH_VER}.tar.bz2
+#
+# PIE_VER
+# PIE_GCC_VER
+# These variables control patching in various updates for the logic
+# controlling Position Independant Executables. PIE_VER is expected
+# to be the version of this patch, and PIE_GCC_VER the gcc version of
+# the patch:
+# An example:
+# PIE_VER="8.7.6.5"
+# PIE_GCC_VER="3.4.0"
+# The resulting filename of this tarball will be:
+# gcc-${PIE_GCC_VER:-${GCC_RELEASE_VER}}-piepatches-v${PIE_VER}.tar.bz2
+#
+# SPECS_VER
+# SPECS_GCC_VER
+# This is for the minispecs files included in the hardened gcc-4.x
+# The specs files for hardenedno*, vanilla and for building the "specs" file.
+# SPECS_VER is expected to be the version of this patch, SPECS_GCC_VER
+# the gcc version of the patch.
+# An example:
+# SPECS_VER="8.7.6.5"
+# SPECS_GCC_VER="3.4.0"
+# The resulting filename of this tarball will be:
+# gcc-${SPECS_GCC_VER:-${GCC_RELEASE_VER}}-specs-${SPECS_VER}.tar.bz2
+#
+# HTB_VER
+# HTB_GCC_VER
+# These variables control whether or not an ebuild supports Herman
+# ten Brugge's bounds-checking patches. If you want to use a patch
+# for an older gcc version with a new gcc, make sure you set
+# HTB_GCC_VER to that version of gcc.
+get_gcc_src_uri() {
+ export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
+ export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
+ export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}}
+ export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}}
+ export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}}
+
+ # Set where to download gcc itself depending on whether we're using a
+ # prerelease, snapshot, or release tarball.
+ if [[ ${PV} == *9999* ]] ; then
+ # Nothing to do w/git snapshots.
+ :
+ elif [[ -n ${PRERELEASE} ]] ; then
+ GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/prerelease-${PRERELEASE}/gcc-${PRERELEASE}.tar.bz2"
+ elif [[ -n ${SNAPSHOT} ]] ; then
+ GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.bz2"
+ else
+ GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
+ # we want all branch updates to be against the main release
+ [[ -n ${BRANCH_UPDATE} ]] && \
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)"
+ fi
+
+ [[ -n ${UCLIBC_VER} ]] && \
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2)"
+ [[ -n ${PATCH_VER} ]] && \
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2)"
+
+ # strawberry pie, Cappuccino and a Gauloises (it's a good thing)
+ [[ -n ${PIE_VER} ]] && \
+ PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} && \
+ GCC_SRC_URI+=" $(gentoo_urls ${PIE_CORE})"
+
+ # gcc minispec for the hardened gcc 4 compiler
+ [[ -n ${SPECS_VER} ]] && \
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2)"
+
+ # gcc bounds checking patch
+ if [[ -n ${HTB_VER} ]] ; then
+ local HTBFILE="bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
+ GCC_SRC_URI+="
+ boundschecking? (
+ mirror://sourceforge/boundschecking/${HTBFILE}
+ $(gentoo_urls ${HTBFILE})
+ )"
+ fi
+
+ [[ -n ${D_VER} ]] && \
+ GCC_SRC_URI+=" d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )"
+
+ if in_iuse gcj ; then
+ if tc_version_is_at_least 4.5 ; then
+ GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.5.jar )"
+ elif tc_version_is_at_least 4.3 ; then
+ GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.3.jar )"
+ fi
+ fi
+
+ echo "${GCC_SRC_URI}"
+}
+
+SRC_URI=$(get_gcc_src_uri)
+
+#---->> pkg_pretend <<----
+
+toolchain_pkg_pretend() {
+ if [[ -n ${PRERELEASE}${SNAPSHOT} || ${PV} == *9999* ]] &&
+ [[ -z ${I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS} ]] ; then
+ die "Please \`export I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1\` or define it" \
+ "in your make.conf if you want to use this version."
+ fi
+
+ [[ -z ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] && \
+ die "Sorry, this version does not support uClibc"
+
+ if ! use_if_iuse cxx ; then
+ use_if_iuse go && ewarn 'Go requires a C++ compiler, disabled due to USE="-cxx"'
+ use_if_iuse objc++ && ewarn 'Obj-C++ requires a C++ compiler, disabled due to USE="-cxx"'
+ use_if_iuse gcj && ewarn 'GCJ requires a C++ compiler, disabled due to USE="-cxx"'
+ fi
+
+ want_minispecs
+}
+
+#---->> pkg_setup <<----
+
+toolchain_pkg_setup() {
+ case "${EAPI:-0}" in
+ 0|1|2|3) toolchain_pkg_pretend ;;
+ esac
+
+ # we dont want to use the installed compiler's specs to build gcc
+ unset GCC_SPECS
+ unset LANGUAGES #265283
+}
+
+#---->> src_unpack <<----
+
+toolchain_src_unpack() {
+ if [[ ${PV} == *9999* ]]; then
+ git-2_src_unpack
+ else
+ gcc_quick_unpack
+ fi
+
+ case ${EAPI:-0} in
+ 0|1) toolchain_src_prepare ;;
+ esac
+}
+
+gcc_quick_unpack() {
+ pushd "${WORKDIR}" > /dev/null
+ export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
+ export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
+ export PIE_GCC_VER=${PIE_GCC_VER:-${GCC_RELEASE_VER}}
+ export HTB_GCC_VER=${HTB_GCC_VER:-${GCC_RELEASE_VER}}
+ export SPECS_GCC_VER=${SPECS_GCC_VER:-${GCC_RELEASE_VER}}
+
+ if [[ -n ${GCC_A_FAKEIT} ]] ; then
+ unpack ${GCC_A_FAKEIT}
+ elif [[ -n ${PRERELEASE} ]] ; then
+ unpack gcc-${PRERELEASE}.tar.bz2
+ elif [[ -n ${SNAPSHOT} ]] ; then
+ unpack gcc-${SNAPSHOT}.tar.bz2
+ elif [[ ${PV} != *9999* ]] ; then
+ unpack gcc-${GCC_RELEASE_VER}.tar.bz2
+ # We want branch updates to be against a release tarball
+ if [[ -n ${BRANCH_UPDATE} ]] ; then
+ pushd "${S}" > /dev/null
+ epatch "${DISTDIR}"/gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
+ popd > /dev/null
+ fi
+ fi
+
+ if [[ -n ${D_VER} ]] && use d ; then
+ pushd "${S}"/gcc > /dev/null
+ unpack gdc-${D_VER}-src.tar.bz2
+ cd ..
+ ebegin "Adding support for the D language"
+ ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log
+ if ! eend $? ; then
+ eerror "The D GCC package failed to apply"
+ eerror "Please include this log file when posting a bug report:"
+ eerror " ${T}/dgcc.log"
+ die "failed to include the D language"
+ fi
+ popd > /dev/null
+ fi
+
+ [[ -n ${PATCH_VER} ]] && \
+ unpack gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2
+
+ [[ -n ${UCLIBC_VER} ]] && \
+ unpack gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2
+
+ if want_pie ; then
+ if [[ -n ${PIE_CORE} ]] ; then
+ unpack ${PIE_CORE}
+ else
+ unpack gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2
+ fi
+ [[ -n ${SPECS_VER} ]] && \
+ unpack gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2
+ fi
+
+ use_if_iuse boundschecking && unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
+
+ popd > /dev/null
+}
+
+#---->> src_prepare <<----
+
+toolchain_src_prepare() {
+ export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}"
+ cd "${S}"
+
+ if ! use vanilla ; then
+ if [[ -n ${PATCH_VER} ]] ; then
+ guess_patch_type_in_dir "${WORKDIR}"/patch
+ EPATCH_MULTI_MSG="Applying Gentoo patches ..." \
+ epatch "${WORKDIR}"/patch
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}"
+ fi
+ if [[ -n ${UCLIBC_VER} ]] ; then
+ guess_patch_type_in_dir "${WORKDIR}"/uclibc
+ EPATCH_MULTI_MSG="Applying uClibc patches ..." \
+ epatch "${WORKDIR}"/uclibc
+ fi
+ fi
+ do_gcc_HTB_patches
+ do_gcc_PIE_patches
+ epatch_user
+
+ if ( tc_version_is_at_least 4.8.2 || use hardened ) && ! use vanilla ; then
+ make_gcc_hard
+ fi
+
+ # install the libstdc++ python into the right location
+ # http://gcc.gnu.org/PR51368
+ if tc_version_is_between 4.5 4.7 ; then
+ sed -i \
+ '/^pythondir =/s:=.*:= $(datadir)/python:' \
+ "${S}"/libstdc++-v3/python/Makefile.in || die
+ fi
+
+ # make sure the pkg config files install into multilib dirs.
+ # since we configure with just one --libdir, we can't use that
+ # (as gcc itself takes care of building multilibs). #435728
+ find "${S}" -name Makefile.in \
+ -exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} +
+
+ # No idea when this first started being fixed, but let's go with 4.3.x for now
+ if ! tc_version_is_at_least 4.3 ; then
+ fix_files=""
+ for x in contrib/test_summary libstdc++-v3/scripts/check_survey.in ; do
+ [[ -e ${x} ]] && fix_files="${fix_files} ${x}"
+ done
+ ht_fix_file ${fix_files} */configure *.sh */Makefile.in
+ fi
+
+ setup_multilib_osdirnames
+ gcc_version_patch
+
+ if tc_version_is_at_least 4.1 ; then
+ if [[ -n ${SNAPSHOT} || -n ${PRERELEASE} ]] ; then
+ # BASE-VER must be a three-digit version number
+ # followed by an optional -pre string
+ # eg. 4.5.1, 4.6.2-pre20120213, 4.7.0-pre9999
+ # If BASE-VER differs from ${PV/_/-} then libraries get installed in
+ # the wrong directory.
+ echo ${PV/_/-} > "${S}"/gcc/BASE-VER
+ fi
+ fi
+
+ # >= gcc-4.3 doesn't bundle ecj.jar, so copy it
+ if tc_version_is_at_least 4.3 && use gcj ; then
+ if tc_version_is_at_least 4.5 ; then
+ einfo "Copying ecj-4.5.jar"
+ cp -pPR "${DISTDIR}/ecj-4.5.jar" "${S}/ecj.jar" || die
+ else
+ einfo "Copying ecj-4.3.jar"
+ cp -pPR "${DISTDIR}/ecj-4.3.jar" "${S}/ecj.jar" || die
+ fi
+ fi
+
+ # disable --as-needed from being compiled into gcc specs
+ # natively when using a gcc version < 3.4.4
+ # http://gcc.gnu.org/PR14992
+ if ! tc_version_is_at_least 3.4.4 ; then
+ sed -i -e s/HAVE_LD_AS_NEEDED/USE_LD_AS_NEEDED/g "${S}"/gcc/config.in
+ fi
+
+ # In gcc 3.3.x and 3.4.x, rename the java bins to gcc-specific names
+ # in line with gcc-4.
+ if tc_version_is_between 3.3 4.0 ; then
+ do_gcc_rename_java_bins
+ fi
+
+ # Prevent libffi from being installed
+ if tc_version_is_between 3.0 4.8 ; then
+ sed -i -e 's/\(install.*:\) install-.*recursive/\1/' "${S}"/libffi/Makefile.in || die
+ sed -i -e 's/\(install-data-am:\).*/\1/' "${S}"/libffi/include/Makefile.in || die
+ fi
+
+ # Fixup libtool to correctly generate .la files with portage
+ elibtoolize --portage --shallow --no-uclibc
+
+ gnuconfig_update
+
+ # update configure files
+ local f
+ einfo "Fixing misc issues in configure files"
+ for f in $(grep -l 'autoconf version 2.13' $(find "${S}" -name configure)) ; do
+ ebegin " Updating ${f/${S}\/} [LANG]"
+ patch "${f}" "${GCC_FILESDIR}"/gcc-configure-LANG.patch >& "${T}"/configure-patch.log \
+ || eerror "Please file a bug about this"
+ eend $?
+ done
+ sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828
+
+ # Prevent new texinfo from breaking old versions (see #198182, #464008)
+ tc_version_is_at_least 4.1 && epatch "${GCC_FILESDIR}"/gcc-configure-texinfo.patch
+
+ if [[ -x contrib/gcc_update ]] ; then
+ einfo "Touching generated files"
+ ./contrib/gcc_update --touch | \
+ while read f ; do
+ einfo " ${f%%...}"
+ done
+ fi
+}
+
+guess_patch_type_in_dir() {
+ [[ -n $(ls "$1"/*.bz2 2>/dev/null) ]] \
+ && EPATCH_SUFFIX="patch.bz2" \
+ || EPATCH_SUFFIX="patch"
+}
+
+do_gcc_HTB_patches() {
+ use_if_iuse boundschecking || return 0
+
+ # modify the bounds checking patch with a regression patch
+ epatch "${WORKDIR}/bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch"
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, HTB-${HTB_GCC_VER}-${HTB_VER}"
+}
+
+do_gcc_PIE_patches() {
+ want_pie || return 0
+ use vanilla && return 0
+
+ if tc_version_is_at_least 4.3.2 ; then
+ guess_patch_type_in_dir "${WORKDIR}"/piepatch/
+ EPATCH_MULTI_MSG="Applying pie patches ..." \
+ epatch "${WORKDIR}"/piepatch/
+ else
+ guess_patch_type_in_dir "${WORKDIR}"/piepatch/upstream
+
+ # corrects startfile/endfile selection and shared/static/pie flag usage
+ EPATCH_MULTI_MSG="Applying upstream pie patches ..." \
+ epatch "${WORKDIR}"/piepatch/upstream
+ # adds non-default pie support (rs6000)
+ EPATCH_MULTI_MSG="Applying non-default pie patches ..." \
+ epatch "${WORKDIR}"/piepatch/nondef
+ # adds default pie support (rs6000 too) if DEFAULT_PIE[_SSP] is defined
+ EPATCH_MULTI_MSG="Applying default pie patches ..." \
+ epatch "${WORKDIR}"/piepatch/def
+ fi
+
+ BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}"
+}
+
+# configure to build with the hardened GCC specs as the default
+make_gcc_hard() {
+ # we want to be able to control the pie patch logic via something other
+ # than ALL_CFLAGS...
+ sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
+ -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \
+ -i "${S}"/gcc/Makefile.in
+ # Need to add HARD_CFLAGS to ALL_CXXFLAGS on >= 4.7
+ if tc_version_is_at_least 4.7 ; then
+ sed -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = ' \
+ -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \
+ -i "${S}"/gcc/Makefile.in
+ fi
+
+ # defaults to enable for all toolchains
+ local gcc_hard_flags=""
+ if use hardened ; then
+ if hardened_gcc_works ; then
+ einfo "Updating gcc to use automatic PIE + SSP building ..."
+ gcc_hard_flags+=" -DEFAULT_PIE_SSP"
+ elif hardened_gcc_works pie ; then
+ einfo "Updating gcc to use automatic PIE building ..."
+ ewarn "SSP has not been enabled by default"
+ gcc_hard_flags+=" -DEFAULT_PIE"
+ elif hardened_gcc_works ssp ; then
+ einfo "Updating gcc to use automatic SSP building ..."
+ ewarn "PIE has not been enabled by default"
+ gcc_hard_flags+=" -DEFAULT_SSP"
+ else
+ # do nothing if hardened is't supported, but don't die either
+ ewarn "hardened is not supported for this arch in this gcc version"
+ return 0
+ fi
+ # rebrand to make bug reports easier
+ BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened}
+ else
+ if hardened_gcc_works ssp ; then
+ einfo "Updating gcc to use automatic SSP building ..."
+ gcc_hard_flags+=" -DEFAULT_SSP"
+ fi
+ fi
+
+ sed -i \
+ -e "/^HARD_CFLAGS = /s|=|= ${gcc_hard_flags} |" \
+ "${S}"/gcc/Makefile.in || die
+
+}
+
+# This is a historical wart. The original Gentoo/amd64 port used:
+# lib32 - 32bit binaries (x86)
+# lib64 - 64bit binaries (x86_64)
+# lib - "native" binaries (a symlink to lib64)
+# Most other distros use the logic (including mainline gcc):
+# lib - 32bit binaries (x86)
+# lib64 - 64bit binaries (x86_64)
+# Over time, Gentoo is migrating to the latter form.
+#
+# Unfortunately, due to distros picking the lib32 behavior, newer gcc
+# versions will dynamically detect whether to use lib or lib32 for its
+# 32bit multilib. So, to keep the automagic from getting things wrong
+# while people are transitioning from the old style to the new style,
+# we always set the MULTILIB_OSDIRNAMES var for relevant targets.
+setup_multilib_osdirnames() {
+ is_multilib || return 0
+
+ local config
+ local libdirs="../lib64 ../lib32"
+
+ # this only makes sense for some Linux targets
+ case ${CTARGET} in
+ x86_64*-linux*) config="i386" ;;
+ powerpc64*-linux*) config="rs6000" ;;
+ sparc64*-linux*) config="sparc" ;;
+ s390x*-linux*) config="s390" ;;
+ *) return 0 ;;
+ esac
+ config+="/t-linux64"
+
+ local sed_args=()
+ if tc_version_is_at_least 4.6 ; then
+ sed_args+=( -e 's:$[(]call if_multiarch[^)]*[)]::g' )
+ fi
+ if [[ ${SYMLINK_LIB} == "yes" ]] ; then
+ einfo "updating multilib directories to be: ${libdirs}"
+ if tc_version_is_at_least 4.6.4 || tc_version_is_at_least 4.7 ; then
+ sed_args+=( -e '/^MULTILIB_OSDIRNAMES.*lib32/s:[$][(]if.*):../lib32:' )
+ else
+ sed_args+=( -e "/^MULTILIB_OSDIRNAMES/s:=.*:= ${libdirs}:" )
+ fi
+ else
+ einfo "using upstream multilib; disabling lib32 autodetection"
+ sed_args+=( -r -e 's:[$][(]if.*,(.*)[)]:\1:' )
+ fi
+ sed -i "${sed_args[@]}" "${S}"/gcc/config/${config} || die
+}
+
+gcc_version_patch() {
+ # gcc-4.3+ has configure flags (whoo!)
+ tc_version_is_at_least 4.3 && return 0
+
+ local version_string=${GCC_CONFIG_VER}
+ [[ -n ${BRANCH_UPDATE} ]] && version_string+=" ${BRANCH_UPDATE}"
+
+ einfo "patching gcc version: ${version_string} (${BRANDING_GCC_PKGVERSION})"
+
+ local gcc_sed=( -e 's:gcc\.gnu\.org/bugs\.html:bugs\.gentoo\.org/:' )
+ if grep -qs VERSUFFIX "${S}"/gcc/version.c ; then
+ gcc_sed+=( -e "/VERSUFFIX \"\"/s:\"\":\" (${BRANDING_GCC_PKGVERSION})\":" )
+ else
+ version_string="${version_string} (${BRANDING_GCC_PKGVERSION})"
+ gcc_sed+=( -e "/const char version_string\[\] = /s:= \".*\":= \"${version_string}\":" )
+ fi
+ sed -i "${gcc_sed[@]}" "${S}"/gcc/version.c || die
+}
+
+do_gcc_rename_java_bins() {
+ # bug #139918 - conflict between gcc and java-config-2 for ownership of
+ # /usr/bin/rmi{c,registry}. Done with mv & sed rather than a patch
+ # because patches would be large (thanks to the rename of man files),
+ # and it's clear from the sed invocations that all that changes is the
+ # rmi{c,registry} names to grmi{c,registry} names.
+ # Kevin F. Quinn 2006-07-12
+ einfo "Renaming jdk executables rmic and rmiregistry to grmic and grmiregistry."
+ # 1) Move the man files if present (missing prior to gcc-3.4)
+ for manfile in rmic rmiregistry ; do
+ [[ -f ${S}/gcc/doc/${manfile}.1 ]] || continue
+ mv "${S}"/gcc/doc/${manfile}.1 "${S}"/gcc/doc/g${manfile}.1
+ done
+ # 2) Fixup references in the docs if present (mission prior to gcc-3.4)
+ for jfile in gcc/doc/gcj.info gcc/doc/grmic.1 gcc/doc/grmiregistry.1 gcc/java/gcj.texi ; do
+ [[ -f ${S}/${jfile} ]] || continue
+ sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} ||
+ die "Failed to fixup file ${jfile} for rename to grmiregistry"
+ sed -i -e 's:rmic:grmic:g' "${S}"/${jfile} ||
+ die "Failed to fixup file ${jfile} for rename to grmic"
+ done
+ # 3) Fixup Makefiles to build the changed executable names
+ # These are present in all 3.x versions, and are the important bit
+ # to get gcc to build with the new names.
+ for jfile in libjava/Makefile.am libjava/Makefile.in gcc/java/Make-lang.in ; do
+ sed -i -e 's:rmiregistry:grmiregistry:g' "${S}"/${jfile} ||
+ die "Failed to fixup file ${jfile} for rename to grmiregistry"
+ # Careful with rmic on these files; it's also the name of a directory
+ # which should be left unchanged. Replace occurrences of 'rmic$',
+ # 'rmic_' and 'rmic '.
+ sed -i -e 's:rmic\([$_ ]\):grmic\1:g' "${S}"/${jfile} ||
+ die "Failed to fixup file ${jfile} for rename to grmic"
+ done
+}
+
+#---->> src_configure <<----
+
+toolchain_src_configure() {
+ downgrade_arch_flags
+ gcc_do_filter_flags
+
+ einfo "CFLAGS=\"${CFLAGS}\""
+ einfo "CXXFLAGS=\"${CXXFLAGS}\""
+ einfo "LDFLAGS=\"${LDFLAGS}\""
+
+ # Force internal zip based jar script to avoid random
+ # issues with 3rd party jar implementations. #384291
+ export JAR=no
+
+ # For hardened gcc 4.3 piepatchset to build the hardened specs
+ # file (build.specs) to use when building gcc.
+ if ! tc_version_is_at_least 4.4 && want_minispecs ; then
+ setup_minispecs_gcc_build_specs
+ fi
+
+ local confgcc=( --host=${CHOST} )
+
+ if is_crosscompile || tc-is-cross-compiler ; then
+ # Straight from the GCC install doc:
+ # "GCC has code to correctly determine the correct value for target
+ # for nearly all native systems. Therefore, we highly recommend you
+ # not provide a configure target when configuring a native compiler."
+ confgcc+=( --target=${CTARGET} )
+ fi
+ [[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
+
+ confgcc+=(
+ --prefix="${PREFIX}"
+ --bindir="${BINPATH}"
+ --includedir="${INCLUDEPATH}"
+ --datadir="${DATAPATH}"
+ --mandir="${DATAPATH}/man"
+ --infodir="${DATAPATH}/info"
+ --with-gxx-include-dir="${STDCXX_INCDIR}"
+ )
+
+ # Stick the python scripts in their own slotted directory (bug #279252)
+ #
+ # --with-python-dir=DIR
+ # Specifies where to install the Python modules used for aot-compile. DIR
+ # should not include the prefix used in installation. For example, if the
+ # Python modules are to be installed in /usr/lib/python2.5/site-packages,
+ # then --with-python-dir=/lib/python2.5/site-packages should be passed.
+ #
+ # This should translate into "/share/gcc-data/${CTARGET}/${GCC_CONFIG_VER}/python"
+ if tc_version_is_at_least 4.4 ; then
+ confgcc+=( --with-python-dir=${DATAPATH/$PREFIX/}/python )
+ fi
+
+ ### language options
+
+ local GCC_LANG="c"
+ is_cxx && GCC_LANG+=",c++"
+ is_d && GCC_LANG+=",d"
+ is_gcj && GCC_LANG+=",java"
+ is_go && GCC_LANG+=",go"
+ if is_objc || is_objcxx ; then
+ GCC_LANG+=",objc"
+ if tc_version_is_at_least 4 ; then
+ use objc-gc && confgcc+=( --enable-objc-gc )
+ fi
+ is_objcxx && GCC_LANG+=",obj-c++"
+ fi
+
+ # fortran support just got sillier! the lang value can be f77 for
+ # fortran77, f95 for fortran95, or just plain old fortran for the
+ # currently supported standard depending on gcc version.
+ is_fortran && GCC_LANG+=",fortran"
+ is_f77 && GCC_LANG+=",f77"
+ is_f95 && GCC_LANG+=",f95"
+
+ # We do NOT want 'ADA support' in here!
+ # is_ada && GCC_LANG+=",ada"
+
+ confgcc+=( --enable-languages=${GCC_LANG} )
+
+ ### general options
+
+ confgcc+=(
+ --enable-obsolete
+ --enable-secureplt
+ --disable-werror
+ --with-system-zlib
+ )
+
+ if use nls ; then
+ confgcc+=( --enable-nls --without-included-gettext )
+ else
+ confgcc+=( --disable-nls )
+ fi
+
+ tc_version_is_at_least 3.4 || confgcc+=( --disable-libunwind-exceptions )
+
+ # Use the default ("release") checking because upstream usually neglects
+ # to test "disabled" so it has a history of breaking. #317217
+ if tc_version_is_at_least 4 || [[ -n ${GCC_CHECKS_LIST} ]] ; then
+ confgcc+=( --enable-checking=${GCC_CHECKS_LIST:-release} )
+ else
+ confgcc+=( --disable-checking )
+ fi
+
+ # Branding
+ tc_version_is_at_least 4.3 && confgcc+=(
+ --with-bugurl=https://bugs.gentoo.org/
+ --with-pkgversion="${BRANDING_GCC_PKGVERSION}"
+ )
+
+ # If we want hardened support with the newer piepatchset for >=gcc 4.4
+ if tc_version_is_at_least 4.4 && want_minispecs ; then
+ confgcc+=( $(use_enable hardened esp) )
+ fi
+
+ # allow gcc to search for clock funcs in the main C lib.
+ # if it can't find them, then tough cookies -- we aren't
+ # going to link in -lrt to all C++ apps. #411681
+ if tc_version_is_at_least 4.4 && is_cxx ; then
+ confgcc+=( --enable-libstdcxx-time )
+ fi
+
+ # # Turn on the -Wl,--build-id flag by default for ELF targets. #525942
+ # # This helps with locating debug files.
+ # case ${CTARGET} in
+ # *-linux-*|*-elf|*-eabi)
+ # tc_version_is_at_least 4.5 && confgcc+=(
+ # --enable-linker-build-id
+ # )
+ # ;;
+ # esac
+
+ # newer gcc versions like to bootstrap themselves with C++,
+ # so we need to manually disable it ourselves
+ if tc_version_is_between 4.7 4.8 && ! is_cxx ; then
+ confgcc+=( --disable-build-with-cxx --disable-build-poststage1-with-cxx )
+ fi
+
+ ### Cross-compiler options
+ if is_crosscompile ; then
+ # Enable build warnings by default with cross-compilers when system
+ # paths are included (e.g. via -I flags).
+ confgcc+=( --enable-poison-system-directories )
+
+ # When building a stage1 cross-compiler (just C compiler), we have to
+ # disable a bunch of features or gcc goes boom
+ local needed_libc=""
+ case ${CTARGET} in
+ *-linux) needed_libc=no-fucking-clue;;
+ *-dietlibc) needed_libc=dietlibc;;
+ *-elf|*-eabi) needed_libc=newlib;;
+ *-freebsd*) needed_libc=freebsd-lib;;
+ *-gnu*) needed_libc=glibc;;
+ *-klibc) needed_libc=klibc;;
+ *-musl*) needed_libc=musl;;
+ *-uclibc*)
+ if ! echo '#include <features.h>' | \
+ $(tc-getCPP ${CTARGET}) -E -dD - 2>/dev/null | \
+ grep -q __HAVE_SHARED__
+ then #291870
+ confgcc+=( --disable-shared )
+ fi
+ needed_libc=uclibc
+ ;;
+ *-cygwin) needed_libc=cygwin;;
+ x86_64-*-mingw*|\
+ *-w64-mingw*) needed_libc=mingw64-runtime;;
+ mingw*|*-mingw*) needed_libc=mingw-runtime;;
+ avr) confgcc+=( --enable-shared --disable-threads );;
+ esac
+ if [[ -n ${needed_libc} ]] ; then
+ local confgcc_no_libc=( --disable-shared )
+ tc_version_is_at_least 4.8 && confgcc_no_libc+=( --disable-libatomic )
+ if ! has_version ${CATEGORY}/${needed_libc} ; then
+ confgcc+=(
+ "${confgcc_no_libc[@]}"
+ --disable-threads
+ --without-headers
+ )
+ elif built_with_use --hidden --missing false ${CATEGORY}/${needed_libc} crosscompile_opts_headers-only ; then
+ confgcc+=(
+ "${confgcc_no_libc[@]}"
+ --with-sysroot=${PREFIX}/${CTARGET}
+ )
+ else
+ confgcc+=( --with-sysroot=${PREFIX}/${CTARGET} )
+ fi
+ fi
+
+ tc_version_is_at_least 4.2 && confgcc+=( --disable-bootstrap )
+ else
+ if tc-is-static-only ; then
+ confgcc+=( --disable-shared )
+ else
+ confgcc+=( --enable-shared )
+ fi
+ case ${CHOST} in
+ mingw*|*-mingw*|*-cygwin)
+ confgcc+=( --enable-threads=win32 ) ;;
+ *)
+ confgcc+=( --enable-threads=posix ) ;;
+ esac
+ fi
+
+ # __cxa_atexit is "essential for fully standards-compliant handling of
+ # destructors", but apparently requires glibc.
+ case ${CTARGET} in
+ *-uclibc*)
+ confgcc+=(
+ --disable-__cxa_atexit
+ $(use_enable nptl tls)
+ )
+ tc_version_is_between 3.3 3.4 && confgcc+=( --enable-sjlj-exceptions )
+ if tc_version_is_between 3.4 4.3 ; then
+ confgcc+=( --enable-clocale=uclibc )
+ fi
+ ;;
+ *-elf|*-eabi)
+ confgcc+=( --with-newlib )
+ ;;
+ *-gnu*)
+ confgcc+=(
+ --enable-__cxa_atexit
+ --enable-clocale=gnu
+ )
+ ;;
+ *-freebsd*)
+ confgcc+=( --enable-__cxa_atexit )
+ ;;
+ *-solaris*)
+ confgcc+=( --enable-__cxa_atexit )
+ ;;
+ esac
+
+ ### arch options
+
+ gcc-multilib-configure
+
+ # ppc altivec support
+ confgcc+=( $(use_enable altivec) )
+
+ # gcc has fixed-point arithmetic support in 4.3 for mips targets that can
+ # significantly increase compile time by several hours. This will allow
+ # users to control this feature in the event they need the support.
+ tc_version_is_at_least 4.3 && confgcc+=( $(use_enable fixed-point) )
+
+ case $(tc-is-softfloat) in
+ yes) confgcc+=( --with-float=soft ) ;;
+ softfp) confgcc+=( --with-float=softfp ) ;;
+ *)
+ # If they've explicitly opt-ed in, do hardfloat,
+ # otherwise let the gcc default kick in.
+ [[ ${CTARGET//_/-} == *-hardfloat-* ]] \
+ && confgcc+=( --with-float=hard )
+ ;;
+ esac
+
+ local with_abi_map=()
+ case $(tc-arch) in
+ arm) #264534 #414395
+ local a arm_arch=${CTARGET%%-*}
+ # Remove trailing endian variations first: eb el be bl b l
+ for a in e{b,l} {b,l}e b l ; do
+ if [[ ${arm_arch} == *${a} ]] ; then
+ arm_arch=${arm_arch%${a}}
+ break
+ fi
+ done
+ # Convert armv7{a,r,m} to armv7-{a,r,m}
+ [[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-}
+ # See if this is a valid --with-arch flag
+ if (srcdir=${S}/gcc target=${CTARGET} with_arch=${arm_arch};
+ . "${srcdir}"/config.gcc) &>/dev/null
+ then
+ confgcc+=( --with-arch=${arm_arch} )
+ fi
+
+ # Make default mode thumb for microcontroller classes #418209
+ [[ ${arm_arch} == *-m ]] && confgcc+=( --with-mode=thumb )
+
+ # Enable hardvfp
+ if [[ $(tc-is-softfloat) == "no" ]] && \
+ [[ ${CTARGET} == armv[67]* ]] && \
+ tc_version_is_at_least 4.5
+ then
+ # Follow the new arm hardfp distro standard by default
+ confgcc+=( --with-float=hard )
+ case ${CTARGET} in
+ armv6*) confgcc+=( --with-fpu=vfp ) ;;
+ armv7*) confgcc+=( --with-fpu=vfpv3-d16 ) ;;
+ esac
+ fi
+ ;;
+ mips)
+ # Add --with-abi flags to set default ABI
+ confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) )
+ ;;
+ amd64)
+ # drop the older/ABI checks once this get's merged into some
+ # version of gcc upstream
+ if tc_version_is_at_least 4.7 && has x32 $(get_all_abis TARGET) ; then
+ confgcc+=( --with-abi=$(gcc-abi-map ${TARGET_DEFAULT_ABI}) )
+ fi
+ ;;
+ x86)
+ # Default arch for x86 is normally i386, lets give it a bump
+ # since glibc will do so based on CTARGET anyways
+ confgcc+=( --with-arch=${CTARGET%%-*} )
+ ;;
+ hppa)
+ # Enable sjlj exceptions for backward compatibility on hppa
+ [[ ${GCCMAJOR} == "3" ]] && confgcc+=( --enable-sjlj-exceptions )
+ ;;
+ ppc)
+ # Set up defaults based on current CFLAGS
+ is-flagq -mfloat-gprs=double && confgcc+=( --enable-e500-double )
+ [[ ${CTARGET//_/-} == *-e500v2-* ]] && confgcc+=( --enable-e500-double )
+ ;;
+ esac
+
+ # if the target can do biarch (-m32/-m64), enable it. overhead should
+ # be small, and should simplify building of 64bit kernels in a 32bit
+ # userland by not needing sys-devel/kgcc64. #349405
+ case $(tc-arch) in
+ ppc|ppc64) tc_version_is_at_least 3.4 && confgcc+=( --enable-targets=all ) ;;
+ sparc) tc_version_is_at_least 4.4 && confgcc+=( --enable-targets=all ) ;;
+ amd64|x86) tc_version_is_at_least 4.3 && confgcc+=( --enable-targets=all ) ;;
+ esac
+
+ # On Darwin we need libdir to be set in order to get correct install names
+ # for things like libobjc-gnu, libgcj and libfortran. If we enable it on
+ # non-Darwin we screw up the behaviour this eclass relies on. We in
+ # particular need this over --libdir for bug #255315.
+ [[ ${CTARGET} == *-darwin* ]] && \
+ confgcc+=( --enable-version-specific-runtime-libs )
+
+ ### library options
+
+ if ! is_gcj ; then
+ confgcc+=( --disable-libgcj )
+ elif use awt ; then
+ confgcc+=( --enable-java-awt=gtk )
+ fi
+
+ if tc_version_is_at_least 4.2 ; then
+ if in_iuse openmp ; then
+ # Make sure target has pthreads support. #326757 #335883
+ # There shouldn't be a chicken & egg problem here as openmp won't
+ # build without a C library, and you can't build that w/out
+ # already having a compiler ...
+ if ! is_crosscompile || \
+ $(tc-getCPP ${CTARGET}) -E - <<<"#include <pthread.h>" >& /dev/null
+ then
+ confgcc+=( $(use_enable openmp libgomp) )
+ else
+ # Force disable as the configure script can be dumb #359855
+ confgcc+=( --disable-libgomp )
+ fi
+ else
+ # For gcc variants where we don't want openmp (e.g. kgcc)
+ confgcc+=( --disable-libgomp )
+ fi
+ fi
+
+ if tc_version_is_at_least 4.0 ; then
+ if in_iuse mudflap ; then
+ confgcc+=( $(use_enable mudflap libmudflap) )
+ else
+ confgcc+=( --disable-libmudflap )
+ fi
+
+ if use_if_iuse libssp ; then
+ confgcc+=( --enable-libssp )
+ else
+ if hardened_gcc_is_stable ssp; then
+ export gcc_cv_libc_provides_ssp=yes
+ fi
+ confgcc+=( --disable-libssp )
+ fi
+
+ fi
+
+ # newer gcc's come with libquadmath, but only fortran uses
+ # it, so auto punt it when we don't care
+ if tc_version_is_at_least 4.6 && ! is_fortran ; then
+ confgcc+=( --disable-libquadmath )
+ fi
+
+ if tc_version_is_at_least 4.6 ; then
+ confgcc+=( --enable-lto )
+ elif tc_version_is_at_least 4.5 ; then
+ confgcc+=( --disable-lto )
+ fi
+
+ # graphite was added in 4.4 but we only support it in 4.6+ due to external
+ # library issues. 4.6/4.7 uses cloog-ppl which is a fork of CLooG with a
+ # PPL backend. 4.8+ uses upstream CLooG with the ISL backend. We install
+ # cloog-ppl into a non-standard location to prevent collisions.
+ if tc_version_is_at_least 4.8 ; then
+ confgcc+=( $(use_with graphite cloog) )
+ use graphite && confgcc+=( --disable-isl-version-check )
+ elif tc_version_is_at_least 4.6 ; then
+ confgcc+=( $(use_with graphite cloog) )
+ confgcc+=( $(use_with graphite ppl) )
+ use graphite && confgcc+=( --with-cloog-include=/usr/include/cloog-ppl )
+ use graphite && confgcc+=( --disable-ppl-version-check )
+ elif tc_version_is_at_least 4.4 ; then
+ confgcc+=( --without-cloog )
+ confgcc+=( --without-ppl )
+ fi
+
+ if tc_version_is_at_least 4.8 ; then
+ confgcc+=( $(use_enable sanitize libsanitizer) )
+ fi
+
+ # Disable gcc info regeneration -- it ships with generated info pages
+ # already. Our custom version/urls/etc... trigger it. #464008
+ export gcc_cv_prog_makeinfo_modern=no
+
+ # Do not let the X detection get in our way. We know things can be found
+ # via system paths, so no need to hardcode things that'll break multilib.
+ # Older gcc versions will detect ac_x_libraries=/usr/lib64 which ends up
+ # killing the 32bit builds which want /usr/lib.
+ export ac_cv_have_x='have_x=yes ac_x_includes= ac_x_libraries='
+
+ confgcc+=( "$@" ${EXTRA_ECONF} )
+
+ # Nothing wrong with a good dose of verbosity
+ echo
+ einfo "PREFIX: ${PREFIX}"
+ einfo "BINPATH: ${BINPATH}"
+ einfo "LIBPATH: ${LIBPATH}"
+ einfo "DATAPATH: ${DATAPATH}"
+ einfo "STDCXX_INCDIR: ${STDCXX_INCDIR}"
+ echo
+ einfo "Languages: ${GCC_LANG}"
+ echo
+ einfo "Configuring GCC with: ${confgcc[@]//--/\n\t--}"
+ echo
+
+ # Build in a separate build tree
+ mkdir -p "${WORKDIR}"/build
+ pushd "${WORKDIR}"/build > /dev/null
+
+ # and now to do the actual configuration
+ addwrite /dev/zero
+ echo "${S}"/configure "${confgcc[@]}"
+ "${S}"/configure "${confgcc[@]}" || die "failed to run configure"
+
+ # return to whatever directory we were in before
+ popd > /dev/null
+}
+
+# Replace -m flags unsupported by the version being built with the best
+# available equivalent
+downgrade_arch_flags() {
+ local arch bver i isa myarch mytune rep ver
+
+ bver=${1:-${GCC_BRANCH_VER}}
+ [[ $(gcc-version) < ${bver} ]] && return 0
+ [[ $(tc-arch) != amd64 && $(tc-arch) != x86 ]] && return 0
+
+ myarch=$(get-flag march)
+ mytune=$(get-flag mtune)
+
+ # If -march=native isn't supported we have to tease out the actual arch
+ if [[ ${myarch} == native || ${mytune} == native ]] ; then
+ if [[ ${bver} < 4.2 ]] ; then
+ arch=$($(tc-getCC) -march=native -v -E -P - </dev/null 2>&1 \
+ | sed -rn "/cc1.*-march/s:.*-march=([^ ']*).*:\1:p")
+ replace-cpu-flags native ${arch}
+ fi
+ fi
+
+ # Handle special -mtune flags
+ [[ ${mytune} == intel && ${bver} < 4.9 ]] && replace-cpu-flags intel generic
+ [[ ${mytune} == generic && ${bver} < 4.2 ]] && filter-flags '-mtune=*'
+ [[ ${mytune} == x86-64 ]] && filter-flags '-mtune=*'
+ [[ ${bver} < 3.4 ]] && filter-flags '-mtune=*'
+
+ # "added" "arch" "replacement"
+ local archlist=(
+ 4.9 bdver4 bdver3
+ 4.9 bonnell atom
+ 4.9 broadwell core-avx2
+ 4.9 haswell core-avx2
+ 4.9 ivybridge core-avx-i
+ 4.9 nehalem corei7
+ 4.9 sandybridge corei7-avx
+ 4.9 silvermont corei7
+ 4.9 westmere corei7
+ 4.8 bdver3 bdver2
+ 4.8 btver2 btver1
+ 4.7 bdver2 bdver1
+ 4.7 core-avx2 core-avx-i
+ 4.6 bdver1 amdfam10
+ 4.6 btver1 amdfam10
+ 4.6 core-avx-i core2
+ 4.6 corei7 core2
+ 4.6 corei7-avx core2
+ 4.5 atom core2
+ 4.3 amdfam10 k8
+ 4.3 athlon64-sse3 k8
+ 4.3 barcelona k8
+ 4.3 core2 nocona
+ 4.3 geode k6-2 # gcc.gnu.org/PR41989#c22
+ 4.3 k8-sse3 k8
+ 4.3 opteron-sse3 k8
+ 3.4 athlon-fx x86-64
+ 3.4 athlon64 x86-64
+ 3.4 c3-2 c3
+ 3.4 k8 x86-64
+ 3.4 opteron x86-64
+ 3.4 pentium-m pentium3
+ 3.4 pentium3m pentium3
+ 3.4 pentium4m pentium4
+ )
+
+ for ((i = 0; i < ${#archlist[@]}; i += 3)) ; do
+ myarch=$(get-flag march)
+ mytune=$(get-flag mtune)
+
+ ver=${archlist[i]}
+ arch=${archlist[i + 1]}
+ rep=${archlist[i + 2]}
+
+ [[ ${myarch} != ${arch} && ${mytune} != ${arch} ]] && continue
+
+ if [[ ${ver} > ${bver} ]] ; then
+ einfo "Replacing ${myarch} (added in gcc ${ver}) with ${rep}..."
+ [[ ${myarch} == ${arch} ]] && replace-cpu-flags ${myarch} ${rep}
+ [[ ${mytune} == ${arch} ]] && replace-cpu-flags ${mytune} ${rep}
+ continue
+ else
+ break
+ fi
+ done
+
+ # we only check -mno* here since -m* get removed by strip-flags later on
+ local isalist=(
+ 4.9 -mno-sha
+ 4.9 -mno-avx512pf
+ 4.9 -mno-avx512f
+ 4.9 -mno-avx512er
+ 4.9 -mno-avx512cd
+ 4.8 -mno-xsaveopt
+ 4.8 -mno-xsave
+ 4.8 -mno-rtm
+ 4.8 -mno-fxsr
+ 4.7 -mno-lzcnt
+ 4.7 -mno-bmi2
+ 4.7 -mno-avx2
+ 4.6 -mno-tbm
+ 4.6 -mno-rdrnd
+ 4.6 -mno-fsgsbase
+ 4.6 -mno-f16c
+ 4.6 -mno-bmi
+ 4.5 -mno-xop
+ 4.5 -mno-movbe
+ 4.5 -mno-lwp
+ 4.5 -mno-fma4
+ 4.4 -mno-pclmul
+ 4.4 -mno-fma
+ 4.4 -mno-avx
+ 4.4 -mno-aes
+ 4.3 -mno-ssse3
+ 4.3 -mno-sse4a
+ 4.3 -mno-sse4
+ 4.3 -mno-sse4.2
+ 4.3 -mno-sse4.1
+ 4.3 -mno-popcnt
+ 4.3 -mno-abm
+ )
+
+ for ((i = 0; i < ${#isalist[@]}; i += 2)) ; do
+ ver=${isalist[i]}
+ isa=${isalist[i + 1]}
+ [[ ${ver} > ${bver} ]] && filter-flags ${isa} ${isa/-m/-mno-}
+ done
+}
+
+gcc_do_filter_flags() {
+ strip-flags
+ replace-flags -O? -O2
+
+ # dont want to funk ourselves
+ filter-flags '-mabi*' -m31 -m32 -m64
+
+ filter-flags -frecord-gcc-switches # 490738
+ filter-flags -mno-rtm -mno-htm # 506202
+
+ if tc_version_is_between 3.2 3.4 ; then
+ # XXX: this is so outdated it's barely useful, but it don't hurt...
+ replace-cpu-flags G3 750
+ replace-cpu-flags G4 7400
+ replace-cpu-flags G5 7400
+
+ # XXX: should add a sed or something to query all supported flags
+ # from the gcc source and trim everything else ...
+ filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs
+ filter-flags -f{no-,}stack-protector{,-all}
+ filter-flags -fvisibility-inlines-hidden -fvisibility=hidden
+ fi
+
+ if tc_version_is_at_least 3.4 ; then
+ case $(tc-arch) in
+ amd64|x86)
+ filter-flags '-mcpu=*'
+
+ tc_version_is_between 4.4 4.5 && append-flags -mno-avx # 357287
+
+ if tc_version_is_between 4.6 4.7 ; then
+ # https://bugs.gentoo.org/411333
+ # https://bugs.gentoo.org/466454
+ replace-cpu-flags c3-2 pentium2 pentium3 pentium3m pentium-m i686
+ fi
+ ;;
+ alpha)
+ # https://bugs.gentoo.org/454426
+ append-ldflags -Wl,--no-relax
+ ;;
+ sparc)
+ # temporary workaround for random ICEs reproduced by multiple users
+ # https://bugs.gentoo.org/457062
+ tc_version_is_between 4.6 4.8 && MAKEOPTS+=" -j1"
+ ;;
+ *-macos)
+ # http://gcc.gnu.org/PR25127
+ tc_version_is_between 4.0 4.2 && \
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*'
+ ;;
+ esac
+ fi
+
+ strip-unsupported-flags
+
+ # these are set here so we have something sane at configure time
+ if is_crosscompile ; then
+ # Set this to something sane for both native and target
+ CFLAGS="-O2 -pipe"
+ FFLAGS=${CFLAGS}
+ FCFLAGS=${CFLAGS}
+
+ local VAR="CFLAGS_"${CTARGET//-/_}
+ CXXFLAGS=${!VAR}
+ fi
+
+ export GCJFLAGS=${GCJFLAGS:-${CFLAGS}}
+}
+
+setup_minispecs_gcc_build_specs() {
+ # Setup the "build.specs" file for gcc 4.3 to use when building.
+ if hardened_gcc_works pie ; then
+ cat "${WORKDIR}"/specs/pie.specs >> "${WORKDIR}"/build.specs
+ fi
+ if hardened_gcc_works ssp ; then
+ for s in ssp sspall ; do
+ cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs
+ done
+ fi
+ for s in nostrict znow ; do
+ cat "${WORKDIR}"/specs/${s}.specs >> "${WORKDIR}"/build.specs
+ done
+ export GCC_SPECS="${WORKDIR}"/build.specs
+}
+
+gcc-multilib-configure() {
+ if ! is_multilib ; then
+ confgcc+=( --disable-multilib )
+ # Fun times: if we are building for a target that has multiple
+ # possible ABI formats, and the user has told us to pick one
+ # that isn't the default, then not specifying it via the list
+ # below will break that on us.
+ else
+ confgcc+=( --enable-multilib )
+ fi
+
+ # translate our notion of multilibs into gcc's
+ local abi list
+ for abi in $(get_all_abis TARGET) ; do
+ local l=$(gcc-abi-map ${abi})
+ [[ -n ${l} ]] && list+=",${l}"
+ done
+ if [[ -n ${list} ]] ; then
+ case ${CTARGET} in
+ x86_64*)
+ tc_version_is_at_least 4.7 && confgcc+=( --with-multilib-list=${list:1} )
+ ;;
+ esac
+ fi
+}
+
+gcc-abi-map() {
+ # Convert the ABI name we use in Gentoo to what gcc uses
+ local map=()
+ case ${CTARGET} in
+ mips*) map=("o32 32" "n32 n32" "n64 64") ;;
+ x86_64*) map=("amd64 m64" "x86 m32" "x32 mx32") ;;
+ esac
+
+ local m
+ for m in "${map[@]}" ; do
+ l=( ${m} )
+ [[ $1 == ${l[0]} ]] && echo ${l[1]} && break
+ done
+}
+
+#----> src_compile <----
+
+toolchain_src_compile() {
+ case ${EAPI:-0} in
+ 0|1) toolchain_src_configure ;;
+ esac
+
+ touch "${S}"/gcc/c-gperf.h
+
+ # Do not make manpages if we do not have perl ...
+ [[ ! -x /usr/bin/perl ]] \
+ && find "${WORKDIR}"/build -name '*.[17]' | xargs touch
+
+ gcc_do_make ${GCC_MAKE_TARGET}
+}
+
+gcc_do_make() {
+ # This function accepts one optional argument, the make target to be used.
+ # If omitted, gcc_do_make will try to guess whether it should use all,
+ # or bootstrap-lean depending on CTARGET and arch.
+ # An example of how to use this function:
+ #
+ # gcc_do_make all-target-libstdc++-v3
+
+ [[ -n ${1} ]] && GCC_MAKE_TARGET=${1}
+
+ # default target
+ if is_crosscompile || tc-is-cross-compiler ; then
+ # 3 stage bootstrapping doesnt quite work when you cant run the
+ # resulting binaries natively ^^;
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-all}
+ else
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap-lean}
+ fi
+
+ # Older versions of GCC could not do profiledbootstrap in parallel due to
+ # collisions with profiling info.
+ # boundschecking also seems to introduce parallel build issues.
+ if [[ ${GCC_MAKE_TARGET} == "profiledbootstrap" ]] || use_if_iuse boundschecking ; then
+ ! tc_version_is_at_least 4.6 && export MAKEOPTS="${MAKEOPTS} -j1"
+ fi
+
+ if [[ ${GCC_MAKE_TARGET} == "all" ]] ; then
+ STAGE1_CFLAGS=${STAGE1_CFLAGS-"${CFLAGS}"}
+ elif [[ $(gcc-version) == "3.4" && ${GCC_BRANCH_VER} == "3.4" ]] && gcc-specs-ssp ; then
+ # See bug #79852
+ STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"}
+ fi
+
+ if is_crosscompile; then
+ # In 3.4, BOOT_CFLAGS is never used on a crosscompile...
+ # but I'll leave this in anyways as someone might have had
+ # some reason for putting it in here... --eradicator
+ BOOT_CFLAGS=${BOOT_CFLAGS-"-O2"}
+ else
+ # we only want to use the system's CFLAGS if not building a
+ # cross-compiler.
+ BOOT_CFLAGS=${BOOT_CFLAGS-"$(get_abi_CFLAGS ${TARGET_DEFAULT_ABI}) ${CFLAGS}"}
+ fi
+
+ einfo "Compiling ${PN} (${GCC_MAKE_TARGET})..."
+
+ pushd "${WORKDIR}"/build >/dev/null
+
+ emake \
+ LDFLAGS="${LDFLAGS}" \
+ STAGE1_CFLAGS="${STAGE1_CFLAGS}" \
+ LIBPATH="${LIBPATH}" \
+ BOOT_CFLAGS="${BOOT_CFLAGS}" \
+ ${GCC_MAKE_TARGET} \
+ || die "emake failed with ${GCC_MAKE_TARGET}"
+
+ if ! is_crosscompile && use cxx && use_if_iuse doc ; then
+ if type -p doxygen > /dev/null ; then
+ if tc_version_is_at_least 4.3 ; then
+ cd "${CTARGET}"/libstdc++-v3/doc
+ emake doc-man-doxygen || ewarn "failed to make docs"
+ elif tc_version_is_at_least 3.0 ; then
+ cd "${CTARGET}"/libstdc++-v3
+ emake doxygen-man || ewarn "failed to make docs"
+ fi
+ else
+ ewarn "Skipping libstdc++ manpage generation since you don't have doxygen installed"
+ fi
+ fi
+
+ popd >/dev/null
+}
+
+#---->> src_test <<----
+
+toolchain_src_test() {
+ if use regression-test ; then
+ cd "${WORKDIR}"/build
+ emake -k check
+ fi
+}
+
+#---->> src_install <<----
+
+toolchain_src_install() {
+ cd "${WORKDIR}"/build
+
+ # Do allow symlinks in private gcc include dir as this can break the build
+ find gcc/include*/ -type l -delete
+
+ # Copy over the info pages. We disabled their generation earlier, but the
+ # build system only expects to install out of the build dir, not the source. #464008
+ mkdir -p gcc/doc
+ local x=
+ for x in "${S}"/gcc/doc/*.info* ; do
+ if [[ -f ${x} ]] ; then
+ cp "${x}" gcc/doc/ || die
+ fi
+ done
+
+ # Remove generated headers, as they can cause things to break
+ # (ncurses, openssl, etc).
+ while read x ; do
+ grep -q 'It has been auto-edited by fixincludes from' "${x}" \
+ && rm -f "${x}"
+ done < <(find gcc/include*/ -name '*.h')
+
+ # Do the 'make install' from the build directory
+ S="${WORKDIR}"/build emake -j1 DESTDIR="${D}" install || die
+
+ # Punt some tools which are really only useful while building gcc
+ find "${D}" -name install-tools -prune -type d -exec rm -rf "{}" \;
+ # This one comes with binutils
+ find "${D}" -name libiberty.a -delete
+
+ # Move the libraries to the proper location
+ gcc_movelibs
+
+ # Basic sanity check
+ if ! is_crosscompile ; then
+ local EXEEXT
+ eval $(grep ^EXEEXT= "${WORKDIR}"/build/gcc/config.log)
+ [[ -r ${D}${BINPATH}/gcc${EXEEXT} ]] || die "gcc not found in ${D}"
+ fi
+
+ dodir /etc/env.d/gcc
+ create_gcc_env_entry
+
+ # Setup the gcc_env_entry for hardened gcc 4 with minispecs
+ want_minispecs && copy_minispecs_gcc_specs
+
+ # Make sure we dont have stuff lying around that
+ # can nuke multiple versions of gcc
+ gcc_slot_java
+
+ dodir /usr/bin
+ cd "${D}"${BINPATH}
+ # Ugh: we really need to auto-detect this list.
+ # It's constantly out of date.
+ for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do
+ # For some reason, g77 gets made instead of ${CTARGET}-g77...
+ # this should take care of that
+ [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x}
+
+ if [[ -f ${CTARGET}-${x} ]] ; then
+ if ! is_crosscompile ; then
+ ln -sf ${CTARGET}-${x} ${x}
+ dosym ${BINPATH}/${CTARGET}-${x} \
+ /usr/bin/${x}-${GCC_CONFIG_VER}
+ fi
+ # Create versioned symlinks
+ dosym ${BINPATH}/${CTARGET}-${x} \
+ /usr/bin/${CTARGET}-${x}-${GCC_CONFIG_VER}
+ fi
+
+ if [[ -f ${CTARGET}-${x}-${GCC_CONFIG_VER} ]] ; then
+ rm -f ${CTARGET}-${x}-${GCC_CONFIG_VER}
+ ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER}
+ fi
+ done
+
+ # Now do the fun stripping stuff
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}"
+ env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}"
+ # gcc used to install helper binaries in lib/ but then moved to libexec/
+ [[ -d ${D}${PREFIX}/libexec/gcc ]] && \
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}"
+
+ cd "${S}"
+ if is_crosscompile; then
+ rm -rf "${D}"/usr/share/{man,info}
+ rm -rf "${D}"${DATAPATH}/{man,info}
+ else
+ if tc_version_is_at_least 3.0 ; then
+ local cxx_mandir=$(find "${WORKDIR}/build/${CTARGET}/libstdc++-v3" -name man)
+ if [[ -d ${cxx_mandir} ]] ; then
+ # clean bogus manpages #113902
+ find "${cxx_mandir}" -name '*_build_*' -exec rm {} \;
+ cp -r "${cxx_mandir}"/man? "${D}/${DATAPATH}"/man/
+ fi
+ fi
+ has noinfo ${FEATURES} \
+ && rm -r "${D}/${DATAPATH}"/info \
+ || prepinfo "${DATAPATH}"
+ has noman ${FEATURES} \
+ && rm -r "${D}/${DATAPATH}"/man \
+ || prepman "${DATAPATH}"
+ fi
+ # prune empty dirs left behind
+ find "${D}" -depth -type d -delete 2>/dev/null
+
+ # install testsuite results
+ if use regression-test; then
+ docinto testsuite
+ find "${WORKDIR}"/build -type f -name "*.sum" -print0 | xargs -0 dodoc
+ find "${WORKDIR}"/build -type f -path "*/testsuite/*.log" -print0 \
+ | xargs -0 dodoc
+ fi
+
+ # Rather install the script, else portage with changing $FILESDIR
+ # between binary and source package borks things ....
+ if ! is_crosscompile ; then
+ insinto "${DATAPATH}"
+ if tc_version_is_at_least 4.0 ; then
+ newins "${GCC_FILESDIR}"/awk/fixlafiles.awk-no_gcc_la fixlafiles.awk || die
+ find "${D}/${LIBPATH}" -name libstdc++.la -type f -exec rm "{}" \;
+ find "${D}/${LIBPATH}" -name "lib?san.la" -type f -exec rm "{}" \; # 487550
+ else
+ doins "${GCC_FILESDIR}"/awk/fixlafiles.awk || die
+ fi
+ exeinto "${DATAPATH}"
+ doexe "${GCC_FILESDIR}"/fix_libtool_files.sh || die
+ doexe "${GCC_FILESDIR}"/c{89,99} || die
+ fi
+
+ # Use gid of 0 because some stupid ports don't have
+ # the group 'root' set to gid 0. Send to /dev/null
+ # for people who are testing as non-root.
+ chown -R root:0 "${D}"${LIBPATH} 2>/dev/null
+
+ # Move pretty-printers to gdb datadir to shut ldconfig up
+ local py gdbdir=/usr/share/gdb/auto-load${LIBPATH/\/lib\//\/$(get_libdir)\/}
+ pushd "${D}"${LIBPATH} >/dev/null
+ for py in $(find . -name '*-gdb.py') ; do
+ local multidir=${py%/*}
+ insinto "${gdbdir}/${multidir}"
+ sed -i "/^libdir =/s:=.*:= '${LIBPATH}/${multidir}':" "${py}" || die #348128
+ doins "${py}" || die
+ rm "${py}" || die
+ done
+ popd >/dev/null
+
+ # Don't scan .gox files for executable stacks - false positives
+ export QA_EXECSTACK="usr/lib*/go/*/*.gox"
+ export QA_WX_LOAD="usr/lib*/go/*/*.gox"
+
+ # Disable RANDMMAP so PCH works. #301299
+ if tc_version_is_at_least 4.3 ; then
+ pax-mark -r "${D}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1"
+ pax-mark -r "${D}${PREFIX}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1plus"
+ fi
+}
+
+# Move around the libs to the right location. For some reason,
+# when installing gcc, it dumps internal libraries into /usr/lib
+# instead of the private gcc lib path
+gcc_movelibs() {
+ # older versions of gcc did not support --print-multi-os-directory
+ tc_version_is_at_least 3.2 || return 0
+
+ local x multiarg removedirs=""
+ for multiarg in $($(XGCC) -print-multi-lib) ; do
+ multiarg=${multiarg#*;}
+ multiarg=${multiarg//@/ -}
+
+ local OS_MULTIDIR=$($(XGCC) ${multiarg} --print-multi-os-directory)
+ local MULTIDIR=$($(XGCC) ${multiarg} --print-multi-directory)
+ local TODIR=${D}${LIBPATH}/${MULTIDIR}
+ local FROMDIR=
+
+ [[ -d ${TODIR} ]] || mkdir -p ${TODIR}
+
+ for FROMDIR in \
+ ${LIBPATH}/${OS_MULTIDIR} \
+ ${LIBPATH}/../${MULTIDIR} \
+ ${PREFIX}/lib/${OS_MULTIDIR} \
+ ${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR}
+ do
+ removedirs="${removedirs} ${FROMDIR}"
+ FROMDIR=${D}${FROMDIR}
+ if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then
+ local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null)
+ if [[ -n ${files} ]] ; then
+ mv ${files} "${TODIR}"
+ fi
+ fi
+ done
+ fix_libtool_libdir_paths "${LIBPATH}/${MULTIDIR}"
+
+ # SLOT up libgcj.pc if it's available (and let gcc-config worry about links)
+ FROMDIR="${PREFIX}/lib/${OS_MULTIDIR}"
+ for x in "${D}${FROMDIR}"/pkgconfig/libgcj*.pc ; do
+ [[ -f ${x} ]] || continue
+ sed -i "/^libdir=/s:=.*:=${LIBPATH}/${MULTIDIR}:" "${x}"
+ mv "${x}" "${D}${FROMDIR}"/pkgconfig/libgcj-${GCC_PV}.pc || die
+ done
+ done
+
+ # We remove directories separately to avoid this case:
+ # mv SRC/lib/../lib/*.o DEST
+ # rmdir SRC/lib/../lib/
+ # mv SRC/lib/../lib32/*.o DEST # Bork
+ for FROMDIR in ${removedirs} ; do
+ rmdir "${D}"${FROMDIR} >& /dev/null
+ done
+ find "${D}" -type d | xargs rmdir >& /dev/null
+}
+
+# make sure the libtool archives have libdir set to where they actually
+# -are-, and not where they -used- to be. also, any dependencies we have
+# on our own .la files need to be updated.
+fix_libtool_libdir_paths() {
+ pushd "${D}" >/dev/null
+
+ pushd "./${1}" >/dev/null
+ local dir="${PWD#${D%/}}"
+ local allarchives=$(echo *.la)
+ allarchives="\(${allarchives// /\\|}\)"
+ popd >/dev/null
+
+ sed -i \
+ -e "/^libdir=/s:=.*:='${dir}':" \
+ ./${dir}/*.la
+ sed -i \
+ -e "/^dependency_libs=/s:/[^ ]*/${allarchives}:${LIBPATH}/\1:g" \
+ $(find ./${PREFIX}/lib* -maxdepth 3 -name '*.la') \
+ ./${dir}/*.la
+
+ popd >/dev/null
+}
+
+create_gcc_env_entry() {
+ dodir /etc/env.d/gcc
+ local gcc_envd_base="/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}"
+
+ local gcc_specs_file
+ local gcc_envd_file="${D}${gcc_envd_base}"
+ if [[ -z $1 ]] ; then
+ # I'm leaving the following commented out to remind me that it
+ # was an insanely -bad- idea. Stuff broke. GCC_SPECS isnt unset
+ # on chroot or in non-toolchain.eclass gcc ebuilds!
+ #gcc_specs_file="${LIBPATH}/specs"
+ gcc_specs_file=""
+ else
+ gcc_envd_file+="-$1"
+ gcc_specs_file="${LIBPATH}/$1.specs"
+ fi
+
+ # We want to list the default ABI's LIBPATH first so libtool
+ # searches that directory first. This is a temporary
+ # workaround for libtool being stupid and using .la's from
+ # conflicting ABIs by using the first one in the search path
+ local ldpaths mosdirs
+ if tc_version_is_at_least 3.2 ; then
+ local mdir mosdir abi ldpath
+ for abi in $(get_all_abis TARGET) ; do
+ mdir=$($(XGCC) $(get_abi_CFLAGS ${abi}) --print-multi-directory)
+ ldpath=${LIBPATH}
+ [[ ${mdir} != "." ]] && ldpath+="/${mdir}"
+ ldpaths="${ldpath}${ldpaths:+:${ldpaths}}"
+
+ mosdir=$($(XGCC) $(get_abi_CFLAGS ${abi}) -print-multi-os-directory)
+ mosdirs="${mosdir}${mosdirs:+:${mosdirs}}"
+ done
+ else
+ # Older gcc's didn't do multilib, so logic is simple.
+ ldpaths=${LIBPATH}
+ fi
+
+ cat <<-EOF > ${gcc_envd_file}
+ PATH="${BINPATH}"
+ ROOTPATH="${BINPATH}"
+ GCC_PATH="${BINPATH}"
+ LDPATH="${ldpaths}"
+ MANPATH="${DATAPATH}/man"
+ INFOPATH="${DATAPATH}/info"
+ STDCXX_INCDIR="${STDCXX_INCDIR##*/}"
+ CTARGET="${CTARGET}"
+ GCC_SPECS="${gcc_specs_file}"
+ MULTIOSDIRS="${mosdirs}"
+ EOF
+}
+
+copy_minispecs_gcc_specs() {
+ # setup the hardenedno* specs files and the vanilla specs file.
+ if hardened_gcc_works ; then
+ create_gcc_env_entry hardenednopiessp
+ fi
+ if hardened_gcc_works pie ; then
+ create_gcc_env_entry hardenednopie
+ fi
+ if hardened_gcc_works ssp ; then
+ create_gcc_env_entry hardenednossp
+ fi
+ create_gcc_env_entry vanilla
+ insinto ${LIBPATH}
+ doins "${WORKDIR}"/specs/*.specs || die "failed to install specs"
+ # Build system specs file which, if it exists, must be a complete set of
+ # specs as it completely and unconditionally overrides the builtin specs.
+ if ! tc_version_is_at_least 4.4 ; then
+ $(XGCC) -dumpspecs > "${WORKDIR}"/specs/specs
+ cat "${WORKDIR}"/build.specs >> "${WORKDIR}"/specs/specs
+ doins "${WORKDIR}"/specs/specs || die "failed to install the specs file"
+ fi
+}
+
+gcc_slot_java() {
+ local x
+
+ # Move Java headers to compiler-specific dir
+ for x in "${D}"${PREFIX}/include/gc*.h "${D}"${PREFIX}/include/j*.h ; do
+ [[ -f ${x} ]] && mv -f "${x}" "${D}"${LIBPATH}/include/
+ done
+ for x in gcj gnu java javax org ; do
+ if [[ -d ${D}${PREFIX}/include/${x} ]] ; then
+ dodir /${LIBPATH}/include/${x}
+ mv -f "${D}"${PREFIX}/include/${x}/* "${D}"${LIBPATH}/include/${x}/
+ rm -rf "${D}"${PREFIX}/include/${x}
+ fi
+ done
+
+ if [[ -d ${D}${PREFIX}/lib/security ]] || [[ -d ${D}${PREFIX}/$(get_libdir)/security ]] ; then
+ dodir /${LIBPATH}/security
+ mv -f "${D}"${PREFIX}/lib*/security/* "${D}"${LIBPATH}/security
+ rm -rf "${D}"${PREFIX}/lib*/security
+ fi
+
+ # Move random gcj files to compiler-specific directories
+ for x in libgcj.spec logging.properties ; do
+ x="${D}${PREFIX}/lib/${x}"
+ [[ -f ${x} ]] && mv -f "${x}" "${D}"${LIBPATH}/
+ done
+
+ # Rename jar because it could clash with Kaffe's jar if this gcc is
+ # primary compiler (aka don't have the -<version> extension)
+ cd "${D}"${BINPATH}
+ [[ -f jar ]] && mv -f jar gcj-jar
+}
+
+#---->> pkg_post* <<----
+
+toolchain_pkg_postinst() {
+ do_gcc_config
+
+ if ! is_crosscompile ; then
+ echo
+ ewarn "If you have issues with packages unable to locate libstdc++.la,"
+ ewarn "then try running 'fix_libtool_files.sh' on the old gcc versions."
+ echo
+ ewarn "You might want to review the GCC upgrade guide when moving between"
+ ewarn "major versions (like 4.2 to 4.3):"
+ ewarn "http://www.gentoo.org/doc/en/gcc-upgrading.xml"
+ echo
+
+ # Clean up old paths
+ rm -f "${ROOT}"/*/rcscripts/awk/fixlafiles.awk "${ROOT}"/sbin/fix_libtool_files.sh
+ rmdir "${ROOT}"/*/rcscripts{/awk,} 2>/dev/null
+
+ mkdir -p "${ROOT}"/usr/{share/gcc-data,sbin,bin}
+ cp "${ROOT}/${DATAPATH}"/fixlafiles.awk "${ROOT}"/usr/share/gcc-data/ || die
+ cp "${ROOT}/${DATAPATH}"/fix_libtool_files.sh "${ROOT}"/usr/sbin/ || die
+
+ # Since these aren't critical files and portage sucks with
+ # handling of binpkgs, don't require these to be found
+ cp "${ROOT}/${DATAPATH}"/c{89,99} "${ROOT}"/usr/bin/ 2>/dev/null
+ fi
+
+ if use regression-test ; then
+ elog "Testsuite results have been installed into /usr/share/doc/${PF}/testsuite"
+ echo
+ fi
+
+ if [[ -n ${PRERELEASE}${SNAPSHOT} ]] ; then
+ einfo "This GCC ebuild is provided for your convenience, and the use"
+ einfo "of this compiler is not supported by the Gentoo Developers."
+ einfo "Please report bugs to upstream at http://gcc.gnu.org/bugzilla/"
+ fi
+}
+
+toolchain_pkg_postrm() {
+ # to make our lives easier (and saner), we do the fix_libtool stuff here.
+ # rather than checking SLOT's and trying in upgrade paths, we just see if
+ # the common libstdc++.la exists in the ${LIBPATH} of the gcc that we are
+ # unmerging. if it does, that means this was a simple re-emerge.
+
+ # clean up the cruft left behind by cross-compilers
+ if is_crosscompile ; then
+ if [[ -z $(ls "${ROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
+ rm -f "${ROOT}"/etc/env.d/gcc/config-${CTARGET}
+ rm -f "${ROOT}"/etc/env.d/??gcc-${CTARGET}
+ rm -f "${ROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
+ fi
+ return 0
+ fi
+
+ # ROOT isnt handled by the script
+ [[ ${ROOT} != "/" ]] && return 0
+
+ if [[ ! -e ${LIBPATH}/libstdc++.so ]] ; then
+ # make sure the profile is sane during same-slot upgrade #289403
+ do_gcc_config
+
+ einfo "Running 'fix_libtool_files.sh ${GCC_RELEASE_VER}'"
+ /usr/sbin/fix_libtool_files.sh ${GCC_RELEASE_VER}
+ if [[ -n ${BRANCH_UPDATE} ]] ; then
+ einfo "Running 'fix_libtool_files.sh ${GCC_RELEASE_VER}-${BRANCH_UPDATE}'"
+ /usr/sbin/fix_libtool_files.sh ${GCC_RELEASE_VER}-${BRANCH_UPDATE}
+ fi
+ fi
+
+ return 0
+}
+
+do_gcc_config() {
+ if ! should_we_gcc_config ; then
+ env -i ROOT="${ROOT}" gcc-config --use-old --force
+ return 0
+ fi
+
+ local current_gcc_config="" current_specs="" use_specs=""
+
+ current_gcc_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>/dev/null)
+ if [[ -n ${current_gcc_config} ]] ; then
+ # figure out which specs-specific config is active
+ current_specs=$(gcc-config -S ${current_gcc_config} | awk '{print $3}')
+ [[ -n ${current_specs} ]] && use_specs=-${current_specs}
+ fi
+ if [[ -n ${use_specs} ]] && \
+ [[ ! -e ${ROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
+ then
+ ewarn "The currently selected specs-specific gcc config,"
+ ewarn "${current_specs}, doesn't exist anymore. This is usually"
+ ewarn "due to enabling/disabling hardened or switching to a version"
+ ewarn "of gcc that doesnt create multiple specs files. The default"
+ ewarn "config will be used, and the previous preference forgotten."
+ use_specs=""
+ fi
+
+ gcc-config ${CTARGET}-${GCC_CONFIG_VER}${use_specs}
+}
+
+should_we_gcc_config() {
+ # if the current config is invalid, we definitely want a new one
+ # Note: due to bash quirkiness, the following must not be 1 line
+ local curr_config
+ curr_config=$(env -i ROOT="${ROOT}" gcc-config -c ${CTARGET} 2>&1) || return 0
+
+ # if the previously selected config has the same major.minor (branch) as
+ # the version we are installing, then it will probably be uninstalled
+ # for being in the same SLOT, make sure we run gcc-config.
+ local curr_config_ver=$(env -i ROOT="${ROOT}" gcc-config -S ${curr_config} | awk '{print $2}')
+
+ local curr_branch_ver=$(get_version_component_range 1-2 ${curr_config_ver})
+
+ # If we're using multislot, just run gcc-config if we're installing
+ # to the same profile as the current one.
+ use multislot && return $([[ ${curr_config_ver} == ${GCC_CONFIG_VER} ]])
+
+ if [[ ${curr_branch_ver} == ${GCC_BRANCH_VER} ]] ; then
+ return 0
+ else
+ # if we're installing a genuinely different compiler version,
+ # we should probably tell the user -how- to switch to the new
+ # gcc version, since we're not going to do it for him/her.
+ # We don't want to switch from say gcc-3.3 to gcc-3.4 right in
+ # the middle of an emerge operation (like an 'emerge -e world'
+ # which could install multiple gcc versions).
+ # Only warn if we're installing a pkg as we might be called from
+ # the pkg_{pre,post}rm steps. #446830
+ if [[ ${EBUILD_PHASE} == *"inst" ]] ; then
+ einfo "The current gcc config appears valid, so it will not be"
+ einfo "automatically switched for you. If you would like to"
+ einfo "switch to the newly installed gcc version, do the"
+ einfo "following:"
+ echo
+ einfo "gcc-config ${CTARGET}-${GCC_CONFIG_VER}"
+ einfo "source /etc/profile"
+ echo
+ fi
+ return 1
+ fi
+}
+
+#---->> support and misc functions <<----
+
+# This is to make sure we don't accidentally try to enable support for a
+# language that doesnt exist. GCC 3.4 supports f77, while 4.0 supports f95, etc.
+#
+# Also add a hook so special ebuilds (kgcc64) can control which languages
+# exactly get enabled
+gcc-lang-supported() {
+ grep ^language=\"${1}\" "${S}"/gcc/*/config-lang.in > /dev/null || return 1
+ [[ -z ${TOOLCHAIN_ALLOWED_LANGS} ]] && return 0
+ has $1 ${TOOLCHAIN_ALLOWED_LANGS}
+}
+
+is_ada() {
+ gcc-lang-supported ada || return 1
+ use ada
+}
+
+is_cxx() {
+ gcc-lang-supported 'c++' || return 1
+ ! is_crosscompile && tc_version_is_at_least 4.8 && return 0
+ use cxx
+}
+
+is_d() {
+ gcc-lang-supported d || return 1
+ use_if_iuse d
+}
+
+is_f77() {
+ gcc-lang-supported f77 || return 1
+ use fortran
+}
+
+is_f95() {
+ gcc-lang-supported f95 || return 1
+ use fortran
+}
+
+is_fortran() {
+ gcc-lang-supported fortran || return 1
+ use fortran
+}
+
+is_gcj() {
+ gcc-lang-supported java || return 1
+ use cxx && use_if_iuse gcj
+}
+
+is_go() {
+ gcc-lang-supported go || return 1
+ use cxx && use_if_iuse go
+}
+
+is_multilib() {
+ tc_version_is_at_least 3 || return 1
+ use multilib
+}
+
+is_objc() {
+ gcc-lang-supported objc || return 1
+ use_if_iuse objc
+}
+
+is_objcxx() {
+ gcc-lang-supported 'obj-c++' || return 1
+ use cxx && use_if_iuse objc++
+}
+
+# Grab a variable from the build system (taken from linux-info.eclass)
+get_make_var() {
+ local var=$1 makefile=${2:-${WORKDIR}/build/Makefile}
+ echo -e "e:\\n\\t@echo \$(${var})\\ninclude ${makefile}" | \
+ r=${makefile%/*} emake --no-print-directory -s -f - 2>/dev/null
+}
+
+XGCC() { get_make_var GCC_FOR_TARGET ; }
+
+# The gentoo piessp patches allow for 3 configurations:
+# 1) PIE+SSP by default
+# 2) PIE by default
+# 3) SSP by default
+hardened_gcc_works() {
+ if [[ $1 == "pie" ]] ; then
+ # $gcc_cv_ld_pie is unreliable as it simply take the output of
+ # `ld --help | grep -- -pie`, that reports the option in all cases, also if
+ # the loader doesn't actually load the resulting executables.
+ # To avoid breakage, blacklist FreeBSD here at least
+ [[ ${CTARGET} == *-freebsd* ]] && return 1
+
+ want_pie || return 1
+ use_if_iuse nopie && return 1
+ hardened_gcc_is_stable pie
+ return $?
+ elif [[ $1 == "ssp" ]] ; then
+ [[ -n ${SPECS_VER} ]] || return 1
+ use_if_iuse nossp && return 1
+ hardened_gcc_is_stable ssp
+ return $?
+ else
+ # laziness ;)
+ hardened_gcc_works pie || return 1
+ hardened_gcc_works ssp || return 1
+ return 0
+ fi
+}
+
+hardened_gcc_is_stable() {
+ local tocheck
+ if [[ $1 == "pie" ]] ; then
+ if [[ ${CTARGET} == *-uclibc* ]] ; then
+ tocheck=${PIE_UCLIBC_STABLE}
+ elif [[ ${CTARGET} == *-musl* ]] ; then
+ tocheck=${PIE_MUSL_STABLE}
+ elif [[ ${CTARGET} == *-gnu* ]] ; then
+ tocheck=${PIE_GLIBC_STABLE}
+ fi
+ elif [[ $1 == "ssp" ]] ; then
+ if [[ ${CTARGET} == *-uclibc* ]] ; then
+ tocheck=${SSP_UCLIBC_STABLE}
+ elif [[ ${CTARGET} == *-musl* ]] ; then
+ tocheck=${SSP_MUSL_STABLE}
+ elif [[ ${CTARGET} == *-gnu* ]] ; then
+ tocheck=${SSP_STABLE}
+ fi
+ else
+ die "hardened_gcc_stable needs to be called with pie or ssp"
+ fi
+
+ has $(tc-arch) ${tocheck} && return 0
+ return 1
+}
+
+want_minispecs() {
+ if tc_version_is_at_least 4.3.2 && use hardened ; then
+ if ! want_pie ; then
+ ewarn "PIE_VER or SPECS_VER is not defined in the GCC ebuild."
+ elif use vanilla ; then
+ ewarn "You will not get hardened features if you have the vanilla USE-flag."
+ elif use nopie && use nossp ; then
+ ewarn "You will not get hardened features if you have the nopie and nossp USE-flag."
+ elif ! hardened_gcc_works ; then
+ ewarn "Your $(tc-arch) arch is not supported."
+ else
+ return 0
+ fi
+ ewarn "Hope you know what you are doing. Hardened will not work."
+ return 0
+ fi
+ return 1
+}
+
+want_pie() {
+ ! use hardened && [[ -n ${PIE_VER} ]] && use nopie && return 1
+ [[ -n ${PIE_VER} ]] && [[ -n ${SPECS_VER} ]] && return 0
+ tc_version_is_at_least 4.3.2 && return 1
+ [[ -z ${PIE_VER} ]] && return 1
+ use !nopie && return 0
+ return 1
+}
+
+has toolchain_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" toolchain_death_notice"
+toolchain_death_notice() {
+ if [[ -e "${WORKDIR}"/build ]] ; then
+ pushd "${WORKDIR}"/build >/dev/null
+ (echo '' | $(tc-getCC ${CTARGET}) ${CFLAGS} -v -E - 2>&1) > gccinfo.log
+ [[ -e "${T}"/build.log ]] && cp "${T}"/build.log .
+ tar jcf "${WORKDIR}"/gcc-build-logs.tar.bz2 \
+ gccinfo.log build.log $(find -name config.log)
+ rm gccinfo.log build.log
+ eerror
+ eerror "Please include ${WORKDIR}/gcc-build-logs.tar.bz2 in your bug report."
+ eerror
+ popd >/dev/null
+ fi
+}
diff --git a/gnome-base/libgtop/Manifest b/gnome-base/libgtop/Manifest
new file mode 100644
index 00000000..16203fe6
--- /dev/null
+++ b/gnome-base/libgtop/Manifest
@@ -0,0 +1,6 @@
+AUX libgtop-musl.patch 781 SHA256 3d970072db4d9c521026d074de38accc1caf8d020e2fb040641fe59582827933 SHA512 c0254baedd3a18839ae5c88951fcc1d2d804686938363936268381b695f41bdb4f7b12954cefc1c4bd5b373f36736e4937548dd6659a925d4201bf23a28fd1c2 WHIRLPOOL b163e843018f428f666f57dc930dda2d9349686f97fdf06b53d446004c58d256899aeff2d38f2a75619866a7713fabe5be88501c3408475e6870568872422558
+DIST libgtop-2.28.5.tar.xz 654828 SHA256 c812c174e44a8971a1f33265437cfd10f1e99869c7f5c05f8ee95846a70a3342 SHA512 9e7e645ea2a525edfd8e616cde7830b2175a6203113c27bcb81a6a853b16b2be14fa44b373a1c993b49a2f8ffb12dcf3a9f556f41b82b3d869e66f1650f75052 WHIRLPOOL 2435f04096b4daa10d20f1f3937ded1b64450a5065f55401b0f1d6e337421d04f18496f5e4b66586cbb51d9ad3e3e33d64c8004f9c411941876294ca06a98ad7
+DIST libgtop-2.30.0.tar.xz 664476 SHA256 463bcbe5737b1b93f3345ee34abf601e8eb864f507c49ff1921c2737abafc1e5 SHA512 1ea867671744143d7bf128cfc4120ba5dfa85b8491a056b2704c9c116f3f1bdb1065b81cae011f141cbca69f8fff8f1410b076dffbad3356ee2087c521db4a4d WHIRLPOOL 88c2c1cade666e642a06550c447a4467b1ddb9f72496190245fad74a678b436ea498f38243ccf4a42fee8ff14e04fd2404b7a7756c9a880a9a8cf992399eb648
+EBUILD libgtop-2.28.5-r99.ebuild 864 SHA256 608b526437d6155c85a8f3c8170379f9c71b2a170c33a08d46095ad58006a383 SHA512 93cd3c4e34dee85280bebb0a2a11514bac06801b02a2b2688f065f8c48dcf52ee815a0ea6e6592dba618850ec8af30804a667c07be4bd44300c976302b50d072 WHIRLPOOL 5312732140a408d586eba9a51f5f031fc3f116027467b20e0a40e206317cfda18a9f6f851c7af20c7c50c11f77bdcfee8691c5a271ab8ea668951186be64cbbb
+EBUILD libgtop-2.30.0-r99.ebuild 852 SHA256 3f2e51aa59d95ca0ad47c1b80f1621a1a5d59655f9534225f2d25dd6b3e8fc25 SHA512 63190dc4852e59e1a5e065be9f28b587203e85211b0099aaa55fbaac24e4f8866c034711242c45daaca5312bde6b026030446c9341031ffaa18161a10fb239e2 WHIRLPOOL ad08e3e613cee4836c68e064d97f2c9a75597510d5bc81cde447f22df4855af6a25b14907feb650e4b4278de9188c37ab9fd83bc48d6d318880ecc8588075783
+MISC metadata.xml 272 SHA256 d6cd612b3d4d224cec4189a81e42dc98ba6fd96ce241908b57491d78f99e6314 SHA512 f3e9cc433eb6e6475a4281ad4dbb021bd050e00e194e9dd1b7ea619ea55a7f09ea2f4952e1e192e38764aba9260a6b15f06082685def060aa9ac7ead67d97237 WHIRLPOOL ed5cb90610d66f50314f1269b41424aff0990c4ff733c10d2f1424492cd01e4f7de682f1677c15b3e70508fe72dca8d04fccac6282395f0adb27b0df99a307cc
diff --git a/gnome-base/libgtop/files/libgtop-musl.patch b/gnome-base/libgtop/files/libgtop-musl.patch
new file mode 100644
index 00000000..c8bb40f4
--- /dev/null
+++ b/gnome-base/libgtop/files/libgtop-musl.patch
@@ -0,0 +1,27 @@
+diff -Naur libgtop-2.28.5.orig/sysdeps/linux/netload.c libgtop-2.28.5/sysdeps/linux/netload.c
+--- libgtop-2.28.5.orig/sysdeps/linux/netload.c 2013-07-27 12:40:23.000000000 +0000
++++ libgtop-2.28.5/sysdeps/linux/netload.c 2014-06-18 12:05:40.024216274 +0000
+@@ -34,8 +34,6 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+
+-#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
+-/* GNU LibC */
+ #include <net/if.h>
+ #include <netinet/ip_icmp.h>
+ #include <netinet/in.h>
+@@ -43,14 +41,6 @@
+ #include <netinet/tcp.h>
+ #include <netinet/udp.h>
+ #include <net/if.h>
+-#else /* Libc 5 */
+-#include <linux/if.h>
+-#include <linux/in.h>
+-#include <linux/ip.h>
+-#include <linux/icmp.h>
+-#include <linux/tcp.h>
+-#include <linux/udp.h>
+-#endif
+
+
+ #ifdef HAVE_IFADDRS_H
diff --git a/gnome-base/libgtop/libgtop-2.28.5-r99.ebuild b/gnome-base/libgtop/libgtop-2.28.5-r99.ebuild
new file mode 100644
index 00000000..ec25292c
--- /dev/null
+++ b/gnome-base/libgtop/libgtop-2.28.5-r99.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/libgtop/libgtop-2.28.5.ebuild,v 1.10 2014/05/17 15:31:27 ago Exp $
+
+EAPI="5"
+GCONF_DEBUG="yes"
+
+inherit gnome2 eutils
+
+DESCRIPTION="A library that provides top functionality to applications"
+HOMEPAGE="http://developer.gnome.org/libgtop/stable/"
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="debug +introspection"
+
+RDEPEND=">=dev-libs/glib-2.6:2"
+DEPEND="${RDEPEND}
+ >=dev-util/gtk-doc-am-1.4
+ >=dev-util/intltool-0.35
+ virtual/pkgconfig
+ introspection? ( >=dev-libs/gobject-introspection-0.6.7 )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-musl.patch
+}
+
+src_configure() {
+ DOCS="AUTHORS ChangeLog NEWS README"
+ gnome2_src_configure \
+ --disable-static \
+ $(use_enable introspection)
+}
diff --git a/gnome-base/libgtop/libgtop-2.30.0-r99.ebuild b/gnome-base/libgtop/libgtop-2.30.0-r99.ebuild
new file mode 100644
index 00000000..b09a6654
--- /dev/null
+++ b/gnome-base/libgtop/libgtop-2.30.0-r99.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-base/libgtop/libgtop-2.30.0.ebuild,v 1.1 2014/05/31 10:19:20 pacho Exp $
+
+EAPI="5"
+GCONF_DEBUG="yes"
+
+inherit gnome2
+
+DESCRIPTION="A library that provides top functionality to applications"
+HOMEPAGE="http://developer.gnome.org/libgtop/stable/"
+
+LICENSE="GPL-2"
+SLOT="2/10" # libgtop soname version
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="debug +introspection"
+
+RDEPEND=">=dev-libs/glib-2.6:2"
+DEPEND="${RDEPEND}
+ >=dev-util/gtk-doc-am-1.4
+ >=dev-util/intltool-0.35
+ virtual/pkgconfig
+ introspection? ( >=dev-libs/gobject-introspection-0.6.7 )
+"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-musl.patch
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --disable-static \
+ $(use_enable introspection)
+}
diff --git a/gnome-base/libgtop/metadata.xml b/gnome-base/libgtop/metadata.xml
new file mode 100644
index 00000000..3147d749
--- /dev/null
+++ b/gnome-base/libgtop/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="introspection">Use <pkg>dev-libs/gobject-introspection</pkg> for
+ introspection</flag>
+</use>
+</pkgmetadata>
diff --git a/mail-client/mailx-support/Manifest b/mail-client/mailx-support/Manifest
new file mode 100644
index 00000000..b4b8f8d3
--- /dev/null
+++ b/mail-client/mailx-support/Manifest
@@ -0,0 +1,6 @@
+AUX mailx-support-20030215-gentoo.patch 1793 SHA256 3b9384318875c1f42b5435e40e4d822ec77ff799045ca776705afdb7c5c063cf SHA512 c45420ddf6719c1176f4fc006d7ac2060ff93283d1120baeed463e764ae08d82a2bf255822691858b516d44b9dc5eca9a141c0e3075061a7ed9e17104f775fa8 WHIRLPOOL ff4b41023daa06ebca808defc6228582c3fb0cabf0cfddaa91703e5b7738f13394b53440626324394096e50583fe11547d6f145bf89cd6f7915a8bde63400162
+AUX mailx-support-20060102-add-sys_file_h.patch 397 SHA256 2a9ffe62b22f86417c43ac66cd45f56790079f08c12e62b28328f179f05ff179 SHA512 d2906ca15610090ab93d0f839a0687b67556dccc0cd8dcfe1c5ae52d23c45e74d008376d57d84eaa4272a56f209628819a60108eebaf645cc1c3106ae5a954d6 WHIRLPOOL 03a6e51a09797ec714a4102ab3dd016043968b4f5abfa5c3948b6682bf8747e02625222731952064cfb1c4924d6528e5c9f55224d35c1b4f521dc5a69283fe8b
+AUX mailx-support-20060102-respect-ldflags.patch 537 SHA256 2c7b5c8d4031d836b0ffd38814ec4643cf2c7d330c4142c4fd9ce041b2711eb2 SHA512 cec6b2cf6a3f8b85ebdfcd3bdbbeac9ded468b7f34053ef6473aefd413292d9d7dc350782488481a3ae2db273ad9a7005193acc0e601c5556a2fdd49640dfe1f WHIRLPOOL db8794216190984dedf6eda06e20e321c02a472e5e897bb275c7b9a309ece8248fd285ee92cfcf9351bccfa3aa9fbc35196d221f0ab4bb2a87bb9231827760b0
+DIST mailx-support-20060102.tar.bz2 8822 SHA256 e962d12116a99ab72cc04304cc0f9b86dce2ab84c5028599e052c21930fc4d62 SHA512 a4bd84253fcb5a97119e75290dfda01004115c3eb5898bb792c75f7b01c7e48fa1189b9ec4ed195c404196893af8b9390062f2f258da68889b464b53aa0ecbc2 WHIRLPOOL b009fc0405a9610c9ac8cd66024dc237dbc5910f9a7e9b13440a167be8a1bc751d9ce2e318008ca83d6ad5c6d8cd32a1433bb1647ab1f271da5ffe334318331a
+EBUILD mailx-support-20060102-r99.ebuild 929 SHA256 323a8c60af2d31d1bfa5ba2101e4497f463e72a690d15ebd23272a7210f15f8e SHA512 2e36eddcc8ec952efc313571348e91e72c1e65d1ea0feb21488ed918261640a09d5943212f3ca56fd9f3a44ba164ebf2a7afe9ef36a4b4909c64226e69b176df WHIRLPOOL ca8506fe9e1569da73c8dc45f4dda3a9fde94ed5cc8f85c93d774bc3fe8166b1d70ac9d3be47fff63c643a5b0931cc4596af23bc568fdada0e770fee5ede9e67
+MISC metadata.xml 161 SHA256 4ebf9a8f60040bfb95f13790c1d146a49c69f791f9c421e02a5d96fd6fcb2b32 SHA512 77001eed8032a3b919c30d8dd9314951d3471528e770ef5ad840060e217037f5e1f0eb2cf4c5f90cb2d58e9598c8a38619a1301f890d6dd734900ab6273fb6ec WHIRLPOOL 0d251627fdbf63b5c090313d5bbf3e45acf630331742dc930a0136cc382b7720fe4099c64fd439fd31fe0eed48a4199d6e31692dbdedd34f803f9e2567d46975
diff --git a/mail-client/mailx-support/files/mailx-support-20030215-gentoo.patch b/mail-client/mailx-support/files/mailx-support-20030215-gentoo.patch
new file mode 100644
index 00000000..829b8582
--- /dev/null
+++ b/mail-client/mailx-support/files/mailx-support-20030215-gentoo.patch
@@ -0,0 +1,66 @@
+--- - 2003-02-15 23:35:46.000000000 +0800
++++ locking.c 2003-02-15 23:19:11.000000000 +0800
+@@ -45,6 +45,7 @@
+ #include <stdarg.h>
+ #include "pathnames.h"
+ #include "mail.local.h"
++#include "open_with_exlock.h"
+
+ static char lpath[MAXPATHLEN];
+
+@@ -93,7 +94,7 @@
+ }
+ goto again;
+ }
+- if ((lfd = open(lpath, O_CREAT|O_WRONLY|O_EXCL|O_EXLOCK,
++ if ((lfd = open_with_exlock(lpath, O_CREAT|O_WRONLY|O_EXCL,
+ S_IRUSR|S_IWUSR)) != -1)
+ break;
+ again:
+@@ -104,7 +105,7 @@
+ return(-1);
+ }
+ if (tries > 9 &&
+- (lfd = open(lpath, O_WRONLY|O_EXLOCK, 0)) != -1) {
++ (lfd = open_with_exlock(lpath, O_WRONLY, 0)) != -1) {
+ if (fstat(lfd, &fsb) != -1 &&
+ lstat(lpath, &sb) != -1) {
+ if (fsb.st_dev == sb.st_dev &&
+@@ -169,3 +170,4 @@
+ if (isfatal)
+ exit(1);
+ }
++
+--- - 2003-02-15 23:37:13.000000000 +0800
++++ mail.local.c 2003-02-15 23:20:50.000000000 +0800
+@@ -66,6 +66,7 @@
+ #include <string.h>
+ #include "pathnames.h"
+ #include "mail.local.h"
++#include "open_with_exlock.h"
+
+ int
+ main(int argc, char *argv[])
+@@ -218,7 +219,7 @@
+ merr(NOTFATAL, "%s: %s", path, strerror(errno));
+ goto bad;
+ }
+- if ((mbfd = open(path, O_APPEND|O_CREAT|O_EXCL|O_WRONLY|O_EXLOCK,
++ if ((mbfd = open_with_exlock(path, O_APPEND|O_CREAT|O_EXCL|O_WRONLY,
+ S_IRUSR|S_IWUSR)) < 0) {
+ if (errno == EEXIST) {
+ /* file appeared since lstat */
+@@ -244,7 +245,7 @@
+ merr(NOTFATAL, "%s: linked or special file", path);
+ goto bad;
+ }
+- if ((mbfd = open(path, O_APPEND|O_WRONLY|O_EXLOCK,
++ if ((mbfd = open_with_exlock(path, O_APPEND|O_WRONLY,
+ S_IRUSR|S_IWUSR)) < 0) {
+ merr(NOTFATAL, "%s: %s", path, strerror(errno));
+ goto bad;
+@@ -340,3 +341,4 @@
+ {
+ merr(FATAL, "usage: mail.local [-lL] [-f from] user ...");
+ }
++
diff --git a/mail-client/mailx-support/files/mailx-support-20060102-add-sys_file_h.patch b/mail-client/mailx-support/files/mailx-support-20060102-add-sys_file_h.patch
new file mode 100644
index 00000000..b3b871b4
--- /dev/null
+++ b/mail-client/mailx-support/files/mailx-support-20060102-add-sys_file_h.patch
@@ -0,0 +1,9 @@
+diff -Naur mailx-support-20060102.orig/open_with_exlock.c mailx-support-20060102/open_with_exlock.c
+--- mailx-support-20060102.orig/open_with_exlock.c 2003-06-09 19:01:08.000000000 +0000
++++ mailx-support-20060102/open_with_exlock.c 2014-04-01 12:17:31.830213927 +0000
+@@ -1,4 +1,5 @@
+ #include <fcntl.h>
++#include <sys/file.h>
+
+ int open_with_exlock(const char *path, int flags, mode_t mode)
+ {
diff --git a/mail-client/mailx-support/files/mailx-support-20060102-respect-ldflags.patch b/mail-client/mailx-support/files/mailx-support-20060102-respect-ldflags.patch
new file mode 100644
index 00000000..42aa5694
--- /dev/null
+++ b/mail-client/mailx-support/files/mailx-support-20060102-respect-ldflags.patch
@@ -0,0 +1,18 @@
+Index: mailx-support-20060102/Makefile
+===================================================================
+--- mailx-support-20060102.orig/Makefile
++++ mailx-support-20060102/Makefile
+@@ -17,10 +17,10 @@ clean:
+ ${RM} -f ${PRODUCTS} *.o
+
+ mail.local: mail.local.o locking.o open_with_exlock.o
+- ${CC} ${CFLAGS} -o $@ $^
++ ${CC} ${LDFLAGS} ${CFLAGS} -o $@ $^
+
+ lockspool: lockspool.o locking.o open_with_exlock.o
+- ${CC} ${CFLAGS} -o $@ $^
++ ${CC} ${LDFLAGS} ${BINDNOW_FLAGS} ${CFLAGS} -o $@ $^
+
+ .c.o:
+ ${CC} ${CFLAGS} -c -o $@ $^
+
diff --git a/mail-client/mailx-support/mailx-support-20060102-r99.ebuild b/mail-client/mailx-support/mailx-support-20060102-r99.ebuild
new file mode 100644
index 00000000..60eb5a3c
--- /dev/null
+++ b/mail-client/mailx-support/mailx-support-20060102-r99.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-client/mailx-support/mailx-support-20060102-r1.ebuild,v 1.17 2013/02/17 20:46:43 zmedico Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Provides lockspool utility"
+HOMEPAGE="http://www.openbsd.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-respect-ldflags.patch
+ epatch "${FILESDIR}"/${P}-add-sys_file_h.patch
+
+ # This code should only be ran with Gentoo Prefix profiles
+ if use prefix; then
+ ebegin "Allowing unprivileged install"
+ sed -i -e "s|-g 0 -o 0||g" Makefile
+ eend $?
+ fi
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" BINDNOW_FLAGS="" || die "emake failed"
+}
+
+src_install() {
+ einstall || die "einstall failed"
+}
diff --git a/mail-client/mailx-support/metadata.xml b/mail-client/mailx-support/metadata.xml
new file mode 100644
index 00000000..51f94e3f
--- /dev/null
+++ b/mail-client/mailx-support/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>net-mail</herd>
+</pkgmetadata>
diff --git a/mail-mta/exim/Manifest b/mail-mta/exim/Manifest
new file mode 100644
index 00000000..2a37072d
--- /dev/null
+++ b/mail-mta/exim/Manifest
@@ -0,0 +1,27 @@
+AUX auth_conf.sub 790 SHA256 d0631d487f115c07a178d48bc7168cd16d7b22c8879b1e926923152cde95ba78 SHA512 c0799a44e0fabdd4eb33c9c4a009c7abed80d5b2ab773206b11d644e54bb79004c5741fc510df77fe9856bdff979a14f1cf9a58da19fb00aaae05c623da287b3 WHIRLPOOL 54a457732851ec3154b38e161728f932e52166e0a3debe3f4672208207eb3070056a473bd6b73977ecda2d8d6c7348cbaf4870ee3d4b3250e64f2da5f58c5153
+AUX exim-4.14-tail.patch 446 SHA256 74d1044bb94e167180fd8f8aba7449ca3d2b09b1ce170a1a2e4e54ca0cd660da SHA512 a0365b15f0a48076f9660ebc424d48f68995ac21bbf77f407bdca5103ca65758d7f2241d0151eb5c78476557e240b24a95c23d3b12cfffc1b34ab6f89f2c2110 WHIRLPOOL c6e7e1d183c7669a745b33643c61b672a2c2800a0f1eeff380afa5cafe6d97a91106a4f08273ed154a87cfc7ee807cef8308422b53092083fcc12030403786a5
+AUX exim-4.20-maildir.patch 478 SHA256 2704c4db67bb7c58c2421656d942f533d1eedf1df187e76297ab72d2c2a2fb4c SHA512 2c6f68e3c162a51e62ce6e391db8e79733f11bba20cc8778737650158203b88f9a77b7bbbd2a32b2cf8ae50f039b794fb0996f198acec6a50b94cad6a111f432 WHIRLPOOL 4cf3638b7c7b05badeebbb65151f5d8e847fe2324ca5f88bcca87b8bf7e01ae290a9deccb26dec6abec89f105d00625efe99874e9ea2edf4a557b3d831c3b9f0
+AUX exim-4.69-r1.27021.patch 1447 SHA256 dc81115be1324cf2d61ff2e2393462bd31aa63551a8b58d9dac39293bec058d5 SHA512 45a5b833c698da4690485716c7c45d762a9194d5ae41514028bbad548bbd44373cf7a3a3c6a1c4f635f3f50d1695ac7ead098bf8be15cd1f691c7cc6c7f8d715 WHIRLPOOL ddf5a97d6d2c7220ebbca8ae5377a2c177c75bbed82a2e356f71582839021fe32eb6001d099fa4fb9c4afd55e7a74249d54997cdf691eb6b6aa44a8f834b1d64
+AUX exim-4.74-localscan_dlopen.patch 9280 SHA256 dcd44f552e9b9b79facc988c9efad3ab1609a4e4209e9276323f49d1ea00e462 SHA512 bfd35b8fcc7b8bd50a28b2bb7865d358ed1af3978b057da1c83a0be38ba30a737d983b6b5cf829559ba8c490709d28bdb7d679eb825fe7e24798ec223bedc94e WHIRLPOOL 7140c45782d8611638f3aecc960f890963b1d34fd1cca7a5b78058a616607d10c1a50d4110498e9c3d700ca04df8797c184ce816bfd1cab8931bd4eb9ef3aa8a
+AUX exim-4.74-radius-db-ENV-clash.patch 667 SHA256 a4150c9b73203dd284faa646a67e39f431d07c6a378af8fabc97a4ad9e078437 SHA512 040bbdb2259df882569a428b7fef03f89c3685428654ac29e93360a4791bdabe66e52d33d14f0822461fac119295bd31aad5998f63d59d4af057bd26b310a568 WHIRLPOOL 3ef9641fc821be5d7477ccc41f8656f987a896e883a7aa3a627b92e64e2663a87f345bd0fc46ae1b4b9f6ac09a560c951c0396dd135305c97821374d8aa08806
+AUX exim-4.76-crosscompile.patch 462 SHA256 25ba013858b0fc239e24166554c1e28832d3d25801b53ca633f289bc4ae72b8e SHA512 d4fd4417c1ce727f139999c399795312cdbbb9735d0793d68f8e3150240bc53b31277cb26f9946ba549b34c661fc0a61147d376bda09aa6763cab55d80d62343 WHIRLPOOL 22026d355888efb2f823842c596fb670f0821076fe6faaae9d0a6ecf57a4a6de52af9f720e784e8d7bbcf681494a020f22e75f4a2aa079d30880f5c9af759405
+AUX exim-4.76-dsn.patch 822 SHA256 2b36099285ff271f1c6db189435ebe3c2d3f3e8407ac11a041c7ea21b1997463 SHA512 b25324ca0bb9d5d9fd6b4604c5fb4f601ed793d409f75c008e7638a2d8ac5435bccc300b95999fe34ff167275c7a19a0af7ebc8eb15627243b3cbcddb3fa4f04 WHIRLPOOL d49305b97a43686436c12453366a71bd6730e4593566d340f73a02f08db94ff6b9b8c473993e5ec5ec699425aee5f50f4ba90bc14168f9e8876a0b4a91ee0ddd
+AUX exim-4.77-as-needed-ldflags.patch 5954 SHA256 3960f6883f7c3b44110ca5916ad8fa63f829516624c011a807cda00972b4dffd SHA512 716cac89116b66df645a6d49c88369ed062e3d3cf158fb50420984fe1fd2c1d3f56ad3a59ba36bb5d88dc9f8194f5fa105340baa82120b63298a245c6aaaaca2 WHIRLPOOL 8e321d3abf5a2d55af93d7cc865a33b1b8f13ba19af8ce6b17c29ba7b4003b4cc7acb4789ab941e8dc0b475d8568c0934e8da2c429dec9099901e85b966830d0
+AUX exim-4.77-makefile-freebsd.patch 1124 SHA256 50108e7f26ca2acb594d3d9a57c25ad041f32ada729b604da7378e9376b3ac7c SHA512 99dd86a5aedb6505356e3c5614b065a68d4bbae69502cd5c0a780038c231fb1047e21a2f0b8757a65d6b1a6dcdf8a7f7416a299edc1c85adeec4e362b992f321 WHIRLPOOL 33a4d49572cb3beafe2680b742fe68ceb6d7098be4244677c3ae2ea23dfed8af1be4ef91f0247e5d69adec5679dd02cb3dc71233ba4cb3418f93c70e717727fa
+AUX exim-4.80-spool-mail-group.patch 946 SHA256 4f013e30f6f96360baa7d5d7818eaf5247984ab0eb43b8b5ba8d1bd8704b811b SHA512 24f30e9a9d90dc0f1fe8b3db26f8bc2649182b4e78110dc28a9c0f3a3feb7589f923144a4f1c54a1c46ff8cfe40826a1f2212787753be752f4d15a72d54a143b WHIRLPOOL aa34f4e721fda796ebeb091514ec35ffcf153e813b7760245d25da5d6f27590734d28032498a0ffb2262e170355b0a99b53947818e669d1f79bd0393ae85a2d6
+AUX exim-4.82-makefile-freebsd.patch 1252 SHA256 c407ea37ff8125f20f535ddb02793d5242a12582b9ab388d2ba956f932af2f3d SHA512 fb440ad3e46b90d4c2e4826841944f4006390ccebee08154a39e46f6854be15edd7d0b028333b41451a0511f886ad3a30cb4b86e7ba8be99f12616a137f09d56 WHIRLPOOL 72132bdce44ba23fb162a5afaed33ea72ef2c917d020f5ddf920ce16991f02411c0bbcb23526b0e09753ab84cf2f258108aa2283ce5f9529810844497df29501
+AUX exim-submission.socket 161 SHA256 d3bb58f0fbeaaa33c812a823708664bbcd828da7d24e2a098f84a15aee443fee SHA512 4a233761793e3510e9efa5aad3a6098c41b757f13133a7ea825680f2b393aba8d7935f16bf1dd065dde884fe7ba45639a8d398333a7d9bf0a6b72f88c8f2a09d WHIRLPOOL 7fe2a157ae3361440d8a85c8eca44a97a289be1689261efda943076c9a76ab74ef9d5f01ec0eecdde940ae30ccb46530c95d7223cf62b78e8eb2bde5268288e2
+AUX exim-submission_at.service 360 SHA256 55719e8b823702b0054584326ca28349b7487e5be9e567ddc7a6e6259767e05b SHA512 dc28698f15e8eaa4614ae81fc8cb76d92fed1110ce02f7a6ee8feace418dbb194711eb2d4dd444cf818628c11721e21d80b7b974879ab6ddd78cc717cce17c2f WHIRLPOOL 8e907250dc6be75a252b0a6880004b05fccb2ebeb044a4538bc88eae6ed81f5a537a319188320657d43b3ae1850e11cfa0d86393b038d2d0d1e9a0ce7a7543fc
+AUX exim.confd 141 SHA256 352c48d5302d122d75b821395933150e1fc6e16004b0d28e99a14b60f160ee6e SHA512 cb5e4aa71d3f0b7945e9806064f6a3ab64cb894381654ead40c73a49ae2d1bbb3dc587919952a09b2c81b9fcf8784f73d59c12081cda96a5b7210442f5088998 WHIRLPOOL 078764d27c5c7614120ac0f531b97ac4b65a68ee741fe11fd3ae68e8e89307cc3aaab6d7ee651ec5969479cf9f752933c54faef1e068efa3fda85360343f4d39
+AUX exim.logrotate 116 SHA256 755eab8631ebc103fff111b0c37ff104a34f8fdff349d383d62cd91db3bc0984 SHA512 24bb8dcfadb1204c2ab0316d57de287b5092754731949390cfb3c88fa6827d45acfe1048cf9e26f615ca0449e8d780d0c98ea55ed61be9d1558755d3e53b9ec8 WHIRLPOOL 7c3092e99e20a038fe21f10ada71bae39faa31de6d032b0bd02a373a92b34f3972ab68642cca072364b28d3c0cbe3f35787f137681b8d8093105fb56abd9c7ed
+AUX exim.rc8 755 SHA256 8ebeb8d406690918c6d4e9b87fd2fd44053055130091671e49ce7d77608e0390 SHA512 4fe4d04cc330a7445cb0f00c163148bda51b9ae6d7fece640efab1a3dec60ae4eb8ea2dbc24502a27c48e8bc03f8892d1cb6c78316d8e9262897e21e67bdc02e WHIRLPOOL e9d00cad884804f8d6b1ecd5adcc8df8be92fb305b37eaeb39194dc2d41a2ea3785d27cb34df31e29847b734318ef5ee9b42c9474203629262f32c9dc78b56e1
+AUX exim.rc9 1236 SHA256 e541e950313a4057e3cd13cabac26db924485c54607410e0dcb3a2c348bf2fab SHA512 2032f27ecb23dc9dcc7154d959dd60f9e24316415a78a993ce1ed7511753a99f12774c649698aec1a92bd641c3254c6b81a9a42f2a424dd43ff10813e1aad2f5 WHIRLPOOL ebbdda159ddd609a3524dfc2b79d482fc30a0b11dbaed11c4687fd781ed8231982cb61e2dfc5bc830f8ef281f0d02db84f18535660034ef8e0dbdc5ee960a578
+AUX exim.service 229 SHA256 6e5372338d93b75d96bf571d892b167ac812378bcf978dcd3f3324d7e612463a SHA512 a071e9fb74b5fc2fdf0c73ad64ddfbc3954d8f7095d6a363dacf8c75d72a479fbf6821822ec5c8f3846d7687342e1bd447b97f91ca7b0582e5c98008aac30cca WHIRLPOOL 5f2ccd6898c95599f8e801aa111c53dbb50b7ec9f6ba6552fe195ad07d41efdcbff765cba1d696df6acb564bca29830d0bf61bcda9a244a3b48354318914bbd5
+AUX exim.socket 139 SHA256 3e3d8b6be2741d2587a496196c08b3f2ffa05b5803b2bf9fb49359cef3a98d26 SHA512 db621116907ceb573e6f34581f47c91f751bff593054d7ddc32397b34c7f2405bec184bdb0589d2ac457fa3a61bcba072761e3a6293a99c9c764d2d9fd6069ae WHIRLPOOL 6ddceaa1bf31d995afa2dc49ab4d8e1068321ab12b158e075f6ea3f2cc4dff35c2052da2a85fe998813354755e574670086880ef7e42e2a02877d4f766706d3c
+AUX exim_482_dsn_1_3.patch 41505 SHA256 4e00069a4b2e2deb414f05ea33f29b3f007d9ebff17cfc16998800b21b8e0ef5 SHA512 5f184d903300851dba46f4c3d46e70269111ff335fc71e9d14b04f40462c163411521f6fd60e1d703dfab3a173911225a209133369bb3c26d83455499261e777 WHIRLPOOL 842040f5009ad43b40ceff4935510b06a0f7496bfb7e7a13db8f3eeb6fec63d7c7b38e4ed31b2d8de543ddaf7e8af8becef334c88d1365910e783c8c0ad5a7ff
+AUX exim_at.service 140 SHA256 faad96dadbb2750faa5652d830f10d5a14be487a42e8db1cec797164acf14b73 SHA512 11c8133ee15b3e5193c9b1c59aed66c81b6e045dd23310bede9fcde6c88905db5ef08afdb798b53b75a7465915ea1247e980edf95db07a7f9b7bb58ce95fbb5a WHIRLPOOL 78f0c825526ae890458c4e71df2bd724d77d508081c6d6c2e3493732f11576ffeed755968dd2f3bcfb1cc6e0b0d61ea9fc175cd71340d908646f1a9ccbc7406e
+DIST exim-4.84.tar.bz2 1761790 SHA256 78ea22be87fb6df880e7fd482f3bec9ef6ceca0c9dedd50f8a26cae0b38b9e9c SHA512 3cd41af6d57e5f0377fc93367753eae6cb6bf835803e8608c44e1da5acefce1ed8886f4fe7536950de072bfed6e927afe1536c1e6466cf3121dd352b69a68039 WHIRLPOOL 9e840aa6afa0db68455b4ab458706eedd7ea57b084999c9e85eaaec0530ed93958731d934ff1d7830d9b5cd086e36cb56dc8a2f78dad85bdba9ae6573510e840
+DIST exim-html-4.84.tar.bz2 465281 SHA256 7ee7e9015b853915604b7806be93d56e9ba1fb915b63f0d6828c47f2228fd45b SHA512 7de8513476b6abcdfd36b0121a2a9d6decf1ccf94ef51b8363e544066cc05670e6f2b4d03d5fbc49071b1431183dfd9badde5cbcc65f51d55ec6b25ebcb070b9 WHIRLPOOL 88c376fd399e17b2bc06d2d0fad19f8c6485807118a81e0c200f6c39defe7155fa920489481a8b82e629951766ce0222b85956f387d22d22549303bd3dff7f82
+DIST system_filter.exim.gz 3075 SHA256 3a3471b486a09e0a0153f7b520e1eaf26d21b97d73ea8348bdc593c00eb1e437 SHA512 cb358d3ce2499a0bb5920d962a06f2af8486e55ec90c8c928bd8e3aefb279aa57f5f960d5adfcef68bd94110b405eaa144e9629cfe6014a529c79c544600bbf3 WHIRLPOOL ce68d9c18b24eca3ef97ea810964cc1ada5f85b795a7c432ad39b5788188a16419101c92fb52b418738d760e1d658f7a41485e5561079a667d84d276c71be5a4
+EBUILD exim-4.84-r99.ebuild 12405 SHA256 c62882bcabceff343d0384e3ddb34dbdce36af3594bbd00dd2f21cf985b97f51 SHA512 2198d439730ed2429ef113a7898bcf69d131a81bcc0e612bfc67f4b7f34ac09df561304f8c27bee1640c784f1718cd527e1cac236e2a401994421b4acc51af90 WHIRLPOOL 6eb6d0e1ba489623779c13bc43ba88e97b383b518eefd51319ec9ef8c61fbb15eddc8bdd2d1fa70ba4ef10265df41629c9c36ec6c6160ba6c484d4b5e12f707b
+MISC metadata.xml 2299 SHA256 a2985b24eb4e06b72f5c3a77403fd36e511112d789c584c391f344f547b21bcf SHA512 a7d4c9faf6240b5795e1da7df99f918bf438b1bf93fbe9ce12269b0f48000beb622dfad2489337f35b42c342605cd19359edf4e581794fc33f76a4cb0d035568 WHIRLPOOL 7eb7ade4038826e0947df620a65044acd2167b32126963c3f28336050680b05e4dca211588b722e7fb8273e13e171690a5ba0114182047e0690c43fdf244b71f
diff --git a/mail-mta/exim/exim-4.84-r99.ebuild b/mail-mta/exim/exim-4.84-r99.ebuild
new file mode 100644
index 00000000..e1604561
--- /dev/null
+++ b/mail-mta/exim/exim-4.84-r99.ebuild
@@ -0,0 +1,513 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/exim/exim-4.84.ebuild,v 1.17 2015/03/21 21:18:34 jlec Exp $
+
+EAPI="5"
+
+inherit eutils toolchain-funcs multilib pam systemd
+
+IUSE="dcc +dkim dlfunc dmarc +dnsdb doc dovecot-sasl dsn exiscan-acl gnutls ipv6 ldap lmtp maildir mbx mysql nis pam perl pkcs11 postgres +prdr proxy radius redis sasl selinux spf sqlite srs ssl syslog tcpd tpda X"
+REQUIRED_USE="spf? ( exiscan-acl ) srs? ( exiscan-acl ) dmarc? ( spf dkim ) pkcs11? ( gnutls )"
+
+COMM_URI="ftp://ftp.exim.org/pub/exim/exim4$([[ ${PV} == *_rc* ]] && echo /test)"
+
+DESCRIPTION="A highly configurable, drop-in replacement for sendmail"
+SRC_URI="${COMM_URI}/${P//rc/RC}.tar.bz2
+ mirror://gentoo/system_filter.exim.gz
+ doc? ( ${COMM_URI}/${PN}-html-${PV//rc/RC}.tar.bz2 )"
+HOMEPAGE="http://www.exim.org/"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="amd64 ppc ~mips x86"
+
+COMMON_DEPEND=">=sys-apps/sed-4.0.5
+ >=sys-libs/db-3.2
+ dev-libs/libpcre
+ perl? ( dev-lang/perl:= )
+ pam? ( virtual/pam )
+ tcpd? ( sys-apps/tcp-wrappers )
+ ssl? ( dev-libs/openssl )
+ gnutls? ( net-libs/gnutls[pkcs11?]
+ dev-libs/libtasn1 )
+ ldap? ( >=net-nds/openldap-2.0.7 )
+ mysql? ( virtual/mysql )
+ postgres? ( dev-db/postgresql )
+ sasl? ( >=dev-libs/cyrus-sasl-2.1.26-r2 )
+ redis? ( dev-libs/hiredis )
+ spf? ( >=mail-filter/libspf2-1.2.5-r1 )
+ dmarc? ( mail-filter/opendmarc )
+ srs? ( mail-filter/libsrs_alt )
+ X? ( x11-proto/xproto
+ x11-libs/libX11
+ x11-libs/libXmu
+ x11-libs/libXt
+ x11-libs/libXaw
+ )
+ sqlite? ( dev-db/sqlite )
+ radius? ( net-dialup/radiusclient )
+ virtual/libiconv
+ "
+ # added X check for #57206
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+ !mail-mta/courier
+ !mail-mta/esmtp
+ !mail-mta/mini-qmail
+ !<mail-mta/msmtp-1.4.19-r1
+ !>=mail-mta/msmtp-1.4.19-r1[mta]
+ !mail-mta/netqmail
+ !mail-mta/nullmailer
+ !mail-mta/postfix
+ !mail-mta/qmail-ldap
+ !mail-mta/sendmail
+ !mail-mta/opensmtpd
+ !<mail-mta/ssmtp-2.64-r2
+ !>=mail-mta/ssmtp-2.64-r2[mta]
+ !net-mail/mailwrapper
+ >=net-mail/mailbase-0.00-r5
+ virtual/logger
+ dcc? ( mail-filter/dcc )
+ selinux? ( sec-policy/selinux-exim )
+ "
+
+S=${WORKDIR}/${P//rc/RC}
+
+src_prepare() {
+ epatch "${FILESDIR}"/exim-4.14-tail.patch
+ epatch "${FILESDIR}"/exim-4.74-localscan_dlopen.patch
+ epatch "${FILESDIR}"/exim-4.69-r1.27021.patch
+ epatch "${FILESDIR}"/exim-4.74-radius-db-ENV-clash.patch # 287426
+ epatch "${FILESDIR}"/exim-4.82-makefile-freebsd.patch # 235785
+ epatch "${FILESDIR}"/exim-4.77-as-needed-ldflags.patch # 352265, 391279
+ epatch "${FILESDIR}"/exim-4.76-crosscompile.patch # 266591
+
+ if use maildir ; then
+ epatch "${FILESDIR}"/exim-4.20-maildir.patch
+ else
+ epatch "${FILESDIR}"/exim-4.80-spool-mail-group.patch # 438606
+ fi
+
+ # user Exim believes it should be
+ MAILUSER=mail
+ MAILGROUP=mail
+ if use prefix && [[ ${EUID} != 0 ]] ; then
+ MAILUSER=$(id -un)
+ MAILGROUP=$(id -gn)
+ fi
+}
+
+src_configure() {
+ # general config and paths
+
+ sed -i.orig \
+ -e "/SYSTEM_ALIASES_FILE/s'SYSTEM_ALIASES_FILE'${EPREFIX}/etc/mail/aliases'" \
+ "${S}"/src/configure.default || die
+
+ sed -i -e 's/^buildname=.*/buildname=exim-gentoo/g' Makefile || die
+
+ sed -e "48i\CFLAGS=${CFLAGS}" \
+ -e "s:BIN_DIRECTORY=/usr/exim/bin:BIN_DIRECTORY=${EPREFIX}/usr/sbin:" \
+ -e "s:EXIM_USER=:EXIM_USER=${MAILUSER}:" \
+ -e "s:CONFIGURE_FILE=/usr/exim/configure:CONFIGURE_FILE=${EPREFIX}/etc/exim/exim.conf:" \
+ -e "s:ZCAT_COMMAND=.*$:ZCAT_COMMAND=${EPREFIX}/bin/zcat:" \
+ -e "s:COMPRESS_COMMAND=.*$:COMPRESS_COMMAND=${EPREFIX}/bin/gzip:" \
+ src/EDITME > Local/Makefile
+
+ if use elibc_musl; then
+ sed -e 's/^LIBS = -lnsl/LIBS =/g' \
+ -e 's/^HAVE_ICONV=yes/#HAVE_ICONV=yes/' \
+ -i OS/Makefile-Linux
+ fi
+
+ cd Local
+
+ cat >> Makefile <<- EOC
+ INFO_DIRECTORY=${EPREFIX}/usr/share/info
+ PID_FILE_PATH=${EPREFIX}/run/exim.pid
+ SPOOL_DIRECTORY=${EPREFIX}/var/spool/exim
+ EOC
+
+ # if we use libiconv, now is the time to tell so
+ use !elibc_glibc && use !elibc_musl && echo "EXTRALIBS_EXIM=-liconv" >> Makefile
+
+ # support for IPv6
+ if use ipv6; then
+ cat >> Makefile <<- EOC
+ HAVE_IPV6=YES
+ EOC
+ fi
+
+ #
+ # mail storage formats
+
+ # mailstore is Exim's traditional storage format
+ cat >> Makefile <<- EOC
+ SUPPORT_MAILSTORE=yes
+ EOC
+
+ # mbox
+ if use mbx; then
+ cat >> Makefile <<- EOC
+ SUPPORT_MBX=yes
+ EOC
+ fi
+
+ # maildir
+ if use maildir; then
+ cat >> Makefile <<- EOC
+ SUPPORT_MAILDIR=yes
+ EOC
+ fi
+
+ #
+ # lookup methods
+
+ # use the "native" interfaces to the DBM and CDB libraries, support
+ # passwd and directory lookups by default
+ cat >> Makefile <<- EOC
+ USE_DB=yes
+ DBMLIB=-ldb
+ LOOKUP_CDB=yes
+ LOOKUP_PASSWD=yes
+ LOOKUP_DSEARCH=yes
+ EOC
+
+ if ! use dnsdb; then
+ # DNSDB lookup is enabled by default
+ sed -i "s:^LOOKUP_DNSDB=yes:# LOOKUP_DNSDB=yes:" Makefile
+ fi
+
+ if use ldap; then
+ cat >> Makefile <<- EOC
+ LOOKUP_LDAP=yes
+ LDAP_LIB_TYPE=OPENLDAP2
+ LOOKUP_INCLUDE += -I"${EROOT}"usr/include/ldap
+ LOOKUP_LIBS += -lldap -llber
+ EOC
+ fi
+
+ if use mysql; then
+ cat >> Makefile <<- EOC
+ LOOKUP_MYSQL=yes
+ LOOKUP_INCLUDE += $(mysql_config --include)
+ LOOKUP_LIBS += $(mysql_config --libs)
+ EOC
+ fi
+
+ if use nis; then
+ cat >> Makefile <<- EOC
+ LOOKUP_NIS=yes
+ LOOKUP_NISPLUS=yes
+ EOC
+ fi
+
+ if use postgres; then
+ cat >> Makefile <<- EOC
+ LOOKUP_PGSQL=yes
+ LOOKUP_INCLUDE += -I$(pg_config --includedir)
+ LOOKUP_LIBS += -L$(pg_config --libdir) -lpq
+ EOC
+ fi
+
+ if use sqlite; then
+ cat >> Makefile <<- EOC
+ LOOKUP_SQLITE=yes
+ LOOKUP_SQLITE_PC=sqlite3
+ EOC
+ fi
+
+ if use redis; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_REDIS=yes
+ LOOKUP_LIBS += -lhiredis
+ EOC
+ fi
+
+ #
+ # Exim monitor, enabled by default, controlled via X USE-flag,
+ # disable if not requested, bug #46778
+ if use X; then
+ cp ../exim_monitor/EDITME eximon.conf || die
+ else
+ sed -i -e '/^EXIM_MONITOR=/s/^/# /' Makefile
+ fi
+
+ #
+ # features
+
+ # content scanning support
+ if use exiscan-acl; then
+ cat >> Makefile <<- EOC
+ WITH_CONTENT_SCAN=yes
+ WITH_OLD_DEMIME=yes
+ EOC
+ fi
+
+ # DomainKeys Identified Mail, RFC4871
+ if ! use dkim; then
+ # DKIM is enabled by default
+ cat >> Makefile <<- EOC
+ DISABLE_DKIM=yes
+ EOC
+ fi
+
+ # Per-Recipient-Data-Response
+ if ! use prdr; then
+ # PRDR is enabled by default
+ cat >> Makefile <<- EOC
+ DISABLE_PRDR=yes
+ EOC
+ fi
+
+ # log to syslog
+ if use syslog; then
+ sed -i "s:LOG_FILE_PATH=/var/log/exim/exim_%s.log:LOG_FILE_PATH=syslog:" Makefile
+ cat >> Makefile <<- EOC
+ LOG_FILE_PATH=syslog
+ EOC
+ else
+ cat >> Makefile <<- EOC
+ LOG_FILE_PATH=${EPREFIX}/var/log/exim/exim_%s.log
+ EOC
+ fi
+
+ # starttls support (ssl)
+ if use ssl; then
+ echo "SUPPORT_TLS=yes" >> Makefile
+ if use gnutls; then
+ echo "USE_GNUTLS=yes" >> Makefile
+ echo "USE_GNUTLS_PC=gnutls" >> Makefile
+ use pkcs11 || echo "AVOID_GNUTLS_PKCS11=yes" >> Makefile
+ else
+ echo "USE_OPENSSL_PC=openssl" >> Makefile
+ fi
+ fi
+
+ # TCP wrappers
+ if use tcpd; then
+ cat >> Makefile <<- EOC
+ USE_TCP_WRAPPERS=yes
+ EXTRALIBS_EXIM += -lwrap
+ EOC
+ fi
+
+ # Light Mail Transport Protocol
+ if use lmtp; then
+ cat >> Makefile <<- EOC
+ TRANSPORT_LMTP=yes
+ EOC
+ fi
+
+ # embedded Perl
+ if use perl; then
+ cat >> Makefile <<- EOC
+ EXIM_PERL=perl.o
+ EOC
+ fi
+
+ # dlfunc
+ if use dlfunc; then
+ cat >> Makefile <<- EOC
+ EXPAND_DLFUNC=yes
+ EOC
+ fi
+
+ #
+ # experimental features
+
+ # Distributed Checksum Clearinghouse
+ if use dcc; then
+ echo "EXPERIMENTAL_DCC=yes">> Makefile
+ fi
+
+ # Sender Policy Framework
+ if use spf; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_SPF=yes
+ EXTRALIBS_EXIM += -lspf2
+ EOC
+ fi
+
+ # Sender Rewriting Scheme
+ if use srs; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_SRS=yes
+ EXTRALIBS_EXIM += -lsrs_alt
+ EOC
+ fi
+
+ # DMARC
+ if use dmarc; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DMARC=yes
+ EXTRALIBS_EXIM += -lopendmarc
+ EOC
+ fi
+
+ # Transport post-delivery actions
+ if use tpda; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_TPDA=yes
+ EOC
+ fi
+
+ # Proxy Protocol
+ if use proxy; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_PROXY=yes
+ EOC
+ fi
+
+ # Delivery Sender Notifications
+ if use dsn; then
+ cat >> Makefile <<- EOC
+ EXPERIMENTAL_DSN=yes
+ EOC
+ fi
+
+ #
+ # authentication (SMTP AUTH)
+
+ # standard bits
+ cat >> Makefile <<- EOC
+ AUTH_SPA=yes
+ AUTH_CRAM_MD5=yes
+ AUTH_PLAINTEXT=yes
+ EOC
+
+ # Cyrus SASL
+ if use sasl; then
+ cat >> Makefile <<- EOC
+ CYRUS_SASLAUTHD_SOCKET=${EPREFIX}/run/saslauthd/mux
+ AUTH_CYRUS_SASL=yes
+ AUTH_LIBS += -lsasl2
+ EOC
+ fi
+
+ # Dovecot
+ if use dovecot-sasl; then
+ cat >> Makefile <<- EOC
+ AUTH_DOVECOT=yes
+ EOC
+ fi
+
+ # Pluggable Authentication Modules
+ if use pam; then
+ cat >> Makefile <<- EOC
+ SUPPORT_PAM=yes
+ AUTH_LIBS += -lpam
+ EOC
+ fi
+
+ # Radius
+ if use radius; then
+ cat >> Makefile <<- EOC
+ RADIUS_CONFIG_FILE=${EPREFIX}/etc/radiusclient/radiusclient.conf
+ RADIUS_LIB_TYPE=RADIUSCLIENT
+ AUTH_LIBS += -lradiusclient
+ EOC
+ fi
+}
+
+src_compile() {
+ emake -j1 CC="$(tc-getCC)" HOSTCC="$(tc-getCC $CBUILD)" \
+ AR="$(tc-getAR) cq" RANLIB="$(tc-getRANLIB)" FULLECHO='' \
+ || die "make failed"
+}
+
+src_install () {
+ cd "${S}"/build-exim-gentoo || die
+ dosbin exim
+ if use X; then
+ dosbin eximon.bin
+ dosbin eximon
+ fi
+ fperms 4755 /usr/sbin/exim
+
+ dosym exim /usr/sbin/sendmail
+ dosym exim /usr/sbin/rsmtp
+ dosym exim /usr/sbin/rmail
+ dosym /usr/sbin/exim /usr/bin/mailq
+ dosym /usr/sbin/exim /usr/bin/newaliases
+ dosym /usr/sbin/sendmail /usr/lib/sendmail
+
+ for i in exicyclog exim_dbmbuild exim_dumpdb exim_fixdb exim_lock \
+ exim_tidydb exinext exiwhat exigrep eximstats exiqsumm exiqgrep \
+ convert4r3 convert4r4 exipick
+ do
+ dosbin $i
+ done
+
+ dodoc "${S}"/doc/*
+ doman "${S}"/doc/exim.8
+ use dsn && dodoc "${S}"/README.DSN
+ use doc && dohtml -r "${WORKDIR}"/${PN}-html-${PV//rc/RC}/doc/html/spec_html/*
+
+ # conf files
+ insinto /etc/exim
+ newins "${S}"/src/configure.default exim.conf.dist
+ if use exiscan-acl; then
+ newins "${S}"/src/configure.default exim.conf.exiscan-acl
+ fi
+ doins "${WORKDIR}"/system_filter.exim
+ doins "${FILESDIR}"/auth_conf.sub
+
+ pamd_mimic system-auth exim auth account
+
+ # headers, #436406
+ if use dlfunc ; then
+ # fixup includes so they actually can be found when including
+ sed -i \
+ -e '/#include "\(config\|store\|mytypes\).h"/s:"\(.\+\)":<exim/\1>:' \
+ local_scan.h || die
+ insinto /usr/include/exim
+ doins {config,local_scan}.h ../src/{mytypes,store}.h
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/exim.logrotate" exim
+
+ newinitd "${FILESDIR}"/exim.rc8 exim
+ newconfd "${FILESDIR}"/exim.confd exim
+
+ systemd_dounit "${FILESDIR}"/{exim.service,exim.socket,exim-submission.socket}
+ systemd_newunit "${FILESDIR}"/exim_at.service 'exim@.service'
+ systemd_newunit "${FILESDIR}"/exim-submission_at.service 'exim-submission@.service'
+
+ DIROPTIONS="-m 0750 -o ${MAILUSER} -g ${MAILGROUP}"
+ dodir /var/log/${PN}
+}
+
+pkg_postinst() {
+ if [[ ! -f ${EROOT}etc/exim/exim.conf ]] ; then
+ einfo "${EROOT}etc/exim/system_filter.exim is a sample system_filter."
+ einfo "${EROOT}etc/exim/auth_conf.sub contains the configuration sub for using smtp auth."
+ einfo "Please create ${EROOT}etc/exim/exim.conf from ${EROOT}etc/exim/exim.conf.dist."
+ fi
+ if use dcc ; then
+ einfo "DCC support is experimental, you can find some limited"
+ einfo "documentation at the bottom of this prerelease message:"
+ einfo "http://article.gmane.org/gmane.mail.exim.devel/3579"
+ fi
+ use spf && einfo "SPF support is experimental"
+ use srs && einfo "SRS support is experimental"
+ if use dmarc ; then
+ einfo "DMARC support is experimental. See global settings to"
+ einfo "configure DMARC, for usage see the documentation at "
+ einfo "experimental-spec.txt."
+ fi
+ use tpda && einfo "TPDA support is experimental"
+ use proxy && einfo "proxy support is experimental"
+ if use dsn ; then
+ einfo "Starting from Exim 4.83, DSN support comes from upstream."
+ einfo "DSN support is an experimental feature. If you used DSN"
+ einfo "support prior to 4.83, make sure to remove all dsn_process"
+ einfo "switches from your routers, see http://bugs.gentoo.org/511818"
+ fi
+ einfo "Exim maintains some db files under its spool directory that need"
+ einfo "cleaning from time to time. (${EROOT}var/spool/exim/db)"
+ einfo "Please use the exim_tidydb tool as documented in the Exim manual:"
+ einfo "http://www.exim.org/exim-html-current/doc/html/spec_html/ch-exim_utilities.html#SECThindatmai"
+}
diff --git a/mail-mta/exim/files/auth_conf.sub b/mail-mta/exim/files/auth_conf.sub
new file mode 100644
index 00000000..24434a71
--- /dev/null
+++ b/mail-mta/exim/files/auth_conf.sub
@@ -0,0 +1,25 @@
+######################################################################
+# AUTHENTICATION CONFIGURATION #
+######################################################################
+# If you're using PAM to authenticate, lifes real simple.
+# This plain directive works for nearly everything except windows MUA's the
+# login directive will allow you to authenticate your Outlook 2000 and
+# outlook express clients.
+
+
+
+plain:
+ driver = plaintext
+ public_name = PLAIN
+ server_condition = "${if pam{$2:$3}{1}{0}}"
+ server_set_id = $2
+
+login:
+ driver = plaintext
+ public_name = LOGIN
+ server_prompts = "Username:: : Password::"
+ server_condition = "${if pam{$1:${sg{$2}{:}{::}}}{1}{0}}"
+ server_set_id = $1
+#
+# FIXME
+# Need to add authenticator for SPA!!
diff --git a/mail-mta/exim/files/exim-4.14-tail.patch b/mail-mta/exim/files/exim-4.14-tail.patch
new file mode 100644
index 00000000..481dca9b
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.14-tail.patch
@@ -0,0 +1,11 @@
+--- scripts/Configure-config.h.orig 2003-07-17 18:01:19.000000000 -0400
++++ scripts/Configure-config.h 2003-07-17 18:01:25.000000000 -0400
+@@ -41,7 +41,7 @@
+
+ # Double-check that config.h is complete.
+
+-if [ "`tail -1 config.h`" != "/* End of config.h */" ] ; then
++if [ "`tail -n 1 config.h`" != "/* End of config.h */" ] ; then
+ echo "*** config.h appears to be incomplete"
+ echo "*** unexpected failure in buildconfig program"
+ exit 1
diff --git a/mail-mta/exim/files/exim-4.20-maildir.patch b/mail-mta/exim/files/exim-4.20-maildir.patch
new file mode 100644
index 00000000..3cb198d5
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.20-maildir.patch
@@ -0,0 +1,14 @@
+diff -urN ./exim-4.20.orig/src/configure.default exim-4.20/src/configure.default
+--- ./exim-4.20.orig/src/configure.default 2003-06-27 16:48:22.000000000 -0700
++++ exim-4.20/src/configure.default 2003-06-27 16:52:20.000000000 -0700
+@@ -451,7 +451,9 @@
+
+ local_delivery:
+ driver = appendfile
+- file = /var/mail/$local_part
++# file = /var/mail/$local_part
++ directory = /home/$local_part/.maildir
++ maildir_format
+ delivery_date_add
+ envelope_to_add
+ return_path_add
diff --git a/mail-mta/exim/files/exim-4.69-r1.27021.patch b/mail-mta/exim/files/exim-4.69-r1.27021.patch
new file mode 100644
index 00000000..804e16d6
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.69-r1.27021.patch
@@ -0,0 +1,48 @@
+diff -urN exim-4.69.orig/src/configure.default exim-4.69/src/configure.default
+--- exim-4.69.orig/src/configure.default 2008-05-05 10:17:44.000000000 +0100
++++ exim-4.69/src/configure.default 2008-05-05 10:18:26.000000000 +0100
+@@ -592,6 +592,22 @@
+ pipe_transport = address_pipe
+ reply_transport = address_reply
+
++# This router runs procmail if users have a .procmailrc file
++procmail:
++ check_local_user
++ driver = accept
++ transport = procmail_pipe
++ require_files = ${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail
++ no_verify
++
++# This router runs maildrop if users have a .mailfilter file
++maildrop:
++ check_local_user
++ driver = accept
++ transport = maildrop_pipe
++ require_files = ${local_part}:+${home}:+${home}/.mailfilter:+/usr/bin/maildrop
++ no_verify
++
+
+ # This router matches local user mailboxes. If the router fails, the error
+ # message is "Unknown user".
+@@ -676,6 +692,21 @@
+ address_reply:
+ driver = autoreply
+
++# This transport is used for procmail
++procmail_pipe:
++ driver = pipe
++ command = "/usr/bin/procmail -d ${local_part}"
++ return_path_add
++ delivery_date_add
++ envelope_to_add
++
++# This transport is used for courier-maildrop filtering (Maildir filter system)
++maildrop_pipe:
++ driver = pipe
++ command = "/usr/bin/maildrop -d ${local_part}"
++ return_path_add
++ delivery_date_add
++ envelope_to_add
+
+
+ ######################################################################
diff --git a/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch b/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch
new file mode 100644
index 00000000..3bb57c16
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch
@@ -0,0 +1,262 @@
+diff -Naur exim-4.32/src/EDITME exim-4.32-dlopen/src/EDITME
+--- src/EDITME 2004-04-15 08:27:01.000000000 +0000
++++ src/EDITME 2004-05-06 16:15:47.000000000 +0000
+@@ -505,6 +505,24 @@
+
+
+ #------------------------------------------------------------------------------
++# On systems which support dynamic loading of shared libraries, Exim can
++# load a local_scan function specified in its config file instead of having
++# to be recompiled with the desired local_scan function. For a full
++# description of the API to this function, see the Exim specification.
++
++DLOPEN_LOCAL_SCAN=yes
++
++# If you set DLOPEN_LOCAL_SCAN, then you need to include -rdynamic in the
++# linker flags. Without it, the loaded .so won't be able to access any
++# functions from exim.
++
++LFLAGS = -rdynamic
++ifeq ($(OSTYPE),Linux)
++LFLAGS += -ldl
++endif
++
++
++#------------------------------------------------------------------------------
+ # The default distribution of Exim contains only the plain text form of the
+ # documentation. Other forms are available separately. If you want to install
+ # the documentation in "info" format, first fetch the Texinfo documentation
+diff -Naur exim-4.32/src/config.h.defaults exim-4.32-dlopen/src/config.h.defaults
+--- src/config.h.defaults 2004-04-15 08:27:01.000000000 +0000
++++ src/config.h.defaults 2004-05-06 16:16:30.000000000 +0000
+@@ -20,6 +20,8 @@
+ #define AUTH_PLAINTEXT
+ #define AUTH_SPA
+
++#define DLOPEN_LOCAL_SCAN
++
+ #define BIN_DIRECTORY
+
+ #define CONFIGURE_FILE
+diff -Naur exim-4.32/src/globals.c exim-4.32-dlopen/src/globals.c
+--- src/globals.c 2004-04-15 08:27:01.000000000 +0000
++++ src/globals.c 2004-05-06 16:17:07.000000000 +0000
+@@ -109,6 +109,10 @@
+ uschar *tls_verify_hosts = NULL;
+ #endif
+
++#ifdef DLOPEN_LOCAL_SCAN
++uschar *local_scan_path = NULL;
++#endif
++
+
+ /* Input-reading functions for messages, so we can use special ones for
+ incoming TCP/IP. The defaults use stdin. We never need these for any
+diff -Naur exim-4.32/src/globals.h exim-4.32-dlopen/src/globals.h
+--- src/globals.h 2004-04-15 08:27:01.000000000 +0000
++++ src/globals.h 2004-05-06 16:17:50.000000000 +0000
+@@ -73,6 +73,9 @@
+ extern uschar *tls_verify_hosts; /* Mandatory client verification */
+ #endif
+
++#ifdef DLOPEN_LOCAL_SCAN
++extern uschar *local_scan_path; /* Path to local_scan() library */
++#endif
+
+ /* Input-reading functions for messages, so we can use special ones for
+ incoming TCP/IP. */
+diff -Naur exim-4.32/src/local_scan.c exim-4.32-dlopen/src/local_scan.c
+--- src/local_scan.c 2004-04-15 08:27:01.000000000 +0000
++++ src/local_scan.c 2004-05-06 16:21:57.000000000 +0000
+@@ -5,60 +5,131 @@
+ /* Copyright (c) University of Cambridge 1995 - 2004 */
+ /* See the file NOTICE for conditions of use and distribution. */
+
++#include "exim.h"
+
+-/******************************************************************************
+-This file contains a template local_scan() function that just returns ACCEPT.
+-If you want to implement your own version, you should copy this file to, say
+-Local/local_scan.c, and edit the copy. To use your version instead of the
+-default, you must set
+-
+-LOCAL_SCAN_SOURCE=Local/local_scan.c
+-
+-in your Local/Makefile. This makes it easy to copy your version for use with
+-subsequent Exim releases.
+-
+-For a full description of the API to this function, see the Exim specification.
+-******************************************************************************/
+-
+-
+-/* This is the only Exim header that you should include. The effect of
+-including any other Exim header is not defined, and may change from release to
+-release. Use only the documented interface! */
+-
+-#include "local_scan.h"
+-
+-
+-/* This is a "do-nothing" version of a local_scan() function. The arguments
+-are:
+-
+- fd The file descriptor of the open -D file, which contains the
+- body of the message. The file is open for reading and
+- writing, but modifying it is dangerous and not recommended.
+-
+- return_text A pointer to an unsigned char* variable which you can set in
+- order to return a text string. It is initialized to NULL.
+-
+-The return values of this function are:
+-
+- LOCAL_SCAN_ACCEPT
+- The message is to be accepted. The return_text argument is
+- saved in $local_scan_data.
+-
+- LOCAL_SCAN_REJECT
+- The message is to be rejected. The returned text is used
+- in the rejection message.
+-
+- LOCAL_SCAN_TEMPREJECT
+- This specifies a temporary rejection. The returned text
+- is used in the rejection message.
+-*/
++#ifdef DLOPEN_LOCAL_SCAN
++#include <dlfcn.h>
++static int (*local_scan_fn)(int fd, uschar **return_text) = NULL;
++static int load_local_scan_library(void);
++#endif
+
+ int
+ local_scan(int fd, uschar **return_text)
+ {
+ fd = fd; /* Keep picky compilers happy */
+ return_text = return_text;
+-return LOCAL_SCAN_ACCEPT;
++#ifdef DLOPEN_LOCAL_SCAN
++/* local_scan_path is defined AND not the empty string */
++if (local_scan_path && *local_scan_path)
++ {
++ if (!local_scan_fn)
++ {
++ if (!load_local_scan_library())
++ {
++ char *base_msg , *error_msg , *final_msg ;
++ int final_length = -1 ;
++
++ base_msg=US"Local configuration error - local_scan() library failure\n";
++ error_msg = dlerror() ;
++
++ final_length = strlen(base_msg) + strlen(error_msg) + 1 ;
++ final_msg = (char*)malloc( final_length*sizeof(char) ) ;
++ *final_msg = '\0' ;
++
++ strcat( final_msg , base_msg ) ;
++ strcat( final_msg , error_msg ) ;
++
++ *return_text = final_msg ;
++ return LOCAL_SCAN_TEMPREJECT;
++ }
++ }
++ return local_scan_fn(fd, return_text);
++ }
++else
++#endif
++ return LOCAL_SCAN_ACCEPT;
++}
++
++#ifdef DLOPEN_LOCAL_SCAN
++
++static int load_local_scan_library(void)
++{
++/* No point in keeping local_scan_lib since we'll never dlclose() anyway */
++void *local_scan_lib = NULL;
++int (*local_scan_version_fn)(void);
++int vers_maj;
++int vers_min;
++
++local_scan_lib = dlopen(local_scan_path, RTLD_NOW);
++if (!local_scan_lib)
++ {
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library open failed - "
++ "message temporarily rejected");
++ return FALSE;
++ }
++
++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_major");
++if (!local_scan_version_fn)
++ {
++ dlclose(local_scan_lib);
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain "
++ "local_scan_version_major() function - message temporarily rejected");
++ return FALSE;
++ }
++
++/* The major number is increased when the ABI is changed in a non
++ backward compatible way. */
++vers_maj = local_scan_version_fn();
++
++local_scan_version_fn = dlsym(local_scan_lib, "local_scan_version_minor");
++if (!local_scan_version_fn)
++ {
++ dlclose(local_scan_lib);
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain "
++ "local_scan_version_minor() function - message temporarily rejected");
++ return FALSE;
++ }
++
++/* The minor number is increased each time a new feature is added (in a
++ way that doesn't break backward compatibility) -- Marc */
++vers_min = local_scan_version_fn();
++
++
++if (vers_maj != LOCAL_SCAN_ABI_VERSION_MAJOR)
++ {
++ dlclose(local_scan_lib);
++ local_scan_lib = NULL;
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible major"
++ "version number, you need to recompile your module for this version"
++ "of exim (The module was compiled for version %d.%d and this exim provides"
++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR,
++ LOCAL_SCAN_ABI_VERSION_MINOR);
++ return FALSE;
++ }
++else if (vers_min > LOCAL_SCAN_ABI_VERSION_MINOR)
++ {
++ dlclose(local_scan_lib);
++ local_scan_lib = NULL;
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() has an incompatible minor"
++ "version number, you need to recompile your module for this version"
++ "of exim (The module was compiled for version %d.%d and this exim provides"
++ "ABI version %d.%d)", vers_maj, vers_min, LOCAL_SCAN_ABI_VERSION_MAJOR,
++ LOCAL_SCAN_ABI_VERSION_MINOR);
++ return FALSE;
++ }
++
++local_scan_fn = dlsym(local_scan_lib, "local_scan");
++if (!local_scan_fn)
++ {
++ dlclose(local_scan_lib);
++ log_write(0, LOG_MAIN|LOG_REJECT, "local_scan() library doesn't contain "
++ "local_scan() function - message temporarily rejected");
++ return FALSE;
++ }
++
++return TRUE;
+ }
+
++#endif /* DLOPEN_LOCAL_SCAN */
++
+ /* End of local_scan.c */
+diff -Naur exim-4.32/src/readconf.c exim-4.32-dlopen/src/readconf.c
+--- src/readconf.c 2004-04-15 08:27:01.000000000 +0000
++++ src/readconf.c 2004-05-06 16:23:12.000000000 +0000
+@@ -223,6 +223,9 @@
+ { "local_from_prefix", opt_stringptr, &local_from_prefix },
+ { "local_from_suffix", opt_stringptr, &local_from_suffix },
+ { "local_interfaces", opt_stringptr, &local_interfaces },
++#ifdef DLOPEN_LOCAL_SCAN
++ { "local_scan_path", opt_stringptr, &local_scan_path },
++#endif
+ { "local_scan_timeout", opt_time, &local_scan_timeout },
+ { "local_sender_retain", opt_bool, &local_sender_retain },
+ { "localhost_number", opt_stringptr, &host_number_string },
diff --git a/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch b/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch
new file mode 100644
index 00000000..247668ef
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.74-radius-db-ENV-clash.patch
@@ -0,0 +1,22 @@
+Nasty workaround for
+http://bugs.gentoo.org/show_bug.cgi?id=287426
+
+--- src/auths/call_radius.c
++++ src/auths/call_radius.c
+@@ -10,6 +10,16 @@
+ /* This file was originally supplied by Ian Kirk. The libradius support came
+ from Alex Kiernan. */
+
++/* ugly hack to work around redefinition of ENV by radiusclient.h and
++ * db.h: define _DB_H_ so the db.h include thinks it's already included,
++ * we can get away with it like this, since this file doesn't use any db
++ * functions. */
++#ifndef _DB_H_
++#define _DB_H_ 1
++#define _DB_EXT_PROT_IN_ 1
++#define DB void
++#endif
++
+ #include "../exim.h"
+
+ /* This module contains functions that call the Radius authentication
diff --git a/mail-mta/exim/files/exim-4.76-crosscompile.patch b/mail-mta/exim/files/exim-4.76-crosscompile.patch
new file mode 100644
index 00000000..cf47adee
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.76-crosscompile.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/show_bug.cgi?id=266591
+
+--- OS/Makefile-Base
++++ OS/Makefile-Base
+@@ -114,8 +114,8 @@
+
+ # Targets for special-purpose configuration header builders
+ buildconfig: buildconfig.c
+- @echo "$(CC) buildconfig.c"
+- $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
++ @echo "$(HOSTCC) buildconfig.c"
++ $(FE)$(HOSTCC) $(HOSTCFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
+
+
+ # Target for the exicyclog utility script
diff --git a/mail-mta/exim/files/exim-4.76-dsn.patch b/mail-mta/exim/files/exim-4.76-dsn.patch
new file mode 100644
index 00000000..8a608ba6
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.76-dsn.patch
@@ -0,0 +1,18 @@
+http://bugs.gentoo.org/show_bug.cgi?id=366835
+https://sourceforge.net/tracker/?func=detail&aid=3300653&group_id=121058&atid=689120
+
+--- exim_469_dsn_1_3.patch
++++ exim_469_dsn_1_3.patch
+@@ -524,10 +524,10 @@
+ diff -urN exim-4.69-orig/src/readconf.c exim-4.69-dsn/src/readconf.c
+ --- exim-4.69-orig/src/readconf.c 2007-08-23 12:01:49.000000000 +0100
+ +++ exim-4.69-dsn/src/readconf.c 2008-07-28 09:52:55.000000000 +0100
+-@@ -207,6 +207,9 @@
+- { "dns_ipv4_lookup", opt_stringptr, &dns_ipv4_lookup },
++@@ -219,6 +219,9 @@
+ { "dns_retrans", opt_time, &dns_retrans },
+ { "dns_retry", opt_int, &dns_retry },
++ { "dns_use_edns0", opt_int, &dns_use_edns0 },
+ +#ifdef SUPPORT_DSN
+ + { "dsn", opt_bool, &dsn },
+ +#endif
diff --git a/mail-mta/exim/files/exim-4.77-as-needed-ldflags.patch b/mail-mta/exim/files/exim-4.77-as-needed-ldflags.patch
new file mode 100644
index 00000000..4eac9aa3
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.77-as-needed-ldflags.patch
@@ -0,0 +1,144 @@
+https://bugs.gentoo.org/show_bug.cgi?id=352265
+
+Make sure LDFLAGS comes first, such that all libraries are considered,
+and not discarded when --as-needed is in effect.
+
+https://bugs.gentoo.org/show_bug.cgi?id=391279
+
+Use LDFLAGS for all targets, not just the exim binary, such that
+--as-needed works as well.
+
+
+--- OS/Makefile-Base
++++ OS/Makefile-Base
+@@ -327,12 +327,12 @@
+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
+ rm -f exim
+ @echo "$(LNCC) -o exim"
+- $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
++ $(FE)$(PURIFY) $(LNCC) -o exim $(LDFLAGS) $(OBJ_EXIM) version.o \
+ routers/routers.a transports/transports.a lookups/lookups.a \
+ auths/auths.a pdkim/pdkim.a \
+ $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
+ $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
+- $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
++ $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim; \
+ $(STRIP_COMMAND) exim; \
+@@ -340,8 +340,8 @@
+
+ exim_dumpdb: $(OBJ_DUMPDB)
+ @echo "$(LNCC) -o exim_dumpdb"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
+- $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LDFLAGS) $(OBJ_DUMPDB) \
++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_dumpdb; \
+ $(STRIP_COMMAND) exim_dumpdb; \
+@@ -355,8 +355,8 @@
+
+ exim_fixdb: $(OBJ_FIXDB) auths/auths.a
+ @echo "$(LNCC) -o exim_fixdb"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
+- auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LDFLAGS) $(OBJ_FIXDB) \
++ auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_fixdb; \
+ $(STRIP_COMMAND) exim_fixdb; \
+@@ -370,8 +370,8 @@
+
+ exim_tidydb: $(OBJ_TIDYDB)
+ @echo "$(LNCC) -o exim_tidydb"
+- $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
+- $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LDFLAGS) $(OBJ_TIDYDB) \
++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_tidydb; \
+ $(STRIP_COMMAND) exim_tidydb; \
+@@ -383,8 +383,8 @@
+
+ exim_dbmbuild: exim_dbmbuild.o
+ @echo "$(LNCC) -o exim_dbmbuild"
+- $(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
+- $(LIBS) $(EXTRALIBS) $(DBMLIB)
++ $(FE)$(LNCC) -o exim_dbmbuild $(LDFLAGS) exim_dbmbuild.o \
++ $(LIBS) $(EXTRALIBS) $(DBMLIB) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_dbmbuild; \
+ $(STRIP_COMMAND) exim_dbmbuild; \
+@@ -398,8 +398,8 @@
+ @echo "$(CC) exim_lock.c"
+ $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
+ @echo "$(LNCC) -o exim_lock"
+- $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
+- $(LIBS) $(EXTRALIBS)
++ $(FE)$(LNCC) -o exim_lock $(LDFLAGS) exim_lock.o \
++ $(LIBS) $(EXTRALIBS) $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) exim_lock; \
+ $(STRIP_COMMAND) exim_lock; \
+@@ -429,9 +429,9 @@
+ $(FE)$(CC) -o em_version.o -c \
+ $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
+ @echo "$(LNCC) -o eximon.bin"
+- $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
++ $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LDFLAGS) $(XLFLAGS) \
+ $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
+- $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
++ $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc $(LFLAGS)
+ @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
+ echo $(STRIP_COMMAND) eximon.bin; \
+ $(STRIP_COMMAND) eximon.bin; \
+@@ -706,9 +706,9 @@
+ test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
+ string.o tod.o version.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
+- $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
++ $(LNCC) -o test_dbfn $(LDFLAGS) dbfn.o \
+ dummies.o sa-globals.o sa-os.o store.o string.o \
+- tod.o version.o $(LIBS) $(DBMLIB)
++ tod.o version.o $(LIBS) $(DBMLIB) $(LFLAGS)
+ rm -f dbfn.o
+
+ test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
+@@ -717,28 +717,28 @@
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
+- $(LNCC) -o test_host $(LFLAGS) \
++ $(LNCC) -o test_host $(LDFLAGS) \
+ host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
+- tod.o tree.o $(LIBS) $(LIBRESOLV)
++ tod.o tree.o $(LIBS) $(LIBRESOLV) $(LFLAGS)
+ rm -f child.o dummies.o host.o dns.o
+
+ test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
+- $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
+- sa-globals.o store.o string.o tod.o $(LIBS)
++ $(LNCC) -o test_os $(LDFLAGS) os.o dummies.o \
++ sa-globals.o store.o string.o tod.o $(LIBS) $(LFLAGS)
+ rm -f os.o
+
+ test_parse: config.h parse.c dummies.o sa-globals.o \
+ store.o string.o tod.o version.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
+- $(LNCC) -o test_parse $(LFLAGS) parse.o \
+- dummies.o sa-globals.o store.o string.o tod.o version.o
++ $(LNCC) -o test_parse $(LDFLAGS) parse.o \
++ dummies.o sa-globals.o store.o string.o tod.o version.o $(LFLAGS)
+ rm -f parse.o
+
+ test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
+ $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
+- $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
+- dummies.o sa-globals.o store.o tod.o $(LIBS)
++ $(LNCC) -o test_string $(LDFLAGS) -DSTAND_ALONE string.o \
++ dummies.o sa-globals.o store.o tod.o $(LIBS) $(LFLAGS)
+ rm -f string.o
+
+ # End
diff --git a/mail-mta/exim/files/exim-4.77-makefile-freebsd.patch b/mail-mta/exim/files/exim-4.77-makefile-freebsd.patch
new file mode 100644
index 00000000..f3c03323
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.77-makefile-freebsd.patch
@@ -0,0 +1,48 @@
+--- OS/Makefile-FreeBSD
++++ OS/Makefile-FreeBSD
+@@ -1,12 +1,10 @@
+-# Exim: OS-specific make file for FreeBSD
+-# There's no setting of CFLAGS here, to allow the system default
+-# for "make" to be the default.
+-
+-PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
+-
+-CHOWN_COMMAND=/usr/sbin/chown
+-STRIP_COMMAND=/usr/bin/strip
+-CHMOD_COMMAND=/bin/chmod
++# Exim: OS-specific FreeBSD make file, modified for Gentoo Prefix
++
++
++BASENAME_COMMAND=look_for_it
++CHOWN_COMMAND=look_for_it
++CHGRP_COMMAND=look_for_it
++CHMOD_COMMAND=look_for_it
+
+ HAVE_SA_LEN=YES
+
+@@ -18,23 +16,12 @@
+ # Dynamicly loaded modules need to be built with -fPIC
+ CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
+
+-# FreeBSD always ships with Berkeley DB
++DBMLIB = -ldb
+ USE_DB=yes
+
+-# This code for building outside ports suggested by Richard Clayton
+-.ifdef X11BASE
+-X11=${X11BASE}
+-.elifdef LOCALBASE
+-X11=$(LOCALBASE)
+-.else
+-X11=/usr/local
+-.endif
+-
++X11=/usr/X11R6
+ XINCLUDE=-I$(X11)/include
+ XLFLAGS=-L$(X11)/lib
+-.if ${PORTOBJFORMAT} == "elf"
+-XLFLAGS+=-Wl,-rpath,${X11}/lib
+-.endif
+ X11_LD_LIB=$(X11)/lib
+
+ EXIWHAT_PS_ARG=-ax
diff --git a/mail-mta/exim/files/exim-4.80-spool-mail-group.patch b/mail-mta/exim/files/exim-4.80-spool-mail-group.patch
new file mode 100644
index 00000000..6f88d853
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.80-spool-mail-group.patch
@@ -0,0 +1,27 @@
+Change default such that we run on a stock Gentoo system. Bug #438606
+
+--- src/configure.default
++++ src/configure.default
+@@ -674,8 +674,9 @@
+ # BSD mailbox format. By default it will be run under the uid and gid of the
+ # local user, and requires the sticky bit to be set on the /var/mail directory.
+ # Some systems use the alternative approach of running mail deliveries under a
+-# particular group instead of using the sticky bit. The commented options below
+-# show how this can be done.
++# particular group instead of using the sticky bit. This is also the
++# default case on Gentoo, therefore group and mode are set below.
++# Comment them out, to get the default behaviour.
+
+ local_delivery:
+ driver = appendfile
+@@ -683,8 +684,8 @@
+ delivery_date_add
+ envelope_to_add
+ return_path_add
+-# group = mail
+-# mode = 0660
++ group = mail
++ mode = 0660
+
+
+ # This transport is used for handling pipe deliveries generated by alias or
diff --git a/mail-mta/exim/files/exim-4.82-makefile-freebsd.patch b/mail-mta/exim/files/exim-4.82-makefile-freebsd.patch
new file mode 100644
index 00000000..9693d494
--- /dev/null
+++ b/mail-mta/exim/files/exim-4.82-makefile-freebsd.patch
@@ -0,0 +1,45 @@
+--- OS/Makefile-FreeBSD.orig 2013-09-30 19:59:09.000000000 +0200
++++ OS/Makefile-FreeBSD 2013-09-30 20:01:22.000000000 +0200
+@@ -1,10 +1,8 @@
+-# Exim: OS-specific make file for FreeBSD
+-# There's no setting of CFLAGS here, to allow the system default
+-# for "make" to be the default.
+-
+-CHOWN_COMMAND=/usr/sbin/chown
+-STRIP_COMMAND=/usr/bin/strip
+-CHMOD_COMMAND=/bin/chmod
++# Exim: OS-specific FreeBSD make file, modified for Gentoo Prefix
++
++CHOWN_COMMAND=look_for_it
++STRIP_COMMAND=
++CHMOD_COMMAND=look_for_it
+
+ HAVE_SA_LEN=YES
+
+@@ -15,17 +13,9 @@
+ CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
+
+ # FreeBSD always ships with Berkeley DB
++DBMLIB = -ldb
+ USE_DB=yes
+
+-# This code for building outside ports suggested by Richard Clayton
+-.ifdef X11BASE
+-X11=${X11BASE}
+-.elifdef LOCALBASE
+-X11=$(LOCALBASE)
+-.else
+-X11=/usr/local
+-.endif
+-
+ # nb: FreeBSD is entirely elf; objformat was removed prior to FreeBSD 7
+ # http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/objformat/Attic/objformat.c
+ # deleted Jan 2007.
+@@ -37,6 +27,7 @@
+ # switch to default to ELF came with FreeBSD 3. elf(5) claims ELF support
+ # introduced in FreeBSD 2.2.6.
+ #
++X11=/usr/X11R6
+ XINCLUDE=-I$(X11)/include
+ XLFLAGS=-L$(X11)/lib -Wl,-rpath,${X11}/lib
+ X11_LD_LIB=$(X11)/lib
diff --git a/mail-mta/exim/files/exim-submission.socket b/mail-mta/exim/files/exim-submission.socket
new file mode 100644
index 00000000..b9593e2e
--- /dev/null
+++ b/mail-mta/exim/files/exim-submission.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Exim Mail Transfer Agent (message submission)
+Conflicts=exim.service
+
+[Socket]
+ListenStream=587
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/mail-mta/exim/files/exim-submission_at.service b/mail-mta/exim/files/exim-submission_at.service
new file mode 100644
index 00000000..4f90cd83
--- /dev/null
+++ b/mail-mta/exim/files/exim-submission_at.service
@@ -0,0 +1,11 @@
+# It doesn't make sense for this to be separate from exim@.service
+# However, I couldn't think of a way to have two .socket files point
+# to it ([Socket] Service= is rejected if Accept=yes is set).
+
+[Unit]
+Description=Exim Mail Daemon per-connection server (message submission)
+
+[Service]
+ExecStart=-/usr/bin/exim -bs
+StandardInput=socket
+StandardError=syslog
diff --git a/mail-mta/exim/files/exim.confd b/mail-mta/exim/files/exim.confd
new file mode 100644
index 00000000..1534d9df
--- /dev/null
+++ b/mail-mta/exim/files/exim.confd
@@ -0,0 +1,5 @@
+# Command-line options for running exim
+EXIM_OPTS="-bd -q15m"
+
+# Additional flags passed to exim_tidydb upon start (e.g. -t 7d)
+TIDY_OPTS=""
diff --git a/mail-mta/exim/files/exim.logrotate b/mail-mta/exim/files/exim.logrotate
new file mode 100644
index 00000000..f54f8c47
--- /dev/null
+++ b/mail-mta/exim/files/exim.logrotate
@@ -0,0 +1,9 @@
+/var/log/exim/exim*.log {
+ daily
+ missingok
+ rotate 28
+ compress
+ delaycompress
+ notifempty
+ create 640 mail mail
+}
diff --git a/mail-mta/exim/files/exim.rc8 b/mail-mta/exim/files/exim.rc8
new file mode 100644
index 00000000..f84d772e
--- /dev/null
+++ b/mail-mta/exim/files/exim.rc8
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/exim/files/exim.rc8,v 1.1 2013/10/08 18:16:18 grobian Exp $
+
+extra_started_commands="reload"
+
+depend() {
+ need logger
+ use antivirus net
+ provide mta
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/exim --pidfile /run/${SVCNAME}.pid -- -C /etc/exim/${SVCNAME}.conf ${EXIM_OPTS:--bd -q15m}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid --name exim
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile /run/${SVCNAME}.pid --name exim
+ eend $?
+}
diff --git a/mail-mta/exim/files/exim.rc9 b/mail-mta/exim/files/exim.rc9
new file mode 100644
index 00000000..c88f6533
--- /dev/null
+++ b/mail-mta/exim/files/exim.rc9
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/exim/files/exim.rc9,v 1.1 2015/05/05 12:55:34 grobian Exp $
+
+extra_started_commands="reload"
+
+depend() {
+ need logger
+ use antivirus net
+ provide mta
+}
+
+tidy_dbs() {
+ local spooldir=$(/usr/sbin/exim -C /etc/exim/${SVCNAME}.conf -bP -n spool_directory)
+ local db
+ local ret=0
+ ebegin "Tidying hints databases in ${spooldir}/db"
+ for db in "${spooldir}"/db/* ; do
+ [[ ${db} == *".lockfile" || ${db} == *"*" ]] && continue
+ /usr/sbin/exim_tidydb ${TIDY_OPTS} "${spooldir}" ${db##*/} > /dev/null
+ : $((ret += $?))
+ done
+ eend ${ret}
+}
+
+start() {
+ # if you use multiple instances, make sure you set spool_directory
+ # in the configfile
+ tidy_dbs
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/exim --pidfile /run/${SVCNAME}.pid -- -C /etc/exim/${SVCNAME}.conf ${EXIM_OPTS:--bd -q15m}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile /run/${SVCNAME}.pid --name exim
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile /run/${SVCNAME}.pid --name exim
+ eend $?
+}
diff --git a/mail-mta/exim/files/exim.service b/mail-mta/exim/files/exim.service
new file mode 100644
index 00000000..c8a61cdc
--- /dev/null
+++ b/mail-mta/exim/files/exim.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Exim Mail Transport Agent
+After=network.target
+
+[Service]
+Environment=QUEUE=15m
+ExecStart=/usr/sbin/exim -bdf -q${QUEUE}
+ExecReload=/bin/kill -HUP $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mail-mta/exim/files/exim.socket b/mail-mta/exim/files/exim.socket
new file mode 100644
index 00000000..36d28684
--- /dev/null
+++ b/mail-mta/exim/files/exim.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=Exim Mail Transfer Agent
+Conflicts=exim.service
+
+[Socket]
+ListenStream=25
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/mail-mta/exim/files/exim_482_dsn_1_3.patch b/mail-mta/exim/files/exim_482_dsn_1_3.patch
new file mode 100644
index 00000000..c3006996
--- /dev/null
+++ b/mail-mta/exim/files/exim_482_dsn_1_3.patch
@@ -0,0 +1,1212 @@
+Modified for 4.82 by Gentoo -- not the official patch from
+http://sourceforge.net/projects/eximdsn/
+
+diff -Naur exim-4.82_RC5.orig/README.DSN exim-4.82_RC5/README.DSN
+--- exim-4.82_RC5.orig/README.DSN 1970-01-01 01:00:00.000000000 +0100
++++ exim-4.82_RC5/README.DSN 2013-10-27 21:47:32.000000000 +0100
+@@ -0,0 +1,118 @@
++Exim DSN Patch (4.76)
++---------------------
++
++This patch 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 patch 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 patch; if not, write to the Free Software
++Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
++
++Install
++-------
++cd into the source tree for a vanilla exim
++
++patch -p1 </path/to/patch/file.patch
++
++Example :-
++[root@linuxbuild exim-4.72-test]# patch -p1 <../exim.dsn.patch-472
++
++Expected Output :-
++patching file README.DSN
++patching file src/config.h.defaults
++patching file src/deliver.c
++patching file src/exim.c
++patching file src/exim.h
++patching file src/globals.c
++patching file src/globals.h
++patching file src/local_scan.h
++patching file src/macros.h
++patching file src/readconf.c
++patching file src/route.c
++patching file src/smtp_in.c
++patching file src/spool_in.c
++patching file src/spool_out.c
++patching file src/structs.h
++patching file src/transport.c
++patching file src/transports/smtp.c
++
++
++This patch can be included / excluded from the compilation by use of the #define SUPPORT_DSN
++which gets added into src/config.h.defaults & src/EDITME by the patch.
++
++Use
++---
++
++The facility (once compiled in) can be turned on for a particular router via the
++dsn_process directive Eg :-
++
++dest_delivery_int:
++ driver = manualroute
++ domains = +relay_to_domains
++ condition = ${if eq {${lc:$sender_address_domain}}\
++ {domain.com}\
++ {yes}{no}\
++ }
++ dsn_process
++ hide route_data = ${lc:${extract{mailHost}{$address_data}{$value}{}}}
++ transport = remote_smtp
++
++Exim will produce 1 of 2 DSN's back to the originator, or pass on the DSN request.
++The 2 DSN's will either contain (relayed via non "Remote SMTP" router) or
++(relayed to non-DSN-aware mailer) depending on if the delivery was VIA an SMTP
++transport or not.
++
++
++Credits
++-------
++
++The original work for the patch was done by Philip Hazel in Exim 3
++
++The extract was taken and re-applied to Exim 4 by the following :-
++Phil Bingham (phil.bingham@cwipapps.net)
++Steve Falla (steve.falla@cwipapps.net)
++Ray Edah (ray.edah@cwipapps.net)
++Andrew Johnson (andrew.johnson@cwippaps.net)
++Adrian Hungate (adrian.hungate@cwipapps.net)
++
++Now Primarily maintained by :-
++Andrew Johnson (andrew.johnson@cwippaps.net)
++
++Contributions
++-------------
++Andrey J. Melnikoff (TEMHOTA) (temnota@kmv.ru)
++
++
++ChangeLog
++---------
++
++14-Apr-2006 : Changed subject to "Delivery Status Notification"
++
++17-May-2006 : debug_printf in spool-in.c were not wrapped with #ifndef COMPILE_UTILITY
++ thanks to Andrey J. Melnikoff for this information
++
++12-Sep-2006 : Now supports Exim 4.63
++
++12-Sep-2006 : src/EDITME did not include the #define SUPPORT_DSN as stated
++ in the documentation, this has now been corrected
++ thanks to Robert Kehl for this information
++
++28-Jul-2008 : New version for exim 4.69 released.
++
++02-Jul-2010 : New version for exim 4.72 released.
++
++20-May-2011 : New version for exim 4.76 released.
++
++
++Support for this patch (limited though it is) will only be provided through the SourceForge
++project page (http://sourceforge.net/projects/eximdsn/)
++
++--
++Andrew Johnson Cable & Wireless
+diff -Naur exim-4.82_RC5.orig/src/config.h.defaults exim-4.82_RC5/src/config.h.defaults
+--- exim-4.82_RC5.orig/src/config.h.defaults 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/config.h.defaults 2013-10-27 21:47:32.000000000 +0100
+@@ -136,6 +136,7 @@
+ #define SUPPORT_MOVE_FROZEN_MESSAGES
+ #define SUPPORT_PAM
+ #define SUPPORT_TLS
++#define SUPPORT_DSN
+ #define SUPPORT_TRANSLATE_IP_ADDRESS
+
+ #define SYSLOG_LOG_PID
+diff -Naur exim-4.82_RC5.orig/src/deliver.c exim-4.82_RC5/src/deliver.c
+--- exim-4.82_RC5.orig/src/deliver.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/deliver.c 2013-10-27 21:47:32.000000000 +0100
+@@ -63,6 +63,9 @@
+ static address_item *addr_remote = NULL;
+ static address_item *addr_route = NULL;
+ static address_item *addr_succeed = NULL;
++#ifdef SUPPORT_DSN
++static address_item *addr_dsntmp = NULL;
++#endif
+
+ static FILE *message_log = NULL;
+ static BOOL update_spool;
+@@ -2966,6 +2969,15 @@
+ addr->flags |= af_prdr_used; break;
+ #endif
+
++ #ifdef SUPPORT_DSN
++ case 'D':
++ if (addr == NULL) break;
++ addr->dsn_aware = (*ptr)? string_copy(ptr) : string_copy(" ");
++ while (*ptr++);
++ DEBUG(D_deliver) debug_printf("DSN read: addr->dsn_aware = %s\n", addr->dsn_aware);
++ break;
++ #endif
++
+ case 'A':
+ if (addr == NULL)
+ {
+@@ -4074,6 +4086,15 @@
+ if (addr->flags & af_prdr_used) rmt_dlv_checked_write(fd, "P", 1);
+ #endif
+
++ #ifdef SUPPORT_DSN
++ if (addr->dsn_aware == NULL)
++ addr->dsn_aware = string_copy(" ");
++ DEBUG(D_deliver) debug_printf("DSN write: addr->dsn_aware = %s\n", addr->dsn_aware);
++ sprintf(big_buffer, "D%s", addr->dsn_aware);
++ DEBUG(D_deliver) debug_printf("DSN write: big_buffer = %s (%d)\n", big_buffer, strlen(big_buffer)+1);
++ write(fd, big_buffer, strlen(big_buffer)+1);
++ #endif
++
+ /* Retry information: for most success cases this will be null. */
+
+ for (r = addr->retries; r != NULL; r = r->next)
+@@ -5219,6 +5240,14 @@
+ if (r->pno >= 0)
+ new->onetime_parent = recipients_list[r->pno].address;
+
++ #ifdef SUPPORT_DSN
++ /* If DSN support is enabled, set the dsn flags and the original receipt
++ to be passed on to other DSN enabled MTAs */
++ new->dsn_flags = r->dsn_flags & rf_dsnflags;
++ new->dsn_orcpt = r->orcpt;
++ debug_printf("DSN (deliver): orcpt: %s flags: %d\n", new->dsn_orcpt, new->dsn_flags);
++ #endif
++
+ switch (process_recipients)
+ {
+ /* RECIP_DEFER is set when a system filter freezes a message. */
+@@ -6163,6 +6192,12 @@
+ regex_must_compile(US"\\n250[\\s\\-]PRDR(\\s|\\n|$)", FALSE, TRUE);
+ #endif
+
++ #ifdef SUPPORT_DSN
++ /* Set the regex to check for DSN support on remote MTA */
++ if (regex_DSN == NULL) regex_DSN =
++ regex_must_compile(US"\\n250[\\s\\-]DSN(\\s|\\n|$)", FALSE, TRUE);
++ #endif
++
+ /* Now sort the addresses if required, and do the deliveries. The yield of
+ do_remote_deliveries is FALSE when mua_wrapper is set and all addresses
+ cannot be delivered in one transaction. */
+@@ -6267,6 +6302,179 @@
+
+ else if (!dont_deliver) retry_update(&addr_defer, &addr_failed, &addr_succeed);
+
++#ifdef SUPPORT_DSN
++/* ********** philb - Send DSN for successful messages */
++
++addr_dsntmp = addr_succeed;
++
++while(addr_dsntmp != NULL)
++{
++ BOOL dsn_sendmessage = FALSE;
++ uschar dsnmsgbuf[4096];
++
++ DEBUG(D_deliver)
++ debug_printf("DSN: processing router : %s\n", addr_dsntmp->router->name);
++
++ DEBUG(D_deliver)
++ debug_printf("DSN: processing successful delivery address: %s\n", addr_dsntmp->address);
++
++ if (testflag(addr_dsntmp, af_ignore_error))
++ {
++ DEBUG(D_deliver)
++ debug_printf("DSN: Ignore error for: %s\n", addr_dsntmp->address);
++ }
++ else
++ {
++ DEBUG(D_deliver) debug_printf("DSN: Checking Flag\n");
++ if (addr_dsntmp->dsn_aware == NULL) {
++ DEBUG(D_deliver) debug_printf("DSN: dsn_aware was NULL, setting to space at %s %d\n", __FILE__, __LINE__);
++ addr_dsntmp->dsn_aware = string_copy(" ");
++ }
++ DEBUG(D_deliver) debug_printf("DSN: Sender_address: %s\n", sender_address);
++ DEBUG(D_deliver) debug_printf("DSN: orcpt: %s flags: %d\n", addr_dsntmp->dsn_orcpt, addr_dsntmp->dsn_flags);
++ DEBUG(D_deliver) debug_printf("DSN: envid: %s ret: %d\n", dsn_envid, dsn_ret);
++ DEBUG(D_deliver) debug_printf("DSN: Remote SMTP server supports DSN: %s\n", addr_dsntmp->dsn_aware);
++
++ /* Process the flags */
++ if((addr_dsntmp->dsn_flags & rf_dsnflags) != 0)
++ {
++ /* We've got at least one flag set */
++
++ /* set flag so we don't send bounces */
++ setflag(addr_dsntmp, af_ignore_error);
++
++ if((addr_dsntmp->dsn_flags & rf_notify_never) != 0)
++ {
++ DEBUG(D_deliver) debug_printf("DSN: NEVER FLAG\n");
++
++ /* nothing to do here */
++ }
++
++ if((addr_dsntmp->dsn_flags & rf_notify_success) != 0)
++ {
++ DEBUG(D_deliver) debug_printf("DSN: SUCCESS FLAG\n");
++
++ dsn_sendmessage = TRUE;
++ }
++
++ if((addr_dsntmp->dsn_flags & rf_notify_failure) != 0)
++ {
++ DEBUG(D_deliver) debug_printf("DSN: FAILURE FLAG\n");
++
++ /* allow bounce messages */
++ clearflag(addr_dsntmp, af_ignore_error);
++ }
++
++ if((addr_dsntmp->dsn_flags & rf_notify_delay) != 0)
++ {
++ DEBUG(D_deliver) debug_printf("DSN: DELAY FLAG\n");
++
++ /* hmm, what to do here? */
++ }
++ }
++
++ if ((addr_dsntmp->dsn_aware != 0) && (addr_dsntmp->dsn_aware[0] != 'Y') && (dsn_sendmessage == TRUE) && (addr_dsntmp->router->dsn_process == TRUE))
++ {
++ pid_t pid;
++ int fd;
++
++ /* remote MTA does not support DSN, so we need to send message */
++
++ /* create exim process to send message */
++ pid = child_open_exim(&fd);
++
++ DEBUG(D_deliver) debug_printf("DSN: child_open_exim returns: %d\n", pid);
++
++ if (pid < 0) /* Creation of child failed */
++ {
++ log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Process %d (parent %d) failed to "
++ "create child process to send failure message: %s", getpid(),
++ getppid(), strerror(errno));
++
++ DEBUG(D_deliver) debug_printf("DSN: child_open_exim failed\n");
++
++ }
++ else /* Creation of child succeeded */
++ {
++ FILE *f = fdopen(fd, "wb");
++ int topt = topt_add_return_path;
++ uschar boundaryStr[64];
++
++ DEBUG(D_deliver) debug_printf("sending error message to: %s\n", sender_address);
++
++ /* build unique id for MIME boundary */
++ snprintf(boundaryStr, 63, "%d-cwdsn-%d", pid, rand());
++ DEBUG(D_deliver) debug_printf("DSN: MIME boundary: %s\n", boundaryStr);
++
++ /* if the sender doesn't want the whole message returned, don't send the body */
++ if (dsn_ret != dsn_ret_full) topt |= topt_no_body;
++
++ if (errors_reply_to != NULL) fprintf(f,"Reply-To: %s\n", errors_reply_to);
++
++ fprintf(f,"Auto-Submitted: auto-generated\n");
++ fprintf(f,"From: Mail Delivery System <Mailer-Daemon@%s>\n", qualify_domain_sender);
++ fprintf(f,"To: %s\n", sender_address);
++ fprintf(f,"Subject: Delivery Status Notification\n");
++ fprintf(f,"Content-Type: multipart/report; report-type=delivery-status; boundary=%s\n", boundaryStr);
++ fprintf(f,"MIME-Version: 1.0\n\n");
++
++ fprintf(f,"--%s\n", boundaryStr);
++ fprintf(f,"Content-type: text/plain; charset=us-ascii\n\n");
++
++ fprintf(f,"This message was created automatically by mail delivery software.\n");
++ fprintf(f," ----- The following addresses had successful delivery notifications -----\n");
++/* AH: added specific message for non "Remote SMTP" situations */
++ if (addr_dsntmp->dsn_aware[0] == 'N') {
++ fprintf(f,"<%s> (relayed to non-DSN-aware mailer)\n\n", addr_dsntmp->address);
++ } else {
++ fprintf(f,"<%s> (relayed via non \"Remote SMTP\" router)\n\n", addr_dsntmp->address);
++ }
++
++ fprintf(f,"--%s\n", boundaryStr);
++ fprintf(f,"Content-type: message/delivery-status\n\n");
++
++ if (dsn_envid) { /* Test for NULL added by GC */
++ fprintf(f,"Original-Envelope-Id: %s\n", dsn_envid);
++ }
++ fprintf(f,"Reporting-MTA: dns; %s\n", qualify_domain_sender);
++ if (addr_dsntmp->dsn_orcpt) { /* Test for NULL added by GC */
++ fprintf(f,"Original-Recipient: %s\n", addr_dsntmp->dsn_orcpt);
++ }
++ fprintf(f,"Action: delivered\n\n");
++
++ fprintf(f,"--%s\n", boundaryStr);
++ fprintf(f,"Content-type: message/rfc822\n\n");
++
++ fflush(f);
++ transport_filter_argv = NULL; /* Just in case */
++ return_path = sender_address; /* In case not previously set */
++
++ /* Write the original email out */
++ transport_write_message(NULL, fileno(f), topt, 2048, NULL, NULL, NULL, NULL, NULL, 0);
++ fflush(f);
++
++ fprintf(f,"\n");
++ fprintf(f,"--%s--\n", boundaryStr);
++
++ fflush(f);
++ fclose(f);
++ rc = child_close(pid, 0); /* Waits for child to close, no timeout */
++ }
++ }
++ else
++ { if (addr_dsntmp->router->dsn_process == TRUE)
++ DEBUG(D_deliver) debug_printf("DSN: *** NOT SENDING DSN SUCCESS Message ***\n");
++ if (addr_dsntmp->router->dsn_process == FALSE)
++ DEBUG(D_deliver) debug_printf("DSN: *** NOT SENDING DSN SUCCESS Message (gagged) ***\n");
++ }
++ }
++
++ addr_dsntmp = addr_dsntmp->next;
++}
++
++/* ********** philb - end of mod */
++#endif
++
+ /* If any addresses failed, we must send a message to somebody, unless
+ af_ignore_error is set, in which case no action is taken. It is possible for
+ several messages to get sent if there are addresses with different
+diff -Naur exim-4.82_RC5.orig/src/EDITME exim-4.82_RC5/src/EDITME
+--- exim-4.82_RC5.orig/src/EDITME 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/EDITME 2013-10-27 21:47:32.000000000 +0100
+@@ -192,6 +192,8 @@
+ # least one type of lookup. You should consider whether you want to build
+ # the Exim monitor or not.
+
++# Support DSN
++SUPPORT_DSN=yes
+
+ #------------------------------------------------------------------------------
+ # These settings determine which individual router drivers are included in the
+diff -Naur exim-4.82_RC5.orig/src/exim.c exim-4.82_RC5/src/exim.c
+--- exim-4.82_RC5.orig/src/exim.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/exim.c 2013-10-27 21:47:32.000000000 +0100
+@@ -831,6 +831,9 @@
+ #ifdef EXPERIMENTAL_REDIS
+ fprintf(f, " Experimental_Redis");
+ #endif
++#ifdef SUPPORT_DSN
++ fprintf(f, " C&W_DSN_1.3");
++#endif
+ fprintf(f, "\n");
+
+ fprintf(f, "Lookups (built-in):");
+@@ -2653,6 +2656,16 @@
+ break;
+ }
+
++ #ifdef SUPPORT_DSN
++ /* -MCD: set the smtp_use_dsn flag; this indicates that the host
++ that exim is connected to supports the esmtp extension DSN */
++ else if (strcmp(argrest, "CD") == 0)
++ {
++ smtp_use_dsn = TRUE;
++ break;
++ }
++ #endif
++
+ /* -MCP: set the smtp_use_pipelining flag; this is useful only when
+ it preceded -MC (see above) */
+
+diff -Naur exim-4.82_RC5.orig/src/globals.c exim-4.82_RC5/src/globals.c
+--- exim-4.82_RC5.orig/src/globals.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/globals.c 2013-10-27 21:47:32.000000000 +0100
+@@ -124,6 +124,13 @@
+ uschar *local_scan_path = NULL;
+ #endif
+
++#ifdef SUPPORT_DSN
++BOOL dsn = TRUE;
++uschar *dsn_envid = NULL;
++int dsn_ret = 0;
++const pcre *regex_DSN = NULL;
++BOOL smtp_use_dsn = FALSE;
++#endif
+
+ #ifdef SUPPORT_TLS
+ BOOL gnutls_compat_mode = FALSE;
+@@ -341,6 +348,11 @@
+ NULL, /* authenticator */
+ NULL, /* auth_id */
+ NULL, /* auth_sndr */
++ #ifdef SUPPORT_DSN
++ NULL, /* dsn_orcpt */
++ 0, /* dsn_flags */
++ NULL, /* dsn_aware */
++ #endif
+ (uid_t)(-1), /* uid */
+ (gid_t)(-1), /* gid */
+ 0, /* flags */
+@@ -1096,6 +1108,9 @@
+ TRUE, /* verify_sender */
+ FALSE, /* uid_set */
+ FALSE, /* unseen */
++#ifdef SUPPORT_DSN
++ FALSE, /* dsn_process */
++#endif
+
+ self_freeze, /* self_code */
+ (uid_t)(-1), /* uid */
+@@ -1105,6 +1120,7 @@
+ NULL, /* transport instance */
+ NULL, /* pass_router */
+ NULL /* redirect_router */
++
+ };
+
+ uschar *router_name = NULL;
+diff -Naur exim-4.82_RC5.orig/src/globals.h exim-4.82_RC5/src/globals.h
+--- exim-4.82_RC5.orig/src/globals.h 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/globals.h 2013-10-27 21:47:32.000000000 +0100
+@@ -130,6 +130,13 @@
+ extern int (*receive_ferror)(void);
+ extern BOOL (*receive_smtp_buffered)(void);
+
++#ifdef SUPPORT_DSN
++extern BOOL dsn; /* FALSE if DSN not to be used */
++extern uschar *dsn_envid; /* DSN envid string */
++extern int dsn_ret; /* DSN ret type*/
++extern const pcre *regex_DSN; /* For recognizing DSN settings */
++extern BOOL smtp_use_dsn; /* Global for passed connections */
++#endif
+
+ /* For clearing, saving, restoring address expansion variables. We have to have
+ the size of this vector set explicitly, because it is referenced from more than
+diff -Naur exim-4.82_RC5.orig/src/local_scan.h exim-4.82_RC5/src/local_scan.h
+--- exim-4.82_RC5.orig/src/local_scan.h 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/local_scan.h 2013-10-27 21:47:32.000000000 +0100
+@@ -124,9 +124,13 @@
+ field is always NULL except for one_time aliases that had errors_to on the
+ routers that generated them. */
+
++/* Added the dsn attributes orcpt and dsn_flags for DSN support*/
++
+ typedef struct recipient_item {
+ uschar *address; /* the recipient address */
+ int pno; /* parent number for "one_time" alias, or -1 */
++ uschar *orcpt; /* DSN orcpt */
++ int dsn_flags; /* DSN flags */
+ uschar *errors_to; /* the errors_to address or NULL */
+ #ifdef EXPERIMENTAL_BRIGHTMAIL
+ uschar *bmi_optin;
+diff -Naur exim-4.82_RC5.orig/src/macros.h exim-4.82_RC5/src/macros.h
+--- exim-4.82_RC5.orig/src/macros.h 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/macros.h 2013-10-27 21:47:32.000000000 +0100
+@@ -778,6 +778,22 @@
+ #define topt_no_body 0x040 /* Omit body */
+ #define topt_escape_headers 0x080 /* Apply escape check to headers */
+
++ /* Flags for recipient_block, used in DSN support */
++
++ #define rf_onetime 0x01 /* A one-time alias */
++ #define rf_notify_never 0x02 /* NOTIFY= settings */
++ #define rf_notify_success 0x04
++ #define rf_notify_failure 0x08
++ #define rf_notify_delay 0x10
++
++ #define rf_dsnflags (rf_notify_never | rf_notify_success | \
++ rf_notify_failure | rf_notify_delay)
++
++ /* DSN RET types */
++
++ #define dsn_ret_full 1
++ #define dsn_ret_hdrs 2
++
+ /* Codes for the host_find_failed and host_all_ignored options. */
+
+ #define hff_freeze 0
+diff -Naur exim-4.82_RC5.orig/src/readconf.c exim-4.82_RC5/src/readconf.c
+--- exim-4.82_RC5.orig/src/readconf.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/readconf.c 2013-10-27 21:49:15.000000000 +0100
+@@ -229,6 +229,9 @@
+ /* This option is now a no-op, retained for compability */
+ { "drop_cr", opt_bool, &drop_cr },
+ /*********************************************************/
++#ifdef SUPPORT_DSN
++ { "dsn", opt_bool, &dsn },
++#endif
+ { "dsn_from", opt_stringptr, &dsn_from },
+ { "envelope_to_remove", opt_bool, &envelope_to_remove },
+ { "errors_copy", opt_stringptr, &errors_copy },
+diff -Naur exim-4.82_RC5.orig/src/receive.c exim-4.82_RC5/src/receive.c
+--- exim-4.82_RC5.orig/src/receive.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/receive.c 2013-10-27 21:47:32.000000000 +0100
+@@ -490,6 +490,8 @@
+ memcpy(recipients_list, oldlist, oldmax * sizeof(recipient_item));
+ }
+
++/* memset added by GC to blank dsn records, etc. */
++memset(&recipients_list[recipients_count], 0, sizeof(recipient_item));
+ recipients_list[recipients_count].address = recipient;
+ recipients_list[recipients_count].pno = pno;
+ #ifdef EXPERIMENTAL_BRIGHTMAIL
+diff -Naur exim-4.82_RC5.orig/src/route.c exim-4.82_RC5/src/route.c
+--- exim-4.82_RC5.orig/src/route.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/route.c 2013-10-27 21:47:32.000000000 +0100
+@@ -58,6 +58,10 @@
+ (void *)offsetof(router_instance, domains) },
+ { "driver", opt_stringptr|opt_public,
+ (void *)offsetof(router_instance, driver_name) },
++ #ifdef SUPPORT_DSN
++ { "dsn_process", opt_bool|opt_public,
++ (void *)offsetof(router_instance, dsn_process) },
++ #endif
+ { "errors_to", opt_stringptr|opt_public,
+ (void *)(offsetof(router_instance, errors_to)) },
+ { "expn", opt_bool|opt_public,
+@@ -270,6 +274,13 @@
+
+ if (r->pass_router_name != NULL)
+ set_router(r, r->pass_router_name, &(r->pass_router), TRUE);
++
++ #ifdef SUPPORT_DSN
++ if (r->dsn_process == FALSE)
++ DEBUG(D_route) debug_printf("%s router skipping DSN - add dsn_process to router\n", r->name);
++ if (r->dsn_process == TRUE)
++ DEBUG(D_route) debug_printf("%s router performing DSN \n", r->name);
++ #endif
+ }
+ }
+
+@@ -1412,7 +1423,10 @@
+
+ copyflag(new, addr, af_propagate);
+ new->p.address_data = addr->p.address_data;
+-
++#ifdef SUPPORT_DSN
++ new->dsn_flags = addr->dsn_flags;
++ new->dsn_orcpt = addr->dsn_orcpt;
++#endif
+
+ /* As it has turned out, we haven't set headers_add or headers_remove for the
+ * clone. Thinking about it, it isn't entirely clear whether they should be
+diff -Naur exim-4.82_RC5.orig/src/smtp_in.c exim-4.82_RC5/src/smtp_in.c
+--- exim-4.82_RC5.orig/src/smtp_in.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/smtp_in.c 2013-10-27 21:47:32.000000000 +0100
+@@ -213,6 +213,9 @@
+ #ifdef EXPERIMENTAL_PRDR
+ ENV_MAIL_OPT_PRDR,
+ #endif
++#ifdef SUPPORT_DSN
++ ENV_MAIL_OPT_RET, ENV_MAIL_OPT_ENVID,
++#endif
+ ENV_MAIL_OPT_NULL
+ };
+ typedef struct {
+@@ -228,6 +231,10 @@
+ #ifdef EXPERIMENTAL_PRDR
+ { US"PRDR", ENV_MAIL_OPT_PRDR, FALSE },
+ #endif
++#ifdef SUPPORT_DSN
++ { US"RET", ENV_MAIL_OPT_RET, FALSE },
++ { US"ENVID", ENV_MAIL_OPT_ENVID, FALSE },
++#endif
+ { US"NULL", ENV_MAIL_OPT_NULL, FALSE }
+ };
+
+@@ -1073,6 +1080,13 @@
+ sender_verified_list = NULL; /* No senders verified */
+ memset(sender_address_cache, 0, sizeof(sender_address_cache));
+ memset(sender_domain_cache, 0, sizeof(sender_domain_cache));
++
++#ifdef SUPPORT_DSN
++/* Reset the DSN flags */
++dsn_ret = 0;
++dsn_envid = NULL;
++#endif
++
+ authenticated_sender = NULL;
+ #ifdef EXPERIMENTAL_BRIGHTMAIL
+ bmi_run = 0;
+@@ -2679,6 +2693,10 @@
+ int ptr, size, rc;
+ int c, i;
+ auth_instance *au;
++#ifdef SUPPORT_DSN
++ uschar *orcpt = NULL;
++ int flags;
++#endif
+
+ switch(smtp_read_command(TRUE))
+ {
+@@ -3106,6 +3124,12 @@
+ s = string_cat(s, &size, &ptr, US"-8BITMIME\r\n", 11);
+ }
+
++ #ifdef SUPPORT_DSN
++ /* Advertise DSN support if configured to do so. */
++ if (dsn)
++ s = string_cat(s, &size, &ptr, US"250-DSN\r\n", 9);
++ #endif
++
+ /* Advertise ETRN if there's an ACL checking whether a host is
+ permitted to issue it; a check is made when any host actually tries. */
+
+@@ -3360,6 +3384,42 @@
+ arg_error = TRUE;
+ break;
+
++#ifdef SUPPORT_DSN
++
++ /* Handle the two DSN options, but only if configured to do so
++ * (which will have caused "DSN" to be given in the EHLO
++ * response). The code itself is included only if configured in
++ * at build time. */
++
++ case ENV_MAIL_OPT_RET:
++ /* Check if RET has already been set */
++ if (dsn_ret > 0) {
++ synprot_error(L_smtp_syntax_error, 501, NULL,
++ US"RET can be specified once only");
++ goto COMMAND_LOOP;
++ }
++ dsn_ret = (strcmpic(value, US"HDRS") == 0)? dsn_ret_hdrs :
++ (strcmpic(value, US"FULL") == 0)? dsn_ret_full : 0;
++ DEBUG(D_receive) debug_printf("DSN_RET: %d\n", dsn_ret);
++ /* Check for invalid invalid value, and exit with error */
++ if (dsn_ret == 0) {
++ synprot_error(L_smtp_syntax_error, 501, NULL,
++ US"Value for RET is invalid");
++ goto COMMAND_LOOP;
++ }
++ break;
++ case ENV_MAIL_OPT_ENVID:
++ /* Check if the dsn envid has been already set */
++ if (dsn_envid != NULL) {
++ synprot_error(L_smtp_syntax_error, 501, NULL,
++ US"ENVID can be specified once only");
++ goto COMMAND_LOOP;
++ }
++ dsn_envid = string_copy(value);
++ DEBUG(D_receive) debug_printf("DSN_ENVID: %s\n", dsn_envid);
++ break;
++#endif
++
+ /* Handle the AUTH extension. If the value given is not "<>" and either
+ the ACL says "yes" or there is no ACL but the sending host is
+ authenticated, we set it up as the authenticated sender. However, if the
+@@ -3633,6 +3693,89 @@
+ rcpt_fail_count++;
+ break;
+ }
++
++ #ifdef SUPPORT_DSN
++ /* Set the DSN flags orcpt and dsn_flags from the session*/
++ orcpt = NULL;
++ flags = 0;
++
++ if (esmtp) for(;;)
++ {
++ uschar *name, *value, *end;
++ int size;
++
++ if (!extract_option(&name, &value))
++ {
++ break;
++ }
++
++ if (strcmpic(name, US"ORCPT") == 0)
++ {
++ /* Check whether orcpt has been already set */
++ if (orcpt != NULL) {
++ synprot_error(L_smtp_syntax_error, 501, NULL,
++ US"ORCPT can be specified once only");
++ goto COMMAND_LOOP;
++ }
++ orcpt = string_copy(value);
++ DEBUG(D_receive) debug_printf("DSN orcpt: %s\n", orcpt);
++ }
++
++ else if (strcmpic(name, US"NOTIFY") == 0)
++ {
++ /* Check if the notify flags have been already set */
++ if (flags > 0)
++ {
++ synprot_error(L_smtp_syntax_error, 501, NULL,
++ US"NOTIFY can be specified once only");
++ goto COMMAND_LOOP;
++ }
++ if (strcmpic(value, US"NEVER") == 0) flags |= rf_notify_never; else
++ {
++ uschar *p = value;
++ while (*p != 0)
++ {
++ uschar *pp = p;
++ while (*pp != 0 && *pp != ',') pp++;
++ if (*pp == ',') *pp++ = 0;
++ if (strcmpic(p, US"SUCCESS") == 0) {
++ DEBUG(D_receive) debug_printf("GC: Setting notify success\n");
++ flags |= rf_notify_success;
++ }
++ else if (strcmpic(p, US"FAILURE") == 0) {
++ DEBUG(D_receive) debug_printf("GC: Setting notify failure\n");
++ flags |= rf_notify_failure;
++ }
++ else if (strcmpic(p, US"DELAY") == 0) {
++ DEBUG(D_receive) debug_printf("GC: Setting notify delay\n");
++ flags |= rf_notify_delay;
++ }
++ else
++ {
++ /* Catch any strange values */
++ synprot_error(L_smtp_syntax_error, 501, NULL,
++ US"Invalid value for NOTIFY parameter");
++ goto COMMAND_LOOP;
++ }
++ p = pp;
++ }
++ DEBUG(D_receive) debug_printf("DSN Flags: %x\n", flags);
++ }
++ }
++
++ /* Unknown option. Stick back the terminator characters and break
++ the loop. An error for a malformed address will occur. */
++
++ else
++ {
++ DEBUG(D_receive) debug_printf("Invalid dsn command: %s : %s\n", name, value);
++ name[-1] = ' ';
++ value[-1] = '=';
++ break;
++ }
++ }
++ #endif
++
+
+ /* Apply SMTP rewriting then extract the working address. Don't allow "<>"
+ as a recipient address */
+@@ -3747,6 +3890,24 @@
+ if (user_msg == NULL) smtp_printf("250 Accepted\r\n");
+ else smtp_user_msg(US"250", user_msg);
+ receive_add_recipient(recipient, -1);
++
++ #ifdef SUPPORT_DSN
++
++ /* Set the dsn flags in the recipients_list */
++ if (orcpt != NULL)
++ recipients_list[recipients_count-1].orcpt = orcpt;
++ else
++ recipients_list[recipients_count-1].orcpt = NULL;
++
++ if (flags != 0)
++ recipients_list[recipients_count-1].dsn_flags = flags;
++ else
++ recipients_list[recipients_count-1].dsn_flags = 0;
++ debug_printf("DSN-AJ(smtp-in): orcpt: %s flags: %d\n", recipients_list[recipients_count-1].orcpt, recipients_list[recipients_count-1].dsn_flags);
++
++
++ #endif
++
+ }
+
+ /* The recipient was discarded */
+diff -Naur exim-4.82_RC5.orig/src/spool_in.c exim-4.82_RC5/src/spool_in.c
+--- exim-4.82_RC5.orig/src/spool_in.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/spool_in.c 2013-10-27 21:47:32.000000000 +0100
+@@ -293,6 +293,13 @@
+ spam_score_int = NULL;
+ #endif
+
++#ifdef SUPPORT_DSN
++#ifndef COMPILE_UTILITY
++dsn_ret = 0;
++dsn_envid = NULL;
++#endif /* COMPILE_UTILITY */
++#endif
++
+ /* Generate the full name and open the file. If message_subdir is already
+ set, just look in the given directory. Otherwise, look in both the split
+ and unsplit directories, as for the data file above. */
+@@ -467,6 +474,19 @@
+ case 'd':
+ if (Ustrcmp(p, "eliver_firsttime") == 0)
+ deliver_firsttime = TRUE;
++ #ifdef SUPPORT_DSN
++ #ifndef COMPILE_UTILITY
++ /* Check if the dsn flags have been set in the header file */
++ else if (Ustrncmp(p, "sn_ret", 6) == 0)
++ {
++ dsn_ret= atoi(big_buffer + 8);
++ }
++ else if (Ustrncmp(p, "sn_envid", 8) == 0)
++ {
++ dsn_envid = string_copy(big_buffer + 11);
++ }
++ #endif /* COMPILE_UTILITY */
++ #endif
+ break;
+
+ case 'f':
+@@ -554,7 +574,7 @@
+ tls_in.sni = string_unprinting(string_copy(big_buffer + 9));
+ break;
+ #endif
+-
++
+ default: /* Present because some compilers complain if all */
+ break; /* possibilities are not covered. */
+ }
+@@ -604,6 +624,10 @@
+ {
+ int nn;
+ int pno = -1;
++ #ifdef SUPPORT_DSN
++ int dsn_flags = 0;
++ uschar *orcpt = NULL;
++ #endif
+ uschar *errors_to = NULL;
+ uschar *p;
+
+@@ -672,10 +696,19 @@
+ }
+
+ /* Handle current format Exim 4 spool files */
++ /* Spool file is modified if DSN is supported
++ Original was "address errors_to len(errors_to),pno
++ New for DSN support is now:
++ "address errors_to orcpt len(errors_to),len(orcpt),pno,dsn_flags */
+
+ else if (*p == '#')
+ {
+ int flags;
++
++ #ifndef COMPILE_UTILITY
++ DEBUG(D_deliver) debug_printf("**** SPOOL_IN - Exim 4 standard format spoolfile\n");
++ #endif /* COMPILE_UTILITY */
++
+ (void)sscanf(CS p+1, "%d", &flags);
+
+ if ((flags & 0x01) != 0) /* one_time data exists */
+@@ -688,15 +721,82 @@
+ {
+ p -= len;
+ errors_to = string_copy(p);
++ }
++ }
++
++ *(--p) = 0; /* Terminate address */
++ }
++ #ifdef SUPPORT_DSN
++ else if (*p == '!') /* Handle Exim4 + DSN spool files */
++ {
++ int flags;
++ int temp_dsn_flags;
++
++ #ifndef COMPILE_UTILITY
++ DEBUG(D_deliver) debug_printf("**** SPOOL_IN - C&W DSN format spoolfile\n");
++ #endif /* COMPILE_UTILITY */
++
++ sscanf(CS p+1, "%d,%d", &flags, &temp_dsn_flags);
++
++ if (((flags & 0x01) != 0) || (temp_dsn_flags > 0)) /* one_time data or dsn_flags exist */
++ {
++ int len;
++ int len_orcpt;
++
++ #ifndef COMPILE_UTILITY
++ DEBUG(D_deliver) debug_printf("**** spool_in dsn_flags = 0\n");
++ #endif /* COMPILE_UTILITY */
++
++ dsn_flags = 0;
++
++ while (isdigit(*(--p)) || *p == ',' || *p == '-');
++ sscanf(CS p+1, "%d,%d,%d,%d", &len, &len_orcpt, &pno, &dsn_flags);
++
++ *p = 0;
++ if (len_orcpt > 0)
++ {
++ p -= len_orcpt;
++ orcpt = string_copy(p);
+ }
++ *(--p) = 0; /* change the space to a NULL */
++
++ if (len > 0)
++ {
++ p -= len;
++ errors_to = string_copy(p);
++ }
+ }
+
+ *(--p) = 0; /* Terminate address */
+ }
++ #endif
++ #ifndef COMPILE_UTILITY
++ else
++ {
++ DEBUG(D_deliver) debug_printf("**** SPOOL_IN - No additional fields\n");
++ }
++ #endif /* COMPILE_UTILITY */
++
++ #ifdef SUPPORT_DSN
++ #ifndef COMPILE_UTILITY
++ DEBUG(D_deliver) debug_printf("**** SPOOL_IN - address: |%s| errorsto: |%s| orcpt: |%s| dsn_flags: %d\n",
++ big_buffer, errors_to, orcpt, dsn_flags);
++ #endif /* COMPILE_UTILITY */
++ #endif
++ #ifndef SUPPORT_DSN
++ #ifndef COMPILE_UTILITY
++ DEBUG(D_deliver) debug_printf("**** SPOOL_IN - address: |%s| errorsto: |%s|\n",
++ big_buffer, errors_to);
++ #endif /* COMPILE_UTILITY */
++ #endif
+
+ recipients_list[recipients_count].address = string_copy(big_buffer);
+ recipients_list[recipients_count].pno = pno;
+ recipients_list[recipients_count].errors_to = errors_to;
++ #ifdef SUPPORT_DSN
++ recipients_list[recipients_count].orcpt = orcpt;
++ recipients_list[recipients_count].dsn_flags = dsn_flags;
++ #endif
+ }
+
+ /* The remainder of the spool header file contains the headers for the message,
+diff -Naur exim-4.82_RC5.orig/src/spool_out.c exim-4.82_RC5/src/spool_out.c
+--- exim-4.82_RC5.orig/src/spool_out.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/spool_out.c 2013-10-27 21:47:32.000000000 +0100
+@@ -234,6 +234,15 @@
+ if (tls_in.sni != NULL) fprintf(f, "-tls_sni %s\n", string_printing(tls_in.sni));
+ #endif
+
++#ifdef SUPPORT_DSN
++/* Write the dsn flags to the spool header file */
++DEBUG(D_deliver) debug_printf("DSN: Write SPOOL :-dsn_envid %s\n", dsn_envid);
++if (dsn_envid != NULL) fprintf(f, "-dsn_envid %s\n", dsn_envid);
++DEBUG(D_deliver) debug_printf("DSN: Write SPOOL :-dsn_ret %d\n", dsn_ret);
++if (dsn_ret != 0) fprintf(f, "-dsn_ret %d\n", dsn_ret);
++#endif
++
++
+ /* To complete the envelope, write out the tree of non-recipients, followed by
+ the list of recipients. These won't be disjoint the first time, when no
+ checking has been done. If a recipient is a "one-time" alias, it is followed by
+@@ -244,14 +253,36 @@
+ for (i = 0; i < recipients_count; i++)
+ {
+ recipient_item *r = recipients_list + i;
+- if (r->pno < 0 && r->errors_to == NULL)
++#ifdef SUPPORT_DSN
++DEBUG(D_deliver) debug_printf("DSN: Flags :%d\n", r->dsn_flags);
++#endif
++ if (r->pno < 0 && r->errors_to == NULL
++ #ifdef SUPPORT_DSN
++ && r->dsn_flags == 0
++ #endif
++ )
+ fprintf(f, "%s\n", r->address);
+ else
+ {
+ uschar *errors_to = (r->errors_to == NULL)? US"" : r->errors_to;
++ #ifdef SUPPORT_DSN
++ uschar *orcpt = (r->orcpt == NULL)? US"" : r->orcpt;
++ fprintf(f, "%s %s %s %d,%d,%d,%d!1\n", r->address, errors_to, orcpt,
++ Ustrlen(errors_to), Ustrlen(orcpt), r->pno, r->dsn_flags);
++ #else
+ fprintf(f, "%s %s %d,%d#1\n", r->address, errors_to,
+ Ustrlen(errors_to), r->pno);
++ #endif
+ }
++
++ #ifdef SUPPORT_DSN
++ DEBUG(D_deliver) debug_printf("DSN :**** SPOOL_OUT - address: |%s| errorsto: |%s| orcpt: |%s| dsn_flags: %d\n",
++ r->address, r->errors_to, r->orcpt, r->dsn_flags);
++ #endif
++ #ifndef SUPPORT_DSN
++ DEBUG(D_deliver) debug_printf("**** SPOOL_OUT - address: |%s| errorsto: |%s|\n",
++ r->address, r->errors_to);
++ #endif
+ }
+
+ /* Put a blank line before the headers */
+diff -Naur exim-4.82_RC5.orig/src/structs.h exim-4.82_RC5/src/structs.h
+--- exim-4.82_RC5.orig/src/structs.h 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/structs.h 2013-10-27 21:47:32.000000000 +0100
+@@ -282,7 +282,9 @@
+ BOOL verify_sender; /* Use this router when verifying a sender */
+ BOOL uid_set; /* Flag to indicate uid is set */
+ BOOL unseen; /* If TRUE carry on, even after success */
+-
++#ifdef SUPPORT_DSN
++ BOOL dsn_process; /* If TRUE, activate DSN for this router */
++#endif
+ int self_code; /* Encoded version of "self" */
+ uid_t uid; /* Fixed uid value */
+ gid_t gid; /* Fixed gid value */
+@@ -547,6 +549,12 @@
+ uschar *auth_id; /* auth "login" name used by transport */
+ uschar *auth_sndr; /* AUTH arg to SMTP MAIL, used by transport */
+
++ #ifdef SUPPORT_DSN
++ uschar *dsn_orcpt; /* DSN orcpt value */
++ int dsn_flags; /* DSN flags */
++ uschar *dsn_aware; /* DSN aware flag */
++ #endif
++
+ uid_t uid; /* uid for transporting */
+ gid_t gid; /* gid for transporting */
+
+diff -Naur exim-4.82_RC5.orig/src/transport.c exim-4.82_RC5/src/transport.c
+--- exim-4.82_RC5.orig/src/transport.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/transport.c 2013-10-27 21:47:32.000000000 +0100
+@@ -1802,6 +1802,11 @@
+
+ argv = child_exec_exim(CEE_RETURN_ARGV, TRUE, &i, FALSE, 0);
+
++ #ifdef SUPPORT_DSN
++ /* Call with the dsn flag */
++ if (smtp_use_dsn) argv[i++] = US"-MCD";
++ #endif
++
+ if (smtp_authenticated) argv[i++] = US"-MCA";
+
+ #ifdef SUPPORT_TLS
+diff -Naur exim-4.82_RC5.orig/src/transports/smtp.c exim-4.82_RC5/src/transports/smtp.c
+--- exim-4.82_RC5.orig/src/transports/smtp.c 2013-10-27 21:46:25.000000000 +0100
++++ exim-4.82_RC5/src/transports/smtp.c 2013-10-27 21:47:32.000000000 +0100
+@@ -242,6 +242,16 @@
+ #endif
+ };
+
++#ifdef SUPPORT_DSN
++/* some DSN flags for use later */
++
++static int rf_list[] = {rf_notify_never, rf_notify_success,
++ rf_notify_failure, rf_notify_delay };
++
++static uschar *rf_names[] = { "NEVER", "SUCCESS", "FAILURE", "DELAY" };
++#endif
++
++
+
+ /* Local statics */
+
+@@ -1079,6 +1089,27 @@
+ else if (new[0] != 0) local_authenticated_sender = new;
+ }
+
++#ifdef SUPPORT_DSN
++/* Add any DSN flags to the mail command */
++
++if (smtp_use_dsn)
++ {
++ uschar *p = buffer;
++ if (dsn_ret == dsn_ret_hdrs)
++ {
++ strcpy(p, " RET=HDRS");
++ while (*p) p++;
++ }
++ else if (dsn_ret == dsn_ret_full)
++ {
++ strcpy(p, " RET=FULL");
++ while (*p) p++;
++ }
++ if (dsn_envid != NULL)
++ string_format(p, sizeof(buffer) - (p-buffer), " ENVID=%s", dsn_envid);
++ }
++#endif
++
+ /* Add the authenticated sender address if present */
+
+ if ((smtp_authenticated || ob->authenticated_sender_force) &&
+@@ -1587,6 +1618,14 @@
+ {DEBUG(D_transport) debug_printf("PRDR usable\n");}
+ #endif
+
++ #ifdef SUPPORT_DSN
++ /* Note if the server supports DSN */
++ smtp_use_dsn = dsn &&
++ esmtp && pcre_exec(regex_DSN, NULL, CS buffer, (int)Ustrlen(CS buffer), 0,
++ PCRE_EOPT, NULL, 0) >= 0;
++ DEBUG(D_transport) debug_printf("use_dsn=%d\n", smtp_use_dsn);
++ #endif
++
+ /* Note if the response to EHLO specifies support for the AUTH extension.
+ If it has, check that this host is one we want to authenticate to, and do
+ the business. The host name and address must be available when the
+@@ -1746,18 +1785,66 @@
+ int count;
+ BOOL no_flush;
+
++ #ifdef SUPPORT_DSN
++ /* philb - set dsn_aware flag for this recipient */
++ if(smtp_use_dsn)
++ addr->dsn_aware = string_copy("Y");
++ else
++ addr->dsn_aware = string_copy("N");
++ #endif
++
+ if (addr->transport_return != PENDING_DEFER) continue;
+
+ address_count++;
+ no_flush = smtp_use_pipelining && (!mua_wrapper || addr->next != NULL);
+
++ #ifdef SUPPORT_DSN
++ /* Add any DSN flags to the rcpt command and add to the sent string */
++
++ p = buffer;
++ *p = 0;
++
++ if (smtp_use_dsn)
++ {
++ if ((addr->dsn_flags & rf_dsnflags) != 0)
++ {
++ int i;
++ BOOL first = TRUE;
++ strcpy(p, " NOTIFY=");
++ while (*p) p++;
++ for (i = 0; i < 4; i++)
++ {
++ if ((addr->dsn_flags & rf_list[i]) != 0)
++ {
++ if (!first) *p++ = ',';
++ first = FALSE;
++ strcpy(p, rf_names[i]);
++ while (*p) p++;
++ }
++ }
++ }
++
++ if (addr->dsn_orcpt != NULL)
++ string_format(p, sizeof(buffer) - (p-buffer), " ORCPT=%s",
++ addr->dsn_orcpt);
++ }
++
++ #endif
++
++
+ /* Now send the RCPT command, and process outstanding responses when
+ necessary. After a timeout on RCPT, we just end the function, leaving the
+ yield as OK, because this error can often mean that there is a problem with
+ just one address, so we don't want to delay the host. */
+
++ #ifdef SUPPORT_DSN
++ count = smtp_write_command(&outblock, no_flush, "RCPT TO:<%s>%s%s\r\n",
++ transport_rcpt_address(addr, tblock->rcpt_include_affixes), igquotstr, buffer);
++ #else
+ count = smtp_write_command(&outblock, no_flush, "RCPT TO:<%s>%s\r\n",
+ transport_rcpt_address(addr, tblock->rcpt_include_affixes), igquotstr);
++ #endif
++
+ if (count < 0) goto SEND_FAILED;
+ if (count > 0)
+ {
diff --git a/mail-mta/exim/files/exim_at.service b/mail-mta/exim/files/exim_at.service
new file mode 100644
index 00000000..19c07a51
--- /dev/null
+++ b/mail-mta/exim/files/exim_at.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Exim Mail Daemon per-connection server
+
+[Service]
+ExecStart=-/usr/bin/exim -bs
+StandardInput=socket
+StandardError=syslog
diff --git a/mail-mta/exim/metadata.xml b/mail-mta/exim/metadata.xml
new file mode 100644
index 00000000..c94ff4f9
--- /dev/null
+++ b/mail-mta/exim/metadata.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-mail</herd>
+ <maintainer>
+ <email>grobian@gentoo.org</email>
+ </maintainer>
+ <longdescription>
+ Exim is a message transfer agent (MTA) developed at the University of
+ Cambridge for use on Unix systems connected to the Internet. It is
+ freely available under the terms of the GNU General Public Licence. In
+ style it is similar to Smail 3, but its facilities are more general.
+ There is a great deal of flexibility in the way mail can be routed, and
+ there are extensive facilities for checking incoming mail. Exim can be
+ installed in place of sendmail, although the configuration of exim is
+ quite different to that of sendmail.
+ </longdescription>
+ <use>
+ <flag name='dcc'>Adds support for Distributed Checksum Clearinghouse
+ (DCC)</flag>
+ <flag name='dkim'>Adds support for DomainKeys Identified Mail
+ (DKIM)</flag>
+ <flag name='dnsdb'>Adds support for a DNS search for a record whose
+ domain name is the supplied query</flag>
+ <flag name='dovecot-sasl'>Adds support for Dovecot's
+ authentication</flag>
+ <flag name='dlfunc'>Install local_scan.h header to compile separate
+ dlfunc libraries</flag>
+ <flag name='dmarc'>Adds support for DMARC</flag>
+ <flag name='dsn'>Adds support for Delivery Status Notifications
+ (DSN)</flag>
+ <flag name='exiscan-acl'>Patch providing support for content
+ scanning</flag>
+ <flag name='lmtp'>Adds support for lmtp</flag>
+ <flag name='mbx'>Adds support for UW's mbx format</flag>
+ <flag name='spf'>Adds support for Sender Policy Framework</flag>
+ <flag name='srs'>Adds support for Sender Rewriting Scheme</flag>
+ <flag name='proxy'>Add support for being behind a proxy, such as HAProxy</flag>
+ <flag name='pkcs11'>Require pkcs11 support in <pkg>net-libs/gnutls</pkg> with USE=gnutls</flag>
+ <flag name='redis'>Adds support for querying <pkg>dev-db/redis</pkg></flag>
+ <flag name='prdr'>Adds support for Per-Recipient Data Response</flag>
+ <flag name='tpda'>Adds support for Transport Post-Delivery Actions</flag>
+ </use>
+ <upstream>
+ <bugs-to>http://bugs.exim.org/</bugs-to>
+ <!-- stupid DTD doesn't allow this
+ <vcs>http://git.exim.org/exim.git</vcs>
+ -->
+ </upstream>
+</pkgmetadata>
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest
new file mode 100644
index 00000000..fb38f61e
--- /dev/null
+++ b/media-gfx/sane-backends/Manifest
@@ -0,0 +1,13 @@
+AUX niash_array_index.patch 4141 SHA256 a44687911c10e66c1a57efe73508d1c78eed55fa2699fe7e13c62ddc7b646187 SHA512 13dcba7d609cb5fe27442918818b46dd55b3d4c65aeb3f379377671775cf28f8cd48950a0633fb3abb33db29b223798c0b00a86a029956ae0bc323edc344d28f WHIRLPOOL c93d1c770e49550eb72f82f2a48385600b806531cc4e6072fa7317515c16ac7847acb63be7d8c94592fee299e433f438a2f7db82f362d7a57e79c42a2b13940b
+AUX sane-backends-1.0.24-automagic_systemd.patch 1310 SHA256 5461cb3aa8bad1b299cd92c525cf6af5a3af5a82e81a74549a7f660d026ee610 SHA512 1edf28a2d106cf05df92a55ef3bf4ea530c9ee69a2517f14a33a5ff30ba69702d818677da1715ab19169a4d5575f1c7c2755431193d48a40d4f80d11e6308120 WHIRLPOOL 9404f9938567bec86487969fa0e1af21cf83c8aa88344983c09a2380c279c3de7b9c4bcd8a41836ffc3ab9628bfe4f8a38c0c165f5d933adefc66fb589fdf5d6
+AUX sane-backends-1.0.24-kodakaio_avahi.patch 2900 SHA256 83f2a75a379fd964e8662d61394dd61d674bfaf5d4cf13d12725af83aaa36f7e SHA512 c00c01d2b7ad1770117403373ece89b14ff58ed23b6719b01f89c381dd88a1195c6c57c1d3ca25d7036ea21128a36f14675e7bfae0e6db671db24fb4c1422674 WHIRLPOOL ee3be39baa2a33615308d1805d0c5f59ae6e1b4e72f481ef0629c71f94f4d26dbd06e2dca12a969e883f0453e07953c1bfbc8cbafc19dca16f5ec1e2c86ceaeb
+AUX sane-backends-1.0.24-saned_pidfile_location.patch 345 SHA256 c95f305d01fd0dfb63944788f450d798a8882412f1d3e6da5c7e49f33cceba51 SHA512 49519b8fea68292b8cbd7bdcaf5b4803a1b890800e17015ace1d662e4503cc0844f191793c8f42cd6aa7e9922ee9f961d4784e30f22abc497973be1978bf1b24 WHIRLPOOL d72b314c7e4898c83a4c79e6fa39af978bd60e2b78afa58c1f8e1709b5f597292e965d330a58cd4109780fb2051dcd7880008f65d2b204fe476cbf3ce898e22b
+AUX sane-backends-1.0.24-systemd_pkgconfig.patch 1324 SHA256 8a6a253e5869d0a5e9d3296b9e7525c892a74b12e25c8945fffeb52521efeaa8 SHA512 1d503302ef60e7a16d764997768a1aca3cf2a0109fc53d9c353761354aad2b34caa3dc2763c343fe1af6544021ed9c288f0e951e2d10218a80fd9d081aabb5d5 WHIRLPOOL 8e4df791a67f859d9f1893301bc238f1cf26d8568ffbfdefd7321d8e0f87ce5b079a378788af58b42f4506e15cac6bf7607410df2b54dae9b815a83b2134c28f
+AUX sane-backends-1.0.24-u_char.patch 436 SHA256 d9f7c0a88d107122427aba7c9ac83fa8023a6a660615870bc1f6e5ea0028a54d SHA512 0c697abb204d2c9d3d5b907a2d38aada096d0d0935bd904a66a32bf1cff98f5f4d1c700e9673aa946a75de53d0957bb7884b36ab5a1ea837dafd5a8e0fadf92e WHIRLPOOL 0e61a250ba31b5c4944e1f1cd22ad3c5e9b6679c7f3fcfb5075490aa90fa457e8e34db48201e4355df7d1713e5d6b0c1124203fdf997c78a5e63b00d031ab9cc
+AUX sane-backends-1.0.24-unused-cups.patch 1658 SHA256 ceb0b0809c90e8c89da70bf054c62d96a621e8a141ad2d4a9f9e48e222728376 SHA512 9c8eca84f7fe9bb4b9a80e622a577fa270f7790e84ad1cdac3894f8c6fd2f91756f14227a128c3e9252d16c16e7a51b3695c52e983871eae96d8afb2970a0296 WHIRLPOOL cd55ab0dbd86196c54e560a874e8e5c5435655c85068d35d8560fa8888dfb3bac19a4900ebfa59fde5e6a576ce3759b8bd7a61fce614872bec1afb6859cce53d
+AUX saned 150 SHA256 d18856d6dd26fac11988fea5217c8616686ad3c0c024ad5437efbf0fd24984f5 SHA512 26f3d66c6b1e75d87d7d430518aa878c77d5ab8d76a45847cef3ff15566341938eedf46c50d0fa8cdeef828df9cddefdd6fdd767c5de30d3aa7d64ed1911d910 WHIRLPOOL 5bdd707daeba740b980ce6dd51096716eec2c2939681f6abd9e7f73b50d8d384a68a07dcc11e9295cd123cc5d2a53d02def52133a559c3e33d63612028d2aac5
+AUX saned.confd 76 SHA256 197e44ba1f438a18f5f7d9f5858feb19c1ece4286d82a5e63caf9be5b964aa76 SHA512 8f4a99ef24c19b3a7213b3d25ea16f5bca8623735cf25d21e3a706e9e0135ac8cce5d0b8fb8728845977f41dcefe6bd858076d755515fc91b00e05ee5817d751 WHIRLPOOL ede920bf5eb1ee59263296a2ccce1ab2da2b04669c2f8a58de1fc4fa76cc1eee501290eb4fdaece464bc184cc0cfb17d100e9309a33d79c06142a3f03c91b837
+AUX saned.initd 411 SHA256 4dd4e7fa07bf2ab2d4f5753156f5df0ad2277523f6755b0eab3d2db3480989e2 SHA512 ec9c11c84dc405981fd854f99007a5fcae5403685894acd1d1108fc772147a54d9fad9103dcff708765efff644e972260459c19fe439af17db76562dc1b5ba84 WHIRLPOOL bec23753fc557a36a6990ed565519bb62e1bc9a6bd81c0c16cc956cd6dbc1c6fd661775b8c8bf05faa1f5bbbef2406498094a0adc48c9fd81e89f4531669c4e8
+DIST sane-backends-1.0.24.tar.gz 5778749 SHA256 27c7085a54f1505d8b551e6f1e69d30e1ee57328b18429bb2225dabf4c45462d SHA512 1e9f962bb9d27f17067eb662dabfc0a1aa0d06e16bec4bd28868124b468578d82f14f6d2c1f5de63d2cec57ca4584ec12d3b2c2b1de20f1199aece581453ebc5 WHIRLPOOL 19b939c920a3c157044c85a941debdc664d8781562fa3fc04f061b9d216b089be80edfd43479069382adf13e68160518fdbd5c84a5f4c506a46f8521d4ed2a1c
+EBUILD sane-backends-1.0.24-r99.ebuild 7662 SHA256 0d631f5ab4b58cce3c28417c02da0382f91281823202a41bc3f03a64f0ae709c SHA512 679a7ceaf6c4d621baafd2e5de968eb3f59a07cadc3d42a7f457662aee847dedc19e0213a6486223067e2cffe860ac83efadfd64c0d25d3fbab49634c26d2133 WHIRLPOOL 32840ad2b7900da0ddeaceb3256dd881f5e1318c20e92393e25acb21d34de2b42cd2f6feaaa8380ab56ee64ea79c5b0388dab7998ca2c974091abbdb6526996a
+MISC metadata.xml 233 SHA256 c5f5ebf692f6c9e98fb12ac750be2e67f8b316b820dc6d36dfa3f22fead02ca4 SHA512 76ddd2dcdfdb17b98cd96ee032935125b95ee8b78722c1049b9beaef6cf482760c6bd7791d77ef5ca52c4185a5c01222a5f874c033ec3788cce2b4906ed18682 WHIRLPOOL 30cd038d04c297199c5d1d340f3612ce5e4226c099e1272b6c3257c2f9ff61cac32b577ffbcbdee7f888f8ededa9fa6d5aec6801249b2db53586531788f39229
diff --git a/media-gfx/sane-backends/files/niash_array_index.patch b/media-gfx/sane-backends/files/niash_array_index.patch
new file mode 100644
index 00000000..236c4598
--- /dev/null
+++ b/media-gfx/sane-backends/files/niash_array_index.patch
@@ -0,0 +1,140 @@
+--- backend/niash.c 2010-12-02 00:49:58.000000000 +0100
++++ backend/niash.c.new 2011-09-21 20:09:07.000000000 +0200
+@@ -82,14 +82,7 @@
+ optThreshold,
+
+
+- optLast,
+-/* put temporarily disabled options here after optLast */
+-
+- optGroupMisc,
+- optLamp,
+-
+- optCalibrate,
+- optGamma /* analog gamma = single number */
++ optLast
+ } EOptionIndex;
+
+
+@@ -685,17 +678,6 @@
+ pDesc->size = 0;
+ break;
+
+- case optGamma:
+- pDesc->name = SANE_NAME_ANALOG_GAMMA;
+- pDesc->title = SANE_TITLE_ANALOG_GAMMA;
+- pDesc->desc = SANE_DESC_ANALOG_GAMMA;
+- pDesc->type = SANE_TYPE_FIXED;
+- pDesc->constraint_type = SANE_CONSTRAINT_RANGE;
+- pDesc->constraint.range = &rangeGamma;
+- pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
+- pVal->w = startUpGamma;
+- break;
+-
+ case optGammaTable:
+ pDesc->name = SANE_NAME_GAMMA_VECTOR;
+ pDesc->title = SANE_TITLE_GAMMA_VECTOR;
+@@ -707,31 +689,6 @@
+ pVal->wa = s->aGammaTable;
+ break;
+
+- case optGroupMisc:
+- pDesc->title = SANE_I18N ("Miscellaneous");
+- pDesc->type = SANE_TYPE_GROUP;
+- pDesc->size = 0;
+- break;
+-
+- case optLamp:
+- pDesc->name = "lamp";
+- pDesc->title = SANE_I18N ("Lamp status");
+- pDesc->desc = SANE_I18N ("Switches the lamp on or off.");
+- pDesc->type = SANE_TYPE_BOOL;
+- pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
+- /* switch the lamp on when starting for first the time */
+- pVal->w = SANE_TRUE;
+- break;
+-
+- case optCalibrate:
+- pDesc->name = "calibrate";
+- pDesc->title = SANE_I18N ("Calibrate");
+- pDesc->desc = SANE_I18N ("Calibrates for black and white level.");
+- pDesc->type = SANE_TYPE_BUTTON;
+- pDesc->cap = SANE_CAP_SOFT_SELECT;
+- pDesc->size = 0;
+- break;
+-
+ case optGroupMode:
+ pDesc->title = SANE_I18N ("Scan Mode");
+ pDesc->desc = "";
+@@ -1007,7 +964,6 @@
+ /* Get options of type SANE_Word */
+ case optCount:
+ case optDPI:
+- case optGamma:
+ case optTLX:
+ case optTLY:
+ case optBRX:
+@@ -1031,17 +987,6 @@
+ strcpy ((char *) pVal, modeList[s->aValues[optMode].w]);
+ break;
+
+- /* Get options of type SANE_Bool */
+- case optLamp:
+- GetLamp (&s->HWParams, &fLampIsOn);
+- *(SANE_Bool *) pVal = fLampIsOn;
+- break;
+-
+- case optCalibrate:
+- /* although this option has nothing to read,
+- it's added here to avoid a warning when running scanimage --help */
+- break;
+-
+ default:
+ DBG (DBG_MSG, "SANE_ACTION_GET_VALUE: Invalid option (%d)\n", n);
+ }
+@@ -1061,7 +1006,6 @@
+ case optCount:
+ return SANE_STATUS_INVAL;
+
+- case optGamma:
+ case optThreshold:
+ case optDPI:
+
+@@ -1089,15 +1033,7 @@
+ DBG (DBG_MSG,
+ "sane_control_option: SANE_ACTION_SET_VALUE %d = %d\n", n,
+ (int) s->aValues[n].w);
+- if (n == optGamma)
+- {
+- if (!fSame && optLast > optGammaTable)
+- {
+- info |= SANE_INFO_RELOAD_OPTIONS;
+- }
+- _SetScalarGamma (s->aGammaTable, s->aValues[n].w);
+- }
+- break;
++ break;
+
+ case optGammaTable:
+ DBG (DBG_MSG, "Writing gamma table\n");
+@@ -1158,20 +1094,6 @@
+ break;
+
+
+-
+- case optLamp:
+- fVal = *(SANE_Bool *) pVal;
+- DBG (DBG_MSG, "lamp %s\n", fVal ? "on" : "off");
+- if (fVal)
+- _WarmUpLamp (s, WARMUP_INSESSION);
+- else
+- SetLamp (&s->HWParams, SANE_FALSE);
+- break;
+-
+- case optCalibrate:
+-/* SimpleCalib(&s->HWParams); */
+- break;
+-
+ default:
+ DBG (DBG_ERR, "SANE_ACTION_SET_VALUE: Invalid option (%d)\n", n);
+ }
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch
new file mode 100644
index 00000000..c0dfe3c5
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch
@@ -0,0 +1,40 @@
+diff --git a/configure.in b/configure.in
+index 4365868..7413646 100644
+--- a/configure.in
++++ b/configure.in
+@@ -344,17 +344,24 @@ dnl $as_echo "in order to autodetect network scanners in kodakaio."
+ dnl with_cups="no"
+ dnl fi
+
+-dnl added by llagendijk 12/7/2012 to detect systemd for saned
+-$as_echo_n "Checking for systemd..."
+-if test -e /usr/include/systemd/sd-daemon.h ; then
+- AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
+- with_systemd="yes"
+- SYSTEMD_LIBS=" -lsystemd-daemon"
+- AC_SUBST(SYSTEMD_LIBS)
+- $as_echo "yes"
+-else
+- with_systemd="no"
+- $as_echo "no"
++AC_ARG_WITH(systemd,
++ AC_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@]))
++if test "x$with_systemd" != xno ; then
++ dnl added by llagendijk 12/7/2012 to detect systemd for saned
++ $as_echo_n "Checking for systemd..."
++ if test -e /usr/include/systemd/sd-daemon.h ; then
++ AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
++ have_systemd="yes"
++ SYSTEMD_LIBS=" -lsystemd-daemon"
++ AC_SUBST(SYSTEMD_LIBS)
++ $as_echo "yes"
++ else
++ have_systemd="no"
++ $as_echo "no"
++ if test "x$with_systemd" = xyes; then
++ AC_MSG_ERROR([Systemd support was requested but systemd was not found])
++ fi
++ fi
+ fi
+
+ dnl ***********
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch
new file mode 100644
index 00000000..e6f52ad6
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch
@@ -0,0 +1,84 @@
+diff --git a/backend/kodakaio.c b/backend/kodakaio.c
+index 8c4583a..b442e50 100644
+--- a/backend/kodakaio.c
++++ b/backend/kodakaio.c
+@@ -127,7 +127,7 @@ for ubuntu 12.10
+
+ #define KODAKAIO_VERSION 02
+ #define KODAKAIO_REVISION 4
+-#define KODAKAIO_BUILD 6
++#define KODAKAIO_BUILD 7
+
+ /* for usb (but also used for net though it's not required). */
+ #define MAX_BLOCK_SIZE 32768
+@@ -2184,6 +2184,7 @@ static void resolve_callback(
+ AvahiLookupResultFlags flags,
+ AVAHI_GCC_UNUSED void* userdata) {
+
++ AvahiStringList *vid_pair_list = NULL, *pid_pair_list = NULL;
+ char *pidkey, *pidvalue;
+ char *vidkey, *vidvalue;
+ size_t valuesize;
+@@ -2204,20 +2205,40 @@ static void resolve_callback(
+ avahi_address_snprint(a, sizeof(a), address);
+
+ /* Output short for Kodak ESP */
+- DBG(min(10,DBG_AUTO), "%s:%u %s ", a,port,host_name);
+- avahi_string_list_get_pair(avahi_string_list_find(txt, "vid"),
+- &vidkey, &vidvalue, &valuesize);
+- DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue);
+- avahi_string_list_get_pair(avahi_string_list_find(txt, "pid"),
+- &pidkey, &pidvalue, &valuesize);
+- DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue);
++ DBG(min(10,DBG_AUTO), "%s:%u %s\n", a,port,host_name);
+
++ vid_pair_list = avahi_string_list_find(txt, "vid");
++ if(vid_pair_list != NULL) {
++ avahi_string_list_get_pair(vid_pair_list, &vidkey, &vidvalue, &valuesize);
++ DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "failed to find key vid\n");
++
++ pid_pair_list = avahi_string_list_find(txt, "pid");
++ if(pid_pair_list != NULL) {
++ avahi_string_list_get_pair(pid_pair_list, &pidkey, &pidvalue, &valuesize);
++ DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "failed to find key pid\n");
++
++ if(pid_pair_list != NULL && vid_pair_list != NULL) {
+ ProcessAvahiDevice(name, vidvalue, pidvalue, a);
+- avahi_free(vidkey); avahi_free(vidvalue);
+- avahi_free(pidkey); avahi_free(pidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "didn't call ProcessAvahiDevice\n");
++
++ if(vid_pair_list != NULL) {
++ avahi_free(vidkey);
++ avahi_free(vidvalue);
++ DBG(min(15,DBG_AUTO), "vidkey and vidvalue freed\n");
++ }
++ if(pid_pair_list != NULL) {
++ avahi_free(pidkey);
++ avahi_free(pidvalue);
++ DBG(min(15,DBG_AUTO), "pidkey and pidvalue freed\n");
++ }
+ }
+ }
+-
++ DBG(min(10,DBG_AUTO), "ending resolve_callback\n");
+ avahi_service_resolver_free(r);
+ }
+
+diff --git a/doc/descriptions/kodakaio.desc b/doc/descriptions/kodakaio.desc
+index 7882513..5fb18ed 100644
+--- a/doc/descriptions/kodakaio.desc
++++ b/doc/descriptions/kodakaio.desc
+@@ -1,6 +1,6 @@
+ :backend "kodakaio"
+ :url "http://sourceforge.net/projects/cupsdriverkodak/"
+-:version "2.4.6"
++:version "2.4.7"
+ :manpage "sane-kodakaio"
+ :comment "Backend for Kodak AiO ESP and Hero printers. Also possibly Advent AWL10"
+ :devicetype :scanner
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch
new file mode 100644
index 00000000..c682961f
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch
@@ -0,0 +1,11 @@
+--- sane-backends-1.0.23/frontend/saned.c
++++ sane-backends-1.0.23/frontend/saned.c
+@@ -221,7 +221,7 @@
+ int numchildren;
+
+ #define SANED_CONFIG_FILE "saned.conf"
+-#define SANED_PID_FILE "/var/run/saned.pid"
++#define SANED_PID_FILE "/var/run/saned/saned.pid"
+
+ #define SANED_SERVICE_NAME "sane-port"
+ #define SANED_SERVICE_PORT 6566
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch
new file mode 100644
index 00000000..2d36cfae
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch
@@ -0,0 +1,37 @@
+diff --git a/configure.in b/configure.in
+index 7413646..66828fc 100644
+--- a/configure.in
++++ b/configure.in
+@@ -347,21 +347,18 @@ dnl fi
+ AC_ARG_WITH(systemd,
+ AC_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@]))
+ if test "x$with_systemd" != xno ; then
+- dnl added by llagendijk 12/7/2012 to detect systemd for saned
+- $as_echo_n "Checking for systemd..."
+- if test -e /usr/include/systemd/sd-daemon.h ; then
+- AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
+- have_systemd="yes"
+- SYSTEMD_LIBS=" -lsystemd-daemon"
+- AC_SUBST(SYSTEMD_LIBS)
+- $as_echo "yes"
+- else
+- have_systemd="no"
+- $as_echo "no"
+- if test "x$with_systemd" = xyes; then
+- AC_MSG_ERROR([Systemd support was requested but systemd was not found])
+- fi
++ PKG_CHECK_MODULES(SYSTEMD, [libsystemd], have_systemd=yes, have_systemd=no)
++ if test "x$have_systemd" = xno; then
++ PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon], have_systemd=yes, have_systemd=no)
++ fi
++ if test "x$have_systemd" = xyes; then
++ AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
++ AC_SUBST(SYSTEMD_LIBS)
++ else
++ if test "x$with_systemd" = xyes; then
++ AC_MSG_ERROR([Systemd support was requested but systemd was not found])
+ fi
++ fi
+ fi
+
+ dnl ***********
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch
new file mode 100644
index 00000000..0a353355
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch
@@ -0,0 +1,11 @@
+diff -ur a/sane-backends-1.0.24/include/sane/sanei_udp.h b/sane-backends-1.0.24/include/sane/sanei_udp.h
+--- a/sane-backends-1.0.24/include/sane/sanei_udp.h
++++ b/sane-backends-1.0.24/include/sane/sanei_udp.h
+@@ -27,6 +27,7 @@
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #endif
++#include <sys/types.h>
+
+ extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
+ extern SANE_Status sanei_udp_open_broadcast(int *fdp);
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch
new file mode 100644
index 00000000..c8ed34e8
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch
@@ -0,0 +1,42 @@
+diff --git a/configure.in b/configure.in
+index e13888c..4365868 100644
+--- a/configure.in
++++ b/configure.in
+@@ -332,17 +332,17 @@ if test -c /dev/urandom ; then
+ AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?])
+ fi
+
+-dnl added by PN 3/2/12 to detect cups
+-$as_echo "checking for cups"
+-if test -e /usr/include/cups/cups.h ; then
+- AC_DEFINE(HAVE_CUPS, 1, [Is /usr/include/cups/cups.h available?])
+- with_cups="yes"
+- LIBS="-lcups $LIBS"
+-else
+- $as_echo "cups.h not found, you may want to install a cups development package"
+- $as_echo "in order to autodetect network scanners in kodakaio."
+- with_cups="no"
+-fi
++dnl added by PN 3/2/12 to detect cups commented out 15/10/13 since avahi is now used instead
++dnl $as_echo "checking for cups"
++dnl if test -e /usr/include/cups/cups.h ; then
++dnl AC_DEFINE(HAVE_CUPS, 1, [Is /usr/include/cups/cups.h available?])
++dnl with_cups="yes"
++dnl LIBS="-lcups $LIBS"
++dnl else
++dnl $as_echo "cups.h not found, you may want to install a cups development package"
++dnl $as_echo "in order to autodetect network scanners in kodakaio."
++dnl with_cups="no"
++dnl fi
+
+ dnl added by llagendijk 12/7/2012 to detect systemd for saned
+ $as_echo_n "Checking for systemd..."
+@@ -816,7 +816,7 @@ fi
+ echo "IPv6 support: `eval eval echo ${ipv6}`"
+ echo "Avahi support: `eval eval echo ${enable_avahi}`"
+ echo "SNMP support: `eval eval echo ${with_snmp}`"
+-echo "CUPS support: `eval eval echo ${with_cups}`"
++dnl echo "CUPS support: `eval eval echo ${with_cups}`" commented out 15/10/13
+ echo "-> The following backends will be built:"
+ for backend in ${BACKENDS} ; do
+ echo $ECHO_N "${backend} "
diff --git a/media-gfx/sane-backends/files/saned b/media-gfx/sane-backends/files/saned
new file mode 100644
index 00000000..4b3e228e
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned
@@ -0,0 +1,10 @@
+service sane-port
+{
+ socket_type = stream
+ server = /usr/sbin/saned
+ protocol = tcp
+ user = saned
+ group = scanner
+ wait = no
+ disable = yes
+}
diff --git a/media-gfx/sane-backends/files/saned.confd b/media-gfx/sane-backends/files/saned.confd
new file mode 100644
index 00000000..adb1eab2
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.confd
@@ -0,0 +1,2 @@
+# The user saned should drop its privileges to after startup
+#SANED_USER=""
diff --git a/media-gfx/sane-backends/files/saned.initd b/media-gfx/sane-backends/files/saned.initd
new file mode 100644
index 00000000..26498dd7
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.initd
@@ -0,0 +1,12 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/files/saned.initd,v 1.1 2013/03/15 08:15:52 phosphan Exp $
+
+pidfile="/var/run/saned/saned.pid"
+command="/usr/sbin/saned"
+command_args="-a ${SANED_USER:-root}"
+
+start_pre() {
+ checkpath -d -o ${SANED_USER:-root} ${pidfile%/*}
+}
diff --git a/media-gfx/sane-backends/metadata.xml b/media-gfx/sane-backends/metadata.xml
new file mode 100644
index 00000000..95a1b7f6
--- /dev/null
+++ b/media-gfx/sane-backends/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>teiresias@gentoo.org</email>
+ <name>Chris Brannon</name>
+</maintainer>
+</pkgmetadata>
diff --git a/media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild b/media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild
new file mode 100644
index 00000000..7919a11e
--- /dev/null
+++ b/media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild
@@ -0,0 +1,329 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/sane-backends-1.0.24-r5.ebuild,v 1.2 2014/06/18 19:24:59 mgorny Exp $
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs
+
+# gphoto and v4l are handled by their usual USE flags.
+# The pint backend was disabled because I could not get it to compile.
+IUSE_SANE_BACKENDS="
+ abaton
+ agfafocus
+ apple
+ artec
+ artec_eplus48u
+ as6e
+ avision
+ bh
+ canon
+ canon630u
+ canon_dr
+ canon_pp
+ cardscan
+ coolscan
+ coolscan2
+ coolscan3
+ dc210
+ dc240
+ dc25
+ dell1600n_net
+ dmc
+ epjitsu
+ epson
+ epson2
+ fujitsu
+ genesys
+ gt68xx
+ hp
+ hp3500
+ hp3900
+ hp4200
+ hp5400
+ hp5590
+ hpljm1005
+ hpsj5s
+ hs2p
+ ibm
+ kodak
+ kodakaio
+ kvs1025
+ kvs20xx
+ kvs40xx
+ leo
+ lexmark
+ ma1509
+ magicolor
+ matsushita
+ microtek
+ microtek2
+ mustek
+ mustek_pp
+ mustek_usb
+ mustek_usb2
+ nec
+ net
+ niash
+ p5
+ pie
+ pixma
+ plustek
+ plustek_pp
+ pnm
+ qcam
+ ricoh
+ rts8891
+ s9036
+ sceptre
+ sharp
+ sm3600
+ sm3840
+ snapscan
+ sp15c
+ st400
+ stv680
+ tamarack
+ teco1
+ teco2
+ teco3
+ test
+ u12
+ umax
+ umax1220u
+ umax_pp
+ xerox_mfp"
+
+IUSE="avahi doc gphoto2 ipv6 threads usb v4l xinetd snmp systemd"
+
+for backend in ${IUSE_SANE_BACKENDS}; do
+ case ${backend} in
+ # Disable backends that require parallel ports as no one has those anymore.
+ canon_pp|hpsj5s|mustek_pp|\
+ pnm)
+ IUSE+=" -sane_backends_${backend}"
+ ;;
+ mustek_usb2|kvs40xx)
+ IUSE+=" sane_backends_${backend}"
+ ;;
+ *)
+ IUSE+=" +sane_backends_${backend}"
+ esac
+done
+
+REQUIRED_USE="
+ sane_backends_mustek_usb2? ( threads )
+ sane_backends_kvs40xx? ( threads )
+"
+
+DESCRIPTION="Scanner Access Now Easy - Backends"
+HOMEPAGE="http://www.sane-project.org/"
+SRC_URI="https://alioth.debian.org/frs/download.php/file/3958/${P}.tar.gz"
+
+LICENSE="GPL-2 public-domain"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+
+RDEPEND="
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
+ sane_backends_dell1600n_net? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
+ >=media-libs/tiff-3.9.7-r1[${MULTILIB_USEDEP}] )
+ avahi? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ usb? ( >=virtual/libusb-1-r1:1[${MULTILIB_USEDEP}] )
+ gphoto2? (
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
+ >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
+ )
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
+ xinetd? ( sys-apps/xinetd )
+ snmp? ( net-analyzer/net-snmp )
+ systemd? ( sys-apps/systemd:0= )
+"
+
+DEPEND="${RDEPEND}
+ v4l? ( sys-kernel/linux-headers )
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-latexextra
+ )
+ >=sys-apps/sed-4
+
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
+RDEPEND="${RDEPEND}
+ !<sys-fs/udev-114
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-medialibs-20140508
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ )"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/sane-config
+)
+
+pkg_setup() {
+ enewgroup scanner
+ enewuser saned -1 -1 -1 scanner
+}
+
+src_prepare() {
+ cat >> backend/dll.conf.in <<-EOF
+ # Add support for the HP-specific backend. Needs net-print/hplip installed.
+ hpaio
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed.
+ epkowa
+ EOF
+ epatch "${FILESDIR}"/niash_array_index.patch \
+ "${FILESDIR}"/${P}-unused-cups.patch \
+ "${FILESDIR}"/${P}-automagic_systemd.patch \
+ "${FILESDIR}"/${P}-systemd_pkgconfig.patch \
+ "${FILESDIR}"/${P}-kodakaio_avahi.patch \
+ "${FILESDIR}"/${P}-saned_pidfile_location.patch \
+ "${FILESDIR}"/${P}-u_char.patch
+ # Fix for "make check".
+ sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html*
+ AT_NOELIBTOOLIZE=yes eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # the blank is intended - an empty string would result in building ALL backends.
+ local BACKENDS=" "
+
+ use gphoto2 && BACKENDS="gphoto2"
+ use v4l && BACKENDS="${BACKENDS} v4l"
+ for backend in ${IUSE_SANE_BACKENDS}; do
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
+ BACKENDS="${BACKENDS} ${backend}"
+ fi
+ done
+
+ local myconf=(
+ $(use_enable usb libusb_1_0)
+ $(multilib_native_use_with snmp)
+ )
+
+ # you can only enable this backend, not disable it...
+ if use sane_backends_pnm; then
+ myconf+=( --enable-pnm-backend )
+ fi
+ if ! use doc; then
+ myconf+=( --disable-latex )
+ fi
+ if use sane_backends_mustek_pp; then
+ myconf+=( --enable-parport-directio )
+ fi
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
+ myconf+=( sane_cv_use_libieee1284=no )
+ fi
+ # if LINGUAS is set, just use the listed and supported localizations.
+ if [ "${LINGUAS-NoLocalesSet}" != NoLocalesSet ]; then
+ mkdir -p po || die
+ echo > po/LINGUAS
+ for lang in ${LINGUAS}; do
+ if [ -a "${S}"/po/${lang}.po ]; then
+ echo ${lang} >> po/LINGUAS
+ fi
+ done
+ fi
+
+ # relative path must be used for tests to work properly
+ ECONF_SOURCE=../${P} \
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
+ BACKENDS="${BACKENDS}" \
+ econf \
+ $(use_with gphoto2) \
+ $(multilib_native_use_with systemd) \
+ $(use_with v4l) \
+ $(use_enable avahi) \
+ $(use_enable ipv6) \
+ $(use_enable threads pthread) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake VARTEXFONTS="${T}/fonts"
+
+ if use usb; then
+ cd tools/hotplug || die
+ sed -i -e '/^$/d' libsane.usermap || die
+ fi
+
+ if tc-is-cross-compiler; then
+ # The build system sucks and doesn't handle this properly.
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
+ tc-export_build_env BUILD_CC
+ cd "${BUILD_DIR}"/tools || die
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} -I. -I../include -I"${S}"/include \
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
+ local dirs=( hal hotplug hotplug-ng udev )
+ local targets=(
+ hal/libsane.fdi
+ hotplug/libsane.usermap
+ hotplug-ng/libsane.db
+ udev/libsane.rules
+ )
+ mkdir -p "${dirs[@]}" || die
+ emake "${targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
+ docdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ if multilib_is_native_abi; then
+ if use usb; then
+ insinto /etc/hotplug/usb
+ doins tools/hotplug/libsane.usermap
+ fi
+
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules
+ insinto "/usr/share/pkgconfig"
+ doins tools/sane-backends.pc
+ fi
+}
+
+multilib_src_install_all() {
+ keepdir /var/lib/lock/sane
+ fowners root:scanner /var/lib/lock/sane
+ fperms g+w /var/lib/lock/sane
+ dodir /etc/env.d
+
+ if use usb; then
+ exeinto /etc/hotplug/usb
+ doexe tools/hotplug/libusbscanner
+ newdoc tools/hotplug/README README.hotplug
+ fi
+
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux
+ prune_libtool_files --all
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ doins "${FILESDIR}"/saned
+ fi
+
+ newinitd "${FILESDIR}"/saned.initd saned
+ newconfd "${FILESDIR}"/saned.confd saned
+}
+
+pkg_postinst() {
+ if use xinetd; then
+ elog "If you want remote clients to connect, edit"
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
+ fi
+
+ elog "If you are using a USB scanner, add all users who want"
+ elog "to access your scanner to the \"scanner\" group."
+}
diff --git a/media-libs/alsa-lib/Manifest b/media-libs/alsa-lib/Manifest
new file mode 100644
index 00000000..0dcd29dd
--- /dev/null
+++ b/media-libs/alsa-lib/Manifest
@@ -0,0 +1,7 @@
+AUX alsa-lib-1.0.25-pcm-h.patch 1177 SHA256 e6525c81b77f5b5ba48ce2ba16be2622f54a7090e1268be5f5198e2490c9cf45 SHA512 de62a1a1bfed51fc0482a145ed5fce7451b314a84a8c616f2af5f5e1f033da78f2a7800dc0b0921022d934efba110598a9d98d846c71b7861f2867c04093def2 WHIRLPOOL 395ccc8faa5bc59cee8f442224ddee9d1908c24918fd1bdfdd041454eaead4ba1f3e0895bf6d55f1ccbd92378bdc08e6681040ea01c713413aacbf500e008000
+AUX alsa-lib-1.0.27.1-musl.patch 965 SHA256 f0f7079e38691bbb65418b097c4c66de2837237d33f0873b2403eca9145b7489 SHA512 6cee79a298214c3a541cb5f523ed44957b169b8bef14d47792cc1f17b0887ae59018097e150c602fef4e70e486da983d495499916691dd7e5e0b512c6e194051 WHIRLPOOL 52767ab59ea59a127fac6470c6b0a843bcba9389b5b34ba5133f91f1b5d70e7b06846e9ae1d4ca73791a98cdc4be17ee6948ae0ea51d80733b69567fd93c532d
+AUX alsa-lib-1.0.27.1-rewind.patch 1514 SHA256 b13b1758f1d54cae12510ccfc29ae3ccca0ab8e7ff97798d1de834a30f252fea SHA512 67b38120d4d8be74fecf55af639fb1a3c9c118f1f0b1c55eee81b65693d1fee753c02eea6cabdd0273299d0c6af6e155a91e88efb900040c3069901fc8b2774e WHIRLPOOL fc6adbb7f833efaabfd40f3a4b76f27d1f5a7afdd02ca2b405a91ebf3f483fa03078710223116e0e1f1f2e273c8e26df9a5d5747db247b3bbbb617f9ff893cfc
+AUX alsa-lib-1.0.27.2-portable-mutex.patch 894 SHA256 a26d381704f336fef02de6d8413434c56b6cc1401f30d66c10f5602cfd4ec523 SHA512 e4fa707e714fe61628da3cb42adf9c69edfdde48ea034dd72ec34def26b9918f61000ab2343cffe97a55c275a3db0c8b0e7173bfc4c64a5eb74b1887ff4126dc WHIRLPOOL 2b611d0737b9e57fe8a3f089e2ea81ee69e923c8168e17758565601cb94d31616908496fa4073cb0bd8687e8ef2b0fa303f52404469b64f4844c96a8962e1958
+DIST alsa-lib-1.0.27.1.tar.bz2 906234 SHA256 690e07a3ef6270d40ed2130638dba3c18395aae8db4a109bcc473643ce29a03b SHA512 546a52c5c23d51e3a49a36565c0bdda98efc3bbe8ba217c72cfb6986b0e1a6104a3040bc223a74966139416ce39709421a3131f3edb29362a3f949b0ae939909 WHIRLPOOL 485a5b260edc208776ca553d13065d242f1266e38b25dab252596fc8d4c9c3482d11fd3e472c7c96c97b396718a715ca12f36c76635bd069ebe09edc6815693f
+EBUILD alsa-lib-1.0.27.1-r99.ebuild 1953 SHA256 4ea3f30026bc63720345cd2a8b0c1553c06d58e253675bb37df59155601e852d SHA512 25fea6eeba3366a639eda1cd1c6d8ac51d2545553c3454ccb4ddeea17928236a47a830877b641091cb019670ca33d219867bc67b6a64018b17f571dacff9f563 WHIRLPOOL 46c3c5ed70df92ed41e1c4af461a468b632402d7947d429ef30b326cd22c4af81e6397b349be8c551e05fc097be1bc4262b31e7274340612a2db56ef6c7534d1
+MISC metadata.xml 443 SHA256 2c3e6e0b3b3cfb7d4cd1b35cb092bc3e0fb60688f7aaedc29133408d00437fba SHA512 ba3c80c882e081177bf371ebd8d8fa3696f0cdd8c214333f4a5515e7d2997884ffddb56559ce51e818fdf8516af0529eaed01e6048f582feddc701d9f27bdb30 WHIRLPOOL 8537995f235dbfaf3c242868af177df5199762de1842f0f7085388dbe86e7821ffe137bb3ea6591d45a36bed5499128e7724a8675bff124b676994e723062a2b
diff --git a/media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild b/media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild
new file mode 100644
index 00000000..0967bf4d
--- /dev/null
+++ b/media-libs/alsa-lib/alsa-lib-1.0.27.1-r99.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27.1.ebuild,v 1.15 2013/09/01 18:36:03 ago Exp $
+
+EAPI=5
+
+# no support for python3_2 or above yet wrt #471326
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils multilib python-single-r1
+
+DESCRIPTION="Advanced Linux Sound Architecture Library"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/lib/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="doc debug alisp python"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ doc? ( >=app-doc/doxygen-1.2.6 )"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ find . -name Makefile.am -exec sed -i -e '/CFLAGS/s:-g -O2::' {} + || die
+ # force use of correct python-config wrt #478802
+ if [[ ${ABI} == ${DEFAULT_ABI} ]]; then
+ use python && { sed -i -e "s:python-config:$EPYTHON-config:" configure.in || die; }
+ fi
+ epatch "${FILESDIR}"/${P}-rewind.patch #477282
+ epatch "${FILESDIR}"/${P}-musl.patch
+ epatch "${FILESDIR}"/${PN}-1.0.25-pcm-h.patch
+ epatch "${FILESDIR}"/${PN}-1.0.27.2-portable-mutex.patch
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ use elibc_uclibc && myconf="--without-versioned"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-maintainer-mode \
+ --enable-shared \
+ --disable-resmgr \
+ --enable-rawmidi \
+ --enable-seq \
+ --enable-aload \
+ $(use_with debug) \
+ $(use_enable alisp) \
+ $(use_enable python) \
+ ${myconf}
+}
+
+src_compile() {
+ emake
+
+ if use doc; then
+ emake doc
+ fgrep -Zrl "${S}" doc/doxygen/html | \
+ xargs -0 sed -i -e "s:${S}::"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ if use doc; then
+ dohtml -r doc/doxygen/html/.
+ fi
+ prune_libtool_files --all
+ find "${ED}"/usr/$(get_libdir)/alsa-lib -name '*.a' -exec rm -f {} +
+ dodoc ChangeLog doc/asoundrc.txt NOTES TODO
+}
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch
new file mode 100644
index 00000000..7d6dc135
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.25-pcm-h.patch
@@ -0,0 +1,27 @@
+taken from sabotage linux
+
+--- alsa-lib-1.0.25/include/pcm.h
++++ alsa-lib-1.0.25.patched/include/pcm.h
+@@ -33,6 +33,7 @@
+ extern "C" {
+ #endif
+
++#include <stdint.h>
+ /**
+ * \defgroup PCM PCM Interface
+ * See the \ref pcm page for more details.
+@@ -941,10 +942,10 @@
+ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
+ snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian);
+ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
+-u_int8_t snd_pcm_format_silence(snd_pcm_format_t format);
+-u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
+-u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
+-u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
++uint8_t snd_pcm_format_silence(snd_pcm_format_t format);
++uint16_t snd_pcm_format_silence_16(snd_pcm_format_t format);
++uint32_t snd_pcm_format_silence_32(snd_pcm_format_t format);
++uint64_t snd_pcm_format_silence_64(snd_pcm_format_t format);
+ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples);
+
+ snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes);
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch
new file mode 100644
index 00000000..0521fe0c
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-musl.patch
@@ -0,0 +1,24 @@
+diff -ur a/alsa-lib-1.0.27.1/configure.in b/alsa-lib-1.0.27.1/configure.in
+--- a/alsa-lib-1.0.27.1/configure.in 2013-05-21 08:48:28.000000000 +0000
++++ b/alsa-lib-1.0.27.1/configure.in 2014-02-16 21:04:29.833236371 +0000
+@@ -64,7 +64,7 @@
+
+ dnl Checks for library functions.
+ AC_PROG_GCC_TRADITIONAL
+-AC_CHECK_FUNC([hsearch_r], [HAVE_HSEARCH_R=yes])
++AC_CHECK_FUNC([hsearch], [HAVE_HSEARCH_R=yes])
+ AM_CONDITIONAL([ALSA_HSEARCH_R], [test "x$HAVE_HSEARCH_R" != xyes])
+ AC_CHECK_FUNCS([uselocale])
+
+diff -ur a/alsa-lib-1.0.27.1/include/global.h b/alsa-lib-1.0.27.1/include/global.h
+--- a/alsa-lib-1.0.27.1/include/global.h 2013-05-21 08:48:28.000000000 +0000
++++ b/alsa-lib-1.0.27.1/include/global.h 2014-02-16 20:08:10.954478169 +0000
+@@ -133,7 +133,7 @@
+
+ int snd_user_file(const char *file, char **result);
+
+-#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE)
++#if 0
+ struct timeval {
+ time_t tv_sec; /* seconds */
+ long tv_usec; /* microseconds */
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch
new file mode 100644
index 00000000..f5856456
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.27.1-rewind.patch
@@ -0,0 +1,40 @@
+From f2d39afe6139ab16aa2aeea0f51f32db79ab1262 Mon Sep 17 00:00:00 2001
+From: David Henningsson <david.henningsson@canonical.com>
+Date: Thu, 30 May 2013 12:26:34 +0200
+Subject: [PATCH] pcm_plugin: Fix return value of snd_pcm_rewind
+
+In case the rewind did not rewind as much as expected, e g due to
+time delay between the latest avail update and the rewind, we must
+properly account for that in the plugin layer.
+
+Otherwise, the plugin's appl ptr and the hw's appl ptr become
+unsynchronised, which is very bad, especially in mmap_shadow plugins,
+e g, this could cause the overlapping memcpy in the softvol plugin
+as seen here:
+https://bugs.freedesktop.org/show_bug.cgi?id=64299
+
+Signed-off-by: David Henningsson <david.henningsson@canonical.com>
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+---
+ src/pcm/pcm_plugin.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
+index 96218a8..17157e8 100644
+--- a/src/pcm/pcm_plugin.c
++++ b/src/pcm/pcm_plugin.c
+@@ -219,9 +219,9 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
+ snd_atomic_write_end(&plugin->watom);
+ return sframes;
+ }
+- snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
++ snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) sframes);
+ snd_atomic_write_end(&plugin->watom);
+- return (snd_pcm_sframes_t) frames;
++ return (snd_pcm_sframes_t) sframes;
+ }
+
+ static snd_pcm_sframes_t snd_pcm_plugin_forwardable(snd_pcm_t *pcm)
+--
+1.7.11.7
+
diff --git a/media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch b/media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch
new file mode 100644
index 00000000..c4f90d28
--- /dev/null
+++ b/media-libs/alsa-lib/files/alsa-lib-1.0.27.2-portable-mutex.patch
@@ -0,0 +1,35 @@
+taken from sabotage linux
+
+--- alsa-lib-1.0.27.2.orig/src/conf.c
++++ alsa-lib-1.0.27.2/src/conf.c
+@@ -427,8 +427,8 @@
+ #ifndef DOC_HIDDEN
+
+ #ifdef HAVE_LIBPTHREAD
+-static pthread_mutex_t snd_config_update_mutex =
+- PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
++static pthread_mutex_t snd_config_update_mutex;
++static pthread_once_t snd_config_update_mutex_once = PTHREAD_ONCE_INIT;
+ #endif
+
+ struct _snd_config {
+@@ -472,8 +472,19 @@
+
+ #ifdef HAVE_LIBPTHREAD
+
++static void snd_config_init_mutex(void)
++{
++ pthread_mutexattr_t attr;
++
++ pthread_mutexattr_init(&attr);
++ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
++ pthread_mutex_init(&snd_config_update_mutex, &attr);
++ pthread_mutexattr_destroy(&attr);
++}
++
+ static inline void snd_config_lock(void)
+ {
++ pthread_once(&snd_config_update_mutex_once, snd_config_init_mutex);
+ pthread_mutex_lock(&snd_config_update_mutex);
+ }
+
diff --git a/media-libs/alsa-lib/metadata.xml b/media-libs/alsa-lib/metadata.xml
new file mode 100644
index 00000000..0ea67aec
--- /dev/null
+++ b/media-libs/alsa-lib/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>alsa</herd>
+ <maintainer>
+ <email>alsa-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="alisp">Enable support for ALISP (ALSA LISP) interpreter for advanced features.</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:alsa-project:alsa-lib</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-libs/libmpdclient/Manifest b/media-libs/libmpdclient/Manifest
new file mode 100644
index 00000000..4a695954
--- /dev/null
+++ b/media-libs/libmpdclient/Manifest
@@ -0,0 +1,4 @@
+AUX libmpdclient-2.9-missing_headers.patch 425 SHA256 5c67b0fe86223661ad40022a40321e6f2779bd2d984efb2f889645cb9d605266 SHA512 a43aba9b23a4aa06066ddd84bc606a4fd5b64ef3a4815f5bf63b67d02394ef22c76e36da23b5d9678fb9c17aebf7441eaf1483b0c3e285b7f43d3b186666d7e3 WHIRLPOOL 2f4a01ff43f986359d8bce29041dc2d06e7e3c30befde1766c5f9361914a40169ed72189dfe490813376594a6a4db52111186aacf90558f0bdca456cf5b9ccea
+DIST libmpdclient-2.9.tar.xz 253992 SHA256 7cc97ba560e91addafe5975f7e7da04b95d6710750e47b3367fa0d8c3b7699ca SHA512 7e6af51e31a3319e6681dfe5199fda1b2c1482f6aa6854af7c7f02c999fbbeae4f369c9b157abf95402c7f022d155109454b243549185ba791df5b2457baaba4 WHIRLPOOL d4d78a83bfa300be8df37e321c3b8ed535bd7342acc1ec371a2aa59a76efde79a9c4531bc8052c5d0c2c423d808f23b2e5d3b92ccf5c9dec4f2a120b615a4992
+EBUILD libmpdclient-2.9-r99.ebuild 1031 SHA256 20d41659f5e78e1a3cfc856d273a88ef6b73160353b2ed50831122e80b6996b8 SHA512 b9f2dbbaf3014a56dc91ee54c0faa43d6236d9bba84a02759afac6a8771f11c9093076fcf0474ab71c989dc3423e7ad7380828f32faa64bbd61b3f0c34aeeaa5 WHIRLPOOL 2cf5f6fef059dbef4531e268d1555a94150f075149cb438cfa898ef65e00c510171f42c62b0b4ed9cd78b56bf22ee1d378fe61e7cd4ad1bad9623ff1c4eb1881
+MISC metadata.xml 255 SHA256 424482131b9475b8217fb609dc705806689e6927c93a7e6428437e30bde46f1c SHA512 d9bf9555ce80d32a1f3440e44cc1dfbadeeeb442e0722fa8bd6b90fa8cdcf31f7be8cb31acee92a94ae6ec63e79ea325917e2965b3dd6b34831651ad097fc57f WHIRLPOOL 9524e80335c42df064511f211bc84b8943626e5c98fdb2b186cac973bc980e406d378f2bbfac1616ff9134fe3e250872087437460e1f28350d3ac5f96b69bcfb
diff --git a/media-libs/libmpdclient/files/libmpdclient-2.9-missing_headers.patch b/media-libs/libmpdclient/files/libmpdclient-2.9-missing_headers.patch
new file mode 100644
index 00000000..cd1b3847
--- /dev/null
+++ b/media-libs/libmpdclient/files/libmpdclient-2.9-missing_headers.patch
@@ -0,0 +1,20 @@
+--- a/libmpdclient-2.9/src/socket.c
++++ b/libmpdclient-2.9/src/socket.c
+@@ -36,6 +36,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <sys/select.h>
+
+ #ifdef WIN32
+ # include <winsock2.h>
+--- a/libmpdclient-2.9/src/sync.c
++++ b/libmpdclient-2.9/src/sync.c
+@@ -35,6 +35,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <sys/select.h>
+
+ static bool
+ ignore_errno(int e)
diff --git a/media-libs/libmpdclient/libmpdclient-2.9-r99.ebuild b/media-libs/libmpdclient/libmpdclient-2.9-r99.ebuild
new file mode 100644
index 00000000..045a1dfe
--- /dev/null
+++ b/media-libs/libmpdclient/libmpdclient-2.9-r99.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libmpdclient/libmpdclient-2.9.ebuild,v 1.8 2014/01/26 12:15:37 ago Exp $
+
+EAPI=4
+inherit eutils
+
+DESCRIPTION="A library for interfacing Music Player Daemon (media-sound/mpd)"
+HOMEPAGE="http://www.musicpd.org"
+SRC_URI="http://www.musicpd.org/download/${PN}/${PV%.*}/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="doc examples static-libs"
+
+RDEPEND=""
+DEPEND="doc? ( app-doc/doxygen )"
+
+src_prepare() {
+ sed -e "s:@top_srcdir@:.:" -i doc/doxygen.conf.in
+
+ epatch ${FILESDIR}/${P}-missing_headers.patch
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ $(use_enable static-libs static) \
+ $(use_enable doc documentation)
+}
+
+src_install() {
+ default
+ use examples && dodoc src/example.c
+ use doc || rm -rf "${ED}"/usr/share/doc/${PF}/html
+ find "${ED}" -name "*.la" -exec rm -rf {} + || die "failed to delete .la files"
+}
diff --git a/media-libs/libmpdclient/metadata.xml b/media-libs/libmpdclient/metadata.xml
new file mode 100644
index 00000000..f939777e
--- /dev/null
+++ b/media-libs/libmpdclient/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>sound</herd>
+ <maintainer>
+ <email>angelos@gentoo.org</email>
+ <name>Christoph Mende</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/media-libs/libv4l/Manifest b/media-libs/libv4l/Manifest
new file mode 100644
index 00000000..bcbfc590
--- /dev/null
+++ b/media-libs/libv4l/Manifest
@@ -0,0 +1,5 @@
+AUX libv4l-1.0.0-configure.patch 1260 SHA256 f66fec7cfdb7949b4586237212479fd6bcb7ce6ca5a914b46e2501c835a98157 SHA512 bf566845bd7a396dc79160415c76428022b8cdfe9cf30447e9e9c039351a870badc7f7c7f5b1895f971e42ca8f447e2dbd286345991fcd44c0cb3eeb4906c4d8 WHIRLPOOL e573bde3807672428c2b2779eaff1ad620650d139ac1fe1f93ce4b41bcb1d37004076bd6156089ccc10763c0c309eecc4f8244ac6651014f0094035b8a86ed23
+AUX libv4l-1.0.0-off_t.patch 455 SHA256 8d6a072021c93621815565132cc6138a98c2f5ccf6748d04798fce88a6520c70 SHA512 4300d14693735a84fe08041d89792479f64cebd4f3db90cdf3add86b6570796444acd5384f57692d0765c215d321ec61c1f0c730a9782f9c211ef9a079735e62 WHIRLPOOL f4e6eb716dcf59fd10ab043f227d4397ee9a6b751fa06ffee08df48ed5d63fe56d189f1e22c55e056ef264aeafb105de99a0996cf0b13d0578ac91f84cc294ec
+DIST v4l-utils-1.0.0.tar.bz2 963427 SHA256 1de3882099e04e89e354675ee408b82c8ac8afd3ca6ab27ea321771901285f30 SHA512 19e31167015623f50f93dc27becb8f053ca7488ffc41e275c195cb46af63671a0cec6cecea71d90a43b3b01b47f6e6cc2f44517dddd3c2c376bb1d82f770117e WHIRLPOOL 133d85232457545a828e783ca503d368a5da814ab51d70648ef9a727947a21a07bf82e8ebdcbc48b4fc9a139bdff22c73f0dd1ad666cf8f8a051f7df93e4f2fe
+EBUILD libv4l-1.0.0-r99.ebuild 1567 SHA256 c5c0e4782b1ff2715ae8ada2e564bf81c9c90823484d25438bd8c29758bbb6ae SHA512 cd146eebb9170b1a330999eb069092ff6582f81023c1ccdd6173cbf0b40b2964d3371274f7119430514bfac91e12bf38f546a9540d36cbdbcbc386c9227341bd WHIRLPOOL a41038a311f46dceba86abb9132f68118819952c0e0c8245f28f64b7180116aca16d3e6c9a7ff4ebc27f8944e9d269040404273f49a9f0e8d5afc9cc01e1faa0
+MISC metadata.xml 1135 SHA256 3aa2704309b6a8c6c1d407871f5765ae9a35875f83ea140f24d67639f1926c1e SHA512 e051f1b40363405e66d863331f965e643722474eb83250a998a4d920b86ab615d217e1aff251651b2b70aecf938708a5d7669fab21e8586b5c95472edf35042a WHIRLPOOL dd1ccf47f383388c51c6ac1e904a05e569dcec6473728c5464d6424aed5676c82d498126958254c14b70dbaf3ef7be1a23bc36d098dd7e50ff3a07c502455fa6
diff --git a/media-libs/libv4l/files/libv4l-1.0.0-configure.patch b/media-libs/libv4l/files/libv4l-1.0.0-configure.patch
new file mode 100644
index 00000000..d9437e6b
--- /dev/null
+++ b/media-libs/libv4l/files/libv4l-1.0.0-configure.patch
@@ -0,0 +1,27 @@
+--- a/v4l-utils-1.0.0/configure.ac
++++ b/v4l-utils-1.0.0/configure.ac
+@@ -144,15 +144,6 @@
+ AC_SUBST([DLOPEN_LIBS])
+ LIBS=$dl_saved_libs
+
+-AC_CHECK_HEADER([argp.h],,AC_MSG_ERROR(Cannot continue: argp.h not found))
+-argp_saved_libs=$LIBS
+- AC_SEARCH_LIBS([argp_parse],
+- [argp],
+- [test "$ac_cv_search_argp_parse" = "none required" || ARGP_LIBS=$ac_cv_search_argp_parse],
+- [AC_MSG_ERROR([unable to find the argp_parse() function])])
+- AC_SUBST([ARGP_LIBS])
+-LIBS=$argp_saved_libs
+-
+ AC_CHECK_HEADER([linux/i2c-dev.h], [linux_i2c_dev=yes], [linux_i2c_dev=no])
+ AM_CONDITIONAL([HAVE_LINUX_I2C_DEV], [test x$linux_i2c_dev = xyes])
+
+@@ -238,7 +229,7 @@
+ AM_CONDITIONAL([WITH_V4LUTILS], [test x$enable_v4lutils != xno])
+ AM_CONDITIONAL([WITH_QV4L2], [test ${qt_pkgconfig} = true -a x$enable_qv4l2 != xno])
+ AM_CONDITIONAL([WITH_V4L_PLUGINS], [test x$enable_libv4l != xno -a x$enable_shared != xno])
+-AM_CONDITIONAL([WITH_V4L_WRAPPERS], [test x$enable_libv4l != xno -a x$enable_shared != xno])
++AM_CONDITIONAL([WITH_V4L_WRAPPERS], [false])
+
+ # append -static to libtool compile and link command to enforce static libs
+ AS_IF([test x$enable_libdvbv5 != xyes], [AC_SUBST([ENFORCE_LIBDVBV5_STATIC], ["-static"])])
diff --git a/media-libs/libv4l/files/libv4l-1.0.0-off_t.patch b/media-libs/libv4l/files/libv4l-1.0.0-off_t.patch
new file mode 100644
index 00000000..4fdd6329
--- /dev/null
+++ b/media-libs/libv4l/files/libv4l-1.0.0-off_t.patch
@@ -0,0 +1,11 @@
+--- a/v4l-utils-1.0.0/lib/libv4lconvert/libv4lsyscall-priv.h
++++ b/v4l-utils-1.0.0/lib/libv4lconvert/libv4lsyscall-priv.h
+@@ -99,7 +99,7 @@
+ #else
+ #define SYS_MMAP(addr, len, prot, flags, fd, off) \
+ syscall(SYS_mmap2, (void *)(addr), (size_t)(len), \
+- (int)(prot), (int)(flags), (int)(fd), (__off_t)((off) >> MMAP2_PAGE_SHIFT))
++ (int)(prot), (int)(flags), (int)(fd), (off_t)((off) >> MMAP2_PAGE_SHIFT))
+ #endif
+
+ #define SYS_MUNMAP(addr, len) \
diff --git a/media-libs/libv4l/libv4l-1.0.0-r99.ebuild b/media-libs/libv4l/libv4l-1.0.0-r99.ebuild
new file mode 100644
index 00000000..51985fbf
--- /dev/null
+++ b/media-libs/libv4l/libv4l-1.0.0-r99.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libv4l/libv4l-1.0.0.ebuild,v 1.6 2014/07/28 13:46:11 ago Exp $
+
+EAPI=5
+inherit eutils linux-info udev multilib-minimal autotools
+
+MY_P=v4l-utils-${PV}
+
+DESCRIPTION="Separate libraries ebuild from upstream v4l-utils package"
+HOMEPAGE="http://git.linuxtv.org/v4l-utils.git"
+SRC_URI="http://linuxtv.org/downloads/v4l-utils/${MY_P}.tar.bz2"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE=""
+
+# The libraries only link to -ljpeg, therefore multilib depend only for virtual/jpeg.
+RDEPEND=">=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ virtual/glu
+ virtual/opengl
+ x11-libs/libX11:=
+ !media-tv/v4l2-ctl
+ !<media-tv/ivtv-utils-1.4.0-r2
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20130224-r5
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}
+ sys-devel/gettext
+ virtual/os-headers
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ CONFIG_CHECK="~SHMEM"
+ linux-info_pkg_setup
+}
+
+src_prepare() {
+ epatch ${FILESDIR}/${P}-configure.patch
+ epatch ${FILESDIR}/${P}-off_t.patch
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-static \
+ --disable-qv4l2 \
+ --disable-v4l-utils \
+ --with-udevdir="$(get_udevdir)"
+}
+
+multilib_src_compile() {
+ emake -C lib
+}
+
+multilib_src_install() {
+ emake -j1 -C lib DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ dodoc ChangeLog README.lib* TODO
+ prune_libtool_files --all
+}
diff --git a/media-libs/libv4l/metadata.xml b/media-libs/libv4l/metadata.xml
new file mode 100644
index 00000000..1e04bfc3
--- /dev/null
+++ b/media-libs/libv4l/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>media-tv</herd>
+ <maintainer>
+ <email>tetromino@gentoo.org</email>
+ <name>Alexandre Rostovtsev</name>
+ </maintainer>
+ <longdescription lang="en">
+ libv4l is a collection of libraries which adds a thin abstraction layer on
+ top of video4linux2 devices. The purpose of this (thin) layer is to make it
+ easy for application writers to support a wide variety of devices without
+ having to write separate code for different devices in the same class.
+
+ libv4l consists of 3 different libraries: libv4lconvert, libv4l1 and libv4l2.
+
+ libv4lconvert offers functions to convert from any (known) pixelformat
+ to V4l2_PIX_FMT_BGR24 or V4l2_PIX_FMT_YUV420.
+
+ libv4l1 offers the (deprecated) v4l1 API on top of v4l2 devices, independent
+ of the drivers for those devices supporting v4l1 compatibility (which many
+ v4l2 drivers do not).
+
+ libv4l2 offers the v4l2 API on top of v4l2 devices, while adding for the
+ application transparent libv4lconvert conversion where necessary.
+ </longdescription>
+</pkgmetadata>
+
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
new file mode 100644
index 00000000..9f97337e
--- /dev/null
+++ b/media-libs/mesa/Manifest
@@ -0,0 +1,10 @@
+AUX eselect-mesa.conf.8.1 1622 SHA256 a7a4306084885dc624304a8893ca4f5645f7f1fe31322f9fb663e5a103f69221 SHA512 58eacf1304ebaa0116ea3c53fafdddb8c94738e31daad8546ac33b46dc51b81a6bccb48c167afe792c7fd41ca5054d8e66123f524b0623ad3e603ed4872f9dc4 WHIRLPOOL 7af55e3cb9448f4b3b4c463443e078a5559588371767e10b5890918d84bfeb16797f11ffabf9aaa205db70c550c5dfc18fe709b3a2e00746d93d4bf4944124b1
+AUX eselect-mesa.conf.9.2 1676 SHA256 bcf5f77140b4695f147d4cd3c2db4b954fb57eccfd4475c7f7c4866edda8436e SHA512 d0061359638c0d9729ba1035fd7740c84d59f538adc11af2ee671b5ddbc83c420159efbefcc39ea680f06d20507f1e1d76b528712a07baeca901a413ba7b55df WHIRLPOOL 0fc650223a1910305bb2c4b7b946ac8b83b5b1ba0b79b586a96303a369b30c9c03dc658a6e8e9a29c5c4605f3865e245be0a0e6a27c40ac37402e8a2616b3ace
+AUX glx_ro_text_segm.patch 731 SHA256 e36af5b530fdbe2b0e62a035bf4bf4baef267c3dc56133d1a58e56899ebffc5c SHA512 90d04d1268cc90e1c5596b49b143895eba99d4e7f7d9bb5f699725c1308e3995edac44e3f61536c7ce70ebf5df84a5a22c18fa84fb54fbddb339f908975bb43c WHIRLPOOL 42171ef67930bebdcfdfcb0c9370234791c6125be760b6419abfff44bd65899982167d6da4d6eb4198383438e6376b4b695109af158083b903071c545160d883
+AUX mesa-10-pthread.patch 695 SHA256 a355933736a39ce9b0e26412ac940377fc6b3eeb25737c53bf8d767fe34c5367 SHA512 7850b543fb8413b9abf65ab884588eb7b15782122253bc9f4baee8735775bfd6bade42c386f295c20c7d43484d9ce82597cf82c8bca97433ccec8816386cc275 WHIRLPOOL ad2b5163a556733f8772ab9bce0ea452ac8373c96dc9be82ab1cf7dd7c59eea9fc7bed90786f1e3237e1639852785ed836f42bcaed78447355a6693501c9560f
+AUX mesa-10.2-dont-require-llvm-for-r300.patch 547 SHA256 83cfeae33b1e8c84b37ed59c353000eb775978ae3d9035ba8ce4f63a167756fc SHA512 d1cb5a989aa001c99f353d27ab5b28ac05d60050614bbfd76ca5d312e00efcc2b1a2459d30d697b68119310c69512b4195afce6c0ed7f31fb9cf14689a740e27 WHIRLPOOL c06669942d275a9d9f132ec8f51d3ecf23d33cb89cb607ba3a7861f209f283b39a9568513b07e22f0dfcc99339a307d7b2a6b03f261ed583fd4518d3b4d0b464
+AUX mesa-10.3.7-dont-use-clrsb.patch 1140 SHA256 23626c6bf1e502f17f4b9236b512063b41bf52be64f56252f0fc5ce456824d58 SHA512 2d9dd9a56c3bab02e8ec1a1ab4d88c2855746d8243548f197cb43de6e980554447c75e53c07dcd270de7e1c282cf7fdf996e5102a24e47b75e484a18f99092e0 WHIRLPOOL 47b222fb61427bbe2a63ac4b738608e9c3491e6373c33e1d68c79198a111d7668b4cafbac9e58820e8cefae55dffca46ab57dbe91ad819feeb734c32f01020f0
+AUX mesa-9.1.6-fpclassify.patch 618 SHA256 b02df9b6850d46d251dd51213800d6608195487d0bc91aac79df75616b7bd6d4 SHA512 e7f61451bb05caaeecbe19b24d3c44cecd54a3f10d40701973cf061dc5396c7dc0220c19396e73d5f8d8a8febf34789333476cca62566667d827ed5f68155d4b WHIRLPOOL 4df278e552808cf8656c1319518cd8e37ffd3189e482efae6401dfd43febe733a8e57135d1d4886906fc37b495762c92ca24e5a5f98fe7af59df405e54a4b946
+DIST MesaLib-10.3.7.tar.bz2 7287153 SHA256 43c6ced15e237cbb21b3082d7c0b42777c50c1f731d0d4b5efb5231063fb6a5b SHA512 bbc027c4146c42aaa160990f5281c71a342d32c10ba56f91da1a60dd4cb7d620ff49b72553d24bc1d87470e2baf9be81b5bdee9abe49d6acc57902fccb9e2e5f WHIRLPOOL 7fa32e70c6aabb84a06f2f852f77eac839aea08726c442742b3d3abdb94a0fd9f033439ab0cb16865f4ee14e1538cb86937856bbdfd1f9090e8e7c43eac52e03
+EBUILD mesa-10.3.7-r1.ebuild 14902 SHA256 45718624b57b37693fad5d1ca41c5a8156f2fe364ed95c9709f3b58db34ef27e SHA512 e22136acb270c7e19e0f0ff82ac4b204d5c437c606943455ff6565a930f3a20052dc84a5e4d45a1ded2c1ca029ef81fb34121ea315f0539ac8e6416b3d0602a0 WHIRLPOOL 8a9ad22fad2e133df122ce4babe42ac3ee8f05187b56a76226e6fbaa414eab2990a09c67c9fea280b82510d6960485bc294d39091f4025795d71667e149e5cd5
+MISC metadata.xml 1937 SHA256 b1c243ea287b20ad89f349d4d6274735d0bee6fd4b3309c6a9a0fbc063633c2e SHA512 445b1923de09a43ee10b6df629e48dd114003a2edf482de865f16816b2011d90b058e7cbc5e81face2ffdbac3cb94443f35aeea5cea93a9213f77a8aa822b459 WHIRLPOOL 56eb282ac574bff06e7dbc0bcb26b364ee1fd7827975327d59e3a94530c1cd7e7f843fe6be0bdab9a5956e34301ea3148c17e30b757fb904434a706ae6889023
diff --git a/media-libs/mesa/files/eselect-mesa.conf.8.1 b/media-libs/mesa/files/eselect-mesa.conf.8.1
new file mode 100644
index 00000000..63a21aa4
--- /dev/null
+++ b/media-libs/mesa/files/eselect-mesa.conf.8.1
@@ -0,0 +1,38 @@
+# mesa classic/gallium implementations in this release
+
+# Syntax description:
+# * MESA_IMPLEMENTATIONS contains a space-delimited list of switchable
+# classic/gallium implementations.
+# * MESA_DRIVERS is an associative array, for each member "foo" of
+# MESA_IMPLEMENTATIONS it contains the following elements:
+# foo,description - Human-readable description of the driver
+# foo,classicdriver - Filename of the classic driver
+# foo,galliumdriver - Filename of the gallium driver
+# foo,default - which of classic or gallium is chosen by default
+
+MESA_IMPLEMENTATIONS="i915 i965 r300 r600 sw"
+declare -A MESA_DRIVERS || die "MESA_DRIVERS already in environment and not associative."
+
+MESA_DRIVERS[i915,description]="i915 (Intel 915, 945)"
+MESA_DRIVERS[i915,classicdriver]="i915_dri.so"
+MESA_DRIVERS[i915,galliumdriver]="i915g_dri.so"
+MESA_DRIVERS[i915,default]="gallium"
+
+MESA_DRIVERS[i965,description]="i965 (Intel 965, G/Q3x, G/Q4x)"
+MESA_DRIVERS[i965,classicdriver]="i965_dri.so"
+MESA_DRIVERS[i965,default]="classic"
+
+MESA_DRIVERS[r300,description]="r300 (Radeon R300-R500)"
+MESA_DRIVERS[r300,classicdriver]="r300_dri.so"
+MESA_DRIVERS[r300,galliumdriver]="r300g_dri.so"
+MESA_DRIVERS[r300,default]="gallium"
+
+MESA_DRIVERS[r600,description]="r600 (Radeon R600-R700, Evergreen, Northern Islands)"
+MESA_DRIVERS[r600,classicdriver]="r600_dri.so"
+MESA_DRIVERS[r600,galliumdriver]="r600g_dri.so"
+MESA_DRIVERS[r600,default]="gallium"
+
+MESA_DRIVERS[sw,description]="sw (Software renderer)"
+MESA_DRIVERS[sw,classicdriver]="swrast_dri.so"
+MESA_DRIVERS[sw,galliumdriver]="swrastg_dri.so"
+MESA_DRIVERS[sw,default]="gallium"
diff --git a/media-libs/mesa/files/eselect-mesa.conf.9.2 b/media-libs/mesa/files/eselect-mesa.conf.9.2
new file mode 100644
index 00000000..ff590f59
--- /dev/null
+++ b/media-libs/mesa/files/eselect-mesa.conf.9.2
@@ -0,0 +1,39 @@
+# mesa classic/gallium implementations in this release
+
+# Syntax description:
+# * MESA_IMPLEMENTATIONS contains a space-delimited list of switchable
+# classic/gallium implementations.
+# * MESA_DRIVERS is an associative array, for each member "foo" of
+# MESA_IMPLEMENTATIONS it contains the following elements:
+# foo,description - Human-readable description of the driver
+# foo,classicdriver - Filename of the classic driver
+# foo,galliumdriver - Filename of the gallium driver
+# foo,default - which of classic or gallium is chosen by default
+
+MESA_IMPLEMENTATIONS="i915 i965 r300 r600 sw"
+declare -A MESA_DRIVERS || die "MESA_DRIVERS already in environment and not associative."
+
+MESA_DRIVERS[i915,description]="i915 (Intel 915, 945)"
+MESA_DRIVERS[i915,classicdriver]="i915_dri.so"
+MESA_DRIVERS[i915,galliumdriver]="i915g_dri.so"
+MESA_DRIVERS[i915,default]="gallium"
+
+MESA_DRIVERS[i965,description]="i965 (Intel GMA 965, G/Q3x, G/Q4x, HD)"
+MESA_DRIVERS[i965,classicdriver]="i965_dri.so"
+MESA_DRIVERS[i965,galliumdriver]="ilo_dri.so"
+MESA_DRIVERS[i965,default]="classic"
+
+MESA_DRIVERS[r300,description]="r300 (Radeon R300-R500)"
+MESA_DRIVERS[r300,classicdriver]="r300_dri.so"
+MESA_DRIVERS[r300,galliumdriver]="r300g_dri.so"
+MESA_DRIVERS[r300,default]="gallium"
+
+MESA_DRIVERS[r600,description]="r600 (Radeon R600-R700, Evergreen, Northern Islands)"
+MESA_DRIVERS[r600,classicdriver]="r600_dri.so"
+MESA_DRIVERS[r600,galliumdriver]="r600g_dri.so"
+MESA_DRIVERS[r600,default]="gallium"
+
+MESA_DRIVERS[sw,description]="sw (Software renderer)"
+MESA_DRIVERS[sw,classicdriver]="swrast_dri.so"
+MESA_DRIVERS[sw,galliumdriver]="swrastg_dri.so"
+MESA_DRIVERS[sw,default]="gallium"
diff --git a/media-libs/mesa/files/glx_ro_text_segm.patch b/media-libs/mesa/files/glx_ro_text_segm.patch
new file mode 100644
index 00000000..495b7dc4
--- /dev/null
+++ b/media-libs/mesa/files/glx_ro_text_segm.patch
@@ -0,0 +1,28 @@
+2011-02-09 Jeremy Huddleston <jeremyhu@freedesktop.org
+
+ #240956
+ * configure.ac add support to enable readonly test segment on x86
+
+--- configure.ac.orig 2008-11-17 23:19:38.000000000 +0100
++++ configure.ac 2008-11-17 23:20:17.000000000 +0100
+@@ -499,6 +499,20 @@
+ enable_xcb=no
+ fi
+
++
++dnl readonly text segment on x86 hardened platforms
++AC_ARG_ENABLE([glx_rts],
++ [AS_HELP_STRING([--enable-glx-rts],
++ [on x86, use a readonly text segment for libGL @<:@default=disabled@:>@])],
++ [enable_glx_rts="$enableval"],
++ [enable_glx_rts=no])
++if test "x$enable_glx_rts" = xyes; then
++ DEFINES="$DEFINES -DGLX_X86_READONLY_TEXT"
++else
++ enable_glx_rts=no
++fi
++
++
+ dnl
+ dnl libGL configuration per driver
+ dnl
diff --git a/media-libs/mesa/files/mesa-10-pthread.patch b/media-libs/mesa/files/mesa-10-pthread.patch
new file mode 100644
index 00000000..17a8bda0
--- /dev/null
+++ b/media-libs/mesa/files/mesa-10-pthread.patch
@@ -0,0 +1,24 @@
+mesa-10.patch from sabotage linux
+
+--- ./include/c11/threads_posix.h.orig
++++ ./include/c11/threads_posix.h
+@@ -178,7 +178,7 @@
+ return thrd_error;
+ pthread_mutexattr_init(&attr);
+ if ((type & mtx_recursive) != 0) {
+-#if defined(__linux__) || defined(__linux)
++#if defined(__GLIBC__)
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ #else
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+--- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig
++++ ./src/gallium/winsys/svga/drm/vmw_screen.h
+@@ -34,7 +34,7 @@
+ #ifndef VMW_SCREEN_H_
+ #define VMW_SCREEN_H_
+
+-
++#include <sys/stat.h>
+ #include "pipe/p_compiler.h"
+ #include "pipe/p_state.h"
+
diff --git a/media-libs/mesa/files/mesa-10.2-dont-require-llvm-for-r300.patch b/media-libs/mesa/files/mesa-10.2-dont-require-llvm-for-r300.patch
new file mode 100644
index 00000000..a85a3c10
--- /dev/null
+++ b/media-libs/mesa/files/mesa-10.2-dont-require-llvm-for-r300.patch
@@ -0,0 +1,11 @@
+diff -Naur a/configure.ac b/configure.ac
+--- a/configure.ac 2014-03-03 04:05:33.110522943 +0100
++++ b/configure.ac 2014-03-03 04:06:44.165518094 +0100
+@@ -1774,7 +1774,6 @@
+ HAVE_GALLIUM_R300=yes
+ PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
+ gallium_require_drm_loader
+- gallium_require_llvm "Gallium R300"
+ GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
+ gallium_check_st "radeon/drm" "r300/dri" "" "" ""
+ DRICOMMON_NEED_LIBDRM=yes
diff --git a/media-libs/mesa/files/mesa-10.3.7-dont-use-clrsb.patch b/media-libs/mesa/files/mesa-10.3.7-dont-use-clrsb.patch
new file mode 100644
index 00000000..c38757dc
--- /dev/null
+++ b/media-libs/mesa/files/mesa-10.3.7-dont-use-clrsb.patch
@@ -0,0 +1,36 @@
+From 32e98e8ef06f0bb6ad55f9fb5858be77c03367b0 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 2 Feb 2015 17:26:49 -0800
+Subject: [PATCH] gallium/util: Don't use __builtin_clrsb in util_last_bit().
+
+Unclear circumstances lead to undefined symbols on x86.
+
+Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=536916
+Cc: mesa-stable@lists.freedesktop.org
+Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
+---
+ src/gallium/auxiliary/util/u_math.h | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
+index 19c7343..ca6d0f1 100644
+--- a/src/gallium/auxiliary/util/u_math.h
++++ b/src/gallium/auxiliary/util/u_math.h
+@@ -561,14 +561,10 @@ util_last_bit(unsigned u)
+ static INLINE unsigned
+ util_last_bit_signed(int i)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(__INTEL_COMPILER)
+- return 31 - __builtin_clrsb(i);
+-#else
+ if (i >= 0)
+ return util_last_bit(i);
+ else
+ return util_last_bit(~(unsigned)i);
+-#endif
+ }
+
+ /* Destructively loop over all of the bits in a mask as in:
+--
+2.0.4
+
diff --git a/media-libs/mesa/files/mesa-9.1.6-fpclassify.patch b/media-libs/mesa/files/mesa-9.1.6-fpclassify.patch
new file mode 100644
index 00000000..3d606c9e
--- /dev/null
+++ b/media-libs/mesa/files/mesa-9.1.6-fpclassify.patch
@@ -0,0 +1,11 @@
+--- Mesa-9.1.6.org/src/mesa/main/querymatrix.c 2013-08-04 18:12:47.046000003 +0000
++++ Mesa-9.1.6/src/mesa/main/querymatrix.c 2013-08-04 18:23:35.360000003 +0000
+@@ -71,7 +71,7 @@
+ }
+ }
+
+-#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
++#elif defined(fpclassify) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
+ defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
+ (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \
+ (defined(__sun) && defined(__GNUC__)) || defined(ANDROID) || defined(__HAIKU__)
diff --git a/media-libs/mesa/mesa-10.3.7-r1.ebuild b/media-libs/mesa/mesa-10.3.7-r1.ebuild
new file mode 100644
index 00000000..5417c733
--- /dev/null
+++ b/media-libs/mesa/mesa-10.3.7-r1.ebuild
@@ -0,0 +1,538 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-10.3.7-r1.ebuild,v 1.4 2015/02/20 11:16:40 ago Exp $
+
+EAPI=5
+
+EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
+
+if [[ ${PV} = 9999* ]]; then
+ GIT_ECLASS="git-r3"
+ EXPERIMENTAL="true"
+fi
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit base autotools multilib multilib-minimal flag-o-matic \
+ python-any-r1 toolchain-funcs pax-utils ${GIT_ECLASS}
+
+OPENGL_DIR="xorg-x11"
+
+MY_PN="${PN/m/M}"
+MY_P="${MY_PN}-${PV/_/-}"
+MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
+
+FOLDER="${PV/.0/}"
+
+DESCRIPTION="OpenGL-like graphic library for Linux"
+HOMEPAGE="http://mesa3d.sourceforge.net/"
+
+#SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2"
+if [[ $PV = 9999* ]]; then
+ SRC_URI="${SRC_PATCHES}"
+else
+ SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_SRC_P}.tar.bz2
+ ${SRC_PATCHES}"
+fi
+
+# The code is MIT/X11.
+# GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
+LICENSE="MIT SGI-B-2.0"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+
+INTEL_CARDS="i915 i965 ilo intel"
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vmware"
+for card in ${VIDEO_CARDS}; do
+ IUSE_VIDEO_CARDS+=" video_cards_${card}"
+done
+
+IUSE="${IUSE_VIDEO_CARDS}
+ bindist +classic debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm +nptl
+ opencl openvg osmesa pax_kernel openmax pic r600-llvm-compiler selinux
+ +udev vdpau wayland xvmc xa kernel_FreeBSD kernel_linux"
+
+REQUIRED_USE="
+ llvm? ( gallium )
+ openvg? ( egl gallium )
+ opencl? (
+ gallium
+ llvm
+ video_cards_r600? ( r600-llvm-compiler )
+ video_cards_radeon? ( r600-llvm-compiler )
+ video_cards_radeonsi? ( r600-llvm-compiler )
+ )
+ openmax? ( gallium )
+ gles1? ( egl )
+ gles2? ( egl )
+ r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi video_cards_radeon ) )
+ wayland? ( egl gbm )
+ xa? ( gallium )
+ video_cards_freedreno? ( gallium )
+ video_cards_intel? ( || ( classic gallium ) )
+ video_cards_i915? ( || ( classic gallium ) )
+ video_cards_i965? ( classic )
+ video_cards_ilo? ( gallium )
+ video_cards_nouveau? ( || ( classic gallium ) )
+ video_cards_radeon? ( || ( classic gallium ) )
+ video_cards_r100? ( classic )
+ video_cards_r200? ( classic )
+ video_cards_r300? ( gallium )
+ video_cards_r600? ( gallium )
+ video_cards_radeonsi? ( gallium llvm )
+ video_cards_vmware? ( gallium )
+ ${PYTHON_REQUIRED_USE}
+"
+
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.56"
+# keep correct libdrm and dri2proto dep
+# keep blocks in rdepend for binpkg
+RDEPEND="
+ !<x11-base/xorg-server-1.7
+ !<=x11-proto/xf86driproto-2.0.3
+ abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
+ classic? ( app-eselect/eselect-mesa )
+ gallium? ( app-eselect/eselect-mesa )
+ >=app-eselect/eselect-opengl-1.2.7
+ udev? ( kernel_linux? ( >=virtual/libudev-215:=[${MULTILIB_USEDEP}] ) )
+ >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
+ >=x11-libs/libxcb-1.9.3:=[${MULTILIB_USEDEP}]
+ llvm? (
+ video_cards_radeonsi? ( || (
+ >=dev-libs/elfutils-0.155-r1:=[${MULTILIB_USEDEP}]
+ >=dev-libs/libelf-0.8.13-r2:=[${MULTILIB_USEDEP}]
+ ) )
+ video_cards_r600? ( || (
+ >=dev-libs/elfutils-0.155-r1:=[${MULTILIB_USEDEP}]
+ >=dev-libs/libelf-0.8.13-r2:=[${MULTILIB_USEDEP}]
+ ) )
+ !video_cards_r600? (
+ video_cards_radeon? ( || (
+ >=dev-libs/elfutils-0.155-r1:=[${MULTILIB_USEDEP}]
+ >=dev-libs/libelf-0.8.13-r2:=[${MULTILIB_USEDEP}]
+ ) )
+ )
+ >=sys-devel/llvm-3.3-r3:=[${MULTILIB_USEDEP}]
+ video_cards_radeonsi? ( >=sys-devel/llvm-3.4.2:=[${MULTILIB_USEDEP}] )
+ )
+ opencl? (
+ app-eselect/eselect-opencl
+ dev-libs/libclc
+ )
+ openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
+ vdpau? ( >=x11-libs/libvdpau-0.7:=[${MULTILIB_USEDEP}] )
+ wayland? ( >=dev-libs/wayland-1.2.0:=[${MULTILIB_USEDEP}] )
+ xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
+ ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vmware?,${MULTILIB_USEDEP}]
+"
+for card in ${INTEL_CARDS}; do
+ RDEPEND="${RDEPEND}
+ video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
+ "
+done
+
+for card in ${RADEON_CARDS}; do
+ RDEPEND="${RDEPEND}
+ video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
+ "
+done
+
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ llvm? (
+ r600-llvm-compiler? ( sys-devel/llvm[video_cards_radeon] )
+ video_cards_radeonsi? ( sys-devel/llvm[video_cards_radeon] )
+ )
+ opencl? (
+ >=sys-devel/llvm-3.4.2:=[${MULTILIB_USEDEP}]
+ >=sys-devel/clang-3.4.2:=[${MULTILIB_USEDEP}]
+ >=sys-devel/gcc-4.6
+ )
+ sys-devel/bison
+ sys-devel/flex
+ sys-devel/gettext
+ virtual/pkgconfig
+ >=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
+ dri3? (
+ >=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
+ >=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
+ )
+ >=x11-proto/glproto-1.4.16-r1:=[${MULTILIB_USEDEP}]
+ >=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
+ >=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
+ >=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
+"
+
+S="${WORKDIR}/${MY_P}"
+EGIT_CHECKOUT_DIR=${S}
+
+# It is slow without texrels, if someone wants slow
+# mesa without texrels +pic use is worth the shot
+QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
+QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
+
+# Think about: ggi, fbcon, no-X configs
+
+pkg_setup() {
+ # workaround toc-issue wrt #386545
+ use ppc64 && append-flags -mminimal-toc
+
+ # warning message for bug 459306
+ if use llvm && has_version sys-devel/llvm[!debug=]; then
+ ewarn "Mismatch between debug USE flags in media-libs/mesa and sys-devel/llvm"
+ ewarn "detected! This can cause problems. For details, see bug 459306."
+ fi
+
+ python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+ [[ $PV = 9999* ]] && git-r3_src_unpack
+}
+
+src_prepare() {
+ # apply patches
+ if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
+ EPATCH_FORCE="yes" \
+ EPATCH_SOURCE="${WORKDIR}/patches" \
+ EPATCH_SUFFIX="patch" \
+ epatch
+ fi
+
+ epatch "${FILESDIR}"/${PN}-10.3.7-dont-use-clrsb.patch
+
+ # relax the requirement that r300 must have llvm, bug 380303
+ epatch "${FILESDIR}"/${PN}-10.2-dont-require-llvm-for-r300.patch
+
+ # for musl
+ epatch "${FILESDIR}"/${PN}-9.1.6-fpclassify.patch
+ epatch "${FILESDIR}"/${PN}-10-pthread.patch
+
+ # fix for hardened pax_kernel, bug 240956
+ [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
+
+ # Solaris needs some recent POSIX stuff in our case
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
+ fi
+
+ base_src_prepare
+
+ eautoreconf
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf
+
+ if use classic; then
+ # Configurable DRI drivers
+ driver_enable swrast
+
+ # Intel code
+ driver_enable video_cards_i915 i915
+ driver_enable video_cards_i965 i965
+ if ! use video_cards_i915 && \
+ ! use video_cards_i965; then
+ driver_enable video_cards_intel i915 i965
+ fi
+
+ # Nouveau code
+ driver_enable video_cards_nouveau nouveau
+
+ # ATI code
+ driver_enable video_cards_r100 radeon
+ driver_enable video_cards_r200 r200
+ if ! use video_cards_r100 && \
+ ! use video_cards_r200; then
+ driver_enable video_cards_radeon radeon r200
+ fi
+ fi
+
+ if use egl; then
+ myconf+="--with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm") "
+ fi
+
+ if use gallium; then
+ myconf+="
+ $(use_enable llvm gallium-llvm)
+ $(use_enable openvg)
+ $(use_enable openvg gallium-egl)
+ $(use_enable openmax omx)
+ $(use_enable r600-llvm-compiler)
+ $(use_enable vdpau)
+ $(use_enable xa)
+ $(use_enable xvmc)
+ "
+ gallium_enable swrast
+ gallium_enable video_cards_vmware svga
+ gallium_enable video_cards_nouveau nouveau
+ gallium_enable video_cards_i915 i915
+ gallium_enable video_cards_ilo ilo
+ if ! use video_cards_i915 && \
+ ! use video_cards_i965; then
+ gallium_enable video_cards_intel i915
+ fi
+
+ gallium_enable video_cards_r300 r300
+ gallium_enable video_cards_r600 r600
+ gallium_enable video_cards_radeonsi radeonsi
+ if ! use video_cards_r300 && \
+ ! use video_cards_r600; then
+ gallium_enable video_cards_radeon r300 r600
+ fi
+
+ gallium_enable video_cards_freedreno freedreno
+ # opencl stuff
+ if use opencl; then
+ myconf+="
+ $(use_enable opencl)
+ --with-opencl-libdir="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/mesa"
+ --with-clang-libdir="${EPREFIX}/usr/lib"
+ "
+ fi
+ fi
+
+ # x86 hardened pax_kernel needs glx-rts, bug 240956
+ if use pax_kernel; then
+ myconf+="
+ $(use_enable x86 glx-rts)
+ "
+ fi
+
+ # on abi_x86_32 hardened we need to have asm disable
+ if [[ ${ABI} == x86* ]] && use pic; then
+ myconf+=" --disable-asm"
+ fi
+
+ # build fails with BSD indent, bug #428112
+ use userland_GNU || export INDENT=cat
+
+ econf \
+ --enable-dri \
+ --enable-glx \
+ --enable-shared-glapi \
+ $(use_enable !bindist texture-float) \
+ $(use_enable debug) \
+ $(use_enable dri3) \
+ $(use_enable egl) \
+ $(use_enable gbm) \
+ $(use_enable gles1) \
+ $(use_enable gles2) \
+ $(use_enable nptl glx-tls) \
+ $(use_enable osmesa) \
+ $(use_enable !udev sysfs) \
+ --enable-llvm-shared-libs \
+ --with-dri-drivers=${DRI_DRIVERS} \
+ --with-gallium-drivers=${GALLIUM_DRIVERS} \
+ PYTHON2="${PYTHON}" \
+ ${myconf}
+}
+
+multilib_src_install() {
+ emake install DESTDIR="${D}"
+
+ # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
+ # because user can eselect desired GL provider.
+ ebegin "Moving libGL and friends for dynamic switching"
+ local x
+ local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
+ dodir ${gl_dir}/{lib,extensions,include/GL}
+ for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f "${x}" "${ED}${gl_dir}"/lib \
+ || die "Failed to move ${x}"
+ fi
+ done
+ for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f "${x}" "${ED}${gl_dir}"/include/GL \
+ || die "Failed to move ${x}"
+ fi
+ done
+ for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
+ if [ -d ${x} ]; then
+ mv -f "${x}" "${ED}${gl_dir}"/include \
+ || die "Failed to move ${x}"
+ fi
+ done
+ eend $?
+
+ if use classic || use gallium; then
+ ebegin "Moving DRI/Gallium drivers for dynamic switching"
+ local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
+ keepdir /usr/$(get_libdir)/dri
+ dodir /usr/$(get_libdir)/mesa
+ for x in ${gallium_drivers[@]}; do
+ if [ -f "$(get_libdir)/gallium/${x}" ]; then
+ mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
+ || die "Failed to move ${x}"
+ fi
+ done
+ if use classic; then
+ emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
+ fi
+ for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f "${x}" "${x/dri/mesa}" \
+ || die "Failed to move ${x}"
+ fi
+ done
+ pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
+ ln -s ../mesa/*.so . || die "Creating symlink failed"
+ # remove symlinks to drivers known to eselect
+ for x in ${gallium_drivers[@]}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ rm "${x}" || die "Failed to remove ${x}"
+ fi
+ done
+ popd
+ eend $?
+ fi
+ if use opencl; then
+ ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
+ local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
+ dodir ${cl_dir}/{lib,include}
+ if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
+ mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
+ "${ED}"${cl_dir}
+ fi
+ if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
+ mv -f "${ED}"/usr/include/CL \
+ "${ED}"${cl_dir}/include
+ fi
+ eend $?
+ fi
+
+ if use openmax; then
+ echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
+ doenvd "${T}"/99mesaxdgomx
+ keepdir /usr/share/mesa/xdg
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --all
+ einstalldocs
+
+ if use !bindist; then
+ dodoc docs/patents.txt
+ fi
+
+ # Install config file for eselect mesa
+ insinto /usr/share/mesa
+ newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
+}
+
+multilib_src_test() {
+ if use llvm; then
+ local llvm_tests='lp_test_arit lp_test_arit lp_test_blend lp_test_blend lp_test_conv lp_test_conv lp_test_format lp_test_format lp_test_printf lp_test_printf'
+ pushd src/gallium/drivers/llvmpipe >/dev/null || die
+ emake ${llvm_tests}
+ pax-mark m ${llvm_tests}
+ popd >/dev/null || die
+ fi
+ emake check
+}
+
+pkg_postinst() {
+ # Switch to the xorg implementation.
+ echo
+ eselect opengl set --use-old ${OPENGL_DIR}
+
+ # switch to xorg-x11 and back if necessary, bug #374647 comment 11
+ OLD_IMPLEM="$(eselect opengl show)"
+ if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
+ eselect opengl set ${OPENGL_DIR}
+ eselect opengl set ${OLD_IMPLEM}
+ fi
+
+ # Select classic/gallium drivers
+ if use classic || use gallium; then
+ eselect mesa set --auto
+ fi
+
+ # Switch to mesa opencl
+ if use opencl; then
+ eselect opencl set --use-old ${PN}
+ fi
+
+ # run omxregister-bellagio to make the OpenMAX drivers known system-wide
+ if use openmax; then
+ ebegin "Registering OpenMAX drivers"
+ BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
+ OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
+ omxregister-bellagio
+ eend $?
+ fi
+
+ # warn about patent encumbered texture-float
+ if use !bindist; then
+ elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
+ elog "enabled. Please see patents.txt for an explanation."
+ fi
+
+ local using_radeon r_flag
+ for r_flag in ${RADEON_CARDS}; do
+ if use video_cards_${r_flag}; then
+ using_radeon=1
+ break
+ fi
+ done
+
+ if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
+ elog "Note that in order to have full S3TC support, it is necessary to install"
+ elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
+ elog "textures in some apps, and some others even require this to run."
+ fi
+}
+
+pkg_prerm() {
+ if use openmax; then
+ rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
+ fi
+}
+
+# $1 - VIDEO_CARDS flag
+# other args - names of DRI drivers to enable
+# TODO: avoid code duplication for a more elegant implementation
+driver_enable() {
+ case $# in
+ # for enabling unconditionally
+ 1)
+ DRI_DRIVERS+=",$1"
+ ;;
+ *)
+ if use $1; then
+ shift
+ for i in $@; do
+ DRI_DRIVERS+=",${i}"
+ done
+ fi
+ ;;
+ esac
+}
+
+gallium_enable() {
+ case $# in
+ # for enabling unconditionally
+ 1)
+ GALLIUM_DRIVERS+=",$1"
+ ;;
+ *)
+ if use $1; then
+ shift
+ for i in $@; do
+ GALLIUM_DRIVERS+=",${i}"
+ done
+ fi
+ ;;
+ esac
+}
diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml
new file mode 100644
index 00000000..fe098a45
--- /dev/null
+++ b/media-libs/mesa/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>x11</herd>
+<use>
+ <flag name='bindist'>Disable patent-encumbered ARB_texture_float, EXT_texture_shared_exponent, and EXT_packed_float extensions.</flag>
+ <flag name='classic'>Build drivers based on the classic architecture.</flag>
+ <flag name='d3d9'>Enable Direct 3D9 API through Nine state tracker. Can be used together with patched wine.</flag>
+ <flag name='dri3'>Enable DRI3 support.</flag>
+ <flag name='egl'>Enable EGL support.</flag>
+ <flag name='gallium'>Build drivers based on Gallium3D, the new architecture for 3D graphics drivers.</flag>
+ <flag name='gbm'>Enable the Graphics Buffer Manager for EGL on KMS.</flag>
+ <flag name='gles'>Enable GLES (both v1 and v2) support.</flag>
+ <flag name='gles1'>Enable GLESv1 support.</flag>
+ <flag name='gles2'>Enable GLESv2 support.</flag>
+ <flag name='llvm'>Enable LLVM backend for Gallium3D.</flag>
+ <flag name='opencl'>Enable the Clover Gallium OpenCL state tracker.</flag>
+ <flag name='openmax'>Enable OpenMAX video decode/encode acceleration for Gallium3D.</flag>
+ <flag name='openvg'>Enable the OpenVG 2D acceleration API for Gallium3D.</flag>
+ <flag name='osmesa'>Build the Mesa library for off-screen rendering.</flag>
+ <flag name='pax_kernel'>Enable if the user plans to run the package under a pax enabled hardened kernel</flag>
+ <flag name='pic'>disable optimized assembly code that is not PIC friendly</flag>
+ <flag name='r600-llvm-compiler'>Build the LLVM based r600 shader compiler.</flag>
+ <flag name='vdpau'>Enable the VDPAU acceleration interface for the Gallium3D Video Layer.</flag>
+ <flag name='wayland'>Enable support for dev-libs/wayland</flag>
+ <flag name='xa'>Enable the XA (X Acceleration) API for Gallium3D.</flag>
+ <flag name='xvmc'>Enable the XvMC acceleration interface for the Gallium3D Video Layer.</flag>
+</use>
+</pkgmetadata>
diff --git a/media-libs/netpbm/Manifest b/media-libs/netpbm/Manifest
new file mode 100644
index 00000000..fbe240a3
--- /dev/null
+++ b/media-libs/netpbm/Manifest
@@ -0,0 +1,10 @@
+AUX make-tarball.sh 1053 SHA256 247827b36f85878195ad30f1a1ec3a4edf9992ccafcd4f66ce4fa18910abd731 SHA512 66d7de6cb87fefb353547183c7dd2ff28304534753aef48549801ef3ed23bcde995a766e6f3b14b70e64e1a7e6fddca56329e5a6e5e2182f26bf3b0d2dffd593 WHIRLPOOL 05831454f0109ef79549922234c98a9c4294804329212b197bb386d4faa37b26537f9b537cc50f890bf4d48e33b84d4fff3300da9adab12d3137ba2e90cbf3e0
+AUX netpbm-10.31-build.patch 1629 SHA256 eaf363941337718390856c318c8e69114c8fb9dbcea8b07755350dbdabce6323 SHA512 53e88bd1c85aa04d60ca2de7a32e5d00d9f959f3443e0c951c0694c814f6956708d8d12427a0fa8a8f76a1613d2982c3aa9b0c6ddd12b9cad3419ced1e5bb59e WHIRLPOOL 15a6b682813bfac808ccff8e16be492fd78defd59f82d5960d9a344452d8c761ea64ebbdc460c005c7d7669a3f26aa3704850487b43f4732bccb742b15709c28
+AUX netpbm-10.51.00-getline.patch 5633 SHA256 7ebd19673033dbfcbc1ba83c7d13b83e1775b3501799218725863e271caf3e7c SHA512 bc1342c3dc24377f365a01694b68f6ab1a18feef3dc8d595dabf0152b5e98a5d67ef9256ed16f50669ea3fa10c0e11962482c9f26ae74f50de0d5e425eb74a25 WHIRLPOOL 49de87814cc999ca12bd511f23306a12089510efe33c4f69dbd453fd01c1b7bdaa0211db84b44b0b9d1565a6350a4804a377f67191f981bd5d69c1e36d4c6f78
+AUX netpbm-10.51.00-pnmconvol-nooffset.patch 3930 SHA256 d9c7f70e58d50dac4998157021ac2fef92822d1abd9b9d060384b195e4f1cabb SHA512 9f9a1e9a2d7db117693648693c0152082cab1e60a075e9bd4ca67b9c042ea02549917504658d32311b116cd17901f153ece73303adabdac2cd0981ac22a1ce45 WHIRLPOOL c7a6b09c9c5e258445473d7f16e91fac9205d1f21f24e8eebe0a277908774e6670d00ee3f6aa44f6bfc6bccface76c5db6bc523f442c263306982d43cb83edb3
+AUX netpbm-10.51.00-ppmtompeg-free.patch 1199 SHA256 45c0229b035e8b50f759a5aae646a60ef07f4c0fb156b4aee1dc52aa0c1cbc75 SHA512 902f9882f24561e92277d2b93363e3611f26e59236f2f116728f25179198e2be723e7d1e39e5c12ef820fd98ba654ea0ccd946db6d27cfbf592d98bb2ba9cb57 WHIRLPOOL bc6222c72a9bb12d218a762161d2bff577fb04b577131eefea930f0fd6c324dcdd6740a032f40cc75b5e5403cb6757bd66b1867bab0ccd0735da9a62183f078b
+AUX netpbm-10.51.00-underlinking.patch 657 SHA256 f933003b9c50717d76abaf3272b9bef66b328629a8791144fd0038e692989b95 SHA512 5fe8513f982fbfe557460a9c4cba2d61e27d2a7142906a6a05bd40ceb3c6b194c3c1ae1005e246a94606ac15d1c2f109f2ef33d8c4140118691877fae22d61ee WHIRLPOOL 724976eaa5a5ac95498bac9f221d78f5a5ba73fa2a2666167ced3c66fa88f8c9b15be7a86d3a19c6faa771781ca37b57f302750f7c70ef30d2d92f2323531612
+DIST netpbm-10.51.00-libpng-1.5.patch.bz2 8120 SHA256 260a5f0e9834e7e1aa5c2dcc292695aa43b5aa198af1cb33e5705f7cac10da7b SHA512 3bebffb798e72e5ff872b482d43dffbd174496d1ca46e88bcb3c19f2b94cdfe2037aa1f19a22a40996503ccc03929bd28570722874a0c74265b083fbc66b24c4 WHIRLPOOL cbf1efd16ac7acef1fa318454f24afbd7f68eded7343168783ce8fd5dd389b9d97e7a9237cf4d6315cdeba462c9d84fb7011ddfa2df592b1fe15f4462ca0d623
+DIST netpbm-10.51.00.tar.xz 1834148 SHA256 6d7bb30d1d0e7f6a23b55c6f03bbb20b539909ad84281dc944b1072656dc1d0e SHA512 07b621bfebbd051a80eff09886bc2b3b4f82b01fa9087d6a76ed70a042493b69fb3295d471640a4576101ba19352a57eadf69c5721d9cc416d25ff563ee07c76 WHIRLPOOL 25cbfbdd575fe1c032ce1bb700181175b1386d481990e516ce62d953b1d37091c32ca2016c487d4963af1b8c79ec04953e59181334d2a53b9d5701acedabdf2a
+EBUILD netpbm-10.51.00-r99.ebuild 4872 SHA256 0a53f874d4d92a570722641046f60d33367ec24ce44a2af184c23652e4cb81d0 SHA512 7caff25e7f489de3a85011abba9149b9a9e1bc401952de0ba8b40a12705a2a8f220fd3d8460ef7298a13049ea73ff5d5a878dff8443b4524e5d070d518c55230 WHIRLPOOL a73ba95f8f48e5a379a86fab12f2639eed3c5b784ac0992b6b327beb840d4be802371dd999528c890ce62eca7a0c5f048eafbc8070345d85459b63489fe978d4
+MISC metadata.xml 261 SHA256 e04079912e263782a8c0e4f115e49ff3694535ff2efef7b7fff85cf8d100102b SHA512 e7bcb8f689bd7da37e414a3f33b125d52a5ec0d376e821edd58d352ffb502098fbe8b7d24c0eb073822e41a55c280f84558ca4314dd37ac20adcf6471bd712af WHIRLPOOL 9aa2223d48bacfa917affeb56dc180becb54fc612e69ce6d26496d45cc42fd1050e2a40c77957ee7f37b3e2665adc0c95f08b60fab1787d3292905f0a4c8092a
diff --git a/media-libs/netpbm/files/make-tarball.sh b/media-libs/netpbm/files/make-tarball.sh
new file mode 100755
index 00000000..d3915228
--- /dev/null
+++ b/media-libs/netpbm/files/make-tarball.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+. /etc/init.d/functions.sh
+
+if [[ $# -eq 0 || $# -gt 2 ]] ; then
+ exec echo "Usage: $0 <version> [netpbm svn root]"
+fi
+
+PN=netpbm
+PV=$1
+P=${PN}-${PV}
+
+SVN_ROOT=${2:-/usr/local/src}
+
+T=/tmp
+
+maint_pkg_create() {
+ local base="/usr/local/src"
+ local srcdir="${base}/netpbm/release_number"
+ local htmldir="${base}/netpbm/userguide"
+ if [[ -d ${srcdir} ]] ; then
+ cd "${T}" || die
+
+ rm -rf ${P}
+
+ ebegin "Exporting ${srcdir}/${PV} to ${P}"
+ svn export -q "${srcdir}/${PV}" ${P}
+ eend $? || return 1
+
+ ebegin "Exporting ${htmldir} to ${P}/userguide"
+ svn export -q "${htmldir}" ${P}/userguide
+ eend $? || return 1
+
+ ebegin "Generating manpages from html"
+ (cd "${P}/userguide" && ../buildtools/makeman *.html)
+ eend $? || return 1
+
+ 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 https://netpbm.svn.sourceforge.net/svnroot/netpbm"
+ die "need svn checkout dir"
+ fi
+}
+maint_pkg_create
diff --git a/media-libs/netpbm/files/netpbm-10.31-build.patch b/media-libs/netpbm/files/netpbm-10.31-build.patch
new file mode 100644
index 00000000..cd744743
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.31-build.patch
@@ -0,0 +1,50 @@
+- Don't install libnetpbm.a and libnetpbm.so into a sep link dir
+- Try to fix parallel building
+- Make the libopt tool less 'helpful'
+
+--- lib/Makefile
++++ lib/Makefile
+@@ -249,7 +249,7 @@
+ .PHONY: install.staticlib
+ install.staticlib: $(PKGDIR)/link
+ $(INSTALL) -c -m $(INSTALL_PERM_LIBS) libnetpbm.$(STATICLIBSUFFIX) \
+- $(PKGDIR)/link
++ $(PKGDIR)/lib
+
+ # Install a shared library stub -- the ".so" file used at link time to
+ # prepare a program for dynamically linking a library at run time
+@@ -257,9 +257,9 @@
+ install.sharedlibstub: $(PKGDIR)/link
+ ifeq ($(NETPBMLIBTYPE),unixshared)
+ # install the link-time (.so) links to the runtime libraries
+- cd $(PKGDIR)/link ; \
++ cd $(PKGDIR)/lib ; \
+ rm -f libnetpbm.$(NETPBMLIBSUFFIX); \
+- $(SYMLINK) ../lib/libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
++ $(SYMLINK) libnetpbm.$(NETPBMLIBSUFFIX).$(MAJ) \
+ libnetpbm.$(NETPBMLIBSUFFIX)
+ endif
+ ifeq ($(NETPBMLIBTYPE),dll)
+--- GNUmakefile
++++ GNUmakefile
+@@ -87,6 +87,9 @@
+
+ .PHONY: nonmerge
+ nonmerge: $(PRODUCT_SUBDIRS:%=%/all)
++
++$(PRODUCT_SUBDIRS:%=%/all): buildtools/all
++converter/all analyzer/all editor/all generator/all other/all: lib/all
+
+ OMIT_CONFIG_RULE = 1
+ include $(SRCDIR)/Makefile.common
+--- buildtools/libopt.c
++++ buildtools/libopt.c
+@@ -502,7 +502,7 @@
+
+ strcpy(outputLine, ""); /* initial value */
+ runtime = FALSE; /* initial value */
+- quiet = FALSE; /* initial value */
++ quiet = TRUE; /* initial value */
+ error = FALSE; /* no error yet */
+ for (arg = 1; arg < argc && !error; arg++) {
+ if (strcmp(argv[arg], "-runtime") == 0)
diff --git a/media-libs/netpbm/files/netpbm-10.51.00-getline.patch b/media-libs/netpbm/files/netpbm-10.51.00-getline.patch
new file mode 100644
index 00000000..645623ef
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.51.00-getline.patch
@@ -0,0 +1,145 @@
+--- a/netpbm-10.51.00/converter/ppm/xpmtoppm.c
++++ b/netpbm-10.51.00/converter/ppm/xpmtoppm.c
+@@ -123,7 +123,7 @@
+
+
+ static void
+-getline(char * const line,
++my_getline(char * const line,
+ size_t const size,
+ FILE * const stream) {
+ /*----------------------------------------------------------------------------
+@@ -141,7 +141,7 @@
+ Exit program if the line doesn't fit in the buffer.
+ -----------------------------------------------------------------------------*/
+ if (size > sizeof(lastInputLine))
+- pm_error("INTERNAL ERROR: getline() received 'size' parameter "
++ pm_error("INTERNAL ERROR: my_getline() received 'size' parameter "
+ "which is out of bounds");
+
+ if (backup) {
+@@ -387,7 +387,7 @@
+ int * const transparentP) {
+ /*----------------------------------------------------------------------------
+ Read the header of the XPM file on stream 'stream'. Assume the
+- getline() stream is presently positioned to the beginning of the
++ my_getline() stream is presently positioned to the beginning of the
+ file and it is a Version 3 XPM file. Leave the stream positioned
+ after the header.
+
+@@ -423,25 +423,25 @@
+ unsigned int * ptab;
+
+ /* Read the XPM signature comment */
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ if (strncmp(line, xpm3_signature, strlen(xpm3_signature)) != 0)
+ pm_error("Apparent XPM 3 file does not start with '/* XPM */'. "
+ "First line is '%s'", xpm3_signature);
+
+ /* Read the assignment line */
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ if (strncmp(line, "static char", 11) != 0)
+ pm_error("Cannot find data structure declaration. Expected a "
+ "line starting with 'static char', but found the line "
+ "'%s'.", line);
+
+ /* Read the hints line */
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ /* skip the comment line if any */
+ if (!strncmp(line, "/*", 2)) {
+ while (!strstr(line, "*/"))
+- getline(line, sizeof(line), stream);
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ }
+ if (sscanf(line, "\"%u %u %u %u\",", &width, &height,
+ &nColors, &charsPerPixel) != 4)
+@@ -475,10 +475,10 @@
+ *transparentP = -1; /* initial value */
+
+ for (seqNum = 0; seqNum < nColors; ++seqNum) {
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ /* skip the comment line if any */
+ if (!strncmp(line, "/*", 2))
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+
+ interpretXpm3ColorTableLine(line, seqNum, charsPerPixel,
+ colors, ptab, nColors, transparentP);
+@@ -504,7 +504,7 @@
+ unsigned int ** const ptabP) {
+ /*----------------------------------------------------------------------------
+ Read the header of the XPM file on stream 'stream'. Assume the
+- getline() stream is presently positioned to the beginning of the
++ my_getline() stream is presently positioned to the beginning of the
+ file and it is a Version 1 XPM file. Leave the stream positioned
+ after the header.
+
+@@ -525,7 +525,7 @@
+ /* Read the initial defines. */
+ processedStaticChar = FALSE;
+ while (!processedStaticChar) {
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+
+ if (sscanf(line, "#define %s %d", str1, &v) == 2) {
+ char *t1;
+@@ -576,7 +576,7 @@
+ /* If there's a monochrome color table, skip it. */
+ if (!strncmp(t1, "mono", 4)) {
+ for (;;) {
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ if (!strncmp(line, "static char", 11))
+ break;
+ }
+@@ -599,7 +599,7 @@
+
+ /* Read color table. */
+ for (i = 0; i < *ncolorsP; ++i) {
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+
+ if ((t1 = strchr(line, '"')) == NULL)
+ pm_error("D error scanning color table");
+@@ -635,7 +635,7 @@
+ "static char ...").
+ */
+ for (;;) {
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ if (strncmp(line, "static char", 11) == 0)
+ break;
+ }
+@@ -741,7 +741,7 @@
+ backup = FALSE;
+
+ /* Read the header line */
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ backup = TRUE; /* back up so next read reads this line again */
+
+ rc = sscanf(line, "/* %s */", str1);
+@@ -761,7 +761,7 @@
+ pm_error("Could not get %d bytes of memory for image", totalpixels);
+ cursor = *dataP;
+ maxcursor = *dataP + totalpixels - 1;
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ /* read next line (first line may not always start with comment) */
+ while (cursor <= maxcursor) {
+ if (strncmp(line, "/*", 2) == 0) {
+@@ -771,7 +771,7 @@
+ ncolors, ptab, &cursor, maxcursor);
+ }
+ if (cursor <= maxcursor)
+- getline(line, sizeof(line), stream);
++ my_getline(line, sizeof(line), stream);
+ }
+ if (ptab) free(ptab);
+ }
diff --git a/media-libs/netpbm/files/netpbm-10.51.00-pnmconvol-nooffset.patch b/media-libs/netpbm/files/netpbm-10.51.00-pnmconvol-nooffset.patch
new file mode 100644
index 00000000..1eb5506d
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.51.00-pnmconvol-nooffset.patch
@@ -0,0 +1,83 @@
+taken from upstream
+
+http://bugs.gentoo.org/338230
+
+Index: editor/pnmconvol.c
+===================================================================
+--- editor/pnmconvol.c (revision 1297)
++++ editor/pnmconvol.c (revision 1298)
+@@ -455,13 +455,13 @@ static void
+ convKernelCreatePnm(struct pam * const cpamP,
+ tuple * const * const ctuples,
+ unsigned int const depth,
+- bool const offsetPgm,
++ bool const offsetPnm,
+ struct convKernel ** const convKernelPP) {
+ /*----------------------------------------------------------------------------
+- Compute the convolution matrix in normalized form from the PGM
+- form. Each element of the output matrix is the actual weight we give an
+- input pixel -- i.e. the thing by which we multiple a value from the
+- input image.
++ Compute the convolution matrix in normalized form from the PGM form
++ 'ctuples'/'cpamP'. Each element of the output matrix is the actual weight
++ we give an input pixel -- i.e. the thing by which we multiple a value from
++ the input image.
+
+ 'depth' is the required number of planes in the kernel. If 'ctuples' has
+ fewer planes than that, we duplicate as necessary. E.g. if 'ctuples' is
+@@ -470,13 +470,13 @@ convKernelCreatePnm(struct pam *
+ 'ctuples' has more planes than specified, we ignore the higher numbered
+ ones.
+
+- 'offsetPgm' means the PGM convolution matrix is defined in offset form so
++ 'offsetPnm' means the PNM convolution matrix is defined in offset form so
+ that it can represent negative values. E.g. with maxval 100, 50 means
+ 0, 100 means 50, and 0 means -50. If 'offsetPgm' is false, 0 means 0
+ and there are no negative weights.
+ -----------------------------------------------------------------------------*/
+- double const scale = (offsetPgm ? 2.0 : 1.0) / cpamP->maxval;
+- double const offset = offsetPgm ? - 1.0 : 0.0;
++ double const scale = (offsetPnm ? 2.0 : 1.0) / cpamP->maxval;
++ double const offset = offsetPnm ? - 1.0 : 0.0;
+ unsigned int const planes = MIN(3, depth);
+
+ struct convKernel * convKernelP;
+@@ -579,9 +579,19 @@ normalizeKernel(struct convKernel * cons
+ static void
+ getKernelPnm(const char * const fileName,
+ unsigned int const depth,
+- bool const nooffset,
++ bool const offset,
+ struct convKernel ** const convKernelPP) {
++/*----------------------------------------------------------------------------
++ Get the convolution kernel from the PNM file named 'fileName'.
++ 'offset' means the PNM convolution matrix is defined in offset form so
++ that it can represent negative values. E.g. with maxval 100, 50 means
++ 0, 100 means 50, and 0 means -50. If 'offsetPgm' is false, 0 means 0
++ and there are no negative weights.
++
++ Make the kernel suitable for convolving an image of depth 'depth'.
+
++ Return the kernel as *convKernelPP.
++-----------------------------------------------------------------------------*/
+ struct pam cpam;
+ FILE * cifP;
+ tuple ** ctuples;
+@@ -594,7 +604,7 @@ getKernelPnm(const char * const
+
+ validateKernelDimensions(cpam.width, cpam.height);
+
+- convKernelCreatePnm(&cpam, ctuples, depth, nooffset, convKernelPP);
++ convKernelCreatePnm(&cpam, ctuples, depth, offset, convKernelPP);
+ }
+
+
+@@ -893,7 +903,7 @@ getKernel(struct cmdlineInfo const cmd
+ struct convKernel * convKernelP;
+
+ if (cmdline.pnmMatrixFileName)
+- getKernelPnm(cmdline.pnmMatrixFileName, depth, cmdline.nooffset,
++ getKernelPnm(cmdline.pnmMatrixFileName, depth, !cmdline.nooffset,
+ &convKernelP);
+ else if (cmdline.matrixfile)
+ convKernelCreateSimpleFile(cmdline.matrixfile, cmdline.normalize,
diff --git a/media-libs/netpbm/files/netpbm-10.51.00-ppmtompeg-free.patch b/media-libs/netpbm/files/netpbm-10.51.00-ppmtompeg-free.patch
new file mode 100644
index 00000000..0c1e4854
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.51.00-ppmtompeg-free.patch
@@ -0,0 +1,35 @@
+fix from upstream
+
+------------------------------------------------------------------------
+r1285 | giraffedata | 2010-09-18 16:13:39 -0400 (Sat, 18 Sep 2010) | 1 line
+
+Fix free of non-allocated memory
+
+Index: converter/ppm/ppmtompeg/param.c
+===================================================================
+--- converter/ppm/ppmtompeg/param.c (revision 1284)
++++ converter/ppm/ppmtompeg/param.c (revision 1285)
+@@ -283,8 +283,8 @@ GetFrameRate(const char * const p)
+
+
+ static void
+-mergeInputSource(struct inputSource * const baseSourceP,
+- struct inputSource * const addedSourceP) {
++mergeInputSource(struct inputSource * const baseSourceP,
++ const struct inputSource * const addedSourceP) {
+
+ unsigned int i;
+
+@@ -294,12 +294,6 @@ mergeInputSource(struct inputSource * co
+ for (i = 0; i < addedSourceP->numInputFileEntries; ++i)
+ baseSourceP->inputFileEntries[baseSourceP->numInputFileEntries++] =
+ addedSourceP->inputFileEntries[i];
+-
+- free(addedSourceP);
+- /* Note the space allocated for the *addedSourceP input file
+- entries themselves is still allocated, and used by
+- *baseSourceP.
+- */
+ }
+
+
diff --git a/media-libs/netpbm/files/netpbm-10.51.00-underlinking.patch b/media-libs/netpbm/files/netpbm-10.51.00-underlinking.patch
new file mode 100644
index 00000000..e161242c
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.51.00-underlinking.patch
@@ -0,0 +1,16 @@
+ converter/other/Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/converter/other/Makefile b/converter/other/Makefile
+index 1417cd3..c178101 100644
+--- a/converter/other/Makefile
++++ b/converter/other/Makefile
+@@ -167,7 +167,7 @@ pngtopam: %: %.o pngx.o $(NETPBMLIB) $(LIBOPT)
+ pnmtopng: %: %.o pngx.o pngtxt.o $(NETPBMLIB) $(LIBOPT)
+ $(LD) -o $@ $@.o pngx.o pngtxt.o \
+ $(shell $(LIBOPT) $(NETPBMLIB)) \
+- $(PNGLIB_LIBOPTS) $(MATHLIB) $(LDFLAGS) $(LDLIBS) $(RPATH) $(LADD)
++ $(PNGLIB_LIBOPTS) $(MATHLIB) $(LDFLAGS) $(LDLIBS) $(RPATH) $(LADD) -lz
+
+ pamrgbatopng: %: %.o $(NETPBMLIB) $(LIBOPT)
+ $(LD) -o $@ $@.o \
diff --git a/media-libs/netpbm/metadata.xml b/media-libs/netpbm/metadata.xml
new file mode 100644
index 00000000..86743338
--- /dev/null
+++ b/media-libs/netpbm/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>graphics</herd>
+ <use>
+ <flag name="rle">Build converters for the RLE format (utah raster toolkit)</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-libs/netpbm/netpbm-10.51.00-r99.ebuild b/media-libs/netpbm/netpbm-10.51.00-r99.ebuild
new file mode 100644
index 00000000..ea6cfbed
--- /dev/null
+++ b/media-libs/netpbm/netpbm-10.51.00-r99.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/netpbm/netpbm-10.51.00-r2.ebuild,v 1.6 2013/08/27 15:32:09 kensington Exp $
+
+EAPI="3"
+
+inherit toolchain-funcs eutils multilib
+
+DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
+HOMEPAGE="http://netpbm.sourceforge.net/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-libpng-1.5.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="jbig jpeg jpeg2k png rle svga tiff X xml zlib"
+
+RDEPEND="jbig? ( media-libs/jbigkit )
+ jpeg? ( virtual/jpeg:0 )
+ jpeg2k? ( media-libs/jasper )
+ png? ( >=media-libs/libpng-1.4:0 )
+ rle? ( media-libs/urt )
+ svga? ( media-libs/svgalib )
+ tiff? ( >=media-libs/tiff-3.5.5:0 )
+ xml? ( dev-libs/libxml2 )
+ zlib? ( sys-libs/zlib )
+ X? ( x11-libs/libX11 )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-devel/flex"
+
+maint_pkg_create() {
+ local base="/usr/local/src"
+ local srcdir="${base}/netpbm/release_number"
+ if [[ -d ${srcdir} ]] ; then
+ cd "${T}" || die
+
+ ebegin "Exporting ${srcdir}/${PV} to netpbm-${PV}"
+ svn export -q ${srcdir}/${PV} netpbm-${PV}
+ eend $? || return 1
+
+ ebegin "Creating netpbm-${PV}.tar.xz"
+ tar cf - netpbm-${PV} | xz > netpbm-${PV}.tar.xz
+ eend $?
+
+ einfo "Tarball now ready at: ${T}/netpbm-${PV}.tar.xz"
+ else
+ einfo "You need to run:"
+ einfo " cd ${base}"
+ einfo " svn co https://netpbm.svn.sourceforge.net/svnroot/netpbm"
+ die "need svn checkout dir"
+ fi
+}
+pkg_setup() { [[ -n ${VAPIER_LOVES_YOU} && ! -e ${DISTDIR}/${P}.tar.xz ]] && maint_pkg_create ; }
+
+netpbm_libtype() {
+ case ${CHOST} in
+ *-darwin*) echo dylib;;
+ *) echo unixshared;;
+ esac
+}
+netpbm_libsuffix() {
+ local suffix=$(get_libname)
+ echo ${suffix//\.}
+}
+netpbm_ldshlib() {
+ case ${CHOST} in
+ *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name $(SONAME)';;
+ *) echo '$(LDFLAGS) -shared -Wl,-soname,$(SONAME)';;
+ esac
+}
+netpbm_config() {
+ if use $1 ; then
+ [[ $2 != "!" ]] && echo -l${2:-$1}
+ else
+ echo NONE
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/netpbm-10.31-build.patch
+ epatch "${FILESDIR}"/${P}-ppmtompeg-free.patch
+ epatch "${FILESDIR}"/${P}-pnmconvol-nooffset.patch #338230
+ epatch "${WORKDIR}"/${P}-libpng-1.5.patch #355025
+ epatch "${FILESDIR}"/${P}-underlinking.patch #367405
+
+ epatch "${FILESDIR}"/${P}-getline.patch
+
+ # make sure we use system urt
+ sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die
+ rm -rf urt
+
+ # take care of the importinc stuff ourselves by only doing it once
+ # at the top level and having all subdirs use that one set #149843
+ sed -i \
+ -e '/^importinc:/s|^|importinc:\nmanual_|' \
+ -e '/-Iimportinc/s|-Iimp|-I"$(BUILDDIR)"/imp|g'\
+ common.mk || die
+ sed -i \
+ -e '/%.c/s: importinc$::' \
+ common.mk lib/Makefile lib/util/Makefile || die
+
+ # avoid ugly depend.mk warnings
+ touch $(find . -name Makefile | sed s:Makefile:depend.mk:g)
+}
+
+src_configure() {
+ cat config.mk.in - >> config.mk <<-EOF
+ # Misc crap
+ BUILD_FIASCO = N
+ SYMLINK = ln -sf
+
+ # Toolchain options
+ CC = $(tc-getCC) -Wall
+ LD = \$(CC)
+ CC_FOR_BUILD = $(tc-getBUILD_CC)
+ LD_FOR_BUILD = \$(CC_FOR_BUILD)
+ AR = $(tc-getAR)
+ RANLIB = $(tc-getRANLIB)
+
+ STRIPFLAG =
+ CFLAGS_SHLIB = -fPIC
+
+ LDRELOC = \$(LD) -r
+ LDSHLIB = $(netpbm_ldshlib)
+ LINKER_CAN_DO_EXPLICIT_LIBRARY = N # we can, but dont want to
+ LINKERISCOMPILER = Y
+ NETPBMLIBSUFFIX = $(netpbm_libsuffix)
+ NETPBMLIBTYPE = $(netpbm_libtype)
+
+ # Gentoo build options
+ TIFFLIB = $(netpbm_config tiff)
+ JPEGLIB = $(netpbm_config jpeg)
+ PNGLIB = $(netpbm_config png)
+ ZLIB = $(netpbm_config zlib z)
+ LINUXSVGALIB = $(netpbm_config svga vga)
+ XML2_LIBS = $(netpbm_config xml xml2)
+ JBIGLIB = -ljbig
+ JBIGHDR_DIR = $(netpbm_config jbig "!")
+ JASPERLIB = -ljasper
+ JASPERHDR_DIR = $(netpbm_config jpeg2k "!")
+ URTLIB = $(netpbm_config rle)
+ URTHDR_DIR =
+ X11LIB = $(netpbm_config X X11)
+ X11HDR_DIR =
+ EOF
+ # cannot chain the die with the heredoc above as bash-3
+ # has a parser bug in that setup #282902
+ [ $? -eq 0 ] || die "writing config.mk failed"
+}
+
+src_compile() {
+ emake -j1 pm_config.h version.h manual_importinc || die #149843
+ emake || die
+}
+
+src_install() {
+ # Subdir make targets like to use `mkdir` all over the place
+ # without any actual dependencies, thus the -j1.
+ emake -j1 package pkgdir="${D}"/usr || die
+
+ [[ $(get_libdir) != "lib" ]] && mv "${D}"/usr/lib "${D}"/usr/$(get_libdir)
+
+ # Remove cruft that we don't need, and move around stuff we want
+ rm "${D}"/usr/bin/{doc.url,manweb} || die
+ rm -r "${D}"/usr/man/web || die
+ rm -r "${D}"/usr/link || die
+ rm "${D}"/usr/{README,VERSION,config_template,pkginfo} || die
+ dodir /usr/share
+ mv "${D}"/usr/man "${D}"/usr/share/ || die
+ mv "${D}"/usr/misc "${D}"/usr/share/netpbm || die
+
+ dodoc README
+ cd doc
+ dodoc HISTORY Netpbm.programming USERDOC
+ dohtml -r .
+}
diff --git a/media-sound/mpg123/Manifest b/media-sound/mpg123/Manifest
new file mode 100644
index 00000000..7890c196
--- /dev/null
+++ b/media-sound/mpg123/Manifest
@@ -0,0 +1,4 @@
+AUX mpg123-largefile.patch 663 SHA256 fe2da2e20ec85c5201d574bf24da14a6c96c6af5d0b6eaf9b7702704e3fa9cfd SHA512 b9de804a3e8732207f3663f371d6292ea1b000fad501c8d4bb78fa4ac25ba1c5bf4824cc9e7f90c66dc8bcb44485abc1d00ef4c9abd7a1771fe458d5936fbde1 WHIRLPOOL cc42589f0941839427e27f226c688d525d4b7581fbe65b31a11bdec931890cfddaeb8ac5d80074f44768e192d598b10b330b561a51f1dc761912eab6f6001e99
+DIST mpg123-1.15.4.tar.bz2 802566 SHA256 6885fda3584566c5fa4816e635dfa1d34babf397333b2af00ab7263faffe5115 SHA512 6c16adfe47aa1a474795aa655429bfa2db6b6ade52267ed8352fb76bd82284431c6c0a90651d30be6efe9942e82656658304d0b6fd6a065fce2fe07cecf5fd9f WHIRLPOOL 7971e91b3b36c070746e710f6b4ac94129200680ea943f829d21b880f1ea8afc51ad1588789929e0ddcd4bfe6783e00f8158db6f84362b95507aa3369dc9d9ba
+EBUILD mpg123-1.15.4-r99.ebuild 2278 SHA256 4972f678865aec2478de3b658ecc0c30ba9a25dab9e2842f747d09e4b8251652 SHA512 f4f097c745cda0830ceacfdebbd8fd6d52262ceda8b3ee320abccf6830f1fe11e0335bb2d60e603ced09afe04ac69cda02981d83ff7f099cffea01aceed708c3 WHIRLPOOL 1c44f7b8e5fb12e38385bc76eccba1574557599a762a924b346faf069217aa892febda0e9de8cbfca85235ef5d32755441c05bb3687a24a8126356a2f77e16a8
+MISC metadata.xml 492 SHA256 ec073d0ca010ed50d6b671f13cc98a6ee6f221526e56886b469d436c25a6042e SHA512 0cb2796ed7f5eb2696d374b45f83a371944257d177d6c73df0495178dd9e43a56efe947ccdf09dcb306c051f4e00c1af3f95201a32b93ae7eef449fe2acbe7dc WHIRLPOOL 7b1da43b004d4cf690fd16915d0af64207e4ccbf391f8ae1253d14f916a44c92ecfdbe80473c8a0fdff9aa82a7366f42348c97525057ccf1195a8722ff5c67a6
diff --git a/media-sound/mpg123/files/mpg123-largefile.patch b/media-sound/mpg123/files/mpg123-largefile.patch
new file mode 100644
index 00000000..81bab6d3
--- /dev/null
+++ b/media-sound/mpg123/files/mpg123-largefile.patch
@@ -0,0 +1,10 @@
+--- a/mpg123-1.15.4/src/libmpg123/mpg123.h.in
++++ b/mpg123-1.15.4/src/libmpg123/mpg123.h.in
+@@ -53,6 +53,7 @@
+ Now, the renaming of large file aware functions.
+ By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
+ */
++#define MPG123_NO_LARGENAME
+ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX))
+
+ /* Need some trickery to concatenate the value(s) of the given macro(s). */
diff --git a/media-sound/mpg123/metadata.xml b/media-sound/mpg123/metadata.xml
new file mode 100644
index 00000000..e45dc8d1
--- /dev/null
+++ b/media-sound/mpg123/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>sound</herd>
+ <upstream>
+ <maintainer>
+ <email>thomas-forum@orgis.org</email>
+ <name>Thomas Orgis</name>
+ </maintainer>
+ </upstream>
+ <use>
+ <flag name="3dnowext">Enable 3dnowext cpu instructions</flag>
+ <flag name="int-quality">Use rounding instead of fast truncation for integer output, where possible</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-sound/mpg123/mpg123-1.15.4-r99.ebuild b/media-sound/mpg123/mpg123-1.15.4-r99.ebuild
new file mode 100644
index 00000000..6410cc71
--- /dev/null
+++ b/media-sound/mpg123/mpg123-1.15.4-r99.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mpg123/mpg123-1.15.4.ebuild,v 1.11 2013/08/07 13:24:23 ago Exp $
+
+EAPI=5
+inherit toolchain-funcs libtool flag-o-matic
+
+DESCRIPTION="a realtime MPEG 1.0/2.0/2.5 audio player for layers 1, 2 and 3"
+HOMEPAGE="http://www.mpg123.org/"
+SRC_URI="http://www.mpg123.org/download/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="3dnow 3dnowext alsa altivec coreaudio int-quality ipv6 jack mmx nas oss portaudio pulseaudio sdl sse"
+
+RDEPEND="app-eselect/eselect-mpg123
+ >=sys-devel/libtool-2.2.6b
+ alsa? ( media-libs/alsa-lib )
+ jack? ( media-sound/jack-audio-connection-kit )
+ nas? ( media-libs/nas )
+ portaudio? ( media-libs/portaudio )
+ pulseaudio? ( media-sound/pulseaudio )
+ sdl? ( media-libs/libsdl )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+DOCS=( AUTHORS ChangeLog NEWS NEWS.libmpg123 README )
+
+src_prepare() {
+ elibtoolize # for Darwin bundles
+
+ epatch ${FILESDIR}/${PN}-largefile.patch
+}
+
+src_configure() {
+ local _audio=dummy
+ local _output=dummy
+ local _cpu=generic_fpu
+
+ for flag in nas portaudio sdl oss jack alsa pulseaudio coreaudio; do
+ if use ${flag}; then
+ _audio="${_audio} ${flag/pulseaudio/pulse}"
+ _output=${flag/pulseaudio/pulse}
+ fi
+ done
+
+ use altivec && _cpu=altivec
+
+ if [[ $(tc-arch) == amd64 || ${ARCH} == x64-* ]]; then
+ use sse && _cpu=x86-64
+ elif use x86 && gcc-specs-pie ; then
+ # Don't use any mmx, 3dnow, sse and 3dnowext #bug 164504
+ _cpu=generic_fpu
+ elif use x86-macos ; then
+ # ASM doesn't work quite as expected with the Darwin linker
+ _cpu=generic_fpu
+ else
+ use mmx && _cpu=mmx
+ use 3dnow && _cpu=3dnow
+ use sse && _cpu=x86
+ use 3dnowext && _cpu=x86
+ fi
+
+ econf \
+ --with-optimization=0 \
+ --with-audio="${_audio}" \
+ --with-default-audio=${_output} \
+ --with-cpu=${_cpu} \
+ --enable-network \
+ --disable-lfs-alias \
+ $(use_enable ipv6) \
+ --enable-int-quality=$(usex int-quality)
+}
+
+src_install() {
+ default
+ mv "${ED}"/usr/bin/mpg123{,-mpg123}
+ find "${ED}" -name '*.la' -exec sed -i -e "/^dependency_libs/s:=.*:='':" {} +
+}
+
+pkg_postinst() {
+ eselect mpg123 update ifunset
+}
+
+pkg_postrm() {
+ eselect mpg123 update ifunset
+}
diff --git a/media-video/ffmpeg/Manifest b/media-video/ffmpeg/Manifest
new file mode 100644
index 00000000..20f21a0d
--- /dev/null
+++ b/media-video/ffmpeg/Manifest
@@ -0,0 +1,8 @@
+AUX dirac_arith_hardened.patch 1184 SHA256 80e0ffcfd9db67f6a15df93f081e4eae24b0f6879a394c8d1ba6a29b239b62b4 SHA512 996e6439a984d87adb2f42afc00d3011324e0752bea50bf2708a701cf21ebde53ec3a2051c0c85aaa7d04a515088aa8e54d3845cdc125c5be8a3e98f2e7143d0 WHIRLPOOL 6ac462685a2eef402e583b1778f7a5c241a0a47a742b22531b5137bea4c8c977ddd2145fcb925dd0900ee79810c7dbc49c6ff1d358b77e216f33a68c790db060
+AUX ffmpeg-1.2.6-strerror_r.patch 207 SHA256 6d871e59b0258d99b70909890b060c32db362268ad72af8fa6526c3ca84bbb0a SHA512 8f8fb3a1a4519ca721f6309c5a455e1c68ae0815bea225b8cb426909ece28a4bbade7c47cf94f4388cc94173d999d05f9447389ff7301d2143303472443ba7a3 WHIRLPOOL 4aec9eb1e581d9177eb895cebc0b6fd54e50156953d8b83f010fc439ddd67bd6f4a80a5b3f2e33d25830a5307c4b64f906f33c432f3bd9cd5568bf4b494c6fe7
+AUX ladspadl.patch 723 SHA256 b660bef2bdd4ecba5c3ec04fccee16f4ed3eab0dc7f125f19ab004274df7d17a SHA512 fa2022e2ac73cdf63a7ebdcc71672123adf223b4eca4ee027974a3de380f54378d063166c7048c243ccfb2a95b8ebbd1115f010fe9e491bbdcee7896c523d790 WHIRLPOOL c2d175d1e953117365a929ba85d75b0fc5e60ae4e23a00a2998c6f62c00084a3d78becf027ef2710f8768cd7528b333dfad9dbfea049a7d2f45b5b66751e16a4
+DIST ffmpeg-1.2.6.tar.bz2 5970714 SHA256 29d454de3458cf327df246cc2a2ef0fa09cb88af7880f733525de12bde70999c SHA512 bc3aa640549e7f17f3a24a7d866a89ab23e9920c2d655a1a03bb4b85b8bdc33500bce3ba6fb570376453c158291a6f4bd2953f258d5a3f989cbdcb30e9a25ee4 WHIRLPOOL 6959a0e72b98dfb56381010f06f98d387a6389037d214f8d600d868d41baddd73417b5df7b00c8b160f6a59778c20c27708d2cc115dde76d6c94dcfbf307b51e
+DIST ffmpeg-2.2.14.tar.bz2 7033140 SHA256 c7e34ad8b9b12b07b469b7c0b64aad72edc70e72d924d4a04b943b3ad80ca053 SHA512 c22aa4bdaf3819c1b3210fc99e6fbcbc3b91eb77f3aeadf05a4a0b86ba6d08c40e7b7a56d3dce02ca90bfc269fa6ca89dcf748cf2693f04aa4ee72fdff43c3fe WHIRLPOOL 3c376ead8aa23ff3b43f75bd22e6798d5e1c9b42e914012fe41294b3dfdd1d1ecdbdfd8052241252b6b4f77fce624f574d20ac62cde5cd33ef18017eb4719a5f
+EBUILD ffmpeg-1.2.6-r99.ebuild 8965 SHA256 0f757677dc2fe7b8ea9cb8fb77fe490cb6db33700ede651a82bfceea2af0c4d7 SHA512 7d1fc9727dc760569069c9f468efcda68e10860c846ac00cf6545308cbd84bbcab6ed0cd844024484689cd0d210f3ff99843332a89dbb12ed3bc518827616a62 WHIRLPOOL 0b180583b96c95a19fb047137630d10b8f220c0faf7deaea2fbb819263bc4d59fef2ac9d2a552900fc5e640f485c7bfed8640d8a27c784beda17a4011ddbb7e6
+EBUILD ffmpeg-2.2.14-r99.ebuild 12661 SHA256 133ea5a880299facf68cc2c8920cabd7c998939d46785ea91e3f66576cbf7eb8 SHA512 a1999548a9566a30bfd50f2ad9b3955f35bbe531168407158a24568938a12c17e1e0ff531fa645c945d4f4693985e309e94d4d9eae16ecfafc735b2086ae74b1 WHIRLPOOL 1ffcf3034ab4c750629308ac01fcf3069e9f5ccae33166f5decff0868adabeb28a19f5080817ad663f0ad6f5604476b4f10be36476a647036f1b53d767868046
+MISC metadata.xml 3363 SHA256 3bb3c89b2b41d67f8e5634ed705607da65d3eb00739b37c117ec6fe846193e47 SHA512 eb47b0e4d6c90e6ed98c3a4138c9e3df7ea26895826e367987ac3b75dc1aa23314d4c0e7f8458bbd16e4f19f966c050872e4f570ed895ba86a0c4ab9fae0b9ef WHIRLPOOL add8dfd6ceeed938444cfee2cec031ee406acfd82ed797ef897a72f1db80ca90fd3b87565573d31c5f39b4100a10ecadb2ad8c89767190e3ad6029bca0216e9a
diff --git a/media-video/ffmpeg/ffmpeg-1.2.6-r99.ebuild b/media-video/ffmpeg/ffmpeg-1.2.6-r99.ebuild
new file mode 100644
index 00000000..8d013abd
--- /dev/null
+++ b/media-video/ffmpeg/ffmpeg-1.2.6-r99.ebuild
@@ -0,0 +1,305 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ffmpeg/ffmpeg-1.2.6.ebuild,v 1.12 2014/06/08 13:01:45 ago Exp $
+
+EAPI="4"
+
+SCM=""
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SCM="git-2"
+ EGIT_REPO_URI="git://source.ffmpeg.org/ffmpeg.git"
+fi
+
+inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
+
+DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec."
+HOMEPAGE="http://ffmpeg.org/"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SRC_URI=""
+elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+else # Release
+ SRC_URI="http://ffmpeg.org/releases/${P/_/-}.tar.bz2"
+fi
+FFMPEG_REVISION="${PV#*_p}"
+
+LICENSE="GPL-2 amr? ( GPL-3 ) encode? ( aac? ( GPL-3 ) )"
+SLOT="0"
+if [ "${PV#9999}" = "${PV}" ] ; then
+ KEYWORDS="amd64 arm ~mips ppc x86"
+fi
+IUSE="
+ aac aacplus alsa amr bindist bluray +bzip2 cdio celt
+ cpudetection debug doc +encode examples faac fdk flite fontconfig frei0r
+ gnutls gsm +hardcoded-tables +iconv iec61883 ieee1394 jack jpeg2k libass
+ libcaca libsoxr libv4l modplug mp3 +network openal openssl opus oss pic
+ pulseaudio rtmp schroedinger sdl speex static-libs test theora threads
+ truetype twolame v4l vaapi vdpau vorbis vpx X x264 xvid +zlib
+ "
+
+# String for CPU features in the useflag[:configure_option] form
+# if :configure_option isn't set, it will use 'useflag' as configure option
+CPU_FEATURES="3dnow:amd3dnow 3dnowext:amd3dnowext altivec avx mmx mmxext ssse3 vis neon"
+
+for i in ${CPU_FEATURES}; do
+ IUSE="${IUSE} ${i%:*}"
+done
+
+FFTOOLS="aviocat cws2fws ffescape ffeval fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher"
+
+for i in ${FFTOOLS}; do
+ IUSE="${IUSE} +fftools_$i"
+done
+
+RDEPEND="
+ alsa? ( media-libs/alsa-lib )
+ amr? ( media-libs/opencore-amr )
+ bluray? ( media-libs/libbluray )
+ bzip2? ( app-arch/bzip2 )
+ cdio? ( || ( dev-libs/libcdio-paranoia <dev-libs/libcdio-0.90[-minimal] ) )
+ celt? ( >=media-libs/celt-0.11.1 )
+ encode? (
+ aac? ( media-libs/vo-aacenc )
+ aacplus? ( media-libs/libaacplus )
+ amr? ( media-libs/vo-amrwbenc )
+ faac? ( media-libs/faac )
+ fdk? ( media-libs/fdk-aac )
+ mp3? ( >=media-sound/lame-3.98.3 )
+ theora? ( >=media-libs/libtheora-1.1.1[encode] media-libs/libogg )
+ twolame? ( media-sound/twolame )
+ x264? ( >=media-libs/x264-0.0.20111017 )
+ xvid? ( >=media-libs/xvid-1.1.0 )
+ )
+ flite? ( app-accessibility/flite )
+ fontconfig? ( media-libs/fontconfig )
+ frei0r? ( media-plugins/frei0r-plugins )
+ gnutls? ( >=net-libs/gnutls-2.12.16 )
+ gsm? ( >=media-sound/gsm-1.0.12-r1 )
+ iconv? ( virtual/libiconv )
+ iec61883? ( media-libs/libiec61883 sys-libs/libraw1394 sys-libs/libavc1394 )
+ ieee1394? ( media-libs/libdc1394 sys-libs/libraw1394 )
+ jack? ( media-sound/jack-audio-connection-kit )
+ jpeg2k? ( >=media-libs/openjpeg-1.3-r2:0 )
+ libass? ( media-libs/libass )
+ libcaca? ( media-libs/libcaca )
+ libsoxr? ( media-libs/soxr )
+ libv4l? ( media-libs/libv4l )
+ modplug? ( media-libs/libmodplug )
+ openal? ( >=media-libs/openal-1.1 )
+ openssl? ( dev-libs/openssl )
+ opus? ( media-libs/opus )
+ pulseaudio? ( media-sound/pulseaudio )
+ rtmp? ( >=media-video/rtmpdump-2.2f )
+ sdl? ( >=media-libs/libsdl-1.2.13-r1[sound,video] )
+ schroedinger? ( media-libs/schroedinger )
+ speex? ( >=media-libs/speex-1.2_beta3 )
+ truetype? ( media-libs/freetype:2 )
+ vaapi? ( >=x11-libs/libva-0.32 )
+ vdpau? ( x11-libs/libvdpau )
+ vorbis? ( media-libs/libvorbis media-libs/libogg )
+ vpx? ( >=media-libs/libvpx-0.9.6 )
+ X? ( x11-libs/libX11 x11-libs/libXext x11-libs/libXfixes )
+ zlib? ( sys-libs/zlib )
+ !media-video/qt-faststart
+ !media-libs/libpostproc
+"
+
+DEPEND="${RDEPEND}
+ >=sys-devel/make-3.81
+ doc? ( app-text/texi2html )
+ fontconfig? ( virtual/pkgconfig )
+ gnutls? ( virtual/pkgconfig )
+ ieee1394? ( virtual/pkgconfig )
+ libv4l? ( virtual/pkgconfig )
+ mmx? ( dev-lang/yasm )
+ rtmp? ( virtual/pkgconfig )
+ schroedinger? ( virtual/pkgconfig )
+ test? ( net-misc/wget )
+ truetype? ( virtual/pkgconfig )
+ v4l? ( sys-kernel/linux-headers )
+"
+# faac is license-incompatible with ffmpeg
+REQUIRED_USE="bindist? ( encode? ( !faac !aacplus ) !openssl )
+ libv4l? ( v4l )
+ fftools_cws2fws? ( zlib )
+ test? ( encode )"
+
+S=${WORKDIR}/${P/_/-}
+BUILD_DIR=${S}_build
+
+src_prepare() {
+ if [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
+ export revision=git-N-${FFMPEG_REVISION}
+ fi
+
+ epatch "${FILESDIR}/dirac_arith_hardened.patch"
+ epatch "${FILESDIR}/${P}-strerror_r.patch" # for musl
+ epatch_user
+}
+
+src_configure() {
+ mkdir -p "${BUILD_DIR}"
+ cd "${BUILD_DIR}"
+
+ local myconf="${EXTRA_FFMPEG_CONF}"
+
+ # options to use as use_enable in the foo[:bar] form.
+ # This will feed configure with $(use_enable foo bar)
+ # or $(use_enable foo foo) if no :bar is set.
+ local ffuse="bzip2:bzlib cpudetection:runtime-cpudetect debug doc
+ gnutls hardcoded-tables iconv network openssl sdl:ffplay vaapi vdpau zlib"
+ use openssl && myconf="${myconf} --enable-nonfree"
+
+ # Encoders
+ if use encode
+ then
+ ffuse="${ffuse} aac:libvo-aacenc amr:libvo-amrwbenc mp3:libmp3lame fdk:libfdk-aac"
+ for i in aacplus faac theora twolame x264 xvid; do
+ ffuse="${ffuse} ${i}:lib${i}"
+ done
+
+ # Licensing.
+ if use aac || use amr ; then
+ myconf="${myconf} --enable-version3"
+ fi
+ if use aacplus || use faac || use fdk ; then
+ myconf="${myconf} --enable-nonfree"
+ fi
+ else
+ myconf="${myconf} --disable-encoders"
+ fi
+
+ # libavdevice options
+ ffuse="${ffuse} cdio:libcdio iec61883:libiec61883 ieee1394:libdc1394 libcaca openal"
+
+ # Indevs
+ use v4l || myconf="${myconf} --disable-indev=v4l2"
+ for i in alsa oss jack ; do
+ use ${i} || myconf="${myconf} --disable-indev=${i}"
+ done
+ ffuse="${ffuse} libv4l:libv4l2 pulseaudio:libpulse X:x11grab"
+
+ # Outdevs
+ for i in alsa oss sdl ; do
+ use ${i} || myconf="${myconf} --disable-outdev=${i}"
+ done
+
+ # libavfilter options
+ ffuse="${ffuse} flite:libflite frei0r fontconfig libass truetype:libfreetype"
+
+ # libswresample options
+ ffuse="${ffuse} libsoxr"
+
+ # Threads; we only support pthread for now but ffmpeg supports more
+ ffuse="${ffuse} threads:pthreads"
+
+ # Decoders
+ ffuse="${ffuse} amr:libopencore-amrwb amr:libopencore-amrnb jpeg2k:libopenjpeg"
+ use amr && myconf="${myconf} --enable-version3"
+ for i in bluray celt gsm modplug opus rtmp schroedinger speex vorbis vpx; do
+ ffuse="${ffuse} ${i}:lib${i}"
+ done
+
+ for i in ${ffuse} ; do
+ myconf="${myconf} $(use_enable ${i%:*} ${i#*:})"
+ done
+
+ # CPU features
+ for i in ${CPU_FEATURES}; do
+ use ${i%:*} || myconf="${myconf} --disable-${i#*:}"
+ done
+ if use pic ; then
+ myconf="${myconf} --enable-pic"
+ # disable asm code if PIC is required
+ # as the provided asm decidedly is not PIC for x86.
+ use x86 && myconf="${myconf} --disable-asm"
+ fi
+ [[ ${ABI} == "x32" ]] && myconf+=" --disable-asm" #427004
+
+ # Try to get cpu type based on CFLAGS.
+ # Bug #172723
+ # We need to do this so that features of that CPU will be better used
+ # If they contain an unknown CPU it will not hurt since ffmpeg's configure
+ # will just ignore it.
+ for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
+ [ "${i}" = "native" ] && i="host" # bug #273421
+ myconf="${myconf} --cpu=${i}"
+ break
+ done
+
+ # Mandatory configuration
+ myconf="
+ --enable-gpl
+ --enable-postproc
+ --enable-avfilter
+ --enable-avresample
+ --disable-stripping
+ ${myconf}"
+
+ # cross compile support
+ if tc-is-cross-compiler ; then
+ myconf="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
+ case ${CHOST} in
+ *freebsd*)
+ myconf="${myconf} --target-os=freebsd"
+ ;;
+ mingw32*)
+ myconf="${myconf} --target-os=mingw32"
+ ;;
+ *linux*)
+ myconf="${myconf} --target-os=linux"
+ ;;
+ esac
+ fi
+
+ "${S}/configure" \
+ --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --mandir="${EPREFIX}/usr/share/man" \
+ --enable-shared \
+ --cc="$(tc-getCC)" \
+ --cxx="$(tc-getCXX)" \
+ --ar="$(tc-getAR)" \
+ --optflags="${CFLAGS}" \
+ --extra-cflags="${CFLAGS}" \
+ --extra-cxxflags="${CXXFLAGS}" \
+ $(use_enable static-libs static) \
+ ${myconf} || die
+}
+
+src_compile() {
+ cd "${BUILD_DIR}"
+ emake V=1
+
+ for i in ${FFTOOLS} ; do
+ if use fftools_$i ; then
+ emake V=1 tools/$i
+ fi
+ done
+}
+
+src_install() {
+ cd "${BUILD_DIR}"
+ emake V=1 DESTDIR="${D}" install install-man
+
+ for i in ${FFTOOLS} ; do
+ if use fftools_$i ; then
+ dobin tools/$i
+ fi
+ done
+
+ cd "${S}"
+ dodoc Changelog README CREDITS doc/*.txt doc/APIchanges doc/RELEASE_NOTES
+ use doc && dohtml -r doc/*
+ if use examples ; then
+ dodoc -r doc/examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
+
+src_test() {
+ cd "${BUILD_DIR}"
+ LD_LIBRARY_PATH="${BUILD_DIR}/libpostproc:${BUILD_DIR}/libswscale:${BUILD_DIR}/libswresample:${BUILD_DIR}/libavcodec:${BUILD_DIR}/libavdevice:${BUILD_DIR}/libavfilter:${BUILD_DIR}/libavformat:${BUILD_DIR}/libavutil:${BUILD_DIR}/libavresample" \
+ emake V=1 fate
+}
diff --git a/media-video/ffmpeg/ffmpeg-2.2.14-r99.ebuild b/media-video/ffmpeg/ffmpeg-2.2.14-r99.ebuild
new file mode 100644
index 00000000..e5eb797c
--- /dev/null
+++ b/media-video/ffmpeg/ffmpeg-2.2.14-r99.ebuild
@@ -0,0 +1,375 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/ffmpeg/ffmpeg-2.2.14.ebuild,v 1.3 2015/04/11 12:09:46 zlogene Exp $
+
+EAPI="5"
+
+# Subslot: libavutil major.libavcodec major.libavformat major
+# Since FFmpeg ships several libraries, subslot is kind of limited here.
+# Most consumers will use those three libraries, if a "less used" library
+# changes its soname, consumers will have to be rebuilt the old way
+# (preserve-libs).
+# If, for example, a package does not link to libavformat and only libavformat
+# changes its ABI then this package will be rebuilt needlessly. Hence, such a
+# package is free _not_ to := depend on FFmpeg but I would strongly encourage
+# doing so since such a case is unlikely.
+FFMPEG_SUBSLOT=52.55.55
+
+SCM=""
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SCM="git-2"
+ EGIT_REPO_URI="git://source.ffmpeg.org/ffmpeg.git"
+fi
+
+inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs ${SCM}
+
+DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec"
+HOMEPAGE="http://ffmpeg.org/"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SRC_URI=""
+elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+else # Release
+ SRC_URI="http://ffmpeg.org/releases/${P/_/-}.tar.bz2"
+fi
+FFMPEG_REVISION="${PV#*_p}"
+
+LICENSE="GPL-2 amr? ( GPL-3 ) encode? ( aac? ( GPL-3 ) )"
+SLOT="0/${FFMPEG_SUBSLOT}"
+if [ "${PV#9999}" = "${PV}" ] ; then
+ KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
+fi
+IUSE="
+ aac aacplus alsa amr amrenc bluray +bzip2 cdio celt
+ cpudetection debug doc +encode examples faac fdk flite fontconfig frei0r
+ gme gnutls gsm +hardcoded-tables +iconv iec61883 ieee1394 jack jpeg2k
+ ladspa libass libcaca libsoxr libv4l modplug mp3 +network openal opengl
+ openssl opus oss pic pulseaudio quvi rtmp schroedinger sdl speex ssh
+ static-libs test theora threads truetype twolame v4l vaapi vdpau vorbis vpx
+ wavpack webp X x264 x265 xvid +zlib zvbi
+ "
+
+ARM_CPU_FEATURES="armv5te armv6 armv6t2 neon armvfp:vfp"
+MIPS_CPU_FEATURES="mips32r2 mipsdspr1 mipsdspr2 mipsfpu"
+PPC_CPU_FEATURES="altivec"
+X86_CPU_FEATURES=( 3dnow:amd3dnow 3dnowext:amd3dnowext avx:avx avx2:avx2 fma3:fma3 fma4:fma4 mmx:mmx mmxext:mmxext sse:sse sse2:sse2 sse3:sse3 ssse3:ssse3 sse4_1:sse4 sse4_2:sse42 )
+
+# String for CPU features in the useflag[:configure_option] form
+# if :configure_option isn't set, it will use 'useflag' as configure option
+CPU_FEATURES="
+ ${ARM_CPU_FEATURES}
+ ${MIPS_CPU_FEATURES}
+ ${PPC_CPU_FEATURES}
+ ${X86_CPU_FEATURES[@]/#/cpu_flags_x86_}
+"
+
+for i in ${CPU_FEATURES}; do
+ IUSE="${IUSE} ${i%:*}"
+done
+
+FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher"
+
+for i in ${FFTOOLS}; do
+ IUSE="${IUSE} +fftools_$i"
+done
+
+RDEPEND="
+ alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
+ amr? ( >=media-libs/opencore-amr-0.1.3-r1[${MULTILIB_USEDEP}] )
+ bluray? ( >=media-libs/libbluray-0.3.0-r1[${MULTILIB_USEDEP}] )
+ bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
+ cdio? ( >=dev-libs/libcdio-paranoia-0.90_p1-r1[${MULTILIB_USEDEP}] )
+ celt? ( >=media-libs/celt-0.11.1-r1[${MULTILIB_USEDEP}] )
+ encode? (
+ aac? ( >=media-libs/vo-aacenc-0.1.3[${MULTILIB_USEDEP}] )
+ aacplus? ( >=media-libs/libaacplus-2.0.2-r1[${MULTILIB_USEDEP}] )
+ amrenc? ( >=media-libs/vo-amrwbenc-0.1.2-r1[${MULTILIB_USEDEP}] )
+ faac? ( >=media-libs/faac-1.28-r3[${MULTILIB_USEDEP}] )
+ mp3? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] )
+ theora? (
+ >=media-libs/libtheora-1.1.1[encode,${MULTILIB_USEDEP}]
+ >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
+ )
+ twolame? ( >=media-sound/twolame-0.3.13-r1[${MULTILIB_USEDEP}] )
+ wavpack? ( >=media-sound/wavpack-4.60.1-r1[${MULTILIB_USEDEP}] )
+ webp? ( >=media-libs/libwebp-0.3.0[${MULTILIB_USEDEP}] )
+ x264? ( >=media-libs/x264-0.0.20130506:=[${MULTILIB_USEDEP}] )
+ x265? ( >=media-libs/x265-0.8:=[${MULTILIB_USEDEP}] )
+ xvid? ( >=media-libs/xvid-1.3.2-r1[${MULTILIB_USEDEP}] )
+ )
+ fdk? ( >=media-libs/fdk-aac-0.1.3[${MULTILIB_USEDEP}] )
+ flite? ( >=app-accessibility/flite-1.4-r4[${MULTILIB_USEDEP}] )
+ fontconfig? ( >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}] )
+ frei0r? ( media-plugins/frei0r-plugins )
+ gme? ( >=media-libs/game-music-emu-0.6.0[${MULTILIB_USEDEP}] )
+ gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}] )
+ gsm? ( >=media-sound/gsm-1.0.13-r1[${MULTILIB_USEDEP}] )
+ iconv? ( >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] )
+ iec61883? (
+ >=media-libs/libiec61883-1.2.0-r1[${MULTILIB_USEDEP}]
+ >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
+ >=sys-libs/libavc1394-0.5.4-r1[${MULTILIB_USEDEP}]
+ )
+ ieee1394? (
+ >=media-libs/libdc1394-2.2.1[${MULTILIB_USEDEP}]
+ >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
+ )
+ jack? ( >=media-sound/jack-audio-connection-kit-0.121.3-r1[${MULTILIB_USEDEP}] )
+ jpeg2k? ( >=media-libs/openjpeg-1.5.0:0[${MULTILIB_USEDEP}] )
+ libass? ( >=media-libs/libass-0.10.2[${MULTILIB_USEDEP}] )
+ libcaca? ( >=media-libs/libcaca-0.99_beta18-r1[${MULTILIB_USEDEP}] )
+ libsoxr? ( >=media-libs/soxr-0.1.0[${MULTILIB_USEDEP}] )
+ libv4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
+ modplug? ( >=media-libs/libmodplug-0.8.8.4-r1[${MULTILIB_USEDEP}] )
+ openal? ( >=media-libs/openal-1.15.1[${MULTILIB_USEDEP}] )
+ opengl? ( >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] )
+ openssl? ( >=dev-libs/openssl-1.0.1h-r2[${MULTILIB_USEDEP}] )
+ opus? ( >=media-libs/opus-1.0.2-r2[${MULTILIB_USEDEP}] )
+ pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
+ quvi? ( media-libs/libquvi:0.4 )
+ rtmp? ( >=media-video/rtmpdump-2.4_p20131018[${MULTILIB_USEDEP}] )
+ sdl? ( >=media-libs/libsdl-1.2.15-r4[sound,video,${MULTILIB_USEDEP}] )
+ schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] )
+ speex? ( >=media-libs/speex-1.2_rc1-r1[${MULTILIB_USEDEP}] )
+ ssh? ( >=net-libs/libssh-0.5.5[${MULTILIB_USEDEP}] )
+ truetype? ( >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}] )
+ vaapi? ( >=x11-libs/libva-1.2.1-r1[${MULTILIB_USEDEP}] )
+ vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
+ vorbis? (
+ >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
+ >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
+ )
+ vpx? ( >=media-libs/libvpx-1.2.0_pre20130625[${MULTILIB_USEDEP}] )
+ X? (
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}]
+ >=x11-libs/libXv-1.0.10[${MULTILIB_USEDEP}]
+ )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+ zvbi? ( >=media-libs/zvbi-0.2.35[${MULTILIB_USEDEP}] )
+ !media-video/qt-faststart
+ !media-libs/libpostproc
+"
+
+DEPEND="${RDEPEND}
+ >=sys-devel/make-3.81
+ doc? ( app-text/texi2html )
+ fontconfig? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ gnutls? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ ieee1394? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ ladspa? ( >=media-libs/ladspa-sdk-1.13-r2[${MULTILIB_USEDEP}] )
+ libv4l? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ cpu_flags_x86_mmx? ( >=dev-lang/yasm-1.2 )
+ rtmp? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ schroedinger? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ test? ( net-misc/wget sys-devel/bc )
+ truetype? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
+ v4l? ( sys-kernel/linux-headers )
+"
+
+RDEPEND="${RDEPEND}
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20140508-r3
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+
+REQUIRED_USE="
+ libv4l? ( v4l )
+ fftools_cws2fws? ( zlib )
+ test? ( encode )"
+# faac is license-incompatible with ffmpeg
+RESTRICT="encode? ( faac? ( bindist ) aacplus? ( bindist ) ) openssl? ( bindist )"
+
+S=${WORKDIR}/${P/_/-}
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/libavutil/avconfig.h
+)
+
+src_prepare() {
+ if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
+ export revision=git-N-${FFMPEG_REVISION}
+ fi
+ epatch "${FILESDIR}/ladspadl.patch"
+ epatch "${FILESDIR}/${PN}-1.2.6-strerror_r.patch"
+ epatch_user
+}
+
+multilib_src_configure() {
+ local myconf=( ${EXTRA_FFMPEG_CONF} )
+
+ # options to use as use_enable in the foo[:bar] form.
+ # This will feed configure with $(use_enable foo bar)
+ # or $(use_enable foo foo) if no :bar is set.
+ local ffuse=(
+ bzip2:bzlib cpudetection:runtime-cpudetect debug doc
+ gnutls hardcoded-tables iconv network openssl sdl:ffplay vaapi
+ vdpau zlib
+ )
+ use openssl && myconf+=( --enable-nonfree )
+
+ # Encoders
+ if use encode
+ then
+ ffuse+=( aac:libvo-aacenc amrenc:libvo-amrwbenc mp3:libmp3lame )
+ for i in aacplus faac theora twolame wavpack webp x264 x265 xvid; do
+ ffuse+=( ${i}:lib${i} )
+ done
+
+ # Licensing.
+ if use aac || use amrenc ; then
+ myconf+=( --enable-version3 )
+ fi
+ if use aacplus || use faac ; then
+ myconf+=( --enable-nonfree )
+ fi
+ else
+ myconf+=( --disable-encoders )
+ fi
+
+ # libavdevice options
+ ffuse+=( cdio:libcdio iec61883:libiec61883 ieee1394:libdc1394 libcaca openal opengl )
+
+ # Indevs
+ use v4l || myconf+=( --disable-indev=v4l2 --disable-outdev=v4l2 )
+ for i in alsa oss jack ; do
+ use ${i} || myconf+=( --disable-indev=${i} )
+ done
+ ffuse+=( libv4l:libv4l2 pulseaudio:libpulse X:x11grab )
+
+ # Outdevs
+ for i in alsa oss sdl ; do
+ use ${i} || myconf+=( --disable-outdev=${i} )
+ done
+
+ # libavfilter options
+ ffuse+=( flite:libflite frei0r fontconfig ladspa libass truetype:libfreetype )
+
+ # libswresample options
+ ffuse+=( libsoxr )
+
+ # Threads; we only support pthread for now but ffmpeg supports more
+ ffuse+=( threads:pthreads )
+
+ # Decoders
+ ffuse+=( amr:libopencore-amrwb amr:libopencore-amrnb fdk:libfdk-aac jpeg2k:libopenjpeg )
+ use amr && myconf+=( --enable-version3 )
+ for i in bluray celt gme gsm modplug opus quvi rtmp ssh schroedinger speex vorbis vpx zvbi; do
+ ffuse+=( ${i}:lib${i} )
+ done
+ use fdk && myconf+=( --enable-nonfree )
+
+ for i in "${ffuse[@]}" ; do
+ myconf+=( $(use_enable ${i%:*} ${i#*:}) )
+ done
+
+ # (temporarily) disable non-multilib deps
+ if ! multilib_is_native_abi; then
+ for i in frei0r libquvi; do
+ myconf+=( --disable-${i} )
+ done
+ fi
+
+ # CPU features
+ for i in ${CPU_FEATURES}; do
+ use ${i%:*} || myconf+=( --disable-${i#*:} )
+ done
+ if use pic ; then
+ myconf+=( --enable-pic )
+ # disable asm code if PIC is required
+ # as the provided asm decidedly is not PIC for x86.
+ [[ ${ABI} == x86 ]] && myconf+=( --disable-asm )
+ fi
+ [[ ${ABI} == x32 ]] && myconf+=( --disable-asm ) #427004
+
+ # Try to get cpu type based on CFLAGS.
+ # Bug #172723
+ # We need to do this so that features of that CPU will be better used
+ # If they contain an unknown CPU it will not hurt since ffmpeg's configure
+ # will just ignore it.
+ for i in $(get-flag mcpu) $(get-flag mtune) $(get-flag march) ; do
+ [[ ${i} = native ]] && i="host" # bug #273421
+ myconf+=( --cpu=${i} )
+ break
+ done
+
+ # Mandatory configuration
+ myconf=(
+ --enable-gpl
+ --enable-postproc
+ --enable-avfilter
+ --enable-avresample
+ --disable-stripping
+ "${myconf[@]}"
+ )
+
+ # cross compile support
+ if tc-is-cross-compiler ; then
+ myconf+=( --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}- )
+ case ${CHOST} in
+ *freebsd*)
+ myconf+=( --target-os=freebsd )
+ ;;
+ mingw32*)
+ myconf+=( --target-os=mingw32 )
+ ;;
+ *linux*)
+ myconf+=( --target-os=linux )
+ ;;
+ esac
+ fi
+
+ set -- "${S}/configure" \
+ --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --mandir="${EPREFIX}/usr/share/man" \
+ --enable-shared \
+ --cc="$(tc-getCC)" \
+ --cxx="$(tc-getCXX)" \
+ --ar="$(tc-getAR)" \
+ --optflags="${CFLAGS}" \
+ --extra-cflags="${CFLAGS}" \
+ --extra-cxxflags="${CXXFLAGS}" \
+ $(use_enable static-libs static) \
+ "${myconf[@]}"
+ echo "${@}"
+ "${@}" || die
+}
+
+multilib_src_compile() {
+ emake V=1
+
+ if multilib_is_native_abi; then
+ for i in ${FFTOOLS} ; do
+ if use fftools_${i} ; then
+ emake V=1 tools/${i}
+ fi
+ done
+ fi
+}
+
+multilib_src_install() {
+ emake V=1 DESTDIR="${D}" install install-man
+
+ if multilib_is_native_abi; then
+ for i in ${FFTOOLS} ; do
+ if use fftools_${i} ; then
+ dobin tools/${i}
+ fi
+ done
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc Changelog README CREDITS doc/*.txt doc/APIchanges doc/RELEASE_NOTES
+ use doc && dohtml -r doc/*
+ if use examples ; then
+ dodoc -r doc/examples
+ docompress -x /usr/share/doc/${PF}/examples
+ fi
+}
+
+multilib_src_test() {
+ LD_LIBRARY_PATH="${BUILD_DIR}/libpostproc:${BUILD_DIR}/libswscale:${BUILD_DIR}/libswresample:${BUILD_DIR}/libavcodec:${BUILD_DIR}/libavdevice:${BUILD_DIR}/libavfilter:${BUILD_DIR}/libavformat:${BUILD_DIR}/libavutil:${BUILD_DIR}/libavresample" \
+ emake V=1 fate
+}
diff --git a/media-video/ffmpeg/files/dirac_arith_hardened.patch b/media-video/ffmpeg/files/dirac_arith_hardened.patch
new file mode 100644
index 00000000..26614233
--- /dev/null
+++ b/media-video/ffmpeg/files/dirac_arith_hardened.patch
@@ -0,0 +1,36 @@
+commit d8ab7f31dd819f7b3e0d460a2fa4261aaae87b98
+Author: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
+Date: Wed Apr 9 12:18:32 2014 +0200
+
+ avcodec/dirac_arith: Fix build with PIC and stack-check options
+
+ Fixes Ticket3540
+
+ The function dirac_get_arith_bit in libavcodec/dirac_arith.h can't be
+ built with PIC and check-stack because the asm code needs 6 registers
+ and PIC and check-stack options take 1 each and x86 is quite limited
+ in this area.
+
+ Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
+
+diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h
+index f9a8bba..089c71a 100644
+--- a/libavcodec/dirac_arith.h
++++ b/libavcodec/dirac_arith.h
+@@ -28,6 +28,7 @@
+ #ifndef AVCODEC_DIRAC_ARITH_H
+ #define AVCODEC_DIRAC_ARITH_H
+
++#include "libavutil/x86/asm.h"
+ #include "bytestream.h"
+ #include "get_bits.h"
+
+@@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
+
+ range_times_prob = (c->range * prob_zero) >> 16;
+
+-#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
++#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
+ low -= range_times_prob << 16;
+ range -= range_times_prob;
+ bit = 0;
diff --git a/media-video/ffmpeg/files/ffmpeg-1.2.6-strerror_r.patch b/media-video/ffmpeg/files/ffmpeg-1.2.6-strerror_r.patch
new file mode 100644
index 00000000..bf0c8a5a
--- /dev/null
+++ b/media-video/ffmpeg/files/ffmpeg-1.2.6-strerror_r.patch
@@ -0,0 +1,10 @@
+--- a/ffmpeg-1.2.6/libavutil/error.c
++++ b/ffmpeg-1.2.6/libavutil/error.c
+@@ -17,6 +17,7 @@
+ */
+
+ #undef _GNU_SOURCE
++#define _POSIX_SOURCE
+ #include "avutil.h"
+ #include "avstring.h"
+ #include "common.h"
diff --git a/media-video/ffmpeg/files/ladspadl.patch b/media-video/ffmpeg/files/ladspadl.patch
new file mode 100644
index 00000000..12fc9889
--- /dev/null
+++ b/media-video/ffmpeg/files/ladspadl.patch
@@ -0,0 +1,25 @@
+From c27dc27c50cb016d470b45c5852c884718f4769c Mon Sep 17 00:00:00 2001
+From: Alexis Ballier <aballier@gentoo.org>
+Date: Tue, 20 May 2014 20:06:28 +0200
+Subject: [PATCH] Fix build with --enable-ladspa --disable-frei0r.
+
+https://bugs.gentoo.org/show_bug.cgi?id=510516
+---
+ configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure b/configure
+index b6d35ae..0848fed 100755
+--- a/configure
++++ b/configure
+@@ -2499,6 +2499,7 @@ hqdn3d_filter_deps="gpl"
+ interlace_filter_deps="gpl"
+ kerndeint_filter_deps="gpl"
+ ladspa_filter_deps="ladspa dlopen"
++ladspa_filter_extralibs='$ldl'
+ mcdeint_filter_deps="avcodec gpl"
+ movie_filter_deps="avcodec avformat"
+ mp_filter_deps="gpl avcodec swscale inline_asm"
+--
+1.9.3
+
diff --git a/media-video/ffmpeg/metadata.xml b/media-video/ffmpeg/metadata.xml
new file mode 100644
index 00000000..2137df54
--- /dev/null
+++ b/media-video/ffmpeg/metadata.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>video</herd>
+ <maintainer>
+ <email>media-video@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="3dnowext">
+ Enable manually-optimised routines using the AMD 3DNow!Ex SIMD
+ instruction set, present in modern AMD CPUs. (Check for
+ 3dnowext in /proc/cpuinfo to know whether your CPU supports it).
+ </flag>
+ <flag name="aacplus">AAC+ encoding via <pkg>media-libs/libaacplus</pkg>.</flag>
+ <flag name="amr">Enables Adaptive Multi-Rate Audio support</flag>
+ <flag name="avx">Adds support for Advanced Vector Extensions instructions (Intel Sandy Bridge, AMD Bulldozer and later chips)</flag>
+ <flag name="bindist">Enforces license compatibility constraints via REQUIRED_USE.</flag>
+ <flag name="bluray">Enable playback of Blu-ray filesystems</flag>
+ <flag name="cdio">Enables audio CD grabbing with <pkg>dev-libs/libcdio</pkg>.</flag>
+ <flag name="celt">Adds Xiph CELT audio decoding support via <pkg>media-libs/celt</pkg></flag>
+ <flag name="cpudetection">Enables runtime CPU detection (useful for bindist, compatibility on other CPUs)</flag>
+ <flag name="faac">Use external faac library for AAC encoding</flag>
+ <flag name="fdk">Use external fdk-aac library for AAC encoding</flag>
+ <flag name="flite">Adds a text-to-speech filter based on <pkg>app-accessibility/flite</pkg>.</flag>
+ <flag name="frei0r">Enable frei0r wrapping in libavfilter</flag>
+ <flag name="hardcoded-tables">Use pre-calculated tables rather than calculating them on the fly.</flag>
+ <flag name="iec61883"> Support for FireWire DV/HDV input device using <pkg>media-libs/libiec61883</pkg>.</flag>
+ <flag name="libsoxr">Enables audio resampling through <pkg>media-libs/soxr</pkg>.</flag>
+ <flag name="libv4l">Uses <pkg>media-libs/libv4l</pkg> for video4linux instead of direct calls. Adds support for more devices via the userspace library.</flag>
+ <flag name="mmxext">Enables mmx2 support</flag>
+ <flag name="network">Enables network streaming support</flag>
+ <flag name="openssl">Enables <pkg>dev-libs/openssl</pkg> support. Adds support for encrypted network protocols (TLS/HTTPS).</flag>
+ <flag name="opus">Adds (decoding) support for the Opus codec via <pkg>media-libs/opus</pkg>.</flag>
+ <flag name="pic">Force shared libraries to be built as PIC (this is slower)</flag>
+ <flag name="rtmp">Enable Real Time Messaging Protocol using librtmp</flag>
+ <flag name="schroedinger">Enable Dirac video support (an advanced royalty-free video compression format) via libschroedinger (high-speed implementation in C of the Dirac codec).</flag>
+ <flag name="ssse3">Faster floating point optimization for SSSE3 capable chips (Intel Core 2 and later chips)</flag>
+ <flag name="twolame">Enables MP2 encoding via <pkg>media-sound/twolame</pkg> as an alternative to the internal encoder.</flag>
+ <flag name="vaapi">Enables VAAPI (Video Acceleration API) for hardware decoding</flag>
+ <flag name="vis"> Adds support for SIMD optimizations for UltraSPARC processors.</flag>
+ <flag name="vpx">Enables vp8 codec support using libvpx: Decoding vp8 does not require this to be enabled but libvpx can also be used for decoding; encoding vp8 requires this useflag to be enabled though.</flag>
+ </use>
+</pkgmetadata>
diff --git a/metadata/layout.conf b/metadata/layout.conf
new file mode 100644
index 00000000..d43e61ca
--- /dev/null
+++ b/metadata/layout.conf
@@ -0,0 +1 @@
+masters = gentoo
diff --git a/net-dialup/ppp/ChangeLog b/net-dialup/ppp/ChangeLog
new file mode 100644
index 00000000..3943f050
--- /dev/null
+++ b/net-dialup/ppp/ChangeLog
@@ -0,0 +1,1306 @@
+# ChangeLog for net-dialup/ppp
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/ppp/ChangeLog,v 1.304 2015/05/14 10:21:15 pinkbyte Exp $
+
+ 14 May 2015; Sergey Popov <pinkbyte@gentoo.org> ppp-2.4.6-r3.ebuild,
+ ppp-2.4.7.ebuild, ppp-2.4.7-r1.ebuild:
+ Explicitly set SLOT on dev-libs/openssl dependency
+
+*ppp-2.4.7-r1 (14 May 2015)
+
+ 14 May 2015; Sergey Popov <pinkbyte@gentoo.org> ppp-2.4.7.ebuild,
+ +ppp-2.4.7-r1.ebuild:
+ Revision bump: split ppp scripts into separate package -
+ net-dialup/ppp-scripts. Adjust dependencies
+
+ 03 Mar 2015; Yixun Lan <dlan@gentoo.org> ppp-2.4.7.ebuild:
+ add arm64 support, tested on A53 board
+
+ 21 Aug 2014; Agostino Sarubbo <ago@gentoo.org> ppp-2.4.7.ebuild:
+ Stable for ppc, wrt bug #519650
+
+ 20 Aug 2014; Raúl Porcel <armin76@gentoo.org> ppp-2.4.7.ebuild:
+ alpha/arm/sparc stable wrt #519650
+
+ 19 Aug 2014; Agostino Sarubbo <ago@gentoo.org> ppp-2.4.7.ebuild:
+ Stable for ppc64, wrt bug #519650
+
+ 19 Aug 2014; Agostino Sarubbo <ago@gentoo.org> ppp-2.4.7.ebuild:
+ Stable for ia64, wrt bug #519650
+
+ 13 Aug 2014; Jeroen Roovers <jer@gentoo.org> ppp-2.4.7.ebuild:
+ Stable for HPPA (bug #519650).
+
+ 12 Aug 2014; Agostino Sarubbo <ago@gentoo.org> ppp-2.4.7.ebuild:
+ Stable for x86, wrt bug #519650
+
+ 12 Aug 2014; Agostino Sarubbo <ago@gentoo.org> ppp-2.4.7.ebuild:
+ Stable for amd64, wrt bug #519650
+
+*ppp-2.4.7 (12 Aug 2014)
+
+ 12 Aug 2014; Lars Wendler <polynomial-c@gentoo.org> +ppp-2.4.7.ebuild:
+ Security bump (bug #519650).
+
+*ppp-2.4.6-r3 (18 Jun 2014)
+
+ 18 Jun 2014; Sergey Popov <pinkbyte@gentoo.org> -ppp-2.4.6-r2.ebuild,
+ +ppp-2.4.6-r3.ebuild:
+ Revision bump: finally fix bug #513512, thanks again to Daniel Kenzelmann
+ <gentoo AT k8n.de>. Drop old revision
+
+*ppp-2.4.6-r2 (17 Jun 2014)
+
+ 17 Jun 2014; Sergey Popov <pinkbyte@gentoo.org> -ppp-2.4.6.ebuild,
+ -ppp-2.4.6-r1.ebuild, +ppp-2.4.6-r2.ebuild:
+ Revision bump: fix missing semicolon in ip-up.d/50-initd.sh script, update
+ patchset, wrt bug #513512. Thanks to Daniel Kenzelmann <gentoo AT k8n.de> for
+ discovering this issue. Drop old revisions
+
+*ppp-2.4.6-r1 (16 Jun 2014)
+
+ 16 Jun 2014; Sergey Popov <pinkbyte@gentoo.org> +ppp-2.4.6-r1.ebuild:
+ Revision bump: add missing 'die' to sed calls. Call OpenRC scripts only when
+ OpenRC is active init-system, wrt bug #490820. Fix issue with logwtmp not
+ working properly
+
+*ppp-2.4.6 (19 Feb 2014)
+
+ 19 Feb 2014; Lars Wendler <polynomial-c@gentoo.org> -ppp-2.4.5-r1.ebuild,
+ -ppp-2.4.5-r2.ebuild, +ppp-2.4.6.ebuild:
+ Version bump (bug #501530). Removed old.
+
+ 09 Jun 2013; Mike Frysinger <vapier@gentoo.org> metadata.xml:
+ Add upstream CPE tag (security info) from ChromiumOS.
+
+ 24 Mar 2013; Sergey Popov <pinkbyte@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Adjust SRC_URI, wrt bug #457854. Thanks to Theo Chatzimichos for discovering
+ this issue
+
+ 16 Dec 2012; Raúl Porcel <armin76@gentoo.org> ppp-2.4.5-r3.ebuild:
+ alpha/ia64/s390/sh/sparc stable wrt #444256
+
+ 29 Nov 2012; Jeroen Roovers <jer@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Stable for HPPA (bug #444256).
+
+ 26 Nov 2012; <ago@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Stable for x86, wrt to bug #444256
+
+ 25 Nov 2012; Sergey Popov <pinkbyte@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Stable on amd64, wrt bug #444256
+
+ 25 Nov 2012; Anthony G. Basile <blueness@gentoo.org> ppp-2.4.5-r3.ebuild:
+ stable arm ppc ppc64, bug #444256
+
+ 25 Nov 2012; Mike Gilbert <floppym@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Fix 80_all_eaptls-mppe-0.991-gentoo.patch, a casualty of CVS keyword
+ expansion.
+
+ 22 Sep 2012; Mike Frysinger <vapier@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Always unpack the dhcp code (since it is small) and update the patches to work
+ with patch-2.7 #435588.
+
+ 18 Aug 2012; Tomáš Chvátal <scarabeus@gentoo.org> ppp-2.4.5-r3.ebuild:
+ Make patch apply. Fixes bug#430830. Patch by Andrey Volkov.
+
+*ppp-2.4.5-r3 (10 Aug 2012)
+
+ 10 Aug 2012; Mike Frysinger <vapier@gentoo.org> +ppp-2.4.5-r3.ebuild:
+ Update to EAPI=4 and move patchset to CVS.
+
+ 07 Aug 2012; Mike Frysinger <vapier@gentoo.org> ppp-2.4.5-r2.ebuild:
+ Remove local copies of linux-headers and rely on the system one being up-to-
+ date #427684 by SpanKY.
+
+ 14 Jun 2012; Zac Medico <zmedico@gentoo.org> ppp-2.4.4-r25.ebuild,
+ ppp-2.4.5-r1.ebuild, ppp-2.4.5-r2.ebuild:
+ inherit multilib for get_libdir
+
+ 06 Apr 2012; Pacho Ramos <pacho@gentoo.org> metadata.xml:
+ Drop maintainer due retirement, bug #63588
+
+ 11 Nov 2011; Diego E. Pettenò <flameeyes@gentoo.org> ppp-2.4.5-r2.ebuild:
+ QA: fetch the patchset from dev.gentoo.org rather than mirrors.
+
+*ppp-2.4.5-r2 (11 Nov 2011)
+
+ 11 Nov 2011; Alin Năstac <mrness@gentoo.org> -ppp-2.4.5.ebuild,
+ +ppp-2.4.5-r2.ebuild, metadata.xml:
+ Fix QA issues in pppdump.c. Update EAP-TLS patch. Remove reference to
+ undefined symbol in passwordfd plugin (#389565).
+
+ 17 Jul 2011; Kacper Kowalik <xarthisius@gentoo.org> ppp-2.4.5-r1.ebuild:
+ ppc/ppc64 stable wrt #366719
+
+ 12 Jun 2011; Raúl Porcel <armin76@gentoo.org> ppp-2.4.5-r1.ebuild:
+ alpha/ia64/s390/sh/sparc stable wrt #366719
+
+ 05 Jun 2011; Jeroen Roovers <jer@gentoo.org> ppp-2.4.5-r1.ebuild:
+ Stable for HPPA (bug #366719).
+
+ 02 Jun 2011; Markus Meier <maekke@gentoo.org> ppp-2.4.5-r1.ebuild:
+ arm stable, bug #366719
+
+ 31 May 2011; Markus Meier <maekke@gentoo.org> ppp-2.4.5-r1.ebuild:
+ amd64/x86 stable, bug #366719
+
+ 02 Apr 2011; Samuli Suominen <ssuominen@gentoo.org> ppp-2.4.4-r25.ebuild,
+ ppp-2.4.5.ebuild, ppp-2.4.5-r1.ebuild:
+ Use net-libs/libpcap instead of virtual/libpcap wrt #358835.
+
+ 29 Mar 2011; Christoph Mende <angelos@gentoo.org> ppp-2.4.4-r25.ebuild:
+ Fixed slot deps
+
+*ppp-2.4.5-r1 (27 Nov 2010)
+
+ 27 Nov 2010; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r24.ebuild,
+ +ppp-2.4.5-r1.ebuild:
+ Fix PPPOE freeze when garbage packets are received iso PADO/PADS
+ (#340267). Add lcp-echo-adaptive option (#344273).
+
+ 02 Nov 2010; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r25.ebuild:
+ Stable for PPC (bug #331611).
+
+ 02 Nov 2010; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r25.ebuild:
+ Stable for HPPA (bug #331611).
+
+ 30 Sep 2010; Brent Baude <ranger@gentoo.org> ppp-2.4.4-r25.ebuild:
+ stable ppc64, bug 331611
+
+ 05 Sep 2010; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r25.ebuild:
+ alpha/ia64/s390/sh/sparc stable wrt #331611
+
+ 03 Sep 2010; Markos Chandras <hwoarang@gentoo.org> ppp-2.4.5.ebuild:
+ New patchset which fixes bug #334047 and bug #334727. No revbump
+
+ 22 Aug 2010; Markus Meier <maekke@gentoo.org> ppp-2.4.4-r25.ebuild:
+ arm stable, bug #331611
+
+ 09 Aug 2010; Markos Chandras <hwoarang@gentoo.org> ppp-2.4.4-r25.ebuild:
+ Stable on amd64 wrt bug #331611
+
+ 08 Aug 2010; Pawel Hajdan jr <phajdan.jr@gentoo.org> ppp-2.4.4-r25.ebuild:
+ x86 stable wrt bug #331611
+
+*ppp-2.4.5 (08 Aug 2010)
+
+ 08 Aug 2010; Alin Năstac <mrness@gentoo.org> +ppp-2.4.5.ebuild:
+ Version bump (#296267).
+
+ 08 Aug 2010; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r23.ebuild,
+ ppp-2.4.4-r25.ebuild:
+ Build radius plugin only when correspondent USE flag is enabled (#296436).
+
+ 06 Jan 2010; Brent Baude <ranger@gentoo.org> ppp-2.4.4-r24.ebuild:
+ Marking ppp-2.4.4-r24 ppc64 for bug 289593
+
+ 08 Dec 2009; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r24.ebuild:
+ Stable for HPPA (bug #289593).
+
+ 26 Nov 2009; Markus Meier <maekke@gentoo.org> ppp-2.4.4-r24.ebuild:
+ amd64 stable, bug #289593
+
+*ppp-2.4.4-r25 (16 Nov 2009)
+
+ 16 Nov 2009; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r25.ebuild:
+ Redesign kill-pg patch due to strange side effect (#292374). Make
+ 40-dns.sh script compatible with busybox (#292571). Add backport patch of
+ the pppoe-mac option (#291889).
+
+ 03 Nov 2009; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r24.ebuild:
+ arm/ia64/s390/sh/sparc stable wrt #289593
+
+ 29 Oct 2009; Christian Faulhammer <fauli@gentoo.org> ppp-2.4.4-r24.ebuild:
+ stable x86, bug 289593
+
+ 24 Oct 2009; Tobias Klausmann <klausman@gentoo.org> ppp-2.4.4-r24.ebuild:
+ Stable on alpha, bug #289593
+
+ 24 Oct 2009; nixnut <nixnut@gentoo.org> ppp-2.4.4-r24.ebuild:
+ ppc stable #289593
+
+ 18 Oct 2009; Alin Năstac <mrness@gentoo.org> ppp-2.4.4-r24.ebuild:
+ Add warning about missing CONFIG_PACKET.
+
+ 10 Sep 2009; Robin H. Johnson <robbat2@gentoo.org> ppp-2.4.4-r23.ebuild,
+ ppp-2.4.4-r24.ebuild:
+ Change the config check to avoid triggering it during catalyst autobuild
+ for the meantime.
+
+ 08 Sep 2009; Robin H. Johnson <robbat2@gentoo.org> ppp-2.4.4-r23.ebuild,
+ ppp-2.4.4-r24.ebuild:
+ Fix for linux-info change to give more suitable warnings when kernel
+ sources are not present.
+
+ 16 Aug 2009; Alin Năstac <mrness@gentoo.org> ppp-2.4.4-r24.ebuild:
+ Readd scripts to gentoo tarball (#281591).
+
+*ppp-2.4.4-r24 (15 Aug 2009)
+
+ 15 Aug 2009; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r24.ebuild:
+ Change connect-errors file path to /var/log/ppp-connect-errors (#279695).
+
+*ppp-2.4.4-r23 (23 Jun 2009)
+
+ 23 Jun 2009; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r21.ebuild,
+ -ppp-2.4.4-r22.ebuild, +ppp-2.4.4-r23.ebuild:
+ Correct sed command performed on modules.d file when mppe-mppc USE flag is
+ enabled (#274934).
+
+ 28 May 2009; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r22.ebuild:
+ Stable for HPPA (bug #269127). Catch cases where /sbin/update-modules does
+ not return 0 (like when /etc/modules.conf has not been automatically
+ generated).
+
+ 20 May 2009; nixnut <nixnut@gentoo.org> ppp-2.4.4-r22.ebuild:
+ ppc stable #269127
+
+ 15 May 2009; Markus Meier <maekke@gentoo.org> ppp-2.4.4-r22.ebuild:
+ amd64 stable, bug #269127
+
+ 11 May 2009; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r22.ebuild:
+ arm/ia64/s390/sh/sparc/x86 stable wrt #269127
+
+ 11 May 2009; Brent Baude <ranger@gentoo.org> ppp-2.4.4-r22.ebuild:
+ stable ppc64, bug 269127
+
+ 09 May 2009; Tobias Klausmann <klausman@gentoo.org> ppp-2.4.4-r22.ebuild:
+ Stable on alpha, bug #269127
+
+ 09 May 2009; Alin Năstac <mrness@gentoo.org> ppp-2.4.4-r22.ebuild:
+ Migrate to EAPI 2.
+
+*ppp-2.4.4-r22 (06 May 2009)
+
+ 06 May 2009; Mike Frysinger <vapier@gentoo.org> +ppp-2.4.4-r22.ebuild:
+ Install modprobe.d file with a .conf extension.
+
+ 02 Dec 2008; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r14.ebuild,
+ -ppp-2.4.4-r15.ebuild:
+ Remove obsolete versions.
+
+ 02 Dec 2008; Brent Baude <ranger@gentoo.org> ppp-2.4.4-r21.ebuild:
+ stable ppc64, bug 239851
+
+ 18 Oct 2008; nixnut <nixnut@gentoo.org> ppp-2.4.4-r21.ebuild:
+ Stable on ppc wrt bug 239851
+
+ 18 Oct 2008; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r21.ebuild:
+ Stable for HPPA (bug #239851).
+
+ 08 Oct 2008; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r21.ebuild:
+ alpha/ia64 stable wrt #239851
+
+ 06 Oct 2008; Markus Meier <maekke@gentoo.org> ppp-2.4.4-r21.ebuild:
+ amd64/x86 stable, bug #239851
+
+ 06 Oct 2008; Friedrich Oslage <bluebird@gentoo.org> ppp-2.4.4-r21.ebuild:
+ Stable on sparc, bug #239851
+
+*ppp-2.4.4-r21 (19 Aug 2008)
+
+ 19 Aug 2008; Alin Năstac <mrness@gentoo.org> metadata.xml,
+ -ppp-2.4.4-r19.ebuild, -ppp-2.4.4-r20.ebuild, +ppp-2.4.4-r21.ebuild:
+ Export LDFLAGS from plugins/Makefile (#234915). Add usepeerwins option,
+ thanks to Jaco Kroon <jaco at uls dot co dot za>; remove wins-ack USE
+ flag (#234583).
+
+*ppp-2.4.4-r20 (15 Aug 2008)
+
+ 15 Aug 2008; Alin Năstac <mrness@gentoo.org> metadata.xml,
+ -ppp-2.4.4-r17.ebuild, +ppp-2.4.4-r20.ebuild:
+ Add wins-ack USE flag and patch (#234583). Add USE flag description to
+ metadata.
+
+*ppp-2.4.4-r19 (01 Aug 2008)
+
+ 01 Aug 2008; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r18.ebuild,
+ +ppp-2.4.4-r19.ebuild:
+ Export LDFLAGS used to compile plugin programs (#233317).
+
+ 01 Aug 2008; nixnut <nixnut@gentoo.org> ppp-2.4.4-r15.ebuild:
+ Stable on ppc wrt bug 227183
+
+*ppp-2.4.4-r18 (30 Jul 2008)
+
+ 30 Jul 2008; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r18.ebuild:
+ Link pppoe-discovery program with user selected LDFLAGS (#233317).
+
+ 15 Jul 2008; Alin Năstac <mrness@gentoo.org> ppp-2.4.4-r15.ebuild,
+ ppp-2.4.4-r17.ebuild:
+ Move ppp-gentoo tarballs back to distfiles-local (#231842).
+
+ 11 Jul 2008; Thomas Anderson <gentoofan23@gentoo.org>
+ ppp-2.4.4-r15.ebuild:
+ stable amd64, bug 227183
+
+ 28 Jun 2008; Tobias Klausmann <klausman@gentoo.org> ppp-2.4.4-r15.ebuild:
+ Stable on alpha, bug #227183
+
+*ppp-2.4.4-r17 (27 Jun 2008)
+
+ 27 Jun 2008; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r16.ebuild,
+ +ppp-2.4.4-r17.ebuild:
+ Re-add script directory to ppp-2.4.4-gentoo tarball and make sure it never
+ happens again (#229757). Fix passwordfd-read-early patch (#229773).
+
+*ppp-2.4.4-r16 (25 Jun 2008)
+
+ 25 Jun 2008; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r16.ebuild:
+ Patch passwordfd plugin to read password as soon as it gets the fd number -
+ openrc use stdin for that, fd that could be closed by pppd before plugin
+ reads the password (#209294).
+
+ 21 Jun 2008; Markus Rothe <corsair@gentoo.org> ppp-2.4.4-r15.ebuild:
+ Stable on ppc64; bug #227183
+
+ 21 Jun 2008; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r15.ebuild:
+ ia64/sparc stable wrt #227183
+
+ 19 Jun 2008; Christian Faulhammer <opfer@gentoo.org> ppp-2.4.4-r15.ebuild:
+ stable x86, bug 227183
+
+ 17 Jun 2008; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r15.ebuild:
+ Stable for HPPA (bug #227183).
+
+ 14 Jun 2008; Zac Medico <zmedico@gentoo.org> ppp-2.4.4-r14.ebuild,
+ ppp-2.4.4-r15.ebuild:
+ Bug #226505 - For compatibility with phase execution order in
+ >=portage-2.1.5, call has_version inside pkg_preinst instead of
+ pkg_postinst.
+
+ 14 May 2008; Diego Pettenò <flameeyes@gentoo.org> ppp-2.4.4-r15.ebuild:
+ Depend on virtual/pam as the code builds fine with OpenPAM.
+
+*ppp-2.4.4-r15 (12 Apr 2008)
+
+ 12 Apr 2008; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r15.ebuild:
+ Re-write kill-pg.patch (#181145 and #216183). Fix LCP timeout error
+ (#210852). Fix QA warning (#211160). Install modprobe.d file (#213879).
+
+ 31 Mar 2008; <ricmm@gentoo.org> ppp-2.4.4-r14.ebuild:
+ Drop to ~mips due to unstable deps
+
+ 20 Feb 2008; Alin Năstac <mrness@gentoo.org> ppp-2.4.4-r14.ebuild:
+ Re-add bindnow LDFLAGS (#210837).
+
+*ppp-2.4.4-r14 (20 Feb 2008)
+
+ 20 Feb 2008; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r13.ebuild,
+ +ppp-2.4.4-r14.ebuild:
+ Improve pam file (#210824). Drop bindnow LDFLAGS.
+
+ 13 Jan 2008; Alin Năstac <mrness@gentoo.org> -files/ip-down,
+ -files/ip-up, -ppp-2.4.4-r9.ebuild, -ppp-2.4.4-r11.ebuild:
+ Remove obsolete revisions.
+
+ 23 Dec 2007; Stuart Longland <redhatter@gentoo.org> ppp-2.4.4-r13.ebuild:
+ Tested and working on MIPS. Marked stable.
+
+ 05 Nov 2007; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r13.ebuild:
+ sparc stable wrt #194820
+
+ 02 Nov 2007; Steve Dibb <beandog@gentoo.org> ppp-2.4.4-r13.ebuild:
+ amd64 stable, bug 194820
+
+ 14 Oct 2007; Markus Rothe <corsair@gentoo.org> ppp-2.4.4-r13.ebuild:
+ Stable on ppc64; bug #194820
+
+ 11 Oct 2007; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r13.ebuild:
+ alpha/ia64 stable wrt #194820
+
+ 09 Oct 2007; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r13.ebuild:
+ Stable for HPPA (bug #194820).
+
+ 06 Oct 2007; Christian Faulhammer <opfer@gentoo.org> ppp-2.4.4-r13.ebuild:
+ stable x86, bug 194820
+
+ 06 Oct 2007; Lars Weiler <pylon@gentoo.org> ppp-2.4.4-r13.ebuild:
+ stable ppc, bug #194820
+
+*ppp-2.4.4-r13 (03 Sep 2007)
+
+ 03 Sep 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r12.ebuild,
+ +ppp-2.4.4-r13.ebuild:
+ Improve up/down scripts (#190143).
+
+*ppp-2.4.4-r12 (31 Aug 2007)
+
+ 31 Aug 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r4.ebuild,
+ +ppp-2.4.4-r12.ebuild:
+ Use gtk+-2 library (#189350). Add support for /etc/ppp/ip-{up,down}.d
+ directories (#190143).
+
+*ppp-2.4.4-r11 (17 Aug 2007)
+
+ 17 Aug 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r10.ebuild,
+ +ppp-2.4.4-r11.ebuild:
+ Create /dev/ppp instead loading ppp_generic module (#163098).
+
+ 07 Aug 2007; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r10.ebuild:
+ Add defaultmetric option and allow setting the default route even if one
+ already exist (but has a different metric). Load ppp_generic kernel module
+ before trying to open /dev/ppp (#163098).
+
+ 04 Aug 2007; Tobias Scherbaum <dertobi123@gentoo.org> ppp-2.4.4-r9.ebuild:
+ ppc stable, bug #184696
+
+*ppp-2.4.4-r10 (07 Aug 2007)
+
+ 07 Aug 2007; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r10.ebuild:
+ Add defaultmetric option. Load ppp_generic kernel module before trying to
+ open /dev/ppp (#163098).
+
+ 28 Jul 2007; Christoph Mende <angelos@gentoo.org> ppp-2.4.4-r9.ebuild:
+ Stable on amd64 wrt bug #184696
+
+ 23 Jul 2007; Joshua Kinard <kumba@gentoo.org> ppp-2.4.4-r9.ebuild:
+ Stable on mips, per #184695.
+
+ 12 Jul 2007; Christian Faulhammer <opfer@gentoo.org> ppp-2.4.4-r9.ebuild:
+ stable x86, bug 184696
+
+ 11 Jul 2007; Markus Rothe <corsair@gentoo.org> ppp-2.4.4-r9.ebuild:
+ Stable on ppc64; bug #184696
+
+ 11 Jul 2007; Gustavo Zacarias <gustavoz@gentoo.org> ppp-2.4.4-r9.ebuild:
+ Stable on sparc wrt #184696
+
+ 10 Jul 2007; Raúl Porcel <armin76@gentoo.org> ppp-2.4.4-r9.ebuild:
+ alpha/x86 stable wrt #184696
+
+ 10 Jul 2007; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r9.ebuild:
+ Stable for HPPA (bug #184696).
+
+*ppp-2.4.4-r9 (09 Jul 2007)
+
+ 09 Jul 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r5.ebuild,
+ -ppp-2.4.4-r8.ebuild, +ppp-2.4.4-r9.ebuild:
+ Install pppd header files (#184545).
+
+*ppp-2.4.4-r8 (14 Jun 2007)
+
+ 14 Jun 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r7.ebuild,
+ +ppp-2.4.4-r8.ebuild:
+ Fix another grammar error (#180180).
+
+*ppp-2.4.4-r7 (14 Jun 2007)
+
+ 14 Jun 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r6.ebuild,
+ +ppp-2.4.4-r7.ebuild:
+ Correct auth-fail paragraphs of the pppd man page (#180180).
+
+*ppp-2.4.4-r6 (09 Jun 2007)
+
+ 09 Jun 2007; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r6.ebuild:
+ Kill children instead process group when pppd is still attached to the
+ controlling terminal (#181145). Add auth-fail script, thanks to Jaco Kroon
+ <jaco at kroon dot co dot za> (#180180).
+
+*ppp-2.4.4-r5 (28 May 2007)
+
+ 28 May 2007; Alin Năstac <mrness@gentoo.org> +ppp-2.4.4-r5.ebuild:
+ Fix QA notice. Remove /var/run/ppp-$linkname.pid only on exit (#179978).
+
+ 06 May 2007; Marius Mauch <genone@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Replacing einfo with elog
+
+ 28 Apr 2007; Sven Wegener <swegener@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Drop dodir from dodir/*into combination.
+
+ 16 Apr 2007; Stefan Schweizer <genstef@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Use update-modules thanks to jakub in bug 174749
+
+ 13 Apr 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.3-r16.ebuild:
+ Remove old version.
+
+ 13 Apr 2007; Jeroen Roovers <jer@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable for HPPA (bug #157525).
+
+ 08 Apr 2007; <solar@gentoo.org> ppp-2.4.4-r4.ebuild:
+ - added ~s390
+
+ 27 Jan 2007; Alexander H. Færøy <eroyf@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on MIPS; bug #157525
+
+ 21 Jan 2007; Alin Năstac <mrness@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on amd64 (#157525).
+
+ 05 Jan 2007; Alin Năstac <mrness@gentoo.org> -ppp-2.4.4-r3.ebuild,
+ ppp-2.4.4-r4.ebuild:
+ Add -D_GNU_SOURCE to CFLAGS (#159877). Remove obsolete revision.
+
+ 31 Dec 2006; Bryan Østergaard <kloeri@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on Alpha, bug 157525.
+
+ 23 Dec 2006; Alexander H. Færøy <eroyf@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on IA64; bug #157525
+
+ 17 Dec 2006; Tobias Scherbaum <dertobi123@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on ppc wrt bug #157525.
+
+ 11 Dec 2006; Christian Faulhammer <opfer@gentoo.org> ppp-2.4.4-r4.ebuild:
+ stable x86, bug #157525
+
+ 11 Dec 2006; Gustavo Zacarias <gustavoz@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on sparc wrt #157525
+
+ 09 Dec 2006; Markus Rothe <corsair@gentoo.org> ppp-2.4.4-r4.ebuild:
+ Stable on ppc64; bug #157525
+
+*ppp-2.4.4-r4 (24 Nov 2006)
+
+ 24 Nov 2006; Alin Nastac <mrness@gentoo.org> +ppp-2.4.4-r4.ebuild:
+ Correct initialization of mschap-v2 response buffer, thanks to Guillaume
+ Knispel <gknispel at proformatique dot com> (#156052).
+
+*ppp-2.4.4-r3 (03 Nov 2006)
+
+ 03 Nov 2006; Alin Nastac <mrness@gentoo.org> -ppp-2.4.4-r2.ebuild,
+ +ppp-2.4.4-r3.ebuild:
+ Fix wait-children patch (#153798).
+
+ 24 Oct 2006; Alin Nastac <mrness@gentoo.org> -files/chat-default,
+ -files/confd.ppp0, files/ip-down, -files/ip-down.baselayout, files/ip-up,
+ -files/ip-up.baselayout, -files/net.ppp0, -files/options-pppoe,
+ -files/options-pptp, -files/plog, -files/poff, -files/pon, -files/pon.1,
+ -files/pppoe.html, -ppp-2.4.2-r15.ebuild, ppp-2.4.3-r16.ebuild,
+ -ppp-2.4.4-r1.ebuild, ppp-2.4.4-r2.ebuild:
+ Remove obsolete versions.
+
+ 24 Oct 2006; Fernando J. Pereda <ferdy@gentoo.org> ppp-2.4.3-r16.ebuild:
+ Alpha stable as per bug #148472
+
+ 14 Oct 2006; Aron Griffis <agriffis@gentoo.org> ppp-2.4.3-r16.ebuild:
+ Mark 2.4.3-r16 stable on ia64. #148472
+
+*ppp-2.4.4-r2 (05 Oct 2006)
+
+ 05 Oct 2006; Alin Nastac <mrness@gentoo.org> +ppp-2.4.4-r2.ebuild:
+ Set the gateway in the default route, just as ppp-2.4.3 used to set (the
+ default gateway is needed by openswan's %defaultroute).
+
+ 23 Sep 2006; Tobias Scherbaum <dertobi123@gentoo.org>
+ ppp-2.4.3-r16.ebuild:
+ hppa stable, bug #148472
+
+ 10 Sep 2006; Alin Nastac <mrness@gentoo.org> ppp-2.4.3-r16.ebuild,
+ -ppp-2.4.4.ebuild, ppp-2.4.4-r1.ebuild:
+ Fix broken build against openssl-0.9.8 (#146780).
+
+ 04 Sep 2006; Joshua Kinard <kumba@gentoo.org> ppp-2.4.3-r16.ebuild:
+ Marked stable on mips.
+
+ 30 Aug 2006; Michael Hanselmann <hansmi@gentoo.org> ppp-2.4.3-r16.ebuild:
+ Stable on ppc.
+
+*ppp-2.4.4-r1 (28 Aug 2006)
+
+ 28 Aug 2006; Alin Nastac <mrness@gentoo.org> metadata.xml,
+ +ppp-2.4.4-r1.ebuild:
+ Take maintainership of this package. Extend limit of maxoctets parameter
+ to UINT_MAX, thanks to Serhij S. Stasyuk <stas@onlineua.net> (#145313).
+
+*ppp-2.4.4 (22 Aug 2006)
+
+ 22 Aug 2006; Alin Nastac <mrness@gentoo.org> +ppp-2.4.4.ebuild:
+ Version bump (#144690).
+
+ 16 Aug 2006; Gustavo Zacarias <gustavoz@gentoo.org> ppp-2.4.3-r16.ebuild:
+ Stable on sparc
+
+ 16 Aug 2006; Markus Rothe <corsair@gentoo.org> ppp-2.4.3-r16.ebuild:
+ Stable on ppc64
+
+ 14 Aug 2006; Alin Nastac <mrness@gentoo.org> -ppp-2.4.3-r15.ebuild,
+ ppp-2.4.3-r16.ebuild:
+ Stable on amd64 and x86.
+
+*ppp-2.4.3-r16 (07 Jul 2006)
+
+ 07 Jul 2006; Alin Nastac <mrness@gentoo.org> +ppp-2.4.3-r16.ebuild:
+ Fix local privilege escaladation (#139477).
+
+ 13 Jun 2006; <uberlord@gentoo.org> ppp-2.4.2-r15.ebuild,
+ ppp-2.4.3-r15.ebuild:
+ Change update-modules to modules-update.
+
+ 23 May 2006; Alin Nastac <mrness@gentoo.org> -ppp-2.4.3-r14.ebuild,
+ ppp-2.4.3-r15.ebuild:
+ Remove old test version. Take advantage of the new features implemented in
+ linux-info.eclass (#133026).
+
+ 16 May 2006; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Fix recursive definitions of COPTS make variable (#133309).
+
+ 15 May 2006; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Fix build error on systems where libcrypt is not installed in /usr/lib
+ (#133309).
+
+*ppp-2.4.3-r15 (07 May 2006)
+
+ 07 May 2006; Alin Nastac <mrness@gentoo.org> -ppp-2.4.2-r10.ebuild,
+ +ppp-2.4.3-r15.ebuild:
+ Remove old revision. Fix makefiles wrt CFLAGS and LDFLAGS used by the user
+ (#132115). Extend kernel configuration tests performed in pkg_postinst
+ function.
+
+ 03 May 2006; Torsten Veller <tove@gentoo.org> ppp-2.4.3-r14.ebuild:
+ Cross-compile fix for
+ <http://article.gmane.org/gmane.linux.gentoo.embedded/588>
+
+ 24 Apr 2006; Joshua Kinard <kumba@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Marked stable on mips.
+
+*ppp-2.4.3-r14 (09 Apr 2006)
+
+ 09 Apr 2006; Alin Nastac <mrness@gentoo.org> -ppp-2.4.3-r13.ebuild,
+ +ppp-2.4.3-r14.ebuild:
+ Modprobe pppoatm silently in pppoatm plugin, for avoiding the annoyance of a
+ bogus error when PPPoA support is compiled into the kernel (#129282).
+
+*ppp-2.4.3-r13 (23 Mar 2006)
+
+ 23 Mar 2006; Alin Nastac <mrness@gentoo.org> files/ip-down.baselayout,
+ -ppp-2.4.3-r12.ebuild, +ppp-2.4.3-r13.ebuild:
+ Fix typo in ip-down script (#127339).
+
+*ppp-2.4.3-r12 (20 Mar 2006)
+
+ 20 Mar 2006; Alin Nastac <mrness@gentoo.org> files/ip-down.baselayout,
+ files/ip-up.baselayout, -ppp-2.4.3-r11.ebuild, +ppp-2.4.3-r12.ebuild:
+ Change the baselayout-1.12 compatible ip-up/ip-down scripts, at uberlord
+ request.
+
+ 12 Mar 2006; Alin Nastac <mrness@gentoo.org> -ppp-2.4.3-r10.ebuild,
+ ppp-2.4.3-r11.ebuild:
+ Remove old test version. Simplify dependencies. Quote $S, $D, $WORKDIR,
+ $FILESDIR and $ROOT.
+
+*ppp-2.4.3-r11 (21 Feb 2006)
+
+ 21 Feb 2006; Alin Nastac <mrness@gentoo.org> +ppp-2.4.3-r11.ebuild:
+ Wait for user scripts to finish at the end of PPP session (#122795).
+
+ 23 Jan 2006; Alin Nastac <mrness@gentoo.org> files/modules.ppp,
+ ppp-2.4.2-r10.ebuild, ppp-2.4.2-r15.ebuild, -ppp-2.4.3-r9.ebuild,
+ ppp-2.4.3-r10.ebuild:
+ Remove old test version. Add warnings about MPPE-MPPC patch problems and
+ incompatibilities (#119705). If eap-tls is enabled, apply eap-tls-0.7-mppe
+ patch regardless whether mppe-mppc flag is enabled or not.
+
+ 25 Dec 2005; Diego Pettenò <flameeyes@gentoo.org> ppp-2.4.3-r10.ebuild:
+ Use bindnow-flags function instead of -Wl,-z,now.
+
+*ppp-2.4.3-r10 (29 Nov 2005)
+
+ 29 Nov 2005; Alin Nastac <mrness@gentoo.org> +files/ip-down.baselayout,
+ +files/ip-up.baselayout, -ppp-2.4.2-r12.ebuild, -ppp-2.4.3-r8.ebuild,
+ +ppp-2.4.3-r10.ebuild:
+ Remove old versions. Add support for the new pppd net module introduced by
+ sys-apps/baselayout-1.12.0_pre11.
+
+ 14 Nov 2005; Luis Medinas <metalgod@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Marked Stable on amd64.
+
+*ppp-2.4.3-r9 (05 Nov 2005)
+
+ 05 Nov 2005; Alin Nastac <mrness@gentoo.org> +ppp-2.4.3-r9.ebuild:
+ Add experimental support for EAP-TLS, selectable through eap-tls useflag
+ (#109935).
+
+ 18 Oct 2005; Aron Griffis <agriffis@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Mark 2.4.2-r15 stable on alpha
+
+ 24 Sep 2005; Markus Rothe <corsair@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Stable on ppc64
+
+ 22 Sep 2005; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r15.ebuild,
+ ppp-2.4.3-r8.ebuild:
+ Make kernel configuration checks non-fatal (#103396).
+
+ 20 Sep 2005; Gustavo Zacarias <gustavoz@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Stable on sparc
+
+ 15 Sep 2005; Joseph Jezak <josejx@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Marked ppc stable.
+
+ 13 Sep 2005; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r15.ebuild:
+ Stable on x86.
+
+ 09 Sep 2005; Tom Gall <tgall@gentoo.org> ppp-2.4.2-r12.ebuild,
+ ppp-2.4.2-r15.ebuild:
+ stable on ppc64 (r12) ~ppc64 (r15)
+
+ 29 Aug 2005; Alin Nastac <mrness@gentoo.org> files/ip-up,
+ ppp-2.4.2-r12.ebuild, ppp-2.4.2-r15.ebuild, -ppp-2.4.3-r6.ebuild,
+ ppp-2.4.3-r8.ebuild:
+ Fix cp -a usage for Gentoo BSD (#103487) and remove old test version.
+
+ 24 Aug 2005; Aron Griffis <agriffis@gentoo.org> ppp-2.4.2-r12.ebuild:
+ stable on ia64
+
+*ppp-2.4.3-r8 (29 Jul 2005)
+*ppp-2.4.2-r15 (29 Jul 2005)
+
+ 29 Jul 2005; Alin Nastac <mrness@gentoo.org> -ppp-2.4.2-r14.ebuild,
+ +ppp-2.4.2-r15.ebuild, -ppp-2.4.3-r7.ebuild, +ppp-2.4.3-r8.ebuild:
+ Fix on-demand links with outbound keyword in active-filter/pass-filter
+ (#99190).
+
+*ppp-2.4.2-r14 (29 Jul 2005)
+
+ 29 Jul 2005; Alin Nastac <mrness@gentoo.org> -ppp-2.4.2-r13.ebuild,
+ +ppp-2.4.2-r14.ebuild, ppp-2.4.3-r7.ebuild:
+ Correct the activefilter patch and add kernel configuration checks (#99190).
+
+*ppp-2.4.3-r7 (27 Jul 2005)
+*ppp-2.4.2-r13 (27 Jul 2005)
+
+ 27 Jul 2005; Alin Nastac <mrness@gentoo.org> +ppp-2.4.2-r13.ebuild,
+ +ppp-2.4.3-r7.ebuild:
+ Add fixes for activefilter support (#99190) and remove interface name check
+ in rp-pppoe plugin (#100437). Add upstream CVS patches to ppp-2.4.3.
+
+ 09 Jul 2005; Joseph Jezak <josejx@gentoo.org> ppp-2.4.2-r12.ebuild:
+ Marked ppc stable.
+
+ 05 Jul 2005; Rene Nussbaumer <killerfox@gentoo.org> ppp-2.4.2-r12.ebuild:
+ Stable on hppa.
+
+ 04 Jul 2005; Gustavo Zacarias <gustavoz@gentoo.org> ppp-2.4.2-r12.ebuild:
+ Stable on sparc
+
+ 03 Jul 2005; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r12.ebuild:
+ Stable on x86.
+
+*ppp-2.4.3-r6 (12 Jun 2005)
+*ppp-2.4.2-r12 (12 Jun 2005)
+
+ 12 Jun 2005; Alin Nastac <mrness@gentoo.org> -ppp-2.4.2-r11.ebuild,
+ +ppp-2.4.2-r12.ebuild, -ppp-2.4.3-r3.ebuild, -ppp-2.4.3-r5.ebuild,
+ +ppp-2.4.3-r6.ebuild:
+ Create {pap,chap}-secrets files based on example files (#95402). Remove old
+ test versions.
+
+*ppp-2.4.3-r5 (26 May 2005)
+
+ 26 May 2005; Alin Nastac <mrness@gentoo.org> -ppp-2.4.3-r4.ebuild,
+ +ppp-2.4.3-r5.ebuild:
+ Move /etc/radiusclient directory installed by ppp-2.4.3 to /etc/ppp/radius
+ for avoiding collisions with net-dialup/radiusclient package (#92878).
+
+*ppp-2.4.3-r4 (23 May 2005)
+*ppp-2.4.2-r11 (23 May 2005)
+
+ 23 May 2005; Alin Nastac <mrness@gentoo.org> +ppp-2.4.2-r11.ebuild,
+ ppp-2.4.3-r3.ebuild, +ppp-2.4.3-r4.ebuild:
+ Add radius USE flag which controls installation of RADIUS plugins. Partially
+ solve conflicts with net-dialup/radiusclient by not installing radiusclient
+ library - ppp is statically linked with it (#92878). Install radiusclient
+ configuration files in ppp-2.4.3-r4 (#92977).
+
+ 14 May 2005; Alin Nastac <mrness@gentoo.org> -files/2.4.2/README.mpls,
+ -files/2.4.2/cbcp-dosfix.patch, -files/2.4.2/cflags.patch,
+ -files/2.4.2/chat-default, -files/2.4.2/control_c.patch,
+ -files/2.4.2/killaddr-smarter.patch.gz, -files/2.4.2/modules.ppp,
+ -files/2.4.2/mpls.patch.gz, -files/2.4.2/mppe-mppc-1.0.patch.gz,
+ -files/2.4.2/options-pppoe, -files/2.4.2/options-pptp,
+ -files/2.4.2/pcap.patch, -files/2.4.2/pppoatm-2.diff.gz,
+ -files/2.4.2/pppoatm.diff.gz, -files/2.4.2/pppoe.html,
+ -files/2.4.2/stdopt-mppe-mppc-0.82.patch.gz, -files/2.4.3/README.mpls,
+ -files/2.4.3/chat-default, -files/2.4.3/fixes-from-upstream-cvs.patch,
+ -files/2.4.3/killaddr-smarter.patch, -files/2.4.3/modules.ppp,
+ -files/2.4.3/mpls.patch, -files/2.4.3/options-pppoe,
+ -files/2.4.3/options-pptp, -files/2.4.3/ppp_flags.patch,
+ -files/2.4.3/pppoe.html, +files/README.mpls,
+ -files/gcc3.3-multiline.patch, -files/gcc33-amd64.patch,
+ +files/options-pppoe, +files/options-pptp,
+ -files/ppp-sys_error_to_strerror.patch, -ppp-2.4.1-r14.ebuild,
+ ppp-2.4.2-r10.ebuild, -ppp-2.4.3.ebuild, -ppp-2.4.3-r1.ebuild,
+ -ppp-2.4.3-r2.ebuild, ppp-2.4.3-r3.ebuild:
+ Fix multilib-strict issue (#92111) in 2.4.2. Remove obsolete versions.
+ Reorganize patches and FILESDIR stuff.
+
+ 10 May 2005; Herbie Hopkins <herbs@gentoo.org> ppp-2.4.3-r3.ebuild:
+ Fixed multilib-strict issue, bug #92111
+
+ 08 May 2005; Torsten Veller <tove@gentoo.org> ppp-2.4.3-r3.ebuild:
+ using toolchain-funcs
+
+*ppp-2.4.3-r3 (08 May 2005)
+
+ 08 May 2005; Alin Nastac <mrness@gentoo.org> +files/2.4.3/README.mpls,
+ metadata.xml, +ppp-2.4.3-r3.ebuild:
+ Fix plugins installation on amd64 (#74093).
+
+*ppp-2.4.3-r2 (05 May 2005)
+
+ 05 May 2005; Alin Nastac <mrness@gentoo.org> +ppp-2.4.3-r2.ebuild:
+ Import fixes from upstream CVS (#74093).
+
+ 16 Apr 2005; Alin Nastac <mrness@gentoo.org> files/net.ppp0:
+ Fix net.ppp0 script regarding default route removal (#89017).
+
+ 14 Apr 2005; Tom Gall <tgall@gentoo.org> ppp-2.4.3-r1.ebuild:
+ added ~ppc64, bug #89139
+
+ 18 Mar 2005; Alin Nastac <mrness@gentoo.org> files/net.ppp0:
+ Pass peer name as 6th param to the ip-up/ip-down scripts (#85700).
+
+ 12 Feb 2005; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r10.ebuild:
+ Fix broken build of radiusclient plugin on SMP machines (#81544).
+
+ 06 Feb 2005; Alin Nastac <mrness@gentoo.org> files/confd.ppp0,
+ files/ip-down, files/ip-up, files/net.ppp0, -files/2.4.2/confd.ppp0,
+ -files/2.4.2/ip-down, -files/2.4.2/ip-up, -files/2.4.2/net.ppp0,
+ -files/2.4.3/confd.ppp0, -files/2.4.3/ip-down, -files/2.4.3/ip-up,
+ -files/2.4.3/net.ppp0, ppp-2.4.2-r10.ebuild, ppp-2.4.3-r1.ebuild,
+ ppp-2.4.3.ebuild:
+ Use same scripts in all versions.
+
+ 30 Jan 2005; Daniel Black <dragonheart@gentoo.org> ppp-2.4.1-r14.ebuild,
+ ppp-2.4.2-r10.ebuild, ppp-2.4.3-r1.ebuild, ppp-2.4.3.ebuild:
+ Transition dependancy from net-libs/libpcap to virtual/libpcap
+
+ 21 Jan 2005; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/ppp-sys_error_to_strerror.patch, ppp-2.4.2-r10.ebuild,
+ ppp-2.4.3.ebuild, ppp-2.4.3-r1.ebuild:
+ See bug #78679.
+
+*ppp-2.4.3-r1 (09 Jan 2005)
+
+ 09 Jan 2005; Alin Nastac <mrness@gentoo.org>
+ +files/2.4.3/fixes-from-upstream-cvs.patch, +ppp-2.4.3-r1.ebuild:
+ Add fixes from upstream CVS for bug IDs 1103-1106. See bug #58275 and #74093.
+
+ 08 Jan 2005; Alin Nastac <mrness@gentoo.org> -files/ppp-2.4.1-r10.patch,
+ -ppp-2.4.2-r9.ebuild:
+ Remove old ebuild.
+
+ 06 Jan 2005; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r10.ebuild:
+ Mark stable on all arches.
+
+ 29 Nov 2004; Alin Nastac <mrness@gentoo.org>
+ -files/ppp-2.4.1-MSCHAPv2-fix.patch, -ppp-2.4.2-r1.ebuild,
+ -ppp-2.4.2-r2.ebuild, -ppp-2.4.2-r6.ebuild, -ppp-2.4.2-r7.ebuild,
+ -ppp-2.4.2-r8.ebuild, -ppp-2.4.2.ebuild:
+ Remove old ebuilds.
+
+*ppp-2.4.3 (27 Nov 2004)
+
+ 27 Nov 2004; Alin Nastac <mrness@gentoo.org> +files/2.4.3/chat-default,
+ +files/2.4.3/confd.ppp0, +files/2.4.3/ip-down, +files/2.4.3/ip-up,
+ +files/2.4.3/killaddr-smarter.patch, +files/2.4.3/modules.ppp,
+ +files/2.4.3/mpls.patch, +files/2.4.3/net.ppp0, +files/2.4.3/options-pppoe,
+ +files/2.4.3/options-pptp, +files/2.4.3/ppp_flags.patch,
+ +files/2.4.3/pppoe.html, +ppp-2.4.3.ebuild:
+ Import ebuild for 2.4.3 from #72405, thanks to tove <bugs@veller.net>.
+
+ 18 Nov 2004; Alin Nastac <mrness@gentoo.org> ppp-2.4.2-r10.ebuild,
+ ppp-2.4.2-r9.ebuild:
+ Add pam library to dependencies. See bug #71577.
+
+*ppp-2.4.2-r10 (14 Nov 2004)
+
+ 14 Nov 2004; Alin Nastac <mrness@gentoo.org> +ppp-2.4.2-r10.ebuild:
+ Install pam file for ppp (see #70957). Add failures when failed to install
+ essential parts.
+
+*ppp-2.4.2-r9 (11 Nov 2004)
+
+ 11 Nov 2004; Alin Nastac <mrness@gentoo.org>
+ files/2.4.2/ip-up, files/2.4.2/ip-down, +ppp-2.4.2-r9.ebuild:
+ Create a world readable resolv.conf (see #37886).
+ Leave it stable it is a trivial script correction.
+
+*ppp-2.4.2-r8 (09 Nov 2004)
+
+ 09 Nov 2004; Alin Nastac <mrness@gentoo.org>
+ files/2.4.2/ip-up, files/2.4.2/ip-down, +ppp-2.4.2-r8.ebuild:
+ Correctly pass empty params to ip-up.local and ip-down.local .
+ Leave it stable on all arches since is a trivial change. See bug #70440.
+
+ 07 Nov 2004; Steve Arnold <nerdboy@gentoo.org>
+ +files/2.4.2/mppe-mppc-1.0.patch.gz, ppp-2.4.2-r2.ebuild:
+ updated mppe patch for bug 51744
+
+ 05 Nov 2004; Hardave Riar <hardave@gentoo.org> ppp-2.4.2-r7.ebuild:
+ Stable on mips, bug #69152.
+
+ 01 Nov 2004; Daniel Black <dragonheart@gentoo.org> files/net.ppp0:
+ Permissions changed from 640 to 644 on ip-up/down scripts as per bug #37886
+ Thanks to Oliver Schoett <oschoett@t-online.de>
+
+ 31 Oct 2004; <SeJo@gentoo.org> ppp-2.4.2-r7.ebuild:
+ stable on ppc gsla: 69152
+
+ 31 Oct 2004; Daniel Black <dragonheart@gentoo.org> ppp-2.4.2-r7.ebuild:
+ x86 stable
+
+ 30 Oct 2004; Bryan Østergaard <kloeri@gentoo.org> ppp-2.4.2-r7.ebuild:
+ Stable on alpha, bug 69152.
+
+ 30 Oct 2004; Jason Wever <weeve@gentoo.org> ppp-2.4.2-r7.ebuild:
+ Stable on sparc wrt security bug #69152.
+
+ 30 Oct 2004; Simon Stelling <blubb@gentoo.org> ppp-2.4.2-r7.ebuild:
+ stable on amd64 for security reasons (bug #69152)
+
+*ppp-2.4.2-r7 (30 Oct 2004)
+
+ 30 Oct 2004; Daniel Black <dragonheart@gentoo.org>
+ +files/2.4.2/cbcp-dosfix.patch, +ppp-2.4.2-r7.ebuild:
+ Added patch cbcp-dosfix.patch to fix remote DOS as per bug #69152. Thanks Dan
+ Margolis <krispykringle@gentoo.org>
+
+*ppp-2.4.2-r6 (14 Oct 2004)
+
+ 14 Oct 2004; Daniel Black <dragonheart@gentoo.org> -ppp-2.4.2-r5.ebuild,
+ +ppp-2.4.2-r6.ebuild:
+ revision bump and remove old version to fix bug #67125. Thanks Ned for
+ the notification and Alin Nastac for the simple fix
+
+*ppp-2.4.2-r5 (27 Sep 2004)
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> -ppp-2.4.2-r4.ebuild,
+ +ppp-2.4.2-r5.ebuild:
+ add dhcp plugin, bug #62969
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2/net.ppp0:
+ fix setup for two modems, bug #43923
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r4.ebuild:
+ fix activfilter useflag
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> files/net.ppp0:
+ fix handling of INITSTRING, bug #49861
+
+*ppp-2.4.2-r4 (27 Sep 2004)
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2/modules.ppp,
+ -ppp-2.4.2-r3.ebuild, +ppp-2.4.2-r4.ebuild:
+ add mppe-mppc support via useflag, bug #51027
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r3.ebuild:
+ move radius plugin from /usr/lib to /usr/lib/ppp/2.4.2, bug #56747
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.1-r14.ebuild:
+ apply pcap patch to 2.4.1-r14, bug #51059
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org>
+ +files/2.4.2/endless-loop.patch, ppp-2.4.2.ebuild:
+ fix endless loop, bug #58364
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r3.ebuild:
+ remove unneccesary x86 dependencie of atm use flag, bug #55881
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2/net.ppp0:
+ load ppp module if not present, bug #55233
+
+ 27 Sep 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2/ip-down,
+ files/2.4.2/ip-up:
+ fix resolv.conf permissions
+
+ 25 Sep 2004; Mike Frysinger <vapier@gentoo.org> ppp-2.4.1-r14.ebuild,
+ ppp-2.4.2-r1.ebuild, ppp-2.4.2-r2.ebuild, ppp-2.4.2-r3.ebuild,
+ ppp-2.4.2.ebuild:
+ Do not install the pap/chap secrets files because if a user makes a binary
+ package, they could include their passwords without realizing it.
+
+*ppp-2.4.2-r3 (24 Sep 2004)
+
+ 24 Sep 2004; Daniel Black <dragonheart@gentoo.org>
+ -files/ppp-2.4.1-openssl-0.9.6-mppe-patch.gz,
+ -files/ppp-crypto-fix.patch.bz2, +files/2.4.2/control_c.patch,
+ ppp-2.4.1-r14.ebuild, +ppp-2.4.2-r3.ebuild:
+ Patch added to fix bug #57238. Thank to Thomas G <ganto2@gmx.de> et al.
+ Removed unused patch files/ppp-2.4.1-openssl-0.9.6-mppe-patch.gz. Moved
+ files/ppp-crypto-fix.patch.bz2 to mirrors.
+
+ 01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org> ppp-2.4.1-r14.ebuild,
+ ppp-2.4.2-r1.ebuild, ppp-2.4.2-r2.ebuild, ppp-2.4.2.ebuild:
+ virtual/glibc -> virtual/libc
+
+ 13 Jun 2004; Travis Tilley <lv@gentoo.org> ppp-2.4.2-r2.ebuild:
+ pushing to stable -way- early to fix bug #53615
+
+ 12 Jun 2004; Travis Tilley <lv@gentoo.org> ppp-2.4.2-r2.ebuild:
+ this version compiles on amd64, re-adding ~amd64 keyword
+
+ 09 Jun 2004; Aron Griffis <agriffis@gentoo.org> ppp-2.4.1-r14.ebuild,
+ ppp-2.4.2-r1.ebuild, ppp-2.4.2-r2.ebuild, ppp-2.4.2.ebuild:
+ Fix use invocation
+
+ 03 May 2004; Jason Eric Huebel <jhuebel@gentoo.org> ppp-2.4.2-r2.ebuild:
+ gnuconfig update
+
+ 30 Apr 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r1.ebuild,
+ ppp-2.4.2-r2.ebuild:
+ bug #49318
+
+ 28 Apr 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r2.ebuild:
+ link to libatm, bug #49133
+
+*ppp-2.4.2-r2 (27 Apr 2004)
+
+ 27 Apr 2004; Aron Griffis <agriffis@gentoo.org> ppp-2.4.1-r14.ebuild,
+ ppp-2.4.2-r1.ebuild, ppp-2.4.2-r2.ebuild, ppp-2.4.2.ebuild:
+ Add inherit eutils
+
+ 26 Apr 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2b3/README.mpls,
+ files/2.4.2b3/cflags.patch, files/2.4.2b3/chat-default,
+ files/2.4.2b3/confd.ppp0, files/2.4.2b3/ip-down, files/2.4.2b3/ip-up,
+ files/2.4.2b3/killaddr-smarter.patch, files/2.4.2b3/modules.ppp,
+ files/2.4.2b3/mpls.patch, files/2.4.2b3/net.ppp0,
+ files/2.4.2b3/options-pppoe, files/2.4.2b3/options-pptp,
+ files/2.4.2b3/pppoe.html:
+ remove old version
+
+ 26 Apr 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2/modules.ppp:
+ update pppoatm patch, bug #47574
+ add mppe alias, bug #47091
+
+ 08 Mar 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r1.ebuild:
+ install pppoatm.so, not only build it
+
+ 06 Mar 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r1.ebuild:
+ add support for udev
+
+*ppp-2.4.2-r1 (06 Mar 2004)
+
+ 06 Mar 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2-r1.ebuild:
+ add atm to IUSE=""
+
+ 06 Mar 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2.ebuild,
+ files/2.4.2/killaddr-smarter.patch, files/2.4.2/killaddr-smarter.patch.gz,
+ files/2.4.2/mpls.patch, files/2.4.2/mpls.patch.gz,
+ files/2.4.2/pppoatm.diff.gz, files/2.4.2/stdopt-mppe-mppc-0.82.patch.gz:
+ add atm support (bug #41607) and mppc support (bug #42212)
+
+ 22 Feb 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2.ebuild:
+ bug #41914
+
+ 14 Feb 2004; Aron Griffis <agriffis@gentoo.org> ppp-2.4.2.ebuild,
+ files/2.4.2/pcap.patch:
+ Patch for libpcap headers; fixes bug 41416
+
+*ppp-2.4.2 (12 Feb 2004)
+
+ 12 Feb 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2.ebuild:
+ version bump
+
+ 18 Jan 2004; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2_beta3-r1.ebuild:
+ enable radius
+
+ 17 Jan 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2b3/ip-down,
+ files/2.4.2b3/ip-up:
+ resolv.conf permissions again, took method from debian
+
+ 12 Jan 2004; Heinrich Wendel <lanius@gentoo.org> files/2.4.2b3/ip-down,
+ files/2.4.2b3/ip-up:
+ resolv.conf permissions again
+
+ 01 Jan 2004; <tuxus@gentoo.org> ppp-2.4.1-r14.ebuild:
+ Added mips to KEYWORDS
+
+ 27 Dec 2003; Heinrich Wendel <lanius@gentoo.org> files/2.4.2b3/net.ppp0:
+ fixed sleep command to work on all locales (bug #36571)
+
+ 27 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2_beta3-r1.ebuild:
+ fixed sed expression to only replace pppoe.so but not rp-pppoe.so
+
+ 26 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2_beta3-r1.ebuild:
+ automatically change pppoe.so to rp-pppoe.so (library name changed in 2.4.2)
+
+ 23 Dec 2003; Brad House <brad_mssw@gentoo.org> ppp-2.4.2_beta3-r1.ebuild:
+ freezes on compile on amd64, even after libtoolize addition
+
+ 22 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.1-r11.ebuild,
+ ppp-2.4.1-r12.ebuild, ppp-2.4.1-r13.ebuild, ppp-2.4.2_beta3.ebuild:
+ removed old versions
+
+ 22 Dec 2003; Heinrich Wendel <lanius@gentoo.org> files/2.4.2b3/ip-down,
+ files/2.4.2b3/ip-up, files/2.4.2b3/net.ppp0:
+ speed up startup in special cases (bug #36195)
+
+*ppp-2.4.2_beta3-r1 (22 Dec 2003)
+
+ 22 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2_beta3-r1.ebuild,
+ files/2.4.2b3/confd.ppp0, files/2.4.2b3/net.ppp0:
+ added support for leased-line pppd setups (bug #33290)
+
+*ppp-2.4.2_beta3-r1 (22 Dec 2003)
+
+ 22 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2_beta3-r1.ebuild,
+ files/2.4.2b3/README.mpls, files/2.4.2b3/cflags.patch,
+ files/2.4.2b3/chat-default, files/2.4.2b3/confd.ppp0, files/2.4.2b3/ip-down,
+ files/2.4.2b3/ip-up, files/2.4.2b3/killaddr-smarter.patch,
+ files/2.4.2b3/modules.ppp, files/2.4.2b3/mpls.patch, files/2.4.2b3/net.ppp0,
+ files/2.4.2b3/options-pppoe, files/2.4.2b3/options-pptp,
+ files/2.4.2b3/pppoe.html:
+
+ major cleanups:
+ - moved all cflags fixed to one patch
+ - added mpls support
+ - use pon, poff, plog scripts from ppp distribution
+ - added killaddr-smarter patch (http://seclists.org/lists/linux-kernel/2001/Jan/ 5745.html)
+ - added options files for pppoe and pptp
+ - fixed resolv.conf issues
+ - fixed stopping of net.ppp0
+ - some minor things i forgot
+
+ many thx to:
+ - Robert Cernansky <openhs@users.sourceforge.net> (bug#26920)
+ - Cory Visi <cory@visi.name> (bug #35381)
+ - Francesco Pretto <ceztko@libero.it> (bug #36081)
+ - Steve Hudson <shudson2@uwo.ca> (bug #26311)
+ - BlueRaven <blueraven@libero.it> (bug #31418)
+
+ 08 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.1-r14.ebuild:
+ added alpha to keywords, stable on sparc
+
+ 05 Dec 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.1-r13.ebuild:
+ fixed chown syntax
+
+ 19 Nov 2003; Heinrich Wendel <lanius@gentoo.org> metadata.xml:
+ metadata.xml
+
+*ppp-2.4.2_beta3 (02 Oct 2003)
+
+ 02 Oct 2003; Heinrich Wendel <lanius@gentoo.org> ppp-2.4.2_beta3.ebuild:
+ version bump
+
+ 06 Sep 2003; Seemant Kulleen <seemant@gentoo.org> files/net.ppp0:
+ surround username with quotes for the secrets file generation. This helps with
+ users who have funky characters in the usernames. Thanks to choenig__ in
+ #gentoo-bugs (Christian Hoenig <gentoo@christianhoenig.de>)
+
+ 06 Sep 2003; Martin Holzer <mholzer@gentoo.org> ppp-2.4.1-r14.ebuild:
+ removing pppatm
+
+ 07 Aug 2003; Tavis Ormandy <taviso@gentoo.org> ppp-2.4.1-r12.ebuild:
+ stable on alpha
+
+ 01 Jul 2003; Olivier Crete <tester@gentoo.org> ppp-2.4.1-r14.ebuild:
+ fix for va_list on amd64 (its like ppc)
+
+ 15 Jul 2003; Martin Schlemmer <azarah@gentoo.org> files/net.ppp0:
+ Do not update /etc/ppp/peers if no NUMBER is set - this is for non
+ dialup users, thanks to Maciek Freudenheim <fahren@bochnia.pl>.
+
+ 12 Jun 2003; <msterret@gentoo.org> ppp-2.4.1-r13.ebuild,
+ ppp-2.4.1-r14.ebuild:
+ add Header
+
+ 26 May 2003; Luca Barbato <lu_zero@gentoo.org> ppp-2.4.1-r14.ebuild:
+ gcc-3.3 fix and moving the patches in src_unpack.
+
+*ppp-2.4.1-r14 (22 May 2003)
+
+ 04 Aug 2003; Guy Martin <gmsoft@gentoo.org> ppp-2.4.1-r14.ebuild :
+ Marked stable on hppa.
+
+ 22 May 2003; Chuck Brewer <killian@gentoo.org> ppp-2.4.1-r14.ebuild:
+ new testing ebuild, adds pppoatm.so that should work with this build
+
+*ppp-2.4.1-r12 (22 May 2003)
+
+ 22 May 2003; Chuck Brewer <killian@gentoo.org> ppp-2.4.1-r12.ebuild:
+ Added stuff from baselayout to be provided by the ppp package, i.e.
+ net.ppp0,conf.d/net.ppp0 and chat-default
+
+*ppp-2.4.1-r13 (24 Apr 2003)
+
+ 24 Apr 2003; Chuck Brewer <killian@gentoo.org> ppp-2.4.1-r13.ebuild:
+ Added ppp-2.4.1-r13.ebuild and digest to include support for p* and
+ ip-* scripts, perms fix, details in bug #18264
+
+ 15 Apr 2003; Tavis Ormandy <taviso@gentoo.org> ppp-2.4.1-r12.ebuild:
+ Adding ~alpha keyword.
+
+ 28 Mar 2003; Guy Martin <gmsoft@gentoo.org> ppp-2.4.1-r12.ebuild :
+ Added hppa to KEYWORDS.
+
+ 02 Mar 2003; Seemant Kulleen <seemant@gentoo.org> ppp-2.4.1-r12.ebuild :
+
+ Moved to stable x86. Closing bug #12002
+
+ 05 Feb 2003; Hannes Mehnert <hannes@gentoo.org> ppp-2.4.1-r12.ebuild:
+ added local activefilter useflag, thanks to Alexander Holler
+ <holler@ahsoftware.de> for his patch
+
+ 06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
+
+*ppp-2.4.1-r12 (15 Dec 2002)
+
+ 15 Dec 2002; phoen][x <phoenix@gentoo.org> ppp-2.4.1-r12.ebuild, ChangeLog,
+ files/digest-ppp-2.4.1-r12 :
+ Fixed a pretty severe bug: /etc/modules.d/ppp was set +x - that caused
+ a strange behaviour with update-modules. See bug #12002 for more details.
+ Fixed the LICENSE setting: GPL -> GPL-2.
+ Revision bump to force portage to update ppp.
+
+*ppp-2.4.1-r11 (28 Aug 2002)
+
+ 13 Nov 2002; Hannes Mehnert <hannes@gentoo.org> ppp-2.4.1-r11.ebuild :
+ added sample /etc/ppp/ip-up script submitted in bug #8609, added IUSE
+
+ 16 Sep 2002; Maarten Thibaut <murphy@gentoo.org> ppp-2.4.1-r11.ebuild :
+ Added sparc and sparc64 keywords. Revamped ChangeLog layout.
+
+ 15 Sep 2002; phoen][x <phoenix@gentoo.org> ppp-2.4.1-r11.ebuild :
+ Uploaded the tarball to ibiblio and modified SRC_URI.
+ This closes bug 7771.
+
+ 05 Sep 2002; phoen][x <phoenix@gentoo.org> ppp-2.4.1-r11.ebuild :
+ Enabled callback.
+ This closes bug 7373.
+
+ 28 Aug 2002; phoen][x <phoenix@gentoo.org> ppp-2.4.1-r11.ebuild :
+ Added ipv6 useflag support.
+ This closes bug 6972.
+
+*ppp-2.4.1-r10 (31 Jul 2002)
+
+ 16 Sep 2002; Maarten Thibaut <murphy@gentoo.org> ppp-2.4.1-r10.ebuild :
+ Added sparc and sparc64 keywords.
+
+ 3 Aug 2002; Calum Selkirk <cselkirk@gentoo.org> ppp-2.4.1-r10.ebuild
+ ppp-2.4.1-r9.ebuild :
+ Added ppc to KEYWORDS.
+
+ 31 Jul 2002; Daniel Ahlberg <aliz@gentoo.org> ppp-2.4.1-r10.ebuild :
+ Security fix - added a patch to prevent race condition.
+
+*ppp-2.4.1-r9
+
+ 16 Jul 2002; Ben Lutgens <lamer@gentoo.org> ppp-2.4.1-r[789].ebuild :
+ updated homepage
+
+*ppp-2.4.1-r8 (09 Apr 2002)
+
+ 22 May 2002; Mike Jones <ashmodai@gentoo.org> :
+ Added (optional - USE crypt variable was used) MPPE support for ppp, enabling
+ clients who use the pptp server to have encrypted connections.
+
+*ppp-2.4.1-r8 (09 Apr 2002)
+
+ 09 Apr 2002; Daniel Robbins <drobbins@gentoo.org> : fixed plugin installation
+ path; closing bug #1629.
+
+*ppp-2.4.1-r7 (08 Apr 2002)
+
+ 08 Apr 2002; Daniel Robbins <drobbins@gentoo.org> : New release of ppp (using
+ new kernel pppoe-enabled ebuild submitted by Christian Loitsch.) Closes bug
+ #1527.
+
+*ppp-2.4.1-r6 (01 Feb 2002)
+
+ 1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog :
+
+ Added initial ChangeLog which should be updated whenever the package is
+ updated in any way. This changelog is targetted to users. This means that the
+ comments should well explained and written in clean English. The details about
+ writing correct changelogs are explained in the skel.ChangeLog file which you
+ can find in the root directory of the portage repository.
diff --git a/net-dialup/ppp/Manifest b/net-dialup/ppp/Manifest
new file mode 100644
index 00000000..8200ad6e
--- /dev/null
+++ b/net-dialup/ppp/Manifest
@@ -0,0 +1,10 @@
+AUX README.mpls 530 SHA256 5ef99aba902533fe9d17b7dfaf91e72b638cc70b9f811d1e518822ee80b5ff57 SHA512 2b617365fce74cceeb14e53f476b454c4420273661050d25e1c524cf5d56a7554318a268f7b9ebb100592b61a01d274efaeed28abb9ca0adaeb71ef981201b36 WHIRLPOOL f96310ae7e75bd4e289d97767f6a74a6a0a0006855068755d7cfb484950e145246472b3a6cffcd0db44c589ed43720f998872ef1e7b12a3ccd02e833d80e6e84
+AUX modules.ppp 299 SHA256 8947dd48d3d0c128166edc9bb0917b9af88502296fad791d6d90bf165ca50db3 SHA512 58bf5d6d286a08bd6dd595b39ee425efedd5745dddf33a9c90505891546eb46f4cf1306d83911bef61bc4611816aa0f6aef5d3e0f14c2f4ddd0a588780570041 WHIRLPOOL dfc2d6fb1a36b74b0dd998739bb1c5977234c2d88100f686fb6faae2826795b0ca217937a7775660421f5ebc356e5e1378849ac6e56fef018eceab6f90bb26e3
+AUX ppp-2.4.7-dhcp-musl.patch 1943 SHA256 2c76bf44407ebb917c0c7db7b1d7c7253e6d67efa16edfbd6906b7cd18e5951b SHA512 26cbbe527a8bf950d983f124b78b6b65fcd5f37ff9af20ec8ffcd7b4cb42d507ec80270361c7993a4cd96f78b170da5b5818f10146f76f193f9cd958f0014eec WHIRLPOOL d2578dbdf9a9b1215584bf77c0a725e7c0785880ad09a8b27cacb6f79655338d1e3609d984a8a523dc41392edc658ba0d161a5ea5639569b7be247ef9b4d1276
+AUX ppp-2.4.7-musl.patch 5350 SHA256 91e67a03538b1146584b784bfd41f33eb4d0587af66e6df442a3a2ffa259c8af SHA512 ce6381280c5299933ee55cc1039874e9d33900e28198939263ca4b78e1c1b8e88939e198c4e313e7f05ba6d85ff33e8d5ccd5c5ba12c7acfff6d96e767738179 WHIRLPOOL bf6d148ba578ffcdd169c966d13daa541d478a2d400e1a1aad53b52d0e11b55d14b23d0f78f3f9dbb8b3cfd56ea4641d2a15224fcc47fc996c4779429d4e397a
+DIST ppp-2.4.7-patches-2.tar.xz 37484 SHA256 ca2a58bb2af2c2a728cfaefab31386239bda2e750765141f9aae65bde38d58f1 SHA512 91d91820a7171dbe93fc4d9235456dd6eaa821b79fd0d34691bd95ecfeec2f571ed69ef07fa5839c78132dbbcb0f6b347e2ac5f794a0a1385055c7bf9a4637b6 WHIRLPOOL 6ba77ffdcf51fd792439c56dd43bab51cb978db395c1a409019e549fb1481a33f0cd8b8b3aaed93dbecb3b5e4b6916e4ef5a5425a6509b05b874add936632173
+DIST ppp-2.4.7.tar.gz 688117 SHA256 02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30 SHA512 e34ce24020af6a73e7a26c83c4f73a9c83fa455b7b363794dba27bf01f70368be06bff779777843949bd77f4bc9385d6ad455ea48bf8fff4e0d73cc8fef16ae2 WHIRLPOOL 48f3251e6b955ecfdaf9260b9ea5220d9e355fff836e2f5217ee0b15bf2c93e43f8207005f58bf1f97fb8ff0c76c56df8ecd8536f63c4d84d5940458ba0ba5c3
+DIST ppp-dhcpc.tgz 33497 SHA256 977fd980bb1d285963d8e27a87b7601ea84317faadfdb40989b258d1853db644 SHA512 aeaf791b14f5a09c0e2079072a157e65132cbff46e608bc0724e6a5827a01da934f5006e2774eb7105f83e607a52cb4987238f4385cf6f5cc86cbe305a556738 WHIRLPOOL 74e5e0d7f9bc52d1b9cfeff83fe74c2b38cc10c60636cd9c0f5d67d61dc7da56dbf2bcc84afa29444546792876cb36afbc853a6515ce9b3d83d6de98eacedd1e
+EBUILD ppp-2.4.7-r99.ebuild 7034 SHA256 2e5da5c46173eaff782b639bb1b49f4206b817fa3fba1fb7496ec030877128dc SHA512 fc2b3cc3d2e267d9636e326e0ad8c45a414e879f5d7452b6218904d27a99b5a2c4c193d46ed22d6dc04b32f6e48c21198a9dc21ec523f7427eae1bd2f97960cc WHIRLPOOL 2327bb37ce7f23c4d975ce715651ccb433e591e30da7f34f465c0e9fe82d4c0fcff743a127752d948d28e3d0499ca1a9e452970e35aaac4166076bc214cef351
+MISC ChangeLog 48359 SHA256 7fc888cc470be8f7d8fb3dc93e5f47663040b3a7b831714a6df5a3a9709e7b59 SHA512 21979dedf9368f3b3135b54dd7ce8db70c105461bfdd2b1c2c8c3d1986bc6285a19621cfcca52a4130e0d32997a89bf3cdbcb232159987689689c14bd81145b5 WHIRLPOOL 597664594efeb789dcefd0e7ea0b722a53463910757c57994c3b13516d338c86157a3d819fd7367c63155e78bacb96192079753f2b184c88beb65319534d3fac
+MISC metadata.xml 1437 SHA256 ead1d034656325de6aebce34890880e837b002baebcc9064218913b0b1796216 SHA512 1113d280079f4ba1ae4d12106ffeb6bda6c4fa72a8514df2522b7f3db556b4931f4960d4567ac093558cd266de0eb3cdfd1c955047b7ab12bd9a8b7588f2f143 WHIRLPOOL 02f4409c8e891ada907f775a6c68f65ab5a0d5eaae6bf20d4323cf592cd91cadcb5124f08c030327f77df079f9e57e5a695f59d19b8226f7453553de6db9c9fd
diff --git a/net-dialup/ppp/files/README.mpls b/net-dialup/ppp/files/README.mpls
new file mode 100644
index 00000000..1ae7ae46
--- /dev/null
+++ b/net-dialup/ppp/files/README.mpls
@@ -0,0 +1,15 @@
+MPLS consists of 3 components:
+1. MPLS forwarding
+2. MPLS signalling
+3. Mapping layer 3 traffic onto MPLS LSPs
+
+The document mpls-forwarding basics explains item 1.
+
+Examples of MPLS signalling protocols are: RSVP-TE LDP and CR-LDP.
+The package ldp-portable is an implementation of LDP and contains more
+information about LDP based MPLS signalling.
+
+Mapping of layer 3 traffic to MPLS LSPs is accomplised in a couple of
+different ways.
+-Per FEC where FEC is an entry in the routing table
+-Virtual interface that represents an LSP
diff --git a/net-dialup/ppp/files/modules.ppp b/net-dialup/ppp/files/modules.ppp
new file mode 100644
index 00000000..e936041c
--- /dev/null
+++ b/net-dialup/ppp/files/modules.ppp
@@ -0,0 +1,10 @@
+alias char-major-108 ppp_generic
+alias /dev/ppp ppp_generic
+alias tty-ldisc-3 ppp_async
+alias tty-ldisc-13 n_hdlc
+alias tty-ldisc-14 ppp_synctty
+alias ppp-compress-18 ppp_mppe
+alias ppp-compress-21 bsd_comp
+alias ppp-compress-24 ppp_deflate
+alias ppp-compress-26 ppp_deflate
+alias net-pf-24 pppoe
diff --git a/net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.patch b/net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.patch
new file mode 100644
index 00000000..4830bfe3
--- /dev/null
+++ b/net-dialup/ppp/files/ppp-2.4.7-dhcp-musl.patch
@@ -0,0 +1,44 @@
+diff -ur ppp-2.4.7.orig/pppd/plugins/dhcp/clientpacket.c ppp-2.4.7/pppd/plugins/dhcp/clientpacket.c
+--- ppp-2.4.7.orig/pppd/plugins/dhcp/clientpacket.c 2002-08-31 12:19:20.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/dhcp/clientpacket.c 2015-05-20 13:24:41.299978928 +0000
+@@ -205,9 +205,9 @@
+
+ /* Make sure its the right packet for us, and that it passes sanity checks */
+ if (packet.ip.protocol != IPPROTO_UDP || packet.ip.version != IPVERSION ||
+- packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) ||
++ packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.uh_dport != htons(CLIENT_PORT) ||
+ bytes > (int) sizeof(struct udp_dhcp_packet) ||
+- ntohs(packet.udp.len) != (short) (bytes - sizeof(packet.ip))) {
++ ntohs(packet.udp.uh_ulen) != (short) (bytes - sizeof(packet.ip))) {
+ DEBUG(LOG_INFO, "unrelated/bogus packet");
+ return -1;
+ }
+@@ -223,14 +223,14 @@
+ /* verify the UDP checksum by replacing the header with a psuedo header */
+ source = packet.ip.saddr;
+ dest = packet.ip.daddr;
+- check = packet.udp.check;
+- packet.udp.check = 0;
++ check = packet.udp.uh_sum;
++ packet.udp.uh_sum = 0;
+ memset(&packet.ip, 0, sizeof(packet.ip));
+
+ packet.ip.protocol = IPPROTO_UDP;
+ packet.ip.saddr = source;
+ packet.ip.daddr = dest;
+- packet.ip.tot_len = packet.udp.len; /* cheat on the psuedo-header */
++ packet.ip.tot_len = packet.udp.uh_ulen; /* cheat on the psuedo-header */
+ if (check && check != checksum(&packet, bytes)) {
+ DEBUG(LOG_ERR, "packet with bad UDP checksum received, ignoring");
+ return -1;
+diff -ur ppp-2.4.7.orig/pppd/plugins/dhcp/dhcpd.h ppp-2.4.7/pppd/plugins/dhcp/dhcpd.h
+--- ppp-2.4.7.orig/pppd/plugins/dhcp/dhcpd.h 2002-08-31 11:52:31.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/dhcp/dhcpd.h 2015-05-20 13:24:10.999978974 +0000
+@@ -4,6 +4,7 @@
+
+ #include <netinet/ip.h>
+ #include <netinet/udp.h>
++#include <sys/types.h>
+
+ #include "leases.h"
+
diff --git a/net-dialup/ppp/files/ppp-2.4.7-musl.patch b/net-dialup/ppp/files/ppp-2.4.7-musl.patch
new file mode 100644
index 00000000..8b75727a
--- /dev/null
+++ b/net-dialup/ppp/files/ppp-2.4.7-musl.patch
@@ -0,0 +1,179 @@
+diff -ur ppp-2.4.7.orig/include/linux/ppp_defs.h ppp-2.4.7/include/linux/ppp_defs.h
+--- ppp-2.4.7.orig/include/linux/ppp_defs.h 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/include/linux/ppp_defs.h 2015-05-20 12:38:46.739983089 +0000
+@@ -50,6 +50,10 @@
+ #ifndef _PPP_DEFS_H_
+ #define _PPP_DEFS_H_
+
++#ifndef __P
++# define __P(x) x
++#endif
++
+ /*
+ * The basic PPP frame.
+ */
+diff -ur ppp-2.4.7.orig/include/net/ppp_defs.h ppp-2.4.7/include/net/ppp_defs.h
+--- ppp-2.4.7.orig/include/net/ppp_defs.h 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/include/net/ppp_defs.h 2015-05-20 12:38:46.739983089 +0000
+@@ -38,6 +38,8 @@
+ #ifndef _PPP_DEFS_H_
+ #define _PPP_DEFS_H_
+
++#include <sys/time.h>
++
+ /*
+ * The basic PPP frame.
+ */
+diff -ur ppp-2.4.7.orig/pppd/Makefile.linux ppp-2.4.7/pppd/Makefile.linux
+--- ppp-2.4.7.orig/pppd/Makefile.linux 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/Makefile.linux 2015-05-20 12:38:46.739983089 +0000
+@@ -126,7 +126,7 @@
+ endif
+
+ ifdef USE_LIBUTIL
+-CFLAGS += -DHAVE_LOGWTMP=1
++#CFLAGS += -DHAVE_LOGWTMP=1
+ LIBS += -lutil
+ endif
+
+diff -ur ppp-2.4.7.orig/pppd/magic.h ppp-2.4.7/pppd/magic.h
+--- ppp-2.4.7.orig/pppd/magic.h 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/magic.h 2015-05-20 12:38:46.739983089 +0000
+@@ -42,6 +42,10 @@
+ * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
+ */
+
++#ifndef __P
++# define __P(x) x
++#endif
++
+ void magic_init __P((void)); /* Initialize the magic number generator */
+ u_int32_t magic __P((void)); /* Returns the next magic number */
+
+diff -ur ppp-2.4.7.orig/pppd/plugins/rp-pppoe/config.h ppp-2.4.7/pppd/plugins/rp-pppoe/config.h
+--- ppp-2.4.7.orig/pppd/plugins/rp-pppoe/config.h 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/rp-pppoe/config.h 2015-05-20 12:38:46.739983089 +0000
+@@ -101,9 +101,6 @@
+ /* Define if you have the <netpacket/packet.h> header file. */
+ #define HAVE_NETPACKET_PACKET_H 1
+
+-/* Define if you have the <sys/cdefs.h> header file. */
+-#define HAVE_SYS_CDEFS_H 1
+-
+ /* Define if you have the <sys/dlpi.h> header file. */
+ /* #undef HAVE_SYS_DLPI_H */
+
+diff -ur ppp-2.4.7.orig/pppd/plugins/rp-pppoe/if.c ppp-2.4.7/pppd/plugins/rp-pppoe/if.c
+--- ppp-2.4.7.orig/pppd/plugins/rp-pppoe/if.c 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/rp-pppoe/if.c 2015-05-20 12:38:46.739983089 +0000
+@@ -30,10 +30,6 @@
+ #include <linux/if_packet.h>
+ #endif
+
+-#ifdef HAVE_NET_ETHERNET_H
+-#include <net/ethernet.h>
+-#endif
+-
+ #ifdef HAVE_ASM_TYPES_H
+ #include <asm/types.h>
+ #endif
+diff -ur ppp-2.4.7.orig/pppd/plugins/rp-pppoe/plugin.c ppp-2.4.7/pppd/plugins/rp-pppoe/plugin.c
+--- ppp-2.4.7.orig/pppd/plugins/rp-pppoe/plugin.c 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/rp-pppoe/plugin.c 2015-05-20 12:38:46.739983089 +0000
+@@ -46,7 +46,6 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <net/ethernet.h>
+ #include <net/if_arp.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_pppox.h>
+diff -ur ppp-2.4.7.orig/pppd/plugins/rp-pppoe/pppoe-discovery.c ppp-2.4.7/pppd/plugins/rp-pppoe/pppoe-discovery.c
+--- ppp-2.4.7.orig/pppd/plugins/rp-pppoe/pppoe-discovery.c 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/rp-pppoe/pppoe-discovery.c 2015-05-20 12:38:46.739983089 +0000
+@@ -27,10 +27,6 @@
+ #include <linux/if_packet.h>
+ #endif
+
+-#ifdef HAVE_NET_ETHERNET_H
+-#include <net/ethernet.h>
+-#endif
+-
+ #ifdef HAVE_ASM_TYPES_H
+ #include <asm/types.h>
+ #endif
+@@ -55,6 +51,8 @@
+ exit(status);
+ }
+
++#define error(x...) fprintf(stderr, x)
++
+ /* Initialize frame types to RFC 2516 values. Some broken peers apparently
+ use different frame types... sigh... */
+
+diff -ur ppp-2.4.7.orig/pppd/plugins/rp-pppoe/pppoe.h ppp-2.4.7/pppd/plugins/rp-pppoe/pppoe.h
+--- ppp-2.4.7.orig/pppd/plugins/rp-pppoe/pppoe.h 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/plugins/rp-pppoe/pppoe.h 2015-05-20 12:38:46.739983089 +0000
+@@ -39,10 +39,6 @@
+ #error Unknown method for accessing raw Ethernet frames
+ #endif
+
+-#ifdef HAVE_SYS_CDEFS_H
+-#include <sys/cdefs.h>
+-#endif
+-
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+@@ -86,19 +82,6 @@
+
+ #include <netinet/in.h>
+
+-#ifdef HAVE_NETINET_IF_ETHER_H
+-#include <sys/types.h>
+-
+-#ifdef HAVE_SYS_SOCKET_H
+-#include <sys/socket.h>
+-#endif
+-#ifndef HAVE_SYS_DLPI_H
+-#include <netinet/if_ether.h>
+-#endif
+-#endif
+-
+-
+-
+ /* Ethernet frame types according to RFC 2516 */
+ #define ETH_PPPOE_DISCOVERY 0x8863
+ #define ETH_PPPOE_SESSION 0x8864
+diff -ur ppp-2.4.7.orig/pppd/sys-linux.c ppp-2.4.7/pppd/sys-linux.c
+--- ppp-2.4.7.orig/pppd/sys-linux.c 2014-08-09 12:31:39.000000000 +0000
++++ ppp-2.4.7/pppd/sys-linux.c 2015-05-20 12:39:38.269983011 +0000
+@@ -73,7 +73,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/file.h>
+ #include <sys/stat.h>
+ #include <sys/utsname.h>
+@@ -102,19 +102,11 @@
+ #define MAX_ADDR_LEN 7
+ #endif
+
+-#if __GLIBC__ >= 2
+ #include <asm/types.h> /* glibc 2 conflicts with linux/types.h */
+ #include <net/if.h>
+ #include <net/if_arp.h>
+ #include <net/route.h>
+ #include <netinet/if_ether.h>
+-#else
+-#include <linux/types.h>
+-#include <linux/if.h>
+-#include <linux/if_arp.h>
+-#include <linux/route.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+
diff --git a/net-dialup/ppp/metadata.xml b/net-dialup/ppp/metadata.xml
new file mode 100644
index 00000000..a80d7e96
--- /dev/null
+++ b/net-dialup/ppp/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version = '1.0' encoding = 'UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-dialup</herd>
+ <longdescription>ppp (Paul's PPP Package) is an open source package which
+ implements the Point-to-Point Protocol</longdescription>
+ <use>
+ <flag name="activefilter">Enables active filter support</flag>
+ <flag name="atm">Enables ATM (Asynchronous Transfer Mode) protocol
+ support</flag>
+ <flag name="dhcp">Installs PPP DHCP client plugin for IP address allocation
+ by a DHCP server (see http://www.netservers.co.uk/gpl/)</flag>
+ <flag name="eap-tls">Enables support for Extensible Authentication
+ Protocol and Transport Level Security (see
+ http://www.nikhef.nl/~janjust/ppp/index.html)</flag>
+ <flag name="gtk">Installs GTK+ password prompting program that can be used
+ by passprompt.so PPP plugin for reading the password from a X11 input
+ terminal</flag>
+ <flag name="ipv6">Enables support for IP version 6</flag>
+ <flag name="mppe-mppc">Enables support for MPPC (Microsoft Point-to-Point
+ Compression) - NEEDS A PATCHED KERNEL &lt;=2.6.14 (see
+ http://mppe-mppc.alphacron.de)</flag>
+ <flag name="pam">Enables PAM (Pluggable Authentication Modules)
+ support</flag>
+ <flag name="radius">Enables RADIUS support</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:samba:ppp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-dialup/ppp/ppp-2.4.7-r99.ebuild b/net-dialup/ppp/ppp-2.4.7-r99.ebuild
new file mode 100644
index 00000000..68c2c8c1
--- /dev/null
+++ b/net-dialup/ppp/ppp-2.4.7-r99.ebuild
@@ -0,0 +1,226 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/ppp/ppp-2.4.7-r1.ebuild,v 1.2 2015/05/14 10:21:15 pinkbyte Exp $
+
+EAPI=5
+
+inherit eutils linux-info multilib pam toolchain-funcs
+
+PATCH_VER="2"
+DESCRIPTION="Point-to-Point Protocol (PPP)"
+HOMEPAGE="http://www.samba.org/ppp"
+SRC_URI="ftp://ftp.samba.org/pub/ppp/${P}.tar.gz
+ http://dev.gentoo.org/~pinkbyte/distfiles/patches/${P}-patches-${PATCH_VER}.tar.xz
+ http://www.netservers.net.uk/gpl/ppp-dhcpc.tgz"
+
+LICENSE="BSD GPL-2"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="activefilter atm dhcp eap-tls gtk ipv6 pam radius"
+
+DEPEND="activefilter? ( net-libs/libpcap )
+ atm? ( net-dialup/linux-atm )
+ pam? ( virtual/pam )
+ gtk? ( x11-libs/gtk+:2 )
+ eap-tls? ( net-misc/curl dev-libs/openssl:0 )"
+RDEPEND="${DEPEND}"
+PDEPEND="net-dialup/ppp-scripts"
+
+src_prepare() {
+ mv "${WORKDIR}/dhcp" "${S}/pppd/plugins" || die
+
+ use eap-tls || EPATCH_EXCLUDE+=" 8?_all_eaptls-*"
+ EPATCH_SUFFIX="patch" \
+ epatch "${WORKDIR}"/patch
+
+ if use atm ; then
+ einfo "Enabling PPPoATM support"
+ sed -i '/^#HAVE_LIBATM=yes/s:#::' \
+ pppd/plugins/pppoatm/Makefile.linux || die
+ fi
+
+ if ! use activefilter ; then
+ einfo "Disabling active filter"
+ sed -i '/^FILTER=y/s:^:#:' pppd/Makefile.linux || die
+ fi
+
+ if use pam ; then
+ einfo "Enabling PAM"
+ sed -i '/^#USE_PAM=y/s:^#::' pppd/Makefile.linux || die
+ fi
+
+ if use ipv6 ; then
+ einfo "Enabling IPv6"
+ sed -i '/#HAVE_INET6/s:#::' pppd/Makefile.linux || die
+ fi
+
+ einfo "Enabling CBCP"
+ sed -i '/^#CBCP=y/s:#::' pppd/Makefile.linux || die
+
+ if use dhcp ; then
+ einfo "Adding ppp-dhcp plugin files"
+ sed -i \
+ -e '/^SUBDIRS :=/s:$: dhcp:' \
+ pppd/plugins/Makefile.linux || die
+ fi
+
+ # Set correct libdir
+ sed -i -e "s:/lib/pppd:/$(get_libdir)/pppd:" \
+ pppd/{pathnames.h,pppd.8} || die
+
+ if use radius ; then
+ #set the right paths in radiusclient.conf
+ sed -i -e "s:/usr/local/etc:/etc:" \
+ -e "s:/usr/local/sbin:/usr/sbin:" \
+ pppd/plugins/radius/etc/radiusclient.conf || die
+ #set config dir to /etc/ppp/radius
+ sed -i -e "s:/etc/radiusclient:/etc/ppp/radius:g" \
+ pppd/plugins/radius/{*.8,*.c,*.h} \
+ pppd/plugins/radius/etc/* || die
+ else
+ einfo "Disabling radius"
+ sed -i -e '/+= radius/s:^:#:' pppd/plugins/Makefile.linux || die
+ fi
+
+ if use elibc_musl ; then
+ einfo "Conditionally patching for musl"
+ epatch "${FILESDIR}"/${P}-musl.patch
+
+ if use dhcp ; then
+ einfo "Conditionally patching dhcp support for musl"
+ epatch "${FILESDIR}"/${P}-dhcp-musl.patch
+ fi
+ fi
+}
+
+src_compile() {
+ tc-export AR CC
+ emake COPTS="${CFLAGS} -D_GNU_SOURCE"
+
+ # build pppgetpass
+ cd contrib/pppgetpass || die
+ if use gtk ; then
+ emake -f Makefile.linux
+ else
+ emake pppgetpass.vt
+ fi
+}
+
+src_install() {
+ local i
+ for i in chat pppd pppdump pppstats ; do
+ doman ${i}/${i}.8
+ dosbin ${i}/${i}
+ done
+ fperms u+s-w /usr/sbin/pppd
+
+ # Install pppd header files
+ emake -C pppd INSTROOT="${D}" install-devel
+
+ dosbin pppd/plugins/rp-pppoe/pppoe-discovery
+
+ dodir /etc/ppp/peers
+ insinto /etc/ppp
+ insopts -m0600
+ newins etc.ppp/pap-secrets pap-secrets.example
+ newins etc.ppp/chap-secrets chap-secrets.example
+
+ insopts -m0644
+ doins etc.ppp/options
+
+ pamd_mimic_system ppp auth account session
+
+ local PLUGINS_DIR="/usr/$(get_libdir)/pppd/${PV}"
+ # closing " for syntax coloring
+ insinto "${PLUGINS_DIR}"
+ insopts -m0755
+ doins pppd/plugins/minconn.so
+ doins pppd/plugins/passprompt.so
+ doins pppd/plugins/passwordfd.so
+ doins pppd/plugins/winbind.so
+ doins pppd/plugins/rp-pppoe/rp-pppoe.so
+ doins pppd/plugins/pppol2tp/openl2tp.so
+ doins pppd/plugins/pppol2tp/pppol2tp.so
+ if use atm ; then
+ doins pppd/plugins/pppoatm/pppoatm.so
+ fi
+ if use dhcp ; then
+ doins pppd/plugins/dhcp/dhcpc.so
+ fi
+ if use radius ; then
+ doins pppd/plugins/radius/rad{ius,attr,realms}.so
+
+ #Copy radiusclient configuration files (#92878)
+ insinto /etc/ppp/radius
+ insopts -m0644
+ doins pppd/plugins/radius/etc/{dictionary*,issue,port-id-map,radiusclient.conf,realms,servers}
+
+ doman pppd/plugins/radius/pppd-rad{ius,attr}.8
+ fi
+
+ insinto /etc/modprobe.d
+ insopts -m0644
+ newins "${FILESDIR}/modules.ppp" ppp.conf
+
+ dodoc PLUGINS README* SETUP Changes-2.3 FAQ
+ dodoc "${FILESDIR}/README.mpls"
+
+ dosbin scripts/p{on,off,log}
+ doman scripts/pon.1
+
+ # Adding misc. specialized scripts to doc dir
+ insinto /usr/share/doc/${PF}/scripts/chatchat
+ doins scripts/chatchat/*
+ insinto /usr/share/doc/${PF}/scripts
+ doins scripts/*
+
+ if use gtk ; then
+ dosbin contrib/pppgetpass/{pppgetpass.vt,pppgetpass.gtk}
+ newsbin contrib/pppgetpass/pppgetpass.sh pppgetpass
+ else
+ newsbin contrib/pppgetpass/pppgetpass.vt pppgetpass
+ fi
+ doman contrib/pppgetpass/pppgetpass.8
+}
+
+pkg_postinst() {
+ if linux-info_get_any_version && linux_config_src_exists ; then
+ echo
+ ewarn "If the following test report contains a missing kernel configuration option that you need,"
+ ewarn "you should reconfigure and rebuild your kernel before running pppd."
+ CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY"
+ local ERROR_PPP="CONFIG_PPP:\t missing PPP support (REQUIRED)"
+ local ERROR_PPP_ASYNC="CONFIG_PPP_ASYNC:\t missing asynchronous serial line discipline (optional, but highly recommended)"
+ local WARNING_PPP_SYNC_TTY="CONFIG_PPP_SYNC_TTY:\t missing synchronous serial line discipline (optional; used by 'sync' pppd option)"
+ if use activefilter ; then
+ CONFIG_CHECK="${CONFIG_CHECK} ~PPP_FILTER"
+ local ERROR_PPP_FILTER="CONFIG_PPP_FILTER:\t missing PPP filtering support (REQUIRED)"
+ fi
+ CONFIG_CHECK="${CONFIG_CHECK} ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE"
+ local ERROR_PPP_DEFLATE="CONFIG_PPP_DEFLATE:\t missing Deflate compression (optional, but highly recommended)"
+ local ERROR_PPP_BSDCOMP="CONFIG_PPP_BSDCOMP:\t missing BSD-Compress compression (optional, but highly recommended)"
+ local WARNING_PPP_MPPE="CONFIG_PPP_MPPE:\t missing MPPE encryption (optional, mostly used by PPTP links)"
+ CONFIG_CHECK="${CONFIG_CHECK} ~PPPOE ~PACKET"
+ local WARNING_PPPOE="CONFIG_PPPOE:\t missing PPPoE support (optional, needed by rp-pppoe plugin)"
+ local WARNING_PACKET="CONFIG_PACKET:\t missing AF_PACKET support (optional, used by rp-pppoe and dhcpc plugins)"
+ if use atm ; then
+ CONFIG_CHECK="${CONFIG_CHECK} ~PPPOATM"
+ local WARNING_PPPOATM="CONFIG_PPPOATM:\t missing PPPoA support (optional, needed by pppoatm plugin)"
+ fi
+ check_extra_config
+ fi
+
+ # create *-secrets files if not exists
+ [ -f "${ROOT}/etc/ppp/pap-secrets" ] || \
+ cp -pP "${ROOT}/etc/ppp/pap-secrets.example" "${ROOT}/etc/ppp/pap-secrets"
+ [ -f "${ROOT}/etc/ppp/chap-secrets" ] || \
+ cp -pP "${ROOT}/etc/ppp/chap-secrets.example" "${ROOT}/etc/ppp/chap-secrets"
+
+ # lib name has changed
+ sed -i -e "s:^pppoe.so:rp-pppoe.so:" "${ROOT}/etc/ppp/options" || die
+
+ echo
+ elog "Pon, poff and plog scripts have been supplied for experienced users."
+ elog "Users needing particular scripts (ssh,rsh,etc.) should check out the"
+ elog "/usr/share/doc/${PF}/scripts directory."
+}
diff --git a/net-firewall/iptables/Manifest b/net-firewall/iptables/Manifest
new file mode 100644
index 00000000..90d0bb2b
--- /dev/null
+++ b/net-firewall/iptables/Manifest
@@ -0,0 +1,16 @@
+AUX ip6tables-1.4.13.confd 690 SHA256 2938fe4206514d9868047bd8f888a699fa2097ca69edab176453436d4259abaa SHA512 8de9a5de4061bef217fbc07577688a8110f1116af7f3b936dfd18100a6a7a47ec6e70c456b24cf3432fb4f2034b741a487fe6af8d9740f174d51c6eb16945c6e WHIRLPOOL f2f4903812b5b97d5bdf9cb28f0bcb6f8c866f197b46a9128530721a8d9db1cdcedffe2512c9235391a67f494c2daf1266d7bc8a6185949756437221c3861a10
+AUX iptables-1.4.13-r1.init 2891 SHA256 13047698e03079b754957e1e548ce7505dfb2c73c9a31f87e061140603ab0e44 SHA512 c35d4fc3d08e6fe3c567a5fe4b8dc0679c87c01c5d90e9a08b68039e4e846043a1f1ae47bc37bc718af761b9287394e8edfa3681d5ae23d666fc9de60a8c8302 WHIRLPOOL 7007ab6e5524b7d1e6e3c17ed0a7c40c6e7034510ecad2e442a2863a819a72f5f1cda58c5b6ad331b36c6c5c40980f344364593246d46cf95c1527a24115b829
+AUX iptables-1.4.13.confd 687 SHA256 7e2341211ca14997b7a8a1f930f94db855291af597c568f680f80031c20d45b6 SHA512 bd67d53e997ea65755148ba071fe6e3856d6e604b9167c666900721bc3dc24f63d395bc33a1a34ae50f95e72760da630db1a8d35afc81ec5973e60ba5343dc70 WHIRLPOOL 111b809b3122b04cce8ac0e551cfcdec7fde1ad563e1001bbbb3dbb4cae0ddf13851ece1024e13fb26aab2fe306dfc4fd9e59ab5a10127b301bc7a65ec20486b
+AUX iptables-1.4.20-musl.patch 9543 SHA256 b245f263a7cd3807389fada98e1ff12c3b9b0359e77c5660841dbd6c6bc4c3cd SHA512 84c7401d89ef048f6221c55dfee0d6971938d4575c8ddd00e5fd03ed39cc277f7d5074b3b20313535389f321a2ef8cdfa12313a5481f8c49a89a4ca26deaf54a WHIRLPOOL 2b95fc4ede005f819676d3d3abe96f6f23881657b5da36d8cc73fb09cbdc93de8e77da8dc17c7669ddb0e0d86b4e3c0e036d9e8a8a65235b50b3cd1b2266c977
+AUX iptables-1.4.21-musl.patch 3947 SHA256 1d5fbdcb4752c480a4198a0188b067352fdd6b99a221de18ab8a106a5b115ee0 SHA512 6fc3c0c29da8f767892b1022e659f341c2ff97bc83a70b4b19fffe3b7385cd4879fe53e9630a6ec9f9449f3b5b20d34a060c4af0c5f186829069da0d075c9dfe WHIRLPOOL f6fe339c790fdfd5de544cc0791b775df2a2c486b7c4b2092ee2cd400874ddb53677abcd5c74022c2dc7079e919890e7da6d481a240b5396bd38162681ce7f54
+AUX systemd/ip6tables-restore.service 395 SHA256 679ba8327bf037e991ff07d8cf910009c67026b0faf8112d75c945b64f4b64de SHA512 e41f7bc55b2b58452b993ccb42014b5bc2701aeeef46eee845a2b016b334299ff4e6d11ba22f3aaff47195f1049dc7fd4be41a7055911420230107b1ee4c6ba3 WHIRLPOOL 232d90f8591358fe853c8c4b569b2825ba02ced59d390232a7f7fb535e3bfbbcb70972938506cbead5e6b57845310f5a91c1fd225898f185cffb96ba7d4d97f3
+AUX systemd/ip6tables-store.service 243 SHA256 ce93fc2ba81f7693877479ddc75cdec94627c302a140bd27ff30656fad78e72b SHA512 7cee224f91d4c8348606ba176d0d689749a59229958cfdf4e75451d77271363e7cff71dbb7e30dbc4a5a837363a72d70d6960d2dfb218f3ad16456ae109cba10 WHIRLPOOL d84687a142843fa9cd930171e817652afb22b950214349ca156ba6da174312989973d17fed04cd129c18d4d6fbd5ad3124b9afa0d105d128333248c90fdb4ca6
+AUX systemd/ip6tables.service 133 SHA256 1b8d342ffdf471ef25e365dacf106e1899b438dad4bf9154cfad2d5217c3a019 SHA512 f871e694a8c666a59840c4c7ae1f355dc47f481501b3472601b65460c1d6e163a7e33f7a6c42a84ac33131ddb96170b316e83507a43f1ede54d61446f81950dc WHIRLPOOL 24140e7398cfa494210b8d3b773bdca5ee1abbbdb29c2921e84ff025848e26844b5c20fadefa9b961ce14564ce8daa9b8e9f197b7d7ec70c26bb6609b74b10d0
+AUX systemd/iptables-restore.service 391 SHA256 ace3b2085700bde96f0597e8c6f3b8524c28d4f9b6c924deb09b164a5b8e979c SHA512 222a088d487f8e5c199aec4a3619f8c8ee620ffca13c35fd3da8daf926db25fa5203226a6f4a2c426622d935ffd57c02ad4ff5edbca922f8168e29fc3e52c516 WHIRLPOOL 507cfef3650fcce3a17d56edfb39110d08397bbd96c88cb21c2cdb74c69b920142f0f68f71312ae7a6013057e0ab500546a0075806dd424fc85b9aebdb76b5f4
+AUX systemd/iptables-store.service 240 SHA256 14965fd0f3cd4285e77ea1e3d9975a818b0d64fb0026b925d8434896b2cbf839 SHA512 a720e92b5571a2c3427101105e95e555f3b72541a53c5daa43e361c99ca28830e9e8dd27dbd7cfed40fbbe289ed180f9be7e0f3b6b0cd19bba022a531815fd5e WHIRLPOOL e3a5b77b2c19ad8445a21cc9c8680c2d632d968483357221fac1c309275bd17aa25c05cf23188d5ae644d5b1266c64b3dd5fe8fbdec9f2a439a212c3d1c767db
+AUX systemd/iptables.service 130 SHA256 c404c54c98521817aca75b96774a24684e0c7ed2fc8de2ced78f4ae4d8a6b99d SHA512 87114ccc7eb079d1ed43d77be35cf4c91702ca960883a4bbca5dfcf74aa6f086e44f4a4251441ac3a277c93eb10e7482157caf2d62bbf2a7f5327947ede25bef WHIRLPOOL 844296866dfe2fe6b1207c99d2f938f4c87a37592e95576f9504fe056fe82fc29878b9aa1a204fa31d6711fbe7ba5cd48f7a639e4839bbe366e6220246a0d3c3
+DIST iptables-1.4.20.tar.bz2 546864 SHA256 109b8c7ca90b4536bc5de869ae705f6d5efcc0c08ef3003755aad3ed6d2d49ad SHA512 6c8e1d89db66c0cfd76afd7fa7de8a7d451337f6f15f01d811585714f6d488275621ca9a1f4967a2ae99e90f3890cf0e3c7f7a9a3a98fda902b0a56717d7ffe0 WHIRLPOOL 8146d632ec00c663988d4e82e3adfa8b9fa2df269df2e6cc359dae65727e59f4ef614540eb4f970d020eac558d7423731a88246f9df1265718346ca62e59a8e7
+DIST iptables-1.4.21.tar.bz2 547439 SHA256 52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0 SHA512 dd4baccdb080284d8620e6ed59beafc2677813f3e099051764b07f8e394f6d94ca11861b181f3cce7c55c66de64c1e2add13dc1a0b64e24050cd9fb7aea0689b WHIRLPOOL 475541d1b2b7fe4ee8fa3b537274ef082aab8bfd262201ee14cd53577dfac6f591445cc6d64ed93b226a4b71d54ae1b9ab4cbb378b5440861a585f770f0db200
+EBUILD iptables-1.4.20-r99.ebuild 2351 SHA256 cc58a460821612291fc4040a71d1c6c69b36e315a6c7fa42447009a1c440f208 SHA512 9839e8fd6c7d29ff014dc9f71fb8f85d4c2378384bb9ebb1283dfd03c593bdc968262f7f5f389649407a3596dd7c699c5d0f226a5df84acd81bca85f28dd5f5d WHIRLPOOL 94d8c4a2d94ad72fbb1cbd822494526ae5c5520e6e2fa9500c04d116523ebc22b66c60a24ec18d9ccf138c833fd4eb3ef64a359ba3de074126b6d786a4293dae
+EBUILD iptables-1.4.21-r99.ebuild 2428 SHA256 106e7046e9977b4c69be158b04bb541ec4514b063b80308f860094b920eca726 SHA512 8c45d4c8d0c3ed6d813ba20d41a5a672f5b318b124015d30b5af0035587e96ccd9d62cfc680a097928df965653b1b6b620515153335109d936e0bca70a0a5646 WHIRLPOOL 3dfd8107fa7bb492e224e2966c40928d59ee728f7db5e663ba8fcae4e2f98e38a3f10c5c0582416d235f788b7d3108824fb10be0847b96960e7375d4b024cc17
+MISC metadata.xml 1069 SHA256 91c6679d742c254b368f9a18cb42a3d29f90a9b691dda61967152b629e2abaa2 SHA512 395b2b3b812cc99d31ea812ad2e42fe52e9fc3e5fcd17db18b95b1dba09495bb5124760308ba46a463b47cb089d587819600d5883a313314a865628fa00f6907 WHIRLPOOL 6e1e2717c19802d94f155c6841a0b7cef10ad38cd338e3e5ba8eab671b433c547fbe816a234f8e02ad1a0bfd6f69695ff643f3ca62a99a6d51be8108eb79e9ce
diff --git a/net-firewall/iptables/files/ip6tables-1.4.13.confd b/net-firewall/iptables/files/ip6tables-1.4.13.confd
new file mode 100644
index 00000000..3bb36989
--- /dev/null
+++ b/net-firewall/iptables/files/ip6tables-1.4.13.confd
@@ -0,0 +1,19 @@
+# /etc/conf.d/ip6tables
+
+# Location in which iptables initscript will save set rules on
+# service shutdown
+IP6TABLES_SAVE="/var/lib/ip6tables/rules-save"
+
+# Options to pass to iptables-save and iptables-restore
+SAVE_RESTORE_OPTIONS="-c"
+
+# Save state on stopping iptables
+SAVE_ON_STOP="yes"
+
+# If you need to log iptables messages as soon as iptables starts,
+# AND your logger does NOT depend on the network, then you may wish
+# to uncomment the next line.
+# If your logger depends on the network, and you uncomment this line
+# you will create an unresolvable circular dependency during startup.
+# After commenting or uncommenting this line, you must run 'rc-update -u'.
+#rc_use="logger"
diff --git a/net-firewall/iptables/files/iptables-1.4.13-r1.init b/net-firewall/iptables/files/iptables-1.4.13-r1.init
new file mode 100644
index 00000000..a63d0768
--- /dev/null
+++ b/net-firewall/iptables/files/iptables-1.4.13-r1.init
@@ -0,0 +1,130 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/iptables/files/iptables-1.4.13-r1.init,v 1.3 2013/04/27 17:29:09 vapier Exp $
+
+extra_commands="check save panic"
+extra_started_commands="reload"
+
+iptables_name=${SVCNAME}
+case ${iptables_name} in
+iptables|ip6tables) ;;
+*) iptables_name="iptables" ;;
+esac
+
+iptables_bin="/sbin/${iptables_name}"
+case ${iptables_name} in
+ iptables) iptables_proc="/proc/net/ip_tables_names"
+ iptables_save=${IPTABLES_SAVE};;
+ ip6tables) iptables_proc="/proc/net/ip6_tables_names"
+ iptables_save=${IP6TABLES_SAVE};;
+esac
+
+depend() {
+ need localmount #434774
+ before net
+}
+
+set_table_policy() {
+ local chains table=$1 policy=$2
+ case ${table} in
+ nat) chains="PREROUTING POSTROUTING OUTPUT";;
+ mangle) chains="PREROUTING INPUT FORWARD OUTPUT POSTROUTING";;
+ filter) chains="INPUT FORWARD OUTPUT";;
+ *) chains="";;
+ esac
+ local chain
+ for chain in ${chains} ; do
+ ${iptables_bin} -t ${table} -P ${chain} ${policy}
+ done
+}
+
+checkkernel() {
+ if [ ! -e ${iptables_proc} ] ; then
+ eerror "Your kernel lacks ${iptables_name} support, please load"
+ eerror "appropriate modules and try again."
+ return 1
+ fi
+ return 0
+}
+checkconfig() {
+ if [ ! -f ${iptables_save} ] ; then
+ eerror "Not starting ${iptables_name}. First create some rules then run:"
+ eerror "/etc/init.d/${iptables_name} save"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Loading ${iptables_name} state and starting firewall"
+ ${iptables_bin}-restore ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
+ eend $?
+}
+
+stop() {
+ if [ "${SAVE_ON_STOP}" = "yes" ] ; then
+ save || return 1
+ fi
+ checkkernel || return 1
+ ebegin "Stopping firewall"
+ local a
+ for a in $(cat ${iptables_proc}) ; do
+ set_table_policy $a ACCEPT
+
+ ${iptables_bin} -F -t $a
+ ${iptables_bin} -X -t $a
+ done
+ eend $?
+}
+
+reload() {
+ checkkernel || return 1
+ checkrules || return 1
+ ebegin "Flushing firewall"
+ local a
+ for a in $(cat ${iptables_proc}) ; do
+ ${iptables_bin} -F -t $a
+ ${iptables_bin} -X -t $a
+ done
+ eend $?
+
+ start
+}
+
+checkrules() {
+ ebegin "Checking rules"
+ ${iptables_bin}-restore --test ${SAVE_RESTORE_OPTIONS} < "${iptables_save}"
+ eend $?
+}
+
+check() {
+ # Short name for users of init.d script.
+ checkrules
+}
+
+save() {
+ ebegin "Saving ${iptables_name} state"
+ checkpath -q -d "$(dirname "${iptables_save}")"
+ checkpath -q -m 0600 -f "${iptables_save}"
+ ${iptables_bin}-save ${SAVE_RESTORE_OPTIONS} > "${iptables_save}"
+ eend $?
+}
+
+panic() {
+ checkkernel || return 1
+ if service_started ${iptables_name}; then
+ rc-service ${iptables_name} stop
+ fi
+
+ local a
+ ebegin "Dropping all packets"
+ for a in $(cat ${iptables_proc}) ; do
+ ${iptables_bin} -F -t $a
+ ${iptables_bin} -X -t $a
+
+ set_table_policy $a DROP
+ done
+ eend $?
+}
diff --git a/net-firewall/iptables/files/iptables-1.4.13.confd b/net-firewall/iptables/files/iptables-1.4.13.confd
new file mode 100644
index 00000000..7225374c
--- /dev/null
+++ b/net-firewall/iptables/files/iptables-1.4.13.confd
@@ -0,0 +1,19 @@
+# /etc/conf.d/iptables
+
+# Location in which iptables initscript will save set rules on
+# service shutdown
+IPTABLES_SAVE="/var/lib/iptables/rules-save"
+
+# Options to pass to iptables-save and iptables-restore
+SAVE_RESTORE_OPTIONS="-c"
+
+# Save state on stopping iptables
+SAVE_ON_STOP="yes"
+
+# If you need to log iptables messages as soon as iptables starts,
+# AND your logger does NOT depend on the network, then you may wish
+# to uncomment the next line.
+# If your logger depends on the network, and you uncomment this line
+# you will create an unresolvable circular dependency during startup.
+# After commenting or uncommenting this line, you must run 'rc-update -u'.
+#rc_use="logger"
diff --git a/net-firewall/iptables/files/iptables-1.4.20-musl.patch b/net-firewall/iptables/files/iptables-1.4.20-musl.patch
new file mode 100644
index 00000000..cd5b1a72
--- /dev/null
+++ b/net-firewall/iptables/files/iptables-1.4.20-musl.patch
@@ -0,0 +1,304 @@
+diff -ur a/iptables-1.4.20/extensions/libxt_conntrack.c b/iptables-1.4.20/extensions/libxt_conntrack.c
+--- a/iptables-1.4.20/extensions/libxt_conntrack.c
++++ b/iptables-1.4.20/extensions/libxt_conntrack.c
+@@ -786,7 +786,7 @@
+
+ static void
+ conntrack_dump_ports(const char *prefix, const char *opt,
+- u_int16_t port_low, u_int16_t port_high)
++ uint16_t port_low, uint16_t port_high)
+ {
+ if (port_high == 0 || port_low == port_high)
+ printf(" %s%s %u", prefix, opt, port_low);
+diff -ur a/iptables-1.4.20/include/libipq/libipq.h b/iptables-1.4.20/include/libipq/libipq.h
+--- a/iptables-1.4.20/include/libipq/libipq.h
++++ b/iptables-1.4.20/include/libipq/libipq.h
+@@ -48,19 +48,19 @@
+ struct ipq_handle
+ {
+ int fd;
+- u_int8_t blocking;
++ uint8_t blocking;
+ struct sockaddr_nl local;
+ struct sockaddr_nl peer;
+ };
+
+-struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol);
++struct ipq_handle *ipq_create_handle(uint32_t flags, uint32_t protocol);
+
+ int ipq_destroy_handle(struct ipq_handle *h);
+
+ ssize_t ipq_read(const struct ipq_handle *h,
+ unsigned char *buf, size_t len, int timeout);
+
+-int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t len);
++int ipq_set_mode(const struct ipq_handle *h, uint8_t mode, size_t len);
+
+ ipq_packet_msg_t *ipq_get_packet(const unsigned char *buf);
+
+diff -ur a/iptables-1.4.20/include/libiptc/ipt_kernel_headers.h b/iptables-1.4.20/include/libiptc/ipt_kernel_headers.h
+--- a/iptables-1.4.20/include/libiptc/ipt_kernel_headers.h
++++ b/iptables-1.4.20/include/libiptc/ipt_kernel_headers.h
+@@ -15,13 +15,12 @@
+ #include <sys/types.h>
+ #else /* libc5 */
+ #include <sys/socket.h>
+-#include <linux/ip.h>
+-#include <linux/in.h>
+-#include <linux/if.h>
++#include <netinet/ip.h>
++#include <netinet/in.h>
++#include <net/if.h>
+ #include <linux/icmp.h>
+ #include <linux/tcp.h>
+ #include <linux/udp.h>
+ #include <linux/types.h>
+-#include <linux/in6.h>
+ #endif
+ #endif
+diff -ur a/iptables-1.4.20/include/libiptc/libxtc.h b/iptables-1.4.20/include/libiptc/libxtc.h
+--- a/iptables-1.4.20/include/libiptc/libxtc.h
++++ b/iptables-1.4.20/include/libiptc/libxtc.h
+@@ -10,7 +10,7 @@
+ #endif
+
+ #ifndef XT_MIN_ALIGN
+-/* xt_entry has pointers and u_int64_t's in it, so if you align to
++/* xt_entry has pointers and uint64_t's in it, so if you align to
+ it, you'll also align to any crazy matches and targets someone
+ might write */
+ #define XT_MIN_ALIGN (__alignof__(struct xt_entry))
+diff -ur a/iptables-1.4.20/include/libipulog/libipulog.h b/iptables-1.4.20/include/libipulog/libipulog.h
+--- a/iptables-1.4.20/include/libipulog/libipulog.h 2013-08-06 15:48:43.000000000 +0000
++++ b/iptables-1.4.20/include/libipulog/libipulog.h 2014-02-09 09:32:45.058650377 +0000
+@@ -21,9 +21,9 @@
+
+ struct ipulog_handle;
+
+-u_int32_t ipulog_group2gmask(u_int32_t group);
++uint32_t ipulog_group2gmask(uint32_t group);
+
+-struct ipulog_handle *ipulog_create_handle(u_int32_t gmask);
++struct ipulog_handle *ipulog_create_handle(uint32_t gmask);
+
+ void ipulog_destroy_handle(struct ipulog_handle *h);
+
+diff -ur a/iptables-1.4.20/include/linux/netfilter_ipv4/ip_tables.h b/iptables-1.4.20/include/linux/netfilter_ipv4/ip_tables.h
+--- a/iptables-1.4.20/include/linux/netfilter_ipv4/ip_tables.h
++++ b/iptables-1.4.20/include/linux/netfilter_ipv4/ip_tables.h
+@@ -15,6 +15,7 @@
+ #ifndef _IPTABLES_H
+ #define _IPTABLES_H
+
++#include <stdint.h>
+ #include <linux/types.h>
+
+ #include <linux/netfilter_ipv4.h>
+@@ -73,12 +74,12 @@
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ /* Protocol, 0 = ANY */
+- u_int16_t proto;
++ uint16_t proto;
+
+ /* Flags word */
+- u_int8_t flags;
++ uint8_t flags;
+ /* Inverse flags */
+- u_int8_t invflags;
++ uint8_t invflags;
+ };
+
+ /* Values for "flag" field in struct ipt_ip (general ip structure). */
+@@ -106,9 +107,9 @@
+ unsigned int nfcache;
+
+ /* Size of ipt_entry + matches */
+- u_int16_t target_offset;
++ uint16_t target_offset;
+ /* Size of ipt_entry + matches + target */
+- u_int16_t next_offset;
++ uint16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+@@ -125,7 +126,7 @@
+ * Unlike BSD Linux inherits IP options so you don't have to use a raw
+ * socket for this. Instead we check rights in the calls.
+ *
+- * ATTENTION: check linux/in.h before adding new number here.
++ * ATTENTION: check netinet/in.h before adding new number here.
+ */
+ #define IPT_BASE_CTL 64
+
+@@ -141,9 +142,9 @@
+
+ /* ICMP matching stuff */
+ struct ipt_icmp {
+- u_int8_t type; /* type to match */
+- u_int8_t code[2]; /* range of code */
+- u_int8_t invflags; /* Inverse flags */
++ uint8_t type; /* type to match */
++ uint8_t code[2]; /* range of code */
++ uint8_t invflags; /* Inverse flags */
+ };
+
+ /* Values for "inv" field for struct ipt_icmp. */
+diff -ur a/iptables-1.4.20/include/linux/netfilter_ipv6/ip6_tables.h b/iptables-1.4.20/include/linux/netfilter_ipv6/ip6_tables.h
+--- a/iptables-1.4.20/include/linux/netfilter_ipv6/ip6_tables.h
++++ b/iptables-1.4.20/include/linux/netfilter_ipv6/ip6_tables.h
+@@ -73,14 +73,14 @@
+ * MH do not match any packets.
+ * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
+ */
+- u_int16_t proto;
++ uint16_t proto;
+ /* TOS to match iff flags & IP6T_F_TOS */
+- u_int8_t tos;
++ uint8_t tos;
+
+ /* Flags word */
+- u_int8_t flags;
++ uint8_t flags;
+ /* Inverse flags */
+- u_int8_t invflags;
++ uint8_t invflags;
+ };
+
+ /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
+@@ -110,9 +110,9 @@
+ unsigned int nfcache;
+
+ /* Size of ipt_entry + matches */
+- u_int16_t target_offset;
++ uint16_t target_offset;
+ /* Size of ipt_entry + matches + target */
+- u_int16_t next_offset;
++ uint16_t next_offset;
+
+ /* Back pointer */
+ unsigned int comefrom;
+@@ -162,7 +162,6 @@
+ * Unlike BSD Linux inherits IP options so you don't have to use
+ * a raw socket for this. Instead we check rights in the calls.
+ *
+- * ATTENTION: check linux/in6.h before adding new number here.
+ */
+ #define IP6T_BASE_CTL 64
+
+@@ -178,9 +177,9 @@
+
+ /* ICMP matching stuff */
+ struct ip6t_icmp {
+- u_int8_t type; /* type to match */
+- u_int8_t code[2]; /* range of code */
+- u_int8_t invflags; /* Inverse flags */
++ uint8_t type; /* type to match */
++ uint8_t code[2]; /* range of code */
++ uint8_t invflags; /* Inverse flags */
+ };
+
+ /* Values for "inv" field for struct ipt_icmp. */
+diff -ur a/iptables-1.4.20/include/linux/netfilter_ipv6/ip6t_rt.h b/iptables-1.4.20/include/linux/netfilter_ipv6/ip6t_rt.h
+--- a/iptables-1.4.20/include/linux/netfilter_ipv6/ip6t_rt.h
++++ b/iptables-1.4.20/include/linux/netfilter_ipv6/ip6t_rt.h
+@@ -2,7 +2,6 @@
+ #define _IP6T_RT_H
+
+ #include <linux/types.h>
+-/*#include <linux/in6.h>*/
+
+ #define IP6T_RT_HOPS 16
+
+diff -ur a/iptables-1.4.20/include/xtables.h b/iptables-1.4.20/include/xtables.h
+--- a/iptables-1.4.20/include/xtables.h
++++ b/iptables-1.4.20/include/xtables.h
+@@ -220,12 +220,12 @@
+ const char *real_name;
+
+ /* Revision of match (0 by default). */
+- u_int8_t revision;
++ uint8_t revision;
+
+ /* Extension flags */
+- u_int8_t ext_flags;
++ uint8_t ext_flags;
+
+- u_int16_t family;
++ uint16_t family;
+
+ /* Size of match data. */
+ size_t size;
+@@ -297,12 +297,12 @@
+ const char *real_name;
+
+ /* Revision of target (0 by default). */
+- u_int8_t revision;
++ uint8_t revision;
+
+ /* Extension flags */
+- u_int8_t ext_flags;
++ uint8_t ext_flags;
+
+- u_int16_t family;
++ uint16_t family;
+
+
+ /* Size of target data. */
+@@ -373,7 +373,7 @@
+ */
+ struct xtables_pprot {
+ const char *name;
+- u_int8_t num;
++ uint8_t num;
+ };
+
+ enum xtables_tryload {
+@@ -446,12 +446,12 @@
+ extern bool xtables_strtoui(const char *, char **, unsigned int *,
+ unsigned int, unsigned int);
+ extern int xtables_service_to_port(const char *name, const char *proto);
+-extern u_int16_t xtables_parse_port(const char *port, const char *proto);
++extern uint16_t xtables_parse_port(const char *port, const char *proto);
+ extern void
+ xtables_parse_interface(const char *arg, char *vianame, unsigned char *mask);
+
+ /* this is a special 64bit data type that is 8-byte aligned */
+-#define aligned_u64 u_int64_t __attribute__((aligned(8)))
++#define aligned_u64 uint64_t __attribute__((aligned(8)))
+
+ extern struct xtables_globals *xt_params;
+ #define xtables_error (xt_params->exit_err)
+@@ -514,7 +514,7 @@
+ #endif
+
+ extern const struct xtables_pprot xtables_chain_protos[];
+-extern u_int16_t xtables_parse_protocol(const char *s);
++extern uint16_t xtables_parse_protocol(const char *s);
+
+ /* kernel revision handling */
+ extern int kernel_version;
+diff -ur a/iptables-1.4.20/libipq/ipq_create_handle.3 b/iptables-1.4.20/libipq/ipq_create_handle.3
+--- a/iptables-1.4.20/libipq/ipq_create_handle.3
++++ b/iptables-1.4.20/libipq/ipq_create_handle.3
+@@ -24,7 +24,7 @@
+ .br
+ .B #include <libipq.h>
+ .sp
+-.BI "struct ipq_handle *ipq_create_handle(u_int32_t " flags ", u_int32_t " protocol ");"
++.BI "struct ipq_handle *ipq_create_handle(uint32_t " flags ", uint32_t " protocol ");"
+ .br
+ .BI "int ipq_destroy_handle(struct ipq_handle *" h );
+ .SH DESCRIPTION
+diff -ur a/iptables-1.4.20/libipq/ipq_set_mode.3 b/iptables-1.4.20/libipq/ipq_set_mode.3
+--- a/iptables-1.4.20/libipq/ipq_set_mode.3
++++ b/iptables-1.4.20/libipq/ipq_set_mode.3
+@@ -24,7 +24,7 @@
+ .br
+ .B #include <libipq.h>
+ .sp
+-.BI "int ipq_set_mode(const struct ipq_handle *" h ", u_int8_t " mode ", size_t " range );
++.BI "int ipq_set_mode(const struct ipq_handle *" h ", uint8_t " mode ", size_t " range );
+ .SH DESCRIPTION
+ The
+ .B ipq_set_mode
diff --git a/net-firewall/iptables/files/iptables-1.4.21-musl.patch b/net-firewall/iptables/files/iptables-1.4.21-musl.patch
new file mode 100644
index 00000000..286ea875
--- /dev/null
+++ b/net-firewall/iptables/files/iptables-1.4.21-musl.patch
@@ -0,0 +1,136 @@
+diff -ru a/iptables-1.4.21/extensions/libip6t_ipv6header.c b/iptables-1.4.21/extensions/libip6t_ipv6header.c
+--- a/iptables-1.4.21/extensions/libip6t_ipv6header.c
++++ b/iptables-1.4.21/extensions/libip6t_ipv6header.c
+@@ -10,6 +10,9 @@
+ #include <netdb.h>
+ #include <xtables.h>
+ #include <linux/netfilter_ipv6/ip6t_ipv6header.h>
++#ifndef IPPROTO_HOPOPTS
++# define IPPROTO_HOPOPTS 0
++#endif
+
+ enum {
+ O_HEADER = 0,
+diff -ru a/iptables-1.4.21/extensions/libxt_TCPOPTSTRIP.c b/iptables-1.4.21/extensions/libxt_TCPOPTSTRIP.c
+--- a/iptables-1.4.21/extensions/libxt_TCPOPTSTRIP.c
++++ b/iptables-1.4.21/extensions/libxt_TCPOPTSTRIP.c
+@@ -12,6 +12,21 @@
+ #ifndef TCPOPT_MD5SIG
+ # define TCPOPT_MD5SIG 19
+ #endif
++#ifndef TCPOPT_MAXSEG
++# define TCPOPT_MAXSEG 2
++#endif
++#ifndef TCPOPT_WINDOW
++# define TCPOPT_WINDOW 3
++#endif
++#ifndef TCPOPT_SACK_PERMITTED
++# define TCPOPT_SACK_PERMITTED 4
++#endif
++#ifndef TCPOPT_SACK
++# define TCPOPT_SACK 5
++#endif
++#ifndef TCPOPT_TIMESTAMP
++# define TCPOPT_TIMESTAMP 8
++#endif
+
+ enum {
+ O_STRIP_OPTION = 0,
+diff -ru a/iptables-1.4.21/include/libiptc/ipt_kernel_headers.h b/iptables-1.4.21/include/libiptc/ipt_kernel_headers.h
+--- a/iptables-1.4.21/include/libiptc/ipt_kernel_headers.h
++++ b/iptables-1.4.21/include/libiptc/ipt_kernel_headers.h
+@@ -5,7 +5,6 @@
+
+ #include <limits.h>
+
+-#if defined(__GLIBC__) && __GLIBC__ == 2
+ #include <netinet/ip.h>
+ #include <netinet/in.h>
+ #include <netinet/ip_icmp.h>
+@@ -13,15 +12,4 @@
+ #include <netinet/udp.h>
+ #include <net/if.h>
+ #include <sys/types.h>
+-#else /* libc5 */
+-#include <sys/socket.h>
+-#include <linux/ip.h>
+-#include <linux/in.h>
+-#include <linux/if.h>
+-#include <linux/icmp.h>
+-#include <linux/tcp.h>
+-#include <linux/udp.h>
+-#include <linux/types.h>
+-#include <linux/in6.h>
+-#endif
+ #endif
+diff -ru a/iptables-1.4.21/include/linux/netfilter_ipv4/ip_tables.h b/iptables-1.4.21/include/linux/netfilter_ipv4/ip_tables.h
+--- a/iptables-1.4.21/include/linux/netfilter_ipv4/ip_tables.h
++++ b/iptables-1.4.21/include/linux/netfilter_ipv4/ip_tables.h
+@@ -16,6 +16,7 @@
+ #define _IPTABLES_H
+
+ #include <linux/types.h>
++#include <sys/types.h>
+
+ #include <linux/netfilter_ipv4.h>
+
+diff -ru a/iptables-1.4.21/iptables/ip6tables-restore.c b/iptables-1.4.21/iptables/ip6tables-restore.c
+--- a/iptables-1.4.21/iptables/ip6tables-restore.c
++++ b/iptables-1.4.21/iptables/ip6tables-restore.c
+@@ -9,7 +9,7 @@
+ */
+
+ #include <getopt.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <stdbool.h>
+ #include <string.h>
+ #include <stdio.h>
+diff -ru a/iptables-1.4.21/iptables/ip6tables-save.c b/iptables-1.4.21/iptables/ip6tables-save.c
+--- a/iptables-1.4.21/iptables/ip6tables-save.c
++++ b/iptables-1.4.21/iptables/ip6tables-save.c
+@@ -6,7 +6,7 @@
+ * This code is distributed under the terms of GNU GPL v2
+ */
+ #include <getopt.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+diff -ru a/iptables-1.4.21/iptables/iptables-restore.c b/iptables-1.4.21/iptables/iptables-restore.c
+--- a/iptables-1.4.21/iptables/iptables-restore.c
++++ b/iptables-1.4.21/iptables/iptables-restore.c
+@@ -6,7 +6,7 @@
+ */
+
+ #include <getopt.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <stdbool.h>
+ #include <string.h>
+ #include <stdio.h>
+diff -ru a/iptables-1.4.21/iptables/iptables-save.c b/iptables-1.4.21/iptables/iptables-save.c
+--- a/iptables-1.4.21/iptables/iptables-save.c
++++ b/iptables-1.4.21/iptables/iptables-save.c
+@@ -6,7 +6,7 @@
+ *
+ */
+ #include <getopt.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+diff -ru a/iptables-1.4.21/iptables/iptables-xml.c b/iptables-1.4.21/iptables/iptables-xml.c
+--- a/iptables-1.4.21/iptables/iptables-xml.c
++++ b/iptables-1.4.21/iptables/iptables-xml.c
+@@ -7,7 +7,7 @@
+ */
+
+ #include <getopt.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
diff --git a/net-firewall/iptables/files/systemd/ip6tables-restore.service b/net-firewall/iptables/files/systemd/ip6tables-restore.service
new file mode 100644
index 00000000..88415fa3
--- /dev/null
+++ b/net-firewall/iptables/files/systemd/ip6tables-restore.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Restore ip6tables firewall rules
+# if both are queued for some reason, don't store before restoring :)
+Before=ip6tables-store.service
+# sounds reasonable to have firewall up before any of the services go up
+Before=network.target
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=/sbin/ip6tables-restore /var/lib/ip6tables/rules-save
+
+[Install]
+WantedBy=basic.target
diff --git a/net-firewall/iptables/files/systemd/ip6tables-store.service b/net-firewall/iptables/files/systemd/ip6tables-store.service
new file mode 100644
index 00000000..99753783
--- /dev/null
+++ b/net-firewall/iptables/files/systemd/ip6tables-store.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Store ip6tables firewall rules
+Before=shutdown.target
+DefaultDependencies=No
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "/sbin/ip6tables-save --counters > /var/lib/ip6tables/rules-save"
+
+[Install]
+WantedBy=shutdown.target
diff --git a/net-firewall/iptables/files/systemd/ip6tables.service b/net-firewall/iptables/files/systemd/ip6tables.service
new file mode 100644
index 00000000..0a6d7fa1
--- /dev/null
+++ b/net-firewall/iptables/files/systemd/ip6tables.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Store and restore ip6tables firewall rules
+
+[Install]
+Also=ip6tables-store.service
+Also=ip6tables-restore.service
diff --git a/net-firewall/iptables/files/systemd/iptables-restore.service b/net-firewall/iptables/files/systemd/iptables-restore.service
new file mode 100644
index 00000000..9d568d78
--- /dev/null
+++ b/net-firewall/iptables/files/systemd/iptables-restore.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Restore iptables firewall rules
+# if both are queued for some reason, don't store before restoring :)
+Before=iptables-store.service
+# sounds reasonable to have firewall up before any of the services go up
+Before=network.target
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=/sbin/iptables-restore /var/lib/iptables/rules-save
+
+[Install]
+WantedBy=basic.target
diff --git a/net-firewall/iptables/files/systemd/iptables-store.service b/net-firewall/iptables/files/systemd/iptables-store.service
new file mode 100644
index 00000000..aa16e75e
--- /dev/null
+++ b/net-firewall/iptables/files/systemd/iptables-store.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Store iptables firewall rules
+Before=shutdown.target
+DefaultDependencies=No
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "/sbin/iptables-save --counters > /var/lib/iptables/rules-save"
+
+[Install]
+WantedBy=shutdown.target
diff --git a/net-firewall/iptables/files/systemd/iptables.service b/net-firewall/iptables/files/systemd/iptables.service
new file mode 100644
index 00000000..3643a3e3
--- /dev/null
+++ b/net-firewall/iptables/files/systemd/iptables.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=Store and restore iptables firewall rules
+
+[Install]
+Also=iptables-store.service
+Also=iptables-restore.service
diff --git a/net-firewall/iptables/iptables-1.4.20-r99.ebuild b/net-firewall/iptables/iptables-1.4.20-r99.ebuild
new file mode 100644
index 00000000..287dec6c
--- /dev/null
+++ b/net-firewall/iptables/iptables-1.4.20-r99.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/iptables/iptables-1.4.20.ebuild,v 1.12 2014/01/18 19:48:53 ago Exp $
+
+EAPI="4"
+
+# Force users doing their own patches to install their own tools
+AUTOTOOLS_AUTO_DEPEND=no
+
+inherit eutils multilib toolchain-funcs autotools
+
+DESCRIPTION="Linux kernel (2.4+) firewall, NAT and packet mangling tools"
+HOMEPAGE="http://www.netfilter.org/projects/iptables/"
+SRC_URI="http://www.netfilter.org/projects/iptables/files/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ipv6 netlink static-libs"
+
+RDEPEND="
+ netlink? ( net-libs/libnfnetlink )
+"
+DEPEND="${RDEPEND}
+ virtual/os-headers
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # use the saner headers from the kernel
+ rm -f include/linux/{kernel,types}.h
+
+ epatch ${FILESDIR}/${P}-musl.patch
+
+ # Remove problematic extensions
+ rm -f extensions/libxt_TCPOPTSTRIP.*
+ rm -f extensions/libxt_osf.*
+
+ # Only run autotools if user patched something
+ epatch_user && eautoreconf || elibtoolize
+}
+
+src_configure() {
+ # Some libs use $(AR) rather than libtool to build #444282
+ tc-export AR
+
+ sed -i \
+ -e "/nfnetlink=[01]/s:=[01]:=$(usex netlink 1 0):" \
+ configure || die
+
+ econf \
+ --sbindir="${EPREFIX}/sbin" \
+ --libexecdir="${EPREFIX}/$(get_libdir)" \
+ --enable-devel \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ $(use_enable ipv6)
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ dodoc INCOMPATIBILITIES iptables/iptables.xslt
+
+ # all the iptables binaries are in /sbin, so might as well
+ # put these small files in with them
+ into /
+ dosbin iptables/iptables-apply
+ dosym iptables-apply /sbin/ip6tables-apply
+ doman iptables/iptables-apply.8
+
+ insinto /usr/include
+ doins include/iptables.h $(use ipv6 && echo include/ip6tables.h)
+ insinto /usr/include/iptables
+ doins include/iptables/internal.h
+
+ keepdir /var/lib/iptables
+ newinitd "${FILESDIR}"/${PN}-1.4.13-r1.init iptables
+ newconfd "${FILESDIR}"/${PN}-1.4.13.confd iptables
+ if use ipv6 ; then
+ keepdir /var/lib/ip6tables
+ newinitd "${FILESDIR}"/iptables-1.4.13-r1.init ip6tables
+ newconfd "${FILESDIR}"/ip6tables-1.4.13.confd ip6tables
+ fi
+
+ # Move important libs to /lib
+ gen_usr_ldscript -a ip{4,6}tc iptc xtables
+
+ prune_libtool_files
+}
diff --git a/net-firewall/iptables/iptables-1.4.21-r99.ebuild b/net-firewall/iptables/iptables-1.4.21-r99.ebuild
new file mode 100644
index 00000000..6f5106d5
--- /dev/null
+++ b/net-firewall/iptables/iptables-1.4.21-r99.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/iptables/iptables-1.4.21-r1.ebuild,v 1.5 2014/06/14 11:52:14 zlogene Exp $
+
+EAPI="5"
+
+# Force users doing their own patches to install their own tools
+AUTOTOOLS_AUTO_DEPEND=no
+
+inherit eutils multilib systemd toolchain-funcs autotools
+
+DESCRIPTION="Linux kernel (2.4+) firewall, NAT and packet mangling tools"
+HOMEPAGE="http://www.netfilter.org/projects/iptables/"
+SRC_URI="http://www.netfilter.org/projects/iptables/files/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ipv6 netlink static-libs"
+
+RDEPEND="
+ netlink? ( net-libs/libnfnetlink )
+"
+DEPEND="${RDEPEND}
+ virtual/os-headers
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # use the saner headers from the kernel
+ rm -f include/linux/{kernel,types}.h
+
+ epatch ${FILESDIR}/${P}-musl.patch
+
+ # Only run autotools if user patched something
+ epatch_user && eautoreconf || elibtoolize
+}
+
+src_configure() {
+ # Some libs use $(AR) rather than libtool to build #444282
+ tc-export AR
+
+ sed -i \
+ -e "/nfnetlink=[01]/s:=[01]:=$(usex netlink 1 0):" \
+ configure || die
+
+ econf \
+ --sbindir="${EPREFIX}/sbin" \
+ --libexecdir="${EPREFIX}/$(get_libdir)" \
+ --enable-devel \
+ --enable-shared \
+ $(use_enable static-libs static) \
+ $(use_enable ipv6)
+}
+
+src_compile() {
+ emake V=1
+}
+
+src_install() {
+ default
+ dodoc INCOMPATIBILITIES iptables/iptables.xslt
+
+ # all the iptables binaries are in /sbin, so might as well
+ # put these small files in with them
+ into /
+ dosbin iptables/iptables-apply
+ dosym iptables-apply /sbin/ip6tables-apply
+ doman iptables/iptables-apply.8
+
+ insinto /usr/include
+ doins include/iptables.h $(use ipv6 && echo include/ip6tables.h)
+ insinto /usr/include/iptables
+ doins include/iptables/internal.h
+
+ keepdir /var/lib/iptables
+ newinitd "${FILESDIR}"/${PN}-1.4.13-r1.init iptables
+ newconfd "${FILESDIR}"/${PN}-1.4.13.confd iptables
+ if use ipv6 ; then
+ keepdir /var/lib/ip6tables
+ newinitd "${FILESDIR}"/iptables-1.4.13-r1.init ip6tables
+ newconfd "${FILESDIR}"/ip6tables-1.4.13.confd ip6tables
+ fi
+
+ systemd_dounit "${FILESDIR}"/systemd/iptables{,-{re,}store}.service
+ if use ipv6 ; then
+ systemd_dounit "${FILESDIR}"/systemd/ip6tables{,-{re,}store}.service
+ fi
+
+ # Move important libs to /lib
+ gen_usr_ldscript -a ip{4,6}tc iptc xtables
+
+ prune_libtool_files
+}
diff --git a/net-firewall/iptables/metadata.xml b/net-firewall/iptables/metadata.xml
new file mode 100644
index 00000000..ed96e3dd
--- /dev/null
+++ b/net-firewall/iptables/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>
+<use>
+ <flag name='netlink'>Build against libnfnetlink which enables the nfnl_osf util</flag>
+</use>
+<longdescription>
+ iptables is the userspace command line program used to set up, maintain, and
+ inspect the tables of IPv4 packet filter rules in the Linux kernel. It's a
+ part of packet filtering framework which allows the stateless and stateful
+ packet filtering, all kinds of network address and port translation, and is a
+ flexible and extensible infrastructure with multiple layers of API's for 3rd
+ party extensions. The iptables package also includes ip6tables. ip6tables is
+ used for configuring the IPv6 packet filter.
+
+ Note that some extensions (e.g. imq and l7filter) are not included into
+ official kernel sources so you have to patch the sources before installation.
+</longdescription>
+<upstream>
+ <remote-id type="cpe">cpe:/a:netfilter_core_team:iptables</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/net-fs/cifs-utils/Manifest b/net-fs/cifs-utils/Manifest
new file mode 100644
index 00000000..93b81f89
--- /dev/null
+++ b/net-fs/cifs-utils/Manifest
@@ -0,0 +1,5 @@
+AUX cifs-utils-6.1-hardcoded-path.patch 1513 SHA256 2a0415b1452f3033c8322ed102b9acafbab9640f936254002d1bc493a0e6d7d5 SHA512 3ad0fbea11cd6a4bf6072e1131ccf87b0b81a9c869e2ee199f655ebc974c5e79f87694aa162ce2911767b6689f3b7530895b835d920575b5c37ac8fcd8cf4aad WHIRLPOOL 8684a3a3de491f9bc17070c8ad9d53bad14f5af62692e805bdd548bd4ad731096c01ce580b9800b053fcf583ee7af4166cfe00761f207934fa75b0223b22da76
+AUX cifs-utils-6.1-paths.h.patch 200 SHA256 3998b247b3a2658a637755db8ebf800eee75b3650ca0e114513e5a68fe71939f SHA512 8728a3a7ccc5837faac7e0380c32f8855e71013b6175117f22b1acfdd321363ab7529141e5f3d3e75a60fd0366adc3e23b8b59672fada77e201261d8bcb45ee3 WHIRLPOOL 4a99f745e65632cbbbc4d4c28028bf81fcb5f57076f46a93f1a53143c640007b08f59addbbb062807b2992350137ee54914b75f9e045596fcb0da1f879ca87ad
+DIST cifs-utils-6.1.tar.bz2 390958 SHA256 381f1e9caccdafdcdb0efa32a4cceb77c1a96b0b58702394e4b86dac4825f3b5 SHA512 6427b74edbf56b865dee38a610c74ac5483cdc13096082cfc1e9d225a048c9b5ee0c7afb30e625a615a0e8e9f3767e33765220e27148e2c2a29d12d4129b01fd WHIRLPOOL a800a02a0729996035a331b460cb28ae5463ddecaf205d88173dc08efd7a2bee577995ebba97b36977858c8435ac3b7ec9c7ce5d193f8b30d0602f9546fed5b1
+EBUILD cifs-utils-6.1-r99.ebuild 3101 SHA256 f89c643b1ce05f74e434fd93d54126cba7048c6ea08c8f2a15532b667fecf75e SHA512 32e4fdb22f91a6df7f11fe749ca40cadb731d797eb13f2721b7b6e084f135302973e6a62969b4dc1f3e9c892c47d2a1bd8379c4015730792c8909f438ade8e71 WHIRLPOOL 785d23e8506c333e4cb9bb621e2f619bd22925468b23f4223b9b41adc9bd7d1f268ef0868421796900a62938e3743b6db74acaea52356e71d3d17e349affd111
+MISC metadata.xml 894 SHA256 8d598e43e3e8ffcdca076aeecc8d7748574b9b10b0edcb7f29870c5765dac849 SHA512 351c7e517aeaac819858716a196364f033aa384d70dd8128a2e92d4b300ea451416cace7bcb8feeeffeb57264042d02fd814be3fdc8fc305b86f57e51158724f WHIRLPOOL ae8a5e246350bf67577855da35d3d100bd0485f4885cb2f46ca7a0ec3cc3eb6020a188bb0d08793f231adfd7c0b2fef6fe66d5c61a009a6c3aa4989df35d1299
diff --git a/net-fs/cifs-utils/cifs-utils-6.1-r99.ebuild b/net-fs/cifs-utils/cifs-utils-6.1-r99.ebuild
new file mode 100644
index 00000000..de04aac4
--- /dev/null
+++ b/net-fs/cifs-utils/cifs-utils-6.1-r99.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/cifs-utils/cifs-utils-6.1-r1.ebuild,v 1.13 2014/06/22 21:28:55 klausman Exp $
+
+EAPI=5
+
+inherit eutils linux-info multilib
+
+DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
+HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
+SRC_URI="ftp://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+acl +ads +caps +caps-ng creds"
+
+DEPEND="!net-fs/mount-cifs
+ !<net-fs/samba-3.6_rc1
+ ads? (
+ sys-apps/keyutils
+ sys-libs/talloc
+ virtual/krb5
+ )
+ caps? ( !caps-ng? ( sys-libs/libcap ) )
+ caps? ( caps-ng? ( sys-libs/libcap-ng ) )
+ creds? ( sys-apps/keyutils )"
+PDEPEND="${DEPEND}
+ acl? ( || (
+ =net-fs/samba-3.6*[winbind]
+ >=net-fs/samba-4.0.0_alpha1
+ ) )
+"
+
+REQUIRED_USE="acl? ( ads )"
+
+DOCS="doc/linux-cifs-client-guide.odt"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
+ ewarn "You must enable CIFS support in your kernel config, "
+ ewarn "to be able to mount samba shares. You can find it at"
+ ewarn
+ ewarn " File systems"
+ ewarn " Network File Systems"
+ ewarn " CIFS support"
+ ewarn
+ ewarn "and recompile your kernel ..."
+ fi
+}
+
+src_prepare() {
+ # Do not rely on hardcoded path to systemd-ask-password, bug #478538
+ epatch "${FILESDIR}/${P}-hardcoded-path.patch"
+ epatch "${FILESDIR}/${P}-paths.h.patch" #for musl
+}
+
+src_configure() {
+ ROOTSBINDIR="${EPREFIX}"/sbin \
+ econf \
+ $(use_enable acl cifsacl cifsidmap) \
+ $(use_enable ads cifsupcall) \
+ $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
+ $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
+ $(use_enable creds cifscreds)
+}
+
+src_install() {
+ default
+
+ # remove empty directories
+ find "${ED}" -type d -print0 | xargs --null rmdir \
+ --ignore-fail-on-non-empty &>/dev/null
+
+ if use acl ; then
+ dodir /etc/cifs-utils
+ dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
+ /etc/cifs-utils/idmap-plugin
+ dodir /etc/request-key.d
+ echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
+ > "${ED}/etc/request-key.d/cifs.idmap.conf"
+ fi
+
+ if use ads ; then
+ dodir /etc/request-key.d
+ echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
+ > "${ED}/etc/request-key.d/cifs.upcall.conf"
+ fi
+}
+
+pkg_postinst() {
+ # Inform about set-user-ID bit of mount.cifs
+ ewarn "setuid use flag was dropped due to multiple security implications"
+ ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
+ ewarn "You are free to set setuid flags by yourself"
+
+ # Inform about upcall usage
+ if use acl ; then
+ einfo "The cifs.idmap utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
+ einfo "This enables you to get and set CIFS acls."
+ fi
+
+ if use ads ; then
+ einfo "The cifs.upcall utility has been enabled by creating the"
+ einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
+ einfo "This enables you to mount DFS shares."
+ fi
+}
diff --git a/net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch b/net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch
new file mode 100644
index 00000000..c2e2ea21
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-6.1-hardcoded-path.patch
@@ -0,0 +1,44 @@
+From 4e315f6a02a4edb259b33bcf0665eba259fee2f2 Mon Sep 17 00:00:00 2001
+From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 30 Jul 2013 10:00:26 +0200
+Subject: [PATCH] Do not rely on hardcoded path to systemd-ask-password.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+Relying on hardcoded /bin/systemd-ask-password path breaks systemd that
+install systemd-ask-password in /usr/bin. Since both paths are supposed
+to be in ${PATH} and popen() passes the command to shell, just pass
+'systemd-ask-password' and let the shell find it.
+
+Fixes: https://bugzilla.samba.org/show_bug.cgi?id=10054
+Signed-off-by: Michał Górny <mgorny@gentoo.org>
+---
+ mount.cifs.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mount.cifs.c b/mount.cifs.c
+index e76beee..7206dcb 100644
+--- a/mount.cifs.c
++++ b/mount.cifs.c
+@@ -1626,7 +1626,7 @@ drop_child_privs(void)
+ }
+
+ /*
+- * If systemd is running and /bin/systemd-ask-password --
++ * If systemd is running and systemd-ask-password --
+ * is available, then use that else fallback on getpass(..)
+ *
+ * Returns: @input or NULL on error
+@@ -1649,7 +1649,7 @@ get_password(const char *prompt, char *input, int capacity)
+ FILE *ask_pass_fp = NULL;
+
+ cmd = ret = NULL;
+- if (asprintf(&cmd, "/bin/systemd-ask-password \"%s\"", prompt) >= 0) {
++ if (asprintf(&cmd, "systemd-ask-password \"%s\"", prompt) >= 0) {
+ ask_pass_fp = popen (cmd, "re");
+ free (cmd);
+ }
+--
+1.7.0.4
+
diff --git a/net-fs/cifs-utils/files/cifs-utils-6.1-paths.h.patch b/net-fs/cifs-utils/files/cifs-utils-6.1-paths.h.patch
new file mode 100644
index 00000000..5e2434d7
--- /dev/null
+++ b/net-fs/cifs-utils/files/cifs-utils-6.1-paths.h.patch
@@ -0,0 +1,10 @@
+--- a/cifs-utils-6.1/mtab.c
++++ b/cifs-utils-6.1/mtab.c
+@@ -38,6 +38,7 @@
+ #include <mntent.h>
+ #include <stdlib.h>
+ #include <signal.h>
++#include <paths.h>
+ #include "mount.h"
+ #include "config.h"
+
diff --git a/net-fs/cifs-utils/metadata.xml b/net-fs/cifs-utils/metadata.xml
new file mode 100644
index 00000000..a31a339f
--- /dev/null
+++ b/net-fs/cifs-utils/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>samba</herd>
+ <maintainer>
+ <email>samba@gentoo.org</email>
+ <name>Samba Team</name>
+ </maintainer>
+ <longdescription>The in-kernel CIFS filesystem relies on a set of user-space tools. That package of tools is called cifs-utils. Although not really part of Samba proper, these tools were originally part of the Samba package. For several reasons, shipping these tools as part of Samba was problematic and it was deemed better to split them off into their own package</longdescription>
+ <use>
+ <flag name="ads">Enable Active Directory support and create cifs.idmap binary - idmap support</flag>
+ <flag name="caps">libcap support</flag>
+ <flag name="caps-ng">libcap-ng support</flag>
+ <flag name="creds">cifs credentials support</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-libs/liblockfile/Manifest b/net-libs/liblockfile/Manifest
new file mode 100644
index 00000000..3f401eda
--- /dev/null
+++ b/net-libs/liblockfile/Manifest
@@ -0,0 +1,7 @@
+AUX Makefile.Darwin.in 2074 SHA256 3f8f82d8f6c9664ce11eaeaed5dfb22c4aaf8481f493f5c6d06eaeadf208b54b SHA512 cf2a9cee280ada8a05d239da0284eb16323bb04985790da0c737d880488a28fc03fe59aa276092681d25a444bc532e57c20ed8f549804f125e9a20cdb3b59f22 WHIRLPOOL 71e2641ee10994fe20cad0a46bdf77cbe9e0fe2c86bd626e91f9203dcebe33f1c0179ae6f590fbc9d30f358c364498195707f8c8623275b7d340ee5922600fd3
+AUX liblockfile-1.06-respectflags.patch 665 SHA256 c1ef8e3baa31291d5ac32e9ab76c4fcdb669852b1b3a6502fef74ced9566b386 SHA512 560aaf84c59c90b6c19f8cd8290e54bcbe7e1e5dad226b8c332be7a67789f68d29d19bd6110ffa907c587d80dc370f68fb4db88442015723a526cb77079441d6 WHIRLPOOL af77a3f10e2835c3997b1687407d08f3df9bfdbe15ac5c8846be41674c8adcfa2f53eee5baef077288744e19665cdfc58926caf21cd3ba3cd7ae226e3b4f92b9
+AUX liblockfile-1.09-no-ldconfig.patch 665 SHA256 77e595b67a0a5c2eb7b9a769b87428b95e2981bbbdfb6816c8efc42bb89a27f9 SHA512 8ecb0e73a9aa1a7583f4b46a69289fb9e106e563b90266077321a526190867f8bafe34b28d8e2ce170ae9fc0fb08cac87c22241ac20a43579745f53504af71b1 WHIRLPOOL 6157c4d94a56ec8296751728019e432689ce28fdc0d0a7d79538c3d95adf246116e63110ec7bc408d843b8263d227b96e7005b84262a1e8e1cfe367c6aed08f3
+AUX liblockfile-orphan-file.patch 613 SHA256 5e058b5c370a6256947ae664c9f44ba0eee59d0c80dd062a032fc9ec5a216859 SHA512 e42d5db372211a1c685c75b68542ecc0a9aa0810620cfd82fc0e76769120a058c691d04d6217ec428f956b0c0789a61fd08bca793260edf081e711e7d8626b0e WHIRLPOOL 126933d4cc8977142c0b614d6711fde427bbee088fb465a0fe74f516a814c54bef789a304e7b9db1584cf87c86bd12bf02bffa97b227017a340de64cc10c8f73
+DIST liblockfile_1.09.orig.tar.gz 32178 SHA256 16979eba05396365e1d6af7100431ae9d32f9bc063930d1de66298a0695f1b7f SHA512 8577f8bfa9c78983d6a409bc449be0d981e599a6a5f2fc8b43f76a238810ec5e3c180e27280719398f31041ed837fe8ba61df208ce77db77a354453e4579848a WHIRLPOOL 4365bd4f90207a97ec8421f60bcf2d61c4565eecc9435fd920b31ede3e182856783d21ad466632ea8d18e0378f3401637185235ef90e50d6bc10d093ae4d8a42
+EBUILD liblockfile-1.09-r99.ebuild 1257 SHA256 b8349009c3a63c751e2b95c469b29dea7c2fd554efe89259563a05616a632267 SHA512 b2d3f2bef785d6e7936c9f1124ce36b45bb9d3fadf45d68b3eca16af72f345e467a772c8255781944e509c69b09ddc2eb9be9766987dca2aa2919f33762281cb WHIRLPOOL 60eca8e07c9cedb13f289757337eac2a7a7a28f7419720edbc654a98c4e8dfe61e464d1518e0e8f83f5d831db4eac3f7a9762d6e4bd075d0207bad1967d2db4c
+MISC metadata.xml 161 SHA256 4ebf9a8f60040bfb95f13790c1d146a49c69f791f9c421e02a5d96fd6fcb2b32 SHA512 77001eed8032a3b919c30d8dd9314951d3471528e770ef5ad840060e217037f5e1f0eb2cf4c5f90cb2d58e9598c8a38619a1301f890d6dd734900ab6273fb6ec WHIRLPOOL 0d251627fdbf63b5c090313d5bbf3e45acf630331742dc930a0136cc382b7720fe4099c64fd439fd31fe0eed48a4199d6e31692dbdedd34f803f9e2567d46975
diff --git a/net-libs/liblockfile/files/Makefile.Darwin.in b/net-libs/liblockfile/files/Makefile.Darwin.in
new file mode 100644
index 00000000..bdd320fe
--- /dev/null
+++ b/net-libs/liblockfile/files/Makefile.Darwin.in
@@ -0,0 +1,80 @@
+#
+# Makefile.in Makefile for the liblockfile package (Darwin version)
+#
+# Gentoo version for Darwin, based on original:
+# version: @(#)Makefile.in 1.01 16-Apr-1999 miquels@cistron.nl
+#
+
+VER = 1.0
+NVER = 0.1
+
+CFLAGS = @CFLAGS@ -I.
+LDFLAGS = @LDFLAGS@
+CC = @CC@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+mandir = @mandir@
+nfslockdir = @nfslockdir@
+includedir = @includedir@
+
+MAILGROUP = @MAILGROUP@
+
+all: @TARGETS@
+install: @INSTALL_TARGETS@
+
+static: liblockfile.a dotlockfile
+shared: liblockfile.dylib dotlockfile
+nfslib: nfslock.$(VER).dylib
+
+liblockfile.a: lockfile.o
+ ar rv liblockfile.a lockfile.o
+
+liblockfile.dylib: liblockfile.a
+ $(CC) $(LDFLAGS) -fPIC -dynamiclib -install_name @libdir@/liblockfile.1.0.dylib \
+ -o liblockfile.dylib lockfile.o -lc
+
+nfslock.$(VER).dylib: nfslock.o
+ $(CC) $(LDFLAGS) -fPIC -dynamiclib -install_name nfslock.0.dylib \
+ -o nfslock.$(NVER).dylib nfslock.o
+
+dotlockfile: dotlockfile.o xlockfile.o
+ $(CC) $(LDFLAGS) -o dotlockfile dotlockfile.o xlockfile.o
+
+lockfile.o: lockfile.c
+ $(CC) $(CFLAGS) -DLIB -DLOCKPROG=\"$(bindir)/dotlockfile\" \
+ -c lockfile.c
+
+xlockfile.o: lockfile.c
+ $(CC) $(CFLAGS) -c lockfile.c -o xlockfile.o
+
+install_static: static install_common
+ install -m 644 liblockfile.a $(ROOT)$(libdir)
+
+install_shared: shared install_common
+ install -m 755 liblockfile.dylib \
+ $(ROOT)$(libdir)/liblockfile.$(VER).dylib
+ ln -s liblockfile.$(VER).dylib $(ROOT)$(libdir)/liblockfile.dylib
+
+install_common:
+ install -m 644 lockfile.h maillock.h $(ROOT)$(includedir)
+ if [ "$(MAILGROUP)" != "" ]; then\
+ install -g $(MAILGROUP) -m 2755 dotlockfile $(ROOT)$(bindir);\
+ else \
+ install -g root -m 755 dotlockfile $(ROOT)$(bindir); \
+ fi
+ install -m 644 *.1 $(ROOT)$(mandir)/man1
+ install -m 644 *.3 $(ROOT)$(mandir)/man3
+
+install_nfslib: nfslib
+ install -m 755 nfslock.$(VER).dylib $(ROOT)$(nfslockdir)
+
+clean:
+ rm -f *.a *.o *.dylib dotlockfile
+
+distclean: clean
+ rm -f Makefile autoconf.h maillock.h \
+ config.cache config.log config.status
+
diff --git a/net-libs/liblockfile/files/liblockfile-1.06-respectflags.patch b/net-libs/liblockfile/files/liblockfile-1.06-respectflags.patch
new file mode 100644
index 00000000..1a8d0eb1
--- /dev/null
+++ b/net-libs/liblockfile/files/liblockfile-1.06-respectflags.patch
@@ -0,0 +1,18 @@
+Index: liblockfile-1.06/Makefile.in
+===================================================================
+--- liblockfile-1.06.orig/Makefile.in
++++ liblockfile-1.06/Makefile.in
+@@ -32,11 +32,11 @@ liblockfile.a: lockfile.o
+ ar rv liblockfile.a lockfile.o
+
+ liblockfile.so: liblockfile.a
+- $(CC) -fPIC -shared -Wl,-soname,liblockfile.so.1 \
++ $(CC) $(LDFLAGS) -fPIC -shared -Wl,-soname,liblockfile.so.1 \
+ -o liblockfile.so lockfile.o -lc
+
+ nfslock.so.$(VER): nfslock.o
+- $(CC) -fPIC -shared -Wl,-soname,nfslock.so.0 \
++ $(CC) $(LDFLAGS) -fPIC -shared -Wl,-soname,nfslock.so.0 \
+ -o nfslock.so.$(NVER) nfslock.o
+
+ dotlockfile: dotlockfile.o xlockfile.o
diff --git a/net-libs/liblockfile/files/liblockfile-1.09-no-ldconfig.patch b/net-libs/liblockfile/files/liblockfile-1.09-no-ldconfig.patch
new file mode 100644
index 00000000..a478fa83
--- /dev/null
+++ b/net-libs/liblockfile/files/liblockfile-1.09-no-ldconfig.patch
@@ -0,0 +1,20 @@
+--- a/liblockfile-1.09/Makefile.in
++++ b/liblockfile-1.09/Makefile.in
+@@ -56,7 +56,7 @@
+ install -m 755 liblockfile.so \
+ $(ROOT)$(libdir)/liblockfile.so.$(VER)
+ ln -s liblockfile.so.$(VER) $(ROOT)$(libdir)/liblockfile.so
+- if test "$(ROOT)" = ""; then @LDCONFIG@; fi
++ if test "$(ROOT)" = ""; then sh -c '@LDCONFIG@'; fi
+
+ install_common:
+ install -m 644 lockfile.h maillock.h $(ROOT)$(includedir)
+@@ -70,7 +70,7 @@
+
+ install_nfslib: nfslib
+ install -m 755 nfslock.so.$(VER) $(ROOT)$(nfslockdir)
+- if test "$(ROOT)" = ""; then @LDCONFIG@; fi
++ if test "$(ROOT)" = ""; then sh -c '@LDCONFIG@'; fi
+
+ clean:
+ rm -f *.a *.o *.so *.so.* dotlockfile
diff --git a/net-libs/liblockfile/files/liblockfile-orphan-file.patch b/net-libs/liblockfile/files/liblockfile-orphan-file.patch
new file mode 100644
index 00000000..4a8c75ac
--- /dev/null
+++ b/net-libs/liblockfile/files/liblockfile-orphan-file.patch
@@ -0,0 +1,19 @@
+diff -ur liblockfile-1.06-orig/Makefile.in liblockfile-1.06/Makefile.in
+--- liblockfile-1.06-orig/Makefile.in 2006-11-28 06:19:09.000000000 +0100
++++ liblockfile-1.06/Makefile.in 2006-11-28 06:24:30.000000000 +0100
+@@ -5,6 +5,7 @@
+ #
+
+ VER = 1.0
++MVER = 1
+ NVER = 0.1
+
+ CFLAGS = @CFLAGS@ -I.
+@@ -55,6 +56,7 @@
+ install_shared: shared install_common
+ install -m 755 liblockfile.so \
+ $(ROOT)$(libdir)/liblockfile.so.$(VER)
++ ln -s liblockfile.so.$(VER) $(ROOT)$(libdir)/liblockfile.so.$(MVER)
+ ln -s liblockfile.so.$(VER) $(ROOT)$(libdir)/liblockfile.so
+ if test "$(ROOT)" = ""; then @LDCONFIG@; fi
+
diff --git a/net-libs/liblockfile/liblockfile-1.09-r99.ebuild b/net-libs/liblockfile/liblockfile-1.09-r99.ebuild
new file mode 100644
index 00000000..531a64b3
--- /dev/null
+++ b/net-libs/liblockfile/liblockfile-1.09-r99.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/liblockfile/liblockfile-1.09.ebuild,v 1.16 2014/01/08 06:42:31 vapier Exp $
+
+EAPI=4
+
+inherit eutils multilib autotools user
+
+DESCRIPTION="Implements functions designed to lock the standard mailboxes"
+HOMEPAGE="http://www.debian.org/"
+SRC_URI="mirror://debian/pool/main/libl/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE=""
+
+pkg_setup() {
+ enewgroup mail 12
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.06-respectflags.patch
+ epatch "${FILESDIR}"/${PN}-1.09-no-ldconfig.patch
+ epatch "${FILESDIR}"/${PN}-orphan-file.patch
+
+ # I don't feel like making the Makefile portable
+ [[ ${CHOST} == *-darwin* ]] \
+ && cp "${FILESDIR}"/Makefile.Darwin.in Makefile.in
+
+ eautoreconf
+}
+
+src_configure() {
+ local grp=mail
+ if use prefix ; then
+ # we never want to use LDCONFIG
+ export LDCONFIG=${EPREFIX}/bin/true
+ # in unprivileged installs this is "mail"
+ grp=$(id -g)
+ fi
+ econf --with-mailgroup=${grp} --enable-shared
+}
+
+src_install() {
+ dodir /usr/{bin,include,$(get_libdir)} /usr/share/man/{man1,man3}
+ emake ROOT="${D}" install
+ dodoc README Changelog
+}
diff --git a/net-libs/liblockfile/metadata.xml b/net-libs/liblockfile/metadata.xml
new file mode 100644
index 00000000..51f94e3f
--- /dev/null
+++ b/net-libs/liblockfile/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>net-mail</herd>
+</pkgmetadata>
diff --git a/net-libs/libnfsidmap/Manifest b/net-libs/libnfsidmap/Manifest
new file mode 100644
index 00000000..623ec428
--- /dev/null
+++ b/net-libs/libnfsidmap/Manifest
@@ -0,0 +1,6 @@
+AUX 0001-add_missing_header_musl.patch 278 SHA256 5ad941e71e4523f22da5f30c7855e6657193470917a6ee3b4143f04967b4af09 SHA512 34dd3d7c0723cf95518a6f28b7b522d35a4f653bf6496d3b46fa57602b41f761e60e51ada7334422950fcd8a0cae559caf82bb9c2822c9f688e0d009476c4389 WHIRLPOOL a981aed6d9c84363375c720719a4fa9e87bae5f324bf02b41324ecb107ce4d325e0e0cca9afd0b95994bf97aeea7ab1254ae1610d97ec5e23b6b9505665a2791
+AUX libnfsidmap-0.19-getgrouplist.patch 3459 SHA256 214f347663610a63f56659da0f50eac95e0c59257c18f09edcdc37984fdc8596 SHA512 a778620b51158b07b7224ca010ba199feba85af7fc087bde65cfb8d2660bd7646c08d303a39d2af525b3a449694a60c3c35fe3b696cb0354b5d74423240a9e8d WHIRLPOOL d44d8f9272884d99f838483742cabbb2d0353b4d45f03988a6addcad54b6ad91059179697618595f7833df47d2e9f17747fc86ce4e94b725c497e19c9238cb2c
+AUX libnfsidmap-0.21-headers.patch 438 SHA256 755314afbbdc82d2cb2e5f0114a3d6eae0d0978da859f215bb858e44a11296ff SHA512 55cc2dce6df5c215d2ba270324a2dabdd7c798d88dfe1f6ac01a7bfcddc1b9a23bc031fac2006682596f3984f0ce9782c8584e3b8e02a1b491ac978a69aca926 WHIRLPOOL 0ea374b911ba5209b621a363eff287647fdb8d3d98106276f143cb9fd03578c8c477482195876d8f751dcf59b9c1ecf8121f405caae4e0134f23a48cbcc86861
+DIST libnfsidmap-0.24.tar.gz 328720 SHA256 59501432e683336d7a290da13767e92afb5b86f42ea4254041225fe218e8dd47 SHA512 1283a4af1bcf3c6f941ab294acc0b2b4bd9ca947f2d3c2e866717478ba2e7a2190a5467b71d7e9136c5c83de564c4892f9e3304323ae17e3988af2e40c43982b WHIRLPOOL 7f9e81dec91429c09b24325bdf077d800b608bb87eeeb5d4334fa3dbbd50a4acf482162716c19c5f5175e48bf129dbf4611c1d6be933097753eeaab834192bae
+EBUILD libnfsidmap-0.24-r99.ebuild 1214 SHA256 29a791cbb57c4ebf390deb938d4cc3e520044ad189fea0c0fda4dcabcdaf15ae SHA512 375b1360e72635a6bbb12cab0d99687c18e4d3909521dcf01599ed77f56808ab01e751ec91148597a7fb1b224b8bc9a8b03b682c9d7e1788e35b644527232ed4 WHIRLPOOL f72bae2c111421409d62f2a52499e2418d8ea9dc7d8d7395d28c098dc2ef960f15b673008458e63d289b34bb7fcadb0bb2fd9ab32993a1dd973874a900c51457
+MISC metadata.xml 159 SHA256 562c59615c028ffa088de789b3a792fd4cbbbfe71628ddd6a55d3b176becbc6b SHA512 9645bd7d570c2eefd7f14adf726c056a6295d45263f143e365a3fd2e8e6128392eb5fa1103b3a3bb60a622b4595ac7fe3ec19430184210ff63e86d5f03635704 WHIRLPOOL 1d62390192bf65ac30d67f3c0a872536dd8e6a5a0d8d978e5e8f83f09e44907abf16825066c9976e8be482398385737a024837da3c544eaf912ec2710318e289
diff --git a/net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch b/net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch
new file mode 100644
index 00000000..c94748e8
--- /dev/null
+++ b/net-libs/libnfsidmap/files/0001-add_missing_header_musl.patch
@@ -0,0 +1,12 @@
+--- cfg.h 2015-01-10 14:25:50.384148769 +0000
++++ cfg.h 2015-01-10 14:28:23.062148769 +0000
+@@ -33,6 +33,9 @@
+ #ifndef _CONF_H_
+ #define _CONF_H_
+
++#if ! defined(__GLIBC__) || ! defined(__UCLIBC__)
++#include <sys/types.h>
++#endif
+ #include "queue.h"
+
+ struct conf_list_node {
diff --git a/net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch b/net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch
new file mode 100644
index 00000000..0d5d367b
--- /dev/null
+++ b/net-libs/libnfsidmap/files/libnfsidmap-0.19-getgrouplist.patch
@@ -0,0 +1,115 @@
+http://bugs.gentoo.org/169909
+
+--- libnfsidmap-0.19/configure.in
++++ libnfsidmap-0.19/configure.in
+@@ -38,7 +38,7 @@
+
+ # Checks for library functions.
+ AC_FUNC_MALLOC
+-AC_CHECK_FUNCS([strchr strdup])
++AC_CHECK_FUNCS([strchr strdup getgrouplist])
+
+ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT(libnfsidmap.pc)
+--- libnfsidmap-0.19/nss.c
++++ libnfsidmap-0.19/nss.c
+@@ -49,6 +49,8 @@
+ #include "cfg.h"
+ #include <syslog.h>
+
++#include "getgrouplist.c"
++
+ /*
+ * NSS Translation Methods
+ *
+--- libnfsidmap-0.19/getgrouplist.c
++++ libnfsidmap-0.19/getgrouplist.c
+@@ -0,0 +1,88 @@
++/*
++ * getgrouplist.c
++ *
++ * if system does not provide the non-standard getgrouplist, we will emulate
++ * it via POSIX standard functions
++ *
++ * Copyright (c) 1991, 1993
++ * The Regents of the University of California. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 4. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++#include <sys/types.h>
++#include <grp.h>
++#include <string.h>
++#include <unistd.h>
++
++#ifndef HAVE_GETGROUPLIST
++static
++int
++getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
++{
++ const struct group *grp;
++ int i, maxgroups, ngroups, ret;
++
++ ret = 0;
++ ngroups = 0;
++ maxgroups = *grpcnt;
++ /*
++ * When installing primary group, duplicate it;
++ * the first element of groups is the effective gid
++ * and will be overwritten when a setgid file is executed.
++ */
++ groups[ngroups++] = agroup;
++ if (maxgroups > 1)
++ groups[ngroups++] = agroup;
++ /*
++ * Scan the group file to find additional groups.
++ */
++ setgrent();
++ while ((grp = getgrent()) != NULL) {
++ for (i = 0; i < ngroups; i++) {
++ if (grp->gr_gid == groups[i])
++ goto skip;
++ }
++ for (i = 0; grp->gr_mem[i]; i++) {
++ if (!strcmp(grp->gr_mem[i], uname)) {
++ if (ngroups >= maxgroups) {
++ ret = -1;
++ break;
++ }
++ groups[ngroups++] = grp->gr_gid;
++ break;
++ }
++ }
++skip:
++ ;
++ }
++ endgrent();
++ *grpcnt = ngroups;
++ return (ret);
++}
++#endif
diff --git a/net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch b/net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch
new file mode 100644
index 00000000..6ef12d44
--- /dev/null
+++ b/net-libs/libnfsidmap/files/libnfsidmap-0.21-headers.patch
@@ -0,0 +1,22 @@
+for toupper and such
+
+--- a/nss.c
++++ b/nss.c
+@@ -34,6 +34,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include <ctype.h>
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <unistd.h>
+--- a/libnfsidmap.c
++++ b/libnfsidmap.c
+@@ -37,6 +37,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#include <ctype.h>
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <unistd.h>
diff --git a/net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild b/net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild
new file mode 100644
index 00000000..bddfb349
--- /dev/null
+++ b/net-libs/libnfsidmap/libnfsidmap-0.24-r99.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libnfsidmap/libnfsidmap-0.24.ebuild,v 1.8 2014/01/18 04:50:16 vapier Exp $
+
+EAPI="2"
+
+inherit autotools eutils
+
+DESCRIPTION="NFSv4 ID <-> name mapping library"
+HOMEPAGE="http://www.citi.umich.edu/projects/nfsv4/linux/"
+SRC_URI="http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ldap static-libs"
+
+DEPEND="ldap? ( net-nds/openldap )"
+RDEPEND="${DEPEND}
+ !<net-fs/nfs-utils-1.2.2
+ !net-fs/idmapd"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.19-getgrouplist.patch #169909
+ epatch "${FILESDIR}"/${PN}-0.21-headers.patch
+ epatch "${FILESDIR}"/0001-add_missing_header_musl.patch
+ epatch_user
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-dependency-tracking \
+ $(use_enable static-libs static) \
+ $(use_enable ldap)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS ChangeLog NEWS README
+
+ insinto /etc
+ doins idmapd.conf || die
+
+ # remove useless files
+ rm -f "${D}"/usr/lib*/libnfsidmap/*.{a,la}
+ use static-libs || rm -f "${D}"/usr/lib*/*.la
+}
diff --git a/net-libs/libnfsidmap/metadata.xml b/net-libs/libnfsidmap/metadata.xml
new file mode 100644
index 00000000..ca66751d
--- /dev/null
+++ b/net-libs/libnfsidmap/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>net-fs</herd>
+</pkgmetadata>
diff --git a/net-libs/libtirpc/Manifest b/net-libs/libtirpc/Manifest
new file mode 100644
index 00000000..36a4cd97
--- /dev/null
+++ b/net-libs/libtirpc/Manifest
@@ -0,0 +1,12 @@
+AUX 0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch 2012 SHA256 9ff042aa7ba870d2d581f2815eee9cae7620df6b3a725da4c4d555325a08a05d SHA512 e60fc98c9efaa4675d08e85b669d8dea07b2c7e7b268344e06e172f5751baf6fae7f354149d738f4bbe139ff5b964f1d80d0bfa91a1c9ca94f9ab9489618166d WHIRLPOOL b0977e6af76929f9279b253ecb30c7b265da130bb76ea87ab5709372bb74f02b3a7c508394b72be785c7396cc171ec2da98857b1b49dcca3a3f6324d8f2c7b28
+AUX 0002-Misc-header-fixes.patch 1074 SHA256 519dd9015db2505404118e0067c7cbfec22b0df1371691c52568290f4a6641eb SHA512 aa5c158fb2c8f28b046831d383edc78421f71f4f632d1880e4beb30c9dfb1ea8814889c1256a82fccde06d1cfe7840ed23e857900a38bc738bf31d79c7a1ef75 WHIRLPOOL 334e566fd89f40134f46f2c852f15cf6d2062f6bec9d5fb6773b81a4abc45096acbc4577543f9a73b68578678fda6be2a5b512f90e031524126cde75040a6b7d
+AUX 0003-fix_cdefs_h_include.patch 15313 SHA256 c5bae800d887a08eba89d817b6cc19c4337b14e53f2ce8e9fb7e9984dbfe4168 SHA512 cf686acda95f8ccca486b518ee2ada42a443b3cc524bf4374b770612f501e0f2a75c61c8586a9d490ce3ee1e373559cf72c380d9fa99a75d0037b74e35fa3647 WHIRLPOOL 12915a1d45649695198c20bd609681f640bdbf3a1b40554d051e6a07534b7889a4676990edab90605571f0bc2caaebae074f3c6ec9ef88304c597acd0580b7a8
+AUX 0004-fix_DECLS.patch 29124 SHA256 bdc844c56cfe2d5b060d59fee009576895504e2df492423ddaedd9915c785650 SHA512 8d0efe87a0e8444dd10d4b63430dfd038a7591a0a1e54bc539a4023c7421a89caae1c811d6a2ed4e33fd4d0beebd48c11fc28b5de41dbedf0c1e0fbeb8885cf3 WHIRLPOOL 5ec477f9dfb79a53b2689dea6e158c42437f0c15e18f0eebd3aede63e59b1191974fd913b26db352feb84d468dd7770e102510022ae2b017aa634f0e9e335a27
+AUX 0005-fix_remaining_issues.patch 373 SHA256 db061da4e22c4ed9192587a622454e69c6999b5ccfdafa5588957440051277e2 SHA512 db70a64424904a669534e25c70b13dffb0ddd3437e81f6fee69ac2399e00bdd4e83ee9c65bc0bb789e28c1ac8e030a22461642e699fd371a4f147782a5845912 WHIRLPOOL 06e9f643c66867ddf965427e5c874eaa3c4275b961634d3fc669120275e3db8613a9bd997d612976c078584e016234f34e5a4abfeef20eb655997c7825e8cb56
+AUX 0006-fix_queue_h_include.patch 1788 SHA256 3b8f296eb375052210874ebc3caeadd0cdf689a27e279761e16d76b411e89f8f SHA512 f5a419d883dc6fc0bc6ebb02c3b1f7ce95aeb2b261eb5a49498b600844a27041b32f146fd8bba3d1769c32a67a15b9e40d9ffe3598d9448ebfc4fde6446e69aa WHIRLPOOL 1e7b71255a11abd45dc88b74d8d8146f60c0a621ebe42f437e45e01f791a0ca020c27f841091f556d33fd284336b2e8cc8fa91fa9ca9ed5dd5904c1a5fe82212
+AUX 0007-no-des.patch 960 SHA256 12823f030b803045108df782018d04ca253d4439b0e92015ddb140dcd33c1be3 SHA512 95ad086657d008a01a4072ba7141391cbbe8ac35372b2f063a3f9774eb5dfa12b97bcff0c1b6da2d887001beaa60a8524823df93a8de2fdb73ad2a30340770ba WHIRLPOOL bd075834fddeff5ae86b90273f5c7b820f88649045e65b63d09dc26c35ada0fd1162dcf8aeb1cd82ad59b9092eceb92e154fa58c9beca540dc31ead7cc96b72e
+AUX libtirpc-0.2.5-stdarg.patch 667 SHA256 2b31b1148af9d96c9a9e6f609c0b5b03424954d6251c18d64b6119afd8afa6f7 SHA512 2197f8c2ed3b4dbfc54ee37e973a6e275d19c6dde5d066b9ce45beecdbb17c9e620d7c6f0997b7ebfeb2bd1741327028a793b34edd94d59a89c8b36ac102b025 WHIRLPOOL 90d4e88c18f0d93ab8dfef4981377c2a6df42ff90b70049d07e203e7b66a5087910fe501cf9e1b93782eb25a8b3a8680c03287ccc563b838f517e5d1524b12c5
+DIST libtirpc-0.2.5.tar.bz2 459094 SHA256 62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db SHA512 9f8afa1acb04a2c2c558018f2528f8caaa79994a2af2abeed947f914145872ef72988b241e11925c799db0de9ec51fd9baecd2b08150240b22f91e2e55a45194 WHIRLPOOL a2b4f1c4825f2b774c2290cccd9d552bb7566ec9eb5988d3ab619d7870a907600f67e7af39fbc3e245606db8534f114c990145789c383206d3a9cf96cf043d8c
+DIST libtirpc-glibc-nfs.tar.xz 8948 SHA256 2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83 SHA512 90255bf0a27af16164e0710dd940778609925d473f4343093ff19d98cc4f23023788bf4edf0178eae1961afc0ba8b69b273de95b7d7e2afdb706701d8ba6f7ba WHIRLPOOL 06bcf3fd4e424a86071e5c4ddeb89aa571c862e765aae9382d9f9a55ab72cd1c623490555c1a9bd3380a2d04ecb10fb47a75a7dddf449d4368a1a01617226858
+EBUILD libtirpc-0.2.5-r99.ebuild 2018 SHA256 b4df6736e714a256720092b5e633f2a333674f1378f644522eb04d84b9863967 SHA512 58e3d66138f3fff2326cb3d13ea57ca30b0e5fe20d9134261b1ded38d4aef10feee5aea02cd127b146f048a4f07e10f058b13de6ef26648919f1092183189607 WHIRLPOOL c64f92481c25b49812e05a4758899a898503bbafd1afc022f789c582552fe7520ee0bf7a0c7014a5f6d7adfb3cf69c01f179664c0427ee7154ad9e60c9f759bf
+MISC metadata.xml 159 SHA256 562c59615c028ffa088de789b3a792fd4cbbbfe71628ddd6a55d3b176becbc6b SHA512 9645bd7d570c2eefd7f14adf726c056a6295d45263f143e365a3fd2e8e6128392eb5fa1103b3a3bb60a622b4595ac7fe3ec19430184210ff63e86d5f03635704 WHIRLPOOL 1d62390192bf65ac30d67f3c0a872536dd8e6a5a0d8d978e5e8f83f09e44907abf16825066c9976e8be482398385737a024837da3c544eaf912ec2710318e289
diff --git a/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch b/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
new file mode 100644
index 00000000..3708638a
--- /dev/null
+++ b/net-libs/libtirpc/files/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
@@ -0,0 +1,85 @@
+From d3b5ffed6d7d49cc93b2343afcf0e4502a3e54ce Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 24 Apr 2014 09:19:45 +0200
+Subject: [PATCH 1/2] Provide getrpcbynumber and getrpcbyname if those are
+ missing
+
+We enable the config.h again and check fi getrpcbynumber and
+getrpcbyname exists on the building patform. If it does not exist, then
+provide those functions.
+
+This is needed for musl libc.
+---
+ configure.ac | 6 ++++--
+ src/getrpcent.c | 10 ++++++++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 10d17ea..0180801 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,14 +24,16 @@ if test "x$enable_ipv6" != xno; then
+ fi
+
+ AC_PROG_CC
+-m4_pattern_allow(AM_CONFIG_HEADERS(config.h))
++AC_CONFIG_HEADERS([config.h])
+ AC_PROG_LIBTOOL
+ AC_HEADER_DIRENT
+ AC_PREFIX_DEFAULT(/usr)
+ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h locale.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
+ AC_CHECK_LIB([pthread], [pthread_create])
+ AC_CHECK_LIB([nsl], [yp_get_default_domain])
+-
++AC_CHECK_FUNCS([getrpcbyname getrpcbynumber])
+
+ AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
+ AC_OUTPUT(libtirpc.pc)
++
++
+diff --git a/src/getrpcent.c b/src/getrpcent.c
+index 1b54b6d..6da006a 100644
+--- a/src/getrpcent.c
++++ b/src/getrpcent.c
+@@ -50,6 +50,10 @@
+ #include <libc_private.h>
+ #endif
+
++#if HAVE_CONFIG_H
++#include "config.h"
++#endif
++
+ /*
+ * Internet version.
+ */
+@@ -89,7 +93,7 @@ _rpcdata()
+ return (d);
+ }
+
+-#ifdef GQ
++#if !HAVE_GETRPCBYNYMBER
+ struct rpcent *
+ getrpcbynumber(number)
+ int number;
+@@ -135,7 +139,9 @@ no_yp:
+ endrpcent();
+ return (p);
+ }
++#endif /* !HAVE_GETRPCBYNUMBER */
+
++#if !HAVE_GETRPCBYNAME
+ struct rpcent *
+ getrpcbyname(name)
+ const char *name;
+@@ -158,7 +164,7 @@ done:
+ endrpcent();
+ return (rpc);
+ }
+-#endif /* GQ */
++#endif /* !HAVE_GETRPCBYNAME */
+
+ void
+ setrpcent(f)
+--
+1.9.2
+
diff --git a/net-libs/libtirpc/files/0002-Misc-header-fixes.patch b/net-libs/libtirpc/files/0002-Misc-header-fixes.patch
new file mode 100644
index 00000000..9287d03a
--- /dev/null
+++ b/net-libs/libtirpc/files/0002-Misc-header-fixes.patch
@@ -0,0 +1,40 @@
+From ed6dc31ed1092baf42f99278ef9c5c297805c3d0 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 24 Apr 2014 08:58:20 +0200
+Subject: [PATCH 2/2] Misc header fixes
+
+src/bindresvport.c: IPPORT_RESERVED needs netdb.h
+
+Misc fixes for building on musl libc
+---
+ src/bindresvport.c | 1 +
+ tirpc/netconfig.h | 1 +
+ tirpc/rpc/rpcent.h | 2 +-
+ tirpc/rpc/types.h | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/bindresvport.c b/src/bindresvport.c
+index d6d9c14..5a7a1a9 100644
+--- a/src/bindresvport.c
++++ b/src/bindresvport.c
+@@ -37,6 +37,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
++#include <netdb.h>
+ #include <netinet/in.h>
+
+ #include <errno.h>
+diff --git a/tirpc/rpc/rpcent.h b/tirpc/rpc/rpcent.h
+index c865e51..a36cf91 100644
+--- a/tirpc/rpc/rpcent.h
++++ b/tirpc/rpc/rpcent.h
+@@ -47,7 +47,7 @@
+ __BEGIN_DECLS
+
+ /* These are defined in /usr/include/rpc/netdb.h */
+-#if 0
++#if !defined(__GLIBC__)
+ struct rpcent {
+ char *r_name; /* name of server for this rpc program */
+ char **r_aliases; /* alias list */
diff --git a/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch b/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch
new file mode 100644
index 00000000..4f09b702
--- /dev/null
+++ b/net-libs/libtirpc/files/0003-fix_cdefs_h_include.patch
@@ -0,0 +1,618 @@
+--- ./tirpc/rpc/xdr.h.orig 2014-11-28 09:09:44.902289976 +0000
++++ ./tirpc/rpc/xdr.h 2014-11-28 09:09:44.903289976 +0000
+@@ -40,7 +40,9 @@
+
+ #ifndef _TIRPC_XDR_H
+ #define _TIRPC_XDR_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <netinet/in.h>
+
+--- ./tirpc/rpc/pmap_prot.h.orig 2014-11-28 09:09:44.901289976 +0000
++++ ./tirpc/rpc/pmap_prot.h 2014-11-28 09:09:44.902289976 +0000
+@@ -71,7 +71,9 @@
+
+ #ifndef _RPC_PMAP_PROT_H
+ #define _RPC_PMAP_PROT_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #define PMAPPORT ((u_short)111)
+ #define PMAPPROG ((u_long)100000)
+--- ./tirpc/rpc/auth.h.orig 2014-11-28 09:09:44.896289976 +0000
++++ ./tirpc/rpc/auth.h 2014-11-28 09:09:44.897289976 +0000
+@@ -48,7 +48,9 @@
+
+ #include <rpc/xdr.h>
+ #include <rpc/clnt_stat.h>
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <sys/socket.h>
+ #include <sys/types.h>
+
+--- ./tirpc/rpc/svc.h.orig 2014-11-28 09:09:44.904289976 +0000
++++ ./tirpc/rpc/svc.h 2014-11-28 09:09:44.905289976 +0000
+@@ -40,7 +40,9 @@
+
+ #ifndef _TIRPC_SVC_H
+ #define _TIRPC_SVC_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * This interface must manage two items concerning remote procedure calling:
+--- ./tirpc/rpc/svc_soc.h.orig 2014-11-28 09:09:44.906289976 +0000
++++ ./tirpc/rpc/svc_soc.h 2014-11-28 09:09:44.907289976 +0000
+@@ -38,7 +38,9 @@
+
+ #ifndef _RPC_SVC_SOC_H
+ #define _RPC_SVC_SOC_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /* #pragma ident "@(#)svc_soc.h 1.11 94/04/25 SMI" */
+ /* svc_soc.h 1.8 89/05/01 SMI */
+--- ./tirpc/rpc/clnt_soc.h.orig 2014-11-28 09:09:44.893289976 +0000
++++ ./tirpc/rpc/clnt_soc.h 2014-11-28 09:09:44.894289976 +0000
+@@ -46,7 +46,9 @@
+ * with TS-RPC.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
+
+--- ./tirpc/rpc/rpc_com.h.orig 2014-11-28 09:09:44.894289976 +0000
++++ ./tirpc/rpc/rpc_com.h 2014-11-28 09:09:44.894289976 +0000
+@@ -41,7 +41,9 @@
+ #ifndef _RPC_RPCCOM_H
+ #define _RPC_RPCCOM_H
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
+
+--- ./tirpc/rpc/auth_unix.h.orig 2014-11-28 09:09:44.905289976 +0000
++++ ./tirpc/rpc/auth_unix.h 2014-11-28 09:09:44.906289976 +0000
+@@ -45,7 +45,9 @@
+
+ #ifndef _TIRPC_AUTH_UNIX_H
+ #define _TIRPC_AUTH_UNIX_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /* The machine name is part of a credential; it may not exceed 255 bytes */
+ #define MAX_MACHINE_NAME 255
+--- ./tirpc/rpc/pmap_rmt.h.orig 2014-11-28 09:09:44.899289976 +0000
++++ ./tirpc/rpc/pmap_rmt.h 2014-11-28 09:09:44.900289976 +0000
+@@ -41,7 +41,9 @@
+
+ #ifndef _RPC_PMAP_RMT_H
+ #define _RPC_PMAP_RMT_H
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ struct rmtcallargs {
+ u_long prog, vers, proc, arglen;
+--- ./tirpc/rpc/des_crypt.h.orig 2014-11-28 09:09:44.900289976 +0000
++++ ./tirpc/rpc/des_crypt.h 2014-11-28 09:09:44.901289976 +0000
+@@ -43,7 +43,9 @@
+ #ifndef _DES_DES_CRYPT_H
+ #define _DES_DES_CRYPT_H
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <rpc/rpc.h>
+
+ #define DES_MAXDATA 8192 /* max bytes encrypted in one call */
+--- ./tirpc/rpc/clnt.h.orig 2014-11-28 09:09:44.897289976 +0000
++++ ./tirpc/rpc/clnt.h 2014-11-28 09:09:44.899289976 +0000
+@@ -42,7 +42,9 @@
+ #include <rpc/clnt_stat.h>
+ #include <rpc/auth.h>
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <netconfig.h>
+ #include <sys/un.h>
+
+--- ./tirpc/rpc/pmap_clnt.h.orig 2014-11-28 09:09:44.895289976 +0000
++++ ./tirpc/rpc/pmap_clnt.h 2014-11-28 09:09:44.895289976 +0000
+@@ -63,7 +63,9 @@
+
+ #ifndef _RPC_PMAP_CLNT_H_
+ #define _RPC_PMAP_CLNT_H_
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ __BEGIN_DECLS
+ extern bool_t pmap_set(u_long, u_long, int, int);
+--- ./tirpc/rpcsvc/crypt.x.orig 2014-11-28 09:09:44.907289976 +0000
++++ ./tirpc/rpcsvc/crypt.x 2014-11-28 09:09:44.908289976 +0000
+@@ -31,7 +31,9 @@
+ */
+
+ #ifndef RPC_HDR
+-%#include <sys/cdefs.h>
++%#ifdef __GLIBC__
++%#include <sys/cdefs.h>
++%#endif
+ %__FBSDID("$FreeBSD: src/include/rpcsvc/crypt.x,v 1.5 2003/05/04 02:51:42 obrien Exp $");
+ #endif
+
+--- ./src/auth_none.c.orig 2014-11-28 09:09:44.875289976 +0000
++++ ./src/auth_none.c 2014-11-28 09:09:44.876289976 +0000
+@@ -31,7 +31,9 @@
+ static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro";
+ static char *sccsid = "@(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC";
+ #endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $");
+ */
+
+--- ./src/crypt_client.c.orig 2014-11-28 09:09:44.886289976 +0000
++++ ./src/crypt_client.c 2014-11-28 09:09:44.886289976 +0000
+@@ -30,7 +30,9 @@
+ * SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #include <err.h>
+ #include <sys/types.h>
+--- ./src/xdr_reference.c.orig 2014-11-28 09:09:44.858289976 +0000
++++ ./src/xdr_reference.c 2014-11-28 09:09:44.859289976 +0000
+@@ -26,8 +26,12 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr_reference.c, Generic XDR routines impelmentation.
+--- ./src/auth_unix.c.orig 2014-11-28 09:09:44.863289976 +0000
++++ ./src/auth_unix.c 2014-11-28 09:09:44.864289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * auth_unix.c, Implements UNIX style authentication parameters.
+--- ./src/authdes_prot.c.orig 2014-11-28 09:09:44.868289976 +0000
++++ ./src/authdes_prot.c 2014-11-28 09:09:44.869289976 +0000
+@@ -1,4 +1,6 @@
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ /*
+ * Copyright (c) 2009, Sun Microsystems, Inc.
+ * All rights reserved.
+--- ./src/rpcb_st_xdr.c.orig 2014-11-28 09:09:44.847289976 +0000
++++ ./src/rpcb_st_xdr.c 2014-11-28 09:09:44.848289976 +0000
+@@ -35,7 +35,9 @@
+ * routines used with the rpcbind stats facility.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #include <rpc/rpc.h>
+
+--- ./src/auth_time.c.orig 2014-11-28 09:09:44.887289976 +0000
++++ ./src/auth_time.c 2014-11-28 09:09:44.888289976 +0000
+@@ -25,7 +25,9 @@
+ * needed to deal with TCP connections.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+--- ./src/des_crypt.c.orig 2014-11-28 09:09:44.871289976 +0000
++++ ./src/des_crypt.c 2014-11-28 09:09:44.872289976 +0000
+@@ -39,7 +39,9 @@
+ static char sccsid[] = "@(#)des_crypt.c 2.2 88/08/10 4.0 RPCSRC; from 1.13 88/02/08 SMI";
+ #endif
+ #endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * );
+ int (*__des_crypt_LOCAL)() = 0;
+--- ./src/svc_vc.c.orig 2014-11-28 09:09:44.878289976 +0000
++++ ./src/svc_vc.c 2014-11-28 09:09:44.879289976 +0000
+@@ -27,7 +27,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * svc_vc.c, Server side for Connection Oriented based RPC.
+--- ./src/xdr_float.c.orig 2014-11-28 09:09:44.882289976 +0000
++++ ./src/xdr_float.c 2014-11-28 09:09:44.883289976 +0000
+@@ -27,7 +27,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr_float.c, Generic XDR routines implementation.
+--- ./src/xdr_sizeof.c.orig 2014-11-28 09:09:44.865289976 +0000
++++ ./src/xdr_sizeof.c 2014-11-28 09:09:44.866289976 +0000
+@@ -34,7 +34,9 @@
+ * when serialized using XDR.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
+--- ./src/xdr_array.c.orig 2014-11-28 09:09:44.892289976 +0000
++++ ./src/xdr_array.c 2014-11-28 09:09:44.893289976 +0000
+@@ -27,7 +27,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr_array.c, Generic XDR routines impelmentation.
+--- ./src/rpc_generic.c.orig 2014-11-28 09:09:44.842289976 +0000
++++ ./src/rpc_generic.c 2014-11-28 09:09:44.844289976 +0000
+@@ -29,7 +29,9 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * rpc_generic.c, Miscl routines for RPC.
+--- ./src/getpeereid.c.orig 2014-11-28 09:09:44.855289976 +0000
++++ ./src/getpeereid.c 2014-11-28 09:09:44.856289976 +0000
+@@ -24,7 +24,9 @@
+ * SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- ./src/xdr_stdio.c.orig 2014-11-28 09:09:44.880289976 +0000
++++ ./src/xdr_stdio.c 2014-11-28 09:09:44.881289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr_stdio.c, XDR implementation on standard i/o file.
+--- ./src/clnt_bcast.c.orig 2014-11-28 09:09:44.859289976 +0000
++++ ./src/clnt_bcast.c 2014-11-28 09:09:44.861289976 +0000
+@@ -28,7 +28,9 @@
+ /*
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * clnt_bcast.c
+--- ./src/xdr_mem.c.orig 2014-11-28 09:09:44.876289976 +0000
++++ ./src/xdr_mem.c 2014-11-28 09:09:44.877289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr_mem.h, XDR implementation using memory buffers.
+--- ./src/key_call.c.orig 2014-11-28 09:09:44.889289976 +0000
++++ ./src/key_call.c 2014-11-28 09:09:44.890289976 +0000
+@@ -30,7 +30,9 @@
+ */
+
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * key_call.c, Interface to keyserver
+--- ./src/svc_simple.c.orig 2014-11-28 09:09:44.874289976 +0000
++++ ./src/svc_simple.c 2014-11-28 09:09:44.875289976 +0000
+@@ -29,7 +29,9 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * svc_simple.c
+--- ./src/mt_misc.c.orig 2014-11-28 09:09:44.870289976 +0000
++++ ./src/mt_misc.c 2014-11-28 09:09:44.871289976 +0000
+@@ -1,5 +1,7 @@
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <pthread.h>
+ #include <reentrant.h>
+ #include <rpc/rpc.h>
+--- ./src/authunix_prot.c.orig 2014-11-28 09:09:44.885289976 +0000
++++ ./src/authunix_prot.c 2014-11-28 09:09:44.885289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * authunix_prot.c
+--- ./src/des_soft.c.orig 2014-11-28 09:09:44.851289976 +0000
++++ ./src/des_soft.c 2014-11-28 09:09:44.851289976 +0000
+@@ -1,4 +1,6 @@
+-//#include <sys/cdefs.h>
++//#ifdef __GLIBC__
++#include <sys/cdefs.h>
++#endif
+
+ /*
+ * Copyright (c) 2009, Sun Microsystems, Inc.
+--- ./src/rpcdname.c.orig 2014-11-28 09:09:44.850289976 +0000
++++ ./src/rpcdname.c 2014-11-28 09:09:44.850289976 +0000
+@@ -25,7 +25,9 @@
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * rpcdname.c
+--- ./src/getnetpath.c.orig 2014-11-28 09:09:44.884289976 +0000
++++ ./src/getnetpath.c 2014-11-28 09:09:44.884289976 +0000
+@@ -25,13 +25,17 @@
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * Copyright (c) 1989 by Sun Microsystems, Inc.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+--- ./src/svc_dg.c.orig 2014-11-28 09:09:44.852289976 +0000
++++ ./src/svc_dg.c 2014-11-28 09:09:44.853289976 +0000
+@@ -31,7 +31,9 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * svc_dg.c, Server side for connectionless RPC.
+--- ./src/rpc_com.h.orig 2014-11-28 09:09:44.845289976 +0000
++++ ./src/rpc_com.h 2014-11-28 09:09:44.846289976 +0000
+@@ -40,7 +40,9 @@
+ #ifndef _TIRPC_RPCCOM_H
+ #define _TIRPC_RPCCOM_H
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
+
+--- ./src/pmap_getmaps.c.orig 2014-11-28 09:09:44.891289976 +0000
++++ ./src/pmap_getmaps.c 2014-11-28 09:09:44.892289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * pmap_getmap.c
+--- ./src/pmap_clnt.c.orig 2014-11-28 09:09:44.869289976 +0000
++++ ./src/pmap_clnt.c 2014-11-28 09:09:44.870289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * pmap_clnt.c
+--- ./src/bindresvport.c.orig 2014-11-28 09:09:44.848289976 +0000
++++ ./src/bindresvport.c 2014-11-28 09:09:44.849289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * Copyright (c) 1987 by Sun Microsystems, Inc.
+--- ./src/xdr_rec.c.orig 2014-11-28 09:09:44.866289976 +0000
++++ ./src/xdr_rec.c 2014-11-28 09:09:44.868289976 +0000
+@@ -27,8 +27,12 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking"
+--- ./src/clnt_perror.c.orig 2014-11-28 09:09:44.854289976 +0000
++++ ./src/clnt_perror.c 2014-11-28 09:09:44.855289976 +0000
+@@ -27,7 +27,9 @@
+ */
+
+ /*
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ */
+ /*
+ * clnt_perror.c
+--- ./src/key_prot_xdr.c.orig 2014-11-28 09:09:44.888289976 +0000
++++ ./src/key_prot_xdr.c 2014-11-28 09:09:44.889289976 +0000
+@@ -33,7 +33,9 @@
+ */
+ /* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * Compiled from key_prot.x using rpcgen.
+--- ./src/getnetconfig.c.orig 2014-11-28 09:09:44.856289976 +0000
++++ ./src/getnetconfig.c 2014-11-28 09:09:44.858289976 +0000
+@@ -32,7 +32,9 @@
+
+ #include <pthread.h>
+ #include <reentrant.h>
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <stdio.h>
+ #include <errno.h>
+ #include <netconfig.h>
+--- ./src/getpublickey.c.orig 2014-11-28 09:09:44.844289976 +0000
++++ ./src/getpublickey.c 2014-11-28 09:09:44.845289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+ /*
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ */
+
+ /*
+--- ./src/clnt_simple.c.orig 2014-11-28 09:09:44.881289976 +0000
++++ ./src/clnt_simple.c 2014-11-28 09:09:44.882289976 +0000
+@@ -29,7 +29,9 @@
+ * Copyright (c) 1986-1991 by Sun Microsystems Inc.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * clnt_simple.c
+--- ./src/auth_des.c.orig 2014-11-28 09:09:44.872289976 +0000
++++ ./src/auth_des.c 2014-11-28 09:09:44.874289976 +0000
+@@ -38,7 +38,9 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+ #include <rpc/des_crypt.h>
+ #include <syslog.h>
+ #include <rpc/types.h>
+@@ -52,7 +54,9 @@
+
+ #if defined(LIBC_SCCS) && !defined(lint)
+ #endif
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ #include "debug.h"
+
+--- ./src/xdr.c.orig 2014-11-28 09:09:44.861289976 +0000
++++ ./src/xdr.c 2014-11-28 09:09:44.863289976 +0000
+@@ -26,7 +26,9 @@
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#ifdef __GLIBC__
+ #include <sys/cdefs.h>
++#endif
+
+ /*
+ * xdr.c, Generic XDR routines implementation.
diff --git a/net-libs/libtirpc/files/0004-fix_DECLS.patch b/net-libs/libtirpc/files/0004-fix_DECLS.patch
new file mode 100644
index 00000000..86abf77a
--- /dev/null
+++ b/net-libs/libtirpc/files/0004-fix_DECLS.patch
@@ -0,0 +1,1226 @@
+--- ./tirpc/rpc/xdr.h.orig 2014-11-28 09:16:53.990289976 +0000
++++ ./tirpc/rpc/xdr.h 2014-11-28 09:16:53.991289976 +0000
+@@ -289,7 +289,11 @@ struct xdr_discrim {
+ /*
+ * These are the "generic" xdr routines.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_void(void);
+ extern bool_t xdr_int(XDR *, int *);
+ extern bool_t xdr_u_int(XDR *, u_int *);
+@@ -332,7 +336,11 @@ extern bool_t xdr_hyper(XDR *, quad_t *)
+ extern bool_t xdr_u_hyper(XDR *, u_quad_t *);
+ extern bool_t xdr_longlong_t(XDR *, quad_t *);
+ extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Common opaque bytes objects used by many rpc protocols;
+@@ -350,7 +358,11 @@ extern bool_t xdr_netobj(XDR *, struct
+ * These are the public routines for the various implementations of
+ * xdr streams.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ /* XDR using memory buffers */
+ extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op);
+
+@@ -371,6 +383,10 @@ extern bool_t xdrrec_skiprecord(XDR *);
+ /* true if no more input */
+ extern bool_t xdrrec_eof(XDR *);
+ extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_TIRPC_XDR_H */
+--- ./tirpc/rpc/auth_des.h.orig 2014-11-28 09:16:53.994289976 +0000
++++ ./tirpc/rpc/auth_des.h 2014-11-28 09:16:53.995289976 +0000
+@@ -114,17 +114,33 @@ struct authdes_verf {
+ * Map a des credential into a unix cred.
+ *
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
+ extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
+ extern int rtime(dev_t, struct netbuf *, int, struct timeval *,
+ struct timeval *);
+ extern void kgetnetname(char *);
+ extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* ndef _TI_AUTH_DES_ */
+--- ./tirpc/rpc/pmap_prot.h.orig 2014-11-28 09:16:53.988289976 +0000
++++ ./tirpc/rpc/pmap_prot.h 2014-11-28 09:16:53.989289976 +0000
+@@ -99,10 +99,18 @@ struct pmaplist {
+ struct pmaplist *pml_next;
+ };
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_pmap(XDR *, struct pmap *);
+ extern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
+ extern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_PMAP_PROT_H */
+--- ./tirpc/rpc/auth.h.orig 2014-11-28 09:16:53.982289976 +0000
++++ ./tirpc/rpc/auth.h 2014-11-28 09:16:53.983289976 +0000
+@@ -166,9 +166,17 @@ union des_block {
+ char c[8];
+ };
+ typedef union des_block des_block;
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_des_block(XDR *, des_block *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Authentication info. Opaque to client.
+@@ -279,9 +287,17 @@ auth_put(AUTH *auth)
+ xfunc, xwhere))
+
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern struct opaque_auth _null_auth;
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Any style authentication. These routines can be used by any
+@@ -302,11 +318,19 @@ int authany_wrap(void), authany_unwrap(v
+ * int len;
+ * int *aup_gids;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *);
+ extern AUTH *authunix_create_default(void); /* takes no parameters */
+ extern AUTH *authnone_create(void); /* takes no parameters */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ /*
+ * DES style authentication
+ * AUTH *authsecdes_create(servername, window, timehost, ckey)
+@@ -315,15 +339,31 @@ __END_DECLS
+ * const char *timehost; - optional hostname to sync with
+ * des_block *ckey; - optional conversation key to use
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *);
+ extern AUTH *authdes_seccreate (const char *, const u_int, const char *,
+ const des_block *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip))
+ #define authsys_create_default() authunix_create_default()
+@@ -331,36 +371,60 @@ __END_DECLS
+ /*
+ * Netname manipulation routines.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int getnetname(char *);
+ extern int host2netname(char *, const char *, const char *);
+ extern int user2netname(char *, const uid_t, const char *);
+ extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *);
+ extern int netname2host(char *, char *, const int);
+ extern void passwd2des ( char *, char * );
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ *
+ * These routines interface to the keyserv daemon
+ *
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int key_decryptsession(const char *, des_block *);
+ extern int key_encryptsession(const char *, des_block *);
+ extern int key_gendes(des_block *);
+ extern int key_setsecret(const char *);
+ extern int key_secretkey_is_set(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Publickey routines.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int getpublickey (const char *, char *);
+ extern int getpublicandprivatekey (char *, char *);
+ extern int getsecretkey (char *, char *, char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #ifdef KERBEROS
+ /*
+@@ -373,10 +437,18 @@ __END_DECLS
+ * const char *timehost; - optional hostname to sync with
+ * int *status; - kerberos status returned
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern AUTH *authkerb_seccreate(const char *, const char *, const char *,
+ const u_int, const char *, int *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Map a kerberos credential into a unix cred.
+@@ -389,20 +461,36 @@ __END_DECLS
+ * int *groups;
+ *
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *,
+ short *, int * */);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ #endif /* KERBEROS */
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ struct svc_req;
+ struct rpc_msg;
+ enum auth_stat _svcauth_none (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *);
+ enum auth_stat _svcauth_gss (struct svc_req *, struct rpc_msg *, bool_t *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #define AUTH_NONE 0 /* no authentication */
+ #define AUTH_NULL 0 /* backward compatibility */
+--- ./tirpc/rpc/svc.h.orig 2014-11-28 09:16:53.992289976 +0000
++++ ./tirpc/rpc/svc.h 2014-11-28 09:16:53.993289976 +0000
+@@ -202,11 +202,19 @@ struct svc_req {
+ * const struct netconfig *nconf;
+ */
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t svc_reg(SVCXPRT *, const rpcprog_t, const rpcvers_t,
+ void (*)(struct svc_req *, SVCXPRT *),
+ const struct netconfig *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Service un-registration
+@@ -216,9 +224,17 @@ __END_DECLS
+ * const rpcvers_t vers;
+ */
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void svc_unreg(const rpcprog_t, const rpcvers_t);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Transport registration.
+@@ -226,9 +242,17 @@ __END_DECLS
+ * xprt_register(xprt)
+ * SVCXPRT *xprt;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void xprt_register(SVCXPRT *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Transport un-register
+@@ -236,9 +260,17 @@ __END_DECLS
+ * xprt_unregister(xprt)
+ * SVCXPRT *xprt;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void xprt_unregister(SVCXPRT *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+@@ -267,7 +299,11 @@ __END_DECLS
+ * deadlock the caller and server processes!
+ */
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t svc_sendreply(SVCXPRT *, xdrproc_t, void *);
+ extern void svcerr_decode(SVCXPRT *);
+ extern void svcerr_weakauth(SVCXPRT *);
+@@ -279,7 +315,11 @@ extern void svcerr_systemerr(SVCXPRT *);
+ extern int rpc_reg(rpcprog_t, rpcvers_t, rpcproc_t,
+ char *(*)(char *), xdrproc_t, xdrproc_t,
+ char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Lowest level dispatching -OR- who owns this process anyway.
+@@ -308,11 +348,23 @@ extern int svc_fds;
+ * a small program implemented by the svc_rpc implementation itself;
+ * also see clnt.h for protocol numbers.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void rpctest_service(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void svc_getreq(int);
+ extern void svc_getreqset(fd_set *);
+ extern void svc_getreq_common(int);
+@@ -321,7 +373,11 @@ extern void svc_getreq_poll(struct pollf
+
+ extern void svc_run(void);
+ extern void svc_exit(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Socket to use on svcxxx_create call to get default socket
+@@ -333,7 +389,11 @@ __END_DECLS
+ * These are the existing service side transport implementations
+ */
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ /*
+ * Transport independent svc_create routine.
+ */
+@@ -429,7 +489,11 @@ int svc_dg_enablecache(SVCXPRT *, const
+
+ int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /* for backward compatibility */
+--- ./tirpc/rpc/rpc.h.orig 2014-11-28 09:16:53.994289976 +0000
++++ ./tirpc/rpc/rpc.h 2014-11-28 09:16:53.994289976 +0000
+@@ -79,7 +79,11 @@
+ #define UDPMSGSIZE 8800
+ #endif
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern int get_myaddress(struct sockaddr_in *);
+ extern int bindresvport(int, struct sockaddr_in *) __THROW;
+ extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
+@@ -93,18 +97,30 @@ struct netbuf *uaddr2taddr(const struct
+
+ struct sockaddr;
+ extern int bindresvport_sa(int, struct sockaddr *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * The following are not exported interfaces, they are for internal library
+ * and rpcbind use only. Do not use, they may change without notice.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ int __rpc_nconf2fd(const struct netconfig *);
+ int __rpc_nconf2fd_flags(const struct netconfig *, int);
+ int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
+ int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);
+ u_int __rpc_get_t_size(int, int, int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_RPC_H */
+--- ./tirpc/rpc/svc_soc.h.orig 2014-11-28 09:16:53.998289976 +0000
++++ ./tirpc/rpc/svc_soc.h 2014-11-28 09:16:53.999289976 +0000
+@@ -66,10 +66,18 @@
+ * void (*dispatch)();
+ * int protocol; like TCP or UDP, zero means do not register
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t svc_register(SVCXPRT *, u_long, u_long,
+ void (*)(struct svc_req *, SVCXPRT *), int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Service un-registration
+@@ -78,44 +86,84 @@ __END_DECLS
+ * u_long prog;
+ * u_long vers;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void svc_unregister(u_long, u_long);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+ * Memory based rpc for testing and timing.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svcraw_create(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+ * Udp based rpc.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svcudp_create(int);
+ extern SVCXPRT *svcudp_bufcreate(int, u_int, u_int);
+ extern int svcudp_enablecache(SVCXPRT *, u_long);
+ extern SVCXPRT *svcudp6_create(int);
+ extern SVCXPRT *svcudp6_bufcreate(int, u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+ * Tcp based rpc.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svctcp_create(int, u_int, u_int);
+ extern SVCXPRT *svctcp6_create(int, u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Fd based rpc.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern SVCXPRT *svcfd_create(int, u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_SVC_SOC_H */
+--- ./tirpc/rpc/clnt_soc.h.orig 2014-11-28 09:16:53.976289976 +0000
++++ ./tirpc/rpc/clnt_soc.h 2014-11-28 09:16:53.977289976 +0000
+@@ -63,27 +63,51 @@
+ * u_int sendsz;
+ * u_int recvsz;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clnttcp_create(struct sockaddr_in *, u_long, u_long, int *,
+ u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Raw (memory) rpc.
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clntraw_create(u_long, u_long);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+ IPv6 socket version
+ */
+ #ifdef INET6
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clnttcp6_create(struct sockaddr_in6 *, u_long, u_long, int *,
+ u_int, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ #endif
+
+ /*
+@@ -107,7 +131,11 @@ __END_DECLS
+ * u_int sendsz;
+ * u_int recvsz;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clntudp_create(struct sockaddr_in *, u_long, u_long,
+ struct timeval, int *);
+ extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
+@@ -118,7 +146,11 @@ extern CLIENT *clntudp6_create(struct so
+ extern CLIENT *clntudp6_bufcreate(struct sockaddr_in6 *, u_long, u_long,
+ struct timeval, int *, u_int, u_int);
+ #endif
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ #endif /* _RPC_CLNT_SOC_H */
+--- ./tirpc/rpc/rpc_com.h.orig 2014-11-28 09:16:53.977289976 +0000
++++ ./tirpc/rpc/rpc_com.h 2014-11-28 09:16:53.978289976 +0000
+@@ -57,7 +57,11 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+ (u_int32_t)(now)->tv_usec)
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern int _rpc_dtablesize(void);
+@@ -79,6 +83,10 @@ bool_t rpc_control(int,void *);
+
+ char *_get_next_token(char *, int);
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* _RPC_RPCCOM_H */
+--- ./tirpc/rpc/auth_unix.h.orig 2014-11-28 09:16:53.998289976 +0000
++++ ./tirpc/rpc/auth_unix.h 2014-11-28 09:16:53.998289976 +0000
+@@ -69,9 +69,17 @@ struct authunix_parms {
+
+ #define authsys_parms authunix_parms
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_authunix_parms(XDR *, struct authunix_parms *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * If a response verifier has flavor AUTH_SHORT,
+--- ./tirpc/rpc/pmap_rmt.h.orig 2014-11-28 09:16:53.986289976 +0000
++++ ./tirpc/rpc/pmap_rmt.h 2014-11-28 09:16:53.986289976 +0000
+@@ -58,9 +58,17 @@ struct rmtcallres {
+ xdrproc_t xdr_results;
+ };
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
+ extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_PMAP_RMT_H */
+--- ./tirpc/rpc/des_crypt.h.orig 2014-11-28 09:16:53.987289976 +0000
++++ ./tirpc/rpc/des_crypt.h 2014-11-28 09:16:53.988289976 +0000
+@@ -85,23 +85,47 @@
+ /*
+ * Cipher Block Chaining mode
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ int cbc_crypt( char *, char *, unsigned int, unsigned int, char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Electronic Code Book mode
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ int ecb_crypt( char *, char *, unsigned int, unsigned int );
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Set des parity for a key.
+ * DES parity is odd and in the low bit of each byte
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ void des_setparity( char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* _DES_DES_CRYPT_H */
+--- ./tirpc/rpc/rpcb_clnt.h.orig 2014-11-28 09:16:53.979289976 +0000
++++ ./tirpc/rpc/rpcb_clnt.h 2014-11-28 09:16:53.979289976 +0000
+@@ -59,7 +59,11 @@
+
+ #include <rpc/types.h>
+ #include <rpc/rpcb_prot.h>
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
+ const struct netconfig *, const struct netbuf *);
+ extern bool_t rpcb_unset(const rpcprog_t, const rpcvers_t,
+@@ -78,6 +82,10 @@ extern bool_t rpcb_getaddr(const rpcprog
+ extern bool_t rpcb_gettime(const char *, time_t *);
+ extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
+ extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_RPCB_CLNT_H */
+--- ./tirpc/rpc/clnt.h.orig 2014-11-28 09:16:53.984289976 +0000
++++ ./tirpc/rpc/clnt.h 2014-11-28 09:16:53.985289976 +0000
+@@ -269,7 +269,11 @@ struct rpc_timers {
+ * Generic client creation routine. Supported protocols are those that
+ * belong to the nettype namespace (/etc/netconfig).
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern CLIENT *clnt_create(const char *, const rpcprog_t, const rpcvers_t,
+ const char *);
+ /*
+@@ -416,32 +420,60 @@ extern CLIENT *clnt_dg_create(const int,
+ */
+ extern CLIENT *clnt_raw_create(rpcprog_t, rpcvers_t);
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+ * Print why creation failed
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void clnt_pcreateerror(const char *); /* stderr */
+ extern char *clnt_spcreateerror(const char *); /* string */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Like clnt_perror(), but is more verbose in its output
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void clnt_perrno(enum clnt_stat); /* stderr */
+ extern char *clnt_sperrno(enum clnt_stat); /* string */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * Print an English error message, given the client error code
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void clnt_perror(CLIENT *, const char *); /* stderr */
+ extern char *clnt_sperror(CLIENT *, const char *); /* string */
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+
+ /*
+@@ -452,9 +484,17 @@ struct rpc_createerr {
+ struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
+ };
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern struct rpc_createerr *__rpc_createerr(void);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+ #define get_rpc_createerr() (*(__rpc_createerr()))
+ #define rpc_createerr (*(__rpc_createerr()))
+
+@@ -471,12 +511,20 @@ __END_DECLS
+ * char *out;
+ * const char *nettype;
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern enum clnt_stat rpc_call(const char *, const rpcprog_t,
+ const rpcvers_t, const rpcproc_t,
+ const xdrproc_t, const char *,
+ const xdrproc_t, char *, const char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /*
+ * RPC broadcast interface
+@@ -524,7 +572,11 @@ __END_DECLS
+
+ typedef bool_t (*resultproc_t)(caddr_t, ...);
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern enum clnt_stat rpc_broadcast(const rpcprog_t, const rpcvers_t,
+ const rpcproc_t, const xdrproc_t,
+ caddr_t, const xdrproc_t, caddr_t,
+@@ -534,7 +586,11 @@ extern enum clnt_stat rpc_broadcast_exp(
+ caddr_t, const xdrproc_t, caddr_t,
+ const resultproc_t, const int,
+ const int, const char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ /* For backward compatibility */
+ #include <rpc/clnt_soc.h>
+--- ./tirpc/rpc/rpcent.h.orig 2014-11-28 09:16:53.996289976 +0000
++++ ./tirpc/rpc/rpcent.h 2014-11-28 09:16:53.996289976 +0000
+@@ -44,7 +44,11 @@
+ /* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */
+ /* @(#)rpcent.h 1.1 88/12/06 SMI */
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+
+ /* These are defined in /usr/include/rpc/netdb.h */
+ #if 0
+@@ -62,6 +66,10 @@ extern struct rpcent *getrpcent(void);
+
+ extern void setrpcent(int) __THROW;
+ extern void endrpcent(void) __THROW;
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_CENT_H */
+--- ./tirpc/rpc/pmap_clnt.h.orig 2014-11-28 09:16:53.980289976 +0000
++++ ./tirpc/rpc/pmap_clnt.h 2014-11-28 09:16:53.980289976 +0000
+@@ -67,7 +67,11 @@
+ #include <sys/cdefs.h>
+ #endif
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern bool_t pmap_set(u_long, u_long, int, int);
+ extern bool_t pmap_unset(u_long, u_long);
+ extern struct pmaplist *pmap_getmaps(struct sockaddr_in *);
+@@ -82,6 +86,10 @@ extern enum clnt_stat clnt_broadcast(u_l
+ resultproc_t);
+ extern u_short pmap_getport(struct sockaddr_in *,
+ u_long, u_long, u_int);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_PMAP_CLNT_H_ */
+--- ./tirpc/rpc/auth_gss.h.orig 2014-11-28 09:16:53.989289976 +0000
++++ ./tirpc/rpc/auth_gss.h 2014-11-28 09:16:53.990289976 +0000
+@@ -104,7 +104,11 @@ struct rpc_gss_init_res {
+ #define MAXSEQ 0x80000000
+
+ /* Prototypes. */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ bool_t xdr_rpc_gss_cred __P((XDR *xdrs, struct rpc_gss_cred *p));
+ bool_t xdr_rpc_gss_init_args __P((XDR *xdrs, gss_buffer_desc *p));
+ bool_t xdr_rpc_gss_init_res __P((XDR *xdrs, struct rpc_gss_init_res *p));
+@@ -126,6 +130,10 @@ void gss_log_status __P((char *m, OM_ui
+ OM_uint32 minor));
+ void gss_log_hexdump __P((const u_char *buf, int len, int offset));
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_TIRPC_AUTH_GSS_H */
+--- ./tirpc/rpc/rpc_msg.h.orig 2014-11-28 09:16:53.996289976 +0000
++++ ./tirpc/rpc/rpc_msg.h 2014-11-28 09:16:53.997289976 +0000
+@@ -161,7 +161,11 @@ struct rpc_msg {
+ #define acpted_rply ru.RM_rmb.ru.RP_ar
+ #define rjcted_rply ru.RM_rmb.ru.RP_dr
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ /*
+ * XDR routine to handle a rpc message.
+ * xdr_callmsg(xdrs, cmsg)
+@@ -210,6 +214,10 @@ extern bool_t xdr_rejected_reply(XDR *,
+ * struct rpc_err *error;
+ */
+ extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_TIRPC_RPC_MSG_H */
+--- ./tirpc/rpc/nettype.h.orig 2014-11-28 09:16:53.981289976 +0000
++++ ./tirpc/rpc/nettype.h 2014-11-28 09:16:53.982289976 +0000
+@@ -53,11 +53,19 @@
+ #define _RPC_TCP 7
+ #define _RPC_UDP 8
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern void *__rpc_setconf(const char *);
+ extern void __rpc_endconf(void *);
+ extern struct netconfig *__rpc_getconf(void *);
+ extern struct netconfig *__rpc_getconfip(const char *);
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_TIRPC_NETTYPE_H */
+--- ./tirpc/rpc/svc_auth.h.orig 2014-11-28 09:16:53.986289976 +0000
++++ ./tirpc/rpc/svc_auth.h 2014-11-28 09:16:53.987289976 +0000
+@@ -65,13 +65,21 @@ typedef struct SVCAUTH {
+ /*
+ * Server side authenticator
+ */
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern enum auth_stat _gss_authenticate(struct svc_req *, struct rpc_msg *,
+ bool_t *);
+ extern enum auth_stat _authenticate(struct svc_req *, struct rpc_msg *);
+ extern int svc_auth_reg(int, enum auth_stat (*)(struct svc_req *,
+ struct rpc_msg *));
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* !_RPC_SVC_AUTH_H */
+--- ./tirpc/rpcsvc/nis.h.orig 2014-11-28 09:16:54.001289976 +0000
++++ ./tirpc/rpcsvc/nis.h 2014-11-28 09:16:54.002289976 +0000
+@@ -36,7 +36,11 @@
+ #include <rpc/rpc.h>
+ #include <rpcsvc/nis_tags.h>
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+
+ /*
+ * nis.h
+@@ -611,6 +615,10 @@ extern nis_error * nis_rmdir_3_svc (nis
+ extern nis_error * nis_updkeys_3 (nis_name *, CLIENT *) __THROW;
+ extern nis_error * nis_updkeys_3_svc (nis_name *, struct svc_req *) __THROW;
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* ! _RPCSVC_NIS_H */
+--- ./tirpc/rpcsvc/nislib.h.orig 2014-11-28 09:16:53.999289976 +0000
++++ ./tirpc/rpcsvc/nislib.h 2014-11-28 09:16:54.000289976 +0000
+@@ -23,7 +23,11 @@
+
+ #include <features.h>
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+
+ typedef const char *const_nis_name;
+
+@@ -283,6 +287,10 @@ extern nis_error __nisfind_server (const
+
+ #endif
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* __RPCSVC_NISLIB_H__ */
+--- ./tirpc/netconfig.h.orig 2014-11-28 09:16:54.003289976 +0000
++++ ./tirpc/netconfig.h 2014-11-28 09:16:54.003289976 +0000
+@@ -74,7 +74,11 @@ typedef struct {
+ #define NC_UDP "udp"
+ #define NC_ICMP "icmp"
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+
+ extern void *setnetconfig (void);
+ extern struct netconfig *getnetconfig (void *);
+@@ -89,6 +93,10 @@ extern int endnetpath (void *);
+ extern void nc_perror (const char *);
+ extern char *nc_sperror (void);
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* _NETCONFIG_H_ */
+--- ./src/rpc_com.h.orig 2014-11-28 09:16:53.975289976 +0000
++++ ./src/rpc_com.h 2014-11-28 09:16:53.975289976 +0000
+@@ -56,7 +56,11 @@
+ #define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
+ (u_int32_t)(now)->tv_usec)
+
++#ifdef __GLIBC__
+ __BEGIN_DECLS
++#elif defined(__cplusplus)
++extern "C" {
++#endif
+ extern u_int __rpc_get_a_size(int);
+ extern int __rpc_dtbsize(void);
+ extern struct netconfig * __rpcgettp(int);
+@@ -92,6 +96,10 @@ void __xprt_set_raddr(SVCXPRT *, const s
+ SVCXPRT **__svc_xports;
+ int __svc_maxrec;
+
++#ifdef __GLIBC__
+ __END_DECLS
++#elif defined(__cplusplus)
++}
++#endif
+
+ #endif /* _TIRPC_RPCCOM_H */
diff --git a/net-libs/libtirpc/files/0005-fix_remaining_issues.patch b/net-libs/libtirpc/files/0005-fix_remaining_issues.patch
new file mode 100644
index 00000000..538e79e5
--- /dev/null
+++ b/net-libs/libtirpc/files/0005-fix_remaining_issues.patch
@@ -0,0 +1,14 @@
+--- ./tirpc/rpc/rpcent.h 2014-11-21 21:33:50.421928818 +0000
++++ ./tirpc/rpc/rpcent.h 2014-11-21 21:35:05.140928818 +0000
+@@ -64,6 +64,10 @@ extern struct rpcent *getrpcbynumber(int
+ extern struct rpcent *getrpcent(void);
+ #endif
+
++#ifndef __GLIBC__
++#define __THROW
++#endif
++
+ extern void setrpcent(int) __THROW;
+ extern void endrpcent(void) __THROW;
+ #ifdef __GLIBC__
+
diff --git a/net-libs/libtirpc/files/0006-fix_queue_h_include.patch b/net-libs/libtirpc/files/0006-fix_queue_h_include.patch
new file mode 100644
index 00000000..9db410c1
--- /dev/null
+++ b/net-libs/libtirpc/files/0006-fix_queue_h_include.patch
@@ -0,0 +1,44 @@
+--- src/clnt_bcast.c.orig 2014-11-28 09:31:22.462289976 +0000
++++ src/clnt_bcast.c 2014-11-28 09:34:06.588289976 +0000
+@@ -43,8 +43,41 @@
+ */
+ #include <sys/socket.h>
+ #include <sys/types.h>
++#ifdef __GLIBC__
+ #include <sys/queue.h>
++#else
++/*
++ * * Tail queue definitions.
++ * */
++#define _TAILQ_HEAD(name, type, qual) \
++struct name { \
++ qual type *tqh_first; /* first element */ \
++ qual type *qual *tqh_last; /* addr of last next element */ \
++}
++#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
+
++#define _TAILQ_ENTRY(type, qual) \
++struct { \
++ qual type *tqe_next; /* next element */ \
++ qual type *qual *tqe_prev; /* address of previous next element */\
++}
++#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
++/*
++ * * Tail queue functions.
++ * */
++#define TAILQ_INIT(head) do { \
++ (head)->tqh_first = NULL; \
++ (head)->tqh_last = &(head)->tqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_TAIL(head, elm, field) do { \
++ (elm)->field.tqe_next = NULL; \
++ (elm)->field.tqe_prev = (head)->tqh_last; \
++ *(head)->tqh_last = (elm); \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#endif
+ #include <net/if.h>
+ #include <netinet/in.h>
+ #include <ifaddrs.h>
diff --git a/net-libs/libtirpc/files/0007-no-des.patch b/net-libs/libtirpc/files/0007-no-des.patch
new file mode 100644
index 00000000..43472612
--- /dev/null
+++ b/net-libs/libtirpc/files/0007-no-des.patch
@@ -0,0 +1,29 @@
+--- libtirpc-0.2.5.orig/src/Makefile.am
++++ libtirpc-0.2.5/src/Makefile.am
+@@ -51,7 +51,7 @@
+ rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+ rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+ svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+- auth_time.c auth_des.c authdes_prot.c debug.c
++ auth_time.c debug.c
+
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c
+--- libtirpc-0.2.5.orig/src/rpc_soc.c
++++ libtirpc-0.2.5/src/rpc_soc.c
+@@ -520,6 +520,7 @@
+ (resultproc_t) rpc_wrap_bcast, "udp");
+ }
+
++#if 0
+ /*
+ * Create the client des authentication object. Obsoleted by
+ * authdes_seccreate().
+@@ -551,6 +552,7 @@
+ dummy = authdes_seccreate(servername, window, NULL, ckey);
+ return (dummy);
+ }
++#endif
+
+ /*
+ * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
diff --git a/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch b/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch
new file mode 100644
index 00000000..8006de39
--- /dev/null
+++ b/net-libs/libtirpc/files/libtirpc-0.2.5-stdarg.patch
@@ -0,0 +1,29 @@
+From d26607bade0893fe8652e1a0983f9fae59c64649 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 12 Aug 2014 03:11:41 -0400
+Subject: [PATCH libtirpc] include stdarg.h when used
+
+The debug.h header uses va_list but doesn't include stdarg.h which
+can lead to random build failures.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ src/debug.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/debug.h b/src/debug.h
+index afc8d57..c971ac3 100644
+--- a/src/debug.h
++++ b/src/debug.h
+@@ -21,6 +21,8 @@
+
+ #ifndef _DEBUG_H
+ #define _DEBUG_H
++
++#include <stdarg.h>
+ #include <syslog.h>
+
+ extern int libtirpc_debug_level;
+--
+2.0.0
+
diff --git a/net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild b/net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild
new file mode 100644
index 00000000..74341b7f
--- /dev/null
+++ b/net-libs/libtirpc/libtirpc-0.2.5-r99.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/libtirpc/libtirpc-0.2.5.ebuild,v 1.4 2014/12/30 18:09:41 maekke Exp $
+
+EAPI="4"
+
+inherit multilib-minimal toolchain-funcs autotools
+
+DESCRIPTION="Transport Independent RPC library (SunRPC replacement)"
+HOMEPAGE="http://libtirpc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2
+ mirror://gentoo/${PN}-glibc-nfs.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ipv6 kerberos static-libs"
+
+RDEPEND="kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+src_unpack() {
+ unpack ${A}
+ cp -r tirpc "${S}"/ || die
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-stdarg.patch
+ epatch "${FILESDIR}"/0001-Provide-getrpcbynumber-and-getrpcbyname-if-those-are.patch
+ epatch "${FILESDIR}"/0002-Misc-header-fixes.patch
+ epatch "${FILESDIR}"/0003-fix_cdefs_h_include.patch
+ epatch "${FILESDIR}"/0004-fix_DECLS.patch
+ epatch "${FILESDIR}"/0005-fix_remaining_issues.patch
+ epatch "${FILESDIR}"/0006-fix_queue_h_include.patch
+ epatch "${FILESDIR}"/0007-no-des.patch
+ eautoconf
+ eautoreconf
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable ipv6) \
+ $(use_enable kerberos gssapi) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install() {
+ default
+
+ # libtirpc replaces rpc support in glibc, so we need it in /
+ multilib_is_native_abi && gen_usr_ldscript -a tirpc
+}
+
+multilib_src_install_all() {
+ einstalldocs
+
+ insinto /etc
+ doins doc/netconfig
+
+ insinto /usr/include/tirpc
+ doins -r "${WORKDIR}"/tirpc/*
+
+ # makes sure that the linking order for nfs-utils is proper, as
+ # libtool would inject a libgssglue dependency in the list.
+ use static-libs || prune_libtool_files
+}
diff --git a/net-libs/libtirpc/metadata.xml b/net-libs/libtirpc/metadata.xml
new file mode 100644
index 00000000..ca66751d
--- /dev/null
+++ b/net-libs/libtirpc/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>net-fs</herd>
+</pkgmetadata>
diff --git a/net-libs/webkit-gtk/Manifest b/net-libs/webkit-gtk/Manifest
new file mode 100644
index 00000000..237fa68f
--- /dev/null
+++ b/net-libs/webkit-gtk/Manifest
@@ -0,0 +1,19 @@
+AUX gir-paxctl-lt-wrapper 1015 SHA256 cb11d91ed69c0fcce2ca6502b715d0f846dd6b062ce98441a70a5b2d2f1e042a SHA512 8a0e5ae51ab38f1e27e18cc7a7166267bdb8d9ea814874ddbfc97c5022c555d23cffce496219f0827f9eac32a55d5d95ac353eb56b4439f915a8c34683a1989d WHIRLPOOL 937e28e599f50535f6c8461acc10982719856c5b760d5d592d86819601bca5c032b405f215ff525c0278ce6563704c385cb942e3e21093112dce33d0b280a72c
+AUX webkit-gtk-1.11.90-gtk-docize-fix.patch 422 SHA256 4ee4f54be107bf947b39266c868671670cf759ca52879382dddcef66168b841c SHA512 bb56020948d255f1e9de06528cebd921820862593b865cc6a2ba9e1c0e734dc7bb9bcbd5c6e8a735e4ee3afd906b0d17bc43a4a262a98f28a467c649d9d15a3c WHIRLPOOL 5793470581e9971eb699f464e15153b9080225d6e44011c5af14dd379da4d3f8c614a1029f9b98bcaa5d5ba649d0b542e8796fc564baf31cddafe675df317818
+AUX webkit-gtk-1.6.1-darwin-quartz.patch 1516 SHA256 34ad751c33e868d85b41e06ecbd085b61a81c42bd52063bada52bc59b9e05a23 SHA512 ca8c80d06aa93c07d658ebf3433f5fdee9225616740a075f5606df87e3b90a83b2c492777a8e30255cdd4f11f889be789544ac1fc4a39056e1929a72720347ea WHIRLPOOL 558250f3cf6de4d511a26afb0aeacc04b7049b3d0499362d320c035acac20932d7c16f6ff99d83833498296e3a21b5e2bab985b1ee5fca709754b582195a0fd1
+AUX webkit-gtk-2.2.4-unittests-build.patch 2866 SHA256 714b4663c5ae3fc695ae13c40fbedfae358e7ae4b6c2743a35ddd5e96d213133 SHA512 e4ba2eafdc97a673d07d1e253832c30ec32b57e02eb5b61d7a1c327760630f39d24e215a7940bcd5cd9ca321cd4d71e433f231e12e8476ebda62abfa53573297 WHIRLPOOL 5252edd1a69769ef99724f1aaf7844e50a9db1c204984ee066c2dd116bc58814631ddd9bea6bf4822e4c1122ad230f50f87e5f037b00e35ee81299fb9adf7ab5
+AUX webkit-gtk-2.2.5-gir-nvidia-hangs.patch 4078 SHA256 843ed737a72f4cb705901efc05ba23442e1eceb21602c21a7593fa81e5b78a51 SHA512 3cb09602a87e7ab0f45ec1ae38f4ac51f2af86a871fe66373723ed1ce911984d5e9ba572b9d46601ac1f14ca8ecabcd21296b7c32cb21f2c1a1fe005248128d0 WHIRLPOOL aefa244dc599729c9fadb0faeb3f217d8b89b3be35ee2e19e86aa84ec2081d1ac35b81a29255992f9d952bf96386af701bf5a31c0f2aeb139b2044b1a0b394d1
+AUX webkit-gtk-2.2.5-hppa-platform.patch 530 SHA256 9a2b8311a89aa3500d19d2425c0f12f67c1457c67ecaa322511170461c4c6be7 SHA512 168d4f8acddf4a5fa6ddc3661ef3ec344824c854db036b279d38d526b6025cfbb8bbd15bc64ddd846876749823796ca7d05e4083cf35a744d46b00cfd5179ae1 WHIRLPOOL 5fc8070bf07eef199578db5802452b4443ee3a00b555325b430a3cfd923a0cbb827497907462cb224b07f2f1713d65a26af4adf24b3dca59cb9040dbd6227f92
+AUX webkit-gtk-2.2.5-ia64-malloc.patch 780 SHA256 4a057c94f3e83101dc48401897a2e9295106e395bdf2a7abcad8334afb26f22b SHA512 09d3287fb41dbe5f87e483874f9c81b0e5dbcc1eed709285aaa4f0232377ba19865491ed0f2e5a108bbc8f3d486bc6ab30f3c940cb68dc8515c1826b181051df WHIRLPOOL 4f97a8d74b95cdfe1d223391b93c6de0dbe0944fd9872bf81c5e1d357f677ca6650beb73ad44e50dd51dc4505807592b2caaee4010e271cbb6ada772c6b2a72d
+AUX webkit-gtk-2.2.5-ia64-platform.patch 331 SHA256 1ac5327f4f190bc4cbee9e62d4a2805879bbffd914ba75be17afd1aa245e6693 SHA512 dae3cde801d2d29c61abb64c00bf33ac1f7080dd2085cc9a1520c8606ef65538ccee9b1e4c4c16a3dba551acd035542f80b6e808ae5090bb883c85ecfa7ac36e WHIRLPOOL d9ca8172f685f515bb22a38d269e73f1e0fdcbf487bb83557f41649cd9ff5883d1fe0827aef3c753d975895252db3e3fa5eef3f72b43a6557492effd5db10072
+AUX webkit-gtk-2.2.5-sparc64-build.patch 1169 SHA256 fe6c7c345eb46a0f6856b5f1c547a65185b36c314d6f55a7980c640da0a53b56 SHA512 c59c6aed45ce237d68e58e5b03f46dc66ae4b73cd8a78f7eab9429ef3fe13882d0985da33f30fb425e0b5945298502ac35f9888e666c177fe2467f3f1ed35892 WHIRLPOOL f5a55fcaafc203352583e9ded39e79edca8e9d13cb1cf6e6574e905729fc8e9f92ccd75cd9309b66734f91830847164ebe9011c149e17c85af5549bd40b04f90
+AUX webkit-gtk-2.2.6-musl-remove-execinfo.patch 1205 SHA256 81a965fb74a00e1f3a806fb3aa7910317ee340ee606cc1e66672b1514d028d07 SHA512 7f39e6889f96d11e9e255a5f131d3bf43e9b8742f1a87dbafb626e2f11b7037f74ab2a42a7b0cb3f25278d0bf18a52baed2fe8c6c003acd9a9760fc18437faeb WHIRLPOOL 9151d8f0a9bae2fc06122d769906694984fc6afe9ffeb2bda11ee5f3bc64b757f5b19c7fe176adfa360a07e86d5735a5e4348c5cc513fcdef70c15c14dad58a9
+AUX webkit-gtk-2.4.1-ia64-malloc.patch 807 SHA256 8e01dee48af7e8e0d24729dd9b99e88b47125b5f91d07df29d579785e60d398d SHA512 d9e7a792861ff30137072eba6b5b80e7b37e47e7302bf1cd56027b5c30aea3fd215891f6272d85b80e98c826b3216d0701fe92f06b76e7d1fb860028d7a701c0 WHIRLPOOL 7cf769d9752cf800f72e76233ef299e2da8c13f427cd8d312d47d76282091f06ec32a618dda9d0bacedbc5dcf8aa4289ce9ce089cdbb90be28deeb75e449a925
+AUX webkit-gtk-2.4.1-musl-remove-execinfo.patch 1163 SHA256 88bf7b60857ce237ca07ef07dca3f16a72c20d2d2dc2b5dd8f5d0ccf78744843 SHA512 a7815a7894f4ad8d6f920ab8d7845bec80519b18ba70deff0e087d86bf2a800f4a341150d7a0e6973e1b11b591f34169cbd62b4dfc89765a82f4602e5e23bd05 WHIRLPOOL 4d176a7404605ebb1d5a4b195ca36a033f78ebba7019131bd5b16a04373124932b6536430270520ce8abe232e9978fadda937d93b82316dee4ebe9acc360ca5e
+DIST webkitgtk-2.2.6.tar.xz 9400300 SHA256 157ee7377ae97a27bb3b9bd2733d9353979632543c3d078b6578aeeb1319bf06 SHA512 9a90109ee8f591ae34ac2282e21aeee872292d82d1f66ebc69fb506c89a8ec952e373b35d1db7cc68307ea6ee90949c5c447ed206f14ec77374f8d68ab56021d WHIRLPOOL 47e5ffa17b53238f6282b17e2eb3e988dac7f295dd6757c097ea81d826770b1929d04d79f8a0e03abe5e30bfeb8626c42ad06c6a13aa0e9626120f590b55a931
+DIST webkitgtk-2.4.1.tar.xz 9836352 SHA256 6eed5d41ecdcfbafe3c2fbb0f0b79b9cda87a5ea0e7d0938afb6c6c82996e2f7 SHA512 59f7d053fce46efc47461e721f0bf75cdda1a89c2ad57e4866d2effd86995704eb63fcc797a9ea2b0764491c21cda28840ca388dd7d0c89447df35304ca835de WHIRLPOOL 2c9f940267b462731eed0d487338a7f6897e63c6420eedf2bd0cde0e272ed766fec979f6658618d4d535868ce782d7a1256ce5fd178ae621f03170067c6c96a9
+DIST webkitgtk-2.4.3.tar.xz 9841564 SHA256 9862c3eac1d12cc6e52cc39060a1284163950b304d534529a0dbcc5958a8ceac SHA512 fc4b36a3e11075325c79ced9f0d70a4b3daec43c5d3fff63ec843c513f04fd6cbe1b6472ea83e77f250f334f962a636a2423d8dbea4db0c767e823e2bd63f8d4 WHIRLPOOL dc9eb5211bbbea899379e688816ec978aa0f813ece777d0d9da08309eb2d647c662be66599a945bf743ff2946646e9e7d0554e0e9333fd10be425f05c7c8ffb6
+EBUILD webkit-gtk-2.2.6-r99.ebuild 8884 SHA256 f2b7d013665e1c1e3f63d3d4592c3d19663cae6a1618f916655650f34e12e2be SHA512 01df0abece0281db90e8bc774f9caa82d09576cf388d8c5e4145929b8786062270b57710e2e4bf2e1cde155dbe263a1293ee8dc21cb3547d760a297d0a20abcc WHIRLPOOL beeaabe0c403751fa91d82a57d6717480e6114fb98016482aca1ad1b57744355b16f1df84b3865eaf0f782cc5ddb0e68aa04f77d5f9bcd94a2e14d8c05c73288
+EBUILD webkit-gtk-2.4.1-r99.ebuild 9008 SHA256 ae749acd31433578eb2bd1527bc8be1a4755c8a1daa4abe60dea4e87e97a93f7 SHA512 af9e8b6482b1bfac11ee4e5127b7fdc7e0d916116cf946f704fb48e7c9866f80f53865ae0da2c4fe2732be88c408c966f84c030c95b07e7c20474ff98add8642 WHIRLPOOL 84025fff7b12420606b0a9e0a934c47b7f2f6252ad94289f6cc89130bfbda878a57d343421c2c82c6126a00789860c792a37f36240643904684095ce367939d0
+EBUILD webkit-gtk-2.4.3-r99.ebuild 9010 SHA256 1bf5f2c90b61448d375a343606ffc9da92360a1353090c8210c17a26036941ff SHA512 8c941c0e149903e5206803b7a8ad24c53f51c3091d5993f31735c129af08676a5f1dcbeee430c2d3e68c09390bbeac2690ff2fd6e0e5fa50c608e883da5719c8 WHIRLPOOL e76df6c5b7f6ba0212e81cbe870537a47d2cc43898aaa21e2b616fe6d39d281921ff087ca1b7a53a8a231b2abbfd2332306733d9ad3dc3c2a21db28035e20f79
+MISC metadata.xml 610 SHA256 23faf3368df312d51e2dd38d6e7695410deab694bc12558cbe9751067575df11 SHA512 ac78b2e8a719247f5294c045ead7731cd42fb7200ea5a6a450ac18abd3a79fc888045e2c7f98bf984dd2a9484fc352ebc06e6b1c7a0bdd75a65a825e71c09188 WHIRLPOOL f2c88de8a7889cd3cdbb66f498067f85a5e6ce0c7b3732299ad9373e39ac332abe5d3da93f8fbe1e5f63b44306f9def006a3e34349eaca12ee9fb3b7a7368ea1
diff --git a/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper b/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper
new file mode 100755
index 00000000..d4f270c2
--- /dev/null
+++ b/net-libs/webkit-gtk/files/gir-paxctl-lt-wrapper
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Wrapper for $(LIBTOOL) that performs PaX marking on the dumper binary
+# generated by g-ir-scanner.
+# PaX marking code stolen from pax-utils.eclass
+
+flags=${1//-}; shift
+
+echo ${LIBTOOL} "$@"
+${LIBTOOL} "$@"
+
+retval=$?
+
+files=$(find . -path "*tmp-introspect*/.libs/*")
+
+if type -p paxctl > /dev/null; then
+ echo "PT PaX marking -${flags} ${files}"
+ for f in ${files}; do
+ # First, try modifying the existing PAX_FLAGS header
+ paxctl -q${flags} "${f}" && continue
+ # Second, try stealing the (unused under PaX) PT_GNU_STACK header
+ paxctl -qc${flags} "${f}" && continue
+ # Third, try pulling the base down a page, to create space and
+ # insert a PT_GNU_STACK header (works on ET_EXEC)
+ paxctl -qC${flags} "${f}" && continue
+ done
+elif type -p scanelf > /dev/null; then
+ # Try scanelf, the Gentoo swiss-army knife ELF utility
+ # Currently this sets PT if it can, no option to control what it does.
+ echo "Fallback PaX marking -${flags} ${files}"
+ scanelf -Xxz ${flags} ${files}
+fi
+
+exit ${retval}
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch b/net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch
new file mode 100644
index 00000000..8f56ab22
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-1.11.90-gtk-docize-fix.patch
@@ -0,0 +1,10 @@
+--- configure.ac.old 2013-03-02 09:22:53.791750644 +0200
++++ configure.ac 2013-03-02 09:24:56.725213764 +0200
+@@ -24,6 +24,7 @@
+ m4_include([Source/autotools/SetupLibtool.m4])
+ m4_include([Source/autotools/ReadCommandLineArguments.m4])
+ m4_include([Source/autotools/FindDependencies.m4])
++GTK_DOC_CHECK([1.10])
+ m4_include([Source/autotools/SetupCompilerFlags.m4])
+ m4_include([Source/autotools/SetupAutoconfHeader.m4])
+
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch b/net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch
new file mode 100644
index 00000000..5ad357e9
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-1.6.1-darwin-quartz.patch
@@ -0,0 +1,67 @@
+Original from:
+http://trac.macports.org/browser/trunk/dports/www/webkit-gtk/files/patch-quartz-WebCore-plugins-gtk-gtkxtbin.c.diff?format=txt
+http://trac.macports.org/browser/trunk/dports/www/webkit-gtk/files/patch-quartz-WebCore-plugins-gtk-PluginViewGtk.cpp.diff?format=txt
+
+Adapted for 1.6.1
+
+--- Source/WebCore/plugins/gtk/PluginViewGtk.cpp
++++ Source/WebCore/plugins/gtk/PluginViewGtk.cpp
+@@ -70,6 +70,8 @@
+ #endif
+ #include <gtk/gtk.h>
+
++#undef XP_UNIX
++
+ #if defined(XP_UNIX)
+ #include "RefPtrCairo.h"
+ #include "gtk2xtbin.h"
+@@ -439,9 +441,9 @@
+ event->setDefaultHandled();
+ }
+
+-#if defined(XP_UNIX)
+ void PluginView::handleFocusInEvent()
+ {
++#if defined(XP_UNIX)
+ if (!m_isStarted || m_status != PluginStatusLoadedSuccessfully)
+ return;
+
+@@ -454,10 +456,12 @@
+ event.detail = NotifyDetailNone;
+
+ dispatchNPEvent(npEvent);
++#endif
+ }
+
+ void PluginView::handleFocusOutEvent()
+ {
++#if defined(XP_UNIX)
+ if (!m_isStarted || m_status != PluginStatusLoadedSuccessfully)
+ return;
+
+@@ -470,8 +474,8 @@
+ event.detail = NotifyDetailNone;
+
+ dispatchNPEvent(npEvent);
+-}
+ #endif
++}
+
+ void PluginView::setParent(ScrollView* parent)
+ {
+--- Source/WebCore/plugins/gtk/gtk2xtbin.c
++++ Source/WebCore/plugins/gtk/gtk2xtbin.c
+@@ -41,7 +41,7 @@
+ * The GtkXtBin widget allows for Xt toolkit code to be used
+ * inside a GTK application.
+ */
+-
++#if 0
+ #include "GtkVersioning.h"
+ #include "xembed.h"
+ #include "gtk2xtbin.h"
+@@ -966,3 +966,4 @@
+
+ return;
+ }
++#endif
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.4-unittests-build.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.4-unittests-build.patch
new file mode 100644
index 00000000..a6077b4a
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.4-unittests-build.patch
@@ -0,0 +1,103 @@
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Wed, 03 Feb 2014 23:47:39 +0100
+Subject: [PATCH] Build unittests on demand
+
+--- a/GNUmakefile.am 2013-11-27 23:52:56.148735433 +0100
++++ b/GNUmakefile.am 2013-11-27 23:51:25.551590806 +0100
+@@ -51,6 +51,9 @@
+ # Libraries and support components
+ bin_PROGRAMS :=
+ noinst_PROGRAMS :=
++check_PROGRAMS :=
++check_LTLIBRARIES :=
++check_DATA :=
+ libexec_PROGRAMS :=
+ noinst_DATA :=
+ noinst_HEADERS :=
+--- a/Tools/TestWebKitAPI/GNUmakefile.am 2014-02-03 23:44:52.534272572 +0100
++++ b/Tools/TestWebKitAPI/GNUmakefile.am 2014-02-03 23:45:41.711783299 +0100
+@@ -1,8 +1,8 @@
+-noinst_LTLIBRARIES += \
++check_LTLIBRARIES += \
+ Libraries/libTestWebKitAPIMain.la
+
+ if ENABLE_WEBKIT2
+-noinst_LTLIBRARIES += \
++check_LTLIBRARIES += \
+ Libraries/libTestWebKit2GtkAPI.la
+ endif
+
+@@ -111,14 +111,14 @@
+ Libraries_libTestWebKit2GtkAPI_la_CPPFLAGS = $(webkit2gtk_tests_cppflags)
+
+
+-noinst_PROGRAMS += \
++check_PROGRAMS += \
+ Programs/TestWebKitAPI/WTF/TestWTF \
+ Programs/TestWebKitAPI/JavaScriptCore/TestJavaScriptCore \
+ Programs/TestWebKitAPI/WebCore/TestWebCore \
+ Programs/TestWebKitAPI/WebCoreGtk/TestWebCoreGtk
+
+ if ENABLE_WEBKIT1
+-noinst_PROGRAMS += \
++check_PROGRAMS += \
+ Programs/TestWebKitAPI/WebKitGtk/testapplicationcache \
+ Programs/TestWebKitAPI/WebKitGtk/testcontextmenu \
+ Programs/TestWebKitAPI/WebKitGtk/testdomdocument \
+@@ -150,7 +150,7 @@
+ endif
+
+ if ENABLE_WEBKIT2
+-noinst_PROGRAMS += \
++check_PROGRAMS += \
+ Programs/TestWebKitAPI/WebKit2/TestWebKit2 \
+ Programs/TestWebKitAPI/WebKit2Gtk/InspectorTestServer \
+ Programs/TestWebKitAPI/WebKit2Gtk/TestAuthentication \
+@@ -179,7 +179,7 @@
+ Programs/TestWebKitAPI/WebKit2Gtk/TestWebViewEditor
+
+ if HAVE_ATSPI2
+-noinst_PROGRAMS += \
++check_PROGRAMS += \
+ Programs/TestWebKitAPI/WebKit2Gtk/AccessibilityTestServer \
+ Programs/TestWebKitAPI/WebKit2Gtk/TestWebKitAccessibility
+ endif
+@@ -627,7 +627,7 @@
+ Tools/TestWebKitAPI/Tests/WebKit2/WKURL.cpp
+
+ if ENABLE_WEBKIT2
+-noinst_LTLIBRARIES += \
++check_LTLIBRARIES += \
+ Libraries/libTestWebKitAPIInjectedBundle.la
+ endif # ENABLE_WEBKIT2
+
+@@ -684,7 +684,7 @@
+
+
+ if ENABLE_WEBKIT2
+-noinst_LTLIBRARIES += Libraries/WebExtensions/libWebExtensionTest.la
++check_LTLIBRARIES += Libraries/WebExtensions/libWebExtensionTest.la
+ endif
+
+ Libraries_WebExtensions_libWebExtensionTest_la_SOURCES = \
+@@ -711,7 +711,7 @@
+
+
+ if ENABLE_WEBKIT2
+-noinst_LTLIBRARIES += Libraries/WebExtensions/libWebProcessTest.la
++check_LTLIBRARIES += Libraries/WebExtensions/libWebProcessTest.la
+ endif
+
+ Libraries_WebExtensions_libWebProcessTest_la_SOURCES = \
+@@ -747,7 +747,7 @@
+ DISTCLEANFILES += \
+ Programs/TestWebKitAPI/WebKit2Gtk/resources/webkit2gtk-tests-resources.gresource
+
+-noinst_DATA += \
++check_DATA += \
+ Programs/TestWebKitAPI/WebKit2Gtk/resources/webkit2gtk-tests-resources.gresource
+
+
+--
+1.8.3.2
+
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-gir-nvidia-hangs.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-gir-nvidia-hangs.patch
new file mode 100644
index 00000000..854a1120
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-gir-nvidia-hangs.patch
@@ -0,0 +1,95 @@
+Description: deadlock in gobject introspection
+Bug-Dyson: http://osdyson.org/issues/161
+Bug-Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=463960
+Stack:
+25849: /home/pashev/packaging/webkitgtk/webkitgtk-2.0.4/build-2.0/tmp-introsp
+----------------- lwp# 1 / thread# 1 --------------------
+ fffffd7ffeeaf957 lwp_park (0, 0, 0)
+ fffffd7ffeea8036 mutex_lock_impl () + 156
+ fffffd7ffeea810b mutex_lock () + b
+ fffffd7ffee340fa _preexec_atfork_unload () + 3a
+ fffffd7ffee343ab _preexec_exit_handlers () + bb
+ fffffd7fff5ccf0d purge_exit_handlers () + 10d
+ fffffd7fff5cec18 remove_hdl () + ce8
+ fffffd7fff5c8895 dlclose_core () + c5
+ fffffd7fff5c88e5 dlclose_intn () + 15
+ fffffd7fff5c89bb dlclose_check () + 7b
+ fffffd7fff5c8a21 dlclose () + 41
+ fffffd7ffaa03c41 px_module_manager_load () + 191
+ fffffd7ffaa03cf6 px_module_manager_load_dir () + 66
+ fffffd7ffaa050d7 px_proxy_factory_new () + 107
+ fffffd7ffb201671 ???????? ()
+ fffffd7feca30eca g_type_create_instance () + 16a
+ fffffd7feca1597c ???????? ()
+ fffffd7feca17472 g_object_newv () + 792
+ fffffd7feca17aec g_object_new () + ec
+ fffffd7fece5d052 ???????? ()
+ fffffd7fece5d1d8 ???????? ()
+ fffffd7fc98659a5 ???????? ()
+ fffffd7feca173f6 g_object_newv () + 716
+ fffffd7feca17aec g_object_new () + ec
+ fffffd7fc986da24 soup_session_add_feature_by_type () + e4
+ fffffd7fc986fb43 ???????? ()
+ fffffd7feca17e00 g_object_set_valist () + 300
+ fffffd7feca186d7 g_object_set () + e7
+ fffffd7fc5724f87 WebCore::ResourceHandle::defaultSession() () + a7
+ fffffd7fc48da299 webkitExit() () + 9
+ fffffd7ffee33f56 _exithandle () + 66
+ fffffd7ffee1e191 exit () + 11
+ 00000000004086af ???????? ()
+ 000000000040724c _start () + 6c
+----------------- lwp# 2 / thread# 2 --------------------
+ fffffd7ffeeaf957 lwp_park (0, 0, 0)
+ fffffd7ffeea94bf cond_wait_queue () + 4f
+ fffffd7ffeea9b12 __cond_wait () + b2
+ fffffd7ffeea9b42 cond_wait () + 22
+ fffffd7ffeea9b79 pthread_cond_wait () + 9
+ fffffd7fc4eed04b WebCore::IconDatabase::syncThreadMainLoop() () + 12b
+ fffffd7fc4eed278 WebCore::IconDatabase::iconDatabaseSyncThread() () + 138
+ fffffd7fc3b2bc59 WTF::wtfThreadEntryPoint(void*) () + 19
+ fffffd7ffeeaf617 _thrp_setup () + 77
+ fffffd7ffeeaf910 _lwp_start ()
+----------------- lwp# 3 / thread# 3 --------------------
+ fffffd7ffeeaf957 lwp_park (0, 0, 0)
+ fffffd7ffeea8036 mutex_lock_impl () + 156
+ fffffd7ffeea810b mutex_lock () + b
+ fffffd7ffee33e17 atexit_locks () + 17
+ fffffd7ffee58ce9 libc_prepare_atfork () + 9
+ fffffd7ffee34533 _prefork_handler () + 33
+ fffffd7ffee9fc85 forkx () + 275
+ fffffd7ffee9fcab fork () + b
+ fffffd7fec68aacb ???????? ()
+ fffffd7fec68b2a7 g_spawn_sync () + 167
+ fffffd7fec68b994 g_spawn_command_line_sync () + 74
+ fffffd7feceb2748 ???????? ()
+ fffffd7feceb4019 g_dbus_address_get_for_bus_sync () + 2c9
+ fffffd7fecebd11e ???????? ()
+ fffffd7fecec4643 g_bus_get_sync () + 63
+ fffffd7ffc60700b ???????? ()
+ fffffd7ffc60714f ???????? ()
+ fffffd7fec648ad0 g_main_context_dispatch () + 130
+ fffffd7fec648e40 ???????? ()
+ fffffd7fec648f08 g_main_context_iteration () + 38
+ fffffd7ffc606f65 ???????? ()
+ fffffd7fec66d50d ???????? ()
+ fffffd7ffeeaf617 _thrp_setup () + 77
+ fffffd7ffeeaf910 _lwp_start ()
+Index: webkit/Source/WebKit/gtk/webkit/webkitglobals.cpp
+===================================================================
+--- webkit.orig/Source/WebKit/gtk/webkit/webkitglobals.cpp 2013-12-02 00:06:10.504150531 +0400
++++ webkit/Source/WebKit/gtk/webkit/webkitglobals.cpp 2013-12-03 14:08:05.956932011 +0400
+@@ -564,6 +564,14 @@
+
+ WebCore::SchemeRegistry::registerURLSchemeAsLocal("resource");
+
++ // http://osdyson.org/issues/161
++ // WebKitGTK FTBFS when building GObject introspection due to deadlock.
++ // When gobject introspection is done, a simple program call exit()
++ // exit() -> webkitExit() -> g_object_unref() -> webkit_get_default_session()
++ // -> ResourceHandle::defaultSession() => default session doesn't exist! AND
++ // we try to create it! Thus deadlock. So, create default session earlier:
++ (void) webkit_get_default_session();
++
+ atexit(webkitExit);
+ }
+
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch
new file mode 100644
index 00000000..8aee778c
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-hppa-platform.patch
@@ -0,0 +1,20 @@
+Index: webkitgtk/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkitgtk.orig/Source/WTF/wtf/Platform.h
++++ webkitgtk/Source/WTF/wtf/Platform.h
+@@ -72,6 +72,15 @@
+ #define WTF_CPU_BIG_ENDIAN 1
+ #endif
+
++/* CPU(HPPA) - HP PARISC */
++#if defined(__hppa__)
++#define WTF_CPU_HPPA 1
++#define WTF_CPU_BIG_ENDIAN 1
++#define ENABLE_JIT 0
++#define ENABLE_YARR_JIT 0
++#define ENABLE_ASSEMBLER 0
++#endif
++
+ /* CPU(IA64) - Itanium / IA-64 */
+ #if defined(__ia64__)
+ #define WTF_CPU_IA64 1
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-malloc.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-malloc.patch
new file mode 100644
index 00000000..5f0542c4
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-malloc.patch
@@ -0,0 +1,20 @@
+Description: Fix wide pointer issues on ia64 (closes: #642750).
+Author: Stephan Schreiber <info@fs-driver.org>
+Index: webkitgtk/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkitgtk.orig/Source/WTF/wtf/Platform.h
++++ webkitgtk/Source/WTF/wtf/Platform.h
+@@ -705,6 +705,13 @@
+ #define ENABLE_JIT 1
+ #endif
+
++/* FIXME: The fast malloc implementation is broken on Itanium / IA64 because
++ some memory barriers are missing in the thread-unsafe code around the
++ pagemap_cache_ object. */
++#if CPU(IA64) || CPU(IA64_32)
++#define USE_SYSTEM_MALLOC 1
++#endif
++
+ /* The JIT is enabled by default on all x86, x86-64, ARM & MIPS platforms. */
+ #if !defined(ENABLE_JIT) \
+ && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS)) \
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch
new file mode 100644
index 00000000..a63e9e82
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-ia64-platform.patch
@@ -0,0 +1,12 @@
+--- a/Source/WTF/wtf/Platform.h 2014-02-25 00:33:16.561606810 +0100
++++ b/Source/WTF/wtf/Platform.h 2014-02-25 00:49:52.895512955 +0100
+@@ -79,6 +79,9 @@
+ #if !defined(__LP64__)
+ #define WTF_CPU_IA64_32 1
+ #endif
++#define ENABLE_JIT 0
++#define ENABLE_YARR_JIT 0
++#define ENABLE_ASSEMBLER 0
+ #endif
+
+ /* CPU(MIPS) - MIPS 32-bit */
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-sparc64-build.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-sparc64-build.patch
new file mode 100644
index 00000000..691b5286
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.5-sparc64-build.patch
@@ -0,0 +1,23 @@
+$OpenBSD: patch-Source_WTF_wtf_Atomics_h,v 1.3 2013/10/20 09:07:57 landry Exp $
+
+https://bugs.webkit.org/show_bug.cgi?id=86835
+Fix build failure on sparc64 since 1.8.1, provide atomic{In,De}crement implems based on __sync_fetch_and_add builtin
+
+--- Source/WTF/wtf/Atomics.h.orig Sat Aug 3 18:10:38 2013
++++ Source/WTF/wtf/Atomics.h Sun Oct 20 11:06:14 2013
+@@ -112,6 +112,15 @@ inline int atomicDecrement(int volatile* addend) { ret
+ inline int64_t atomicIncrement(int64_t volatile* addend) { return __sync_add_and_fetch(addend, 1); }
+ inline int64_t atomicDecrement(int64_t volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
+
++#elif COMPILER(GCC) && CPU(SPARC64)
++#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1
++
++inline int atomicIncrement(int volatile* addend) { return __sync_fetch_and_add(addend, 1) + 1; }
++inline int atomicDecrement(int volatile* addend) { return __sync_fetch_and_add(addend, -1) - 1; }
++
++inline int64_t atomicIncrement(int64_t volatile* addend) { return __sync_fetch_and_add(addend, 1) + 1; }
++inline int64_t atomicDecrement(int64_t volatile* addend) { return __sync_fetch_and_add(addend, -1) - 1; }
++
+ #endif
+
+ #if OS(WINDOWS)
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.2.6-musl-remove-execinfo.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.2.6-musl-remove-execinfo.patch
new file mode 100644
index 00000000..bb120f60
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.2.6-musl-remove-execinfo.patch
@@ -0,0 +1,37 @@
+diff -Naur webkitgtk-2.2.6.orig/Source/WTF/wtf/Assertions.cpp webkitgtk-2.2.6/Source/WTF/wtf/Assertions.cpp
+--- webkitgtk-2.2.6.orig/Source/WTF/wtf/Assertions.cpp 2014-03-19 03:53:02.000000000 -0400
++++ webkitgtk-2.2.6/Source/WTF/wtf/Assertions.cpp 2014-06-18 08:33:19.280216672 -0400
+@@ -64,12 +64,6 @@
+ #include <windows.h>
+ #endif
+
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+-#include <cxxabi.h>
+-#include <dlfcn.h>
+-#include <execinfo.h>
+-#endif
+-
+ #if PLATFORM(BLACKBERRY)
+ #include <BlackBerryPlatformLog.h>
+ #endif
+@@ -242,9 +236,7 @@
+
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+- *size = backtrace(stack, *size);
+-#elif OS(WINDOWS) && !OS(WINCE)
++#if OS(WINDOWS) && !OS(WINCE)
+ // The CaptureStackBackTrace function is available in XP, but it is not defined
+ // in the Windows Server 2003 R2 Platform SDK. So, we'll grab the function
+ // through GetProcAddress.
+@@ -278,9 +270,6 @@
+
+ #if OS(DARWIN) || OS(LINUX)
+ # if PLATFORM(QT) || PLATFORM(GTK)
+-# if defined(__GLIBC__) && !defined(__UCLIBC__)
+-# define WTF_USE_BACKTRACE_SYMBOLS 1
+-# endif
+ # else
+ # define WTF_USE_DLADDR 1
+ # endif
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch
new file mode 100644
index 00000000..8c387ffe
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-ia64-malloc.patch
@@ -0,0 +1,20 @@
+Description: Fix wide pointer issues on ia64 (closes: #642750).
+Author: Stephan Schreiber <info@fs-driver.org>
+Index: webkitgtk/Source/WTF/wtf/Platform.h
+===================================================================
+--- webkitgtk.orig/Source/WTF/wtf/Platform.h
++++ webkitgtk/Source/WTF/wtf/Platform.h
+@@ -705,6 +705,13 @@
+ #define ENABLE_JIT 1
+ #endif
+
++/* FIXME: The fast malloc implementation is broken on Itanium / IA64 because
++ some memory barriers are missing in the thread-unsafe code around the
++ pagemap_cache_ object. */
++#if CPU(IA64) || CPU(IA64_32)
++#define USE_SYSTEM_MALLOC 1
++#endif
++
+ /* The JIT is enabled by default on all x86, x86-64, ARM & MIPS platforms except Win64. */
+ #if !defined(ENABLE_JIT) \
+ && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)) \
diff --git a/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-musl-remove-execinfo.patch b/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-musl-remove-execinfo.patch
new file mode 100644
index 00000000..a234f269
--- /dev/null
+++ b/net-libs/webkit-gtk/files/webkit-gtk-2.4.1-musl-remove-execinfo.patch
@@ -0,0 +1,37 @@
+diff -Naur webkitgtk-2.4.1.orig/Source/WTF/wtf/Assertions.cpp webkitgtk-2.4.1/Source/WTF/wtf/Assertions.cpp
+--- webkitgtk-2.4.1.orig/Source/WTF/wtf/Assertions.cpp 2014-04-14 02:40:45.000000000 -0400
++++ webkitgtk-2.4.1/Source/WTF/wtf/Assertions.cpp 2014-06-18 09:16:35.617334849 -0400
+@@ -63,12 +63,6 @@
+ #include <windows.h>
+ #endif
+
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+-#include <cxxabi.h>
+-#include <dlfcn.h>
+-#include <execinfo.h>
+-#endif
+-
+ extern "C" {
+
+ WTF_ATTRIBUTE_PRINTF(1, 0)
+@@ -233,9 +227,7 @@
+
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+- *size = backtrace(stack, *size);
+-#elif OS(WINDOWS) && !OS(WINCE)
++#if OS(WINDOWS) && !OS(WINCE)
+ // The CaptureStackBackTrace function is available in XP, but it is not defined
+ // in the Windows Server 2003 R2 Platform SDK. So, we'll grab the function
+ // through GetProcAddress.
+@@ -269,9 +261,6 @@
+
+ #if OS(DARWIN) || OS(LINUX)
+ # if PLATFORM(GTK)
+-# if defined(__GLIBC__) && !defined(__UCLIBC__)
+-# define WTF_USE_BACKTRACE_SYMBOLS 1
+-# endif
+ # else
+ # define WTF_USE_DLADDR 1
+ # endif
diff --git a/net-libs/webkit-gtk/metadata.xml b/net-libs/webkit-gtk/metadata.xml
new file mode 100644
index 00000000..b49dc036
--- /dev/null
+++ b/net-libs/webkit-gtk/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>gnome</herd>
+ <use>
+ <flag name="coverage">Enable code coverage support</flag>
+ <flag name='egl'>Enable EGL support.</flag>
+ <flag name="geoloc">Enable geolocation support through <pkg>app-misc/geoclue</pkg></flag>
+ <flag name='gles2'>Enable GLESv2 support.</flag>
+ <flag name="libsecret">Enable libsecret support to store login credentials</flag>
+ <flag name="webgl">Build support for the WebGL HTML API using <pkg>virtual/opengl</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/net-libs/webkit-gtk/webkit-gtk-2.2.6-r99.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.2.6-r99.ebuild
new file mode 100644
index 00000000..bb018bec
--- /dev/null
+++ b/net-libs/webkit-gtk/webkit-gtk-2.2.6-r99.ebuild
@@ -0,0 +1,271 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/webkit-gtk/webkit-gtk-2.2.6.ebuild,v 1.9 2014/04/21 10:30:20 ago Exp $
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_6,2_7} )
+GCONF_DEBUG="no"
+
+inherit autotools check-reqs eutils flag-o-matic gnome2 pax-utils python-any-r1 toolchain-funcs versionator virtualx
+
+MY_P="webkitgtk-${PV}"
+DESCRIPTION="Open source web browser engine"
+HOMEPAGE="http://www.webkitgtk.org/"
+SRC_URI="http://www.webkitgtk.org/releases/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2+ BSD"
+SLOT="3/29" # soname version
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="aqua coverage debug +egl +geoloc gles2 +gstreamer +introspection +jit libsecret +opengl spell +webgl"
+# bugs 372493, 416331
+REQUIRED_USE="
+ geoloc? ( introspection )
+ introspection? ( gstreamer )
+ gles2? ( egl )
+ webgl? ( ^^ ( gles2 opengl ) )
+ !webgl? ( ?? ( gles2 opengl ) )
+"
+
+# use sqlite, svg by default
+# Aqua support in gtk3 is untested
+# gtk2 is needed for plugin process support
+# gtk3-3.10 required for wayland
+RDEPEND="
+ dev-libs/libxml2:2
+ dev-libs/libxslt
+ media-libs/harfbuzz:=[icu(+)]
+ media-libs/libwebp:=
+ virtual/jpeg:0=
+ >=media-libs/libpng-1.4:0=
+ >=x11-libs/cairo-1.10:=[X]
+ >=dev-libs/glib-2.36.0:2
+ >=x11-libs/gtk+-3.6.0:3[aqua=,introspection?]
+ >=dev-libs/icu-3.8.1-r1:=
+ >=net-libs/libsoup-2.42.0:2.4[introspection?]
+ dev-db/sqlite:3=
+ >=x11-libs/pango-1.30.0.0
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/gtk+-2.24.10:2
+
+ egl? ( media-libs/mesa[egl] )
+ geoloc? ( app-misc/geoclue:0 )
+ gles2? ( media-libs/mesa[gles2] )
+ gstreamer? (
+ >=media-libs/gstreamer-1.2:1.0
+ >=media-libs/gst-plugins-base-1.2:1.0 )
+ introspection? ( >=dev-libs/gobject-introspection-1.32.0 )
+ libsecret? ( app-crypt/libsecret )
+ opengl? ( virtual/opengl )
+ spell? ( >=app-text/enchant-0.22:= )
+ webgl? (
+ x11-libs/cairo[opengl]
+ x11-libs/libXcomposite
+ x11-libs/libXdamage )
+"
+
+# paxctl needed for bug #407085
+# Need real bison, not yacc
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ || (
+ virtual/rubygems[ruby_targets_ruby20]
+ virtual/rubygems[ruby_targets_ruby21]
+ virtual/rubygems[ruby_targets_ruby19]
+ )
+ >=app-accessibility/at-spi2-core-2.5.3
+ >=dev-libs/atk-2.8.0
+ >=dev-util/gtk-doc-am-1.10
+ dev-util/gperf
+ >=sys-devel/bison-2.4.3
+ >=sys-devel/flex-2.5.33
+ || ( >=sys-devel/gcc-4.7 >=sys-devel/clang-3.0 )
+ sys-devel/gettext
+ >=sys-devel/make-3.82-r4
+ virtual/pkgconfig
+
+ introspection? ( jit? ( sys-apps/paxctl ) )
+ test? (
+ dev-lang/python:2.7
+ dev-python/pygobject:3[python_targets_python2_7]
+ x11-themes/hicolor-icon-theme
+ jit? ( sys-apps/paxctl ) )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
+ einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
+ check-reqs_pkg_pretend
+ fi
+
+ if ! test-flag-CXX -std=c++11; then
+ die "You need at least GCC 4.7.x or Clang >= 3.0 for C++11-specific compiler flags"
+ fi
+}
+
+pkg_setup() {
+ # Check whether any of the debugging flags is enabled
+ if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
+ if is-flagq "-ggdb" && [[ ${WEBKIT_GTK_GGDB} != "yes" ]]; then
+ replace-flags -ggdb -g
+ ewarn "Replacing \"-ggdb\" with \"-g\" in your CFLAGS."
+ ewarn "Building ${PN} with \"-ggdb\" produces binaries which are too"
+ ewarn "large for current binutils releases (bug #432784) and has very"
+ ewarn "high temporary build space and memory requirements."
+ ewarn "If you really want to build ${PN} with \"-ggdb\", add"
+ ewarn "WEBKIT_GTK_GGDB=yes"
+ ewarn "to your make.conf file."
+ fi
+ einfo "You need to have at least 18GB of temporary build space available"
+ einfo "to build ${PN} with debugging CFLAGS. Note that it might still"
+ einfo "not be enough, as the total space requirements depend on the flags"
+ einfo "(-ggdb vs -g1) and enabled features."
+ check-reqs_pkg_setup
+ fi
+
+ [[ ${MERGE_TYPE} = "binary" ]] || python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ DOCS="ChangeLog NEWS" # other ChangeLog files handled by src_install
+
+ # intermediate MacPorts hack while upstream bug is not fixed properly
+ # https://bugs.webkit.org/show_bug.cgi?id=28727
+ use aqua && epatch "${FILESDIR}"/${PN}-1.6.1-darwin-quartz.patch
+
+ # Don't force -O2
+ sed -i 's/-O2//g' "${S}"/Source/autotools/SetupCompilerFlags.m4 || die
+
+ # Failing tests
+ # * webinspector -> https://bugs.webkit.org/show_bug.cgi?id=50744
+ # * keyevents is interactive
+ # * mimehandling test sometimes fails under Xvfb (works fine manually), bug #???
+ # * webdatasource test needs a network connection and intermittently fails with icedtea-web
+ # * webplugindatabase intermittently fails with icedtea-web, bug #????
+ sed -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebinspector/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testkeyevents/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testmimehandling/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebdatasource/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebplugindatabase/ d' \
+ -i Source/WebKit/gtk/GNUmakefile.am || die
+
+ # Respect CC, otherwise fails on prefix #395875
+ tc-export CC
+
+ # bug #459978, upstream bug #113397
+ epatch "${FILESDIR}/${PN}-1.11.90-gtk-docize-fix.patch"
+
+ # Do not build unittests unless requested, upstream bug #128163
+ epatch "${FILESDIR}"/${PN}-2.2.4-unittests-build.patch
+
+ # Deadlock causing infinite compilations with nvidia-drivers:
+ # https://bugs.gentoo.org/show_bug.cgi?id=463960
+ # http://osdyson.org/issues/161
+ # https://bugs.webkit.org/show_bug.cgi?id=125651
+ epatch "${FILESDIR}"/${PN}-2.2.5-gir-nvidia-hangs.patch
+
+ # Debian patches to fix support for some arches
+ # https://bugs.webkit.org/show_bug.cgi?id=129540
+ epatch "${FILESDIR}"/${PN}-2.2.5-{hppa,ia64}-platform.patch
+ # https://bugs.webkit.org/show_bug.cgi?id=129542
+ epatch "${FILESDIR}"/${PN}-2.2.5-ia64-malloc.patch
+
+ # OpenBSD patches to fix support for some arches
+ # https://bugs.webkit.org/show_bug.cgi?id=86835
+ epatch "${FILESDIR}"/${PN}-2.2.5-sparc64-build.patch
+
+ epatch "${FILESDIR}"/${P}-musl-remove-execinfo.patch
+
+ AT_M4DIR=Source/autotools eautoreconf
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ # Arches without JIT support also need this to really disable it in all places
+ use jit || append-cppflags -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0
+
+ # It doesn't compile on alpha without this in LDFLAGS, bug #???
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ # Sigbuses on SPARC with mcpu and co., bug #???
+ use sparc && filter-flags "-mvis"
+
+ # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
+ use ppc64 && append-flags "-mminimal-toc"
+
+ # Try to use less memory, bug #469942 (see Fedora .spec for reference)
+ # --no-keep-memory doesn't work on ia64, bug #502492
+ if ! use ia64; then
+ append-ldflags "-Wl,--no-keep-memory"
+ fi
+ if ! $(tc-getLD) --version | grep -q "GNU gold"; then
+ append-ldflags "-Wl,--reduce-memory-overheads"
+ fi
+
+ local myconf=""
+
+ if has_version "virtual/rubygems[ruby_targets_ruby21]"; then
+ myconf="${myconf} RUBY=$(type -P ruby21)"
+ elif has_version "virtual/rubygems[ruby_targets_ruby20]"; then
+ myconf="${myconf} RUBY=$(type -P ruby20)"
+ else
+ myconf="${myconf} RUBY=$(type -P ruby19)"
+ fi
+
+ # TODO: Check Web Audio support
+ # should somehow let user select between them?
+ #
+ # * Aqua support in gtk3 is untested
+ # * dependency-tracking is required so parallel builds won't fail
+ gnome2_src_configure \
+ $(use_enable coverage) \
+ $(use_enable debug) \
+ $(use_enable egl) \
+ $(use_enable geoloc geolocation) \
+ $(use_enable gles2) \
+ $(use_enable gstreamer video) \
+ $(use_enable gstreamer web-audio) \
+ $(use_enable introspection) \
+ $(use_enable jit) \
+ $(use_enable libsecret credential_storage) \
+ $(use_enable opengl glx) \
+ $(use_enable spell spellcheck) \
+ $(use_enable webgl) \
+ $(use_enable webgl accelerated-compositing) \
+ --with-gtk=3.0 \
+ --enable-dependency-tracking \
+ --disable-gtk-doc \
+ $(usex aqua "--with-font-backend=pango --with-target=quartz" "")
+ ${myconf}
+}
+
+src_test() {
+ # Tests expect an out-of-source build in WebKitBuild
+ ln -s . WebKitBuild || die "ln failed"
+
+ # Prevents test failures on PaX systems
+ use jit && pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
+
+ unset DISPLAY
+ # Tests need virtualx, bug #294691, bug #310695
+ # Parallel tests sometimes fail
+ Xemake -j1 check
+}
+
+src_install() {
+ # https://bugs.webkit.org/show_bug.cgi?id=129242
+ MAKEOPTS="${MAKEOPTS} -j1" gnome2_src_install
+
+ newdoc Source/WebKit/gtk/ChangeLog ChangeLog.gtk
+ newdoc Source/JavaScriptCore/ChangeLog ChangeLog.JavaScriptCore
+ newdoc Source/WebCore/ChangeLog ChangeLog.WebCore
+
+ # Prevents crashes on PaX systems
+ use jit && pax-mark m "${ED}usr/bin/jsc-3"
+}
diff --git a/net-libs/webkit-gtk/webkit-gtk-2.4.1-r99.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.4.1-r99.ebuild
new file mode 100644
index 00000000..5a6f1ab9
--- /dev/null
+++ b/net-libs/webkit-gtk/webkit-gtk-2.4.1-r99.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/webkit-gtk/webkit-gtk-2.4.1.ebuild,v 1.1 2014/04/27 18:26:53 eva Exp $
+
+EAPI="5"
+GCONF_DEBUG="no"
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit autotools check-reqs eutils flag-o-matic gnome2 pax-utils python-any-r1 toolchain-funcs versionator virtualx
+
+MY_P="webkitgtk-${PV}"
+DESCRIPTION="Open source web browser engine"
+HOMEPAGE="http://www.webkitgtk.org/"
+SRC_URI="http://www.webkitgtk.org/releases/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2+ BSD"
+SLOT="3/25" # soname version of libwebkit2gtk-3.0
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="aqua coverage debug +egl +geoloc gles2 +gstreamer +introspection +jit libsecret +opengl spell wayland +webgl +X"
+# bugs 372493, 416331
+REQUIRED_USE="
+ geoloc? ( introspection )
+ introspection? ( gstreamer )
+ gles2? ( egl )
+ webgl? ( ^^ ( gles2 opengl ) )
+ !webgl? ( ?? ( gles2 opengl ) )
+ || ( aqua wayland X )
+"
+
+# use sqlite, svg by default
+# Aqua support in gtk3 is untested
+# gtk2 is needed for plugin process support
+# gtk3-3.10 required for wayland
+RDEPEND="
+ dev-libs/libxml2:2
+ dev-libs/libxslt
+ media-libs/harfbuzz:=[icu(+)]
+ media-libs/libwebp:=
+ virtual/jpeg:0=
+ >=media-libs/libpng-1.4:0=
+ >=x11-libs/cairo-1.10:=[X]
+ >=dev-libs/glib-2.36.0:2
+ >=x11-libs/gtk+-3.6.0:3[aqua=,introspection?]
+ >=dev-libs/icu-3.8.1-r1:=
+ >=net-libs/libsoup-2.42.0:2.4[introspection?]
+ dev-db/sqlite:3=
+ >=x11-libs/pango-1.30.0.0
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/gtk+-2.24.10:2
+
+ egl? ( media-libs/mesa[egl] )
+ geoloc? ( >=app-misc/geoclue-2.1.5:2.0 )
+ gles2? ( media-libs/mesa[gles2] )
+ gstreamer? (
+ >=media-libs/gstreamer-1.2:1.0
+ >=media-libs/gst-plugins-base-1.2:1.0 )
+ introspection? ( >=dev-libs/gobject-introspection-1.32.0 )
+ libsecret? ( app-crypt/libsecret )
+ opengl? ( virtual/opengl )
+ spell? ( >=app-text/enchant-0.22:= )
+ wayland? ( >=x11-libs/gtk+-3.10:3[wayland] )
+ webgl? (
+ x11-libs/cairo[opengl]
+ x11-libs/libXcomposite
+ x11-libs/libXdamage )
+"
+
+# paxctl needed for bug #407085
+# Need real bison, not yacc
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ || (
+ virtual/rubygems[ruby_targets_ruby20]
+ virtual/rubygems[ruby_targets_ruby21]
+ virtual/rubygems[ruby_targets_ruby19]
+ )
+ >=app-accessibility/at-spi2-core-2.5.3
+ >=dev-libs/atk-2.8.0
+ >=dev-util/gtk-doc-am-1.10
+ dev-util/gperf
+ >=sys-devel/bison-2.4.3
+ >=sys-devel/flex-2.5.33
+ || ( >=sys-devel/gcc-4.7 >=sys-devel/clang-3.3 )
+ sys-devel/gettext
+ >=sys-devel/make-3.82-r4
+ virtual/pkgconfig
+
+ introspection? ( jit? ( sys-apps/paxctl ) )
+ test? (
+ dev-lang/python:2.7
+ dev-python/pygobject:3[python_targets_python2_7]
+ x11-themes/hicolor-icon-theme
+ jit? ( sys-apps/paxctl ) )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
+ einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
+ check-reqs_pkg_pretend
+ fi
+
+ if ! test-flag-CXX -std=c++11; then
+ die "You need at least GCC 4.7.x or Clang >= 3.3 for C++11-specific compiler flags"
+ fi
+}
+
+pkg_setup() {
+ # Check whether any of the debugging flags is enabled
+ if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
+ if is-flagq "-ggdb" && [[ ${WEBKIT_GTK_GGDB} != "yes" ]]; then
+ replace-flags -ggdb -g
+ ewarn "Replacing \"-ggdb\" with \"-g\" in your CFLAGS."
+ ewarn "Building ${PN} with \"-ggdb\" produces binaries which are too"
+ ewarn "large for current binutils releases (bug #432784) and has very"
+ ewarn "high temporary build space and memory requirements."
+ ewarn "If you really want to build ${PN} with \"-ggdb\", add"
+ ewarn "WEBKIT_GTK_GGDB=yes"
+ ewarn "to your make.conf file."
+ fi
+ einfo "You need to have at least 18GB of temporary build space available"
+ einfo "to build ${PN} with debugging CFLAGS. Note that it might still"
+ einfo "not be enough, as the total space requirements depend on the flags"
+ einfo "(-ggdb vs -g1) and enabled features."
+ check-reqs_pkg_setup
+ fi
+
+ [[ ${MERGE_TYPE} = "binary" ]] || python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # intermediate MacPorts hack while upstream bug is not fixed properly
+ # https://bugs.webkit.org/show_bug.cgi?id=28727
+ use aqua && epatch "${FILESDIR}"/${PN}-1.6.1-darwin-quartz.patch
+
+ # Leave optimization level to user CFLAGS
+ # FORTIFY_SOURCE is enabled by default in Gentoo
+ sed -e 's/-O[012]//g' \
+ -e 's/-D_FORTIFY_SOURCE=2//g' \
+ -i Source/autotools/SetupCompilerFlags.m4 || die
+
+ # Failing tests
+ # * webinspector -> https://bugs.webkit.org/show_bug.cgi?id=50744
+ # * keyevents is interactive
+ # * mimehandling test sometimes fails under Xvfb (works fine manually), bug #???
+ # * webdatasource test needs a network connection and intermittently fails with icedtea-web
+ # * webplugindatabase intermittently fails with icedtea-web, bug #????
+ sed -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebinspector/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testkeyevents/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testmimehandling/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebdatasource/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebplugindatabase/ d' \
+ -i Tools/TestWebKitAPI/GNUmakefile.am || die
+
+ # bug #459978, upstream bug #113397
+ epatch "${FILESDIR}/${PN}-1.11.90-gtk-docize-fix.patch"
+
+ # Do not build unittests unless requested, upstream bug #128163
+ epatch "${FILESDIR}"/${PN}-2.2.4-unittests-build.patch
+
+ # Deadlock causing infinite compilations with nvidia-drivers:
+ # https://bugs.gentoo.org/show_bug.cgi?id=463960
+ # http://osdyson.org/issues/161
+ # https://bugs.webkit.org/show_bug.cgi?id=125651
+ epatch "${FILESDIR}"/${PN}-2.2.5-gir-nvidia-hangs.patch
+
+ # Debian patches to fix support for some arches
+ # https://bugs.webkit.org/show_bug.cgi?id=129540
+ epatch "${FILESDIR}"/${PN}-2.2.5-{hppa,ia64}-platform.patch
+ # https://bugs.webkit.org/show_bug.cgi?id=129542
+ epatch "${FILESDIR}"/${PN}-2.4.1-ia64-malloc.patch
+
+ epatch "${FILESDIR}"/${PN}-2.4.1-musl-remove-execinfo.patch
+
+ AT_M4DIR=Source/autotools eautoreconf
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ # Respect CC, otherwise fails on prefix #395875
+ tc-export CC
+
+ # Arches without JIT support also need this to really disable it in all places
+ use jit || append-cppflags -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0
+
+ # It doesn't compile on alpha without this in LDFLAGS, bug #???
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ # Sigbuses on SPARC with mcpu and co., bug #???
+ use sparc && filter-flags "-mvis"
+
+ # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
+ use ppc64 && append-flags "-mminimal-toc"
+
+ # Try to use less memory, bug #469942 (see Fedora .spec for reference)
+ # --no-keep-memory doesn't work on ia64, bug #502492
+ if ! use ia64; then
+ append-ldflags "-Wl,--no-keep-memory"
+ fi
+ if ! $(tc-getLD) --version | grep -q "GNU gold"; then
+ append-ldflags "-Wl,--reduce-memory-overheads"
+ fi
+
+ local myconf=""
+
+ if has_version "virtual/rubygems[ruby_targets_ruby21]"; then
+ myconf="${myconf} RUBY=$(type -P ruby21)"
+ elif has_version "virtual/rubygems[ruby_targets_ruby20]"; then
+ myconf="${myconf} RUBY=$(type -P ruby20)"
+ else
+ myconf="${myconf} RUBY=$(type -P ruby19)"
+ fi
+
+ # TODO: Check Web Audio support
+ # should somehow let user select between them?
+ #
+ # * Aqua support in gtk3 is untested
+ # * dependency-tracking is required so parallel builds won't fail
+ gnome2_src_configure \
+ $(use_enable aqua quartz-target) \
+ $(use_enable coverage) \
+ $(use_enable debug) \
+ $(use_enable egl) \
+ $(use_enable geoloc geolocation) \
+ $(use_enable gles2) \
+ $(use_enable gstreamer video) \
+ $(use_enable gstreamer web-audio) \
+ $(use_enable introspection) \
+ $(use_enable jit) \
+ $(use_enable libsecret credential_storage) \
+ $(use_enable opengl glx) \
+ $(use_enable spell spellcheck) \
+ $(use_enable webgl) \
+ $(use_enable webgl accelerated-compositing) \
+ $(use_enable wayland wayland-target) \
+ $(use_enable X x11-target) \
+ --with-gtk=3.0 \
+ --enable-dependency-tracking \
+ --disable-gtk-doc \
+ ${myconf}
+}
+
+src_test() {
+ # Tests expect an out-of-source build in WebKitBuild
+ ln -s . WebKitBuild || die "ln failed"
+
+ # Prevents test failures on PaX systems
+ use jit && pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
+
+ unset DISPLAY
+ # Tests need virtualx, bug #294691, bug #310695
+ # Parallel tests sometimes fail
+ Xemake -j1 check
+}
+
+src_install() {
+ DOCS="ChangeLog NEWS" # other ChangeLog files handled by src_install
+
+ # https://bugs.webkit.org/show_bug.cgi?id=129242
+ MAKEOPTS="${MAKEOPTS} -j1" gnome2_src_install
+
+ newdoc Source/WebKit/gtk/ChangeLog ChangeLog.gtk
+ newdoc Source/JavaScriptCore/ChangeLog ChangeLog.JavaScriptCore
+ newdoc Source/WebCore/ChangeLog ChangeLog.WebCore
+
+ # Prevents crashes on PaX systems
+ use jit && pax-mark m "${ED}usr/bin/jsc-3"
+}
diff --git a/net-libs/webkit-gtk/webkit-gtk-2.4.3-r99.ebuild b/net-libs/webkit-gtk/webkit-gtk-2.4.3-r99.ebuild
new file mode 100644
index 00000000..68651e56
--- /dev/null
+++ b/net-libs/webkit-gtk/webkit-gtk-2.4.3-r99.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/webkit-gtk/webkit-gtk-2.4.3.ebuild,v 1.1 2014/05/30 05:03:33 pacho Exp $
+
+EAPI="5"
+GCONF_DEBUG="no"
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit autotools check-reqs eutils flag-o-matic gnome2 pax-utils python-any-r1 toolchain-funcs versionator virtualx
+
+MY_P="webkitgtk-${PV}"
+DESCRIPTION="Open source web browser engine"
+HOMEPAGE="http://www.webkitgtk.org/"
+SRC_URI="http://www.webkitgtk.org/releases/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2+ BSD"
+SLOT="3/25" # soname version of libwebkit2gtk-3.0
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="aqua coverage debug +egl +geoloc gles2 +gstreamer +introspection +jit libsecret +opengl spell wayland +webgl +X"
+# bugs 372493, 416331
+REQUIRED_USE="
+ geoloc? ( introspection )
+ introspection? ( gstreamer )
+ gles2? ( egl )
+ webgl? ( ^^ ( gles2 opengl ) )
+ !webgl? ( ?? ( gles2 opengl ) )
+ || ( aqua wayland X )
+"
+
+# use sqlite, svg by default
+# Aqua support in gtk3 is untested
+# gtk2 is needed for plugin process support
+# gtk3-3.10 required for wayland
+RDEPEND="
+ dev-libs/libxml2:2
+ dev-libs/libxslt
+ media-libs/harfbuzz:=[icu(+)]
+ media-libs/libwebp:=
+ virtual/jpeg:0=
+ >=media-libs/libpng-1.4:0=
+ >=x11-libs/cairo-1.10:=[X]
+ >=dev-libs/glib-2.36.0:2
+ >=x11-libs/gtk+-3.6.0:3[aqua=,introspection?]
+ >=dev-libs/icu-3.8.1-r1:=
+ >=net-libs/libsoup-2.42.0:2.4[introspection?]
+ dev-db/sqlite:3=
+ >=x11-libs/pango-1.30.0.0
+ x11-libs/libXrender
+ x11-libs/libXt
+ >=x11-libs/gtk+-2.24.10:2
+
+ egl? ( media-libs/mesa[egl] )
+ geoloc? ( >=app-misc/geoclue-2.1.5:2.0 )
+ gles2? ( media-libs/mesa[gles2] )
+ gstreamer? (
+ >=media-libs/gstreamer-1.2:1.0
+ >=media-libs/gst-plugins-base-1.2:1.0 )
+ introspection? ( >=dev-libs/gobject-introspection-1.32.0 )
+ libsecret? ( app-crypt/libsecret )
+ opengl? ( virtual/opengl )
+ spell? ( >=app-text/enchant-0.22:= )
+ wayland? ( >=x11-libs/gtk+-3.10:3[wayland] )
+ webgl? (
+ x11-libs/cairo[opengl]
+ x11-libs/libXcomposite
+ x11-libs/libXdamage )
+"
+
+# paxctl needed for bug #407085
+# Need real bison, not yacc
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ || (
+ virtual/rubygems[ruby_targets_ruby20]
+ virtual/rubygems[ruby_targets_ruby21]
+ virtual/rubygems[ruby_targets_ruby19]
+ )
+ >=app-accessibility/at-spi2-core-2.5.3
+ >=dev-libs/atk-2.8.0
+ >=dev-util/gtk-doc-am-1.10
+ dev-util/gperf
+ >=sys-devel/bison-2.4.3
+ >=sys-devel/flex-2.5.33
+ || ( >=sys-devel/gcc-4.7 >=sys-devel/clang-3.3 )
+ sys-devel/gettext
+ >=sys-devel/make-3.82-r4
+ virtual/pkgconfig
+
+ introspection? ( jit? ( sys-apps/paxctl ) )
+ test? (
+ dev-lang/python:2.7
+ dev-python/pygobject:3[python_targets_python2_7]
+ x11-themes/hicolor-icon-theme
+ jit? ( sys-apps/paxctl ) )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+CHECKREQS_DISK_BUILD="18G" # and even this might not be enough, bug #417307
+
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
+ einfo "Checking for sufficient disk space to build ${PN} with debugging CFLAGS"
+ check-reqs_pkg_pretend
+ fi
+
+ if ! test-flag-CXX -std=c++11; then
+ die "You need at least GCC 4.7.x or Clang >= 3.3 for C++11-specific compiler flags"
+ fi
+}
+
+pkg_setup() {
+ # Check whether any of the debugging flags is enabled
+ if [[ ${MERGE_TYPE} != "binary" ]] && is-flagq "-g*" && ! is-flagq "-g*0" ; then
+ if is-flagq "-ggdb" && [[ ${WEBKIT_GTK_GGDB} != "yes" ]]; then
+ replace-flags -ggdb -g
+ ewarn "Replacing \"-ggdb\" with \"-g\" in your CFLAGS."
+ ewarn "Building ${PN} with \"-ggdb\" produces binaries which are too"
+ ewarn "large for current binutils releases (bug #432784) and has very"
+ ewarn "high temporary build space and memory requirements."
+ ewarn "If you really want to build ${PN} with \"-ggdb\", add"
+ ewarn "WEBKIT_GTK_GGDB=yes"
+ ewarn "to your make.conf file."
+ fi
+ einfo "You need to have at least 18GB of temporary build space available"
+ einfo "to build ${PN} with debugging CFLAGS. Note that it might still"
+ einfo "not be enough, as the total space requirements depend on the flags"
+ einfo "(-ggdb vs -g1) and enabled features."
+ check-reqs_pkg_setup
+ fi
+
+ [[ ${MERGE_TYPE} = "binary" ]] || python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ # intermediate MacPorts hack while upstream bug is not fixed properly
+ # https://bugs.webkit.org/show_bug.cgi?id=28727
+ use aqua && epatch "${FILESDIR}"/${PN}-1.6.1-darwin-quartz.patch
+
+ # Leave optimization level to user CFLAGS
+ # FORTIFY_SOURCE is enabled by default in Gentoo
+ sed -e 's/-O[012]//g' \
+ -e 's/-D_FORTIFY_SOURCE=2//g' \
+ -i Source/autotools/SetupCompilerFlags.m4 || die
+
+ # Failing tests
+ # * webinspector -> https://bugs.webkit.org/show_bug.cgi?id=50744
+ # * keyevents is interactive
+ # * mimehandling test sometimes fails under Xvfb (works fine manually), bug #???
+ # * webdatasource test needs a network connection and intermittently fails with icedtea-web
+ # * webplugindatabase intermittently fails with icedtea-web, bug #????
+ sed -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebinspector/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testkeyevents/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testmimehandling/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebdatasource/ d' \
+ -e '/Programs\/TestWebKitAPI\/WebKitGtk\/testwebplugindatabase/ d' \
+ -i Tools/TestWebKitAPI/GNUmakefile.am || die
+
+ # bug #459978, upstream bug #113397
+ epatch "${FILESDIR}/${PN}-1.11.90-gtk-docize-fix.patch"
+
+ # Do not build unittests unless requested, upstream bug #128163
+ epatch "${FILESDIR}"/${PN}-2.2.4-unittests-build.patch
+
+ # Deadlock causing infinite compilations with nvidia-drivers:
+ # https://bugs.gentoo.org/show_bug.cgi?id=463960
+ # http://osdyson.org/issues/161
+ # https://bugs.webkit.org/show_bug.cgi?id=125651
+ epatch "${FILESDIR}"/${PN}-2.2.5-gir-nvidia-hangs.patch
+
+ # Debian patches to fix support for some arches
+ # https://bugs.webkit.org/show_bug.cgi?id=129540
+ epatch "${FILESDIR}"/${PN}-2.2.5-{hppa,ia64}-platform.patch
+ # https://bugs.webkit.org/show_bug.cgi?id=129542
+ epatch "${FILESDIR}"/${PN}-2.4.1-ia64-malloc.patch
+
+ epatch "${FILESDIR}"/${PN}-2.4.1-musl-remove-execinfo.patch
+
+ AT_M4DIR=Source/autotools eautoreconf
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ # Respect CC, otherwise fails on prefix #395875
+ tc-export CC
+
+ # Arches without JIT support also need this to really disable it in all places
+ use jit || append-cppflags -DENABLE_JIT=0 -DENABLE_YARR_JIT=0 -DENABLE_ASSEMBLER=0
+
+ # It doesn't compile on alpha without this in LDFLAGS, bug #???
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ # Sigbuses on SPARC with mcpu and co., bug #???
+ use sparc && filter-flags "-mvis"
+
+ # https://bugs.webkit.org/show_bug.cgi?id=42070 , #301634
+ use ppc64 && append-flags "-mminimal-toc"
+
+ # Try to use less memory, bug #469942 (see Fedora .spec for reference)
+ # --no-keep-memory doesn't work on ia64, bug #502492
+ if ! use ia64; then
+ append-ldflags "-Wl,--no-keep-memory"
+ fi
+ if ! $(tc-getLD) --version | grep -q "GNU gold"; then
+ append-ldflags "-Wl,--reduce-memory-overheads"
+ fi
+
+ local myconf=""
+
+ if has_version "virtual/rubygems[ruby_targets_ruby21]"; then
+ myconf="${myconf} RUBY=$(type -P ruby21)"
+ elif has_version "virtual/rubygems[ruby_targets_ruby20]"; then
+ myconf="${myconf} RUBY=$(type -P ruby20)"
+ else
+ myconf="${myconf} RUBY=$(type -P ruby19)"
+ fi
+
+ # TODO: Check Web Audio support
+ # should somehow let user select between them?
+ #
+ # * Aqua support in gtk3 is untested
+ # * dependency-tracking is required so parallel builds won't fail
+ gnome2_src_configure \
+ $(use_enable aqua quartz-target) \
+ $(use_enable coverage) \
+ $(use_enable debug) \
+ $(use_enable egl) \
+ $(use_enable geoloc geolocation) \
+ $(use_enable gles2) \
+ $(use_enable gstreamer video) \
+ $(use_enable gstreamer web-audio) \
+ $(use_enable introspection) \
+ $(use_enable jit) \
+ $(use_enable libsecret credential_storage) \
+ $(use_enable opengl glx) \
+ $(use_enable spell spellcheck) \
+ $(use_enable webgl) \
+ $(use_enable webgl accelerated-compositing) \
+ $(use_enable wayland wayland-target) \
+ $(use_enable X x11-target) \
+ --with-gtk=3.0 \
+ --enable-dependency-tracking \
+ --disable-gtk-doc \
+ ${myconf}
+}
+
+src_test() {
+ # Tests expect an out-of-source build in WebKitBuild
+ ln -s . WebKitBuild || die "ln failed"
+
+ # Prevents test failures on PaX systems
+ use jit && pax-mark m $(list-paxables Programs/*[Tt]ests/*) # Programs/unittests/.libs/test*
+
+ unset DISPLAY
+ # Tests need virtualx, bug #294691, bug #310695
+ # Parallel tests sometimes fail
+ Xemake -j1 check
+}
+
+src_install() {
+ DOCS="ChangeLog NEWS" # other ChangeLog files handled by src_install
+
+ # https://bugs.webkit.org/show_bug.cgi?id=129242
+ MAKEOPTS="${MAKEOPTS} -j1" gnome2_src_install
+
+ newdoc Source/WebKit/gtk/ChangeLog ChangeLog.gtk
+ newdoc Source/JavaScriptCore/ChangeLog ChangeLog.JavaScriptCore
+ newdoc Source/WebCore/ChangeLog ChangeLog.WebCore
+
+ # Prevents crashes on PaX systems
+ use jit && pax-mark m "${ED}usr/bin/jsc-3"
+}
diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
new file mode 100644
index 00000000..8cbdded9
--- /dev/null
+++ b/net-misc/dhcp/Manifest
@@ -0,0 +1,35 @@
+AUX dhcp-3.0-fix-perms.patch 485 SHA256 a805a60b36e148886887aebb797e80f642386b3e55ef4a0b5132f96a2877e018 SHA512 6d3ae697faf576bac801d9c302187ed7c8691eb991e0f9866e528ef7fb72592ba239b7519124919c44e4fff6108e4f13d83c1c0bb35d022f7a702b1fb06a6333 WHIRLPOOL af9a21870c2b1785573ea29f82dcb6b5629b9d6f0de94fa49e60576645d721debc8c6d01a29c4a6daeff91abe9674c5d07a8bca8b960893b51f85a0a43bfd56e
+AUX dhcp-3.0-paranoia.patch 5366 SHA256 a8db9eb98397a9c1b3a0de07fc107c39dc4f6a4a331d404fc6fcc4a8dbc7aeae SHA512 7583ce88621c5f3c5f150129a4a3c82a20a237adeb689fb7067f23fc8a78ab89305741605284d9de0d5fb91d329c5fbd08361405845d5b34adf41a9b26261690 WHIRLPOOL 24afb961c2500bccdda097faac12a24215e0f0473310195552f69a789875f3ac61cbb904b69caa2109f2cd76a77ca96840baf375cc260db65b0e15dbedeaee9e
+AUX dhcp-3.0.3-dhclient-no-down.patch 2332 SHA256 a5a67de79f6435d9bc4eeea416aff7a904ab567e5e8d75ecf34495bc9f2c5a44 SHA512 12440298f27980256bd797c133f2fe14fb55485c8631176c055122c2d874bbbed84dca75d5a2d2abbd37ca5ed0d3ab94c3383a5de9a35f1ac69c2c6a215ecf7d WHIRLPOOL 0993456be9b082368e7fdc20acf37af168ff55f4fbde381c6cc8d3940c4cd00b4c683c954ff1ce62c5ebc8d4c48d228a2eb77ee114eb2efdb726bcea9833f48d
+AUX dhcp-3.1.3-dhclient-no-down.patch 2762 SHA256 94c9dbe45063c6c600976ffab4c1fc9ac6f52f4e8077b5074f5142816ea626c4 SHA512 40c40fe05afbe37dc78037956a6c056e520239586f895d373a309f1a3b60058cb867308ac50a7731b589dcf87a13db2676589e34ce817a5a41b821bc7fd5bc5c WHIRLPOOL 0acca442f21f306ff157a723b3a796d8671edb1fdfbeae40e76808100a6dcb4bca8119b1c3973db455f7d4193e083298ccb6a53655e160a8a826d95f41f498f1
+AUX dhcp-4.0-dhclient-ntp.patch 7966 SHA256 e93bda7f2baae9163f96ab0408bfbe885caa96a8698f9e566b8a9dc04de9359b SHA512 548c865988e12d8dbff357d7b5400f7afbb221297765c4de265bc55c016d144d9d7acd0bc6536160d8ca849f7f5b830c2413f407e376216fc05c8bd4b152b927 WHIRLPOOL 2850679345d2da92e3868c47ccbc07b142e51f1c6257c4d8cc4c8736bfc03b23aca3e127e73a43ea0125fd6054796edddcf9d2768d5a52276e5921c6545a07b8
+AUX dhcp-4.2.0-errwarn-message.patch 1508 SHA256 e2baa7b6097a6ca20b66afcd7b0e399840a8b0f251b3750a49a03f0d5b714231 SHA512 6471e4b73fd817740118a5db9ac801914f418360c3322e98c4c2417cb9f563729bb88885e12735ad35a9ec404ac345367300b47be0ca6c2a42673f3c6528ce8d WHIRLPOOL 3262c1433aaec67ce0fbd7cb83eaf47a4d2b264b67c082e0db704c47b918bfc8b6284de54ae205220e6ffa3d34cab360e7a94fcdf0aa6160ac9b0b4e5d8e1cf3
+AUX dhcp-4.2.2-bind-build-flags.patch 476 SHA256 a16d9da5fc29c95c46cf7e2401744292b898f692d49dea4753991505e03c1ca8 SHA512 f552f2b8b1e13e22636f8e4548557801273b0ab38f076a141adb72584ad55b4da156401d94abd12e9364b8632a6e75ecbf3cd90af3b6dbad88627ad3f9658059 WHIRLPOOL 3202f614747eaa9b533e36495bfa862eb96b3e884cb4939a8406fdbded56061aabea20e9249d647e6aa8ed5ed5547d5c8f14c46af193c248239a2734dc79411a
+AUX dhcp-4.2.2-bind-disable.patch 390 SHA256 0871e10198af86414f85c72d21beec640cb0b7c7c4ccea2550d4886bade1417e SHA512 4f852b3fe9dbc18ffa4013fc54aa81ec1009289569c504de10bd01f42798ea21b08567c84e77fbac09ec43038c4da1f0c5579c34ab19e0a038dcb2f61f078df1 WHIRLPOOL 039e71725dbf05e8e74916be490dca13459614038eaf0bfea6a5a5cfd0a72604db4bbdaf02cd8126c4649e7033cbbf39da11d46fee1b83424f41952534230342
+AUX dhcp-4.2.2-bind-parallel-build.patch 304 SHA256 cff322da581742ef1a8019641ee9689c588c3f9fef883b55e28af52823f08838 SHA512 3dee3b0ae5bd512bd7be6d5be7b8cfca8077065f6a3463089bf9ff5fcb556b3333fb8d3aeadf25ea7125fb6eff2ef6967b2878c9312046fa378c8acf0c9cf9d2 WHIRLPOOL 4dbc45c32b7da7cb6f591356290f598308083af3df309cd8e6908b586cbec3dfa6d7d582a3f3675112ff46a15db9c0e1abe727b8b8b4c2168c21a97905f9fb13
+AUX dhcp-4.2.2-dhclient-resolvconf.patch 14535 SHA256 e1142264522fa868f5d86bf2776f5ec3e683783471a39672395e22d417081082 SHA512 8acc93a393979870b2b00908c696d1ab971167e8eb447d9d97d4f861ec727aa18b8d74e79f9d87ee5c569d47cab6e8b7521187cbe2b9aea596d18f0167776d67 WHIRLPOOL e1b616de2aac75b56157abfb6add22274b17e3f8845150bb910cadffd911f32fa294f8bedd3500979d2d31a146178720b322c6fe4013f5cca3439c369ecb957b
+AUX dhcp-4.2.2-dhclient-stdin-conf.patch 3017 SHA256 701da4d022490bf9e1cfd946c752a00a2d2ab9a1fd5030281c1608f367cc68fe SHA512 1adfa938e5531040008981dd4dcba37219bce0794524d3c3530eff527528ef7b22aa6fd540f9ac175339372e98347c0a91b86b4bb5f2aa93f04217b9902c3388 WHIRLPOOL c42b3880b5cf710613021c192fc5bc1290bd04db9d79b991bac9e361f58fd84514044a19a5eff82695845e017c996cd46b29b697bfe718e51fba413caf925096
+AUX dhcp-4.2.2-nogateway.patch 1671 SHA256 3fed5823812c134e1819c8ac10c5fc718df86f4013ffc7505efbbe692319480e SHA512 fefbb402020dfdc3eff75da50bfaed0f30c5b90facd4b4ca25ac38d62f14bb85b18028261b32ac3f4654afc8e6915fcdd6f5e580444f2efe882f6f75ea10be0c WHIRLPOOL 91d38301aaecc4a2199ffd0be19d5c2b36531446524aeb65e743adb82220d20b18f53f3e740b5286bdf578f8fd35b2511f52747406b914d1c4d2841d1677e1bd
+AUX dhcp-4.2.4-always-accept-4.patch 907 SHA256 2a876b92ff385e97955279eab8d7658b9a323cdf16c4a162ba649166cae10194 SHA512 682583d3a68b9609b16ba5029fb14a068c5e4ba1134b91e3c5c91f8cfa0d97d68e7b0fec2aa3d4e224bef9e97765971ca423e54f853a74ff6a2e24715ce17a2c WHIRLPOOL 27516c02bcece28eac935f2a6fbfbf64e3b31b75206151ec618daa906b21a40b62497cefe2e793c1ae74b0b4ee5decde363c9908a632bb38513e14cbb64347e5
+AUX dhcp-4.2.4-quieter-ping.patch 2771 SHA256 8acf6266190a76f13c942da5c0a52c38421259f3fd63426134ad245e65081db0 SHA512 1a17a7ca52aa2a56e483e5f70e9878d7472f8eb3982b4f04c6cb3c32f839fa3972f79f632f99f47196a7e7b9fd8826392b94daaa074691d26636b793fcd40e73 WHIRLPOOL aa0b2bc3f3c539eaa6de27f9ce98525c5342af9a257cf36b8889b40455b3264f7b824a615146539ab012bcf4e5a55a7f1992cfc6222ce77976709c1a88dc907b
+AUX dhcp-4.2.5-bindtodevice-inet6.patch 826 SHA256 482dea1517e3d7a22c0469908c41c0595455b654968e24a31e2053af8b11aa30 SHA512 74d9d30b4803d10a63843d474dda92f019e4b7b9d7a9f4e32a49a1c261c1bb7238cd13f9b91c2bf8cf7f3ce5a5c665ef1d32998b06ca1439b30785d33827fe67 WHIRLPOOL 78b09180b95a4629c383d4347dd6ae55c83987f3c8946eb71a7643a442d59bfb63b3decbdc3fa3bc4e608c6d8ab59c3904eb027e97dcdbba169ca51ff0ced6c2
+AUX dhcp-4.2.5-iproute2-path.patch 340 SHA256 a6c25d408ca1bac5180151ff2955807017c386c06fc162395dcd71040900f59b SHA512 4a5c4f3b1af93fa137d94fd860689919b83de5885198e48eb89678379a59a7c9d90f8a3f558ddf9d442130abb127a460928a85c0646c4ad0984827ccd9e08852 WHIRLPOOL d54ba0f4c3da34375ab0f1fa98368ad4ec4f6ff79a131638a3d6540a4c2fa62e83cb45f946518b114793ad8e868b6cef9ec9338a4930080623439e7692386d77
+AUX dhcp-4.3.1-dhclient-resolvconf.patch 14574 SHA256 9f1d8d987e62679d246c70dbc5149090ce1c382b7256c003f2852dd6617a335b SHA512 0cad400e5517ad9b66fc9aa09b2455809205eeb686dce6c7cc4efb8ea655d8de436f47b91ccf8fbd2c4286ecbb2b9d761b7e60e72ab7456794f3028739d80efe WHIRLPOOL 3a021da8fd0069e668ea79d13e496f40976202dcdfa95e78ef3182a6aafa787cd1cafaaa99c1a8e3655f8d15e989d771173c8add54f93b4b332426cd5863e63f
+AUX dhcp-4.3.2-fix-compilation-for-musl.patch 1459 SHA256 4c2687337c9ad0e7cfac884145c79a23070c0d3904e551ee7daf2c95d9e4a8ee SHA512 86d98af9a7595b13a580e4f147d3aa9fc136048b1a1fedd110b5acc2bed1352f3f87ff5d8bce8e7837eaea4810aa940935a5da1e75cb133384ea61a25f759af1 WHIRLPOOL 16fe41ddc593a7019cf1dc952e9f344cce932f74639a5e6ada63b0e23ea0e349913fea20b2889bc5ec778dcaac9e592e4d980f33b142ea13e2ea8df253558de8
+AUX dhcpd.conf2 1068 SHA256 e8a413e9102948b336f60041fc3cade33125faf56d8319ee65d9f3c63199a8e7 SHA512 7b7a77b7826b475a4113ebeee54501ce417cc56e85754301a82a185d88b4713d198f615a366e63e0e2b0aef988c8137dcd1e18c4036d993378257079da17693d WHIRLPOOL eef0331ee019b561de2f3e46860d2c470f6de05be9104f46316d61b09bad9687d916af94eb4b399612bfd05340cda5f68f87886200801de485bd3665cc0886b9
+AUX dhcpd.init5 2953 SHA256 b5811c6adf10d6210e5685b4e999f0449ac492379d055226eeb140f00d9b8702 SHA512 8831a8f9f924cf465f0cd8189f14132138ea010b88ddef12b3c4f77b0549ded552627e03a1555ed42cf4e7f07cc5911872b1db68d9e7f6aac4856f5be5b6fb01 WHIRLPOOL 9eaf25aacf03817ae2e83a184375cf5175248ab0cf8cde5bfc78f79a4fef6f31d28b37e0a97cce670075bda39ac3007309cd27556b243691b8ebde1bd7daf5bc
+AUX dhcpd.tmpfiles 75 SHA256 bb344a11fadedaec33ba3c504cc04adba34b15aeb07a640dab6da255de97728a SHA512 0c34ab0ef8618e6792ba8bda797877ce2e6c4fa433b4944dbc03cc4fc69efe26ce4b5e4dec661fbb2b7ae4173d908de02f4e86f8539364789a23f36cfd8edacb WHIRLPOOL fd4450a697cfbdca4db49eb433c7f67e7a9051541f4ab6e2633659435a504b051aad6338257ece4e5fc950c46f9fa7d5c5820f750440325fc62cae79dff2cfb0
+AUX dhcpd4.service 264 SHA256 174e1a7dab5b23bbbd73a9fe16d3907923c21d2802c51dc1096c9e24bfa9fda3 SHA512 e340311fb890c5fc2f5836cc8d10ea3e4bb34bb5e96e7231798e7d960f05886478bf28305828fbd851080baadafe7d3fd2c7f30a81dcbc68d6368e8b4bd0de71 WHIRLPOOL 121ed7c50b179a7d09f53c758e5d44cd9e91451ca7b577d9b058d8097473df421715018986c314d633a599541d422cbda276831ba8c192c2a8762608fc5f2a3b
+AUX dhcpd6.service 270 SHA256 82efa0887779b8c0f5c33ab77274ff9617f8cca0f59816e0e9425e368f1a1824 SHA512 2898f0dfa56ecb590c25a1f0e44446a83d1d9118e691c9a7680250a9e47f4dec2b36195dbda8259292d93a31bf0e1230b9f39ad93f2b0a9280e8cc4d77b50bae WHIRLPOOL 3040add013f776f1c91624c916456f68307321bd2e2cf69616ac2343743d65dfb9e940bffff089c0c45912d7498c666fcff77b4250ef3c533e1028270d9a4c55
+AUX dhcrelay.conf 547 SHA256 a157630c3bdc9565cca8240ee1e6539fc9cbc1e4642c40e0965e3609d1021bac SHA512 af94d679c5b7652a770d4acb96f5f12fd9dc99f4e8e26b10fab67514693f63392bc8033a6e5e6c1967d7004decc72b810462e1fe92c1d4808606e48086dea00b WHIRLPOOL 344ce23b6b6c8e5d87306dd6052036656d202149a7b65245e7eb010236abf43b60b0c4b999df4080c5d9a8fd9315f068cac4184680a023f1b5f5461937d45763
+AUX dhcrelay.init3 809 SHA256 204aaf81d51dc119cee1d1ff3ae3dd50af666af2f8b2a363fd1bf442d4dcee00 SHA512 76b4b36e2e1bb66312c7e120959a88615c8cf26919fe308260cad10f374bd3460e6f8eef9a0f711d0436ce90460ac5e19d039ae9cd61261b6ce264345a06c3cd WHIRLPOOL a89aea861f513dd13f795cd2ae846db54f9e516080bc3f4aca02a87ed5473c02e74ebc9af2148f7aa9d6dd5f50be122b74ff95edb4d4d91c51c5429e37903619
+AUX dhcrelay4.service 202 SHA256 9c10299c70c9c63ebe8e1a58c73dfb78f08732f0da1bb3265f1ad6e80f7d79ec SHA512 fcc41f7bc055a3f32f288536d93447c1d0b9f112196a3864e12668a9c844d60f99f01f991846196ec53034d65da076276fa633069308b8f674e9a2af20e107e4 WHIRLPOOL 88a8260d057965965173c7f5efdeb26730c3bc4c6bd09bb675db122972a0c545ace05e44df538ab8e05b7c0ff3fbbdd42f148541f8a50eafff29423c52e8455b
+AUX dhcrelay4.service.conf 105 SHA256 c47b40a940fef418941168d72345576a336d1caf42504256400fbcc421ee9e8a SHA512 e4dcde2fe30e26b0f24102c63a6204cf9e98924246609a957b4881c1cedc6a30500511b1c107f8cc1e5f6d5afbd28468bd47f12d38000d25605a982e15027f8f WHIRLPOOL fc8c7dc20a3b2b2355c1561c1627265340b6bbe356cb96291ad8b2e306c34d308e3371ecd58336003b932e583a68ba25541eb2d687177b5101e8da6927769f17
+AUX dhcrelay6.conf 325 SHA256 099f668e1ad42ed9446b15675032a1186715d1fe9e4a1b24dfb787e68495d2b6 SHA512 40d3a6bdf8521bf5152cf31b961aea88b2fb0339433d0b6a6360a16c796298620b377bd079c0246e97bc9c0533ddb13bbb58cc5169d0ca598e3a51d1a607a9e9 WHIRLPOOL 7fcb1b63d12b066c6fc2668497d18ae33b739cca4dbcbc95530d762c7152c410a0af76e65ebb21f3c9c4a837b999799da4a766315e5eb667ccde64100b66b6fd
+AUX dhcrelay6.service 237 SHA256 5406caf5355a71396895a3ef49c3a0af29aa9b982cb10541590fd55dbc1c878a SHA512 11d17aebef403fce1f3b0514f1c7206cb6520f1712c603b016c11275a83e102b969cc371dbe5a3a9c430a392dedf0c7af33692a49197092c467ea764dfaede9d WHIRLPOOL 4dc79fd4fbdea4ea585f6df777e24591876fe8fef21defcaeac676e384137f43695d69fc8ddb5f91d233f47481349e2951fd3c9411aafb00d2fcf161025192ac
+AUX dhcrelay6.service.conf 220 SHA256 c8ef2c5d930ad0addd1a4a10576db271f50cc3e81ac8f87b8b56fb759ab65bdd SHA512 2ac54a5ebdf009854700e6f6b70662b36787b71a5b917fc61be35d31762508ede0e81b3874965b91de655a088914dbe43927911d8df1a16c262cb68389c168a9 WHIRLPOOL 70bba913342e6a1b492eda9799146e48c612175f227b1337874b904bcf22251389d10a4b79c90519b248cdd594288f8d31396e2e8475bb8e28d019c9e9382a88
+DIST dhcp-4.3.1.tar.gz 8980806 SHA256 266cbca8a7a6bb8f9ccc5765da0d2b04099329314a54a4fc1022d510ad3e9af0 SHA512 84ca525fda825bf367a98754f1fb1b8eba5b095c92c25ddaec6e30b31008c7d5c43062ae43cecaa43731a8e78ae406a3123906fd402d2ba4b46b7adbae65aa6a WHIRLPOOL 3fd3720f6883b43856d2169264ee2adfb541b793604728c4e5cc3b647d4a88d6245fb6e53062de4118301cc15f0b4388363eba304bf3623dfb88c91bde94b2b6
+DIST dhcp-4.3.2.tar.gz 9230340 SHA256 6246c9b358759f6cdcc45104caaf76e732a211dbbbbf64a21f499c8db1298165 SHA512 b91a0a90736c6e8bd66a74af8c67949c81db3148eba23ee647f0987bbd98543f0dfd1605c94e152b28a606bbbecd94cd8a8112db5f5fe4c3d041101bda1b95da WHIRLPOOL a201cea52e96517ff1dae2b6c05b05da11feb4c2eed6dca539ea5ab3185711377cd7f7ed9ecc5e5f2bc30bc84d73a85d4140154c43b4f0f27a7e0a4a51f56787
+EBUILD dhcp-4.3.1-r99.ebuild 7879 SHA256 060f1ac8de8f083af37fe41d8b53e3228dc9bbb7c0fdb58e2bd9451398f04432 SHA512 38c8cd13feebaff94c496481079bd046491b4c2cf8c49c41980509434c501762be4d4b90c89e208a797b960224172c1aeb0d7b0cd113c89c1ead912876d4a6dd WHIRLPOOL ea990d45bc634b6897d6448cebcdd2caafb80d5a5353b153f2c6069d879b8eba8eab16481beb4e2781fd4e59449ccdc1fd895f3df76f9951dfb66d2825c0ce88
+EBUILD dhcp-4.3.2-r99.ebuild 7882 SHA256 0930b36f6ec9f4715391c42f9b05fb7f359432a0d0a49d41e28a365c888e6b91 SHA512 c00c3563b0cce431b14cc54a22ae646613f600faf4c2a872aa19025ef548aedb6425b05fbab57789a2e38879db378d06d3a85ec7d743e0a402a41919c11b45f5 WHIRLPOOL 116412737560f00a2d09a291bf6912cec64c5a2b7ae587cfdb96b57298788c9ff58e998d224ff6307b2d1f42c0ae9c6862cc8a8c683f3cd29dc613f1a0bb6bb7
+MISC metadata.xml 577 SHA256 2349abb9b79d82a0f8afb3a940b52c9e8d73c59cfe66f8f52929be1ffcc4c929 SHA512 ee08e66a8f140b68448b503c6f169e1f35ccb6bb383ba5cb7e14463377a8ebc3d047b9b401114a0609e57eae4f268045d4e2cab24bc62f3c795335579a03d84f WHIRLPOOL fb2e511d53539d67b4181dd95f19972712c03b551057e51160bc145c144089069913d2f29e7abb5768f7d97a9ced54c0fe4e5f896ec5bbb1865bc68d4eef179e
diff --git a/net-misc/dhcp/dhcp-4.3.1-r99.ebuild b/net-misc/dhcp/dhcp-4.3.1-r99.ebuild
new file mode 100644
index 00000000..9b3aae00
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.1-r99.ebuild
@@ -0,0 +1,256 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.3.1-r2.ebuild,v 1.10 2015/04/14 10:59:58 ago Exp $
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs user
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+ ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
+
+DEPEND="
+ client? (
+ kernel_linux? (
+ ipv6? ( sys-apps/iproute2 )
+ sys-apps/net-tools
+ )
+ )
+ ldap? (
+ net-nds/openldap
+ ssl? ( dev-libs/openssl )
+ )"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-dhcp )
+ vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${A}
+ # handle local bind hell
+ cd "${S}"/bind
+ unpack ./bind.tar.gz
+}
+
+src_prepare() {
+ # Gentoo patches - these will probably never be accepted upstream
+ # Fix for musl
+ epatch "${FILESDIR}"/${PN}-4.3.2-fix-compilation-for-musl.patch
+ # Fix some permission issues
+ epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
+ # Enable dhclient to equery NTP servers
+ epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
+ epatch "${FILESDIR}"/${PN}-4.3.1-dhclient-resolvconf.patch
+ # Stop downing the interface on Linux as that breaks link daemons
+ # such as wpa_supplicant and netplug
+ epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
+ # Enable dhclient to get extra configuration from stdin
+ epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
+ epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
+ epatch "${FILESDIR}"/${PN}-4.2.4-quieter-ping.patch #296921
+ epatch "${FILESDIR}"/${PN}-4.2.4-always-accept-4.patch #437108
+ epatch "${FILESDIR}"/${PN}-4.2.5-iproute2-path.patch #480636
+ epatch "${FILESDIR}"/${PN}-4.2.5-bindtodevice-inet6.patch #471142
+
+ # Brand the version with Gentoo
+ sed -i \
+ -e "/VERSION=/s:'$: Gentoo-${PR}':" \
+ configure || die
+
+ # Change the hook script locations of the scripts
+ sed -i \
+ -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+ -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+ client/scripts/* || die
+
+ # No need for the linux script to force bash #158540
+ sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+ # Quiet the freebsd logger a little
+ sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+ # Remove these options from the sample config
+ sed -i -r \
+ -e "/(script|host-name|domain-name) /d" \
+ client/dhclient.conf.example || die
+
+ if use client && ! use server ; then
+ sed -i -r \
+ -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+ Makefile.in || die
+ elif ! use client && use server ; then
+ sed -i -r \
+ -e '/^SUBDIRS/s:\<client\>::' \
+ Makefile.in || die
+ fi
+
+ # Only install different man pages if we don't have en
+ if [[ " ${LINGUAS} " != *" en "* ]]; then
+ # Install Japanese man pages
+ if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+ einfo "Installing Japanese documention"
+ cp doc/ja_JP.eucJP/dhclient* client
+ cp doc/ja_JP.eucJP/dhcp* common
+ fi
+ fi
+ # Now remove the non-english docs so there are no errors later
+ rm -rf doc/ja_JP.eucJP
+
+ # make the bind build work
+ binddir=${S}/bind
+ cd "${binddir}" || die
+ cat <<-EOF > bindvar.tmp
+ binddir=${binddir}
+ GMAKE=${MAKE:-gmake}
+ EOF
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-disable.patch
+ cd bind-*/
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
+}
+
+src_configure() {
+ # bind defaults to stupid `/usr/bin/ar`
+ tc-export AR BUILD_CC
+ export ac_cv_path_AR=${AR}
+
+ # this is tested for by the bind build system, and can cause trouble
+ # when cross-building; since dhcp itself doesn't make use of libcap,
+ # simply disable it.
+ export ac_cv_lib_cap_cap_set_proc=no
+
+ # Use FHS sane paths ... some of these have configure options,
+ # but not all, so just do it all here.
+ local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+ cat <<-EOF >> includes/site.h
+ #define _PATH_DHCPD_CONF "${e}/dhcpd.conf"
+ #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf"
+ #define _PATH_DHCPD_DB "${l}/dhcpd.leases"
+ #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases"
+ #define _PATH_DHCLIENT_DB "${l}/dhclient.leases"
+ #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases"
+ #define _PATH_DHCPD_PID "${r}/dhcpd.pid"
+ #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid"
+ #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid"
+ #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid"
+ #define _PATH_DHCRELAY_PID "${r}/dhcrelay.pid"
+ #define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid"
+ EOF
+
+ econf \
+ --enable-paranoia \
+ --enable-early-chroot \
+ --sysconfdir=${e} \
+ $(use_enable ipv6 dhcpv6) \
+ $(use_with ldap) \
+ $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+
+ # configure local bind cruft. symtable option requires
+ # perl and we don't want to require that #383837.
+ cd bind/bind-*/ || die
+ eval econf \
+ $(sed -n '/ [.].configure /{s:^[^-]*::;s:>.*::;p}' ../Makefile) \
+ --disable-symtable \
+ --without-make-clean
+}
+
+src_compile() {
+ # build local bind cruft first
+ emake -C bind/bind-*/lib/export install
+ # then build standard dhcp code
+ emake AR="$(tc-getAR)"
+}
+
+src_install() {
+ default
+
+ dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+ dohtml doc/References.html
+
+ if [[ -e client/dhclient ]] ; then
+ # move the client to /
+ dodir /sbin
+ mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+ exeinto /sbin
+ if use kernel_linux ; then
+ newexe "${S}"/client/scripts/linux dhclient-script
+ else
+ newexe "${S}"/client/scripts/freebsd dhclient-script
+ fi
+ fi
+
+ if [[ -e server/dhcpd ]] ; then
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins contrib/ldap/dhcp.*
+ dosbin contrib/ldap/dhcpd-conf-to-ldap
+ fi
+
+ newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+ newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+ newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+ newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+ newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+ newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+ systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
+ systemd_dounit "${FILESDIR}"/dhcpd4.service
+ systemd_dounit "${FILESDIR}"/dhcpd6.service
+ systemd_dounit "${FILESDIR}"/dhcrelay4.service
+ systemd_dounit "${FILESDIR}"/dhcrelay6.service
+ systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+ systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+ sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+ fi
+
+ # the default config files aren't terribly useful #384087
+ local f
+ for f in "${ED}"/etc/dhcp/*.conf.example ; do
+ mv "${f}" "${f%.example}" || die
+ done
+ sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+ enewgroup dhcp
+ enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+ # Keep the user files over the sample ones. The
+ # hashing is to ignore the crappy defaults #384087.
+ local f h
+ for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+ h=${f#*:}
+ f="/etc/dhcp/${f%:*}.conf"
+ if [ -e "${EROOT}"${f} ] ; then
+ case $(md5sum "${EROOT}"${f}) in
+ ${h}*) ;;
+ *) cp -p "${EROOT}"${f} "${ED}"${f};;
+ esac
+ fi
+ done
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+ ewarn
+ ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+ ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+ ewarn "and dhcp should be removed from the default runlevel"
+ ewarn
+ fi
+}
diff --git a/net-misc/dhcp/dhcp-4.3.2-r99.ebuild b/net-misc/dhcp/dhcp-4.3.2-r99.ebuild
new file mode 100644
index 00000000..411a9ad3
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.3.2-r99.ebuild
@@ -0,0 +1,256 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.3.2.ebuild,v 1.1 2015/03/10 02:17:25 vapier Exp $
+
+EAPI="4"
+
+inherit eutils systemd toolchain-funcs user
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz
+ ftp://ftp.isc.org/isc/dhcp/${MY_PV}/${MY_P}.tar.gz"
+
+LICENSE="ISC BSD SSLeay GPL-2" # GPL-2 only for init script
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
+
+DEPEND="
+ client? (
+ kernel_linux? (
+ ipv6? ( sys-apps/iproute2 )
+ sys-apps/net-tools
+ )
+ )
+ ldap? (
+ net-nds/openldap
+ ssl? ( dev-libs/openssl )
+ )"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-dhcp )
+ vim-syntax? ( app-vim/dhcpd-syntax )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${A}
+ # handle local bind hell
+ cd "${S}"/bind
+ unpack ./bind.tar.gz
+}
+
+src_prepare() {
+ # Gentoo patches - these will probably never be accepted upstream
+ # Fix for musl
+ epatch "${FILESDIR}"/${PN}-4.3.2-fix-compilation-for-musl.patch
+ # Fix some permission issues
+ epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
+ # Enable dhclient to equery NTP servers
+ epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
+ epatch "${FILESDIR}"/${PN}-4.3.1-dhclient-resolvconf.patch
+ # Stop downing the interface on Linux as that breaks link daemons
+ # such as wpa_supplicant and netplug
+ epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
+ # Enable dhclient to get extra configuration from stdin
+ epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
+ epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
+ epatch "${FILESDIR}"/${PN}-4.2.4-quieter-ping.patch #296921
+ epatch "${FILESDIR}"/${PN}-4.2.4-always-accept-4.patch #437108
+ epatch "${FILESDIR}"/${PN}-4.2.5-iproute2-path.patch #480636
+ epatch "${FILESDIR}"/${PN}-4.2.5-bindtodevice-inet6.patch #471142
+
+ # Brand the version with Gentoo
+ sed -i \
+ -e "/VERSION=/s:'$: Gentoo-${PR}':" \
+ configure || die
+
+ # Change the hook script locations of the scripts
+ sed -i \
+ -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+ -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+ client/scripts/* || die
+
+ # No need for the linux script to force bash #158540
+ sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+ # Quiet the freebsd logger a little
+ sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+ # Remove these options from the sample config
+ sed -i -r \
+ -e "/(script|host-name|domain-name) /d" \
+ client/dhclient.conf.example || die
+
+ if use client && ! use server ; then
+ sed -i -r \
+ -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+ Makefile.in || die
+ elif ! use client && use server ; then
+ sed -i -r \
+ -e '/^SUBDIRS/s:\<client\>::' \
+ Makefile.in || die
+ fi
+
+ # Only install different man pages if we don't have en
+ if [[ " ${LINGUAS} " != *" en "* ]]; then
+ # Install Japanese man pages
+ if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+ einfo "Installing Japanese documention"
+ cp doc/ja_JP.eucJP/dhclient* client
+ cp doc/ja_JP.eucJP/dhcp* common
+ fi
+ fi
+ # Now remove the non-english docs so there are no errors later
+ rm -rf doc/ja_JP.eucJP
+
+ # make the bind build work
+ binddir=${S}/bind
+ cd "${binddir}" || die
+ cat <<-EOF > bindvar.tmp
+ binddir=${binddir}
+ GMAKE=${MAKE:-gmake}
+ EOF
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-disable.patch
+ cd bind-*/
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
+}
+
+src_configure() {
+ # bind defaults to stupid `/usr/bin/ar`
+ tc-export AR BUILD_CC
+ export ac_cv_path_AR=${AR}
+
+ # this is tested for by the bind build system, and can cause trouble
+ # when cross-building; since dhcp itself doesn't make use of libcap,
+ # simply disable it.
+ export ac_cv_lib_cap_cap_set_proc=no
+
+ # Use FHS sane paths ... some of these have configure options,
+ # but not all, so just do it all here.
+ local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+ cat <<-EOF >> includes/site.h
+ #define _PATH_DHCPD_CONF "${e}/dhcpd.conf"
+ #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf"
+ #define _PATH_DHCPD_DB "${l}/dhcpd.leases"
+ #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases"
+ #define _PATH_DHCLIENT_DB "${l}/dhclient.leases"
+ #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases"
+ #define _PATH_DHCPD_PID "${r}/dhcpd.pid"
+ #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid"
+ #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid"
+ #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid"
+ #define _PATH_DHCRELAY_PID "${r}/dhcrelay.pid"
+ #define _PATH_DHCRELAY6_PID "${r}/dhcrelay6.pid"
+ EOF
+
+ econf \
+ --enable-paranoia \
+ --enable-early-chroot \
+ --sysconfdir=${e} \
+ $(use_enable ipv6 dhcpv6) \
+ $(use_with ldap) \
+ $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+
+ # configure local bind cruft. symtable option requires
+ # perl and we don't want to require that #383837.
+ cd bind/bind-*/ || die
+ eval econf \
+ $(sed -n '/ [.].configure /{s:^[^-]*::;s:>.*::;p}' ../Makefile) \
+ --disable-symtable \
+ --without-make-clean
+}
+
+src_compile() {
+ # build local bind cruft first
+ emake -C bind/bind-*/lib/export install
+ # then build standard dhcp code
+ emake AR="$(tc-getAR)"
+}
+
+src_install() {
+ default
+
+ dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+ dohtml doc/References.html
+
+ if [[ -e client/dhclient ]] ; then
+ # move the client to /
+ dodir /sbin
+ mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+ exeinto /sbin
+ if use kernel_linux ; then
+ newexe "${S}"/client/scripts/linux dhclient-script
+ else
+ newexe "${S}"/client/scripts/freebsd dhclient-script
+ fi
+ fi
+
+ if [[ -e server/dhcpd ]] ; then
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins contrib/ldap/dhcp.*
+ dosbin contrib/ldap/dhcpd-conf-to-ldap
+ fi
+
+ newinitd "${FILESDIR}"/dhcpd.init5 dhcpd
+ newconfd "${FILESDIR}"/dhcpd.conf2 dhcpd
+ newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay
+ newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay
+ newinitd "${FILESDIR}"/dhcrelay.init3 dhcrelay6
+ newconfd "${FILESDIR}"/dhcrelay6.conf dhcrelay6
+
+ systemd_newtmpfilesd "${FILESDIR}"/dhcpd.tmpfiles dhcpd.conf
+ systemd_dounit "${FILESDIR}"/dhcpd4.service
+ systemd_dounit "${FILESDIR}"/dhcpd6.service
+ systemd_dounit "${FILESDIR}"/dhcrelay4.service
+ systemd_dounit "${FILESDIR}"/dhcrelay6.service
+ systemd_install_serviced "${FILESDIR}"/dhcrelay4.service.conf
+ systemd_install_serviced "${FILESDIR}"/dhcrelay6.service.conf
+
+ sed -i "s:#@slapd@:$(usex ldap slapd ''):" "${ED}"/etc/init.d/* || die #442560
+ fi
+
+ # the default config files aren't terribly useful #384087
+ local f
+ for f in "${ED}"/etc/dhcp/*.conf.example ; do
+ mv "${f}" "${f%.example}" || die
+ done
+ sed -i '/^[^#]/s:^:#:' "${ED}"/etc/dhcp/*.conf || die
+}
+
+pkg_preinst() {
+ enewgroup dhcp
+ enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+ # Keep the user files over the sample ones. The
+ # hashing is to ignore the crappy defaults #384087.
+ local f h
+ for f in dhclient:da7c8496a96452190aecf9afceef4510 dhcpd:10979e7b71134bd7f04d2a60bd58f070 ; do
+ h=${f#*:}
+ f="/etc/dhcp/${f%:*}.conf"
+ if [ -e "${EROOT}"${f} ] ; then
+ case $(md5sum "${EROOT}"${f}) in
+ ${h}*) ;;
+ *) cp -p "${EROOT}"${f} "${ED}"${f};;
+ esac
+ fi
+ done
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+ ewarn
+ ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+ ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+ ewarn "and dhcp should be removed from the default runlevel"
+ ewarn
+ fi
+}
diff --git a/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
new file mode 100644
index 00000000..13debb20
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.0-fix-perms.patch
@@ -0,0 +1,15 @@
+--- server/dhcpd.c 2003-11-05 14:08:09.000000000 -0800
++++ server/dhcpd.c 2003-11-05 14:15:32.000000000 -0800
+@@ -602,6 +602,12 @@
+ if (lftest)
+ exit (0);
+
++#if defined (PARANOIA)
++ /* Set proper permissions... */
++ if (lchown (path_dhcpd_db, set_uid, set_gid))
++ log_fatal ("lchown(%s, %d, %d): %m", path_dhcpd_db, (int) set_uid, (int) set_gid);
++#endif /* PARANOIA */
++
+ /* Discover all the network interfaces and initialize them. */
+ discover_interfaces (DISCOVER_SERVER);
+
diff --git a/net-misc/dhcp/files/dhcp-3.0-paranoia.patch b/net-misc/dhcp/files/dhcp-3.0-paranoia.patch
new file mode 100644
index 00000000..886f5cb5
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.0-paranoia.patch
@@ -0,0 +1,207 @@
+
+paranoia (non-root/chroot) patch for ISC dhcp 3.0
+file to patch: dhcp-3.0/server/dhcpd.c
+
+update from paranoia patch for ISC dhcp 2.0
+
+Adds 3 options:
+
+ -user <user>
+ -group <group>
+ -chroot <chroot_dir>
+
+Notes:
+ -DPARANOIA must be passed as an argument to the --copts option
+ of configure. Otherwise, the paranoia code will not be compiled
+ in. Example: ./configure --copts -DPARANOIA
+
+ The chroot() call has been delayed in order to allow /dev/log to
+ be reopened after the configuration file has been read. This is
+ beneficial for systems on which /dev/log is a unix domain socket.
+ The main side effect is that dhcpd.conf should be placed in /etc,
+ instead of <chroot_dir>/etc.
+
+ If dhcpd is to be run on a sysV-style architecture (or, more
+ generally, if /dev/log is a character device), one may opt to
+ create the <chroot_dir>/dev/log character device and add
+ -DEARLY_CHROOT to the --copts option of configure (in addition to
+ -DPARANOIA). This will perform the chroot() call at the earliest
+ convenience (before reading the configuration file).
+
+ If the -user option is used, the lease and pid file directories
+ should be writable to the server process after it drops
+ privileges.
+
+
+ari edelkind (12/10/2001)
+last modified 12/10/2001
+
+
+--- dhcp-3.0/server/dhcpd.c Thu Jun 21 22:12:58 2001
++++ dhcp-3.0+paranoia/server/dhcpd.c Wed Oct 17 08:23:00 2001
+@@ -56,6 +56,16 @@
+ #include "version.h"
+ #include <omapip/omapip_p.h>
+
++#if defined (PARANOIA)
++# include <sys/types.h>
++# include <unistd.h>
++# include <pwd.h>
++/* get around the ISC declaration of group */
++# define group real_group
++# include <grp.h>
++# undef group
++#endif /* PARANOIA */
++
+ static void usage PROTO ((void));
+
+ TIME cur_time;
+@@ -204,6 +214,22 @@
+ omapi_object_dereference (&listener, MDL);
+ }
+
++#if defined (PARANOIA)
++/* to be used in one of two possible scenarios */
++static void setup_chroot (char *chroot_dir) {
++ if (geteuid())
++ log_fatal ("you must be root to use chroot");
++
++ if (chroot(chroot_dir)) {
++ log_fatal ("chroot(\"%s\"): %m", chroot_dir);
++ }
++ if (chdir ("/")) {
++ /* probably permission denied */
++ log_fatal ("chdir(\"/\"): %m");
++ }
++}
++#endif /* PARANOIA */
++
+ int main (argc, argv, envp)
+ int argc;
+ char **argv, **envp;
+@@ -236,6 +262,14 @@
+ char *traceinfile = (char *)0;
+ char *traceoutfile = (char *)0;
+ #endif
++#if defined (PARANOIA)
++ char *set_user = 0;
++ char *set_group = 0;
++ char *set_chroot = 0;
++
++ uid_t set_uid = 0;
++ gid_t set_gid = 0;
++#endif /* PARANOIA */
+
+ /* Make sure we have stdin, stdout and stderr. */
+ status = open ("/dev/null", O_RDWR);
+@@ -298,6 +332,20 @@
+ if (++i == argc)
+ usage ();
+ server = argv [i];
++#if defined (PARANOIA)
++ } else if (!strcmp (argv [i], "-user")) {
++ if (++i == argc)
++ usage ();
++ set_user = argv [i];
++ } else if (!strcmp (argv [i], "-group")) {
++ if (++i == argc)
++ usage ();
++ set_group = argv [i];
++ } else if (!strcmp (argv [i], "-chroot")) {
++ if (++i == argc)
++ usage ();
++ set_chroot = argv [i];
++#endif /* PARANOIA */
+ } else if (!strcmp (argv [i], "-cf")) {
+ if (++i == argc)
+ usage ();
+@@ -397,6 +445,44 @@
+ trace_seed_stop, MDL);
+ #endif
+
++#if defined (PARANOIA)
++ /* get user and group info if those options were given */
++ if (set_user) {
++ struct passwd *tmp_pwd;
++
++ if (geteuid())
++ log_fatal ("you must be root to set user");
++
++ if (!(tmp_pwd = getpwnam(set_user)))
++ log_fatal ("no such user: %s", set_user);
++
++ set_uid = tmp_pwd->pw_uid;
++
++ /* use the user's group as the default gid */
++ if (!set_group)
++ set_gid = tmp_pwd->pw_gid;
++ }
++
++ if (set_group) {
++/* get around the ISC declaration of group */
++#define group real_group
++ struct group *tmp_grp;
++
++ if (geteuid())
++ log_fatal ("you must be root to set group");
++
++ if (!(tmp_grp = getgrnam(set_group)))
++ log_fatal ("no such group: %s", set_group);
++
++ set_gid = tmp_grp->gr_gid;
++#undef group
++ }
++
++# if defined (EARLY_CHROOT)
++ if (set_chroot) setup_chroot (set_chroot);
++# endif /* EARLY_CHROOT */
++#endif /* PARANOIA */
++
+ /* Default to the DHCP/BOOTP port. */
+ if (!local_port)
+ {
+@@ -500,6 +586,10 @@
+
+ postconf_initialization (quiet);
+
++#if defined (PARANOIA) && !defined (EARLY_CHROOT)
++ if (set_chroot) setup_chroot (set_chroot);
++#endif /* PARANOIA && !EARLY_CHROOT */
++
+ /* test option should cause an early exit */
+ if (cftest && !lftest)
+ exit(0);
+@@ -543,6 +633,22 @@
+ exit (0);
+ }
+
++#if defined (PARANOIA)
++ /* change uid to the specified one */
++
++ if (set_gid) {
++ if (setgroups (0, (void *)0))
++ log_fatal ("setgroups: %m");
++ if (setgid (set_gid))
++ log_fatal ("setgid(%d): %m", (int) set_gid);
++ }
++
++ if (set_uid) {
++ if (setuid (set_uid))
++ log_fatal ("setuid(%d): %m", (int) set_uid);
++ }
++#endif /* PARANOIA */
++
+ /* Read previous pid file. */
+ if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) {
+ status = read (i, pbuf, (sizeof pbuf) - 1);
+@@ -888,6 +994,10 @@
+
+ log_fatal ("Usage: dhcpd [-p <UDP port #>] [-d] [-f]%s%s%s%s",
+ "\n [-cf config-file] [-lf lease-file]",
++#if defined (PARANOIA)
++ /* meld into the following string */
++ "\n [-user user] [-group group] [-chroot dir]"
++#endif /* PARANOIA */
+ #if defined (TRACING)
+ "\n [-tf trace-output-file]",
+ "\n [-play trace-input-file]",
diff --git a/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
new file mode 100644
index 00000000..518efec1
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.0.3-dhclient-no-down.patch
@@ -0,0 +1,70 @@
+--- client/scripts/linux
++++ client/scripts/linux
+@@ -118,9 +118,9 @@
+ if [ x$reason = xPREINIT ]; then
+ if [ x$alias_ip_address != x ]; then
+ # Bring down alias interface. Its routes will disappear too.
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+- ifconfig $interface 0 up
++ ifconfig $interface 0.0.0.0 up
+
+ # We need to give the kernel some time to get the interface up.
+ sleep 1
+@@ -145,12 +145,12 @@
+ if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+ [ x$alias_ip_address != x$old_ip_address ]; then
+ # Possible new alias. Remove old alias.
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+ # IP address changed. Bringing down the interface will delete all routes,
+ # and clear the ARP cache.
+- ifconfig $interface inet 0 down
++ ifconfig $interface inet 0.0.0.0
+
+ fi
+ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+@@ -171,7 +171,7 @@
+ fi
+ if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+ then
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+ route add -host $alias_ip_address $interface:0
+ fi
+@@ -183,11 +183,11 @@
+ || [ x$reason = xSTOP ]; then
+ if [ x$alias_ip_address != x ]; then
+ # Turn off alias interface.
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ if [ x$old_ip_address != x ]; then
+ # Shut down interface, which will delete routes and clear arp cache.
+- ifconfig $interface inet 0 down
++ ifconfig $interface inet 0.0.0.0
+ fi
+ if [ x$alias_ip_address != x ]; then
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+@@ -198,7 +198,7 @@
+
+ if [ x$reason = xTIMEOUT ]; then
+ if [ x$alias_ip_address != x ]; then
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+@@ -223,7 +223,7 @@
+ make_resolv_conf
+ exit_with_hooks 0
+ fi
+- ifconfig $interface inet 0 down
++ ifconfig $interface inet 0.0.0.0
+ exit_with_hooks 1
+ fi
+
diff --git a/net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch b/net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch
new file mode 100644
index 00000000..89935df8
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-3.1.3-dhclient-no-down.patch
@@ -0,0 +1,77 @@
+diff -Nuar --exclude '*.orig' dhcp-3.1.3.orig//client/scripts/linux dhcp-3.1.3//client/scripts/linux
+--- dhcp-3.1.3.orig//client/scripts/linux 2010-10-15 04:59:15.890664245 +0000
++++ dhcp-3.1.3//client/scripts/linux 2010-10-15 05:04:57.940396350 +0000
+@@ -118,7 +118,7 @@
+ if [ x$reason = xPREINIT ]; then
+ if [ x$alias_ip_address != x ]; then
+ # Bring down alias interface. Its routes will disappear too.
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ if [ $relmajor -lt 2 ] || ( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] )
+ then
+@@ -127,7 +127,7 @@
+ # Add route to make broadcast work. Do not omit netmask.
+ route add default dev $interface netmask 0.0.0.0
+ else
+- ifconfig $interface 0 up
++ ifconfig $interface 0.0.0.0 up
+ fi
+
+ # We need to give the kernel some time to get the interface up.
+@@ -155,12 +155,12 @@
+ if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+ [ x$alias_ip_address != x$old_ip_address ]; then
+ # Possible new alias. Remove old alias.
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+ # IP address changed. Bringing down the interface will delete all routes,
+ # and clear the ARP cache.
+- ifconfig $interface inet 0 down
++ ifconfig $interface inet 0.0.0.0
+
+ fi
+ if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+@@ -179,7 +179,7 @@
+ fi
+ if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+ then
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+ route add -host $alias_ip_address $interface:0
+ fi
+@@ -191,11 +191,11 @@
+ || [ x$reason = xSTOP ]; then
+ if [ x$alias_ip_address != x ]; then
+ # Turn off alias interface.
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ if [ x$old_ip_address != x ]; then
+ # Shut down interface, which will delete routes and clear arp cache.
+- ifconfig $interface inet 0 down
++ ifconfig $interface inet 0.0.0.0
+ fi
+ if [ x$alias_ip_address != x ]; then
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+@@ -206,7 +206,7 @@
+
+ if [ x$reason = xTIMEOUT ]; then
+ if [ x$alias_ip_address != x ]; then
+- ifconfig $interface:0- inet 0
++ ifconfig $interface:0- inet 0.0.0.0
+ fi
+ ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+@@ -227,7 +227,7 @@
+ make_resolv_conf
+ exit_with_hooks 0
+ fi
+- ifconfig $interface inet 0 down
++ ifconfig $interface inet 0.0.0.0
+ exit_with_hooks 1
+ fi
+
diff --git a/net-misc/dhcp/files/dhcp-4.0-dhclient-ntp.patch b/net-misc/dhcp/files/dhcp-4.0-dhclient-ntp.patch
new file mode 100644
index 00000000..d3f29714
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.0-dhclient-ntp.patch
@@ -0,0 +1,216 @@
+diff -uNr dhcp-4.0.0.ORIG/client/clparse.c dhcp-4.0.0/client/clparse.c
+--- dhcp-4.0.0.ORIG/client/clparse.c 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/clparse.c 2008-09-01 11:48:17.000000000 +0100
+@@ -37,7 +37,7 @@
+
+ struct client_config top_level_config;
+
+-#define NUM_DEFAULT_REQUESTED_OPTS 9
++#define NUM_DEFAULT_REQUESTED_OPTS 10
+ struct option *default_requested_options[NUM_DEFAULT_REQUESTED_OPTS + 1];
+
+ static void parse_client_default_duid(struct parse *cfile);
+@@ -98,15 +98,20 @@
+ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 8 */
+- code = D6O_NAME_SERVERS;
++ code = DHO_NTP_SERVERS;
+ option_code_hash_lookup(&default_requested_options[7],
+- dhcpv6_universe.code_hash, &code, 0, MDL);
++ dhcp_universe.code_hash, &code, 0, MDL);
+
+ /* 9 */
+- code = D6O_DOMAIN_SEARCH;
++ code = D6O_NAME_SERVERS;
+ option_code_hash_lookup(&default_requested_options[8],
+ dhcpv6_universe.code_hash, &code, 0, MDL);
+
++ /* 10 */
++ code = D6O_DOMAIN_SEARCH;
++ option_code_hash_lookup(&default_requested_options[9],
++ dhcpv6_universe.code_hash, &code, 0, MDL);
++
+ for (code = 0 ; code < NUM_DEFAULT_REQUESTED_OPTS ; code++) {
+ if (default_requested_options[code] == NULL)
+ log_fatal("Unable to find option definition for "
+diff -uNr dhcp-4.0.0.ORIG/client/scripts/bsdos dhcp-4.0.0/client/scripts/bsdos
+--- dhcp-4.0.0.ORIG/client/scripts/bsdos 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/scripts/bsdos 2008-09-01 11:39:30.000000000 +0100
+@@ -29,6 +29,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ x$new_ntp_servers != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+diff -uNr dhcp-4.0.0.ORIG/client/scripts/freebsd dhcp-4.0.0/client/scripts/freebsd
+--- dhcp-4.0.0.ORIG/client/scripts/freebsd 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/scripts/freebsd 2008-09-01 11:39:30.000000000 +0100
+@@ -73,6 +73,26 @@
+ fi
+ fi
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+diff -uNr dhcp-4.0.0.ORIG/client/scripts/linux dhcp-4.0.0/client/scripts/linux
+--- dhcp-4.0.0.ORIG/client/scripts/linux 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/scripts/linux 2008-09-01 11:39:30.000000000 +0100
+@@ -55,6 +55,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+diff -uNr dhcp-4.0.0.ORIG/client/scripts/netbsd dhcp-4.0.0/client/scripts/netbsd
+--- dhcp-4.0.0.ORIG/client/scripts/netbsd 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/scripts/netbsd 2008-09-01 11:39:30.000000000 +0100
+@@ -29,6 +29,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+diff -uNr dhcp-4.0.0.ORIG/client/scripts/openbsd dhcp-4.0.0/client/scripts/openbsd
+--- dhcp-4.0.0.ORIG/client/scripts/openbsd 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/scripts/openbsd 2008-09-01 11:39:30.000000000 +0100
+@@ -29,6 +29,26 @@
+
+ mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+diff -uNr dhcp-4.0.0.ORIG/client/scripts/solaris dhcp-4.0.0/client/scripts/solaris
+--- dhcp-4.0.0.ORIG/client/scripts/solaris 2008-09-01 11:38:51.000000000 +0100
++++ dhcp-4.0.0/client/scripts/solaris 2008-09-01 11:39:30.000000000 +0100
+@@ -17,6 +17,26 @@
+
+ mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ fi
++ # If we're making confs, may as well make an ntp.conf too
++ make_ntp_conf
++}
++
++make_ntp_conf() {
++ if [ x$PEER_NTP = x ] || [ x$PEER_NTP = xyes ]; then
++ if [ "x$new_ntp_servers" != x ]; then
++ conf="# Generated by dhclient for interface $interface\n"
++ conf="${conf}restrict default noquery notrust nomodify\n"
++ conf="${conf}restrict 127.0.0.1\n"
++ for ntpserver in $new_ntp_servers; do
++ conf="${conf}restrict $ntpserver nomodify notrap noquery\n"
++ conf="${conf}server $ntpserver\n"
++ done
++ conf="${conf}driftfile /var/lib/ntp/ntp.drift\n"
++ conf="${conf}logfile /var/log/ntp.log\n"
++ printf "${conf}" > /etc/ntp.conf
++ chmod 644 /etc/ntp.conf
++ fi
++ fi
+ }
+
+ # Must be used on exit. Invokes the local dhcp client exit hooks, if any.
diff --git a/net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch b/net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch
new file mode 100644
index 00000000..f882a134
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.0-errwarn-message.patch
@@ -0,0 +1,31 @@
+ripped from Fedora & tweaked
+
+--- dhcp-4.2.0/omapip/errwarn.c
++++ dhcp-4.2.0/omapip/errwarn.c
+@@ -76,20 +76,13 @@
+
+ #if !defined (NOMINUM)
+ log_error ("%s", "");
+- log_error ("If you did not get this software from ftp.isc.org, please");
+- log_error ("get the latest from ftp.isc.org and install that before");
+- log_error ("requesting help.");
++ log_error ("This version of ISC DHCP is based on the release available");
++ log_error ("on ftp.isc.org. Features have been added and other changes");
++ log_error ("have been made to the base software release in order to make");
++ log_error ("it work better with this distribution.");
+ log_error ("%s", "");
+- log_error ("If you did get this software from ftp.isc.org and have not");
+- log_error ("yet read the README, please read it before requesting help.");
+- log_error ("If you intend to request help from the dhcp-server@isc.org");
+- log_error ("mailing list, please read the section on the README about");
+- log_error ("submitting bug reports and requests for help.");
+- log_error ("%s", "");
+- log_error ("Please do not under any circumstances send requests for");
+- log_error ("help directly to the authors of this software - please");
+- log_error ("send them to the appropriate mailing list as described in");
+- log_error ("the README file.");
++ log_error ("Please report for this software via the Gentoo Bugzilla site:");
++ log_error (" http://bugs.gentoo.org/");
+ log_error ("%s", "");
+ log_error ("exiting.");
+ #endif
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch b/net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch
new file mode 100644
index 00000000..ae336382
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-bind-build-flags.patch
@@ -0,0 +1,14 @@
+bind sets up BUILD_XXX vars for building native tools, but then
+doesn't use them for the "gen" tool
+
+--- a/bind/lib/export/dns/Makefile.in
++++ b/bind/lib/export/dns/Makefile.in
+@@ -166,7 +166,7 @@
+ ./gen -s ${srcdir} > code.h
+
+ gen: ${srcdir}/gen.c
+- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
++ ${BUILD_CC} ${BUILD_CFLAGS} ${CINCLUDES} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS}
+
+ #We don't need rbtdb64 for this library
+ #rbtdb64.@O@: rbtdb.c
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-bind-disable.patch b/net-misc/dhcp/files/dhcp-4.2.2-bind-disable.patch
new file mode 100644
index 00000000..4c7810e8
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-bind-disable.patch
@@ -0,0 +1,13 @@
+we take care of building this ourselves in the ebuild so
+build settings are properly respected
+
+--- dhcp-4.2.2/bind/Makefile
++++ dhcp-4.2.2/bind/Makefile
+@@ -29,6 +29,7 @@
+ bindsrcdir=bind-${version}
+
+ all:
++disable:
+ # Extract the source from the tarball, if it hasn't been already.
+ @if test -d ${bindsrcdir} ; then \
+ echo ${bindsrcdir} already unpacked... ; \
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch b/net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch
new file mode 100644
index 00000000..6136154f
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-bind-parallel-build.patch
@@ -0,0 +1,14 @@
+fix the bind subdir parallel builds
+
+https://bugs.gentoo.org/380717
+
+--- a/bind/lib/export/isc/Makefile.in
++++ b/bind/lib/export/isc/Makefile.in
+@@ -114,6 +114,7 @@
+ -DLIBAGE=${LIBAGE} \
+ -c ${srcdir}/version.c
+
++${OBJS}: | subdirs
+ libisc.@SA@: ${OBJS}
+ ${AR} ${ARFLAGS} $@ ${OBJS}
+ ${RANLIB} $@
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.2.2-dhclient-resolvconf.patch
new file mode 100644
index 00000000..28080a84
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-dhclient-resolvconf.patch
@@ -0,0 +1,409 @@
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+ if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id='';;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
+@@ -11,73 +11,45 @@
+ fi
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient )
+- exit_status=$?
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
+- else
+- if [ "x$new_domain_search" != x ]; then
+- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- elif [ "x$new_domain_name" != x ]; then
+- # Note that the DHCP 'Domain Name Option' is really just a domain
+- # name, and that this practice of using the domain name option as
+- # a search path is both nonstandard and deprecated.
+- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- fi
+- for nameserver in $new_domain_name_servers; do
+- if [ $exit_status -ne 0 ]; then
+- break
+- fi
+- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
+- exit_status=$?
+- done
+-
+- # If there were no errors, attempt to mv the new file into place.
+- if [ $exit_status -eq 0 ]; then
+- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
+- exit_status=$?
+- fi
+-
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
++ # Note that the DHCP 'Domain Name Option' is really just a domain
++ # name, and that this practice of using the domain name option as
++ # a search path is both nonstandard and deprecated.
++ conf="${conf}search ${new_domain_name}\n"
+ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver ${nameserver}\n"
++ done
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
+- else
+- if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- fi
+- for nameserver in ${new_dhcp6_name_servers} ; do
+- if [ $exit_status -ne 0 ] ; then
+- break
+- fi
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id='';;
+ esac
+- ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- done
+-
+- if [ $exit_status -eq 0 ] ; then
+- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
+- exit_status=$?
+- fi
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
++ done
++ fi
+
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
+ fi
+ fi
+ }
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -26,44 +26,49 @@
+ ip=/sbin/ip
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- chmod 644 /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ shopt -s nocasematch
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ if [[ "$nameserver" =~ ^fe80:: ]]
+ then
+ zone_id="%$interface"
+ else
+ zone_id=
+ fi
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
+ shopt -u nocasematch
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
+- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ "x$new_domain_name" != x ]; then
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
++ if [ x"$new_domain_name_servers" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id='';;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
+- if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
++ if [ x"$new_domain_name_servers" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id='';;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/solaris
++++ b/client/scripts/solaris
+@@ -1,21 +1,39 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
++ done
++ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch b/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch
new file mode 100644
index 00000000..bf5a54c3
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-dhclient-stdin-conf.patch
@@ -0,0 +1,113 @@
+--- dhcp-4.2.2/client/clparse.c
++++ dhcp-4.2.2/client/clparse.c
+@@ -182,6 +182,10 @@ isc_result_t read_client_conf ()
+ #endif
+ }
+
++ /* Read any extra configuration from stdin */
++ extern int read_client_conf_stdin (struct interface_info *ip, struct client_config *client);
++ read_client_conf_stdin (NULL, &top_level_config);
++
+ /* Set up state and config structures for clients that don't
+ have per-interface configuration statements. */
+ config = (struct client_config *)0;
+@@ -211,23 +215,13 @@ isc_result_t read_client_conf ()
+ return status;
+ }
+
+-int read_client_conf_file (const char *name, struct interface_info *ip,
++int read_client_conf_actual (struct parse *cfile, struct interface_info *ip,
+ struct client_config *client)
+ {
+- int file;
+- struct parse *cfile;
+ const char *val;
+ int token;
+ isc_result_t status;
+
+- if ((file = open (name, O_RDONLY)) < 0)
+- return uerr2isc (errno);
+-
+- cfile = NULL;
+- status = new_parse(&cfile, file, NULL, 0, path_dhclient_conf, 0);
+- if (status != ISC_R_SUCCESS || cfile == NULL)
+- return status;
+-
+ do {
+ token = peek_token (&val, (unsigned *)0, cfile);
+ if (token == END_OF_FILE)
+@@ -238,10 +232,74 @@ int read_client_conf_file (const char *name, struct interface_info *ip,
+ status = (cfile -> warnings_occurred
+ ? DHCP_R_BADPARSE
+ : ISC_R_SUCCESS);
++ return status;
++}
++
++int read_client_conf_file (const char *name, struct interface_info *ip,
++ struct client_config *client)
++{
++ int file;
++ struct parse *cfile;
++ isc_result_t status;
++
++ if ((file = open (name, O_RDONLY)) < 0)
++ return uerr2isc (errno);
++
++ cfile = (struct parse *)0;
++ new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
++ status = read_client_conf_actual(cfile, ip, client);
+ end_parse (&cfile);
+ return status;
+ }
+
++int read_client_conf_stdin (struct interface_info *ip,
++ struct client_config *client)
++{
++ int file;
++ char *buffer = NULL, *p;
++ unsigned buflen, len = 0;
++ struct parse *cfile;
++ size_t bytes;
++ isc_result_t status;
++
++ file = fileno(stdin);
++ if (isatty (file))
++ return ISC_R_NOTFOUND;
++ if (fcntl (file, F_SETFL, O_NONBLOCK) < 0)
++ log_fatal ("could not set stdin to non blocking!");
++
++ buflen = BUFSIZ;
++ buffer = malloc (BUFSIZ + 1);
++ p = buffer;
++ do {
++ bytes = read (file, p, BUFSIZ);
++ if (bytes == 0)
++ break;
++ if (bytes == -1)
++ log_fatal ("failed to read stdin!");
++ if (bytes >= BUFSIZ) {
++ buflen += BUFSIZ;
++ len += BUFSIZ;
++ buffer = realloc (buffer, buflen + 1);
++ if (!buffer)
++ log_fatal ("not enough buffer to read stdin!");
++ p = buffer + len;
++ } else {
++ len += bytes;
++ break;
++ }
++ } while(1);
++ buffer[len] = '\0';
++
++ cfile = (struct parse *)0;
++ status = new_parse (&cfile, -1, buffer, len, "stdin", 0);
++ if (status == ISC_R_SUCCESS) {
++ status = read_client_conf_actual (cfile, ip, client);
++ end_parse (&cfile);
++ }
++ free(buffer);
++ return status;
++}
+
+ /* lease-file :== client-lease-statements END_OF_FILE
+ client-lease-statements :== <nil>
diff --git a/net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch b/net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch
new file mode 100644
index 00000000..27fb2b0e
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.2-nogateway.patch
@@ -0,0 +1,46 @@
+http://bugs.gentoo.org/265531
+
+--- dhcp-4.2.2/client/scripts/linux
++++ dhcp-4.2.2/client/scripts/linux
+@@ -193,12 +193,14 @@
+ ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+ # Add a network route to the computed network address.
+- for router in $new_routers; do
+- if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
+- fi
+- route add default gw $router $metric_arg dev $interface
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ for router in $new_routers; do
++ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
++ route add -host $router dev $interface
++ fi
++ route add default gw $router $metric_arg dev $interface
++ done
++ fi
+ else
+ # we haven't changed the address, have we changed other options
+ # that we wish to update?
+@@ -244,12 +246,14 @@
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+ route add -host $alias_ip_address dev $interface:0
+ fi
+- for router in $new_routers; do
+- if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+- route add -host $router dev $interface
+- fi
+- route add default gw $router $metric_arg dev $interface
+- done
++ if [ x$PEER_ROUTERS = x ] || [ x$PEER_ROUTERS = xyes ]; then
++ for router in $new_routers; do
++ if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
++ route add -host $router dev $interface
++ fi
++ route add default gw $router $metric_arg dev $interface
++ done
++ fi
+ make_resolv_conf
+ exit_with_hooks 0
+ fi
diff --git a/net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch b/net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch
new file mode 100644
index 00000000..6cec86c9
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.4-always-accept-4.patch
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/437108
+
+always accept the -4 option even if we don't have IPv6 support enabled.
+the relay code does this already.
+
+--- a/client/dhclient.c
++++ b/client/dhclient.c
+@@ -170,8 +170,8 @@ main(int argc, char **argv) {
+ if (!strcmp(argv[i], "-r")) {
+ release_mode = 1;
+ no_daemon = 1;
+-#ifdef DHCPv6
+ } else if (!strcmp(argv[i], "-4")) {
++#ifdef DHCPv6
+ if (local_family_set && local_family != AF_INET)
+ log_fatal("Client can only do v4 or v6, not "
+ "both.");
+--- a/server/dhcpd.c
++++ b/server/dhcpd.c
+@@ -373,8 +373,8 @@ main(int argc, char **argv) {
+ } else if (!strcmp (argv [i], "-q")) {
+ quiet = 1;
+ quiet_interface_discovery = 1;
+-#ifdef DHCPv6
+ } else if (!strcmp(argv[i], "-4")) {
++#ifdef DHCPv6
+ if (local_family_set && (local_family != AF_INET)) {
+ log_fatal("Server cannot run in both IPv4 and "
+ "IPv6 mode at the same time.");
diff --git a/net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch b/net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch
new file mode 100644
index 00000000..66a1fcd7
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.4-quieter-ping.patch
@@ -0,0 +1,72 @@
+https://bugs.gentoo.org/296921
+
+`ping -q` will still print out summary information. send that to /dev/null.
+
+patch by Martin Mokrejš
+
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
+@@ -251,7 +251,7 @@ if [ x$reason = xTIMEOUT ]; then
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
+@@ -284,7 +284,7 @@ if [ x$reason = xTIMEOUT ]; then
+ if [ -n "$new_routers" ]; then
+ $LOGGER "New Routers: $new_routers"
+ set -- $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -253,7 +253,7 @@ if [ x$reason = xTIMEOUT ]; then
+ ifconfig $interface inet $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg
+ set $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
+@@ -251,7 +251,7 @@ if [ x$reason = xTIMEOUT ]; then
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
+@@ -245,7 +245,7 @@ if [ x$reason = xTIMEOUT ]; then
+ sleep 1
+ if [ "$new_routers" != "" ]; then
+ set $new_routers
+- if ping -q -c 1 -w 1 $1; then
++ if ping -q -c 1 -w 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
+--- a/client/scripts/openwrt
++++ b/client/scripts/openwrt
+@@ -186,7 +186,7 @@ if [ x$reason = xTIMEOUT ]; then
+ ifconfig $interface $new_ip_address $new_subnet_arg \
+ $new_broadcast_arg $mtu_arg $metric_arg
+ set $new_routers
+- if ping -q -c 1 $1; then
++ if ping -q -c 1 $1 >/dev/null; then
+ if [ x$new_ip_address != x$alias_ip_address ] && \
+ [ x$alias_ip_address != x ]; then
+ ifconfig $interface:0 $alias_ip_address $alias_subnet_arg
diff --git a/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch b/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch
new file mode 100644
index 00000000..77254c32
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.5-bindtodevice-inet6.patch
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/471142
+
+snipped from fedora
+
+# dhclient -6: bind socket to interface (#1001742)
+# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #34784])
+
+diff -up dhcp-4.2.5/common/socket.c.bindtodevice_inet6 dhcp-4.2.5/common/socket.c
+--- dhcp-4.2.5/common/socket.c.bindtodevice_inet6 2013-09-17 16:47:05.000000000 +0200
++++ dhcp-4.2.5/common/socket.c 2013-09-17 16:48:18.975997842 +0200
+@@ -245,7 +245,7 @@ if_register_socket(struct interface_info
+
+ #if defined(SO_BINDTODEVICE)
+ /* Bind this socket to this interface. */
+- if ((local_family != AF_INET6) && (info->ifp != NULL) &&
++ if (((do_multicast == 0)||(*do_multicast == 0)) && (info->ifp != NULL) &&
+ setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE,
+ (char *)(info -> ifp), sizeof(*(info -> ifp))) < 0) {
+ log_fatal("setsockopt: SO_BINDTODEVICE: %m");
diff --git a/net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch b/net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch
new file mode 100644
index 00000000..ea223ed3
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.2.5-iproute2-path.patch
@@ -0,0 +1,15 @@
+find `ip` via $PATH and not hardcoded path
+
+https://bugs.gentoo.org/480636
+
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -23,7 +23,7 @@
+ # of the $1 in its args.
+
+ # 'ip' just looks too weird. /sbin/ip looks less weird.
+-ip=/sbin/ip
++ip=ip
+
+ make_resolv_conf() {
+ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
diff --git a/net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch b/net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch
new file mode 100644
index 00000000..71d3f2c6
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.1-dhclient-resolvconf.patch
@@ -0,0 +1,411 @@
+resolvconf support in dhclient-script
+
+--- a/client/scripts/bsdos
++++ b/client/scripts/bsdos
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+ if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_search}\n"
+ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >> /etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/freebsd
++++ b/client/scripts/freebsd
+@@ -11,73 +11,45 @@
+ fi
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient )
+- exit_status=$?
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient: Error $exit_status"
+- else
+- if [ "x$new_domain_search" != x ]; then
+- ( echo search $new_domain_search >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- elif [ "x$new_domain_name" != x ]; then
+- # Note that the DHCP 'Domain Name Option' is really just a domain
+- # name, and that this practice of using the domain name option as
+- # a search path is both nonstandard and deprecated.
+- ( echo search $new_domain_name >> /etc/resolv.conf.dhclient )
+- exit_status=$?
+- fi
+- for nameserver in $new_domain_name_servers; do
+- if [ $exit_status -ne 0 ]; then
+- break
+- fi
+- ( echo nameserver $nameserver >>/etc/resolv.conf.dhclient )
+- exit_status=$?
+- done
+-
+- # If there were no errors, attempt to mv the new file into place.
+- if [ $exit_status -eq 0 ]; then
+- ( mv /etc/resolv.conf.dhclient /etc/resolv.conf )
+- exit_status=$?
+- fi
+-
+- if [ $exit_status -ne 0 ]; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
++ # Note that the DHCP 'Domain Name Option' is really just a domain
++ # name, and that this practice of using the domain name option as
++ # a search path is both nonstandard and deprecated.
++ conf="${conf}search ${new_domain_name}\n"
+ fi
++ for nameserver in $new_domain_name_servers; do
++ conf="${conf}nameserver ${nameserver}\n"
++ done
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- ( cat /dev/null > /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Unable to create /etc/resolv.conf.dhclient6: Error $exit_status"
+- else
+- if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- ( echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- fi
+- for nameserver in ${new_dhcp6_name_servers} ; do
+- if [ $exit_status -ne 0 ] ; then
+- break
+- fi
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- ( echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6 )
+- exit_status=$?
+- done
+-
+- if [ $exit_status -eq 0 ] ; then
+- ( mv /etc/resolv.conf.dhclient6 /etc/resolv.conf )
+- exit_status=$?
+- fi
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
++ done
++ fi
+
+- if [ $exit_status -ne 0 ] ; then
+- $LOGGER "Error while writing new /etc/resolv.conf."
+- fi
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
+ fi
+ fi
+ }
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -26,44 +26,49 @@
+ ip=/sbin/ip
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- chmod 644 /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ shopt -s nocasematch
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ if [[ "$nameserver" =~ ^fe80:: ]]
+ then
+ zone_id="%$interface"
+ else
+ zone_id=
+ fi
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
+ shopt -u nocasematch
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/netbsd
++++ b/client/scripts/netbsd
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
+- if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ "x$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ "x$new_domain_name" != x ]; then
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
++ if [ x"$new_domain_name_servers" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/openbsd
++++ b/client/scripts/openbsd
+@@ -1,40 +1,46 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
+- if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
++ if [ x"$new_domain_name_servers" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
+ done
+-
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
+ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+- cat /dev/null > /etc/resolv.conf.dhclient6
+- chmod 644 /etc/resolv.conf.dhclient6
+-
+ if [ "x${new_dhcp6_domain_search}" != x ] ; then
+- echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
+ fi
+ for nameserver in ${new_dhcp6_name_servers} ; do
+ # If the nameserver has a link-local address
+ # add a <zone_id> (interface name) to it.
+ case $nameserver in
+ fe80:*) zone_id="%$interface";;
+ FE80:*) zone_id="%$interface";;
+ *) zone_id="";;
+ esac
+- echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++ conf="${conf}nameserver ${nameserver}$zone_id\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
+--- a/client/scripts/solaris
++++ b/client/scripts/solaris
+@@ -1,21 +1,39 @@
+ #!/bin/sh
+
+ make_resolv_conf() {
++ if [ x"$PEER_DNS" != x ] && [ x"$PEER_DNS" != xyes ]; then
++ return 0
++ fi
++ local conf=
+ if [ x"$new_domain_name_servers" != x ]; then
+- cat /dev/null > /etc/resolv.conf.dhclient
+- if [ x"$new_domain_search" != x ]; then
+- echo search $new_domain_search >> /etc/resolv.conf.dhclient
+- elif [ x"$new_domain_name" != x ]; then
++ if [ "x$new_domain_search" != x ]; then
++ conf="${conf}search ${new_domain_search}\n"
++ elif [ "x$new_domain_name" != x ]; then
+ # Note that the DHCP 'Domain Name Option' is really just a domain
+ # name, and that this practice of using the domain name option as
+ # a search path is both nonstandard and deprecated.
+- echo search $new_domain_name >> /etc/resolv.conf.dhclient
++ conf="${conf}search ${new_domain_name}\n"
+ fi
+ for nameserver in $new_domain_name_servers; do
+- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++ conf="${conf}nameserver ${nameserver}\n"
++ done
++ elif [ "x${new_dhcp6_name_servers}" != x ] ; then
++ if [ "x${new_dhcp6_domain_search}" != x ] ; then
++ conf="${conf}search ${new_dhcp6_domain_search}\n"
++ fi
++ for nameserver in ${new_dhcp6_name_servers} ; do
++ conf="${conf}nameserver ${nameserver}\n"
+ done
++ fi
+
+- mv /etc/resolv.conf.dhclient /etc/resolv.conf
++ if [ x"$conf" != x ]; then
++ conf="# Generated by dhclient or interface $interface\n${conf}"
++ if type resolvconf >/dev/null 2>&1; then
++ printf "${conf}" | resolvconf -a $interface
++ else
++ printf "${conf}" > /etc/resolv.conf
++ chmod 644 /etc/resolv.conf
++ fi
+ fi
+ }
+
diff --git a/net-misc/dhcp/files/dhcp-4.3.2-fix-compilation-for-musl.patch b/net-misc/dhcp/files/dhcp-4.3.2-fix-compilation-for-musl.patch
new file mode 100644
index 00000000..841f7276
--- /dev/null
+++ b/net-misc/dhcp/files/dhcp-4.3.2-fix-compilation-for-musl.patch
@@ -0,0 +1,44 @@
+diff -Naur dhcp-4.3.2.orig/dst/dst_api.c dhcp-4.3.2/dst/dst_api.c
+--- dhcp-4.3.2.orig/dst/dst_api.c 2015-02-26 20:35:43.000000000 +0100
++++ dhcp-4.3.2/dst/dst_api.c 2015-05-19 01:11:22.520053688 +0200
+@@ -49,6 +49,7 @@
+ #include <sys/param.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+
+ #include "cdefs.h"
+diff -Naur dhcp-4.3.2.orig/dst/dst_internal.h dhcp-4.3.2/dst/dst_internal.h
+--- dhcp-4.3.2.orig/dst/dst_internal.h 2015-02-26 20:35:43.000000000 +0100
++++ dhcp-4.3.2/dst/dst_internal.h 2015-05-19 01:02:22.090054505 +0200
+@@ -20,6 +20,7 @@
+ */
+ #include <limits.h>
+ #include <sys/param.h>
++#include <sys/types.h>
+
+ #ifndef PATH_MAX
+ # ifdef POSIX_PATH_MAX
+diff -Naur dhcp-4.3.2.orig/dst/dst_support.c dhcp-4.3.2/dst/dst_support.c
+--- dhcp-4.3.2.orig/dst/dst_support.c 2015-02-26 20:35:43.000000000 +0100
++++ dhcp-4.3.2/dst/dst_support.c 2015-05-19 01:10:29.790053768 +0200
+@@ -25,6 +25,7 @@
+ #include <sys/stat.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+
+ #include "cdefs.h"
+ #include "osdep.h"
+diff -Naur dhcp-4.3.2.orig/dst/hmac_link.c dhcp-4.3.2/dst/hmac_link.c
+--- dhcp-4.3.2.orig/dst/hmac_link.c 2015-02-26 20:35:43.000000000 +0100
++++ dhcp-4.3.2/dst/hmac_link.c 2015-05-19 01:12:14.190053610 +0200
+@@ -31,6 +31,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+
+ #include "cdefs.h"
+ #include "osdep.h"
diff --git a/net-misc/dhcp/files/dhcpd.conf2 b/net-misc/dhcp/files/dhcpd.conf2
new file mode 100644
index 00000000..5cd2eeca
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd.conf2
@@ -0,0 +1,28 @@
+# /etc/conf.d/dhcpd: config file for /etc/init.d/dhcpd
+
+# If you require more than one instance of dhcpd you can create symbolic
+# links to dhcpd service like so
+# cd /etc/init.d
+# ln -s dhcpd dhcpd.foo
+# cd ../conf.d
+# cp dhcpd dhcpd.foo
+# Now you can edit dhcpd.foo and specify a different configuration file.
+# You'll also need to specify a pidfile in that dhcpd.conf file.
+# See the pid-file-name option in the dhcpd.conf man page for details.
+
+# If you wish to run dhcpd in a chroot, uncomment the following line
+# DHCPD_CHROOT="/var/lib/dhcp/chroot"
+
+# All file paths below are relative to the chroot.
+# You can specify a different chroot directory but MAKE SURE it's empty.
+
+# Specify a configuration file - the default is /etc/dhcp/dhcpd.conf
+# DHCPD_CONF="/etc/dhcp/dhcpd.conf"
+
+# Configure which interface or interfaces to for dhcpd to listen on.
+# List all interfaces space separated. If this is not specified then
+# we listen on all interfaces.
+# DHCPD_IFACE=""
+
+# Insert any other dhcpd options - see the man page for a full list.
+# DHCPD_OPTS=""
diff --git a/net-misc/dhcp/files/dhcpd.init5 b/net-misc/dhcp/files/dhcpd.init5
new file mode 100755
index 00000000..65148e08
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd.init5
@@ -0,0 +1,115 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init5,v 1.6 2015/02/10 00:27:08 polynomial-c Exp $
+
+extra_commands="configtest"
+
+: ${DHCPD_CONF:=/etc/dhcp/${SVCNAME}.conf}
+
+depend() {
+ need net
+ use logger dns #@slapd@
+}
+
+get_var() {
+ local var="$(sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' "${chroot}${DHCPD_CONF}")"
+ echo ${var:-$2}
+}
+
+checkconfig() {
+ set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t
+
+ dhcpd "$@" 1>/dev/null 2>&1
+ local ret=$?
+ if [ ${ret} -ne 0 ] ; then
+ eerror "${SVCNAME} has detected a syntax error in your configuration files:"
+ dhcpd "$@"
+ fi
+
+ return ${ret}
+}
+
+configtest() {
+ local chroot=${DHCPD_CHROOT%/}
+
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+start() {
+ local chroot=${DHCPD_CHROOT%/}
+
+ # Work out our cffile if it's in our DHCPD_OPTS
+ case " ${DHCPD_OPTS} " in
+ *" -cf "*)
+ DHCPD_CONF=" ${DHCPD_OPTS} "
+ DHCPD_CONF="${DHCPD_CONF##* -cf }"
+ DHCPD_CONF="${DHCPD_CONF%% *}"
+ ;;
+ *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}"
+ ;;
+ esac
+
+ if [ -n "${chroot}" ] ; then
+ # the config test want's these to exist
+ mkdir -p \
+ "${chroot}"/var/run/dhcp \
+ "${chroot}"/var/lib/dhcp \
+ "${chroot}"/etc/dhcp
+ fi
+
+ # see comment in get_var() above
+ if [ ! -f "${chroot}${DHCPD_CONF}" ] ; then
+ eerror "${chroot}${DHCPD_CONF} does not exist"
+ return 1
+ fi
+
+ checkconfig || return 1
+
+ checkpath -d -o dhcp:dhcp "${chroot}"/var/run/dhcp "${chroot}"/var/lib/dhcp
+
+ local leasefile="$(get_var lease-file-name /var/lib/dhcp/${SVCNAME}.leases)"
+ checkpath -f -o dhcp:dhcp "${chroot}${leasefile}"
+
+ # Setup LD_PRELOAD so name resolution works in our chroot.
+ if [ -n "${chroot}" ] ; then
+ checkpath -d -o root:root -m 755 "${chroot}"/dev "${chroot}"/etc "${chroot}"/proc
+ cp -pP /etc/localtime /etc/resolv.conf "${chroot}"/etc/
+ export LD_PRELOAD="${LD_PRELOAD} libresolv.so libnss_dns.so"
+ if ! mountinfo -q "${chroot}/proc" ; then
+ mount --bind /proc "${chroot}/proc"
+ fi
+ fi
+
+ local pidfile="$(get_var pid-file-name /var/run/dhcp/${SVCNAME}.pid)"
+
+ ebegin "Starting ${chroot:+chrooted }${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/dhcpd \
+ --pidfile "${chroot}/${pidfile}" \
+ -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \
+ -user dhcp -group dhcp \
+ ${chroot:+-chroot} ${chroot} ${DHCPD_IFACE}
+ eend $? \
+ && save_options dhcpd_chroot "${chroot}" \
+ && save_options pidfile "${pidfile}"
+}
+
+stop() {
+ local chroot="$(get_options dhcpd_chroot)"
+ [ -z "$chroot" ] && chroot="$(get_options chroot)"
+
+ ebegin "Stopping ${chroot:+chrooted }${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/sbin/dhcpd \
+ --pidfile "${chroot}/$(get_options pidfile)"
+ res=$?
+
+ if [ ${res} -eq 0 ] && [ -n "${chroot}" ] ; then
+ if mountinfo -q "${chroot}/proc" ; then
+ umount "${chroot}/proc"
+ fi
+ fi
+
+ eend $res
+}
diff --git a/net-misc/dhcp/files/dhcpd.tmpfiles b/net-misc/dhcp/files/dhcpd.tmpfiles
new file mode 100644
index 00000000..ee2f4dee
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd.tmpfiles
@@ -0,0 +1,2 @@
+d /var/lib/dhcp/ 0755 dhcp dhcp
+f /var/lib/dhcp/dhcpd.leases 0644 dhcp dhcp \ No newline at end of file
diff --git a/net-misc/dhcp/files/dhcpd4.service b/net-misc/dhcp/files/dhcpd4.service
new file mode 100644
index 00000000..b064bd9b
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd4.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCPv4 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcp -group dhcp --no-pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcpd6.service b/net-misc/dhcp/files/dhcpd6.service
new file mode 100644
index 00000000..603cacd8
--- /dev/null
+++ b/net-misc/dhcp/files/dhcpd6.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=DHCPv6 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+ExecStart=/usr/sbin/dhcpd -f -s -6 -cf /etc/dhcp/dhcpd.conf -user dhcp -group dhcp --no-pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcrelay.conf b/net-misc/dhcp/files/dhcrelay.conf
new file mode 100644
index 00000000..44699682
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay.conf
@@ -0,0 +1,16 @@
+# /etc/conf.d/dhcrelay: config file for /etc/init.d/dhcrelay
+
+# Configure which interface or interfaces to for dhcrelay to listen on
+# and send to.
+# List all interfaces space separated. If this is not specified then
+# we use all interfaces.
+#IFACE=""
+# If you have split net interfaces, you might want to depend on them
+# explicitly here.
+#rc_need=$(printf 'net.%s ' ${IFACE})
+
+# Insert any other options needed. See dhcrelay(8) for details.
+#DHCRELAY_OPTS=""
+
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+DHCRELAY_SERVERS=""
diff --git a/net-misc/dhcp/files/dhcrelay.init3 b/net-misc/dhcp/files/dhcrelay.init3
new file mode 100755
index 00000000..fe4ec8c6
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay.init3
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcrelay.init3,v 1.3 2012/11/11 21:42:02 vapier Exp $
+
+depend() {
+ need net
+ use logger #@slapd@
+}
+
+start() {
+ if [ -z "${DHCRELAY_SERVERS}" ] ; then
+ eerror "No DHCRELAY_SERVERS specified in /etc/conf.d/${SVCNAME}"
+ return 1
+ fi
+
+ checkpath -d /var/run/dhcp
+
+ local iface_opts
+ if [ -n "${IFACE}" ] ; then
+ iface_opts=$(printf -- '-i %s ' ${IFACE})
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/dhcrelay \
+ -- -q ${iface_opts} ${DHCRELAY_OPTS} ${DHCRELAY_SERVERS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --pidfile /var/run/dhcp/${SVCNAME}.pid
+ eend $?
+}
diff --git a/net-misc/dhcp/files/dhcrelay4.service b/net-misc/dhcp/files/dhcrelay4.service
new file mode 100644
index 00000000..09e835d4
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay4.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+Documentation=man:dhcrelay(8)
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/dhcrelay -d --no-pid $DHCRELAY_SERVERS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcrelay4.service.conf b/net-misc/dhcp/files/dhcrelay4.service.conf
new file mode 100644
index 00000000..1a0465b7
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay4.service.conf
@@ -0,0 +1,3 @@
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+[Service]
+Environment="DHCRELAY_SERVERS=" \ No newline at end of file
diff --git a/net-misc/dhcp/files/dhcrelay6.conf b/net-misc/dhcp/files/dhcrelay6.conf
new file mode 100644
index 00000000..4e8b8c6f
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay6.conf
@@ -0,0 +1,8 @@
+# /etc/conf.d/dhcrelay6: config file for /etc/init.d/dhcrelay6
+
+# Insert any other options needed. See dhcrelay(8) for details.
+# Make sure you specify the lower (-l)/upper (-u) interfaces.
+DHCRELAY_OPTS="-6 -l lower-iface -u upper-iface"
+
+# Space separated list of IPs to forward BOOTP/DHCP packets to.
+DHCRELAY_SERVERS=""
diff --git a/net-misc/dhcp/files/dhcrelay6.service b/net-misc/dhcp/files/dhcrelay6.service
new file mode 100644
index 00000000..1e5e4988
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay6.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+Documentation=man:dhcrelay(8)
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/dhcrelay -d --no-pid -6 -l $lower-iface -u $upper-iface $DHCRELAY_SERVERS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/dhcp/files/dhcrelay6.service.conf b/net-misc/dhcp/files/dhcrelay6.service.conf
new file mode 100644
index 00000000..ae293ab4
--- /dev/null
+++ b/net-misc/dhcp/files/dhcrelay6.service.conf
@@ -0,0 +1,6 @@
+[Service]
+# Space separated list of IPs to forward BOOTP/DHCP packets to
+Environment="DHCRELAY_SERVERS="
+# Make sure you specify the lower (-l)/upper (-u) interfaces
+Environment="lower-iface="
+Environment="upper-iface="
diff --git a/net-misc/dhcp/metadata.xml b/net-misc/dhcp/metadata.xml
new file mode 100644
index 00000000..9ee69445
--- /dev/null
+++ b/net-misc/dhcp/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>
+ <longdescription lang="en">The ISC DHCP client/server package.</longdescription>
+ <longdescription lang="ja">ISC DHCP クライアント/サーバ・パッケージです。</longdescription>
+ <use>
+ <flag name='client'>Install the dhclient program</flag>
+ <flag name='server'>Install the dhcpd and dhcrelay programs</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:isc:dhcp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/iputils/Manifest b/net-misc/iputils/Manifest
new file mode 100644
index 00000000..61034fd1
--- /dev/null
+++ b/net-misc/iputils/Manifest
@@ -0,0 +1,19 @@
+AUX 021109-uclibc-no-ether_ntohost.patch 635 SHA256 cf8135fd380918890a1da8de438d5283111f1e9ea0754b4f5c78bb703fcf617b SHA512 29ccbbf19bd40e9c929af403227f49586a4cb79d7ef948710b34b0813d116017530ef1bf0082b093b4179edff1daa275906cfb9a565f61dd5bed10f24b66fd38 WHIRLPOOL e5390a41b0764d78cda651dd6fff2ebd4f206dc6f5b34da370c19cee7d44f373035fc1efa2bf90924b5a06ca48f344f80a2c902abe04eb588d01e0a9d59bf79d
+AUX iputils-20100418-makefile.patch 974 SHA256 910914b0184a65aa15d42979bb7e3d272697310231005673cf2f46648deb6a4b SHA512 c3c9096cd2587e39afdd0a78291a4f67249e2fc75c303cd648a795f7c88dc7e9e2c27f3f56fe6d7d40bdcb0d179dfd35f1c991ba8fd3524149f8cbb94d9ef0ca WHIRLPOOL b4fa577f4b52792165abda924a1980fb1101c7f5a15714b4a9647535e5be622c54e6ef0f731212a74b1a6fc1ddfcf54f98e5c0a0c540e0113823e7646dd6df8a
+AUX iputils-20100418-printf-size.patch 1658 SHA256 95ce6cdf73cd5dbfbd962131fc1f6513713d4874ca161f5b24eaed21d58a1cfc SHA512 556237d39043815f196b0f22ec552bfb52ad2d45b2faf67e26712361bc11acd21cec42b8241ccf72778b421b9f456a37e9466dbfc03c0df2be1e1bb5ae48a92e WHIRLPOOL 80d03f09a6b023413845f5fe12e6decd87e70c143ad79215d66b1fd29c42bf7b61580addac910dd2134c9d4bf41432f21c7a63184e76aa1bdd936621da6b12d6
+AUX iputils-20100418-so_mark.patch 597 SHA256 3c0c3e93d3b458a02f856be3681c2dd5bfb18933e4752e90dc277cdd353b3576 SHA512 453ef3f8c53e2c2cef54f19219b892e51a83a6109f73a4f10712aec729509f02e6b830ab7ca85843a70f3d9c9860f084b256290f638741d573a5205ba89fe469 WHIRLPOOL 502e9ee110555644fd7d19d64afba3d2777844faca6fe0111b4b7356e3262c011b8de13475db1e70dff9225e3883d7e3e27d1f96f240a80d4c5c9ab0a29c9560
+AUX iputils-20101006-owl-pingsock.diff 6390 SHA256 1425efd6d30e6c9682569ff1de731922351048f81df44a2ebad30cca85fc51c9 SHA512 0e609aa8088572244a57d719124df2719d5b0a3b37861afb08aa434192c1801e03617254b7caca8f47749cf72c2da8c52f007eb0c136a64f5abd44ad9960cc1d WHIRLPOOL dc9824a7761fd384e8a5c991d02201cb18b4aeb666a0d83ca18ce0e59216a46831a219629d796beacb048fb647841d178d64f478288b8e9d2766e10f2d129a10
+AUX iputils-20121221-add-bits_types_h.patch 3092 SHA256 e198400f387fa4140c7c6a75089b570ea24d044cf6fd55b1f37f239bb018969e SHA512 666c1711c5a5c829246a0f9a3d9afbb0ceb43e172b907230b856dbc0a330814d0c562e1894ee3b6051c01b54469fafd429c4236954967691b12744cacc844dab WHIRLPOOL 0014a8394f4e7bc002d572d8eeec3cb49809a172eaf93b3f62d4b91b741c7b8bd36b4b8b830ed16b6972102e9a3c4c730b50039d6731c0abb6203aeab44d33ba
+AUX iputils-20121221-crypto-build.patch 1325 SHA256 cafc281c70d46f2964489b4c19c981bcf203b4c6266d4f49437c3fe67e2027b2 SHA512 922daa01f00c19f8237515b2d3ab73b87daa957cfc491382def2ce1c098ffed943ad4952c94134f3155570f64353abf5348523ea773ce7eb457578f975cc92d2 WHIRLPOOL a39c7dbb9b37849cc3560dc1f814a8c18a9ff9b55e19c3587a7c49286d55323f96d42d33c6f2723d3868506c252272e1d2d6bc3370eb935b479c89514f03c9c5
+AUX iputils-20121221-fix-header-order.patch 568 SHA256 d1ccc1defcd02ee0d0cb92d440bc786a8f508db5ee75b6c6566374d4b2a4114d SHA512 530334d2e89c13e3a15f4098a1a9eff9bda9d60118fd6e6ceba30453513c5deb9e33f609206a220c7a4af52704bfe6d3be1baa7a218265b0b6c9b95475b5cc7d WHIRLPOOL 01a377c067aed7e4c3be96bab4d74e9bcde48d7b73d65aa2184d9416dbdf02962b87a5c77dc4966890798f698128c5bb81021051071ee41fe5386d0efebb08fd
+AUX iputils-20121221-fix-init-elemnt.patch 677 SHA256 302b1118596befdad56d23769e36fc0960d807230bc5c6ad4ad59d00fb78560b SHA512 15cc4a96851eaa77f08e3914139925cecc50ff7161a693e86cb6f5ae09da5c2d232325f922c1cf4af20d639ed89071314092f31fa55e23bc5033bfb74eeda7a3 WHIRLPOOL 7bbd1d869275fe96b0377da3ea345bd5d60ff903f37a45967a146ab149f714aced59f66aa247bd0a028a62094823d7f46b8333dcb38a6366c978a88f38ff5ec3
+AUX iputils-20121221-fix-musl-headers.patch 2616 SHA256 bdd3992ed19d625cfd08563ef46ab22f25ca46390ad4603e501f9c66d2508bcc SHA512 82b88635e5fec34b4175c74d25b821d3b76b899c48aa87b7035ae8702a3ede3abaebb3d9be32cb7e853186d78db5e9c03cdd14cfc1ce9481f6ae65466815bdac WHIRLPOOL 6e39b744edd175b82cece11b1d7d18083c78bfb16210c99b7e427d6382dc6722c49fd13606cd8cb14105b4ce447e44a2dac4413093495d3a4db424f3359ce907
+AUX iputils-20121221-makefile.patch 1791 SHA256 779632822e3440f3b898a50955cb8fb72177f0d1623c9da7c0a8afa68313435f SHA512 5899942b73d4d13e0ff85f22a81e9107b2a04c82cac6b59559a521c5d0bf25007e34b61b2dfdb40c21b221a108f6ba72c1a51fa59359a400ad045c9394c176db WHIRLPOOL c0c13046265ad44d23bde66cf48f64803591b4577861fde0ad7873001cbd9284c8593ce277a39d077b5bab635d0f8aa53ad124ea724bbc4584db36570028f90f
+AUX iputils-20121221-openssl.patch 2378 SHA256 cc1af5ccdd593b4fa43273cf7de8b9552f0a5d33a72a35fcc4f94cf2c6fc9a44 SHA512 05240c00d0a1f9f878a9826d54cbd0128c2ed5ce7cab4685907956156c3cf2131ccd563812b64490bf915a75f52851396966a590027fc4c1886b2d19f421718b WHIRLPOOL 66052233f933cf30fe1572578012faa380f53580307e880e9a94c001ea14e585b3e28693c8e3883ee6350bb6af04a6931732ebaa284c4e3851b64081e042d081
+AUX iputils-20121221-owl-pingsock.diff 6374 SHA256 915e18ee5a03f5636b408ff34a5576ad8899a3d93d5fe8182984c3565bd94375 SHA512 2f2577230d8bc864adc562c4c5bf33cde3bbabfde633406165b2b61df4e13e2dba74c8561f70d88c3932fc49a41a0276533b715ade208c8608348e4d065c8395 WHIRLPOOL 205179fa205e8bd88a9077cf628ec1a060189ee01d55c45dbe754f3bc36a496531cb9eab120507eff5d72140c934a7480d6a015fa6020f7dcecdfbc6ef590443
+AUX iputils-20121221-printf-size.patch 1671 SHA256 a1ed939d0e008bca06208ae34e3f17a0ddc66b50f1679f82a630b52cdfbd111a SHA512 ff5491ad5a0396bee41fcbfc1384699d396c24da093bd2209dead67f52efcec462dbfb4a43008083742d0139da7bd52e922499b5f7eae028384c74930453dd33 WHIRLPOOL 8582495e9c58a01c3aafe6d0c968df910e672af20d420980ba7503800ad75e308c62cd53f86b5aaa8ef9d232ee7a0a4ea7bb3d9cd9735045ae0f6a21f8e419ee
+AUX iputils-20121221-remove-rdisc-glibc-assumption.patch 770 SHA256 0639fca129c3e2ca57a7e0f0d3392474665e11f139cfa9362a365b3fca9593b2 SHA512 2ed65a0c0188cf6e06bfb5e3795fa720f7e7040533adbc1ce0c5ded435b823792790890826fc4250a6b2fba16576dc024c50d1faf9598f2fe36aadda77db8a36 WHIRLPOOL a656ae24a99bc5ee6356375be963324eb7fae6aa533e3a572f95bb4695200f2f66d2fa36e037a3c55ce95dcc1643bde4f80326c3cd32ccd53754dde639a1cbd8
+DIST iputils-s20121221-manpages.tar.bz2 23778 SHA256 6fc7ed7d281b7a2ee00e4f75e5465c90498c685bcc988afdff74db4eaa736d1c SHA512 006be62e61bf1555c99dbd5aac270cbd8d1074a3016fdde3aeed47e5c9b1acd326aa30a596c532d6688827f7f61966a6e3141eaa3b6f4f943eb21ac227282d8c WHIRLPOOL da0ccb577c4b2189553419df2c093404752fb2865eb3e0bfececfc242d930ceb44f96b32d945cfdd0c9ca060359651b2ec8479db5cc9220cda412dfeee5e910d
+DIST iputils-s20121221.tar.bz2 155344 SHA256 450f549fc5b620c23c5929aa6d54b7ddfc7ee1cb1e8efdc5e8bb21d8d0c5319f SHA512 693d240becd766c345c3af2053fc0699b9358e54d667d40738c21d731b70e779112d81476a220d8300ca54250120385414a13610d445996f95a90571047389f4 WHIRLPOOL 64529180eb4b8e2f7a60c18df7cac49e10a4b7702514252d418b16dcdc10a85ccb0a7f8beb51274cc9d708be2026c4c136e720986795fd39d314e4f9d5590ec9
+EBUILD iputils-20121221-r99.ebuild 3167 SHA256 ef88f7e5e925ddc3822ab5d655231f319ca704f2c895d6e30439a256910ef71e SHA512 f4bf6c5c5142ddf7c583e78f397a4ec86051398101eb79c710c08ea03eb341cdc0bbdd0c224225b165bf87cae053e9c5495cd271ddfa97d064c6a980a1cab1eb WHIRLPOOL 37919b7510ba487c3d4c68ba38b568e535932b674a3c634149e7fc9fa6beb07bfe71e5ce3a8c4eddf4a943b3773b2d1867822692bb4f60e1fce2a60462b9d6c8
+MISC metadata.xml 386 SHA256 36462bcda28f18d127af12e2c6fdf58a813f3a5018a9151695892c1b706da52d SHA512 d7529383e575fbdbae4c96123530672192198cf1c4fc3a22097c42ddb3d179b8c99c67e274fbade85c68fc742d5792fb5286f40993f1099dc4694b1cf9942224 WHIRLPOOL 24417ef5492727316830ab0f208138c8ba41ae3e51b46e398297b1ed823f7d801e1cb4bb2ca6d87035f37a4072919073bd99dd8677cb67f3263258cb72184764
diff --git a/net-misc/iputils/files/021109-uclibc-no-ether_ntohost.patch b/net-misc/iputils/files/021109-uclibc-no-ether_ntohost.patch
new file mode 100644
index 00000000..e790d2b5
--- /dev/null
+++ b/net-misc/iputils/files/021109-uclibc-no-ether_ntohost.patch
@@ -0,0 +1,24 @@
+--- iputils/rarpd.c.mps 2004-06-10 15:27:01.000000000 +0200
++++ iputils/rarpd.c 2004-06-10 15:26:29.000000000 +0200
+@@ -42,7 +42,9 @@ int listen_arp;
+ char *ifname;
+ char *tftp_dir = "/etc/tftpboot";
+
++#ifndef __UCLIBC__
+ extern int ether_ntohost(char *name, unsigned char *ea);
++#endif
+ void usage(void) __attribute__((noreturn));
+
+ struct iflink
+@@ -305,7 +307,11 @@ struct rarp_map *rarp_lookup(int ifindex
+ 6,
+ };
+
++#ifndef __UCLIBC__
+ if (ether_ntohost(ename, lladdr) != 0 ||
++#else
++ if (
++#endif
+ (hp = gethostbyname(ename)) == NULL) {
+ if (verbose)
+ syslog(LOG_INFO, "not found in /etc/ethers");
diff --git a/net-misc/iputils/files/iputils-20100418-makefile.patch b/net-misc/iputils/files/iputils-20100418-makefile.patch
new file mode 100644
index 00000000..50a0e81c
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20100418-makefile.patch
@@ -0,0 +1,35 @@
+--- Makefile
++++ Makefile
+@@ -1,20 +1,17 @@
+ # Path to parent kernel include files directory
+ LIBC_INCLUDE=/usr/include
+
+-DEFINES=
+-
+ #options if you have a bind>=4.9.4 libresolv (or, maybe, glibc)
+ LDLIBS=
+-ADDLIB=
+
+ #options if you compile with libc5, and without a bind>=4.9.4 libresolv
+ # NOT AVAILABLE. Please, use libresolv.
+
+-CC=gcc
+ # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
+ #CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g -Werror
+-CCOPT=-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -g
+-CFLAGS=$(CCOPT) $(GLIBCFIX) $(DEFINES)
++CFLAGS ?= -O2 -g
++CFLAGS += -Wstrict-prototypes -Wall
++CPPFLAGS += -D_GNU_SOURCE
+
+ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
+ IPV6_TARGETS=tracepath6 traceroute6 ping6
+@@ -35,7 +32,7 @@
+ rdisc_srv: rdisc_srv.o
+
+ rdisc_srv.o: rdisc.c
+- $(CC) $(CFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c
++ $(CC) $(CFLAGS) $(CPPFLAGS) -DRDISC_SERVER -o rdisc_srv.o rdisc.c
+
+
+ check-kernel:
diff --git a/net-misc/iputils/files/iputils-20100418-printf-size.patch b/net-misc/iputils/files/iputils-20100418-printf-size.patch
new file mode 100644
index 00000000..edde65b5
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20100418-printf-size.patch
@@ -0,0 +1,62 @@
+From 6ccd3b91c18d8b13bc468ef962a9ef9dfc6c4515 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 14 Aug 2010 01:16:42 -0400
+Subject: [PATCH] tracepath: re-use printf return in print_host
+
+The printf funcs take an int for field widths, not a size_t. Also, since
+the printf funcs already return the length of chars displayed, use that
+value instead of re-calculating the length with strlen.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ tracepath.c | 11 ++++-------
+ tracepath6.c | 11 ++++-------
+ 2 files changed, 8 insertions(+), 14 deletions(-)
+
+diff --git a/tracepath.c b/tracepath.c
+index 81c22e9..ca84a69 100644
+--- a/tracepath.c
++++ b/tracepath.c
+@@ -68,13 +68,10 @@ void data_wait(int fd)
+
+ void print_host(const char *a, const char *b, int both)
+ {
+- size_t plen = 0;
+- printf("%s", a);
+- plen = strlen(a);
+- if (both) {
+- printf(" (%s)", b);
+- plen += strlen(b) + 3;
+- }
++ int plen;
++ plen = printf("%s", a);
++ if (both)
++ plen += printf(" (%s)", b);
+ if (plen >= HOST_COLUMN_SIZE)
+ plen = HOST_COLUMN_SIZE - 1;
+ printf("%*s", HOST_COLUMN_SIZE - plen, "");
+diff --git a/tracepath6.c b/tracepath6.c
+index 5cc7424..5c2db8f 100644
+--- a/tracepath6.c
++++ b/tracepath6.c
+@@ -80,13 +80,10 @@ void data_wait(int fd)
+
+ void print_host(const char *a, const char *b, int both)
+ {
+- size_t plen = 0;
+- printf("%s", a);
+- plen = strlen(a);
+- if (both) {
+- printf(" (%s)", b);
+- plen += strlen(b) + 3;
+- }
++ int plen;
++ plen = printf("%s", a);
++ if (both)
++ plen += printf(" (%s)", b);
+ if (plen >= HOST_COLUMN_SIZE)
+ plen = HOST_COLUMN_SIZE - 1;
+ printf("%*s", HOST_COLUMN_SIZE - plen, "");
+--
+1.7.1.1
+
diff --git a/net-misc/iputils/files/iputils-20100418-so_mark.patch b/net-misc/iputils/files/iputils-20100418-so_mark.patch
new file mode 100644
index 00000000..ad92254d
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20100418-so_mark.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/335347
+
+fix building with older linux headers that don't define SO_MARK
+
+--- ping_common.c
++++ ping_common.c
+@@ -485,6 +485,7 @@
+ fprintf(stderr, "Warning: no SO_TIMESTAMP support, falling back to SIOCGSTAMP\n");
+ }
+ #endif
++#ifdef SO_MARK
+ if (options & F_MARK) {
+ if (setsockopt(icmp_sock, SOL_SOCKET, SO_MARK,
+ &mark, sizeof(mark)) == -1) {
+@@ -494,6 +495,7 @@
+ fprintf(stderr, "Warning: Failed to set mark %d\n", mark);
+ }
+ }
++#endif
+
+ /* Set some SNDTIMEO to prevent blocking forever
+ * on sends, when device is too slow or stalls. Just put limit
diff --git a/net-misc/iputils/files/iputils-20101006-owl-pingsock.diff b/net-misc/iputils/files/iputils-20101006-owl-pingsock.diff
new file mode 100644
index 00000000..86c85bca
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20101006-owl-pingsock.diff
@@ -0,0 +1,224 @@
+http://openwall.info/wiki/people/segoon/ping
+
+--- iputils-s20101006/ping.c
++++ iputils-s20101006/ping.c
+@@ -88,6 +88,7 @@ struct sockaddr_in whereto; /* who to pi
+ int optlen = 0;
+ int settos = 0; /* Set TOS, Precendence or other QOS options */
+ int icmp_sock; /* socket file descriptor */
++int using_ping_socket = 0;
+ u_char outpack[0x10000];
+ int maxpacket = sizeof(outpack);
+
+@@ -123,7 +124,11 @@ main(int argc, char **argv)
+ char *target, hnamebuf[MAX_HOSTNAMELEN];
+ char rspace[3 + 4 * NROUTES + 1]; /* record route space */
+
+- icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
++ icmp_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);
++ if (icmp_sock != -1)
++ using_ping_socket = 1;
++ else
++ icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
+ socket_errno = errno;
+
+ uid = getuid();
+@@ -377,13 +382,35 @@ main(int argc, char **argv)
+ }
+ }
+
+- if ((options&F_STRICTSOURCE) &&
+- bind(icmp_sock, (struct sockaddr*)&source, sizeof(source)) == -1) {
+- perror("bind");
+- exit(2);
++ if (!using_ping_socket) {
++ if ((options&F_STRICTSOURCE) &&
++ bind(icmp_sock, (struct sockaddr*)&source, sizeof(source)) == -1) {
++ perror("bind");
++ exit(2);
++ }
++ } else {
++ struct sockaddr_in sa;
++ socklen_t sl;
++
++ sa.sin_family = AF_INET;
++ sa.sin_port = 0;
++ sa.sin_addr.s_addr = (options&F_STRICTSOURCE) ?
++ source.sin_addr.s_addr : 0;
++ sl = sizeof(sa);
++
++ if (bind(icmp_sock, (struct sockaddr *) &sa, sl) == -1) {
++ perror("bind");
++ exit(2);
++ }
++
++ if (getsockname(icmp_sock, (struct sockaddr *) &sa, &sl) == -1) {
++ perror("getsockname");
++ exit(2);
++ }
++ ident = sa.sin_port;
+ }
+
+- if (1) {
++ if (!using_ping_socket) {
+ struct icmp_filter filt;
+ filt.data = ~((1<<ICMP_SOURCE_QUENCH)|
+ (1<<ICMP_DEST_UNREACH)|
+@@ -398,6 +425,12 @@ main(int argc, char **argv)
+ hold = 1;
+ if (setsockopt(icmp_sock, SOL_IP, IP_RECVERR, (char *)&hold, sizeof(hold)))
+ fprintf(stderr, "WARNING: your kernel is veeery old. No problems.\n");
++ if (using_ping_socket) {
++ if (setsockopt(icmp_sock, SOL_IP, IP_RECVTTL, (char *)&hold, sizeof(hold)))
++ perror("WARNING: setsockopt(IP_RECVTTL)");
++ if (setsockopt(icmp_sock, SOL_IP, IP_RETOPTS, (char *)&hold, sizeof(hold)))
++ perror("WARNING: setsockopt(IP_RETOPTS)");
++ }
+
+ /* record route option */
+ if (options & F_RROUTE) {
+@@ -566,6 +599,7 @@ int receive_error_msg()
+ nerrors++;
+ } else if (e->ee_origin == SO_EE_ORIGIN_ICMP) {
+ struct sockaddr_in *sin = (struct sockaddr_in*)(e+1);
++ int error_pkt;
+
+ if (res < sizeof(icmph) ||
+ target.sin_addr.s_addr != whereto.sin_addr.s_addr ||
+@@ -576,9 +610,18 @@ int receive_error_msg()
+ goto out;
+ }
+
+- acknowledge(ntohs(icmph.un.echo.sequence));
++ error_pkt = (e->ee_type != ICMP_REDIRECT &&
++ e->ee_type != ICMP_SOURCE_QUENCH);
++ if (error_pkt) {
++ acknowledge(ntohs(icmph.un.echo.sequence));
++ net_errors++;
++ nerrors++;
++ }
++ else {
++ saved_errno = 0;
++ }
+
+- if (!working_recverr) {
++ if (!using_ping_socket && !working_recverr) {
+ struct icmp_filter filt;
+ working_recverr = 1;
+ /* OK, it works. Add stronger filter. */
+@@ -589,15 +632,14 @@ int receive_error_msg()
+ perror("\rWARNING: setsockopt(ICMP_FILTER)");
+ }
+
+- net_errors++;
+- nerrors++;
+ if (options & F_QUIET)
+ goto out;
+ if (options & F_FLOOD) {
+- write(STDOUT_FILENO, "\bE", 2);
++ if (error_pkt)
++ write(STDOUT_FILENO, "\bE", 2);
+ } else {
+ print_timestamp();
+- printf("From %s icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
++ printf("From %s: icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
+ pr_icmph(e->ee_type, e->ee_code, e->ee_info, NULL);
+ fflush(stdout);
+ }
+@@ -695,15 +737,41 @@ parse_reply(struct msghdr *msg, int cc,
+ struct iphdr *ip;
+ int hlen;
+ int csfailed;
++ struct cmsghdr *cmsg;
++ int ttl;
++ __u8 *opts;
++ int optlen;
+
+ /* Check the IP header */
+ ip = (struct iphdr *)buf;
+- hlen = ip->ihl*4;
+- if (cc < hlen + 8 || ip->ihl < 5) {
+- if (options & F_VERBOSE)
+- fprintf(stderr, "ping: packet too short (%d bytes) from %s\n", cc,
+- pr_addr(from->sin_addr.s_addr));
+- return 1;
++ if (!using_ping_socket) {
++ hlen = ip->ihl*4;
++ if (cc < hlen + 8 || ip->ihl < 5) {
++ if (options & F_VERBOSE)
++ fprintf(stderr, "ping: packet too short (%d bytes) from %s\n", cc,
++ pr_addr(from->sin_addr.s_addr));
++ return 1;
++ }
++ ttl = ip->ttl;
++ opts = buf + sizeof(struct iphdr);
++ optlen = hlen - sizeof(struct iphdr);
++ } else {
++ hlen = 0;
++ ttl = 0;
++ opts = buf;
++ optlen = 0;
++ for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
++ if (cmsg->cmsg_level != SOL_IP)
++ continue;
++ if (cmsg->cmsg_type == IP_TTL) {
++ if (cmsg->cmsg_len < sizeof(int))
++ continue;
++ ttl = *(int *) CMSG_DATA(cmsg);
++ } else if (cmsg->cmsg_type == IP_RETOPTS) {
++ opts = (__u8 *) CMSG_DATA(cmsg);
++ optlen = cmsg->cmsg_len;
++ }
++ }
+ }
+
+ /* Now the ICMP part */
+@@ -716,7 +784,7 @@ parse_reply(struct msghdr *msg, int cc,
+ return 1; /* 'Twas not our ECHO */
+ if (gather_statistics((__u8*)icp, sizeof(*icp), cc,
+ ntohs(icp->un.echo.sequence),
+- ip->ttl, 0, tv, pr_addr(from->sin_addr.s_addr),
++ ttl, 0, tv, pr_addr(from->sin_addr.s_addr),
+ pr_echo_reply))
+ return 0;
+ } else {
+@@ -807,7 +875,7 @@ parse_reply(struct msghdr *msg, int cc,
+ }
+
+ if (!(options & F_FLOOD)) {
+- pr_options(buf + sizeof(struct iphdr), hlen);
++ pr_options(opts, optlen + sizeof(struct iphdr));
+
+ if (options & F_AUDIBLE)
+ putchar('\a');
+@@ -916,8 +984,7 @@ void pr_icmph(__u8 type, __u8 code, __u3
+ printf("Redirect, Bad Code: %d", code);
+ break;
+ }
+- if (icp)
+- printf("(New nexthop: %s)\n", pr_addr(icp->un.gateway));
++ printf("(New nexthop: %s)\n", pr_addr(icp ? icp->un.gateway : info));
+ if (icp && (options & F_VERBOSE))
+ pr_iph((struct iphdr*)(icp + 1));
+ break;
+@@ -1217,7 +1284,7 @@ void install_filter(void)
+ insns
+ };
+
+- if (once)
++ if (once || using_ping_socket)
+ return;
+ once = 1;
+
+--- iputils-s20101006/ping_common.c
++++ iputils-s20101006/ping_common.c
+@@ -515,7 +515,8 @@ void setup(int icmp_sock)
+ *p++ = i;
+ }
+
+- ident = htons(getpid() & 0xFFFF);
++ if (!ident)
++ ident = htons(getpid() & 0xFFFF);
+
+ set_signal(SIGINT, sigexit);
+ set_signal(SIGALRM, sigexit);
diff --git a/net-misc/iputils/files/iputils-20121221-add-bits_types_h.patch b/net-misc/iputils/files/iputils-20121221-add-bits_types_h.patch
new file mode 100644
index 00000000..9ea34189
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-add-bits_types_h.patch
@@ -0,0 +1,94 @@
+diff -Naur iputils-s20121221.orig/clockdiff.c iputils-s20121221/clockdiff.c
+--- iputils-s20121221.orig/clockdiff.c 2014-01-24 15:32:49.111934548 +0000
++++ iputils-s20121221/clockdiff.c 2014-01-24 15:32:14.438932610 +0000
+@@ -23,6 +23,8 @@
+ #include <sys/capability.h>
+ #endif
+
++#include "types.h"
++
+ void usage(void) __attribute__((noreturn));
+
+ #define MAX_HOSTNAMELEN NI_MAXHOST
+diff -Naur iputils-s20121221.orig/ping.c iputils-s20121221/ping.c
+--- iputils-s20121221.orig/ping.c 2014-01-24 15:32:49.111934548 +0000
++++ iputils-s20121221/ping.c 2014-01-24 15:32:14.459932611 +0000
+@@ -59,6 +59,7 @@
+ */
+
+ #include "ping_common.h"
++#include "types.h"
+
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+diff -Naur iputils-s20121221.orig/ping6.c iputils-s20121221/ping6.c
+--- iputils-s20121221.orig/ping6.c 2014-01-24 15:32:49.112934549 +0000
++++ iputils-s20121221/ping6.c 2014-01-24 15:32:14.439932610 +0000
+@@ -67,6 +67,7 @@
+ * This program has to run SUID to ROOT to access the ICMP socket.
+ */
+ #include "ping_common.h"
++#include "types.h"
+
+ #include <linux/filter.h>
+ #include <netinet/ip6.h>
+diff -Naur iputils-s20121221.orig/ping_common.c iputils-s20121221/ping_common.c
+--- iputils-s20121221.orig/ping_common.c 2014-01-24 15:32:49.112934549 +0000
++++ iputils-s20121221/ping_common.c 2014-01-24 15:32:14.439932610 +0000
+@@ -1,4 +1,5 @@
+ #include "ping_common.h"
++#include "types.h"
+ #include <ctype.h>
+ #include <sched.h>
+ #include <math.h>
+diff -Naur iputils-s20121221.orig/ping_common.h iputils-s20121221/ping_common.h
+--- iputils-s20121221.orig/ping_common.h 2014-01-24 15:32:14.419932609 +0000
++++ iputils-s20121221/ping_common.h 2014-01-24 15:33:08.206935616 +0000
+@@ -35,6 +35,7 @@
+ #include <linux/errqueue.h>
+
+ #include "SNAPSHOT.h"
++#include "types.h"
+
+ #define DEFDATALEN (64 - 8) /* default data length */
+
+diff -Naur iputils-s20121221.orig/rdisc.c iputils-s20121221/rdisc.c
+--- iputils-s20121221.orig/rdisc.c 2014-01-24 15:32:49.113934549 +0000
++++ iputils-s20121221/rdisc.c 2014-01-24 15:32:14.450932610 +0000
+@@ -62,6 +62,7 @@
+ #include <syslog.h>
+
+ #include "SNAPSHOT.h"
++#include "types.h"
+
+ struct interface
+ {
+diff -Naur iputils-s20121221.orig/traceroute6.c iputils-s20121221/traceroute6.c
+--- iputils-s20121221.orig/traceroute6.c 2014-01-24 15:32:49.113934549 +0000
++++ iputils-s20121221/traceroute6.c 2014-01-24 15:32:14.440932610 +0000
+@@ -267,6 +267,7 @@
+ #include <string.h>
+ #include <unistd.h>
+
++#include "types.h"
+ #include "SNAPSHOT.h"
+
+ #ifndef SOL_IPV6
+diff -Naur iputils-s20121221.orig/types.h iputils-s20121221/types.h
+--- iputils-s20121221.orig/types.h 1970-01-01 00:00:00.000000000 +0000
++++ iputils-s20121221/types.h 2014-01-24 15:32:14.440932610 +0000
+@@ -0,0 +1,14 @@
++/* This is a small version of <bits/types.h> from glibc
++ * to take care of type u_char.
++ *
++ * Anthony G. Basile <blueness@gentoo.org>
++ */
++#ifndef _BITS_TYPES_H
++#define _BITS_TYPES_H 1
++
++typedef unsigned char u_char;
++typedef unsigned short int u_short;
++typedef unsigned int u_int;
++typedef unsigned long int u_long;
++
++#endif /* mini <bits/types.h> */
diff --git a/net-misc/iputils/files/iputils-20121221-crypto-build.patch b/net-misc/iputils/files/iputils-20121221-crypto-build.patch
new file mode 100644
index 00000000..1ec3c101
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-crypto-build.patch
@@ -0,0 +1,35 @@
+From 568e990d30fc7e9416e0a6f8c74ea5013921eaec Mon Sep 17 00:00:00 2001
+From: Arjan van de Ven <arjanvandeven@gmail.com>
+Date: Wed, 16 Jan 2013 03:12:15 +0900
+Subject: [PATCH [iputils]] ping6: Fix build command line argument with gnutls.
+
+The ping6 command can use either openssl or gnutls...
+and the Makefile has a bunch of setup for defining which of the two to use.
+
+Unfortunately, the final -D define on the commandline to enable gnutls
+inside the ping6.c file didn't actually make it onto the gcc
+commandline.
+This patch adds the $(DEF_CRYPTO) Makefile variable to fix this gap.
+
+Signed-off-by: Arjan van de Ven <arjanvandeven@gmail.com>
+Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index c62d9df..89249f5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -149,7 +149,7 @@ LIB_clockdiff = $(LIB_CAP)
+ DEF_ping_common = $(DEF_CAP) $(DEF_IDN)
+ DEF_ping = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS)
+ LIB_ping = $(LIB_CAP) $(LIB_IDN)
+-DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR)
++DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) $(DEF_CRYPTO)
+ LIB_ping6 = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO)
+
+ ping: ping_common.o
+--
+1.8.0.2
+
diff --git a/net-misc/iputils/files/iputils-20121221-fix-header-order.patch b/net-misc/iputils/files/iputils-20121221-fix-header-order.patch
new file mode 100644
index 00000000..6bfcea49
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-fix-header-order.patch
@@ -0,0 +1,18 @@
+diff -Naur iputils-s20121221.orig/tracepath.c iputils-s20121221/tracepath.c
+--- iputils-s20121221.orig/tracepath.c 2014-11-20 07:39:59.114108620 -0500
++++ iputils-s20121221/tracepath.c 2014-11-20 07:40:37.813110381 -0500
+@@ -14,13 +14,13 @@
+ #include <unistd.h>
+ #include <sys/socket.h>
+ #include <linux/types.h>
+-#include <linux/errqueue.h>
+ #include <errno.h>
+ #include <string.h>
+ #include <netdb.h>
+ #include <netinet/in.h>
+ #include <resolv.h>
+ #include <sys/time.h>
++#include <linux/errqueue.h>
+ #include <sys/uio.h>
+ #include <arpa/inet.h>
+ #include <limits.h>
diff --git a/net-misc/iputils/files/iputils-20121221-fix-init-elemnt.patch b/net-misc/iputils/files/iputils-20121221-fix-init-elemnt.patch
new file mode 100644
index 00000000..554ce9bd
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-fix-init-elemnt.patch
@@ -0,0 +1,23 @@
+diff -Naur iputils-s20121221.orig/ping.c iputils-s20121221/ping.c
+--- iputils-s20121221.orig/ping.c 2014-01-24 15:05:02.082841335 +0000
++++ iputils-s20121221/ping.c 2014-01-24 15:17:12.975882203 +0000
+@@ -774,9 +774,16 @@
+
+ do {
+ static struct iovec iov = {outpack, 0};
+- static struct msghdr m = { &whereto, sizeof(whereto),
+- &iov, 1, &cmsg, 0, 0 };
+- m.msg_controllen = cmsg_len;
++ static struct msghdr m;
++
++ m.msg_name = &whereto;
++ m.msg_namelen = sizeof(whereto);
++ m.msg_iov = &iov;
++ m.msg_iovlen = 1;
++ m.msg_control = &cmsg;
++ m.msg_controllen = sizeof(cmsg);
++ m.msg_flags = 0;
++
+ iov.iov_len = cc;
+
+ i = sendmsg(icmp_sock, &m, confirm);
diff --git a/net-misc/iputils/files/iputils-20121221-fix-musl-headers.patch b/net-misc/iputils/files/iputils-20121221-fix-musl-headers.patch
new file mode 100644
index 00000000..d12dd828
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-fix-musl-headers.patch
@@ -0,0 +1,89 @@
+diff -Naur iputils-s20121221.orig/arping.c iputils-s20121221/arping.c
+--- iputils-s20121221.orig/arping.c 2012-12-21 14:01:07.000000000 +0000
++++ iputils-s20121221/arping.c 2014-01-23 21:19:57.091268011 +0000
+@@ -16,7 +16,7 @@
+ #include <linux/sockios.h>
+ #include <sys/file.h>
+ #include <sys/time.h>
+-#include <sys/signal.h>
++#include <signal.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>
+ #include <linux/if_packet.h>
+--- iputils-s20121221.orig/clockdiff.c 2012-12-21 14:01:07.000000000 +0000
++++ iputils-s20121221/clockdiff.c 2014-01-23 21:19:57.093268011 +0000
+@@ -14,7 +14,6 @@
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+ #define TSPTYPES
+-#include <protocols/timed.h>
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <arpa/inet.h>
+diff -Naur iputils-s20121221.orig/ping_common.h iputils-s20121221/ping_common.h
+--- iputils-s20121221.orig/ping_common.h 2012-12-21 14:01:07.000000000 +0000
++++ iputils-s20121221/ping_common.h 2014-01-23 21:27:07.677292088 +0000
+@@ -7,16 +7,17 @@
+ #include <linux/sockios.h>
+ #include <sys/file.h>
+ #include <sys/time.h>
+-#include <sys/signal.h>
++#include <signal.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>
+ #include <sys/uio.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <string.h>
+ #include <netdb.h>
+ #include <setjmp.h>
++#include <asm-generic/param.h>
+
+ #ifdef CAPABILITIES
+ #include <sys/prctl.h>
+--- iputils-s20121221.orig/rarpd.c 2014-01-24 13:38:46.816551953 +0000
++++ iputils-s20121221/rarpd.c 2014-01-24 13:36:51.833545524 +0000
+@@ -19,16 +19,17 @@
+ #include <netdb.h>
+ #include <arpa/inet.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
+-#include <sys/errno.h>
+-#include <sys/fcntl.h>
++#include <poll.h>
++#include <errno.h>
++#include <fcntl.h>
+ #include <sys/socket.h>
+-#include <sys/signal.h>
++#include <signal.h>
+ #include <linux/if.h>
+ #include <linux/if_arp.h>
+ #include <netinet/in.h>
+ #include <linux/if_packet.h>
+ #include <linux/filter.h>
++#include <sys/types.h>
+
+ int do_reload = 1;
+
+--- iputils-s20121221.orig/tracepath.c 2014-01-24 13:38:46.865551956 +0000
++++ iputils-s20121221/tracepath.c 2014-01-23 21:19:57.109268012 +0000
+@@ -23,6 +23,7 @@
+ #include <sys/time.h>
+ #include <sys/uio.h>
+ #include <arpa/inet.h>
++#include <limits.h>
+ #ifdef USE_IDN
+ #include <idna.h>
+ #include <locale.h>
+--- iputils-s20121221.orig/tracepath6.c 2014-01-24 13:38:46.865551956 +0000
++++ iputils-s20121221/tracepath6.c 2014-01-23 21:20:40.316270428 +0000
+@@ -25,6 +25,7 @@
+ #include <sys/time.h>
+ #include <sys/uio.h>
+ #include <arpa/inet.h>
++#include <limits.h>
+
+ #ifdef USE_IDN
+ #include <idna.h>
diff --git a/net-misc/iputils/files/iputils-20121221-makefile.patch b/net-misc/iputils/files/iputils-20121221-makefile.patch
new file mode 100644
index 00000000..66424c85
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-makefile.patch
@@ -0,0 +1,61 @@
+From c66609d2c830d6fe06f48f5d38c54eb5cc6f2975 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 24 Jan 2013 23:36:16 -0500
+Subject: [PATCH [iputils]] fix handling of CFLAGS
+
+This defaults CFLAGS to -O3 without clobbering settings people have set
+up in the environment already.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 13 +++++--------
+ 1 file changed, 5 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 2c49940..ecabac3 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,8 +2,6 @@
+ # Configuration
+ #
+
+-# CC
+-CC=gcc
+ # Path to parent kernel include files directory
+ LIBC_INCLUDE=/usr/include
+ # Libraries
+@@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no
+
+ # -------------------------------------
+ # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
+-# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
+-CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g
+-CCOPTOPT=-O3
+-GLIBCFIX=-D_GNU_SOURCE
+-DEFINES=
++# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
++CFLAGS?=-O3 -g
++CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall
++CPPFLAGS+=-D_GNU_SOURCE
+ LDLIB=
+
+ FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2))
+@@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
+ IPV6_TARGETS=tracepath6 traceroute6 ping6
+ TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
+
+-CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
+ LDLIBS=$(LDLIB) $(ADDLIB)
+
+ UNAME_N:=$(shell uname -n)
+@@ -132,6 +128,7 @@ all: $(TARGETS)
+ $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@
+ %.o: %.c
+ $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@
++LINK.o += $(CFLAGS)
+ $(TARGETS): %: %.o
+ $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@
+
+--
+1.8.0.2
+
diff --git a/net-misc/iputils/files/iputils-20121221-openssl.patch b/net-misc/iputils/files/iputils-20121221-openssl.patch
new file mode 100644
index 00000000..1c6ba81d
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-openssl.patch
@@ -0,0 +1,92 @@
+From b57d77dcfa5cb363b7eba5b331324669a8505ac4 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 24 Jan 2013 23:32:39 -0500
+Subject: [PATCH [iputils]] ping6: allow disabling of openssl support
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 5 ++++-
+ ping6.c | 14 +++++++++++++-
+ 2 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 89249f5..2c49940 100644
+--- a/Makefile
++++ b/Makefile
+@@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
+
+ # GNU TLS library for ping6 [yes|no|static]
+ USE_GNUTLS=yes
+-# Crypto library for ping6 [shared|static]
++# Crypto library for ping6 [shared|static|no]
+ USE_CRYPTO=shared
+ # Resolv library for ping6 [yes|static]
+ USE_RESOLV=yes
+@@ -63,7 +63,10 @@ ifneq ($(USE_GNUTLS),no)
+ LIB_CRYPTO = $(call FUNC_LIB,$(USE_GNUTLS),$(LDFLAG_GNUTLS))
+ DEF_CRYPTO = -DUSE_GNUTLS
+ else
++ifneq ($(USE_CRYPTO),no)
+ LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
++ DEF_CRYPTO = -DUSE_OPENSSL
++endif
+ endif
+
+ # USE_RESOLV: LIB_RESOLV
+diff --git a/ping6.c b/ping6.c
+index c39864d..f2f90af 100644
+--- a/ping6.c
++++ b/ping6.c
+@@ -168,8 +168,10 @@ static int icmp_sock;
+
+ #ifdef USE_GNUTLS
+ # include <gnutls/openssl.h>
+-#else
++# define USE_CRYPTO
++#elif defined USE_OPENSSL
+ # include <openssl/md5.h>
++# define USE_CRYPTO
+ #endif
+
+ /* Node Information query */
+@@ -326,6 +328,7 @@ static void niquery_init_nonce(void)
+ #if !PING6_NONCE_MEMORY
+ static int niquery_nonce(__u8 *nonce, int fill)
+ {
++# ifdef USE_CRYPTO
+ static __u8 digest[MD5_DIGEST_LENGTH];
+ static int seq = -1;
+
+@@ -348,6 +351,10 @@ static int niquery_nonce(__u8 *nonce, int fill)
+ return -1;
+ return ntohsp((__u16 *)nonce);
+ }
++# else
++ fprintf(stderr, "ping6: function not available; crypto disabled\n");
++ exit(3);
++# endif
+ }
+ #endif
+
+@@ -502,6 +509,7 @@ static int niquery_option_subject_addr_handler(int index, const char *arg)
+
+ static int niquery_option_subject_name_handler(int index, const char *arg)
+ {
++#ifdef USE_CRYPTO
+ static char nigroup_buf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ];
+ unsigned char *dnptrs[2], **dpp, **lastdnptr;
+ int n;
+@@ -627,6 +635,10 @@ errexit:
+ free(idn);
+ free(name);
+ exit(1);
++#else
++ fprintf(stderr, "ping6: function not available; crypto disabled\n");
++ exit(3);
++#endif
+ }
+
+ int niquery_option_help_handler(int index, const char *arg)
+--
+1.8.0.2
+
diff --git a/net-misc/iputils/files/iputils-20121221-owl-pingsock.diff b/net-misc/iputils/files/iputils-20121221-owl-pingsock.diff
new file mode 100644
index 00000000..283aa989
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-owl-pingsock.diff
@@ -0,0 +1,224 @@
+http://openwall.info/wiki/people/segoon/ping
+
+--- iputils-s20101006/ping.c
++++ iputils-s20101006/ping.c
+@@ -88,6 +88,7 @@ struct sockaddr_in whereto; /* who to pi
+ int optlen = 0;
+ int settos = 0; /* Set TOS, Precendence or other QOS options */
+ int icmp_sock; /* socket file descriptor */
++int using_ping_socket = 0;
+ u_char outpack[0x10000];
+ int maxpacket = sizeof(outpack);
+
+@@ -123,7 +124,11 @@ main(int argc, char **argv)
+ char *target, hnamebuf[MAX_HOSTNAMELEN];
+ char rspace[3 + 4 * NROUTES + 1]; /* record route space */
+
+- icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
++ icmp_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);
++ if (icmp_sock != -1)
++ using_ping_socket = 1;
++ else
++ icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
+ socket_errno = errno;
+
+ uid = getuid();
+@@ -377,13 +382,35 @@ main(int argc, char **argv)
+ }
+ }
+
+- if ((options&F_STRICTSOURCE) &&
+- bind(icmp_sock, (struct sockaddr*)&source, sizeof(source)) == -1) {
+- perror("bind");
+- exit(2);
++ if (!using_ping_socket) {
++ if ((options&F_STRICTSOURCE) &&
++ bind(icmp_sock, (struct sockaddr*)&source, sizeof(source)) == -1) {
++ perror("bind");
++ exit(2);
++ }
++ } else {
++ struct sockaddr_in sa;
++ socklen_t sl;
++
++ sa.sin_family = AF_INET;
++ sa.sin_port = 0;
++ sa.sin_addr.s_addr = (options&F_STRICTSOURCE) ?
++ source.sin_addr.s_addr : 0;
++ sl = sizeof(sa);
++
++ if (bind(icmp_sock, (struct sockaddr *) &sa, sl) == -1) {
++ perror("bind");
++ exit(2);
++ }
++
++ if (getsockname(icmp_sock, (struct sockaddr *) &sa, &sl) == -1) {
++ perror("getsockname");
++ exit(2);
++ }
++ ident = sa.sin_port;
+ }
+
+- if (1) {
++ if (!using_ping_socket) {
+ struct icmp_filter filt;
+ filt.data = ~((1<<ICMP_SOURCE_QUENCH)|
+ (1<<ICMP_DEST_UNREACH)|
+@@ -398,6 +425,12 @@ main(int argc, char **argv)
+ hold = 1;
+ if (setsockopt(icmp_sock, SOL_IP, IP_RECVERR, (char *)&hold, sizeof(hold)))
+ fprintf(stderr, "WARNING: your kernel is veeery old. No problems.\n");
++ if (using_ping_socket) {
++ if (setsockopt(icmp_sock, SOL_IP, IP_RECVTTL, (char *)&hold, sizeof(hold)))
++ perror("WARNING: setsockopt(IP_RECVTTL)");
++ if (setsockopt(icmp_sock, SOL_IP, IP_RETOPTS, (char *)&hold, sizeof(hold)))
++ perror("WARNING: setsockopt(IP_RETOPTS)");
++ }
+
+ /* record route option */
+ if (options & F_RROUTE) {
+@@ -566,6 +599,7 @@ int receive_error_msg()
+ nerrors++;
+ } else if (e->ee_origin == SO_EE_ORIGIN_ICMP) {
+ struct sockaddr_in *sin = (struct sockaddr_in*)(e+1);
++ int error_pkt;
+
+ if (res < sizeof(icmph) ||
+ target.sin_addr.s_addr != whereto.sin_addr.s_addr ||
+@@ -576,9 +610,18 @@ int receive_error_msg()
+ goto out;
+ }
+
+- acknowledge(ntohs(icmph.un.echo.sequence));
++ error_pkt = (e->ee_type != ICMP_REDIRECT &&
++ e->ee_type != ICMP_SOURCE_QUENCH);
++ if (error_pkt) {
++ acknowledge(ntohs(icmph.un.echo.sequence));
++ net_errors++;
++ nerrors++;
++ }
++ else {
++ saved_errno = 0;
++ }
+
+- if (!working_recverr) {
++ if (!using_ping_socket && !working_recverr) {
+ struct icmp_filter filt;
+ working_recverr = 1;
+ /* OK, it works. Add stronger filter. */
+@@ -589,15 +632,14 @@ int receive_error_msg()
+ perror("\rWARNING: setsockopt(ICMP_FILTER)");
+ }
+
+- net_errors++;
+- nerrors++;
+ if (options & F_QUIET)
+ goto out;
+ if (options & F_FLOOD) {
+- write_stdout("\bE", 2);
++ if (error_pkt)
++ write_stdout("\bE", 2);
+ } else {
+ print_timestamp();
+- printf("From %s icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
++ printf("From %s: icmp_seq=%u ", pr_addr(sin->sin_addr.s_addr), ntohs(icmph.un.echo.sequence));
+ pr_icmph(e->ee_type, e->ee_code, e->ee_info, NULL);
+ fflush(stdout);
+ }
+@@ -695,15 +737,41 @@ parse_reply(struct msghdr *msg, int cc,
+ struct iphdr *ip;
+ int hlen;
+ int csfailed;
++ struct cmsghdr *cmsg;
++ int ttl;
++ __u8 *opts;
++ int optlen;
+
+ /* Check the IP header */
+ ip = (struct iphdr *)buf;
+- hlen = ip->ihl*4;
+- if (cc < hlen + 8 || ip->ihl < 5) {
+- if (options & F_VERBOSE)
+- fprintf(stderr, "ping: packet too short (%d bytes) from %s\n", cc,
+- pr_addr(from->sin_addr.s_addr));
+- return 1;
++ if (!using_ping_socket) {
++ hlen = ip->ihl*4;
++ if (cc < hlen + 8 || ip->ihl < 5) {
++ if (options & F_VERBOSE)
++ fprintf(stderr, "ping: packet too short (%d bytes) from %s\n", cc,
++ pr_addr(from->sin_addr.s_addr));
++ return 1;
++ }
++ ttl = ip->ttl;
++ opts = buf + sizeof(struct iphdr);
++ optlen = hlen - sizeof(struct iphdr);
++ } else {
++ hlen = 0;
++ ttl = 0;
++ opts = buf;
++ optlen = 0;
++ for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
++ if (cmsg->cmsg_level != SOL_IP)
++ continue;
++ if (cmsg->cmsg_type == IP_TTL) {
++ if (cmsg->cmsg_len < sizeof(int))
++ continue;
++ ttl = *(int *) CMSG_DATA(cmsg);
++ } else if (cmsg->cmsg_type == IP_RETOPTS) {
++ opts = (__u8 *) CMSG_DATA(cmsg);
++ optlen = cmsg->cmsg_len;
++ }
++ }
+ }
+
+ /* Now the ICMP part */
+@@ -716,7 +784,7 @@ parse_reply(struct msghdr *msg, int cc,
+ return 1; /* 'Twas not our ECHO */
+ if (gather_statistics((__u8*)icp, sizeof(*icp), cc,
+ ntohs(icp->un.echo.sequence),
+- ip->ttl, 0, tv, pr_addr(from->sin_addr.s_addr),
++ ttl, 0, tv, pr_addr(from->sin_addr.s_addr),
+ pr_echo_reply))
+ return 0;
+ } else {
+@@ -807,7 +875,7 @@ parse_reply(struct msghdr *msg, int cc,
+ }
+
+ if (!(options & F_FLOOD)) {
+- pr_options(buf + sizeof(struct iphdr), hlen);
++ pr_options(opts, optlen + sizeof(struct iphdr));
+
+ if (options & F_AUDIBLE)
+ putchar('\a');
+@@ -916,8 +984,7 @@ void pr_icmph(__u8 type, __u8 code, __u3
+ printf("Redirect, Bad Code: %d", code);
+ break;
+ }
+- if (icp)
+- printf("(New nexthop: %s)\n", pr_addr(icp->un.gateway));
++ printf("(New nexthop: %s)\n", pr_addr(icp ? icp->un.gateway : info));
+ if (icp && (options & F_VERBOSE))
+ pr_iph((struct iphdr*)(icp + 1));
+ break;
+@@ -1217,7 +1284,7 @@ void install_filter(void)
+ insns
+ };
+
+- if (once)
++ if (once || using_ping_socket)
+ return;
+ once = 1;
+
+--- iputils-s20101006/ping_common.c
++++ iputils-s20101006/ping_common.c
+@@ -515,7 +515,8 @@ void setup(int icmp_sock)
+ *p++ = i;
+ }
+
+- ident = htons(getpid() & 0xFFFF);
++ if (!ident)
++ ident = htons(getpid() & 0xFFFF);
+
+ set_signal(SIGINT, sigexit);
+ set_signal(SIGALRM, sigexit);
diff --git a/net-misc/iputils/files/iputils-20121221-printf-size.patch b/net-misc/iputils/files/iputils-20121221-printf-size.patch
new file mode 100644
index 00000000..6d6c3b7d
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-printf-size.patch
@@ -0,0 +1,64 @@
+From 23fcb10ae15a96aa9e5a823cfe0b612d9522691c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 14 Aug 2010 01:16:42 -0400
+Subject: [PATCH [iputils]] tracepath: re-use printf return in print_host
+
+Since the printf funcs already return the length of chars displayed,
+use that value instead of re-calculating the length with strlen.
+
+This also fixes the handling of the strlen return -- it's a size_t,
+not an int.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ tracepath.c | 11 ++++-------
+ tracepath6.c | 11 ++++-------
+ 2 files changed, 8 insertions(+), 14 deletions(-)
+
+diff --git a/tracepath.c b/tracepath.c
+index 8a08f1d..f155816 100644
+--- a/tracepath.c
++++ b/tracepath.c
+@@ -73,13 +73,10 @@ void data_wait(int fd)
+
+ void print_host(const char *a, const char *b, int both)
+ {
+- int plen = 0;
+- printf("%s", a);
+- plen = strlen(a);
+- if (both) {
+- printf(" (%s)", b);
+- plen += strlen(b) + 3;
+- }
++ int plen;
++ plen = printf("%s", a);
++ if (both)
++ plen += printf(" (%s)", b);
+ if (plen >= HOST_COLUMN_SIZE)
+ plen = HOST_COLUMN_SIZE - 1;
+ printf("%*s", HOST_COLUMN_SIZE - plen, "");
+diff --git a/tracepath6.c b/tracepath6.c
+index 126fadf..bee95c3 100644
+--- a/tracepath6.c
++++ b/tracepath6.c
+@@ -86,13 +86,10 @@ void data_wait(int fd)
+
+ void print_host(const char *a, const char *b, int both)
+ {
+- int plen = 0;
+- printf("%s", a);
+- plen = strlen(a);
+- if (both) {
+- printf(" (%s)", b);
+- plen += strlen(b) + 3;
+- }
++ int plen;
++ plen = printf("%s", a);
++ if (both)
++ plen += printf(" (%s)", b);
+ if (plen >= HOST_COLUMN_SIZE)
+ plen = HOST_COLUMN_SIZE - 1;
+ printf("%*s", HOST_COLUMN_SIZE - plen, "");
+--
+1.8.0.2
+
diff --git a/net-misc/iputils/files/iputils-20121221-remove-rdisc-glibc-assumption.patch b/net-misc/iputils/files/iputils-20121221-remove-rdisc-glibc-assumption.patch
new file mode 100644
index 00000000..08e764dd
--- /dev/null
+++ b/net-misc/iputils/files/iputils-20121221-remove-rdisc-glibc-assumption.patch
@@ -0,0 +1,30 @@
+diff -Naur iputils-s20121221.orig/rdisc.c iputils-s20121221/rdisc.c
+--- iputils-s20121221.orig/rdisc.c 2014-01-24 14:59:29.937822762 +0000
++++ iputils-s20121221/rdisc.c 2014-01-23 21:25:58.760288234 +0000
+@@ -115,26 +114,7 @@
+
+ #define MAXIFS 32
+
+-#if !defined(__GLIBC__) || __GLIBC__ < 2
+-/* For router advertisement */
+-struct icmp_ra
+-{
+- u_char icmp_type; /* type of message, see below */
+- u_char icmp_code; /* type sub code */
+- u_short icmp_cksum; /* ones complement cksum of struct */
+- u_char icmp_num_addrs;
+- u_char icmp_wpa; /* Words per address */
+- short icmp_lifetime;
+-};
+-
+-struct icmp_ra_addr
+-{
+- __u32 ira_addr;
+- __u32 ira_preference;
+-};
+-#else
+ #define icmp_ra icmp
+-#endif
+
+ /* Router constants */
+ #define MAX_INITIAL_ADVERT_INTERVAL 16
diff --git a/net-misc/iputils/iputils-20121221-r99.ebuild b/net-misc/iputils/iputils-20121221-r99.ebuild
new file mode 100644
index 00000000..bccdd552
--- /dev/null
+++ b/net-misc/iputils/iputils-20121221-r99.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/iputils/iputils-20121221-r1.ebuild,v 1.17 2015/04/25 00:34:24 vapier Exp $
+
+# For released versions, we precompile the man/html pages and store
+# them in a tarball on our mirrors. This avoids ugly issues while
+# building stages, and when the jade/sgml packages are broken (which
+# seems to be more common than would be nice).
+
+EAPI="4"
+
+inherit flag-o-matic eutils toolchain-funcs fcaps
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://www.linux-ipv6.org/gitroot/iputils"
+ inherit git-2
+else
+ SRC_URI="http://www.skbuff.net/iputils/iputils-s${PV}.tar.bz2
+ mirror://gentoo/iputils-s${PV}-manpages.tar.bz2"
+ KEYWORDS="amd64 arm ~mips ppc x86"
+fi
+
+DESCRIPTION="Network monitoring tools including ping and ping6"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iputils"
+
+LICENSE="BSD-4"
+SLOT="0"
+IUSE="caps doc gnutls idn ipv6 SECURITY_HAZARD ssl static"
+
+LIB_DEPEND="caps? ( sys-libs/libcap[static-libs(+)] )
+ idn? ( net-dns/libidn[static-libs(+)] )
+ ipv6? ( ssl? (
+ gnutls? (
+ net-libs/gnutls[openssl(+)]
+ net-libs/gnutls[static-libs(+)]
+ )
+ !gnutls? ( dev-libs/openssl:0[static-libs(+)] )
+ ) )"
+RDEPEND="!net-misc/rarpd
+ !static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+ static? ( ${LIB_DEPEND} )
+ virtual/os-headers"
+if [[ ${PV} == "99999999" ]] ; then
+ DEPEND+="
+ app-text/openjade
+ dev-perl/SGMLSpm
+ app-text/docbook-sgml-dtd
+ app-text/docbook-sgml-utils
+ "
+fi
+
+S=${WORKDIR}/${PN}-s${PV}
+
+src_prepare() {
+ epatch "${FILESDIR}"/021109-uclibc-no-ether_ntohost.patch
+ epatch "${FILESDIR}"/${PN}-20121221-openssl.patch #335436
+ epatch "${FILESDIR}"/${PN}-20121221-crypto-build.patch
+ epatch "${FILESDIR}"/${PN}-20100418-so_mark.patch #335347
+ epatch "${FILESDIR}"/${PN}-20121221-makefile.patch
+ epatch "${FILESDIR}"/${PN}-20121221-printf-size.patch
+ epatch "${FILESDIR}"/${PN}-20121221-owl-pingsock.diff
+ epatch "${FILESDIR}"/${PN}-20121221-fix-musl-headers.patch
+ epatch "${FILESDIR}"/${PN}-20121221-add-bits_types_h.patch
+ epatch "${FILESDIR}"/${PN}-20121221-remove-rdisc-glibc-assumption.patch
+ epatch "${FILESDIR}"/${PN}-20121221-fix-init-elemnt.patch
+ epatch "${FILESDIR}"/${PN}-20121221-fix-header-order.patch
+ use SECURITY_HAZARD && epatch "${FILESDIR}"/${PN}-20071127-nonroot-floodping.patch
+ use static && append-ldflags -static
+}
+
+src_compile() {
+ tc-export CC
+ emake \
+ USE_CAP=$(usex caps) \
+ USE_IDN=$(usex idn) \
+ USE_GNUTLS=$(usex gnutls) \
+ USE_CRYPTO=$(usex ssl) \
+ $(use ipv6 || echo IPV6_TARGETS=)
+
+ if [[ ${PV} == "99999999" ]] ; then
+ emake -j1 html man
+ fi
+}
+
+ipv6() { usex ipv6 "$*" '' ; }
+
+src_install() {
+ into /
+ dobin arping ping $(ipv6 ping6)
+ into /usr
+ dobin clockdiff
+ dosbin rarpd rdisc ipg tftpd tracepath $(ipv6 tracepath6)
+
+ dodoc INSTALL RELNOTES
+ use ipv6 \
+ && dosym ping.8 /usr/share/man/man8/ping6.8 \
+ || rm -f doc/*6.8
+ rm -f doc/{setkey,traceroute6}.8
+ doman doc/*.8
+
+ use doc && dohtml doc/*.html
+}
+
+pkg_postinst() {
+ fcaps cap_net_raw \
+ bin/{ar,}ping \
+ $(ipv6 bin/ping6) \
+ usr/bin/clockdiff
+}
diff --git a/net-misc/iputils/metadata.xml b/net-misc/iputils/metadata.xml
new file mode 100644
index 00000000..5c2d8fe5
--- /dev/null
+++ b/net-misc/iputils/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="SECURITY_HAZARD">Allow non-root users to flood (ping -f). This is generally a very bad idea.</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:skbuff:iputils</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/openssh/Manifest b/net-misc/openssh/Manifest
new file mode 100644
index 00000000..7ec1e094
--- /dev/null
+++ b/net-misc/openssh/Manifest
@@ -0,0 +1,23 @@
+AUX openssh-4.7_p1-GSSAPI-dns.patch 4494 SHA256 88a08f349258d4be5b2faa838a89fe1aa0196502990b745ac0e3a70dda30a0d7 SHA512 4d00a9ed79f66b92502c3e5ee580523f63d7b3643fe1bd330ff97994acce527d4d285d38199cef66eddc0ef68afabf7b268abc60cba871bac5d2e99045d4ac11 WHIRLPOOL 2f118fd2f016c529dbc31e8f2b6b418931e6770ab02c28b7feeaba93e84e7fcd1c742f4420a43a9fec0bdfaa4d4bc7cf14fb860c0a56c68a30e7b136fb60bcdb
+AUX openssh-6.3_p1-x509-hpn14v2-glue.patch 1451 SHA256 d7179b3c16edd065977aaf56a410e2b9b237206fb619474f312972b430b73c8d SHA512 02577e3f718ff994bb4e962189f17048b4c03104d0a1981683f3c6a1d6d30701db368e132102c8396da2c0f5eb2f6602b26f32f74d19382af34bd9a93fc508f3 WHIRLPOOL b7d224d71634f380bd31b3a1dd3e588a29582255f717a6a308738ad58b485b693d827a53704479995ec2ebca53c9dc9b2113d8de52a1336b67ce83943f946b77
+AUX openssh-6.4_p1-x509-glue.patch 1445 SHA256 cf18f17b12514692a4e33d5fb995f5ba1bc1ea258c80babb38516d8def7d0bc3 SHA512 e5c51fd639e95ca9c7820974684117861cc58cf5172c7c44deaaca106c1e91a931421720cb210652aef30ffa41bc96efe04dbedf996120b40143080fc6b2b47d WHIRLPOOL 7c7065a22cc6237a927e6d6c0f7b4bfa7b57e32ffd8b3d70ed9e70b9a882a95ce40478873374460a6173cc5a33c22ddfbbded783568049f1b4fccb5f5253d4bf
+AUX openssh-6.4p1-fix-typo-construct_utmpx.patch 796 SHA256 844bfa729eb63cd4c05c1dc518d34263f4da4e0f1510c39b27b8c15c0a23459c SHA512 d7d5dcee89b1b427098bcd8ff44d99aebb4ab077af450b89aa432796a4398e1516fe4a75fdb2ae6ef71b702ad1af5766af040316e37d3f71bce65de5be59830e WHIRLPOOL c01570bdcde7ca2c03df0db62c1c59486cf94380e6ce27104a897407d90c862e6f88ef3584f28c3c59a3744c64ad9405c6daf1053d241354bdc064d77520b03e
+AUX openssh-6.4p1-missing-sys_param_h.patch 2139 SHA256 0be81f4fbcabb1e8a5459f4b41f179498cef5e3411435c16fc9b36e3f619d79e SHA512 c7f997a5351d464b9d86f1b5ae221a9788a0c77ccaf7a4d2a4e266033fc58d0dede9c7fca8cfee36cfad328513d9ba6bb735be0e778a8ce489ad98d81110f579 WHIRLPOOL 1355becb4460a4749145fcc786fd45c260d779176761ae37e27de81072f8c84fdd16f2f1c6ea0d7576ba09e048d8be85a0449987ef2097ed5c5defca8ebb5b26
+AUX openssh-6.7_p1-openssl-ignore-status.patch 765 SHA256 b068cc30d4bce5c457cea78233396c9793864ec909f810dd0be87d913673433a SHA512 ab15d6dfdb8d59946684501f6f30ac0eb82676855b7b57f19f2027a7ada072f9062fcb96911111a50cfc3838492faddd282db381ec83d22462644ccddccf0ae7 WHIRLPOOL c0a4ff69d65eeb40c1ace8d5be6f8e59044a8f16dc6b37e87393e79ab80935abf30a9d2a6babc043aba0477f5f79412e1ae5d373daba580178fd85ca1f60e60b
+AUX openssh-6.7_p1-sctp-x509-glue.patch 1326 SHA256 42eb87eda1685e19add23c1304f17dabd99a1a38a57bfe2bfbb70ab85f6d385e SHA512 7f014e2b1893a5240680e2e14475d61b9b6047d1be3fe404d5971a899c122cc624546e9e5b31bfee5905cf7b4605a0871c3b00ed5c2bd28d84755a49392e1a69 WHIRLPOOL 8d6888163068dbc486bc4eff0dd7d4053f68b9848347eb520dd7d382b0b8c74e3016f7f3ed401c2c2dfd48e73a9077fb9777d39c0f236cc500c53393be426b42
+AUX openssh-6.7_p1-sshd-gssapi-multihomed.patch 5489 SHA256 d2a1735b523709a4b4ceaa57862ecb21a95656678bacc5b7da59dc46187ad997 SHA512 a8b8d2c2ab4520c8c7315f6130ee44fec48935a129ce7c7e51a068a4de2c7528980437246b61e4abc4cff614466f8054c554cdbaad4eb0d1f4afcfb434c30bbc WHIRLPOOL e4b97398c324360576a04792357f66be3ed9f17e4113f75275f8422ee0b7ecf28073c7cde01a63e24fa0901b14db822d22d7d2c5936bbee3bd5874a867066967
+AUX openssh-6.7_p1-x509-glue.patch 1633 SHA256 58031e90e0bf220028934ab590af6ccfc45722629b2416df13d84f10c9b94478 SHA512 364ca0280be5cc83d1dedf7727323fd5fc0093c6dbcf9cc8ccaa30ee754b866584be28da1166953f03faf8745d6364e33fad7daad9be9a29681a8674eb9d292b WHIRLPOOL b79a6cff897be78793bbf2ca03154103aa1380647b8c53e104155fd68122568a8e7dea23996213b192e4269f980b1035d3ca395dbd2c318fd81a45f44d110c31
+AUX openssh-6.7p1-avoid-exit.patch 9766 SHA256 a2ccd76c5ce0f5761c1cea49a7055c171c2be1cfe6bf20ae60ba6cbfe7c7d1f4 SHA512 524630996012c0cbbcc835519760808a52b68d9180b8d82bd3f596bbd3661bceec9e6163876a2bedf7b7ce0d869800801134f1f465c3e2a932f0d300a23ad172 WHIRLPOOL 0254a83459a480370e89556417e077d9f206bf3b34a1630019db619647c055d1c4e4d8570ba154666bf60b8dea60c3ed97a7ba9b7b81e9680f4a62a1a2d3198a
+AUX sshd.confd 396 SHA256 29c6d57ac3ec6018cadc6ba6cd9b90c9ed46e20049b970fdcc68ee2481a2ee41 SHA512 b9ae816af54a55e134a9307e376f05367b815f1b3fd545c2a2c312d18aedcf907f413e8bad8db980cdd9aad4011a72a79e1e94594f69500939a9cb46287f2f81 WHIRLPOOL 69f43e6192e009a4663d130f7e40ee8b13c6eb9cc7d960b5e0e22f5d477649c88806a9d219efef211f4346582c2bb51e40d230a8191e5953dbe08bfff976ae53
+AUX sshd.pam_include.2 156 SHA256 166136e27d653e0bf481a6ca79fecb7d9fa2fc3d597d041f97df595f65a8193c SHA512 d3f7e6ca8c9f2b5060ebccb259316bb59c9a7e158e8ef9466765a20db263a4043a590811f1a3ab072b718dbd70898bc69b77e0b19603d7f394b5ac1bd0a4a56c WHIRLPOOL ba7a0a8c3bb39c5fda69de34b822a19696398e0a8789211ac1faae787ee34f9639eb35efe29c67f874b5f9fe674742503e570f441c005974f4a0c93468b8970b
+AUX sshd.rc6.4 2313 SHA256 97221a017d8ee9de996277c5a794d973a0b5e8180c29c97b3652bd1984a7b5d0 SHA512 88826bc9923299ac4c1502e7076483d6c197fd5a0e693bc2e1690f82bcd7d1bbd144aae2ffd92acb28d6fe912233aa93346e00c72917de65c22811ce9cd5bff7 WHIRLPOOL a77bad5891eb74770ae12e79131a99e5645a83841d14f1d60e39581a23b9d86e66b2e5fb7d0c989afac410eb5c6a627b83389d54085d1b78c89fc07852f8eb66
+AUX sshd.service 242 SHA256 1351c43fe8287f61255ace9fa20790f770d69296b4dd31b0c583983d4cc59843 SHA512 77f50c85a2c944995a39819916eb860cfdc1aff90986e93282e669a0de73c287ecb92d550fd118cfcc8ab538eab677e0d103b23cd959b7e8d9801bc37250c39c WHIRLPOOL 0f5c48d709274c526ceee4f26e35dcb00816ffa9d6661acc1e4e462acb38c3c6108b0e87783eff9da1b1868127c5550c57a5a0a9d7270b927ac4b92191876989
+AUX sshd.socket 136 SHA256 c055abcd10c5d372119cbc3708661ddffccdee7a1de1282559c54d03e2f109d9 SHA512 4d31d373b7bdae917dc0cf05418c71d4743e98e354aefcf055f88f55c9c644a5a0e0e605dbb8372c1b98d17c0ea1c8c0fee27d38ab8dbe23c7e420a6a78c6d42 WHIRLPOOL 102d87b708c31e5994e8005437c78b1aa756c6def4ee9ae2fa9be1438f328fc28c9152a4ff2528941be18f1311594490ecd98b66716ec74e970aa3725a98e2e5
+AUX sshd_at.service 176 SHA256 332f5ffc30456fe2494095c2aabd1e6e02075ce224e2d49708ac7ccf6d341998 SHA512 662a9c2668902633e6dbcb9435ac35bec3e224afdb2ab6a1df908618536ae9fc1958ba1d611e146c01fddb0c8f41eefdc26de78f45b7f165b1d6b2ee2f23be2a WHIRLPOOL aeb32351380dd674ef7a2e7b537f43116c189f7fddb8bdb8b2c109e9f62b0a73cc0f29f2d46270e658ab6409b8d3671ce9e0d0ba7c0d3674c2f85291a73e6df1
+DIST openssh-6.7_p1-sctp.patch.xz 7408 SHA256 b33e82309195f2a3f21a9fb14e6da2080b096dcf0d6f1c36c93cdeac683fdd59 SHA512 35da5e58f857e8b24e63b4058e946b71fdf0fecc637cb7af0ba8913869e5aadf8317805838936c84dc24421f03c5c91e1670761bed152fdf325c5a509f1b5d04 WHIRLPOOL cc7bace4aa60d720914e3a6a4ff650b7543d9e4963deab12c19cb5d798547b4fe547690946ff8955e121339e9a3d0ebe06f3ff758cca4bb81a09ac43fc877f58
+DIST openssh-6.7p1+x509-8.2.diff.gz 241798 SHA256 85acfcd560b40d4533b82a4e3f443b7137b377868bab424dacdf00581c83240f SHA512 d33ece7ddf382235b032875cf961845b308dc5e4cd1888cb68fee11c95066bb90938f9043cb9410f372efb578b61dfd5d50341da95a92fab5a4c209ac54e1f5e WHIRLPOOL b1fe2b88f0e77312099171f5c83dc670abc4c40d215fdff1e43161e44f806de9e0537cfa3a0001e1c7bbc0d0aed555079455f88b8ff313b00d8e9a19dabcb7d8
+DIST openssh-6.7p1-hpnssh14v5.tar.xz 25652 SHA256 7284db65548b6b04142930da86972f96b1f5aa8ad3fc125134412f904f369d7e SHA512 21929805f40c79684ee3ecdb2b495d3204dca90b932aa633c4e0f6a093a417259cdeee10b3e49f3dff426febc6792f45ee23cc0688f05bf047630f3016e0926a WHIRLPOOL 5515cd4c745b061a3e92ac03e8121fb3ffc4b2ff116140625ca7ab2c0211c673b6345e5b08134df8b1743e03f9964017e789e1f0b9da99a0fd5970e14665e681
+DIST openssh-6.7p1.tar.gz 1351367 SHA256 b2f8394eae858dabbdef7dac10b99aec00c95462753e80342e530bbb6f725507 SHA512 2469dfcd289948374843311dd9e5f7e144ce1cebd4bfce0d387d0b75cb59f3e1af1b9ebf96bd4ab6407dfa77a013c5d25742971053e61cae2541054aeaca559d WHIRLPOOL ac8ce86d0f6c78c4cb3624b480f189f951d508db38b22d7a5550b7302d5277c1c7d18eaa713d52139abc0f77edacfdb03ced2603125e3ddf9bc09c69e6b70518
+DIST openssh-lpk-6.7p1-0.3.14.patch.xz 16920 SHA256 0203e6e44e41d58ec46d1611d7efc985134e662bbee51632c29f43ae809003f0 SHA512 344ccde4a04aeb1500400f779e64b2d8a5ad2970de3c4c343ca9605758e22d3812ef5453cd3221b18ad74a9762583c62417879107e4e1dda1398a6a65bcd04b2 WHIRLPOOL 5b6beeb743d04deea70c8b471a328b5f056fd4651e1370c7882e5d12f54fa2170486dcd6f97aa8c58e80af9a2d4012e2dfbcf53185317976d309783ca8d6cf73
+EBUILD openssh-6.7_p1-r99.ebuild 10109 SHA256 3f94d0374656b23805d4d211bc6bf882814082a2d71a7f505e043550dedf029e SHA512 e311b8c49059904226b78bc4184e9e85c9c3e331f50937e20a8db8e337baa9ac8e6d12ab63642aa4247913ff5402fc532fa70192fdaef3072f790db2609a9297 WHIRLPOOL 6fb85a46881a1e226ac8a50fc8bd848d67f21689ff117f457882ae72faff424266816cbd078fea89464a55d3b33cf46bb49f8eaa80f252713d6b8b0ba06da246
+MISC metadata.xml 1912 SHA256 7b838285f09ad395f237a0d0b9963eee86d0e85b58e6e5b4d5edb093fa888a0a SHA512 e55c10ffd12488720c3da19e55942cfedec63fe767fc1608439b5a3932eeb5488086ad7ef4e1f858c89381e737426f035845ea5e8bede4ed8a0ccabdc656d9b5 WHIRLPOOL 5c07b3dd4a4002cff5df62133ecf570bf79f58e9477d0ad25d60f185ee029183d11118147e3adfec373542659d921e99e787054cfe9284031c974d694de6e9ed
diff --git a/net-misc/openssh/files/openssh-4.7_p1-GSSAPI-dns.patch b/net-misc/openssh/files/openssh-4.7_p1-GSSAPI-dns.patch
new file mode 100644
index 00000000..c81ae5cb
--- /dev/null
+++ b/net-misc/openssh/files/openssh-4.7_p1-GSSAPI-dns.patch
@@ -0,0 +1,127 @@
+http://bugs.gentoo.org/165444
+https://bugzilla.mindrot.org/show_bug.cgi?id=1008
+
+Index: readconf.c
+===================================================================
+RCS file: /cvs/openssh/readconf.c,v
+retrieving revision 1.135
+diff -u -r1.135 readconf.c
+--- readconf.c 5 Aug 2006 02:39:40 -0000 1.135
++++ readconf.c 19 Aug 2006 11:59:52 -0000
+@@ -126,6 +126,7 @@
+ oClearAllForwardings, oNoHostAuthenticationForLocalhost,
+ oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
+ oAddressFamily, oGssAuthentication, oGssDelegateCreds,
++ oGssTrustDns,
+ oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly,
+ oSendEnv, oControlPath, oControlMaster, oHashKnownHosts,
+ oTunnel, oTunnelDevice, oLocalCommand, oPermitLocalCommand,
+@@ -163,9 +164,11 @@
+ #if defined(GSSAPI)
+ { "gssapiauthentication", oGssAuthentication },
+ { "gssapidelegatecredentials", oGssDelegateCreds },
++ { "gssapitrustdns", oGssTrustDns },
+ #else
+ { "gssapiauthentication", oUnsupported },
+ { "gssapidelegatecredentials", oUnsupported },
++ { "gssapitrustdns", oUnsupported },
+ #endif
+ { "fallbacktorsh", oDeprecated },
+ { "usersh", oDeprecated },
+@@ -444,6 +447,10 @@
+ intptr = &options->gss_deleg_creds;
+ goto parse_flag;
+
++ case oGssTrustDns:
++ intptr = &options->gss_trust_dns;
++ goto parse_flag;
++
+ case oBatchMode:
+ intptr = &options->batch_mode;
+ goto parse_flag;
+@@ -1010,6 +1017,7 @@
+ options->challenge_response_authentication = -1;
+ options->gss_authentication = -1;
+ options->gss_deleg_creds = -1;
++ options->gss_trust_dns = -1;
+ options->password_authentication = -1;
+ options->kbd_interactive_authentication = -1;
+ options->kbd_interactive_devices = NULL;
+@@ -1100,6 +1108,8 @@
+ options->gss_authentication = 0;
+ if (options->gss_deleg_creds == -1)
+ options->gss_deleg_creds = 0;
++ if (options->gss_trust_dns == -1)
++ options->gss_trust_dns = 0;
+ if (options->password_authentication == -1)
+ options->password_authentication = 1;
+ if (options->kbd_interactive_authentication == -1)
+Index: readconf.h
+===================================================================
+RCS file: /cvs/openssh/readconf.h,v
+retrieving revision 1.63
+diff -u -r1.63 readconf.h
+--- readconf.h 5 Aug 2006 02:39:40 -0000 1.63
++++ readconf.h 19 Aug 2006 11:59:52 -0000
+@@ -45,6 +45,7 @@
+ /* Try S/Key or TIS, authentication. */
+ int gss_authentication; /* Try GSS authentication */
+ int gss_deleg_creds; /* Delegate GSS credentials */
++ int gss_trust_dns; /* Trust DNS for GSS canonicalization */
+ int password_authentication; /* Try password
+ * authentication. */
+ int kbd_interactive_authentication; /* Try keyboard-interactive auth. */
+Index: ssh_config.5
+===================================================================
+RCS file: /cvs/openssh/ssh_config.5,v
+retrieving revision 1.97
+diff -u -r1.97 ssh_config.5
+--- ssh_config.5 5 Aug 2006 01:34:51 -0000 1.97
++++ ssh_config.5 19 Aug 2006 11:59:53 -0000
+@@ -483,7 +483,16 @@
+ Forward (delegate) credentials to the server.
+ The default is
+ .Dq no .
+-Note that this option applies to protocol version 2 only.
++Note that this option applies to protocol version 2 connections using GSSAPI.
++.It Cm GSSAPITrustDns
++Set to
++.Dq yes to indicate that the DNS is trusted to securely canonicalize
++the name of the host being connected to. If
++.Dq no, the hostname entered on the
++command line will be passed untouched to the GSSAPI library.
++The default is
++.Dq no .
++This option only applies to protocol version 2 connections using GSSAPI.
+ .It Cm HashKnownHosts
+ Indicates that
+ .Xr ssh 1
+Index: sshconnect2.c
+===================================================================
+RCS file: /cvs/openssh/sshconnect2.c,v
+retrieving revision 1.151
+diff -u -r1.151 sshconnect2.c
+--- sshconnect2.c 18 Aug 2006 14:33:34 -0000 1.151
++++ sshconnect2.c 19 Aug 2006 11:59:53 -0000
+@@ -499,6 +499,12 @@
+ static u_int mech = 0;
+ OM_uint32 min;
+ int ok = 0;
++ const char *gss_host;
++
++ if (options.gss_trust_dns)
++ gss_host = get_canonical_hostname(1);
++ else
++ gss_host = authctxt->host;
+
+ /* Try one GSSAPI method at a time, rather than sending them all at
+ * once. */
+@@ -511,7 +517,7 @@
+ /* My DER encoding requires length<128 */
+ if (gss_supported->elements[mech].length < 128 &&
+ ssh_gssapi_check_mechanism(&gssctxt,
+- &gss_supported->elements[mech], authctxt->host)) {
++ &gss_supported->elements[mech], gss_host)) {
+ ok = 1; /* Mechanism works */
+ } else {
+ mech++;
diff --git a/net-misc/openssh/files/openssh-6.3_p1-x509-hpn14v2-glue.patch b/net-misc/openssh/files/openssh-6.3_p1-x509-hpn14v2-glue.patch
new file mode 100644
index 00000000..c3647d5a
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.3_p1-x509-hpn14v2-glue.patch
@@ -0,0 +1,51 @@
+--- openssh-6.3p1/Makefile.in
++++ openssh-6.3p1/Makefile.in
+@@ -45,7 +45,7 @@
+ CC=@CC@
+ LD=@LD@
+ CFLAGS=@CFLAGS@
+-CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ @LDAP_CPPFLAGS@ $(PATHS) @DEFS@
++CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
+ LIBS=@LIBS@
+ K5LIBS=@K5LIBS@
+ GSSLIBS=@GSSLIBS@
+@@ -53,6 +53,7 @@
+ SSHDLIBS=@SSHDLIBS@
+ LIBEDIT=@LIBEDIT@
+ LIBLDAP=@LDAP_LDFLAGS@ @LDAP_LIBS@
++CPPFLAGS+=@LDAP_CPPFLAGS@
+ AR=@AR@
+ AWK=@AWK@
+ RANLIB=@RANLIB@
+--- openssh-6.3p1/sshconnect.c
++++ openssh-6.3p1/sshconnect.c
+@@ -465,7 +465,7 @@
+ {
+ /* Send our own protocol version identification. */
+ if (compat20) {
+- xasprintf(&client_version_string, "SSH-%d.%d-%.100s PKIX\r\n",
++ xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
+ PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION);
+ } else {
+ xasprintf(&client_version_string, "SSH-%d.%d-%.100s\n",
+--- openssh-6.3p1/sshd.c
++++ openssh-6.3p1/sshd.c
+@@ -472,8 +472,8 @@
+ comment = "";
+ }
+
+- xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s%s",
+- major, minor, SSH_VERSION, comment,
++ xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
++ major, minor, SSH_VERSION,
+ *options.version_addendum == '\0' ? "" : " ",
+ options.version_addendum, newline);
+
+--- openssh-6.3p1/version.h
++++ openssh-6.3p1/version.h
+@@ -3,4 +3,5 @@
+ #define SSH_VERSION "OpenSSH_6.3"
+
+ #define SSH_PORTABLE "p1"
++#define SSH_X509 " PKIX"
+ #define SSH_RELEASE SSH_VERSION SSH_PORTABLE
diff --git a/net-misc/openssh/files/openssh-6.4_p1-x509-glue.patch b/net-misc/openssh/files/openssh-6.4_p1-x509-glue.patch
new file mode 100644
index 00000000..6aed19be
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.4_p1-x509-glue.patch
@@ -0,0 +1,30 @@
+Make x509 apply after openssh-5.9_p1-sshd-gssapi-multihomed.patch and remove
+redundant README.x509v3 directory.
+
+--- openssh-6.4p1+x509-7.7.diff.orig 2013-11-09 14:51:13.400696545 -0800
++++ openssh-6.4p1+x509-7.7.diff 2013-11-09 14:51:05.798786189 -0800
+@@ -6809,9 +6809,9 @@
+
+ -$OpenBSD: README.dns,v 1.2 2003/10/14 19:43:23 jakob Exp $
+ +$OpenBSD$
+-diff -ruN openssh-6.4p1/README.x509v3/README.x509v3 openssh-6.4p1+x509-7.7/README.x509v3/README.x509v3
+---- openssh-6.4p1/README.x509v3/README.x509v3 1970-01-01 02:00:00.000000000 +0200
+-+++ openssh-6.4p1+x509-7.7/README.x509v3/README.x509v3 2013-05-17 18:50:02.156263192 +0300
++diff -ruN openssh-6.4p1/README.x509v3 openssh-6.4p1+x509-7.7/README.x509v3
++--- openssh-6.4p1/README.x509v3 1970-01-01 02:00:00.000000000 +0200
+++++ openssh-6.4p1+x509-7.7/README.x509v3 2013-05-17 18:50:02.156263192 +0300
+ @@ -0,0 +1,615 @@
+ + Roumen Petrov
+ + Sofia, Bulgaria
+@@ -14793,10 +14793,9 @@
+ .It Cm ChallengeResponseAuthentication
+ Specifies whether challenge-response authentication is allowed (e.g. via
+ PAM or though authentication styles supported in
+-@@ -490,6 +567,16 @@
++@@ -490,5 +567,15 @@
+ The default is
+ .Dq yes .
+- Note that this option applies to protocol version 2 only.
+ +.It Cm HostbasedAlgorithms
+ +Specifies the protocol version 2 algorithms used in
+ +.Dq hostbased
diff --git a/net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch b/net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch
new file mode 100644
index 00000000..a3361cac
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.4p1-fix-typo-construct_utmpx.patch
@@ -0,0 +1,21 @@
+diff -Naur openssh-6.4p1.orig/loginrec.c openssh-6.4p1/loginrec.c
+--- openssh-6.4p1.orig/loginrec.c 2014-01-22 17:33:12.380676129 +0000
++++ openssh-6.4p1/loginrec.c 2014-01-22 17:55:40.957751536 +0000
+@@ -785,12 +785,12 @@
+ /* this is just a 128-bit IPv6 address */
+ if (li->hostaddr.sa.sa_family == AF_INET6) {
+ sa6 = ((struct sockaddr_in6 *)&li->hostaddr.sa);
+- memcpy(ut->ut_addr_v6, sa6->sin6_addr.s6_addr, 16);
++ memcpy(utx->ut_addr_v6, sa6->sin6_addr.s6_addr, 16);
+ if (IN6_IS_ADDR_V4MAPPED(&sa6->sin6_addr)) {
+- ut->ut_addr_v6[0] = ut->ut_addr_v6[3];
+- ut->ut_addr_v6[1] = 0;
+- ut->ut_addr_v6[2] = 0;
+- ut->ut_addr_v6[3] = 0;
++ utx->ut_addr_v6[0] = utx->ut_addr_v6[3];
++ utx->ut_addr_v6[1] = 0;
++ utx->ut_addr_v6[2] = 0;
++ utx->ut_addr_v6[3] = 0;
+ }
+ }
+ # endif
diff --git a/net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch b/net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch
new file mode 100644
index 00000000..22b6ffac
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.4p1-missing-sys_param_h.patch
@@ -0,0 +1,67 @@
+diff -Naur openssh-6.4p1.orig/channels.c openssh-6.4p1/channels.c
+--- openssh-6.4p1.orig/channels.c 2014-01-22 17:14:19.508612783 +0000
++++ openssh-6.4p1/channels.c 2014-01-22 17:18:18.176626129 +0000
+@@ -61,6 +61,7 @@
+ #include <termios.h>
+ #include <unistd.h>
+ #include <stdarg.h>
++#include <sys/param.h>
+
+ #include "openbsd-compat/sys-queue.h"
+ #include "xmalloc.h"
+diff -Naur openssh-6.4p1.orig/loginrec.c openssh-6.4p1/loginrec.c
+--- openssh-6.4p1.orig/loginrec.c 2013-06-01 22:07:32.000000000 +0000
++++ openssh-6.4p1/loginrec.c 2014-01-22 17:30:57.322668577 +0000
+@@ -162,6 +162,7 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <time.h>
++#include <sys/time.h>
+ #include <unistd.h>
+
+ #include "xmalloc.h"
+diff -Naur openssh-6.4p1.orig/sshconnect.c openssh-6.4p1/sshconnect.c
+--- openssh-6.4p1.orig/sshconnect.c 2014-01-22 17:16:53.809621411 +0000
++++ openssh-6.4p1/sshconnect.c 2014-01-22 17:17:19.535622850 +0000
+@@ -40,6 +40,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <sys/param.h>
+
+ #include "xmalloc.h"
+ #include "key.h"
+diff -Naur openssh-6.4p1.orig/sshd.c openssh-6.4p1/sshd.c
+--- openssh-6.4p1.orig/sshd.c 2014-01-22 17:14:19.517612784 +0000
++++ openssh-6.4p1/sshd.c 2014-01-22 17:18:54.560628163 +0000
+@@ -83,6 +83,8 @@
+ #include <prot.h>
+ #endif
+
++#include <sys/param.h>
++
+ #include "xmalloc.h"
+ #include "ssh.h"
+ #include "ssh1.h"
+diff -Naur openssh-6.4p1.orig/ssh-keyscan.c openssh-6.4p1/ssh-keyscan.c
+--- openssh-6.4p1.orig/ssh-keyscan.c 2013-06-01 21:31:19.000000000 +0000
++++ openssh-6.4p1/ssh-keyscan.c 2014-01-22 17:59:37.756764777 +0000
+@@ -29,6 +29,7 @@
+ #include <signal.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <sys/param.h>
+
+ #include "xmalloc.h"
+ #include "ssh.h"
+diff -Naur openssh-6.4p1.orig/ssh-pkcs11-helper.c openssh-6.4p1/ssh-pkcs11-helper.c
+--- openssh-6.4p1.orig/ssh-pkcs11-helper.c 2013-06-01 21:31:19.000000000 +0000
++++ openssh-6.4p1/ssh-pkcs11-helper.c 2014-01-22 18:00:04.653766281 +0000
+@@ -28,6 +28,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <sys/param.h>
+
+ #include "xmalloc.h"
+ #include "buffer.h"
diff --git a/net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch b/net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch
new file mode 100644
index 00000000..fa33af39
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.7_p1-openssl-ignore-status.patch
@@ -0,0 +1,17 @@
+the last nibble of the openssl version represents the status. that is,
+whether it is a beta or release. when it comes to version checks in
+openssh, this component does not matter, so ignore it.
+
+https://bugzilla.mindrot.org/show_bug.cgi?id=2212
+
+--- a/openbsd-compat/openssl-compat.c
++++ b/openbsd-compat/openssl-compat.c
+@@ -58,7 +58,7 @@ ssh_compatible_openssl(long headerver, long libver)
+ * For versions >= 1.0.0, major,minor,status must match and library
+ * fix version must be equal to or newer than the header.
+ */
+- mask = 0xfff0000fL; /* major,minor,status */
++ mask = 0xfff00000L; /* major,minor,status */
+ hfix = (headerver & 0x000ff000) >> 12;
+ lfix = (libver & 0x000ff000) >> 12;
+ if ( (headerver & mask) == (libver & mask) && lfix >= hfix)
diff --git a/net-misc/openssh/files/openssh-6.7_p1-sctp-x509-glue.patch b/net-misc/openssh/files/openssh-6.7_p1-sctp-x509-glue.patch
new file mode 100644
index 00000000..bd0b7ce1
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.7_p1-sctp-x509-glue.patch
@@ -0,0 +1,42 @@
+--- openssh-6.7_p1-sctp.patch.orig 2014-11-24 10:34:31.817538707 -0800
++++ openssh-6.7_p1-sctp.patch 2014-11-24 10:38:52.744990154 -0800
+@@ -195,14 +195,6 @@
+ .Op Fl c Ar cipher
+ .Op Fl F Ar ssh_config
+ .Op Fl i Ar identity_file
+-@@ -178,6 +178,7 @@ For full details of the options listed b
+- .It ServerAliveCountMax
+- .It StrictHostKeyChecking
+- .It TCPKeepAlive
+-+.It Transport
+- .It UsePrivilegedPort
+- .It User
+- .It UserKnownHostsFile
+ @@ -218,6 +219,8 @@ and
+ to print debugging messages about their progress.
+ This is helpful in
+@@ -482,14 +474,6 @@
+ .Op Fl b Ar bind_address
+ .Op Fl c Ar cipher_spec
+ .Op Fl D Oo Ar bind_address : Oc Ns Ar port
+-@@ -473,6 +473,7 @@ For full details of the options listed b
+- .It StreamLocalBindUnlink
+- .It StrictHostKeyChecking
+- .It TCPKeepAlive
+-+.It Transport
+- .It Tunnel
+- .It TunnelDevice
+- .It UsePrivilegedPort
+ @@ -665,6 +666,8 @@ Trusted X11 forwardings are not subjecte
+ controls.
+ .It Fl y
+@@ -527,7 +511,7 @@
+- again:
++
+ - while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx"
+ + while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" SCTP_OPT
+- "ACD:E:F:I:KL:MNO:PQ:R:S:TVw:W:XYy")) != -1) {
++ "ACD:E:F:" ENGCONFIG "I:KL:MNO:PQ:R:S:TVw:W:XYy")) != -1) {
+ switch (opt) {
+ case '1':
+ @@ -732,6 +738,11 @@ main(int ac, char **av)
diff --git a/net-misc/openssh/files/openssh-6.7_p1-sshd-gssapi-multihomed.patch b/net-misc/openssh/files/openssh-6.7_p1-sshd-gssapi-multihomed.patch
new file mode 100644
index 00000000..96818e42
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.7_p1-sshd-gssapi-multihomed.patch
@@ -0,0 +1,162 @@
+https://bugs.gentoo.org/378361
+https://bugzilla.mindrot.org/show_bug.cgi?id=928
+
+--- a/gss-serv.c
++++ b/gss-serv.c
+@@ -41,9 +41,12 @@
+ #include "channels.h"
+ #include "session.h"
+ #include "misc.h"
++#include "servconf.h"
+
+ #include "ssh-gss.h"
+
++extern ServerOptions options;
++
+ static ssh_gssapi_client gssapi_client =
+ { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
+ GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL}};
+@@ -77,25 +80,32 @@ ssh_gssapi_acquire_cred(Gssctxt *ctx)
+ char lname[NI_MAXHOST];
+ gss_OID_set oidset;
+
+- gss_create_empty_oid_set(&status, &oidset);
+- gss_add_oid_set_member(&status, ctx->oid, &oidset);
+-
+- if (gethostname(lname, sizeof(lname))) {
+- gss_release_oid_set(&status, &oidset);
+- return (-1);
+- }
++ if (options.gss_strict_acceptor) {
++ gss_create_empty_oid_set(&status, &oidset);
++ gss_add_oid_set_member(&status, ctx->oid, &oidset);
++
++ if (gethostname(lname, MAXHOSTNAMELEN)) {
++ gss_release_oid_set(&status, &oidset);
++ return (-1);
++ }
++
++ if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) {
++ gss_release_oid_set(&status, &oidset);
++ return (ctx->major);
++ }
++
++ if ((ctx->major = gss_acquire_cred(&ctx->minor,
++ ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds,
++ NULL, NULL)))
++ ssh_gssapi_error(ctx);
+
+- if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) {
+ gss_release_oid_set(&status, &oidset);
+ return (ctx->major);
++ } else {
++ ctx->name = GSS_C_NO_NAME;
++ ctx->creds = GSS_C_NO_CREDENTIAL;
+ }
+-
+- if ((ctx->major = gss_acquire_cred(&ctx->minor,
+- ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL)))
+- ssh_gssapi_error(ctx);
+-
+- gss_release_oid_set(&status, &oidset);
+- return (ctx->major);
++ return GSS_S_COMPLETE;
+ }
+
+ /* Privileged */
+--- a/servconf.c
++++ b/servconf.c
+@@ -86,6 +86,7 @@ initialize_server_options(ServerOptions
+ options->kerberos_get_afs_token = -1;
+ options->gss_authentication=-1;
+ options->gss_cleanup_creds = -1;
++ options->gss_strict_acceptor = -1;
+ options->password_authentication = -1;
+ options->kbd_interactive_authentication = -1;
+ options->challenge_response_authentication = -1;
+@@ -200,6 +201,8 @@ fill_default_server_options(ServerOption
+ options->gss_authentication = 0;
+ if (options->gss_cleanup_creds == -1)
+ options->gss_cleanup_creds = 1;
++ if (options->gss_strict_acceptor == -1)
++ options->gss_strict_acceptor = 0;
+ if (options->password_authentication == -1)
+ options->password_authentication = 1;
+ if (options->kbd_interactive_authentication == -1)
+@@ -277,7 +280,8 @@ typedef enum {
+ sBanner, sUseDNS, sHostbasedAuthentication,
+ sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
+ sClientAliveCountMax, sAuthorizedKeysFile,
+- sGssAuthentication, sGssCleanupCreds, sAcceptEnv, sPermitTunnel,
++ sGssAuthentication, sGssCleanupCreds, sGssStrictAcceptor,
++ sAcceptEnv, sPermitTunnel,
+ sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
+ sUsePrivilegeSeparation, sAllowAgentForwarding,
+ sZeroKnowledgePasswordAuthentication, sHostCertificate,
+@@ -327,9 +331,11 @@ static struct {
+ #ifdef GSSAPI
+ { "gssapiauthentication", sGssAuthentication, SSHCFG_ALL },
+ { "gssapicleanupcredentials", sGssCleanupCreds, SSHCFG_GLOBAL },
++ { "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL },
+ #else
+ { "gssapiauthentication", sUnsupported, SSHCFG_ALL },
+ { "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL },
++ { "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL },
+ #endif
+ { "passwordauthentication", sPasswordAuthentication, SSHCFG_ALL },
+ { "kbdinteractiveauthentication", sKbdInteractiveAuthentication, SSHCFG_ALL },
+@@ -850,6 +856,10 @@ process_server_config_line(ServerOptions
+
+ case sGssCleanupCreds:
+ intptr = &options->gss_cleanup_creds;
++ goto parse_flag;
++
++ case sGssStrictAcceptor:
++ intptr = &options->gss_strict_acceptor;
+ goto parse_flag;
+
+ case sPasswordAuthentication:
+--- a/servconf.h
++++ b/servconf.h
+@@ -92,6 +92,7 @@ typedef struct {
+ * authenticated with Kerberos. */
+ int gss_authentication; /* If true, permit GSSAPI authentication */
+ int gss_cleanup_creds; /* If true, destroy cred cache on logout */
++ int gss_strict_acceptor; /* If true, restrict the GSSAPI acceptor name */
+ int password_authentication; /* If true, permit password
+ * authentication. */
+ int kbd_interactive_authentication; /* If true, permit */
+--- a/sshd_config
++++ b/sshd_config
+@@ -69,6 +69,7 @@
+ # GSSAPI options
+ #GSSAPIAuthentication no
+ #GSSAPICleanupCredentials yes
++#GSSAPIStrictAcceptorCheck yes
+
+ # Set this to 'yes' to enable PAM authentication, account processing,
+ # and session processing. If this is enabled, PAM authentication will
+--- a/sshd_config.5
++++ b/sshd_config.5
+@@ -386,6 +386,21 @@ on logout.
+ The default is
+ .Dq yes .
+ Note that this option applies to protocol version 2 only.
++.It Cm GSSAPIStrictAcceptorCheck
++Determines whether to be strict about the identity of the GSSAPI acceptor
++a client authenticates against.
++If set to
++.Dq yes
++then the client must authenticate against the
++.Pa host
++service on the current hostname.
++If set to
++.Dq no
++then the client may authenticate against any service key stored in the
++machine's default store.
++This facility is provided to assist with operation on multi homed machines.
++The default is
++.Dq yes .
+ .It Cm HostbasedAuthentication
+ Specifies whether rhosts or /etc/hosts.equiv authentication together
+ with successful public key client host authentication is allowed
diff --git a/net-misc/openssh/files/openssh-6.7_p1-x509-glue.patch b/net-misc/openssh/files/openssh-6.7_p1-x509-glue.patch
new file mode 100644
index 00000000..71b9c517
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.7_p1-x509-glue.patch
@@ -0,0 +1,46 @@
+--- openssh-6.7p1.orig/sshd_config.5 2014-11-24 10:24:29.356244415 -0800
++++ openssh-6.7p1/sshd_config.5 2014-11-24 10:23:49.415029039 -0800
+@@ -610,21 +610,6 @@
+ The default is
+ .Dq yes .
+ Note that this option applies to protocol version 2 only.
+-.It Cm GSSAPIStrictAcceptorCheck
+-Determines whether to be strict about the identity of the GSSAPI acceptor
+-a client authenticates against.
+-If set to
+-.Dq yes
+-then the client must authenticate against the
+-.Pa host
+-service on the current hostname.
+-If set to
+-.Dq no
+-then the client may authenticate against any service key stored in the
+-machine's default store.
+-This facility is provided to assist with operation on multi homed machines.
+-The default is
+-.Dq yes .
+ .It Cm HostbasedAuthentication
+ Specifies whether rhosts or /etc/hosts.equiv authentication together
+ with successful public key client host authentication is allowed
+@@ -651,6 +636,21 @@
+ attempting to resolve the name from the TCP connection itself.
+ The default is
+ .Dq no .
++.It Cm GSSAPIStrictAcceptorCheck
++Determines whether to be strict about the identity of the GSSAPI acceptor
++a client authenticates against.
++If set to
++.Dq yes
++then the client must authenticate against the
++.Pa host
++service on the current hostname.
++If set to
++.Dq no
++then the client may authenticate against any service key stored in the
++machine's default store.
++This facility is provided to assist with operation on multi homed machines.
++The default is
++.Dq yes .
+ .It Cm HostCertificate
+ Specifies a file containing a public host certificate.
+ The certificate's public key must match a private host key already specified
diff --git a/net-misc/openssh/files/openssh-6.7p1-avoid-exit.patch b/net-misc/openssh/files/openssh-6.7p1-avoid-exit.patch
new file mode 100644
index 00000000..4998a941
--- /dev/null
+++ b/net-misc/openssh/files/openssh-6.7p1-avoid-exit.patch
@@ -0,0 +1,441 @@
+diff -ur a/openssh-6.7p1/configure.ac b/openssh-6.7p1/configure.ac
+--- a/openssh-6.7p1/configure.ac 2014-08-26 21:32:01.000000000 -0100
++++ b/openssh-6.7p1/configure.ac 2014-12-08 20:55:47.281836604 -0100
+@@ -252,7 +252,7 @@
+ [AC_LANG_PROGRAM([[
+ #include <stdlib.h>
+ __attribute__((__unused__)) static void foo(void){return;}]],
+- [[ exit(0); ]])],
++ [[ return 0; ]])],
+ [ AC_MSG_RESULT([yes]) ],
+ [ AC_MSG_RESULT([no])
+ AC_DEFINE(NO_ATTRIBUTE_ON_RETURN_TYPE, 1,
+@@ -442,7 +442,7 @@
+ [AC_LANG_PROGRAM([[
+ #define testmacro foo
+ #define testmacro bar]],
+- [[ exit(0); ]])],
++ [[ return 0; ]])],
+ [ AC_MSG_RESULT([yes]) ],
+ [ AC_MSG_RESULT([no])
+ CC="`echo $CC | sed 's/-qlanglvl\=ansi//g'`"
+@@ -562,9 +562,9 @@
+ AC_MSG_CHECKING([if we have working getaddrinfo])
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h>
+ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
+- exit(0);
++ return 0;
+ else
+- exit(1);
++ return 1;
+ }
+ ]])],
+ [AC_MSG_RESULT([working])],
+@@ -1067,7 +1067,7 @@
+ esac
+
+ AC_MSG_CHECKING([compiler and flags for sanity])
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])],
++AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ return 0; ]])],
+ [ AC_MSG_RESULT([yes]) ],
+ [
+ AC_MSG_RESULT([no])
+@@ -1099,9 +1099,9 @@
+ strncpy(buf,"/etc", 32);
+ s = dirname(buf);
+ if (!s || strncmp(s, "/", 32) != 0) {
+- exit(1);
++ return 1;
+ } else {
+- exit(0);
++ return 0;
+ }
+ }
+ ]])],
+@@ -1191,19 +1191,19 @@
+ int a=0, b=0, c=0, d=0, n, v;
+ n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d);
+ if (n != 3 && n != 4)
+- exit(1);
++ return 1;
+ v = a*1000000 + b*10000 + c*100 + d;
+ fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v);
+
+ /* 1.1.4 is OK */
+ if (a == 1 && b == 1 && c >= 4)
+- exit(0);
++ return 0;
+
+ /* 1.2.3 and up are OK */
+ if (v >= 1020300)
+- exit(0);
++ return 0;
+
+- exit(2);
++ return 2;
+ ]])],
+ AC_MSG_RESULT([no]),
+ [ AC_MSG_RESULT([yes])
+@@ -1308,7 +1308,7 @@
+ #include <dirent.h>]],
+ [[
+ struct dirent d;
+- exit(sizeof(d.d_name)<=sizeof(char));
++ return sizeof(d.d_name)<=sizeof(char);
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [
+@@ -1354,7 +1354,7 @@
+ #include <skey.h>
+ ]], [[
+ char *ff = skey_keyinfo(""); ff="";
+- exit(0);
++ return 0;
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [
+@@ -1403,7 +1403,7 @@
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <ldns/ldns.h>
+-int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; exit(0); }
++int main() { ldns_status status = ldns_verify_trusted(NULL, NULL, NULL, NULL); status=LDNS_STATUS_OK; return 0; }
+ ]])
+ ],
+ [AC_MSG_RESULT(yes)],
+@@ -1460,7 +1460,7 @@
+ [[
+ int i = H_SETSIZE;
+ el_init("", NULL, NULL, NULL);
+- exit(0);
++ return 0;
+ ]])],
+ [ AC_MSG_RESULT([yes]) ],
+ [ AC_MSG_RESULT([no])
+@@ -1808,9 +1808,9 @@
+ errno=0;
+ setresuid(0,0,0);
+ if (errno==ENOSYS)
+- exit(1);
++ return 1;
+ else
+- exit(0);
++ return 0;
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_DEFINE([BROKEN_SETRESUID], [1],
+@@ -1831,9 +1831,9 @@
+ errno=0;
+ setresgid(0,0,0);
+ if (errno==ENOSYS)
+- exit(1);
++ return 1;
+ else
+- exit(0);
++ return 0;
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_DEFINE([BROKEN_SETRESGID], [1],
+@@ -1875,7 +1875,7 @@
+ [[
+ char b[5];
+ snprintf(b,5,"123456789");
+- exit(b[4]!='\0');
++ return b[4]!='\0';
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [
+@@ -1966,9 +1966,9 @@
+ ]], [[
+ char template[]="conftest.mkstemp-test";
+ if (mkstemp(template) == -1)
+- exit(1);
++ return 1;
+ unlink(template);
+- exit(0);
++ return 0;
+ ]])],
+ [
+ AC_MSG_RESULT([no])
+@@ -1999,22 +1999,22 @@
+
+ pid = fork();
+ if (pid < 0) { /* failed */
+- exit(1);
++ return 1;
+ } else if (pid > 0) { /* parent */
+ waitpid(pid, &status, 0);
+ if (WIFEXITED(status))
+- exit(WEXITSTATUS(status));
++ return WEXITSTATUS(status);
+ else
+- exit(2);
++ return 2;
+ } else { /* child */
+ close(0); close(1); close(2);
+ setsid();
+ openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
+ fd = open("/dev/tty", O_RDWR | O_NOCTTY);
+ if (fd >= 0)
+- exit(3); /* Acquired ctty: broken */
++ return 3; /* Acquired ctty: broken */
+ else
+- exit(0); /* Did not acquire ctty: OK */
++ return 0; /* Did not acquire ctty: OK */
+ }
+ ]])],
+ [
+@@ -2055,7 +2055,7 @@
+ err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
+ if (err != 0) {
+ fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
+- exit(1);
++ return 1;
+ }
+
+ for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
+@@ -2072,7 +2072,7 @@
+ else
+ fprintf(stderr, "getnameinfo failed: %s\n",
+ gai_strerror(err));
+- exit(2);
++ return 2;
+ }
+
+ sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+@@ -2080,10 +2080,10 @@
+ perror("socket");
+ if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
+ if (errno == EBADF)
+- exit(3);
++ return 3;
+ }
+ }
+- exit(0);
++ return 0;
+ ]])],
+ [
+ AC_MSG_RESULT([yes])
+@@ -2123,7 +2123,7 @@
+ err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
+ if (err != 0) {
+ fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
+- exit(1);
++ return 1;
+ }
+
+ for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
+@@ -2136,10 +2136,10 @@
+
+ if (ai->ai_family == AF_INET && err != 0) {
+ perror("getnameinfo");
+- exit(2);
++ return 2;
+ }
+ }
+- exit(0);
++ return 0;
+ ]])],
+ [
+ AC_MSG_RESULT([yes])
+@@ -2248,12 +2248,12 @@
+
+ fd = fopen(DATA,"w");
+ if(fd == NULL)
+- exit(1);
++ return 1;
+
+ if ((rc = fprintf(fd ,"%08x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
+- exit(1);
++ return 1;
+
+- exit(0);
++ return 0;
+ ]])],
+ [
+ ssl_header_ver=`cat conftest.sslincver`
+@@ -2283,13 +2283,13 @@
+
+ fd = fopen(DATA,"w");
+ if(fd == NULL)
+- exit(1);
++ return 1;
+
+ if ((rc = fprintf(fd ,"%08x (%s)\n", SSLeay(),
+ SSLeay_version(SSLEAY_VERSION))) <0)
+- exit(1);
++ return 1;
+
+- exit(0);
++ return 0;
+ ]])],
+ [
+ ssl_library_ver=`cat conftest.ssllibver`
+@@ -2330,7 +2330,7 @@
+ #include <string.h>
+ #include <openssl/opensslv.h>
+ ]], [[
+- exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1);
++ return SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1;
+ ]])],
+ [
+ AC_MSG_RESULT([yes])
+@@ -2419,7 +2419,7 @@
+ #include <string.h>
+ #include <openssl/evp.h>
+ ]], [[
+- exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
++ return EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL;
+ ]])],
+ [
+ AC_MSG_RESULT([no])
+@@ -2490,7 +2490,7 @@
+ #include <openssl/evp.h>
+ ]], [[
+ if(EVP_DigestUpdate(NULL, NULL,0))
+- exit(0);
++ return 0;
+ ]])],
+ [
+ AC_MSG_RESULT([yes])
+@@ -2604,7 +2604,7 @@
+ ]],[[
+ EC_KEY *e = EC_KEY_new_by_curve_name(NID_secp521r1);
+ const EVP_MD *m = EVP_sha512(); /* We need this too */
+- exit(e == NULL || m == NULL);
++ return e == NULL || m == NULL;
+ ]])],
+ [ AC_MSG_RESULT([yes])
+ enable_nistp521=1 ],
+@@ -2677,7 +2677,7 @@
+ #include <string.h>
+ #include <openssl/rand.h>
+ ]], [[
+- exit(RAND_status() == 1 ? 0 : 1);
++ return RAND_status() == 1 ? 0 : 1;
+ ]])],
+ [
+ OPENSSL_SEEDS_ITSELF=yes
+@@ -2985,7 +2985,7 @@
+ struct rlimit rl_zero;
+
+ rl_zero.rlim_cur = rl_zero.rlim_max = 0;
+- exit(setrlimit(RLIMIT_FSIZE, &rl_zero) != 0);
++ return setrlimit(RLIMIT_FSIZE, &rl_zero) != 0;
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+@@ -3119,7 +3119,7 @@
+ long long i, llmin, llmax = 0;
+
+ if((f = fopen(DATA,"w")) == NULL)
+- exit(1);
++ return 1;
+
+ #if defined(LLONG_MIN) && defined(LLONG_MAX)
+ fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n");
+@@ -3138,16 +3138,16 @@
+ || llmax - 1 > llmax || llmin == llmax || llmin == 0
+ || llmax == 0 || llmax < LONG_MAX || llmin > LONG_MIN) {
+ fprintf(f, "unknown unknown\n");
+- exit(2);
++ return 2;
+ }
+
+ if (fprint_ll(f, llmin) < 0)
+- exit(3);
++ return 3;
+ if (fprint_ll(f, llmax) < 0)
+- exit(4);
++ return 4;
+ if (fclose(f) < 0)
+- exit(5);
+- exit(0);
++ return 5;
++ return 0;
+ ]])],
+ [
+ llong_min=`$AWK '{print $1}' conftest.llminmax`
+@@ -3553,8 +3553,8 @@
+ strcpy(expected_out, "9223372036854775807");
+ snprintf(buf, mazsize, "%lld", num);
+ if(strcmp(buf, expected_out) != 0)
+- exit(1);
+- exit(0);
++ return 1;
++ return 0;
+ }
+ #else
+ main() { exit(0); }
+@@ -3641,11 +3641,11 @@
+ ]], [[
+ #ifdef msg_accrights
+ #error "msg_accrights is a macro"
+-exit(1);
++return 1;
+ #endif
+ struct msghdr m;
+ m.msg_accrights = 0;
+-exit(0);
++return 0;
+ ]])],
+ [ ac_cv_have_accrights_in_msghdr="yes" ],
+ [ ac_cv_have_accrights_in_msghdr="no" ]
+@@ -3702,11 +3702,11 @@
+ ]], [[
+ #ifdef msg_control
+ #error "msg_control is a macro"
+-exit(1);
++return 1;
+ #endif
+ struct msghdr m;
+ m.msg_control = 0;
+-exit(0);
++return 0;
+ ]])],
+ [ ac_cv_have_control_in_msghdr="yes" ],
+ [ ac_cv_have_control_in_msghdr="no" ]
+@@ -4128,22 +4128,22 @@
+
+ fd = fopen(DATA,"w");
+ if(fd == NULL)
+- exit(1);
++ return 1;
+
+ #if defined (_PATH_MAILDIR)
+ if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
+- exit(1);
++ return 1;
+ #elif defined (MAILDIR)
+ if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
+- exit(1);
++ return 1;
+ #elif defined (_PATH_MAIL)
+ if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
+- exit(1);
++ return 1;
+ #else
+ exit (2);
+ #endif
+
+- exit(0);
++ return 0;
+ ]])],
+ [
+ maildir_what=`awk -F: '{print $1}' conftest.maildir`
+@@ -4378,12 +4378,12 @@
+
+ fd = fopen(DATA,"w");
+ if(fd == NULL)
+- exit(1);
++ return 1;
+
+ if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
+- exit(1);
++ return 1;
+
+- exit(0);
++ return 0;
+ ]])],
+ [ user_path=`cat conftest.stdpath` ],
+ [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
diff --git a/net-misc/openssh/files/sshd.confd b/net-misc/openssh/files/sshd.confd
new file mode 100644
index 00000000..28952b4a
--- /dev/null
+++ b/net-misc/openssh/files/sshd.confd
@@ -0,0 +1,21 @@
+# /etc/conf.d/sshd: config file for /etc/init.d/sshd
+
+# Where is your sshd_config file stored?
+
+SSHD_CONFDIR="/etc/ssh"
+
+
+# Any random options you want to pass to sshd.
+# See the sshd(8) manpage for more info.
+
+SSHD_OPTS=""
+
+
+# Pid file to use (needs to be absolute path).
+
+#SSHD_PIDFILE="/var/run/sshd.pid"
+
+
+# Path to the sshd binary (needs to be absolute path).
+
+#SSHD_BINARY="/usr/sbin/sshd"
diff --git a/net-misc/openssh/files/sshd.pam_include.2 b/net-misc/openssh/files/sshd.pam_include.2
new file mode 100644
index 00000000..b801aaaf
--- /dev/null
+++ b/net-misc/openssh/files/sshd.pam_include.2
@@ -0,0 +1,4 @@
+auth include system-remote-login
+account include system-remote-login
+password include system-remote-login
+session include system-remote-login
diff --git a/net-misc/openssh/files/sshd.rc6.4 b/net-misc/openssh/files/sshd.rc6.4
new file mode 100755
index 00000000..1b872bc8
--- /dev/null
+++ b/net-misc/openssh/files/sshd.rc6.4
@@ -0,0 +1,87 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/files/sshd.rc6.4,v 1.3 2013/04/24 03:13:03 vapier Exp $
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+SSHD_CONFDIR=${SSHD_CONFDIR:-/etc/ssh}
+SSHD_CONFIG=${SSHD_CONFIG:-${SSHD_CONFDIR}/sshd_config}
+SSHD_PIDFILE=${SSHD_PIDFILE:-/var/run/${SVCNAME}.pid}
+SSHD_BINARY=${SSHD_BINARY:-/usr/sbin/sshd}
+
+depend() {
+ use logger dns
+ if [ "${rc_need+set}" = "set" ]; then
+ : # Do nothing, the user has explicitly set rc_need
+ else
+ warn_addr=''
+ for x in $(awk '/^ListenAddress/{ print $2 }' "$SSHD_CONFIG" 2>/dev/null) ; do
+ case "$x" in
+ 0.0.0.0|0.0.0.0:*) ;;
+ ::|\[::\]*) ;;
+ *) warn_addr="${warn_addr} $x" ;;
+ esac
+ done
+ unset x
+ if [ "${warn_addr:+set}" = "set" ]; then
+ need net
+ ewarn "You are binding an interface in ListenAddress statement in your sshd_config!"
+ ewarn "You must add rc_need=\"net.FOO\" to your /etc/conf.d/sshd"
+ ewarn "where FOO is the interface(s) providing the following address(es):"
+ ewarn "${warn_addr}"
+ fi
+ unset warn_addr
+ fi
+}
+
+checkconfig() {
+ if [ ! -d /var/empty ] ; then
+ mkdir -p /var/empty || return 1
+ fi
+
+ if [ ! -e "${SSHD_CONFDIR}"/sshd_config ] ; then
+ eerror "You need an ${SSHD_CONFDIR}/sshd_config file to run sshd"
+ eerror "There is a sample file in /usr/share/doc/openssh"
+ return 1
+ fi
+
+ ssh-keygen -A || return 1
+
+ [ "${SSHD_PIDFILE}" != "/var/run/sshd.pid" ] \
+ && SSHD_OPTS="${SSHD_OPTS} -o PidFile=${SSHD_PIDFILE}"
+ [ "${SSHD_CONFDIR}" != "/etc/ssh" ] \
+ && SSHD_OPTS="${SSHD_OPTS} -f ${SSHD_CONFDIR}/sshd_config"
+
+ "${SSHD_BINARY}" -t ${SSHD_OPTS} || return 1
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec "${SSHD_BINARY}" \
+ --pidfile "${SSHD_PIDFILE}" \
+ -- ${SSHD_OPTS}
+ eend $?
+}
+
+stop() {
+ if [ "${RC_CMD}" = "restart" ] ; then
+ checkconfig || return 1
+ fi
+
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec "${SSHD_BINARY}" \
+ --pidfile "${SSHD_PIDFILE}" --quiet
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP \
+ --exec "${SSHD_BINARY}" --pidfile "${SSHD_PIDFILE}"
+ eend $?
+}
diff --git a/net-misc/openssh/files/sshd.service b/net-misc/openssh/files/sshd.service
new file mode 100644
index 00000000..b5e96b3a
--- /dev/null
+++ b/net-misc/openssh/files/sshd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenSSH server daemon
+After=syslog.target network.target auditd.service
+
+[Service]
+ExecStartPre=/usr/bin/ssh-keygen -A
+ExecStart=/usr/sbin/sshd -D -e
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/openssh/files/sshd.socket b/net-misc/openssh/files/sshd.socket
new file mode 100644
index 00000000..94b95331
--- /dev/null
+++ b/net-misc/openssh/files/sshd.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=OpenSSH Server Socket
+Conflicts=sshd.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/net-misc/openssh/files/sshd_at.service b/net-misc/openssh/files/sshd_at.service
new file mode 100644
index 00000000..2645ad04
--- /dev/null
+++ b/net-misc/openssh/files/sshd_at.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=OpenSSH per-connection server daemon
+After=syslog.target auditd.service
+
+[Service]
+ExecStart=-/usr/sbin/sshd -i -e
+StandardInput=socket
+StandardError=syslog
diff --git a/net-misc/openssh/metadata.xml b/net-misc/openssh/metadata.xml
new file mode 100644
index 00000000..885648b4
--- /dev/null
+++ b/net-misc/openssh/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <maintainer restrict="net-misc/openssh[ldap]">
+ <email>robbat2@gentoo.org</email>
+ <description>LPK issues. Only assign if it's a direct LPK issue. Do not directly assign for anything else.</description>
+ </maintainer>
+ <longdescription>
+OpenSSH is a FREE version of the SSH protocol suite of network connectivity tools that
+increasing numbers of people on the Internet are coming to rely on. Many users of telnet,
+rlogin, ftp, and other such programs might not realize that their password is transmitted
+across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords)
+to effectively eliminate eavesdropping, connection hijacking, and other network-level attacks.
+Additionally, OpenSSH provides a myriad of secure tunneling capabilities, as well as a variety
+of authentication methods.
+
+The OpenSSH suite includes the ssh program which replaces rlogin and telnet, scp which
+replaces rcp, and sftp which replaces ftp. Also included is sshd which is the server side of
+the package, and the other basic utilities like ssh-add, ssh-agent, ssh-keysign, ssh-keyscan,
+ssh-keygen and sftp-server. OpenSSH supports SSH protocol versions 1.3, 1.5, and 2.0.
+</longdescription>
+ <use>
+ <flag name="bindist">Disable EC/RC5 algorithms in OpenSSL for patent reasons.</flag>
+ <flag name="hpn">Enable high performance ssh</flag>
+ <flag name="ldap">Add support for storing SSH public keys in LDAP</flag>
+ <flag name="ldns">Use LDNS for DNSSEC/SSHFP validation.</flag>
+ <flag name="sctp">Support for Stream Control Transmission Protocol</flag>
+ <flag name="X509">Adds support for X.509 certificate authentication</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:openssh:openssh</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/openssh/openssh-6.7_p1-r99.ebuild b/net-misc/openssh/openssh-6.7_p1-r99.ebuild
new file mode 100644
index 00000000..f6ad39c5
--- /dev/null
+++ b/net-misc/openssh/openssh-6.7_p1-r99.ebuild
@@ -0,0 +1,330 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-6.7_p1-r3.ebuild,v 1.1 2014/11/25 22:35:45 chutzpah Exp $
+
+EAPI="4"
+inherit eutils user flag-o-matic multilib autotools pam systemd versionator
+
+# Make it more portable between straight releases
+# and _p? releases.
+PARCH=${P/_}
+
+HPN_PATCH="${PN}-6.7p1-hpnssh14v5.tar.xz"
+LDAP_PATCH="${PN}-lpk-6.7p1-0.3.14.patch.xz"
+X509_VER="8.2" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
+
+DESCRIPTION="Port of OpenBSD's free SSH release"
+HOMEPAGE="http://www.openssh.org/"
+SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
+ mirror://gentoo/${P}-sctp.patch.xz
+ ${HPN_PATCH:+hpn? (
+ mirror://gentoo/${HPN_PATCH}
+ http://dev.gentoo.org/~vapier/dist/${HPN_PATCH}
+ mirror://sourceforge/hpnssh/${HPN_PATCH}
+ )}
+ ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
+ ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
+ "
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="bindist ${HPN_PATCH:++}hpn kerberos kernel_linux ldap ldns libedit pam +pie sctp selinux skey static X X509"
+REQUIRED_USE="pie? ( !static )"
+
+LIB_DEPEND="sctp? ( net-misc/lksctp-tools[static-libs(+)] )
+ selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
+ skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
+ libedit? ( dev-libs/libedit[static-libs(+)] )
+ >=dev-libs/openssl-0.9.6d:0[bindist=]
+ dev-libs/openssl[static-libs(+)]
+ >=sys-libs/zlib-1.2.3[static-libs(+)]"
+RDEPEND="
+ !static? (
+ ${LIB_DEPEND//\[static-libs(+)]}
+ ldns? (
+ !bindist? ( net-libs/ldns[ecdsa,ssl] )
+ bindist? ( net-libs/ldns[-ecdsa,ssl] )
+ )
+ )
+ pam? ( virtual/pam )
+ kerberos? ( virtual/krb5 )
+ ldap? ( net-nds/openldap )"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ ldns? (
+ !bindist? ( net-libs/ldns[ecdsa,ssl,static-libs(+)] )
+ bindist? ( net-libs/ldns[-ecdsa,ssl,static-libs(+)] )
+ )
+ )
+ virtual/pkgconfig
+ virtual/os-headers
+ sys-devel/autoconf"
+RDEPEND="${RDEPEND}
+ pam? ( >=sys-auth/pambase-20081028 )
+ userland_GNU? ( virtual/shadow )
+ X? ( x11-apps/xauth )"
+
+S=${WORKDIR}/${PARCH}
+
+pkg_setup() {
+ # this sucks, but i'd rather have people unable to `emerge -u openssh`
+ # than not be able to log in to their server any more
+ maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
+ local fail="
+ $(use X509 && maybe_fail X509 X509_PATCH)
+ $(use ldap && maybe_fail ldap LDAP_PATCH)
+ $(use hpn && maybe_fail hpn HPN_PATCH)
+ "
+ fail=$(echo ${fail})
+ if [[ -n ${fail} ]] ; then
+ eerror "Sorry, but this version does not yet support features"
+ eerror "that you requested: ${fail}"
+ eerror "Please mask ${PF} for now and check back later:"
+ eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
+ die "booooo"
+ fi
+}
+
+save_version() {
+ # version.h patch conflict avoidence
+ mv version.h version.h.$1
+ cp -f version.h.pristine version.h
+}
+
+src_prepare() {
+ sed -i \
+ -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX}/usr/bin/xauth:" \
+ pathnames.h || die
+ # keep this as we need it to avoid the conflict between LPK and HPN changing
+ # this file.
+ cp version.h version.h.pristine
+
+ # don't break .ssh/authorized_keys2 for fun
+ sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
+
+ epatch "${FILESDIR}"/${PN}-6.7_p1-sshd-gssapi-multihomed.patch #378361
+ if use X509 ; then
+ pushd .. >/dev/null
+ epatch "${FILESDIR}"/${P}-x509-glue.patch
+ epatch "${FILESDIR}"/${P}-sctp-x509-glue.patch
+ popd >/dev/null
+ epatch "${WORKDIR}"/${X509_PATCH%.*}
+ epatch "${FILESDIR}"/${PN}-6.3_p1-x509-hpn14v2-glue.patch
+ save_version X509
+ fi
+ if ! use X509 ; then
+ if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
+ epatch "${WORKDIR}"/${LDAP_PATCH%.*}
+ save_version LPK
+ fi
+ else
+ use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
+ fi
+ epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
+ epatch "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
+ epatch "${WORKDIR}"/${PN}-6.7_p1-sctp.patch
+ if [[ -n ${HPN_PATCH} ]] && use hpn; then
+ epatch "${WORKDIR}"/${HPN_PATCH%.*}/*
+ save_version HPN
+ fi
+
+ tc-export PKG_CONFIG
+ local sed_args=(
+ -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
+ # Disable PATH reset, trust what portage gives us #254615
+ -e 's:^PATH=/:#PATH=/:'
+ # Disable fortify flags ... our gcc does this for us
+ -e 's:-D_FORTIFY_SOURCE=2::'
+ )
+ # The -ftrapv flag ICEs on hppa #505182
+ use hppa && sed_args+=(
+ -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
+ -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
+ )
+ sed -i "${sed_args[@]}" configure{.ac,} || die
+
+ epatch "${FILESDIR}"/${PN}-6.7p1-avoid-exit.patch
+ epatch "${FILESDIR}"/${PN}-6.4p1-missing-sys_param_h.patch
+ epatch "${FILESDIR}"/${PN}-6.4p1-fix-typo-construct_utmpx.patch
+
+ epatch_user #473004
+
+ # Now we can build a sane merged version.h
+ (
+ sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
+ macros=()
+ for p in HPN LPK X509 ; do [ -e version.h.${p} ] && macros+=( SSH_${p} ) ; done
+ printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros}"
+ ) > version.h
+
+ eautoreconf
+}
+
+static_use_with() {
+ local flag=$1
+ if use static && use ${flag} ; then
+ ewarn "Disabling '${flag}' support because of USE='static'"
+ # rebuild args so that we invert the first one (USE flag)
+ # but otherwise leave everything else working so we can
+ # just leverage use_with
+ shift
+ [[ -z $1 ]] && flag="${flag} ${flag}"
+ set -- !${flag} "$@"
+ fi
+ use_with "$@"
+}
+
+src_configure() {
+ local myconf=()
+ addwrite /dev/ptmx
+ addpredict /etc/skey/skeykeys #skey configure code triggers this
+
+ use static && append-ldflags -static
+
+ # Special settings for Gentoo/FreeBSD 9.0 or later (see bug #391011)
+ if use elibc_FreeBSD && version_is_at_least 9.0 "$(uname -r|sed 's/\(.\..\).*/\1/')" ; then
+ myconf+=( --disable-utmp --disable-wtmp --disable-wtmpx )
+ append-ldflags -lutil
+ fi
+
+ # __stack_chk_fail_local
+ use x86 && myconf+=( --without-stackprotect)
+ use ppc && myconf+=( --without-stackprotect)
+
+ econf \
+ --with-ldflags="${LDFLAGS}" \
+ --disable-strip \
+ --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run \
+ --sysconfdir="${EPREFIX}"/etc/ssh \
+ --libexecdir="${EPREFIX}"/usr/$(get_libdir)/misc \
+ --datadir="${EPREFIX}"/usr/share/openssh \
+ --with-privsep-path="${EPREFIX}"/var/empty \
+ --with-privsep-user=sshd \
+ --with-md5-passwords \
+ --with-ssl-engine \
+ $(static_use_with pam) \
+ $(static_use_with kerberos kerberos5 "${EPREFIX}"/usr) \
+ ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
+ $(use_with ldns) \
+ $(use_with libedit) \
+ $(use_with pie) \
+ $(use_with sctp) \
+ $(use_with selinux) \
+ $(use_with skey) \
+ "${myconf[@]}"
+}
+
+src_install() {
+ emake install-nokeys DESTDIR="${D}"
+ fperms 600 /etc/ssh/sshd_config
+ dobin contrib/ssh-copy-id
+ newinitd "${FILESDIR}"/sshd.rc6.4 sshd
+ newconfd "${FILESDIR}"/sshd.confd sshd
+ keepdir /var/empty
+
+ # not all openssl installs support ecc, or are functional #352645
+ if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
+ elog "dev-libs/openssl was built with 'bindist' - disabling ecdsa support"
+ sed -i 's:&& gen_key ecdsa::' "${ED}"/etc/init.d/sshd || die
+ fi
+
+ newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
+ if use pam ; then
+ sed -i \
+ -e "/^#UsePAM /s:.*:UsePAM yes:" \
+ -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
+ -e "/^#PrintMotd /s:.*:PrintMotd no:" \
+ -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
+ "${ED}"/etc/ssh/sshd_config || die "sed of configuration file failed"
+ fi
+
+ # Gentoo tweaks to default config files
+ cat <<-EOF >> "${ED}"/etc/ssh/sshd_config
+
+ # Allow client to pass locale environment variables #367017
+ AcceptEnv LANG LC_*
+ EOF
+ cat <<-EOF >> "${ED}"/etc/ssh/ssh_config
+
+ # Send locale environment variables #367017
+ SendEnv LANG LC_*
+ EOF
+
+ # This instruction is from the HPN webpage,
+ # Used for the server logging functionality
+ if [[ -n ${HPN_PATCH} ]] && use hpn ; then
+ keepdir /var/empty/dev
+ fi
+
+ if ! use X509 && [[ -n ${LDAP_PATCH} ]] && use ldap ; then
+ insinto /etc/openldap/schema/
+ newins openssh-lpk_openldap.schema openssh-lpk.schema
+ fi
+
+ doman contrib/ssh-copy-id.1
+ dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
+
+ diropts -m 0700
+ dodir /etc/skel/.ssh
+
+ systemd_dounit "${FILESDIR}"/sshd.{service,socket}
+ systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
+}
+
+src_test() {
+ local t tests skipped failed passed shell
+ tests="interop-tests compat-tests"
+ skipped=""
+ shell=$(egetshell ${UID})
+ if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
+ elog "Running the full OpenSSH testsuite"
+ elog "requires a usable shell for the 'portage'"
+ elog "user, so we will run a subset only."
+ skipped="${skipped} tests"
+ else
+ tests="${tests} tests"
+ fi
+ # It will also attempt to write to the homedir .ssh
+ local sshhome=${T}/homedir
+ mkdir -p "${sshhome}"/.ssh
+ for t in ${tests} ; do
+ # Some tests read from stdin ...
+ HOMEDIR="${sshhome}" \
+ emake -k -j1 ${t} </dev/null \
+ && passed="${passed}${t} " \
+ || failed="${failed}${t} "
+ done
+ einfo "Passed tests: ${passed}"
+ ewarn "Skipped tests: ${skipped}"
+ if [[ -n ${failed} ]] ; then
+ ewarn "Failed tests: ${failed}"
+ die "Some tests failed: ${failed}"
+ else
+ einfo "Failed tests: ${failed}"
+ return 0
+ fi
+}
+
+pkg_preinst() {
+ enewgroup sshd 22
+ enewuser sshd 22 -1 /var/empty sshd
+}
+
+pkg_postinst() {
+ if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
+ elog "Starting with openssh-5.8p1, the server will default to a newer key"
+ elog "algorithm (ECDSA). You are encouraged to manually update your stored"
+ elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
+ fi
+ ewarn "Remember to merge your config files in /etc/ssh/ and then"
+ ewarn "reload sshd: '/etc/init.d/sshd reload'."
+ # This instruction is from the HPN webpage,
+ # Used for the server logging functionality
+ if [[ -n ${HPN_PATCH} ]] && use hpn ; then
+ echo
+ einfo "For the HPN server logging patch, you must ensure that"
+ einfo "your syslog application also listens at /var/empty/dev/log."
+ fi
+}
diff --git a/net-misc/openvpn/Manifest b/net-misc/openvpn/Manifest
new file mode 100644
index 00000000..4c4ace65
--- /dev/null
+++ b/net-misc/openvpn/Manifest
@@ -0,0 +1,15 @@
+AUX 2.3.6-disable-compression.patch 579 SHA256 644068d1925a7b2866a4afaef15ebb27f5bbf1b55eed0894d34f7603c230bd9a SHA512 56acdd4716df4f6a0367fd583296718e30d3fa4b6b129159f61f913eba97769943a2354e9b51572314a206f68a20def091a89aec12bc942d94b05369128d3a97 WHIRLPOOL 1fb293d49f63a75cb772c262d9a55a6cb00be0f154387bf4fb3e9be1602038bd70348fad5f1a2b714fa7b45cbcd36a4db2c6f1441f3a00aff7d51732b3629708
+AUX 2.3.6-musl-compat.patch 433 SHA256 5837eef6d66b56ce9c0cb5fe93dac1a27900c085ab8a2e295c5a7b8fcae52e60 SHA512 ef002c1bff131924d8ca1ee41f10c3f274788c85fa122d2b9839bb571579fa836f1bcf865bcb8b825db21681ea7dd9290d796f7005690a2070f32439da105e0f WHIRLPOOL 482e1717c27b89ebd3d2294eea16d588a892ef984e947c0a06eb9c4924247af4a81f4877d6cd89d65840ff28ac8badd4bf5d7ee7b44889b4b8e465d3be1ca8fa
+AUX 2.3.6-null-cipher.patch 1531 SHA256 a3f8ac3630c9887d18d21e0ac9781d615cf8dff277c070306b36c5d0faa8a1ac SHA512 0aa288af3c0b43977bf84b099ea28dbf7ab9a1096d76e8f706989570984c70a4c298430eac35b0c80eab8bc05e6072d965c20a9e3689e7448e759abb92c93fb2 WHIRLPOOL cbefb2a1b6d63373890a76d3a6153335f8d05b07e4546893e7a8871c653d39f06941615181308fbf41a07cf702b2a730dfacc6a01840efdbfbeaf301a58362bb
+AUX 65openvpn 45 SHA256 d5758e39fdc75dcbb5a788b1afa743c3c1f08c63c535aa32c300b965474d765c SHA512 713345092b60d1322d3fa96fd72d69ed82dbfee5031a675114bc60acfdacaf0811f6bf4530cf937ca5a86b3f2665b28951b9087ec91c2c0faf75bdaf1e25bdbb WHIRLPOOL 534e7dcf2ac953e9ec5de05810022471cb26a16806cd036f25d02550e20f8aaa91410bd005bc7a5e4a549d8a40d01ae317be1d1e1e25d91ed989bbbea7ede9d2
+AUX down.sh 943 SHA256 39debebcd8c899f20e6d355cbc8eaab46e28b83a9f6c33a94c065688a4f3d2c7 SHA512 5defd61edf11cc63f3f8f60bef7fa730c4bcdd2545d664bd94666dd3aea80bd9d190263d8835a555e4287a594f6fce0f52426aed49c60233ff637a2a6164a997 WHIRLPOOL c66fd1e016656fe83d7f55b77bf232058397f9cd3054abe13ec006c227afe6746ee4ada310ff43761ec95510f736b8e542f136711d648642eecafe055975c57e
+AUX openvpn-2.1.conf 892 SHA256 330149a83684ddabe413d134d4c8efad4c88b18c2ab67165014deff5f7fffad2 SHA512 982ade883afbe2e656a9cbbe36c31c0e8b4f7bbbe5b63df9f7b834f02a9153032fb7445c85d3e91f62c68a7ddd13c3afbf420fb71cdd13d9c4b69f867bdd9f37 WHIRLPOOL 6ef644826e1e9e2a100e0fa20b5c9190e92c9e08a366dee28dccf3f70fa0593f3c4d271e42db3920630f03704aa2aef8e84d9efbb2b4b6a0d08e74bb340fb0a5
+AUX openvpn-2.1.init 4186 SHA256 d1b1f8a00935d77521bceb62535350444df3470fa45f4d33c3934051a1bb595b SHA512 7ecd0b4dc7341ea0df598752bec8ae6011bea7973ed9dbf17a12c308aed46362e1507fcb3a3bb26049619747f2f819deec1a42c6dce2c13d2a769f1e37735a2f WHIRLPOOL 9d34c438b7d9e45678e2aa48ab42a68b9e2801423688c6280cbb4934a8ef04cbf8a7953a061659f57fb02adf535596ac9313268c29e2dc18cffbf7315681da82
+AUX openvpn.init 1486 SHA256 c4b9e0899fa5ee0b90c5100da7711dc7a6a5658f10042b0feda9e7efb90a11cf SHA512 450595b9ec82ded74c26ed9f73182122e05f53655262a342b195dcedfe63a06a5d9927a3bbe50d0d04f810cc786ac3eb78843877f426c893e165b967bc8ac012 WHIRLPOOL e549221283b4b92c9ada312a746c4ad4c645493c1c844ddaddefecee4c31e17bd4bd8555618408e065c83143e157aaf7e75b44f01abe43f507835df2aa1149d3
+AUX openvpn.service 335 SHA256 a63a6e1505f2b3e20f2c82588dd0c23da9d8c750e1f36fec2ba20a8b5b0c9de1 SHA512 fbd41b80253aaae6750301ac95d8b3bf09e3a70556cc0513792c8e06faa70a716233d134d4928295f381f0f235fcde0eeac9cfa074924b6666a4b46ff7cf91a9 WHIRLPOOL 16f44d10ab03110a21a69716fbac2e64e5376426edd26783d7946d928dd0cc106810126436488843da8e16277d3aa83d208fe50c4aebd9cff86526ce1762b215
+AUX openvpn.tmpfile 39 SHA256 ef3453056a26487d27908d5ced124285403d8e88deb843fccdba9f6724966826 SHA512 659713b35eee340f2b6578796f4335dda391aa635892e802e3f2531f31c9470460b4e4b3be45457f81f3b08b7d60ce15d16f8d70b968fbf24f846ef5f8611a58 WHIRLPOOL 19e4611ffda68a99851921ccaf3a99d04350cd3e0d8833136da151119c267edc383ff96162aa47a2f77171ae908ad011e4119a7a18961ed0bddcbf38d997b976
+AUX up.sh 2865 SHA256 d887ee065261affd849227fa27e092cf66549d824a698f302312d15f787dd840 SHA512 35201b0e60ad20358080007e595eb4f96d186ba8e88f0485c55d164c28e3d78a12f3e09347ba3d76abb9b8b03fb4a53664bd74ab484be1548090022b956925fd WHIRLPOOL 8d25a66d192a6710466d149aec7a1719dfe91558205e8ba7e25b93e58869c8fedc96ba4ce2aedb0595b7e0b63299e6e41be1ba82c6b93ae6bbbb26d409c9bf51
+DIST openvpn-2.3.6.tar.gz 1213272 SHA256 7baed2ff39c12e1a1a289ec0b46fcc49ff094ca58b8d8d5f29b36ac649ee5b26 SHA512 70e0045ea41f6588769ab8b98d8f550b69148adbf7fedcdc36900e25950df43379950492652e243ec6e7965bf9c7dcc86a56ba5dfdc44523aaa81cfc508b1c6e WHIRLPOOL 737f2d1d69ee1c7700d5cd5a4e7d5d1b2f55d8b2229f7c2565fcb8c731ebb719ec8d6bad3b76f763f36e5c70c6e40a666db3508f3024f8e4637c0659061dba48
+EBUILD openvpn-2.3.6-r99.ebuild 4426 SHA256 3f1264eced8d351e4e179b1d7b7522e8c1e3d440b3a608d914d8fe99d4f2ab79 SHA512 0fa7ea5f00d81d83a26b88ff4e7a8944357c85d1df023b76857b53a4b486b926c51efe73082ecc0b0c9d4dd17ae90ebbe02798493f494db95458bf1021b681df WHIRLPOOL 47500eb883a0e077f4a249570c4ebaab0fa033d9051f1e56a0c0d36e97023320ef77f889a9ce81e7a81ca06a4ca7aca826433394c04181f22b19944c532f27b2
+EBUILD openvpn-9999.ebuild 3941 SHA256 ef975ee9157e25b16aa4c59144b1fc0814c67def458a71e5166c70e7c41e5081 SHA512 7030ee666c7372b86a198f3780797a4253baed6e61e4bbb3f1bb166b95268b4ee00992c770c689ab6bb9326eb2d66a6c52cec65739e887ef39e6da1da6ce49b6 WHIRLPOOL 174bee3dc113263b7ebc24048613cc3039cd49f52cee4c9eff55d80d9436cead408d3c09cb6dad1318a4812fb00f7eb22b286f329499346240db2f38a066b2ff
+MISC metadata.xml 937 SHA256 3dfcc28012f2c92f044882c39d56b6ef82bb80749ce688b75d526cc6c8836dd3 SHA512 ad3f218ccc64249fda19d87fe79494280eb880841f2d1e69757e7093e62b446f273fecd074ccac02c28894924b02d6a9c9fbbc1bd12ab13493f7f77e50e5b1ce WHIRLPOOL 65bf683e35f44c306c9ed3297cd954eb490f658f97a2d03af2cba0484030b1eccdf401fdc867a5c35a602bd67bf7052d555c2a48b7bebb4469158e26a530a742
diff --git a/net-misc/openvpn/files/2.3.6-disable-compression.patch b/net-misc/openvpn/files/2.3.6-disable-compression.patch
new file mode 100644
index 00000000..d9d1c764
--- /dev/null
+++ b/net-misc/openvpn/files/2.3.6-disable-compression.patch
@@ -0,0 +1,18 @@
+https://community.openvpn.net/openvpn/changeset/5d5233778868ddd568140c394adfcfc8e3453245/
+
+--- openvpn-2.3.6/src/openvpn/ssl_openssl.c.orig 2014-11-29 23:00:35.000000000 +0800
++++ openvpn-2.3.6/src/openvpn/ssl_openssl.c 2015-01-12 21:14:30.186993686 +0800
+@@ -238,6 +238,13 @@
+ if (tls_ver_min > TLS_VER_1_2 || tls_ver_max < TLS_VER_1_2)
+ sslopt |= SSL_OP_NO_TLSv1_2;
+ #endif
++
++#ifdef SSL_OP_NO_COMPRESSION
++ msg (M_WARN, "[Workaround] disable SSL compression");
++ sslopt |= SSL_OP_NO_COMPRESSION;
++#endif
++
++
+ SSL_CTX_set_options (ctx->ctx, sslopt);
+ }
+
diff --git a/net-misc/openvpn/files/2.3.6-musl-compat.patch b/net-misc/openvpn/files/2.3.6-musl-compat.patch
new file mode 100644
index 00000000..9b1289b8
--- /dev/null
+++ b/net-misc/openvpn/files/2.3.6-musl-compat.patch
@@ -0,0 +1,14 @@
+diff -Naur openvpn-2.3.6.orig/src/openvpn/syshead.h openvpn-2.3.6/src/openvpn/syshead.h
+--- openvpn-2.3.6.orig/src/openvpn/syshead.h 2014-11-29 16:00:35.000000000 +0100
++++ openvpn-2.3.6/src/openvpn/syshead.h 2015-05-08 00:42:34.171634884 +0200
+@@ -214,10 +214,6 @@
+
+ #ifdef TARGET_LINUX
+
+-#if defined(HAVE_NETINET_IF_ETHER_H)
+-#include <netinet/if_ether.h>
+-#endif
+-
+ #ifdef HAVE_LINUX_IF_TUN_H
+ #include <linux/if_tun.h>
+ #endif
diff --git a/net-misc/openvpn/files/2.3.6-null-cipher.patch b/net-misc/openvpn/files/2.3.6-null-cipher.patch
new file mode 100644
index 00000000..1e831cfa
--- /dev/null
+++ b/net-misc/openvpn/files/2.3.6-null-cipher.patch
@@ -0,0 +1,46 @@
+The "really fix cipher none" patch has been merged to release/2.3 and master:
+
+commit 785838614afc20d362b64907b0212e9a779e2287 (release/2.3)
+commit 98156e90e1e83133a6a6a020db8e7333ada6156b (master)
+
+diff --git a/src/openvpn/crypto_backend.h b/src/openvpn/crypto_backend.h
+index 8749878..4e45df0 100644
+--- a/src/openvpn/crypto_backend.h
++++ b/src/openvpn/crypto_backend.h
+@@ -237,8 +237,7 @@ int cipher_kt_mode (const cipher_kt_t *cipher_kt);
+ *
+ * @return true iff the cipher is a CBC mode cipher.
+ */
+-bool cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+- __attribute__((nonnull));
++bool cipher_kt_mode_cbc(const cipher_kt_t *cipher);
+
+ /**
+ * Check if the supplied cipher is a supported OFB or CFB mode cipher.
+@@ -247,8 +246,7 @@ bool cipher_kt_mode_cbc(const cipher_kt_t *cipher)
+ *
+ * @return true iff the cipher is a OFB or CFB mode cipher.
+ */
+-bool cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher)
+- __attribute__((nonnull));
++bool cipher_kt_mode_ofb_cfb(const cipher_kt_t *cipher);
+
+
+ /**
+diff --git a/tests/t_lpback.sh b/tests/t_lpback.sh
+index 8f88ad9..d7792cd 100755
+--- a/tests/t_lpback.sh
++++ b/tests/t_lpback.sh
+@@ -35,6 +35,9 @@ CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \
+ # GD, 2014-07-06 do not test RC5-* either (fails on NetBSD w/o libcrypto_rc5)
+ CIPHERS=$(echo "$CIPHERS" | egrep -v '^(DES-EDE3-CFB1|DES-CFB1|RC5-)' )
+
++# Also test cipher 'none'
++CIPHERS=${CIPHERS}$(printf "\nnone")
++
+ "${top_builddir}/src/openvpn/openvpn" --genkey --secret key.$$
+ set +e
+
+--
+1.9.1
+
diff --git a/net-misc/openvpn/files/65openvpn b/net-misc/openvpn/files/65openvpn
new file mode 100644
index 00000000..4ddb0343
--- /dev/null
+++ b/net-misc/openvpn/files/65openvpn
@@ -0,0 +1 @@
+CONFIG_PROTECT="/usr/share/openvpn/easy-rsa"
diff --git a/net-misc/openvpn/files/down.sh b/net-misc/openvpn/files/down.sh
new file mode 100755
index 00000000..1c70db0e
--- /dev/null
+++ b/net-misc/openvpn/files/down.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Copyright (c) 2006-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Contributed by Roy Marples (uberlord@gentoo.org)
+
+# If we have a service specific script, run this now
+if [ -x /etc/openvpn/"${SVCNAME}"-down.sh ] ; then
+ /etc/openvpn/"${SVCNAME}"-down.sh "$@"
+fi
+
+# Restore resolv.conf to how it was
+if [ "${PEER_DNS}" != "no" ]; then
+ if [ -x /sbin/resolvconf ] ; then
+ /sbin/resolvconf -d "${dev}"
+ elif [ -e /etc/resolv.conf-"${dev}".sv ] ; then
+ # Important that we copy instead of move incase resolv.conf is
+ # a symlink and not an actual file
+ cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf
+ rm -f /etc/resolv.conf-"${dev}".sv
+ fi
+fi
+
+if [ -n "${SVCNAME}" ]; then
+ # Re-enter the init script to start any dependant services
+ if /etc/init.d/"${SVCNAME}" --quiet status ; then
+ export IN_BACKGROUND=true
+ /etc/init.d/"${SVCNAME}" --quiet stop
+ fi
+fi
+
+exit 0
+
+# vim: ts=4 :
diff --git a/net-misc/openvpn/files/openvpn-2.1.conf b/net-misc/openvpn/files/openvpn-2.1.conf
new file mode 100644
index 00000000..72510c34
--- /dev/null
+++ b/net-misc/openvpn/files/openvpn-2.1.conf
@@ -0,0 +1,18 @@
+# OpenVPN automatically creates an /etc/resolv.conf (or sends it to
+# resolvconf) if given DNS information by the OpenVPN server.
+# Set PEER_DNS="no" to stop this.
+PEER_DNS="yes"
+
+# OpenVPN can run in many modes. Most people will want the init script
+# to automatically detect the mode and try and apply a good default
+# configuration and setup scripts. However, there are cases where the
+# OpenVPN configuration looks like a client, but it's really a peer or
+# something else. DETECT_CLIENT controls this behaviour.
+DETECT_CLIENT="yes"
+
+# If DETECT_CLIENT is no and you have your own scripts to re-enter the openvpn
+# init script (ie, it first becomes "inactive" and the script then starts the
+# script again to make it "started") then you can state this below.
+# In other words, unless you understand service dependencies and are a
+# competent shell scripter, don't set this.
+RE_ENTER="no"
diff --git a/net-misc/openvpn/files/openvpn-2.1.init b/net-misc/openvpn/files/openvpn-2.1.init
new file mode 100755
index 00000000..d65e6f8b
--- /dev/null
+++ b/net-misc/openvpn/files/openvpn-2.1.init
@@ -0,0 +1,133 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+VPNDIR=${VPNDIR:-/etc/openvpn}
+VPN=${SVCNAME#*.}
+if [ -n "${VPN}" ] && [ ${SVCNAME} != "openvpn" ]; then
+ VPNPID="/var/run/openvpn.${VPN}.pid"
+else
+ VPNPID="/var/run/openvpn.pid"
+fi
+VPNCONF="${VPNDIR}/${VPN}.conf"
+
+depend() {
+ need localmount net
+ use dns
+ after bootmisc
+}
+
+checkconfig() {
+ # Linux has good dynamic tun/tap creation
+ if [ $(uname -s) = "Linux" ] ; then
+ if [ ! -e /dev/net/tun ]; then
+ if ! modprobe tun ; then
+ eerror "TUN/TAP support is not available" \
+ "in this kernel"
+ return 1
+ fi
+ fi
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
+ ebegin "Detected broken /dev/net/tun symlink, fixing..."
+ rm -f /dev/net/tun
+ ln -s /dev/misc/net/tun /dev/net/tun
+ eend $?
+ fi
+ return 0
+ fi
+
+ # Other OS's don't, so we rely on a pre-configured interface
+ # per vpn instance
+ local ifname=$(sed -n -e 's/[[:space:]]*dev[[:space:]][[:space:]]*\([^[:space:]]*\).*/\1/p' "${VPNCONF}")
+ if [ -z ${ifname} ] ; then
+ eerror "You need to specify the interface that this openvpn" \
+ "instance should use" \
+ "by using the dev option in ${VPNCONF}"
+ return 1
+ fi
+
+ if ! ifconfig "${ifname}" >/dev/null 2>/dev/null ; then
+ # Try and create it
+ echo > /dev/"${ifname}" >/dev/null
+ fi
+ if ! ifconfig "${ifname}" >/dev/null 2>/dev/null ; then
+ eerror "${VPNCONF} requires interface ${ifname}" \
+ "but that does not exist"
+ return 1
+ fi
+}
+
+start() {
+ # If we are re-called by the openvpn gentoo-up.sh script
+ # then we don't actually want to start openvpn
+ [ "${IN_BACKGROUND}" = "true" ] && return 0
+
+ ebegin "Starting ${SVCNAME}"
+
+ checkconfig || return 1
+
+ local args="" reenter=${RE_ENTER:-no}
+ # If the config file does not specify the cd option, we do
+ # But if we specify it, we override the config option which we do not want
+ if ! grep -q "^[ ]*cd[ ].*" "${VPNCONF}" ; then
+ args="${args} --cd ${VPNDIR}"
+ fi
+
+ # We mark the service as inactive and then start it.
+ # When we get an authenticated packet from the peer then we run our script
+ # which configures our DNS if any and marks us as up.
+ if [ "${DETECT_CLIENT:-yes}" = "yes" ] && \
+ grep -q "^[ ]*remote[ ].*" "${VPNCONF}" ; then
+ reenter="yes"
+ args="${args} --up-delay --up-restart"
+ args="${args} --script-security 2"
+ args="${args} --up /etc/openvpn/up.sh"
+ args="${args} --down-pre --down /etc/openvpn/down.sh"
+
+ # Warn about setting scripts as we override them
+ if grep -Eq "^[ ]*(up|down)[ ].*" "${VPNCONF}" ; then
+ ewarn "WARNING: You have defined your own up/down scripts"
+ ewarn "As you're running as a client, we now force Gentoo specific"
+ ewarn "scripts to be run for up and down events."
+ ewarn "These scripts will call /etc/openvpn/${SVCNAME}-{up,down}.sh"
+ ewarn "where you can put your own code."
+ fi
+
+ # Warn about the inability to change ip/route/dns information when
+ # dropping privs
+ if grep -q "^[ ]*user[ ].*" "${VPNCONF}" ; then
+ ewarn "WARNING: You are dropping root privileges!"
+ ewarn "As such openvpn may not be able to change ip, routing"
+ ewarn "or DNS configuration."
+ fi
+ else
+ # So we're a server. Run as openvpn unless otherwise specified
+ grep -q "^[ ]*user[ ].*" "${VPNCONF}" || args="${args} --user openvpn"
+ grep -q "^[ ]*group[ ].*" "${VPNCONF}" || args="${args} --group openvpn"
+ fi
+
+ # Ensure that our scripts get the PEER_DNS variable
+ [ -n "${PEER_DNS}" ] && args="${args} --setenv PEER_DNS ${PEER_DNS}"
+
+ [ "${reenter}" = "yes" ] && mark_service_inactive "${SVCNAME}"
+ start-stop-daemon --start --exec /usr/sbin/openvpn --pidfile "${VPNPID}" \
+ -- --config "${VPNCONF}" --writepid "${VPNPID}" --daemon \
+ --setenv SVCNAME "${SVCNAME}" ${args}
+ eend $? "Check your logs to see why startup failed"
+}
+
+stop() {
+ # If we are re-called by the openvpn gentoo-down.sh script
+ # then we don't actually want to stop openvpn
+ if [ "${IN_BACKGROUND}" = "true" ] ; then
+ mark_service_inactive "${SVCNAME}"
+ return 0
+ fi
+
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet \
+ --exec /usr/sbin/openvpn --pidfile "${VPNPID}"
+ eend $?
+}
+
+# vim: set ts=4 :
diff --git a/net-misc/openvpn/files/openvpn.init b/net-misc/openvpn/files/openvpn.init
new file mode 100644
index 00000000..489ab497
--- /dev/null
+++ b/net-misc/openvpn/files/openvpn.init
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+VPNDIR="/etc/openvpn"
+VPN="${SVCNAME#*.}"
+if [ -n "${VPN}" ] && [ "${SVCNAME}" != "openvpn" ]; then
+ VPNPID="/var/run/openvpn.${VPN}.pid"
+else
+ VPNPID="/var/run/openvpn.pid"
+fi
+VPNCONF="${VPNDIR}/${VPN}.conf"
+
+depend() {
+ need localmount net
+ before netmount
+ after bootmisc
+}
+
+checktundevice() {
+ if [ ! -e /dev/net/tun ]; then
+ if ! modprobe tun ; then
+ eerror "TUN/TAP support is not available in this kernel"
+ return 1
+ fi
+ fi
+ if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
+ ebegin "Detected broken /dev/net/tun symlink, fixing..."
+ rm -f /dev/net/tun
+ ln -s /dev/misc/net/tun /dev/net/tun
+ eend $?
+ fi
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ checktundevice || return 1
+
+ if [ ! -e "${VPNCONF}" ]; then
+ eend 1 "${VPNCONF} does not exist"
+ return 1
+ fi
+
+ local args=""
+ # If the config file does not specify the cd option, we do
+ # But if we specify it, we override the config option which we do not want
+ if ! grep -q "^[ ]*cd[ ].*" "${VPNCONF}" ; then
+ args="${args} --cd ${VPNDIR}"
+ fi
+
+ start-stop-daemon --start --exec /usr/sbin/openvpn --pidfile "${VPNPID}" \
+ -- --config "${VPNCONF}" --writepid "${VPNPID}" --daemon ${args}
+ eend $? "Check your logs to see why startup failed"
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --exec /usr/sbin/openvpn --pidfile "${VPNPID}"
+ eend $?
+}
+
+# vim: ts=4
diff --git a/net-misc/openvpn/files/openvpn.service b/net-misc/openvpn/files/openvpn.service
new file mode 100644
index 00000000..358dcb79
--- /dev/null
+++ b/net-misc/openvpn/files/openvpn.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenVPN Robust And Highly Flexible Tunneling Application On %I
+After=syslog.target network.target
+
+[Service]
+PrivateTmp=true
+Type=forking
+PIDFile=/var/run/openvpn/%i.pid
+ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/openvpn/files/openvpn.tmpfile b/net-misc/openvpn/files/openvpn.tmpfile
new file mode 100644
index 00000000..d5fca71a
--- /dev/null
+++ b/net-misc/openvpn/files/openvpn.tmpfile
@@ -0,0 +1 @@
+D /var/run/openvpn 0710 root openvpn -
diff --git a/net-misc/openvpn/files/up.sh b/net-misc/openvpn/files/up.sh
new file mode 100755
index 00000000..6ce82d61
--- /dev/null
+++ b/net-misc/openvpn/files/up.sh
@@ -0,0 +1,100 @@
+#!/bin/sh
+# Copyright (c) 2006-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Contributed by Roy Marples (uberlord@gentoo.org)
+
+# Setup our resolv.conf
+# Vitally important that we use the domain entry in resolv.conf so we
+# can setup the nameservers are for the domain ONLY in resolvconf if
+# we're using a decent dns cache/forwarder like dnsmasq and NOT nscd/libc.
+# nscd/libc users will get the VPN nameservers before their other ones
+# and will use the first one that responds - maybe the LAN ones?
+# non resolvconf users just the the VPN resolv.conf
+
+# FIXME:- if we have >1 domain, then we have to use search :/
+# We need to add a flag to resolvconf to say
+# "these nameservers should only be used for the listed search domains
+# if other global nameservers are present on other interfaces"
+# This however, will break compatibility with Debians resolvconf
+# A possible workaround would be to just list multiple domain lines
+# and try and let resolvconf handle it
+
+min_route() {
+ local n=1
+ local m
+ local r
+
+ eval m="\$route_metric_$n"
+ while [ -n "${m}" ]; do
+ if [ -z "$r" ] || [ "$r" -gt "$m" ]; then
+ r="$m"
+ fi
+ n="$(($n+1))"
+ eval m="\$route_metric_$n"
+ done
+
+ echo "$r"
+}
+
+if [ "${PEER_DNS}" != "no" ]; then
+ NS=
+ DOMAIN=
+ SEARCH=
+ i=1
+ while true ; do
+ eval opt=\$foreign_option_${i}
+ [ -z "${opt}" ] && break
+ if [ "${opt}" != "${opt#dhcp-option DOMAIN *}" ] ; then
+ if [ -z "${DOMAIN}" ] ; then
+ DOMAIN="${opt#dhcp-option DOMAIN *}"
+ else
+ SEARCH="${SEARCH}${SEARCH:+ }${opt#dhcp-option DOMAIN *}"
+ fi
+ elif [ "${opt}" != "${opt#dhcp-option DNS *}" ] ; then
+ NS="${NS}nameserver ${opt#dhcp-option DNS *}\n"
+ fi
+ i=$((${i} + 1))
+ done
+
+ if [ -n "${NS}" ] ; then
+ DNS="# Generated by openvpn for interface ${dev}\n"
+ if [ -n "${SEARCH}" ] ; then
+ DNS="${DNS}search ${DOMAIN} ${SEARCH}\n"
+ elif [ -n "${DOMAIN}" ]; then
+ DNS="${DNS}domain ${DOMAIN}\n"
+ fi
+ DNS="${DNS}${NS}"
+ if [ -x /sbin/resolvconf ] ; then
+ metric="$(min_route)"
+ printf "${DNS}" | /sbin/resolvconf -a "${dev}" ${metric:+-m ${metric}}
+ else
+ # Preserve the existing resolv.conf
+ if [ -e /etc/resolv.conf ] ; then
+ cp /etc/resolv.conf /etc/resolv.conf-"${dev}".sv
+ fi
+ printf "${DNS}" > /etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+ fi
+ fi
+fi
+
+# Below section is Gentoo specific
+# Quick summary - our init scripts are re-entrant and set the SVCNAME env var
+# as we could have >1 openvpn service
+
+if [ -n "${SVCNAME}" ]; then
+ # If we have a service specific script, run this now
+ if [ -x /etc/openvpn/"${SVCNAME}"-up.sh ] ; then
+ /etc/openvpn/"${SVCNAME}"-up.sh "$@"
+ fi
+
+ # Re-enter the init script to start any dependant services
+ if ! /etc/init.d/"${SVCNAME}" --quiet status ; then
+ export IN_BACKGROUND=true
+ /etc/init.d/${SVCNAME} --quiet start
+ fi
+fi
+
+exit 0
+
+# vim: ts=4 :
diff --git a/net-misc/openvpn/metadata.xml b/net-misc/openvpn/metadata.xml
new file mode 100644
index 00000000..ef30850f
--- /dev/null
+++ b/net-misc/openvpn/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>djc@gentoo.org</email>
+ <name>Dirkjan Ochtman</name>
+ </maintainer>
+ <longdescription>OpenVPN is an easy-to-use, robust and highly
+configurable VPN daemon which can be used to securely link two or more
+networks using an encrypted tunnel.</longdescription>
+ <use>
+ <flag name="down-root">Enable the down-root plugin</flag>
+ <flag name="iproute2">Enabled iproute2 support instead of net-tools</flag>
+ <flag name="passwordsave">Enables openvpn to save passwords</flag>
+ <flag name="polarssl">Use PolarSSL instead of OpenSSL</flag>
+ <flag name="pkcs11">Enable PKCS#11 smartcard support</flag>
+ <flag name="plugins">Enable the OpenVPN plugin system</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:openvpn:openvpn</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/openvpn/openvpn-2.3.6-r99.ebuild b/net-misc/openvpn/openvpn-2.3.6-r99.ebuild
new file mode 100644
index 00000000..ebb4c70a
--- /dev/null
+++ b/net-misc/openvpn/openvpn-2.3.6-r99.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/openvpn-2.3.6-r2.ebuild,v 1.1 2015/02/17 18:46:07 djc Exp $
+
+EAPI=4
+
+inherit multilib autotools flag-o-matic user systemd
+
+DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes"
+SRC_URI="http://swupdate.openvpn.net/community/releases/${P}.tar.gz"
+HOMEPAGE="http://openvpn.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="examples down-root iproute2 pam passwordsave pkcs11 +plugins +polarssl selinux +ssl systemd +lzo static userland_BSD"
+
+REQUIRED_USE="static? ( !plugins !pkcs11 )
+ polarssl? ( ssl )
+ pkcs11? ( ssl )
+ !plugins? ( !pam !down-root )"
+
+DEPEND="
+ kernel_linux? (
+ iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools )
+ )
+ pam? ( virtual/pam )
+ ssl? (
+ !polarssl? ( >=dev-libs/openssl-0.9.7 ) polarssl? ( >=net-libs/polarssl-1.2.10 )
+ )
+ lzo? ( >=dev-libs/lzo-1.07 )
+ pkcs11? ( >=dev-libs/pkcs11-helper-1.11 )"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-openvpn )
+"
+
+src_prepare() {
+ # Set correct pass to systemd-ask-password binary
+ sed -i "s:\(/bin/systemd-ask-password\):/usr\1:" ./src/openvpn/console.c || die
+ epatch "${FILESDIR}/2.3.6-null-cipher.patch" || die
+ epatch "${FILESDIR}/2.3.6-disable-compression.patch" || die
+ epatch "${FILESDIR}/2.3.6-musl-compat.patch" || die
+ eautoreconf
+}
+
+src_configure() {
+ use static && LDFLAGS="${LDFLAGS} -Xcompiler -static"
+ local myconf
+ echo "DROPPY"
+ use polarssl && echo "FLOZZY"
+ use polarssl && myconf="--with-crypto-library=polarssl"
+ econf \
+ ${myconf} \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --with-plugindir="${ROOT}/usr/$(get_libdir)/$PN" \
+ $(use_enable passwordsave password-save) \
+ $(use_enable ssl) \
+ $(use_enable ssl crypto) \
+ $(use_enable lzo) \
+ $(use_enable pkcs11) \
+ $(use_enable plugins) \
+ $(use_enable iproute2) \
+ $(use_enable pam plugin-auth-pam) \
+ $(use_enable down-root plugin-down-root) \
+ $(use_enable systemd)
+}
+
+src_install() {
+ default
+ find "${ED}/usr" -name '*.la' -delete
+ # install documentation
+ dodoc AUTHORS ChangeLog PORTS README README.IPv6
+
+ # Install some helper scripts
+ keepdir /etc/openvpn
+ exeinto /etc/openvpn
+ doexe "${FILESDIR}/up.sh"
+ doexe "${FILESDIR}/down.sh"
+
+ # Install the init script and config file
+ newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
+ newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
+
+ # install examples, controlled by the respective useflag
+ if use examples ; then
+ # dodoc does not supportly support directory traversal, #15193
+ insinto /usr/share/doc/${PF}/examples
+ doins -r sample contrib
+ fi
+
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfile ${PN}.conf
+ systemd_newunit "${FILESDIR}"/${PN}.service 'openvpn@.service'
+}
+
+pkg_postinst() {
+ # Add openvpn user so openvpn servers can drop privs
+ # Clients should run as root so they can change ip addresses,
+ # dns information and other such things.
+ enewgroup openvpn
+ enewuser openvpn "" "" "" openvpn
+
+ if [ path_exists -o "${ROOT}/etc/openvpn/*/local.conf" ] ; then
+ ewarn "WARNING: The openvpn init script has changed"
+ ewarn ""
+ fi
+
+ elog "The openvpn init script expects to find the configuration file"
+ elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
+ elog ""
+ elog "To create more VPNs, simply create a new .conf file for it and"
+ elog "then create a symlink to the openvpn init script from a link called"
+ elog "openvpn.newconfname - like so"
+ elog " cd /etc/openvpn"
+ elog " ${EDITOR##*/} foo.conf"
+ elog " cd /etc/init.d"
+ elog " ln -s openvpn openvpn.foo"
+ elog ""
+ elog "You can then treat openvpn.foo as any other service, so you can"
+ elog "stop one vpn and start another if you need to."
+
+ if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
+ ewarn ""
+ ewarn "WARNING: If you use the remote keyword then you are deemed to be"
+ ewarn "a client by our init script and as such we force up,down scripts."
+ ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
+ ewarn "can move your scripts to."
+ fi
+
+ if use plugins ; then
+ einfo ""
+ einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
+ fi
+
+ einfo ""
+ einfo "OpenVPN 2.3.x no longer includes the easy-rsa suite of utilities."
+ einfo "They can now be emerged via app-crypt/easy-rsa."
+}
diff --git a/net-misc/openvpn/openvpn-9999.ebuild b/net-misc/openvpn/openvpn-9999.ebuild
new file mode 100644
index 00000000..408b3956
--- /dev/null
+++ b/net-misc/openvpn/openvpn-9999.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/openvpn-9999.ebuild,v 1.8 2014/11/02 09:13:00 swift Exp $
+
+EAPI=4
+
+inherit multilib autotools flag-o-matic user git-2
+
+DESCRIPTION="Robust and highly flexible tunneling application compatible with many OSes"
+EGIT_REPO_URI="https://github.com/OpenVPN/${PN}.git"
+HOMEPAGE="http://openvpn.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="examples down-root iproute2 pam passwordsave pkcs11 +plugins polarssl selinux +ssl +lzo static userland_BSD"
+
+REQUIRED_USE="static? ( !plugins !pkcs11 )
+ polarssl? ( ssl )
+ !plugins? ( !pam !down-root )"
+
+DEPEND="
+ kernel_linux? (
+ iproute2? ( sys-apps/iproute2[-minimal] ) !iproute2? ( sys-apps/net-tools )
+ )
+ pam? ( virtual/pam )
+ ssl? (
+ !polarssl? ( >=dev-libs/openssl-0.9.7 ) polarssl? ( >=net-libs/polarssl-1.1.0 )
+ )
+ lzo? ( >=dev-libs/lzo-1.07 )
+ pkcs11? ( >=dev-libs/pkcs11-helper-1.05 )"
+RDEPEND="${DEPEND}
+ selinux? ( sec-policy/selinux-openvpn )
+"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ use static && LDFLAGS="${LDFLAGS} -Xcompiler -static"
+ local myconf
+ use polarssl && myconf="--with-crypto-library=polarssl"
+ econf \
+ ${myconf} \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --with-plugindir="${ROOT}/usr/$(get_libdir)/$PN" \
+ $(use_enable passwordsave password-save) \
+ $(use_enable ssl) \
+ $(use_enable ssl crypto) \
+ $(use_enable lzo) \
+ $(use_enable pkcs11) \
+ $(use_enable plugins) \
+ $(use_enable iproute2) \
+ $(use_enable pam plugin-auth-pam) \
+ $(use_enable down-root plugin-down-root)
+}
+
+src_install() {
+ default
+ find "${ED}/usr" -name '*.la' -delete
+ # install documentation
+ dodoc AUTHORS ChangeLog PORTS README README.IPv6
+
+ # Install some helper scripts
+ keepdir /etc/openvpn
+ exeinto /etc/openvpn
+ doexe "${FILESDIR}/up.sh"
+ doexe "${FILESDIR}/down.sh"
+
+ # Install the init script and config file
+ newinitd "${FILESDIR}/${PN}-2.1.init" openvpn
+ newconfd "${FILESDIR}/${PN}-2.1.conf" openvpn
+
+ # install examples, controlled by the respective useflag
+ if use examples ; then
+ # dodoc does not supportly support directory traversal, #15193
+ insinto /usr/share/doc/${PF}/examples
+ doins -r sample contrib
+ fi
+}
+
+pkg_postinst() {
+ # Add openvpn user so openvpn servers can drop privs
+ # Clients should run as root so they can change ip addresses,
+ # dns information and other such things.
+ enewgroup openvpn
+ enewuser openvpn "" "" "" openvpn
+
+ if [ path_exists -o "${ROOT}/etc/openvpn/*/local.conf" ] ; then
+ ewarn "WARNING: The openvpn init script has changed"
+ ewarn ""
+ fi
+
+ elog "The openvpn init script expects to find the configuration file"
+ elog "openvpn.conf in /etc/openvpn along with any extra files it may need."
+ elog ""
+ elog "To create more VPNs, simply create a new .conf file for it and"
+ elog "then create a symlink to the openvpn init script from a link called"
+ elog "openvpn.newconfname - like so"
+ elog " cd /etc/openvpn"
+ elog " ${EDITOR##*/} foo.conf"
+ elog " cd /etc/init.d"
+ elog " ln -s openvpn openvpn.foo"
+ elog ""
+ elog "You can then treat openvpn.foo as any other service, so you can"
+ elog "stop one vpn and start another if you need to."
+
+ if grep -Eq "^[ \t]*(up|down)[ \t].*" "${ROOT}/etc/openvpn"/*.conf 2>/dev/null ; then
+ ewarn ""
+ ewarn "WARNING: If you use the remote keyword then you are deemed to be"
+ ewarn "a client by our init script and as such we force up,down scripts."
+ ewarn "These scripts call /etc/openvpn/\$SVCNAME-{up,down}.sh where you"
+ ewarn "can move your scripts to."
+ fi
+
+ if use plugins ; then
+ einfo ""
+ einfo "plugins have been installed into /usr/$(get_libdir)/${PN}"
+ fi
+
+ ewarn ""
+ ewarn "You are using a live ebuild building from the sources of openvpn"
+ ewarn "repository from http://openvpn.git.sourceforge.net. For reporting"
+ ewarn "bugs please contact: openvpn-devel@lists.sourceforge.net."
+}
diff --git a/net-misc/radvd/Manifest b/net-misc/radvd/Manifest
new file mode 100644
index 00000000..a0ba39bc
--- /dev/null
+++ b/net-misc/radvd/Manifest
@@ -0,0 +1,10 @@
+AUX radvd-1.9.1.init 1660 SHA256 7043465373b0f80d7b7705079797bacfcb6778ed9da0a854ff6ff8d87e070712 SHA512 098795ce220895e049ec77652c3e93994196a4451560572d91d0cc5ae19cb95cf34a5d7a53fa1edf46f85bb35436a1399061244e47a590706feb439b649c8444 WHIRLPOOL bd8d2cabbbd288ea5f7cfec0ca4c4b200008c2e0de1206f9bd8f80ce5d03928363c112efd67c7d7ea9fd3fc4a535ca84052c10011b75aa53349d9f8b46345c9d
+AUX radvd-2.10-musl-libc-fix.patch 2282 SHA256 8b6b9b40ffb5bf62a222447b79d34dc5bbdf5a685a927ed07b7b75c56c93eec7 SHA512 aa33c08cccf6d59fca13feddd984d6c5c03d2fa9ab596efaa16ad10c1f231454f3eb6a1150ad2d695f8f739bb884b32b27052cbf34bcaa4baee8de9e07e33f88 WHIRLPOOL bde401e4aebc13df63e2b54547dec4a8613979e9e5252ba18ba47b50cb477c9084d7d642c63c9f3aa650e16b0e10c10866fd52bd674b5f3fa246894a84106963
+AUX radvd.conf 445 SHA256 a9c704a481fc7c24d4ed3e21aa6bf8979fca6e81b93d86a86b40e4433d03809c SHA512 386a6cdee43a0aa157760a590b9daa52e06e2c344a8d191a188c6174281734df95b82121e92d3c01e6c0fe76658dbdf6467dee2b30e2e010fc57dc8e0666b2cc WHIRLPOOL 406aed79b6611cef5ae8eff40d474a02539064205f28ef4d3b13b6d7ea5699eaf9fa7d8d373a95d7198f8ad3fd48f15159f93da199266b1913ff789a0f497f21
+AUX radvd.service 371 SHA256 bf32735579f54745e544ccdaccf1dd620c65042bf25ffc37581f3fd0a5a908ad SHA512 36050f79759e8d5a97d4954fbcf455be31ffc7adba1a3b587c1c1e5902c495cfff22f6573b4da7d56476d4b7194e1c5802e7df6f2d7911fc832a3214402f58fd WHIRLPOOL 001bbdda3b7a2b226bd4be7d00ae305ff09b146aa797db50d54f0099a41403dffea17a2799058d10d76e6707bfe052bd0aaf8b215b329cf606c7687eca622d6e
+AUX radvd.tmpfilesd 30 SHA256 da69653b29db8af0f757d9f968882db566c4284a4cc9d7d29516d4c82dd463bb SHA512 d126bc90083e0f8aefda8cbd3cd01ecc9beb0eb05713c2d9fb5315bc10337d927b3c9e52c390e35799d1421078b365793772a712c33028be35280cd083cf65c3 WHIRLPOOL 1a9b3438b9f80503ab2c26fff46aa95aa1b86c181ebda643c133ffb31ae9e81c77f75f263e45b8e226d0fab556be90cbcbf8e774ccd154f2ad34cd888f3928b6
+DIST radvd-2.10.tar.gz 202426 SHA256 b41867c5b0375f786bebbd3fc88776d41927aa392eeba954e4b88f8ec7e8f13e SHA512 cfc34ad414bd07e22519982f8c3fa75cb27eab54131d0af09d6dd5fbb69da3de26fda776593e1a4e2735b63fc7cc2224663665854895d8be459f43ba4012fa26 WHIRLPOOL 5689d137313e75e30f370637bc92f4e242f2a4e2675b0ee34f1824a66e7efcf4ad683e121375623b62f015dd59a664511f2dbcff229c70a9d55c083dc7fef98f
+DIST radvd-2.11.tar.gz 202596 SHA256 80ad60b15689e9591a5af393a57a1d93304deeff2e46482f0fd98046c00622f8 SHA512 35fc641b81cc76de677c8e55a61c8b28d9167d8f40a3fa7adf2a254293ca2d7856ca2c8f6d3bdba391bf873345d3019c0f572ee166eaba011ae874b176c85d4b WHIRLPOOL 058ecf265881963e44267945349e56f1b5bb402b8e4605bd852a8e3ced00419e0028eee70028819433bbc7d596f938d94fef1145ea615c66a975feb9fe4aa56c
+EBUILD radvd-2.10-r99.ebuild 1831 SHA256 c08efad503659d5fb7964b87562b284e0078fcf35619a723eee135670ad0319c SHA512 e45ec08becc0fbb9277b45c7c2931a59e2aefe9a2e33e89e43b7afbc897821fca89172933ea9174769ef02a059e7d557522938b878fb40850e073e7d28612af8 WHIRLPOOL f1622894599c9cdb7cfe8344e19f6bdfec92c1cfa93c88629c448c4a729d0f0b9e89548999066545e9091161607b23c45877801a3f92faba03916dbab033794d
+EBUILD radvd-2.11-r99.ebuild 1877 SHA256 c3d3b0c4b28b348f2b21f979e58aa938765691f8c0d584f0d8e2a60ce2513ac5 SHA512 8daf3862fae9b6ed26cbecdade688851ca3a741a85ffe1743f4df913dcbbc9e70796cecf64dd174ff39543dfa669d299b184ada0498949937e5fe14d28daac20 WHIRLPOOL a351cdfaf234fb894769d5044395c251d421386257178e2ae426f0e2ad757bc0d18c3c4ff80ae2af0a4a329c01b9eacd307aa86fedae18d721abc2e709b7a2b0
+MISC metadata.xml 330 SHA256 40f8466e0dfb2770a66eddc657185e34a39dc389419a758b183a1d229a47e0bd SHA512 e8bdd24745abdcf8129f8fae83b8397bc762ae1cc1010b271a7f5647eed8ccf65a15f7b761d32fb250676a3e081dbe3395fc82934276b73c5595b35ff2e8da80 WHIRLPOOL 2ec6a85e151014a9156007b3e9fc9d3b43aa43dcbd59aeec6de21c94df4e2a4e1b65fc828905c57a62b06ace6aaf1b3cd23e314426d4a0a719b1f61bfccd5ea9
diff --git a/net-misc/radvd/files/radvd-1.9.1.init b/net-misc/radvd/files/radvd-1.9.1.init
new file mode 100644
index 00000000..c44d8616
--- /dev/null
+++ b/net-misc/radvd/files/radvd-1.9.1.init
@@ -0,0 +1,71 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd-1.9.1.init,v 1.2 2014/02/18 03:33:37 prometheanfire Exp $
+
+CONFIGFILE=/etc/radvd.conf
+PIDFILE=/var/run/radvd/radvd.pid
+SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f "${CONFIGFILE}" ]; then
+ eerror "Configuration file ${CONFIGFILE} not found"
+ return 1
+ fi
+
+ if ! /usr/sbin/radvd -c -C "${CONFIGFILE}" ; then
+ eerror "Configuration file ${CONFIGFILE} failed test"
+ return 1
+ fi
+
+ checkpath -d -o radvd:radvd ${PIDFILE%/*}
+}
+
+start() {
+ if [ "${FORWARD}" != "no" ]; then
+ ebegin "Enabling IPv6 forwarding"
+ sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
+ eend $?
+ fi
+
+ checkconfig || return 1
+
+ ebegin "Starting IPv6 Router Advertisement Daemon"
+ start-stop-daemon --start --exec /usr/sbin/radvd \
+ --pidfile "${PIDFILE}" \
+ -- -C "${CONFIGFILE}" -p "${PIDFILE}" -u radvd ${OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping IPv6 Router Advertisement Daemon"
+ start-stop-daemon --stop --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+
+ if [ "${FORWARD}" != "no" ]; then
+ ebegin "Disabling IPv6 forwarding"
+ sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null
+ eend $?
+ fi
+}
+
+reload() {
+ if [ "${FORWARD}" != "no" ]; then
+ ebegin "Enabling IPv6 forwarding"
+ sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
+ eend $?
+ fi
+
+ checkconfig || return 1
+
+ ebegin "Reloading IPv6 Router Advertisement Daemon"
+ start-stop-daemon --signal HUP \
+ --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/net-misc/radvd/files/radvd-2.10-musl-libc-fix.patch b/net-misc/radvd/files/radvd-2.10-musl-libc-fix.patch
new file mode 100644
index 00000000..c44f2843
--- /dev/null
+++ b/net-misc/radvd/files/radvd-2.10-musl-libc-fix.patch
@@ -0,0 +1,87 @@
+From 1d8973e13d89802eee0b648451e2b97ac65cf9e0 Mon Sep 17 00:00:00 2001
+From: Reuben Hawkins <reubenhwk@gmail.com>
+Date: Sat, 16 May 2015 09:27:38 -0700
+Subject: [PATCH] device-linux.c: IEEE 802.15.4 musl libc fix
+
+The ARPHRD_IEEE802154 macro's definition and name have been recently
+moved around from kernel header to glibc headers. Include linux/if_arp.h
+if available and then use either ARPHRD_IEEE802154_MONITOR or ARPHRD_IEEE802154_PHY,
+whichever comes first.
+---
+ configure.ac | 1 +
+ device-linux.c | 8 ++++++++
+ includes.h | 6 ++++++
+ 3 files changed, 15 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 0c1efd6..4bd4c9d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -156,6 +156,7 @@ AC_HEADER_STDC
+ AC_CHECK_HEADERS( \
+ getopt.h \
+ ifaddrs.h \
++ linux/if_arp.h \
+ machine/limits.h \
+ machine/param.h \
+ net/if_arp.h \
+diff --git a/device-linux.c b/device-linux.c
+index fa7d978..de83f2e 100644
+--- a/device-linux.c
++++ b/device-linux.c
+@@ -79,10 +79,12 @@ int update_device_info(int sock, struct Interface *iface)
+ iface->sllao.if_maxmtu = -1;
+ break;
+ #endif /* ARPHDR_ARCNET */
++#ifdef ARPHRD_IEEE802154
+ case ARPHRD_IEEE802154:
+ iface->sllao.if_hwaddr_len = 64;
+ iface->sllao.if_prefix_len = 64;
+ break;
++#endif
+ default:
+ iface->sllao.if_hwaddr_len = -1;
+ iface->sllao.if_prefix_len = -1;
+@@ -371,9 +373,15 @@ static char const *hwstr(unsigned short sa_family)
+ case ARPHRD_IEEE802154:
+ rc = "ARPHRD_IEEE802154";
+ break;
++#if ARPHRD_IEEE802154_MONITOR
++ case ARPHRD_IEEE802154_MONITOR:
++ rc = "ARPHRD_IEEE802154_MONITOR";
++ break;
++#elif ARPHRD_IEEE802154_PHY
+ case ARPHRD_IEEE802154_PHY:
+ rc = "ARPHRD_IEEE802154_PHY";
+ break;
++#endif
+ case ARPHRD_VOID:
+ rc = "ARPHRD_VOID";
+ break;
+diff --git a/includes.h b/includes.h
+index 39a36d2..d2449c4 100644
+--- a/includes.h
++++ b/includes.h
+@@ -81,9 +81,11 @@
+ #ifdef HAVE_NET_IF_DL_H
+ #include <net/if_dl.h>
+ #endif
++
+ #ifdef HAVE_NET_IF_TYPES_H
+ #include <net/if_types.h>
+ #endif
++
+ #if defined(HAVE_NET_IF_ARP_H) && !defined(ARPHRD_ETHER)
+ #include <net/if_arp.h>
+ #endif /* defined(HAVE_NET_IF_ARP_H) && !defined(ARPHRD_ETHER) */
+@@ -100,3 +102,7 @@
+ #include <ifaddrs.h>
+ #endif
+
++#ifdef HAVE_LINUX_IF_ARP_H
++#include <linux/if_arp.h>
++#endif
++
+--
+2.3.6
+
diff --git a/net-misc/radvd/files/radvd.conf b/net-misc/radvd/files/radvd.conf
new file mode 100644
index 00000000..e025c686
--- /dev/null
+++ b/net-misc/radvd/files/radvd.conf
@@ -0,0 +1,11 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd.conf,v 1.1 2006/07/19 13:02:36 uberlord Exp $
+
+# Extra options to pass to radvd
+OPTIONS=""
+
+# Set this to "no" to tell the init script NOT to set up IPv6 forwarding
+# using /proc/sys/net/ipv6/conf/all/forwarding
+# Only change this if you know what you're doing!
+FORWARD="yes"
diff --git a/net-misc/radvd/files/radvd.service b/net-misc/radvd/files/radvd.service
new file mode 100644
index 00000000..d9095f62
--- /dev/null
+++ b/net-misc/radvd/files/radvd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Router advertisement daemon for IPv6
+Documentation=man:radvd(8)
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/radvd --username radvd --logmethod stderr --debug 0
+ExecReload=/usr/sbin/radvd --configtest ; \
+ /bin/kill -HUP $MAINPID
+CPUSchedulingPolicy=idle
+PIDFile=/run/radvd/radvd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/radvd/files/radvd.tmpfilesd b/net-misc/radvd/files/radvd.tmpfilesd
new file mode 100644
index 00000000..26f203d1
--- /dev/null
+++ b/net-misc/radvd/files/radvd.tmpfilesd
@@ -0,0 +1 @@
+d /run/radvd 0755 radvd radvd
diff --git a/net-misc/radvd/metadata.xml b/net-misc/radvd/metadata.xml
new file mode 100644
index 00000000..74f40b3d
--- /dev/null
+++ b/net-misc/radvd/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>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+ <maintainer>
+ <email>prometheanfire@gentoo.org</email>
+ <name>Matthew Thode</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/net-misc/radvd/radvd-2.10-r99.ebuild b/net-misc/radvd/radvd-2.10-r99.ebuild
new file mode 100644
index 00000000..fa4e771b
--- /dev/null
+++ b/net-misc/radvd/radvd-2.10-r99.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/radvd-2.10.ebuild,v 1.5 2015/05/21 13:29:04 ago Exp $
+
+EAPI=4
+
+inherit systemd user eutils readme.gentoo
+
+DESCRIPTION="Linux IPv6 Router Advertisement Daemon"
+HOMEPAGE="http://v6web.litech.org/radvd/"
+SRC_URI="http://v6web.litech.org/radvd/dist/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~arm hppa ppc ~sparc x86 ~x86-fbsd"
+IUSE="kernel_FreeBSD selinux"
+
+CDEPEND="dev-libs/libdaemon"
+DEPEND="${CDEPEND}
+ dev-libs/check
+ sys-devel/bison
+ sys-devel/flex
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-radvd )
+"
+DOCS=( CHANGES README TODO radvd.conf.example )
+
+pkg_setup() {
+ enewgroup radvd
+ enewuser radvd -1 -1 /dev/null radvd
+
+ # force ownership of radvd user and group (bug #19647)
+ [[ -d ${ROOT}/var/run/radvd ]] && chown radvd:radvd "${ROOT}"/var/run/radvd
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.10-musl-libc-fix.patch
+}
+
+src_configure() {
+ econf --with-pidfile=/var/run/radvd/radvd.pid \
+ --disable-silent-rules
+}
+
+src_install() {
+ default
+
+ dohtml INTRO.html
+
+ newinitd "${FILESDIR}"/${PN}-1.9.1.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}.conf
+
+ if use kernel_FreeBSD ; then
+ sed -i -e \
+ 's/^SYSCTL_FORWARD=.*$/SYSCTL_FORWARD=net.inet6.ip6.forwarding/g' \
+ "${D}"/etc/init.d/${PN} || die
+ fi
+
+ readme.gentoo_create_doc
+}
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="Please create a configuratoion ${ROOT}etc/radvd.conf.
+See ${ROOT}usr/share/doc/${PF} for an example.
+
+grsecurity users should allow a specific group to read /proc
+and add the radvd user to that group, otherwise radvd may
+segfault on startup."
diff --git a/net-misc/radvd/radvd-2.11-r99.ebuild b/net-misc/radvd/radvd-2.11-r99.ebuild
new file mode 100644
index 00000000..b66e624d
--- /dev/null
+++ b/net-misc/radvd/radvd-2.11-r99.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/radvd-2.11.ebuild,v 1.1 2015/04/24 01:35:16 xmw Exp $
+
+EAPI=4
+
+inherit systemd user eutils readme.gentoo
+
+DESCRIPTION="Linux IPv6 Router Advertisement Daemon"
+HOMEPAGE="http://v6web.litech.org/radvd/"
+SRC_URI="http://v6web.litech.org/radvd/dist/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86 ~x86-fbsd"
+IUSE="kernel_FreeBSD selinux test"
+
+CDEPEND="dev-libs/libdaemon"
+DEPEND="${CDEPEND}
+ sys-devel/bison
+ sys-devel/flex
+ virtual/pkgconfig
+ test? ( dev-libs/check )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-radvd )
+"
+DOCS=( CHANGES README TODO radvd.conf.example )
+
+pkg_setup() {
+ enewgroup radvd
+ enewuser radvd -1 -1 /dev/null radvd
+
+ # force ownership of radvd user and group (bug #19647)
+ [[ -d ${ROOT}/var/run/radvd ]] && chown radvd:radvd "${ROOT}"/var/run/radvd
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.10-musl-libc-fix.patch
+}
+
+src_configure() {
+ econf --with-pidfile=/var/run/radvd/radvd.pid \
+ --disable-silent-rules \
+ $(use_with test check)
+}
+
+src_install() {
+ default
+
+ dohtml INTRO.html
+
+ newinitd "${FILESDIR}"/${PN}-1.9.1.init ${PN}
+ newconfd "${FILESDIR}"/${PN}.conf ${PN}
+
+ systemd_dounit "${FILESDIR}"/${PN}.service
+ systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}.conf
+
+ if use kernel_FreeBSD ; then
+ sed -i -e \
+ 's/^SYSCTL_FORWARD=.*$/SYSCTL_FORWARD=net.inet6.ip6.forwarding/g' \
+ "${D}"/etc/init.d/${PN} || die
+ fi
+
+ readme.gentoo_create_doc
+}
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="Please create a configuratoion ${ROOT}etc/radvd.conf.
+See ${ROOT}usr/share/doc/${PF} for an example.
+
+grsecurity users should allow a specific group to read /proc
+and add the radvd user to that group, otherwise radvd may
+segfault on startup."
diff --git a/net-news/newsbeuter/Manifest b/net-news/newsbeuter/Manifest
new file mode 100644
index 00000000..2a494a93
--- /dev/null
+++ b/net-news/newsbeuter/Manifest
@@ -0,0 +1,4 @@
+AUX newsbeuter-2.8-musl.patch 1774 SHA256 01bc5b5d231181215eb051db9d9717e05f94578db70b9889606a8d2d027664ba SHA512 479b243faf6b39b3473ce16e0ade892e7055613387bcecef8e3bc900733a270cd2c4a6e3493e1244047079cadabc0a9eb20b2e97d4eecfbf964adf56f0db94eb WHIRLPOOL 73950da6b97f6d5617dd57d52bf27569b3be8c9f473e40360e648ded4a160cc887bfce11e98587784f7722d07a57c4dd66a82f8d17baa3353446199663a7b0a5
+DIST newsbeuter-2.8.tar.gz 431299 SHA256 c872a068ec7792680b11126230dff240dee72acdab8f153016ba5ef83c8a7804 SHA512 b87c8118c4b450fe774dda73f83f485fada48e7dc308cd4c61e650b6e04a52b62eee075426d02aa5521edefced0ec09b599a51086ddee40408e063e94c6b259a WHIRLPOOL ad278481e885845f09f766aadfdb52b75c970f28f0c1b24ec27508efd4647768de91509a0ed3d57c4b009817ead546e0d1ac8a45815ab73dc619724eb7a49756
+EBUILD newsbeuter-2.8-r99.ebuild 1212 SHA256 22bd58f47b8a227e0c7ee75551335cc8fac56aad5556faef63b9e17f82eacc5d SHA512 9d6167fee234ab196b36927a2af0f4673027ae2469234c7436dc2449dd8516cf87abb42df3cad9cdf7358c1199466397e7c6d9b5aa2d761227907908aae42fcf WHIRLPOOL bcc5078757754891bcc9eaa0d788d6d7d3e433929add7583512e5f5095eecb604184424e7bbad6c6b5e7a9f250b5fdfc9397fa9e9dac497a15aa8ba8f033f233
+MISC metadata.xml 405 SHA256 72d5989efe3e9aa0fc0102ce2a3cd62af3a3b40beaeb42d9321149ca02387a15 SHA512 62694bdd8d3c988d48945c6ae926e20509fcc660d2584a69adcafad2c6abaa810364603ab5ca3b79cac128a2cb31486cac4b9b2903117ae73bf6e283145289dc WHIRLPOOL 6c5473ea7fe0652e0c8890ec81e4043e2b55b1cc46054e8c6b7a1575a190669b33d6012c9e30e1574696d562936684fa1ba086309355265fe47d948af7a1517f
diff --git a/net-news/newsbeuter/files/newsbeuter-2.8-musl.patch b/net-news/newsbeuter/files/newsbeuter-2.8-musl.patch
new file mode 100644
index 00000000..562fba5f
--- /dev/null
+++ b/net-news/newsbeuter/files/newsbeuter-2.8-musl.patch
@@ -0,0 +1,43 @@
+https://github.com/akrennmair/newsbeuter/issues/174
+
+diff -ur a/newsbeuter-2.8/src/stflpp.cpp b/newsbeuter-2.8/src/stflpp.cpp
+--- a/newsbeuter-2.8/src/stflpp.cpp 2014-01-19 01:10:41.000000000 -0200
++++ b/newsbeuter-2.8/src/stflpp.cpp 2015-04-09 23:49:37.768386550 -0200
+@@ -16,7 +16,7 @@
+ */
+
+ stfl::form::form(const std::string& text) : f(0) {
+- ipool = stfl_ipool_create((std::string(nl_langinfo(CODESET)) + "//TRANSLIT").c_str());
++ ipool = stfl_ipool_create(nl_langinfo(CODESET));
+ if (!ipool) {
+ throw exception(errno);
+ }
+@@ -82,7 +82,7 @@
+
+ std::string stfl::quote(const std::string& text) {
+ scope_mutex lock(&quote_mtx);
+- stfl_ipool * ipool = stfl_ipool_create((std::string(nl_langinfo(CODESET)) + "//TRANSLIT").c_str());
++ stfl_ipool * ipool = stfl_ipool_create(nl_langinfo(CODESET));
+ std::string retval = stfl_ipool_fromwc(ipool,stfl_quote(stfl_ipool_towc(ipool,text.c_str())));
+ stfl_ipool_destroy(ipool);
+ return retval;
+diff -ur a/newsbeuter-2.8/src/utils.cpp b/newsbeuter-2.8/src/utils.cpp
+--- a/newsbeuter-2.8/src/utils.cpp 2014-01-19 01:10:41.000000000 -0200
++++ b/newsbeuter-2.8/src/utils.cpp 2015-04-09 23:47:39.570864222 -0200
+@@ -262,7 +262,7 @@
+ if (strcasecmp(tocode.c_str(), fromcode.c_str())==0)
+ return text;
+
+- iconv_t cd = ::iconv_open((tocode + "//TRANSLIT").c_str(), fromcode.c_str());
++ iconv_t cd = ::iconv_open(tocode.c_str(), fromcode.c_str());
+
+ if (cd == reinterpret_cast<iconv_t>(-1))
+ return result;
+@@ -493,7 +493,6 @@
+
+ std::string utils::wstr2str(const std::wstring& wstr) {
+ std::string codeset = nl_langinfo(CODESET);
+- codeset.append("//TRANSLIT");
+ struct stfl_ipool * ipool = stfl_ipool_create(codeset.c_str());
+ std::string result = stfl_ipool_fromwc(ipool, wstr.c_str());
+ stfl_ipool_destroy(ipool);
diff --git a/net-news/newsbeuter/metadata.xml b/net-news/newsbeuter/metadata.xml
new file mode 100644
index 00000000..eb329177
--- /dev/null
+++ b/net-news/newsbeuter/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>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <longdescription lang="en">
+ newsbeuter is an RSS feed reader for the text console. It is designed
+ to run Unix-like operating systems such as Linux.
+ </longdescription>
+</pkgmetadata>
diff --git a/net-news/newsbeuter/newsbeuter-2.8-r99.ebuild b/net-news/newsbeuter/newsbeuter-2.8-r99.ebuild
new file mode 100644
index 00000000..09c3cea4
--- /dev/null
+++ b/net-news/newsbeuter/newsbeuter-2.8-r99.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-news/newsbeuter/newsbeuter-2.8.ebuild,v 1.3 2014/03/29 06:08:40 ago Exp $
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A RSS/Atom feed reader for the text console"
+HOMEPAGE="http://www.newsbeuter.org/index.html"
+SRC_URI="http://www.${PN}.org/downloads/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="test"
+
+RDEPEND=">=dev-db/sqlite-3.5:3
+ >=dev-libs/stfl-0.21
+ >=net-misc/curl-7.18.0
+ dev-libs/json-c:=
+ dev-libs/libxml2"
+
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig
+ sys-devel/gettext
+ test? (
+ dev-libs/boost
+ sys-devel/bc
+ )"
+
+# tests require network access
+RESTRICT="test"
+
+src_prepare() {
+ sed -i 's:-ggdb::' Makefile || die
+ epatch "${FILESDIR}"/${P}-musl.patch
+}
+
+src_configure() {
+ ./config.sh || die
+}
+
+src_compile() {
+ emake CXX="$(tc-getCXX)" AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
+}
+
+src_test() {
+ emake test
+ # Tests fail if in ${S} rather than in ${S}/test
+ cd "${S}"/test
+ ./test || die
+}
+
+src_install() {
+ emake prefix="${D}/usr" docdir="${D}/usr/share/doc/${PF}" install
+ dodoc AUTHORS README CHANGES
+}
diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest
new file mode 100644
index 00000000..6967e834
--- /dev/null
+++ b/net-wireless/bluez/Manifest
@@ -0,0 +1,14 @@
+AUX 0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch 1907 SHA256 4c07ccb23953e83d805b8b0c726a08121dc17deb26f7571bca32dfafe7bd2881 SHA512 17a0967ac291be3822e2be73912ab4c1720564bdce0765582e54bc0347d0477d38f82dbf0db9d660f982c35b3c2ea13dd37b22e18223d36745306c4c9d859423 WHIRLPOOL 67a3ab27c5f6bb15894f1fb55c9947fd97c9e64c380fe0f52540887c12f7052d54b34c2cbda3f62bcf27888c2400ddac9b239a138383f74ad28616aebefdae84
+AUX 0001-emulator-serial.c-use-posix_openpt-instead-of-getpt.patch 1074 SHA256 5384d81e2feaa11268f69036385ae91f2ed5e357df6300c337e88fe5bdf06fef SHA512 620b304749e6f1e725eb9fd19a7e69cc704c5da5f4676a310bb2101eac676dcf47c64a7998403fc3f7929330da5fb5e84ef93c58f7d41aee86deb136c45c1784 WHIRLPOOL cc09186ac50689a3f12580e6c787f91d21dabd9723e0fa7a2ea85ff8a155dd17f58a7f0706d5451d3d269b94884c7baf46f0fa112c5cc15f50c4ade0cd2af6c3
+AUX 0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch 1252 SHA256 86e3d24527f44c5a225e6d92457be52026481a7ac0d7944700ef4445d8afc8b4 SHA512 774f1d9cd49dd3fc0e9f02ad93876c59d78f88f149591f384cf5d2e3541d237ce390552c8bc2cb4d4ad7e5dcc295df49220565f0b0e686a2f8b3404f68323d32 WHIRLPOOL a88e1a061ed3989251a7e350e5a2f44b3d83ca388456652e28408a37e474e6afbd3b48e25b0ebc27b90e515d62987bac05a99087d5fe337ab2ec245c2d4edd3c
+AUX 0001-tools-Fix-compilation-errors-with-musl.patch 4795 SHA256 33adc09786a5f0c07b6e8cc89d869bd27363a53c07b9d13841773540f708e207 SHA512 ce6175a6a52ad8fae11a59a80a82f6a3ebdf3e9b65e8c7a9251c4e41c55a3ea20266912ef7f259d2960acc6702c0f0a761819c24b80c605d1129b2838a3ff725 WHIRLPOOL 81b174ad64e49b2c7947021ba696f61346e1621acb509f94a2e49baee85d696efdc73546f1c2bd9390adfe6567aca673f8d774034f70f2855d2a2727854d9c8e
+AUX 0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch 1165 SHA256 1c3cab160520c0f60a8b5b1e479d70a92c3564d951aca34caa8b837cdba3a5cd SHA512 928c0bbd0e2d231385a979c9c2247e6840c66520a0c5e0075f2c075ee73f424cf3b7b2469d834d839e356bf28629b05b2f179446594e090f6b0f7a3ea7822f97 WHIRLPOOL b7ab7f22cc77f0da2030f19dddd1a42a457676e7f3c55bef09cdc42eab5faf497d1ef7568deece347086e8ca6a6d196694dda8ddf5cc9f66c0bfce3c0cc45a6b
+AUX 0002-autopair-Don-t-handle-the-iCade.patch 1412 SHA256 219c595ea7d022abc70221f99861815b248c46f45eef66006e7a77a0c9bd8911 SHA512 7911d0461a2720a083369c03038d6a6c69218756733c72f79eccd2e13821ecdba30649cd38a5e2427e1b79473809610020bd16a6aab55b35ac4136319c5832b3 WHIRLPOOL b9e7f4dbb48bde12259d75a3a4e65d1284415a70047776f52588c795ed7216c634b31b559545425dcd44b41454327ce50bd95289be5bb94132e6ed245c2bfa97
+AUX 0004-agent-Assert-possible-infinite-loop.patch 583 SHA256 7164b3c2e759336f926210b923b917ee5b3098024fd7a46d39cfe0c0e463ddb3 SHA512 f3af46b27180f500c3f978799633b7a01a9d7720eafdb7a9fb108684161616b976b42d135a2358785830c26642ef7c2175d0f1fa3d6df898fe3bd5e77f6a191d WHIRLPOOL 4c6ecb787db4e3922652433940e734de9c1755be9cd73a27cd0e1b62ca470c76962fef666aff1b2932e306772b5879f34bae366619bb173ae1f92a0cfeff5e3f
+AUX bluetooth-init.d-r3 571 SHA256 de7f4a890cf994e1c283251ac5ac6b0aedb29104d708e5e7a77702ac2055dec7 SHA512 e5f550a8c0b5c9e8902c920b1bd1ef120698b568fe38220eae2d49099e364ea7b05e3026356e857666a515bb9137c92a774ca1fc70a2b6814b4d03fe29c2ccc2 WHIRLPOOL 84a3655b8b13985759365ac220a27fcc18cdf97373032e2040cf4a5b27a8b1a5df92aa6b45e92442010b338419d82c4f9548af03602c101e9f34d623e4b1b174
+AUX bluez-5.23-use-posix_openpt.patch 594 SHA256 6d8f641577b769629d501aae34bcd9dba82307a93309f94a304a90b2e0b2a64c SHA512 e61fb667d2f67f90df495feba25211a2caf2a09336165859d90b9224caa6b61c256dc4b124375a2d40547f0030e03185abc358e2224638acdecf12d02c6af0e9 WHIRLPOOL a21870b9077d2c041168945fd3d8cfdb2921e20ac42535a46d6cd4a98ea8761272f2fecb7e40029bb330f1e7ec9297256f2b2db442a570bac134350ed0d4602d
+AUX bluez-plugdev.patch 469 SHA256 ec3f06f24f530574edf5eef308afcf16bb7e0a88336a454a0b24698d2491f5f2 SHA512 b7e23b6f52e6f638e6d5deed4e901136c40bc1cbfb302ada8d85873e1792b4e3605802a2c5f786d5d6d53bf4651fc5b611396aaafe5eff90578650c448a5a7a2 WHIRLPOOL 6364590d80d811e55e2f696ba0b57c0173bac859e69de284bbcc3b511c7ea639d48dd7451e5a4abe8746b8c0986867cb680b291880e6a6ada03004e0c72c2583
+AUX rfcomm-init.d-r2 661 SHA256 e633ab4690db7d89d8a325bbdff73253cb4e3994c4cc5daa0c81205576bc1d09 SHA512 ec3968c79bd4b0ac57f4a0fd2f286b3380951af183c68ae9c9b57339d74931d98984b3594c9e10db9f61eb2160e214572a4bae8885cd4ff9192dbbfc357d20a5 WHIRLPOOL c37f516e2485c21d4613b821d53c2f2782ffa50a1cc4263ea8bd44c064088651c05c4880edd397fdc20b0c5f0805bef6a06ec0606748f16cd67dd7e35757fe34
+DIST bluez-5.23.tar.xz 1426660 SHA256 cdabd38d7ac8dd392a77ce7d76d5c120b277e4115040ba5d3ab91c05ab37f2c1 SHA512 5cbb5c34963c5b70badab618018eda5017b44d240c3a47b4bbaf88e41b67617c5a299a21509a917ef3bb91be79032aa10837138283b6510e2829a6be1554ef92 WHIRLPOOL c3049637a97c80301307fa8ce7618763df706223d103e6a79c41eecc68203bcd0f999f8f523048acac6f07884ce4ecbc0ef9e2f80bbdafacbbef289fb9531fc8
+EBUILD bluez-5.23-r99.ebuild 5520 SHA256 b257a7aaad8f43b8997570b42131d9c9086ec8dc9b574eb51829b75118edfb95 SHA512 1fa9bab18bf825dec4dd3cc4df68f5b7d9713f0709e307d11215b14e864a5eb822d8a09f5b30d9aa6298d3fda743ff55ffa2b4cecccfd3e4979a667277a392f8 WHIRLPOOL 1d0cc853a7355a47b06dab2a56aed1ad41f50e2396a6f3f63c9a3c91167fb14e3c782e8eecf5166b712b3625dbdcd2502825d4832d6958914cbd07d277ced323
+MISC metadata.xml 759 SHA256 e649a4a8180f678ead82c6b8fd8d02cecc19f0c592fb059cbbadf14c3028da7f SHA512 91e8f285f398cbd6bd7e739433df5efab185bfcbc755e403639ac504fd8c5699531b205b0a54c4da24785268d8c5b18b06db30536484576726afede6a67c8184 WHIRLPOOL 459f9d3e931bd0c7962ef8633ed28292ca30835f60ff8eabf067051606509ee411d4aafa8e95e1ebfdc626f35e95ae6516b7469b984fcddddae0db3bb007d9a4
diff --git a/net-wireless/bluez/bluez-5.23-r99.ebuild b/net-wireless/bluez/bluez-5.23-r99.ebuild
new file mode 100644
index 00000000..467772e5
--- /dev/null
+++ b/net-wireless/bluez/bluez-5.23-r99.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-5.23.ebuild,v 1.2 2014/09/25 09:11:55 pacho Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
+
+inherit autotools eutils multilib python-any-r1 readme.gentoo systemd udev user multilib-minimal
+
+DESCRIPTION="Bluetooth Tools and System Daemons for Linux"
+HOMEPAGE="http://www.bluez.org"
+SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz"
+
+LICENSE="GPL-2+ LGPL-2.1+"
+SLOT="0/3"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="cups debug +obex +readline selinux systemd test +udev"
+REQUIRED_USE="test? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+ >=dev-libs/glib-2.28:2
+ >=sys-apps/dbus-1.6:=
+ >=sys-apps/hwids-20121202.2
+ cups? ( net-print/cups:= )
+ obex? ( dev-libs/libical )
+ readline? ( sys-libs/readline:= )
+ selinux? ( sec-policy/selinux-bluetooth )
+ systemd? ( sys-apps/systemd )
+ udev? ( >=virtual/udev-172 )
+ abi_x86_32? (
+ !<app-emulation/emul-linux-x86-soundlibs-20140406-r1
+ !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32]
+ )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ test? (
+ ${PYTHON_DEPS}
+ >=dev-python/dbus-python-1
+ dev-python/pygobject:2
+ dev-python/pygobject:3
+ )
+"
+
+DOC_CONTENTS="
+ If you want to use rfcomm as a normal user, you need to add the user
+ to the uucp group.
+"
+
+pkg_setup() {
+ enewgroup plugdev
+ use test && python-any-r1_pkg_setup
+
+ if ! use udev; then
+ ewarn
+ ewarn "You are installing ${PN} with USE=-udev. This means various bluetooth"
+ ewarn "devices and adapters from Apple, Dell, Logitech etc. will not work,"
+ ewarn "and hid2hci will not be available."
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Use static group "plugdev" if there is no ConsoleKit (or systemd logind)
+ epatch "${FILESDIR}"/bluez-plugdev.patch
+
+ # Fedora patches
+ # http://www.spinics.net/lists/linux-bluetooth/msg38490.html
+ epatch "${FILESDIR}"/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg40136.html
+ epatch "${FILESDIR}"/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
+
+ # http://www.spinics.net/lists/linux-bluetooth/msg41264.html
+ epatch "${FILESDIR}"/0002-autopair-Don-t-handle-the-iCade.patch
+
+ # ???
+ epatch "${FILESDIR}"/0004-agent-Assert-possible-infinite-loop.patch
+
+ # Ubuntu workaround for bug #501120
+ epatch "${FILESDIR}"/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
+
+ # Patches for musl
+ epatch "${FILESDIR}"/0001-tools-Fix-compilation-errors-with-musl.patch
+ epatch "${FILESDIR}"/0001-emulator-serial.c-use-posix_openpt-instead-of-getpt.patch
+
+ if use cups; then
+ sed -i \
+ -e "s:cupsdir = \$(libdir)/cups:cupsdir = $(cups-config --serverbin):" \
+ Makefile.{in,tools} || die
+ fi
+
+ eautoreconf
+
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # readline is automagic when client is enabled
+ # --enable-client always needs readline, bug #504038
+ ac_cv_header_readline_readline_h=$(multilib_native_usex readline)
+ )
+
+ if ! multilib_is_native_abi; then
+ myconf+=(
+ # deps not used for the library
+ {DBUS,GLIB}_{CFLAGS,LIBS}=' '
+ )
+ fi
+
+ # Missing flags: experimental (sap, nfc, ...)
+ econf \
+ --localstatedir=/var \
+ --disable-android \
+ --enable-datafiles \
+ --enable-experimental \
+ --enable-optimization \
+ $(use_enable debug) \
+ --enable-pie \
+ --enable-threads \
+ --enable-library \
+ $(multilib_native_use_enable test) \
+ --enable-tools \
+ --enable-manpages \
+ --enable-monitor \
+ $(multilib_native_use_enable cups) \
+ $(multilib_native_use_enable obex) \
+ $(multilib_native_use_enable readline client) \
+ $(multilib_native_use_enable systemd) \
+ $(systemd_with_unitdir) \
+ $(multilib_native_use_enable udev) \
+ $(multilib_native_use_enable udev sixaxis)
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ emake -f Makefile -f - libs \
+ <<<'libs: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && default
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install
+
+ # Unittests are not that useful once installed
+ if use test ; then
+ rm -r "${ED}"/usr/$(get_libdir)/bluez/test || die
+ fi
+ else
+ emake DESTDIR="${D}" \
+ install-includeHEADERS \
+ install-libLTLIBRARIES \
+ install-pkgconfigDATA
+ fi
+}
+
+multilib_src_install_all() {
+ prune_libtool_files --modules
+
+ keepdir /var/lib/bluetooth
+
+ # Upstream don't want people to play with them
+ # But we keep installing them due 'historical' reasons
+ insinto /etc/bluetooth
+ local d
+ for d in input network proximity; do
+ doins profiles/${d}/${d}.conf
+ done
+ doins src/main.conf
+ doins src/bluetooth.conf
+
+# FIXME:
+# Looks like upstream installs it only for systemd, probably not needed
+# insinto /usr/share/dbus-1/system-services
+# doins src/org.bluez.service
+
+ newinitd "${FILESDIR}"/bluetooth-init.d-r3 bluetooth
+ newinitd "${FILESDIR}"/rfcomm-init.d-r2 rfcomm
+
+ einstalldocs
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+
+ use udev && udev_reload
+
+ has_version net-dialup/ppp || elog "To use dial up networking you must install net-dialup/ppp."
+
+ if ! has_version sys-auth/consolekit && ! has_version sys-apps/systemd; then
+ elog "Since you don't have sys-auth/consolekit neither sys-apps/systemd, you will only"
+ elog "be able to run bluetooth clients as root. If you want to be able to run bluetooth clients as"
+ elog "a regular user, you need to add the user to the plugdev group."
+ fi
+}
diff --git a/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
new file mode 100644
index 00000000..1ea3e6f3
--- /dev/null
+++ b/net-wireless/bluez/files/0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch
@@ -0,0 +1,58 @@
+From 3027cb7141fb65cf3eeda69c688db8c4045e2d3f Mon Sep 17 00:00:00 2001
+From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
+Date: Sat, 12 Oct 2013 17:45:25 +0200
+Subject: [PATCH] Allow using obexd without systemd in the user session
+
+Not all sessions run systemd --user (actually, the majority
+doesn't), so the dbus daemon must be able to spawn obexd
+directly, and to do so it needs the full path of the daemon.
+---
+ Makefile.obexd | 4 ++--
+ obexd/src/org.bluez.obex.service | 4 ----
+ obexd/src/org.bluez.obex.service.in | 4 ++++
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+ delete mode 100644 obexd/src/org.bluez.obex.service
+ create mode 100644 obexd/src/org.bluez.obex.service.in
+
+diff --git a/Makefile.obexd b/Makefile.obexd
+index 3760867..142e7c3 100644
+--- a/Makefile.obexd
++++ b/Makefile.obexd
+@@ -2,12 +2,12 @@
+ if SYSTEMD
+ systemduserunitdir = @SYSTEMD_USERUNITDIR@
+ systemduserunit_DATA = obexd/src/obex.service
++endif
+
+ dbussessionbusdir = @DBUS_SESSIONBUSDIR@
+ dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+-endif
+
+-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
++EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+
+ obex_plugindir = $(libdir)/obex/plugins
+
+diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+deleted file mode 100644
+index a538088..0000000
+--- a/obexd/src/org.bluez.obex.service
++++ /dev/null
+@@ -1,4 +0,0 @@
+-[D-BUS Service]
+-Name=org.bluez.obex
+-Exec=/bin/false
+-SystemdService=dbus-org.bluez.obex.service
+diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+new file mode 100644
+index 0000000..9c815f2
+--- /dev/null
++++ b/obexd/src/org.bluez.obex.service.in
+@@ -0,0 +1,4 @@
++[D-BUS Service]
++Name=org.bluez.obex
++Exec=@libexecdir@/obexd
++SystemdService=dbus-org.bluez.obex.service
+--
+1.8.3.1
+
diff --git a/net-wireless/bluez/files/0001-emulator-serial.c-use-posix_openpt-instead-of-getpt.patch b/net-wireless/bluez/files/0001-emulator-serial.c-use-posix_openpt-instead-of-getpt.patch
new file mode 100644
index 00000000..766734a4
--- /dev/null
+++ b/net-wireless/bluez/files/0001-emulator-serial.c-use-posix_openpt-instead-of-getpt.patch
@@ -0,0 +1,37 @@
+From 57c33317f5c3f6d21a9b3c56f8d1e97179e4c457 Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Sat, 4 Oct 2014 09:34:05 -0400
+Subject: [PATCH] emulator/serial.c: use posix_openpt() instead of getpt()
+
+getpt(3) is glibc-specific and is not provided on musl. Instead, we
+use use posix_openpt(3) which is equivalent and portable.
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+---
+ emulator/serial.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/emulator/serial.c b/emulator/serial.c
+index 9583be4..8b49dc6 100644
+--- a/emulator/serial.c
++++ b/emulator/serial.c
+@@ -32,6 +32,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/epoll.h>
+ #include <sys/uio.h>
+@@ -160,7 +161,7 @@ static void open_pty(struct serial *serial)
+ {
+ enum btdev_type uninitialized_var(type);
+
+- serial->fd = getpt();
++ serial->fd = posix_openpt(O_RDWR | O_NOCTTY);
+ if (serial->fd < 0) {
+ perror("Failed to get master pseudo terminal");
+ return;
+--
+2.0.4
+
diff --git a/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch b/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
new file mode 100644
index 00000000..004a3895
--- /dev/null
+++ b/net-wireless/bluez/files/0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
@@ -0,0 +1,38 @@
+From f7861d27fbcbc519f57d8496aa9486f487908821 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Sat, 9 Nov 2013 18:13:43 +0100
+Subject: [PATCH 1/5] obex: Use GLib helper function to manipulate paths
+
+Instead of trying to do it by hand. This also makes sure that
+relative paths aren't used by the agent.
+---
+ obexd/src/manager.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/obexd/src/manager.c b/obexd/src/manager.c
+index cec8a39..f18896e 100644
+--- a/obexd/src/manager.c
++++ b/obexd/src/manager.c
+@@ -651,14 +651,14 @@ static void agent_reply(DBusPendingCall *call, void *user_data)
+ DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_INVALID)) {
+ /* Splits folder and name */
+- const char *slash = strrchr(name, '/');
++ gboolean is_relative = !g_path_is_absolute(name);
+ DBG("Agent replied with %s", name);
+- if (!slash) {
+- agent->new_name = g_strdup(name);
++ if (is_relative) {
++ agent->new_name = g_path_get_basename(name);
+ agent->new_folder = NULL;
+ } else {
+- agent->new_name = g_strdup(slash + 1);
+- agent->new_folder = g_strndup(name, slash - name);
++ agent->new_name = g_path_get_basename(name);
++ agent->new_folder = g_path_get_dirname(name);
+ }
+ }
+
+--
+1.8.4.2
+
diff --git a/net-wireless/bluez/files/0001-tools-Fix-compilation-errors-with-musl.patch b/net-wireless/bluez/files/0001-tools-Fix-compilation-errors-with-musl.patch
new file mode 100644
index 00000000..501e75a1
--- /dev/null
+++ b/net-wireless/bluez/files/0001-tools-Fix-compilation-errors-with-musl.patch
@@ -0,0 +1,189 @@
+From 51ec4fd847369bc77e72850fe93d727ae9c656b9 Mon Sep 17 00:00:00 2001
+From: Szymon Janc <szymon.janc@tieto.com>
+Date: Fri, 19 Sep 2014 16:10:07 +0200
+Subject: [PATCH] tools: Fix compilation errors with musl
+
+This fix number of includes for <sys/poll.h> instead of <poll.h>
+
+ CC tools/hciattach.o
+In file included from tools/hciattach.c:41:0:
+/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect
+ #include <sys/poll.h> to <poll.h> [-Werror=cpp]
+ #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ ^
+---
+ tools/amptest.c | 2 +-
+ tools/btattach.c | 2 +-
+ tools/btsnoop.c | 1 +
+ tools/ciptool.c | 2 +-
+ tools/cltest.c | 2 +-
+ tools/hciattach.c | 2 +-
+ tools/hciattach_qualcomm.c | 2 +-
+ tools/hciattach_tialt.c | 2 +-
+ tools/hcidump.c | 2 +-
+ tools/l2ping.c | 2 +-
+ tools/l2test.c | 2 +-
+ tools/rfcomm.c | 2 +-
+ 12 files changed, 12 insertions(+), 11 deletions(-)
+
+diff --git a/tools/amptest.c b/tools/amptest.c
+index 6192f7e..bba0a9a 100644
+--- a/tools/amptest.c
++++ b/tools/amptest.c
+@@ -32,7 +32,7 @@
+ #include <alloca.h>
+ #include <stdlib.h>
+ #include <stdbool.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+
+diff --git a/tools/btattach.c b/tools/btattach.c
+index 9458fd7..bdbbe16 100644
+--- a/tools/btattach.c
++++ b/tools/btattach.c
+@@ -35,7 +35,7 @@
+ #include <getopt.h>
+ #include <termios.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/hci.h>
+diff --git a/tools/btsnoop.c b/tools/btsnoop.c
+index 14581f2..71191eb 100644
+--- a/tools/btsnoop.c
++++ b/tools/btsnoop.c
+@@ -35,6 +35,7 @@
+ #include <stdbool.h>
+ #include <string.h>
+ #include <getopt.h>
++#include <endian.h>
+ #include <arpa/inet.h>
+ #include <sys/stat.h>
+
+diff --git a/tools/ciptool.c b/tools/ciptool.c
+index 72338dc..3ff9fb1 100644
+--- a/tools/ciptool.c
++++ b/tools/ciptool.c
+@@ -32,7 +32,7 @@
+ #include <string.h>
+ #include <getopt.h>
+ #include <signal.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+
+diff --git a/tools/cltest.c b/tools/cltest.c
+index 4ddb98a..0231805 100644
+--- a/tools/cltest.c
++++ b/tools/cltest.c
+@@ -32,7 +32,7 @@
+ #include <alloca.h>
+ #include <stdlib.h>
+ #include <stdbool.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+
+diff --git a/tools/hciattach.c b/tools/hciattach.c
+index 1904ac5..d8ef7e7 100644
+--- a/tools/hciattach.c
++++ b/tools/hciattach.c
+@@ -37,8 +37,8 @@
+ #include <syslog.h>
+ #include <termios.h>
+ #include <time.h>
++#include <poll.h>
+ #include <sys/time.h>
+-#include <sys/poll.h>
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
+
+diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c
+index eb72a0f..0e25905 100644
+--- a/tools/hciattach_qualcomm.c
++++ b/tools/hciattach_qualcomm.c
+@@ -36,8 +36,8 @@
+ #include <syslog.h>
+ #include <termios.h>
+ #include <time.h>
++#include <poll.h>
+ #include <sys/time.h>
+-#include <sys/poll.h>
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
+ #include <sys/uio.h>
+diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c
+index 5c7f3a5..a7c1706 100644
+--- a/tools/hciattach_tialt.c
++++ b/tools/hciattach_tialt.c
+@@ -35,8 +35,8 @@
+ #include <syslog.h>
+ #include <termios.h>
+ #include <time.h>
++#include <poll.h>
+ #include <sys/time.h>
+-#include <sys/poll.h>
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
+ #include <sys/uio.h>
+diff --git a/tools/hcidump.c b/tools/hcidump.c
+index 37a9f00..8839eb0 100644
+--- a/tools/hcidump.c
++++ b/tools/hcidump.c
+@@ -33,7 +33,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+diff --git a/tools/l2ping.c b/tools/l2ping.c
+index 29fb3d0..3dd437e 100644
+--- a/tools/l2ping.c
++++ b/tools/l2ping.c
+@@ -35,7 +35,7 @@
+ #include <getopt.h>
+ #include <signal.h>
+ #include <sys/time.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/socket.h>
+
+ #include <bluetooth/bluetooth.h>
+diff --git a/tools/l2test.c b/tools/l2test.c
+index 67ca70a..71ad109 100644
+--- a/tools/l2test.c
++++ b/tools/l2test.c
+@@ -38,7 +38,7 @@
+ #include <syslog.h>
+ #include <signal.h>
+ #include <sys/time.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+
+diff --git a/tools/rfcomm.c b/tools/rfcomm.c
+index b5bea38..659bbec 100644
+--- a/tools/rfcomm.c
++++ b/tools/rfcomm.c
+@@ -34,7 +34,7 @@
+ #include <getopt.h>
+ #include <signal.h>
+ #include <termios.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+--
+2.0.4
+
diff --git a/net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch b/net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
new file mode 100644
index 00000000..55d5af65
--- /dev/null
+++ b/net-wireless/bluez/files/0001-work-around-Logitech-diNovo-Edge-keyboard-firmware-i.patch
@@ -0,0 +1,29 @@
+From aa73bf5039dfd2cf0a52dd6fd22501d955cc1a00 Mon Sep 17 00:00:00 2001
+From: Tommy <mesilliac@gmail.com>
+Date: Thu, 10 Jan 2013 09:18:43 +0100
+Subject: [PATCH] work around Logitech diNovo Edge keyboard firmware issue
+
+https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/269851
+---
+ tools/hid2hci.rules | 5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/tools/hid2hci.rules b/tools/hid2hci.rules
+index db6bb03..7db4572 100644
+--- a/tools/hid2hci.rules
++++ b/tools/hid2hci.rules
+@@ -11,7 +11,10 @@ ATTR{bInterfaceClass}=="03", ATTR{bInterfaceSubClass}=="01", ATTR{bInterfaceProt
+ RUN+="hid2hci --method=dell --devpath=%p", ENV{HID2HCI_SWITCH}="1"
+
+ # Logitech devices
+-KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[345abce]|c71[34bc]", \
++KERNEL=="hiddev*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[5e]", \
++ RUN+="hid2hci --method=logitech-hid --devpath=%p"
++# Logitech, Inc. RAW communicating devices
++KERNEL=="hidraw*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c70[34abc]|c71[34bc]", \
+ RUN+="hid2hci --method=logitech-hid --devpath=%p"
+
+ ENV{DEVTYPE}!="usb_device", GOTO="hid2hci_end"
+--
+1.8.0.1
+
diff --git a/net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch b/net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch
new file mode 100644
index 00000000..68751ae7
--- /dev/null
+++ b/net-wireless/bluez/files/0002-autopair-Don-t-handle-the-iCade.patch
@@ -0,0 +1,47 @@
+From c16ae7041c7511d8d1ed8441f696716fa6a9117e Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Tue, 19 Nov 2013 14:11:39 +0100
+Subject: [PATCH 2/5] autopair: Don't handle the iCade
+
+We can't easily enter digits other than 1 through 4 (inclusive)
+so leave it up to the agent to figure out a good passcode
+for the iCade.
+
+Note that we can not use the VID/PID of the device, as it is not
+yet known at that point.
+---
+ plugins/autopair.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/autopair.c b/plugins/autopair.c
+index 8c98c12..5d2f6f7 100644
+--- a/plugins/autopair.c
++++ b/plugins/autopair.c
+@@ -57,13 +57,23 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
+ {
+ char addr[18];
+ char pinstr[7];
++ char name[25];
+ uint32_t class;
+
+ ba2str(device_get_address(device), addr);
+
+ class = btd_device_get_class(device);
+
+- DBG("device %s 0x%x", addr, class);
++ device_get_name(device, name, sizeof(name));
++ name[sizeof(name) - 1] = 0;
++
++ DBG("device %s (%s) 0x%x", addr, name, class);
++
++ g_message ("vendor 0x%X product: 0x%X", btd_device_get_vendor (device), btd_device_get_product (device));
++
++ /* The iCade shouldn't use random PINs like normal keyboards */
++ if (name != NULL && strstr(name, "iCade") != NULL)
++ return 0;
+
+ /* This is a class-based pincode guesser. Ignore devices with an
+ * unknown class.
+--
+1.8.4.2
+
diff --git a/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch b/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch
new file mode 100644
index 00000000..2746e0cd
--- /dev/null
+++ b/net-wireless/bluez/files/0004-agent-Assert-possible-infinite-loop.patch
@@ -0,0 +1,25 @@
+From 67e5477687a2753d3f7b300bcfdc74464d8ad41f Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Mon, 9 Dec 2013 18:04:56 +0100
+Subject: [PATCH 4/5] agent: Assert possible infinite loop
+
+---
+ src/agent.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/agent.c b/src/agent.c
+index bcba969..b292881 100644
+--- a/src/agent.c
++++ b/src/agent.c
+@@ -203,6 +203,8 @@ void agent_unref(struct agent *agent)
+ if (agent->ref > 0)
+ return;
+
++ g_assert (agent->ref == 0);
++
+ if (agent->request) {
+ DBusError err;
+ agent_pincode_cb pincode_cb;
+--
+1.8.4.2
+
diff --git a/net-wireless/bluez/files/bluetooth-init.d-r3 b/net-wireless/bluez/files/bluetooth-init.d-r3
new file mode 100644
index 00000000..f97fdb2c
--- /dev/null
+++ b/net-wireless/bluez/files/bluetooth-init.d-r3
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/files/bluetooth-init.d-r3,v 1.2 2014/01/09 13:24:42 joker Exp $
+
+depend() {
+ after coldplug
+ need dbus localmount hostname
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --background --exec /usr/libexec/bluetooth/bluetoothd
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down ${SVCNAME}"
+ start-stop-daemon --stop --quiet --exec /usr/libexec/bluetooth/bluetoothd
+ eend $?
+}
diff --git a/net-wireless/bluez/files/bluez-5.23-use-posix_openpt.patch b/net-wireless/bluez/files/bluez-5.23-use-posix_openpt.patch
new file mode 100644
index 00000000..3630df68
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-5.23-use-posix_openpt.patch
@@ -0,0 +1,20 @@
+diff -Naur bluez-5.23.orig/emulator/serial.c bluez-5.23/emulator/serial.c
+--- bluez-5.23.orig/emulator/serial.c 2014-08-06 17:25:36.000000000 +0000
++++ bluez-5.23/emulator/serial.c 2014-10-04 13:02:38.081336391 +0000
+@@ -32,6 +32,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/epoll.h>
+
+@@ -159,7 +160,7 @@
+ {
+ enum btdev_type uninitialized_var(type);
+
+- serial->fd = getpt();
++ serial->fd = posix_openpt(O_RDWR | O_NOCTTY);
+ if (serial->fd < 0) {
+ perror("Failed to get master pseudo terminal");
+ return;
diff --git a/net-wireless/bluez/files/bluez-plugdev.patch b/net-wireless/bluez/files/bluez-plugdev.patch
new file mode 100755
index 00000000..726838a5
--- /dev/null
+++ b/net-wireless/bluez/files/bluez-plugdev.patch
@@ -0,0 +1,14 @@
+diff -Nurp bluez-4.39.orig/src/bluetooth.conf bluez-4.39/src/bluetooth.conf
+--- bluez-4.39.orig/src/bluetooth.conf 2008-12-20 20:18:10.000000000 +0100
++++ bluez-4.39/src/bluetooth.conf 2009-09-05 13:30:34.411581498 +0200
+@@ -17,6 +17,10 @@
+ <allow send_destination="org.bluez"/>
+ </policy>
+
++ <policy group="plugdev">
++ <allow send_destination="org.bluez"/>
++ </policy>
++
+ <policy context="default">
+ <deny send_destination="org.bluez"/>
+ </policy>
diff --git a/net-wireless/bluez/files/rfcomm-init.d-r2 b/net-wireless/bluez/files/rfcomm-init.d-r2
new file mode 100755
index 00000000..c5640555
--- /dev/null
+++ b/net-wireless/bluez/files/rfcomm-init.d-r2
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/files/rfcomm-init.d-r2,v 1.1 2014/06/26 17:18:43 alonbl Exp $
+
+depend() {
+ need bluetooth
+}
+
+checkconfig() {
+ if [ -z "${ADDRESS}" ]; then
+ eerror "ADDRESS must be set"
+ return 1
+ fi
+
+ return 0
+}
+
+start() {
+ local DEVICE=${RC_SVCNAME#*.}
+
+ checkconfig || return 1
+
+ ebegin "Starting ${RC_SVCNAME}"
+ rfcomm bind "${DEVICE}" "${ADDRESS}" ${CHANNEL}
+ eend $?
+}
+
+stop() {
+ local DEVICE=${RC_SVCNAME#*.}
+
+ ebegin "Shutting down ${RC_SVCNAME}"
+ rfcomm release "${DEVICE}"
+ eend $?
+}
diff --git a/net-wireless/bluez/metadata.xml b/net-wireless/bluez/metadata.xml
new file mode 100644
index 00000000..de19c8b5
--- /dev/null
+++ b/net-wireless/bluez/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>pacho@gentoo.org</email>
+ <name>Pacho Ramos</name>
+ </maintainer>
+ <use>
+ <flag name="test-programs">Install tools for testing of
+ various Bluetooth functions</flag>
+ <flag name="hid2hci">The HID proxying makes the keyboard / mouse show up
+ as regular USB HID devices, but needs them to be
+ paired before enabling this, otherwise they won't be
+ detected</flag>
+ <flag name="obex">Enable OBEX transfer support.</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:bluez:bluez</remote-id>
+ <remote-id type="cpe">cpe:/a:bluez:bluez-libs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-wireless/crda/Manifest b/net-wireless/crda/Manifest
new file mode 100644
index 00000000..f091cb99
--- /dev/null
+++ b/net-wireless/crda/Manifest
@@ -0,0 +1,5 @@
+AUX crda-1.1.2-missing-include.patch 219 SHA256 e5dfc0dee3fe5d663430da50f53bd6f7f42cef9b5a7d248f997ea99899e7182f SHA512 ecb1f6c5e02a7e4564c8fd72d4fd3d2378095d8c9f42d635b70eb73400852a6714d3bc88ea7abf19781b875d343cb0bccb655aae4ee6ce4895be9d11ce59b609 WHIRLPOOL 2c481603a3a5d6f372aae26d667979897ede03de96e5fd4d9cfb7014fd623964a589646b704b41a295d941c8df11bd92f6dededece50127e7b99f91eeb1af84c
+AUX libnl31-support.diff 1963 SHA256 5a2fce22089b49733cd2315840d2812e4590e12d987086a04dcb69d6d9fcbac7 SHA512 849c3f866723f163579f55be7f6eda13020299394fd6599bfff80028da73cbe78f049d963fbf91eb3de6fca1e16ce26ae48e84534ad383caade4112ca448ca89 WHIRLPOOL d7fb6fbf7ea3d2fee7342e4878110ed9305259818cb353dd7cac321fecd87e5cd23986a6ee5a266f6ca06fade05e1d016531c38d6d1404a80c0963451e67604f
+DIST crda-1.1.2.tar.bz2 21754 SHA256 e469348a5d0bb933df31995869130f68901de9be02e666437f52125698851864 SHA512 cd0997fdafc63640cbac5cff57b617177c3693a6d05e2138f23ed8273502d5f485f8f60309ed4fec97fe2cd2d51ee4b7e2d9535efc1de44c08b9cc9d6fb7ecf3 WHIRLPOOL 35ef76fcb7f3760613135caba5b9c6b0c781bc560f948a60f6b09eaeb75f3538461d90ce353decc17795995795b63c124a282903d41a8e25680fda0b6498bea4
+EBUILD crda-1.1.2-r3.ebuild 1344 SHA256 839ca201462dbb74247bda0384150354e541ae24aa89c18ec0348fccce38a4ae SHA512 0fe5dbf6bcad6c2ea5ef998911544edb5b3699a47300a818725d3db3b09782d0380c155b4904660458d1072c4056c066d513d2b45be5fafe62cb5749204b340a WHIRLPOOL 63448bff7fe1d95d0d6cd6bd1733b32c584b1b655128e8c1d36abea9766bc9173cbdcc2bf2a1f45f2025c339deb77e1935d0fca9c187f3e85f8e74c442503a4e
+MISC metadata.xml 423 SHA256 a2bf4db1a40a535e8239fceeb01e7433b04ab0be4046a4f358303fc7e057cc87 SHA512 cedd6c72d6e7af630a04cac09a9ffd41e48d01ecfc2bb5e3c0a7af05de31f41d5b88f675b8204bb7fca2ea4ffada0b454c6f47337ce1dc13aeb87875861819c6 WHIRLPOOL 1301cb831507d985158de92f230e60e528e91529ba659508e34d4846c78e9c80963271356164e087098396624ccbd564d4055be07beb32848d9d088680272b67
diff --git a/net-wireless/crda/crda-1.1.2-r3.ebuild b/net-wireless/crda/crda-1.1.2-r3.ebuild
new file mode 100644
index 00000000..93306acb
--- /dev/null
+++ b/net-wireless/crda/crda-1.1.2-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-wireless/crda/crda-1.1.2-r3.ebuild,v 1.11 2013/01/01 08:27:28 ago Exp $
+
+EAPI=4
+inherit eutils toolchain-funcs python
+
+DESCRIPTION="Central Regulatory Domain Agent for wireless networks."
+HOMEPAGE="http://wireless.kernel.org/en/developers/Regulatory"
+SRC_URI="http://linuxwireless.org/download/crda/${P}.tar.bz2"
+
+LICENSE="ISC"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE=""
+
+RDEPEND="dev-libs/openssl
+ dev-libs/libnl
+ net-wireless/wireless-regdb"
+DEPEND="${RDEPEND}
+ dev-python/m2crypto
+ =dev-lang/python-2*
+ virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+ >=virtual/udev-171"
+
+src_prepare() {
+ epatch "${FILESDIR}"/libnl31-support.diff
+ epatch "${FILESDIR}"/${P}-missing-include.patch
+
+ python_convert_shebangs 2 utils/key2pub.py
+
+ sed -i \
+ -e "s:\<pkg-config\>:$(tc-getPKG_CONFIG):" \
+ Makefile || die
+}
+
+src_compile() {
+ emake UDEV_RULE_DIR=/lib/udev/rules.d/ REG_BIN=/usr/$(get_libdir)/crda/regulatory.bin USE_OPENSSL=1 CC="$(tc-getCC)" all_noverify
+}
+
+src_test() {
+ emake USE_OPENSSL=1 CC="$(tc-getCC)" verify
+}
+
+src_install() {
+ emake UDEV_RULE_DIR=/lib/udev/rules.d/ REG_BIN=/usr/$(get_libdir)/crda/regulatory.bin USE_OPENSSL=1 DESTDIR="${D}" install
+ keepdir /etc/wireless-regdb/pubkeys
+}
diff --git a/net-wireless/crda/files/crda-1.1.2-missing-include.patch b/net-wireless/crda/files/crda-1.1.2-missing-include.patch
new file mode 100644
index 00000000..7d28a778
--- /dev/null
+++ b/net-wireless/crda/files/crda-1.1.2-missing-include.patch
@@ -0,0 +1,10 @@
+--- a/crda-1.1.2/reglib.c
++++ b/crda-1.1.2/reglib.c
+@@ -1,6 +1,7 @@
+ #include <errno.h>
+ #include <stdio.h>
+ #include <arpa/inet.h>
++#include <limits.h>
+ #include <sys/types.h>
+ #include <dirent.h>
+ #include "reglib.h"
diff --git a/net-wireless/crda/files/libnl31-support.diff b/net-wireless/crda/files/libnl31-support.diff
new file mode 100644
index 00000000..56243ee9
--- /dev/null
+++ b/net-wireless/crda/files/libnl31-support.diff
@@ -0,0 +1,60 @@
+diff -aurp a/crda-1.1.2/crda.c b/crda-1.1.2/crda.c
+--- a/crda-1.1.2/crda.c 2011-11-07 19:52:28.884873650 +0000
++++ b/crda-1.1.2/crda.c 2011-11-07 19:53:30.501874372 +0000
+@@ -21,7 +21,7 @@
+ #include "regdb.h"
+ #include "reglib.h"
+
+-#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
++#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30) && !defined(CONFIG_LIBNL31)
+ /* libnl 2.0 compatibility code */
+ static inline struct nl_handle *nl_socket_alloc(void)
+ {
+@@ -44,7 +44,7 @@ static inline int __genl_ctrl_alloc_cach
+
+ #define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache
+ #define nl_sock nl_handle
+-#endif /* CONFIG_LIBNL20 && CONFIG_LIBNL30 */
++#endif /* CONFIG_LIBNL20 && CONFIG_LIBNL30 && CONFIG_LIBNL31 */
+
+ struct nl80211_state {
+ struct nl_sock *nl_sock;
+diff -aurp a/crda-1.1.2/Makefile b/crda-1.1.2/Makefile
+--- a/crda-1.1.2/Makefile 2011-11-07 19:52:28.884873650 +0000
++++ b/crda-1.1.2/Makefile 2011-11-07 19:54:25.906872386 +0000
+@@ -48,19 +48,26 @@ INSTALL ?= install
+ NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y)
+ NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y)
+ NL3FOUND := $(shell pkg-config --atleast-version=3 libnl-3.0 && echo Y)
++NL31FOUND := $(shell pkg-config --atleast-version=3 libnl-3.1 && echo Y)
+
+-ifeq ($(NL3FOUND),Y)
++ifeq ($(NL31FOUND),Y)
+ CFLAGS += -DCONFIG_LIBNL30
+-NLLIBS += -lnl-genl
+-NLLIBNAME = libnl-3.0
++NLLIBS += $(shell pkg-config --libs libnl-genl-3.1)
++NLLIBNAME = libnl-3.1
+ else
+- ifeq ($(NL2FOUND),Y)
+- CFLAGS += -DCONFIG_LIBNL20
+- NLLIBS += -lnl-genl
+- NLLIBNAME = libnl-2.0
++ ifeq ($(NL3FOUND),Y)
++ CFLAGS += -DCONFIG_LIBNL30
++ NLLIBS += $(shell pkg-config --libs libnl-genl-3.0)
++ NLLIBNAME = libnl-3.0
+ else
+- ifeq ($(NL1FOUND),Y)
+- NLLIBNAME = libnl-1
++ ifeq ($(NL2FOUND),Y)
++ CFLAGS += -DCONFIG_LIBNL20
++ NLLIBS += -lnl-genl
++ NLLIBNAME = libnl-2.0
++ else
++ ifeq ($(NL1FOUND),Y)
++ NLLIBNAME = libnl-1
++ endif
+ endif
+ endif
+ endif
diff --git a/net-wireless/crda/metadata.xml b/net-wireless/crda/metadata.xml
new file mode 100644
index 00000000..e6745d77
--- /dev/null
+++ b/net-wireless/crda/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>gurligebis@gentoo.org</email>
+ <name>Bjarke Istrup Pedersen</name>
+ </maintainer>
+ <maintainer>
+ <email>zerochaos@gentoo.org</email>
+ <name>Rick Farina</name>
+ </maintainer>
+ <longdescription lang="en">
+ Central Regulatory Domain Agent
+ </longdescription>
+</pkgmetadata>
+
diff --git a/profiles/repo_name b/profiles/repo_name
new file mode 100644
index 00000000..c320dd8b
--- /dev/null
+++ b/profiles/repo_name
@@ -0,0 +1 @@
+hardened-development
diff --git a/sys-apps/attr/Manifest b/sys-apps/attr/Manifest
new file mode 100644
index 00000000..22e84ec3
--- /dev/null
+++ b/sys-apps/attr/Manifest
@@ -0,0 +1,9 @@
+AUX attr-2.4.44-gettext.patch 1577 SHA256 d8e4948b48f657b174f642cf29b0830094d16ffae837149fc30c923afd06ddd4 SHA512 32db6077d3e05a225d18e40b44abe2fa83f0309131f61726c8fe221c6ae5270b524c4d36932161671b82b987fe1344d43c6492734b145018a0d9a147abf67e3d WHIRLPOOL b247a5a9aeba48de310498920c0c14f71b0dab7a2c4c94bba436f73ee03568c655588d1832bbbf3a1ef509099f4714ed2f2e51ee1b8cf5f44d1f3397740166fc
+AUX attr-2.4.46-config-shell.patch 1497 SHA256 8e04776ea64be0a6a7bd39790c66df75cf9e51495fe7a1b895c16de6ca6f110c SHA512 378d58eaf662c9acfaea16faa64cfd65a5ff1b265e9abc79c758104146664eb346e205a3065067e27ae63b39f9b816990fef7e2f99a7e3c5cb1699bd4e37136c WHIRLPOOL f3efb1e737111c551bbb0eb7f7a683f3b0aaabb3ee5162311cf3439be2f8d39149e32a638b2ac5c4c77f1b6b46da1a4ad71d998be26e82e398d9d5306e50bd88
+AUX attr-2.4.46-generic-syscalls.patch 5977 SHA256 9fc575b72bce0927c52cd18c9b9aee50c32962aa20598097935c607e5b563b28 SHA512 8dd9f6e44c5862c77058a220ca4557dab5aa1af6ce8aee872567ee235f21b8bd147941e727880c6e0c84aa948a3eaaa6ee9a88880fcfb760fe59207d09bed308 WHIRLPOOL 3883aebc6392248a4eb152f847aacedb7b76cefb0c6e971f2b54ddb02d9184866768e55380146a0b46611a8dad6949b82df7cebcbcca2d04a60635c53a85b023
+AUX attr-2.4.46-ifdef_cplusplus.patch 746 SHA256 5642592689dbbd7547514a9d76ae69adb81d81c205dc6c7671ea94c4ddd99641 SHA512 36a3fd04e006877cdb6c3185a12b3239f1cef307420f9df43074852cf9a3979976144df12a966323f32c298e6901b137b2d030e8dd04f9227016829453543b17 WHIRLPOOL 00ef7704488e1953fe833798c573cdf037f3eb16d4fbbc2ca92e818e2f52fb95f627cccf1f9093578602ee0ef8902374d1dd03062e1ee6d21873b48c97aa60ca
+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
+EBUILD attr-2.4.46-r99.ebuild 1566 SHA256 d5be60eeda3480eef7d27cada97a1bc912c79aac155cefe8bbb9383965a90503 SHA512 da61738bbf71ab337c08e9094b5c2825154a0a2ccd1bfe5686c28a12be4d2943773b03936973d05f9d9c9ac5601450ef5bc91afb52b8d70b1ae2931a81ed2522 WHIRLPOOL 36aa49202378a92930284cdab4d98c66b9d2b683561cf0f3f46245010020144cf8f7f68fc6e40f48327669baac57b8d1b8f3f7607c27c4722736737df19f907f
+EBUILD attr-2.4.47-r99.ebuild 1869 SHA256 e3f06c40d987c5a0111dc32f87ca3b5f61162e38266ab72c95d03cf5c9ea69bb SHA512 299ee7104a75d5edf086017f471a7cd69224e36dbf5b1ef2cb57743a7260163f3ec38835007fadfe5cd33ce463e1b3568baf5a3d21d336cec35d594ef607fea8 WHIRLPOOL 050be6291794309d26987def58c449be9482d656ded63d3f98c6d8cb1895f10d8809e5606b34b1a8a5d037231c2046896a18c29326ba49fc2de46d56f3f10b76
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-apps/attr/attr-2.4.46-r99.ebuild b/sys-apps/attr/attr-2.4.46-r99.ebuild
new file mode 100644
index 00000000..c38d860e
--- /dev/null
+++ b/sys-apps/attr/attr-2.4.46-r99.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/attr/attr-2.4.46-r2.ebuild,v 1.13 2014/01/17 04:23:10 vapier Exp $
+
+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="amd64 arm ~mips ppc x86"
+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
+ epatch "${FILESDIR}"/${PN}-2.4.46-ifdef_cplusplus.patch
+ 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-r99.ebuild b/sys-apps/attr/attr-2.4.47-r99.ebuild
new file mode 100644
index 00000000..ccd15580
--- /dev/null
+++ b/sys-apps/attr/attr-2.4.47-r99.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/attr/attr-2.4.47-r1.ebuild,v 1.9 2014/02/15 18:41:59 nimiux Exp $
+
+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="amd64 arm ~mips ppc x86"
+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() {
+ epatch "${FILESDIR}"/${PN}-2.4.46-ifdef_cplusplus.patch
+ 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/files/attr-2.4.44-gettext.patch b/sys-apps/attr/files/attr-2.4.44-gettext.patch
new file mode 100644
index 00000000..49c2d32b
--- /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 00000000..b6660e63
--- /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 00000000..d12fcd29
--- /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/files/attr-2.4.46-ifdef_cplusplus.patch b/sys-apps/attr/files/attr-2.4.46-ifdef_cplusplus.patch
new file mode 100644
index 00000000..7b01afe3
--- /dev/null
+++ b/sys-apps/attr/files/attr-2.4.46-ifdef_cplusplus.patch
@@ -0,0 +1,24 @@
+diff -Naur attr-2.4.46.orig/include/xattr.h attr-2.4.46/include/xattr.h
+--- attr-2.4.46.orig/include/xattr.h 2014-01-21 22:14:56.418790180 +0000
++++ attr-2.4.46/include/xattr.h 2014-01-21 22:14:19.626788123 +0000
+@@ -31,7 +31,11 @@
+ #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+
+
++#ifdef __cpluplus
+ __BEGIN_DECLS
++#else
++#define __THROW
++#endif
+
+ extern int setxattr (const char *__path, const char *__name,
+ const void *__value, size_t __size, int __flags) __THROW;
+@@ -58,6 +62,8 @@
+ extern int lremovexattr (const char *__path, const char *__name) __THROW;
+ extern int fremovexattr (int __filedes, const char *__name) __THROW;
+
++#ifdef __cpluplus
+ __END_DECLS
++#endif
+
+ #endif /* __XATTR_H__ */
diff --git a/sys-apps/attr/metadata.xml b/sys-apps/attr/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /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/busybox/Manifest b/sys-apps/busybox/Manifest
new file mode 100644
index 00000000..cb75bf55
--- /dev/null
+++ b/sys-apps/busybox/Manifest
@@ -0,0 +1,37 @@
+AUX busybox-1.19.0-bb.patch 908 SHA256 98f92c2edbcf61d1bacef783ea8b08cce07051b0a4489ed3f4579296846f89f1 SHA512 d4024e531ce7113cf554646608b1ef356e51691e3e21d165621b3690c82b56a319867b90d9daba548b635d9dbd41be5efea63181b7123d4505e529d863a8214c WHIRLPOOL b0d6d9b08ad0930e5243c7addc8a6db61505e95ed8e72c64fbfd734cb6ff9e303b3eb8ea6ec4790b2be567783664230cf278eb3e673fa0844c3881cf993f7cb8
+AUX busybox-1.21.0-ifconfig.patch 281 SHA256 81a8ea4471d2d0c6b925878b7276ad9837d2d3fda2db0669a4934c63f8d42c43 SHA512 5a1d6a20a349562cc217663aea91c494703725f80e46a4fcf81bff2ed6940a4080f2008b9216f73b75c80c7408f933743d6b783da5b780b5731475dace85832f WHIRLPOOL d1f0219f407acdf131a33db01c0fb74dfd42d56e180feb7c549fb2867b4483e6255ab0bb9651f35f4446bd9159167b33086e5599a2e4b88f52a79821c6401a48
+AUX busybox-1.21.0-iplink.patch 401 SHA256 f3ef2c9294c83860fd1dbd10cd40347118b96d42e60a4a8cb12d76a19215ceb0 SHA512 45a13ca6749771319414090a86fa15644e57062641cdaf7b908136125aad6cb25628c85830b150392debb87992f386ece9ea3a730eee72a5e5727655429f451b WHIRLPOOL 64cf91527c39f0dd3fb8d2bf35df6c82d0d470a00aa98c3d680d7fb63a986885f6f834785d27afda7131a8fa46381a285be57b5ef7d22a4691b459dcf330e994
+AUX busybox-1.21.0-mdev.patch 1173 SHA256 911371ceff8c6a899323cda8d63a20b5f98d503681e5617b2448b555c4fecc61 SHA512 490a9a85d6df17e0111ad86f420207fed1b699b3b4e9ebe8d6700d4ce33ab3de0e0137dba1326efb5011dbcd53c769448ddab855995c896135ed6adbe61d2e44 WHIRLPOOL 2a302d310a6e82f3aa1c878a14fc4d2b1644d4e724aae1e25c1390cbd3852d252a38c76fd38fc79ee4b08d8f83aa2a442963955fe49486a28c060d1d4b6edc47
+AUX busybox-1.21.0-platform.patch 1227 SHA256 ee7b96577330a68598d4ec48ce94f6eca3079c32a86cca32f3bb6cc28d467654 SHA512 595e1081dcc9f2dca714066c1f59659d7c7e3f702df937c138ff60cf9af42272b71ac354521c3abd26ac406eb07a710c14c4f94e62a293edcd6473ba1fd53675 WHIRLPOOL d18661bccd8f43bc4fcb492013a647480ff4e0e88a1ac8ea9a1a3f176193363bfbd7777589b2796ccdf92315cd80a5d6999a321dafc441f4939546d6272002eb
+AUX busybox-1.21.0-xz.patch 2647 SHA256 c807f73718e836a81ee74987306c72297ddba209038240f81fab96b4a28b73b4 SHA512 696dd31a73bbd919435a3ee1b8cd05769e6c3a45e853e3e052a22b7290bf332cd3b7e17e394911864b3c7ed7f9eea604dfbd7a5c43f0eb1e65b257d679fcccd3 WHIRLPOOL a3be95e60602374daff1629c38556f93b2342d81939afda86613f5fb0af0f7b600656118712ac33237cba230369f622a18502347e1dad0aa3570dc1d0a1725f1
+AUX busybox-1.22.1-ash.patch 344 SHA256 c3b5b5c5522fda8014b12a23c370d7f70f6d1625fefa93a62c5c14414528ad12 SHA512 297736a2b41badba50a64881e20778e05c9df5f6fed5cbe45cf8c5a31e5486a5fe85ce00897c2ef0c60787cc33467f03fc586f39945f513a7caeaea57aafc8d7 WHIRLPOOL bea756e5335b2ebcabb487b9a4f64e1aae0cf9a4652ed3bbab5232b31fb5730cdb726a152f1ef494aaaacc251a24a30c40bc89485d2b008eb56290f88008ea4e
+AUX busybox-1.22.1-date.patch 1008 SHA256 8502dd7454e948a56fcd8201f4fe9d629d2844b9df2bacff7ee0bb09398d12e8 SHA512 0836ef682e24fc0e6d660d0d835200d5f4cd863691a6b58d071e40d001923664389f61670037140c2f95deb2080a93c989037308c761ac9304165d83cbfd3d34 WHIRLPOOL 58b93b0553e81f98c49503bfec33f473c1a7cde2ca3110e96c0d80f45d458c98b5cea1528637b4d9bbbb3df4de6e074446d43cbeeee285cec3ea52a352c374d2
+AUX busybox-1.22.1-iplink.patch 425 SHA256 186b41734e43ee117cb367055ce6a4d5b3aac671c09d71f2a6347793874d653b SHA512 f213d11c842841a5b7a6c8b1ffb38719eb038cde220b06f8b5419e63998e21629b0e3f481ad7549d67a764e113abe524d8a7fa0fd9286b8b355a1f20211fd889 WHIRLPOOL c87b1c0dafab79fd707ec22d7540de939595d3fb6665df2c20e22059b4c675fab1d5f81353230e1a172a9fc618c766db32c8e0c35913f160a06224cd13de47a5
+AUX ginit.c 3097 SHA256 fd6a4715d3dd10f6db479020433da3997d397658301335c847fb779129238b8c SHA512 8bf70f13db0fbeecedf9a9f862c5391c0d8b7aa3ddd2ec85cda9b360c3117a01e32b01017b8c30197f587e521ba360ff70d1caf8d0f69d5c3a27f37ecc252e7c WHIRLPOOL a1ec3ccc296033d88a9504b693c7d249d0bd11b1d75e3f59a62137c5e4b4c914fe2b8971c86dbca2cc8ccc0d86f3f8c2c45bb44cec85a3628c44f091476baa92
+AUX klogd.confd 218 SHA256 737b78745964e110da2fd3357c6d5fb80ccacf979039b8d40c03cf1cb969e5f3 SHA512 3348d5376b368b28d1431692a93868cd4550be12ad729340c5f78da35a5bd295e7613d70ce8ccde5029ad6d87a41c2f24155180f3570de8a9174dd63dece143f WHIRLPOOL ea28c1d926e36fba0ab69de8ddfd2503889b7cfa3a4ada347a9d22d9894fe30be068c0ed55f899b952e62b8de3cb69e1a4209f7864787988ded28ede10c7445a
+AUX klogd.initd 359 SHA256 ef607b72d270797e4be1fba425c23ba26078633c47c698063bd4b17e7b4ff8c3 SHA512 e9d6215e4b0dcc4fbb507ce2bb84c818ad18951282c47c98b0c98b3fa58e6b28218f608689a7786cb0447673ae1f5c3ba5767f9b29cffd73325d93bf2a928ac9 WHIRLPOOL d7e82a0d2a6a60b2444a3b212022250297ca163001045bf508442972fc6330c4eea55cb965920778e090c92a69441e864e6721f02ecc6d10279b6196b14f7e71
+AUX mdev-start.sh 2758 SHA256 9904263c8dfe2b8c3e968a9b4245fa0c162a2413110c037cdd797ac3773587d7 SHA512 532ececdf40769e8059172b95f600c92ddda9490dcf04dc76b11cd669b2b35740aeb02ef7c152a42c13d5adfefb391de01239ebbb4efd06faadc0d096fcde6f5 WHIRLPOOL aace77a07eedfea3ffab029ce25334ff58f512bf5c67512c1f4a40fd51278c2b8b764e55dbf975f74bb4423cfc3f35482a5d3ee8397032fcbf22ad1f91c7c4ea
+AUX mdev.initd 978 SHA256 a7126916ba17b6d0c12dd9a0428e5ca27c229856cca0a497ddd12de33d345f68 SHA512 280d9004520acc7c23a8e68e4fa8516de99c5389b4c6ee1cbb7cd17bc328a029b6d56aefc35a2062fcdea76c27a7229b3bec8fc28043bbc04f6f84dc0aaaa706 WHIRLPOOL a3a3607536b62414eedfeb4ce2b5c22ff864309e50b7eb4a9a4f3c59d4808596541071f3fb7664202336b542fb89b0234ba3f43bee460175c17d804d50ad45d1
+AUX mdev.rc 282 SHA256 e52abbc3399fc85ce1f097e8f12b25a5ca7fe2e3d648bee60c061b547ba39dc5 SHA512 b3e5f0810a5e33047ea73c6a4d846087100fb8c566cfa001e07fc0c1448d2024913ac06355122076ec6c79146867af77a02bbc6509b009afa97b5207588da1b9 WHIRLPOOL 2bd20507d115c82076653c6c78899751f8e3b8cde14c81c8f10ef7747ccba867360b463c90b9b3053cd6cb8599f297362153ebbff0dfad90c2fac8f445668320
+AUX mdev.rc.1 2202 SHA256 5235a2cd5e4ce92032a5e3e314c6e2980d98df8a6a387d2cf3e0d30d29f62cd5 SHA512 27435ac949ee351aa957f23a31b08f8689f284449928fba495f9432c893e30cd8ab8f883ee131626310f09e9edc615908484c7402009df3cba3a6eaf137f8afc WHIRLPOOL 54c23164ed320efe654d36656bd4be2be383199c003a57806a850692b38556d4f961b9608c1561f16fa108bac64643ab2270a8a1a5edf8e5d1e24a967f549b76
+AUX mdev/dvbdev 356 SHA256 ef091bb4c8943a99b9a97b556cdc15ddd20275f5afa8287e201419b08c4e71de SHA512 ebd82f935da2ca89097234dd8a8f47e179a423652c151123a1f3343f3e1e7bfaba2b8800380e988d4e8f4294545d3a9ab6708ae2e77c5b108b5f091bbce8f94a WHIRLPOOL ec24a4afe8333e2d4d856fe3853b844d113057daf3fe536a4c8ef481a5ec925254c7daeb09df378922fabb96400440f4bde40979417b7c35467934d7e2235739
+AUX mdev/ide_links 440 SHA256 3fccc9ee437e3dcc8ac73bfe3713334a7156a112fe442e052fff4f26ff0f6a88 SHA512 0142234d0bda86ad1e5f88f1da34669e5fda46a0fd52ce507bd49ce74d2b7c12c323e8db863bccb924e6d632b568db8b243361b217c5b2e1d92a25feb6e62dec WHIRLPOOL ce02358a65ad2beeab12485379e322736c7b6b58ff44a20b880d9bab8806e04890a385b94228f2db685150dfe0a3c716f842ce5c1c7f579c8208ab4e9a6ae852
+AUX mdev/usbdev 1624 SHA256 113ecaa722fa1f4e1c76489e2a7b24099778615a5bccd443aa9cbab28c6d05d0 SHA512 f2d98050eeeb2fbb299298e221f47182a74ed901d2c8c848aa297ebd461c62c30d2fb968bb3eb723a6d9c268fac4a3c40a18aa59ed934043d42c38a1f6b9f5a2 WHIRLPOOL 9b773cb41827bf5777061ec7ed432315bc5bf070768a44ceec7c893af2266d8c06ea4c061711b2696a8228d72c7222fbf52d26fb92b4112158716727b3bc1e38
+AUX mdev/usbdisk_link 984 SHA256 c72cdf4bfde9a8f8334a9d6bfce2a468c926a5530532b8a16a13a63d798abeb3 SHA512 05bc589f067cf988f97f10def3c05e139ac4f4ebe045bdb4c2f5453f5e672bf61d3dc1636974c5680c8c9cf22498bee9cfa28a8f4a264d9f5b10a72a9da0ca16 WHIRLPOOL 03f71c6ce87ea19d9b78615e06adbb5ad73e05b2e3dd69d28092df5e961aea2d06db6c97389d000d20b42b0df241a5e8a7f23056d0f40c5cde0557ce7fdf1fcc
+AUX ntpd.confd 186 SHA256 4bff7f5c66f4eece52e4381fd2706e591f10eb50f3c3a4132344d34150dc54de SHA512 b0ef111ea7dd6a096acf711d2d84a7c3d38e7e8c181f734053d38c565ab44ecf843ef32c0de0c4e7ecec990e97468a2545f83821beedb125cd6723ed74c67ad8 WHIRLPOOL a1b228ae22c61de6ecc7fa58edcd4c3941b3762a45fcc38d05bd1c9428bc553b1a158c101d65a99ba63d4bc19b269e834b3f0eba40a5a1c81e0ae876a2ecb42c
+AUX ntpd.initd 372 SHA256 66266f86f65a5095bdbcba4d8ec5893b086849e4dcf43dab81b2bcc5970f8e35 SHA512 4daec8c17e2d89abc386178ac172092b682b46d74dbb43c20bc9d0723bede720bc7dc5e90c24b33c6a7344d58f0ef43aab2fc331343ba12e69ff5446ac2a1345 WHIRLPOOL 4e92d44c95ae93622c838b4e0221e3d201983b649a50fe6ffceaab020aad7ec88024f66c9d9cbe044345af48bed81a1b985a8ed00df79bdf08045f9394add4b9
+AUX syslogd.confd 234 SHA256 65166088cb173582200b8c0d3bc6ea339b5929dbafa816780bfaf50e3514bc25 SHA512 01a2ecf89c49e3e06dd1b6f6673fca16d0f2dd01ff27c0d609c803bc2c81b5ced8245b6388e48ffa2f05ff4e8c1824af73df6364bbebebc722166447bd412f52 WHIRLPOOL b0a9e82225968d44446025242ac6c9429dc2e01a3720d94349756f71ec3a11c3ff2217bce7c4f1a1ea8a2a8baecd3265c3cce01675138674c05a9f2a96ade2ae
+AUX syslogd.initd 383 SHA256 b66e709317513b79139d5441c712839e271ff5177a3d743b86e39f70906fe2ee SHA512 b6bd8b7cb990c7c9c242baf4b3d20b3351e6ca0054b6d231787540b318ea9ac2332ac97ae4b56d07d2cf9ae52fb9c1644dede47bbfdd9f8bc7727bcfd0da8ed7 WHIRLPOOL 4b7a3e4ad7cc9e07853cc0e43b8f15aa0cb71642afeee89392190ba75d547e156ec4b790f8e35e56851bae01ff3965ef36e9160bf61aae95376c9fa2189f11a7
+AUX watchdog.confd 232 SHA256 786d9497ad55c29d6fff231709e71ecad94f2ee1de3b45b461deb29c3eba1c63 SHA512 8fd7121075535195f3e5d43ec773713c883fb7865cd5e5927b3b20c2605c50acb81d50461bd1a246c1282006ce74b11932ac1cec67ddc2be15da2f9aa8674232 WHIRLPOOL 8ea0f6b759198c978f10bf0b2b00cc73343e72401a05edf257b9c5e1032e8a619328aaa02936b5b5a717a021baa84b5653b8c9826e14e5c07c7b7af98f878767
+AUX watchdog.initd 334 SHA256 ae335a9540d282277d0a127673efff279177a1bb643e98afd772eef9423fe79f SHA512 e915a2b5567b1cfe5423b00ca984c37dea4afd72bc3b7a550858f7140dc18283831bb9cfeeb564ced2669706cf747f3934fd339f9e93d456b229b03781ac9303 WHIRLPOOL c57eaf47d0501394f2f08a6b6f09529f91fd34f3d5027f6e159573ea8c5321a88c2cb01511971d15f8b25c9a44693c88e340ee35949c4cdab49d7fbbbe064c22
+DIST busybox-1.21.0.tar.bz2 2200841 SHA256 eb9d268627783297f5f459cb9bd61a94e395dc7cb3647e10ec186e0159aa36ed SHA512 ddafded24881f03db550d9793585bb5442c70f2a60a5d9770126f50981dadfe95fc0b280f83d5b8a8ce21c86bb7ce64e9f1a606cea140fb2f2599a21de55ba31 WHIRLPOOL d50378bb823dd59e8a607ed6a72d4890f4e5ad3304f1ddba9f7f3d49b5ab820acc9daa2b3c4619f8b147dec085c53c3c6f4b4ebe4c60b431299031d2af00a4d3
+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
+EBUILD busybox-1.21.0-r99.ebuild 8588 SHA256 f7e1429315ca4ce61ef7d64f4661531c27f41d2b59692ca99ea7172a97d0f4e3 SHA512 c511aa8f5b8760fad79afde3fec71bbe3c32b5786750fe20c8448af88b96ba99b24f7a949947dbf9a9e9daf2b65a70d5a8a4be24a33ac88d096eca5743979ed3 WHIRLPOOL 7598961b898f6cef190e1419772955bdb036dace22aa48947adfa665e1f0052b949c429001c4495b46e576acf8e5681dd5ffeae0074701238a216a8d9670668d
+EBUILD busybox-1.22.1-r99.ebuild 8594 SHA256 fa0e6eee8c7759c8ac82355df9702132ccbec39dc38fb62cd8f211ac1bc10928 SHA512 67a43091a833dfe6b35f58d25028206ec69acbf5a395ff43087881af49fb66c96ed693995aa13855c5b333826dbf6acdf4b666b3b008c0f873874a3d3140e09f WHIRLPOOL e3cb3d0fd69ecb53ff140332b896351a13b037a57bfb1d05c1f714c4918eb47194339b3cb9e3543bf95ba21374b0775df87a090a6303027099b8a8c92c28805c
+EBUILD busybox-1.23.0-r99.ebuild 8650 SHA256 842aad5a812f0442db537949e3aecec3a0ad18624bf7d5c8a2e8f7b197f2aca5 SHA512 625783b4b3d9c18d7e84389c6d405ae2e3a81a049c686fa9fae54a02a6fb468bbacdd6b9930d64be35bd32e3aa81d0a149d195b3941269b55f9864c446a0af82 WHIRLPOOL e5937cc929f06cee0df09742bef8374b4c5da3006d862dabcbcf32cdee55df5e26547e5fcad3075645dba32619021678c550560d386a18e31dd3bbdd3d8bb628
+EBUILD busybox-1.23.1-r99.ebuild 8787 SHA256 97a1ae68fbf5ba706133b5762aaa0e0058a82910cdd5af6ec18a04d0b682490b SHA512 033a6ae2c843bfcd1797688d2bd3ef3e95f7236e2a9299e7cdce832ca4cc4bc7d1b0bfade57c476d5d9a574af59dd5f19a3feac148d3407ab61eab18b34356f7 WHIRLPOOL 6f4d6404a8ea710e303d33e71bf511992f3a51573eef40f1401f6220a5ba6e09f5f4ef8c84f8a0b219007f4cd8e64a7e8cca57bd90a8c0ecffce68c10098cdab
+EBUILD busybox-1.23.2-r99.ebuild 8787 SHA256 ead09859c4cfbb4c6a5ad0d7806f59382e59cfe51e85bf9053beed4920b40400 SHA512 a3fa1fc0dea7f6145374153f92891711a68d800409adfdb7e06dff45201505331da7c2d35513ddc0a4b71393127abd3782863eb3b2077c5d14a5bd9279342a82 WHIRLPOOL dbb5ea28bd7780028ad60331801351f6507aba9788ab5b021a6bb75cd179a58a6273abfd77cd64506fca3b89d348253636169182461364575dbc8fd18fca5e8e
+MISC metadata.xml 708 SHA256 e17f2240f57d74f8847e7bbf4e3cf44fdcd3ab3f610e0a66eb186d2a598178be SHA512 0d26c0593b156cc5764ad03c64e9b2a724b3877e348787d57818aec6b32f995951a9c0976a92d6ba824a2a5983d0c88116b9d335e51ba0e3c7b8f89e579482ba WHIRLPOOL 2ab4758748cf6d83d1a3a1d2f5f9472825a01affe5c7fdf8cd78fb9c75a1abaf18d8895fce12c7c502453caf68dd40799f47cce502804c9ec60705af2bb4f388
diff --git a/sys-apps/busybox/busybox-1.21.0-r99.ebuild b/sys-apps/busybox/busybox-1.21.0-r99.ebuild
new file mode 100644
index 00000000..dab62580
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.21.0-r99.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.21.0.ebuild,v 1.21 2013/09/14 10:38:45 ago Exp $
+
+# 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="amd64 arm ~mips ppc x86"
+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
+
+ # turn off some options causing trouble with musl
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+ busybox_config_option n IFPLUGD
+
+ # 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-r99.ebuild b/sys-apps/busybox/busybox-1.22.1-r99.ebuild
new file mode 100644
index 00000000..da1fea12
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.22.1-r99.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.22.1.ebuild,v 1.2 2014/02/02 08:17:37 vapier Exp $
+
+# 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="~amd64 ~arm ~mips ~ppc ~x86"
+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
+
+ # turn off some options causing trouble with musl
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+ busybox_config_option n IFPLUGD
+
+ # 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-r99.ebuild b/sys-apps/busybox/busybox-1.23.0-r99.ebuild
new file mode 100644
index 00000000..cdc38d18
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.0-r99.ebuild
@@ -0,0 +1,305 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.23.0.ebuild,v 1.4 2015/01/17 03:11:56 zlogene Exp $
+
+# 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="amd64 arm ~mips ppc x86"
+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 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
+
+ # causes trouble with musl
+ busybox_config_option n IFPLUGD
+
+ # 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-r99.ebuild b/sys-apps/busybox/busybox-1.23.1-r99.ebuild
new file mode 100644
index 00000000..14887a0c
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.1-r99.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.23.1-r1.ebuild,v 1.3 2015/02/08 22:35:39 blueness Exp $
+
+# 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="amd64 arm ~mips ppc x86"
+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
+
+ # causes trouble with musl
+ busybox_config_option n IFPLUGD
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+
+ # 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-r99.ebuild b/sys-apps/busybox/busybox-1.23.2-r99.ebuild
new file mode 100644
index 00000000..98f537d7
--- /dev/null
+++ b/sys-apps/busybox/busybox-1.23.2-r99.ebuild
@@ -0,0 +1,308 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.23.1-r1.ebuild,v 1.3 2015/02/08 22:35:39 blueness Exp $
+
+# 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="amd64 arm ~mips ppc x86"
+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
+
+ # causes trouble with musl
+ busybox_config_option n IFPLUGD
+ busybox_config_option n EXTRA_COMPAT
+ busybox_config_option n FEATURE_VI_REGEX_SEARCH
+
+ # 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 00000000..a66b45a5
--- /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.21.0-ifconfig.patch b/sys-apps/busybox/files/busybox-1.21.0-ifconfig.patch
new file mode 100644
index 00000000..bc74904b
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.21.0-ifconfig.patch
@@ -0,0 +1,11 @@
+--- a/busybox-1.21.0/networking/ifconfig.c
++++ b/busybox-1.21.0/networking/ifconfig.c
+@@ -56,7 +56,7 @@
+ #endif
+
+ #if ENABLE_FEATURE_IFCONFIG_SLIP
+-# include <net/if_slip.h>
++# include <linux/if_slip.h>
+ #endif
+
+ /* I don't know if this is needed for busybox or not. Anyone? */
diff --git a/sys-apps/busybox/files/busybox-1.21.0-iplink.patch b/sys-apps/busybox/files/busybox-1.21.0-iplink.patch
new file mode 100644
index 00000000..80d8e5d6
--- /dev/null
+++ b/sys-apps/busybox/files/busybox-1.21.0-iplink.patch
@@ -0,0 +1,12 @@
+--- a/busybox-1.21.0/networking/libiproute/iplink.c
++++ b/busybox-1.21.0/networking/libiproute/iplink.c
+@@ -5,8 +5,7 @@
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+ #include <net/if.h>
+-#include <net/if_packet.h>
+-#include <netpacket/packet.h>
++#include <linux/if_packet.h>
+ #include <netinet/if_ether.h>
+
+ #include "ip_common.h" /* #include "libbb.h" is inside */
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 00000000..cb873faf
--- /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 00000000..9be6cb8f
--- /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 00000000..56ba1a27
--- /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.22.1-ash.patch b/sys-apps/busybox/files/busybox-1.22.1-ash.patch
new file mode 100644
index 00000000..301e9428
--- /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 00000000..6380d878
--- /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 00000000..dbd76c57
--- /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/ginit.c b/sys-apps/busybox/files/ginit.c
new file mode 100644
index 00000000..de98e4ac
--- /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 00000000..4c16096a
--- /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 00000000..4c6dbbc5
--- /dev/null
+++ b/sys-apps/busybox/files/klogd.initd
@@ -0,0 +1,12 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/klogd.initd,v 1.2 2012/12/21 03:15:28 blueness Exp $
+
+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 00000000..8784cd55
--- /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 00000000..2a61f99b
--- /dev/null
+++ b/sys-apps/busybox/files/mdev.initd
@@ -0,0 +1,53 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.initd,v 1.1 2014/12/30 19:13:42 williamh Exp $
+
+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 00000000..5470404a
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.rc,v 1.1 2010/08/15 03:55:29 vapier Exp $
+
+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 00000000..569d5407
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.rc.1,v 1.2 2012/09/26 21:25:23 robbat2 Exp $
+
+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 00000000..f0186c17
--- /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 00000000..be0c95aa
--- /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 00000000..ea5b9155
--- /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 00000000..6bb06924
--- /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 00000000..f50d4c2e
--- /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 00000000..5a05c31f
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/ntpd.initd,v 1.2 2012/12/21 03:15:28 blueness Exp $
+
+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 00000000..7df6885c
--- /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 00000000..f14224ae
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/syslogd.initd,v 1.2 2012/12/21 03:15:28 blueness Exp $
+
+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 00000000..bd6aec0a
--- /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 00000000..214468a2
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/watchdog.initd,v 1.3 2013/04/27 07:47:23 vapier Exp $
+
+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 00000000..72850fbb
--- /dev/null
+++ b/sys-apps/busybox/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>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>
+</pkgmetadata>
diff --git a/sys-apps/findutils/Manifest b/sys-apps/findutils/Manifest
new file mode 100644
index 00000000..a3b698bc
--- /dev/null
+++ b/sys-apps/findutils/Manifest
@@ -0,0 +1,9 @@
+AUX findutils-4.4.2-gnulib-date-x32.patch 1210 SHA256 004a9d3a28ac727fddf3e54fcf2846aab90b30f29f40f8ff32b19742539e85eb SHA512 51bd15305d12a93f2a83faa359d1a2501fd96dea2c8dbed25cafa60c5d7f17b7a86d2d7dd0095dc0a6e0c1e9eaf2775bc6e1ceaadbdf5e2ffbaab6a4a4b9ff60 WHIRLPOOL 7c866ac607fd7c9311160e398ccd98e593f69833ca643606d0462f2b125fce616249a8a0063f2514cd573542e5563539164a1527f3b02c1f20234880d287f258
+AUX findutils-4.4.2-gnulib-musl.patch 646 SHA256 65ae9c84a03b200b742a7e2eed785e7fe7ab3f045ae7151ad2b7e6209ed2fbe5 SHA512 900cf211161ce05d29c17f7e7a264615f616c94f4273d3733ca9ccf0678d911434bf2ff80fed5e13939d748d6cd13c8dab6e2c94be935ea5f1c3e1e6f5b7b11c WHIRLPOOL 5babeecf4d40117ab9086a73d1d311eca7139239e71ed1a7aef59339cf42a76f647dadeabcfc3e9f4a387de2180987040b496806487ab2aac22d45575cf4f7ed
+AUX findutils-4.4.2-selinux.diff 15603 SHA256 67de61c659f8d524b70ebabafe25093c02374b1fc83770dd5633480745e2ee9d SHA512 5fb4346b56cab0a470358e75c4c4a57f6709f7a987b1e6887242b9a4f241590adcaba7061d71752a5d2f8ac3598ecc1dffdb92b2bc072f5f31152088b88ed7f9 WHIRLPOOL 612394c54d4095c6cd9d0dc326be2b5b6ce41e43cd3dc8e3cd2a4e99a0844aec769373243c62398df79d6f7561f865754b627917b5f1733d6b065b7e3ce7be35
+AUX findutils-4.5.12-gnulib-musl.patch 4945 SHA256 52ab4e59bad488d9fe2ea64e68e08b90128fd1d8ef2171b160449950f99b0177 SHA512 8137a3d33f4b8612b91db07e4219bfa6e66209783387b50ddbd78dde548f0679d92ff834d6ac2ad1805d7303e25c93d089b86ec66363cec11afc447e095e8dd3 WHIRLPOOL 9d1d8489f7fbe982bca49c9e0155e339d7d91d5763883921139f6504e621a96dd46383e4e0e35273f5033944a430efd82e7b94c3318bb4432cdaf72b08968ef5
+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
+EBUILD findutils-4.4.2-r99.ebuild 1439 SHA256 54565a9da76fa50f6af16fc8aec6ff7bb0696ee689ba8be72143b09fd8802176 SHA512 cfa4339cd8315c208ceb2e72ad488661936e9aace744eae6b037984cf9351eba8d0269bb6832f11f096e795354b57143489246a7279df9a00764b7363f131b43 WHIRLPOOL 150b650ac57083e2f52d1b7c4eabd6c820e2547d383347197485bea3d27bc50deb1144b33cb27b6c21f74445b21c7f1afb1f57127161730f7100e44755bd4cf9
+EBUILD findutils-4.5.12-r99.ebuild 1453 SHA256 969c9c10bedc2e2906917f7867212e629c2c482ca23705c1c7a61bd03671509e SHA512 4b9c1a712dc43dc2a707587dd6a299021e13cf0d9c5cc7f7a7390752b4e6da486fbb1f45fa5ce81ed321514713a47c88de7186c8791a152880b1906f08d99408 WHIRLPOOL 05fcc0cc44e61614b0dae52771956d5c650a8a89ccc49083ec73afe26e9549a59ba4c6c7ae62341a247fc04bce17a6f54cb9fee75207d1de98aa915af5abb4a0
+MISC metadata.xml 247 SHA256 c1aace970507b192985f753f5b6d6b4f909284fa2e8c9a6492c9d29651476bab SHA512 e42648aa29d9aaa1125770a5f89c68ede330e90c64562942f8cb64d85471cc8176f2ae10c1dad00230b4fcad3a65eae92676c6fd8a43c1bf8985e9ee8ac8fd29 WHIRLPOOL f8eb5d248383ef10b836b0a9ffa9154bb8f38d001813ca727ffb0d07ffa9234eee323894831b01144017cb8b43400dd910b685babf75ebe10a2615dc94999e08
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 00000000..9ff86f6b
--- /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-gnulib-musl.patch b/sys-apps/findutils/files/findutils-4.4.2-gnulib-musl.patch
new file mode 100644
index 00000000..0a47c907
--- /dev/null
+++ b/sys-apps/findutils/files/findutils-4.4.2-gnulib-musl.patch
@@ -0,0 +1,18 @@
+diff -Naur findutils-4.4.2.orig/gnulib/lib/freadahead.c findutils-4.4.2/gnulib/lib/freadahead.c
+--- findutils-4.4.2.orig/gnulib/lib/freadahead.c 2009-05-10 21:23:57.000000000 +0000
++++ findutils-4.4.2/gnulib/lib/freadahead.c 2013-07-06 01:54:25.443043832 +0000
+@@ -22,6 +22,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
++#if 0
+ #if defined _IO_ferror_unlocked /* GNU libc, BeOS */
+ if (fp->_IO_write_ptr > fp->_IO_write_base)
+ return 0;
+@@ -63,4 +64,6 @@
+ #else
+ #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread on your system, then report this to bug-gnulib."
+ #endif
++#endif
++ return 0;
+ }
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 00000000..66c9c412
--- /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.12-gnulib-musl.patch b/sys-apps/findutils/files/findutils-4.5.12-gnulib-musl.patch
new file mode 100644
index 00000000..b5538019
--- /dev/null
+++ b/sys-apps/findutils/files/findutils-4.5.12-gnulib-musl.patch
@@ -0,0 +1,132 @@
+diff -Naur findutils-4.5.12.orig/gl/lib/fseeko.c findutils-4.5.12/gl/lib/fseeko.c
+--- findutils-4.5.12.orig/gl/lib/fseeko.c 2013-09-22 15:27:42.000000000 +0000
++++ findutils-4.5.12/gl/lib/fseeko.c 2014-03-01 13:35:14.718973449 +0000
+@@ -26,128 +26,6 @@
+
+ int
+ fseeko (FILE *fp, off_t offset, int whence)
+-#undef fseeko
+-#if !HAVE_FSEEKO
+-# undef fseek
+-# define fseeko fseek
+-#endif
+-#if _GL_WINDOWS_64_BIT_OFF_T
+-# undef fseeko
+-# if HAVE__FSEEKI64 /* msvc, mingw64 */
+-# define fseeko _fseeki64
+-# else /* mingw */
+-# define fseeko fseeko64
+-# endif
+-#endif
+ {
+-#if LSEEK_PIPE_BROKEN
+- /* mingw gives bogus answers rather than failure on non-seekable files. */
+- if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
+- return EOF;
+-#endif
+-
+- /* These tests are based on fpurge.c. */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+- if (fp->_IO_read_end == fp->_IO_read_ptr
+- && fp->_IO_write_ptr == fp->_IO_write_base
+- && fp->_IO_save_base == NULL)
+-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+-# if defined __SL64 && defined __SCLE /* Cygwin */
+- if ((fp->_flags & __SL64) == 0)
+- {
+- /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
+- mode; but has an fseeko that requires 64-bit mode. */
+- FILE *tmp = fopen ("/dev/null", "r");
+- if (!tmp)
+- return -1;
+- fp->_flags |= __SL64;
+- fp->_seek64 = tmp->_seek64;
+- fclose (tmp);
+- }
+-# endif
+- if (fp_->_p == fp_->_bf._base
+- && fp_->_r == 0
+- && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
+- ? fp_->_bf._size
+- : 0)
+- && fp_ub._base == NULL)
+-#elif defined __EMX__ /* emx+gcc */
+- if (fp->_ptr == fp->_buffer
+- && fp->_rcount == 0
+- && fp->_wcount == 0
+- && fp->_ungetc_count == 0)
+-#elif defined __minix /* Minix */
+- if (fp_->_ptr == fp_->_buf
+- && (fp_->_ptr == NULL || fp_->_count == 0))
+-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
+- if (fp_->_ptr == fp_->_base
+- && (fp_->_ptr == NULL || fp_->_cnt == 0))
+-#elif defined __UCLIBC__ /* uClibc */
+- if (((fp->__modeflags & __FLAG_WRITING) == 0
+- || fp->__bufpos == fp->__bufstart)
+- && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
+- || fp->__bufpos == fp->__bufread))
+-#elif defined __QNX__ /* QNX */
+- if ((fp->_Mode & 0x2000 /* _MWRITE */ ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
+- && fp->_Rback == fp->_Back + sizeof (fp->_Back)
+- && fp->_Rsave == NULL)
+-#elif defined __MINT__ /* Atari FreeMiNT */
+- if (fp->__bufp == fp->__buffer
+- && fp->__get_limit == fp->__bufp
+- && fp->__put_limit == fp->__bufp
+- && !fp->__pushed_back)
+-#elif defined EPLAN9 /* Plan9 */
+- if (fp->rp == fp->buf
+- && fp->wp == fp->buf)
+-#else
+- #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
+-#endif
+- {
+- /* We get here when an fflush() call immediately preceded this one (or
+- if ftell() has created buffers but no I/O has occurred on a
+- newly-opened stream). We know there are no buffers. */
+- off_t pos = lseek (fileno (fp), offset, whence);
+- if (pos == -1)
+- {
+-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+- fp_->_flags &= ~__SOFF;
+-#endif
+- return -1;
+- }
+-
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+- fp->_flags &= ~_IO_EOF_SEEN;
+- fp->_offset = pos;
+-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
+-# if defined __CYGWIN__
+- /* fp_->_offset is typed as an integer. */
+- fp_->_offset = pos;
+-# else
+- /* fp_->_offset is an fpos_t. */
+- {
+- /* Use a union, since on NetBSD, the compilation flags
+- determine whether fpos_t is typedef'd to off_t or a struct
+- containing a single off_t member. */
+- union
+- {
+- fpos_t f;
+- off_t o;
+- } u;
+- u.o = pos;
+- fp_->_offset = u.f;
+- }
+-# endif
+- fp_->_flags |= __SOFF;
+- fp_->_flags &= ~__SEOF;
+-#elif defined __EMX__ /* emx+gcc */
+- fp->_flags &= ~_IOEOF;
+-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
+- fp->_flag &= ~_IOEOF;
+-#elif defined __MINT__ /* Atari FreeMiNT */
+- fp->__offset = pos;
+- fp->__eof = 0;
+-#endif
+- return 0;
+- }
+ return fseeko (fp, offset, whence);
+ }
diff --git a/sys-apps/findutils/findutils-4.4.2-r99.ebuild b/sys-apps/findutils/findutils-4.4.2-r99.ebuild
new file mode 100644
index 00000000..12c72e9a
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.4.2-r99.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/findutils/findutils-4.4.2-r1.ebuild,v 1.10 2012/03/27 17:50:37 vapier Exp $
+
+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-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc 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
+ epatch "${FILESDIR}"/${P}-gnulib-musl.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.5.12-r99.ebuild b/sys-apps/findutils/findutils-4.5.12-r99.ebuild
new file mode 100644
index 00000000..c3a869a6
--- /dev/null
+++ b/sys-apps/findutils/findutils-4.5.12-r99.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/findutils/findutils-4.5.12.ebuild,v 1.4 2014/01/18 03:28:44 vapier Exp $
+
+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="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="nls selinux static"
+
+RDEPEND="selinux? ( sys-libs/libselinux )
+ nls? ( virtual/libintl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gnulib-musl.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
+}
+
+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 00000000..b122af87
--- /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/hdparm/Manifest b/sys-apps/hdparm/Manifest
new file mode 100644
index 00000000..dff69752
--- /dev/null
+++ b/sys-apps/hdparm/Manifest
@@ -0,0 +1,9 @@
+AUX hdparm-9.39-musl.patch 1616 SHA256 c7033556b993570d3c326cd47e5fcfc1dd39e6b9b225c9527fd4bf339be76b75 SHA512 3310b600443e53ac9320e537b6b053c580d3a940619953ae7fc68aecd8e1e6b041988199bdd90ebacd174771eb92cf15be7caa2285b379cec48cd7aca7ea3051 WHIRLPOOL 5037ced4431880c61a0d97164517e5842c743d73fe7470722e39d38cd0d4690b7588d0e544b49d87c05d9980c431589afcc68e32d9814dd7edba3398e4f0458d
+AUX hdparm-9.45-musl.patch 1096 SHA256 8fc853886d40814cfcd21669cf261d122ed8f1903a2405c36f13943a3bb97da8 SHA512 2518f3e447bb16ff02e8bc0d0d219ce88be6c48ea26f86c5fad3848377867a3bb8421bd3e349dc03716a6d28c4d18d6e05586c4e1b2f82bd9288af24af746631 WHIRLPOOL c780dac1557c1147bbac4443191488a9fbcee03441f8d38570575ffda9ebdc3b40056a2de2595c3a7035f4ad6495f39f3929b4b0c3cdfdbdef23ccd533bc70a6
+AUX hdparm-conf.d.3 872 SHA256 37c95ff723fa578e9039613d09dbf790d99113a318c065422986c744519214e9 SHA512 968c6b9d26a71bf724728c259d35a499a644496875eac255dcac3cb4a7e5cadb677a4f6e5e0f8bbd7e1826b6fb77cb39af15b11d1e59b3e9daf9ba442b9e6f02 WHIRLPOOL 110d330860c4f5e3b1626b85ab369a02e5c092acf656edc845a2f311b5349644317ec2021063a0fb977d3b9851e0bb9c54fd66e814a080d6af3aa0f05fbd658b
+AUX hdparm-init-8 1469 SHA256 434beee81ba04c96fcd03e6b37a4578c2c25af2c1007368469c48dd37523d56e SHA512 f81100a4f06670639ac8c079a72028dbb0c1b6e5436e6c745c339612ad3287223d3307a40609625dd6904f737816e162af82ecc428d4405678ff0130d0f9752b WHIRLPOOL f0bb17c90466727a0a179928275a1abcfe6f669703a98a803395fe61de90aa7cc4c83b7f510cd1bdf8f44235cfcffe3c6b6a4182d7cfb6594be1b0f8936bab51
+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
+EBUILD hdparm-9.39-r99.ebuild 1002 SHA256 1856e129df57d01bef8b168fe55a038fdc4a253f161e235e8065ef59dacddc62 SHA512 0a948b0a02f171dc4f0f3c6f088b72aeca47b6d7f8af27b5a06b73e596d9ee7ce48071aedc0bb37e42d09e77088577471c4d41f5694e6a49f803deeb572f1ee4 WHIRLPOOL f41d0f15bf88d29fb112e38d95bec5de115749adb2493f62949bbb9271ef7a84ef8ea8eaf9f1ebf505a21862673b463c8d180ebf363967aae3e1fd7c674e499a
+EBUILD hdparm-9.45-r99.ebuild 1059 SHA256 610efd5b18638e667c955e064d896b2a76f7a354996cab3f9ce39371525f3c10 SHA512 836667acc79f9b7bd25867ac222f6565f9e2b55b0dfe20e57e06cb19fbed04523ee56a69cdd68c44924e99f5be6d55f33065a5c41f9a0deee19aa95653e99d7e WHIRLPOOL 362a12083b9d8088805bb205d2b359e01e9fc421904033f145f71f0cd7393007d6cfa5b665c72e77193ffcabfef7c4d8ac7e2cfe335691a4bc4212e105cad812
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-apps/hdparm/files/hdparm-9.39-musl.patch b/sys-apps/hdparm/files/hdparm-9.39-musl.patch
new file mode 100644
index 00000000..8c71bc76
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-9.39-musl.patch
@@ -0,0 +1,50 @@
+diff -ur a/hdparm-9.39/Makefile b/hdparm-9.39/Makefile
+--- a/hdparm-9.39/Makefile
++++ b/hdparm-9.39/Makefile
+@@ -13,7 +13,7 @@
+ CC ?= gcc
+ STRIP ?= strip
+
+-CFLAGS := -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS)
++CFLAGS := -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs -D _GNU_SOURCE $(CFLAGS)
+
+ LDFLAGS = -s
+ #LDFLAGS = -s -static
+diff -ur a/hdparm-9.39/geom.c b/hdparm-9.39/geom.c
+--- a/hdparm-9.39/geom.c
++++ b/hdparm-9.39/geom.c
+@@ -16,7 +16,7 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+-#include <linux/types.h>
++#include <sys/types.h>
+ #include <linux/fs.h>
+
+ #include "hdparm.h"
+diff -ur a/hdparm-9.39/hdparm.h b/hdparm-9.39/hdparm.h
+--- a/hdparm-9.39/hdparm.h
++++ b/hdparm-9.39/hdparm.h
+@@ -2,6 +2,7 @@
+
+ //#undef __KERNEL_STRICT_NAMES
+ #include <linux/types.h>
++#include <sys/stat.h>
+
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x)
+diff -ur a/hdparm-9.39/sysfs.c b/hdparm-9.39/sysfs.c
+--- a/hdparm-9.39/sysfs.c
++++ b/hdparm-9.39/sysfs.c
+@@ -12,9 +12,10 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <limits.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
+-#include <linux/types.h>
++#include <sys/types.h>
+
+ #include "hdparm.h"
+
diff --git a/sys-apps/hdparm/files/hdparm-9.45-musl.patch b/sys-apps/hdparm/files/hdparm-9.45-musl.patch
new file mode 100644
index 00000000..a9fe0aa1
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-9.45-musl.patch
@@ -0,0 +1,35 @@
+diff -ur a/hdparm-9.45/fallocate.c b/hdparm-9.45/fallocate.c
+--- a/hdparm-9.45/fallocate.c 2010-10-04 20:38:39.000000000 -0100
++++ b/hdparm-9.45/fallocate.c 2015-01-28 21:19:59.201795557 -0100
+@@ -27,7 +27,7 @@
+ err = EINVAL;
+ #else
+ int fd;
+- loff_t offset = 0, len;
++ off_t offset = 0, len;
+ int mode = 0;
+
+ fd = open(path, O_WRONLY|O_CREAT|O_EXCL, 0600);
+diff -ur a/hdparm-9.45/hdparm.h b/hdparm-9.45/hdparm.h
+--- a/hdparm-9.45/hdparm.h 2014-09-27 14:31:18.000000000 -0100
++++ b/hdparm-9.45/hdparm.h 2015-01-28 21:19:08.662427386 -0100
+@@ -1,7 +1,7 @@
+ /* Some prototypes for extern functions. */
+
+ //#undef __KERNEL_STRICT_NAMES
+-#include <linux/types.h>
++#include <sys/types.h>
+
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x)
+diff -ur a/hdparm-9.45/sysfs.c b/hdparm-9.45/sysfs.c
+--- a/hdparm-9.45/sysfs.c 2010-10-04 20:39:20.000000000 -0100
++++ b/hdparm-9.45/sysfs.c 2015-01-28 21:19:25.692214485 -0100
+@@ -13,6 +13,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <sys/stat.h>
+ #include <linux/types.h>
+
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 00000000..a1ae626b
--- /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 00000000..9a4200c8
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-init-8,v 1.3 2012/04/29 00:30:18 vapier Exp $
+
+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-r99.ebuild b/sys-apps/hdparm/hdparm-9.39-r99.ebuild
new file mode 100644
index 00000000..a7814a6b
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.39-r99.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/hdparm-9.39.ebuild,v 1.10 2012/09/29 09:58:03 ulm Exp $
+
+EAPI="4"
+
+inherit eutils 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="amd64 arm ~mips ppc x86"
+IUSE=""
+
+src_prepare() {
+ epatch ${FILESDIR}/${P}-musl.patch
+
+ 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-r99.ebuild b/sys-apps/hdparm/hdparm-9.45-r99.ebuild
new file mode 100644
index 00000000..d0826b09
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.45-r99.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/hdparm-9.45.ebuild,v 1.2 2015/06/02 11:38:26 zlogene Exp $
+
+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="amd64 ~arm ~mips ~ppc ~x86"
+IUSE="static"
+
+src_prepare() {
+ use static && append-ldflags -static
+ sed -i \
+ -e "/^CFLAGS/ s:-O2:${CFLAGS}:" \
+ -e "/^LDFLAGS/ s:-s:${LDFLAGS}:" \
+ Makefile || die "sed"
+ epatch "${FILESDIR}"/${P}-musl.patch
+}
+
+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 00000000..96a2d586
--- /dev/null
+++ b/sys-apps/hdparm/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/iproute2/Manifest b/sys-apps/iproute2/Manifest
new file mode 100644
index 00000000..c9601415
--- /dev/null
+++ b/sys-apps/iproute2/Manifest
@@ -0,0 +1,15 @@
+AUX iproute2-3.1.0-mtu.patch 1649 SHA256 d8d1d3b81a3fd5674e6c9e202bce9e84f41b579ba2c6a554df3346f4642715af SHA512 5479c2085b4aca958a89d3e265ebc3763c9e7cb273bd4046d7b7585209739f75ff04cc9b84d8eb9e3afae821ff788f0f0c7ab443260ab07943b6fad6946403e1 WHIRLPOOL b813f1d9dcdbfb525fb07a462f7faf1c13117dd3e9e584b1a033cb69f3dad9d4b8e5120f8512185f24769e6be0aabd6635ad3996342dc210ff513866e7638502
+AUX iproute2-3.1.0-no-ipv6.patch 1352 SHA256 ee93d86903e6f0aff54cd3c861f91e3d37639d7fc975c9c088f281f1ca8017da SHA512 b80f190d58c0ba5ab61185648c039133d870f72e9b270e905cc93aa335a20c1d880b00dd32eb7cd427c40f4e3182936b6b3156884ebf9ff976da0b76759ca9ab WHIRLPOOL ea155aa0e5c23b78df11b38613a763ac3e4674fd0c8aebad2f25c975e668ef00bd4b47a44e69f5bf5557d547436434a899dcfbd723d64828aaded76b207708db
+AUX iproute2-3.10.0-no-ipv6.patch 1390 SHA256 7fd8cce977876c7815990912965d056396b25885219397ac4fd469357230265e SHA512 344d19146f1e518d4631cbebf794d047f54ff845d29439cb51d1398fded38b9ead6e4b6deede1c9c412fdb9c11f8c83058c6d514ba4229a8d4c71e3c967affa8 WHIRLPOOL 5dfe8c13297cc49ce785449c224527e24eebe10b41ad791777f9c5e8c8f650ae019d127bd1a2e80a92f32d7c63b6eb2745ce664306f025db2f1241c4713fb978
+AUX iproute2-3.19.0-musl.patch 794 SHA256 f15ef3d2455f8dbddc1e1060bdfe63e91d768a5678f230bf0dd8fba5d4032834 SHA512 43bf34904f504f87c6e9acdc1824cc9aa8d16c04d8a88923553a121c06d67f48784b62d4e27923d0b2803eb98f1fc2bcae66cc5232aced6ba929e0b93cff1de5 WHIRLPOOL 3a355863a898714c8754d5ebfd506fbfd1102d25e09c020f9267e187e4117e5f004ef8b227bedfce9fb59234914adfdb57590305cc6c6c8921e55bdafd24a333
+AUX iproute2-3.8.0-musl-headers.patch 2701 SHA256 3d6c6ff432f68ab76bc818aee6228eb6272c52679c86e3e49c556fec3de4d03d SHA512 bee8782ad8f2c3fcfc000f26e3d358a189f1518e45c2a2992356653e60381f31b2209c40b14b72ed11f925c330ca052f12a409b9575aa384274e91c47cbb3d8b WHIRLPOOL 9a1fa59e12bac76ea06e33481e10808d165d4a95eabb63eff69f5258df5c84dca5403c1096557e9fc595ec5acac4a306ff29feb8f3645b2af6d2cc8c3ba0ebd2
+AUX iproute2-3.8.0-old-mount-libc.patch 871 SHA256 dc9fc407b09763f79663dbad627961f8a3446881737cc666f0cb67235f160d51 SHA512 cda73ce07c21d18c68fcff08e282e87a2d4b53cf7779e8a1ef669d7275974c8f3638ca530031aafcfc7eb4885264ceb7abb308b9da6f5568889a84cb4c7df1f9 WHIRLPOOL d2057e6bad82dce7844886d551d70af9207e111494b9cc23abc433857741afa48f30671091c8821a60aaa07ca621f243fbeee10322da11ac44d02f4f588b88bf
+AUX iproute2-4.0.0-fix-build-with-musl.patch 586 SHA256 e617316ce2803b6ad0dca43426a7a6c8762809f8e1e984da8c935bcff4db8e34 SHA512 2473432adbc02f0085be7b689af00527bc87f3ee89e313425dbc3a02e1a4569b1c397fc7160a2b26907c5edff3fdd5bd38d7e27043a9bebfbc36d714c8281953 WHIRLPOOL a6b451b38bb977a0b52fa904905c599922693c425537d5173c981dc2082d6c55f9a0d01514405e57c5719c376357f4759333ea3ad5dea849f4cef9df76d12181
+AUX iproute2-4.0.0-tc-show-buffer-overflow.patch 1717 SHA256 2ddb5ea744185f5ebff79961a054570b166ad1a5f3df0b91b59927d1b86c7aa3 SHA512 f5b507ce9d9a2cf4b86c0c2e2a18c5295226707df707eb229ec2f880b0fee64740a039fe5aa334c1dfc2d04faec4200cdb27dfaf631119a8705dd698f2767a77 WHIRLPOOL 801e25b3f6984b59d95eb494dfa63502e2c32551c8f5376ab6109a6bf5b9401f1b7bf6a0e0456dc68abb207d9505b5dbade675ea39e709e27a839357a431c444
+DIST iproute2-3.19.0.tar.xz 455004 SHA256 e2f9f8c36e166f2ba6c0e1e7a9ad84cdf7c1615b93df49dac44563d7b57fd7b0 SHA512 fc533b6a526cfda234f043ac25302a3206a81ab2a740640b997b6bfb22e6f94ddc21b704191a358ea8721a327ba785e0224a4b4129111ef5008b4003379c3706 WHIRLPOOL 6a0aa1a948286d7dcb3663d787167c27760d756385295bf0ca631920aed50fbd984c19204247097116ef0d4e293c3c8dbe13b0b44c6ec83e7815a7461293c89f
+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
+EBUILD iproute2-3.19.0-r99.ebuild 3638 SHA256 db56d0742f3a2e0808395a958118e36062e7f56b35a36d9c534f1caa6459bb3d SHA512 a5dfffef35a7c459def9dcf57a92af5caf11b84e6c0f76b81b6035bc053bb9b09c8e8f735a8009bb405fd596a6c8f08561d6ce00fd1f8c03871527dcd209248f WHIRLPOOL 3fbba0222b33ef1a8f250e10208a7a71dca90217869f86b552536bc47bbdbcbbdc616aad31ca0d387e40b7872e0e92b3a828348f5fefed3db5d810d45fa7e67a
+EBUILD iproute2-3.8.0-r99.ebuild 3492 SHA256 c301203fe02eca67fb1a7cd4a7ad2d76eca17e2a2f0bfc8e877bf75260a253fb SHA512 aaa8305610842a4f87aee1512c5185a44d1fcf572a7cb21e3a6e4e1dd36c1d55efac7126a126f982e404c495a74934e9ca0048a707d9ed685719b467094ea5ab WHIRLPOOL 09b2e6783302c4fb2f61cd5641dd6dcbf9281adc13b3f13d414117beadf763ce9922bb86517ebdf47b79a82cdd42f0762b34ae486d3f0471644672a1ceb42248
+EBUILD iproute2-4.0.0-r99.ebuild 3723 SHA256 898e0da7fc5887d8f25fcaaa13b98afb53279ea2a7574f66b322d1bc0c5f3fc6 SHA512 3b6b7509e6f769e5fb005d6740c8914d1556027e4d9eafcea74c2e4d29e42e12c9da1388146fcaa50a0bd3eb81d917fc401dea695d5ee74e7e02f887e0376171 WHIRLPOOL ffe9b8168e081a89265c879d7899ffb1c4f6f0f9fc98cb581660440dcd60c9eab115737e3b0f6c5d0f9352233093dc989a60217425701b1f367d3912a5135b76
+MISC metadata.xml 317 SHA256 45312a0c8b9363b8eaa97110513ca39053ffcd967af978900ee0a01aa81c00aa SHA512 2e6ed50522276dd0b09a61ba0c68ccc226ff33b64da2af87e92e349354f379cae040eb753961aeedc2a894eb65415fba7763541efe21bf328fe0a69706aeb872 WHIRLPOOL 73003e9201c29cba545b3245b53da9c36dc4b3c209ece693a9401b954896f6db5d29b209318fb7dd1c33db8920d01e097feaa88ef4ec0cb07590e850803bce09
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 00000000..fa12dad2
--- /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 00000000..1282a1b5
--- /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 00000000..86d80d2d
--- /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.19.0-musl.patch b/sys-apps/iproute2/files/iproute2-3.19.0-musl.patch
new file mode 100644
index 00000000..6ebc8086
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.19.0-musl.patch
@@ -0,0 +1,22 @@
+diff -ur a/iproute2-3.19.0/include/linux/if_bridge.h b/iproute2-3.19.0/include/linux/if_bridge.h
+--- a/iproute2-3.19.0/include/linux/if_bridge.h 2015-02-11 01:14:32.000000000 -0200
++++ b/iproute2-3.19.0/include/linux/if_bridge.h 2015-04-25 21:39:38.130830774 -0200
+@@ -15,7 +15,6 @@
+
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+
+ #define SYSFS_BRIDGE_ATTR "bridge"
+ #define SYSFS_BRIDGE_FDB "brforward"
+diff -ur a/iproute2-3.19.0/lib/namespace.c b/iproute2-3.19.0/lib/namespace.c
+--- a/iproute2-3.19.0/lib/namespace.c 2015-02-11 01:14:32.000000000 -0200
++++ b/iproute2-3.19.0/lib/namespace.c 2015-04-25 21:39:01.273291557 -0200
+@@ -9,6 +9,7 @@
+
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <sys/param.h>
+
+ #include "utils.h"
+ #include "namespace.h"
diff --git a/sys-apps/iproute2/files/iproute2-3.8.0-musl-headers.patch b/sys-apps/iproute2/files/iproute2-3.8.0-musl-headers.patch
new file mode 100644
index 00000000..a0b2e45f
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-3.8.0-musl-headers.patch
@@ -0,0 +1,81 @@
+diff -Naur iproute2-3.8.0.orig/misc/arpd.c iproute2-3.8.0/misc/arpd.c
+--- iproute2-3.8.0.orig/misc/arpd.c 2013-02-21 16:41:20.000000000 +0000
++++ iproute2-3.8.0/misc/arpd.c 2015-01-17 12:23:52.251980551 +0000
+@@ -18,7 +18,7 @@
+ #include <netdb.h>
+ #include <db_185.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <sys/uio.h>
+diff -Naur iproute2-3.8.0.orig/misc/ifstat.c iproute2-3.8.0/misc/ifstat.c
+--- iproute2-3.8.0.orig/misc/ifstat.c 2013-02-21 16:41:20.000000000 +0000
++++ iproute2-3.8.0/misc/ifstat.c 2015-01-17 12:23:42.795640740 +0000
+@@ -21,7 +21,7 @@
+ #include <sys/file.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/wait.h>
+ #include <sys/stat.h>
+ #include <signal.h>
+diff -Naur iproute2-3.8.0.orig/misc/lnstat.h iproute2-3.8.0/misc/lnstat.h
+--- iproute2-3.8.0.orig/misc/lnstat.h 2013-02-21 16:41:20.000000000 +0000
++++ iproute2-3.8.0/misc/lnstat.h 2015-01-17 12:33:50.391207710 +0000
+@@ -2,6 +2,7 @@
+ #define _LNSTAT_H
+
+ #include <limits.h>
++#include <sys/time.h>
+
+ #define LNSTAT_VERSION "0.02 041002"
+
+diff -Naur iproute2-3.8.0.orig/misc/nstat.c iproute2-3.8.0/misc/nstat.c
+--- iproute2-3.8.0.orig/misc/nstat.c 2013-02-21 16:41:20.000000000 +0000
++++ iproute2-3.8.0/misc/nstat.c 2015-01-17 12:23:27.683097666 +0000
+@@ -21,7 +21,7 @@
+ #include <sys/file.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/wait.h>
+ #include <sys/stat.h>
+ #include <signal.h>
+diff -Naur iproute2-3.8.0.orig/misc/rtacct.c iproute2-3.8.0/misc/rtacct.c
+--- iproute2-3.8.0.orig/misc/rtacct.c 2013-02-21 16:41:20.000000000 +0000
++++ iproute2-3.8.0/misc/rtacct.c 2015-01-17 12:23:35.340372834 +0000
+@@ -22,7 +22,7 @@
+ #include <sys/file.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/wait.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+diff -Naur iproute2-3.8.0.orig/tc/tc_stab.c iproute2-3.8.0/tc/tc_stab.c
+--- iproute2-3.8.0.orig/tc/tc_stab.c 2015-01-17 12:19:44.001058119 +0000
++++ iproute2-3.8.0/tc/tc_stab.c 2015-01-17 12:22:35.692229262 +0000
+@@ -21,6 +21,7 @@
+ #include <arpa/inet.h>
+ #include <string.h>
+ #include <malloc.h>
++#include <sys/param.h>
+
+ #include "utils.h"
+ #include "tc_util.h"
+diff -Naur iproute2-3.8.0.orig/tc/tc_util.c iproute2-3.8.0/tc/tc_util.c
+--- iproute2-3.8.0.orig/tc/tc_util.c 2013-02-21 16:41:20.000000000 +0000
++++ iproute2-3.8.0/tc/tc_util.c 2015-01-17 12:21:57.785866923 +0000
+@@ -20,6 +20,7 @@
+ #include <arpa/inet.h>
+ #include <string.h>
+ #include <math.h>
++#include <sys/param.h>
+
+ #include "utils.h"
+ #include "tc_util.h"
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 00000000..96280e04
--- /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-fix-build-with-musl.patch b/sys-apps/iproute2/files/iproute2-4.0.0-fix-build-with-musl.patch
new file mode 100644
index 00000000..5281be34
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-4.0.0-fix-build-with-musl.patch
@@ -0,0 +1,24 @@
+diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
+index 913bd8e..260d1e0 100644
+--- a/include/linux/if_bridge.h
++++ b/include/linux/if_bridge.h
+@@ -15,7 +15,6 @@
+
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+
+ #define SYSFS_BRIDGE_ATTR "bridge"
+ #define SYSFS_BRIDGE_FDB "brforward"
+diff --git a/lib/namespace.c b/lib/namespace.c
+index c03a103..f121eaa 100644
+--- a/lib/namespace.c
++++ b/lib/namespace.c
+@@ -9,6 +9,7 @@
+
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <sys/param.h>
+
+ #include "utils.h"
+ #include "namespace.h"
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 00000000..6c6c9a5c
--- /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-3.19.0-r99.ebuild b/sys-apps/iproute2/iproute2-3.19.0-r99.ebuild
new file mode 100644
index 00000000..08c29dee
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-3.19.0-r99.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-3.19.0.ebuild,v 1.5 2015/04/25 12:36:09 zlogene Exp $
+
+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="amd64 arm ~mips ppc 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
+
+ epatch "${FILESDIR}"/${PN}-3.19.0-musl.patch
+
+ 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.8.0-r99.ebuild b/sys-apps/iproute2/iproute2-3.8.0-r99.ebuild
new file mode 100644
index 00000000..cae49ff0
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-3.8.0-r99.ebuild
@@ -0,0 +1,118 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-3.8.0.ebuild,v 1.18 2014/01/18 11:02:22 vapier Exp $
+
+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="amd64 arm ~mips ppc 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
+ epatch "${FILESDIR}"/${P}-musl-headers.patch
+ 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-r99.ebuild b/sys-apps/iproute2/iproute2-4.0.0-r99.ebuild
new file mode 100644
index 00000000..c9ef0728
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-4.0.0-r99.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-4.0.0-r1.ebuild,v 1.1 2015/04/20 20:51:18 vapier Exp $
+
+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="~amd64 ~arm ~mips ~ppc ~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
+ epatch "${FILESDIR}"/${P}-tc-show-buffer-overflow.patch #546928
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+ epatch "${FILESDIR}"/${PN}-4.0.0-fix-build-with-musl.patch
+
+ 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/metadata.xml b/sys-apps/iproute2/metadata.xml
new file mode 100644
index 00000000..eab1d3a7
--- /dev/null
+++ b/sys-apps/iproute2/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='berkdb'>build programs that use berkdb (just arpd)</flag>
+ <flag name='iptables'>include support for iptables filtering</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/kbd/Manifest b/sys-apps/kbd/Manifest
new file mode 100644
index 00000000..c6b617e9
--- /dev/null
+++ b/sys-apps/kbd/Manifest
@@ -0,0 +1,10 @@
+AUX kbd-1.15.5-fix-struct_winsize-collision.patch 366 SHA256 510856ce92915a2f2c2547b99761a5c62c5ca452a6a57a43c2ec3392509fa3b6 SHA512 19f0623b594796e7bf3f82421d46fefcf9acc210683b4915d5ae6a0ddf026ccd373abb9f0cfb7d8ad99cc19443b5e585150f480653e360efb76dfdd722c801d2 WHIRLPOOL 8c7fd883c3b2b032ff0790514d519083a9a8dad09cfa3ad931ad9423d6ec511c2ab15938ba30c98fb986875dec44d0c5d3382cc223542f91d36ffb880e368e16
+AUX kbd-1.15.5-loadkeys-parse.patch 2163 SHA256 8fa928854ee1e3298df99e600cfdb08ccf8b44b7a7fc42423569fecc9365aa22 SHA512 c338c5f5ee9054f3dfc62646f9e8a47a577fc55dbc4723a04f006afa6c966ac5b056b744c49d4bdfcd80d69e64af20b0f71cc9cfff23db9f017adb32bd6d9d7d WHIRLPOOL 26b1adadc347b534675c7426eb9aca535556b81cffdd1ccd7ef50c603e127c1f9f6774af1b8050c67fc81daefe0c33da4593f74d3b77c47a089d6772363153e8
+AUX kbd-1.15.5-musl-headers-error.patch 3456 SHA256 5ada44aa9dc55385cb55d5b22a3d657e932652b8a0b0f261de91c635450e734c SHA512 56dd0fca91284ef76a5265cc92c08ac404b3ed2fde9d02a7d631d27ae380dde75343a889bdd7d320daa09212db1ae70a2f8b91ddc42513133fefa78da59e9b36 WHIRLPOOL 4908b996e41abead43259680630885ac65fc45cb0d75677302a32324c082b1c56927e73cdda16c37250d00d8e9820e56b624e7e21d12247e8a5489cdfaf540eb
+AUX kbd-2.0.0-tests.patch 747 SHA256 b1bd608043ecd19a9f0a9431afd4f3202e4d953b7f5c361d3e5949de65eda852 SHA512 408df2b4a9409c10c350d4c879a273cf7126ba58b49546a910cc93e0fd3119014a32b3e8b9c19eddecc9f601aa9d2a1b2b25c563f9529691c2d44f8db4cd0974 WHIRLPOOL 27e78a5dfb6d4ee3e117cbbfdd3025ee99980201e590c4631fab399a89a408a5275d17beac60da2364d2dfaf7f9e1cfda5c8cc8e74713d4160241bffd41c9b6a
+AUX kbd-2.0.2-musl-headers-error.patch 3327 SHA256 93add08a331bf538a3894a302fd9f5dc8631043feba7d1441773800f4d47e07c SHA512 4411480ed84e992cf8ede1f54983ef804cc2ce4ce3a952127454188a6a341293cb2ddfc26d61a04d678c8a58b311d6df78f4c406b475dbe18c379e36ee5406dd WHIRLPOOL 8512ed0f2738a9b4a69e6028c0c10b1adfde4537ad66a0b4393842df49475c7be94abe709556834a96d2781142a09acde7fc2fb9fdb9b3853c7b7440ac9432d9
+DIST kbd-1.15.5.tar.gz 1730719 SHA256 e35fa29f690dbbfb721706b2c8edc760c697640904fec65e81194ae8840c5c62 SHA512 725853b0ecde6a38976e2bae5672b8de78bfc90d65a0762695964a6dab729c96be4af778fe7f0f195caae04d630b07a3d0d95c9c928d1a5609e223e47723e58c WHIRLPOOL 431873623d4125b73622894c511711a2153fae498a17dc59851219405c69a641c24bb591fa66001eb4cc7491fc4f90e532661c2bf56f69e2a17dd435d1e14ace
+DIST kbd-2.0.2.tar.xz 1023980 SHA256 9dfddabf96012e329c4bebb96a21aeef7c3872f624e96e8156ba542b82aeb912 SHA512 8159383f94242f06c701dfd5400e35bd3a76494a643f738d98c6713bcb20034065b49f31f66e8bf19e6829a30be97fbeee43ed8ad276febb98e28b3bf82972fa WHIRLPOOL e6a5be104b11266f8be9ba653e9e0de701cdf4c56b249af9bc52ea5eea374d1de82e3f4a02214552750adebb8ae21c8c964a4161d661e460f765306920e23849
+EBUILD kbd-1.15.5-r99.ebuild 1221 SHA256 c06e81423bcc222bb2b59913f3c4b6485cec106ba52bf8115448a15238ac52b5 SHA512 afcb55f95bc9bb004a83f91245ef2d436b9eebcb8ba3ae3935a12d4eb98d4857e0a6aed66797501fc53d49af2bddac295025cb4951a5d267962fc80e8210922d WHIRLPOOL 7e3316431c4b8a10a644ec99f3e23830be8fb7b759e9f40c1a923e1034733fc7842e61dec3485e97e2728ce5fa69ae34798b5596e33635eb5fe0e69600059017
+EBUILD kbd-2.0.2-r99.ebuild 1520 SHA256 786bb5ef7317bb5a3ac208d6f33002fe59387649c73d36d85ea9a18bc36acced SHA512 e5068082e06839f407ce553dde8b3cc0013cb0b8b855fcd009f895c4dde8ac7fcda876dc20ea246fbe7a10e7c26d7454b28773a8a4f2372016bdfe701f4de5dd WHIRLPOOL b8f8a57861cd48b87095ed713a94c6977c97c72e689ad9a165b92fbdf73bef68aa1798d7356199edca820bccc1e093e13adce63db49378f8acf53f749737a7e4
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-apps/kbd/files/kbd-1.15.5-fix-struct_winsize-collision.patch b/sys-apps/kbd/files/kbd-1.15.5-fix-struct_winsize-collision.patch
new file mode 100644
index 00000000..29360908
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.15.5-fix-struct_winsize-collision.patch
@@ -0,0 +1,11 @@
+diff -Naur kbd-1.15.5.orig/src/resizecons.c kbd-1.15.5/src/resizecons.c
+--- kbd-1.15.5.orig/src/resizecons.c 2012-12-01 21:41:38.000000000 +0000
++++ kbd-1.15.5/src/resizecons.c 2014-01-16 13:48:25.793935059 +0000
+@@ -82,7 +82,6 @@
+ #include <sys/perm.h>
+ #else
+ #include <linux/types.h>
+-#include <linux/termios.h>
+ #endif
+ #include <linux/vt.h>
+ #include "paths.h"
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 00000000..c78a2278
--- /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-1.15.5-musl-headers-error.patch b/sys-apps/kbd/files/kbd-1.15.5-musl-headers-error.patch
new file mode 100644
index 00000000..ad52a63f
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.15.5-musl-headers-error.patch
@@ -0,0 +1,115 @@
+diff -Naur kbd-1.15.3.orig/src/dumpkeys.c kbd-1.15.3/src/dumpkeys.c
+--- kbd-1.15.3.orig/src/dumpkeys.c 2011-05-07 20:33:42.000000000 +0000
++++ kbd-1.15.3/src/dumpkeys.c 2013-07-06 02:20:41.660131968 +0000
+@@ -12,6 +12,7 @@
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <string.h>
+ #include <errno.h>
+ #include "ksyms.h"
+diff -Naur kbd-1.15.3.orig/src/kbdinfo.c kbd-1.15.3/src/kbdinfo.c
+--- kbd-1.15.3.orig/src/kbdinfo.c 2011-05-07 20:33:42.000000000 +0000
++++ kbd-1.15.3/src/kbdinfo.c 2013-07-06 02:29:12.057160508 +0000
+@@ -1,6 +1,5 @@
+ #include <stdio.h>
+ #include <errno.h>
+-#include <error.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+ #include <linux/kd.h>
+@@ -9,6 +8,10 @@
+ #include "nls.h"
+ #include "version.h"
+
++#define error(e, n, s) \
++ perror(s); \
++ exit(e); \
++
+ static const char *action = NULL;
+ static const char *value = NULL;
+
+diff -Naur kbd-1.15.3.orig/src/kbdrate.c kbd-1.15.3/src/kbdrate.c
+--- kbd-1.15.3.orig/src/kbdrate.c 2011-05-07 20:33:42.000000000 +0000
++++ kbd-1.15.3/src/kbdrate.c 2013-07-06 02:21:53.121135964 +0000
+@@ -74,6 +74,7 @@
+ #include <errno.h>
+ #include <sys/file.h>
+ #include <sys/ioctl.h>
++#include <fcntl.h>
+
+ #ifdef __sparc__
+ #include <asm/param.h>
+diff -Naur kbd-1.15.3.orig/src/loadkeys.c kbd-1.15.3/src/loadkeys.c
+--- kbd-1.15.3.orig/src/loadkeys.c 2011-05-07 20:33:42.000000000 +0000
++++ kbd-1.15.3/src/loadkeys.c 2013-07-06 02:21:02.148133114 +0000
+@@ -79,6 +79,7 @@
+ #include <ctype.h>
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+ #include <unistd.h>
+diff -Naur kbd-1.15.3.orig/src/openvt.c kbd-1.15.3/src/openvt.c
+--- kbd-1.15.3.orig/src/openvt.c 2011-05-07 20:33:42.000000000 +0000
++++ kbd-1.15.3/src/openvt.c 2013-07-06 02:22:11.080136968 +0000
+@@ -10,6 +10,7 @@
+ #include <sys/vt.h>
+ #include <sys/wait.h>
+ #include <sys/file.h>
++#include <fcntl.h>
+
+ #include "version.h"
+ #include "xmalloc.h"
+diff -Naur kbd-1.15.3.orig/src/setvtrgb.c kbd-1.15.3/src/setvtrgb.c
+--- kbd-1.15.3.orig/src/setvtrgb.c 2011-05-07 20:33:42.000000000 +0000
++++ kbd-1.15.3/src/setvtrgb.c 2013-07-06 02:34:26.390178084 +0000
+@@ -5,12 +5,15 @@
+ #include <sys/ioctl.h>
+ #include <linux/kd.h>
+ #include <errno.h>
+-#include <error.h>
+ #include "kbd.h"
+ #include "getfd.h"
+ #include "nls.h"
+ #include "version.h"
+
++#define error(e, n, s) \
++ perror(s); \
++ exit(e); \
++
+ static unsigned char *cmap;
+
+ /* Standard VGA terminal colors, matching those hardcoded in the Linux kernel's
+@@ -82,25 +85,21 @@
+ if (c == EOF)
+ error(EXIT_FAILURE, errno, "fscanf");
+
+- error(EXIT_FAILURE, 0, _("Error: %s: Invalid value in field %u in line %u."),
+- filename, rows + 1, cols + 1);
++ error(EXIT_FAILURE, 0, "setvtrgb");
+ }
+
+ cmap[rows + cols * 3] = (unsigned char) val;
+
+ if (cols < 15 && fgetc(fd) != ',')
+- error(EXIT_FAILURE, 0, _("Error: %s: Insufficient number of fields in line %u."),
+- filename, rows + 1);
++ error(EXIT_FAILURE, 0, "setvtrgb");
+ cols++;
+ }
+
+ if ((c = fgetc(fd)) == EOF)
+- error(EXIT_FAILURE, 0, _("Error: %s: Line %u has ended unexpectedly.\n"),
+- filename, rows + 1);
++ error(EXIT_FAILURE, 0, "setvtrgb");
+
+ if (c != '\n')
+- error(EXIT_FAILURE, 0, _("Error: %s: Line %u is too long.\n"),
+- filename, rows + 1);
++ error(EXIT_FAILURE, 0, "setvtrgb");
+ }
+ }
+
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 00000000..7a4e186c
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-2.0.0-tests.patch
@@ -0,0 +1,31 @@
+--- 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.2-musl-headers-error.patch b/sys-apps/kbd/files/kbd-2.0.2-musl-headers-error.patch
new file mode 100644
index 00000000..69ac7d0e
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-2.0.2-musl-headers-error.patch
@@ -0,0 +1,147 @@
+diff --git a/src/kbdinfo.c b/src/kbdinfo.c
+index e5f122d..dcdcac0 100644
+--- a/src/kbdinfo.c
++++ b/src/kbdinfo.c
+@@ -1,6 +1,5 @@
+ #include <stdio.h>
+ #include <errno.h>
+-#include <error.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+ #include <linux/kd.h>
+@@ -9,6 +8,10 @@
+ #include "nls.h"
+ #include "version.h"
+
++#define error(e, n, ...) \
++ fprintf(stderr, ##__VA_ARGS__); \
++ exit(e);
++
+ static const char *action = NULL;
+ static const char *value = NULL;
+
+diff --git a/src/kbdrate.c b/src/kbdrate.c
+index 2ab8388..5faff00 100644
+--- a/src/kbdrate.c
++++ b/src/kbdrate.c
+@@ -74,6 +74,7 @@ beats rebuilding the kernel!
+ #include <errno.h>
+ #include <sys/file.h>
+ #include <sys/ioctl.h>
++#include <fcntl.h>
+ #include <linux/kd.h>
+
+ #ifdef __sparc__
+diff --git a/src/libkeymap/dump.c b/src/libkeymap/dump.c
+index 0262e24..606931e 100644
+--- a/src/libkeymap/dump.c
++++ b/src/libkeymap/dump.c
+@@ -13,6 +13,7 @@
+ #include <string.h>
+ #include <ctype.h>
+ #include <unistd.h>
++#include <sys/types.h>
+
+ #include "keymap.h"
+
+diff --git a/src/libkeymap/kmap.c b/src/libkeymap/kmap.c
+index 67be81e..e13498b 100644
+--- a/src/libkeymap/kmap.c
++++ b/src/libkeymap/kmap.c
+@@ -1,5 +1,6 @@
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/types.h>
+
+ #include "nls.h"
+ #include "kbd.h"
+diff --git a/src/libkeymap/summary.c b/src/libkeymap/summary.c
+index 46df90d..0912ae8 100644
+--- a/src/libkeymap/summary.c
++++ b/src/libkeymap/summary.c
+@@ -9,6 +9,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+
+ #include "keymap.h"
+
+diff --git a/src/openvt.c b/src/openvt.c
+index 075136f..49720d7 100644
+--- a/src/openvt.c
++++ b/src/openvt.c
+@@ -10,6 +10,7 @@
+ #include <sys/vt.h>
+ #include <sys/wait.h>
+ #include <sys/file.h>
++#include <fcntl.h>
+
+ #include "version.h"
+ #include "xmalloc.h"
+@@ -19,6 +20,8 @@
+ #include "compat/linux-limits.h"
+ #endif
+
++#define NAME_MAX 255
++
+ // There must be a universal way to find these!
+ #define TRUE (1)
+ #define FALSE (0)
+diff --git a/src/setvtrgb.c b/src/setvtrgb.c
+index f99badc..f1a631c 100644
+--- a/src/setvtrgb.c
++++ b/src/setvtrgb.c
+@@ -5,12 +5,15 @@
+ #include <sys/ioctl.h>
+ #include <linux/kd.h>
+ #include <errno.h>
+-#include <error.h>
+ #include "kbd.h"
+ #include "getfd.h"
+ #include "nls.h"
+ #include "version.h"
+
++#define error(e, n, ...) \
++ fprintf(stderr, ##__VA_ARGS__); \
++ exit(e);
++
+ static unsigned char *cmap;
+
+ /* Standard VGA terminal colors, matching those hardcoded in the Linux kernel's
+diff --git a/src/vlock/auth.c b/src/vlock/auth.c
+index da135ce..a3f365b 100644
+--- a/src/vlock/auth.c
++++ b/src/vlock/auth.c
+@@ -22,7 +22,6 @@
+ */
+
+ #include <errno.h>
+-#include <error.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+diff --git a/src/vlock/vlock.c b/src/vlock/vlock.c
+index c2c4158..fa2f386 100644
+--- a/src/vlock/vlock.c
++++ b/src/vlock/vlock.c
+@@ -23,7 +23,6 @@
+
+ #include <stdio.h>
+ #include <errno.h>
+-#include <error.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/src/vlock/vt.c b/src/vlock/vt.c
+index 4e5282b..f3ba85d 100644
+--- a/src/vlock/vt.c
++++ b/src/vlock/vt.c
+@@ -23,7 +23,6 @@
+
+ #include <stdio.h>
+ #include <errno.h>
+-#include <error.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
diff --git a/sys-apps/kbd/kbd-1.15.5-r99.ebuild b/sys-apps/kbd/kbd-1.15.5-r99.ebuild
new file mode 100644
index 00000000..78572570
--- /dev/null
+++ b/sys-apps/kbd/kbd-1.15.5-r99.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-1.15.5-r1.ebuild,v 1.6 2014/01/09 13:37:41 polynomial-c Exp $
+
+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="amd64 arm ~mips ppc 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
+ epatch "${FILESDIR}"/${P}-musl-headers-error.patch
+ epatch "${FILESDIR}"/${P}-fix-struct_winsize-collision.patch
+}
+
+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.2-r99.ebuild b/sys-apps/kbd/kbd-2.0.2-r99.ebuild
new file mode 100644
index 00000000..93f2fb0a
--- /dev/null
+++ b/sys-apps/kbd/kbd-2.0.2-r99.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kbd/kbd-2.0.2.ebuild,v 1.1 2014/08/01 10:35:43 vapier Exp $
+
+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="~amd64 ~arm ~mips ~ppc ~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
+ epatch "${FILESDIR}"/${PN}-1.15.5-fix-struct_winsize-collision.patch
+ epatch "${FILESDIR}"/${PN}-2.0.2-musl-headers-error.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 00000000..96a2d586
--- /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/keyutils/Manifest b/sys-apps/keyutils/Manifest
new file mode 100644
index 00000000..033aaee6
--- /dev/null
+++ b/sys-apps/keyutils/Manifest
@@ -0,0 +1,5 @@
+AUX keyutils-1.5.5-makefile-fixup.patch 879 SHA256 b68e7fab7293c680e5f44f3b116622b2d7dba2039e849ec53ab577c4e12f3a5b SHA512 d3628be5cd759fd59e3fb07897db2f23615cc4b2b12d537438c4c186e5588d8d7c22438fdb26003be29ace4910db24a889d4e35550b74a91958a4fcb4bc654c0 WHIRLPOOL 69a9ec2b8386e39c6c133395b96b7a50cc12e1a4644ce06198f4a77431b685e0e962938b97c7a757074beae8794ceafc9f36cf270064b855f91db0c91475ba1e
+AUX keyutils-1.5.9-UINT_MAX.patch 368 SHA256 6d8743f250bc23b3bda40f7ac319824345421d399294faaa8c6afc5dba604d12 SHA512 bf81128dbe5939ba88b884b68efcc08552ee5ef7ad9239d173e10e36a02c6a41f7fdd2093ed4111aacdc21cfc38b8a25feb226ce9849344b9fbf417b6791cb25 WHIRLPOOL c2f170df1176f7408b6123e2c69f9db3151b54e1638d4ca426402bd8e104f320921b17f6e1848389e94cef194ef80411999e11edf279fa8961416d773847859d
+DIST keyutils-1.5.9.tar.bz2 74683 SHA256 4da2c5552c688b65ab14d4fd40fbdf720c8b396d8ece643e040cf6e707e083ae SHA512 d4ee1dabb87844e18bfd8d094a5bc9ce792c96720b71e77961b6c36bb1addb9acea2a7004ddfba1d09b167af908368162312e5c3656b22a6266955bb57b887e2 WHIRLPOOL 0509cce076a32d2f319f596506d4aaeb83e1853ee6337e6a3041e6957e9098f4482ae56a9c6455605b72b3f34701a890e9be666b6fdd752ff14a3d3564dcba19
+EBUILD keyutils-1.5.9-r99.ebuild 2400 SHA256 ebf6b00892e437f12753db3d4914312eca1cfd84f72f99dff3da1eca655b1a37 SHA512 cdbbb086349787b5a76b5f9e746584dab95e912298839e92b800e431f90aec26575ab25942bad335b6374d05d84c4527dd336de4f2ef3a88e1d8e7e1187822e5 WHIRLPOOL 91de2851905f006226d2b309a922fd8ffa556a70cc74c52cb46786a7c9b6b78decaf20ede22bf604c727348ceb413909d8886ba36678145a6c314cf3f209b5f6
+MISC metadata.xml 227 SHA256 eb6179099f91f31168c95bd4a018a01f37aa1eb8d9ba8d3ed039056bac71bcf8 SHA512 1e52da091741cb67f6a61955ebf0c314c3634d5cab187a27820fa76f36307cb9c404271360de061f9b2076dfa1e4f3fadb46a3834ad9fc6685fbc437e5c7c789 WHIRLPOOL 0baafc1e244b376dc66e10952a10ec634fabb384431da1bec9be95bb344109c7943c6e74ae249070a9c5ee93410714e2c9343a65e01309bac7918239b6492820
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 00000000..ff4bcfa9
--- /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/files/keyutils-1.5.9-UINT_MAX.patch b/sys-apps/keyutils/files/keyutils-1.5.9-UINT_MAX.patch
new file mode 100644
index 00000000..65a50b06
--- /dev/null
+++ b/sys-apps/keyutils/files/keyutils-1.5.9-UINT_MAX.patch
@@ -0,0 +1,12 @@
+Patch sent to dhowells@redhat.com
+
+--- a/keyutils-1.5.9/key.dns_resolver.c 2014-02-21 17:18:24.000000000 -0200
++++ b/keyutils-1.5.9/key.dns_resolver.c 2015-04-03 17:29:22.517832174 -0200
+@@ -42,6 +42,7 @@
+ #include <netinet/in.h>
+ #include <arpa/nameser.h>
+ #include <arpa/inet.h>
++#include <limits.h>
+ #include <resolv.h>
+ #include <getopt.h>
+ #include <sys/types.h>
diff --git a/sys-apps/keyutils/keyutils-1.5.9-r99.ebuild b/sys-apps/keyutils/keyutils-1.5.9-r99.ebuild
new file mode 100644
index 00000000..d148784e
--- /dev/null
+++ b/sys-apps/keyutils/keyutils-1.5.9-r99.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/keyutils/keyutils-1.5.9-r1.ebuild,v 1.12 2015/01/05 13:45:19 jlec Exp $
+
+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="amd64 arm ~mips ppc x86"
+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
+ epatch "${FILESDIR}"/${PN}-1.5.9-UINT_MAX.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/metadata.xml b/sys-apps/keyutils/metadata.xml
new file mode 100644
index 00000000..035bc6b0
--- /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 00000000..6f82412e
--- /dev/null
+++ b/sys-apps/kmod/Manifest
@@ -0,0 +1,5 @@
+AUX kmod-19-strndupa.patch 579 SHA256 e090896840b0692bc52ba093f794289580863cc56e9d34191291a2200eac88fa SHA512 2edca256b43503e45cc9878d03619af4d9d02bddc9fb31a18d62e0516e484f49251f376d6545535a5fe83fe56eba45970e972186a18892e040b10035877e4b37 WHIRLPOOL 7fc53b00485312c3e4e42b68459d350f4b7d59e405aeae41a4418daf37b5f1cd8cd398d9186c4c7f0af7f4ee53d16b30d58962e2eebba712c55bf88111c47d20
+AUX kmod-static-nodes-r1 601 SHA256 21995879ee2ac6727ca5784a309eff5dd41b93030efc854f123b8a4d8ef3294b SHA512 d95b63174b7e28cc8d72b28a1a436fb108164528d5643ce9f65012f233151604f6b26c20c64fbe2f657fbbd6863c08ae9094c5bdc2dfc68d417448e268a7bc11 WHIRLPOOL f0342f23912535134e5cbc88cd13fdd9a6681ba5502a15cb5b0d5aafe2d6db4a2bba806293be29b9e14f11ad28456cc1104f6d031b88d1142ab313407df73163
+DIST kmod-19.tar.xz 1473916 SHA256 3e7fee6eeff5435848b2dcc852bc8959066478d687d232284d67300c071e7b14 SHA512 317aebbfe12e2bd8f610d799642499d411e017cbda6082d0de92b1597753d29f42c4a2faac574879166e8cda8d7fd42ad2f98086b169e85b238cf024887ec0ee WHIRLPOOL a2aec8057cbc7776b71cea5c70fcec90fa20f09d2195f532f03085df2e85ae6dfbba50450a1b33425fd17caa01b997e052ec4676e0ed9c6afd7555b53aa8c589
+EBUILD kmod-19-r99.ebuild 5008 SHA256 1c2ab7972062629f53a1535320849c96348bc36538cbbd52d4c797f62c60511f SHA512 08e3db0296c39f0d258879051c0fa579bcd43d6154ee64acd128faa1b0f8170d8dec0b684686896b060d1f26eb9188b3be8ec50bddeecd3bb7b1a1c42ab82b01 WHIRLPOOL 93eb10f54be24c710e91b42d3cca03fe1f3a1602e54cc35c2fed1ee5f3ca172479818883b8c50e03837b94da9bc7fdaf793056fe0dcd45c54894b7fe0d198a3b
+MISC metadata.xml 315 SHA256 615f47d63e08942e7a0c3cd3246f70d2f49b276aec75c84a9ec5e1188a91a18e SHA512 0f8bb9e3ba70ec5084d3c8a3fe8fba508dec2a33cb77cc13f3aba35c70b53d9011674a862033de6ba83aefb1b351b4d1fac7112d2e61070444620191f8ed8742 WHIRLPOOL 928f3536c928ba3457a2f94eb6de26e3c13f5a34748d554219edd8aa5841c24ebbc5930fcb147550c0cd9d8f5eae8f4a1cd04f3267ddbe066450178e38d7cb37
diff --git a/sys-apps/kmod/files/kmod-19-strndupa.patch b/sys-apps/kmod/files/kmod-19-strndupa.patch
new file mode 100644
index 00000000..74b2af6c
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-19-strndupa.patch
@@ -0,0 +1,23 @@
+From efb5bfaca938fa5991865c1e9a0c730dc919708c Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 17 Nov 2014 09:36:29 +0100
+Subject: util: fix build on systems missing strndupa
+
+we need include shared/missing.h to be able to compile on sysmtes that
+lacks strndupa.
+
+diff --git a/shared/util.c b/shared/util.c
+index 855d4e4..23bbb26 100644
+--- a/shared/util.c
++++ b/shared/util.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <unistd.h>
+
++#include <shared/missing.h>
+ #include <shared/util.h>
+
+ #define USEC_PER_SEC 1000000ULL
+--
+cgit v0.10.1
+
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 00000000..dcbf6793
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-static-nodes-r1
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/files/kmod-static-nodes-r1,v 1.1 2014/07/11 12:28:07 ssuominen Exp $
+
+description="Create list of required static device nodes for the current kernel"
+
+depend() {
+ after dev-mount
+ before tmpfiles.dev dev
+ keyword -lxc
+}
+
+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-19-r99.ebuild b/sys-apps/kmod/kmod-19-r99.ebuild
new file mode 100644
index 00000000..6da3cd01
--- /dev/null
+++ b/sys-apps/kmod/kmod-19-r99.ebuild
@@ -0,0 +1,192 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/kmod-19.ebuild,v 1.1 2014/11/23 06:51:01 williamh Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_2,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="amd64 arm ~mips ppc 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
+ !<sys-apps/systemd-217
+ 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
+
+ epatch "${FILESDIR}"/${P}-strndupa.patch
+
+ # 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 00000000..723317e9
--- /dev/null
+++ b/sys-apps/kmod/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>
+ <maintainer>
+ <email>udev-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='tools'>Install module loading/unloading tools.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/ldconfig/Manifest b/sys-apps/ldconfig/Manifest
new file mode 100644
index 00000000..fecbe6c7
--- /dev/null
+++ b/sys-apps/ldconfig/Manifest
@@ -0,0 +1,3 @@
+AUX ldconfig-0.1 2435 SHA256 1ae38d1acbae2860f8e3ec4f990f98013f6fea456d3a9572ec0c4b15a63a88a4 SHA512 1f94dbb37bca54d32282e0967ca2009db34bf10751c0c4b8852d5e4d0072c5c16a159b489d40b1da0c48249ae21ae90f1f0be71a0317481d39cab511ecae728b WHIRLPOOL 6dfd8170581b847345ee61ee004d933f23649ca1714363ecb4d66f5525c50d8aeb7ad1cdc5e52f601eea769d83cb7be31c56f2e6d342dbe038fa9c7720b936d0
+EBUILD ldconfig-0.1.ebuild 607 SHA256 03b1a27b574e3160d6b6ae67e450c391cc3a6bceb09d7128dfda813ec4a9c70f SHA512 f6685e923ccccf985f96d62c349deb45e0bcdc510c8051ed285f09df3120754dbcfee02cd3daa811f28225af22a957ef7d8e662fcb8e3d0964457a7af1b2ec72 WHIRLPOOL 2569af7e1d0cf6890ff7cd165122851b72fb0d7cf11fb1a0b4db44ba554bff59d6711d3eb01ebebdb1ae2dfd4be43e22459a3197b903ee2cbc6f11230a6445e4
+MISC metadata.xml 238 SHA256 f13e6e7b65d20beb9ae945d520160ef0dba80c1965754958945904d7e3c0a75f SHA512 3c3d75f1cb90ffcfb98df47481fbde6d451254a29fa87577acd25bc27cbcc3e5dbc0c1efce5974be905428f0b7caf912c8b051417aff92763847fa377493a153 WHIRLPOOL 6ec3d597b87aff99014404b8b732e6f600aafc3c3eeebfab135c9c19cde2e43161cfa23f841bd72826cc3393b724e1dac115c15dcce2b74ace6f1d6ec209dbf3
diff --git a/sys-apps/ldconfig/files/ldconfig-0.1 b/sys-apps/ldconfig/files/ldconfig-0.1
new file mode 100644
index 00000000..71394508
--- /dev/null
+++ b/sys-apps/ldconfig/files/ldconfig-0.1
@@ -0,0 +1,141 @@
+#!/bin/bash -e
+
+ROOT="/"
+
+LDSO_CONF="/etc/ld.so.conf"
+if [[ ! -e $LDSO_CONF ]]; then
+ echo "$LDSO_CONF not found" >&2
+ exit 1
+fi
+
+LDSO_CONF_DIR=$(dirname $LDSO_CONF)
+
+VERBOSE=0
+
+UPDATE_LINKS=1
+
+get_options() {
+ while getopts "vnNXf:C:r:p" opt "$@"; do
+ case $opt in
+ v)
+ echo "ldconfig for musl in Gentoo"
+ VERBOSE=1
+ ;;
+ r)
+ ROOT=$OPTARG
+ ;;
+ f)
+ LDSO_CONF=$OPTARG
+ ;;
+ X)
+ UPDATE_LINKS=0
+ ;;
+ \?)
+ echo "Invalid option: -$opt" >&2
+ exit 1
+ ;;
+ n|N|C|p)
+ echo "Unimplemented option: -$opt" >&2
+ exit 1
+ ;;
+ esac
+ done
+
+ if [[ $UPDATE_LINKS == 1 ]]; then
+ echo "Updating links is not implemented."
+ fi
+}
+
+
+repeated() {
+ local l=$1
+ local drs="${@:2}"
+ for m in $drs; do
+ [[ $m == $l ]] && return 0
+ done
+ return 1
+}
+
+expand() {
+ # We are assuming the ld.so.conf's 'include' is not recursive
+ local f line l
+ local glob="$LDSO_CONF_DIR/$1"
+ local drs="${@:2} "
+
+ for f in $glob; do
+ [[ ! -f $f ]] && continue
+ while read line; do
+ line=${line%%#*}
+ line=${line//:/ }
+ line=${line//,/ }
+ for l in $line; do
+ #We must add this whether or not the directory exists
+ repeated $l $drs && continue
+ drs+=" $l "
+ done
+ done < $f
+ done
+
+ echo $drs
+}
+
+read_ldso_conf() {
+ local drs=" "
+
+ while read line; do
+ # Sanitize the line - see ldconfig(8) for delimiters
+ # Note: bash read turns tabs into spaces and read already
+ # delimits on newlines with the default $IFS
+ line=${line%%#*} # Remove comments
+ line=${line//:/ } # Change colon delimiter to space
+ line=${line//,/ } # Change comma delimiter to space
+
+ next=0
+ for l in $line; do
+ if [[ $next == 1 ]]; then
+ next=0
+ drs=$(expand $l $drs)
+ elif [[ $l == "include" ]]; then
+ next=1
+ else
+ # glibc's ldconfig silently skips non directories
+ if [[ -d $l ]]; then
+ repeated $l $drs && continue
+ drs+=" $l "
+ fi
+ fi
+ done
+ done < $1
+
+ echo $drs
+}
+
+sanitize() {
+ local drs=$@
+
+ repeated "/lib" $drs || drs="/lib $drs"
+ repeated "/usr/lib" $drs || drs="/usr/lib $drs"
+
+ echo $drs
+}
+
+get_options "$@"
+drs=$(read_ldso_conf "$LDSO_CONF")
+drs=$(sanitize $drs)
+
+LDSO_PATH=$(ls /lib/ld-musl-*.so.1)
+if [[ ! -e $LDSO_PATH ]]; then
+ echo "$LDSO_PATH not found" >&2
+ exit 1
+fi
+
+LDSO_ARCH=$(basename $LDSO_PATH)
+LDSO_NAME=${LDSO_ARCH%.so.1}
+ETC_LDSO_PATH=/etc/${LDSO_NAME}.path
+
+X=$(mktemp --tmpdir=/tmp ${LDSO_NAME}.XXXXXX)
+for d in $drs; do
+ echo $d >> $X
+done
+chmod 644 $X
+mv $X $ETC_LDSO_PATH
diff --git a/sys-apps/ldconfig/ldconfig-0.1.ebuild b/sys-apps/ldconfig/ldconfig-0.1.ebuild
new file mode 100644
index 00000000..05ab221d
--- /dev/null
+++ b/sys-apps/ldconfig/ldconfig-0.1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+DESCRIPTION="ldconfig for musl in Gentoo"
+HOMEPAGE="http://dev.gentoo.org/~blueness"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+#KEYWORDS="~amd64"
+KEYWORDS=""
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+
+pkg_preinst () {
+ use elibc_musl || die "This package only works on a musl system"
+}
+
+src_unpack () {
+ mkdir -p ${P}
+ cp "${FILESDIR}"/${P} ${P}/${PN}
+}
+
+src_install () {
+ into /
+ dosbin ${PN}
+ echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00musl
+ doenvd "${T}"/00musl || die
+}
diff --git a/sys-apps/ldconfig/metadata.xml b/sys-apps/ldconfig/metadata.xml
new file mode 100644
index 00000000..1e758737
--- /dev/null
+++ b/sys-apps/ldconfig/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/net-tools/Manifest b/sys-apps/net-tools/Manifest
new file mode 100644
index 00000000..266024ab
--- /dev/null
+++ b/sys-apps/net-tools/Manifest
@@ -0,0 +1,11 @@
+AUX net-tools-fix-header-assumptions.patch 3462 SHA256 bea5145e5a69bcea835bcb9a71cadcef55651b253c6e4552f007e37e16d60a1a SHA512 e14293a16d0111cb50f205d4a861f94b9525ce75311f8e3aeed1231ffc877d4d2715074d64419c72473c27cb4c2535ad4af17f911dc7ece71d2e941bce44297a WHIRLPOOL f6b378db90711d82d55cda0ee1903b32102f97854897236562f69a42470d7288ab7bbb4b166927086b758b237c1d091d7b1f392d1e798de06d875b6b0e293433
+DIST net-tools-1.60_p20120127084908-patches-1.tar.xz 3332 SHA256 1240a3c139b684da195f665447a80e1d05f0d6f3c2319dbf340dfcbb78b01501 SHA512 97602993e273d2fadac2bf3df892e09ba7c7cda44a7825209a644ada4d203e0c3d2248cbf976545afb07113976694fb581511641725ce1b95b00688d357d0a02 WHIRLPOOL 4fd537e042ab368795ff0db55717c424ef3bd7bc37302c5fa64936c4ffe4772557c25c83224f9ee0017f812817143b7168e70b2fdcf146abab06d18cafe3448d
+DIST net-tools-1.60_p20120127084908.tar.xz 224992 SHA256 408a51964aa142a4f45c4cffede2478abbd5630a7c7346ba0d3611059a2a3c94 SHA512 1237a4bb0bba5273a25d707493d5bdb16f267bfa6731c526329cff459e06923e0d54aef6eded458d3cb72994bf4382f216212c34ad9329f5f1573a4228445996 WHIRLPOOL b14f24c13f2950fd92eb6b897cd14c5aa4d52e40062943fcb84de7e13555f98008db1aa6ec6fb6ca8f899a5bfdfc685f8822da2f3c0e5e002b9d20aec4d8b73c
+DIST net-tools-1.60_p20130513023548-patches-1.tar.xz 3352 SHA256 926240c304e20a0ab966c3d278703a6ef8e7833a54aaf636598854450bd01f4e SHA512 6dd3eef6469a18581a98fc91f424b418f3875cd0eff86724d6bdbacca1b83d1229a567a184b82e0187d01a428ea6be933d53090796b5c7d301009b2e211c4531 WHIRLPOOL fb638e122f85e95fda35b77336fbb5d4f6e89c5f5a5b76d759bd08f53eb0741feb9c7221940b836e0e7f5c60bd312d99d823c3af89340d6e254f1be96e34d2ce
+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
+EBUILD net-tools-1.60_p20120127084908-r99.ebuild 2766 SHA256 11f9af8e9ce94583c366ec99c8c1d187b0ac85e17284fba7964f9cd14df3735a SHA512 a129f01d78933384114055c47f924f122c73008b57a46e2b7f1a8d9e95e1828a1a67b41934aacf479680de2eff23758981579be22faafb39bf865d6607ca2e13 WHIRLPOOL 1e59554cc984b68202cce4f378b99724b9c08e7fb4482f34b68d0c55475aa7e69ae752dd9e8d6574ea992ab56de98dccb60c797e8b98413c7fe6267be892940e
+EBUILD net-tools-1.60_p20130513023548-r99.ebuild 2777 SHA256 7c74e71ea16d2821e6f3f369183cb430c91a0073379cf050ed8f4590f57b271a SHA512 990d3c30fe158c9a205ede566a87d948e9065d93b85f9a17c129aa44d33fd03a55f579378e4c671f642a70893ac237cc089d51a479a4d55a74e549c1006c29d6 WHIRLPOOL c52b338672edd287f07aa613c13a21970fc035f825b60c2d9c5d8fa617cadb49de4f5c370393aec05719d73256cf35841f0b11677f0293e901869a7833885c87
+EBUILD net-tools-1.60_p20141019041918-r99.ebuild 2781 SHA256 18d3b66d1f921fc7ab3cf778dfc6c731927bf39560feb8728c105aeeec9dd20b SHA512 a09b4ec16ae85656721df67ebfeda57bb6b9d49abde9a4e2840ccce0e6f931ff571adaa271bcb9863356f794c222fa738232670c621ec68e6c4a4ab9b5d19754 WHIRLPOOL 291d46d3c17f95e89ea1b6e9385c23dc81b7b4b6bd997cb14db05b9230849ec3efaaae33be46625d50aac131d04ba2f84463f6a1620d3e4380eaaa175435e8f8
+MISC metadata.xml 283 SHA256 cec36850384943bdbf7c366908c2e7e0d68c0c906fa9eeac1796effedb58c8a0 SHA512 3b33e18dedba7de9ab348a5e0546c7732eb74b998a9ee652390c53e44cc2dbc2ced2d54b47827ff20cff868836b02527eb14d6d6a6c32e62af30c36b1d5288c3 WHIRLPOOL bfe91370d53ddd42093b42aff4c92f063103eaae98b16de2f3d5e2fb54b2e61e8c43f72b93c4f7503bfbd38aae05343339e5ab69fde5935ff588be87a4516acc
diff --git a/sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch b/sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch
new file mode 100644
index 00000000..f56dffcd
--- /dev/null
+++ b/sys-apps/net-tools/files/net-tools-fix-header-assumptions.patch
@@ -0,0 +1,93 @@
+diff -Naur net-tools-1.60_p20120127084908.orig/lib/inet6_gr.c net-tools-1.60_p20120127084908/lib/inet6_gr.c
+--- net-tools-1.60_p20120127084908.orig/lib/inet6_gr.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/lib/inet6_gr.c 2014-01-21 19:18:50.557199377 +0000
+@@ -23,9 +23,6 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
+-#include <netinet6/ipv6_route.h> /* glibc doesn't have this */
+-#endif
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+diff -Naur net-tools-1.60_p20120127084908.orig/lib/inet6_sr.c net-tools-1.60_p20120127084908/lib/inet6_sr.c
+--- net-tools-1.60_p20120127084908.orig/lib/inet6_sr.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/lib/inet6_sr.c 2014-01-21 19:19:23.307201208 +0000
+@@ -23,11 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+ #include <net/route.h>
+-#else
+-#include <netinet6/ipv6_route.h> /* glibc does not have this */
+-#endif
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+diff -Naur net-tools-1.60_p20120127084908.orig/lib/inet_sr.c net-tools-1.60_p20120127084908/lib/inet_sr.c
+--- net-tools-1.60_p20120127084908.orig/lib/inet_sr.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/lib/inet_sr.c 2014-01-21 20:41:59.223478324 +0000
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+diff -Naur net-tools-1.60_p20120127084908.orig/lib/util-ank.c net-tools-1.60_p20120127084908/lib/util-ank.c
+--- net-tools-1.60_p20120127084908.orig/lib/util-ank.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/lib/util-ank.c 2014-01-21 20:42:56.876481548 +0000
+@@ -25,6 +25,7 @@
+ #include <netdb.h>
+ #include <arpa/inet.h>
+ #include <resolv.h>
++#include <limits.h>
+
+ #include "intl.h"
+ #include "util-ank.h"
+diff -Naur net-tools-1.60_p20120127084908.orig/mii-tool.c net-tools-1.60_p20120127084908/mii-tool.c
+--- net-tools-1.60_p20120127084908.orig/mii-tool.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/mii-tool.c 2014-01-21 20:54:31.563520392 +0000
+@@ -47,10 +47,6 @@
+ #include <net/if.h>
+ #include <linux/sockios.h>
+
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include <linux/mii.h>
+ #include <linux/sockios.h>
+ #include "version.h"
+diff -Naur net-tools-1.60_p20120127084908.orig/netstat.c net-tools-1.60_p20120127084908/netstat.c
+--- net-tools-1.60_p20120127084908.orig/netstat.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/netstat.c 2014-01-21 20:43:34.023483625 +0000
+@@ -88,6 +88,7 @@
+ #include <sys/stat.h>
+ #include <net/if.h>
+ #include <dirent.h>
++#include <asm-generic/param.h>
+
+ #if HAVE_SELINUX
+ #include <selinux/selinux.h>
+diff -Naur net-tools-1.60_p20120127084908.orig/slattach.c net-tools-1.60_p20120127084908/slattach.c
+--- net-tools-1.60_p20120127084908.orig/slattach.c 2012-01-27 08:49:08.000000000 +0000
++++ net-tools-1.60_p20120127084908/slattach.c 2014-01-21 20:44:46.953487703 +0000
+@@ -45,14 +45,7 @@
+ #include <unistd.h>
+ #include <getopt.h>
+ #include <linux/if_slip.h>
+-
+-#if defined(__GLIBC__)
+-#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 0
+-# include <termbits.h>
+-#else
+ # include <termios.h>
+-#endif
+-#endif
+
+ #include "pathnames.h"
+ #include "net-support.h"
diff --git a/sys-apps/net-tools/metadata.xml b/sys-apps/net-tools/metadata.xml
new file mode 100644
index 00000000..0c72e81d
--- /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_p20120127084908-r99.ebuild b/sys-apps/net-tools/net-tools-1.60_p20120127084908-r99.ebuild
new file mode 100644
index 00000000..abb911a3
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20120127084908-r99.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/net-tools/net-tools-1.60_p20120127084908.ebuild,v 1.16 2014/01/18 03:28:51 vapier Exp $
+
+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
+ KEYWORDS=""
+else
+ PATCH_VER="1"
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz"
+ KEYWORDS="amd64 arm ~mips ppc x86"
+fi
+
+DESCRIPTION="Standard Linux networking tools"
+HOMEPAGE="http://net-tools.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="nls old-output static"
+
+RDEPEND="!<sys-apps/openrc-0.9.9.3"
+DEPEND="${RDEPEND}
+ 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="nt/" master | tar xf - -C "${T}"
+ pushd "${T}" >/dev/null
+ pushd nt >/dev/null
+ sed -i "/^RELEASE/s:=.*:=${pv}:" Makefile || die
+ emake dist >/dev/null
+ popd >/dev/null
+ zcat ${p}.tar.gz | xz > ${p}.tar.xz
+ rm -f ${p}.tar.gz
+ 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://git.overlays.gentoo.org/gitweb/?p=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() {
+ epatch "${FILESDIR}"/${PN}-fix-header-assumptions.patch
+ 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_AFECONET 0
+ 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-r99.ebuild b/sys-apps/net-tools/net-tools-1.60_p20130513023548-r99.ebuild
new file mode 100644
index 00000000..b453df88
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20130513023548-r99.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/net-tools/net-tools-1.60_p20130513023548.ebuild,v 1.6 2014/04/07 20:12:31 vapier Exp $
+
+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="amd64 arm ~mips ppc x86"
+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://git.overlays.gentoo.org/gitweb/?p=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() {
+ epatch "${FILESDIR}"/${PN}-fix-header-assumptions.patch
+ 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_AFECONET 0
+ 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-r99.ebuild b/sys-apps/net-tools/net-tools-1.60_p20141019041918-r99.ebuild
new file mode 100644
index 00000000..529d30e4
--- /dev/null
+++ b/sys-apps/net-tools/net-tools-1.60_p20141019041918-r99.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/net-tools/net-tools-1.60_p20141019041918.ebuild,v 1.1 2014/10/19 04:24:16 vapier Exp $
+
+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="~amd64 ~arm ~mips ~ppc ~x86"
+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://git.overlays.gentoo.org/gitweb/?p=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() {
+ epatch "${FILESDIR}"/${PN}-fix-header-assumptions.patch
+ 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_AFECONET 0
+ 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/pciutils/Manifest b/sys-apps/pciutils/Manifest
new file mode 100644
index 00000000..33b454b1
--- /dev/null
+++ b/sys-apps/pciutils/Manifest
@@ -0,0 +1,7 @@
+AUX conf.d-pciparm 988 SHA256 ffdec7d6c510a502d212129d31a9b37c3b9c75393a48a8b1ee6010b7d4aa1887 SHA512 7c3513a9112318736907f4a1f3e94910d59752d8f51cf4f9f8ccd33b563250aca17a507e0937507bd9352d12a2b9a47e7419306908990b21a3460e6527dab6a4 WHIRLPOOL b5954d8897687a0c6d267c9f60feadb692ce637bf294f5b2f8b7eca479cf454ac541a4bfe904d43ff59e5a77a808c1cecd63aa1011817ba61152d7a4664c86ad
+AUX init.d-pciparm 1871 SHA256 30a62e5778997954f766cdf289a11ac124502943e8422bc33c49b6aa118df6a5 SHA512 231b7b96a751332a5a2395902e2a8024ae687f1e25b881d07bdcfba08acd1b6b6254e8fa694a7e01d851aa28c4ec6ff3d9c5ac64f8c1a471cc1f8f9a325881bd WHIRLPOOL 1fad1cc4fdb031f7f24d9ec47439b6c6f83f22e85b6081eca283ab8cc501f7af9bbf91f8a0118ca10f45490ffab26c4ff4650f1fc1ab418afaf2cf44a0aa9f00
+AUX pciutils-3.1.9-static-pc.patch 373 SHA256 81f8c664cf844adfe2238f6dc584100340de8781d361cb185035d5928aee82fe SHA512 e20286ae41569236b549d13c703266f920f335609c1ad2e5d67fd1561f9e9c68d4ac1fd530f93a4451ec79a5496ed226b83db0c74935499f44cd47e94eb74f49 WHIRLPOOL 9d5bf04b08a76bb786524e8fdc4de412154340f17dcccf48ebcb7504a6b5feb8a719337489a20dd8d94d77bdeb93e75009f66840a18ec63805d8fe36dc7e1981
+AUX pciutils-3.2.0-io.patch 311 SHA256 aec9f72d5c7eae1e7a7ccc5c433322e2c3ff04237b1049cfe22cd952a3fac548 SHA512 9acea1ac1f6d87a647c1c69b084726930535ebcb75e79d5fc750dc2862c6cac0a89187febfd215bdc9bd6f75f2a809c02e7967a35eb288167db0a8a780864f99 WHIRLPOOL bcef00c8f4a079ced8e2354bdefee56fe5c33a60cdb0aaa72bd63528e3e792a22ad49fb894a88bdd46639419af89b9228600788a501684295259dcae6c379287
+DIST pciutils-3.2.0.tar.gz 357003 SHA256 84e705bff712b128a942117565a3506bd4b8bf841d397c1962c6255169762f71 SHA512 ce619bca35c529f947b883858164584db9fd16be05b44bd20d7f30b73246076b8c80a9e0ff3f7b2c27366a08043488ccfee98dd3cb43e3c5ee8962efaa056fd1 WHIRLPOOL fda9efb423ba444b460986b82b89feb3e5940d63774377eab4dce6ed1a1c690824192ca25d04a4f34960412ddedbdb9c874dace2256ccd1dede61ee99618b418
+EBUILD pciutils-3.2.0.ebuild 2279 SHA256 baaee63528064e053068e03eec6210d68d533105fa2e4bd9fbcf5708c3135257 SHA512 03962535e2124984ecf9b02c50ee1b81f5f42bf0b529ebdcc47081bc441cd9cd01927b39ba7e8de79f12022efe3ee8580761b41199591ec20e616545f88a929f WHIRLPOOL 6e4c81b708b84ce1642079632f06c41bc1a576ec043371d33fb20af4cfe18abbfb6f4c03beb579969664bfd035b3ac0b67730d4f5fb050546528c5a61387dbff
+MISC metadata.xml 345 SHA256 2e1f814fd8995f54e2d029e18f0f8f4b742f7383ce3448697994c4a57e498254 SHA512 d075e1944952d3d6c5316c46247003159782dd2e18d449048bc34bfd7f2f307fc287e9a9803f6f1399898c22d4faee294c013241d9b709b887c14b7966c52be6 WHIRLPOOL f1bc3329686d73cc96c8d4bdf5d05451e555aeda3bac9c3a5e2b1b5fa33294b39eff6a1ef5b945d8013c41dbfa188a38a62d205a7ce58ef1cac55828efa5941e
diff --git a/sys-apps/pciutils/files/conf.d-pciparm b/sys-apps/pciutils/files/conf.d-pciparm
new file mode 100644
index 00000000..f036b15a
--- /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 00000000..705b647e
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/files/init.d-pciparm,v 1.3 2008/10/11 02:47:50 robbat2 Exp $
+
+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 00000000..9e63b7ec
--- /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/files/pciutils-3.2.0-io.patch b/sys-apps/pciutils/files/pciutils-3.2.0-io.patch
new file mode 100644
index 00000000..f8cf13b2
--- /dev/null
+++ b/sys-apps/pciutils/files/pciutils-3.2.0-io.patch
@@ -0,0 +1,14 @@
+--- a/pciutils-3.2.0/lib/i386-io-linux.h
++++ b/pciutils-3.2.0/lib/i386-io-linux.h
+@@ -6,11 +6,7 @@
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+-#ifdef __GLIBC__
+ #include <sys/io.h>
+-#else
+-#include <asm/io.h>
+-#endif
+
+ static int
+ intel_setup_io(struct pci_access *a UNUSED)
diff --git a/sys-apps/pciutils/metadata.xml b/sys-apps/pciutils/metadata.xml
new file mode 100644
index 00000000..aa9db869
--- /dev/null
+++ b/sys-apps/pciutils/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='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 00000000..8e9ed66e
--- /dev/null
+++ b/sys-apps/pciutils/pciutils-3.2.0.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/pciutils/pciutils-3.2.0.ebuild,v 1.14 2014/01/18 04:55:35 vapier Exp $
+
+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="amd64 arm ~mips ppc x86"
+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
+ epatch "${FILESDIR}"/${PN}-3.2.0-io.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/sandbox/Manifest b/sys-apps/sandbox/Manifest
new file mode 100644
index 00000000..ee7e77a9
--- /dev/null
+++ b/sys-apps/sandbox/Manifest
@@ -0,0 +1,13 @@
+AUX 09sandbox 37 SHA256 73e9e9d12ba54f1c649813ec86107924050528852c890a8ba1e2853796781bbe SHA512 4e8a9c58debde6480224a45559c5f2db4765213d151e47937f9142f110cac3681bf6402acaf21249a37bb17398e7bc00ae7feee68ecdb5b9363c432eac1b052a WHIRLPOOL 80d55a34d3faf3314f2b9de2200d4b46a800128514be9e30eb59e5f03fb7a0a5197a9e5b5ab33d6b68d35bf83c86a1bd7ba734a33ccd382fe0af3b2c2a11d0bd
+AUX sandbox-2.6-check-empty-paths-at.patch 7454 SHA256 a48759a4d3e9a70713473b6fad59bdd750b5cd37e7d632c786205ff20004ae2c SHA512 5eba7915dedf57f44c37881e9c6b48db8733d1493779a33127d08bb9ea77056d788ec9ace72c13eb101f42f01c95309c7cebca6c76212a8c99a8655372c0b7d7 WHIRLPOOL 46eb3a8ef8f22030cd793f3b16adc190b5750019c0df83e161c6918f08555a8ad890c1425b03cbf7e53ebcd34a07a9dd9b594d0c0fe31834656ffce3d58fa284
+AUX sandbox-2.6-desktop.patch 875 SHA256 2eecf67790aeac210f9aa899a86f7664776ed65d9b55159e1b359162dfb9ff74 SHA512 b72ec7f414d19bf513dfb1aea10523fa5dc07a1375d8f08f664d204b64b23c891a79ca14987528c595936f441e1f595b366aabbc57313667c7639d73d089ed9a WHIRLPOOL 7f787b8be9b5712eb2b2a0cd2ff825df1045ebf1cc4e73a50f610e620d30752045690a5c28835465d0ab0c3c4a9eaf8b92a5c123cd741ad69dfedb31aa457fa0
+AUX sandbox-2.6-include-PROTECTED-symbols.patch 569 SHA256 6edd24b329fd9908005e8566002f213d2799375ad4fced483be4707ddf0570ed SHA512 d96644fc48ec70f992bef55ccae03c0034bfb669586b8257a2c74f1cf0b78f2fbfebc2417ac62cd15841cc5e973272962252b88ca066224cf118eecf060e0d80 WHIRLPOOL f377d71928a6fb84b1e413ae2f4335fe6753d6cc056cb21fe758c8b5559330473a88098c85863c3157b0b5bec8f5530f233f1a2a659eee553c3bb07ae3633399
+AUX sandbox-2.6-log-var.patch 2039 SHA256 f464a29cdd9de0c510277310f4febc8f96515ff2ff03fc92df1c75b9cbd75619 SHA512 cf6f900b4078eff5870b63b2bc7c81c5b00488e030d7e9ce3007693e9d1339ac6201ddacfaff552c6c9b99b6d32383229133c80190404b7e4fde06ad376b2050 WHIRLPOOL db99737a6567788194f7b37b12b92fcfb4c263df40f40aef9e0a3ef2b6a1523331313b791fffa2b26775b646795364ab1db1711eb4329cda3337df27aebfeffa
+AUX sandbox-2.6-musl.patch 1821 SHA256 df08faebffbfade91a2620ff8b56c2087e4a34506fbff3dcf9bc35c2d5bd467c SHA512 69d11e80c97a844c0d84404e802950c876edda8eb7909c90f6f5d4b3fe8a33b5bc884ecc3741c10c8bd7e0871db2db1853cfac969a153d162423b3f3c94039c9 WHIRLPOOL 7120eaf3062cb18c3b13a61fe2b6f839a5f267650d9aa809fafc6d25e8faaadd7af3d5fb41cce66ecf71668555847d264ea977442f03f4dfe7b88b98cf86f78e
+AUX sandbox-2.6-no-pch.patch 702 SHA256 d95a65ffe23c6c81f6b1e695f27cffc1cb617ebf62ca467c8eae5e4c3771089b SHA512 2269b806c2b04c0891644c694d2e0cb87b3ad9236457add50df58d3af62ca5daf17e8b599d0190b4efcae7e84ba99308ea4b0f4a1482d08314d4f3b64bdaf884 WHIRLPOOL 343b62bcf88b0491d69b507eb2feb02b21e9e66cb9006c2043fcaee87f461b3228d37e9053f092e32fff4eb73b14db32a262b79c7430cddf0ddde6f90958e21b
+AUX sandbox-2.6-open-nofollow.patch 2027 SHA256 c8816ae4e1991f9941abd43ec4bfdbf4e99cf36ee90694f77ab88754c53785ce SHA512 dd5222f32a40def38c9719363a24c48d5b112e3560b44c5f32afc3daa0614fe9bc5cb68ca8ac69032cc8d6299f09b25d4d7c72e16892188b42768ffb28c19f07 WHIRLPOOL 03cb5fb9df04a8d7f92855c292a6c431d01d330fecae198f2c4b95d824454f10ce1ad66db1a9d54d1bef5f74989cf6debb2d98de28ee0c2c6a09c1a0752b5519
+AUX sandbox-2.6-static-close-fd.patch 2945 SHA256 807eb4dc1ba6543c94a90a9a53bb89f42079ea20ed7c196f82d65f280e5de96a SHA512 e2f57c4d80816241f3ba4828c2b27c67d1d604b14b2d575888a978e5c4e8e47e60e3a609d81e59c615bc5b7cee6194cc362e255ae8508f632862a35180c30de8 WHIRLPOOL e08f60227fe954894d3a3a01297e9988f4d7722ea75ffbd2b0f3971d38c8ce00af230fcaecb1f53243a868d54f48bb680e2d547bbeb2ee3e5a11f8942d2084fd
+AUX sandbox-2.6-trace-hppa.patch 850 SHA256 20688b2f33162f95af4af5e3c7d3700f2e7776e454b785ac1398f0870f84efa9 SHA512 fb7bf2202f960e952edc1e52fe4b6b085042158223d96b9baa899e871abcdef711ede3122c971120f55f71cc1aad71496a6079222dbaaa6c14b0c6f7ea182454 WHIRLPOOL 80f7fb529b912d19d81b9d71ee4a648db7b217583f2e8f2054cc666839030ea7d0112d69d52a2bf35c4d3549ffbd81dbd0cd39d5993bfabbb43bcb6a4455ade4
+DIST sandbox-2.6.tar.xz 366356 SHA256 95615c5879dfc419713f22ba5506a2802a50ea0ce8a2f57c656354f2e50b1c4d SHA512 32ba7fb675c67fdc8bc52da1db7ed6878e5fea8753accb30d9aca00f708e0dde03287b5962caf5ef031bea6934d6ef3e18404b015c70ebd551d3fd8109ad2371 WHIRLPOOL bab2d015fb0de92a2266408ca7941c8fb66b599179040cfc727ffce5b2424a9722dc55ba89d198e3361044d8cb357314205488d2a980c7b8af063fd8940f0c03
+EBUILD sandbox-2.6-r999.ebuild 3391 SHA256 c4756c9265bc272f82bb6ad7221e15c3d28c9987ec5fb53e9957f02b44dcbf8b SHA512 a7b34f6fab52348f6024d2b719e01067d88c7b30fff4d73b361a5d24042c401e2b65ad3039256dd0c033ee2e3528e39d5988b0a40ec523eadb4a5da679b72503 WHIRLPOOL c80cc5e94914c56e528492cdb042bf79c8cc33d664a19aa38e981d8e453245412b5b4439e4374f1d7d023b0ec050abd641f675a718172012017f0b065e9112b5
+MISC metadata.xml 316 SHA256 488f8a1ba1e1d07a159d22ac198aefee5dfa9ded04de2969019f177161abef1b SHA512 2b4ddea0bb5a40cac834a09b89624049b8561a4a4f648b4d5072c413d4eca78b5cc24859664fa746be36c8b60188e88f2ae38c2c5af30d91dc6273c0f85de278 WHIRLPOOL 64ed27fc7abb1b3b82621f6bb91f03d0070933d0423f9d323ac803354fc6acf2182df1dd85a083fa047d63561a5e92d44287ef4935a11a733244d4393edf8f6f
diff --git a/sys-apps/sandbox/files/09sandbox b/sys-apps/sandbox/files/09sandbox
new file mode 100644
index 00000000..9181eb06
--- /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-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 00000000..e4dc5290
--- /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 00000000..fbecb072
--- /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-include-PROTECTED-symbols.patch b/sys-apps/sandbox/files/sandbox-2.6-include-PROTECTED-symbols.patch
new file mode 100644
index 00000000..cb29a6c8
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-include-PROTECTED-symbols.patch
@@ -0,0 +1,12 @@
+diff -Naur sandbox-2.6.orig/scripts/gen_symbol_version_map.awk sandbox-2.6/scripts/gen_symbol_version_map.awk
+--- sandbox-2.6.orig/scripts/gen_symbol_version_map.awk 2009-02-20 06:29:29.000000000 +0000
++++ sandbox-2.6/scripts/gen_symbol_version_map.awk 2015-06-08 19:29:55.727290000 +0000
+@@ -14,7 +14,7 @@
+
+ # Only check FUNCtion symbols which are not LOCAL, or
+ # do not have DEFAULT visibility
+- if ($4 != "FUNC" || $5 == "LOCAL" || $6 != "DEFAULT")
++ if ($4 != "FUNC" || $5 == "LOCAL" || ($6 != "DEFAULT" && $6 != "PROTECTED"))
+ next;
+
+ for (x in SYMBOLS) {
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 00000000..bfea9e55
--- /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-musl.patch b/sys-apps/sandbox/files/sandbox-2.6-musl.patch
new file mode 100644
index 00000000..ee288d76
--- /dev/null
+++ b/sys-apps/sandbox/files/sandbox-2.6-musl.patch
@@ -0,0 +1,48 @@
+diff -Naur sandbox-2.6.orig/headers.h sandbox-2.6/headers.h
+--- sandbox-2.6.orig/headers.h 2012-07-03 18:27:44.000000000 +0000
++++ sandbox-2.6/headers.h 2014-05-22 13:57:55.225002786 +0000
+@@ -133,9 +133,11 @@
+ #ifdef HAVE_ASM_PTRACE_H
+ # include <asm/ptrace.h>
+ #endif
++/*
+ #ifdef HAVE_LINUX_PTRACE_H
+ # include <linux/ptrace.h>
+ #endif
++*/
+ #undef FU_ia64_fpreg
+ #undef FU_pt_all_user_regs
+
+diff -Naur sandbox-2.6.orig/libsandbox/trace.c sandbox-2.6/libsandbox/trace.c
+--- sandbox-2.6.orig/libsandbox/trace.c 2014-05-22 13:58:25.215002800 +0000
++++ sandbox-2.6/libsandbox/trace.c 2014-05-22 13:57:26.515002772 +0000
+@@ -9,7 +9,7 @@
+ #include "wrappers.h"
+ #include "sb_nr.h"
+
+-static long _do_ptrace(enum __ptrace_request request, const char *srequest, void *addr, void *data);
++static long _do_ptrace(int request, const char *srequest, void *addr, void *data);
+ #define do_ptrace(request, addr, data) _do_ptrace(request, #request, addr, data)
+ #define _trace_possible(data) true
+
+@@ -43,7 +43,7 @@
+ _exit(status);
+ }
+
+-static long _do_ptrace(enum __ptrace_request request, const char *srequest, void *addr, void *data)
++static long _do_ptrace(int request, const char *srequest, void *addr, void *data)
+ {
+ long ret;
+ try_again:
+diff -Naur sandbox-2.6.orig/scripts/gen_symbol_header.awk sandbox-2.6/scripts/gen_symbol_header.awk
+--- sandbox-2.6.orig/scripts/gen_symbol_header.awk 2014-05-22 13:58:25.235002800 +0000
++++ sandbox-2.6/scripts/gen_symbol_header.awk 2014-05-22 13:57:26.520002772 +0000
+@@ -161,7 +161,7 @@
+ else
+ printf("symbol_version(%s, %s, %s);\n",
+ sym_real_name, sym_index, symbol_array[2]);
+- } else {
++ } else if (!(sym_index ~ 64)) {
+ # For non-versioned libc's we use strong aliases
+ printf("strong_alias(%s, %s);\n", sym_real_name,
+ sym_index);
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 00000000..fe227492
--- /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 00000000..0101ece2
--- /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 00000000..7fc09725
--- /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 00000000..7e738228
--- /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 00000000..9e13eaea
--- /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-2.6-r999.ebuild b/sys-apps/sandbox/sandbox-2.6-r999.ebuild
new file mode 100644
index 00000000..1221d284
--- /dev/null
+++ b/sys-apps/sandbox/sandbox-2.6-r999.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sandbox/sandbox-2.6-r1.ebuild,v 1.16 2014/01/18 01:59:21 vapier Exp $
+
+#
+# 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="amd64 arm ~mips ppc x86"
+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}-musl.patch
+ epatch "${FILESDIR}"/${P}-include-PROTECTED-symbols.patch
+ epatch_user
+}
+
+sb_configure() {
+ mkdir "${WORKDIR}/build-${ABI}"
+ cd "${WORKDIR}/build-${ABI}"
+
+ use multilib && multilib_toolchain_setup ${ABI}
+
+ # hack for conflict between powerpc bits/user.h and asm/ptrace.h
+ use elibc_musl && append-cppflags -D_ASM_POWERPC_PTRACE_H
+
+ 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
+
+ # Sandbox builds on mips-musl but fails to run
+ use mips && chmod -x "${ROOT}"/usr/bin/sandbox
+}
diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest
new file mode 100644
index 00000000..47d0d74e
--- /dev/null
+++ b/sys-apps/shadow/Manifest
@@ -0,0 +1,21 @@
+AUX default/useradd 96 SHA256 31aa2cbe4a34a9f7d4d134c1fecd007c9bbf4d40e19d0dcddbcd396f1853b490 SHA512 87b01ac88c2065392fa988871489d8403ef93341b4cfbadb4504f39a2a3396ddef756efc6378868d00627a58a1feb9612eb52a8135558a211a09c6a9ccf3404f WHIRLPOOL 9022a371e34e96a4c3193f24752979da27cdcd60aec1c8db1d2b427ab880b16917578ddcb4d8af02fd1d0eedc6b346cf43d7ae892e8580321e32e50f5498980b
+AUX login.defs 6254 SHA256 b7bfd7b1c34ce3d35865b572abc69d278dea4eef4f349c26b238735547c4ac22 SHA512 7d21d6f72693e5485bde8bbf18a66b3aefef58fae057825fa84beeb548b78d7e12c00149d9c63a5fbdc32daaf1ee5bfa57f63b523b391562d4d2e81a6c06cf27 WHIRLPOOL 756549cd21f0101c861ece9194405a13a1fc4e7c3b9bae080103a3e1bb94b5073d90904d63c7c25fd2f02ef1c4a0d43b9eac4879adc0e1ad4ade4d2ee4532ab9
+AUX login.pamd.3 190 SHA256 1009e196b630dae5d1f40b1cc6ee42a38ecdb7c2cd4bfa40fb7114ee74e0bfd0 SHA512 7181fcdf5dc798230f482cd52827680839f054f79d67498bbdbc20d9926752d34858af37d0b5afc28be9ef5247ad884e027d6ccf29ea0f69ba75a6cdd80918f1 WHIRLPOOL 63012c9e4899f644e2f91fa31348d76718811035e42e5a94425a1e9689b8a67f92e11228b629ce70b9114a44ce4bdf54770fb6805aaacbc4beba4ab302589b24
+AUX login_defs.awk 738 SHA256 6ceb9e03c2f7df817f3162de48886c9c66a596cb2af98fbf523c93e26840113b SHA512 06a19785c55dd7b389342535c3dd9f56114eba54e27c415d921b8598f9862bad4c8d1b251bd0eb036ecefdf4124c444f30c504d7921d93dab3a0eaea03625f72 WHIRLPOOL 047cc78b7faf93b4508efa3f6238d2c013af4cffc920a7ffc0f0197d69cb301189f32ae2d74a9dceafea4999a33e0656dfd43aa4f791b5855e12a553e770ccde
+AUX login_defs_pam.sed 479 SHA256 587239d5b1425c5766f10cea5352b325699fb35829d9375bda68bbfd74f1d839 SHA512 c4bda7776b5a0bdaa8e7e36c09fb005699cf8b1ef5b474021f7e95d98e62a39aebd354dcc8ad0c49316e8e5d0123429b893c3ff9e4024c18ac0e25b4ab4b45ed WHIRLPOOL a6c5ce16824dde56b4ae899cb9b8effc9b7d61133e88e262a22a5e0db080c85ead15d6d9a13c5583b6e55b368ffd890bf037a3957ce6071b370dd7fb50d63bf4
+AUX pam.d-include/login 245 SHA256 39bbe2ed696a22c7549a39a7cfd47c16e347e5af4fd71b8c01ec87fce59ba0a0 SHA512 87a503ed5df2c522cbf97dcb7f6c252fe9e6e4a4fd34e6641b5cbbaebd2ff4a4d861eeadb0196c7cb30717db8fa2194072500af2336f4b81d4bd87b106699c35 WHIRLPOOL 85a34f81ad9337d06c3162c4c897d8e20f26e9ad9eb399adf11e5eea4538d274ecd9498da37a4e374521d480eadcbcdf98b1991a79580af6e8bb1890f6e02f2f
+AUX pam.d-include/other 142 SHA256 5e05df2743ec0021364b05f4bbe2e5a3a670abb5af845c3fa760731e5b7272ca SHA512 639db65a3f573e5d800790931ddac0f378a2d678338ff45068b9f5dda8aa9ebd858fed86c0c1e4f45c2ce3d04e3d8d4ec4ced57837a54e3c18e209711cfe2522 WHIRLPOOL ea34f5db2897fc506c63d0e0a2efc20d5f8c7b1f7353d1ab98c5becf8d0e73c1299a357114412376f17b42f43e0f1685810afe5dc86f42a400b86d7f9a314936
+AUX pam.d-include/passwd 144 SHA256 8c54d2e3aab50b2a8d3d36aa37f7d7bb32c15d9a3af9a10b7ec5b5ffcff9a5fb SHA512 31611a08d97cd2c129f18d451a555ff6c781f91603c77fc0c66ff406b5fa4a97db19ae4ce104816a6324529d10e131de0d5329646bdab2abc8dc3ee5b82b057f WHIRLPOOL 879370adfb6a78c0acdeebf2c10a503d94925c34dceadb8677693f6c34e4e973f2584b221a9a81fdf23f084c430bbafa23a03440c1a95c798b58faedf4d412bd
+AUX pam.d-include/shadow 152 SHA256 7fc1ccca85d2b1ac4dad9909792453c8d26e9aeab48c620d861a92b9355ac69f SHA512 d07611c350d0d6f3386db5080c80a84e4135cf33e44fd3a390cb1092e034f9bd2a69495fadd4bda6ede9962e9658e77f2c8e12d3189cdcda6c7b3c607336f0c3 WHIRLPOOL 2b5282f983b5bf52c0311c2153dba2d12f6c07ae803d1723010bf4bbf4962d120aea026d32b1f3b062778da5222e7cb16dc39660e53b72173fba723a57b616de
+AUX pam.d-include/su 1059 SHA256 63a6a6fb6194f4dff8fdd16214a563242a4ea6cb682f49af337378dfddaf2962 SHA512 c9535434437221fad058b9fad878da13f3a3d4fc9290e4a7366e6d4dab7e320ac40de297bcc874fbe83e50b5ea29c5aac39d7d250632f045d964150604381550 WHIRLPOOL 33283dee1e71ae36112c72d36852680291bab919158e8faab478f7fd32035732b2cf62d83df373fa06869d3c84f05b34477598e776f8e65a39dbc0ef8a2c3724
+AUX pam.d-include/su-openpam 249 SHA256 8d26b735b1b5aa598fc29a88a2d52eeed587210dd1dbd3180ef9bb440a3375b7 SHA512 242328ac89744a5178fdf904b4068d358e07a3ab69035ed586de05ae31a59a4d9929ae6e5f3aa0c60b61b22d8df8584aca47e3f682416979e89d4c7dbc76bdcd WHIRLPOOL 3f7e52c38abc07d9d289edc0b6b31ea8d5d84520e737f4e289e75c5df965eda424f0a4706bb3e5fd6e556b274a6472dc5ca90ba23d17f609ae1311b013b0aef7
+AUX pam.d-include/system-auth 380 SHA256 704c07b9bab8201d55d80970e5a086ea35d93d62969aeb27ee9ebef85a029ed9 SHA512 4a359425064711a4194cff517175f708c829e6f1ca24a77ce38eb10482a8ca5a7ac1f9e25ce301d1f0278963768483344d6caf0548685eb33019f8d4a7d4f847 WHIRLPOOL 8607d4d2a12ac3252902c5a5c592b07903e843a8ada2ed87bf589ab9ab358eef9734a5294862baa5558eef1381c5a77c4fd3e62b1bb9898232aab78f60fbe5d3
+AUX pam.d-include/system-auth-1.1 365 SHA256 e073f573c88515cf38fb22faa26ccf87d55d34e6d460d28ad25682958de4c13e SHA512 3633aff2be598a108d75bd5c2b92b399f0b244327be54ff29d498ef8f95107d0c39a62ffe983e19198d54540c36c028316b628081abf5e8f85cb946db41055c2 WHIRLPOOL 1cb61620c3fbc8ada4676b04d9e38da345f300e1115a13f81790decaa57d56d6d8ada8d1fa12c1857b0ea3591583cb9fa6f195237ebfa1e0ba48e667defa2c5f
+AUX securetty 262 SHA256 9bc3c187d5535ebe83cf22129b7189a9d8e4c05520af187bff6cff4d8f083c67 SHA512 d841f00a4c83e9672ec3620cdff73f2cd02a1a9e883115b329720b5f6ffbf6faa0ff8ac975f1494f7ad07f0ffa91f6eb983a617e604af67dd46062069b09f7f2 WHIRLPOOL 4b7ee107532d1a2e528745c5e3dcb770fc54f7f2a7dcc0f706613e5623f9a5521ee808900a5ffeb68073d9787ebe08606e6eaf95cdb400c9490b0da3614deaa8
+AUX shadow-4.1.3-dots-in-usernames.patch 302 SHA256 2299ffaec204d20e00d791bf5b982571c9261a74c7a7b865a9f7cad1cdcb43ba SHA512 ad20fb3f4f0292f39b5da796e41df71e9e8b1b81dd11a99b2d988440c1b435b0061333a0a5a37a909598d5a840a75946e8c59c74426bae7452de88cf673a5f7d WHIRLPOOL f0258b24f7731ab7b15a1fca391593c8bbd6bdf2ddad57af1d7960d05af49bc5b706039caa576646cb3d817d2d4ad8e89526b12fe046301c63c1518d01dcf173
+AUX shadow-4.1.5.1-fix-RUSEROK.patch 397 SHA256 0f64dd68b55aee9a7059548c97906011d6799078462d41cdb3fcc75de1ff0b0d SHA512 31049022e162223cf66624f861e6acc5451ae10999f93fa3cc49edb0d208c7d522aa39d6aeb12fde0efae05f922acdb46b19a09e45e8c82e85232cf11139972f WHIRLPOOL 11b9999c38a730afa10c7315e204ffb8945e3e823f5a7807a778eeef7ebcceb8da95a6c30c98528675b8d1962104cf6edeb5af6b59c4efbfa11b4e262afde078
+AUX shadow-4.1.5.1-fix-struct_in_addr-collision.patch 418 SHA256 91ebfec6ab1bc824053f590ba8c6f3f90c0a47803e73531ad02521e1f3809c47 SHA512 0561d18a6e80f3250d290cc93c87e714c66f6e87ed147f40ae8a2c8011b0fddc7fc489569e6ea94c05867a5a8b2b65b23da22e35266274677b141b38475dfaf2 WHIRLPOOL bc2c4e11d73ae200b58b0ef273d940862d535e49d227984489d297c76f2e419b41861798371db0b241e2cb3b16a560999a47a7fb4438d7f742395fcba1570000
+AUX shadow-4.1.5.1-include-sys-socket.patch 439 SHA256 10889b8a8c168d708a8997bac6564c50bbcb2ad9d6ccca5412965c9b0d5860ac SHA512 eb526b3e932ebc599ca6a42c0a1aab9a9de8f8bd3ff7278ccddb1552c216c642be50e61e9cbc40798d027cbb944682fccf40cdc2b16fbefc65d60bcdafd56939 WHIRLPOOL 79ae6ded499296dc91fdeb4d25240f210902f202444f3ca44c935fe7a20d228fcdf9da2509cd68d85953a4fd1b457d38d325481713c97b68e5b7c112ca65fa8f
+DIST shadow-4.1.5.1.tar.bz2 2193325 SHA256 aa32333748d68b58ed3a83625f0165e0f6b9dc4639e6377c9300c6bf4fe978fb SHA512 c3bc605de1ca5b774b80d0d92cef5d4c0d5b4a206acadcf5a819f195453093bfe7990d7e32b98799180847ae4fadecfc7876c8ee7297f343acce2230d805d02c WHIRLPOOL 08751597b5b57057f0a3141be97204df49fada25adf0a9f43106a4099ce1b06fec6e90592e43ff1d789bf0a7e16a40b45f29830879ea5c71e9f5a1a81e7a7357
+EBUILD shadow-4.1.5.1-r99.ebuild 5315 SHA256 62908768e6ef0da9948c4c80bc7193b36bf8751d84d6424e6596e847a9f58239 SHA512 9a14a651c9a2baec762a5d338451092a5f07c714c659f5c0d603abeb5d61f8624d47ca801f22fe83980f551f530a555bee7e165666b74997be3b95efb43bfcc5 WHIRLPOOL 228fd1aedd45928939a06c71776f25191d105ef9ca4ffb9d5d0766128bed6a837891d226986d7a16f1ca644c6da1838b9f89fec4f7d4c20c58f242d8a53de897
+MISC metadata.xml 374 SHA256 1675a5791603e79e431df63215162737553fa8018360b026739ac3284bca54b2 SHA512 0bb65b45fa94ddea89f7e0a879fd996b3f363b3e58eb6cbd71251fd79416667f103af4bac0c87f3ba240e0ce3f323c77ce7be9f6ea92c13d619ff8cef8797add WHIRLPOOL e7f4f5d975440fe71dbb35dee4394aa808fce7b5e58ac64d162418a47ed99cb002c7622563be4f6800967d6b8530d29dbd895e431c78f75a5cdf490b8c1afc45
diff --git a/sys-apps/shadow/files/default/useradd b/sys-apps/shadow/files/default/useradd
new file mode 100644
index 00000000..ae81dbb3
--- /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 b/sys-apps/shadow/files/login.defs
new file mode 100644
index 00000000..4aa7044b
--- /dev/null
+++ b/sys-apps/shadow/files/login.defs
@@ -0,0 +1,212 @@
+#
+# /etc/login.defs - Configuration control definitions for the login package.
+#
+# $Id: login.defs,v 1.6 2006/03/12 23:47:08 flameeyes Exp $
+#
+# Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
+# If unspecified, some arbitrary (and possibly incorrect) value will
+# be assumed. All other items are optional - if not specified then
+# the described action or option will be inhibited.
+#
+# Comment lines (lines beginning with "#") and blank lines are ignored.
+#
+# Modified for Linux. --marekm
+
+#
+# Delay in seconds before being allowed another attempt after a login failure
+#
+FAIL_DELAY 3
+
+#
+# Enable display of unknown usernames when login failures are recorded.
+#
+LOG_UNKFAIL_ENAB no
+
+#
+# Enable logging of successful logins
+#
+LOG_OK_LOGINS no
+
+#
+# Enable "syslog" logging of su activity - in addition to sulog file logging.
+# SYSLOG_SG_ENAB does the same for newgrp and sg.
+#
+SYSLOG_SU_ENAB yes
+SYSLOG_SG_ENAB yes
+
+#
+# If defined, either full pathname of a file containing device names or
+# a ":" delimited list of device names. Root logins will be allowed only
+# upon these devices.
+#
+CONSOLE /etc/securetty
+#CONSOLE console:tty01:tty02:tty03:tty04
+
+#
+# If defined, all su activity is logged to this file.
+#
+#SULOG_FILE /var/log/sulog
+
+#
+# If defined, file which maps tty line to TERM environment parameter.
+# Each line of the file is in a format something like "vt100 tty01".
+#
+#TTYTYPE_FILE /etc/ttytype
+
+#
+# If defined, the command name to display when running "su -". For
+# example, if this is defined as "su" then a "ps" will display the
+# command is "-su". If not defined, then "ps" would display the
+# name of the shell actually being run, e.g. something like "-sh".
+#
+SU_NAME su
+
+#
+# *REQUIRED*
+# Directory where mailboxes reside, _or_ name of file, relative to the
+# home directory. If you _do_ define both, MAIL_DIR takes precedence.
+#
+MAIL_DIR /var/spool/mail
+
+#
+# If defined, file which inhibits all the usual chatter during the login
+# sequence. If a full pathname, then hushed mode will be enabled if the
+# user's name or shell are found in the file. If not a full pathname, then
+# hushed mode will be enabled if the file exists in the user's home directory.
+#
+HUSHLOGIN_FILE .hushlogin
+#HUSHLOGIN_FILE /etc/hushlogins
+
+#
+# *REQUIRED* The default PATH settings, for superuser and normal users.
+#
+# (they are minimal, add the rest in the shell startup files)
+ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ENV_PATH PATH=/bin:/usr/bin
+
+#
+# Terminal permissions
+#
+# TTYGROUP Login tty will be assigned this group ownership.
+# TTYPERM Login tty will be set to this permission.
+#
+# If you have a "write" program which is "setgid" to a special group
+# which owns the terminals, define TTYGROUP to the group number and
+# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign
+# TTYPERM to either 622 or 600.
+#
+TTYGROUP tty
+TTYPERM 0600
+
+#
+# Login configuration initializations:
+#
+# ERASECHAR Terminal ERASE character ('\010' = backspace).
+# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
+# UMASK Default "umask" value.
+#
+# The ERASECHAR and KILLCHAR are used only on System V machines.
+# The ULIMIT is used only if the system supports it.
+# (now it works with setrlimit too; ulimit is in 512-byte units)
+#
+# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
+#
+ERASECHAR 0177
+KILLCHAR 025
+UMASK 022
+
+#
+# Password aging controls:
+#
+# PASS_MAX_DAYS Maximum number of days a password may be used.
+# PASS_MIN_DAYS Minimum number of days allowed between password changes.
+# PASS_WARN_AGE Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS 99999
+PASS_MIN_DAYS 0
+PASS_WARN_AGE 7
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN 1000
+UID_MAX 60000
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN 100
+GID_MAX 60000
+
+#
+# Max number of login retries if password is bad
+#
+LOGIN_RETRIES 3
+
+#
+# Max time in seconds for login
+#
+LOGIN_TIMEOUT 60
+
+#
+# Which fields may be changed by regular users using chfn - use
+# any combination of letters "frwh" (full name, room number, work
+# phone, home phone). If not defined, no changes are allowed.
+# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
+#
+CHFN_RESTRICT rwh
+
+#
+# List of groups to add to the user's supplementary group set
+# when logging in on the console (as determined by the CONSOLE
+# setting). Default is none.
+#
+# Use with caution - it is possible for users to gain permanent
+# access to these groups, even when not logged in on the console.
+# How to do it is left as an exercise for the reader...
+#
+#CONSOLE_GROUPS floppy:audio:cdrom
+
+#
+# Should login be allowed if we can't cd to the home directory?
+# Default in no.
+#
+DEFAULT_HOME yes
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD /usr/sbin/userdel_local
+
+#
+# When prompting for password without echo, getpass() can optionally
+# display a random number (in the range 1 to GETPASS_ASTERISKS) of '*'
+# characters for each character typed. This feature is designed to
+# confuse people looking over your shoulder when you enter a password :-).
+# Also, the new getpass() accepts both Backspace (8) and Delete (127)
+# keys to delete previous character (to cope with different terminal
+# types), Control-U to delete all characters, and beeps when there are
+# no more characters to delete, or too many characters entered.
+#
+# Setting GETPASS_ASTERISKS to 1 results in more traditional behaviour -
+# exactly one '*' displayed for each character typed.
+#
+# Setting GETPASS_ASTERISKS to 0 disables the '*' characters (Backspace,
+# Delete, Control-U and beep continue to work as described above).
+#
+# Setting GETPASS_ASTERISKS to -1 reverts to the traditional getpass()
+# without any new features. This is the default.
+#
+GETPASS_ASTERISKS 0
+
+#
+# Enable setting of the umask group bits to be the same as owner bits
+# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
+# the same as gid, and username is the same as the primary group name.
+#
+# This also enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
diff --git a/sys-apps/shadow/files/login.pamd.3 b/sys-apps/shadow/files/login.pamd.3
new file mode 100644
index 00000000..13abd279
--- /dev/null
+++ b/sys-apps/shadow/files/login.pamd.3
@@ -0,0 +1,6 @@
+auth required pam_securetty.so
+auth include system-local-login
+
+account include system-local-login
+password include system-local-login
+session include system-local-login
diff --git a/sys-apps/shadow/files/login_defs.awk b/sys-apps/shadow/files/login_defs.awk
new file mode 100644
index 00000000..56087c64
--- /dev/null
+++ b/sys-apps/shadow/files/login_defs.awk
@@ -0,0 +1,32 @@
+# Fixes up login defs for PAM by commenting all non-PAM options and adding a
+# comment that it is not supported with PAM.
+#
+# Call with lib/getdef.c and etc/login.defs as args in the root source directory
+# of shadow, ie:
+#
+# gawk -f login_defs.awk lib/getdef.c etc/login.defs > login.defs.new
+#
+
+(FILENAME == "lib/getdef.c") {
+ if ($2 == "USE_PAM")
+ start_printing = 1
+ else if ($1 == "#endif")
+ nextfile
+ else if (start_printing == 1)
+ VARS[count++] = substr($1, 3, length($1) - 4)
+}
+
+(FILENAME != "lib/getdef.c") {
+ print_line = 1
+ for (x in VARS) {
+ regex = "(^|#)" VARS[x]
+ if ($0 ~ regex) {
+ print_line = 0
+ printf("%s%s\t(NOT SUPPORTED WITH PAM)\n",
+ ($0 ~ /^#/) ? "" : "#", $0)
+ }
+ }
+ if (print_line)
+ print $0
+}
+
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 00000000..ba308ba9
--- /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/login b/sys-apps/shadow/files/pam.d-include/login
new file mode 100644
index 00000000..9d216779
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/login
@@ -0,0 +1,12 @@
+#%PAM-1.0
+
+auth required pam_securetty.so
+auth include system-auth
+auth required pam_nologin.so
+
+account include system-auth
+
+password include system-auth
+
+session include system-auth
+session optional pam_console.so
diff --git a/sys-apps/shadow/files/pam.d-include/other b/sys-apps/shadow/files/pam.d-include/other
new file mode 100644
index 00000000..bb0b9647
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/other
@@ -0,0 +1,9 @@
+#%PAM-1.0
+
+auth required pam_deny.so
+
+account required pam_deny.so
+
+password required pam_deny.so
+
+session required pam_deny.so
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 00000000..960b32ea
--- /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 00000000..743b2f02
--- /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/pam.d-include/su b/sys-apps/shadow/files/pam.d-include/su
new file mode 100644
index 00000000..d15c7edf
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/su
@@ -0,0 +1,32 @@
+#%PAM-1.0
+
+auth sufficient pam_rootok.so
+
+# If you want to restrict users begin allowed to su even more,
+# create /etc/security/suauth.allow (or to that matter) that is only
+# writable by root, and add users that are allowed to su to that
+# file, one per line.
+#auth required pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.allow
+
+# Uncomment this to allow users in the wheel group to su without
+# entering a passwd.
+#auth sufficient pam_wheel.so use_uid trust
+
+# Alternatively to above, you can implement a list of users that do
+# not need to supply a passwd with a list.
+#auth sufficient pam_listfile.so item=ruser sense=allow onerr=fail file=/etc/security/suauth.nopass
+
+# Comment this to allow any user, even those not in the 'wheel'
+# group to su
+auth required pam_wheel.so use_uid
+
+auth include system-auth
+
+account include system-auth
+
+password include system-auth
+
+session include system-auth
+session required pam_env.so
+session optional pam_xauth.so
+
diff --git a/sys-apps/shadow/files/pam.d-include/su-openpam b/sys-apps/shadow/files/pam.d-include/su-openpam
new file mode 100644
index 00000000..e9ec7d3d
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/su-openpam
@@ -0,0 +1,14 @@
+#%PAM-1.0
+
+auth sufficient pam_rootok.so
+
+auth include system-auth
+
+account include system-auth
+
+password include system-auth
+
+session include system-auth
+session required pam_env.so
+session optional pam_xauth.so
+
diff --git a/sys-apps/shadow/files/pam.d-include/system-auth b/sys-apps/shadow/files/pam.d-include/system-auth
new file mode 100644
index 00000000..b7c37afd
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/system-auth
@@ -0,0 +1,14 @@
+#%PAM-1.0
+
+auth required pam_env.so
+auth sufficient pam_unix.so likeauth nullok nodelay
+auth required pam_deny.so
+
+account required pam_unix.so
+
+password required pam_cracklib.so retry=3
+password sufficient pam_unix.so nullok md5 shadow use_authtok
+password required pam_deny.so
+
+session required pam_limits.so
+session required pam_unix.so
diff --git a/sys-apps/shadow/files/pam.d-include/system-auth-1.1 b/sys-apps/shadow/files/pam.d-include/system-auth-1.1
new file mode 100644
index 00000000..fe804831
--- /dev/null
+++ b/sys-apps/shadow/files/pam.d-include/system-auth-1.1
@@ -0,0 +1,14 @@
+#%PAM-1.0
+
+auth required pam_env.so
+auth sufficient pam_unix.so likeauth nullok
+auth required pam_deny.so
+
+account required pam_unix.so
+
+password required pam_cracklib.so retry=3
+password sufficient pam_unix.so nullok md5 shadow use_authtok
+password required pam_deny.so
+
+session required pam_limits.so
+session required pam_unix.so
diff --git a/sys-apps/shadow/files/securetty b/sys-apps/shadow/files/securetty
new file mode 100644
index 00000000..c7042fae
--- /dev/null
+++ b/sys-apps/shadow/files/securetty
@@ -0,0 +1,33 @@
+# /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
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 00000000..efcb33db
--- /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.1.5.1-fix-RUSEROK.patch b/sys-apps/shadow/files/shadow-4.1.5.1-fix-RUSEROK.patch
new file mode 100644
index 00000000..35ed22e8
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5.1-fix-RUSEROK.patch
@@ -0,0 +1,12 @@
+diff -Naur shadow-4.1.5.1.orig/libmisc/rlogin.c shadow-4.1.5.1/libmisc/rlogin.c
+--- shadow-4.1.5.1.orig/libmisc/rlogin.c 2009-07-12 22:24:45.000000000 +0000
++++ shadow-4.1.5.1/libmisc/rlogin.c 2013-07-06 11:01:09.415878105 +0000
+@@ -187,7 +187,7 @@
+ * go fix the #define in config.h.
+ */
+
+-#ifndef RUSEROK
++#if RUSEROK == 0
+ return 0;
+ #else
+ return ruserok (remote_host, pwd->pw_uid == 0,
diff --git a/sys-apps/shadow/files/shadow-4.1.5.1-fix-struct_in_addr-collision.patch b/sys-apps/shadow/files/shadow-4.1.5.1-fix-struct_in_addr-collision.patch
new file mode 100644
index 00000000..6761ff92
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5.1-fix-struct_in_addr-collision.patch
@@ -0,0 +1,12 @@
+diff -Naur shadow-4.1.5.1.orig/libmisc/utmp.c shadow-4.1.5.1/libmisc/utmp.c
+--- shadow-4.1.5.1.orig/libmisc/utmp.c 2014-01-16 13:59:51.517973402 +0000
++++ shadow-4.1.5.1/libmisc/utmp.c 2014-01-16 14:00:13.147974612 +0000
+@@ -45,8 +45,6 @@
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <sys/socket.h>
+-#include <linux/in.h>
+-#include <linux/in6.h>
+
+ #ident "$Id: utmp.c 3720 2012-05-18 17:57:52Z nekral-guest $"
+
diff --git a/sys-apps/shadow/files/shadow-4.1.5.1-include-sys-socket.patch b/sys-apps/shadow/files/shadow-4.1.5.1-include-sys-socket.patch
new file mode 100644
index 00000000..0b93c9d0
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5.1-include-sys-socket.patch
@@ -0,0 +1,13 @@
+diff -Naur shadow-4.1.5.1.orig/libmisc/utmp.c shadow-4.1.5.1/libmisc/utmp.c
+--- shadow-4.1.5.1.orig/libmisc/utmp.c 2012-05-18 17:57:54.000000000 +0000
++++ shadow-4.1.5.1/libmisc/utmp.c 2013-07-06 03:49:09.871428783 +0000
+@@ -44,6 +44,9 @@
+ #include <assert.h>
+ #include <netdb.h>
+ #include <stdio.h>
++#include <sys/socket.h>
++#include <linux/in.h>
++#include <linux/in6.h>
+
+ #ident "$Id: utmp.c 3720 2012-05-18 17:57:52Z nekral-guest $"
+
diff --git a/sys-apps/shadow/metadata.xml b/sys-apps/shadow/metadata.xml
new file mode 100644
index 00000000..59792273
--- /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-r99.ebuild b/sys-apps/shadow/shadow-4.1.5.1-r99.ebuild
new file mode 100644
index 00000000..26536e61
--- /dev/null
+++ b/sys-apps/shadow/shadow-4.1.5.1-r99.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/shadow/shadow-4.1.5.1.ebuild,v 1.4 2013/03/12 14:19:37 vapier Exp $
+
+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="amd64 arm ~mips ppc 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 "${FILESDIR}"/${P}-include-sys-socket.patch
+ epatch "${FILESDIR}"/${P}-fix-RUSEROK.patch
+ epatch "${FILESDIR}"/${P}-fix-struct_in_addr-collision.patch
+ 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/sysvinit/Manifest b/sys-apps/sysvinit/Manifest
new file mode 100644
index 00000000..2aa20dae
--- /dev/null
+++ b/sys-apps/sysvinit/Manifest
@@ -0,0 +1,12 @@
+AUX inittab-2.87 1893 SHA256 abe0e3a60564bbce32fb54a919166efc486678826f54fbf9847aeb68abb87831 SHA512 a24aecc907faf65492b3ffeaaf1f8d4fb80b5796ccd087bb148fb0df9ecdf448e040b04d6c9a54bd9fa30418c712e22aeeb8914af68741dcb105faca13e48472 WHIRLPOOL 7c5202b1b1e3e4b609a96dfdb8f089e692e762e897f3d5c17c3085a4c1c57124d20bc8bf68403ee55eb2ccdaee22895d4bcdf999a3a8cc8c982085efb8d9f198
+AUX reboot.sh 304 SHA256 967fa572014ac6dd69f5e7e24d5250abad9c20c644563b927b295778608cafef SHA512 d47cde84e3a3b98b2f24d09d58977e22ec3db23c5860624ce29a40815df1a7aa69d9da92fd13769e19b52291e48d24a930fe536ba16365ada0ad96a6e157b73c WHIRLPOOL 5fc4d2479eda414bbad53ffa9a22d1333b366d84657c816c9019d5050f84de551e8793712c2d4153189c22216afd1ba7dff7aed91544f7a2428fd65114968e42
+AUX shutdown.sh 385 SHA256 2cc84a5194a949f16a82c6215459f4bf6d8156e50d8d9130d310f085bb208d4c SHA512 cffa58c2b548e6aadeb05944cf7b88f93b4b40351766eaf24e0e3f258c03bb24c748311fcbb30c16efa3ed7b9cc0ccaa2be02099e1f37930f599d064da9e2054 WHIRLPOOL 42b63e21e12975c21c5aec479696b836e482b622b81ec7028139f7fea2f6a77d4bf98414ecd139ad5b1c5d698963a15ce5aedd06f7deb60193249f3dbc33c3d9
+AUX sysvinit-2.86-kexec.patch 3910 SHA256 a9d764afc05ae73c2153b024a3b9e3295ba913e14e9684ddf1fd94467e4bc823 SHA512 6ce3adf698554d15394edbe6dbfc62822859854d503b201c9f96bd81c2a8cd249ed44229a85dd8b97f454f9311abc5792e349f5cc512ff6d5570500d88044bee WHIRLPOOL aecabc2b97e80d401bba856a38ab92d66c038eb00fe58e56e7e87d6ecb4ef0ec8e07534430887eb3f204dfac20f2d94e6ea81e2d7597e3a937442f376f703887
+AUX sysvinit-2.86-shutdown-single.patch 1229 SHA256 78852ca410e7ee23bf69cb6e566cb90404d8c8b7bcc10b264f66c97e0359d431 SHA512 b1fa6225cdb0d5ed6d2d3128a9ad29dc76f14845c3fe57aa2edf234af456ae49f700b25ed4170a6337f662be224bd6ddfd424331483b0c482fd33cd045ddc575 WHIRLPOOL a770eec46053c67a047832742197b8d30d8b5e2e27cad0dc4f608cbccde0b5ece7e08102c51372cc0b33304e266e3b03156d12209db14fbe61800b312ad556aa
+AUX sysvinit-2.88-makefile.patch 1545 SHA256 34d6ee50be139ad08b620569df11ac6a4cdf3dae737733dda21a716c4064c194 SHA512 d19e260902f69dd19bfaa4f3e415a816388663a7f89b9d102b27f44c5f2d0654b64ab2e5689a20a3975ff0801e4fb96ef7b6737bfb4ba9466ec58c477de322aa WHIRLPOOL bba46046a59969ac2007c3c932bf07646a5ebece72a216990c185b8eeead724e88cd349219ae528060b9c71a5df97d1e3221691cdbb77e16c9522014c836a76d
+AUX sysvinit-2.88-musl.patch 240 SHA256 392bea0f822852e740280a04b5446d41954cb8627d9edf076d2532a79ab15478 SHA512 cac79c4bc874b987db53d5011fded8a0a038c794bfe884ac9caf901d6098aa9a611150e80f23712c404768e2a0c8fb6ff4c392a269165a0104cb1f18e79b0987 WHIRLPOOL 473f855e5054228612d36e752bd052fa47ae962d757d3a5c4d3f73dbb90becdb106f7a0c4e6c39470a210e53e051b3ba9dd5b3430e640d312a556ded30137654
+AUX sysvinit-2.88-selinux.patch 1041 SHA256 e987ab6e478e5b3987ae1c6e338cfc66ae356f704d0c3ea932f9e4335b4986f0 SHA512 46eeb3ab2dd25f314b9f60b2dc8a7da2aa2aafb978953a730ccc36456d240e317930e86df69ce2592cf45978f3307dfc2522b24ae1158e64ff17dfa6ed84dcb8 WHIRLPOOL 4fe319df09759addf9499367a6da47e8effe93ec0a4ba5b7e7b1d0c746b324a303cdc81eb360c81e529faf41260d69e2b4364d6695b390db9dba1e3d1693c872
+AUX sysvinit-2.88-shutdown-h.patch 1626 SHA256 642585158e6fbb185ed53804be2eeea85c037726ed19beb51a9ffb594e63ca0f SHA512 244ed7c2242f52674153ccfebb92c7a9bdc68a25f98aacbbf107ddfce11b195483e90150619fbeae3167136fcb54b878f8eb77e2dfe225d9f2eeb2c182e5e2fe WHIRLPOOL 6500d8be6313190e5ccf8ca0fe3d51ef879458f59e7ebe1849f666f3c20ffdea21d73f2951e978ac0bf7dce1f47be0113e129db784fdabb6f4407e4d78a3cb0d
+DIST sysvinit-2.88dsf.tar.bz2 105551 SHA256 60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519 SHA512 0bd8eeb124e84fdfa8e621b05f796804ee69a9076b65f5115826bfa814ac1d5d28d31a5c22ebe77c86a93b2288edf4891adc0afaecc4de656c4ecda8a83807bf WHIRLPOOL f4809e19ea2c72c733d3c09a4964d7a6e67b091d1f1d9ef276515b2f138148bfbf516034d3fb1009289f9520f2fbe9e29687f432bba06fb437ebd6e2b9ef570c
+EBUILD sysvinit-2.88-r999.ebuild 3430 SHA256 f475afa4de57de238795c580639b0f841b05f75b20e6cd7b1e8052b4b26d8743 SHA512 0f318cd38732fa0c968ca112342bcee413661df7f8e3334e3ca4d25af430a850e0fd57de0860a9ee63334fec28fb741e28d0308b42073159666fdfed8517d493 WHIRLPOOL 0a80ba5b1ef215168ffcee674793e1fc75f2fb0aa353cb17627456028e48c8be4a28997a6887378358454a3d0224459781dde63061344242576101233ec68290
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-apps/sysvinit/files/inittab-2.87 b/sys-apps/sysvinit/files/inittab-2.87
new file mode 100644
index 00000000..cf075481
--- /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>
+#
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/files/inittab-2.87,v 1.2 2013/04/20 03:51:26 vapier Exp $
+
+# 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 00000000..3e50f71c
--- /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 00000000..502ef527
--- /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 00000000..4948806d
--- /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 00000000..b8e403f6
--- /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 00000000..22f463cd
--- /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-musl.patch b/sys-apps/sysvinit/files/sysvinit-2.88-musl.patch
new file mode 100644
index 00000000..6011278d
--- /dev/null
+++ b/sys-apps/sysvinit/files/sysvinit-2.88-musl.patch
@@ -0,0 +1,10 @@
+--- sysvinit-2.88dsf.org/src/init.c
++++ sysvinit-2.88dsf/src/init.c
+@@ -51,6 +51,7 @@
+ #include <stdarg.h>
+ #include <sys/syslog.h>
+ #include <sys/time.h>
++#include <sys/ttydefaults.h>
+
+ #ifdef WITH_SELINUX
+ # include <selinux/selinux.h>
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 00000000..91b7435b
--- /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 00000000..716999c3
--- /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 00000000..96a2d586
--- /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-r999.ebuild b/sys-apps/sysvinit/sysvinit-2.88-r999.ebuild
new file mode 100644
index 00000000..6fb78ceb
--- /dev/null
+++ b/sys-apps/sysvinit/sysvinit-2.88-r999.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sysvinit/sysvinit-2.88-r5.ebuild,v 1.4 2013/09/29 01:24:03 vapier Exp $
+
+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="amd64 arm ~mips ppc x86"
+IUSE="selinux ibm static kernel_FreeBSD"
+
+RDEPEND="selinux? ( >=sys-libs/libselinux-1.28 )"
+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
+ epatch "${FILESDIR}"/${P}-musl.patch
+ 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 00000000..83f9c8ff
--- /dev/null
+++ b/sys-apps/tcp-wrappers/Manifest
@@ -0,0 +1,11 @@
+AUX hosts.allow.example 585 SHA256 fbcdcedbdc985d8f0cc79e9a8752e69553b48aa38662321046cd4eae9f4d7e3b SHA512 63587dd4552b688dc5ed0adde3932e43e5287129315211498063f09e37c1f8beee0de60d7d4f69df7149bd500546a2fd59a6094d71f9c0be221426eae3cb869b WHIRLPOOL 449f28dad80a13497baa7d5d43cc99b8e7159b8e38dc7659947c9dd76ca2e8d7153de84a3706ec6658d94bb70d5b35554b72e9cf8f35bc8eaf27dacb8229cae9
+AUX tcp-wrappers-7.6-headers.patch 5419 SHA256 86d24cdf5d1c7f88d21b174988234d5024f506982e029e173c06cb5456c46bb0 SHA512 48cd3d8951ef0f0106c51f1a1de6116fe1f68bf49f321b956d4f9dac1b3f1b6c2964163deb3d1bb449a2ac672e471c4b216e0e616de4a2dad0665d767d13f786 WHIRLPOOL 721d65254fd0d39152e0ba1c860fba5bb8c08ab61d1c89a10e1da9ed274b41ba2734253e79e0c680fe72cdf720eba7243c7b7e6f33d383c074f078b2c64d923d
+AUX tcp-wrappers-7.6-redhat-bug11881.patch 956 SHA256 b8b3bbbe223d3496b25070d1fbc62d9a1424709e20d380b55390b13f03b46e03 SHA512 d530f788c3b40f5ec2836ba7c6e73df529869ef465b93fe2b2d8460dfcb5e9031e78c8e6a99c71d6262a05b82f25e694fdd717686198a87dfcb2c9b9d5a52ef4 WHIRLPOOL 05620832e55b9ef396601851d22e6fc1e60adb655340b1c1909c8138454b38338cba3bf9976d8458d157cc2ce8a3f30450efdf82943b885e325965b2d93697b7
+AUX tcp-wrappers-7.6-remove-DECLS.patch 490 SHA256 5155a217b51cede4179c3febb008e6397b05a2900d27be658e4aff5b26e8b6e2 SHA512 67eff00fd55d1f6c9628f629ffd49a49a7f92e2c6eda85e0c00f41077afd8ac33494c2a8ff1d0f402bc29694b4ffb9a056d88410959a0e1ee020c0653e05bc83 WHIRLPOOL aad11b4436134dcd1d7e8671e79083a773aedf1647c7f3173a3526b8934504e8135db9f71b63edd40ebad1a52b125a00023563e4bcc4b610be1c166a5cd255bb
+AUX tcp-wrappers-7.6.22-remove-DECLS.patch 475 SHA256 d7fadcd9d60955e971402033c017ffa5aaee5ae489ff26ff0658e926131bdf66 SHA512 c56562e2209559c6c7aa10e3fd10eff2612efaa0455b4a405497d095b99926e057236f9a60ce4d2646dec0d442b9d1642ad3defc3f099fec49896d6a9b3fc76f WHIRLPOOL c03aca47527a07a3fc7115c3d14747202124aa837b24571eae715c2b6e90bd0ab83ccbe94240c2102d89c806dd00c40e19688fff5d4cbff00b07d73db7336216
+DIST tcp-wrappers-7.6-patches-1.0.tar.bz2 16128 SHA256 dcb10f194684b16ae6aa9faf05dd8b063d81a3dde1431b664260dcf385089256 SHA512 b020006ce3f7578c0ab3c7b8cb71a3bb00ab0ae3d595b0612fa6464041e06905fb431acb85a759de90407ef502aa75191abed6225a57586abc7bbd1801cea969 WHIRLPOOL 819afd55ac96abe8e737592ac5663f3d41e96837eafe2511018cf6dda17dd2cb13ed8930ff0bf50a3d63a45fb834897586f78b10f0d8a55d31934fd970147903
+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
+EBUILD tcp-wrappers-7.6-r99.ebuild 1975 SHA256 59731a917a5cc260227631d38c537a683c13353287b72340fc6b51c378df71fb SHA512 c2f52de54f6448eb1e7b768c0f537a0e2a46a53f4b8d283cf0dee4b27c17c92bf02ee555e19c25d1c686a7dddbdf5ac6a6caea0c78f4ee1bf99a3ba2e6c973ca WHIRLPOOL 24fa8061dd19cd3ad3eb96f31e1dc4de07b8dc66c1723be8c9c35e00579f3e616a738321db8003c251b386f309b5ced77d9cf8f9e6897dfc7219d897e256b860
+EBUILD tcp-wrappers-7.6.22-r99.ebuild 2711 SHA256 bb6b777d4eafe0fa671708d1dfbda7bbeb5a3aa4eea770e400d2aabbaac4b241 SHA512 76bb3fd216ae20d11c1f8e9191a20ee3eb56ae6c47c50df8d100f68289b8556cc71471c4b1d8009b32f08df3334bef8c19ae639b0b3f5f65e4b3c8575ca3d07d WHIRLPOOL 79844b6565cf3c1a5bf3a871ad48c75e7b1a481c871c543bfbb4ff218b35a3b4199680afb44547da4c76cace1b42ff3d2f8512bde3cacdf74acc6c0cb52879b7
+MISC metadata.xml 349 SHA256 81a5bdc0c787284f58b68dd7e3db3cfe6652b336d03698826dd86a705626b725 SHA512 b3c8aa5ea459990ef57ffa5b66e230ea6cf7aa8acd3481183f2dbe7394d98add0a2712cd5b74fd494ca0372e79097c3e2d712514a5f20815c7673372351f5755 WHIRLPOOL 2c28eb2f649bb90041c36b7c9b5fe5ec5826382a59a13f64846bd99746172bdea5daa8d3c025d74402ec9d8beb8a675ec536405b2b223aeffd9122d9af8342cd
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 00000000..c473eb95
--- /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 00000000..328a4a10
--- /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 00000000..4a684762
--- /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/files/tcp-wrappers-7.6-remove-DECLS.patch b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-remove-DECLS.patch
new file mode 100644
index 00000000..1382c6dc
--- /dev/null
+++ b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-remove-DECLS.patch
@@ -0,0 +1,19 @@
+diff -Naur tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2013-07-06 02:14:23.070110799 +0000
++++ tcp_wrappers_7.6/tcpd.h 2013-07-06 02:14:56.184112650 +0000
+@@ -21,8 +21,6 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+
+-__BEGIN_DECLS
+-
+ /* Structure to describe one communications endpoint. */
+
+ #define STRING_LENGTH 128 /* hosts, users, processes */
+@@ -259,6 +257,4 @@
+ extern char *my_strtok();
+ #endif
+
+-__END_DECLS
+-
+ #endif /* tcpd.h */
diff --git a/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6.22-remove-DECLS.patch b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6.22-remove-DECLS.patch
new file mode 100644
index 00000000..0fbd5ed9
--- /dev/null
+++ b/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6.22-remove-DECLS.patch
@@ -0,0 +1,22 @@
+diff -Naur tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2014-03-24 18:39:52.000000000 +0000
++++ tcp_wrappers_7.6/tcpd.h 2014-03-24 18:48:21.000000000 +0000
+@@ -11,7 +11,9 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+
++#ifdef __cplusplus
+ __BEGIN_DECLS
++#endif
+
+ /* Structure to describe one communications endpoint. */
+
+@@ -252,6 +254,8 @@
+ extern char *my_strtok();
+ #endif
+
++#ifdef __cplusplus
+ __END_DECLS
++#endif
+
+ #endif
diff --git a/sys-apps/tcp-wrappers/metadata.xml b/sys-apps/tcp-wrappers/metadata.xml
new file mode 100644
index 00000000..1cecd60a
--- /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 need want it)
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/sys-apps/tcp-wrappers/tcp-wrappers-7.6-r99.ebuild b/sys-apps/tcp-wrappers/tcp-wrappers-7.6-r99.ebuild
new file mode 100644
index 00000000..bca5ab94
--- /dev/null
+++ b/sys-apps/tcp-wrappers/tcp-wrappers-7.6-r99.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/tcp-wrappers/tcp-wrappers-7.6-r8.ebuild,v 1.26 2013/05/14 05:46:04 radhermit Exp $
+
+inherit eutils toolchain-funcs multilib
+
+MY_P="${P//-/_}"
+PATCH_VER="1.0"
+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://gentoo/${P}-patches-${PATCH_VER}.tar.bz2"
+
+LICENSE="tcp_wrappers_license"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ipv6"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ chmod ug+w Makefile
+
+ EPATCH_SUFFIX="patch"
+ PATCHDIR=${WORKDIR}/${PV}
+ epatch ${PATCHDIR}/${P}-makefile.patch
+ epatch ${PATCHDIR}/generic
+ epatch ${PATCHDIR}/${P}-shared.patch
+ use ipv6 && epatch ${PATCHDIR}/${P}-ipv6-1.14.diff
+
+ epatch "${FILESDIR}"/${P}-remove-DECLS.patch
+}
+
+src_compile() {
+ tc-export AR CC RANLIB
+
+ local myconf="-DHAVE_WEAKSYMS"
+ use ipv6 && myconf="${myconf} -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len"
+
+ emake \
+ REAL_DAEMON_DIR=/usr/sbin \
+ GENTOO_OPT="${myconf}" \
+ MAJOR=0 MINOR=${PV:0:1} REL=${PV:2:3} \
+ config-check || die "emake config-check failed"
+
+ emake \
+ REAL_DAEMON_DIR=/usr/sbin \
+ GENTOO_OPT="${myconf}" \
+ MAJOR=0 MINOR=${PV:0:1} REL=${PV:2:3} \
+ linux || die "emake linux failed"
+}
+
+src_install() {
+ dosbin tcpd tcpdchk tcpdmatch safe_finger try-from || die
+
+ 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 /usr/include
+ doins tcpd.h
+
+ into /usr
+ dolib.a libwrap.a
+
+ into /
+ newlib.so libwrap.so libwrap.so.0.${PV}
+ dosym libwrap.so.0.${PV} /$(get_libdir)/libwrap.so.0
+ dosym libwrap.so.0 /$(get_libdir)/libwrap.so
+ # bug #4411
+ gen_usr_ldscript libwrap.so || die "gen_usr_ldscript failed"
+
+ dodoc BLURB CHANGES DISCLAIMER README* "${FILESDIR}"/hosts.allow.example
+}
diff --git a/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r99.ebuild b/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r99.ebuild
new file mode 100644
index 00000000..39b8e844
--- /dev/null
+++ b/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r99.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/tcp-wrappers/tcp-wrappers-7.6.22-r1.ebuild,v 1.7 2014/03/16 17:17:09 maekke Exp $
+
+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="amd64 arm ~mips ppc x86"
+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
+ epatch "${FILESDIR}"/${PN}-7.6.22-remove-DECLS.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_build_binaries; 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/util-linux/Manifest b/sys-apps/util-linux/Manifest
new file mode 100644
index 00000000..6989c257
--- /dev/null
+++ b/sys-apps/util-linux/Manifest
@@ -0,0 +1,18 @@
+AUX crypto-loop.confd 412 SHA256 188c945e5e6c54cb14874057c625ff30b72fb33d3d5648e53de2f231a3375600 SHA512 fdcb4e3a267afd1bbc836e368918da7edc709fc8a61e45b53ec3694a79722ebfda0f3bcbeb053c665a6552241c5a915b76f142bff07757a7c018446000dd7bd0 WHIRLPOOL 7e0c95f46bc7c5474f950a0da93d9eefda7962385e1f425f2ae3dd931f7119fb5efa5ca0a470706bdbde661a001bb3797cf6e5f2735f346efb69aed5d66146e7
+AUX crypto-loop.initd 1729 SHA256 b8329250c865e79a1e761d713c2270c99d5fe96e0d5a7ca646946fab65c4b810 SHA512 89983743c2277c2c88e7f77cd38ce0e2cc56255f7f314dcce74c5cbffe607323f888d00ef115a660ec6c52802b347d8e0d8cc0a411644f20118d776c88f9725b WHIRLPOOL 3f3256788ba61e2ce147b38144b739c4f7d0ed7bc1b8936b1bf4f33d4a0bce4cd17a49d81a573009601a597fff081170845b5cdf400dc8b7160022943538c7d9
+AUX ttydefaults.h 964 SHA256 ad3983370bad941522ebb481c2ca087a405b16870ac094301aa9a3afc2b24441 SHA512 151d19dee177c0851200c247b598aad2a2879b4721f87af7a81a5f709100f0a06d942f8473789973c61e075bc295d8728bb9711c2fe217ea24c553bea69ad289 WHIRLPOOL 03bc2f196386d3f7823ca51da88671b5f752fb4bba645af649072bd723817297b98a7453f23f8828cebbf8b6551b8a7990c5a21561ade10f5e97bc650ac402d9
+AUX util-linux-2.23.1-musl.patch 3946 SHA256 b36f16f7ccad9bb7177df149767dccbae03d948e10299d2f14a91bc2a919425e SHA512 16a529026bf590e51038cbc1101a126477194b79297f49629a0ce36afefce227c96ee5ef6f9442ec19c449a589b2bfb099f60f60d8c851ba0eea99ab5ab81382 WHIRLPOOL 92259307a9375c20593b75b7acfa87b5aaef7024f405eb8b54d225773f313b16935a7955ccfeec4adf581d2ab0705991f36d25cad2f3d7cfd18cd3c0d52b808f
+AUX util-linux-2.24-last-tests.patch 4513 SHA256 61be31970f0aced6a8423e1f0ab35751f0dcd9e24265eb3221a8e0e14cae731f SHA512 f9be688b0a074ca3e93139fcd78c4a28b892b9cafedc70d92b08f695131631349044d1eb42b4534db9c09f656e503d400dc59b220234668cba206888ad43cd1a WHIRLPOOL fa1057d0b9d99a92f53975c468e7488d47b2a801d42141233c88b01a9bde66ae489cf862505f3eadfb6c7e99172d202e37ec4bc5cd7d97e2fdc6e043df3335f9
+AUX util-linux-2.24-skip-last-tests.patch 1003 SHA256 5ccbab17e26cc9b592b534b9b3e72b6a23dbdd04718f6360cb7d8886221ffa4d SHA512 9d89530f203c8a50e1def8164669b93ce1c1509d4da112c9db56cea9e29288c32964978e06ababa8e6c00222813d7a99bc35e0a7cfc17d8cd63804b629c9165c WHIRLPOOL 0e7c1cd6a4bdc94fdad3582f1855992d375238438d165627d60cddda8d1314c759b6e34171c5d00890956acdf9641ad5bf955f980fd142545b1ef468caa90be6
+AUX util-linux-2.24.1-musl.patch 977 SHA256 027890f21ad6ae870e519d6da6498cade79f42d0a8c95a3afa30a6af41b25aea SHA512 b01a915da3e288e19e7f1c404d982bb296ab33b2d1a068decea04f35bc69aad2b33b78215054911682db855a61e0446c11ce0a37af6bc7f2be05537c97557fc3 WHIRLPOOL 20f4f6a503e5645bd9e0360f84529bd9a878d7815940447e7a9db93b71bb3c24ad59ee9b5e0cb5ae83c4b3881c1121744332a5a5b82ead525bf17640068dfec9
+AUX util-linux-2.24.2-hexdump.patch 838 SHA256 3b225036f09ff2979c5c181b129231169d10b95a8bf3d37308ccb44fc9e164d8 SHA512 bc94e4c6ba5620c8e21a642052e91f74b4b1552af65fc5dea8f4c6fb0f976dd83c7b2ecc62956936a70561af0eeb5894f5dcca29283bff458d7d7696eed81c2f WHIRLPOOL 184f89870273a48d87fc7869128cc099851702dceb9342fb06dc5f2f155558e1df6f55aab2c745d73eeb1a4ba4d44befdc37d49b41917bb26635e66593512b0a
+AUX util-linux-2.25-lscpu-pic.patch 2529 SHA256 5ca73497accd0a53084e756c150b32c6f7a7fa2524acceb17182bf866e03b13a SHA512 186bbc40330f118ca5cde88db113b0dbc2111de2aab7a3001b369fc01a2b7e05ae4cc9b6d164a5ed6b4d48bd19558d2ac4a18c5df60da5d5c02228fada2d7a2b WHIRLPOOL a4777871b7cc14b0c63153c7dd6e1a3a45eee0b1a06eee19f20a02796ac3bd18bbc17774cb45c51bec074dde21a2b93dd11167349ea285bfd73eda98bb27b0e8
+AUX util-linux-2.25-remove__SWORD_TYPE.patch 663 SHA256 29eb73d4a14352176bcc81bbb82518ebd8b8f57aecde0314465ffa5568407cf9 SHA512 80679400b61bd87aef8c8e0f448e83b8d14e15b4a0edda4e6866e15fc2d3d2968e23345b0d47edf6fc31d2e89707e0aa68d3def8bd0f3bb194cb1a08c9638b6e WHIRLPOOL a86a121b0496f7aeaa29c9b5c57449903e9364cc10e48c5b62c9a64e5db1bef4c45a14cadc5e9ae737cbdcb47d47333b21e594c95eb02aa4c7844b8d2168bcfa
+AUX util-linux-2.25.2-runuser-bash-completion.patch 1372 SHA256 a3eebac8c53b3bf6e29e15e161ba460fdafed840647f49de93cf8e20856f10ed SHA512 d7a90f709480065eceddc9c0ca2186a12b941c08130d3bee69286e1cd13ef228bff6991373ce30eacbb29f4ddad8a1afdf6551652d5ca21063e0ab7211aa44da WHIRLPOOL ef5446ecee7ae1d932fe62a0a321cab55df0ed24d7ab98abf2d8cba9fbd47bd2524fac22c0a0d4ebdcacb642ece273ce97e76f763ed816eaa3df95a76579caba
+DIST util-linux-2.24.1.tar.xz 3543692 SHA256 835eb6232cfab0118ef2e4fd649de0ba9f5bd1b8cbf9a7d4d84594541dec8410 SHA512 5636e1c57bd57954518e90ff0f079810cc2927f52bb925dde556ce2744a088577f8adbc19c19b2bd079efd253406767faa44d1de5f557e024762522e647f044b WHIRLPOOL 25862a85788eb1c275c7e06f3d2be8e6a9605811665e06a4b21d1e274fc4a5e19dd03e5c52061ee5d98ce8c86ba757a7f8076683edb603ad0c43c05ab5e52a51
+DIST util-linux-2.25.2.tar.xz 3703644 SHA256 e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6 SHA512 cf8c5bde78f844425150c2a81bdecb87aa57bcd5cebd177a78160835627f58037fa2cfe4db26fd8f35eedb3beb499a91492a297a27d065465e2ea0c6218dc387 WHIRLPOOL dd1685f2e694bf3de95acc3ba3170d231426c18c3395a867c815bbd3ab5ee0f07567b49d0ae083ce669c89db711e39fd2b990bc7321985ec2279d78816ec5258
+DIST util-linux-2.25.tar.xz 3681308 SHA256 47ba5a8bd8cdd55262699078a5612a95db17966c7f20c43e3fe492c90ce7980a SHA512 9306bcf8ef4b25c09a56e2e96c885d47a43bc389c3bba6123ff11b146eddfec0d04da817ff599bf7f2aa330b1044a051f69e8d90b6f2c4b125d2842f852be690 WHIRLPOOL e787d474c64b0a4ef944d5ec205afc3de6ff5b8789448a9d00232179813ee8fdf6564b433409012fed27a1fdfbb79c8ff504fde904b5f3433da95b79825900bd
+EBUILD util-linux-2.24.1-r99.ebuild 4037 SHA256 4b191a882c5b099ea3ee7b96d2391eaae4fdad98371476b290c53f72b564c792 SHA512 912c9e32ee3c704435537ab4c7c8add494673d8ec2266ce3a6b2095a872622379861b8f5869145bee029f362650bd1f3d956b0de79d1165a0cee1277630c0549 WHIRLPOOL 5ceddd10cb246ca8190e6316b0de0a85a5adf426a4e6fe0520d2ac25cdc79bbcc0549af94bb37831cba8a8141d8544d6a59f4fdb5aa029f15ae7416fb0c94925
+EBUILD util-linux-2.25-r99.ebuild 5195 SHA256 5615d0cde4c97893100b9c80f48c6c6b71bd434db580ad466fbf0a8063c4aada SHA512 fd72e236e89790310058391d24a3748a083fed638e3b5c83ff13059c0f4a61ea921d324ffcf7e774ad469b096707d00aefa702a47ab99addd7ff789d0fb8a858 WHIRLPOOL 19fac70b043702b79462ce954a461a19785c0aeff7536745019f8c4a12c5f21fbf2ba09c0f053fc08b5ccf7b5f6be9a0a60bf1fe2ef9100b110d914aa6427aa2
+EBUILD util-linux-2.25.2-r99.ebuild 5156 SHA256 20af508111b44fa8b53821f5f9ce93e3097d75cac40f206c55f35c9f5ed71dbd SHA512 772c617b54bf4e9ee74a72a8c79a711398095eb7140f2ee85bb534f57f2cf31eac995e9761baa6976ec4df12a373fabfaa254251cb44a216de994c97e5c730a1 WHIRLPOOL c8436040b3aa55908b96d101868bb7b5e5a518803a67d41a577669a625fad73cd44c0cb2c280047d1ab3390966561662b52a73cb752aed3bd90df2ae9ea4cf3e
+MISC metadata.xml 846 SHA256 7fef382903a74be1395de2940640987cb09f84b4925bb9e19cbd803cad7041dc SHA512 47cbc59784221810ee0815e8078bb1c89147e6c69c9efa7ca3dddc66265225f98c698ca58d2a0406141aa3a069d68079c6dffae7f18cf1bc2a0b94ecf54ca6ef WHIRLPOOL 653bc6ee4435225a16ce7d662793af9bbe389185b831feeb43094b334a4662a593b5c92089ed71ed8108f6fc8768c46182f3a7f6210cfc6de14238b3c3088862
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 00000000..6a884346
--- /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 00000000..853bae27
--- /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
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/files/crypto-loop.initd,v 1.4 2008/10/26 03:16:48 vapier Exp $
+
+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/ttydefaults.h b/sys-apps/util-linux/files/ttydefaults.h
new file mode 100644
index 00000000..af692acb
--- /dev/null
+++ b/sys-apps/util-linux/files/ttydefaults.h
@@ -0,0 +1,38 @@
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
+#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
+#define TTYDEF_SPEED (B9600)
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL _POSIX_VDISABLE
+#else
+# define CEOL '\0'
+#endif
+#define CERASE 0177
+#define CINTR CTRL('c')
+#ifdef _POSIX_VDISABLE
+# define CSTATUS _POSIX_VDISABLE
+#else
+# define CSTATUS '\0'
+#endif
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+#endif
diff --git a/sys-apps/util-linux/files/util-linux-2.23.1-musl.patch b/sys-apps/util-linux/files/util-linux-2.23.1-musl.patch
new file mode 100644
index 00000000..7868998a
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.23.1-musl.patch
@@ -0,0 +1,110 @@
+patch taken from sabotage linux -- https://github.com/rofl0r/sabotage
+diff -aur util-linux-2.23.1.org/fdisks/cfdisk.c util-linux-2.23.1/fdisks/cfdisk.c
+--- util-linux-2.23.1.org/fdisks/cfdisk.c 2013-07-01 21:37:58.508000002 +0000
++++ util-linux-2.23.1/fdisks/cfdisk.c 2013-07-01 22:00:23.042000002 +0000
+@@ -325,7 +325,7 @@
+ int logical = 0;
+ long long logical_sectors[MAXIMUM_PARTS];
+
+-__sighandler_t old_SIGINT, old_SIGTERM;
++sighandler_t old_SIGINT, old_SIGTERM;
+
+ int arrow_cursor = FALSE;
+ int display_units = MEGABYTES;
+diff -aur util-linux-2.23.1.org/fdisks/fdisksunlabel.c util-linux-2.23.1/fdisks/fdisksunlabel.c
+--- util-linux-2.23.1.org/fdisks/fdisksunlabel.c 2013-07-01 21:37:58.508000002 +0000
++++ util-linux-2.23.1/fdisks/fdisksunlabel.c 2013-07-01 21:59:43.721000002 +0000
+@@ -383,9 +383,11 @@
+ }
+ }
+
+-static int verify_sun_cmp(int *a, int *b, void *data)
++static void* cmp_data;
++static int verify_sun_cmp(const void *pa, const void *pb)
+ {
+- unsigned int *verify_sun_starts = (unsigned int *) data;
++ const int *a = pa, *b = pb;
++ unsigned int *verify_sun_starts = (unsigned int *) cmp_data;
+
+ if (*a == -1)
+ return 1;
+@@ -449,9 +451,8 @@
+ else
+ array[i] = -1;
+ }
+- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+- verify_sun_starts);
++ cmp_data = verify_sun_starts;
++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
+
+ if (array[0] == -1) {
+ fdisk_info(cxt, _("No partitions defined"));
+diff -aur util-linux-2.23.1.org/include/ttyutils.h util-linux-2.23.1/include/ttyutils.h
+--- util-linux-2.23.1.org/include/ttyutils.h 2013-07-01 21:37:58.433000002 +0000
++++ util-linux-2.23.1/include/ttyutils.h 2013-07-01 21:48:42.328000002 +0000
+@@ -10,6 +10,7 @@
+ #include <stdlib.h>
+ #include <termios.h>
+ #include <limits.h>
++#include "ttydefaults.h"
+ #ifdef HAVE_SYS_IOCTL_H
+ #include <sys/ioctl.h>
+ #endif
+diff -aur util-linux-2.23.1.org/term-utils/setterm.c util-linux-2.23.1/term-utils/setterm.c
+--- util-linux-2.23.1.org/term-utils/setterm.c 2013-07-01 21:37:58.442000002 +0000
++++ util-linux-2.23.1/term-utils/setterm.c 2013-07-01 22:02:54.244000002 +0000
+@@ -123,7 +123,7 @@
+ #include "nls.h"
+ #include "closestream.h"
+
+-#if __GNU_LIBRARY__ < 5
++#if defined(__GLIBC__) && __GNU_LIBRARY__ < 5
+ #ifndef __alpha__
+ # include <linux/unistd.h>
+ #define __NR_klogctl __NR_syslog
+diff -aur util-linux-2.23.1.org/term-utils/ttymsg.c util-linux-2.23.1/term-utils/ttymsg.c
+--- util-linux-2.23.1.org/term-utils/ttymsg.c 2013-07-01 21:37:58.442000002 +0000
++++ util-linux-2.23.1/term-utils/ttymsg.c 2013-07-01 22:07:02.788000002 +0000
+@@ -41,6 +41,7 @@
+ */
+
+ #include <sys/types.h>
++#include <sys/param.h>
+ #include <sys/uio.h>
+ #include <signal.h>
+ #include <fcntl.h>
+diff -aur util-linux-2.23.1.org/text-utils/hexdump.h util-linux-2.23.1/text-utils/hexdump.h
+--- util-linux-2.23.1.org/text-utils/hexdump.h 2013-07-01 21:37:58.437000002 +0000
++++ util-linux-2.23.1/text-utils/hexdump.h 2013-07-01 22:01:27.005000002 +0000
+@@ -32,7 +32,7 @@
+ *
+ * @(#)hexdump.h 5.4 (Berkeley) 6/1/90
+ */
+-
++#include <sys/types.h>
+ typedef struct _pr {
+ struct _pr *nextpr; /* next print unit */
+ #define F_ADDRESS 0x001 /* print offset */
+diff -aur util-linux-2.23.1.org/text-utils/pg.c util-linux-2.23.1/text-utils/pg.c
+--- util-linux-2.23.1.org/text-utils/pg.c 2013-07-01 21:37:58.437000002 +0000
++++ util-linux-2.23.1/text-utils/pg.c 2013-07-01 22:01:55.831000002 +0000
+@@ -37,7 +37,7 @@
+ #ifndef TIOCGWINSZ
+ # include <sys/ioctl.h>
+ #endif
+-#include <sys/termios.h>
++#include <termios.h>
+ #include <fcntl.h>
+ #include <regex.h>
+ #include <stdio.h>
+--- util-linux-2.23.1.orig/sys-utils/eject.c
++++ util-linux-2.23.1/sys-utils/eject.c
+@@ -40,7 +40,6 @@
+ #include <sys/mount.h>
+ #include <scsi/scsi.h>
+ #include <scsi/sg.h>
+-#include <scsi/scsi_ioctl.h>
+ #include <sys/time.h>
+
+ #include <libmount.h>
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 00000000..77cf478e
--- /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 00000000..5148053d
--- /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.24.1-musl.patch b/sys-apps/util-linux/files/util-linux-2.24.1-musl.patch
new file mode 100644
index 00000000..3d9efcf7
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24.1-musl.patch
@@ -0,0 +1,30 @@
+adapted from a patch from sabotage linux
+diff -ru a/util-linux-2.24.1/libfdisk/src/sun.c b/util-linux-2.24.1/libfdisk/src/sun.c
+--- a/util-linux-2.24.1/libfdisk/src/sun.c
++++ b/util-linux-2.24.1/libfdisk/src/sun.c
+@@ -361,9 +361,11 @@
+ }
+ }
+
+-static int verify_sun_cmp(int *a, int *b, void *data)
++static void* cmp_data;
++static int verify_sun_cmp(const void *pa, const void *pb)
+ {
+- unsigned int *verify_sun_starts = (unsigned int *) data;
++ const int *a = pa, *b = pb;
++ unsigned int *verify_sun_starts = (unsigned int *) cmp_data;
+
+ if (*a == -1)
+ return 1;
+@@ -427,9 +429,8 @@
+ else
+ array[i] = -1;
+ }
+- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+- verify_sun_starts);
++ cmp_data = verify_sun_starts;
++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
+
+ if (array[0] == -1) {
+ fdisk_info(cxt, _("No partitions defined."));
diff --git a/sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch b/sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch
new file mode 100644
index 00000000..716ea531
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch
@@ -0,0 +1,40 @@
+from alpine linux
+--- ./text-utils/parse.c.orig
++++ ./text-utils/parse.c
+@@ -208,7 +208,7 @@
+ PR *pr, **nextpr;
+ FU *fu;
+ char *p1, *p2;
+- char savech, *fmtp, cs[3];
++ char savech, *fmtp, cs[4];
+ int nconv, prec;
+
+ nextpr = NULL;
+@@ -282,9 +282,10 @@
+ goto isint;
+ case 'o': case 'u': case 'x': case 'X':
+ pr->flags = F_UINT;
+-isint: cs[2] = '\0';
+- cs[1] = cs[0];
+- cs[0] = 'q';
++isint: cs[3] = '\0';
++ cs[2] = cs[0];
++ cs[1] = 'l';
++ cs[0] = 'l';
+ switch(fu->bcnt) {
+ case 0: case 4:
+ pr->bcnt = 4;
+@@ -342,9 +343,10 @@
+ ++p2;
+ switch(p1[2]) {
+ case 'd': case 'o': case'x':
+- cs[0] = 'q';
+- cs[1] = p1[2];
+- cs[2] = '\0';
++ cs[0] = 'l';
++ cs[1] = 'l';
++ cs[2] = p1[2];
++ cs[3] = '\0';
+ break;
+ default:
+ p1[3] = '\0';
diff --git a/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch b/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch
new file mode 100644
index 00000000..f66ffa70
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch
@@ -0,0 +1,81 @@
+From f86d649d5f2522c61b791366a96e9f00cd255668 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 5 Aug 2014 18:58:52 -0400
+Subject: [PATCH] lscpu: clean up vmware inline asm
+
+This code is not PIC clean which means it fails to build on hardened
+32bit x86 systems (i.e. building as PIE).
+
+While here, optimize the existing cpuid logic slightly.
+
+URL: https://bugs.gentoo.org/518936
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ sys-utils/lscpu.c | 36 ++++++++++++++++++++++++++----------
+ 1 file changed, 26 insertions(+), 10 deletions(-)
+
+diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
+index 062dff5..9965eeb 100644
+--- a/sys-utils/lscpu.c
++++ b/sys-utils/lscpu.c
+@@ -546,10 +546,9 @@ cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
+ __asm__(
+ #if defined(__PIC__) && defined(__i386__)
+ /* x86 PIC cannot clobber ebx -- gcc bitches */
+- "pushl %%ebx;"
++ "xchg %%ebx, %%esi;"
+ "cpuid;"
+- "movl %%ebx, %%esi;"
+- "popl %%ebx;"
++ "xchg %%esi, %%ebx;"
+ : "=S" (*ebx),
+ #else
+ "cpuid;"
+@@ -656,12 +655,29 @@ read_hypervisor_powerpc(struct lscpu_desc *desc)
+ #define VMWARE_BDOOR_PORT 0x5658
+ #define VMWARE_BDOOR_CMD_GETVERSION 10
+
+-#define VMWARE_BDOOR(eax, ebx, ecx, edx) \
+- __asm__("inl (%%dx), %%eax" : \
+- "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \
+- "0"(VMWARE_BDOOR_MAGIC), "1"(VMWARE_BDOOR_CMD_GETVERSION), \
+- "2"(VMWARE_BDOOR_PORT), "3"(0) : \
+- "memory");
++static inline
++void vmware_bdoor(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
++{
++ __asm__(
++#if defined(__PIC__) && defined(__i386__)
++ /* x86 PIC cannot clobber ebx -- gcc bitches */
++ "xchg %%ebx, %%esi;"
++ "inl (%%dx), %%eax;"
++ "xchg %%esi, %%ebx;"
++ : "=S" (*ebx),
++#else
++ "inl (%%dx), %%eax;"
++ : "=b" (*ebx),
++#endif
++ "=a" (*eax),
++ "=c" (*ecx),
++ "=d" (*edx)
++ : "0" (VMWARE_BDOOR_MAGIC),
++ "1" (VMWARE_BDOOR_CMD_GETVERSION),
++ "2" (VMWARE_BDOOR_PORT),
++ "3" (0)
++ : "memory");
++}
+
+ static jmp_buf segv_handler_env;
+
+@@ -697,7 +713,7 @@ is_vmware_platform(void)
+ if (sigaction(SIGSEGV, &act, &oact))
+ err(EXIT_FAILURE, _("error: can not set signal handler"));
+
+- VMWARE_BDOOR(eax, ebx, ecx, edx);
++ vmware_bdoor(&eax, &ebx, &ecx, &edx);
+
+ if (sigaction(SIGSEGV, &oact, NULL))
+ err(EXIT_FAILURE, _("error: can not restore signal handler"));
+--
+2.0.0
+
diff --git a/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch
new file mode 100644
index 00000000..86edab45
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch
@@ -0,0 +1,14 @@
+diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
+--- util-linux-2.25.orig/sys-utils/switch_root.c 2014-08-13 15:08:15.632801343 +0000
++++ util-linux-2.25/sys-utils/switch_root.c 2014-08-13 15:09:19.617801087 +0000
+@@ -181,8 +181,8 @@
+ if (pid <= 0) {
+ struct statfs stfs;
+ if (fstatfs(cfd, &stfs) == 0 &&
+- (stfs.f_type == (__SWORD_TYPE)STATFS_RAMFS_MAGIC ||
+- stfs.f_type == (__SWORD_TYPE)STATFS_TMPFS_MAGIC))
++ (stfs.f_type == STATFS_RAMFS_MAGIC ||
++ stfs.f_type == STATFS_TMPFS_MAGIC))
+ recursiveRemove(cfd);
+ else
+ warn(_("old root filesystem is not an initramfs"));
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 00000000..85c48114
--- /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 00000000..785ff9f5
--- /dev/null
+++ b/sys-apps/util-linux/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>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='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-r99.ebuild b/sys-apps/util-linux/util-linux-2.24.1-r99.ebuild
new file mode 100644
index 00000000..bb150bcd
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.24.1-r99.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.24.1-r2.ebuild,v 1.8 2014/05/14 18:13:29 ssuominen Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,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="amd64 arm ~mips ppc x86"
+ 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
+ epatch "${FILESDIR}"/${PN}-2.24.1-musl.patch #for musl
+ epatch "${FILESDIR}"/${PN}-2.24.2-hexdump.patch #for musl
+ 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.25-r99.ebuild b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
new file mode 100644
index 00000000..2e10960f
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.25.ebuild,v 1.5 2014/08/05 23:04:39 vapier Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,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="~amd64 ~arm ~mips ~ppc ~x86"
+ KEYWORDS=""
+ 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 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}"/${P}-lscpu-pic.patch #518936
+ epatch "${FILESDIR}"/${PN}-2.25-remove__SWORD_TYPE.patch
+ 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)" \
+ $(multilib_native_use_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-r99.ebuild b/sys-apps/util-linux/util-linux-2.25.2-r99.ebuild
new file mode 100644
index 00000000..17f7738c
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.2-r99.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.25.2.ebuild,v 1.1 2014/10/24 16:27:07 vapier Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,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="amd64 arm ~mips ppc x86"
+ 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
+ epatch "${FILESDIR}"/${PN}-2.25-remove__SWORD_TYPE.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-auth/polkit/Manifest b/sys-auth/polkit/Manifest
new file mode 100644
index 00000000..21304041
--- /dev/null
+++ b/sys-auth/polkit/Manifest
@@ -0,0 +1,4 @@
+AUX polkit-make-netgroup-support-optional.patch 2818 SHA256 840f295f8c99005938a501e696080136bcea6696a2e0abfe4c5f0f1e46a079a0 SHA512 90ad57cdbdfcd706b1443b596eb2aa849e73e56d6c25c72683270a8f71d5e8c0144c9fa39e4267928531b1b7bf1870ab29cb6f19981ef1621419da7540d8ccbb WHIRLPOOL c68e260ce7fa65001fe0a4fcff97ebff9c447cad7d6fb8a564ebfb13e27b5c6e09be6b8f30a56cd1a3fcd0efe4346c6736e75004fd4aaeb1163209ad61eb77b7
+DIST polkit-0.112.tar.gz 1429240 SHA256 d695f43cba4748a822fbe864dd32c4887c5da1c71694a47693ace5e88fcf6af6 SHA512 e4ad1bd287b38e5650cb94b1897a959b2ceaa6c19b4478ba872eacb13b58758fd42f6ab1718976162d823d850cd5c99b3ccadf1b57d75dea7790101422029d5f WHIRLPOOL af5dd0a17b7356302b0319e80565d6ac916128dfc85b6e2711147f3de86651f11fe8d08f3d6067d7abd24e263be92403f9d8f46935ba93db571e386a603a038a
+EBUILD polkit-0.112-r99.ebuild 3424 SHA256 efefa359d9a7532552a15adf3a87cbf6b07e9f23b13221cdd518c841e656b02a SHA512 82435a7ddf17fc4cc320b6fb74002dde0ecbdd3ec053f4aa2a9a18888325024a547232d28af1df4be406ce45d896d60c9a29c126881d7b2d97ec6e3c645490aa WHIRLPOOL 78e567239a79bb51310489f6c70ed392d36144f65d606983990e5b1dd3bf44ab88f12caf6b4894219e4dc396075697f66669d24a38068cc90f885cafcf87ca7a
+MISC metadata.xml 379 SHA256 ecde37fb639f16a58cccb842e5e1c5ab40359a62045c3d622f4960cd6c3da42b SHA512 6d0bfcbf0e5123e4f088b0d8b6f8558c7a5f62b0dde794b61c03466790d4064071dcb2b47350f197049f5c2e34aa762cf0f1829a2bb6de646c46f2f5bfb8264b WHIRLPOOL c457da71156bb08f89f6a0479334d1a665c011987d084f1a49a23b4b6109b929c75b1d29bfd149e22921de19f159c7d2fc46de6f2c94541f9b93b1d676e0a92a
diff --git a/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch b/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch
new file mode 100644
index 00000000..07efd0e7
--- /dev/null
+++ b/sys-auth/polkit/files/polkit-make-netgroup-support-optional.patch
@@ -0,0 +1,86 @@
+diff --git a/configure.ac b/configure.ac
+index 4bb6d90..8d30a95 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -158,7 +158,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"],
+ [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+ AC_SUBST(EXPAT_LIBS)
+
+-AC_CHECK_FUNCS(clearenv)
++AC_CHECK_FUNCS(clearenv getnetgrent innetgr)
+
+ if test "x$GCC" = "xyes"; then
+ LDFLAGS="-Wl,--as-needed $LDFLAGS"
+diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
+index 3bd2f0b..9d2ec61 100644
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
++++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -2103,6 +2103,7 @@ get_users_in_group (PolkitIdentity *group,
+ return ret;
+ }
+
++#if defined HAVE_GETNETGRENT
+ static GList *
+ get_users_in_net_group (PolkitIdentity *group,
+ gboolean include_root)
+@@ -2154,6 +2155,7 @@ get_users_in_net_group (PolkitIdentity *group,
+ endnetgrent ();
+ return ret;
+ }
++#endif
+
+ /* ---------------------------------------------------------------------------------------------------- */
+
+@@ -2243,10 +2245,12 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
+ {
+ user_identities = g_list_concat (user_identities, get_users_in_group (identity, FALSE));
+ }
++#if defined HAVE_GETNETGRENT
+ else if (POLKIT_IS_UNIX_NETGROUP (identity))
+ {
+ user_identities = g_list_concat (user_identities, get_users_in_net_group (identity, FALSE));
+ }
++#endif
+ else
+ {
+ g_warning ("Unsupported identity");
+diff --git a/src/polkitbackend/polkitbackendjsauthority.c b/src/polkitbackend/polkitbackendjsauthority.c
+index bc2fe22..b84c110 100644
+--- a/src/polkitbackend/polkitbackendjsauthority.c
++++ b/src/polkitbackend/polkitbackendjsauthority.c
+@@ -29,6 +29,7 @@
+ #include <glib/gstdio.h>
+ #include <locale.h>
+ #include <glib/gi18n-lib.h>
++#include <sys/wait.h>
+
+ #include <polkit/polkit.h>
+ #include "polkitbackendjsauthority.h"
+@@ -1450,13 +1451,16 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
+ JSBool ret = JS_FALSE;
+ JSString *user_str;
+ JSString *netgroup_str;
+- char *user;
+- char *netgroup;
+ JSBool is_in_netgroup = JS_FALSE;
+
+ if (!JS_ConvertArguments (cx, argc, JS_ARGV (cx, vp), "SS", &user_str, &netgroup_str))
+ goto out;
+
++#if defined(HAVE_INNETGR)
++ {
++ char *user;
++ char *netgroup;
++
+ user = JS_EncodeString (cx, user_str);
+ netgroup = JS_EncodeString (cx, netgroup_str);
+
+@@ -1470,6 +1474,8 @@ js_polkit_user_is_in_netgroup (JSContext *cx,
+
+ JS_free (cx, netgroup);
+ JS_free (cx, user);
++ }
++#endif
+
+ ret = JS_TRUE;
+
diff --git a/sys-auth/polkit/metadata.xml b/sys-auth/polkit/metadata.xml
new file mode 100644
index 00000000..d553f2f4
--- /dev/null
+++ b/sys-auth/polkit/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>freedesktop</herd>
+ <maintainer>
+ <email>freedesktop-bugs@gentoo.org</email>
+ </maintainer>
+ <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-auth/polkit/polkit-0.112-r99.ebuild b/sys-auth/polkit/polkit-0.112-r99.ebuild
new file mode 100644
index 00000000..1d239c2c
--- /dev/null
+++ b/sys-auth/polkit/polkit-0.112-r99.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/polkit/polkit-0.112-r2.ebuild,v 1.17 2015/02/11 03:45:06 patrick Exp $
+
+EAPI=5
+inherit eutils autotools multilib pam pax-utils systemd user
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide services"
+HOMEPAGE="http://www.freedesktop.org/wiki/Software/polkit"
+SRC_URI="http://www.freedesktop.org/software/${PN}/releases/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="examples gtk +introspection jit kde nls pam selinux systemd"
+
+CDEPEND="
+ ia64? ( =dev-lang/spidermonkey-1.8.5*[-debug] )
+ hppa? ( =dev-lang/spidermonkey-1.8.5*[-debug] )
+ mips? ( =dev-lang/spidermonkey-1.8.5*[-debug] )
+ !hppa? ( !ia64? ( !mips? ( dev-lang/spidermonkey:17[-debug,jit=] ) ) )
+ >=dev-libs/glib-2.32
+ >=dev-libs/expat-2:=
+ introspection? ( >=dev-libs/gobject-introspection-1 )
+ pam? (
+ sys-auth/pambase
+ virtual/pam
+ )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ dev-util/intltool
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-policykit )
+"
+PDEPEND="
+ gtk? ( || (
+ >=gnome-extra/polkit-gnome-0.105
+ lxde-base/lxpolkit
+ ) )
+ kde? ( || (
+ kde-plasma/polkit-kde-agent
+ sys-auth/polkit-kde-agent
+ ) )
+ !systemd? ( sys-auth/consolekit[policykit] )"
+
+QA_MULTILIB_PATHS="
+ usr/lib/polkit-1/polkit-agent-helper-1
+ usr/lib/polkit-1/polkitd"
+
+pkg_setup() {
+ local u=polkitd
+ local g=polkitd
+ local h=/var/lib/polkit-1
+
+ enewgroup ${g}
+ enewuser ${u} -1 -1 ${h} ${g}
+ esethome ${u} ${h}
+}
+
+src_prepare() {
+ sed -i -e 's|unix-group:wheel|unix-user:0|' src/polkitbackend/*-default.rules || die #401513
+ epatch "${FILESDIR}"/${PN}-make-netgroup-support-optional.patch
+ eautoreconf || die
+}
+
+src_configure() {
+ econf \
+ --localstatedir="${EPREFIX}"/var \
+ --disable-static \
+ --enable-man-pages \
+ --disable-gtk-doc \
+ $(use_enable systemd libsystemd-login) \
+ $(use_enable introspection) \
+ --disable-examples \
+ $(use_enable nls) \
+ $(if use hppa || use ia64 || use mips; then echo --with-mozjs=mozjs185; else echo --with-mozjs=mozjs-17.0; fi) \
+ "$(systemd_with_unitdir)" \
+ --with-authfw=$(usex pam pam shadow) \
+ $(use pam && echo --with-pam-module-dir="$(getpam_mod_dir)") \
+ --with-os-type=gentoo
+}
+
+src_compile() {
+ default
+
+ # Required for polkitd on hardened/PaX due to spidermonkey's JIT
+ local f='src/polkitbackend/.libs/polkitd test/polkitbackend/.libs/polkitbackendjsauthoritytest'
+ local m=''
+ # Only used when USE="jit" is enabled for 'dev-lang/spidermonkey:17' wrt #485910
+ has_version 'dev-lang/spidermonkey:17[jit]' && m='m'
+ # hppa, ia64 and mips uses spidermonkey-1.8.5 which requires different pax-mark flags
+ use hppa && m='mr'
+ use ia64 && m='mr'
+ use mips && m='mr'
+ [ -n "$m" ] && pax-mark ${m} ${f}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc docs/TODO HACKING NEWS README
+
+ fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
+
+ diropts -m0700 -o polkitd -g polkitd
+ keepdir /var/lib/polkit-1
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}/examples
+ doins src/examples/{*.c,*.policy*}
+ fi
+
+ prune_libtool_files
+}
+
+pkg_postinst() {
+ chown -R polkitd:root "${EROOT}"/{etc,usr/share}/polkit-1/rules.d
+ chown -R polkitd:polkitd "${EROOT}"/var/lib/polkit-1
+}
diff --git a/sys-block/parted/Manifest b/sys-block/parted/Manifest
new file mode 100644
index 00000000..358cafa8
--- /dev/null
+++ b/sys-block/parted/Manifest
@@ -0,0 +1,6 @@
+AUX parted-3.2-devmapper.patch 1972 SHA256 a72db7a487b891b19e6b859a6deaa4defe0c603842f1a91962de553e68acc96f SHA512 3baf2090ba86242df1633bb4b50deeb6e0226b0a56ad82466ddd76f028a859e29bd021f1f251047cd2a2a5ea1c77ed0129eca8be2e97ee48c21c1d186c07b8da WHIRLPOOL c0a16dce6f967b6d4d343bec9fe34c0803fdb231aa51abede4b94080db90af8be36d232f9d24246808a59be13be7635b520b0ec6c2cd82a99515c2ad0866f876
+AUX parted-3.2-fix-includes.patch 257 SHA256 f87c9290e861b969f4520a1af84ebf4b8f5f1437c1d78ee235d5ffcda3bffe84 SHA512 55ee63c218d1867c0f2c596e7c3eec5c42af160181456cc551fe3d432eabed0ac2dd3a3955ff0c375f76aeec8071e7f55a32834b87a0d39b8ef30361f671bfdd WHIRLPOOL cbc2d36e9e0d59f032f4cd7e3a487674a17b8e87a873dea796dfadda7219526ad052b5826a9a353c0ed6d387b8f8c0ed9420394c8037f85c5deec08b292a158c
+AUX parted-3.2-po4a-mandir.patch 275 SHA256 327ffc2ea942a58a63cf6dc21d041965ee76b3b7d4d01b36a0654dcb6b0a92ae SHA512 5ef686f56d8c3939da3f24fdb6196d8858c2f980805f1cb06020d6f6996158f62b8372a233ec3ec98aae30b41034046d615e415b3abf2648db7be88e3b45a872 WHIRLPOOL 643013b78ebd6dbd93a60e7fc46215851bcd9d3166f0df308fa9d1a3927772cf1d63d2ba0da737983b3fbb0ff125f946d27662808e6233f6c60bdf4f7425898d
+DIST parted-3.2.tar.xz 1655244 SHA256 858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4 SHA512 4e37dbdd6f5032c9ebfec43704f6882379597d038167b9c4d04053efa083c68a705196713864451fa9e11d32777e16c68982877945c5efd9ea5f8252cb20e1c4 WHIRLPOOL af928177b893150ac6d5e0efcef542b6fa0df6b135f975078f7d8d5f7a4b109ef4c1f8eeaf6afc5c34448ff662ce4cbe5289e084f4ec05257666503a0cd3c93f
+EBUILD parted-3.2-r99.ebuild 1424 SHA256 194bdb7d16ee41340a859fc1d8e9621943db8ea294660af05e4b0aa8ef493457 SHA512 5e72c2363a4578cf16eb476f1e8aedd39b353750223151d6e07a0ff98feee2e8af82e9732e35790531d63fdfc9fdf968f5e11b07d2da6397f75c0d479abe3a84 WHIRLPOOL 6f1dc64779807e27132d77b56a2be138b0b98e1d10c303f24aeb2c41b3c41a2e391bc4258da0cebe4ecea3ac182e23ed2a74545c407b169a30eb1c03e55b1106
+MISC metadata.xml 654 SHA256 6e27cdd8e0c516256079e3ad9606e7b660a3fe223e3d769c3a5fc265f5d13bd2 SHA512 4e99dbb6bacc84d5dfccf4f56cd474aa5cd9368f23989b71d38101913702f5670af44f41947158b07662fcbee3ddfc36eb8cdf8c3899387a8cf4efd4c24c6ccf WHIRLPOOL 49366ca8e059614582ec750bd215ef79b2090cb615e85d1d5e5d4093c135ff9a4513862ecf9827318163a622df035855b0795ab6405427c4d48712fe2080e0fa
diff --git a/sys-block/parted/files/parted-3.2-devmapper.patch b/sys-block/parted/files/parted-3.2-devmapper.patch
new file mode 100644
index 00000000..0cd3e0e3
--- /dev/null
+++ b/sys-block/parted/files/parted-3.2-devmapper.patch
@@ -0,0 +1,60 @@
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -2304,6 +2304,7 @@
+ return r < 0 ? NULL : resultp;
+ }
+
++#ifdef ENABLE_DEVICE_MAPPER
+ static char *
+ dm_canonical_path (PedDevice const *dev)
+ {
+@@ -2326,12 +2327,22 @@
+ err:
+ return NULL;
+ }
++#endif /* ENABLE_DEVICE_MAPPER */
+
+ static char*
+ _device_get_part_path (PedDevice const *dev, int num)
+ {
+- char *devpath = (dev->type == PED_DEVICE_DM
+- ? dm_canonical_path (dev) : dev->path);
++ char *devpath =
++#ifdef ENABLE_DEVICE_MAPPER
++ (
++ dev->type == PED_DEVICE_DM
++ ? dm_canonical_path (dev) :
++#endif /* ENABLE_DEVICE_MAPPER */
++ dev->path
++#ifdef ENABLE_DEVICE_MAPPER
++ )
++#endif /* ENABLE_DEVICE_MAPPER */
++ ;
+ size_t path_len = strlen (devpath);
+ char *result;
+ /* Check for devfs-style /disc => /partN transformation
+@@ -2945,12 +2956,14 @@
+ unsigned long long *length);
+
+
++#ifdef ENABLE_DEVICE_MAPPER
+ if (disk->dev->type == PED_DEVICE_DM) {
+ add_partition = _dm_add_partition;
+ remove_partition = _dm_remove_partition;
+ resize_partition = _dm_resize_partition;
+ get_partition_start_and_length = _dm_get_partition_start_and_length;
+ } else {
++#endif /* ENABLE_DEVICE_MAPPER */
+ add_partition = _blkpg_add_partition;
+ remove_partition = _blkpg_remove_partition;
+ #ifdef BLKPG_RESIZE_PARTITION
+@@ -2959,7 +2972,9 @@
+ resize_partition = NULL;
+ #endif
+ get_partition_start_and_length = _kernel_get_partition_start_and_length;
++#ifdef ENABLE_DEVICE_MAPPER
+ }
++#endif /* ENABLE_DEVICE_MAPPER */
+
+ /* lpn = largest partition number.
+ * for remove pass, use greater of device or label limit */
diff --git a/sys-block/parted/files/parted-3.2-fix-includes.patch b/sys-block/parted/files/parted-3.2-fix-includes.patch
new file mode 100644
index 00000000..c6eff0eb
--- /dev/null
+++ b/sys-block/parted/files/parted-3.2-fix-includes.patch
@@ -0,0 +1,10 @@
+--- parted-3.1.orig/libparted/fs/xfs/platform_defs.h
++++ parted-3.1/libparted/fs/xfs/platform_defs.h
+@@ -35,6 +35,7 @@
+ #define __XFS_PLATFORM_DEFS_H__
+
+ #include <stdio.h>
++#include <fcntl.h>
+ #include <stdarg.h>
+ #include <assert.h>
+ #include <endian.h>
diff --git a/sys-block/parted/files/parted-3.2-po4a-mandir.patch b/sys-block/parted/files/parted-3.2-po4a-mandir.patch
new file mode 100644
index 00000000..be0a9c69
--- /dev/null
+++ b/sys-block/parted/files/parted-3.2-po4a-mandir.patch
@@ -0,0 +1,11 @@
+--- a/doc/po4a.mk
++++ b/doc/po4a.mk
+@@ -23,7 +23,7 @@
+ # threshold is 80%), it won't be distributed, and the build won't fail.
+ #
+
+-mandir = $(mandir)/$(lang)
++mandir := $(mandir)/$(lang)
+
+ # Inform automake that we want to install some man pages in section 1, 5
+ # and 8.
diff --git a/sys-block/parted/metadata.xml b/sys-block/parted/metadata.xml
new file mode 100644
index 00000000..57a67699
--- /dev/null
+++ b/sys-block/parted/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>livecd</herd>
+<use>
+ <flag name='device-mapper'>
+ Enable device-mapper support from <pkg>sys-fs/lvm2</pkg> in parted
+ </flag>
+ <flag name="debug">
+ Enable debugging as encouraged by upstream: [The default configuration]
+ includes --enable-debug (by default), which contains many assertions.
+ Obviously, these "waste" space, but in the past, they have caught
+ potentially dangerous bugs before they would have done damage, so we think
+ it's worth it. Also, it means we get more bug reports ;)
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/sys-block/parted/parted-3.2-r99.ebuild b/sys-block/parted/parted-3.2-r99.ebuild
new file mode 100644
index 00000000..b7b307bc
--- /dev/null
+++ b/sys-block/parted/parted-3.2-r99.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/parted/parted-3.2.ebuild,v 1.14 2015/03/03 09:57:56 dlan Exp $
+
+EAPI=5
+inherit autotools eutils
+
+DESCRIPTION="Create, destroy, resize, check, copy partitions and file systems"
+HOMEPAGE="http://www.gnu.org/software/parted"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+debug device-mapper nls readline selinux static-libs"
+RESTRICT="test"
+
+# specific version for gettext needed
+# to fix bug 85999
+RDEPEND="
+ >=sys-fs/e2fsprogs-1.27
+ >=sys-libs/ncurses-5.7-r7
+ device-mapper? ( >=sys-fs/lvm2-2.02.45 )
+ readline? ( >=sys-libs/readline-5.2:= )
+ selinux? ( sys-libs/libselinux )
+"
+DEPEND="
+ ${RDEPEND}
+ nls? ( >=sys-devel/gettext-0.12.1-r2 )
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2-devmapper.patch
+ epatch "${FILESDIR}"/${PN}-3.2-po4a-mandir.patch
+ epatch "${FILESDIR}"/${PN}-3.2-fix-includes.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable debug) \
+ $(use_enable device-mapper) \
+ $(use_enable nls) \
+ $(use_enable selinux) \
+ $(use_enable static-libs static) \
+ $(use_with readline) \
+ --disable-rpath \
+ --disable-silent-rules
+}
+
+DOCS=( AUTHORS BUGS ChangeLog NEWS README THANKS TODO doc/{API,FAT,USER.jp} )
+
+src_install() {
+ default
+ prune_libtool_files
+}
diff --git a/sys-boot/efibootmgr/Manifest b/sys-boot/efibootmgr/Manifest
new file mode 100644
index 00000000..26e3627b
--- /dev/null
+++ b/sys-boot/efibootmgr/Manifest
@@ -0,0 +1,4 @@
+AUX efibootmgr-use-linux-pci-header.patch 417 SHA256 5c9cc92b268e7ef45dbfdb1ce1ecf31b29d1703a289b618cc3851a4ab0c79299 SHA512 c4e5861896bb59d90992852e6a8df01cd804540e31751cf576ec0cf51e9a023c6341f826f85efc3e363c5bbc4bd201e1bdb9547ef7ac10d4119f02744519e974 WHIRLPOOL 840e09af90b3dc1f96bc50200bf1c4cc7b249b50c1c90676c284b86d9787050c4064f0a4b80eaa205840c4dabc302c569744ceef3d51c561febd4370c609925b
+DIST efibootmgr-0.11.0.tar.bz2 53636 SHA256 f27ce3d7588512017bceb2d2a29aef110499a662a21550afa1158f9950f976d1 SHA512 65866239ae3e2f0142f48e57b16c2a2f4b736e6c7942e595492d82c628633826cfe1a68dd850b8d3090b1a0bd1bbf1906ea882e377a593d1866d686b984cac19 WHIRLPOOL 411cca8fcc26620d2c2a9d15f39e4bafc430efa2789cfe875b411522c641e6754295a640bf03876fd45c8c7c2880f81779bebd95485459316ed846210d7bb533
+EBUILD efibootmgr-0.11.0-r99.ebuild 954 SHA256 90968115e07ad2e950b9b823d5a4cbc7ee9cf3482b57475d4c83c4535cf8eaff SHA512 5cd8b9492730b1384496de09b800681e6150883882f1d75d3d530a5ea54c1e2761e4151e3b70e877d8803e0016a4374dfeaa8e1df2a98911bcaa1f4b5b7c3e8b WHIRLPOOL c00d7f50e4a3049e36a15057a80d80a4bdbf2a742eed41b1ddac7e8ef7459909ba64e04d345d75a0ffb9921ed2a8c5c4d3c5599c6e02d46a37efd0d1f51a20a3
+MISC metadata.xml 721 SHA256 2cd408b3fef01dddc0b14853a4eb8175dae030fe21a7a326279531bd1071c227 SHA512 c6e9a85ede378f46ac22c5cbfb6e8bb7753e1202ddbfc7fbeda07a6e2aea5894e0de85a9bc2c485ae16d3af2ee707f1dcdb8e94d60dbd7e5d2e74cbc1d938664 WHIRLPOOL d454adeddf3a181d5fbc6738102832237e98fc2ec9c0ee3a4bc94dea2f3b5be1167699e46eaa5dbfa5049f16e29d3b2e760f26fe67e33bad20b2377e2d5deb65
diff --git a/sys-boot/efibootmgr/efibootmgr-0.11.0-r99.ebuild b/sys-boot/efibootmgr/efibootmgr-0.11.0-r99.ebuild
new file mode 100644
index 00000000..6f043a77
--- /dev/null
+++ b/sys-boot/efibootmgr/efibootmgr-0.11.0-r99.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-boot/efibootmgr/efibootmgr-0.11.0.ebuild,v 1.4 2015/02/28 13:25:47 ago Exp $
+
+EAPI=5
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space application to modify the EFI boot manager"
+HOMEPAGE="https://github.com/vathpela/efibootmgr"
+SRC_URI="https://github.com/vathpela/${PN}/releases/download/${P}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ia64 x86"
+IUSE=""
+
+RDEPEND="sys-apps/pciutils
+ sys-libs/efivar"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/efibootmgr-use-linux-pci-header.patch"
+ sed -i -e s/-Werror// Makefile || die
+}
+
+src_configure() {
+ tc-export CC
+ export EXTRA_CFLAGS=${CFLAGS}
+}
+
+src_install() {
+ # build system uses perl, so just do it ourselves
+ dosbin src/efibootmgr/efibootmgr
+ doman src/man/man8/efibootmgr.8
+ dodoc AUTHORS README doc/ChangeLog doc/TODO
+}
diff --git a/sys-boot/efibootmgr/files/efibootmgr-use-linux-pci-header.patch b/sys-boot/efibootmgr/files/efibootmgr-use-linux-pci-header.patch
new file mode 100644
index 00000000..7fa44f0a
--- /dev/null
+++ b/sys-boot/efibootmgr/files/efibootmgr-use-linux-pci-header.patch
@@ -0,0 +1,17 @@
+Use pci.h from linux... sys/pci.h is glibc specific.
+
+--- src/lib/scsi_ioctls.c.orig 2014-12-28 10:43:35.513305649 +0100
++++ src/lib/scsi_ioctls.c 2014-12-28 10:43:45.024306074 +0100
+@@ -19,11 +19,11 @@
+ */
+
+ #include <stdio.h>
+-#include <sys/pci.h>
+ #include <stdint.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
++#include <linux/pci.h>
+ #include <linux/nvme.h>
+ #include "scsi_ioctls.h"
+
diff --git a/sys-boot/efibootmgr/metadata.xml b/sys-boot/efibootmgr/metadata.xml
new file mode 100644
index 00000000..1f9a68be
--- /dev/null
+++ b/sys-boot/efibootmgr/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>proxy-maintainers</herd>
+ <maintainer>
+ <email>yannick.schaeffer@epfl.ch</email>
+ <name>Yannick Schaeffer</name>
+ <description>Mantainer. Assign bugs to him</description>
+ </maintainer>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+ <longdescription>
+ This is efibootmgr, a Linux user-space application to modify the Intel
+ Extensible Firmware Interface (EFI) Boot Manager. This application
+ can create and destroy boot entries, change the boot order, change
+ the next running boot option, and more.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
new file mode 100644
index 00000000..d107c22c
--- /dev/null
+++ b/sys-devel/gcc/Manifest
@@ -0,0 +1,30 @@
+AUX awk/fixlafiles.awk 7807 SHA256 3cae4890a295adef50c6cf8a7e14d1be4e7a2356479c073e5c29433c3cdf9c5c SHA512 a39e09db4f34d1358de9e929b4c1e10b677d7e8aeffd6afb36d42543b18f1dfa77e3e26331e3fa1b556bae3d8c75ab4bd5796c7ccf2dda4eb365edb307828bed WHIRLPOOL 0cb6e5e96460514c17f3242d8fe936dc2545c07ca08c03ceb34730935435fde24d197300da54d4a19de86067f9e4bbc14178da2f7c03f4be57c89c81307f5d82
+AUX awk/fixlafiles.awk-no_gcc_la 8596 SHA256 91e36c29133b6ff854bc84acd6cd2e9d07be6eaa73ef9b23e4f7bc6371107fab SHA512 a970ade3e0b57b3280dd01036a95338c4a7f0c7ec45e7aeb7255197df43e13a5fad8c565b4b345e3a0c8326f71ae7ab598b804eaeaa9d59eda8683195bccfe45 WHIRLPOOL e3da866b8902fbf639af545b43c3b6ccaca0f5d543647007f02e0b8bfc16a675463b8681e9fad11d6ce29517e099636f43708f880ef7a433e4578ee408c3b099
+AUX c89 412 SHA256 29ad5dd697135c2892067e780447894dc1cd071708157e46d21773ab99c5022c SHA512 71d33a147339d8d70a62aa22a95d3e70e445d8435d6ac05893f7da19ae851b89bea851f6ce213fbd22470f13572ae13b83cf02f0621333f07d7b0c68a79b7924 WHIRLPOOL d9707a2be8da7a709b54fcb1154cfa05e479f8c3bdd6173822ee1f1bc265b2a0d04741c0685bfb0db68e1e4297fb032d2f8ff94da88014575d947054474d8295
+AUX c99 446 SHA256 057b348cf5be9b4fb9db99a4549f6433c89d21e5f91dc5e46b0b4dc6b70432f5 SHA512 bf3b0eb1125d5e89b433954fcbf805cd86dec5a6eeb23df685ebf3ff83a610573f2ffcec65d893244c845936a73918387cba026710c65c854b2c94a78b007989 WHIRLPOOL b888038b96615c7a0363555b407a3de2c1f17e34428fa16dfbf56fcf68875d6bcdecbc61b545d7f71842ff1909a3ffeff17165fa7f56b48f95adae22f5f8bff1
+AUX fix_libtool_files.sh 1679 SHA256 0037e3f1303560f1ffadc61c7ed6bca13a41d6f2f70f196276938cda9dd158f0 SHA512 834beeb04f1057a0b1f79025fc9bbe0193ea8457055cc10b5b4c528a60e37ead7614a686aa6e7285e040161a91d4b5ff394539a33fc2f4b44be5c2514d0bb283 WHIRLPOOL c7e2f517e0c5c9a8930cd615f68222b44a6f227518ea71b5eb9b6436e1642be748d9cb4c0732f27df6c2ded2eb2c758d67ee9cb58e409f30814f988523dc649b
+AUX gcc-4.7.3-musl-linker-path.patch 3097 SHA256 dbc140267f3ccaf7dce4dbb153920d90018c453ffbc531864cc73a2dc5f002a2 SHA512 2c33899aa8bb8a8b1ad974c3da9039984aa52fe2d2f52d0f6ddf3aa6386419ee32907f40f60db552abcd0e1dee04cae91a029e37fe531938614f9c66e9518cd7 WHIRLPOOL d4f8a1a6abb083566d4ceb5deed31c2c35bd06f4b786ecd365d19606413c5e7f8579fac05a990a12157a139c243286ebcb7c61108ed69ae6477ef20f579cec86
+AUX gcc-4.7.3-powerpc-libc-stack-end.patch 5374 SHA256 880028136d6a3352e74664d0fccda293fe078a5adb58ddb84cbf4d301aee01c7 SHA512 c66b561cb8db68f86b9c001625fb5599db268e576ac163eb47226976e81dc97b3d4ad3cd9f9b0ef44cac0ca9d353be3ae4709e75ed319ff08175ff4e1b1aa174 WHIRLPOOL c7ae1a535410ca5c7d5a8e3b2f8f2bcaeaceaf1cc9c20b3426efd09422b3a957cca7527842f720655a94b5bc8c82642eef0d693003071bd7f80a381d58be848b
+AUX gcc-4.7.4-secure-plt.patch 1915 SHA256 668c57298064abf6d58857126cdbcefab6d3117726198185ca4f24855c3f7180 SHA512 0e23385b9e654acc296e5b3f333b5859174dea852f38bc5acb182ce15d6ac568dc588c69407b066dc0b91ffb48a1f1c0d8d25720d3ab268da8a56d1c6c40492a WHIRLPOOL 9e061026ea0f87416ea0cd39dc64c074d79001f26d513ec2a6777b42caf47b6bf250bedebcace52c351cf95710318012039da58fdc7d2ef59e51fffc445e3edf
+AUX gcc-4.8.3-musl-fix-libc5-assumption.patch 529 SHA256 74cdaebe0e376c05f64808f9ec61682b5dc6f29fd36883af8e54dfcc261d68f8 SHA512 7fac0b48acf187d4a56f63148af51a17fff75d97fbe2b8256efbb51ba26d74ea06e11e0834f04f5d1f4b492cfd5860b52252428b9c87d7dfbe813d4601e782d5 WHIRLPOOL 6b830b5fcc56ae2cfe96ce17278063004a0aaa80db022daf6199d5c8cb49764ed7e2d9863d0d16e9b5e29ae031c4326ad940fa816d64f0ae257899c392fe9d18
+AUX gcc-4.8.3-musl-linker-path.patch 3425 SHA256 d5415e1ae64dfb0e2b9e164806884441c62e5261e3d253437afd8e885529d2c5 SHA512 c2d62fb4e7e636c95ed013910b84ea46b09e7af8dc03ca7b7018f9623ebfdb3aadf277a3248a9e01a913445cb03dc1a91e46152198d02c272f35c559ea6b825f WHIRLPOOL 02666002615a49f45b3c977e90053de399d88664c6332c886e6aded8faa73abcdda7374e67f7848a40f05ed2a13bef0ef5725f237a1a9b971e467790176b0f35
+AUX gcc-4.8.3-musl-res_state.patch 668 SHA256 ff5948712855a10f4b65750b9fa3fb188adf69ff5612161aeff5e6674cf292ba SHA512 bf30a772b5858210ac8ed46c50146655df98809c1daeb755fad9de592e7339c2e25b0870efd6351067f12e93a2270774a0e7bfbf0dfe8e0301c145c0dd966b30 WHIRLPOOL 457a548a900536024d722a2ff27f757a167c2ac9f1c4b3f38b0bbd29836b80938ad977617a1dfb71d81e063b2dc7213e8332ef4f9ad2a36eb402b8f97727b427
+AUX gcc-4.8.3-secure-plt.patch 1866 SHA256 65c60adf4a4fcf4707e8acc51e4062124b742601ed7f7ae049e69790cb051658 SHA512 5a4ab263be1e10aa1d7685c0dcd2537e0ff1d50b3f9687064988ae04f18f995fc608e76644ba657a28bb1217c96dfef7b64da7e6fa3ed522001140a51a67a8a3 WHIRLPOOL 2a60dcea7de6e2706370ed66f3b7f99c250bce96021e1c7ee16cd9d3358bea4bcbbd1a893662e8027dc59a9e58f95c890c81ee2070e83170b9a83b6d5a9d8ac7
+AUX gcc-configure-LANG.patch 2052 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129 WHIRLPOOL 3cc1ec912fb192ff1058de5b93e49a994ba30d1501a932290dd5b3df1cd783875621cda56edeb41894cd5fa10c04917e693a40a60be8d742ddd7992bf5d8afeb
+AUX gcc-configure-texinfo.patch 337 SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 SHA512 a15fba8bf2ff02bdeca54d6f186bfa08c1079c6a8ba0a3beef154483ce5c1b8c497e7ffeec32371968f0037e0ff8384609eb0c367d0155a4e5a7eef8aad084d5 WHIRLPOOL 39d008aad06f7621e4e5db15f5e85a59e583b43f8d247029bd4944466bb60a9795bda157d185c45c329294078e282703a243aad5c468d90c77665dd6336870d4
+AUX gcc-spec-env-r1.patch 3148 SHA256 da0a6442eb42bce58cbdc7858b110a2e65fc5bd5b4b780b9b491033de6e302fa SHA512 ecae71577543772cfe1711f1b4a8815c0b5d706ebd01edacd1f07586637d4805e25771f970a6e6d1bb696d4b1b5ef3e0036088a96a9f6beff7ddaee704175d16 WHIRLPOOL 3535605998eabccdee71ba396ed5cefbb8b0a8cb073101f6444c7d01233f3b3904c1b29f4daf0a3417c68de8dbd62a0b7dc367cacfcbfa0c4ee1b69b7df8c6fb
+AUX gcc-spec-env.patch 1544 SHA256 64b01f29fb853fee5ecda998b66eeaa7ec86ff1fc3b21432bfd69eb543c93e6a SHA512 ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 WHIRLPOOL b88c9c18e20868b3ff535c3390408ebe8f1304bcec6e70b6472781f684671265860dff4335f2301d3b4d3b73395283b29673f0f5da62414e1094cfcb8130e8d8
+AUX mkinfodir 7324 SHA256 0565353e767e253207adb8b5c9be9ba215a628447e075a4dc7bb3183ed099d2a SHA512 a05f9130d98e4cb4d3254b757de06d772d0a965ac4b5a9a15082b1cb694a2fd32c9c8f550745a9423ba3cfdd1c5e87b6d568a809301772a24cc6e1a414d5f98b WHIRLPOOL 4001ae3f7fb666a84e12432a1a41eacf62ebf922181c279e4d06dad32e44d0b499d13e098e794fdd19a9cff5c438a28e5e9e125fb78e72bb913fa5ddd8e44bae
+DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad
+DIST gcc-4.4.3-specs-0.2.0.tar.bz2 2004 SHA256 f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 SHA512 779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 WHIRLPOOL 8a1e45aad9d306cb19de93c63b5854a97e629d90852feb6861dcfca042b6257705304fc13ad65655a4cb227d36b83fc6063648c94f270821574ee0e85307094e
+DIST gcc-4.7.4-patches-1.1.tar.bz2 40801 SHA256 e9dfa4dfb654d1ba3e298aadf50df4e43b64f10eea6c2a79a3d551a8ec52cf83 SHA512 5c3cbfb6b1df90080ef9a2fc18c5de93e9cf92f2ef3a6226fb3fd8faff94bdcc18779a5e68bb49ca5c209169811eb67b1ec13c1c54efe03b76103a9eb1effdc7 WHIRLPOOL 8b501c31b50afe44f2f23aace11e6320c20117f9fa2814457f95fe9fd624ac7d5c0145e23d13874d0201f9db515d68073e9b30c15b0e8ece02b2a7b0628c0c37
+DIST gcc-4.7.4-piepatches-v0.5.5.tar.bz2 15358 SHA256 6b568bd204e3ffb177df1830e5a888be3987491b4183bdb6ad75ad83c642a348 SHA512 f5e078bf4c17f7b5be102f1e3358d91c72e80363b5e055a92461f78399a1bf27bf6cb690d41900719bb260b6529f5d1aac999e613fda6ac5e4efa27f622510e6 WHIRLPOOL 42e348d5925cf4d43697a6dc06c911cc617f89037949ce1d8f7aa0fa93405f460e7416d6cd00e8fb2aac54c6f26fcae00691917f1517fcfb6891925efa3d3400
+DIST gcc-4.7.4-uclibc-patches-1.0.tar.bz2 3019 SHA256 cbdfe2947f653e11ac391dded461416e5cef1ff8900cf8fe92672de797b4018b SHA512 c2e6c96b74365f8233f6106fa03d94075b60f6f77c683aa2e27aceb007da723243f8e3ddea8b178e6a0f7939b8e35615165534dc74e5050f87680ab261a31c52 WHIRLPOOL 53c8bd64336eb55d8e3d62a33267d3d99c0239d5c818985a9830fd776d766aabf4b0bce630949c5b522580566e2eeba1b59bfc1b8388dee7ec6c990512d2c499
+DIST gcc-4.7.4.tar.bz2 82935453 SHA256 92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282 SHA512 dfcb737073191e628231031a3571ec77ee760a59377630f4a6e4fdfa66f9ddad39fde47e3f0f227eb43cdf90e0d34cde5abdc9ac892c1e111a911062a66c9189 WHIRLPOOL df8408e80634ce28f105f9abcdcf38fba5c130795cbe48428527a68819abebc3bc7152bb6ad714e40c71450a08986b48ddd630c887e1b2faf07c3babfe720969
+DIST gcc-4.8.4-patches-1.4.tar.bz2 25313 SHA256 afb729d3cd8d5f8038fbf9809d2eef3615b269e76b895056e82653d71537332c SHA512 d903ac0b2418a4ef151d7e372960a01cf724f25219122821625ae24ed4617d75e1d6c214910731f974f849f3e3df11b02d6aa4f24b5c6eca39b6af9774fb1e06 WHIRLPOOL d0b50fcf52fdcdb5dbee38ce10ddbb484c9772c0243cdd9ecc89ed3bd7a09a000afd5599bad3c6d75ee1822ab8dbe29951c605d57af9e0c22ccad8f09cdfa270
+DIST gcc-4.8.4-piepatches-v0.6.1.tar.bz2 14110 SHA256 558bd1babcd687979ef6269b8e4774a3a06b860bda44e0a8aafaaa55423574b4 SHA512 464c7c482a244f6e3d07beb0bbe6d007bb95502d76d08dbb9daca92bcdb4560571f85eb10a73f542a03d1c7ba90fd1e50cfb8220f933ef559ff6f7867bc8bbdc WHIRLPOOL cc3ab1819905a32dd5983d1fae5c6812343c1426ec3ef387c56eaf46c73c646e376ae6351a151bd5579393be5055a231cb94e29ab03051f729ad4c685e69b77f
+DIST gcc-4.8.4-uclibc-patches-1.0.tar.bz2 3004 SHA256 c7f9d3b7eba23a8042edad469a5e2a2a7ad613a7a6b6c658179409d7859edf41 SHA512 0e22e57731725f2d2a53c7137ee667a54ff92d30a7532660bc75220e2445452605e3e377b56b99bc3a62feb65d46b315f28aba3e075ffabd1e9d60e94e35b4af WHIRLPOOL 472cdbd2c7f77ce6505f6f5feb27d530edc5250d6e167ecd4a8ab1cd877abf4ae842f4785c55486bddb49e2e553c688c24a6d7e998cb211cde844b9867436c09
+DIST gcc-4.8.4.tar.bz2 86220648 SHA256 4a80aa23798b8e9b5793494b8c976b39b8d9aa2e53cd5ed5534aff662a7f8695 SHA512 b4c84ebd754c026029d706ef52c4242df4dcadc6a22cc5669b3aa37ac9dc25bc9cd9651fda83fb24dd5d17b1710e6865a35bb6c5cd9b95d0971717453935ae8e WHIRLPOOL b8b44413da420d083d0edcb846ad1b619971c399638e629089ca3bc8b6008a41bd38d688199f1451171d32443c37ab749f44a3763c5150f2147f729d4bd45a4b
+EBUILD gcc-4.7.4-r99.ebuild 2038 SHA256 016a8cb81c1df2ebc14899952d4a878b8d6af336d927ca521e446a802a8a52fe SHA512 9fd8d835881289a7c24d5e0c95b6345c1583834312eab65423bccc990bf9515aa0f8545cbd40b580e40424508967d8bde8566e782f2c737020c63cc824aa7d94 WHIRLPOOL 1a805ecce42c7b5a87d0e0da6aaddc37e7e8ffb4e75481c8133157f8a61fb5dbe329c4ca654d9df7367beea833d507e34a0510ccf4f99d2b2d21052970ae3606
+EBUILD gcc-4.8.4-r99.ebuild 2209 SHA256 56f5278f18751ee0d7dbf5ef00fb6dd8fced7bacd32f00dbfcea9029cd9fc202 SHA512 c5b33788ddae21efe63848a334d4749690c912097e82c89aaea646f98b8537e59ed30ab9a23bf63d8d8a8380805c0bf42d3bfbb2018f4c6ee82b16d6ce5bea42 WHIRLPOOL f40c57dda8f8ecac0f916d879e0519c166ae03839fa21d38970ac315725f26aec00a7ef60cdfc892cf9931736027387865b3e3ca1dec9b1e3ce19205275cbac7
+MISC metadata.xml 1647 SHA256 912a61ec01bb34d65df28f726b5fd31380c88b7b3dbf325860ae53de143e2d08 SHA512 733378ac017f7557e700faa7a28a18bd175e870bd3fc7d5e496bee4219ff5cfa0ff9ab3e506c61ce23693b1e4fb45b78bc34ad1fa9b87fc6280b7d23c5256b03 WHIRLPOOL 0614b060408667ea3d9250e5c7a056d61979ac1e7acbf4a54907c42549ee1d02675c2dfe01a167ae3901a9becd8b1aeb3aba42bfec026b2c6012650821a1dcfe
diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk
new file mode 100644
index 00000000..ffade966
--- /dev/null
+++ b/sys-devel/gcc/files/awk/fixlafiles.awk
@@ -0,0 +1,314 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk,v 1.15 2008/02/19 05:47:29 vapier Exp $
+
+#
+# Helper functions
+#
+function printn(string) {
+ printf("%s", string)
+}
+function einfo(string) {
+ printf(" \033[32;01m*\033[0m %s\n", string)
+}
+function einfon(string) {
+ printf(" \033[32;01m*\033[0m %s", string)
+}
+function ewarn(string) {
+ printf(" \033[33;01m*\033[0m %s\n", string)
+}
+function ewarnn(string) {
+ printf(" \033[33;01m*\033[0m %s", string)
+}
+function eerror(string) {
+ printf(" \033[31;01m*\033[0m %s\n", string)
+}
+
+#
+# assert(condition, errmsg)
+# assert that a condition is true. Otherwise exit.
+#
+function assert(condition, string) {
+ if (! condition) {
+ printf("%s:%d: assertion failed: %s\n",
+ FILENAME, FNR, string) > "/dev/stderr"
+ _assert_exit = 1
+ exit 1
+ }
+}
+
+#
+# system(command, return)
+# wrapper that normalizes return codes ...
+#
+function dosystem(command, ret) {
+ ret = 0
+ ret = system(command)
+ if (ret == 0)
+ return 1
+ else
+ return 0
+}
+
+BEGIN {
+ #
+ # Get our variables from environment
+ #
+ OLDVER = ENVIRON["OLDVER"]
+ OLDCHOST = ENVIRON["OLDCHOST"]
+
+ if (OLDVER == "") {
+ eerror("Could not get OLDVER!");
+ exit 1
+ }
+
+ # Setup some sane defaults
+ LIBCOUNT = 2
+ HAVE_GCC34 = 0
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ #
+ # Walk /etc/ld.so.conf to discover all our library paths
+ #
+ pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
+ while(((pipe) | getline ldsoconf_data) > 0) {
+ if (ldsoconf_data !~ /^[[:space:]]*#/) {
+ if (ldsoconf_data == "") continue
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+
+ # If there's more than one path per line, split
+ # it up as if they were sep lines
+ split(ldsoconf_data, nodes, /[:,[:space:]]/)
+
+ # Now add the rest from ld.so.conf
+ for (x in nodes) {
+ # wtf does this line do ?
+ sub(/=.*/, "", nodes[x])
+ # Prune trailing /
+ sub(/\/$/, "", nodes[x])
+
+ if (nodes[x] == "") continue
+
+ #
+ # Drop the directory if its a child directory of
+ # one that was already added ...
+ # For example, if we have:
+ # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
+ # We really just want to save /usr/lib /usr/libexec
+ #
+ CHILD = 0
+ for (y in DIRLIST) {
+ if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
+ CHILD = 1
+ break
+ }
+ }
+ if (CHILD) continue
+
+ DIRLIST[++LIBCOUNT] = nodes[x]
+ }
+ }
+ }
+ close(pipe)
+
+ #
+ # Get line from gcc's output containing CHOST
+ #
+ pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
+ if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
+ close(pipe)
+
+ # If we fail to get the CHOST, see if we can get the CHOST
+ # portage thinks we are using ...
+ pipe = "/usr/bin/portageq envvar 'CHOST'"
+ assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
+ } else {
+ # Check pre gcc-3.4.x versions
+ CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
+
+ if (CHOST == TMP_CHOST || CHOST == "") {
+ # Check gcc-3.4.x or later
+ CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
+
+ if (CHOST == TMP_CHOST || CHOST == "")
+ CHOST = ""
+ else
+ HAVE_GCC34 = 1
+ }
+ }
+ close(pipe)
+
+ if (CHOST == "") {
+ eerror("Could not get gcc's CHOST!")
+ exit 1
+ }
+
+ if (OLDCHOST != "")
+ if (OLDCHOST == CHOST)
+ OLDCHOST = ""
+
+ GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
+ GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
+
+ if (HAVE_GCC34)
+ GCCLIBPREFIX = GCCLIBPREFIX_NEW
+ else
+ GCCLIBPREFIX = GCCLIBPREFIX_OLD
+
+ GCCLIB = GCCLIBPREFIX CHOST
+
+ if (OLDCHOST != "") {
+ OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
+ OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
+ }
+
+ # Get current gcc's version
+ pipe = "gcc -dumpversion"
+ assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
+ close(pipe)
+
+ if (NEWVER == "") {
+ eerror("Could not get gcc's version!")
+ exit 1
+ }
+
+ # Nothing to do ?
+ if ((OLDVER == NEWVER) && (OLDCHOST == ""))
+ exit 0
+
+ #
+ # Ok, now let's scan for the .la files and actually fix them up
+ #
+ for (x = 1; x <= LIBCOUNT; x++) {
+ # Do nothing if the target dir is gcc's internal library path
+ if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
+ DIRLIST[x] ~ GCCLIBPREFIX_NEW)
+ continue
+
+ einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
+
+ pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
+ while (((pipe) | getline la_files) > 0) {
+
+ # Do nothing if the .la file is located in gcc's internal lib path
+ if (la_files ~ GCCLIBPREFIX_OLD ||
+ la_files ~ GCCLIBPREFIX_NEW)
+ continue
+
+ CHANGED = 0
+ CHOST_CHANGED = 0
+
+ # See if we need to fix the .la file
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
+ GCCLIB, la_data) > 0) ||
+ (gsub(OLDGCCLIB2 "[/[:space:]]+",
+ GCCLIB, la_data) > 0)) {
+ CHANGED = 1
+ CHOST_CHANGED = 1
+ }
+ }
+ if (OLDVER != NEWVER) {
+ if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0) ||
+ (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0))
+ CHANGED = 1
+ }
+ }
+ close(la_files)
+
+ # Do the actual changes in a second loop, as we can then
+ # verify that CHOST_CHANGED among things is correct ...
+ if (CHANGED) {
+ ewarnn(" FIXING: " la_files " ...")
+
+ if (CHANGED)
+ printn("[")
+
+ # Clear the temp file (removing rather than '>foo' is better
+ # out of a security point of view?)
+ dosystem("rm -f " la_files ".new")
+
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", la_data)
+ tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ printn("c")
+ la_data = tmpstr
+ }
+
+ if (CHOST_CHANGED > 0) {
+ # We try to be careful about CHOST changes outside
+ # the gcc library path (meaning we cannot match it
+ # via /GCCLIBPREFIX CHOST/) ...
+
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/CHOST/{bin,lib}'
+ #
+ gsub("-L/usr/" OLDCHOST "/",
+ "-L/usr/" CHOST "/", la_data)
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
+ #
+ la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
+ "\\1/" CHOST "/", "g", la_data)
+ }
+ }
+
+ if (OLDVER != NEWVER) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
+ #
+ tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", la_data)
+ tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
+ #
+ # in cases where we have gcc34
+ tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ printn("v")
+ la_data = tmpstr
+ }
+ }
+
+ print la_data >> (la_files ".new")
+ }
+
+ if (CHANGED)
+ print "]"
+
+ close(la_files)
+ close(la_files ".new")
+
+ assert(dosystem("mv -f " la_files ".new " la_files),
+ "dosystem(\"mv -f " la_files ".new " la_files "\")")
+ }
+ }
+
+ close(pipe)
+ }
+}
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
new file mode 100644
index 00000000..346bd16f
--- /dev/null
+++ b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
@@ -0,0 +1,335 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.4 2010/03/19 23:53:07 vapier Exp $
+
+#
+# Helper functions
+#
+function printn(string) {
+ printf("%s", string)
+}
+function einfo(string) {
+ printf(" \033[32;01m*\033[0m %s\n", string)
+}
+function einfon(string) {
+ printf(" \033[32;01m*\033[0m %s", string)
+}
+function ewarn(string) {
+ printf(" \033[33;01m*\033[0m %s\n", string)
+}
+function ewarnn(string) {
+ printf(" \033[33;01m*\033[0m %s", string)
+}
+function eerror(string) {
+ printf(" \033[31;01m*\033[0m %s\n", string)
+}
+
+#
+# assert(condition, errmsg)
+# assert that a condition is true. Otherwise exit.
+#
+function assert(condition, string) {
+ if (! condition) {
+ printf("%s:%d: assertion failed: %s\n",
+ FILENAME, FNR, string) > "/dev/stderr"
+ _assert_exit = 1
+ exit 1
+ }
+}
+
+#
+# system(command, return)
+# wrapper that normalizes return codes ...
+#
+function dosystem(command, ret) {
+ ret = 0
+ ret = system(command)
+ if (ret == 0)
+ return 1
+ else
+ return 0
+}
+
+#
+# parse_ld_conf(config_file)
+#
+function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) {
+ pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
+ while(((pipe) | getline ldsoconf_data) > 0) {
+ if (ldsoconf_data ~ /^[[:space:]]*#/)
+ continue
+ if (ldsoconf_data == "")
+ continue
+
+ # Handle the "include" keyword
+ if (ldsoconf_data ~ /^include /) {
+ sub(/^include /, "", ldsoconf_data)
+ parse_ld_conf(ldsoconf_data)
+ continue
+ }
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+ # Eat duplicate slashes
+ sub(/\/\//, "/", ldsoconf_data)
+ # Prune trailing /
+ sub(/\/$/, "", ldsoconf_data)
+
+ #
+ # Drop the directory if its a child directory of
+ # one that was already added ...
+ # For example, if we have:
+ # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
+ # We really just want to save /usr/lib /usr/libexec
+ #
+ CHILD = 0
+ for (y in DIRLIST) {
+ if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
+ CHILD = 1
+ break
+ }
+ }
+ if (CHILD) continue
+
+ DIRLIST[++LIBCOUNT] = ldsoconf_data
+ }
+ close(pipe)
+}
+
+BEGIN {
+ #
+ # Get our variables from environment
+ #
+ OLDVER = ENVIRON["OLDVER"]
+ OLDCHOST = ENVIRON["OLDCHOST"]
+
+ if (OLDVER == "") {
+ eerror("Could not get OLDVER!");
+ exit 1
+ }
+
+ # Setup some sane defaults
+ LIBCOUNT = 2
+ HAVE_GCC34 = 0
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ #
+ # Walk /etc/ld.so.conf to discover all our library paths
+ #
+ parse_ld_conf("/etc/ld.so.conf")
+
+ #
+ # Get line from gcc's output containing CHOST
+ #
+ pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
+ if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
+ close(pipe)
+
+ # If we fail to get the CHOST, see if we can get the CHOST
+ # portage thinks we are using ...
+ pipe = "/usr/bin/portageq envvar 'CHOST'"
+ assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
+ } else {
+ # Check pre gcc-3.4.x versions
+ CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
+
+ if (CHOST == TMP_CHOST || CHOST == "") {
+ # Check gcc-3.4.x or later
+ CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
+
+ if (CHOST == TMP_CHOST || CHOST == "")
+ CHOST = ""
+ else
+ HAVE_GCC34 = 1
+ }
+ }
+ close(pipe)
+
+ if (CHOST == "") {
+ eerror("Could not get gcc's CHOST!")
+ exit 1
+ }
+
+ if (OLDCHOST != "")
+ if (OLDCHOST == CHOST)
+ OLDCHOST = ""
+
+ GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
+ GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
+
+ if (HAVE_GCC34)
+ GCCLIBPREFIX = GCCLIBPREFIX_NEW
+ else
+ GCCLIBPREFIX = GCCLIBPREFIX_OLD
+
+ GCCLIB = GCCLIBPREFIX CHOST
+
+ if (OLDCHOST != "") {
+ OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
+ OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
+ }
+
+ # Get current gcc's version
+ pipe = "gcc -dumpversion"
+ assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
+ close(pipe)
+
+ if (NEWVER == "") {
+ eerror("Could not get gcc's version!")
+ exit 1
+ }
+
+ # Nothing to do ?
+ # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to
+ # replace libstdc++.la ....
+ if ((OLDVER == "") && (OLDCHOST == ""))
+ exit 0
+
+ #
+ # Ok, now let's scan for the .la files and actually fix them up
+ #
+ for (x = 1; x <= LIBCOUNT; x++) {
+ # Do nothing if the target dir is gcc's internal library path
+ if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
+ DIRLIST[x] ~ GCCLIBPREFIX_NEW)
+ continue
+
+ einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
+
+ pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
+ while (((pipe) | getline la_files) > 0) {
+
+ # Do nothing if the .la file is located in gcc's internal lib path
+ if (la_files ~ GCCLIBPREFIX_OLD ||
+ la_files ~ GCCLIBPREFIX_NEW)
+ continue
+
+ CHANGED = 0
+ CHOST_CHANGED = 0
+
+ # See if we need to fix the .la file
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
+ GCCLIB, la_data) > 0) ||
+ (gsub(OLDGCCLIB2 "[/[:space:]]+",
+ GCCLIB, la_data) > 0)) {
+ CHANGED = 1
+ CHOST_CHANGED = 1
+ }
+ }
+ if (OLDVER != NEWVER) {
+ if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0) ||
+ (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0))
+ CHANGED = 1
+ }
+ # We now check if we have libstdc++.la, as we remove the
+ # libtool linker scripts for gcc ...
+ # We do this last, as we only match the new paths
+ if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
+ "-lstdc++", la_data) > 0)
+ CHANGED = 1
+ }
+ close(la_files)
+
+ # Do the actual changes in a second loop, as we can then
+ # verify that CHOST_CHANGED among things is correct ...
+ if (CHANGED) {
+ ewarnn(" FIXING: " la_files " ...[")
+
+ # Clear the temp file (removing rather than '>foo' is better
+ # out of a security point of view?)
+ dosystem("rm -f " la_files ".new")
+
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", la_data)
+ tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ printn("c")
+ la_data = tmpstr
+ }
+
+ if (CHOST_CHANGED > 0) {
+ # We try to be careful about CHOST changes outside
+ # the gcc library path (meaning we cannot match it
+ # via /GCCLIBPREFIX CHOST/) ...
+
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/CHOST/{bin,lib}'
+ #
+ gsub("-L/usr/" OLDCHOST "/",
+ "-L/usr/" CHOST "/", la_data)
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
+ #
+ la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
+ "\\1/" CHOST "/", "g", la_data)
+ }
+ }
+
+ if (OLDVER != NEWVER) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
+ #
+ tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", la_data)
+ tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
+ #
+ # in cases where we have gcc34
+ tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ printn("v")
+ la_data = tmpstr
+ }
+ }
+
+ # We now check if we have libstdc++.la, as we remove the
+ # libtool linker scripts for gcc and any referencese in any
+ # libtool linker scripts.
+ # We do this last, as we only match the new paths
+ tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
+ "-lstdc++", "g", la_data);
+ if (la_data != tmpstr) {
+ printn("l")
+ la_data = tmpstr
+ }
+
+ print la_data >> (la_files ".new")
+ }
+
+ if (CHANGED)
+ print "]"
+
+ close(la_files)
+ close(la_files ".new")
+
+ assert(dosystem("mv -f " la_files ".new " la_files),
+ "dosystem(\"mv -f " la_files ".new " la_files "\")")
+ }
+ }
+
+ close(pipe)
+ }
+}
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/c89 b/sys-devel/gcc/files/c89
new file mode 100755
index 00000000..cee0325f
--- /dev/null
+++ b/sys-devel/gcc/files/c89
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Call the appropriate C compiler with options to accept ANSI/ISO C
+# The following options are the same (as of gcc-2.95):
+# -ansi
+# -std=c89
+# -std=iso9899:1990
+
+for i; do
+ case "$i" in
+ -ansi|-std=c89|-std=iso9899:1990)
+ ;;
+ -std=*)
+ echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i"
+ exit 1
+ ;;
+ esac
+done
+
+exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@"
diff --git a/sys-devel/gcc/files/c99 b/sys-devel/gcc/files/c99
new file mode 100755
index 00000000..c9542095
--- /dev/null
+++ b/sys-devel/gcc/files/c99
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+# Call the appropriate C compiler with options to accept ANSI/ISO C
+# The following options are the same (as of gcc-3.3):
+# -std=c99
+# -std=c9x
+# -std=iso9899:1999
+# -std=iso9899:199x
+
+for i; do
+ case "$i" in
+ -std=c9[9x]|-std=iso9899:199[9x])
+ ;;
+ -ansi|-std=*)
+ echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i"
+ exit 1
+ ;;
+ esac
+done
+
+exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"}
diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh
new file mode 100644
index 00000000..c55250b6
--- /dev/null
+++ b/sys-devel/gcc/files/fix_libtool_files.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 1.16 2012/05/18 21:28:56 vapier Exp $
+
+usage() {
+cat << "USAGE_END"
+Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>]
+
+ Where <old-gcc-version> is the version number of the
+ previous gcc version. For example, if you updated to
+ gcc-3.2.1, and you had gcc-3.2 installed, run:
+
+ # fix_libtool_files.sh 3.2
+
+ If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu
+ but you now have CHOST as i686-pc-linux-gnu, run:
+
+ # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu
+
+ Note that if only the CHOST and not the version changed, you can run
+ it with the current version and the '--oldarch <old-CHOST>' arguments,
+ and it will do the expected:
+
+ # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
+
+USAGE_END
+ exit 1
+}
+
+case $2 in
+--oldarch) [ $# -ne 3 ] && usage ;;
+*) [ $# -ne 1 ] && usage ;;
+esac
+
+ARGV1=$1
+ARGV2=$2
+ARGV3=$3
+
+. /etc/profile || exit 1
+. /etc/init.d/functions.sh || exit 1
+
+if [ ${EUID:-0} -ne 0 ] ; then
+ eerror "${0##*/}: Must be root."
+ exit 1
+fi
+
+# make sure the files come out sane
+umask 0022
+
+OLDCHOST=
+[ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3}
+
+AWKDIR="/usr/share/gcc-data"
+
+if [ ! -r "${AWKDIR}/fixlafiles.awk" ] ; then
+ eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
+ exit 1
+fi
+
+OLDVER=${ARGV1}
+
+export OLDVER OLDCHOST
+
+einfo "Scanning libtool files for hardcoded gcc library paths..."
+exec gawk -f "${AWKDIR}/fixlafiles.awk"
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
new file mode 100644
index 00000000..d4540534
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.3-musl-linker-path.patch
@@ -0,0 +1,61 @@
+diff -Naur gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h gcc-4.7.3/gcc/config/arm/linux-eabi.h
+--- gcc-4.7.3.orig/gcc/config/arm/linux-eabi.h 2014-04-06 14:15:03.000000000 +0000
++++ gcc-4.7.3/gcc/config/arm/linux-eabi.h 2014-04-06 12:12:42.000000000 +0000
+@@ -69,8 +69,8 @@
+ GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
+
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-musl-arm.so.1"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-musl-armhf.so.1"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+
+ #define GLIBC_DYNAMIC_LINKER \
+diff -Naur gcc-4.7.3.orig/gcc/config/i386/linux64.h gcc-4.7.3/gcc/config/i386/linux64.h
+--- gcc-4.7.3.orig/gcc/config/i386/linux64.h 2014-04-06 14:15:03.000000000 +0000
++++ gcc-4.7.3/gcc/config/i386/linux64.h 2014-04-06 12:12:42.000000000 +0000
+@@ -28,6 +28,6 @@
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+diff -Naur gcc-4.7.3.orig/gcc/config/mips/linux.h gcc-4.7.3/gcc/config/mips/linux.h
+--- gcc-4.7.3.orig/gcc/config/mips/linux.h 2011-07-19 18:00:27.000000000 +0000
++++ gcc-4.7.3/gcc/config/mips/linux.h 2014-04-06 14:12:48.000000000 +0000
+@@ -18,4 +18,4 @@
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-mipsel.so.1"
+diff -Naur gcc-4.7.3.orig/gcc/config/rs6000/linux64.h gcc-4.7.3/gcc/config/rs6000/linux64.h
+--- gcc-4.7.3/gcc/config/rs6000/linux64.h 2014-10-11 18:59:07.479279989 -0200
++++ gcc-4.7.3/gcc/config/rs6000/linux64.h 2014-10-11 18:59:45.777801191 -0200
+@@ -358,8 +358,8 @@
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+diff -Naur gcc-4.7.3/gcc/config/rs6000/sysv4.h gcc-4.7.3/gcc/config/rs6000/sysv4.h
+--- gcc-4.7.3/gcc/config/rs6000/sysv4.h 2014-10-11 19:00:03.079584889 -0200
++++ gcc-4.7.3/gcc/config/rs6000/sysv4.h 2014-10-11 19:00:28.476267387 -0200
+@@ -802,7 +802,7 @@
+
+ #define LINK_START_LINUX_SPEC ""
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
diff --git a/sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch b/sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch
new file mode 100644
index 00000000..91c1b347
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.3-powerpc-libc-stack-end.patch
@@ -0,0 +1,171 @@
+From: amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 15 Feb 2013 13:53:40 +0000 (+0000)
+Subject: PR target/55431
+X-Git-Tag: gcc-4_8_0-release~416
+X-Git-Url: http://repo.or.cz/w/official-gcc.git/commitdiff_plain/2a0bfd56d1b6a8ece8fb852691ea32713c7891b3
+
+ PR target/55431
+ * config/rs6000/linux-unwind.h (ppc_linux_aux_vector): Delete.
+ (ppc_fallback_frame_state): Always set up save locations for fp
+ and altivec. Don't bother with non-callee-saved regs, r0-r13
+ except for r2 on ppc64, fr0-fr13, v0-v19, vscr.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196077 138bc75d-0d04-0410-961f-82ee72b054a4
+diff --git a/libgcc/config/rs6000/linux-unwind.h b/libgcc/config/rs6000/linux-unwind.h
+index 3a2da6e..c9273c4 100644
+--- a/libgcc/config/rs6000/linux-unwind.h
++++ b/libgcc/config/rs6000/linux-unwind.h
+@@ -26,7 +26,6 @@
+ #define R_CR2 70
+ #define R_VR0 77
+ #define R_VRSAVE 109
+-#define R_VSCR 110
+
+ struct gcc_vregs
+ {
+@@ -175,38 +174,6 @@ get_regs (struct _Unwind_Context *context)
+ }
+ #endif
+
+-/* Find an entry in the process auxiliary vector. The canonical way to
+- test for VMX is to look at AT_HWCAP. */
+-
+-static long
+-ppc_linux_aux_vector (long which)
+-{
+- /* __libc_stack_end holds the original stack passed to a process. */
+- extern long *__libc_stack_end;
+- long argc;
+- char **argv;
+- char **envp;
+- struct auxv
+- {
+- long a_type;
+- long a_val;
+- } *auxp;
+-
+- /* The Linux kernel puts argc first on the stack. */
+- argc = __libc_stack_end[0];
+- /* Followed by argv, NULL terminated. */
+- argv = (char **) __libc_stack_end + 1;
+- /* Followed by environment string pointers, NULL terminated. */
+- envp = argv + argc + 1;
+- while (*envp++)
+- continue;
+- /* Followed by the aux vector, zero terminated. */
+- for (auxp = (struct auxv *) envp; auxp->a_type != 0; ++auxp)
+- if (auxp->a_type == which)
+- return auxp->a_val;
+- return 0;
+-}
+-
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
+@@ -216,8 +183,8 @@ static _Unwind_Reason_Code
+ ppc_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+ {
+- static long hwcap = 0;
+ struct gcc_regs *regs = get_regs (context);
++ struct gcc_vregs *vregs;
+ long new_cfa;
+ int i;
+
+@@ -229,12 +196,15 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
+ fs->regs.cfa_reg = STACK_POINTER_REGNUM;
+ fs->regs.cfa_offset = new_cfa - (long) context->cfa;
+
+- for (i = 0; i < 32; i++)
+- if (i != STACK_POINTER_REGNUM)
+- {
+- fs->regs.reg[i].how = REG_SAVED_OFFSET;
+- fs->regs.reg[i].loc.offset = (long) &regs->gpr[i] - new_cfa;
+- }
++#ifdef __powerpc64__
++ fs->regs.reg[2].how = REG_SAVED_OFFSET;
++ fs->regs.reg[2].loc.offset = (long) &regs->gpr[2] - new_cfa;
++#endif
++ for (i = 14; i < 32; i++)
++ {
++ fs->regs.reg[i].how = REG_SAVED_OFFSET;
++ fs->regs.reg[i].loc.offset = (long) &regs->gpr[i] - new_cfa;
++ }
+
+ fs->regs.reg[R_CR2].how = REG_SAVED_OFFSET;
+ /* CR? regs are always 32-bit and PPC is big-endian, so in 64-bit
+@@ -250,57 +220,35 @@ ppc_fallback_frame_state (struct _Unwind_Context *context,
+ fs->retaddr_column = ARG_POINTER_REGNUM;
+ fs->signal_frame = 1;
+
+- if (hwcap == 0)
++ /* If we have a FPU... */
++ for (i = 14; i < 32; i++)
+ {
+- hwcap = ppc_linux_aux_vector (16);
+- /* These will already be set if we found AT_HWCAP. A nonzero
+- value stops us looking again if for some reason we couldn't
+- find AT_HWCAP. */
+-#ifdef __powerpc64__
+- hwcap |= 0xc0000000;
+-#else
+- hwcap |= 0x80000000;
+-#endif
++ fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
++ fs->regs.reg[i + 32].loc.offset = (long) &regs->fpr[i] - new_cfa;
+ }
+
+- /* If we have a FPU... */
+- if (hwcap & 0x08000000)
+- for (i = 0; i < 32; i++)
+- {
+- fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
+- fs->regs.reg[i + 32].loc.offset = (long) &regs->fpr[i] - new_cfa;
+- }
+-
+ /* If we have a VMX unit... */
+- if (hwcap & 0x10000000)
+- {
+- struct gcc_vregs *vregs;
+ #ifdef __powerpc64__
+- vregs = regs->vp;
++ vregs = regs->vp;
+ #else
+- vregs = &regs->vregs;
++ vregs = &regs->vregs;
+ #endif
+- if (regs->msr & (1 << 25))
++ if (regs->msr & (1 << 25))
++ {
++ for (i = 20; i < 32; i++)
+ {
+- for (i = 0; i < 32; i++)
+- {
+- fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET;
+- fs->regs.reg[i + R_VR0].loc.offset
+- = (long) &vregs->vr[i] - new_cfa;
+- }
+-
+- fs->regs.reg[R_VSCR].how = REG_SAVED_OFFSET;
+- fs->regs.reg[R_VSCR].loc.offset = (long) &vregs->vscr - new_cfa;
++ fs->regs.reg[i + R_VR0].how = REG_SAVED_OFFSET;
++ fs->regs.reg[i + R_VR0].loc.offset = (long) &vregs->vr[i] - new_cfa;
+ }
+-
+- fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET;
+- fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa;
+ }
+
++ fs->regs.reg[R_VRSAVE].how = REG_SAVED_OFFSET;
++ fs->regs.reg[R_VRSAVE].loc.offset = (long) &vregs->vsave - new_cfa;
++
+ /* If we have SPE register high-parts... we check at compile-time to
+ avoid expanding the code for all other PowerPC. */
+ #ifdef __SPE__
+- for (i = 0; i < 32; i++)
++ for (i = 14; i < 32; i++)
+ {
+ fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + FIRST_PSEUDO_REGISTER - 1].loc.offset
diff --git a/sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch b/sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch
new file mode 100644
index 00000000..1cc395f2
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.7.4-secure-plt.patch
@@ -0,0 +1,51 @@
+adapted from musl-cross gcc-patches
+diff -ur a/gcc/config.gcc b/gcc/config.gcc
+--- a/gcc/config.gcc 2013-10-03 02:52:23.000000000 -0200
++++ b/gcc/config.gcc 2015-05-03 22:05:10.855150177 -0200
+@@ -2091,6 +2091,10 @@
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+diff -r 6097333f2ab4 gcc/config/rs6000/secureplt.h
+--- a/gcc/config/rs6000/secureplt.h Tue May 20 11:06:08 2014 -0400
++++ b/gcc/config/rs6000/secureplt.h Tue May 20 11:06:11 2014 -0400
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+--- a/gcc/config/rs6000/sysv4.h 2012-04-30 19:39:01.000000000 -0200
++++ b/gcc/config/rs6000/sysv4.h 2014-10-21 10:24:03.631956578 -0200
+@@ -537,6 +537,9 @@
+ } \
+ while (0)
+ #endif
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
+
+ #undef ASM_SPEC
+ #define ASM_SPEC "%(asm_cpu) \
+@@ -624,6 +627,7 @@
+ /* Override the default target of the linker. */
+ #define LINK_TARGET_SPEC "\
+ %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
++%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}} \
+ %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
+ %{mcall-i960-old: --oformat elf32-powerpcle} \
+ }}}}"
+@@ -938,6 +942,7 @@
+ { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \
+ { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch
new file mode 100644
index 00000000..65bc45e7
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-fix-libc5-assumption.patch
@@ -0,0 +1,11 @@
+--- /var/tmp/portage/sys-devel/gcc-4.8.3-r99/work/gcc-4.8.3/boehm-gc/os_dep.c 2013-03-06 15:08:58.000000000 +0000
++++ gcc-4.8.3.new/boehm-gc/os_dep.c 2014-10-24 18:25:39.963379871 +0000
+@@ -41,7 +41,7 @@
+ # else /* not 2 <= __GLIBC__ */
+ /* libc5 doesn't have <sigcontext.h>: go directly with the kernel */
+ /* one. Check LINUX_VERSION_CODE to see which we should reference. */
+-# include <asm/sigcontext.h>
++//# include <asm/sigcontext.h>
+ # endif /* 2 <= __GLIBC__ */
+ # endif
+ # endif
diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch
new file mode 100644
index 00000000..a22fb80c
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-linker-path.patch
@@ -0,0 +1,70 @@
+diff -ur a/gcc-4.8.3/gcc/config/arm/linux-eabi.h b/gcc-4.8.3/gcc/config/arm/linux-eabi.h
+--- a/gcc-4.8.3/gcc/config/arm/linux-eabi.h 2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/arm/linux-eabi.h 2014-11-26 21:09:34.162787397 -0100
+@@ -68,8 +68,8 @@
+ GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
+
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-musl-arm.so.1"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-musl-armhf.so.1"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+
+ #define GLIBC_DYNAMIC_LINKER \
+diff -ur a/gcc-4.8.3/gcc/config/i386/linux64.h b/gcc-4.8.3/gcc/config/i386/linux64.h
+--- a/gcc-4.8.3/gcc/config/i386/linux64.h 2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/i386/linux64.h 2014-11-26 21:09:34.162787397 -0100
+@@ -27,6 +27,6 @@
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+diff -ur a/gcc-4.8.3/gcc/config/mips/linux.h b/gcc-4.8.3/gcc/config/mips/linux.h
+--- a/gcc-4.8.3/gcc/config/mips/linux.h 2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/mips/linux.h 2014-11-26 21:11:28.772354580 -0100
+@@ -17,4 +17,9 @@
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
++#define GLIBC_DYNAMIC_LINKER_E "%{EB:;:el}"
++#else
++#define GLIBC_DYNAMIC_LINKER_E "%{EL:el}"
++#endif
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-mips" GLIBC_DYNAMIC_LINKER_E ".so.1"
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/linux64.h b/gcc-4.8.3/gcc/config/rs6000/linux64.h
+--- a/gcc-4.8.3/gcc/config/rs6000/linux64.h 2014-04-04 16:10:24.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/linux64.h 2014-11-26 21:09:34.164787372 -0100
+@@ -366,12 +366,8 @@
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
+-#else
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
+-#endif
++#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/sysv4.h b/gcc-4.8.3/gcc/config/rs6000/sysv4.h
+--- a/gcc-4.8.3/gcc/config/rs6000/sysv4.h 2014-04-04 15:50:31.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/sysv4.h 2014-11-26 21:09:34.164787372 -0100
+@@ -761,7 +761,7 @@
+
+ #define LINK_START_LINUX_SPEC ""
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
diff --git a/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch b/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch
new file mode 100644
index 00000000..7757c38c
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-musl-res_state.patch
@@ -0,0 +1,12 @@
+diff -ENwbur gcc-4.8.3.orig/libsanitizer/tsan/tsan_platform_linux.cc gcc-4.8.3/libsanitizer/tsan/tsan_platform_linux.cc
+--- gcc-4.8.3.orig/libsanitizer/tsan/tsan_platform_linux.cc 2014-08-31 12:50:18.381689906 +0000
++++ gcc-4.8.3/libsanitizer/tsan/tsan_platform_linux.cc 2014-08-31 13:12:19.838446253 +0000
+@@ -292,7 +292,7 @@
+ #ifndef TSAN_GO
+ int ExtractResolvFDs(void *state, int *fds, int nfd) {
+ int cnt = 0;
+- __res_state *statp = (__res_state*)state;
++ res_state statp = (res_state)state;
+ for (int i = 0; i < MAXNS && cnt < nfd; i++) {
+ if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
+ fds[cnt++] = statp->_u._ext.nssocks[i];
diff --git a/sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch b/sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch
new file mode 100644
index 00000000..fc367aef
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-4.8.3-secure-plt.patch
@@ -0,0 +1,43 @@
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/secureplt.h b/gcc-4.8.3/gcc/config/rs6000/secureplt.h
+--- a/gcc-4.8.3/gcc/config/rs6000/secureplt.h 2013-01-10 21:38:27.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/secureplt.h 2014-11-03 20:41:01.696584962 -0100
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+diff -ur a/gcc-4.8.3/gcc/config/rs6000/sysv4.h b/gcc-4.8.3/gcc/config/rs6000/sysv4.h
+--- a/gcc-4.8.3/gcc/config/rs6000/sysv4.h 2014-04-04 15:50:31.000000000 -0100
++++ b/gcc-4.8.3/gcc/config/rs6000/sysv4.h 2014-11-03 20:42:30.098479787 -0100
+@@ -585,7 +585,8 @@
+
+ /* Override the default target of the linker. */
+ #define LINK_TARGET_SPEC \
+- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
++ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
++ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+
+ /* Any specific OS flags. */
+ #define LINK_OS_SPEC "\
+@@ -894,6 +895,7 @@
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
+diff -ur a/gcc-4.8.3/gcc/config.gcc b/gcc-4.8.3/gcc/config.gcc
+--- a/gcc-4.8.3/gcc/config.gcc 2014-05-06 16:29:04.000000000 -0100
++++ b/gcc-4.8.3/gcc/config.gcc 2014-11-03 20:40:13.135192063 -0100
+@@ -2135,6 +2135,10 @@
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
new file mode 100644
index 00000000..d1b1b035
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-LANG.patch
@@ -0,0 +1,64 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
+option parsing, it may break.
+
+http://bugs.gentoo.org/103483
+
+--- configure
++++ configure
+@@ -54,6 +54,19 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
+@@ -452,16 +463,6 @@
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+-
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+ rm -rf conftest* confdefs.h
+ # AIX cpp loses on an empty file, so make sure it contains at least a newline.
+@@ -1850,6 +1850,19 @@
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
++ eval \$as_var=C; export \$as_var
++ else
++ unset \$as_var
++ fi
++done
++
+ ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ for ac_option
+ do
diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
new file mode 100644
index 00000000..ddc098dd
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch
@@ -0,0 +1,16 @@
+Chances are quite good that the installed makeinfo is sufficient.
+So ignore false positives where the makeinfo installed is so new
+that it violates the cheesy version grep.
+
+http://bugs.gentoo.org/198182
+
+--- configure
++++ configure
+@@ -3573,6 +3573,6 @@
+ :
+ else
+- MAKEINFO="$MISSING makeinfo"
++ :
+ fi
+ ;;
+
diff --git a/sys-devel/gcc/files/gcc-spec-env-r1.patch b/sys-devel/gcc/files/gcc-spec-env-r1.patch
new file mode 100644
index 00000000..a5892683
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env-r1.patch
@@ -0,0 +1,87 @@
+2013-08-22 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
+ and move the process of the user specifed specs.
+
+ This allows us to easily control pie/ssp defaults with gcc-config profiles.
+ Original patch by Rob Holland
+ Extended to support multiple entries separated by ':' by Kevin F. Quinn
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+ Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
+
+--- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100
++++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200
+@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
+ do_option_spec (option_default_specs[i].name,
+ option_default_specs[i].spec);
+
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ specs_file = getenv ("GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
++ /* Process any user specified specs in the order given on the command
++ * line. */
++ for (uptr = user_specs_head; uptr; uptr = uptr->next)
++ {
++ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
++ R_OK, true);
++ read_specs (filename ? filename : uptr->filename, false, true);
++ }
++ /* Process any user self specs. */
++ {
++ struct spec_list *sl;
++ for (sl = specs; sl; sl = sl->next)
++ if (sl->name_len == sizeof "self_spec" - 1
++ && !strcmp (sl->name, "self_spec"))
++ do_self_spec (*sl->ptr_spec);
++ }
++
+ /* Process DRIVER_SELF_SPECS, adding any new options to the end
+ of the command line. */
+
+@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
+ PREFIX_PRIORITY_LAST, 0, 1);
+ }
+
+- /* Process any user specified specs in the order given on the command
+- line. */
+- for (uptr = user_specs_head; uptr; uptr = uptr->next)
+- {
+- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+- R_OK, true);
+- read_specs (filename ? filename : uptr->filename, false, true);
+- }
+-
+- /* Process any user self specs. */
+- {
+- struct spec_list *sl;
+- for (sl = specs; sl; sl = sl->next)
+- if (sl->name_len == sizeof "self_spec" - 1
+- && !strcmp (sl->name, "self_spec"))
+- do_self_spec (*sl->ptr_spec);
+- }
+-
+ if (compare_debug)
+ {
+ enum save_temps save;
diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
new file mode 100644
index 00000000..57e7567e
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env.patch
@@ -0,0 +1,42 @@
+ Add support for external spec file via the GCC_SPECS env var. This
+ allows us to easily control pie/ssp defaults with gcc-config profiles.
+
+ Original patch by Rob Holland
+ Extended to support multiple entries separated by ':' by Kevin F. Quinn
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+
+--- gcc-4/gcc/gcc.c
++++ gcc-4/gcc/gcc.c
+@@ -6482,6 +6482,32 @@
+
+ /* Process any user specified specs in the order given on the command
+ line. */
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ specs_file = getenv ("GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
diff --git a/sys-devel/gcc/files/mkinfodir b/sys-devel/gcc/files/mkinfodir
new file mode 100644
index 00000000..a62840ee
--- /dev/null
+++ b/sys-devel/gcc/files/mkinfodir
@@ -0,0 +1,233 @@
+#!/bin/bash
+# $Id: mkinfodir,v 1.1 2001/09/01 07:56:19 drobbins Exp $
+# Generate the top-level Info node, given a directory of Info files
+# and (optionally) a skeleton file. The output will be suitable for a
+# top-level dir file. The skeleton file contains info topic names in the
+# order they should appear in the output. There are three special
+# lines that alter the behavior: a line consisting of just "--" causes
+# the next line to be echoed verbatim to the output. A line
+# containing just "%%" causes all the remaining filenames (wildcards
+# allowed) in the rest of the file to be ignored. A line containing
+# just "!!" exits the script when reached (unless preceded by a line
+# containing just "--"). Once the script reaches the end of the
+# skeleton file, it goes through the remaining files in the directory
+# in order, putting their entries at the end. The script will use the
+# ENTRY information in each info file if it exists. Otherwise it will
+# make a minimal entry.
+
+# sent by Jeffrey Osier <jeffrey@cygnus.com>, who thinks it came from
+# zoo@winternet.com (david d `zoo' zuhn)
+
+# modified 7 April 1995 by Joe Harrington <jh@tecate.gsfc.nasa.gov> to
+# take special flags
+
+INFODIR=$1
+if [ $# = 2 ] ; then
+ SKELETON=$2
+else
+ SKELETON=/dev/null
+fi
+
+skip=
+
+if [ $# -gt 2 ] ; then
+ echo usage: $0 info-directory [ skeleton-file ] 1>&2
+ exit 1
+elif [ -z "${INFODIR}" ] ; then
+ INFODIR="%%DEFAULT_INFO_DIR%%"
+else
+ true
+fi
+
+if [ ! -d ${INFODIR} ] ; then
+ echo "$0: first argument must specify a directory"
+ exit 1
+fi
+
+### output the dir header
+echo "-*- Text -*-"
+echo "This file was generated automatically by $0."
+echo "This version was generated on `date`"
+echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`"
+
+cat << moobler
+\$Id: mkinfodir,v 1.1 2001/09/01 07:56:19 drobbins Exp $
+This is the file .../info/dir, which contains the topmost node of the
+Info hierarchy. The first time you invoke Info you start off
+looking at that node, which is (dir)Top.
+
+File: dir Node: Top This is the top of the INFO tree
+
+ This (the Directory node) gives a menu of major topics.
+ Typing "q" exits, "?" lists all Info commands, "d" returns here,
+ "h" gives a primer for first-timers,
+ "mEmacs<Return>" visits the Emacs topic, etc.
+
+ In Emacs, you can click mouse button 2 on a menu item or cross reference
+ to select it.
+
+* Menu: The list of major topics begins on the next line.
+
+moobler
+
+### go through the list of files in the skeleton. If an info file
+### exists, grab the ENTRY information from it. If an entry exists
+### use it, otherwise create a minimal dir entry.
+###
+### Then remove that file from the list of existing files. If any
+### additional files remain (ones that don't have a skeleton entry),
+### then generate entries for those in the same way, putting the info for
+### those at the end....
+
+infofiles=`(cd ${INFODIR}; /bin/ls | grep -v '\-[0-9]*\.gz$' | grep -v '\-[0-9]*$' | egrep -v '^dir$|^dir\.info$|^dir\.orig$')`
+
+# echoing gets clobbered by backquotes; we do it the hard way...
+lines=`wc $SKELETON | awk '{print $1}'`
+line=1
+while [ $lines -ge $line ] ; do
+ # Read one line from the file. This is so that we can echo lines with
+ # whitespace and quoted characters in them.
+ fileline=`awk NR==$line $SKELETON`
+
+ # flag fancy features
+ if [ ! -z "$echoline" ] ; then # echo line
+ echo "$fileline"
+ fileline=
+ echoline=
+ elif [ "${fileline}" = "--" ] ; then # should we echo the next line?
+ echoline=1
+ elif [ "${fileline}" = "%%" ] ; then # eliminate remaining files from dir?
+ skip=1
+ elif [ "${fileline}" = "!!" ] ; then # quit now
+ exit 0
+ fi
+
+ # handle files if they exist
+ for file in $fileline"" ; do # expand wildcards ("" handles blank lines)
+
+ fname=
+
+ if [ -z "$echoline" -a ! -z "$file" ] ; then
+
+ # Find the file to operate upon. Check both possible names.
+ infoname=`echo $file | sed 's/\.gz$//'`
+ infoname=`echo $infoname | sed 's/\.info$//'`
+ noext=
+ ext=
+ if [ -f ${INFODIR}/$infoname ] ; then
+ noext=$infoname
+ fi
+ if [ -f ${INFODIR}/${infoname}.info ] ; then
+ ext=${infoname}.info
+ fi
+ if [ -f ${INFODIR}/${infoname}.info.gz ] ; then
+ ext=${infoname}.info.gz
+ fi
+ # If it exists with both names take what was said in the file.
+ if [ ! -z "$ext" -a ! -z "$noext" ]; then
+ fname=$file
+ warn="### Warning: $ext and $noext both exist! Using ${file}. ###"
+ elif [ ! \( -z "$ext" -a -z "$noext" \) ]; then
+ # just take the name if it exists only once
+ fname=${noext}${ext}
+ fi
+
+ # if we found something and aren't skipping, do the entry
+ if [ ! -z "$fname" ] ; then
+ if [ -z "$skip" ] ; then
+
+ if [ ! -z "$warn" ] ; then # issue any warning
+ echo $warn
+ warn=
+ fi
+ if [ "${fname##*.}" = "gz" ] ; then
+ entry=`zcat ${INFODIR}/${fname} | sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' `
+ else
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$fname`
+ fi
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ else
+ echo "* ${infoname}: (${infoname})."
+ fi
+ fi
+
+ # remove the name from the directory listing
+ infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${fname} / /" -e "s/ / /g"`
+
+ fi
+
+ fi
+
+ done
+
+ line=`expr $line + 1`
+done
+
+if [ -z "${infofiles}" ] ; then
+ exit 0
+elif [ $lines -gt 0 ]; then
+ echo
+fi
+
+# Sort remaining files by INFO-DIR-SECTION.
+prevsect=
+filesectdata=`(cd ${INFODIR}; fgrep INFO-DIR-SECTION /dev/null ${infofiles} | \
+ fgrep -v 'INFO-DIR-SECTION Miscellaneous' | \
+ sort -t: -k2 -k1 | tr ' ' '_')`
+for sectdata in ${filesectdata}; do
+ file=`echo ${sectdata} | cut -d: -f1`
+ section=`sed -n -e 's/^INFO-DIR-SECTION //p' ${INFODIR}/${file}`
+ infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${file} / /" -e "s/ / /g"`
+
+ if [ "${prevsect}" != "${section}" ] ; then
+ if [ ! -z "${prevsect}" ] ; then
+ echo ""
+ fi
+ echo "${section}"
+ prevsect="${section}"
+ fi
+ infoname=`echo $file | sed 's/\.gz$//'`
+ infoname=`echo $infoname | sed 's/\.info$//'`
+ if [ "${file##*.}" = "gz" ] ; then
+ entry=`zcat ${INFODIR}/$file | sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' `
+ else
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$file`
+ fi
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ elif [ ! -d "${INFODIR}/${file}" ] ; then
+ echo "* ${infoname}: (${infoname})."
+ fi
+done
+
+# Process miscellaneous files.
+for file in ${infofiles}; do
+ if [ ! -z "${prevsect}" ] ; then
+ echo ""
+ echo "Miscellaneous"
+ prevsect=""
+ fi
+
+ infoname=`echo $file | sed 's/\.gz$//'`
+ infoname=`echo $infoname | sed 's/\.info$//'`
+ if [ "${file##*.}" = "gz" ] ; then
+ entry=`zcat ${INFODIR}/${file} | sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d'`
+ else
+ entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$file`
+ fi
+
+
+ if [ ! -z "${entry}" ] ; then
+ echo "${entry}"
+ elif [ ! -d "${INFODIR}/${file}" ] ; then
+ echo "* ${infoname}: (${infoname})."
+ fi
+done
+
diff --git a/sys-devel/gcc/gcc-4.7.4-r99.ebuild b/sys-devel/gcc/gcc-4.7.4-r99.ebuild
new file mode 100644
index 00000000..e2735a54
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.7.4-r99.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.7.3.ebuild,v 1.2 2013/05/20 10:56:06 aballier Exp $
+
+EAPI="2"
+
+PATCH_VER="1.1"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.5.5"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 ppc ppc64"
+SSP_STABLE="amd64 x86 ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 ppc ppc64 arm"
+PIE_MUSL_STABLE="amd64 arm ppc x86"
+SSP_MUSL_STABLE="amd64 arm ppc x86"
+#end Hardened stuff
+
+inherit eutils toolchain
+
+KEYWORDS="amd64 arm ~mips ppc x86"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.18"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+
+ if use elibc_musl; then
+ cd "${S}"
+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+ mv libstdc\+\+-v3/config/os/gnu-linux libstdc\+\+-v3/config/os/gnu-linux.org
+ cp -r libstdc\+\+-v3/config/os/generic libstdc\+\+-v3/config/os/gnu-linux
+ cp libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver libstdc++-v3/config/os/gnu-linux/
+ mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
+ cp -r libitm/config/generic libitm/config/linux/x86
+ epatch "${FILESDIR}"/${PN}-4.7.3-musl-linker-path.patch
+ epatch "${FILESDIR}"/${PN}-4.7.3-powerpc-libc-stack-end.patch
+ epatch "${FILESDIR}"/${PN}-4.7.4-secure-plt.patch
+ fi
+
+ use vanilla && return 0
+
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
+}
diff --git a/sys-devel/gcc/gcc-4.8.4-r99.ebuild b/sys-devel/gcc/gcc-4.8.4-r99.ebuild
new file mode 100644
index 00000000..33b9881b
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.8.4-r99.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-4.8.2.ebuild,v 1.9 2014/01/19 01:51:34 dirtyepic Exp $
+
+EAPI="4"
+
+PATCH_VER="1.4"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.1"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+PIE_MUSL_STABLE="amd64 arm ppc mips x86"
+SSP_MUSL_STABLE="amd64 arm ppc mips"
+#end Hardened stuff
+
+inherit eutils toolchain
+
+KEYWORDS="amd64 arm ~mips ~ppc x86"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+
+ if use elibc_musl; then
+ cd "${S}"
+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+ mv libstdc\+\+-v3/config/os/gnu-linux libstdc\+\+-v3/config/os/gnu-linux.org
+ cp -r libstdc\+\+-v3/config/os/generic libstdc\+\+-v3/config/os/gnu-linux
+ cp libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver libstdc++-v3/config/os/gnu-linux/
+ mv libitm/config/linux/x86 libitm/config/linux/x86_glibc
+ cp -r libitm/config/generic libitm/config/linux/x86
+ epatch "${FILESDIR}"/${PN}-4.8.3-musl-linker-path.patch
+ epatch "${FILESDIR}"/${PN}-4.8.3-secure-plt.patch
+ epatch "${FILESDIR}"/${PN}-4.8.3-musl-res_state.patch
+ epatch "${FILESDIR}"/${PN}-4.8.3-musl-fix-libc5-assumption.patch
+ fi
+
+ use vanilla && return 0
+ #Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch
+}
diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
new file mode 100644
index 00000000..0b0c8ffe
--- /dev/null
+++ b/sys-devel/gcc/metadata.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>toolchain</herd>
+ <use>
+ <flag name="awt">Useful only when building GCJ, this enables Abstract Window Toolkit
+ (AWT) peer support on top of GTK+</flag>
+ <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
+ in gcc (Warning: significantly increases compile time!)</flag>
+ <flag name="go">Build the GCC Go language frontend.</flag>
+ <flag name="graphite">Add support for the framework for loop
+ optimizations based on a polyhedral intermediate representation</flag>
+ <flag name="libssp">Build SSP support into a dedicated library rather than use the
+ code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
+ <flag name="mudflap">Add support for mudflap, a pointer use checking library</flag>
+ <flag name="multislot">Allow for SLOTs to include minor version (3.3.4
+ instead of just 3.3)</flag>
+ <flag name="nopie">Disable PIE support (NOT FOR GENERAL USE)</flag>
+ <flag name="nossp">Disable SSP support (NOT FOR GENERAL USE)</flag>
+ <flag name="objc">Build support for the Objective C code language</flag>
+ <flag name="objc++">Build support for the Objective C++ language</flag>
+ <flag name="objc-gc">Build support for the Objective C code language Garbage
+ Collector</flag>
+ <flag name="regression-test">Run the testsuite and install the results (requires FEATURES=test)</flag>
+ <flag name="sanitize">Build support various sanitizer functions (ASAN/TSAN/etc...)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/gdb/Manifest b/sys-devel/gdb/Manifest
new file mode 100644
index 00000000..43bcc44f
--- /dev/null
+++ b/sys-devel/gdb/Manifest
@@ -0,0 +1,7 @@
+AUX gdb-7.4-linux-nat.patch 778 SHA256 26d5bb6567c66300cf59380da18e790ee5a5d20b7be3c90e4cd0012e244ba306 SHA512 6aab4819bec533623b3b57e5fab43681693c350889c77749fa242b7d6131b6c026f029f5efca5d0b5ca162fa9c11cd00b18a402c05b44866de5e36bf8380f75e WHIRLPOOL ecb605f5e02d25416e8ab146bcade3aee0f6a5662557878176d9cb68d733c2e1433050e9a8389ce05cc79cdc0077b482fbed7d8a3e91c16994ecb3044b3f309f
+AUX gdb-7.5.1-amd64-linux-nat.patch 294 SHA256 3cd462098d40ed19073dbf9ca208e6f82bfa6ec0dedcca0d881cbcd6f1627f91 SHA512 86c0938f349fc122e275b9398690dabbae2253c018fa95b2b64584beb803bf343106dd39724a0783e6599af9496783ea0f12931dc4185c50103585a494fd3d94 WHIRLPOOL bb6f3c33b921b2c356c31e996906cda2a97303a726e7eb9b676f43f3b8fac19dcc7d9576a04ee8989ee4b365316c667fe0a1947bba65dc43236698357d338510
+AUX gdb-7.6-linux-low-threaddb.patch 1013 SHA256 bc5160a5d23565b8108c6324dea94af8b882121d01a322321fbed89196d55f6b SHA512 3f73326ff33e3bb12eb10c6912d514bd8e4baa6855b7262e8acccccc3ef1c6c070704106fc65fed6518818e5da0c087070f036e6403ffb812113b11559970520 WHIRLPOOL c6f590ebc638c31f740814d0bc9cac5ce03943d4c3a8f8786e2ccf60201361d079669173f8faa5d155fa530ffa59d02d086c4f66e7330837a2798ca4e8b18e68
+DIST gdb-7.7.1-patches-1.tar.xz 8600 SHA256 336cdcb2c90da0ca970dc21dc0285a8cb1fbcf81af63c49ee3f3d45c0aef7200 SHA512 427aba554e77ccfe9cdf5b0a833a1d64f1882e8f9e37d1288c5f2510cc63d154b4c22054a2a653d156e37044d7655937dee4a1a9cd0f9768abaafc8c34ae1cc0 WHIRLPOOL d5db4b874475724ac62bae9f1b33c566192570dd68195fe1c2065b7502a36b06f5a64079a88c63a965392d87e9b7a8eb0c709578297d6692fdce1ee933a867f4
+DIST gdb-7.7.1.tar.bz2 24849503 SHA256 0dbd5260406f1b0c70fcf027c6488527fadde0cd9bb574593491fe076eb03aa5 SHA512 887b9b726dae8f6e3e5e41574460a67e4f9002b0d47bc985dcf63bdf3518397a90b6a208cb5b19e5ed2341715ad75cfeed4df4fb423f39f74218e36bc87f1cab WHIRLPOOL 3b726d5f519167105248eb3a400be0d9bc70f72dbce9a04aa56a765b6c2ed9fc00a7c2e6ec72d0372f87bada1d74a40fc998c10a5322e2f3b5c8ea53c7ba6aa4
+EBUILD gdb-7.7.1-r99.ebuild 5967 SHA256 9d5b4c30ec58c13d57404f9f7b6c3d429ab0d21d94ed2957b31aa1eeccda791e SHA512 5e278577afd886cef054007437513aeb1a2311bd09ef4012df562eb6bd8a65e4db67ae0e7283c65ff1e4893e36247a7dfd381161b9733c98ab126e50773fbb92 WHIRLPOOL 8162a0ea2019510ad23dcd8b8138c99c3501d18917885be1962c947786d7eb064fea2eca4e23f6fa63840107605b7e8a9cd29362119bc0bcc66fadfdb72ebb0d
+MISC metadata.xml 552 SHA256 e86791dadf315a7a079e460854bcc4a28d7c69a93694efc85014b325824b81cf SHA512 bb4901b011b63137fb7e359ff657fbe8aa2bd7d36a78be397c163a0bd37486a32bddf4929ab5a2a3b7b7d52f3c2edd69ce18d4bb5e2f56b45d43bb59cb54f686 WHIRLPOOL 214e51279eed4230ed8cba15e42581213428ff06c32ad7832b17c1af6c2eae351a843aae51d78a99486b5bbfea2369faa4aaa4b99cae1ce7a41da5748d8e2211
diff --git a/sys-devel/gdb/files/gdb-7.4-linux-nat.patch b/sys-devel/gdb/files/gdb-7.4-linux-nat.patch
new file mode 100644
index 00000000..30bfbc8d
--- /dev/null
+++ b/sys-devel/gdb/files/gdb-7.4-linux-nat.patch
@@ -0,0 +1,32 @@
+taken from sabotage linux
+
+the first chunk fixes build errors,
+the non_stop part below fixes thread debugging being available
+by default without setting any breakpoints or usage of libthread_db.
+
+--- gdb-7.4.org/gdb/linux-nat.c 2013-08-10 05:24:24.651000003 +0000
++++ gdb-7.4/gdb/linux-nat.c 2013-08-10 05:25:50.966000003 +0000
+@@ -71,6 +71,14 @@
+ # endif
+ #endif /* HAVE_PERSONALITY */
+
++#ifndef __SIGRTMIN
++#define __SIGRTMIN SIGRTMIN
++#endif
++
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
+ /* This comment documents high-level logic of this file.
+
+ Waiting for events in sync mode
+@@ -2265,7 +2273,7 @@
+ status = 0;
+ }
+
+- if (non_stop)
++ if (1)
+ {
+ /* Add the new thread to GDB's lists as soon as possible
+ so that:
diff --git a/sys-devel/gdb/files/gdb-7.5.1-amd64-linux-nat.patch b/sys-devel/gdb/files/gdb-7.5.1-amd64-linux-nat.patch
new file mode 100644
index 00000000..13459ad9
--- /dev/null
+++ b/sys-devel/gdb/files/gdb-7.5.1-amd64-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb-7.5.1/gdb/amd64-linux-nat.c
++++ b/gdb-7.5.1/gdb/amd64-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "elf/common.h"
+ #include <sys/uio.h>
+ #include <sys/ptrace.h>
+-#include <sys/debugreg.h>
++#include <asm/debugreg.h>
+ #include <sys/syscall.h>
+ #include <sys/procfs.h>
+ #include <sys/user.h>
diff --git a/sys-devel/gdb/files/gdb-7.6-linux-low-threaddb.patch b/sys-devel/gdb/files/gdb-7.6-linux-low-threaddb.patch
new file mode 100644
index 00000000..4b0f1aac
--- /dev/null
+++ b/sys-devel/gdb/files/gdb-7.6-linux-low-threaddb.patch
@@ -0,0 +1,34 @@
+taken from sabotage linux
+
+this patch fixes compilation of gdbserver on systems that don't have
+thread_db.h. in that case we fall back to gdb's own copy
+"gdb_thread_db.h", so the typedef of the td_thrhandle_t member is
+available, which is accessed in other parts of the code without
+checking whether thread_db.h is available.
+this is by far the cleaner solution, removing the accesses to the
+th member in other parts of the source would either litter it with
+ifdefs or cripple the functionality.
+
+--- gdb-7.6.2.org/gdb/gdbserver/linux-low.h
++++ gdb-7.6.2/gdb/gdbserver/linux-low.h
+@@ -18,6 +18,8 @@
+
+ #ifdef HAVE_THREAD_DB_H
+ #include <thread_db.h>
++#else
++#include "gdb_thread_db.h"
+ #endif
+ #include <signal.h>
+
+@@ -270,11 +272,9 @@
+ int need_step_over;
+
+ int thread_known;
+-#ifdef HAVE_THREAD_DB_H
+ /* The thread handle, used for e.g. TLS access. Only valid if
+ THREAD_KNOWN is set. */
+ td_thrhandle_t th;
+-#endif
+
+ /* Arch-specific additions. */
+ struct arch_lwp_info *arch_private;
diff --git a/sys-devel/gdb/gdb-7.7.1-r99.ebuild b/sys-devel/gdb/gdb-7.7.1-r99.ebuild
new file mode 100644
index 00000000..b5887075
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.7.1-r99.ebuild
@@ -0,0 +1,213 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gdb/gdb-7.7.1.ebuild,v 1.10 2014/11/04 20:15:26 maekke Exp $
+
+EAPI="4"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
+ export CTARGET=${CATEGORY/cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+*.*.*.*.*.*)
+ # fedora version: gdb-6.8.50.20090302-8.fc11.src.rpm
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ MY_PV=$(gvcr 1-4)
+ RPM="${PN}-${MY_PV}-$(gvcr 5).fc$(gvcr 6).src.rpm"
+ SRC_URI="mirror://fedora/development/source/SRPMS/${RPM}"
+ ;;
+*.*.50.*)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.bz2"
+ ;;
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.bz2
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.bz2"
+ ;;
+esac
+
+PATCH_VER="1"
+DESCRIPTION="GNU debugger"
+HOMEPAGE="http://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ KEYWORDS="amd64 arm ~mips ppc x86"
+fi
+IUSE="+client expat lzma multitarget nls +python +server test vanilla zlib"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="!dev-util/gdbserver
+ >=sys-libs/ncurses-5.2-r2
+ sys-libs/readline
+ expat? ( dev-libs/expat )
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch ${FILESDIR}/${PN}-7.4-linux-nat.patch
+ epatch ${FILESDIR}/${PN}-7.5.1-amd64-linux-nat.patch
+
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ use vanilla || [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # make sure we have a python-config that matches our install,
+ # such that the python check doesn't fail just because the
+ # gdb-provided copy isn't quite what our python installed
+ # version is
+ rm -f "${S}"/gdb/python/python-config.py || die
+ pushd "${S}"/gdb/python > /dev/null || die
+ ln -s "${T}"/${EPYTHON}/bin/python-config python-config.py || die
+ popd > /dev/null || die
+ fi
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='http://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ $(use_with zlib)
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share
+ return 0
+ fi
+ # Install it by hand for now:
+ # http://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/metadata.xml b/sys-devel/gdb/metadata.xml
new file mode 100644
index 00000000..ab9c41a6
--- /dev/null
+++ b/sys-devel/gdb/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>toolchain</herd>
+<use>
+ <flag name='client'>Install the main "gdb" program (most people want this)</flag>
+ <flag name='multitarget'>Support all known targets in one gdb binary</flag>
+ <flag name='python'>Enable support for the new internal scripting language, as well as extended pretty printers</flag>
+ <flag name='server'>Install the "gdbserver" program (useful for embedded/remote targets)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
new file mode 100644
index 00000000..76b09bf8
--- /dev/null
+++ b/sys-devel/llvm/Manifest
@@ -0,0 +1,18 @@
+AUX clang-3.4-darwin_prefix-include-paths.patch 710 SHA256 f76311dfc5fa734a3a72fa516f695486595963824d5b6891fd1454d71c27fa0b SHA512 e130d7392b82ffc40ec96c0ee45d53cf032c761e00a7a2382af1f826e2a892b12069a7f5407307e1828fb741e522b8e10728d593d839e1b5648ccf9460feff0e WHIRLPOOL d2b24e224cb90be9615994d64af92b139325b2630cc43851370b8989d0eb7ee8f43ad421e3036041a30ec1fb30c1e3ddaf09d54f461484963a2bd8ea2fba24c6
+AUX clang-3.5-gentoo-install.patch 2166 SHA256 e359a219f2d0d2b88094bbb5ab91fd50d9662686f77e85b7ccfb8d1c4a6fd39d SHA512 07e5b3d4131a7d58577bcb99a82c585258c98a38e71b7e8dda058b467a558471e1ddeec5c9f5492f5d17e280cd4b09e49338e0926dd2534583bc8a2772bce26d WHIRLPOOL 5582b2015b4d3e845a45bfda08c156683df11685170f253f79ccf016f2e771b016d213417d83068f01a41bd8e0148474711cd6f9b7187e758322e9ebb9c390dd
+AUX clang-3.5-gentoo-runtime-gcc-detection-v3.patch 1694 SHA256 24691db819d08f87f0144a67900ae6797c0df4d180b55acc5c377d890ac2e72e SHA512 a34f694560ef0c7366ad0dc243a479afc74b6122d624b8681538da69c70d0d1869245a89c61d49add890c5f76134281470f5e75a59e6fc9ac963230fc56fe8e6 WHIRLPOOL 4f4af09e08c7d5af89558e77d0a2a4542f77ae505e9020ca6e48e20ef71c4db6016ed0211b2a303b756994f62949c91c216cc2f81b16ff65c71414d354977c8f
+AUX llvm-3.2-nodoctargz.patch 1761 SHA256 e17494aef638d2fe3fb0b669516ffcc9e560161903e1e165de0eecba684c8c1b SHA512 d12a8996d8a1160f7bad4ce3b3a9ddfb2d29d91fc160876c145f9241927b0cf4413f3b29bc2bf291f0421f61a512de8057e8f3d0029a8a09ba3f1d93582723b5 WHIRLPOOL be273271db8293829a63120cfc917711c99d8893cae6f95af2583def735131f629ee67b5a1515df007477f34abeaf5f2729d689eefdc61eb3aae6b1959971507
+AUX llvm-3.5-gcc-4.9.patch 1722 SHA256 c73f64311ff67534b581729b3ef0fecf452b86961c3b668ac2e6b50f1eff0bd2 SHA512 5ad0a742fca3eb9e08a183af9f90370baf85528bba6f3083d19592fe2a704950ca8c6bf9e930f9834255de3fc5832c49a06c9ca29a66e45928d9047abd9ad8ac WHIRLPOOL dac24fcb47d8b094ffa6b4403dbd7604901dd0f5ef6665a882380109584e4de815b2f277e05d44c05e1a3d22a7003075b2b2649f3f614f299b38bc6d594400ae
+AUX llvm-3.5-gentoo-install.patch 3204 SHA256 0c97173613505ea92f0aa79d4e04e797f1917fdc33b34daee05752bb52336d53 SHA512 f60b04f1fc7798f7869f3d80e4c163086c398e01b81220d60ccff42be5899fa036d5ab95257933e89e4c5efd04267a09015917c6a617b86b82d7ab4f5d0de221 WHIRLPOOL 81ce5835b9eb1fe1b162f35d6e37762cc8d613e67c5791f078ecd0e354a87eb92e52452bd6e9a7f70953dabea99d197786e87ed64dc802223149b8e97d6de265
+AUX llvm-3.5-musl-clang-support.patch 2341 SHA256 e0d43b6ce1406706bc5bba37f39bd3f26cc4082dbc585cfb5dcca56440238824 SHA512 2ecfd55388504a7f51d9c1726131e46b0b08e9546cd4a7ee1b74125343502412095863efabc81ed726f3a8e650c4c43fbf1fde428d35e53906d7c9b45d0fa9f1 WHIRLPOOL ddde48159cd735eacbdeff618964d8ac55692c8cf6d44414aed49cbbede3ba59e8f8f346986b7b45922c36c26248e477e82c07b0e4cdbf95ffdbca026054d09b
+AUX llvm-3.5-musl-compiler-rt.patch 2309 SHA256 a9ec6cb87f9b7e17a9fd0cf7fa7cedafaba7601b97359e27d13c7f1cde96adfe SHA512 8d96fdaab4c2b5d6ee3177e5346be0176deb104c1a75aeed72195ff8e86cdb6234c5815645887c3bd1ff28047281fbaf707c1d1e80bebd1b80c8b7e4abc8d0fa WHIRLPOOL 1afed6a971f7f3d4dea37b81e8381b6eb96d21ebdfd90f21e451e40e597938b8dd545f03bce7c0aa448a1807162333e76e52903b7fb2ac4f33545f4fd4e46a88
+AUX llvm-3.5-musl-fixes.patch 3465 SHA256 e7ea600500b948bcf5d3eaad0664039b1cdfb27ece878f176b038a97c86183e5 SHA512 b5c5c6e25d7c15d5a014537e8b77d1f648bd3abb56aa1b1342849235e7887468d0b46031ac00115ee8c1786a1ad4695dee9d43c9d38dbfca8577faeee5db156f WHIRLPOOL f7ede3ed9e8d06aa76eb12c3e23a35629be9d4676aa21017758b25cbf97d1e03534763e2a0008d2b549672b10c326925da5040319f70c0c8d139add8c4eb7661
+AUX llvm-3.5-musl-support.patch 2761 SHA256 fbead2e7842e6e928fba09a8b59f9ca10110021c30ccee0b4500c81bd1607c58 SHA512 e0545a23e1ae8a06cba0577f5bcebe7aca90ac25617fa9132ac2bc3749f2ad95b5d3665073f9b2e1b0404741b903596b8892f9dd3e303f51c349da8959cb1b12 WHIRLPOOL a5e3f8fba22b0478c6bda6a9cd9fb8d83f80b8caa8fcd56381f2d59caf8062a98f5fc1b609856a7bdc45209615597039346ea20cb05e557a291ab73c29b1fed8
+AUX llvm-3.5.0-fix_LLVMExports_cmake.patch 1563 SHA256 924303a7fa7ee46276eb2984e3e2d9304873df1d63c0d878371cf98b4094aef0 SHA512 8e8c3ae2c8e2bac0d78a7f572ccfae9cfc30e52ffbfa953596c075cf6adc4e5881d2b80cad4d87bbf1de837d88352334bb51a331adc8d8db74354945c036637e WHIRLPOOL b525bbf3a7ade5906e9e35315af1ccb50c4392e1d104c516927a3ab9b627bc3d0fcf41bd0b77093f6743131f801d37d53d1065371e5c86eb4e7d538eb969b3a8
+DIST cfe-3.5.0.src.tar.xz 8233432 SHA256 fc80992e004b06f6c7afb612de1cdaa9ac9d25811c55f94fcf7331d9b81cdb8b SHA512 b26a5e2cd81c150607c23b22fafc0d9c7f12b83b45e476b8e75bf5e99d42be7c98ffeac7349df664f01b00900864a01429860b298e48961861377a4b2daf3e49 WHIRLPOOL 5dd8b6fe97933b74f1668b1d753c16cd3bcd05ccf72aac1283aa449caf93f5ba88ae79e7668f7e79b554e1421549a87af21c86cf92657c1b4d77744165718ce7
+DIST clang-tools-extra-3.5.0.src.tar.xz 216256 SHA256 2981beb378afb5aa5c50ed017720a42a33e77e902c7086ad2d412ef4fa931f69 SHA512 5ff2cc5d143b78fbe6645486f02e50f738a92aaf6b8e85cfc6f91e659684686b12e61fc8f00b814b4372c5ed2c2b1be5eca61ea696fbe074b815877b799534ee WHIRLPOOL 10b5afc550fa6a8c33739fbf9268e934732b2892842d398152676e66ab90aed3c6e1bae02bc1b8aa0a9a917b6b450f60950317a9eda3f9e377971cbe00164b11
+DIST compiler-rt-3.5.0.src.tar.xz 1088352 SHA256 a4b3e655832bf8d9a357ea2c771db347237460e131988cbb96cda40ff39a8136 SHA512 862cce2d6b398bd1a8399496a547e6ab976a31f676528beebfbea5fd7dc54aa72e1c25deefa12f6167096521eba74090565b0168806451da02ddac04e922fc48 WHIRLPOOL 248acf997d70d7904aa79bf83e0c02ba4e5f8c2812c03f44a8e1e31b845a654f250c09ec6a123f9245d0db8713e8cc5a4087b9ce785af4f5eb7e55d9dbd362a2
+DIST llvm-3.5.0-manpages.tar.bz2 35314 SHA256 724e752a60016dce8cc536658906d3646c600e977374e0ea692a5d0fe2d4a021 SHA512 d99d6096d7f21a81923297584fe5eeb23e0d83d4538fe376615c92fffc8aff3189999f7ab3c537b5aa5d6bc2c22c53eb05717d48c7ab99c42315b8665bac62c3 WHIRLPOOL 68ced06ee6678c5333c662eb1cc0da744c5a184b12dd059c1b77ec200b1d3cc231f270b9d9b6e177d728776894277b3f9061338aa55620c90474eb97915b7819
+DIST llvm-3.5.0.src.tar.xz 11735940 SHA256 28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03 SHA512 b4d0f325dbdb0a8f10e5fd031954ef4b1971d8f99f4e4b53834801a2b74a7acde3f77c655c8355b407424b363edfb10f71d85fc370356dc52af5c636a1bba197 WHIRLPOOL 561520823468b61c63df8e13f876b7ac586eb1e52c256e9a36370e5d46e8cef3937655c36fbb51eebd3680fab67412e7c777479477fc728e7a8f35420e573ef1
+EBUILD llvm-3.5.0-r99.ebuild 15202 SHA256 9f42e4f0476d40babc95d1acdcce051d12697ef07ed0c4ecf3f4a2e332a6f733 SHA512 b647fa654210ec4673a20bc27958cd382e590a5f311c919fe85cf761360d6375287c3362ede837feb9c1334bef135bf21ef7f771a654cfd80558b3f7d6d23f3d WHIRLPOOL 7b9327050a59cc343d2584bdbe242cda749955b0bdc4ff1b3879ed98d8cfa14b0238acd37e032e1df66eea47cc5f44a3d351323da296de3a37425618b24910b3
+MISC metadata.xml 2787 SHA256 22dc7b91c98fb4258271cc9cd4bd99f214b30f258bbdfea83dc37ac74df8d498 SHA512 4fca0d2551a889e7800c688077adf405697d05730bf66621ac53fdefeeeaddb7a8d868973edc9a6fe48e9a07734f1d43fd88229bae693fe181a7dbb95eeb9481 WHIRLPOOL 6284033d40bef02510f924ec1e6a9d3e1072bf26945fdedde0ddaf1d6d35c3d30971cdefa583a8e4d9db3da67bee04145ace15ded4cee63f534588b66633c76b
diff --git a/sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch b/sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch
new file mode 100644
index 00000000..f5f1d9e3
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.4-darwin_prefix-include-paths.patch
@@ -0,0 +1,18 @@
+--- tools/clang/lib/Frontend/InitHeaderSearch.cpp
++++ tools/clang/lib/Frontend/InitHeaderSearch.cpp
+@@ -233,6 +233,7 @@
+ case llvm::Triple::Bitrig:
+ break;
+ default:
++ AddPath("@GENTOO_PORTAGE_EPREFIX@/usr/include", System, false);
+ // FIXME: temporary hack: hard-coded paths.
+ AddPath("/usr/local/include", System, false);
+ break;
+@@ -505,6 +506,7 @@
+ // Add the default framework include paths on Darwin.
+ if (HSOpts.UseStandardSystemIncludes) {
+ if (triple.isOSDarwin()) {
++ AddPath("@GENTOO_PORTAGE_EPREFIX@/Frameworks", System, true);
+ AddPath("/System/Library/Frameworks", System, true);
+ AddPath("/Library/Frameworks", System, true);
+ }
diff --git a/sys-devel/llvm/files/clang-3.5-gentoo-install.patch b/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
new file mode 100644
index 00000000..5d4261d0
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.5-gentoo-install.patch
@@ -0,0 +1,57 @@
+---
+ tools/clang/lib/Driver/Tools.cpp | 2 +-
+ tools/clang/tools/scan-build/scan-build | 4 ++--
+ tools/clang/tools/scan-view/scan-view | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
+index 187ed38..55bcd99 100644
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -1404,7 +1404,7 @@ static void AddGoldPlugin(const ToolChain &ToolChain, const ArgList &Args,
+ // as gold requires -plugin to come before any -plugin-opt that -Wl might
+ // forward.
+ CmdArgs.push_back("-plugin");
+- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so";
++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/LLVMgold.so";
+ CmdArgs.push_back(Args.MakeArgString(Plugin));
+
+ // Try to pass driver level flags relevant to LTO code generation down to
+diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build
+index 0f119f6..58f78d9 100755
+--- a/tools/clang/tools/scan-build/scan-build
++++ b/tools/clang/tools/scan-build/scan-build
+@@ -419,7 +419,7 @@
+
+ my $Dir = shift;
+
+- my $JS = Cwd::realpath("$RealBin/sorttable.js");
++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js");
+
+ DieDiag("Cannot find 'sorttable.js'.\n")
+ if (! -r $JS);
+@@ -429,7 +429,7 @@
+ DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n")
+ if (! -r "$Dir/sorttable.js");
+
+- my $CSS = Cwd::realpath("$RealBin/scanview.css");
++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css");
+
+ DieDiag("Cannot find 'scanview.css'.\n")
+ if (! -r $CSS);
+diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view
+index fb27da6..1f8ddb8 100755
+--- a/tools/clang/tools/scan-view/scan-view
++++ b/tools/clang/tools/scan-view/scan-view
+@@ -54,7 +54,7 @@ def start_browser(port, options):
+ webbrowser.open(url)
+
+ def run(port, options, root):
+- import ScanView
++ from clang import ScanView
+ try:
+ print 'Starting scan-view at: http://%s:%d'%(options.host,
+ port)
+--
+1.8.4.4
+
diff --git a/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch b/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
new file mode 100644
index 00000000..1f81af0b
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
@@ -0,0 +1,42 @@
+From 916572e1243633ddf913c8f32771a3a7f70fd853 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 5 Sep 2014 16:49:35 +0200
+Subject: [PATCH] Support obtaining active toolchain from gcc-config.
+
+---
+ tools/clang/lib/Driver/ToolChains.cpp | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
+index b46f69d..2d4374d 100644
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -1253,6 +1253,25 @@ Generic_GCC::GCCInstallationDetector::init(
+ Prefixes.push_back("/usr");
+ }
+
++ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) {
++ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File =
++ llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str());
++ if (File)
++ {
++ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str();
++ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText;
++ if (llvm::sys::fs::exists(GentooPath + "/crtbegin.o"))
++ {
++ Version = GCCVersion::Parse(VersionText);
++ GCCInstallPath = GentooPath;
++ GCCParentLibPath = GCCInstallPath + "/../../..";
++ GCCTriple.setTriple(CandidateTripleAliases[k]);
++ IsValid = true;
++ return;
++ }
++ }
++ }
++
+ // Loop over the various components which exist and select the best GCC
+ // installation available. GCC installs are ranked by version number.
+ Version = GCCVersion::Parse("0.0.0");
+--
+2.1.0
+
diff --git a/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch b/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch
new file mode 100644
index 00000000..3a622b53
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.2-nodoctargz.patch
@@ -0,0 +1,45 @@
+--- docs/Makefile.orig 2012-04-30 17:00:01.000000000 +0200
++++ docs/Makefile 2012-04-30 17:15:52.000000000 +0200
+@@ -52,11 +52,10 @@
+ # 'make generated BUILD_FOR_WEBSITE=1'
+ generated:: $(generated_targets)
+
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz
++install-html:
+ $(Echo) Installing HTML documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
+ $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
+
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
+ $(Echo) Packaging HTML documentation
+@@ -68,12 +67,11 @@
+ install-doxygen: doxygen
+ $(Echo) Installing doxygen documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
+
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
++doxygen: regendoc
+
+ regendoc:
+ $(Echo) Building doxygen documentation
+@@ -99,7 +97,6 @@
+ install-ocamldoc: ocamldoc
+ $(Echo) Installing ocamldoc documentation
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
+ $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
+ $(FIND) . -type f -exec \
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
+@@ -109,7 +106,6 @@
+ $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc.tar*
+ $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/ocamldoc.tar ocamldoc
+ $(Verb) $(GZIPBIN) $(PROJ_OBJ_DIR)/ocamldoc.tar
+- $(Verb) $(CP) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_OBJ_DIR)/ocamldoc/html/
+
+ regen-ocamldoc:
+ $(Echo) Building ocamldoc documentation
diff --git a/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch b/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch
new file mode 100644
index 00000000..7da657f4
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-gcc-4.9.patch
@@ -0,0 +1,43 @@
+commit 080fb498017d17af2e4d7563608c7d8a848f20da
+Author: Sanjoy Das <sanjoy at azulsystems.com>
+Date: Thu Jun 19 15:38:02 2014 -0700
+
+ Fix the --enable-shared build.
+
+ Currently a build configured with ./configure --enable-shared breaks
+ with an undefined "llvm::cl::parser<llvm::PassInfo
+ const*>::getOption(unsigned int) const" symbol when linking opt. This
+ body for this symbol gets emitted into Pass.o (along with the destructor
+ for PassNameParser), but gets linked into libLLVM-3.5svn.so with local
+ visibility, causing the link error.
+
+ This fix uses the existing EXTERN_TEMPLATE machinery to force a globally
+ visible definition for the functions in parser<const PassInfo *> into
+ Pass.o.
+
+diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h
+index e2e4912..a07e3fd 100644
+--- a/include/llvm/IR/LegacyPassNameParser.h
++++ b/include/llvm/IR/LegacyPassNameParser.h
+@@ -95,6 +95,8 @@ private:
+ }
+ };
+
++EXTERN_TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
++
+ ///===----------------------------------------------------------------------===//
+ /// FilteredPassNameParser class - Make use of the pass registration
+ /// mechanism to automatically add a command line argument to opt for
+diff --git a/lib/IR/Pass.cpp b/lib/IR/Pass.cpp
+index 91d86ae..00ce223 100644
+--- a/lib/IR/Pass.cpp
++++ b/lib/IR/Pass.cpp
+@@ -234,6 +234,8 @@ PassNameParser::~PassNameParser() {
+ // attempting to remove the registration listener is an error.
+ }
+
++TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
++
+ //===----------------------------------------------------------------------===//
+ // AnalysisUsage Class Implementation
+ //
diff --git a/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch
new file mode 100644
index 00000000..7a8c9f7d
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-gentoo-install.patch
@@ -0,0 +1,83 @@
+From b8846d389ff5e2b768a114f752cf39788accba26 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 19 Aug 2013 13:22:46 +0200
+Subject: [PATCH] gentoo install fixes
+
+---
+ Makefile.config.in | 6 +++---
+ Makefile.rules | 6 +++---
+ tools/llvm-config/BuildVariables.inc.in | 2 ++
+ tools/llvm-config/Makefile | 4 ++++
+ tools/llvm-config/llvm-config.cpp | 5 +++--
+ utils/FileCheck/Makefile | 2 +-
+ 7 files changed, 17 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile.config.in b/Makefile.config.in
+index dcca45f..e75ae2e 100644
+--- a/Makefile.config.in
++++ b/Makefile.config.in
+@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix)
+ endif
+
+ PROJ_bindir := $(PROJ_prefix)/bin
+-PROJ_libdir := $(PROJ_prefix)/lib
++PROJ_libdir := $(PROJ_prefix)/$(GENTOO_LIBDIR)
+ PROJ_datadir := $(PROJ_prefix)/share
+-PROJ_docsdir := $(PROJ_prefix)/docs/llvm
+-PROJ_etcdir := $(PROJ_prefix)/etc/llvm
++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@
++PROJ_etcdir := @EPREFIX@/etc/llvm
+ PROJ_includedir := $(PROJ_prefix)/include
+ PROJ_infodir := $(PROJ_prefix)/info
+ PROJ_mandir := $(PROJ_prefix)/share/man
+diff --git a/Makefile.rules b/Makefile.rules
+index e53598b..217f754 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -275,7 +275,7 @@ ifeq ($(ENABLE_OPTIMIZED),1)
+ BuildMode := Release
+ # Don't use -fomit-frame-pointer on Darwin or FreeBSD.
+ ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin Darwin DragonFly FreeBSD GNU/kFreeBSD))
+- OmitFramePointer := -fomit-frame-pointer
++ OmitFramePointer :=
+ endif
+
+ CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
+diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in
+index fe87afb..fd9f2c6 100644
+--- a/tools/llvm-config/BuildVariables.inc.in
++++ b/tools/llvm-config/BuildVariables.inc.in
+@@ -25,3 +25,4 @@
+ #define LLVM_BUILDMODE "@LLVM_BUILDMODE@"
+ #define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
+ #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
++#define LLVM_LIBDIR "@LLVM_LIBDIR@"
+diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile
+index b20b6bf..fc56781 100644
+--- a/tools/llvm-config/Makefile
++++ b/tools/llvm-config/Makefile
+@@ -55,6 +55,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
+ >> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
+ >> temp.sed
++ $(Verb) $(ECHO) 's/@LLVM_LIBDIR@/$(subst /,\/,$(GENTOO_LIBDIR))/' \
++ >> temp.sed
+ $(Verb) $(SED) -f temp.sed < $< > $@
+ $(Verb) $(RM) temp.sed
+
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index 3924e2e..f439c60 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -250,7 +250,7 @@ int main(int argc, char **argv) {
+ ActivePrefix = CurrentExecPrefix;
+ ActiveIncludeDir = ActivePrefix + "/include";
+ ActiveBinDir = ActivePrefix + "/bin";
+- ActiveLibDir = ActivePrefix + "/lib";
++ ActiveLibDir = ActivePrefix + "/" LLVM_LIBDIR;
+ ActiveIncludeOption = "-I" + ActiveIncludeDir;
+ }
+
+--
+1.8.4.2
+
diff --git a/sys-devel/llvm/files/llvm-3.5-musl-clang-support.patch b/sys-devel/llvm/files/llvm-3.5-musl-clang-support.patch
new file mode 100644
index 00000000..a492f12b
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-musl-clang-support.patch
@@ -0,0 +1,59 @@
+adapted from llvm-alpine-linux.patch from Alpine
+
+diff -ru llvm-3.5.0.src.orig/tools/clang/lib/Driver/Tools.cpp llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp
+--- tools/clang/lib/Driver/Tools.cpp 2014-08-07 07:51:51.000000000 -0300
++++ tools/clang/lib/Driver/Tools.cpp 2014-11-12 15:11:31.901864030 -0200
+@@ -7182,8 +7182,14 @@
+ return "/system/bin/linker64";
+ else
+ return "/system/bin/linker";
+- } else if (ToolChain.getArch() == llvm::Triple::x86 ||
+- ToolChain.getArch() == llvm::Triple::sparc)
++ } else if (ToolChain.getArch() == llvm::Triple::x86) {
++ switch (ToolChain.getTriple().getEnvironment()) {
++ case llvm::Triple::Musl:
++ return "/lib/ld-musl-i386.so.1";
++ default:
++ return "/lib/ld-linux.so.2";
++ }
++ } else if (ToolChain.getArch() == llvm::Triple::sparc)
+ return "/lib/ld-linux.so.2";
+ else if (ToolChain.getArch() == llvm::Triple::aarch64 ||
+ ToolChain.getArch() == llvm::Triple::arm64)
+@@ -7193,10 +7199,17 @@
+ return "/lib/ld-linux-aarch64_be.so.1";
+ else if (ToolChain.getArch() == llvm::Triple::arm ||
+ ToolChain.getArch() == llvm::Triple::thumb) {
+- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
++ switch (ToolChain.getTriple().getEnvironment()) {
++ case llvm::Triple::Musl:
++ case llvm::Triple::MuslEABI:
++ return "/lib/ld-musl-arm.so.3";
++ case llvm::Triple::MuslEABIHF:
++ return "/lib/ld-musl-armhf.so.3";
++ case llvm::Triple::GNUEABIHF:
+ return "/lib/ld-linux-armhf.so.3";
+- else
++ default:
+ return "/lib/ld-linux.so.3";
++ }
+ } else if (ToolChain.getArch() == llvm::Triple::armeb ||
+ ToolChain.getArch() == llvm::Triple::thumbeb) {
+ if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+@@ -7227,8 +7240,14 @@
+ else if (ToolChain.getArch() == llvm::Triple::x86_64 &&
+ ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUX32)
+ return "/libx32/ld-linux-x32.so.2";
+- else
+- return "/lib64/ld-linux-x86-64.so.2";
++ else {
++ switch (ToolChain.getTriple().getEnvironment()) {
++ case llvm::Triple::Musl:
++ return "/lib/ld-musl-x86_64.so.1";
++ default:
++ return "/lib64/ld-linux-x86-64.so.2";
++ }
++ }
+ }
+
+ static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
diff --git a/sys-devel/llvm/files/llvm-3.5-musl-compiler-rt.patch b/sys-devel/llvm/files/llvm-3.5-musl-compiler-rt.patch
new file mode 100644
index 00000000..b1f48d2c
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-musl-compiler-rt.patch
@@ -0,0 +1,58 @@
+diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk b/llvm-3.5.0.src/projects/compiler-rt/lib/Makefile.mk
+--- a/projects/compiler-rt/lib/Makefile.mk 2014-02-14 10:20:33.000000000 -0100
++++ b/projects/compiler-rt/lib/Makefile.mk 2015-01-07 13:56:00.362944069 -0100
+@@ -10,13 +10,13 @@
+ SubDirs :=
+
+ # Add submodules.
+-SubDirs += asan
++#SubDirs += asan
+ SubDirs += builtins
+-SubDirs += dfsan
++#SubDirs += dfsan
+ SubDirs += interception
+-SubDirs += lsan
+-SubDirs += msan
++#SubDirs += lsan
++#SubDirs += msan
+ SubDirs += profile
+-SubDirs += sanitizer_common
+-SubDirs += tsan
+-SubDirs += ubsan
++#SubDirs += sanitizer_common
++#SubDirs += tsan
++#SubDirs += ubsan
+diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.cc
+--- a/projects/compiler-rt/lib/interception/interception_linux.cc 2014-02-24 09:37:41.000000000 -0100
++++ b/projects/compiler-rt/lib/interception/interception_linux.cc 2015-01-07 13:56:56.609240893 -0100
+@@ -24,12 +24,6 @@
+ return real == wrapper;
+ }
+
+-#if !defined(__ANDROID__) // android does not have dlvsym
+-void *GetFuncAddrVer(const char *func_name, const char *ver) {
+- return dlvsym(RTLD_NEXT, func_name, ver);
+-}
+-#endif // !defined(__ANDROID__)
+-
+ } // namespace __interception
+
+
+diff -ur a/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h b/llvm-3.5.0.src/projects/compiler-rt/lib/interception/interception_linux.h
+--- a/projects/compiler-rt/lib/interception/interception_linux.h 2014-02-24 09:37:41.000000000 -0100
++++ b/projects/compiler-rt/lib/interception/interception_linux.h 2015-01-07 13:56:41.617428317 -0100
+@@ -34,14 +34,8 @@
+ (::__interception::uptr) & (func), \
+ (::__interception::uptr) & WRAP(func))
+
+-#if !defined(__ANDROID__) // android does not have dlvsym
+-# define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
+- ::__interception::real_##func = (func##_f)(unsigned long) \
+- ::__interception::GetFuncAddrVer(#func, symver)
+-#else
+ # define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
+ INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)
+-#endif // !defined(__ANDROID__)
+
+ #endif // INTERCEPTION_LINUX_H
+ #endif // __linux__ || __FreeBSD__
diff --git a/sys-devel/llvm/files/llvm-3.5-musl-fixes.patch b/sys-devel/llvm/files/llvm-3.5-musl-fixes.patch
new file mode 100644
index 00000000..98d61338
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-musl-fixes.patch
@@ -0,0 +1,77 @@
+llvm-musl.patch from alpine linux
+
+diff -ru llvm-3.5.0.src.orig/include/llvm/Target/TargetLibraryInfo.h llvm-3.5.0.src/include/llvm/Target/TargetLibraryInfo.h
+--- llvm-3.5.0.src.orig/include/llvm/Target/TargetLibraryInfo.h 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/include/llvm/Target/TargetLibraryInfo.h 2014-11-13 12:52:35.078889077 +0000
+@@ -13,6 +13,15 @@
+ #include "llvm/ADT/DenseMap.h"
+ #include "llvm/Pass.h"
+
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ class Triple;
+
+diff -ru llvm-3.5.0.src.orig/lib/Support/DynamicLibrary.cpp llvm-3.5.0.src/lib/Support/DynamicLibrary.cpp
+--- llvm-3.5.0.src.orig/lib/Support/DynamicLibrary.cpp 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/lib/Support/DynamicLibrary.cpp 2014-11-13 12:52:07.781720766 +0000
+@@ -138,7 +138,7 @@
+
+ // This macro returns the address of a well-known, explicit symbol
+ #define EXPLICIT_SYMBOL(SYM) \
+- if (!strcmp(symbolName, #SYM)) return &SYM
++ if (!strcmp(symbolName, #SYM)) return (void *) &SYM
+
+ // On linux we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+diff -ru llvm-3.5.0.src.orig/lib/Support/Unix/Signals.inc llvm-3.5.0.src/lib/Support/Unix/Signals.inc
+--- llvm-3.5.0.src.orig/lib/Support/Unix/Signals.inc 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/lib/Support/Unix/Signals.inc 2014-11-13 12:52:07.781720766 +0000
+@@ -266,7 +266,7 @@
+ // On glibc systems we have the 'backtrace' function, which works nicely, but
+ // doesn't demangle symbols.
+ void llvm::sys::PrintStackTrace(FILE *FD) {
+-#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
++#if defined(__GLIBC__) && defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
+ static void* StackTrace[256];
+ // Use backtrace() to output a backtrace on Linux systems with glibc.
+ int depth = backtrace(StackTrace,
+diff -ru llvm-3.5.0.src.orig/lib/Target/TargetLibraryInfo.cpp llvm-3.5.0.src/lib/Target/TargetLibraryInfo.cpp
+--- llvm-3.5.0.src.orig/lib/Target/TargetLibraryInfo.cpp 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/lib/Target/TargetLibraryInfo.cpp 2014-11-13 12:52:07.785054160 +0000
+@@ -653,14 +653,15 @@
+ }
+
+ // The following functions are available on at least Linux:
+- if (!T.isOSLinux()) {
++ if (!T.isOSLinux())
++ TLI.setUnavailable(LibFunc::memalign);
++ if (1 /*!T.isGlibc()*/) {
+ TLI.setUnavailable(LibFunc::dunder_strdup);
+ TLI.setUnavailable(LibFunc::dunder_strtok_r);
+ TLI.setUnavailable(LibFunc::dunder_isoc99_scanf);
+ TLI.setUnavailable(LibFunc::dunder_isoc99_sscanf);
+ TLI.setUnavailable(LibFunc::under_IO_getc);
+ TLI.setUnavailable(LibFunc::under_IO_putc);
+- TLI.setUnavailable(LibFunc::memalign);
+ TLI.setUnavailable(LibFunc::fopen64);
+ TLI.setUnavailable(LibFunc::fseeko64);
+ TLI.setUnavailable(LibFunc::fstat64);
+diff -ru llvm-3.5.0.src.orig/utils/unittest/googletest/src/gtest.cc llvm-3.5.0.src/utils/unittest/googletest/src/gtest.cc
+--- llvm-3.5.0.src.orig/utils/unittest/googletest/src/gtest.cc 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/utils/unittest/googletest/src/gtest.cc 2014-11-13 12:52:07.785054160 +0000
+@@ -120,6 +120,7 @@
+
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h> // NOLINT
++# include <sys/socket.h> // NOLINT
+ # include <netdb.h> // NOLINT
+ #endif
+
diff --git a/sys-devel/llvm/files/llvm-3.5-musl-support.patch b/sys-devel/llvm/files/llvm-3.5-musl-support.patch
new file mode 100644
index 00000000..4abb8546
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5-musl-support.patch
@@ -0,0 +1,67 @@
+adapted from llvm-alpine-linux.patch from Alpine
+
+diff -ru llvm-3.5.0.src.orig/include/llvm/ADT/Triple.h llvm-3.5.0.src/include/llvm/ADT/Triple.h
+--- include/llvm/ADT/Triple.h 2014-07-18 17:28:19.000000000 -0300
++++ include/llvm/ADT/Triple.h 2014-11-12 14:44:41.738448045 -0200
+@@ -149,6 +149,10 @@
+ EABIHF,
+ Android,
+
++ Musl,
++ MuslEABI,
++ MuslEABIHF,
++
+ MSVC,
+ Itanium,
+ Cygnus,
+Only in llvm-3.5.0.src/include/llvm/ADT: Triple.h.orig
+diff -ru llvm-3.5.0.src.orig/lib/Support/Triple.cpp llvm-3.5.0.src/lib/Support/Triple.cpp
+--- lib/Support/Triple.cpp 2014-07-18 17:28:19.000000000 -0300
++++ lib/Support/Triple.cpp 2014-11-12 14:47:06.565122146 -0200
+@@ -168,6 +168,9 @@
+ case CODE16: return "code16";
+ case EABI: return "eabi";
+ case EABIHF: return "eabihf";
++ case Musl: return "musl";
++ case MuslEABI: return "musleabi";
++ case MuslEABIHF: return "musleabihf";
+ case Android: return "android";
+ case MSVC: return "msvc";
+ case Itanium: return "itanium";
+@@ -344,6 +347,9 @@
+ .StartsWith("gnux32", Triple::GNUX32)
+ .StartsWith("code16", Triple::CODE16)
+ .StartsWith("gnu", Triple::GNU)
++ .StartsWith("musl", Triple::Musl)
++ .StartsWith("musleabi", Triple::MuslEABI)
++ .StartsWith("musleabihf", Triple::MuslEABIHF)
+ .StartsWith("android", Triple::Android)
+ .StartsWith("msvc", Triple::MSVC)
+ .StartsWith("itanium", Triple::Itanium)
+Only in llvm-3.5.0.src/lib/Support: Triple.cpp.orig
+diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.cpp llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.cpp
+--- lib/Target/ARM/ARMSubtarget.cpp 2014-07-16 23:13:31.000000000 -0300
++++ lib/Target/ARM/ARMSubtarget.cpp 2014-11-12 14:50:40.025133104 -0200
+@@ -273,6 +273,8 @@
+ case Triple::EABIHF:
+ case Triple::GNUEABI:
+ case Triple::GNUEABIHF:
++ case Triple::MuslEABI:
++ case Triple::MuslEABIHF:
+ TargetABI = ARM_ABI_AAPCS;
+ break;
+ default:
+diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.h llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.h
+--- lib/Target/ARM/ARMSubtarget.h 2014-07-16 23:13:31.000000000 -0300
++++ lib/Target/ARM/ARMSubtarget.h 2014-11-12 14:53:36.571808822 -0200
+@@ -372,8 +372,10 @@
+ bool isTargetEHABICompatible() const {
+ return (TargetTriple.getEnvironment() == Triple::EABI ||
+ TargetTriple.getEnvironment() == Triple::GNUEABI ||
++ TargetTriple.getEnvironment() == Triple::MuslEABI ||
+ TargetTriple.getEnvironment() == Triple::EABIHF ||
+ TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
++ TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
+ TargetTriple.getEnvironment() == Triple::Android) &&
+ !isTargetDarwin() && !isTargetWindows();
+ }
diff --git a/sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch b/sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch
new file mode 100644
index 00000000..9fbd7b73
--- /dev/null
+++ b/sys-devel/llvm/files/llvm-3.5.0-fix_LLVMExports_cmake.patch
@@ -0,0 +1,39 @@
+Index: cmake/modules/Makefile
+===================================================================
+--- cmake/modules/Makefile (revision 217451)
++++ cmake/modules/Makefile (working copy)
+@@ -33,6 +33,16 @@
+ LLVM_ENABLE_RTTI := 0
+ endif
+
++LLVM_LIBS_TO_EXPORT := $(subst -l,,$(shell $(LLVM_CONFIG) --libs $(LINK_COMPONENTS) || echo Error))
++
++ifeq ($(LLVM_LIBS_TO_EXPORT),Error)
++$(error llvm-config --libs failed)
++endif
++
++ifndef LLVM_LIBS_TO_EXPORT
++$(error LLVM_LIBS_TO_EXPORT cannot be empty)
++endif
++
+ OBJMODS := LLVMConfig.cmake LLVMConfigVersion.cmake LLVMExports.cmake
+
+ $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMConfig.cmake.in $(LLVMBuildCMakeFrag)
+@@ -45,7 +55,7 @@
+ -e 's/@LLVM_VERSION_PATCH@/'"$(LLVM_VERSION_PATCH)"'/' \
+ -e 's/@PACKAGE_VERSION@/'"$(LLVMVersion)"'/' \
+ -e 's/@LLVM_COMMON_DEPENDS@//' \
+- -e 's/@LLVM_AVAILABLE_LIBS@/'"$(subst -l,,$(LLVMConfigLibs))"'/' \
++ -e 's/@LLVM_AVAILABLE_LIBS@/'"$(LLVM_LIBS_TO_EXPORT)"'/' \
+ -e 's/@LLVM_ALL_TARGETS@/'"$(ALL_TARGETS)"'/' \
+ -e 's/@LLVM_TARGETS_TO_BUILD@/'"$(TARGETS_TO_BUILD)"'/' \
+ -e 's/@LLVM_TARGETS_WITH_JIT@/'"$(TARGETS_WITH_JIT)"'/' \
+@@ -83,7 +93,7 @@
+ $(Echo) 'Generating LLVM CMake target exports file'
+ $(Verb) ( \
+ echo '# LLVM CMake target exports. Do not include directly.' && \
+- for lib in $(subst -l,,$(LLVMConfigLibs)); do \
++ for lib in $(LLVM_LIBS_TO_EXPORT); do \
+ echo 'add_library('"$$lib"' STATIC IMPORTED)' && \
+ echo 'set_property(TARGET '"$$lib"' PROPERTY IMPORTED_LOCATION "'"$(PROJ_libdir)/lib$$lib.a"'")' ; \
+ done && \
diff --git a/sys-devel/llvm/llvm-3.5.0-r99.ebuild b/sys-devel/llvm/llvm-3.5.0-r99.ebuild
new file mode 100644
index 00000000..22c7f6b6
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.5.0-r99.ebuild
@@ -0,0 +1,531 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.5.0.ebuild,v 1.11 2015/01/01 20:53:32 maekke Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 pypy )
+
+inherit eutils flag-o-matic multibuild multilib \
+ multilib-minimal python-r1 toolchain-funcs pax-utils check-reqs prefix
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="http://llvm.org/"
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( http://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ http://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+ http://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+ !doc? ( http://dev.gentoo.org/~voyageur/distfiles/${P}-manpages.tar.bz2 )"
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.5"
+KEYWORDS="amd64 arm ppc x86"
+IUSE="clang debug doc gold libedit +libffi multitarget ncurses ocaml python
+ +static-analyzer test xml video_cards_radeon
+ kernel_Darwin kernel_FreeBSD"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ clang? (
+ python? ( ${PYTHON_DEPS} )
+ static-analyzer? (
+ dev-lang/perl:*
+ ${PYTHON_DEPS}
+ )
+ xml? ( dev-libs/libxml2:2= )
+ )
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:5=[${MULTILIB_USEDEP}] )
+ ocaml? ( dev-lang/ocaml:0= )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 )
+ clang? ( xml? ( virtual/pkgconfig ) )
+ doc? ( dev-python/sphinx )
+ libffi? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99
+ !>=sys-devel/clang-9999 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ test? ( || ( $(python_gen_useflags 'python*') ) )"
+
+S=${WORKDIR}/${P}.src
+
+# Some people actually override that in make.conf. That sucks since
+# we need to run install per-directory, and ninja can't do that...
+# so why did it call itself ninja in the first place?
+CMAKE_MAKEFILE_GENERATOR=emake
+
+pkg_pretend() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if use debug; then
+ ewarn "USE=debug is known to increase the size of package considerably"
+ ewarn "and cause the tests to fail."
+ ewarn
+
+ (( build_size *= 14 ))
+ elif is-flagq -g || is-flagq -ggdb; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ # Multiply by number of ABIs :).
+ local abis=( $(multilib_get_enabled_abis) )
+ (( build_size *= ${#abis[@]} ))
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+ ebegin "Trying to build a C++11 test program"
+ if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+ eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ eend ${?}
+ fi
+}
+
+pkg_setup() {
+ pkg_pretend
+}
+
+src_unpack() {
+ default
+
+ rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+ || die "symlinks removal failed"
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ mv "${WORKDIR}"/clang-tools-extra-${PV}.src "${S}"/tools/clang/tools/extra \
+ || die "clang-tools-extra source directory move failed"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch
+ epatch "${FILESDIR}"/${PN}-3.5-gcc-4.9.patch
+ epatch "${FILESDIR}"/${PN}-3.5-gentoo-install.patch
+
+ epatch "${FILESDIR}"/${PN}-3.5-musl-fixes.patch
+ epatch "${FILESDIR}"/${PN}-3.5-musl-support.patch
+
+ epatch "${FILESDIR}"/${P}-fix_LLVMExports_cmake.patch
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ epatch "${FILESDIR}"/${PN}-3.5-musl-compiler-rt.patch
+ epatch "${FILESDIR}"/${PN}-3.5-musl-clang-support.patch
+ epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+
+ epatch "${FILESDIR}"/clang-3.5-gentoo-install.patch
+ epatch "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+ fi
+
+ if use prefix && use clang; then
+ sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+ projects/compiler-rt/make/platform/clang_*.mk || die
+ fi
+
+ local sub_files=(
+ Makefile.config.in
+ Makefile.rules
+ tools/llvm-config/llvm-config.cpp
+ )
+ use clang && sub_files+=(
+ tools/clang/lib/Driver/Tools.cpp
+ tools/clang/tools/scan-build/scan-build
+ )
+
+ # unfortunately ./configure won't listen to --mandir and the-like, so take
+ # care of this.
+ # note: we're setting the main libdir intentionally.
+ # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+ einfo "Fixing install dirs"
+ sed -e "s,@libdir@,$(get_libdir),g" \
+ -e "s,@PF@,${PF},g" \
+ -e "s,@EPREFIX@,${EPREFIX},g" \
+ -i "${sub_files[@]}" \
+ || die "install paths sed failed"
+
+ if use clang; then
+ # constantly fails for a long time, likely due to our patches
+ rm tools/clang/test/Driver/cross-linux.c || die
+ fi
+
+ # User patches
+ epatch_user
+
+ python_setup
+}
+
+multilib_src_configure() {
+ # disable timestamps since they confuse ccache
+ local conf_flags=(
+ --disable-timestamps
+ --enable-keep-symbols
+ --enable-shared
+ --with-optimize-option=
+ $(tc-is-static-only && echo --disable-shared)
+ $(use_enable !debug optimized)
+ $(use_enable debug assertions)
+ $(use_enable debug expensive-checks)
+ $(use_enable libedit)
+ $(use_enable ncurses terminfo)
+ $(use_enable libffi)
+ )
+
+ # well, it's used only by clang executable c-index-test
+ if multilib_is_native_abi && use clang && use xml; then
+ conf_flags+=( XML2CONFIG="$(tc-getPKG_CONFIG) libxml-2.0" )
+ else
+ conf_flags+=( ac_cv_prog_XML2CONFIG="" )
+ fi
+
+ local targets bindings
+ if use multitarget; then
+ targets='all'
+ else
+ targets='host,cpp'
+ use video_cards_radeon && targets+=',r600'
+ fi
+ conf_flags+=( --enable-targets=${targets} )
+
+ if multilib_is_native_abi; then
+ use gold && conf_flags+=( --with-binutils-include="${EPREFIX}"/usr/include/ )
+ # extra commas don't hurt
+ use ocaml && bindings+=',ocaml'
+ fi
+
+ [[ ${bindings} ]] || bindings='none'
+ conf_flags+=( --enable-bindings=${bindings} )
+
+ if use libffi; then
+ local CPPFLAGS=${CPPFLAGS}
+ append-cppflags "$(pkg-config --cflags libffi)"
+ fi
+
+ # llvm prefers clang over gcc, so we may need to force that
+ tc-export CC CXX
+
+ ECONF_SOURCE=${S} \
+ econf "${conf_flags[@]}"
+}
+
+set_makeargs() {
+ MAKEARGS=(
+ VERBOSE=1
+ REQUIRES_RTTI=1
+ GENTOO_LIBDIR=$(get_libdir)
+ )
+
+ # for tests, we want it all! otherwise, we may use a little filtering...
+ # adding ONLY_TOOLS also disables unittest building...
+ if [[ ${EBUILD_PHASE_FUNC} != src_test ]]; then
+ local tools=( llvm-config )
+ use clang && tools+=( clang )
+
+ if multilib_is_native_abi; then
+ tools+=(
+ opt llvm-as llvm-dis llc llvm-ar llvm-nm llvm-link lli
+ llvm-extract llvm-mc llvm-bcanalyzer llvm-diff macho-dump
+ llvm-objdump llvm-readobj llvm-rtdyld llvm-dwarfdump llvm-cov
+ llvm-size llvm-stress llvm-mcmarkup llvm-profdata
+ llvm-symbolizer obj2yaml yaml2obj lto bugpoint
+ )
+
+ # the build system runs explicitly specified tools in parallel,
+ # so we need to split it into two runs
+ if [[ ${1} != -1 ]]; then
+ # those require lto
+ tools+=( llvm-lto )
+ use gold && tools+=( gold )
+
+ # those require clang :)
+ # we need to explicitly specify all its tools
+ # since we're passing BUILD_CLANG_ONLY
+ use clang && tools+=(
+ clang/tools/{clang-check,clang-format,extra}
+ )
+ fi
+ fi
+
+ MAKEARGS+=(
+ # filter tools + disable unittests implicitly
+ ONLY_TOOLS="${tools[*]}"
+
+ # this disables unittests & docs from clang
+ BUILD_CLANG_ONLY=YES
+ )
+ fi
+}
+
+multilib_src_compile() {
+ local MAKEARGS
+ set_makeargs -1
+ emake "${MAKEARGS[@]}"
+
+ if multilib_is_native_abi; then
+ set_makeargs
+ emake -C tools "${MAKEARGS[@]}"
+
+ if use doc; then
+ emake -C "${S}"/docs -f Makefile.sphinx man
+ use clang && emake -C "${S}"/tools/clang/docs/tools \
+ BUILD_FOR_WEBSITE=1 DST_MAN_DIR="${T}"/ man
+ emake -C "${S}"/docs -f Makefile.sphinx html
+ fi
+ fi
+
+ if use debug; then
+ pax-mark m Debug+Asserts+Checks/bin/llvm-rtdyld
+ pax-mark m Debug+Asserts+Checks/bin/lli
+ pax-mark m Debug+Asserts+Checks/bin/lli-child-target
+ else
+ pax-mark m Release/bin/llvm-rtdyld
+ pax-mark m Release/bin/lli
+ pax-mark m Release/bin/lli-child-target
+ fi
+}
+
+multilib_src_test() {
+ local MAKEARGS
+ set_makeargs
+
+ # build the remaining tools & unittests
+ emake "${MAKEARGS[@]}"
+
+ pax-mark m unittests/ExecutionEngine/JIT/Release/JITTests
+ pax-mark m unittests/ExecutionEngine/MCJIT/Release/MCJITTests
+ pax-mark m unittests/Support/Release/SupportTests
+
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ emake "${MAKEARGS[@]}" check
+ use clang && emake "${MAKEARGS[@]}" -C tools/clang test
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/config.h
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ if use clang; then
+ # note: magic applied below
+ MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/clang
+ /usr/bin/clang++
+ /usr/bin/clang-${PV}
+ /usr/bin/clang++-${PV}
+ )
+
+ MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/clang/Config/config.h
+ )
+ fi
+
+ multilib-minimal_src_install
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ use kernel_FreeBSD && use clang && rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h
+}
+
+multilib_src_install() {
+ local MAKEARGS
+ set_makeargs
+
+ local root=${D}/_${ABI}
+
+ emake "${MAKEARGS[@]}" DESTDIR="${root}" install
+ multibuild_merge_root "${root}" "${D}"
+
+ if ! multilib_is_native_abi; then
+ # Backwards compat, will be happily removed someday.
+ dosym "${CHOST}"-llvm-config /usr/bin/llvm-config.${ABI}
+ else
+ # Install docs.
+ if use doc; then
+ doman "${S}"/docs/_build/man/*.1
+ use clang && doman "${T}"/clang.1
+ dohtml -r "${S}"/docs/_build/html/
+ else
+ if ! use clang; then
+ rm "${WORKDIR}"/${P}-manpages/clang.1 || die
+ fi
+ doman "${WORKDIR}"/${P}-manpages/*.1
+ fi
+
+ # Symlink the gold plugin.
+ if use gold; then
+ dodir /usr/${CHOST}/binutils-bin/lib/bfd-plugins
+ dosym ../../../../$(get_libdir)/LLVMgold.so \
+ /usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so
+ fi
+ fi
+
+ # apply CHOST and PV to clang executables
+ # they're statically linked so we don't have to worry about the lib
+ if use clang; then
+ local clang_tools=( clang clang++ )
+ local i
+
+ # append ${PV} and symlink back
+ # TODO: use alternatives.eclass? does that make any sense?
+ # maybe with USE=-clang on :0 and USE=clang on older
+ for i in "${clang_tools[@]}"; do
+ mv "${ED%/}/usr/bin/${i}"{,-${PV}} || die
+ dosym "${i}"-${PV} /usr/bin/${i}
+ done
+
+ # now prepend ${CHOST} and let the multilib-build.eclass symlink it
+ if ! multilib_is_native_abi; then
+ # non-native? let's replace it with a simple wrapper
+ for i in "${clang_tools[@]}"; do
+ rm "${ED%/}/usr/bin/${i}-${PV}" || die
+ cat > "${T}"/wrapper.tmp <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec "${i}-${PV}" $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+ newbin "${T}"/wrapper.tmp "${i}-${PV}"
+ done
+ fi
+ fi
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ local lib= f= odylib= ndylib= libpv=${PV}
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ eval $(grep PACKAGE_VERSION= configure)
+ [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+ for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_osx_dynamic.dylib; do
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal
+ # + omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ ebegin "fixing install_name of $lib"
+ install_name_tool \
+ -id "${EPREFIX}"/usr/lib/${lib} \
+ "${ED}"/usr/lib/${lib}
+ eend $?
+ done
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do
+ # omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \
+ while read odylib ; do
+ ndylib=
+ case ${odylib} in
+ */libclang.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libclang.dylib
+ ;;
+ */libLLVM-${libpv}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib
+ ;;
+ */libLTO.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLTO.dylib
+ ;;
+ esac
+ if [[ -n ${ndylib} ]] ; then
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+ install_name_tool \
+ -change "${odylib}" "${ndylib}" \
+ "${f}"
+ eend $?
+ fi
+ done
+ done
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /usr/share/vim/vimfiles/syntax
+ doins utils/vim/*.vim
+
+ if use clang; then
+ cd tools/clang || die
+
+ if use static-analyzer ; then
+ dobin tools/scan-build/ccc-analyzer
+ dosym ccc-analyzer /usr/bin/c++-analyzer
+ dobin tools/scan-build/scan-build
+
+ insinto /usr/share/${PN}
+ doins tools/scan-build/scanview.css
+ doins tools/scan-build/sorttable.js
+ fi
+
+ python_inst() {
+ if use static-analyzer ; then
+ pushd tools/scan-view >/dev/null || die
+
+ python_doscript scan-view
+
+ touch __init__.py || die
+ python_moduleinto clang
+ python_domodule __init__.py Reporter.py Resources ScanView.py startfile.py
+
+ popd >/dev/null || die
+ fi
+
+ if use python ; then
+ pushd bindings/python/clang >/dev/null || die
+
+ python_moduleinto clang
+ python_domodule __init__.py cindex.py enumerations.py
+
+ popd >/dev/null || die
+ fi
+
+ # AddressSanitizer symbolizer (currently separate)
+ python_doscript "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+ }
+ python_foreach_impl python_inst
+ fi
+}
diff --git a/sys-devel/llvm/metadata.xml b/sys-devel/llvm/metadata.xml
new file mode 100644
index 00000000..1a630669
--- /dev/null
+++ b/sys-devel/llvm/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+ </maintainer>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <longdescription>Low Level Virtual Machine (LLVM) is:
+ 1. A compilation strategy designed to enable effective program optimization across the entire lifetime of a program. LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time and offline (i.e., after software is installed), while remaining transparent to developers and maintaining compatibility with existing build scripts.
+ 2. A virtual instruction set - LLVM is a low-level object code representation that uses simple RISC-like instructions, but provides rich, language-independent, type information and dataflow (SSA) information about operands. This combination enables sophisticated transformations on object code, while remaining light-weight enough to be attached to the executable. This combination is key to allowing link-time, run-time, and offline transformations.
+ 3. A compiler infrastructure - LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C and C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for many popular (and some obscure) architectures, a back-end which emits portable C code, and a Just-In-Time compilers for several architectures.
+ 4. LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or run-time code generation (In fact, LLVM makes a great static compiler!). Note that optional LLVM components can be used to build high-level virtual machines and other systems that need these services.</longdescription>
+ <use>
+ <flag name='clang'>Build the clang C/C++ compiler</flag>
+ <flag name='cmake'>Enable cmake support (experimental)</flag>
+ <flag name='doc'>Build and install the HTML documentation and regenerate the man pages</flag>
+ <flag name='gold'>Build the gold linker plugin</flag>
+ <flag name='llvm-gcc'>Build LLVM with <pkg>sys-devel/llvm-gcc</pkg></flag>
+ <flag name='multitarget'>Build all host targets (default: host only)</flag>
+ <flag name='ncurses'>Support querying terminal properties using ncurses' terminfo</flag>
+ <flag name='static-analyzer'>Install the Clang static analyzer (requires USE=clang)</flag>
+ <flag name='udis86'>Enable support for <pkg>dev-libs/udis86</pkg> disassembler library</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/m4/Manifest b/sys-devel/m4/Manifest
new file mode 100644
index 00000000..935766de
--- /dev/null
+++ b/sys-devel/m4/Manifest
@@ -0,0 +1,6 @@
+AUX m4-1.4.16-fix-test-readlink.patch 326 SHA256 5d036a2aab097de8c0b83b6562732235e9863542478d302f5b96d58ee1fe9717 SHA512 cd7a9efd742b7e4aeb2c3ba0b5fe089d21604ed1a59a90a123a29450f8866eae4f7444ad3c3e679e6ac55785f27162d26f8a890635e516876fd2415965320abb WHIRLPOOL 688fc2d34e42148855501d71b2f80afed6b086ce22903088bd8a22b7a2ac5ca0f13194e5902c39b680be2be57053f2c5a1c43bdd050d841f786245413a657ba4
+AUX m4-1.4.16-gnulib-musl.patch 639 SHA256 9508f42d238c19a778e7e992b809aa9b8dba49dfe29df1442e73c7f8d8f8372e SHA512 de86188320a04851fe86547b28216db6e950ff4840ceb5fdd69bad925be273f96e87a288b57432bc726d41f9f354f1f02f7d3ce78395d6b74b353b17aa66f597 WHIRLPOOL f29cb8fd76ec977a640f5ba83489d85b4fb756060b8d755efccb9764f64222eabdb84b9313f282331ca680e875e310a9984f74580441330bf9a332b4c33dcad3
+AUX m4-1.4.16-no-gets.patch 809 SHA256 6059410a6ed64f68a07aa28cc65bc1c7ee6c6528f2750f1c5ba966d82eb521b3 SHA512 eca7f8f669314fe824351e9c05fbd4d152afe2e434f083060ddc1fa47f65822f0147468260ad058890644e8aef68ec317c1003f45bcfe31d3884d62f029d9fd3 WHIRLPOOL f12bb58b7ea491f3d764224fe52426db8d847f78e9908d8e2dd8f51add9b461fd8dd0296f9c07bd7dbc8aaab29c13aa1e3d361501318c67af236627138fca3e4
+DIST m4-1.4.16.tar.xz 1005264 SHA256 d5b5d51cf8f5b18f3bac39bc2f6b1e61f34d400136ae1a87d075e26a38028d5d SHA512 1123671ab3e0b1b13a4a08035e792a93af0d7d0a5b9027982fe7b5104488a0746906068a0f4774c1f1bc2648ba1bc74d690836e90ff9391464278e4ccbc7edf0 WHIRLPOOL 0438098dab71f6a66c2b18aed2941ef9a2152a8061c2f9903373a1348b261354429806c2bd313f55c7aaa612fe4c2f7628a1fff3c80819565df2a3b664485c23
+EBUILD m4-1.4.16-r99.ebuild 1456 SHA256 bf9120b727d18a0f2d9aebd62ef3aee45c826e51516d1170b40046cc2e95a88a SHA512 7a0d2681ec0fbf13b953a96e2ad64f56d68f9ba8b46993dd658dfa3d8e0dd5cf47d7b3bdd761dda032c1b65bedc447279c78fb66f4b1452970e7ae113f6108c7 WHIRLPOOL 6c9d3c7c3bced8900ea97521c9bda68c3b0d921539b4e61783a0ad8b3372235445b5dd540375973fa872e611a8e694d6de0f108f19ad832d8d5df4cc5dbd9132
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-devel/m4/files/m4-1.4.16-fix-test-readlink.patch b/sys-devel/m4/files/m4-1.4.16-fix-test-readlink.patch
new file mode 100644
index 00000000..bb887c4b
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.16-fix-test-readlink.patch
@@ -0,0 +1,11 @@
+--- tests/test-readlink.h
++++ tests/test-readlink.h
+@@ -38,7 +38,7 @@
+ ASSERT (errno == ENOENT);
+ errno = 0;
+ ASSERT (func ("", buf, sizeof buf) == -1);
+- ASSERT (errno == ENOENT);
++ ASSERT (errno == ENOENT || errno == EINVAL);
+ errno = 0;
+ ASSERT (func (".", buf, sizeof buf) == -1);
+ ASSERT (errno == EINVAL);
diff --git a/sys-devel/m4/files/m4-1.4.16-gnulib-musl.patch b/sys-devel/m4/files/m4-1.4.16-gnulib-musl.patch
new file mode 100644
index 00000000..8bf05076
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.16-gnulib-musl.patch
@@ -0,0 +1,18 @@
+diff -Naur m4-1.4.16.orig/lib/freadahead.c m4-1.4.16/lib/freadahead.c
+--- m4-1.4.16.orig/lib/freadahead.c 2011-03-01 16:39:27.000000000 +0000
++++ m4-1.4.16/lib/freadahead.c 2013-07-06 03:37:11.809388632 +0000
+@@ -25,6 +25,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
++#if 0
+ #if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ if (fp->_IO_write_ptr > fp->_IO_write_base)
+ return 0;
+@@ -82,4 +83,6 @@
+ #else
+ #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
+ #endif
++#endif
++ return 0;
+ }
diff --git a/sys-devel/m4/files/m4-1.4.16-no-gets.patch b/sys-devel/m4/files/m4-1.4.16-no-gets.patch
new file mode 100644
index 00000000..bb8069b8
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.16-no-gets.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/424978
+
+hack until m4 pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -125,7 +125,6 @@
+ so any use of gets warrants an unconditional warning. Assume it is
+ always declared, since it is required by C89. */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/sys-devel/m4/m4-1.4.16-r99.ebuild b/sys-devel/m4/m4-1.4.16-r99.ebuild
new file mode 100644
index 00000000..37486caa
--- /dev/null
+++ b/sys-devel/m4/m4-1.4.16-r99.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/m4/m4-1.4.16.ebuild,v 1.13 2013/02/18 01:07:35 zmedico Exp $
+
+EAPI="3"
+
+inherit eutils
+
+DESCRIPTION="GNU macro processor"
+HOMEPAGE="http://www.gnu.org/software/m4/m4.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="examples"
+
+# remember: cannot dep on autoconf since it needs us
+DEPEND="app-arch/xz-utils"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fix-test-readlink.patch #376639
+ epatch "${FILESDIR}"/${P}-no-gets.patch #424978
+ epatch "${FILESDIR}"/${P}-gnulib-musl.patch
+}
+
+src_configure() {
+ # Disable automagic dependency over libsigsegv; see bug #278026
+ export ac_cv_libsigsegv=no
+
+ local myconf=""
+ [[ ${USERLAND} != "GNU" ]] && myconf="--program-prefix=g"
+ econf --enable-changeword ${myconf}
+}
+
+src_test() {
+ [[ -d /none ]] && die "m4 tests will fail with /none/" #244396
+ emake check || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ # autoconf-2.60 for instance, first checks gm4, then m4. If we don't have
+ # gm4, it might find gm4 from outside the prefix on for instance Darwin
+ use prefix && dosym /usr/bin/m4 /usr/bin/gm4
+ dodoc BACKLOG ChangeLog NEWS README* THANKS TODO
+ if use examples ; then
+ docinto examples
+ dodoc examples/*
+ rm -f "${ED}"/usr/share/doc/${PF}/examples/Makefile*
+ fi
+}
diff --git a/sys-devel/m4/metadata.xml b/sys-devel/m4/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /dev/null
+++ b/sys-devel/m4/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/dosfstools/Manifest b/sys-fs/dosfstools/Manifest
new file mode 100644
index 00000000..1ee4cd46
--- /dev/null
+++ b/sys-fs/dosfstools/Manifest
@@ -0,0 +1,5 @@
+AUX dosfstools-3.0.27-Fix-format-string-in-check.c.patch 886 SHA256 44f80903b89d69d51ec71fb0fb1a1a560c5e795c8c9a3a25e8d84ac81cf423fa SHA512 d278ba4fbf79bfd1490c1f693113da5e047a394b639e3ca29e13e98604dddecf61c860e9dc1a0ef9b84c97c1d467a05d61a9e9e8942d24ca8dfe39e05599bfb4 WHIRLPOOL fa2bd8339a3cab8787ada26ab2df54af5e27c980dd33761aa7d603d115053f8b756ff7252d8168280579d99d5287ae88c6e313c2f92a31c397f3014fb0d17e28
+AUX dosfstools-3.0.28-fix_build_with_musl.patch 815 SHA256 fb8cafac2fc31b726aa5a8a74b29554a6865a6b92fb8aacf01fafc630dcc18bd SHA512 f1bc61db4f28ceb70ec30be007ca1b67616b61ec44c82cb373d83803fa8a075cc051ae77a002ed487764f2623309db6d61b5bbb9a5764d48511feeaf2ef6fb54 WHIRLPOOL 1627ff041848a67f768ec6e706f22c7dded41992499694e073107d5cad745f5c452f2d69ec4e8d3be5d0231152e96fc52a3af088e8a0900ce01cf6d0b65a7409
+DIST dosfstools-3.0.28.tar.xz 82980 SHA256 ee95913044ecf2719b63ea11212917649709a6e53209a72d622135aaa8517ee2 SHA512 7325a9e05f51715b358cab0a8fa8f8096422b470f1a43eecfab2adbb954e1daf6a24003121be5b3a22de5fcb3e3adffbf1551e2158852b6663fd57a109f057ad WHIRLPOOL b584aa1dee4db96c04f19b6ac46b6322c533fcadbafb09546412e4d6a7568e23abe6985389dc446dacbe2d14f36dd7a8b52fc83b93ab1f5864b4b61f14f6ffd0
+EBUILD dosfstools-3.0.28-r99.ebuild 954 SHA256 667f2342d0b8db2b51568a71157988835b7bdf15a21a5ede942332e6617768b4 SHA512 96718cff2640c6279419114e127d4b319858fd62dc9d26392e07011ecc421a5dd7e5161223def86f340af1e47720250e48fd2c7bdf4954ae7ca62fb256aa63f7 WHIRLPOOL df0b1ce733cd5669fb30672abb6487f2eaf08639162f242a16c5031bbec8c78a939e393eeb53dc0054e5d087cf1ca97e9b7fa72169e27aa759138237cce293b2
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-fs/dosfstools/dosfstools-3.0.28-r99.ebuild b/sys-fs/dosfstools/dosfstools-3.0.28-r99.ebuild
new file mode 100644
index 00000000..63dc7c2a
--- /dev/null
+++ b/sys-fs/dosfstools/dosfstools-3.0.28-r99.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/dosfstools/dosfstools-3.0.27.ebuild,v 1.1 2015/04/03 07:05:29 vapier Exp $
+
+EAPI="5"
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat"
+HOMEPAGE="http://www.daniel-baumann.ch/software/dosfstools/"
+SRC_URI="https://github.com/dosfstools/dosfstools/releases/download/v${PV}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
+RESTRICT="test" # there is no test target #239071
+
+src_prepare() {
+ sed -i \
+ -e "/^PREFIX/s:=.*:= ${EPREFIX}/usr:" \
+ -e '/^OPTFLAGS/d' \
+ -e '/^DEBUGFLAGS/d' \
+ -e "/\$(DOCDIR)/s:${PN}:${PF}:" \
+ Makefile || die
+ epatch "${FILESDIR}"/${PN}-3.0.27-Fix-format-string-in-check.c.patch
+ epatch "${FILESDIR}"/${PN}-3.0.28-fix_build_with_musl.patch
+ append-lfs-flags
+ tc-export CC
+}
diff --git a/sys-fs/dosfstools/files/dosfstools-3.0.27-Fix-format-string-in-check.c.patch b/sys-fs/dosfstools/files/dosfstools-3.0.27-Fix-format-string-in-check.c.patch
new file mode 100644
index 00000000..8a5bbb65
--- /dev/null
+++ b/sys-fs/dosfstools/files/dosfstools-3.0.27-Fix-format-string-in-check.c.patch
@@ -0,0 +1,25 @@
+From 04d5d990904df782a7a774827e0c860eac640272 Mon Sep 17 00:00:00 2001
+From: Hinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>
+Date: Thu, 16 Apr 2015 14:19:57 +0000
+Subject: [PATCH 2/2] Fix format string in check.c
+
+---
+ src/check.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/check.c b/src/check.c
+index d8880a8..bb783e5 100644
+--- a/src/check.c
++++ b/src/check.c
+@@ -582,7 +582,7 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
+ if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) <=
+ (uint64_t)clusters * fs->cluster_size) {
+ printf
+- ("%s\n File size is %u bytes, cluster chain length is > %lu "
++ ("%s\n File size is %u bytes, cluster chain length is > %llu "
+ "bytes.\n Truncating file to %u bytes.\n", path_name(file),
+ le32toh(file->dir_ent.size),
+ (uint64_t)clusters * fs->cluster_size,
+--
+2.3.5
+
diff --git a/sys-fs/dosfstools/files/dosfstools-3.0.28-fix_build_with_musl.patch b/sys-fs/dosfstools/files/dosfstools-3.0.28-fix_build_with_musl.patch
new file mode 100644
index 00000000..b4953786
--- /dev/null
+++ b/sys-fs/dosfstools/files/dosfstools-3.0.28-fix_build_with_musl.patch
@@ -0,0 +1,25 @@
+diff --git a/Makefile b/Makefile
+index f22a4c5..967defe 100644
+--- a/Makefile
++++ b/Makefile
+@@ -30,7 +30,7 @@ MANDIR = $(PREFIX)/share/man
+ #OPTFLAGS = -O2 -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ #WARNFLAGS = -Wall -pedantic -std=c99
+ WARNFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
+-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS)
++CFLAGS += $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS) -D _GNU_SOURCE
+
+ VPATH = src
+
+diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
+index b38d116..7e6c996 100644
+--- a/src/mkfs.fat.c
++++ b/src/mkfs.fat.c
+@@ -60,6 +60,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <time.h>
+ #include <errno.h>
diff --git a/sys-fs/dosfstools/metadata.xml b/sys-fs/dosfstools/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /dev/null
+++ b/sys-fs/dosfstools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/encfs/Manifest b/sys-fs/encfs/Manifest
new file mode 100644
index 00000000..557338c2
--- /dev/null
+++ b/sys-fs/encfs/Manifest
@@ -0,0 +1,5 @@
+AUX encfs-1.7.4-encfsctl.patch 243 SHA256 ca73c93de560460893cd125bf408f4f5fbf37e6aafb98b1e8d736e8b48aeb0d9 SHA512 c6d2c74ed14e5375c0a19b45a9beb945d3bdfe3f1a02e97d8f5b5d6008b87e5a94305249bf051aa122480df8488d874b2abd1fa35e373d5c415d99af3589050f WHIRLPOOL a77caf91c0d83dc00c9a88abbb93cf4be603a3f94e76c66864172d01ddfbcd28d04df92f5dbea5c581ca8d9143a0f9c5a66fc59ae9c575a34a19c04e985df813
+AUX encfs-1.7.4-r68:69.patch 787 SHA256 33d7019e74bba6b3efdb3594d5fc773804436ea263416c73d60f63e61dd823fe SHA512 9a94af359a12c4b293e26dfe9ca55d43db8e82e1166edc7316ed592d8be5cc41046c0f6a165ca15dc5a7a9204c5d4265a9faf30be27c1d1639969bf22818599a WHIRLPOOL 6ba3741ef6e0918e3ec23e2cfc024e8be02751da06eeaa828c0d6ddb4af11daff5584e64e7bc761e2d877130271ce70071abe6b799f912a72a63f48b8182f65a
+DIST encfs-1.7.4.tgz 931048 SHA256 282ef0f04f2dd7ba3527b45621fab485b7cc510c2ceee116600d0348dc2170a8 SHA512 323db9a9e7b3bc76902e0aefc6cad34974be27586651b21cc3e0550999a6313b997ad06d05a659dd7112a1f499cb60a547837d40f6a1547c9551c28ef765beaf WHIRLPOOL 7eafc12b47d5820fbcbefb45156ed3fe78aadc6d93b6f9f49ca7c5ffe8169dd8d63410d05a9249dba87bc31c0c1c504de29efdef2c89cc5b5404fb5ee5a70914
+EBUILD encfs-1.7.4-r99.ebuild 1051 SHA256 11123fff7dd23e23c424ce85b4b1f1daae9d79e0a5004deca86163df1558447e SHA512 7412cb0d002a0d53108269c2f83e471f87fce70b9e7a9d8a5f215827b8c8f4cf4fcbca3de6688b6453a36899261ed1d8bb8c89dde44b9a1a787a5a51637d637c WHIRLPOOL 821683fb533b7e1be48e8013f986f6532b21c4fbb6a53cf71876d1d58e88dc94231760a37bae19bfc5e165043ec6a12b7ab3c657a0cf3463c87db5484b515a36
+MISC metadata.xml 313 SHA256 abe6b6fece5704f3a514740324c6d3bc9a77959f4a61be0888d3115a5def3bd7 SHA512 a0dca7552f2b432de4b6520ff39688fafb87243b9b3a8458958b2db4669d6a6061628dd4a7e75cd195b357f7220c83b104b9779abfd1f3ff0fd2da86e0c581bc WHIRLPOOL 0ebf3e41f00ea50f329eade3a499a6caace811dba0af84e817a5527270b661d6dd1b6b8a2b468323d40613e688f06b80487c37a583e39341441fc7c34e947833
diff --git a/sys-fs/encfs/encfs-1.7.4-r99.ebuild b/sys-fs/encfs/encfs-1.7.4-r99.ebuild
new file mode 100644
index 00000000..ac968342
--- /dev/null
+++ b/sys-fs/encfs/encfs-1.7.4-r99.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/encfs/encfs-1.7.4.ebuild,v 1.6 2012/10/31 23:14:20 flameeyes Exp $
+
+EAPI=2
+inherit eutils multilib
+
+DESCRIPTION="An implementation of encrypted filesystem in user-space using FUSE"
+HOMEPAGE="http://www.arg0.net/encfs/"
+SRC_URI="http://encfs.googlecode.com/files/${P}.tgz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="xattr"
+
+RDEPEND=">=dev-libs/boost-1.34
+ >=dev-libs/openssl-0.9.7
+ >=dev-libs/rlog-1.4
+ >=sys-fs/fuse-2.7.0
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ virtual/pkgconfig
+ xattr? ( sys-apps/attr )
+ sys-devel/gettext"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.7.4-r68:69.patch
+ epatch "${FILESDIR}"/${PN}-1.7.4-encfsctl.patch
+}
+
+src_configure() {
+ use xattr || export ac_cv_header_attr_xattr_h=no
+
+ econf \
+ --disable-dependency-tracking
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog README
+ find "${D}" -name '*.la' -delete
+}
diff --git a/sys-fs/encfs/files/encfs-1.7.4-encfsctl.patch b/sys-fs/encfs/files/encfs-1.7.4-encfsctl.patch
new file mode 100644
index 00000000..fe111724
--- /dev/null
+++ b/sys-fs/encfs/files/encfs-1.7.4-encfsctl.patch
@@ -0,0 +1,10 @@
+--- a/encfs-1.7.4/encfs/encfsctl.cpp
++++ b/encfs-1.7.4/encfs/encfsctl.cpp
+@@ -38,6 +38,7 @@
+ #include <getopt.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <limits.h>
+ #include <fcntl.h>
+ #ifdef __FreeBSD__
+ #include <libintl.h>
diff --git a/sys-fs/encfs/files/encfs-1.7.4-r68:69.patch b/sys-fs/encfs/files/encfs-1.7.4-r68:69.patch
new file mode 100644
index 00000000..0c27095f
--- /dev/null
+++ b/sys-fs/encfs/files/encfs-1.7.4-r68:69.patch
@@ -0,0 +1,31 @@
+Index: encfs/base64.cpp
+===================================================================
+--- encfs/base64.cpp (revision 68)
++++ encfs/base64.cpp (revision 69)
+@@ -80,7 +80,7 @@
+ }
+
+ // we have at least one value that can be output
+- char outVal = work & mask;
++ unsigned char outVal = work & mask;
+ work >>= dst2Pow;
+ workBits -= dst2Pow;
+
+@@ -96,8 +96,15 @@
+ *outLoc++ = outVal;
+
+ // we could have a partial value left in the work buffer..
+- if(workBits && outputPartialLastByte)
+- *outLoc = work & mask;
++ if(outputPartialLastByte)
++ {
++ while(workBits > 0)
++ {
++ *outLoc++ = work & mask;
++ work >>= dst2Pow;
++ workBits -= dst2Pow;
++ }
++ }
+ }
+ }
+
diff --git a/sys-fs/encfs/metadata.xml b/sys-fs/encfs/metadata.xml
new file mode 100644
index 00000000..3693a6a8
--- /dev/null
+++ b/sys-fs/encfs/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>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="google-code">encfs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/fuse/Manifest b/sys-fs/fuse/Manifest
new file mode 100644
index 00000000..e73491bd
--- /dev/null
+++ b/sys-fs/fuse/Manifest
@@ -0,0 +1,6 @@
+AUX fuse-2.9.3-includes.patch 1771 SHA256 7aa45538344fb6eadc8bfaeaf04e397efd18a653d0cd3fe1266d6741f18f7dea SHA512 c15cce6095278148f45f3117575a05248e8e7074473273def7d8556f12cb04038c661300ff1fc040b0fd95a65cf03b1e0e47fcde3b5763752039aa0ecb5be27a WHIRLPOOL 7216deebc38df2dd8929bed364ad72a33084780b879d05c275c7b56f86f6eefb19defcd2bf547494ebdf599958f36d0a42ccd41ea992476acc10f22315ac9407
+AUX fuse-fbsd.init 467 SHA256 d896a80d67668246f586c6283f95f624fdbecb306408bec6f2c944601aae7273 SHA512 4d8ce71d9a025a52e8f1d7074f83fdc368fbdd4bdf65bccfdbdce214580d4051c20bdde7f61725d14c585db1dbbe0781cee2a0c73a857f1340a5b57ee920649e WHIRLPOOL 3cb757a5de22b36c6e638c612a99cad43edeac86e37a9590a3635d550ee12f404ea54734c69a7f139c1c1089d2446b37a6387f1aa264651000d50942f4a97047
+AUX fuse.init 756 SHA256 22a22c914d2a4f0fb5fc8495f4b7efcd1819efde548c9033ca612c181cd29eda SHA512 3d2765114081c8f6720ed25d7b7da4f6da5fbbb5b35760bb0a760f0bf2482abacabec63c1488d4e8cbe4f78875574607e6e46508dfe22df0869f4d2e1e91e607 WHIRLPOOL 2932da7d97b7418b5ead6c71f9e583b6ec1b47c86e763577312fd55492482c0c31677a78534301c7b541d476ee16b0eb2da981eb6723c1fdc9af338ce10c243c
+DIST fuse-2.9.3.tar.gz 572044 SHA256 0beb83eaf2c5e50730fc553406ef124d77bc02c64854631bdfc86bfd6437391c SHA512 03f43f88694ec7e039ff3579a8e76349b5a5a05872c55901fc1d9ee53dbb6b1e69f6dd0005b620f3b5ead0b14da8eeb31d46b922d10f88f4e3f830aa47e8162c WHIRLPOOL 739562e48e85326049dac0ef06653e5e6574a01dd60649e23ddc0990ea6c1979e6ce952a1e84d0776b706fbcad79eb0e1328aa35f70ba4881db9a4482d254a04
+EBUILD fuse-2.9.3-r99.ebuild 2213 SHA256 30cb8fcf62efc23e0103237920a2f17dc15b0532b9d27339aa168ce25eb0e78c SHA512 5637dd9bc6b6822aa4731e2abd21333b4574edd215183272a8b9879763b92c9e65111191b6202d1e723cad0ea636e694cc6939c92eea6f4f0f3c081ce7eaba55 WHIRLPOOL 1687f495902fa1c4aa0162edb8eca658cc0d7d30fd723a04a186187d5884a58b3721cd7dd00e7b55c7d95c347855462e3f5af65c1b21598a3dc27d4f17adeb44
+MISC metadata.xml 248 SHA256 32abf15e7c6c5b1d79352aff76413358aea37ae781534cee099c03723de657bc SHA512 b820a6d68eb09f0c3eda90fd7ed53d21afc40eb3daef875542f711b8064a5c7fc78f06462a5aa6a9a7e7d71bd82225ecaee627eb599b5c5fd563d2599cf78974 WHIRLPOOL 9187ff09bb4d8f155befdf23e5ec86740069de083eb920122ed18702a1f3a83ad9aa2e9adacd307940c9455d3b346853726f750e350be0f4f644b898e9dc3c21
diff --git a/sys-fs/fuse/files/fuse-2.9.3-includes.patch b/sys-fs/fuse/files/fuse-2.9.3-includes.patch
new file mode 100644
index 00000000..db293776
--- /dev/null
+++ b/sys-fs/fuse/files/fuse-2.9.3-includes.patch
@@ -0,0 +1,66 @@
+diff -ur a/fuse-2.9.3/lib/fuse.c b/fuse-2.9.3/lib/fuse.c
+--- a/fuse-2.9.3/lib/fuse.c
++++ b/fuse-2.9.3/lib/fuse.c
+@@ -33,6 +33,7 @@
+ #include <dlfcn.h>
+ #include <assert.h>
+ #include <poll.h>
++#include <sys/file.h>
+ #include <sys/param.h>
+ #include <sys/uio.h>
+ #include <sys/time.h>
+diff -ur a/fuse-2.9.3/lib/fuse_lowlevel.c b/fuse-2.9.3/lib/fuse_lowlevel.c
+--- a/fuse-2.9.3/lib/fuse_lowlevel.c
++++ b/fuse-2.9.3/lib/fuse_lowlevel.c
+@@ -24,6 +24,7 @@
+ #include <limits.h>
+ #include <errno.h>
+ #include <assert.h>
++#include <sys/file.h>
+
+ #ifndef F_LINUX_SPECIFIC_BASE
+ #define F_LINUX_SPECIFIC_BASE 1024
+diff -ur a/fuse-2.9.3/lib/mount.c b/fuse-2.9.3/lib/mount.c
+--- a/fuse-2.9.3/lib/mount.c
++++ b/fuse-2.9.3/lib/mount.c
+@@ -20,6 +20,7 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <paths.h>
+ #include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+diff -ur a/fuse-2.9.3/lib/mount_util.c b/fuse-2.9.3/lib/mount_util.c
+--- a/fuse-2.9.3/lib/mount_util.c
++++ b/fuse-2.9.3/lib/mount_util.c
+@@ -16,6 +16,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
++#include <paths.h>
+ #ifndef __NetBSD__
+ #include <mntent.h>
+ #endif
+diff -ur a/fuse-2.9.3/util/fusermount.c b/fuse-2.9.3/util/fusermount.c
+--- a/fuse-2.9.3/util/fusermount.c
++++ b/fuse-2.9.3/util/fusermount.c
+@@ -19,6 +19,7 @@
+ #include <getopt.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <paths.h>
+ #include <pwd.h>
+ #include <mntent.h>
+ #include <sys/wait.h>
+diff -ur a/fuse-2.9.3/util/mount_util.c b/fuse-2.9.3/util/mount_util.c
+--- a/fuse-2.9.3/util/mount_util.c
++++ b/fuse-2.9.3/util/mount_util.c
+@@ -16,6 +16,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
++#include <paths.h>
+ #ifndef __NetBSD__
+ #include <mntent.h>
+ #endif
diff --git a/sys-fs/fuse/files/fuse-fbsd.init b/sys-fs/fuse/files/fuse-fbsd.init
new file mode 100644
index 00000000..19b8400e
--- /dev/null
+++ b/sys-fs/fuse/files/fuse-fbsd.init
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need localmount
+}
+
+start() {
+ ebegin "Starting fuse"
+ if ! kldstat -q -m fuse; then
+ kldload fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module"
+ fi
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping fuse"
+ if kldstat -q -m fuse; then
+ kldunload fuse >/dev/null 2>&1 || eerror $? "Error unloading fuse module"
+ fi
+ eend ${?}
+}
diff --git a/sys-fs/fuse/files/fuse.init b/sys-fs/fuse/files/fuse.init
new file mode 100644
index 00000000..30b512e8
--- /dev/null
+++ b/sys-fs/fuse/files/fuse.init
@@ -0,0 +1,35 @@
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MOUNTPOINT=/sys/fs/fuse/connections
+
+depend() {
+ need localmount
+}
+
+start() {
+
+ ebegin "Starting fuse"
+ if ! grep -qw fuse /proc/filesystems; then
+ modprobe fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module"
+ fi
+ if grep -qw fusectl /proc/filesystems && \
+ ! grep -qw $MOUNTPOINT /proc/mounts; then
+ mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \
+ eerror $? "Error mounting control filesystem"
+ fi
+ eend ${?}
+
+}
+
+stop() {
+
+ ebegin "Stopping fuse"
+ if grep -qw $MOUNTPOINT /proc/mounts; then
+ umount $MOUNTPOINT >/dev/null 2>&1 || \
+ eerror $? "Error unmounting control filesystem"
+ fi
+ eend ${?}
+
+}
diff --git a/sys-fs/fuse/fuse-2.9.3-r99.ebuild b/sys-fs/fuse/fuse-2.9.3-r99.ebuild
new file mode 100644
index 00000000..11cacff7
--- /dev/null
+++ b/sys-fs/fuse/fuse-2.9.3-r99.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/fuse/fuse-2.9.3.ebuild,v 1.11 2014/01/18 19:54:53 ago Exp $
+
+EAPI=5
+inherit eutils libtool linux-info udev toolchain-funcs
+
+MY_P=${P/_/-}
+DESCRIPTION="An interface for filesystems implemented in userspace."
+HOMEPAGE="http://fuse.sourceforge.net"
+SRC_URI="mirror://sourceforge/fuse/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="examples kernel_linux kernel_FreeBSD static-libs"
+
+PDEPEND="kernel_FreeBSD? ( sys-fs/fuse4bsd )"
+DEPEND="virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ if use kernel_linux ; then
+ if kernel_is lt 2 6 9 ; then
+ die "Your kernel is too old."
+ fi
+ CONFIG_CHECK="~FUSE_FS"
+ FUSE_FS_WARNING="You need to have FUSE module built to use user-mode utils"
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # sandbox violation with mtab writability wrt #438250
+ # don't sed configure.in without eautoreconf because of maintainer mode
+ sed -i 's:umount --fake:true --fake:' configure || die
+ epatch "${FILESDIR}"/${PN}-2.9.3-includes.patch
+ elibtoolize
+}
+
+src_configure() {
+ econf \
+ INIT_D_PATH="${EPREFIX}/etc/init.d" \
+ MOUNT_FUSE_PATH="${EPREFIX}/sbin" \
+ UDEV_RULES_PATH="${EPREFIX}/$(get_udevdir)/rules.d" \
+ $(use_enable static-libs static) \
+ --disable-example
+}
+
+src_install() {
+ default
+
+ dodoc AUTHORS ChangeLog Filesystems README \
+ README.NFS NEWS doc/how-fuse-works \
+ doc/kernel.txt FAQ
+
+ if use examples ; then
+ docinto examples
+ dodoc example/*
+ fi
+
+ if use kernel_linux ; then
+ newinitd "${FILESDIR}"/fuse.init fuse
+ elif use kernel_FreeBSD ; then
+ insinto /usr/include/fuse
+ doins include/fuse_kernel.h
+ newinitd "${FILESDIR}"/fuse-fbsd.init fuse
+ else
+ die "We don't know what init code install for your kernel, please file a bug."
+ fi
+
+ prune_libtool_files
+ rm -rf "${D}"/dev
+
+ dodir /etc
+ cat > "${ED}"/etc/fuse.conf <<-EOF
+ # Set the maximum number of FUSE mounts allowed to non-root users.
+ # The default is 1000.
+ #
+ #mount_max = 1000
+
+ # Allow non-root users to specify the 'allow_other' or 'allow_root'
+ # mount options.
+ #
+ #user_allow_other
+ EOF
+}
diff --git a/sys-fs/fuse/metadata.xml b/sys-fs/fuse/metadata.xml
new file mode 100644
index 00000000..5cb3fdef
--- /dev/null
+++ b/sys-fs/fuse/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>kernel-misc</herd>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:fuse:fuse</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
new file mode 100644
index 00000000..0ff3eda7
--- /dev/null
+++ b/sys-fs/lvm2/Manifest
@@ -0,0 +1,30 @@
+AUX clvmd.confd-2.02.39 213 SHA256 68442d5c9da81bad79fa6b1beaede290f24ea6a4e4415f3d9f4e37ccca6c524a SHA512 9614c4188c9a5bcf398d1f521b52d7e2281fcdf76265fdaca4acda22be282d8468e82b54a2661d5753f4b9a442ebe93a60daf87c846db4e275a283f71c9fd8e2 WHIRLPOOL b429d06a5200d37f46e72190060bc2fe866575ba441b5f92d12d939bdc5d411ef37e895a7369bbaaf733b1a0d0305a05d499c7ae6c7360fe8767e902d2a3bfc4
+AUX clvmd.rc-2.02.39 3684 SHA256 476289b24539eeff4ff94c34c129da755d8cff11f1e950b40f9fad212ca5c05d SHA512 18879fa7925d6181b9ebfd7a6379ee4f25c9c83474ba69684e63811867754b1c52dd6568324aafd9fe391fd2fd4aadf931870cefc21b72d2f81f9e04ef123f41 WHIRLPOOL 095a313a6c66f0dec1d42233dd1853879ade6334c474ac747c2cd87c24b433381547a6fdecedf784db060549ece8dc24870d4981bcf590bf39e57dd7bad92120
+AUX device-mapper.conf-1.02.22-r3 15 SHA256 57777904f12a35617e5a4193c964ebb32396452487fd02353e71e16e7b46bc22 SHA512 1846e0ca1be7170d4c0beb694a23aea4d19b24b99a248bb0f4e034286a6beede0a8efc474b0c237e33ee72c86c93b6238f2d5ea23e224765acba99c90633261e WHIRLPOOL a0de185e849cd4d1aab9f145a6330f267ca547ba4ec7720be6f33e2c3c4c182b8674ea220b894f0fc806fe6637ba7bcabd739ca57b53b3efa5fad0cf1e57ba2e
+AUX device-mapper.rc-2.02.105-r2 3828 SHA256 036b6de05e6cbd921a667d6fc6b01d30c8f9b720e1a0d0e2453ecd62d32573fb SHA512 aa5c73a91a85069782384ab9ecec299d9f036ed8c069ebef66bbedfa9d9ce7c63baa70692148cf4f1b06d6b4e53fc1916ae576ecc005323154a25a686bef33fd WHIRLPOOL bebba4faf498d400c68b8e79a64c90f0b71a3df350895ea4b78efb802600f4179ec0b7507be7ca61bd7444ca8d5c8f8156112a2fa3083e51a6fe8f552db583ba
+AUX device-mapper.rc-2.02.95-r2 2765 SHA256 e0bff689040746480e2479d1ad57adb5ab23cc0415ab9a8356503aed7a14c658 SHA512 f6e653c6af92debe543bcb48ee36c2bfa0f1ad08d2dfe40455cf9d3b104a1f825a295b43de2a5fa64367c6c2eadb2b36004c7cf51fd3b15191ea6be21d0c5a4f WHIRLPOOL 298548daebf413ea8739c979c23b9ea7cfbcf12437debb8ce7d570b6a8269fbcd4d7b27816734f3728e2d591ef9658a4f4bb0c43299dbf408aeac10ef87e5bf0
+AUX dmeventd.initd-2.02.67-r1 683 SHA256 0c051388991ba69afbf2f6baf36ba227d7c26fc8f0d7588d8de76d9a74886d79 SHA512 523b54d63592c500394243632f4ed60838d04a8c386a85bb2a0fda6f756607467ec025c1490104d8c73035e37646eeea55dcafd3f05eab85e035bbedcebf0406 WHIRLPOOL 5dcf777e9c736eb4101649e5b0bbb43016c3b7ece77c1bb8afdda63b23b15a37257cdd29c05f82b0ae4f98405067c85a9a6ee8a35d98c4b5fb647ed015c11da7
+AUX dmtab 416 SHA256 e2e22bbe13fb97ec9a68659daa275b1d22fd0a3fd21e76b1f4bfba504a8bd7b5 SHA512 392b4bd85745bc774245195a1c416ae68efbe5f7b2498f6bfc40021cd2c9f6372fd1c3d346198c7749635b5d9b3f66ba1b963a2e144b4f522d87016ab4777de2 WHIRLPOOL f48c0fda382c7d57bad2ad4a8155189735236d13f24f39b3969736c3ad54d28f92c82174cae5c6775f8bc58506f19025f2cba6433f389c84505552fc8b4d3ed4
+AUX lvm-monitoring.initd-2.02.105-r2 1088 SHA256 d7655cadd3a3a9d3683a540413365310ca9503c38fd21a9bfccec40630ca72f1 SHA512 3c3f7ec1868e3634be3bb82689d30065dbe0fac3e2dfa22a14acb76c82b102022c280f995f82a1f7c91c905c0ba961bbb2707ddf60ad5fa9d717acdf942855d5 WHIRLPOOL 92e7eedf6add5cba645f74281912713928f694f18155db222352ba8e4a70ac89696f9db3cc2c9fc79fb9ff0f98cb176da8aedb1c5b7b47eecd4ee36360df41f0
+AUX lvm-monitoring.initd-2.02.67-r2 1183 SHA256 b89971a4f163e1a91df2416ff442cae7209f8343e6c8612eb3174ed8f5c5c788 SHA512 e99d8e0ed2f22e8f3f1e36581ce92bc2196dbebdeb7c301070c5f2e78079804de3ac782c732929e23a3a01536a270236513c849ec1574ff4c72045b8f69c98ed WHIRLPOOL 71eb7d1203bc2b6be22ebb0eb20e3d2e0786036bea9f0beda91c517f47b99374b52ca4c7d5cd76ae6338ddab187b68a7a371a437e5501996454e125e12e998a8
+AUX lvm.confd-2.02.28-r2 173 SHA256 28370c089c39c248d7ded0960b8d8a9256bada44d44c22ce3cec87d512ef6844 SHA512 67b153cbc5c2327c15f042b3b5590c1d8fdf9823efb19c80192ac4dcf98e530efea8ecae0aaaa4a54b0e3e4907565aa21455b364df1dbe8f2e7dffa1c5d355d0 WHIRLPOOL 06467b28ad2acf36984eef1b7b7e3d88277505760f848a808d85820cd1cccf6bb7397c00624d36961d9bdbb994e55de03444a7cfc97ecefd9bd3b785a3c6fdbf
+AUX lvm.rc-2.02.105-r2 3071 SHA256 a5754ffa0a05a0c29a9f6b5acf1b21dd313581fd6156c1ef722dc620e0114676 SHA512 9dd321b6d76628376b324de1ff47c4a37b98d3bf406abbf1b1755e20d957a9f1d77ff2e50a99b0c77ca8200800cd6071da5ab83c2f5afb9ff97f31e75671a617 WHIRLPOOL 6ba25a5152bf6f5052481e6ad2b1dc3ea65a818d11bff49e9688f537245c471f5446d4b8d381dba69ab8ece8f16340220f4c8173be096c7cb3d7c4c7fd10cebd
+AUX lvm.rc-2.02.95-r2 3001 SHA256 66844a70cedf61b2cd3373cdbd8f8c1afa817bde0764fdf5cf488857532d4553 SHA512 e5d34447db2fc050256222eff427703341b839a80c833c8ca2a814663b790bdffad967fa41bda8c182d5217dda629057a571520cb0a2e4cb06d5a8a241746ea3 WHIRLPOOL 102baf82bd5573ce90bdb19307ccf71026b6e03fd9e471a123f17072e0ac3785ecf017bb2cd81adf7a5332f33b42330e7c484c8804ed57d4ad6fb1cdd4c119f7
+AUX lvm2-2.02.100-selinux_and_udev_static.patch 3223 SHA256 15c20b1e16443932c560164ad9546ab01279601b0f0dd7fdc54f9cf3cd3ffee3 SHA512 232dc2908073254e23878098734cc65449c7be0707f7f0f7e73561e7b204bf71cf75ff5ee143b0f9f301ddabac1595c59cb0ec80c665464e8fe3f1b65a3eb0c2 WHIRLPOOL fdd908aa01cc3790be4ff8e7b2180cd526065c826657924edfccdc53f5c2266a12911c1ebface9de649b1974ff77401e94a64de507b5c72415614e5726dd4a2a
+AUX lvm2-2.02.106-pthread-pkgconfig.patch 860 SHA256 aaf04bdb140cbedebe731a04846cbb7459cdd002ee4616a3d0725136edb5ef02 SHA512 ae073936ee15fdeabde4d3948a65f6a435b82e62aa0ddadbad399b69bd5c9bfc181d5e0be1beae9f6e899a6e8b9d7c21add13f7a1606cb5ed4762ed5aa5aa223 WHIRLPOOL 9e822f0f1c7c67b5443fb9e62547a1893d8c91f91d63f03c9f4b3d9a20cd24c377f5697f2fe24028f10949550af6f2a05d95db6d5e29700dfaa05f1c3d615773
+AUX lvm2-2.02.107-static-pkgconfig-libs.patch 3607 SHA256 b3efe76e670fd45e363c62bc8a9965eff4bb1c12e98b6eebdf3b8690de24ddca SHA512 6cd6bbe2ff2dbbe012c20043f3b31e42cacc3379838358c58891ec8ce9593ced29a14fbb9e96b9c76e1b245c5aec2e38a26d3a599c78ff18c3d920e89f1d2f72 WHIRLPOOL 4acf0777694df20886b4e6bf06c91a86041f6e4d888c49dc26f582cd6220504550f54ea5d94c220a3a16b4768933e45e901f274dfaf616083db741aab81b612b
+AUX lvm2-2.02.108-example.conf.in.patch 1681 SHA256 c9e0b46965f68c25495e21ca9504699031ed88dbb69407a08d53569ddc88ae4c SHA512 b4e983892b7ff47e5e7617376197daa62cfd063cf398235dc4a436fd9025ec4b1e263d7418e2c2943d53be494cba4209e9d4230d54a78762b0ca526f92e9746c WHIRLPOOL 0fc73d8e6f47596fa1789118aefebf931fb217342259da838d701bdeb96f21d7de59f29ac81c3c0f4a00db711e86b9fac6b4c889cf05ffc90ad8fd5a9ef77cd1
+AUX lvm2-2.02.108-static-pkgconfig-libs.patch 3302 SHA256 5cbdb4c4db1a77767a8cf3a89490eb0e21a2d4cc7729a8ffb099e4d0746e2775 SHA512 246f1029f9346d6bc57c2062c8a223535d0b832fa6bd86947b8b91b094dbc388706a9914f9ca0531666f77e73544612e2819335435b7576b4e91cdb1b0e4f041 WHIRLPOOL 53e723bdcfe07f668abf6fe9e6093ae38d81b01bd10ade0b40a037d44c367a6945ed86d14d70c2af8af6e7063763fd3620591b5c7384bd255b98cceb7ee192f3
+AUX lvm2-2.02.56-lvm2create_initrd.patch 2032 SHA256 b892d0544e05350e78ea400c16e6fd3657671d9bdf50bfae70505fd79bdda081 SHA512 b2a1705fa6b962027ebc5047583547489afe8ef8d8977c6284a28d0a8b0e05e20e6c48bd6c02a8bb02de9cfb40ac2d6e2a4b8ed8ef8c4ae7b6ea9a29bc4194de WHIRLPOOL cb533df528be0aae4bf50966285ef7a238f810d955ee86d5b446f43944d093732eff6ef8178d1654c4a2c075049ffc11994a99de6291bab1140cb8812be8b8a0
+AUX lvm2-2.02.63-always-make-static-libdm.patch 1420 SHA256 1c498b5efce77ed16bbbfcd9e0ec6da404a9c70c7ad0959ed7b60733adfcfc21 SHA512 67735af9e51369d5b3b400cab4f9ffa25f8dea1c1ec3d01855cb3c5aeade5c39a35eeed43f3a665204fe6bbba4ca43baecd845330bf26d023064b94ca3d1317c WHIRLPOOL f273c893acedfd658e7947abb5f4b528f15de9808ae3862ec8a9189ba7de4ea6998dc67dbc7af642ca3a27bba2ef8eabfd48337f532145f88500988f564313b1
+AUX lvm2-2.02.67-createinitrd.patch 660 SHA256 d59f5642fff9d9575227bfd0b3d103d928a6f7b08b417d6c458704171f11da39 SHA512 17fbba5d34ece5c1c25ef35fa3bbc3d6fcd20b44bd766c049bbc120853a8d60c9544db5790645a7814db5c272fd12d383699a8a9be6f4e9c56a7c0a1bb29ade2 WHIRLPOOL b358a31a9ee669a4fccf42280da5342c214932bfd83deee92d41351eb37dc6c0b2e5dc7419f2304128b5d285fed92db5b2e1634a71bbf1310d36b54d1a353bb0
+AUX lvm2-2.02.70-asneeded.patch 326 SHA256 b0f84dadc213a9daaa97ae7815f624f0bcdc883d627659c7fcf8b7131538b43e SHA512 e38d8ef5d13c8861f7d1ca5c16271b3da138e8747ba01442de3f55aab45265fdaf42513e596f5af1d024fa2cf0c959bd3e47da52bbe8b13c75e665dd95f81279 WHIRLPOOL 77143f2dafeca221f8b3cda4df1669111de44a4ae4916d9aa2228aa76d94b4d1c556cf90a6f90cae2f1938f7474fb678ec6eab1b4e57f7fd20eab473de667cda
+AUX lvm2-2.02.92-dynamic-static-ldflags.patch 3031 SHA256 90b880572186d4d1abf049d39e5f11e4cfedb3707c29eeb9740ceccdb3b62468 SHA512 edb78081d12bebaccd31c2474cb531563b729f1ad966afaff7892556177ee7a68217cc699c65383318066139ba62183adc8334f46f8f8933d62b6b5dcd11a023 WHIRLPOOL 6880a29dfb6747f167c41506e1472c0d48ef7af3a545238c733949f85f3f8f36110fb6908c6f626260f7ed975e56a4e8ccf42ece4d758fa3570154cbe970f2a3
+AUX lvm2-2.02.99-example.conf.in.patch 1489 SHA256 55273a2bc6df33057f4efdd947b75f0282a7993acd5e57f0019f8ca57ca7df38 SHA512 0c92a0e454505219653500d4fb2ee57626bb30375782be941bda17d7b841cb05eeebb87bfc4f7aa397b26fb4908bcbd0f69d2c07e63bf4f070756a1894851869 WHIRLPOOL 3f6c94dd63fcf5e2d1406aa074aee27997fa6d58da3db9d22281b3080ec36277bc5225c3b62f042b38f5d0870fb1e3e19433f218f01e03323c7ad1210d45d4b3
+AUX lvm2-2.02.99-locale-muck.patch 395 SHA256 14e7c65fd9aa71b7f09cc1aecfaccb3048dbb09dd4eb4c342556708aa6adba77 SHA512 4014abbaeb1106dbaa360e2573340651adc0cccc6c0c05cc57695e74e7a3d0b5a73e2b72242bab0d0a10c2506a7c30c2a4de0275c0f81a14dfb068ec91492497 WHIRLPOOL 3383e94ca4dbaefd2c628d3a95b17a14602481c98425caf48f490185289eb3f1af2ef234ff5b5c431ea4624edd8e48764252bdf5b7159ab3bbbad699c3f936ab
+AUX lvm2-fix-stdio-usage.patch 3666 SHA256 79c5379cbf660f8dabd45359463c77a40b5a83153b54c67ce36049260dac9071 SHA512 c4d55b366a60926baadf431dd382012eb808490c0bb514e01503d526cfd7ae573efa2d60a92bd5f6f451b54b11fb5cf827f45cec35cfcdee6aa291674cc776dd WHIRLPOOL 48be6a1205c2293fda51bb8b103db0eebe4b28794a6983c910e5761bb50712da4552eb339a485258f0f79032e10aa7589f65411de282f83ab910881c52a356ed
+AUX lvm2-musl-fixes.patch 1537 SHA256 6516f64faeccaf87641f7c29823344baea0f3af9ac14701e98fa768cbccb703d SHA512 87bd64a0c7525cbf5d49f1fbdd4a86f23bade065362580a1f2ef3b73b5e76e865e620800c922aa6819ace78daf3d4e2ce96b7990c63dcdbf504d03e636d26c00 WHIRLPOOL 9aeabec1f8b0e3487cad583e359c729b5c45ecbc426b48c19260d1f3a8e377fe5e8f09297d893dc2588b9ee11537148558a372c029ac84c02282011cc07440fe
+AUX lvmetad.initd-2.02.105-r2 405 SHA256 60accb4b6114753232f2db0adf3fc3f46d4459bfedf79b888801a13c55d79fa9 SHA512 d9c6f6c68a83b8f391ded7ebe900009a61ff06e92eb68ccb3dcdc8f41e61bbcdf47246e523ea8cfd6e71790376b316b219d4afaf66cf11477e2b54d526b74998 WHIRLPOOL d959d8c8b5f4ef84c26f8e585fe1761ef9bfd37f590e783e937679a863982e7cc4a4e320c3e2e3bd635dbd3486c15baf7c24e1a21325521f4320e643a57fb0e7
+DIST LVM2.2.02.110.tgz 1487448 SHA256 3dad1aa04a71b8420b15f44c53f041001436539d3f8073490c2d0c52f6fecd11 SHA512 5b4dfa5ed877d34efa5b109dc712e8fa9154b4954b267b0243f1925f9d2fa8c67f4ce8da36a85f3bba6c117f6153fdbf150e3753587ab90584a86d2654dc0812 WHIRLPOOL ea221ed3e9d3f79009d7c341a7a75b52eacc5be79e28f2498e7cdc0f4a97c2bebff405b032eb8086d3b5b5aaf79da2f281c5734562355bddbe6004058e114ced
+EBUILD lvm2-2.02.110-r99.ebuild 9477 SHA256 0005f0d2e3c85c7d00648fd7c56526564fc6cabcfd17fbfe495035a2de0024cf SHA512 e170af6ee4b8b9b1ac31ae67abe04736e36d1e0550f4f4689665fa895b77879d5ec23621e9afdc3c9e74d3ac691ca999968f2379744694c8ada021d67bae935c WHIRLPOOL 58549bf7414360770fff8050ce777c1af382333be2700f8206eb9bec0a413750579d7815c7e8bd15cc0306106eb17105d5230c4423ee6a413d6beb7aaeddeaaf
+MISC metadata.xml 995 SHA256 a2be36b695dab8ef65772af8d808cdc7a5c5855e2c9104060e7232e21b984216 SHA512 642abe2a196ffeaf3a67530befa8dc123f1e3e1238bf55d38c0affea82ab5b2f9e56da6b303410845c625494a59323ac8570f40e0f8a406db76295059958361a WHIRLPOOL cba3a6dd12fafc4719050082ee740d03ef0ed68e074b556a0c1f15f4a7b328d9b826d2b7ab3d3f19546de92e907a3fd466792db67423cb8630d5313154d5b6f2
diff --git a/sys-fs/lvm2/files/clvmd.confd-2.02.39 b/sys-fs/lvm2/files/clvmd.confd-2.02.39
new file mode 100644
index 00000000..57821709
--- /dev/null
+++ b/sys-fs/lvm2/files/clvmd.confd-2.02.39
@@ -0,0 +1,9 @@
+# CLVMD_CLUSTER_TIMEOUT -- amount of time to wait for cluster quorum.
+
+CLVMD_CLUSTER_TIMEOUT=30
+
+
+# CLVMD_NODES_TIMEOUT -- amount of time to wait for the other nodes to
+# join the cluster.
+
+CLVMD_NODES_TIMEOUT=60
diff --git a/sys-fs/lvm2/files/clvmd.rc-2.02.39 b/sys-fs/lvm2/files/clvmd.rc-2.02.39
new file mode 100755
index 00000000..96476236
--- /dev/null
+++ b/sys-fs/lvm2/files/clvmd.rc-2.02.39
@@ -0,0 +1,146 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/clvmd.rc-2.02.39,v 1.3 2013/04/09 11:00:26 ssuominen Exp $
+
+[ -x /usr/sbin/clvmd ] && CLVMD_BIN="/usr/sbin/clvmd" || CLVMD_BIN="/sbin/clvmd"
+
+[ -z "$CLVMD_CLUSTER_TIMEOUT" ] && CLVMD_CLUSTER_TIMEOUT=30
+[ -n "$CLVMD_NODES_TIMEOUT" ] || CLVMD_NODES_TIMEOUT=60
+
+VGCHANGE="/sbin/vgchange"
+VGSCAN="/sbin/vgscan"
+VGDISPLAY="/sbin/vgdisplay"
+CLVMD_PIDFILE="/var/run/clvmd.pid"
+
+depend() {
+ use net dns logger dmeventd
+ need cman
+}
+
+load_modules() {
+ local module modules
+ modules=$1
+
+ for module in ${modules}; do
+ ebegin "Loading ${module} kernel module"
+ modprobe ${module}
+ eend $? "Failed to load ${module} kernel module"
+ done
+}
+
+unload_modules() {
+ local module modules
+ modules=$1
+
+ for module in ${modules}; do
+ ebegin "Unloading ${module} kernel module"
+ modprobe -r ${module}
+ eend $? "Failed to unload ${module} kernel module"
+ done
+}
+
+umount_gfs_filesystems() {
+ local sig retry
+ local remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
+
+ if [ -n "${remaining}" ]
+ then
+ sig=
+ retry=3
+ while [ -n "${remaining}" -a "${retry}" -gt 0 ]
+ do
+ if [ "${retry}" -lt 3 ]
+ then
+ ebegin "Unmounting GFS filesystems (retry)"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems this retry"
+ else
+ ebegin "Unmounting GFS filesystems"
+ umount ${remaining} &>/dev/null
+ eend $? "Failed to unmount GFS filesystems"
+ fi
+ remaining="$(awk '$3 == "gfs" { print $2 }' /proc/mounts | sort -r)"
+ [ -z "${remaining}" ] && break
+ /bin/fuser -k -m ${sig} ${remaining} &>/dev/null
+ sleep 5
+ retry=$((${retry} -1))
+ sig=-9
+ done
+ fi
+}
+
+
+start_volumes() {
+ ebegin "Scanning LVM volumes"
+ $VGSCAN > /dev/null 2>&1
+ eend $?
+
+ ret=$?
+ if [ "$ret" -eq 5 ]
+ then
+ einfo " Waiting for other nodes to join the cluster ($CLVMD_NODES_TIMEOUT seconds)"
+ fi
+
+ clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
+ for vg in $clustervgs; do
+ ebegin " Activating Clustered VG: ${vg} "
+
+ wait=0
+ while [ -n "$($VGCHANGE -a y ${vg} 2>&1 |grep "clvmd not running")" ]; do
+ if [ $wait -lt $CLVMD_NODES_TIMEOUT ]; then
+ sleep 3
+ wait=$(($wait + 3))
+ else
+ eend 1
+ fi
+ done
+ eend 0
+ done
+}
+
+stop_volumes() {
+ # Deactivate only clustered volumes
+ clustervgs=`$VGDISPLAY 2> /dev/null | awk 'BEGIN {RS="VG Name"} {if (/Clustered/) print $1;}'`
+ for vg in $clustervgs; do
+ ebegin " Shutting Down Clustered VG: ${vg} "
+ $VGCHANGE -anl ${vg} >/dev/null
+ eend $?
+ done
+}
+
+
+start() {
+ local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/{modules,devices})
+
+ if [ -z "${module}" ]; then
+ load_modules "dm-mod"
+ sleep 1s
+ fi
+
+ ebegin "Starting clvmd ($CLVMD_CLUSTER_TIMEOUT seconds)"
+
+ start-stop-daemon --start --quiet --exec ${CLVMD_BIN} -- -T ${CLVMD_CLUSTER_TIMEOUT}
+ eend $?
+
+ start_volumes
+}
+
+stop() {
+
+ # umount GFS filesystems
+ umount_gfs_filesystems
+
+ #stop_volumes
+
+ ebegin "Stopping clvmd"
+ #start-stop-daemon --stop -s TERM --quiet --exec ${CLVMD_BIN} --name clvmd
+ killall -TERM ${CLVMD_BIN} >/dev/null
+ eend $?
+
+ #local module=$(awk '$1 == "dm_mod" { print $1 }' /proc/modules)
+
+ #if [[ "$?" -eq 0 && ! -z "${module}" ]]; then
+ # unload_modules "dm-mod"
+ #fi
+}
diff --git a/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 b/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3
new file mode 100644
index 00000000..bc7a2515
--- /dev/null
+++ b/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3
@@ -0,0 +1 @@
+RC_AFTER="lvm"
diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2 b/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
new file mode 100644
index 00000000..56e75037
--- /dev/null
+++ b/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2
@@ -0,0 +1,147 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ before dmeventd checkfs fsck
+ after modules
+}
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+# char **build_dmsetup_command(volume)
+#
+# Returns complete dmsetup command given single volume name
+build_dmsetup_command() {
+ local count dmsetup_cmd
+
+ # Number of lines mentioning volume name
+ count=$(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | grep -c ${1})
+
+ # If there's just one line:
+ if [ ${count} -eq 1 ] ; then
+ echo "echo $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk '{$1=""; print $0}') | /sbin/dmsetup create ${1}"
+
+ # For all cases with more lines:
+ elif [ ${count} -gt 1 ] ; then
+ for c in $( seq 1 ${count} ) ; do
+ if [ ${c} -eq 1 ] ; then
+ # Heavy escaping in awk-statement because we cannot use apostrophes
+ dmsetup_cmd="echo -e $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
+ else
+ # Append starting with newline
+ dmsetup_cmd="${dmsetup_cmd}\\\\n \
+ $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})"
+ fi
+ done
+ echo "${dmsetup_cmd} | /sbin/dmsetup create ${1}"
+ fi
+
+ return 0
+}
+
+# char **get_new_dm_volumes(void)
+#
+# Return unique volumes from /etc/dmtab
+get_new_dm_volumes() {
+ local volume
+
+ # Filter comments and blank lines
+ grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ awk '{ print $1 }' | \
+ uniq | \
+ while read volume ; do
+ # If it exists, skip it
+ dmvolume_exists "${volume%:}" && continue
+
+ echo "${volume%:}"
+ done
+
+ return 0
+}
+
+# int dmvolume_exists(volume)
+#
+# Return true if volume exists in DM table
+dmvolume_exists() {
+ local x line volume=$1
+
+ [ -z "${volume}" ] && return 1
+
+ /sbin/dmsetup ls 2>/dev/null | \
+ while read line ; do
+ for x in ${line} ; do
+ # the following conditonal return only breaks out
+ # of the while loop, as it is running in a pipe.
+ [ "${x}" = "${volume}" ] && return 1
+ # We only want to check the volume name
+ break
+ done
+ done
+
+ # if 1 was returned from the above loop, then indicate that
+ # volume exists
+ [ $? = 1 ] && return 0
+
+ # otherwise the loop exited normally and the volume does not
+ # exist
+ return 1
+}
+
+# int is_empty_dm_volume(volume)
+#
+# Return true if the volume exists in DM table, but is empty/non-valid
+is_empty_dm_volume() {
+ local table volume=$1
+
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
+}
+
+
+start() {
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ # Ensure the dirs exist for locking and running
+ checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
+
+ local x volume
+
+ if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
+ einfo " Setting up device-mapper volumes:"
+
+ get_new_dm_volumes | \
+ while read x ; do
+ [ -n "${x}" ] || continue
+
+ volume="${x##* }"
+
+ ebegin " Creating volume: ${volume}"
+ if ! eval $(build_dmsetup_command ${volume}) >/dev/null 2>/dev/null ; then
+ eend 1 " Error creating volume: ${volume}"
+ # dmsetup still adds an empty volume in some cases,
+ # so lets remove it
+ is_empty_dm_volume "${volume}" && \
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
+ else
+ eend 0
+ fi
+ done
+ fi
+}
+
diff --git a/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2 b/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2
new file mode 100644
index 00000000..9ac8cdb7
--- /dev/null
+++ b/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2
@@ -0,0 +1,111 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2,v 1.2 2013/04/09 11:00:26 ssuominen Exp $
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ before dmeventd checkfs fsck
+ after modules
+}
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+# char **get_new_dm_volumes(void)
+#
+# Return dmsetup commands to setup volumes
+get_new_dm_volumes() {
+ local volume params
+
+ # Filter comments and blank lines
+ grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
+ while read volume params ; do
+ # If it exists, skip it
+ dmvolume_exists "${volume%:}" && continue
+ # Assemble the command to run to create volume
+ echo "echo ${params} | /sbin/dmsetup create ${volume%:}"
+ done
+
+ return 0
+}
+
+# int dmvolume_exists(volume)
+#
+# Return true if volume exists in DM table
+dmvolume_exists() {
+ local x line volume=$1
+
+ [ -z "${volume}" ] && return 1
+
+ /sbin/dmsetup ls 2>/dev/null | \
+ while read line ; do
+ for x in ${line} ; do
+ # the following conditonal return only breaks out
+ # of the while loop, as it is running in a pipe.
+ [ "${x}" = "${volume}" ] && return 1
+ # We only want to check the volume name
+ break
+ done
+ done
+
+ # if 1 was returned from the above loop, then indicate that
+ # volume exists
+ [ $? = 1 ] && return 0
+
+ # otherwise the loop exited normally and the volume does not
+ # exist
+ return 1
+}
+
+# int is_empty_dm_volume(volume)
+#
+# Return true if the volume exists in DM table, but is empty/non-valid
+is_empty_dm_volume() {
+ local table volume=$1
+
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
+}
+
+
+start() {
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ # Ensure the dirs exist for locking and running
+ checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm
+
+ local x volume
+
+ if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
+ einfo " Setting up device-mapper volumes:"
+
+ get_new_dm_volumes | \
+ while read x ; do
+ [ -n "${x}" ] || continue
+
+ volume="${x##* }"
+
+ ebegin " Creating volume: ${volume}"
+ if ! eval "${x}" >/dev/null 2>/dev/null ; then
+ eend 1 " Error creating volume: ${volume}"
+ # dmsetup still adds an empty volume in some cases,
+ # so lets remove it
+ is_empty_dm_volume "${volume}" && \
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
+ else
+ eend 0
+ fi
+ done
+ fi
+}
+
diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1 b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
new file mode 100644
index 00000000..3c2f5f32
--- /dev/null
+++ b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1,v 1.3 2014/02/08 21:17:46 robbat2 Exp $
+
+PIDFILE=/run/dmeventd.pid
+BIN=/sbin/dmeventd
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ after lvm device-mapper
+}
+
+start() {
+ ebegin "Starting dmeventd"
+ start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dmeventd"
+ start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
+ eend $?
+}
+
diff --git a/sys-fs/lvm2/files/dmtab b/sys-fs/lvm2/files/dmtab
new file mode 100644
index 00000000..5fc1d793
--- /dev/null
+++ b/sys-fs/lvm2/files/dmtab
@@ -0,0 +1,12 @@
+#/etc/dmraid: config file for adding device-mapper volumes at boot
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmtab,v 1.1 2009/04/09 23:00:10 caleb Exp $
+
+# Format: <volume name>: <table>
+# Example: isw0: 0 312602976 striped 2 128 /dev/sda 0 /dev/sdb 0
+#
+# Alternatively you can create all your volumes the first time, and just run:
+#
+# dmsetup table >> /etc/dmtab
+#
+# and verify that they are correct.
+
diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
new file mode 100644
index 00000000..c53a6046
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
+
+# This script is based on upstream file
+# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ need lvm dmeventd
+}
+
+VGCHANGE=/sbin/vgchange
+VGS=/sbin/vgs
+
+start() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+ ebegin "Starting LVM monitoring for VGs ${VGSLIST}:"
+ $VGCHANGE --monitor y --poll y ${VGSLIST}
+ ret=$?
+ eend $ret
+ return $ret
+
+}
+
+stop() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name --rows 2> /dev/null`
+ ebegin "Stopping LVM monitoring for VGs ${VGSLIST}:"
+ $VGCHANGE --monitor n ${VGSLIST}
+ ret=$?
+ eend $ret
+ return $ret
+}
diff --git a/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2 b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2
new file mode 100644
index 00000000..6a41bb60
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm-monitoring.initd-2.02.67-r2,v 1.4 2013/04/09 11:00:26 ssuominen Exp $
+
+# This script is based on upstream file
+# LVM2.2.02.67/scripts/lvm2_monitoring_init_red_hat.in
+
+depend() {
+ # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
+ # means dmeventd is NOT notified, as it cannot be safely running
+ need lvm dmeventd
+}
+
+VGCHANGE=/sbin/vgchange
+VGS=/sbin/vgs
+
+start() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
+ for vg in $VGSLIST
+ do
+ ebegin "Starting LVM monitoring for VG $vg:"
+ $VGCHANGE --monitor y --poll y $vg
+ ret2=$?
+ eend $ret2
+ [ $ret2 -ne 0 ] && ret=$ret2
+ done
+ return $ret
+}
+
+stop() {
+ ret=0
+ # TODO do we want to separate out already active groups only?
+ VGSLIST=`$VGS --noheadings -o name 2> /dev/null`
+ for vg in $VGSLIST
+ do
+ ebegin "Stopping LVM monitoring for VG $vg:"
+ $VGCHANGE --monitor n $vg
+ ret2=$?
+ eend $ret2
+ [ $ret2 -ne 0 ] && ret=$ret2
+ done
+ return $ret
+}
diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2 b/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
new file mode 100644
index 00000000..2fbd8668
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
@@ -0,0 +1,5 @@
+# LVM should normally only be started after mdraid is available
+# this is because LVM physical volumes are very often MD devices.
+RC_AFTER="mdraid"
+
+# vim: ft=gentoo-conf-d
diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.105-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
new file mode 100644
index 00000000..7fdf50e1
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.105-r2
@@ -0,0 +1,97 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm.rc-2.02.105-r2,v 1.1 2014/02/02 19:52:34 robbat2 Exp $
+
+depend() {
+ before checkfs fsck
+ after modules device-mapper
+ need lvmetad sysfs
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+# Stop LVM2
+if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ln ${VGS}\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed (possibly some LVs still needed for /usr or root)"
+ fi
+
+ einfo "Finished shutting down the Logical Volume Manager"
+ return 0
+fi
+}
+
+# vim:ts=4
diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.95-r2 b/sys-fs/lvm2/files/lvm.rc-2.02.95-r2
new file mode 100644
index 00000000..76d90f33
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.95-r2
@@ -0,0 +1,96 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm.rc-2.02.95-r2,v 1.2 2013/04/09 11:00:26 ssuominen Exp $
+
+depend() {
+ use dmeventd
+ before checkfs fsck
+ after dmeventd modules device-mapper
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
+
+start() {
+ # LVM support for /usr, /home, /opt ....
+ # This should be done *before* checking local
+ # volumes, or they never get checked.
+
+ # NOTE: Add needed modules for LVM or RAID, etc
+ # to /etc/modules.autoload if needed
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+ if [ -z "${CDBOOT}" ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc ; then
+ ebegin "Setting up the Logical Volume Manager"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}pvscan\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgscan --mknodes\n"
+ # And turn them on!
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ly\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed to setup the LVM"
+ fi
+ fi
+}
+
+stop() {
+ for lvm_path in /bin/lvm /sbin/lvm ; do
+ [ -x "$lvm_path" ] && break
+ done
+ if [ ! -x "$lvm_path" ]; then
+ eerror "Cannot find lvm binary in /sbin or /bin!"
+ return 1
+ fi
+# Stop LVM2
+if [ -x /sbin/vgs ] && \
+ [ -x /sbin/vgchange ] && \
+ [ -x /sbin/lvchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ] && \
+ [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
+then
+ einfo "Shutting down the Logical Volume Manager"
+
+
+ VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix 2> /dev/null)
+
+ if [ "$VGS" ]
+ then
+ ebegin " Shutting Down LVs & VGs"
+ #still echo stderr for debugging
+ lvm_commands="#! ${lvm_path} --config '${config}'\n"
+ # Extra PV find pass because some devices might not have been available until very recently
+ lvm_commands="${lvm_commands}lvchange --sysinit -a ln ${VGS}\n"
+ # Now make the nodes
+ lvm_commands="${lvm_commands}vgchange --sysinit -a ln\n"
+ # Order of this is important, have to work around dash and LVM readline
+ printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
+ eend $? "Failed"
+ fi
+
+ einfo "Finished Shutting down the Logical Volume Manager"
+fi
+}
+
+# vim:ts=4
diff --git a/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch b/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch
new file mode 100644
index 00000000..d6c8e5fd
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.100-selinux_and_udev_static.patch
@@ -0,0 +1,93 @@
+diff -ur LVM2.2.02.100.orig/configure.in LVM2.2.02.100/configure.in
+--- LVM2.2.02.100.orig/configure.in 2013-08-13 13:44:43.000000000 +0300
++++ LVM2.2.02.100/configure.in 2013-09-12 23:23:19.365329440 +0300
+@@ -954,6 +954,7 @@
+ pkg_config_init
+ fi
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+
+@@ -1199,19 +1200,32 @@
+ if test x$SELINUX = xyes; then
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+- SELINUX_LIBS="-lsepol"])
++ SEPOL_LIBS="-lsepol"])
+
+- AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+- AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+- AC_CHECK_HEADERS([selinux/label.h])
+- AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++ dnl -- init pkgconfig if required
++ if test x$PKGCONFIG_INIT != x1; then
++ pkg_config_init
++ fi
++ PKG_CHECK_MODULES(SELINUX, libselinux, [
+ SELINUX_PC="libselinux"
+- HAVE_SELINUX=yes ], [
+- AC_MSG_WARN(Disabling selinux)
+- SELINUX_LIBS=
+- SELINUX_PC=
+- HAVE_SELINUX=no ])
++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ ],[
++ dnl -- old non-pkgconfig method, is buggy with static builds
++ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
++ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
++ AC_CHECK_HEADERS([selinux/label.h])
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
++ SELINUX_STATIC_LIBS="$SELINUX_LIBS"
++ SELINUX_PC="libselinux"
++ HAVE_SELINUX=yes ], [
++ AC_MSG_WARN(Disabling selinux)
++ SELINUX_LIBS=
++ SELINUX_PC=
++ HAVE_SELINUX=no ])
++ ])
+ fi
+
+ ################################################################################
+@@ -1615,6 +1629,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -1625,6 +1640,7 @@
+ AC_SUBST(THIN_DUMP_CMD)
+ AC_SUBST(THIN_REPAIR_CMD)
+ AC_SUBST(UDEV_LIBS)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+diff -ur LVM2.2.02.100.orig/make.tmpl.in LVM2.2.02.100/make.tmpl.in
+--- LVM2.2.02.100.orig/make.tmpl.in 2013-08-13 13:44:43.000000000 +0300
++++ LVM2.2.02.100/make.tmpl.in 2013-09-12 23:22:58.125328808 +0300
+@@ -32,7 +32,7 @@
+
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS += @CFLAGS@ @UDEV_CFLAGS@
+@@ -46,7 +46,9 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ TESTING = @TESTING@
+
+ # Setup directory variables
diff --git a/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch b/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch
new file mode 100644
index 00000000..594d6061
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.106-pthread-pkgconfig.patch
@@ -0,0 +1,32 @@
+Make sure that libdm usage always brings in pthread libraries, both in
+pkgconfig and during manual build.
+
+--- tools/Makefile.in
++++ tools/Makefile.in
+@@ -87,6 +87,7 @@
+ INSTALL_LVM_TARGETS += install_tools_static
+ INSTALL_DMSETUP_TARGETS += install_dmsetup_static
+ INSTALL_CMDLIB_TARGETS += install_cmdlib_static
++ STATIC_LIBS += @PTHREAD_LIBS@
+ endif
+
+ LVMLIBS = $(LVMINTERNAL_LIBS)
+@@ -118,6 +119,10 @@
+
+ include $(top_builddir)/make.tmpl
+
++ifeq ("@STATIC_LINK@", "yes")
++ STATIC_LIBS += @PTHREAD_LIBS@
++endif
++
+ device-mapper: $(TARGETS_DM)
+
+ CFLAGS_dmsetup.o += $(UDEV_CFLAGS) $(EXTRA_EXEC_CFLAGS)
+--- libdm/libdevmapper.pc.in
++++ libdm/libdevmapper.pc.in
+@@ -8,4 +8,5 @@
+ Version: @DM_LIB_PATCHLEVEL@
+ Cflags: -I${includedir}
+ Libs: -L${libdir} -ldevmapper
++Libs.private: -L${libdir} @PTHREAD_LIBS@
+ Requires.private: @SELINUX_PC@ @UDEV_PC@
diff --git a/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch
new file mode 100644
index 00000000..723cd0e2
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.107-static-pkgconfig-libs.patch
@@ -0,0 +1,104 @@
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/configure.in LVM2.2.02.107/configure.in
+--- LVM2.2.02.107.orig/configure.in 2014-07-15 12:57:55.867439868 -0700
++++ LVM2.2.02.107/configure.in 2014-07-15 17:24:02.662666091 -0700
+@@ -997,6 +997,7 @@
+ fi])
+ if test "$BLKID_WIPING" = yes; then
+ BLKID_PC="blkid"
++ BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ fi
+ fi
+@@ -1022,6 +1023,7 @@
+ if test "$UDEV_SYNC" = yes; then
+ pkg_config_init
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+
+@@ -1242,19 +1244,32 @@
+ if test "$SELINUX" = yes; then
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+- SELINUX_LIBS="-lsepol"])
++ SEPOL_LIBS="-lsepol"])
++
++ dnl -- init pkgconfig if required
++ if test x$PKGCONFIG_INIT != x1; then
++ pkg_config_init
++ fi
++ PKG_CHECK_MODULES(SELINUX, libselinux, [
++ SELINUX_PC="libselinux"
++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ ],[
++ dnl -- old non-pkgconfig method, is buggy with static builds
+
+ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ AC_CHECK_HEADERS([selinux/label.h])
+ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ SELINUX_PC="libselinux"
+ HAVE_SELINUX=yes ], [
+ AC_MSG_WARN(Disabling selinux)
+ SELINUX_LIBS=
+ SELINUX_PC=
+ HAVE_SELINUX=no ])
++ ])
+ fi
+
+ ################################################################################
+@@ -1556,6 +1571,7 @@
+ ################################################################################
+ AC_SUBST(APPLIB)
+ AC_SUBST(AWK)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BLKID_PC)
+ AC_SUBST(BLKID_WIPING)
+ AC_SUBST(BUILD_CMIRRORD)
+@@ -1651,6 +1667,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -1662,6 +1679,7 @@
+ AC_SUBST(THIN_DUMP_CMD)
+ AC_SUBST(THIN_REPAIR_CMD)
+ AC_SUBST(THIN_RESTORE_CMD)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.107.orig/make.tmpl.in LVM2.2.02.107/make.tmpl.in
+--- LVM2.2.02.107.orig/make.tmpl.in 2014-07-15 12:57:55.868439884 -0700
++++ LVM2.2.02.107/make.tmpl.in 2014-07-15 17:23:24.060055838 -0700
+@@ -44,7 +44,7 @@
+
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS += @CFLAGS@
+@@ -59,10 +59,13 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ TESTING = @TESTING@
+
+ # Setup directory variables
diff --git a/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch
new file mode 100644
index 00000000..af5a5afe
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.108-example.conf.in.patch
@@ -0,0 +1,50 @@
+Maintainer note: Forward ported without editing from lvm2-2.02.99-example.conf.in.patch to apply cleanly.
+
+--- conf/example.conf.in
++++ conf/example.conf.in
+@@ -105,6 +105,10 @@
+ # By default we accept every block device:
+ # filter = [ "a/.*/" ]
+
++ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++ # noise when you probed while not available.
++ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
++
+ # Exclude the cdrom drive
+ # filter = [ "r|/dev/cdrom|" ]
+
+@@ -522,7 +526,8 @@
+ # e.g. vgscan.lvm1 and they will stop working after you start using
+ # the new lvm2 on-disk metadata format.
+ # The default value is set when the tools are built.
+- # fallback_to_lvm1 = 0
++ # Gentoo: the LVM tools are a seperate package.
++ fallback_to_lvm1 = 0
+
+ # The default metadata format that commands should use - "lvm1" or "lvm2".
+ # The command line override is -M1 or -M2.
+@@ -1182,12 +1187,13 @@
+
+ # Metadata settings
+ #
+-# metadata {
++metadata {
+ # Default number of copies of metadata to hold on each PV. 0, 1 or 2.
+ # You might want to override it from the command line with 0
+ # when running pvcreate on new PVs which are to be added to large VGs.
+
+- # pvmetadatacopies = 1
++ # Gentoo: enable for data safety, but PV resize is then disabled.
++ # pvmetadatacopies = 2
+
+ # Default number of copies of metadata to maintain for each VG.
+ # If set to a non-zero value, LVM automatically chooses which of
+@@ -1222,7 +1228,7 @@
+ # the supplied toolset to make changes (e.g. vgcfgrestore).
+
+ # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
+-#}
++}
+
+ # Event daemon
+ #
diff --git a/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch b/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch
new file mode 100644
index 00000000..3ab69986
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.108-static-pkgconfig-libs.patch
@@ -0,0 +1,104 @@
+Maintainer note: Forward ported without editing from lvm2-2.02.107-static-pkgconfig-libs.patch to apply cleanly.
+
+--- configure.in
++++ configure.in
+@@ -1067,6 +1067,7 @@
+ fi])
+ if test "$BLKID_WIPING" = yes; then
+ BLKID_PC="blkid"
++ BLKID_STATIC_LIBS=`$PKG_CONFIG --static --libs $BLKID_PC`
+ AC_DEFINE([BLKID_WIPING_SUPPORT], 1, [Define to 1 to use libblkid detection of signatures when wiping.])
+ fi
+ fi
+@@ -1092,6 +1093,7 @@
+ if test "$UDEV_SYNC" = yes; then
+ pkg_config_init
+ PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"])
++ UDEV_STATIC_LIBS=`$PKG_CONFIG --static --libs libudev`
+ AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
+ fi
+
+@@ -1312,19 +1314,32 @@
+ if test "$SELINUX" = yes; then
+ AC_CHECK_LIB([sepol], [sepol_check_context], [
+ AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
+- SELINUX_LIBS="-lsepol"])
++ SEPOL_LIBS="-lsepol"])
++
++ dnl -- init pkgconfig if required
++ if test x$PKGCONFIG_INIT != x1; then
++ pkg_config_init
++ fi
++ PKG_CHECK_MODULES(SELINUX, libselinux, [
++ SELINUX_PC="libselinux"
++ SELINUX_STATIC_LIBS=`$PKG_CONFIG --static --libs libselinux`
++ SELINUX_LIBS="$SELINUX_LIBS $SEPOL_LIBS"
++ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
++ ],[
++ dnl -- old non-pkgconfig method, is buggy with static builds
+
+ AC_CHECK_LIB([selinux], [is_selinux_enabled], [
+ AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
+ AC_CHECK_HEADERS([selinux/label.h])
+ AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
+- SELINUX_LIBS="-lselinux $SELINUX_LIBS"
++ SELINUX_LIBS="-lselinux $SEPOL_LIBS"
+ SELINUX_PC="libselinux"
+ HAVE_SELINUX=yes ], [
+ AC_MSG_WARN(Disabling selinux)
+ SELINUX_LIBS=
+ SELINUX_PC=
+ HAVE_SELINUX=no ])
++ ])
+ fi
+
+ ################################################################################
+@@ -1626,6 +1641,7 @@
+ ################################################################################
+ AC_SUBST(APPLIB)
+ AC_SUBST(AWK)
++AC_SUBST(BLKID_STATIC_LIBS)
+ AC_SUBST(BLKID_PC)
+ AC_SUBST(BLKID_WIPING)
+ AC_SUBST(BUILD_CMIRRORD)
+@@ -1721,6 +1737,7 @@
+ AC_SUBST(SALCK_CFLAGS)
+ AC_SUBST(SALCK_LIBS)
+ AC_SUBST(SELINUX_LIBS)
++AC_SUBST(SELINUX_STATIC_LIBS)
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
+@@ -1735,6 +1752,7 @@
+ AC_SUBST(CACHE_DUMP_CMD)
+ AC_SUBST(CACHE_REPAIR_CMD)
+ AC_SUBST(CACHE_RESTORE_CMD)
++AC_SUBST(UDEV_STATIC_LIBS)
+ AC_SUBST(UDEV_PC)
+ AC_SUBST(UDEV_RULES)
+ AC_SUBST(UDEV_SYNC)
+--- make.tmpl.in
++++ make.tmpl.in
+@@ -43,7 +43,7 @@
+
+ LIBS = @LIBS@
+ # Extra libraries always linked with static binaries
+-STATIC_LIBS = $(SELINUX_LIBS) $(UDEV_LIBS) $(BLKID_LIBS)
++STATIC_LIBS = $(SELINUX_STATIC_LIBS) $(UDEV_STATIC_LIBS) $(BLKID_STATIC_LIBS)
+ DEFS += @DEFS@
+ # FIXME set this only where it's needed, not globally?
+ CFLAGS += @CFLAGS@
+@@ -57,10 +57,13 @@
+ PTHREAD_LIBS = @PTHREAD_LIBS@
+ READLINE_LIBS = @READLINE_LIBS@
+ SELINUX_LIBS = @SELINUX_LIBS@
++SELINUX_STATIC_LIBS = @SELINUX_STATIC_LIBS@
+ UDEV_CFLAGS = @UDEV_CFLAGS@
+ UDEV_LIBS = @UDEV_LIBS@
++UDEV_STATIC_LIBS = @UDEV_STATIC_LIBS@
+ BLKID_CFLAGS = @BLKID_CFLAGS@
+ BLKID_LIBS = @BLKID_LIBS@
++BLKID_STATIC_LIBS = @BLKID_STATIC_LIBS@
+ TESTING = @TESTING@
+
+ # Setup directory variables
diff --git a/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch b/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch
new file mode 100644
index 00000000..59aaa9b3
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.56-lvm2create_initrd.patch
@@ -0,0 +1,72 @@
+--- LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd.orig 2006-11-21 22:41:56.000000000 +0000
++++ LVM2.2.02.56/scripts/lvm2create_initrd/lvm2create_initrd 2009-12-26 01:47:08.025224602 +0000
+@@ -54,7 +54,9 @@
+ DEVRAM=/tmp/initrd.$$
+
+ # set defaults
+-BINFILES=${BINFILES:-"`which lvm` `which bash` `which busybox` `which pivot_root`"}
++LVM=`which lvm.static`
++LVM=${LVM:-"`which lvm`"}
++BINFILES=${BINFILES:-"${LVM} `which bash` `which busybox` `which pivot_root`"}
+ BASICDEVICES=${BASICDEVICES:-"std consoleonly fd"}
+ BLOCKDEVICES=${BLOCKDEVICES:-"md hda hdb hdc hdd sda sdb sdc sdd"}
+ MAKEDEV=${MAKEDEV:-"debian"}
+@@ -119,6 +121,10 @@
+ echo "$PRE Mounting /proc"
+ mount -t proc none /proc
+
++# We need /sys for lvm
++echo "$PRE Mounting /sys"
++mount -t sysfs sysfs /sys
++
+ # plug in modules listed in /etc/modules
+ if [ -f /etc/modules ]; then
+ echo -n "$PRE plugging in kernel modules:"
+@@ -179,26 +185,29 @@
+ # run a shell if we're passed lvm2rescue on commandline
+ grep lvm2rescue /proc/cmdline 1>/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+- lvm vgchange --ignorelockingfailure -P -a y
++ $LVM vgchange --ignorelockingfailure -P -a y
+ do_shell
+ else
+- lvm vgchange --ignorelockingfailure -a y
++ $LVM vgchange --ignorelockingfailure -a y
+ fi
+
+ echo "$PRE Mounting root filesystem $rootvol ro"
+ mkdir /rootvol
+ if ! mount -t auto -o ro $rootvol /rootvol; then
+- echo "\t*FAILED*";
++ echo "\t*FAILED TRYING TO MOUNT ROOTVOL*";
+ do_shell
+ fi
+
+ echo "$PRE Umounting /proc"
+ umount /proc
+
++echo "$PRE Umounting /sys"
++umount /sys
++
+ echo "$PRE Changing roots"
+ cd /rootvol
+ if ! pivot_root . initrd ; then
+- echo "\t*FAILED*"
++ echo "\t*FAILED PIVOT TO NEW ROOT*"
+ do_shell
+ fi
+
+@@ -356,7 +365,7 @@
+ fi
+
+ verbose "creating basic set of directories in $TMPMNT"
+-(cd $TMPMNT; mkdir bin dev etc lib proc sbin var)
++(cd $TMPMNT; mkdir bin dev etc lib proc sbin sys var)
+ if [ $? -ne 0 ]; then
+ echo "$cmd -- ERROR creating directories in $TMPMNT"
+ cleanup 1
+@@ -499,4 +508,3 @@
+ FINALTXT
+
+ cleanup 0
+-
diff --git a/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch b/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch
new file mode 100644
index 00000000..5ddcb4e5
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.63-always-make-static-libdm.patch
@@ -0,0 +1,42 @@
+diff -Nuar --exclude '*~' LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in LVM2.2.02.63/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.63.orig/daemons/dmeventd/Makefile.in 2010-04-09 14:42:48.000000000 -0700
++++ LVM2.2.02.63/daemons/dmeventd/Makefile.in 2010-04-19 11:53:27.000000000 -0700
+@@ -28,11 +28,12 @@
+ INSTALL_LIB_TARGETS = install_lib_dynamic
+
+ LIB_NAME = libdevmapper-event
++LIB_STATIC = $(LIB_NAME).a
++INSTALL_LIB_TARGETS += install_lib_static
++TARGETS += $(LIB_STATIC)
+ ifeq ("@STATIC_LINK@", "yes")
+- LIB_STATIC = $(LIB_NAME).a
+- TARGETS += $(LIB_STATIC) dmeventd.static
++ TARGETS += dmeventd.static
+ INSTALL_DMEVENTD_TARGETS += install_dmeventd_static
+- INSTALL_LIB_TARGETS += install_lib_static
+ endif
+
+ LIB_VERSION = $(LIB_VERSION_DM)
+diff -Nuar --exclude '*~' LVM2.2.02.63.orig/libdm/Makefile.in LVM2.2.02.63/libdm/Makefile.in
+--- LVM2.2.02.63.orig/libdm/Makefile.in 2010-04-09 14:42:51.000000000 -0700
++++ LVM2.2.02.63/libdm/Makefile.in 2010-04-19 11:52:20.000000000 -0700
+@@ -34,8 +34,8 @@
+
+ INCLUDES = -I$(srcdir)/$(interface) -I$(srcdir)
+
+-ifeq ("@STATIC_LINK@", "yes")
+ LIB_STATIC = $(interface)/libdevmapper.a
++ifeq ("@STATIC_LINK@", "yes")
+ endif
+
+ LIB_SHARED = $(interface)/libdevmapper.$(LIB_SUFFIX)
+@@ -63,8 +63,8 @@
+
+ INSTALL_TYPE = install_dynamic
+
+-ifeq ("@STATIC_LINK@", "yes")
+ INSTALL_TYPE += install_static
++ifeq ("@STATIC_LINK@", "yes")
+ endif
+
+ ifeq ("@PKGCONFIG@", "yes")
diff --git a/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch b/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch
new file mode 100644
index 00000000..7f0bfb89
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.67-createinitrd.patch
@@ -0,0 +1,18 @@
+X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=301331
+X-Gentoo-Bug: 301331
+
+diff -Nuar LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd
+--- LVM2.2.02.67.orig/scripts/lvm2create_initrd/lvm2create_initrd 2010-06-07 18:44:34.182980475 +0000
++++ LVM2.2.02.67/scripts/lvm2create_initrd/lvm2create_initrd 2010-06-07 18:51:27.636312899 +0000
+@@ -469,9 +469,9 @@
+ rmdir $TMPMNT/lost+found
+
+ echo "$cmd -- ummounting ram disk"
+-umount $DEVRAM
++umount $TMPMNT
+ if [ $? -ne 0 ]; then
+- echo "$cmd -- ERROR umounting $DEVRAM"
++ echo "$cmd -- ERROR umounting $TMPMNT"
+ cleanup 1
+ fi
+
diff --git a/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch b/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch
new file mode 100644
index 00000000..7576e192
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.70-asneeded.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/330255
+
+liblvm2app.so: undefined reference to `floor'
+
+--- liblvm/Makefile.in
++++ liblvm/Makefile.in
+@@ -39,7 +39,7 @@
+
+ include $(top_builddir)/make.tmpl
+
+-LIBS += $(LVMINTERNAL_LIBS) -ldevmapper
++LIBS += $(LVMINTERNAL_LIBS) -ldevmapper -lm
+
+ ifeq ("@DMEVENTD@", "yes")
+ LIBS += -ldevmapper-event
diff --git a/sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch b/sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch
new file mode 100644
index 00000000..de2b294e
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.92-dynamic-static-ldflags.patch
@@ -0,0 +1,63 @@
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/configure.in LVM2.2.02.92/configure.in
+--- LVM2.2.02.92.orig/configure.in 2012-02-20 11:36:27.000000000 -0800
++++ LVM2.2.02.92/configure.in 2012-02-20 15:53:40.700124222 -0800
+@@ -32,6 +32,7 @@
+ COPTIMISE_FLAG="-O2"
+ CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym"
+ ELDFLAGS="-Wl,--export-dynamic"
++ STATIC_LDFLAGS="-Wl,--no-export-dynamic"
+ # FIXME Generate list and use --dynamic-list=.dlopen.sym
+ CLDWHOLEARCHIVE="-Wl,-whole-archive"
+ CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive"
+@@ -1458,6 +1459,7 @@
+ AC_SUBST(SELINUX_PC)
+ AC_SUBST(SNAPSHOTS)
+ AC_SUBST(STATICDIR)
++AC_SUBST(STATIC_LDFLAGS)
+ AC_SUBST(STATIC_LINK)
+ AC_SUBST(TESTING)
+ AC_SUBST(THIN)
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/daemons/dmeventd/Makefile.in LVM2.2.02.92/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.92.orig/daemons/dmeventd/Makefile.in 2012-02-20 15:48:04.861683196 -0800
++++ LVM2.2.02.92/daemons/dmeventd/Makefile.in 2012-02-20 15:52:50.732314588 -0800
+@@ -65,7 +65,7 @@
+ $(DL_LIBS) $(LVMLIBS) $(LIBS) -rdynamic
+
+ dmeventd.static: $(LIB_STATIC) dmeventd.o $(interfacebuilddir)/libdevmapper.a
+- $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
++ $(CC) $(CFLAGS) $(LDFLAGS) $(ELDFLAGS) $(STATIC_LDFLAGS) -static -L. -L$(interfacebuilddir) -o $@ \
+ dmeventd.o $(DL_LIBS) $(LVMLIBS) $(LIBS) $(STATIC_LIBS)
+
+ ifeq ("@PKGCONFIG@", "yes")
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/make.tmpl.in LVM2.2.02.92/make.tmpl.in
+--- LVM2.2.02.92.orig/make.tmpl.in 2012-02-20 15:48:05.034685963 -0800
++++ LVM2.2.02.92/make.tmpl.in 2012-02-20 15:48:58.622550855 -0800
+@@ -38,6 +38,7 @@
+ ELDFLAGS += @ELDFLAGS@
+ LDDEPS += @LDDEPS@
+ LDFLAGS += @LDFLAGS@
++STATIC_LDFLAGS += @STATIC_LDFLAGS@
+ LIB_SUFFIX = @LIB_SUFFIX@
+ LVMINTERNAL_LIBS = -llvm-internal $(UDEV_LIBS) $(DL_LIBS)
+ DL_LIBS = @DL_LIBS@
+diff -Nuar --exclude '*.rej' --exclude '*.orig' LVM2.2.02.92.orig/tools/Makefile.in LVM2.2.02.92/tools/Makefile.in
+--- LVM2.2.02.92.orig/tools/Makefile.in 2011-11-14 13:30:36.000000000 -0800
++++ LVM2.2.02.92/tools/Makefile.in 2012-02-20 15:52:25.242901501 -0800
+@@ -126,7 +126,7 @@
+ -o $@ dmsetup.o -ldevmapper $(LIBS)
+
+ dmsetup.static: dmsetup.o $(interfacebuilddir)/libdevmapper.a
+- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) \
++ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) \
+ -o $@ dmsetup.o -ldevmapper $(STATIC_LIBS) $(LIBS)
+
+ all: device-mapper
+@@ -136,7 +136,7 @@
+ $(LVMLIBS) $(READLINE_LIBS) $(LIBS) -rdynamic
+
+ lvm.static: $(OBJECTS) lvm-static.o $(top_builddir)/lib/liblvm-internal.a $(interfacebuilddir)/libdevmapper.a
+- $(CC) $(CFLAGS) $(LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
++ $(CC) $(CFLAGS) $(LDFLAGS) $(STATIC_LDFLAGS) -static -L$(interfacebuilddir) -o $@ \
+ $(OBJECTS) lvm-static.o $(LVMLIBS) $(STATIC_LIBS) $(LIBS)
+
+ liblvm2cmd.a: $(top_builddir)/lib/liblvm-internal.a $(OBJECTS) lvmcmdlib.o lvm2cmd.o
diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch b/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch
new file mode 100644
index 00000000..38be5dfa
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.99-example.conf.in.patch
@@ -0,0 +1,47 @@
+--- conf/example.conf.in
++++ conf/example.conf.in
+@@ -50,7 +50,9 @@
+
+
+ # By default we accept every block device:
+- filter = [ "a/.*/" ]
++ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++ # noise when you probed while not available.
++ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
+
+ # Exclude the cdrom drive
+ # filter = [ "r|/dev/cdrom|" ]
+@@ -259,6 +261,8 @@
+ # the new lvm2 on-disk metadata format.
+ # The default value is set when the tools are built.
+ # fallback_to_lvm1 = 0
++ # Gentoo: the LVM tools are a seperate package.
++ fallback_to_lvm1 = 0
+
+ # The default metadata format that commands should use - "lvm1" or "lvm2".
+ # The command line override is -M1 or -M2.
+@@ -449,12 +453,12 @@
+
+ # Metadata settings
+ #
+-# metadata {
++metadata {
+ # Default number of copies of metadata to hold on each PV. 0, 1 or 2.
+ # You might want to override it from the command line with 0
+ # when running pvcreate on new PVs which are to be added to large VGs.
+-
+- # pvmetadatacopies = 1
++ # Gentoo: enable for data safety, but PV resize is then disabled.
++ #pvmetadatacopies = 2
+
+ # Approximate default size of on-disk metadata areas in sectors.
+ # You should increase this if you have large volume groups or
+@@ -476,7 +480,7 @@
+ # the supplied toolset to make changes (e.g. vgcfgrestore).
+
+ # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
+-#}
++}
+
+ # Event daemon
+ #
diff --git a/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch b/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
new file mode 100644
index 00000000..364fbd44
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.99-locale-muck.patch
@@ -0,0 +1,11 @@
+--- make.tmpl.in
++++ make.tmpl.in
+@@ -395,7 +395,7 @@
+ ( cat $(srcdir)/.exported_symbols; \
+ if test x$(EXPORTED_HEADER) != x; then \
+ $(CC) -E -P $(INCLUDES) $(DEFS) $(EXPORTED_HEADER) | \
+- $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
++ LC_ALL=C $(SED) -ne "/^typedef|}/!s/.*[ *]\($(EXPORTED_FN_PREFIX)_[a-z0-9_]*\)(.*/\1/p"; \
+ fi \
+ ) > $@
+
diff --git a/sys-fs/lvm2/files/lvm2-fix-stdio-usage.patch b/sys-fs/lvm2/files/lvm2-fix-stdio-usage.patch
new file mode 100644
index 00000000..71fa5bfa
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-fix-stdio-usage.patch
@@ -0,0 +1,111 @@
+--- LVM2.2.02.103.orig/lib/commands/toolcontext.c
++++ LVM2.2.02.103/lib/commands/toolcontext.c
+@@ -1336,7 +1336,10 @@
+ /*
+ * Close and reopen stream on file descriptor fd.
+ */
+-static int _reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
++#ifdef __GLIBC__
++#define _reopen_stream(stream, fd, mode, name) __reopen_stream(stream, fd, mode, name, &stream)
++
++static int __reopen_stream(FILE *stream, int fd, const char *mode, const char *name, FILE **new_stream)
+ {
+ int fd_copy, new_fd;
+
+@@ -1363,6 +1366,9 @@
+
+ return 1;
+ }
++#else
++#define _reopen_stream(stream, fd, mode, name) (freopen(NULL, mode, stream) != NULL)
++#endif
+
+ /* Entry point */
+ struct cmd_context *create_toolcontext(unsigned is_long_lived,
+@@ -1371,7 +1377,6 @@
+ unsigned threaded)
+ {
+ struct cmd_context *cmd;
+- FILE *new_stream;
+ int flags;
+
+ #ifdef M_MMAP_MAX
+@@ -1421,9 +1426,8 @@
+ if (is_valid_fd(STDIN_FILENO) &&
+ ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_WRONLY) {
+- if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream))
++ if (!_reopen_stream(stdin, STDIN_FILENO, "r", "stdin"))
+ goto_out;
+- stdin = new_stream;
+ if (setvbuf(stdin, cmd->linebuffer, _IOLBF, linebuffer_size)) {
+ log_sys_error("setvbuf", "");
+ goto out;
+@@ -1433,9 +1437,8 @@
+ if (is_valid_fd(STDOUT_FILENO) &&
+ ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_RDONLY) {
+- if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream))
++ if (!_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout"))
+ goto_out;
+- stdout = new_stream;
+ if (setvbuf(stdout, cmd->linebuffer + linebuffer_size,
+ _IOLBF, linebuffer_size)) {
+ log_sys_error("setvbuf", "");
+@@ -1715,7 +1718,6 @@
+ void destroy_toolcontext(struct cmd_context *cmd)
+ {
+ struct dm_config_tree *cft_cmdline;
+- FILE *new_stream;
+ int flags;
+
+ if (cmd->dump_filter && cmd->filter && cmd->filter->dump &&
+@@ -1752,8 +1754,7 @@
+ if (is_valid_fd(STDIN_FILENO) &&
+ ((flags = fcntl(STDIN_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_WRONLY) {
+- if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin", &new_stream)) {
+- stdin = new_stream;
++ if (_reopen_stream(stdin, STDIN_FILENO, "r", "stdin")) {
+ setlinebuf(stdin);
+ } else
+ cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
+@@ -1762,8 +1763,7 @@
+ if (is_valid_fd(STDOUT_FILENO) &&
+ ((flags = fcntl(STDOUT_FILENO, F_GETFL)) > 0) &&
+ (flags & O_ACCMODE) != O_RDONLY) {
+- if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout", &new_stream)) {
+- stdout = new_stream;
++ if (_reopen_stream(stdout, STDOUT_FILENO, "w", "stdout")) {
+ setlinebuf(stdout);
+ } else
+ cmd->linebuffer = NULL; /* Leave buffer in place (deliberate leak) */
+--- LVM2.2.02.103.orig/tools/lvmcmdline.c
++++ LVM2.2.02.103/tools/lvmcmdline.c
+@@ -1252,7 +1252,7 @@
+ int err = is_valid_fd(STDERR_FILENO);
+
+ if (!is_valid_fd(STDIN_FILENO) &&
+- !(stdin = fopen(_PATH_DEVNULL, "r"))) {
++ !freopen(_PATH_DEVNULL, "r", stdin)) {
+ if (err)
+ perror("stdin stream open");
+ else
+@@ -1262,7 +1262,7 @@
+ }
+
+ if (!is_valid_fd(STDOUT_FILENO) &&
+- !(stdout = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stdout)) {
+ if (err)
+ perror("stdout stream open");
+ /* else no stdout */
+@@ -1270,7 +1270,7 @@
+ }
+
+ if (!is_valid_fd(STDERR_FILENO) &&
+- !(stderr = fopen(_PATH_DEVNULL, "w"))) {
++ !freopen(_PATH_DEVNULL, "w", stderr)) {
+ printf("stderr stream open: %s\n",
+ strerror(errno));
+ return 0;
diff --git a/sys-fs/lvm2/files/lvm2-musl-fixes.patch b/sys-fs/lvm2/files/lvm2-musl-fixes.patch
new file mode 100644
index 00000000..b62e80ae
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-musl-fixes.patch
@@ -0,0 +1,33 @@
+diff -uar LVM2.2.02.110-old/daemons/lvmetad/lvmetad-core.c LVM2.2.02.110/daemons/lvmetad/lvmetad-core.c
+--- LVM2.2.02.110-old/daemons/lvmetad/lvmetad-core.c 2015-05-14 21:37:01.226755157 +0000
++++ LVM2.2.02.110/daemons/lvmetad/lvmetad-core.c 2015-05-14 21:44:08.098585801 +0000
+@@ -124,7 +124,7 @@
+ if (!(vg = dm_hash_lookup(s->lock.vg, id))) {
+ if (!(vg = malloc(sizeof(pthread_mutex_t))) ||
+ pthread_mutexattr_init(&rec) ||
+- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP) ||
++ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE) ||
+ pthread_mutex_init(vg, &rec))
+ goto bad;
+ if (!dm_hash_insert(s->lock.vg, id, vg)) {
+@@ -1152,7 +1152,7 @@
+ ls->log = s->log;
+
+ pthread_mutexattr_init(&rec);
+- pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE_NP);
++ pthread_mutexattr_settype(&rec, PTHREAD_MUTEX_RECURSIVE);
+ pthread_mutex_init(&ls->lock.pvid_to_pvmeta, &rec);
+ pthread_mutex_init(&ls->lock.vgid_to_metadata, &rec);
+ pthread_mutex_init(&ls->lock.pvid_to_vgid, NULL);
+Only in LVM2.2.02.110/lib/commands: toolcontext.c.orig
+diff -uar LVM2.2.02.110-old/libdaemon/server/daemon-server.c LVM2.2.02.110/libdaemon/server/daemon-server.c
+--- LVM2.2.02.110-old/libdaemon/server/daemon-server.c 2015-05-14 21:37:01.256755555 +0000
++++ LVM2.2.02.110/libdaemon/server/daemon-server.c 2015-05-14 21:37:51.108437752 +0000
+@@ -26,6 +26,7 @@
+ #include <sys/un.h>
+ #include <unistd.h>
+ #include <signal.h>
++#include <fcntl.h>
+
+ #include <syslog.h> /* FIXME. For the global closelog(). */
+
diff --git a/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2 b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
new file mode 100755
index 00000000..e16d55c4
--- /dev/null
+++ b/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2
@@ -0,0 +1,13 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvmetad.initd-2.02.105-r2,v 1.2 2014/02/08 21:17:46 robbat2 Exp $
+
+pidfile="/run/lvmetad.pid"
+command="/sbin/lvmetad"
+command_args="${LVMETAD_OPTS:=-p ${pidfile}}"
+start_stop_daemon_args="--pidfile ${pidfile}"
+
+depend() {
+ :
+}
diff --git a/sys-fs/lvm2/lvm2-2.02.110-r99.ebuild b/sys-fs/lvm2/lvm2-2.02.110-r99.ebuild
new file mode 100644
index 00000000..4cffcec6
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.110-r99.ebuild
@@ -0,0 +1,275 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.110.ebuild,v 1.3 2014/08/29 07:15:02 ssuominen Exp $
+
+EAPI=5
+inherit autotools eutils linux-info multilib systemd toolchain-funcs udev flag-o-matic
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software"
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="readline static static-libs systemd clvm cman lvm1 lvm2create_initrd selinux +udev +thin device-mapper-only"
+REQUIRED_USE="device-mapper-only? ( !clvm !cman !lvm1 !lvm2create_initrd !thin )
+ systemd? ( udev )
+ static? ( !udev )" #520450
+
+DEPEND_COMMON="clvm? ( cman? ( =sys-cluster/cman-3* ) =sys-cluster/libdlm-3* )
+ readline? ( sys-libs/readline )
+ udev? ( >=virtual/libudev-208:=[static-libs?] )"
+# /run is now required for locking during early boot. /var cannot be assumed to
+# be available -- thus, pull in recent enough baselayout for /run.
+# This version of LVM is incompatible with cryptsetup <1.1.2.
+RDEPEND="${DEPEND_COMMON}
+ >=sys-apps/baselayout-2.2
+ !<sys-apps/openrc-0.11
+ !<sys-fs/cryptsetup-1.1.2
+ !!sys-fs/clvm
+ !!sys-fs/lvm-user
+ >=sys-apps/util-linux-2.16
+ lvm2create_initrd? ( sys-apps/makedev )
+ thin? ( >=sys-block/thin-provisioning-tools-0.3.0 )"
+# note: thin- 0.3.0 is required to avoid --disable-thin_check_needs_check
+DEPEND="${DEPEND_COMMON}
+ virtual/pkgconfig
+ >=sys-devel/binutils-2.20.1-r1
+ static? (
+ selinux? ( sys-libs/libselinux[static-libs] )
+ udev? ( >=virtual/libudev-208:=[static-libs] )
+ >=sys-apps/util-linux-2.16[static-libs]
+ )"
+
+S=${WORKDIR}/${PN/lvm/LVM}.${PV}
+
+pkg_setup() {
+ local CONFIG_CHECK="~SYSVIPC"
+
+ if use udev; then
+ local WARNING_SYSVIPC="CONFIG_SYSVIPC:\tis not set (required for udev sync)\n"
+ if linux_config_exists; then
+ local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH)
+ if [ -n "${uevent_helper_path}" ] && [ "${uevent_helper_path}" != '""' ]; then
+ ewarn "It's recommended to set an empty value to the following kernel config option:"
+ ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}"
+ fi
+ fi
+ fi
+
+ check_extra_config
+
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static to the filename!"
+ fi
+}
+
+src_prepare() {
+ # Gentoo specific modification(s):
+ epatch "${FILESDIR}"/${PN}-2.02.108-example.conf.in.patch
+
+ sed -i \
+ -e "1iAR = $(tc-getAR)" \
+ -e "s:CC ?= @CC@:CC = $(tc-getCC):" \
+ make.tmpl.in || die #444082
+
+ sed -i -e '/FLAG/s:-O2::' configure{.in,} || die #480212
+
+ if use udev && ! use device-mapper-only; then
+ sed -i -e '/use_lvmetad =/s:0:1:' conf/example.conf.in || die #514196
+ elog "Notice that \"use_lvmetad\" setting is enabled with USE=\"udev\" in"
+ elog "/etc/lvm/lvm.conf, which will require restart of udev, lvm, and lvmetad"
+ elog "if it was previously disabled."
+ fi
+
+ sed -i -e "s:/usr/bin/true:$(type -P true):" scripts/blk_availability_systemd_red_hat.service.in || die #517514
+
+ # For upstream -- review and forward:
+ epatch "${FILESDIR}"/${PN}-2.02.63-always-make-static-libdm.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-lvm2create_initrd.patch
+ epatch "${FILESDIR}"/${PN}-2.02.67-createinitrd.patch #301331
+ epatch "${FILESDIR}"/${PN}-2.02.99-locale-muck.patch #330373
+ epatch "${FILESDIR}"/${PN}-2.02.70-asneeded.patch # -Wl,--as-needed
+ epatch "${FILESDIR}"/${PN}-2.02.92-dynamic-static-ldflags.patch #332905
+ epatch "${FILESDIR}"/${PN}-2.02.108-static-pkgconfig-libs.patch #370217, #439414 + blkid
+ epatch "${FILESDIR}"/${PN}-2.02.106-pthread-pkgconfig.patch #492450
+ # Patches for musl
+ epatch "${FILESDIR}"/${PN}-fix-stdio-usage.patch # Patch from alpine linux
+ epatch "${FILESDIR}"/${PN}-musl-fixes.patch
+
+ # Without thin-privision-tools, there is nothing to install for target install_man7:
+ use thin || { sed -i -e '/^install_lvm2/s:install_man7::' man/Makefile.in || die; }
+
+ eautoreconf
+}
+
+src_configure() {
+ filter-flags -flto
+ local myconf
+ local buildmode
+
+ myconf="${myconf} $(use_enable !device-mapper-only dmeventd)"
+ myconf="${myconf} $(use_enable !device-mapper-only cmdlib)"
+ myconf="${myconf} $(use_enable !device-mapper-only applib)"
+ myconf="${myconf} $(use_enable !device-mapper-only fsadm)"
+ myconf="${myconf} $(use_enable !device-mapper-only lvmetad)"
+ use device-mapper-only && myconf="${myconf} --disable-udev-systemd-background-jobs"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static; then
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ myconf="${myconf} --enable-static_link"
+ else
+ buildmode="shared"
+ fi
+ dmbuildmode=$(use !device-mapper-only && echo internal || echo none)
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=${dmbuildmode}"
+ myconf="${myconf} --with-snapshots=${dmbuildmode}"
+ if use thin; then
+ myconf="${myconf} --with-thin=internal --with-cache=internal"
+ local texec
+ for texec in check dump repair restore; do
+ myconf="${myconf} --with-thin-${texec}=${EPREFIX}/sbin/thin_${texec}"
+ myconf="${myconf} --with-cache-${texec}=${EPREFIX}/sbin/cache_${texec}"
+ done
+ else
+ myconf="${myconf} --with-thin=none --with-cache=none"
+ fi
+
+ if use lvm1; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ econf \
+ $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --with-confdir="${EPREFIX}"/etc \
+ --exec-prefix="${EPREFIX}" \
+ --sbindir="${EPREFIX}/sbin" \
+ --with-staticdir="${EPREFIX}"/sbin \
+ --libdir="${EPREFIX}/$(get_libdir)" \
+ --with-usrlibdir="${EPREFIX}/usr/$(get_libdir)" \
+ --with-default-dm-run-dir=/run \
+ --with-default-run-dir=/run/lvm \
+ --with-default-locking-dir=/run/lock/lvm \
+ --with-default-pid-dir=/run \
+ $(use_enable udev udev_rules) \
+ $(use_enable udev udev_sync) \
+ $(use_with udev udevdir "$(get_udevdir)"/rules.d) \
+ $(use_enable systemd udev-systemd-background-jobs) \
+ "$(systemd_with_unitdir)" \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}"
+}
+
+src_compile() {
+ pushd include >/dev/null
+ emake
+ popd >/dev/null
+
+ if use device-mapper-only ; then
+ emake device-mapper
+ else
+ emake
+ emake CC="$(tc-getCC)" -C scripts lvm2_activation_generator_systemd_red_hat
+ fi
+}
+
+src_install() {
+ local inst
+ INSTALL_TARGETS="install install_systemd_units install_systemd_generators install_tmpfiles_configuration"
+ use device-mapper-only && INSTALL_TARGETS="install_device-mapper"
+ for inst in ${INSTALL_TARGETS}; do
+ emake DESTDIR="${D}" ${inst}
+ done
+
+ newinitd "${FILESDIR}"/device-mapper.rc-2.02.105-r2 device-mapper
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper
+
+ if use !device-mapper-only ; then
+ newinitd "${FILESDIR}"/dmeventd.initd-2.02.67-r1 dmeventd
+ newinitd "${FILESDIR}"/lvm.rc-2.02.105-r2 lvm
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm
+
+ newinitd "${FILESDIR}"/lvm-monitoring.initd-2.02.105-r2 lvm-monitoring
+ newinitd "${FILESDIR}"/lvmetad.initd-2.02.105-r2 lvmetad
+ fi
+
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd
+ fi
+
+ if use static-libs; then
+ dolib.a libdm/ioctl/libdevmapper.a
+ dolib.a libdaemon/client/libdaemonclient.a #462908
+ #gen_usr_ldscript libdevmapper.so
+ dolib.a daemons/dmeventd/libdevmapper-event.a
+ #gen_usr_ldscript libdevmapper-event.so
+ else
+ rm -f "${ED}"usr/$(get_libdir)/{libdevmapper-event,liblvm2cmd,liblvm2app,libdevmapper}.a
+ fi
+
+ if use lvm2create_initrd; then
+ dosbin scripts/lvm2create_initrd/lvm2create_initrd
+ doman scripts/lvm2create_initrd/lvm2create_initrd.8
+ newdoc scripts/lvm2create_initrd/README README.lvm2create_initrd
+ fi
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+
+ dodoc README VERSION* WHATS_NEW WHATS_NEW_DM doc/*.{c,txt} conf/*.conf
+}
+
+pkg_postinst() {
+ ewarn "Make sure the \"lvm\" init script is in the runlevels:"
+ ewarn "# rc-update add lvm boot"
+ ewarn
+ ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
+ ewarn "to enable lvm autoactivation and metadata caching."
+}
+
+src_test() {
+ einfo "Tests are disabled because of device-node mucking, if you want to"
+ einfo "run tests, compile the package and see ${S}/tests"
+}
diff --git a/sys-fs/lvm2/metadata.xml b/sys-fs/lvm2/metadata.xml
new file mode 100644
index 00000000..74f768f7
--- /dev/null
+++ b/sys-fs/lvm2/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>robbat2@gentoo.org</email>
+ <name>Robin H. Johnson</name>
+ </maintainer>
+ <maintainer>
+ <email>agk@redhat.com</email>
+ <name>Alasdair Kergon</name>
+ <description>Upstream Maintainer (please CC on bugs)</description>
+ </maintainer>
+ <use>
+ <flag name='clvm'>Allow users to build clustered lvm2</flag>
+ <flag name='cman'>Cman support for clustered lvm</flag>
+ <flag name='lvm1'>Allow users to build lvm2 with lvm1 support</flag>
+ <flag name='lvm2create_initrd'>Install lvm2create_initrd script and pull in <pkg>sys-apps/makedev</pkg> for the /sbin/MAKEDEV command</flag>
+ <flag name='thin'>Support for thin volumes</flag>
+ <flag name='device-mapper-only'>Build only device-mapper and not the rest of LVM2 (UNSUPPORTED)</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:heinz_mauelshagen:lvm2</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/squashfs-tools/Manifest b/sys-fs/squashfs-tools/Manifest
new file mode 100644
index 00000000..120cdfee
--- /dev/null
+++ b/sys-fs/squashfs-tools/Manifest
@@ -0,0 +1,6 @@
+AUX squashfs-tools-4.2-missing-includes.patch 236 SHA256 3e88e86568146d80733d52bcdd28405e3f02120e8ca408c5fc995f37d30006f1 SHA512 8f18536e59708475d210e7a2fb4ff4dd3fa29441ea6881ddd21f1a5aadb5686647d45961de832384e356cc011fcb74ebabb8d52816a64db3adb3a9a3a37e785e WHIRLPOOL fb7eb189ddd120e291b11a927ff3ee9871d187530c49729c9fb3d0becff9cfe89e89d0e308bdddde33252caff5949c26263f18712429507b27eeef61b70ae322
+DIST squashfs4.2.tar.gz 133173 SHA256 d9e0195aa922dbb665ed322b9aaa96e04a476ee650f39bbeadb0d00b24022e96 SHA512 4b69c5d3008803347d0ce7628957e3873c9ebd799662b25dfb739afb6a1ce97bdd02b0465ac4d949bc38af2155880ac068209dc638b94e5c86a8011ec3a00de0 WHIRLPOOL c69d403b9775ecebfba02c2ae395b3e5ed8f832caf80417863e5df861b60462b97ac3d10ee027cc96c6f8146450bd8fe8cf715574d41ed47abcc7abc9423ce52
+DIST squashfs4.3.tar.gz 182550 SHA256 0d605512437b1eb800b4736791559295ee5f60177e102e4d4ccd0ee241a5f3f6 SHA512 854ed7acc99920f24ecf11e0da807e5a2a162eeda55db971aba63a03f0da2c13b20ec0564a906c4b0e415bd8258b273a10208c7abc0704f2ceea773aa6148a79 WHIRLPOOL c819f416b34cc46a232b8bc385017774603f81b4a865e6b97208004c183ebad5de7d0f726be444f8cb4e1d450abed9340dab730aec0762407f034e99b39bdc06
+EBUILD squashfs-tools-4.2-r99.ebuild 1452 SHA256 21d0faeec0b21f801de63770b454273d2e9baa5320334fdbf72ac7a25c6a7d0f SHA512 64a7e21aea34462b91ea4dfb3c934c4f44ad43eff09884722a3c59e8a4c8b2859ad8fa3fc8422ef916285c2edad76cc90adcb4b7c6e554bf62d7e08895694ea6 WHIRLPOOL 31aa501b6c4ae2c149bcfcbdc03d0d17dc7e44aaaa71e3d61b5a4c4a78091ccd91450a9a132580a0dccb914278c1be45df5b6fb67a16e9c395600c8302ce5638
+EBUILD squashfs-tools-4.3-r99.ebuild 1522 SHA256 549d659c5a2f2a76e6dab8a7e32cfd76fe81733b5c0d1ca71461461ee1aff5dc SHA512 d08074bd1d6b90d2739e63d0164f9cc7886d06cfb6dac7aabfa3d5d034402acd74c9830f0cffbcdcd6068a6e95ba36cbde51dfd32176dd9d2cfc0c2f59d7f685 WHIRLPOOL 3dfb210820065645205607faad4bdfd302861bcbdfd1533a09de7027e7ab7e85eb1ab7d00caece0055c0db6f3dd70bbdac9f709b9bac8a6af4252468e78d2797
+MISC metadata.xml 284 SHA256 f61a80ede0dd7d1044c5112f9e484ab6debc7fbf6bf3da8755e6e30063141622 SHA512 3bc31499e8734e371a5a062f599e4c61be8af09fda0bc5c06827aa50bec7e0349a86f35f200550e531cd9ab519b9370e717b9fc0550efb272d2007924faa6c82 WHIRLPOOL f3644be42c30edfd27e7e4a7e8fab00019939f564b9cbfa8dfe4606cd4004706444b6c12bda7adc1b7148652ad8cc8ba824e3bf5436a8de3b49cf2c61bd01165
diff --git a/sys-fs/squashfs-tools/files/squashfs-tools-4.2-missing-includes.patch b/sys-fs/squashfs-tools/files/squashfs-tools-4.2-missing-includes.patch
new file mode 100644
index 00000000..82451e0d
--- /dev/null
+++ b/sys-fs/squashfs-tools/files/squashfs-tools-4.2-missing-includes.patch
@@ -0,0 +1,10 @@
+--- a/squashfs4.2/squashfs-tools/pseudo.c
++++ b/squashfs4.2/squashfs-tools/pseudo.c
+@@ -30,6 +30,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <stdlib.h>
++#include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+
diff --git a/sys-fs/squashfs-tools/metadata.xml b/sys-fs/squashfs-tools/metadata.xml
new file mode 100644
index 00000000..e1c66a45
--- /dev/null
+++ b/sys-fs/squashfs-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>livecd</herd>
+ <use>
+ <flag name="xz">Enable support for XZ ("LZMA2") compression using <pkg>app-arch/xz-utils</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-fs/squashfs-tools/squashfs-tools-4.2-r99.ebuild b/sys-fs/squashfs-tools/squashfs-tools-4.2-r99.ebuild
new file mode 100644
index 00000000..5ed51e54
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-4.2-r99.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/squashfs-tools/squashfs-tools-4.2.ebuild,v 1.12 2014/01/18 11:37:50 vapier Exp $
+
+EAPI="2"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+MY_PV=${PV}
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+xz lzo xattr"
+
+RDEPEND="
+ sys-libs/zlib
+ xz? ( app-arch/xz-utils )
+ lzo? ( dev-libs/lzo )
+ !xz? ( !lzo? ( sys-libs/zlib ) )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/squashfs${MY_PV}/squashfs-tools
+
+use_sed() {
+ local u=$1 s="${2:-`echo $1 | tr '[:lower:]' '[:upper:]'`}_SUPPORT"
+ printf '/^#?%s =/%s\n' "${s}" \
+ "$( use $u && echo s:.*:${s} = 1: || echo d )"
+}
+
+src_prepare() {
+ epatch ${FILESDIR}/${P}-missing-includes.patch
+}
+
+src_configure() {
+ append-cppflags -DFNM_EXTMATCH=0
+ tc-export CC
+ sed -i -r \
+ -e "$(use_sed xz XZ)" \
+ -e "$(use_sed lzo)" \
+ -e "$(use_sed xattr)" \
+ Makefile || die
+}
+
+src_install() {
+ dobin mksquashfs unsquashfs || die
+ cd ..
+ dodoc README ACKNOWLEDGEMENTS CHANGES PERFORMANCE.README || die
+}
+
+pkg_postinst() {
+ ewarn "This version of mksquashfs requires a 2.6.29 kernel or better"
+ use xz &&
+ ewarn "XZ support requires a 2.6.38 kernel or better"
+}
diff --git a/sys-fs/squashfs-tools/squashfs-tools-4.3-r99.ebuild b/sys-fs/squashfs-tools/squashfs-tools-4.3-r99.ebuild
new file mode 100644
index 00000000..f186f889
--- /dev/null
+++ b/sys-fs/squashfs-tools/squashfs-tools-4.3-r99.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/squashfs-tools/squashfs-tools-4.3.ebuild,v 1.6 2014/09/28 11:02:46 blueness Exp $
+
+EAPI=5
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="Tool for creating compressed filesystem type squashfs"
+HOMEPAGE="http://squashfs.sourceforge.net"
+SRC_URI="mirror://sourceforge/squashfs/squashfs${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
+IUSE="+xz lzma lz4 lzo xattr"
+
+RDEPEND="
+ sys-libs/zlib
+ !xz? ( !lzo? ( sys-libs/zlib ) )
+ lz4? ( app-arch/lz4 )
+ lzma? ( app-arch/xz-utils )
+ lzo? ( dev-libs/lzo )
+ xattr? ( sys-apps/attr )
+ xz? ( app-arch/xz-utils )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/squashfs${PV}/${PN}"
+
+src_prepare() {
+ epatch ${FILESDIR}/${PN}-4.2-missing-includes.patch
+}
+
+src_configure() {
+ # set up make command line variables in EMAKE_SQUASHFS_CONF
+ EMAKE_SQUASHFS_CONF=(
+ $(usex lzma LZMA_XZ_SUPPORT=1 LZMA_XS_SUPPORT=0)
+ $(usex lzo LZO_SUPPORT=1 LZO_SUPPORT=0)
+ $(usex lz4 LZ4_SUPPORT=1 LZ4_SUPPORT=0)
+ $(usex xattr XATTR_SUPPORT=1 XATTR_SUPPORT=0)
+ $(usex xz XZ_SUPPORT=1 XZ_SUPPORT=0)
+ )
+
+ append-cppflags -DFNM_EXTMATCH=0
+ tc-export CC
+}
+
+src_compile() {
+ emake ${EMAKE_SQUASHFS_CONF[@]}
+}
+
+src_install() {
+ dobin mksquashfs unsquashfs
+ dodoc ../README
+}
+
+pkg_postinst() {
+ ewarn "This version of mksquashfs requires a 2.6.29 kernel or better"
+ use xz &&
+ ewarn "XZ support requires a 2.6.38 kernel or better"
+}
diff --git a/sys-fs/xfsdump/Manifest b/sys-fs/xfsdump/Manifest
new file mode 100644
index 00000000..c20265c7
--- /dev/null
+++ b/sys-fs/xfsdump/Manifest
@@ -0,0 +1,6 @@
+AUX xfsdump-3.0.4-no-symlink.patch 721 SHA256 b3ccccfce2b7f36263a8b3611724560ae768a3371dcc6e19045abae8df8052a3 SHA512 8b8feddfbdd76bebe61a8d06e174f5bef6edd05d0ce3b96731c234f58f36c73182e411a6f7b30f4e2bbc48b13b675edaf9ba30434e414b2bf2c7dbf431c1b819 WHIRLPOOL 576a5f0324ac20b80fe946f1b0390b9e70860b9f350811e41c7ccbbbb06ef8439ca1946b4d7db88b2d106ad4d67b9bf82cb46636e52d362b304c6d78bb35f142
+AUX xfsdump-3.0.5-prompt-overflow.patch 333 SHA256 80684664bae903256dd1b6355da9e88b727b8b42a559a6131aa2d24a6ce08428 SHA512 73f2a2f29b1f0e8585f49ac510b4da18deebbb799e428519fedf936f46dbd602c1cf6d300fd4e416ae4e6af1e6ce726798dec710c01d73c263782cb01ab21ba2 WHIRLPOOL 33e53b9b2690791df7374e8c7b9ff893850e076f936be86c2164798ae98ba33b35d9f2955c060d487688cb6dc9818591a05e1a74ce0792c40afd5d5989e514c7
+AUX xfsdump-3.1.4-compat-musl.patch 1023 SHA256 2983ea5405e6ebee2a595345b7c519f48f1202d8d557daff6f709ced65759801 SHA512 350638c7a214f565ea1ffbe7753ed01e8d6cee873f73a45c58fc99d49122099d6e83c55fe2966b5595bcffcc2bdb895d765dfa6874f02d2b4d0d1b75e75904f7 WHIRLPOOL 34178b7e079d6125031e677e2090a7409695ab3dccfdfa76b98c7111c3ab16687fc6e6f92aeef85157644ea04815eab3070deb4c87f49360cebc3f06d50eeb72
+DIST xfsdump-3.1.4.tar.gz 848188 SHA256 570eafd0721515bdd79cb0e295b701d49cdf81e71a0a0ff0df6d4c5cc1960943 SHA512 e82885ad6b3f1d81c1cdeff56714b73651e1c74eb4ce71574875ec0bb69b3fe707b40f85f0766b21ba589d13364ecfc0bad657a9b15c428cf821f926c3d66b25 WHIRLPOOL 5677000929f260b391743207a865c7529b788db46806a62c62bb6917025194913609cc804ead23314988f44853abc57f3c86ee22d2bde365697a35b0a7e3b607
+EBUILD xfsdump-3.1.4-r99.ebuild 1180 SHA256 3c87b64acf0da936526a3fe762803f81b9b9b07d19b65c0d95d8ce17b7f6d3d3 SHA512 86c2bac6bdc8bf927eb58625303e7b05ef010f7aa7f1f744f5df59e2baa9ad576eb0086b5087f299c030322048f0dbb5c8dae2040f19e33eac83b20dd86ad606 WHIRLPOOL b5716771f8ce4d0683a22ade8cc4b093469c6624052b62574a5985e481f6e83051f2cb74a6df8a0b21b7f2c922f5b7172ade278ab178f9581d5b20ddd2fd0f28
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch b/sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch
new file mode 100644
index 00000000..014ca33d
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.0.4-no-symlink.patch
@@ -0,0 +1,22 @@
+http://bugs.gentoo.org/311881
+
+--- xfsdump-3.0.4/dump/Makefile
++++ xfsdump-3.0.4/dump/Makefile
+@@ -102,7 +102,6 @@
+ $(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
+ $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_ROOT_SBIN_DIR)
+ $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
+- $(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
+ install-dev:
+
+ $(COMMINCL) $(COMMON):
+--- xfsdump-3.0.4/restore/Makefile
++++ xfsdump-3.0.4/restore/Makefile
+@@ -114,7 +114,6 @@
+ $(INSTALL) -m 755 -d $(PKG_ROOT_SBIN_DIR)
+ $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_ROOT_SBIN_DIR)
+ $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
+- $(INSTALL) -S $(PKG_ROOT_SBIN_DIR)/$(LTCOMMAND) $(PKG_SBIN_DIR)/$(LTCOMMAND)
+ install-dev:
+
+ $(COMMINCL) $(COMMON):
diff --git a/sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch b/sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch
new file mode 100644
index 00000000..053615c8
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.0.5-prompt-overflow.patch
@@ -0,0 +1,14 @@
+http://oss.sgi.com/bugzilla/show_bug.cgi?id=876
+https://bugs.gentoo.org/335115
+
+--- dump/content.c
++++ dump/content.c
+@@ -6460,7 +6460,7 @@
+ Media_prompt_erase( drive_t *drivep )
+ {
+ fold_t fold;
+- char question[ 100 ];
++ char question[ 200 ];
+ char *preamblestr[ PREAMBLEMAX ];
+ size_t preamblecnt;
+ char *querystr[ QUERYMAX ];
diff --git a/sys-fs/xfsdump/files/xfsdump-3.1.4-compat-musl.patch b/sys-fs/xfsdump/files/xfsdump-3.1.4-compat-musl.patch
new file mode 100644
index 00000000..643fba6f
--- /dev/null
+++ b/sys-fs/xfsdump/files/xfsdump-3.1.4-compat-musl.patch
@@ -0,0 +1,36 @@
+diff -Naurp xfsdump-3.1.4.orig/common/main.c xfsdump-3.1.4.mod/common/main.c
+--- xfsdump-3.1.4.orig/common/main.c 2012-10-09 20:42:33.000000000 +0000
++++ xfsdump-3.1.4.mod/common/main.c 2015-05-10 20:14:36.255773000 +0000
+@@ -50,6 +50,10 @@
+ #include "content.h"
+ #include "inventory.h"
+
++#ifndef RLIM64_INFINITY
++#define RLIM64_INFINITY (~0ULL)
++#endif
++
+ #ifdef DUMP
+ /* main.c - main for dump
+ */
+@@ -2220,7 +2224,10 @@ static sig_printmap_t sig_printmap[ ] =
+ {SIGTERM, "SIGTERM"},
+ {SIGUSR1, "SIGUSR1"},
+ {SIGUSR2, "SIGUSR2"},
++ {SIGCHLD, "SIGCHLD"},
++#ifdef SIGCLD
+ {SIGCLD, "SIGCLD"},
++#endif
+ {SIGPWR, "SIGPWR"},
+ {SIGURG, "SIGURG"},
+ {SIGPOLL, "SIGPOLL"},
+diff -Naurp xfsdump-3.1.4.orig/dump/content.c xfsdump-3.1.4.mod/dump/content.c
+--- xfsdump-3.1.4.orig/dump/content.c 2015-05-10 19:45:58.915773000 +0000
++++ xfsdump-3.1.4.mod/dump/content.c 2015-05-10 22:23:10.705773000 +0000
+@@ -33,6 +33,7 @@
+
+ #ifdef linux
+ #include <xfs/xqm.h>
++#include <linux/limits.h>
+ #endif
+
+ #include <attr/attributes.h>
diff --git a/sys-fs/xfsdump/metadata.xml b/sys-fs/xfsdump/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /dev/null
+++ b/sys-fs/xfsdump/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/xfsdump/xfsdump-3.1.4-r99.ebuild b/sys-fs/xfsdump/xfsdump-3.1.4-r99.ebuild
new file mode 100644
index 00000000..c8c7302e
--- /dev/null
+++ b/sys-fs/xfsdump/xfsdump-3.1.4-r99.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/xfsdump/xfsdump-3.1.4.ebuild,v 1.2 2014/09/04 05:19:58 polynomial-c Exp $
+
+EAPI="4"
+
+inherit multilib eutils
+
+DESCRIPTION="xfs dump/restore utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 -sparc ~x86"
+IUSE=""
+
+RDEPEND="sys-fs/e2fsprogs
+ >=sys-fs/xfsprogs-3.2.0
+ sys-apps/dmapi
+ >=sys-apps/attr-2.4.19"
+DEPEND="${RDEPEND}
+ sys-devel/gettext"
+
+src_prepare() {
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in \
+ || die
+ epatch "${FILESDIR}"/${PN}-3.0.5-prompt-overflow.patch #335115
+ epatch "${FILESDIR}"/${PN}-3.0.4-no-symlink.patch #311881
+ epatch "${FILESDIR}"/${PN}-3.1.4-compat-musl.patch #549116
+}
+
+src_configure() {
+ unset PLATFORM #184564
+ export OPTIMIZER=${CFLAGS}
+ export DEBUG=-DNDEBUG
+
+ econf \
+ --libdir=/$(get_libdir) \
+ --libexecdir=/usr/$(get_libdir) \
+ --sbindir=/sbin
+}
diff --git a/sys-fs/xfsprogs/ChangeLog b/sys-fs/xfsprogs/ChangeLog
new file mode 100644
index 00000000..c299052e
--- /dev/null
+++ b/sys-fs/xfsprogs/ChangeLog
@@ -0,0 +1,783 @@
+# ChangeLog for sys-fs/xfsprogs
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/xfsprogs/ChangeLog,v 1.178 2014/12/15 10:01:52 polynomial-c Exp $
+
+*xfsprogs-3.2.2 (15 Dec 2014)
+
+ 15 Dec 2014; Lars Wendler <polynomial-c@gentoo.org> +xfsprogs-3.2.2.ebuild,
+ +files/xfsprogs-3.2.2-sharedlibs.patch:
+ Version bump.
+
+ 11 Nov 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for ia64, wrt bug #524374
+
+ 04 Nov 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for sparc, wrt bug #524374
+
+ 03 Nov 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for x86, wrt bug #524374
+
+ 02 Nov 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for alpha, wrt bug #524374
+
+ 01 Nov 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for ppc, wrt bug #524374
+
+ 31 Oct 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for ppc64, wrt bug #524374
+
+ 30 Oct 2014; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for amd64, wrt bug #524374
+
+ 23 Oct 2014; Jeroen Roovers <jer@gentoo.org> xfsprogs-3.2.1.ebuild:
+ Stable for HPPA (bug #524374).
+
+ 22 Oct 2014; Markus Meier <maekke@gentoo.org> xfsprogs-3.2.1.ebuild:
+ arm stable, bug #524374
+
+*xfsprogs-3.2.1 (04 Sep 2014)
+
+ 04 Sep 2014; Lars Wendler <polynomial-c@gentoo.org> -xfsprogs-3.1.11.ebuild,
+ +xfsprogs-3.2.1.ebuild:
+ Version bump (bug #510750). Removed old.
+
+*xfsprogs-3.1.11-r1 (25 Dec 2013)
+
+ 25 Dec 2013; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-3.1.11-sharedlibs.patch, +xfsprogs-3.1.11-r1.ebuild:
+ Install extra headers for libxfs #486514 by Stefan Reimer. Rewrite shared lib
+ installs to only use libtool to avoid rpath issues.
+
+*xfsprogs-3.1.11 (18 Oct 2013)
+
+ 18 Oct 2013; Lars Wendler <polynomial-c@gentoo.org> -xfsprogs-3.1.7.ebuild,
+ -xfsprogs-3.1.8.ebuild, +xfsprogs-3.1.11.ebuild,
+ -files/xfsprogs-3.1.1-sharedlibs.patch, -files/xfsprogs-3.1.8-readline.patch:
+ Version bump. Removed old.
+
+ 15 May 2013; Mike Frysinger <vapier@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Add s390 love #444688.
+
+ 02 Apr 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for hppa, wrt bug #457486
+
+ 31 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for sh, wrt bug #457486
+
+ 31 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for sparc, wrt bug #457486
+
+ 30 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for alpha, wrt bug #457486
+
+ 28 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for ia64, wrt bug #457486
+
+ 28 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for arm, wrt bug #457486
+
+ 27 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for ppc64, wrt bug #457486
+
+ 26 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for ppc, wrt bug #457486
+
+ 26 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for x86, wrt bug #457486
+
+ 26 Mar 2013; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.10.ebuild:
+ Stable for amd64, wrt bug #457486
+
+*xfsprogs-3.1.10 (11 Jan 2013)
+
+ 11 Jan 2013; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-3.1.10-sharedlibs.patch, +xfsprogs-3.1.10.ebuild:
+ Version bump #450588 by Agostino Sarubbo.
+
+ 19 Oct 2012; Mike Frysinger <vapier@gentoo.org>
+ files/xfsprogs-3.1.1-sharedlibs.patch:
+ Fix parallel install failures with libxlog #438764 by Jorge Manuel B. S.
+ Vicetto.
+
+ 25 Aug 2012; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-3.1.8-readline.patch, xfsprogs-3.1.8.ebuild:
+ Link libxcmd against readline #432644 by David Badia.
+
+ 19 Aug 2012; Raúl Porcel <armin76@gentoo.org> xfsprogs-3.1.8.ebuild:
+ alpha/ia64/sh/sparc stable wrt #422225
+
+ 14 Jul 2012; Markus Meier <maekke@gentoo.org> xfsprogs-3.1.8.ebuild:
+ arm stable, bug #422225
+
+ 28 Jun 2012; Brent Baude <ranger@gentoo.org> xfsprogs-3.1.8.ebuild:
+ Marking xfsprogs-3.1.8 ppc for bug 422225
+
+ 27 Jun 2012; Jeroen Roovers <jer@gentoo.org> xfsprogs-3.1.8.ebuild:
+ Stable for HPPA (bug #422225).
+
+ 22 Jun 2012; Brent Baude <ranger@gentoo.org> xfsprogs-3.1.8.ebuild:
+ Marking xfsprogs-3.1.8 ppc64 for bug 422225
+
+ 21 Jun 2012; Jeff Horelick <jdhore@gentoo.org> xfsprogs-3.1.8.ebuild:
+ marked x86 per bug 422225
+
+ 19 Jun 2012; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.8.ebuild:
+ Stable for amd64, wrt bug #422225
+
+*xfsprogs-3.1.8 (26 Apr 2012)
+
+ 26 Apr 2012; Tomáš Chvátal <scarabeus@gentoo.org> +xfsprogs-3.1.8.ebuild,
+ -xfsprogs-3.1.4.ebuild, -xfsprogs-3.1.5.ebuild, -xfsprogs-3.1.6.ebuild,
+ -xfsprogs-3.1.7-r1.ebuild:
+ Version bump to latest. Prune older a bit.
+
+ 01 Apr 2012; Raúl Porcel <armin76@gentoo.org> xfsprogs-3.1.7.ebuild:
+ alpha/ia64/sh/sparc stable wrt #408021
+
+*xfsprogs-3.1.7-r1 (30 Mar 2012)
+
+ 30 Mar 2012; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.1.7-r1.ebuild:
+ Migrate to EAPI=4 and fix static-libs handling #410251 by Fernando V.
+
+ 30 Mar 2012; Diego E. Pettenò <flameeyes@gentoo.org> xfsprogs-3.1.4.ebuild,
+ xfsprogs-3.1.5.ebuild, xfsprogs-3.1.6.ebuild, xfsprogs-3.1.7.ebuild:
+ Fix dependencies on util-linux with USE=static (bug #410251, thanks to
+ Fernando V.).
+
+ 25 Mar 2012; Markus Meier <maekke@gentoo.org> xfsprogs-3.1.7.ebuild:
+ arm stable, bug #408021
+
+ 24 Mar 2012; Pawel Hajdan jr <phajdan.jr@gentoo.org> xfsprogs-3.1.7.ebuild:
+ x86 stable wrt bug #408021
+
+ 15 Mar 2012; Jeroen Roovers <jer@gentoo.org> xfsprogs-3.1.7.ebuild:
+ Stable for HPPA (bug #408021).
+
+ 13 Mar 2012; Samuli Suominen <ssuominen@gentoo.org> xfsprogs-3.1.7.ebuild:
+ ppc/ppc64 stable wrt #408021
+
+ 13 Mar 2012; Agostino Sarubbo <ago@gentoo.org> xfsprogs-3.1.7.ebuild:
+ Stable for amd64, wrt bug #408021
+
+*xfsprogs-3.1.7 (09 Feb 2012)
+
+ 09 Feb 2012; Robin H. Johnson <robbat2@gentoo.org> +xfsprogs-3.1.7.ebuild:
+ Bug #402801: version bump.
+
+*xfsprogs-3.1.6 (06 Nov 2011)
+
+ 06 Nov 2011; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.1.6.ebuild:
+ Version bump.
+
+*xfsprogs-3.1.5 (12 Apr 2011)
+
+ 12 Apr 2011; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.1.5.ebuild:
+ Version bump #363261 by Lars Wendler.
+
+ 30 Mar 2011; Jeroen Roovers <jer@gentoo.org> xfsprogs-3.1.4.ebuild:
+ Stable for HPPA (bug #358499).
+
+ 20 Mar 2011; Raúl Porcel <armin76@gentoo.org> xfsprogs-3.1.4.ebuild:
+ alpha/arm/ia64/sh/sparc stable wrt #358499
+
+ 13 Mar 2011; Markos Chandras <hwoarang@gentoo.org> xfsprogs-3.1.4.ebuild:
+ Stable on amd64 wrt bug #358499
+
+ 13 Mar 2011; Kacper Kowalik <xarthisius@gentoo.org> xfsprogs-3.1.4.ebuild:
+ ppc/ppc64 stable wrt #358499
+
+ 13 Mar 2011; Pawel Hajdan jr <phajdan.jr@gentoo.org>
+ xfsprogs-3.1.4.ebuild:
+ x86 stable wrt bug #358499
+
+*xfsprogs-3.1.4 (13 Dec 2010)
+
+ 13 Dec 2010; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.1.4.ebuild:
+ Version bump #348147 by Francisco Javier.
+
+ 18 Aug 2010; Mike Frysinger <vapier@gentoo.org> xfsprogs-3.1.2.ebuild,
+ +files/xfsprogs-3.1.2-depend.patch:
+ Clean up dependency generation to avoid parallel build issues #333155 by
+ Samuli Suominen.
+
+ 17 Aug 2010; Mike Frysinger <vapier@gentoo.org>
+ files/xfsprogs-3.1.1-sharedlibs.patch, xfsprogs-3.1.2.ebuild:
+ Clean up library install and prefer readline over editline like upstream
+ #311109.
+
+*xfsprogs-3.1.2 (03 Jun 2010)
+
+ 03 Jun 2010; Tiziano Müller <dev-zero@gentoo.org>
+ +files/xfsprogs-3.1.1-sharedlibs.patch, +xfsprogs-3.1.2.ebuild:
+ Version bump (bug #311109), added deps for readline/libedit, added
+ static-libs use flag, changed dependency from e2fsprogs to util-linux,
+ thanks to Hendrik Leppkes for the updated patch.
+
+ 11 May 2010; Joseph Jezak <josejx@gentoo.org> xfsprogs-3.0.3.ebuild:
+ Marked ppc/ppc64 stable for bug #311381.
+
+ 06 May 2010; Jeroen Roovers <jer@gentoo.org> xfsprogs-3.0.3.ebuild:
+ Stable for HPPA (bug #311381).
+
+ 25 Apr 2010; Raúl Porcel <armin76@gentoo.org> xfsprogs-3.0.3.ebuild:
+ alpha/ia64/sh/sparc stable wrt #311381
+
+ 05 Apr 2010; Markus Meier <maekke@gentoo.org> xfsprogs-3.0.3.ebuild:
+ amd64/arm/x86 stable, bug #311381
+
+*xfsprogs-3.0.3 (23 Sep 2009)
+
+ 23 Sep 2009; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.0.3.ebuild:
+ Version bump #285985 by Lars Wendler.
+
+ 19 Sep 2009; Robin H. Johnson <robbat2@gentoo.org>
+ xfsprogs-3.0.1-r1.ebuild:
+ Adding ~arm support. Tested on mv78100.arm.dev.gentoo.org thanks to
+ Marvell.
+
+*xfsprogs-3.0.1-r1 (26 Jun 2009)
+
+ 26 Jun 2009; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.0.1-r1.ebuild,
+ files/xfsprogs-3.0.1-sharedlibs.patch:
+ Fix by Lars Wendler to install missing libxcmd.so #275456 by Chris Smith.
+
+ 25 Jun 2009; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.0.1.ebuild,
+ +files/xfsprogs-3.0.1-sharedlibs.patch:
+ Version bump #275405 by Lars Wendler and USE=static support #273219 by
+ Wolfram Schlich.
+
+*xfsprogs-3.0.1 (25 Jun 2009)
+
+ 25 Jun 2009; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.0.1.ebuild:
+ Version bump #275405 by Lars Wendler.
+
+ 24 Feb 2009; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-3.0.0-parallel-build.patch, xfsprogs-3.0.0.ebuild:
+ Fix parallel build failures #260005 by Gilles Dartiguelongue.
+
+ 24 Feb 2009; Mike Frysinger <vapier@gentoo.org> xfsprogs-3.0.0.ebuild:
+ Apply blocker as some binaries have moved from xfsdump to xfsprogs #259966
+ by Robin Johnson.
+
+*xfsprogs-3.0.0 (22 Feb 2009)
+
+ 22 Feb 2009; Mike Frysinger <vapier@gentoo.org> +xfsprogs-3.0.0.ebuild:
+ Version bump #259894 by Lars (Polynomial-C).
+
+ 14 Feb 2009; Raúl Porcel <armin76@gentoo.org> xfsprogs-2.10.1.ebuild:
+ ia64 stable wrt #252148
+
+ 31 Jan 2009; Jeroen Roovers <jer@gentoo.org> xfsprogs-2.10.1.ebuild:
+ Stable for HPPA (bug #252148).
+
+ 09 Jan 2009; Brent Baude <ranger@gentoo.org> xfsprogs-2.10.1.ebuild:
+ stable ppc, bug 252148
+
+ 07 Jan 2009; Brent Baude <ranger@gentoo.org> xfsprogs-2.10.1.ebuild:
+ stable ppc64, bug 252148
+
+ 25 Dec 2008; Tobias Klausmann <klausman@gentoo.org>
+ xfsprogs-2.10.1.ebuild:
+ Stable on alpha, bug #252148
+
+ 22 Dec 2008; Markus Meier <maekke@gentoo.org> xfsprogs-2.10.1.ebuild:
+ amd64/x86 stable, bug #252148
+
+ 22 Dec 2008; Ferris McCormick <fmccor@gentoo.org> xfsprogs-2.10.1.ebuild:
+ Sparc stable, Bug #252148.
+
+*xfsprogs-2.10.2 (22 Dec 2008)
+
+ 22 Dec 2008; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.10.2.ebuild:
+ Version bump #251651 by Lars (Polynomial-C).
+
+ 16 Nov 2008; Diego E. Pettenò <flameeyes@gentoo.org>
+ +files/xfsprogs-2.10.1-parallelmake.patch, xfsprogs-2.10.1.ebuild:
+ Add a patch to allow parallel make builds, reported upstream.
+
+*xfsprogs-2.10.1 (29 Sep 2008)
+
+ 29 Sep 2008; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.10.1-headers.patch, +xfsprogs-2.10.1.ebuild:
+ Version bump #237170 by Conrad Kostecki.
+
+ 01 May 2008; Raúl Porcel <armin76@gentoo.org> xfsprogs-2.9.7.ebuild:
+ ia64/sparc stable wrt #218942
+
+ 01 May 2008; Tobias Scherbaum <dertobi123@gentoo.org>
+ xfsprogs-2.9.7.ebuild:
+ ppc stable, bug #218942
+
+ 30 Apr 2008; Tobias Klausmann <klausman@gentoo.org> xfsprogs-2.9.7.ebuild:
+ Stable on alpha, bug #218942
+
+ 28 Apr 2008; Jeroen Roovers <jer@gentoo.org> xfsprogs-2.9.7.ebuild:
+ Stable for HPPA (bug #218942).
+
+ 26 Apr 2008; Markus Meier <maekke@gentoo.org> xfsprogs-2.9.7.ebuild:
+ x86 stable, bug #218942
+
+ 26 Apr 2008; Richard Freeman <rich0@gentoo.org> xfsprogs-2.9.7.ebuild:
+ amd64 stable - 218942
+
+ 24 Apr 2008; Markus Rothe <corsair@gentoo.org> xfsprogs-2.9.7.ebuild:
+ Stable on ppc64; bug #218942
+
+*xfsprogs-2.9.8 (23 Apr 2008)
+
+ 23 Apr 2008; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.9.8.ebuild:
+ Version bump #219018 by Sergey Dryabzhinsky.
+
+*xfsprogs-2.9.7 (18 Mar 2008)
+
+ 18 Mar 2008; Robin H. Johnson <robbat2@gentoo.org> +xfsprogs-2.9.7.ebuild:
+ Version bump as 2.9.6 had a bad default that enabled lazy-counts and then
+ the filesystem did not work on kernels older than 2.6.23.
+
+ 07 Mar 2008; Richard Freeman <rich0@gentoo.org> xfsprogs-2.9.5.ebuild:
+ amd64 stabe - 211152
+
+ 28 Feb 2008; nixnut <nixnut@gentoo.org> xfsprogs-2.9.5.ebuild:
+ Stable on ppc wrt bug 211152
+
+ 27 Feb 2008; Raúl Porcel <armin76@gentoo.org> xfsprogs-2.9.5.ebuild:
+ alpha/ia64/sparc stable wrt #211152
+
+ 25 Feb 2008; Jeroen Roovers <jer@gentoo.org> xfsprogs-2.9.5.ebuild:
+ Stable for HPPA (bug #211152).
+
+ 24 Feb 2008; Brent Baude <ranger@gentoo.org> xfsprogs-2.9.5.ebuild:
+ stable ppc64, bug 211152
+
+ 24 Feb 2008; Markus Meier <maekke@gentoo.org> xfsprogs-2.9.5.ebuild:
+ x86 stable, bug #211152
+
+*xfsprogs-2.9.6 (23 Feb 2008)
+
+ 23 Feb 2008; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.9.6.ebuild:
+ Version bump #211113 by Raúl Porcel.
+
+*xfsprogs-2.9.5 (26 Jan 2008)
+
+ 26 Jan 2008; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.9.5.ebuild:
+ Version bump #207411 by Sergey Dryabzhinsky.
+
+ 19 Nov 2007; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Stable on mips, per #197204.
+
+ 02 Nov 2007; Steve Dibb <beandog@gentoo.org> xfsprogs-2.9.4.ebuild:
+ amd64 stable, bug 197204
+
+ 31 Oct 2007; Jeroen Roovers <jer@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Stable for HPPA (bug #197204).
+
+ 30 Oct 2007; nixnut <nixnut@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Stable on ppc wrt bug 197204
+
+ 29 Oct 2007; Raúl Porcel <armin76@gentoo.org> xfsprogs-2.9.4.ebuild:
+ ia64 stable wrt #197204
+
+ 28 Oct 2007; Ferris McCormick <fmccor@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Sparc stable --- Bug #197204 (although we don't much use xfs).
+
+ 28 Oct 2007; Jose Luis Rivero <yoswink@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Stable on alpha wrt bug #197204
+
+ 28 Oct 2007; Markus Rothe <corsair@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Stable on ppc64; bug #197204
+
+ 28 Oct 2007; Andrej Kacian <ticho@gentoo.org> xfsprogs-2.9.4.ebuild:
+ Stable on x86, bug #197204.
+
+ 06 Oct 2007; Tom Gall <tgall@gentoo.org> xfsprogs-2.9.3.ebuild:
+ stable on ppc64, bug #193143
+
+ 28 Sep 2007; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.9.3.ebuild:
+ Stable on mips, per #193143.
+
+ 26 Sep 2007; Raúl Porcel <armin76@gentoo.org> xfsprogs-2.9.3.ebuild:
+ sparc stable wrt #193143
+
+ 26 Sep 2007; Christoph Mende <angelos@gentoo.org> xfsprogs-2.9.3.ebuild:
+ Stable on amd64 wrt bug #193143
+
+ 23 Sep 2007; Raúl Porcel <armin76@gentoo.org> xfsprogs-2.9.3.ebuild:
+ alpha/ia64 stable wrt #193143
+
+ 22 Sep 2007; Christian Faulhammer <opfer@gentoo.org>
+ xfsprogs-2.9.3.ebuild:
+ stable x86, bug 193143
+
+ 20 Sep 2007; Lars Weiler <pylon@gentoo.org> xfsprogs-2.9.3.ebuild:
+ Stable on ppc; bug #193143.
+
+*xfsprogs-2.9.4 (20 Sep 2007)
+
+ 20 Sep 2007; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.9.4.ebuild:
+ Version bump #192647 by Arfrever Frehtes Taifersar Arahesis.
+
+ 01 Sep 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.9.3-pthreads.patch, xfsprogs-2.9.3.ebuild:
+ Link in libpthread with all binaries for now #190523 by Sergey D.
+
+*xfsprogs-2.9.3 (29 Aug 2007)
+
+ 29 Aug 2007; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.9.3.ebuild:
+ Version bump #190523 by Sergey D.
+
+ 13 Jun 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.8.21-LDFLAGS.patch, xfsprogs-2.8.21.ebuild:
+ Respect LDFLAGS while linking the library.
+
+ 09 Jun 2007; Markus Rothe <corsair@gentoo.org>
+ +files/xfsprogs-2.8.21-kern-types.patch, xfsprogs-2.8.21.ebuild:
+ Added patch for bug #131483; upstream fixed the fix ... and broke it
+
+*xfsprogs-2.8.21 (31 May 2007)
+
+ 31 May 2007; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.8.21.ebuild:
+ Version bump.
+
+ 14 Feb 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.8.18-symlinks.patch, xfsprogs-2.8.18.ebuild:
+ Fix installing in parallel #166729 by Connor.
+
+*xfsprogs-2.8.18 (13 Feb 2007)
+
+ 13 Feb 2007; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.8.18.ebuild:
+ Version bump #166640 by Antti Mäkelä.
+
+ 28 Jan 2007; Joseph Jezak <josejx@gentoo.org> xfsprogs-2.8.11.ebuild:
+ Marked ppc stable for bug #156840.
+
+ 31 Dec 2006; Bryan Østergaard <kloeri@gentoo.org> xfsprogs-2.8.11.ebuild:
+ Stable on Alpha, bug 156840.
+
+ 11 Dec 2006; Peter Weller <welp@gentoo.org> xfsprogs-2.8.11.ebuild:
+ Added amd64 keyword wrt bug ##156840
+
+ 07 Dec 2006; Guy Martin <gmsoft@gentoo.org> xfsprogs-2.8.11.ebuild:
+ Stable on hppa.
+
+ 07 Dec 2006; Christian Faulhammer <opfer@gentoo.org>
+ xfsprogs-2.8.11.ebuild:
+ stable x86, bug #156840
+
+ 03 Dec 2006; Markus Rothe <corsair@gentoo.org> ChangeLog:
+ Stable on ppc64; bug #156840
+
+ 27 Sep 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.8.11-kern-types.patch, xfsprogs-2.8.11.ebuild:
+ Fix from upstream for building with newer kernel headers #131483 by Markus
+ Rothe.
+
+*xfsprogs-2.8.11 (26 Sep 2006)
+
+ 26 Sep 2006; Patrick McLean <chutzpah@gentoo.org> +xfsprogs-2.8.11.ebuild:
+ Version bump.
+
+*xfsprogs-2.8.10 (10 Aug 2006)
+
+ 10 Aug 2006; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.8.10.ebuild:
+ Version bump #143377 by Christian Hesse.
+
+ 12 Jul 2006; Aron Griffis <agriffis@gentoo.org> xfsprogs-2.7.11.ebuild:
+ Mark 2.7.11 stable on ia64. #130436
+
+ 14 May 2006; Luis Medinas <metalgod@gentoo.org> xfsprogs-2.7.11.ebuild:
+ Stable on amd64.
+
+ 29 Apr 2006; Guy Martin <gmsoft@gentoo.org> xfsprogs-2.7.11.ebuild:
+ Stable on hppa.
+
+ 29 Apr 2006; Joseph Jezak <josejx@gentoo.org> xfsprogs-2.7.11.ebuild:
+ Marked ppc stable for bug #130436.
+
+ 29 Apr 2006; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.7.11.ebuild:
+ Marked stable on mips.
+
+ 23 Apr 2006; Chris Gianelloni <wolf31o2@gentoo.org>
+ xfsprogs-2.7.11.ebuild:
+ Stable on x86 wrt bug #130436.
+
+ 20 Apr 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.7.11-LDFLAGS.patch, xfsprogs-2.7.11.ebuild:
+ Respect user LDFLAGS #126825 by Diego Pettenò.
+
+ 10 Apr 2006; Mike Frysinger <vapier@gentoo.org>
+ +files/xfsprogs-2.7.11-no-compress-docs.patch, xfsprogs-2.7.11.ebuild:
+ Let portage compress the docs #129486 by Stefan de Konink.
+
+ 19 Feb 2006; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.7.3.ebuild:
+ Marked stable on mips.
+
+ 29 Jan 2006; Simon Stelling <blubb@gentoo.org> xfsprogs-2.7.3.ebuild:
+ stable on amd64
+
+ 28 Jan 2006; Mark Loeser <halcy0n@gentoo.org> xfsprogs-2.7.3.ebuild:
+ Stable on x86; bug #120486
+
+ 28 Jan 2006; Markus Rothe <corsair@gentoo.org> xfsprogs-2.7.3.ebuild:
+ Stable on ppc64; bug #120486
+
+ 27 Jan 2006; Luca Barbato <lu_zero@gentoo.org> xfsprogs-2.7.3.ebuild:
+ Marked ppc
+
+ 27 Jan 2006; Aron Griffis <agriffis@gentoo.org> xfsprogs-2.7.3.ebuild:
+ Mark 2.7.3 stable on alpha #120486
+
+*xfsprogs-2.7.11 (27 Jan 2006)
+
+ 27 Jan 2006; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.7.11.ebuild:
+ Version bump.
+
+*xfsprogs-2.7.3 (29 Nov 2005)
+
+ 29 Nov 2005; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.7.3.ebuild:
+ Version bump.
+
+*xfsprogs-2.6.36 (02 Sep 2005)
+
+ 02 Sep 2005; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.6.36.ebuild:
+ Version bump.
+
+ 29 May 2005; <solar@gentoo.org> xfsprogs-2.6.25.ebuild:
+ - update xfsprogs to use libc expanded variable elibc_uclibc vs uclibc so
+ USE=-* works
+
+ 29 Apr 2005; Markus Rothe <corsair@gentoo.org> xfsprogs-2.6.25.ebuild:
+ Stable on ppc64
+
+ 29 Apr 2005; Hanno Boeck <hanno@gentoo.org> +files/xfsprogs_gcc4.gz,
+ xfsprogs-2.6.25.ebuild:
+ Add patch to compile with gcc4 (from upstream cvs).
+
+ 30 Mar 2005; Mike Frysinger <vapier@gentoo.org> xfsprogs-2.6.25.ebuild:
+ Clean up and add ppc64 KEYWORDS.
+
+ 20 Mar 2005; Bryan Østergaard <kloeri@gentoo.org> xfsprogs-2.6.25.ebuild:
+ Stable on alpha.
+
+ 19 Feb 2005; Joseph Jezak <josejx@gentoo.org> xfsprogs-2.6.25.ebuild:
+ Marked ppc stable for bug #82181.
+
+ 29 Jan 2005; <solar@gentoo.org> +files/2.6.25-uclibc-fadvise.patch,
+ xfsprogs-2.6.25.ebuild:
+ - temp work around to disable posix_fadvise till such times as _syscall6()
+ exists for uClibc. bug #73855
+
+ 19 Jan 2005; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.6.25.ebuild:
+ Marked stable on mips.
+
+ 03 Jan 2005; Ciaran McCreesh <ciaranm@gentoo.org> :
+ Change encoding to UTF-8 for GLEP 31 compliance
+
+ 14 Dec 2004; Dylan Carlson <absinthe@gentoo.org> xfsprogs-2.6.25.ebuild:
+ Stable on amd64.
+
+*xfsprogs-2.6.25 (09 Oct 2004)
+
+ 09 Oct 2004; Mike Frysinger <vapier@gentoo.org> +xfsprogs-2.6.25.ebuild:
+ Version bump.
+
+ 07 Oct 2004; <solar@gentoo.org> +files/2.6.13-uclibc-mincore.patch,
+ xfsprogs-2.6.13.ebuild:
+ mincore() does not appear to be part of POSIX or the Single Unix
+ Specification. So we patch it out for uclibc builds.
+
+ 07 Oct 2004; Mike Frysinger <vapier@gentoo.org> xfsprogs-2.6.13.ebuild,
+ +files/2.6.13-configure.patch:
+ Add patch to fix configure mis-detection #65735 by Marc Bevand.
+
+ 21 Sep 2004; Mike Frysinger <vapier@gentoo.org> xfsprogs-2.6.13.ebuild:
+ Make nls support optional #64862 by Aaron GIpson.
+
+ 03 Sep 2004; Pieter Van den Abeele <pvdabeel@gentoo.org>
+ xfsprogs-2.3.9.ebuild, xfsprogs-2.6.3.ebuild:
+ Masked xfsprogs-2.6.3.ebuild stable for ppc
+
+ 03 Sep 2004; Pieter Van den Abeele <pvdabeel@gentoo.org>
+ xfsprogs-2.3.9.ebuild:
+ Masked xfsprogs-2.3.9.ebuild stable for ppc
+
+ 23 Aug 2004; Bryan Østergaard <kloeri@gentoo.org> xfsprogs-2.6.13.ebuild:
+ Stable on alpha.
+
+ 21 Aug 2004; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.6.13.ebuild:
+ Marked stable on mips.
+
+ 21 Aug 2004; Mike Frysinger <vapier@gentoo.org> xfsprogs-2.6.13.ebuild:
+ Unmask since latest stable xfsdump needs a the latest xfsprogs #42484 and to
+ cheat at fixing #39559.
+
+ 30 Jul 2004; Aron Griffis <agriffis@gentoo.org> xfsprogs-2.6.3.ebuild:
+ stable on alpha and ia64
+
+ 29 Jul 2004; Guy Martin <gmsoft@gentoo.org> xfsprogs-2.6.3.ebuild:
+ Stable on hppa.
+
+*xfsprogs-2.6.13 (28 Jul 2004)
+
+ 28 Jul 2004; Jon Portnoy <avenj@gentoo.org> xfsprogs-2.6.13.ebuild :
+ Version bump.
+
+ 28 Jul 2004; Jon Portnoy <avenj@gentoo.org> xfsprogs-2.6.3.ebuild :
+ Bump to stable on x86 and AMD64, bug #54108.
+
+ 01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
+ xfsprogs-1.3.13.ebuild, xfsprogs-2.6.3.ebuild:
+ virtual/glibc -> virtual/libc
+
+ 27 Jun 2004; Aron Griffis <agriffis@gentoo.org> xfsprogs-2.6.0.ebuild:
+ QA - fix use invocation
+
+ 24 May 2004; Michael Sterrett <mr_bones_@gentoo.org> xfsprogs-2.6.3.ebuild:
+ IUSE; don't rdepend on sed; use character class in sed; error check disk io;
+ compress docs
+
+ 25 Apr 2004; Joshua Kinard <kumba@gentoo.org> xfsprogs-2.6.3.ebuild:
+ Tweaked the arch check to see if PLATFORM needed to be unset and added mips to
+ that arch list.
+
+ 18 Apr 2004; Luca Barbato <lu_zero@gentoo.org> xfsprogs-2.6.0.ebuild,
+ xfsprogs-2.6.3.ebuild:
+ Fixed bug #42181
+
+*xfsprogs-2.6.3 (11 Feb 2004)
+
+ 11 Feb 2004; Mike Frysinger <vapier@gentoo.org> :
+ Version bump #19406.
+
+ 31 Jan 2004; Brian Harring <ferringb@gentoo.org> xfsprogs-1.3.13.ebuild,
+ xfsprogs-2.3.9.ebuild, xfsprogs-2.6.0.ebuild:
+ Adjusted all xfsprogs ebuild SRC_URI's to mirror://gentoo, due to upstream
+ files no longer existing.
+
+ 17 Jan 2004; Bartosch Pixa <darkspecter@gentoo.org> :
+ manifest fix
+
+ 16 Jan 2004; Bartosch Pixa <darkspecter@gentoo.org> xfsprogs-2.6.0.ebuild:
+ set ppc in keywords
+
+ 15 Dec 2003; Jason Wever <weeve@gentoo.org> xfsprogs-2.6.0.ebuild:
+ Added sparc fix and marked ~sparc.
+
+*xfsprogs-2.6.0 (13 Nov 2003)
+
+ 13 Nov 2003; <plasmaroo@gentoo.org> xfsprogs-2.6.0.ebuild:
+ Version bump. Bug #33358
+
+ 28 Sep 2003; David Holm <dholm@gentoo.org> xfsprogs-2.3.9.ebuild:
+ Added to ~ppc.
+
+*xfsprogs-2.3.6-r1 (15 Sep 2003)
+
+ 15 Sep 2003; Seemant Kulleen <seemant@gentoo.org> xfsprogs-1.3.13.ebuild,
+ xfsprogs-2.0.1_p20020330.ebuild, xfsprogs-2.2.2-r1.ebuild,
+ xfsprogs-2.2.2.ebuild, xfsprogs-2.3.6-r1.ebuild, xfsprogs-2.3.6-r2.ebuild,
+ xfsprogs-2.3.6.ebuild, xfsprogs-2.3.9.ebuild:
+ moved to sys-fs
+
+ 10 Jun 2003; Brandon Low <lostlogic@gentoo.org> xfsprogs-2.3.9.ebuild:
+ Change to sed -i and more better fix bug 19527
+
+ 10 Jun 2003; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.3.9.ebuild:
+ added fix from bug #19527
+
+ 09 Jun 2003; Brad Laue <brad@gentoo.org> xfsprogs-2.3.9.ebuild:
+ Marking xfsprogs-2.3.9 stable: the 2.3.6 distfile is no longer on the main FTP
+ site.
+
+ 03 Jun 2003; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.3.9.ebuild:
+ added dep to close bug #21160
+
+*xfsprogs-2.3.9 (16 Apr 2003)
+
+ 16 Apr 2003; Daniel Ahlberg <aliz@gentoo.org> xfsprogs-2.3.9.ebuild :
+ Version bump.
+
+*xfsprogs-2.3.6-r2 (26 Dec 2002)
+
+ 28 Mar 2003; Guy Martin <gmsoft@gentoo.org> xfsprogs-2.3.6-r2.ebuild :
+ Added ~hppa to KEYWORDS.
+
+ 24 Feb 2003; Nicholas Wourms <dragon@gentoo.org> xfsprogs-2.3.6-r2.ebuild :
+ Marked as testing for mips. Made ChangeLog compatible with echangelog.
+
+ 26 Dec 2002; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.3.6-r2.ebuild,
+ files/digest-xfsprogs-2.3.6-r2:
+ Changed some sedding to use flag-o-matic, and exported some vars.
+
+ 21 Dec 2002; Daniel Robbins <drobbins@gentoo.org>: renamed xfsprogs version
+ 20020330-r1 to 2.0.1_p20020330 to bring in line with CVS ebuild policy and
+ fix version comparison snafu.
+
+*xfsprogs-2.3.6-r1 (16 Dec 2002)
+
+ 16 Dec 2002; Bjoern Brauel <bjb@gentoo.org> xfsprogs-2.3.6-r1.ebuild,
+ files/digest-xfsprogs-2.3.6-r1:
+
+ Add ~alpha to KEYWORDS
+
+ 16 Dec 2002; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.3.6-r1.ebuild,
+ files/digest-xfsprogs-2.3.6-r1:
+
+ Cleaned up ebuild.
+
+*xfsprogs-2.3.6 (09 Dec 2002)
+
+ 09 Dec 2002; Donny Davies <woodchip@gentoo.org> : Chase latest release.
+
+*xfsprogs-2.2.2-r1 (29 Oct 2002)
+
+ 27 Oct 2002; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.2.2-r1.ebuild
+ files/digest-xfsprogs-2.2.2-r1 :
+
+ Updated symlinks for bug# 9861.
+
+*xfsprogs-2.2.2 (27 Sep 2002)
+
+ 05 Oct 2002; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.2.2.ebuild :
+
+ Fixed symlinks and "modernized" ebuild.
+
+ 27 Sep 2002; Brad Cowan <bcowan@gentoo.org> xfsprogs-2.2.2.ebuild
+ files/digest-xfsprogs-2.2.2 :
+
+ version bump thanks to Hanno Boeck <hanno@gentoo.org>
+
+*xfsprogs-20020330-r1 (26 July 2002)
+
+ 26 Jul 2002; phoen][x <phoenix@gentoo.org>:
+ This package will be compiled with -O1 now.
+ Compiling it with a higher setting, breaks xfs_check in
+ a gcc-2.95.3 environment. Closes bug #5551.
+
+*xfsprogs-20020330 (14 July 2002)
+
+ 21 Jul 2002; Mark Guertin <gerk@gentoo.org>:
+ updated keywords (ppc)
+
+ 14 Jul 2002; phoen][x <phoenix@gentoo.org> xfsprogs-20020330.ebuild :
+ Added LICENSE, KEYWORDS, SLOT.
+
+*xfsprogs-1.3.13 (14 July 2002)
+
+ 25 Feb 2003; Brandon Low <lostlogic@gentoo.org> xfsprogs-1.3.13.ebuild :
+ Fix massively long line
+
+ 14 Jul 2002; phoen][x <phoenix@gentoo.org> xfsprogs-1.3.13.ebuild :
+ Added LICENSE, KEYWORDS, SLOT.
+
+*xfsprogs-20020124-r2 (1 Feb 2002)
+
+ 14 Jul 2002; phoen][x <phoenix@gentoo.org> xfsprogs-20020124-r2.ebuild :
+ Added LICENSE, KEYWORDS, SLOT.
+
+ 1 Feb 2002; G.Bevin <gbevin@gentoo.org> ChangeLog :
+
+ Added initial ChangeLog which should be updated whenever the package is
+ updated in any way. This changelog is targetted to users. This means that the
+ comments should well explained and written in clean English. The details about
+ writing correct changelogs are explained in the skel.ChangeLog file which you
+ can find in the root directory of the portage repository.
diff --git a/sys-fs/xfsprogs/Manifest b/sys-fs/xfsprogs/Manifest
new file mode 100644
index 00000000..2be54c5d
--- /dev/null
+++ b/sys-fs/xfsprogs/Manifest
@@ -0,0 +1,7 @@
+AUX xfsprogs-3.2.2-add-limits-h.patch 271 SHA256 6d8e49de188fc9932ea488a8945601bf2035b03dfa4c3667bd55689445582696 SHA512 62125c90ff22e52142927d3e1ca8411a757679a304fcf1acf780c692fee1ef8c8d1d4bdbd97dce3e9f6d6678f9640f189fd96400e91c974978f0455966b80c6c WHIRLPOOL 8c9aa0e5ec61319e53c983c8484e1770beaf5c229b5c99735fb473d4a973034060bf5cdd2e6295f0d673eade4c393de43adcb5711c0e964dd6fac8fa68e8a53d
+AUX xfsprogs-3.2.2-musl-compat.patch 3599 SHA256 b62b258a56ba5ffbead385a390541fa34b8b545322ad6984bc5c1bb01d2e0c58 SHA512 1c6936fdee3cebf81a1ef9828cbf28175533dab46b47aead3f4165f725b7a66d1ac214314818f639313ebfef8e0fe245d21bb7f804423f934c2505c493dbce97 WHIRLPOOL a314521a2e68e5f22a3d4dd6f88c2cf86c7ea1ca778f27efda090490dae19a30a9f2015ba7f7cec364831b1a203832484651355e6a446e3418a64763cffdc5de
+AUX xfsprogs-3.2.2-sharedlibs.patch 2776 SHA256 a687cbd95bdd3948ab50a2d945b5c73197dbf6f2a2b5190071dd67003753fa8b SHA512 cb54e4e1a15e45b801788d0a189c3cdb4a02ff8ad9e3d31814c73532e33a0c47e3b0226179142c9f79a87511eaa89387c30794c1651718e36bf6cd4efbba5f6a WHIRLPOOL 0c42f6194a99372acbc914f71a73217cd29fc9256cd39ae832f245d2526f9bfa7ff3e76c2e2bc0ce6d39d05744c4f8ef8e9b7a6624c0a258014f5c99471a04a2
+DIST xfsprogs-3.2.2.tar.gz 1477667 SHA256 1a525ce21dc39d4ad3d775fa3c12c2dd4fb7a85e1e05ddd4530dcf773ed65fab SHA512 6316ce6da87bc3d70c1a887b7c5558b594fa6960105d6a51ad0e8072d5533444f69da174f370907738a15bd50f785f715f71947de916940daf0df2845f4a700e WHIRLPOOL a3e1d57e3dd77f91361ff710306a5579a5d99204849291d6730f672e65febe18a5957646cfcda60d02684a24333dca45f742637256b423a7756d4f28556594cf
+EBUILD xfsprogs-3.2.2-r99.ebuild 2857 SHA256 f835a99f146d2537bb9009440626bacde5db667807ac18611e5425856522a3f9 SHA512 a42104a92687ea86b7cd245748e3ae9c811a03f8b336f4cf6f0392943b4b09ac3c5c9deadd7afbb02f0757027b7e1b59398a3a6612935ac5a939bab743225646 WHIRLPOOL 9ba7f85e8e4e79aaff767996f862609cd91b7971c17cbe9e59894061f98c5033e7166301042688dfde92f11a30e0dc6cc751b77b158a82b94a2a797a3671dd4b
+MISC ChangeLog 27065 SHA256 a0637579839e88d27c78c8ae0d1ff4fc8459bf1001a13df17040020ebc4a8f5f SHA512 2c987b23b3f752fcbe1fa4e17df0b3714edf758ce4b807cc10ae29aac69ee8a6b27909a5c7391d38b1ae8be165f8bf99b71c564b1607044643fe5939f485dd7b WHIRLPOOL d31f96e38bcf1e8fc735c254565776fbe3dcf0fa62a7540a9dc2930c8e9debe17a6fd7951c8128f427292a2d8c5704b721d16d4cd384382bf8f3df8f382fb711
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-fs/xfsprogs/files/xfsprogs-3.2.2-add-limits-h.patch b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-add-limits-h.patch
new file mode 100644
index 00000000..813119fd
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-add-limits-h.patch
@@ -0,0 +1,10 @@
+--- ./libxfs/xfs_attr_remote.c.orig
++++ ./libxfs/xfs_attr_remote.c
+@@ -17,6 +17,7 @@
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+ #include <xfs.h>
++#include <linux/limits.h>
+
+ #define ATTR_RMTVALUE_MAPSIZE 1 /* # of map entries at once */
+
diff --git a/sys-fs/xfsprogs/files/xfsprogs-3.2.2-musl-compat.patch b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-musl-compat.patch
new file mode 100644
index 00000000..bffa6fb6
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-musl-compat.patch
@@ -0,0 +1,154 @@
+diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
+index 6f00b41..5b4af53 100644
+--- a/fsr/xfs_fsr.c
++++ b/fsr/xfs_fsr.c
+@@ -44,6 +44,10 @@
+ #define _PATH_FSRLAST "/var/tmp/.fsrlast_xfs"
+ #define _PATH_PROC_MOUNTS "/proc/mounts"
+
++#ifndef _PATH_MOUNTED
++#define _PATH_MOUNTED MOUNTED
++#endif
++
+
+ char *progname;
+
+diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in
+index ac260bc..0e7fccf 100644
+--- a/include/platform_defs.h.in
++++ b/include/platform_defs.h.in
+@@ -68,6 +68,32 @@ typedef __u64 __bitwise __be64;
+
+ typedef struct filldir filldir_t;
+
++#ifndef __uint8_t
++#define __uint8_t uint8_t
++#endif
++#ifndef __uint16_t
++#define __uint16_t uint16_t
++#endif
++#ifndef __uint32_t
++#define __uint32_t uint32_t
++#endif
++#ifndef __uint64_t
++#define __uint64_t uint64_t
++#endif
++
++#ifndef __int8_t
++#define __int8_t int8_t
++#endif
++#ifndef __int16_t
++#define __int16_t int16_t
++#endif
++#ifndef __int32_t
++#define __int32_t int32_t
++#endif
++#ifndef __int64_t
++#define __int64_t int64_t
++#endif
++
+ #if defined(__linux__)
+ #include <xfs/linux.h>
+ #elif defined(__FreeBSD__)
+diff --git a/libhandle/handle.c b/libhandle/handle.c
+index 9a232fa..1db7772 100644
+--- a/libhandle/handle.c
++++ b/libhandle/handle.c
+@@ -20,6 +20,9 @@
+ #include <xfs/xfs.h>
+ #include <xfs/handle.h>
+ #include <xfs/parent.h>
++#if defined(__linux__)
++#include <linux/limits.h>
++#endif
+
+ /* just pick a value we know is more than big enough */
+ #define MAXHANSIZ 64
+diff --git a/libhandle/jdm.c b/libhandle/jdm.c
+index 070407b..8dd6322 100644
+--- a/libhandle/jdm.c
++++ b/libhandle/jdm.c
+@@ -20,6 +20,9 @@
+ #include <xfs/handle.h>
+ #include <xfs/jdm.h>
+ #include <xfs/parent.h>
++#if defined(__linux__)
++#include <linux/limits.h>
++#endif
+
+ /* internal fshandle - typecast to a void for external use */
+ #define FSHANDLE_SZ 8
+diff --git a/libxfs/linux.c b/libxfs/linux.c
+index 2e07d54..4075786 100644
+--- a/libxfs/linux.c
++++ b/libxfs/linux.c
+@@ -16,12 +16,9 @@
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#define ustat __kernel_ustat
+ #include <xfs/libxfs.h>
+ #include <mntent.h>
+ #include <sys/stat.h>
+-#undef ustat
+-#include <sys/ustat.h>
+ #include <sys/mount.h>
+ #include <sys/ioctl.h>
+ #include <sys/sysinfo.h>
+@@ -49,9 +46,12 @@ static int max_block_alignment;
+ int
+ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+ {
+- /* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */
+- struct ustat ust[2];
+ struct stat64 st;
++ FILE *f;
++ struct stat64 mst;
++ struct mntent *mnt;
++ char mounts[MAXPATHLEN];
++ int ismounted = 0;
+
+ if (!s) {
+ if (stat64(block, &st) < 0)
+@@ -61,14 +61,25 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+ s = &st;
+ }
+
+- if (ustat(s->st_rdev, ust) >= 0) {
++ strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED);
++ if ((f = setmntent(mounts, "r")) == NULL)
++ return 0;
++
++ while ((mnt = getmntent(f)) != NULL) {
++ if (stat64(mnt->mnt_dir, &mst) < 0)
++ continue;
++ if (mst.st_dev != s->st_rdev)
++ continue;
++
+ if (verbose)
+ fprintf(stderr,
+ _("%s: %s contains a mounted filesystem\n"),
+ progname, name);
+- return 1;
++ ismounted = 1;
++ break;
+ }
+- return 0;
++ endmntent(f);
++ return ismounted;
+ }
+
+ int
+--- ./repair/attr_repair.c.orig
++++ ./repair/attr_repair.c
+@@ -24,6 +24,10 @@
+ #include "bmap.h"
+ #include "protos.h"
+ #include "dir2.h"
++#if defined(__linux__)
++#include <linux/limits.h>
++#endif
++
+
+ static int xfs_acl_valid(struct xfs_mount *mp, struct xfs_acl *daclp);
+ static int xfs_mac_valid(xfs_mac_label_t *lp);
diff --git a/sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch
new file mode 100644
index 00000000..118874a5
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-3.2.2-sharedlibs.patch
@@ -0,0 +1,108 @@
+use libtool to do all installing. do not use the manual file install as
+that'll copy files directly from the .libs/ subdir which might have rpaths
+that we do not want.
+
+--- xfsprogs-3.2.2/include/buildmacros
++++ xfsprogs-3.2.2/include/buildmacros
+@@ -70,18 +70,9 @@
+ # /usr/lib.
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB_DEV = \
+- cd $(TOPDIR)/$(LIBNAME)/.libs; \
+- ../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 -T old_lib $(LIBNAME).lai $(PKG_LIB_DIR); \
+- ../$(INSTALL) -m 644 $(LIBNAME).lai $(PKG_LIB_DIR)/$(LIBNAME).la ; \
+- ../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+- ../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+- if [ "x$(shell readlink -f $(PKG_LIB_DIR))" != \
+- "x$(shell readlink -f $(PKG_ROOT_LIB_DIR))"; ]; then \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).a $(PKG_ROOT_LIB_DIR)/$(LIBNAME).a; \
+- ../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).la $(PKG_ROOT_LIB_DIR)/$(LIBNAME).la; \
+- ../$(INSTALL) -S $(PKG_ROOT_LIB_DIR)/$(LIBNAME).so $(PKG_LIB_DIR)/$(LIBNAME).so; \
+- fi
++ set -e; cd $(TOPDIR)/$(LIBNAME); \
++ $(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++ env -uDIST_ROOT $(LTINSTALL) $(TOPDIR)/$(LIBNAME)/$(LIBNAME).la $(DIST_ROOT)$(PKG_LIB_DIR)/$(LIBNAME).la
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
+ endif
+--- xfsprogs-3.2.2/libdisk/Makefile
++++ xfsprogs-3.2.2/libdisk/Makefile
+@@ -31,6 +31,7 @@
+ install: default
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: install-dev
+
+--- xfsprogs-3.2.2/libhandle/Makefile
++++ xfsprogs-3.2.2/libhandle/Makefile
+@@ -20,7 +20,6 @@
+ include $(BUILDRULES)
+
+ install: default
+- $(INSTALL_LTLIB)
+
+ install-dev: default
+ $(INSTALL_LTLIB_DEV)
+--- xfsprogs-3.2.2/libxcmd/Makefile
++++ xfsprogs-3.2.2/libxcmd/Makefile
+@@ -34,6 +34,11 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++
++ install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .ltdep
+--- xfsprogs-3.2.2/libxfs/Makefile
++++ xfsprogs-3.2.2/libxfs/Makefile
+@@ -86,6 +86,7 @@
+ install: default
+
+ install-dev: default
++ $(INSTALL_LTLIB_DEV)
+
+ install-qa: default
+
+--- xfsprogs-3.2.2/libxlog/Makefile
++++ xfsprogs-3.2.2/libxlog/Makefile
+@@ -12,6 +12,8 @@
+
+ CFILES = xfs_log_recover.c util.c
+
++LTLIBS = $(LIBUUID) $(LIBXFS)
++
+ # don't want to link xfs_repair with a debug libxlog.
+ DEBUG = -DNDEBUG
+
+@@ -19,6 +21,11 @@
+
+ include $(BUILDRULES)
+
+-install install-dev install-qa: default
++install: default
++
++install-dev: default
++ $(INSTALL_LTLIB_DEV)
++
++install-qa: default
+
+ -include .ltdep
+--- xfsprogs-3.2.2/Makefile
++++ xfsprogs-3.2.2/Makefile
+@@ -63,6 +63,8 @@
+ mkfs: libxfs
+ quota: libxcmd
+ repair: libxfs libxlog
++libxlog: libxfs
++libxlog-install-dev: libxfs-install-dev
+
+ ifneq ($(ENABLE_BLKID), yes)
+ mkfs: libdisk
diff --git a/sys-fs/xfsprogs/metadata.xml b/sys-fs/xfsprogs/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /dev/null
+++ b/sys-fs/xfsprogs/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+</pkgmetadata>
diff --git a/sys-fs/xfsprogs/xfsprogs-3.2.2-r99.ebuild b/sys-fs/xfsprogs/xfsprogs-3.2.2-r99.ebuild
new file mode 100644
index 00000000..c9216e37
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-3.2.2-r99.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/xfsprogs/xfsprogs-3.2.2.ebuild,v 1.1 2014/12/15 10:01:52 polynomial-c Exp $
+
+EAPI="4"
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="http://oss.sgi.com/projects/xfs/"
+SRC_URI="ftp://oss.sgi.com/projects/xfs/cmd_tars/${P}.tar.gz
+ ftp://oss.sgi.com/projects/xfs/previous/cmd_tars/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="libedit nls readline static static-libs"
+REQUIRED_USE="static? ( static-libs )"
+
+LIB_DEPEND=">=sys-apps/util-linux-2.17.2[static-libs(+)]
+ readline? ( sys-libs/readline[static-libs(+)] )
+ !readline? ( libedit? ( dev-libs/libedit[static-libs(+)] ) )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+ !<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}
+ static? (
+ ${LIB_DEPEND}
+ readline? ( sys-libs/ncurses[static-libs] )
+ )
+ nls? ( sys-devel/gettext )"
+
+pkg_setup() {
+ if use readline && use libedit ; then
+ ewarn "You have USE='readline libedit' but these are exclusive."
+ ewarn "Defaulting to readline; please disable this USE flag if you want libedit."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.2.2-sharedlibs.patch
+ epatch "${FILESDIR}"/${PN}-3.2.2-musl-compat.patch
+ epatch "${FILESDIR}"/${PN}-3.2.2-add-limits-h.patch
+
+ sed -i \
+ -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+ include/builddefs.in || die
+ sed -i \
+ -e '1iLLDFLAGS = -static' \
+ {estimate,fsr}/Makefile || die
+ sed -i \
+ -e "/LLDFLAGS/s:-static:$(use static && echo -all-static):" \
+ $(find -name Makefile) || die
+
+ # libdisk has broken blkid conditional checking
+ sed -i \
+ -e '/LIB_SUBDIRS/s:libdisk::' \
+ Makefile || die
+
+ # TODO: write a patch for configure.in to use pkg-config for the uuid-part
+ if use static && use readline ; then
+ sed -i \
+ -e 's|-lreadline|\0 -lncurses|' \
+ -e 's|-lblkid|\0 -luuid|' \
+ configure || die
+ fi
+}
+
+src_configure() {
+ export DEBUG=-DNDEBUG
+ export OPTIMIZER=${CFLAGS}
+ unset PLATFORM # if set in user env, this breaks configure
+
+ local myconf
+ if use static || use static-libs ; then
+ myconf+=" --enable-static"
+ else
+ myconf+=" --disable-static"
+ fi
+
+ econf \
+ --bindir=/usr/bin \
+ --libexecdir=/usr/$(get_libdir) \
+ $(use_enable nls gettext) \
+ $(use_enable readline) \
+ $(usex readline --disable-editline $(use_enable libedit editline)) \
+ ${myconf}
+
+ MAKEOPTS+=" V=1"
+}
+
+src_install() {
+ emake DIST_ROOT="${ED}" install
+ # parallel install fails on these targets for >=xfsprogs-3.2.0
+ emake -j1 DIST_ROOT="${ED}" install-{dev,qa}
+
+ # handle is for xfsdump, the rest for xfsprogs
+ gen_usr_ldscript -a xfs xlog
+ # removing unnecessary .la files if not needed
+ use static-libs || find "${ED}" -name '*.la' -delete
+}
diff --git a/sys-kernel/linux-headers/Manifest b/sys-kernel/linux-headers/Manifest
new file mode 100644
index 00000000..f8372cdd
--- /dev/null
+++ b/sys-kernel/linux-headers/Manifest
@@ -0,0 +1,7 @@
+AUX glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch 275 SHA256 eea3758ded887b84e3b15031e590975b4f94dbf7b03e7b135611339bcb8ca81c SHA512 8ff3af26ac01d402641d6c775ad54922a73e5eaf1e41efe842448d08c59f51ab9290104008283fafbdacd9eb1b8e48e9d2507210a8531d05a852c6ba84d2b60e WHIRLPOOL 2cd90e18615df2f1be80c83d0d2e218d6d02437b2ea91ba3a61ced407357f972371bddfed140f18ec66817e7f6ddd61a1c85da7f9b14be04f71ca3e64c8fb687
+AUX libc-compat.h-fix-some-issues-arising-from-in6.h.patch 2051 SHA256 9dc049392ba3b79453baa809f0aafb47283293046b84511b5ae8519a86716048 SHA512 6d6107974dcf9671dd0f1a747160adf85a22c27216b1200ce40fd410f6fc5fd47956b8b5b51055cfda4b97cc9f172cd3850ccb4daa73e4eda449e6e77c0840ca WHIRLPOOL 4245b157fd91ecba39f42126e603a166eab74ff4abc7487639ea191de22376876de25db35b295e1227da4990e2ae04bcc6bab34a1b583ef10fda4fe30341a1c1
+AUX libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch 1037 SHA256 3297454dd7bdc3417d36f448ca2091e39a6acf475e22c6eb67ee5819d7b73c8f SHA512 895e23a36d0736ff624ad960e8a26e221d990e50910cc96b1a151789f97b94288f3e801ad76d141e421901e66422c480e511b2e20798e91a15b9e298c72533d6 WHIRLPOOL 25fc05bd3d942c27e12ede60fe07953d3c35adfb7154ee1b99cc8f02946264a4f91df9c5cce089c90bb08c5aec104c6217d55c8f7c07b454f3a4c32b4ee2f61f
+DIST gentoo-headers-3.18-1.tar.xz 3628 SHA256 d6b83a873baf83d8db535623dc9b91b52354e53238a128bb6fc29c6ff4f9f11e SHA512 89fb9b336fa3455752f6fe8626500d30245c04806890d4448a2895bbef2a5eae409940618fd4e0be57aa12784a198a695c32479f12d76450e16f2af1536e7a1f WHIRLPOOL 5a18218fef9013d5306d3ef6aa6467c1fe09dc70593c3f8f1f62a3e99d704d085420e33ded3924f0e34ee58c080952e5e007842f31d7bf648fad14a02ce3751f
+DIST gentoo-headers-base-3.18.tar.xz 3776668 SHA256 12a44590e505525509556f6e973464f124f172565d3a4b29a3ff4627aa24f9a7 SHA512 6615c604e5e618d26fff5a61691f7827bb05be9790db6c9f8e16e3842bce8f056f9928f85ae5714710b75743b0d0804faba4ba9c76e934e1de22dc03ef6d5535 WHIRLPOOL 5cdd500aaac3589d6672ea365f5b29ccef207db36cbc34052f0bf1bbe35b5dbfedf3b1675079c1ec05daf1a136d2da3018b2ca91bcaeda1fe8d23e3246fda25e
+EBUILD linux-headers-3.18-r99.ebuild 1722 SHA256 ebc98e2ba00102a97d0cdbb8fd029a6faf19f230d5814bbf27741e1b64bed5c9 SHA512 f5410f584990a0a7145b5d144d7186860a459789d44d6130d0a22304328853a114cb115f5a6d0b95fe634f2cc9c98472c20da5d69518374796457244531462e9 WHIRLPOOL 3cdbfc29de6f562b14adc65d2427f945564c8aa29d6f9b2dee969940f3139d887587b87cfa3b3fb44c431408449eeaa7d0606a7f8c9bc7bfe42aa1cb9cface2a
+MISC metadata.xml 247 SHA256 6858f34fb3375b80b0071f911f6ead887ae327e0e27ecd39be3e8ccb2609fa0a SHA512 b82456bc3441754e0f316575316497d293374ac4bb80e1b7e4b158358a3e920a6da4bb223a97412bbeba8f51ea4555a84267f4ebc8eecdb06941038efd03c47f WHIRLPOOL 96213c23913ccc5a89e2fa924701b916106c15cd24940f7bc2c8896c6a5545f840c1bd21ccc0882a928fd44628cce49c7cd8d25957ffe6c64b4755b467e6344d
diff --git a/sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch b/sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
new file mode 100644
index 00000000..0b4cfb12
--- /dev/null
+++ b/sys-kernel/linux-headers/files/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
@@ -0,0 +1,12 @@
+--- ./include/uapi/linux/kernel.h.orig
++++ ./include/uapi/linux/kernel.h
+@@ -1,7 +1,9 @@
+ #ifndef _UAPI_LINUX_KERNEL_H
+ #define _UAPI_LINUX_KERNEL_H
+
++#ifdef __GLIBC__
+ #include <linux/sysinfo.h>
++#endif
+
+ /*
+ * 'kernel.h' contains some often-used function prototypes etc
diff --git a/sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch b/sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch
new file mode 100644
index 00000000..e4ce3d65
--- /dev/null
+++ b/sys-kernel/linux-headers/files/libc-compat.h-fix-some-issues-arising-from-in6.h.patch
@@ -0,0 +1,61 @@
+--- ./include/uapi/linux/libc-compat.h.orig
++++ ./include/uapi/linux/libc-compat.h
+@@ -48,35 +48,26 @@
+ #ifndef _UAPI_LIBC_COMPAT_H
+ #define _UAPI_LIBC_COMPAT_H
+
+-/* We have included glibc headers... */
+-#if defined(__GLIBC__)
++#ifndef __KERNEL__ /* we're used from userspace */
+
+-/* Coordinate with glibc netinet/in.h header. */
+-#if defined(_NETINET_IN_H)
++/* Coordinate with libc netinet/in.h header. */
++#ifdef _NETINET_IN_H
+
+ /* GLIBC headers included first so don't define anything
+ * that would already be defined. */
+ #define __UAPI_DEF_IN6_ADDR 0
+-/* The exception is the in6_addr macros which must be defined
+- * if the glibc code didn't define them. This guard matches
+- * the guard in glibc/inet/netinet/in.h which defines the
+- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
+-#if defined(__USE_MISC) || defined (__USE_GNU)
+ #define __UAPI_DEF_IN6_ADDR_ALT 0
+-#else
+-#define __UAPI_DEF_IN6_ADDR_ALT 1
+-#endif
+ #define __UAPI_DEF_SOCKADDR_IN6 0
+ #define __UAPI_DEF_IPV6_MREQ 0
+ #define __UAPI_DEF_IPPROTO_V6 0
+
+-#else
++#else /* defined(_NETINET_IN_H) */
+
+ /* Linux headers included first, and we must define everything
+- * we need. The expectation is that glibc will check the
++ * we need. The expectation is that the libc will check the
+ * __UAPI_DEF_* defines and adjust appropriately. */
+ #define __UAPI_DEF_IN6_ADDR 1
+-/* We unconditionally define the in6_addr macros and glibc must
++/* We unconditionally define the in6_addr macros and the libc must
+ * coordinate. */
+ #define __UAPI_DEF_IN6_ADDR_ALT 1
+ #define __UAPI_DEF_SOCKADDR_IN6 1
+@@ -89,7 +80,7 @@
+ /* If we did not see any headers from any supported C libraries,
+ * or we are being included in the kernel, then define everything
+ * that we need. */
+-#else /* !defined(__GLIBC__) */
++#else /* __KERNEL__ */
+
+ /* Definitions for in6.h */
+ #define __UAPI_DEF_IN6_ADDR 1
+@@ -98,6 +89,6 @@
+ #define __UAPI_DEF_IPV6_MREQ 1
+ #define __UAPI_DEF_IPPROTO_V6 1
+
+-#endif /* __GLIBC__ */
++#endif /* __KERNEL__ */
+
+ #endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch b/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
new file mode 100644
index 00000000..b8ac94fb
--- /dev/null
+++ b/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
@@ -0,0 +1,39 @@
+--- ./include/uapi/linux/if_ether.h.orig
++++ ./include/uapi/linux/if_ether.h
+@@ -22,6 +22,7 @@
+ #define _UAPI_LINUX_IF_ETHER_H
+
+ #include <linux/types.h>
++#include <linux/libc-compat.h>
+
+ /*
+ * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
+@@ -130,11 +131,12 @@
+ * This is an Ethernet frame header.
+ */
+
++#if __UAPI_DEF_ETHHDR
+ struct ethhdr {
+ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+ unsigned char h_source[ETH_ALEN]; /* source ether addr */
+ __be16 h_proto; /* packet type ID field */
+ } __attribute__((packed));
+-
++#endif
+
+ #endif /* _UAPI_LINUX_IF_ETHER_H */
+--- ./include/uapi/linux/libc-compat.h.orig
++++ ./include/uapi/linux/libc-compat.h
+@@ -50,6 +50,12 @@
+
+ #ifndef __KERNEL__ /* we're used from userspace */
+
++#ifdef _NETINET_IF_ETHER_H /* musl */
++#define __UAPI_DEF_ETHHDR 0
++#else /* glibc uses __NETINET_IF_ETHER_H, and includes the kernel header. */
++#define __UAPI_DEF_ETHHDR 1
++#endif
++
+ /* Coordinate with libc netinet/in.h header. */
+ #ifdef _NETINET_IN_H
+
diff --git a/sys-kernel/linux-headers/linux-headers-3.18-r99.ebuild b/sys-kernel/linux-headers/linux-headers-3.18-r99.ebuild
new file mode 100644
index 00000000..d9113b80
--- /dev/null
+++ b/sys-kernel/linux-headers/linux-headers-3.18-r99.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/linux-headers/linux-headers-3.18.ebuild,v 1.3 2015/03/24 20:13:13 maekke Exp $
+
+EAPI="4"
+
+ETYPE="headers"
+H_SUPPORTEDARCH="alpha amd64 arc arm arm64 avr32 bfin cris frv hexagon hppa ia64 m32r m68k metag microblaze mips mn10300 openrisc ppc ppc64 s390 score sh sparc tile x86 xtensa"
+inherit kernel-2
+detect_version
+
+PATCH_VER="1"
+SRC_URI="mirror://gentoo/gentoo-headers-base-${PV}.tar.xz
+ ${PATCH_VER:+mirror://gentoo/gentoo-headers-${PV}-${PATCH_VER}.tar.xz}"
+
+KEYWORDS="amd64 arm ~mips ppc x86"
+
+DEPEND="app-arch/xz-utils
+ dev-lang/perl"
+RDEPEND="!!media-sound/alsa-headers"
+
+S=${WORKDIR}/gentoo-headers-base-${PV}
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_prepare() {
+ [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/${PV}
+ epatch "${FILESDIR}"/glibc-specific-inclusion-of-sysinfo.h-in-kernel.h.patch
+ epatch "${FILESDIR}"/libc-compat.h-fix-some-issues-arising-from-in6.h.patch
+ epatch "${FILESDIR}"/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch
+}
+
+src_install() {
+ kernel-2_src_install
+
+ # hrm, build system sucks
+ find "${ED}" '(' -name '.install' -o -name '*.cmd' ')' -delete
+ find "${ED}" -depth -type d -delete 2>/dev/null
+
+ # provided by libdrm (for now?)
+ rm -rf "${ED}"/$(kernel_header_destdir)/drm
+}
+
+src_test() {
+ einfo "Possible unescaped attribute/type usage"
+ egrep -r \
+ -e '(^|[[:space:](])(asm|volatile|inline)[[:space:](]' \
+ -e '\<([us](8|16|32|64))\>' \
+ .
+
+ einfo "Missing linux/types.h include"
+ egrep -l -r -e '__[us](8|16|32|64)' "${ED}" | xargs grep -L linux/types.h
+
+ emake ARCH=$(tc-arch-kernel) headers_check
+}
diff --git a/sys-kernel/linux-headers/metadata.xml b/sys-kernel/linux-headers/metadata.xml
new file mode 100644
index 00000000..0cddf522
--- /dev/null
+++ b/sys-kernel/linux-headers/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>toolchain</herd>
+<upstream>
+ <remote-id type="cpe">cpe:/o:linux:linux_kernel</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-libs/efivar/Manifest b/sys-libs/efivar/Manifest
new file mode 100644
index 00000000..7814875e
--- /dev/null
+++ b/sys-libs/efivar/Manifest
@@ -0,0 +1,4 @@
+AUX efivar-0.15-portability.patch 871 SHA256 44cda9a0048fd3d59d44eb54e2439a2fd71e330b0db0d99bad469ccdff69bc7b SHA512 50eceab418dab2f699d17d6d94fd730f156f4d5fba5bc43fbe2eb1b923b2bde12f2e142fce596700798ae16463b9ef069df2538de224ec306bec4beafe54d6a9 WHIRLPOOL db04b8c6407139dcd627c799436a5543bad716b43155bad61530c7f68b767631125eb269c1ea151f429a897829e35cfddb378aa2ef80866013229239955f37c4
+DIST efivar-0.15.tar.bz2 26936 SHA256 08251e10dbee8a5a9851d859b98fc6cb479acfced38695a101bd8ed2a447051e SHA512 f6fbc71fa892366933f11f230f662ff7af515bcee3d4eb0279a3aeb6aa5bf21d86f86db928ff3cb4ed3366f52bd3fb8b959752759277ed4bf368a5fc223d62e9 WHIRLPOOL 8fd6a689b14aed7d8a9ed7d17fe4206416d5bb72d04843dab7de22c513cc0ad639daa8dad0de4c87e60164092d3c31c8d25973be03e20add99018c9a122bb9be
+EBUILD efivar-0.15-r99.ebuild 690 SHA256 b29e0b4fbe3d15baefedf73461a5f3d5819d11cb0a59528c23278580144d1d2f SHA512 94e01eba11348841e5b321c9108c3af31d138b722eeda238beea8456fa22899c2f6d455ccae895f519eff14f537a309d8d39183b02cd269f63ae227e4e94988a WHIRLPOOL 81664850ea85604386d274c067fed345b05bf16e389040f3828e4c09b8d8a31a20c7f630e11ae63a34f2d51c62d37d0fcf50c6cb54d99011f76ecd4e303e621f
+MISC metadata.xml 428 SHA256 027692e0063d3257f4dc694e5c332bd180708357d464a7c97a51859cb7d9afd3 SHA512 964bb532fcf28bfd978220a4de96635e1ec75cb4efd42070e8c4153ea6611fb015b03efc57f33e3064614335c5b7ed6fdfad2431bfa4167fff384e7a8d7de5ac WHIRLPOOL c0f6a624eea7f280eff533487cd5d7a0540786375acac851177e8b75642799339a60cc049e685d0bce0bad3e099eb81ddd64d1da94edfcd3e39be417775951d2
diff --git a/sys-libs/efivar/efivar-0.15-r99.ebuild b/sys-libs/efivar/efivar-0.15-r99.ebuild
new file mode 100644
index 00000000..94461c59
--- /dev/null
+++ b/sys-libs/efivar/efivar-0.15-r99.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/efivar/efivar-0.15.ebuild,v 1.5 2015/02/28 13:25:44 ago Exp $
+
+EAPI=5
+
+inherit multilib toolchain-funcs eutils
+
+DESCRIPTION="Tools and library to manipulate EFI variables"
+HOMEPAGE="https://github.com/vathpela/efivar"
+SRC_URI="https://github.com/vathpela/${PN}/releases/download/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+RDEPEND="dev-libs/popt"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-0.15-portability.patch" || die
+}
+
+src_configure() {
+ tc-export CC
+ export libdir="/usr/$(get_libdir)"
+}
diff --git a/sys-libs/efivar/files/efivar-0.15-portability.patch b/sys-libs/efivar/files/efivar-0.15-portability.patch
new file mode 100644
index 00000000..2c824a00
--- /dev/null
+++ b/sys-libs/efivar/files/efivar-0.15-portability.patch
@@ -0,0 +1,29 @@
+Portability fixes:
+
+- Initialize outbuf with the expected size! fixes a segfault with musl.
+- Really use __builtin_va_arg_pack_len().
+
+--- a/src/efivar.h
++++ b/src/efivar.h
+@@ -85,7 +85,7 @@ efi_set_variable(efi_guid_t guid, const char *name,
+ return -1;
+ }
+
+- if (__va_arg_pack_len() == 0)
++ if (__builtin_va_arg_pack_len() == 0)
+ return _efi_set_variable(guid, name, data, data_size,
+ attributes, 0644);
+
+diff --git a/src/makeguids.c b/src/makeguids.c
+index 321a7e7..7d68b8a 100644
+--- a/src/makeguids.c
++++ b/src/makeguids.c
+@@ -100,7 +100,7 @@ main(int argc, char *argv[])
+ err(1, "makeguids: could not read \"%s\"", argv[1]);
+
+ /* strictly speaking, this *has* to be too large. */
+- struct guidname *outbuf = calloc(inlen, sizeof (char));
++ struct guidname *outbuf = calloc(inlen, sizeof (struct guidname));
+ if (!outbuf)
+ err(1, "makeguids");
+
diff --git a/sys-libs/efivar/metadata.xml b/sys-libs/efivar/metadata.xml
new file mode 100644
index 00000000..1a973701
--- /dev/null
+++ b/sys-libs/efivar/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>yannick.schaeffer@epfl.ch</email>
+ <name>Yannick Schaeffer</name>
+ <description>Mantainer. Assign bugs to him</description>
+ </maintainer>
+ <maintainer>
+ <email>floppym@gentoo.org</email>
+ <name>Mike Gilbert</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/gdbm/Manifest b/sys-libs/gdbm/Manifest
new file mode 100644
index 00000000..3830da57
--- /dev/null
+++ b/sys-libs/gdbm/Manifest
@@ -0,0 +1,4 @@
+DIST gdbm-1.11.tar.gz 811662 SHA256 8d912f44f05d0b15a4a5d96a76f852e905d051bb88022fcdfd98b43be093e3c3 SHA512 272fb65ab9ca0a21e9f0dcfb2c638457e87cbb938c65ee850123474d11f2858496f84d3fa9edca27cd91c7220160cfdb59f90bd46ddc45395514addc9fd4151c WHIRLPOOL 827f100826273fb8e6d8fdc88fffdb81e5630a7d07bdbeeb7d25759809c5165613446567b0b48bf862d4a4b231e5db921e28c9d6915e669fd0ce795f4a9f150a
+DIST gdbm-1.8.3.tar.gz 228695 SHA256 cc340338a2e28b40058ab9eb5354a21d53f88a1582ea21ba0bb185c37a281dc9 SHA512 2a01751ee8f730db563b4f52185c72f1c7a4f66530d6736f05f7446153be685ea0bb6ea1d2bad16ce31547fea879dc48507ff65ad35b0973df9aa385713b10d7 WHIRLPOOL 9d2e402b2ec00cadfc64e40d87da095f293f157386abbe9a64ebe8b7a2af9b965546805826ffe3d5c88212dec0628ab2ae3ebef91de2da7fc69d0937d03d7075
+EBUILD gdbm-1.11-r99.ebuild 1776 SHA256 bc764e80b163a99f205ceda8572205156dfeb2d8caed4248b217f517a4287716 SHA512 44950681a966bb2ed4afc3b3bb0470aa5acfc2455df1c7f7069ac4c366fdcfc839628cb6ad00e9174f65f5700d7fa5345e26940ab611a2dfa4a95ffcbd7f6ddd WHIRLPOOL 5f9eb5fb44b379f99858f21b81aeab92dee6cacb24a1fa1ebb30b70bd9b045fe75e5648ecbe2c2c7dc840673c0292b9b26fdc04815aa43e37422c3dcdca6c365
+MISC metadata.xml 382 SHA256 08df40c74ce04dcb73a182dbb283233242bd568c16b00b20c7eaa97da80c75e2 SHA512 d496626e7351cd4266055755ff7ec3c5ceff5b73ec9c2100c45ce3f7930224e651ea3b92146e9808f1026f8af43617c236e79266323037607872a7c76592a7f7 WHIRLPOOL 3a76dff01b89a3e9a4cd27f41fdc09f6a40a3dc048d7efb5f83e1ca1bbcec6af62409126b2c97f6b03cb147c2b4d4a3cc9002185c0663320b2e0b02567ac72cd
diff --git a/sys-libs/gdbm/gdbm-1.11-r99.ebuild b/sys-libs/gdbm/gdbm-1.11-r99.ebuild
new file mode 100644
index 00000000..7ac020f9
--- /dev/null
+++ b/sys-libs/gdbm/gdbm-1.11-r99.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/gdbm/gdbm-1.11.ebuild,v 1.1 2014/01/13 15:41:08 polynomial-c Exp $
+
+EAPI="4"
+
+inherit flag-o-matic libtool multilib multilib-minimal
+
+EX_P="${PN}-1.8.3"
+DESCRIPTION="Standard GNU database libraries"
+HOMEPAGE="http://www.gnu.org/software/gdbm/"
+SRC_URI="mirror://gnu/gdbm/${P}.tar.gz
+ exporter? ( mirror://gnu/gdbm/${EX_P}.tar.gz )"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+berkdb exporter nls static-libs"
+
+RDEPEND="
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r4
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+EX_S="${WORKDIR}"/${EX_P}
+
+src_prepare() {
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # gdbm doesn't appear to use either of these libraries
+ export ac_cv_lib_dbm_main=no ac_cv_lib_ndbm_main=no
+
+ if multilib_build_binaries && use exporter ; then
+ pushd "${EX_S}" >/dev/null
+ append-lfs-flags
+ econf --disable-shared
+ popd >/dev/null
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --includedir="${EPREFIX}"/usr/include/gdbm \
+ --with-gdbm183-libdir="${EX_S}/.libs" \
+ --with-gdbm183-includedir="${EX_S}" \
+ $(use_enable berkdb libgdbm-compat) \
+ $(multilib_build_binaries && use_enable exporter gdbm-export) \
+ $(use_enable nls) \
+ $(use_enable static-libs static)
+}
+
+multilib_src_compile() {
+ use exporter && emake -C "${EX_S}" libgdbm.la
+ emake
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}" -name '*.la' -delete
+ mv "${ED}"/usr/include/gdbm/gdbm.h "${ED}"/usr/include/ || die
+}
+
+pkg_preinst() {
+ preserve_old_lib libgdbm{,_compat}.so.{2,3} #32510
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify libgdbm{,_compat}.so.{2,3} #32510
+}
diff --git a/sys-libs/gdbm/metadata.xml b/sys-libs/gdbm/metadata.xml
new file mode 100644
index 00000000..07b37856
--- /dev/null
+++ b/sys-libs/gdbm/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='berkdb'>enable compatibility layer for UNIX-like dbm and ndbm interfaces</flag>
+ <flag name='exporter'>enable gdbmexport binary for exporting data from gdbm-1.8 databases into gdbm-1.9</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-libs/libcap-ng/Manifest b/sys-libs/libcap-ng/Manifest
new file mode 100644
index 00000000..11ae6c14
--- /dev/null
+++ b/sys-libs/libcap-ng/Manifest
@@ -0,0 +1,6 @@
+AUX libcap-ng-0.7.3-add-missing-unistd_h.patch 398 SHA256 8f0f12407d3bdfb9d5d01692ce01916ce69fe6c203e7aefd99681c0ab9e55a68 SHA512 99b3ac95a1b010856b09f3aa63af416532cfddc49f6175c6e707bd99ed14d50b0e224c64e70bf616b30f57bd554e25318c2d7e1032c9a187413c81c908f31c66 WHIRLPOOL 4f6b7052d55f6ea147ab265db5266d9b1c64d8a49c3ced1284196e6137bb9f9d05ad3a24fac10c94331fe51bee872518aee7c4ce20e49919c645057846ead214
+DIST libcap-ng-0.7.3.tar.gz 392613 SHA256 5ca441c8d3a1e4cfe8a8151907977662679457311ccaa7eaac91447c33a35bb1 SHA512 f03a35c54b5998ef2e712540caa1f4ade37f9abe60992a1e727142b26815a4b8a7ce86ea94466fe692e4798c7297e5e1bbd338e5afe05689905ee9e0c0f16ef2 WHIRLPOOL 7752a70ea348dfc52537f67d5dccab03d598a112a7263a8811987453b53cda58643e938b4651c5cd8d0ea02f20fddc10bff2ac8bc23f68f97c9ab8c5791429ab
+DIST libcap-ng-0.7.4.tar.gz 407007 SHA256 48a2083276f9820cb92dcb05d001b30733bcbf48c14c230303cac3cd08b45b6b SHA512 443b92f44cffd4b436a2651eb3539c560382102d918faf63f993d3b6627c03e80f7b4a5105ddb040890ef82122a42ca6881795ab0639de337f693705f5506cf0 WHIRLPOOL 3d62f26fad8c9e7756374022982a4f2fcdde5af5532474dfa7eb6ba1bc7f97984691bdda8975ef32423b8e86af2462ef672ba3175a3121a484c46096cc8f10b2
+EBUILD libcap-ng-0.7.3-r99.ebuild 2540 SHA256 f833f7500c634248076f78762f87b1e88b67d31106aec7c91a6e1b71fae10f84 SHA512 2655051f3ecb442e1b06173991e93ba1db3b8a0b4c10fd30c0408cb21824c4cacdeb02b60e06027b3232086f08ceff7d4acd427cd1b79c33156eec37ceba6c90 WHIRLPOOL 6c7e871a73c374ee90919354e74ab45d40356d12a4e0e33c25c0e9d3580979302c50271d9e2a01d072b29189bf425fda18125c2eaafb0ca44cc6455052a06dc3
+EBUILD libcap-ng-0.7.4-r99.ebuild 2092 SHA256 668d18348988182957545c68b84a4085d5652fbdf2cc827b9608bf919cb9ca1b SHA512 c0d469ee46b6e83ee4e55788a372ab9b7546223f9d3399e6fadae46eeae453eac934bd3ed7748293160b0032ce18679ae247315738a0edb194b66189428f9c30 WHIRLPOOL 9722b249a472511e20bcb0c4ff1dc8b5500f197cb3ba0795ecde6c05385526e359f0986abe9ad5516e2478144bc895517fbf3b7e5716fac13815a2a2657573ac
+MISC metadata.xml 501 SHA256 2ba6118979e987255eff0de2453eff6e9a76d4e2ffa04e3acbe1bc92fda0a171 SHA512 f974d0009e90640257cab704897db67cc736663313d026ba2092a6aaae004973416e1f649c9d7a0373b1f58d49db8103217e85803faa8c37a7830c9057f2c5e8 WHIRLPOOL 38c2e18fffda49e0b81e47bce317af92b0e992d1371c79e2e8bed04ea69e704902e005af8693735f7bf1fbf8d1cda5bea6ec9e0c20886018103914d11a95ec30
diff --git a/sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch b/sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch
new file mode 100644
index 00000000..fa6fab2c
--- /dev/null
+++ b/sys-libs/libcap-ng/files/libcap-ng-0.7.3-add-missing-unistd_h.patch
@@ -0,0 +1,11 @@
+diff -Naur libcap-ng-0.7.3.orig/utils/proc-llist.c libcap-ng-0.7.3/utils/proc-llist.c
+--- libcap-ng-0.7.3.orig/utils/proc-llist.c 2012-11-09 19:59:13.000000000 +0000
++++ libcap-ng-0.7.3/utils/proc-llist.c 2014-02-22 15:58:17.933566760 +0000
+@@ -24,6 +24,7 @@
+ #include "config.h"
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ #include "proc-llist.h"
+
+ void list_create(llist *l)
diff --git a/sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild b/sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild
new file mode 100644
index 00000000..27d737d7
--- /dev/null
+++ b/sys-libs/libcap-ng/libcap-ng-0.7.3-r99.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap-ng/libcap-ng-0.7.3.ebuild,v 1.14 2014/01/19 20:11:39 vapier Exp $
+
+EAPI=5
+
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
+
+inherit autotools eutils flag-o-matic python
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/"
+SRC_URI="http://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="python static-libs"
+
+RDEPEND="python? ( dev-lang/python )"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers
+ python? ( >=dev-lang/swig-2 )"
+
+PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
+
+pkg_setup() {
+ use python && python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-add-missing-unistd_h.patch
+
+ # Disable byte-compilation of Python modules.
+ >py-compile
+
+ # Python bindings are built/tested/installed manually.
+ sed -i -e "/^SUBDIRS/s/ python//" bindings/Makefile.am || die
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
+
+ eautoreconf
+
+ use sparc && replace-flags -O? -O0
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static) \
+ $(use_with python)
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ python_copy_sources bindings/python
+
+ building() {
+ emake \
+ CFLAGS="${CFLAGS}" \
+ PYTHON_VERSION="$(python_get_version)" \
+ pyexecdir="$(python_get_sitedir)" \
+ pythondir="$(python_get_sitedir)"
+ }
+ python_execute_function -s --source-dir bindings/python building
+ fi
+}
+
+src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions."
+ return
+ fi
+
+ default
+
+ if use python; then
+ testing() {
+ emake \
+ PYTHON_VERSION="$(python_get_version)" \
+ pyexecdir="$(python_get_sitedir)" \
+ pythondir="$(python_get_sitedir)" \
+ TESTS_ENVIRONMENT="PYTHONPATH=..:../.libs" \
+ check
+ }
+ python_execute_function -s --source-dir bindings/python testing
+ fi
+}
+
+src_install() {
+ default
+
+ if use python; then
+ installation() {
+ emake \
+ DESTDIR="${D}" \
+ PYTHON_VERSION="$(python_get_version)" \
+ pyexecdir="$(python_get_sitedir)" \
+ pythondir="$(python_get_sitedir)" \
+ install
+ }
+ python_execute_function -s --source-dir bindings/python installation
+
+ python_clean_installation_image
+ fi
+
+ rm -f "${ED}"/usr/lib*/${PN}.la
+}
+
+pkg_postinst() {
+ use python && python_mod_optimize capng.py
+}
+
+pkg_postrm() {
+ use python && python_mod_cleanup capng.py
+}
diff --git a/sys-libs/libcap-ng/libcap-ng-0.7.4-r99.ebuild b/sys-libs/libcap-ng/libcap-ng-0.7.4-r99.ebuild
new file mode 100644
index 00000000..92aacacd
--- /dev/null
+++ b/sys-libs/libcap-ng/libcap-ng-0.7.4-r99.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcap-ng/libcap-ng-0.7.4.ebuild,v 1.10 2014/12/06 16:40:48 ago Exp $
+
+EAPI=5
+
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit autotools-utils flag-o-matic python-r1
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/"
+SRC_URI="http://people.redhat.com/sgrubb/${PN}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="python static-libs"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers
+ python? ( >=dev-lang/swig-2 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.7.3-add-missing-unistd_h.patch
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die
+
+ autotools-utils_src_prepare
+
+ use sparc && replace-flags -O? -O0
+}
+
+src_configure() {
+ local myeconfargs=(
+ --without-python
+ )
+
+ # set up the library build
+ autotools-utils_src_configure
+
+ if use python; then
+ python_parallel_foreach_impl \
+ autotools-utils_src_configure --with-python
+ fi
+}
+
+src_compile() {
+ autotools-utils_src_compile
+
+ if use python; then
+ python_compile() {
+ local CFLAGS=${CFLAGS}
+
+ python_is_python3 || CFLAGS+=" -fno-strict-aliasing"
+
+ emake "${@}" \
+ -C "${BUILD_DIR}"/bindings/python
+ }
+
+ # help build system find the right objects
+ python_foreach_impl python_compile \
+ VPATH="${BUILD_DIR}"/bindings/python \
+ LIBS="${BUILD_DIR}"/src/libcap-ng.la
+ fi
+}
+
+src_test() {
+ if [[ "${EUID}" -eq 0 ]]; then
+ ewarn "Skipping tests due to root permissions."
+ return
+ fi
+
+ autotools-utils_src_test
+
+ if use python; then
+ python_foreach_impl \
+ autotools-utils_src_compile -C bindings/python check \
+ VPATH="${BUILD_DIR}"/bindings/python:"${S}"/bindings/python/test
+ fi
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ if use python; then
+ python_foreach_impl \
+ autotools-utils_src_install -C bindings/python \
+ VPATH="${BUILD_DIR}"/bindings/python
+ fi
+}
diff --git a/sys-libs/libcap-ng/metadata.xml b/sys-libs/libcap-ng/metadata.xml
new file mode 100644
index 00000000..703c2526
--- /dev/null
+++ b/sys-libs/libcap-ng/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>
+ <longdescription>The libcap-ng library is intended to make programming with
+ POSIX capabilities much easier than the traditional libcap library. It
+ includes utilities that can analyse all currently running applications and
+ print out any capabilities and whether or not it has an open ended bounding
+ set.</longdescription>
+</pkgmetadata>
diff --git a/sys-libs/libutempter/Manifest b/sys-libs/libutempter/Manifest
new file mode 100644
index 00000000..adc76aa4
--- /dev/null
+++ b/sys-libs/libutempter/Manifest
@@ -0,0 +1,4 @@
+AUX libutempter-remove-glibc-assumption.patch 1704 SHA256 4116a2dfb6925b2a513d2e289dd9e2f18160202af8be12d99fbb77d94e2e3941 SHA512 2d487a44ae3c84417f3dd55917ae707bee682b811ebe7aefe8b50aa9f309f879a7f9ed5cbce08119b6fea7dfddb97702348cfbb05ed45e79f95952d15f0366ff WHIRLPOOL e761bbf80fbc4b3323e176f21cb9f2fb2a9bddae7bd22c8975cd05aae1f673f0c2563e0099f5195b76432f0fe12ace7e866f844c533b505643ae2d90f0295f1d
+DIST libutempter-1.1.6.tar.bz2 15705 SHA256 b898565f31ced7e5c1fa0a2eaa0f6ff0ed862b5fe375d26375b64bfbdfeac397 SHA512 6ada410b981d157ae20b578de8ce20997ec0446ec6de6859549b080aa65976fc9900d211600dab09dc3d0d109daabad0994a648b093b8781b442ff26ca17fede WHIRLPOOL c94d42d6929754608f9504defec3ab5b4c5c61fd0baa373e07508a11167241c07de4ecf26e14271e2c9914b731afba12ff7930e8ecd0126da1f472dccabdea30
+EBUILD libutempter-1.1.6-r99.ebuild 1834 SHA256 d347a8dc90c95c27869b9089014689a5d414f202c153318d79c0b8ef0ce6c928 SHA512 e1cc023b4d0adc14e7c273ad588ba2197c498ba5f2e8d13b84d18c1ac95dfe5a5255412f0d926c8df6817966ebc06cff1ecb41a496d37bbdaf85b428ae2f7f10 WHIRLPOOL 4b2e6bc54f98bbc602d5f0a368672dd0096b29620005a8cda8017a87d319ed9c16cc5db4a17a0d5e8f18eb3348528b86fc6f56a4926b7b082de88a7591ce06fa
+MISC metadata.xml 183 SHA256 0903359b99ca4bfefc1aa654cc0c787e6b104ec133318f522842aab7e42f9286 SHA512 db31aeacd92ae0a3081eb18c65711705b0fb162a75e45b8b0c1775d3ebc11ef3260f5c9ea80c19d40a7ea3b1d086fcfe9417def53085dafc64677fb58d3a2659 WHIRLPOOL c8b29cb8cb38d204f2ec96033ac02369ae1c71148eb282e0d7cc1ad345e69467078dcf75d85f72477657d917f8ba69394f4cde850b9adf97d41ae1f75cc4c344
diff --git a/sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch b/sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch
new file mode 100644
index 00000000..6ed93355
--- /dev/null
+++ b/sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch
@@ -0,0 +1,81 @@
+diff -Naur libutempter-1.1.6.orig/utempter.c libutempter-1.1.6/utempter.c
+--- libutempter-1.1.6.orig/utempter.c 2010-11-04 13:14:53.000000000 -0400
++++ libutempter-1.1.6/utempter.c 2014-06-20 16:37:09.762403323 -0400
+@@ -34,13 +34,7 @@
+ #include <sys/stat.h>
+ #include <utmp.h>
+
+-#ifdef __GLIBC__
+ # include <pty.h>
+-#elif defined(__FreeBSD__)
+-# include <libutil.h>
+-#else
+-# error Unsupported platform
+-#endif /* __GLIBC__ || __FreeBSD__ */
+
+ #define DEV_PREFIX "/dev/"
+ #define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1)
+@@ -106,17 +100,12 @@
+
+ static int
+ write_uwtmp_record(const char *user, const char *term, const char *host,
+-#ifdef __GLIBC__
+ pid_t pid,
+-#endif
+ int add)
+ {
+ struct utmp ut;
+ struct timeval tv;
+-
+-#ifdef __GLIBC__
+ size_t offset;
+-#endif
+
+ memset(&ut, 0, sizeof(ut));
+
+@@ -128,8 +117,6 @@
+ if (host)
+ strncpy(ut.ut_host, host, sizeof(ut.ut_host));
+
+-#ifdef __GLIBC__
+-
+ offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 :
+ strlen(term) - sizeof(ut.ut_id);
+ strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id));
+@@ -156,27 +143,6 @@
+
+ (void) updwtmp(_PATH_WTMP, &ut);
+
+-#elif defined(__FreeBSD__)
+-
+- ut.ut_time = tv.tv_sec;
+-
+- if (add)
+- {
+- login(&ut);
+- } else
+- {
+- if (logout(term) != 1)
+- {
+-#ifdef UTEMPTER_DEBUG
+- fprintf(stderr, "utempter: logout: %s\n",
+- strerror(errno));
+-#endif
+- exit(EXIT_FAILURE);
+- }
+- }
+-
+-#endif /* __GLIBC__ || __FreeBSD__ */
+-
+ #ifdef UTEMPTER_DEBUG
+ fprintf(stderr,
+ "utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n",
+@@ -255,8 +221,6 @@
+ validate_device(device);
+
+ return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host,
+-#ifdef __GLIBC__
+ pid,
+-#endif
+ add);
+ }
diff --git a/sys-libs/libutempter/libutempter-1.1.6-r99.ebuild b/sys-libs/libutempter/libutempter-1.1.6-r99.ebuild
new file mode 100644
index 00000000..e4049be2
--- /dev/null
+++ b/sys-libs/libutempter/libutempter-1.1.6-r99.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild,v 1.1 2014/05/06 12:52:04 chainsaw Exp $
+
+EAPI="4"
+
+inherit eutils user multilib flag-o-matic
+
+DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access"
+HOMEPAGE="http://altlinux.org/index.php?module=sisyphus&package=libutempter"
+SRC_URI="ftp://ftp.altlinux.org/pub/people/ldv/${PN}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="static-libs elibc_FreeBSD"
+
+RDEPEND="!sys-apps/utempter"
+
+pkg_setup() {
+ enewgroup utmp 406
+}
+
+src_prepare() {
+ local args=(
+ -e "/^libdir /s:/usr/lib:${EPREFIX}/usr/$(get_libdir):"
+ -e '/^libexecdir /s:=.*:= $(libdir)/misc:'
+ -e '/^CFLAGS = $(RPM_OPT_FLAGS)/d'
+ -e 's:,-stats::'
+ -e "/^includedir /s:/usr/include:${EPREFIX}/usr/include:"
+ -e "/^mandir /s:=.*:= ${EPREFIX}/usr/share/man:"
+ )
+ use static-libs || args+=(
+ -e '/^STATICLIB/d'
+ -e '/INSTALL.*STATICLIB/d'
+ )
+ sed -i "${args[@]}" Makefile || die
+
+ epatch "${FILESDIR}"/${PN}-remove-glibc-assumption.patch
+}
+
+src_configure() {
+ use elibc_FreeBSD && append-libs -lutil
+ tc-export AR CC
+}
+
+src_compile() {
+ emake LDLIBS="${LIBS}"
+}
+
+src_install() {
+ default
+
+ if ! use prefix ; then
+ fowners root:utmp /usr/$(get_libdir)/misc/utempter/utempter
+ fperms 2755 /usr/$(get_libdir)/misc/utempter/utempter
+ fi
+ dodir /usr/sbin
+ dosym ../$(get_libdir)/misc/utempter/utempter /usr/sbin/utempter
+}
+
+pkg_postinst() {
+ if [ -f "${EROOT}/var/log/wtmp" ] ; then
+ chown root:utmp "${EROOT}/var/log/wtmp"
+ chmod 664 "${EROOT}/var/log/wtmp"
+ fi
+
+ if [ -f "${EROOT}/var/run/utmp" ] ; then
+ chown root:utmp "${EROOT}/var/run/utmp"
+ chmod 664 "${EROOT}/var/run/utmp"
+ fi
+}
diff --git a/sys-libs/libutempter/metadata.xml b/sys-libs/libutempter/metadata.xml
new file mode 100644
index 00000000..5aafc105
--- /dev/null
+++ b/sys-libs/libutempter/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-libs/pam/Manifest b/sys-libs/pam/Manifest
new file mode 100644
index 00000000..db75f3ad
--- /dev/null
+++ b/sys-libs/pam/Manifest
@@ -0,0 +1,7 @@
+AUX pam-1.1.8-doc-install.patch 6592 SHA256 83edb1f57e3fa579bde4cd9ba05966063106f0dc8e57458eea9857250b1a0fb5 SHA512 335220790207c3cb9c84420f13e5e1ea8e42e2b5402def0d0f9425ae89b37c8aef66eb9906c58eeb249bd1ca27af711015c363421d4096206ea44c4c4beea302 WHIRLPOOL ae6df174b9457bcfd85f41b72ec22054898c0c86f9bb0b170ec3e6c747140d1ac3fba3e684e2c4c9c12bb4a1429996a5bb999c9dc2c7693d5109e52f383d1fcf
+AUX pam-1.1.8-fix-compat.patch 402 SHA256 c783156888287b44816b4a32c946af657c0a43d8926fe7bd9f54d9768ee8f699 SHA512 1178ead83fdc872a626576c620876d013cbeb6199edb704c8d91cb906b9aabc1dd02e11a27a792cb87179554dcaf3080d04478317e03cf34cea23bf42b65fe2f WHIRLPOOL 692d3df998b7c29f1a7ea4c75cbeabdb6a907d7a8ca0b9e22f9c02df883db6af6b2052f67f4778cf97667456d54abed7f89fb43ed1bcb01c9fdef42f63d2762f
+AUX pam-1.1.8-innetgr.patch 1662 SHA256 fb609212837c67da7da033a0daa01d1c2e34166867530e6924102b655e00ebde SHA512 ca32ecdacfc5b8f1482031203b616932b646a008b02080315ea2589af5962180d4ff4339c27fe9f6a878a89f47fb69429f4ac75d67b0e70ad7765a4db1dc74d9 WHIRLPOOL 3034a8cd10f26c303546a99c0ae7de38d016d537deae81e52cc510c515d7e8b7d703bf257fac8d737588add225e125d7a90f6f35cc811eb1330cb3cc88d67048
+DIST Linux-PAM-1.1.8-docs.tar.bz2 147887 SHA256 c4bb6a0e8307d2ab5611457fecf20fcbd6cdfff51dea524f0f06c74e4f3b4ff8 SHA512 36aa99996f8cc0640686d2af40845e18ad4b48183f18de9e1495427550ad5b61e2f59e25f6d5e8df1277cd3f171fd69bf6c49fe7c5b31f0b290e3641b65521e8 WHIRLPOOL c4b373e59fac30a29c2b16f01419492c72fae2ceb15b157418bba4899b75cf4b97bac4559b688ef8d5a231cc972f72654c4e10d63a0b72a0d6573388f7125f87
+DIST Linux-PAM-1.1.8.tar.bz2 1148944 SHA256 c4b1f23a236d169e2496fea20721578d864ba00f7242d2b41d81050ac87a1e55 SHA512 245785ab4e187ceaab6393967352c8d2a2319c64e1e83285d0251cc02995dc2edab8e3001301b6d9f6774c441b7557d9caf4dfdf94c7cd5d44aa53ae759d9e5d WHIRLPOOL b4ec7baeb57b9d987086fe3e007e08e8b9c92b2ff86a94f8003a87c8448925835808661cd719d2445570aa8dd1c20fcbbe8bd465d73f4af8cd7edde0f650a734
+EBUILD pam-1.1.8-r99.ebuild 6289 SHA256 d9fac218f4e3a095a1d7bbe62d65db2c73a5183681b28006972c2575a1473221 SHA512 f341057c9234e57e102c38d46bdb2670bc6e2c50e53a3175cf3e65a35bd37e633712608f458b2e59fb7ec61a41169279efdbeeb4be468d5ba9287239ca5033e1 WHIRLPOOL 074506f012d3d820951d003b1350f62f9745d841b26ad7c89a345c819734c6cfd26d69a89f4f08dfb4c3ac67bf68e9b938d630fa3887cea33dcc0a7dcde18e7c
+MISC metadata.xml 1218 SHA256 9ea95e669c343b7e7184d3fb3b1bbad013493bfdca0e8f184ddf4728e6b5e884 SHA512 60ae70d605f654867e4c444c7489ecd76083c286039febd71ffd18a9e120b151a47488df925ec97e6768c62e5e48068abb864a6b978abd67623fb0b6c414f248 WHIRLPOOL a96d70fd81604dd265f15672183b793d0c3f48508b317f973481c460d56ea05d917a446fd60998536f7a3d811407ca3573554f9dcdc8f45ab88dbbf7875985ab
diff --git a/sys-libs/pam/files/pam-1.1.8-doc-install.patch b/sys-libs/pam/files/pam-1.1.8-doc-install.patch
new file mode 100644
index 00000000..bdd5b9d4
--- /dev/null
+++ b/sys-libs/pam/files/pam-1.1.8-doc-install.patch
@@ -0,0 +1,142 @@
+https://bugs.gentoo.org/473650
+https://fedorahosted.org/linux-pam/ticket/31
+
+fix doc installs when doing out of tree builds
+
+--- a/doc/adg/Makefile.in
++++ b/doc/adg/Makefile.in
+@@ -463,17 +463,17 @@ install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ $(mkinstalldirs) $(DESTDIR)$(pdfdir)
+ $(mkinstalldirs) $(DESTDIR)$(htmldir)
+- test -f html/Linux-PAM_ADG.html || exit 0; \
++ test -f html/Linux-PAM_ADG.html -o -f $(srcdir)/html/Linux-PAM_ADG.html || exit 0; \
+ $(install_sh_DATA) html/Linux-PAM_ADG.html html/adg-*.html \
+ $(DESTDIR)$(htmldir)/ || \
+ $(install_sh_DATA) $(srcdir)/html/Linux-PAM_ADG.html \
+- $(srcdir)/html/sag-*.html \
++ $(srcdir)/html/adg-*.html \
+ $(DESTDIR)$(htmldir)/
+- test -f Linux-PAM_ADG.txt || exit 0; \
++ test -f Linux-PAM_ADG.txt -o -f $(srcdir)/Linux-PAM_ADG.txt || exit 0; \
+ $(install_sh_DATA) Linux-PAM_ADG.txt $(DESTDIR)$(docdir)/ || \
+ $(install_sh_DATA) $(srcdir)/Linux-PAM_ADG.txt \
+ $(DESTDIR)$(docdir)/
+- test -f Linux-PAM_ADG.pdf || exit 0; \
++ test -f Linux-PAM_ADG.pdf -o -f $(srcdir)/Linux-PAM_ADG.pdf || exit 0; \
+ $(install_sh_DATA) Linux-PAM_ADG.pdf $(DESTDIR)$(pdfdir)/ || \
+ $(install_sh_DATA) $(srcdir)/Linux-PAM_ADG.pdf \
+ $(DESTDIR)$(pdfdir)/
+@@ -486,18 +486,18 @@ uninstall-local:
+
+ releasedocs: all
+ $(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/html
+- test -f html/Linux-PAM_ADG.html || exit 0; \
++ test -f html/Linux-PAM_ADG.html -o -f $(srcdir)/html/Linux-PAM_ADG.html || exit 0; \
+ cp -ap html/Linux-PAM_ADG.html html/adg-*.html \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/html/ || \
+ cp -ap $(srcdir)/html/Linux-PAM_ADG.html \
+ $(srcdir)/html/adg-*.html \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/html/
+- test -f Linux-PAM_ADG.txt || exit 0; \
++ test -f Linux-PAM_ADG.txt -o -f $(srcdir)/Linux-PAM_ADG.txt || exit 0; \
+ cp -p Linux-PAM_ADG.txt \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/ || \
+ cp -p $(srcdir)/Linux-PAM_ADG.txt \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/
+- test -f Linux-PAM_ADG.pdf || exit 0; \
++ test -f Linux-PAM_ADG.pdf -o -f $(srcdir)/Linux-PAM_ADG.pdf || exit 0; \
+ cp -p Linux-PAM_ADG.pdf \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/adg/ || \
+ cp -p $(srcdir)/Linux-PAM_ADG.pdf \
+--- a/doc/mwg/Makefile.in
++++ b/doc/mwg/Makefile.in
+@@ -463,17 +463,17 @@ install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ $(mkinstalldirs) $(DESTDIR)$(pdfdir)
+ $(mkinstalldirs) $(DESTDIR)$(htmldir)
+- test -f html/Linux-PAM_MWG.html || exit 0; \
++ test -f html/Linux-PAM_MWG.html -o -f $(srcdir)/html/Linux-PAM_MWG.html || exit 0; \
+ $(install_sh_DATA) html/Linux-PAM_MWG.html html/mwg-*.html \
+ $(DESTDIR)$(htmldir)/ || \
+ $(install_sh_DATA) $(srcdir)/html/Linux-PAM_MWG.html \
+- $(srcdir)/html/sag-*.html \
++ $(srcdir)/html/mwg-*.html \
+ $(DESTDIR)$(htmldir)/
+- test -f Linux-PAM_MWG.txt || exit 0; \
++ test -f Linux-PAM_MWG.txt -o -f $(srcdir)/Linux-PAM_MWG.txt || exit 0; \
+ $(install_sh_DATA) Linux-PAM_MWG.txt $(DESTDIR)$(docdir)/ || \
+ $(install_sh_DATA) $(srcdir)/Linux-PAM_MWG.txt \
+ $(DESTDIR)$(docdir)/
+- test -f Linux-PAM_MWG.pdf || exit 0; \
++ test -f Linux-PAM_MWG.pdf -o -f $(srcdir)/Linux-PAM_MWG.pdf || exit 0; \
+ $(install_sh_DATA) Linux-PAM_MWG.pdf $(DESTDIR)$(pdfdir)/ || \
+ $(install_sh_DATA) $(srcdir)/Linux-PAM_MWG.pdf \
+ $(DESTDIR)$(pdfdir)/
+@@ -486,18 +486,18 @@ uninstall-local:
+
+ releasedocs: all
+ $(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/html
+- test -f html/Linux-PAM_MWG.html || exit 0; \
++ test -f html/Linux-PAM_MWG.html -o -f $(srcdir)/html/Linux-PAM_MWG.html || exit 0; \
+ cp -ap html/Linux-PAM_MWG.html html/mwg-*.html \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/html/ || \
+ cp -ap $(srcdir)/html/Linux-PAM_MWG.html \
+ $(srcdir)/html/mwg-*.html \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/html/
+- test -f Linux-PAM_MWG.txt || exit 0; \
++ test -f Linux-PAM_MWG.txt -o -f $(srcdir)/Linux-PAM_MWG.txt || exit 0; \
+ cp -p Linux-PAM_MWG.txt \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/ || \
+ cp -p $(srcdir)/Linux-PAM_MWG.txt \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/
+- test -f Linux-PAM_MWG.pdf || exit 0; \
++ test -f Linux-PAM_MWG.pdf -o -f $(srcdir)/Linux-PAM_MWG.pdf || exit 0; \
+ cp -p Linux-PAM_MWG.pdf \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/mwg/ || \
+ cp -p $(srcdir)/Linux-PAM_MWG.pdf \
+--- a/doc/sag/Makefile.in
++++ b/doc/sag/Makefile.in
+@@ -463,17 +463,17 @@ install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ $(mkinstalldirs) $(DESTDIR)$(pdfdir)
+ $(mkinstalldirs) $(DESTDIR)$(htmldir)
+- test -f html/Linux-PAM_SAG.html || exit 0; \
++ test -f html/Linux-PAM_SAG.html -o -f $(srcdir)/html/Linux-PAM_SAG.html || exit 0; \
+ $(install_sh_DATA) html/Linux-PAM_SAG.html html/sag-*.html \
+ $(DESTDIR)$(htmldir)/ || \
+ $(install_sh_DATA) $(srcdir)/html/Linux-PAM_SAG.html \
+ $(srcdir)/html/sag-*.html \
+ $(DESTDIR)$(htmldir)/
+- test -f Linux-PAM_SAG.txt || exit 0; \
++ test -f Linux-PAM_SAG.txt -o -f $(srcdir)/Linux-PAM_SAG.txt || exit 0; \
+ $(install_sh_DATA) Linux-PAM_SAG.txt $(DESTDIR)$(docdir)/ || \
+ $(install_sh_DATA) $(srcdir)/Linux-PAM_SAG.txt \
+ $(DESTDIR)$(docdir)/
+- test -f Linux-PAM_SAG.pdf || exit 0; \
++ test -f Linux-PAM_SAG.pdf -o -f $(srcdir)/Linux-PAM_SAG.pdf || exit 0; \
+ $(install_sh_DATA) Linux-PAM_SAG.pdf $(DESTDIR)$(pdfdir)/ || \
+ $(install_sh_DATA) $(srcdir)/Linux-PAM_SAG.pdf \
+ $(DESTDIR)$(pdfdir)/
+@@ -486,18 +486,18 @@ uninstall-local:
+
+ releasedocs: all
+ $(mkinstalldirs) $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/html
+- test -f html/Linux-PAM_SAG.html || exit 0; \
++ test -f html/Linux-PAM_SAG.html -o -f $(srcdir)/html/Linux-PAM_SAG.html || exit 0; \
+ cp -ap html/Linux-PAM_SAG.html html/sag-*.html \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/html/ || \
+ cp -ap $(srcdir)/html/Linux-PAM_SAG.html \
+ $(srcdir)/html/sag-*.html \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/html/
+- test -f Linux-PAM_SAG.txt || exit 0; \
++ test -f Linux-PAM_SAG.txt -o -f $(srcdir)/Linux-PAM_SAG.txt || exit 0; \
+ cp -p Linux-PAM_SAG.txt \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/ || \
+ cp -p $(srcdir)/Linux-PAM_SAG.txt \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/
+- test -f Linux-PAM_SAG.pdf || exit 0; \
++ test -f Linux-PAM_SAG.pdf -o -f $(srcdir)/Linux-PAM_SAG.pdf || exit 0; \
+ cp -p Linux-PAM_SAG.pdf \
+ $(top_builddir)/Linux-PAM-$(VERSION)/doc/sag/ || \
+ cp -p $(srcdir)/Linux-PAM_SAG.pdf \
diff --git a/sys-libs/pam/files/pam-1.1.8-fix-compat.patch b/sys-libs/pam/files/pam-1.1.8-fix-compat.patch
new file mode 100644
index 00000000..332f6096
--- /dev/null
+++ b/sys-libs/pam/files/pam-1.1.8-fix-compat.patch
@@ -0,0 +1,21 @@
+--- a/modules/pam_lastlog/pam_lastlog.c
++++ b/modules/pam_lastlog/pam_lastlog.c
+@@ -10,6 +10,7 @@
+
+ #include "config.h"
+
++#include <paths.h>
+ #include <fcntl.h>
+ #include <time.h>
+ #include <errno.h>
+@@ -48,6 +49,10 @@
+
+ #ifndef _PATH_BTMP
+ # define _PATH_BTMP "/var/log/btmp"
++#endif
++
++#ifndef __GLIBC__
++#define logwtmp(args...)
+ #endif
+
+ /* XXX - time before ignoring lock. Is 1 sec enough? */
diff --git a/sys-libs/pam/files/pam-1.1.8-innetgr.patch b/sys-libs/pam/files/pam-1.1.8-innetgr.patch
new file mode 100644
index 00000000..a94fa3da
--- /dev/null
+++ b/sys-libs/pam/files/pam-1.1.8-innetgr.patch
@@ -0,0 +1,54 @@
+--- Linux-PAM-1.1.3.orig/modules/pam_group/pam_group.c
++++ Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+@@ -658,10 +658,13 @@
+ continue;
+ }
+ /* If buffer starts with @, we are using netgroups */
++#ifdef HAVE_INNETGR
+ if (buffer[0] == '@')
+ good &= innetgr (&buffer[1], NULL, user, NULL);
+ /* otherwise, if the buffer starts with %, it's a UNIX group */
+- else if (buffer[0] == '%')
++ else
++#endif
++ if (buffer[0] == '%')
+ good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
+ else
+ good &= logic_field(pamh,user, buffer, count, is_same);
+--- Linux-PAM-1.1.3.orig/modules/pam_succeed_if/pam_succeed_if.c
++++ Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+@@ -233,16 +233,20 @@
+ static int
+ evaluate_innetgr(const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 1)
+ return PAM_SUCCESS;
++#endif
+ return PAM_AUTH_ERR;
+ }
+ /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
+ static int
+ evaluate_notinnetgr(const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 0)
+ return PAM_SUCCESS;
++#endif
+ return PAM_AUTH_ERR;
+ }
+
+--- Linux-PAM-1.1.3.orig/modules/pam_time/pam_time.c
++++ Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+@@ -554,9 +554,11 @@
+ continue;
+ }
+ /* If buffer starts with @, we are using netgroups */
++#ifdef HAVE_INNETGR
+ if (buffer[0] == '@')
+ good &= innetgr (&buffer[1], NULL, user, NULL);
+ else
++#endif
+ good &= logic_field(pamh, user, buffer, count, is_same);
+ D(("with user: %s", good ? "passes":"fails" ));
+
diff --git a/sys-libs/pam/metadata.xml b/sys-libs/pam/metadata.xml
new file mode 100644
index 00000000..4ee5aecd
--- /dev/null
+++ b/sys-libs/pam/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>pam</herd>
+ <maintainer>
+ <email>pam-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='audit'>Enable support for <pkg>sys-process/audit</pkg></flag>
+
+ <flag name="berkdb">
+ Build the pam_userdb module, that allows to authenticate users
+ against a Berkeley DB file. Please note that enabling this USE
+ flag will create a PAM module that links to the Berkeley DB (as
+ provided by <pkg>sys-libs/db</pkg>) installed in /usr/lib and
+ will thus not work for boot-critical services authentication.
+ </flag>
+
+ <flag name="cracklib">
+ Build the pam_cracklib module, that allows to verify the chosen
+ passwords' strength through the use of
+ <pkg>sys-libs/cracklib</pkg>. Please note that simply enabling
+ the USE flag on this package will not make use of pam_cracklib
+ by default, you should also enable it in
+ <pkg>sys-auth/pambase</pkg> as well as update your configuration
+ files.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:kernel:linux-pam</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-libs/pam/pam-1.1.8-r99.ebuild b/sys-libs/pam/pam-1.1.8-r99.ebuild
new file mode 100644
index 00000000..4b3c6596
--- /dev/null
+++ b/sys-libs/pam/pam-1.1.8-r99.ebuild
@@ -0,0 +1,205 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit libtool multilib multilib-minimal eutils pam toolchain-funcs flag-o-matic db-use
+
+MY_PN="Linux-PAM"
+MY_P="${MY_PN}-${PV}"
+
+HOMEPAGE="https://fedorahosted.org/linux-pam/"
+DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
+
+SRC_URI="http://www.linux-pam.org/library/${MY_P}.tar.bz2
+ http://www.linux-pam.org/documentation/${MY_P}-docs.tar.bz2"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="cracklib nls elibc_FreeBSD selinux vim-syntax audit test elibc_musl elibc_glibc debug berkdb nis"
+
+RDEPEND="nls? ( >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] )
+ cracklib? ( >=sys-libs/cracklib-2.9.1-r1[${MULTILIB_USEDEP}] )
+ audit? ( >=sys-process/audit-2.2.2[${MULTILIB_USEDEP}] )
+ selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+ berkdb? ( >=sys-libs/db-4.8.30-r1[${MULTILIB_USEDEP}] )
+ elibc_glibc? (
+ >=sys-libs/glibc-2.7
+ nis? ( || ( >=net-libs/libtirpc-0.2.4-r2[${MULTILIB_USEDEP}] <sys-libs/glibc-2.14 ) )
+ )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2
+ >=sys-devel/flex-2.5.39-r1[${MULTILIB_USEDEP}]
+ nls? ( sys-devel/gettext )
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+PDEPEND="sys-auth/pambase
+ vim-syntax? ( app-vim/pam-syntax )"
+RDEPEND="${RDEPEND}
+ !<sys-apps/openrc-0.11.8
+ !sys-auth/openpam
+ !sys-auth/pam_userdb
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r7
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S="${WORKDIR}/${MY_P}"
+
+check_old_modules() {
+ local retval="0"
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | fgrep -q pam_stack.so; then
+ eerror ""
+ eerror "Your current setup is using the pam_stack module."
+ eerror "This module is deprecated and no longer supported, and since version"
+ eerror "0.99 is no longer installed, nor provided by any other package."
+ eerror "The package will be built (to allow binary package builds), but will"
+ eerror "not be installed."
+ eerror "Please replace pam_stack usage with proper include directive usage,"
+ eerror "following the PAM Upgrade guide at the following URL"
+ eerror " http://www.gentoo.org/proj/en/base/pam/upgrade-0.99.xml"
+ eerror ""
+
+ retval=1
+ fi
+
+ if sed -e 's:#.*::' "${EROOT}"/etc/pam.d/* 2>/dev/null | egrep -q 'pam_(pwdb|console)'; then
+ eerror ""
+ eerror "Your current setup is using one or more of the following modules,"
+ eerror "that are not built or supported anymore:"
+ eerror "pam_pwdb, pam_console"
+ eerror "If you are in real need for these modules, please contact the maintainers"
+ eerror "of PAM through http://bugs.gentoo.org/ providing information about its"
+ eerror "use cases."
+ eerror "Please also make sure to read the PAM Upgrade guide at the following URL:"
+ eerror " http://www.gentoo.org/proj/en/base/pam/upgrade-0.99.xml"
+ eerror ""
+
+ retval=1
+ fi
+
+ return $retval
+}
+
+pkg_pretend() {
+ # do not error out, this is just a warning, one could build a binpkg
+ # with old modules enabled.
+ check_old_modules
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.1.8-doc-install.patch #473650
+ epatch "${FILESDIR}"/${PN}-1.1.8-fix-compat.patch
+ epatch "${FILESDIR}"/${PN}-1.1.8-innetgr.patch
+
+ # disable insecure modules (musl-libc doesn't implement the functions anyway)
+ use elibc_musl && sed -e 's/pam_rhosts//g' -i modules/Makefile.am modules/Makefile.in
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Disable automatic detection of libxcrypt; we _don't_ want the
+ # user to link libxcrypt in by default, since we won't track the
+ # dependency and allow to break PAM this way.
+ export ac_cv_header_xcrypt_h=no
+
+ # Disable automatic detection of libcrypt
+ use elibc_musl && export ac_cv_search_crypt=no
+
+ local myconf=(
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --enable-securedir="${EPREFIX}"/$(get_libdir)/security
+ --enable-isadir="${EPREFIX}"/$(get_libdir)/security
+ $(use_enable nls)
+ $(use_enable selinux)
+ $(use_enable cracklib)
+ $(use_enable audit)
+ $(use_enable debug)
+ $(use_enable berkdb db)
+ $(use_enable nis)
+ --with-db-uniquename=-$(db_findver sys-libs/db)
+ --disable-prelude
+ )
+
+ if use hppa || use elibc_FreeBSD; then
+ myconf+=( --disable-pie )
+ fi
+
+ ECONF_SOURCE=${S} \
+ econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake sepermitlockdir="${EPREFIX}/run/sepermit"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install \
+ sepermitlockdir="${EPREFIX}/run/sepermit"
+
+ local prefix
+ if multilib_is_native_abi; then
+ prefix=
+ gen_usr_ldscript -a pam pamc pam_misc
+ else
+ prefix=/usr
+ fi
+
+ # create extra symlinks just in case something depends on them...
+ local lib
+ for lib in pam pamc pam_misc; do
+ if ! [[ -f "${ED}"${prefix}/$(get_libdir)/lib${lib}$(get_libname) ]]; then
+ dosym lib${lib}$(get_libname 0) ${prefix}/$(get_libdir)/lib${lib}$(get_libname)
+ fi
+ done
+}
+
+DOCS=( CHANGELOG ChangeLog README AUTHORS Copyright NEWS )
+
+multilib_src_install_all() {
+ einstalldocs
+ prune_libtool_files --all
+
+ # Need to be suid
+ fperms u+s /sbin/unix_chkpwd
+
+ docinto modules
+ for dir in modules/pam_*; do
+ newdoc "${dir}"/README README."$(basename "${dir}")"
+ done
+
+ if use selinux; then
+ dodir /usr/lib/tmpfiles.d
+ cat - > "${D}"/usr/lib/tmpfiles.d/${CATEGORY}:${PN}:${SLOT}.conf <<EOF
+d /run/sepermit 0755 root root
+EOF
+ fi
+}
+
+pkg_preinst() {
+ check_old_modules || die "deprecated PAM modules still used"
+}
+
+pkg_postinst() {
+ ewarn "Some software with pre-loaded PAM libraries might experience"
+ ewarn "warnings or failures related to missing symbols and/or versions"
+ ewarn "after any update. While unfortunate this is a limit of the"
+ ewarn "implementation of PAM and the software, and it requires you to"
+ ewarn "restart the software manually after the update."
+ ewarn ""
+ ewarn "You can get a list of such software running a command like"
+ ewarn " lsof / | egrep -i 'del.*libpam\\.so'"
+ ewarn ""
+ ewarn "Alternatively, simply reboot your system."
+ if [[ -x "${EROOT}"/var/log/tallylog ]] ; then
+ elog ""
+ elog "Because of a bug present up to version 1.1.1-r2, you have"
+ elog "an executable /var/log/tallylog file. You can safely"
+ elog "correct it by running the command"
+ elog " chmod -x /var/log/tallylog"
+ elog ""
+ fi
+}
diff --git a/sys-libs/readline/Manifest b/sys-libs/readline/Manifest
new file mode 100644
index 00000000..7836e0d5
--- /dev/null
+++ b/sys-libs/readline/Manifest
@@ -0,0 +1,12 @@
+AUX readline-5.0-no_rpath.patch 363 SHA256 59df6107772d1a93550bacc267a2c00f9dfd6d5380b8497d8fd756a7191b9e4b SHA512 c0344c5b831433ad3a8499a91d36615e849a9b520f8ca35cd9cae6d5bc55729adbf97d003e335d210cb3806b2f39af273b4b5f98380dac371dc184053e245bb2 WHIRLPOOL c0d2fe9d1d1f36cf89279f315c373a7385d255ebbeab8ebf1ede7b99196660611499c7db85554b036ad3df4f0b4375558b1d1ce7cbae5f5731172181f7d167ac
+AUX readline-5.2-no-ignore-shlib-errors.patch 688 SHA256 2c585c4e2d69d6b91157f378a3dd11cb49beefab808eef3350cf1b8357b2efc6 SHA512 23f88aee11a9ebe15406293695f3de2a7a6c52b8b138c199c64f9dbb9b59d9063f12f8693656e61611e72f6298f7d919016cd240434e78ea2232876690a8b738 WHIRLPOOL ae87d544fa32dbd2b6f27f164dd4e6d0e8a3f399d4a9bde81bcb631985c6e69db11705dc372c21a4f9d3a26cf4279023aeae97fd0d243ca8e1c0e547b59084a4
+AUX readline-6.2-rlfe-tgoto.patch 379 SHA256 6bd5db93cba1cdf751b424a25a1f08c87bae2b42ff59c6c0aa34d659115cbfc1 SHA512 1d2c3aafc949d92fdf6abbee60a60c80f0327f81694d5d8f3a166f1c24d37346caca3e72c9971106b96b2758a9a01269346954fe20bc381eb9da2e6a2737fc3c WHIRLPOOL daab79312136fa728ea77839d6ad663554055e2acd7acff036b8d168f4a0791d57503aa196be4f834caf32ba72ec73c3125adb9b11b5d6898bb796016e83175a
+DIST readline-6.2.tar.gz 2277926 SHA256 79a696070a058c233c72dd6ac697021cc64abd5ed51e59db867d66d196a89381 SHA512 fa5b4f1b6f81bc0b3be0739adb06dab0668603ff256fe62b59ebfe21d5a9e340a758a8eef569df8c4c4ecb86cdd9698a6dabc2ee8c70a769de2bd5930c32ff59 WHIRLPOOL 5d92645085f253206c16533e3cb35bb382d6fe616bf2144feb06f9ffb9b4d7cc25ceaa846b98f17aa442552a0e80642a62d57fe20982e0ed8fdefb75c2f9bbf0
+DIST readline62-001 1388 SHA256 38a86c417437692db01069c8ab40a9a8f548e67ad9af0390221b024b1c39b4e3 SHA512 e505161a9ab28f6c1086a6a4ecc5a82da9001d79e4c2b7c44cd82e86dca90bc726ee2387a31e8b4c6893b240877a766fdd913ee7294389722214e6281c518478 WHIRLPOOL 28c63b09a62fa1b64902b04a3c5607da742f7f308648262736240138fa7c957f21856556c8dd2dc08749acf143c271907c69124a978191a5ddb21a6dcf9ee70a
+DIST readline62-002 1714 SHA256 1e6349128cb573172063ea007c67af79256889c809973002ca66c5dfc503c7d4 SHA512 e86cb15b4df7b2a4cf68148a3e2414b48f70ad23d9685764627906164a74f31967ba8247510229aa19dfb7f6e8e92ff89164896e79b2d7320d3a62187a9173f5 WHIRLPOOL 444fa6eaa6b3e13728224f49a012f969f736d9b448d4c7da6cf0fdd3cfb33d24ca7566801d0ffa5a642fa581571c485e3c913b4a057a096a665735a84d9fbfe8
+DIST readline62-003 1911 SHA256 cb2131ff352d6e5f82edc09755191f74220b15f026bdb6c52624931c79622374 SHA512 863a4f0725df357fdd4a2ea738a8b81d850f36652705a45a415762a643fcf32f71ecb29f9faf9acd84d0b4b67580329adc491ab3562f0ad6f4b808768539301e WHIRLPOOL 86d10b4c23eef4c64ece0a4537f13cf68198888cfdd83eb38124da8610b971e87dfcdbd64c52fd21ca6d3753298b6582ce15378112d575944ff7d9b68baea3a6
+DIST readline62-004 3335 SHA256 09bd342479ea5bb8b6411bfdf7d302fab2e521d1d241bcb8344d3bad5d9f5476 SHA512 d5c80fb49748b586867a4df0900a73257a2973653c00e1403b9ba4eb5b265cdf6b32b6432f10c23482051f173fe63c18f2b569940b9a609ee29da60ce0ae38b2 WHIRLPOOL 471ace4d86d241d11fb494e885b6e6f78a5938bcbd7f438250e0410849ed2c94ae6743162576412d7d2b7125c2151b009d97295578a716327d8a9cd003543884
+DIST readline62-005 2143 SHA256 ef02905e4d544a5a511142e8b8282e325411200c7eaca4287f413f3ea85cc1f4 SHA512 8717df6034b64cc185e006cd0a00ba80b2cc06406420fb4e080affc4bfe2d4bab07b4d0c8fdd1f5b95692ee6b572199731daeaa64c17a0d799853e132d130e90 WHIRLPOOL 5469407cbc196bfffff890d288ac8dc1a11c34a9ac87baba615587617a3e540331cf54db89de861c8fcc126a443afc91af108d9e94f6234ec80c1ade219b51a0
+EBUILD readline-6.2_p4-r99.ebuild 3020 SHA256 feac9434c2e6ce418a919329cfb9d4ae804d463d6cc43e0d1ae2848477d3c4b5 SHA512 17058b0652f75580bf330e07dcf5dc0df455ad4c51cfdeba2cb8ec4fa1148f16b117d6176de69b00552c7ea2a880a9a014e960e74632b10d3bf45172fdc4a6c8 WHIRLPOOL 5e67c7bef740e0758a6bfc82c334d77f7c44f5038401ca8fc66b827f8ec6b7217002fc4d277484b955c942d0002c8a1c934b891cb9474a013fbdba2c38954fee
+EBUILD readline-6.2_p5-r99.ebuild 4081 SHA256 249c584db3fd7638c03f6313600d87e6701b1c86edd18b2e6a972b94521ddb4b SHA512 ca46b44366edc031c791dca4d36037546d234d384319697210b632ec937bf3c939856bdf5812b89dfc399421d57cb9d9dd2cb7f16b074548079a08287f1d0007 WHIRLPOOL 4ccb6f2eb525d4e109a7a4bdfaf38faeb16a9303287dc83c76084caa175adf4d426208147d4f583366ff1813755aa50370222f3f5e2226813322cd0a91b870e1
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-libs/readline/files/readline-5.0-no_rpath.patch b/sys-libs/readline/files/readline-5.0-no_rpath.patch
new file mode 100644
index 00000000..624b2d7d
--- /dev/null
+++ b/sys-libs/readline/files/readline-5.0-no_rpath.patch
@@ -0,0 +1,13 @@
+ripped from Fedora
+
+--- support/shobj-conf
++++ support/shobj-conf
+@@ -102,7 +102,7 @@
+ SHOBJ_LD='${CC}'
+ SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+
+- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+ ;;
+
diff --git a/sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch b/sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch
new file mode 100644
index 00000000..fc634911
--- /dev/null
+++ b/sys-libs/readline/files/readline-5.2-no-ignore-shlib-errors.patch
@@ -0,0 +1,24 @@
+dont ignore errors in the shlib subdir
+
+http://bugs.gentoo.org/216952
+
+--- Makefile.in
++++ Makefile.in
+@@ -194,7 +194,7 @@
+
+ shared: force
+ -test -d shlib || mkdir shlib
+- -( cd shlib ; ${MAKE} ${MFLAGS} all )
++ ( cd shlib ; ${MAKE} ${MFLAGS} all )
+
+ documentation: force
+ -test -d doc || mkdir doc
+@@ -238,7 +238,7 @@
+ -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
+
+ install-shared: installdirs install-headers shared install-doc
+- -( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
++ ( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install )
+
+ uninstall-shared: maybe-uninstall-headers
+ -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall )
diff --git a/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch b/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch
new file mode 100644
index 00000000..b898bf05
--- /dev/null
+++ b/sys-libs/readline/files/readline-6.2-rlfe-tgoto.patch
@@ -0,0 +1,14 @@
+https://bugs.gentoo.org/385091
+
+https://lists.gnu.org/archive/html/bug-readline/2011-10/msg00000.html
+
+--- a/examples/rlfe/configure
++++ b/examples/rlfe/configure
+@@ -4062,6 +4062,7 @@ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h. */
+
++extern char *tgoto(char *, int, int);
+ main()
+ {
+ exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
diff --git a/sys-libs/readline/metadata.xml b/sys-libs/readline/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /dev/null
+++ b/sys-libs/readline/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-libs/readline/readline-6.2_p4-r99.ebuild b/sys-libs/readline/readline-6.2_p4-r99.ebuild
new file mode 100644
index 00000000..54df6a47
--- /dev/null
+++ b/sys-libs/readline/readline-6.2_p4-r99.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/readline/readline-6.2_p4.ebuild,v 1.2 2013/02/17 23:40:35 zmedico Exp $
+
+inherit eutils multilib toolchain-funcs flag-o-matic
+
+# Official patches
+# See ftp://ftp.cwru.edu/pub/bash/readline-6.0-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ [[ ${PLEVEL} -eq 0 ]] && return 1
+ local opt=$1
+ eval set -- {1..${PLEVEL}}
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@"
+ done
+ fi
+}
+
+DESCRIPTION="Another cute console display library"
+HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="static-libs"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+
+ cd "${S}"
+ sed -i -e 's:sgtty:termios:' examples/rlfe/os.h
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
+ epatch "${FILESDIR}"/${PN}-5.2-no-ignore-shlib-errors.patch #216952
+
+ # force ncurses linking #71420
+ sed -i -e 's:^SHLIB_LIBS=:SHLIB_LIBS=-lncurses:' support/shobj-conf || die "sed"
+
+ # fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
+ # objformat for years, so we don't want to rely on that.
+ sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die
+
+ ln -s ../.. examples/rlfe/readline # for local readline headers
+}
+
+src_compile() {
+ # fix implicit decls with widechar funcs
+ append-cppflags -D_GNU_SOURCE
+ # http://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
+
+ # This is for rlfe, but we need to make sure LDFLAGS doesn't change
+ # so we can re-use the config cache file between the two.
+ append-ldflags -L.
+ econf \
+ --cache-file="${S}"/config.cache \
+ --with-curses \
+ $(use_enable static-libs static)
+ emake || die
+
+ if ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ cd examples/rlfe
+ local l
+ for l in readline history ; do
+ ln -s ../../shlib/lib${l}$(get_libname)* lib${l}$(get_libname)
+ ln -sf ../../lib${l}.a lib${l}.a
+ done
+ econf --cache-file="${S}"/config.cache
+ emake || die
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ gen_usr_ldscript -a readline history #4411
+
+ if ! tc-is-cross-compiler; then
+ dobin examples/rlfe/rlfe || die
+ fi
+
+ dodoc CHANGELOG CHANGES README USAGE NEWS
+ docinto ps
+ dodoc doc/*.ps
+ dohtml -r doc
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/lib{history,readline}.so.{4,5} #29865
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.{4,5}
+}
diff --git a/sys-libs/readline/readline-6.2_p5-r99.ebuild b/sys-libs/readline/readline-6.2_p5-r99.ebuild
new file mode 100644
index 00000000..ee133057
--- /dev/null
+++ b/sys-libs/readline/readline-6.2_p5-r99.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/readline/readline-6.2_p5-r1.ebuild,v 1.14 2014/07/18 10:56:45 pacho Exp $
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs flag-o-matic multilib-minimal
+
+# Official patches
+# See ftp://ftp.cwru.edu/pub/bash/readline-6.2-patches/
+PLEVEL=${PV##*_p}
+MY_PV=${PV/_p*}
+MY_PV=${MY_PV/_/-}
+MY_P=${PN}-${MY_PV}
+[[ ${PV} != *_p* ]] && PLEVEL=0
+patches() {
+ [[ ${PLEVEL} -eq 0 ]] && return 1
+ local opt=$1
+ eval set -- {1..${PLEVEL}}
+ set -- $(printf "${PN}${MY_PV/\.}-%03d " "$@")
+ if [[ ${opt} == -s ]] ; then
+ echo "${@/#/${DISTDIR}/}"
+ else
+ local u
+ for u in ftp://ftp.cwru.edu/pub/bash mirror://gnu/${PN} ; do
+ printf "${u}/${PN}-${MY_PV}-patches/%s " "$@"
+ done
+ fi
+}
+
+DESCRIPTION="Another cute console display library"
+HOMEPAGE="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz $(patches)"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="static-libs"
+
+RDEPEND=">=sys-libs/ncurses-5.9-r3[${MULTILIB_USEDEP}]
+ abi_x86_32? (
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r7
+ )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+}
+
+src_prepare() {
+ sed -i -e 's:sgtty:termios:' examples/rlfe/os.h # For musl
+ [[ ${PLEVEL} -gt 0 ]] && epatch $(patches -s)
+ epatch "${FILESDIR}"/${PN}-5.0-no_rpath.patch
+ epatch "${FILESDIR}"/${PN}-5.2-no-ignore-shlib-errors.patch #216952
+ epatch "${FILESDIR}"/${PN}-6.2-rlfe-tgoto.patch #385091
+
+ # Force ncurses linking. #71420
+ # Use pkg-config to get the right values. #457558
+ local ncurses_libs=$($(tc-getPKG_CONFIG) ncurses --libs)
+ sed -i \
+ -e "/^SHLIB_LIBS=/s:=.*:='${ncurses_libs}':" \
+ support/shobj-conf || die
+ sed -i \
+ -e "/^[[:space:]]*LIBS=.-lncurses/s:-lncurses:${ncurses_libs}:" \
+ examples/rlfe/configure || die
+
+ # fix building under Gentoo/FreeBSD; upstream FreeBSD deprecated
+ # objformat for years, so we don't want to rely on that.
+ sed -i -e '/objformat/s:if .*; then:if true; then:' support/shobj-conf || die
+
+ ln -s ../.. examples/rlfe/readline # for local readline headers
+}
+
+src_configure() {
+ # fix implicit decls with widechar funcs
+ append-cppflags -D_GNU_SOURCE
+ # http://lists.gnu.org/archive/html/bug-readline/2010-07/msg00013.html
+ append-cppflags -Dxrealloc=_rl_realloc -Dxmalloc=_rl_malloc -Dxfree=_rl_free
+
+ # Make sure configure picks a better ar than `ar`. #484866
+ export ac_cv_prog_AR=$(tc-getAR)
+
+ # Force the test since we used sed above to force it.
+ export bash_cv_termcap_lib=ncurses
+
+ # This is for rlfe, but we need to make sure LDFLAGS doesn't change
+ # so we can re-use the config cache file between the two.
+ append-ldflags -L.
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE=${S} \
+ econf \
+ --cache-file="${BUILD_DIR}"/config.cache \
+ --with-curses \
+ $(use_enable static-libs static)
+
+ if multilib_is_native_abi && ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ mkdir -p examples/rlfe || die
+ cd examples/rlfe || die
+ ECONF_SOURCE=${S}/examples/rlfe \
+ econf --cache-file="${BUILD_DIR}"/config.cache
+ fi
+}
+
+multilib_src_compile() {
+ emake
+
+ if multilib_is_native_abi && ! tc-is-cross-compiler ; then
+ # code is full of AC_TRY_RUN()
+ cd examples/rlfe || die
+ local l
+ for l in readline history ; do
+ ln -s ../../shlib/lib${l}$(get_libname)* lib${l}$(get_libname)
+ ln -sf ../../lib${l}.a lib${l}.a
+ done
+ emake
+ fi
+}
+
+multilib_src_install() {
+ default
+
+ if multilib_is_native_abi ; then
+ gen_usr_ldscript -a readline history #4411
+
+ if ! tc-is-cross-compiler; then
+ dobin examples/rlfe/rlfe
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc USAGE
+ dohtml -r doc/.
+ docinto ps
+ dodoc doc/*.ps
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/lib{history,readline}.so.{4,5} #29865
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.{4,5}
+}
diff --git a/sys-libs/talloc/Manifest b/sys-libs/talloc/Manifest
new file mode 100644
index 00000000..e975047e
--- /dev/null
+++ b/sys-libs/talloc/Manifest
@@ -0,0 +1,6 @@
+AUX talloc-remove-check-bsd-strtoll.patch 1145 SHA256 e37590d707ce22f5248d329f35e693ad2e81d9e44ec4db3dddfd6d891806627c SHA512 96810678fbf61f1b4968e2bed9e40adb36165ee235b5d46fcb88bc677ceedddbff4c146cebb2b93837eaeca9ec16ac8cb115e7580712a7f392af811db4f7acca WHIRLPOOL 549a73536b09c681f2fd4905833074b9b39c74c16a9daf17cb84f854f9e632e16159d00ddce61776d76514bb6d2be725e1cd3405cc12b06a6a92f593f29598be
+DIST talloc-2.0.8.tar.gz 433489 SHA256 1ec11e635e0318dbbb014db38ff96e8dba3ce5f614eeb7d993b4a5b71c016783 SHA512 8e8e71d05443b7ea5d8ac432c1043840000b7b6ebeff6a2f621274f29a298e6c64ad5fb75b59c6138179c5602d6164695b85b57b5b310809150320b6eecd487f WHIRLPOOL 4cfaab8edbb7040ff0319ff7bce54657e3ecdfd27792b6ad0b5d789b38579116f69023def228e725d03a6c226ded768cfcdede920162930179704481160b9e81
+DIST talloc-2.1.0.tar.gz 416097 SHA256 0701393882647f823503e3aa075bc67d75c194b376822377dae2d20f9130f08f SHA512 7bdc448c91211299edf16502d263362ac660d5123d8ea7bb2ed58af2231537e4f29da5384b8d5be10254a02b193520890e95a73d697c40eba09728a9b6d56d57 WHIRLPOOL d8593cba27f5d971acb39acacdbea70df5b80ed31288cf440a2ebeaca266e070deeea8322f4ba5682580f66044128f18dd6d76b735aa0670aed46f13f5a4e857
+EBUILD talloc-2.0.8-r99.ebuild 1963 SHA256 f8f6bb2b6979a6b16037d1fe0effec45cb89ee0df1ac671dd17d025973de9573 SHA512 e4e71371062ba390f9e1b4ddc3f91e2743b6c50ba92fc2bef85cbe97322f88accd3b618a68ab5baa7b34d6f273b9a015e77c257b52b0915a2885a5f7c8e70b47 WHIRLPOOL 2f337527a1e965c45103635005a9f092db5a6d9c1680ae2b6426af92c64c5f17f206ebde7c5fb66d7a47cff339bb9f322eab27186c40848f8cd4848caa5c55bb
+EBUILD talloc-2.1.0-r99.ebuild 1963 SHA256 d8300c166dd1586d3e36bbd7e30c24eedcbc49d6251a3c14366f5bb7a3c19502 SHA512 21359b9cd37e0c48887737781e2ef273a8e18064cc72e4123aac1b449b1c876861e60551f255edfb83c9649622950ff3d3eae136574c19e90ac6e474e65679c7 WHIRLPOOL 7bab34ee41daf5ff53c15723b3117e11dcb75da9fba28c50fc8e3fd826715affdeeb3375b41a83a09f682be66732edc5e379e0ce821da5bb9417f83d288471fc
+MISC metadata.xml 341 SHA256 f12826bad0472c46c8bd1ee18e7ab0acdc4cf26dd8b1322b1a93ff7c95b14a7e SHA512 dd141022832b17bc47f40cc940c2165c849b5ad786df5cbba7685da4543a8969ed992fb9dda3a136d045418f6de731c83909f3d02fd3ad2dee4d0ab4689b0c44 WHIRLPOOL 1fff0d00542a6e5b3f64edb985e53fe978a9d91dde0b0118cf790dc113a1a3e3fd01632f2f19517af9b47fef51902de579e43c30eaedf3fa298230848cb125a3
diff --git a/sys-libs/talloc/files/talloc-remove-check-bsd-strtoll.patch b/sys-libs/talloc/files/talloc-remove-check-bsd-strtoll.patch
new file mode 100644
index 00000000..f872ef5a
--- /dev/null
+++ b/sys-libs/talloc/files/talloc-remove-check-bsd-strtoll.patch
@@ -0,0 +1,24 @@
+diff -Naur talloc-2.1.0.orig/lib/replace/wscript talloc-2.1.0/lib/replace/wscript
+--- talloc-2.1.0.orig/lib/replace/wscript 2013-09-08 12:24:14.000000000 +0000
++++ talloc-2.1.0/lib/replace/wscript 2014-02-22 19:46:36.033471201 +0000
+@@ -272,20 +272,6 @@
+
+ #Some OS (ie. freebsd) return EINVAL if the convertion could not be done, it's not what we expect
+ #Let's detect those cases
+- if conf.CONFIG_SET('HAVE_STRTOLL'):
+- conf.CHECK_CODE('''
+- long long nb = strtoll("Text", NULL, 0);
+- if (errno == EINVAL) {
+- return 0;
+- } else {
+- return 1;
+- }
+- ''',
+- msg="Checking correct behavior of strtoll",
+- headers = 'errno.h',
+- execute = True,
+- define = 'HAVE_BSD_STRTOLL',
+- )
+ conf.CHECK_FUNCS('if_nametoindex strerror_r')
+ conf.CHECK_FUNCS('getdirentries getdents syslog')
+ conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
diff --git a/sys-libs/talloc/metadata.xml b/sys-libs/talloc/metadata.xml
new file mode 100644
index 00000000..be0176a4
--- /dev/null
+++ b/sys-libs/talloc/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>samba</herd>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <use>
+ <flag name="compat">Enable extra compatibility stuff</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-libs/talloc/talloc-2.0.8-r99.ebuild b/sys-libs/talloc/talloc-2.0.8-r99.ebuild
new file mode 100644
index 00000000..d1d81f02
--- /dev/null
+++ b/sys-libs/talloc/talloc-2.0.8-r99.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/talloc/talloc-2.0.8-r1.ebuild,v 1.3 2013/08/25 20:01:47 maekke Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+PYTHON_REQ_USE="threads"
+
+inherit eutils waf-utils python-single-r1 multilib
+
+DESCRIPTION="Samba talloc library"
+HOMEPAGE="http://talloc.samba.org/"
+SRC_URI="http://samba.org/ftp/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="compat python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ !!<sys-libs/talloc-2.0.5"
+DEPEND="${RDEPEND}
+ dev-libs/libxslt
+ || ( dev-lang/python:2.7[threads] dev-lang/python:2.6[threads] )"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_configure() {
+ local extra_opts=""
+
+ use compat && extra_opts+=" --enable-talloc-compat1"
+ use python || extra_opts+=" --disable-python"
+ waf-utils_src_configure \
+ ${extra_opts}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # waf is stupid, and no, we can't fix the build-system, since it's provided
+ # as a brilliant binary blob thats decompressed on the fly
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libtalloc.2.0.5.dylib || die
+ if use python ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libpytalloc-util.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"$(python_get_sitedir)/talloc.bundle || die
+ fi
+ fi
+}
diff --git a/sys-libs/talloc/talloc-2.1.0-r99.ebuild b/sys-libs/talloc/talloc-2.1.0-r99.ebuild
new file mode 100644
index 00000000..41645cdc
--- /dev/null
+++ b/sys-libs/talloc/talloc-2.1.0-r99.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/talloc/talloc-2.1.0.ebuild,v 1.4 2014/02/02 17:40:57 vostorga Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+PYTHON_REQ_USE="threads"
+
+inherit eutils waf-utils python-single-r1 multilib
+
+DESCRIPTION="Samba talloc library"
+HOMEPAGE="http://talloc.samba.org/"
+SRC_URI="http://samba.org/ftp/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="compat +python"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ !!<sys-libs/talloc-2.0.5"
+DEPEND="${RDEPEND}
+ dev-libs/libxslt
+ || ( dev-lang/python:2.7[threads] dev-lang/python:2.6[threads] )"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_configure() {
+ local extra_opts=""
+
+ use compat && extra_opts+=" --enable-talloc-compat1"
+ use python || extra_opts+=" --disable-python"
+ waf-utils_src_configure \
+ ${extra_opts}
+}
+
+src_install() {
+ waf-utils_src_install
+
+ # waf is stupid, and no, we can't fix the build-system, since it's provided
+ # as a brilliant binary blob thats decompressed on the fly
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libtalloc.2.0.5.dylib || die
+ if use python ; then
+ install_name_tool \
+ -id "${EPREFIX}"/usr/$(get_libdir)/libpytalloc-util.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"/usr/$(get_libdir)/libpytalloc-util.2.0.5.dylib || die
+ install_name_tool \
+ -change "${S}/bin/default/libtalloc.dylib" \
+ "${EPREFIX}"/usr/$(get_libdir)/libtalloc.2.dylib \
+ "${ED}"$(python_get_sitedir)/talloc.bundle || die
+ fi
+ fi
+}
diff --git a/sys-libs/tdb/Manifest b/sys-libs/tdb/Manifest
new file mode 100644
index 00000000..92e876f1
--- /dev/null
+++ b/sys-libs/tdb/Manifest
@@ -0,0 +1,6 @@
+AUX tdb-remove-check-bsd-strtoll.patch 1181 SHA256 f1f90725967b0df76b24613c8382cd1b93f7717b49a2981b3ff5d36a49b7e7c6 SHA512 ccafbfaee3984a15e81cdd891d47d1100f221f2a22150f8cc14f0d2eed1d1412dcf7cad99cf3bb845825e6a75ac0d33331b26e07b17f718c40ab8b9aac8b935a WHIRLPOOL 8f2703ba60e898d7d1306712856bfb277d168a26845e754172f2451b6f8439f6f2d6f395b2a5d527b41b630c79c709f2fe26872a3e634989423afb4226a52d7b
+DIST tdb-1.2.11.tar.gz 481298 SHA256 f10eae6361b033131d2deebfcccbcaeb3d8006747005f5240d68e8b70632f6c2 SHA512 fba47db71d0a28eb38cac44a7aa5796d9ee54ab7a9fff3b5a88f9c305cbfb6580173a2cbe3a3ea3484ff0d366b7bc79be78512183216c484246688de5843d3bc WHIRLPOOL d3a1d61dd923ecd1c84d5d4299561a654b4eddc34282c505bb2e1507f7e673dea61c8b76a4f346ddd50fc3192905322a2efdd767dda591beb917d1166e833ced
+DIST tdb-1.2.12.tar.gz 462590 SHA256 282d3db1cc56ac3011ae5f3922fd0c5bb217ecb0320836c23b6fe67f2163a71f SHA512 7f6061cae722db79a604ed517e615bed8d06c1b69549e6c1b771611797e1b4f64ebc7af63c3b911ed055979dd6782c8fca44af829c3466911f4181e835ef9b28 WHIRLPOOL 1f584052432c2b87b3d203dd2aefdf9fb425181e5bbd2cfd2f23ede512fa01623f08c33e85afdddfb3c08d776892c15382d9868bfb22a4a36987e06668ffc828
+EBUILD tdb-1.2.11-r99.ebuild 1090 SHA256 103cda52f038a3d851bff5856d88360df56d2c97635e776c072c834db6ca6561 SHA512 99d38b5a7c228695148177d0597875fd227807beb270b6cfe025dd2e2dd779d2784ae27d11d119b5d9265514d2886eb970c4c385fe7931e5546ac75d39b4ecaa WHIRLPOOL 746bdbb98b38b32a78fc6595c9be832bc86a4da3072328c603ee70c821ddadfb804f560e27dce62b378f51b42224a4d666bb5e42183637eb8e9761372660a959
+EBUILD tdb-1.2.12-r99.ebuild 1021 SHA256 7496a54b221b3fb00c4c9e26581c2dce3b5af66e9a5d23986605f3de6f0fb5a0 SHA512 ec640d09c237d137fa63d44c9331d3257cb5bd614a18d0e112c41fcaf6996d8a11edecfdcd7691895cecdb53e89da8ba1aff247e975cbc5d5b3ca89eb7dbbb88 WHIRLPOOL 95031b9eefafebc3f3fd793997393d75776d97d25ce7b1472484fbe582293fa3dd0e7da75b8823aebe5b298283872f7f13df4f1daec5c7c1854bbfe33eac8360
+MISC metadata.xml 260 SHA256 9c67a75d6c6db8d88233eb27271c93874a4b763907a61f189970574fc957e0e6 SHA512 611e0004aba6d842ba71a9b9f74b8301d1a7d8d366208122001f5d164ae34b88c1ba2d41c0b25c760cea155387e5e7a4b3d141d6b21cc997f894a21c519a07c9 WHIRLPOOL 1bf0ee15987eee963adc9506dff9e8e978bcb8b7bdc9381f468fdc92ed39e356c69dc67af161da4eac8b46098a28ab8b6249f0efeb5709f7cd4f3f8a4749b675
diff --git a/sys-libs/tdb/files/tdb-remove-check-bsd-strtoll.patch b/sys-libs/tdb/files/tdb-remove-check-bsd-strtoll.patch
new file mode 100644
index 00000000..8108209a
--- /dev/null
+++ b/sys-libs/tdb/files/tdb-remove-check-bsd-strtoll.patch
@@ -0,0 +1,25 @@
+diff -Naur tdb-1.2.11.orig/lib/replace/wscript tdb-1.2.11/lib/replace/wscript
+--- tdb-1.2.11.orig/lib/replace/wscript 2012-11-30 08:51:31.000000000 +0000
++++ tdb-1.2.11/lib/replace/wscript 2014-02-23 12:37:58.921617847 +0000
+@@ -215,21 +215,6 @@
+
+ #Some OS (ie. freebsd) return EINVAL if the convertion could not be done, it's not what we expect
+ #Let's detect those cases
+- if conf.CONFIG_SET('HAVE_STRTOLL'):
+- conf.CHECK_CODE('''
+- long long nb = strtoll("Text", NULL, 0);
+- if (errno == EINVAL) {
+- return 0;
+- } else {
+- return 1;
+- }
+- ''',
+- msg="Checking correct behavior of strtoll",
+- headers = 'errno.h',
+- execute = True,
+- define_ret = True,
+- define = 'HAVE_BSD_STRTOLL',
+- )
+ conf.CHECK_FUNCS('if_nametoindex strerror_r')
+ conf.CHECK_FUNCS('getdirentries getdents syslog')
+ conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
diff --git a/sys-libs/tdb/metadata.xml b/sys-libs/tdb/metadata.xml
new file mode 100644
index 00000000..eb993d35
--- /dev/null
+++ b/sys-libs/tdb/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>samba</herd>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/tdb/tdb-1.2.11-r99.ebuild b/sys-libs/tdb/tdb-1.2.11-r99.ebuild
new file mode 100644
index 00000000..ae082f1a
--- /dev/null
+++ b/sys-libs/tdb/tdb-1.2.11-r99.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/tdb/tdb-1.2.11.ebuild,v 1.8 2013/09/06 16:04:59 ago Exp $
+
+EAPI=3
+PYTHON_DEPEND="python? 2"
+RESTRICT_PYTHON_ABIS="3.* *-jython 2.7-pypy-*"
+
+inherit waf-utils python
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="python"
+
+RDEPEND=""
+DEPEND="|| ( dev-lang/python:2.7 dev-lang/python:2.6 )
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python_set_active_version 2
+ python_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_configure() {
+ local extra_opts=""
+ use python || extra_opts+=" --disable-python"
+ waf-utils_src_configure \
+ ${extra_opts}
+}
+
+src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check || die "emake check failed"
+}
diff --git a/sys-libs/tdb/tdb-1.2.12-r99.ebuild b/sys-libs/tdb/tdb-1.2.12-r99.ebuild
new file mode 100644
index 00000000..39140930
--- /dev/null
+++ b/sys-libs/tdb/tdb-1.2.12-r99.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/tdb/tdb-1.2.12-r1.ebuild,v 1.1 2013/06/30 16:33:13 jlec Exp $
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit waf-utils python-single-r1
+
+DESCRIPTION="A simple database API"
+HOMEPAGE="http://tdb.samba.org/"
+SRC_URI="http://samba.org/ftp/tdb/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+IUSE="python"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+DEPEND="
+ ${RDEPEND}
+ app-text/docbook-xml-dtd:4.2"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_configure() {
+ local extra_opts=""
+ use python || extra_opts+=" --disable-python"
+ waf-utils_src_configure \
+ ${extra_opts}
+}
+
+src_test() {
+ # the default src_test runs 'make test' and 'make check', letting
+ # the tests fail occasionally (reason: unknown)
+ emake check
+}
diff --git a/sys-libs/tevent/Manifest b/sys-libs/tevent/Manifest
new file mode 100644
index 00000000..b7af3dbc
--- /dev/null
+++ b/sys-libs/tevent/Manifest
@@ -0,0 +1,11 @@
+AUX add-py-file-0.9.14.patch 1093 SHA256 8b19556991ca4c5279e842a267ae38a5275caf0eaaa0db19f3c407972fa66c29 SHA512 aca86b56fd353c04eedd2a02a1f68db3a72b2b8ad7b669bdda1fbb9632a8acd69d523ad1e23665fc0ff4abdee89815fe8194a36a9d0d03ac45c7ac06e0ff262b WHIRLPOOL 9fd1b46c5b8c93597401cdcbdeda1e03f9e9fac97b38dcede18be4f67930fe53fcaacdf8324bbb74b37700eb77ab9e2bdf7672115204a6178c751f0fb441fe61
+AUX add-py-file.patch 1094 SHA256 91543e43496f22684032eece3ab409b6e45908d3c4cc9c25f2e3d1844a6cb457 SHA512 f1db337951fe797b48ef630e4c0e1370ed514f156671f5b039385c4cd6285109f681a2c38efa77ae02de64798076ad533557ac07b6827e99ee1d181fbae03b35 WHIRLPOOL 7dcabfabc62da2d12a5ea7fc9db78deaa7b81242c367ca0d44c63091d40d3a661696f565b11c2f64688a02d861026b8174651e72ffe87b28928ea27285e409ed
+AUX tevent-remove-check-bsd-strtoll.patch 1149 SHA256 3c912c5129e9bcfce51cb1c0517e4fe641371d3eea9af43454024858eb6418fe SHA512 69ef329df08066b877b554b1fdc0270190db4b80d3fc11988736584e7743047d3afc11c1678dcaaff71d00fe443a13de118a85727df1097ae7edf80d43b7bdf9 WHIRLPOOL c50aa5ffef33ff9fc099893f81081dcb2d939216a05bad7106d210eba08ab41413ebb5054675e30a943fe0d5dd91190576069a9156d6735576daf744e22923f3
+AUX tevent-version.patch 832 SHA256 9f03c4fa65358620e6ed50d5ebad78a522ee4e3a3dceade97fd5023c36e97799 SHA512 e0762c4f45bf6cdbf91dc45de22bab3a7722707ca0a19246ad10a622959e63507ded160e27d5cb6f55b086cccc06d5dfaad0dcc89b9b46c4f8926f7ea4546db1 WHIRLPOOL a16eceed526dc7d82cdd99f26e47dd7ef3463a07a1b31f2287443ab28abecfe9d1afbf8c96a8992bf6055ade1f057dc07a2cb300c5b61ac6387f19422b09ef05
+DIST tevent-0.9.19.tar.gz 543195 SHA256 f9a1d079844ec0068804541ee2421d8ff34d7a4cdb93a6cc20d0edd5302e3fc9 SHA512 9c8eb11dc8efbf6b7651261bb4359c6100022145df749630c116ecafea62f6527c3cc7ab73499e3ff1854454aab3947c58d49a9765fc857ac0ddd90250299d0d WHIRLPOOL ebdda4d558a023531c7c991027442dd05f83936f9e8389ce83de06b9d60033dea0e36299c3ed808a9670d84bb3c43297d3d5a5d62670e69ede474ef0bec32581
+DIST tevent-0.9.20.tar.gz 549404 SHA256 b31ce8d066f124a920ed106855ce5df4dc2f86614edd861f422f06890d353814 SHA512 b3d8b892d463f903eab88a569fadd2bf8588d83b2a7db973a5445d66e1eb4dfddc93e349407b16d0e52b6a23cd2fa131bc92cac657f71e8998516017a9dcb546 WHIRLPOOL 7bfcdbc93d3286f5b70ca33031e89cd342babf301549d99a02aad563fc8199041736287dfbe9b783a3674404c2cf11864a761c02795db72044c8f6e0b0e6dd1f
+DIST tevent-0.9.21.tar.gz 550606 SHA256 f2be7463573dab2d8210cb57fe7e7e2aeb323274cbdc865a6e29ddcfb977f0f4 SHA512 d1d76402bf32c4da9394ec5e0eb149abefa3f4dc86e5d22529f5cc4f30b1d3071e7a00aac3bd5707532e68dfed5a03dc5a267ea367c8fbe0aaead9df63beafdf WHIRLPOOL 4b4525394cdc06a5ce2535216eea8fdcf44dc0b4ab7964506042df3ee67ce9463d82e9b6be3bdd4cd9983ce92a62e3dfc69c6abf66d30b9b6466e863b2c1d7cd
+EBUILD tevent-0.9.19-r99.ebuild 932 SHA256 59f9365bb387a6d6a57c48fddfe0ad6520e1e6403f004cd5016f63559ba282f2 SHA512 601cabdf6bd42f371b4929b2ec08a83e57160101b9be344bb116038ed65e738d357bc35993cdfc9f2914a10fe08a15608512e31608fa3c9b3e17961bd4d31485 WHIRLPOOL a0323d708fd1f3222f8a7beaeadd1b4862d0fe0bd13435d0e12f4c9730d0b2ce59f166952dafdd8db2c002b471faddc42451084d7f082ce5e8da020116757ac8
+EBUILD tevent-0.9.20-r99.ebuild 930 SHA256 e573558731ba8286fcd528583b40cc46f44911924c2ba96ea127c5865f689eea SHA512 24a803638473fe6786c0f19f7fbd99c702ceb8421696d40e9735d46d61de840d862b7eeddfe95fa77c8316962584ab92ad2a3cee16f1d7a53cd2b869d514eccc WHIRLPOOL d03eead599ad9d78baacf906c8fb5b3b52d4147ca78148b642110f64fd8dc745ff6cac87c3cbf0bd6b17c9e168524044ed574371bddadf020d926f8b1e08e4bc
+EBUILD tevent-0.9.21-r99.ebuild 930 SHA256 596d6e88c77bb05a3a96a17cc699f7fd3785d523bdf7280fbd75d96fb53ea637 SHA512 7ae4d1ae75978c5e58231ec65e4488fef882e4226a8c7e9dd9e3a608611d641b4d78c47383bcabdf29dd208a713843cd5570e9bc832cf6b18d1d1cfee0510113 WHIRLPOOL a3ec7e7ac5aeb1be57752d07aa360a7da05d73010bb0ccc35cf809cd71966087f624c7c119e110e0e7c10d1d8974d5ba2275f11f80184d09f6652946e9585066
+MISC metadata.xml 253 SHA256 89737be021da6f1a76894bd234f227b72ba57fd0213bdfdc0f5b38f1051ce775 SHA512 58c5ed90694ec0914f49f21b7066d7bd5610f53bbd0ee01e6d1b285e5f8f261bcb681e19b21c39287c312fc982b300f2a34a8cc638eaa0e939dd0da2b046288a WHIRLPOOL 15e90e302adf797a5761d14558f652e319613ec179ea5a4cdfcff2040bcf8d0cc734266744a69e644108ec47bcdde213ad5eaf0c7adf9d796a21e62a58ed9dfe
diff --git a/sys-libs/tevent/files/add-py-file-0.9.14.patch b/sys-libs/tevent/files/add-py-file-0.9.14.patch
new file mode 100644
index 00000000..32708160
--- /dev/null
+++ b/sys-libs/tevent/files/add-py-file-0.9.14.patch
@@ -0,0 +1,32 @@
+--- /dev/null
++++ /tevent.py
+@@ -0,0 +1,29 @@
++#!/usr/bin/python
++#
++# Python integration for tevent
++#
++# Copyright (C) Jelmer Vernooij 2011
++#
++# ** NOTE! The following LGPL license applies to the tevent
++# ** library. This does NOT imply that all of Samba is released
++# ** under the LGPL
++#
++# This library 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 3 of the License, or (at your option) any later version.
++#
++# This library 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 this library; if not, see <http://www.gnu.org/licenses/>.
++
++from _tevent import (
++ __version__,
++ backend_list,
++ Context,
++ Signal,
++ )
diff --git a/sys-libs/tevent/files/add-py-file.patch b/sys-libs/tevent/files/add-py-file.patch
new file mode 100644
index 00000000..cd919834
--- /dev/null
+++ b/sys-libs/tevent/files/add-py-file.patch
@@ -0,0 +1,32 @@
+--- /dev/null
++++ b/tevent.py
+@@ -0,0 +1,29 @@
++#!/usr/bin/python
++#
++# Python integration for tevent
++#
++# Copyright (C) Jelmer Vernooij 2011
++#
++# ** NOTE! The following LGPL license applies to the tevent
++# ** library. This does NOT imply that all of Samba is released
++# ** under the LGPL
++#
++# This library 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 3 of the License, or (at your option) any later version.
++#
++# This library 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 this library; if not, see <http://www.gnu.org/licenses/>.
++
++from _tevent import (
++ __version__,
++ backend_list,
++ Context,
++ Signal,
++ )
diff --git a/sys-libs/tevent/files/tevent-remove-check-bsd-strtoll.patch b/sys-libs/tevent/files/tevent-remove-check-bsd-strtoll.patch
new file mode 100644
index 00000000..481f0d44
--- /dev/null
+++ b/sys-libs/tevent/files/tevent-remove-check-bsd-strtoll.patch
@@ -0,0 +1,24 @@
+diff -Naur tevent-0.9.19.orig/lib/replace/wscript tevent-0.9.19/lib/replace/wscript
+--- tevent-0.9.19.orig/lib/replace/wscript 2013-06-04 14:21:30.000000000 +0000
++++ tevent-0.9.19/lib/replace/wscript 2014-02-23 12:01:19.733793736 +0000
+@@ -272,20 +272,6 @@
+
+ #Some OS (ie. freebsd) return EINVAL if the convertion could not be done, it's not what we expect
+ #Let's detect those cases
+- if conf.CONFIG_SET('HAVE_STRTOLL'):
+- conf.CHECK_CODE('''
+- long long nb = strtoll("Text", NULL, 0);
+- if (errno == EINVAL) {
+- return 0;
+- } else {
+- return 1;
+- }
+- ''',
+- msg="Checking correct behavior of strtoll",
+- headers = 'errno.h',
+- execute = True,
+- define = 'HAVE_BSD_STRTOLL',
+- )
+ conf.CHECK_FUNCS('if_nametoindex strerror_r')
+ conf.CHECK_FUNCS('getdirentries getdents syslog')
+ conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
diff --git a/sys-libs/tevent/files/tevent-version.patch b/sys-libs/tevent/files/tevent-version.patch
new file mode 100644
index 00000000..2042ec58
--- /dev/null
+++ b/sys-libs/tevent/files/tevent-version.patch
@@ -0,0 +1,27 @@
+--- a/pytevent.c
++++ b/pytevent.c
+@@ -761,4 +761,6 @@ void init_tevent(void)
+
+ Py_INCREF(&TeventFd_Type);
+ PyModule_AddObject(m, "Fd", (PyObject *)&TeventFd_Type);
++
++ PyModule_AddObject(m, "__version__", PyString_FromString(PACKAGE_VERSION));
+ }
+--- a/wscript
++++ b/wscript
+@@ -92,7 +92,14 @@
+ 'pytevent.c',
+ deps='tevent',
+ enabled=True,
+- realname='_tevent.so')
++ realname='_tevent.so',
++ cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
++ # install out various python scripts for use by make test
++ bld.SAMBA_SCRIPT('tevent_python',
++ pattern='tevent.py',
++ installdir='python')
++
++ bld.INSTALL_WILDCARD('${PYTHONDIR}', 'tevent.py', flat=False)
+
+
+ def test(ctx):
diff --git a/sys-libs/tevent/metadata.xml b/sys-libs/tevent/metadata.xml
new file mode 100644
index 00000000..e06ba379
--- /dev/null
+++ b/sys-libs/tevent/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>samba</herd>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/tevent/tevent-0.9.19-r99.ebuild b/sys-libs/tevent/tevent-0.9.19-r99.ebuild
new file mode 100644
index 00000000..b5d60604
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.19-r99.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/tevent/tevent-0.9.19.ebuild,v 1.15 2013/09/06 20:08:35 maekke Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python2_{6,7} )
+
+inherit waf-utils python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE=""
+
+RDEPEND=">=sys-libs/talloc-2.0.8[python]
+ ${PYTHON_DEPS}"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_install() {
+ waf-utils_src_install
+ python_export PYTHON_SITEDIR
+ insinto "${PYTHON_SITEDIR#${EPREFIX}}"
+ doins tevent.py
+ python_optimize
+}
diff --git a/sys-libs/tevent/tevent-0.9.20-r99.ebuild b/sys-libs/tevent/tevent-0.9.20-r99.ebuild
new file mode 100644
index 00000000..8b1a9c5e
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.20-r99.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/tevent/tevent-0.9.20.ebuild,v 1.2 2013/12/16 08:53:50 polynomial-c Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python2_{6,7} )
+
+inherit waf-utils python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND=">=sys-libs/talloc-2.1.0[python]
+ ${PYTHON_DEPS}"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_install() {
+ waf-utils_src_install
+ python_export PYTHON_SITEDIR
+ insinto "${PYTHON_SITEDIR#${EPREFIX}}"
+ doins tevent.py
+ python_optimize
+}
diff --git a/sys-libs/tevent/tevent-0.9.21-r99.ebuild b/sys-libs/tevent/tevent-0.9.21-r99.ebuild
new file mode 100644
index 00000000..89f9e799
--- /dev/null
+++ b/sys-libs/tevent/tevent-0.9.21-r99.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/tevent/tevent-0.9.21.ebuild,v 1.1 2014/01/18 23:19:27 polynomial-c Exp $
+
+EAPI=5
+PYTHON_COMPAT=( python2_{6,7} )
+
+inherit waf-utils python-single-r1
+
+DESCRIPTION="Samba tevent library"
+HOMEPAGE="http://tevent.samba.org/"
+SRC_URI="http://samba.org/ftp/tevent/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND=">=sys-libs/talloc-2.1.0[python]
+ ${PYTHON_DEPS}"
+
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-remove-check-bsd-strtoll.patch
+}
+
+src_install() {
+ waf-utils_src_install
+ python_export PYTHON_SITEDIR
+ insinto "${PYTHON_SITEDIR#${EPREFIX}}"
+ doins tevent.py
+ python_optimize
+}
diff --git a/sys-process/cronie/Manifest b/sys-process/cronie/Manifest
new file mode 100644
index 00000000..f80d017b
--- /dev/null
+++ b/sys-process/cronie/Manifest
@@ -0,0 +1,8 @@
+AUX 0001-add_limits_h_and_MAXNAMLEN.patch 384 SHA256 9d9a64ac23fe90caf99e129a31ac8540a62860d3eedcaef6b4191b06d1667ffd SHA512 e1b4e7adb16658702685c34e23fa9ae6dcf7e5e48b670210e6a263110548e71872242a91351157283099d5116e599249dc619f2dfaf700425ce1e20b7e0fbf48 WHIRLPOOL f364cbd01759b07e6815c277fdec55c7e9cd6fa673db8894d1b2a51699df31417acb273adfd26c486359453a0c203a77fe620ded4b1ba9544e9edead36e938ad
+AUX cronie-1.2-cron.deny 216 SHA256 4a857b2c58bb10d4aefbdd7d4a41710456a8cc27774c365e361ca5271128e0b8 SHA512 88b4bf039d5677e9b63fffa5b40bcfb15bd5fe3e76db6ef8dabe2c7b2fe9f7c45ef8cc0fc2087457f5ec364bcc7dee7548df5b98f1c88cbf9df495b12a601a04 WHIRLPOOL 2f02d1db5b2650ca63345445010853016f1d397aa45c1031d0518fff3702e3eb3ed52b3835fa22f8a637a53b4de193ac74aa3ca190fa9739f161760d11398f44
+AUX cronie-1.3-crontab 833 SHA256 700714927dea9ed271924817863e9b45cb50b3dd650bd00e072f09aadc4c3684 SHA512 9c21d9ab6f7ae45f75b3f681abdfb043f1ba61c8522fb6cd2a6ffd32a628b3dc07c4011c1fbe43228016fe670d99a230ebdcac08d0ace12ec749cff4f2a85895 WHIRLPOOL 4c60338d73a6163812802b23377ec93dfe3a29339bd01d5f24fcd17ed4b749354d5660464d334c06b04de1cfd9540ba78d732695759fc0d8880904646030d984
+AUX cronie-1.3-initd 395 SHA256 292a7b20fe33bd027357475fea6aa1194afa7e5c1c47a85299db945b9d1c847e SHA512 e52ddbf1a7235aff7756478f807e5c10cccf729d9cbd52294db767b958a5640f3645f3f5784618b55aca302808755707d3eca667637c1f93a233aa83365f567f WHIRLPOOL 112e78802d59aac029d33e3ec8cb833b29417a13ab6212393f15f09b42906d56d92501ac8bad972e3fb91d9255067795b32f4fd0589cedfd2f337572cc2576c5
+AUX cronie-1.4.3-pamd 231 SHA256 c281c9b8fb4984e20142a7e099d7032192d5c2ca2eb02ece5eb4f73ca64593dd SHA512 32268d8b097e60eb039c023647ecd651b6940a8fe1587111ce0d49314bbb2de451214f98b7b703fd284e231c10bc4e616d4d0c63c107d9cdbc2bb470a17f2c3a WHIRLPOOL 171dbaa3a49aec2731d1cd78a1a4168369a1a0596b98049fd9c026ab9af54e97fdcf81416fa4fe8201c232dcdf891c4d3e81da20ddfa103eae458094c2095424
+DIST cronie-1.4.12.tar.gz 234214 SHA256 0f5c9bf32f352599451c4ca0d6bc076d19e73ecfa5a90b34ecfe47c918c8bafd SHA512 ff17c9a1ba39957727db390d28d21248f05414f55119094d99a646695698e1b148b920f3fc91e9733b862bc8ce226824d290fff51abe17410a0e63ab3b424865 WHIRLPOOL 61a6a7c3a660bbbb38ff2b7b700fe6fa84b1144d20d658e26f4cde522f6fc3faa6141f4cb176f78cfb22cfb50e17f2a945aeb382761ba2aa1b25e6e16ad20082
+EBUILD cronie-1.4.12-r99.ebuild 2057 SHA256 58371871d9c0a65c52ca53c8dc41d259f4f54c4f56940a97990158a72b6740b2 SHA512 af840fe9b6d998486fe9b4ee2a3a0a1e44c2a7f193bbd4cc8fb39481caffddd8176cb5c078080effdb1b35889b866e3490ea4af63caa950e4e9efcaa2b58e026 WHIRLPOOL e7a822818b4cc58f623d177ade7bea340b58a9cc200c97e5cde75d6e958a1b0d39cc242ea87027a47d3ea9c32070318d83074765d6dd58461d5832b2c2ba95b3
+MISC metadata.xml 799 SHA256 fe8f004016da48f9eaf570c4777bd407f210d468e8779d8db538b5fa1f0dad7d SHA512 9bae8c4edf33af2e6d25aa9db003d40525895dc21ca3388a303a7bba851a0bbe46ac0d254e0aa9c84da8f5c1d2b0e0042e1e317f717c1bd53fe388849366da82 WHIRLPOOL a9e7f4565bc909bc44dc4b676edc48794e8da7235a33b9289fcf53de65fb3406662560588d80fbed90873a9a56fcf00a0ec03fd80325ec2c8e56b9a38b66e01a
diff --git a/sys-process/cronie/cronie-1.4.12-r99.ebuild b/sys-process/cronie/cronie-1.4.12-r99.ebuild
new file mode 100644
index 00000000..026029fa
--- /dev/null
+++ b/sys-process/cronie/cronie-1.4.12-r99.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/cronie-1.4.12.ebuild,v 1.4 2014/12/30 17:42:09 maekke Exp $
+
+EAPI=5
+
+inherit cron eutils pam systemd user
+
+DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron"
+SRC_URI="https://fedorahosted.org/releases/c/r/cronie/${P}.tar.gz"
+HOMEPAGE="https://fedorahosted.org/cronie/wiki"
+
+LICENSE="ISC BSD BSD-2 GPL-2"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="anacron +inotify pam selinux"
+
+DEPEND="pam? ( virtual/pam )
+ anacron? ( !sys-process/anacron )"
+RDEPEND="${DEPEND}"
+
+#cronie supports /etc/crontab
+CRON_SYSTEM_CRONTAB="yes"
+
+src_prepare() {
+ epatch "${FILESDIR}"/0001-add_limits_h_and_MAXNAMLEN.patch
+}
+
+pkg_setup() {
+ enewgroup crontab
+}
+
+src_configure() {
+ SPOOL_DIR="/var/spool/cron/crontabs" \
+ ANACRON_SPOOL_DIR="/var/spool/anacron" \
+ econf \
+ $(use_with inotify) \
+ $(use_with pam) \
+ $(use_with selinux) \
+ $(use_enable anacron) \
+ --enable-syscrontab \
+ --with-daemon_username=cron \
+ --with-daemon_groupname=cron
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ docrondir -m 1730 -o root -g crontab
+ fowners root:crontab /usr/bin/crontab
+ fperms 2751 /usr/bin/crontab
+
+ insinto /etc/conf.d
+ newins "${S}"/crond.sysconfig ${PN}
+
+ insinto /etc
+ newins "${FILESDIR}/${PN}-1.3-crontab" crontab
+ newins "${FILESDIR}/${PN}-1.2-cron.deny" cron.deny
+
+ keepdir /etc/cron.d
+ newinitd "${FILESDIR}/${PN}-1.3-initd" ${PN}
+ newpamd "${FILESDIR}/${PN}-1.4.3-pamd" crond
+
+ sed s:sysconfig/crond:conf.d/cronie: contrib/cronie.systemd \
+ > "${T}"/cronie.service
+ systemd_dounit "${T}"/cronie.service
+
+ if use anacron ; then
+ local anacrondir="/var/spool/anacron"
+ keepdir ${anacrondir}
+ fowners root:cron ${anacrondir}
+ fperms 0750 ${anacrondir}
+
+ insinto /etc
+
+ doins contrib/anacrontab
+
+ insinto /etc/cron.hourly
+ doins contrib/0anacron
+ fperms 0750 /etc/cron.hourly/0anacron
+ fi
+
+ dodoc AUTHORS README contrib/*
+}
+
+pkg_postinst() {
+ cron_pkg_postinst
+}
diff --git a/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch b/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch
new file mode 100644
index 00000000..fdf721b2
--- /dev/null
+++ b/sys-process/cronie/files/0001-add_limits_h_and_MAXNAMLEN.patch
@@ -0,0 +1,15 @@
+--- src/database.c 2015-01-10 13:17:11.253148769 +0000
++++ src/database.c 2015-01-10 13:18:45.491148769 +0000
+@@ -38,6 +38,12 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#if ! defined(__GLIBC__) && ! defined(__UCLIBC__)
++#include <limits.h>
++
++/* match gnu to posix */
++#define MAXNAMLEN NAME_MAX
++#endif
+
+ #ifdef WITH_INOTIFY
+ # include <sys/inotify.h>
diff --git a/sys-process/cronie/files/cronie-1.2-cron.deny b/sys-process/cronie/files/cronie-1.2-cron.deny
new file mode 100644
index 00000000..f909922d
--- /dev/null
+++ b/sys-process/cronie/files/cronie-1.2-cron.deny
@@ -0,0 +1,5 @@
+# $Id: cronie-1.2-cron.deny,v 1.1 2009/02/17 22:09:35 bangert Exp $
+# If for any reason you have users in the 'cron' group who should not
+# be allowed to run crontab, add them to this file (one username per
+# line)
+
diff --git a/sys-process/cronie/files/cronie-1.3-crontab b/sys-process/cronie/files/cronie-1.3-crontab
new file mode 100644
index 00000000..b14eeda3
--- /dev/null
+++ b/sys-process/cronie/files/cronie-1.3-crontab
@@ -0,0 +1,16 @@
+# for cronie
+# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/cronie-1.3-crontab,v 1.2 2014/04/18 13:24:55 polynomial-c Exp $
+
+# Global variables
+SHELL=/bin/bash
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+HOME=/
+
+# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
+# if anacron is not present
+59 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.hourly
+9 3 * * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.daily
+19 4 * * 6 root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.weekly
+29 5 1 * * root [ ! -x /etc/cron.hourly/0anacron ] && rm -f /var/spool/cron/lastrun/cron.monthly
+*/10 * * * * root [ ! -x /etc/cron.hourly/0anacron ] && { test -x /usr/sbin/run-crons && /usr/sbin/run-crons ; }
diff --git a/sys-process/cronie/files/cronie-1.3-initd b/sys-process/cronie/files/cronie-1.3-initd
new file mode 100644
index 00000000..138530f5
--- /dev/null
+++ b/sys-process/cronie/files/cronie-1.3-initd
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/cronie/files/cronie-1.3-initd,v 1.3 2014/03/04 00:17:58 polynomial-c Exp $
+
+command="/usr/sbin/crond"
+command_args="${CRONDARGS}"
+pidfile="/var/run/crond.pid"
+
+depend() {
+ use clock logger
+ need localmount
+ provide cron
+}
diff --git a/sys-process/cronie/files/cronie-1.4.3-pamd b/sys-process/cronie/files/cronie-1.4.3-pamd
new file mode 100644
index 00000000..e82be8d8
--- /dev/null
+++ b/sys-process/cronie/files/cronie-1.4.3-pamd
@@ -0,0 +1,9 @@
+#
+# The PAM configuration file for the cron daemon
+#
+#
+auth include system-auth
+account required pam_access.so
+account include system-auth
+session required pam_loginuid.so
+session include system-auth
diff --git a/sys-process/cronie/metadata.xml b/sys-process/cronie/metadata.xml
new file mode 100644
index 00000000..79ee2465
--- /dev/null
+++ b/sys-process/cronie/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>cron</herd>
+<maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+</maintainer>
+ <longdescription lang="en">
+ Cronie contains the standard UNIX daemon crond that runs specified programs at
+ scheduled times and related tools. It is based on the original cron and
+ has security and configuration enhancements like the ability to use pam and
+ SELinux.
+ And why cronie? See http://www.urbandictionary.com/define.php?term=cronie
+ </longdescription>
+ <use>
+ <flag name='anacron'>Install the periodic anacron command scheduler.</flag>
+ <flag name='inotify'>Enable inotify filesystem monitoring support.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-process/lsof/Manifest b/sys-process/lsof/Manifest
new file mode 100644
index 00000000..bbecd3a6
--- /dev/null
+++ b/sys-process/lsof/Manifest
@@ -0,0 +1,9 @@
+AUX lsof-4.85-arg.c.patch 703 SHA256 a517f97ae897dc1d1c7c4e1eeb2fe4a4dab646004c07457709f823e41e57bd43 SHA512 fa0b510e02647ae13515491240f7a2aa169c19f14a3a02ac9735a067ca509613a0aaf00b4f01e8f00a032a6320d15495d876fad3b4903c48df926ef5e8a397df WHIRLPOOL 80ee5f343120caa1ef104d6c0d542357eccf7e14981605cb8f5f82206e17a5f6d25675e3aeeb9c3cfdaa51e8c781aed8273f5e99dab115e0af926cfb0521353f
+AUX lsof-4.85-cross.patch 1000 SHA256 5067c73c65d9cbe75213572423d0ddea02a12ba7f3509767082cd9b6faf8b174 SHA512 399df859f225a69a7211c81439883afba38562d72b0d320dcf19acf7b705031963e97469a322af919d05aa14af501af6137301c24a29f871f59253c6d6a647d7 WHIRLPOOL b258a537f44d24c3e2bbc771476e98f79a3bcbf9b4d9d1e0f2779f9eae75e0a19eb8348a0d23ca2c9ad4d1835b859ec4f6ded74fd9fd5b8594d19bb1c8ff086b
+AUX lsof-4.85-fix-missing-netinet_tcp_h.patch 387 SHA256 b95910ad1b98e1b2a7b18abcc2bdebf25d2bffafa3005a51aaf4a9fa039f869a SHA512 d2cc166b97fcb47bde060f762953e296a1fb75a3460f416dc4e436a01e4f9efd0c6332c1cb471017abf252bd27272bd6a9c832f137e156b168c348ee3baee8d8 WHIRLPOOL 37f18c2ed5c2130dd12a8723e59573d3d144e8131ac12e77dba995ad2d87398071809726f63b7eeadb1b9b863bbbc3f494f2843034910b68d9a3102860c21104
+AUX lsof-4.87-remove-glibc-check.patch 514 SHA256 c90a71adbdcc5fb6d32b7469196315cc5b6c1b71f351eef748b899ec3ea89671 SHA512 34efacf57c8e3bd1fa0f84ce58b8046177cb6dd075840837ea3f104570c63ceb9b7491bba8524b6c712440c86f11dc1a2d5bf475703c59345c4cb9c5624cabe6 WHIRLPOOL dea979075595f26a8d03b09857ac9ffab9602dc4c39bafd6fdb8f804ae5d9d4f7dd282771522169ed4cbf236cc186f7677e20eb8ae44b0058dc1062f4656e23a
+DIST lsof_4.85.tar.bz2 763397 SHA256 49aa58e63539c45bada514a6a2e5a1c9f946ada1f4137dc9154cf4bf6054a1c1 SHA512 f38356d300e18feaac09043f19c3ef612ac22cb89608cbecbc3594dd170705be855ebc5ce80b069db4a5af9bb517b1f4e571c2e175aa579214014d7f77ac30cb WHIRLPOOL 7cc1476bae92699b5b52e2e9a31713840308768b9536d2f4c904439458cd8778311facafffeea93f743db4488dc296fccfaf852d739f2b68859e10031289a6d3
+DIST lsof_4.87.tar.bz2 773664 SHA256 dfdd3709d82bc79ccdf3e404b84aafa9aede5948642a824ecaefd0aac589da2c SHA512 5e811225dd65366e3ef49628d567864fadda1dbda2d66a5e473123e73c468f5a3a577ae4e1b701a55ac49c2a759dab5c413663121c260a2804fca10ece902766 WHIRLPOOL 4ef01b855dbd8418e1533ebb293c3faacfa38c7a3cd30436d0a8174a974b7cd0eebfb79b23c4c3f13b66a65813a6fbdf5aa483d3f8d2689325fe7d0f48bfb5eb
+EBUILD lsof-4.85-r99.ebuild 2396 SHA256 e9103045427f760b42a906bfa8ad29fd79c4ad40587fd37bb4d7f7d8986737a3 SHA512 5afc59a98315c2c26eaf28ce2c2aa99719b3c49845eb3f163b79ad74442e1cf06c2d3bf27359f707829c1a850aa1d4994aa6419c7fd7873f7aff6e984243e918 WHIRLPOOL 8b9b2bb379c5e68bfa6c63e5c46f5085f680d3c285aa5bd381ebba6c90e39a592113d07206ef7634a40f3b948a64f864adeff9f074dd62b660d4757ae197e3be
+EBUILD lsof-4.87-r99.ebuild 2939 SHA256 875f3a3317470458290d62cbe45a39a7e159e5affaf11c9d1b6056fd29634102 SHA512 001699b94b3dfc8f6dc80d42ef96ebd48db6663e8946e709f21b228bfe9a23fc41a6efd2a3cbcae77063cadc56429993f4f41b2f8076ebfef7340a210daeda02 WHIRLPOOL f0aab68fac77f221ff9a26d800ef77c4e004c3a0d9b463f40344cee0dd4bbdc9944d53c8c81998eb49388d90ab7d1a3339e9f252a87bde9a7c7d4a174f828567
+MISC metadata.xml 238 SHA256 27f27d7c7ba9fb670a6867a79ff8af354e48735f9bd672d387d96b4bd49d415b SHA512 b8434ca8a5f116234268cca5c8d7cf20b3187e1f2c326bfe3693e2e85c2dac961618b39a20d0d5b7a01744b5159057e2861eeaff7fef6a08e0fc4c1b47bbf778 WHIRLPOOL f3ada27de4f86d469929230f1649727d91cc303e007ae728038062a04522053f0b49559d5bc4b6dd203744ba117d1577d03d62a1cb5d7c24c86c268edf057761
diff --git a/sys-process/lsof/files/lsof-4.85-arg.c.patch b/sys-process/lsof/files/lsof-4.85-arg.c.patch
new file mode 100644
index 00000000..98838cd7
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-arg.c.patch
@@ -0,0 +1,30 @@
+arg.c.patch Patches: lsof_4.85_src/arg.c
+
+ Importance: major for all dialects supporting
+ the +|-e option (e.g., Linux)
+
+ Function: this patch corrects a bug in the
+ accumulation of multiple +|-e
+ option values
+
+*** /tmp/T0iAaaeo Thu Oct 20 14:08:43 2011
+--- arg.c Thu Oct 20 14:03:49 2011
+***************
+*** 778,785 ****
+ ep->pathl = i;
+ ep->rdlnk = rdlnk;
+ ep->mp = (struct mounts *)NULL;
+! if (!(ep->next = Efsysl))
+! Efsysl = ep;
+ return(0);
+ }
+ #endif /* defined(HASEOPT) */
+--- 778,785 ----
+ ep->pathl = i;
+ ep->rdlnk = rdlnk;
+ ep->mp = (struct mounts *)NULL;
+! ep->next = Efsysl;
+! Efsysl = ep;
+ return(0);
+ }
+ #endif /* defined(HASEOPT) */
diff --git a/sys-process/lsof/files/lsof-4.85-cross.patch b/sys-process/lsof/files/lsof-4.85-cross.patch
new file mode 100644
index 00000000..186c6d8d
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-cross.patch
@@ -0,0 +1,33 @@
+let the preprocessor work its magic rather than executing the code
+
+https://bugs.gentoo.org/432120
+
+--- a/Configure
++++ b/Configure
+@@ -2730,20 +2730,17 @@ LOCKF_OWNER4
+ rm -f ${LSOF_TMPC}.*
+ cat > $LSOF_TMPC.c << .LSOF_END_HERE_DOC1
+ #include <features.h>
+-main() {
++#undef XXX
+ #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+-printf("-DGLIBCV=%d\n",__GLIBC__*100+__GLIBC_MINOR__);
++XXX: __GLIBC__ * 100 + __GLIBC_MINOR__
+ #elif defined(__GLIBC__)
+-printf("-DGLIBCV=%d00\n",__GLIBC__);
+-#else
+-printf("\n");
++XXX: __GLIBC__ * 100
+ #endif
+-return(0); }
+ .LSOF_END_HERE_DOC1
+- $LINUX_CONF_CC ${LSOF_TMPC}.c -I$LSOF_INCLUDE -o ${LSOF_TMPC}.x > /dev/null 2>&1
++ $LINUX_CONF_CC ${LSOF_TMPC}.c -E -I$LSOF_INCLUDE 2>/dev/null | sed -n '/^XXX:/s|.*:||p' > ${LSOF_TMPC}.x
+- if test -x ${LSOF_TMPC}.x # {
++ if test -s ${LSOF_TMPC}.x # {
+ then
+- LINUX_CLIB=`${LSOF_TMPC}.x`
++ LINUX_CLIB="-DGLIBCV=$(( `cat ${LSOF_TMPC}.x` ))"
+ LSOF_TMP=$?
+ else
+ LINUX_CLIB=""
diff --git a/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch b/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch
new file mode 100644
index 00000000..919c7ae6
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.85-fix-missing-netinet_tcp_h.patch
@@ -0,0 +1,11 @@
+diff -Naur lsof_4.85.orig/lsof_4.85_src/lsof.h lsof_4.85/lsof_4.85_src/lsof.h
+--- lsof_4.85.orig/lsof_4.85_src/lsof.h 2011-09-07 19:14:10.000000000 +0000
++++ lsof_4.85/lsof_4.85_src/lsof.h 2014-02-21 19:31:43.322452780 +0000
+@@ -53,6 +53,7 @@
+ #include <locale.h>
+ # endif /* defined(HASSETLOCALE) */
+
++#include <netinet/tcp.h>
+ #include <netdb.h>
+ #include <pwd.h>
+ #include <stdio.h>
diff --git a/sys-process/lsof/files/lsof-4.87-remove-glibc-check.patch b/sys-process/lsof/files/lsof-4.87-remove-glibc-check.patch
new file mode 100644
index 00000000..1e121cba
--- /dev/null
+++ b/sys-process/lsof/files/lsof-4.87-remove-glibc-check.patch
@@ -0,0 +1,15 @@
+--- a/lsof_4.87_src/dialects/linux/dlsof.h 2015-02-28 22:37:00.731421615 +0000
++++ b/lsof_4.87_src/dialects/linux/dlsof.h 2015-02-28 22:37:57.585422124 +0000
+@@ -49,12 +49,7 @@
+ #include <setjmp.h>
+ #include <unistd.h>
+ #include <netinet/in.h>
+-
+-# if defined(GLIBCV) || defined(__UCLIBC__)
+ #include <netinet/tcp.h>
+-# else /* !defined(GLIBCV) && !defined(__UCLIBC__) */
+-#include <linux/tcp.h>
+-# endif /* defined(GLIBCV) || defined(__UCLIBC__) */
+
+ # if !defined(HASNORPC_H)
+ #include <rpc/rpc.h> \ No newline at end of file
diff --git a/sys-process/lsof/lsof-4.85-r99.ebuild b/sys-process/lsof/lsof-4.85-r99.ebuild
new file mode 100644
index 00000000..53829191
--- /dev/null
+++ b/sys-process/lsof/lsof-4.85-r99.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.85-r2.ebuild,v 1.12 2014/01/20 06:40:56 vapier Exp $
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+MY_P=${P/-/_}
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
+SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="examples ipv6 rpc selinux static"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ rpc? ( virtual/pkgconfig )"
+
+S=${WORKDIR}/${MY_P}/${MY_P}_src
+
+src_unpack() {
+ unpack ${A}
+ cd ${MY_P}
+ unpack ./${MY_P}_src.tar
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fix-missing-netinet_tcp_h.patch #for musl
+ epatch "${FILESDIR}"/${P}-arg.c.patch #388555
+ epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
+ # convert `test -r header.h` into a compile test
+ sed -i -r \
+ -e 's:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:' \
+ -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
+ Configure || die
+}
+
+target() { usex kernel_FreeBSD freebsd linux ; }
+src_configure() {
+ use static && append-ldflags -static
+
+ append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
+ append-cppflags $(usex ipv6 -{D,U}HASIPv6)
+
+ export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
+ $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
+
+ # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
+ # around in it and mix /usr/include paths with cross-compile/etc.
+ touch .neverInv
+ LINUX_HASSELINUX=$(usex selinux y n) \
+ LSOF_INCLUDE=${T} \
+ LSOF_CC=$(tc-getCC) \
+ LSOF_AR="$(tc-getAR) rc" \
+ LSOF_RANLIB=$(tc-getRANLIB) \
+ LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
+ ./Configure -n $(target) || die
+}
+
+src_compile() {
+ emake DEBUG="" all || die
+}
+
+src_install() {
+ dobin lsof || die
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/* || die
+ fi
+
+ doman lsof.8 || die
+ dodoc 00*
+}
diff --git a/sys-process/lsof/lsof-4.87-r99.ebuild b/sys-process/lsof/lsof-4.87-r99.ebuild
new file mode 100644
index 00000000..dd3753b3
--- /dev/null
+++ b/sys-process/lsof/lsof-4.87-r99.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/lsof/lsof-4.87-r1.ebuild,v 1.13 2014/12/06 16:38:45 ago Exp $
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+MY_P=${P/-/_}
+DESCRIPTION="Lists open files for running Unix processes"
+HOMEPAGE="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
+SRC_URI="ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/${MY_P}.tar.bz2
+ ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/${MY_P}.tar.bz2"
+
+LICENSE="lsof"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples ipv6 rpc selinux static"
+
+RDEPEND="rpc? ( net-libs/libtirpc )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ rpc? ( virtual/pkgconfig )"
+
+S=${WORKDIR}/${MY_P}/${MY_P}_src
+
+src_unpack() {
+ unpack ${A}
+ cd ${MY_P}
+ unpack ./${MY_P}_src.tar
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-4.87-remove-glibc-check.patch #for musl
+ epatch "${FILESDIR}"/${PN}-4.85-cross.patch #432120
+ # convert `test -r header.h` into a compile test
+ sed -i -r \
+ -e 's:test -r \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\1>" | ${LSOF_CC} ${LSOF_CFGF} -E - >/dev/null 2>\&1:' \
+ -e 's:grep (.*) \$\{LSOF_INCLUDE\}/([[:alnum:]/._]*):echo "#include <\2>" | ${LSOF_CC} ${LSOF_CFGF} -E -P -dD - 2>/dev/null | grep \1:' \
+ Configure || die
+}
+
+target() {
+ case ${CHOST} in
+ *-darwin*) echo darwin ;;
+ *-freebsd*) echo freebsd ;;
+ *-solaris*) echo solaris ;;
+ *-aix*) echo aixgcc ;;
+ *) echo linux ;;
+ esac
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ append-cppflags $(use rpc && $(tc-getPKG_CONFIG) libtirpc --cflags || echo "-DHASNOTRPC -DHASNORPC_H")
+ append-cppflags $(usex ipv6 -{D,U}HASIPv6)
+
+ export LSOF_CFGL="${CFLAGS} ${LDFLAGS} \
+ $(use rpc && $(tc-getPKG_CONFIG) libtirpc --libs)"
+
+ # Set LSOF_INCLUDE to a dummy location so the script doesn't poke
+ # around in it and mix /usr/include paths with cross-compile/etc.
+ touch .neverInv
+ LINUX_HASSELINUX=$(usex selinux y n) \
+ LSOF_INCLUDE=${T} \
+ LSOF_CC=$(tc-getCC) \
+ LSOF_AR="$(tc-getAR) rc" \
+ LSOF_RANLIB=$(tc-getRANLIB) \
+ LSOF_CFGF="${CFLAGS} ${CPPFLAGS}" \
+ ./Configure -n $(target) || die
+}
+
+src_compile() {
+ emake DEBUG="" all
+}
+
+src_install() {
+ dobin lsof
+
+ if use examples ; then
+ insinto /usr/share/lsof/scripts
+ doins scripts/*
+ fi
+
+ doman lsof.8
+ dodoc 00*
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ einfo "Note: to use lsof on Solaris you need read permissions on"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group sys"
+ elif [[ ${CHOST} == *-aix* ]] ; then
+ einfo "Note: to use lsof on AIX you need read permissions on /dev/mem and"
+ einfo "/dev/kmem, i.e. you need to be root, or to be in the group system"
+ fi
+}
diff --git a/sys-process/lsof/metadata.xml b/sys-process/lsof/metadata.xml
new file mode 100644
index 00000000..49fb858f
--- /dev/null
+++ b/sys-process/lsof/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 looking up RPC service info</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-process/procps/Manifest b/sys-process/procps/Manifest
new file mode 100644
index 00000000..e3aabc01
--- /dev/null
+++ b/sys-process/procps/Manifest
@@ -0,0 +1,14 @@
+AUX procps-3.3.6-error_at_line.patch 325 SHA256 642eb70e9165f3cf18b7ca3afe370f93991b32bc0271c9e1064c774dd2fadbb3 SHA512 fd0fd437deb7c1ac683ca90f3e94d14b35f3e9d19422e84f59b74d7530f204a04a289e5397d986536adffb2a30611ec5a8486bc9f01a32708d9025d3fb7c98b9 WHIRLPOOL f0f2da5452a8a1817a48a76723f6d02eddb856e8e69bac8ec8d87891a7f94f10c8945dba5c501cdc0d3f52fe690940524d0ae2c32868a3aa48155e54ffd2c3af
+AUX procps-3.3.8-kill-neg-pid.patch 1446 SHA256 847c21f6619c7aa0f2847726a17595f986ec2fe0f361d95e17812639abe32a79 SHA512 3ed4e83d81f7dd574ff68bbcae9ad9f8649a39d46a17de5fd4297f215d8f70cd28e415b1d3c7b5142e7719343af28f4b393061a60eb012caece81dfe5ff6c271 WHIRLPOOL cf452118312e60a0bab7a4ec87bed9a9d2f5fb8bb563769a0430f11c72348e5be79bdfc031f67f4e97e0bf9b32f6ccd1ac590f392c95ee935b77b857ce1b1739
+AUX procps-3.3.8-no-GLOB_TILDE.patch 466 SHA256 17b3e7360d740c97b842e1c68cd863bb66b13b1539b6ead7435d75c1daf5f48a SHA512 9fc13cff6c310080f5af8a2fa83e88d88ff741046c988ae806ce010b37cfd38a770726bc98bb50b9532c5c1679f7da45b12803f55e4e40638daf4dd55c58b84f WHIRLPOOL d791950607fd06a8bfeccf21fd17a454f3c3a207f562bcebdd1c521f0afecdd8a358dec8a4277951eed0f71a7210ba89bae2f9e8887043e39169aab7bd9c6269
+AUX procps-3.3.8-no-error_h.patch 1394 SHA256 2535f3cafc047aff6ddb879dc31479d95b445130471934a48d9aaa25835b91f3 SHA512 0c4dd060f93dca15fc36a0a4640909dd1782dc7af96ada62ec42a0d4f2831ccd1e274c14136d0df679b7066316dc44203267c077a875f6183df131b90c6f2a26 WHIRLPOOL 8232a4c92687ea8334ab933947fee107a1e7d712dbd3dbff4030353e41fd83384772b24a6acaa8335245205d06dedcf3ad28a5f642dd141882a73332d5c36920
+AUX procps-3.3.9-configure.patch 462 SHA256 d5d1274b7a41d2e2c6ccdada90f5107cbbc416b6b977e44da3bde2e299085ab2 SHA512 197c22cd86e601f77a6fa86d6bfcae6019982d4faad50aaf1c002d093f961cb8f664169b8b90f17572511c7fdd2b3afe6cc655793abf8bce4257c603be47ade5 WHIRLPOOL 6ee6d5ad2c24a17722613847fced3e6d962f1a4f4af3f4bc9c87aec269ee43f825effcb5308f496a9c78f8ea61ca8295ff598142ee005abeaee62a9b76ee0da9
+AUX procps-3.3.9-no-error_h.patch 1587 SHA256 0ed0d24f05ff23f83bd8cafa45e07cd015d45b394dadad76f3deea2316211465 SHA512 f05db99409189c3e284d65faa7ca9d267ab8cb111d5958bb722f57919fe45cbb00332d0c1b1f9f666b492ba657e0ea6bf931b9c71d4dfc5b69775fcf18acf480 WHIRLPOOL f41d32288b340e8de389034b60afd6b3b011f565e63b27b98d429fe4be1f73e90a72f35e550706dc5d5f856e4b9b540b6cfcbc4ec504ae3aea9ff374d86027d8
+DIST procps-3.3.8-respect_epipe_in_fileutils.patch 1412 SHA256 4a56c88697fa6099a62a4169838c9c04df2c2c2bbc08e9ad9953e5b00df16d68 SHA512 317fc8e7c3fbd280182f55b399a30b2cfbc72268590825ea323537361cd761776afe1486509cb04ae937287ccf11578def5aac2eaa0fe660d04f0357282d9c14 WHIRLPOOL f8fdac8a172037edf51e1e777374293848afaa2180adc35adce5bf8ebefceb37df30082b27f6d6f1f5a571ba0f84bdfff9fc6c2343f120ce5c80b2f52e1804ac
+DIST procps-ng-3.3.10.tar.xz 657232 SHA256 1759229cd0d97da3d200d5599c4ea82726d61fae9c4b7d3edd52c544962791b7 SHA512 cbfa49e79a88a8e7066a9c316ef089f15fa825c5bfbc22ab8a83f53c6f367a7c586cef9c403e360d373d824c471533a15ddb11cd30c561650e6879fe687e7e4f WHIRLPOOL 723dd1c00578a7fa7e3ff47bed60283c30850cc8ae8069c704ba648792809a67c5944dbfd9b7b0159e0be83215b61e6b71b2d76e65b3619aed54223900ffed9b
+DIST procps-ng-3.3.8.tar.xz 553056 SHA256 a4109cfb6fe3bcfb5a0efb37efe04d0c8ce858bff3820d48cc258bad41bed46b SHA512 63ba13f9ef0f4558748c6b2d1b0719a1173bd87e38279e3b052a10e207e1b808626d031f16dd65b05c55708366df7350cb0a64da8dc20e7f9f1fdc1cd2417c71 WHIRLPOOL 671860af1f028c9c8c7bb0c035db86e3e13d9d754801e7a3f19105710bb9720bbfa627e4e748b823192286319fe4e7e736c1af5a3fb34116cbe93386b0d2bed6
+DIST procps-ng-3.3.9.tar.xz 560812 SHA256 00f0cb0fadf968ddf605b0ef119846af07386629244d4f3da711a2cecf4e8663 SHA512 62c7270aa48b4346a3198f306d1cb8474f64650bfb67e8cc6c4d41923e50c31c95b3a0367a464823fb50a6137ec0c6352006292ac85b50caf730ec8ec35eb553 WHIRLPOOL dac97433a87badd40b46e3155bf0e30652ed2961a41bc8fca074357431301d250632215512ad752634c9c4f3273a1c75caba1ecf4f5a3c510bee155660dde166
+EBUILD procps-3.3.10-r99.ebuild 1909 SHA256 6ecaab61ee1932be7331c310762213cf8bbc3d7a4223a7b6fbaed478334c4c0a SHA512 21014530561f93884034b8b1e1fa694e459b14888153817221bdb5be6a4423d480971cf2715fb3881f830d044fb2d5ed84e648a2d8c65165770ae2ddd3ab6fcf WHIRLPOOL 952c44f05eda80ed1172a60d3617a4343b050d23b4f88934887bbf8f5e8dacf93c91c1b566d58db656559f696f53cf97c6934822fedd8063ab3827437c73b115
+EBUILD procps-3.3.8-r99.ebuild 1818 SHA256 fd06e9254f0216b401346463268112c9bf9a008c73d8407fe78d005437b4aed7 SHA512 44811f384402b264d1474775db477edf28f733d1b1785326d609e1d6ce0be5da1c72037db51283456e2ff90b6ee58009015e259812aeb2854309a69a1561545e WHIRLPOOL 7405808b4178630c047a4bd14776cc22c88a4c49de70d788aae333670d0277db39b5901197fbcd4c22a9f3f6df6726e96dffff3d5a7d79f53f35755c0a41a282
+EBUILD procps-3.3.9-r99.ebuild 1698 SHA256 10d81de372db3c00a1e3bc5e1d88e8200cc58f16f2fbbbe0886403f4421d565e SHA512 cb44fd715fdf82d62789dce81bc49a796eedce0bcfd1ed682bd7bbb23223a8c8b02137231f1dbd4c3c267410042609c357b976cbf4697a105cbd3879a6f8a1b1 WHIRLPOOL 2c86fa70f08158601318f18a1fb8a5cc3ceca79e651935be3e9fdef86920578809eae9872fafd34349c2c474e3ea0b23ac2d81169e154b02d563b62d5ca06a13
+MISC metadata.xml 259 SHA256 0bb63eb156063b66b45ac343be2ccf262f08ea0a9d247e8b1428d2f413c978c2 SHA512 b3ffc0288a73615eb2a24f7af77fa63781c3b6d713a2ba47d4bf83accf7d82bcb029e24cea7600b1ecc94de723f51b20fda082cf22d5b48dc05e98bd6eea6017 WHIRLPOOL 5339d46eb28ba6d6e413e6c79ea8c4c174379b0a99baa990c9f5e18c199113b96e5028437e3d175087d19730869cad704b34c10fc0714a88cea00517ce85dc92
diff --git a/sys-process/procps/files/procps-3.3.6-error_at_line.patch b/sys-process/procps/files/procps-3.3.6-error_at_line.patch
new file mode 100644
index 00000000..4329a496
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.6-error_at_line.patch
@@ -0,0 +1,12 @@
+ps/display.c:65:7: warning: implicit declaration of function ‘error_at_line’ [-Wimplicit-function-declaration]
+
+--- ps/display.c
++++ ps/display.c
+@@ -25,6 +25,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <error.h> /* error_at_line */
+
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
diff --git a/sys-process/procps/files/procps-3.3.8-kill-neg-pid.patch b/sys-process/procps/files/procps-3.3.8-kill-neg-pid.patch
new file mode 100644
index 00000000..00397480
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.8-kill-neg-pid.patch
@@ -0,0 +1,46 @@
+From 396cbc4cf36166217d877e2ff7e0a290758b0bc2 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 27 Jun 2013 18:37:17 -0400
+Subject: [PATCH] kill: fix -PID handling
+
+Commit 19b6f48990b02aeca211b480625b95b2033c1017 tried to fix -PID
+handling, but the new logic ends up skipping over the arg. This is
+because getopt increments optind after it processed the -PID (even
+though it was an unknown option). We need to decrement it by one
+so the loop at the end of the code will process it for us.
+
+I also fixed some whitespace errors in that same commit.
+
+URL: http://code.google.com/p/chromium/issues/detail?id=255209
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ skill.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/skill.c b/skill.c
+index fb57305..074c5d7 100644
+--- a/skill.c
++++ b/skill.c
+@@ -390,7 +390,7 @@ static void __attribute__ ((__noreturn__))
+ else
+ sigopt++;
+
+- opterr=0; /* suppress errors on -123 */
++ opterr = 0; /* suppress errors on -123 */
+ while (loop == 1 && (i = getopt_long(argc, argv, "l::Ls:hV", longopts, NULL)) != -1)
+ switch (i) {
+ case 'l':
+@@ -423,7 +423,9 @@ static void __attribute__ ((__noreturn__))
+ xwarnx(_("invalid argument %c"), optopt);
+ kill_usage(stderr);
+ }
+- loop=0;
++ /* We need to back off by one since getopt() ate the -PID */
++ --optind;
++ loop = 0;
+ break;
+ default:
+ kill_usage(stderr);
+--
+1.8.2.1
+
diff --git a/sys-process/procps/files/procps-3.3.8-no-GLOB_TILDE.patch b/sys-process/procps/files/procps-3.3.8-no-GLOB_TILDE.patch
new file mode 100644
index 00000000..09af4208
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.8-no-GLOB_TILDE.patch
@@ -0,0 +1,12 @@
+diff -Nuar procps-ng-3.3.8.orig/sysctl.c procps-ng-3.3.8/sysctl.c
+--- procps-ng-3.3.8.orig/sysctl.c 2013-05-25 21:39:41.000000000 +0000
++++ procps-ng-3.3.8/sysctl.c 2014-01-17 16:28:37.241303653 +0000
+@@ -500,7 +500,7 @@
+ int globerr;
+ int j;
+
+- globerr = glob(filename, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf);
++ globerr = glob(filename, GLOB_NOCHECK, NULL, &globbuf);
+ if (globerr != 0 && globerr != GLOB_NOMATCH)
+ xerr(EXIT_FAILURE, _("glob failed"));
+
diff --git a/sys-process/procps/files/procps-3.3.8-no-error_h.patch b/sys-process/procps/files/procps-3.3.8-no-error_h.patch
new file mode 100644
index 00000000..e6ca7937
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.8-no-error_h.patch
@@ -0,0 +1,54 @@
+diff -Naur procps-ng-3.3.8.orig/ps/display.c procps-ng-3.3.8/ps/display.c
+--- procps-ng-3.3.8.orig/ps/display.c 2013-05-25 21:39:40.000000000 +0000
++++ procps-ng-3.3.8/ps/display.c 2014-01-17 14:43:26.027950754 +0000
+@@ -25,7 +25,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++
++#if HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <err.h>
++#endif
+
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+@@ -63,7 +68,11 @@
+ case SIGUSR2:
+ exit(EXIT_FAILURE);
+ default:
++#if HAVE_ERROR_H
+ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
++#else
++ err(1, "%s:%d: %s", __FILE__, __LINE__, _("please report this bug"));
++#endif
+ signal(signo, SIG_DFL); /* allow core file creation */
+ kill(getpid(), signo);
+ }
+--- procps-ng-3.3.8.orig/ps/global.c 2013-05-25 21:39:40.000000000 +0000
++++ procps-ng-3.3.8/ps/global.c 2014-01-17 14:42:00.972945998 +0000
+@@ -25,7 +27,12 @@
+ #include <string.h>
+ #include <termios.h>
+ #include <unistd.h>
++
++#if HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <err.h>
++#endif
+
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+@@ -522,6 +529,10 @@
+ unsigned int linenum,
+ const char *message)
+ {
++#if HAVE_ERROR_H
+ error_at_line(0, 0, filename, linenum, "%s", message);
++#else
++ err(1, "%s:%d: %s", filename, linenum, message);
++#endif
+ exit(EXIT_FAILURE);
+ }
diff --git a/sys-process/procps/files/procps-3.3.9-configure.patch b/sys-process/procps/files/procps-3.3.9-configure.patch
new file mode 100644
index 00000000..4822f62e
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.9-configure.patch
@@ -0,0 +1,13 @@
+--- a/procps-ng-3.3.9/configure.ac
++++ b/procps-ng-3.3.9/configure.ac
+@@ -235,7 +235,9 @@
+ else
+ AC_SEARCH_LIBS([dlopen], [dl], [],
+ [AC_MSG_ERROR([dynamic linking unavailable, circumvent with --disable-numa])])
+- DL_LIB="$ac_cv_search_dlopen"
++ if test "$ac_cv_search_dlopen" != "none required" ; then
++ DL_LIB="$ac_cv_search_dlopen"
++ fi
+ fi
+ AC_SUBST([DL_LIB])
+
diff --git a/sys-process/procps/files/procps-3.3.9-no-error_h.patch b/sys-process/procps/files/procps-3.3.9-no-error_h.patch
new file mode 100644
index 00000000..070e1fe6
--- /dev/null
+++ b/sys-process/procps/files/procps-3.3.9-no-error_h.patch
@@ -0,0 +1,64 @@
+diff -aur a/procps-ng-3.3.9/lib/nsutils.c b/procps-ng-3.3.9/lib/nsutils.c
+--- a/procps-ng-3.3.9/lib/nsutils.c
++++ b/procps-ng-3.3.9/lib/nsutils.c
+@@ -1,5 +1,4 @@
+ #include <errno.h>
+-#include <error.h>
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <sys/types.h>
+diff -aur a/procps-ng-3.3.9/ps/display.c b/procps-ng-3.3.9/ps/display.c
+--- a/procps-ng-3.3.9/ps/display.c
++++ b/procps-ng-3.3.9/ps/display.c
+@@ -25,7 +25,12 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++
++#if HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <err.h>
++#endif
+
+ #include <sys/sysmacros.h>
+ #include <sys/types.h>
+@@ -63,7 +68,11 @@
+ case SIGUSR2:
+ exit(EXIT_FAILURE);
+ default:
++#if HAVE_ERROR_H
+ error_at_line(0, 0, __FILE__, __LINE__, "%s", _("please report this bug"));
++#else
++ err(1, "%s:%d: %s", __FILE__, __LINE__, _("please report this bug"));
++#endif
+ signal(signo, SIG_DFL); /* allow core file creation */
+ kill(getpid(), signo);
+ }
+diff -aur a/procps-ng-3.3.9/ps/global.c b/procps-ng-3.3.9/ps/global.c
+--- a/procps-ng-3.3.9/ps/global.c
++++ b/procps-ng-3.3.9/ps/global.c
+@@ -25,7 +25,12 @@
+ #include <string.h>
+ #include <termios.h>
+ #include <unistd.h>
++
++#if HAVE_ERROR_H
+ #include <error.h>
++#else
++#include <err.h>
++#endif
+
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+@@ -522,6 +527,10 @@
+ unsigned int linenum,
+ const char *message)
+ {
++#if HAVE_ERROR_H
+ error_at_line(0, 0, filename, linenum, "%s", message);
++#else
++ err(1, "%s:%d: %s", filename, linenum, message);
++#endif
+ exit(EXIT_FAILURE);
+ }
diff --git a/sys-process/procps/metadata.xml b/sys-process/procps/metadata.xml
new file mode 100644
index 00000000..16e9fa35
--- /dev/null
+++ b/sys-process/procps/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='ncurses'>Build programs that use ncurses: top, slabtop, watch</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-process/procps/procps-3.3.10-r99.ebuild b/sys-process/procps/procps-3.3.10-r99.ebuild
new file mode 100644
index 00000000..9c1b4d81
--- /dev/null
+++ b/sys-process/procps/procps-3.3.10-r99.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/procps-3.3.10-r1.ebuild,v 1.1 2014/09/24 06:14:53 polynomial-c Exp $
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="standard informational utilities and process-handling tools"
+# http://packages.debian.org/sid/procps
+HOMEPAGE="http://procps.sourceforge.net/ http://gitorious.org/procps"
+# SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV}.orig.tar.xz"
+#FEDORA_HASH="0980646fa25e0be58f7afb6b98f79d74"
+#SRC_URI="http://pkgs.fedoraproject.org/repo/pkgs/${PN}-ng/${PN}-ng-${PV}.tar.xz/${FEDORA_HASH}/${PN}-ng-${PV}.tar.xz"
+SRC_URI="http://dev.gentoo.org/~polynomial-c/${PN}-ng-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips x86"
+IUSE="+ncurses modern-top nls selinux static-libs systemd test"
+
+RDEPEND="!<sys-apps/sysvinit-2.88-r6
+ ncurses? ( >=sys-libs/ncurses-5.7-r7 )
+ selinux? ( sys-libs/libselinux )
+ systemd? ( >=sys-apps/systemd-209 )"
+DEPEND="${RDEPEND}
+ ncurses? ( virtual/pkgconfig )
+ systemd? ( virtual/pkgconfig )
+ test? ( dev-util/dejagnu )"
+
+S=${WORKDIR}/${PN}-ng-${PV}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.3.8-kill-neg-pid.patch
+ sed -i -e 's:systemd-login:systemd:' configure || die #501306
+}
+
+src_configure() {
+ use elibc_musl && append-cppflags -D_XOPEN_SOURCE_EXTENDED
+ econf \
+ --exec-prefix="${EPREFIX}" \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ --disable-watch8bit \
+ $(use_enable modern-top) \
+ $(use_with ncurses) \
+ $(use_enable nls) \
+ $(use_enable selinux libselinux) \
+ $(use_enable static-libs static) \
+ $(use_with systemd)
+}
+
+src_install() {
+ default
+ #dodoc sysctl.conf
+
+ mv "${ED}"/usr/bin/pidof "${ED}"/bin/ || die
+
+ # The configure script is completely whacked in the head
+ mv "${ED}"/lib* "${ED}"/usr/ || die
+ gen_usr_ldscript -a procps
+ prune_libtool_files
+}
diff --git a/sys-process/procps/procps-3.3.8-r99.ebuild b/sys-process/procps/procps-3.3.8-r99.ebuild
new file mode 100644
index 00000000..1ed3ba5a
--- /dev/null
+++ b/sys-process/procps/procps-3.3.8-r99.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/procps-3.3.8-r1.ebuild,v 1.10 2013/12/26 14:41:10 maekke Exp $
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="standard informational utilities and process-handling tools"
+# http://packages.debian.org/sid/procps
+HOMEPAGE="http://procps.sourceforge.net/ http://gitorious.org/procps"
+# SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV}.orig.tar.xz"
+FEDORA_HASH="aecbeeda2ab308f8d09dddcb4cb9a572"
+SRC_URI="http://pkgs.fedoraproject.org/repo/pkgs/${PN}-ng/${PN}-ng-${PV}.tar.xz/${FEDORA_HASH}/${PN}-ng-${PV}.tar.xz
+ https://gitorious.org/${PN}/${PN}/commit/ce5e995921e770bfcda25e42fe090aeccdbf1291.patch -> ${P}-respect_epipe_in_fileutils.patch"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+ncurses nls static-libs unicode"
+
+RDEPEND="ncurses? ( >=sys-libs/ncurses-5.7-r7[unicode?] )"
+DEPEND="${RDEPEND}
+ ncurses? ( virtual/pkgconfig )
+ test? ( dev-util/dejagnu )"
+
+S=${WORKDIR}/${PN}-ng-${PV}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-kill-neg-pid.patch \
+ "${DISTDIR}"/${P}-respect_epipe_in_fileutils.patch \
+ "${FILESDIR}"/${P}-no-error_h.patch \
+ "${FILESDIR}"/${P}-no-GLOB_TILDE.patch
+}
+
+src_configure() {
+ use elibc_musl && export ac_cv_search_dlopen=
+ use elibc_musl && append-cflags -D_XOPEN_SOURCE_EXTENDED
+ econf \
+ --exec-prefix="${EPREFIX}" \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ $(use_with ncurses) \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode watch8bit)
+}
+
+src_install() {
+ default
+# dodoc sysctl.conf
+
+ # The configure script is completely whacked in the head
+ mv "${ED}"/lib* "${ED}"/usr/ || die
+ gen_usr_ldscript -a procps
+ prune_libtool_files
+}
diff --git a/sys-process/procps/procps-3.3.9-r99.ebuild b/sys-process/procps/procps-3.3.9-r99.ebuild
new file mode 100644
index 00000000..41b08e2a
--- /dev/null
+++ b/sys-process/procps/procps-3.3.9-r99.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/procps/procps-3.3.9.ebuild,v 1.6 2014/05/14 18:16:01 ssuominen Exp $
+
+EAPI="4"
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="standard informational utilities and process-handling tools"
+# http://packages.debian.org/sid/procps
+HOMEPAGE="http://procps.sourceforge.net/ http://gitorious.org/procps"
+# SRC_URI="mirror://debian/pool/main/p/${PN}/${PN}_${PV}.orig.tar.xz"
+FEDORA_HASH="0980646fa25e0be58f7afb6b98f79d74"
+SRC_URI="http://pkgs.fedoraproject.org/repo/pkgs/${PN}-ng/${PN}-ng-${PV}.tar.xz/${FEDORA_HASH}/${PN}-ng-${PV}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="+ncurses nls static-libs test unicode"
+
+RDEPEND="ncurses? ( >=sys-libs/ncurses-5.7-r7[unicode?] )
+ !<sys-apps/sysvinit-2.88-r6"
+DEPEND="${RDEPEND}
+ ncurses? ( virtual/pkgconfig )
+ test? ( dev-util/dejagnu )"
+
+S=${WORKDIR}/${PN}-ng-${PV}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.3.8-kill-neg-pid.patch
+ epatch "${FILESDIR}"/${PN}-3.3.8-no-GLOB_TILDE.patch
+ epatch "${FILESDIR}"/${P}-no-error_h.patch
+ epatch "${FILESDIR}"/${P}-configure.patch
+ autoreconf
+}
+
+src_configure() {
+ use elibc_musl && append-cppflags -D_XOPEN_SOURCE_EXTENDED
+ econf \
+ --exec-prefix="${EPREFIX}" \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ $(use_with ncurses) \
+ $(use_enable nls) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode watch8bit)
+}
+
+src_install() {
+ default
+# dodoc sysctl.conf
+
+ # The configure script is completely whacked in the head
+ mv "${ED}"/lib* "${ED}"/usr/ || die
+ gen_usr_ldscript -a procps
+ prune_libtool_files
+}
diff --git a/sys-process/psmisc/Manifest b/sys-process/psmisc/Manifest
new file mode 100644
index 00000000..6c03e801
--- /dev/null
+++ b/sys-process/psmisc/Manifest
@@ -0,0 +1,4 @@
+AUX psmisc-22.21-add-limits_h.patch 355 SHA256 363ba4dcc2627d7db260f29a97888fe8b58315fa5317bf3506e685c9fc30e46e SHA512 a26cd96decdbcb7ed8822a5cee74254b428a0ff8b76c972b08be80a345f29bfb915ccd7b3816d1ca0c559ddc7b1a945f49091142abef74e508d57ba487b39c49 WHIRLPOOL 3fc7e0172f709158a19e7f6679d1918f8abd4a085be99537634beff5075eb7527cf9dbf20ed960047b7506ce7800808560245cb76ae87cda27b01d70d0aa14bd
+DIST psmisc-22.21.tar.gz 457702 SHA256 97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a SHA512 766aeb45687090b88b17176c5117a603e83fe92a13c013aea72c8ee80048adf02e18c7daa52ddfb8b2135f7c9a1bcae38896cdfb8d0158728d85a446c5e0d5ae WHIRLPOOL cbd4af3e54ce01f43558184b57a24e44dfb6e05d8438bd11e2308ee62535bb93dc417b08e66603966cc5912d7fa88c29df1529995a42e2a8b7c3da663b01681f
+EBUILD psmisc-22.21-r99.ebuild 1343 SHA256 82d077e6930d8d2eff5bb2ef780c46b87cb7c47cc903aa793a1e8f5893fc33ee SHA512 2dc58ef39345a28438df9b76656daa9a2d53168362b115f97861863b9cf078174d5c747a3d421bf81a6345a1e54c719a21a47e1eb0d65419038e588c79702869 WHIRLPOOL 4ee6d1c533ca54b4582a10b7e5937fb08306c209d8df729a71b4d71dccca359fdbfc155861660bc1fe02179181336a91d652be599e957a5882c3afe2acf1b684
+MISC metadata.xml 164 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 SHA512 8eb0d5153d388f6ea069c64b93882244816a0a09aecc0d73cb872121ce0eb24c5ccafa96aad0b620b2300f319e1af101fa7fa6c5d0d561719d49bb07da0a2eca WHIRLPOOL 11a1441bddb7a6c69653c663902b7da5767ae6ad515ac2aabfc42fe37927a1ccc21472deeee454009ff720201a41c3e4a912df42661a0a87150fb46126da2d52
diff --git a/sys-process/psmisc/files/psmisc-22.21-add-limits_h.patch b/sys-process/psmisc/files/psmisc-22.21-add-limits_h.patch
new file mode 100644
index 00000000..6ebb34a6
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-22.21-add-limits_h.patch
@@ -0,0 +1,11 @@
+diff -Naur psmisc-22.21.orig/src/pstree.c psmisc-22.21/src/pstree.c
+--- psmisc-22.21.orig/src/pstree.c 2013-09-29 05:11:56.000000000 +0000
++++ psmisc-22.21/src/pstree.c 2014-03-26 13:30:36.000000000 +0000
+@@ -41,6 +41,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
++#include <limits.h>
+
+ #include "i18n.h"
+ #include "comm.h"
diff --git a/sys-process/psmisc/metadata.xml b/sys-process/psmisc/metadata.xml
new file mode 100644
index 00000000..96a2d586
--- /dev/null
+++ b/sys-process/psmisc/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-process/psmisc/psmisc-22.21-r99.ebuild b/sys-process/psmisc/psmisc-22.21-r99.ebuild
new file mode 100644
index 00000000..f2b097d0
--- /dev/null
+++ b/sys-process/psmisc/psmisc-22.21-r99.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/psmisc-22.21.ebuild,v 1.2 2014/01/18 03:51:41 vapier Exp $
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="A set of tools that use the proc filesystem"
+HOMEPAGE="http://psmisc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ipv6 nls selinux X"
+
+RDEPEND=">=sys-libs/ncurses-5.7-r7
+ nls? ( virtual/libintl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ >=sys-devel/libtool-2.2.6b
+ nls? ( sys-devel/gettext )"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-add-limits_h.patch
+}
+
+src_configure() {
+ econf \
+ $(use_enable selinux) \
+ --disable-harden-flags \
+ $(use_enable ipv6) \
+ $(use_enable nls)
+}
+
+src_compile() {
+ # peekfd is a fragile crap hack #330631
+ nonfatal emake -C src peekfd || touch src/peekfd{.o,}
+ emake
+}
+
+src_install() {
+ default
+
+ use X || rm -f "${ED}"/usr/bin/pstree.x11
+
+ [[ -s ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/bin/peekfd
+ [[ -e ${ED}/usr/bin/peekfd ]] || rm -f "${ED}"/usr/share/man/man1/peekfd.1
+
+ # fuser is needed by init.d scripts; use * wildcard for #458250
+ dodir /bin
+ mv "${ED}"/usr/bin/*fuser "${ED}"/bin || die
+}
diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
new file mode 100644
index 00000000..8c12ef50
--- /dev/null
+++ b/www-client/firefox/Manifest
@@ -0,0 +1,100 @@
+AUX 1130164.patch 2765 SHA256 6ed6bd33b63b8b80beae8142aa0eed4d18f5eb2a699ed48e9aa739fb2ab49fb5 SHA512 a969bfac688f0f4dd7c1c72b97c6d1a3d363a20dfc2e1338e3fd3600f103dcd2b3e7078a77f64900d0167e1fdfafa7a60726862a1136aa772994a673ece2dafc WHIRLPOOL 3b9d9f9bada166d68e304c38ce6875fbed745f2696eacd6c4830169e8877ecb61f61eea0719482011fe6bda805b2b5b1267c11390b8fa23642fcdcc9d6bd2574
+AUX 1130175.patch 1039 SHA256 f43fe97b2e1db668f35f41b6044c5373ad6d3893028424da10f2f99c9035fcd4 SHA512 8a6a7a987be895e43d7be1dbeb5eabbc79184ecb06ef8cf289ec35db46da99a6dae9d1d7849559dac1c623e6b6e503125bd699afffc73beea06812e2fa8d50a6 WHIRLPOOL 22dc999a2743efb588bdda98c23f15d27b448a12606afdc58220e2f88740325ba76a0859e54aa432f1eaafb196e0caf12742082c5a9559b2015a47b8d9408f4a
+AUX 1130710.patch 2185 SHA256 8bae2d411b9ff6a1e9320a7c808ec72cf6f28618447473b34262c9ccdc83d14b SHA512 987dffe07267d05551679e6ac3f630b38864b2de6274659cd3a3e175e631ee7594774f8b6276d71d99907be9e399c8b3a0d99335aab700731c9df02245907440 WHIRLPOOL eecaf0c05ac341dd3d84072820166c3e4f6178e61b92931f8a22d3762e6492e789639f269ee7b40239da51fcd7bc1e4007dfd9a5ef5bc63055077cbffd44d7c6
+AUX basename.patch 948 SHA256 7cc6469b3096434cc0abcc7bfcd8294deb2fc2174726e686e6d859c1b2441a93 SHA512 14ddc44dfcb03e81ea359c177e6ab024f761ef17e2352feb9af58986d1477adfa8edf9a87bcdb2d6318fbf7f01561ec0cbd2e14946b2d0e4738282e63f232f17 WHIRLPOOL 147ae63e9b1c7fa1a3a041cca5a6875529a9abddcf960977e09f75d1a080fd712324f1f7002126473cba24c4b225674aa4e2c229238644ade96d10da3f751438
+AUX crashreporter.patch 15047 SHA256 ed3d26ebeafaca27f3afd3dc88f5c30292f385c26f75a7d5abfb04b20ba03316 SHA512 fcc45e3173ccab57552f7fb331e8d80d41fe87213b3b8b0249ad5959bb2fe74d5dadbcf68e74b7c7f614d166bec4faf034292ceb636fd5910e0c998f6519ba7a WHIRLPOOL 314027851c0a1a3112c42ceb743e55a6334b787a19dc61e6e95d79711833b1eb919d3cf0c67a7eee9ff1995961953e5be2010ca1ef7c49de03854a597dcfb914
+AUX firefox-35.0-gmp-clearkey-sprintf.patch 331 SHA256 b4c206440dbe298c03a8b5c83c860a918dda6292a882c17e15656aa3b28ceade SHA512 1ad8cbf34a10b478687280f5378fd628a7cc82a2bdd8ea1917f6995fe60770415bb3dac190aeb8927ca94d98cf6d1775e3f23d175997d01c868419068a8326cf WHIRLPOOL b8f4af5a9fb8e5926173826340d84a7b648cd91cbb50b7e577fd4c3d3ac1008d03a93a46809de61ed3e8a35d7aaf34eac705d928e8800005fe0ca1fc5071250e
+AUX fts.patch 16727 SHA256 031f0b4fa991482ceee084ccc0032a2379ebb40df5a84347f7db955167159514 SHA512 bb1c9925c71fc1b11df35423fadd4cd0ec2acef31f1d7f55b093382a20fca006709375ea3c38b2dbd64a4d8d902bfc17379b601bc1d49874f6d979c52f82f38e WHIRLPOOL fa0fb88793980a6cec36fe52dc720e89ecd5bf724bc426415489575b3bd2e4bfbe32bd38221415eecab34de83139ebb5ccf21b873b79c234556bc9efe6aa0e6c
+AUX gentoo-default-prefs.js-1 821 SHA256 16259ec24a231d1d60097c8d892caa80d2703ba5be72304f6da55cfce1b329de SHA512 b63542c51edfe0158ce487b317ea6d36ffc17cf8457534adb6aa3f613d9a027f4285c9dcf76eb1b96de6bbc10ba09948fa6c081e00cfb25ca47450cbc32923f2 WHIRLPOOL 770d4b15f1b142ee1f59ce47f7b6d9e4bf4adb20a8a9fc104ea7d6c2481edb0d685c2e672008dbd869d92e8b24ea6ad8efdb4180421ff19ae88d0a9f6f752121
+AUX icon/firefox.desktop 276 SHA256 06565ade11b6e4b448cf10339696c43f31e73cb6824491094bb6e0ab902c7cf5 SHA512 3ab9aa94d3006518fb154c887e9be99fd372a75ac128b8d37debe5d72f26fb7103dd36f75bb6111750e93d520b730a29a8118805fe84be8f3021e4528c0ec47e WHIRLPOOL 9722c40c167bb1a76e7a81e3b1aedbb3cd10a09e00361fe1678883feff33e1d9ce31379f150a757d8b2667715175c2bbc16a714164d02210b4284ee91a25f8f5
+AUX libstagefright-cdefs.patch 817 SHA256 00599213b8ec39f708de9068f66054942f6b9093b1d002a7661ac07d3476f335 SHA512 222c725f92c835f53397d2588333e52733d038f47b9b6bf17f42185c9ea70f4d8c5aa1d4c646451c0e2a5341c4bbbdd977c667b1d10fb41e90f0849a622344f4 WHIRLPOOL 3cc199d68787d9f18fbd40955d2b391f6d90b8af2d6b9a7f9381219bf3a0144346748512b2e94e95b8b3e7dd3261e106881e85567f4cd7050fe4d527c329ea6e
+AUX profiler-gettid.patch 1523 SHA256 9b03a9f2b5919b15756977e56cebe2fee9e50ad38464db9bf7b1889bdeb9617d SHA512 e54df99dff89660b4ed64773e53c23f54b637428362ea2564e952bee336c43fae85978f497a184472c8e99a90b39254c35e4cdf74be54336e0fa70ea2c0ac6bd WHIRLPOOL d26aa12fd7496b13da5644ab20a748dfce8df920ff734323cac984ba80939ee5f1d460bf5e1c22d8c3d2413b22b6c6ebd7ab95dfbc16bbba0be15a5dfe0e076c
+AUX sandbox-cdefs.patch 942 SHA256 5b8ee760a84931ce86224269c035a3151ad30ca74cad76de5de8ee1138df0176 SHA512 27c913ec913f4d7afd22997116fc91a80a728ce3fbf3bda9d9672ab03a89bfd93054c94e828327f81761bf4a0e774f2f5f04d0b600b13df014a2bad207d2164b WHIRLPOOL 86008d7b174f7bad7597e6b68b6d39cdaa9b2c2ad54e688639ca54f3a5ee6800da57b18c33c0bed4181efd5aed0e75d36028b0ec91ec4cee875a71f6f47d7590
+AUX sctp-36.patch 1950 SHA256 cdea1af1af9722894b06d8fce1e8f39502d3f44bedfea95b1121be610c56e4f2 SHA512 ac9f47ec1fcaaacc63022d472fc19b3f17bb2f5dc50baeddddb2f66e73b82428c5764c32b34dd33a5c222f364648d0fd350f8c2f9587ef586bfc2ef6e4ee57b7 WHIRLPOOL 705f2060b11594d24e99ac8555d6e5824ec77c46191e15367bd926f34bbc17afa9c61fd7611adecbd98afbdcec3c2e7ee351a4def59bc563a600369400a5edb5
+AUX sctp.patch 2192 SHA256 642669b144bcc95d8fb757fd2fc10b922abca0850612f4a36fc4c327fbb2feb5 SHA512 45f9caab77334b58b21b33379dfc140bdc90698a23c47180a7e5c4c19ab87b59438c6bd278f012e6a279e6e016b478eb5ff51eb612c123891090cc0a1a150cae WHIRLPOOL e4078e1818cb4403954750ad3d72a8e5bb1d2ef8a015dbd6aa23f324c85aeae6817b427013c7c059be34a5717dfaaf9ca7b2e36e1ffd283f15e90728313b1106
+AUX sipcc.patch 3771 SHA256 b8bc05f35317d2d36aa68e6f4eaba722b10b9d7152e5d538d09580b477b239aa SHA512 962a22ceaa57e2fb73201ed0934723a157a13728dff9a72eb702dc1111c0e831ff4d38051c1cda16f7cfb18b1f202d61a7c7a5a363ae908628d6809c295b4a54 WHIRLPOOL 350f8ed18231bd13f71d8a76d99fe088b15f2af8160c67534a2190ccdd37854f0c15c9f0a3d954287417b8a3e52cc5080dbafa5eedc9adbaf98b5bf682fb6703
+AUX updater.patch 1257 SHA256 79ab76551b41e2313f65fd9b951bdb636581e67e1890828c26f157bc22153646 SHA512 911009d23aaf3a512d46fa20cb563b40b21980e75316440d95e5d52353bea57dffaf7c0e7699efbd809e9cf7a80cb7a11b9f30b6daab1865757aa335f96a77bd WHIRLPOOL 0a0dba9832a40a304b5e4f25f7d56f1f9a0cae030a1981beb8258d44a685e403077c39669464458673f59ea86ca455dedd83abbb97bd1fc0917aa3c8f0ad9eaa
+AUX xpcom-blocksize.patch 1023 SHA256 495c2313d1d298700514ea9f820d85d56e49c1b2338f13a30a399dbc3b138a83 SHA512 5c8bdf1b65f26b24bf7a105426b9824ee74ab77bd53ad6a911cddbcc4ef83b9eb1af101800364199c5b6dd8296920be827e00ce397ce92cd4b38b78a41afeafc WHIRLPOOL a7a26425bbd15fd3c1806d020ad9373a331fd7473b593afd6464925b6e24705f443b008fc791c1334b1ed5ec4beaa1d1516b2796920b51caf1d3a23fe2be17fb
+DIST firefox-36.0-patches-01.tar.xz 4420 SHA256 9ebde39a67c05b3bd1053f16cc6ef9a9795940871da39456685cff0093c72812 SHA512 e5edc318acd367ae71bbeac554a01276be09301c052ed8054ce420f8026e11501cb853a81f05ce48df3642d5cec4e56c70502cf07c45fc514662f24177714ba1 WHIRLPOOL 7f2cda02552f9cbb4aeedcc8928ee2c624133d220fda86d3e526c97ada7d1def6ca3393c6368a70c5892b188bb3b47589c3365a66adf697464277438644d0cc9
+DIST firefox-37.0.1-af.xpi 476563 SHA256 04b3a632806568b098d4b76cf12a11759caf4dddce9c1769aa59efe05328f2c9 SHA512 72a2de750c897076cfa4e96393ca22bf91ad28eaa61f9a8b9ebc7e76b32c4662bbdc3ca4942ad928309b0575bdee32c3a2eb2b4364807f01b317d37e69800a72 WHIRLPOOL 436802637df11a83de400a7e0fdde7e61f213dd72153dcb008aa6f1d116b4e9a87280b3f3e4a6c77ae7599aabb519145fb6c777f1f813250e05cb54bfe01ea11
+DIST firefox-37.0.1-ar.xpi 508942 SHA256 2058ebc47e7bdc36cf0e1d629f52fc5e69bd77ed59be281391ff719ea6b6f7bc SHA512 38f55b70d445368d9cb664f38c706c3d3a269fd9cd074bca2973b8430e273c3d3b49aeebf3cd3ecda9f57a21b3d66aba2e9df68623a09474cfe3e2f67587b449 WHIRLPOOL 202d0a09267d6f32b3257034e7f707c92a7ca23ea53871379a5dd88689a2e39c0f4ff08999f0b91420b4f5e045f639092fb7a0bdf5738e751f197e3946d67f28
+DIST firefox-37.0.1-as.xpi 499986 SHA256 a8aa165f3ae90e34199c250ab0671d3e953e7f4b7104c6658bacd22fd9f1b453 SHA512 2d7c8a583ac6e4f80490a9d7424d73296e7a3b2ad75649a56ff6b97fbb3992a1e2e9c1c1397ac7b85388b614d91985edf538cedf327b7ec0653f467859e7cf43 WHIRLPOOL 0efdd8578a4c3737ea12b52e4dc3c88ae2128d4534002d7ac12fe767529005d44f67dd71e345c1d3cd93010ea919c623cda4fac6ffd4433f6bdb632255e97d09
+DIST firefox-37.0.1-ast.xpi 384090 SHA256 d5c892286bdde5357bf10154b7db1dac0b7d4ffc37eb8ccea0eb3991ab6c6257 SHA512 a2ca16a9a9f97b848b7b96dd12a7248a6a35a95e6711c5ac4a70de27d3459fa5285f04598815ed22d84f803c9791303471d80978f2545e32c4985c35a4dcda6e WHIRLPOOL 620360de5d8e4a0b324fcb118970f0cd6a9c195e7d465d042942ad825f544917958de4f6dff357dd9763ff9ddadea94f21b8e955b1f8ebcaecba9e3bd1af5d60
+DIST firefox-37.0.1-be.xpi 431983 SHA256 05bcdba7490d80e96843c591319b40966a226321bfac9b270577f24c9848d8b3 SHA512 af902a034c9fb856e112f23ec3d631dd9db6e01551b4c26790efe54f00e58fa2bd680460a69a83d7ff773acca919152f944987f2a8ef63dc6a6a7892a7c52b09 WHIRLPOOL 3a83d250fa70067559fa07604f6e787bbd1cfa8b2678921b3f0ea34e2006f58017ac1c5ec431e08d14e23d561b115c02671ec1f24bb42992676bdf5dd4610dd4
+DIST firefox-37.0.1-bg.xpi 486715 SHA256 14ab7abe9e2b50fd96fc13abba308ae861d157f5d8fdfcc2de306c6595886b45 SHA512 588b6b9f2aff7dd26c9ab2588f5ed6c0fa5324a86904c385ecd0c504c0d52dcf2bbda6dc2c6bc22697432616a133b03116f9838ef18028a46ed816c7043dbd26 WHIRLPOOL b6263b640f24021679aeb5223fde7ce14c22f989c2b890e5b930f5cdca92104bbe83fd14047ee713177dd14fca877cd986819310afaad168f3501cfc3d15fe68
+DIST firefox-37.0.1-bn-BD.xpi 520238 SHA256 2dcf33f611b0d6609afe1a7534175044fed0b67dd2010164b04745f626a4adde SHA512 142676edf211f47a9a5c1660f070d06de99a29bd12f17457dfba5aa6433eb53aeb6c3168a35a00d98de4e36a7b9d2c8e67904bc7beddd617a39790637d9a6f2e WHIRLPOOL 6fff016a210c0d488f0c6bb6d2602f89c6c156fb664867f73eafe1662f80e4b37812e507084b48e12345137e9861e5a7816bf59ffe66eb83fdfb63794e0247b6
+DIST firefox-37.0.1-bn-IN.xpi 519973 SHA256 11cf7460453f12f6639222b725a825043a1ba06f93ff43560d59cce5b00c85f8 SHA512 edb822aac8ce1b4b48cc76a71a0ff0d2db94b244d18ca77980a721ec061ba33a3005ddb9d9f0e8ed6b3f66de7ff3bc845e1efdce19b24297d32e3bf4da831964 WHIRLPOOL ddec27d88e55e71787c308807ea5ffcbec85b34da1588716633185fb5a4315073cb4e7ccf6b02ca065a56b19e3464bb3f633328670cb92caaa77504df2053098
+DIST firefox-37.0.1-br.xpi 435127 SHA256 50ebb43386c08a78dcf2b76d7d55330d659c2623035779676b24212161ff7c62 SHA512 00697b71163a1d58d14c40bd9dc909021ca3df5e5a6b753b366ad8877f5165c1f2b356a4719328018b4fbcbaaa20dc2b6a0e3368baf7dfe8090a40878fc561ed WHIRLPOOL 1abfdd30e941557505b0a4a6ce086204b051ada4e286085490e85dc86d13c6a8c19f9229b3dbf968e807a9b74880b3b3e6f4925f9db5d3081a2008b6bf6ce711
+DIST firefox-37.0.1-bs.xpi 476982 SHA256 5c896421424a848d70a0ffeacfe22f807f2ef239c808be91a0dc759995ba605d SHA512 4c1f5bfaa9342702dfd3f676d264807e5e455d53fbe609b5c3914da3328d6224963c6b255a5cf3bc9e22766614f30e74ec4da7beee72eb99d06cdf96b36b77ed WHIRLPOOL b040fb3c807bdf1e054e759e38fd5b9549a650b693dec811b706d80af733a79efc09f86906c6d04419fdb94c71dc69aa0ea82650433a673a5c763c28caf11001
+DIST firefox-37.0.1-ca.xpi 450919 SHA256 d8ff98feba0e7dcbf31b836a47ca695e4b6902dd2583ec5024df1753d32e4928 SHA512 4f0d903d3913219695860bfbcc353bef401e0550057586ca760fa7cf2b2756081e4ac9b991c3212d7c0b06f7f785f11ac660be2da1aafe1fbc3996f0ecbe6360 WHIRLPOOL c0cc3e3dff3ae8e5e6eb79dbf4619e3dddd81aa0200fe5dc8746c183ced493ae4d65c41cc3a82934bff0ce0f0bbe014e910225c8e8b421dca9d85181f0518559
+DIST firefox-37.0.1-cs.xpi 439373 SHA256 0476e95fcf12c1991a24f303445bd9fde687612e376e4ae6ee61c88c4bcb1e54 SHA512 7087018d1268c9167aedbbf4dbe85baa9377a1ed86fe151dc96cf76afcc0a7412a7626c50d3000962471ba3da7db494b7c54fe3e7dfb09db8fca5c02022e1851 WHIRLPOOL 0869331faad5c27d805d24c50d4ea5cba6c95fe1603b5ebaae241bf7658ab921fb84da55595a0301ca627928da1ed3d975bc0ce386a003d511fd9984599f5c9f
+DIST firefox-37.0.1-cy.xpi 437312 SHA256 4852c9801d376309eca2abb6e32022f406f4a10acc93c05bffd8dda3786ffcca SHA512 9864822e6c47aed8051c881d8f8ca68af7d4f04a191b4a4331d9a03bc2d6045ed63b0863eb82a7bd706f1028b8ad38d5ee1481572ae4fb378c9d30445e506f5d WHIRLPOOL 1531b3887233cc60f661ae054b8400f6f8877696407f340aa3b583b91e07b7b05fde9882d04862cf066983935ce8db55ca0b639c74d14c8c9909c9ffac67d87f
+DIST firefox-37.0.1-da.xpi 443934 SHA256 7d0f8636ebea342f3d9cf4bc89f7389219d915c84b5778cc89bdeca0ac1d4150 SHA512 67c3501399ffba768aa3ca2262e544aae6f17a0d6ac6448583b58e347b175039dd9570d067b953680004077534b31c7afd07effcb372e24615b016cb86965f83 WHIRLPOOL 42dd68a37591fe2241fd22b3cc7b2206a2bb0a52f1220bed9bbe6dcb251140ce103469cf3b6784301bc191c47fab79aa3f7fc83847969a7381d19b175db6ea3b
+DIST firefox-37.0.1-de.xpi 444260 SHA256 48506f5cedbf4242f74d03b41762690e84c877b3d5f10396efa17b048733ff96 SHA512 e7f3cac5119c9613769c0649a6e78cff28192bb042317e5adb6349776b661a5eaa2c49774593f2f79cc483440eee50c0f277492e29a2a4c008a45cc5a562efe6 WHIRLPOOL 32004a3d87e0a4706717ef6e558b86da687acd71fc25858823ff082eee00686bfa1e91919768a51348d4df20e196901e8ee601287cd6b6413520163143394818
+DIST firefox-37.0.1-el.xpi 490092 SHA256 1a598cd6ca17033270d777318455ee7e0eec7a964af5c07b3ffb36959c8adb4b SHA512 237b8c2c038e98e323acdf314b6e6e56f6d9538345856fee2d24b8f84484811ee7ef2f369331ecb3ea8ab8c123ece5a7acab4aad062587f943f490b04363ee5b WHIRLPOOL 94c6c2e20ac34f6896d239cba11736d16b5e87f28de60d8d59d585ee5a635da2ba7c1c991bea0f1b95d9840659ff6fd2586ab9fad7b994012d731228676a34dc
+DIST firefox-37.0.1-en-GB.xpi 431299 SHA256 e61862b6adcfd46f521c5921c2bb18d9466ffe4e6132b9cd32c3395c7f078ba2 SHA512 754c91f80f8cd8f99e0d63752713028605724418b13db6c5504323a7f7c02538e2f1ff5d3082a427e8120562a05d515c62e9a97059c5ab078eaccc82bb7fbc11 WHIRLPOOL c3984d5bf388bcff0aa9fdd0f8da7a72d575adf0bc8b726035e4da82bd10ee0140bc758d3f4da27e2af6ea3c8f1c42e97da017f07733414a002970e02bea2669
+DIST firefox-37.0.1-en-ZA.xpi 431152 SHA256 ee953283a4446f8df0735b9f010049872e6623e358f6bed88ee04b30151cfc07 SHA512 d1843fca4d0bf93c6309d21d777907f253795396964edb5e1de6c8f9bab50f78ae825305bd79345bd636f2c9b81a4eac48be38894ceb8240b7631684982d0eb6 WHIRLPOOL 093e272e9900428724b7b0e63533b7103419369d5549a1be14646e5c0e11f824e7380263eec14dbfbf2e1e9bbcca3b63c309635569ed01b5e64717448ddba2bf
+DIST firefox-37.0.1-eo.xpi 478448 SHA256 d4ed45cc54fa7880c6f3086a1c260e26699524a39c1f1a70881da924e474f8a6 SHA512 d79f7e94f97435699efde0fc133d2c72bd4a33d1e61ea32f123a9bea1303e8c604c69be62a7f2b60fe9b373944e221affe4309b448aaae9573eece14c2e600b0 WHIRLPOOL 3018c7cb5c8535905e249d3e0d2b071a0991e249b00fe93adaa3c31bfee5af887d03dd5539af2e32d0786d7fea496ccbe225595a5c42d7ca7c862bd4eb0795cf
+DIST firefox-37.0.1-es-AR.xpi 447018 SHA256 ec7e303ca31a970eed3ed1fbab465f31ebe0df319a94d8d238ae8eb1b2691762 SHA512 0fc772d7211f30d65c73418d214664269a6c8c556af9c2c16805c91ea77582d963b2c93bfb0f84e7894f86c058c2478082d8367e0e2cdfccc1170756cd9992a4 WHIRLPOOL d67db6831377068190218d53f82758f76b4049c08a78f900d299cd333338edda30db32ddeffd8f8de19db5eb34a5e107dc5ed8014ae4b3739794a33eaada03d9
+DIST firefox-37.0.1-es-CL.xpi 380181 SHA256 11bbd990e9d12ded0ae76a1d4c116e1280e146503609a295cd0a7b430abf6639 SHA512 e875086a0d9b19234ac800809086a9ecc59aff9a332fa79b46243e708466b06026a5128021ac559e7b29a056f92324750c68d8da059945eef5fcf418a57f46c4 WHIRLPOOL c4c182dc52e6c177894fab52f6669ca31dddeab6212e09ab8004f72c4b561d857a4033ede8f8a461a9a7b6f3cb7fd7911a620f0624577e3a8ec5fe6248e16440
+DIST firefox-37.0.1-es-ES.xpi 369782 SHA256 95b81c06bde0ba38e74b5a2379b12c2de1e822044e1560d78c274514352fb159 SHA512 003f291b69e3b63a7d251e96519d64d19948fbac0a851faf8caaae85cc2b7ebbd1c10b2b8125dbd948d41a263017009b209e8fd680dcb59b337c21a98313a04c WHIRLPOOL 461f8cec9cbd2a7332a2216511dfee5c5acc41578781a6ffdca0ade665c3b42e9df5c00becec8992b7edaace9c34cdbb38e85a7582ebe5dc9d994899d8aa5d11
+DIST firefox-37.0.1-es-MX.xpi 449799 SHA256 451ecdad6cf72b340ce80bd22dd7ba2843ee2a73fa77ffe0250dd458e1990520 SHA512 ef10c668e99f2c3e63de46cac5cb96e42da37d25469e2211d6f5c6d19247394150e24b609b21d7772e4009ea5e4c23dc3373c7186b34b8cdfa632a18fcd0813f WHIRLPOOL 18e50cf91133fa5e1492297b4b8ca4dee7e88376415b79a896f027939bd89c13e6fbd55b0db6f67e3cd126cc426df072e09f523edab0e4f4c4e7ea54d23675da
+DIST firefox-37.0.1-et.xpi 436251 SHA256 5f017bcde67591108985b7f0ab66f9ec44062418f905a7ac9904312369ec5901 SHA512 67b467cc7561da93200d9ca7d6195d6ab8a024723986b68aa280575922639c5d25eede5f88f85be64840c1de7d1dfb48f0b0bb593860059b7d7652935e58b5a6 WHIRLPOOL 7f9bfb65d3037346fa4819a60fb8c80fd3657b9ff004654fef84138dfe3f4f20859381a1c3816b86f74bee7560b45200990f59745d041ffc71a15d7ff69e55f9
+DIST firefox-37.0.1-eu.xpi 459489 SHA256 4d6b37822e0e753eef40231ff9ed47d75886a0d9c4b27f0424726d6aab616941 SHA512 844ea7d863b8778e2118c10f67d82ea61268468e54a280cc486fb5d4d62bc681c502c48a5facdb25744f46eda4e040d9ee1de9b4212419a11a3a9845d7f37d9f WHIRLPOOL 7a655a11d43e7831186ebe8288182bf1ac6b4bc6560cf4cc1553d770704adc9bfb4dfd6bd6c0dc142ac35485054e994e4ba482d03415e1801d7c7e14f1e21c47
+DIST firefox-37.0.1-fa.xpi 505517 SHA256 de6a97f7d93ac5e9f0384dd4bd92a15f64c93309f5ca72d5ef7b2918c63285cd SHA512 f95283a411033b2f9fadb3dec7cec3e4ca28c2417a98d9b3eca9ae640702aa05d0a13877bf053926dc06ca88ddc6e8129841de2cb49f9d0b5708a62b537e9e5f WHIRLPOOL 718d0ce1f90f47a8afc041475bece888189b23d33a4fef5ff60b593acb1d507552e1d50579ec4ebc68e56d1a72142bbb5ccd890c15fe84dc2448929d0db45fa2
+DIST firefox-37.0.1-fi.xpi 438063 SHA256 0abc8206d44ed2b5d4de819d66c59c9aea90b53988915602f3c2d676a9657f3d SHA512 3f600dd224fcc52432beb96fd82641f6b7c745ae39d784d80ea5afada348ea328ca0761b3b0e69d3a8e21c767070deee37c1092a121f7a3394b8d5d720257382 WHIRLPOOL 69bbe43956e1229ddfc634f621810ea85919bbc3739b0c86dd6f7dd01456108de853131029d786b29e8e2bd41f35680e53770ebd08c2fb54c4e0e493604ecf66
+DIST firefox-37.0.1-fr.xpi 453985 SHA256 9aba98a4503f2c74a5f2a935a8f5965dc6e4303e9d6753d0e32bc2cfcd146033 SHA512 f081abe878f11a3c4431dd1ce996acdd4284e4be675d00f182c9d8bf0ec19ae106a7ec34d4b24fbb61deb090029b61ec1780065cb9101a28dd7505165d2c3631 WHIRLPOOL 9efc8ffd1b9c2a41d4cb4a8906719f258b44178f3e05cd50a9061de63f467c97e476094ce3681f86ece1a64a26fe309180ed09ba1f1953fbb50b42ace8a0637d
+DIST firefox-37.0.1-fy-NL.xpi 448481 SHA256 c12a324cb6245ee27fbc0711d99be0bf32c5ee947ec0fcd5302fbabf22329979 SHA512 4137c3868df6fa9c34740835bc29297acba149713fbd091428cd20a168ba79d235217e80beb5a1777d9a763df984b95e0085536e19fd42ca32e91ab25b962fc1 WHIRLPOOL 6dbf9c8b7d990a1228d6980ed4b56751ab50a167947a23f604b197293c14a262f7fa090b898147867908c3cd117e43dbea8670268b419f45360a2572ccfa4e12
+DIST firefox-37.0.1-ga-IE.xpi 458671 SHA256 a884b9ad92da02b98fc157bfb3efe7ff9aed908df7b521928d9a9cc1683e9e2b SHA512 50aa21e67c142e993a0b0c31aea344466744026fb006d3ec8d42165552b099f22b730d536f5fe368233b44f1f7ac59e9d28e8f08f5ca888bc996a4ba49ed7432 WHIRLPOOL 92ce2a503efb7e44fcbdd3d68b7cfc8b0e2f84495f7bf1755fb47bbde511cc3a37619c77c4cf6bc274938b9b4bbeb62856bc943ef8be127da2818dfbf5dc6199
+DIST firefox-37.0.1-gd.xpi 447476 SHA256 a9e69741ae00ffd64c3fc11a17f312ea06e895ef1554be5077620a1e4a9841d9 SHA512 9fe911bac42cd7c5c3562cc7e614fac8a0a54bb485938ba5ee8fc1afa564e8f08a4989f735a535e0a718155195e361cbf2decfcc74009cfb670e0986964e9346 WHIRLPOOL 805a81406754338f0249aa90913e154e191aff352837ea6055f50f68d822549667d3ad624dd62c5160f159171df658e3fcd6f3d184e3271335809f067aa5cabb
+DIST firefox-37.0.1-gl.xpi 439065 SHA256 1ccb97a2b43a10c3819db02c2ca67ca4265b5b96c8068f2dffcc1e4b0d596709 SHA512 2f234e6011be40df650d5fca7a77ff93075ef0dc7336a5410a84b4d540b7fea891b84b64fe6ea34c151c1d872c39d69dcb49b8b21efd39498d5db8ffd2cda9df WHIRLPOOL de6455ffa8320b0710bafa3e30adcf62962627e414791f8ee1776120478b739063285621473c17df8b494de7534b9d8fc1f84a7da31341e9b7e683e6e9709d6b
+DIST firefox-37.0.1-gu-IN.xpi 468930 SHA256 97ae4d0c70e1eec13a8920f8d33a1dddd34bc90294a0d043417c361803ad25fd SHA512 d05640d8b3fb51a70032fedb2f739883aa25a96f561eb9b6075b0c9bda3c70ea8f2934b469e76dc397c4b6f2354abd5df74c38df091d4ed3dda950985dd0c40f WHIRLPOOL b97e7bb59bb6bf6705768c514e527c17c247dc555d41ddd279c795d049c8ca4f3b834cb3867965c37b13739a93d4985ec7649a3f7a16981fd373e4d2be499ccb
+DIST firefox-37.0.1-he.xpi 478219 SHA256 1953371e2ac06d386ccdfdff63cb6cb9dad33c4a4608dee484a97a9bb24b9a9c SHA512 04e9dab7f2730279ff47401bb5f3a48c050beb0903a6e0629795bacade097a8e9b8d6931a27045f380a5d9cf4bbe7cc9daff7fe6f1d571beb104422d4cafd169 WHIRLPOOL 744ead7cdb93873adbd4a36dc3a12d43475288243966ee0c8e48ddfcf2b87a768a9362429b4a2f1b19746d0c44607fcc6e42bafa4d34c625698488422cf50fc6
+DIST firefox-37.0.1-hi-IN.xpi 498979 SHA256 3692c78477e24f89c89cba61e6a5566f6da9c973743d753886e68f605d960a76 SHA512 1659ec9e32cf8bd3941376a8a1f65be6436514773f070743ae6d0c5be91180fadf0b71f75c5d4127c2df9c4cb2ccf88cf28764a409ce011c1248e46480196cea WHIRLPOOL daf92a110892430fc19bfd64deb83cc4a176ae094e144a242497177699d31a8d2f219b2ca606ba1c2068b878a87e40e104864b024e2a5f2284baab343ae73fd0
+DIST firefox-37.0.1-hr.xpi 471180 SHA256 3c6842936de1eb35e7d3c2272872960c322d8613c8900d9b14d120d65ce1cd39 SHA512 f20fd67b7bdad62d7905104bc1a7dbf3f44e8d37dfb41bf8e9769708529a5ed80cbb271597debceed3e1ef8be2de0f41c5c3d7b5b066f5eda36b4c47c1ef1ec8 WHIRLPOOL cb218bba3886a52e25768174cdc358aa840c20a4c4643940986991a803867404b90ea89f5b79f59bf8ac075ad55b53c5a4be75ac66e2bad66615653f33a4a681
+DIST firefox-37.0.1-hu.xpi 446230 SHA256 4e757dcfb5c2a73b66bedb6f177021707eccd355e06175ed8021591b379c2f01 SHA512 79ae01896c3ddeb895857358b44144061d9615173b9c89440decd57ee98ce587809faaf24c5b60ee2e54cfacbd762b40b25a34c02dff96527dd7fa769bacfc2f WHIRLPOOL 7c7e311f21597a76e1a34c027477fd7d24d4f7ce0ff08f77837938c37bbda7294a2d269755a71ee1cae73420ce4c6da3fa62e139a6c53b286bd99671f4922e48
+DIST firefox-37.0.1-hy-AM.xpi 527193 SHA256 d4f87a38fd66b3ea8e16d3700fd16cc5bf1789979aa6d2fd7c22de9a28c036b2 SHA512 bcc07896801bec67cd10d534320ed47c57838e26b5230e8072e8c62958539340d5d58188141d5a2274b55639ca1c109f086e80438b011c5b2573429829d09f4d WHIRLPOOL a8d5c3d80dfdbe16f21e6cf0bc6adbeb9f32210ff2af4c079b49d7f4b6b89b56861c4f1d6425a5d9a2df71c9abc5909aed9579bb697dc4148936c5725d58ee3f
+DIST firefox-37.0.1-id.xpi 424542 SHA256 2b570a4f54d3ca2c2dbe460b4b9d77aa68d3ec4912de2fb1119134dad291ce50 SHA512 9d30d1880f3b6b03a9e56afdeaa44f9e3fcb7baad382a55a0c7cb4d34eb1c5295e0d17807a34601817934e0866a0779ee01dc4eb16771db21cc0d13fa4647fb2 WHIRLPOOL cb4d11b122e138746e7ba1bb4a5f7cec12d4ec022abc6bf912e1f578abce0b91cd2683f0d06145af96df1dd1925161d54f720d93d74ca748f4f052b4c5798a97
+DIST firefox-37.0.1-is.xpi 478140 SHA256 1ab0d5062982534dbc30dc08d73ff778be4c9f9c472efe3536075e8ebe1ad260 SHA512 a03fa54a99a34550e80af3fbdaafee3a39add14fc6e822bdde52f2cdda59a02813927b2afee2e0b7f34932630a7e7f2a8d8eb5b7ca22f7bfee2ecbf9150ab921 WHIRLPOOL 35d038b9b1282ebc84b2f2b83bda19bdc79d3b89a1d44f4c7f817a561f422894ec947667d1780106f87916f555cde28dfcb3ee4f95ad217d1155623eba0b1da8
+DIST firefox-37.0.1-it.xpi 364081 SHA256 79aa70f3d99ac2171857f3e05ad30c9d5e5fff2bf6366c649cbc39a0ecec84c6 SHA512 ba0b643c728171810068e72dfd234a6faff52e0f4ed96f4e02bef37546e5245f59ea8630d7ba3cba1708d75f7fe5bf0c8255c919bf34c9e411855a58cb0e0db9 WHIRLPOOL 6422ccd479d5c6d38e3b604f6183be7cadfe576490996a4fe847c946631800a5e9211a85c545281f40685aecfbb972a3c9a80991c94fa4b8d46ee9a5677af4a9
+DIST firefox-37.0.1-ja.xpi 470683 SHA256 1b9abe098d38adb672483d6b721b27b90e1b99ca921e2c79bfdda47ba7e39ebe SHA512 1e46aa5df5b9dd7c6fdbcb2a985f0aa436b4c5a4ed06aae55a62148f1d7f293e5ed1b51b2c964c6f68d1d5ff0bb0fcc1d7b56b7c581b3ba2bc722dc77035802e WHIRLPOOL ccf4e9a6a6586e032cc837b0ce9fae201b424a9c1953ed973507282159b1d75ccbcd9453526f43254428bc212124937438f5d1a7fced3018369187596727b365
+DIST firefox-37.0.1-kk.xpi 495569 SHA256 1ddc2ade757903b53b4772755bbb43fc2dbcdf591447c336a137007d6235cf6d SHA512 cb76e82db587fd9161612baf4c05b54d1e36e021fb8b71c47b093652300f7b66e10bee16a874611db199626b41026551eda3eb54847413714037188c9b450815 WHIRLPOOL 5207eabe603aac9dae3f669220b71270fede29313e31a89f51d60e0f5dafb669740abd26935a9f576385905d744ff4dacf523210fd60009f30d9fedb8215b3e4
+DIST firefox-37.0.1-km.xpi 558106 SHA256 df0b7c9a26f5ea42230bcec1bd9d0575212cf936a6c64c25e17e816a23f73590 SHA512 07c76370114972db01c764d6afffe822880ca342288302c83fede80347d24d3b53af65fba03b85460b1b34f3733a730215558c8f2f05d699e119e2c45b28dc34 WHIRLPOOL 115fb5348c709249372c0e02742e8e336061031fe0c87232172eab653baba443c1e756a6f618527fcddb3b396f0c5533355dcf9444813cd2523ec5a8030baeed
+DIST firefox-37.0.1-kn.xpi 525619 SHA256 883d13a9b85c3ecc1f9ba1b4d211e22d9d1d473d32f2ebbe84559e801d60f796 SHA512 017b579b1f02a969fd47cc6853afe679e77acab11bafddffe2c43357b61c8cebd5090bdc1ed0e8c6b493f3f35aedb60dceaa6fa4f30787899ecd08fda96ac2cd WHIRLPOOL 3d0d70fbab1d6bc31cb02c1c5cca273bbec0cff79407dc4719a70f963f237eb6baedb4528da2d7865bcf951be26b6c6ce288a3e4a319ea61a29a1163bd8a48a6
+DIST firefox-37.0.1-ko.xpi 453335 SHA256 7fa083f0ad4dd03659fa89520bab2bd5a24fcd9170a4a49368e500604871abb9 SHA512 f569a2ae9b245408b666c894ed228cafb8b77131960192dd58fb131d30a49e60cf28ebcfee9c4772a5bcdb173247630f04cb4b9308ff2858c920b82757e44d96 WHIRLPOOL 82a7e93320e2d096a069f77e2f184cb5a132619a8d37a50d6deb239c3a70d22915f6d24d3869c410c96bfca651643c7b5910e7b18c94281abc98893539d09dd0
+DIST firefox-37.0.1-lt.xpi 478857 SHA256 d7663bdf53ebf01eb7e5003be5139dfd1111ca6758003c1b7aa6554006c08f7c SHA512 92ae320c95cbce2a2359416309b26277eb488ee5852ed9194a9fc0229ff25c3bc58772bbe349e97987de92bcfaee4a12d331ca3accb8c4433b3f355f8315d177 WHIRLPOOL cc8645e985ec8daaeea3bb21e15ba1844ee675628deab39a996fffee87d0500673e8aa5c0579337dceec7606f915f0605c86f3dd862a507cd5b90c911b4a290f
+DIST firefox-37.0.1-lv.xpi 460100 SHA256 83023c6f3a89763d3d1fc7842abea6700f060be2eb2a8e5f7a808e32db1946b8 SHA512 2d569f62bdb65560f7765e8c2495b83acd9a7ea32aa614abfa25029410c6261217e4510ba17b2af6527e1aa1b44cc49c3a40fa09517d6bd0fbe983638f91351e WHIRLPOOL affa709870cc422ebec9341ef0d228613fd34ed476285b13f9ce02e8ea367599cecc94760fe37ab5405affde9079ae69e5091f5d998f79ff57f85db2537675ed
+DIST firefox-37.0.1-mai.xpi 490292 SHA256 82be57136f0199593fd7aa76bce4fc81637e56de3fb494df5aca8c7b7b801392 SHA512 a7f07d9207b4258a62af085884ac1730ef3c5aa8cc3469c553aaed5c5e967a85066bc5cac4e421a5dc49be5ca505807403c704d61dc27e02667ad4d73b783069 WHIRLPOOL 57fd3097e7601dd7a4f4c06af58278c60667dc828514c6598312772929790b7a726bc57a6414687b393a8bab20b90a33955b43f599de27d02ef6cb0aaa56a681
+DIST firefox-37.0.1-mk.xpi 521047 SHA256 cdc4ae7cf20613d9b56ced52fe630043f798c9e7056c9ce74848cc68816efee8 SHA512 36e9613b77b809cd5c57e955a9d26b4307aed0e89991df20fb48a387271516b498aee8cfabc40ba8bc46d9e8e8e215b9c765bba0435276290d08a7889d8efaf0 WHIRLPOOL 16a7847e8e542e38b7c932e5a12f85881a38f854f7b99a24de6629399e9f1d5d3ce6ffdcdfc95f5b806be0633f13e175c6f62bd25d4e88664b687bc01c9c17f3
+DIST firefox-37.0.1-ml.xpi 520103 SHA256 044b5bb25e198dab62e523a52f0abb48b56459453acdfab0e9c3bbe73e5019a3 SHA512 5456b3e1d748ff7065443aa8d45081e368921f78c4bc97b6f8f245fc4d827bb412d7b42234b53980f0a0fdb384eced9bbd3c29e135f777898f2f0d24250745ab WHIRLPOOL a607a48561ddfe241c4f43543b1fc9b8709c52a73f4696858308d9b6b883afea67acc1458f2d500f2b1dc1beaab7cef0814c80ec5de98b51565d7e4b538aebbf
+DIST firefox-37.0.1-mr.xpi 500824 SHA256 a87fc89d5f00b62b5ad6dc5f0185ce15291a664dba1c8fe69e0ae63ebd679d92 SHA512 acc318d91e85da494ec1114f787d22c596149d2cf9aafa3c9a49cea83f7f430d75139446be6ec68a7fe14f349378c5e405be5be9fae0eaed085c2a72ccc8fad6 WHIRLPOOL 8c501341f390eafde3b7e22486ed490ef6901e124d4e36935ba2d72dc818258250b7d492f49f57cfe0b3bd8218e72b8b56f4a34e8a7ac096dd68bfe35a102035
+DIST firefox-37.0.1-nb-NO.xpi 437178 SHA256 568e4ef1969d7b6cdba93f6606f674f85d8739c740f172b8de7d2499dc91e487 SHA512 0eac68052ae9b7fc25f599da2d8418ec5db6a16c202a877dcfc644f9e56b9adde35385e861554928bd0898f6b525dbba8e625a4085a6e6594668fabd3f79590c WHIRLPOOL 9a59b47911c68181235bf79554e14d5d30d317940bc1f261514402c0247aacf61fd79a42cf509c1fe7e2639739d1f91b5f8386b596428eabae2feeb179210304
+DIST firefox-37.0.1-nl.xpi 437048 SHA256 c2919f9db4eedecc820ffc8396636cb259310c920c3ce3ea84f01f0afac75b26 SHA512 bf36a058819a240e6ebc9e0bd7d0e7676c0e47f0b5115aac1026942f7ee3735ded864e35abb22ff2e0baa9724a4fc73dc6d04122ec965ef4f5a5a9bb5748d54b WHIRLPOOL ec3782bd71ecbb6569a8d243e6a53cf0e6190c118e6f85fab4dfc45fbaed48fc3472d083d55b1a0e16958a8f5c64357911ec24732e4c9f1ee128c2d2ac3c2b30
+DIST firefox-37.0.1-nn-NO.xpi 431561 SHA256 280ff0ec69320e22f550ccc556d9a71ce77f7543ea9e3c539df20a3cae2b9f0f SHA512 f4758b9cf8d39f8bc2c3dbea3e4d9435a25db034c2b6538b9871750c882fb01d6ae193f4143e62badf7c57577f5f044c03b8e25d7fe4eb8270f800a6b35ccb3b WHIRLPOOL 39869a47d2f78274ccfd9bb30cde12d89920355d545cbe66360da951b683f7f35ccc17159c94c1f2308ee089e9931846d32d6f5c2e488b546bd866295a579698
+DIST firefox-37.0.1-or.xpi 517635 SHA256 579c32a579a3de8f37cd131ef926b3131e13152fa21536c2a185ffb874aab8b8 SHA512 f9271ef677b793ddd60444cdd5136803655a2b26c40e835a3202092533a05ea5e6af8313b6ce3a82f90d36a7afee8bf81aac4fb3f3c5e88b01ec7298b3c6a41c WHIRLPOOL f56a6b44b872df4d8bd80511fe65f9c10cab4f837552ce695ec05b68f8b03994cae304c9feb5d75be7a5c76a6e5051f745c75271d8700f7e0bf0f8a2824a98db
+DIST firefox-37.0.1-pa-IN.xpi 487555 SHA256 6a51842508f0e165ed2c39e5ae636d142abee34111caa92fafdbee59577d49ac SHA512 535295ae911480c95388ea94ce101e83e8ee560bb8df1cea72ca87687f53101ffa583818ac6feea39fe63b9759a8006619889f262b5734389c458a7bf1dd0ff8 WHIRLPOOL ce4efbb2cb15df2591165576349ba17bdb7887ba0f46559e573046d489fc756c2cf9e8121071ea92c42591bc7fa9c804e15cd1f2d5957f155abc3b77a61e43c4
+DIST firefox-37.0.1-pl.xpi 404495 SHA256 31004bb15ccaee03e00bc7b026ddab255284e2b46a54b5dbb2fbc2b551e8ae85 SHA512 80697ec37c2e27add60bab6e6b0bf90c9de4758ba2bd3ff9e513a521401a2a34f0fab17506f0fa662c2e284ebb6b8f8612946ddae2c45ee41acdec03203844dd WHIRLPOOL 80f618d31b2cd8fe5981ef8473e99c3b3021a0c66462db0a433132ab5d31e34142e61fbd45ce520515cdb816187a368d41fca7b467f9de811347bcb72d4748de
+DIST firefox-37.0.1-pt-BR.xpi 453348 SHA256 d417ce12500918c0135ec39804bc1343e32cb2458bd720e32edd8d36fcc4afa5 SHA512 11d526f80805de43617bf8779e5cd876a3d4672e97ed993c80ba0410ee09206b749386aacffa35f20d43a11fddfafe67403a7b94d44c20963b3080ed605a94cb WHIRLPOOL adb29757b437a721275ccec223d4f968c435b0e01eaa1cd4643886bd24bff7ce67cd1e7fd09f62048d29d090e2bba00c0b02c6f96357017ec78ddba6e54b7a41
+DIST firefox-37.0.1-pt-PT.xpi 433017 SHA256 e03b57f6d9192fa3544712d8646f37bcaf48d4b5a7109c794ee6f4be1cb4a266 SHA512 965b69baedb933ee4768027b22f2b789780462fbe8b8e2463ec0ff70a2d731c825bd3cf5f803a379556b1fa91297382cdc5dd6cffbf3cb6b08b4d90e5d400f37 WHIRLPOOL 2e930a6b79af28a98baa627ca752d49831b5a79230f7a126cc50777e478acdbce1d749642e858424d333cba51c62d884c84140c15666b2f1c45143170700ff18
+DIST firefox-37.0.1-rm.xpi 439790 SHA256 b012b35c5000ccb4cecda5a045259b10b6818709ddf9422ee0ffc2e312666a73 SHA512 88e0122e340c260c7ec9212c3fc92e76eb5cfe711fd854d8ec8ed5bcaeab8ed77d92b547b927b579f4796bb84b4bb331606d2e1b52b776b824781b3de23d4e65 WHIRLPOOL 649e5cc87bf6ad53b271f5467acad895aca7b1e470bd88702863b163b0c934d45aabda5a139c7a31d4cfeeec45f49a23d042a8dd54be7331f23694abda59fbef
+DIST firefox-37.0.1-ro.xpi 487622 SHA256 fbe82794bf70d69448be69e35a8504690eb12b538dded052bfed2739274b63f9 SHA512 bffc7e8f4cc00a3b6779513953c9892184bdc10124d67480a2d0b2b7cf1746516766f8faa43c50d81700fa93468ad9e98f3a70e4d3c9c0d72b62e5fbc4a95106 WHIRLPOOL a8b9dcbcfa6cb1c8f9b54c607ca049a75180d1f975907d55a772afa8f046d65225db1ca454d464da29bcf7bbdb4811dab2da91c7431bb2fa2479f395de2409b6
+DIST firefox-37.0.1-ru.xpi 409378 SHA256 9e1cc4f143068093a4f7ca2c9da72ea6cc338c0f8ef46112b26db5f1a1d7ee75 SHA512 c0bf0fd81abcb42e049f2ae18e9fe52a7faf7dae359fcbbcd4c4c2e0bb9d8995d67f8039b470eb13801f3fd84bb4592f22ec727556888b12d853cee2fd1af6f7 WHIRLPOOL a68f6ec6b4f6e562fa3a89f47f66e4b6a823fd337e6143267ee28996240a0beeeb01f37a640571206d0741880f25eb6ca997e543073aebc38d152e8a63335660
+DIST firefox-37.0.1-si.xpi 520321 SHA256 94ae95f1d6ad97a184771bc814249647bd5f2fbfa31298fa0385632a74d70a54 SHA512 933c5a6eed1178a6cb11cdbc58988472cd74c205f269f2e81a4bb174fc57e70d24896d755c564def038eed8de61ddb4b752c822947cea629472dc6aa978f06f7 WHIRLPOOL c7fbe7526f0d56691c4ca7de52ec8ff8958d18dff06d4a9092556099b63ff2ac71a3c2bd0ae4fe7226af4bef65cdce01e0084b1878c6495ab7fdbc3aaeef075c
+DIST firefox-37.0.1-sk.xpi 462174 SHA256 660d6a2d84fe48818fdf189445772d9674e1a6f5d47fc70d569431874f912c31 SHA512 fde47c994e5d9d72ce9454928c96a6686516da5a12a973253b0770e12150fb2ae759f2d25255805900e5f1c4a5f80a2510f8613bd420df5ab96f6ffecec377ef WHIRLPOOL 253fb3b9ffad1cf13dae5be31512e5c0c4b6434b7536f9653324b65cb762fceab0fb8cff78d5d2bc28465b266bcb8f07288d4f68c8bc8f5a4608101ef0332cbf
+DIST firefox-37.0.1-sl.xpi 434639 SHA256 ff57daa7d02498679783b9ebdc2fdc31c9f2c49a44c734262c8294819f902382 SHA512 6248183c9460a0f3afe1f3dbbff828b8c750bc095ccec89f4ae3847971a0d652b66cfb44e8ddfb4aa188ba5cd9ce930efb24c52a6d188bc92f38bc3f855575a1 WHIRLPOOL 201d0c45f275c04115dbbdaa5f3da0cccab7e5caf7b0bbecb32c1378987f6b9fb3219dc57f585f8f9ddc29b0ebef0fc1e6f766a312cbee27334dd7420fdef2e3
+DIST firefox-37.0.1-son.xpi 442055 SHA256 64038a2e9f0036aabd11bf3c209e618a8249a59a7cb15261cb835485a43d6f0d SHA512 7446e1626f4aacd44023c47d6c82dbf204ca98bd10e4a661c4bbbf8c0779d7293ad339e9e9bf3824361442ae340c7d06bfd5b04e7375df8c52504e682b9541f2 WHIRLPOOL 0f03dc72cb12ab83adfaa039ff2bdb77a162840542f4520d5568f627c4e467fa931edc8fbc0b7feed4f739a860cc4aebd1ce823ee357dd388fd802d80bd89aa6
+DIST firefox-37.0.1-sq.xpi 478875 SHA256 2a2fc10dae6af510e7e034f1b0e4fe53d3ffa19411c14f899a3d68c7cac6a2f1 SHA512 041d4515def00b299cc316ac648b8994ccb1585a78e0ec37867a2d7a3ed3490d46ab3c7a45c05106770442ea6752d06fbc3a0c379438b10b4c8710b397d1dc69 WHIRLPOOL 12b18170e442f92854cd10c507843d5c877d49d45f6d3915404350548940f8f3a783e5eb21f02b90875264e31c5094b38693e9ae210f5062ba52e873ff195e6a
+DIST firefox-37.0.1-sr.xpi 472192 SHA256 da2961dd54eae4016d0062787202013342d0b5dff7503227044cda09340cbba7 SHA512 0b83abb28d4dfa189efa10c9c47857268e33f841d67ab1ae919833be9006c299e6c449bb94bccf200ee286306bdf7f702a25b4de49a1f590c78485ea1f889379 WHIRLPOOL 35a6f0661a44734b515bf4c5b90437df8acd8b3312943cd990de80239e7ca1906f4736395d95a4b80141576b8b4ae673a7d38536304282616c3a8894bdaa21b2
+DIST firefox-37.0.1-sv-SE.xpi 445515 SHA256 4e65aff0357b79084bb9aa4789f06383457a05954fd813edbba8dfb130ffa995 SHA512 3e2226c5a37cea402f1addb940e616e7b713d1f3a5aaa59732d4a48d1320dd4aeed1320a1d24d9b04bbe5cad98f12b19c545d997c923cb41c49ae7822a915cb8 WHIRLPOOL d01e5c32aeea10a057477897bffa69c8e18a165ea94933af233304f7dc2358fd4ec24213c8c23b43765ccba020464d3cc6b5e48aea0cba28360626e2ad5a49bb
+DIST firefox-37.0.1-ta.xpi 499307 SHA256 fc6906571934991fdb829b5cfbca338d34be14a659372e0376fb06f3e48d66bf SHA512 ba5474f664d1022edc6cd124ce59ec33c0a489c6c474e6d0e1918267692e33daf5092868f2abe8c59e32bf56e2917673d9a80d420e5660d61ef227232ccad8c4 WHIRLPOOL e5d603c84adaaa808e1c551c780f1f2bf1bba88691d2b6bffaf5c5418056766c94e890a841481bd890e89024afa590f9a7ba54a3f30df39c991e801e96da9d86
+DIST firefox-37.0.1-te.xpi 517656 SHA256 5cfb5625b75a913f5b790f8172ba3e014875dceeb5cce95f97c1f011e0b6b798 SHA512 d80a40ecb895e8d1294baf0ef99a65f5f58e7784a1b2c94e8d6014d5c2e3200ee88ebfe4f654a9910605528d6528ce2f6be5fb24cc0069cf69135040df07e01f WHIRLPOOL c0dcd955d33aaa115c19ab23ac40051ea5a7c85d4d41b34a0f4e1aa92c9f9f2bd0fc2979a08d55a61b7bcb09c8f7da6e4976dce7a7bffd46b4b7e839fa9f6448
+DIST firefox-37.0.1-th.xpi 527248 SHA256 9b8046a309ec85a1bbca75d282625c45d5907fb1ff15798f7f74037467a0f769 SHA512 e76c04f8368552903bdd9373c12723a6992d7cc2e7dcdbeedc20100724d1e1fac61453c7fdea297fc11a68d859f11e7c4f226fae65358d439f1f9173d7248716 WHIRLPOOL d196ce8db545072eef7ec5a65b56ee4e87e1cb9528b550d41db06eab4a76c171af826f0e98e592f2b63265c5fe3b4d655b759932056f37f96b867b416567665b
+DIST firefox-37.0.1-tr.xpi 473884 SHA256 a5bae41b3fed52037bfe60d9dce8388e9fb4e83ec40abd00ab63706effd1e400 SHA512 504f0c6b15a328e4a054e75d1a31830fca80bed18e88e0e0b56e4f82a322ee94167ce00afb9d5d8c021a12012e0c5473885ae59d58a3972d8b842e0eaa4c71bd WHIRLPOOL f25380449f2eb5cb0c8ec883591e1698a4d3336fbad7c29c491361c2679a4f8578640ec6bfe5f1e8a735d35280f8e59150237f1dd7d52fe02573b9963a330ff8
+DIST firefox-37.0.1-uk.xpi 482542 SHA256 7232836bd748076c1dc7f152acb131488620fb45e2751a78bfa5a5c5e8c18e51 SHA512 fb7dfa108d80e4d432114bf96872e6dbd3640b636e0f9b3bb13f450b09925b2017838ea9e6b7abc5cf41e942b998be5e31fd610ebac771630f61291dec3466e5 WHIRLPOOL e8a361db8b7b4f57248a5bf3c75f3f34b6c7c47d266df7c6e888d75b3117d4c801af60338ec0b20e4794834fbeef642120886358d912b25ba559404fcac58129
+DIST firefox-37.0.1-vi.xpi 459109 SHA256 4a14e11028cec54b574e761722384b32c567faaf24eff8b2b4b527538c817d26 SHA512 71b86c726530ea8643d3200a4f113f76bb8899bc8b99cf9373b5552440419133c63125e84907cdcc4e5e4cd0b1f008191ca15799baf696fbdb0709c12f51f16b WHIRLPOOL 403e82ac619a4dd212760914aa0b0ceffc860e7fcf84165b54551970e759d6b94549049bdf6e140c99ae766202024586b5da0f80bac8317f33529240a468380d
+DIST firefox-37.0.1-xh.xpi 440996 SHA256 c49f48ae67c89ae361dcc091d3c2e115bc67cdbb2f4eb72f4552ca9d7075245b SHA512 0d7ffbfc35a86627089fb8d5d953fbdc9ec181dce3989bd9063aa8e920b6f2ccccfdaad7b7c87418de8f922464626f340283427b9fff38baebf6822bd8b2d7e5 WHIRLPOOL f43a7f0469c990c2e918ae1f89f392d272d5be61fed5c4d8986edfc729dfbaa915d5be856d9c0b3933ee81ce358a76df3339a4031ce56309be7ffc89febb5fe6
+DIST firefox-37.0.1-zh-CN.xpi 480865 SHA256 2dbd4cd038d54b17c00c227c35810a1e2119898b766f038c932fc470758d4ece SHA512 667eaf50562be8dfbfb196a6c943e2ecb6fc2d3b51841040ad6e3726aa6b11a2df77e0fd7012493c9babfebf5bc0f15e21c2c384287729caa50635667047347c WHIRLPOOL e57deec8c8e506fc7ba5f8f44ca9978ad7cbfd93e87cc0e9ca98a0ccc9197c8a7d1c9cce154a61be80655e3d1abeaa1c6fbc2f9c8b8a44f1527509e9e460aadd
+DIST firefox-37.0.1-zh-TW.xpi 460364 SHA256 424998b4a53bfe3fe1021a8ba91a46bf17dc5b379d99940314bf2bd6587eec89 SHA512 7df95d02a83c69f487c7e47b3712dd8bc2ae2c9a6621bbfcfc449dc2f96ce5434d40ae82a4e1ddd1a53f265b9920d73bdcbc563d2e56ab165c07df72ac5b6240 WHIRLPOOL ca27aff9cbd56b42fa33a5ff647ce22013cedea0e5330f2ba00503c33acae3c85c9aee00d6710a0aa8a071ebbcb4db2f93aa0dc04ded7bd0a27cf2016239744b
+DIST firefox-37.0.1.source.tar.bz2 178735792 SHA256 8d10aab49017f0222dbbe4811b953d2ce61737ba612b13a98dcd4379510e18e6 SHA512 fe592a4b17af20d2813e581a3496f5217e549fe089e48b9b8afb6ba3d1630218cd9fc627818c9076ac5893658c050d4dfb192da292769761f86513f18bd32de3 WHIRLPOOL c27db8f45c96ac8583c778e87d47ff998a5a76acbe1865a3043efbc11ff7abfc4d7081885287c2fc4782f65e6938c3abd0db0755d03c616e6dd13aa3c432363f
+EBUILD firefox-37.0.1-r99.ebuild 12881 SHA256 873cb02295c07ac42ffec36ae3d49885a7486b6b25704b513f71fdc0f61d7110 SHA512 5c44bad4a4644519564a2e5b0998d01796d478a4e98b2f0fa7b8c33a9bd563b4535ff346b6940730e705becfa8fd6fa0752b418011ed720413ab753292589d53 WHIRLPOOL 39ad0b35341057ebeb11f919d6d404f7c45fe78ee53e93acf1f91d3e9c95b1f12975ef9c80cd00f2a9e851f0b9804b8be70cb26b58c95788affa02fa4ebbc29d
+MISC metadata.xml 1332 SHA256 6472dd21d6d153e44d858e6dbc7f998278f6be6dc65b9ef3a2ef86ee2c5b8533 SHA512 10a3e92528ca24810917b4580d22ae0b979d7704e5faf40c85204dc2bd76e60c21178f13cddb33145688a674812660ebde1c7e51daf9cd170dc54ee99eb8776d WHIRLPOOL 672be0b9d4372ddebd2f4721696daacac92a91ea21d2331c741e97117875eca92d07452377babd20e09908ec80c9b6196ba805584653c202ff2a44d7233fb58d
diff --git a/www-client/firefox/files/1130164.patch b/www-client/firefox/files/1130164.patch
new file mode 100644
index 00000000..2b292f83
--- /dev/null
+++ b/www-client/firefox/files/1130164.patch
@@ -0,0 +1,68 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423173074 -3600
+# Thu Feb 05 22:51:14 2015 +0100
+# Node ID a446b4e607445d1c6faec25b43a5d9b5d45bcacf
+# Parent 89120ad0518fb4932de5b5f466debed68ee787ce
+Bug 1130164 - tools/profiler: Use <stdint.h> types. r=jseward
+
+diff -r 89120ad0518f -r a446b4e60744 tools/profiler/UnwinderThread2.cpp
+--- a/tools/profiler/UnwinderThread2.cpp Thu Mar 05 06:04:03 2015 -0500
++++ b/tools/profiler/UnwinderThread2.cpp Thu Feb 05 22:51:14 2015 +0100
+@@ -470,7 +470,7 @@
+ //////////////////////////////////////////////////////////
+
+ // This is the interface to LUL.
+-typedef struct { u_int64_t pc; u_int64_t sp; } PCandSP;
++typedef struct { uint64_t pc; uint64_t sp; } PCandSP;
+
+ // Forward declaration. Implementation is below.
+ static
+@@ -1338,7 +1338,7 @@
+ else {
+ // We have at least one N and one P entry available.
+ // Scan forwards to find the SP of the current P entry
+- u_int64_t sp_cur_P = 0;
++ uint64_t sp_cur_P = 0;
+ unsigned int m = next_P + 1;
+ while (1) {
+ /* This assertion should hold because in a well formed
+@@ -1349,7 +1349,7 @@
+ if (ent.is_ent_hint('Q'))
+ break;
+ if (ent.is_ent('S')) {
+- sp_cur_P = reinterpret_cast<u_int64_t>(ent.get_tagPtr());
++ sp_cur_P = reinterpret_cast<uint64_t>(ent.get_tagPtr());
+ break;
+ }
+ m++;
+@@ -1358,7 +1358,7 @@
+ if (0) LOG(" P <= last_was_P && sp_cur_P == 0");
+ use_P = true;
+ } else {
+- u_int64_t sp_cur_N = pairs[next_N].sp;
++ uint64_t sp_cur_N = pairs[next_N].sp;
+ use_P = (sp_cur_P > sp_cur_N);
+ if (0) LOGF(" %s <= sps P %p N %p",
+ use_P ? "P" : "N", (void*)(intptr_t)sp_cur_P,
+diff -r 89120ad0518f -r a446b4e60744 tools/profiler/local_debug_info_symbolizer.cc
+--- a/tools/profiler/local_debug_info_symbolizer.cc Thu Mar 05 06:04:03 2015 -0500
++++ b/tools/profiler/local_debug_info_symbolizer.cc Thu Feb 05 22:51:14 2015 +0100
+@@ -222,7 +222,7 @@
+ debug_info_module = it->second;
+ }
+
+- u_int64_t address = frame->instruction - frame->module->base_address();
++ uint64_t address = frame->instruction - frame->module->base_address();
+ Module::Function* function =
+ debug_info_module->FindFunctionByAddress(address);
+ if (function) {
+@@ -282,7 +282,7 @@
+ if (it == symbols_.end()) return NULL;
+
+ Module* module = it->second;
+- u_int64_t address = frame->instruction - frame->module->base_address();
++ uint64_t address = frame->instruction - frame->module->base_address();
+ Module::StackFrameEntry* entry =
+ module->FindStackFrameEntryByAddress(address);
+ if (!entry)
diff --git a/www-client/firefox/files/1130175.patch b/www-client/firefox/files/1130175.patch
new file mode 100644
index 00000000..8946a56a
--- /dev/null
+++ b/www-client/firefox/files/1130175.patch
@@ -0,0 +1,33 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423171460 -3600
+# Thu Feb 05 22:24:20 2015 +0100
+# Node ID af818fbea923d7c026bc8e22a6512f14f788ba56
+# Parent 9c40ffbcf6b32d688abf089f2cce3c85dd8bdb29
+Bug 1130175 - nICEr: avoid sysctl.h include. r=bwc
+
+diff -r 9c40ffbcf6b3 -r af818fbea923 media/mtransport/third_party/nICEr/src/stun/addrs.c
+--- a/media/mtransport/third_party/nICEr/src/stun/addrs.c Mon Feb 23 07:39:00 2015 -0500
++++ b/media/mtransport/third_party/nICEr/src/stun/addrs.c Thu Feb 05 22:24:20 2015 +0100
+@@ -45,13 +45,11 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #ifndef ANDROID
+-#include <sys/sysctl.h>
+ #include <sys/syslog.h>
+ #else
+ #include <syslog.h>
+ /* Work around an Android NDK < r8c bug */
+ #undef __unused
+-#include <linux/sysctl.h>
+ #endif
+ #ifndef LINUX
+ #include <net/if.h>
+@@ -122,6 +120,7 @@
+ */
+
+ #include <err.h>
++#include <sys/sysctl.h>
+
+ static void stun_rt_xaddrs(caddr_t, caddr_t, struct rt_addrinfo *);
+ static int stun_grab_addrs(char *name, int addrcount,
diff --git a/www-client/firefox/files/1130710.patch b/www-client/firefox/files/1130710.patch
new file mode 100644
index 00000000..02c28771
--- /dev/null
+++ b/www-client/firefox/files/1130710.patch
@@ -0,0 +1,57 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423172841 -3600
+# Node ID 48efa200aae98f4b5fced4f1afa4f1b8c8cde9e1
+# Parent 3693f117ad5018927922c92cf5bd9739bc25f394
+Bug 1130710 - xre: Use stdint uint*_t instead of nonstandard __uint*_t. r=bsmedberg
+
+diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp
+--- a/toolkit/xre/nsSigHandlers.cpp
++++ b/toolkit/xre/nsSigHandlers.cpp
+@@ -160,17 +160,17 @@ static void fpehandler(int signum, sigin
+ #if defined(__i386__) || defined(__amd64__)
+ _STRUCT_FP_CONTROL *ctrl = &uc->uc_mcontext->__fs.__fpu_fcw;
+ ctrl->__invalid = ctrl->__denorm = ctrl->__zdiv = ctrl->__ovrfl = ctrl->__undfl = ctrl->__precis = 1;
+
+ _STRUCT_FP_STATUS *status = &uc->uc_mcontext->__fs.__fpu_fsw;
+ status->__invalid = status->__denorm = status->__zdiv = status->__ovrfl = status->__undfl =
+ status->__precis = status->__stkflt = status->__errsumm = 0;
+
+- __uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
++ uint32_t *mxcsr = &uc->uc_mcontext->__fs.__fpu_mxcsr;
+ *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
+ *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
+ #endif
+ #endif
+ #if defined(LINUX) && !defined(ANDROID)
+ ucontext_t *uc = (ucontext_t *)context;
+
+ #if defined(__i386__)
+@@ -180,23 +180,23 @@ static void fpehandler(int signum, sigin
+ */
+ unsigned long int *cw = &uc->uc_mcontext.fpregs->cw;
+ *cw |= FPU_EXCEPTION_MASK;
+
+ unsigned long int *sw = &uc->uc_mcontext.fpregs->sw;
+ *sw &= ~FPU_STATUS_FLAGS;
+ #endif
+ #if defined(__amd64__)
+- __uint16_t *cw = &uc->uc_mcontext.fpregs->cwd;
++ uint16_t *cw = &uc->uc_mcontext.fpregs->cwd;
+ *cw |= FPU_EXCEPTION_MASK;
+
+- __uint16_t *sw = &uc->uc_mcontext.fpregs->swd;
++ uint16_t *sw = &uc->uc_mcontext.fpregs->swd;
+ *sw &= ~FPU_STATUS_FLAGS;
+
+- __uint32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
++ uint32_t *mxcsr = &uc->uc_mcontext.fpregs->mxcsr;
+ *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
+ *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
+ #endif
+ #endif
+ #ifdef SOLARIS
+ ucontext_t *uc = (ucontext_t *)context;
+
+ #if defined(__i386)
+
diff --git a/www-client/firefox/files/basename.patch b/www-client/firefox/files/basename.patch
new file mode 100644
index 00000000..bfbfaeab
--- /dev/null
+++ b/www-client/firefox/files/basename.patch
@@ -0,0 +1,25 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423172942 -3600
+# Thu Feb 05 22:49:02 2015 +0100
+# Node ID 5f3abeb6ae6c0512901724428d908f601b9e49d4
+# Parent 2d344ef8da33717224d5a08570dc834ca2254f9f
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1041962
+LulElf: Avoid basename
+
+diff -r 2d344ef8da33 -r 5f3abeb6ae6c tools/profiler/LulElf.cpp
+--- a/tools/profiler/LulElf.cpp Sun Feb 01 19:32:36 2015 +0100
++++ b/tools/profiler/LulElf.cpp Thu Feb 05 22:49:02 2015 +0100
+@@ -611,9 +611,9 @@
+ // last slash, or the whole filename if there are no slashes.
+ string BaseFileName(const string &filename) {
+ // Lots of copies! basename's behavior is less than ideal.
+- char *c_filename = strdup(filename.c_str());
+- string base = basename(c_filename);
+- free(c_filename);
++ const char *c_filename = filename.c_str();
++ const char *p = strrchr(c_filename, '/');
++ string base = p ? p+1 : c_filename;
+ return base;
+ }
+
diff --git a/www-client/firefox/files/crashreporter.patch b/www-client/firefox/files/crashreporter.patch
new file mode 100644
index 00000000..719ed0df
--- /dev/null
+++ b/www-client/firefox/files/crashreporter.patch
@@ -0,0 +1,358 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423172597 -3600
+# Thu Feb 05 22:43:17 2015 +0100
+# Node ID df5ec9e5685a52bcd19bbe566c0770daa40f14b1
+# Parent 2d344ef8da33717224d5a08570dc834ca2254f9f
+crashreporter: compile with musl
+
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
+--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc Thu Feb 05 22:43:17 2015 +0100
+@@ -28,7 +28,6 @@
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ #include <assert.h>
+-#include <dirent.h>
+ #include <fcntl.h>
+ #include <limits.h>
+ #include <poll.h>
+@@ -49,6 +48,8 @@
+ #include "common/linux/guid_creator.h"
+ #include "common/linux/safe_readlink.h"
+
++#include <dirent.h>
++
+ static const char kCommandQuit = 'x';
+
+ namespace google_breakpad {
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc Thu Feb 05 22:43:17 2015 +0100
+@@ -77,7 +77,7 @@
+ #include <sys/wait.h>
+ #include <unistd.h>
+
+-#include <sys/signal.h>
++#include <signal.h>
+ #include <sys/ucontext.h>
+ #include <sys/user.h>
+ #include <ucontext.h>
+@@ -418,11 +418,11 @@
+ siginfo_t siginfo = {};
+ // Mimic a trusted signal to allow tracing the process (see
+ // ExceptionHandler::HandleSignal().
+- siginfo.si_code = SI_USER;
+- siginfo.si_pid = getpid();
+- struct ucontext context;
+- getcontext(&context);
+- return HandleSignal(sig, &siginfo, &context);
++// siginfo.si_code = SI_USER;
++// siginfo.si_pid = getpid();
++// struct ucontext context;
++// getcontext(&context);
++// return HandleSignal(sig, &siginfo, &context);
+ }
+
+ // This function may run in a compromised context: see the top of the file.
+@@ -567,7 +567,7 @@
+ sys_prctl(PR_SET_DUMPABLE, 1);
+
+ CrashContext context;
+- int getcontext_result = getcontext(&context.context);
++ int getcontext_result = 1;//getcontext(&context.context);
+ if (getcontext_result)
+ return false;
+ #if !defined(__ARM_EABI__)
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
+--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h Thu Feb 05 22:43:17 2015 +0100
+@@ -192,7 +192,7 @@
+ struct ucontext context;
+ #if !defined(__ARM_EABI__)
+ // #ifdef this out because FP state is not part of user ABI for Linux ARM.
+- struct _libc_fpstate float_state;
++ struct _fpstate float_state;
+ #endif
+ };
+
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
+--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc Thu Feb 05 22:43:17 2015 +0100
+@@ -174,7 +174,7 @@
+ // out: the minidump structure
+ // info: the collection of register structures.
+ void CPUFillFromUContext(MDRawContextX86 *out, const ucontext *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -274,7 +274,7 @@
+ }
+
+ void CPUFillFromUContext(MDRawContextAMD64 *out, const ucontext *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+@@ -341,7 +341,7 @@
+ }
+
+ void CPUFillFromUContext(MDRawContextARM* out, const ucontext* uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ out->context_flags = MD_CONTEXT_ARM_FULL;
+
+ out->iregs[0] = uc->uc_mcontext.arm_r0;
+@@ -1480,7 +1480,7 @@
+ const char* path_; // Path to the file where the minidum should be written.
+
+ const struct ucontext* const ucontext_; // also from the signal handler
+- const struct _libc_fpstate* const float_state_; // ditto
++ const struct _fpstate* const float_state_; // ditto
+ LinuxDumper* dumper_;
+ MinidumpFileWriter minidump_writer_;
+ off_t minidump_size_limit_;
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h
+--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h Sun Feb 01 19:32:36 2015 +0100
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,100 +0,0 @@
+-// Copyright (c) 2012, Google Inc.
+-// All rights reserved.
+-//
+-// Redistribution and use in source and binary forms, with or without
+-// modification, are permitted provided that the following conditions are
+-// met:
+-//
+-// * Redistributions of source code must retain the above copyright
+-// notice, this list of conditions and the following disclaimer.
+-// * Redistributions in binary form must reproduce the above
+-// copyright notice, this list of conditions and the following disclaimer
+-// in the documentation and/or other materials provided with the
+-// distribution.
+-// * Neither the name of Google Inc. nor the names of its
+-// contributors may be used to endorse or promote products derived from
+-// this software without specific prior written permission.
+-//
+-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-
+-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
+-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
+-
+-#include <sys/cdefs.h>
+-
+-#ifdef __BIONIC_HAVE_STAB_H
+-#include <stab.h>
+-#else
+-
+-#ifdef __cplusplus
+-extern "C" {
+-#endif // __cplusplus
+-
+-#define _STAB_CODE_LIST \
+- _STAB_CODE_DEF(UNDF,0x00) \
+- _STAB_CODE_DEF(GSYM,0x20) \
+- _STAB_CODE_DEF(FNAME,0x22) \
+- _STAB_CODE_DEF(FUN,0x24) \
+- _STAB_CODE_DEF(STSYM,0x26) \
+- _STAB_CODE_DEF(LCSYM,0x28) \
+- _STAB_CODE_DEF(MAIN,0x2a) \
+- _STAB_CODE_DEF(PC,0x30) \
+- _STAB_CODE_DEF(NSYMS,0x32) \
+- _STAB_CODE_DEF(NOMAP,0x34) \
+- _STAB_CODE_DEF(OBJ,0x38) \
+- _STAB_CODE_DEF(OPT,0x3c) \
+- _STAB_CODE_DEF(RSYM,0x40) \
+- _STAB_CODE_DEF(M2C,0x42) \
+- _STAB_CODE_DEF(SLINE,0x44) \
+- _STAB_CODE_DEF(DSLINE,0x46) \
+- _STAB_CODE_DEF(BSLINE,0x48) \
+- _STAB_CODE_DEF(BROWS,0x48) \
+- _STAB_CODE_DEF(DEFD,0x4a) \
+- _STAB_CODE_DEF(EHDECL,0x50) \
+- _STAB_CODE_DEF(MOD2,0x50) \
+- _STAB_CODE_DEF(CATCH,0x54) \
+- _STAB_CODE_DEF(SSYM,0x60) \
+- _STAB_CODE_DEF(SO,0x64) \
+- _STAB_CODE_DEF(LSYM,0x80) \
+- _STAB_CODE_DEF(BINCL,0x82) \
+- _STAB_CODE_DEF(SOL,0x84) \
+- _STAB_CODE_DEF(PSYM,0xa0) \
+- _STAB_CODE_DEF(EINCL,0xa2) \
+- _STAB_CODE_DEF(ENTRY,0xa4) \
+- _STAB_CODE_DEF(LBRAC,0xc0) \
+- _STAB_CODE_DEF(EXCL,0xc2) \
+- _STAB_CODE_DEF(SCOPE,0xc4) \
+- _STAB_CODE_DEF(RBRAC,0xe0) \
+- _STAB_CODE_DEF(BCOMM,0xe2) \
+- _STAB_CODE_DEF(ECOMM,0xe4) \
+- _STAB_CODE_DEF(ECOML,0xe8) \
+- _STAB_CODE_DEF(NBTEXT,0xf0) \
+- _STAB_CODE_DEF(NBDATA,0xf2) \
+- _STAB_CODE_DEF(NBBSS,0xf4) \
+- _STAB_CODE_DEF(NBSTS,0xf6) \
+- _STAB_CODE_DEF(NBLCS,0xf8) \
+- _STAB_CODE_DEF(LENG,0xfe)
+-
+-enum __stab_debug_code {
+-#define _STAB_CODE_DEF(x,y) N_##x = y,
+-_STAB_CODE_LIST
+-#undef _STAB_CODE_DEF
+-};
+-
+-#ifdef __cplusplus
+-} // extern "C"
+-#endif // __cplusplus
+-
+-#endif // __BIONIC_HAVE_STAB_H
+-
+-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h
+--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h Sun Feb 01 19:32:36 2015 +0100
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,35 +0,0 @@
+-// Copyright (c) 2012, Google Inc.
+-// All rights reserved.
+-//
+-// Redistribution and use in source and binary forms, with or without
+-// modification, are permitted provided that the following conditions are
+-// met:
+-//
+-// * Redistributions of source code must retain the above copyright
+-// notice, this list of conditions and the following disclaimer.
+-// * Redistributions in binary form must reproduce the above
+-// copyright notice, this list of conditions and the following disclaimer
+-// in the documentation and/or other materials provided with the
+-// distribution.
+-// * Neither the name of Google Inc. nor the names of its
+-// contributors may be used to endorse or promote products derived from
+-// this software without specific prior written permission.
+-//
+-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-
+-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
+-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
+-
+-#include <signal.h>
+-
+-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
+--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc Thu Feb 05 22:43:17 2015 +0100
+@@ -829,9 +829,9 @@
+ // last slash, or the whole filename if there are no slashes.
+ string BaseFileName(const string &filename) {
+ // Lots of copies! basename's behavior is less than ideal.
+- char *c_filename = strdup(filename.c_str());
+- string base = basename(c_filename);
+- free(c_filename);
++ const char *c_filename = filename.c_str();
++ const char *p = strrchr(c_filename, '/');
++ string base = p ? p+1 : c_filename;
+ return base;
+ }
+
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h
+--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h Thu Feb 05 22:43:17 2015 +0100
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <sys/reg.h>
+
+ #include "common/memory_range.h"
+
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
+--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc Thu Feb 05 22:43:17 2015 +0100
+@@ -34,7 +34,6 @@
+ #include "common/stabs_reader.h"
+
+ #include <assert.h>
+-#include <stab.h>
+ #include <string.h>
+
+ #include <string>
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h
+--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h Thu Feb 05 22:43:17 2015 +0100
+@@ -53,12 +53,19 @@
+ #include <config.h>
+ #endif
+
+-#ifdef HAVE_A_OUT_H
+-#include <a.out.h>
+-#endif
+ #ifdef HAVE_MACH_O_NLIST_H
+ #include <mach-o/nlist.h>
+ #endif
++// Definitions from <stab.h> and <a.out.h> for systems which
++// do not have them
++#undef N_UNDF
++#define N_UNDF 0x0
++#define N_FUN 0x24
++#define N_SLINE 0x44
++#define N_SO 0x64
++#define N_LSYM 0x80
++#define N_BINCL 0x82
++#define N_SOL 0x84
+
+ #include <string>
+ #include <vector>
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc
+--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc Thu Feb 05 22:43:17 2015 +0100
+@@ -33,7 +33,6 @@
+
+ #include <assert.h>
+ #include <errno.h>
+-#include <stab.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h Thu Feb 05 22:43:17 2015 +0100
+@@ -2814,7 +2814,7 @@
+ LSS_INLINE _syscall6(void*, mmap, void*, s,
+ size_t, l, int, p,
+ int, f, int, d,
+- __off64_t, o)
++ off64_t, o)
+
+ LSS_INLINE _syscall4(int, newfstatat, int, d,
+ const char *, p,
+diff -r 2d344ef8da33 -r df5ec9e5685a toolkit/crashreporter/nsExceptionHandler.cpp
+--- a/toolkit/crashreporter/nsExceptionHandler.cpp Sun Feb 01 19:32:36 2015 +0100
++++ b/toolkit/crashreporter/nsExceptionHandler.cpp Thu Feb 05 22:43:17 2015 +0100
+@@ -49,6 +49,7 @@
+ #elif defined(XP_LINUX)
+ #include "nsIINIParser.h"
+ #include "common/linux/linux_libc_support.h"
++#undef getdents64
+ #include "third_party/lss/linux_syscall_support.h"
+ #include "client/linux/crash_generation/client_info.h"
+ #include "client/linux/crash_generation/crash_generation_server.h"
diff --git a/www-client/firefox/files/firefox-35.0-gmp-clearkey-sprintf.patch b/www-client/firefox/files/firefox-35.0-gmp-clearkey-sprintf.patch
new file mode 100644
index 00000000..dfd9a8db
--- /dev/null
+++ b/www-client/firefox/files/firefox-35.0-gmp-clearkey-sprintf.patch
@@ -0,0 +1,10 @@
+--- a/mozilla-beta/media/gmp-clearkey/0.1/openaes/oaes_lib.c 2014-12-04 11:24:16.279571363 -0500
++++ b/mozilla-beta/media/gmp-clearkey/0.1/openaes/oaes_lib.c 2014-12-04 11:23:07.449572313 -0500
+@@ -42,6 +42,7 @@
+
+ #include "oaes_config.h"
+ #include "oaes_lib.h"
++#include "standard.h"
+
+ #ifdef OAES_HAVE_ISAAC
+ #include "rand.h"
diff --git a/www-client/firefox/files/fts.patch b/www-client/firefox/files/fts.patch
new file mode 100644
index 00000000..4c1734f0
--- /dev/null
+++ b/www-client/firefox/files/fts.patch
@@ -0,0 +1,480 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1428142499 -7200
+# Sat Apr 04 12:14:59 2015 +0200
+# Node ID b85504ff4ee9c548d58e75398a2de69f2089e907
+# Parent 90adc073cbc6398f4fab9b1cd07b685368559f34
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1139173
+ipc/chromium: Remove dead code to make it compile on linux without <fts.h>
+
+diff -r 90adc073cbc6 -r b85504ff4ee9 ipc/chromium/moz.build
+--- a/ipc/chromium/moz.build Thu Apr 02 08:10:00 2015 -0400
++++ b/ipc/chromium/moz.build Sat Apr 04 12:14:59 2015 +0200
+@@ -50,7 +50,6 @@
+ 'src/base/pickle.cc',
+ 'src/base/rand_util.cc',
+ 'src/base/revocable_store.cc',
+- 'src/base/scoped_temp_dir.cc',
+ 'src/base/string_piece.cc',
+ 'src/base/string_util.cc',
+ 'src/base/thread.cc',
+diff -r 90adc073cbc6 -r b85504ff4ee9 ipc/chromium/src/base/file_util.cc
+--- a/ipc/chromium/src/base/file_util.cc Thu Apr 02 08:10:00 2015 -0400
++++ b/ipc/chromium/src/base/file_util.cc Sat Apr 04 12:14:59 2015 +0200
+@@ -139,12 +139,6 @@
+ path->push_back(FilePath::kSeparators[0]);
+ path->append(new_ending);
+ }
+-bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path,
+- bool recursive) {
+- return CopyDirectory(FilePath::FromWStringHack(from_path),
+- FilePath::FromWStringHack(to_path),
+- recursive);
+-}
+ bool CopyFile(const std::wstring& from_path, const std::wstring& to_path) {
+ return CopyFile(FilePath::FromWStringHack(from_path),
+ FilePath::FromWStringHack(to_path));
+@@ -172,8 +166,8 @@
+ *temp_file = temp_file_path.ToWStringHack();
+ return true;
+ }
+-bool Delete(const std::wstring& path, bool recursive) {
+- return Delete(FilePath::FromWStringHack(path), recursive);
++bool Delete(const std::wstring& path) {
++ return Delete(FilePath::FromWStringHack(path));
+ }
+ bool DirectoryExists(const std::wstring& path) {
+ return DirectoryExists(FilePath::FromWStringHack(path));
+diff -r 90adc073cbc6 -r b85504ff4ee9 ipc/chromium/src/base/file_util.h
+--- a/ipc/chromium/src/base/file_util.h Thu Apr 02 08:10:00 2015 -0400
++++ b/ipc/chromium/src/base/file_util.h Sat Apr 04 12:14:59 2015 +0200
+@@ -16,7 +16,6 @@
+ #include <sys/stat.h>
+ #elif defined(OS_POSIX)
+ #include <sys/types.h>
+-#include <fts.h>
+ #include <sys/stat.h>
+ #endif
+
+@@ -87,34 +86,17 @@
+
+ // Deletes the given path, whether it's a file or a directory.
+ // If it's a directory, it's perfectly happy to delete all of the
+-// directory's contents. Passing true to recursive deletes
+-// subdirectories and their contents as well.
++// directory's contents.
+ // Returns true if successful, false otherwise.
+-//
+-// WARNING: USING THIS WITH recursive==true IS EQUIVALENT
+-// TO "rm -rf", SO USE WITH CAUTION.
+-bool Delete(const FilePath& path, bool recursive);
++bool Delete(const FilePath& path);
+ // Deprecated temporary compatibility function.
+-bool Delete(const std::wstring& path, bool recursive);
++bool Delete(const std::wstring& path);
+
+ // Copies a single file. Use CopyDirectory to copy directories.
+ bool CopyFile(const FilePath& from_path, const FilePath& to_path);
+ // Deprecated temporary compatibility function.
+ bool CopyFile(const std::wstring& from_path, const std::wstring& to_path);
+
+-// Copies the given path, and optionally all subdirectories and their contents
+-// as well.
+-// If there are files existing under to_path, always overwrite.
+-// Returns true if successful, false otherwise.
+-// Dont't use wildcards on the names, it may stop working without notice.
+-//
+-// If you only need to copy a file use CopyFile, it's faster.
+-bool CopyDirectory(const FilePath& from_path, const FilePath& to_path,
+- bool recursive);
+-// Deprecated temporary compatibility function.
+-bool CopyDirectory(const std::wstring& from_path, const std::wstring& to_path,
+- bool recursive);
+-
+ // Returns true if the given path exists on the local filesystem,
+ // false otherwise.
+ bool PathExists(const FilePath& path);
+diff -r 90adc073cbc6 -r b85504ff4ee9 ipc/chromium/src/base/file_util_posix.cc
+--- a/ipc/chromium/src/base/file_util_posix.cc Thu Apr 02 08:10:00 2015 -0400
++++ b/ipc/chromium/src/base/file_util_posix.cc Sat Apr 04 12:14:59 2015 +0200
+@@ -8,13 +8,10 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <fnmatch.h>
+-#ifndef ANDROID
+-#include <fts.h>
+-#endif
+ #include <libgen.h>
+ #include <stdio.h>
+ #include <string.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/mman.h>
+ #define _DARWIN_USE_64_BIT_INODE // Use 64-bit inode data structures
+ #include <sys/stat.h>
+@@ -53,7 +50,7 @@
+ // which works both with and without the recursive flag. I'm not sure we need
+ // that functionality. If not, remove from file_util_win.cc, otherwise add it
+ // here.
+-bool Delete(const FilePath& path, bool recursive) {
++bool Delete(const FilePath& path) {
+ const char* path_str = path.value().c_str();
+ struct stat file_info;
+ int test = stat(path_str, &file_info);
+@@ -64,174 +61,8 @@
+ }
+ if (!S_ISDIR(file_info.st_mode))
+ return (unlink(path_str) == 0);
+- if (!recursive)
+- return (rmdir(path_str) == 0);
+
+-#ifdef ANDROID
+- // XXX Need ftsless impl for bionic
+- return false;
+-#else
+- bool success = true;
+- int ftsflags = FTS_PHYSICAL | FTS_NOSTAT;
+- char top_dir[PATH_MAX];
+- if (base::strlcpy(top_dir, path_str,
+- arraysize(top_dir)) >= arraysize(top_dir)) {
+- return false;
+- }
+- char* dir_list[2] = { top_dir, NULL };
+- FTS* fts = fts_open(dir_list, ftsflags, NULL);
+- if (fts) {
+- FTSENT* fts_ent = fts_read(fts);
+- while (success && fts_ent != NULL) {
+- switch (fts_ent->fts_info) {
+- case FTS_DNR:
+- case FTS_ERR:
+- // log error
+- success = false;
+- continue;
+- break;
+- case FTS_DP:
+- success = (rmdir(fts_ent->fts_accpath) == 0);
+- break;
+- case FTS_D:
+- break;
+- case FTS_NSOK:
+- case FTS_F:
+- case FTS_SL:
+- case FTS_SLNONE:
+- success = (unlink(fts_ent->fts_accpath) == 0);
+- break;
+- default:
+- DCHECK(false);
+- break;
+- }
+- fts_ent = fts_read(fts);
+- }
+- fts_close(fts);
+- }
+- return success;
+-#endif
+-}
+-
+-bool Move(const FilePath& from_path, const FilePath& to_path) {
+- if (rename(from_path.value().c_str(), to_path.value().c_str()) == 0)
+- return true;
+-
+- if (!CopyDirectory(from_path, to_path, true))
+- return false;
+-
+- Delete(from_path, true);
+- return true;
+-}
+-
+-bool CopyDirectory(const FilePath& from_path,
+- const FilePath& to_path,
+- bool recursive) {
+- // Some old callers of CopyDirectory want it to support wildcards.
+- // After some discussion, we decided to fix those callers.
+- // Break loudly here if anyone tries to do this.
+- // TODO(evanm): remove this once we're sure it's ok.
+- DCHECK(to_path.value().find('*') == std::string::npos);
+- DCHECK(from_path.value().find('*') == std::string::npos);
+-
+- char top_dir[PATH_MAX];
+- if (base::strlcpy(top_dir, from_path.value().c_str(),
+- arraysize(top_dir)) >= arraysize(top_dir)) {
+- return false;
+- }
+-
+-#ifdef ANDROID
+- // XXX Need ftsless impl for bionic
+- return false;
+-#else
+- char* dir_list[] = { top_dir, NULL };
+- FTS* fts = fts_open(dir_list, FTS_PHYSICAL | FTS_NOSTAT, NULL);
+- if (!fts) {
+- CHROMIUM_LOG(ERROR) << "fts_open failed: " << strerror(errno);
+- return false;
+- }
+-
+- int error = 0;
+- FTSENT* ent;
+- while (!error && (ent = fts_read(fts)) != NULL) {
+- // ent->fts_path is the source path, including from_path, so paste
+- // the suffix after from_path onto to_path to create the target_path.
+- std::string suffix(&ent->fts_path[from_path.value().size()]);
+- // Strip the leading '/' (if any).
+- if (!suffix.empty()) {
+- DCHECK_EQ('/', suffix[0]);
+- suffix.erase(0, 1);
+- }
+- const FilePath target_path = to_path.Append(suffix);
+- switch (ent->fts_info) {
+- case FTS_D: // Preorder directory.
+- // If we encounter a subdirectory in a non-recursive copy, prune it
+- // from the traversal.
+- if (!recursive && ent->fts_level > 0) {
+- if (fts_set(fts, ent, FTS_SKIP) != 0)
+- error = errno;
+- continue;
+- }
+-
+- // Try creating the target dir, continuing on it if it exists already.
+- // Rely on the user's umask to produce correct permissions.
+- if (mkdir(target_path.value().c_str(), 0777) != 0) {
+- if (errno != EEXIST)
+- error = errno;
+- }
+- break;
+- case FTS_F: // Regular file.
+- case FTS_NSOK: // File, no stat info requested.
+- errno = 0;
+- if (!CopyFile(FilePath(ent->fts_path), target_path))
+- error = errno ? errno : EINVAL;
+- break;
+- case FTS_DP: // Postorder directory.
+- case FTS_DOT: // "." or ".."
+- // Skip it.
+- continue;
+- case FTS_DC: // Directory causing a cycle.
+- // Skip this branch.
+- if (fts_set(fts, ent, FTS_SKIP) != 0)
+- error = errno;
+- break;
+- case FTS_DNR: // Directory cannot be read.
+- case FTS_ERR: // Error.
+- case FTS_NS: // Stat failed.
+- // Abort with the error.
+- error = ent->fts_errno;
+- break;
+- case FTS_SL: // Symlink.
+- case FTS_SLNONE: // Symlink with broken target.
+- CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping symbolic link: " <<
+- ent->fts_path;
+- continue;
+- case FTS_DEFAULT: // Some other sort of file.
+- CHROMIUM_LOG(WARNING) << "CopyDirectory() skipping file of unknown type: " <<
+- ent->fts_path;
+- continue;
+- default:
+- NOTREACHED();
+- continue; // Hope for the best!
+- }
+- }
+- // fts_read may have returned NULL and set errno to indicate an error.
+- if (!error && errno != 0)
+- error = errno;
+-
+- if (!fts_close(fts)) {
+- // If we already have an error, let's use that error instead of the error
+- // fts_close set.
+- if (!error)
+- error = errno;
+- }
+-
+- if (error) {
+- CHROMIUM_LOG(ERROR) << "CopyDirectory(): " << strerror(error);
+- return false;
+- }
+- return true;
+-#endif
++ return (rmdir(path_str) == 0);
+ }
+
+ bool PathExists(const FilePath& path) {
+diff -r 90adc073cbc6 -r b85504ff4ee9 ipc/chromium/src/base/file_util_win.cc
+--- a/ipc/chromium/src/base/file_util_win.cc Thu Apr 02 08:10:00 2015 -0400
++++ b/ipc/chromium/src/base/file_util_win.cc Sat Apr 04 12:14:59 2015 +0200
+@@ -27,14 +27,14 @@
+ return true;
+ }
+
+-bool Delete(const FilePath& path, bool recursive) {
++bool Delete(const FilePath& path) {
+ if (path.value().length() >= MAX_PATH)
+ return false;
+
+- // If we're not recursing use DeleteFile; it should be faster. DeleteFile
++ // Use DeleteFile; it should be faster. DeleteFile
+ // fails if passed a directory though, which is why we fall through on
+ // failure to the SHFileOperation.
+- if (!recursive && DeleteFile(path.value().c_str()) != 0)
++ if (DeleteFile(path.value().c_str()) != 0)
+ return true;
+
+ // SHFILEOPSTRUCT wants the path to be terminated with two NULLs,
+@@ -48,8 +48,7 @@
+ file_operation.wFunc = FO_DELETE;
+ file_operation.pFrom = double_terminated_path;
+ file_operation.fFlags = FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION;
+- if (!recursive)
+- file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY;
++ file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY;
+ int err = SHFileOperation(&file_operation);
+ // Some versions of Windows return ERROR_FILE_NOT_FOUND when
+ // deleting an empty directory.
+@@ -98,26 +97,6 @@
+ return (SHFileOperation(&file_operation) == 0);
+ }
+
+-bool CopyDirectory(const FilePath& from_path, const FilePath& to_path,
+- bool recursive) {
+- if (recursive)
+- return ShellCopy(from_path, to_path, true);
+-
+- // Instead of creating a new directory, we copy the old one to include the
+- // security information of the folder as part of the copy.
+- if (!PathExists(to_path)) {
+- // Except that Vista fails to do that, and instead do a recursive copy if
+- // the target directory doesn't exist.
+- if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA)
+- CreateDirectory(to_path);
+- else
+- ShellCopy(from_path, to_path, false);
+- }
+-
+- FilePath directory = from_path.Append(L"*.*");
+- return ShellCopy(directory, to_path, false);
+-}
+-
+ bool PathExists(const FilePath& path) {
+ return (GetFileAttributes(path.value().c_str()) != INVALID_FILE_ATTRIBUTES);
+ }
+diff -r 40f6b9e6448e -r e25335f4fbb2 ipc/chromium/src/base/scoped_temp_dir.cc
+--- a/ipc/chromium/src/base/scoped_temp_dir.cc Tue Mar 03 23:02:07 2015 +0100
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,47 +0,0 @@
+-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+-// Use of this source code is governed by a BSD-style license that can be
+-// found in the LICENSE file.
+-
+-#include "base/scoped_temp_dir.h"
+-
+-#include "base/file_util.h"
+-#include "base/logging.h"
+-#include "base/string_util.h"
+-
+-ScopedTempDir::ScopedTempDir() {
+-}
+-
+-ScopedTempDir::~ScopedTempDir() {
+- if (!path_.empty() && !file_util::Delete(path_, true))
+- CHROMIUM_LOG(ERROR) << "ScopedTempDir unable to delete " << path_.value();
+-}
+-
+-bool ScopedTempDir::CreateUniqueTempDir() {
+- // This "scoped_dir" prefix is only used on Windows and serves as a template
+- // for the unique name.
+- if (!file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("scoped_dir"),
+- &path_))
+- return false;
+-
+- return true;
+-}
+-
+-bool ScopedTempDir::Set(const FilePath& path) {
+- DCHECK(path_.empty());
+- if (!file_util::DirectoryExists(path) &&
+- !file_util::CreateDirectory(path)) {
+- return false;
+- }
+- path_ = path;
+- return true;
+-}
+-
+-FilePath ScopedTempDir::Take() {
+- FilePath ret = path_;
+- path_ = FilePath();
+- return ret;
+-}
+-
+-bool ScopedTempDir::IsValid() const {
+- return !path_.empty() && file_util::DirectoryExists(path_);
+-}
+diff -r 40f6b9e6448e -r e25335f4fbb2 ipc/chromium/src/base/scoped_temp_dir.h
+--- a/ipc/chromium/src/base/scoped_temp_dir.h Tue Mar 03 23:02:07 2015 +0100
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,47 +0,0 @@
+-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+-// Use of this source code is governed by a BSD-style license that can be
+-// found in the LICENSE file.
+-
+-#ifndef BASE_SCOPED_TEMP_DIR_H_
+-#define BASE_SCOPED_TEMP_DIR_H_
+-
+-// An object representing a temporary / scratch directory that should be cleaned
+-// up (recursively) when this object goes out of scope. Note that since
+-// deletion occurs during the destructor, no further error handling is possible
+-// if the directory fails to be deleted. As a result, deletion is not
+-// guaranteed by this class.
+-
+-#include "base/file_path.h"
+-
+-class ScopedTempDir {
+- public:
+- // No directory is owned/created initially.
+- ScopedTempDir();
+-
+- // Recursively delete path_
+- ~ScopedTempDir();
+-
+- // Creates a unique directory in TempPath, and takes ownership of it.
+- // See file_util::CreateNewTemporaryDirectory.
+- bool CreateUniqueTempDir();
+-
+- // Takes ownership of directory at |path|, creating it if necessary.
+- // Don't call multiple times unless Take() has been called first.
+- bool Set(const FilePath& path);
+-
+- // Caller takes ownership of the temporary directory so it won't be destroyed
+- // when this object goes out of scope.
+- FilePath Take();
+-
+- const FilePath& path() const { return path_; }
+-
+- // Returns true if path_ is non-empty and exists.
+- bool IsValid() const;
+-
+- private:
+- FilePath path_;
+-
+- DISALLOW_COPY_AND_ASSIGN(ScopedTempDir);
+-};
+-
+-#endif // BASE_SCOPED_TEMP_DIR_H_
+diff -r 90adc073cbc6 -r b85504ff4ee9 ipc/chromium/src/base/shared_memory_posix.cc
+--- a/ipc/chromium/src/base/shared_memory_posix.cc Thu Apr 02 08:10:00 2015 -0400
++++ b/ipc/chromium/src/base/shared_memory_posix.cc Sat Apr 04 12:14:59 2015 +0200
+@@ -93,7 +93,7 @@
+
+ FilePath path(WideToUTF8(mem_filename));
+ if (file_util::PathExists(path)) {
+- return file_util::Delete(path, false);
++ return file_util::Delete(path);
+ }
+
+ // Doesn't exist, so success.
+@@ -170,7 +170,7 @@
+ // Deleting the file prevents anyone else from mapping it in
+ // (making it private), and prevents the need for cleanup (once
+ // the last fd is closed, it is truly freed).
+- file_util::Delete(path, false);
++ file_util::Delete(path);
+ } else {
+ std::wstring mem_filename;
+ if (FilenameForMemoryName(name, &mem_filename) == false)
diff --git a/www-client/firefox/files/gentoo-default-prefs.js-1 b/www-client/firefox/files/gentoo-default-prefs.js-1
new file mode 100644
index 00000000..22a51ff7
--- /dev/null
+++ b/www-client/firefox/files/gentoo-default-prefs.js-1
@@ -0,0 +1,17 @@
+pref("app.update.enabled", false);
+pref("app.update.autoInstallEnabled", false);
+pref("browser.display.use_system_colors", true);
+pref("browser.link.open_external", 3);
+pref("general.smoothScroll", true);
+pref("general.autoScroll", false);
+pref("browser.tabs.tabMinWidth", 15);
+pref("browser.backspace_action", 0);
+pref("browser.urlbar.hideGoButton", true);
+pref("accessibility.typeaheadfind", true);
+pref("browser.shell.checkDefaultBrowser", false);
+pref("browser.EULA.override", true);
+pref("general.useragent.vendor", "Gentoo");
+pref("intl.locale.matchOS", true);
+pref("general.useragent.locale", "chrome://global/locale/intl.properties");
+pref("extensions.autoDisableScopes", 0);
+pref("layout.css.dpi", 0);
diff --git a/www-client/firefox/files/icon/firefox.desktop b/www-client/firefox/files/icon/firefox.desktop
new file mode 100644
index 00000000..35999a87
--- /dev/null
+++ b/www-client/firefox/files/icon/firefox.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=@NAME@
+Comment=Web Browser
+Exec=firefox %U
+Icon=@ICON@
+Terminal=false
+Type=Application
+MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
+Categories=Network;WebBrowser;
diff --git a/www-client/firefox/files/libstagefright-cdefs.patch b/www-client/firefox/files/libstagefright-cdefs.patch
new file mode 100644
index 00000000..b45f97fb
--- /dev/null
+++ b/www-client/firefox/files/libstagefright-cdefs.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423171584 -3600
+# Thu Feb 05 22:26:24 2015 +0100
+# Node ID 48a43c9da31a3ae083edd563be50fb04d9a5b99a
+# Parent 2d344ef8da33717224d5a08570dc834ca2254f9f
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1151202
+libstagefright: Fix compilation for systems without <sys/cdefs.h>
+
+diff -r 2d344ef8da33 -r 48a43c9da31a media/libstagefright/system/core/include/cutils/properties.h
+--- a/media/libstagefright/system/core/include/cutils/properties.h Sun Feb 01 19:32:36 2015 +0100
++++ b/media/libstagefright/system/core/include/cutils/properties.h Thu Feb 05 22:26:24 2015 +0100
+@@ -17,7 +17,7 @@
+ #ifndef __CUTILS_PROPERTIES_H
+ #define __CUTILS_PROPERTIES_H
+
+-#include <sys/cdefs.h>
++#include <sys/types.h>
+ #include <stddef.h>
+
+ #ifdef __cplusplus
diff --git a/www-client/firefox/files/profiler-gettid.patch b/www-client/firefox/files/profiler-gettid.patch
new file mode 100644
index 00000000..d9983b40
--- /dev/null
+++ b/www-client/firefox/files/profiler-gettid.patch
@@ -0,0 +1,51 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423173146 -3600
+# Thu Feb 05 22:52:26 2015 +0100
+# Node ID c084550fcab646d911bbf4f05747f228759161e4
+# Parent 2d344ef8da33717224d5a08570dc834ca2254f9f
+profiler: avoid getcontext and gettid
+
+diff -r 2d344ef8da33 -r c084550fcab6 tools/profiler/GeckoTaskTracer.cpp
+--- a/tools/profiler/GeckoTaskTracer.cpp Sun Feb 01 19:32:36 2015 +0100
++++ b/tools/profiler/GeckoTaskTracer.cpp Thu Feb 05 22:52:26 2015 +0100
+@@ -18,8 +18,8 @@
+
+ #include <stdarg.h>
+
+-#if defined(__GLIBC__)
+-// glibc doesn't implement gettid(2).
++#if defined(OS_LINUX) && !defined(ANDROID)
++// only bionic wraps gettid(2).
+ #include <sys/syscall.h>
+ static pid_t gettid()
+ {
+diff -r 2d344ef8da33 -r c084550fcab6 tools/profiler/platform-linux.cc
+--- a/tools/profiler/platform-linux.cc Sun Feb 01 19:32:36 2015 +0100
++++ b/tools/profiler/platform-linux.cc Thu Feb 05 22:52:26 2015 +0100
+@@ -92,8 +92,8 @@
+
+ #define SIGNAL_SAVE_PROFILE SIGUSR2
+
+-#if defined(__GLIBC__)
+-// glibc doesn't implement gettid(2).
++#if !defined(ANDROID)
++// only android wraps gettid(2).
+ #include <sys/syscall.h>
+ pid_t gettid()
+ {
+@@ -652,10 +652,10 @@
+ {
+ MOZ_ASSERT(aContext);
+ ucontext_t* pContext = reinterpret_cast<ucontext_t*>(aContext);
+- if (!getcontext(pContext)) {
+- context = pContext;
+- SetSampleContext(this, aContext);
+- }
++// if (!getcontext(pContext)) {
++// context = pContext;
++// SetSampleContext(this, aContext);
++// }
+ }
+
+ void OS::SleepMicro(int microseconds)
diff --git a/www-client/firefox/files/sandbox-cdefs.patch b/www-client/firefox/files/sandbox-cdefs.patch
new file mode 100644
index 00000000..9591a29a
--- /dev/null
+++ b/www-client/firefox/files/sandbox-cdefs.patch
@@ -0,0 +1,21 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423172498 -3600
+# Thu Feb 05 22:41:38 2015 +0100
+# Node ID 375c73854f92701f13403b8461b35727dccde825
+# Parent 2d344ef8da33717224d5a08570dc834ca2254f9f
+# https://codereview.chromium.org/278583005
+chromium sandbox: Avoid cdefs.h
+
+diff -r 2d344ef8da33 -r 375c73854f92 security/sandbox/chromium/sandbox/linux/seccomp-bpf/linux_seccomp.h
+--- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/linux_seccomp.h Sun Feb 01 19:32:36 2015 +0100
++++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/linux_seccomp.h Thu Feb 05 22:41:38 2015 +0100
+@@ -16,7 +16,7 @@
+ #include <asm/unistd.h>
+ #include <linux/filter.h>
+
+-#include <sys/cdefs.h>
++#include <sys/types.h>
+ // Old Bionic versions do not have sys/user.h. The if can be removed once we no
+ // longer need to support these old Bionic versions.
+ // All x86_64 builds use a new enough bionic to have sys/user.h.
diff --git a/www-client/firefox/files/sctp-36.patch b/www-client/firefox/files/sctp-36.patch
new file mode 100644
index 00000000..77a18a84
--- /dev/null
+++ b/www-client/firefox/files/sctp-36.patch
@@ -0,0 +1,52 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1146096
+
+diff -r e965a1a534ec -r 4ca8a9e27180 netwerk/sctp/src/netinet/sctp_os_userspace.h
+--- a/netwerk/sctp/src/netinet/sctp_os_userspace.h Tue Mar 17 14:22:40 2015 -0400
++++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h Tue Mar 17 22:17:01 2015 +0100
+@@ -273,9 +273,11 @@
+ #endif
+
+ #else /* !defined(Userspace_os_Windows) */
++#ifdef __FreeBSD__
+ #include <sys/cdefs.h> /* needed? added from old __FreeBSD__ */
++#endif /* __FreeBSD__ */
+ #include <sys/socket.h>
+-#if defined(__Userspace_os_DragonFly) || defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_Linux) || defined(__Userspace_os_NetBSD) || defined(__Userspace_os_OpenBSD) || defined(ANDROID)
++#if !defined(__Userspace_os_Windows) && !defined(__Userspace_os_Darwin)
+ #include <pthread.h>
+ #endif
+ typedef pthread_mutex_t userland_mutex_t;
+@@ -437,7 +439,7 @@
+ /* #include <sys/param.h> in FreeBSD defines MSIZE */
+ /* #include <sys/ktr.h> */
+ /* #include <sys/systm.h> */
+-#if defined(__Userspace_os_Windows)
++#if 1
+ #include <user_queue.h>
+ #else
+ #include <sys/queue.h>
+diff -r e965a1a534ec -r 4ca8a9e27180 netwerk/sctp/src/netinet/sctp_pcb.c
+--- a/netwerk/sctp/src/netinet/sctp_pcb.c Tue Mar 17 14:22:40 2015 -0400
++++ b/netwerk/sctp/src/netinet/sctp_pcb.c Tue Mar 17 22:17:01 2015 +0100
+@@ -30,6 +30,9 @@
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#define _BSD_SOURCE /* for IPPORT_RESERVED */
++#include <netdb.h>
++
+ #ifdef __FreeBSD__
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 277031 2015-01-11 21:55:30Z tuexen $");
+diff -r e965a1a534ec -r 4ca8a9e27180 netwerk/sctp/src/user_queue.h
+--- a/netwerk/sctp/src/user_queue.h Tue Mar 17 14:22:40 2015 -0400
++++ b/netwerk/sctp/src/user_queue.h Tue Mar 17 22:17:01 2015 +0100
+@@ -31,7 +31,7 @@
+ #ifndef _USER_QUEUE_H_
+ #define _USER_QUEUE_H_
+
+-#if !defined (__Userspace_os_Windows)
++#if defined(__Userspace_os_FreeBSD)
+ #include <sys/cdefs.h>
+ #endif
+ /*
diff --git a/www-client/firefox/files/sctp.patch b/www-client/firefox/files/sctp.patch
new file mode 100644
index 00000000..5155c850
--- /dev/null
+++ b/www-client/firefox/files/sctp.patch
@@ -0,0 +1,58 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1426627021 -3600
+# Tue Mar 17 22:17:01 2015 +0100
+# Node ID 4ca8a9e2718089a1d220d1d420ebe583be4be9e5
+# Parent e965a1a534ecb6635975fae33a929dc6c06bcb50
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1146096
+
+diff -r e965a1a534ec -r 4ca8a9e27180 netwerk/sctp/src/netinet/sctp_os_userspace.h
+--- a/netwerk/sctp/src/netinet/sctp_os_userspace.h Tue Mar 17 14:22:40 2015 -0400
++++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h Tue Mar 17 22:17:01 2015 +0100
+@@ -273,9 +273,11 @@
+ #endif
+
+ #else /* !defined(Userspace_os_Windows) */
++#ifdef __FreeBSD__
+ #include <sys/cdefs.h> /* needed? added from old __FreeBSD__ */
++#endif /* __FreeBSD__ */
+ #include <sys/socket.h>
+-#if defined(__Userspace_os_DragonFly) || defined(__Userspace_os_FreeBSD) || defined(__Userspace_os_Linux) || defined(__Userspace_os_NetBSD) || defined(__Userspace_os_OpenBSD) || defined(__Userspace_os_NaCl)
++#if !defined(__Userspace_os_Windows) && !defined(__Userspace_os_Darwin)
+ #include <pthread.h>
+ #endif
+ typedef pthread_mutex_t userland_mutex_t;
+@@ -437,7 +439,7 @@
+ /* #include <sys/param.h> in FreeBSD defines MSIZE */
+ /* #include <sys/ktr.h> */
+ /* #include <sys/systm.h> */
+-#if defined(__Userspace_os_Windows)
++#if 1
+ #include <user_queue.h>
+ #else
+ #include <sys/queue.h>
+diff -r e965a1a534ec -r 4ca8a9e27180 netwerk/sctp/src/netinet/sctp_pcb.c
+--- a/netwerk/sctp/src/netinet/sctp_pcb.c Tue Mar 17 14:22:40 2015 -0400
++++ b/netwerk/sctp/src/netinet/sctp_pcb.c Tue Mar 17 22:17:01 2015 +0100
+@@ -30,6 +30,9 @@
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
++#define _BSD_SOURCE /* for IPPORT_RESERVED */
++#include <netdb.h>
++
+ #ifdef __FreeBSD__
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 277031 2015-01-11 21:55:30Z tuexen $");
+diff -r e965a1a534ec -r 4ca8a9e27180 netwerk/sctp/src/user_queue.h
+--- a/netwerk/sctp/src/user_queue.h Tue Mar 17 14:22:40 2015 -0400
++++ b/netwerk/sctp/src/user_queue.h Tue Mar 17 22:17:01 2015 +0100
+@@ -31,7 +31,7 @@
+ #ifndef _USER_QUEUE_H_
+ #define _USER_QUEUE_H_
+
+-#if !defined (__Userspace_os_Windows)
++#if defined(__Userspace_os_FreeBSD)
+ #include <sys/cdefs.h>
+ #endif
+ /*
diff --git a/www-client/firefox/files/sipcc.patch b/www-client/firefox/files/sipcc.patch
new file mode 100644
index 00000000..060fdf95
--- /dev/null
+++ b/www-client/firefox/files/sipcc.patch
@@ -0,0 +1,159 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1423304332 -3600
+# Sat Feb 07 11:18:52 2015 +0100
+# Node ID fbbc5e616bd05c0f3b29ede3d777609e04dce620
+# Parent 204cb68867f5b09f0949bd4a49a4a8c1aaf0f467
+# https://bugzilla.mozilla.org/show_bug.cgi?id=1130709
+sipcc: Make __BEGIN_DECLS and __END_DECLS explicit
+
+diff -r 204cb68867f5 -r fbbc5e616bd0 media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h
+--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h Sat Feb 07 09:22:26 2015 +0100
++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_darwin_types.h Sat Feb 07 11:18:52 2015 +0100
+@@ -54,27 +54,6 @@
+ #endif
+
+ /**
+- * __BEGIN_DECLS and __END_DECLS
+- *
+- * Define macros for compilation by C++ compiler
+- */
+-#ifndef __BEGIN_DECLS
+-#ifdef __cplusplus
+-#define __BEGIN_DECLS extern "C" {
+-#else
+-#define __BEGIN_DECLS
+-#endif
+-#endif
+-
+-#ifndef __END_DECLS
+-#ifdef __cplusplus
+-#define __END_DECLS }
+-#else
+-#define __END_DECLS
+-#endif
+-#endif
+-
+-/**
+ * Define TRUE/FALSE
+ * defined in several header files
+ */
+diff -r 204cb68867f5 -r fbbc5e616bd0 media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h
+--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h Sat Feb 07 09:22:26 2015 +0100
++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_linux_types.h Sat Feb 07 11:18:52 2015 +0100
+@@ -62,28 +62,6 @@
+ #endif
+ #endif
+
+-
+-
+-/**
+- * __BEGIN_DECLS and __END_DECLS
+- *
+- * Define macros for compilation by C++ compiler
+- */
+-#ifndef __BEGIN_DECLS
+-#ifdef __cplusplus
+-#define __BEGIN_DECLS extern "C" {
+-#else
+-#define __BEGIN_DECLS
+-#endif
+-#endif
+-
+-#ifndef __END_DECLS
+-#ifdef __cplusplus
+-#define __END_DECLS }
+-#else
+-#define __END_DECLS
+-#endif
+-#endif
+ /**
+ * Define TRUE/FALSE
+ * defined in several header files
+diff -r 204cb68867f5 -r fbbc5e616bd0 media/webrtc/signaling/src/sdp/sipcc/cpr_string.h
+--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_string.h Sat Feb 07 09:22:26 2015 +0100
++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_string.h Sat Feb 07 11:18:52 2015 +0100
+@@ -10,7 +10,9 @@
+ #include "cpr_types.h"
+ #include "cpr_strings.h"
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * sstrncpy
+@@ -130,6 +132,8 @@
+ char *
+ cpr_strdup(const char *str);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
+diff -r 204cb68867f5 -r fbbc5e616bd0 media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h
+--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h Sat Feb 07 09:22:26 2015 +0100
++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_strings.h Sat Feb 07 11:18:52 2015 +0100
+@@ -7,8 +7,6 @@
+
+ #include "cpr_types.h"
+
+-__BEGIN_DECLS
+-
+
+ #include <string.h>
+
+@@ -25,6 +23,4 @@
+
+ #endif // _MSC_VER
+
+-__END_DECLS
+-
+ #endif
+diff -r 204cb68867f5 -r fbbc5e616bd0 media/webrtc/signaling/src/sdp/sipcc/cpr_types.h
+--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h Sat Feb 07 09:22:26 2015 +0100
++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_types.h Sat Feb 07 11:18:52 2015 +0100
+@@ -13,7 +13,9 @@
+ #include "cpr_darwin_types.h"
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /*
+ * CPR Return Codes
+@@ -114,6 +116,8 @@
+
+ typedef const char *string_t;
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
+diff -r 204cb68867f5 -r fbbc5e616bd0 media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h
+--- a/media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h Sat Feb 07 09:22:26 2015 +0100
++++ b/media/webrtc/signaling/src/sdp/sipcc/cpr_win_types.h Sat Feb 07 11:18:52 2015 +0100
+@@ -100,16 +100,5 @@
+ */
+ /* DONE defined in windef.h */
+
+-/*
+- * Define __BEGIN_DECLS and __END_DECLS
+- */
+-#ifdef __cplusplus
+-#define __BEGIN_DECLS extern "C" {
+-#define __END_DECLS }
+-#else
+-#define __BEGIN_DECLS
+-#define __END_DECLS
+-#endif
+-
+ #endif // _CPR_WIN_TYPES_H_
+
diff --git a/www-client/firefox/files/updater.patch b/www-client/firefox/files/updater.patch
new file mode 100644
index 00000000..e6852a36
--- /dev/null
+++ b/www-client/firefox/files/updater.patch
@@ -0,0 +1,42 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1428142217 -7200
+# Sat Apr 04 12:10:17 2015 +0200
+# Node ID c04cc88f3bb26e254356df6de06583a542ae6796
+# Parent 90adc073cbc6398f4fab9b1cd07b685368559f34
+updater: no fts.h and MAXNAMLEN
+
+diff -r 90adc073cbc6 -r c04cc88f3bb2 toolkit/mozapps/update/common/updatedefines.h
+--- a/toolkit/mozapps/update/common/updatedefines.h Thu Apr 02 08:10:00 2015 -0400
++++ b/toolkit/mozapps/update/common/updatedefines.h Sat Apr 04 12:10:17 2015 +0200
+@@ -109,7 +109,7 @@
+ # include <sys/wait.h>
+ # include <unistd.h>
+
+-#ifdef SOLARIS
++#if 1
+ # include <sys/stat.h>
+ #else
+ # include <fts.h>
+diff -r 90adc073cbc6 -r c04cc88f3bb2 toolkit/mozapps/update/updater/updater.cpp
+--- a/toolkit/mozapps/update/updater/updater.cpp Thu Apr 02 08:10:00 2015 -0400
++++ b/toolkit/mozapps/update/updater/updater.cpp Sat Apr 04 12:10:17 2015 +0200
+@@ -3338,7 +3338,8 @@
+ return rv;
+ }
+
+-#elif defined(SOLARIS)
++#elif 1
++//#defined(SOLARIS)
+ int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
+ {
+ int rv = OK;
+@@ -3346,7 +3347,7 @@
+ NS_tchar foundpath[MAXPATHLEN];
+ struct {
+ dirent dent_buffer;
+- char chars[MAXNAMLEN];
++ char chars[NAME_MAX];
+ } ent_buf;
+ struct dirent* ent;
+
diff --git a/www-client/firefox/files/xpcom-blocksize.patch b/www-client/firefox/files/xpcom-blocksize.patch
new file mode 100644
index 00000000..9e25ba91
--- /dev/null
+++ b/www-client/firefox/files/xpcom-blocksize.patch
@@ -0,0 +1,22 @@
+# HG changeset patch
+# User Felix Janda <felix.janda@posteo.de>
+# Date 1424989496 -3600
+# Thu Feb 26 23:24:56 2015 +0100
+# Node ID 6980ec675819ae01048026a1be510c64e069ffe3
+# Parent 490274146476bc459cc1a9ed9e0d3771a4fe7d57
+xpcom: Use dbtob instead of BLOCK_SIZE
+
+diff -r 490274146476 -r 6980ec675819 xpcom/io/nsLocalFileUnix.cpp
+--- a/xpcom/io/nsLocalFileUnix.cpp Thu Feb 26 22:58:09 2015 +0100
++++ b/xpcom/io/nsLocalFileUnix.cpp Thu Feb 26 23:24:56 2015 +0100
+@@ -1408,8 +1408,8 @@
+ && dq.dqb_bhardlimit) {
+ int64_t QuotaSpaceAvailable = 0;
+ // dqb_bhardlimit is count of BLOCK_SIZE blocks, dqb_curspace is bytes
+- if ((BLOCK_SIZE * dq.dqb_bhardlimit) > dq.dqb_curspace)
+- QuotaSpaceAvailable = int64_t(BLOCK_SIZE * dq.dqb_bhardlimit - dq.dqb_curspace);
++ if (dbtob(dq.dqb_bhardlimit) > dq.dqb_curspace)
++ QuotaSpaceAvailable = (dbtob(dq.dqb_bhardlimit) - dq.dqb_curspace);
+ if (QuotaSpaceAvailable < *aDiskSpaceAvailable) {
+ *aDiskSpaceAvailable = QuotaSpaceAvailable;
+ }
diff --git a/www-client/firefox/firefox-37.0.1-r99.ebuild b/www-client/firefox/firefox-37.0.1-r99.ebuild
new file mode 100644
index 00000000..03254dd4
--- /dev/null
+++ b/www-client/firefox/firefox-37.0.1-r99.ebuild
@@ -0,0 +1,421 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-37.0.1.ebuild,v 1.1 2015/04/05 23:07:55 polynomial-c Exp $
+
+EAPI="5"
+VIRTUALX_REQUIRED="pgo"
+WANT_AUTOCONF="2.1"
+MOZ_ESR=""
+
+# This list can be updated with scripts/get_langs.sh from the mozilla overlay
+# No official support as of fetch time
+# csb
+MOZ_LANGS=( af ar as ast be bg bn-BD bn-IN br bs ca cs cy da de el en
+en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd
+gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko lt lv mai mk ml mr
+nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te
+th tr uk vi xh zh-CN zh-TW )
+
+# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
+MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
+MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
+MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
+
+if [[ ${MOZ_ESR} == 1 ]]; then
+ # ESR releases have slightly version numbers
+ MOZ_PV="${MOZ_PV}esr"
+fi
+
+# Patch version
+PATCH="${PN}-36.0-patches-01"
+# Upstream ftp release URI that's used by mozlinguas.eclass
+# We don't use the http mirror because it deletes old tarballs.
+MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases"
+MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases"
+
+MOZCONFIG_OPTIONAL_WIFI=1
+MOZCONFIG_OPTIONAL_JIT="enabled"
+
+inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v5.36 multilib pax-utils fdo-mime autotools virtualx mozlinguas
+
+DESCRIPTION="Firefox Web Browser"
+HOMEPAGE="http://www.mozilla.com/firefox"
+
+KEYWORDS="~amd64 ~arm ~ppc ~x86"
+
+SLOT="0"
+LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
+IUSE="bindist hardened +minimal pgo selinux +gmp-autoupdate test"
+RESTRICT="!bindist? ( bindist )"
+
+# More URIs appended below...
+SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
+ http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz
+ http://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.xz"
+
+ASM_DEPEND=">=dev-lang/yasm-1.1"
+
+# Mesa 7.10 needed for WebGL + bugfixes
+RDEPEND="
+ >=dev-libs/nss-3.17.4
+ >=dev-libs/nspr-4.10.8
+ selinux? ( sec-policy/selinux-mozilla )"
+
+DEPEND="${RDEPEND}
+ pgo? (
+ >=sys-devel/gcc-4.5 )
+ amd64? ( ${ASM_DEPEND}
+ virtual/opengl )
+ x86? ( ${ASM_DEPEND}
+ virtual/opengl )"
+
+# No source releases for alpha|beta
+if [[ ${PV} =~ alpha ]]; then
+ CHANGESET="8a3042764de7"
+ SRC_URI="${SRC_URI}
+ http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
+ S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
+elif [[ ${PV} =~ beta ]]; then
+ S="${WORKDIR}/mozilla-beta"
+ SRC_URI="${SRC_URI}
+ ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
+ ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
+else
+ SRC_URI="${SRC_URI}
+ ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
+ ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
+ if [[ ${MOZ_ESR} == 1 ]]; then
+ S="${WORKDIR}/mozilla-esr${PV%%.*}"
+ else
+ S="${WORKDIR}/mozilla-release"
+ fi
+fi
+
+QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
+
+BUILD_OBJ_DIR="${S}/ff"
+
+pkg_setup() {
+ moz_pkgsetup
+
+ # Avoid PGO profiling problems due to enviroment leakage
+ # These should *always* be cleaned up anyway
+ unset DBUS_SESSION_BUS_ADDRESS \
+ DISPLAY \
+ ORBIT_SOCKETDIR \
+ SESSION_MANAGER \
+ XDG_SESSION_COOKIE \
+ XAUTHORITY
+
+ if ! use bindist; then
+ einfo
+ elog "You are enabling official branding. You may not redistribute this build"
+ elog "to any users on your network or the internet. Doing so puts yourself into"
+ elog "a legal problem with Mozilla Foundation"
+ elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
+ fi
+
+ if use pgo; then
+ einfo
+ ewarn "You will do a double build for profile guided optimization."
+ ewarn "This will result in your build taking at least twice as long as before."
+ fi
+}
+
+pkg_pretend() {
+ # Ensure we have enough disk space to compile
+ if use pgo || use debug || use test ; then
+ CHECKREQS_DISK_BUILD="8G"
+ else
+ CHECKREQS_DISK_BUILD="4G"
+ fi
+ check-reqs_pkg_setup
+}
+
+src_unpack() {
+ unpack ${A}
+
+ # Unpack language packs
+ mozlinguas_src_unpack
+}
+
+src_prepare() {
+ # Apply our patches
+ EPATCH_EXCLUDE="8002_jemalloc_configure_unbashify.patch" \
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}/firefox"
+
+ epatch "${FILESDIR}"/${PN}-35.0-gmp-clearkey-sprintf.patch
+ #epatch "${FILESDIR}"/${PN}-36.0-disable-ion.patch
+ #epatch "${FILESDIR}"/${PN}-36.0-depollute-CONST-from-dtoa.patch
+
+ ## patches for building with musl libc
+
+ # already upstream
+ epatch "${FILESDIR}"/1130164.patch
+ epatch "${FILESDIR}"/1130175.patch
+ epatch "${FILESDIR}"/sctp-36.patch # backported
+ epatch "${FILESDIR}"/1130710.patch
+
+ # others against hg
+ epatch "${FILESDIR}"/basename.patch
+ epatch "${FILESDIR}"/crashreporter.patch
+ epatch "${FILESDIR}"/fts.patch
+ epatch "${FILESDIR}"/libstagefright-cdefs.patch
+ epatch "${FILESDIR}"/profiler-gettid.patch
+ epatch "${FILESDIR}"/sandbox-cdefs.patch
+ epatch "${FILESDIR}"/updater.patch
+ epatch "${FILESDIR}"/xpcom-blocksize.patch
+ epatch "${FILESDIR}"/sipcc.patch
+
+ cp "${S}"/media/mtransport/third_party/nrappkit/src/port/generic/include/sys/queue.h "${S}"/media/mtransport/third_party/nrappkit/src/port/linux/include/sys
+
+ ## end of musl patching
+
+ # Allow user to apply any additional patches without modifing ebuild
+ epatch_user
+
+ # Enable gnomebreakpad
+ if use debug ; then
+ sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
+ "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
+ fi
+
+ # Ensure that our plugins dir is enabled as default
+ sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
+ sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
+
+ # Fix sandbox violations during make clean, bug 372817
+ sed -e "s:\(/no-such-file\):${T}\1:g" \
+ -i "${S}"/config/rules.mk \
+ -i "${S}"/nsprpub/configure{.in,} \
+ || die
+
+ # Don't exit with error when some libs are missing which we have in
+ # system.
+ sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
+ -i "${S}"/browser/installer/Makefile.in || die
+
+ # Don't error out when there's no files to be removed:
+ sed 's@\(xargs rm\)$@\1 -f@' \
+ -i "${S}"/toolkit/mozapps/installer/packager.mk || die
+
+ eautoreconf
+
+ # Must run autoconf in js/src
+ cd "${S}"/js/src || die
+ eautoconf
+
+ # Need to update jemalloc's configure
+ cd "${S}"/memory/jemalloc/src || die
+ WANT_AUTOCONF= eautoconf
+}
+
+src_configure() {
+ MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
+ MEXTENSIONS="default"
+ # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
+ # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
+ # get your own set of keys.
+ _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
+
+ ####################################
+ #
+ # mozconfig, CFLAGS and CXXFLAGS setup
+ #
+ ####################################
+
+ mozconfig_init
+ mozconfig_config
+
+ # It doesn't compile on alpha without this LDFLAGS
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ # Add full relro support for hardened
+ use hardened && append-ldflags "-Wl,-z,relro,-z,now"
+
+ # Setup api key for location services
+ echo -n "${_google_api_key}" > "${S}"/google-api-key
+ mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
+
+ mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
+ mozconfig_annotate '' --disable-mailnews
+
+ # Other ff-specific settings
+ mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
+
+ # mozjemalloc doesn't build on musl yet
+ mozconfig_annotate '' --disable-replace-malloc
+ mozconfig_annotate '' --disable-jemalloc
+
+ # Allow for a proper pgo build
+ if use pgo; then
+ echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
+ fi
+
+ echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
+
+ # Finalize and report settings
+ mozconfig_final
+
+ if [[ $(gcc-major-version) -lt 4 ]]; then
+ append-cxxflags -fno-stack-protector
+ elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
+ if use amd64 || use x86; then
+ append-flags -mno-avx
+ fi
+ fi
+}
+
+src_compile() {
+ if use pgo; then
+ addpredict /root
+ addpredict /etc/gconf
+ # Reset and cleanup environment variables used by GNOME/XDG
+ gnome2_environment_reset
+
+ # Firefox tries to use dri stuff when it's run, see bug 380283
+ shopt -s nullglob
+ cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
+ if test -z "${cards}"; then
+ cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
+ if test -n "${cards}"; then
+ # Binary drivers seem to cause access violations anyway, so
+ # let's use indirect rendering so that the device files aren't
+ # touched at all. See bug 394715.
+ export LIBGL_ALWAYS_INDIRECT=1
+ fi
+ fi
+ shopt -u nullglob
+ addpredict "${cards}"
+
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
+ Xemake -f client.mk profiledbuild || die "Xemake failed"
+ else
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
+ emake -f client.mk
+ fi
+
+}
+
+src_install() {
+ MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
+ DICTPATH="\"${EPREFIX}/usr/share/myspell\""
+
+ cd "${BUILD_OBJ_DIR}" || die
+
+ # Pax mark xpcshell for hardened support, only used for startupcache creation.
+ pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
+
+ # Add our default prefs for firefox
+ cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
+ "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
+ || die
+
+ # Set default path to search for dictionaries.
+ echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
+ >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
+ || die
+
+ echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
+ "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
+ || die
+
+ local plugin
+ use gmp-autoupdate || for plugin in \
+ gmp-gmpopenh264 ; do
+ echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
+ "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
+ || die
+ done
+
+ MOZ_MAKE_FLAGS="${MAKEOPTS}" \
+ emake DESTDIR="${D}" install
+
+ # Install language packs
+ mozlinguas_src_install
+
+ local size sizes icon_path icon name
+ if use bindist; then
+ sizes="16 32 48"
+ icon_path="${S}/browser/branding/aurora"
+ # Firefox's new rapid release cycle means no more codenames
+ # Let's just stick with this one...
+ icon="aurora"
+ name="Aurora"
+ else
+ sizes="16 22 24 32 256"
+ icon_path="${S}/browser/branding/official"
+ icon="${PN}"
+ name="Mozilla Firefox"
+ fi
+
+ # Install icons and .desktop for menu entry
+ for size in ${sizes}; do
+ insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
+ newins "${icon_path}/default${size}.png" "${icon}.png"
+ done
+ # The 128x128 icon has a different name
+ insinto "/usr/share/icons/hicolor/128x128/apps"
+ newins "${icon_path}/mozicon128.png" "${icon}.png"
+ # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
+ newicon "${icon_path}/content/icon48.png" "${icon}.png"
+ newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
+ sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
+ "${ED}/usr/share/applications/${PN}.desktop" || die
+
+ # Add StartupNotify=true bug 237317
+ if use startup-notification ; then
+ echo "StartupNotify=true"\
+ >> "${ED}/usr/share/applications/${PN}.desktop" \
+ || die
+ fi
+
+ # Required in order to use plugins and even run firefox on hardened.
+ if use jit; then
+ pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
+ else
+ pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
+ fi
+
+ if use minimal; then
+ rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
+ || die "Failed to remove sdk and headers"
+ fi
+
+ # very ugly hack to make firefox not sigbus on sparc
+ # FIXME: is this still needed??
+ use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
+ -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
+ || die "sparc sed failed"; }
+
+ # revdep-rebuild entry
+ insinto /etc/revdep-rebuild
+ echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10firefox
+ doins "${T}"/10${PN} || die
+
+ # workaround to make firefox find libmozalloc.so on musl
+ insinto /etc/env.d
+ echo "LDPATH=${MOZILLA_FIVE_HOME}" >> "${T}"/20firefox
+ doins "${T}"/20firefox || die
+}
+
+pkg_preinst() {
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ # Update mimedb for the new .desktop file
+ fdo-mime_desktop_database_update
+ gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ gnome2_icon_cache_update
+}
diff --git a/www-client/firefox/metadata.xml b/www-client/firefox/metadata.xml
new file mode 100644
index 00000000..10544e46
--- /dev/null
+++ b/www-client/firefox/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>mozilla</herd>
+<use>
+ <flag name="bindist">Disable official Firefox branding (icons, name) which
+ are not binary-redistributable according to upstream.</flag>
+ <flag name="custom-optimization">Fine-tune custom compiler
+ optimizations (-Os, -O0, -O1, -O2, -O3)</flag>
+ <flag name="gmp-autoupdate">Allow Gecko Media Plugins (binary blobs) to be automatically
+ downloaded and kept up-to-date in user profiles</flag>
+ <flag name="minimal"> Prevent sdk and headers from being installed</flag>
+ <flag name="pgo">Add support for profile-guided optimization using gcc-4.5,
+ for faster binaries. This option will double the compile time.</flag>
+ <flag name="system-cairo">Use the system-wide <pkg>x11-libs/cairo</pkg>
+ instead of bundled.</flag>
+ <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
+ instead of bundled.</flag>
+ <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg>
+ instead of bundled.</flag>
+ <flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg>
+ instead of bundled.</flag>
+ <flag name="system-sqlite">Use the system-wide <pkg>dev-db/sqlite</pkg>
+ installation with secure-delete enabled</flag>
+</use>
+</pkgmetadata>
diff --git a/www-misc/htdig/Manifest b/www-misc/htdig/Manifest
new file mode 100644
index 00000000..d58460e3
--- /dev/null
+++ b/www-misc/htdig/Manifest
@@ -0,0 +1,7 @@
+AUX 0001-remove_rresvport_usage_on_musl.patch 619 SHA256 6286ee4e20df336d4512216ecdef0a4bbe98d1b506490a06802b53d53d32ee09 SHA512 c50a4bab008ae713796324e5b6ab8b4013ea62168c3a0540662f5f5880033e40042fff943a177626226f7dc509ba4fc25184c94555c5d3d46d9c6510feb49bf7 WHIRLPOOL f8ed21100ae837aff91a7ba602d9a9e10c821b3fe05b8def313fab3c211149e3c2fe83ffe5004db2aff97b168f4af6b106c7de6c5f575d83c1a8d02f296581e0
+AUX htdig-3.2.0_beta6-as-needed.patch 2244 SHA256 3d0e74896a15f698532d4305f0a2257302ee0d275639b5f1d761cba51a6885fa SHA512 8b52aeb60be2cad7a5aadf02ed90044a67cba15d8fe3e3c3a715d99f2b6078d9f8c4dae145975ed0da8f4a973e46f91b5374422c1252cda4e84c6755e41015c4 WHIRLPOOL 81edca6c1d6bf415031fafde6b2cf9309f32eafdcb9c4c427e47e8b6f418e3147ab7ae9d24bd61f292a788d94c5200fa9f9492fc7123afe381f7d78630dc5e75
+AUX htdig-3.2.0_beta6-gcc4.patch 541 SHA256 729ea1d0fd415b5b144b2b95bba0575c4eef942f77adfbf54bb69e7da7dd58c3 SHA512 9acb44d1cbdbacbb0cb37d9c358e602cf5151bf06f3151da589c3697ddc2d13f576ca8fa7576b967369e8dbe7e41507f973aea60c4e7b99c447370fc0dcf7f5b WHIRLPOOL c01390007f0902619fbc1fbbbbb752ba77d20700ac75359a2cfb63dd18ddd004ffe85e2ef8c4c27f4007dd586cb23c2ceee503cb36a393573c7292a817ff881b
+AUX htdig-3.2.0_beta6-quoting.patch 1130 SHA256 d84222aa6895305c2ee87f9975bfc348a7872f63ee02a33e862b325f125b8109 SHA512 7edadb8cecb378eac8352e43ce12d5fa6af711f847f1e1ca0a49303daedffb1cef9795b74eb8cd64120e981c57c947f082f60d857985ee5ac0d54537fd6b4181 WHIRLPOOL f2be945441f52c0eba84153d5da1d403272f80dbdcc58fd8b3e300948a258839982bb08c51944251c4fe30926fc8de7f0ecc975f91f98d832687549739ab7b7e
+DIST htdig-3.2.0b6.tar.gz 3104936 SHA256 6da9e0ee8627d5302f5685a1b3e5de5f1e6e8df4c0a92c0ca00796bca9e546c8 SHA512 29832f4aebd2b1f944cc4d800a5202342c8ce66936980476d49f679ec169c0268a902e85cd7440a3b6bea9db0a3b640bb1a9719c680d857ff00d34590af63064 WHIRLPOOL 63b0635873a24ad84c62fb85b6f9e645b3166630a4db52948604e6179f5f41978ef3c1b663122e8e5b74173c2e1cad269d4d92c5e678dcaf4dbac06d6b930cf3
+EBUILD htdig-3.2.0_beta6-r99.ebuild 1894 SHA256 8b259a96d9b2528d02bf9700451cb300b30af0a6ba7c208e0781389d429d4cec SHA512 140f3aa55ea9a9ec73a65639000575549bfd4303e39511b3a90ee67416c20bda0e6070849e95ff73844b9522afc2c4824b8297add50682be14fc2cf99a50ad33 WHIRLPOOL 844f79ba428a98184884c02e74801a13c3348f697ae8d6733b1261d7350e6212df1d5447c4952a2328cb420a5718706546588e35880999019c75f13701b1e814
+MISC metadata.xml 161 SHA256 9cd891fcf0af580e98b62d2f4ded9e53671599f5a7aafd5dce692b996d2a83f4 SHA512 da8733f12ac4bebcfa485138fd9880683c1196efc0312a588ffce412ed14c1dd831e005129b6598d027af44d381fceb844453a433d0c982348e21f2d9c49f52e WHIRLPOOL 2b56ebef4f0870596c32c35c96e6dfbc911f6a3d8fe0e8c463df76dfa73dde112948c814b9a9ee996b7d71a85e4a723033ee3b92f4cde0f31d0770404d7dba61
diff --git a/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch b/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch
new file mode 100644
index 00000000..ba9fab04
--- /dev/null
+++ b/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch
@@ -0,0 +1,20 @@
+--- htnet/Connection.cc.orig 2014-12-27 13:40:45.961149583 +0000
++++ htnet/Connection.cc 2014-12-27 13:45:45.967149583 +0000
+@@ -64,7 +64,7 @@
+
+ typedef void (*SIGNAL_HANDLER) (...);
+
+-#ifndef _MSC_VER /* _WIN32 */
++#if ! defined(_MSC_VER) && (defined(__GLIBC__) || defined(__UCLIBC__))
+ extern "C" {
+ int rresvport(int *);
+ }
+@@ -162,7 +162,7 @@ int Connection::Open(int priv)
+ int aport = IPPORT_RESERVED - 1;
+
+ // Native Windows (MSVC) has no rresvport
+-#ifndef _MSC_VER /* _WIN32 */
++#if ! defined(_MSC_VER) && (defined(__GLIBC__) || defined(__UCLIBC__))
+ sock = rresvport(&aport);
+ #else
+ return NOTOK;
diff --git a/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch b/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch
new file mode 100644
index 00000000..bf455ea8
--- /dev/null
+++ b/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch
@@ -0,0 +1,61 @@
+--- htdig-3.2.0b6/Makefile.config.orig 2006-11-19 08:49:57.000000000 -0800
++++ htdig-3.2.0b6/Makefile.config 2006-11-19 08:51:19.000000000 -0800
+@@ -22,10 +22,7 @@
+ $(LOCAL_DEFINES) $(PROFILING)
+
+ HTLIBS= $(top_builddir)/htnet/libhtnet.la \
+- $(top_builddir)/htcommon/libcommon.la \
+- $(top_builddir)/htword/libhtword.la \
+ $(top_builddir)/htlib/libht.la \
+ $(top_builddir)/htcommon/libcommon.la \
+ $(top_builddir)/htword/libhtword.la \
+- $(top_builddir)/db/libhtdb.la \
+- $(top_builddir)/htlib/libht.la
++ $(top_builddir)/db/libhtdb.la
+--- htdig-3.2.0b6/htlib/Makefile.am.orig 2006-11-19 09:13:47.000000000 -0800
++++ htdig-3.2.0b6/htlib/Makefile.am 2006-11-19 09:17:50.000000000 -0800
+@@ -1,7 +1,8 @@
+ include $(top_srcdir)/Makefile.config
+
+ pkglib_LTLIBRARIES = libht.la
+-
++libht_la_DEPENDENCIES = $(top_builddir)/db/libhtdb.la
++libht_la_LIBADD= $(top_builddir)/db/libhtdb.la
+ libht_la_SOURCES = Configuration.cc Database.cc Dictionary.cc \
+ DB2_db.cc IntObject.cc List.cc Object.cc \
+ ParsedString.cc Queue.cc QuotedStringList.cc Stack.cc \
+@@ -17,9 +18,6 @@
+ myqsort.c \
+ md5.cc mhash_md5.c
+
+-libht_la_LIBADD=@LTLIBOBJS@
+-# this includes regex.c
+-
+ libht_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags}
+
+ pkginclude_HEADERS = \
+--- htdig-3.2.0b6/htword/Makefile.am.orig 2006-11-19 08:55:08.000000000 -0800
++++ htdig-3.2.0b6/htword/Makefile.am 2006-11-19 08:56:51.000000000 -0800
+@@ -10,7 +10,8 @@
+ LOCAL_DEFINES =
+
+ pkglib_LTLIBRARIES = libhtword.la
+-
++libhtword_la_DEPENDENCIES = $(top_builddir)/htlib/libht.la
++libhtword_la_LIBADD = $(top_builddir)/htlib/libht.la
+ libhtword_la_SOURCES = \
+ WordBitCompress.cc \
+ WordContext.cc \
+
+--- htdig-3.2.0b6/htcommon/Makefile.am.orig 2006-11-19 09:32:39.000000000 -0800
++++ htdig-3.2.0b6/htcommon/Makefile.am 2006-11-19 09:33:42.000000000 -0800
+@@ -12,7 +12,8 @@
+ EXTRA_DIST=conf_lexer.cxx conf_parser.cxx
+
+ pkglib_LTLIBRARIES = libcommon.la
+-
++libcommon_la_DEPENDENCIES = $(top_builddir)/htword/libhtword.la
++libcommon_la_LIBADD = $(top_builddir)/htword/libhtword.la
+ libcommon_la_SOURCES = DocumentDB.cc DocumentRef.cc \
+ HtWordReference.cc HtWordList.cc defaults.cc \
+ HtURLCodec.cc URL.cc URLTrans.cc \
diff --git a/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch b/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch
new file mode 100644
index 00000000..58dec139
--- /dev/null
+++ b/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch
@@ -0,0 +1,15 @@
+diff -Naurp htdig-3.2.0b6.orig/htsearch/Collection.h htdig-3.2.0b6/htsearch/Collection.h
+--- htdig-3.2.0b6.orig/htsearch/Collection.h 2004-05-28 06:15:24.000000000 -0700
++++ htdig-3.2.0b6/htsearch/Collection.h 2006-03-22 11:35:40.000000000 -0800
+@@ -36,9 +36,9 @@ public:
+ const char *docExcerpt);
+ ~Collection();
+
+- void Collection::Open();
++ void Open();
+
+- void Collection::Close();
++ void Close();
+
+ char *getWordFile() { return wordFile.get(); }
+ DocumentRef *getDocumentRef(int id);
diff --git a/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch b/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch
new file mode 100644
index 00000000..57b0e3b7
--- /dev/null
+++ b/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch
@@ -0,0 +1,26 @@
+Index: htdig-3.2.0b6/htsearch/Display.cc
+===================================================================
+--- htdig-3.2.0b6.orig/htsearch/Display.cc
++++ htdig-3.2.0b6/htsearch/Display.cc
+@@ -137,7 +137,7 @@ Display::display(int pageNumber)
+ // Must temporarily stash the message in a String, since
+ // displaySyntaxError will overwrite the static temp used in form.
+
+- String s(form("No such sort method: `%s'", (const char*)config->Find("sort")));
++ String s("invalid sort method");
+
+ displaySyntaxError(s);
+ return;
+Index: htdig-3.2.0b6/libhtdig/ResultFetch.cc
+===================================================================
+--- htdig-3.2.0b6.orig/libhtdig/ResultFetch.cc
++++ htdig-3.2.0b6/libhtdig/ResultFetch.cc
+@@ -142,7 +142,7 @@ ResultFetch::fetch()
+ // Must temporarily stash the message in a String, since
+ // displaySyntaxError will overwrite the static temp used in form.
+
+- String s(form("No such sort method: `%s'", (const char *) config->Find("sort")));
++ String s("invalid sort method");
+
+ displaySyntaxError(s);
+ //return;
diff --git a/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild b/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild
new file mode 100644
index 00000000..2c09cf5b
--- /dev/null
+++ b/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-misc/htdig/htdig-3.2.0_beta6-r3.ebuild,v 1.12 2013/05/02 04:13:35 patrick Exp $
+
+inherit eutils autotools
+
+MY_PV=${PV/_beta/b}
+S=${WORKDIR}/${PN}-${MY_PV}
+
+DESCRIPTION="HTTP/HTML indexing and searching system"
+HOMEPAGE="http://www.htdig.org"
+SRC_URI="http://www.htdig.org/files/${PN}-${MY_PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="ssl"
+
+DEPEND=">=sys-libs/zlib-1.1.3
+ app-arch/unzip
+ ssl? ( dev-libs/openssl )"
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-gcc4.patch
+ epatch "${FILESDIR}"/${P}-as-needed.patch
+ epatch "${FILESDIR}"/${P}-quoting.patch
+ epatch "${FILESDIR}"/0001-remove_rresvport_usage_on_musl.patch
+ epatch_user
+ sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.in db/configure.in || die
+ eautoreconf
+}
+
+src_compile() {
+ use prefix || EPREFIX=
+
+ econf \
+ --with-config-dir="${EPREFIX}"/etc/${PN} \
+ --with-default-config-file="${EPREFIX}"/etc/${PN}/${PN}.conf \
+ --with-database-dir="${EPREFIX}"/var/lib/${PN}/db \
+ --with-cgi-bin-dir="${EPREFIX}"/var/www/localhost/cgi-bin \
+ --with-search-dir="${EPREFIX}"/var/www/localhost/htdocs/${PN} \
+ --with-image-dir="${EPREFIX}"/var/www/localhost/htdocs/${PN} \
+ $(use_with ssl)
+
+# --with-image-url-prefix="file://${EPREFIX}/var/www/localhost/htdocs/${PN}" \
+
+ emake || die "emake failed"
+}
+
+src_install () {
+ use prefix || ED="${D}"
+
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ dodoc ChangeLog README
+ dohtml -r htdoc
+
+ sed -i "s:${D}::g" \
+ "${ED}"/etc/${PN}/${PN}.conf \
+ "${ED}"/usr/bin/rundig \
+ || die "sed failed (removing \${D} from installed files)"
+
+ # symlink htsearch so it can be easily found. see bug #62087
+ dosym ../../var/www/localhost/cgi-bin/htsearch /usr/bin/htsearch
+}
diff --git a/www-misc/htdig/metadata.xml b/www-misc/htdig/metadata.xml
new file mode 100644
index 00000000..95c06f00
--- /dev/null
+++ b/www-misc/htdig/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>web-apps</herd>
+</pkgmetadata>
diff --git a/x11-apps/sessreg/Manifest b/x11-apps/sessreg/Manifest
new file mode 100644
index 00000000..4e3fd88c
--- /dev/null
+++ b/x11-apps/sessreg/Manifest
@@ -0,0 +1,4 @@
+AUX sessreg-1.0.8-missing_path_wtmpx.patch 349 SHA256 8d13a6ae41492cdc4afd38691f45792e8000b129f34e94cf83a30435c4686b29 SHA512 ab562bba2463d8f7ede6ed90fafdd685a33596ef47f118eefa2312f38e34d1ba18bd0c383dfe778327b126e0c80dc12045cb27d49eab09162ebacea6ab98b522 WHIRLPOOL 0331bf6a7f1204f06d16a0c96729d623dd403d7b889d5597adede150f090b1d7220b425abe003cdc6c528b7847883a5328907c081caafb740c891649d8a1ae78
+DIST sessreg-1.0.8.tar.bz2 126979 SHA256 0e2accc6272fcc2321aef7370f4ccf0df0fe259b2e942938264e2aaedee6c4c3 SHA512 aecf6def3d1b5981aacb1be393867bf3b841234be54499e77bd3cd61281d8a4479a52f95d27f3cbfae1dafe7cd295bbf6c0594fc5180cfaca0dd1b4dd3f314bd WHIRLPOOL a4a28a46d097f0151f5391faee26b98b22a439813bb8b015d1151edbd7ff2ed97be21053f62a4a39e4b47294d79df35c364753bab2a1ba4391c1f93a3ed5cea7
+EBUILD sessreg-1.0.8-r99.ebuild 473 SHA256 588c533f50cd7fc76558dac1d44fd78f9403b9df4f9664cadabfbdd70d4d8366 SHA512 7417eaaeb9140b4cc92e2569751d7540fb26aeeaf2c5ba09cba91fdd16e32d3317e7c1ea1a8deebc15e22b6b060c1eb7b558b8db72858b40a46f3cef5d4561f7 WHIRLPOOL 8367c5110b5093c1df32d3207a948273c5564ab4e5fa99972f23ab034ad8873082543531ac1bc2a64a85a85a625e1a3e8057c414bd83931afa50275a85e54501
+MISC metadata.xml 156 SHA256 5101ab0d4cc8c7125eea733c44e86962769bd77acaf53b69223b9cadcdd29055 SHA512 daa9bb2a9b1a16220327bc394f10d93a1a8a427bfbed8808cd247c1dfd5a5b87a4945d55d8243e07fede2c8182a208c618ebd483773d77e9d23862ec77016019 WHIRLPOOL 691e028648bb8b60771d74ef718c51fdb0f4a587e984f6ac4c13d7796415ecf770df2e0fd766399091771924bb65995e9bb290baa35971c56e07d76f2bbf6d93
diff --git a/x11-apps/sessreg/files/sessreg-1.0.8-missing_path_wtmpx.patch b/x11-apps/sessreg/files/sessreg-1.0.8-missing_path_wtmpx.patch
new file mode 100644
index 00000000..dac21245
--- /dev/null
+++ b/x11-apps/sessreg/files/sessreg-1.0.8-missing_path_wtmpx.patch
@@ -0,0 +1,12 @@
+diff -Naur sessreg-1.0.8.orig/sessreg.h sessreg-1.0.8/sessreg.h
+--- sessreg-1.0.8.orig/sessreg.h 2013-02-10 21:43:50.000000000 -0500
++++ sessreg-1.0.8/sessreg.h 2014-06-18 10:02:17.769459663 -0400
+@@ -106,3 +106,8 @@
+ #ifndef UTMPX_FILE
+ # define UTMPX_FILE _PATH_UTMPX
+ #endif
++
++#ifndef _PATH_WTMPX
++# define _PATH_WTMPX "/var/log/wtmp"
++#endif
++
diff --git a/x11-apps/sessreg/metadata.xml b/x11-apps/sessreg/metadata.xml
new file mode 100644
index 00000000..01c4c004
--- /dev/null
+++ b/x11-apps/sessreg/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>x11</herd>
+</pkgmetadata>
diff --git a/x11-apps/sessreg/sessreg-1.0.8-r99.ebuild b/x11-apps/sessreg/sessreg-1.0.8-r99.ebuild
new file mode 100644
index 00000000..7bb22c7f
--- /dev/null
+++ b/x11-apps/sessreg/sessreg-1.0.8-r99.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-apps/sessreg/sessreg-1.0.8.ebuild,v 1.10 2013/10/08 05:02:56 ago Exp $
+
+EAPI=5
+inherit eutils xorg-2
+
+DESCRIPTION="manage utmp/wtmp entries for non-init clients"
+
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ x11-proto/xproto"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-missing_path_wtmpx.patch
+}
diff --git a/x11-base/xorg-server/Manifest b/x11-base/xorg-server/Manifest
new file mode 100644
index 00000000..0bd0d48b
--- /dev/null
+++ b/x11-base/xorg-server/Manifest
@@ -0,0 +1,21 @@
+AUX xdm-setup.initd-1 346 SHA256 942ce5e8d1a0770543b683dcc388bae7619a24eb9741c1cd678ed3df97c01406 SHA512 b12ef1a757213c2df2d4fb50691695fdaf00ee9edb7d4ec551980c48b6eb05598d3eda0db543719a11a82b019939fb4af82a19813d238a725dcc0d818379103e WHIRLPOOL 28a033355ec3871eba2dfdf45969e9ac354d8ae542dcb1449901af856b9c26314318f6a91cec81f2548caaede19d88e14eac2de0fd7dab8957a7358e94a594b2
+AUX xdm.confd-4 562 SHA256 9d26b72bb28611a60a6b9f942b8d8cfe47b59f926be89af9709b5912668344d8 SHA512 facfb91c0b4e0b1cae86b707d263523215633720e1e8f4595639411f936907b321643e8a06111dd3f7b74fa601476e4b0d09768edfdec762c73fa07cb227588b WHIRLPOOL d701fb5f40ecde2b2f2bb56970576c8abde1499916168fee4a6d27afbc1c0493eb17ddd1a8ee70bfbc77d553a47e219e538febada4946d19cccbdabc90f40e6f
+AUX xdm.initd-10 6032 SHA256 85e5778e23748c6a6285fdadaeb18e6c04b3fdf98d2a81f0ab9d854dbac8076c SHA512 60656a77800a773f5e05e4725e62c2a666a4635192f0fa4f51dd27b31e743dac6ed3b2eeef4de271df3a0863b1e1c59d99755987a88c8bdb9542911266dd3bc7 WHIRLPOOL 8d2b389b74e45963fcfb98faefe1297d1f8ba2b7d03f243cc9555635073c599c4367e2d54a0081dcfc24964d3045f539f0c88ad22b6f76a517ef326e24957a71
+AUX xdm.initd-11 6136 SHA256 86a17c9ba172481318d5fd51c3aadfdcad9e5d52ed7478379723ce1784061930 SHA512 6ebd1d4aa538c4de0591348e2befe0d03da2014863208ce52dbe9966e069908adcd5efd5b8ed01cfa3bd3c84121e91494e6d82e1cf96acac2ab0b03a2961dfae WHIRLPOOL 16c6f69008c28f3fc2b84e7257e75df578308ed4a4a537600c43d7a6d372c64a3d8f9e8f1a59c2d8106e1bee9a87694d06f3d1f777d132a19544b747e745473d
+AUX xorg-server-1.12-cve-2013-4396.patch 2807 SHA256 11707d59d550a9f0b04f0ca3dba1668c7f848a4e8a4cea7a6ae01c665bd11fe9 SHA512 9c8fea712e7ad727390052fd6a717c00e6d16eecaee23153b21870b82772a67c841d9ae48573cf4f8adfc101c948ed25e454ce420226ca991a3c671ecdefa209 WHIRLPOOL 932cba6b4641156de7a56fa977fd39dcf171015e21d196de588694e31cb0fa1d9928b17a3ac81568581c6f722be252ca09125eb08a9f088d5550e205dd09cb42
+AUX xorg-server-1.12-disable-acpi.patch 275 SHA256 1d3878d44e2b8690bb7d1595960d06acee7f86a6a4724236a09a74900404e953 SHA512 ca52ce0931819acf46a066116b8485c3a398a56d79826a5cdb2b3b8c7809e5163e17a5954de370805dc51a3be3c75a0333d5c17c30bf99139105d705de2fff95 WHIRLPOOL 048be09bad947a5ef02d5935534c47d08439f0ceccddcdb017908bf73aa0484a69b0e42e8e6630393323305b31a8008ef8a0f4655556082245bc5fcde254aa5b
+AUX xorg-server-1.12-ia64-fix_inx_outx.patch 1737 SHA256 bf996a01faf3d1e6f00f12b17373a2530e7e433d3e6c4cac8935ebddc91cd089 SHA512 18bf9bbb973ae4e3f95ffafca8f82845f0c318c3b2dbf0cf9089a2614215ecf000b9037bfed7d80d9367be01247bf316ba2f6e16aa04fe79c54d81441c962bcd WHIRLPOOL cd133d58fc74de9d49773fe2a570d023cea38d09d7550fb9097a8c83a8393e8fc829ffaac566eee732475410e5d8063d0f99d437a68a67e8d3f65d012522240e
+AUX xorg-server-1.12-unloadsubmodule.patch 1373 SHA256 c68c4c0749b9229c3ca11c72b5ca98b58c7dbaf5c7311ce45890204bdc637c3c SHA512 a6a8ebbb1005f2ea9cfdfc928209a23fe213caab31a889c3290f14bcae0a9afd40176330e2e56cb5ff986d522505e7fb98fa0c71187f403e2afd33c9c919780e WHIRLPOOL 7e9dce7dc4e064567e68697a2966f87cef756670db7e49da50c8d9a5379d7930c3f9642913b8482b8c7597067ef9098e1989284986b5ec605aca6a536329c05c
+AUX xorg-server-1.14.3-musl.patch 916 SHA256 aa3d44a6b21a7991eb730d5ddf345e8ab9cf2a319648576b30a1cf5be2621fd1 SHA512 06bc6860c6fc5508c3e7458f2a6061ad02e893d0ba6303423fe76d12b223ef609f225383da891ecbaf448d9ba82bad94f33d5854763b467c1845588fbbbafcb2 WHIRLPOOL 52e957f34a738fe79eb54707252642ee2a748fc10655a02d6998f5f93380766082a772f1de91d8c65042421329af70a9057580dd5f521edec48516ba58803793
+AUX xorg-server-disable-acpi.patch 663 SHA256 5b3cc7c8bea18fe3ba81851d2846d19ffd8fab9cdf5d8f3a274846847e734200 SHA512 0f741e3dac610ba75c3f22cb9412d93e6d8422216100bce886be5f8d6dc49a94e0dab525039247d7af668f162b02fdab302aeb55b02a949ebf56c1f455fa68cf WHIRLPOOL 69e7425e3fbb1154b64568261ab17dc513d561a0d92558fad4e1281869b43132892f14eb89443dc11003cc62bacb4a80f86f592d9dc4bdd873f29fd970c25558
+AUX xorg-sets.conf 199 SHA256 1201d0337ac69d9715f4454a86dfb8a7bd1ae6f4c2578042fc08f283a997597c SHA512 910fe28f20909243044f079ff35136942b8790f4f28ac42ffc64a76b7f03cd22057087fa5e4e01192080b52c0d89000ea96d5a807c6f11f680d3f43312c5be41 WHIRLPOOL 4acac88e1688ea71df59a86a8a188b5369ad05f61e1369cd620eecd754511578e961a537ff6d0b22156f671d3485289cbc941dfe83bea24a27329b7bebb46c7d
+DIST xorg-server-1.14.3.tar.bz2 5502845 SHA256 02125ae13a443dcbb55f964d5c37f1da2f58ad54c2102356037bec23c1b84f5e SHA512 d5379e2f52e93985ab2636ca02f503baadd359a4ec05bed80162213392e16d433a2b7308e90cdd18c1a0bd283429f2c8b8758b5a2c585923533cced6245de989 WHIRLPOOL 241feac891f48bdc7470891d54abec0e13921cc127898b083665778ab87920d2bf10088536ac05b9db200cc2cc8b002307873786223995624aa70098370ba183
+DIST xorg-server-1.15.0.tar.bz2 5546579 SHA256 613b2f2e7ee2a06d2f8e862c836dc70d319c52f1537749e027398f40086aabb8 SHA512 7bf6a9eff9cc606defbaa46600a4d7b41896f4304e06af745a2717687853c7e92b191481f1f4d6d98ef0adfe5f404c9e3997ebd98553c60b626cd1bb53c58d9d WHIRLPOOL 905d3b47938e5e5604b04953f11ec7acee9298d6f32570612d6301ac71b0c5a49e774267b627957b7a6a94f6b9bf211c9ed6b7102f389a2120a40bd45502a6d7
+DIST xorg-server-1.15.2.tar.bz2 5551426 SHA256 3c0585607c654ded836da43a45a75492fc13454ff4149704fb08dac39f051163 SHA512 5fcbf0012af309f80e1db206e05d7861796146d765cd17f3963fde6da7f43f0e57d63dbbdbf2c554612a557aa4dee623ef62f7ca7d007834aafd7a46ca7bb1d6 WHIRLPOOL 22cdbad68462f9bac32b13be958df496411ca72fe47435ec7e3ebb470b121ba4b4a0e023913f31a92113c5a56bc4be660dfec5086bc1fb72a617d2cdeaa8adf1
+DIST xorg-server-1.16-cve-2014-8091..8103.patches.tar.xz 27892 SHA256 47d8c9bb79c829389e7599aef1110d43afbc5bf744dbcf73d8f3cf01796d287a SHA512 f8b55c009166883b3e6ec2c8c7a2ff4ed61df6970afcc4f0efb9efa36741af194456a368d4b1c7ba9345ef973fb139a48eb50cb5a7ebc144b43749b9ffdb1f7b WHIRLPOOL 2f8b26c018f4ad4cf780ed7dcb0b844de64e7a612adc30c622d1956dfcee710086ffcc837ff0a64cdcc14d47720d82d8797374488bf0b52d77ca63adf6806885
+DIST xorg-server-1.16.4.tar.bz2 5817330 SHA256 abb6e1cc9213a9915a121f48576ff6739a0b8cdb3d32796f9a7743c9a6efc871 SHA512 f756fca65535aa921a85d8d8eb36ea2ba5b7af90a46d640b0ca76259a9abd9d323885087e11156528d95240937c70373045001ae20266a1b9e89909f007e9e74 WHIRLPOOL 63980a3e2b57d2860998344f21a6524598b3dc135c277e5a868e34b57ab5060681ae7137358b3ba8b9ca5fd622a91aeb06bd0ac9e3e5ce1f4dc55df2b2dc0e33
+EBUILD xorg-server-1.14.3-r99.ebuild 7111 SHA256 84af670927a261634d150bbd7f26e5f48030b906ea9e9c5e7a861cf8b52124ff SHA512 802bdc43901090fc0c7f7d819e8c6e193dd7c98760b3e1592162949f225dbb5b980d844de6cb830bc027315a8d66a7fabb5a58d5455eaf8982302d302084cb4d WHIRLPOOL 91bbd8b0d4bdcf62a20b1011973ffacc50b56d725d7c0fcd4f1fc2f7881a6f91d5a68b11d6561d61f76d532804556ece6ed05b4fe51cf5acfef264ccec3c848d
+EBUILD xorg-server-1.15.0-r99.ebuild 7174 SHA256 5d8423c3ae2943ed5f328c0d62d01c66099bf9be78747f11e1538f74b054cff5 SHA512 888c4f761fa1848f1b29dc868338734293cc35014f5e0d2e9f55ba3fcd5a88a2fbe7eee01872b259cdc6007dfa5cd02ea6ad5b8c35996d855c53834d85307efd WHIRLPOOL 3d34906797e818365d7779a05b0d55967223fd54976770450d9695562f92e3c6262103b17a94f8451d238c55fe18a85e188cba9597ed583a91269361d57ab838
+EBUILD xorg-server-1.15.2-r99.ebuild 7170 SHA256 7b83ea772b71be326d101db94ce6328b4ba67820fe09460a005d12d87f800b31 SHA512 ffab1e674f018a0958bf990a6da32efae442e643ec5dece2c1f7ce4867c465d81cd3da184039904859b6ae401a0062d925a8442fc422def5a5797d55aa85479e WHIRLPOOL ae73abf3aaffcd04509fab742cf0f609de49772f42d6c4e3e1ce14e0092679e01c224a29841aa763ef6be338910ae46fdba2e05ffac95bfe49e19ec9f39964ac
+EBUILD xorg-server-1.16.4-r99.ebuild 6876 SHA256 0739d3d91dbb842561047e565a8178a5f919e305eeefd07537a512f2379048bb SHA512 ac798c226406c6166c95c52a669b96861a62226ffc0152b553419d527f186bbc37971d405a38ac80a28f300d8a8f9c71929b9522098b4a3d989b920c637b316c WHIRLPOOL 4bdb8a87dac5693d0e8ad840bf156043286dde1feda2ce52133b5fd8a2c326cb3c89b3adfe4ceb6896895692e5d5039b9fdaf95f090b53700eb08b377c6489c6
+MISC metadata.xml 686 SHA256 70ff076fe4097092f7d5a5515d4706a79123d4d1aa84a92e3c6a798b1ed7d4de SHA512 b2e7ae9a2d062939bfb92b5628cd239f961bf4e646ec18aad9588abc481d6a3710d73a17cd398a7d8fbc699ef66ee427c3e40c3aeba64df1760e2fd793b07596 WHIRLPOOL 4d0b9f2bcfc75dcf2d8a56e7ffa9dbdac33a154033f45b0e66ccd46a091fa8f7c47bf982100a502fb7d4131df0435824a88bd81bd1791e7d9c48ef37cbca82ae
diff --git a/x11-base/xorg-server/files/xdm-setup.initd-1 b/x11-base/xorg-server/files/xdm-setup.initd-1
new file mode 100644
index 00000000..365664e6
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm-setup.initd-1
@@ -0,0 +1,14 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/files/xdm-setup.initd-1,v 1.1 2010/04/13 10:07:39 scarabeus Exp $
+
+depend() {
+ need localmount
+}
+
+start() {
+ if get_bootparam "nox" ; then
+ touch /etc/.noxdm
+ fi
+}
diff --git a/x11-base/xorg-server/files/xdm.confd-4 b/x11-base/xorg-server/files/xdm.confd-4
new file mode 100644
index 00000000..c82fece0
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.confd-4
@@ -0,0 +1,10 @@
+# We always try and start X on a static VT. The various DMs normally default
+# to using VT7. If you wish to use the xdm init script, then you should ensure
+# that the VT checked is the same VT your DM wants to use. We do this check to
+# ensure that you haven't accidentally configured something to run on the VT
+# in your /etc/inittab file so that you don't get a dead keyboard.
+CHECKVT=7
+
+# What display manager do you use ? [ xdm | gdm | kdm | gpe | entrance ]
+# NOTE: If this is set in /etc/rc.conf, that setting will override this one.
+DISPLAYMANAGER="xdm"
diff --git a/x11-base/xorg-server/files/xdm.initd-10 b/x11-base/xorg-server/files/xdm.initd-10
new file mode 100644
index 00000000..9826e6bb
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.initd-10
@@ -0,0 +1,226 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/files/xdm.initd-10,v 1.1 2013/09/26 15:23:33 axs Exp $
+
+# This is here to serve as a note to myself, and future developers.
+#
+# Any Display manager (gdm,kdm,xdm) has the following problem: if
+# it is started before any getty, and no vt is specified, it will
+# usually run on vt2. When the getty on vt2 then starts, and the
+# DM is already started, the getty will take control of the keyboard,
+# leaving us with a "dead" keyboard.
+#
+# Resolution: add the following line to /etc/inittab
+#
+# x:a:once:/etc/X11/startDM.sh
+#
+# and have /etc/X11/startDM.sh start the DM in daemon mode if
+# a lock is present (with the info of what DM should be started),
+# else just fall through.
+#
+# How this basically works, is the "a" runlevel is a additional
+# runlevel that you can use to fork processes with init, but the
+# runlevel never gets changed to this runlevel. Along with the "a"
+# runlevel, the "once" key word means that startDM.sh will only be
+# run when we specify it to run, thus eliminating respawning
+# startDM.sh when "xdm" is not added to the default runlevel, as was
+# done previously.
+#
+# This script then just calls "telinit a", and init will run
+# /etc/X11/startDM.sh after the current runlevel completes (this
+# script should only be added to the actual runlevel the user is
+# using).
+#
+# Martin Schlemmer
+# aka Azarah
+# 04 March 2002
+
+depend() {
+ need localmount xdm-setup
+
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+ # (#139824) Start after ypbind and autofs for network authentication
+ # (#145219 #180163) Could use lirc mouse as input device
+ # (#70689 comment #92) Start after consolefont to avoid display corruption
+ # (#291269) Start after quota, since some dm need readable home
+ # (#390609) gdm-3 will fail when dbus is not running
+ # (#366753) starting keymaps after X causes problems
+ after bootmisc consolefont modules netmount
+ after readahead-list ypbind autofs openvpn gpm lircmd
+ after quota keymaps
+ before alsasound
+
+ # Start before X
+ use consolekit dbus xfs
+}
+
+setup_dm() {
+ local MY_XDM
+
+ MY_XDM=$(echo "${DISPLAYMANAGER}" | tr '[:upper:]' '[:lower:]')
+
+ # Load our root path from profile.env
+ # Needed for kdm
+ PATH=${PATH}:$(. /etc/profile.env; echo "${ROOTPATH}")
+
+ NAME=
+ case "${MY_XDM}" in
+ kdm|kde)
+ EXE=/usr/bin/kdm
+ PIDFILE=/run/kdm.pid
+ ;;
+ entrance*)
+ EXE=/usr/sbin/entrance
+ PIDFILE=/run/entrance.pid
+ ;;
+ gdm|gnome)
+ # gdm-3 and above has different paths
+ if [ -f /usr/sbin/gdm ]; then
+ EXE=/usr/sbin/gdm
+ PIDFILE=/run/gdm/gdm.pid
+ START_STOP_ARGS="--background"
+ AUTOCLEAN_CGROUP="yes"
+ else
+ EXE=/usr/bin/gdm
+ PIDFILE=/run/gdm.pid
+ fi
+ [ "${RC_UNAME}" != "Linux" ] && NAME=gdm-binary
+ ;;
+ wdm)
+ EXE=/usr/bin/wdm
+ PIDFILE=
+ ;;
+ gpe)
+ EXE=/usr/bin/gpe-dm
+ PIDFILE=/run/gpe-dm.pid
+ ;;
+ lxdm)
+ EXE=/usr/sbin/lxdm-binary
+ PIDFILE=/run/lxdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ lightdm)
+ EXE=/usr/sbin/lightdm
+ PIDFILE=/run/lightdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ *)
+ # first find out if there is such executable
+ EXE="$(command -v ${MY_XDM} 2>/dev/null)"
+ PIDFILE="/run/${MY_XDM}.pid"
+
+ # warn user that he is doing sick things if the exe was not found
+ if [ -z "${EXE}" ]; then
+ echo "ERROR: Your XDM value is invalid."
+ echo " No ${MY_XDM} executable could be found on your system."
+ fi
+ ;;
+ esac
+
+ if ! [ -x "${EXE}" ]; then
+ EXE=/usr/bin/xdm
+ PIDFILE=/run/xdm.pid
+ if ! [ -x "/usr/bin/xdm" ]; then
+ echo "ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,"
+ echo " or install x11-apps/xdm package"
+ eend 255
+ fi
+ fi
+}
+
+# Check to see if something is defined on our VT
+vtstatic() {
+ if [ -e /etc/inittab ] ; then
+ grep -Eq "^[^#]+.*\<tty$1\>" /etc/inittab
+ elif [ -e /etc/ttys ] ; then
+ grep -q "^ttyv$(($1 - 1))" /etc/ttys
+ else
+ return 1
+ fi
+}
+
+start() {
+ local EXE NAME PIDFILE AUTOCLEAN_CGROUP
+ setup_dm
+
+ if [ -f /etc/.noxdm ]; then
+ einfo "Skipping ${EXE##*/}, /etc/.noxdm found or \"nox\" bootparam passed."
+ rm /etc/.noxdm
+ return 0
+ fi
+
+ ebegin "Setting up ${EXE##*/}"
+
+ # save the prefered DM
+ save_options "service" "${EXE}"
+ save_options "name" "${NAME}"
+ save_options "pidfile" "${PIDFILE}"
+ save_options "start_stop_args" "${START_STOP_ARGS}"
+ save_options "autoclean_cgroup" "${AUTOCLEAN_CGROUP:-no}"
+
+ if [ -n "${CHECKVT-y}" ] ; then
+ if vtstatic "${CHECKVT:-7}" ; then
+ if [ -x /sbin/telinit ] && [ "${SOFTLEVEL}" != "BOOT" ] && [ "${RC_SOFTLEVEL}" != "BOOT" ]; then
+ ewarn "Something is already defined on VT ${CHECKVT:-7}, will start X later"
+ telinit a >/dev/null 2>&1
+ return 0
+ else
+ eerror "Something is already defined on VT ${CHECKVT:-7}, not starting"
+ return 1
+ fi
+ fi
+ fi
+
+ /etc/X11/startDM.sh
+ eend 0
+}
+
+stop() {
+ local curvt retval
+
+ retval=0
+ if [ -t 0 ]; then
+ if type fgconsole >/dev/null 2>&1; then
+ curvt=$(fgconsole 2>/dev/null)
+ else
+ curvt=$(tty)
+ case "${curvt}" in
+ /dev/ttyv[0-9]*) curvt=${curvt#/dev/ttyv} ;;
+ *) curvt= ;;
+ esac
+ fi
+ fi
+ local myexe myname mypidfile myservice
+ myexe=$(get_options "service")
+ myname=$(get_options "name")
+ mypidfile=$(get_options "pidfile")
+ myservice=${myexe##*/}
+ yesno "${rc_cgroup_cleanup:-no}" || rc_cgroup_cleanup=$(get_options "autoclean_cgroup")
+
+ [ -z "${myexe}" ] && return 0
+
+ ebegin "Stopping ${myservice}"
+
+ if start-stop-daemon --quiet --test --stop --exec "${myexe}"; then
+ start-stop-daemon --stop --exec "${myexe}" --retry TERM/5/TERM/5 \
+ ${mypidfile:+--pidfile} ${mypidfile} \
+ ${myname:+--name} ${myname}
+ retval=${?}
+ fi
+
+ # switch back to original vt
+ if [ -n "${curvt}" ]; then
+ if type chvt >/dev/null 2>&1; then
+ chvt "${curvt}"
+ else
+ vidcontrol -s "$((curvt + 1))"
+ fi
+ fi
+
+ eend ${retval} "Error stopping ${myservice}"
+ return ${retval}
+}
+
+# vim: set ts=4 :
diff --git a/x11-base/xorg-server/files/xdm.initd-11 b/x11-base/xorg-server/files/xdm.initd-11
new file mode 100644
index 00000000..2f7b47cb
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.initd-11
@@ -0,0 +1,231 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/files/xdm.initd-11,v 1.1 2014/04/14 16:19:25 chithanh Exp $
+
+# This is here to serve as a note to myself, and future developers.
+#
+# Any Display manager (gdm,kdm,xdm) has the following problem: if
+# it is started before any getty, and no vt is specified, it will
+# usually run on vt2. When the getty on vt2 then starts, and the
+# DM is already started, the getty will take control of the keyboard,
+# leaving us with a "dead" keyboard.
+#
+# Resolution: add the following line to /etc/inittab
+#
+# x:a:once:/etc/X11/startDM.sh
+#
+# and have /etc/X11/startDM.sh start the DM in daemon mode if
+# a lock is present (with the info of what DM should be started),
+# else just fall through.
+#
+# How this basically works, is the "a" runlevel is a additional
+# runlevel that you can use to fork processes with init, but the
+# runlevel never gets changed to this runlevel. Along with the "a"
+# runlevel, the "once" key word means that startDM.sh will only be
+# run when we specify it to run, thus eliminating respawning
+# startDM.sh when "xdm" is not added to the default runlevel, as was
+# done previously.
+#
+# This script then just calls "telinit a", and init will run
+# /etc/X11/startDM.sh after the current runlevel completes (this
+# script should only be added to the actual runlevel the user is
+# using).
+#
+# Martin Schlemmer
+# aka Azarah
+# 04 March 2002
+
+depend() {
+ need localmount xdm-setup
+
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+ # (#139824) Start after ypbind and autofs for network authentication
+ # (#145219 #180163) Could use lirc mouse as input device
+ # (#70689 comment #92) Start after consolefont to avoid display corruption
+ # (#291269) Start after quota, since some dm need readable home
+ # (#390609) gdm-3 will fail when dbus is not running
+ # (#366753) starting keymaps after X causes problems
+ after bootmisc consolefont modules netmount
+ after readahead-list ypbind autofs openvpn gpm lircmd
+ after quota keymaps
+ before alsasound
+
+ # Start before X
+ use consolekit dbus xfs
+}
+
+setup_dm() {
+ local MY_XDM
+
+ MY_XDM=$(echo "${DISPLAYMANAGER}" | tr '[:upper:]' '[:lower:]')
+
+ # Load our root path from profile.env
+ # Needed for kdm
+ PATH=${PATH}:$(. /etc/profile.env; echo "${ROOTPATH}")
+
+ NAME=
+ case "${MY_XDM}" in
+ kdm|kde)
+ EXE=/usr/bin/kdm
+ PIDFILE=/run/kdm.pid
+ ;;
+ entrance*)
+ EXE=/usr/sbin/entrance
+ PIDFILE=/run/entrance.pid
+ ;;
+ gdm|gnome)
+ # gdm-3 and above has different paths
+ if [ -f /usr/sbin/gdm ]; then
+ EXE=/usr/sbin/gdm
+ PIDFILE=/run/gdm/gdm.pid
+ START_STOP_ARGS="--background"
+ AUTOCLEAN_CGROUP="yes"
+ else
+ EXE=/usr/bin/gdm
+ PIDFILE=/run/gdm.pid
+ fi
+ [ "${RC_UNAME}" != "Linux" ] && NAME=gdm-binary
+ ;;
+ wdm)
+ EXE=/usr/bin/wdm
+ PIDFILE=
+ ;;
+ gpe)
+ EXE=/usr/bin/gpe-dm
+ PIDFILE=/run/gpe-dm.pid
+ ;;
+ lxdm)
+ EXE=/usr/sbin/lxdm-binary
+ PIDFILE=/run/lxdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ lightdm)
+ EXE=/usr/sbin/lightdm
+ PIDFILE=/run/lightdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ sddm)
+ EXE="/usr/bin/sddm"
+ START_STOP_ARGS="-m --background"
+ PIDFILE=/run/sddm.pid
+ ;;
+ *)
+ # first find out if there is such executable
+ EXE="$(command -v ${MY_XDM} 2>/dev/null)"
+ PIDFILE="/run/${MY_XDM}.pid"
+
+ # warn user that he is doing sick things if the exe was not found
+ if [ -z "${EXE}" ]; then
+ echo "ERROR: Your XDM value is invalid."
+ echo " No ${MY_XDM} executable could be found on your system."
+ fi
+ ;;
+ esac
+
+ if ! [ -x "${EXE}" ]; then
+ EXE=/usr/bin/xdm
+ PIDFILE=/run/xdm.pid
+ if ! [ -x "/usr/bin/xdm" ]; then
+ echo "ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,"
+ echo " or install x11-apps/xdm package"
+ eend 255
+ fi
+ fi
+}
+
+# Check to see if something is defined on our VT
+vtstatic() {
+ if [ -e /etc/inittab ] ; then
+ grep -Eq "^[^#]+.*\<tty$1\>" /etc/inittab
+ elif [ -e /etc/ttys ] ; then
+ grep -q "^ttyv$(($1 - 1))" /etc/ttys
+ else
+ return 1
+ fi
+}
+
+start() {
+ local EXE NAME PIDFILE AUTOCLEAN_CGROUP
+ setup_dm
+
+ if [ -f /etc/.noxdm ]; then
+ einfo "Skipping ${EXE##*/}, /etc/.noxdm found or \"nox\" bootparam passed."
+ rm /etc/.noxdm
+ return 0
+ fi
+
+ ebegin "Setting up ${EXE##*/}"
+
+ # save the prefered DM
+ save_options "service" "${EXE}"
+ save_options "name" "${NAME}"
+ save_options "pidfile" "${PIDFILE}"
+ save_options "start_stop_args" "${START_STOP_ARGS}"
+ save_options "autoclean_cgroup" "${AUTOCLEAN_CGROUP:-no}"
+
+ if [ -n "${CHECKVT-y}" ] ; then
+ if vtstatic "${CHECKVT:-7}" ; then
+ if [ -x /sbin/telinit ] && [ "${SOFTLEVEL}" != "BOOT" ] && [ "${RC_SOFTLEVEL}" != "BOOT" ]; then
+ ewarn "Something is already defined on VT ${CHECKVT:-7}, will start X later"
+ telinit a >/dev/null 2>&1
+ return 0
+ else
+ eerror "Something is already defined on VT ${CHECKVT:-7}, not starting"
+ return 1
+ fi
+ fi
+ fi
+
+ /etc/X11/startDM.sh
+ eend 0
+}
+
+stop() {
+ local curvt retval
+
+ retval=0
+ if [ -t 0 ]; then
+ if type fgconsole >/dev/null 2>&1; then
+ curvt=$(fgconsole 2>/dev/null)
+ else
+ curvt=$(tty)
+ case "${curvt}" in
+ /dev/ttyv[0-9]*) curvt=${curvt#/dev/ttyv} ;;
+ *) curvt= ;;
+ esac
+ fi
+ fi
+ local myexe myname mypidfile myservice
+ myexe=$(get_options "service")
+ myname=$(get_options "name")
+ mypidfile=$(get_options "pidfile")
+ myservice=${myexe##*/}
+ yesno "${rc_cgroup_cleanup:-no}" || rc_cgroup_cleanup=$(get_options "autoclean_cgroup")
+
+ [ -z "${myexe}" ] && return 0
+
+ ebegin "Stopping ${myservice}"
+
+ if start-stop-daemon --quiet --test --stop --exec "${myexe}"; then
+ start-stop-daemon --stop --exec "${myexe}" --retry TERM/5/TERM/5 \
+ ${mypidfile:+--pidfile} ${mypidfile} \
+ ${myname:+--name} ${myname}
+ retval=${?}
+ fi
+
+ # switch back to original vt
+ if [ -n "${curvt}" ]; then
+ if type chvt >/dev/null 2>&1; then
+ chvt "${curvt}"
+ else
+ vidcontrol -s "$((curvt + 1))"
+ fi
+ fi
+
+ eend ${retval} "Error stopping ${myservice}"
+ return ${retval}
+}
+
+# vim: set ts=4 :
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch b/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch
new file mode 100644
index 00000000..4b6727e6
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch
@@ -0,0 +1,75 @@
+From 7bddc2ba16a2a15773c2ea8947059afa27727764 Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Mon, 16 Sep 2013 21:47:16 -0700
+Subject: [PATCH] Avoid use-after-free in dix/dixfonts.c: doImageText()
+ [CVE-2013-4396]
+
+Save a pointer to the passed in closure structure before copying it
+and overwriting the *c pointer to point to our copy instead of the
+original. If we hit an error, once we free(c), reset c to point to
+the original structure before jumping to the cleanup code that
+references *c.
+
+Since one of the errors being checked for is whether the server was
+able to malloc(c->nChars * itemSize), the client can potentially pass
+a number of characters chosen to cause the malloc to fail and the
+error path to be taken, resulting in the read from freed memory.
+
+Since the memory is accessed almost immediately afterwards, and the
+X server is mostly single threaded, the odds of the free memory having
+invalid contents are low with most malloc implementations when not using
+memory debugging features, but some allocators will definitely overwrite
+the memory there, leading to a likely crash.
+
+Reported-by: Pedro Ribeiro <pedrib@gmail.com>
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Reviewed-by: Julien Cristau <jcristau@debian.org>
+---
+ dix/dixfonts.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/dix/dixfonts.c b/dix/dixfonts.c
+index feb765d..2e34d37 100644
+--- a/dix/dixfonts.c
++++ b/dix/dixfonts.c
+@@ -1425,6 +1425,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ GC *pGC;
+ unsigned char *data;
+ ITclosurePtr new_closure;
++ ITclosurePtr old_closure;
+
+ /* We're putting the client to sleep. We need to
+ save some state. Similar problem to that handled
+@@ -1436,12 +1437,14 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ err = BadAlloc;
+ goto bail;
+ }
++ old_closure = c;
+ *new_closure = *c;
+ c = new_closure;
+
+ data = malloc(c->nChars * itemSize);
+ if (!data) {
+ free(c);
++ c = old_closure;
+ err = BadAlloc;
+ goto bail;
+ }
+@@ -1452,6 +1455,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ if (!pGC) {
+ free(c->data);
+ free(c);
++ c = old_closure;
+ err = BadAlloc;
+ goto bail;
+ }
+@@ -1464,6 +1468,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ FreeScratchGC(pGC);
+ free(c->data);
+ free(c);
++ c = old_closure;
+ err = BadAlloc;
+ goto bail;
+ }
+--
+1.7.9.2
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch b/x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch
new file mode 100644
index 00000000..df43dbde
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch
@@ -0,0 +1,11 @@
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac 2011-10-31 19:40:02.000000000 +0100
++++ b/configure.ac 2011-10-31 19:41:02.372745481 +0100
+@@ -1624,7 +1624,6 @@
+ linux_alpha=yes
+ ;;
+ i*86|amd64*|x86_64*|ia64*)
+- linux_acpi="yes"
+ ;;
+ *)
+ ;;
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch b/x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch
new file mode 100644
index 00000000..24a5a02f
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch
@@ -0,0 +1,60 @@
+diff -r --context xorg-server-1.12.3/hw/xfree86/common/compiler.h xorg-server-1.12.3-fix/hw/xfree86/common/compiler.h
+*** xorg-server-1.12.3/hw/xfree86/common/compiler.h 2012-07-06 07:17:19.000000000 +0200
+--- xorg-server-1.12.3-fix/hw/xfree86/common/compiler.h 2012-08-29 00:14:39.000000000 +0200
+***************
+*** 421,426 ****
+--- 421,474 ----
+ #include <machine/pio.h>
+ #endif /* __NetBSD__ */
+
++ #elif defined(linux) && defined(__ia64__)
++ /* for Linux on ia64, we use the LIBC _inx/_outx routines */
++ /* note that the appropriate setup via "ioperm" needs to be done */
++ /* *before* any inx/outx is done. */
++
++ extern _X_EXPORT void _outb(unsigned char val, unsigned long port);
++ extern _X_EXPORT void _outw(unsigned short val, unsigned long port);
++ extern _X_EXPORT void _outl(unsigned int val, unsigned long port);
++ extern _X_EXPORT unsigned int _inb(unsigned long port);
++ extern _X_EXPORT unsigned int _inw(unsigned long port);
++ extern _X_EXPORT unsigned int _inl(unsigned long port);
++
++ static __inline__ void
++ outb(unsigned long port, unsigned char val)
++ {
++ _outb(val, port);
++ }
++
++ static __inline__ void
++ outw(unsigned long port, unsigned short val)
++ {
++ _outw(val, port);
++ }
++
++ static __inline__ void
++ outl(unsigned long port, unsigned int val)
++ {
++ _outl(val, port);
++ }
++
++ static __inline__ unsigned int
++ inb(unsigned long port)
++ {
++ return _inb(port);
++ }
++
++ static __inline__ unsigned int
++ inw(unsigned long port)
++ {
++ return _inw(port);
++ }
++
++ static __inline__ unsigned int
++ inl(unsigned long port)
++ {
++ return _inl(port);
++ }
++
+ #elif (defined(linux) || defined(__FreeBSD__)) && defined(__amd64__)
+
+ #include <inttypes.h>
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch b/x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch
new file mode 100644
index 00000000..57c7349d
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch
@@ -0,0 +1,53 @@
+diff -u13 -r xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c xorg-server-1.12.3/hw/xfree86/loader/loadmod.c
+--- xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c 2012-09-05 18:26:42.000000000 +0200
++++ xorg-server-1.12.3/hw/xfree86/loader/loadmod.c 2012-09-05 18:28:54.000000000 +0200
+@@ -1109,39 +1109,38 @@
+ static void
+ RemoveChild(ModuleDescPtr child)
+ {
+ ModuleDescPtr mdp;
+ ModuleDescPtr prevsib;
+ ModuleDescPtr parent;
+
+ if (!child->parent)
+ return;
+
+ parent = child->parent;
+ if (parent->child == child) {
+ parent->child = child->sib;
+- return;
+- }
+-
+- prevsib = parent->child;
+- mdp = prevsib->sib;
+- while (mdp && mdp != child) {
+- prevsib = mdp;
+- mdp = mdp->sib;
++ }
++ else {
++ prevsib = parent->child;
++ mdp = prevsib->sib;
++ while (mdp && mdp != child) {
++ prevsib = mdp;
++ mdp = mdp->sib;
++ }
++ if (mdp == child)
++ prevsib->sib = child->sib;
+ }
+- if (mdp == child)
+- prevsib->sib = child->sib;
+ child->sib = NULL;
+- return;
+ }
+
+ void
+ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
+ {
+ const char *msg;
+ MessageType type = X_ERROR;
+
+ switch (errmaj) {
+ case LDR_NOERROR:
+ msg = "no error";
+ break;
+ case LDR_NOMEM:
diff --git a/x11-base/xorg-server/files/xorg-server-1.14.3-musl.patch b/x11-base/xorg-server/files/xorg-server-1.14.3-musl.patch
new file mode 100644
index 00000000..dae98484
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.14.3-musl.patch
@@ -0,0 +1,31 @@
+diff -ur a/xorg-server-1.14.3/hw/xfree86/os-support/xf86_OSlib.h b/xorg-server-1.14.3/hw/xfree86/os-support/xf86_OSlib.h
+--- a/xorg-server-1.14.3/hw/xfree86/os-support/xf86_OSlib.h
++++ b/xorg-server-1.14.3/hw/xfree86/os-support/xf86_OSlib.h
+@@ -179,7 +179,7 @@
+ #include <assert.h>
+
+ #ifdef __linux__
+-#include <termio.h>
++#include <termios.h>
+ #else /* __GLIBC__ */
+ #include <termios.h>
+ #endif
+diff -ur a/xorg-server-1.14.3/os/access.c b/xorg-server-1.14.3/os/access.c
+--- a/xorg-server-1.14.3/os/access.c
++++ b/xorg-server-1.14.3/os/access.c
+@@ -89,6 +89,7 @@
+ #define XSERV_t
+ #define TRANS_SERVER
+ #define TRANS_REOPEN
++#define _GNU_SOURCE
+ #include <X11/Xtrans/Xtrans.h>
+ #include <X11/Xauth.h>
+ #include <X11/X.h>
+@@ -98,6 +99,7 @@
+ #include <errno.h>
+ #include <sys/types.h>
+ #ifndef WIN32
++#define _GNU_SOURCE
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <ctype.h>
diff --git a/x11-base/xorg-server/files/xorg-server-disable-acpi.patch b/x11-base/xorg-server/files/xorg-server-disable-acpi.patch
new file mode 100644
index 00000000..cc80e6ce
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-disable-acpi.patch
@@ -0,0 +1,31 @@
+From a8079882f1884edc62a9de28af915bd8b65dfbbe Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Wed, 11 Mar 2009 14:02:11 -0400
+Subject: [PATCH] Don't build the ACPI code.
+
+No good can come of this.
+---
+ configure.ac | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 72ae67e..04716f8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1269,13 +1269,11 @@ if test "x$XORG" = xyes; then
+ case $host_cpu in
+ ia64*)
+ linux_ia64=yes
+- linux_acpi="yes"
+ ;;
+ alpha*)
+ linux_alpha=yes
+ ;;
+ i*86|amd64*|x86_64*)
+- linux_acpi="yes"
+ ;;
+ *)
+ ;;
+--
+1.6.1.3
+
diff --git a/x11-base/xorg-server/files/xorg-sets.conf b/x11-base/xorg-server/files/xorg-sets.conf
new file mode 100644
index 00000000..5cd8112f
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-sets.conf
@@ -0,0 +1,6 @@
+# Rebuild all X11 modules (mostly useful after xorg-server ABI change).
+[x11-module-rebuild]
+class = portage.sets.dbapi.VariableSet
+world-candidate = false
+variable = CATEGORY
+includes = x11-drivers
diff --git a/x11-base/xorg-server/metadata.xml b/x11-base/xorg-server/metadata.xml
new file mode 100644
index 00000000..c5056f1c
--- /dev/null
+++ b/x11-base/xorg-server/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<use>
+ <flag name='dmx'>Build the Distributed Multiheaded X server</flag>
+ <flag name='kdrive'>Build the kdrive X servers</flag>
+ <flag name='tslib'>Build with tslib support for touchscreen devices</flag>
+ <flag name='unwind'>Enable libunwind usage for backtraces</flag>
+ <flag name='xnest'>Build the Xnest server</flag>
+ <flag name='xorg'>Build the Xorg X server (HIGHLY RECOMMENDED)</flag>
+ <flag name='xvfb'>Build the Xvfb server</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:x.org:xorg-server</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/x11-base/xorg-server/xorg-server-1.14.3-r99.ebuild b/x11-base/xorg-server/xorg-server-1.14.3-r99.ebuild
new file mode 100644
index 00000000..217b33cc
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.14.3-r99.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.14.3-r2.ebuild,v 1.10 2013/10/22 07:36:05 ago Exp $
+
+EAPI=5
+
+XORG_DOC=doc
+# avoid maintainer mode, bug #484634
+XORG_EAUTORECONF=yes
+inherit xorg-2 multilib versionator flag-o-matic
+EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/xserver"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/${PV}"
+KEYWORDS="amd64 arm ~mips ppc x86"
+
+IUSE_SERVERS="dmx kdrive xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} ipv6 minimal nptl selinux +suid tslib +udev"
+
+RDEPEND=">=app-eselect/eselect-opengl-1.0.8
+ dev-libs/openssl
+ media-libs/freetype
+ >=x11-apps/iceauth-1.0.2
+ >=x11-apps/rgb-1.0.3
+ >=x11-apps/xauth-1.0.3
+ x11-apps/xkbcomp
+ >=x11-libs/libdrm-2.4.20
+ >=x11-libs/libpciaccess-0.12.901
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont-1.4.2
+ >=x11-libs/libxkbfile-1.0.4
+ >=x11-libs/pixman-0.27.2
+ >=x11-libs/xtrans-1.2.2
+ >=x11-misc/xbitmaps-1.0.1
+ >=x11-misc/xkeyboard-config-2.4.1-r3
+ dmx? (
+ x11-libs/libXt
+ >=x11-libs/libdmx-1.0.99.1
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXaw-1.0.4
+ >=x11-libs/libXext-1.0.99.4
+ >=x11-libs/libXfixes-5.0
+ >=x11-libs/libXi-1.2.99.1
+ >=x11-libs/libXmu-1.0.3
+ x11-libs/libXrender
+ >=x11-libs/libXres-1.0.3
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ !minimal? (
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXext-1.0.5
+ >=media-libs/mesa-8[nptl=]
+ )
+ tslib? ( >=x11-libs/tslib-1.0 )
+ udev? ( >=virtual/udev-150 )
+ >=x11-apps/xinit-1.3
+ selinux? ( sec-policy/selinux-xserver )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ >=x11-proto/bigreqsproto-1.1.0
+ >=x11-proto/compositeproto-0.4
+ >=x11-proto/damageproto-1.1
+ >=x11-proto/fixesproto-5.0
+ >=x11-proto/fontsproto-2.0.2
+ >=x11-proto/glproto-1.4.16
+ >=x11-proto/inputproto-2.2.99.1
+ >=x11-proto/kbproto-1.0.3
+ >=x11-proto/randrproto-1.4.0
+ >=x11-proto/recordproto-1.13.99.1
+ >=x11-proto/renderproto-0.11
+ >=x11-proto/resourceproto-1.2.0
+ >=x11-proto/scrnsaverproto-1.1
+ >=x11-proto/trapproto-3.4.3
+ >=x11-proto/videoproto-2.2.2
+ >=x11-proto/xcmiscproto-1.2.0
+ >=x11-proto/xextproto-7.1.99
+ >=x11-proto/xf86dgaproto-2.0.99.1
+ >=x11-proto/xf86rushproto-1.1.2
+ >=x11-proto/xf86vidmodeproto-2.2.99.1
+ >=x11-proto/xineramaproto-1.1.3
+ >=x11-proto/xproto-7.0.22
+ dmx? (
+ >=x11-proto/dmxproto-2.2.99.1
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )
+ !minimal? (
+ >=x11-proto/xf86driproto-2.1.0
+ >=x11-proto/dri2proto-2.8
+ )"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )"
+
+#UPSTREAMED_PATCHES=(
+# "${WORKDIR}/patches/"
+#)
+
+PATCHES=(
+ "${UPSTREAMED_PATCHES[@]}"
+ "${FILESDIR}"/${PN}-1.12-disable-acpi.patch
+ "${FILESDIR}"/${PN}-1.12-ia64-fix_inx_outx.patch
+ "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch
+ "${FILESDIR}"/${PN}-1.12-cve-2013-4396.patch
+ "${FILESDIR}"/${PN}-1.14.3-musl.patch
+)
+
+pkg_pretend() {
+ # older gcc is not supported
+ [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
+ die "Sorry, but gcc earlier than 4.0 will not work for xorg-server."
+}
+
+src_configure() {
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+ # NOTE: fop is used for doc generating ; and i have no idea if gentoo
+ # package it somewhere
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(use_enable kdrive kdrive-kbd)
+ $(use_enable kdrive kdrive-mouse)
+ $(use_enable kdrive kdrive-evdev)
+ $(use_enable suid install-setuid)
+ $(use_enable tslib)
+ $(use_enable !minimal record)
+ $(use_enable !minimal xfree86-utils)
+ $(use_enable !minimal install-libxf86config)
+ $(use_enable !minimal dri)
+ $(use_enable !minimal dri2)
+ $(use_enable !minimal glx)
+ $(use_enable xnest)
+ $(use_enable xorg)
+ $(use_enable xvfb)
+ $(use_enable nptl glx-tls)
+ $(use_enable udev config-udev)
+ $(use_with doc doxygen)
+ $(use_with doc xmlto)
+ --enable-libdrm
+ --sysconfdir="${EPREFIX}"/etc/X11
+ --localstatedir="${EPREFIX}"/var
+ --with-fontrootdir="${EPREFIX}"/usr/share/fonts
+ --with-xkb-output="${EPREFIX}"/var/lib/xkb
+ --disable-config-hal
+ --without-dtrace
+ --without-fop
+ --with-os-vendor=Gentoo
+ )
+
+ # Xorg-server requires includes from OS mesa which are not visible for
+ # users of binary drivers.
+ mkdir -p "${T}/mesa-symlinks/GL"
+ for i in gl glx glxmd glxproto glxtokens; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/xorg-x11/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ for i in glext glxext; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/global/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ append-cppflags "-I${T}/mesa-symlinks"
+
+ xorg-2_src_configure
+}
+
+src_install() {
+ xorg-2_src_install
+
+ dynamic_libgl_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
+ fi
+
+ newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
+ newinitd "${FILESDIR}"/xdm.initd-10 xdm
+ newconfd "${FILESDIR}"/xdm.confd-4 xdm
+
+ # install the @x11-module-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/xorg-sets.conf xorg.conf
+}
+
+pkg_postinst() {
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ eselect opengl set xorg-x11 --use-old
+
+ if [[ ${PV} != 9999 && $(get_version_component_range 2 ${REPLACING_VERSIONS}) != $(get_version_component_range 2 ${PV}) ]]; then
+ ewarn "You must rebuild all drivers if upgrading from <xorg-server-$(get_version_component_range 1-2)"
+ ewarn "because the ABI changed. If you cannot start X because"
+ ewarn "of module version mismatch errors, this is your problem."
+
+ echo
+ ewarn "You can rebuild all installed packages in the x11-drivers"
+ ewarn "category using this command:"
+ ewarn " emerge @x11-module-rebuild"
+ fi
+
+ if use udev && has_version virtual/udev[-keymap]; then
+ ewarn "virtual/udev was built without keymap support. This may cause input device"
+ ewarn "autoconfiguration to fail."
+ fi
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then
+ rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/xorg-x11/extensions
+ local x=""
+ for x in "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/lib{glx,dri,dri2}*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${ED}"/usr/$(get_libdir)/opengl/xorg-x11/extensions
+ fi
+ done
+ eend 0
+}
+
+server_based_install() {
+ if ! use xorg; then
+ rm "${ED}"/usr/share/man/man1/Xserver.1x \
+ "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \
+ "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ "${ED}"/usr/share/man/man1/Xserver.1x
+ fi
+}
diff --git a/x11-base/xorg-server/xorg-server-1.15.0-r99.ebuild b/x11-base/xorg-server/xorg-server-1.15.0-r99.ebuild
new file mode 100644
index 00000000..d6f7ab25
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.15.0-r99.ebuild
@@ -0,0 +1,254 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.15.0.ebuild,v 1.6 2014/03/28 01:51:18 jer Exp $
+
+EAPI=5
+
+XORG_DOC=doc
+inherit xorg-2 multilib versionator flag-o-matic
+EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/xserver"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm ~mips ~ppc ~x86"
+
+IUSE_SERVERS="dmx kdrive xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} ipv6 minimal nptl selinux +suid tslib +udev unwind"
+
+RDEPEND=">=app-eselect/eselect-opengl-1.0.8
+ dev-libs/openssl
+ media-libs/freetype
+ >=x11-apps/iceauth-1.0.2
+ >=x11-apps/rgb-1.0.3
+ >=x11-apps/xauth-1.0.3
+ x11-apps/xkbcomp
+ >=x11-libs/libdrm-2.4.20
+ >=x11-libs/libpciaccess-0.12.901
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont-1.4.2
+ >=x11-libs/libxkbfile-1.0.4
+ >=x11-libs/libxshmfence-1.1
+ >=x11-libs/pixman-0.27.2
+ >=x11-libs/xtrans-1.3.2
+ >=x11-misc/xbitmaps-1.0.1
+ >=x11-misc/xkeyboard-config-2.4.1-r3
+ dmx? (
+ x11-libs/libXt
+ >=x11-libs/libdmx-1.0.99.1
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXaw-1.0.4
+ >=x11-libs/libXext-1.0.99.4
+ >=x11-libs/libXfixes-5.0
+ >=x11-libs/libXi-1.2.99.1
+ >=x11-libs/libXmu-1.0.3
+ x11-libs/libXrender
+ >=x11-libs/libXres-1.0.3
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ !minimal? (
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXext-1.0.5
+ >=media-libs/mesa-9.2.0[nptl=]
+ )
+ tslib? ( >=x11-libs/tslib-1.0 )
+ udev? ( >=virtual/udev-150 )
+ unwind? ( sys-libs/libunwind )
+ >=x11-apps/xinit-1.3
+ selinux? ( sec-policy/selinux-xserver )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ >=x11-proto/bigreqsproto-1.1.0
+ >=x11-proto/compositeproto-0.4
+ >=x11-proto/damageproto-1.1
+ >=x11-proto/fixesproto-5.0
+ >=x11-proto/fontsproto-2.0.2
+ >=x11-proto/glproto-1.4.17
+ >=x11-proto/inputproto-2.2.99.1
+ >=x11-proto/kbproto-1.0.3
+ >=x11-proto/randrproto-1.4.0
+ >=x11-proto/recordproto-1.13.99.1
+ >=x11-proto/renderproto-0.11
+ >=x11-proto/resourceproto-1.2.0
+ >=x11-proto/scrnsaverproto-1.1
+ >=x11-proto/trapproto-3.4.3
+ >=x11-proto/videoproto-2.2.2
+ >=x11-proto/xcmiscproto-1.2.0
+ >=x11-proto/xextproto-7.2.99.901
+ >=x11-proto/xf86dgaproto-2.0.99.1
+ >=x11-proto/xf86rushproto-1.1.2
+ >=x11-proto/xf86vidmodeproto-2.2.99.1
+ >=x11-proto/xineramaproto-1.1.3
+ >=x11-proto/xproto-7.0.22
+ >=x11-proto/presentproto-1.0
+ >=x11-proto/dri3proto-1.0
+ dmx? (
+ >=x11-proto/dmxproto-2.2.99.1
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )
+ !minimal? (
+ >=x11-proto/xf86driproto-2.1.0
+ >=x11-proto/dri2proto-2.8
+ )"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )"
+
+#UPSTREAMED_PATCHES=(
+# "${WORKDIR}/patches/"
+#)
+
+PATCHES=(
+ "${UPSTREAMED_PATCHES[@]}"
+ "${FILESDIR}"/${PN}-1.12-ia64-fix_inx_outx.patch
+ "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch
+ "${FILESDIR}"/${PN}-1.14.3-musl.patch
+)
+
+pkg_pretend() {
+ # older gcc is not supported
+ [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
+ die "Sorry, but gcc earlier than 4.0 will not work for xorg-server."
+}
+
+src_configure() {
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+ # NOTE: fop is used for doc generating ; and i have no idea if gentoo
+ # package it somewhere
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(use_enable kdrive kdrive-kbd)
+ $(use_enable kdrive kdrive-mouse)
+ $(use_enable kdrive kdrive-evdev)
+ $(use_enable suid install-setuid)
+ $(use_enable tslib)
+ $(use_enable unwind libunwind)
+ $(use_enable !minimal record)
+ $(use_enable !minimal xfree86-utils)
+ $(use_enable !minimal install-libxf86config)
+ $(use_enable !minimal dri)
+ $(use_enable !minimal dri2)
+ $(use_enable !minimal glx)
+ $(use_enable xnest)
+ $(use_enable xorg)
+ $(use_enable xvfb)
+ $(use_enable nptl glx-tls)
+ $(use_enable udev config-udev)
+ $(use_with doc doxygen)
+ $(use_with doc xmlto)
+ --enable-libdrm
+ --sysconfdir="${EPREFIX}"/etc/X11
+ --localstatedir="${EPREFIX}"/var
+ --with-fontrootdir="${EPREFIX}"/usr/share/fonts
+ --with-xkb-output="${EPREFIX}"/var/lib/xkb
+ --disable-config-hal
+ --disable-linux-acpi
+ --without-dtrace
+ --without-fop
+ --with-os-vendor=Gentoo
+ --with-sha1=libcrypto
+ )
+
+ # Xorg-server requires includes from OS mesa which are not visible for
+ # users of binary drivers.
+ mkdir -p "${T}/mesa-symlinks/GL"
+ for i in gl glx glxmd glxproto glxtokens; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/xorg-x11/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ for i in glext glxext; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/global/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ append-cppflags "-I${T}/mesa-symlinks"
+
+ xorg-2_src_configure
+}
+
+src_install() {
+ xorg-2_src_install
+
+ dynamic_libgl_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
+ fi
+
+ newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
+ newinitd "${FILESDIR}"/xdm.initd-10 xdm
+ newconfd "${FILESDIR}"/xdm.confd-4 xdm
+
+ # install the @x11-module-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/xorg-sets.conf xorg.conf
+}
+
+pkg_postinst() {
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ eselect opengl set xorg-x11 --use-old
+
+ if [[ ${PV} != 9999 && $(get_version_component_range 2 ${REPLACING_VERSIONS}) != $(get_version_component_range 2 ${PV}) ]]; then
+ ewarn "You must rebuild all drivers if upgrading from <xorg-server-$(get_version_component_range 1-2)"
+ ewarn "because the ABI changed. If you cannot start X because"
+ ewarn "of module version mismatch errors, this is your problem."
+
+ echo
+ ewarn "You can rebuild all installed packages in the x11-drivers"
+ ewarn "category using this command:"
+ ewarn " emerge @x11-module-rebuild"
+ fi
+
+ if use udev && has_version virtual/udev[-keymap]; then
+ ewarn "virtual/udev was built without keymap support. This may cause input device"
+ ewarn "autoconfiguration to fail."
+ fi
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then
+ rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/xorg-x11/extensions
+ local x=""
+ for x in "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/lib{glx,dri,dri2}*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${ED}"/usr/$(get_libdir)/opengl/xorg-x11/extensions
+ fi
+ done
+ eend 0
+}
+
+server_based_install() {
+ if ! use xorg; then
+ rm "${ED}"/usr/share/man/man1/Xserver.1x \
+ "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \
+ "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ "${ED}"/usr/share/man/man1/Xserver.1x
+ fi
+}
diff --git a/x11-base/xorg-server/xorg-server-1.15.2-r99.ebuild b/x11-base/xorg-server/xorg-server-1.15.2-r99.ebuild
new file mode 100644
index 00000000..f5e05c2c
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.15.2-r99.ebuild
@@ -0,0 +1,257 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.15.2-r1.ebuild,v 1.8 2015/01/16 08:08:28 ago Exp $
+
+EAPI=5
+
+XORG_EAUTORECONF=yes
+XORG_DOC=doc
+inherit xorg-2 multilib versionator flag-o-matic
+EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/xserver"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm ~mips ppc x86"
+
+SRC_URI="${SRC_URI} mirror://gentoo/${PN}-1.16-cve-2014-8091..8103.patches.tar.xz"
+
+IUSE_SERVERS="dmx kdrive xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} ipv6 minimal nptl selinux +suid tslib +udev unwind"
+
+CDEPEND=">=app-eselect/eselect-opengl-1.0.8
+ dev-libs/openssl
+ media-libs/freetype
+ >=x11-apps/iceauth-1.0.2
+ >=x11-apps/rgb-1.0.3
+ >=x11-apps/xauth-1.0.3
+ x11-apps/xkbcomp
+ >=x11-libs/libdrm-2.4.20
+ >=x11-libs/libpciaccess-0.12.901
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont-1.4.2
+ >=x11-libs/libxkbfile-1.0.4
+ >=x11-libs/libxshmfence-1.1
+ >=x11-libs/pixman-0.27.2
+ >=x11-libs/xtrans-1.3.2
+ >=x11-misc/xbitmaps-1.0.1
+ >=x11-misc/xkeyboard-config-2.4.1-r3
+ dmx? (
+ x11-libs/libXt
+ >=x11-libs/libdmx-1.0.99.1
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXaw-1.0.4
+ >=x11-libs/libXext-1.0.99.4
+ >=x11-libs/libXfixes-5.0
+ >=x11-libs/libXi-1.2.99.1
+ >=x11-libs/libXmu-1.0.3
+ x11-libs/libXrender
+ >=x11-libs/libXres-1.0.3
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ !minimal? (
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXext-1.0.5
+ >=media-libs/mesa-9.2.0[nptl=]
+ )
+ tslib? ( >=x11-libs/tslib-1.0 )
+ udev? ( >=virtual/udev-150 )
+ unwind? ( sys-libs/libunwind )
+ >=x11-apps/xinit-1.3"
+
+DEPEND="${CDEPEND}
+ sys-devel/flex
+ >=x11-proto/bigreqsproto-1.1.0
+ >=x11-proto/compositeproto-0.4
+ >=x11-proto/damageproto-1.1
+ >=x11-proto/fixesproto-5.0
+ >=x11-proto/fontsproto-2.0.2
+ >=x11-proto/glproto-1.4.17
+ >=x11-proto/inputproto-2.2.99.1
+ >=x11-proto/kbproto-1.0.3
+ >=x11-proto/randrproto-1.4.0
+ >=x11-proto/recordproto-1.13.99.1
+ >=x11-proto/renderproto-0.11
+ >=x11-proto/resourceproto-1.2.0
+ >=x11-proto/scrnsaverproto-1.1
+ >=x11-proto/trapproto-3.4.3
+ >=x11-proto/videoproto-2.2.2
+ >=x11-proto/xcmiscproto-1.2.0
+ >=x11-proto/xextproto-7.2.99.901
+ >=x11-proto/xf86dgaproto-2.0.99.1
+ >=x11-proto/xf86rushproto-1.1.2
+ >=x11-proto/xf86vidmodeproto-2.2.99.1
+ >=x11-proto/xineramaproto-1.1.3
+ >=x11-proto/xproto-7.0.22
+ >=x11-proto/presentproto-1.0
+ >=x11-proto/dri3proto-1.0
+ dmx? (
+ >=x11-proto/dmxproto-2.2.99.1
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )
+ !minimal? (
+ >=x11-proto/xf86driproto-2.1.0
+ >=x11-proto/dri2proto-2.8
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-xserver )
+"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )"
+
+pkg_pretend() {
+ # older gcc is not supported
+ [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
+ die "Sorry, but gcc earlier than 4.0 will not work for xorg-server."
+}
+
+src_prepare() {
+ UPSTREAMED_PATCHES=(
+ "${WORKDIR}"/patches/*.patch
+ )
+ PATCHES=(
+ "${UPSTREAMED_PATCHES[@]}"
+ "${FILESDIR}"/${PN}-1.12-ia64-fix_inx_outx.patch
+ "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch
+ "${FILESDIR}"/${PN}-1.14.3-musl.patch
+ )
+ xorg-2_src_prepare
+}
+
+src_configure() {
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+ # NOTE: fop is used for doc generating ; and i have no idea if gentoo
+ # package it somewhere
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(use_enable kdrive kdrive-kbd)
+ $(use_enable kdrive kdrive-mouse)
+ $(use_enable kdrive kdrive-evdev)
+ $(use_enable suid install-setuid)
+ $(use_enable tslib)
+ $(use_enable unwind libunwind)
+ $(use_enable !minimal record)
+ $(use_enable !minimal xfree86-utils)
+ $(use_enable !minimal install-libxf86config)
+ $(use_enable !minimal dri)
+ $(use_enable !minimal dri2)
+ $(use_enable !minimal glx)
+ $(use_enable xnest)
+ $(use_enable xorg)
+ $(use_enable xvfb)
+ $(use_enable nptl glx-tls)
+ $(use_enable udev config-udev)
+ $(use_with doc doxygen)
+ $(use_with doc xmlto)
+ --enable-libdrm
+ --sysconfdir="${EPREFIX}"/etc/X11
+ --localstatedir="${EPREFIX}"/var
+ --with-fontrootdir="${EPREFIX}"/usr/share/fonts
+ --with-xkb-output="${EPREFIX}"/var/lib/xkb
+ --disable-config-hal
+ --disable-linux-acpi
+ --without-dtrace
+ --without-fop
+ --with-os-vendor=Gentoo
+ --with-sha1=libcrypto
+ )
+
+ # Xorg-server requires includes from OS mesa which are not visible for
+ # users of binary drivers.
+ mkdir -p "${T}/mesa-symlinks/GL"
+ for i in gl glx glxmd glxproto glxtokens; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/xorg-x11/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ for i in glext glxext; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/global/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ append-cppflags "-I${T}/mesa-symlinks"
+
+ xorg-2_src_configure
+}
+
+src_install() {
+ xorg-2_src_install
+
+ dynamic_libgl_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
+ fi
+
+ newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
+ newinitd "${FILESDIR}"/xdm.initd-11 xdm
+ newconfd "${FILESDIR}"/xdm.confd-4 xdm
+
+ # install the @x11-module-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/xorg-sets.conf xorg.conf
+}
+
+pkg_postinst() {
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ eselect opengl set xorg-x11 --use-old
+
+ if [[ ${PV} != 9999 && $(get_version_component_range 2 ${REPLACING_VERSIONS}) != $(get_version_component_range 2 ${PV}) ]]; then
+ ewarn "You must rebuild all drivers if upgrading from <xorg-server-$(get_version_component_range 1-2)"
+ ewarn "because the ABI changed. If you cannot start X because"
+ ewarn "of module version mismatch errors, this is your problem."
+
+ echo
+ ewarn "You can rebuild all installed packages in the x11-drivers"
+ ewarn "category using this command:"
+ ewarn " emerge @x11-module-rebuild"
+ fi
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then
+ rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/xorg-x11/extensions
+ local x=""
+ for x in "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/lib{glx,dri,dri2}*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${ED}"/usr/$(get_libdir)/opengl/xorg-x11/extensions
+ fi
+ done
+ eend 0
+}
+
+server_based_install() {
+ if ! use xorg; then
+ rm "${ED}"/usr/share/man/man1/Xserver.1x \
+ "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \
+ "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ "${ED}"/usr/share/man/man1/Xserver.1x
+ fi
+}
diff --git a/x11-base/xorg-server/xorg-server-1.16.4-r99.ebuild b/x11-base/xorg-server/xorg-server-1.16.4-r99.ebuild
new file mode 100644
index 00000000..5c88b4a5
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.16.4-r99.ebuild
@@ -0,0 +1,259 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.16.4.ebuild,v 1.5 2015/02/20 11:17:22 ago Exp $
+
+EAPI=5
+
+XORG_DOC=doc
+inherit xorg-2 multilib versionator flag-o-matic
+EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/xserver"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/1.16.1"
+KEYWORDS="amd64 ~arm ~mips ppc x86"
+
+IUSE_SERVERS="dmx kdrive xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} glamor ipv6 minimal nptl selinux +suid systemd tslib +udev unwind wayland"
+
+CDEPEND=">=app-eselect/eselect-opengl-1.0.8
+ !>=app-eselect/eselect-opengl-1.3.0
+ dev-libs/openssl
+ media-libs/freetype
+ >=x11-apps/iceauth-1.0.2
+ >=x11-apps/rgb-1.0.3
+ >=x11-apps/xauth-1.0.3
+ x11-apps/xkbcomp
+ >=x11-libs/libdrm-2.4.20
+ >=x11-libs/libpciaccess-0.12.901
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont-1.4.2
+ >=x11-libs/libxkbfile-1.0.4
+ >=x11-libs/libxshmfence-1.1
+ >=x11-libs/pixman-0.27.2
+ >=x11-libs/xtrans-1.3.3
+ >=x11-misc/xbitmaps-1.0.1
+ >=x11-misc/xkeyboard-config-2.4.1-r3
+ dmx? (
+ x11-libs/libXt
+ >=x11-libs/libdmx-1.0.99.1
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXaw-1.0.4
+ >=x11-libs/libXext-1.0.99.4
+ >=x11-libs/libXfixes-5.0
+ >=x11-libs/libXi-1.2.99.1
+ >=x11-libs/libXmu-1.0.3
+ x11-libs/libXrender
+ >=x11-libs/libXres-1.0.3
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ glamor? (
+ media-libs/libepoxy
+ media-libs/mesa[egl,gbm]
+ !x11-libs/glamor
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ !minimal? (
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXext-1.0.5
+ >=media-libs/mesa-9.2.0[nptl=]
+ )
+ tslib? ( >=x11-libs/tslib-1.0 )
+ udev? ( >=virtual/udev-150 )
+ unwind? ( sys-libs/libunwind )
+ wayland? (
+ >=dev-libs/wayland-1.3.0
+ media-libs/libepoxy
+ )
+ >=x11-apps/xinit-1.3
+ systemd? (
+ sys-apps/dbus
+ sys-apps/systemd
+ )"
+
+DEPEND="${CDEPEND}
+ sys-devel/flex
+ >=x11-proto/bigreqsproto-1.1.0
+ >=x11-proto/compositeproto-0.4
+ >=x11-proto/damageproto-1.1
+ >=x11-proto/fixesproto-5.0
+ >=x11-proto/fontsproto-2.1.3
+ >=x11-proto/glproto-1.4.17
+ >=x11-proto/inputproto-2.2.99.1
+ >=x11-proto/kbproto-1.0.3
+ >=x11-proto/randrproto-1.4.0
+ >=x11-proto/recordproto-1.13.99.1
+ >=x11-proto/renderproto-0.11
+ >=x11-proto/resourceproto-1.2.0
+ >=x11-proto/scrnsaverproto-1.1
+ >=x11-proto/trapproto-3.4.3
+ >=x11-proto/videoproto-2.2.2
+ >=x11-proto/xcmiscproto-1.2.0
+ >=x11-proto/xextproto-7.2.99.901
+ >=x11-proto/xf86dgaproto-2.0.99.1
+ >=x11-proto/xf86rushproto-1.1.2
+ >=x11-proto/xf86vidmodeproto-2.2.99.1
+ >=x11-proto/xineramaproto-1.1.3
+ >=x11-proto/xproto-7.0.26
+ >=x11-proto/presentproto-1.0
+ >=x11-proto/dri3proto-1.0
+ dmx? (
+ >=x11-proto/dmxproto-2.2.99.1
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )
+ !minimal? (
+ >=x11-proto/xf86driproto-2.1.0
+ >=x11-proto/dri2proto-2.8
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-xserver )
+"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )"
+
+#UPSTREAMED_PATCHES=(
+# "${WORKDIR}/patches/"
+#)
+
+PATCHES=(
+ "${UPSTREAMED_PATCHES[@]}"
+ "${FILESDIR}"/${PN}-1.12-ia64-fix_inx_outx.patch
+ "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch
+ "${FILESDIR}"/${PN}-1.14.3-musl.patch
+)
+
+pkg_pretend() {
+ # older gcc is not supported
+ [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
+ die "Sorry, but gcc earlier than 4.0 will not work for xorg-server."
+}
+
+src_configure() {
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+ # NOTE: fop is used for doc generating ; and i have no idea if gentoo
+ # package it somewhere
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable glamor)
+ $(use_enable kdrive)
+ $(use_enable kdrive kdrive-kbd)
+ $(use_enable kdrive kdrive-mouse)
+ $(use_enable kdrive kdrive-evdev)
+ $(use_enable suid install-setuid)
+ $(use_enable tslib)
+ $(use_enable unwind libunwind)
+ $(use_enable wayland xwayland)
+ $(use_enable !minimal record)
+ $(use_enable !minimal xfree86-utils)
+ $(use_enable !minimal install-libxf86config)
+ $(use_enable !minimal dri)
+ $(use_enable !minimal dri2)
+ $(use_enable !minimal glx)
+ $(use_enable xnest)
+ $(use_enable xorg)
+ $(use_enable xvfb)
+ $(use_enable nptl glx-tls)
+ $(use_enable udev config-udev)
+ $(use_with doc doxygen)
+ $(use_with doc xmlto)
+ $(use_with systemd systemd-daemon)
+ $(use_enable systemd systemd-logind)
+ --enable-libdrm
+ --sysconfdir="${EPREFIX}"/etc/X11
+ --localstatedir="${EPREFIX}"/var
+ --with-fontrootdir="${EPREFIX}"/usr/share/fonts
+ --with-xkb-output="${EPREFIX}"/var/lib/xkb
+ --disable-config-hal
+ --disable-linux-acpi
+ --without-dtrace
+ --without-fop
+ --with-os-vendor=Gentoo
+ --with-sha1=libcrypto
+ )
+
+ # Xorg-server requires includes from OS mesa which are not visible for
+ # users of binary drivers.
+ mkdir -p "${T}/mesa-symlinks/GL"
+ for i in gl glx glxmd glxproto glxtokens; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/xorg-x11/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ for i in glext glxext; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/global/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ append-cppflags "-I${T}/mesa-symlinks"
+
+ xorg-2_src_configure
+}
+
+src_install() {
+ xorg-2_src_install
+
+ dynamic_libgl_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
+ fi
+
+ newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
+ newinitd "${FILESDIR}"/xdm.initd-11 xdm
+ newconfd "${FILESDIR}"/xdm.confd-4 xdm
+
+ # install the @x11-module-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/xorg-sets.conf xorg.conf
+}
+
+pkg_postinst() {
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ eselect opengl set xorg-x11 --use-old
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then
+ rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/xorg-x11/extensions
+ local x=""
+ for x in "${ED}"/usr/$(get_libdir)/xorg/modules/extensions/lib{glx,dri,dri2}*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${ED}"/usr/$(get_libdir)/opengl/xorg-x11/extensions
+ fi
+ done
+ eend 0
+}
+
+server_based_install() {
+ if ! use xorg; then
+ rm "${ED}"/usr/share/man/man1/Xserver.1x \
+ "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \
+ "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ "${ED}"/usr/share/man/man1/Xserver.1x
+ fi
+}
diff --git a/x11-libs/libpciaccess/Manifest b/x11-libs/libpciaccess/Manifest
new file mode 100644
index 00000000..3132bea5
--- /dev/null
+++ b/x11-libs/libpciaccess/Manifest
@@ -0,0 +1,7 @@
+AUX libpciaccess-0.13.2-arm.patch 308 SHA256 177fa4db376ce1f1ef405bd26efc10014ab95e10048ce7af2278aa6b5d2aac3d SHA512 fc34aa03609f0f8eb48ccc123e461730b4d1823eb06c57b73a5dfbbf13aa1c1aad81b665189a5c3b884be77e92adf4339211335e2d489426573d04880d539867 WHIRLPOOL 4215374d49b587e93f49a63a01421e427832af61836195746045e7e6635e081ba2cb2e9cc5bbafdd14bc78e452894a0be32b3e1e6093aa806e03a0e699d26156
+AUX libpciaccess-0.13.2-limits.patch 280 SHA256 b2cc4d3f0671e2bfb069c0195f286b134289c8ac74ca3b102ac4ce916c5dca16 SHA512 90fb7f4ae553e528f14764c7eaa3abf9d71330d7cab25d7fb5304ed13e967adf319cbd836a460b43d5a3828b10405c06d3140028e7cf05fe151e0275558db5ab WHIRLPOOL 36674f63b4de4e99acff7002c53c919acd995b8b170ae9e697f216d639770d55cf5392c2820a3ddc3a4600d85e9ed8828816f8add182b572bfc638fd4de02baa
+DIST libpciaccess-0.13.2.tar.bz2 359231 SHA256 abab8c2b050afb89bc29280e9c6b50ec5867174960d88bfb81a01036ec20de19 SHA512 312d891c1337256c9aeeda2c743907ce8c51444a165a97d2007fd2f8d05cafab37cf16e85288244490e514bcfbd7ba050d985130efe3dc2f6ed316dd46e6ad1d WHIRLPOOL 861666da875f6854b5443bc6d388f4feef45979e8ae4b2108baab792396a2ef55a3190277aa5f9ebc6a8460353a57c4f38da7071ff63a3c346905dd069216501
+DIST libpciaccess-0.13.3.tar.bz2 368755 SHA256 6cd76ccae4e06eee47d3ead84a118740e9406e2a9b7adc9b08e92c69ce89c2e3 SHA512 11ad783c6278e340973a621339cece3776c098952d0eaf96bfe745d013347e928c0883ed8444c5ddea870f5e4b3c25da16a44facb9d7fc1c8fea1c7e77bd592b WHIRLPOOL 92ba320540535c2b2811c29272a2d94dd3c1f586a0e3073ed4678c03cb3e30656772ad6b0a3e9612a0972a28cfe0d9c4c93ea955610e609fb103a15bb8051e31
+EBUILD libpciaccess-0.13.2-r99.ebuild 1023 SHA256 dd016bebfd804132f2ea4a63c764524beda5fae0525d727aea6bc1ae4b13896d SHA512 b5f0ff4b26f2ce013060d543fc559e79f61499805f3462a4c8775d41ebe859d20221e5fdb82ab3565074c000d13517b3908aa5e9c7149116922bdfe687abb8b3 WHIRLPOOL 5f9c1cba430d87f5352f87382b228495d6c1489adc00497a88edb034c731033dcddaf00538f415cc650c5f25d4b2f79b9e72d17d384986ca4de043e5abbf3134
+EBUILD libpciaccess-0.13.3-r99.ebuild 946 SHA256 7f570f01c20d41d3e272b6dc63bc0cda73610d3bc4ff1c431e8c4ec40c2df1ad SHA512 63156902334708374cf65f52d3bfbab986ae4e34a2fcc266e4853c9f29a2252a780b1ed3b683402962edc37fbe6fe029415faa309f19db781841b2e4453d0380 WHIRLPOOL ceb0d7a1bc7508b26cedad14f7e548ab427c45e6b599c21d085bd9dfdec856d5236414cefbeef0d29fce1304f53ad6fd1230d1671df8374e586989bf7b25c3b5
+MISC metadata.xml 156 SHA256 5101ab0d4cc8c7125eea733c44e86962769bd77acaf53b69223b9cadcdd29055 SHA512 daa9bb2a9b1a16220327bc394f10d93a1a8a427bfbed8808cd247c1dfd5a5b87a4945d55d8243e07fede2c8182a208c618ebd483773d77e9d23862ec77016019 WHIRLPOOL 691e028648bb8b60771d74ef718c51fdb0f4a587e984f6ac4c13d7796415ecf770df2e0fd766399091771924bb65995e9bb290baa35971c56e07d76f2bbf6d93
diff --git a/x11-libs/libpciaccess/files/libpciaccess-0.13.2-arm.patch b/x11-libs/libpciaccess/files/libpciaccess-0.13.2-arm.patch
new file mode 100644
index 00000000..263dc01f
--- /dev/null
+++ b/x11-libs/libpciaccess/files/libpciaccess-0.13.2-arm.patch
@@ -0,0 +1,11 @@
+--- a/libpciaccess-0.13.2/src/linux_sysfs.c
++++ b/libpciaccess-0.13.2/src/linux_sysfs.c
+@@ -45,7 +45,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+
+-#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
++#if defined(__i386__) || defined(__x86_64__)
+ #include <sys/io.h>
+ #else
+ #define inb(x) -1
diff --git a/x11-libs/libpciaccess/files/libpciaccess-0.13.2-limits.patch b/x11-libs/libpciaccess/files/libpciaccess-0.13.2-limits.patch
new file mode 100644
index 00000000..463b4185
--- /dev/null
+++ b/x11-libs/libpciaccess/files/libpciaccess-0.13.2-limits.patch
@@ -0,0 +1,10 @@
+--- a/libpciaccess-0.13.2/src/linux_sysfs.c
++++ b/libpciaccess-0.13.2/src/linux_sysfs.c
+@@ -44,6 +44,7 @@
+ #include <sys/mman.h>
+ #include <dirent.h>
+ #include <errno.h>
++#include <limits.h>
+
+ #if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
+ #include <sys/io.h>
diff --git a/x11-libs/libpciaccess/libpciaccess-0.13.2-r99.ebuild b/x11-libs/libpciaccess/libpciaccess-0.13.2-r99.ebuild
new file mode 100644
index 00000000..84324a96
--- /dev/null
+++ b/x11-libs/libpciaccess/libpciaccess-0.13.2-r99.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/libpciaccess/libpciaccess-0.13.2.ebuild,v 1.11 2013/10/08 05:07:22 ago Exp $
+
+EAPI=5
+
+XORG_MULTILIB=yes
+inherit xorg-2
+
+DESCRIPTION="Library providing generic access to the PCI bus and devices"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="minimal zlib"
+
+DEPEND="!<x11-base/xorg-server-1.5
+ zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}
+ sys-apps/hwids"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.13.2-limits.patch
+ "${FILESDIR}"/${PN}-0.13.2-arm.patch
+)
+
+pkg_setup() {
+ xorg-2_pkg_setup
+
+ XORG_CONFIGURE_OPTIONS=(
+ "$(use_with zlib)"
+ "--with-pciids-path=${EPREFIX}/usr/share/misc"
+ )
+}
+
+src_install() {
+ xorg-2_src_install
+
+ if ! use minimal; then
+ scanpci_install() {
+ ${BASH} "${BUILD_DIR}/libtool" --mode=install "$(type -P install)" -c "${BUILD_DIR}/scanpci/scanpci" "${ED}"/usr/bin || die
+ }
+
+ dodir /usr/bin
+ multilib_foreach_abi scanpci_install
+ fi
+}
diff --git a/x11-libs/libpciaccess/libpciaccess-0.13.3-r99.ebuild b/x11-libs/libpciaccess/libpciaccess-0.13.3-r99.ebuild
new file mode 100644
index 00000000..5ae47749
--- /dev/null
+++ b/x11-libs/libpciaccess/libpciaccess-0.13.3-r99.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/libpciaccess/libpciaccess-0.13.3.ebuild,v 1.4 2015/02/20 11:18:03 ago Exp $
+
+EAPI=5
+
+XORG_MULTILIB=yes
+inherit xorg-2
+
+DESCRIPTION="Library providing generic access to the PCI bus and devices"
+KEYWORDS="amd64 ~arm ~mips ppc x86"
+IUSE="minimal zlib"
+
+DEPEND="!<x11-base/xorg-server-1.5
+ zlib? ( >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}
+ sys-apps/hwids"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.13.2-limits.patch
+ "${FILESDIR}"/${PN}-0.13.2-arm.patch
+)
+
+pkg_setup() {
+ xorg-2_pkg_setup
+
+ XORG_CONFIGURE_OPTIONS=(
+ "$(use_with zlib)"
+ "--with-pciids-path=${EPREFIX}/usr/share/misc"
+ )
+}
+
+multilib_src_install() {
+ default
+
+ if multilib_is_native_abi; then
+ dodir /usr/bin
+ ${BASH} libtool --mode=install "$(type -P install)" -c scanpci/scanpci "${ED}"/usr/bin || die
+ fi
+}
diff --git a/x11-libs/libpciaccess/metadata.xml b/x11-libs/libpciaccess/metadata.xml
new file mode 100644
index 00000000..01c4c004
--- /dev/null
+++ b/x11-libs/libpciaccess/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>x11</herd>
+</pkgmetadata>
diff --git a/x11-misc/slim/Manifest b/x11-misc/slim/Manifest
new file mode 100644
index 00000000..4b9778c3
--- /dev/null
+++ b/x11-misc/slim/Manifest
@@ -0,0 +1,16 @@
+AUX Xsession-r3 4045 SHA256 5eaa3c03278443f27a8477397dd0bcaa5f95e7d0cf99448f028bf0165ce089af SHA512 6c0bfba4c3f00b75d6b5fb0e0e8a492fa262b2d0f3c6382861d7f3a8c657e803151a2060e181439952649fd2acf6fa71b75811565f1156018027ec14a761f7d0 WHIRLPOOL 4808e5a3303bf4e8aff965cf1e77e4ca45413468f54dfa163ced9e848a53d19f705b203054002729f05d2efcc303b8456fd76644de8c1fb28613a43599c815cb
+AUX slim-1.3.5-arm.patch 289 SHA256 95c7be21f8a176ce649e2dd804b8c2fa019e5e206a2532233f8b76bdbf201fba SHA512 1d3a3a387433c8bfc9bff6ac3779e70e0e0ca5f65e6120dd83fb51d59dfa47facc6d31c6e955b737e41ebf760416015f7f12dc749e710957cbef274aa5d1d308 WHIRLPOOL 54cb1cff534d30c157460a729a054cb4089b39dbf950b7d78462f6cc8f1dcc1770b6943fe0e24198ad0313cd2c359e0684d35e99155e3945fc19e14638986437
+AUX slim-1.3.5-disable-ck-for-systemd.patch 3303 SHA256 e309716a177bcff758f2e5b807a99380d503ae08a819048cacd01f1010a40791 SHA512 64205963f8f56f012dd16c2aea18e2e4f4e155093d44222a512b242061b334b7faa9c3abdd1acc011213f0fed9007cf232da8c61e6cedc30c710b149fa841f04 WHIRLPOOL cc3e45fe35e5b178213f261f22e3f54e4175e501a6bd7b3a042206d14713d9f038238f531d1dd872abe15a8d118d5ccd0edec83028e49ad8df3ba1d77c55812c
+AUX slim-1.3.6-add-missing-libgen_h.patch 323 SHA256 a8637ff009441e763f4dedf28db5663661ba25a798288238b0cd503a43898bf4 SHA512 c69937c42abf0c5959af7f0291af1608aa4a39a107f1a11e36f262b79e72537ca8aa69af03f3b637b6e6e2c440887990b5c5065863a7357f27009fc6e82a851e WHIRLPOOL 1cd94b031879204dc97f95324509a6395e4284e60814b44193156c426088819a3e2092cab5eac0c27ab4e0b128b31415f97ea99be73e8899b2b4c12c3f2a9f94
+AUX slim-1.3.6-config.diff 2934 SHA256 5f7f1fcd6d0d28a4060b2360fdbd0489dd3884087596786ce3f31615098d1840 SHA512 afee976f30f563ed97187f40cdd618159545d7850e8af15bd5b30306c347cf8e5276c6c16938ce094bb589dcab8d88d5c368f7267dbe3f794a18f734f69ddf10 WHIRLPOOL caf3eac08c415e6370a1e0c4077137ccf4763c761a91d130648d9edbbcbb2ced2723c4a5dc4498fff4b3f410b7b6bb21b6f0c3882043aa25ce0941d37a5905cd
+AUX slim-1.3.6-drop-zlib.patch 309 SHA256 d90ead30ef02aa4e0f6fcc9b23c248522409749338972c8d343880e66478ac8b SHA512 2aa62e5b7ad67df47009e4cff0b34b8ff6116e9d3d23194c8199ec06356fbf0660df6b807e530075d3dc5aa8e04dda29e7a6e1337212b58e3bae09e9543c0c22 WHIRLPOOL b16da43ede2991bc14af3063d187301e93c29deb96c336a7558caeabcc5ba92bf425512252e170ee45f48dcbb2837e0c46dd7c828ad1943e65b3100df3dd18b0
+AUX slim-1.3.6-fix-slimlock-nopam-v2.patch 839 SHA256 7ee18c47e3159145be99b16bc2a8c56543043be17ff4527e581cf033a0b4d42e SHA512 2251cd96801e593b387037d79014ea86fdec223d8910628fbfd0e9c5eafbe79c27ffb7f08123c89b635d33dc2bf9cf76e2964f5293352784c1e08c7b1c7427c0 WHIRLPOOL ec303bf8a764e0445726df941d1e09b94d0aaae522f43146dc3a5fef4ad197f0bd654d081489f51a7ed0cbbf30fe8954abb1f5ff5066e4ca69bbb04e21373c54
+AUX slim-1.3.6-honour-cflags.patch 499 SHA256 7a19c872c2f3a290a74df246cdd3f08126f7ce46e63fb5074a326b81adb805bf SHA512 bbc99d396d30e034100e468d8d5a69cee3bc26eb6029793bdb95f29bd6364f680baec13e12e9ca7dcf01d84de3d8d45712462de36f6f729c7f8c232865a71a7a WHIRLPOOL 96941218006cd2d91efca231f9f2917431a1aa4e0afd31137809a90efb4e69122addf5257aff76b2b345606fa44b8593d9b3bb9d01125a83f751ea6f5945dc48
+AUX slim-1.3.6-libslim-cmake-fixes.patch 852 SHA256 9565d206e0e34000975e59afbd2bc3de74fd3f590afdd9e34d0125cb3f12c75a SHA512 457e23e193c6b9ecb5335accad444470ffb2e0109550d041385bba2b6036fdfac8d48e031574e4229d8b8768a7a86f6d6c191b214540f1156a2a13e5a9f3451f WHIRLPOOL e712e7b829da0cc3113a7cc69364045467c89fa05a52b36ccc2393a708840f36108088088500485e251c9765eefd0485462876fb14ca15db09c49a7f63a81cad
+AUX slim-1.3.6-session-chooser.patch 3994 SHA256 3ee06061b10f42925cbd33ca25af1e870d4462be54c34e409fbe7b8f3bafa20e SHA512 7227fa0210d7870971870409da2d86d9f239ae285dde116e2b2d817318339fb51324bd11d04dc4c26a2ca3c1e5a0f0686987eab7042265389fb2f60cc7d37a45 WHIRLPOOL 594651c89d95210b28e8db7b7da547ab3009678be8312d8f94f79c71008aa7d4c3f2f02b71ce0624f400e84399a779b4544ac5523529255209c8e2f9a27b8f1c
+AUX slim-1.3.6-strip-systemd-unit-install.patch 474 SHA256 01e02399cad7f223233e70c255956aff809aa16d416c3e1428d171e0a810c576 SHA512 377b1443c700ab6697b2087affed8486d9661de8794355e134a78125695a22e966927f26296e6330b8f4e7a600e9d21bca034dbc2d5445171e05618a2bfad55a WHIRLPOOL 5aef1e500930710b3cfe042078c3916d361800c61aac9813c56cd64d654786afb67a9f9357c0e1ffede6f5a65068c837767aca8f6fdddeb7935bdcd5e4b4ca9f
+AUX slim-1.3.6-systemd-session.patch 820 SHA256 1cb2b5f322ae975cd5a5a9ccca45854c642497638aa1707234d8595e58adee3e SHA512 df653a31bd2b0d3bb5b09d700d89d6b4c444b3ef49dc6d5a0646cab5480841a76ecb1c3bcd45b602eb0d2000971a5ef576eac63de67907769ea23b6925329635 WHIRLPOOL 7557d7afd65ad3dd232656f05f1da7735668c1bb55125b1c833c55f9e4ea1411dcbfd8a104cba0d4d0f94aecd29a9f36d56c06515464e78da772e2ee304019db
+AUX slim.logrotate 102 SHA256 d0559cf7764147f601f2bab8077fd956b1171adad4872c0d324279f6a978264a SHA512 b49ce2dc1a1943c5f8eea8e6394cc27b014832e2d9908220f32ffd21fbe69442ec45b18f6e435430c6cbed074e5983e2136ebade10218bb073bb13106716f5b2 WHIRLPOOL 9e940bd1d88613e46ac4a333afa0f02cd16c583a1b34f509c4409321f7d5c5e14ec86e38e9743a6176187a72e403683127fbaf293abbef678e23873c428613c1
+DIST slim-1.3.6.tar.gz 232547 SHA256 21defeed175418c46d71af71fd493cd0cbffd693f9d43c2151529125859810df SHA512 345b1dee5d6f0c3716dfa7c5c16274adbf18586bdaaa6af4f310e24c5a61f79a297ffac921a5ba545523317e9fe120916df226c36b9c9b49c2ac9c1ca21dee0c WHIRLPOOL 473fa2f3752ec0c1bd2410ff3110649ce792c2e904928694b5fb8a43de619945276282e4a9de86198b9f38cdd74d1f9dc9cbcc754cc97989002b368ef26a8429
+EBUILD slim-1.3.6-r99.ebuild 3796 SHA256 44b41b2863e2857385e528271e98c1cb3abdb2c8181c09b84b9d6dc54d35853c SHA512 10ec7ebe13fccf4c8d85212621405a130c906d8fe07be7d5ec2542403e306f7f956230dbcca32013f16b40ec1e16c3385765c1558f6e1e15905097dc5dd8a896 WHIRLPOOL 0e7918cf37a38330f8e22e1e10e7011cd7bebe83100969b60f4bef06bb55ef4d373c4e52925c9692bf75eb3595da61e28f2e2b41ef98efda76b8621ff8a3f791
+MISC metadata.xml 317 SHA256 5b7154fd1fce1e40461b40b06533854dc7605d8b5eb19f68eeb9d84527c579c4 SHA512 6b5a9244c1b0fc0abec27900a10673fc431a0559d8cddd917d4117965e4ae569c153bc47ba3342ca4d8b114b949bcf10205a3d07645eb2a2834f300152028687 WHIRLPOOL 886788720a8dd6ca0fefa991e6e5f1640fa5913594be0acb6abcf92bb8e2d684a793721bdbb60a243f39cee097704b00620ae77c75a1f7d55672e875a34dedfc
diff --git a/x11-misc/slim/files/Xsession-r3 b/x11-misc/slim/files/Xsession-r3
new file mode 100644
index 00000000..237fb363
--- /dev/null
+++ b/x11-misc/slim/files/Xsession-r3
@@ -0,0 +1,158 @@
+#!/bin/sh
+#
+# Slim login manager Xsession script
+#
+
+command="$@"
+
+# this will go into slim.log along with all other echo's
+# good for debugging where things go wrong
+echo "$0: Beginning session setup..."
+
+# First read /etc/profile and .profile
+test -f /etc/profile && . /etc/profile
+test -f "$HOME/.profile" && . "$HOME/.profile"
+# Second read /etc/xprofile and .xprofile for X specific setup
+test -f /etc/xprofile && . /etc/xprofile
+test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
+
+# wrap possible arguments to determine whether to treat special or not
+if [ "x$command" = "xcustom" ] || [ "x$command" = "xCustom" ] || [ "x$command" = "xdefault" ] || [ "x$command" = "xDefault" ]; then
+ command="Xsession"
+fi
+if [ "x$command" = "x" ]; then
+ # no default specified, check if Xsession will complete
+ # and if not then assign XSESSION to command
+ if [ -x "$HOME/.xsession" ] || [ -x "$HOME/.Xclients" ] || [ -x /etc/X11/xinit/Xclients ] || [ -x /etc/X11/Xclients ]; then
+ command="Xsession"
+ else
+ command=$XSESSION
+ fi
+fi
+
+# most of this is from /etc/X11/chooser.sh
+sessionscript=""
+if [ -n "${command}" ]; then
+ # find a match for $command in /etc/X11/Sessions
+ for x in /etc/X11/Sessions/* ; do
+ if [ "`echo ${x##*/} | awk '{ print toupper($1) }'`" = "`echo ${command} | awk '{ print toupper($1) }'`" ]; then
+ sessionscript=${x}
+ break
+ fi
+ done
+ if [ -n "${sessionscript}" ]; then
+ if [ -x "${sessionscript}" ]; then
+ command="${sessionscript}"
+ else
+ command="/bin/sh ${sessionscript}"
+ fi
+ else
+
+ # find an executable for $command
+ x=""
+ y=""
+
+ for x in "${command}" "`echo ${command} | awk '{ print toupper($1) }'`" "`echo ${command} | awk '{ print tolower($1) }'`"
+ do
+ # Fall through ...
+ if [ -x "`which ${x} 2>/dev/null`" ]; then
+ y="`which ${x} 2>/dev/null`"
+ break
+ fi
+ done
+ # note , if the command could not be found then $command will be empty
+ command="$y"
+ unset x
+ unset y
+ fi
+fi
+
+# call xrdb and xmodmap and such, since $command is not a session script
+if [ -z "${sessionscript}" ]; then
+ userresources="$HOME/.Xresources"
+ usermodmap="$HOME/.Xmodmap"
+ userxkbmap="$HOME/.Xkbmap"
+
+ sysresources=/etc/X11/Xresources
+ sysmodmap=/etc/X11/Xmodmap
+ sysxkbmap=/etc/X11/Xkbmap
+
+ rh6sysresources=/etc/X11/xinit/Xresources
+ rh6sysmodmap=/etc/X11/xinit/Xmodmap
+
+ # merge in defaults
+ if [ -f "$rh6sysresources" ]; then
+ xrdb -merge "$rh6sysresources"
+ fi
+
+ if [ -f "$sysresources" ]; then
+ xrdb -merge "$sysresources"
+ fi
+
+ if [ -f "$userresources" ]; then
+ xrdb -merge "$userresources"
+ fi
+
+ # merge in keymaps
+ if [ -f "$sysxkbmap" ]; then
+ setxkbmap `cat "$sysxkbmap"`
+ XKB_IN_USE=yes
+ fi
+
+ if [ -f "$userxkbmap" ]; then
+ setxkbmap `cat "$userxkbmap"`
+ XKB_IN_USE=yes
+ fi
+
+ #
+ # Eeek, this seems like too much magic here
+ #
+ if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
+ if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
+ xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
+ if [ -n "$xkbsymbols" ]; then
+ setxkbmap -symbols "$xkbsymbols"
+ XKB_IN_USE=yes
+ fi
+ fi
+ fi
+
+ # xkb and xmodmap don't play nice together
+ if [ -z "$XKB_IN_USE" ]; then
+ if [ -f "$rh6sysmodmap" ]; then
+ xmodmap "$rh6sysmodmap"
+ fi
+
+ if [ -f "$sysmodmap" ]; then
+ xmodmap "$sysmodmap"
+ fi
+
+ if [ -f "$usermodmap" ]; then
+ xmodmap "$usermodmap"
+ fi
+ fi
+
+ unset XKB_IN_USE
+fi
+unset sessionscript
+
+# start failsafe session
+if [ -z "${command}" ]; then
+ echo "$0: Failed to find a command to start the session, so starting a failsafe xterm."
+ exec xterm -geometry 80x24+0+0
+fi
+
+# run all system xinitrc shell scripts which will update command
+if [ -d /etc/X11/xinit/xinitrc.d ]; then
+ for i in /etc/X11/xinit/xinitrc.d/* ; do
+ if [ -x "$i" ]; then
+ . "$i"
+ fi
+ done
+ unset i
+fi
+
+echo "$0: Setup done, will execute: $command"
+exec $command
+
+# vim:ts=4
diff --git a/x11-misc/slim/files/slim-1.3.5-arm.patch b/x11-misc/slim/files/slim-1.3.5-arm.patch
new file mode 100644
index 00000000..9438ce4a
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.5-arm.patch
@@ -0,0 +1,11 @@
+--- a/Ck.cpp 2012-06-26 04:20:14.000000000 -0400
++++ b/Ck.cpp 2012-10-05 13:25:29.000000000 -0400
+@@ -91,7 +91,7 @@
+
+ vt = *((long *)return_value);
+
+- std::snprintf(device, 32, "/dev/tty%ld", vt);
++ std::sprintf(device, "/dev/tty%ld", vt);
+
+ if(return_value)
+ XFree(return_value);
diff --git a/x11-misc/slim/files/slim-1.3.5-disable-ck-for-systemd.patch b/x11-misc/slim/files/slim-1.3.5-disable-ck-for-systemd.patch
new file mode 100644
index 00000000..f7e36176
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.5-disable-ck-for-systemd.patch
@@ -0,0 +1,122 @@
+diff -Naur slim-1.3.5/app.cpp slim-1.3.5.new/app.cpp
+--- slim-1.3.5/app.cpp 2012-12-31 08:03:42.000000000 -0500
++++ slim-1.3.5.new/app.cpp 2013-08-22 14:16:37.994854259 -0400
+@@ -138,11 +138,14 @@
+ daemonmode = false;
+ force_nodaemon = false;
+ firstlogin = true;
++#ifdef USE_CONSOLEKIT
++ consolekit_support_enabled = true;
++#endif
+ Dpy = NULL;
+
+ /* Parse command line
+ Note: we force a option for nodaemon switch to handle "-nodaemon" */
+- while((tmp = getopt(argc, argv, "vhp:n:d?")) != EOF) {
++ while((tmp = getopt(argc, argv, "vhsp:n:d?")) != EOF) {
+ switch (tmp) {
+ case 'p': /* Test theme */
+ testtheme = optarg;
+@@ -163,6 +166,11 @@
+ std::cout << APPNAME << " version " << VERSION << endl;
+ exit(OK_EXIT);
+ break;
++#ifdef USE_CONSOLEKIT
++ case 's': /* Disable consolekit support */
++ consolekit_support_enabled = false;
++ break;
++#endif
+ case '?': /* Illegal */
+ logStream << endl;
+ case 'h': /* Help */
+@@ -171,6 +179,9 @@
+ << " -d: daemon mode" << endl
+ << " -nodaemon: no-daemon mode" << endl
+ << " -v: show version" << endl
++#ifdef USE_CONSOLEKIT
++ << " -s: start for systemd, disable consolekit support" << endl
++#endif
+ << " -p /path/to/theme/dir: preview theme" << endl;
+ exit(OK_EXIT);
+ break;
+@@ -559,6 +570,7 @@
+ #endif
+
+ #ifdef USE_CONSOLEKIT
++ if (consolekit_support_enabled) {
+ /* Setup the ConsoleKit session */
+ try {
+ ck.open_session(DisplayName, pw->pw_uid);
+@@ -567,6 +579,7 @@
+ logStream << APPNAME << ": " << e << endl;
+ exit(ERR_EXIT);
+ }
++ }
+ #endif
+
+ /* Create new process */
+@@ -578,6 +591,7 @@
+ char** child_env = pam.getenvlist();
+
+ # ifdef USE_CONSOLEKIT
++ if (consolekit_support_enabled) {
+ char** old_env = child_env;
+
+ /* Grow the copy of the environment for the session cookie */
+@@ -590,6 +604,7 @@
+ memcpy(child_env, old_env, sizeof(char*)*n+1);
+ child_env[n - 1] = StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
+ child_env[n] = NULL;
++ }
+ # endif /* USE_CONSOLEKIT */
+ #else
+
+@@ -611,6 +626,7 @@
+ child_env[n++]=StrConcat("MAIL=", maildir.c_str());
+ child_env[n++]=StrConcat("XAUTHORITY=", xauthority.c_str());
+ # ifdef USE_CONSOLEKIT
++ if (consolekit_support_enabled)
+ child_env[n++]=StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
+ # endif /* USE_CONSOLEKIT */
+ child_env[n++]=0;
+@@ -656,12 +672,14 @@
+ }
+
+ #ifdef USE_CONSOLEKIT
++ if (consolekit_support_enabled) {
+ try {
+ ck.close_session();
+ }
+ catch(Ck::Exception &e) {
+ logStream << APPNAME << ": " << e << endl;
+ };
++ }
+ #endif
+
+ #ifdef USE_PAM
+diff -Naur slim-1.3.5/app.h slim-1.3.5.new/app.h
+--- slim-1.3.5/app.h 2012-12-31 08:03:42.000000000 -0500
++++ slim-1.3.5.new/app.h 2013-08-22 14:12:45.536850016 -0400
+@@ -108,6 +108,10 @@
+ char *testtheme;
+ bool testing;
+
++#ifdef USE_CONSOLEKIT
++ bool consolekit_support_enabled;
++#endif
++
+ std::string themeName;
+ std::string mcookie;
+
+diff -Naur slim-1.3.5/slim.service slim-1.3.5.new/slim.service
+--- slim-1.3.5/slim.service 2012-12-31 08:03:42.000000000 -0500
++++ slim-1.3.5.new/slim.service 2013-08-22 14:15:39.186853186 -0400
+@@ -3,7 +3,7 @@
+ After=systemd-user-sessions.service
+
+ [Service]
+-ExecStart=/usr/bin/slim -nodaemon
++ExecStart=/usr/bin/slim -nodaemon -s
+
+ [Install]
+ Alias=display-manager.service
diff --git a/x11-misc/slim/files/slim-1.3.6-add-missing-libgen_h.patch b/x11-misc/slim/files/slim-1.3.6-add-missing-libgen_h.patch
new file mode 100644
index 00000000..f137d94e
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-add-missing-libgen_h.patch
@@ -0,0 +1,11 @@
+diff -Naur slim-1.3.6.orig/panel.cpp slim-1.3.6/panel.cpp
+--- slim-1.3.6.orig/panel.cpp 2014-06-18 11:04:57.958630814 -0400
++++ slim-1.3.6/panel.cpp 2014-06-18 11:05:10.675631393 -0400
+@@ -11,6 +11,7 @@
+
+ #include <sstream>
+ #include <poll.h>
++#include <libgen.h>
+ #include <X11/extensions/Xrandr.h>
+ #include "panel.h"
+
diff --git a/x11-misc/slim/files/slim-1.3.6-config.diff b/x11-misc/slim/files/slim-1.3.6-config.diff
new file mode 100644
index 00000000..9da6795c
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-config.diff
@@ -0,0 +1,77 @@
+--- slim.conf.orig 2010-08-25 11:52:23.000000000 -0400
++++ slim.conf 2010-08-25 11:58:58.000000000 -0400
+@@ -2,7 +2,7 @@
+ # Note: -xauth $authfile is automatically appended
+ default_path /bin:/usr/bin:/usr/local/bin
+ default_xserver /usr/bin/X
+-#xserver_arguments -dpi 75
++xserver_arguments -nolisten tcp -br -deferglyphs 16 vt07
+
+ # Commands for halt, login, etc.
+ halt_cmd /sbin/shutdown -h now
+@@ -18,7 +18,7 @@
+
+
+ # Activate numlock when slim starts. Valid values: on|off
+-# numlock on
++numlock on
+
+ # Hide the mouse cursor (note: does not work with some WMs).
+ # Valid values: true|false
+@@ -33,7 +33,8 @@
+ # to adjust the command according to your preferred shell,
+ # i.e. for freebsd use:
+ # login_cmd exec /bin/sh - ~/.xinitrc %session
+-login_cmd exec /bin/bash -login ~/.xinitrc %session
++# login_cmd exec /bin/bash -login ~/.xinitrc %session
++login_cmd exec /bin/bash -login /usr/share/slim/Xsession %session
+
+ # Commands executed when starting and exiting a session.
+ # They can be used for registering a X11 session with
+@@ -41,20 +42,30 @@
+ #
+ # sessionstart_cmd some command
+ # sessionstop_cmd some command
++sessionstart_cmd /usr/bin/sessreg -a -l :0.0 %user
++sessionstop_cmd /usr/bin/sessreg -d -l :0.0 %user
+
+ # Start in daemon mode. Valid values: yes | no
+ # Note that this can be overriden by the command line
+ # options "-d" and "-nodaemon"
+-# daemon yes
++daemon yes
+
+-# Available sessions (first one is the default).
+-# The current chosen session name is replaced in the login_cmd
++# Available sessions:
++# The current chosen session name replaces %session in the login_cmd
+ # above, so your login command can handle different sessions.
++# If no session is chosen (via F1), %session will be an empty string.
+ # see the xinitrc.sample file shipped with slim sources
+-sessions xfce4,icewm-session,wmaker,blackbox
++#sessions xfce4,icewm-session,wmaker,blackbox
++# Alternatively, read available sessions from a directory of scripts:
++#sessiondir /etc/X11/Sessions
++# Or, read available sessions from the xsessions desktop files --
++# note that this may provide a full path to the session executable!
++sessiondir /usr/share/xsessions
+
+-# Executed when pressing F11 (requires imagemagick)
++# Executed when pressing F11 (requires media-gfx/imagemagick for import)
++# Alternative is media-gfx/scrot. See Gentoo bug 252241 for more info.
+ screenshot_cmd import -window root /slim.png
++#screenshot_cmd scrot /root/slim.png
+
+ # welcome message. Available variables: %host, %domain
+ welcome_msg Welcome to %host
+@@ -83,8 +91,8 @@
+ # randomly choose from
+ current_theme default
+
+-# Lock file
+-lockfile /var/run/slim.lock
++# Lock file, /etc/init.d/xdm expects slim.pid
++lockfile /run/slim.pid
+
+ # Log file
+ logfile /var/log/slim.log
diff --git a/x11-misc/slim/files/slim-1.3.6-drop-zlib.patch b/x11-misc/slim/files/slim-1.3.6-drop-zlib.patch
new file mode 100644
index 00000000..cf2106a8
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-drop-zlib.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt 2014-02-28 10:38:48.655262163 -0500
++++ b/CMakeLists.txt 2014-02-28 10:47:01.671271162 -0500
+@@ -96,7 +96,6 @@
+ find_package(Freetype REQUIRED)
+ find_package(JPEG REQUIRED)
+ find_package(PNG REQUIRED)
+-find_package(ZLIB REQUIRED)
+
+ # Fontconfig
+ set(FONTCONFIG_DIR ${CMAKE_MODULE_PATH})
diff --git a/x11-misc/slim/files/slim-1.3.6-fix-slimlock-nopam-v2.patch b/x11-misc/slim/files/slim-1.3.6-fix-slimlock-nopam-v2.patch
new file mode 100644
index 00000000..d5fc4db4
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-fix-slimlock-nopam-v2.patch
@@ -0,0 +1,26 @@
+--- a/CMakeLists.txt 2013-10-27 21:24:21.193802669 -0400
++++ b/CMakeLists.txt 2013-10-27 21:26:54.127806951 -0400
+@@ -220,7 +220,6 @@
+ ####### install
+ # slim
+ install(TARGETS slim RUNTIME DESTINATION bin)
+-install(TARGETS slimlock RUNTIME DESTINATION bin)
+
+ if (BUILD_SHARED_LIBS)
+ set_target_properties(libslim PROPERTIES
+@@ -235,8 +234,14 @@
+
+ # man file
+ install(FILES slim.1 DESTINATION ${MANDIR}/man1/)
+-install(FILES slimlock.1 DESTINATION ${MANDIR}/man1/)
+ # configure
+ install(FILES slim.conf DESTINATION ${SYSCONFDIR})
++
++#slimlock
++if(BUILD_SLIMLOCK)
++install(TARGETS slimlock RUNTIME DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE SETUID)
++install(FILES slimlock.1 DESTINATION ${MANDIR}/man1/)
++endif(BUILD_SLIMLOCK)
++
+ # themes directory
+ subdirs(themes)
diff --git a/x11-misc/slim/files/slim-1.3.6-honour-cflags.patch b/x11-misc/slim/files/slim-1.3.6-honour-cflags.patch
new file mode 100644
index 00000000..8335e0fe
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-honour-cflags.patch
@@ -0,0 +1,14 @@
+--- CMakeLists.txt 2013-10-01 18:38:05.000000000 -0400
++++ CMakeLists.txt.new 2013-10-15 11:33:18.975741094 -0400
+@@ -42,11 +42,6 @@
+ set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPKGDATADIR=\"${PKGDATADIR}\"")
+ set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"${SYSCONFDIR}\"")
+
+-# Flags
+-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O2")
+-set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -Wall -g -O2")
+-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -g -O2")
+-
+ # source
+ set(slim_srcs
+ main.cpp
diff --git a/x11-misc/slim/files/slim-1.3.6-libslim-cmake-fixes.patch b/x11-misc/slim/files/slim-1.3.6-libslim-cmake-fixes.patch
new file mode 100644
index 00000000..11e39dc9
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-libslim-cmake-fixes.patch
@@ -0,0 +1,33 @@
+--- a/CMakeLists.txt 2013-10-15 11:35:16.688739802 -0400
++++ b/CMakeLists.txt 2013-10-15 11:53:46.185727620 -0400
+@@ -115,6 +115,7 @@
+ message("\tPAM Found")
+ set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DUSE_PAM")
+ target_link_libraries(${PROJECT_NAME} ${PAM_LIBRARY})
++ target_link_libraries(libslim ${PAM_LIBRARY})
+ target_link_libraries(slimlock ${PAM_LIBRARY})
+ include_directories(${PAM_INCLUDE_DIR})
+ else(PAM_FOUND)
+@@ -173,7 +174,10 @@
+ )
+
+ target_link_libraries(libslim
+- ${JPEG_LIBRARIES}
++ ${RT_LIB}
++ ${X11_Xft_LIB}
++ ${X11_Xrandr_LIB}
++ ${JPEG_LIBRARIES}
+ ${PNG_LIBRARIES}
+ )
+
+@@ -228,8 +228,8 @@
+ SOVERSION ${SLIM_VERSION})
+
+ install(TARGETS libslim
+- LIBRARY DESTINATION lib
+- ARCHIVE DESTINATION lib
++ LIBRARY DESTINATION lib${LIB_SUFFIX}
++ ARCHIVE DESTINATION lib${LIB_SIFFUX}
+ )
+ endif (BUILD_SHARED_LIBS)
+
diff --git a/x11-misc/slim/files/slim-1.3.6-session-chooser.patch b/x11-misc/slim/files/slim-1.3.6-session-chooser.patch
new file mode 100644
index 00000000..b43c9a30
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-session-chooser.patch
@@ -0,0 +1,115 @@
+--- a/cfg.cpp 2013-10-01 18:38:05.000000000 -0400
++++ b/cfg.cpp 2013-10-24 12:12:20.584103253 -0400
+@@ -274,14 +274,14 @@
+ while (true) {
+ string::const_iterator begin = s;
+ while (*s != c && s != str.end()) { ++s; }
+- tmp = string(begin, s);
+- if (useEmpty || tmp.size() > 0)
++ tmp = string(begin, s);
++ if (useEmpty || tmp.size() > 0)
+ v.push_back(tmp);
+ if (s == str.end()) {
+ break;
+ }
+ if (++s == str.end()) {
+- if (useEmpty)
++ if (useEmpty)
+ v.push_back("");
+ break;
+ }
+@@ -289,6 +289,7 @@
+ }
+
+ void Cfg::fillSessionList(){
++ string strSessionList = getOption("sessions");
+ string strSessionDir = getOption("sessiondir");
+
+ sessions.clear();
+@@ -307,29 +308,29 @@
+ struct stat oFileStat;
+
+ if (stat(strFile.c_str(), &oFileStat) == 0) {
+- if (S_ISREG(oFileStat.st_mode) &&
+- access(strFile.c_str(), R_OK) == 0){
+- ifstream desktop_file( strFile.c_str() );
+- if (desktop_file){
+- string line, session_name = "", session_exec = "";
+- while (getline( desktop_file, line )) {
+- if (line.substr(0, 5) == "Name=") {
+- session_name = line.substr(5);
+- if (!session_exec.empty())
+- break;
+- } else
+- if (line.substr(0, 5) == "Exec=") {
+- session_exec = line.substr(5);
+- if (!session_name.empty())
+- break;
+- }
+- }
+- desktop_file.close();
+- pair<string,string> session(session_name,session_exec);
+- sessions.push_back(session);
+- cout << session_exec << " - " << session_name << endl;
+- }
+-
++ if (S_ISREG(oFileStat.st_mode) &&
++ access(strFile.c_str(), R_OK) == 0){
++ ifstream desktop_file( strFile.c_str() );
++ if (desktop_file){
++ string line, session_name = "", session_exec = "";
++ while (getline( desktop_file, line )) {
++ if (line.substr(0, 5) == "Name=") {
++ session_name = line.substr(5);
++ if (!session_exec.empty()) break;
++ } else if (line.substr(0, 5) == "Exec=") {
++ session_exec = line.substr(5);
++ if (!session_name.empty()) break;
++ }
++ }
++ desktop_file.close();
++ if (!session_name.empty() && !session_exec.empty()) {
++ pair<string,string> session(session_name,session_exec);
++ sessions.push_back(session);
++ } else if (access(strFile.c_str(), X_OK) == 0) {
++ pair<string,string> session(string(pDirent->d_name),strFile);
++ sessions.push_back(session);
++ }
++ }
+ }
+ }
+ }
+@@ -338,8 +339,18 @@
+ }
+
+ if (sessions.empty()){
+- pair<string,string> session("","");
+- sessions.push_back(session);
++ if (strSessionList.empty()) {
++ pair<string,string> session("","");
++ sessions.push_back(session);
++ } else {
++ // iterate through the split of the session list
++ vector<string> sessit;
++ split(sessit,strSessionList,',',false);
++ for (vector<string>::iterator it = sessit.begin(); it != sessit.end(); ++it) {
++ pair<string,string> session(*it,*it);
++ sessions.push_back(session);
++ }
++ }
+ }
+ }
+
+--- a/app.cpp 2013-10-24 12:16:59.870111072 -0400
++++ b/app.cpp 2013-10-24 12:29:59.899132910 -0400
+@@ -377,10 +377,6 @@
+ LoginPanel->SetName(cfg->getOption("default_user") );
+ }
+
+- if (firstloop) {
+- LoginPanel->SwitchSession();
+- }
+-
+ if (!AuthenticateUser(focuspass && firstloop)){
+ panelclosed = 0;
+ firstloop = false;
diff --git a/x11-misc/slim/files/slim-1.3.6-strip-systemd-unit-install.patch b/x11-misc/slim/files/slim-1.3.6-strip-systemd-unit-install.patch
new file mode 100644
index 00000000..f116c5eb
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-strip-systemd-unit-install.patch
@@ -0,0 +1,13 @@
+--- CMakeLists.txt 2013-10-15 12:02:13.463722050 -0400
++++ CMakeLists.txt.new 2013-10-17 09:41:41.602917345 -0400
+@@ -238,10 +238,6 @@
+ install(FILES slimlock.1 DESTINATION ${MANDIR}/man1/)
+ # configure
+ install(FILES slim.conf DESTINATION ${SYSCONFDIR})
+-# systemd service file
+-if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+- install(FILES slim.service DESTINATION ${LIBDIR}/systemd/system)
+-endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ # themes directory
+ subdirs(themes)
+
diff --git a/x11-misc/slim/files/slim-1.3.6-systemd-session.patch b/x11-misc/slim/files/slim-1.3.6-systemd-session.patch
new file mode 100644
index 00000000..0639aeb5
--- /dev/null
+++ b/x11-misc/slim/files/slim-1.3.6-systemd-session.patch
@@ -0,0 +1,29 @@
+--- a/app.cpp 2013-10-23 16:19:57.074100282 -0400
++++ b/app.cpp 2013-10-23 16:33:13.302122574 -0400
+@@ -829,8 +829,13 @@
+
+ StopServer();
+ RemoveLock();
+- while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
+- Run();
++ if (force_nodaemon) {
++ delete LoginPanel;
++ exit(ERR_EXIT); /* use ERR_EXIT so that systemd's RESTART=on-failure works */
++ } else {
++ while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
++ Run();
++ }
+ }
+
+ void App::KillAllClients(Bool top) {
+--- a/slim.service 2013-10-23 16:19:57.074100282 -0400
++++ b/slim.service 2013-10-23 16:45:14.901142776 -0400
+@@ -4,6 +4,7 @@
+
+ [Service]
+ ExecStart=/usr/bin/slim -nodaemon -s
++Restart=on-failure
+
+ [Install]
+ Alias=display-manager.service
+Common subdirectories: slim-1.3.6/themes and slim-1.3.6.new/themes
diff --git a/x11-misc/slim/files/slim.logrotate b/x11-misc/slim/files/slim.logrotate
new file mode 100644
index 00000000..89015306
--- /dev/null
+++ b/x11-misc/slim/files/slim.logrotate
@@ -0,0 +1,9 @@
+/var/log/slim.log {
+ compress
+ rotate 4
+ weekly
+ delaycompress
+ copytruncate
+ missingok
+ notifempty
+}
diff --git a/x11-misc/slim/metadata.xml b/x11-misc/slim/metadata.xml
new file mode 100644
index 00000000..f6d2292a
--- /dev/null
+++ b/x11-misc/slim/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>axs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='consolekit'>Enable native consolekit support</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/x11-misc/slim/slim-1.3.6-r99.ebuild b/x11-misc/slim/slim-1.3.6-r99.ebuild
new file mode 100644
index 00000000..cb553f5c
--- /dev/null
+++ b/x11-misc/slim/slim-1.3.6-r99.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/slim-1.3.6-r4.ebuild,v 1.2 2014/02/28 15:52:09 axs Exp $
+
+EAPI=5
+
+CMAKE_MIN_VERSION="2.8.8"
+inherit cmake-utils pam eutils systemd versionator
+
+DESCRIPTION="Simple Login Manager"
+HOMEPAGE="http://slim.berlios.de"
+SRC_URI="mirror://berlios/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc x86"
+IUSE="branding pam consolekit"
+REQUIRED_USE="consolekit? ( pam )"
+
+RDEPEND="x11-libs/libXmu
+ x11-libs/libX11
+ x11-libs/libXpm
+ x11-libs/libXft
+ x11-libs/libXrandr
+ media-libs/libpng:0=
+ virtual/jpeg:=
+ x11-apps/sessreg
+ consolekit? ( sys-auth/consolekit
+ sys-apps/dbus )
+ pam? ( virtual/pam
+ !x11-misc/slimlock )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ x11-proto/xproto"
+PDEPEND="branding? ( >=x11-themes/slim-themes-1.2.3a-r3 )"
+
+src_prepare() {
+ # Our Gentoo-specific config changes
+ epatch "${FILESDIR}"/${P}-config.diff
+ epatch "${FILESDIR}"/${PN}-1.3.5-arm.patch
+ epatch "${FILESDIR}"/${P}-honour-cflags.patch
+ epatch "${FILESDIR}"/${P}-libslim-cmake-fixes.patch
+ epatch "${FILESDIR}"/${PN}-1.3.5-disable-ck-for-systemd.patch
+ epatch "${FILESDIR}"/${P}-strip-systemd-unit-install.patch
+ epatch "${FILESDIR}"/${P}-systemd-session.patch
+ epatch "${FILESDIR}"/${P}-session-chooser.patch
+ epatch "${FILESDIR}"/${P}-fix-slimlock-nopam-v2.patch
+ epatch "${FILESDIR}"/${P}-drop-zlib.patch
+ epatch "${FILESDIR}"/${P}-add-missing-libgen_h.patch
+
+ if use elibc_FreeBSD; then
+ sed -i -e 's/"-DHAVE_SHADOW"/"-DNEEDS_BASENAME"/' CMakeLists.txt \
+ || die
+ fi
+
+ if use branding; then
+ sed -i -e 's/ default/ slim-gentoo-simple/' slim.conf || die
+ fi
+}
+
+src_configure() {
+ mycmakeargs=(
+ $(cmake-utils_use pam USE_PAM)
+ $(cmake-utils_use consolekit USE_CONSOLEKIT)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ if use pam ; then
+ pamd_mimic system-local-login slim auth account session
+ pamd_mimic system-local-login slimlock auth
+ fi
+
+ systemd_dounit slim.service
+
+ insinto /usr/share/slim
+ newins "${FILESDIR}/Xsession-r3" Xsession
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/slim.logrotate" slim
+
+ dodoc xinitrc.sample ChangeLog README TODO THEMES
+}
+
+pkg_postinst() {
+ # note, $REPLACING_VERSIONS will always contain 0 or 1 PV's for slim
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "The configuration file is located at /etc/slim.conf."
+ elog
+ elog "If you wish ${PN} to start automatically, set DISPLAYMANAGER=\"${PN}\" "
+ elog "in /etc/conf.d/xdm and run \"rc-update add xdm default\"."
+ fi
+ if ! version_is_at_least "1.3.2-r7" "${REPLACING_VERSIONS:-1.0}" ; then
+ elog
+ elog "By default, ${PN} is set up to do proper X session selection, including ~/.xsession"
+ elog "support, as well as selection between sessions available in"
+ elog "/etc/X11/Sessions/ at login by pressing [F1]."
+ elog
+ elog "The XSESSION environment variable is still supported as a default"
+ elog "if no session has been specified by the user."
+ elog
+ elog "If you want to use .xinitrc in the user's home directory for session"
+ elog "management instead, see README and xinitrc.sample in"
+ elog "/usr/share/doc/${PF} and change your login_cmd in /etc/slim.conf"
+ elog "accordingly."
+ elog
+ ewarn "Please note that slim supports consolekit directly. Please do not use any "
+ ewarn "old work-arounds (including calls to 'ck-launch-session' in xinitrc scripts)"
+ ewarn "and enable USE=\"consolekit\" instead."
+ ewarn
+ fi
+ if ! use pam; then
+ elog "You have merged ${PN} without USE=\"pam\", this will cause ${PN} to fall back to"
+ elog "the console when restarting your window manager. If this is not desired, then"
+ elog "please remerge ${PN} with USE=\"pam\""
+ elog
+ fi
+}