The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / pppd / pppd.mk
1 ################################################################################
2 #
3 # pppd
4 #
5 ################################################################################
6
7 PPPD_VERSION = 2.4.7
8 PPPD_SOURCE = ppp-$(PPPD_VERSION).tar.gz
9 PPPD_SITE = https://download.samba.org/pub/ppp
10 PPPD_LICENSE = LGPLv2+ LGPL BSD-4c BSD-3c GPLv2+
11 PPPD_LICENSE_FILES = \
12         pppd/tdb.c pppd/plugins/pppoatm/COPYING \
13         pppdump/bsd-comp.c pppd/ccp.c pppd/plugins/passprompt.c
14
15 PPPD_MAKE_OPTS = HAVE_INET6=y
16 PPPD_INSTALL_STAGING = YES
17 PPPD_TARGET_BINS = chat pppd pppdump pppstats
18 PPPD_RADIUS_CONF = \
19         dictionary dictionary.ascend dictionary.compat \
20         dictionary.merit dictionary.microsoft \
21         issue port-id-map realms server radiusclient.conf
22
23 ifeq ($(BR2_PACKAGE_PPPD_FILTER),y)
24 PPPD_DEPENDENCIES += libpcap
25 PPPD_MAKE_OPTS += FILTER=y
26 endif
27
28 # pppd bundles some but not all of the needed kernel headers. The embedded
29 # if_pppol2tp.h is unfortunately not compatible with kernel headers > 2.6.34,
30 # and has been part of the kernel headers since 2.6.23, so drop it
31 define PPPD_DROP_INTERNAL_IF_PPOL2TP_H
32         $(RM) $(@D)/include/linux/if_pppol2tp.h
33 endef
34
35 PPPD_POST_EXTRACT_HOOKS += PPPD_DROP_INTERNAL_IF_PPOL2TP_H
36
37 # pppd defaults to /etc/ppp/resolv.conf, which not be writable and is
38 # definitely not useful since the C library only uses
39 # /etc/resolv.conf. Therefore, we change pppd to use /etc/resolv.conf
40 # instead.
41 define PPPD_SET_RESOLV_CONF
42         $(SED) 's,ppp/resolv.conf,resolv.conf,' $(@D)/pppd/pathnames.h
43 endef
44 PPPD_POST_EXTRACT_HOOKS += PPPD_SET_RESOLV_CONF
45
46 define PPPD_CONFIGURE_CMDS
47         $(SED) 's/FILTER=y/#FILTER=y/' $(PPPD_DIR)/pppd/Makefile.linux
48         $(SED) 's/ifneq ($$(wildcard \/usr\/include\/pcap-bpf.h),)/ifdef FILTER/' $(PPPD_DIR)/*/Makefile.linux
49         ( cd $(@D); ./configure --prefix=/usr )
50 endef
51
52 define PPPD_BUILD_CMDS
53         $(MAKE) CC="$(TARGET_CC)" COPTS="$(TARGET_CFLAGS)" \
54                 -C $(@D) $(PPPD_MAKE_OPTS)
55 endef
56
57 ifeq ($(BR2_PACKAGE_PPPD_RADIUS),y)
58 define PPPD_INSTALL_RADIUS
59         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radattr.so \
60                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radattr.so
61         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radius.so \
62                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radius.so
63         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/radius/radrealms.so \
64                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/radrealms.so
65         for m in $(PPPD_RADIUS_CONF); do \
66                 $(INSTALL) -m 644 -D $(PPPD_DIR)/pppd/plugins/radius/etc/$$m \
67                         $(TARGET_DIR)/etc/ppp/radius/$$m; \
68         done
69         $(SED) 's:/usr/local/etc:/etc:' \
70                 $(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
71         $(SED) 's:/usr/local/sbin:/usr/sbin:' \
72                 $(TARGET_DIR)/etc/ppp/radius/radiusclient.conf
73         $(SED) 's:/etc/radiusclient:/etc/ppp/radius:g' \
74                 $(TARGET_DIR)/etc/ppp/radius/*
75 endef
76 endif
77
78 define PPPD_INSTALL_TARGET_CMDS
79         for sbin in $(PPPD_TARGET_BINS); do \
80                 $(INSTALL) -D $(PPPD_DIR)/$$sbin/$$sbin \
81                         $(TARGET_DIR)/usr/sbin/$$sbin; \
82         done
83         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/minconn.so \
84                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/minconn.so
85         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/passprompt.so \
86                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/passprompt.so
87         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/passwordfd.so \
88                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/passwordfd.so
89         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppoatm/pppoatm.so \
90                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppoatm.so
91         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/rp-pppoe/rp-pppoe.so \
92                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/rp-pppoe.so
93         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/rp-pppoe/pppoe-discovery \
94                 $(TARGET_DIR)/usr/sbin/pppoe-discovery
95         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/winbind.so \
96                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/winbind.so
97         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/openl2tp.so \
98                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/openl2tp.so
99         $(INSTALL) -D $(PPPD_DIR)/pppd/plugins/pppol2tp/pppol2tp.so \
100                 $(TARGET_DIR)/usr/lib/pppd/$(PPPD_VERSION)/pppol2tp.so
101         $(PPPD_INSTALL_RADIUS)
102 endef
103
104 define PPPD_INSTALL_STAGING_CMDS
105         $(MAKE) INSTROOT=$(STAGING_DIR)/ -C $(@D) $(PPPD_MAKE_OPTS) install-devel
106 endef
107
108 $(eval $(generic-package))