I'm looking to finalize a few programs I've made and make a PKGBUILD for them for distribution. But after reading both https://wiki.archlinux.org/title/Creating_packages and https://wiki.archlinux.org/title/PKGBUILD I've still got a few questions relating to how to approach directory structure. I have some ideas and general direction for how to answer these questions, but I think it'd be best to get as much guidance here as possible:
- Where should my applications store a db file? Should it be located in
~home/.configor is there a better directory for it? It is always user specific. - Should config files be under
~home/.config/<package_name>/config.extension? The use case here would never have shared global configs for multiple users, so should I bother falling back to/etc/<package_name>/config.extension? - The application binary belongs in
/usr/bin/<binary_application>I'm guessing? - For all of these prior questions, do environment variables ever influence or change these points? In other words, can an environment variable ever change where config files are located for the user (eg: instead of in
~home/.configthe environment variable specifies/mnt/.config?)
4a. How should my program handle environment variables beyond reading the home env var for the current user? I'm not asking for specific implementation, but for what env vars I should be interested in using/paying attention to?
4b. If I don't need to pay much attention to environment variables per Q4/Q4a, do I then just hardcode the expected directory paths (minus user specific paths which have to be built at runtime) in my application? Eg: I check for user home config file, then check for /etc/ config file, then create a default config in the home directory? Does this need to interact with the PKGBUILD in any particular way, other than in theprepare()andpackage()sections, where I'd basically just be uncompressing toXdirectory?
Thank you very much for any help!