You are not logged in.

#1 2021-12-15 22:33:16

Registered: 2021-12-15
Posts: 2

[SOLVED] Location of static files in AUR Package

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 ./ "$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)


#2 2021-12-15 23:32:26

Registered: 2012-09-01
Posts: 8,866

Re: [SOLVED] Location of static files in AUR Package

Depends on what they are.


#3 2021-12-16 01:10:15

Inspector Parrot
Registered: 2011-11-29
Posts: 26,197

Re: [SOLVED] Location of static files in AUR Package

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


#4 2021-12-16 04:20:20

Registered: 2021-12-15
Posts: 2

Re: [SOLVED] Location of static files in AUR Package

Thanks for the reply, Trilby. I'll update the PKGBUILD to reflect those changes.


Board footer

Powered by FluxBB