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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Fri Jan 8 08:56:43 2010 UTC (10 years, 1 month ago) by grobian
Branch: MAIN
Changes since 1.3: +2 -2 lines
fix copyright after the unconventional commit I just did
(Portage version: 2.2.00.15171-prefix/cvs/Darwin powerpc)

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

  ViewVC Help
Powered by ViewVC 1.1.20