/[gentoo-x86]/dev-lang/ccc/ccc-6.5.9.001-r3.ebuild
Gentoo

Contents of /dev-lang/ccc/ccc-6.5.9.001-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Thu Dec 27 11:57:36 2007 UTC (11 years, 9 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
Remove ccc, cxx, cfal, broken, unfetchable, unsupported by upstream

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/ccc/ccc-6.5.9.001-r3.ebuild,v 1.7 2007/07/02 14:39:33 peper Exp $
4 #
5 # Ebuild contributed by Tavis Ormandy <taviso@sdf.lonestar.org>
6 # and edited by Aron Griffis <agriffis@gentoo.org>
7
8 inherit eutils rpm
9
10 IUSE="doc"
11
12 DESCRIPTION="Compaq's enhanced C compiler for the ALPHA platform"
13 HOMEPAGE="http://www.support.compaq.com/alpha-tools"
14
15 # no need to add fetch restrictions, as the rpm is gpg encrypted
16 # and user must agree to the license before getting access
17 SRC_URI="ftp://ftp.compaq.com/pub/products/linuxdevtools/latest/crypt/ccc-6.5.9.001-6.alpha.rpm.crypt"
18
19 S=${WORKDIR}
20 LICENSE="PLDSPv2"
21 SLOT="0"
22 KEYWORDS="-* ~alpha"
23
24 RDEPEND="virtual/libc
25 dev-libs/libots
26 >=dev-libs/libcpml-5.2.01-r2"
27
28 DEPEND="${RDEPEND}
29 sys-devel/gcc-config
30 >=sys-apps/sed-4
31 app-crypt/gnupg
32 >=app-shells/bash-2.05b"
33
34 RESTRICT="strip"
35
36 # These variables are not used by Portage, but by the functions
37 # below.
38 ccc_release="${PV}-6"
39 ee_license_reg="http://h18000.www1.hp.com/products/software/alpha-tools/ee-license.html"
40
41 src_unpack() {
42 # convert rpm into tar archive
43 local ccc_rpm="ccc-${ccc_release}.alpha.rpm"
44
45 if [ -z ${CCC_LICENSE_KEY} ]; then
46 eerror
47 eerror "You have not set the environment variable"
48 eerror "\$CCC_LICENSE_KEY, this should be set to"
49 eerror "the password you were sent when you applied"
50 eerror "for your alpha-tools enthusiast/educational"
51 eerror "license."
52 eerror "If you do not have a license key, apply for one"
53 eerror "here ${ee_license_reg}"
54 eerror
55 die "no license key in \$CCC_LICENSE_KEY"
56 fi
57
58 einfo "Decrypting ccc distribution..."
59 gpg --quiet \
60 --homedir=${T} --no-permission-warning \
61 --no-mdc-warning \
62 --passphrase-fd 0 \
63 --output ${ccc_rpm} \
64 --decrypt ${DISTDIR}/${ccc_rpm}.crypt <<< ${CCC_LICENSE_KEY:-NULL} || die "failed to secrypt ccc distribution"
65
66 ebegin "Unpacking ccc distribution..."
67 rpm_unpack ${ccc_rpm}
68 eend ${?}
69 assert "Failed to extract ${ccc_rpm%.rpm}.tar.gz"
70
71 find ${S}/usr -type d -exec chmod a+rx {} \;
72
73 # patch up config script to sort gcc-lib paths last. Thanks to
74 # Marc Giger for sorting this out
75 epatch ${FILESDIR}/create-comp-config.patch
76
77 # remove unwanted documentation
78 if ! use doc; then
79 einfo "Removing unwanted documentation (USE=\"-doc\")..."
80 rm -rf usr/doc
81 fi
82
83 # Patch create-comp-config.sh to work with gcc-3.x
84 # (06 Feb 2004 agriffis)
85 sed -i -e 's/gcc -v -V \$GCC_VER/gcc -V $GCC_VER -v/' \
86 usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/create-comp-config.sh
87
88 # man pages are in the wrong place
89 einfo "Reorganising man structure..."
90 rm -rf usr/man
91 mkdir usr/share
92 mv usr/lib/compaq/ccc-${ccc_release}/alpha-linux/man usr/share
93
94 if use doc; then
95 einfo "Reorganising documentation..."
96 mv usr/doc usr/share
97 fi
98 }
99
100 src_compile() {
101 true # nothing to compile
102 }
103
104 src_install() {
105 # move files over
106 mv usr ${D} || die "ccc installation failed"
107
108 # prep manpages
109 prepman ${D}/usr/share/man/man1/ccc.1
110 prepman ${D}/usr/share/man/man8/protect_headers_setup.8
111 prepalldocs
112
113 # install ccc proxy until config is executed
114 mv ${D}/usr/bin/ccc{,.real}
115 cat >${D}/usr/bin/ccc <<EOF
116 #!/bin/sh
117 echo "Error: ccc must be configured before compiling!" >&2
118 echo "The system administrator must run the following command:" >&2
119 echo " emerge --config =${CATEGORY}/${PF}" >&2
120 exit 1
121 EOF
122 chmod 0755 ${D}/usr/bin/ccc
123 }
124
125 pkg_config () {
126 einfo "Copying crtbegin/crtend from gcc"
127 local gcc_libs_path="`gcc-config --get-lib-path`"
128 if [[ $? != 0 || ! -d "${gcc_libs_path}" ]]; then
129 die "gcc-config returned an invalid library path (${gcc_libs_path})"
130 else
131 rm -f /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/crt{begin,end}.o
132 cp ${gcc_libs_path}/crt{begin,end}.o \
133 /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin
134 assert "Failed to copy crtbegin/crtend.o from ${gcc_libs_path}"
135 fi
136
137 # Need the real ccc prior to configuration
138 if [[ -f /usr/bin/ccc.real ]]; then
139 einfo "Moving ccc.real into place"
140 rm -f /usr/bin/ccc
141 mv /usr/bin/ccc.real /usr/bin/ccc
142 assert "failed to rename ccc.real"
143 fi
144
145 einfo "Attempting configuration of ccc"
146 # NOTE: _must_ hide distcc, ccache, etc during this step
147 PATH=/bin:/usr/bin:/sbin:/usr/sbin \
148 /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/create-comp-config.sh \
149 ccc-${ccc_release} ${gcc_libs_path}
150 echo
151
152 einfo "ccc has been configured, you can now use it as usual."
153 }
154
155 pkg_postinst () {
156 echo
157 elog "ccc has been merged successfully, the EULA"
158 elog "is available in"
159 elog
160 elog "/usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/LICENSE.txt"
161 elog
162 if use doc >/dev/null; then
163 elog "You can also view the compiler documentation"
164 elog "in /usr/share/doc/ccc-${PV}"
165 fi
166
167 echo
168 elog "Hopefullly soon we will get a ccc USE flag"
169 elog "on packages (or at least individual"
170 elog "components) that can be successfully built"
171 elog "using this compiler, until then you will"
172 elog "just have to experiment :)"
173 elog
174 elog "Please report successes/failures with ccc"
175 elog "to http://bugs.gentoo.org so that the USE"
176 elog "flags can be updated."
177 elog
178
179 echo
180 ewarn
181 ewarn "You _MUST_ now run:"
182 ewarn "emerge --config =${CATEGORY}/${PF}"
183 ewarn "to complete the installation"
184 ewarn
185
186 echo
187 }

  ViewVC Help
Powered by ViewVC 1.1.20