264N/A#
264N/A# CDDL HEADER START
264N/A#
264N/A# The contents of this file are subject to the terms of the
264N/A# Common Development and Distribution License (the "License").
264N/A# You may not use this file except in compliance with the License.
264N/A#
264N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
264N/A# or http://www.opensolaris.org/os/licensing.
264N/A# See the License for the specific language governing permissions
264N/A# and limitations under the License.
264N/A#
264N/A# When distributing Covered Code, include this CDDL HEADER in each
264N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
264N/A# If applicable, add the following below this CDDL HEADER, with the
264N/A# fields enclosed by brackets "[]" replaced with your own identifying
264N/A# information: Portions Copyright [yyyy] [name of copyright owner]
264N/A#
264N/A# CDDL HEADER END
264N/A#
264N/A
264N/A#
5396N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
264N/A#
814N/A
5220N/Ainclude ../../make-rules/shared-macros.mk
5135N/A
4431N/A# Samba does not work properly on i386 when built by studio with -xO3+.
4431N/Aifeq ($(MACH), sparc)
6094N/AWAFOPT1 = -j64
3817N/Aelse
4431N/A# Both SPRO_VROOT and studio_OPT vars must use the override keyword otherwise
4431N/A# Userland will ignore it and use its default value.
4431N/A# To use the older 12.3 compiler instead of the default 12.4 compiler uncomment
4431N/A# the following line.
4431N/A#override SPRO_VROOT = $(SPRO_ROOT)/solarisstudio12.3
4431N/Aoverride studio_OPT = -xO1
3817N/Aendif
3817N/A
6094N/A# parfait seems to spin on us
6094N/Aexport PARFAIT_BUILD=no
6094N/A
264N/ACOMPONENT_NAME= samba
6475N/ACOMPONENT_VERSION= 4.4.5
6475N/ATPNO= 30123
6475N/ACOMPONENT_ARCHIVE_HASH= sha256:b876ef2e63f66265490e80a122e66ef2d7616112b839df68f56ac2e1ce17a7bd
264N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
264N/ACOMPONENT_PROJECT_URL= http://www.samba.org/
264N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
5396N/ACOMPONENT_ARCHIVE_URL= https://download.samba.org/pub/samba/stable/$(COMPONENT_ARCHIVE)
1258N/ACOMPONENT_BUGDB= utility/samba
264N/A
3817N/Ainclude $(WS_MAKE_RULES)/prep.mk
264N/A
4431N/A# waf
4431N/AWAF_PATH = PATH=$(BUILD_DIR)/samba/buildtools/bin:$(PROTO_DIR)/usr/bin:$$PATH
4431N/A# Verbosed waf produces unreadable output if parallelized.
4431N/A# Uncomment to enable verbose build.
4431N/A#override WAFOPT1 = -v -j1
264N/A
4431N/A# Set build dirs for Samba + Winbind / Winbind (without Samba).
4431N/ABUILD_DIR_SMB = $(BUILD_DIR)/samba
4431N/ABUILD_DIR_WINB = $(BUILD_DIR)/winbind
4431N/A
5174N/A# Depends on S12-only libraries from Desktop to build.
5174N/Aifeq ($(BUILD_TYPE), evaluation)
5174N/APUBLISH_STAMP=
5174N/Aendif
3817N/Ainclude $(WS_MAKE_RULES)/ips.mk
264N/A
4431N/A# directory to search for "include" in samba.p5m
264N/APKG_OPTIONS += -I $(COMPONENT_DIR)
6094N/A# Set the pkg... path to search files in ./Solaris/ dir (mainly the SMF manifests are there)
6094N/APKG_PROTO_DIRS += $(COMPONENT_DIR)
264N/A
4431N/A# Oracle HSM is not supported on 12.0 yet but the libsam.so target should rather be commented out than removed
5135N/A#$(PROTO_DIR)/opt/SUNWsamfs/lib/$(MACH64)/libsam.so: Solaris/libsam.c
4431N/A# $(MKDIR) $(@D)
5135N/A# $(CC.studio.64) -m64 -G $(studio_PIC) -hlibsam.so Solaris/libsam.c \
4431N/A# -I$(COMPONENT_DIR)/Solaris/include \
4431N/A# -o $@
4375N/A
4431N/A# Compiler settings
4431N/ACFLAGS.studio += $(studio_C99_ENABLE)
264N/A
4431N/ALIBS += -lrt -lsec -lcrypt -lmd5 -lsocket -lnsl
5135N/A# More libs needed by smbd (libavahi, libgamin, ...)
5135N/ALIBS4SMBD = -lsendfile -lavahi-common -lavahi-core
264N/A
972N/A#CPPFLAGS += -DSAMBA_VERSION_VENDOR_SUFFIX=\\\"Placeholder_for_vendor_suffix\\\"
446N/ACPPFLAGS += $(CPP_LARGEFILES)
446N/ACPPFLAGS += $(CPP_XPG6MODE)
4431N/ACPPFLAGS += -I/usr/include/openldap
264N/A
7243N/A# Enable adiheap and adistack security extensions
7243N/AADIHEAP_MODE = $(ADIHEAP_ENABLE)
7243N/AADISTACK_MODE = $(ADISTACK_ENABLE)
7243N/A
5135N/ALDFLAGS += -m$(BITS)
5135N/ALDFLAGS += -R/usr/lib/samba$(MACHLIBDIR)
5135N/ALDFLAGS += -R/usr/lib/samba/private$(MACHLIBDIR)
5135N/ALDFLAGS += $(LIBS)
5135N/A$(BUILD_DIR_SMB)/.configured: LDFLAGS += $(LIBS4SMBD)
264N/A
5680N/ALD_OPTIONS += $(LD_B_DIRECT)
264N/A
4431N/A# --enable-fhs should not be on
4431N/ACONFIGURE_OPTIONS = --exec-prefix=/usr
4431N/ACONFIGURE_OPTIONS += --bindir=/usr/lib/samba/bin
4431N/ACONFIGURE_OPTIONS += --sbindir=/usr/lib/samba/sbin
5135N/ACONFIGURE_OPTIONS += --libdir=/usr/lib/samba$(MACHLIBDIR)
7243N/A
5135N/ACONFIGURE_OPTIONS += --with-privatelibdir=/usr/lib/samba/private$(MACHLIBDIR)
795N/ACONFIGURE_OPTIONS += --sysconfdir=/etc/samba
5135N/ACONFIGURE_OPTIONS += --with-pammodulesdir=/usr/lib/samba/security$(MACHLIBDIR)
4431N/ACONFIGURE_OPTIONS += --datarootdir=/usr/lib/samba
4431N/ACONFIGURE_OPTIONS += --mandir=/usr/share/man
4431N/ACONFIGURE_OPTIONS += --htmldir=/usr/share/samba/swat/help
4431N/ACONFIGURE_OPTIONS += --includedir=/usr/include/samba
795N/ACONFIGURE_OPTIONS += --with-privatedir=/etc/samba/private
795N/ACONFIGURE_OPTIONS += --localstatedir=/var/samba
795N/ACONFIGURE_OPTIONS += --with-logfilebase=/var/samba/log
4431N/ACONFIGURE_OPTIONS += --sharedstatedir=/var/samba/com
4431N/ACONFIGURE_OPTIONS += --libexecdir=/usr/lib/samba
6094N/A# Whenever getfacl is found HAVE_SOLARIS_UNIXWARE_ACLS is set and
6094N/A# vfs_solarisacl is placed into the list of the static modules
4431N/ACONFIGURE_OPTIONS += --with-static-modules=
5135N/A$(BUILD_DIR_SMB)/.configured: CONFIGURE_OPTIONS += \
6094N/A --with-shared-modules=vfs_worm,vfs_zfsacl,vfs_prealloc,vfs_cacheprime,vfs_commit,idmap_ldap,idmap_tdb2,idmap_rid,idmap_ad,idmap_hash,idmap_adex
5135N/A$(BUILD_DIR_WINB)/.configured: CONFIGURE_OPTIONS += \
5135N/A --with-shared-modules=idmap_ldap,idmap_tdb2,idmap_rid,idmap_ad,idmap_hash,idmap_adex
795N/ACONFIGURE_OPTIONS += --with-ads
4431N/ACONFIGURE_OPTIONS += --with-winbind
4375N/ACONFIGURE_OPTIONS += --with-ldap
4431N/ACONFIGURE_OPTIONS += --with-libldap=ldap_r
4431N/ACONFIGURE_OPTIONS += --with-system-mitkrb5
4431N/ACONFIGURE_OPTIONS += --without-ad-dc
4431N/A
4431N/ACONFIGURE_OPTIONS += --nocache
4431N/ACONFIGURE_OPTIONS += --nopyo
4431N/ACONFIGURE_OPTIONS += --disable-rpath
4431N/ACONFIGURE_OPTIONS += --disable-gnutls
4431N/ACONFIGURE_OPTIONS += --bundled-libraries=ALL
4431N/A
5135N/A#$(BUILD_DIR_SMB)/.configured: CONFIGURE_OPTIONS += --with-samfs=$(PROTO_DIR)/opt/SUNWsamfs/lib
4369N/A
4431N/ACONFIGURE_ENV += CC="$(CC)"
4431N/ACONFIGURE_ENV += CPP="$(CC) -E"
4431N/ACONFIGURE_ENV += AWK=gawk
5795N/ACONFIGURE_ENV += PERL=$(PERL)
4431N/ACONFIGURE_ENV += PYTHONDIR="$(PYTHON_VENDOR_PACKAGES)"
4431N/ACONFIGURE_ENV += PYTHONARCHDIR="$(PYTHON_VENDOR_PACKAGES)/samba"
4431N/ACONFIGURE_ENV += LD="$(LD)"
4431N/ACONFIGURE_ENV += CFLAGS="$(CFLAGS)"
5135N/ACONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS) -I$(PROTO_DIR)/usr/include -I$(COMPONENT_DIR)/Solaris/include"
5135N/ACONFIGURE_ENV += LINKFLAGS="$(LD_OPTIONS) $(LDFLAGS)"
4431N/ACONFIGURE_ENV.64 += MACH64="$(MACH64)"
4431N/ACONFIGURE_ENV += LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)"
4431N/ACONFIGURE_ENV += CUPS_CONFIG=$(USRBINDIR)/cups-config
6094N/ACONFIGURE_ENV += INSTALL="$(INSTALL)"
4369N/A
4431N/A# Propagation of smb.conf with default settings.
4431N/A$(PROTO_DIR)/etc/samba/smb.conf-example: $(BUILD_DIR_SMB)/.built
4431N/A $(MKDIR) $(@D)
4431N/A sed -f $(COMPONENT_DIR)/Solaris/smbconf.sed > $@ \
4431N/A $(BUILD_DIR_SMB)/examples/smb.conf.default
4431N/A
4431N/A# Build targets for WAF:
4431N/A# (motivation) Samba started to use WAF (build system from Google) from the 3.x
4431N/A# (as a parallel build system) but Samba4 discontinued the use of auto tools
4431N/A# definitively.
4431N/A# (note) .BDprep target is an additional step between .prep and .configure
4431N/A# targets. It was added because there were problems with libtool-like phase of
4431N/A# WAF when the not "prepared well". "waf distclean" on CLONEY'ed BUILD_DIR is
4431N/A# enough.
4431N/A
4431N/A# Prepare build dir for Samba + Winbind.
6094N/A$(BUILD_DIR_SMB)/.BDprep: $(SOURCE_DIR)/.prep
4431N/A # re-create configure dir
4431N/A $(MKDIR) $(@D)
4431N/A # Clone SOURCE_DIR
4431N/A $(CLONEY) $(SOURCE_DIR) $(@D)
4431N/A # clenup of clone
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) waf distclean $(WAFOPT1) )
4375N/A $(TOUCH) $@
795N/A
4431N/A# Configure of Samba + Winbind.
6094N/A$(BUILD_DIR_SMB)/.configured: $(BUILD_DIR_SMB)/.BDprep
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) $(CONFIGURE_ENV) $(CONFIGURE_ENV.$(BITS)) \
5135N/A waf configure $(WAFOPT1) $(CONFIGURE_OPTIONS) $(CONFIGURE_OPTIONS.$(BITS)) )
4431N/A $(TOUCH) $@
4431N/A
5174N/A# Depends on S12-only libraries from Desktop to build.
5174N/Aifeq ($(BUILD_TYPE), evaluation)
5174N/A$(BUILD_DIR_SMB)/.built:
5174N/A$(BUILD_DIR_SMB)/.installed:
5174N/A$(BUILD_DIR_WINB)/.built:
5174N/A$(BUILD_DIR_WINB)/.installed:
5174N/APUBLISH_STAMP=
5174N/Aelse
5174N/A
4431N/A# Build of Samba + Winbind.
4431N/A$(BUILD_DIR_SMB)/.built: $(BUILD_DIR_SMB)/.configured
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" waf build $(WAFOPT1) )
4431N/A $(TOUCH) $@
4369N/A
4431N/A# Install of Samba + Winbind.
4431N/A$(BUILD_DIR_SMB)/.installed: $(BUILD_DIR_SMB)/.built
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" waf install $(WAFOPT1) --destdir=$(PROTO_DIR) )
4431N/A $(PYTHON) -m compileall $(PROTO_DIR)/$(PYTHON_VENDOR_PACKAGES)/
4431N/A $(TOUCH) $@
264N/A
4431N/A# Prepare build dir for Winbind (without Samba) for different bitness.
6094N/A$(BUILD_DIR_WINB)/.BDprep: $(SOURCE_DIR)/.prep
4431N/A # re-create configure dir
4431N/A $(MKDIR) $(@D)
4431N/A # Clone SOURCE_DIR
4431N/A $(CLONEY) $(SOURCE_DIR) $(@D)
4431N/A # clenup of clone
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) waf distclean $(WAFOPT1) )
4375N/A $(TOUCH) $@
4375N/A
4431N/A# Configure of Winbind (without Samba) for different bitness.
6094N/A$(BUILD_DIR_WINB)/.configured: $(BUILD_DIR_WINB)/.BDprep
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) $(CONFIGURE_ENV) $(CONFIGURE_ENV.$(BITS)) \
5135N/A waf configure $(WAFOPT1) $(CONFIGURE_OPTIONS) $(CONFIGURE_OPTIONS.$(BITS)) )
4431N/A $(TOUCH) $@
4431N/A
4431N/A# Build of Winbind (without Samba) for different bitness.
6094N/AWB_TARGETS = --targets=nss_winbind,pamwinbind
4431N/A$(BUILD_DIR_WINB)/.built: $(BUILD_DIR_WINB)/.configured
6610N/A (cd $(@D) ; $(ENV) - $(WAF_PATH) LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)" waf build $(WAFOPT1) \
4431N/A $(WB_TARGETS) )
4431N/A $(TOUCH) $@
2063N/A
4431N/A# Installf Winbind (without Samba) for different bitness.
4431N/A$(BUILD_DIR_WINB)/.installed: $(BUILD_DIR_WINB)/.built
5135N/A /bin/sh -c "cd $(@D) ; \
5135N/A $(INSTALL) -d $(PROTO_DIR)/usr/lib/samba$(MACHLIBDIR) ; \
5135N/A $(INSTALL) -m 0555 -t $(PROTO_DIR)/usr/lib/samba$(MACHLIBDIR) bin/shared/!(pam_*).so* ; \
5135N/A $(INSTALL) -d $(PROTO_DIR)/usr/lib/samba/security$(MACHLIBDIR) ; \
5135N/A $(INSTALL) -m 0555 -t $(PROTO_DIR)/usr/lib/samba/security$(MACHLIBDIR) bin/shared/pam_*.so* ; \
5135N/A $(INSTALL) -d $(PROTO_DIR)/usr/lib/samba/private$(MACHLIBDIR) ; \
5135N/A $(INSTALL) -m 0555 -t $(PROTO_DIR)/usr/lib/samba/private$(MACHLIBDIR) bin/shared/private/*.so* \
5135N/A "
4431N/A $(TOUCH) $@
5174N/Aendif
4431N/A
4431N/A# Set appropriate bitnesses for Samba + Winbind / Winbind (without Samba).
5135N/A$(BUILD_DIR_SMB)/.configured: BITS=64
5135N/A$(BUILD_DIR_SMB)/.configured: MACHLIBDIR=/$(MACH64)
5135N/A$(BUILD_DIR_WINB)/.configured: BITS=32
5135N/A$(BUILD_DIR_WINB)/.configured $(BUILD_DIR_WINB)/.installed: MACHLIBDIR=
264N/A
264N/A# common targets
4431N/Abuild: $(BUILD_DIR_SMB)/.built $(BUILD_DIR_WINB)/.built
3477N/A
4431N/Ainclude $(WS_MAKE_RULES)/shared-targets.mk
4375N/A
4431N/Ainstall: $(BUILD_DIR_SMB)/.installed $(BUILD_DIR_WINB)/.installed
6094N/A # set version of python interpreter for pkglint
6094N/A find $(PROTO_DIR) -name \*.py -print0 | \
6094N/A while IFS= read -r -d $$'\0' file; do \
6094N/A /usr/bin/sed -e '1,1s&^#!.*python[:blank:]\{0,\}$$&#!$(PYTHON.$(PYTHON_VERSION))&' \
6094N/A $$file > $$file.pyverset ; \
6094N/A done
6094N/A find $(PROTO_DIR) -name \*.py.pyverset -print0 | \
6094N/A while IFS= read -r -d $$'\0' file; do \
6094N/A $(MV) $$file `echo $$file | sed -e 's/[.]pyverset$$//'` ; \
6094N/A done
264N/A
264N/Atest: $(NO_TESTS)
264N/A
4337N/Asystem-test: $(NO_TESTS)
4337N/A
264N/Aclean::
4431N/A $(RM) -r $(BUILD_DIR)
4431N/A
3817N/AREQUIRED_PACKAGES += library/file-monitor/gamin
6094N/AREQUIRED_PACKAGES += library/libarchive
3817N/AREQUIRED_PACKAGES += library/print/cups-libs
5795N/AREQUIRED_PACKAGES += $(PERL_PKG)
4431N/AREQUIRED_PACKAGES += runtime/python-27
6094N/AREQUIRED_PACKAGES += security/kerberos-5
3817N/AREQUIRED_PACKAGES += shell/ksh93
3817N/AREQUIRED_PACKAGES += system/core-os
3817N/AREQUIRED_PACKAGES += system/library
6094N/AREQUIRED_PACKAGES += system/library/libdbus
3817N/AREQUIRED_PACKAGES += system/library/security/crypto
3817N/AREQUIRED_PACKAGES += system/network
3817N/AREQUIRED_PACKAGES += system/network/avahi
6021N/AREQUIRED_PACKAGES += system/network/ldap/openldap