You are not logged in.
It's my first one and it feels a little clunky to me. Specifically, the number of times I use the mkdir and cp commands, and the fact that it leaves behind a leftover folder in the user's home directory after the install finishes. Here's the AUR link to it. I'm also not sure if there's a better way to handle mime type registration for the .gamebook file type. I'll take any pointers you have.
Last edited by WayfarerCodes (2025-08-13 18:23:59)
Offline
You don't need to use mkdir or cp at all as 'install -D' creates the leading directory. All the files except for the Python script can be installed with 'install -Dm644'.
Offline
If you do prefer to create directories before using them, you can combine the commands on 1 line .
Something like
mkdir -p "${pkgdir}"/usr/share/{appplications,icons,mime/packages,doc/Wayfarer/StoryFork/Examples}Note that https://wiki.archlinux.org/title/Arch_p … irectories recommends /usr/share/doc/pkg so no grouping in /usr/share/doc .
source=("$url/archive/v$pkgver.zip")
sha512sums=("SKIP")You must using a unique name in the source array, also skipping checksum generation for archives is a bad idea.
Check https://wiki.archlinux.org/title/Arch_p … ge_sources
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
How would I go about generating a checksum for the archive? Also, is there a way to clean up the files left behind in the user's home after install, or is that generally up to the user to do?
Here's my updated PKGBUILD so far. I've tested it and it seems to be working.
pkgname="storyfork"
pkgver="1.1.0"
pkgrel="2"
pkgdesc="A tool for reading CYOA stories written in text files"
arch=("x86_64")
url="https://codeberg.org/wayfarer/StoryFork"
license=("GPL-3.0-only")
groups=("wayfarer")
depends=("python-pyqt6" "python3")
source=("${pkgname}-${pkgver}.zip::${url}/archive/v${pkgver}.zip")
sha512sums=("SKIP")
package() {
install -Dm755 "${srcdir}/storyfork/src/storyfork.py" "${pkgdir}/usr/bin/storyfork"
install -Dm644 "${srcdir}/storyfork/build/StoryFork.desktop" "${pkgdir}/usr/share/applications/StoryFork.desktop"
install -Dm644 "${srcdir}/storyfork/icons/storyfork-logo.png" "${pkgdir}/usr/share/icons/storyfork.png"
install -Dm644 "${srcdir}/storyfork/build/mime-type.xml" "${pkgdir}/usr/share/mime/packages/wayfarer-storyfork.xml"
install -Dm644 "${srcdir}/storyfork/templates/Simple.gamebook" "${pkgdir}/usr/share/doc/StoryFork/Examples/Simple.gamebook"
install -Dm644 "${srcdir}/storyfork/templates/Advanced.gamebook" "${pkgdir}/usr/share/doc/StoryFork/Examples/Advanced.gamebook"
}Offline
How would I go about generating a checksum for the archive?
- manually calculate the checksum using the sha512sum command on the archive and c/p it in the PKGBUILD
- run makepkg -g
and my preferred method:
- run updpkgsums (comes with pacman-contrib)
Also, is there a way to clean up the files left behind in the user's home after install, or is that generally up to the user to do?
If you're referring to the build folder where the PKGBUILD (and other files needed for build) reside, that's up to the user.
(many prefer to keep those for future rebuils)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Okay, I've added the checksum and pushed the updated PKGBUILD to the AUR. Thanks for all your help with this.
Offline