aboutsummaryrefslogtreecommitdiff
path: root/comms/ltmdm
diff options
context:
space:
mode:
authorSergey A. Osokin <osa@FreeBSD.org>2006-02-27 12:40:57 +0000
committerSergey A. Osokin <osa@FreeBSD.org>2006-02-27 12:40:57 +0000
commit5911c46a9178c5362fbfeffebdd3a4a8b3d4b060 (patch)
treee5790054032d830a8d94b17a0d71bc3ae72a3e84 /comms/ltmdm
parent5b75d68309a2d3c53c88f5186fa08b2366b11cd4 (diff)
downloadports-5911c46a9178c5362fbfeffebdd3a4a8b3d4b060.tar.gz
ports-5911c46a9178c5362fbfeffebdd3a4a8b3d4b060.zip
Notes
Diffstat (limited to 'comms/ltmdm')
-rw-r--r--comms/ltmdm/Makefile50
-rw-r--r--comms/ltmdm/files/ltmdm.sh.in85
-rw-r--r--comms/ltmdm/files/pkg-message.in (renamed from comms/ltmdm/pkg-message)10
-rw-r--r--comms/ltmdm/pkg-plist19
4 files changed, 65 insertions, 99 deletions
diff --git a/comms/ltmdm/Makefile b/comms/ltmdm/Makefile
index 2538e7ae05dd..75dc0f48e62f 100644
--- a/comms/ltmdm/Makefile
+++ b/comms/ltmdm/Makefile
@@ -7,36 +7,48 @@
PORTNAME= ltmdm
PORTVERSION= 1.4
-PORTREVISION= 17
+PORTREVISION= 18
CATEGORIES= comms
MASTER_SITES= http://www.dons.net.au/~darius/
EXTRACT_SUFX= .tgz
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= osa@FreeBSD.org
COMMENT= Driver for the Lucent LT Winmodem chipset
+DEVDIR= ${DESTDIR}/dev
+MODULES_WITH_WORLD?= yes
ONLY_FOR_ARCHS= i386
BUILD_WRKSRC= ${WRKSRC}/sys/modules/ltmdm
NO_WRKSUBDIR= yes
+SUB_FILES+= pkg-message
+PKGMESSAGE= ${WRKDIR}/pkg-message
+NO_PACKAGE= "Should be recompiled for a particular FreeBSD kernel"
-USE_RC_SUBR= ltmdm.sh
-SUB_LIST= MAJOR=${LTMDM_DEV_MAJOR}
-LTMDM_DEV_MAJOR ?= 228
-LTMDM_OBJ_VERSION ?= 600
+LTMDM_DEV_MAJOR?= 228
+LTMDM_OBJ_VERSION?= 600
.if defined(WITH_595_OBJ)
-MAKE_ARGS= LTMDM_OBJ_VERSION=595
+MAKE_ARGS+= LTMDM_OBJ_VERSION=595
.endif
MAKE_ARGS+= LTMDM_DEV_MAJOR=${LTMDM_DEV_MAJOR}
MAKE_ARGS+= LTMDM_OBJ_VERSION=${LTMDM_OBJ_VERSION}
-MAKE_ENV+= WERROR=
+#MAKE_ENV+= WERROR=
+STRIP= # do not strip kernel module
PORTDOCS= README.TXT README-en.TXT INSTALL.TXT INSTALL-en.TXT
SYSDIR?= ${SRC_BASE}/sys
-PLIST_FILES= %%DATADIR%%/ltmdm.ko
-PLIST_DIRS= %%DATADIR%%
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 500000
+MAJOR= ${LTMDM_DEV_MAJOR}
+PLIST_SUB+= FREEBSD5="@comment " FREEBSD4=""
+PLIST_SUB+= MAJOR=${MAJOR}
+.else
+PLIST_SUB+= FREEBSD5="" FREEBSD4="@comment "
+.endif
+PLIST_SUB+= KMODDIR=${KMODDIR}
pre-fetch:
.if !exists(${SYSDIR}/Makefile)
@@ -54,14 +66,26 @@ pre-fetch:
.endif
do-install:
- @${MKDIR} ${DATADIR}
- @${INSTALL_DATA} ${WRKSRC}/sys/modules/ltmdm/ltmdm.ko ${DATADIR}
+ @${INSTALL_PROGRAM} ${BUILD_WRKSRC}/ltmdm.ko ${KMODDIR}
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for i in ${PORTDOCS}
@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}/
.endfor
.endif
+
+.if ${OSVERSION} < 500000
+ @${RM} -f ${DEVDIR}/cual0 ${DEVDIR}/cuail0 ${DEVDIR}/cuall0
+ @umask 7
+ @mknod ${DEVDIR}/cual0 c ${MAJOR} 128 uucp:dialer
+ @mknod ${DEVDIR}/cuail0 c ${MAJOR} 160 uucp:dialer
+ @mknod ${DEVDIR}/cuall0 c ${MAJOR} 192 uucp:dialer
+ @${RM} -f ${DEVDIR}/ttyl0 ${DEVDIR}/ttyil0 ${DEVDIR}/ttyll0
+ @umask 77
+ @mknod ${DEVDIR}/ttyl0 c ${MAJOR} 0 uucp:dialer
+ @mknod ${DEVDIR}/ttyil0 c ${MAJOR} 32 uucp:dialer
+ @mknod ${DEVDIR}/ttyll0 c ${MAJOR} 64 uucp:dialer
+.endif
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/comms/ltmdm/files/ltmdm.sh.in b/comms/ltmdm/files/ltmdm.sh.in
deleted file mode 100644
index 10fb24dfb346..000000000000
--- a/comms/ltmdm/files/ltmdm.sh.in
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-# $FreeBSD: /tmp/pcvs/ports/comms/ltmdm/files/Attic/ltmdm.sh.in,v 1.2 2006-02-20 20:46:49 dougb Exp $
-
-# PROVIDE: ltmdm
-# REQUIRE: DAEMON
-# BEFORE: LOGIN
-# KEYWORD: shutdown
-
-# Define these ltmdm_* variables in one of these files:
-# /etc/rc.conf
-# /etc/rc.conf.local
-# /etc/rc.conf.d/ltmdm
-#
-# DO NOT CHANGE THESE DEFAULT VALUES HERE
-#
-ltmdm_enable=${ltmdm_enable-"NO"}
-
-. %%RC_SUBR%%
-
-name="ltmdm"
-rcvar=`set_rcvar`
-start_cmd="ltmdm_start"
-stop_cmd="ltmdm_stop"
-MAJOR="%%MAJOR%%"
-
-load_rc_config $name
-
-ltmdm_devfs_check()
-{
- # Check devfs status, return
- # 0 - if devfs present
- # 1 - if devfs do not present
- if mount -p | awk '{print $3}'| grep -q devfs ; then
- return 0
- else
- return 1
- fi
-}
-
-ltmdm_start()
-{
- echo "Enabling ltmdm."
-
- # Check devfs status, if devfs do not presented
- # create cua* and tty* devices
- if ! ltmdm_devfs_check ; then
- umask 7
- mknod /dev/cual0 c ${MAJOR} 128 uucp:dialer
- mknod /dev/cuail0 c ${MAJOR} 160 uucp:dialer
- mknod /dev/cuall0 c ${MAJOR} 192 uucp:dialer
- umask 77
- mknod /dev/ttyl0 c ${MAJOR} 0 root:wheel
- mknod /dev/ttyil0 c ${MAJOR} 32 root:wheel
- mknod /dev/ttyll0 c ${MAJOR} 64 root:wheel
- fi
-
- # Load ltmdm kernel module if needed
- if ! kldstat -v | grep -q ltmdm\$; then
- if kldload %%PREFIX%%/share/ltmdm/ltmdm.ko; then
- info 'ltmdm module loaded.'
- else
- err 1 'ltmdm module failed to load.'
- fi
- fi
-
- # Ignore incoming calls
- echo "ats0=0">/dev/cual0
-}
-
-ltmdm_stop()
-{
- echo "Disabling ltmdm."
-
- # Check devfs status, if devfs do not presented
- # remove cua* and tty* devices
- if ! ltmdm_devfs_check ; then
- rm -f /dev/cual0 /dev/cuail0 /dev/cuall0 \
- /dev/ttyl0 /dev/ttyil0 /dev/ttyll0
- fi
-
- # Unload ltmdm kernel module
- kldstat -n ltmdm 2>/dev/null >/dev/null && kldunload ltmdm
-}
-
-run_rc_command "$1"
diff --git a/comms/ltmdm/pkg-message b/comms/ltmdm/files/pkg-message.in
index d74241a48c1a..c3d06c7cbf56 100644
--- a/comms/ltmdm/pkg-message
+++ b/comms/ltmdm/files/pkg-message.in
@@ -5,3 +5,13 @@
* source update. To do this reinstall the port. *
* *
*******************************************************************************
+To use these drivers, make sure that you have loaded the ltmdm kernel
+module, by doing
+
+ # kldload ltmdm
+
+or adding
+
+ ltmdm_load="YES"
+
+to your /boot/loader.conf.
diff --git a/comms/ltmdm/pkg-plist b/comms/ltmdm/pkg-plist
index 9d70d350f28c..46a9c4c770f3 100644
--- a/comms/ltmdm/pkg-plist
+++ b/comms/ltmdm/pkg-plist
@@ -1 +1,18 @@
-@unexec sh %D/etc/rc.d/ltmdm.sh stop || true
+@cwd %%KMODDIR%%
+ltmdm.ko
+%%FREEBSD5%%@unexec kldxref %D
+%%FREEBSD4%%@cwd /dev
+%%FREEBSD4%%@exec umask 7
+%%FREEBSD4%%@exec mknod /dev/cual0 c %%MAJOR%% 128 uucp:dialer
+%%FREEBSD4%%@exec mknod /dev/cuail0 c %%MAJOR%% 160 uucp:dialer
+%%FREEBSD4%%@exec mknod /dev/cuall0 c %%MAJOR%% 192 uucp:dialer
+%%FREEBSD4%%@exec umask 77
+%%FREEBSD4%%@exec mknod /dev/ttyl0 c %%MAJOR%% 0 uucp:dialer
+%%FREEBSD4%%@exec mknod /dev/ttyil0 c %%MAJOR%% 32 uucp:dialer
+%%FREEBSD4%%@exec mknod /dev/ttyll0 c %%MAJOR%% 64 uucp:dialer
+%%FREEBSD4%%@unexec rm -f /dev/cual0
+%%FREEBSD4%%@unexec rm -f /dev/cuail0
+%%FREEBSD4%%@unexec rm -f /dev/cuall0
+%%FREEBSD4%%@unexec rm -f /dev/ttyl0
+%%FREEBSD4%%@unexec rm -f /dev/ttyil0
+%%FREEBSD4%%@unexec rm -f /dev/ttyll0