/[gentoo-x86]/sys-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild
Gentoo

Contents of /sys-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Mar 5 18:04:28 2010 UTC (9 years, 10 months ago) by grobian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +4 -6 lines
Convert to EAPI=3
(Portage version: 2.2.00.15738-prefix/cvs/Darwin powerpc)

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-apps/darwin-miscutils/darwin-miscutils-6-r1.ebuild,v 1.3 2010/01/08 08:56:43 grobian Exp $
4
5 EAPI="3"
6
7 inherit toolchain-funcs eutils
8
9 MISC_VER=23
10 SHELL_VER=118
11 DEV_VER=49
12
13 DESCRIPTION="Miscellaneous commands used on Darwin/Mac OS X systems, Leopard"
14 HOMEPAGE="http://www.opensource.apple.com/"
15 SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/misc_cmds-${MISC_VER}.tar.gz
16 http://www.opensource.apple.com/darwinsource/tarballs/other/shell_cmds-${SHELL_VER}.tar.gz
17 http://www.opensource.apple.com/darwinsource/tarballs/other/developer_cmds-${DEV_VER}.tar.gz"
18
19 LICENSE="BSD"
20 SLOT="0"
21 KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
22 IUSE=""
23
24 S=${WORKDIR}
25
26 src_prepare() {
27 epatch "${FILESDIR}"/${PN}-5-w.patch
28 epatch "${FILESDIR}"/${PN}-5-stdlib.patch
29 epatch "${FILESDIR}"/${PN}-6-w64.patch
30 cd "${S}"/developer_cmds-${DEV_VER}
31 epatch "${FILESDIR}"/${PN}-5-error.patch
32 }
33
34 src_compile() {
35 local TS=${S}/misc_cmds-${MISC_VER}
36 # tsort is provided by coreutils
37 for t in leave units calendar; do
38 cd "${TS}/${t}"
39 echo "in ${TS}/${t}:"
40 echo "$(tc-getCC) -o ${t}" *.c
41 $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
42 done
43 # compile cal separately
44 cd "${TS}/ncal"
45 echo "in ${TS}/ncal:"
46 local flags
47 flags[0]=-I.
48 flags[1]=-D__FBSDID=__RCSID
49 flags[2]=-Wsystem-headers
50 echo "$(tc-getCC) ${flags[@]} -c calendar.c"
51 $(tc-getCC) ${flags[@]} -c calendar.c || die "failed to compile cal"
52 echo "$(tc-getCC) ${flags[@]} -c easter.c"
53 $(tc-getCC) ${flags[@]} -c easter.c || die "failed to compile cal"
54 echo "$(tc-getCC) ${flags[@]} -c ncal.c"
55 $(tc-getCC) ${flags[@]} -c ncal.c || die "failed to compile cal"
56 echo "$(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o"
57 $(tc-getCC) ${flags[@]} -o cal calendar.o easter.o ncal.o || die "failed to compile cal"
58
59 TS=${S}/shell_cmds-${SHELL_VER}
60 # only pick those tools not provided by coreutils, findutils
61 for t in \
62 alias apply getopt hostname jot kill \
63 lastcomm renice shlock time whereis;
64 do
65 echo "in ${TS}/${t}:"
66 echo "$(tc-getCC) -o ${t} ${t}.c"
67 cd "${TS}/${t}"
68 $(tc-getCC) -o ${t} ${t}.c || die "failed to compile $t"
69 done
70 # script and killall need additonal flags
71 for t in \
72 killall script
73 do
74 echo "in ${TS}/${t}:"
75 echo "$(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c"
76 cd "${TS}/${t}"
77 $(tc-getCC) -D__FBSDID=__RCSID -o ${t} ${t}.c || die "failed to compile $t"
78 done
79 cd "${TS}/su"
80 echo "in ${TS}/su:"
81 echo "$(tc-getCC) -lpam -o su su.c"
82 $(tc-getCC) -lpam -o su su.c || die "failed to compile su"
83 cd "${TS}/w"
84 echo "in ${TS}/w:"
85 echo "$(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c"
86 $(tc-getCC) -DHAVE_UTMPX=1 -lresolv -o w w.c pr_time.c proc_compare.c \
87 || die "failed to compile w"
88
89 TS=${S}/developer_cmds-${DEV_VER}
90 # only pick those tools that do not conflict (no ctags and indent)
91 # do not install lorder, mkdep and vgrind as they are a non-prefix-aware
92 # shell scripts
93 # don't install rpcgen, as it is heavily related to the OS it runs
94 # on (and this is the Leopard version)
95 for t in asa error hexdump unifdef what ; do
96 echo "in ${TS}/${t}:"
97 cd "${TS}/${t}"
98 sed -i -e '/^__FBSDID/d' *.c
99 echo "$(tc-getCC) -o ${t}" *.c
100 $(tc-getCC) -o ${t} *.c || die "failed to compile $t"
101 done
102 }
103
104 src_install() {
105 mkdir -p "${ED}"/bin
106 mkdir -p "${ED}"/usr/bin
107
108 local TS=${S}/misc_cmds-${MISC_VER}
109 for t in leave units calendar ; do
110 cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
111 doman "${TS}/${t}/${t}.1"
112 done
113 # copy cal separately
114 cp "${TS}/ncal/cal" "${ED}"/usr/bin/
115 dosym /usr/bin/cal /usr/bin/ncal
116 doman "${TS}/ncal/ncal.1"
117 dosym /usr/share/man/man1/ncal.1 /usr/share/man/man1/cal.1
118
119 TS=${S}/shell_cmds-${SHELL_VER}
120 for t in \
121 alias apply getopt jot killall lastcomm \
122 renice script shlock su time w whereis;
123 do
124 cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
125 [[ -f "${TS}/${t}/${t}.1" ]] && doman "${TS}/${t}/${t}.1"
126 [[ -f "${TS}/${t}/${t}.8" ]] && doman "${TS}/${t}/${t}.8"
127 done
128 cp "${TS}/w/w" "${ED}"/usr/bin/uptime
129 doman "${TS}/w/uptime.1"
130 for t in hostname kill; do
131 cp "${TS}/${t}/${t}" "${ED}"/bin/
132 doman "${TS}/${t}/${t}.1"
133 done
134
135 TS=${S}/developer_cmds-${DEV_VER}
136 for t in asa error hexdump unifdef what ; do
137 cp "${TS}/${t}/${t}" "${ED}"/usr/bin/
138 doman "${TS}/${t}/${t}.1"
139 done
140 }

  ViewVC Help
Powered by ViewVC 1.1.20