Ported pptpd to buildroot-ng
[packages.git] / net / pptpd / 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:=pptpd
12 PKG_VERSION:=1.3.0
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=75d494e881f7027f4e60b114163f6b67
15
16 PKG_SOURCE_URL:=@SF/poptop
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_CAT:=zcat
19
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/pptpd
27   SECTION:=net
28   CATEGORY:=Network
29   DEPENDS:=
30   TITLE:=PopTop pptp server
31   DESCRIPTION:=PopTop pptp server
32 endef
33
34
35 define Build/Configure
36         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
37                 $(TARGET_CONFIGURE_OPTS) \
38                 CFLAGS="$(TARGET_CFLAGS)" \
39                 ./configure \
40                   --target=$(GNU_TARGET_NAME) \
41                   --host=$(GNU_TARGET_NAME) \
42                   --build=$(GNU_HOST_NAME) \
43                   --program-prefix="" \
44                   --program-suffix="" \
45                   --prefix=/usr \
46                   --exec-prefix=/usr \
47                   --bindir=/usr/bin \
48                   --datadir=/usr/share \
49                   --includedir=/usr/include \
50                   --infodir=/usr/share/info \
51                   --libdir=/usr/lib \
52                   --libexecdir=/usr/lib \
53                   --localstatedir=/var \
54                   --mandir=/usr/share/man \
55                   --sbindir=/usr/sbin \
56                   --sysconfdir=/etc \
57                   $(DISABLE_LARGEFILE) \
58                   $(DISABLE_NLS) \
59                   --with-pppd-ip-alloc \
60         )
61 endef
62
63 define Build/Compile
64         rm -rf $(PKG_INSTALL_DIR)
65         mkdir -p $(PKG_INSTALL_DIR)
66         $(MAKE) -C $(PKG_BUILD_DIR) \
67                 CC=$(TARGET_CC) \
68                 CFLAGS="$(TARGET_CFLAGS) -DSBINDIR=\\\"/usr/sbin\\\"" \
69                 DESTDIR="$(PKG_INSTALL_DIR)" \
70                 INSTALL="install" \
71                 all install
72 endef
73
74 define Package/pptpd/install
75         install -d -m0755 $(1)/etc
76         install -m0644 ./files/pptpd.conf $(1)/etc/
77         install -d -m0755 $(1)/etc/init.d
78         install -m0755 ./files/pptpd.init $(1)/etc/init.d/S50pptpd
79         install -d -m0755 $(1)/etc/ppp
80         install -m0644 ./files/options.pptpd $(1)/etc/ppp/
81         install -d -m0755 $(1)/usr/sbin
82         install -d -m0755 $(1)/usr/lib/pptpd
83         cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/pptpd $(1)/usr/sbin/
84         cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/pptpctrl $(1)/usr/sbin/
85         cp -fpR $(PKG_INSTALL_DIR)/usr/lib/pptpd/* $(1)/usr/lib/pptpd
86         $(STRIP) $1/usr/sbin/*
87         $(STRIP) $1/usr/lib/pptpd/*
88 endef
89
90 $(eval $(call BuildPackage,pptpd))
91
92
93