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 package needs to create host symlink #62925

Merged
merged 1 commit into from
Dec 17, 2021
Merged
Changes from all commits
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
30 changes: 21 additions & 9 deletions src/installer/pkg/sfx/installers/dotnet-host.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<GenerateInstallers>true</GenerateInstallers>
<InstallerName>dotnet-host</InstallerName>
<InstallerName Condition="'$(TargetOS)' == 'OSX'">dotnet-host-internal</InstallerName>
<LinuxInstallRoot Condition="'$(BuildRpmPackage)' == 'true'">/</LinuxInstallRoot>
<PackageBrandNameSuffix>Host</PackageBrandNameSuffix>
<VSInsertionShortComponentName>NetCore.SharedHost</VSInsertionShortComponentName>
<UseCustomDirectoryHarvesting>true</UseCustomDirectoryHarvesting>
Expand All @@ -18,9 +19,6 @@
<IncludeVersionInMacOSComponentName>false</IncludeVersionInMacOSComponentName>
<MacOSScriptsTemplateDirectory>osx_scripts/host</MacOSScriptsTemplateDirectory>
<MacOSPackageDescription>The .NET Shared Host.</MacOSPackageDescription>
<RpmScriptsDirectory>$(MSBuildThisFileDirectory)rpm_scripts/host</RpmScriptsDirectory>
<RpmAfterInstallScript>$(RpmScriptsDirectory)/after_install.sh</RpmAfterInstallScript>
<RpmAfterRemoveScript>$(RpmScriptsDirectory)/after_remove.sh</RpmAfterRemoveScript>
<!-- Stabilizes upgrade codes, using values from 6.0.0 release - do not change -->
<UpgradeCode Condition="'$(TargetArchitecture)' == 'arm64'">{FD6988BF-5CCB-4202-3752-072442B1070B}</UpgradeCode>
<UpgradeCode Condition="'$(TargetArchitecture)' == 'x64'">{97C9F490-5379-6902-7B80-D2723CA59D95}</UpgradeCode>
Expand All @@ -44,21 +42,37 @@
<Target Name="PublishToDisk">
<Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." />

<PropertyGroup>
<_DestinationPath>$(OutputPath)</_DestinationPath>
<_DestinationPath Condition="'$(BuildRpmPackage)' == 'true'">$(OutputPath)usr/share/dotnet/</_DestinationPath>
<_UsrBinPath>$(OutputPath)usr/bin/</_UsrBinPath>
</PropertyGroup>

<MakeDir Condition="'$(BuildRpmPackage)' == 'true'" Directories="$(_DestinationPath)" />
<MakeDir Condition="'$(BuildRpmPackage)' == 'true'" Directories="$(_UsrBinPath)" />

<ItemGroup>
<FilesToPublish Include="$(DotNetHostBinDir)\dotnet$(ExeSuffix)"
Destination="$(OutputPath)dotnet$(ExeSuffix)" />
Destination="$(_DestinationPath)dotnet$(ExeSuffix)" />
<FilesToPublish Include="$(InstallerProjectRoot)pkg\THIRD-PARTY-NOTICES.TXT"
Destination="$(OutputPath)ThirdPartyNotices.txt" />
Destination="$(_DestinationPath)ThirdPartyNotices.txt" />
<FilesToPublish Include="$(RepoRoot)LICENSE.TXT"
Destination="$(OutputPath)LICENSE.txt"
Destination="$(_DestinationPath)LICENSE.txt"
Condition="'$(TargetsUnix)' == 'true'"/>
<FilesToPublish Include="$(InstallerProjectRoot)pkg\LICENSE-MSFT.TXT"
Destination="$(OutputPath)LICENSE.txt"
Destination="$(_DestinationPath)LICENSE.txt"
Condition="'$(TargetsUnix)' != 'true'"/>
</ItemGroup>

<Copy SourceFiles="@(FilesToPublish)"
DestinationFiles="%(FilesToPublish.Destination)" />

<!--
Create symlink so the dotnet host is in PATH. It points to where dotnet will be installed, so
it may seem to point to the wrong place in the build machine's layout.
-->
<Exec Condition="'$(BuildRpmPackage)' == 'true'" Command="ln -sf &quot;/usr/share/dotnet/dotnet&quot; &quot;$(_UsrBinPath)dotnet&quot;" />

</Target>

<Target Name="PublishSymbolsToDisk">
Expand All @@ -80,8 +94,6 @@
<ItemGroup>
<DebJsonProperty Include="symlinks" Object="{ &quot;dotnet&quot;: &quot;/usr/bin/dotnet&quot; }" />
<RpmJsonProperty Include="directories" Object="[ &quot;/usr/share/dotnet&quot;, &quot;/usr/share/doc/dotnet-host&quot; ]" />
<RpmJsonProperty Include="after_install_source" Object="&quot;$(RpmAfterInstallScript)&quot;" />
<RpmJsonProperty Include="after_remove_source" Object="&quot;$(RpmAfterRemoveScript)&quot;" />
<PackageConflictsProperty Include="package_conflicts" Object="[ &quot;dotnet&quot;, &quot;dotnet-nightly&quot; ]" />
<DebJsonProperty Include="@(PackageConflictsProperty)" />
<RpmJsonProperty Include="@(PackageConflictsProperty)" />
Expand Down