samba36: allow build with no ipv6 support
[openwrt/openwrt.git] / package / network / services / samba36 / Makefile
index 0762dd93071538831e2697a89d46460d7ea701aa..a4392f62c5a613860c25204258cc3748ffb81f3e 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=samba
 PKG_VERSION:=3.6.25
-PKG_RELEASE:=7
+PKG_RELEASE:=14
 
 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \
                https://download.samba.org/pub/samba/stable
@@ -18,8 +18,7 @@ PKG_HASH:=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751
 
 PKG_LICENSE:=GPL-3.0
 PKG_LICENSE_FILES:=COPYING
-
-PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_CPE_ID:=cpe:/a:samba:samba
 
 PKG_BUILD_PARALLEL:=1
 
@@ -30,27 +29,35 @@ CONFIGURE_PATH:=source3
 
 PKG_BUILD_BIN:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/bin
 
-define Package/samba36-server
+define Package/samba/Default
   SECTION:=net
   CATEGORY:=Network
-  TITLE:=Samba 3.6 SMB/CIFS server
+  TITLE:=Samba 3.6 SMB/CIFS
   URL:=https://www.samba.org/
+  MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+endef
+
+define Package/samba36-server
+  $(call Package/samba/Default)
+  TITLE+= server
   DEPENDS:=+USE_GLIBC:librt $(ICONV_DEPENDS)
 endef
 
+define Package/samba36-hotplug
+  $(call Package/samba/Default)
+  TITLE+= hotplug script for auto sharing
+  DEPENDS:=+blockd
+endef
+
 define Package/samba36-client
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Samba 3.6 SMB/CIFS client
-  URL:=https://www.samba.org/
+  $(call Package/samba/Default)
+  TITLE+= client
   DEPENDS:=+libreadline +libncurses
 endef
 
 define Package/samba36-net
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=Samba 3.6 SMB/CIFS net commands
-  URL:=https://www.samba.org/
+  $(call Package/samba/Default)
+  TITLE+= net commands
   DEPENDS:=+libreadline +libncurses
 endef
 
@@ -78,6 +85,7 @@ CONFIGURE_VARS += \
        libreplace_cv_HAVE_C99_VSNPRINTF=yes \
        libreplace_cv_HAVE_GETADDRINFO=yes \
        libreplace_cv_HAVE_IFACE_IFCONF=yes \
+       $(if $(CONFIG_IPV6),,libreplace_cv_HAVE_IPV6=no libreplace_cv_HAVE_IPV6_V6ONLY=no) \
        LINUX_LFS_SUPPORT=yes \
        samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \
        samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \
@@ -100,6 +108,9 @@ CONFIGURE_ARGS += \
        --prefix=/ \
        --disable-avahi \
        --disable-cups \
+       --disable-external-libtalloc \
+       --disable-external-libtdb \
+       --disable-external-libtevent \
        --disable-pie \
        --disable-relro \
        --disable-static \
@@ -144,7 +155,7 @@ define Package/samba36-server/install
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_CONF) ./files/samba.config $(1)/etc/config/samba
        $(INSTALL_DIR) $(1)/etc/samba
-       $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba
+       $(INSTALL_CONF) ./files/smb.conf.template $(1)/etc/samba
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/lowcase.dat $(1)/etc/samba
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/upcase.dat $(1)/etc/samba
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/codepages/valid.dat $(1)/etc/samba
@@ -157,6 +168,11 @@ define Package/samba36-server/install
        $(LN) samba_multicall $(1)/usr/sbin/smbpasswd
 endef
 
+define Package/samba36-hotplug/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/mount
+       $(INSTALL_CONF) ./files/samba.hotplug $(1)/etc/hotplug.d/mount/60-samba
+endef
+
 define Package/samba36-client/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_BIN)/smbclient $(1)/usr/sbin
@@ -170,5 +186,6 @@ endef
 
 $(eval $(call BuildPackage,samba36-client))
 $(eval $(call BuildPackage,samba36-server))
+$(eval $(call BuildPackage,samba36-hotplug))
 $(eval $(call BuildPackage,samba36-net))