usb-modeswitch: Fix a condition to compare default product id and switched product...
[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:=4
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/Default
28 TITLE:=Zaptel (kernel module)
29 SUBMENU:=Other modules
30 endef
31
32 define KernelPackage/zaptel14
33 $(call KernelPackage/zaptel14/Default)
34 TITLE:=Zaptel (kernel module)
35 FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX)
36 AUTOLOAD:=$(call AutoLoad,70,zaptel)
37 endef
38
39 define KernelPackage/zaptel14/description
40 This package contains the Zaptel core module. No longer includes ztdummy
41 because it is not needed in all cases (and is in fact broken on x86).
42 endef
43
44
45 define KernelPackage/zaptel14-dummy
46 $(call KernelPackage/zaptel14/Default)
47 TITLE:=Zaptel Dummy (timer; kernel module)
48 DEPENDS += +kmod-zaptel14 @TARGET_x86:@BROKEN
49 FILES:=$(PKG_BUILD_DIR)/kernel/ztdummy.$(LINUX_KMOD_SUFFIX)
50 AUTOLOAD:=$(call AutoLoad,71,ztdummy)
51 endef
52
53 define KernelPackage/zaptel14/description
54 This package contains the Zaptel ztdummy driver. Broken on x86 due to lack
55 of RTC on some hardware.
56 endef
57
58 define KernelPackage/zaptel14-wcusb
59 $(call KernelPackage/zaptel14/Default)
60 DEPENDS += +kmod-zaptel14
61 FILES:=$(PKG_BUILD_DIR)/kernel/wcusb.$(LINUX_KMOD_SUFFIX)
62 AUTOLOAD:=$(call AutoLoad,72,wcusb)
63 endef
64
65 define KernelPackage/zaptel14-wcusb/description
66 This package contains the Zaptel S100U usb driver.
67 endef
68
69 define KernelPackage/zaptel14-wctdm
70 $(call KernelPackage/zaptel14/Default)
71 DEPENDS += +kmod-zaptel14
72 FILES:=$(PKG_BUILD_DIR)/kernel/wctdm.$(LINUX_KMOD_SUFFIX)
73 AUTOLOAD:=$(call AutoLoad,72,wctdm)
74 endef
75
76 define KernelPackage/zaptel14-wctdm/description
77 This package contains the Zaptel wctdm driver.
78 endef
79
80 define Package/zaptel14-util
81 $(call Package/zaptel14/Default)
82 SECTION:=utils
83 CATEGORY:=Utilities
84 TITLE+= utils
85 DEPENDS += +kmod-zaptel14 +zaptel14-libtonezone +libnewt
86 endef
87
88 define Package/zaptel14-util/description
89 This package contains the zaptel utils.
90 endef
91
92 define Package/zaptel14-libtonezone
93 $(call Package/zaptel14/Default)
94 SECTION:=libs
95 CATEGORY:=Libraries
96 TITLE+= libtonezone (library)
97 DEPENDS += +kmod-zaptel14
98 endef
99
100 define Package/zaptel14-libtonezone/description
101 This package contains the libraries for accessing zaptel/dummy drivers.
102 endef
103
104 CONFIGURE_VARS += \
105 LDFLAGS="$$$$LDFLAGS -Wl,-rpath-link $(STAGING_DIR)/usr/lib"
106
107 CONFIGURE_ARGS += \
108 --with-newt="$(STAGING_DIR)/usr" \
109 --without-curses \
110 --without-ncurses
111
112 MAKE_FLAGS:= \
113 ARCH="$(LINUX_KARCH)" \
114 CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
115 LD="$(TARGET_CROSS)ld" \
116 CROSS_COMPILE="$(TARGET_CROSS)" \
117 KVERS="$(LINUX_VERSION)" \
118 KSRC="$(LINUX_DIR)" \
119 TOPDIR_MODULES="zaptel ztdummy wcusb wctdm" \
120 SUBDIR_MODULES=""
121
122 define Build/Compile/kmod
123 $(MAKE) -C $(PKG_BUILD_DIR) \
124 $(MAKE_FLAGS) \
125 modules
126 endef
127
128 define Build/Compile/user
129 $(MAKE) -C $(PKG_BUILD_DIR) \
130 ARCH="$(LINUX_KARCH)" \
131 DESTDIR="$(PKG_INSTALL_DIR)" \
132 install-libs install-include zttest ztcfg zttool ztdiag fxotune ztmonitor ztscan ztspeed fxstest
133 endef
134
135 define Build/Compile
136 $(call Build/Compile/kmod)
137 $(call Build/Compile/user)
138 endef
139
140 define Build/InstallDev
141 $(INSTALL_DIR) $(STAGING_DIR)/usr/include
142 $(CP) $(PKG_INSTALL_DIR)/usr/include/zaptel $(STAGING_DIR)/usr/include/
143 $(INSTALL_DIR) $(STAGING_DIR)/usr/lib
144 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.* $(STAGING_DIR)/usr/lib/
145 endef
146
147 define Package/zaptel14-util/install
148 $(INSTALL_DIR) $(1)/usr/bin
149 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttest $(1)/usr/bin/
150 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztcfg $(1)/usr/bin/
151 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zttool $(1)/usr/bin/
152 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztdiag $(1)/usr/bin/
153 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fxotune $(1)/usr/bin/
154 $(INSTALL_BIN) $(PKG_BUILD_DIR)/fxstest $(1)/usr/bin/
155 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztmonitor $(1)/usr/bin/
156 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztscan $(1)/usr/bin/
157 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ztspeed $(1)/usr/bin/
158 $(INSTALL_DIR) $(1)/etc/hotplug.d/zaptel
159 $(INSTALL_DATA) ./files/10-create-device-node $(1)/etc/hotplug.d/zaptel/
160 endef
161
162 define Package/zaptel14-libtonezone/install
163 $(INSTALL_DIR) $(1)/usr/lib
164 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so.* $(1)/usr/lib/
165 endef
166
167 $(eval $(call KernelPackage,zaptel14))
168 $(eval $(call KernelPackage,zaptel14-dummy))
169 $(eval $(call KernelPackage,zaptel14-wcusb))
170 $(eval $(call KernelPackage,zaptel14-wctdm))
171 $(eval $(call BuildPackage,zaptel14-util))
172 $(eval $(call BuildPackage,zaptel14-libtonezone))