fritzkink
2023-06-05 d2d790f0407a3fa3957f2ed839b8828c3144e132
commit | author | age
f68008 1 #
AP 2 # CDDL HEADER START
3 #
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.
7 #
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.
12 #
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]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
f46b53 24 # Copyright 2023 Friedrich Kink. All rights reserved.
f68008 25 #
AP 26
f46b53 27 BUILD_BITS =            64_and_32
F 28 BUILD_STYLE =           waf
f68008 29
AP 30 include ../../../make-rules/shared-macros.mk
31
32 COMPONENT_NAME=        samba
d2d790 33 COMPONENT_VERSION=    4.18.3
f68008 34 COMPONENT_SRC=        $(COMPONENT_NAME)-$(COMPONENT_VERSION)
AP 35 COMPONENT_SUMMARY=    A library that permits GPLv2 applications to manipulate CIFS/SMB network resources
f46b53 36 COMPONENT_PROJECT_URL=    https://www.samba.org/
f68008 37 COMPONENT_ARCHIVE=    $(COMPONENT_SRC).tar.gz
d2d790 38 COMPONENT_ARCHIVE_HASH=    sha256:c67e1453165a3918ffffad600236ca3966b47bde4798e89ae600ae3903ccc32c
f46b53 39 COMPONENT_ARCHIVE_URL=    https://download.samba.org/pub/samba/stable/$(COMPONENT_ARCHIVE)
F 40 #COMPONENT_SIG_URL =     https://download.samba.org/pub/samba/stable/$(COMPONENT_SRC).tar.asc
2276d3 41 COMPONENT_FMRI=        library/samba/libsmbclient
f68008 42 COMPONENT_CLASSIFICATION=    System/Libraries
AP 43 COMPONENT_LICENSE=    GPLv3
44 COMPONENT_LICENSE_FILE=    COPYING
45
f46b53 46 TEST_TARGET =           $(NO_TESTS)
F 47
48 include $(WS_MAKE_RULES)/common.mk
f68008 49
AP 50 # waf
f46b53 51 WAF = PYTHONHASHSEED=1 $(PYTHON) $(SOURCE_DIR)/buildtools/bin/waf
f68008 52
AP 53 # Compiler settings
f46b53 54 CFLAGS    +=    $($(COMPILER)_C99_ENABLE) -D_POSIX_PTHREAD_SEMANTICS -DHAVE_AUXV_T -DHCRYPTO_DEF_PROVIDER=hcrypto
f68008 55
f46b53 56 LDFLAGS.32 +=    -R/usr/lib/libsmbclient
F 57 LDFLAGS.64 +=    -R/usr/lib/libsmbclient/$(MACH64)
58 LDFLAGS.32 +=    -R/usr/lib/libsmbclient/private
59 LDFLAGS.64 +=    -R/usr/lib/libsmbclient/private/$(MACH64)
60 LDFLAGS +=    $(LDFLAGS.$(BITS))
f68008 61
f46b53 62 LDFLAGS +=      -lrt -lsec -lcrypt -lmd5 -lsocket -lnsl -lsendfile
F 63 LDFLAGS +=      -lldap-2.6 -lsendfile -lavahi-common -lavahi-core
f68008 64
f46b53 65 CPPFLAGS +=    $(CPP_LARGEFILES) $(CPP_XPG6MODE)
F 66 CPPFLAGS +=    -I/usr/include/openldap -I/usr/include/jansson
67
68 # Flag is not picked up for lib/replace
69 LDFLAGS +=     $(LD_SSP)
f68008 70
AP 71 LD_OPTIONS +=     -B direct
e7cb7e 72
f46b53 73 # to avoid a clash with system gssapi.h (some declaration are not compatible)
F 74 COMPONENT_POST_CONFIGURE_ACTION= ( \
75         $(RM) $(@D)/third_party/heimdal/lib/gssapi/gssapi.h; \
76          );
77
78 CONFIGURE_PREFIX =      /usr/lib/libsmbclient
79
f68008 80 # !!! Note, this is not a configure.mk-based Makefile !!!
f46b53 81 # --enable-fhs should not be on
F 82 CONFIGURE_OPTIONS +=    --prefix=$(CONFIGURE_PREFIX)
83 CONFIGURE_OPTIONS +=    --exec-prefix=$(CONFIGURE_PREFIX)
84 CONFIGURE_OPTIONS.32 += --bindir=$(CONFIGURE_PREFIX)/bin
85 CONFIGURE_OPTIONS.64 += --bindir=$(CONFIGURE_PREFIX)/bin/$(MACH64)
86 CONFIGURE_OPTIONS.32 += --sbindir=$(CONFIGURE_PREFIX)/sbin
87 CONFIGURE_OPTIONS.64 += --sbindir=$(CONFIGURE_PREFIX)/sbin/$(MACH64)
88 CONFIGURE_OPTIONS.32 += --libdir=$(CONFIGURE_PREFIX)
89 CONFIGURE_OPTIONS.64 += --libdir=$(CONFIGURE_PREFIX)/$(MACH64)
90 CONFIGURE_OPTIONS.32 += --with-privatelibdir=$(CONFIGURE_PREFIX)/private
91 CONFIGURE_OPTIONS.64 += --with-privatelibdir=$(CONFIGURE_PREFIX)/private/$(MACH64)
92 CONFIGURE_OPTIONS +=    --sysconfdir=$(ETCDIR)/samba
93 CONFIGURE_OPTIONS.32 += --with-pammodulesdir=$(CONFIGURE_PREFIX)/security
94 CONFIGURE_OPTIONS.64 += --with-pammodulesdir=$(CONFIGURE_PREFIX)/security/$(MACH64)
95 CONFIGURE_OPTIONS +=    --datarootdir=$(CONFIGURE_PREFIX)
96 CONFIGURE_OPTIONS +=    --mandir=$(USRSHAREMANDIR)
97 CONFIGURE_OPTIONS +=    --htmldir=/usr/share/samba/swat/help
98 CONFIGURE_OPTIONS +=    --includedir=$(USRINCDIR)/libsmbclient
99 CONFIGURE_OPTIONS +=    --with-privatedir=$(ETCDIR)/samba/private
100 CONFIGURE_OPTIONS +=    --localstatedir=$(VARDIR)/samba
101 CONFIGURE_OPTIONS +=    --with-logfilebase=$(VARDIR)/samba/log
102 CONFIGURE_OPTIONS +=    --sharedstatedir=$(VARDIR)/samba/com
103 CONFIGURE_OPTIONS +=    --libexecdir=$(CONFIGURE_PREFIX)/libexec/$(MACH64)
104 CONFIGURE_OPTIONS +=    --with-bind-dns-dir=$(CONFIGURE_PREFIX)/bind-dns
105
f68008 106 CONFIGURE_OPTIONS +=    --with-static-modules=
AP 107 CONFIGURE_OPTIONS +=    --with-shared-modules=
108 CONFIGURE_OPTIONS +=    --with-ads
109 CONFIGURE_OPTIONS +=    --with-winbind
110 CONFIGURE_OPTIONS +=    --with-ldap
111 CONFIGURE_OPTIONS +=    --nopyo
112 CONFIGURE_OPTIONS +=    --disable-rpath
113 CONFIGURE_OPTIONS +=    --disable-rpath-private-install 
114 CONFIGURE_OPTIONS +=    --bundled-libraries=ALL
f46b53 115 CONFIGURE_OPTIONS +=    --disable-python
F 116 CONFIGURE_OPTIONS +=    --without-ad-dc
117 CONFIGURE_OPTIONS +=    --disable-spotlight
f68008 118
f46b53 119 CONFIGURE_ENV +=        CPP="$(CC) -E"
F 120 CONFIGURE_ENV +=        CPPFLAGS="$(CPPFLAGS)"
121 CONFIGURE_ENV +=        CUPS_CONFIG=$(USRBINDIR)/cups-config
122 CONFIGURE_ENV +=        PATH=$(GNUBIN.$(BITS)):$(USRBINDIR.$(BITS)):$(PATH.gnu)
f68008 123
AP 124 # Build targets for WAF:
125 # (motivation) Samba started to use WAF (build system from Google) from the 3.x
126 # (as a parallel build system) but Samba4 discontinued the use of auto tools
127 # definitively.
128 # (note) .BDprep target is an additional step between .prep and .configure
129 # targets. It was added because there were problems with libtool-like phase of
130 # WAF when the not "prepared well". "waf distclean" on CLONEY'ed BUILD_DIR is
131 # enough.
132
133 # Prepare build dir for Samba
134 $(BUILD_DIR_32)/.BDprep:    $(SOURCE_DIR)/.prep
135     # re-create configure dir
136     $(MKDIR) $(@D)
137     # Clone SOURCE_DIR
138     $(CLONEY) $(SOURCE_DIR) $(@D)
f46b53 139     # cleanup of clone
F 140     (cd $(@D) ; $(ENV) $(WAF) distclean )
f68008 141     $(TOUCH) $@
AP 142
143 # Configure of Samba
144 $(BUILD_DIR_32)/.configured:    $(BUILD_DIR_32)/.BDprep
f46b53 145     (cd $(@D) ; $(ENV) $(CONFIGURE_ENV) \
F 146         $(CONFIGURE_ENV.32) $(WAF) configure $(CONFIGURE_OPTIONS) $(CONFIGURE_OPTIONS.32) )
f68008 147     $(TOUCH) $@
AP 148
149 # Build of Samba + Winbind.
150 $(BUILD_DIR_32)/.built:    $(BUILD_DIR_32)/.configured
f46b53 151     (cd $(@D) ; \
F 152         $(GSED) -i -e 's:/usr/lib/amd64:/usr/lib:' bin/c4che/default_cache.py; \
153      $(ENV) $(WAF) build --targets=smbclient)
f68008 154     $(TOUCH) $@
AP 155
156 # Install of Samba + Winbind.
157 $(BUILD_DIR_32)/.installed:    $(BUILD_DIR_32)/.built
f46b53 158     (cd $(@D) ; $(ENV) $(WAF) install --targets=smbclient --destdir=$(PROTO_DIR) )
f68008 159     $(TOUCH) $@
AP 160
161 $(BUILD_DIR)/.pc.fixed:    $(INSTALL_32)
162     $(GSED) -i -e '/^Libs/s:-L$${libdir}:-L$${libdir} -R$${libdir}:' $(PROTO_DIR)/usr/lib/libsmbclient/pkgconfig/*.pc
163     $(TOUCH) $@
164
165 # common targets
166 install:    $(INSTALL_32) $(BUILD_DIR)/.pc.fixed
167
27685a 168 # manually added packages
F 169 PERL_REQUIRED_PACKAGES +=library/perl-5/json
170
f46b53 171 # Auto-generated dependencies
F 172 REQUIRED_PACKAGES += library/file-monitor/gamin
e7cb7e 173 REQUIRED_PACKAGES += library/gnutls-3
f46b53 174 REQUIRED_PACKAGES += library/icu
F 175 REQUIRED_PACKAGES += library/jansson
f68008 176 REQUIRED_PACKAGES += library/openldap
AP 177 REQUIRED_PACKAGES += library/print/cups-libs
f46b53 178 REQUIRED_PACKAGES += library/zlib
f68008 179 REQUIRED_PACKAGES += system/library
f46b53 180 REQUIRED_PACKAGES += system/network/avahi