aboutsummaryrefslogtreecommitdiff
path: root/sysutils/ipmi-kmod
diff options
context:
space:
mode:
authorSam Lawrance <lawrance@FreeBSD.org>2006-05-17 07:15:36 +0000
committerSam Lawrance <lawrance@FreeBSD.org>2006-05-17 07:15:36 +0000
commit7b419d28a098b164b8c012a828a99a7d79c0bea5 (patch)
tree68984da937557d30123e0a9d74c87f0f84e9a4a7 /sysutils/ipmi-kmod
parent5f78f05e88ab6c924c9009b0ae0cd645083de910 (diff)
downloadports-7b419d28a098b164b8c012a828a99a7d79c0bea5.tar.gz
ports-7b419d28a098b164b8c012a828a99a7d79c0bea5.zip
Notes
Diffstat (limited to 'sysutils/ipmi-kmod')
-rw-r--r--sysutils/ipmi-kmod/Makefile26
-rw-r--r--sysutils/ipmi-kmod/files/patch-dev-ipmi-ipmi_pci.c13
-rw-r--r--sysutils/ipmi-kmod/files/pkg-deinstall.in20
-rw-r--r--sysutils/ipmi-kmod/files/pkg-install.in12
-rw-r--r--sysutils/ipmi-kmod/pkg-deinstall20
-rw-r--r--sysutils/ipmi-kmod/pkg-descr2
6 files changed, 63 insertions, 30 deletions
diff --git a/sysutils/ipmi-kmod/Makefile b/sysutils/ipmi-kmod/Makefile
index fc1ec5224a6a..7cb9fbcbfd7c 100644
--- a/sysutils/ipmi-kmod/Makefile
+++ b/sysutils/ipmi-kmod/Makefile
@@ -11,10 +11,15 @@ CATEGORIES= sysutils
MASTER_SITES= http://dpw.threerings.net/projects/ipmi-kmod/
MAINTAINER= snb@threerings.net
-COMMENT= Backport of ipmi driver from FreeBSD 7-CURRENT for FreeBSD 6.x
+COMMENT= Backport of ipmi driver from FreeBSD 7-CURRENT for FreeBSD 5.x/6.x
-PLIST_FILES= include/sys/ipmi.h
-PLIST_DIRS= include/sys
+SUB_FILES= pkg-install pkg-deinstall
+SUB_LIST+= KMODDIR=${KMODDIR}
+
+PLIST_FILES= include/sys/ipmi.h \
+ "@dirrm include/sys" \
+ "@cwd /" \
+ ${KMODDIR:C,^/,,}/ipmi.ko \
# We want to install the module in /boot/modules rather than /boot/kernel
KMODDIR= /boot/modules
@@ -27,15 +32,18 @@ ONLY_FOR_ARCHS= i386 amd64
IGNORE= requires kernel source to be installed
.endif
-.if ${OSVERSION} < 600000
-IGNORE= FreeBSD before 6.0 is not supported
-.elif ${OSVERSION} > 700000
-IGNORE= FreeBSD 7.0 has an ipmi driver supplied by the kernel
+.if exists(/usr/include/sys/ipmi.h)
+IGNORE= already in the base system
+.elif ${OSVERSION} < 503000
+IGNORE= does not support FreeBSD before 5.3
.endif
do-install:
@${MKDIR} ${PREFIX}/include/sys
- ${INSTALL_SCRIPT} ${WRKSRC}/sys/ipmi.h ${PREFIX}/include/sys
- ${INSTALL_SCRIPT} ${WRKSRC}/ipmi.ko ${KMODDIR}
+ ${INSTALL_DATA} ${WRKSRC}/sys/ipmi.h ${PREFIX}/include/sys
+ ${INSTALL_PROGRAM} ${WRKSRC}/ipmi.ko ${DESTDIR}${KMODDIR}
+
+post-install:
+ @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.post.mk>
diff --git a/sysutils/ipmi-kmod/files/patch-dev-ipmi-ipmi_pci.c b/sysutils/ipmi-kmod/files/patch-dev-ipmi-ipmi_pci.c
new file mode 100644
index 000000000000..0d66bc8f692c
--- /dev/null
+++ b/sysutils/ipmi-kmod/files/patch-dev-ipmi-ipmi_pci.c
@@ -0,0 +1,13 @@
+--- dev/ipmi/ipmi_pci.c.orig Fri Feb 17 19:25:42 2006
++++ dev/ipmi/ipmi_pci.c Fri Feb 17 19:52:45 2006
+@@ -50,6 +50,10 @@
+ #include <dev/ipmi/ipmivars.h>
+ #endif
+
++#ifndef BUS_PROBE_DEFAULT
++#define BUS_PROBE_DEFAULT 0
++#endif
++
+ static int ipmi_pci_probe(device_t dev);
+ static int ipmi_pci_attach(device_t dev);
+ static int ipmi_pci_detach(device_t dev);
diff --git a/sysutils/ipmi-kmod/files/pkg-deinstall.in b/sysutils/ipmi-kmod/files/pkg-deinstall.in
new file mode 100644
index 000000000000..1500a86a6ae4
--- /dev/null
+++ b/sysutils/ipmi-kmod/files/pkg-deinstall.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# Unload ipmi module if necessary
+#
+# $FreeBSD$
+#
+
+KMODDIR="%%KMODDIR%%"
+
+case "$2" in
+DEINSTALL)
+ echo "Unloading ipmi kernel module."
+
+ # Unload the module if it is currently loaded.
+ kldstat -n ipmi 2>/dev/null >/dev/null && kldunload ipmi || true
+ ;;
+POST-DEINSTALL)
+ type kldxref >/dev/null 2>&1 && kldxref ${KMODDIR} || true
+ ;;
+esac
diff --git a/sysutils/ipmi-kmod/files/pkg-install.in b/sysutils/ipmi-kmod/files/pkg-install.in
new file mode 100644
index 000000000000..375d226c46e8
--- /dev/null
+++ b/sysutils/ipmi-kmod/files/pkg-install.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+KMODDIR="%%KMODDIR%%"
+
+if [ "$2" != "POST-INSTALL" ]; then
+ exit 0
+fi
+
+type kldxref >/dev/null 2>&1 && kldxref ${KMODDIR} || true
diff --git a/sysutils/ipmi-kmod/pkg-deinstall b/sysutils/ipmi-kmod/pkg-deinstall
deleted file mode 100644
index 5646d3c63b95..000000000000
--- a/sysutils/ipmi-kmod/pkg-deinstall
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# Unload ipmi module if necessary, then remove the file
-#
-# $FreeBSD$
-#
-
-if [ "x$2" != "xDEINSTALL" ]; then
- exit 0
-fi
-
-echo "Unloading ipmi kernel module."
-
-# Unload the module if it is currently loaded.
-kldstat -n ipmi 2>/dev/null >/dev/null && kldunload ipmi
-
-# Now remove the .ko file
-KMODDIR="/boot/modules"
-[ -f ${KMODDIR}/ipmi.ko ] && rm -f ${KMODDIR}/ipmi.ko
-
diff --git a/sysutils/ipmi-kmod/pkg-descr b/sysutils/ipmi-kmod/pkg-descr
index 6dd41611ef11..255f967eae82 100644
--- a/sysutils/ipmi-kmod/pkg-descr
+++ b/sysutils/ipmi-kmod/pkg-descr
@@ -1,3 +1,3 @@
-Backport of ipmi driver from FreeBSD 7-CURRENT for FreeBSD 6.x.
+Backport of ipmi driver from FreeBSD 7-CURRENT for FreeBSD 5.x/6.x.
WWW: http://dpw.threerings.net/projects/ipmi-kmod/