a36270ae6c864899ded6bd4f79864d62fdb9ff20
[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_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 URL:=http://www.samba.org/
31 endef
32
33 define Package/samba/description
34 The Samba software suite is a collection of programs that implements the
35 SMB protocol for unix systems, allowing you to serve files and printers to
36 Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred
37 to as the LanManager or Netbios protocol.
38 endef
39
40 define Package/samba-common
41 $(call Package/samba)
42 TITLE:=NetBIOS/SMB server and client shared files
43 DEPENDS:=+libgcc
44 endef
45
46 define Package/samba-server
47 $(call Package/samba)
48 TITLE:=NetBIOS/SMB file and print server
49 DEPENDS:=samba-common
50 endef
51
52 define Package/samba-client
53 $(call Package/samba)
54 TITLE:=NetBIOS/SMB simple client
55 DEPENDS:=samba-common
56 endef
57
58 define Build/Compile
59 rm -rf $(PKG_INSTALL_DIR)
60 mkdir -p $(PKG_INSTALL_DIR)
61 (cd $(PKG_BUILD_DIR)/source ; rm -rf config.{cache,status} ; \
62 ./configure \
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_LARGEFILE) \
78 $(DISABLE_NLS) \
79 --with-lockdir=/var/run/samba \
80 --with-privatedir=/etc/samba \
81 );
82 $(MAKE) -C $(PKG_BUILD_DIR)/source \
83 bin/make_smbcodepage bin/make_unicodemap
84 (cd $(PKG_BUILD_DIR)/source/bin ; \
85 mv -f make_smbcodepage make_smbcodepage.old ; \
86 mv -f make_unicodemap make_unicodemap.old ; \
87 );
88 $(MAKE) -C $(PKG_BUILD_DIR)/source \
89 clean
90 (cd $(PKG_BUILD_DIR)/source; rm -rf config.{cache,status}; \
91 $(TARGET_CONFIGURE_OPTS) \
92 CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64" \
93 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
94 LDFLAGS="-lgcc_s -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
95 ac_cv_lib_cups_httpConnect=no \
96 samba_cv_FTRUNCATE_NEEDS_ROOT=no \
97 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no \
98 samba_cv_HAVE_BROKEN_GETGROUPS=no \
99 samba_cv_HAVE_BROKEN_READDIR=no \
100 samba_cv_HAVE_FCNTL_LOCK=yes \
101 samba_cv_HAVE_FNMATCH=yes \
102 samba_cv_HAVE_FTRUNCATE_EXTEND=no \
103 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \
104 samba_cv_HAVE_IFACE_AIX=no \
105 samba_cv_HAVE_IFACE_IFCONF=yes \
106 samba_cv_HAVE_IFACE_IFREQ=yes \
107 samba_cv_HAVE_INO64_T=yes \
108 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no \
109 samba_cv_HAVE_OFF64_T=yes \
110 samba_cv_HAVE_ROOT=yes \
111 samba_cv_HAVE_SECURE_MKSTEMP=yes \
112 samba_cv_HAVE_SHARED_MMAP=yes \
113 samba_cv_HAVE_STRUCT_FLOCK64=yes \
114 samba_cv_HAVE_SYSV_IPC=no \
115 samba_cv_HAVE_TRUNCATED_SALT=no \
116 samba_cv_HAVE_UNION_SEMUN=no \
117 samba_cv_HAVE_UNSIGNED_CHAR=yes \
118 samba_cv_NEED_SGI_SEMUN_HACK=no \
119 samba_cv_REPLACE_INET_NTOA=no \
120 samba_cv_SIZEOF_INO_T=4 \
121 samba_cv_SIZEOF_OFF_T=4 \
122 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes \
123 samba_cv_USE_SETEUID=yes \
124 samba_cv_USE_SETRESUID=no \
125 samba_cv_USE_SETREUID=yes \
126 samba_cv_USE_SETUIDX=no \
127 samba_cv_have_longlong=yes \
128 samba_cv_have_setresgid=no \
129 samba_cv_have_setresuid=no \
130 ./configure \
131 --target=$(GNU_TARGET_NAME) \
132 --host=$(GNU_TARGET_NAME) \
133 --build=$(GNU_HOST_NAME) \
134 --program-prefix="" \
135 --program-suffix="" \
136 --prefix=/usr \
137 --exec-prefix=/usr \
138 --bindir=/usr/bin \
139 --datadir=/usr/share \
140 --includedir=/usr/include \
141 --infodir=/usr/share/info \
142 --libdir=/usr/lib \
143 --libexecdir=/usr/lib \
144 --localstatedir=/var/log/samba \
145 --mandir=/usr/share/man \
146 --sbindir=/usr/sbin \
147 --sysconfdir=/etc/samba \
148 $(DISABLE_LARGEFILE) \
149 $(DISABLE_NLS) \
150 --with-lockdir=/var/run/samba \
151 --with-privatedir=/etc/samba \
152 --with-syslog \
153 );
154 $(MAKE) -C $(PKG_BUILD_DIR)/source \
155 $(TARGET_CONFIGURE_OPTS) \
156 CODEPAGEDIR="/usr/share/samba" \
157 all shared
158 (cd $(PKG_BUILD_DIR)/source/bin ; \
159 mv -f make_smbcodepage.old make_smbcodepage ; touch make_smbcodepage ; \
160 mv -f make_unicodemap.old make_unicodemap ; touch make_unicodemap ; \
161 );
162 mkdir -p $(PKG_INSTALL_DIR)/usr/share/samba
163 mkdir -p $(PKG_INSTALL_DIR)/var/log
164 $(MAKE) -C $(PKG_BUILD_DIR)/source \
165 BASEDIR="$(PKG_INSTALL_DIR)/usr" \
166 BINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
167 SBINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
168 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
169 VARDIR="$(PKG_INSTALL_DIR)/var/log/samba" \
170 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
171 CONFIGDIR="$(PKG_INSTALL_DIR)/etc/samba" \
172 PRIVATEDIR="$(PKG_INSTALL_DIR)/etc/samba" \
173 SWATDIR="$(PKG_INSTALL_DIR)/usr/swat" \
174 LOCKDIR="$(PKG_INSTALL_DIR)/var/run/samba" \
175 SAMBABOOK="$(PKG_INSTALL_DIR)/usr/swat/using_samba" \
176 CODEPAGEDIR="$(PKG_INSTALL_DIR)/usr/share/samba" \
177 install
178 endef
179
180 define Package/samba-common/install
181 $(INSTALL_DIR) $(1)/etc/samba
182 $(INSTALL_DATA) ./files/smb.conf $(1)/etc/samba/smb.conf
183 $(INSTALL_DIR) $(1)/usr/bin
184 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd.shared $(1)/usr/bin/smbpasswd
185 $(INSTALL_DIR) $(1)/usr/share/samba
186 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.{437,850} $(1)/usr/share/samba/
187 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{437,850,ISO8859-1,ISO8859-15} $(1)/usr/share/samba/
188 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.852 $(1)/usr/share/samba/
189 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{852,ISO8859-2} $(1)/usr/share/samba/
190 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/codepage.866 $(1)/usr/share/samba/
191 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/samba/unicode_map.{866,ISO8859-5,KOI8-R} $(1)/usr/share/samba/
192 endef
193
194 define Package/samba-server/install
195 $(INSTALL_DIR) $(1)/etc/init.d
196 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
197 $(INSTALL_DIR) $(1)/usr/lib
198 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/libsmb.so $(1)/usr/lib/
199 $(INSTALL_DIR) $(1)/usr/sbin
200 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd.shared $(1)/usr/sbin/nmbd
201 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd.shared $(1)/usr/sbin/smbd
202 endef
203
204 define Package/samba-client/install
205 $(INSTALL_DIR) $(1)/usr/bin
206 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smbclient $(1)/usr/bin/
207 endef
208
209 $(eval $(call BuildPackage,samba-common))
210 $(eval $(call BuildPackage,samba-server))
211 $(eval $(call BuildPackage,samba-client))