diff options
author | lawrance <lawrance@FreeBSD.org> | 2006-05-17 15:15:36 +0800 |
---|---|---|
committer | lawrance <lawrance@FreeBSD.org> | 2006-05-17 15:15:36 +0800 |
commit | f5041e7a8a1c1edf92a64fc607fd5ac640149570 (patch) | |
tree | 312279d5450bfb3eb21ca82593fcef5551539f54 /sysutils | |
parent | 7a1caafc52230e1a731d8d0c4034b58c0da21121 (diff) | |
download | freebsd-ports-gnome-f5041e7a8a1c1edf92a64fc607fd5ac640149570.tar.gz freebsd-ports-gnome-f5041e7a8a1c1edf92a64fc607fd5ac640149570.tar.zst freebsd-ports-gnome-f5041e7a8a1c1edf92a64fc607fd5ac640149570.zip |
Fix pkg-plist.
Improve install/deinstall scripts and make use of SUB_FILES
to avoid hardcoding paths.
Add support for FreeBSD 5.3 and later.
PR: ports/97331
Submitted by: Nick Barkas <snb@threerings.net> (maintainer)
Obtained from: Dmitry Frolov <frolov@riss-telecom.ru>
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/ipmi-kmod/Makefile | 26 | ||||
-rw-r--r-- | sysutils/ipmi-kmod/files/patch-dev-ipmi-ipmi_pci.c | 13 | ||||
-rw-r--r-- | sysutils/ipmi-kmod/files/pkg-deinstall.in | 20 | ||||
-rw-r--r-- | sysutils/ipmi-kmod/files/pkg-install.in | 12 | ||||
-rw-r--r-- | sysutils/ipmi-kmod/pkg-deinstall | 20 | ||||
-rw-r--r-- | sysutils/ipmi-kmod/pkg-descr | 2 |
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/ |