Skip to content

Commit

Permalink
Updated packaging files (new for Caldera).
Browse files Browse the repository at this point in the history
(This used to be commit 721a257)
  • Loading branch information
John Terpstra committed Nov 16, 1998
1 parent 13d0b57 commit 7ce840a
Show file tree
Hide file tree
Showing 16 changed files with 1,089 additions and 8 deletions.
11 changes: 11 additions & 0 deletions packaging/Caldera/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Preparation Date: Mon November 16 1998
Preparer: John H Terpstra <[email protected]>

Instructions: Preparing Samba Packages for Caldera OpenLinux 1.2
==================================================================

We provide support only for current versions of Caldera OpenLinux.

To produce the RPMS simply type:
sh makerpms.sh

141 changes: 141 additions & 0 deletions packaging/Caldera/findsmb
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
#!/usr/bin/perl
#
# Prints info on all smb responding machines on a subnet.
# This script needs to be run on a machine without nmbd running and be
# run as root to get correct info from WIN95 clients.
#
# syntax:
# findsmb [subnet broadcast address]
#
# with no agrument it will list machines on the current subnet
#
# There will be a "+" in front of the workgroup name for machines that are
# local master browsers for that workgroup. There will be an "*" in front
# of the workgroup name for machines that are the domain master browser for
# that workgroup.
#

$SAMBABIN = "/usr/bin";

for ($i = 0; $i < 2; $i++) { # test for -d option and broadcast address
$_ = shift;
if (m/-d|-D/) {
$DEBUG = 1;
} else {
if ($_) {
$BCAST = "-B $_";
}
}
}

sub ipsort # do numeric sort on last field of IP address
{
@t1 = split(/\./,$a);
@t2 = split(/\./,$b);
@t1[3] <=> @t2[3];
}

# look for all machines that respond to a name lookup

open(NMBLOOKUP,"$SAMBABIN/nmblookup $BCAST '*'|") ||
die("Can't run nmblookup '*'.\n");

# get rid of all lines that are not a response IP address,
# strip everything but IP address and sort by last field in address

@ipaddrs = sort ipsort grep(s/ \*<00>.*$//,<NMBLOOKUP>);

# print header info

print "\nIP ADDR NETBIOS NAME WORKGROUP/OS/VERSION $BCAST\n";
print "---------------------------------------------------------------------\n";

foreach $ip (@ipaddrs) # loop through each IP address found
{
$ip =~ s/\n//; # strip newline from IP address

# find the netbios names registered by each machine

open(NMBLOOKUP,"$SAMBABIN/nmblookup -r -A $ip|") ||
die("Can't get nmb name list.\n");
@nmblookup = <NMBLOOKUP>;
close NMBLOOKUP;

# get the first <00> name

@name = grep(/<00>/,@nmblookup);
$_ = @name[0];
if ($_) { # we have a netbios name
if (/GROUP/) { # is it a group name
($name, $aliases, $type, $length, @addresses) =
gethostbyaddr(pack('C4',split('\.',$ip)),2);
if (! $name) { # could not get name
$name = "unknown nis name";
}
} else {
/(\S+)/;
$name = $1;
}

# do an smbclient command on the netbios name.

open(SMB,"$SAMBABIN/smbclient -N -L $name -I $ip -U% |") ||
die("Can't do smbclient command.\n");
@smb = <SMB>;
close SMB;

if ($DEBUG) { # if -d flag print results of nmblookup and smbclient
print "===============================================================\n";
print @nmblookup;
print @smb;
}

# look for the OS= string

@info = grep(/OS=/,@smb);
$_ = @info[0];
if ($_) { # we found response
s/Domain=|OS=|Server=|\n//g; # strip out descriptions to make line shorter

} else { # no OS= string in response (WIN95 client)

# for WIN95 clients get workgroup name from nmblookup response
@name = grep(/<00> - <GROUP>/,@nmblookup);
$_ = @name[0];
if ($_) {
/(\S+)/;
$_ = "[$1]";
} else {
$_ = "Unknown Workgroup";
}
}

# see if machine registered a local master browser name
if (grep(/<1d>/,@nmblookup)) {
$master = '+'; # indicate local master browser
if (grep(/<1b>/,@nmblookup)) { # how about domain master browser?
$master = '*'; # indicate domain master browser
}
} else {
$master = ' '; # not a browse master
}

# line up info in 3 columns

print "$ip".' 'x(16-length($ip))."$name".' 'x(14-length($name))."$master"."$_\n";

} else { # no netbios name found
# try getting the host name
($name, $aliases, $type, $length, @addresses) =
gethostbyaddr(pack('C4',split('\.',$ip)),2);
if (! $name) { # could not get name
$name = "unknown nis name";
}
if ($DEBUG) { # if -d flag print results of nmblookup
print "===============================================================\n";
print @nmblookup;
}
print "$ip".' 'x(16-length($ip))."$name\n";
}
}

70 changes: 70 additions & 0 deletions packaging/Caldera/makefile-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
--- samba-2.0.0/source/Makefile.in.orig Sat Aug 22 02:48:36 1998
+++ samba-2.0.0/source/Makefile.in Fri Aug 21 22:19:32 1998
***************
*** 22,32 ****
builddir=@builddir@
SHELL=/bin/sh

! BASEDIR=$(prefix)/samba
BINDIR = $(BASEDIR)/bin
! SBINDIR = $(BASEDIR)/bin
! LIBDIR = $(BASEDIR)/lib
! VARDIR = $(BASEDIR)/var
MANDIR = $(BASEDIR)/man

# The permissions to give the executables
--- 22,32 ----
builddir=@builddir@
SHELL=/bin/sh

! BASEDIR=/usr
BINDIR = $(BASEDIR)/bin
! SBINDIR = $(BASEDIR)/sbin
! LIBDIR = /etc
! VARDIR = /var
MANDIR = $(BASEDIR)/man

# The permissions to give the executables
***************
*** 35,54 ****
# set these to where to find various files
# These can be overridden by command line switches (see smbd(8))
# or in smb.conf (see smb.conf(5))
! SMBLOGFILE = $(VARDIR)/log.smb
! NMBLOGFILE = $(VARDIR)/log.nmb
CONFIGFILE = $(LIBDIR)/smb.conf
LMHOSTSFILE = $(LIBDIR)/lmhosts
DRIVERFILE = $(LIBDIR)/printers.def
PASSWD_PROGRAM = /bin/passwd
! SMB_PASSWD_FILE = $(BASEDIR)/private/smbpasswd
SMB_PASSWD_PROGRAM = $(BASEDIR)/bin/smbpasswd

# This is where SWAT images and help files go
! SWATDIR = $(BASEDIR)/swat

# the directory where lock files go
! LOCKDIR = $(VARDIR)/locks

# The directory where code page definition files go
CODEPAGEDIR = $(LIBDIR)/codepages
--- 35,54 ----
# set these to where to find various files
# These can be overridden by command line switches (see smbd(8))
# or in smb.conf (see smb.conf(5))
! SMBLOGFILE = $(VARDIR)/log/samba/log.smb
! NMBLOGFILE = $(VARDIR)/log/samba/log.nmb
CONFIGFILE = $(LIBDIR)/smb.conf
LMHOSTSFILE = $(LIBDIR)/lmhosts
DRIVERFILE = $(LIBDIR)/printers.def
PASSWD_PROGRAM = /bin/passwd
! SMB_PASSWD_FILE = $(LIBDIR)/smbpasswd
SMB_PASSWD_PROGRAM = $(BASEDIR)/bin/smbpasswd

# This is where SWAT images and help files go
! SWATDIR = $(BASEDIR)/share/swat

# the directory where lock files go
! LOCKDIR = $(VARDIR)/lock/samba

# The directory where code page definition files go
CODEPAGEDIR = $(LIBDIR)/codepages
14 changes: 14 additions & 0 deletions packaging/Caldera/makerpms.sh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
# Copyright (C) John H Terpstra 1998
#
RPMDIR=`rpm --showrc | awk '/^rpmdir/ { print $3}'`
SPECDIR=`rpm --showrc | awk '/^specdir/ { print $3}'`
SRCDIR=`rpm --showrc | awk '/^sourcedir/ { print $3}'`

( cd ../../.. ; tar czvf ${SRCDIR}/samba-PVERSION.tar.gz samba-PVERSION )
cp -a *.spec $SPECDIR
cp -a *.patch smb.* samba.log $SRCDIR
cd $SRCDIR
chown -R root.root samba-PVERSION
cd $SPECDIR
rpm -ba -v samba2.spec
11 changes: 11 additions & 0 deletions packaging/Caldera/samba.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/var/log/samba/log.nmb {
postrotate
/usr/bin/killall -HUP nmbd
endrotate
}

/var/log/samba/log.smb {
postrotate
/usr/bin/killall -HUP smbd
endrotate
}
2 changes: 2 additions & 0 deletions packaging/Caldera/samba.pamd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
auth required /lib/security/pam_pwdb.so nullok shadow
account required /lib/security/pam_pwdb.so
Loading

0 comments on commit 7ce840a

Please sign in to comment.