From: Derrick Brashear Date: Thu, 24 Jan 2008 23:55:02 +0000 (+0000) Subject: redhat-support-dkms-20080124 X-Git-Tag: BP-openafs-windows-kdfs-ifs~180 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=7dc71d1154294cdc5f5aba4c3e58a00972318960 redhat-support-dkms-20080124 LICENSE IPL10 attempt to provide dkms support. this does work on my fc8 test host. it may not work in all cases. --- diff --git a/src/packaging/RedHat/openafs-buildall.sh b/src/packaging/RedHat/openafs-buildall.sh index e87fc27..3ff7144 100755 --- a/src/packaging/RedHat/openafs-buildall.sh +++ b/src/packaging/RedHat/openafs-buildall.sh @@ -35,7 +35,7 @@ elif [ `echo $rhrel | grep -c 'CentOS'` = 1 ] ; then elif [ `echo $rhrel | grep -c 'Red Hat Linux'` = 1 ] ; then ostype='rh' osrel=`echo $rhrel | sed -e 's/^.*release \([^ ]*\).*$/\1/' -e 's/\.//g'` -elif [ `echo $rhrel | grep -c 'SUSE LINUX'` = 1 ] ; then +elif [ `echo $rhrel | grep -c 'SUSE'` = 1 ] ; then ostype='suse' specdir=/usr/src/packages/SPECS osrel=`grep VERSION /etc/SuSE-release|awk '{print $3}'` diff --git a/src/packaging/RedHat/openafs-client.init b/src/packaging/RedHat/openafs-client.init index 0b4a8a4..e8128aa 100644 --- a/src/packaging/RedHat/openafs-client.init +++ b/src/packaging/RedHat/openafs-client.init @@ -4,6 +4,7 @@ # # chkconfig: 2345 50 50 # description: OpenAFS is a distributed filesystem. +# Should-Start: dkms # # $Revision$ diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index d21534d..d527f7f 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -12,6 +12,7 @@ %endif %{!?fedorakmod: %define fedorakmod 1} +%{!?build_dkmspkg: %define build_dkmspkg 1} # Determine presence of rpmbuild command line --define arguments used for # option specification @@ -70,6 +71,8 @@ # End legacy kernel build stuff %endif +%define dkms_version %{osvers}.%{pkgrel} + # Set 'debugspec' to 1 if you want to debug the spec file. This will # not remove the installed tree as part of the %clean operation %if %{?debugspec:0}%{!?debugspec:1} @@ -80,6 +83,12 @@ # to distribute aklog and asetkey %define krb5support %{?_without_krb5:0}%{!?_without_krb5:1} +%if %{krb5support} +%if %{?krb5config:0}%{!?krb5config:1} +%define krb5config /usr/kerberos/bin/krb5-config +%endif +%endif + # Set 'bootkernelsupport' to 1 if you want to build the # kernel module for Red Hat BOOT Kernels on x86. %define bootkernelsupport %{?_with_bootkernel:1}%{!?_with_bootkernel:0} @@ -217,7 +226,7 @@ Release: %{osvers}.%{pkgrel} License: IBM Public License URL: http://www.openafs.org BuildRoot: %{_tmppath}/%{name}-%{version}-root -Packager: Derek Atkins +Packager: OpenAFS Gatekeepers Group: Networking/Filesystems BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison %if %{krb5support} @@ -342,6 +351,29 @@ administrative management. This package provides basic server support to host files in an AFS Cell. +%if %{build_dkmspkg} +%package -n dkms-%{name} +Summary: DKMS-ready kernel source for AFS distributed filesystem +Group: Development/Kernel +Provides: openafs-kernel = %{PACKAGE_VERSION} +%if %{fedorakmod} +Provides: %{name}-kmod = %{PACKAGE_VERSION} +%endif +Requires(pre): dkms +Requires(pre): flex +Requires(post): dkms +Requires: %{name}-kmod-common = %{version} + +%description -n dkms-%{name} +The AFS distributed filesystem. AFS is a distributed filesystem +allowing cross-platform sharing of files among multiple computers. +Facilities are provided for access control, authentication, backup and +administrative management. + +This package provides the source code to allow DKMS to build an +AFS kernel module. +%endif + %if %{build_authlibs} %package authlibs Summary: OpenAFS authentication shared libraries @@ -809,7 +841,7 @@ CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS --with-linux-kernel-headers=${ksrc} \ %endif %if %{krb5support} - --with-krb5-conf=/usr/kerberos/bin/krb5-config \ + --with-krb5-conf=%{krb5config} \ %endif $config_opts \ || exit 1 @@ -972,6 +1004,28 @@ install -p -m 644 %{SOURCE20} $uve/CellServDB.dist install -p -m 644 src/packaging/RedHat/openafs-cacheinfo $uve/cacheinfo # +# install dkms source +# +install -d -m 755 $RPM_BUILD_ROOT%{_prefix}/src +cp -a libafs_tree $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version} + +cat > $RPM_BUILD_ROOT%{_prefix}/src/%{name}-%{dkms_version}/dkms.conf <