remove more deprecated stuff
Hanno Böck

Hanno Böck commited on 2011-02-02 22:41:12
Zeige 76 geänderte Dateien mit 0 Einfügungen und 12835 Löschungen.

... ...
@@ -1,21 +0,0 @@
1
-AUX 20php5-envd 145 RMD160 8c81fb7dc1d1ddf16fd956d748514db3bcb27603 SHA1 f1cef57c0def8e2c5422aaf136f40b4ff47801d2 SHA256 efaae9e6ae5f7010e073c2ab6d8a9dda009f0707c7d7b0c027e142c94f7041a4
2
-AUX 70_mod_php5.conf-apache2 348 RMD160 9f3f49a52ebf92c2650501c5ceb6f95ce4bb2e76 SHA1 62992e793446b4a9a64900d1ecba7bae06873382 SHA256 5bb8a45570582b4389a7d3feea0398e1c13ed4ced96e559b9406ed8c965dea8c
3
-AUX 70_mod_php5.conf-apache2-r1 374 RMD160 ca06cdc9d1a3dc4129a60c938ee3a1b542497fbb SHA1 4733066b6324c5870e716485484c44c7c26a9ff1 SHA256 815c1ca23c9afe8479568ceaac4057eb91ea5444fbd863866b29adb4eea2c82b
4
-AUX 70_mod_php5_concurr.conf-apache2 348 RMD160 9f3f49a52ebf92c2650501c5ceb6f95ce4bb2e76 SHA1 62992e793446b4a9a64900d1ecba7bae06873382 SHA256 5bb8a45570582b4389a7d3feea0398e1c13ed4ced96e559b9406ed8c965dea8c
5
-AUX 70_mod_php5_concurr.conf-apache2-r1 376 RMD160 4f7de5c0784b6191450b5c1a7de7ad941620e199 SHA1 c42a23bd7a1d3e8c7e0ac906f50f180116349f76 SHA256 c05f499d9c8927391c586b94716a9f59d63767165552ea527ec7ff63c36eaa40
6
-AUX eblits/common-v1.eblit 376 RMD160 524d38035ef01b215c6dc06699c41550c246de9d SHA1 b85091f9e56b20217e5c2d3e25cef055642cd088 SHA256 d395752919fe05fa64a0e09deaf690e008a04f2c580f42233b5a854a1012045e
7
-AUX eblits/pkg_postinst-v1.eblit 2184 RMD160 ce65ba811eab10862d067c7e2b4bdc8d2b0aee56 SHA1 11c14f2235041cfb08e33cf2550bebef2037e92b SHA256 9e1cd81be4f051f3156de0ce5398a338b2ab6f8e73047c5983beda47f2f762b0
8
-AUX eblits/pkg_setup-v1.eblit 777 RMD160 aa63e7ab1bae34feffbbfaae902f11c6e797ba9d SHA1 f7334a4750b1a1bb2f24021dff884733a88ac347 SHA256 2613f51ee9e3a258dbab38ff2df724f2971a50a5ad8c097cb5a4e3744df5fc8a
9
-AUX eblits/src_compile-v1.eblit 1897 RMD160 45aa94bdf920a567ab9002309f6afbed8ba13abb SHA1 83c7fce59355d4bc7684bcfad975a147426f7911 SHA256 0fe6bfd4734f0dfe0bf420b09a5e19698490a8441c1ee20d7446bcceee480336
10
-AUX eblits/src_configure-v1.eblit 10019 RMD160 32f9cf226742689ed0ddf8c2fe87fa3233f83071 SHA1 2e027b84a318452068dcee0a1d1934d1b4b14e03 SHA256 540e9e770a8039aa4b40f9f915cb839e7f2ed8c05a06b9cf87f41253f0ccb5bc
11
-AUX eblits/src_install-v1.eblit 4415 RMD160 dc02d3abc3aa3dae2208675c4f00b3d616d1262b SHA1 f41b3430e0054866dbfbdbac5ce11127d4963112 SHA256 0dba349226de4559cd62c73572cb5c1d8213d7ce9f7d5338887d71158f2da64e
12
-AUX eblits/src_prepare-v1.eblit 2616 RMD160 ccff64d09cc90ada1ea5d1311457cf9a05f12f8e SHA1 7db40d0ca7ef01e5b61962f261511803f768f1bc SHA256 915b9755a37f7670f6e436fe5072dae8f5e6b437ccdfbff835e26bb2f9d22b1e
13
-AUX eblits/src_test-v1.eblit 1480 RMD160 68ef731042ef236efee923649b318239c0219d52 SHA1 81c047f180e43eb1e6b0309ee8d6751950ce1b97 SHA256 ddc836ca2e7b2abac20450fc6eb8c7d30277c567d23051016b903ece1d07a6b2
14
-AUX php-5.2.12-libpng14.patch 222 RMD160 d63bd712d077d9606a02d6620c7084bca7197c01 SHA1 a25a47386d625a47698094fc4825208c6ec8f2a4 SHA256 af94a9c2a104dcb037aa059dd46b6f534adb939ea44ad4cb9e3a0a7c49b64fab
15
-AUX php-5.3.1-sha512.diff 58046 RMD160 1479068ed76c041427cdd85f18911b76f5d9bf02 SHA1 6745a2ea314554ddf3550e9ebaa192bc2ed04c8a SHA256 f152e27055e26817448f60b88d8d0738cc3def6d6f10c2d7fbbd84e5a096a344
16
-AUX php5-ldvs 22 RMD160 5846dab2745b68a88175dd4e72d0b8cf4756dd46 SHA1 592398c92575adb14ec972847ce2aca28a7b9c2c SHA256 b79d0e52b1b3b4543b31ad45525ae1c2814a27ea8e676772ab10bf6fb12dfe79
17
-DIST php-5.2.13.tar.bz2 9084518 RMD160 9e21d32a7b757d25ed827834b26235ea1eebfcc8 SHA1 7127a21f1b493e3cd43f45cadecdb46b623eb1fb SHA256 2b50a2535e3bb9a98cd4d1633f9452d877276c40b385915261f040d535c7eadb
18
-DIST php-patchset-5.2.13-r0.tar.bz2 10207 RMD160 b367c17742553fcfbf4cb1b76f8dd4aae9f08cf8 SHA1 20b60e3aef34d0b558f0c896c6981957490b2ba9 SHA256 c71dad65178186786393164a0cb4f056b85f0e00579da3dc2dbe5b863ec4262b
19
-DIST suhosin-patch-5.2.13-0.9.7.patch.gz 22989 RMD160 63a022a5bf0fb8c6688f4c0ebcfaa8a437ea6935 SHA1 e2faf8db2d7facbd44cee2f737ce87732835d341 SHA256 787743e5d201ab2ce3fcc3f252eedd7f167470fa1f55af0646d7f03aab89d184
20
-EBUILD php-5.2.13.ebuild 16876 RMD160 47cb3b5a07da0e1b47ff2b48d9570e16348aa05e SHA1 e485585c4c66dcca2b02343849bde752d0f67ac5 SHA256 fc574234a108f208515199f0d83dff92ba3714e41da6b41621eef6b147ac0501
21
-MISC howto-slot 245 RMD160 cb09ab083354e80e907275b97405c5dbea27751d SHA1 2602522299cb7a9b50d081e2f73e970e54ba57ef SHA256 a17dfddea74501c6c92e565a5b9cc9117f86bc740d5976f4dbb1c8d490c0744c
... ...
@@ -1,2 +0,0 @@
1
-MANPATH="/usr/lib/php5/man/"
2
-CONFIG_PROTECT_MASK="/etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/"
... ...
@@ -1,14 +0,0 @@
1
-<IfDefine PHP5>
2
-	# Load the module first
3
-	<IfModule !mod_php5.c>
4
-		LoadModule php5_module    modules/libphp5.so
5
-	</IfModule>
6
-
7
-	# Set it to handle the files
8
-	<IfModule mod_mime.c>
9
-		AddHandler application/x-httpd-php .php .php5 .phtml
10
-		AddHandler application/x-httpd-php-source .phps
11
-	</IfModule>
12
-
13
-	DirectoryIndex index.php index.phtml
14
-</IfDefine>
... ...
@@ -1,17 +0,0 @@
1
-<IfDefine PHP5>
2
-	# Load the module first
3
-	<IfModule !mod_php5.c>
4
-		LoadModule php5_module    modules/libphp5.so
5
-	</IfModule>
6
-
7
-	# Set it to handle the files
8
-	<FilesMatch "\.ph(p5?|tml)$">
9
-		SetHandler application/x-httpd-php
10
-	</FilesMatch>
11
-
12
-	<FilesMatch "\.phps$">
13
-		SetHandler application/x-httpd-php-source
14
-	</FilesMatch>
15
-
16
-	DirectoryIndex index.php index.phtml
17
-</IfDefine>
... ...
@@ -1,14 +0,0 @@
1
-<IfDefine PHP5>
2
-	# Load the module first
3
-	<IfModule !mod_php5.c>
4
-		LoadModule php5_module    modules/libphp5.so
5
-	</IfModule>
6
-
7
-	# Set it to handle the files
8
-	<IfModule mod_mime.c>
9
-		AddHandler application/x-httpd-php .php .php5 .phtml
10
-		AddHandler application/x-httpd-php-source .phps
11
-	</IfModule>
12
-
13
-	DirectoryIndex index.php index.phtml
14
-</IfDefine>
... ...
@@ -1,17 +0,0 @@
1
-<IfDefine PHP5>
2
-	# Load the module first
3
-	<IfModule !mod_php5.c>
4
-		LoadModule php5_module    modules/libphp5.so
5
-	</IfModule>
6
-
7
-	# Set it to handle the files
8
-	<FilesMatch "\.ph(p5?|tml)$">
9
-		SetHandler application/x-httpd-php5
10
-	</FilesMatch>
11
-
12
-	<FilesMatch "\.phps$">
13
-		SetHandler application/x-httpd-php5-source
14
-	</FilesMatch>
15
-
16
-	DirectoryIndex index.php index.phtml
17
-</IfDefine>
... ...
@@ -1,9 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/common-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
4
-
5
-php_set_ini_dir() {
6
-	PHP_INI_DIR="/etc/php/${1}-php${PHP_MV}"
7
-	PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
8
-	PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
9
-}
... ...
@@ -1,72 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_postinst-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
4
-
5
-eblit-php-pkg_postinst() {
6
-	# Output some general info to the user
7
-	if use apache2 ; then
8
-		APACHE2_MOD_DEFINE="PHP${PHP_MV}"
9
-		if use concurrentmodphp ; then
10
-			APACHE2_MOD_CONF="70_mod_php${PHP_MV}_concurr"
11
-		else
12
-			APACHE2_MOD_CONF="70_mod_php${PHP_MV}"
13
-		fi
14
-		apache-module_pkg_postinst
15
-	fi
16
-
17
-	# Update Apache2 to use mod_php
18
-	if use apache2 ; then
19
-		"${ROOT}/usr/sbin/php-select" -t apache2 php${PHP_MV} > /dev/null 2>&1
20
-		exitStatus=$?
21
-		if [[ ${exitStatus} == 2 ]] ; then
22
-			php-select apache2 php${PHP_MV}
23
-		elif [[ ${exitStatus} == 4 ]] ; then
24
-			ewarn "To make Apache2 use php-${PHP_MV}, use"
25
-			ewarn "    php-select apache2 php${PHP_MV}"
26
-			ewarn
27
-		fi
28
-	fi
29
-
30
-	# Create the symlinks for php-cli
31
-	if use cli ; then
32
-		"${ROOT}/usr/sbin/php-select" -t php php${PHP_MV} > /dev/null 2>&1
33
-		exitStatus=$?
34
-		if [[ ${exitStatus} == 5 ]] ; then
35
-			php-select php php${PHP_MV}
36
-		elif [[ ${exitStatus} == 4 ]] ; then
37
-			ewarn "To make usr/bin/php point to php-${PHP_MV}, use"
38
-			ewarn "    php-select php php${PHP_MV}"
39
-			ewarn
40
-		fi
41
-	fi
42
-
43
-	# Create the symlinks for php-cgi
44
-	if use cgi ; then
45
-		"${ROOT}/usr/sbin/php-select" -t php-cgi php${PHP_MV} > /dev/null 2>&1
46
-		exitStatus=$?
47
-		if [[ ${exitStatus} == 5 ]] ; then
48
-			php-select php-cgi php${PHP_MV}
49
-		elif [[ ${exitStatus} == 4 ]] ; then
50
-			ewarn "To make usr/bin/php-cgi point to php-${PHP_MV}, use"
51
-			ewarn "    php-select php-cgi php${PHP_MV}"
52
-			ewarn
53
-		fi
54
-	fi
55
-
56
-	# Create the symlinks for php-devel
57
-	"${ROOT}/usr/sbin/php-select" -t php-devel php${PHP_MV} > /dev/null 2>&1
58
-	exitStatus=$?
59
-	if [[ $exitStatus == 5 ]] ; then
60
-		php-select php-devel php${PHP_MV}
61
-	elif [[ $exitStatus == 4 ]] ; then
62
-		ewarn "To make usr/bin/php-config and usr/bin/phpize point to php-${PHP_MV}, use"
63
-		ewarn "    php-select php-devel php${PHP_MV}"
64
-		ewarn
65
-	fi
66
-
67
-	ewarn "You may have to recompile third-party extensions now"
68
-	ewarn "(includes every dev-php5/pecl-* package and probably others in that category)"
69
-	ewarn
70
-}
71
-
72
-
... ...
@@ -1,28 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_setup-v1.eblit,v 1.2 2010/07/08 22:39:52 mabi Exp $
4
-
5
-eblit-php-pkg_setup() {
6
-	if use concurrentmodphp || use kolab ; then
7
-		ewarn "concurrentmodphp and kolab are Gentoo-specific experimental"
8
-		ewarn "patches. Before reporting any bugs to bugs.php.net, make sure to"
9
-		ewarn "rebuild PHP with those USE flags disabled"
10
-		ewarn
11
-	fi
12
-
13
-	# Mail support
14
-	php_check_mta
15
-
16
-	# imap support
17
-	# if virtuals/imap-c-client goes to new style virtual, we  can exchange this
18
-	# for proper use-deps
19
-	php_check_imap
20
-
21
-	# Oracle support
22
-	php_check_oracle_8
23
-
24
-	phpconfutils_warn_about_external_deps
25
-	depend.apache_pkg_setup
26
-}
27
-
28
-
... ...
@@ -1,90 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
4
-
5
-eblit-php-src_compile() {
6
-	SAPI_DIR="${WORKDIR}/sapis"
7
-	local is_first_sapi=1
8
-
9
-	for sapi in ${SAPIS} ; do
10
-		use "${sapi}" || continue
11
-		if [[ ${is_first_sapi} == 1 ]]; then
12
-			is_first_sapi=0
13
-		else
14
-			emake clean
15
-		fi
16
-
17
-		php_sapi_build "${sapi}"
18
-		php_sapi_copy "${sapi}"
19
-	done
20
-}
21
-
22
-php_sapi_build() {
23
-	local sapi="$1"
24
-	php_set_ini_dir "${sapi}"
25
-
26
-	mkdir -p "${SAPI_DIR}/${sapi}"
27
-
28
-	sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
29
-		--with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
30
-
31
-	for one_sapi in $SAPIS ; do
32
-		case "$one_sapi" in
33
-			cli|cgi|embed|fpm)
34
-				if [[ "${one_sapi}" == "${sapi}" ]] ; then
35
-					sapi_conf="${sapi_conf} --enable-${one_sapi}"
36
-				else
37
-					sapi_conf="${sapi_conf} --disable-${one_sapi}"
38
-				fi
39
-				;;
40
-
41
-			apache2)
42
-				if [[ "${one_sapi}" == "${sapi}" ]] ; then
43
-					sapi_conf="${sapi_conf} --with-apxs2=/usr/sbin/apxs"
44
-				else
45
-					sapi_conf="${sapi_conf} --without-apxs2"
46
-				fi
47
-				;;
48
-
49
-		esac
50
-	done
51
-
52
-	econf ${sapi_conf}
53
-	emake || die "emake failed"
54
-}
55
-
56
-php_sapi_copy() {
57
-	local sapi="$1"
58
-	local source=""
59
-
60
-	case "$sapi" in
61
-		cli)
62
-			source="sapi/cli/php"
63
-			;;
64
-		cgi)
65
-			source="sapi/cgi/php-cgi"
66
-			;;
67
-		fpm)
68
-			source="sapi/fpm/php-fpm"
69
-			;;
70
-		embed)
71
-			source="libs/libphp${PHP_MV}.so"
72
-			;;
73
-
74
-		apache2)
75
-			# apache2 is a special case; the necessary files
76
-			# (yes, multiple) are copied by make install, not
77
-			# by the ebuild; that's the reason, why apache2 has
78
-			# to be the last sapi
79
-			emake INSTALL_ROOT="${SAPI_DIR}/${sapi}/" install-sapi
80
-			;;
81
-
82
-		*)
83
-			die "unhandled sapi in php_sapi_copy"
84
-			;;
85
-	esac
86
-
87
-	if [[ "${source}" ]] ; then
88
-		cp "$source" "${SAPI_DIR}/$sapi" || die "Unable to copy ${sapi} SAPI"
89
-	fi
90
-}
... ...
@@ -1,246 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
4
-
5
-eblit-php-src_configure() {
6
-	PHP_DESTDIR="/usr/$(get_libdir)/php${PHP_MV}"
7
-
8
-	# This is a global variable and should be in caps. It isn't because the
9
-	# phpconfutils eclass relies on exactly this name...
10
-	# for --with-libdir see bug #327025
11
-	my_conf="
12
-		--prefix="${PHP_DESTDIR}"
13
-		--mandir="${PHP_DESTDIR}"/man
14
-		--infodir="${PHP_DESTDIR}"/info
15
-		--libdir="${PHP_DESTDIR}"/lib
16
-		--with-libdir=$(get_libdir)
17
-		--without-pear
18
-		$(use_enable threads maintainer-zts)"
19
-
20
-	phpconfutils_init
21
-
22
-	#                             extension	      USE flag        shared
23
-	phpconfutils_extension_enable  "bcmath"       "bcmath"           1
24
-	phpconfutils_extension_with    "bz2"          "bzip2"            1
25
-	phpconfutils_extension_enable  "calendar"     "calendar"         1
26
-	phpconfutils_extension_disable "ctype"        "ctype"            0
27
-	phpconfutils_extension_with    "curl"         "curl"             1
28
-	phpconfutils_extension_with    "curlwrappers" "curlwrappers"     0
29
-	phpconfutils_extension_disable "dom"          "xml"              0
30
-	phpconfutils_extension_with    "enchant"      "enchant"          1 "/usr"
31
-	phpconfutils_extension_enable  "exif"         "exif"             1
32
-	phpconfutils_extension_disable "fileinfo"     "fileinfo"         1
33
-	phpconfutils_extension_disable "filter"       "filter"           0
34
-	phpconfutils_extension_enable  "ftp"          "ftp"              1
35
-	phpconfutils_extension_with    "gettext"      "nls"              1
36
-	phpconfutils_extension_with    "gmp"          "gmp"              1
37
-	phpconfutils_extension_disable "hash"         "hash"             0
38
-	phpconfutils_extension_without "iconv"        "iconv"            0
39
-	phpconfutils_extension_enable  "intl"         "intl"             1
40
-	phpconfutils_extension_disable "ipv6"         "ipv6"             0
41
-	phpconfutils_extension_disable "json"         "json"             0
42
-	phpconfutils_extension_with    "kerberos"     "kerberos"         0 "/usr"
43
-	phpconfutils_extension_disable "libxml"       "xml"              0
44
-	phpconfutils_extension_enable  "mbstring"     "unicode"          1
45
-	phpconfutils_extension_with    "mcrypt"       "crypt"            1
46
-	phpconfutils_extension_with    "mssql"        "mssql"            1
47
-	phpconfutils_extension_with    "onig"         "unicode"          0 "/usr"
48
-	phpconfutils_extension_with    "openssl"      "ssl"              0
49
-	phpconfutils_extension_with    "openssl-dir"  "ssl"              0 "/usr"
50
-	phpconfutils_extension_enable  "pcntl"        "pcntl"            1
51
-	phpconfutils_extension_disable "phar"         "phar"             1
52
-	phpconfutils_extension_disable "pdo"          "pdo"              0
53
-	phpconfutils_extension_with    "pgsql"        "postgres"         1
54
-	phpconfutils_extension_disable "posix"        "posix"            0
55
-	phpconfutils_extension_with    "pspell"       "spell"            1
56
-	phpconfutils_extension_with    "recode"       "recode"           1
57
-	phpconfutils_extension_disable "simplexml"    "simplexml"        0
58
-	phpconfutils_extension_enable  "shmop"        "sharedmem"        0
59
-	phpconfutils_extension_with    "snmp"         "snmp"             1
60
-	phpconfutils_extension_enable  "soap"         "soap"             1
61
-	phpconfutils_extension_enable  "sockets"      "sockets"          1
62
-	phpconfutils_extension_without "sqlite3"      "sqlite3"          1 "/usr"
63
-	phpconfutils_extension_with    "sybase-ct"    "sybase-ct"        1
64
-	phpconfutils_extension_enable  "sysvmsg"      "sysvipc"          1
65
-	phpconfutils_extension_enable  "sysvsem"      "sysvipc"          1
66
-	phpconfutils_extension_enable  "sysvshm"      "sysvipc"          1
67
-	phpconfutils_extension_with    "tidy"         "tidy"             1
68
-	phpconfutils_extension_disable "tokenizer"    "tokenizer"        0
69
-	phpconfutils_extension_enable  "wddx"         "wddx"             1
70
-	phpconfutils_extension_disable "xml"          "xml"              0
71
-	phpconfutils_extension_disable "xmlreader"    "xmlreader"        0
72
-	phpconfutils_extension_disable "xmlwriter"    "xmlwriter"        0
73
-	phpconfutils_extension_with    "xmlrpc"       "xmlrpc"           1
74
-	phpconfutils_extension_with    "xsl"          "xsl"              1
75
-	phpconfutils_extension_enable  "zip"          "zip"              1
76
-	phpconfutils_extension_with    "zlib"         "zlib"             1
77
-	phpconfutils_extension_enable  "debug"        "debug"            0
78
-
79
-	# DBA support
80
-	if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
81
-		|| use qdbm ; then
82
-		my_conf="${my_conf} --enable-dba${shared}"
83
-	fi
84
-
85
-	# DBA drivers support
86
-	phpconfutils_extension_with   "cdb"        "cdb"      0
87
-	phpconfutils_extension_with   "db4"        "berkdb"   0
88
-	phpconfutils_extension_enable "flatfile"   "flatfile" 0
89
-	phpconfutils_extension_with   "gdbm"       "gdbm"     0
90
-	phpconfutils_extension_enable "inifile"    "inifile"  0
91
-	phpconfutils_extension_with   "qdbm"       "qdbm"     0
92
-
93
-	# Support for the GD graphics library
94
-	if use gd-external ; then
95
-		phpconfutils_extension_with   "freetype-dir" "truetype"    0 "/usr"
96
-		phpconfutils_extension_with   "t1lib"        "truetype"    0 "/usr"
97
-		phpconfutils_extension_enable "gd-jis-conv"  "cjk"         0
98
-		phpconfutils_extension_with   "gd"           "gd-external" 1 "/usr"
99
-	else
100
-		phpconfutils_extension_with   "freetype-dir" "truetype"    0 "/usr"
101
-		phpconfutils_extension_with   "t1lib"        "truetype"    0 "/usr"
102
-		phpconfutils_extension_enable "gd-jis-conv"  "cjk"         0
103
-		phpconfutils_extension_with   "jpeg-dir"     "gd"          0 "/usr"
104
-		phpconfutils_extension_with   "png-dir"      "gd"          0 "/usr"
105
-		phpconfutils_extension_with   "xpm-dir"      "xpm"         0 "/usr"
106
-		# enable gd last, so configure can pick up the previous settings
107
-		phpconfutils_extension_with   "gd"           "gd"          0
108
-	fi
109
-
110
-	# IMAP support
111
-	if use imap ; then
112
-		phpconfutils_extension_with "imap"     "imap" 1
113
-		phpconfutils_extension_with "imap-ssl" "ssl"  0
114
-	fi
115
-
116
-	phpconfutils_extension_with "interbase"	"interbase"	0 "/opt"
117
-	phpconfutils_extension_with	"interbase"	"firebird"	0 "/usr"
118
-
119
-	# LDAP support
120
-	if use ldap ; then
121
-		if use oci8 ; then
122
-			phpconfutils_extension_with "ldap" "ldap" 1 "${ORACLE_HOME}"
123
-		else
124
-			phpconfutils_extension_with "ldap"      "ldap"      1
125
-			phpconfutils_extension_with "ldap-sasl" "ldap-sasl" 0
126
-		fi
127
-	fi
128
-
129
-	# MySQL support
130
-	if use mysql ; then
131
-		if use mysqlnd ; then
132
-			phpconfutils_extension_with "mysql"      "mysql" 1 "mysqlnd"
133
-		else
134
-			phpconfutils_extension_with "mysql"      "mysql" 1 "/usr"
135
-		fi
136
-		phpconfutils_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock"
137
-	fi
138
-
139
-	# MySQLi support
140
-	if use mysqlnd ; then
141
-		phpconfutils_extension_with "mysqli" "mysqli" 1 "mysqlnd"
142
-	else
143
-		phpconfutils_extension_with "mysqli" "mysqli" 1 "/usr/bin/mysql_config"
144
-	fi
145
-
146
-	# ODBC support
147
-	if use odbc ; then
148
-		phpconfutils_extension_with "unixODBC" "odbc"     1 "/usr"
149
-		phpconfutils_extension_with "adabas"   "adabas"   1
150
-		phpconfutils_extension_with "birdstep" "birdstep" 1
151
-		phpconfutils_extension_with "dbmaker"  "dbmaker"  1
152
-		phpconfutils_extension_with "empress"  "empress"  1
153
-		if use empress ; then
154
-			phpconfutils_extension_with "empress-bcs" "empress-bcs" 0
155
-		fi
156
-		phpconfutils_extension_with "esoob"   "esoob" 1
157
-		phpconfutils_extension_with "ibm-db2" "db2"   1
158
-		phpconfutils_extension_with "sapdb"   "sapdb" 1
159
-		phpconfutils_extension_with "solid"   "solid" 1
160
-	fi
161
-
162
-	if use iodbc ; then
163
-		phpconfutils_extension_with "iodbc"   "iodbc" 1 "/usr"
164
-	fi
165
-
166
-	# Oracle support
167
-	phpconfutils_extension_with "oci8" "oci8" 1
168
-	if use oci8-instant-client ; then
169
-		OCI8IC_PKG="$(best_version dev-db/oracle-instantclient-basic | \
170
-			sed -e 's|dev-db/oracle-instantclient-basic-||g' | \
171
-			sed -e 's|-r.*||g')"
172
-
173
-		phpconfutils_extension_with "oci8" "oci8-instant-client" 1 \
174
-			"instantclient,/usr/lib/oracle/${OCI8IC_PKG}/client/lib"
175
-	fi
176
-
177
-	# PDO support
178
-	if use pdo ; then
179
-		phpconfutils_extension_with "pdo-dblib"  "mssql"    1
180
-		if use mysqlnd ; then
181
-			phpconfutils_extension_with "pdo-mysql"  "mysql"    1 "mysqlnd"
182
-		else
183
-			phpconfutils_extension_with "pdo-mysql"  "mysql"    1 "/usr"
184
-		fi
185
-		phpconfutils_extension_with "pdo-pgsql"  "postgres"	1
186
-		phpconfutils_extension_with "pdo-sqlite" "sqlite"   1 "/usr"
187
-		phpconfutils_extension_with "pdo-odbc"   "odbc"     1 "unixODBC,/usr"
188
-		if use oci8 ; then
189
-			phpconfutils_extension_with "pdo-oci" "oci8" 1
190
-		fi
191
-		if use oci8-instant-client ; then
192
-			phpconfutils_extension_with "pdo-oci" "oci8-instant-client" 1 \
193
-				"instantclient,/usr,${OCI8IC_PKG}"
194
-		fi
195
-	fi
196
-
197
-	# readline/libedit support
198
-	phpconfutils_extension_with "readline" "readline" 0
199
-	phpconfutils_extension_with "libedit"  "libedit"  0
200
-
201
-	# Session support
202
-	if use session ; then
203
-		phpconfutils_extension_with "mm" "sharedmem" 0
204
-	else
205
-		phpconfutils_extension_disable "session" "session" 0
206
-	fi
207
-
208
-	# SQLite support
209
-	if use sqlite ; then
210
-		phpconfutils_extension_with   "sqlite"      "sqlite"  0 "/usr"
211
-		phpconfutils_extension_enable "sqlite-utf8" "unicode" 0
212
-	else
213
-		phpconfutils_extension_without "sqlite" "sqlite" 0
214
-	fi
215
-
216
-	if use pic ; then
217
-		my_conf="${my_conf} --with-pic"
218
-	fi
219
-
220
-	if has fpm ${IUSE//+} && use fpm ; then
221
-		my_conf="${my_conf} --with-libevent-dir=/usr/lib"
222
-	fi
223
-
224
-
225
-	# we use the system copy of pcre
226
-	# --with-pcre-regex affects ext/pcre
227
-	# --with-pcre-dir affects ext/filter and ext/zip
228
-	my_conf="${my_conf} --with-pcre-regex=/usr --with-pcre-dir=/usr"
229
-
230
-	# Catch CFLAGS problems
231
-	php_check_cflags
232
-
233
-	# Support user-passed configuration parameters
234
-	my_conf="${my_conf} ${EXTRA_ECONF:-}"
235
-
236
-	# Support the Apache2 extras, they must be set globally for all
237
-	# SAPIs to work correctly, especially for external PHP extensions
238
-	if use apache2 ; then
239
-		# Concurrent PHP Apache2 modules support
240
-		if use concurrentmodphp ; then
241
-			append-ldflags "-Wl,--version-script=${FILESDIR}/php${PHP_MV}-ldvs"
242
-		fi
243
-	fi
244
-}
245
-
246
-
... ...
@@ -1,140 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit,v 1.4 2010/07/26 13:42:12 mabi Exp $
4
-
5
-eblit-php-src_install() {
6
-	# Makefile forgets to create this before trying to write to it...
7
-	dodir "${PHP_DESTDIR}/bin"
8
-
9
-	# Install php environment (without any sapis)
10
-	emake INSTALL_ROOT="${D}" \
11
-		install-build install-headers install-programs \
12
-		|| die "emake install failed"
13
-
14
-	local extension_dir="$("${D}/${PHP_DESTDIR}/bin/php-config" --extension-dir)"
15
-
16
-	# And install the modules to it
17
-	if use sharedext ; then
18
-		insinto "${extension_dir}"
19
-		doins "${S}/modules/"*.so
20
-	fi
21
-
22
-	# Generate the USE file for PHP
23
-	phpconfutils_generate_usefile
24
-
25
-	# Create the directory where we'll put version-specific php scripts
26
-	keepdir /usr/share/php${PHP_MV}
27
-
28
-	local sapi="", file=""
29
-	local sapi_list=""
30
-
31
-	for sapi in ${SAPIS}; do
32
-		if use "${sapi}" ; then
33
-			einfo "Installing SAPI: ${sapi}"
34
-			# needed each time, php_install_ini would reset it
35
-			into "${PHP_DESTDIR}"
36
-			file=$(find "${SAPI_DIR}/${sapi}/" -type f | head -n 1)
37
-
38
-			if [[ "${file: -3}" == ".so" ]]; then 
39
-				if [[ "${sapi}" == "apache2" ]]; then
40
-					insinto "${PHP_DESTDIR}/../apache2/modules/"
41
-					newins "${file}" "${file/*\/}"
42
-				else
43
-					dolib.so "${file}" || die "Unable to install ${sapi} sapi"
44
-				fi
45
-			else
46
-				dobin "${file}" || die "Unable to install ${sapi} sapi"
47
-			fi
48
-
49
-			php_install_ini "${sapi}"
50
-
51
-			# construct correct SAPI string for php-config
52
-			# thanks to ferringb for the bash voodoo
53
-			if [[ "${sapi}" == "apache2" ]]; then
54
-			    sapi_list="${sapi_list:+${sapi_list} }apache2handler"
55
-			else
56
-				sapi_list="${sapi_list:+${sapi_list} }${sapi}"
57
-			fi
58
-		fi
59
-	done
60
-
61
-	# Install env.d files
62
-	newenvd "${FILESDIR}/20php${PHP_MV}-envd" \
63
-		"20php${PHP_MV}"
64
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i \
65
-		"${D}/etc/env.d/20php${PHP_MV}"
66
-
67
-	# set php-config variable correctly (bug #278439)
68
-	sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
69
-		"${D}/usr/$(get_libdir)/php5/bin/php-config"
70
-}
71
-
72
-php_install_ini() {
73
-	local phpsapi="${1}"
74
-
75
-	# work out where we are installing the ini file
76
-	php_set_ini_dir "${phpsapi}"
77
-
78
-	local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
79
-	cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
80
-
81
-	# default to expose_php=Off, bug 300695
82
-	sed -e 's|^expose_php .*|expose_php = Off|g' -i "${phpinisrc}"
83
-
84
-	# Set the extension dir
85
-	sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
86
-
87
-	# Set the include path to point to where we want to find PEAR packages
88
-	sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php'${PHP_MV}':/usr/share/php"|' -i "${phpinisrc}"
89
-
90
-	dodir "${PHP_INI_DIR}"
91
-	insinto "${PHP_INI_DIR}"
92
-	newins "${phpinisrc}" "${PHP_INI_FILE}"
93
-
94
-	dodir "${PHP_EXT_INI_DIR}"
95
-	dodir "${PHP_EXT_INI_DIR_ACTIVE}"
96
-
97
-	# Install any extensions built as shared objects
98
-	if use sharedext ; then
99
-		insinto "${PHP_EXT_INI_DIR}"
100
-		for extension in "${D}/${extension_dir}/"*.so ; do
101
-			extension="${extension##*/}"
102
-			inifilename="${extension/.so/.ini}"
103
-			echo "extension=${extension}" > "${S}/modules/$inifilename"
104
-			doins "${S}/modules/$inifilename"
105
-			dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
106
-		done
107
-	fi
108
-
109
-	# SAPI-specific handling
110
-	if [[ "${sapi}" == "apache2" ]] ; then
111
-		if use concurrentmodphp ; then
112
-			einfo "Installing Apache2 config file 70_mod_php${PHP_MV}_concurr.conf"
113
-			insinto "${APACHE_MODULES_CONFDIR}"
114
-			newins "${FILESDIR}/70_mod_php${PHP_MV}_concurr.conf-apache2" \
115
-				"70_mod_php${PHP_MV}_concurr.conf"
116
-
117
-			# Put the ld version script in the right place so
118
-			# it's always accessible
119
-			insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
120
-			doins "${FILESDIR}/php${PHP_MV}-ldvs"
121
-		else
122
-			einfo "Installing Apache2 config 70_mod_php${PHP_MV}.conf)"
123
-			insinto ${APACHE_MODULES_CONFDIR}
124
-			newins "${FILESDIR}/70_mod_php${PHP_MV}.conf-apache2" \
125
-				"70_mod_php${PHP_MV}.conf"
126
-		fi
127
-	fi
128
-
129
-	if [[ "${sapi}" == "fpm" ]] ; then
130
-		einfo "Installing FPM CGI config file php-fpm.conf"
131
-		epatch "${FILESDIR}/php-fpm-gentooified.patch"
132
-		insinto ${PHP_INI_DIR}
133
-		doins "${S}/sapi/fpm/php-fpm.conf"
134
-		dodir "/etc/init.d"
135
-		insinto "/etc/init.d"
136
-		newins  "${FILESDIR}/php-fpm.init" "php-fpm"
137
-		fperms 755 "/etc/init.d/php-fpm"
138
-		dosym "${PHP_DESTDIR}/bin/php-fpm" "/usr/bin/php-fpm"
139
-	fi
140
-}
... ...
@@ -1,70 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_prepare-v1.eblit,v 1.3 2010/06/01 16:17:05 mabi Exp $
4
-
5
-eblit-php-src_prepare() {
6
-	# USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
7
-	# ([empty session.save_path]/session_mm_[sapi][gid].sem)
8
-	# there is no easy way to circumvent that, all php calls during
9
-	# install use -n, so no php.ini file will be used.
10
-	# As such, this is the easiest way to get around
11
-	addpredict /session_mm_cli250.sem
12
-	addpredict /session_mm_cli0.sem
13
-
14
-	# Concurrent PHP Apache2 modules support
15
-	use apache2 && use concurrentmodphp && \
16
-		epatch "${WORKDIR}/${PV}/opt/concurrent_apache_modules.patch"
17
-
18
-	# kolab support (support for imap annotations)
19
-	use kolab && epatch "${WORKDIR}/${PV}/opt/imap-kolab-annotations.patch"
20
-
21
-	# Change PHP branding
22
-	sed -re	"s|^(PHP_EXTRA_VERSION=\").*(\")|\1${PHP_EXTRA_BRANDING}-pl${PR/r/}-gentoo\2|g" \
23
-		-i configure.in || die "Unable to change PHP branding"
24
-
25
-	# Apply generic PHP patches
26
-	EPATCH_SOURCE="${WORKDIR}/${PV}/generic" EPATCH_SUFFIX="patch" \
27
-		EPATCH_FORCE="yes" \
28
-		EPATCH_MULTI_MSG="Applying generic patches and fixes from upstream..." epatch
29
-
30
-	# Patch PHP to show Gentoo as the server platform
31
-	sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
32
-		-i configure.in || die "Failed to fix server platform name"
33
-
34
-	# Prevent PHP from activating the Apache config,
35
-	# as we will do that ourselves
36
-	sed -i \
37
-		-e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
38
-		-e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
39
-		configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
40
-
41
-	# Patch PHP to support heimdal instead of mit-krb5
42
-	if has_version "app-crypt/heimdal" ; then
43
-		sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
44
-			|| die "Failed to fix heimdal libname"
45
-		sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
46
-			|| die "Failed to fix heimdal crypt library reference"
47
-	fi
48
-
49
-	# Suhosin support
50
-	if use suhosin ; then
51
-		epatch "${WORKDIR}/${SUHOSIN_PATCH}"
52
-	fi
53
-
54
-	# rebuild the whole autotools stuff as we are heavily patching it
55
-	# (suhosin, fastbuild, ...)
56
-
57
-	# eaclocal doesn't accept --force, so we try to force re-generation
58
-	# this way
59
-	rm aclocal.m4
60
-
61
-	# work around divert() issues with newer autoconf, bug #281697
62
-	if has_version '>=sys-devel/autoconf-2.64' ; then
63
-		sed -i -r \
64
-			-e 's:^((m4_)?divert)[(]([0-9]*)[)]:\1(600\3):' \
65
-			$(grep -l divert $(find . -name '*.m4') configure.in) || die
66
-	fi
67
-	eautoreconf --force -W no-cross
68
-}
69
-
70
-
... ...
@@ -1,54 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_test-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
4
-
5
-eblit-php-src_test() {
6
-	vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
7
-
8
-	if [[ ! -x "${S}/sapi/cli/php" ]] ; then
9
-		ewarn "Test phase requires USE=cli, skipping"
10
-		return
11
-	else
12
-		export TEST_PHP_EXECUTABLE="${S}/sapi/cli/php"
13
-	fi
14
-
15
-	if [[ -x "${S}/sapi/cgi/php-cgi" ]] ; then
16
-		export TEST_PHP_CGI_EXECUTABLE="${S}/sapi/cgi/php-cgi"
17
-	fi
18
-	
19
-	
20
-	REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n  -d "session.save_path=${T}" \
21
-		"${S}/run-tests.php" -n -q -d "session.save_path=${T}"
22
-
23
-	for name in ${EXPECTED_TEST_FAILURES}; do
24
-		mv "${name}.out" "${name}.out.orig" 2>/dev/null
25
-	done
26
-
27
-	local failed="$(find -name '*.out')"
28
-	if [[ ${failed} != "" ]] ; then
29
-		ewarn "The following test cases failed unexpectedly:"
30
-		for name in ${failed}; do
31
-			ewarn "  ${name/.out/}"
32
-		done
33
-	else
34
-		einfo "No unexpected test failures, all fine"
35
-	fi
36
-
37
-	if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
38
-		local passed=""
39
-		for name in ${EXPECTED_TEST_FAILURES}; do
40
-			[[ -f "${name}.diff" ]] && continue
41
-			passed="${passed} ${name}"
42
-		done
43
-		if [[ ${passed} != "" ]] ; then
44
-			einfo "The following test cases passed unexpectedly:"
45
-			for name in ${passed}; do
46
-				ewarn "  ${passed}"
47
-			done
48
-		else
49
-			einfo "None of the known-to-fail tests passed, all fine"
50
-		fi
51
-	fi
52
-}
53
-
54
-
... ...
@@ -1,11 +0,0 @@
1
---- ext/gd/libgd/gd_png.c
2
-+++ ext/gd/libgd/gd_png.c
3
-@@ -139,7 +139,7 @@
4
- 		return NULL;
5
- 	}
6
- 
7
--	if (!png_check_sig (sig, 8)) { /* bad signature */
8
-+	if (png_sig_cmp (sig, 0, 8)) { /* bad signature */
9
- 		return NULL;
10
- 	}
11
- 
... ...
@@ -1,1801 +0,0 @@
1
-Index: ext/standard/crypt_sha512.c
2
-===================================================================
3
---- ext/standard/crypt_sha512.c	(Revision 0)
4
-+++ ext/standard/crypt_sha512.c	(Revision 291899)
5
-@@ -0,0 +1,831 @@
6
-+/* SHA512-based Unix crypt implementation.
7
-+   Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>.  */
8
-+/* Windows VC++ port by Pierre Joye <pierre@php.net> */
9
-+
10
-+#ifndef PHP_WIN32
11
-+# include <endian.h>
12
-+# include "php.h"
13
-+# include "php_main.h"
14
-+#endif
15
-+
16
-+#include <errno.h>
17
-+#include <limits.h>
18
-+#ifdef PHP_WIN32
19
-+# include "win32/php_stdint.h"
20
-+# include "win32/php_stdbool.h"
21
-+# define __alignof__ __alignof
22
-+# define alloca _alloca
23
-+#else
24
-+# if HAVE_INTTYPES_H
25
-+#  include <inttypes.h>
26
-+# elif HAVE_STDINT_H
27
-+#  include <stdint.h>
28
-+# endif
29
-+# include <stdbool.h>
30
-+#endif
31
-+
32
-+#include <stdio.h>
33
-+#include <stdlib.h>
34
-+
35
-+#ifdef PHP_WIN32
36
-+# include <string.h>
37
-+#else
38
-+# include <sys/param.h>
39
-+# include <sys/types.h>
40
-+# if HAVE_STRING_H
41
-+#  define __USE_GNU 
42
-+#  include <string.h>
43
-+# else
44
-+#  include <strings.h>
45
-+# endif
46
-+#endif
47
-+#if 0
48
-+#ifndef stpncpy
49
-+char * stpncpy(char *dst, const char *src, size_t len)
50
-+{
51
-+	size_t n = strlen(src);
52
-+	if (n > len) {
53
-+		n = len;
54
-+	}
55
-+	return strncpy(dst, src, len) + n;
56
-+}
57
-+#endif
58
-+
59
-+#ifndef mempcpy
60
-+void * mempcpy(void * dst, const void * src, size_t len)
61
-+{
62
-+	return (((char *)memcpy(dst, src, len)) + len);
63
-+}
64
-+#endif
65
-+#endif
66
-+
67
-+#ifndef MIN
68
-+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
69
-+#endif
70
-+#ifndef MAX
71
-+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
72
-+#endif
73
-+
74
-+/* Structure to save state of computation between the single steps.  */
75
-+struct sha512_ctx
76
-+{
77
-+	uint64_t H[8];
78
-+
79
-+	uint64_t total[2];
80
-+	uint64_t buflen;
81
-+	char buffer[256];	/* NB: always correctly aligned for uint64_t.  */
82
-+};
83
-+
84
-+
85
-+#if PHP_WIN32 || (__BYTE_ORDER == __LITTLE_ENDIAN)
86
-+# define SWAP(n) \
87
-+  (((n) << 56)					\
88
-+   | (((n) & 0xff00) << 40)			\
89
-+   | (((n) & 0xff0000) << 24)			\
90
-+   | (((n) & 0xff000000) << 8)			\
91
-+   | (((n) >> 8) & 0xff000000)			\
92
-+   | (((n) >> 24) & 0xff0000)			\
93
-+   | (((n) >> 40) & 0xff00)			\
94
-+   | ((n) >> 56))
95
-+#else
96
-+# define SWAP(n) (n)
97
-+#endif
98
-+
99
-+/* This array contains the bytes used to pad the buffer to the next
100
-+   64-byte boundary.  (FIPS 180-2:5.1.2)  */
101
-+static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ...  */ };
102
-+
103
-+/* Constants for SHA512 from FIPS 180-2:4.2.3.  */
104
-+static const uint64_t K[80] = {
105
-+	UINT64_C (0x428a2f98d728ae22), UINT64_C (0x7137449123ef65cd),
106
-+	UINT64_C (0xb5c0fbcfec4d3b2f), UINT64_C (0xe9b5dba58189dbbc),
107
-+	UINT64_C (0x3956c25bf348b538), UINT64_C (0x59f111f1b605d019),
108
-+	UINT64_C (0x923f82a4af194f9b), UINT64_C (0xab1c5ed5da6d8118),
109
-+	UINT64_C (0xd807aa98a3030242), UINT64_C (0x12835b0145706fbe),
110
-+	UINT64_C (0x243185be4ee4b28c), UINT64_C (0x550c7dc3d5ffb4e2),
111
-+	UINT64_C (0x72be5d74f27b896f), UINT64_C (0x80deb1fe3b1696b1),
112
-+	UINT64_C (0x9bdc06a725c71235), UINT64_C (0xc19bf174cf692694),
113
-+	UINT64_C (0xe49b69c19ef14ad2), UINT64_C (0xefbe4786384f25e3),
114
-+	UINT64_C (0x0fc19dc68b8cd5b5), UINT64_C (0x240ca1cc77ac9c65),
115
-+	UINT64_C (0x2de92c6f592b0275), UINT64_C (0x4a7484aa6ea6e483),
116
-+	UINT64_C (0x5cb0a9dcbd41fbd4), UINT64_C (0x76f988da831153b5),
117
-+	UINT64_C (0x983e5152ee66dfab), UINT64_C (0xa831c66d2db43210),
118
-+	UINT64_C (0xb00327c898fb213f), UINT64_C (0xbf597fc7beef0ee4),
119
-+	UINT64_C (0xc6e00bf33da88fc2), UINT64_C (0xd5a79147930aa725),
120
-+	UINT64_C (0x06ca6351e003826f), UINT64_C (0x142929670a0e6e70),
121
-+	UINT64_C (0x27b70a8546d22ffc), UINT64_C (0x2e1b21385c26c926),
122
-+	UINT64_C (0x4d2c6dfc5ac42aed), UINT64_C (0x53380d139d95b3df),
123
-+	UINT64_C (0x650a73548baf63de), UINT64_C (0x766a0abb3c77b2a8),
124
-+	UINT64_C (0x81c2c92e47edaee6), UINT64_C (0x92722c851482353b),
125
-+	UINT64_C (0xa2bfe8a14cf10364), UINT64_C (0xa81a664bbc423001),
126
-+	UINT64_C (0xc24b8b70d0f89791), UINT64_C (0xc76c51a30654be30),
127
-+	UINT64_C (0xd192e819d6ef5218), UINT64_C (0xd69906245565a910),
128
-+	UINT64_C (0xf40e35855771202a), UINT64_C (0x106aa07032bbd1b8),
129
-+	UINT64_C (0x19a4c116b8d2d0c8), UINT64_C (0x1e376c085141ab53),
130
-+	UINT64_C (0x2748774cdf8eeb99), UINT64_C (0x34b0bcb5e19b48a8),
131
-+	UINT64_C (0x391c0cb3c5c95a63), UINT64_C (0x4ed8aa4ae3418acb),
132
-+	UINT64_C (0x5b9cca4f7763e373), UINT64_C (0x682e6ff3d6b2b8a3),
133
-+	UINT64_C (0x748f82ee5defb2fc), UINT64_C (0x78a5636f43172f60),
134
-+	UINT64_C (0x84c87814a1f0ab72), UINT64_C (0x8cc702081a6439ec),
135
-+	UINT64_C (0x90befffa23631e28), UINT64_C (0xa4506cebde82bde9),
136
-+	UINT64_C (0xbef9a3f7b2c67915), UINT64_C (0xc67178f2e372532b),
137
-+	UINT64_C (0xca273eceea26619c), UINT64_C (0xd186b8c721c0c207),
138
-+	UINT64_C (0xeada7dd6cde0eb1e), UINT64_C (0xf57d4f7fee6ed178),
139
-+	UINT64_C (0x06f067aa72176fba), UINT64_C (0x0a637dc5a2c898a6),
140
-+	UINT64_C (0x113f9804bef90dae), UINT64_C (0x1b710b35131c471b),
141
-+	UINT64_C (0x28db77f523047d84), UINT64_C (0x32caab7b40c72493),
142
-+	UINT64_C (0x3c9ebe0a15c9bebc), UINT64_C (0x431d67c49c100d4c),
143
-+	UINT64_C (0x4cc5d4becb3e42b6), UINT64_C (0x597f299cfc657e2a),
144
-+	UINT64_C (0x5fcb6fab3ad6faec), UINT64_C (0x6c44198c4a475817)
145
-+  };
146
-+
147
-+
148
-+/* Process LEN bytes of BUFFER, accumulating context into CTX.
149
-+   It is assumed that LEN % 128 == 0.  */
150
-+static void
151
-+sha512_process_block(const void *buffer, size_t len, struct sha512_ctx *ctx) {
152
-+	const uint64_t *words = buffer;
153
-+	size_t nwords = len / sizeof(uint64_t);
154
-+	uint64_t a = ctx->H[0];
155
-+	uint64_t b = ctx->H[1];
156
-+	uint64_t c = ctx->H[2];
157
-+	uint64_t d = ctx->H[3];
158
-+	uint64_t e = ctx->H[4];
159
-+	uint64_t f = ctx->H[5];
160
-+	uint64_t g = ctx->H[6];
161
-+	uint64_t h = ctx->H[7];
162
-+
163
-+  /* First increment the byte count.  FIPS 180-2 specifies the possible
164
-+	 length of the file up to 2^128 bits.  Here we only compute the
165
-+	 number of bytes.  Do a double word increment.  */
166
-+	ctx->total[0] += len;
167
-+	if (ctx->total[0] < len) {
168
-+		++ctx->total[1];
169
-+	}
170
-+
171
-+	/* Process all bytes in the buffer with 128 bytes in each round of
172
-+	 the loop.  */
173
-+	while (nwords > 0) {
174
-+		uint64_t W[80];
175
-+		uint64_t a_save = a;
176
-+		uint64_t b_save = b;
177
-+		uint64_t c_save = c;
178
-+		uint64_t d_save = d;
179
-+		uint64_t e_save = e;
180
-+		uint64_t f_save = f;
181
-+		uint64_t g_save = g;
182
-+		uint64_t h_save = h;
183
-+		unsigned int t;
184
-+
185
-+/* Operators defined in FIPS 180-2:4.1.2.  */
186
-+#define Ch(x, y, z) ((x & y) ^ (~x & z))
187
-+#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
188
-+#define S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39))
189
-+#define S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41))
190
-+#define R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7))
191
-+#define R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6))
192
-+
193
-+		/* It is unfortunate that C does not provide an operator for
194
-+		   cyclic rotation.  Hope the C compiler is smart enough.  */
195
-+#define CYCLIC(w, s) ((w >> s) | (w << (64 - s)))
196
-+
197
-+		/* Compute the message schedule according to FIPS 180-2:6.3.2 step 2.  */
198
-+		for (t = 0; t < 16; ++t) {
199
-+			W[t] = SWAP (*words);
200
-+			++words;
201
-+		}
202
-+
203
-+		for (t = 16; t < 80; ++t) {
204
-+			W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16];
205
-+		}
206
-+
207
-+		/* The actual computation according to FIPS 180-2:6.3.2 step 3.  */
208
-+		for (t = 0; t < 80; ++t) {
209
-+			uint64_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t];
210
-+			uint64_t T2 = S0 (a) + Maj (a, b, c);
211
-+			h = g;
212
-+			g = f;
213
-+			f = e;
214
-+			e = d + T1;
215
-+			d = c;
216
-+			c = b;
217
-+			b = a;
218
-+			a = T1 + T2;
219
-+		}
220
-+
221
-+		/* Add the starting values of the context according to FIPS 180-2:6.3.2
222
-+		step 4.  */
223
-+		a += a_save;
224
-+		b += b_save;
225
-+		c += c_save;
226
-+		d += d_save;
227
-+		e += e_save;
228
-+		f += f_save;
229
-+		g += g_save;
230
-+		h += h_save;
231
-+
232
-+		/* Prepare for the next round.  */
233
-+		nwords -= 16;
234
-+	}
235
-+
236
-+	/* Put checksum in context given as argument.  */
237
-+	ctx->H[0] = a;
238
-+	ctx->H[1] = b;
239
-+	ctx->H[2] = c;
240
-+	ctx->H[3] = d;
241
-+	ctx->H[4] = e;
242
-+	ctx->H[5] = f;
243
-+	ctx->H[6] = g;
244
-+	ctx->H[7] = h;
245
-+}
246
-+
247
-+
248
-+/* Initialize structure containing state of computation.
249
-+   (FIPS 180-2:5.3.3)  */
250
-+static void sha512_init_ctx (struct sha512_ctx *ctx) {
251
-+	ctx->H[0] = UINT64_C (0x6a09e667f3bcc908);
252
-+	ctx->H[1] = UINT64_C (0xbb67ae8584caa73b);
253
-+	ctx->H[2] = UINT64_C (0x3c6ef372fe94f82b);
254
-+	ctx->H[3] = UINT64_C (0xa54ff53a5f1d36f1);
255
-+	ctx->H[4] = UINT64_C (0x510e527fade682d1);
256
-+	ctx->H[5] = UINT64_C (0x9b05688c2b3e6c1f);
257
-+	ctx->H[6] = UINT64_C (0x1f83d9abfb41bd6b);
258
-+	ctx->H[7] = UINT64_C (0x5be0cd19137e2179);
259
-+
260
-+	ctx->total[0] = ctx->total[1] = 0;
261
-+	ctx->buflen = 0;
262
-+}
263
-+
264
-+
265
-+/* Process the remaining bytes in the internal buffer and the usual
266
-+	prolog according to the standard and write the result to RESBUF.
267
-+
268
-+	IMPORTANT: On some systems it is required that RESBUF is correctly
269
-+	aligned for a 32 bits value. */
270
-+static void * sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf) {
271
-+	/* Take yet unprocessed bytes into account.  */
272
-+	uint64_t bytes = ctx->buflen;
273
-+	size_t pad;
274
-+	unsigned int i;
275
-+
276
-+	/* Now count remaining bytes.  */
277
-+	ctx->total[0] += bytes;
278
-+	if (ctx->total[0] < bytes) {
279
-+		++ctx->total[1];
280
-+	}
281
-+
282
-+	pad = bytes >= 112 ? 128 + 112 - (size_t)bytes : 112 - (size_t)bytes;
283
-+	memcpy(&ctx->buffer[bytes], fillbuf, pad);
284
-+
285
-+	/* Put the 128-bit file length in *bits* at the end of the buffer.  */
286
-+	*(uint64_t *) &ctx->buffer[bytes + pad + 8] = SWAP(ctx->total[0] << 3);
287
-+	*(uint64_t *) &ctx->buffer[bytes + pad] = SWAP((ctx->total[1] << 3) |
288
-+						(ctx->total[0] >> 61));
289
-+
290
-+	/* Process last bytes.  */
291
-+	sha512_process_block(ctx->buffer, (size_t)(bytes + pad + 16), ctx);
292
-+
293
-+	/* Put result from CTX in first 64 bytes following RESBUF.  */
294
-+	for (i = 0; i < 8; ++i) {
295
-+		((uint64_t *) resbuf)[i] = SWAP(ctx->H[i]);
296
-+	}
297
-+
298
-+	return resbuf;
299
-+}
300
-+
301
-+static void
302
-+sha512_process_bytes(const void *buffer, size_t len, struct sha512_ctx *ctx) {
303
-+	/* When we already have some bits in our internal buffer concatenate
304
-+	 both inputs first.  */
305
-+	if (ctx->buflen != 0) {
306
-+		size_t left_over = (size_t)ctx->buflen;
307
-+		size_t add = (size_t)(256 - left_over > len ? len : 256 - left_over);
308
-+
309
-+		memcpy(&ctx->buffer[left_over], buffer, add);
310
-+		ctx->buflen += add;
311
-+
312
-+		if (ctx->buflen > 128) {
313
-+			sha512_process_block(ctx->buffer, ctx->buflen & ~127, ctx);
314
-+
315
-+			ctx->buflen &= 127;
316
-+			/* The regions in the following copy operation cannot overlap.  */
317
-+			memcpy(ctx->buffer, &ctx->buffer[(left_over + add) & ~127],
318
-+					(size_t)ctx->buflen);
319
-+		}
320
-+
321
-+		buffer = (const char *) buffer + add;
322
-+		len -= add;
323
-+	}
324
-+
325
-+	/* Process available complete blocks.  */
326
-+	if (len >= 128) {
327
-+#if !_STRING_ARCH_unaligned
328
-+/* To check alignment gcc has an appropriate operator.  Other
329
-+   compilers don't.  */
330
-+# if __GNUC__ >= 2
331
-+#  define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint64_t) != 0)
332
-+# else
333
-+#  define UNALIGNED_P(p) (((uintptr_t) p) % sizeof(uint64_t) != 0)
334
-+# endif
335
-+		if (UNALIGNED_P(buffer))
336
-+			while (len > 128) {
337
-+				sha512_process_block(memcpy(ctx->buffer, buffer, 128), 128, ctx);
338
-+				buffer = (const char *) buffer + 128;
339
-+				len -= 128;
340
-+			}
341
-+		else
342
-+#endif
343
-+		{
344
-+		  sha512_process_block(buffer, len & ~127, ctx);
345
-+		  buffer = (const char *) buffer + (len & ~127);
346
-+		  len &= 127;
347
-+		}
348
-+	}
349
-+
350
-+  /* Move remaining bytes into internal buffer.  */
351
-+	if (len > 0) {
352
-+		size_t left_over = (size_t)ctx->buflen;
353
-+
354
-+		memcpy(&ctx->buffer[left_over], buffer, len);
355
-+		left_over += len;
356
-+		if (left_over >= 128) {
357
-+			sha512_process_block(ctx->buffer, 128, ctx);
358
-+			left_over -= 128;
359
-+			memcpy(ctx->buffer, &ctx->buffer[128], left_over);
360
-+		}
361
-+		ctx->buflen = left_over;
362
-+	}
363
-+}
364
-+
365
-+
366
-+/* Define our magic string to mark salt for SHA512 "encryption"
367
-+   replacement.  */
368
-+static const char sha512_salt_prefix[] = "$6$";
369
-+
370
-+/* Prefix for optional rounds specification.  */
371
-+static const char sha512_rounds_prefix[] = "rounds=";
372
-+
373
-+/* Maximum salt string length.  */
374
-+#define SALT_LEN_MAX 16
375
-+/* Default number of rounds if not explicitly specified.  */
376
-+#define ROUNDS_DEFAULT 5000
377
-+/* Minimum number of rounds.  */
378
-+#define ROUNDS_MIN 1000
379
-+/* Maximum number of rounds.  */
380
-+#define ROUNDS_MAX 999999999
381
-+
382
-+/* Table with characters for base64 transformation.  */
383
-+static const char b64t[64] =
384
-+"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
385
-+
386
-+
387
-+char *
388
-+php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) {
389
-+#ifdef PHP_WIN32
390
-+	__declspec(align(64)) unsigned char alt_result[64];
391
-+	__declspec(align(64)) unsigned char temp_result[64];
392
-+#else
393
-+	unsigned char alt_result[64]
394
-+		__attribute__ ((__aligned__ (__alignof__ (uint64_t))));
395
-+	unsigned char temp_result[64]
396
-+		__attribute__ ((__aligned__ (__alignof__ (uint64_t))));
397
-+#endif
398
-+	struct sha512_ctx ctx;
399
-+	struct sha512_ctx alt_ctx;
400
-+	size_t salt_len;
401
-+	size_t key_len;
402
-+	size_t cnt;
403
-+	char *cp;
404
-+	char *copied_key = NULL;
405
-+	char *copied_salt = NULL;
406
-+	char *p_bytes;
407
-+	char *s_bytes;
408
-+	/* Default number of rounds.  */
409
-+	size_t rounds = ROUNDS_DEFAULT;
410
-+	bool rounds_custom = false;
411
-+
412
-+	/* Find beginning of salt string.  The prefix should normally always
413
-+	 be present.  Just in case it is not.  */
414
-+	if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0) {
415
-+		/* Skip salt prefix.  */
416
-+		salt += sizeof(sha512_salt_prefix) - 1;
417
-+	}
418
-+
419
-+	if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1) == 0) {
420
-+		const char *num = salt + sizeof(sha512_rounds_prefix) - 1;
421
-+		char *endp;
422
-+		unsigned long int srounds = strtoul(num, &endp, 10);
423
-+
424
-+		if (*endp == '$') {
425
-+			salt = endp + 1;
426
-+			rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
427
-+			rounds_custom = true;
428
-+		}
429
-+	}
430
-+
431
-+	salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
432
-+	key_len = strlen(key);
433
-+
434
-+	if ((key - (char *) 0) % __alignof__ (uint64_t) != 0) {
435
-+		char *tmp = (char *) alloca (key_len + __alignof__ (uint64_t));
436
-+		key = copied_key =
437
-+		memcpy(tmp + __alignof__(uint64_t) - (tmp - (char *) 0) % __alignof__(uint64_t), key, key_len);
438
-+	}
439
-+
440
-+	if ((salt - (char *) 0) % __alignof__ (uint64_t) != 0) {
441
-+		char *tmp = (char *) alloca(salt_len + __alignof__(uint64_t));
442
-+
443
-+		salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) - (tmp - (char *) 0) % __alignof__(uint64_t), salt, salt_len);
444
-+	}
445
-+
446
-+	/* Prepare for the real work.  */
447
-+	sha512_init_ctx(&ctx);
448
-+
449
-+	/* Add the key string.  */
450
-+	sha512_process_bytes(key, key_len, &ctx);
451
-+
452
-+	/* The last part is the salt string.  This must be at most 16
453
-+	 characters and it ends at the first `$' character (for
454
-+	 compatibility with existing implementations).  */
455
-+	sha512_process_bytes(salt, salt_len, &ctx);
456
-+
457
-+
458
-+	/* Compute alternate SHA512 sum with input KEY, SALT, and KEY.  The
459
-+	 final result will be added to the first context.  */
460
-+	sha512_init_ctx(&alt_ctx);
461
-+
462
-+	/* Add key.  */
463
-+	sha512_process_bytes(key, key_len, &alt_ctx);
464
-+
465
-+	/* Add salt.  */
466
-+	sha512_process_bytes(salt, salt_len, &alt_ctx);
467
-+
468
-+	/* Add key again.  */
469
-+	sha512_process_bytes(key, key_len, &alt_ctx);
470
-+
471
-+	/* Now get result of this (64 bytes) and add it to the other
472
-+	 context.  */
473
-+	sha512_finish_ctx(&alt_ctx, alt_result);
474
-+
475
-+	/* Add for any character in the key one byte of the alternate sum.  */
476
-+	for (cnt = key_len; cnt > 64; cnt -= 64) {
477
-+		sha512_process_bytes(alt_result, 64, &ctx);
478
-+	}
479
-+	sha512_process_bytes(alt_result, cnt, &ctx);
480
-+
481
-+	/* Take the binary representation of the length of the key and for every
482
-+	 1 add the alternate sum, for every 0 the key.  */
483
-+	for (cnt = key_len; cnt > 0; cnt >>= 1) {
484
-+		if ((cnt & 1) != 0) {
485
-+			sha512_process_bytes(alt_result, 64, &ctx);
486
-+		} else {
487
-+			sha512_process_bytes(key, key_len, &ctx);
488
-+		}
489
-+	}
490
-+
491
-+	/* Create intermediate result.  */
492
-+	sha512_finish_ctx(&ctx, alt_result);
493
-+
494
-+	/* Start computation of P byte sequence.  */
495
-+	sha512_init_ctx(&alt_ctx);
496
-+
497
-+	/* For every character in the password add the entire password.  */
498
-+	for (cnt = 0; cnt < key_len; ++cnt) {
499
-+		sha512_process_bytes(key, key_len, &alt_ctx);
500
-+	}
501
-+
502
-+	/* Finish the digest.  */
503
-+	sha512_finish_ctx(&alt_ctx, temp_result);
504
-+
505
-+	/* Create byte sequence P.  */
506
-+	cp = p_bytes = alloca(key_len);
507
-+	for (cnt = key_len; cnt >= 64; cnt -= 64) {
508
-+		cp = mempcpy((void *) cp, (const void *)temp_result, 64);
509
-+	}
510
-+
511
-+	memcpy(cp, temp_result, cnt);
512
-+
513
-+	/* Start computation of S byte sequence.  */
514
-+	sha512_init_ctx(&alt_ctx);
515
-+
516
-+	/* For every character in the password add the entire password.  */
517
-+	for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) {
518
-+		sha512_process_bytes(salt, salt_len, &alt_ctx);
519
-+	}
520
-+
521
-+	/* Finish the digest.  */
522
-+	sha512_finish_ctx(&alt_ctx, temp_result);
523
-+
524
-+	/* Create byte sequence S.  */
525
-+	cp = s_bytes = alloca(salt_len);
526
-+	for (cnt = salt_len; cnt >= 64; cnt -= 64) {
527
-+		cp = mempcpy(cp, temp_result, 64);
528
-+	}
529
-+	memcpy(cp, temp_result, cnt);
530
-+
531
-+	/* Repeatedly run the collected hash value through SHA512 to burn
532
-+	 CPU cycles.  */
533
-+	for (cnt = 0; cnt < rounds; ++cnt) {
534
-+		/* New context.  */
535
-+		sha512_init_ctx(&ctx);
536
-+
537
-+		/* Add key or last result.  */
538
-+		if ((cnt & 1) != 0) {
539
-+			sha512_process_bytes(p_bytes, key_len, &ctx);
540
-+		} else {
541
-+			sha512_process_bytes(alt_result, 64, &ctx);
542
-+		}
543
-+
544
-+		/* Add salt for numbers not divisible by 3.  */
545
-+		if (cnt % 3 != 0) {
546
-+			sha512_process_bytes(s_bytes, salt_len, &ctx);
547
-+		}
548
-+
549
-+		/* Add key for numbers not divisible by 7.  */
550
-+		if (cnt % 7 != 0) {
551
-+			sha512_process_bytes(p_bytes, key_len, &ctx);
552
-+		}
553
-+
554
-+		/* Add key or last result.  */
555
-+		if ((cnt & 1) != 0) {
556
-+			sha512_process_bytes(alt_result, 64, &ctx);
557
-+		} else {
558
-+			sha512_process_bytes(p_bytes, key_len, &ctx);
559
-+		}
560
-+
561
-+		/* Create intermediate result.  */
562
-+		sha512_finish_ctx(&ctx, alt_result);
563
-+	}
564
-+
565
-+	/* Now we can construct the result string.  It consists of three
566
-+	 parts.  */
567
-+	cp = stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen));
568
-+	buflen -= sizeof(sha512_salt_prefix) - 1;
569
-+
570
-+	if (rounds_custom) {
571
-+#ifdef PHP_WIN32
572
-+	  int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha512_rounds_prefix, rounds);
573
-+#else
574
-+	  int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha512_rounds_prefix, rounds);
575
-+#endif
576
-+	  cp += n;
577
-+	  buflen -= n;
578
-+	}
579
-+
580
-+	cp = stpncpy(cp, salt, MIN((size_t) MAX(0, buflen), salt_len));
581
-+	buflen -= (int) MIN((size_t) MAX(0, buflen), salt_len);
582
-+
583
-+	if (buflen > 0) {
584
-+		*cp++ = '$';
585
-+		--buflen;
586
-+	}
587
-+
588
-+#define b64_from_24bit(B2, B1, B0, N)                    \
589
-+  do {									                 \
590
-+	unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0);	 \
591
-+	int n = (N);							             \
592
-+	while (n-- > 0 && buflen > 0)					     \
593
-+	  {									                 \
594
-+	*cp++ = b64t[w & 0x3f];						         \
595
-+	--buflen;							                 \
596
-+	w >>= 6;							                 \
597
-+	  }									                 \
598
-+  } while (0)
599
-+
600
-+	b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4);
601
-+	b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4);
602
-+	b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4);
603
-+	b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4);
604
-+	b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4);
605
-+	b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4);
606
-+	b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4);
607
-+	b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4);
608
-+	b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4);
609
-+	b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4);
610
-+	b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4);
611
-+	b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4);
612
-+	b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4);
613
-+	b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4);
614
-+	b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4);
615
-+	b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4);
616
-+	b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4);
617
-+	b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4);
618
-+	b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4);
619
-+	b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4);
620
-+	b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4);
621
-+	b64_from_24bit(0, 0, alt_result[63], 2);
622
-+
623
-+	if (buflen <= 0) {
624
-+		errno = ERANGE;
625
-+		buffer = NULL;
626
-+	} else {
627
-+		*cp = '\0';		/* Terminate the string.  */
628
-+	}
629
-+
630
-+	/* Clear the buffer for the intermediate result so that people
631
-+	 attaching to processes or reading core dumps cannot get any
632
-+	 information.  We do it in this way to clear correct_words[]
633
-+	 inside the SHA512 implementation as well.  */
634
-+	sha512_init_ctx(&ctx);
635
-+	sha512_finish_ctx(&ctx, alt_result);
636
-+	memset(temp_result, '\0', sizeof(temp_result));
637
-+	memset(p_bytes, '\0', key_len);
638
-+	memset(s_bytes, '\0', salt_len);
639
-+	memset(&ctx, '\0', sizeof(ctx));
640
-+	memset(&alt_ctx, '\0', sizeof(alt_ctx));
641
-+	if (copied_key != NULL) {
642
-+		memset(copied_key, '\0', key_len);
643
-+	}
644
-+	if (copied_salt != NULL) {
645
-+		memset(copied_salt, '\0', salt_len);
646
-+	}
647
-+
648
-+	return buffer;
649
-+}
650
-+
651
-+
652
-+/* This entry point is equivalent to the `crypt' function in Unix
653
-+   libcs.  */
654
-+char *
655
-+php_sha512_crypt(const char *key, const char *salt) {
656
-+	/* We don't want to have an arbitrary limit in the size of the
657
-+	 password.  We can compute an upper bound for the size of the
658
-+	 result in advance and so we can prepare the buffer we pass to
659
-+	 `sha512_crypt_r'.  */
660
-+	static char *buffer;
661
-+	static int buflen;
662
-+	int needed = (int)(sizeof(sha512_salt_prefix) - 1
663
-+		+ sizeof(sha512_rounds_prefix) + 9 + 1
664
-+		+ strlen(salt) + 1 + 86 + 1);
665
-+
666
-+	if (buflen < needed) {
667
-+		char *new_buffer = (char *) realloc(buffer, needed);
668
-+		if (new_buffer == NULL) {
669
-+			return NULL;
670
-+		}
671
-+
672
-+		buffer = new_buffer;
673
-+		buflen = needed;
674
-+	}
675
-+
676
-+	return php_sha512_crypt_r (key, salt, buffer, buflen);
677
-+}
678
-+
679
-+#ifdef TEST
680
-+static const struct {
681
-+	const char *input;
682
-+	const char result[64];
683
-+} tests[] =
684
-+	{
685
-+	/* Test vectors from FIPS 180-2: appendix C.1.  */
686
-+	{ "abc",
687
-+	  "\xdd\xaf\x35\xa1\x93\x61\x7a\xba\xcc\x41\x73\x49\xae\x20\x41\x31"
688
-+	  "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a"
689
-+	  "\x21\x92\x99\x2a\x27\x4f\xc1\xa8\x36\xba\x3c\x23\xa3\xfe\xeb\xbd"
690
-+	  "\x45\x4d\x44\x23\x64\x3c\xe8\x0e\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f" },
691
-+	/* Test vectors from FIPS 180-2: appendix C.2.  */
692
-+	{ "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn"
693
-+	  "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
694
-+	  "\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14\x3f"
695
-+	  "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88\x90\x18"
696
-+	  "\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4\xb5\x43\x3a"
697
-+	  "\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b\x87\x4b\xe9\x09" },
698
-+	/* Test vectors from the NESSIE project.  */
699
-+	{ "",
700
-+	  "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd\xf1\x54\x28\x50\xd6\x6d\x80\x07"
701
-+	  "\xd6\x20\xe4\x05\x0b\x57\x15\xdc\x83\xf4\xa9\x21\xd3\x6c\xe9\xce"
702
-+	  "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0\xff\x83\x18\xd2\x87\x7e\xec\x2f"
703
-+	  "\x63\xb9\x31\xbd\x47\x41\x7a\x81\xa5\x38\x32\x7a\xf9\x27\xda\x3e" },
704
-+	{ "a",
705
-+	  "\x1f\x40\xfc\x92\xda\x24\x16\x94\x75\x09\x79\xee\x6c\xf5\x82\xf2"
706
-+	  "\xd5\xd7\xd2\x8e\x18\x33\x5d\xe0\x5a\xbc\x54\xd0\x56\x0e\x0f\x53"
707
-+	  "\x02\x86\x0c\x65\x2b\xf0\x8d\x56\x02\x52\xaa\x5e\x74\x21\x05\x46"
708
-+	  "\xf3\x69\xfb\xbb\xce\x8c\x12\xcf\xc7\x95\x7b\x26\x52\xfe\x9a\x75" },
709
-+	{ "message digest",
710
-+	  "\x10\x7d\xbf\x38\x9d\x9e\x9f\x71\xa3\xa9\x5f\x6c\x05\x5b\x92\x51"
711
-+	  "\xbc\x52\x68\xc2\xbe\x16\xd6\xc1\x34\x92\xea\x45\xb0\x19\x9f\x33"
712
-+	  "\x09\xe1\x64\x55\xab\x1e\x96\x11\x8e\x8a\x90\x5d\x55\x97\xb7\x20"
713
-+	  "\x38\xdd\xb3\x72\xa8\x98\x26\x04\x6d\xe6\x66\x87\xbb\x42\x0e\x7c" },
714
-+	{ "abcdefghijklmnopqrstuvwxyz",
715
-+	  "\x4d\xbf\xf8\x6c\xc2\xca\x1b\xae\x1e\x16\x46\x8a\x05\xcb\x98\x81"
716
-+	  "\xc9\x7f\x17\x53\xbc\xe3\x61\x90\x34\x89\x8f\xaa\x1a\xab\xe4\x29"
717
-+	  "\x95\x5a\x1b\xf8\xec\x48\x3d\x74\x21\xfe\x3c\x16\x46\x61\x3a\x59"
718
-+	  "\xed\x54\x41\xfb\x0f\x32\x13\x89\xf7\x7f\x48\xa8\x79\xc7\xb1\xf1" },
719
-+	{ "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
720
-+	  "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a\x0c\xed\x7b\xeb\x8e\x08\xa4\x16"
721
-+	  "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8\x27\x9b\xe3\x31\xa7\x03\xc3\x35"
722
-+	  "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9\xaa\x1d\x3b\xea\x57\x78\x9c\xa0"
723
-+	  "\x31\xad\x85\xc7\xa7\x1d\xd7\x03\x54\xec\x63\x12\x38\xca\x34\x45" },
724
-+	{ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
725
-+	  "\x1e\x07\xbe\x23\xc2\x6a\x86\xea\x37\xea\x81\x0c\x8e\xc7\x80\x93"
726
-+	  "\x52\x51\x5a\x97\x0e\x92\x53\xc2\x6f\x53\x6c\xfc\x7a\x99\x96\xc4"
727
-+	  "\x5c\x83\x70\x58\x3e\x0a\x78\xfa\x4a\x90\x04\x1d\x71\xa4\xce\xab"
728
-+	  "\x74\x23\xf1\x9c\x71\xb9\xd5\xa3\xe0\x12\x49\xf0\xbe\xbd\x58\x94" },
729
-+	{ "123456789012345678901234567890123456789012345678901234567890"
730
-+	  "12345678901234567890",
731
-+	  "\x72\xec\x1e\xf1\x12\x4a\x45\xb0\x47\xe8\xb7\xc7\x5a\x93\x21\x95"
732
-+	  "\x13\x5b\xb6\x1d\xe2\x4e\xc0\xd1\x91\x40\x42\x24\x6e\x0a\xec\x3a"
733
-+	  "\x23\x54\xe0\x93\xd7\x6f\x30\x48\xb4\x56\x76\x43\x46\x90\x0c\xb1"
734
-+	  "\x30\xd2\xa4\xfd\x5d\xd1\x6a\xbb\x5e\x30\xbc\xb8\x50\xde\xe8\x43" }
735
-+  };
736
-+#define ntests (sizeof (tests) / sizeof (tests[0]))
737
-+
738
-+
739
-+static const struct
740
-+{
741
-+	const char *salt;
742
-+	const char *input;
743
-+	const char *expected;
744
-+} tests2[] = {
745
-+	{ "$6$saltstring", "Hello world!",
746
-+	"$6$saltstring$svn8UoSVapNtMuq1ukKS4tPQd8iKwSMHWjl/O817G3uBnIFNjnQJu"
747
-+	"esI68u4OTLiBFdcbYEdFCoEOfaS35inz1"},
748
-+	{ "$6$rounds=10000$saltstringsaltstring", "Hello world!",
749
-+	"$6$rounds=10000$saltstringsaltst$OW1/O6BYHV6BcXZu8QVeXbDWra3Oeqh0sb"
750
-+	"HbbMCVNSnCM/UrjmM0Dp8vOuZeHBy/YTBmSK6H9qs/y3RnOaw5v." },
751
-+	{ "$6$rounds=5000$toolongsaltstring", "This is just a test",
752
-+	"$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQ"
753
-+	"zQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0" },
754
-+	{ "$6$rounds=1400$anotherlongsaltstring",
755
-+	"a very much longer text to encrypt.  This one even stretches over more"
756
-+	"than one line.",
757
-+	"$6$rounds=1400$anotherlongsalts$POfYwTEok97VWcjxIiSOjiykti.o/pQs.wP"
758
-+	"vMxQ6Fm7I6IoYN3CmLs66x9t0oSwbtEW7o7UmJEiDwGqd8p4ur1" },
759
-+	{ "$6$rounds=77777$short",
760
-+	"we have a short salt string but not a short password",
761
-+	"$6$rounds=77777$short$WuQyW2YR.hBNpjjRhpYD/ifIw05xdfeEyQoMxIXbkvr0g"
762
-+	"ge1a1x3yRULJ5CCaUeOxFmtlcGZelFl5CxtgfiAc0" },
763
-+	{ "$6$rounds=123456$asaltof16chars..", "a short string",
764
-+	"$6$rounds=123456$asaltof16chars..$BtCwjqMJGx5hrJhZywWvt0RLE8uZ4oPwc"
765
-+	"elCjmw2kSYu.Ec6ycULevoBK25fs2xXgMNrCzIMVcgEJAstJeonj1" },
766
-+	{ "$6$rounds=10$roundstoolow", "the minimum number is still observed",
767
-+	"$6$rounds=1000$roundstoolow$kUMsbe306n21p9R.FRkW3IGn.S9NPN0x50YhH1x"
768
-+	"hLsPuWGsUSklZt58jaTfF4ZEQpyUNGc0dqbpBYYBaHHrsX." },
769
-+};
770
-+#define ntests2 (sizeof (tests2) / sizeof (tests2[0]))
771
-+
772
-+
773
-+int main (void) {
774
-+	struct sha512_ctx ctx;
775
-+	char sum[64];
776
-+	int result = 0;
777
-+	int cnt;
778
-+	int i;
779
-+	char buf[1000];
780
-+	static const char expected[64] =
781
-+		"\xe7\x18\x48\x3d\x0c\xe7\x69\x64\x4e\x2e\x42\xc7\xbc\x15\xb4\x63"
782
-+		"\x8e\x1f\x98\xb1\x3b\x20\x44\x28\x56\x32\xa8\x03\xaf\xa9\x73\xeb"
783
-+		"\xde\x0f\xf2\x44\x87\x7e\xa6\x0a\x4c\xb0\x43\x2c\xe5\x77\xc3\x1b"
784
-+		"\xeb\x00\x9c\x5c\x2c\x49\xaa\x2e\x4e\xad\xb2\x17\xad\x8c\xc0\x9b";
785
-+
786
-+	for (cnt = 0; cnt < (int) ntests; ++cnt) {
787
-+		sha512_init_ctx (&ctx);
788
-+		sha512_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx);
789
-+		sha512_finish_ctx (&ctx, sum);
790
-+		if (memcmp (tests[cnt].result, sum, 64) != 0) {
791
-+			printf ("test %d run %d failed\n", cnt, 1);
792
-+			result = 1;
793
-+		}
794
-+
795
-+		sha512_init_ctx (&ctx);
796
-+		for (i = 0; tests[cnt].input[i] != '\0'; ++i) {
797
-+			sha512_process_bytes (&tests[cnt].input[i], 1, &ctx);
798
-+		}
799
-+		sha512_finish_ctx (&ctx, sum);
800
-+		if (memcmp (tests[cnt].result, sum, 64) != 0) {
801
-+			printf ("test %d run %d failed\n", cnt, 2);
802
-+			result = 1;
803
-+		}
804
-+	}
805
-+
806
-+	/* Test vector from FIPS 180-2: appendix C.3.  */
807
-+
808
-+	memset (buf, 'a', sizeof (buf));
809
-+	sha512_init_ctx (&ctx);
810
-+	for (i = 0; i < 1000; ++i) {
811
-+		sha512_process_bytes (buf, sizeof (buf), &ctx);
812
-+	}
813
-+
814
-+	sha512_finish_ctx (&ctx, sum);
815
-+	if (memcmp (expected, sum, 64) != 0) {
816
-+		printf ("test %d failed\n", cnt);
817
-+		result = 1;
818
-+	}
819
-+
820
-+	for (cnt = 0; cnt < ntests2; ++cnt) {
821
-+		char *cp = php_sha512_crypt(tests2[cnt].input, tests2[cnt].salt);
822
-+
823
-+		if (strcmp (cp, tests2[cnt].expected) != 0) {
824
-+			printf ("test %d: expected \"%s\", got \"%s\"\n",
825
-+					cnt, tests2[cnt].expected, cp);
826
-+			result = 1;
827
-+		}
828
-+	}
829
-+
830
-+	if (result == 0) {
831
-+		puts ("all tests OK");
832
-+	}
833
-+
834
-+	return result;
835
-+}
836
-+#endif
837
-Index: ext/standard/crypt_sha256.c
838
-===================================================================
839
---- ext/standard/crypt_sha256.c	(Revision 0)
840
-+++ ext/standard/crypt_sha256.c	(Revision 291899)
841
-@@ -0,0 +1,754 @@
842
-+/* SHA256-based Unix crypt implementation.
843
-+   Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>.  */
844
-+/* Windows VC++ port by Pierre Joye <pierre@php.net> */
845
-+
846
-+#ifndef PHP_WIN32
847
-+# include <endian.h>
848
-+# include "php.h"
849
-+# include "php_main.h"
850
-+#endif
851
-+
852
-+#include <errno.h>
853
-+#include <limits.h>
854
-+
855
-+#ifdef PHP_WIN32
856
-+# include "win32/php_stdint.h"
857
-+# include "win32/php_stdbool.h"
858
-+# define __alignof__ __alignof
859
-+# define alloca _alloca
860
-+#else
861
-+# if HAVE_INTTYPES_H
862
-+#  include <inttypes.h>
863
-+# elif HAVE_STDINT_H
864
-+#  include <stdint.h>
865
-+# endif
866
-+# include <stdbool.h>
867
-+#endif
868
-+
869
-+#include <stdio.h>
870
-+#include <stdlib.h>
871
-+
872
-+#ifdef PHP_WIN32
873
-+# include <string.h>
874
-+#else
875
-+# include <sys/param.h>
876
-+# include <sys/types.h>
877
-+# if HAVE_STRING_H
878
-+//#  define __USE_GNU 1
879
-+#  include <string.h>
880
-+# else
881
-+#  include <strings.h>
882
-+# endif
883
-+#endif
884
-+
885
-+#ifndef HAVE_STRPNCPY 
886
-+char * stpncpy(char *dst, const char *src, size_t len)
887
-+{
888
-+	size_t n = strlen(src);
889
-+	if (n > len) {
890
-+		n = len;
891
-+	}
892
-+	return strncpy(dst, src, len) + n;
893
-+}
894
-+#endif
895
-+
896
-+#ifndef HAVE_MEMPCPY 
897
-+void * mempcpy(void * dst, const void * src, size_t len)
898
-+{
899
-+	return (((char *)memcpy(dst, src, len)) + len);
900
-+}
901
-+#endif
902
-+
903
-+#ifndef MIN
904
-+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
905
-+#endif
906
-+#ifndef MAX
907
-+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
908
-+#endif
909
-+
910
-+/* Structure to save state of computation between the single steps.  */
911
-+struct sha256_ctx {
912
-+	uint32_t H[8];
913
-+
914
-+	uint32_t total[2];
915
-+	uint32_t buflen;
916
-+	char buffer[128]; /* NB: always correctly aligned for uint32_t.  */
917
-+};
918
-+
919
-+#if PHP_WIN32 || (__BYTE_ORDER == __LITTLE_ENDIAN)
920
-+# define SWAP(n) \
921
-+    (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
922
-+#else
923
-+# define SWAP(n) (n)
924
-+#endif
925
-+
926
-+/* This array contains the bytes used to pad the buffer to the next
927
-+   64-byte boundary.  (FIPS 180-2:5.1.1)  */
928
-+static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ...  */ };
929
-+
930
-+
931
-+/* Constants for SHA256 from FIPS 180-2:4.2.2.  */
932
-+static const uint32_t K[64] = {
933
-+	0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
934
-+	0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
935
-+	0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
936
-+	0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
937
-+	0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
938
-+	0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
939
-+	0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
940
-+	0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
941
-+	0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
942
-+	0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
943
-+	0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
944
-+	0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
945
-+	0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
946
-+	0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
947
-+	0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
948
-+	0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
949
-+};
950
-+
951
-+
952
-+/* Process LEN bytes of BUFFER, accumulating context into CTX.
953
-+   It is assumed that LEN % 64 == 0.  */
954
-+static void sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) {
955
-+	const uint32_t *words = buffer;
956
-+	size_t nwords = len / sizeof (uint32_t);
957
-+	unsigned int t;
958
-+
959
-+	uint32_t a = ctx->H[0];
960
-+	uint32_t b = ctx->H[1];
961
-+	uint32_t c = ctx->H[2];
962
-+	uint32_t d = ctx->H[3];
963
-+	uint32_t e = ctx->H[4];
964
-+	uint32_t f = ctx->H[5];
965
-+	uint32_t g = ctx->H[6];
966
-+	uint32_t h = ctx->H[7];
967
-+
968
-+	/* First increment the byte count.  FIPS 180-2 specifies the possible
969
-+	 length of the file up to 2^64 bits.  Here we only compute the
970
-+	 number of bytes.  Do a double word increment.  */
971
-+	ctx->total[0] += len;
972
-+	if (ctx->total[0] < len) {
973
-+		++ctx->total[1];
974
-+	}
975
-+
976
-+	/* Process all bytes in the buffer with 64 bytes in each round of
977
-+	 the loop.  */
978
-+	while (nwords > 0) {
979
-+		uint32_t W[64];
980
-+		uint32_t a_save = a;
981
-+		uint32_t b_save = b;
982
-+		uint32_t c_save = c;
983
-+		uint32_t d_save = d;
984
-+		uint32_t e_save = e;
985
-+		uint32_t f_save = f;
986
-+		uint32_t g_save = g;
987
-+		uint32_t h_save = h;
988
-+
989
-+	/* Operators defined in FIPS 180-2:4.1.2.  */
990
-+#define Ch(x, y, z) ((x & y) ^ (~x & z))
991
-+#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
992
-+#define S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22))
993
-+#define S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25))
994
-+#define R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3))
995
-+#define R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10))
996
-+
997
-+	/* It is unfortunate that C does not provide an operator for
998
-+	cyclic rotation.  Hope the C compiler is smart enough.  */
999
-+#define CYCLIC(w, s) ((w >> s) | (w << (32 - s)))
1000
-+
1001
-+		/* Compute the message schedule according to FIPS 180-2:6.2.2 step 2.  */
1002
-+		for (t = 0; t < 16; ++t) {
1003
-+			W[t] = SWAP (*words);
1004
-+			++words;
1005
-+		}
1006
-+		for (t = 16; t < 64; ++t)
1007
-+			W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16];
1008
-+
1009
-+		/* The actual computation according to FIPS 180-2:6.2.2 step 3.  */
1010
-+		for (t = 0; t < 64; ++t) {
1011
-+			uint32_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t];
1012
-+			uint32_t T2 = S0 (a) + Maj (a, b, c);
1013
-+			h = g;
1014
-+			g = f;
1015
-+			f = e;
1016
-+			e = d + T1;
1017
-+			d = c;
1018
-+			c = b;
1019
-+			b = a;
1020
-+			a = T1 + T2;
1021
-+		}
1022
-+
1023
-+		/* Add the starting values of the context according to FIPS 180-2:6.2.2
1024
-+		step 4.  */
1025
-+		a += a_save;
1026
-+		b += b_save;
1027
-+		c += c_save;
1028
-+		d += d_save;
1029
-+		e += e_save;
1030
-+		f += f_save;
1031
-+		g += g_save;
1032
-+		h += h_save;
1033
-+
1034
-+		/* Prepare for the next round.  */
1035
-+		nwords -= 16;
1036
-+	}
1037
-+
1038
-+	/* Put checksum in context given as argument.  */
1039
-+	ctx->H[0] = a;
1040
-+	ctx->H[1] = b;
1041
-+	ctx->H[2] = c;
1042
-+	ctx->H[3] = d;
1043
-+	ctx->H[4] = e;
1044
-+	ctx->H[5] = f;
1045
-+	ctx->H[6] = g;
1046
-+	ctx->H[7] = h;
1047
-+}
1048
-+
1049
-+
1050
-+/* Initialize structure containing state of computation.
1051
-+   (FIPS 180-2:5.3.2)  */
1052
-+static void sha256_init_ctx(struct sha256_ctx *ctx) {
1053
-+	ctx->H[0] = 0x6a09e667;
1054
-+	ctx->H[1] = 0xbb67ae85;
1055
-+	ctx->H[2] = 0x3c6ef372;
1056
-+	ctx->H[3] = 0xa54ff53a;
1057
-+	ctx->H[4] = 0x510e527f;
1058
-+	ctx->H[5] = 0x9b05688c;
1059
-+	ctx->H[6] = 0x1f83d9ab;
1060
-+	ctx->H[7] = 0x5be0cd19;
1061
-+
1062
-+	ctx->total[0] = ctx->total[1] = 0;
1063
-+	ctx->buflen = 0;
1064
-+}
1065
-+
1066
-+
1067
-+/* Process the remaining bytes in the internal buffer and the usual
1068
-+   prolog according to the standard and write the result to RESBUF.
1069
-+
1070
-+   IMPORTANT: On some systems it is required that RESBUF is correctly
1071
-+   aligned for a 32 bits value.  */
1072
-+static void * sha256_finish_ctx(struct sha256_ctx *ctx, void *resbuf) {
1073
-+	/* Take yet unprocessed bytes into account.  */
1074
-+	uint32_t bytes = ctx->buflen;
1075
-+	size_t pad;
1076
-+	unsigned int i;
1077
-+
1078
-+	/* Now count remaining bytes.  */
1079
-+	ctx->total[0] += bytes;
1080
-+	if (ctx->total[0] < bytes) {
1081
-+		++ctx->total[1];
1082
-+	}
1083
-+
1084
-+	pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
1085
-+	memcpy(&ctx->buffer[bytes], fillbuf, pad);
1086
-+
1087
-+	/* Put the 64-bit file length in *bits* at the end of the buffer.  */
1088
-+	*(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
1089
-+	*(uint32_t *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
1090
-+						  (ctx->total[0] >> 29));
1091
-+
1092
-+	/* Process last bytes.  */
1093
-+	sha256_process_block(ctx->buffer, bytes + pad + 8, ctx);
1094
-+
1095
-+	/* Put result from CTX in first 32 bytes following RESBUF.  */
1096
-+	for (i = 0; i < 8; ++i) {
1097
-+		((uint32_t *) resbuf)[i] = SWAP(ctx->H[i]);
1098
-+	}
1099
-+
1100
-+	return resbuf;
1101
-+}
1102
-+
1103
-+
1104
-+static void sha256_process_bytes(const void *buffer, size_t len, struct sha256_ctx *ctx) {
1105
-+	/* When we already have some bits in our internal buffer concatenate
1106
-+	 both inputs first.  */
1107
-+	if (ctx->buflen != 0) {
1108
-+		size_t left_over = ctx->buflen;
1109
-+		size_t add = 128 - left_over > len ? len : 128 - left_over;
1110
-+
1111
-+		  memcpy(&ctx->buffer[left_over], buffer, add);
1112
-+		  ctx->buflen += add;
1113
-+
1114
-+		if (ctx->buflen > 64) {
1115
-+			sha256_process_block(ctx->buffer, ctx->buflen & ~63, ctx);
1116
-+			ctx->buflen &= 63;
1117
-+			/* The regions in the following copy operation cannot overlap.  */
1118
-+			memcpy(ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ctx->buflen);
1119
-+		}
1120
-+
1121
-+		buffer = (const char *) buffer + add;
1122
-+		len -= add;
1123
-+	}
1124
-+
1125
-+	/* Process available complete blocks.  */
1126
-+	if (len >= 64) {
1127
-+/* To check alignment gcc has an appropriate operator.  Other
1128
-+compilers don't.  */
1129
-+#if __GNUC__ >= 2
1130
-+# define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint32_t) != 0)
1131
-+#else
1132
-+# define UNALIGNED_P(p) (((uintptr_t) p) % sizeof (uint32_t) != 0)
1133
-+#endif
1134
-+		if (UNALIGNED_P (buffer))
1135
-+			while (len > 64) {
1136
-+				sha256_process_block(memcpy(ctx->buffer, buffer, 64), 64, ctx);
1137
-+				buffer = (const char *) buffer + 64;
1138
-+				len -= 64;
1139
-+			} else {
1140
-+				sha256_process_block(buffer, len & ~63, ctx);
1141
-+				buffer = (const char *) buffer + (len & ~63);
1142
-+				len &= 63;
1143
-+			}
1144
-+	}
1145
-+
1146
-+	/* Move remaining bytes into internal buffer.  */
1147
-+	if (len > 0) {
1148
-+		size_t left_over = ctx->buflen;
1149
-+
1150
-+		memcpy(&ctx->buffer[left_over], buffer, len);
1151
-+		left_over += len;
1152
-+		if (left_over >= 64) {
1153
-+			sha256_process_block(ctx->buffer, 64, ctx);
1154
-+			left_over -= 64;
1155
-+			memcpy(ctx->buffer, &ctx->buffer[64], left_over);
1156
-+		}
1157
-+		ctx->buflen = left_over;
1158
-+	}
1159
-+}
1160
-+
1161
-+
1162
-+/* Define our magic string to mark salt for SHA256 "encryption"
1163
-+   replacement.  */
1164
-+static const char sha256_salt_prefix[] = "$5$";
1165
-+
1166
-+/* Prefix for optional rounds specification.  */
1167
-+static const char sha256_rounds_prefix[] = "rounds=";
1168
-+
1169
-+/* Maximum salt string length.  */
1170
-+#define SALT_LEN_MAX 16
1171
-+/* Default number of rounds if not explicitly specified.  */
1172
-+#define ROUNDS_DEFAULT 5000
1173
-+/* Minimum number of rounds.  */
1174
-+#define ROUNDS_MIN 1000
1175
-+/* Maximum number of rounds.  */
1176
-+#define ROUNDS_MAX 999999999
1177
-+
1178
-+/* Table with characters for base64 transformation.  */
1179
-+static const char b64t[64] =
1180
-+"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
1181
-+
1182
-+char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
1183
-+{
1184
-+#ifdef PHP_WIN32
1185
-+	__declspec(align(32)) unsigned char alt_result[32];
1186
-+	__declspec(align(32)) unsigned char temp_result[32];
1187
-+#else
1188
-+	unsigned char alt_result[32]
1189
-+	__attribute__ ((__aligned__ (__alignof__ (uint32_t))));
1190
-+	unsigned char temp_result[32]
1191
-+	__attribute__ ((__aligned__ (__alignof__ (uint32_t))));
1192
-+#endif
1193
-+
1194
-+	struct sha256_ctx ctx;
1195
-+	struct sha256_ctx alt_ctx;
1196
-+	size_t salt_len;
1197
-+	size_t key_len;
1198
-+	size_t cnt;
1199
-+	char *cp;
1200
-+	char *copied_key = NULL;
1201
-+	char *copied_salt = NULL;
1202
-+	char *p_bytes;
1203
-+	char *s_bytes;
1204
-+	/* Default number of rounds.  */
1205
-+	size_t rounds = ROUNDS_DEFAULT;
1206
-+	bool rounds_custom = false;
1207
-+
1208
-+	/* Find beginning of salt string.  The prefix should normally always
1209
-+	be present.  Just in case it is not.  */
1210
-+	if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0) {
1211
-+		/* Skip salt prefix.  */
1212
-+		salt += sizeof(sha256_salt_prefix) - 1;
1213
-+	}
1214
-+
1215
-+	if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1) == 0) {
1216
-+		const char *num = salt + sizeof(sha256_rounds_prefix) - 1;
1217
-+		char *endp;
1218
-+		unsigned long int srounds = strtoul(num, &endp, 10);
1219
-+		if (*endp == '$') {
1220
-+			salt = endp + 1;
1221
-+			rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX));
1222
-+			rounds_custom = true;
1223
-+		}
1224
-+	}
1225
-+
1226
-+	salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX);
1227
-+	key_len = strlen(key);
1228
-+
1229
-+	if ((key - (char *) 0) % __alignof__ (uint32_t) != 0) {
1230
-+		char *tmp = (char *) alloca(key_len + __alignof__(uint32_t));
1231
-+		key = copied_key = memcpy(tmp + __alignof__(uint32_t) - (tmp - (char *) 0) % __alignof__(uint32_t), key, key_len);
1232
-+	}
1233
-+
1234
-+	if ((salt - (char *) 0) % __alignof__(uint32_t) != 0) {
1235
-+		char *tmp = (char *) alloca(salt_len + __alignof__(uint32_t));
1236
-+		salt = copied_salt =
1237
-+		memcpy(tmp + __alignof__(uint32_t) - (tmp - (char *) 0) % __alignof__ (uint32_t), salt, salt_len);
1238
-+	}
1239
-+
1240
-+	/* Prepare for the real work.  */
1241
-+	sha256_init_ctx(&ctx);
1242
-+
1243
-+	/* Add the key string.  */
1244
-+	sha256_process_bytes(key, key_len, &ctx);
1245
-+
1246
-+	/* The last part is the salt string.  This must be at most 16
1247
-+	 characters and it ends at the first `$' character (for
1248
-+	 compatibility with existing implementations).  */
1249
-+	sha256_process_bytes(salt, salt_len, &ctx);
1250
-+
1251
-+
1252
-+	/* Compute alternate SHA256 sum with input KEY, SALT, and KEY.  The
1253
-+	 final result will be added to the first context.  */
1254
-+	sha256_init_ctx(&alt_ctx);
1255
-+
1256
-+	/* Add key.  */
1257
-+	sha256_process_bytes(key, key_len, &alt_ctx);
1258
-+
1259
-+	/* Add salt.  */
1260
-+	sha256_process_bytes(salt, salt_len, &alt_ctx);
1261
-+
1262
-+	/* Add key again.  */
1263
-+	sha256_process_bytes(key, key_len, &alt_ctx);
1264
-+
1265
-+	/* Now get result of this (32 bytes) and add it to the other
1266
-+	 context.  */
1267
-+	sha256_finish_ctx(&alt_ctx, alt_result);
1268
-+
1269
-+	/* Add for any character in the key one byte of the alternate sum.  */
1270
-+	for (cnt = key_len; cnt > 32; cnt -= 32) {
1271
-+		sha256_process_bytes(alt_result, 32, &ctx);
1272
-+	}
1273
-+	sha256_process_bytes(alt_result, cnt, &ctx);
1274
-+
1275
-+	/* Take the binary representation of the length of the key and for every
1276
-+	1 add the alternate sum, for every 0 the key.  */
1277
-+	for (cnt = key_len; cnt > 0; cnt >>= 1) {
1278
-+		if ((cnt & 1) != 0) {
1279
-+			sha256_process_bytes(alt_result, 32, &ctx);
1280
-+		} else {
1281
-+			sha256_process_bytes(key, key_len, &ctx);
1282
-+		}
1283
-+	}
1284
-+
1285
-+	/* Create intermediate result.  */
1286
-+	sha256_finish_ctx(&ctx, alt_result);
1287
-+
1288
-+	/* Start computation of P byte sequence.  */
1289
-+	sha256_init_ctx(&alt_ctx);
1290
-+
1291
-+	/* For every character in the password add the entire password.  */
1292
-+	for (cnt = 0; cnt < key_len; ++cnt) {
1293
-+		sha256_process_bytes(key, key_len, &alt_ctx);
1294
-+	}
1295
-+
1296
-+	/* Finish the digest.  */
1297
-+	sha256_finish_ctx(&alt_ctx, temp_result);
1298
-+
1299
-+	/* Create byte sequence P.  */
1300
-+	cp = p_bytes = alloca(key_len);
1301
-+	for (cnt = key_len; cnt >= 32; cnt -= 32) {
1302
-+		cp = mempcpy((void *)cp, (const void *)temp_result, 32);
1303
-+	}
1304
-+	memcpy(cp, temp_result, cnt);
1305
-+
1306
-+	/* Start computation of S byte sequence.  */
1307
-+	sha256_init_ctx(&alt_ctx);
1308
-+
1309
-+	/* For every character in the password add the entire password.  */
1310
-+	for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) {
1311
-+		sha256_process_bytes(salt, salt_len, &alt_ctx);
1312
-+	}
1313
-+
1314
-+	/* Finish the digest.  */
1315
-+	sha256_finish_ctx(&alt_ctx, temp_result);
1316
-+
1317
-+	/* Create byte sequence S.  */
1318
-+	cp = s_bytes = alloca(salt_len);
1319
-+	for (cnt = salt_len; cnt >= 32; cnt -= 32) {
1320
-+		cp = mempcpy(cp, temp_result, 32);
1321
-+	}
1322
-+	memcpy(cp, temp_result, cnt);
1323
-+
1324
-+	/* Repeatedly run the collected hash value through SHA256 to burn
1325
-+	CPU cycles.  */
1326
-+	for (cnt = 0; cnt < rounds; ++cnt) {
1327
-+		/* New context.  */
1328
-+		sha256_init_ctx(&ctx);
1329
-+
1330
-+		/* Add key or last result.  */
1331
-+		if ((cnt & 1) != 0) {
1332
-+			sha256_process_bytes(p_bytes, key_len, &ctx);
1333
-+		} else {
1334
-+			sha256_process_bytes(alt_result, 32, &ctx);
1335
-+		}
1336
-+
1337
-+		/* Add salt for numbers not divisible by 3.  */
1338
-+		if (cnt % 3 != 0) {
1339
-+			sha256_process_bytes(s_bytes, salt_len, &ctx);
1340
-+		}
1341
-+
1342
-+		/* Add key for numbers not divisible by 7.  */
1343
-+		if (cnt % 7 != 0) {
1344
-+			sha256_process_bytes(p_bytes, key_len, &ctx);
1345
-+		}
1346
-+
1347
-+		/* Add key or last result.  */
1348
-+		if ((cnt & 1) != 0) {
1349
-+			sha256_process_bytes(alt_result, 32, &ctx);
1350
-+		} else {
1351
-+			sha256_process_bytes(p_bytes, key_len, &ctx);
1352
-+		}
1353
-+
1354
-+		/* Create intermediate result.  */
1355
-+		sha256_finish_ctx(&ctx, alt_result);
1356
-+	}
1357
-+
1358
-+	/* Now we can construct the result string.  It consists of three
1359
-+	parts.  */
1360
-+	cp = stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen));
1361
-+	buflen -= sizeof(sha256_salt_prefix) - 1;
1362
-+
1363
-+	if (rounds_custom) {
1364
-+#ifdef PHP_WIN32
1365
-+		int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha256_rounds_prefix, rounds);
1366
-+#else
1367
-+		int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha256_rounds_prefix, rounds);
1368
-+#endif
1369
-+		cp += n;
1370
-+		buflen -= n;
1371
-+	}
1372
-+
1373
-+	cp = stpncpy(cp, salt, MIN ((size_t) MAX (0, buflen), salt_len));
1374
-+	buflen -= MIN((size_t) MAX (0, buflen), salt_len);
1375
-+
1376
-+	if (buflen > 0) {
1377
-+		*cp++ = '$';
1378
-+		--buflen;
1379
-+	}
1380
-+
1381
-+#define b64_from_24bit(B2, B1, B0, N)					      \
1382
-+  do {									      \
1383
-+    unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0);			      \
1384
-+    int n = (N);							      \
1385
-+    while (n-- > 0 && buflen > 0)					      \
1386
-+      {									      \
1387
-+	*cp++ = b64t[w & 0x3f];						      \
1388
-+	--buflen;							      \
1389
-+	w >>= 6;							      \
1390
-+      }									      \
1391
-+  } while (0)
1392
-+
1393
-+	b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4);
1394
-+	b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4);
1395
-+	b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4);
1396
-+	b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4);
1397
-+	b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4);
1398
-+	b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4);
1399
-+	b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4);
1400
-+	b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4);
1401
-+	b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4);
1402
-+	b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4);
1403
-+	b64_from_24bit(0, alt_result[31], alt_result[30], 3);
1404
-+	if (buflen <= 0) {
1405
-+		errno = ERANGE;
1406
-+		buffer = NULL;
1407
-+	} else
1408
-+		*cp = '\0';		/* Terminate the string.  */
1409
-+
1410
-+	/* Clear the buffer for the intermediate result so that people
1411
-+     attaching to processes or reading core dumps cannot get any
1412
-+     information.  We do it in this way to clear correct_words[]
1413
-+     inside the SHA256 implementation as well.  */
1414
-+	sha256_init_ctx(&ctx);
1415
-+	sha256_finish_ctx(&ctx, alt_result);
1416
-+	memset(temp_result, '\0', sizeof(temp_result));
1417
-+	memset(p_bytes, '\0', key_len);
1418
-+	memset(s_bytes, '\0', salt_len);
1419
-+	memset(&ctx, '\0', sizeof(ctx));
1420
-+	memset(&alt_ctx, '\0', sizeof(alt_ctx));
1421
-+
1422
-+	if (copied_key != NULL) {
1423
-+		memset(copied_key, '\0', key_len);
1424
-+
1425
-+	}
1426
-+	if (copied_salt != NULL) {
1427
-+		memset(copied_salt, '\0', salt_len);
1428
-+	}
1429
-+
1430
-+	return buffer;
1431
-+}
1432
-+
1433
-+
1434
-+/* This entry point is equivalent to the `crypt' function in Unix
1435
-+   libcs.  */
1436
-+char * php_sha256_crypt(const char *key, const char *salt)
1437
-+{
1438
-+	/* We don't want to have an arbitrary limit in the size of the
1439
-+	password.  We can compute an upper bound for the size of the
1440
-+	result in advance and so we can prepare the buffer we pass to
1441
-+	`sha256_crypt_r'.  */
1442
-+	static char *buffer;
1443
-+	static int buflen;
1444
-+	int needed = (sizeof(sha256_salt_prefix) - 1
1445
-+			+ sizeof(sha256_rounds_prefix) + 9 + 1
1446
-+			+ strlen(salt) + 1 + 43 + 1);
1447
-+
1448
-+	if (buflen < needed) {
1449
-+		char *new_buffer = (char *) realloc(buffer, needed);
1450
-+		if (new_buffer == NULL) {
1451
-+			return NULL;
1452
-+		}
1453
-+
1454
-+		buffer = new_buffer;
1455
-+		buflen = needed;
1456
-+	}
1457
-+
1458
-+	return php_sha256_crypt_r(key, salt, buffer, buflen);
1459
-+}
1460
-+
1461
-+
1462
-+#ifdef TEST
1463
-+static const struct
1464
-+{
1465
-+	const char *input;
1466
-+	const char result[32];
1467
-+} tests[] =
1468
-+	{
1469
-+	/* Test vectors from FIPS 180-2: appendix B.1.  */
1470
-+	{ "abc",
1471
-+	"\xba\x78\x16\xbf\x8f\x01\xcf\xea\x41\x41\x40\xde\x5d\xae\x22\x23"
1472
-+	"\xb0\x03\x61\xa3\x96\x17\x7a\x9c\xb4\x10\xff\x61\xf2\x00\x15\xad" },
1473
-+	/* Test vectors from FIPS 180-2: appendix B.2.  */
1474
-+	{ "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1475
-+	"\x24\x8d\x6a\x61\xd2\x06\x38\xb8\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
1476
-+	"\xa3\x3c\xe4\x59\x64\xff\x21\x67\xf6\xec\xed\xd4\x19\xdb\x06\xc1" },
1477
-+	/* Test vectors from the NESSIE project.  */
1478
-+	{ "",
1479
-+	"\xe3\xb0\xc4\x42\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24"
1480
-+	"\x27\xae\x41\xe4\x64\x9b\x93\x4c\xa4\x95\x99\x1b\x78\x52\xb8\x55" },
1481
-+	{ "a",
1482
-+	"\xca\x97\x81\x12\xca\x1b\xbd\xca\xfa\xc2\x31\xb3\x9a\x23\xdc\x4d"
1483
-+	"\xa7\x86\xef\xf8\x14\x7c\x4e\x72\xb9\x80\x77\x85\xaf\xee\x48\xbb" },
1484
-+	{ "message digest",
1485
-+	"\xf7\x84\x6f\x55\xcf\x23\xe1\x4e\xeb\xea\xb5\xb4\xe1\x55\x0c\xad"
1486
-+	"\x5b\x50\x9e\x33\x48\xfb\xc4\xef\xa3\xa1\x41\x3d\x39\x3c\xb6\x50" },
1487
-+	{ "abcdefghijklmnopqrstuvwxyz",
1488
-+	"\x71\xc4\x80\xdf\x93\xd6\xae\x2f\x1e\xfa\xd1\x44\x7c\x66\xc9\x52"
1489
-+	"\x5e\x31\x62\x18\xcf\x51\xfc\x8d\x9e\xd8\x32\xf2\xda\xf1\x8b\x73" },
1490
-+	{ "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
1491
-+	"\x24\x8d\x6a\x61\xd2\x06\x38\xb8\xe5\xc0\x26\x93\x0c\x3e\x60\x39"
1492
-+	"\xa3\x3c\xe4\x59\x64\xff\x21\x67\xf6\xec\xed\xd4\x19\xdb\x06\xc1" },
1493
-+	{ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
1494
-+	"\xdb\x4b\xfc\xbd\x4d\xa0\xcd\x85\xa6\x0c\x3c\x37\xd3\xfb\xd8\x80"
1495
-+	"\x5c\x77\xf1\x5f\xc6\xb1\xfd\xfe\x61\x4e\xe0\xa7\xc8\xfd\xb4\xc0" },
1496
-+	{ "123456789012345678901234567890123456789012345678901234567890"
1497
-+	"12345678901234567890",
1498
-+	"\xf3\x71\xbc\x4a\x31\x1f\x2b\x00\x9e\xef\x95\x2d\xd8\x3c\xa8\x0e"
1499
-+	"\x2b\x60\x02\x6c\x8e\x93\x55\x92\xd0\xf9\xc3\x08\x45\x3c\x81\x3e" }
1500
-+  };
1501
-+#define ntests (sizeof (tests) / sizeof (tests[0]))
1502
-+
1503
-+
1504
-+static const struct
1505
-+{
1506
-+	const char *salt;
1507
-+	const char *input;
1508
-+	const char *expected;
1509
-+} tests2[] =
1510
-+{
1511
-+	{ "$5$saltstring", "Hello world!",
1512
-+	"$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5" },
1513
-+	{ "$5$rounds=10000$saltstringsaltstring", "Hello world!",
1514
-+	"$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2."
1515
-+	"opqey6IcA" },
1516
-+	{ "$5$rounds=5000$toolongsaltstring", "This is just a test",
1517
-+	"$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8"
1518
-+	"mGRcvxa5" },
1519
-+	{ "$5$rounds=1400$anotherlongsaltstring",
1520
-+	"a very much longer text to encrypt.  This one even stretches over more"
1521
-+	"than one line.",
1522
-+	"$5$rounds=1400$anotherlongsalts$Rx.j8H.h8HjEDGomFU8bDkXm3XIUnzyxf12"
1523
-+	"oP84Bnq1" },
1524
-+	{ "$5$rounds=77777$short",
1525
-+	"we have a short salt string but not a short password",
1526
-+	"$5$rounds=77777$short$JiO1O3ZpDAxGJeaDIuqCoEFysAe1mZNJRs3pw0KQRd/" },
1527
-+	{ "$5$rounds=123456$asaltof16chars..", "a short string",
1528
-+	"$5$rounds=123456$asaltof16chars..$gP3VQ/6X7UUEW3HkBn2w1/Ptq2jxPyzV/"
1529
-+	"cZKmF/wJvD" },
1530
-+	{ "$5$rounds=10$roundstoolow", "the minimum number is still observed",
1531
-+	"$5$rounds=1000$roundstoolow$yfvwcWrQ8l/K0DAWyuPMDNHpIVlTQebY9l/gL97"
1532
-+	"2bIC" },
1533
-+};
1534
-+#define ntests2 (sizeof (tests2) / sizeof (tests2[0]))
1535
-+
1536
-+
1537
-+int main(void) {
1538
-+	struct sha256_ctx ctx;
1539
-+	char sum[32];
1540
-+	int result = 0;
1541
-+	int cnt, i;
1542
-+	char buf[1000];
1543
-+	static const char expected[32] =
1544
-+	"\xcd\xc7\x6e\x5c\x99\x14\xfb\x92\x81\xa1\xc7\xe2\x84\xd7\x3e\x67"
1545
-+	"\xf1\x80\x9a\x48\xa4\x97\x20\x0e\x04\x6d\x39\xcc\xc7\x11\x2c\xd0";
1546
-+
1547
-+	for (cnt = 0; cnt < (int) ntests; ++cnt) {
1548
-+		sha256_init_ctx(&ctx);
1549
-+		sha256_process_bytes(tests[cnt].input, strlen(tests[cnt].input), &ctx);
1550
-+		sha256_finish_ctx(&ctx, sum);
1551
-+		if (memcmp(tests[cnt].result, sum, 32) != 0) {
1552
-+			printf("test %d run %d failed\n", cnt, 1);
1553
-+			result = 1;
1554
-+		}
1555
-+
1556
-+		sha256_init_ctx(&ctx);
1557
-+		for (i = 0; tests[cnt].input[i] != '\0'; ++i) {
1558
-+			sha256_process_bytes(&tests[cnt].input[i], 1, &ctx);
1559
-+		}
1560
-+		sha256_finish_ctx(&ctx, sum);
1561
-+		if (memcmp(tests[cnt].result, sum, 32) != 0) {
1562
-+			printf("test %d run %d failed\n", cnt, 2);
1563
-+			result = 1;
1564
-+		}
1565
-+	}
1566
-+
1567
-+	/* Test vector from FIPS 180-2: appendix B.3.  */
1568
-+
1569
-+	memset(buf, 'a', sizeof(buf));
1570
-+	sha256_init_ctx(&ctx);
1571
-+	for (i = 0; i < 1000; ++i) {
1572
-+		sha256_process_bytes (buf, sizeof (buf), &ctx);
1573
-+	}
1574
-+
1575
-+	sha256_finish_ctx(&ctx, sum);
1576
-+
1577
-+	if (memcmp(expected, sum, 32) != 0) {
1578
-+		printf("test %d failed\n", cnt);
1579
-+		result = 1;
1580
-+	}
1581
-+
1582
-+	for (cnt = 0; cnt < ntests2; ++cnt) {
1583
-+		char *cp = php_sha256_crypt(tests2[cnt].input, tests2[cnt].salt);
1584
-+		if (strcmp(cp, tests2[cnt].expected) != 0) {
1585
-+			printf("test %d: expected \"%s\", got \"%s\"\n", cnt, tests2[cnt].expected, cp);
1586
-+			result = 1;
1587
-+		}
1588
-+	}
1589
-+
1590
-+	if (result == 0)
1591
-+	puts("all tests OK");
1592
-+
1593
-+	return result;
1594
-+}
1595
-+#endif
1596
-Index: ext/standard/config.w32
1597
-===================================================================
1598
---- ext/standard/config.w32	(Revision 291898)
1599
-+++ ext/standard/config.w32	(Revision 291899)
1600
-@@ -9,8 +9,8 @@
1601
- CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");
1602
- 
1603
- EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \
1604
--	crc32.c crypt.c \
1605
--	crypt_freesec.c crypt_blowfish.c php_crypt_r.c \
1606
-+	crc32.c crypt.c crypt_freesec.c crypt_blowfish.c crypt_sha256.c \
1607
-+	crypt_sha512.c  php_crypt_r.c \
1608
- 	cyr_convert.c datetime.c dir.c dl.c dns.c dns_win32.c exec.c \
1609
- 	file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \
1610
- 	info.c iptc.c lcg.c link_win32.c mail.c math.c md5.c metaphone.c microtime.c \
1611
-Index: ext/standard/php_crypt_r.h
1612
-===================================================================
1613
---- ext/standard/php_crypt_r.h	(Revision 291898)
1614
-+++ ext/standard/php_crypt_r.h	(Revision 291899)
1615
-@@ -49,6 +49,8 @@
1616
- extern char * php_md5_crypt_r(const char *pw, const char *salt, char *out);
1617
- extern char * php_crypt_blowfish_rn(__CONST char *key, __CONST char *setting,
1618
- 	char *output, int size);
1619
-+extern char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
1620
-+extern char * php_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen);
1621
- 
1622
- #ifdef __cplusplus
1623
- }
1624
-Index: ext/standard/crypt.c
1625
-===================================================================
1626
---- ext/standard/crypt.c	(Revision 291898)
1627
-+++ ext/standard/crypt.c	(Revision 291899)
1628
-@@ -82,6 +82,12 @@
1629
- #define PHP_MAX_SALT_LEN 60
1630
- #endif
1631
- 
1632
-+#if PHP_SHA512_CRYPT
1633
-+#undef PHP_MAX_SALT_LEN
1634
-+#define PHP_MAX_SALT_LEN 123
1635
-+#endif
1636
-+
1637
-+
1638
- /* If the configure-time checks fail, we provide DES.
1639
-  * XXX: This is a hack. Fix the real problem! */
1640
- 
1641
-@@ -163,6 +169,7 @@
1642
- 		php_to64(&salt[0], PHP_CRYPT_RAND, 2);
1643
- 		salt[2] = '\0';
1644
- #endif
1645
-+		salt_in_len = strlen(salt);
1646
- 	}
1647
- 
1648
- /* Windows (win32/crypt) has a stripped down version of libxcrypt and 
1649
-@@ -175,7 +182,36 @@
1650
- 			char output[MD5_HASH_MAX_LEN];
1651
- 
1652
- 			RETURN_STRING(php_md5_crypt_r(str, salt, output), 1);
1653
--		} else  if (
1654
-+		} else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') {
1655
-+			const char sha512_salt_prefix[] = "$6$";
1656
-+			const char sha512_rounds_prefix[] = "rounds=";
1657
-+			char *output;
1658
-+			int needed = (sizeof(sha512_salt_prefix) - 1
1659
-+						+ sizeof(sha512_rounds_prefix) + 9 + 1
1660
-+						+ strlen(salt) + 1 + 43 + 1);
1661
-+			output = emalloc(needed * sizeof(char *));
1662
-+			salt[salt_in_len] = '\0';
1663
-+
1664
-+			php_sha512_crypt_r(str, salt, output, needed);
1665
-+
1666
-+			RETVAL_STRING(output, 1);
1667
-+			memset(output, 0, PHP_MAX_SALT_LEN + 1);
1668
-+			efree(output);
1669
-+		} else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') {
1670
-+			const char sha256_salt_prefix[] = "$5$";
1671
-+			const char sha256_rounds_prefix[] = "rounds=";
1672
-+			char *output;
1673
-+			int needed = (sizeof(sha256_salt_prefix) - 1
1674
-+						+ sizeof(sha256_rounds_prefix) + 9 + 1
1675
-+						+ strlen(salt) + 1 + 43 + 1);
1676
-+			output = emalloc(needed * sizeof(char *));
1677
-+			salt[salt_in_len] = '\0';
1678
-+			php_sha256_crypt_r(str, salt, output, needed);
1679
-+
1680
-+			RETVAL_STRING(output, 1);
1681
-+			memset(output, 0, PHP_MAX_SALT_LEN + 1);
1682
-+			efree(output);
1683
-+		} else if (
1684
- 				salt[0] == '$' &&
1685
- 				salt[1] == '2' &&
1686
- 				salt[2] == 'a' &&
1687
-Index: ext/standard/config.m4
1688
-===================================================================
1689
---- ext/standard/config.m4	(Revision 291898)
1690
-+++ ext/standard/config.m4	(Revision 291899)
1691
-@@ -172,6 +172,65 @@
1692
-   ac_cv_crypt_blowfish=no
1693
- ])])
1694
- 
1695
-+AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_SHA512,[
1696
-+AC_TRY_RUN([
1697
-+#if HAVE_UNISTD_H
1698
-+#include <unistd.h>
1699
-+#endif
1700
-+
1701
-+#if HAVE_CRYPT_H
1702
-+#include <crypt.h>
1703
-+#endif
1704
-+
1705
-+main() {
1706
-+#if HAVE_CRYPT
1707
-+    char salt[30], answer[80];
1708
-+    
1709
-+    salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0';
1710
-+    strcpy(answer, salt);
1711
-+    strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu.");
1712
-+    exit (strcmp((char *)crypt("foo",salt),answer));
1713
-+#else
1714
-+	exit(0);
1715
-+#endif
1716
-+}],[
1717
-+  ac_cv_crypt_SHA512=yes
1718
-+],[
1719
-+  ac_cv_crypt_SHA512=no
1720
-+],[
1721
-+  ac_cv_crypt_SHA512=no
1722
-+])])
1723
-+
1724
-+AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_SHA256,[
1725
-+AC_TRY_RUN([
1726
-+#if HAVE_UNISTD_H
1727
-+#include <unistd.h>
1728
-+#endif
1729
-+
1730
-+#if HAVE_CRYPT_H
1731
-+#include <crypt.h>
1732
-+#endif
1733
-+
1734
-+main() {
1735
-+#if HAVE_CRYPT
1736
-+    char salt[30], answer[80];
1737
-+    salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t';  salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0';    
1738
-+    strcat(salt,"");
1739
-+    strcpy(answer, salt);
1740
-+    strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5");
1741
-+    exit (strcmp((char *)crypt("foo",salt),answer));
1742
-+#else
1743
-+	exit(0);
1744
-+#endif
1745
-+}],[
1746
-+  ac_cv_crypt_SHA256=yes
1747
-+],[
1748
-+  ac_cv_crypt_SHA256=no
1749
-+],[
1750
-+  ac_cv_crypt_SHA256=no
1751
-+])])
1752
-+
1753
-+
1754
- dnl
1755
- dnl If one of them is missing, use our own implementation, portable code is then possible
1756
- dnl
1757
-@@ -181,8 +240,10 @@
1758
-   AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, 1, [Whether the system supports BlowFish salt])
1759
-   AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, 1, [Whether the system supports extended DES salt])
1760
-   AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, 1, [Whether the system supports extended DES salt])
1761
-+  AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, 1, [Whether the system supports SHA512 salt])
1762
-+  AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, 1, [Whether the system supports SHA256 salt])
1763
- 
1764
--  PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c php_crypt_r.c)
1765
-+  PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c)
1766
- else
1767
-   if test "$ac_cv_crypt_des" = "yes"; then
1768
-     ac_result=1
1769
-@@ -211,13 +272,31 @@
1770
-   fi
1771
-   AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt])
1772
- 
1773
-+  if test "$ac_cv_crypt_sha512" = "yes"; then
1774
-+    ac_result=1
1775
-+    ac_crypt_sha512=1
1776
-+  else
1777
-+    ac_result=0
1778
-+    ac_crypt_sha512=0
1779
-+  fi
1780
-+  AC_DEFINE_UNQUOTED(PHP_EXT_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt])
1781
-+
1782
-+  if test "$ac_cv_crypt_sha256" = "yes"; then
1783
-+    ac_result=1
1784
-+    ac_crypt_sha256=1
1785
-+  else
1786
-+    ac_result=0
1787
-+    ac_crypt_sha256=0
1788
-+  fi
1789
-+  AC_DEFINE_UNQUOTED(PHP_EXT_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt])
1790
-+
1791
-   AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des])
1792
- fi
1793
- 
1794
- dnl
1795
- dnl Check for available functions
1796
- dnl
1797
--AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan)
1798
-+AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy)
1799
- AC_FUNC_FNMATCH	
1800
- 
1801
- divert(5)dnl
... ...
@@ -1 +0,0 @@
1
-PHP_5 { global: *; };
... ...
@@ -1,4 +0,0 @@
1
-change all $(get_libdir)/php appearances in both eclass and ebuild to something like php52
2
-change all /etc/php appearances in ebuild and eclass to sth. /etc/php53
3
-disable mod_php (USE=-apache2)
4
-change /etc/env.d/20php5 to sth. 20php53 in ebuild
... ...
@@ -1,551 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.2.13.ebuild,v 1.8 2010/07/05 23:19:20 mabi Exp $
4
-
5
-CGI_SAPI_USE="discard-path force-cgi-redirect"
6
-APACHE2_SAPI_USE="concurrentmodphp threads"
7
-IUSE="cli cgi ${CGI_SAPI_USE} ${APACHE2_SAPI_USE} fastbuild"
8
-
9
-KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
10
-
11
-# NOTE: Portage doesn't support setting PROVIDE based on the USE flags
12
-#		that have been enabled, so we have to PROVIDE everything for now
13
-#		and hope for the best
14
-PROVIDE="virtual/php"
15
-
16
-# php package settings
17
-SLOT="5.2"
18
-MY_PHP_PV="${PV}"
19
-MY_PHP_P="php-${MY_PHP_PV}"
20
-PHP_PACKAGE="1"
21
-# php patch settings, general
22
-PHP_PATCHSET_REV="${PR/r/}"
23
-PHP_PATCHSET_URI="http://dev.gentoo.org/~keytoaster/distfiles/php-patchset-${PV}-r${PHP_PATCHSET_REV}.tar.bz2"
24
-SUHOSIN_PATCH="suhosin-patch-5.2.13-0.9.7.patch.gz"
25
-MULTILIB_PATCH="${MY_PHP_PV}/opt/multilib-search-path.patch"
26
-# php patch settings, ebuild specific
27
-FASTBUILD_PATCH="${MY_PHP_PV}/opt/fastbuild.patch"
28
-CONCURRENTMODPHP_PATCH="${MY_PHP_PV}/opt/concurrent_apache_modules.patch"
29
-# kolab patch - http://kolab.org/cgi-bin/viewcvs-kolab.cgi/server/patches/php/
30
-# bugs about this go to wrobel@gentoo.org
31
-KOLAB_PATCH="${MY_PHP_PV}/opt/kolab-imap-annotations.patch"
32
-
33
-inherit versionator php5_2-sapi apache-module
34
-
35
-# Suhosin patch support
36
-[[ -n "${SUHOSIN_PATCH}" ]] && SRC_URI="${SRC_URI} suhosin? (
37
-http://download.suhosin.org/${SUHOSIN_PATCH} )"
38
-
39
-DESCRIPTION="The PHP language runtime engine: CLI, CGI and Apache2 SAPIs."
40
-
41
-DEPEND="app-admin/php-toolkit
42
-	imap? ( >=virtual/imap-c-client-2006k )
43
-	pcre? ( >=dev-libs/libpcre-7.8 )
44
-	xml? ( >=dev-libs/libxml2-2.7.2-r2 )
45
-	xmlrpc? ( >=dev-libs/libxml2-2.7.2-r2 virtual/libiconv )"
46
-
47
-RDEPEND="${DEPEND}"
48
-if [[ -n "${KOLAB_PATCH}" ]] ; then
49
-	IUSE="${IUSE} kolab"
50
-	DEPEND="${DEPEND}
51
-		kolab? ( >=net-libs/c-client-2004g-r1 )"
52
-fi
53
-
54
-PDEPEND="suhosin? ( >=dev-php5/suhosin-0.9.29 )"
55
-
56
-want_apache
57
-
58
-pkg_setup() {
59
-	PHPCONFUTILS_AUTO_USE=""
60
-
61
-	# Make sure the user has specified at least one SAPI
62
-	einfo "Determining SAPI(s) to build"
63
-	phpconfutils_require_any "  Enabled  SAPI:" "  Disabled SAPI:" cli cgi apache2
64
-
65
-	# Threaded Apache2 support
66
-	if use apache2 ; then
67
-		has_apache_threads
68
-	fi
69
-
70
-	# Concurrent PHP Apache2 modules support
71
-	if use apache2 ; then
72
-		if use concurrentmodphp ; then
73
-			ewarn
74
-			ewarn "'concurrentmodphp' makes it possible to load multiple, differently"
75
-			ewarn "versioned mod_php's into the same Apache instance. This is done with"
76
-			ewarn "a few linker tricks and workarounds, and is not guaranteed to always"
77
-			ewarn "work correctly, so use it at your own risk. Especially, do not use"
78
-			ewarn "this in conjunction with PHP modules (PECL, ...) other than the ones"
79
-			ewarn "you may find in the Portage tree or the PHP Overlay!"
80
-			ewarn "This is an experimental feature, so please rebuild PHP"
81
-			ewarn "without the 'concurrentmodphp' USE flag if you experience"
82
-			ewarn "any problems, and then reproduce any bugs before filing"
83
-			ewarn "them in Gentoo's Bugzilla or bugs.php.net."
84
-			ewarn "If you have conclusive evidence that a bug directly"
85
-			ewarn "derives from 'concurrentmodphp', please file a bug in"
86
-			ewarn "Gentoo's Bugzilla only."
87
-			ewarn
88
-			ebeep 5
89
-		fi
90
-	fi
91
-
92
-	# fastbuild support
93
-	if use fastbuild ; then
94
-		ewarn
95
-		ewarn "'fastbuild' attempts to build all SAPIs in a single pass."
96
-		ewarn "This is an experimental feature, so please rebuild PHP"
97
-		ewarn "without the 'fastbuild' USE flag if you experience"
98
-		ewarn "any problems, and then reproduce any bugs before filing"
99
-		ewarn "them in Gentoo's Bugzilla or bugs.php.net."
100
-		ewarn "If you have conclusive evidence that a bug directly"
101
-		ewarn "derives from 'fastbuild', please file a bug in"
102
-		ewarn "Gentoo's Bugzilla only."
103
-		ewarn
104
-	fi
105
-
106
-	if use pcre ; then
107
-		built_with_use dev-libs/libpcre unicode || \
108
-			die "Please rebuild dev-libs/libpcre with USE=unicode"
109
-	fi
110
-
111
-	depend.apache_pkg_setup
112
-	php5_2-sapi_pkg_setup
113
-}
114
-
115
-php_determine_sapis() {
116
-	# holds the list of sapis that we want to build
117
-	PHPSAPIS=
118
-
119
-	if use cli || phpconfutils_usecheck cli ; then
120
-		PHPSAPIS="${PHPSAPIS} cli"
121
-	fi
122
-
123
-	if use cgi ; then
124
-		PHPSAPIS="${PHPSAPIS} cgi"
125
-	fi
126
-
127
-	# note - apache SAPI comes after the simpler cli/cgi sapis
128
-	if use apache2 ; then
129
-		PHPSAPIS="${PHPSAPIS} apache${APACHE_VERSION}"
130
-	fi
131
-}
132
-
133
-src_unpack() {
134
-	if [[ "${PHP_PACKAGE}" == 1 ]] ; then
135
-		unpack ${A}
136
-	fi
137
-
138
-	cd "${S}"
139
-
140
-	epatch "${FILESDIR}"/${PN}-5.2.12-libpng14.patch
141
-
142
-	# Concurrent PHP Apache2 modules support
143
-	if use apache2 ; then
144
-		if use concurrentmodphp ; then
145
-			if [[ -n "${CONCURRENTMODPHP_PATCH}" ]] && [[ -f "${WORKDIR}/${CONCURRENTMODPHP_PATCH}" ]] ; then
146
-				epatch "${WORKDIR}/${CONCURRENTMODPHP_PATCH}"
147
-			else
148
-				ewarn "There is no concurrent mod_php patch available for this PHP release yet!"
149
-			fi
150
-		fi
151
-	fi
152
-
153
-	# fastbuild support
154
-	if use fastbuild ; then
155
-		if [[ -n "${FASTBUILD_PATCH}" ]] && [[ -f "${WORKDIR}/${FASTBUILD_PATCH}" ]] ; then
156
-			epatch "${WORKDIR}/${FASTBUILD_PATCH}"
157
-		else
158
-			ewarn "There is no fastbuild patch available for this PHP release yet!"
159
-		fi
160
-	fi
161
-
162
-	# kolab support
163
-	if [[ -n "${KOLAB_PATCH}" ]] ; then
164
-		use kolab && epatch "${WORKDIR}/${KOLAB_PATCH}"
165
-	fi
166
-
167
-	# pretend to not have flex, bug 221357
168
-	sed -re 's:( +)PHP_SUBST\(LEX\):\1LEX="exit 0;"\n\0:' -i acinclude.m4
169
-
170
-	# Now let the eclass do the rest and regenerate the configure
171
-	php5_2-sapi_src_unpack
172
-
173
-	# Fix Makefile.global:test to consider the CGI SAPI if present
174
-	if use cgi ; then
175
-		sed -e "s|test \! -z \"\$(top_builddir)/php-cli\" \&\& test -x \"\$(top_builddir)/php-cli\"|test \! -z \"\$(top_builddir)/php-cli\" \&\& test -x \"\$(top_builddir)/php-cli\" \&\& test \! -z \"\$(top_builddir)/php-cgi\" \&\& test -x \"\$(top_builddir)/php-cgi\"|g" -i Makefile.global
176
-		sed -e "s|TEST_PHP_EXECUTABLE=\"\$(top_builddir)/php-cli\"|TEST_PHP_EXECUTABLE=\"\$(top_builddir)/php-cli\" TEST_PHP_CGI_EXECUTABLE=\"\$(top_builddir)/php-cgi\"|g" -i Makefile.global
177
-	fi
178
-
179
-	# try to fix some test cases which fail because of sandbox otherwise
180
-	sed -e 's:/no/such/:.\0:' -i ext/standard/tests/file/005_error.phpt \
181
-		ext/standard/tests/file/006_error.phpt \
182
-		ext/standard/tests/file/touch.phpt
183
-
184
-	# REMOVING BROKEN TESTS:
185
-	# removing this test as it has been broken for ages and is not easily
186
-	# fixable (depends on a lot of factors)
187
-	rm ext/standard/tests/general_functions/phpinfo.phpt
188
-
189
-	# never worked properly, no easy fix
190
-	rm ext/iconv/tests/iconv_stream_filter.phpt
191
-
192
-	# needs write access to /tmp and others
193
-	rm ext/session/tests/session_save_path_variation5.phpt
194
-
195
-	# new tests since 5.2.7 which have never been working for me
196
-	rm ext/spl/tests/arrayObject___construct_basic4.phpt \
197
-		ext/spl/tests/arrayObject___construct_basic5.phpt \
198
-		ext/spl/tests/arrayObject_exchangeArray_basic3.phpt \
199
-		ext/spl/tests/arrayObject_setFlags_basic1.phpt
200
-
201
-	# those might as well be related to suhosin
202
-	rm ext/session/tests/session_decode_variation3.phpt \
203
-		ext/session/tests/session_encode_variation8.phpt
204
-
205
-	# missing skipif
206
-	use reflection || \
207
-		rm ext/standard/tests/directory/DirectoryClass_basic_001.phpt
208
-
209
-	# sandbox-related (sandbox checks for permissions before even looking
210
-	# at the fs, but the tests expect "No such file or directory"
211
-	sed -e 's:/blah:./bla:' -i \
212
-		ext/session/tests/session_save_path_variation{2,3}.phpt
213
-	rm ext/standard/tests/file/rename_variation13.phpt
214
-
215
-	# test passes, but run-tests.php claims failure
216
-	rm ext/standard/tests/file/tempnam_variation4.phpt
217
-
218
-	# these tests behave differently with suhosin enabled, adapting them...
219
-	use suhosin && sed -e 's:File(\.\./):File(..):g' -i \
220
-		tests/security/open_basedir*{.inc,.phpt}
221
-}
222
-
223
-src_compile() {
224
-	# bug 217392 (autconf-2.62 behavior changes)
225
-	export CFLAGS="${CFLAGS} -D_GNU_SOURCE"
226
-	export CXXFLAGS="${CXXFLAGS} -D_GNU_SOURCE"
227
-	if use fastbuild && [[ -n "${FASTBUILD_PATCH}" ]] ; then
228
-		src_compile_fastbuild
229
-	else
230
-		src_compile_normal
231
-	fi
232
-}
233
-
234
-src_compile_fastbuild() {
235
-	php_determine_sapis
236
-
237
-	build_cli=0
238
-	build_cgi=0
239
-	build_apache2=0
240
-	my_conf=""
241
-
242
-	for x in ${PHPSAPIS} ; do
243
-		case ${x} in
244
-			cli)
245
-				build_cli=1
246
-				;;
247
-			cgi)
248
-				build_cgi=1
249
-				;;
250
-			apache2)
251
-				build_apache2=1
252
-				;;
253
-		esac
254
-	done
255
-
256
-	if [[ ${build_cli} = 1 ]] ; then
257
-		my_conf="${my_conf} --enable-cli"
258
-	else
259
-		my_conf="${my_conf} --disable-cli"
260
-	fi
261
-
262
-	if [[ ${build_cgi} = 1 ]] ; then
263
-		my_conf="${my_conf} --enable-cgi --enable-fastcgi"
264
-		phpconfutils_extension_enable "discard-path" "discard-path" 0
265
-		phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
266
-	else
267
-		my_conf="${my_conf} --disable-cgi"
268
-	fi
269
-
270
-	if [[ ${build_apache2} = 1 ]] ; then
271
-		my_conf="${my_conf} --with-apxs2=/usr/sbin/apxs2"
272
-
273
-		# Threaded Apache2 support
274
-		if use threads ; then
275
-			my_conf="${my_conf} --enable-maintainer-zts"
276
-			ewarn "Enabling ZTS for Apache2 MPM"
277
-		fi
278
-
279
-		# Concurrent PHP Apache2 modules support
280
-		if use concurrentmodphp ; then
281
-			append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
282
-		fi
283
-	fi
284
-
285
-	if use pcre || phpconfutils_usecheck pcre ; then
286
-		myconf="${my_conf} --with-pcre-dir=/usr"
287
-		phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr"
288
-	fi
289
-
290
-	# Now we know what we are building, build it
291
-	php5_2-sapi_src_compile
292
-
293
-	# To keep the separate php.ini files for each SAPI, we change the
294
-	# build-defs.h and recompile
295
-
296
-	if [[ ${build_cli} = 1 ]] ; then
297
-		einfo
298
-		einfo "Building CLI SAPI"
299
-		einfo
300
-
301
-		sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php52/cli-php5"|g;' -i main/build-defs.h
302
-		sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php52/cli-php5/ext-active"|g;' -i main/build-defs.h
303
-		for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
304
-			[[ -f ${x} ]] && rm -f ${x}
305
-		done
306
-		make sapi/cli/php || die "Unable to make CLI SAPI"
307
-		cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
308
-	fi
309
-
310
-	if [[ ${build_cgi} = 1 ]] ; then
311
-		einfo
312
-		einfo "Building CGI SAPI"
313
-		einfo
314
-
315
-		sed -e 's|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH "/etc/php52/cgi-php5"|g;' -i main/build-defs.h
316
-		sed -e 's|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR "/etc/php52/cgi-php5/ext-active"|g;' -i main/build-defs.h
317
-		for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
318
-			[[ -f ${x} ]] && rm -f ${x}
319
-		done
320
-		make sapi/cgi/php-cgi || die "Unable to make CGI SAPI"
321
-		cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
322
-	fi
323
-
324
-	if [[ ${build_apache2} = 1 ]] ; then
325
-		einfo
326
-		einfo "Building apache${APACHE_VERSION} SAPI"
327
-		einfo
328
-
329
-		sed -e "s|^#define PHP_CONFIG_FILE_PATH.*|#define PHP_CONFIG_FILE_PATH \"/etc/php52/apache${APACHE_VERSION}-php5\"|g;" -i main/build-defs.h
330
-		sed -e "s|^#define PHP_CONFIG_FILE_SCAN_DIR.*|#define PHP_CONFIG_FILE_SCAN_DIR \"/etc/php52/apache${APACHE_VERSION}-php5/ext-active\"|g;" -i main/build-defs.h
331
-		for x in main/main.o main/main.lo main/php_ini.o main/php_ini.lo ; do
332
-			[[ -f ${x} ]] && rm -f ${x}
333
-		done
334
-		make || die "Unable to make apache${APACHE_VERSION} SAPI"
335
-	fi
336
-}
337
-
338
-src_compile_normal() {
339
-	php_determine_sapis
340
-
341
-	CLEAN_REQUIRED=0
342
-	my_conf=""
343
-
344
-	# Support the Apache2 extras, they must be set globally for all
345
-	# SAPIs to work correctly, especially for external PHP extensions
346
-	if use apache2 ; then
347
-		# Concurrent PHP Apache2 modules support
348
-		if use concurrentmodphp ; then
349
-			append-ldflags "-Wl,--version-script=${FILESDIR}/php5-ldvs"
350
-		fi
351
-	fi
352
-
353
-	for x in ${PHPSAPIS} ; do
354
-		if use pcre || phpconfutils_usecheck pcre ; then
355
-			myconf="${my_conf} --with-pcre-dir=/usr"
356
-			phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr"
357
-		fi
358
-
359
-		# Support the Apache2 extras, they must be set globally for all
360
-		# SAPIs to work correctly, especially for external PHP extensions
361
-		if use apache2 ; then
362
-			# Threaded Apache2 support
363
-			if use threads ; then
364
-				my_conf="${my_conf} --enable-maintainer-zts"
365
-				ewarn "Enabling ZTS for Apache2 MPM"
366
-			fi
367
-		fi
368
-
369
-		if [[ "${CLEAN_REQUIRED}" = 1 ]] ; then
370
-			make clean
371
-		fi
372
-
373
-		PHPSAPI="${x}"
374
-
375
-		case ${x} in
376
-			cli)
377
-				my_conf="${my_conf} --enable-cli --disable-cgi"
378
-				php5_2-sapi_src_compile
379
-				cp sapi/cli/php php-cli || die "Unable to copy CLI SAPI"
380
-				;;
381
-			cgi)
382
-				my_conf="${my_conf} --disable-cli --enable-cgi --enable-fastcgi"
383
-				phpconfutils_extension_enable "discard-path" "discard-path" 0
384
-				phpconfutils_extension_enable "force-cgi-redirect" "force-cgi-redirect" 0
385
-				php5_2-sapi_src_compile
386
-				cp sapi/cgi/php-cgi php-cgi || die "Unable to copy CGI SAPI"
387
-				;;
388
-			apache2)
389
-				my_conf="${my_conf} --disable-cli --with-apxs2=/usr/sbin/apxs2"
390
-				php5_2-sapi_src_compile
391
-				;;
392
-		esac
393
-
394
-		CLEAN_REQUIRED=1
395
-		my_conf=""
396
-	done
397
-}
398
-
399
-src_install() {
400
-	php_determine_sapis
401
-
402
-	destdir=/usr/$(get_libdir)/php52
403
-
404
-	# Let the eclass do the common work
405
-	php5_2-sapi_src_install
406
-
407
-	einfo
408
-	einfo "Installing SAPI(s) ${PHPSAPIS}"
409
-	einfo
410
-
411
-	for x in ${PHPSAPIS} ; do
412
-
413
-		PHPSAPI="${x}"
414
-
415
-		case ${x} in
416
-			cli)
417
-				einfo "Installing CLI SAPI"
418
-				into ${destdir}
419
-				newbin php-cli php || die "Unable to install ${x} sapi"
420
-				php5_2-sapi_install_ini
421
-				;;
422
-			cgi)
423
-				einfo "Installing CGI SAPI"
424
-				into ${destdir}
425
-				dobin php-cgi || die "Unable to install ${x} sapi"
426
-				php5_2-sapi_install_ini
427
-				;;
428
-			apache2)
429
-				einfo "Installing Apache${APACHE_VERSION} SAPI"
430
-				make INSTALL_ROOT="${D}" install-sapi || die "Unable to install ${x} SAPI"
431
-				if use concurrentmodphp ; then
432
-					einfo "Installing Apache${APACHE_VERSION} config file for PHP5-concurrent (70_mod_php5_concurr.conf)"
433
-					insinto ${APACHE_MODULES_CONFDIR}
434
-					newins "${FILESDIR}/70_mod_php5_concurr.conf-apache2-r1" "70_mod_php5_concurr.conf"
435
-
436
-					# Put the ld version script in the right place so it's always accessible
437
-					insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
438
-					doins "${FILESDIR}/php5-ldvs"
439
-
440
-					# Redefine the extension dir to have the modphp suffix
441
-					PHPEXTDIR="`"${D}/${destdir}/bin/php-config" --extension-dir`-versioned"
442
-				else
443
-					einfo "Installing Apache${APACHE_VERSION} config file for PHP5 (70_mod_php5.conf)"
444
-					insinto ${APACHE_MODULES_CONFDIR}
445
-					newins "${FILESDIR}/70_mod_php5.conf-apache2-r1" "70_mod_php5.conf"
446
-				fi
447
-				php5_2-sapi_install_ini
448
-				;;
449
-		esac
450
-	done
451
-
452
-	# Install env.d files
453
-	newenvd "${FILESDIR}/20php5-envd" "20php52"
454
-	sed -e "s|/lib/|/$(get_libdir)/|g" -i "${D}/etc/env.d/20php52"
455
-}
456
-
457
-pkg_postinst() {
458
-	# Output some general info to the user
459
-	if use apache2 ; then
460
-		APACHE2_MOD_DEFINE="PHP5"
461
-		if use concurrentmodphp ; then
462
-			APACHE2_MOD_CONF="70_mod_php5_concurr"
463
-		else
464
-			APACHE2_MOD_CONF="70_mod_php5"
465
-		fi
466
-		apache-module_pkg_postinst
467
-	fi
468
-
469
-	# Update Apache2 to use mod_php
470
-	if use apache2 ; then
471
-		"${ROOT}/usr/sbin/php-select" -t apache2 php5 > /dev/null 2>&1
472
-		exitStatus=$?
473
-		if [[ ${exitStatus} == 2 ]] ; then
474
-			php-select apache2 php5
475
-		elif [[ ${exitStatus} == 4 ]] ; then
476
-			ewarn
477
-			ewarn "Apache2 is configured to load a different version of PHP."
478
-			ewarn "To make Apache2 use PHP v5, use php-select:"
479
-			ewarn
480
-			ewarn "    php-select apache2 php5"
481
-			ewarn
482
-		fi
483
-	fi
484
-
485
-	# Create the symlinks for php-cli
486
-	if use cli || phpconfutils_usecheck cli ; then
487
-		"${ROOT}/usr/sbin/php-select" -t php php5 > /dev/null 2>&1
488
-		exitStatus=$?
489
-		if [[ ${exitStatus} == 5 ]] ; then
490
-			php-select php php5
491
-		elif [[ ${exitStatus} == 4 ]] ; then
492
-			ewarn
493
-			ewarn "/usr/bin/php links to a different version of PHP."
494
-			ewarn "To make /usr/bin/php point to PHP v5, use php-select:"
495
-			ewarn
496
-			ewarn "    php-select php php5"
497
-			ewarn
498
-		fi
499
-	fi
500
-
501
-	# Create the symlinks for php-cgi
502
-	if use cgi ; then
503
-		"${ROOT}/usr/sbin/php-select" -t php-cgi php5 > /dev/null 2>&1
504
-		exitStatus=$?
505
-		if [[ ${exitStatus} == 5 ]] ; then
506
-			php-select php-cgi php5
507
-		elif [[ ${exitStatus} == 4 ]] ; then
508
-			ewarn
509
-			ewarn "/usr/bin/php-cgi links to a different version of PHP."
510
-			ewarn "To make /usr/bin/php-cgi point to PHP v5, use php-select:"
511
-			ewarn
512
-			ewarn "    php-select php-cgi php5"
513
-			ewarn
514
-		fi
515
-	fi
516
-
517
-	# Create the symlinks for php-devel
518
-	"${ROOT}/usr/sbin/php-select" -t php-devel php5 > /dev/null 2>&1
519
-	exitStatus=$?
520
-	if [[ $exitStatus == 5 ]] ; then
521
-		php-select php-devel php5
522
-	elif [[ $exitStatus == 4 ]] ; then
523
-		ewarn
524
-		ewarn "/usr/bin/php-config and/or /usr/bin/phpize are linked to a"
525
-		ewarn "different version of PHP. To make them point to PHP v5, use"
526
-		ewarn "php-select:"
527
-		ewarn
528
-		ewarn "    php-select php-devel php5"
529
-		ewarn
530
-	fi
531
-
532
-	php5_2-sapi_pkg_postinst
533
-}
534
-
535
-src_test() {
536
-	echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
537
-	if [[ ! -x "${S}"/php-cli ]]; then
538
-		ewarn "Running the php test suite requires USE=cli"
539
-		return
540
-	fi
541
-
542
-	export TEST_PHP_EXECUTABLE="${S}"/php-cli
543
-	if [[ -x "${S}"/php-cgi ]]; then
544
-		export TEST_PHP_CGI_EXECUTABLE="${S}"/php-cgi
545
-	fi
546
-	REPORT_EXIT_STATUS=1 "${S}"/php-cli -n "${S}"/run-tests.php -n
547
-
548
-	if [[ $? != 0 ]] ; then
549
-		eerror "Not all tests were successful!"
550
-	fi
551
-}
... ...
@@ -1,901 +0,0 @@
1
-# ChangeLog for mail-mta/courier
2
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/ChangeLog,v 1.132 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-  05 Dec 2010; Matt Turner <mattst88@gentoo.org> courier-0.59.0.ebuild,
6
-  courier-0.60.0.ebuild, courier-0.61.1.ebuild, courier-0.61.2.ebuild,
7
-  courier-0.62.2.ebuild, courier-0.63.0.ebuild, courier-0.64.0.ebuild,
8
-  courier-0.64.1.ebuild, courier-0.65.0.ebuild:
9
-  Drop ~mips keywords due to broken dependencies. Bug 247702.
10
-
11
-  24 Oct 2010; Brent Baude <ranger@gentoo.org> courier-0.64.1.ebuild:
12
-  Marking courier-0.64.1 ppc for bug 319785
13
-
14
-  16 Jul 2010; Christian Faulhammer <fauli@gentoo.org>
15
-  courier-0.64.1.ebuild:
16
-  stable x86, bug 319785
17
-
18
-*courier-0.65.0 (28 Jun 2010)
19
-
20
-  28 Jun 2010; Hanno Boeck <hanno@gentoo.org> +courier-0.65.0.ebuild:
21
-  Version bump.
22
-
23
-  17 Jun 2010; Patrick Lauer <patrick@gentoo.org> courier-0.59.0.ebuild,
24
-  courier-0.60.0.ebuild, courier-0.61.1.ebuild, courier-0.61.2.ebuild,
25
-  courier-0.62.2.ebuild, courier-0.63.0.ebuild, courier-0.64.0.ebuild,
26
-  courier-0.64.1.ebuild:
27
-  Migrating away from deprecated postgres virtuals
28
-
29
-  19 May 2010; Jeroen Roovers <jer@gentoo.org> courier-0.64.1.ebuild:
30
-  Stable for HPPA (bug #319785).
31
-
32
-*courier-0.64.1 (08 Mar 2010)
33
-
34
-  08 Mar 2010; Hanno Boeck <hanno@gentoo.org> +courier-0.64.1.ebuild:
35
-  Version bump.
36
-
37
-  31 Jan 2010; Torsten Veller <tove@gentoo.org> courier-0.59.0.ebuild,
38
-  courier-0.60.0.ebuild, courier-0.61.1.ebuild, courier-0.61.2.ebuild:
39
-  Change vecho to echo
40
-
41
-*courier-0.64.0 (31 Jan 2010)
42
-
43
-  31 Jan 2010; Hanno Boeck <hanno@gentoo.org> +courier-0.64.0.ebuild:
44
-  Version bump.
45
-
46
-  07 Jan 2010; Brent Baude <ranger@gentoo.org> courier-0.62.2.ebuild:
47
-  Marking courier-0.62.2 ppc for bug 292087
48
-
49
-  01 Jan 2010; Raúl Porcel <armin76@gentoo.org> courier-0.62.2.ebuild:
50
-  alpha/ia64/sparc stable wrt #292087
51
-
52
-  26 Dec 2009; Peter Volkov <pva@gentoo.org> courier-0.59.0.ebuild,
53
-  courier-0.60.0.ebuild, courier-0.61.1.ebuild, courier-0.61.2.ebuild,
54
-  courier-0.62.2.ebuild, courier-0.63.0.ebuild:
55
-  virtual/ghostscript->app-text/ghostscript-gpl: ghostscript-gpl is the only
56
-  implementation left in the tree.
57
-
58
-*courier-0.63.0 (07 Dec 2009)
59
-
60
-  07 Dec 2009; Hanno Boeck <hanno@gentoo.org> +courier-0.63.0.ebuild:
61
-  Version bump.
62
-
63
-  01 Dec 2009; Markus Meier <maekke@gentoo.org> courier-0.62.2.ebuild:
64
-  amd64/x86 stable, bug #292087
65
-
66
-*courier-0.62.2 (31 Jul 2009)
67
-
68
-  31 Jul 2009; Hanno Boeck <hanno@gentoo.org> +courier-0.62.2.ebuild:
69
-  Version bump, some cleanup, get rid of checking FEATURES variable.
70
-
71
-  04 May 2009; Hanno Boeck <hanno@gentoo.org> courier-0.61.2.ebuild:
72
-  Don't redundantly set S and don't call filter-flags in global scope.
73
-
74
-*courier-0.61.2 (04 May 2009)
75
-
76
-  04 May 2009; Hanno Boeck <hanno@gentoo.org> +courier-0.61.2.ebuild:
77
-  Version bump.
78
-
79
-*courier-0.61.1 (22 Feb 2009)
80
-
81
-  22 Feb 2009; Hanno Boeck <hanno@gentoo.org> +courier-0.61.1.ebuild:
82
-  Version bump.
83
-
84
-  20 Nov 2008; Hanno Boeck <hanno@gentoo.org> +files/courier-init-r2,
85
-  courier-0.60.0.ebuild:
86
-  Fix location of webmaild in init script, thanks to Mike Bryce in #225093.
87
-
88
-  23 Aug 2008; Doug Goldstein <cardoe@gentoo.org> metadata.xml:
89
-  add GLEP 56 USE flag desc from use.local.desc
90
-
91
-*courier-0.60.0 (21 Jul 2008)
92
-
93
-  21 Jul 2008; Hanno Boeck <hanno@gentoo.org> +courier-0.60.0.ebuild:
94
-  Version bump, as-needed-Patch removed, has been applied upstream.
95
-
96
-  16 Jul 2008; Luca Longinotti <chtekk@gentoo.org> courier-0.53.2-r1.ebuild,
97
-  courier-0.55.1-r1.ebuild, courier-0.59.0.ebuild:
98
-  Dep on PostgreSQL libs only.
99
-
100
-  14 Jun 2008; nixnut <nixnut@gentoo.org> courier-0.59.0.ebuild:
101
-  Stable on ppc wrt bug 223767
102
-
103
-  07 Jun 2008; Raúl Porcel <armin76@gentoo.org> courier-0.59.0.ebuild:
104
-  alpha/ia64 stable wrt #223767
105
-
106
-  07 Jun 2008; Friedrich Oslage <bluebird@gentoo.org> courier-0.59.0.ebuild:
107
-  stable on sparc, bug #223767
108
-
109
-  04 Jun 2008; Dawid Węgliński <cla@gentoo.org> courier-0.59.0.ebuild:
110
-  Stable on x86/amd64 (bug #223767)
111
-
112
-  02 Jun 2008; Jeroen Roovers <jer@gentoo.org> courier-0.59.0.ebuild:
113
-  Stable for HPPA (bug #223767).
114
-
115
-  21 May 2008; Tiziano Müller <dev-zero@gentoo.org>
116
-  courier-0.53.2-r1.ebuild, courier-0.55.1-r1.ebuild, courier-0.59.0.ebuild:
117
-  Changed dependency for postgresql from dev-db/postgresql to
118
-  virtual/postgresql-server
119
-
120
-  21 May 2008; Tiziano Müller <dev-zero@gentoo.org>
121
-  courier-0.53.2-r1.ebuild, courier-0.55.1-r1.ebuild, courier-0.59.0.ebuild:
122
-  Changed dependency for postgresql from dev-db/postgresql to
123
-  virtual/postgresql-server
124
-
125
-  14 May 2008; Hanno Boeck <hanno@gentoo.org> courier-0.59.0.ebuild:
126
-  Remove uclibc-sed (this is already in upstream). remove global eautoreconf
127
-  call (we don't need it and it causes trouble).
128
-
129
-  05 May 2008; Hanno Boeck <hanno@gentoo.org>
130
-  +files/courier-0.59.0-asneeded.patch, metadata.xml, courier-0.59.0.ebuild:
131
-  Fix for --as-needed, thanks to flameeyes.
132
-
133
-  22 Apr 2008; Diego Pettenò <flameeyes@gentoo.org> courier-0.59.0.ebuild:
134
-  Don't call _elibtoolize manually! Use eautoreconf instead.
135
-
136
-  21 Apr 2008; Christian Heim <phreak@gentoo.org> metadata.xml:
137
-  Fixing up the metadata.xml. If there's no maintainer and no herd, also add
138
-  the maintainer-needed assignee.
139
-
140
-*courier-0.59.0 (21 Apr 2008)
141
-
142
-  21 Apr 2008; Hanno Boeck <hanno@gentoo.org>
143
-  +files/remove-sysconftool.patch, +courier-0.59.0.ebuild:
144
-  Version bump, proxy-maintained user ebuild by Bernd Wurst.
145
-
146
-  20 Apr 2008; Hanno Boeck <hanno@gentoo.org> courier-0.55.1-r1.ebuild:
147
-  Fix quoting.
148
-
149
-  03 Feb 2008; Benedikt Böhm <hollow@gentoo.org> courier-0.53.2.ebuild,
150
-  courier-0.53.2-r1.ebuild, courier-0.55.1.ebuild, courier-0.55.1-r1.ebuild:
151
-  get rid of completely broken mime type handling wrt #208033
152
-
153
-  15 Aug 2007; Tobias Scherbaum <dertobi123@gentoo.org>
154
-  courier-0.53.2-r1.ebuild:
155
-  ppc stable, bug #184221
156
-
157
-  11 Aug 2007; Steve Dibb <beandog@gentoo.org> courier-0.53.2-r1.ebuild:
158
-  amd64 stable, bug 184221
159
-
160
-  29 Jul 2007; Christian Heim <phreak@gentoo.org> courier-0.53.2.ebuild,
161
-  courier-0.53.2-r1.ebuild, courier-0.55.1.ebuild, courier-0.55.1-r1.ebuild:
162
-  Fixing the DEPEND/RDEPEND for the move of net-www/apache to
163
-  www-servers/apache (#78622).
164
-
165
-  10 Jul 2007; Jeroen Roovers <jer@gentoo.org> courier-0.53.2-r1.ebuild:
166
-  Stable for HPPA (bug #184221).
167
-
168
-  05 Jul 2007; Gustavo Zacarias <gustavoz@gentoo.org>
169
-  courier-0.53.2-r1.ebuild:
170
-  Stable on sparc wrt #184221
171
-
172
-  05 Jul 2007; Raúl Porcel <armin76@gentoo.org> courier-0.53.2-r1.ebuild:
173
-  alpha/ia64/x86 stable wrt #184221
174
-
175
-*courier-0.55.1-r1 (04 Jul 2007)
176
-*courier-0.53.2-r1 (04 Jul 2007)
177
-
178
-  04 Jul 2007; Diego Pettenò <flameeyes@gentoo.org>
179
-  +files/pam-include.patch, +courier-0.53.2-r1.ebuild,
180
-  +courier-0.55.1-r1.ebuild:
181
-  Add patch from Ed Catmur to work with PAM 0.99 (and in general without
182
-  pam_stack). Thanks Ed. See bug #177748.
183
-
184
-*courier-0.55.1 (30 May 2007)
185
-
186
-  30 May 2007; Caleb Tennis <caleb@gentoo.org> +courier-0.55.1.ebuild:
187
-  Version bump.  It emerges, but I'm still testing everything out
188
-
189
-  28 Apr 2007; Sven Wegener <swegener@gentoo.org> courier-0.53.2.ebuild:
190
-  Fix *initd, *confd and *envd calls (#17388, #174266)
191
-
192
-  02 Apr 2007; Petteri Räty <betelgeuse@gentoo.org> -courier-0.48.1.ebuild,
193
-  -courier-0.48.1-r1.ebuild, -courier-0.48.2.20050224.ebuild,
194
-  -courier-0.49.0.ebuild, -courier-0.49.0.20050405.ebuild,
195
-  -courier-0.50.0.ebuild, -courier-0.50.1.ebuild, -courier-0.50.1-r1.ebuild,
196
-  -courier-0.52.2.ebuild, courier-0.53.2.ebuild:
197
-  Remove old versions. Most of these are vulnerable to security issues.
198
-
199
-  18 Mar 2007; Marius Mauch <genone@gentoo.org> courier-0.48.1.ebuild,
200
-  courier-0.48.1-r1.ebuild, courier-0.48.2.20050224.ebuild,
201
-  courier-0.49.0.ebuild, courier-0.49.0.20050405.ebuild,
202
-  courier-0.50.0.ebuild, courier-0.50.1.ebuild, courier-0.50.1-r1.ebuild,
203
-  courier-0.52.2.ebuild, courier-0.53.2.ebuild:
204
-  Replacing einfo with elog
205
-
206
-  05 Jan 2007; Diego Pettenò <flameeyes@gentoo.org>
207
-  courier-0.48.2.20050224.ebuild, courier-0.49.0.ebuild,
208
-  courier-0.49.0.20050405.ebuild, courier-0.50.0.ebuild,
209
-  courier-0.50.1.ebuild, courier-0.50.1-r1.ebuild, courier-0.52.2.ebuild:
210
-  Remove gnuconfig_update usage, leave it to econf.
211
-
212
-  04 Jan 2007; Diego Pettenò <flameeyes@gentoo.org> courier-0.53.2.ebuild:
213
-  Fix broken autotools handling and remove gnuconfig inheritance.
214
-
215
-  23 Nov 2006; Francesco Riosa <vivo@gentoo.org> courier-0.48.1.ebuild,
216
-  courier-0.48.1-r1.ebuild, courier-0.48.2.20050224.ebuild,
217
-  courier-0.49.0.ebuild, courier-0.49.0.20050405.ebuild,
218
-  courier-0.50.0.ebuild, courier-0.50.1.ebuild, courier-0.50.1-r1.ebuild,
219
-  courier-0.52.2.ebuild, courier-0.53.2.ebuild:
220
-  dev-db/mysql => virtual/mysql
221
-
222
-  15 Oct 2006; Bryan Østergaard <kloeri@gentoo.org> courier-0.53.2.ebuild:
223
-  Stable on ia64, bug 135005.
224
-
225
-  14 Oct 2006; Bryan Østergaard <kloeri@gentoo.org> metadata.xml:
226
-  Remove swtaylor from metadata.xml due to retiring.
227
-
228
-  31 Jul 2006; Simon Stelling <blubb@gentoo.org> courier-0.53.2.ebuild:
229
-  stable on amd64 wrt bug 135005
230
-
231
-  22 Jul 2006; Thomas Cort <tcort@gentoo.org> courier-0.53.2.ebuild:
232
-  Stable on alpha wrt security Bug #135005.
233
-
234
-  22 Jul 2006; Rene Nussbaumer <killerfox@gentoo.org> courier-0.53.2.ebuild:
235
-  Stable on hppa. See bug #135005.
236
-
237
-  20 Jul 2006; Joshua Jackson <tsunam@gentoo.org> courier-0.53.2.ebuild:
238
-  marking the right version stable for x86 this time
239
-
240
-  18 Jul 2006; Michael Hanselmann <hansmi@gentoo.org> courier-0.53.2.ebuild:
241
-  Stable on ppc, too.
242
-
243
-  18 Jul 2006; Michael Hanselmann <hansmi@gentoo.org> courier-0.52.2.ebuild:
244
-  Stable on ppc.
245
-
246
-  18 Jul 2006; Tuấn Văn <langthang@gentoo.org> courier-0.53.2.ebuild:
247
-  remove conditional patch. should be always or `use_with fam` won't work.
248
-
249
-  18 Jul 2006; Tuấn Văn <langthang@gentoo.org>
250
-  +files/fam-disable-check.patch, courier-0.53.2.ebuild:
251
-  add fam-disable-check patch. Bug #140883.
252
-  mv epatch to src_unpack and use eautoreconf instead.
253
-
254
-  16 Jul 2006; Jason Wever <weeve@gentoo.org> courier-0.53.2.ebuild:
255
-  Stable on SPARC wrt security bug #135005.
256
-
257
-  14 Jul 2006; Luca Longinotti <chtekk@gentoo.org> files/mailer.conf,
258
-  courier-0.53.2.ebuild:
259
-  Fix bug in src_test and correct mailer.conf, thanks to Jason Wever on bug
260
-  #135005.
261
-
262
-  12 Jul 2006; Joshua Jackson <tsunam@gentoo.org> courier-0.52.2.ebuild:
263
-  Stable x86; security bug #135005
264
-
265
-*courier-0.53.2 (11 Jul 2006)
266
-
267
-  11 Jul 2006; Luca Longinotti <chtekk@gentoo.org> +files/courier-init-r1,
268
-  +courier-0.53.2.ebuild:
269
-  Version bump. Fixes security bug #135005 and bugs #130957, #133401, #107557
270
-  and #134027. Thanks to Marcin Semeniuk for his help.
271
-
272
-  27 Apr 2006; Marien Zwart <marienz@gentoo.org>
273
-  files/digest-courier-0.48.1, files/digest-courier-0.48.1-r1,
274
-  files/digest-courier-0.48.2.20050224, files/digest-courier-0.49.0,
275
-  files/digest-courier-0.49.0.20050405, files/digest-courier-0.50.0,
276
-  files/digest-courier-0.50.1, files/digest-courier-0.50.1-r1, Manifest:
277
-  Fixing SHA256 digest, pass four
278
-
279
-  02 Mar 2006; Brian Jackson <iggy@gentoo.org> courier-0.52.2.ebuild:
280
-  added libpcre as a dep, bug 123900, thanks to Marco Iseli ismaATsfsservices.biz
281
-
282
-  19 Feb 2006; Brian Jackson <iggy@gentoo.org> +courier-0.52.2.ebuild:
283
-  version bump
284
-
285
-*courier-0.52.2 (19 Feb 2006)
286
-
287
-  25 Dec 2005; Diego Pettenò <flameeyes@gentoo.org>
288
-  courier-0.50.1-r1.ebuild:
289
-  Use root:0, not root:root.
290
-
291
-*courier-0.50.1-r1 (29 Jul 2005)
292
-
293
-  29 Jul 2005; Brian Jackson <iggy@gentoo.org> +courier-0.50.1-r1.ebuild:
294
-  revbump with some changes. it's -*, and I'd like to get some testing
295
-
296
-  11 Jul 2005; Bryan Østergaard <kloeri@gentoo.org>
297
-  courier-0.48.1-r1.ebuild:
298
-  Stable on alpha + ia64, bug 97915.
299
-
300
-  11 Jul 2005; Tobias Scherbaum <dertobi123@gentoo.org>
301
-  courier-0.48.1-r1.ebuild:
302
-  ppc stable, #97915
303
-
304
-  11 Jul 2005; Simon Stelling <blubb@gentoo.org> courier-0.48.1-r1.ebuild:
305
-  stable on amd64 wrt bug 97915
306
-
307
-  11 Jul 2005; Rene Nussbaumer <killerfox@gentoo.org>
308
-  courier-0.48.1-r1.ebuild:
309
-  Stable on hppa. bug #97915
310
-
311
-  11 Jul 2005; Jason Wever <weeve@gentoo.org> courier-0.48.1-r1.ebuild:
312
-  Stable on SPARC wrt security bug #97915.
313
-
314
-  10 Jul 2005; Andrej Kacian <ticho@gentoo.org> courier-0.48.1-r1.ebuild:
315
-  Stable on x86.
316
-
317
-*courier-0.48.1-r1 (10 Jul 2005)
318
-
319
-  10 Jul 2005; Andrej Kacian <ticho@gentoo.org>
320
-  +files/courier-0.48.1-spf-error-handling.patch, +courier-0.48.1-r1.ebuild:
321
-  Bumped 0.48.1 because of security bug #97915 with a patch to fix it. Also
322
-  fixed sandbox access violation on subsequent merge.
323
-
324
-  10 Jul 2005; Andrej Kacian <ticho@gentoo.org> +files/mailer.conf,
325
-  +courier-0.50.1.ebuild:
326
-  Version bump, wrt security bug #97915. Also changed the ebuild to be more
327
-  mailwrapper-compatible.
328
-
329
-*courier-0.50.1 (04 Jul 2005)
330
-
331
-  04 Jul 2005; Andrej Kacian <ticho@gentoo.org> +files/mailer.conf,
332
-  +courier-0.50.1.ebuild:
333
-  Version bump, due to security bug #97915. Also improved mailwrapper
334
-  compatibility.
335
-
336
-*courier-0.50.0 (02 Jul 2005)
337
-
338
-  02 Jul 2005; Scott W Taylor <swtaylor@gentoo.org> +courier-0.50.0.ebuild:
339
-  bump
340
-
341
-  29 May 2005; <solar@gentoo.org> courier-0.48.1.ebuild,
342
-  courier-0.48.2.20050224.ebuild, courier-0.49.0.20050405.ebuild,
343
-  courier-0.49.0.ebuild:
344
-  - update courier to use libc expanded variable elibc_uclibc vs uclibc so
345
-  USE=-* works
346
-
347
-*courier-0.49.0.20050405 (06 Apr 2005)
348
-
349
-  06 Apr 2005; Scott W Taylor <swtaylor@gentoo.org>
350
-  +courier-0.49.0.20050405.ebuild:
351
-  bump
352
-
353
-  21 Mar 2005; Scott W Taylor <swtaylor@gentoo.org> -courier-0.47-r1.ebuild,
354
-  -courier-0.48.2.ebuild, -courier-0.48.2.20050215.ebuild,
355
-  courier-0.48.2.20050224.ebuild, courier-0.49.0.ebuild:
356
-  tidy up due to collision with mailbase. strip bad cflags
357
-
358
-*courier-0.49.0 (04 Mar 2005)
359
-
360
-  04 Mar 2005; Scott W Taylor <swtaylor@gentoo.org>
361
-  courier-0.48.2.20050215.ebuild, courier-0.48.2.20050224.ebuild,
362
-  courier-0.48.2.ebuild, +courier-0.49.0.ebuild:
363
-  bump to 0.49.0 keepdir had been executed on too many directories, collided
364
-  with baselayout. readded more sane keepdir calls, fixes bug 82286
365
-
366
-  03 Mar 2005; Ciaran McCreesh <ciaranm@gentoo.org> courier-0.47-r1.ebuild,
367
-  courier-0.48.1.ebuild, courier-0.48.2.20050130.ebuild,
368
-  courier-0.48.2.20050203.ebuild, courier-0.48.2.20050215.ebuild,
369
-  courier-0.48.2.20050224.ebuild, courier-0.48.2.ebuild:
370
-  Move sys-apps/procps -> sys-process/procps
371
-
372
-*courier-0.48.2.20050224 (25 Feb 2005)
373
-
374
-  25 Feb 2005; Scott W Taylor <swtaylor@gentoo.org>
375
-  +courier-0.48.2.20050224.ebuild:
376
-  bump. adds sha256
377
-
378
-*courier-0.48.2.20050215 (15 Feb 2005)
379
-
380
-  15 Feb 2005; Scott W Taylor <swtaylor@gentoo.org>
381
-  +courier-0.48.2.20050215.ebuild:
382
-  bump, looks like minor stuff from upstream, consistency updates and
383
-  backscatter on uucp/fax
384
-
385
-*courier-0.48.2.20050203 (05 Feb 2005)
386
-
387
-  05 Feb 2005; Scott W Taylor <swtaylor@gentoo.org>
388
-  +courier-0.48.2.20050203.ebuild:
389
-  version bump. mostly backscatter updates
390
-
391
-  31 Jan 2005; Scott W Taylor <swtaylor@gentoo.org> files/courier-init,
392
-  courier-0.48.1.ebuild, courier-0.48.2.20050130.ebuild:
393
-  apply keepdir change to 0.48.1 as well
394
-
395
-  31 Jan 2005; Scott W Taylor <swtaylor@gentoo.org> files/courier-init,
396
-  courier-0.48.2.20050130.ebuild:
397
-  fewer keepdirs for 70503
398
-  init.d need famd for 69630
399
-  allow removal of fam for 69630.7
400
-
401
-  30 Jan 2005; Scott W Taylor <swtaylor@gentoo.org> courier-0.48.1.ebuild:
402
-  stabilize 0.48.1 - most notable change is authentication moved to new
403
-  courier-authlib package
404
-
405
-  30 Jan 2005; Scott W Taylor <swtaylor@gentoo.org>
406
-  courier-0.48.2.20050130.ebuild:
407
-  version bump, add smtp auth methods as well.
408
-
409
-*courier-0.48.2.20050130 (30 Jan 2005)
410
-*courier-0.48.2 (30 Jan 2005)
411
-
412
-  30 Jan 2005; Scott W Taylor <swtaylor@gentoo.org>
413
-  -courier-0.46.20040902.ebuild, -courier-0.47.20041129.ebuild,
414
-  courier-0.48.1.ebuild, +courier-0.48.2.20050130.ebuild,
415
-  +courier-0.48.2.ebuild, -courier-0.48.ebuild:
416
-  $(get_libdir) added for arch compatibility. cleaning house too.
417
-
418
-*courier-0.48.1 (05 Jan 2005)
419
-
420
-  05 Jan 2005; Scott W Taylor <swtaylor@gentoo.org> +courier-0.48.1.ebuild:
421
-  bump
422
-
423
-*courier-0.48 (01 Jan 2005)
424
-
425
-  01 Jan 2005; Scott W Taylor <swtaylor@gentoo.org> +courier-0.48.ebuild,
426
-  -courier-0.48_pre.ebuild:
427
-  courier 0.48 released
428
-
429
-  15 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.47-r1.ebuild,
430
-  courier-0.47.20041129.ebuild, courier-0.48_pre.ebuild:
431
-  move gnupg to fix circular dependancy
432
-
433
-  10 Dec 2004; Scott W Taylor <swtaylor@gentoo.org>
434
-  -courier-0.46.20040825.ebuild, -courier-0.46.ebuild, -courier-0.47.ebuild:
435
-  housecleaning
436
-
437
-  09 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.48_pre.ebuild:
438
-  don't mirror release candidate
439
-
440
-*courier-0.48_pre (09 Dec 2004)
441
-
442
-  09 Dec 2004; Scott W Taylor <swtaylor@gentoo.org>
443
-  +courier-0.48_pre.ebuild:
444
-  bump
445
-
446
-  07 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.47-r1.ebuild,
447
-  courier-0.47.20041129.ebuild:
448
-  remove virtual/mda block
449
-
450
-  06 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.47-r1.ebuild,
451
-  courier-0.47.20041129.ebuild:
452
-  add mime.types dep
453
-
454
-  05 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.47-r1.ebuild,
455
-  courier-0.47.20041129.ebuild:
456
-  keep .maildir even if empty
457
-
458
-*courier-0.47-r1 (05 Dec 2004)
459
-
460
-  05 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> +courier-0.47-r1.ebuild,
461
-  courier-0.47.20041129.ebuild:
462
-  build courier before mailwrapper, bug 73486
463
-
464
-  05 Dec 2004; Scott W Taylor <swtaylor@gentoo.org>
465
-  courier-0.47.20041129.ebuild:
466
-  sed magic to fix #73468
467
-
468
-  01 Dec 2004; Scott W Taylor <swtaylor@gentoo.org> -courier-0.45.6.ebuild,
469
-  -courier-0.46.20040816.ebuild, -courier-0.47.20041113.ebuild,
470
-  -courier-0.47.20041120.ebuild, courier-0.47.20041129.ebuild,
471
-  courier-0.47.ebuild:
472
-  bump and cleanup
473
-
474
-*courier-0.47.20041129 (01 Dec 2004)
475
-
476
-  01 Dec 2004; Scott W Taylor <swtaylor@gentoo.org>
477
-  +courier-0.47.20041129.ebuild:
478
-  bump
479
-
480
-  29 Nov 2004; Andrej Kacian <ticho@gentoo.org> courier-0.45.6.ebuild,
481
-  courier-0.46.20040816.ebuild, courier-0.46.20040825.ebuild,
482
-  courier-0.46.20040902.ebuild, courier-0.46.ebuild,
483
-  courier-0.47.20041113.ebuild, courier-0.47.20041120.ebuild,
484
-  courier-0.47.ebuild:
485
-  Changed app-admin/fam -> virtual/fam, as per bug #67170.
486
-
487
-  26 Nov 2004; Scott W Taylor <swtaylor@gentoo.org> files/courier-init:
488
-  will need courier-authlib in near future. init script updated to reflect this.
489
-
490
-*courier-0.47.20041120 (21 Nov 2004)
491
-
492
-  21 Nov 2004; Scott W Taylor <swtaylor@gentoo.org>
493
-  +courier-0.47.20041120.ebuild:
494
-  version bump. work in progress
495
-
496
-  19 Nov 2004; Scott W Taylor <swtaylor@gentoo.org>
497
-  courier-0.47.20041113.ebuild:
498
-  net-libs/courier-authlib
499
-
500
-  17 Nov 2004; Scott W Taylor <swtaylor@gentoo.org>
501
-  courier-0.47.20041113.ebuild:
502
-  getting closer
503
-
504
-  17 Nov 2004; Scott W Taylor <swtaylor@gentoo.org>
505
-  courier-0.47.20041113.ebuild:
506
-  work in progress. don't use.
507
-
508
-  16 Nov 2004; Scott W Taylor <swtaylor@gentoo.org>
509
-  courier-0.47.20041113.ebuild:
510
-  add maildropldap
511
-
512
-*courier-0.47.20041113 (16 Nov 2004)
513
-
514
-  16 Nov 2004; Scott W Taylor <swtaylor@gentoo.org>
515
-  +courier-0.47.20041113.ebuild:
516
-  now requires courier-authlib. work in progress.
517
-
518
-  02 Nov 2004; Bret Curtis,,, <psi29a@gentoo.org> courier-0.47.ebuild:
519
-  workes well on mips, but marked ~mips for now.
520
-
521
-  02 Oct 2004; <iggy@gentoo.org> files/courier-init:
522
-  fix bug #57310, thanks to Ben Kennedy
523
-
524
-  20 Sep 2004; <iggy@gentoo.org> courier-0.47.ebuild:
525
-  added a small fix for building with uclibc, and removed expect as a dep
526
-
527
-*courier-0.47 (19 Sep 2004)
528
-
529
-  19 Sep 2004; Scott W Taylor <swtaylor@gentoo.org> +courier-0.47.ebuild:
530
-  new version. src_uri is now a conditional instead of swapping commented lines
531
-  for maintainer ease
532
-
533
-  19 Sep 2004; Scott W Taylor <swtaylor@gentoo.org> -courier-0.45.4.ebuild,
534
-  -courier-0.45.5.20040606.ebuild, -courier-0.45.5.ebuild,
535
-  -courier-0.45.6.20040618.ebuild, courier-0.46.20040902.ebuild,
536
-  courier-0.46.ebuild:
537
-  cleanup, promote stable
538
-
539
-  06 Sep 2004; Ciaran McCreesh <ciaranm@gentoo.org> courier-0.45.4.ebuild,
540
-  courier-0.45.5.20040606.ebuild, courier-0.45.5.ebuild,
541
-  courier-0.45.6.20040618.ebuild, courier-0.45.6.ebuild,
542
-  courier-0.46.20040816.ebuild, courier-0.46.20040825.ebuild,
543
-  courier-0.46.20040902.ebuild, courier-0.46.ebuild:
544
-  Switch to use epause and ebeep, bug #62950. Fix header lines.
545
-
546
-  06 Sep 2004; Danny van Dyk <kugelfang@gentoo.org>
547
-  courier-0.46.20040902.ebuild:
548
-  Marked ~amd64.
549
-
550
-*courier-0.46.20040902 (03 Sep 2004)
551
-
552
-  03 Sep 2004; Scott W Taylor <swtaylor@gentoo.org>
553
-  +courier-0.46.20040902.ebuild:
554
-  hot off the press with spf update
555
-
556
-*courier-0.46.20040825 (26 Aug 2004)
557
-
558
-  26 Aug 2004; Scott W Taylor <swtaylor@gentoo.org>
559
-  +courier-0.46.20040825.ebuild:
560
-  bump. more SPF support
561
-
562
-*courier-0.46.20040816 (16 Aug 2004)
563
-
564
-  16 Aug 2004; Scott W Taylor <swtaylor@gentoo.org>
565
-  +courier-0.46.20040816.ebuild:
566
-  version bump. spf beginning to be handled internally. "man 8 courier" for
567
-  details.54557 really fixed.
568
-
569
-*courier-0.46 (01 Aug 2004)
570
-
571
-  01 Aug 2004; Scott W Taylor <swtaylor@gentoo.org>
572
-  courier-0.45.6.20040618.ebuild, courier-0.45.6.ebuild, +courier-0.46.ebuild:
573
-  mark 0.45.6.* stable
574
-
575
-*courier-0.46 (01 Aug 2004)
576
-
577
-  01 Aug 2004; Scott W Taylor <swtaylor@gentoo.org> +courier-0.46.ebuild:
578
-  courier 0.46 released today
579
-
580
-  29 Jul 2004; Gustavo Zacarias <gustavoz@gentoo.org>
581
-  courier-0.45.6.20040618.ebuild:
582
-  Stable on sparc wrt #58020
583
-
584
-  01 Jul 2004; Jeremy Huddleston <eradicator@gentoo.org>
585
-  courier-0.45.4.ebuild, courier-0.45.5.20040606.ebuild,
586
-  courier-0.45.5.ebuild, courier-0.45.6.20040618.ebuild,
587
-  courier-0.45.6.ebuild:
588
-  virtual/glibc -> virtual/libc
589
-
590
-  22 Jun 2004; Scott W Taylor <swtaylor@gentoo.org> -courier-0.45.3.ebuild,
591
-  courier-0.45.5.ebuild:
592
-  mark 0.45.5 stable
593
-
594
-  20 Jun 2004; Scott W Taylor <swtaylor@gentoo.org>
595
-  courier-0.45.6.20040618.ebuild, courier-0.45.6.ebuild:
596
-  cosmetic changes
597
-
598
-  20 Jun 2004; Scott W Taylor <swtaylor@gentoo.org>
599
-  courier-0.45.6.20040618.ebuild:
600
-  upstream added more config statements referencing Maildir. this fixes 54557
601
-
602
-*courier-0.45.6.20040618 (18 Jun 2004)
603
-
604
-  18 Jun 2004; Scott W Taylor <swtaylor@gentoo.org>
605
-  +courier-0.45.6.20040618.ebuild:
606
-  bump
607
-
608
-*courier-0.45.6 (12 Jun 2004)
609
-
610
-  12 Jun 2004; Scott W Taylor <swtaylor@gentoo.org> -courier-0.45.1.ebuild,
611
-  -courier-0.45.2.ebuild, courier-0.45.4.ebuild, +courier-0.45.6.ebuild:
612
-  new 45.6, stable 45.4, drop 45.1 and 45.2
613
-
614
-*courier-0.45.5.20040606 (08 Jun 2004)
615
-
616
-  08 Jun 2004; Scott W Taylor <swtaylor@gentoo.org>
617
-  +courier-0.45.5.20040606.ebuild:
618
-  Spiffy new courier. Tidy up ebuild as well.
619
-
620
-*courier-0.45.4 (29 May 2004)
621
-
622
-  29 May 2004; Robin H. Johnson <robbat2@gentoo.org> courier-0.45.1.ebuild,
623
-  courier-0.45.2.ebuild, courier-0.45.3.ebuild, courier-0.45.4.ebuild,
624
-  courier-0.45.5.ebuild, metadata.xml, files/apache-sqwebmail.inc, files/bofh,
625
-  files/courier-init, files/dot_courier, files/locallowercase,
626
-  files/norewrite.patch, files/password.dist, files/set-mime:
627
-  Moved from net-mail/courier to mail-mta/courier.
628
-
629
-*courier-0.45.5 (22 May 2004)
630
-
631
-  22 May 2004; Scott W Taylor <swtaylor@gentoo.org> +courier-0.45.5.ebuild:
632
-  bump 0.45.5
633
-
634
-  22 May 2004; Scott W Taylor <swtaylor@gentoo.org> files/courier-init:
635
-  spelling fix and init script update for sqwebmail which gets renamed in 0.45.5
636
-
637
-  28 Apr 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.45.2.ebuild,
638
-  courier-0.45.3.ebuild:
639
-  get ppc mask caught up
640
-
641
-  28 Apr 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.45.2.ebuild,
642
-  courier-0.45.3.ebuild, courier-0.45.4.ebuild:
643
-  Bug 49198 - moved ${D} adjustments out of pkg_preinst
644
-
645
-  27 Apr 2004; Aron Griffis <agriffis@gentoo.org> courier-0.45.3.ebuild,
646
-  courier-0.45.4.ebuild:
647
-  Add inherit eutils
648
-
649
-  21 Apr 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.45.2.ebuild,
650
-  courier-0.45.3.ebuild, courier-0.45.4.ebuild:
651
-  mark 0.45.2 stable and fix bug 41819
652
-
653
-  09 Apr 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.45.4.ebuild:
654
-  Added ~sparc on 0.45.4 too
655
-
656
-  06 Apr 2004; Jason Wever <weeve@gentoo.org> courier-0.45.3.ebuild:
657
-  Added ~sparc keyword wrt bug #46319.
658
-
659
-*courier-0.45.4 (06 Apr 2004)
660
-
661
-  06 Apr 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.45.4.ebuild:
662
-  version bump
663
-
664
-*courier-0.45.3 (01 Apr 2004)
665
-
666
-  01 Apr 2004; Scott W Taylor <swtaylor@gentoo.org> courier-0.45.3.ebuild,
667
-  files/courier-init, files/norewrite.patch:
668
-  Version bump and fixes for bugs 44241 and 44245.
669
-
670
-  30 Mar 2004; Lars Weiler <pylon@gentoo.org> courier-0.45.2.ebuild:
671
-  Masked ~ppc on user report
672
-
673
-*courier-0.45.2 (16 Mar 2004)
674
-
675
-  16 Mar 2004; Brian Jackson <iggy@gentoo.org> courier-0.45.2.ebuild,
676
-  files/courier-init:
677
-  version bump
678
-
679
-*courier-0.45.1 (09 Mar 2004)
680
-
681
-  09 Mar 2004; Brian Jackson <iggy@gentoo.org> courier-0.44.0.ebuild,
682
-  courier-0.44.2.20040201.ebuild, courier-0.44.2.ebuild,
683
-  courier-0.45.0.ebuild, courier-0.45.1.ebuild, files/courier,
684
-  files/courier-authdaemond, files/courier-esmtpd, files/courier-esmtpd-msa,
685
-  files/courier-esmtpd-ssl, files/courier-filterd, files/courier-imapd,
686
-  files/courier-imapd-ssl, files/courier-ldapaliasd, files/courier-mta,
687
-  files/courier-pop3d, files/courier-pop3d-ssl, files/gentoo.diff.bz2:
688
-  version bump, fixes 2 minor bugs only
689
-
690
-*courier-0.45.0 (07 Mar 2004)
691
-
692
-  07 Mar 2004; Brian Jackson <iggy@gentoo.org> courier-0.45.0.ebuild,
693
-  files/courier-init:
694
-  version bump, fix for bug 42164, and an issue reported by 
695
-  hachre@dynaloop.net
696
-
697
-  15 Feb 2004; Brian Jackson <iggy@gentoo.org> courier-0.44.2.20040201.ebuild:
698
-  a few cleanups, and fix bug 32878
699
-
700
-*courier-0.44.2.20040201 (08 Feb 2004)
701
-
702
-  08 Feb 2004; Brian Jackson <iggy@gentoo.org> courier-0.44.0.ebuild,
703
-  courier-0.44.2.20040201.ebuild, courier-0.44.2.ebuild:
704
-  version bump to fix a problem with 2.6 kernels, changed a few keywords
705
-
706
-  14 Jan 2004; Aron Griffis <agriffis@gentoo.org> courier-0.44.2.ebuild:
707
-  add ~alpha (bug 21240)
708
-
709
-  09 Dec 2003; Heinrich Wendel <lanius@gentoo.org> courier-0.44.0.ebuild,
710
-  courier-0.44.2.ebuild:
711
-  changed app-text/ghostscript to virtual/ghostscript
712
-
713
-  08 Dec 2003; Brian Jackson <iggy@gentoo.org> courier-0.42.2.ebuild,
714
-  courier-0.43.2.ebuild, courier-0.44.0.ebuild, courier-0.44.2.ebuild,
715
-  files/courier-0.42.2-gentoo.diff.bz2:
716
-  cleaning out old ebuilds/etc, and cleaning up touch .keep's
717
-
718
-  08 Dec 2003; Brian Jackson <iggy@gentoo.org> courier-0.42.2.ebuild:
719
-  fixed the other chown in courier-0.42.2
720
-
721
-  07 Dec 2003; foser <foser@gentoo.org> courier-0.*.ebuild :
722
-  Fix fam-oss > fam, due to move
723
-
724
-  07 Dec 2003; Brian Jackson <iggy@gentoo.org> courier-0.44.2.ebuild:
725
-  add note about recent sed magic
726
-
727
-  30 Nov 2003; Brian Jackson <iggy@gentoo.org> courier-0.44.0.ebuild:
728
-  bump 0.44.0 to x86
729
-
730
-*courier-0.44.2 (30 Nov 2003)
731
-
732
-  30 Nov 2003; Brian Jackson <iggy@gentoo.org> courier-0.44.2.ebuild,
733
-  files/courier-init:
734
-  version bump
735
-
736
-*courier-0.44.0 (07 Nov 2003)
737
-
738
-  07 Nov 2003; Brian Jackson <iggy@gentoo.org> courier-0.42.2-r3.ebuild,
739
-  courier-0.42.2.ebuild, courier-0.43.1.ebuild, courier-0.43.2.ebuild,
740
-  courier-0.44.0.ebuild, files/gentoo.diff.bz2:
741
-  version bump
742
-  cleaned up the ebuild a little
743
-  some docs weren't getting installed
744
-  fix bug 32269
745
-  applying the sqwebmail patch again
746
-
747
-  29 Oct 2003; Brian Jackson <iggy@gentoo.org> courier-0.43.2.ebuild,
748
-  files/courier-init:
749
-  added esmtpd-ssl to init script, closes bug 32267
750
-
751
-*courier-0.43.2 (28 Sep 2003)
752
-
753
-  28 Sep 2003; <iggy@gentoo.org> courier-0.43.1.ebuild, courier-0.43.2.ebuild:
754
-  version bump
755
-
756
-*courier-0.43.1 (19 Aug 2003)
757
-
758
-  19 Aug 2003; <iggy@gentoo.org> courier-0.43.1.ebuild:
759
-  courier-0.43.1 is out, just copied the 42.2-r3 ebuild, and updated the
760
-  postinst msgs a bit
761
-
762
-  02 Aug 2003; <iggy@gentoo.org> courier-0.42.2-r1.ebuild,
763
-  courier-0.42.2-r2.ebuild, courier-0.42.2-r3.ebuild:
764
-  -r3 -> x86, removed older broken ebuilds (-r1, -r2)
765
-
766
-*courier-0.42.2-r3 (01 Aug 2003)
767
-
768
-  01 Aug 2003; Paul de Vrieze <pauldv@gentoo.org> courier-0.42.2-r3.ebuild:
769
-  Removed the optional dependency on berkeley db, as it will not work with db4
770
-  and a patch to make it work with db3 is nontrivial
771
-
772
-  28 Jul 2003; <iggy@gentoo.org> courier-0.42.2-r2.ebuild:
773
-  temporarily removed expect dep pending clarification of tcltk situation
774
-
775
-  24 Jul 2003; <iggy@gentoo.org> files/courier-init:
776
-  fixed courier init script
777
-
778
-  24 Jul 2003; <iggy@gentoo.org> courier-0.42.2-r2.ebuild:
779
-  added !virtual/imapd to RDEPEND closes bug 25027
780
-
781
-  22 Jul 2003; <iggy@gentoo.org> courier-0.42.2-r2.ebuild:
782
-  a few more cleanups to 0.42.2-r2
783
-
784
-*courier-0.42.2-r2 (22 Jul 2003)
785
-
786
-  22 Jul 2003; <iggy@gentoo.org> courier-0.42.2-r2.ebuild, files/courier-init:
787
-  fixed bug 25028, and switched to single init script
788
-
789
-  03 Jul 2003; ,,, <iggy@gentoo.org> metadata.xml:
790
-  added metadata.xml
791
-
792
-  01 Jul 2003; ,,, <iggy@gentoo.org> courier-0.42.2-r1.ebuild,
793
-  courier-0.42.2.ebuild:
794
-  added --disable-autorenamesent to configure options
795
-
796
-*courier-0.42.2-r1 (14 Jun 2003)
797
-
798
-  01 Jul 2003; Brian Jackson <iggy@gentoo.org> courier-0.42.2-r1.ebuild:
799
-  Whatever the patch that we were using was for seems to be fixed upstream.
800
-  I masked this while I have some other people try to test it out.
801
-
802
-*courier-0.42.2 (14 Jun 2003)
803
-
804
-  23 Jun 2003; Nick Hadaway <raker@gentoo.org> courier-0.42.2.ebuild:
805
-  Added crypt use variable.  Added fax local use variable.
806
-
807
-  14 Jun 2003; Nick Hadaway <raker@gentoo.org> courier-0.42.2.ebuild,
808
-  files/digest-courier-0.42.2, files/courier-0.42.2-gentoo.diff.bz2:
809
-  New version.  Updated dependancies.  Added a fix for permissions
810
-  of /var/run/courier.  Changed unicode option code snippet.
811
-
812
-  15 May 2003; Martin Holzer <mholzer@gentoo.org> courier-0.40.2.ebuild,
813
-  courier-0.41.0.ebuild:
814
-  Adding !virtual/mta to RDEPEND. CLoses #21072.
815
-
816
-*courier-0.41.0 (30 Jan 2003)
817
-
818
-  22 Apr 2003; Graham Forest <vladimir@gentoo.org> courier-0.40.2.ebuild,
819
-  courier-0.41.0.ebuild:
820
-  app-text/aspell -> virtual/aspell-dict
821
-
822
-  30 Jan 2003; Alexandru Hartmann <alex@as-computer.de>, Andreas Erhart <andi@as-computer.de>
823
-  courier-0.41.0.ebuild, files/courier:
824
-  new release. supports make install-configure in post_install(). init scripts changes.
825
-  typo fixes.
826
-
827
-  31 Dec 2002; Nick Hadaway <raker@gentoo.org> courier-0.40.2.ebuild,
828
-  files/digest-courier-0.40.2, files/courier-0.40.2-gentoo.diff.bz2 :
829
-  Version bump.  New unicode functionality.  Added support for the spell
830
-  use variable.
831
-
832
-  06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
833
- 
834
-*courier-0.40.2 (31 Dec 2002)
835
-
836
-  15 Jan 2003; Nick Hadaway <raker@gentoo.org> courier-0.40.2.ebuild :
837
-  Marked stable to coincide with courier-imap-1.6.2 being stable.
838
-
839
-  31 Dec 2002; Nick Hadaway <raker@gentoo.org> courier-0.40.2.ebuild,
840
-  files/digest-courier-0.40.2, files/courier-0.40.2-gentoo.diff.bz2 :
841
-  Version bump.  New unicode functionality.  Added support for the spell
842
-  use variable.
843
-
844
-  06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
845
- 
846
-*courier-0.40.1 (19 Nov 2002)
847
-
848
-  21 Dec 2002; Nick Hadaway <raker@gentoo.org> courier-0.40.1.ebuild :
849
-  Filter -fomit-frame-pointer and -funroll-loops as these flags seem
850
-  to cause problems with maildrop and maildirmake.
851
-
852
-  21 Nov 2002; Nick Hadaway <raker@gentoo.org> courier-0.40.1.ebuild,
853
-  files/password.dist :
854
-  Added a password.dist file so people get instructions on how to
855
-  setup a password for the webadmin. 
856
-
857
-  19 Nov 2002; Daniel Ahlberg <aliz@gentoo.org> :
858
-  Security update.
859
-
860
-*courier-0.40.0.20021026 (29 Oct 2002)
861
-
862
-  06 Nov 2002; Nick Hadaway <raker@gentoo.org> :
863
-  Added ebuild to portage.  Marked unstable.
864
-
865
-  29 Oct 2002; Andreas Erhart <andi@zollhaus.net> / Alexandru Hartmann <alex@nimic.net>
866
-  courier-0.40.0.20021026.ebuild, files/digest-courier-0.40.0.20021026
867
-  sqwebmail finally works !
868
-  new version
869
-  
870
-*courier-0.40.0 (28 Oct 2002)
871
-  28 Oct 2002; Alexandru Hartmann <alex@nimic.net>
872
-  courier-0.40.0.ebuild, files/digest-courier-0.40.0
873
-  sometimes /var/lib/courier/msgs and msgq just disappear after an upgrade.
874
-  this is now fixed.
875
- 
876
-*courier-0.40.0 (26 Oct 2002)
877
-  26 Oct 2002; Andreas Erhart <andi@zollhaus.net>
878
-  courier-0.40.0.ebuild, files/digest-courier-0.40.0
879
-  new version
880
-  
881
-*courier-0.39.3 (12 Aug 2002)
882
-  12 Aug 2002; Andreas Erhart <andi@zollhaus.net>
883
-  courier-0.39.3.ebuild, files/digest-courier-0.39.3
884
-  new version
885
-  
886
-*courier-0.39.2 (03 Aug 2002)
887
-
888
-  06 Aug 2002; Nick Hadaway <raker@gentoo.org>
889
-  courier-0.39.2.ebuild, files/digest-courier-0.39.2 :
890
-  Added --without-authvchkpw to the configure options as some 
891
-  systems will fail to finish configure if vpopmail is not installed.
892
-  Version bump.
893
-
894
-  03 Aug 2002; Andreas Erhart <andi@zollhaus.net> :
895
-  new version, thanks to Sam Varshavchik
896
-  removed 10MB message sizelimit
897
-
898
-*courier-0.39.1 (04 Jul 2002)
899
-
900
-  04 Jul 2002; Grant Goodyear <g2boojum@gentoo.org> ChangeLog  :
901
-  New version, thanks to Alex Hartmann
... ...
@@ -1,34 +0,0 @@
1
-AUX apache-sqwebmail.inc 347 RMD160 9d046149af6138320448fe7bb762b142e0eb9b94 SHA1 4996c33b74a3c9b70886f27948334e3880df8073 SHA256 3a6616dacfd49ab0c89c62d9df5662fc3c2d9e598786d781240bf5e8900afc65
2
-AUX bofh 23 RMD160 995b6b103c29f390c2f0230af95d4c0823423dcb SHA1 f6399bc612af33ca79921961b223cbdf394d9549 SHA256 7e42d61373770a2b14a6fdd8b5f71c598ce4767726f8f7106de00b7c34a59e8c
3
-AUX courier-0.59.0-asneeded.patch 534 RMD160 fe2f28235842220d999dc77ed22857dd99c648a2 SHA1 5ae8a8cefbbd91f2146988c9095ac0e3668c1135 SHA256 802ae0431c9d2b55cdda4602522058874765170d12f4e2fcdd064971f8d31991
4
-AUX courier-init 5182 RMD160 7c5d80d7fdd4e09418461a746f6642f2a276b88b SHA1 beef0a5742fe31388947e945b4646c1dbe5627f1 SHA256 4b1a030bbba852c9c2c8d50e58c43c8e97b5a1ac29a04974a1f097362929e126
5
-AUX courier-init-r1 5252 RMD160 2c770526b4fd2e342c904289573c4f8cb19ca6df SHA1 ac67cd4a9664b1010322b5260f84d017ee06736b SHA256 e74fc291b49dace3ffb3af1844b976255c0c7a34aa0e2d87b5c05f672db9058a
6
-AUX courier-init-r2 4877 RMD160 bc1bf99be4e032a0e52bba71801c89f9a6cd4383 SHA1 a9e8329fb0582fc0cf0341de4e054096587f2790 SHA256 d6a53142751f71f3a6287806259a640fdc1c8807003510d775b0239e8410d02a
7
-AUX dot_courier 26 RMD160 cf20012379abbb63f78e1eb0f9cbaefff6d1048d SHA1 8e5e09e167035d100859b42311b6dda2842f4d67 SHA256 8c585031b4356ca1f887e0823fd9b365fff57a5f9cc32541eccfc1542d5d3763
8
-AUX locallowercase 0 RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
9
-AUX mailer.conf 197 RMD160 4229dfa9cf33b275571538211dad33da5ae84048 SHA1 caf095797e8c526dc5fec59d9d89d51f318cd28a SHA256 5a946a7c4ed42bbddf2c471e2e00898150e4bff33f4af70620cf814ab2f12b47
10
-AUX norewrite.patch 489 RMD160 1d0bacf702126cc4f8b9d7b07bbc6a9357b7b6e9 SHA1 007059af9ab5d89b36004e590b6a21911515f69b SHA256 526f3742fb43af93811e6e4b3210fda1c611b50ce5abdf3a57a25dfe4f5c38e4
11
-AUX password.dist 247 RMD160 eab211be0b1e3dbd6206f79e993b1d314a24efa3 SHA1 2cdd5bcf561f7267be6f18b731813962030af166 SHA256 46f20a84922d108d39a7c26ad3ba8915326549f46cea811e2384f55a589d38e2
12
-AUX set-mime 741 RMD160 8ed45fb4a0aee168a70cdcab6d17cf1606f85cad SHA1 b8834602c7304d42f3179a8dde43dcc57d0f4972 SHA256 bf15af7c181d517a924cb82854cbce46278e6e28ffb338e2159ba89c386dc74f
13
-DIST courier-0.59.0.tar.bz2 7121762 RMD160 580e57fd9d39b62772e07dcdec653379cd21caaf SHA1 6870d2b12f1c93d5ede12f2a5c9c1107a7fb647c SHA256 e488cc920ed970c6d38496dba21359b50c6032ff4f2f91432b5d23db261578ec
14
-DIST courier-0.60.0.tar.bz2 7067430 RMD160 f35a9329e87a948ca9abf6bd7fcc42e4bfe3adac SHA1 13be35f2631830ea2bf66831ea492d83b8247464 SHA256 c13da0a0b76c4a59aa219d037129b8305293d1091143027f2dfd631b9e470e64
15
-DIST courier-0.61.1.tar.bz2 7229642 RMD160 10e2eae71732a8d09ff9550ba035e66669248b7a SHA1 bfc8dd1a1af7f91b24fe715cea93428d4a874efa SHA256 979ff8342f53478c8f14cb79290d1a795433375c8ad18fc5aa950595a9973c90
16
-DIST courier-0.61.2.tar.bz2 7268675 RMD160 a738e534df69fee51aec50a53ce6e5d799f0eecd SHA1 aff9b418c84912832a81295ff4592a76fbe36853 SHA256 c240f2cfb96c0c94811152ea1495f41f72507bdef4e69806771f7203db0d1202
17
-DIST courier-0.62.2.tar.bz2 7132042 RMD160 787b0240a0683350d0d1d7fc5220505d82579af7 SHA1 f7c49a86dc6560e4ab33870c9ac4983aac03949b SHA256 7b129ee12bb0f942354fb09527f706821556a0aa824798cafd004b8f60da2964
18
-DIST courier-0.63.0.tar.bz2 7133009 RMD160 bb47bf049c831756b5352ad1df5f7f4a67a8d52b SHA1 79d8b3b2e4cdcc07cc54308bac689255816ef9e6 SHA256 3a52363605f75f4156105aefa6bd375626f742033fbf09b5592179f274322044
19
-DIST courier-0.64.0.tar.bz2 7136191 RMD160 b38563ec054110068d1b2f6399bdb6539ec272a0 SHA1 921d69f2235be7fd548b9082abdaf0cc18e84223 SHA256 9e72165a6c369d135a128af7e69afa3cfa7be608f8f75049b517a077524aa9cc
20
-DIST courier-0.64.1.tar.bz2 7131375 RMD160 f7a0733ab2c4f8e0743bbe8b0fb4c44a5d75ceec SHA1 c8b81a2deb87ce07c74033fae807a498e4958e52 SHA256 b1cc5d95b256b7467743bcd78536c952febe3bfd7926fcc51742bf105deaadee
21
-DIST courier-0.65.0.tar.bz2 7099997 RMD160 e5fc4742da27b3b97bd2592ad3ecc96618abada3 SHA1 4e5b7e64a35fe886a59621bc87e7f111428f19bc SHA256 ad0327eecbd231379a59e728cd27fd45db0e96faabca8920896ed77327d77604
22
-DIST courier-0.65.2.tar.bz2 7152680 RMD160 6a81f74c85f9e78e6514f840598dde634fe070ce SHA1 784893216ea6c43c91606fa550cfdff13060855d SHA256 496361b8734381ba6128c7b0d5fe4c64ce7d807c01a74aae2cb5be8bb29e5ab2
23
-EBUILD courier-0.59.0.ebuild 10179 RMD160 3def3737d7413cefbe88afe27da30ad6b33dcb83 SHA1 2ecd8f0e11e39940e8a37645844109d82dd901de SHA256 1111b6a3af173424aa5d0dfbe5dda0b30dd9931331b432ab21e2e7cb46422f16
24
-EBUILD courier-0.60.0.ebuild 10055 RMD160 5143f42b0af09701c7cce17866eba91fdd6f2bc9 SHA1 4665f7f8c37ba3c9b07016d8dc2acc0a1bdc34e0 SHA256 ea00c4eb9936a6813d3aeaf63118cbe58b1c2762987a87cdaffbfbea1cedfbe8
25
-EBUILD courier-0.61.1.ebuild 9855 RMD160 ef205ddddb0dacb4cfd88c5e808a424cf63d5dff SHA1 6a906bc83c85dc102c6717a5dfa75923928fc9d6 SHA256 b583b1d643c1ac3a8ecd41621e78071588d0b12f0be90ca86398e0d985dbde07
26
-EBUILD courier-0.61.2.ebuild 9834 RMD160 7fb6fc321c83175045e2ef16331ba129e9c20815 SHA1 fe440f2b0bc60b93ea511778ddafa0707c9be5ba SHA256 d07494ed3c49a2470ed9647d34d8d37c180b7e034ce1139bc0de5ebe1602241d
27
-EBUILD courier-0.62.2.ebuild 9281 RMD160 b7d702f685039f31bf6ccda4e1af34bb65ae2a3d SHA1 f1aa6acef932172e554317bef24b6b2d8c761ace SHA256 d2df747ac27822f83ecbb02943c0ad4ec29a5405ffbff53d4271c7ded89a5fbe
28
-EBUILD courier-0.63.0.ebuild 9287 RMD160 82efd8a8f196eff50fc7396eb2e1b545a176d6d9 SHA1 6f1c2eb574e6a1ffa69f4ad00afb3c5733f5b4fa SHA256 1add8fd5f0f0808ce52d43ab9dc28aab0e794f078cfc05bacb77df0df5b942bd
29
-EBUILD courier-0.64.0.ebuild 9287 RMD160 73c5857869513ca3116976b09c8bf8c1f45602ae SHA1 0fa47f881ce8bb18757a8ef7b832d83320f1f6d1 SHA256 17faaef9c1e66313ad9bcb2e22bb306f3894ff6cc313e1cfd28df672d0259fb9
30
-EBUILD courier-0.64.1.ebuild 9284 RMD160 4d2f3a46e166409333597bb954a658ff3e03aa15 SHA1 c0206dbf94df8b047ea11a5715b3eaffbc6f246a SHA256 c2e9f28298b04dda5b0bd70a2211596fa610c7a564fde35b4ee095fd5bd05495
31
-EBUILD courier-0.65.0.ebuild 9287 RMD160 aaf464b3fbe7b5a21bf0667026048effac904632 SHA1 9e7949c159d601e8fd6bd2ce5cd3a8391b9a6743 SHA256 05977ee3e1b14f05f85d5682532b695c697fd718af96ea305a9a58a8670d6d56
32
-EBUILD courier-0.65.2.ebuild 9287 RMD160 aaf464b3fbe7b5a21bf0667026048effac904632 SHA1 9e7949c159d601e8fd6bd2ce5cd3a8391b9a6743 SHA256 05977ee3e1b14f05f85d5682532b695c697fd718af96ea305a9a58a8670d6d56
33
-MISC ChangeLog 32586 RMD160 26c6bfa91525e1f6af31cfa36d90e091c0d1777c SHA1 b57a54341721b5c7593e4f6eb454f566af463ddc SHA256 77d7b92c85665bc09af9926f34035b3a09ce0529470ae635774130f485ad854e
34
-MISC metadata.xml 687 RMD160 753323e40a9add2b07fd1f138c672ce283d2f255 SHA1 2e8255902a9e0394bd27e13e488e84ba70f05845 SHA256 ea417e66d396e793212529ed20f5570b0c97eb666a5ba52bb3202bbfbc022be1
... ...
@@ -1,322 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.59.0.ebuild,v 1.16 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-WANT_AUTOCONF="latest"
6
-WANT_AUTOMAKE="latest"
7
-
8
-inherit eutils flag-o-matic autotools
9
-
10
-DESCRIPTION="An MTA designed specifically for maildirs"
11
-[ -z "${PV/?.??/}" ] && SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
12
-[ -z "${PV/?.??.?/}" ] && SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
13
-[ -z "${SRC_URI}" ] && SRC_URI="http://www.courier-mta.org/beta/courier/${P%%_pre}.tar.bz2"
14
-HOMEPAGE="http://www.courier-mta.org/"
15
-S="${WORKDIR}/${P%%_pre}"
16
-
17
-SLOT="0"
18
-LICENSE="GPL-2"
19
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
20
-KEYWORDS="alpha amd64 hppa ia64 ppc sparc x86"
21
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
22
-	fam web webmail"
23
-
24
-PROVIDE="virtual/mta
25
-	 virtual/mda
26
-	 virtual/imapd"
27
-
28
-DEPEND="
29
-	>=net-libs/courier-authlib-0.59
30
-	>=dev-libs/openssl-0.9.6
31
-	>=sys-libs/gdbm-1.8.0
32
-	dev-libs/libpcre
33
-	app-misc/mime-types
34
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
35
-	pam? ( virtual/pam )
36
-	mysql? ( virtual/mysql )
37
-	ldap? ( >=net-nds/openldap-1.2.11 )
38
-	postgres? ( dev-db/postgresql-base )
39
-	spell? ( virtual/aspell-dict )
40
-	fam? ( virtual/fam )
41
-	!mailwrapper? ( !virtual/mta )
42
-	!virtual/imapd
43
-	!mail-filter/maildrop"
44
-
45
-RDEPEND="${DEPEND}
46
-	dev-lang/perl
47
-	sys-process/procps"
48
-
49
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
50
-	pam? ( net-mail/mailbase )
51
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
52
-
53
-filter-flags '-fomit-frame-pointer'
54
-
55
-src_unpack() {
56
-	use fam || (
57
-		ewarn "File Alteration Monitor (FAM) is disabled"
58
-		ewarn "courier-imap will fall back to 60 second polls."
59
-		ewarn 'add "fam" to your USE flags to build as usual'
60
-		ebeep 4
61
-		epause 4 )
62
-	unpack ${A}
63
-	cd "${S}"
64
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
65
-
66
-	epatch "${FILESDIR}/${P}-asneeded.patch"
67
-	cd "${S}/gdbmobj/"
68
-	eautoreconf
69
-}
70
-
71
-src_compile() {
72
-	local myconf
73
-	myconf="`use_with ipv6` \
74
-		`use_with ldap ldapaliasd` `use_enable ldap maildropldap`"
75
-
76
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
77
-	use spell || myconf="${myconf} --without-ispell"
78
-
79
-	myconf="${myconf} --enable-mimetypes=/etc/mime.types"
80
-
81
-	myconf="${myconf} $(use_with fam)"
82
-
83
-	einfo "Configuring courier: $(echo ${myconf} | xargs echo)"
84
-
85
-	econf \
86
-		--prefix=/usr \
87
-		--disable-root-check \
88
-		--mandir=/usr/share/man \
89
-		--sysconfdir=/etc/courier \
90
-		--libexecdir=/usr/$(get_libdir)/courier \
91
-		--datadir=/usr/share/courier \
92
-		--sharedstatedir=/var/lib/courier/com \
93
-		--localstatedir=/var/lib/courier \
94
-		--with-piddir=/var/run/courier \
95
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
96
-		--with-mailuser=mail \
97
-		--with-mailgroup=mail \
98
-		--with-paranoid-smtpext \
99
-		--with-db=gdbm \
100
-		--disable-autorenamesent \
101
-		--cache-file="${S}/configuring.cache" \
102
-		--host="${CHOST}" ${myconf} debug=true || die "./configure"
103
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
104
-	emake || die "Compile problem"
105
-}
106
-
107
-etc_courier() {
108
-	# Import existing /etc/courier/file if it exists.
109
-	# Add option only if it was not already set or even commented out
110
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
111
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
112
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
113
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
114
-		echo "${2}" >> "${D}/etc/courier/${file}"
115
-}
116
-
117
-etc_courier_chg() {
118
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
119
-	[ -z "${section}" ] && section="${2}"
120
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
121
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
122
-}
123
-
124
-src_install() {
125
-	local f
126
-	diropts -o mail -g mail
127
-	keepdir /var/run/courier
128
-	keepdir /var/lib/courier/tmp
129
-	keepdir /var/lib/courier/msgs
130
-	make install DESTDIR="${D}" || die "install"
131
-	make install-configure || die "install-configure"
132
-
133
-	# Get rid of files we dont want
134
-	if ! use webmail ; then
135
-		cd "${D}"
136
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
137
-	fi
138
-
139
-	if ! use web ; then
140
-		cd "${D}"
141
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
142
-	fi
143
-
144
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
145
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
146
-	done
147
-
148
-	newinitd "${FILESDIR}/courier-init-r1" "courier"
149
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
150
-
151
-	cd "${D}/etc/courier"
152
-	if use webmail ; then
153
-		insinto /etc/courier
154
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
155
-	fi
156
-
157
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
158
-	if use ldap ; then
159
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
160
-	else
161
-		rm -f ldapaliasrc
162
-	fi
163
-
164
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
165
-		> "${D}/etc/courier/sizelimit"
166
-	etc_courier maildroprc ""
167
-	etc_courier esmtproutes ""
168
-	etc_courier backuprelay ""
169
-	etc_courier locallowercase ""
170
-	etc_courier bofh "opt BOFHBADMIME=accept"
171
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
172
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
173
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
174
-	etc_courier bofh "opt BOFHSPFFROM=all"
175
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
176
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
177
-	etc_courier esmtpd "BOFHBADMIME=accept"
178
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
179
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
180
-
181
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
182
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
183
-
184
-	# Fix for a sandbox violation on subsequential merges
185
-	# - ticho@gentoo.org, 2005-07-10
186
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
187
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
188
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
189
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
190
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
191
-
192
-	cd "${S}"
193
-	cp imap/README README.imap
194
-	use nls && cp unicode/README README.unicode
195
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
196
-	dodoc tcpd/README.couriertls
197
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
198
-
199
-	if use webmail ; then
200
-		insinto /usr/$(get_libdir)/courier/courier
201
-		insopts -m 755 -o mail -g mail
202
-		doins "${S}/courier/webmaild"
203
-	fi
204
-
205
-	if use web ; then
206
-		insinto /etc/courier/webadmin
207
-		insopts -m 400 -o mail -g mail
208
-		doins "${FILESDIR}/password.dist"
209
-	fi
210
-
211
-	# avoid name collisions in /usr/sbin, make webadmin match
212
-	cd "${D}/usr/sbin"
213
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
214
-	if use web ; then
215
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
216
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
217
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
218
-			|| ewarn "failed to fix webadmin"
219
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
220
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
221
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
222
-			|| ewarn "failed to fix webadmin"
223
-	fi
224
-
225
-	# users should be able to send mail. Could be restricted with suictl.
226
-	chmod u+s "${D}/usr/bin/sendmail"
227
-
228
-	if use mailwrapper ; then
229
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
230
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
231
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
232
-
233
-		mv "${D}/usr/share/man/man1/sendmail.1" \
234
-			"${D}/usr/share/man/man1/sendmail-courier.1"
235
-		mv "${D}/usr/share/man/man1/mailq.1" \
236
-			"${D}/usr/share/man/man1/mailq-courier.1"
237
-		mv "${D}/usr/share/man/man1/rmail.1" \
238
-			"${D}/usr/share/man/man1/rmail-courier.1"
239
-
240
-		insopts -m 444 -o mail -g mail
241
-		insinto /etc/mail
242
-		doins "${FILESDIR}/mailer.conf"
243
-	else
244
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
245
-	fi
246
-}
247
-
248
-src_test() {
249
-	addpredict /
250
-	echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
251
-	if hasq userpriv "${FEATURES}" ; then
252
-		if ! emake -j1 check; then
253
-			hasq test "${FEATURES}" && die "Make check failed. See above for details."
254
-			hasq test "${FEATURES}" || eerror "Make check failed. See above for details."
255
-		fi
256
-	else
257
-		hasq test "${FEATURES}" && eerror "Make check needs FEATURES="userpriv" to work."
258
-	fi
259
-	SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
260
-}
261
-
262
-pkg_postinst() {
263
-	use fam && elog "fam daemon is needed for courier-imapd" \
264
-		|| ewarn "courier was built without fam support"
265
-}
266
-
267
-pkg_config() {
268
-	mailhost="$(hostname)"
269
-	export mailhost
270
-
271
-	domainname="$(domainname)"
272
-	if [ "x$domainname" = "x(none)" ] ; then
273
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
274
-	fi
275
-	export domainname
276
-
277
-	if [ "${ROOT}" = "/" ] ; then
278
-		file="${ROOT}/etc/courier/locals"
279
-		if [ ! -f "${file}" ] ; then
280
-			echo "localhost" > "${file}";
281
-			echo "${domainname}" >> "${file}";
282
-		fi
283
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
284
-		if [ ! -f "${file}" ] ; then
285
-			echo "${domainname}" > "${file}"
286
-			/usr/sbin/makeacceptmailfor
287
-		fi
288
-
289
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
290
-		if [ ! -f "${file}" ]
291
-		then
292
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
293
-			do
294
-				i=1
295
-				net=""
296
-				TIFS="${IFS}"
297
-				IFS="."
298
-				for o in "${netmask}"
299
-				do
300
-					if [ "${o}" == "255" ]
301
-					then
302
-						[ "_${net}" == "_" ] || net="${net}."
303
-						t="$(echo "${network}" | cut -d " " -f ${i})"
304
-						net="${net}${t}"
305
-					fi
306
-					i="$((${i} + 1))"
307
-				done
308
-				IFS="${TIFS}"
309
-				echo "doing configuration - relay control for the network ${net} !"
310
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
311
-			done
312
-			/usr/sbin/makesmtpaccess
313
-		fi
314
-	fi
315
-
316
-	echo "creating cert for esmtpd-ssl:"
317
-	/usr/sbin/mkesmtpdcert
318
-	echo "creating cert for imapd-ssl:"
319
-	/usr/sbin/mkpop3dcert
320
-	echo "creating cert for pop3d-ssl:"
321
-	/usr/sbin/mkimapdcert
322
-}
... ...
@@ -1,316 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.60.0.ebuild,v 1.6 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-[ -z "${PV/?.??/}" ] && SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-[ -z "${PV/?.??.?/}" ] && SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
10
-[ -z "${SRC_URI}" ] && SRC_URI="http://www.courier-mta.org/beta/courier/${P%%_pre}.tar.bz2"
11
-HOMEPAGE="http://www.courier-mta.org/"
12
-S="${WORKDIR}/${P%%_pre}"
13
-
14
-SLOT="0"
15
-LICENSE="GPL-2"
16
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
17
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
18
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
19
-	fam web webmail"
20
-
21
-PROVIDE="virtual/mta
22
-	 virtual/mda
23
-	 virtual/imapd"
24
-
25
-DEPEND="
26
-	>=net-libs/courier-authlib-0.61.0
27
-	>=dev-libs/openssl-0.9.6
28
-	>=sys-libs/gdbm-1.8.0
29
-	dev-libs/libpcre
30
-	app-misc/mime-types
31
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
32
-	pam? ( virtual/pam )
33
-	mysql? ( virtual/mysql )
34
-	ldap? ( >=net-nds/openldap-1.2.11 )
35
-	postgres? ( dev-db/postgresql-base )
36
-	spell? ( virtual/aspell-dict )
37
-	fam? ( virtual/fam )
38
-	!mailwrapper? ( !virtual/mta )
39
-	!virtual/imapd
40
-	!mail-filter/maildrop"
41
-
42
-RDEPEND="${DEPEND}
43
-	dev-lang/perl
44
-	sys-process/procps"
45
-
46
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
47
-	pam? ( net-mail/mailbase )
48
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
49
-
50
-filter-flags '-fomit-frame-pointer'
51
-
52
-src_unpack() {
53
-	use fam || (
54
-		ewarn "File Alteration Monitor (FAM) is disabled"
55
-		ewarn "courier-imap will fall back to 60 second polls."
56
-		ewarn 'add "fam" to your USE flags to build as usual'
57
-		ebeep 4
58
-		epause 4 )
59
-	unpack ${A}
60
-	cd "${S}"
61
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
62
-
63
-}
64
-
65
-src_compile() {
66
-	local myconf
67
-	myconf="`use_with ipv6` \
68
-		`use_with ldap ldapaliasd` `use_enable ldap maildropldap`"
69
-
70
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
71
-	use spell || myconf="${myconf} --without-ispell"
72
-
73
-	myconf="${myconf} --enable-mimetypes=/etc/mime.types"
74
-
75
-	myconf="${myconf} $(use_with fam)"
76
-
77
-	einfo "Configuring courier: $(echo ${myconf} | xargs echo)"
78
-
79
-	econf \
80
-		--prefix=/usr \
81
-		--disable-root-check \
82
-		--mandir=/usr/share/man \
83
-		--sysconfdir=/etc/courier \
84
-		--libexecdir=/usr/$(get_libdir)/courier \
85
-		--datadir=/usr/share/courier \
86
-		--sharedstatedir=/var/lib/courier/com \
87
-		--localstatedir=/var/lib/courier \
88
-		--with-piddir=/var/run/courier \
89
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
90
-		--with-mailuser=mail \
91
-		--with-mailgroup=mail \
92
-		--with-paranoid-smtpext \
93
-		--with-db=gdbm \
94
-		--disable-autorenamesent \
95
-		--cache-file="${S}/configuring.cache" \
96
-		--host="${CHOST}" ${myconf} debug=true || die "./configure"
97
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
98
-	emake || die "Compile problem"
99
-}
100
-
101
-etc_courier() {
102
-	# Import existing /etc/courier/file if it exists.
103
-	# Add option only if it was not already set or even commented out
104
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
105
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
106
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
107
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
108
-		echo "${2}" >> "${D}/etc/courier/${file}"
109
-}
110
-
111
-etc_courier_chg() {
112
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
113
-	[ -z "${section}" ] && section="${2}"
114
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
115
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
116
-}
117
-
118
-src_install() {
119
-	local f
120
-	diropts -o mail -g mail
121
-	keepdir /var/run/courier
122
-	keepdir /var/lib/courier/tmp
123
-	keepdir /var/lib/courier/msgs
124
-	make install DESTDIR="${D}" || die "install"
125
-	make install-configure || die "install-configure"
126
-
127
-	# Get rid of files we dont want
128
-	if ! use webmail ; then
129
-		cd "${D}"
130
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
131
-	fi
132
-
133
-	if ! use web ; then
134
-		cd "${D}"
135
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
136
-	fi
137
-
138
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
139
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
140
-	done
141
-
142
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
143
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
144
-
145
-	cd "${D}/etc/courier"
146
-	if use webmail ; then
147
-		insinto /etc/courier
148
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
149
-	fi
150
-
151
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
152
-	if use ldap ; then
153
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
154
-	else
155
-		rm -f ldapaliasrc
156
-	fi
157
-
158
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
159
-		> "${D}/etc/courier/sizelimit"
160
-	etc_courier maildroprc ""
161
-	etc_courier esmtproutes ""
162
-	etc_courier backuprelay ""
163
-	etc_courier locallowercase ""
164
-	etc_courier bofh "opt BOFHBADMIME=accept"
165
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
166
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
167
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
168
-	etc_courier bofh "opt BOFHSPFFROM=all"
169
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
170
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
171
-	etc_courier esmtpd "BOFHBADMIME=accept"
172
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
173
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
174
-
175
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
176
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
177
-
178
-	# Fix for a sandbox violation on subsequential merges
179
-	# - ticho@gentoo.org, 2005-07-10
180
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
181
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
182
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
183
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
184
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
185
-
186
-	cd "${S}"
187
-	cp imap/README README.imap
188
-	use nls && cp unicode/README README.unicode
189
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
190
-	dodoc tcpd/README.couriertls
191
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
192
-
193
-	if use webmail ; then
194
-		insinto /usr/$(get_libdir)/courier/courier
195
-		insopts -m 755 -o mail -g mail
196
-		doins "${S}/courier/webmaild"
197
-	fi
198
-
199
-	if use web ; then
200
-		insinto /etc/courier/webadmin
201
-		insopts -m 400 -o mail -g mail
202
-		doins "${FILESDIR}/password.dist"
203
-	fi
204
-
205
-	# avoid name collisions in /usr/sbin, make webadmin match
206
-	cd "${D}/usr/sbin"
207
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
208
-	if use web ; then
209
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
210
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
211
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
212
-			|| ewarn "failed to fix webadmin"
213
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
214
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
215
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
216
-			|| ewarn "failed to fix webadmin"
217
-	fi
218
-
219
-	# users should be able to send mail. Could be restricted with suictl.
220
-	chmod u+s "${D}/usr/bin/sendmail"
221
-
222
-	if use mailwrapper ; then
223
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
224
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
225
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
226
-
227
-		mv "${D}/usr/share/man/man1/sendmail.1" \
228
-			"${D}/usr/share/man/man1/sendmail-courier.1"
229
-		mv "${D}/usr/share/man/man1/mailq.1" \
230
-			"${D}/usr/share/man/man1/mailq-courier.1"
231
-		mv "${D}/usr/share/man/man1/rmail.1" \
232
-			"${D}/usr/share/man/man1/rmail-courier.1"
233
-
234
-		insopts -m 444 -o mail -g mail
235
-		insinto /etc/mail
236
-		doins "${FILESDIR}/mailer.conf"
237
-	else
238
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
239
-	fi
240
-}
241
-
242
-src_test() {
243
-	addpredict /
244
-	echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
245
-	if hasq userpriv "${FEATURES}" ; then
246
-		if ! emake -j1 check; then
247
-			hasq test "${FEATURES}" && die "Make check failed. See above for details."
248
-			hasq test "${FEATURES}" || eerror "Make check failed. See above for details."
249
-		fi
250
-	else
251
-		hasq test "${FEATURES}" && eerror "Make check needs FEATURES="userpriv" to work."
252
-	fi
253
-	SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
254
-}
255
-
256
-pkg_postinst() {
257
-	use fam && elog "fam daemon is needed for courier-imapd" \
258
-		|| ewarn "courier was built without fam support"
259
-}
260
-
261
-pkg_config() {
262
-	mailhost="$(hostname)"
263
-	export mailhost
264
-
265
-	domainname="$(domainname)"
266
-	if [ "x$domainname" = "x(none)" ] ; then
267
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
268
-	fi
269
-	export domainname
270
-
271
-	if [ "${ROOT}" = "/" ] ; then
272
-		file="${ROOT}/etc/courier/locals"
273
-		if [ ! -f "${file}" ] ; then
274
-			echo "localhost" > "${file}";
275
-			echo "${domainname}" >> "${file}";
276
-		fi
277
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
278
-		if [ ! -f "${file}" ] ; then
279
-			echo "${domainname}" > "${file}"
280
-			/usr/sbin/makeacceptmailfor
281
-		fi
282
-
283
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
284
-		if [ ! -f "${file}" ]
285
-		then
286
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
287
-			do
288
-				i=1
289
-				net=""
290
-				TIFS="${IFS}"
291
-				IFS="."
292
-				for o in "${netmask}"
293
-				do
294
-					if [ "${o}" == "255" ]
295
-					then
296
-						[ "_${net}" == "_" ] || net="${net}."
297
-						t="$(echo "${network}" | cut -d " " -f ${i})"
298
-						net="${net}${t}"
299
-					fi
300
-					i="$((${i} + 1))"
301
-				done
302
-				IFS="${TIFS}"
303
-				echo "doing configuration - relay control for the network ${net} !"
304
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
305
-			done
306
-			/usr/sbin/makesmtpaccess
307
-		fi
308
-	fi
309
-
310
-	echo "creating cert for esmtpd-ssl:"
311
-	/usr/sbin/mkesmtpdcert
312
-	echo "creating cert for imapd-ssl:"
313
-	/usr/sbin/mkpop3dcert
314
-	echo "creating cert for pop3d-ssl:"
315
-	/usr/sbin/mkimapdcert
316
-}
... ...
@@ -1,314 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.61.1.ebuild,v 1.5 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-S="${WORKDIR}/${P}"
11
-
12
-SLOT="0"
13
-LICENSE="GPL-2"
14
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
15
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
16
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
17
-	fam web webmail"
18
-
19
-PROVIDE="virtual/mta
20
-	 virtual/mda
21
-	 virtual/imapd"
22
-
23
-DEPEND="
24
-	>=net-libs/courier-authlib-0.61.0
25
-	>=dev-libs/openssl-0.9.6
26
-	>=sys-libs/gdbm-1.8.0
27
-	dev-libs/libpcre
28
-	app-misc/mime-types
29
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
30
-	pam? ( virtual/pam )
31
-	mysql? ( virtual/mysql )
32
-	ldap? ( >=net-nds/openldap-1.2.11 )
33
-	postgres? ( dev-db/postgresql-base )
34
-	spell? ( virtual/aspell-dict )
35
-	fam? ( virtual/fam )
36
-	!mailwrapper? ( !virtual/mta )
37
-	!virtual/imapd
38
-	!mail-filter/maildrop"
39
-
40
-RDEPEND="${DEPEND}
41
-	dev-lang/perl
42
-	sys-process/procps"
43
-
44
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
45
-	pam? ( net-mail/mailbase )
46
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
47
-
48
-filter-flags '-fomit-frame-pointer'
49
-
50
-src_unpack() {
51
-	use fam || (
52
-		ewarn "File Alteration Monitor (FAM) is disabled"
53
-		ewarn "courier-imap will fall back to 60 second polls."
54
-		ewarn 'add "fam" to your USE flags to build as usual'
55
-		ebeep 4
56
-		epause 4 )
57
-	unpack ${A}
58
-	cd "${S}"
59
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
60
-
61
-}
62
-
63
-src_compile() {
64
-	local myconf
65
-	myconf="`use_with ipv6` \
66
-		`use_with ldap ldapaliasd` `use_enable ldap maildropldap`"
67
-
68
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
69
-	use spell || myconf="${myconf} --without-ispell"
70
-
71
-	myconf="${myconf} --enable-mimetypes=/etc/mime.types"
72
-
73
-	myconf="${myconf} $(use_with fam)"
74
-
75
-	einfo "Configuring courier: $(echo ${myconf} | xargs echo)"
76
-
77
-	econf \
78
-		--prefix=/usr \
79
-		--disable-root-check \
80
-		--mandir=/usr/share/man \
81
-		--sysconfdir=/etc/courier \
82
-		--libexecdir=/usr/$(get_libdir)/courier \
83
-		--datadir=/usr/share/courier \
84
-		--sharedstatedir=/var/lib/courier/com \
85
-		--localstatedir=/var/lib/courier \
86
-		--with-piddir=/var/run/courier \
87
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
88
-		--with-mailuser=mail \
89
-		--with-mailgroup=mail \
90
-		--with-paranoid-smtpext \
91
-		--with-db=gdbm \
92
-		--disable-autorenamesent \
93
-		--cache-file="${S}/configuring.cache" \
94
-		--host="${CHOST}" ${myconf} debug=true || die "./configure"
95
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
96
-	emake || die "Compile problem"
97
-}
98
-
99
-etc_courier() {
100
-	# Import existing /etc/courier/file if it exists.
101
-	# Add option only if it was not already set or even commented out
102
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
103
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
104
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
105
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
106
-		echo "${2}" >> "${D}/etc/courier/${file}"
107
-}
108
-
109
-etc_courier_chg() {
110
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
111
-	[ -z "${section}" ] && section="${2}"
112
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
113
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
114
-}
115
-
116
-src_install() {
117
-	local f
118
-	diropts -o mail -g mail
119
-	keepdir /var/run/courier
120
-	keepdir /var/lib/courier/tmp
121
-	keepdir /var/lib/courier/msgs
122
-	make install DESTDIR="${D}" || die "install"
123
-	make install-configure || die "install-configure"
124
-
125
-	# Get rid of files we dont want
126
-	if ! use webmail ; then
127
-		cd "${D}"
128
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
129
-	fi
130
-
131
-	if ! use web ; then
132
-		cd "${D}"
133
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
134
-	fi
135
-
136
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
137
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
138
-	done
139
-
140
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
141
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
142
-
143
-	cd "${D}/etc/courier"
144
-	if use webmail ; then
145
-		insinto /etc/courier
146
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
147
-	fi
148
-
149
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
150
-	if use ldap ; then
151
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
152
-	else
153
-		rm -f ldapaliasrc
154
-	fi
155
-
156
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
157
-		> "${D}/etc/courier/sizelimit"
158
-	etc_courier maildroprc ""
159
-	etc_courier esmtproutes ""
160
-	etc_courier backuprelay ""
161
-	etc_courier locallowercase ""
162
-	etc_courier bofh "opt BOFHBADMIME=accept"
163
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
164
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
165
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
166
-	etc_courier bofh "opt BOFHSPFFROM=all"
167
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
168
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
169
-	etc_courier esmtpd "BOFHBADMIME=accept"
170
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
171
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
172
-
173
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
174
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
175
-
176
-	# Fix for a sandbox violation on subsequential merges
177
-	# - ticho@gentoo.org, 2005-07-10
178
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
179
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
180
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
181
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
182
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
183
-
184
-	cd "${S}"
185
-	cp imap/README README.imap
186
-	use nls && cp unicode/README README.unicode
187
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
188
-	dodoc tcpd/README.couriertls
189
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
190
-
191
-	if use webmail ; then
192
-		insinto /usr/$(get_libdir)/courier/courier
193
-		insopts -m 755 -o mail -g mail
194
-		doins "${S}/courier/webmaild"
195
-	fi
196
-
197
-	if use web ; then
198
-		insinto /etc/courier/webadmin
199
-		insopts -m 400 -o mail -g mail
200
-		doins "${FILESDIR}/password.dist"
201
-	fi
202
-
203
-	# avoid name collisions in /usr/sbin, make webadmin match
204
-	cd "${D}/usr/sbin"
205
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
206
-	if use web ; then
207
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
208
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
209
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
210
-			|| ewarn "failed to fix webadmin"
211
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
212
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
213
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
214
-			|| ewarn "failed to fix webadmin"
215
-	fi
216
-
217
-	# users should be able to send mail. Could be restricted with suictl.
218
-	chmod u+s "${D}/usr/bin/sendmail"
219
-
220
-	if use mailwrapper ; then
221
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
222
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
223
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
224
-
225
-		mv "${D}/usr/share/man/man1/sendmail.1" \
226
-			"${D}/usr/share/man/man1/sendmail-courier.1"
227
-		mv "${D}/usr/share/man/man1/mailq.1" \
228
-			"${D}/usr/share/man/man1/mailq-courier.1"
229
-		mv "${D}/usr/share/man/man1/rmail.1" \
230
-			"${D}/usr/share/man/man1/rmail-courier.1"
231
-
232
-		insopts -m 444 -o mail -g mail
233
-		insinto /etc/mail
234
-		doins "${FILESDIR}/mailer.conf"
235
-	else
236
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
237
-	fi
238
-}
239
-
240
-src_test() {
241
-	addpredict /
242
-	echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
243
-	if hasq userpriv "${FEATURES}" ; then
244
-		if ! emake -j1 check; then
245
-			hasq test "${FEATURES}" && die "Make check failed. See above for details."
246
-			hasq test "${FEATURES}" || eerror "Make check failed. See above for details."
247
-		fi
248
-	else
249
-		hasq test "${FEATURES}" && eerror "Make check needs FEATURES="userpriv" to work."
250
-	fi
251
-	SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
252
-}
253
-
254
-pkg_postinst() {
255
-	use fam && elog "fam daemon is needed for courier-imapd" \
256
-		|| ewarn "courier was built without fam support"
257
-}
258
-
259
-pkg_config() {
260
-	mailhost="$(hostname)"
261
-	export mailhost
262
-
263
-	domainname="$(domainname)"
264
-	if [ "x$domainname" = "x(none)" ] ; then
265
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
266
-	fi
267
-	export domainname
268
-
269
-	if [ "${ROOT}" = "/" ] ; then
270
-		file="${ROOT}/etc/courier/locals"
271
-		if [ ! -f "${file}" ] ; then
272
-			echo "localhost" > "${file}";
273
-			echo "${domainname}" >> "${file}";
274
-		fi
275
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
276
-		if [ ! -f "${file}" ] ; then
277
-			echo "${domainname}" > "${file}"
278
-			/usr/sbin/makeacceptmailfor
279
-		fi
280
-
281
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
282
-		if [ ! -f "${file}" ]
283
-		then
284
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
285
-			do
286
-				i=1
287
-				net=""
288
-				TIFS="${IFS}"
289
-				IFS="."
290
-				for o in "${netmask}"
291
-				do
292
-					if [ "${o}" == "255" ]
293
-					then
294
-						[ "_${net}" == "_" ] || net="${net}."
295
-						t="$(echo "${network}" | cut -d " " -f ${i})"
296
-						net="${net}${t}"
297
-					fi
298
-					i="$((${i} + 1))"
299
-				done
300
-				IFS="${TIFS}"
301
-				echo "doing configuration - relay control for the network ${net} !"
302
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
303
-			done
304
-			/usr/sbin/makesmtpaccess
305
-		fi
306
-	fi
307
-
308
-	echo "creating cert for esmtpd-ssl:"
309
-	/usr/sbin/mkesmtpdcert
310
-	echo "creating cert for imapd-ssl:"
311
-	/usr/sbin/mkpop3dcert
312
-	echo "creating cert for pop3d-ssl:"
313
-	/usr/sbin/mkimapdcert
314
-}
... ...
@@ -1,311 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.61.2.ebuild,v 1.6 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	use fam || (
48
-		ewarn "File Alteration Monitor (FAM) is disabled"
49
-		ewarn "courier-imap will fall back to 60 second polls."
50
-		ewarn 'add "fam" to your USE flags to build as usual'
51
-		ebeep 4
52
-		epause 4 )
53
-	unpack ${A}
54
-	cd "${S}"
55
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
56
-}
57
-
58
-src_compile() {
59
-	filter-flags '-fomit-frame-pointer'
60
-
61
-	local myconf
62
-	myconf="`use_with ipv6` \
63
-		`use_with ldap ldapaliasd` `use_enable ldap maildropldap`"
64
-
65
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
66
-	use spell || myconf="${myconf} --without-ispell"
67
-
68
-	myconf="${myconf} --enable-mimetypes=/etc/mime.types"
69
-
70
-	myconf="${myconf} $(use_with fam)"
71
-
72
-	einfo "Configuring courier: $(echo ${myconf} | xargs echo)"
73
-
74
-	econf \
75
-		--prefix=/usr \
76
-		--disable-root-check \
77
-		--mandir=/usr/share/man \
78
-		--sysconfdir=/etc/courier \
79
-		--libexecdir=/usr/$(get_libdir)/courier \
80
-		--datadir=/usr/share/courier \
81
-		--sharedstatedir=/var/lib/courier/com \
82
-		--localstatedir=/var/lib/courier \
83
-		--with-piddir=/var/run/courier \
84
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
85
-		--with-mailuser=mail \
86
-		--with-mailgroup=mail \
87
-		--with-paranoid-smtpext \
88
-		--with-db=gdbm \
89
-		--disable-autorenamesent \
90
-		--cache-file="${S}/configuring.cache" \
91
-		--host="${CHOST}" ${myconf} debug=true || die "./configure"
92
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
93
-	emake || die "Compile problem"
94
-}
95
-
96
-etc_courier() {
97
-	# Import existing /etc/courier/file if it exists.
98
-	# Add option only if it was not already set or even commented out
99
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
100
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
101
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
102
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
103
-		echo "${2}" >> "${D}/etc/courier/${file}"
104
-}
105
-
106
-etc_courier_chg() {
107
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
108
-	[ -z "${section}" ] && section="${2}"
109
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
110
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
111
-}
112
-
113
-src_install() {
114
-	local f
115
-	diropts -o mail -g mail
116
-	keepdir /var/run/courier
117
-	keepdir /var/lib/courier/tmp
118
-	keepdir /var/lib/courier/msgs
119
-	make install DESTDIR="${D}" || die "install"
120
-	make install-configure || die "install-configure"
121
-
122
-	# Get rid of files we dont want
123
-	if ! use webmail ; then
124
-		cd "${D}"
125
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
126
-	fi
127
-
128
-	if ! use web ; then
129
-		cd "${D}"
130
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
131
-	fi
132
-
133
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
134
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
135
-	done
136
-
137
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
138
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
139
-
140
-	cd "${D}/etc/courier"
141
-	if use webmail ; then
142
-		insinto /etc/courier
143
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
144
-	fi
145
-
146
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
147
-	if use ldap ; then
148
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
149
-	else
150
-		rm -f ldapaliasrc
151
-	fi
152
-
153
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
154
-		> "${D}/etc/courier/sizelimit"
155
-	etc_courier maildroprc ""
156
-	etc_courier esmtproutes ""
157
-	etc_courier backuprelay ""
158
-	etc_courier locallowercase ""
159
-	etc_courier bofh "opt BOFHBADMIME=accept"
160
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
161
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
162
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
163
-	etc_courier bofh "opt BOFHSPFFROM=all"
164
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
165
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
166
-	etc_courier esmtpd "BOFHBADMIME=accept"
167
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
168
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
169
-
170
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
171
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
172
-
173
-	# Fix for a sandbox violation on subsequential merges
174
-	# - ticho@gentoo.org, 2005-07-10
175
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
176
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
177
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
178
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
179
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
180
-
181
-	cd "${S}"
182
-	cp imap/README README.imap
183
-	use nls && cp unicode/README README.unicode
184
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
185
-	dodoc tcpd/README.couriertls
186
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
187
-
188
-	if use webmail ; then
189
-		insinto /usr/$(get_libdir)/courier/courier
190
-		insopts -m 755 -o mail -g mail
191
-		doins "${S}/courier/webmaild"
192
-	fi
193
-
194
-	if use web ; then
195
-		insinto /etc/courier/webadmin
196
-		insopts -m 400 -o mail -g mail
197
-		doins "${FILESDIR}/password.dist"
198
-	fi
199
-
200
-	# avoid name collisions in /usr/sbin, make webadmin match
201
-	cd "${D}/usr/sbin"
202
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
203
-	if use web ; then
204
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
205
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
206
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
207
-			|| ewarn "failed to fix webadmin"
208
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
209
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
210
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
211
-			|| ewarn "failed to fix webadmin"
212
-	fi
213
-
214
-	# users should be able to send mail. Could be restricted with suictl.
215
-	chmod u+s "${D}/usr/bin/sendmail"
216
-
217
-	if use mailwrapper ; then
218
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
219
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
220
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
221
-
222
-		mv "${D}/usr/share/man/man1/sendmail.1" \
223
-			"${D}/usr/share/man/man1/sendmail-courier.1"
224
-		mv "${D}/usr/share/man/man1/mailq.1" \
225
-			"${D}/usr/share/man/man1/mailq-courier.1"
226
-		mv "${D}/usr/share/man/man1/rmail.1" \
227
-			"${D}/usr/share/man/man1/rmail-courier.1"
228
-
229
-		insopts -m 444 -o mail -g mail
230
-		insinto /etc/mail
231
-		doins "${FILESDIR}/mailer.conf"
232
-	else
233
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
234
-	fi
235
-}
236
-
237
-src_test() {
238
-	addpredict /
239
-	echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
240
-	if hasq userpriv "${FEATURES}" ; then
241
-		if ! emake -j1 check; then
242
-			hasq test "${FEATURES}" && die "Make check failed. See above for details."
243
-			hasq test "${FEATURES}" || eerror "Make check failed. See above for details."
244
-		fi
245
-	else
246
-		hasq test "${FEATURES}" && eerror "Make check needs FEATURES="userpriv" to work."
247
-	fi
248
-	SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
249
-}
250
-
251
-pkg_postinst() {
252
-	use fam && elog "fam daemon is needed for courier-imapd" \
253
-		|| ewarn "courier was built without fam support"
254
-}
255
-
256
-pkg_config() {
257
-	mailhost="$(hostname)"
258
-	export mailhost
259
-
260
-	domainname="$(domainname)"
261
-	if [ "x$domainname" = "x(none)" ] ; then
262
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
263
-	fi
264
-	export domainname
265
-
266
-	if [ "${ROOT}" = "/" ] ; then
267
-		file="${ROOT}/etc/courier/locals"
268
-		if [ ! -f "${file}" ] ; then
269
-			echo "localhost" > "${file}";
270
-			echo "${domainname}" >> "${file}";
271
-		fi
272
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
273
-		if [ ! -f "${file}" ] ; then
274
-			echo "${domainname}" > "${file}"
275
-			/usr/sbin/makeacceptmailfor
276
-		fi
277
-
278
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
279
-		if [ ! -f "${file}" ]
280
-		then
281
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
282
-			do
283
-				i=1
284
-				net=""
285
-				TIFS="${IFS}"
286
-				IFS="."
287
-				for o in "${netmask}"
288
-				do
289
-					if [ "${o}" == "255" ]
290
-					then
291
-						[ "_${net}" == "_" ] || net="${net}."
292
-						t="$(echo "${network}" | cut -d " " -f ${i})"
293
-						net="${net}${t}"
294
-					fi
295
-					i="$((${i} + 1))"
296
-				done
297
-				IFS="${TIFS}"
298
-				echo "doing configuration - relay control for the network ${net} !"
299
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
300
-			done
301
-			/usr/sbin/makesmtpaccess
302
-		fi
303
-	fi
304
-
305
-	echo "creating cert for esmtpd-ssl:"
306
-	/usr/sbin/mkesmtpdcert
307
-	echo "creating cert for imapd-ssl:"
308
-	/usr/sbin/mkpop3dcert
309
-	echo "creating cert for pop3d-ssl:"
310
-	/usr/sbin/mkimapdcert
311
-}
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.62.2.ebuild,v 1.7 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="alpha amd64 ~hppa ia64 ppc sparc x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	unpack ${A}
48
-	cd "${S}"
49
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
50
-}
51
-
52
-src_compile() {
53
-	filter-flags '-fomit-frame-pointer'
54
-
55
-	local myconf
56
-	myconf=""
57
-
58
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
59
-
60
-	econf ${myconf} \
61
-		$(use_with fam) \
62
-		$(use_with ipv6) \
63
-		$(use_with spell ispell) \
64
-		$(use_with ldap ldapaliasd) \
65
-		$(use_enable ldap maildroldap) \
66
-		--enable-mimetypes=/etc/mime.types \
67
-		--prefix=/usr \
68
-		--disable-root-check \
69
-		--mandir=/usr/share/man \
70
-		--sysconfdir=/etc/courier \
71
-		--libexecdir=/usr/$(get_libdir)/courier \
72
-		--datadir=/usr/share/courier \
73
-		--sharedstatedir=/var/lib/courier/com \
74
-		--localstatedir=/var/lib/courier \
75
-		--with-piddir=/var/run/courier \
76
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
77
-		--with-mailuser=mail \
78
-		--with-mailgroup=mail \
79
-		--with-paranoid-smtpext \
80
-		--with-db=gdbm \
81
-		--disable-autorenamesent \
82
-		--cache-file="${S}/configuring.cache" \
83
-		--host="${CHOST}" debug=true || die "./configure"
84
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
85
-	emake || die "Compile problem"
86
-}
87
-
88
-etc_courier() {
89
-	# Import existing /etc/courier/file if it exists.
90
-	# Add option only if it was not already set or even commented out
91
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
92
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
93
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
94
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
95
-		echo "${2}" >> "${D}/etc/courier/${file}"
96
-}
97
-
98
-etc_courier_chg() {
99
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
100
-	[ -z "${section}" ] && section="${2}"
101
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
102
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
103
-}
104
-
105
-src_install() {
106
-	local f
107
-	diropts -o mail -g mail
108
-	keepdir /var/run/courier
109
-	keepdir /var/lib/courier/tmp
110
-	keepdir /var/lib/courier/msgs
111
-	make install DESTDIR="${D}" || die "install"
112
-	make install-configure || die "install-configure"
113
-
114
-	# Get rid of files we dont want
115
-	if ! use webmail ; then
116
-		cd "${D}"
117
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
118
-	fi
119
-
120
-	if ! use web ; then
121
-		cd "${D}"
122
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
123
-	fi
124
-
125
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
126
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
127
-	done
128
-
129
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
130
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
131
-
132
-	cd "${D}/etc/courier"
133
-	if use webmail ; then
134
-		insinto /etc/courier
135
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
136
-	fi
137
-
138
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
139
-	if use ldap ; then
140
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
141
-	else
142
-		rm -f ldapaliasrc
143
-	fi
144
-
145
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
146
-		> "${D}/etc/courier/sizelimit"
147
-	etc_courier maildroprc ""
148
-	etc_courier esmtproutes ""
149
-	etc_courier backuprelay ""
150
-	etc_courier locallowercase ""
151
-	etc_courier bofh "opt BOFHBADMIME=accept"
152
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
153
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
154
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
155
-	etc_courier bofh "opt BOFHSPFFROM=all"
156
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
157
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
158
-	etc_courier esmtpd "BOFHBADMIME=accept"
159
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
160
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
161
-
162
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
163
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
164
-
165
-	# Fix for a sandbox violation on subsequential merges
166
-	# - ticho@gentoo.org, 2005-07-10
167
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
168
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
169
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
170
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
171
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
172
-
173
-	cd "${S}"
174
-	cp imap/README README.imap
175
-	use nls && cp unicode/README README.unicode
176
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
177
-	dodoc tcpd/README.couriertls
178
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
179
-
180
-	if use webmail ; then
181
-		insinto /usr/$(get_libdir)/courier/courier
182
-		insopts -m 755 -o mail -g mail
183
-		doins "${S}/courier/webmaild"
184
-	fi
185
-
186
-	if use web ; then
187
-		insinto /etc/courier/webadmin
188
-		insopts -m 400 -o mail -g mail
189
-		doins "${FILESDIR}/password.dist"
190
-	fi
191
-
192
-	# avoid name collisions in /usr/sbin, make webadmin match
193
-	cd "${D}/usr/sbin"
194
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
195
-	if use web ; then
196
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
197
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
198
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
199
-			|| ewarn "failed to fix webadmin"
200
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
201
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
202
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
203
-			|| ewarn "failed to fix webadmin"
204
-	fi
205
-
206
-	# users should be able to send mail. Could be restricted with suictl.
207
-	chmod u+s "${D}/usr/bin/sendmail"
208
-
209
-	if use mailwrapper ; then
210
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
211
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
212
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
213
-
214
-		mv "${D}/usr/share/man/man1/sendmail.1" \
215
-			"${D}/usr/share/man/man1/sendmail-courier.1"
216
-		mv "${D}/usr/share/man/man1/mailq.1" \
217
-			"${D}/usr/share/man/man1/mailq-courier.1"
218
-		mv "${D}/usr/share/man/man1/rmail.1" \
219
-			"${D}/usr/share/man/man1/rmail-courier.1"
220
-
221
-		insopts -m 444 -o mail -g mail
222
-		insinto /etc/mail
223
-		doins "${FILESDIR}/mailer.conf"
224
-	else
225
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
226
-	fi
227
-}
228
-
229
-src_test() {
230
-	if [ `whoami` != 'root' ]; then
231
-		emake -j1 check || die "Make check failed."
232
-	else
233
-		einfo "make check skipped, can't run as root."
234
-		einfo "You can enable it with FEATURES=\"userpriv\""
235
-	fi
236
-}
237
-
238
-pkg_postinst() {
239
-	use fam && elog "fam daemon is needed for courier-imapd" \
240
-		|| ewarn "courier was built without fam support"
241
-}
242
-
243
-pkg_config() {
244
-	mailhost="$(hostname)"
245
-	export mailhost
246
-
247
-	domainname="$(domainname)"
248
-	if [ "x$domainname" = "x(none)" ] ; then
249
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
250
-	fi
251
-	export domainname
252
-
253
-	if [ "${ROOT}" = "/" ] ; then
254
-		file="${ROOT}/etc/courier/locals"
255
-		if [ ! -f "${file}" ] ; then
256
-			echo "localhost" > "${file}";
257
-			echo "${domainname}" >> "${file}";
258
-		fi
259
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
260
-		if [ ! -f "${file}" ] ; then
261
-			echo "${domainname}" > "${file}"
262
-			/usr/sbin/makeacceptmailfor
263
-		fi
264
-
265
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
266
-		if [ ! -f "${file}" ]
267
-		then
268
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
269
-			do
270
-				i=1
271
-				net=""
272
-				TIFS="${IFS}"
273
-				IFS="."
274
-				for o in "${netmask}"
275
-				do
276
-					if [ "${o}" == "255" ]
277
-					then
278
-						[ "_${net}" == "_" ] || net="${net}."
279
-						t="$(echo "${network}" | cut -d " " -f ${i})"
280
-						net="${net}${t}"
281
-					fi
282
-					i="$((${i} + 1))"
283
-				done
284
-				IFS="${TIFS}"
285
-				echo "doing configuration - relay control for the network ${net} !"
286
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
287
-			done
288
-			/usr/sbin/makesmtpaccess
289
-		fi
290
-	fi
291
-
292
-	echo "creating cert for esmtpd-ssl:"
293
-	/usr/sbin/mkesmtpdcert
294
-	echo "creating cert for imapd-ssl:"
295
-	/usr/sbin/mkpop3dcert
296
-	echo "creating cert for pop3d-ssl:"
297
-	/usr/sbin/mkimapdcert
298
-}
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.63.0.ebuild,v 1.4 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	unpack ${A}
48
-	cd "${S}"
49
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
50
-}
51
-
52
-src_compile() {
53
-	filter-flags '-fomit-frame-pointer'
54
-
55
-	local myconf
56
-	myconf=""
57
-
58
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
59
-
60
-	econf ${myconf} \
61
-		$(use_with fam) \
62
-		$(use_with ipv6) \
63
-		$(use_with spell ispell) \
64
-		$(use_with ldap ldapaliasd) \
65
-		$(use_enable ldap maildroldap) \
66
-		--enable-mimetypes=/etc/mime.types \
67
-		--prefix=/usr \
68
-		--disable-root-check \
69
-		--mandir=/usr/share/man \
70
-		--sysconfdir=/etc/courier \
71
-		--libexecdir=/usr/$(get_libdir)/courier \
72
-		--datadir=/usr/share/courier \
73
-		--sharedstatedir=/var/lib/courier/com \
74
-		--localstatedir=/var/lib/courier \
75
-		--with-piddir=/var/run/courier \
76
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
77
-		--with-mailuser=mail \
78
-		--with-mailgroup=mail \
79
-		--with-paranoid-smtpext \
80
-		--with-db=gdbm \
81
-		--disable-autorenamesent \
82
-		--cache-file="${S}/configuring.cache" \
83
-		--host="${CHOST}" debug=true || die "./configure"
84
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
85
-	emake || die "Compile problem"
86
-}
87
-
88
-etc_courier() {
89
-	# Import existing /etc/courier/file if it exists.
90
-	# Add option only if it was not already set or even commented out
91
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
92
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
93
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
94
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
95
-		echo "${2}" >> "${D}/etc/courier/${file}"
96
-}
97
-
98
-etc_courier_chg() {
99
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
100
-	[ -z "${section}" ] && section="${2}"
101
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
102
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
103
-}
104
-
105
-src_install() {
106
-	local f
107
-	diropts -o mail -g mail
108
-	keepdir /var/run/courier
109
-	keepdir /var/lib/courier/tmp
110
-	keepdir /var/lib/courier/msgs
111
-	make install DESTDIR="${D}" || die "install"
112
-	make install-configure || die "install-configure"
113
-
114
-	# Get rid of files we dont want
115
-	if ! use webmail ; then
116
-		cd "${D}"
117
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
118
-	fi
119
-
120
-	if ! use web ; then
121
-		cd "${D}"
122
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
123
-	fi
124
-
125
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
126
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
127
-	done
128
-
129
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
130
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
131
-
132
-	cd "${D}/etc/courier"
133
-	if use webmail ; then
134
-		insinto /etc/courier
135
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
136
-	fi
137
-
138
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
139
-	if use ldap ; then
140
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
141
-	else
142
-		rm -f ldapaliasrc
143
-	fi
144
-
145
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
146
-		> "${D}/etc/courier/sizelimit"
147
-	etc_courier maildroprc ""
148
-	etc_courier esmtproutes ""
149
-	etc_courier backuprelay ""
150
-	etc_courier locallowercase ""
151
-	etc_courier bofh "opt BOFHBADMIME=accept"
152
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
153
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
154
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
155
-	etc_courier bofh "opt BOFHSPFFROM=all"
156
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
157
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
158
-	etc_courier esmtpd "BOFHBADMIME=accept"
159
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
160
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
161
-
162
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
163
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
164
-
165
-	# Fix for a sandbox violation on subsequential merges
166
-	# - ticho@gentoo.org, 2005-07-10
167
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
168
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
169
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
170
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
171
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
172
-
173
-	cd "${S}"
174
-	cp imap/README README.imap
175
-	use nls && cp unicode/README README.unicode
176
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
177
-	dodoc tcpd/README.couriertls
178
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
179
-
180
-	if use webmail ; then
181
-		insinto /usr/$(get_libdir)/courier/courier
182
-		insopts -m 755 -o mail -g mail
183
-		doins "${S}/courier/webmaild"
184
-	fi
185
-
186
-	if use web ; then
187
-		insinto /etc/courier/webadmin
188
-		insopts -m 400 -o mail -g mail
189
-		doins "${FILESDIR}/password.dist"
190
-	fi
191
-
192
-	# avoid name collisions in /usr/sbin, make webadmin match
193
-	cd "${D}/usr/sbin"
194
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
195
-	if use web ; then
196
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
197
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
198
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
199
-			|| ewarn "failed to fix webadmin"
200
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
201
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
202
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
203
-			|| ewarn "failed to fix webadmin"
204
-	fi
205
-
206
-	# users should be able to send mail. Could be restricted with suictl.
207
-	chmod u+s "${D}/usr/bin/sendmail"
208
-
209
-	if use mailwrapper ; then
210
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
211
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
212
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
213
-
214
-		mv "${D}/usr/share/man/man1/sendmail.1" \
215
-			"${D}/usr/share/man/man1/sendmail-courier.1"
216
-		mv "${D}/usr/share/man/man1/mailq.1" \
217
-			"${D}/usr/share/man/man1/mailq-courier.1"
218
-		mv "${D}/usr/share/man/man1/rmail.1" \
219
-			"${D}/usr/share/man/man1/rmail-courier.1"
220
-
221
-		insopts -m 444 -o mail -g mail
222
-		insinto /etc/mail
223
-		doins "${FILESDIR}/mailer.conf"
224
-	else
225
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
226
-	fi
227
-}
228
-
229
-src_test() {
230
-	if [ `whoami` != 'root' ]; then
231
-		emake -j1 check || die "Make check failed."
232
-	else
233
-		einfo "make check skipped, can't run as root."
234
-		einfo "You can enable it with FEATURES=\"userpriv\""
235
-	fi
236
-}
237
-
238
-pkg_postinst() {
239
-	use fam && elog "fam daemon is needed for courier-imapd" \
240
-		|| ewarn "courier was built without fam support"
241
-}
242
-
243
-pkg_config() {
244
-	mailhost="$(hostname)"
245
-	export mailhost
246
-
247
-	domainname="$(domainname)"
248
-	if [ "x$domainname" = "x(none)" ] ; then
249
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
250
-	fi
251
-	export domainname
252
-
253
-	if [ "${ROOT}" = "/" ] ; then
254
-		file="${ROOT}/etc/courier/locals"
255
-		if [ ! -f "${file}" ] ; then
256
-			echo "localhost" > "${file}";
257
-			echo "${domainname}" >> "${file}";
258
-		fi
259
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
260
-		if [ ! -f "${file}" ] ; then
261
-			echo "${domainname}" > "${file}"
262
-			/usr/sbin/makeacceptmailfor
263
-		fi
264
-
265
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
266
-		if [ ! -f "${file}" ]
267
-		then
268
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
269
-			do
270
-				i=1
271
-				net=""
272
-				TIFS="${IFS}"
273
-				IFS="."
274
-				for o in "${netmask}"
275
-				do
276
-					if [ "${o}" == "255" ]
277
-					then
278
-						[ "_${net}" == "_" ] || net="${net}."
279
-						t="$(echo "${network}" | cut -d " " -f ${i})"
280
-						net="${net}${t}"
281
-					fi
282
-					i="$((${i} + 1))"
283
-				done
284
-				IFS="${TIFS}"
285
-				echo "doing configuration - relay control for the network ${net} !"
286
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
287
-			done
288
-			/usr/sbin/makesmtpaccess
289
-		fi
290
-	fi
291
-
292
-	echo "creating cert for esmtpd-ssl:"
293
-	/usr/sbin/mkesmtpdcert
294
-	echo "creating cert for imapd-ssl:"
295
-	/usr/sbin/mkpop3dcert
296
-	echo "creating cert for pop3d-ssl:"
297
-	/usr/sbin/mkimapdcert
298
-}
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.64.0.ebuild,v 1.3 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	unpack ${A}
48
-	cd "${S}"
49
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
50
-}
51
-
52
-src_compile() {
53
-	filter-flags '-fomit-frame-pointer'
54
-
55
-	local myconf
56
-	myconf=""
57
-
58
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
59
-
60
-	econf ${myconf} \
61
-		$(use_with fam) \
62
-		$(use_with ipv6) \
63
-		$(use_with spell ispell) \
64
-		$(use_with ldap ldapaliasd) \
65
-		$(use_enable ldap maildroldap) \
66
-		--enable-mimetypes=/etc/mime.types \
67
-		--prefix=/usr \
68
-		--disable-root-check \
69
-		--mandir=/usr/share/man \
70
-		--sysconfdir=/etc/courier \
71
-		--libexecdir=/usr/$(get_libdir)/courier \
72
-		--datadir=/usr/share/courier \
73
-		--sharedstatedir=/var/lib/courier/com \
74
-		--localstatedir=/var/lib/courier \
75
-		--with-piddir=/var/run/courier \
76
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
77
-		--with-mailuser=mail \
78
-		--with-mailgroup=mail \
79
-		--with-paranoid-smtpext \
80
-		--with-db=gdbm \
81
-		--disable-autorenamesent \
82
-		--cache-file="${S}/configuring.cache" \
83
-		--host="${CHOST}" debug=true || die "./configure"
84
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
85
-	emake || die "Compile problem"
86
-}
87
-
88
-etc_courier() {
89
-	# Import existing /etc/courier/file if it exists.
90
-	# Add option only if it was not already set or even commented out
91
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
92
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
93
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
94
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
95
-		echo "${2}" >> "${D}/etc/courier/${file}"
96
-}
97
-
98
-etc_courier_chg() {
99
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
100
-	[ -z "${section}" ] && section="${2}"
101
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
102
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
103
-}
104
-
105
-src_install() {
106
-	local f
107
-	diropts -o mail -g mail
108
-	keepdir /var/run/courier
109
-	keepdir /var/lib/courier/tmp
110
-	keepdir /var/lib/courier/msgs
111
-	make install DESTDIR="${D}" || die "install"
112
-	make install-configure || die "install-configure"
113
-
114
-	# Get rid of files we dont want
115
-	if ! use webmail ; then
116
-		cd "${D}"
117
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
118
-	fi
119
-
120
-	if ! use web ; then
121
-		cd "${D}"
122
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
123
-	fi
124
-
125
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
126
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
127
-	done
128
-
129
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
130
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
131
-
132
-	cd "${D}/etc/courier"
133
-	if use webmail ; then
134
-		insinto /etc/courier
135
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
136
-	fi
137
-
138
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
139
-	if use ldap ; then
140
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
141
-	else
142
-		rm -f ldapaliasrc
143
-	fi
144
-
145
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
146
-		> "${D}/etc/courier/sizelimit"
147
-	etc_courier maildroprc ""
148
-	etc_courier esmtproutes ""
149
-	etc_courier backuprelay ""
150
-	etc_courier locallowercase ""
151
-	etc_courier bofh "opt BOFHBADMIME=accept"
152
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
153
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
154
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
155
-	etc_courier bofh "opt BOFHSPFFROM=all"
156
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
157
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
158
-	etc_courier esmtpd "BOFHBADMIME=accept"
159
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
160
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
161
-
162
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
163
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
164
-
165
-	# Fix for a sandbox violation on subsequential merges
166
-	# - ticho@gentoo.org, 2005-07-10
167
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
168
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
169
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
170
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
171
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
172
-
173
-	cd "${S}"
174
-	cp imap/README README.imap
175
-	use nls && cp unicode/README README.unicode
176
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
177
-	dodoc tcpd/README.couriertls
178
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
179
-
180
-	if use webmail ; then
181
-		insinto /usr/$(get_libdir)/courier/courier
182
-		insopts -m 755 -o mail -g mail
183
-		doins "${S}/courier/webmaild"
184
-	fi
185
-
186
-	if use web ; then
187
-		insinto /etc/courier/webadmin
188
-		insopts -m 400 -o mail -g mail
189
-		doins "${FILESDIR}/password.dist"
190
-	fi
191
-
192
-	# avoid name collisions in /usr/sbin, make webadmin match
193
-	cd "${D}/usr/sbin"
194
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
195
-	if use web ; then
196
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
197
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
198
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
199
-			|| ewarn "failed to fix webadmin"
200
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
201
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
202
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
203
-			|| ewarn "failed to fix webadmin"
204
-	fi
205
-
206
-	# users should be able to send mail. Could be restricted with suictl.
207
-	chmod u+s "${D}/usr/bin/sendmail"
208
-
209
-	if use mailwrapper ; then
210
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
211
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
212
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
213
-
214
-		mv "${D}/usr/share/man/man1/sendmail.1" \
215
-			"${D}/usr/share/man/man1/sendmail-courier.1"
216
-		mv "${D}/usr/share/man/man1/mailq.1" \
217
-			"${D}/usr/share/man/man1/mailq-courier.1"
218
-		mv "${D}/usr/share/man/man1/rmail.1" \
219
-			"${D}/usr/share/man/man1/rmail-courier.1"
220
-
221
-		insopts -m 444 -o mail -g mail
222
-		insinto /etc/mail
223
-		doins "${FILESDIR}/mailer.conf"
224
-	else
225
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
226
-	fi
227
-}
228
-
229
-src_test() {
230
-	if [ `whoami` != 'root' ]; then
231
-		emake -j1 check || die "Make check failed."
232
-	else
233
-		einfo "make check skipped, can't run as root."
234
-		einfo "You can enable it with FEATURES=\"userpriv\""
235
-	fi
236
-}
237
-
238
-pkg_postinst() {
239
-	use fam && elog "fam daemon is needed for courier-imapd" \
240
-		|| ewarn "courier was built without fam support"
241
-}
242
-
243
-pkg_config() {
244
-	mailhost="$(hostname)"
245
-	export mailhost
246
-
247
-	domainname="$(domainname)"
248
-	if [ "x$domainname" = "x(none)" ] ; then
249
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
250
-	fi
251
-	export domainname
252
-
253
-	if [ "${ROOT}" = "/" ] ; then
254
-		file="${ROOT}/etc/courier/locals"
255
-		if [ ! -f "${file}" ] ; then
256
-			echo "localhost" > "${file}";
257
-			echo "${domainname}" >> "${file}";
258
-		fi
259
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
260
-		if [ ! -f "${file}" ] ; then
261
-			echo "${domainname}" > "${file}"
262
-			/usr/sbin/makeacceptmailfor
263
-		fi
264
-
265
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
266
-		if [ ! -f "${file}" ]
267
-		then
268
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
269
-			do
270
-				i=1
271
-				net=""
272
-				TIFS="${IFS}"
273
-				IFS="."
274
-				for o in "${netmask}"
275
-				do
276
-					if [ "${o}" == "255" ]
277
-					then
278
-						[ "_${net}" == "_" ] || net="${net}."
279
-						t="$(echo "${network}" | cut -d " " -f ${i})"
280
-						net="${net}${t}"
281
-					fi
282
-					i="$((${i} + 1))"
283
-				done
284
-				IFS="${TIFS}"
285
-				echo "doing configuration - relay control for the network ${net} !"
286
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
287
-			done
288
-			/usr/sbin/makesmtpaccess
289
-		fi
290
-	fi
291
-
292
-	echo "creating cert for esmtpd-ssl:"
293
-	/usr/sbin/mkesmtpdcert
294
-	echo "creating cert for imapd-ssl:"
295
-	/usr/sbin/mkpop3dcert
296
-	echo "creating cert for pop3d-ssl:"
297
-	/usr/sbin/mkimapdcert
298
-}
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.64.1.ebuild,v 1.6 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="~alpha ~amd64 hppa ~ia64 ppc ~sparc x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	unpack ${A}
48
-	cd "${S}"
49
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
50
-}
51
-
52
-src_compile() {
53
-	filter-flags '-fomit-frame-pointer'
54
-
55
-	local myconf
56
-	myconf=""
57
-
58
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
59
-
60
-	econf ${myconf} \
61
-		$(use_with fam) \
62
-		$(use_with ipv6) \
63
-		$(use_with spell ispell) \
64
-		$(use_with ldap ldapaliasd) \
65
-		$(use_enable ldap maildroldap) \
66
-		--enable-mimetypes=/etc/mime.types \
67
-		--prefix=/usr \
68
-		--disable-root-check \
69
-		--mandir=/usr/share/man \
70
-		--sysconfdir=/etc/courier \
71
-		--libexecdir=/usr/$(get_libdir)/courier \
72
-		--datadir=/usr/share/courier \
73
-		--sharedstatedir=/var/lib/courier/com \
74
-		--localstatedir=/var/lib/courier \
75
-		--with-piddir=/var/run/courier \
76
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
77
-		--with-mailuser=mail \
78
-		--with-mailgroup=mail \
79
-		--with-paranoid-smtpext \
80
-		--with-db=gdbm \
81
-		--disable-autorenamesent \
82
-		--cache-file="${S}/configuring.cache" \
83
-		--host="${CHOST}" debug=true || die "./configure"
84
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
85
-	emake || die "Compile problem"
86
-}
87
-
88
-etc_courier() {
89
-	# Import existing /etc/courier/file if it exists.
90
-	# Add option only if it was not already set or even commented out
91
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
92
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
93
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
94
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
95
-		echo "${2}" >> "${D}/etc/courier/${file}"
96
-}
97
-
98
-etc_courier_chg() {
99
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
100
-	[ -z "${section}" ] && section="${2}"
101
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
102
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
103
-}
104
-
105
-src_install() {
106
-	local f
107
-	diropts -o mail -g mail
108
-	keepdir /var/run/courier
109
-	keepdir /var/lib/courier/tmp
110
-	keepdir /var/lib/courier/msgs
111
-	make install DESTDIR="${D}" || die "install"
112
-	make install-configure || die "install-configure"
113
-
114
-	# Get rid of files we dont want
115
-	if ! use webmail ; then
116
-		cd "${D}"
117
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
118
-	fi
119
-
120
-	if ! use web ; then
121
-		cd "${D}"
122
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
123
-	fi
124
-
125
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
126
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
127
-	done
128
-
129
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
130
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
131
-
132
-	cd "${D}/etc/courier"
133
-	if use webmail ; then
134
-		insinto /etc/courier
135
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
136
-	fi
137
-
138
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
139
-	if use ldap ; then
140
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
141
-	else
142
-		rm -f ldapaliasrc
143
-	fi
144
-
145
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
146
-		> "${D}/etc/courier/sizelimit"
147
-	etc_courier maildroprc ""
148
-	etc_courier esmtproutes ""
149
-	etc_courier backuprelay ""
150
-	etc_courier locallowercase ""
151
-	etc_courier bofh "opt BOFHBADMIME=accept"
152
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
153
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
154
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
155
-	etc_courier bofh "opt BOFHSPFFROM=all"
156
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
157
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
158
-	etc_courier esmtpd "BOFHBADMIME=accept"
159
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
160
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
161
-
162
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
163
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
164
-
165
-	# Fix for a sandbox violation on subsequential merges
166
-	# - ticho@gentoo.org, 2005-07-10
167
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
168
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
169
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
170
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
171
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
172
-
173
-	cd "${S}"
174
-	cp imap/README README.imap
175
-	use nls && cp unicode/README README.unicode
176
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
177
-	dodoc tcpd/README.couriertls
178
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
179
-
180
-	if use webmail ; then
181
-		insinto /usr/$(get_libdir)/courier/courier
182
-		insopts -m 755 -o mail -g mail
183
-		doins "${S}/courier/webmaild"
184
-	fi
185
-
186
-	if use web ; then
187
-		insinto /etc/courier/webadmin
188
-		insopts -m 400 -o mail -g mail
189
-		doins "${FILESDIR}/password.dist"
190
-	fi
191
-
192
-	# avoid name collisions in /usr/sbin, make webadmin match
193
-	cd "${D}/usr/sbin"
194
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
195
-	if use web ; then
196
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
197
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
198
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
199
-			|| ewarn "failed to fix webadmin"
200
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
201
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
202
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
203
-			|| ewarn "failed to fix webadmin"
204
-	fi
205
-
206
-	# users should be able to send mail. Could be restricted with suictl.
207
-	chmod u+s "${D}/usr/bin/sendmail"
208
-
209
-	if use mailwrapper ; then
210
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
211
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
212
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
213
-
214
-		mv "${D}/usr/share/man/man1/sendmail.1" \
215
-			"${D}/usr/share/man/man1/sendmail-courier.1"
216
-		mv "${D}/usr/share/man/man1/mailq.1" \
217
-			"${D}/usr/share/man/man1/mailq-courier.1"
218
-		mv "${D}/usr/share/man/man1/rmail.1" \
219
-			"${D}/usr/share/man/man1/rmail-courier.1"
220
-
221
-		insopts -m 444 -o mail -g mail
222
-		insinto /etc/mail
223
-		doins "${FILESDIR}/mailer.conf"
224
-	else
225
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
226
-	fi
227
-}
228
-
229
-src_test() {
230
-	if [ `whoami` != 'root' ]; then
231
-		emake -j1 check || die "Make check failed."
232
-	else
233
-		einfo "make check skipped, can't run as root."
234
-		einfo "You can enable it with FEATURES=\"userpriv\""
235
-	fi
236
-}
237
-
238
-pkg_postinst() {
239
-	use fam && elog "fam daemon is needed for courier-imapd" \
240
-		|| ewarn "courier was built without fam support"
241
-}
242
-
243
-pkg_config() {
244
-	mailhost="$(hostname)"
245
-	export mailhost
246
-
247
-	domainname="$(domainname)"
248
-	if [ "x$domainname" = "x(none)" ] ; then
249
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
250
-	fi
251
-	export domainname
252
-
253
-	if [ "${ROOT}" = "/" ] ; then
254
-		file="${ROOT}/etc/courier/locals"
255
-		if [ ! -f "${file}" ] ; then
256
-			echo "localhost" > "${file}";
257
-			echo "${domainname}" >> "${file}";
258
-		fi
259
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
260
-		if [ ! -f "${file}" ] ; then
261
-			echo "${domainname}" > "${file}"
262
-			/usr/sbin/makeacceptmailfor
263
-		fi
264
-
265
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
266
-		if [ ! -f "${file}" ]
267
-		then
268
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
269
-			do
270
-				i=1
271
-				net=""
272
-				TIFS="${IFS}"
273
-				IFS="."
274
-				for o in "${netmask}"
275
-				do
276
-					if [ "${o}" == "255" ]
277
-					then
278
-						[ "_${net}" == "_" ] || net="${net}."
279
-						t="$(echo "${network}" | cut -d " " -f ${i})"
280
-						net="${net}${t}"
281
-					fi
282
-					i="$((${i} + 1))"
283
-				done
284
-				IFS="${TIFS}"
285
-				echo "doing configuration - relay control for the network ${net} !"
286
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
287
-			done
288
-			/usr/sbin/makesmtpaccess
289
-		fi
290
-	fi
291
-
292
-	echo "creating cert for esmtpd-ssl:"
293
-	/usr/sbin/mkesmtpdcert
294
-	echo "creating cert for imapd-ssl:"
295
-	/usr/sbin/mkpop3dcert
296
-	echo "creating cert for pop3d-ssl:"
297
-	/usr/sbin/mkimapdcert
298
-}
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.65.0.ebuild,v 1.2 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	unpack ${A}
48
-	cd "${S}"
49
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
50
-}
51
-
52
-src_compile() {
53
-	filter-flags '-fomit-frame-pointer'
54
-
55
-	local myconf
56
-	myconf=""
57
-
58
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
59
-
60
-	econf ${myconf} \
61
-		$(use_with fam) \
62
-		$(use_with ipv6) \
63
-		$(use_with spell ispell) \
64
-		$(use_with ldap ldapaliasd) \
65
-		$(use_enable ldap maildroldap) \
66
-		--enable-mimetypes=/etc/mime.types \
67
-		--prefix=/usr \
68
-		--disable-root-check \
69
-		--mandir=/usr/share/man \
70
-		--sysconfdir=/etc/courier \
71
-		--libexecdir=/usr/$(get_libdir)/courier \
72
-		--datadir=/usr/share/courier \
73
-		--sharedstatedir=/var/lib/courier/com \
74
-		--localstatedir=/var/lib/courier \
75
-		--with-piddir=/var/run/courier \
76
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
77
-		--with-mailuser=mail \
78
-		--with-mailgroup=mail \
79
-		--with-paranoid-smtpext \
80
-		--with-db=gdbm \
81
-		--disable-autorenamesent \
82
-		--cache-file="${S}/configuring.cache" \
83
-		--host="${CHOST}" debug=true || die "./configure"
84
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
85
-	emake || die "Compile problem"
86
-}
87
-
88
-etc_courier() {
89
-	# Import existing /etc/courier/file if it exists.
90
-	# Add option only if it was not already set or even commented out
91
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
92
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
93
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
94
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
95
-		echo "${2}" >> "${D}/etc/courier/${file}"
96
-}
97
-
98
-etc_courier_chg() {
99
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
100
-	[ -z "${section}" ] && section="${2}"
101
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
102
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
103
-}
104
-
105
-src_install() {
106
-	local f
107
-	diropts -o mail -g mail
108
-	keepdir /var/run/courier
109
-	keepdir /var/lib/courier/tmp
110
-	keepdir /var/lib/courier/msgs
111
-	make install DESTDIR="${D}" || die "install"
112
-	make install-configure || die "install-configure"
113
-
114
-	# Get rid of files we dont want
115
-	if ! use webmail ; then
116
-		cd "${D}"
117
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
118
-	fi
119
-
120
-	if ! use web ; then
121
-		cd "${D}"
122
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
123
-	fi
124
-
125
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
126
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
127
-	done
128
-
129
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
130
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
131
-
132
-	cd "${D}/etc/courier"
133
-	if use webmail ; then
134
-		insinto /etc/courier
135
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
136
-	fi
137
-
138
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
139
-	if use ldap ; then
140
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
141
-	else
142
-		rm -f ldapaliasrc
143
-	fi
144
-
145
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
146
-		> "${D}/etc/courier/sizelimit"
147
-	etc_courier maildroprc ""
148
-	etc_courier esmtproutes ""
149
-	etc_courier backuprelay ""
150
-	etc_courier locallowercase ""
151
-	etc_courier bofh "opt BOFHBADMIME=accept"
152
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
153
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
154
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
155
-	etc_courier bofh "opt BOFHSPFFROM=all"
156
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
157
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
158
-	etc_courier esmtpd "BOFHBADMIME=accept"
159
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
160
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
161
-
162
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
163
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
164
-
165
-	# Fix for a sandbox violation on subsequential merges
166
-	# - ticho@gentoo.org, 2005-07-10
167
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
168
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
169
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
170
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
171
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
172
-
173
-	cd "${S}"
174
-	cp imap/README README.imap
175
-	use nls && cp unicode/README README.unicode
176
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
177
-	dodoc tcpd/README.couriertls
178
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
179
-
180
-	if use webmail ; then
181
-		insinto /usr/$(get_libdir)/courier/courier
182
-		insopts -m 755 -o mail -g mail
183
-		doins "${S}/courier/webmaild"
184
-	fi
185
-
186
-	if use web ; then
187
-		insinto /etc/courier/webadmin
188
-		insopts -m 400 -o mail -g mail
189
-		doins "${FILESDIR}/password.dist"
190
-	fi
191
-
192
-	# avoid name collisions in /usr/sbin, make webadmin match
193
-	cd "${D}/usr/sbin"
194
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
195
-	if use web ; then
196
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
197
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
198
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
199
-			|| ewarn "failed to fix webadmin"
200
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
201
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
202
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
203
-			|| ewarn "failed to fix webadmin"
204
-	fi
205
-
206
-	# users should be able to send mail. Could be restricted with suictl.
207
-	chmod u+s "${D}/usr/bin/sendmail"
208
-
209
-	if use mailwrapper ; then
210
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
211
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
212
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
213
-
214
-		mv "${D}/usr/share/man/man1/sendmail.1" \
215
-			"${D}/usr/share/man/man1/sendmail-courier.1"
216
-		mv "${D}/usr/share/man/man1/mailq.1" \
217
-			"${D}/usr/share/man/man1/mailq-courier.1"
218
-		mv "${D}/usr/share/man/man1/rmail.1" \
219
-			"${D}/usr/share/man/man1/rmail-courier.1"
220
-
221
-		insopts -m 444 -o mail -g mail
222
-		insinto /etc/mail
223
-		doins "${FILESDIR}/mailer.conf"
224
-	else
225
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
226
-	fi
227
-}
228
-
229
-src_test() {
230
-	if [ `whoami` != 'root' ]; then
231
-		emake -j1 check || die "Make check failed."
232
-	else
233
-		einfo "make check skipped, can't run as root."
234
-		einfo "You can enable it with FEATURES=\"userpriv\""
235
-	fi
236
-}
237
-
238
-pkg_postinst() {
239
-	use fam && elog "fam daemon is needed for courier-imapd" \
240
-		|| ewarn "courier was built without fam support"
241
-}
242
-
243
-pkg_config() {
244
-	mailhost="$(hostname)"
245
-	export mailhost
246
-
247
-	domainname="$(domainname)"
248
-	if [ "x$domainname" = "x(none)" ] ; then
249
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
250
-	fi
251
-	export domainname
252
-
253
-	if [ "${ROOT}" = "/" ] ; then
254
-		file="${ROOT}/etc/courier/locals"
255
-		if [ ! -f "${file}" ] ; then
256
-			echo "localhost" > "${file}";
257
-			echo "${domainname}" >> "${file}";
258
-		fi
259
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
260
-		if [ ! -f "${file}" ] ; then
261
-			echo "${domainname}" > "${file}"
262
-			/usr/sbin/makeacceptmailfor
263
-		fi
264
-
265
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
266
-		if [ ! -f "${file}" ]
267
-		then
268
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
269
-			do
270
-				i=1
271
-				net=""
272
-				TIFS="${IFS}"
273
-				IFS="."
274
-				for o in "${netmask}"
275
-				do
276
-					if [ "${o}" == "255" ]
277
-					then
278
-						[ "_${net}" == "_" ] || net="${net}."
279
-						t="$(echo "${network}" | cut -d " " -f ${i})"
280
-						net="${net}${t}"
281
-					fi
282
-					i="$((${i} + 1))"
283
-				done
284
-				IFS="${TIFS}"
285
-				echo "doing configuration - relay control for the network ${net} !"
286
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
287
-			done
288
-			/usr/sbin/makesmtpaccess
289
-		fi
290
-	fi
291
-
292
-	echo "creating cert for esmtpd-ssl:"
293
-	/usr/sbin/mkesmtpdcert
294
-	echo "creating cert for imapd-ssl:"
295
-	/usr/sbin/mkpop3dcert
296
-	echo "creating cert for pop3d-ssl:"
297
-	/usr/sbin/mkimapdcert
298
-}
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.65.0.ebuild,v 1.2 2010/12/05 20:54:48 mattst88 Exp $
4
-
5
-inherit eutils flag-o-matic
6
-
7
-DESCRIPTION="An MTA designed specifically for maildirs"
8
-SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
9
-HOMEPAGE="http://www.courier-mta.org/"
10
-SLOT="0"
11
-LICENSE="GPL-2"
12
-# not in keywords due to missing dependencies: ~arm ~s390 ~ppc64
13
-KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
14
-IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
15
-	fam web webmail"
16
-
17
-PROVIDE="virtual/mta
18
-	 virtual/mda
19
-	 virtual/imapd"
20
-
21
-DEPEND="
22
-	>=net-libs/courier-authlib-0.61.0
23
-	>=dev-libs/openssl-0.9.6
24
-	>=sys-libs/gdbm-1.8.0
25
-	dev-libs/libpcre
26
-	app-misc/mime-types
27
-	fax? ( >=media-libs/netpbm-9.12 app-text/ghostscript-gpl >=net-dialup/mgetty-1.1.28 )
28
-	pam? ( virtual/pam )
29
-	mysql? ( virtual/mysql )
30
-	ldap? ( >=net-nds/openldap-1.2.11 )
31
-	postgres? ( dev-db/postgresql-base )
32
-	spell? ( virtual/aspell-dict )
33
-	fam? ( virtual/fam )
34
-	!mailwrapper? ( !virtual/mta )
35
-	!virtual/imapd
36
-	!mail-filter/maildrop"
37
-
38
-RDEPEND="${DEPEND}
39
-	dev-lang/perl
40
-	sys-process/procps"
41
-
42
-PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
43
-	pam? ( net-mail/mailbase )
44
-	crypt? ( >=app-crypt/gnupg-1.0.4 )"
45
-
46
-src_unpack() {
47
-	unpack ${A}
48
-	cd "${S}"
49
-	use norewrite && epatch "${FILESDIR}/norewrite.patch"
50
-}
51
-
52
-src_compile() {
53
-	filter-flags '-fomit-frame-pointer'
54
-
55
-	local myconf
56
-	myconf=""
57
-
58
-	use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
59
-
60
-	econf ${myconf} \
61
-		$(use_with fam) \
62
-		$(use_with ipv6) \
63
-		$(use_with spell ispell) \
64
-		$(use_with ldap ldapaliasd) \
65
-		$(use_enable ldap maildroldap) \
66
-		--enable-mimetypes=/etc/mime.types \
67
-		--prefix=/usr \
68
-		--disable-root-check \
69
-		--mandir=/usr/share/man \
70
-		--sysconfdir=/etc/courier \
71
-		--libexecdir=/usr/$(get_libdir)/courier \
72
-		--datadir=/usr/share/courier \
73
-		--sharedstatedir=/var/lib/courier/com \
74
-		--localstatedir=/var/lib/courier \
75
-		--with-piddir=/var/run/courier \
76
-		--with-authdaemonvar=/var/lib/courier/authdaemon \
77
-		--with-mailuser=mail \
78
-		--with-mailgroup=mail \
79
-		--with-paranoid-smtpext \
80
-		--with-db=gdbm \
81
-		--disable-autorenamesent \
82
-		--cache-file="${S}/configuring.cache" \
83
-		--host="${CHOST}" debug=true || die "./configure"
84
-	sed -e'/^install-perms-local:/a\	sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
85
-	emake || die "Compile problem"
86
-}
87
-
88
-etc_courier() {
89
-	# Import existing /etc/courier/file if it exists.
90
-	# Add option only if it was not already set or even commented out
91
-	file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
92
-	[ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
93
-			cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
94
-	grep -q "${word}" "${D}/etc/courier/${file}" || \
95
-		echo "${2}" >> "${D}/etc/courier/${file}"
96
-}
97
-
98
-etc_courier_chg() {
99
-	file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
100
-	[ -z "${section}" ] && section="${2}"
101
-	grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
102
-	sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
103
-}
104
-
105
-src_install() {
106
-	local f
107
-	diropts -o mail -g mail
108
-	keepdir /var/run/courier
109
-	keepdir /var/lib/courier/tmp
110
-	keepdir /var/lib/courier/msgs
111
-	make install DESTDIR="${D}" || die "install"
112
-	make install-configure || die "install-configure"
113
-
114
-	# Get rid of files we dont want
115
-	if ! use webmail ; then
116
-		cd "${D}"
117
-		cat "${FILESDIR}/webmail_files" | xargs rm -rf
118
-	fi
119
-
120
-	if ! use web ; then
121
-		cd "${D}"
122
-		cat "${FILESDIR}/webadmin_files" | xargs rm -rf
123
-	fi
124
-
125
-	for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
126
-		keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
127
-	done
128
-
129
-	newinitd "${FILESDIR}/courier-init-r2" "courier"
130
-	use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
131
-
132
-	cd "${D}/etc/courier"
133
-	if use webmail ; then
134
-		insinto /etc/courier
135
-		newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
136
-	fi
137
-
138
-	for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
139
-	if use ldap ; then
140
-		[ -e ldapaliasrc ] &&  ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
141
-	else
142
-		rm -f ldapaliasrc
143
-	fi
144
-
145
-	( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
146
-		> "${D}/etc/courier/sizelimit"
147
-	etc_courier maildroprc ""
148
-	etc_courier esmtproutes ""
149
-	etc_courier backuprelay ""
150
-	etc_courier locallowercase ""
151
-	etc_courier bofh "opt BOFHBADMIME=accept"
152
-	etc_courier bofh "opt BOFHSPFTRUSTME=1"
153
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
154
-	etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
155
-	etc_courier bofh "opt BOFHSPFFROM=all"
156
-	etc_courier bofh "opt BOFHSPFMAILFROM=all"
157
-	etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
158
-	etc_courier esmtpd "BOFHBADMIME=accept"
159
-	etc_courier esmtpd-ssl "BOFHBADMIME=accept"
160
-	etc_courier esmtpd-msa "BOFHBADMIME=accept"
161
-
162
-	use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
163
-	use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
164
-
165
-	# Fix for a sandbox violation on subsequential merges
166
-	# - ticho@gentoo.org, 2005-07-10
167
-	rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
168
-	dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
169
-	dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
170
-	dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
171
-	dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
172
-
173
-	cd "${S}"
174
-	cp imap/README README.imap
175
-	use nls && cp unicode/README README.unicode
176
-	dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
177
-	dodoc tcpd/README.couriertls
178
-	mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
179
-
180
-	if use webmail ; then
181
-		insinto /usr/$(get_libdir)/courier/courier
182
-		insopts -m 755 -o mail -g mail
183
-		doins "${S}/courier/webmaild"
184
-	fi
185
-
186
-	if use web ; then
187
-		insinto /etc/courier/webadmin
188
-		insopts -m 400 -o mail -g mail
189
-		doins "${FILESDIR}/password.dist"
190
-	fi
191
-
192
-	# avoid name collisions in /usr/sbin, make webadmin match
193
-	cd "${D}/usr/sbin"
194
-	for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
195
-	if use web ; then
196
-		sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
197
-			-e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
198
-			"${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
199
-			|| ewarn "failed to fix webadmin"
200
-		sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
201
-			-e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
202
-			"${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
203
-			|| ewarn "failed to fix webadmin"
204
-	fi
205
-
206
-	# users should be able to send mail. Could be restricted with suictl.
207
-	chmod u+s "${D}/usr/bin/sendmail"
208
-
209
-	if use mailwrapper ; then
210
-		mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
211
-		mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
212
-		mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
213
-
214
-		mv "${D}/usr/share/man/man1/sendmail.1" \
215
-			"${D}/usr/share/man/man1/sendmail-courier.1"
216
-		mv "${D}/usr/share/man/man1/mailq.1" \
217
-			"${D}/usr/share/man/man1/mailq-courier.1"
218
-		mv "${D}/usr/share/man/man1/rmail.1" \
219
-			"${D}/usr/share/man/man1/rmail-courier.1"
220
-
221
-		insopts -m 444 -o mail -g mail
222
-		insinto /etc/mail
223
-		doins "${FILESDIR}/mailer.conf"
224
-	else
225
-		dosym /usr/bin/sendmail /usr/sbin/sendmail
226
-	fi
227
-}
228
-
229
-src_test() {
230
-	if [ `whoami` != 'root' ]; then
231
-		emake -j1 check || die "Make check failed."
232
-	else
233
-		einfo "make check skipped, can't run as root."
234
-		einfo "You can enable it with FEATURES=\"userpriv\""
235
-	fi
236
-}
237
-
238
-pkg_postinst() {
239
-	use fam && elog "fam daemon is needed for courier-imapd" \
240
-		|| ewarn "courier was built without fam support"
241
-}
242
-
243
-pkg_config() {
244
-	mailhost="$(hostname)"
245
-	export mailhost
246
-
247
-	domainname="$(domainname)"
248
-	if [ "x$domainname" = "x(none)" ] ; then
249
-		domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
250
-	fi
251
-	export domainname
252
-
253
-	if [ "${ROOT}" = "/" ] ; then
254
-		file="${ROOT}/etc/courier/locals"
255
-		if [ ! -f "${file}" ] ; then
256
-			echo "localhost" > "${file}";
257
-			echo "${domainname}" >> "${file}";
258
-		fi
259
-		file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
260
-		if [ ! -f "${file}" ] ; then
261
-			echo "${domainname}" > "${file}"
262
-			/usr/sbin/makeacceptmailfor
263
-		fi
264
-
265
-		file="${ROOT}/etc/courier/smtpaccess/${domainname}"
266
-		if [ ! -f "${file}" ]
267
-		then
268
-			netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
269
-			do
270
-				i=1
271
-				net=""
272
-				TIFS="${IFS}"
273
-				IFS="."
274
-				for o in "${netmask}"
275
-				do
276
-					if [ "${o}" == "255" ]
277
-					then
278
-						[ "_${net}" == "_" ] || net="${net}."
279
-						t="$(echo "${network}" | cut -d " " -f ${i})"
280
-						net="${net}${t}"
281
-					fi
282
-					i="$((${i} + 1))"
283
-				done
284
-				IFS="${TIFS}"
285
-				echo "doing configuration - relay control for the network ${net} !"
286
-				echo "${net}	allow,RELAYCLIENT" >> ${file}
287
-			done
288
-			/usr/sbin/makesmtpaccess
289
-		fi
290
-	fi
291
-
292
-	echo "creating cert for esmtpd-ssl:"
293
-	/usr/sbin/mkesmtpdcert
294
-	echo "creating cert for imapd-ssl:"
295
-	/usr/sbin/mkpop3dcert
296
-	echo "creating cert for pop3d-ssl:"
297
-	/usr/sbin/mkimapdcert
298
-}
... ...
@@ -1,14 +0,0 @@
1
-Alias /webmail/ /usr/share/courier/sqwebmail/images/
2
-<Directory /usr/share/courier/sqwebmail/>
3
-	Order Allow,Deny
4
-	AllowOverride All
5
-	Allow from all
6
-</Directory>
7
-
8
-ScriptAlias /courier/ /usr/lib/courier/courier/webmail/
9
-<Directory /usr/lib/courier/courier/webmail/>
10
-	AllowOverride All
11
-	Options ExecCGI
12
-	Order allow,deny
13
-	Allow from all
14
-</Directory>
... ...
@@ -1 +0,0 @@
1
-opt BOFHBADMIME=accept
... ...
@@ -1,18 +0,0 @@
1
-Index: courier-0.59.0/gdbmobj/Makefile.am
2
-===================================================================
3
---- courier-0.59.0.orig/gdbmobj/Makefile.am
4
-+++ courier-0.59.0/gdbmobj/Makefile.am
5
-@@ -14,11 +14,12 @@ noinst_LTLIBRARIES=libgdbmobj.la
6
- noinst_PROGRAMS=testgdbm
7
- 
8
- libgdbmobj_la_SOURCES=$(LIBGDBMSOURCES)
9
-+libgdbmobj_la_LIBADD=@LIBGDBM@
10
- 
11
- testgdbm_SOURCES=$(TESTGDBMSOURCES)
12
- 
13
- testgdbm_DEPENDENCIES=libgdbmobj.la
14
--testgdbm_LDADD=libgdbmobj.la @LIBGDBM@
15
-+testgdbm_LDADD=libgdbmobj.la
16
- testgdbm_LDFLAGS=-static
17
- 
18
- check-am:
... ...
@@ -1,184 +0,0 @@
1
-#!/sbin/runscript
2
-# Portions Copyright 2003 Gentoo Linux
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/files/courier-init,v 1.6 2005/05/10 10:54:03 swegener Exp $
4
-#
5
-# script originally from Courier distfile original name = courier.sysvinit
6
-# adapted for Gentoo by Brian Jackson
7
-#
8
-# TODO
9
-# should we update all the .dat/.pem files when the source/config files are 
10
-#	newer than the .dat/.pem files?
11
-
12
-prefix="/usr"
13
-exec_prefix="/usr/bin"
14
-sysconfdir="/etc/courier"
15
-sbindir="/usr/sbin"
16
-libexecdir="/usr/lib/courier"
17
-datadir="/usr/share/courier"
18
-
19
-depend() {
20
-	need net
21
-	[ -d /etc/courier/authlib ] && need courier-authlib
22
-	grep -q "^IMAPDSTART=.*[Yy].*" /etc/courier/imapd && need famd
23
-}
24
-
25
-checkconfig() {
26
-
27
-	[ -f ${sysconfdir}/pop3d-ssl ] && . ${sysconfdir}/pop3d-ssl
28
-
29
-	# If we do not have a certificate, make one up.
30
-	[ ! -f "${datadir}/pop3d.pem" ] && \
31
-	ebegin " generating-POP3-SSL-certificate..." && "${sbindir}/mkpop3dcert"
32
-
33
-	[ -f ${sysconfdir}/imapd-ssl ] && . ${sysconfdir}/imapd-ssl
34
-
35
-	# If we do not have a certificate, make one up.
36
-	[ ! -f ${datadir}/imapd.pem ] && \
37
-	ebegin " generating-IMAP-SSL-certificate..." && "${sbindir}/mkimapdcert"
38
-
39
-	[ -f ${sysconfdir}/esmtpd-ssl ] && . ${sysconfdir}/esmtpd-ssl
40
-
41
-	# If we do not have a certificate, make one up.
42
-	[ ! -f ${datadir}/esmtpd.pem ] && \
43
-	ebegin " generating-ESMTP-SSL-certificate..." && "${sbindir}/mkesmtpdcert"
44
-
45
-	# First time after install create aliases.dat and smtpaccess.dat
46
-
47
-	[ -f ${sysconfdir}/aliases.dat ] || ${sbindir}/makealiases
48
-
49
-	[ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess
50
-
51
-	[ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess-msa
52
-}
53
-
54
-start() {
55
-	# Start daemons.
56
-	ebegin "Starting Courier mail server:"
57
-
58
-	checkconfig || return 1
59
-
60
-	ebegin " Starting courierfilterd"
61
-	${sbindir}/courierfilter start
62
-
63
-	[ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
64
-	${libexecdir}/authlib/authdaemond start && ebegin " Starting authdaemond"
65
-
66
-	[ -x ${libexecdir}/courier/webmaild ] && \
67
-	  ${libexecdir}/courier/webmaild start && ebegin " Starting webmaild" 
68
-	[ ! -x ${libexecdir}/courier/webmaild ] && [ -x ${libexecdir}/courier/sqwebmaild ] && \
69
-	  ${libexecdir}/courier/sqwebmaild start && ebegin " Starting sqwebmaild"
70
-
71
-	[ -x ${sbindir}/courierldapaliasd ] && \
72
-	${sbindir}/courierldapaliasd start && ebegin " Starting courierldapaliasd"
73
-
74
-	ebegin " Starting courierd"
75
-	${sbindir}/courier start
76
-
77
-	# start esmtpd if so written
78
-	[ -f ${sysconfdir}/esmtpd ] && source ${sysconfdir}/esmtpd
79
-	case x$ESMTPDSTART in
80
-	x[yY]*)
81
-		ebegin " Starting esmtpd"
82
-		${sbindir}/esmtpd start
83
-		;;
84
-	esac
85
-
86
-	# start esmtpd-msa if so written
87
-	[ -f ${sysconfdir}/esmtpd-msa ] && source ${sysconfdir}/esmtpd-msa
88
-	case x$ESMTPDSTART in
89
-	x[yY]*)
90
-		ebegin " Starting esmtpd-msa"
91
-		${sbindir}/esmtpd-msa start
92
-		;;
93
-	esac
94
-
95
-	# start esmtpd-ssl if so written
96
-	[ -f ${sysconfdir}/esmtpd-ssl ] && source ${sysconfdir}/esmtpd-ssl
97
-	case x$ESMTPDSSLSTART in
98
-	x[yY]*)
99
-		ebegin " Starting esmtpd-ssl"
100
-		${sbindir}/esmtpd-ssl start
101
-		;;
102
-	esac
103
-
104
-	# start pop3d if so written
105
-	[ -f ${sysconfdir}/pop3d ] && source ${sysconfdir}/pop3d
106
-	case x$POP3DSTART in
107
-	x[yY]*)
108
-		ebegin " courier-pop3d"
109
-		${sbindir}/courier-pop3d start
110
-		;;
111
-	esac
112
-
113
-	# start pop3d-ssl if so written
114
-	[ -f ${sysconfdir}/pop3d-ssl ] && source ${sysconfdir}/pop3d-ssl
115
-	case x$POP3DSSLSTART in
116
-	x[yY]*)
117
-		ebegin " courier-pop3d-ssl"
118
-		${sbindir}/courier-pop3d-ssl start
119
-		;;
120
-	esac
121
-
122
-	[ -f ${sysconfdir}/imapd ] && source ${sysconfdir}/imapd
123
-	case x$IMAPDSTART in
124
-	x[yY]*)
125
-		ebegin " courier-imapd"
126
-		${sbindir}/courier-imapd start
127
-		;;
128
-	esac
129
-
130
-	[ -f ${sysconfdir}/imapd-ssl ] && source ${sysconfdir}/imapd-ssl
131
-	case x$IMAPDSSLSTART in
132
-	x[yY]*)
133
-		ebegin " courier-imapd-ssl"
134
-		${sbindir}/courier-imapd-ssl start
135
-		;;
136
-	esac
137
-
138
-	eend $?
139
-}
140
-
141
-stop() {
142
-	ebegin "Stopping Courier mail server:"
143
-
144
-	ebegin " Stopping courier-esmtpd"
145
-	${sbindir}/esmtpd stop
146
-
147
-	ebegin " Stopping courier-esmtpd-msa"
148
-	${sbindir}/esmtpd-msa stop
149
-
150
-	ebegin " Stopping courier-esmtpd-ssl"
151
-	${sbindir}/esmtpd-ssl stop
152
-
153
-	[ -x ${sbindir}/courier-pop3d ] && \
154
-		ebegin " Stopping courier-pop3d" && ${sbindir}/courier-pop3d stop
155
-
156
-	[ -x ${sbindir}/courier-pop3d-ssl ] && \
157
-		ebegin " Stopping courier-pop3d-ssl" && ${sbindir}/courier-pop3d-ssl stop
158
-
159
-	[ -x ${sbindir}/courier-imapd ] && \
160
-		ebegin " Stopping courier-imapd" && ${sbindir}/courier-imapd stop
161
-
162
-
163
-	[ -x ${sbindir}/courier-imapd-ssl ] && \
164
-		ebegin " Stopping courier-imapd-ssl" && ${sbindir}/courier-imapd-ssl stop
165
-
166
-	ebegin " Stopping courierd"
167
-	${sbindir}/courier stop
168
-
169
-	[ -x ${sbindir}/courierldapaliasd ] && \
170
-	( ${sbindir}/courierldapaliasd stop ; ebegin " Stopping courierldapaliasd" )
171
-
172
-	[ -x ${libexecdir}/courier/webmaild ] && \
173
-	  ( ${libexecdir}/courier/webmaild stop ; ebegin " Stopping webmaild" )
174
-	[ ! -x ${libexecdir}/courier/webmaild ] && [ -x ${libexecdir}/courier/sqwebmaild ] && \
175
-	  ( ${libexecdir}/courier/sqwebmaild stop ; ebegin " Stopping sqwebmaild" )
176
-
177
-	[ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
178
-	( ${libexecdir}/authlib/authdaemond stop ; ebegin " Stopping authdaemond" )
179
-
180
-	${sbindir}/courierfilter stop
181
-	ebegin " Stopping courierfilterd"
182
-
183
-	eend $?
184
-}
... ...
@@ -1,185 +0,0 @@
1
-#!/sbin/runscript
2
-# Portions Copyright 2003 Gentoo Linux
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/files/courier-init-r1,v 1.1 2006/07/11 00:21:53 chtekk Exp $
4
-#
5
-# script originally from Courier distfile original name = courier.sysvinit
6
-# adapted for Gentoo by Brian Jackson
7
-#
8
-# TODO
9
-# should we update all the .dat/.pem files when the source/config files are 
10
-#	newer than the .dat/.pem files?
11
-
12
-prefix="/usr"
13
-exec_prefix="/usr/bin"
14
-sysconfdir="/etc/courier"
15
-sbindir="/usr/sbin"
16
-libexecdir="/usr/lib/courier"
17
-datadir="/usr/share/courier"
18
-
19
-depend() {
20
-	need net
21
-	[ -d /etc/courier/authlib ] && need courier-authlib
22
-	grep -q "^IMAPDSTART=.*[Yy].*" /etc/courier/imapd && use famd
23
-	grep -q "^IMAPDSSLSTART=.*[Yy].*" /etc/courier/imapd-ssl && use famd
24
-}
25
-
26
-checkconfig() {
27
-
28
-	[ -f ${sysconfdir}/pop3d-ssl ] && . ${sysconfdir}/pop3d-ssl
29
-
30
-	# If we do not have a certificate, make one up.
31
-	[ ! -f "${datadir}/pop3d.pem" ] && \
32
-	ebegin " generating-POP3-SSL-certificate..." && "${sbindir}/mkpop3dcert"
33
-
34
-	[ -f ${sysconfdir}/imapd-ssl ] && . ${sysconfdir}/imapd-ssl
35
-
36
-	# If we do not have a certificate, make one up.
37
-	[ ! -f ${datadir}/imapd.pem ] && \
38
-	ebegin " generating-IMAP-SSL-certificate..." && "${sbindir}/mkimapdcert"
39
-
40
-	[ -f ${sysconfdir}/esmtpd-ssl ] && . ${sysconfdir}/esmtpd-ssl
41
-
42
-	# If we do not have a certificate, make one up.
43
-	[ ! -f ${datadir}/esmtpd.pem ] && \
44
-	ebegin " generating-ESMTP-SSL-certificate..." && "${sbindir}/mkesmtpdcert"
45
-
46
-	# First time after install create aliases.dat and smtpaccess.dat
47
-
48
-	[ -f ${sysconfdir}/aliases.dat ] || ${sbindir}/makealiases
49
-
50
-	[ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess
51
-
52
-	[ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess-msa
53
-}
54
-
55
-start() {
56
-	# Start daemons.
57
-	ebegin "Starting Courier mail server:"
58
-
59
-	checkconfig || return 1
60
-
61
-	ebegin " Starting courierfilterd"
62
-	${sbindir}/courierfilter start
63
-
64
-	[ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
65
-	${libexecdir}/authlib/authdaemond start && ebegin " Starting authdaemond"
66
-
67
-	[ -x ${libexecdir}/courier/webmaild ] && \
68
-	  ${libexecdir}/courier/webmaild start && ebegin " Starting webmaild" 
69
-	[ ! -x ${libexecdir}/courier/webmaild ] && [ -x ${libexecdir}/courier/sqwebmaild ] && \
70
-	  ${libexecdir}/courier/sqwebmaild start && ebegin " Starting sqwebmaild"
71
-
72
-	[ -x ${sbindir}/courierldapaliasd ] && \
73
-	${sbindir}/courierldapaliasd start && ebegin " Starting courierldapaliasd"
74
-
75
-	ebegin " Starting courierd"
76
-	${sbindir}/courier start
77
-
78
-	# start esmtpd if so written
79
-	[ -f ${sysconfdir}/esmtpd ] && source ${sysconfdir}/esmtpd
80
-	case x$ESMTPDSTART in
81
-	x[yY]*)
82
-		ebegin " Starting esmtpd"
83
-		${sbindir}/esmtpd start
84
-		;;
85
-	esac
86
-
87
-	# start esmtpd-msa if so written
88
-	[ -f ${sysconfdir}/esmtpd-msa ] && source ${sysconfdir}/esmtpd-msa
89
-	case x$ESMTPDSTART in
90
-	x[yY]*)
91
-		ebegin " Starting esmtpd-msa"
92
-		${sbindir}/esmtpd-msa start
93
-		;;
94
-	esac
95
-
96
-	# start esmtpd-ssl if so written
97
-	[ -f ${sysconfdir}/esmtpd-ssl ] && source ${sysconfdir}/esmtpd-ssl
98
-	case x$ESMTPDSSLSTART in
99
-	x[yY]*)
100
-		ebegin " Starting esmtpd-ssl"
101
-		${sbindir}/esmtpd-ssl start
102
-		;;
103
-	esac
104
-
105
-	# start pop3d if so written
106
-	[ -f ${sysconfdir}/pop3d ] && source ${sysconfdir}/pop3d
107
-	case x$POP3DSTART in
108
-	x[yY]*)
109
-		ebegin " courier-pop3d"
110
-		${sbindir}/courier-pop3d start
111
-		;;
112
-	esac
113
-
114
-	# start pop3d-ssl if so written
115
-	[ -f ${sysconfdir}/pop3d-ssl ] && source ${sysconfdir}/pop3d-ssl
116
-	case x$POP3DSSLSTART in
117
-	x[yY]*)
118
-		ebegin " courier-pop3d-ssl"
119
-		${sbindir}/courier-pop3d-ssl start
120
-		;;
121
-	esac
122
-
123
-	[ -f ${sysconfdir}/imapd ] && source ${sysconfdir}/imapd
124
-	case x$IMAPDSTART in
125
-	x[yY]*)
126
-		ebegin " courier-imapd"
127
-		${sbindir}/courier-imapd start
128
-		;;
129
-	esac
130
-
131
-	[ -f ${sysconfdir}/imapd-ssl ] && source ${sysconfdir}/imapd-ssl
132
-	case x$IMAPDSSLSTART in
133
-	x[yY]*)
134
-		ebegin " courier-imapd-ssl"
135
-		${sbindir}/courier-imapd-ssl start
136
-		;;
137
-	esac
138
-
139
-	eend $?
140
-}
141
-
142
-stop() {
143
-	ebegin "Stopping Courier mail server:"
144
-
145
-	ebegin " Stopping courier-esmtpd"
146
-	${sbindir}/esmtpd stop
147
-
148
-	ebegin " Stopping courier-esmtpd-msa"
149
-	${sbindir}/esmtpd-msa stop
150
-
151
-	ebegin " Stopping courier-esmtpd-ssl"
152
-	${sbindir}/esmtpd-ssl stop
153
-
154
-	[ -x ${sbindir}/courier-pop3d ] && \
155
-		ebegin " Stopping courier-pop3d" && ${sbindir}/courier-pop3d stop
156
-
157
-	[ -x ${sbindir}/courier-pop3d-ssl ] && \
158
-		ebegin " Stopping courier-pop3d-ssl" && ${sbindir}/courier-pop3d-ssl stop
159
-
160
-	[ -x ${sbindir}/courier-imapd ] && \
161
-		ebegin " Stopping courier-imapd" && ${sbindir}/courier-imapd stop
162
-
163
-
164
-	[ -x ${sbindir}/courier-imapd-ssl ] && \
165
-		ebegin " Stopping courier-imapd-ssl" && ${sbindir}/courier-imapd-ssl stop
166
-
167
-	ebegin " Stopping courierd"
168
-	${sbindir}/courier stop
169
-
170
-	[ -x ${sbindir}/courierldapaliasd ] && \
171
-	( ${sbindir}/courierldapaliasd stop ; ebegin " Stopping courierldapaliasd" )
172
-
173
-	[ -x ${libexecdir}/courier/webmaild ] && \
174
-	  ( ${libexecdir}/courier/webmaild stop ; ebegin " Stopping webmaild" )
175
-	[ ! -x ${libexecdir}/courier/webmaild ] && [ -x ${libexecdir}/courier/sqwebmaild ] && \
176
-	  ( ${libexecdir}/courier/sqwebmaild stop ; ebegin " Stopping sqwebmaild" )
177
-
178
-	[ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
179
-	( ${libexecdir}/authlib/authdaemond stop ; ebegin " Stopping authdaemond" )
180
-
181
-	${sbindir}/courierfilter stop
182
-	ebegin " Stopping courierfilterd"
183
-
184
-	eend $?
185
-}
... ...
@@ -1,181 +0,0 @@
1
-#!/sbin/runscript
2
-# Portions Copyright 2003 Gentoo Linux
3
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/files/courier-init-r2,v 1.1 2008/11/20 13:26:32 hanno Exp $
4
-#
5
-# script originally from Courier distfile original name = courier.sysvinit
6
-# adapted for Gentoo by Brian Jackson
7
-#
8
-# TODO
9
-# should we update all the .dat/.pem files when the source/config files are 
10
-#	newer than the .dat/.pem files?
11
-
12
-prefix="/usr"
13
-exec_prefix="/usr/bin"
14
-sysconfdir="/etc/courier"
15
-sbindir="/usr/sbin"
16
-libexecdir="/usr/lib/courier"
17
-datadir="/usr/share/courier"
18
-
19
-depend() {
20
-	need net
21
-	[ -d /etc/courier/authlib ] && need courier-authlib
22
-	grep -q "^IMAPDSTART=.*[Yy].*" /etc/courier/imapd && use famd
23
-	grep -q "^IMAPDSSLSTART=.*[Yy].*" /etc/courier/imapd-ssl && use famd
24
-}
25
-
26
-checkconfig() {
27
-
28
-	[ -f ${sysconfdir}/pop3d-ssl ] && . ${sysconfdir}/pop3d-ssl
29
-
30
-	# If we do not have a certificate, make one up.
31
-	[ ! -f "${datadir}/pop3d.pem" ] && \
32
-	ebegin " generating-POP3-SSL-certificate..." && "${sbindir}/mkpop3dcert"
33
-
34
-	[ -f ${sysconfdir}/imapd-ssl ] && . ${sysconfdir}/imapd-ssl
35
-
36
-	# If we do not have a certificate, make one up.
37
-	[ ! -f ${datadir}/imapd.pem ] && \
38
-	ebegin " generating-IMAP-SSL-certificate..." && "${sbindir}/mkimapdcert"
39
-
40
-	[ -f ${sysconfdir}/esmtpd-ssl ] && . ${sysconfdir}/esmtpd-ssl
41
-
42
-	# If we do not have a certificate, make one up.
43
-	[ ! -f ${datadir}/esmtpd.pem ] && \
44
-	ebegin " generating-ESMTP-SSL-certificate..." && "${sbindir}/mkesmtpdcert"
45
-
46
-	# First time after install create aliases.dat and smtpaccess.dat
47
-
48
-	[ -f ${sysconfdir}/aliases.dat ] || ${sbindir}/makealiases
49
-
50
-	[ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess
51
-
52
-	[ -f ${sysconfdir}/${ACCESSFILE}.dat ] || ${sbindir}/makesmtpaccess-msa
53
-}
54
-
55
-start() {
56
-	# Start daemons.
57
-	ebegin "Starting Courier mail server:"
58
-
59
-	checkconfig || return 1
60
-
61
-	ebegin " Starting courierfilterd"
62
-	${sbindir}/courierfilter start
63
-
64
-	[ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
65
-	${libexecdir}/authlib/authdaemond start && ebegin " Starting authdaemond"
66
-
67
-	[ -x ${sbindir}/webmaild ] && \
68
-	  ${sbindir}/webmaild start && ebegin " Starting webmaild" 
69
-
70
-	[ -x ${sbindir}/courierldapaliasd ] && \
71
-	${sbindir}/courierldapaliasd start && ebegin " Starting courierldapaliasd"
72
-
73
-	ebegin " Starting courierd"
74
-	${sbindir}/courier start
75
-
76
-	# start esmtpd if so written
77
-	[ -f ${sysconfdir}/esmtpd ] && source ${sysconfdir}/esmtpd
78
-	case x$ESMTPDSTART in
79
-	x[yY]*)
80
-		ebegin " Starting esmtpd"
81
-		${sbindir}/esmtpd start
82
-		;;
83
-	esac
84
-
85
-	# start esmtpd-msa if so written
86
-	[ -f ${sysconfdir}/esmtpd-msa ] && source ${sysconfdir}/esmtpd-msa
87
-	case x$ESMTPDSTART in
88
-	x[yY]*)
89
-		ebegin " Starting esmtpd-msa"
90
-		${sbindir}/esmtpd-msa start
91
-		;;
92
-	esac
93
-
94
-	# start esmtpd-ssl if so written
95
-	[ -f ${sysconfdir}/esmtpd-ssl ] && source ${sysconfdir}/esmtpd-ssl
96
-	case x$ESMTPDSSLSTART in
97
-	x[yY]*)
98
-		ebegin " Starting esmtpd-ssl"
99
-		${sbindir}/esmtpd-ssl start
100
-		;;
101
-	esac
102
-
103
-	# start pop3d if so written
104
-	[ -f ${sysconfdir}/pop3d ] && source ${sysconfdir}/pop3d
105
-	case x$POP3DSTART in
106
-	x[yY]*)
107
-		ebegin " courier-pop3d"
108
-		${sbindir}/courier-pop3d start
109
-		;;
110
-	esac
111
-
112
-	# start pop3d-ssl if so written
113
-	[ -f ${sysconfdir}/pop3d-ssl ] && source ${sysconfdir}/pop3d-ssl
114
-	case x$POP3DSSLSTART in
115
-	x[yY]*)
116
-		ebegin " courier-pop3d-ssl"
117
-		${sbindir}/courier-pop3d-ssl start
118
-		;;
119
-	esac
120
-
121
-	[ -f ${sysconfdir}/imapd ] && source ${sysconfdir}/imapd
122
-	case x$IMAPDSTART in
123
-	x[yY]*)
124
-		ebegin " courier-imapd"
125
-		${sbindir}/courier-imapd start
126
-		;;
127
-	esac
128
-
129
-	[ -f ${sysconfdir}/imapd-ssl ] && source ${sysconfdir}/imapd-ssl
130
-	case x$IMAPDSSLSTART in
131
-	x[yY]*)
132
-		ebegin " courier-imapd-ssl"
133
-		${sbindir}/courier-imapd-ssl start
134
-		;;
135
-	esac
136
-
137
-	eend $?
138
-}
139
-
140
-stop() {
141
-	ebegin "Stopping Courier mail server:"
142
-
143
-	ebegin " Stopping courier-esmtpd"
144
-	${sbindir}/esmtpd stop
145
-
146
-	ebegin " Stopping courier-esmtpd-msa"
147
-	${sbindir}/esmtpd-msa stop
148
-
149
-	ebegin " Stopping courier-esmtpd-ssl"
150
-	${sbindir}/esmtpd-ssl stop
151
-
152
-	[ -x ${sbindir}/courier-pop3d ] && \
153
-		ebegin " Stopping courier-pop3d" && ${sbindir}/courier-pop3d stop
154
-
155
-	[ -x ${sbindir}/courier-pop3d-ssl ] && \
156
-		ebegin " Stopping courier-pop3d-ssl" && ${sbindir}/courier-pop3d-ssl stop
157
-
158
-	[ -x ${sbindir}/courier-imapd ] && \
159
-		ebegin " Stopping courier-imapd" && ${sbindir}/courier-imapd stop
160
-
161
-
162
-	[ -x ${sbindir}/courier-imapd-ssl ] && \
163
-		ebegin " Stopping courier-imapd-ssl" && ${sbindir}/courier-imapd-ssl stop
164
-
165
-	ebegin " Stopping courierd"
166
-	${sbindir}/courier stop
167
-
168
-	[ -x ${sbindir}/courierldapaliasd ] && \
169
-	( ${sbindir}/courierldapaliasd stop ; ebegin " Stopping courierldapaliasd" )
170
-
171
-	[ -x ${sbindir}/webmaild ] && \
172
-	  ( ${sbindir}/webmaild stop ; ebegin " Stopping webmaild" )
173
-
174
-	[ ! -d /etc/courier/authlib ] && [ -x ${libexecdir}/authlib/authdaemond ] && \
175
-	( ${libexecdir}/authlib/authdaemond stop ; ebegin " Stopping authdaemond" )
176
-
177
-	${sbindir}/courierfilter stop
178
-	ebegin " Stopping courierfilterd"
179
-
180
-	eend $?
181
-}
... ...
@@ -1,2 +0,0 @@
1
-|| dotforward
2
-./.maildir/
... ...
@@ -1,6 +0,0 @@
1
-# Execute the "real" sendmail program, named /usr/sbin/sendmail
2
-#
3
-sendmail	/usr/bin/sendmail.courier
4
-send-mail	/usr/bin/sendmail.courier
5
-mailq		/usr/bin/mailq.courier
6
-rmail		/usr/bin/rmail.courier
... ...
@@ -1,21 +0,0 @@
1
---- courier/module.esmtp/esmtp.c.orig	2004-02-03 01:08:15.679486558 -0700
2
-+++ courier/module.esmtp/esmtp.c	2004-02-03 01:07:41.262697092 -0700
3
-@@ -255,6 +255,10 @@ const char *me;
4
- struct rfc822t	*tp;
5
- struct rfc822token at;
6
- 
7
-+#if 1
8
-+	(*func)(info);
9
-+	return;
10
-+#else
11
- 	if (info->ptr == 0)
12
- 	{
13
- 		(*func)(info);
14
-@@ -289,6 +293,7 @@ struct rfc822token at;
15
- 	(*func)(info);
16
- 	*r=0;
17
- 	rfc822t_free(tp);
18
-+#endif
19
- }
20
- 
21
- static void rw_esmtp(struct rw_info *info, void (*func)(struct rw_info *))
... ...
@@ -1,6 +0,0 @@
1
-# 1. Open /etc/courier/webadmin/password for editing
2
-# 2. There should be one word in this file.  The webadmin password
3
-# 3. chown mail:mail password
4
-# 4. chmod 400 password
5
-#
6
-# Thanks to Fernando Tobler on bug #10574 for the concise instructions
... ...
@@ -1,28 +0,0 @@
1
-#!/bin/sh
2
-# this has to be called with a list of configuration files to apply the
3
-# changes
4
-# example: ./set-mime /etc/courier/esmtpd /etc/courier/esmtpd-ssl
5
-
6
-files=$*
7
-
8
-chk_badmime='##NAME: BOFHBADMIME:0'
9
-pos_badmime='##NAME: NOADDMSGID:0'
10
-ins_badmime='\
11
-##NAME: BOFHBADMIME:0\
12
-#\
13
-# set BOFHBADMIME\
14
-#   to \"reject\" to return mail with invalid MIME header\
15
-#   to \"wrap\" to wrap mail with invalid MIME header in an attachmant\
16
-#   to \"accept\" to pass mail with invalid MIME header untouched\
17
-\
18
-BOFHBADMIME=accept\
19
-'
20
-
21
-for f in ${files}
22
-do
23
-	if ! grep -q "${chk_badmime}" "${f}"
24
-	then
25
-		echo "adding parameter ${chk_badmime} to ${f}"
26
-		cat ${f} | sed -e"/${pos_badmime}/ i ${ins_badmime}" > "${f}.tmp" && mv -f "${f}.tmp" "${f}"
27
-	fi
28
-done
... ...
@@ -1,20 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3
-
4
-<pkgmetadata>
5
-	<herd>no-herd</herd>
6
-	<maintainer>
7
-		<email>hanno@gentoo.org</email>
8
-	</maintainer>
9
-	<longdescription>
10
-		Complete email package consisting of pop, imap, smtp, and fax
11
-		server and secure version of the above also.
12
-	</longdescription>
13
-	<use>
14
-		<flag name='fax'>Enables fax support in the courier mail server</flag>
15
-		<flag name='norewrite'>Prevents courier mail server from mangling
16
-			virtual user addresses when sending</flag>
17
-		<flag name='web'>Enable the web interface</flag>
18
-		<flag name='webmail'>Enable the webmail interface</flag>
19
-	</use>
20
-</pkgmetadata>
... ...
@@ -1,34 +0,0 @@
1
-AUX 2.10/glibc-2.10-gentoo-chk_fail.c 9407 RMD160 230701dfacfe2481eb49e5384fe4ebb508bd3af2 SHA1 0e9330d57de714dd1ecd7040d3eabf4723cdee7c SHA256 7745c0f5d37b37959b43b41e39762fc35b877161bc5740d9d3e9a83021acbc0e
2
-AUX 2.10/glibc-2.10-hardened-configure-picdefault.patch 865 RMD160 744bdbfb73f1dbced4cb33cb5aa92f3b41d3b4fb SHA1 21e0f83598f5342032a794315f0e3dac07f647da SHA256 b50b29f85d88011555bbcbe6046e6600be9344f2d78412b14aebdea515420774
3
-AUX 2.10/glibc-2.10-hardened-inittls-nosysenter.patch 8823 RMD160 163e53f0f4f0bd003ef1c50a4eaaa8f4a82695fe SHA1 df23c6756114e1451e6f120723af1b621037c28e SHA256 dcf78c6524c222dbee907200a8878aff727e29d43a4962b977a16d85752e5c10
4
-AUX 2.10/glibc-2.10-hardened-ssp-compat.patch 4802 RMD160 02bd17455d64b6661ae5f44329357dc254cdf118 SHA1 b40cf1a8f17e448861746ba39aa20afd66a47b2d SHA256 bd6f0aa8eace0a935731749e101d5fe30210f9edb65f2f5ccd425cef581ddce4
5
-AUX 2.11/glibc-2.11-hardened-pie.patch 1492 RMD160 dacf988364e3eeeaa2bd588420a19db373347678 SHA1 f44b4389d031bc618c83a2f196c4e2afa647a68a SHA256 74277f76ace9cb6b408ef7c1d43a3604ae0d6c1af539055aeaeb542d2bfa2a46
6
-AUX 2.12/glibc-2.12-hardened-pie.patch 1542 RMD160 c42e6a8eef542506c440d58395a066129cd40dec SHA1 703b4c23a6701f41cd51b629eae362e129b60de3 SHA256 9d11da52900a4cfdaa9052476029cb1b4c8004dfaef3cf446f3b728035f75fbe
7
-AUX 2.3.3/glibc-2.3.3-localedef-fix-trampoline.patch 2329 RMD160 de6ba25b8330e6ee720355e8541235d265a461cd SHA1 cf869cbd74793cb579b42d734884f10d4cadcdde SHA256 b5cf51d1ff5479d09fbc82992f126ca4969006c90c3a2ae94ad586d4902d791b
8
-AUX 2.5/glibc-2.5-gentoo-stack_chk_fail.c 9058 RMD160 c98d7007857aeeea00e708e7989800dad9b07ae3 SHA1 ff92b7b6cb4a364dbe81c5110da79d1ad56a72ba SHA256 067fba2a36d2630d50198c44395ef208cdf080508f1b716bd3d079f7b964e2df
9
-AUX 2.5/glibc-2.5-hardened-configure-picdefault.patch 794 RMD160 7ab81bac4b9625043b1e7edea6fb5707696c144d SHA1 25a0b018eb44f3c9818876a12e9ec817e305d80b SHA256 0c0359f567e4ad2d3184618bf6ac7e6102b703eab6227c7e9a4ff4dcdeed2c91
10
-AUX 2.5/glibc-2.5-hardened-inittls-nosysenter.patch 9407 RMD160 352112bf4f2d8d58471f22f623784350baf0bc86 SHA1 ae244e9923c0a0e8be4121d593897530c0bf08e8 SHA256 2a912e82445815ae32744d990c59d8758ec74e482b856bd274c292848b9af1fd
11
-AUX 2.5/glibc-2.5-hardened-pie.patch 1569 RMD160 8746aeb9f9c68ca153d93cf92c9df93d0fb324d6 SHA1 c2ec8d9286af38017f5bee5a8823f642c067201d SHA256 ff9cde8857c5da89faa4039e2a81748674fbeaaa49d85c378d80711d55f2b0c1
12
-AUX 2.6/glibc-2.6-gentoo-stack_chk_fail.c 9545 RMD160 9a21c9deb6ebca5d2245e3bb50b53ce035967a5f SHA1 11ad52117fa55bbe51b429043df49767c7f58de0 SHA256 1410ded812be80d452eada5f9d6b9bd7bdb504c14f01cc27dce3e36b6f92b92a
13
-AUX 2.6/glibc-2.6-hardened-inittls-nosysenter.patch 8674 RMD160 f4e7df0cb25292afc13e18332569d2ca288fdf92 SHA1 7f34ef26d6607321e0ec5ad0f389cb1aedf5e0da SHA256 cf58ded8fbe9fcb3dc094521feec2588c1520ff2c632b20c69d6a210325c4fcf
14
-AUX 2.7/glibc-2.7-hardened-inittls-nosysenter.patch 8755 RMD160 b674894f3b16f63193bb8040f8a5657dce82e1f9 SHA1 79fb3a4454b85af70dac95dd79134be3fe3a9201 SHA256 b0b1bf0746f7160b89cf281502b95c38dec9cb948d6a50a907b84fd6230a2dc3
15
-AUX eblits/common.eblit 9020 RMD160 82cec0d8109f420d9d2369ff6d872c8146d60ad6 SHA1 fc2eab1c0ba49c9536a3b21821dcf1ae265ac651 SHA256 c5e218a6b138b26067293bafd1595453be9ecd4b2e5322da4796330c61368ffe
16
-AUX eblits/pkg_postinst.eblit 1159 RMD160 4b99846819bf0471d1104a8a17dd260796644f9d SHA1 4a2980fede3edebc7960d40db7cf935c7c854859 SHA256 76c403cf5c77a3a3bb7441566335f0c8da2584eaa21f05ab400e7bb00f9db810
17
-AUX eblits/pkg_preinst.eblit 3764 RMD160 f9a9d43e2d2d8df073be7e1b66655e651cb10740 SHA1 b987e2802201e0f44c357ffc7b92da4aa77cf377 SHA256 41baa253ea529156d628108247545235c4ec377b184e7824bd790eba1361299e
18
-AUX eblits/pkg_setup.eblit 2814 RMD160 8352c4b9cc460b7193e17be8bca227db5b6df5ba SHA1 8de7ea78e364521b55574b16036d57e7d35a596f SHA256 b803723f75571649e10e0707a6dbe8b459eabdc149ef155558792db736faa201
19
-AUX eblits/src_compile-2.11.2.eblit 5849 RMD160 8881ea4b50cf177d628eb70913425db8c71e681d SHA1 31d75b03578aed3aa740a88091e2c0a7fe33786c SHA256 b1b9d25fe90b860ebaa8d78b0f6865da034040b58b044b665f4e0385052bc6d5
20
-AUX eblits/src_compile.eblit 5790 RMD160 d059d6ac75b6d6d60101a1c8456e11ecd1da2676 SHA1 4417abec18bce3a8eb9798a8519d868bbf3ba489 SHA256 ce8894489fd5c21dc74cc28116b77cb6d331743bbf9ecf32f4f8e368f997a74c
21
-AUX eblits/src_install-2.11.2.eblit 8091 RMD160 aa409a8fe8cabfeeb71c89d655d345cda84a3946 SHA1 f5526f3eaa448a808cde739d7c5a75fe9bdab245 SHA256 93e1188835bdd1156b33b7b03af3822c46f6d1a1bc8338e98b8aa0f950cee868
22
-AUX eblits/src_install-2.6.eblit 7946 RMD160 6cc258a316b78212777ab328a3c0cb73de1616d4 SHA1 94895689b56fd712156e8ac84a2a639d8475da03 SHA256 54081c34217c230d0ff43c5df378897a37576e727fe41ee4d681767110667f3e
23
-AUX eblits/src_install.eblit 8017 RMD160 f0f94cf49346af96d619ebc658ddb4193a9e91a3 SHA1 f10c162a048c8ef145d269feae9b741790495513 SHA256 a624b2e926bd4233c908cec39911e6df7f78f01c6380d436c1f3d05481efec41
24
-AUX eblits/src_test-2.11.2.eblit 1169 RMD160 d7d1f430453e5278c2f3d4ee4815faff3a47a03a SHA1 9d48060c34ef901cbe6e8d7880ea923c8e1b7f28 SHA256 95b14845a80a74abc5b5c5146f2291524d7dd66f8e1bd9d12b42a3234a065010
25
-AUX eblits/src_test.eblit 1172 RMD160 a70e31e655cd3e306af6a498002de85b72258566 SHA1 4aec15e6ab67279258fd23400701fd38c106a38b SHA256 e5a390761b7ec613460b8da26df3ffe2a137217261dd9f87f2b78c3fa2a12727
26
-AUX eblits/src_unpack.eblit 5219 RMD160 3c63f22995dd13cafce46d519b28c4ede1ee0281 SHA1 b52d277a37232cc6d09666a55a8ee4f5d5d892b4 SHA256 d70a28c4f6662786822cb2852ea86836c92ff2f8059270022431e1d02da3a9e1
27
-AUX glibc-sec1 2564 RMD160 84e731c7b9835c63fbf1616fa8a5d918890a0a71 SHA1 e7d3e07c2cf76001897ab2b67190561d5d0a11bb SHA256 c555ed9e42f8124be75f9cce9b647c3252a314ff9b1a28a227e49ea7f2de8fc9
28
-AUX glibc-sec2 7820 RMD160 838bf19b0f1611d53308422b84c3d67c4fb07478 SHA1 9dbbc4bdd99f1b599e9be90611fde6c2c134a00f SHA256 c4514239863e742bd369c92e3e427e53304349ee0dc10e3819370b46cf337817
29
-AUX nscd 1621 RMD160 f6d20c4c3814f70d7741f3fa2e0b53ba32c37960 SHA1 5751fe798024c2021b7b3ed3e798618e2a38244a SHA256 6165db3a2fcb251d4f3655c0461e018ce9c92a37f7f22a8fd2b75178b5435bc8
30
-AUX nsswitch.conf 503 RMD160 f375f92f6b41029c93382c39cef896261b140cfc SHA1 42f7f5cc3de75c69bf60d806ac8490106ea63326 SHA256 6c38b8642d5da884327ad678d0351d57be3621562253bd9711394bad87e45e2d
31
-DIST glibc-2.11.2-patches-4.tar.bz2 113687 RMD160 bd7de7710ac9d834abd441b461b1ecc07c181010 SHA1 48bd6a30a74445544e04a08b14762fe64c4e1799 SHA256 259558d05233f5490324724f639154bd9882d8aa3cdf78bcea54f42ed0d70c94
32
-DIST glibc-2.11.2.tar.bz2 15675392 RMD160 15d14fb6b0b58ec3fb7781efa2f8a558fcb99a7e SHA1 23b477f4816a97e007be1e98abc1ffe2af13ba9e SHA256 c2ac76ee363eed31b2a377489fb2818139f4668b5505ad583009eb9b0e228713
33
-DIST glibc-ports-2.11.tar.bz2 599606 RMD160 e7262cb903b42d27bd0666fb170d2abb4c8b478f SHA1 76a0513c74b80e34f81abcaabbc538fa0f33b6a4 SHA256 38d212b1a22ed121c97f2827e7357e3e077084635ebc197246993d328b1b6589
34
-EBUILD glibc-2.11.2-r2.ebuild 8456 RMD160 0ef19a9d74d6adf472250147b0b3ac21ebac6514 SHA1 efb87d9b9b5b4778f1199e8f828e98fc02df25e1 SHA256 1923247322c35a6feebfd85839c5593806463f6cc6ca7c1297fa6655722ccc1e
... ...
@@ -1,315 +0,0 @@
1
-/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
2
-   This file is part of the GNU C Library.
3
-
4
-   The GNU C Library is free software; you can redistribute it and/or
5
-   modify it under the terms of the GNU Lesser General Public
6
-   License as published by the Free Software Foundation; either
7
-   version 2.1 of the License, or (at your option) any later version.
8
-
9
-   The GNU C Library is distributed in the hope that it will be useful,
10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
-   Lesser General Public License for more details.
13
-
14
-   You should have received a copy of the GNU Lesser General Public
15
-   License along with the GNU C Library; if not, write to the Free
16
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
-   02111-1307 USA.  */
18
-
19
-/* Copyright (C) 2006-2008 Gentoo Foundation Inc.
20
- * License terms as above.
21
- *
22
- * Hardened Gentoo SSP and FORTIFY handler
23
- *
24
- * An SSP failure handler that does not use functions from the rest of
25
- * glibc; it uses the INTERNAL_SYSCALL methods directly.  This ensures
26
- * no possibility of recursion into the handler.
27
- *
28
- * Direct all bug reports to http://bugs.gentoo.org/
29
- *
30
- * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
31
- * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
32
- *
33
- * The following people contributed to the glibc-2.3 Hardened
34
- * Gentoo SSP and FORTIFY handler, from which this implementation draws much:
35
- *
36
- * Ned Ludd - <solar[@]gentoo.org>
37
- * Alexander Gabert - <pappy[@]gentoo.org>
38
- * The PaX Team - <pageexec[@]freemail.hu>
39
- * Peter S. Mazinger - <ps.m[@]gmx.net>
40
- * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
41
- * Robert Connolly - <robert[@]linuxfromscratch.org>
42
- * Cory Visi <cory[@]visi.name>
43
- * Mike Frysinger <vapier[@]gentoo.org>
44
- * Magnus Granberg <zorry[@]ume.nu>
45
- */
46
-
47
-#include <stdio.h>
48
-#include <stdlib.h>
49
-#include <errno.h>
50
-#include <unistd.h>
51
-#include <signal.h>
52
-
53
-#include <sys/types.h>
54
-
55
-#include <sysdep-cancel.h>
56
-#include <sys/syscall.h>
57
-#include <bp-checks.h>
58
-
59
-#include <kernel-features.h>
60
-
61
-#include <alloca.h>
62
-/* from sysdeps */
63
-#include <socketcall.h>
64
-/* for the stuff in bits/socket.h */
65
-#include <sys/socket.h>
66
-#include <sys/un.h>
67
-
68
-/* Sanity check on SYSCALL macro names - force compilation
69
- * failure if the names used here do not exist
70
- */
71
-#if !defined __NR_socketcall && !defined __NR_socket
72
-# error Cannot do syscall socket or socketcall
73
-#endif
74
-#if !defined __NR_socketcall && !defined __NR_connect
75
-# error Cannot do syscall connect or socketcall
76
-#endif
77
-#ifndef __NR_write
78
-# error Cannot do syscall write
79
-#endif
80
-#ifndef __NR_close
81
-# error Cannot do syscall close
82
-#endif
83
-#ifndef __NR_getpid
84
-# error Cannot do syscall getpid
85
-#endif
86
-#ifndef __NR_kill
87
-# error Cannot do syscall kill
88
-#endif
89
-#ifndef __NR_exit
90
-# error Cannot do syscall exit
91
-#endif
92
-#ifdef SSP_SMASH_DUMPS_CORE
93
-# define ENABLE_SSP_SMASH_DUMPS_CORE 1
94
-# if !defined _KERNEL_NSIG && !defined _NSIG
95
-#  error No _NSIG or _KERNEL_NSIG for rt_sigaction
96
-# endif
97
-# if !defined __NR_sigaction && !defined __NR_rt_sigaction
98
-#  error Cannot do syscall sigaction or rt_sigaction
99
-# endif
100
-/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
101
- * of the _kernel_ sigset_t which is not the same as the user sigset_t.
102
- * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
103
- * some reason.
104
- */
105
-# ifdef _KERNEL_NSIG
106
-#  define _SSP_NSIG _KERNEL_NSIG
107
-# else
108
-#  define _SSP_NSIG _NSIG
109
-# endif
110
-#else
111
-# define _SSP_NSIG 0
112
-# define ENABLE_SSP_SMASH_DUMPS_CORE 0
113
-#endif
114
-
115
-/* Define DO_SIGACTION - default to newer rt signal interface but
116
- * fallback to old as needed.
117
- */
118
-#ifdef __NR_rt_sigaction
119
-# define DO_SIGACTION(signum, act, oldact) \
120
-	INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
121
-#else
122
-# define DO_SIGACTION(signum, act, oldact) \
123
-	INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
124
-#endif
125
-
126
-/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
127
-#if defined(__NR_socket) && defined(__NR_connect)
128
-# define USE_OLD_SOCKETCALL 0
129
-#else
130
-# define USE_OLD_SOCKETCALL 1
131
-#endif
132
-
133
-/* stub out the __NR_'s so we can let gcc optimize away dead code */
134
-#ifndef __NR_socketcall
135
-# define __NR_socketcall 0
136
-#endif
137
-#ifndef __NR_socket
138
-# define __NR_socket 0
139
-#endif
140
-#ifndef __NR_connect
141
-# define __NR_connect 0
142
-#endif
143
-#define DO_SOCKET(result, domain, type, protocol) \
144
-	do { \
145
-		if (USE_OLD_SOCKETCALL) { \
146
-			socketargs[0] = domain; \
147
-			socketargs[1] = type; \
148
-			socketargs[2] = protocol; \
149
-			socketargs[3] = 0; \
150
-			result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
151
-		} else \
152
-			result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
153
-	} while (0)
154
-#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
155
-	do { \
156
-		if (USE_OLD_SOCKETCALL) { \
157
-			socketargs[0] = sockfd; \
158
-			socketargs[1] = (unsigned long int)serv_addr; \
159
-			socketargs[2] = addrlen; \
160
-			socketargs[3] = 0; \
161
-			result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
162
-		} else \
163
-			result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
164
-	} while (0)
165
-
166
-#ifndef _PATH_LOG
167
-# define _PATH_LOG "/dev/log"
168
-#endif
169
-
170
-static const char path_log[] = _PATH_LOG;
171
-
172
-/* For building glibc with SSP switched on, define __progname to a
173
- * constant if building for the run-time loader, to avoid pulling
174
- * in more of libc.so into ld.so
175
- */
176
-#ifdef IS_IN_rtld
177
-static char *__progname = "<rtld>";
178
-#else
179
-extern char *__progname;
180
-#endif
181
-
182
-/* Common handler code, used by chk_fail
183
- * Inlined to ensure no self-references to the handler within itself.
184
- * Data static to avoid putting more than necessary on the stack,
185
- * to aid core debugging.
186
- */
187
-__attribute__ ((__noreturn__ , __always_inline__))
188
-static inline void
189
-__hardened_gentoo_chk_fail(char func[], int damaged)
190
-{
191
-#define MESSAGE_BUFSIZ 256
192
-	static pid_t pid;
193
-	static int plen, i;
194
-	static char message[MESSAGE_BUFSIZ];
195
-	static const char msg_ssa[] = ": buffer overflow attack";
196
-	static const char msg_inf[] = " in function ";
197
-	static const char msg_ssd[] = "*** buffer overflow detected ***: ";
198
-	static const char msg_terminated[] = " - terminated\n";
199
-	static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
200
-	static const char msg_unknown[] = "<unknown>";
201
-	static int log_socket, connect_result;
202
-	static struct sockaddr_un sock;
203
-	static unsigned long int socketargs[4];
204
-
205
-	/* Build socket address
206
-	 */
207
-	sock.sun_family = AF_UNIX;
208
-	i = 0;
209
-	while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
210
-		sock.sun_path[i] = path_log[i];
211
-		i++;
212
-	}
213
-	sock.sun_path[i] = '\0';
214
-
215
-	/* Try SOCK_DGRAM connection to syslog */
216
-	connect_result = -1;
217
-	DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
218
-	if (log_socket != -1)
219
-		DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
220
-	if (connect_result == -1) {
221
-		if (log_socket != -1)
222
-			INLINE_SYSCALL(close, 1, log_socket);
223
-		/* Try SOCK_STREAM connection to syslog */
224
-		DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
225
-		if (log_socket != -1)
226
-			DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
227
-	}
228
-
229
-	/* Build message.  Messages are generated both in the old style and new style,
230
-	 * so that log watchers that are configured for the old-style message continue
231
-	 * to work.
232
-	 */
233
-#define strconcat(str) \
234
-		{i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
235
-		{\
236
-			message[plen+i]=str[i];\
237
-			i++;\
238
-		}\
239
-		plen+=i;}
240
-
241
-	/* R.Henderson post-gcc-4 style message */
242
-	plen = 0;
243
-	strconcat(msg_ssd);
244
-	if (__progname != (char *)0)
245
-		strconcat(__progname)
246
-	else
247
-		strconcat(msg_unknown);
248
-	strconcat(msg_terminated);
249
-
250
-	/* Write out error message to STDERR, to syslog if open */
251
-	INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
252
-	if (connect_result != -1)
253
-		INLINE_SYSCALL(write, 3, log_socket, message, plen);
254
-
255
-	/* Dr. Etoh pre-gcc-4 style message */
256
-	plen = 0;
257
-	if (__progname != (char *)0)
258
-		strconcat(__progname)
259
-	else
260
-		strconcat(msg_unknown);
261
-	strconcat(msg_ssa);
262
-	strconcat(msg_inf);
263
-	if (func != NULL)
264
-		strconcat(func)
265
-	else
266
-		strconcat(msg_unknown);
267
-	strconcat(msg_terminated);
268
-	/* Write out error message to STDERR, to syslog if open */
269
-	INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
270
-	if (connect_result != -1)
271
-		INLINE_SYSCALL(write, 3, log_socket, message, plen);
272
-
273
-	/* Direct reports to bugs.gentoo.org */
274
-	plen=0;
275
-	strconcat(msg_report);
276
-	message[plen++]='\0';
277
-
278
-	/* Write out error message to STDERR, to syslog if open */
279
-	INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
280
-	if (connect_result != -1)
281
-		INLINE_SYSCALL(write, 3, log_socket, message, plen);
282
-
283
-	if (log_socket != -1)
284
-		INLINE_SYSCALL(close, 1, log_socket);
285
-
286
-	/* Suicide */
287
-	pid = INLINE_SYSCALL(getpid, 0);
288
-
289
-	if (ENABLE_SSP_SMASH_DUMPS_CORE) {
290
-		static struct sigaction default_abort_act;
291
-		/* Remove any user-supplied handler for SIGABRT, before using it */
292
-		default_abort_act.sa_handler = SIG_DFL;
293
-		default_abort_act.sa_sigaction = NULL;
294
-		__sigfillset(&default_abort_act.sa_mask);
295
-		default_abort_act.sa_flags = 0;
296
-		if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
297
-			INLINE_SYSCALL(kill, 2, pid, SIGABRT);
298
-	}
299
-
300
-	/* Note; actions cannot be added to SIGKILL */
301
-	INLINE_SYSCALL(kill, 2, pid, SIGKILL);
302
-
303
-	/* In case the kill didn't work, exit anyway
304
-	 * The loop prevents gcc thinking this routine returns
305
-	 */
306
-	while (1)
307
-		INLINE_SYSCALL(exit, 0);
308
-}
309
-
310
-__attribute__ ((__noreturn__))
311
-void __chk_fail(void)
312
-{
313
-	__hardened_gentoo_chk_fail(NULL, 0);
314
-}
315
-
... ...
@@ -1,30 +0,0 @@
1
-Prevent default-fPIE from confusing configure into thinking
2
-PIC code is default.  This causes glibc to build both PIC and
3
-non-PIC code as normal, which on the hardened compiler generates
4
-PIC and PIE.
5
-
6
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
7
-Fixed for glibc 2.10 by Magnus Granberg <zorry@ume.nu>
8
-
9
---- configure.in
10
-+++ configure.in
11
-@@ -2145,7 +2145,7 @@
12
- # error PIC is default.
13
- #endif
14
- EOF
15
--if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
16
-+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
17
-   libc_cv_pic_default=no
18
- fi
19
- rm -f conftest.*])
20
---- configure
21
-+++ configure
22
-@@ -7698,7 +7698,7 @@
23
- # error PIC is default.
24
- #endif
25
- EOF
26
--if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
27
-+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
28
-   libc_cv_pic_default=no
29
- fi
30
- rm -f conftest.*
... ...
@@ -1,274 +0,0 @@
1
-When building glibc PIE (which is not something upstream support),
2
-several modifications are necessary to the glibc build process.
3
-
4
-First, any syscalls in PIEs must be of the PIC variant, otherwise
5
-textrels ensue.  Then, any syscalls made before the initialisation
6
-of the TLS will fail on i386, as the sysenter variant on i386 uses
7
-the TLS, giving rise to a chicken-and-egg situation.  This patch
8
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
9
-version is normally used, and uses the non-sysenter version for the brk
10
-syscall that is performed by the TLS initialisation.  Further, the TLS
11
-initialisation is moved in this case prior to the initialisation of
12
-dl_osversion, as that requires further syscalls.
13
-
14
-csu/libc-start.c: Move initial TLS initialization to before the
15
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
16
-
17
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
18
-INTERNAL_SYSCALL_NOSYSENTER is defined.
19
-
20
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
21
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
22
-
23
-misc/brk.c: Define a no-sysenter version of brk if
24
-INTERNAL_SYSCALL_NOSYSENTER is defined.
25
-
26
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
27
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
28
-
29
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
30
-Fixed for 2.10 by Magnus Granberg <zorry@ume.nu>
31
-
32
---- csu/libc-start.c
33
-+++ csu/libc-start.c
34
-@@ -28,6 +28,7 @@
35
- extern int __libc_multiple_libcs;
36
- 
37
- #include <tls.h>
38
-+#include <sysdep.h>
39
- #ifndef SHARED
40
- # include <dl-osinfo.h>
41
- extern void __pthread_initialize_minimal (void);
42
-@@ -129,6 +130,11 @@
43
- #  endif
44
-   _dl_aux_init (auxvec);
45
- # endif
46
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
47
-+  /* Do the initial TLS initialization before _dl_osversion,
48
-+     since the latter uses the uname syscall.  */
49
-+  __pthread_initialize_minimal ();
50
-+# endif
51
- # ifdef DL_SYSDEP_OSCHECK
52
-   if (!__libc_multiple_libcs)
53
-     {
54
-@@ -138,10 +144,12 @@
55
-     }
56
- # endif
57
- 
58
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
59
-   /* Initialize the thread library at least a bit since the libgcc
60
-      functions are using thread functions if these are available and
61
-      we need to setup errno.  */
62
-   __pthread_initialize_minimal ();
63
-+# endif
64
- 
65
-   /* Set up the stack checker's canary.  */
66
-   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
67
---- csu/libc-tls.c
68
-+++ csu/libc-tls.c
69
-@@ -23,6 +23,7 @@
70
- #include <unistd.h>
71
- #include <stdio.h>
72
- #include <sys/param.h>
73
-+#include <sysdep.h>
74
- 
75
- 
76
- #ifdef SHARED
77
-@@ -29,6 +30,9 @@
78
-  #error makefile bug, this file is for static only
79
- #endif
80
- 
81
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
82
-+extern void *__sbrk_nosysenter (intptr_t __delta);
83
-+#endif
84
- extern ElfW(Phdr) *_dl_phdr;
85
- extern size_t _dl_phnum;
86
- 
87
-@@ -141,14 +145,26 @@
88
- 
89
-      The initialized value of _dl_tls_static_size is provided by dl-open.c
90
-      to request some surplus that permits dynamic loading of modules with
91
--     IE-model TLS.  */
92
-+     IE-model TLS.
93
-+     
94
-+     Where the normal sbrk would use a syscall that needs the TLS (i386)
95
-+     use the special non-sysenter version instead.  */
96
- #if TLS_TCB_AT_TP
97
-   tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
98
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
99
-+  tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
100
-+# else
101
-   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
102
-+# endif
103
- #elif TLS_DTV_AT_TP
104
-   tcb_offset = roundup (tcbsize, align ?: 1);
105
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
106
-+  tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
107
-+		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
108
-+# else
109
-   tlsblock = __sbrk (tcb_offset + memsz + max_align
110
- 		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
111
-+# endif
112
-   tlsblock += TLS_PRE_TCB_SIZE;
113
- #else
114
-   /* In case a model with a different layout for the TCB and DTV
115
---- misc/sbrk.c
116
-+++ misc/sbrk.c
117
-@@ -18,6 +18,7 @@
118
- #include <errno.h>
119
- #include <stdint.h>
120
- #include <unistd.h>
121
-+#include <sysdep.h>
122
- 
123
- /* Defined in brk.c.  */
124
- extern void *__curbrk;
125
-@@ -29,6 +30,35 @@
126
- /* Extend the process's data space by INCREMENT.
127
-    If INCREMENT is negative, shrink data space by - INCREMENT.
128
-    Return start of new space allocated, or -1 for errors.  */
129
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
130
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
131
-+   if the SYSENTER version requires the TLS (which it does on i386).
132
-+   Obviously using the TLS before it is initialised is broken. */
133
-+extern int __brk_nosysenter (void *addr);
134
-+void *
135
-+__sbrk_nosysenter (intptr_t increment)
136
-+{
137
-+  void *oldbrk;
138
-+
139
-+  /* If this is not part of the dynamic library or the library is used
140
-+     via dynamic loading in a statically linked program update
141
-+     __curbrk from the kernel's brk value.  That way two separate
142
-+     instances of __brk and __sbrk can share the heap, returning
143
-+     interleaved pieces of it.  */
144
-+  if (__curbrk == NULL || __libc_multiple_libcs)
145
-+    if (__brk_nosysenter (0) < 0)		/* Initialize the break.  */
146
-+      return (void *) -1;
147
-+
148
-+  if (increment == 0)
149
-+    return __curbrk;
150
-+
151
-+  oldbrk = __curbrk;
152
-+  if (__brk_nosysenter (oldbrk + increment) < 0)
153
-+    return (void *) -1;
154
-+
155
-+  return oldbrk;
156
-+}
157
-+#endif
158
- void *
159
- __sbrk (intptr_t increment)
160
- {
161
---- sysdeps/unix/sysv/linux/i386/brk.c
162
-+++ sysdeps/unix/sysv/linux/i386/brk.c
163
-@@ -31,6 +31,30 @@
164
-    linker.  */
165
- weak_alias (__curbrk, ___brk_addr)
166
- 
167
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
168
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
169
-+ * if the SYSENTER version requires the TLS (which it does on i386).
170
-+ * Obviously using the TLS before it is initialised is broken. */
171
-+int
172
-+__brk_nosysenter (void *addr)
173
-+{
174
-+  void *__unbounded newbrk;
175
-+
176
-+  INTERNAL_SYSCALL_DECL (err);
177
-+  newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
178
-+						 __ptrvalue (addr));
179
-+
180
-+  __curbrk = newbrk;
181
-+
182
-+  if (newbrk < addr)
183
-+    {
184
-+      __set_errno (ENOMEM);
185
-+      return -1;
186
-+    }
187
-+
188
-+  return 0;
189
-+}
190
-+#endif
191
- int
192
- __brk (void *addr)
193
- {
194
---- sysdeps/unix/sysv/linux/i386/sysdep.h
195
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h
196
-@@ -187,7 +187,7 @@
197
- /* The original calling convention for system calls on Linux/i386 is
198
-    to use int $0x80.  */
199
- #ifdef I386_USE_SYSENTER
200
--# ifdef SHARED
201
-+# if defined SHARED || defined __PIC__
202
- #  define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
203
- # else
204
- #  define ENTER_KERNEL call *_dl_sysinfo
205
-@@ -358,7 +358,7 @@
206
-    possible to use more than four parameters.  */
207
- #undef INTERNAL_SYSCALL
208
- #ifdef I386_USE_SYSENTER
209
--# ifdef SHARED
210
-+# if defined SHARED || defined __PIC__
211
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
212
-   ({									      \
213
-     register unsigned int resultvar;					      \
214
-@@ -384,6 +384,18 @@
215
-     : "0" (name), "i" (offsetof (tcbhead_t, sysinfo))			      \
216
-       ASMFMT_##nr(args) : "memory", "cc");				      \
217
-     (int) resultvar; })
218
-+#  define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
219
-+  ({									      \
220
-+    register unsigned int resultvar;					      \
221
-+    EXTRAVAR_##nr							      \
222
-+    asm volatile (							      \
223
-+    LOADARGS_NOSYSENTER_##nr						      \
224
-+    "movl %1, %%eax\n\t"						      \
225
-+    "int $0x80\n\t"							      \
226
-+    RESTOREARGS_NOSYSENTER_##nr						      \
227
-+    : "=a" (resultvar)							      \
228
-+    : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc");		      \
229
-+    (int) resultvar; })
230
- # else
231
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
232
-   ({									      \
233
-@@ -447,12 +459,20 @@
234
- 
235
- #define LOADARGS_0
236
- #ifdef __PIC__
237
--# if defined I386_USE_SYSENTER && defined SHARED
238
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
239
- #  define LOADARGS_1 \
240
-     "bpushl .L__X'%k3, %k3\n\t"
241
- #  define LOADARGS_5 \
242
-     "movl %%ebx, %4\n\t"						      \
243
-     "movl %3, %%ebx\n\t"
244
-+#  define LOADARGS_NOSYSENTER_1 \
245
-+    "bpushl .L__X'%k2, %k2\n\t"
246
-+#  define LOADARGS_NOSYSENTER_2	LOADARGS_NOSYSENTER_1
247
-+#  define LOADARGS_NOSYSENTER_3	LOADARGS_3
248
-+#  define LOADARGS_NOSYSENTER_4	LOADARGS_3
249
-+#  define LOADARGS_NOSYSENTER_5 \
250
-+    "movl %%ebx, %3\n\t"						      \
251
-+    "movl %2, %%ebx\n\t"
252
- # else
253
- #  define LOADARGS_1 \
254
-     "bpushl .L__X'%k2, %k2\n\t"
255
-@@ -474,11 +495,18 @@
256
- 
257
- #define RESTOREARGS_0
258
- #ifdef __PIC__
259
--# if defined I386_USE_SYSENTER && defined SHARED
260
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
261
- #  define RESTOREARGS_1 \
262
-     "bpopl .L__X'%k3, %k3\n\t"
263
- #  define RESTOREARGS_5 \
264
-     "movl %4, %%ebx"
265
-+#  define RESTOREARGS_NOSYSENTER_1 \
266
-+    "bpopl .L__X'%k2, %k2\n\t"
267
-+#  define RESTOREARGS_NOSYSENTER_2	RESTOREARGS_NOSYSENTER_1
268
-+#  define RESTOREARGS_NOSYSENTER_3	RESTOREARGS_3
269
-+#  define RESTOREARGS_NOSYSENTER_4	RESTOREARGS_3
270
-+#  define RESTOREARGS_NOSYSENTER_5 \
271
-+    "movl %3, %%ebx"
272
- # else
273
- #  define RESTOREARGS_1 \
274
-     "bpopl .L__X'%k2, %k2\n\t"
... ...
@@ -1,168 +0,0 @@
1
-Add backwards compat support for gcc-3.x ssp ... older ssp versions
2
-used __guard and __stack_smash_handler symbols while gcc-4.1 and newer
3
-uses __stack_chk_guard and __stack_chk_fail.
4
-
5
---- config.h.in
6
-+++ config.h.in
7
-@@ -42,6 +42,9 @@
8
-    assembler instructions per line.  Default is `;'  */
9
- #undef ASM_LINE_SEP
10
- 
11
-+/* Define if we want to enable support for old ssp symbols */
12
-+#undef	ENABLE_OLD_SSP_COMPAT
13
-+
14
- /* Define if not using ELF, but `.init' and `.fini' sections are available.  */
15
- #undef	HAVE_INITFINI
16
- 
17
---- configure
18
-+++ configure
19
-@@ -1378,6 +1378,9 @@ Optional Features:
20
-   --enable-kernel=VERSION compile for compatibility with kernel not older than
21
-                           VERSION
22
-   --enable-all-warnings   enable all useful warnings gcc can issue
23
-+  --disable-old-ssp-compat
24
-+                          enable support for older ssp symbols
25
-+                          [default=no]
26
-   --enable-multi-arch     enable single DSO with optimizations for multiple
27
-                           architectures
28
-   --enable-experimental-malloc
29
-@@ -6462,6 +6465,20 @@ fi
30
- $as_echo "$libc_cv_ssp" >&6; }
31
- 
32
- 
33
-+# Check whether --enable-old-ssp-compat or --disable-old-ssp-compat was given.
34
-+if test "${enable_old_ssp_compat+set}" = set; then
35
-+  enableval="$enable_old_ssp_compat"
36
-+  enable_old_ssp_compat=$enableval
37
-+else
38
-+  enable_old_ssp_compat=no
39
-+fi;
40
-+if test "x$enable_old_ssp_compat" = "xyes"; then
41
-+  cat >>confdefs.h <<\_ACEOF
42
-+#define ENABLE_OLD_SSP_COMPAT 1
43
-+_ACEOF
44
-+
45
-+fi
46
-+
47
- { $as_echo "$as_me:$LINENO: checking for -fgnu89-inline" >&5
48
- $as_echo_n "checking for -fgnu89-inline... " >&6; }
49
- if test "${libc_cv_gnu89_inline+set}" = set; then
50
---- configure.in
51
-+++ configure.in
52
-@@ -1641,6 +1641,15 @@ fi
53
- rm -f conftest*])
54
- AC_SUBST(libc_cv_ssp)
55
- 
56
-+AC_ARG_ENABLE([old-ssp-compat],
57
-+	      AC_HELP_STRING([--enable-old-ssp-compat],
58
-+	                     [enable support for older ssp symbols @<:@default=no@:>@]),
59
-+	      [enable_old_ssp_compat=$enableval],
60
-+	      [enable_old_ssp_compat=no])
61
-+if test "x$enable_old_ssp_compat" = "xyes"; then
62
-+  AC_DEFINE(ENABLE_OLD_SSP_COMPAT)
63
-+fi
64
-+
65
- AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
66
- cat > conftest.c <<EOF
67
- int foo;
68
---- csu/libc-start.c
69
-+++ csu/libc-start.c
70
-@@ -37,6 +37,9 @@ extern void __pthread_initialize_minimal
71
- uintptr_t __stack_chk_guard attribute_relro;
72
- # endif
73
- #endif
74
-+#ifdef ENABLE_OLD_SSP_COMPAT
75
-+uintptr_t __guard attribute_relro;
76
-+#endif
77
- 
78
- #ifdef HAVE_PTR_NTHREADS
79
- /* We need atomic operations.  */
80
-@@ -141,6 +145,9 @@ LIBC_START_MAIN (int (*main) (int, char 
81
- 
82
-   /* Set up the stack checker's canary.  */
83
-   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
84
-+#ifdef ENABLE_OLD_SSP_COMPAT
85
-+  __guard = stack_chk_guard;
86
-+#endif
87
- # ifdef THREAD_SET_STACK_GUARD
88
-   THREAD_SET_STACK_GUARD (stack_chk_guard);
89
- # else
90
---- csu/Versions
91
-+++ csu/Versions
92
-@@ -17,6 +17,12 @@ libc {
93
-     # New special glibc functions.
94
-     gnu_get_libc_release; gnu_get_libc_version;
95
-   }
96
-+  GLIBC_2.3.2 {
97
-+%ifdef ENABLE_OLD_SSP_COMPAT
98
-+    # global objects and functions for the old propolice patch in gcc
99
-+    __guard;
100
-+%endif
101
-+  }
102
-   GLIBC_PRIVATE {
103
- %if HAVE___THREAD
104
-     # This version is for the TLS symbol, GLIBC_2.0 is the old object symbol.
105
---- debug/Versions
106
-+++ debug/Versions
107
-@@ -10,6 +10,12 @@ libc {
108
-     # These are to support some gcc features.
109
-     __cyg_profile_func_enter; __cyg_profile_func_exit;
110
-   }
111
-+%ifdef ENABLE_OLD_SSP_COMPAT
112
-+  GLIBC_2.3.2 {
113
-+    # backwards ssp compat support; alias to __stack_chk_fail
114
-+    __stack_smash_handler;
115
-+  }
116
-+%endif
117
-   GLIBC_2.3.4 {
118
-     __chk_fail;
119
-     __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
120
---- elf/rtld.c
121
-+++ elf/rtld.c
122
-@@ -89,6 +89,9 @@ INTDEF(_dl_argv)
123
-    in thread local area.  */
124
- uintptr_t __stack_chk_guard attribute_relro;
125
- #endif
126
-+#ifdef ENABLE_OLD_SSP_COMPAT
127
-+uintptr_t __guard attribute_relro;
128
-+#endif
129
- 
130
- /* Only exported for architectures that don't store the pointer guard
131
-    value in thread local area.  */
132
-@@ -1817,6 +1821,9 @@ ERROR: ld.so: object '%s' cannot be load
133
- 
134
-   /* Set up the stack checker's canary.  */
135
-   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard (_dl_random);
136
-+#ifdef ENABLE_OLD_SSP_COMPAT
137
-+  __guard = stack_chk_guard;
138
-+#endif
139
- #ifdef THREAD_SET_STACK_GUARD
140
-   THREAD_SET_STACK_GUARD (stack_chk_guard);
141
- #else
142
---- elf/Versions
143
-+++ elf/Versions
144
-@@ -43,6 +43,12 @@ ld {
145
-     # runtime interface to TLS
146
-     __tls_get_addr;
147
-   }
148
-+%ifdef ENABLE_OLD_SSP_COMPAT
149
-+  GLIBC_2.3.2 {
150
-+    # backwards ssp compat support
151
-+    __guard;
152
-+  }
153
-+%endif
154
-   GLIBC_2.4 {
155
-     # stack canary
156
-     __stack_chk_guard;
157
---- Versions.def
158
-+++ Versions.def
159
-@@ -109,6 +109,9 @@ ld {
160
-   GLIBC_2.0
161
-   GLIBC_2.1
162
-   GLIBC_2.3
163
-+%ifdef ENABLE_OLD_SSP_COMPAT
164
-+  GLIBC_2.3.2
165
-+%endif
166
-   GLIBC_2.4
167
-   GLIBC_PRIVATE
168
- }
... ...
@@ -1,40 +0,0 @@
1
-http://bugs.gentoo.org/292139
2
-
3
-2009-11-08  Magnus Granberg  <zorry@ume.nu>
4
-
5
-	* Makeconfig (+link): Set to +link-pie.
6
-	(+link-static): Change $(static-start-installed-name) to
7
-	S$(static-start-installed-name).
8
-	(+prector): Set to +prectorS.
9
-	(+postctor): Set to +postctorS.
10
-
11
---- libc/Makeconfig
12
-+++ libc/Makeconfig
13
-@@ -447,11 +447,12 @@
14
- 	     $(common-objpfx)libc% $(+postinit),$^) \
15
- 	     $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
16
- endif
17
-++link = $(+link-pie)
18
- # Command for statically linking programs with the C library.
19
- ifndef +link-static
20
- +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
21
- 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F))  \
22
--	      $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
23
-+	      $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
24
- 	      $(+preinit) $(+prector) \
25
- 	      $(filter-out $(addprefix $(csu-objpfx),start.o \
26
- 						     $(start-installed-name))\
27
-@@ -549,11 +550,10 @@
28
- ifeq ($(elf),yes)
29
- +preinit = $(addprefix $(csu-objpfx),crti.o)
30
- +postinit = $(addprefix $(csu-objpfx),crtn.o)
31
--+prector = `$(CC) --print-file-name=crtbegin.o`
32
--+postctor = `$(CC) --print-file-name=crtend.o`
33
--# Variants of the two previous definitions for linking PIE programs.
34
- +prectorS = `$(CC) --print-file-name=crtbeginS.o`
35
- +postctorS = `$(CC) --print-file-name=crtendS.o`
36
-++prector = $(+prectorS)
37
-++postctor = $(+postctorS)
38
- +interp = $(addprefix $(elf-objpfx),interp.os)
39
- endif
40
- csu-objpfx = $(common-objpfx)csu/
... ...
@@ -1,39 +0,0 @@
1
-2010-08-11  Magnus Granberg  <zorry@ume.nu>
2
-
3
-	#332331
4
-	* Makeconfig (+link): Set to +link-pie.
5
-	(+link-static): Change $(static-start-installed-name) to
6
-	S$(static-start-installed-name).
7
-	(+prector): Set to +prectorS.
8
-	(+postctor): Set to +postctorS.
9
-
10
---- libc/Makeconfig
11
-+++ libc/Makeconfig
12
-@@ -447,11 +447,12 @@
13
- 	     $(common-objpfx)libc% $(+postinit),$^) \
14
- 	     $(link-extra-libs) $(link-libc) $(+postctorS) $(+postinit)
15
- endif
16
-++link = $(+link-pie)
17
- # Command for statically linking programs with the C library.
18
- ifndef +link-static
19
- +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
20
- 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F))  \
21
--	      $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
22
-+	      $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
23
- 	      $(+preinit) $(+prector) \
24
- 	      $(filter-out $(addprefix $(csu-objpfx),start.o \
25
- 						     $(start-installed-name))\
26
-@@ -549,11 +550,10 @@
27
- ifeq ($(elf),yes)
28
- +preinit = $(addprefix $(csu-objpfx),crti.o)
29
- +postinit = $(addprefix $(csu-objpfx),crtn.o)
30
--+prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
31
--+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
32
--# Variants of the two previous definitions for linking PIE programs.
33
- +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
34
- +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
35
-++prector = $(+prectorS)
36
-++postctor = $(+postctorS)
37
- +interp = $(addprefix $(elf-objpfx),interp.os)
38
- endif
39
- csu-objpfx = $(common-objpfx)csu/
... ...
@@ -1,68 +0,0 @@
1
-#! /bin/sh -e
2
-
3
-# DP: Description: Fix localedef segfault when run under exec-shield,
4
-#        PaX or similar. (#231438, #198099)
5
-# DP: Dpatch Author: James Troup <james@nocrew.org>
6
-# DP: Patch Author: (probably) Jakub Jelinek <jakub@redhat.com>
7
-# DP: Upstream status: Unknown
8
-# DP: Status Details: Unknown
9
-# DP: Date: 2004-03-16
10
-
11
-if [ $# -ne 2 ]; then
12
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
13
-    exit 1
14
-fi
15
-case "$1" in
16
-    -patch) patch -d "$2" -f --no-backup-if-mismatch -p1 < $0;;
17
-    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p1 < $0;;
18
-    *)
19
-	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
20
-	exit 1
21
-esac
22
-exit 0
23
-
24
---- glibc-2.3.3-net/locale/programs/3level.h	16 Jun 2003 07:19:09 -0000	1.1.1.5
25
-+++ glibc-2.3.3-redhat/locale/programs/3level.h	16 Jun 2003 09:32:40 -0000	1.4
26
-@@ -204,6 +204,42 @@ CONCAT(TABLE,_iterate) (struct TABLE *t,
27
- 	}
28
-     }
29
- }
30
-+
31
-+/* GCC ATM seems to do a poor job with pointers to nested functions passed
32
-+   to inlined functions.  Help it a little bit with this hack.  */
33
-+#define wchead_table_iterate(tp, fn) \
34
-+do									      \
35
-+  {									      \
36
-+    struct wchead_table *t = (tp);					      \
37
-+    uint32_t index1;							      \
38
-+    for (index1 = 0; index1 < t->level1_size; index1++)			      \
39
-+      {									      \
40
-+	uint32_t lookup1 = t->level1[index1];				      \
41
-+	if (lookup1 != ((uint32_t) ~0))					      \
42
-+	  {								      \
43
-+	    uint32_t lookup1_shifted = lookup1 << t->q;			      \
44
-+	    uint32_t index2;						      \
45
-+	    for (index2 = 0; index2 < (1 << t->q); index2++)		      \
46
-+	      {								      \
47
-+		uint32_t lookup2 = t->level2[index2 + lookup1_shifted];	      \
48
-+		if (lookup2 != ((uint32_t) ~0))				      \
49
-+		  {							      \
50
-+		    uint32_t lookup2_shifted = lookup2 << t->p;		      \
51
-+		    uint32_t index3;					      \
52
-+		    for (index3 = 0; index3 < (1 << t->p); index3++)	      \
53
-+		      {							      \
54
-+			struct element_t *lookup3			      \
55
-+			  = t->level3[index3 + lookup2_shifted];	      \
56
-+			if (lookup3 != NULL)				      \
57
-+			  fn ((((index1 << t->q) + index2) << t->p) + index3, \
58
-+			      lookup3);					      \
59
-+		      }							      \
60
-+		  }							      \
61
-+	      }								      \
62
-+	  }								      \
63
-+      }									      \
64
-+  } while (0)
65
-+
66
- #endif
67
- 
68
- #ifndef NO_FINALIZE
... ...
@@ -1,311 +0,0 @@
1
-/* Copyright (C) 2005 Free Software Foundation, Inc.
2
-   This file is part of the GNU C Library.
3
-
4
-   The GNU C Library is free software; you can redistribute it and/or
5
-   modify it under the terms of the GNU Lesser General Public
6
-   License as published by the Free Software Foundation; either
7
-   version 2.1 of the License, or (at your option) any later version.
8
-
9
-   The GNU C Library is distributed in the hope that it will be useful,
10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
-   Lesser General Public License for more details.
13
-
14
-   You should have received a copy of the GNU Lesser General Public
15
-   License along with the GNU C Library; if not, write to the Free
16
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
-   02111-1307 USA.  */
18
-
19
-/* Copyright (C) 2006 Gentoo Foundation Inc.
20
- * License terms as above.
21
- *
22
- * Hardened Gentoo SSP handler
23
- *
24
- * An SSP failure handler that does not use functions from the rest of
25
- * glibc; it uses the INTERNAL_SYSCALL methods directly.  This ensures
26
- * no possibility of recursion into the handler.
27
- *
28
- * Direct all bug reports to http://bugs.gentoo.org/
29
- *
30
- * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
31
- * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
32
- *
33
- * The following people contributed to the glibc-2.3 Hardened
34
- * Gentoo SSP handler, from which this implementation draws much:
35
- *
36
- * Ned Ludd - <solar[@]gentoo.org>
37
- * Alexander Gabert - <pappy[@]gentoo.org>
38
- * The PaX Team - <pageexec[@]freemail.hu>
39
- * Peter S. Mazinger - <ps.m[@]gmx.net>
40
- * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
41
- * Robert Connolly - <robert[@]linuxfromscratch.org>
42
- * Cory Visi <cory[@]visi.name>
43
- * Mike Frysinger <vapier[@]gentoo.org>
44
- */
45
-
46
-#include <errno.h>
47
-#include <stdlib.h>
48
-#include <unistd.h>
49
-#include <signal.h>
50
-
51
-#include <sys/types.h>
52
-
53
-#include <sysdep-cancel.h>
54
-#include <sys/syscall.h>
55
-#include <bp-checks.h>
56
-
57
-#include <kernel-features.h>
58
-
59
-#include <alloca.h>
60
-/* from sysdeps */
61
-#include <socketcall.h>
62
-/* for the stuff in bits/socket.h */
63
-#include <sys/socket.h>
64
-#include <sys/un.h>
65
-
66
-
67
-/* Sanity check on SYSCALL macro names - force compilation
68
- * failure if the names used here do not exist
69
- */
70
-#if !defined __NR_socketcall && !defined __NR_socket
71
-# error Cannot do syscall socket or socketcall
72
-#endif
73
-#if !defined __NR_socketcall && !defined __NR_connect
74
-# error Cannot do syscall connect or socketcall
75
-#endif
76
-#ifndef __NR_write
77
-# error Cannot do syscall write
78
-#endif
79
-#ifndef __NR_close
80
-# error Cannot do syscall close
81
-#endif
82
-#ifndef __NR_getpid
83
-# error Cannot do syscall getpid
84
-#endif
85
-#ifndef __NR_kill
86
-# error Cannot do syscall kill
87
-#endif
88
-#ifndef __NR_exit
89
-# error Cannot do syscall exit
90
-#endif
91
-#ifdef SSP_SMASH_DUMPS_CORE
92
-# if !defined _KERNEL_NSIG && !defined _NSIG
93
-#  error No _NSIG or _KERNEL_NSIG for rt_sigaction
94
-# endif
95
-# if !defined __NR_sigation && !defined __NR_rt_sigaction
96
-#  error Cannot do syscall sigaction or rt_sigaction
97
-# endif
98
-#endif
99
-
100
-
101
-
102
-/* Define DO_SOCKET/DO_CONNECT macros to deal with socketcall vs socket/connect */
103
-#ifdef __NR_socketcall
104
-
105
-# define DO_SOCKET(result,domain,type,protocol) \
106
-	{socketargs[0] = domain; \
107
-	socketargs[1] = type; \
108
-	socketargs[2] = protocol; \
109
-	socketargs[3] = 0; \
110
-	result = INLINE_SYSCALL(socketcall,2,SOCKOP_socket,socketargs);}
111
-
112
-# define DO_CONNECT(result,sockfd,serv_addr,addrlen) \
113
-	{socketargs[0] = sockfd; \
114
-	socketargs[1] = (unsigned long int)serv_addr; \
115
-	socketargs[2] = addrlen; \
116
-	socketargs[3] = 0; \
117
-	result = INLINE_SYSCALL(socketcall,2,SOCKOP_connect,socketargs);}
118
-
119
-#else
120
-
121
-# define DO_SOCKET(result,domain,type,protocol) \
122
-	{result = INLINE_SYSCALL(socket,3,domain,type,protocol);}
123
-
124
-# define DO_CONNECT(result,sockfd,serv_addr,addrlen) \
125
-	{result = INLINE_SYSCALL(connect,3,sockfd,serv_addr,addrlen);}
126
-
127
-#endif
128
-/* __NR_socketcall */
129
-
130
-
131
-#ifndef _PATH_LOG
132
-# define _PATH_LOG "/dev/log"
133
-#endif
134
-
135
-static const char path_log[]=_PATH_LOG;
136
-
137
-/* For building glibc with SSP switched on, define __progname to a
138
- * constant if building for the run-time loader, to avoid pulling
139
- * in more of libc.so into ld.so
140
- */
141
-#ifdef IS_IN_rtld
142
-static char *__progname = "<rtld>";
143
-#else
144
-extern char *__progname;
145
-#endif
146
-
147
-
148
-/* Common handler code, used by stack_chk_fail and __stack_smash_handler
149
- * Inlined to ensure no self-references to the handler within itself.
150
- * Data static to avoid putting more than necessary on the stack,
151
- * to aid core debugging.
152
- */
153
-static inline void
154
-__attribute__ ((__noreturn__ , __always_inline__))
155
-__hardened_gentoo_stack_chk_fail (char func[], int damaged)
156
-{
157
-#define MESSAGE_BUFSIZ 256
158
-	static pid_t pid;
159
-	static int plen, i;
160
-	static char message[MESSAGE_BUFSIZ];
161
-	static const char msg_ssa[]=": stack smashing attack";
162
-	static const char msg_inf[]=" in function ";
163
-	static const char msg_ssd[]="*** stack smashing detected ***: ";
164
-	static const char msg_terminated[]=" - terminated\n";
165
-	static const char msg_report[]="Report to http://bugs.gentoo.org/\n";
166
-	static const char msg_unknown[]="<unknown>";
167
-#ifdef SSP_SMASH_DUMPS_CORE
168
-	static struct sigaction default_abort_act;
169
-#endif
170
-	static int log_socket, connect_result;
171
-	static struct sockaddr_un sock;
172
-#ifdef __NR_socketcall
173
-	static unsigned long int socketargs[4];
174
-#endif
175
-
176
-	/* Build socket address
177
-	 */
178
-	sock.sun_family = AF_UNIX;
179
-	i=0;
180
-	while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1)))
181
-	  {
182
-		sock.sun_path[i]=path_log[i];
183
-		i++;
184
-	  }
185
-	sock.sun_path[i]='\0';
186
-
187
-	/* Try SOCK_DGRAM connection to syslog */
188
-	connect_result=-1;
189
-	DO_SOCKET(log_socket,AF_UNIX,SOCK_DGRAM,0);
190
-	if (log_socket != -1)
191
-		DO_CONNECT(connect_result,log_socket,(&sock),(sizeof(sock)));
192
-	if (connect_result == -1)
193
-	  {
194
-		if (log_socket != -1)
195
-			INLINE_SYSCALL(close,1,log_socket);
196
-		/* Try SOCK_STREAM connection to syslog */
197
-		DO_SOCKET(log_socket,AF_UNIX,SOCK_STREAM,0);
198
-		if (log_socket != -1)
199
-			DO_CONNECT(connect_result,log_socket,(&sock),(sizeof(sock)));
200
-	  }
201
-
202
-	/* Build message.  Messages are generated both in the old style and new style,
203
-	 * so that log watchers that are configured for the old-style message continue
204
-	 * to work.
205
-	 */
206
-#define strconcat(str) \
207
-		{i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
208
-		{\
209
-			message[plen+i]=str[i];\
210
-			i++;\
211
-		}\
212
-		plen+=i;}
213
-
214
-	/* R.Henderson post-gcc-4 style message */
215
-	plen=0;
216
-	strconcat(msg_ssd);
217
-	if (__progname != (char *)0)
218
-		strconcat(__progname)
219
-	else
220
-		strconcat(msg_unknown);
221
-	strconcat(msg_terminated);
222
-
223
-	/* Write out error message to STDERR, to syslog if open */
224
-	INLINE_SYSCALL(write,3,STDERR_FILENO,message,plen);
225
-	if (connect_result != -1)
226
-		INLINE_SYSCALL(write,3,log_socket,message,plen);
227
-
228
-	/* Dr. Etoh pre-gcc-4 style message */
229
-	plen=0;
230
-	if (__progname != (char *)0)
231
-		strconcat(__progname)
232
-	else
233
-		strconcat(msg_unknown);
234
-	strconcat(msg_ssa);
235
-	strconcat(msg_inf);
236
-	if (func!=NULL)
237
-		strconcat(func)
238
-	else
239
-		strconcat(msg_unknown);
240
-	strconcat(msg_terminated);
241
-	/* Write out error message to STDERR, to syslog if open */
242
-	INLINE_SYSCALL(write,3,STDERR_FILENO,message,plen);
243
-	if (connect_result != -1)
244
-		INLINE_SYSCALL(write,3,log_socket,message,plen);
245
-
246
-	/* Direct reports to bugs.gentoo.org */
247
-	plen=0;
248
-	strconcat(msg_report);
249
-	message[plen++]='\0';
250
-
251
-	/* Write out error message to STDERR, to syslog if open */
252
-	INLINE_SYSCALL(write,3,STDERR_FILENO,message,plen);
253
-	if (connect_result != -1)
254
-		INLINE_SYSCALL(write,3,log_socket,message,plen);
255
-
256
-	if (log_socket != -1)
257
-		INLINE_SYSCALL(close,1,log_socket);
258
-
259
-	/* Suicide */
260
-	pid=INLINE_SYSCALL(getpid,0);
261
-#ifdef SSP_SMASH_DUMPS_CORE
262
-	/* Remove any user-supplied handler for SIGABRT, before using it */
263
-	default_abort_act.sa_handler = SIG_DFL;
264
-	default_abort_act.sa_sigaction = NULL;
265
-	__sigfillset(&default_abort_act.sa_mask);
266
-	default_abort_act.sa_flags = 0;
267
-	/* sigaction doesn't exist on amd64; however rt_sigaction seems to
268
-	 * exist everywhere.  rt_sigaction has an extra parameter - the
269
-	 * size of sigset_t.
270
-	 */
271
-# ifdef __NR_sigation
272
-	if (INLINE_SYSCALL(sigaction,3,SIGABRT,&default_abort_act,NULL) == 0)
273
-# else
274
-	/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
275
-	 * of the _kernel_ sigset_t which is not the same as the user sigset_t.
276
-	 * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
277
-	 * some reason.
278
-	 */
279
-#  ifdef _KERNEL_NSIG
280
-	if (INLINE_SYSCALL(rt_sigaction,4,SIGABRT,&default_abort_act,NULL,_KERNEL_NSIG/8) == 0)
281
-#  else
282
-	if (INLINE_SYSCALL(rt_sigaction,4,SIGABRT,&default_abort_act,NULL,_NSIG/8) == 0)
283
-#  endif
284
-# endif
285
-		INLINE_SYSCALL(kill,2,pid,SIGABRT);
286
-#endif
287
-	/* Note; actions cannot be added to SIGKILL */
288
-	INLINE_SYSCALL(kill,2,pid,SIGKILL);
289
-
290
-	/* In case the kill didn't work, exit anyway
291
-	 * The loop prevents gcc thinking this routine returns
292
-	 */
293
-	while (1) INLINE_SYSCALL(exit,0);
294
-}
295
-
296
-void
297
-__attribute__ ((__noreturn__))
298
-	__stack_chk_fail (void)
299
-{
300
-	__hardened_gentoo_stack_chk_fail(NULL,0);
301
-}
302
-
303
-#ifdef ENABLE_OLD_SSP_COMPAT
304
-void
305
-__attribute__ ((__noreturn__))
306
-__stack_smash_handler(char func[], int damaged)
307
-{
308
-	__hardened_gentoo_stack_chk_fail(func,damaged);
309
-}
310
-#endif
311
-
... ...
@@ -1,29 +0,0 @@
1
-Prevent default-fPIE from confusing configure into thinking
2
-PIC code is default.  This causes glibc to build both PIC and
3
-non-PIC code as normal, which on the hardened compiler generates
4
-PIC and PIE.
5
-
6
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
7
-
8
---- configure.in
9
-+++ configure.in
10
-@@ -2145,7 +2145,7 @@
11
- # error PIC is default.
12
- #endif
13
- EOF
14
--if eval "${CC-cc} -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
15
-+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then
16
-   pic_default=no
17
- fi
18
- rm -f conftest.*])
19
---- configure
20
-+++ configure
21
-@@ -7698,7 +7698,7 @@
22
- # error PIC is default.
23
- #endif
24
- EOF
25
--if eval "${CC-cc} -S conftest.c 2>&5 1>&5"; then
26
-+if eval "${CC-cc} -fno-PIE -S conftest.c 2>&5 1>&5"; then
27
-   pic_default=no
28
- fi
29
- rm -f conftest.*
... ...
@@ -1,283 +0,0 @@
1
-When building glibc PIE (which is not something upstream support),
2
-several modifications are necessary to the glibc build process.
3
-
4
-First, any syscalls in PIEs must be of the PIC variant, otherwise
5
-textrels ensue.  Then, any syscalls made before the initialisation
6
-of the TLS will fail on i386, as the sysenter variant on i386 uses
7
-the TLS, giving rise to a chicken-and-egg situation.  This patch
8
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
9
-version is normally used, and uses the non-sysenter version for the brk
10
-syscall that is performed by the TLS initialisation.  Further, the TLS
11
-initialisation is moved in this case prior to the initialisation of
12
-dl_osversion, as that requires further syscalls.
13
-
14
-csu/libc-start.c: Move initial TLS initialization to before the
15
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
16
-
17
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
18
-INTERNAL_SYSCALL_NOSYSENTER is defined.
19
-
20
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
21
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
22
-
23
-misc/brk.c: Define a no-sysenter version of brk if
24
-INTERNAL_SYSCALL_NOSYSENTER is defined.
25
-
26
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
27
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
28
-
29
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
30
-
31
---- csu/libc-start.c.orig	2007-01-21 11:51:06.000000000 +0100
32
-+++ csu/libc-start.c	2007-01-21 11:55:57.000000000 +0100
33
-@@ -28,6 +28,7 @@
34
- extern int __libc_multiple_libcs;
35
- 
36
- #include <tls.h>
37
-+#include <sysdep.h>
38
- #ifndef SHARED
39
- # include <dl-osinfo.h>
40
- extern void __pthread_initialize_minimal (void)
41
-@@ -133,6 +134,14 @@
42
- #  endif
43
-   _dl_aux_init (auxvec);
44
- # endif
45
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
46
-+  /* Do the initial TLS initialization before _dl_osversion,
47
-+     since the latter uses the uname syscall.  */
48
-+#  if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
49
-+  if (__pthread_initialize_minimal)
50
-+#  endif
51
-+    __pthread_initialize_minimal ();
52
-+# endif
53
- # ifdef DL_SYSDEP_OSCHECK
54
-   if (!__libc_multiple_libcs)
55
-     {
56
-@@ -142,15 +151,17 @@
57
-     }
58
- # endif
59
- 
60
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
61
-   /* Initialize the thread library at least a bit since the libgcc
62
-      functions are using thread functions if these are available and
63
-      we need to setup errno.  If there is no thread library and we
64
-      handle TLS the function is defined in the libc to initialized the
65
-      TLS handling.  */
66
--# if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
67
-+#  if !(USE_TLS - 0) && !defined NONTLS_INIT_TP
68
-   if (__pthread_initialize_minimal)
69
--# endif
70
-+#  endif
71
-     __pthread_initialize_minimal ();
72
-+# endif
73
- #endif
74
- 
75
- # ifndef SHARED
76
---- csu/libc-tls.c.orig	2007-01-21 11:37:02.000000000 +0100
77
-+++ csu/libc-tls.c	2007-01-21 12:09:33.000000000 +0100
78
-@@ -23,6 +23,7 @@
79
- #include <unistd.h>
80
- #include <stdio.h>
81
- #include <sys/param.h>
82
-+#include <sysdep.h>
83
- 
84
- 
85
- #ifdef SHARED
86
-@@ -30,6 +31,9 @@
87
- #endif
88
- 
89
- #ifdef USE_TLS
90
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
91
-+extern void *__sbrk_nosysenter (intptr_t __delta);
92
-+# endif
93
- extern ElfW(Phdr) *_dl_phdr;
94
- extern size_t _dl_phnum;
95
- 
96
-@@ -142,14 +146,26 @@
97
- 
98
-      The initialized value of _dl_tls_static_size is provided by dl-open.c
99
-      to request some surplus that permits dynamic loading of modules with
100
--     IE-model TLS.  */
101
-+     IE-model TLS.
102
-+	 
103
-+	 Where the normal sbrk would use a syscall that needs the TLS (i386)
104
-+	 use the special non-sysenter version instead.  */
105
- # if TLS_TCB_AT_TP
106
-   tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
107
-+#  ifdef INTERNAL_SYSCALL_NOSYSENTER
108
-+  tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
109
-+#  else
110
-   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
111
-+#  endif
112
- # elif TLS_DTV_AT_TP
113
-   tcb_offset = roundup (tcbsize, align ?: 1);
114
-+#  ifdef INTERNAL_SYSCALL_NOSYSENTER
115
-+  tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
116
-+		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
117
-+#  else
118
-   tlsblock = __sbrk (tcb_offset + memsz + max_align
119
- 		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
120
-+#  endif
121
-   tlsblock += TLS_PRE_TCB_SIZE;
122
- # else
123
-   /* In case a model with a different layout for the TCB and DTV
124
---- misc/sbrk.c.orig	2007-01-21 11:38:27.000000000 +0100
125
-+++ misc/sbrk.c	2007-01-21 12:07:29.000000000 +0100
126
-@@ -18,6 +18,7 @@
127
- 
128
- #include <unistd.h>
129
- #include <errno.h>
130
-+#include <sysdep.h>
131
- 
132
- /* Defined in brk.c.  */
133
- extern void *__curbrk;
134
-@@ -29,6 +30,35 @@
135
- /* Extend the process's data space by INCREMENT.
136
-    If INCREMENT is negative, shrink data space by - INCREMENT.
137
-    Return start of new space allocated, or -1 for errors.  */
138
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
139
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
140
-+   if the SYSENTER version requires the TLS (which it does on i386).
141
-+   Obviously using the TLS before it is initialised is broken. */
142
-+extern int __brk_nosysenter (void *addr);
143
-+void *
144
-+__sbrk_nosysenter (intptr_t increment)
145
-+{
146
-+  void *oldbrk;
147
-+
148
-+  /* If this is not part of the dynamic library or the library is used
149
-+     via dynamic loading in a statically linked program update
150
-+     __curbrk from the kernel's brk value.  That way two separate
151
-+     instances of __brk and __sbrk can share the heap, returning
152
-+     interleaved pieces of it.  */
153
-+  if (__curbrk == NULL || __libc_multiple_libcs)
154
-+    if (__brk_nosysenter (0) < 0)		/* Initialize the break.  */
155
-+      return (void *) -1;
156
-+
157
-+  if (increment == 0)
158
-+    return __curbrk;
159
-+
160
-+  oldbrk = __curbrk;
161
-+  if (__brk_nosysenter (oldbrk + increment) < 0)
162
-+    return (void *) -1;
163
-+
164
-+  return oldbrk;
165
-+}
166
-+#endif
167
- void *
168
- __sbrk (intptr_t increment)
169
- {
170
---- sysdeps/unix/sysv/linux/i386/brk.c.orig	2007-01-21 11:39:16.000000000 +0100
171
-+++ sysdeps/unix/sysv/linux/i386/brk.c	2007-01-21 11:44:01.000000000 +0100
172
-@@ -31,6 +31,30 @@
173
-    linker.  */
174
- weak_alias (__curbrk, ___brk_addr)
175
- 
176
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
177
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
178
-+ * if the SYSENTER version requires the TLS (which it does on i386).
179
-+ * Obviously using the TLS before it is initialised is broken. */
180
-+int
181
-+__brk_nosysenter (void *addr)
182
-+{
183
-+  void *__unbounded newbrk;
184
-+
185
-+  INTERNAL_SYSCALL_DECL (err);
186
-+  newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
187
-+						 __ptrvalue (addr));
188
-+
189
-+  __curbrk = newbrk;
190
-+
191
-+  if (newbrk < addr)
192
-+    {
193
-+      __set_errno (ENOMEM);
194
-+      return -1;
195
-+    }
196
-+
197
-+  return 0;
198
-+}
199
-+#endif
200
- int
201
- __brk (void *addr)
202
- {
203
---- sysdeps/unix/sysv/linux/i386/sysdep.h.orig	2007-01-21 13:08:00.000000000 +0100
204
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h	2007-01-21 13:19:10.000000000 +0100
205
-@@ -187,7 +187,7 @@
206
- /* The original calling convention for system calls on Linux/i386 is
207
-    to use int $0x80.  */
208
- #ifdef I386_USE_SYSENTER
209
--# ifdef SHARED
210
-+# if defined SHARED || defined __PIC__
211
- #  define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
212
- # else
213
- #  define ENTER_KERNEL call *_dl_sysinfo
214
-@@ -358,7 +358,7 @@
215
-    possible to use more than four parameters.  */
216
- #undef INTERNAL_SYSCALL
217
- #ifdef I386_USE_SYSENTER
218
--# ifdef SHARED
219
-+# if defined SHARED || defined __PIC__
220
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
221
-   ({									      \
222
-     register unsigned int resultvar;					      \
223
-@@ -384,6 +384,18 @@
224
-     : "0" (name), "i" (offsetof (tcbhead_t, sysinfo))			      \
225
-       ASMFMT_##nr(args) : "memory", "cc");				      \
226
-     (int) resultvar; })
227
-+#  define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
228
-+  ({									      \
229
-+    register unsigned int resultvar;					      \
230
-+    EXTRAVAR_##nr							      \
231
-+    asm volatile (							      \
232
-+    LOADARGS_NOSYSENTER_##nr						      \
233
-+    "movl %1, %%eax\n\t"						      \
234
-+    "int $0x80\n\t"							      \
235
-+    RESTOREARGS_NOSYSENTER_##nr						      \
236
-+    : "=a" (resultvar)							      \
237
-+    : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc");		      \
238
-+    (int) resultvar; })
239
- # else
240
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
241
-   ({									      \
242
-@@ -447,12 +459,20 @@
243
- 
244
- #define LOADARGS_0
245
- #ifdef __PIC__
246
--# if defined I386_USE_SYSENTER && defined SHARED
247
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
248
- #  define LOADARGS_1 \
249
-     "bpushl .L__X'%k3, %k3\n\t"
250
- #  define LOADARGS_5 \
251
-     "movl %%ebx, %4\n\t"						      \
252
-     "movl %3, %%ebx\n\t"
253
-+#  define LOADARGS_NOSYSENTER_1 \
254
-+    "bpushl .L__X'%k2, %k2\n\t"
255
-+#  define LOADARGS_NOSYSENTER_2	LOADARGS_NOSYSENTER_1
256
-+#  define LOADARGS_NOSYSENTER_3	LOADARGS_3
257
-+#  define LOADARGS_NOSYSENTER_4	LOADARGS_3
258
-+#  define LOADARGS_NOSYSENTER_5 \
259
-+    "movl %%ebx, %3\n\t"						      \
260
-+    "movl %2, %%ebx\n\t"
261
- # else
262
- #  define LOADARGS_1 \
263
-     "bpushl .L__X'%k2, %k2\n\t"
264
-@@ -474,11 +495,18 @@
265
- 
266
- #define RESTOREARGS_0
267
- #ifdef __PIC__
268
--# if defined I386_USE_SYSENTER && defined SHARED
269
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
270
- #  define RESTOREARGS_1 \
271
-     "bpopl .L__X'%k3, %k3\n\t"
272
- #  define RESTOREARGS_5 \
273
-     "movl %4, %%ebx"
274
-+#  define RESTOREARGS_NOSYSENTER_1 \
275
-+    "bpopl .L__X'%k2, %k2\n\t"
276
-+#  define RESTOREARGS_NOSYSENTER_2	RESTOREARGS_NOSYSENTER_1
277
-+#  define RESTOREARGS_NOSYSENTER_3	RESTOREARGS_3
278
-+#  define RESTOREARGS_NOSYSENTER_4	RESTOREARGS_3
279
-+#  define RESTOREARGS_NOSYSENTER_5 \
280
-+    "movl %3, %%ebx"
281
- # else
282
- #  define RESTOREARGS_1 \
283
-     "bpopl .L__X'%k2, %k2\n\t"
... ...
@@ -1,39 +0,0 @@
1
-Change link commands for glibc executables to build PIEs
2
-
3
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
4
-
5
---- Makeconfig
6
-+++ Makeconfig
7
-@@ -415,10 +415,10 @@
8
- 
9
- # Command for linking programs with the C library.
10
- ifndef +link
11
--+link = $(CC) -nostdlib -nostartfiles -o $@ \
12
-++link = $(CC) -nostdlib -nostartfiles -fPIE -pie -o $@ \
13
- 	      $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
14
- 	      $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
15
--	      $(addprefix $(csu-objpfx),$(start-installed-name)) \
16
-+	      $(addprefix $(csu-objpfx),S$(start-installed-name)) \
17
- 	      $(+preinit) $(+prector) \
18
- 	      $(filter-out $(addprefix $(csu-objpfx),start.o \
19
- 						     $(start-installed-name))\
20
-@@ -429,7 +429,7 @@
21
- ifndef +link-static
22
- +link-static = $(CC) -nostdlib -nostartfiles -static -o $@ \
23
- 	      $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F))  \
24
--	      $(addprefix $(csu-objpfx),$(static-start-installed-name)) \
25
-+	      $(addprefix $(csu-objpfx),S$(static-start-installed-name)) \
26
- 	      $(+preinit) $(+prector) \
27
- 	      $(filter-out $(addprefix $(csu-objpfx),start.o \
28
- 						     $(start-installed-name))\
29
-@@ -528,8 +528,8 @@
30
- ifeq ($(elf),yes)
31
- +preinit = $(addprefix $(csu-objpfx),crti.o)
32
- +postinit = $(addprefix $(csu-objpfx),crtn.o)
33
--+prector = `$(CC) --print-file-name=crtbegin.o`
34
--+postctor = `$(CC) --print-file-name=crtend.o`
35
-++prector = `$(CC) --print-file-name=crtbeginS.o`
36
-++postctor = `$(CC) --print-file-name=crtendS.o`
37
- +interp = $(addprefix $(elf-objpfx),interp.os)
38
- endif
39
- csu-objpfx = $(common-objpfx)csu/
... ...
@@ -1,321 +0,0 @@
1
-/* Copyright (C) 2005 Free Software Foundation, Inc.
2
-   This file is part of the GNU C Library.
3
-
4
-   The GNU C Library is free software; you can redistribute it and/or
5
-   modify it under the terms of the GNU Lesser General Public
6
-   License as published by the Free Software Foundation; either
7
-   version 2.1 of the License, or (at your option) any later version.
8
-
9
-   The GNU C Library is distributed in the hope that it will be useful,
10
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
-   Lesser General Public License for more details.
13
-
14
-   You should have received a copy of the GNU Lesser General Public
15
-   License along with the GNU C Library; if not, write to the Free
16
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17
-   02111-1307 USA.  */
18
-
19
-/* Copyright (C) 2006-2007 Gentoo Foundation Inc.
20
- * License terms as above.
21
- *
22
- * Hardened Gentoo SSP handler
23
- *
24
- * An SSP failure handler that does not use functions from the rest of
25
- * glibc; it uses the INTERNAL_SYSCALL methods directly.  This ensures
26
- * no possibility of recursion into the handler.
27
- *
28
- * Direct all bug reports to http://bugs.gentoo.org/
29
- *
30
- * Re-written from the glibc-2.3 Hardened Gentoo SSP handler
31
- * by Kevin F. Quinn - <kevquinn[@]gentoo.org>
32
- *
33
- * The following people contributed to the glibc-2.3 Hardened
34
- * Gentoo SSP handler, from which this implementation draws much:
35
- *
36
- * Ned Ludd - <solar[@]gentoo.org>
37
- * Alexander Gabert - <pappy[@]gentoo.org>
38
- * The PaX Team - <pageexec[@]freemail.hu>
39
- * Peter S. Mazinger - <ps.m[@]gmx.net>
40
- * Yoann Vandoorselaere - <yoann[@]prelude-ids.org>
41
- * Robert Connolly - <robert[@]linuxfromscratch.org>
42
- * Cory Visi <cory[@]visi.name>
43
- * Mike Frysinger <vapier[@]gentoo.org>
44
- */
45
-
46
-#include <errno.h>
47
-#include <stdlib.h>
48
-#include <unistd.h>
49
-#include <signal.h>
50
-
51
-#include <sys/types.h>
52
-
53
-#include <sysdep-cancel.h>
54
-#include <sys/syscall.h>
55
-#include <bp-checks.h>
56
-
57
-#include <kernel-features.h>
58
-
59
-#include <alloca.h>
60
-/* from sysdeps */
61
-#include <socketcall.h>
62
-/* for the stuff in bits/socket.h */
63
-#include <sys/socket.h>
64
-#include <sys/un.h>
65
-
66
-
67
-/* Sanity check on SYSCALL macro names - force compilation
68
- * failure if the names used here do not exist
69
- */
70
-#if !defined __NR_socketcall && !defined __NR_socket
71
-# error Cannot do syscall socket or socketcall
72
-#endif
73
-#if !defined __NR_socketcall && !defined __NR_connect
74
-# error Cannot do syscall connect or socketcall
75
-#endif
76
-#ifndef __NR_write
77
-# error Cannot do syscall write
78
-#endif
79
-#ifndef __NR_close
80
-# error Cannot do syscall close
81
-#endif
82
-#ifndef __NR_getpid
83
-# error Cannot do syscall getpid
84
-#endif
85
-#ifndef __NR_kill
86
-# error Cannot do syscall kill
87
-#endif
88
-#ifndef __NR_exit
89
-# error Cannot do syscall exit
90
-#endif
91
-#ifdef SSP_SMASH_DUMPS_CORE
92
-# define ENABLE_SSP_SMASH_DUMPS_CORE 1
93
-# if !defined _KERNEL_NSIG && !defined _NSIG
94
-#  error No _NSIG or _KERNEL_NSIG for rt_sigaction
95
-# endif
96
-# if !defined __NR_sigaction && !defined __NR_rt_sigaction
97
-#  error Cannot do syscall sigaction or rt_sigaction
98
-# endif
99
-/* Although rt_sigaction expects sizeof(sigset_t) - it expects the size
100
- * of the _kernel_ sigset_t which is not the same as the user sigset_t.
101
- * Most arches have this as _NSIG bits - mips has _KERNEL_NSIG bits for
102
- * some reason.
103
- */
104
-# ifdef _KERNEL_NSIG
105
-#  define _SSP_NSIG _KERNEL_NSIG
106
-# else
107
-#  define _SSP_NSIG _NSIG
108
-# endif
109
-#else
110
-# define _SSP_NSIG 0
111
-# define ENABLE_SSP_SMASH_DUMPS_CORE 0
112
-#endif
113
-
114
-/* Define DO_SIGACTION - default to newer rt signal interface but
115
- * fallback to old as needed.
116
- */
117
-#ifdef __NR_rt_sigaction
118
-# define DO_SIGACTION(signum, act, oldact) \
119
-	INLINE_SYSCALL(rt_sigaction, 4, signum, act, oldact, _SSP_NSIG/8)
120
-#else
121
-# define DO_SIGACTION(signum, act, oldact) \
122
-	INLINE_SYSCALL(sigaction, 3, signum, act, oldact)
123
-#endif
124
-
125
-/* Define DO_SOCKET/DO_CONNECT functions to deal with socketcall vs socket/connect */
126
-#if defined(__NR_socket) && defined(__NR_connect)
127
-# define USE_OLD_SOCKETCALL 0
128
-#else
129
-# define USE_OLD_SOCKETCALL 1
130
-#endif
131
-/* stub out the __NR_'s so we can let gcc optimize away dead code */
132
-#ifndef __NR_socketcall
133
-# define __NR_socketcall 0
134
-#endif
135
-#ifndef __NR_socket
136
-# define __NR_socket 0
137
-#endif
138
-#ifndef __NR_connect
139
-# define __NR_connect 0
140
-#endif
141
-#define DO_SOCKET(result, domain, type, protocol) \
142
-	do { \
143
-		if (USE_OLD_SOCKETCALL) { \
144
-			socketargs[0] = domain; \
145
-			socketargs[1] = type; \
146
-			socketargs[2] = protocol; \
147
-			socketargs[3] = 0; \
148
-			result = INLINE_SYSCALL(socketcall, 2, SOCKOP_socket, socketargs); \
149
-		} else \
150
-			result = INLINE_SYSCALL(socket, 3, domain, type, protocol); \
151
-	} while (0)
152
-#define DO_CONNECT(result, sockfd, serv_addr, addrlen) \
153
-	do { \
154
-		if (USE_OLD_SOCKETCALL) { \
155
-			socketargs[0] = sockfd; \
156
-			socketargs[1] = (unsigned long int)serv_addr; \
157
-			socketargs[2] = addrlen; \
158
-			socketargs[3] = 0; \
159
-			result = INLINE_SYSCALL(socketcall, 2, SOCKOP_connect, socketargs); \
160
-		} else \
161
-			result = INLINE_SYSCALL(connect, 3, sockfd, serv_addr, addrlen); \
162
-	} while (0)
163
-
164
-#ifndef _PATH_LOG
165
-# define _PATH_LOG "/dev/log"
166
-#endif
167
-
168
-static const char path_log[] = _PATH_LOG;
169
-
170
-/* For building glibc with SSP switched on, define __progname to a
171
- * constant if building for the run-time loader, to avoid pulling
172
- * in more of libc.so into ld.so
173
- */
174
-#ifdef IS_IN_rtld
175
-static char *__progname = "<rtld>";
176
-#else
177
-extern char *__progname;
178
-#endif
179
-
180
-
181
-/* Common handler code, used by stack_chk_fail and __stack_smash_handler
182
- * Inlined to ensure no self-references to the handler within itself.
183
- * Data static to avoid putting more than necessary on the stack,
184
- * to aid core debugging.
185
- */
186
-__attribute__ ((__noreturn__ , __always_inline__))
187
-static inline void
188
-__hardened_gentoo_stack_chk_fail(char func[], int damaged)
189
-{
190
-#define MESSAGE_BUFSIZ 256
191
-	static pid_t pid;
192
-	static int plen, i;
193
-	static char message[MESSAGE_BUFSIZ];
194
-	static const char msg_ssa[] = ": stack smashing attack";
195
-	static const char msg_inf[] = " in function ";
196
-	static const char msg_ssd[] = "*** stack smashing detected ***: ";
197
-	static const char msg_terminated[] = " - terminated\n";
198
-	static const char msg_report[] = "Report to http://bugs.gentoo.org/\n";
199
-	static const char msg_unknown[] = "<unknown>";
200
-	static int log_socket, connect_result;
201
-	static struct sockaddr_un sock;
202
-	static unsigned long int socketargs[4];
203
-
204
-	/* Build socket address
205
-	 */
206
-	sock.sun_family = AF_UNIX;
207
-	i = 0;
208
-	while ((path_log[i] != '\0') && (i<(sizeof(sock.sun_path)-1))) {
209
-		sock.sun_path[i] = path_log[i];
210
-		i++;
211
-	}
212
-	sock.sun_path[i] = '\0';
213
-
214
-	/* Try SOCK_DGRAM connection to syslog */
215
-	connect_result = -1;
216
-	DO_SOCKET(log_socket, AF_UNIX, SOCK_DGRAM, 0);
217
-	if (log_socket != -1)
218
-		DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
219
-	if (connect_result == -1) {
220
-		if (log_socket != -1)
221
-			INLINE_SYSCALL(close, 1, log_socket);
222
-		/* Try SOCK_STREAM connection to syslog */
223
-		DO_SOCKET(log_socket, AF_UNIX, SOCK_STREAM, 0);
224
-		if (log_socket != -1)
225
-			DO_CONNECT(connect_result, log_socket, &sock, sizeof(sock));
226
-	}
227
-
228
-	/* Build message.  Messages are generated both in the old style and new style,
229
-	 * so that log watchers that are configured for the old-style message continue
230
-	 * to work.
231
-	 */
232
-#define strconcat(str) \
233
-		{i=0; while ((str[i] != '\0') && ((i+plen)<(MESSAGE_BUFSIZ-1))) \
234
-		{\
235
-			message[plen+i]=str[i];\
236
-			i++;\
237
-		}\
238
-		plen+=i;}
239
-
240
-	/* R.Henderson post-gcc-4 style message */
241
-	plen = 0;
242
-	strconcat(msg_ssd);
243
-	if (__progname != (char *)0)
244
-		strconcat(__progname)
245
-	else
246
-		strconcat(msg_unknown);
247
-	strconcat(msg_terminated);
248
-
249
-	/* Write out error message to STDERR, to syslog if open */
250
-	INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
251
-	if (connect_result != -1)
252
-		INLINE_SYSCALL(write, 3, log_socket, message, plen);
253
-
254
-	/* Dr. Etoh pre-gcc-4 style message */
255
-	plen = 0;
256
-	if (__progname != (char *)0)
257
-		strconcat(__progname)
258
-	else
259
-		strconcat(msg_unknown);
260
-	strconcat(msg_ssa);
261
-	strconcat(msg_inf);
262
-	if (func != NULL)
263
-		strconcat(func)
264
-	else
265
-		strconcat(msg_unknown);
266
-	strconcat(msg_terminated);
267
-	/* Write out error message to STDERR, to syslog if open */
268
-	INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
269
-	if (connect_result != -1)
270
-		INLINE_SYSCALL(write, 3, log_socket, message, plen);
271
-
272
-	/* Direct reports to bugs.gentoo.org */
273
-	plen=0;
274
-	strconcat(msg_report);
275
-	message[plen++]='\0';
276
-
277
-	/* Write out error message to STDERR, to syslog if open */
278
-	INLINE_SYSCALL(write, 3, STDERR_FILENO, message, plen);
279
-	if (connect_result != -1)
280
-		INLINE_SYSCALL(write, 3, log_socket, message, plen);
281
-
282
-	if (log_socket != -1)
283
-		INLINE_SYSCALL(close, 1, log_socket);
284
-
285
-	/* Suicide */
286
-	pid = INLINE_SYSCALL(getpid, 0);
287
-
288
-	if (ENABLE_SSP_SMASH_DUMPS_CORE) {
289
-		static struct sigaction default_abort_act;
290
-		/* Remove any user-supplied handler for SIGABRT, before using it */
291
-		default_abort_act.sa_handler = SIG_DFL;
292
-		default_abort_act.sa_sigaction = NULL;
293
-		__sigfillset(&default_abort_act.sa_mask);
294
-		default_abort_act.sa_flags = 0;
295
-		if (DO_SIGACTION(SIGABRT, &default_abort_act, NULL) == 0)
296
-			INLINE_SYSCALL(kill, 2, pid, SIGABRT);
297
-	}
298
-
299
-	/* Note; actions cannot be added to SIGKILL */
300
-	INLINE_SYSCALL(kill, 2, pid, SIGKILL);
301
-
302
-	/* In case the kill didn't work, exit anyway
303
-	 * The loop prevents gcc thinking this routine returns
304
-	 */
305
-	while (1)
306
-		INLINE_SYSCALL(exit, 0);
307
-}
308
-
309
-__attribute__ ((__noreturn__))
310
-void __stack_chk_fail(void)
311
-{
312
-	__hardened_gentoo_stack_chk_fail(NULL, 0);
313
-}
314
-
315
-#ifdef ENABLE_OLD_SSP_COMPAT
316
-__attribute__ ((__noreturn__))
317
-void __stack_smash_handler(char func[], int damaged)
318
-{
319
-	__hardened_gentoo_stack_chk_fail(func, damaged);
320
-}
321
-#endif
... ...
@@ -1,273 +0,0 @@
1
-When building glibc PIE (which is not something upstream support),
2
-several modifications are necessary to the glibc build process.
3
-
4
-First, any syscalls in PIEs must be of the PIC variant, otherwise
5
-textrels ensue.  Then, any syscalls made before the initialisation
6
-of the TLS will fail on i386, as the sysenter variant on i386 uses
7
-the TLS, giving rise to a chicken-and-egg situation.  This patch
8
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
9
-version is normally used, and uses the non-sysenter version for the brk
10
-syscall that is performed by the TLS initialisation.  Further, the TLS
11
-initialisation is moved in this case prior to the initialisation of
12
-dl_osversion, as that requires further syscalls.
13
-
14
-csu/libc-start.c: Move initial TLS initialization to before the
15
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
16
-
17
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
18
-INTERNAL_SYSCALL_NOSYSENTER is defined.
19
-
20
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
21
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
22
-
23
-misc/brk.c: Define a no-sysenter version of brk if
24
-INTERNAL_SYSCALL_NOSYSENTER is defined.
25
-
26
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
27
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
28
-
29
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
30
-
31
---- csu/libc-start.c
32
-+++ csu/libc-start.c
33
-@@ -28,6 +28,7 @@
34
- extern int __libc_multiple_libcs;
35
- 
36
- #include <tls.h>
37
-+#include <sysdep.h>
38
- #ifndef SHARED
39
- # include <dl-osinfo.h>
40
- extern void __pthread_initialize_minimal (void);
41
-@@ -129,6 +130,11 @@
42
- #  endif
43
-   _dl_aux_init (auxvec);
44
- # endif
45
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
46
-+  /* Do the initial TLS initialization before _dl_osversion,
47
-+     since the latter uses the uname syscall.  */
48
-+  __pthread_initialize_minimal ();
49
-+# endif
50
- # ifdef DL_SYSDEP_OSCHECK
51
-   if (!__libc_multiple_libcs)
52
-     {
53
-@@ -138,10 +144,12 @@
54
-     }
55
- # endif
56
- 
57
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
58
-   /* Initialize the thread library at least a bit since the libgcc
59
-      functions are using thread functions if these are available and
60
-      we need to setup errno.  */
61
-   __pthread_initialize_minimal ();
62
-+# endif
63
- #endif
64
- 
65
- # ifndef SHARED
66
---- csu/libc-tls.c
67
-+++ csu/libc-tls.c
68
-@@ -23,6 +23,7 @@
69
- #include <unistd.h>
70
- #include <stdio.h>
71
- #include <sys/param.h>
72
-+#include <sysdep.h>
73
- 
74
- 
75
- #ifdef SHARED
76
-@@ -29,6 +30,9 @@
77
-  #error makefile bug, this file is for static only
78
- #endif
79
- 
80
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
81
-+extern void *__sbrk_nosysenter (intptr_t __delta);
82
-+#endif
83
- extern ElfW(Phdr) *_dl_phdr;
84
- extern size_t _dl_phnum;
85
- 
86
-@@ -141,14 +145,26 @@
87
- 
88
-      The initialized value of _dl_tls_static_size is provided by dl-open.c
89
-      to request some surplus that permits dynamic loading of modules with
90
--     IE-model TLS.  */
91
-+     IE-model TLS.
92
-+     
93
-+     Where the normal sbrk would use a syscall that needs the TLS (i386)
94
-+     use the special non-sysenter version instead.  */
95
- #if TLS_TCB_AT_TP
96
-   tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
97
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
98
-+  tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
99
-+# else
100
-   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
101
-+# endif
102
- #elif TLS_DTV_AT_TP
103
-   tcb_offset = roundup (tcbsize, align ?: 1);
104
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
105
-+  tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
106
-+		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
107
-+# else
108
-   tlsblock = __sbrk (tcb_offset + memsz + max_align
109
- 		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
110
-+# endif
111
-   tlsblock += TLS_PRE_TCB_SIZE;
112
- #else
113
-   /* In case a model with a different layout for the TCB and DTV
114
---- misc/sbrk.c
115
-+++ misc/sbrk.c
116
-@@ -18,6 +18,7 @@
117
- 
118
- #include <unistd.h>
119
- #include <errno.h>
120
-+#include <sysdep.h>
121
- 
122
- /* Defined in brk.c.  */
123
- extern void *__curbrk;
124
-@@ -29,6 +30,35 @@
125
- /* Extend the process's data space by INCREMENT.
126
-    If INCREMENT is negative, shrink data space by - INCREMENT.
127
-    Return start of new space allocated, or -1 for errors.  */
128
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
129
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
130
-+   if the SYSENTER version requires the TLS (which it does on i386).
131
-+   Obviously using the TLS before it is initialised is broken. */
132
-+extern int __brk_nosysenter (void *addr);
133
-+void *
134
-+__sbrk_nosysenter (intptr_t increment)
135
-+{
136
-+  void *oldbrk;
137
-+
138
-+  /* If this is not part of the dynamic library or the library is used
139
-+     via dynamic loading in a statically linked program update
140
-+     __curbrk from the kernel's brk value.  That way two separate
141
-+     instances of __brk and __sbrk can share the heap, returning
142
-+     interleaved pieces of it.  */
143
-+  if (__curbrk == NULL || __libc_multiple_libcs)
144
-+    if (__brk_nosysenter (0) < 0)		/* Initialize the break.  */
145
-+      return (void *) -1;
146
-+
147
-+  if (increment == 0)
148
-+    return __curbrk;
149
-+
150
-+  oldbrk = __curbrk;
151
-+  if (__brk_nosysenter (oldbrk + increment) < 0)
152
-+    return (void *) -1;
153
-+
154
-+  return oldbrk;
155
-+}
156
-+#endif
157
- void *
158
- __sbrk (intptr_t increment)
159
- {
160
---- sysdeps/unix/sysv/linux/i386/brk.c
161
-+++ sysdeps/unix/sysv/linux/i386/brk.c
162
-@@ -31,6 +31,30 @@
163
-    linker.  */
164
- weak_alias (__curbrk, ___brk_addr)
165
- 
166
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
167
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
168
-+ * if the SYSENTER version requires the TLS (which it does on i386).
169
-+ * Obviously using the TLS before it is initialised is broken. */
170
-+int
171
-+__brk_nosysenter (void *addr)
172
-+{
173
-+  void *__unbounded newbrk;
174
-+
175
-+  INTERNAL_SYSCALL_DECL (err);
176
-+  newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
177
-+						 __ptrvalue (addr));
178
-+
179
-+  __curbrk = newbrk;
180
-+
181
-+  if (newbrk < addr)
182
-+    {
183
-+      __set_errno (ENOMEM);
184
-+      return -1;
185
-+    }
186
-+
187
-+  return 0;
188
-+}
189
-+#endif
190
- int
191
- __brk (void *addr)
192
- {
193
---- sysdeps/unix/sysv/linux/i386/sysdep.h
194
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h
195
-@@ -187,7 +187,7 @@
196
- /* The original calling convention for system calls on Linux/i386 is
197
-    to use int $0x80.  */
198
- #ifdef I386_USE_SYSENTER
199
--# ifdef SHARED
200
-+# if defined SHARED || defined __PIC__
201
- #  define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
202
- # else
203
- #  define ENTER_KERNEL call *_dl_sysinfo
204
-@@ -358,7 +358,7 @@
205
-    possible to use more than four parameters.  */
206
- #undef INTERNAL_SYSCALL
207
- #ifdef I386_USE_SYSENTER
208
--# ifdef SHARED
209
-+# if defined SHARED || defined __PIC__
210
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
211
-   ({									      \
212
-     register unsigned int resultvar;					      \
213
-@@ -384,6 +384,18 @@
214
-     : "0" (name), "i" (offsetof (tcbhead_t, sysinfo))			      \
215
-       ASMFMT_##nr(args) : "memory", "cc");				      \
216
-     (int) resultvar; })
217
-+#  define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
218
-+  ({									      \
219
-+    register unsigned int resultvar;					      \
220
-+    EXTRAVAR_##nr							      \
221
-+    asm volatile (							      \
222
-+    LOADARGS_NOSYSENTER_##nr						      \
223
-+    "movl %1, %%eax\n\t"						      \
224
-+    "int $0x80\n\t"							      \
225
-+    RESTOREARGS_NOSYSENTER_##nr						      \
226
-+    : "=a" (resultvar)							      \
227
-+    : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc");		      \
228
-+    (int) resultvar; })
229
- # else
230
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
231
-   ({									      \
232
-@@ -447,12 +459,20 @@
233
- 
234
- #define LOADARGS_0
235
- #ifdef __PIC__
236
--# if defined I386_USE_SYSENTER && defined SHARED
237
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
238
- #  define LOADARGS_1 \
239
-     "bpushl .L__X'%k3, %k3\n\t"
240
- #  define LOADARGS_5 \
241
-     "movl %%ebx, %4\n\t"						      \
242
-     "movl %3, %%ebx\n\t"
243
-+#  define LOADARGS_NOSYSENTER_1 \
244
-+    "bpushl .L__X'%k2, %k2\n\t"
245
-+#  define LOADARGS_NOSYSENTER_2	LOADARGS_NOSYSENTER_1
246
-+#  define LOADARGS_NOSYSENTER_3	LOADARGS_3
247
-+#  define LOADARGS_NOSYSENTER_4	LOADARGS_3
248
-+#  define LOADARGS_NOSYSENTER_5 \
249
-+    "movl %%ebx, %3\n\t"						      \
250
-+    "movl %2, %%ebx\n\t"
251
- # else
252
- #  define LOADARGS_1 \
253
-     "bpushl .L__X'%k2, %k2\n\t"
254
-@@ -474,11 +495,18 @@
255
- 
256
- #define RESTOREARGS_0
257
- #ifdef __PIC__
258
--# if defined I386_USE_SYSENTER && defined SHARED
259
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
260
- #  define RESTOREARGS_1 \
261
-     "bpopl .L__X'%k3, %k3\n\t"
262
- #  define RESTOREARGS_5 \
263
-     "movl %4, %%ebx"
264
-+#  define RESTOREARGS_NOSYSENTER_1 \
265
-+    "bpopl .L__X'%k2, %k2\n\t"
266
-+#  define RESTOREARGS_NOSYSENTER_2	RESTOREARGS_NOSYSENTER_1
267
-+#  define RESTOREARGS_NOSYSENTER_3	RESTOREARGS_3
268
-+#  define RESTOREARGS_NOSYSENTER_4	RESTOREARGS_3
269
-+#  define RESTOREARGS_NOSYSENTER_5 \
270
-+    "movl %3, %%ebx"
271
- # else
272
- #  define RESTOREARGS_1 \
273
-     "bpopl .L__X'%k2, %k2\n\t"
... ...
@@ -1,273 +0,0 @@
1
-When building glibc PIE (which is not something upstream support),
2
-several modifications are necessary to the glibc build process.
3
-
4
-First, any syscalls in PIEs must be of the PIC variant, otherwise
5
-textrels ensue.  Then, any syscalls made before the initialisation
6
-of the TLS will fail on i386, as the sysenter variant on i386 uses
7
-the TLS, giving rise to a chicken-and-egg situation.  This patch
8
-defines a PIC syscall variant that doesn't use sysenter, even when the sysenter
9
-version is normally used, and uses the non-sysenter version for the brk
10
-syscall that is performed by the TLS initialisation.  Further, the TLS
11
-initialisation is moved in this case prior to the initialisation of
12
-dl_osversion, as that requires further syscalls.
13
-
14
-csu/libc-start.c: Move initial TLS initialization to before the
15
-initialisation of dl_osversion, when INTERNAL_SYSCALL_NOSYSENTER is defined
16
-
17
-csu/libc-tls.c: Use the no-sysenter version of sbrk when
18
-INTERNAL_SYSCALL_NOSYSENTER is defined.
19
-
20
-misc/sbrk.c: Define a no-sysenter version of sbrk, using the no-sysenter
21
-version of brk - if INTERNAL_SYSCALL_NOSYSENTER is defined.
22
-
23
-misc/brk.c: Define a no-sysenter version of brk if
24
-INTERNAL_SYSCALL_NOSYSENTER is defined.
25
-
26
-sysdeps/unix/sysv/linux/i386/sysdep.h: Define INTERNAL_SYSCALL_NOSYSENTER
27
-Make INTERNAL_SYSCALL always use the PIC variant, even if not SHARED.
28
-
29
-Patch by Kevin F. Quinn <kevquinn@gentoo.org>
30
-
31
---- csu/libc-start.c
32
-+++ csu/libc-start.c
33
-@@ -28,6 +28,7 @@
34
- extern int __libc_multiple_libcs;
35
- 
36
- #include <tls.h>
37
-+#include <sysdep.h>
38
- #ifndef SHARED
39
- # include <dl-osinfo.h>
40
- extern void __pthread_initialize_minimal (void);
41
-@@ -129,6 +130,11 @@
42
- #  endif
43
-   _dl_aux_init (auxvec);
44
- # endif
45
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
46
-+  /* Do the initial TLS initialization before _dl_osversion,
47
-+     since the latter uses the uname syscall.  */
48
-+  __pthread_initialize_minimal ();
49
-+# endif
50
- # ifdef DL_SYSDEP_OSCHECK
51
-   if (!__libc_multiple_libcs)
52
-     {
53
-@@ -138,10 +144,12 @@
54
-     }
55
- # endif
56
- 
57
-+# ifndef INTERNAL_SYSCALL_NOSYSENTER
58
-   /* Initialize the thread library at least a bit since the libgcc
59
-      functions are using thread functions if these are available and
60
-      we need to setup errno.  */
61
-   __pthread_initialize_minimal ();
62
-+# endif
63
- 
64
-   /* Set up the stack checker's canary.  */
65
-   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
66
---- csu/libc-tls.c
67
-+++ csu/libc-tls.c
68
-@@ -23,6 +23,7 @@
69
- #include <unistd.h>
70
- #include <stdio.h>
71
- #include <sys/param.h>
72
-+#include <sysdep.h>
73
- 
74
- 
75
- #ifdef SHARED
76
-@@ -29,6 +30,9 @@
77
-  #error makefile bug, this file is for static only
78
- #endif
79
- 
80
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
81
-+extern void *__sbrk_nosysenter (intptr_t __delta);
82
-+#endif
83
- extern ElfW(Phdr) *_dl_phdr;
84
- extern size_t _dl_phnum;
85
- 
86
-@@ -141,14 +145,26 @@
87
- 
88
-      The initialized value of _dl_tls_static_size is provided by dl-open.c
89
-      to request some surplus that permits dynamic loading of modules with
90
--     IE-model TLS.  */
91
-+     IE-model TLS.
92
-+     
93
-+     Where the normal sbrk would use a syscall that needs the TLS (i386)
94
-+     use the special non-sysenter version instead.  */
95
- #if TLS_TCB_AT_TP
96
-   tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
97
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
98
-+  tlsblock = __sbrk_nosysenter (tcb_offset + tcbsize + max_align);
99
-+# else
100
-   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
101
-+# endif
102
- #elif TLS_DTV_AT_TP
103
-   tcb_offset = roundup (tcbsize, align ?: 1);
104
-+# ifdef INTERNAL_SYSCALL_NOSYSENTER
105
-+  tlsblock = __sbrk_nosysenter (tcb_offset + memsz + max_align
106
-+		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
107
-+# else
108
-   tlsblock = __sbrk (tcb_offset + memsz + max_align
109
- 		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
110
-+# endif
111
-   tlsblock += TLS_PRE_TCB_SIZE;
112
- #else
113
-   /* In case a model with a different layout for the TCB and DTV
114
---- misc/sbrk.c
115
-+++ misc/sbrk.c
116
-@@ -18,6 +18,7 @@
117
- 
118
- #include <unistd.h>
119
- #include <errno.h>
120
-+#include <sysdep.h>
121
- 
122
- /* Defined in brk.c.  */
123
- extern void *__curbrk;
124
-@@ -29,6 +30,35 @@
125
- /* Extend the process's data space by INCREMENT.
126
-    If INCREMENT is negative, shrink data space by - INCREMENT.
127
-    Return start of new space allocated, or -1 for errors.  */
128
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
129
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
130
-+   if the SYSENTER version requires the TLS (which it does on i386).
131
-+   Obviously using the TLS before it is initialised is broken. */
132
-+extern int __brk_nosysenter (void *addr);
133
-+void *
134
-+__sbrk_nosysenter (intptr_t increment)
135
-+{
136
-+  void *oldbrk;
137
-+
138
-+  /* If this is not part of the dynamic library or the library is used
139
-+     via dynamic loading in a statically linked program update
140
-+     __curbrk from the kernel's brk value.  That way two separate
141
-+     instances of __brk and __sbrk can share the heap, returning
142
-+     interleaved pieces of it.  */
143
-+  if (__curbrk == NULL || __libc_multiple_libcs)
144
-+    if (__brk_nosysenter (0) < 0)		/* Initialize the break.  */
145
-+      return (void *) -1;
146
-+
147
-+  if (increment == 0)
148
-+    return __curbrk;
149
-+
150
-+  oldbrk = __curbrk;
151
-+  if (__brk_nosysenter (oldbrk + increment) < 0)
152
-+    return (void *) -1;
153
-+
154
-+  return oldbrk;
155
-+}
156
-+#endif
157
- void *
158
- __sbrk (intptr_t increment)
159
- {
160
---- sysdeps/unix/sysv/linux/i386/brk.c
161
-+++ sysdeps/unix/sysv/linux/i386/brk.c
162
-@@ -31,6 +31,30 @@
163
-    linker.  */
164
- weak_alias (__curbrk, ___brk_addr)
165
- 
166
-+#ifdef INTERNAL_SYSCALL_NOSYSENTER
167
-+/* This version is used by csu/libc-tls.c whem initialising the TLS
168
-+ * if the SYSENTER version requires the TLS (which it does on i386).
169
-+ * Obviously using the TLS before it is initialised is broken. */
170
-+int
171
-+__brk_nosysenter (void *addr)
172
-+{
173
-+  void *__unbounded newbrk;
174
-+
175
-+  INTERNAL_SYSCALL_DECL (err);
176
-+  newbrk = (void *__unbounded) INTERNAL_SYSCALL_NOSYSENTER (brk, err, 1,
177
-+						 __ptrvalue (addr));
178
-+
179
-+  __curbrk = newbrk;
180
-+
181
-+  if (newbrk < addr)
182
-+    {
183
-+      __set_errno (ENOMEM);
184
-+      return -1;
185
-+    }
186
-+
187
-+  return 0;
188
-+}
189
-+#endif
190
- int
191
- __brk (void *addr)
192
- {
193
---- sysdeps/unix/sysv/linux/i386/sysdep.h
194
-+++ sysdeps/unix/sysv/linux/i386/sysdep.h
195
-@@ -187,7 +187,7 @@
196
- /* The original calling convention for system calls on Linux/i386 is
197
-    to use int $0x80.  */
198
- #ifdef I386_USE_SYSENTER
199
--# ifdef SHARED
200
-+# if defined SHARED || defined __PIC__
201
- #  define ENTER_KERNEL call *%gs:SYSINFO_OFFSET
202
- # else
203
- #  define ENTER_KERNEL call *_dl_sysinfo
204
-@@ -358,7 +358,7 @@
205
-    possible to use more than four parameters.  */
206
- #undef INTERNAL_SYSCALL
207
- #ifdef I386_USE_SYSENTER
208
--# ifdef SHARED
209
-+# if defined SHARED || defined __PIC__
210
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
211
-   ({									      \
212
-     register unsigned int resultvar;					      \
213
-@@ -384,6 +384,18 @@
214
-     : "0" (name), "i" (offsetof (tcbhead_t, sysinfo))			      \
215
-       ASMFMT_##nr(args) : "memory", "cc");				      \
216
-     (int) resultvar; })
217
-+#  define INTERNAL_SYSCALL_NOSYSENTER(name, err, nr, args...) \
218
-+  ({									      \
219
-+    register unsigned int resultvar;					      \
220
-+    EXTRAVAR_##nr							      \
221
-+    asm volatile (							      \
222
-+    LOADARGS_NOSYSENTER_##nr						      \
223
-+    "movl %1, %%eax\n\t"						      \
224
-+    "int $0x80\n\t"							      \
225
-+    RESTOREARGS_NOSYSENTER_##nr						      \
226
-+    : "=a" (resultvar)							      \
227
-+    : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc");		      \
228
-+    (int) resultvar; })
229
- # else
230
- #  define INTERNAL_SYSCALL(name, err, nr, args...) \
231
-   ({									      \
232
-@@ -447,12 +459,20 @@
233
- 
234
- #define LOADARGS_0
235
- #ifdef __PIC__
236
--# if defined I386_USE_SYSENTER && defined SHARED
237
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
238
- #  define LOADARGS_1 \
239
-     "bpushl .L__X'%k3, %k3\n\t"
240
- #  define LOADARGS_5 \
241
-     "movl %%ebx, %4\n\t"						      \
242
-     "movl %3, %%ebx\n\t"
243
-+#  define LOADARGS_NOSYSENTER_1 \
244
-+    "bpushl .L__X'%k2, %k2\n\t"
245
-+#  define LOADARGS_NOSYSENTER_2	LOADARGS_NOSYSENTER_1
246
-+#  define LOADARGS_NOSYSENTER_3	LOADARGS_3
247
-+#  define LOADARGS_NOSYSENTER_4	LOADARGS_3
248
-+#  define LOADARGS_NOSYSENTER_5 \
249
-+    "movl %%ebx, %3\n\t"						      \
250
-+    "movl %2, %%ebx\n\t"
251
- # else
252
- #  define LOADARGS_1 \
253
-     "bpushl .L__X'%k2, %k2\n\t"
254
-@@ -474,11 +495,18 @@
255
- 
256
- #define RESTOREARGS_0
257
- #ifdef __PIC__
258
--# if defined I386_USE_SYSENTER && defined SHARED
259
-+# if defined I386_USE_SYSENTER && ( defined SHARED || defined __PIC__ )
260
- #  define RESTOREARGS_1 \
261
-     "bpopl .L__X'%k3, %k3\n\t"
262
- #  define RESTOREARGS_5 \
263
-     "movl %4, %%ebx"
264
-+#  define RESTOREARGS_NOSYSENTER_1 \
265
-+    "bpopl .L__X'%k2, %k2\n\t"
266
-+#  define RESTOREARGS_NOSYSENTER_2	RESTOREARGS_NOSYSENTER_1
267
-+#  define RESTOREARGS_NOSYSENTER_3	RESTOREARGS_3
268
-+#  define RESTOREARGS_NOSYSENTER_4	RESTOREARGS_3
269
-+#  define RESTOREARGS_NOSYSENTER_5 \
270
-+    "movl %3, %%ebx"
271
- # else
272
- #  define RESTOREARGS_1 \
273
-     "bpopl .L__X'%k2, %k2\n\t"
... ...
@@ -1,298 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.12 2010/09/30 06:29:21 vapier Exp $
4
-
5
-# We need to be able to set alternative headers for
6
-# compiling for non-native platform
7
-# Will also become useful for testing kernel-headers without screwing up
8
-# the whole system.
9
-# note: intentionally undocumented.
10
-alt_headers() {
11
-	if [[ -z ${ALT_HEADERS} ]] ; then
12
-		if is_crosscompile ; then
13
-			ALT_HEADERS="/usr/${CTARGET}/usr/include"
14
-		else
15
-			ALT_HEADERS="/usr/include"
16
-		fi
17
-	fi
18
-	echo "${ALT_HEADERS}"
19
-}
20
-alt_build_headers() {
21
-	if [[ -z ${ALT_BUILD_HEADERS} ]] ; then
22
-		ALT_BUILD_HEADERS=$(alt_headers)
23
-		if tc-is-cross-compiler ; then
24
-			ALT_BUILD_HEADERS=${ROOT}$(alt_headers)
25
-			if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then
26
-				local header_path=$(echo '#include <linux/version.h>' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h')
27
-				ALT_BUILD_HEADERS=${header_path%/linux/version.h}
28
-			fi
29
-		fi
30
-	fi
31
-	echo "${ALT_BUILD_HEADERS}"
32
-}
33
-
34
-alt_usrlibdir() {
35
-	if is_crosscompile ; then
36
-		echo /usr/${CTARGET}/usr/$(get_libdir)
37
-	else
38
-		echo /usr/$(get_libdir)
39
-	fi
40
-}
41
-
42
-setup_flags() {
43
-	# Make sure host make.conf doesn't pollute us
44
-	if is_crosscompile || tc-is-cross-compiler ; then
45
-		CHOST=${CTARGET} strip-unsupported-flags
46
-	fi
47
-
48
-	# Store our CFLAGS because it's changed depending on which CTARGET
49
-	# we are building when pulling glibc on a multilib profile
50
-	CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}}
51
-	CFLAGS=${CFLAGS_BASE}
52
-	CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}}
53
-	CXXFLAGS=${CXXFLAGS_BASE}
54
-	ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}}
55
-	ASFLAGS=${ASFLAGS_BASE}
56
-
57
-	# Over-zealous CFLAGS can often cause problems.  What may work for one
58
-	# person may not work for another.  To avoid a large influx of bugs
59
-	# relating to failed builds, we strip most CFLAGS out to ensure as few
60
-	# problems as possible.
61
-	strip-flags
62
-	strip-unsupported-flags
63
-	filter-flags -m32 -m64 -mabi=*
64
-
65
-	unset CBUILD_OPT CTARGET_OPT
66
-	if has_multilib_profile ; then
67
-		CTARGET_OPT=$(get_abi_CTARGET)
68
-		[[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST)
69
-	fi
70
-
71
-	case $(tc-arch) in
72
-		x86)
73
-			# -march needed for #185404
74
-			local t=${CTARGET_OPT:-${CTARGET}}
75
-			t=${t%%-*}
76
-			if ! echo "" | $(tc-getCC) ${CFLAGS} -E -dD - | grep -qs __${t}__ ; then
77
-				filter-flags '-march=*'
78
-				export CFLAGS="-march=${t} ${CFLAGS}"
79
-			fi
80
-		;;
81
-		amd64)
82
-			# Punt this when amd64's 2004.3 is removed
83
-			CFLAGS_x86="-m32"
84
-
85
-			# -march needed for #185404
86
-			local t=${CTARGET_OPT:-${CTARGET}}
87
-			t=${t%%-*}
88
-			if ! echo "" | $(tc-getCC) ${CFLAGS} ${CFLAGS_x86} -m32 -E -dD - | grep -qs __${t}__ ; then
89
-				filter-flags '-march=*'
90
-				export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
91
-			fi
92
-		;;
93
-		ppc)
94
-			append-flags "-freorder-blocks"
95
-		;;
96
-		sparc)
97
-			# Both sparc and sparc64 can use -fcall-used-g6.  -g7 is bad, though.
98
-			filter-flags "-fcall-used-g7"
99
-			append-flags "-fcall-used-g6"
100
-			filter-flags "-mvis"
101
-
102
-			GLIBCMAJOR=$(get_version_component_range 1 ${PV})
103
-			GLIBCMINOR=$(get_version_component_range 2 ${PV})
104
-
105
-			# set CTARGET_OPT so glibc can use cpu-specific .S files for better performance
106
-			# - UltraSPARC T1 (niagara) support requires >= glibc 2.8
107
-			# - UltraSPARC T2 (niagara2) support requires >= glibc 2.7
108
-
109
-			if is_crosscompile || [[ ${PROFILE_ARCH} == "sparc64" ]] || { has_multilib_profile && ! tc-is-cross-compiler; } ; then
110
-				case ${ABI} in
111
-					sparc64)
112
-						filter-flags -Wa,-xarch -Wa,-A
113
-
114
-						if is-flagq "-mcpu=niagara2" && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.7 ]] ; then
115
-							CTARGET_OPT="sparc64v2-unknown-linux-gnu"
116
-							append-flags "-Wa,-xarch=v9b"
117
-							export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
118
-						elif { is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2" ; } && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.6 ]] ; then
119
-							CTARGET_OPT="sparc64v-unknown-linux-gnu"
120
-							append-flags "-Wa,-xarch=v9b"
121
-							export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
122
-						elif is-flagq "-mcpu=ultrasparc3" || is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2"; then
123
-							CTARGET_OPT="sparc64b-unknown-linux-gnu"
124
-							append-flags "-Wa,-xarch=v9b"
125
-							export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9b"
126
-						else
127
-							CTARGET_OPT="sparc64-unknown-linux-gnu"
128
-							append-flags "-Wa,-xarch=v9a"
129
-							export ASFLAGS="${ASFLAGS} -Wa,-xarch=v9a"
130
-						fi
131
-					;;
132
-					*)
133
-						if is-flagq "-mcpu=niagara2" && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.7 ]] ; then
134
-							CTARGET_OPT="sparcv9v2-unknown-linux-gnu"
135
-						elif { is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2" ; } && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.6 ]] ; then
136
-							CTARGET_OPT="sparcv9v-unknown-linux-gnu"
137
-						elif is-flagq "-mcpu=ultrasparc3" || is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2"; then
138
-							CTARGET_OPT="sparcv9b-unknown-linux-gnu"
139
-						else
140
-							CTARGET_OPT="sparcv9-unknown-linux-gnu"
141
-						fi
142
-					;;
143
-				esac
144
-			else
145
-				if is-flagq "-mcpu=niagara2" && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.7 ]] ; then
146
-					CTARGET_OPT="sparcv9v2-unknown-linux-gnu"
147
-				elif { is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2" ; } && [[ ${GLIBCMAJOR}.${GLIBCMINOR} > 2.6 ]] ; then
148
-					CTARGET_OPT="sparcv9v-unknown-linux-gnu"
149
-				elif is-flagq "-mcpu=ultrasparc3" || is-flagq "-mcpu=niagara" || is-flagq "-mcpu=niagara2"; then
150
-					CTARGET_OPT="sparcv9b-unknown-linux-gnu"
151
-				elif { is_crosscompile && want_nptl; } || is-flagq "-mcpu=ultrasparc2" || is-flagq "-mcpu=ultrasparc"; then
152
-					CTARGET_OPT="sparcv9-unknown-linux-gnu"
153
-				fi
154
-			fi
155
-		;;
156
-	esac
157
-
158
-	if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then
159
-		CBUILD_OPT=${CTARGET_OPT}
160
-	fi
161
-
162
-	# Lock glibc at -O2 -- linuxthreads needs it and we want to be
163
-	# conservative here.  -fno-strict-aliasing is to work around #155906
164
-	filter-flags -O?
165
-	append-flags -O2 -fno-strict-aliasing
166
-
167
-	# Cant build glibc itself with fortify code
168
-	append-cppflags -U_FORTIFY_SOURCE
169
-
170
-	# building glibc with SSP is fraught with difficulty, especially
171
-	# due to __stack_chk_fail_local which would mean significant changes
172
-	# to the glibc build process. See bug #94325 #293721
173
-	use hardened && gcc-specs-ssp && append-cflags $(test-flags-CC -fno-stack-protector)
174
-
175
-	if use hardened && gcc-specs-pie ; then
176
-		# Force PIC macro definition for all compilations since they're all
177
-		# either -fPIC or -fPIE with the default-PIE compiler.
178
-		append-cppflags -DPIC
179
-	else
180
-		# Don't build -fPIE without the default-PIE compiler and the
181
-		# hardened-pie patch
182
-		filter-flags -fPIE
183
-	fi
184
-}
185
-
186
-want_nptl() {
187
-	[[ -z ${LT_VER} ]] && return 0
188
-	want_tls || return 1
189
-	use nptl || return 1
190
-
191
-	# Only list the arches that cannot do NPTL
192
-	case $(tc-arch) in
193
-		m68k) return 1;;
194
-		sparc)
195
-			# >= v9 is needed for nptl.
196
-			[[ ${PROFILE_ARCH} == "sparc" ]] && return 1
197
-		;;
198
-	esac
199
-
200
-	return 0
201
-}
202
-
203
-want_linuxthreads() {
204
-	[[ -z ${LT_VER} ]] && return 1
205
-	! use nptlonly && return 0
206
-	want_nptl || return 0
207
-	return 1
208
-}
209
-
210
-want_tls() {
211
-	# Archs that can use TLS (Thread Local Storage)
212
-	case $(tc-arch) in
213
-		sparc)
214
-			# 2.3.6 should have tls support on sparc64
215
-			# when using newer binutils
216
-			case ${CTARGET/-*} in
217
-				sparc64*) return 1 ;;
218
-				*) return 0 ;;
219
-			esac
220
-		;;
221
-		x86)
222
-			# requires i486 or better #106556
223
-			[[ ${CTARGET} == i[4567]86* ]] && return 0
224
-			return 1
225
-		;;
226
-	esac
227
-
228
-	return 0
229
-}
230
-
231
-want__thread() {
232
-	want_tls || return 1
233
-
234
-	# For some reason --with-tls --with__thread is causing segfaults on sparc32.
235
-	[[ ${PROFILE_ARCH} == "sparc" ]] && return 1
236
-
237
-	[[ -n ${WANT__THREAD} ]] && return ${WANT__THREAD}
238
-
239
-	# only test gcc -- cant test linking yet
240
-	tc-has-tls -c ${CTARGET}
241
-	WANT__THREAD=$?
242
-
243
-	return ${WANT__THREAD}
244
-}
245
-
246
-use_multilib() {
247
-	case ${CTARGET} in
248
-		sparc*|mips64*|x86_64*|powerpc64*|s390x*)
249
-			has_multilib_profile || use multilib ;;
250
-		*)  false ;;
251
-	esac
252
-}
253
-
254
-use_multiarch() {
255
-	# Make sure binutils is new enough to support indirect functions #336792
256
-	local bver=$($(tc-getLD ${CTARGET}) -v | awk '{print $NF}') nver
257
-	case $(tc-arch ${CTARGET}) in
258
-		amd64|x86) nver="2.20" ;;
259
-		sparc)     nver="2.21" ;;
260
-		*)         return 1 ;;
261
-	esac
262
-	version_is_at_least ${nver} ${bver}
263
-}
264
-
265
-# Setup toolchain variables that would be defined in the profiles for these archs.
266
-setup_env() {
267
-	# silly users
268
-	unset LD_RUN_PATH
269
-
270
-	if is_crosscompile || tc-is-cross-compiler ; then
271
-		multilib_env ${CTARGET}
272
-		if ! use multilib ; then
273
-			MULTILIB_ABIS=${DEFAULT_ABI}
274
-		else
275
-			MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}}
276
-		fi
277
-
278
-		# If the user has CFLAGS_<CTARGET> in their make.conf, use that,
279
-		# and fall back on CFLAGS.
280
-		local VAR=CFLAGS_${CTARGET//[-.]/_}
281
-		CFLAGS=${!VAR-${CFLAGS}}
282
-	fi
283
-
284
-	setup_flags
285
-
286
-	export ABI=${ABI:-${DEFAULT_ABI:-default}}
287
-
288
-	if is_crosscompile || tc-is-cross-compiler ; then
289
-		local VAR=CFLAGS_${ABI}
290
-		# We need to export CFLAGS with abi information in them because
291
-		# glibc's configure script checks CFLAGS for some targets (like mips)
292
-		export CFLAGS="${!VAR} ${CFLAGS}"
293
-	fi
294
-}
295
-
296
-just_headers() {
297
-	is_crosscompile && use crosscompile_opts_headers-only
298
-}
... ...
@@ -1,29 +0,0 @@
1
-# Copyright 1999-2009 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_postinst.eblit,v 1.1 2009/03/01 21:06:22 vapier Exp $
4
-
5
-eblit-glibc-pkg_postinst() {
6
-	# nothing to do if just installing headers
7
-	just_headers && return
8
-
9
-	if ! tc-is-cross-compiler && [[ -x ${ROOT}/usr/sbin/iconvconfig ]] ; then
10
-		# Generate fastloading iconv module configuration file.
11
-		"${ROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}"
12
-	fi
13
-
14
-	if ! is_crosscompile && [[ ${ROOT} == "/" ]] ; then
15
-		# Reload init ... if in a chroot or a diff init package, ignore
16
-		# errors from this step #253697
17
-		/sbin/telinit U 2>/dev/null
18
-
19
-		# if the host locales.gen contains no entries, we'll install everything
20
-		local locale_list="${ROOT}etc/locale.gen"
21
-		if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then
22
-			ewarn "Generating all locales; edit /etc/locale.gen to save time/space"
23
-			locale_list="${ROOT}usr/share/i18n/SUPPORTED"
24
-		fi
25
-		local x jobs
26
-		for x in ${MAKEOPTS} ; do [[ ${x} == -j* ]] && jobs=${x#-j} ; done
27
-		locale-gen -j ${jobs:-1} --config "${locale_list}"
28
-	fi
29
-}
... ...
@@ -1,90 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_preinst.eblit,v 1.3 2010/10/08 15:33:13 flameeyes Exp $
4
-
5
-fix_lib64_symlinks() {
6
-	# the original Gentoo/AMD64 devs decided that since 64bit is the native
7
-	# bitdepth for AMD64, lib should be used for 64bit libraries. however,
8
-	# this ignores the FHS and breaks multilib horribly... especially
9
-	# since it wont even work without a lib64 symlink anyways. *rolls eyes*
10
-	# see bug 59710 for more information.
11
-	# Travis Tilley <lv@gentoo.org> (08 Aug 2004)
12
-	if [ -L ${ROOT}/lib64 ] ; then
13
-		ewarn "removing /lib64 symlink and moving lib to lib64..."
14
-		ewarn "dont hit ctrl-c until this is done"
15
-		rm ${ROOT}/lib64
16
-		# now that lib64 is gone, nothing will run without calling ld.so
17
-		# directly. luckily the window of brokenness is almost non-existant
18
-		use amd64 && /lib/ld-linux-x86-64.so.2 /bin/mv ${ROOT}/lib ${ROOT}/lib64
19
-		use ppc64 && /lib/ld64.so.1 /bin/mv ${ROOT}/lib ${ROOT}/lib64
20
-		# all better :)
21
-		ldconfig
22
-		ln -s lib64 ${ROOT}/lib
23
-		einfo "done! :-)"
24
-		einfo "fixed broken lib64/lib symlink in ${ROOT}"
25
-	fi
26
-	if [ -L ${ROOT}/usr/lib64 ] ; then
27
-		rm ${ROOT}/usr/lib64
28
-		mv ${ROOT}/usr/lib ${ROOT}/usr/lib64
29
-		ln -s lib64 ${ROOT}/usr/lib
30
-		einfo "fixed broken lib64/lib symlink in ${ROOT}/usr"
31
-	fi
32
-	if [ -L ${ROOT}/usr/X11R6/lib64 ] ; then
33
-		rm ${ROOT}/usr/X11R6/lib64
34
-		mv ${ROOT}/usr/X11R6/lib ${ROOT}/usr/X11R6/lib64
35
-		ln -s lib64 ${ROOT}/usr/X11R6/lib
36
-		einfo "fixed broken lib64/lib symlink in ${ROOT}/usr/X11R6"
37
-	fi
38
-}
39
-
40
-eblit-glibc-pkg_preinst() {
41
-	# nothing to do if just installing headers
42
-	just_headers && return
43
-
44
-	# PPC64+others may want to eventually be added to this logic if they
45
-	# decide to be multilib compatible and FHS compliant. note that this
46
-	# chunk of FHS compliance only applies to 64bit archs where 32bit
47
-	# compatibility is a major concern (not IA64, for example).
48
-
49
-	# amd64's 2005.0 is the first amd64 profile to not need this code.
50
-	# 2005.0 is setup properly, and this is executed as part of the
51
-	# 2004.3 -> 2005.0 upgrade script.
52
-	# It can be removed after 2004.3 has been purged from portage.
53
-	{ use amd64 || use ppc64; } && [ "$(get_libdir)" == "lib64" ] && ! has_multilib_profile && fix_lib64_symlinks
54
-
55
-	# it appears that /lib/tls is sometimes not removed.  See bug
56
-	# 69258 for more info.
57
-	if [[ -d ${ROOT}/$(alt_libdir)/tls ]] && [[ ! -d ${D}/$(alt_libdir)/tls ]] ; then
58
-		ewarn "nptlonly or -nptl in USE, removing /${ROOT}$(alt_libdir)/tls..."
59
-		rm -r "${ROOT}"/$(alt_libdir)/tls || die
60
-	fi
61
-
62
-	# prepare /etc/ld.so.conf.d/ for files
63
-	mkdir -p "${ROOT}"/etc/ld.so.conf.d
64
-
65
-	# simple test to make sure our new glibc isnt completely broken.
66
-	# make sure we don't test with statically built binaries since
67
-	# they will fail.  also, skip if this glibc is a cross compiler.
68
-	[[ ${ROOT} != "/" ]] && return 0
69
-	[[ -d ${D}/$(get_libdir) ]] || return 0
70
-	cd / #228809
71
-	local x striptest
72
-	for x in date env ls true uname ; do
73
-		x=$(type -p ${x})
74
-		[[ -z ${x} ]] && continue
75
-		striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null)
76
-		[[ -z ${striptest} ]] && continue
77
-		[[ ${striptest} == *"statically linked"* ]] && continue
78
-		# we enter ${D} so to avoid trouble if the path contains
79
-		# special characters; for instance if the path contains the
80
-		# colon character (:), then the linker will try to split it
81
-		# and look for the libraries in an unexpected place. This can
82
-		# lead to unsafe code execution if the generated prefix is
83
-		# within a world-writable directory
84
-		# (e.g. /var/tmp/portage:${HOSTNAME})
85
-		pushd "${D}"/$(get_libdir) 2>/dev/null
86
-		./ld-*.so --library-path . ${x} > /dev/null \
87
-			|| die "simple run test (${x}) failed"
88
-		popd 2>/dev/null
89
-	done
90
-}
... ...
@@ -1,67 +0,0 @@
1
-# Copyright 1999-2009 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.4 2009/08/21 05:46:04 vapier Exp $
4
-
5
-eblit-glibc-pkg_setup() {
6
-	# prevent native builds from downgrading ... maybe update to allow people
7
-	# to change between diff -r versions ? (2.3.6-r4 -> 2.3.6-r2)
8
-	if [[ ${ROOT} == "/" ]] && [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
9
-		if has_version '>'${CATEGORY}/${PF} ; then
10
-			eerror "Sanity check to keep you from breaking your system:"
11
-			eerror " Downgrading glibc is not supported and a sure way to destruction"
12
-			die "aborting to save your system"
13
-		fi
14
-
15
-		# Check for broken kernels #262698
16
-		cd "${T}"
17
-		printf '#include <pwd.h>\nint main(){return getpwuid(0)==0;}\n' > kern-clo-test.c
18
-		emake kern-clo-test || die
19
-		if ! ./kern-clo-test ; then
20
-			eerror "Your patched vendor kernel is broken.  You need to get an"
21
-			eerror "update from whoever is providing the kernel to you."
22
-			eerror "http://sourceware.org/bugzilla/show_bug.cgi?id=5227"
23
-			die "keeping your system alive, say thank you"
24
-		fi
25
-
26
-		# Check for broken kernels #279260
27
-		cd "${T}"
28
-		printf '#include <unistd.h>\n#include <sys/syscall.h>\nint main(){return syscall(1000)!=-1;}\n' > kern-enosys-test.c
29
-		emake kern-enosys-test || die
30
-		if ! ./kern-enosys-test ; then
31
-			eerror "Your old kernel is broken.  You need to update it to"
32
-			eerror "a newer version as syscall(<bignum>) will break."
33
-			eerror "http://bugs.gentoo.org/279260"
34
-			die "keeping your system alive, say thank you"
35
-		fi
36
-	fi
37
-
38
-	# users have had a chance to phase themselves, time to give em the boot
39
-	if [[ -e ${ROOT}/etc/locale.gen ]] && [[ -e ${ROOT}/etc/locales.build ]] ; then
40
-		eerror "You still haven't deleted ${ROOT}/etc/locales.build."
41
-		eerror "Do so now after making sure ${ROOT}/etc/locale.gen is kosher."
42
-		die "lazy upgrader detected"
43
-	fi
44
-
45
-	if [[ ${CTARGET} == i386-* ]] ; then
46
-		eerror "i386 CHOSTs are no longer supported."
47
-		eerror "Chances are you don't actually want/need i386."
48
-		eerror "Please read http://www.gentoo.org/doc/en/change-chost.xml"
49
-		die "please fix your CHOST"
50
-	fi
51
-
52
-	if [[ -n ${LT_VER} ]] ; then
53
-		if use nptlonly && ! use nptl ; then
54
-			eerror "If you want nptlonly, add nptl to your USE too ;p"
55
-			die "nptlonly without nptl"
56
-		fi
57
-	fi
58
-
59
-	if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then
60
-		ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS."
61
-		ewarn "This will result in a 50% performance penalty when running with a 32bit"
62
-		ewarn "hypervisor, which is probably not what you want."
63
-	fi
64
-
65
-	use hardened && ! gcc-specs-pie && \
66
-		ewarn "PIE hardening not applied, as your compiler doesn't default to PIE"
67
-}
... ...
@@ -1,208 +0,0 @@
1
-# Copyright 1999-2007 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile-2.11.2.eblit,v 1.1 2010/08/10 08:08:05 vapier Exp $
4
-
5
-glibc_do_configure() {
6
-	local myconf
7
-
8
-	# set addons
9
-	pushd "${S}" > /dev/null
10
-	local ADDONS=$(echo */configure | sed \
11
-		-e 's:/configure::g' \
12
-		-e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
13
-		-e 's: \+$::' \
14
-		-e 's! !,!g' \
15
-		-e 's!^!,!' \
16
-		-e '/^,\*$/d')
17
-	[[ -d ports ]] && ADDONS="${ADDONS},ports"
18
-	popd > /dev/null
19
-
20
-	use nls || myconf="${myconf} --disable-nls"
21
-	myconf="${myconf} $(use_enable hardened stackguard-randomization)"
22
-	if [[ $(<"${T}"/.ssp.compat) == "yes" ]] ; then
23
-		myconf="${myconf} --enable-old-ssp-compat"
24
-	else
25
-		myconf="${myconf} --disable-old-ssp-compat"
26
-	fi
27
-
28
-	use glibc-omitfp && myconf="${myconf} --enable-omitfp"
29
-
30
-	[[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
31
-
32
-	if [[ $1 == "linuxthreads" ]] ; then
33
-		if want_tls ; then
34
-			myconf="${myconf} --with-tls"
35
-
36
-			if ! want__thread || use glibc-compat20 || [[ ${LT_KER_VER} == 2.[02].* ]] ; then
37
-				myconf="${myconf} --without-__thread"
38
-			else
39
-				myconf="${myconf} --with-__thread"
40
-			fi
41
-		else
42
-			myconf="${myconf} --without-tls --without-__thread"
43
-		fi
44
-
45
-		myconf="${myconf} --disable-sanity-checks"
46
-		myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}"
47
-		myconf="${myconf} --enable-kernel=${LT_KER_VER}"
48
-	elif [[ $1 == "nptl" ]] ; then
49
-		myconf="${myconf} --enable-add-ons=nptl${ADDONS}"
50
-		myconf="${myconf} --enable-kernel=${NPTL_KERN_VER}"
51
-	else
52
-		die "invalid pthread option"
53
-	fi
54
-
55
-	# Since SELinux support is only required for nscd, only enable it if:
56
-	# 1. USE selinux
57
-	# 2. only for the primary ABI on multilib systems
58
-	# 3. Not a crosscompile
59
-	if ! is_crosscompile && use selinux ; then
60
-		if use multilib || has_multilib_profile ; then
61
-			if is_final_abi ; then
62
-				myconf="${myconf} --with-selinux"
63
-			else
64
-				myconf="${myconf} --without-selinux"
65
-			fi
66
-		else
67
-			myconf="${myconf} --with-selinux"
68
-		fi
69
-	else
70
-		myconf="${myconf} --without-selinux"
71
-	fi
72
-
73
-	myconf="${myconf}
74
-		--without-cvs
75
-		--enable-bind-now
76
-		--build=${CBUILD_OPT:-${CBUILD}}
77
-		--host=${CTARGET_OPT:-${CTARGET}}
78
-		$(use_enable profile)
79
-		$(use_with gd)
80
-		--with-headers=$(alt_build_headers)
81
-		--prefix=/usr
82
-		--libdir=/usr/$(get_libdir)
83
-		--mandir=/usr/share/man
84
-		--infodir=/usr/share/info
85
-		--libexecdir=/usr/$(get_libdir)/misc/glibc
86
-		${EXTRA_ECONF}"
87
-
88
-	# There is no configure option for this and we need to export it
89
-	# since the glibc build will re-run configure on itself
90
-	export libc_cv_slibdir=/$(get_libdir)
91
-
92
-	has_version app-admin/eselect-compiler || export CC=$(tc-getCC ${CTARGET})
93
-
94
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
95
-	mkdir -p "${GBUILDDIR}"
96
-	cd "${GBUILDDIR}"
97
-	einfo "Configuring GLIBC for $1 with: ${myconf// /\n\t\t}"
98
-	"${S}"/configure ${myconf} || die "failed to configure glibc"
99
-
100
-	# since we'll be punting them for cross-compilers, and they can cause
101
-	# problems (ia64+static), we'll just skip building altogether
102
-	is_crosscompile && sed -i '1ibuild-programs = no' config.make
103
-}
104
-
105
-toolchain-glibc_src_compile() {
106
-	echo
107
-	local v
108
-	for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
109
-		einfo " $(printf '%15s' ${v}:)   ${!v}"
110
-	done
111
-	echo
112
-
113
-	if want_linuxthreads ; then
114
-		glibc_do_configure linuxthreads
115
-		einfo "Building GLIBC with linuxthreads..."
116
-		make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
117
-	fi
118
-	if want_nptl ; then
119
-		# ... and then do the optional nptl build
120
-		unset LD_ASSUME_KERNEL
121
-		glibc_do_configure nptl
122
-		einfo "Building GLIBC with NPTL..."
123
-		make PARALLELMFLAGS="${MAKEOPTS}" || die "make for ${ABI} failed"
124
-	fi
125
-}
126
-
127
-toolchain-glibc_headers_compile() {
128
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
129
-	mkdir -p "${GBUILDDIR}"
130
-	cd "${GBUILDDIR}"
131
-
132
-	# if we don't have a compiler yet, we cant really test it now ...
133
-	# hopefully they don't affect header geneation, so let's hope for
134
-	# the best here ...
135
-	export \
136
-		libc_cv_386_tls=yes \
137
-		libc_cv_asm_cfi_directives=yes \
138
-		libc_cv_broken_visibility_attribute=no \
139
-		libc_cv_gcc___thread=yes \
140
-		libc_cv_mlong_double_128=yes \
141
-		libc_cv_mlong_double_128ibm=yes \
142
-		libc_cv_ppc_machine=yes \
143
-		libc_cv_visibility_attribute=yes \
144
-		libc_cv_z_combreloc=yes \
145
-		libc_cv_z_execstack=yes \
146
-		libc_cv_z_initfirst=yes \
147
-		libc_cv_z_nodelete=yes \
148
-		libc_cv_z_nodlopen=yes \
149
-		libc_cv_z_relro=yes
150
-
151
-	# Pick out the correct location for build headers
152
-	local ports="" myconf="--disable-sanity-checks --enable-hacker-mode"
153
-	[[ -d ${S}/ports ]] && ports=",ports"
154
-	myconf="${myconf}
155
-		--enable-add-ons=nptl${ports}
156
-		--without-cvs
157
-		--enable-bind-now
158
-		--build=${CBUILD_OPT:-${CBUILD}}
159
-		--host=${CTARGET_OPT:-${CTARGET}}
160
-		--with-headers=$(alt_build_headers)
161
-		--prefix=/usr
162
-		${EXTRA_ECONF}"
163
-
164
-	# Nothing is compiled here which would affect the headers for the target.
165
-	# so forcing CC/CFLAGS is sane.  unless you dont have `gcc`.  then i
166
-	# dont care :p.
167
-	einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
168
-	CC=gcc \
169
-	CFLAGS="-O1 -pipe" \
170
-	"${S}"/configure ${myconf} || die "failed to configure glibc"
171
-}
172
-
173
-eblit-glibc-src_compile() {
174
-	if is_crosscompile ; then
175
-		export \
176
-			libc_cv_c_cleanup=yes \
177
-			libc_cv_forced_unwind=yes
178
-	fi
179
-
180
-	if just_headers ; then
181
-		toolchain-glibc_headers_compile
182
-		return
183
-	fi
184
-
185
-	setup_env
186
-
187
-	if [[ -z ${OABI} ]] ; then
188
-		local abilist=""
189
-		if has_multilib_profile ; then
190
-			abilist=$(get_install_abis)
191
-			einfo "Building multilib glibc for ABIs: ${abilist}"
192
-		elif is_crosscompile || tc-is-cross-compiler ; then
193
-			abilist=${DEFAULT_ABI}
194
-		fi
195
-		if [[ -n ${abilist} ]] ; then
196
-			OABI=${ABI}
197
-			for ABI in ${abilist} ; do
198
-				export ABI
199
-				src_compile
200
-			done
201
-			ABI=${OABI}
202
-			unset OABI
203
-			return 0
204
-		fi
205
-	fi
206
-
207
-	toolchain-glibc_src_compile
208
-}
... ...
@@ -1,210 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_compile.eblit,v 1.15 2010/09/30 06:29:21 vapier Exp $
4
-
5
-glibc_do_configure() {
6
-	local myconf
7
-
8
-	einfo "Configuring GLIBC for $1"
9
-
10
-	# set addons
11
-	pushd "${S}" > /dev/null
12
-	local ADDONS=$(echo */configure | sed \
13
-		-e 's:/configure::g' \
14
-		-e 's:\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)::g' \
15
-		-e 's: \+$::' \
16
-		-e 's! !,!g' \
17
-		-e 's!^!,!' \
18
-		-e '/^,\*$/d')
19
-	[[ -d ports ]] && ADDONS="${ADDONS},ports"
20
-	popd > /dev/null
21
-
22
-	use nls || myconf="${myconf} --disable-nls"
23
-	myconf="${myconf} $(use_enable hardened stackguard-randomization)"
24
-	if [[ $(<"${T}"/.ssp.compat) == "yes" ]] ; then
25
-		myconf="${myconf} --enable-old-ssp-compat"
26
-	else
27
-		myconf="${myconf} --disable-old-ssp-compat"
28
-	fi
29
-
30
-	use glibc-omitfp && myconf="${myconf} --enable-omitfp"
31
-
32
-	[[ ${CTARGET//_/-} == *-softfloat-* ]] && myconf="${myconf} --without-fp"
33
-
34
-	if [[ $1 == "linuxthreads" ]] ; then
35
-		if want_tls ; then
36
-			myconf="${myconf} --with-tls"
37
-
38
-			if ! want__thread || use glibc-compat20 || [[ ${LT_KER_VER} == 2.[02].* ]] ; then
39
-				myconf="${myconf} --without-__thread"
40
-			else
41
-				myconf="${myconf} --with-__thread"
42
-			fi
43
-		else
44
-			myconf="${myconf} --without-tls --without-__thread"
45
-		fi
46
-
47
-		myconf="${myconf} --disable-sanity-checks"
48
-		myconf="${myconf} --enable-add-ons=linuxthreads${ADDONS}"
49
-		myconf="${myconf} --enable-kernel=${LT_KER_VER}"
50
-	elif [[ $1 == "nptl" ]] ; then
51
-		myconf="${myconf} --enable-add-ons=nptl${ADDONS}"
52
-		myconf="${myconf} --enable-kernel=${NPTL_KERN_VER}"
53
-	else
54
-		die "invalid pthread option"
55
-	fi
56
-
57
-	# Since SELinux support is only required for nscd, only enable it if:
58
-	# 1. USE selinux
59
-	# 2. only for the primary ABI on multilib systems
60
-	# 3. Not a crosscompile
61
-	if ! is_crosscompile && use selinux ; then
62
-		if use multilib || has_multilib_profile ; then
63
-			if is_final_abi ; then
64
-				myconf="${myconf} --with-selinux"
65
-			else
66
-				myconf="${myconf} --without-selinux"
67
-			fi
68
-		else
69
-			myconf="${myconf} --with-selinux"
70
-		fi
71
-	else
72
-		myconf="${myconf} --without-selinux"
73
-	fi
74
-
75
-	myconf="${myconf}
76
-		--without-cvs
77
-		--enable-bind-now
78
-		--build=${CBUILD_OPT:-${CBUILD}}
79
-		--host=${CTARGET_OPT:-${CTARGET}}
80
-		$(use_enable profile)
81
-		$(use_with gd)
82
-		--with-headers=$(alt_build_headers)
83
-		--prefix=/usr
84
-		--libdir=/usr/$(get_libdir)
85
-		--mandir=/usr/share/man
86
-		--infodir=/usr/share/info
87
-		--libexecdir=/usr/$(get_libdir)/misc/glibc
88
-		$(use_multiarch || echo --disable-multi-arch)
89
-		${EXTRA_ECONF}"
90
-
91
-	# There is no configure option for this and we need to export it
92
-	# since the glibc build will re-run configure on itself
93
-	export libc_cv_slibdir=/$(get_libdir)
94
-
95
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-$1
96
-	mkdir -p "${GBUILDDIR}"
97
-	cd "${GBUILDDIR}"
98
-	echo "${S}"/configure ${myconf}
99
-	"${S}"/configure ${myconf} || die "failed to configure glibc"
100
-
101
-	# since we'll be punting them for cross-compilers, and they can cause
102
-	# problems (ia64+static), we'll just skip building altogether
103
-	is_crosscompile && sed -i '1ibuild-programs = no' config.make
104
-}
105
-
106
-toolchain-glibc_src_compile() {
107
-	echo
108
-	local v
109
-	for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CFLAGS ; do
110
-		einfo " $(printf '%15s' ${v}:)   ${!v}"
111
-	done
112
-	export CC=$(tc-getCC ${CTARGET})
113
-	einfo " $(printf '%15s' 'Manual CC:')   ${CC}"
114
-	echo
115
-
116
-	if want_linuxthreads ; then
117
-		glibc_do_configure linuxthreads
118
-		emake || die "make for ${ABI} failed"
119
-	fi
120
-	if want_nptl ; then
121
-		# ... and then do the optional nptl build
122
-		unset LD_ASSUME_KERNEL
123
-		glibc_do_configure nptl
124
-		emake || die "make for ${ABI} failed"
125
-	fi
126
-}
127
-
128
-toolchain-glibc_headers_compile() {
129
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
130
-	mkdir -p "${GBUILDDIR}"
131
-	cd "${GBUILDDIR}"
132
-
133
-	# if we don't have a compiler yet, we cant really test it now ...
134
-	# hopefully they don't affect header geneation, so let's hope for
135
-	# the best here ...
136
-	export \
137
-		libc_cv_386_tls=yes \
138
-		libc_cv_asm_cfi_directives=yes \
139
-		libc_cv_broken_visibility_attribute=no \
140
-		libc_cv_gcc___thread=yes \
141
-		libc_cv_mlong_double_128=yes \
142
-		libc_cv_mlong_double_128ibm=yes \
143
-		libc_cv_ppc_machine=yes \
144
-		libc_cv_ppc_rel16=yes \
145
-		libc_cv_visibility_attribute=yes \
146
-		libc_cv_z_combreloc=yes \
147
-		libc_cv_z_execstack=yes \
148
-		libc_cv_z_initfirst=yes \
149
-		libc_cv_z_nodelete=yes \
150
-		libc_cv_z_nodlopen=yes \
151
-		libc_cv_z_relro=yes
152
-
153
-	# Pick out the correct location for build headers
154
-	local ports="" myconf="--disable-sanity-checks --enable-hacker-mode"
155
-	[[ -d ${S}/ports ]] && ports=",ports"
156
-	myconf="${myconf}
157
-		--enable-add-ons=nptl${ports}
158
-		--without-cvs
159
-		--enable-bind-now
160
-		--build=${CBUILD_OPT:-${CBUILD}}
161
-		--host=${CTARGET_OPT:-${CTARGET}}
162
-		--with-headers=$(alt_build_headers)
163
-		--prefix=/usr
164
-		${EXTRA_ECONF}"
165
-
166
-	# Nothing is compiled here which would affect the headers for the target.
167
-	# so forcing CC/CFLAGS is sane.  unless you dont have `gcc`.  then i
168
-	# dont care :p.
169
-	einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
170
-	CC=gcc \
171
-	CFLAGS="-O1 -pipe" \
172
-	"${S}"/configure ${myconf} || die "failed to configure glibc"
173
-}
174
-
175
-eblit-glibc-src_compile() {
176
-	if is_crosscompile ; then
177
-		export \
178
-			libc_cv_c_cleanup=yes \
179
-			libc_cv_forced_unwind=yes
180
-	fi
181
-
182
-	if just_headers ; then
183
-		toolchain-glibc_headers_compile
184
-		return
185
-	fi
186
-
187
-	setup_env
188
-
189
-	if [[ -z ${OABI} ]] ; then
190
-		local abilist=""
191
-		if has_multilib_profile ; then
192
-			abilist=$(get_install_abis)
193
-			einfo "Building multilib glibc for ABIs: ${abilist}"
194
-		elif is_crosscompile || tc-is-cross-compiler ; then
195
-			abilist=${DEFAULT_ABI}
196
-		fi
197
-		if [[ -n ${abilist} ]] ; then
198
-			OABI=${ABI}
199
-			for ABI in ${abilist} ; do
200
-				export ABI
201
-				src_compile
202
-			done
203
-			ABI=${OABI}
204
-			unset OABI
205
-			return 0
206
-		fi
207
-	fi
208
-
209
-	toolchain-glibc_src_compile
210
-}
... ...
@@ -1,252 +0,0 @@
1
-# Copyright 1999-2007 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install-2.11.2.eblit,v 1.1 2010/08/10 08:08:05 vapier Exp $
4
-
5
-toolchain-glibc_src_install() {
6
-	local GBUILDDIR
7
-	if want_linuxthreads ; then
8
-		GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
9
-	else
10
-		GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
11
-	fi
12
-
13
-	local install_root=${D}
14
-	is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
15
-	if want_linuxthreads ; then
16
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
17
-		einfo "Installing GLIBC ${ABI} with linuxthreads ..."
18
-	else # nptlonly
19
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
20
-		einfo "Installing GLIBC ${ABI} with NPTL ..."
21
-	fi
22
-	make PARALLELMFLAGS="${MAKEOPTS}" \
23
-		install_root="${install_root}" \
24
-		install || die
25
-
26
-	if is_crosscompile ; then
27
-		# punt all the junk not needed by a cross-compiler
28
-		cd "${D}"/usr/${CTARGET} || die
29
-		rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
30
-	fi
31
-
32
-	if want_linuxthreads && want_nptl ; then
33
-		einfo "Installing NPTL to $(alt_libdir)/tls/..."
34
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
35
-		dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
36
-
37
-		local l src_lib
38
-		for l in libc libm librt libpthread libthread_db ; do
39
-			# take care of shared lib first ...
40
-			l=${l}.so
41
-			if [[ -e ${l} ]] ; then
42
-				src_lib=${l}
43
-			else
44
-				src_lib=$(eval echo */${l})
45
-			fi
46
-			cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
47
-			fperms a+rx $(alt_libdir)/tls/${l}
48
-			dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
49
-
50
-			# then grab the linker script or the symlink ...
51
-			if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
52
-				dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
53
-			else
54
-				sed \
55
-					-e "s:/${l}:/tls/${l}:g" \
56
-					-e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
57
-					"${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
58
-			fi
59
-
60
-			# then grab the static lib ...
61
-			src_lib=${src_lib/%.so/.a}
62
-			[[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
63
-			cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
64
-			src_lib=${src_lib/%.a/_nonshared.a}
65
-			if [[ -e ${src_lib} ]] ; then
66
-				cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
67
-			fi
68
-		done
69
-
70
-		# use the nptl linker instead of the linuxthreads one as the linuxthreads
71
-		# one may lack TLS support and that can be really bad for business
72
-		cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
73
-	fi
74
-
75
-	# We'll take care of the cache ourselves
76
-	rm -f "${D}"/etc/ld.so.cache
77
-
78
-	# Some things want this, notably ash.
79
-	dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
80
-
81
-	# Handle includes for different ABIs if glibc itself doesn't do it
82
-	# XXX: curr glibc should finally handle all of them correctly
83
-	#case $(tc-arch) in
84
-	#	amd64|mips|ppc|s390) ;;
85
-	#	*) prep_ml_includes $(alt_headers) ;;
86
-	#esac
87
-
88
-	# When cross-compiling for a non-multilib setup, make sure we have
89
-	# lib and a proper symlink setup
90
-	if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
91
-		cd "${D}"$(alt_libdir)/..
92
-		mv $(get_libdir) lib || die
93
-		ln -s lib $(get_libdir) || die
94
-		cd "${D}"$(alt_usrlibdir)/..
95
-		mv $(get_libdir) lib || die
96
-		ln -s lib $(get_libdir) || die
97
-	fi
98
-
99
-	#################################################################
100
-	# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
101
-	# Make sure we install some symlink hacks so that when we build
102
-	# a 2nd stage cross-compiler, gcc finds the target system
103
-	# headers correctly.  See gcc/doc/gccinstall.info
104
-	if is_crosscompile ; then
105
-		dosym usr/include /usr/${CTARGET}/sys-include
106
-		return 0
107
-	fi
108
-
109
-	# Everything past this point just needs to be done once ...
110
-	is_final_abi || return 0
111
-
112
-	# Make sure the non-native interp can be found on multilib systems
113
-	if has_multilib_profile ; then
114
-		case $(tc-arch) in
115
-			amd64)
116
-				[[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
117
-				dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
118
-				;;
119
-			ppc64)
120
-				[[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
121
-				dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
122
-				;;
123
-		esac
124
-	fi
125
-
126
-	# Files for Debian-style locale updating
127
-	dodir /usr/share/i18n
128
-	sed \
129
-		-e "/^#/d" \
130
-		-e "/SUPPORTED-LOCALES=/d" \
131
-		-e "s: \\\\::g" -e "s:/: :g" \
132
-		"${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
133
-		|| die "generating /usr/share/i18n/SUPPORTED failed"
134
-	cd "${WORKDIR}"/extra/locale
135
-	dosbin locale-gen || die
136
-	doman *.[0-8]
137
-	insinto /etc
138
-	doins locale.gen || die
139
-
140
-	# Make sure all the ABI's can find the locales and so we only
141
-	# have to generate one set
142
-	local a
143
-	keepdir /usr/$(get_libdir)/locale
144
-	for a in $(get_install_abis) ; do
145
-		if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
146
-			dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
147
-		fi
148
-	done
149
-
150
-	if ! has noinfo ${FEATURES} && [[ -n ${INFOPAGE_VER} ]] ; then
151
-		einfo "Installing info pages..."
152
-
153
-		make \
154
-			-C "${GBUILDDIR}" \
155
-			PARALLELMFLAGS="${MAKEOPTS}" \
156
-			install_root="${install_root}" \
157
-			info -i || die
158
-	fi
159
-
160
-	if [[ -n ${MANPAGE_VER} ]] ; then
161
-		einfo "Installing man pages..."
162
-
163
-		# Install linuxthreads man pages even if nptl is enabled
164
-		cd "${WORKDIR}"/man
165
-		doman *.3thr
166
-	fi
167
-
168
-	cd "${S}"
169
-
170
-	# Install misc network config files
171
-	insinto /etc
172
-	doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
173
-	doins "${WORKDIR}"/extra/etc/*.conf || die
174
-	doinitd "${WORKDIR}"/extra/etc/nscd || die
175
-
176
-	sed -i -e "s:@PIDFILE@:$(strings "${D}"/usr/sbin/nscd | grep nscd.pid):" "${D}"/etc/init.d/nscd
177
-
178
-	echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
179
-	doenvd "${T}"/00glibc || die
180
-
181
-	dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
182
-
183
-	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
184
-	# creation of the "factory" symlink in pkg_postinst().
185
-	rm -f "${D}"/etc/localtime
186
-}
187
-
188
-toolchain-glibc_headers_install() {
189
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
190
-	cd "${GBUILDDIR}"
191
-	make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
192
-	# Copy over headers that are not part of install-headers ... these
193
-	# are pretty much taken verbatim from crosstool, see it for more details
194
-	insinto $(alt_headers)/bits
195
-	doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
196
-	insinto $(alt_headers)/gnu
197
-	doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
198
-	# Make sure we install the sys-include symlink so that when
199
-	# we build a 2nd stage cross-compiler, gcc finds the target
200
-	# system headers correctly.  See gcc/doc/gccinstall.info
201
-	dosym usr/include /usr/${CTARGET}/sys-include
202
-}
203
-
204
-src_strip() {
205
-	# gdb is lame and requires some debugging information to remain in
206
-	# libpthread, so we need to strip it by hand.  libthread_db makes no
207
-	# sense stripped as it is only used when debugging.
208
-	local pthread=$(hasq splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}")
209
-	env \
210
-		-uRESTRICT \
211
-		CHOST=${CTARGET} \
212
-		STRIP_MASK="/*/{,tls/}${pthread}*" \
213
-		prepallstrip
214
-	# if user has stripping enabled and does not have split debug turned on,
215
-	# then leave the debugging sections in libpthread.
216
-	if ! hasq nostrip ${FEATURES} && ! hasq splitdebug ${FEATURES} ; then
217
-		${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so
218
-	fi
219
-}
220
-
221
-eblit-glibc-src_install() {
222
-	if just_headers ; then
223
-		toolchain-glibc_headers_install
224
-		return
225
-	fi
226
-
227
-	setup_env
228
-
229
-	if [[ -z ${OABI} ]] ; then
230
-		local abilist=""
231
-		if has_multilib_profile ; then
232
-			abilist=$(get_install_abis)
233
-			einfo "Installing multilib glibc for ABIs: ${abilist}"
234
-		elif is_crosscompile || tc-is-cross-compiler ; then
235
-			abilist=${DEFAULT_ABI}
236
-		fi
237
-		if [[ -n ${abilist} ]] ; then
238
-			OABI=${ABI}
239
-			for ABI in ${abilist} ; do
240
-				export ABI
241
-				eblit-glibc-src_install
242
-			done
243
-			ABI=${OABI}
244
-			unset OABI
245
-			src_strip
246
-			return 0
247
-		fi
248
-	fi
249
-
250
-	toolchain-glibc_src_install
251
-	[[ -z ${OABI} ]] && src_strip
252
-}
... ...
@@ -1,250 +0,0 @@
1
-# Copyright 1999-2007 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install-2.6.eblit,v 1.2 2008/06/29 16:39:23 vapier Exp $
4
-
5
-toolchain-glibc_src_install() {
6
-	# These should not be set, else the
7
-	# zoneinfo do not always get installed ...
8
-	unset LANGUAGE LANG LC_ALL
9
-
10
-	local GBUILDDIR
11
-	if want_linuxthreads ; then
12
-		GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
13
-	else
14
-		GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
15
-	fi
16
-
17
-	local install_root=${D}
18
-	is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
19
-	if want_linuxthreads ; then
20
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
21
-		einfo "Installing GLIBC ${ABI} with linuxthreads ..."
22
-		make PARALLELMFLAGS="${MAKEOPTS}" \
23
-			install_root="${install_root}" \
24
-			install || die
25
-	else # nptlonly
26
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
27
-		einfo "Installing GLIBC ${ABI} with NPTL ..."
28
-		make PARALLELMFLAGS="${MAKEOPTS}" \
29
-			install_root="${install_root}" \
30
-			install || die
31
-	fi
32
-
33
-	if is_crosscompile ; then
34
-		# punt all the junk not needed by a cross-compiler
35
-		cd "${D}"/usr/${CTARGET} || die
36
-		rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
37
-	fi
38
-
39
-	if want_linuxthreads && want_nptl ; then
40
-		einfo "Installing NPTL to $(alt_libdir)/tls/..."
41
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
42
-		dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
43
-
44
-		local l src_lib
45
-		for l in libc libm librt libpthread libthread_db ; do
46
-			# take care of shared lib first ...
47
-			l=${l}.so
48
-			if [[ -e ${l} ]] ; then
49
-				src_lib=${l}
50
-			else
51
-				src_lib=$(eval echo */${l})
52
-			fi
53
-			cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
54
-			fperms a+rx $(alt_libdir)/tls/${l}
55
-			dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
56
-
57
-			# then grab the linker script or the symlink ...
58
-			if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
59
-				dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
60
-			else
61
-				sed \
62
-					-e "s:/${l}:/tls/${l}:g" \
63
-					-e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
64
-					"${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
65
-			fi
66
-
67
-			# then grab the static lib ...
68
-			src_lib=${src_lib/%.so/.a}
69
-			[[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
70
-			cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
71
-			src_lib=${src_lib/%.a/_nonshared.a}
72
-			if [[ -e ${src_lib} ]] ; then
73
-				cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
74
-			fi
75
-		done
76
-
77
-		# use the nptl linker instead of the linuxthreads one as the linuxthreads
78
-		# one may lack TLS support and that can be really bad for business
79
-		cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
80
-	fi
81
-
82
-	# We'll take care of the cache ourselves
83
-	rm -f "${D}"/etc/ld.so.cache
84
-
85
-	# Some things want this, notably ash.
86
-	dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
87
-
88
-	# Handle includes for different ABIs
89
-	prep_ml_includes $(alt_headers)
90
-
91
-	# When cross-compiling for a non-multilib setup, make sure we have
92
-	# lib and a proper symlink setup
93
-	if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
94
-		cd "${D}"$(alt_libdir)/..
95
-		mv $(get_libdir) lib || die
96
-		ln -s lib $(get_libdir) || die
97
-		cd "${D}"$(alt_usrlibdir)/..
98
-		mv $(get_libdir) lib || die
99
-		ln -s lib $(get_libdir) || die
100
-	fi
101
-
102
-	#################################################################
103
-	# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
104
-	# Make sure we install some symlink hacks so that when we build
105
-	# a 2nd stage cross-compiler, gcc finds the target system
106
-	# headers correctly.  See gcc/doc/gccinstall.info
107
-	if is_crosscompile ; then
108
-		dosym usr/include /usr/${CTARGET}/sys-include
109
-		return 0
110
-	fi
111
-
112
-	# Everything past this point just needs to be done once ...
113
-	is_final_abi || return 0
114
-
115
-	# Make sure the non-native interp can be found on multilib systems
116
-	if has_multilib_profile ; then
117
-		case $(tc-arch) in
118
-			amd64)
119
-				[[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
120
-				dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
121
-				;;
122
-			ppc64)
123
-				[[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
124
-				dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
125
-				;;
126
-		esac
127
-	fi
128
-
129
-	# Files for Debian-style locale updating
130
-	dodir /usr/share/i18n
131
-	sed \
132
-		-e "/^#/d" \
133
-		-e "/SUPPORTED-LOCALES=/d" \
134
-		-e "s: \\\\::g" -e "s:/: :g" \
135
-		"${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
136
-		|| die "generating /usr/share/i18n/SUPPORTED failed"
137
-	cd "${WORKDIR}"/extra/locale
138
-	dosbin locale-gen || die
139
-	doman *.[0-8]
140
-	insinto /etc
141
-	doins locale.gen || die
142
-
143
-	# Make sure all the ABI's can find the locales and so we only
144
-	# have to generate one set
145
-	local a
146
-	keepdir /usr/$(get_libdir)/locale
147
-	for a in $(get_install_abis) ; do
148
-		if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
149
-			dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
150
-		fi
151
-	done
152
-
153
-	if ! has noinfo ${FEATURES} && [[ -n ${INFOPAGE_VER} ]] ; then
154
-		einfo "Installing info pages..."
155
-
156
-		make \
157
-			-C "${GBUILDDIR}" \
158
-			PARALLELMFLAGS="${MAKEOPTS}" \
159
-			install_root="${install_root}" \
160
-			info -i || die
161
-	fi
162
-
163
-	if [[ -n ${MANPAGE_VER} ]] ; then
164
-		einfo "Installing man pages..."
165
-
166
-		# Install linuxthreads man pages even if nptl is enabled
167
-		cd "${WORKDIR}"/man
168
-		doman *.3thr
169
-	fi
170
-
171
-	cd "${S}"
172
-
173
-	# Install misc network config files
174
-	insinto /etc
175
-	doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
176
-	doins "${WORKDIR}"/extra/etc/*.conf || die
177
-	doinitd "${WORKDIR}"/extra/etc/nscd || die
178
-
179
-	dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
180
-
181
-	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
182
-	# creation of the "factory" symlink in pkg_postinst().
183
-	rm -f "${D}"/etc/localtime
184
-}
185
-
186
-toolchain-glibc_headers_install() {
187
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
188
-	cd "${GBUILDDIR}"
189
-	make install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
190
-	# Copy over headers that are not part of install-headers ... these
191
-	# are pretty much taken verbatim from crosstool, see it for more details
192
-	insinto $(alt_headers)/bits
193
-	doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
194
-	insinto $(alt_headers)/gnu
195
-	doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
196
-	# Make sure we install the sys-include symlink so that when
197
-	# we build a 2nd stage cross-compiler, gcc finds the target
198
-	# system headers correctly.  See gcc/doc/gccinstall.info
199
-	dosym usr/include /usr/${CTARGET}/sys-include
200
-}
201
-
202
-src_strip() {
203
-	# gdb is lame and requires some debugging information to remain in
204
-	# libpthread, so we need to strip it by hand.  libthread_db makes no
205
-	# sense stripped as it is only used when debugging.
206
-	local pthread=$(hasq splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}")
207
-	env \
208
-		-uRESTRICT \
209
-		CHOST=${CTARGET} \
210
-		STRIP_MASK="/*/{,tls/}${pthread}*" \
211
-		prepallstrip
212
-	# if user has stripping enabled and does not have split debug turned on,
213
-	# then leave the debugging sections in libpthread.
214
-	if ! hasq nostrip ${FEATURES} && ! hasq splitdebug ${FEATURES} ; then
215
-		${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so
216
-	fi
217
-}
218
-
219
-eblit-glibc-src_install() {
220
-	if just_headers ; then
221
-		toolchain-glibc_headers_install
222
-		return
223
-	fi
224
-
225
-	setup_env
226
-
227
-	if [[ -z ${OABI} ]] ; then
228
-		local abilist=""
229
-		if has_multilib_profile ; then
230
-			abilist=$(get_install_abis)
231
-			einfo "Installing multilib glibc for ABIs: ${abilist}"
232
-		elif is_crosscompile || tc-is-cross-compiler ; then
233
-			abilist=${DEFAULT_ABI}
234
-		fi
235
-		if [[ -n ${abilist} ]] ; then
236
-			OABI=${ABI}
237
-			for ABI in ${abilist} ; do
238
-				export ABI
239
-				eblit-glibc-src_install
240
-			done
241
-			ABI=${OABI}
242
-			unset OABI
243
-			src_strip
244
-			return 0
245
-		fi
246
-	fi
247
-
248
-	toolchain-glibc_src_install
249
-	[[ -z ${OABI} ]] && src_strip
250
-}
... ...
@@ -1,249 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_install.eblit,v 1.10 2010/08/10 08:08:05 vapier Exp $
4
-
5
-toolchain-glibc_src_install() {
6
-	local GBUILDDIR
7
-	if want_linuxthreads ; then
8
-		GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-linuxthreads
9
-	else
10
-		GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-nptl
11
-	fi
12
-
13
-	local install_root=${D}
14
-	is_crosscompile && install_root="${install_root}/usr/${CTARGET}"
15
-	if want_linuxthreads ; then
16
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-linuxthreads
17
-		einfo "Installing GLIBC ${ABI} with linuxthreads ..."
18
-	else # nptlonly
19
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
20
-		einfo "Installing GLIBC ${ABI} with NPTL ..."
21
-	fi
22
-	emake install_root="${install_root}" install || die
23
-
24
-	if is_crosscompile ; then
25
-		# punt all the junk not needed by a cross-compiler
26
-		cd "${D}"/usr/${CTARGET} || die
27
-		rm -rf ./{,usr/}{bin,etc,sbin,share} ./{,usr/}*/{gconv,misc}
28
-	fi
29
-
30
-	if want_linuxthreads && want_nptl ; then
31
-		einfo "Installing NPTL to $(alt_libdir)/tls/..."
32
-		cd "${WORKDIR}"/build-${ABI}-${CTARGET}-nptl
33
-		dodir $(alt_libdir)/tls $(alt_usrlibdir)/nptl
34
-
35
-		local l src_lib
36
-		for l in libc libm librt libpthread libthread_db ; do
37
-			# take care of shared lib first ...
38
-			l=${l}.so
39
-			if [[ -e ${l} ]] ; then
40
-				src_lib=${l}
41
-			else
42
-				src_lib=$(eval echo */${l})
43
-			fi
44
-			cp -a ${src_lib} "${D}"$(alt_libdir)/tls/${l} || die "copying nptl ${l}"
45
-			fperms a+rx $(alt_libdir)/tls/${l}
46
-			dosym ${l} $(alt_libdir)/tls/$(scanelf -qSF'%S#F' ${src_lib})
47
-
48
-			# then grab the linker script or the symlink ...
49
-			if [[ -L ${D}$(alt_usrlibdir)/${l} ]] ; then
50
-				dosym $(alt_libdir)/tls/${l} $(alt_usrlibdir)/nptl/${l}
51
-			else
52
-				sed \
53
-					-e "s:/${l}:/tls/${l}:g" \
54
-					-e "s:/${l/%.so/_nonshared.a}:/nptl/${l/%.so/_nonshared.a}:g" \
55
-					"${D}"$(alt_usrlibdir)/${l} > "${D}"$(alt_usrlibdir)/nptl/${l}
56
-			fi
57
-
58
-			# then grab the static lib ...
59
-			src_lib=${src_lib/%.so/.a}
60
-			[[ ! -e ${src_lib} ]] && src_lib=${src_lib/%.a/_pic.a}
61
-			cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
62
-			src_lib=${src_lib/%.a/_nonshared.a}
63
-			if [[ -e ${src_lib} ]] ; then
64
-				cp -a ${src_lib} "${D}"$(alt_usrlibdir)/nptl/ || die "copying nptl ${src_lib}"
65
-			fi
66
-		done
67
-
68
-		# use the nptl linker instead of the linuxthreads one as the linuxthreads
69
-		# one may lack TLS support and that can be really bad for business
70
-		cp -a elf/ld.so "${D}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
71
-	fi
72
-
73
-	# We'll take care of the cache ourselves
74
-	rm -f "${D}"/etc/ld.so.cache
75
-
76
-	# Some things want this, notably ash.
77
-	dosym libbsd-compat.a $(alt_usrlibdir)/libbsd.a
78
-
79
-	# Handle includes for different ABIs if glibc itself doesn't do it
80
-	# XXX: curr glibc should finally handle all of them correctly
81
-	#case $(tc-arch) in
82
-	#	amd64|mips|ppc|s390) ;;
83
-	#	*) prep_ml_includes $(alt_headers) ;;
84
-	#esac
85
-
86
-	# When cross-compiling for a non-multilib setup, make sure we have
87
-	# lib and a proper symlink setup
88
-	if is_crosscompile && ! use multilib && ! has_multilib_profile && [[ $(get_libdir) != "lib" ]] ; then
89
-		cd "${D}"$(alt_libdir)/..
90
-		mv $(get_libdir) lib || die
91
-		ln -s lib $(get_libdir) || die
92
-		cd "${D}"$(alt_usrlibdir)/..
93
-		mv $(get_libdir) lib || die
94
-		ln -s lib $(get_libdir) || die
95
-	fi
96
-
97
-	#################################################################
98
-	# EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY #
99
-	# Make sure we install some symlink hacks so that when we build
100
-	# a 2nd stage cross-compiler, gcc finds the target system
101
-	# headers correctly.  See gcc/doc/gccinstall.info
102
-	if is_crosscompile ; then
103
-		dosym usr/include /usr/${CTARGET}/sys-include
104
-		return 0
105
-	fi
106
-
107
-	# Everything past this point just needs to be done once ...
108
-	is_final_abi || return 0
109
-
110
-	# Make sure the non-native interp can be found on multilib systems
111
-	if has_multilib_profile ; then
112
-		case $(tc-arch) in
113
-			amd64)
114
-				[[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR amd64) /lib
115
-				dosym ../$(get_abi_LIBDIR x86)/ld-linux.so.2 /lib/ld-linux.so.2
116
-				;;
117
-			ppc64)
118
-				[[ ! -e ${D}/lib ]] && dosym $(get_abi_LIBDIR ppc64) /lib
119
-				dosym ../$(get_abi_LIBDIR ppc)/ld.so.1 /lib/ld.so.1
120
-				;;
121
-		esac
122
-	fi
123
-
124
-	# Files for Debian-style locale updating
125
-	dodir /usr/share/i18n
126
-	sed \
127
-		-e "/^#/d" \
128
-		-e "/SUPPORTED-LOCALES=/d" \
129
-		-e "s: \\\\::g" -e "s:/: :g" \
130
-		"${S}"/localedata/SUPPORTED > "${D}"/usr/share/i18n/SUPPORTED \
131
-		|| die "generating /usr/share/i18n/SUPPORTED failed"
132
-	cd "${WORKDIR}"/extra/locale
133
-	dosbin locale-gen || die
134
-	doman *.[0-8]
135
-	insinto /etc
136
-	doins locale.gen || die
137
-
138
-	# Make sure all the ABI's can find the locales and so we only
139
-	# have to generate one set
140
-	local a
141
-	keepdir /usr/$(get_libdir)/locale
142
-	for a in $(get_install_abis) ; do
143
-		if [[ ! -e ${D}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
144
-			dosym /usr/$(get_libdir)/locale /usr/$(get_abi_LIBDIR ${a})/locale
145
-		fi
146
-	done
147
-
148
-	if ! has noinfo ${FEATURES} && [[ -n ${INFOPAGE_VER} ]] ; then
149
-		einfo "Installing info pages..."
150
-
151
-		emake \
152
-			-C "${GBUILDDIR}" \
153
-			install_root="${install_root}" \
154
-			info -i || die
155
-	fi
156
-
157
-	if [[ -n ${MANPAGE_VER} ]] ; then
158
-		einfo "Installing man pages..."
159
-
160
-		# Install linuxthreads man pages even if nptl is enabled
161
-		cd "${WORKDIR}"/man
162
-		doman *.3thr
163
-	fi
164
-
165
-	cd "${S}"
166
-
167
-	# Install misc network config files
168
-	insinto /etc
169
-	doins nscd/nscd.conf posix/gai.conf nss/nsswitch.conf || die
170
-	doins "${WORKDIR}"/extra/etc/*.conf || die
171
-	doinitd "${WORKDIR}"/extra/etc/nscd || die
172
-
173
-	sed -i -e "s:@PIDFILE@:$(strings "${D}"/usr/sbin/nscd | grep nscd.pid):" "${D}"/etc/init.d/nscd
174
-
175
-	echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc
176
-	doenvd "${T}"/00glibc || die
177
-
178
-	dodoc BUGS ChangeLog* CONFORMANCE FAQ NEWS NOTES PROJECTS README*
179
-
180
-	# Prevent overwriting of the /etc/localtime symlink.  We'll handle the
181
-	# creation of the "factory" symlink in pkg_postinst().
182
-	rm -f "${D}"/etc/localtime
183
-}
184
-
185
-toolchain-glibc_headers_install() {
186
-	local GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
187
-	cd "${GBUILDDIR}"
188
-	emake install_root="${D}/usr/${CTARGET}" install-headers || die "install-headers failed"
189
-	# Copy over headers that are not part of install-headers ... these
190
-	# are pretty much taken verbatim from crosstool, see it for more details
191
-	insinto $(alt_headers)/bits
192
-	doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
193
-	insinto $(alt_headers)/gnu
194
-	doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
195
-	# Make sure we install the sys-include symlink so that when
196
-	# we build a 2nd stage cross-compiler, gcc finds the target
197
-	# system headers correctly.  See gcc/doc/gccinstall.info
198
-	dosym usr/include /usr/${CTARGET}/sys-include
199
-}
200
-
201
-src_strip() {
202
-	# gdb is lame and requires some debugging information to remain in
203
-	# libpthread, so we need to strip it by hand.  libthread_db makes no
204
-	# sense stripped as it is only used when debugging.
205
-	local pthread=$(hasq splitdebug ${FEATURES} && echo "libthread_db" || echo "lib{pthread,thread_db}")
206
-	env \
207
-		-uRESTRICT \
208
-		CHOST=${CTARGET} \
209
-		STRIP_MASK="/*/{,tls/}${pthread}*" \
210
-		prepallstrip
211
-	# if user has stripping enabled and does not have split debug turned on,
212
-	# then leave the debugging sections in libpthread.
213
-	if ! hasq nostrip ${FEATURES} && ! hasq splitdebug ${FEATURES} ; then
214
-		${STRIP:-${CTARGET}-strip} --strip-debug "${D}"/*/libpthread-*.so
215
-	fi
216
-}
217
-
218
-eblit-glibc-src_install() {
219
-	if just_headers ; then
220
-		toolchain-glibc_headers_install
221
-		return
222
-	fi
223
-
224
-	setup_env
225
-
226
-	if [[ -z ${OABI} ]] ; then
227
-		local abilist=""
228
-		if has_multilib_profile ; then
229
-			abilist=$(get_install_abis)
230
-			einfo "Installing multilib glibc for ABIs: ${abilist}"
231
-		elif is_crosscompile || tc-is-cross-compiler ; then
232
-			abilist=${DEFAULT_ABI}
233
-		fi
234
-		if [[ -n ${abilist} ]] ; then
235
-			OABI=${ABI}
236
-			for ABI in ${abilist} ; do
237
-				export ABI
238
-				eblit-glibc-src_install
239
-			done
240
-			ABI=${OABI}
241
-			unset OABI
242
-			src_strip
243
-			return 0
244
-		fi
245
-	fi
246
-
247
-	toolchain-glibc_src_install
248
-	[[ -z ${OABI} ]] && src_strip
249
-}
... ...
@@ -1,42 +0,0 @@
1
-# Copyright 1999-2007 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_test-2.11.2.eblit,v 1.1 2010/08/10 08:08:05 vapier Exp $
4
-
5
-toolchain-glibc_src_test() {
6
-	cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
7
-	unset LD_ASSUME_KERNEL
8
-	make check && return 0
9
-	einfo "make check failed - re-running with --keep-going to get the rest of the results"
10
-	make -k check
11
-	ewarn "make check failed for ${ABI}-${CTARGET}-$1"
12
-	return 1
13
-}
14
-
15
-eblit-glibc-src_test() {
16
-	local ret=0
17
-
18
-	setup_env
19
-
20
-	# give tests more time to complete
21
-	export TIMEOUTFACTOR=5
22
-
23
-	if [[ -z ${OABI} ]] && has_multilib_profile ; then
24
-		OABI=${ABI}
25
-		einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
26
-		for ABI in $(get_install_abis) ; do
27
-			export ABI
28
-			einfo "   Testing ${ABI} glibc"
29
-			src_test
30
-			((ret+=$?))
31
-		done
32
-		ABI=${OABI}
33
-		unset OABI
34
-		[[ ${ret} -ne 0 ]] \
35
-			&& die "tests failed" \
36
-			|| return 0
37
-	fi
38
-
39
-	want_linuxthreads && toolchain-glibc_src_test linuxthreads ; ((ret+=$?))
40
-	want_nptl && toolchain-glibc_src_test nptl ; ((ret+=$?))
41
-	return ${ret}
42
-}
... ...
@@ -1,42 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_test.eblit,v 1.4 2010/08/10 08:08:05 vapier Exp $
4
-
5
-toolchain-glibc_src_test() {
6
-	cd "${WORKDIR}"/build-${ABI}-${CTARGET}-$1 || die "cd build-${ABI}-${CTARGET}-$1"
7
-	unset LD_ASSUME_KERNEL
8
-	emake -j1 check && return 0
9
-	einfo "make check failed - re-running with --keep-going to get the rest of the results"
10
-	emake -j1 -k check
11
-	ewarn "make check failed for ${ABI}-${CTARGET}-$1"
12
-	return 1
13
-}
14
-
15
-eblit-glibc-src_test() {
16
-	local ret=0
17
-
18
-	setup_env
19
-
20
-	# give tests more time to complete
21
-	export TIMEOUTFACTOR=5
22
-
23
-	if [[ -z ${OABI} ]] && has_multilib_profile ; then
24
-		OABI=${ABI}
25
-		einfo "Testing multilib glibc for ABIs: $(get_install_abis)"
26
-		for ABI in $(get_install_abis) ; do
27
-			export ABI
28
-			einfo "   Testing ${ABI} glibc"
29
-			src_test
30
-			((ret+=$?))
31
-		done
32
-		ABI=${OABI}
33
-		unset OABI
34
-		[[ ${ret} -ne 0 ]] \
35
-			&& die "tests failed" \
36
-			|| return 0
37
-	fi
38
-
39
-	want_linuxthreads && toolchain-glibc_src_test linuxthreads ; ((ret+=$?))
40
-	want_nptl && toolchain-glibc_src_test nptl ; ((ret+=$?))
41
-	return ${ret}
42
-}
... ...
@@ -1,178 +0,0 @@
1
-# Copyright 1999-2009 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/src_unpack.eblit,v 1.11 2010/06/08 04:59:56 vapier Exp $
4
-
5
-int_to_KV() {
6
-	local version=$1 major minor micro
7
-	major=$((version / 65536))
8
-	minor=$(((version % 65536) / 256))
9
-	micro=$((version % 256))
10
-	echo ${major}.${minor}.${micro}
11
-}
12
-
13
-eend_KV() {
14
-	[[ $(KV_to_int $1) -ge $(KV_to_int $2) ]]
15
-	eend $?
16
-}
17
-
18
-get_kheader_version() {
19
-	printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \
20
-	$(tc-getCPP ${CTARGET}) -I "$(alt_build_headers)" | \
21
-	tail -n 1
22
-}
23
-
24
-check_nptl_support() {
25
-	# don't care about the compiler here as we arent using it
26
-	just_headers && return
27
-
28
-	local run_kv build_kv want_kv
29
-	run_kv=$(int_to_KV $(get_KV))
30
-	build_kv=$(int_to_KV $(get_kheader_version))
31
-	want_kv=${NPTL_KERN_VER}
32
-
33
-	ebegin "Checking gcc for __thread support"
34
-	if ! eend $(want__thread ; echo $?) ; then
35
-		echo
36
-		eerror "Could not find a gcc that supports the __thread directive!"
37
-		eerror "Please update your binutils/gcc and try again."
38
-		die "No __thread support in gcc!"
39
-	fi
40
-
41
-	if ! is_crosscompile && ! tc-is-cross-compiler ; then
42
-		# Building fails on an non-supporting kernel
43
-		ebegin "Checking kernel version (${run_kv} >= ${want_kv})"
44
-		if ! eend_KV ${run_kv} ${want_kv} ; then
45
-			echo
46
-			eerror "You need a kernel of at least ${want_kv} for NPTL support!"
47
-			die "Kernel version too low!"
48
-		fi
49
-	fi
50
-
51
-	ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})"
52
-	if ! eend_KV ${build_kv} ${want_kv} ; then
53
-		echo
54
-		eerror "You need linux-headers of at least ${want_kv} for NPTL support!"
55
-		die "linux-headers version too low!"
56
-	fi
57
-}
58
-
59
-unpack_pkg() {
60
-	local a=${PN}
61
-	[[ -n ${SNAP_VER} ]] && a="${a}-${RELEASE_VER}"
62
-	[[ -n $1 ]] && a="${a}-$1"
63
-	if [[ -n ${SNAP_VER} ]] ; then
64
-		a="${a}-${SNAP_VER}"
65
-	else
66
-		if [[ -n $2 ]] ; then
67
-			a="${a}-$2"
68
-		else
69
-			a="${a}-${RELEASE_VER}"
70
-		fi
71
-	fi
72
-	unpack ${a}.tar.bz2
73
-	[[ -n $1 ]] && mv ${a} $1
74
-}
75
-
76
-toolchain-glibc_src_unpack() {
77
-	# Check NPTL support _before_ we unpack things to save some time
78
-	want_nptl && check_nptl_support
79
-
80
-	unpack_pkg
81
-
82
-	cd "${S}"
83
-	touch locale/C-translit.h #185476 #218003
84
-	[[ -n ${LT_VER}     ]] && unpack_pkg linuxthreads ${LT_VER}
85
-	[[ -n ${PORTS_VER}  ]] && unpack_pkg ports ${PORTS_VER}
86
-	[[ -n ${LIBIDN_VER} ]] && unpack_pkg libidn
87
-
88
-	if [[ -n ${PATCH_VER} ]] ; then
89
-		cd "${WORKDIR}"
90
-		unpack glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
91
-		# pull out all the addons
92
-		local d
93
-		for d in extra/*/configure ; do
94
-			d=${d%/configure}
95
-			[[ -d ${S}/${d} ]] && die "${d} already exists in \${S}"
96
-			mv "${d}" "${S}" || die "moving ${d} failed"
97
-		done
98
-	fi
99
-
100
-	# XXX: We should do the branchupdate, before extracting the manpages and
101
-	# infopages else it does not help much (mtimes change if there is a change
102
-	# to them with branchupdate)
103
-	if [[ -n ${BRANCH_UPDATE} ]] ; then
104
-		cd "${S}"
105
-		epatch "${DISTDIR}"/glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
106
-
107
-		# Snapshot date patch
108
-		einfo "Patching version to display snapshot date ..."
109
-		sed -i -e "s:\(#define RELEASE\).*:\1 \"${BRANCH_UPDATE}\":" version.h
110
-	fi
111
-
112
-	if [[ -n ${MANPAGE_VER} ]] ; then
113
-		cd "${WORKDIR}"
114
-		unpack glibc-manpages-${MANPAGE_VER}.tar.bz2
115
-	fi
116
-
117
-	if [[ -n ${INFOPAGE_VER} ]] ; then
118
-		cd "${S}"
119
-		unpack glibc-infopages-${INFOPAGE_VER}.tar.bz2
120
-	fi
121
-
122
-	# tag, glibc is it
123
-	cd "${S}"
124
-	[[ -e csu/Banner ]] && die "need new banner location"
125
-	[[ -n ${SNAP_VER} ]] && echo "Gentoo snapshot ${SNAP_VER}" >> csu/Banner
126
-	[[ -n ${BRANCH_UPDATE} ]] && echo "Gentoo branch ${BRANCH_UPDATE}" >> csu/Banner
127
-	if [[ -n ${PATCH_VER} ]] && ! use vanilla ; then
128
-		cd "${S}"
129
-		EPATCH_MULTI_MSG="Applying Gentoo Glibc Patchset ${RELEASE_VER}-${PATCH_VER} ..." \
130
-		EPATCH_EXCLUDE=${GLIBC_PATCH_EXCLUDE} \
131
-		EPATCH_SUFFIX="patch" \
132
-		ARCH=$(tc-arch) \
133
-		epatch "${WORKDIR}"/patches
134
-		echo "Gentoo patchset ${PATCH_VER}" >> csu/Banner
135
-	fi
136
-
137
-	epatch_user
138
-
139
-	gnuconfig_update
140
-}
141
-
142
-eblit-glibc-src_unpack() {
143
-	setup_env
144
-
145
-	toolchain-glibc_src_unpack
146
-
147
-	# Backwards SSP support
148
-	cd "${S}"
149
-# For now, we force everyone to have the extra symbols
150
-#	einfon "Scanning system for __guard to see if we need SSP compat ... "
151
-#	if [[ -n $(scanelf -qyls__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
152
-		echo "yes" > "${T}"/.ssp.compat
153
-#	else
154
-#		# ok, a quick scan didnt find it, so lets do a deep scan ...
155
-#		if [[ -n $(scanelf -qyRlps__guard -F'#s%F' | grep -v '^/lib.*/libc-2.*.so$') ]] ; then
156
-#			echo "yes" > "${T}"/.ssp.compat
157
-#		else
158
-#			echo "no" > "${T}"/.ssp.compat
159
-#		fi
160
-#	fi
161
-#	cat "${T}"/.ssp.compat
162
-
163
-	# Glibc is stupid sometimes, and doesn't realize that with a
164
-	# static C-Only gcc, -lgcc_eh doesn't exist.
165
-	# http://sources.redhat.com/ml/libc-alpha/2003-09/msg00100.html
166
-	# http://sourceware.org/ml/libc-alpha/2005-02/msg00042.html
167
-	echo 'int main(){}' > "${T}"/gcc_eh_test.c
168
-	if ! $(tc-getCC ${CTARGET}) "${T}"/gcc_eh_test.c -lgcc_eh 2>/dev/null ; then
169
-		sed -i -e 's:-lgcc_eh::' Makeconfig || die "sed gcc_eh"
170
-	fi
171
-
172
-	cd "${WORKDIR}"
173
-	find . -type f '(' -size 0 -o -name "*.orig" ')' -exec rm -f {} \;
174
-	find . -name configure -exec touch {} \;
175
-
176
-	# Fix permissions on some of the scripts
177
-	chmod u+x "${S}"/scripts/*.sh
178
-}
... ...
@@ -1,73 +0,0 @@
1
-diff --git a/elf/dl-load.c b/elf/dl-load.c
2
-index a7162eb..776f7e4 100644
3
---- a/elf/dl-load.c
4
-+++ b/elf/dl-load.c
5
-@@ -169,8 +169,7 @@ local_strdup (const char *s)
6
- 
7
- 
8
- static size_t
9
--is_dst (const char *start, const char *name, const char *str,
10
--	int is_path, int secure)
11
-+is_dst (const char *start, const char *name, const char *str, int is_path)
12
- {
13
-   size_t len;
14
-   bool is_curly = false;
15
-@@ -199,11 +198,6 @@ is_dst (const char *start, const char *name, const char *str,
16
- 	   && (!is_path || name[len] != ':'))
17
-     return 0;
18
- 
19
--  if (__builtin_expect (secure, 0)
20
--      && ((name[len] != '\0' && (!is_path || name[len] != ':'))
21
--	  || (name != start + 1 && (!is_path || name[-2] != ':'))))
22
--    return 0;
23
--
24
-   return len;
25
- }
26
- 
27
-@@ -218,13 +212,12 @@ _dl_dst_count (const char *name, int is_path)
28
-     {
29
-       size_t len;
30
- 
31
--      /* $ORIGIN is not expanded for SUID/GUID programs (except if it
32
--	 is $ORIGIN alone) and it must always appear first in path.  */
33
-+      /* $ORIGIN is not expanded for SUID/GUID programs.  */
34
-       ++name;
35
--      if ((len = is_dst (start, name, "ORIGIN", is_path,
36
--			 INTUSE(__libc_enable_secure))) != 0
37
--	  || (len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0
38
--	  || (len = is_dst (start, name, "LIB", is_path, 0)) != 0)
39
-+      if (((len = is_dst (start, name, "ORIGIN", is_path)) != 0
40
-+	   && !INTUSE(__libc_enable_secure))
41
-+	  || (len = is_dst (start, name, "PLATFORM", is_path)) != 0
42
-+	  || (len = is_dst (start, name, "LIB", is_path)) != 0)
43
- 	++cnt;
44
- 
45
-       name = strchr (name + len, '$');
46
-@@ -256,9 +249,12 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
47
- 	  size_t len;
48
- 
49
- 	  ++name;
50
--	  if ((len = is_dst (start, name, "ORIGIN", is_path,
51
--			     INTUSE(__libc_enable_secure))) != 0)
52
-+	  if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0)
53
- 	    {
54
-+	      /* Ignore this path element in SUID/SGID programs.  */
55
-+	      if (INTUSE(__libc_enable_secure))
56
-+		repl = (const char *) -1;
57
-+	      else
58
- #ifndef SHARED
59
- 	      if (l == NULL)
60
- 		repl = _dl_get_origin ();
61
-@@ -266,9 +262,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
62
- #endif
63
- 		repl = l->l_origin;
64
- 	    }
65
--	  else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
66
-+	  else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0)
67
- 	    repl = GLRO(dl_platform);
68
--	  else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0)
69
-+	  else if ((len = is_dst (start, name, "LIB", is_path)) != 0)
70
- 	    repl = DL_DST_LIB;
71
- 
72
- 	  if (repl != NULL && repl != (const char *) -1)
73
-
... ...
@@ -1,201 +0,0 @@
1
-diff --git a/elf/dl-deps.c b/elf/dl-deps.c
2
-index e5b9cdf..1cab2d1 100644
3
---- a/elf/dl-deps.c
4
-+++ b/elf/dl-deps.c
5
-@@ -62,7 +62,7 @@ openaux (void *a)
6
- {
7
-   struct openaux_args *args = (struct openaux_args *) a;
8
- 
9
--  args->aux = _dl_map_object (args->map, args->name, 0,
10
-+  args->aux = _dl_map_object (args->map, args->name,
11
- 			      (args->map->l_type == lt_executable
12
- 			       ? lt_library : args->map->l_type),
13
- 			      args->trace_mode, args->open_mode,
14
-diff --git a/elf/dl-load.c b/elf/dl-load.c
15
-index 776f7e4..9ab3520 100644
16
---- a/elf/dl-load.c
17
-+++ b/elf/dl-load.c
18
-@@ -1808,7 +1808,7 @@ open_verify (const char *name, struct filebuf *fbp, struct link_map *loader,
19
-    if MAY_FREE_DIRS is true.  */
20
- 
21
- static int
22
--open_path (const char *name, size_t namelen, int preloaded,
23
-+open_path (const char *name, size_t namelen, int secure,
24
- 	   struct r_search_path_struct *sps, char **realname,
25
- 	   struct filebuf *fbp, struct link_map *loader, int whatcode,
26
- 	   bool *found_other_class)
27
-@@ -1890,7 +1890,7 @@ open_path (const char *name, size_t namelen, int preloaded,
28
- 	  /* Remember whether we found any existing directory.  */
29
- 	  here_any |= this_dir->status[cnt] != nonexisting;
30
- 
31
--	  if (fd != -1 && __builtin_expect (preloaded, 0)
32
-+	  if (fd != -1 && __builtin_expect (secure, 0)
33
- 	      && INTUSE(__libc_enable_secure))
34
- 	    {
35
- 	      /* This is an extra security effort to make sure nobody can
36
-@@ -1959,7 +1959,7 @@ open_path (const char *name, size_t namelen, int preloaded,
37
- 
38
- struct link_map *
39
- internal_function
40
--_dl_map_object (struct link_map *loader, const char *name, int preloaded,
41
-+_dl_map_object (struct link_map *loader, const char *name,
42
- 		int type, int trace_mode, int mode, Lmid_t nsid)
43
- {
44
-   int fd;
45
-@@ -2063,7 +2063,8 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
46
- 	  for (l = loader; l; l = l->l_loader)
47
- 	    if (cache_rpath (l, &l->l_rpath_dirs, DT_RPATH, "RPATH"))
48
- 	      {
49
--		fd = open_path (name, namelen, preloaded, &l->l_rpath_dirs,
50
-+		fd = open_path (name, namelen, mode & __RTLD_SECURE,
51
-+				&l->l_rpath_dirs,
52
- 				&realname, &fb, loader, LA_SER_RUNPATH,
53
- 				&found_other_class);
54
- 		if (fd != -1)
55
-@@ -2078,14 +2079,15 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
56
- 	      && main_map != NULL && main_map->l_type != lt_loaded
57
- 	      && cache_rpath (main_map, &main_map->l_rpath_dirs, DT_RPATH,
58
- 			      "RPATH"))
59
--	    fd = open_path (name, namelen, preloaded, &main_map->l_rpath_dirs,
60
-+	    fd = open_path (name, namelen, mode & __RTLD_SECURE,
61
-+			    &main_map->l_rpath_dirs,
62
- 			    &realname, &fb, loader ?: main_map, LA_SER_RUNPATH,
63
- 			    &found_other_class);
64
- 	}
65
- 
66
-       /* Try the LD_LIBRARY_PATH environment variable.  */
67
-       if (fd == -1 && env_path_list.dirs != (void *) -1)
68
--	fd = open_path (name, namelen, preloaded, &env_path_list,
69
-+	fd = open_path (name, namelen, mode & __RTLD_SECURE, &env_path_list,
70
- 			&realname, &fb,
71
- 			loader ?: GL(dl_ns)[LM_ID_BASE]._ns_loaded,
72
- 			LA_SER_LIBPATH, &found_other_class);
73
-@@ -2094,12 +2096,12 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
74
-       if (fd == -1 && loader != NULL
75
- 	  && cache_rpath (loader, &loader->l_runpath_dirs,
76
- 			  DT_RUNPATH, "RUNPATH"))
77
--	fd = open_path (name, namelen, preloaded,
78
-+	fd = open_path (name, namelen, mode & __RTLD_SECURE,
79
- 			&loader->l_runpath_dirs, &realname, &fb, loader,
80
- 			LA_SER_RUNPATH, &found_other_class);
81
- 
82
-       if (fd == -1
83
--	  && (__builtin_expect (! preloaded, 1)
84
-+	  && (__builtin_expect (! (mode & __RTLD_SECURE), 1)
85
- 	      || ! INTUSE(__libc_enable_secure)))
86
- 	{
87
- 	  /* Check the list of libraries in the file /etc/ld.so.cache,
88
-@@ -2165,7 +2167,7 @@ _dl_map_object (struct link_map *loader, const char *name, int preloaded,
89
- 	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
90
- 	      || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
91
- 	  && rtld_search_dirs.dirs != (void *) -1)
92
--	fd = open_path (name, namelen, preloaded, &rtld_search_dirs,
93
-+	fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
94
- 			&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
95
- 
96
-       /* Add another newline when we are tracing the library loading.  */
97
-diff --git a/elf/dl-open.c b/elf/dl-open.c
98
-index c394b3f..cf8e8cc 100644
99
---- a/elf/dl-open.c
100
-+++ b/elf/dl-open.c
101
-@@ -223,7 +223,7 @@ dl_open_worker (void *a)
102
- 
103
-   /* Load the named object.  */
104
-   struct link_map *new;
105
--  args->map = new = _dl_map_object (call_map, file, 0, lt_loaded, 0,
106
-+  args->map = new = _dl_map_object (call_map, file, lt_loaded, 0,
107
- 				    mode | __RTLD_CALLMAP, args->nsid);
108
- 
109
-   /* If the pointer returned is NULL this means the RTLD_NOLOAD flag is
110
-diff --git a/elf/rtld.c b/elf/rtld.c
111
-index 201c9cf..4a8cee8 100644
112
---- a/elf/rtld.c
113
-+++ b/elf/rtld.c
114
-@@ -587,7 +587,6 @@ struct map_args
115
-   /* Argument to map_doit.  */
116
-   char *str;
117
-   struct link_map *loader;
118
--  int is_preloaded;
119
-   int mode;
120
-   /* Return value of map_doit.  */
121
-   struct link_map *map;
122
-@@ -625,16 +624,17 @@ static void
123
- map_doit (void *a)
124
- {
125
-   struct map_args *args = (struct map_args *) a;
126
--  args->map = _dl_map_object (args->loader, args->str,
127
--			      args->is_preloaded, lt_library, 0, args->mode,
128
--			      LM_ID_BASE);
129
-+  args->map = _dl_map_object (args->loader, args->str, lt_library, 0,
130
-+			      args->mode, LM_ID_BASE);
131
- }
132
- 
133
- static void
134
- dlmopen_doit (void *a)
135
- {
136
-   struct dlmopen_args *args = (struct dlmopen_args *) a;
137
--  args->map = _dl_open (args->fname, RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT,
138
-+  args->map = _dl_open (args->fname,
139
-+			(RTLD_LAZY | __RTLD_DLOPEN | __RTLD_AUDIT
140
-+			 | __RTLD_SECURE),
141
- 			dl_main, LM_ID_NEWLM, _dl_argc, INTUSE(_dl_argv),
142
- 			__environ);
143
- }
144
-@@ -804,8 +804,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where)
145
- 
146
-   args.str = fname;
147
-   args.loader = main_map;
148
--  args.is_preloaded = 1;
149
--  args.mode = 0;
150
-+  args.mode = __RTLD_SECURE;
151
- 
152
-   unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
153
- 
154
-@@ -1050,7 +1049,6 @@ of this helper program; chances are you did not intend to run this program.\n\
155
- 
156
- 	  args.str = rtld_progname;
157
- 	  args.loader = NULL;
158
--	  args.is_preloaded = 0;
159
- 	  args.mode = __RTLD_OPENEXEC;
160
- 	  (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
161
- 				  &args);
162
-@@ -1062,7 +1060,7 @@ of this helper program; chances are you did not intend to run this program.\n\
163
-       else
164
- 	{
165
- 	  HP_TIMING_NOW (start);
166
--	  _dl_map_object (NULL, rtld_progname, 0, lt_library, 0,
167
-+	  _dl_map_object (NULL, rtld_progname, lt_library, 0,
168
- 			  __RTLD_OPENEXEC, LM_ID_BASE);
169
- 	  HP_TIMING_NOW (stop);
170
- 
171
-diff --git a/include/dlfcn.h b/include/dlfcn.h
172
-index a67426d..af92483 100644
173
---- a/include/dlfcn.h
174
-+++ b/include/dlfcn.h
175
-@@ -9,6 +9,7 @@
176
- #define __RTLD_OPENEXEC	0x20000000
177
- #define __RTLD_CALLMAP	0x10000000
178
- #define __RTLD_AUDIT	0x08000000
179
-+#define __RTLD_SECURE	0x04000000 /* Apply additional security checks.  */
180
- 
181
- #define __LM_ID_CALLER	-2
182
- 
183
-diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
184
-index fcc943b..fa4b6b2 100644
185
---- a/sysdeps/generic/ldsodefs.h
186
-+++ b/sysdeps/generic/ldsodefs.h
187
-@@ -824,11 +824,9 @@ extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
188
- 
189
- /* Open the shared object NAME and map in its segments.
190
-    LOADER's DT_RPATH is used in searching for NAME.
191
--   If the object is already opened, returns its existing map.
192
--   For preloaded shared objects PRELOADED is set to a non-zero
193
--   value to allow additional security checks.  */
194
-+   If the object is already opened, returns its existing map.  */
195
- extern struct link_map *_dl_map_object (struct link_map *loader,
196
--					const char *name, int preloaded,
197
-+					const char *name,
198
- 					int type, int trace_mode, int mode,
199
- 					Lmid_t nsid)
200
-      internal_function attribute_hidden;
201
-
... ...
@@ -1,64 +0,0 @@
1
-#!/sbin/runscript
2
-# Copyright 1999-2005 Gentoo Foundation
3
-# Distributed under the terms of the GNU General Public License v2
4
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/nscd,v 1.7 2007/02/23 12:09:39 uberlord Exp $
5
-
6
-depend() {
7
-	use dns ldap net slapd
8
-}
9
-
10
-checkconfig() {
11
-	if [ ! -d /var/run/nscd ] ; then
12
-		mkdir -p /var/run/nscd
13
-		chmod 755 /var/run/nscd
14
-	fi
15
-	if [ -z "${NSCD_PERMS_OK}" ] && [ "$(stat -c %a /var/run/nscd)" != "755" ] ; then
16
-		echo ""
17
-		ewarn "nscd run dir is not world readable, you should reset the perms:"
18
-		ewarn "chmod 755 /var/run/nscd"
19
-		ewarn "chmod a+rw /var/run/nscd/socket"
20
-		echo ""
21
-		ewarn "To disable this warning, set 'NSCD_PERMS_OK' in /etc/conf.d/nscd"
22
-		echo ""
23
-	fi
24
-}
25
-
26
-start() {
27
-	checkconfig
28
-
29
-	ebegin "Starting Name Service Cache Daemon"
30
-	local secure=`while read curline ; do
31
-		table=${curline%:*}
32
-		entries=${curline##$table:}
33
-		table=${table%%[^a-z]*}
34
-		case $table in
35
-			passwd*|group*|hosts)
36
-			for entry in $entries ; do
37
-			case $entry in
38
-				nisplus*)
39
-					/usr/sbin/nscd_nischeck $table || \
40
-					/echo "-S $table,yes"
41
-				;;
42
-			esac
43
-			done
44
-		;;
45
-		esac
46
-		done < /etc/nsswitch.conf`
47
-	local pidfile="$(strings /usr/sbin/nscd | grep nscd.pid)"
48
-	mkdir -p "$(dirname ${pidfile})"
49
-	save_options pidfile "${pidfile}"
50
-	start-stop-daemon --start --quiet \
51
-		--exec /usr/sbin/nscd --pidfile "${pidfile}" \
52
-		-- $secure
53
-	eend $?
54
-}
55
-
56
-stop() {
57
-	local pidfile="$(get_options pidfile)"
58
-	[ -n "${pidfile}" ] && pidfile="--pidfile ${pidfile}"
59
-	ebegin "Shutting down Name Service Cache Daemon"
60
-	start-stop-daemon --stop --quiet --exec /usr/sbin/nscd ${pidfile}
61
-	eend $?
62
-}
63
-
64
-# vim:ts=4
... ...
@@ -1,24 +0,0 @@
1
-# /etc/nsswitch.conf:
2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/nsswitch.conf,v 1.1 2005/05/17 00:52:41 vapier Exp $
3
-
4
-passwd:      compat
5
-shadow:      compat
6
-group:       compat
7
-
8
-# passwd:    db files nis
9
-# shadow:    db files nis
10
-# group:     db files nis
11
-
12
-hosts:       files dns
13
-networks:    files dns
14
-
15
-services:    db files
16
-protocols:   db files
17
-rpc:         db files
18
-ethers:      db files
19
-netmasks:    files
20
-netgroup:    files
21
-bootparams:  files
22
-
23
-automount:   files
24
-aliases:     files
... ...
@@ -1,247 +0,0 @@
1
-# Copyright 1999-2010 Gentoo Foundation
2
-# Distributed under the terms of the GNU General Public License v2
3
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.11.2-r1.ebuild,v 1.2 2010/10/25 03:05:00 jer Exp $
4
-
5
-inherit eutils versionator libtool toolchain-funcs flag-o-matic gnuconfig multilib
6
-
7
-DESCRIPTION="GNU libc6 (also called glibc2) C library"
8
-HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
9
-
10
-LICENSE="LGPL-2"
11
-KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
12
-RESTRICT="strip" # strip ourself #46186
13
-EMULTILIB_PKG="true"
14
-
15
-# Configuration variables
16
-if [[ ${PV} == *_p* ]] ; then
17
-RELEASE_VER=${PV%_p*}
18
-BRANCH_UPDATE=""
19
-SNAP_VER=${PV#*_p}
20
-else
21
-RELEASE_VER=${PV}
22
-BRANCH_UPDATE=""
23
-SNAP_VER=""
24
-fi
25
-MANPAGE_VER=""                                 # pregenerated manpages
26
-INFOPAGE_VER=""                                # pregenerated infopages
27
-LIBIDN_VER=""                                  # it's integrated into the main tarball now
28
-PATCH_VER="4"                                  # Gentoo patchset
29
-PORTS_VER=${RELEASE_VER%.?}                    # version of glibc ports addon
30
-LT_VER=""                                      # version of linuxthreads addon
31
-NPTL_KERN_VER=${NPTL_KERN_VER:-"2.6.9"}        # min kernel version nptl requires
32
-#LT_KERN_VER=${LT_KERN_VER:-"2.4.1"}           # min kernel version linuxthreads requires
33
-
34
-IUSE="debug gd glibc-omitfp hardened multilib nls selinux profile vanilla crosscompile_opts_headers-only ${LT_VER:+glibc-compat20 nptl nptlonly}"
35
-S=${WORKDIR}/glibc-${RELEASE_VER}${SNAP_VER:+-${SNAP_VER}}
36
-
37
-# Here's how the cross-compile logic breaks down ...
38
-#  CTARGET - machine that will target the binaries
39
-#  CHOST   - machine that will host the binaries
40
-#  CBUILD  - machine that will build the binaries
41
-# If CTARGET != CHOST, it means you want a libc for cross-compiling.
42
-# If CHOST != CBUILD, it means you want to cross-compile the libc.
43
-#  CBUILD = CHOST = CTARGET    - native build/install
44
-#  CBUILD != (CHOST = CTARGET) - cross-compile a native build
45
-#  (CBUILD = CHOST) != CTARGET - libc for cross-compiler
46
-#  CBUILD != CHOST != CTARGET  - cross-compile a libc for a cross-compiler
47
-# For install paths:
48
-#  CHOST = CTARGET  - install into /
49
-#  CHOST != CTARGET - install into /usr/CTARGET/
50
-
51
-export CBUILD=${CBUILD:-${CHOST}}
52
-export CTARGET=${CTARGET:-${CHOST}}
53
-if [[ ${CTARGET} == ${CHOST} ]] ; then
54
-	if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
55
-		export CTARGET=${CATEGORY/cross-}
56
-	fi
57
-fi
58
-
59
-[[ ${CTARGET} == hppa* ]] && NPTL_KERN_VER=${NPTL_KERN_VER/2.6.9/2.6.20}
60
-
61
-is_crosscompile() {
62
-	[[ ${CHOST} != ${CTARGET} ]]
63
-}
64
-alt_libdir() {
65
-	if is_crosscompile ; then
66
-		echo /usr/${CTARGET}/$(get_libdir)
67
-	else
68
-		echo /$(get_libdir)
69
-	fi
70
-}
71
-
72
-if is_crosscompile ; then
73
-	SLOT="${CTARGET}-2.2"
74
-else
75
-	# Why SLOT 2.2 you ask yourself while sippin your tea ?
76
-	# Everyone knows 2.2 > 0, duh.
77
-	SLOT="2.2"
78
-	PROVIDE="virtual/libc"
79
-fi
80
-
81
-# General: We need a new-enough binutils for as-needed
82
-# arch: we need to make sure our binutils/gcc supports TLS
83
-DEPEND=">=sys-devel/gcc-3.4.4
84
-	arm? ( >=sys-devel/binutils-2.16.90 >=sys-devel/gcc-4.1.0 )
85
-	x86? ( >=sys-devel/gcc-4.3 )
86
-	amd64? ( >=sys-devel/binutils-2.19 >=sys-devel/gcc-4.3 )
87
-	ppc? ( >=sys-devel/gcc-4.1.0 )
88
-	ppc64? ( >=sys-devel/gcc-4.1.0 )
89
-	>=sys-devel/binutils-2.15.94
90
-	${LT_VER:+nptl? (} >=sys-kernel/linux-headers-${NPTL_KERN_VER} ${LT_VER:+)}
91
-	>=sys-devel/gcc-config-1.3.12
92
-	>=app-misc/pax-utils-0.1.10
93
-	virtual/os-headers
94
-	nls? ( sys-devel/gettext )
95
-	>=sys-apps/sandbox-1.2.18.1-r2
96
-	!<sys-apps/portage-2.1.2
97
-	selinux? ( sys-libs/libselinux )"
98
-RDEPEND="!sys-kernel/ps3-sources
99
-	nls? ( sys-devel/gettext )
100
-	selinux? ( sys-libs/libselinux )"
101
-
102
-if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then
103
-	DEPEND="${DEPEND} !crosscompile_opts_headers-only? ( ${CATEGORY}/gcc )"
104
-	[[ ${CATEGORY} == *-linux* ]] && DEPEND="${DEPEND} ${CATEGORY}/linux-headers"
105
-else
106
-	DEPEND="${DEPEND} !vanilla? ( >=sys-libs/timezone-data-2007c )"
107
-	RDEPEND="${RDEPEND}
108
-		vanilla? ( !sys-libs/timezone-data )
109
-		!vanilla? ( sys-libs/timezone-data )"
110
-fi
111
-
112
-SRC_URI=$(
113
-	upstream_uris() {
114
-		echo mirror://gnu/glibc/$1 ftp://sources.redhat.com/pub/glibc/{releases,snapshots}/$1 mirror://gentoo/$1
115
-	}
116
-	gentoo_uris() {
117
-		local devspace="HTTP~vapier/dist/URI HTTP~azarah/glibc/URI"
118
-		devspace=${devspace//HTTP/http://dev.gentoo.org/}
119
-		echo mirror://gentoo/$1 ${devspace//URI/$1}
120
-	}
121
-
122
-	TARNAME=${PN}
123
-	if [[ -n ${SNAP_VER} ]] ; then
124
-		TARNAME="${PN}-${RELEASE_VER}"
125
-		[[ -n ${PORTS_VER} ]] && PORTS_VER=${SNAP_VER}
126
-		upstream_uris ${TARNAME}-${SNAP_VER}.tar.bz2
127
-	else
128
-		upstream_uris ${TARNAME}-${RELEASE_VER}.tar.bz2
129
-	fi
130
-	[[ -n ${LIBIDN_VER}    ]] && upstream_uris glibc-libidn-${LIBIDN_VER}.tar.bz2
131
-	[[ -n ${PORTS_VER}     ]] && upstream_uris ${TARNAME}-ports-${PORTS_VER}.tar.bz2
132
-	[[ -n ${LT_VER}        ]] && upstream_uris ${TARNAME}-linuxthreads-${LT_VER}.tar.bz2
133
-	[[ -n ${BRANCH_UPDATE} ]] && gentoo_uris glibc-${RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2
134
-	[[ -n ${PATCH_VER}     ]] && gentoo_uris glibc-${RELEASE_VER}-patches-${PATCH_VER}.tar.bz2
135
-	[[ -n ${MANPAGE_VER}   ]] && gentoo_uris glibc-manpages-${MANPAGE_VER}.tar.bz2
136
-	[[ -n ${INFOPAGE_VER}  ]] && gentoo_uris glibc-infopages-${INFOPAGE_VER}.tar.bz2
137
-)
138
-
139
-# eblit-include [--skip] <function> [version]
140
-eblit-include() {
141
-	local skipable=false
142
-	[[ $1 == "--skip" ]] && skipable=true && shift
143
-	[[ $1 == pkg_* ]] && skipable=true
144
-
145
-	local e v func=$1 ver=$2
146
-	[[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
147
-	for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
148
-		e="${FILESDIR}/eblits/${func}${v}.eblit"
149
-		if [[ -e ${e} ]] ; then
150
-			source "${e}"
151
-			return 0
152
-		fi
153
-	done
154
-	${skipable} && return 0
155
-	die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
156
-}
157
-
158
-# eblit-run-maybe <function>
159
-# run the specified function if it is defined
160
-eblit-run-maybe() {
161
-	[[ $(type -t "$@") == "function" ]] && "$@"
162
-}
163
-
164
-# eblit-run <function> [version]
165
-# aka: src_unpack() { eblit-run src_unpack ; }
166
-eblit-run() {
167
-	eblit-include --skip common "${*:2}"
168
-	eblit-include "$@"
169
-	eblit-run-maybe eblit-$1-pre
170
-	eblit-${PN}-$1
171
-	eblit-run-maybe eblit-$1-post
172
-}
173
-
174
-src_unpack()  { eblit-run src_unpack  ;
175
-	cd "${S}"
176
-	epatch "${FILESDIR}/glibc-sec1"
177
-	epatch "${FILESDIR}/glibc-sec2"
178
-}
179
-src_compile() { eblit-run src_compile ; }
180
-src_test()    { eblit-run src_test    ; }
181
-src_install() { eblit-run src_install ; }
182
-
183
-# FILESDIR might not be available during binpkg install
184
-for x in setup {pre,post}inst ; do
185
-	e="${FILESDIR}/eblits/pkg_${x}.eblit"
186
-	if [[ -e ${e} ]] ; then
187
-		. "${e}"
188
-		eval "pkg_${x}() { eblit-run pkg_${x} ; }"
189
-	fi
190
-done
191
-
192
-eblit-src_unpack-post() {
193
-	if use hardened ; then
194
-		cd "${S}"
195
-		einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
196
-		gcc-specs-pie && epatch "${FILESDIR}"/2.11/glibc-2.11-hardened-pie.patch
197
-		epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-configure-picdefault.patch
198
-		epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-inittls-nosysenter.patch
199
-
200
-		einfo "Patching Glibc to support older SSP __guard"
201
-		epatch "${FILESDIR}"/2.10/glibc-2.10-hardened-ssp-compat.patch
202
-
203
-		einfo "Installing Hardened Gentoo SSP and FORTIFY_SOURCE handler"
204
-		cp -f "${FILESDIR}"/2.6/glibc-2.6-gentoo-stack_chk_fail.c \
205
-			debug/stack_chk_fail.c || die
206
-		cp -f "${FILESDIR}"/2.10/glibc-2.10-gentoo-chk_fail.c \
207
-			debug/chk_fail.c || die
208
-
209
-		if use debug ; then
210
-			# When using Hardened Gentoo stack handler, have smashes dump core for
211
-			# analysis - debug only, as core could be an information leak
212
-			# (paranoia).
213
-			sed -i \
214
-				-e '/^CFLAGS-backtrace.c/ iCFLAGS-stack_chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
215
-				debug/Makefile \
216
-				|| die "Failed to modify debug/Makefile for debug stack handler"
217
-			sed -i \
218
-				-e '/^CFLAGS-backtrace.c/ iCFLAGS-chk_fail.c = -DSSP_SMASH_DUMPS_CORE' \
219
-				debug/Makefile \
220
-				|| die "Failed to modify debug/Makefile for debug fortify handler"
221
-		fi
222
-
223
-		# Build nscd with ssp-all
224
-		sed -i \
225
-			-e 's:-fstack-protector$:-fstack-protector-all:' \
226
-			nscd/Makefile \
227
-			|| die "Failed to ensure nscd builds with ssp-all"
228
-	fi
229
-}
230
-
231
-maint_pkg_create() {
232
-	local base="/usr/local/src/gnu/glibc/glibc-${PV:0:1}_${PV:2:1}"
233
-	cd ${base}
234
-	local stamp=$(date +%Y%m%d)
235
-	local d
236
-	for d in libc ports ; do
237
-		#(cd ${d} && cvs up)
238
-		case ${d} in
239
-			libc)  tarball="${P}";;
240
-			ports) tarball="${PN}-ports-${PV}";;
241
-		esac
242
-		rm -f ${tarball}*
243
-		ln -sf ${d} ${tarball}
244
-		tar hcf - ${tarball} --exclude-vcs | lzma > "${T}"/${tarball}.tar.lzma
245
-		du -b "${T}"/${tarball}.tar.lzma
246
-	done
247
-}
248 0