perl-path-tiny: bump to version 0.061
[buildroot-gz.git] / package / samba / samba.mk
blobd25e94eba24d0cfcfe4cf4dd7609363dced95555
1 ################################################################################
3 # samba
5 ################################################################################
7 SAMBA_VERSION = 3.6.24
8 SAMBA_SITE = http://ftp.samba.org/pub/samba/stable
9 SAMBA_SUBDIR = source3
10 SAMBA_INSTALL_STAGING = YES
11 SAMBA_LICENSE = GPLv3+
12 SAMBA_LICENSE_FILES = COPYING
14 SAMBA_DEPENDENCIES = popt \
15 $(if $(BR2_PACKAGE_SAMBA_RPCCLIENT),readline) \
16 $(if $(BR2_PACKAGE_SAMBA_SMBCLIENT),readline) \
17 $(if $(BR2_PACKAGE_SAMBA_AVAHI),avahi) \
18 $(if $(BR2_PACKAGE_SAMBA_GAMIN),gamin)
20 SAMBA_CONF_ENV = \
21 ac_cv_file__proc_sys_kernel_core_pattern=yes \
22 libreplace_cv_HAVE_GETTIMEOFDAY_TZ=yes \
23 samba_cv_USE_SETREUID=yes \
24 samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes \
25 libreplace_cv_HAVE_IFACE_GETIFADDRS=yes \
26 libreplace_cv_HAVE_IFACE_IFCONF=yes \
27 libreplace_cv_HAVE_MMAP=yes \
28 samba_cv_HAVE_FCNTL_LOCK=yes \
29 libreplace_cv_HAVE_SECURE_MKSTEMP=yes \
30 samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \
31 samba_cv_fpie=no \
32 libreplace_cv_HAVE_IPV6=$(if $(BR2_INET_IPV6),yes,no) \
33 $(if $(BR2_PACKAGE_SAMBA_AVAHI),AVAHI_LIBS=-pthread)
35 SAMBA_CONF_OPTS = \
36 --with-piddir=/var/run \
37 --with-lockdir=/var/lock \
38 --with-logfilebase=/var/log \
39 --with-configdir=/etc/samba \
40 --with-privatedir=/etc/samba \
42 --disable-cups \
43 --enable-shared-libs \
44 --disable-pie \
45 --disable-relro \
46 --disable-dnssd \
48 $(if $(BR2_PACKAGE_SAMBA_AVAHI),--enable-avahi,--disable-avahi) \
49 $(if $(BR2_PACKAGE_SAMBA_GAMIN),--enable-fam,--disable-fam) \
50 $(if $(BR2_PACKAGE_SAMBA_SWAT),--enable-swat,--disable-swat) \
52 --without-cluster-support \
53 --without-dnsupdate \
54 --with-sys-quotas \
55 --without-ads \
56 --without-ldap \
57 --with-included-iniparser \
59 $(if $(BR2_PACKAGE_SAMBA_RPCCLIENT),--with-readline=$(STAGING_DIR)) \
60 $(if $(BR2_PACKAGE_SAMBA_SMBCLIENT),--with-readline=$(STAGING_DIR)) \
61 $(if $(BR2_PACKAGE_SAMBA_WINBINDD),--with-winbind,--without-winbind)
63 SAMBA_INSTALL_TARGET_OPTS = \
64 DESTDIR=$(TARGET_DIR) -C $(SAMBA_DIR)/$(SAMBA_SUBDIR) \
65 installlibs installservers installbin installscripts \
66 $(if $(BR2_PACKAGE_SAMBA_SWAT),installswat)
68 # binaries to keep
69 SAMBA_BINTARGETS_y = \
70 usr/sbin/smbd \
71 usr/lib/libtalloc.so \
72 usr/lib/libtdb.so
74 # binaries to remove
75 SAMBA_BINTARGETS_ = \
76 usr/lib/libnetapi.so* \
77 usr/lib/libsmbsharemodes.so*
79 # binaries to keep or remove
80 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_EVENTLOGADM) += usr/bin/eventlogadm
81 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_NET) += usr/bin/net
82 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_NMBD) += usr/sbin/nmbd
83 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_NMBLOOKUP) += usr/bin/nmblookup
84 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_NTLM_AUTH) += usr/bin/ntlm_auth
85 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_PDBEDIT) += usr/bin/pdbedit
86 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_PROFILES) += usr/bin/profiles
87 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_RPCCLIENT) += usr/bin/rpcclient
88 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBCACLS) += usr/bin/smbcacls
89 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBCLIENT) += usr/bin/smbclient
90 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBCONTROL) += usr/bin/smbcontrol
91 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBCQUOTAS) += usr/bin/smbcquotas
92 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBD) += usr/sbin/smbd
93 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBGET) += usr/bin/smbget
94 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBLDBTOOLS) += usr/bin/ldbadd
95 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBLDBTOOLS) += usr/bin/ldbdel
96 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBLDBTOOLS) += usr/bin/ldbedit
97 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBLDBTOOLS) += usr/bin/ldbmodify
98 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBLDBTOOLS) += usr/bin/ldbrename
99 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBLDBTOOLS) += usr/bin/ldbsearch
100 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBPASSWD) += usr/bin/smbpasswd
101 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBSHARESEC) += usr/bin/sharesec
102 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBSPOOL) += usr/bin/smbspool
103 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBSTATUS) += usr/bin/smbstatus
104 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBTA_UTIL) += usr/bin/smbta-util
105 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SMBTREE) += usr/bin/smbtree
106 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_SWAT) += usr/sbin/swat
107 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_TDB) += usr/bin/tdbbackup
108 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_TDB) += usr/bin/tdbdump
109 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_TDB) += usr/bin/tdbtool
110 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_TESTPARM) += usr/bin/testparm
111 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_WINBINDD) += usr/sbin/winbindd
112 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_WBINFO) += usr/bin/wbinfo
114 # libraries to keep or remove
115 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_WINBINDD) += usr/lib/libwbclient.so*
116 SAMBA_BINTARGETS_$(BR2_PACKAGE_SAMBA_LIBSMBCLIENT) += usr/lib/libsmbclient.so*
118 # non-binaries to remove
119 SAMBA_TXTTARGETS_ = \
120 usr/include/libsmbclient.h \
121 usr/include/netapi.h \
122 usr/include/smb_share_modes.h \
123 usr/include/talloc.h \
124 usr/include/tdb.h \
125 usr/include/wbclient.h
127 # non-binaries to keep or remove
128 SAMBA_TXTTARGETS_$(BR2_PACKAGE_SAMBA_FINDSMB) += usr/bin/findsmb
129 SAMBA_TXTTARGETS_$(BR2_PACKAGE_SAMBA_SMBTAR) += usr/bin/smbtar
131 define SAMBA_REMOVE_UNNEEDED_BINARIES
132 rm -f $(addprefix $(TARGET_DIR)/, $(SAMBA_BINTARGETS_))
133 rm -f $(addprefix $(TARGET_DIR)/, $(SAMBA_TXTTARGETS_))
134 endef
136 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_REMOVE_UNNEEDED_BINARIES
138 ifeq ($(BR2_PACKAGE_SAMBA_LIBNSS_WINS),y)
139 define SAMBA_INSTALL_LIBNSS_WINS
140 $(INSTALL) -m 0755 -D $(@D)/nsswitch/libnss_wins.so $(TARGET_DIR)/lib/libnss_wins.so.2
141 ln -snf libnss_wins.so.2 $(TARGET_DIR)/lib/libnss_wins.so
142 endef
143 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_LIBNSS_WINS
144 endif
146 ifeq ($(BR2_PACKAGE_SAMBA_LIBNSS_WINBIND),y)
147 define SAMBA_INSTALL_LIBNSS_WINBIND
148 $(INSTALL) -m 0755 -D $(@D)/nsswitch/libnss_winbind.so $(TARGET_DIR)/lib/libnss_winbind.so.2
149 ln -snf libnss_winbind.so.2 $(TARGET_DIR)/lib/libnss_winbind.so
150 endef
151 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_LIBNSS_WINBIND
152 endif
154 define SAMBA_REMOVE_SWAT_DOCUMENTATION
155 # Remove the documentation
156 rm -rf $(TARGET_DIR)/usr/swat/help/manpages
157 rm -rf $(TARGET_DIR)/usr/swat/help/Samba3*
158 rm -rf $(TARGET_DIR)/usr/swat/using_samba/
159 # Removing the welcome.html file will make swat default to
160 # welcome-no-samba-doc.html
161 rm -rf $(TARGET_DIR)/usr/swat/help/welcome.html
162 endef
164 # --with-libiconv="" is to avoid detecting host libiconv and build failure
165 ifeq ($(BR2_PACKAGE_SAMBA_LIBICONV),y)
166 SAMBA_DEPENDENCIES += libiconv
167 SAMBA_CONF_OPTS += --with-libiconv=$(STAGING_DIR)
168 else
169 SAMBA_CONF_OPTS += --with-libiconv=""
170 endif
172 # Compiled debug messages by level
173 SAMBA_CONF_OPTS += CFLAGS="$(TARGET_CFLAGS) -DMAX_DEBUG_LEVEL=$(BR2_PACKAGE_SAMBA_MAX_DEBUGLEVEL)"
175 ifeq ($(BR2_PACKAGE_SAMBA_SWAT),y)
176 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_REMOVE_SWAT_DOCUMENTATION
177 endif
179 define SAMBA_INSTALL_CONFIG
180 $(INSTALL) -m 0644 -D package/samba/simple.conf $(TARGET_DIR)/etc/samba/smb.conf
181 endef
183 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_CONFIG
185 define SAMBA_INSTALL_INIT_SYSV
186 $(INSTALL) -m 0755 -D package/samba/S91smb $(TARGET_DIR)/etc/init.d/S91smb
187 endef
189 $(eval $(autotools-package))