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