/[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.87 - (show annotations) (download)
Wed Apr 8 18:27:32 2015 UTC (3 months, 3 weeks ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.86: +2 -2 lines
Drop old Python implementations

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2015 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.86 2015/01/18 18:45:46 williamh Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python{2_7,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 # Block systemd below 217 for -static-nodes-indicate-that-creation-of-static-nodes-.patch
34 RDEPEND="!sys-apps/module-init-tools
35 !sys-apps/modutils
36 !<sys-apps/openrc-0.13.8
37 !<sys-apps/systemd-216-r3
38 lzma? ( >=app-arch/xz-utils-5.0.4-r1 )
39 python? ( ${PYTHON_DEPS} )
40 zlib? ( >=sys-libs/zlib-1.2.6 )" #427130
41 DEPEND="${RDEPEND}
42 doc? ( dev-util/gtk-doc )
43 lzma? ( virtual/pkgconfig )
44 python? (
45 dev-python/cython[${PYTHON_USEDEP}]
46 virtual/pkgconfig
47 )
48 zlib? ( virtual/pkgconfig )"
49 if [[ ${PV} == 9999* ]]; then
50 DEPEND="${DEPEND}
51 dev-libs/libxslt"
52 fi
53
54 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
55
56 DOCS="NEWS README TODO"
57
58 src_prepare() {
59 if [ ! -e configure ]; then
60 if use doc; then
61 gtkdocize --copy --docdir libkmod/docs || die
62 else
63 touch libkmod/docs/gtk-doc.make
64 fi
65 eautoreconf
66 else
67 elibtoolize
68 fi
69
70 # Restore possibility of running --enable-static wrt #472608
71 sed -i \
72 -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \
73 configure || die
74 }
75
76 src_configure() {
77 local myeconfargs=(
78 --bindir="${EPREFIX}/bin"
79 --with-rootlibdir="${EPREFIX}/$(get_libdir)"
80 --enable-shared
81 $(use_enable static-libs static)
82 $(use_enable tools)
83 $(use_enable debug)
84 $(use_enable doc gtk-doc)
85 $(use_with lzma xz)
86 $(use_with zlib)
87 --with-bashcompletiondir="$(get_bashcompdir)"
88 )
89
90 local ECONF_SOURCE="${S}"
91
92 kmod_configure() {
93 mkdir -p "${BUILD_DIR}" || die
94 run_in_build_dir econf "${myeconfargs[@]}" "$@"
95 }
96
97 BUILD_DIR="${WORKDIR}/build"
98 kmod_configure --disable-python
99
100 if use python; then
101 python_parallel_foreach_impl kmod_configure --enable-python
102 fi
103 }
104
105 src_compile() {
106 emake -C "${BUILD_DIR}"
107
108 if use python; then
109 local native_builddir=${BUILD_DIR}
110
111 python_compile() {
112 emake -C "${BUILD_DIR}" -f Makefile -f - python \
113 VPATH="${native_builddir}:${S}" \
114 native_builddir="${native_builddir}" \
115 libkmod_python_kmod_{kmod,list,module,_util}_la_LIBADD='$(PYTHON_LIBS) $(native_builddir)/libkmod/libkmod.la' \
116 <<< 'python: $(pkgpyexec_LTLIBRARIES)'
117 }
118
119 python_foreach_impl python_compile
120 fi
121 }
122
123 src_install() {
124 emake -C "${BUILD_DIR}" DESTDIR="${D}" install
125 einstalldocs
126
127 if use python; then
128 local native_builddir=${BUILD_DIR}
129
130 python_install() {
131 emake -C "${BUILD_DIR}" DESTDIR="${D}" \
132 VPATH="${native_builddir}:${S}" \
133 install-pkgpyexecLTLIBRARIES \
134 install-dist_pkgpyexecPYTHON
135 }
136
137 python_foreach_impl python_install
138 fi
139
140 prune_libtool_files --modules
141
142 if use tools; then
143 local bincmd sbincmd
144 for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do
145 dosym /bin/kmod /sbin/${sbincmd}
146 done
147
148 # These are also usable as normal user
149 for bincmd in lsmod modinfo; do
150 dosym kmod /bin/${bincmd}
151 done
152 fi
153
154 cat <<-EOF > "${T}"/usb-load-ehci-first.conf
155 softdep uhci_hcd pre: ehci_hcd
156 softdep ohci_hcd pre: ehci_hcd
157 EOF
158
159 insinto /lib/modprobe.d
160 doins "${T}"/usb-load-ehci-first.conf #260139
161
162 newinitd "${FILESDIR}"/kmod-static-nodes-r1 kmod-static-nodes
163 }
164
165 pkg_postinst() {
166 if [[ -L ${EROOT%/}/etc/runlevels/boot/static-nodes ]]; then
167 ewarn "Removing old conflicting static-nodes init script from the boot runlevel"
168 rm -f "${EROOT%/}"/etc/runlevels/boot/static-nodes
169 fi
170
171 # Add kmod to the runlevel automatically if this is the first install of this package.
172 if [[ -z ${REPLACING_VERSIONS} ]]; then
173 if [[ ! -d ${EROOT%/}/etc/runlevels/sysinit ]]; then
174 mkdir -p "${EROOT%/}"/etc/runlevels/sysinit
175 fi
176 if [[ -x ${EROOT%/}/etc/init.d/kmod-static-nodes ]]; then
177 ln -s /etc/init.d/kmod-static-nodes "${EROOT%/}"/etc/runlevels/sysinit/kmod-static-nodes
178 fi
179 fi
180
181 if [[ -e ${EROOT%/}/etc/runlevels/sysinit ]]; then
182 if [[ ! -e ${EROOT%/}/etc/runlevels/sysinit/kmod-static-nodes ]]; then
183 ewarn
184 ewarn "You need to add kmod-static-nodes to the sysinit runlevel for"
185 ewarn "kernel modules to have required static nodes!"
186 ewarn "Run this command:"
187 ewarn "\trc-update add kmod-static-nodes sysinit"
188 fi
189 fi
190 }

  ViewVC Help
Powered by ViewVC 1.1.20