diff --git a/ci/package-gateway-deb.ps1 b/ci/package-gateway-deb.ps1 deleted file mode 100644 index 99b816e0e..000000000 --- a/ci/package-gateway-deb.ps1 +++ /dev/null @@ -1,143 +0,0 @@ -param( - [string] $Bin, - [parameter(Mandatory = $true)] - [string] $LibxmfFile, - [parameter(Mandatory = $true)] - [string] $WebClientDir, - [parameter(Mandatory = $true)] - [string] $WebPlayerDir, - [parameter(Mandatory = $true)] - [string] $OutputDir -) - -Import-Module (Join-Path $PSScriptRoot 'Build') -. (Join-Path $PSScriptRoot "linux-changelog.ps1") - -# Creates a Debian package for Gateway. Sources are not included. -# -# Usage -# New-GatewayDeb -Bin $Bin -LibXmfFile $LibXmfFile -WebClientDir $WebClientDir -WebPlayerDir $WebPlayerDir -OutputDir $OutputDir -function New-GatewayDeb() { - param( - [parameter(Mandatory = $true)] - # The path to the devolutions-gateway binary. - [string] $Bin, - [parameter(Mandatory = $true)] - # The path to libxmf.so. - [string]$LibxmfFile, - [parameter(Mandatory = $true)] - # The path to the Angular-built web app client. - [string]$WebClientDir, - [parameter(Mandatory = $true)] - # The path to the Angular-built web app player. - [string]$WebPlayerDir, - # The path to the output directory. The intermediate build files will be storedcreated in gateway-deb inside of this output directory. The generated package will be in the root of the output directory. - [parameter(Mandatory = $true)] - [string] $OutputDir - ) - - # Disable dpkg-buildpackage stripping as the binary is already stripped. - $Env:DEB_BUILD_OPTIONS = "nostrip" - - $version = Get-Version - $repoDir = Split-Path -Parent $PSScriptRoot - - # dh_make - & 'dh_make' @('-e', 'bcortier@devolutions.net', - '-n', '-s', '-p', "devolutions-gateway_$version-1", - '-y', '-c', 'custom', - "--copyrightfile=$repoDir/package/Linux/template/copyright") | Out-Host - - # the directory containing intermediate build files related to Debian packaging - $pkgDir = "$OutputDir/gateway-deb" - # the Debian archive folder, a component of a Debian package - $debDir = "$pkgDir/debian" - - if (-not (Test-Path $pkgDir)) { - New-Item -ItemType Directory -Path $pkgDir | Out-Null - Write-Output "Created directory: $pkgDir" - } - if (Test-Path $debDir) { - # Delete all contents of the directory. This is because dh_make will try not to overwrite existing files if it detects the debian subdirectory. - Remove-Item -Path $debDir -Recurse -Force -ErrorAction 'Stop' - # Create - New-Item -ItemType Directory -Path $debDir | Out-Null - Write-Output "Cleared directory: $debDir" - } - else { - New-Item -ItemType Directory -Path $debDir | Out-Null - } - - # debian/docs - Set-Content -Path "$debDir/docs" -Value "" -ErrorAction 'Stop' - - # debian/rules - $generatedUpstreamChangelog = "$pkgDir/upstream_changelog" - Merge-Tokens -TemplateFile 'package/Linux/gateway/template/rules' -Tokens @{ - upstream_changelog = $generatedUpstreamChangelog - } -OutputFile "$debDir/rules" - chmod +x "$debDir/rules" - - # debian/control - - # If the system architecture is aarch64, we assume that the binary is aarch64. - # If the binary path contains `aarch64`, we assume the same. - $nativeTarget = $(Get-NativeTarget $Target).NativeTarget - if ($nativeTarget -Eq 'aarch64-unknown-linux-gnu' -Or $Bin -Like '*aarch64*') { - $arch = 'arm64' # use Debian naming - } - else { - $arch = 'amd64' - } - - Merge-Tokens -TemplateFile 'package/Linux/gateway/template/control' -Tokens @{ - arch = $arch - } -OutputFile "$debDir/control" - - # debian/copyright - Merge-Tokens -TemplateFile 'package/Linux/template/copyright' -Tokens @{ - package = 'devolutions-gateway' - year = $(Get-Date).Year - } -OutputFile $(Join-Path $debDir 'copyright') - - # Upstream changelog. Eventually included as /usr/share/doc/devolutions-gateway/changelog.gz. - $s = New-Changelog ` - -Format 'Deb' ` - -InputFile "$repoDir/CHANGELOG.md" ` - -Packager 'Benoît Cortier' ` - -Email 'bcortier@devolutions.net' ` - -PackageName 'devolutions-gateway' ` - -Distro 'focal' - Set-Content -Path $generatedUpstreamChangelog -Value $s - - # Package changelog. Eventually included as /usr/share/doc/devolutions-gateway/changelog.Debian.gz. - $s = New-Changelog ` - -Format 'Deb' ` - -InputFile 'package/Linux/CHANGELOG.md' ` - -Packager 'Benoît Cortier' ` - -Email 'bcortier@devolutions.net' ` - -PackageName 'devolutions-gateway' ` - -Distro 'focal' - Set-Content -Path "$debDir/changelog" -Value $s - - # Assets to be included in the package. - # These paths must matchpackage/Linux/gateway/debian/install. - - # Copy scripts over. These are the install file, postinst, and service file. - Copy-Item 'package/Linux/gateway/debian' $pkgDir -Recurse -Force -ErrorAction 'Stop' - - Copy-Item $Bin "$pkgDir/devolutions-gateway" -Force -ErrorAction 'Stop' - Copy-Item $WebClientDir $pkgDir -Recurse -Force -ErrorAction 'Stop' - Copy-Item $WebPlayerDir $pkgDir -Recurse -Force -ErrorAction 'Stop' - Copy-Item $LibxmfFile $pkgDir -Force -ErrorAction 'Stop' - - Push-Location - Set-Location $pkgDir - # Change into the package directory. dpkg-buildpackage will output the package in the parent directory. - & 'dpkg-buildpackage' @('-b', '-us', '-uc', '-a', $arch) - Pop-Location -} - -New-GatewayDeb -Bin $Bin -LibXmfFile $LibXmfFile -WebClientDir $WebClientDir -WebPlayerDir $WebPlayerDir -OutputDir $OutputDir - - diff --git a/ci/package-gateway-rpm.ps1 b/ci/package-gateway-rpm.ps1 deleted file mode 100644 index 508fc6e6f..000000000 --- a/ci/package-gateway-rpm.ps1 +++ /dev/null @@ -1,94 +0,0 @@ -param( - [string] $Bin, - [parameter(Mandatory = $true)] - [string]$LibxmfFile, - [parameter(Mandatory = $true)] - [string]$WebClientDir, - [parameter(Mandatory = $true)] - [string]$WebPlayerDir, - [parameter(Mandatory = $true)] - [string] $OutputDir -) - -Import-Module (Join-Path $PSScriptRoot 'Build') -. (Join-Path $PSScriptRoot "linux-changelog.ps1") - -# Creates an RPM package for Gateway. Sources are not included. -# -# Usage -# New-GatewayRpm -Bin $Bin -LibXmfFile $LibXmfFile -WebClientDir $WebClientDir -WebPlayerDir $WebPlayerDir -OutputDir $OutputDir -function New-GatewayRpm() { - param( - [parameter(Mandatory = $true)] - # The path to the devolutions-gateway binary. - [string] $Bin, - [parameter(Mandatory = $true)] - # The path to libxmf.so. - [string]$LibxmfFile, - [parameter(Mandatory = $true)] - # The path to the Angular-built web app client. - [string]$WebClientDir, - [parameter(Mandatory = $true)] - # The path to the Angular-built web app player. - [string]$WebPlayerDir, - # The path to the output directory. The intermediate build files will be storedcreated in gateway-rpm inside of this output directory. The generated package will be in the root of the output directory. - [parameter(Mandatory = $true)] - [string] $OutputDir - ) - - $version = Get-Version - $repoDir = Split-Path -Parent $PSScriptRoot - $pkgDir = "$OutputDir/gateway-rpm" - - if (-not (Test-Path $pkgDir)) { - New-Item -ItemType Directory -Path $pkgDir | Out-Null - Write-Output "Created directory: $pkgDir" - } - - $generatedUpstreamChangelog = "$pkgDir/upstream_changelog" - $s = New-Changelog -Format 'RpmUpstream' -InputFile "$repoDir/CHANGELOG.md" -Packager 'Benoît Cortier' -Email 'bcortier@devolutions.net' - Set-Content -Path $generatedUpstreamChangelog -Value $s - - $pkgChangelog = "$pkgDir/packaging_changelog" - $s = New-Changelog -Format 'RpmPackaging' -InputFile 'package/Linux/CHANGELOG.md' -Packager 'Benoît Cortier' -Email 'bcortier@devolutions.net' - Set-Content -Path $pkgChangelog -Value $s - - "Copyright $($(Get-Date).Year) Devolutions Inc. All rights reserved." | Set-Content -Path "$pkgDir/copyright" - - $args = @( - '--force' - '--verbose' - '-s', 'dir' - '-t', 'rpm' - '-p', "$OutputDir/devolutions-gateway_$version-1.rpm" - '-n', 'devolutions-gateway' - '-v', $version - '-d', 'glibc' - '--maintainer', 'Benoît Cortier ' - '--description', 'Blazing fast relay server with desired levels of traffic inspection' - '--url', 'https://devolutions.net' - '--license', 'Apache-2.0 OR MIT' - '--rpm-attr', '755,root,root:/usr/bin/devolutions-gateway' - '--rpm-attr', '644,root,root:/usr/lib/systemd/system/devolutions-gateway.service' - '--rpm-attr', '644,root,root:/usr/lib/systemd/system-preset/85-devolutions-gateway.preset' - '--rpm-changelog', $pkgChangelog - '--after-install', 'package/Linux/gateway/rpm/postinst' - '--before-remove', 'package/Linux/gateway/rpm/prerm' - '--after-remove', 'package/Linux/gateway/rpm/postrm' - '--' - "$Bin=/usr/bin/devolutions-gateway" - 'package/Linux/gateway/rpm/service=/usr/lib/systemd/system/devolutions-gateway.service' - 'package/Linux/gateway/rpm/preset=/usr/lib/systemd/system-preset/85-devolutions-gateway.preset' - "$generatedUpstreamChangelog=/usr/share/doc/devolutions-gateway/ChangeLog" - "$pkgDir/copyright=/usr/share/doc/devolutions-gateway/copyright" - "$LibxmfFile=/usr/lib/devolutions-gateway/libxmf.so" - "$WebClientDir/=/usr/share/devolutions-gateway/webapp/client" - "$WebPlayerDir/=/usr/share/devolutions-gateway/webapp/player" - ) - & 'fpm' @args | Out-Host -} - -New-GatewayRpm -Bin $Bin -LibXmfFile $LibXmfFile -WebClientDir $WebClientDir -WebPlayerDir $WebPlayerDir -OutputDir $OutputDir - - - diff --git a/ci/tlk.ps1 b/ci/tlk.ps1 index 3175bc92a..aea068edf 100755 --- a/ci/tlk.ps1 +++ b/ci/tlk.ps1 @@ -756,17 +756,12 @@ class TlkRecipe $RulesFile = Join-Path $OutputDebianPath "rules" $RulesTemplate = Join-Path $InputPackagePath "$($this.Product)/template/rules" - $DhShLibDepsOverride = ""; - if ($this.Target.DebianArchitecture() -Eq "amd64") { - $DhShLibDepsOverride = "dh_shlibdeps" - } - $DebUpstreamChangelogFile = Join-Path $OutputPath "changelog_deb_upstream" Merge-Tokens -TemplateFile $RulesTemplate -Tokens @{ - dh_shlibdeps = $DhShLibDepsOverride upstream_changelog = $DebUpstreamChangelogFile } -OutputFile $RulesFile + chmod +x $RulesFile # debian/control $ControlFile = Join-Path $OutputDebianPath "control" @@ -886,10 +881,13 @@ class TlkRecipe '--after-remove', "$InputPackagePath/$($this.Product)/rpm/postrm" ) + $RpmCopyrightFile = Join-Path $OutputPath "copyright_rpm" + "Copyright $($(Get-Date).Year) Devolutions Inc. All rights reserved." | Set-Content -Path $RpmCopyrightFile + $FpmFiles = @( "$Executable=/usr/bin/$PkgName" "$RpmUpstreamChangelogFile=/usr/share/doc/$PkgName/ChangeLog" - "$CopyrightFile=/usr/share/doc/$PkgName/copyright" + "$RpmCopyrightFile=/usr/share/doc/$PkgName/copyright" ) if ($this.Product -eq "gateway") { diff --git a/package/AgentLinux/agent/template/rules b/package/AgentLinux/agent/template/rules index 5c72f4c40..6ad85859b 100644 --- a/package/AgentLinux/agent/template/rules +++ b/package/AgentLinux/agent/template/rules @@ -4,7 +4,6 @@ dh $@ override_dh_shlibdeps: - {{ dh_shlibdeps }} override_dh_installchangelogs: dh_installchangelogs {{ upstream_changelog }} \ No newline at end of file diff --git a/package/Linux/gateway/template/rules b/package/Linux/gateway/template/rules index bcb9af569..de30ece64 100644 --- a/package/Linux/gateway/template/rules +++ b/package/Linux/gateway/template/rules @@ -4,7 +4,6 @@ dh $@ override_dh_shlibdeps: - {{ dh_shlibdeps }} override_dh_installchangelogs: dh_installchangelogs {{ upstream_changelog }}