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.

479 lines
17 KiB

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