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