add md5sums
[openwrt.git] / openwrt / package / ppp / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME := ppp
6 PKG_VERSION := 2.4.3
7 PKG_RELEASE := 3
8 PKG_MD5SUM := 848f6c3cafeb6074ffeb293c3af79b7c
9
10 PKG_SOURCE_SITE := ftp://ftp.samba.org/pub/ppp/
11 PKG_SOURCE_FILE := $(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_CAT := zcat
13 PKG_SOURCE_DIR := $(PKG_NAME)-$(PKG_VERSION)
14 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_SOURCE_DIR)
15
16 PKG_PPP := $(PACKAGE_DIR)/ppp_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 PKG_PPP_PPPOE_PLUGIN := $(PACKAGE_DIR)/ppp-pppoe-plugin_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
18 PKG_PPP_RADIUS_PLUGIN := $(PACKAGE_DIR)/ppp-radius-plugin_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
19 PKG_PPPSTATS := $(PACKAGE_DIR)/pppstats_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
20 PKG_PPPDUMP := $(PACKAGE_DIR)/pppdump_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
21
22 I_PPP := $(PKG_BUILD_DIR)/ipkg/ppp
23 I_PPP_PPPOE_PLUGIN := $(PKG_BUILD_DIR)/ipkg/ppp-pppoe-plugin
24 I_PPP_RADIUS_PLUGIN := $(PKG_BUILD_DIR)/ipkg/ppp-radius-plugin
25 I_PPPDUMP := $(PKG_BUILD_DIR)/ipkg/pppdump
26 I_PPPSTATS := $(PKG_BUILD_DIR)/ipkg/pppstats
27
28 TARGETS := $(PKG_PPP)
29 ifneq ($(BR2_PACKAGE_PPP_PPPOE),)
30 TARGETS += $(PKG_PPP_PPPOE_PLUGIN)
31 endif
32 ifneq ($(BR2_PACKAGE_PPP_RADIUS),)
33 TARGETS += $(PKG_PPP_RADIUS_PLUGIN)
34 endif
35 ifneq ($(BR2_PACKAGE_PPPDUMP),)
36 TARGETS += $(PKG_PPPDUMP)
37 endif
38 ifneq ($(BR2_PACKAGE_PPPSTATS),)
39 TARGETS += $(PKG_PPPSTATS)
40 endif
41
42 INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/ppp.list
43 ifeq ($(BR2_PACKAGE_PPP_PPPOE),y)
44 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ppp-pppoe-plugin.list
45 endif
46 ifeq ($(BR2_PACKAGE_PPP_RADIUS),y)
47 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/ppp-radius-plugin.list
48 endif
49 ifeq ($(BR2_PACKAGE_PPPDUMP),y)
50 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/pppdump.list
51 endif
52 ifeq ($(BR2_PACKAGE_PPPSTATS),y)
53 INSTALL_TARGETS += $(IPKG_STATE_DIR)/info/pppstats.list
54 endif
55
56 $(DL_DIR)/$(PKG_SOURCE_FILE):
57 mkdir -p $(DL_DIR)
58 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE_FILE) $(PKG_MD5SUM) $(PKG_SOURCE_SITE)
59
60 $(PKG_BUILD_DIR)/.patched: $(DL_DIR)/$(PKG_SOURCE_FILE)
61 mkdir -p $(TOOL_BUILD_DIR)
62 $(PKG_SOURCE_CAT) $(DL_DIR)/$(PKG_SOURCE_FILE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
63 $(PATCH) $(PKG_BUILD_DIR) . $(PKG_NAME).patch
64 touch $(PKG_BUILD_DIR)/.patched
65
66 $(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.patched
67 (cd $(PKG_BUILD_DIR); \
68 rm -f config.cache; \
69 $(TARGET_CONFIGURE_OPTS) \
70 CFLAGS="$(TARGET_CFLAGS)" \
71 ./configure \
72 --target=$(GNU_TARGET_NAME) \
73 --host=$(GNU_TARGET_NAME) \
74 --build=$(GNU_HOST_NAME) \
75 --prefix=/usr \
76 --exec-prefix=/usr \
77 --bindir=/usr/bin \
78 --datadir=/usr/share \
79 --infodir=/usr/share/info \
80 --libexecdir=/usr/lib \
81 --localstatedir=/var \
82 --mandir=/usr/share/man \
83 --sbindir=/usr/sbin \
84 --sysconfdir=/etc \
85 $(DISABLE_NLS))
86 touch $(PKG_BUILD_DIR)/.configured
87
88 $(PKG_BUILD_DIR)/pppd/pppd $(PKG_BUILD_DIR)/pppd/plugins/radius/radius.so: $(PKG_BUILD_DIR)/.configured
89 $(MAKE) -C $(PKG_BUILD_DIR) \
90 CC=$(TARGET_CC) \
91 COPTS="$(TARGET_CFLAGS)" \
92 all
93
94 $(PKG_PPP): $(PKG_BUILD_DIR)/pppd/pppd
95 mkdir -p $(I_PPP)
96 cp -af ./ipkg/ppp/* $(I_PPP)
97 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPP) control/ppp.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
98 mkdir -p $(I_PPP)/usr/sbin
99 cp -af $(PKG_BUILD_DIR)/pppd/pppd $(I_PPP)/usr/sbin/
100 $(STRIP) $(I_PPP)/usr/sbin/*
101 mkdir -p $(I_PPP)/usr/lib/pppd
102 cp $(PKG_BUILD_DIR)/pppd/plugins/*.so $(I_PPP)/usr/lib/pppd/
103 $(STRIP) $(I_PPP)/usr/lib/pppd/*.so
104 mkdir -p $(I_PPP)/$(MODULES_SUBDIR)
105 cp $(MODULES_DIR)/kernel/drivers/net/ppp_async.o $(I_PPP)/$(MODULES_SUBDIR)
106 cp $(MODULES_DIR)/kernel/drivers/net/ppp_deflate.o $(I_PPP)/$(MODULES_SUBDIR)
107 cp $(MODULES_DIR)/kernel/drivers/net/bsd_comp.o $(I_PPP)/$(MODULES_SUBDIR)
108 $(IPKG_BUILD) $(I_PPP) $(PACKAGE_DIR)
109
110 $(IPKG_STATE_DIR)/info/ppp.list: $(PKG_PPP)
111 $(IPKG) install $(PKG_PPP)
112
113 $(PKG_PPP_PPPOE_PLUGIN): $(PKG_PPP)
114 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPP_PPPOE_PLUGIN) control/ppp-pppoe-plugin.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
115 mkdir -p $(I_PPP_PPPOE_PLUGIN)/usr/lib/pppd/rp-pppoe
116 cp -af $(PKG_BUILD_DIR)/pppd/plugins/rp-pppoe/rp-pppoe.so \
117 $(I_PPP_PPPOE_PLUGIN)/usr/lib/pppd/rp-pppoe
118 $(STRIP) $(I_PPP_PPPOE_PLUGIN)/usr/lib/pppd/*/*.so
119 mkdir -p $(I_PPP_PPPOE_PLUGIN)/$(MODULES_SUBDIR)
120 cp $(MODULES_DIR)/kernel/drivers/net/pppo*.o $(I_PPP_PPPOE_PLUGIN)/$(MODULES_SUBDIR)
121 $(IPKG_BUILD) $(I_PPP_PPPOE_PLUGIN) $(PACKAGE_DIR)
122
123 $(IPKG_STATE_DIR)/info/ppp-pppoe-plugin.list: $(PKG_PPP_PPPOE_PLUGIN)
124 $(IPKG) install $(PKG_PPP_PPPOE_PLUGIN)
125
126 $(PKG_PPP_RADIUS_PLUGIN): $(PKG_PPP)
127 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPP_RADIUS_PLUGIN) control/ppp-radius-plugin.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
128 mkdir -p $(I_PPP_RADIUS_PLUGIN)/usr/lib/pppd/radius
129 cp -af $(PKG_BUILD_DIR)/pppd/plugins/radius/radius.so \
130 $(I_PPP_RADIUS_PLUGIN)/usr/lib/pppd/radius/
131 $(STRIP) $(I_PPP_RADIUS_PLUGIN)/usr/lib/pppd/*/*.so
132 $(IPKG_BUILD) $(I_PPP_RADIUS_PLUGIN) $(PACKAGE_DIR)
133
134 $(IPKG_STATE_DIR)/info/ppp-radius-plugin.list: $(PKG_PPP_RADIUS_PLUGIN)
135 $(IPKG) install $(PKG_PPP_RADIUS_PLUGIN)
136
137 $(PKG_PPPDUMP): $(PKG_PPP)
138 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPPDUMP) control/pppdump.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
139 mkdir -p $(I_PPPDUMP)/usr/sbin
140 cp -af $(PKG_BUILD_DIR)/pppdump/pppdump $(I_PPPDUMP)/usr/sbin/
141 $(STRIP) $(I_PPPDUMP)/usr/sbin/*
142 $(IPKG_BUILD) $(I_PPPDUMP) $(PACKAGE_DIR)
143
144 $(IPKG_STATE_DIR)/info/pppdump.list: $(PKG_PPPDUMP)
145 $(IPKG) install $(PKG_PPPDUMP)
146
147 $(PKG_PPPSTATS): $(PKG_PPP)
148 $(SCRIPT_DIR)/make-ipkg-dir.sh $(I_PPPSTATS) control/pppstats.control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH)
149 mkdir -p $(I_PPPSTATS)/usr/sbin
150 cp -af $(PKG_BUILD_DIR)/pppstats/pppstats $(I_PPPSTATS)/usr/sbin/
151 $(STRIP) $(I_PPPSTATS)/usr/sbin/*
152 $(IPKG_BUILD) $(I_PPPSTATS) $(PACKAGE_DIR)
153
154 $(IPKG_STATE_DIR)/info/pppstats.list: $(PKG_PPPSTATS)
155 $(IPKG) install $(PKG_PPPSTATS)
156
157 source: $(DL_DIR)/$(PKG_SOURCE_FILE)
158 prepare: $(PKG_BUILD_DIR)/.patched
159 compile: $(TARGETS)
160 install: $(INSTALL_TARGETS)
161
162 clean:
163 rm -rf $(PKG_BUILD_DIR)
164 rm -f $(PKG_PPP) $(PKG_PPP_PPPOE_PLUGIN) $(PKG_PPP_RADIUS_PLUGIN) $(PKG_PPPSTATS) $(PKG_PPPDUMP)
This page took 0.049339 seconds and 5 git commands to generate.