summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a01902dd901f908f66c23c4a509ace39e4cd23f0 (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
# Maintainer: Firebleudark <fire@firebleudark.xyz>
pkgname=autoinstallpackages
pkgver=5.0.0
pkgrel=1
pkgdesc="Simple Arch post-install tool (CLI + optional Tk GUI)"
arch=('any')
url="https://github.com/Firebleudark/Autoinstallpackages"
license=('GPL3')
depends=('bash')
optdepends=(
  'sudo: required for system changes'
  'python: GUI wrapper runtime'
  'tk: Tkinter for the GUI'
  'pciutils: lspci used in checks'
  'curl: network checks/downloads'
  'git: AUR helper bootstrap'
  'flatpak: optional app source'
)
source=("$pkgname-$pkgver.tar.gz::https://github.com/Firebleudark/Autoinstallpackages/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('49b3cceb3ab579aaf27502bb04130f444e814008969f89104717fbd06c182bab')

package() {
  local srcdir_name="Autoinstallpackages-$pkgver"

  # Install project sources required by CLI/GUI
  install -Dm755 "$srcdir/$srcdir_name/v5/simple-postinstall.sh" \
    "$pkgdir/usr/share/autoinstallpackages/v5/simple-postinstall.sh"
  install -Dm755 "$srcdir/$srcdir_name/gui/app.py" \
    "$pkgdir/usr/share/autoinstallpackages/gui/app.py"

  # CLI wrapper
  install -Dm755 /dev/stdin "$pkgdir/usr/bin/autoinstallpackages" << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
exec /usr/share/autoinstallpackages/v5/simple-postinstall.sh "$@"
EOF

  # GUI wrapper
  install -Dm755 /dev/stdin "$pkgdir/usr/bin/autoinstallpackages-gui" << 'EOF'
#!/usr/bin/env bash
set -euo pipefail
exec /usr/bin/env python3 /usr/share/autoinstallpackages/gui/app.py "$@"
EOF

  # Desktop entry
  install -Dm644 /dev/stdin \
    "$pkgdir/usr/share/applications/autoinstallpackages.desktop" << 'EOF'
[Desktop Entry]
Type=Application
Name=Autoinstallpackages (Arch Post-Install)
Comment=Run the Arch post-install helper
Exec=autoinstallpackages-gui
Icon=utilities-system-monitor
Terminal=false
Categories=System;Settings;
EOF

  # License
  install -Dm644 "$srcdir/$srcdir_name/LICENSE" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}