summaryrefslogtreecommitdiff
path: root/net/samba20/Makefile
blob: bf6652dcdcac52b2bd43057d73b799bb0b29ad76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# $NetBSD: Makefile,v 1.13 2003/07/13 13:52:59 wiz Exp $

DISTNAME=		samba-2.0.10
PKGREVISION=				1
WRKSRC=			${WRKDIR}/${DISTNAME}/source
CATEGORIES=		net
MASTER_SITES=		ftp://ftp.samba.org/pub/samba/old-versions/ \
			ftp://samba.anu.edu.au/pub/samba/old-versions/ \
			ftp://de.samba.org/samba.org/

MAINTAINER=		jlam@netbsd.org
HOMEPAGE=		http://www.samba.org/
COMMENT=		SMB/CIFS protocol server suite for UNIX

BUILD_USES_MSGFMT=	yes
GNU_CONFIGURE=		yes
USE_BUILDLINK2=		yes
USE_PKGINSTALL=		yes

.include "../../mk/bsd.prefs.mk"

PKG_SYSCONFSUBDIR?=	samba

SAMBA_LOGDIR?=		/var/log
SAMBA_LOCKDIR?=		/var/run/samba
SAMBA_ETCDIR?=		${PKG_SYSCONFDIR}
SAMBA_PRIVATE?=		${SAMBA_ETCDIR}/private
SAMBA_DATADIR=		${PREFIX}/share

MAKE_ENV+=		CONFIGDIR=${SAMBA_ETCDIR}

CONFIGURE_ARGS+=	--localstatedir=${SAMBA_LOGDIR}
CONFIGURE_ARGS+=	--with-lockdir=${SAMBA_LOCKDIR}
CONFIGURE_ARGS+=	--with-privatedir=${SAMBA_PRIVATE}
CONFIGURE_ARGS+=	--with-swatdir=${PREFIX}/share/swat
CONFIGURE_ARGS+=	--with-sambabook=${PREFIX}/share/swat/using_samba

CONFIGURE_ARGS+=	--with-ssl
CONFIGURE_ARGS+=	--with-sslinc=${SSLBASE}
CFLAGS+=		-I${SSLBASE}/include/openssl      # ssl.h, err.h

.if defined(USE_CUPS) && (${USE_CUPS} == "YES")
.include "../../print/cups/buildlink2.mk"
BUILD_DEFS+=		USE_CUPS
.endif

.if defined(USE_PAM)
.include "../../security/PAM/buildlink2.mk"
CONFIGURE_ARGS+=	--with-pam
.endif

# The following are Linux-only options.
CONFIGURE_ARGS+=	--without-smbwrapper
CONFIGURE_ARGS+=	--without-smbmount

DOCDIR=			${PREFIX}/share/doc/samba
HTMLDIR=		${PREFIX}/share/doc/html/samba
EXAMPLESDIR=		${PREFIX}/share/examples/samba

FILES_SUBST=		SAMBA_PRIVATE=${SAMBA_PRIVATE}
FILES_SUBST+=		SAMBA_LOCKDIR=${SAMBA_LOCKDIR}
FILES_SUBST+=		SAMBA_LOGDIR=${SAMBA_LOGDIR}
FILES_SUBST+=		SAMBA_ETCDIR=${SAMBA_ETCDIR}
MESSAGE_SUBST+=		ETCDIR=${SAMBA_ETCDIR}

CONF_FILES=		${EXAMPLESDIR}/smb.conf.sample ${SAMBA_ETCDIR}/smb.conf
RCD_SCRIPTS=		samba nmbd smbd
MAKE_DIRS=		${SAMBA_LOCKDIR}
OWN_DIRS=		${SAMBA_ETCDIR} ${SAMBA_PRIVATE}

post-install:
	# Install Samba documentation.
	${INSTALL_DATA_DIR} ${DOCDIR} ${HTMLDIR}
	cd ${WRKDIR}/${DISTNAME}/docs;					\
		${INSTALL_DATA} announce *.reg textdocs/* ${DOCDIR};	\
		${INSTALL_DATA} faq/*.html ${HTMLDIR}

	# Install Samba examples.
	${INSTALL_DATA_DIR} ${EXAMPLESDIR}
	${CP} -R ${WRKDIR}/${DISTNAME}/examples/* ${EXAMPLESDIR}
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${EXAMPLESDIR}
	${CHMOD} -R ugo-w ${EXAMPLESDIR}

	${MV} ${PREFIX}/bin/convert_smbpasswd ${PREFIX}/sbin/convert_smbpasswd
	${INSTALL_SCRIPT} ${WRKSRC}/script/mksmbpasswd.sh		\
		${PREFIX}/sbin/mksmbpasswd

	${SED} ${FILES_SUBST_SED}					\
		${FILESDIR}/smb.conf.sample > ${WRKDIR}/smb.conf.sample
	${INSTALL_DATA} ${WRKDIR}/smb.conf.sample ${EXAMPLESDIR}

.include "../../devel/gettext-lib/buildlink2.mk"
.include "../../devel/readline/buildlink2.mk"
.include "../../security/openssl/buildlink2.mk"

.include "../../mk/bsd.pkg.mk"