/[gentoo-x86]/sys-apps/linux-misc-apps/linux-misc-apps-3.6-r1.ebuild
Gentoo

Contents of /sys-apps/linux-misc-apps/linux-misc-apps-3.6-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon Nov 19 10:23:08 2012 UTC (2 years, 9 months ago) by robbat2
Branch: MAIN
Merge changes from net-misc/usbip-3.6 that just came out when I was not looking.

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/linux-misc-apps/linux-misc-apps-3.6.ebuild,v 1.1 2012/11/19 10:02:22 robbat2 Exp $
4
5 EAPI=4
6
7 inherit versionator eutils toolchain-funcs linux-info autotools flag-o-matic
8
9 DESCRIPTION="Misc tools bundled with kernel sources"
10 HOMEPAGE="http://kernel.org/"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86 ~ppc"
15 IUSE="static-libs tcpd"
16
17 MY_PV="${PV/_/-}"
18 MY_PV="${MY_PV/-pre/-git}"
19
20 LINUX_V=$(get_version_component_range 1-2)
21
22 if [ ${PV/_rc} != ${PV} ]; then
23 LINUX_VER=$(get_version_component_range 1-2).$(($(get_version_component_range 3)-1))
24 PATCH_VERSION=$(get_version_component_range 1-3)
25 LINUX_PATCH=patch-${PV//_/-}.bz2
26 SRC_URI="mirror://kernel/linux/kernel/v${LINUX_V}/testing/${LINUX_PATCH}
27 mirror://kernel/linux/kernel/v${LINUX_V}/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
28 elif [ $(get_version_component_count) == 4 ]; then
29 # stable-release series
30 LINUX_VER=$(get_version_component_range 1-3)
31 LINUX_PATCH=patch-${PV}.bz2
32 SRC_URI="mirror://kernel/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
33 else
34 LINUX_VER=${PV}
35 fi
36
37 LINUX_SOURCES=linux-${LINUX_VER}.tar.bz2
38 SRC_URI="${SRC_URI} mirror://kernel/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
39
40 # pciutils for cpupower
41 # pmtools also provides turbostat
42 # sysfsutils and glib for usbip - remove sysfsutils in 3.7 or 3.8
43 RDEPEND="sys-apps/pciutils
44 sys-apps/hwids
45 >=sys-fs/sysfsutils-2
46 >=dev-libs/glib-2.6
47 tcpd? ( sys-apps/tcp-wrappers )
48 !sys-power/pmtools
49 !net-misc/usbip"
50 DEPEND="${RDEPEND}
51 virtual/pkgconfig"
52
53 S="${WORKDIR}/linux-${LINUX_VER}"
54
55 # All of these are integrated with the kernel build system,
56 # No make install, and ideally build with with the root Makefile
57 TARGETS_SIMPLE=(
58 Documentation/accounting/getdelays.c
59 Documentation/cgroups/cgroup_event_listener.c
60 Documentation/laptops/dslm.c
61 Documentation/laptops/hpfall.c
62 Documentation/networking/timestamping/timestamping.c
63 Documentation/watchdog/src/watchdog-simple.c
64 tools/lguest/lguest.c
65 tools/vm/page-types.c
66 tools/vm/slabinfo.c
67 usr/gen_init_cpio.c
68 )
69 # tools/hv/hv_kvp_daemon.c - broken in 3.7 by missing linux/hyperv.h userspace
70 # Documentation/networking/ifenslave.c - obsolete
71 # Documentation/ptp/testptp.c - pending linux-headers-3.0
72
73 # These have a broken make install, no DESTDIR
74 TARGET_MAKE_SIMPLE=(
75 tools/firewire:nosy-dump
76 tools/power/x86/turbostat:turbostat
77 tools/power/x86/x86_energy_perf_policy:x86_energy_perf_policy
78 Documentation/misc-devices/mei:mei-amt-version
79 tools/power/cpupower:cpupower
80 )
81 # tools/perf - covered by dev-utils/perf
82 # tools/usb - testcases only
83 # tools/virtio - testcaes only
84
85 #for _pattern in {Documentation,scripts,tools,usr,include,lib,"arch/*/include",Makefile,Kbuild,Kconfig}; do
86 src_unpack() {
87 unpack ${LINUX_SOURCES}
88
89 MY_A=
90 for _AFILE in ${A}; do
91 [[ ${_AFILE} == ${LINUX_SOURCES} ]] && continue
92 [[ ${_AFILE} == ${LINUX_PATCH} ]] && continue
93 MY_A="${MY_A} ${_AFILE}"
94 done
95 [[ -n ${MY_A} ]] && unpack ${MY_A}
96 }
97
98 src_prepare() {
99 if [[ -n ${LINUX_PATCH} ]]; then
100 epatch "${DISTDIR}"/${LINUX_PATCH}
101 fi
102
103 pushd drivers/staging/usbip/userspace >/dev/null &&
104 eautoreconf -i -f -v &&
105 popd >/dev/null || die "usbip"
106
107 libs="-lcpupower -lrt -lpci"
108 sed -i \
109 -e "/$libs/{ s,${libs},,g; s,\$, ${libs},g;}" \
110 "${S}"/tools/power/cpupower/Makefile
111
112 sed -i \
113 -e '/^nosy-dump.*LDFLAGS/d' \
114 -e '/^nosy-dump.*CFLAGS/d' \
115 -e '/^nosy-dump.*CPPFLAGS/s,CPPFLAGS =,CPPFLAGS +=,g' \
116 "${S}"/tools/firewire/Makefile
117 }
118
119 cpupower_make() {
120 emake ${makeargs} \
121 CC="$(tc-getCC)" AR="$(tc-getAR)" \
122 docdir="/usr/share/doc/${PF}/cpupower" \
123 mandir="/usr/share/man" \
124 libdir="/usr/$(get_libdir)" \
125 OPTIMIZATION="${CFLAGS}" \
126 LDFLAGS="${LDFLAGS}" \
127 CPUFREQ_BENCH=/bin/false \
128 DEBUG=/bin/false \
129 STRIP=/bin/true \
130 "$@" || die
131 }
132
133 kernel_asm_arch() {
134 a="${1:${ARCH}}"
135 case ${a} in
136 # Merged arches
137 x86|amd64) echo x86 ;;
138 ppc*) echo powerpc ;;
139 # Non-merged
140 alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
141 *) die "TODO: Update the code for your asm-ARCH symlink" ;;
142 esac
143 }
144
145 src_configure() {
146 cd drivers/staging/usbip/userspace && \
147 econf \
148 $(use_enable static-libs static) \
149 $(use tcpd || echo --without-tcp-wrappers) \
150 --with-usbids-dir=/usr/share/misc
151 }
152
153 src_compile() {
154 local karch=$(kernel_asm_arch "${ARCH}")
155 # This is the minimal amount needed to start building host binaries.
156 #emake allmodconfig ARCH=${karch} || die
157 #emake prepare modules_prepare ARCH=${karch} || die
158 #touch Module.symvers
159
160 # Now we can start building
161 for s in ${TARGETS_SIMPLE[@]} ; do
162 dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
163 einfo "Building $s => $bin"
164 emake -f /dev/null M=${dir} ARCH=${karch} ${s%.c} || die
165 done
166
167 for t in ${TARGET_MAKE_SIMPLE[@]} ; do
168 dir=${t/:*} target=${t/*:}
169 einfo "Building $dir => $target"
170 emake -C $dir ARCH=${karch} $target || die
171 done
172
173 emake -C drivers/staging/usbip/userspace
174
175 # cpupower is special
176 einfo "Buildling cpupower"
177 cd "${S}"/tools/power/cpupower
178 cpupower_make ARCH=${karch} all || die
179 }
180
181 src_install() {
182 into /usr
183 for s in ${TARGETS_SIMPLE[@]} ; do
184 dir=$(dirname $s) src=$(basename $s) bin=${src%.c}
185 einfo "Installing $s => $bin"
186 dosbin ${dir}/${bin} || die "Failed to install ${bin}"
187 done
188
189 for t in ${TARGET_MAKE_SIMPLE[@]} ; do
190 dir=${t/:*} target=${t/*:}
191 einfo "Installing $dir => $target"
192 dosbin ${dir}/${target} || die
193 done
194
195 pushd drivers/staging/usbip/userspace >/dev/null \
196 || die "Missing usbip/userspace"
197 emake DESTDIR="${D}" install
198
199 newdoc README README.usbip
200 newdoc AUTHORS AUTHORS.usbip
201 dodoc ../usbip_protocol.txt
202 popd >/dev/null
203
204 local karch=$(kernel_asm_arch "${ARCH}")
205 pushd "${S}"/tools/power/cpupower >/dev/null \
206 || die "Missing tools/power/cpupower"
207 cpupower_make ARCH=${karch} DESTDIR="${D}" install || die
208 popd >/dev/null
209
210 # Avoid conflict
211 rm -f "${D}"/usr/include/cpufreq.h
212
213 newconfd "${FILESDIR}"/hpfall.confd hpfall
214 newinitd "${FILESDIR}"/hpfall.initd hpfall
215 prune_libtool_files
216 }

  ViewVC Help
Powered by ViewVC 1.1.20