summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e6a82491d92aac4fe821fb08d30df45729d61db4 (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
# Maintainer: univrsal <uni@vrsal.xyz>

pkgname=waechter-git
pkgver=0.1.3_46a1730
pkgrel=1
pkgdesc="Traffic shaping and monitoring for GNU/Linux"
arch=('x86_64')
url="https://github.com/univrsal/waechter"
license=('BSD-3-Clause' 'GPL-3.0-or-later')
depends=(
    'systemd'
    'bpf'
    'libbpf'
    'libxkbcommon'
    'libgl'
    'libx11'
    'libxrandr'
    'libxinerama'
    'libxcursor'
    'libxi'
    'curl'
    'libwebsockets'
    'glfw'
)
makedepends=('git' 'cmake' 'clang' 'gcc')

provides=('waechter')
conflicts=('waechter')

source=("git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$srcdir/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/${pkgname%-git}"
}

build() {
  export CFLAGS CXXFLAGS
  CFLAGS="${CFLAGS/_FORTIFY_SOURCE=?/_FORTIFY_SOURCE=2}"
  CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=?/_FORTIFY_SOURCE=2}"

  cd "$srcdir/${pkgname%-git}"
  cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUILTIN_GLFW=OFF
  cmake --build build -j$(nproc)
}

check() {
  :
}

package() {
  cd "$srcdir/${pkgname%-git}"

  install -Dm755 "build/Source/Gui/waechter" \
    "$pkgdir/usr/bin/waechter"

  install -Dm755 "build/Source/Daemon/waechterd" \
    "$pkgdir/usr/bin/waechterd"

  install -Dm755 "build/Source/Daemon/Net/IPLinkProc/waechter-iplink" \
    "$pkgdir/usr/bin/waechter-iplink"

  install -Dm644 "Meta/Package/waechterd.service" \
    "$pkgdir/usr/lib/systemd/system/waechterd.service"
  install -Dm644 "Meta/Package/waechter.sysusers" \
    "$pkgdir/usr/lib/sysusers.d/waechter.conf" 
  install -Dm644 "Meta/Package/waechter.desktop" \
    "$pkgdir/usr/share/applications/waechter.desktop"
  install -Dm644 Meta/Assets/Branding/Icon.png \
    "$pkgdir/usr/share/icons/hicolor/256x256/apps/waechter.png"

  install -Dm644 "Meta/Package/waechterd.ini" "$pkgdir/etc/waechter/waechterd.ini"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}