From 706525306b0e8272c6819e9ab400561d719bb2a8 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Mon, 16 Jan 2012 21:24:37 +0100 Subject: [PATCH] version 4 --- .gitignore | 3 +- kmod-2-with-rootlibdir.patch | 173 ----------------------------------- kmod.spec | 74 ++++++++------- sources | 2 +- 4 files changed, 38 insertions(+), 214 deletions(-) delete mode 100644 kmod-2-with-rootlibdir.patch diff --git a/.gitignore b/.gitignore index db8cbbb..6daca31 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -/kmod-2.tar.xz -/kmod-3.tar.xz +/kmod-4.tar.xz diff --git a/kmod-2-with-rootlibdir.patch b/kmod-2-with-rootlibdir.patch deleted file mode 100644 index 4376ba0..0000000 --- a/kmod-2-with-rootlibdir.patch +++ /dev/null @@ -1,173 +0,0 @@ -diff -urNp kmod-2_orig/configure kmod-2/configure ---- kmod-2_orig/configure 2011-12-20 20:48:00.170160687 -0500 -+++ kmod-2/configure 2011-12-23 12:59:38.968930925 -0500 -@@ -621,6 +621,7 @@ required_private_libs - zlib_libs - BUILD_TOOLS_FALSE - BUILD_TOOLS_TRUE -+rootlibdir - rootprefix - OTOOL64 - OTOOL -@@ -745,6 +746,7 @@ with_gnu_ld - with_sysroot - enable_libtool_lock - with_rootprefix -+with_rootlibdir - enable_tools - enable_logging - enable_zlib -@@ -1405,6 +1407,7 @@ Optional Packages: - (or the compiler's sysroot if not specified). - --with-rootprefix=DIR rootfs directory prefix for config files and kernel - modules -+ --with-rootlibdir=DIR rootfs directory to install shared libraries - - Some influential environment variables: - CC C compiler command -@@ -13233,6 +13236,17 @@ fi - rootprefix=$with_rootprefix - - -+ -+# Check whether --with-rootlibdir was given. -+if test "${with_rootlibdir+set}" = set; then : -+ withval=$with_rootlibdir; -+else -+ with_rootlibdir=$libdir -+fi -+ -+rootlibdir=$with_rootlibdir -+ -+ - # Check whether --enable-tools was given. - if test "${enable_tools+set}" = set; then : - enableval=$enable_tools; -@@ -15828,6 +15842,7 @@ fi - rootprefix: ${rootprefix} - sysconfdir: ${sysconfdir} - libdir: ${libdir} -+ rootlibdir: ${rootlibdir} - includedir: ${includedir} - bindir: ${bindir} - -@@ -15848,6 +15863,7 @@ $as_echo " - rootprefix: ${rootprefix} - sysconfdir: ${sysconfdir} - libdir: ${libdir} -+ rootlibdir: ${rootlibdir} - includedir: ${includedir} - bindir: ${bindir} - -diff -urNp kmod-2_orig/configure.ac kmod-2/configure.ac ---- kmod-2_orig/configure.ac 2011-12-20 20:36:37.036701029 -0500 -+++ kmod-2/configure.ac 2011-12-23 12:59:39.035936076 -0500 -@@ -32,6 +32,11 @@ AC_ARG_WITH([rootprefix], - [], [with_rootprefix=""]) - AC_SUBST([rootprefix], [$with_rootprefix]) - -+AC_ARG_WITH([rootlibdir], -+ AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), -+ [], [with_rootlibdir=$libdir]) -+AC_SUBST([rootlibdir], [$with_rootlibdir]) -+ - AC_ARG_ENABLE([tools], - AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]), - [], enable_tools=yes) -@@ -134,6 +139,7 @@ AC_MSG_RESULT([ - rootprefix: ${rootprefix} - sysconfdir: ${sysconfdir} - libdir: ${libdir} -+ rootlibdir: ${rootlibdir} - includedir: ${includedir} - bindir: ${bindir} - -diff -urNp kmod-2_orig/Makefile.am kmod-2/Makefile.am ---- kmod-2_orig/Makefile.am 2011-12-20 20:36:21.337897292 -0500 -+++ kmod-2/Makefile.am 2011-12-23 12:59:39.036936153 -0500 -@@ -53,6 +53,18 @@ libkmod_libkmod_la_LIBADD = @zlib_libs@ - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = libkmod/libkmod.pc - -+install-exec-hook: -+ if test "$(libdir)" != "$(rootlibdir)"; then \ -+ mkdir -p $(DESTDIR)$(rootlibdir) && \ -+ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \ -+ so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \ -+ ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \ -+ mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \ -+ fi -+ -+uninstall-hook: -+ rm -f $(DESTDIR)$(rootlibdir)/libkmod.so* -+ - if BUILD_TOOLS - bin_PROGRAMS = tools/kmod-insmod tools/kmod-rmmod tools/kmod-lsmod \ - tools/kmod-modprobe tools/kmod-modinfo -diff -urNp kmod-2_orig/Makefile.in kmod-2/Makefile.in ---- kmod-2_orig/Makefile.in 2011-12-20 20:47:59.649167201 -0500 -+++ kmod-2/Makefile.in 2011-12-23 13:00:18.694985405 -0500 -@@ -322,6 +322,7 @@ prefix = @prefix@ - program_transform_name = @program_transform_name@ - psdir = @psdir@ - required_private_libs = @required_private_libs@ -+rootlibdir = @rootlibdir@ - rootprefix = @rootprefix@ - sbindir = @sbindir@ - sharedstatedir = @sharedstatedir@ -@@ -1174,7 +1175,8 @@ install-dvi: install-dvi-am - install-dvi-am: - - install-exec-am: install-binPROGRAMS install-libLTLIBRARIES -- -+ @$(NORMAL_INSTALL) -+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook - install-html: install-html-am - - install-html-am: -@@ -1217,8 +1219,10 @@ ps-am: - - uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ - uninstall-libLTLIBRARIES uninstall-pkgconfigDATA -- --.MAKE: all check-am install-am install-strip -+ @$(NORMAL_INSTALL) -+ $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -+.MAKE: all check-am install-am install-exec-am install-strip \ -+ uninstall-am - - .PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \ - clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ -@@ -1230,7 +1234,7 @@ uninstall-am: uninstall-binPROGRAMS unin - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS install-data \ - install-data-am install-dvi install-dvi-am install-exec \ -- install-exec-am install-html install-html-am \ -+ install-exec-am install-exec-hook install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-pkgconfigDATA install-ps install-ps-am install-strip \ -@@ -1238,9 +1242,21 @@ uninstall-am: uninstall-binPROGRAMS unin - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ -- uninstall-includeHEADERS uninstall-libLTLIBRARIES \ -- uninstall-pkgconfigDATA -+ uninstall-hook uninstall-includeHEADERS \ -+ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA -+ -+ -+install-exec-hook: -+ if test "$(libdir)" != "$(rootlibdir)"; then \ -+ mkdir -p $(DESTDIR)$(rootlibdir) && \ -+ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \ -+ so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \ -+ ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \ -+ mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \ -+ fi - -+uninstall-hook: -+ rm -f $(DESTDIR)$(rootlibdir)/libkmod.so* - - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/kmod.spec b/kmod.spec index 44edd61..d4cf1e2 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,5 +1,5 @@ Name: kmod -Version: 3 +Version: 4 Release: 1%{?dist} Summary: Linux kernel module management utilities @@ -13,13 +13,13 @@ Source0: http://packages.profusion.mobi/kmod/%{name}-%{version}.tar.xz Exclusiveos: Linux BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildRequires: chrpath +BuildRequires: zlib-devel +BuildRequires: xz-devel -BuildRequires: zlib-devel chrpath - -# TODO: Investigate the following and determine prefered policy guide -# Fedora Renaming/Replacing Existing Packages policy (review/FIXME) #Provides: module-init-tools = 4.0-1 #Obsoletes: module-init-tools < 4.0-1 +#Provides: /sbin/modprobe %description The kmod package provides various programs needed for automatic @@ -45,46 +45,40 @@ Requires: %{name} = %{version}-%{release} The kmod-devel package provides header files used for development of applications that wish to load or unload Linux kernel modules. - %prep %setup -q - %build -# Initially configure into /sbin in line with existing tools. This may well -# move into /usr as part of the planned changes to filesystem layout soon. -%configure --disable-static --bindir=/bin --with-rootlibdir=/%{_lib} +# Install into /bin, /lib* for now. This will move into /usr as part of +# the planned changes to filesystem layout soon. +%configure \ + --bindir=/bin \ + --with-rootprefix= \ + --with-rootlibdir=/%{_lib} \ + --with-zlib \ + --with-xz make %{?_smp_mflags} -# TODO: add a doc target here %install rm -rf $RPM_BUILD_ROOT -# TODO: Initially these are installed in /sbin like module-init-tools -# TODO: That *cannot* change for the moment (but explicitly noted here) make install DESTDIR=$RPM_BUILD_ROOT -rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la # TODO: Fix the upstream rpath issues to avoid doing this (just for now) chrpath --delete $RPM_BUILD_ROOT/bin/kmod -#chrpath --delete $RPM_BUILD_ROOT/bin/kmod-depmod -#chrpath --delete $RPM_BUILD_ROOT/bin/kmod-insmod -#chrpath --delete $RPM_BUILD_ROOT/bin/kmod-lsmod -#chrpath --delete $RPM_BUILD_ROOT/bin/kmod-modinfo -#chrpath --delete $RPM_BUILD_ROOT/bin/kmod-modprobe -#chrpath --delete $RPM_BUILD_ROOT/bin/kmod-rmmod -mkdir -p $RPM_BUILD_ROOT/etc -mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d +rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la +#mkdir -p $RPM_BUILD_ROOT/sbin +#ln -sf ../bin/kmod $RPM_BUILD_ROOT/sbin/modprobe +#ln -sf ../bin/kmod $RPM_BUILD_ROOT/sbin/modinfo +#ln -sf ../bin/kmod $RPM_BUILD_ROOT/sbin/insmod +#ln -sf ../bin/kmod $RPM_BUILD_ROOT/sbin/rmmod +#ln -sf ../bin/kmod $RPM_BUILD_ROOT/sbin/depmod +rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/*.5* +rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/*.8* -# New configuration files we ship (if any) should go into /lib/modprobe.d -# in order to allow the local sysadmin to customize /etc/modprobe.d -# NOTE: These do not use macros because we always want "/lib" (no multilib) -mkdir -p $RPM_BUILD_ROOT/lib mkdir -p $RPM_BUILD_ROOT/lib/modprobe.d - -mkdir -p $RPM_BUILD_ROOT/etc/depmod.d -# We used to create a depmod "dist.conf" but do not use that any more - +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d %clean rm -rf $RPM_BUILD_ROOT @@ -95,18 +89,17 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -# TODO: Add documentation files and man pages %dir %{_sysconfdir}/depmod.d %dir %{_sysconfdir}/modprobe.d -# NOTE: always /lib even on systems with /lib64 (there is no macro available) %dir /lib/modprobe.d /bin/kmod -#/bin/kmod-depmod -#/bin/kmod-insmod -#/bin/kmod-lsmod -#/bin/kmod-modinfo -#/bin/kmod-modprobe -#/bin/kmod-rmmod +#/sbin/modprobe +#/sbin/modinfo +#/sbin/insmod +#/sbin/rmmod +#/sbin/depmod +#%attr(0644,root,root) %{_mandir}/man5/*.5* +#%attr(0644,root,root) %{_mandir}/man8/*.8* %doc NEWS README TODO COPYING %files libs @@ -118,6 +111,11 @@ rm -rf $RPM_BUILD_ROOT /%{_libdir}/libkmod.so* %changelog +* Mon Jan 16 2012 Kay Sievers +- Update to version 4 +- set --with-rootprefix= +- enable zlib and xz support + * Thu Jan 05 2012 Jon Masters - 3-1 - Update to latest upstream (adds new depmod replacement utility) - For the moment, use the "kmod" utility to test the various functions diff --git a/sources b/sources index 6192bd1..8e810d0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bc0e69f75c2ac22c091f05e166e86c5d kmod-3.tar.xz +e14450a066a48accd0af1995b3c0232d kmod-4.tar.xz