2000-01-29 06:21:39 +01:00
# New ports collection makefile for: samba
# Date created: 27 Dec 1999
# Whom: Shinya Sasaki <pcmaster@osk3.3web.ne.jp>
#
# $FreeBSD$
#
2000-04-12 16:38:12 +02:00
PORTNAME = samba
2000-08-30 06:47:06 +02:00
PORTVERSION = ${ SAMBA_VERSION } .j${ SAMBA_JA_VERSION }
2003-08-26 22:25:58 +02:00
PORTREVISION = 1
2000-01-29 06:21:39 +01:00
CATEGORIES = japanese net
2000-08-29 21:47:14 +02:00
MASTER_SITES = ftp://ftp.samba.gr.jp/pub/samba-jp/%SUBDIR%/ \
ftp://ftp.iij.ad.jp/pub/SAMBA/samba-jp/%SUBDIR%/ \
2002-05-17 22:50:54 +02:00
ftp://SunSITE.tus.ac.jp/pub/archives/packages/samba/samba-jp/%SUBDIR%/ \
2000-08-29 21:47:14 +02:00
ftp://ftp.plathome.co.jp/pub/samba/samba-jp/%SUBDIR%/ \
2002-07-08 15:53:47 +02:00
ftp://ftp2.samba.gr.jp/pub/samba-jp/%SUBDIR%/
2000-08-30 06:47:06 +02:00
MASTER_SITE_SUBDIR = ${ PORTNAME } -${ SAMBA_VERSION } -ja
DISTNAME = ${ PORTNAME } -${ SAMBA_VERSION } -ja-${ SAMBA_JA_VERSION }
2000-01-29 06:21:39 +01:00
2000-08-29 21:47:14 +02:00
MAINTAINER = nakaji@jp.FreeBSD.org
2003-02-21 13:35:09 +01:00
COMMENT = A free SMB and CIFS client and server for UNIX
2000-08-29 21:47:14 +02:00
2002-04-12 19:10:20 +02:00
BUILD_DEPENDS = msgfmt:${ PORTSDIR } /devel/gettext
2003-08-25 07:41:38 +02:00
LIB_DEPENDS = intl.5:${ PORTSDIR } /devel/gettext
2000-01-29 06:21:39 +01:00
2003-06-07 03:35:33 +02:00
SAMBA_VERSION = 2.2.8a
2003-04-09 11:56:20 +02:00
SAMBA_JA_VERSION = 1.0
2000-04-12 16:38:12 +02:00
2003-02-24 16:15:06 +01:00
USE_BZIP2 = yes
GNU_CONFIGURE = yes
2003-07-16 16:35:36 +02:00
USE_LIBTOOL = yes
2003-02-24 16:15:06 +01:00
USE_AUTOCONF = yes
USE_GMAKE = yes
USE_SUBMAKE = yes
2000-01-29 06:21:39 +01:00
# directories
2003-02-24 16:15:06 +01:00
. i f ! d e f i n e d ( B A T C H ) & & ! d e f i n e d ( P A C K A G E _ B U I L D I N G )
IS_INTERACTIVE = yes
. e n d i f
. i f e x i s t s ( $ { W R K D I R P R E F I X } $ { . C U R D I R } / M a k e f i l e . i n c )
. i n c l u d e "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
. e n d i f
AUDIT ?= "@comment "
RECYCLE ?= "@comment "
LIBSAMBA ?= "@comment "
BUILD_VFS ?= "@comment "
LDAPSAM ?= "@comment "
WINBIND ?= "@comment "
. i f d e f i n e d ( W I T H _ A U D I T )
AUDIT = ""
LIBSAMBA = ""
BUILD_VFS = ""
. e n d i f
. i f d e f i n e d ( W I T H _ R E C Y C L E )
RECYCLE = ""
LIBSAMBA = ""
BUILD_VFS = ""
. e n d i f
2000-01-29 06:21:39 +01:00
VARDIR = /var
SAMBA_SPOOL = ${ VARDIR } /spool/samba
SAMBA_LOGDIR = ${ VARDIR } /log
SAMBA_PRIVATE = ${ PREFIX } /private
SAMBA_CONFDIR = ${ PREFIX } /etc
2003-02-24 16:15:06 +01:00
SAMBA_VFSDIR = ${ PREFIX } /lib/samba
SCRIPTS_ENV = WRKDIRPREFIX = " ${ WRKDIRPREFIX } " \
TOUCH = " ${ TOUCH } " \
MKDIR = " ${ MKDIR } " \
CAT = " ${ CAT } " \
SAMBA_OPTIONS = " ${ SAMBA_OPTIONS } " \
REALCURDIR = " ${ .CURDIR } "
2000-01-29 06:21:39 +01:00
# sample files
STARTUP_SCRIPT = ${ PREFIX } /etc/rc.d/samba.sh.sample
SAMPLE_CONFIG = ${ SAMBA_CONFDIR } /smb.conf.default
2003-06-07 03:35:33 +02:00
CONFIGURE_ARGS = --with-i18n-swat \
2000-08-29 21:47:14 +02:00
--libdir= ${ SAMBA_CONFDIR } \
2000-01-29 06:21:39 +01:00
--localstatedir= ${ VARDIR } --with-swatdir= ${ PREFIX } /share/swat \
2002-01-19 12:05:29 +01:00
--with-lockdir= ${ VARDIR } /db/samba \
2002-07-15 05:09:03 +02:00
--with-logfilebase= ${ SAMBA_LOGDIR } \
2001-02-26 05:50:26 +01:00
--with-privatedir= ${ SAMBA_PRIVATE } \
2002-07-08 15:53:47 +02:00
--with-piddir= ${ VARDIR } /run \
--with-pam \
2001-02-26 05:50:26 +01:00
--prefix= ${ PREFIX }
2000-01-29 06:21:39 +01:00
2003-02-24 16:15:06 +01:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2003-06-07 03:35:33 +02:00
CONFIGURE_ENV += TESTDIR = /tmp \
CPPFLAGS = -I${ LOCALBASE } /include \
LDFLAGS = -L${ LOCALBASE } /lib
2003-02-24 16:15:06 +01:00
. i f d e f i n e d ( W I T H _ S Y S L O G )
CONFIGURE_ARGS += --with-syslog
. e n d i f
. i f d e f i n e d ( W I T H _ S S L )
CONFIGURE_ARGS += --with-ssl --with-sslinc= /usr/include/openssl --with-ssllib= /usr/lib
. e n d i f
. i f d e f i n e d ( W I T H _ Q U O T A S )
CONFIGURE_ARGS += --with-quotas
. e n d i f
. i f d e f i n e d ( W I T H _ U T M P )
CONFIGURE_ARGS += --with-utmp
. e n d i f
. i f d e f i n e d ( W I T H _ M S D F S )
CONFIGURE_ARGS += --with-msdfs
. e n d i f
. i f d e f i n e d ( W I T H _ L D A P )
2003-08-15 02:49:31 +02:00
LIB_DEPENDS += ldap.2:${ PORTSDIR } /net/openldap20-client
2003-02-24 16:15:06 +01:00
CONFIGURE_ARGS += --with-ldapsam
CONFIGURE_ENV += CPPFLAGS = -I${ LOCALBASE } /include \
LDFLAGS = -L${ LOCALBASE } /lib
LDAPSAM = ""
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ C U P S )
WITH_CUPS = yes
. e n d i f
. i f d e f i n e d ( W I T H _ W I N B I N D )
CONFIGURE_ARGS += --with-winbind
WINBIND = ""
. e n d i f
. i f d e f i n e d ( W I T H _ W I N B I N D _ A U T H _ C H A L L E N G E )
CONFIGURE_ARGS += --with-winbind-auth-challenge
. e n d i f
2003-04-09 11:56:20 +02:00
# malloc.h check is not needed.
CONFIGURE_ENV += ac_cv_header_malloc_h = no
2003-02-24 16:15:06 +01:00
pre-fetch :
@${ SETENV } ${ SCRIPTS_ENV } ${ SH } ${ SCRIPTDIR } /configure.samba
post-clean :
@${ RM } -f ${ WRKDIRPREFIX } ${ .CURDIR } /Makefile.inc
. i f d e f i n e d ( W I T H _ C U P S )
LIB_DEPENDS += cups.2:${ PORTSDIR } /print/cups-base
CONFIGURE_ENV += CPPFLAGS = -I${ LOCALBASE } /include \
LDFLAGS = -L${ LOCALBASE } /lib
. e l s e
CONFIGURE_ARGS += --disable-cups
. e n d i f
2000-01-29 06:21:39 +01:00
. i f d e f i n e d ( K R B 5 _ H O M E ) & & e x i s t s ( $ { K R B 5 _ H O M E } )
CONFIGURE_ARGS += --with-krb5= ${ KRB5_HOME }
. e n d i f
2003-02-24 16:15:06 +01:00
. i f d e f i n e d ( W I T H _ A C L _ S U P P O R T )
. i f $ { O S V E R S I O N } < 5 0 0 0 1 8
BROKEN = "ACL support requires a recent FreeBSD 5.0-CURRENT"
. e l s e
CONFIGURE_ARGS += --with-acl-support
. e n d i f
2002-07-08 15:53:47 +02:00
. e n d i f
2000-01-29 06:21:39 +01:00
WRKSRC = ${ WRKDIR } /${ DISTNAME } /source
2002-01-19 12:05:29 +01:00
MAN1 = findsmb.1 nmblookup.1 rpcclient.1 smbcacls.1 \
2002-07-08 15:53:47 +02:00
smbcontrol.1 smbstatus.1 smbclient.1 smbtar.1 \
2000-08-29 21:47:14 +02:00
testparm.1 testprns.1 make_smbcodepage.1 smbsh.1 \
2002-01-19 12:05:29 +01:00
make_unicodemap.1 wbinfo.1
2000-01-29 06:21:39 +01:00
MAN5 = smb.conf.5 smbpasswd.5 lmhosts.5
MAN7 = samba.7
2002-01-19 12:05:29 +01:00
MAN8 = smbd.8 nmbd.8 smbpasswd.8 swat.8 smbspool.8 \
2002-07-08 15:53:47 +02:00
smbmnt.8 smbmount.8 smbumount.8 winbindd.8 \
pdbedit.8
2000-08-29 21:47:14 +02:00
MANLANG = "" ja
2000-01-29 06:21:39 +01:00
2003-02-24 16:15:06 +01:00
SED_PLIST = ${ SED } -e 's!${PREFIX}!%D!g'
PLIST_SUB = AUDIT = ${ AUDIT } \
RECYCLE = ${ RECYCLE } \
LIBSAMBA = ${ LIBSAMBA } \
BUILD_VFS = ${ BUILD_VFS } \
LDAPSAM = ${ LDAPSAM } \
WINBIND = ${ WINBIND }
pre-build :
${ RM } -fr ${ WRKSRC } /include/proto.h
( cd ${ WRKSRC } && make proto)
2002-01-19 12:05:29 +01:00
post-build :
${ SED } 's:/usr/local:${PREFIX}:g' ${ FILESDIR } /samba.sh.sample \
> ${ WRKDIR } /samba.sh.sample
2003-02-24 16:15:06 +01:00
. i f d e f i n e d ( W I T H _ R E C Y C L E ) | | d e f i n e d ( W I T H _ A U D I T )
cd ${ WRKDIR } /${ DISTNAME } /examples/VFS; \
2003-07-16 16:35:36 +02:00
${ SETENV } LIBTOOL = ${ LIBTOOL } ./configure; ${ GMAKE } ; \
2003-02-24 16:15:06 +01:00
${ RM } -f config.cache config.log config.status
. e n d i f
2000-02-13 00:23:48 +01:00
2000-01-29 06:21:39 +01:00
post-install :
2003-02-24 16:15:06 +01:00
. i f d e f i n e d ( W I T H _ A U D I T ) | | d e f i n e d ( W I T H _ R E C Y C L E )
@test -d ${ SAMBA_VFSDIR } || ${ MKDIR } ${ SAMBA_VFSDIR }
. i f d e f i n e d ( W I T H _ A U D I T )
${ INSTALL_PROGRAM } ${ WRKDIR } /${ DISTNAME } /examples/VFS/audit.so ${ SAMBA_VFSDIR }
. e n d i f
. i f d e f i n e d ( W I T H _ R E C Y C L E )
${ INSTALL_PROGRAM } ${ WRKDIR } /${ DISTNAME } /examples/VFS/recycle/recycle.so ${ SAMBA_VFSDIR }
. e n d i f
. e n d i f
${ MKDIR } ${ PREFIX } /share/examples/samba
-${ RM } -f ${ WRKDIR } /${ DISTNAME } /examples/libsmbclient/*.o
${ CP } -rp ${ WRKDIR } /${ DISTNAME } /examples/* ${ PREFIX } /share/examples/samba
. i f d e f i n e d ( W I T H _ A U D I T ) | | d e f i n e d ( W I T H _ R E C Y C L E )
# @${RM} -rf ${PREFIX}/share/examples/samba/VFS/.libs
${ FIND } ${ PREFIX } /share/examples/samba/VFS -type d -name ".libs" | ${ XARGS } ${ RM } -r
@for file in audit.o audit.so recycle/recycle.o recycle/recycle.so skel.o skel.so ; do \
${ RM } ${ PREFIX } /share/examples/samba/VFS/$$ { file} ; \
done
. e n d i f
2002-01-19 12:05:29 +01:00
@${ STRIP_CMD } ${ PREFIX } /sbin/smbd ${ PREFIX } /sbin/nmbd ${ PREFIX } /sbin/swat
@${ STRIP_CMD } ${ PREFIX } /bin/smbclient ${ PREFIX } /bin/smbspool
@${ STRIP_CMD } ${ PREFIX } /bin/testparm ${ PREFIX } /bin/testprns ${ PREFIX } /bin/testprns ${ PREFIX } /bin/smbstatus ${ PREFIX } /bin/smbcontrol ${ PREFIX } /bin/make_printerdef
@${ STRIP_CMD } ${ PREFIX } /bin/smbpasswd ${ PREFIX } /bin/make_smbcodepage ${ PREFIX } /bin/rpcclient ${ PREFIX } /bin/make_unicodemap ${ PREFIX } /bin/make_nftable ${ PREFIX } /bin/smbcacls ${ PREFIX } /bin/nmblookup
@${ MKDIR } ${ PREFIX } /share/examples/samba
@cd ${ WRKDIR } /${ DISTNAME } /examples; \
2003-02-24 16:15:06 +01:00
${ TAR } --exclude .cvsignore --exclude .libs -cf - . | ${ TAR } -xf - -C ${ PREFIX } /share/examples/samba
2000-01-29 06:21:39 +01:00
@if [ ! -f ${ STARTUP_SCRIPT } ] ; then \
${ ECHO } " Installing ${ STARTUP_SCRIPT } startup file. " ; \
2002-01-19 12:05:29 +01:00
${ INSTALL_SCRIPT } ${ WRKDIR } /samba.sh.sample \
2000-01-29 06:21:39 +01:00
${ STARTUP_SCRIPT } ; \
fi
@test -d ${ SAMBA_SPOOL } || ${ MKDIR } ${ SAMBA_SPOOL } && ${ CHMOD } 1777 ${ SAMBA_SPOOL }
2002-01-19 12:05:29 +01:00
@test -d ${ VARDIR } /db/samba || ${ MKDIR } ${ VARDIR } /db/samba && ${ CHMOD } 0755 ${ VARDIR } /db/samba
2000-01-29 06:21:39 +01:00
@if [ ! -f ${ SAMPLE_CONFIG } ] ; then \
${ SED } -e 's!%%SAMBA_SPOOL%%!${SAMBA_SPOOL}!' \
-e 's!%%SAMBA_LOGDIR%%!${SAMBA_LOGDIR}!' \
-e 's!%%SAMBA_CONFDIR%%!${SAMBA_CONFDIR}!' \
${ FILESDIR } /smb.conf.default \
> ${ SAMPLE_CONFIG } ; \
fi
2002-01-19 12:05:29 +01:00
@${ INSTALL_SCRIPT } ${ WRKDIR } /${ DISTNAME } /source/script/mksmbpasswd.sh ${ PREFIX } /bin/make_smbpasswd
2001-09-01 11:10:24 +02:00
2002-03-27 17:06:37 +01:00
@${ MKDIR } -m 500 ${ SAMBA_PRIVATE }
2002-01-19 12:05:29 +01:00
@${ CHOWN } root:wheel ${ SAMBA_PRIVATE }
2002-03-27 17:06:37 +01:00
@${ CAT } /etc/passwd | ${ AWK } -F: '$$6 ~ /home/' | ${ PREFIX } /bin/make_smbpasswd > ${ SAMBA_PRIVATE } /smbpasswd.sample
@test -f ${ SAMBA_PRIVATE } /smbpasswd || ${ TOUCH } ${ SAMBA_PRIVATE } /smbpasswd
@${ CHMOD } 600 ${ SAMBA_PRIVATE } /smbpasswd.sample ${ SAMBA_PRIVATE } /smbpasswd
2001-09-01 11:10:24 +02:00
2002-01-19 12:05:29 +01:00
@${ CHOWN } root:wheel ${ PREFIX } /bin/smbpasswd
@${ CHMOD } 111 ${ PREFIX } /bin/smbpasswd
2003-02-24 16:15:06 +01:00
${ ECHO_CMD } " @exec ${ TEST } -d ${ SAMBA_SPOOL } || ${ MKDIR } ${ SAMBA_SPOOL } && ${ CHMOD } 1777 ${ SAMBA_SPOOL } " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @unexec ${ RM } -rf ${ SAMBA_SPOOL } " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @exec ${ MKDIR } -m 500 ${ SAMBA_PRIVATE } " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @exec ${ CHOWN } root:wheel ${ SAMBA_PRIVATE } " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @exec ${ CAT } /etc/passwd | ${ GREP } -v " ^#" | ${ PREFIX } /bin/make_smbpasswd > ${ SAMBA_PRIVATE } /smbpasswd.default " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @exec ${ TEST } -e ${ SAMBA_PRIVATE } /smbpasswd || ${ CP } -p ${ SAMBA_PRIVATE } /smbpasswd.default ${ SAMBA_PRIVATE } /smbpasswd " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @exec ${ CHMOD } 600 ${ SAMBA_PRIVATE } /smbpasswd* " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @unexec /usr/bin/cmp -s ${ SAMBA_PRIVATE } /smbpasswd ${ SAMBA_PRIVATE } /smbpasswd.default && ${ RM } -f ${ SAMBA_PRIVATE } /smbpasswd ${ SAMBA_PRIVATE } /secrets.tdb || ${ TRUE } " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @unexec ${ RM } -f ${ SAMBA_PRIVATE } /smbpasswd.default " | ${ SED_PLIST } >> ${ TMPPLIST }
${ ECHO_CMD } " @unexec ${ RMDIR } ${ SAMBA_PRIVATE } || ( ${ ECHO_CMD } \"Warning: If you will *NOT* use this package anymore,\" && ${ ECHO_CMD } \" please remove ${ SAMBA_PRIVATE } and its contents manually.\") " | ${ SED_PLIST } >> ${ TMPPLIST }
2000-01-29 06:21:39 +01:00
. i f ! d e f i n e d ( N O P O R T D O C S )
2002-01-19 12:05:29 +01:00
@${ MKDIR } ${ PREFIX } /share/doc/samba
@${ INSTALL_DATA } ${ FILESDIR } /README.FreeBSD ${ PREFIX } /share/doc/samba
@for i in ${ WRKDIR } /${ DISTNAME } /README \
2000-01-29 06:21:39 +01:00
${ WRKDIR } /${ DISTNAME } /COPYING \
${ WRKDIR } /${ DISTNAME } /Manifest \
${ WRKDIR } /${ DISTNAME } /Read-Manifest-Now \
${ WRKDIR } /${ DISTNAME } /Roadmap \
2002-01-19 12:05:29 +01:00
${ WRKDIR } /${ DISTNAME } /WHATSNEW.txt; do \
2000-01-29 06:21:39 +01:00
${ INSTALL_DATA } $$ i ${ PREFIX } /share/doc/samba ; \
done
2002-01-19 12:05:29 +01:00
@cd ${ WRKDIR } /${ DISTNAME } /docs; \
${ TAR } --exclude .cvsignore -cf - . | ${ TAR } -xf - -C ${ PREFIX } /share/doc/samba
@${ INSTALL_DATA } ${ WRKDIR } /${ DISTNAME } /swat/README ${ PREFIX } /share/doc/samba/README.swat
2000-01-29 06:21:39 +01:00
. e n d i f
2002-01-19 12:05:29 +01:00
@if [ -f ${ VARDIR } /spool/lock/browse.dat ] ; then \
${ RM } -f ${ VARDIR } /spool/lock/browse.dat; \
fi
2003-02-24 16:15:06 +01:00
@${ CAT } ${ PKGMESSAGE }
2002-01-19 12:05:29 +01:00
2003-02-24 16:15:06 +01:00
. i n c l u d e < b s d . p o r t . p o s t . m k >