# Maintainer: Joey Yakimowich-Payne <jyapayne@pm.me>
#
# BlueRune's system defaults, for systems installed from the BlueRune ISO (release/iso puts it
# in the system image): the boot splash (dist/plymouth/bluerune), and the files in
# dist/system: the initramfs (systemd, Plymouth, sd-encrypt), Limine's settings and menu,
# Snapper's config for /, compressed swap in RAM, sudo for wheel, and BlueRune's name in
# /etc/os-release. The files here are links to those; release/publish.sh resolves them.
# pkgver counts changes to them.

pkgname=bluerune-system
pkgver=2
pkgrel=1
pkgdesc="BlueRune's system defaults: boot splash, Limine and Snapper setup, initramfs, zram swap, sudo for wheel, BlueRune's name"
arch=('any')
url='https://bluerune.dev'
license=('Apache-2.0 OR MIT')
depends=(
  # The boot splash, and the passphrase prompt for an encrypted disk.
  'plymouth'
  'cryptsetup'
  # The boot loader, an entry per kernel (limine-update), and one per snapshot.
  'limine'
  'limine-mkinitcpio-hook'
  'limine-snapper-sync'
  # Snapshots of / around each pacman transaction.
  'btrfs-progs'
  'snapper'
  'snap-pac'
  'zram-generator'
  'sudo'
)
backup=('etc/mkinitcpio.conf.d/bluerune.conf' 'etc/limine-entry-tool.d/bluerune.conf' 'etc/sudoers.d/10-bluerune-wheel')
install=bluerune-system.install
source=('bluerune.plymouth' 'bluerune.script' 'logo.png' 'entry.png' 'bullet.png' 'progress-track.png' 'progress-bar.png'
        'backdrop.png' 'mkinitcpio.conf' 'limine-entry-tool.conf' 'limine.conf' 'snapper-root' 'zram-generator.conf'
        'sudoers-wheel' 'os-release' 'bluerune-os-release.hook')
sha256sums=('5d8828f64207f11f7f39ad37ed670436620dcfde161a8f4aca6c5d569dfa9555'
            'd67d23f81291c8d52aded3dafa8f414f220fd5e0b978bf23d995f16951c4ca65'
            '1a338705967e276c8d63d3ab4a86099441b811a8e6513fee56bea5b66a6ac284'
            'c756255ac22b6bbce0ca9886bd3c105f33c0ca25e7bd866694a914758154a070'
            '389b5f49034d835d9efae5022036eb635a7b0231419082d08e725e0042dac117'
            'e5c6112aa3d22e967530c1a256194d60557858e5789bc805662ca5151012f361'
            '5ba92723186e268b0b586ec12c177f694626e08c2db5c2ebb87e97a51f20ee12'
            '281abe8ad5ab8e0577c88b9f1c9428f58adf901273973221ea754dcc10c1cb01'
            '0ce4a08bbd198cf7f4294cd9ae7b920e7434a1e8f647f6173cfa24cd5d9ffd03'
            'bdfa8ad48c037e37fd81836668bb49927d1663c7238513b882584a74c5c8610c'
            'a8d6b44126ff7f54fe90e40bd5ec84ea333e99cb7981a6e83a0903468c90ec9d'
            '5df5f7938eeeabaad7a0438689ee7bfce29980e3b463f8dd7f16ee474951cd41'
            '97a144f65e51d6ef1eeac098009aebb7dfbd84276be0f1d3e41bd2044b6cdd92'
            '4ced11c664c3f2c40a1897527cfc26e0ba8ffed6e9256a71dcde1eddaf614130'
            'e1dc123a69048a0fb53475c8facda5d241709492549d7527b35e432696c80375'
            '0006ab6e89945aaeaa42c32628e88f79ff0a876960a9583628cb8f29fd027313')

package() {
  install -Dm644 bluerune.plymouth bluerune.script logo.png entry.png bullet.png progress-track.png progress-bar.png \
    backdrop.png -t "$pkgdir/usr/share/plymouth/themes/bluerune"
  install -Dm644 mkinitcpio.conf "$pkgdir/etc/mkinitcpio.conf.d/bluerune.conf"
  install -Dm644 limine-entry-tool.conf "$pkgdir/etc/limine-entry-tool.d/bluerune.conf"
  install -Dm644 limine.conf -t "$pkgdir/usr/share/bluerune/limine"
  install -Dm644 snapper-root "$pkgdir/usr/share/snapper/config-templates/bluerune"
  install -Dm644 zram-generator.conf -t "$pkgdir/usr/lib/systemd"
  # sudo's own directory is root's alone (750); the package keeps it so.
  install -dm750 "$pkgdir/etc/sudoers.d"
  install -m440 sudoers-wheel "$pkgdir/etc/sudoers.d/10-bluerune-wheel"
  install -Dm755 os-release -t "$pkgdir/usr/lib/bluerune"
  install -Dm644 bluerune-os-release.hook -t "$pkgdir/usr/share/libalpm/hooks"
}
