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.

113 lines
3.1 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=smbd-tools
  3. PKG_VERSION:=3.0.1
  4. PKG_RELEASE:=1
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://github.com/cifsd-team/$(PKG_NAME)/archive/$(PKG_VERSION)/
  7. PKG_HASH:=29f85de8b39608d28ec406c8b557264e004f5dce9b307a37f8324508cdea6217
  8. PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
  9. PKG_LICENSE:=GPL-2.0-or-later
  10. PKG_LICENSE_FILES:=COPYING
  11. PKG_FIXUP:=autoreconf
  12. PKG_INSTALL:=1
  13. PKG_BUILD_PARALLEL:=1
  14. PKG_REMOVE_FILES:=autogen.sh
  15. PKG_BUILD_DEPENDS:=glib2
  16. include $(INCLUDE_DIR)/package.mk
  17. include $(INCLUDE_DIR)/nls.mk
  18. define Package/smbd-tools/Default
  19. SECTION:=net
  20. CATEGORY:=Network
  21. SUBMENU:=Filesystem
  22. TITLE:=Kernel SMB
  23. URL:=https://github.com/cifsd-team/smbd-tools
  24. DEPENDS:= +glib2 $(ICONV_DEPENDS) $(INTL_DEPENDS)
  25. endef
  26. define Package/smbd-tools/Default/description
  27. Userspace tools for the SMB kernel fileserver (smbd.ko).
  28. The config file location is /etc/smbd/smb.conf
  29. endef
  30. define Package/smbd-server
  31. $(call Package/smbd-tools/Default)
  32. TITLE+= server
  33. DEPENDS+= +kmod-fs-smbd +libnl-core +libnl-genl
  34. endef
  35. define Package/smbd-server/description
  36. installs: usmbd
  37. This provides the basic fileserver service and is the minimum needed to serve 'guest only' file shares or use a existing smbdpwd.db.
  38. endef
  39. define Package/smbd-server/config
  40. select PACKAGE_wsdd2
  41. endef
  42. define Package/smbd-utils
  43. $(call Package/smbd-tools/Default)
  44. TITLE+= user management-util
  45. endef
  46. define Package/smbd-utils/description
  47. installs: smbuseradd (smbshareadd)
  48. Tool needed to create the smbdpwd.db, to manage per user share passwords.
  49. NOTE: Not needed for 'guest only' shares.
  50. endef
  51. define Package/smbd-utils/config
  52. config SMBD_UTILS_SHAREADD
  53. bool "Add smbshareadd util"
  54. depends on PACKAGE_smbd-utils
  55. help
  56. Add the smbshareadd tool, to directly manipulate the /etc/smbd/smb.conf.
  57. default n
  58. endef
  59. CONFIGURE_ARGS += \
  60. --disable-shared \
  61. --enable-static
  62. # CONFIGURE_VARS += GLIB_LIBS="$(STAGING_DIR)/usr/lib/libglib-2.0.a"
  63. TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
  64. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -liconv $(if $(INTL_FULL),-lintl)
  65. define Package/smbd-server/install
  66. $(INSTALL_DIR) $(1)/usr/sbin
  67. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/usmbd $(1)/usr/sbin/
  68. $(INSTALL_DIR) $(1)/etc/config $(1)/etc/smbd $(1)/etc/init.d
  69. $(INSTALL_CONF) ./files/smbd.config $(1)/etc/config/smbd
  70. $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/smbd/
  71. $(INSTALL_BIN) ./files/smbd.init $(1)/etc/init.d/smbd
  72. # copy examples until we have a wiki page
  73. $(INSTALL_DATA) ./files/smbd.config.example $(1)/etc/smbd/
  74. $(INSTALL_DATA) $(PKG_BUILD_DIR)/Documentation/configuration.txt $(1)/etc/smbd/
  75. endef
  76. define Package/smbd-utils/install
  77. $(INSTALL_DIR) $(1)/usr/sbin
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smbuseradd $(1)/usr/sbin/
  79. ifeq ($(CONFIG_SMBD_UTILS_SHAREADD),y)
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smbshareadd $(1)/usr/sbin/
  81. endif
  82. endef
  83. define Package/smbd-server/conffiles
  84. /etc/config/smbd
  85. /etc/smbd/smb.conf.template
  86. /etc/smbd/smb.conf
  87. /etc/smbd/smbdpwd.db
  88. endef
  89. $(eval $(call BuildPackage,smbd-server))
  90. $(eval $(call BuildPackage,smbd-utils))