You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

478 lines
17 KiB

  1. # Based partially on (wongsyrone/hbl0307106015) versions
  2. include $(TOPDIR)/rules.mk
  3. PKG_NAME:=samba
  4. PKG_VERSION:=4.9.11
  5. PKG_RELEASE:=3
  6. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  7. PKG_SOURCE_URL:=https://ftp.heanet.ie/mirrors/ftp.samba.org/stable/ \
  8. https://ftp.gwdg.de/pub/samba/stable/ \
  9. https://ftp.riken.jp/net/samba/samba/stable/ \
  10. http://www.nic.funet.fi/index/samba/pub/samba/stable/ \
  11. http://samba.mirror.bit.nl/samba/ftp/stable/ \
  12. https://download.samba.org/pub/samba/stable/
  13. PKG_HASH:=bb736624d16f7369e395de2f15fec153b554f76f95864015b4ce1f2ae53e817b
  14. PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
  15. PKG_LICENSE:=GPL-3.0-only
  16. PKG_LICENSE_FILES:=COPYING
  17. # samba4=(asn1_compile) e2fsprogs=(compile_et) nfs-kernel-server=(rpcgen)
  18. HOST_BUILD_DEPENDS:=python/host nfs-kernel-server/host e2fsprogs/host
  19. PKG_BUILD_DEPENDS:=samba4/host
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_SAMBA4_SERVER_NETBIOS \
  22. CONFIG_SAMBA4_SERVER_AVAHI \
  23. CONFIG_SAMBA4_SERVER_VFS \
  24. CONFIG_SAMBA4_SERVER_VFSX \
  25. CONFIG_SAMBA4_SERVER_QUOTAS \
  26. CONFIG_SAMBA4_SERVER_ACL \
  27. CONFIG_SAMBA4_SERVER_AD_DC \
  28. CONFIG_SAMBA4_SERVER_WINBIND \
  29. CONFIG_PACKAGE_kmod-fs-btrfs \
  30. CONFIG_PACKAGE_kmod-fs-xfs
  31. include $(INCLUDE_DIR)/package.mk
  32. include $(INCLUDE_DIR)/host-build.mk
  33. include $(INCLUDE_DIR)/kernel.mk
  34. include $(INCLUDE_DIR)/version.mk
  35. define Package/samba4/Default
  36. SECTION:=net
  37. CATEGORY:=Network
  38. TITLE:=Samba $(PKG_VERSION)
  39. URL:=https://www.samba.org/
  40. endef
  41. define Package/samba4/Default/description
  42. The Samba software suite is a collection of programs that implements the
  43. SMB/CIFS protocol for UNIX systems, allowing you to serve files and printers.
  44. Samba 4 implements up-to protocol version SMB v3.1.1 (Win10), supports mDNS via AVAHI and a AD-DC setup via krb5.
  45. NOTE: No cluster and printer support.
  46. endef
  47. define Package/samba4-libs
  48. $(call Package/samba4/Default)
  49. TITLE+= libs
  50. DEPENDS:= +zlib +libtirpc +libpopt +libcomerr +libreadline \
  51. +PACKAGE_libcap:libcap +PACKAGE_libpthread:libpthread +PACKAGE_libnettle:libnettle \
  52. +PACKAGE_libgcrypt:libgcrypt +PACKAGE_libpam:libpam +PACKAGE_dbus:dbus +PACKAGE_libavahi-client:libavahi-client \
  53. +SAMBA4_SERVER_VFS:attr \
  54. +SAMBA4_SERVER_ACL:acl +SAMBA4_SERVER_ACL:attr \
  55. +SAMBA4_SERVER_AVAHI:libavahi-client \
  56. +SAMBA4_SERVER_AD_DC:python-base +SAMBA4_SERVER_AD_DC:python-crypto +SAMBA4_SERVER_AD_DC:libopenssl +SAMBA4_SERVER_AD_DC:libgnutls +SAMBA4_SERVER_AD_DC:libopenldap +SAMBA4_SERVER_AD_DC:jansson +SAMBA4_SERVER_AD_DC:libarchive
  57. endef
  58. define Package/samba4-server
  59. $(call Package/samba4/Default)
  60. TITLE+= server
  61. DEPENDS:= +samba4-libs
  62. endef
  63. define Package/samba4-server/description
  64. installs: smbd, nmbd (daemon) smbpasswd pdbedit testparm
  65. This provides the basic fileserver service and is the minimum needed to serve file shares.
  66. HINT: https://fitzcarraldoblog.wordpress.com/2016/10/17/a-correct-method-of-configuring-samba-for-browsing-smb-shares-in-a-home-network/
  67. endef
  68. # BUG: We cant add DEPENDS:= +SAMBA4_SERVER_AD_DC:python-crypto, so this only happens here via select!
  69. define Package/samba4-server/config
  70. select PACKAGE_wsdd2
  71. source "$(SOURCE)/Config.in"
  72. endef
  73. define Package/samba4-client
  74. $(call Package/samba4/Default)
  75. TITLE+= client
  76. DEPENDS:= +samba4-libs
  77. endef
  78. define Package/samba4-client/description
  79. installs: smbclient cifsdd
  80. The smbclient program implements a simple ftp-like client for accessing SMB shares
  81. endef
  82. define Package/samba4-admin
  83. $(call Package/samba4/Default)
  84. TITLE+= admin tools
  85. DEPENDS:= +samba4-libs
  86. endef
  87. define Package/samba4-admin/description
  88. installs: net smbcontrol profiles rpcclient smbcacls smbcquotas
  89. Administration tools collection
  90. endef
  91. define Package/samba4-utils
  92. $(call Package/samba4/Default)
  93. TITLE+= utils
  94. DEPENDS:= +samba4-libs
  95. endef
  96. define Package/samba4-utils/description
  97. installs: smbstatus smbtree smbget nmblookup mvxattr
  98. Utilities collection
  99. endef
  100. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  101. TARGET_LDFLAGS += -Wl,--gc-sections
  102. CONFIGURE_VARS += \
  103. CPP="$(TARGET_CROSS)cpp"
  104. CONFIGURE_CMD = ./buildtools/bin/waf
  105. HOST_CONFIGURE_CMD = ./buildtools/bin/waf
  106. # Strip options that WAF configure script does not recognize
  107. CONFIGURE_ARGS:=$(filter-out \
  108. --target=% \
  109. --host=% \
  110. --build=% \
  111. --program-prefix=% \
  112. --program-suffix=% \
  113. --disable-nls \
  114. --disable-ipv6 \
  115. , $(CONFIGURE_ARGS))
  116. HOST_CONFIGURE_ARGS:=$(filter-out \
  117. --target=% \
  118. --host=% \
  119. --build=% \
  120. --program-prefix=% \
  121. --program-suffix=% \
  122. --disable-nls \
  123. --disable-ipv6 \
  124. , $(HOST_CONFIGURE_ARGS))
  125. # Waf needs the "configure" argument
  126. CONFIGURE_ARGS:=configure $(CONFIGURE_ARGS)
  127. HOST_CONFIGURE_ARGS:=configure $(HOST_CONFIGURE_ARGS)
  128. CONFIGURE_ARGS += \
  129. --hostcc="$(HOSTCC)" \
  130. --cross-compile \
  131. --cross-answers=cross-answers.txt \
  132. --disable-cups \
  133. --disable-iprint \
  134. --disable-cephfs \
  135. --disable-fault-handling \
  136. --disable-glusterfs \
  137. --disable-rpath \
  138. --disable-rpath-install \
  139. --disable-rpath-private-install \
  140. --enable-fhs \
  141. --without-automount \
  142. --without-iconv \
  143. --without-lttng \
  144. --without-ntvfs-fileserver \
  145. --without-pam \
  146. --without-systemd \
  147. --without-utmp \
  148. --without-dmapi \
  149. --without-fam \
  150. --without-gettext \
  151. --without-regedit \
  152. --without-gpgme
  153. HOST_CONFIGURE_ARGS += \
  154. --hostcc="$(HOSTCC)" \
  155. --disable-cups \
  156. --disable-iprint \
  157. --disable-cephfs \
  158. --disable-fault-handling \
  159. --disable-glusterfs \
  160. --disable-rpath \
  161. --disable-rpath-install \
  162. --disable-rpath-private-install \
  163. --enable-fhs \
  164. --without-automount \
  165. --without-iconv \
  166. --without-lttng \
  167. --without-ntvfs-fileserver \
  168. --without-pam \
  169. --without-systemd \
  170. --without-utmp \
  171. --without-dmapi \
  172. --without-fam \
  173. --without-gettext \
  174. --without-regedit \
  175. --without-gpgme
  176. HOST_CONFIGURE_ARGS += --disable-avahi --without-quotas --without-acl-support --without-winbind \
  177. --without-ad-dc --without-json-audit --without-libarchive --disable-python --nopyc --nopyo \
  178. --disable-gnutls --without-dnsupdate --without-ads --without-ldap
  179. HOST_CONFIGURE_VARS += python_LDFLAGS="" python_LIBDIR=""
  180. # Optional AES-NI support - https://lists.samba.org/archive/samba-technical/2017-September/122738.html
  181. # Support for Nettle wasn't comitted
  182. ifdef CONFIG_TARGET_x86_64
  183. CONFIGURE_ARGS += --accel-aes=intelaesni
  184. else
  185. CONFIGURE_ARGS += --accel-aes=none
  186. endif
  187. CONFIGURE_ARGS += \
  188. --with-lockdir=/var/lock \
  189. --with-logfilebase=/var/log \
  190. --with-piddir=/var/run \
  191. --with-privatedir=/etc/samba
  192. ifeq ($(CONFIG_SAMBA4_SERVER_AVAHI),y)
  193. CONFIGURE_ARGS += --enable-avahi
  194. else
  195. CONFIGURE_ARGS += --disable-avahi
  196. endif
  197. ifeq ($(CONFIG_SAMBA4_SERVER_QUOTAS),y)
  198. CONFIGURE_ARGS += --with-quotas
  199. else
  200. CONFIGURE_ARGS += --without-quotas
  201. endif
  202. ifeq ($(CONFIG_SAMBA4_SERVER_ACL),y)
  203. CONFIGURE_ARGS += --with-acl-support
  204. else
  205. CONFIGURE_ARGS += --without-acl-support
  206. endif
  207. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  208. CONFIGURE_ARGS += --enable-gnutls --with-dnsupdate --with-ads --with-ldap
  209. TARGET_CFLAGS := -I$(STAGING_DIR)/usr/include/python2.7 $(TARGET_CFLAGS)
  210. else
  211. CONFIGURE_ARGS += --without-ad-dc --without-json-audit --without-libarchive --disable-python --nopyc --nopyo \
  212. --disable-gnutls --without-dnsupdate --without-ads --without-ldap
  213. CONFIGURE_VARS += \
  214. python_LDFLAGS="" \
  215. python_LIBDIR=""
  216. endif
  217. ifeq ($(CONFIG_SAMBA4_SERVER_WINBIND),y)
  218. CONFIGURE_ARGS += --with-winbind
  219. else
  220. CONFIGURE_ARGS += --without-winbind
  221. endif
  222. SAMBA4_IDMAP_MODULES :=
  223. SAMBA4_IDMAP_MODULES_SHARED :=
  224. SAMBA4_PDB_MODULES :=pdb_smbpasswd,pdb_tdbsam,
  225. SAMBA4_AUTH_MODULES :=auth_builtin,auth_sam,auth_unix,auth_script,
  226. SAMBA4_VFS_MODULES :=vfs_default,
  227. SAMBA4_VFS_MODULES_SHARED :=
  228. ifeq ($(CONFIG_SAMBA4_SERVER_VFS),y)
  229. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_fruit,vfs_shadow_copy2,vfs_recycle,vfs_fake_perms,vfs_readonly,vfs_cap,vfs_offline,vfs_crossrename,vfs_catia,vfs_streams_xattr,vfs_xattr_tdb,
  230. ifeq ($(CONFIG_PACKAGE_kmod-fs-btrfs),y)
  231. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_btrfs,
  232. endif
  233. endif
  234. ifeq ($(CONFIG_SAMBA4_SERVER_VFSX),y)
  235. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_virusfilter,vfs_shell_snap,vfs_commit,vfs_worm,vfs_aio_fork,vfs_aio_pthread,vfs_netatalk,vfs_dirsort,vfs_fileid,
  236. ifeq ($(CONFIG_PACKAGE_kmod-fs-xfs),y)
  237. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_linux_xfs_sgid,
  238. endif
  239. endif
  240. ifeq ($(CONFIG_SAMBA4_SERVER_QUOTAS),y)
  241. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_default_quota,
  242. endif
  243. ifeq ($(CONFIG_SAMBA4_SERVER_ACL),y)
  244. SAMBA4_VFS_MODULES :=$(SAMBA4_VFS_MODULES)vfs_posixacl,
  245. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_acl_xattr,vfs_acl_tdb,
  246. # vfs_zfsacl needs https://github.com/zfsonlinux/zfs/tree/master/include/sys/zfs_acl.h
  247. # vfs_nfs4acl_xattr needs https://github.com/notriddle/libdrpc/blob/master/rpc/xdr.h
  248. endif
  249. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  250. SAMBA4_PDB_MODULES :=$(SAMBA4_PDB_MODULES)pdb_samba_dsdb,pdb_ldapsam,
  251. SAMBA4_AUTH_MODULES :=$(SAMBA4_AUTH_MODULES)auth_samba4,
  252. SAMBA4_VFS_MODULES_SHARED :=$(SAMBA4_VFS_MODULES_SHARED)vfs_audit,vfs_extd_audit,vfs_full_audit,
  253. endif
  254. ifeq ($(CONFIG_SAMBA4_SERVER_WINBIND),y)
  255. SAMBA4_IDMAP_MODULES :=$(SAMBA4_IDMAP_MODULES)idmap_tdb,idmap_passdb,idmap_nss,nss_info_template,
  256. SAMBA4_IDMAP_MODULES_SHARED :=$(SAMBA4_IDMAP_MODULES_SHARED)idmap_autorid,idmap_rid,idmap_hash,idmap_tdb2,idmap_script,
  257. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  258. SAMBA4_IDMAP_MODULES_SHARED :=$(SAMBA4_IDMAP_MODULES_SHARED)idmap_ad,idmap_ldap,idmap_rfc2307,
  259. # idmap_ad needs --with-ads
  260. # idmap_rfc2307 needs ldap headers
  261. endif
  262. SAMBA4_AUTH_MODULES :=$(SAMBA4_AUTH_MODULES)auth_winbind,
  263. endif
  264. SAMBA4_MODULES :=${SAMBA4_VFS_MODULES}${SAMBA4_AUTH_MODULES}${SAMBA4_PDB_MODULES}${SAMBA4_IDMAP_MODULES}
  265. SAMBA4_MODULES_SHARDED :=${SAMBA4_VFS_MODULES_SHARED}${SAMBA4_IDMAP_MODULES_SHARED}
  266. CONFIGURE_ARGS += \
  267. --with-static-modules=$(SAMBA4_MODULES)!DEFAULT,!FORCED \
  268. --with-shared-modules=$(SAMBA4_MODULES_SHARDED)!DEFAULT,!FORCED
  269. HOST_CONFIGURE_ARGS += \
  270. --with-static-modules=!DEFAULT,!FORCED \
  271. --with-shared-modules=!DEFAULT,!FORCED
  272. # Setup build/install targets
  273. # CONFIG_PACKAGE_samba4-server
  274. BUILD_TARGETS_SERVER :=smbd/smbd,smbpasswd,pdbedit,testparm
  275. # Optional server targets
  276. ifeq ($(CONFIG_SAMBA4_SERVER_ACL),y)
  277. BUILD_TARGETS_SERVER :=$(BUILD_TARGETS_SERVER),sharesec
  278. endif
  279. ifeq ($(CONFIG_SAMBA4_SERVER_NETBIOS),y)
  280. BUILD_TARGETS_SERVER :=$(BUILD_TARGETS_SERVER),nmbd
  281. endif
  282. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  283. BUILD_TARGETS_SERVER :=$(BUILD_TARGETS_SERVER),samba,nsstest,ntlm_auth,samba4kinit,samba4kgetcred,samba4kpasswd,samba4ktutil
  284. endif
  285. ifeq ($(CONFIG_SAMBA4_SERVER_WINBIND),y)
  286. BUILD_TARGETS_SERVER :=$(BUILD_TARGETS_SERVER),winbindd,wbinfo,winbind_krb5_locator
  287. endif
  288. # CONFIG_PACKAGE_samba4-client
  289. BUILD_TARGETS_CLIENT :=client/smbclient,client/cifsdd
  290. # CONFIG_PACKAGE_samba4-admin
  291. BUILD_TARGETS_ADMIN :=net,smbcontrol,profiles,rpcclient,smbcacls,smbcquotas,eventlogadm
  292. # CONFIG_PACKAGE_samba4-utils
  293. BUILD_TARGETS_UTILS :=smbstatus,smbtree,smbget,mvxattr,nmblookup
  294. # lib bundling
  295. # NOTE: bundle + make private, we want to avoid version configuration (build, link) conflicts
  296. CONFIGURE_ARGS += --builtin-libraries=talloc,tevent,tevent-util,texpect,tdb,ldb,tdr,cmocka
  297. HOST_CONFIGURE_ARGS += --builtin-libraries=replace --nonshared-binary=asn1_compile
  298. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  299. CONFIGURE_ARGS += --bundled-libraries=talloc,tevent,tevent-util,texpect,tdb,ldb,tdr,cmocka,replace,pytalloc-util,pyldb-util,roken,wind,hx509,asn1,heimbase,hcrypto,krb5,gssapi,heimntlm,hdb,kdc,NONE
  300. else
  301. CONFIGURE_ARGS += --bundled-libraries=talloc,tevent,tevent-util,texpect,tdb,ldb,tdr,cmocka,replace,roken,wind,hx509,asn1,heimbase,hcrypto,krb5,gssapi,heimntlm,hdb,kdc,NONE
  302. endif
  303. # BUG: --private-libraries, Does not work for System possible libs, will not get "samba4" suffix!
  304. CONFIGURE_ARGS += --private-libraries=talloc,tevent,tevent-util,texpect,tdb,ldb,tdr,cmocka,replace
  305. # CONFIGURE_ARGS += --disable-symbol-versions
  306. define Host/Compile
  307. (cd $(HOST_BUILD_DIR); \
  308. ./buildtools/bin/waf build \
  309. --targets=asn1_compile \
  310. )
  311. endef
  312. define Host/Install
  313. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
  314. $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/asn1_compile $(STAGING_DIR_HOSTPKG)/bin/
  315. endef
  316. define Build/Prepare
  317. $(Build/Prepare/Default)
  318. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),)
  319. # un-bundle dnspython
  320. $(SED) '/"dns.resolver":/d' $(PKG_BUILD_DIR)/third_party/wscript
  321. # unbundle iso8601
  322. $(SED) '/"iso8601":/d' $(PKG_BUILD_DIR)/third_party/wscript
  323. endif
  324. endef
  325. define Build/Configure
  326. $(CP) ./waf-cross-answers/$(ARCH).txt $(PKG_BUILD_DIR)/cross-answers.txt
  327. echo 'Checking uname machine type: "$(ARCH)"' >> $(PKG_BUILD_DIR)/cross-answers.txt
  328. echo 'Checking uname release type: "$(LINUX_VERSION)"' >> $(PKG_BUILD_DIR)/cross-answers.txt
  329. echo 'Checking uname version type: "$(VERSION_DIST) Linux-$(LINUX_VERSION) $(shell date +%Y-%m-%d)"' >> $(PKG_BUILD_DIR)/cross-answers.txt
  330. # NOTE: For some unknown reason this answer is not needed on some hosts/distros, yet needed on others?
  331. echo 'Checking whether POSIX capabilities are available: OK' >> $(PKG_BUILD_DIR)/cross-answers.txt
  332. $(call Build/Configure/Default)
  333. endef
  334. # BUG: We need to use "waf install --targets=" otherwise a "make install" or "waf install" will retrigger a full recompile of all possible targets!
  335. define Build/Compile
  336. (cd $(PKG_BUILD_DIR); \
  337. ./buildtools/bin/waf install \
  338. --jobs=$(shell nproc) \
  339. --destdir="$(PKG_INSTALL_DIR)" \
  340. --targets=$(SAMBA4_MODULES)$(SAMBA4_MODULES_SHARDED)$(BUILD_TARGETS_SERVER),$(BUILD_TARGETS_UTILS),$(BUILD_TARGETS_ADMIN),$(BUILD_TARGETS_CLIENT) \
  341. )
  342. endef
  343. # No default install see above
  344. define Build/Install
  345. endef
  346. define Package/samba4-libs/install
  347. $(INSTALL_DIR) $(1)/usr/lib
  348. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  349. $(CP) $(PKG_INSTALL_DIR)/usr/lib/samba/*.so* $(1)/usr/lib/
  350. $(INSTALL_DIR) $(1)/usr/lib/samba/vfs $(1)/usr/lib/samba/idmap $(1)/usr/lib/samba/ldb $(1)/usr/lib/samba/krb5
  351. if [ -d $(PKG_INSTALL_DIR)/usr/lib/samba/idmap ]; then \
  352. $(CP) $(PKG_INSTALL_DIR)/usr/lib/samba/idmap $(1)/usr/lib/samba/; \
  353. fi
  354. if [ -d $(PKG_INSTALL_DIR)/usr/lib/samba/vfs ]; then \
  355. $(CP) $(PKG_INSTALL_DIR)/usr/lib/samba/vfs $(1)/usr/lib/samba/; \
  356. fi
  357. if [ -d $(PKG_INSTALL_DIR)/usr/lib/samba/krb5 ]; then \
  358. $(CP) $(PKG_INSTALL_DIR)/usr/lib/samba/krb5 $(1)/usr/lib/samba/; \
  359. fi
  360. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  361. $(INSTALL_DIR) $(1)/usr/lib/python2.7
  362. $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7 $(1)/usr/lib/
  363. endif
  364. endef
  365. define Package/samba4-client/install
  366. $(INSTALL_DIR) $(1)/usr/bin
  367. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{smbclient,cifsdd} $(1)/usr/bin/
  368. endef
  369. define Package/samba4-admin/install
  370. $(INSTALL_DIR) $(1)/usr/bin
  371. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{net,smbcontrol,profiles,rpcclient,smbcacls,smbcquotas} $(1)/usr/bin/
  372. $(INSTALL_DIR) $(1)/usr/sbin
  373. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/eventlogadm $(1)/usr/sbin/
  374. endef
  375. define Package/samba4-utils/install
  376. $(INSTALL_DIR) $(1)/usr/bin
  377. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{smbstatus,smbtree,smbget,mvxattr,nmblookup} $(1)/usr/bin/
  378. endef
  379. define Package/samba4-server/install
  380. $(INSTALL_DIR) $(1)/usr/bin
  381. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{smbpasswd,pdbedit,testparm} $(1)/usr/bin/
  382. $(INSTALL_DIR) $(1)/usr/sbin
  383. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smbd $(1)/usr/sbin/
  384. ifeq ($(CONFIG_SAMBA4_SERVER_AD_DC),y)
  385. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{samba-tool,ntlm_auth,smbtar} $(1)/usr/bin/
  386. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{samba,samba-gpupdate,samba_dnsupdate,samba_kcc,samba_spnupdate,samba_upgradedns} $(1)/usr/sbin/
  387. # waf does not install those?
  388. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/{samba4kinit,samba4kgetcred,samba4kpasswd,samba4ktutil} $(1)/usr/bin/
  389. endif
  390. ifeq ($(CONFIG_SAMBA4_SERVER_NETBIOS),y)
  391. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/nmbd $(1)/usr/sbin/
  392. endif
  393. ifeq ($(CONFIG_SAMBA4_SERVER_WINBIND),y)
  394. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wbinfo $(1)/usr/bin/
  395. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/winbindd $(1)/usr/sbin/
  396. endif
  397. ifeq ($(CONFIG_SAMBA4_SERVER_ACL),y)
  398. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sharesec $(1)/usr/bin/
  399. endif
  400. $(INSTALL_DIR) $(1)/etc/config $(1)/etc/samba $(1)/etc/init.d
  401. $(INSTALL_CONF) ./files/samba.config $(1)/etc/config/samba4
  402. $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba
  403. $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba4
  404. endef
  405. define Package/samba4-server/conffiles
  406. /etc/config/samba4
  407. /etc/samba/smb.conf.template
  408. /etc/samba/smb.conf
  409. /etc/samba/smbpasswd
  410. /etc/samba/secrets.tdb
  411. /etc/samba/passdb.tdb
  412. /etc/samba/idmap.ldb
  413. /etc/samba/lmhosts
  414. /etc/nsswitch.conf
  415. /etc/krb5.conf
  416. endef
  417. $(eval $(call HostBuild))
  418. $(eval $(call BuildPackage,samba4-libs))
  419. $(eval $(call BuildPackage,samba4-server))
  420. $(eval $(call BuildPackage,samba4-client))
  421. $(eval $(call BuildPackage,samba4-admin))
  422. $(eval $(call BuildPackage,samba4-utils))