[GH-ISSUE #19] Installing data into /usr/local/share #8

Closed
opened 2026-03-01 09:09:57 -06:00 by GiteaMirror · 13 comments
Owner

Originally created by @nms-scribe on GitHub (Oct 18, 2023).
Original GitHub issue: https://github.com/fosskers/cargo-aur/issues/19

My project includes some data (mostly sample files) which I would like my aur package to install into /usr/local/share/<appname>. Can cargo-aur be configured to include these files in the tar file in a way that they would be copied into the right place on install?

Originally created by @nms-scribe on GitHub (Oct 18, 2023). Original GitHub issue: https://github.com/fosskers/cargo-aur/issues/19 My project includes some data (mostly sample files) which I would like my aur package to install into `/usr/local/share/<appname>`. Can cargo-aur be configured to include these files in the tar file in a way that they would be copied into the right place on install?
Author
Owner

@fosskers commented on GitHub (Oct 18, 2023):

That's a reasonable request. Perhaps something like:

[package.metadata.aur]
files = [
  ["/path/to/original/file", "/absolute/path/to/desired/location"],
  # ... and so on ...
]

Any thoughts? Naturally at some point some complexity threshold is crossed and it becomes faster for everyone to just say "manage the PKGBUILD yourself", but in this case I think this could be implemented with little toil.

@fosskers commented on GitHub (Oct 18, 2023): That's a reasonable request. Perhaps something like: ```toml [package.metadata.aur] files = [ ["/path/to/original/file", "/absolute/path/to/desired/location"], # ... and so on ... ] ``` Any thoughts? Naturally at some point some complexity threshold is crossed and it becomes faster for everyone to just say "manage the PKGBUILD yourself", but in this case I think this could be implemented with little toil.
Author
Owner

@nms-scribe commented on GitHub (Oct 18, 2023):

That would be the preferred configuration for me.

@nms-scribe commented on GitHub (Oct 18, 2023): That would be the preferred configuration for me.
Author
Owner

@nms-scribe commented on GitHub (Oct 18, 2023):

Since I wanted this soon and didn't want to bother you, I (forked your project)[https://github.com/nms-scribe/cargo-aur] to add that functionality. You're welcome to fetch the changes out of that if you haven't started working on your own. I don't know if I did it the way you would have done it.

Thanks for the useful tool.

@nms-scribe commented on GitHub (Oct 18, 2023): Since I wanted this soon and didn't want to bother you, I (forked your project)[https://github.com/nms-scribe/cargo-aur] to add that functionality. You're welcome to fetch the changes out of that if you haven't started working on your own. I don't know if I did it the way you would have done it. Thanks for the useful tool.
Author
Owner

@t3hmrman commented on GitHub (Oct 19, 2023):

Would it make sense to also add some light templating, @fosskers ? I assume stuff like {app_name} and {version} should be usable from those strings, possibly even with package information like release date, etc. tinytemplate or full on askama could be good fits.

Also, if you'd like someone to try and take this on I'd be happy to (after looking at what @nms-scribe has started)

@t3hmrman commented on GitHub (Oct 19, 2023): Would it make sense to also add some light templating, @fosskers ? I assume stuff like `{app_name}` and `{version}` should be usable from those strings, possibly even with package information like release date, etc. [`tinytemplate`](https://crates.io/crates/tinytemplate) or full on [`askama`](https://crates.io/crates/askama) could be good fits. Also, if you'd like someone to try and take this on I'd be happy to (after looking at what @nms-scribe has started)
Author
Owner

@fosskers commented on GitHub (Oct 23, 2023):

@t3hmrman What sort of templating? Can you provide a sample [package.metadata.aur] that includes some of what you're imagining?

@nms-scribe I will add this feature as soon as I'm able.

@fosskers commented on GitHub (Oct 23, 2023): @t3hmrman What sort of templating? Can you provide a sample `[package.metadata.aur]` that includes some of what you're imagining? @nms-scribe I will add this feature as soon as I'm able.
Author
Owner

@t3hmrman commented on GitHub (Oct 23, 2023):

Hey @fosskers, using your example earlier -- I was thinking something like this:

files = [
  ["/path/to/config.example.toml", "/etc/{app_name}/{version}/config.example.toml"],
  # ... and so on ...
]

Maybe it's not necessary (package authors could just maintain every single version and grow the list), but planning for such a feature might be nice.

@t3hmrman commented on GitHub (Oct 23, 2023): Hey @fosskers, using your example earlier -- I was thinking something like this: ```toml files = [ ["/path/to/config.example.toml", "/etc/{app_name}/{version}/config.example.toml"], # ... and so on ... ] ``` Maybe it's not necessary (package authors could just maintain every single version and grow the list), but planning for such a feature might be nice.
Author
Owner

@fosskers commented on GitHub (Oct 24, 2023):

Ah I see what you mean. Actually... if you wanted to be really clever, you could put PKBUILD bash-based placeholders in the target string yourself! Like /etc/$pkgname/$pkgver/.... cargo aur would just copy the target string as-is, and you'd get the best of both worlds I think.

@fosskers commented on GitHub (Oct 24, 2023): Ah I see what you mean. Actually... if you wanted to be really clever, you could put PKBUILD bash-based placeholders in the target string yourself! Like `/etc/$pkgname/$pkgver/...`. `cargo aur` would just copy the target string as-is, and you'd get the best of both worlds I think.
Author
Owner

@t3hmrman commented on GitHub (Oct 24, 2023):

Ahh thanks! this makes sense -- so this would basically already be supported. thanks for making me aware of that!

@t3hmrman commented on GitHub (Oct 24, 2023): Ahh thanks! this makes sense -- so this would basically already be supported. thanks for making me aware of that!
Author
Owner

@fosskers commented on GitHub (Oct 24, 2023):

so this would basically already be supported

As soon as I implement the original feature itself, yeah.

@fosskers commented on GitHub (Oct 24, 2023): > so this would basically already be supported As soon as I implement the original feature itself, yeah.
Author
Owner

@fosskers commented on GitHub (Nov 21, 2023):

Update: I have this scheduled to work on in mid-December.

@fosskers commented on GitHub (Nov 21, 2023): Update: I have this scheduled to work on in mid-December.
Author
Owner

@fosskers commented on GitHub (Mar 5, 2024):

@nms-scribe Can you take a look at https://github.com/fosskers/cargo-aur/pull/24 and see if it's comparable to what you implemented?

@fosskers commented on GitHub (Mar 5, 2024): @nms-scribe Can you take a look at https://github.com/fosskers/cargo-aur/pull/24 and see if it's comparable to what you implemented?
Author
Owner

@nms-scribe commented on GitHub (Mar 6, 2024):

I'm not in a place where I can test it right now. Reviewing the code and docs, it looks fine.

There are some differences in implementation (for example, I hard-coded the $pkgbuild variable, and added a file-copy that I realize is probably not necessary), but I can change my project to work with the differences.

@nms-scribe commented on GitHub (Mar 6, 2024): I'm not in a place where I can test it right now. Reviewing the code and docs, it looks fine. There are some differences in implementation (for example, I hard-coded the `$pkgbuild` variable, and added a file-copy that I realize is probably not necessary), but I can change my project to work with the differences.
Author
Owner

@fosskers commented on GitHub (Mar 7, 2024):

Released as 1.7.0.

@fosskers commented on GitHub (Mar 7, 2024): Released as `1.7.0`.
GiteaMirror changed title from Installing data into /usr/local/share to [GH-ISSUE #19] Installing data into /usr/local/share 2026-04-11 05:42:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cargo-aur#8