p7zip: assorted fixes
[oi-userland.git] / components / network / samba / Makefile
blobead5b13a059f7a6c491973df520c0ad40bf316fc
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2019 Rouven Weiler
25 # Copyright 2023,2024 Friedrich Kink
28 BUILD_BITS = 64
29 BUILD_STYLE = waf
30 include ../../../make-rules/shared-macros.mk
32 COMPONENT_NAME = samba
33 COMPONENT_VERSION = 4.21.1
34 COMPONENT_SUMMARY = samba - A Windows SMB/CIFS fileserver for UNIX
35 COMPONENT_SRC = $(COMPONENT_NAME)-$(COMPONENT_VERSION)
36 COMPONENT_PROJECT_URL = https://www.samba.org/
37 COMPONENT_ARCHIVE = $(COMPONENT_SRC).tar.gz
38 COMPONENT_ARCHIVE_HASH = sha256:bd02f55da538358c929505b21fdd8aeba53027eab14c849432a53ed0bae1c7c2
39 COMPONENT_ARCHIVE_URL = https://download.samba.org/pub/samba/stable/$(COMPONENT_ARCHIVE)
40 #COMPONENT_SIG_URL = https://download.samba.org/pub/samba/stable/$(COMPONENT_SRC).tar.asc
41 COMPONENT_FMRI = service/network/samba
42 COMPONENT_CLASSIFICATION = System/File System
43 COMPONENT_LICENSE = GPLv3
44 COMPONENT_LICENSE_FILE = COPYING
46 TEST_TARGET= $(NO_TESTS)
47 include $(WS_MAKE_RULES)/common.mk
49 PYV = $(shell echo $(PYTHON_VERSION) | tr -d .)
50 PKG_MACROS += PYV=$(PYV)
51 PKG_MACROS += PYVER=$(PYTHON_VERSION)
53 # set WAF and adapt PATH for building
54 WAF = PYTHONHASHSEED=1 $(PYTHON) $(SOURCE_DIR)/buildtools/bin/waf
56 # directory to search for "include" in samba.p5m
57 PKG_OPTIONS += -I$(COMPONENT_DIR)
58 # Set the pkg... path to search files in ./Solaris/ dir (mainly the SMF manifests are there)
59 PKG_PROTO_DIRS += $(COMPONENT_DIR)
61 CFLAGS += -std=c17 -D_POSIX_PTHREAD_SEMANTICS -DHAVE_AUXV_T -DHCRYPTO_DEF_PROVIDER=hcrypto -DHAVE_FREEBSD_SUNACL_H -DACE_INHERITED_ACE
62 CPPFLAGS += $(CPP_LARGEFILES) $(CPP_XPG6MODE)
63 CPPFLAGS += -I/usr/include/openldap -I/usr/include/jansson
65 LDFLAGS += -R/usr/lib/samba
66 LDFLAGS += -R/usr/lib/samba/private
67 LDFLAGS += -L$(GNULIB.$(BITS)) -R$(GNULIB.$(BITS))
69 LDFLAGS += -lrt -lsec -lcrypt -lmd5 -lsocket -lnsl -lsendfile
70 LDFLAGS += -lldap-2.6 -lsendfile -lavahi-common -lavahi-core
72 # Flag is not picked up for lib/replace
73 LDFLAGS += $(LD_SSP)
75 LD_OPTIONS += -B direct
77 # to avoid a clash with system gssapi.h (some declaration are not compatible)
78 COMPONENT_POST_CONFIGURE_ACTION= ( \
79 $(RM) $(@D)/third_party/heimdal/lib/gssapi/gssapi.h; \
80 $(GSED) -i -e 's:/usr/lib/amd64:/usr/lib:' $(@D)/bin/c4che/default_cache.py; \
81 );
83 # set everything for target configure.
85 CONFIGURE_PREFIX = /usr/lib/samba
87 CONFIGURE_ENV += CPP="$(CC) -E"
88 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
89 CONFIGURE_ENV += CUPS_CONFIG=$(USRBINDIR)/cups-config
90 CONFIGURE_ENV += PATH=$(GNUBIN.$(BITS)):$(USRBINDIR.$(BITS)):$(PATH.gnu)
91 CONFIGURE_ENV += PYTHONARCHDIR=$(PYTHON_VENDOR_PACKAGES)/samba
93 # --enable-fhs should not be on
94 CONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX)
95 CONFIGURE_OPTIONS += --exec-prefix=$(CONFIGURE_PREFIX)
96 CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_PREFIX)/bin
97 CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_PREFIX)/sbin
98 CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_PREFIX)
99 CONFIGURE_OPTIONS += --with-privatelibdir=$(CONFIGURE_PREFIX)/private
100 CONFIGURE_OPTIONS += --sysconfdir=$(ETCDIR)/samba
101 CONFIGURE_OPTIONS += --with-pammodulesdir=$(CONFIGURE_PREFIX)/security
102 CONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)
103 CONFIGURE_OPTIONS += --mandir=$(USRSHAREMANDIR)
104 CONFIGURE_OPTIONS += --htmldir=/usr/share/samba/swat/help
105 CONFIGURE_OPTIONS += --includedir=$(USRINCDIR)/samba
106 CONFIGURE_OPTIONS += --with-privatedir=$(ETCDIR)/samba/private
107 CONFIGURE_OPTIONS += --localstatedir=$(VARDIR)/samba
108 CONFIGURE_OPTIONS += --with-logfilebase=$(VARDIR)/samba/log
109 CONFIGURE_OPTIONS += --sharedstatedir=$(VARDIR)/samba/com
110 CONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/libexec
111 CONFIGURE_OPTIONS += --with-bind-dns-dir=$(CONFIGURE_PREFIX)/bind-dns
113 CONFIGURE_OPTIONS += --with-static-modules=vfs_solarisacl
114 CONFIGURE_OPTIONS += --with-shared-modules=ALL,vfs_cacheprime,vfs_zfsacl,vfs_nfs4acl_xattr,vfs_acl_common
115 CONFIGURE_OPTIONS += --with-acl-support
116 CONFIGURE_OPTIONS += --with-ads
117 CONFIGURE_OPTIONS += --with-winbind
118 CONFIGURE_OPTIONS += --with-ldap
119 CONFIGURE_OPTIONS += --enable-cups
120 CONFIGURE_OPTIONS += --without-systemd
122 CONFIGURE_OPTIONS += --python=$(PYTHON)
123 CONFIGURE_OPTIONS += --nopyo
124 CONFIGURE_OPTIONS += --nopycache
125 CONFIGURE_OPTIONS += --disable-rpath
126 CONFIGURE_OPTIONS += --bundled-libraries=ALL
128 CONFIGURE_OPTIONS += --disable-spotlight
131 # set everything for target build.
133 COMPONENT_POST_INSTALL_ACTION += \
134 $(MKDIR) $(PROTO_DIR)$(ETCDIR)/samba ; \
135 (sed -f $(COMPONENT_DIR)/Solaris/smbconf.sed \
136 > $(PROTO_DIR)$(ETCDIR)/samba/smb.conf.default $(BUILD_DIR_64)/examples/smb.conf.default)
138 # Build dependencies
139 REQUIRED_PACKAGES += runtime/perl
140 REQUIRED_PACKAGES += library/perl-5/parse-yapp
141 REQUIRED_PACKAGES += library/python/dnspython
142 REQUIRED_PACKAGES += library/python/markdown
144 # Auto-generated dependencies
145 PYTHON_REQUIRED_PACKAGES += runtime/python
146 REQUIRED_PACKAGES += $(ICU_LIBRARY_PKG)
147 REQUIRED_PACKAGES += $(READLINE_PKG)
148 REQUIRED_PACKAGES += SUNWcs
149 REQUIRED_PACKAGES += database/lmdb
150 REQUIRED_PACKAGES += library/file-monitor/gamin
151 REQUIRED_PACKAGES += library/gnutls-3
152 REQUIRED_PACKAGES += library/jansson
153 REQUIRED_PACKAGES += library/libarchive
154 REQUIRED_PACKAGES += library/ncurses
155 REQUIRED_PACKAGES += library/openldap
156 REQUIRED_PACKAGES += library/print/cups-libs
157 REQUIRED_PACKAGES += library/security/gpgme
158 REQUIRED_PACKAGES += library/zlib
159 REQUIRED_PACKAGES += shell/ksh93
160 REQUIRED_PACKAGES += system/library
161 REQUIRED_PACKAGES += system/network/avahi