add a default for PKG_BUILD_DIR and PKG_INSTALL_DIR (will use KERNEL_BUILD_DIR if...
[openwrt.git] / package / linux-atm / Makefile
1
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=linux-atm
12 PKG_VERSION:=2.4.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
16 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/l/linux-atm/
17 PKG_MD5SUM:=84fef49cc39ff2605204246666f65864
18 PKG_CAT:=zcat
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/linux-atm/Default
23   URL:=http://linux-atm.sourceforge.net/
24 endef
25
26 define Package/linux-atm
27   $(call Package/linux-atm/Default)
28   SECTION:=libs
29   CATEGORY:=Libraries
30   TITLE:=Linux ATM Library
31   DESCRIPTION:=\
32         This package contains a library for accessing the Linux ATM subsystem.
33 endef
34
35 define Package/br2684ctl
36   $(call Package/linux-atm/Default)
37   SECTION:=net
38   CATEGORY:=Network
39   DEPENDS:=+linux-atm
40   TITLE:=RFC2684 bridging utility
41   DESCRIPTION:=\
42         This package contains an ATM RFC2684 bridging utility.
43 endef
44
45 define Build/Configure
46         $(call Build/Configure/Default)
47         # prevent autoheader invocation
48         touch $(PKG_BUILD_DIR)/stamp-h.in
49 endef
50
51 TARGET_CFLAGS := -I$(PKG_BUILD_DIR)/src/include $(TARGET_CFLAGS)
52 define Build/Compile
53         $(MAKE) -C $(PKG_BUILD_DIR) \
54                 $(TARGET_CONFIGURE_OPTS) \
55                 DESTDIR="$(PKG_INSTALL_DIR)" \
56                 all install
57 endef
58
59 define Build/InstallDev
60         mkdir -p $(STAGING_DIR)/usr/include
61         $(CP)   $(PKG_INSTALL_DIR)/usr/include/atm{,d,sap}.h \
62                 $(STAGING_DIR)/usr/include/
63         mkdir -p $(STAGING_DIR)/usr/lib
64         $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libatm.{a,so*} \
65                 $(STAGING_DIR)/usr/lib/
66 endef
67
68 define Build/UninstallDev
69         rm -rf  $(STAGING_DIR)/usr/include/atm{,d,sap}.h \
70                 $(STAGING_DIR)/usr/lib/libatm.{a,so*}
71 endef
72
73 define Package/linux-atm/install
74         $(INSTALL_DIR) $(1)/usr/lib
75         cp -f $(PKG_INSTALL_DIR)/usr/lib/libatm.so.1 $(1)/usr/lib
76 endef
77
78 define Package/br2684ctl/install
79         $(INSTALL_DIR) $(1)/usr/sbin
80         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/br2684ctl $(1)/usr/sbin/
81         $(INSTALL_DIR) $(1)/etc/hotplug.d/net
82         $(INSTALL_DATA) ./files/br2684.hotplug $(1)/etc/hotplug.d/net/30-br2684
83 endef
84
85 $(eval $(call BuildPackage,linux-atm))
86 $(eval $(call BuildPackage,br2684ctl))
87
88 $(eval $(call RequireCommand,automake, \
89         $(PKG_NAME) requires automake. \
90 ))