| 1 | # |
| 2 | # Copyright (C) 2006-2012 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:=linux-atm |
| 12 | PKG_VERSION:=2.5.2 |
| 13 | PKG_RELEASE:=5 |
| 14 | |
| 15 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 16 | PKG_SOURCE_URL:=@SF/$(PKG_NAME) |
| 17 | PKG_MD5SUM:=d49499368c3cf15f73a05d9bce8824a8 |
| 18 | |
| 19 | PKG_INSTALL:=1 |
| 20 | PKG_BUILD_PARALLEL:=1 |
| 21 | |
| 22 | include $(INCLUDE_DIR)/package.mk |
| 23 | |
| 24 | ATM_DEBUG_BINS:=aread awrite atmdiag atmdump atmswitch saaldump \ |
| 25 | sonetdiag svc_recv svc_send ttcp_atm |
| 26 | ATM_DEBUG_SBINS:=atmaddr atmloop atmtcp esi atmsigd bus \ |
| 27 | ilmid ilmidiag lecs les mpcd zeppelin |
| 28 | ATM_DEBUG_TOOLS:=$(ATM_DEBUG_BINS) $(ATM_DEBUG_SBINS) |
| 29 | |
| 30 | define Package/linux-atm |
| 31 | SECTION:=libs |
| 32 | CATEGORY:=Libraries |
| 33 | TITLE:=Linux ATM library |
| 34 | URL:=http://linux-atm.sourceforge.net/ |
| 35 | endef |
| 36 | |
| 37 | define Package/linux-atm/description |
| 38 | This package contains a library for accessing the Linux ATM subsystem. |
| 39 | endef |
| 40 | |
| 41 | define Package/linux-atm/Default |
| 42 | SECTION:=net |
| 43 | CATEGORY:=Network |
| 44 | DEPENDS:=linux-atm |
| 45 | URL:=http://linux-atm.sourceforge.net/ |
| 46 | SUBMENU:=Linux ATM tools |
| 47 | endef |
| 48 | |
| 49 | define Package/atm-tools |
| 50 | $(call Package/linux-atm/Default) |
| 51 | TITLE:=Linux ATM tools |
| 52 | endef |
| 53 | |
| 54 | define Package/atm-tools/description |
| 55 | This package contains the Linux ATM tools. |
| 56 | endef |
| 57 | |
| 58 | define Package/atm-diagnostics |
| 59 | $(call Package/linux-atm/Default) |
| 60 | TITLE:=Linux ATM Diagnostics |
| 61 | endef |
| 62 | |
| 63 | define Package/atm-diagnostics/description |
| 64 | This package contains the Linux ATM diagnostics. |
| 65 | endef |
| 66 | |
| 67 | define Package/atm-debug-tools |
| 68 | $(call Package/linux-atm/Default) |
| 69 | TITLE:=Linux ATM debugging tools |
| 70 | endef |
| 71 | |
| 72 | define Package/atm-debug-tools/description |
| 73 | This package contains the Linux ATM debugging tools. |
| 74 | endef |
| 75 | |
| 76 | define Package/br2684ctl |
| 77 | $(call Package/linux-atm/Default) |
| 78 | TITLE:=ATM Ethernet bridging configuration utility |
| 79 | endef |
| 80 | |
| 81 | define Package/br2684ctl/description |
| 82 | Support for AAL5 encapsulation (RFC-1483/RFC-2684) over ATM. |
| 83 | endef |
| 84 | |
| 85 | define GenAtmPlugin |
| 86 | define Package/$(1) |
| 87 | $(call Package/linux-atm/Default) |
| 88 | TITLE:=Linux ATM tool $(2) |
| 89 | endef |
| 90 | |
| 91 | define Package/$(1)/description |
| 92 | Linux ATM tool $(2). |
| 93 | endef |
| 94 | endef |
| 95 | |
| 96 | $(foreach t,$(ATM_DEBUG_TOOLS),$(eval $(call GenAtmPlugin,atm-$(t),$(t)))) |
| 97 | |
| 98 | define Build/Configure |
| 99 | $(call Build/Configure/Default) |
| 100 | # prevent autoheader invocation |
| 101 | touch $(PKG_BUILD_DIR)/stamp-h.in |
| 102 | endef |
| 103 | |
| 104 | unexport PREFIX |
| 105 | |
| 106 | define Build/Compile |
| 107 | # src/qgen is built with HOSTCC, which does not really like our LDFLAGS |
| 108 | +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/src/qgen \ |
| 109 | LDFLAGS="" \ |
| 110 | all |
| 111 | +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) OBJCOPY=$(TARGET_CROSS)objcopy all |
| 112 | endef |
| 113 | |
| 114 | define Build/InstallDev |
| 115 | $(INSTALL_DIR) $(1)/usr |
| 116 | $(CP) \ |
| 117 | $(PKG_INSTALL_DIR)/usr/include \ |
| 118 | $(PKG_INSTALL_DIR)/usr/lib \ |
| 119 | $(1)/usr/ |
| 120 | endef |
| 121 | |
| 122 | define Package/linux-atm/install |
| 123 | $(INSTALL_DIR) $(1)/usr/lib |
| 124 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libatm.so* $(1)/usr/lib/ |
| 125 | endef |
| 126 | |
| 127 | define Package/atm-tools/install |
| 128 | $(INSTALL_DIR) $(1)/usr/sbin/ |
| 129 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/atmarp{,d} $(1)/usr/sbin/ |
| 130 | endef |
| 131 | |
| 132 | |
| 133 | define BuildAtmPlugin |
| 134 | define Package/$(1)/install |
| 135 | $(INSTALL_DIR) $$(1)/usr/$(3) |
| 136 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/$(3)/$(2) $$(1)/usr/$(3) |
| 137 | endef |
| 138 | |
| 139 | $$(eval $$(call BuildPackage,$(1))) |
| 140 | endef |
| 141 | |
| 142 | define Package/atm-debug-tools/install |
| 143 | $(INSTALL_DIR) $(1)/usr/bin/ |
| 144 | $(INSTALL_DIR) $(1)/usr/sbin/ |
| 145 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/atmaddr $(1)/usr/sbin/ |
| 146 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/atmloop $(1)/usr/sbin/ |
| 147 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/atmtcp $(1)/usr/sbin/ |
| 148 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/esi $(1)/usr/sbin/ |
| 149 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aread $(1)/usr/bin/ |
| 150 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/awrite $(1)/usr/bin/ |
| 151 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/atmdiag $(1)/usr/bin/ |
| 152 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/atmdump $(1)/usr/bin/ |
| 153 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/atmsigd $(1)/usr/sbin/ |
| 154 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bus $(1)/usr/sbin/ |
| 155 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ilmid $(1)/usr/sbin/ |
| 156 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ilmidiag $(1)/usr/sbin/ |
| 157 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lecs $(1)/usr/sbin/ |
| 158 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/les $(1)/usr/sbin/ |
| 159 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mpcd $(1)/usr/sbin/ |
| 160 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zeppelin $(1)/usr/sbin/ |
| 161 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/atmswitch $(1)/usr/bin/ |
| 162 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/saaldump $(1)/usr/bin/ |
| 163 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sonetdiag $(1)/usr/bin/ |
| 164 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/svc_recv $(1)/usr/bin/ |
| 165 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/svc_send $(1)/usr/bin/ |
| 166 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ttcp_atm $(1)/usr/bin/ |
| 167 | endef |
| 168 | |
| 169 | define Package/atm-diagnostics/install |
| 170 | $(INSTALL_DIR) $(1)/usr/bin |
| 171 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aread $(1)/usr/bin/ |
| 172 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/awrite $(1)/usr/bin/ |
| 173 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/atmdiag $(1)/usr/bin/ |
| 174 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/atmdump $(1)/usr/bin/ |
| 175 | endef |
| 176 | |
| 177 | define Package/br2684ctl/install |
| 178 | $(INSTALL_DIR) $(1)/etc/init.d/ |
| 179 | $(INSTALL_BIN) ./files/br2684ctl $(1)/etc/init.d/ |
| 180 | $(INSTALL_DIR) $(1)/usr/sbin |
| 181 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/br2684ctl $(1)/usr/sbin/ |
| 182 | endef |
| 183 | |
| 184 | $(eval $(call BuildPackage,linux-atm)) |
| 185 | $(eval $(call BuildPackage,atm-tools)) |
| 186 | $(eval $(call BuildPackage,atm-debug-tools)) |
| 187 | $(eval $(call BuildPackage,atm-diagnostics)) |
| 188 | $(eval $(call BuildPackage,br2684ctl)) |
| 189 | $(foreach t,$(ATM_DEBUG_BINS),$(eval $(call BuildAtmPlugin,atm-$(t),$(t),bin))) |
| 190 | $(foreach t,$(ATM_DEBUG_SBINS),$(eval $(call BuildAtmPlugin,atm-$(t),$(t),sbin))) |
| 191 | |