Fix a typo to make it nicer
[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:=2
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-server
38 $(call Package/samba)
39 TITLE:=NetBIOS/SMB file and print server
40 DEPENDS:=+libgcc
41 endef
42
43 define Package/samba-client
44 $(call Package/samba)
45 TITLE:=NetBIOS/SMB simple client
46 endef
47
48 define Build/Compile
49 rm -rf $(PKG_INSTALL_DIR)
50 mkdir -p $(PKG_INSTALL_DIR)
51 (cd $(PKG_BUILD_DIR)/source ; rm -rf config.{cache,status} ; \
52 ./configure \
53 --program-prefix="" \
54 --program-suffix="" \
55 --prefix=/usr \
56 --exec-prefix=/usr \
57 --bindir=/usr/bin \
58 --datadir=/usr/share \
59 --includedir=/usr/include \
60 --infodir=/usr/share/info \
61 --libdir=/usr/lib \
62 --libexecdir=/usr/lib \
63 --localstatedir=/var/log/samba \
64 --mandir=/usr/share/man \
65 --sbindir=/usr/sbin \
66 --sysconfdir=/etc/samba \
67 $(DISABLE_LARGEFILE) \
68 $(DISABLE_NLS) \
69 --with-lockdir=/var/run/samba \
70 --with-privatedir=/etc/samba \
71 );
72 $(MAKE) -C $(PKG_BUILD_DIR)/source \
73 bin/make_smbcodepage bin/make_unicodemap
74 (cd $(PKG_BUILD_DIR)/source/bin ; \
75 mv -f make_smbcodepage make_smbcodepage.old ; \
76 mv -f make_unicodemap make_unicodemap.old ; \
77 );
78 $(MAKE) -C $(PKG_BUILD_DIR)/source \
79 clean
80 (cd $(PKG_BUILD_DIR)/source; rm -rf config.{cache,status}; \
81 $(TARGET_CONFIGURE_OPTS) \
82 CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -DNDEBUG -DSHMEM_SIZE=524288 -Dfcntl=fcntl64" \
83 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
84 LDFLAGS="-lgcc_s -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
85 ac_cv_lib_cups_httpConnect=no \
86 samba_cv_FTRUNCATE_NEEDS_ROOT=no \
87 samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no \
88 samba_cv_HAVE_BROKEN_GETGROUPS=no \
89 samba_cv_HAVE_BROKEN_READDIR=no \
90 samba_cv_HAVE_FCNTL_LOCK=yes \
91 samba_cv_HAVE_FNMATCH=yes \
92 samba_cv_HAVE_FTRUNCATE_EXTEND=no \
93 samba_cv_HAVE_GETTIMEOFDAY_TZ=yes \
94 samba_cv_HAVE_IFACE_AIX=no \
95 samba_cv_HAVE_IFACE_IFCONF=yes \
96 samba_cv_HAVE_IFACE_IFREQ=yes \
97 samba_cv_HAVE_INO64_T=yes \
98 samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no \
99 samba_cv_HAVE_OFF64_T=yes \
100 samba_cv_HAVE_ROOT=yes \
101 samba_cv_HAVE_SECURE_MKSTEMP=yes \
102 samba_cv_HAVE_SHARED_MMAP=yes \
103 samba_cv_HAVE_STRUCT_FLOCK64=yes \
104 samba_cv_HAVE_SYSV_IPC=no \
105 samba_cv_HAVE_TRUNCATED_SALT=no \
106 samba_cv_HAVE_UNION_SEMUN=no \
107 samba_cv_HAVE_UNSIGNED_CHAR=yes \
108 samba_cv_NEED_SGI_SEMUN_HACK=no \
109 samba_cv_REPLACE_INET_NTOA=no \
110 samba_cv_SIZEOF_INO_T=4 \
111 samba_cv_SIZEOF_OFF_T=4 \
112 samba_cv_SYSCONF_SC_NGROUPS_MAX=yes \
113 samba_cv_USE_SETEUID=yes \
114 samba_cv_USE_SETRESUID=no \
115 samba_cv_USE_SETREUID=yes \
116 samba_cv_USE_SETUIDX=no \
117 samba_cv_have_longlong=yes \
118 samba_cv_have_setresgid=no \
119 samba_cv_have_setresuid=no \
120 ./configure \
121 --target=$(GNU_TARGET_NAME) \
122 --host=$(GNU_TARGET_NAME) \
123 --build=$(GNU_HOST_NAME) \
124 --program-prefix="" \
125 --program-suffix="" \
126 --prefix=/usr \
127 --exec-prefix=/usr \
128 --bindir=/usr/bin \
129 --datadir=/usr/share \
130 --includedir=/usr/include \
131 --infodir=/usr/share/info \
132 --libdir=/usr/lib \
133 --libexecdir=/usr/lib \
134 --localstatedir=/var/log/samba \
135 --mandir=/usr/share/man \
136 --sbindir=/usr/sbin \
137 --sysconfdir=/etc/samba \
138 $(DISABLE_LARGEFILE) \
139 $(DISABLE_NLS) \
140 --with-lockdir=/var/run/samba \
141 --with-privatedir=/etc/samba \
142 --with-syslog \
143 );
144 $(MAKE) -C $(PKG_BUILD_DIR)/source \
145 $(TARGET_CONFIGURE_OPTS) \
146 CODEPAGEDIR="/usr/share/samba" \
147 all shared
148 (cd $(PKG_BUILD_DIR)/source/bin ; \
149 mv -f make_smbcodepage.old make_smbcodepage ; touch make_smbcodepage ; \
150 mv -f make_unicodemap.old make_unicodemap ; touch make_unicodemap ; \
151 );
152 mkdir -p $(PKG_INSTALL_DIR)/usr/share/samba
153 mkdir -p $(PKG_INSTALL_DIR)/var/log
154 $(MAKE) -C $(PKG_BUILD_DIR)/source \
155 BASEDIR="$(PKG_INSTALL_DIR)/usr" \
156 BINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
157 SBINDIR="$(PKG_INSTALL_DIR)/usr/bin" \
158 LIBDIR="$(PKG_INSTALL_DIR)/usr/lib" \
159 VARDIR="$(PKG_INSTALL_DIR)/var/log/samba" \
160 MANDIR="$(PKG_INSTALL_DIR)/usr/share/man" \
161 CONFIGDIR="$(PKG_INSTALL_DIR)/etc/samba" \
162 PRIVATEDIR="$(PKG_INSTALL_DIR)/etc/samba" \
163 SWATDIR="$(PKG_INSTALL_DIR)/usr/swat" \
164 LOCKDIR="$(PKG_INSTALL_DIR)/var/run/samba" \
165 SAMBABOOK="$(PKG_INSTALL_DIR)/usr/swat/using_samba" \
166 CODEPAGEDIR="$(PKG_INSTALL_DIR)/usr/share/samba" \
167 install
168 endef
169
170 define Package/samba-server/install
171 $(INSTALL_DIR) $(1)/etc/init.d
172 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
173 $(INSTALL_DIR) $(1)/etc/samba
174 $(INSTALL_DATA) ./files/smb.conf $(1)/etc/samba/smb.conf
175 $(INSTALL_DIR) $(1)/usr/bin
176 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd.shared $(1)/usr/bin/smbpasswd
177 $(INSTALL_DIR) $(1)/usr/lib
178 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/libsmb.so $(1)/usr/lib/
179 $(INSTALL_DIR) $(1)/usr/sbin
180 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd.shared $(1)/usr/sbin/nmbd
181 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd.shared $(1)/usr/sbin/smbd
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} $(1)/usr/share/samba/
185 endef
186
187 define Package/samba-client/install
188 $(INSTALL_DIR) $(1)/usr/bin
189 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smbclient $(1)/usr/bin/
190 endef
191
192 $(eval $(call BuildPackage,samba-server))
193 $(eval $(call BuildPackage,samba-client))