[net] Filesystem: Moved samba2, samba3, and remotefs to Filesystem submenu.
[openwrt/svn-archive/archive.git] / net / samba / Makefile
1 #
2 # Copyright (C) 2006-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=samba
11 PKG_VERSION:=2.0.10
12 PKG_RELEASE:=6
13 PKG_MD5SUM:=54870482fe036b7e69dd48c90661eec6
14
15 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/samba/old-versions
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/samba
21 SECTION:=net
22 CATEGORY:=Network
23 SUBMENU:=Filesystem
24 TITLE:=samba - NetBIOS/SMB implementation
25 URL:=http://www.samba.org/
26 endef
27
28 define Package/samba/description
29 The Samba software suite is a collection of programs that implements the
30 SMB protocol for unix systems, allowing you to serve files and printers to
31 Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
32 to as the LanManager or Netbios protocol.
33 endef
34
35 define Package/samba2-common
36 $(call Package/samba)
37 MENU:=1
38 TITLE:=NetBIOS/SMB server and client shared files
39 DEPENDS:=+libgcc
40 endef
41
42 define Package/samba2-server
43 $(call Package/samba)
44 TITLE:=NetBIOS/SMB file and print server
45 DEPENDS:=samba2-common
46 endef
47
48 define Package/samba2-client
49 $(call Package/samba)
50 TITLE:=NetBIOS/SMB simple client
51 DEPENDS:=samba2-common
52 endef
53
54 TARGET_CFLAGS += $(FPIC)
55
56 define Build/Compile
57 rm -rf $(PKG_INSTALL_DIR)
58 mkdir -p $(PKG_INSTALL_DIR)
59 (cd $(PKG_BUILD_DIR)/source ; rm -rf config.{cache,status} ; \
60 ./configure \
61 $(HOST_CONFIGURE_VARS) \
62 $(HOST_CONFIGURE_ARGS) \
63 --program-prefix="" \
64 --program-suffix="" \
65 --prefix=/usr \
66 --exec-prefix=/usr \
67 --bindir=/usr/bin \
68 --datadir=/usr/share \
69 --includedir=/usr/include \
70 --infodir=/usr/share/info \
71 --libdir=/usr/lib \
72 --libexecdir=/usr/lib \
73 --localstatedir=/var/log/samba \
74 --mandir=/usr/share/man \
75 --sbindir=/usr/sbin \
76 --sysconfdir=/etc/samba \
77 $(DISABLE_NLS) \
78 --with-lockdir=/var/run/samba \
79 --with-privatedir=/etc/samba \
80 );
81 $(MAKE) -C $(PKG_BUILD_DIR)/source \
82 bin/make_smbcodepage bin/make_unicodemap
83 (cd $(PKG_BUILD_DIR)/source/bin ; \
84 mv -f make_smbcodepage make_smbcodepage.old ; \
85 mv -f make_unicodemap make_unicodemap.old ; \
86 );
87 $(MAKE) -C $(PKG_BUILD_DIR)/source \
88 clean
89 (cd $(PKG_BUILD_DIR)/source; rm -rf config.{cache,status}; \
90 $(TARGET_CONFIGURE_OPTS) \
91 CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64" \
92 CPPFLAGS="$(TARGET_CPPFLAGS)" \
93 LDFLAGS="$(TARGET_LDFLAGS) $(LIBGCC_S)" \
94 ac_cv_lib_cups_httpConnect=no \
95 samba_cv_FTRUNCATE_NEEDS_ROOT=no \
96 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no \
97 samba_cv_HAVE_BROKEN_GETGROUPS=no \
98 samba_cv_HAVE_BROKEN_READDIR=no \
99 samba_cv_HAVE_FCNTL_LOCK=yes \
100 samba_cv_HAVE_FNMATCH=yes \
101 samba_cv_HAVE_FTRUNCATE_EXTEND=no \
102 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \
103 samba_cv_HAVE_IFACE_AIX=no \
104 samba_cv_HAVE_IFACE_IFCONF=yes \
105 samba_cv_HAVE_IFACE_IFREQ=yes \
106 samba_cv_HAVE_INO64_T=yes \
107 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no \
108 samba_cv_HAVE_OFF64_T=yes \
109 samba_cv_HAVE_ROOT=yes \
110 samba_cv_HAVE_SECURE_MKSTEMP=yes \
111 samba_cv_HAVE_SHARED_MMAP=yes \
112 samba_cv_HAVE_STRUCT_FLOCK64=yes \
113 samba_cv_HAVE_SYSV_IPC=no \
114 samba_cv_HAVE_TRUNCATED_SALT=no \
115 samba_cv_HAVE_UNION_SEMUN=no \
116 samba_cv_HAVE_UNSIGNED_CHAR=yes \
117 samba_cv_NEED_SGI_SEMUN_HACK=no \
118 samba_cv_REPLACE_INET_NTOA=no \
119 samba_cv_SIZEOF_INO_T=4 \
120 samba_cv_SIZEOF_OFF_T=4 \
121 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes \
122 samba_cv_USE_SETEUID=yes \
123 samba_cv_USE_SETRESUID=no \
124 samba_cv_USE_SETREUID=yes \
125 samba_cv_USE_SETUIDX=no \
126 samba_cv_have_longlong=yes \
127 samba_cv_have_setresgid=no \
128 samba_cv_have_setresuid=no \
129 ./configure \
130 --target=$(GNU_TARGET_NAME) \
131 --host=$(GNU_TARGET_NAME) \
132 --build=$(GNU_HOST_NAME) \
133 --program-prefix="" \
134 --program-suffix="" \
135 --prefix=/usr \
136 --exec-prefix=/usr \
137 --bindir=/usr/bin \
138 --datadir=/usr/share \
139 --includedir=/usr/include \
140 --infodir=/usr/share/info \
141 --libdir=/usr/lib \
142 --libexecdir=/usr/lib \
143 --localstatedir=/var/log/samba \
144 --mandir=/usr/share/man \
145 --sbindir=/usr/sbin \
146 --sysconfdir=/etc/samba \
147 $(DISABLE_NLS) \
148 --with-lockdir=/var/run/samba \
149 --with-privatedir=/etc/samba \
150 --with-syslog \
151 );
152 $(MAKE) -C $(PKG_BUILD_DIR)/source \
153 $(TARGET_CONFIGURE_OPTS) \
154 CODEPAGEDIR="/usr/share/samba" \
155 all shared
156 (cd $(PKG_BUILD_DIR)/source/bin ; \
157 mv -f make_smbcodepage.old make_smbcodepage ; touch make_smbcodepage ; \
158 mv -f make_unicodemap.old make_unicodemap ; touch make_unicodemap ; \
159 );
160 mkdir -p $(PKG_INSTALL_DIR)/usr/share/samba
161 mkdir -p $(PKG_INSTALL_DIR)/var/log
162 $(MAKE) -C $(PKG_BUILD_DIR)/source \
163 BASEDIR="$(PKG_INSTALL_DIR)/usr" \
164 BINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
165 SBINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
166 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
167 VARDIR="$(PKG_INSTALL_DIR)/var/log/samba" \
168 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
169 CONFIGDIR="$(PKG_INSTALL_DIR)/etc/samba" \
170 PRIVATEDIR="$(PKG_INSTALL_DIR)/etc/samba" \
171 SWATDIR="$(PKG_INSTALL_DIR)/usr/swat" \
172 LOCKDIR="$(PKG_INSTALL_DIR)/var/run/samba" \
173 SAMBABOOK="$(PKG_INSTALL_DIR)/usr/swat/using_samba" \
174 CODEPAGEDIR="$(PKG_INSTALL_DIR)/usr/share/samba" \
175 install
176 endef
177
178 define Package/samba2-common/install
179 $(INSTALL_DIR) $(1)/etc/samba
180 $(INSTALL_DATA) ./files/smb.conf $(1)/etc/samba/smb.conf
181 $(INSTALL_DIR) $(1)/usr/bin
182 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd.shared $(1)/usr/bin/smbpasswd
183 $(INSTALL_DIR) $(1)/usr/share/samba
184 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.{437,850} $(1)/usr/share/samba/
185 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{437,850,ISO8859-1,ISO8859-15} $(1)/usr/share/samba/
186 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.852 $(1)/usr/share/samba/
187 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{852,ISO8859-2} $(1)/usr/share/samba/
188 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.{866,1251} $(1)/usr/share/samba/
189 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{866,ISO8859-5,KOI8-R,1251} $(1)/usr/share/samba/
190 endef
191
192 define Package/samba2-server/install
193 $(INSTALL_DIR) $(1)/etc/init.d
194 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
195 $(INSTALL_DIR) $(1)/usr/lib
196 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/libsmb.so $(1)/usr/lib/
197 $(INSTALL_DIR) $(1)/usr/sbin
198 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd.shared $(1)/usr/sbin/nmbd
199 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd.shared $(1)/usr/sbin/smbd
200 endef
201
202 define Package/samba2-client/install
203 $(INSTALL_DIR) $(1)/usr/bin
204 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smbclient $(1)/usr/bin/
205 endef
206
207 $(eval $(call BuildPackage,samba2-common))
208 $(eval $(call BuildPackage,samba2-server))
209 $(eval $(call BuildPackage,samba2-client))