|
80 | 80 | BuildInParallel="$(BuildInParallel)" /> |
81 | 81 | </Target> |
82 | 82 |
|
| 83 | + <PropertyGroup> |
| 84 | + <_CreateRpmTargets Condition="'$(UseArcadeRpmTooling)' != 'true'">FindFPM;CreateRpmUsingFpm</_CreateRpmTargets> |
| 85 | + <_CreateRpmTargets Condition="'$(UseArcadeRpmTooling)' == 'true'">CreateRpm</_CreateRpmTargets> |
| 86 | + </PropertyGroup> |
| 87 | + |
83 | 88 | <Target Name="GenerateDeb" DependsOnTargets="CreateDeb" /> |
84 | | - <Target Name="GenerateRpm" DependsOnTargets="FindFPM;CreateRpm" /> |
| 89 | + <Target Name="GenerateRpm" DependsOnTargets="$(_CreateRpmTargets)" /> |
85 | 90 | <Target Name="GenerateMsi" DependsOnTargets="CreateWixInstaller" /> |
86 | 91 | <Target Name="GenerateCrossArchMsi" DependsOnTargets="CreateCrossArchWixInstaller" /> |
87 | 92 | <Target Name="GeneratePkg" DependsOnTargets="CreatePkg" /> |
|
292 | 297 |
|
293 | 298 | <!-- Create any symlinks --> |
294 | 299 | <MakeDir Directories="$(_LayoutDataRoot)%(DebSymlink.RelativeDir)" Condition="'%(DebSymlink.Identity)' != ''" /> |
295 | | - <Exec Command="ln -s %(DebSymlink.LinkTarget) %(DebSymlink.FileName)%(DebSymlink.Extension)" WorkingDirectory="$(_LayoutDataRoot)%(DebSymlink.RelativeDir)" Condition="'%(DebSymlink.Identity)' != ''" /> |
| 300 | + <Exec Command="ln -sf %(DebSymlink.LinkTarget) %(DebSymlink.FileName)%(DebSymlink.Extension)" WorkingDirectory="$(_LayoutDataRoot)%(DebSymlink.RelativeDir)" Condition="'%(DebSymlink.Identity)' != ''" /> |
296 | 301 |
|
297 | 302 | <Exec Command="tar -C '$(_LayoutControlRoot)' -czf '$(_LayoutDirectory)/control.tar.gz' ." |
298 | 303 | IgnoreExitCode="true" |
|
314 | 319 | Create RPM package. |
315 | 320 | --> |
316 | 321 | <Target Name="CreateRpm" |
| 322 | + DependsOnTargets=" |
| 323 | + _GetInstallerProperties; |
| 324 | + _CreateInstallerLayout; |
| 325 | + GetRpmInstallerJsonProperties" |
| 326 | + Returns="$(_InstallerFile)"> |
| 327 | + |
| 328 | + <PropertyGroup> |
| 329 | + <_LayoutDirectory>$(IntermediateOutputPath)installer/rpmLayout/</_LayoutDirectory> |
| 330 | + <_LayoutDataRoot>$(_LayoutDirectory)root/</_LayoutDataRoot> |
| 331 | + <_LayoutPackageRoot>$(_LayoutDataRoot)$(LinuxInstallRoot)</_LayoutPackageRoot> |
| 332 | + <_LayoutDocs>$(_LayoutDataRoot)/usr/share/doc</_LayoutDocs> |
| 333 | + </PropertyGroup> |
| 334 | + |
| 335 | + <RemoveDir Condition="Exists('$(_InstallerIntermediatesDir)')" Directories="$(_InstallerIntermediatesDir)" /> |
| 336 | + <MakeDir Directories="$(_InstallerIntermediatesDir)" /> |
| 337 | + |
| 338 | + <!-- Create empty layout. --> |
| 339 | + <RemoveDir Condition="Exists('$(_LayoutDirectory)')" Directories="$(_LayoutDirectory)" /> |
| 340 | + <MakeDir Directories="$(_LayoutDirectory)" /> |
| 341 | + <MakeDir Directories="$(_LayoutPackageRoot)" /> |
| 342 | + <MakeDir Directories="$(_LayoutDocs)" /> |
| 343 | + |
| 344 | + <MSBuild Projects="$(MSBuildProjectFullPath)" |
| 345 | + Targets="PublishToDisk" |
| 346 | + Properties="OutputPath=$([MSBuild]::EnsureTrailingSlash('$(_LayoutPackageRoot)'))" |
| 347 | + RemoveProperties="@(_GlobalPropertiesToRemoveForPublish)" /> |
| 348 | + |
| 349 | + <Copy |
| 350 | + SourceFiles="@(Manpage)" |
| 351 | + DestinationFiles="@(Manpage->'$(_LayoutDocs)/%(RecursiveDir)%(Filename)%(Extension)')" /> |
| 352 | + |
| 353 | + <!-- Write copyright file in the debian format. There's no defined format for RPM copyright files. --> |
| 354 | + <ItemGroup> |
| 355 | + <_CopyrightLine Include="Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/" /> |
| 356 | + <_CopyrightLine Include="%0AFiles: *" /> |
| 357 | + <_CopyrightLine Include="Copyright: $(_PackageCopyright)" /> |
| 358 | + <_CopyrightLine Include="Comment: Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license." /> |
| 359 | + <_CopyrightLine Include="License: MIT and ASL 2.0 and BSD" /> |
| 360 | + <_CopyrightLine Include="%0ALicense: $([System.IO.File]::ReadAllText('$(LicenseFile)'))" /> |
| 361 | + </ItemGroup> |
| 362 | + |
| 363 | + <WriteLinesToFile File="$(_LayoutDocs)/$(VersionedInstallerName)/copyright" Lines="@(_CopyrightLine)" /> |
| 364 | + |
| 365 | + <!-- We always own the directory for the copyright file. --> |
| 366 | + <ItemGroup> |
| 367 | + <_GeneratedFileOwnedDirectory Include="$(_LayoutDocs)/$(VersionedInstallerName)" /> |
| 368 | + </ItemGroup> |
| 369 | + |
| 370 | + <!-- Create any symlinks --> |
| 371 | + <MakeDir Directories="$(_LayoutDataRoot)%(DebSymlink.RelativeDir)" Condition="'%(DebSymlink.Identity)' != ''" /> |
| 372 | + <Exec Command="ln -sf %(DebSymlink.LinkTarget) %(DebSymlink.FileName)%(DebSymlink.Extension)" WorkingDirectory="$(_LayoutDataRoot)%(DebSymlink.RelativeDir)" Condition="'%(DebSymlink.Identity)' != ''" /> |
| 373 | + |
| 374 | + <!-- |
| 375 | + Compress all files and directories that we output. |
| 376 | + We'll filter out any directories we don't own in CreateRpmPackage. |
| 377 | + --> |
| 378 | + <PropertyGroup> |
| 379 | + <_FindAllPayloadFilesCommand>find . -depth ! -wholename '.'</_FindAllPayloadFilesCommand> |
| 380 | + </PropertyGroup> |
| 381 | + <Exec Command="$(_FindAllPayloadFilesCommand) -print | cpio -H newc -o --quiet > '$(_LayoutDirectory)/payload.cpio'" |
| 382 | + WorkingDirectory="$(_LayoutDataRoot)" |
| 383 | + EchoOff="true" |
| 384 | + StandardOutputImportance="Low" /> |
| 385 | + |
| 386 | + <!-- For each filesystem entry, execute the 'file' command. We need to both shell-escape and MSBuild-escape the semicolon --> |
| 387 | + <Exec Command="$(_FindAllPayloadFilesCommand) -exec file {} \%3B" |
| 388 | + ConsoleToMsBuild="true" |
| 389 | + EchoOff="true" |
| 390 | + StandardOutputImportance="Low" |
| 391 | + WorkingDirectory="$(_LayoutDataRoot)"> |
| 392 | + <Output TaskParameter="ConsoleOutput" ItemName="_RawFileKindInfo" /> |
| 393 | + </Exec> |
| 394 | + |
| 395 | + <CreateRpmPackage |
| 396 | + OutputRpmPackagePath="$(_InstallerFile)" |
| 397 | + Vendor=".NET Foundation" |
| 398 | + Packager= ".NET Team <[email protected]>" |
| 399 | + PackageName="$(VersionedInstallerName)" |
| 400 | + PackageVersion="$(InstallerPackageVersion)" |
| 401 | + PackageRelease="$(InstallerPackageRelease)" |
| 402 | + PackageOS="$(TargetRuntimeOS)" |
| 403 | + PackageArchitecture="$(InstallerTargetArchitecture)" |
| 404 | + Payload="$(_LayoutDirectory)/payload.cpio" |
| 405 | + RawPayloadFileKinds="@(_RawFileKindInfo)" |
| 406 | + Requires="@(LinuxPackageDependency)" |
| 407 | + Conflicts="@(RpmConflicts)" |
| 408 | + OwnedDirectories="@(RpmOwnedDirectory);@(_GeneratedFileOwnedDirectory)" |
| 409 | + ChangelogLines="- https://github.com/dotnet/core/tree/master/release-notes" |
| 410 | + License="MIT and ASL 2.0 and BSD" |
| 411 | + Summary="$(_ShortDescription)" |
| 412 | + Description="$(_PackageLongDescription)" |
| 413 | + PackageUrl="https://github.com/dotnet/core" |
| 414 | + /> |
| 415 | + |
| 416 | + <Message Text="$(MSBuildProjectName) -> $(_InstallerFile)" Importance="high" /> |
| 417 | + </Target> |
| 418 | + |
| 419 | + <Target Name="CreateRpmUsingFpm" |
317 | 420 | DependsOnTargets=" |
318 | 421 | _GetInstallerProperties; |
319 | 422 | _CreateInstallerLayout; |
|
367 | 470 | UseHardlinksIfPossible="False" /> |
368 | 471 |
|
369 | 472 | <Message Text="$(MSBuildProjectName) -> $(_InstallerFile)" Importance="high" /> |
| 473 | + </Target> |
370 | 474 |
|
| 475 | + <Target Name="_BuildMarinerRpms" |
| 476 | + AfterTargets="GenerateRpm" |
| 477 | + Condition="'$(CreateRPMForCblMariner)' == 'true'"> |
371 | 478 | <!-- CBL-Mariner 1.0 --> |
372 | | - <Copy Condition="'$(CreateRPMForCblMariner)' == 'true'" |
373 | | - SourceFiles="@(GeneratedRpmFiles)" |
| 479 | + <Copy SourceFiles="$(_InstallerFile)" |
374 | 480 | DestinationFiles="$(_InstallerFileCblMariner)" |
375 | 481 | OverwriteReadOnlyFiles="True" |
376 | 482 | SkipUnchangedFiles="False" |
|
379 | 485 | <Message Text="$(MSBuildProjectName) -> $(_InstallerFileCblMariner)" Importance="high" /> |
380 | 486 |
|
381 | 487 | <!-- CBL-Mariner 2.0 --> |
382 | | - <Copy Condition="'$(CreateRPMForCblMariner)' == 'true'" |
383 | | - SourceFiles="@(GeneratedRpmFiles)" |
| 488 | + <Copy SourceFiles="$(_InstallerFile)" |
384 | 489 | DestinationFiles="$(_InstallerFileCblMariner2)" |
385 | 490 | OverwriteReadOnlyFiles="True" |
386 | 491 | SkipUnchangedFiles="False" |
|
0 commit comments