Skip to content
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

RPM packaging: Use standard macros #153247

Merged
merged 13 commits into from
Aug 3, 2022
Merged

RPM packaging: Use standard macros #153247

merged 13 commits into from
Aug 3, 2022

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jun 26, 2022

This PR, which builds on #142907 (and stems from the discussion in #142907 (comment)), updates the RPM spec file to use standard RPM macros where appropriate in the package definition.

  • Once the placeholder @@NAME@@ is replaced into the specfile definition of Name:, its value can be referenced using the %{name} macro, requiring less substitution on the template specfile.
  • The standard macros %{_bindir} and %(_datadir} are preferred, when specifying paths for installed files (either in the %{builddir} tree, during %install, or in the %files list).

Also:

  1. The directory creations in the %install section are now sorted to match the other references to those paths throughout the file
  2. Broke %install up into coarse sections, each labeled with a preceding comment

ferdnyc and others added 10 commits February 14, 2022 05:26
Create the `/usr/bin/code` symlink during %install
so that the package owns and manages it.
Also, make it relative (for better relocatability).
- Sort directory creation into same order as copying & %files list
- Break up into sections, label with a comment above each
- Once `@@name@@` is replaced into the spec file as the `Name:`,
  it can be referenced with the RPM macro `%{name}`
- The installation directories corresponding to `/usr/bin/` and
  `/usr/share/` are defined in the RPM macros `%{_bindir}` and
  `%{_datadir}`
@ghost
Copy link

ghost commented Jun 26, 2022

CLA assistant check
All CLA requirements met.

@rzhao271 rzhao271 added this to the July 2022 milestone Jun 27, 2022
@rzhao271
Copy link
Contributor

rzhao271 commented Jul 7, 2022

I plan on approving + merging this PR next week.

@rzhao271 rzhao271 modified the milestones: July 2022, August 2022 Jul 25, 2022
@rzhao271
Copy link
Contributor

Sorry, I forgot to merge the PR 🤦‍♂️
New target for merging is next debt week (week of August 8)

@rzhao271 rzhao271 merged commit 357d146 into microsoft:main Aug 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2022
@ferdnyc ferdnyc deleted the rpm-macros branch September 27, 2022 22:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants