@@ -30,7 +30,7 @@ function Start-PSPackage {
30
30
[Switch ] $Force ,
31
31
32
32
[Switch ] $IncludeSymbols ,
33
-
33
+
34
34
[Switch ] $SkipReleaseChecks
35
35
)
36
36
@@ -43,11 +43,9 @@ function Start-PSPackage {
43
43
New-PSOptions - Configuration " Release" - WarningAction SilentlyContinue | ForEach-Object { $_.Runtime , $_.Configuration }
44
44
}
45
45
46
- # We convert the runtime to win7-x64 or win7-x86 to build the universal windows package.
47
46
if ($Environment.IsWindows ) {
48
- $Runtime = $Runtime -replace " win\d+" , " win7"
49
-
50
- # Build the name suffix for win-plat packages
47
+ # Runtime will always be win7-x64 or win7-x86 on Windows.
48
+ # Build the name suffix for universal win-plat packages.
51
49
$NameSuffix = $Runtime -replace ' win\d+' , ' win'
52
50
}
53
51
@@ -134,7 +132,7 @@ function Start-PSPackage {
134
132
}
135
133
log " Packaging Type: $Type "
136
134
137
- # Add the symbols to the suffix
135
+ # Add the symbols to the suffix
138
136
# if symbols are specified to be included
139
137
if ($IncludeSymbols.IsPresent -and $NameSuffix ) {
140
138
$NameSuffix = " symbols-$NameSuffix "
@@ -186,7 +184,7 @@ function Start-PSPackage {
186
184
{
187
185
throw " AppImage does not support packaging '-IncludeSymbols'"
188
186
}
189
-
187
+
190
188
if ($Environment.IsUbuntu14 ) {
191
189
$null = Start-NativeExecution { bash - iex " $PSScriptRoot /../appimage.sh" }
192
190
$appImage = Get-Item PowerShell-* .AppImage
@@ -248,10 +246,6 @@ function New-UnixPackage {
248
246
[Parameter (Mandatory )]
249
247
[string ]$Version ,
250
248
251
- # Package iteration version (rarely changed)
252
- # This is a string because strings are appended to it
253
- [string ]$Iteration = " 1" ,
254
-
255
249
[Switch ]
256
250
$Force
257
251
)
@@ -260,14 +254,14 @@ function New-UnixPackage {
260
254
$ErrorMessage = " Must be on {0} to build '$Type ' packages!"
261
255
switch ($Type ) {
262
256
" deb" {
263
- $WarningMessage = " Building for Ubuntu {0}.04!"
257
+ $verboseMsg = " Building for Ubuntu {0}.04!"
264
258
if (! $Environment.IsUbuntu ) {
265
- throw ($ErrorMessage -f " Ubuntu" )
266
- } elseif ($Environment.IsUbuntu14 ) {
267
- Write-Warning ($WarningMessage -f " 14" )
268
- } elseif ($Environment.IsUbuntu16 ) {
269
- Write-Warning ($WarningMessage -f " 16" )
270
- }
259
+ throw ($ErrorMessage -f " Ubuntu" )
260
+ } elseif ($Environment.IsUbuntu14 ) {
261
+ Write-Verbose ($verboseMsg -f " 14" )
262
+ } elseif ($Environment.IsUbuntu16 ) {
263
+ Write-Verbose ($verboseMsg -f " 16" )
264
+ }
271
265
}
272
266
" rpm" {
273
267
if (! $Environment.IsRedHatFamily ) {
@@ -309,7 +303,7 @@ function New-UnixPackage {
309
303
# Suffix is used for side-by-side package installation
310
304
$Suffix = $Name -replace " ^powershell"
311
305
if (! $Suffix ) {
312
- Write-Warning " Suffix not given, building primary PowerShell package!"
306
+ Write-Verbose " Suffix not given, building primary PowerShell package!"
313
307
$Suffix = $Version
314
308
}
315
309
@@ -408,73 +402,28 @@ function New-UnixPackage {
408
402
" libc6" ,
409
403
" libcurl3" ,
410
404
" libgcc1" ,
411
- " libssl1.0.0" ,
405
+ " libgssapi-krb5-2" ,
406
+ " liblttng-ust0" ,
412
407
" libstdc++6" ,
413
- " libtinfo5" ,
414
408
" libunwind8" ,
415
409
" libuuid1" ,
416
- " zlib1g"
410
+ " zlib1g" ,
411
+ " libssl1.0.0" ,
412
+ " libicu-dev"
417
413
)
418
- # Please note the different libicu package dependency!
419
- if ($Environment.IsUbuntu14 ) {
420
- $Dependencies += " libicu52"
421
- } elseif ($Environment.IsUbuntu16 ) {
422
- $Dependencies += " libicu55"
423
- }
424
414
} elseif ($Environment.IsRedHatFamily ) {
425
415
$Dependencies = @ (
426
- " glibc" ,
427
- " libicu" ,
428
- " openssl" ,
429
416
" libunwind" ,
430
- " uuid" ,
431
- " zlib"
417
+ " libcurl" ,
418
+ " openssl-libs" ,
419
+ " libicu"
432
420
)
433
-
434
- if ($Environment.IsFedora -or $Environment.IsCentOS )
435
- {
436
- $Dependencies += " libcurl"
437
- $Dependencies += " libgcc"
438
- $Dependencies += " libstdc++"
439
- $Dependencies += " ncurses-base"
440
- }
441
-
442
- if ($Environment.IsOpenSUSE )
443
- {
444
- $Dependencies += " libgcc_s1"
445
- $Dependencies += " libstdc++6"
446
- }
447
- }
448
-
449
- # iteration is "debian_revision"
450
- # usage of this to differentiate distributions is allowed by non-standard
451
- if ($Environment.IsUbuntu14 ) {
452
- $Iteration += " ubuntu1.14.04.1"
453
- } elseif ($Environment.IsUbuntu16 ) {
454
- $Iteration += " ubuntu1.16.04.1"
455
- }
456
-
457
- # We currently only support:
458
- # CentOS 7
459
- # Fedora 24+
460
- # OpenSUSE 42.1 (13.2 might build but is EOL)
461
- # Also SEE: https://fedoraproject.org/wiki/Packaging:DistTag
462
- if ($Environment.IsCentOS ) {
463
- $rpm_dist = " el7"
464
- } elseif ($Environment.IsFedora ) {
465
- $version_id = $Environment.LinuxInfo.VERSION_ID
466
- $rpm_dist = " fedora.$version_id "
467
- } elseif ($Environment.IsOpenSUSE ) {
468
- $version_id = $Environment.LinuxInfo.VERSION_ID
469
- $rpm_dist = " suse.$version_id "
470
421
}
471
422
472
-
473
423
$Arguments = @ (
474
424
" --force" , " --verbose" ,
475
425
" --name" , $Name ,
476
426
" --version" , $Version ,
477
- " --iteration" , $Iteration ,
478
427
" --maintainer" , " PowerShell Team <[email protected] >" ,
479
428
" --vendor" , " Microsoft Corporation" ,
480
429
" --url" , " https://microsoft.com/powershell" ,
@@ -485,7 +434,7 @@ function New-UnixPackage {
485
434
" -s" , " dir"
486
435
)
487
436
if ($Environment.IsRedHatFamily ) {
488
- $Arguments += @ (" --rpm-dist" , $rpm_dist )
437
+ $Arguments += @ (" --rpm-dist" , " rhel.7 " )
489
438
$Arguments += @ (" --rpm-os" , " linux" )
490
439
}
491
440
foreach ($Dependency in $Dependencies ) {
@@ -504,8 +453,7 @@ function New-UnixPackage {
504
453
)
505
454
# Build package
506
455
try {
507
- if ($pscmdlet.ShouldProcess (" Create $type package" ))
508
- {
456
+ if ($pscmdlet.ShouldProcess (" Create $type package" )) {
509
457
$Output = Start-NativeExecution { fpm $Arguments }
510
458
}
511
459
} finally {
0 commit comments