2 # Copyright (C) 2008-2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
13 PKG_MD5SUM:=11ed2bfef4090bd5736b194b43f67289
15 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/samba/old-versions/
16 PKG_SOURCE:=samba-$(PKG_VERSION).tar.gz
17 PKG_BUILD_DIR:=$(BUILD_DIR)/samba-$(PKG_VERSION)
20 include $(INCLUDE_DIR)/package.mk
21 include $(INCLUDE_DIR)/nls.mk
23 define Package/samba3/Default
27 URL:=http://www.samba.org/
31 $(call Package/samba3/Default)
32 TITLE:=SMB server for file and printer sharing
33 DEPENDS:=+libpthread +libpopt $(ICONV_DEPENDS)
36 define Package/samba3-nmbd
37 $(call Package/samba3/Default)
38 TITLE:=NetBIOS name server
42 define Package/samba3-mountcifs
43 $(call Package/samba3/Default)
46 TITLE:=Mount utility for samba shares
49 define Package/samba3/description
50 SMB server for file and printer sharing
51 Also contains a SMB password utility (smbpasswd)
53 Made small with patches taken from AVM GPL releases and freetz
56 define Package/samba3-nmbd/description
59 Made small with patches taken from AVM GPL releases and freetz
62 define Package/samba3-mountcifs/description
63 An user space helper utility for mounting remote CIFS shares.
66 define Package/samba3/conffiles
68 /etc/samba/smb.conf.template
71 define Package/samba3/config
72 source "$(SOURCE)/Config.in"
75 TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_CONFIG_DEBUG),-DSAMBA_DEBUG,-DMAX_DEBUG_LEVEL=2)
76 TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_CONFIG_SMALLER),-DAVM_SMALLER)
77 TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_CONFIG_PRINTING),,-DAVM_NO_PRINTING)
78 CONFIGURE_PATH:=source
80 $(if $(CONFIG_SAMBA3_CONFIG_DEBUG),--enable-debug) \
81 $(if $(CONFIG_SAMBA3_CONFIG_PRINTING),,--enable-cups=no --enable-iprint=no) \
86 --with-configdir=/etc/samba \
87 --with-libiconv=$(ICONV_PREFIX) \
88 --with-privatedir=/etc/samba
90 # Make sure we tell the configure script that we support negative enum values and want to use setresuid
92 SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \
93 samba_cv_USE_SETEUID=no \
94 samba_cv_have_setresuid=yes \
95 samba_cv_USE_SETRESUID=yes \
96 samba_cv_HAVE_C99_VSNPRINTF=yes \
97 samba_cv_have_longlong=yes \
98 ac_cv_type_long_long=yes \
102 $(if $(CONFIG_SAMBA3_CONFIG_PRINTING),,OWRT_NO_PRINTING=1) \
103 $(if $(CONFIG_SAMBA3_CONFIG_SMALLER),OWRT_SMALLER=1)
106 # Ugly fix for parallel building (without this some generated files will be missing upon clean build)
107 $(call Build/Compile/Default, proto_exists)
108 $(call Build/Compile/Default, \
109 $(if $(CONFIG_PACKAGE_samba3),bin/smbd bin/smbpasswd) \
110 $(if $(CONFIG_PACKAGE_samba3-nmbd),bin/nmbd) \
111 $(if $(CONFIG_PACKAGE_samba3-mountcifs),bin/mount.cifs bin/umount.cifs) \
115 define Package/samba3/install
116 $(INSTALL_DIR) $(1)/etc/{samba,init.d,config}
117 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
118 $(INSTALL_DATA) ./files/samba.config $(1)/etc/config/samba
119 $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba/
120 touch $(1)/etc/samba/smbpasswd
121 $(INSTALL_DIR) $(1)/usr/sbin
122 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd $(1)/usr/sbin/
123 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd $(1)/usr/sbin/
126 define Package/samba3-nmbd/install
127 $(INSTALL_DIR) $(1)/etc/init.d
128 $(INSTALL_BIN) ./files/samba-nmbd.init $(1)/etc/init.d/samba-nmbd
129 $(INSTALL_DIR) $(1)/usr/sbin
130 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd $(1)/usr/sbin/
133 define Package/samba3-mountcifs/install
134 $(INSTALL_DIR) $(1)/usr/sbin
135 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/mount.cifs $(1)/usr/sbin/
136 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/umount.cifs $(1)/usr/sbin/
139 $(eval $(call BuildPackage,samba3))
140 $(eval $(call BuildPackage,samba3-nmbd))
141 $(eval $(call BuildPackage,samba3-mountcifs))