From 72886e0a921ce40a8a252c7c47539c795872a613 Mon Sep 17 00:00:00 2001 From: marc Date: Thu, 18 Feb 1999 21:26:04 +0000 Subject: [PATCH] port added; Joe (plus some cleanup) --- net/sharity-light/Makefile | 39 +++++++++++ net/sharity-light/files/Makefile.unshlight | 4 ++ net/sharity-light/files/md5 | 1 + net/sharity-light/files/unshlight.c | 77 ++++++++++++++++++++++ net/sharity-light/patches/patch-ad | 31 +++++++++ net/sharity-light/pkg/COMMENT | 1 + net/sharity-light/pkg/DESCR | 15 +++++ net/sharity-light/pkg/PLIST | 6 ++ 8 files changed, 174 insertions(+) create mode 100644 net/sharity-light/Makefile create mode 100644 net/sharity-light/files/Makefile.unshlight create mode 100644 net/sharity-light/files/md5 create mode 100644 net/sharity-light/files/unshlight.c create mode 100644 net/sharity-light/patches/patch-ad create mode 100644 net/sharity-light/pkg/COMMENT create mode 100644 net/sharity-light/pkg/DESCR create mode 100644 net/sharity-light/pkg/PLIST diff --git a/net/sharity-light/Makefile b/net/sharity-light/Makefile new file mode 100644 index 00000000000..faf94777c6b --- /dev/null +++ b/net/sharity-light/Makefile @@ -0,0 +1,39 @@ +# New ports collection makefile for: sharity-light +# Version required: 1.0 +# Date created: 14 June 1997 +# Whom: Dmitrij Tejblum +# +# $OpenBSD: Makefile,v 1.1.1.1 1999/02/18 21:26:04 marc Exp $ +# $FreeBSD: Makefile,v 1.10 1999/01/06 17:11:23 dt Exp $ +# + +DISTNAME= Sharity-Light.1.2 +PKGNAME= sharity-light-1.2 +CATEGORIES= net +MASTER_SITES= ftp://ftp.obdev.at/pub/Products/Sharity-Light/ \ + ftp://ftp.warpnet.ro/mirrors/ftp.obdev.at/pub/Products/Sharity-Light/ \ + http://www.freebsd.org/~dt/distfiles/ + +MAINTAINER= dt@FreeBSD.ORG + +MAN8= smbmount.8 + +post-extract: + @${MKDIR} ${WRKDIR}/unshlight + @${CP} ${FILESDIR}/unshlight.c ${WRKDIR}/unshlight + @${CP} ${FILESDIR}/Makefile.unshlight ${WRKDIR}/unshlight/Makefile + +post-build: + cd ${WRKDIR}/unshlight && make + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/shlight ${PREFIX}/sbin + ${INSTALL_PROGRAM} ${WRKDIR}/unshlight/unshlight ${PREFIX}/sbin +.if !defined(NOPORTDOCS) + ${MKDIR} ${PREFIX}/share/doc/Sharity-Light + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/Sharity-Light/README + ${INSTALL_DATA} ${WRKSRC}/FAQ.txt ${PREFIX}/share/doc/Sharity-Light/FAQ +.endif + ${INSTALL_MAN} ${WRKSRC}/smbmount.8 ${PREFIX}/man/man8 + +.include diff --git a/net/sharity-light/files/Makefile.unshlight b/net/sharity-light/files/Makefile.unshlight new file mode 100644 index 00000000000..7026b344fa3 --- /dev/null +++ b/net/sharity-light/files/Makefile.unshlight @@ -0,0 +1,4 @@ +PROG=unshlight +NOMAN=sorry + +.include diff --git a/net/sharity-light/files/md5 b/net/sharity-light/files/md5 new file mode 100644 index 00000000000..0c4e479f56f --- /dev/null +++ b/net/sharity-light/files/md5 @@ -0,0 +1 @@ +MD5 (Sharity-Light.1.2.tar.gz) = bf892019a5cbdb2ef4a2d69d858482b4 diff --git a/net/sharity-light/files/unshlight.c b/net/sharity-light/files/unshlight.c new file mode 100644 index 00000000000..b8502060d05 --- /dev/null +++ b/net/sharity-light/files/unshlight.c @@ -0,0 +1,77 @@ +#include +#include + +#include +#include +#include +#include +#include + +static void usage(void); + +int +main(int argc, char** argv) +{ + struct statfs* mntbuf; + int mntcount, i; + int aflag=0; + int ch; + + while ( (ch = getopt(argc, argv, "a")) != -1) { + switch (ch) { + case 'a': + aflag=1; + break; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (aflag && argc != 0) + usage(); + if (!aflag && argc == 0) + usage(); + + for (; argc>0 || aflag; aflag?(void)(aflag=0):(void)(argc--, argv++)) { + char abspath[MAXPATHLEN]; + pid_t pid=0; + if (argc > 0) { + if (realpath(argv[0], abspath) == 0) { + warn(abspath); + continue; + } + } + mntcount=getmntinfo(&mntbuf, MNT_NOWAIT); + if (mntcount < 0) + err(EX_OSERR, "getmntinfo"); + for (i=0; i 0 && strcmp(abspath, mntbuf[i].f_mntonname) != 0) continue; +#if defined(__FreeBSD_version) && __FreeBSD_version > 300000 + if (strcmp(mntbuf[i].f_fstypename, "nfs") != 0) continue; +#else + if (mntbuf[i].f_type != MOUNT_NFS) continue; +#endif + if (strncmp(mntbuf[i].f_mntfromname, "shlight-", 8) != 0) continue; + pid=strtoul(mntbuf[i].f_mntfromname+8, &s, 10); + if (*s) continue; + error = unmount (mntbuf[i].f_mntonname, 0); + if (error == 0) { + kill (pid, SIGHUP); + } else { + warn(mntbuf[i].f_mntonname); + } + } + if (argc > 0 && !pid) + warnx("%s: not currently mounted", abspath); + } +} + +void +usage(void) +{ + errx(EX_USAGE, "Usage: unshlight [-a] [node]"); +} diff --git a/net/sharity-light/patches/patch-ad b/net/sharity-light/patches/patch-ad new file mode 100644 index 00000000000..be51b6c7ee7 --- /dev/null +++ b/net/sharity-light/patches/patch-ad @@ -0,0 +1,31 @@ +--- Makefile.orig Mon Jan 4 19:07:31 1999 ++++ Makefile Mon Jan 4 19:08:07 1999 +@@ -12,11 +12,11 @@ + ############################################################################## + + # For NEXTSTEP/OPENSTEP: +-CFLAGS = -Wall -O2 -traditional-cpp -g ++#CFLAGS = -Wall -O2 -traditional-cpp -g + # put your architecture here: +-ARCH = -arch i386 +-THE_CC = cc +-RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized ++#ARCH = -arch i386 ++#THE_CC = cc ++#RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized + + # For Linux: (use static linking because of libc5/libc6 troubles) + #CFLAGS = -Wall -O2 -g +@@ -24,9 +24,9 @@ + #RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized + + # For FreeBSD +-#CFLAGS = -Wall -O2 +-#THE_CC = cc +-#RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized ++CFLAGS += -Wall ++THE_CC := $(CC) ++RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized + + # For NetBsd + #CFLAGS = -Wall -O2 -DNETBSD diff --git a/net/sharity-light/pkg/COMMENT b/net/sharity-light/pkg/COMMENT new file mode 100644 index 00000000000..8963897906d --- /dev/null +++ b/net/sharity-light/pkg/COMMENT @@ -0,0 +1 @@ +An userland smbfs --- SMB to NFS protocols converter diff --git a/net/sharity-light/pkg/DESCR b/net/sharity-light/pkg/DESCR new file mode 100644 index 00000000000..1adb445dd69 --- /dev/null +++ b/net/sharity-light/pkg/DESCR @@ -0,0 +1,15 @@ +If you want a short description of what Sharity-Light can do for you: you can +mount volumes exported by Windows or related operating systems on your Unix +machine. For a more detailed description I will quote from the README file: + +What does Sharity-Light do? +=========================== +If you know smbfs for Linux: Sharity-Light is roughly the same. It is +derived from smbfs, but runs as a user level program, not in the kernel. +If you know samba: Sharity-Light is roughly the opposite: a client for the +Lanmanager protocol. If you know neither of these: Sharity-Light lets you +mount drives exported by Windows (f.Workgroups/95/NT), Lan Manager, OS/2 +etc. on Unix machines. + + +For more information, see http://www.obdev.at/Products/ diff --git a/net/sharity-light/pkg/PLIST b/net/sharity-light/pkg/PLIST new file mode 100644 index 00000000000..4c172ad8856 --- /dev/null +++ b/net/sharity-light/pkg/PLIST @@ -0,0 +1,6 @@ +sbin/shlight +sbin/unshlight +man/man8/smbmount.8 +share/doc/Sharity-Light/README +share/doc/Sharity-Light/FAQ +@dirrm share/doc/Sharity-Light