summaryrefslogtreecommitdiffstats
path: root/libs/dahdi-tools/Makefile
blob: cd05af9b23aa79c24225251d67856c71f7fe7ccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# 
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=dahdi-tools
PKG_VERSION:=3.4.0
PKG_RELEASE:=3

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/dahdi-tools/releases
PKG_HASH:=9b9cd53ba51f4a03baf58bbcecda6d7bd7024e3ea3f7e0b864f666bdd794fcc5

PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Vittorio Gambaletta <openwrt@vittgam.net>

PKG_BUILD_PARALLEL:=1

PKG_FIXUP:=autoreconf

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/dahdi-cfg/Default
  SECTION:=utils
  CATEGORY:=Utilities
  SUBMENU:=Telephony
  DEPENDS=+kmod-dahdi
endef

define Package/dahdi-cfg
  $(call Package/dahdi-cfg/Default)
  DEPENDS+=+libpthread +dahdi-tools-libtonezone
  TITLE:=DAHDI tools dahdi_cfg, dahdi_scan and fxotune
endef

define Package/dahdi-monitor
  $(call Package/dahdi-cfg/Default)
  TITLE:=DAHDI tools dahdi_monitor, dahdi_speed and dahdi_test
endef

define Package/dahdi-tools-libtonezone
  $(call Package/dahdi-cfg/Default)
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=DAHDI tonezone library
endef

CONFIGURE_ARGS += \
	--disable-silent-rules \
	--with-perllib="" \
	--without-libusb \
	--without-libusbx \
	--without-newt \
	--without-pcap \
	--without-ppp \
	--without-selinux \
	--without-usb

# https://issues.asterisk.org/jira/browse/DAHTOOL-85
TARGET_CFLAGS+=-fcommon

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.{a,so*} \
		$(1)/usr/lib/
	$(INSTALL_DIR) $(1)/usr/include/dahdi
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/dahdi/tonezone.h \
		$(1)/usr/include/dahdi/
endef

define Package/dahdi-cfg/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{dahdi_cfg,dahdi_scan,fxotune} \
		$(1)/usr/sbin/
endef

define Package/dahdi-monitor/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{dahdi_monitor,dahdi_speed,dahdi_test} \
		$(1)/usr/sbin/
endef

define Package/dahdi-tools-libtonezone/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtonezone.so* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,dahdi-cfg))
$(eval $(call BuildPackage,dahdi-monitor))
$(eval $(call BuildPackage,dahdi-tools-libtonezone))