# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=pptpclient
pkgver=%version%
pkgrel=%release%
pkgdesc="Client for the proprietary Microsoft Point-to-Point Tunneling Protocol, PPTP."
arch=('x86_64')
url="http://pptpclient.sourceforge.net/"
license=('GPL')
depends=('ppp' 'iproute2' 'perl')
backup=('etc/ppp/options.pptp')
source=("https://downloads.sourceforge.net/sourceforge/pptpclient/pptp-$pkgver.tar.gz")
sha256sums=('82492db8e487ce73b182ee7f444251d20c44f5c26d6e96c553ec7093aefb5af4')

prepare() {
  cd pptp-$pkgver

  # use our CFLAGS and LDFLAGS
  sed -i -e "/CFLAGS  =/ c\CFLAGS = ${CFLAGS}" Makefile
  sed -i -e "/LDFLAGS =/ c\LDFLAGS = ${LDFLAGS}" Makefile

  # adjust ip path
  sed -i 's#/bin/ip#/usr/bin/ip#' routing.c

  # put binaries in /usr/bin
  sed -i "/BINDIR/s#/sbin#/bin#" Makefile
}

build() {
  cd pptp-$pkgver
  make 
}

package() {
  cd pptp-$pkgver
  make DESTDIR="$pkgdir" install
}
