aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dkms.mkconf
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2013-02-08 11:02:08 -0800
committerBrian Behlendorf <[email protected]>2013-03-18 15:31:54 -0700
commit493972c8964174d0ec767c4e780bb3add71363fe (patch)
treedb080966f3503484616e7e97ae555f0f52fad028 /scripts/dkms.mkconf
parent4a6d8d2c3e72345463de1db97d7d016c95443679 (diff)
Refresh RPM packaging
Refresh the existing RPM packaging to conform to the 'Fedora Packaging Guidelines'. This includes adopting the kmods2 packaging standard which is used fod kmods distributed by rpmfusion for Fedora/RHEL. http://fedoraproject.org/wiki/Packaging:Guidelines http://rpmfusion.org/Packaging/KernelModules/Kmods2 While the spec files have been entirely rewritten from a user perspective the only major changes are: * The Fedora packages now have a build dependency on the rpmfusion repositories. The generic kmod packages also have a new dependency on kmodtool-1.22 but it is bundled with the source rpm so no additional packages are needed. * The kernel binary module packages have been renamed from spl-modules-* to kmod-spl-* as specificed by kmods2. * The is now a common kmod-spl-devel-* package in addition to the per-kernel devel packages. The common package contains the development headers while the per-kernel package contains kernel specific build products. Signed-off-by: Brian Behlendorf <[email protected]> Closes #222
Diffstat (limited to 'scripts/dkms.mkconf')
-rwxr-xr-xscripts/dkms.mkconf81
1 files changed, 81 insertions, 0 deletions
diff --git a/scripts/dkms.mkconf b/scripts/dkms.mkconf
new file mode 100755
index 000000000..3bfe2be7b
--- /dev/null
+++ b/scripts/dkms.mkconf
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+PROG=$0
+
+pkgcfg=/etc/sysconfig/spl
+
+while getopts "n:v:c:f:" opt; do
+ case $opt in
+ n) pkgname=$OPTARG ;;
+ v) pkgver=$OPTARG ;;
+ c) pkgcfg=$OPTARG ;;
+ f) filename=$OPTARG ;;
+ esac
+done
+
+if [ -z "${pkgname}" -o -z "${pkgver}" -o -z "${filename}" ]; then
+ echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>"
+ exit 1
+fi
+
+cat >${filename} <<EOF
+PACKAGE_NAME="${pkgname}"
+PACKAGE_VERSION="${pkgver}"
+PACKAGE_CONFIG="${pkgcfg}"
+PRE_BUILD="configure
+ --prefix=/usr
+ --with-config=kernel
+ \$(
+ [[ -r \${PACKAGE_CONFIG} ]] \\
+ && source \${PACKAGE_CONFIG} \\
+ && shopt -q -s extglob \\
+ && \\
+ {
+ if [[ \${SPL_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
+ then
+ echo --enable-debug
+ fi
+ if [[ \${SPL_DKMS_ENABLE_DEBUG_LOG,,} == @(y|yes) ]]
+ then
+ echo --enable-debug-log
+ fi
+ if [[ \${SPL_DKMS_ENABLE_DEBUG_KMEM,,} == @(y|yes) ]]
+ then
+ echo --enable-debug-kmem
+ fi
+ if [[ \${SPL_DKMS_ENABLE_DEBUG_KMEM_TRACKING,,} == @(y|yes) ]]
+ then
+ echo --enable-debug-kmem-tracking
+ fi
+ if [[ \${SPL_DKMS_ENABLE_ATOMIC_SPINLOCKS,,} == @(y|yes) ]]
+ then
+ echo --enable-atomic-spinlocks
+ fi
+ }
+ )
+"
+POST_INSTALL="scripts/dkms.postinst
+ -n \${PACKAGE_NAME}
+ -v \${PACKAGE_VERSION}
+ -a \${arch}
+ -k \${kernelver}
+ -t \${dkms_tree}
+"
+AUTOINSTALL="yes"
+REMAKE_INITRD="no"
+MAKE[0]="make"
+STRIP[0]="\$(
+ [[ -r \${PACKAGE_CONFIG} ]] \\
+ && source \${PACKAGE_CONFIG} \\
+ && shopt -q -s extglob \\
+ && [[ \${SPL_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\
+ && echo -n no
+)"
+STRIP[1]="\${STRIP[0]}"
+BUILT_MODULE_NAME[0]="spl"
+BUILT_MODULE_LOCATION[0]="module/spl/"
+DEST_MODULE_LOCATION[0]="/extra/spl/spl"
+BUILT_MODULE_NAME[1]="splat"
+BUILT_MODULE_LOCATION[1]="module/splat/"
+DEST_MODULE_LOCATION[1]="/extra/splat/splat"
+EOF