[packages] zaptel: update and fix kernel module build for 2.6.34
[openwrt/svn-archive/archive.git] / libs / zaptel-1.4.x / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=zaptel
12 PKG_VERSION:=1.4.12.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/zaptel/releases/ \
17 http://ftp.digium.com/pub/zaptel/releases/
18 PKG_MD5SUM:=71e83a020b020fa60905edecf70e95a3
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/zaptel14/Default
23 TITLE:=Zaptel
24 URL:=http://ftp.digium.com/pub/zaptel/releases
25 endef
26
27 define KernelPackage/zaptel14
28 $(call Package/zaptel14/Default)
29 SUBMENU:=Other modules
30 TITLE+= (kernel module)
31 KCONFIG:=CONFIG_FTRACE=y \
32 CONFIG_TRACING \
33 CONFIG_KMEMTRACE
34 FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) \
35 $(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX)
36 AUTOLOAD:=$(call AutoLoad,70,zaptel ztdummy)
37 endef
38
39 define KernelPackage/zaptel14/description
40 This package contains the Zaptel core module and ztdummy driver.
41 endef
42
43 define Package/zaptel14-util
44 $(call Package/zaptel14/Default)
45 SECTION:=utils
46 CATEGORY:=Utilities
47 TITLE+= utils
48 DEPENDS += +kmod-zaptel14
49 endef
50
51 define Package/zaptel14-util/description
52 This package contains the zttest program
53 endef
54
55 define Package/zaptel14-libtonezone
56 $(call Package/zaptel14/Default)
57 SECTION:=libs
58 CATEGORY:=Libraries
59 TITLE+= libtonezone (library)
60 DEPENDS += +kmod-zaptel14
61 endef
62
63 define Package/zaptel14-libtonezone/description
64 This package contains the libraries for accessing zaptel/dummy drivers.
65 endef
66
67 MAKE_FLAGS:= \
68 ARCH="$(LINUX_KARCH)" \
69 CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
70 LD="$(TARGET_CROSS)ld" \
71 CROSS_COMPILE="$(TARGET_CROSS)" \
72 KVERS="$(LINUX_VERSION)" \
73 KSRC="$(LINUX_DIR)" \
74 TOPDIR_MODULES="zaptel ztdummy" \
75 SUBDIR_MODULES=""
76
77 define Build/Compile/kmod
78 $(MAKE) -C $(PKG_BUILD_DIR) \
79 $(MAKE_FLAGS) \
80 modules
81 endef
82
83 define Build/Compile/user
84 $(MAKE) -C $(PKG_BUILD_DIR) \
85 ARCH="$(LINUX_KARCH)" \
86 DESTDIR="$(PKG_INSTALL_DIR)" \
87 install-libs install-include zttest
88 endef
89
90 define Build/Compile
91 $(call Build/Compile/kmod)
92 $(call Build/Compile/user)
93 endef
94
95 define Build/InstallDev
96 $(INSTALL_DIR) $(STAGING_DIR)/usr/include
97 $(CP) $(PKG_INSTALL_DIR)/usr/include/zaptel $(STAGING_DIR)/usr/include/
98 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.* $(STAGING_DIR)/usr/lib/
100 endef
101
102 define Package/zaptel14-util/install
103 $(INSTALL_DIR) $(1)/usr/bin
104 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttest $(1)/usr/bin/
105 endef
106
107 define Package/zaptel14-libtonezone/install
108 $(INSTALL_DIR) $(1)/usr/lib
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/
110 endef
111
112 $(eval $(call KernelPackage,zaptel14))
113 $(eval $(call BuildPackage,zaptel14-util))
114 $(eval $(call BuildPackage,zaptel14-libtonezone))