summaryrefslogtreecommitdiff
path: root/community/pptpd/PKGBUILD
blob: 9818d82a0961fa4b0f74b4c7e225a0d5d35005d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# $Id: PKGBUILD 90707 2013-05-13 14:34:48Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=pptpd
pkgver=1.3.4
pkgrel=12
pkgdesc="Poptop server"
arch=(i686 x86_64 'mips64el')
url="http://poptop.sourceforge.net/"
license=('GPL')
depends=(ppp glibc)
backup=(etc/pptpd.conf)
source=(http://downloads.sourceforge.net/sourceforge/poptop/pptpd-$pkgver.tar.gz
	pptpd.service
	unrecognized-opt.patch)
md5sums=('b38df9c431041922c997c1148bedf591'
         '144c17c7d5c1b95cfb3450eb73aa2e50'
         'cfa02c86d0413eb94fac15599986f54c')

build() {
  local _pppver=`pacman -Q ppp`
  _pppver=${_pppver%-*}
  _pppver=${_pppver#ppp }

  cd $srcdir/$pkgname-$pkgver
  patch -p1 <$srcdir/unrecognized-opt.patch
  sed -i 's|AM_CONFIG_HEADER|AC_CONFIG_HEADER|g' configure.in
  autoreconf -i
  ./configure --prefix=/usr --libdir=/usr/lib --exec-prefix=/usr --mandir=/usr/share/man
  sed -i "s|#define VERSION.*|#define VERSION \"${_pppver}\"|" plugins/patchlevel.h
  make
  sed -i 's|install -o root|install|g' plugins/Makefile
  sed -i 's|?=|=|g' plugins/Makefile
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install
  mkdir -p $pkgdir/etc/
  echo -e "# Read man pptpd.conf, see samples in /usr/share/doc/pptpd\n# and write your pptpd configuration here" >$pkgdir/etc/pptpd.conf
  install -Dm0644 $srcdir/$pkgname.service $pkgdir/usr/lib/systemd/system/$pkgname.service
  mkdir -p $pkgdir/usr/share/doc/pptpd
  cp -a samples $pkgdir/usr/share/doc/pptpd/
}