You are not logged in.

#1 2022-11-30 07:05:46

the_masala_man
Member
From: India
Registered: 2019-12-16
Posts: 3

PKGBUILD review request: base16-console

Manjaro has a package named maia-console that uses a shell script to echo escape codes to the TTY with a systemd service so the colourscheme is updated before login. I've modified it to be configured to output a base16 theme of choice set through a config file instead of the original hardcoded colours. This is the first time I'm writing a package so I'd really appreciate a review of the PKGBUILD and thoughts on whether its suitable for upload to the AUR.

Source: https://github.com/masala-man/base16-console

PKGBUILD:

# Maintainer: Ayush Shenoy <masala_man@protonmail.com>

pkgname=base16-console
pkgver=1.0
pkgrel=6
pkgdesc="Base16 themes for the console and shell dialog"
arch=('any')
license=('GPL')
depends=('systemd')
backup=('etc/systemd/system/getty@.service.d/base16-console.conf')
install="$pkgname.install"
source=("$pkgname"
        "$pkgname.conf"
        "$pkgname@.service"
        'dialogrc'
        'base16_themes.tar.gz'
        'base16consolerc')
md5sums=('0a9d9c3e9177625b9b1d4af865679a0e'
         'f66e62b940fc92250ee12e36725ffa01'
         '2e05f72efe00e004874ffbba19bb10cb'
         '0116a239d6c4be36c9782217d4008a3f'
         '0bc0676f0b8b3640f866d4e4728c3575'
         'c64f0e353de41e24d968ad0e96974ba6')

package() {
    install -Dm755 $pkgname $pkgdir/usr/bin/$pkgname
    install -Dm644 $pkgname@.service $pkgdir/etc/systemd/system/$pkgname@.service
    install -Dm644 $pkgname.conf $pkgdir/etc/systemd/system/getty@.service.d/$pkgname.conf
    install -Dm644 base16consolerc $pkgdir/etc/base16consolerc
    install -Dm644 themes/* -t $pkgdir/usr/share/$pkgname/themes
#    install -Dm644 dialogrc $pkgdir/etc/skel/.dialogrc
}

Offline

#2 2022-11-30 10:19:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,424

Re: PKGBUILD review request: base16-console

You should quote "$pkgdir" as the build would fail/not work as expected if someone has a space/other special character in their $pkgdir path. Also for general security/verifiability it would probably be preferable to use sha256sums or so instead of md5sums. Other than that I'm not seeing anything blatantly off. You probably also want to change source to actually grab something off of the github link, e.g. a commit/tag  (... or opting for a VCS package) instead of including files directly.

Last edited by V1del (2022-11-30 10:23:09)

Online

#3 2022-11-30 14:34:24

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: PKGBUILD review request: base16-console

Package supplied systemd units should be placed in /usr/lib/systemd this also allows the .install file to be removed as the hook /usr/share/libalpm/hooks/30-systemd-daemon-reload.hook will then be triggered.

Offline

#4 2022-11-30 15:14:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: PKGBUILD review request: base16-console

Is there a reason you are not just using setvtrgb?  My script uses just one command rather than 16 seperate echos.  And with this approach you'd not need variables for the user preferences, their file would just be a list of hex codes, and they'd be fed directly to setvtrgb.  Then at this point you'd realize you'd not need your script at all, and the systemd service could just run setvtrb directly with the config file as a parameter.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2022-12-06 03:28:45

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: PKGBUILD review request: base16-console

The source gives a 404 ...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB