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.

476 lines
16 KiB

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