summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9a50587482767eae9e40fd6b5da888fd7d627302 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=ppp-git
pkgver=2.5.0.r5.gba45e71
pkgrel=1
pkgdesc="A package which implements the Point-to-Point Protocol"
arch=('i686' 'x86_64')
url="https://ppp.samba.org/"
license=('BSD' 'GPL')
depends=('glibc' 'libpcap' 'libxcrypt' 'openssl' 'pam' 'systemd-libs')
makedepends=('git')
provides=("ppp=$pkgver")
conflicts=('ppp')
backup=(etc/ppp/{chap-secrets,ip-down,ip-down.d/00-dns.sh,ip-up,ip-up.d/00-dns.sh,ipv6-down,ipv6-up,ipv6-up.d/00-iface-config.sh,options,pap-secrets})
source=("git+https://github.com/paulusmack/ppp.git"
        "ip-down::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ip-down"
        "ip-down.d.dns.sh::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ip-down.d.dns.sh"
        "ip-up::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ip-up"
        "ip-up.d.dns.sh::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ip-up.d.dns.sh"
        "ipv6-down::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ipv6-down"
        "ipv6-up::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ipv6-up"
        "ipv6-up.d.iface-config.sh::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ipv6-up.d.iface-config.sh"
        "options::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/options"
        "ppp.systemd::https://gitlab.archlinux.org/archlinux/packaging/packages/ppp/-/raw/main/ppp.systemd")
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')


prepare() {
  cd "ppp"

  sed -i --follow-symlinks 's/noipx/#noipx/' "$srcdir/options"
}

pkgver() {
  cd "ppp"

  git describe --long --tags | sed 's/^ppp-//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "ppp"

  ./autogen.sh \
    --prefix="/usr" \
    --sbindir="/usr/bin" \
    --sysconfdir="/etc" \
    --localstatedir="/var" \
    --enable-cbcp \
    --enable-systemd
  make
}

package() {
  cd "ppp"

  make DESTDIR="$pkgdir" install

  install -Dm644 "$srcdir/options" -t "$pkgdir/etc/ppp"
  install -Dm755 "$srcdir"/{ip,ipv6}-{down,up} -t "$pkgdir/etc/ppp"

  install -Dm755 "$srcdir/ip-up.d.dns.sh" "$pkgdir/etc/ppp/ip-up.d/00-dns.sh"
  install -Dm755 "$srcdir/ip-down.d.dns.sh" "$pkgdir/etc/ppp/ip-down.d/00-dns.sh"

  install -Dm755 "$srcdir/ipv6-up.d.iface-config.sh" "$pkgdir/etc/ppp/ipv6-up.d/00-iface-config.sh"
  install -dm755 "$pkgdir/etc/ppp/ipv6-down.d"

  install -dm700 "$pkgdir/etc/ppp/peers"

  install -Dm600 "etc.ppp"/{chap-secrets,pap-secrets} -t "$pkgdir/etc/ppp"
  install -Dm755 "scripts"/{plog,poff,pon} -t "$pkgdir/usr/bin"
  install -Dm644 "scripts/pon.1" -t "$pkgdir/usr/share/man/man1"

  install -Dm644 "$srcdir/ppp.systemd" "$pkgdir/usr/lib/systemd/system/ppp@.service"
}