packages/samba3: use new service functions
[openwrt/svn-archive/archive.git] / net / samba3 / Makefile
1 #
2 # Copyright (C) 2008-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=samba3
10 PKG_VERSION:=3.0.24
11 PKG_RELEASE:=9
12
13 PKG_MD5SUM:=89273f67a6d8067cbbecefaa13747153
14
15 PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/samba/old-versions/
16 PKG_SOURCE:=samba-$(PKG_VERSION).tar.gz
17 PKG_BUILD_DIR:=$(BUILD_DIR)/samba-$(PKG_VERSION)/
18
19 include $(INCLUDE_DIR)/package.mk
20
21 TARGET_CFLAGS+=$(if $(CONFIG_SAMBA3_DEBUG),-DSAMBA_DEBUG)
22
23 define Package/samba3
24 SECTION:=net
25 CATEGORY:=Network
26 SUBMENU:=Filesystem
27 TITLE:=samba3
28 DEPENDS:=+libpthread
29 URL:=http://www.samba.org/
30 endef
31
32 define Package/samba3/Description
33 Samba3 - made small with patches taken from AVM GPL releases and freetz
34 endef
35
36 define Package/samba3/conffiles
37 /etc/config/samba
38 /etc/samba/smb.conf.template
39 endef
40
41 define Package/samba3/config
42 source "$(SOURCE)/Config.in"
43 endef
44
45 define Build/Prepare/LFS
46 endef
47
48 define Build/Prepare
49 $(call Build/Prepare/Default)
50 endef
51
52 define Build/Configure
53 [ -f "$(PKG_BUILD_DIR)/source/include/config.h.save" ] || \
54 $(CP) $(PKG_BUILD_DIR)/source/include/config.h \
55 $(PKG_BUILD_DIR)/source/include/config.h.save
56 cat \
57 $(PKG_BUILD_DIR)/source/include/config.h.save \
58 ./files/config-lfs.h >> $(PKG_BUILD_DIR)/source/include/config.h
59 $(Build/Configure/Default)
60 endef
61
62 define Build/Compile
63 CC="$(TARGET_CC)" \
64 CFLAGS="$(TARGET_CFLAGS)" \
65 CPPFLAGS="$(TARGET_CPPFLAGS)" \
66 LDFLAGS="$(TARGET_LDFLAGS)" \
67 $(MAKE) -C $(PKG_BUILD_DIR)/source \
68 $(TARGET_CONFIGURE_OPTS) \
69 all bin/smbpasswd
70 endef
71
72 define Package/samba3/install
73 $(INSTALL_DIR) $(1)/etc/{samba,init.d,config}
74 $(INSTALL_BIN) ./files/samba.init $(1)/etc/init.d/samba
75 $(INSTALL_DATA) ./files/samba.config $(1)/etc/config/samba
76 $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/samba/
77 touch $(1)/etc/samba/smbpasswd
78 $(INSTALL_DIR) $(1)/usr/sbin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbpasswd $(1)/usr/sbin/
80 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/smbd $(1)/usr/sbin/
81 $(INSTALL_BIN) $(PKG_BUILD_DIR)/source/bin/nmbd $(1)/usr/sbin/
82 endef
83
84 $(eval $(call BuildPackage,samba3))