Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/docs/rpm/sections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ The following is an exhaustive list of file attributes available:
# - config(missingok)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now where is this

Copy link
Copy Markdown
Collaborator

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

# - config(noreplace)
%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
Expand Down
22 changes: 22 additions & 0 deletions content/docs/terra/guidelines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 UPSTREAM-VERSION
%global sanitized_ver %(echo %{ver} | sed 's/-//g')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe replace to . instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what part?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I would change UPSTREAM-VERSION to an example involving a date for something more real world.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 UPSTREAMVERSION 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).
Expand Down