-
-
Notifications
You must be signed in to change notification settings - Fork 16
feat: clarify File derivatives and add illegal char guideline #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -311,7 +311,7 @@ Alternatively, disable `debuginfo` and `debugsource` packages by: | |
|
|
||
| Files can be specified with globs (`*` and `?`). | ||
|
|
||
| ### File derivatives | ||
| ### File Derivatives | ||
|
|
||
| Files can be specified with optionally an attribute[^3] (aka. a file directive[^4]). | ||
| The following is an exhaustive list of file attributes available: | ||
|
|
@@ -320,15 +320,13 @@ The following is an exhaustive list of file attributes available: | |
| %artifact … | ||
| # ╰─ mado: personally never seen this used | ||
| %config(…) … | ||
| # ╰─ exhaustive list: | ||
| # - config(missingok) | ||
| # - config(noreplace) | ||
| # ╰─ flag the specified file as being a configuration file. RPM performs additional processing for config files when packages are erased, and during installations and upgrades. | ||
| %dir … | ||
| # ╰─ specify a directory the package owns | ||
| # ╰─ specify a directory the package owns if the files in that directory are not to be owned by the package | ||
| %doc … | ||
| # ╰─ store the file into %{_docdir} | ||
| %docdir | ||
| # ╰─ mado: personally never seen this used | ||
| # ╰─ Define a directory as a documentation-only directory. Can be used when a package defines its own documentation folder and contains a large number of doc files. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. case |
||
| %ghost … | ||
| # ╰─ mark a file as owned by the package, but don't actually install the file | ||
| %license … | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -409,6 +409,28 @@ It is also acceptable to add more to previous changelogs (for example, adding mi | |
| - If you are unsure if a bump is needed, bump it. | ||
| - Follow appropriate changelog procedures outlined in the above section. | ||
|
|
||
| #### Illegal Char in Version String | ||
|
|
||
| In the case of an 'illegal character' in a `Version:{:rpmspec}` tag (such as a `-` or `/`), you will need to define a `%sanitized_ver:{:rpmspec}` macro. | ||
| To do this, add the following lines to your spec file (assuming a `-` is used in the upstream version): | ||
|
|
||
| ```rpmspec | ||
| %global ver 2005-05-14 | ||
| %global sanitized_ver %(echo %{ver} | sed 's/-//g') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe replace to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In what part?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh like adding a . instead of a /? I copied this from how most our current specs do it... but the . does make more sense
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally, I would change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually why do we need this section? even if so this should be in fedora not us? |
||
| ... | ||
| Version: %sanitized_ver # This will expand to 20250514 in this example | ||
| ``` | ||
|
|
||
| Then, the `update.rhai` needs to be appended to replace the globaly defined `ver` instead of the usual `Version` tag. | ||
| Your `update.rhai` should look like this: | ||
|
|
||
| ```rhai | ||
| rpm.global("ver", gh("upstream/project")); // Remember to change the update function to what your upstream is hosted on, for example, `pypi()` or `hackage()`. | ||
| ``` | ||
|
|
||
| If a different illegal character is used, you will need to write a `sed` script to remove this character. | ||
| More information on writing these scripts can be found [here](https://linux.die.net/man/1/sed). | ||
|
|
||
| #### Patches | ||
|
|
||
| - Packages SHOULD apply patches (usually via the `-p*` flag) in `%autosetup{:rpmspec}`. If this is not possible (typically when `%autosetup{:rpmspec}` is not used), you SHOULD use [%autopatch](../rpm/macros#autopatch). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now where is this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow this did not show up as missing on mobile LMAO