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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (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.6: +1 -1 lines
FILE REMOVED
Remove ccc, cxx, cfal, broken, unfetchable, unsupported by upstream

1 # Copyright 1999-2006 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-r1.ebuild,v 1.6 2007/01/31 14:22:04 genone Exp $
4 #
5 # Ebuild contributed by Tavis Ormandy <taviso@sdf.lonestar.org>
6 # and edited by Aron Griffis <agriffis@gentoo.org>
7
8 IUSE="doc"
9
10 DESCRIPTION="Compaq's enhanced C compiler for the ALPHA platform"
11 HOMEPAGE="http://www.support.compaq.com/alpha-tools"
12
13 # its okay to set a SRC_URI here, as the rpm is gpg encrypted
14 # and user must agree to the license before getting access
15 SRC_URI="ftp://ftp.compaq.com/pub/products/linuxdevtools/latest/crypt/ccc-6.5.9.001-6.alpha.rpm.crypt"
16
17 S=${WORKDIR}
18 LICENSE="PLDSPv2"
19 SLOT="0"
20 # NOTE: ALPHA Only!
21 KEYWORDS="-* alpha"
22
23 RDEPEND="virtual/libc
24 dev-libs/libots
25 >=dev-libs/libcpml-5.2.01-r2"
26
27 DEPEND="${RDEPEND}
28 sys-devel/gcc-config
29 app-arch/rpm2targz
30 >=sys-apps/sed-4
31 app-crypt/gnupg
32 >=app-shells/bash-2.05b
33 >=dev-libs/libcpml-5.2.01-r2
34 "
35
36 # These variables are not used by Portage, but is used 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 # :-NULL safeguards against bash bug.
59 einfo "Decrypting ccc distribution..."
60 gpg --quiet \
61 --homedir=${T} --no-permission-warning \
62 --no-mdc-warning \
63 --passphrase-fd 0 \
64 --output ${ccc_rpm} \
65 --decrypt ${DISTDIR}/${ccc_rpm}.crypt \
66 <<< ${CCC_LICENSE_KEY:-NULL}
67
68 ebegin "Unpacking ccc distribution..."
69 # This is the same as using rpm2targz then extracting 'cept that
70 # it's faster, less work, and less hard disk space. rpmoffset is
71 # provided by the rpm2targz package.
72 i=${ccc_rpm}
73 dd ibs=`rpmoffset < ${i}` skip=1 if=$i 2>/dev/null \
74 | gzip -dc | cpio -idmu 2>/dev/null \
75 && find usr -type d -print0 | xargs -0 chmod a+rx
76 eend ${?}
77 assert "Failed to extract ${ccc_rpm%.rpm}.tar.gz"
78
79 # remove unwanted documentation
80 if ! use doc >/dev/null; then
81 einfo "Removing unwanted documentation (USE=\"-doc\")..."
82 rm -rf usr/doc
83 fi
84
85 # Moved the following step to pkg_config
86 # (06 Feb 2004 agriffis)
87 #
88 # # fix up lib paths - bug #15719, comment 6
89 # einfo "Copying crtbegin/crtend from gcc..."
90 # gcc_libs_path="`gcc-config --get-lib-path`"
91 # if [ $? != 0 ] || [ ! -d "${gcc_libs_path}" ]; then
92 # die "gcc-config returned an invalid library path (${gcc_libs_path})"
93 # else
94 # cp -f ${gcc_libs_path}/crt{begin,end}.o \
95 # usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin
96 # assert "Failed to copy crtbegin/crtend.o from ${gcc_libs_path}"
97 # fi
98
99 # Removed the following step in favor of create-comp-config.sh in pkg_config
100 # (06 Feb 2004 agriffis)
101 #
102 # # add gcc-lib path to ccc's search path
103 # # check man ccc for file format info.
104 # einfo "Configuring ccc to observe gcc library path and include paths..."
105 # printf '%s %s %s\n' \
106 # "-L${gcc_libs_path}" \
107 # " -SysIncDir /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/include" \
108 # " -SysIncDir /usr/include/linux" \
109 # > usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/comp.config
110 # einfo "Additional paths can be set by users using \$DEC_CC variable."
111
112 # Patch create-comp-config.sh to work with gcc-3.x
113 # (06 Feb 2004 agriffis)
114 sed -i -e 's/gcc -v -V \$GCC_VER/gcc -V $GCC_VER -v/' \
115 usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/create-comp-config.sh
116
117 # man pages are in the wrong place
118 einfo "Reorganising man structure..."
119 rm -rf usr/man
120 mkdir usr/share
121 mv usr/lib/compaq/ccc-${ccc_release}/alpha-linux/man usr/share
122
123 if use doc >/dev/null; then
124 einfo "Reorganising documentation..."
125 mv usr/doc usr/share
126 fi
127 }
128
129 src_compile() {
130 true # nothing to compile
131 }
132
133 src_install() {
134 # move files over
135 mv usr ${D} || die "ccc installation failed"
136
137 # prep manpages
138 prepman ${D}/usr/share/man/man1/ccc.1
139 prepman ${D}/usr/share/man/man8/protect_headers_setup.8
140 prepalldocs
141
142 # install ccc proxy until config is executed
143 mv ${D}/usr/bin/ccc{,.real}
144 cat >${D}/usr/bin/ccc <<EOF
145 #!/bin/sh
146 echo "Error: ccc must be configured before compiling!" >&2
147 echo "The system administrator must run the following command:" >&2
148 echo " emerge --config =${CATEGORY}/${PF}" >&2
149 exit 1
150 EOF
151 chmod 0755 ${D}/usr/bin/ccc
152 }
153
154 pkg_config () {
155 einfo "Copying crtbegin/crtend from gcc"
156 local gcc_libs_path="`gcc-config --get-lib-path`"
157 if [[ $? != 0 || ! -d "${gcc_libs_path}" ]]; then
158 die "gcc-config returned an invalid library path (${gcc_libs_path})"
159 else
160 rm -f /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/crt{begin,end}.o
161 cp ${gcc_libs_path}/crt{begin,end}.o \
162 /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin
163 assert "Failed to copy crtbegin/crtend.o from ${gcc_libs_path}"
164 fi
165
166 # Need the real ccc prior to configuration
167 if [[ -f /usr/bin/ccc.real ]]; then
168 einfo "Moving ccc.real into place"
169 rm -f /usr/bin/ccc
170 mv /usr/bin/ccc.real /usr/bin/ccc
171 assert "failed to rename ccc.real"
172 fi
173
174 einfo "Attempting configuration of ccc"
175 echo '<------- Begin ccc configuration output ------->'
176 # NOTE: _must_ hide distcc, ccache, etc during this step
177 PATH=/bin:/usr/bin:/sbin:/usr/sbin \
178 /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/create-comp-config.sh \
179 ccc-${ccc_release} ${gcc_libs_path}
180 echo '<------- End ccc configuration output ------->'
181 echo
182
183 einfo "ccc has been configured, you can now use it as usual."
184 }
185
186 pkg_postinst () {
187 echo
188 elog "ccc has been merged successfully, the EULA"
189 elog "is available in"
190 elog
191 elog "/usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/LICENSE.txt"
192 elog
193 if use doc >/dev/null; then
194 elog "You can also view the compiler documentation"
195 elog "in /usr/share/doc/ccc-${PV}"
196 fi
197
198 echo
199 elog "Hopefullly soon we will get a ccc USE flag"
200 elog "on packages (or at least individual"
201 elog "components) that can be successfully built"
202 elog "using this compiler, until then you will"
203 elog "just have to experiment :)"
204 elog
205 elog "Please report successes/failures with ccc"
206 elog "to http://bugs.gentoo.org so that the USE"
207 elog "flags can be updated."
208 elog
209
210 echo
211 ewarn
212 ewarn "You _MUST_ now run:"
213 ewarn "emerge --config =${CATEGORY}/${PF}"
214 ewarn "to complete the installation"
215 ewarn
216
217 echo
218 }

  ViewVC Help
Powered by ViewVC 1.1.20