port added; Joe <rys@tir.com> (plus some cleanup)

This commit is contained in:
marc 1999-02-18 21:26:04 +00:00
parent 5a4aceee2b
commit 72886e0a92
8 changed files with 174 additions and 0 deletions

View File

@ -0,0 +1,39 @@
# New ports collection makefile for: sharity-light
# Version required: 1.0
# Date created: 14 June 1997
# Whom: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
#
# $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 <bsd.port.mk>

View File

@ -0,0 +1,4 @@
PROG=unshlight
NOMAN=sorry
.include <bsd.prog.mk>

View File

@ -0,0 +1 @@
MD5 (Sharity-Light.1.2.tar.gz) = bf892019a5cbdb2ef4a2d69d858482b4

View File

@ -0,0 +1,77 @@
#include <sys/param.h>
#include <sys/mount.h>
#include <err.h>
#include <sysexits.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
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<mntcount; i++) {
char* s;
int error;
if (argc > 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]");
}

View File

@ -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

View File

@ -0,0 +1 @@
An userland smbfs --- SMB to NFS protocols converter

View File

@ -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/

View File

@ -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