packages: add missing conffiles define
[openwrt/svn-archive/archive.git] / net / batman / 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
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=batmand
12 PKG_REV:=1439
13 PKG_VERSION:=r$(PKG_REV)
14 PKG_RELEASE:=2
15 PKG_EXTRA_CFLAGS=-DDEBUG_MALLOC -DMEMORY_USAGE -DPROFILE_DATA -DREVISION_VERSION=\"\ rv$(PKG_REV)\"
16
17 PKG_SOURCE_PROTO:=svn
18 PKG_SOURCE_VERSION:=$(PKG_REV)
19 PKG_SOURCE_SUBDIR:=$(if $(PKG_BRANCH),$(PKG_BRANCH),$(PKG_NAME))-$(PKG_VERSION)
20 PKG_SOURCE_URL:=http://downloads.open-mesh.org/svn/batman/trunk/
21 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
22 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
23
24 PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman/linux/modules
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/batmand/Default
29 URL:=http://www.open-mesh.org/
30 MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
31 endef
32
33 define Package/batmand
34 $(call Package/batmand/Default)
35 SECTION:=net
36 CATEGORY:=Network
37 SUBMENU:=Routing and Redirection
38 DEPENDS:=+libpthread +kmod-tun
39 TITLE:=B.A.T.M.A.N. layer 3 routing daemon
40 endef
41
42 define Package/batmand/description
43 B.A.T.M.A.N. layer 3 routing daemon
44 endef
45
46 define Package/vis
47 $(call Package/batmand/Default)
48 SECTION:=net
49 CATEGORY:=Network
50 SUBMENU:=Routing and Redirection
51 DEPENDS:=+libpthread
52 TITLE:=visualization server for B.A.T.M.A.N. layer 3
53 endef
54
55 define Package/vis/description
56 visualization server for B.A.T.M.A.N. layer 3
57 endef
58
59 define KernelPackage/batgat
60 $(call Package/batmand/Default)
61 SUBMENU:=Network Support
62 DEPENDS:=+batmand
63 TITLE:=B.A.T.M.A.N. gateway module
64 FILES:=$(PKG_KMOD_BUILD_DIR)/batgat.$(LINUX_KMOD_SUFFIX)
65 AUTOLOAD:=$(call AutoLoad,50,batgat)
66 endef
67
68
69 define KernelPackage/batgat/description
70 Kernel gateway module for B.A.T.M.A.N. for better tunnel performance
71 endef
72
73 MAKE_BATMAND_ARGS += \
74 EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \
75 CCFLAGS="$(TARGET_CFLAGS)" \
76 OFLAGS="$(TARGET_CFLAGS)" \
77 REVISION="$(PKG_REV)" \
78 CC="$(TARGET_CC)" \
79 NODEBUG=1 \
80 UNAME="Linux" \
81 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
82 STRIP="/bin/true" \
83 batmand install
84
85 MAKE_VIS_ARGS += \
86 EXTRA_CFLAGS='$(TARGET_CFLAGS) $(PKG_EXTRA_CFLAGS)' \
87 CCFLAGS="$(TARGET_CFLAGS)" \
88 OFLAGS="$(TARGET_CFLAGS)" \
89 REVISION="$(PKG_REV)" \
90 CC="$(TARGET_CC)" \
91 NODEBUG=1 \
92 UNAME="Linux" \
93 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
94 STRIP="/bin/true" \
95 vis install
96
97 MAKE_BATGAT_ARGS += \
98 CROSS_COMPILE="$(TARGET_CROSS)" \
99 ARCH="$(LINUX_KARCH)" \
100 PATH="$(TARGET_PATH)" \
101 SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
102 LINUX_VERSION="$(LINUX_VERSION)" \
103 REVISION="$(PKG_REV)" modules
104
105
106 define Build/Configure
107 endef
108
109 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_batmand),)
110 BUILD_BATMAND := $(MAKE) -C $(PKG_BUILD_DIR)/batman $(MAKE_BATMAND_ARGS)
111 endif
112
113 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_vis),)
114 BUILD_VIS := $(MAKE) -C $(PKG_BUILD_DIR)/vis $(MAKE_VIS_ARGS)
115 endif
116
117 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batgat),)
118 BUILD_BATGAT := $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATGAT_ARGS)
119 endif
120
121 define Build/Compile
122 $(BUILD_BATMAND)
123 $(BUILD_VIS)
124 cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
125 $(BUILD_BATGAT)
126 endef
127
128 define Package/batmand/install
129 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
130 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand $(1)/usr/sbin/
131 $(INSTALL_BIN) ./files/etc/init.d/batmand $(1)/etc/init.d
132 $(INSTALL_DATA) ./files/etc/config/batmand $(1)/etc/config
133 endef
134
135 define Package/batmand/conffiles
136 /etc/config/batmand
137 endef
138
139 define Package/vis/install
140 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
141 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/vis $(1)/usr/sbin/
142 $(INSTALL_BIN) ./files/etc/init.d/vis $(1)/etc/init.d
143 $(INSTALL_DATA) ./files/etc/config/vis $(1)/etc/config
144 endef
145
146 define Package/vis/conffiles
147 /etc/config/vis
148 endef
149
150 $(eval $(call BuildPackage,batmand))
151 $(eval $(call BuildPackage,vis))
152 $(eval $(call KernelPackage,batgat))