/[gentoo-x86]/sys-apps/kmod/kmod-9999.ebuild
Gentoo

Contents of /sys-apps/kmod/kmod-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.81 - (show annotations) (download)
Tue Sep 2 03:24:55 2014 UTC (6 weeks, 6 days ago) by ryao
Branch: MAIN
CVS Tags: HEAD
Changes since 1.80: +3 -3 lines
src_configure() should use EPREFIX, not EROOT. The previous commit was not correct from the perspective of Catalyst. Thanks goes to Arfever for pointing it out.

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0xBEE84C64)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/kmod-9999.ebuild,v 1.80 2014/08/29 18:35:57 ryao Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_7,3_2,3_3,3_4} )
8
9 inherit bash-completion-r1 eutils multilib python-r1
10
11 if [[ ${PV} == 9999* ]]; then
12 EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git"
13 inherit autotools git-2
14 else
15 SRC_URI="mirror://kernel/linux/utils/kernel/kmod/${P}.tar.xz"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
17 inherit libtool
18 fi
19
20 DESCRIPTION="library and tools for managing linux kernel modules"
21 HOMEPAGE="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git"
22
23 LICENSE="LGPL-2"
24 SLOT="0"
25 IUSE="debug doc lzma python static-libs +tools zlib"
26
27 # Upstream does not support running the test suite with custom configure flags.
28 # I was also told that the test suite is intended for kmod developers.
29 # So we have to restrict it.
30 # See bug #408915.
31 RESTRICT="test"
32
33 RDEPEND="!sys-apps/module-init-tools
34 !sys-apps/modutils
35 !<sys-apps/openrc-0.12
36 lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
37 python? ( ${PYTHON_DEPS} )
38 zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
39 DEPEND="${RDEPEND}
40 doc? ( dev-util/gtk-doc )
41 lzma? ( virtual/pkgconfig )
42 python? (
43 dev-python/cython[${PYTHON_USEDEP}]
44 virtual/pkgconfig
45 )
46 zlib? ( virtual/pkgconfig )"
47 if [[ ${PV} == 9999* ]]; then
48 DEPEND="${DEPEND}
49 dev-libs/libxslt"
50 fi
51
52 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
53
54 DOCS="NEWS README TODO"
55
56 src_prepare() {
57 if [ ! -e configure ]; then
58 if use doc; then
59 gtkdocize --copy --docdir libkmod/docs || die
60 else
61 touch libkmod/docs/gtk-doc.make
62 fi
63 eautoreconf
64 else
65 epatch "${FILESDIR}"/${PN}-15-dynamic-kmod.patch #493630
66 elibtoolize
67 fi
68
69 # Restore possibility of running --enable-static wrt #472608
70 sed -i \
71 -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
72 configure || die
73 }
74
75 src_configure() {
76 local myeconfargs=(
77 --bindir="${EPREFIX}/bin"
78 --with-rootlibdir="${EPREFIX}/$(get_libdir)"
79 --enable-shared
80 $(use_enable static-libs static)
81 $(use_enable tools)
82 $(use_enable debug)
83 $(use_enable doc gtk-doc)
84 $(use_with lzma xz)
85 $(use_with zlib)
86 --with-bashcompletiondir="$(get_bashcompdir)"
87 )
88
89 local ECONF_SOURCE="${S}"
90
91 kmod_configure() {
92 mkdir -p "${BUILD_DIR}" || die
93 run_in_build_dir econf "${myeconfargs[@]}" "$@"
94 }
95
96 BUILD_DIR="${WORKDIR}/build"
97 kmod_configure --disable-python
98
99 if use python; then
100 python_parallel_foreach_impl kmod_configure --enable-python
101 fi
102 }
103
104 src_compile() {
105 if [[ ${PV} != 9999* ]]; then
106 # Force -j1 because of -15-dynamic-kmod.patch, likely caused by lack of eautoreconf
107 # wrt #494806
108 local MAKEOPTS="${MAKEOPTS} -j1"
109 fi
110
111 emake -C "${BUILD_DIR}"
112
113 if use python; then
114 local native_builddir=${BUILD_DIR}
115
116 python_compile() {
117 emake -C "${BUILD_DIR}" -f Makefile -f - python \
118 VPATH="${native_builddir}:${S}" \
119 native_builddir="${native_builddir}" \
120 libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
121 <<< 'python: $(pkgpyexec_LTLIBRARIES)'
122 }
123
124 python_foreach_impl python_compile
125 fi
126 }
127
128 src_install() {
129 emake -C "${BUILD_DIR}" DESTDIR="${D}" install
130 einstalldocs
131
132 if use python; then
133 local native_builddir=${BUILD_DIR}
134
135 python_install() {
136 emake -C "${BUILD_DIR}" DESTDIR="${D}" \
137 VPATH="${native_builddir}:${S}" \
138 install-pkgpyexecLTLIBRARIES \
139 install-dist_pkgpyexecPYTHON
140 }
141
142 python_foreach_impl python_install
143 fi
144
145 prune_libtool_files --modules
146
147 if use tools; then
148 local bincmd sbincmd
149 for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do
150 dosym /bin/kmod /sbin/${sbincmd}
151 done
152
153 # These are also usable as normal user
154 for bincmd in lsmod modinfo; do
155 dosym kmod /bin/${bincmd}
156 done
157 fi
158
159 cat <<-EOF > "${T}"/usb-load-ehci-first.conf
160 softdep uhci_hcd pre: ehci_hcd
161 softdep ohci_hcd pre: ehci_hcd
162 EOF
163
164 insinto /lib/modprobe.d
165 doins "${T}"/usb-load-ehci-first.conf #260139
166
167 newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
168 }
169
170 pkg_postinst() {
171 if [[ -L ${EROOT%/}/etc/runlevels/boot/static-nodes ]]; then
172 ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
173 rm -f "${EROOT%/}"/etc/runlevels/boot/static-nodes
174 fi
175
176 # Add kmod to the runlevel automatically if this is the first install of this package.
177 if [[ -z ${REPLACING_VERSIONS} ]]; then
178 if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
179 mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
180 fi
181 if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
182 ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
183 fi
184 fi
185
186 if [[ -e ${EROOT%/}/etc/runlevels/sysinit ]]; then
187 if [[ ! -e ${EROOT%/}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
188 ewarn
189 ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
190 ewarn "kernel modules to have required static nodes!"
191 ewarn "Run this command:"
192 ewarn "\trc-update add kmod-static-nodes sysinit"
193 fi
194 fi
195 }

  ViewVC Help
Powered by ViewVC 1.1.20