[PR #3] [MERGED] RPM: Support additional files, user creation, SystemD services, dependencies #159

Closed
opened 2026-01-29 16:30:53 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/quamotion/dotnet-packaging/pull/3
Author: @qmfrederik
Created: 6/24/2017
Status: Merged
Merged: 6/24/2017
Merged by: @qmfrederik

Base: masterHead: rpm/additional-files


📝 Commits (5)

  • 0ca32c7 Add the ArchiveEntry class, which allow building an abstract representation of an archive; allowing us to consume additional items (not just the files in the output directory).
  • b95dad0 Allow fine-tuning of the folder structure on Linux
  • fe9996f Support pre/post installation scripts
  • 3687b70 Support specifying additional RPM dependencies
  • b2bb2ab Use .NET Core dependencies as sample dependencies

📊 Changes

20 files changed (+1139 additions, -290 deletions)

View changed files

📝 Packaging.Targets.Tests/Rpm/DotnetFileAnalyzer.cs (+14 -17)
📝 Packaging.Targets.Tests/Rpm/PlistFileAnalyzer.cs (+12 -15)
📝 Packaging.Targets.Tests/Rpm/RpmMetadataTests.cs (+8 -4)
📝 Packaging.Targets.Tests/Rpm/RpmPackageCreatorTests.cs (+27 -8)
Packaging.Targets/ArchiveBuilder.cs (+339 -0)
Packaging.Targets/CopyToDirectoryValue.cs (+23 -0)
Packaging.Targets/IO/ArchiveEntry.cs (+115 -0)
Packaging.Targets/IO/ArchiveEntryType.cs (+23 -0)
📝 Packaging.Targets/IO/CpioFileCreator.cs (+72 -55)
📝 Packaging.Targets/Rpm/DefaultOrder.cs (+9 -1)
📝 Packaging.Targets/Rpm/FileAnalyzer.cs (+38 -49)
📝 Packaging.Targets/Rpm/IFileAnalyzer.cs (+20 -50)
📝 Packaging.Targets/Rpm/IndexTag.cs (+24 -0)
📝 Packaging.Targets/Rpm/RpmMetadata.cs (+54 -0)
📝 Packaging.Targets/Rpm/RpmPackageCreator.cs (+89 -83)
📝 Packaging.Targets/RpmTask.cs (+73 -4)
Packaging.Targets/TaskItemExtensions.cs (+165 -0)
📝 Packaging.Targets/build/Packaging.Targets.targets (+11 -4)
📝 demo/demo.csproj (+15 -0)
demo/demo.service (+8 -0)

📄 Description

This PR adds support for:

  • Adding additional files to the file system.
    Whereas the publish output goes to /usr/share/<project-name>, you may want to save additional files somewhere else. For example, you may want to store your appsettings.json file in /etc/<project-name>/appsettings.json or add a SystemD service file which you want to deploy to /etc/systemd/system/demo.service.
    You can now do that by specifying the LinuxPath path on your project file. For example, to get redirect the location of the appsettings.json file, do:
<Content Update="appsettings.json">
   <LinuxPath>/etc/demo/appsettings.json</LinuxPath>
</Content>
  • Adding empty folders to the deployment layout
    By default, folders are not added to the package layout, even if they are empty. However, you may want to create folders such as /var/lib/<project-name> to store your app data.
    You can add additional folder by adding LinuxFolder elements. You can also specify the owner and group of those folders, and whether these folders should be removed when your application is uninstalled.
<LinuxFolder Include="/var/log/demo" Group="demo" Owner="demo" RemoveOnUninstall="true" />
  • Specifying RPM dependencies
    Your application may depend on other RPM packages to run correctly. For example, any .NET Core application would depend on packages such as libunwind. You can now specify these dependencies using the RpmDependency element:
<RpmDependency Include="java-headless" Version="1.6.0" />
  • Creating Linux Users and Groups
    Applications which run as system services usually have a dedicated service account. You can now have dotnet-rpm create a user and group for your project when your application is installed:
<CreateUser>true</CreateUser>
  • Adding SystemD services
    dotnet-rpm can now install and start your SystemD service:
<InstallService>true</InstallService>

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/quamotion/dotnet-packaging/pull/3 **Author:** [@qmfrederik](https://github.com/qmfrederik) **Created:** 6/24/2017 **Status:** ✅ Merged **Merged:** 6/24/2017 **Merged by:** [@qmfrederik](https://github.com/qmfrederik) **Base:** `master` ← **Head:** `rpm/additional-files` --- ### 📝 Commits (5) - [`0ca32c7`](https://github.com/quamotion/dotnet-packaging/commit/0ca32c7f3b8d8e7b10f6ed4ce9f2ccef436b3db7) Add the ArchiveEntry class, which allow building an abstract representation of an archive; allowing us to consume additional items (not just the files in the output directory). - [`b95dad0`](https://github.com/quamotion/dotnet-packaging/commit/b95dad0e5d1e3b13fc870480b23f5cfa0877366d) Allow fine-tuning of the folder structure on Linux - [`fe9996f`](https://github.com/quamotion/dotnet-packaging/commit/fe9996fad4e0203db397f311e39623cb433aa0e7) Support pre/post installation scripts - [`3687b70`](https://github.com/quamotion/dotnet-packaging/commit/3687b7047a4b0be9e81b3e80569b24daa9dc2461) Support specifying additional RPM dependencies - [`b2bb2ab`](https://github.com/quamotion/dotnet-packaging/commit/b2bb2ab90cf8cdfc0b142c4ca279fbccbac684ba) Use .NET Core dependencies as sample dependencies ### 📊 Changes **20 files changed** (+1139 additions, -290 deletions) <details> <summary>View changed files</summary> 📝 `Packaging.Targets.Tests/Rpm/DotnetFileAnalyzer.cs` (+14 -17) 📝 `Packaging.Targets.Tests/Rpm/PlistFileAnalyzer.cs` (+12 -15) 📝 `Packaging.Targets.Tests/Rpm/RpmMetadataTests.cs` (+8 -4) 📝 `Packaging.Targets.Tests/Rpm/RpmPackageCreatorTests.cs` (+27 -8) ➕ `Packaging.Targets/ArchiveBuilder.cs` (+339 -0) ➕ `Packaging.Targets/CopyToDirectoryValue.cs` (+23 -0) ➕ `Packaging.Targets/IO/ArchiveEntry.cs` (+115 -0) ➕ `Packaging.Targets/IO/ArchiveEntryType.cs` (+23 -0) 📝 `Packaging.Targets/IO/CpioFileCreator.cs` (+72 -55) 📝 `Packaging.Targets/Rpm/DefaultOrder.cs` (+9 -1) 📝 `Packaging.Targets/Rpm/FileAnalyzer.cs` (+38 -49) 📝 `Packaging.Targets/Rpm/IFileAnalyzer.cs` (+20 -50) 📝 `Packaging.Targets/Rpm/IndexTag.cs` (+24 -0) 📝 `Packaging.Targets/Rpm/RpmMetadata.cs` (+54 -0) 📝 `Packaging.Targets/Rpm/RpmPackageCreator.cs` (+89 -83) 📝 `Packaging.Targets/RpmTask.cs` (+73 -4) ➕ `Packaging.Targets/TaskItemExtensions.cs` (+165 -0) 📝 `Packaging.Targets/build/Packaging.Targets.targets` (+11 -4) 📝 `demo/demo.csproj` (+15 -0) ➕ `demo/demo.service` (+8 -0) </details> ### 📄 Description This PR adds support for: * **Adding additional files to the file system.** Whereas the publish output goes to `/usr/share/<project-name>`, you may want to save additional files somewhere else. For example, you may want to store your `appsettings.json` file in `/etc/<project-name>/appsettings.json` or add a SystemD service file which you want to deploy to `/etc/systemd/system/demo.service`. You can now do that by specifying the `LinuxPath` path on your project file. For example, to get redirect the location of the `appsettings.json` file, do: ``` <Content Update="appsettings.json"> <LinuxPath>/etc/demo/appsettings.json</LinuxPath> </Content> ``` * **Adding empty folders to the deployment layout** By default, folders are not added to the package layout, even if they are empty. However, you may want to create folders such as `/var/lib/<project-name>` to store your app data. You can add additional folder by adding `LinuxFolder` elements. You can also specify the owner and group of those folders, and whether these folders should be removed when your application is uninstalled. ``` <LinuxFolder Include="/var/log/demo" Group="demo" Owner="demo" RemoveOnUninstall="true" /> ``` * **Specifying RPM dependencies** Your application may depend on other RPM packages to run correctly. For example, any .NET Core application would depend on packages such as `libunwind`. You can now specify these dependencies using the `RpmDependency` element: ``` <RpmDependency Include="java-headless" Version="1.6.0" /> ``` * **Creating Linux Users and Groups** Applications which run as system services usually have a dedicated service account. You can now have dotnet-rpm create a user and group for your project when your application is installed: ``` <CreateUser>true</CreateUser> ``` * **Adding SystemD services** `dotnet-rpm` can now install and start your SystemD service: ``` <InstallService>true</InstallService> ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:30:53 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#159