You are not logged in.
I'm building a PKGBUILD for a package fully built in shell. This package consists of one executable shell script and needs to access some static files. Tentatively in my PKGBUILD I'm installing the executable at /usr/bin/weffe and copying the static files to /usr/share/weffe/static. While I know I can access the static directory from the package by hard coding the directory in the script using a shell variable during the installation process, I'm wondering if there is a better way to do this using whereis or an environment variable. What is the standard for finding such files? For reference, below is the relevant part of my PKGBUILD for the package weffe-git.
package() {
cd "${pkgname%-git}"
install -Dm755 ./weffe "$pkgdir/usr/bin/weffe"
mkdir -p "$pkgdir/usr/share"
install -Dm644 ./help.md "$pkgdir/usr/share/man/${pkgname%-git}"
mkdir -p "$pkgdir/usr/share/${pkgname%-git}/static/"
find static/ -exec install -Dm644 {} "$pkgdir/usr/share/${pkgname%-git}/{}" \;
}
Last edited by intermezzio (2021-12-16 04:21:13)
Offline
Depends on what they are.
Offline
I'm not quite sure what you mean by static file, but /usr/share/<pgkname> is likely a good location. I'm not sure why you'd specifically include a sub-directory named "static", but whatever you do under /usr/share/<pkgname> is pretty much just up to you. Really it's totally up to you, but there are some defacto standards or common practices.
If this is the project, then they're just image files, right? I'd just put them directly under `/usr/share/weffe-git/`. Note I'd also not trim the "-git" from that path, the directory should correlated with the package name, not the executable.
Side note: there's really no reason to use that find/exec loop:
install -t ${pkgdir}/usr/share/${pkgname} static/*.png
Last edited by Trilby (2021-12-16 04:42:54)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Thanks for the reply, Trilby. I'll update the PKGBUILD to reflect those changes.
Offline