[packages] samba3: add missing samba-nmbd.init, remove interface setting from config...
[openwrt/svn-archive/archive.git] / net / samba3 / Makefile
1 #
2 # Copyright (C) 2008-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=samba3
10 PKG_VERSION:=3.0.37
11 PKG_RELEASE:=2
12
13 PKG_MD5SUM:=11ed2bfef4090bd5736b194b43f67289
14
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)
18 PKG_BUILD_PARALLEL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21 include $(INCLUDE_DIR)/nls.mk
22
23 define Package/samba3/Default
24 SECTION:=net
25 CATEGORY:=Network
26 SUBMENU:=Filesystem
27 URL:=http://www.samba.org/
28 endef
29
30 define Package/samba3
31 $(call Package/samba3/Default)
32 TITLE:=SMB server for file and printer sharing
33 DEPENDS:=+libpthread +libpopt $(ICONV_DEPENDS)
34 endef
35
36 define Package/samba3-nmbd
37 $(call Package/samba3/Default)
38 TITLE:=NetBIOS name server
39 DEPENDS:=+samba3
40 endef
41
42 define Package/samba3-mountcifs
43 $(call Package/samba3/Default)
44 SECTION:=utils
45 CATEGORY:=Utilities
46 TITLE:=Mount utility for samba shares
47 endef
48
49 define Package/samba3/description
50 SMB server for file and printer sharing
51 Also contains a SMB password utility (smbpasswd)
52
53 Made small with patches taken from AVM GPL releases and freetz
54 endef
55
56 define Package/samba3-nmbd/description
57 NetBIOS name server
58
59 Made small with patches taken from AVM GPL releases and freetz
60 endef
61
62 define Package/cifsmount/description
63 An user space helper utility for mounting remote CIFS shares.
64 endef
65
66 define Package/samba3/conffiles
67 /etc/config/samba
68 /etc/samba/smb.conf.template
69 endef
70
71 define Package/samba3/config
72 source "$(SOURCE)/Config.in"
73 endef
74
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_NO_PRINTING),-DAVM_NO_PRINTING)
78 CONFIGURE_PATH:=source
79 CONFIGURE_ARGS+= \
80 $(if $(CONFIG_SAMBA3_CONFIG_DEBUG),--enable-debug) \
81 --without-krb5 \
82 --without-ads \
83 --without-ldap \
84 --enable-largefile \
85 --with-configdir=/etc/samba \
86 --with-libiconv=$(ICONV_PREFIX) \
87 --with-privatedir=/etc/samba
88
89 # Make sure we tell the configure script that we support negative enum values and want to use setresuid
90 CONFIGURE_VARS+= \
91 SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \
92 samba_cv_USE_SETEUID=no \
93 samba_cv_have_setresuid=yes \
94 samba_cv_USE_SETRESUID=yes \
95 samba_cv_HAVE_C99_VSNPRINTF=yes \
96 samba_cv_have_longlong=yes \
97 ac_cv_type_long_long=yes \
98
99 MAKE_PATH=source
100 MAKE_FLAGS += \
101 $(if $(CONFIG_SAMBA3_CONFIG_NO_PRINTING),OWRT_NO_PRINTING=1) \
102 $(if $(CONFIG_SAMBA3_CONFIG_SMALLER),OWRT_SMALLER=1)
103
104 define Build/Compile
105 # Ugly fix for parallel building (without this some generated files will be missing upon clean build)
106 $(call Build/Compile/Default, proto_exists)
107 $(call Build/Compile/Default, \
108 $(if $(CONFIG_PACKAGE_samba3),bin/smbd bin/smbpasswd) \
109 $(if $(CONFIG_PACKAGE_samba3-nmbd),bin/nmbd) \
110 $(if $(CONFIG_PACKAGE_samba3-mountcifs),bin/mount.cifs bin/umount.cifs) \
111 )
112 endef
113
114 define Package/samba3/install
115 $(INSTALL_DIR) $(1)/etc/{samba,init.d,config}
116 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
117 $(INSTALL_DATA) ./files/samba.config $(1)/etc/config/samba
118 $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba/
119 touch $(1)/etc/samba/smbpasswd
120 $(INSTALL_DIR) $(1)/usr/sbin
121 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd $(1)/usr/sbin/
122 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd $(1)/usr/sbin/
123 endef
124
125 define Package/samba3-nmbd/install
126 $(INSTALL_DIR) $(1)/etc/init.d
127 $(INSTALL_BIN) ./files/samba-nmbd.init $(1)/etc/init.d/samba-nmbd
128 $(INSTALL_DIR) $(1)/usr/sbin
129 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd $(1)/usr/sbin/
130 endef
131
132 define Package/samba3-mountcifs/install
133 $(INSTALL_DIR) $(1)/usr/sbin
134 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/mount.cifs $(1)/usr/sbin/
135 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/umount.cifs $(1)/usr/sbin/
136 endef
137
138 $(eval $(call BuildPackage,samba3))
139 $(eval $(call BuildPackage,samba3-nmbd))
140 $(eval $(call BuildPackage,samba3-mountcifs))