Add russian codepage (cp1251) to samba (#819)
[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:=4
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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/samba
25 SECTION:=net
26 CATEGORY:=Network
27 SUBMENU:=samba - NetBIOS/SMB implementation
28 TITLE:=samba - NetBIOS/SMB implementation
29 URL:=http://www.samba.org/
30 endef
31
32 define Package/samba/description
33 The Samba software suite is a collection of programs that implements the
34 SMB protocol for unix systems, allowing you to serve files and printers to
35 Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
36 to as the LanManager or Netbios protocol.
37 endef
38
39 define Package/samba-common
40 $(call Package/samba)
41 TITLE:=NetBIOS/SMB server and client shared files
42 DEPENDS:=+libgcc
43 endef
44
45 define Package/samba-server
46 $(call Package/samba)
47 TITLE:=NetBIOS/SMB file and print server
48 DEPENDS:=samba-common
49 endef
50
51 define Package/samba-client
52 $(call Package/samba)
53 TITLE:=NetBIOS/SMB simple client
54 DEPENDS:=samba-common
55 endef
56
57 define Build/Compile
58 rm -rf $(PKG_INSTALL_DIR)
59 mkdir -p $(PKG_INSTALL_DIR)
60 (cd $(PKG_BUILD_DIR)/source ; rm -rf config.{cache,status} ; \
61 ./configure \
62 --program-prefix="" \
63 --program-suffix="" \
64 --prefix=/usr \
65 --exec-prefix=/usr \
66 --bindir=/usr/bin \
67 --datadir=/usr/share \
68 --includedir=/usr/include \
69 --infodir=/usr/share/info \
70 --libdir=/usr/lib \
71 --libexecdir=/usr/lib \
72 --localstatedir=/var/log/samba \
73 --mandir=/usr/share/man \
74 --sbindir=/usr/sbin \
75 --sysconfdir=/etc/samba \
76 $(DISABLE_LARGEFILE) \
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="-I$(STAGING_DIR)/usr/include" \
93 LDFLAGS="-lgcc_s -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
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_LARGEFILE) \
148 $(DISABLE_NLS) \
149 --with-lockdir=/var/run/samba \
150 --with-privatedir=/etc/samba \
151 --with-syslog \
152 );
153 $(MAKE) -C $(PKG_BUILD_DIR)/source \
154 $(TARGET_CONFIGURE_OPTS) \
155 CODEPAGEDIR="/usr/share/samba" \
156 all shared
157 (cd $(PKG_BUILD_DIR)/source/bin ; \
158 mv -f make_smbcodepage.old make_smbcodepage ; touch make_smbcodepage ; \
159 mv -f make_unicodemap.old make_unicodemap ; touch make_unicodemap ; \
160 );
161 mkdir -p $(PKG_INSTALL_DIR)/usr/share/samba
162 mkdir -p $(PKG_INSTALL_DIR)/var/log
163 $(MAKE) -C $(PKG_BUILD_DIR)/source \
164 BASEDIR="$(PKG_INSTALL_DIR)/usr" \
165 BINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
166 SBINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
167 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
168 VARDIR="$(PKG_INSTALL_DIR)/var/log/samba" \
169 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
170 CONFIGDIR="$(PKG_INSTALL_DIR)/etc/samba" \
171 PRIVATEDIR="$(PKG_INSTALL_DIR)/etc/samba" \
172 SWATDIR="$(PKG_INSTALL_DIR)/usr/swat" \
173 LOCKDIR="$(PKG_INSTALL_DIR)/var/run/samba" \
174 SAMBABOOK="$(PKG_INSTALL_DIR)/usr/swat/using_samba" \
175 CODEPAGEDIR="$(PKG_INSTALL_DIR)/usr/share/samba" \
176 install
177 endef
178
179 define Package/samba-common/install
180 $(INSTALL_DIR) $(1)/etc/samba
181 $(INSTALL_DATA) ./files/smb.conf $(1)/etc/samba/smb.conf
182 $(INSTALL_DIR) $(1)/usr/bin
183 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd.shared $(1)/usr/bin/smbpasswd
184 $(INSTALL_DIR) $(1)/usr/share/samba
185 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.{437,850} $(1)/usr/share/samba/
186 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{437,850,ISO8859-1,ISO8859-15} $(1)/usr/share/samba/
187 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.852 $(1)/usr/share/samba/
188 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{852,ISO8859-2} $(1)/usr/share/samba/
189 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.{866,1251} $(1)/usr/share/samba/
190 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{866,ISO8859-5,KOI8-R,1251} $(1)/usr/share/samba/
191 endef
192
193 define Package/samba-server/install
194 $(INSTALL_DIR) $(1)/etc/init.d
195 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
196 $(INSTALL_DIR) $(1)/usr/lib
197 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/libsmb.so $(1)/usr/lib/
198 $(INSTALL_DIR) $(1)/usr/sbin
199 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd.shared $(1)/usr/sbin/nmbd
200 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd.shared $(1)/usr/sbin/smbd
201 endef
202
203 define Package/samba-client/install
204 $(INSTALL_DIR) $(1)/usr/bin
205 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smbclient $(1)/usr/bin/
206 endef
207
208 $(eval $(call BuildPackage,samba-common))
209 $(eval $(call BuildPackage,samba-server))
210 $(eval $(call BuildPackage,samba-client))