powershell: do fully offline build

Change-Id: I52c40e702dfabe261092bda5c0488d0366529234
Signed-off-by: Shreenidhi Shedi <shreenidhi.shedi@broadcom.com>
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/c/photon/+/24528
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Reviewed-by: Vamsi Krishna Brahmajosyula <vamsi-krishna.brahmajosyula@broadcom.com>
Reviewed-on: http://photon-gerrit.lvn.broadcom.net/c/photon/+/24727
Reviewed-by: <mukul.sikka@broadcom.com>
Tested-by: <mukul.sikka@broadcom.com>
This commit is contained in:
Shreenidhi Shedi 2024-09-04 17:13:44 +05:30 committed by Ankit Jain
parent 3d055bb082
commit 363f801f86
2 changed files with 25 additions and 7 deletions

View File

@ -7,8 +7,8 @@ set -ex
# See https://github.com/PowerShell/PowerShell/blob/master/docs/building/internals.md
mkdir -p /usr/lib/dotnet/sdk-manifests
for f in src/powershell-unix src/ResGen src/TypeCatalogGen; do
dotnet restore $f
for f in powershell-unix ResGen TypeCatalogGen; do
dotnet restore src/${f} -s ${HOME}/.nuget
done
pushd src/ResGen
@ -25,13 +25,17 @@ dotnet run ../System.Management.Automation/CoreCLR/CorePsTypeCatalog.cs powershe
popd
touch DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
dotnet publish /property:GenerateFullPaths=true --configuration Linux --framework net8.0 --runtime linux-x64 src/powershell-unix --output bin
dotnet publish /property:GenerateFullPaths=true \
--configuration Linux \
--framework net8.0 \
--runtime linux-x64 \
--output bin \
--no-restore \
src/powershell-unix
# Even after powershell rpm built, dotnet processes are alive, following to stop them:
for pid in $(pgrep dotnet); do
if [ -n "${pid}" ]; then
if kill -0 "${pid}"; then
kill -15 "${pid}"
fi
kill -0 "${pid}" && kill -TERM "${pid}" || :
fi
done

View File

@ -4,7 +4,7 @@
Summary: PowerShell is an automation and configuration management platform.
Name: powershell
Version: 7.4.3
Release: 1%{?dist}
Release: 2%{?dist}
Vendor: VMware, Inc.
Distribution: Photon
License: MIT
@ -45,6 +45,14 @@ Source4: Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets
Source5: omi-%{libmi_tag}.tar.gz
%define sha512 omi-%{libmi_tag}=73b60237173079707de8dbab29c3225643a8bf262348911724d542409b674f0a6593b046b87801e6998b0aad50b8dfe14748a2a6de115564e129bbb035b76759
# After extracting Powershell original archive (Source0 in this spec), run:
# dotnet restore .
# Then archive $HOME/.nuget directory
# mv $HOME/.nuget <NAME>-<VERSION>-nuget-deps
# tar cJf <NAME>-<VERSION>-nuget-deps.tar.xz <NAME>-<VERSION>-nuget-deps
Source6: %{name}-%{version}-nuget-deps.tar.xz
%define sha512 %{name}-%{version}-nuget-deps=85fc3a9607a164cc851fc6bc5f91ca45983e1f2ad73ecbbc4755ed874c0632ab203fb859e1dc0854e36aa47c03d04612de0099f764aa3d3c78abd2d5dbdf49c2
BuildArch: x86_64
BuildRequires: dotnet-sdk
@ -85,6 +93,10 @@ It consists of a cross-platform command-line shell and associated scripting lang
# Using autosetup is not feasible
%setup -qcTDa 5 -n omi
tar xf %{SOURCE6}
rm -rf ${HOME}/.nuget
mv %{name}-%{version}-nuget-deps ${HOME}/.nuget
%build
# Build libmi
pushd %{_builddir}/omi/omi-%{libmi_tag}/Unix
@ -161,6 +173,8 @@ fi
%{_docdir}/*
%changelog
* Wed Sep 04 2024 Shreenidhi Shedi <shreenidhi.shedi@broadcom.com> 7.4.3-2
- Do fully offline build
* Thu Jul 11 2024 Shreenidhi Shedi <shreenidhi.shedi@broadcom.com> 7.4.3-1
- Upgrade to v7.4.3
* Thu Jan 11 2024 Anmol Jain <anmolja@vmware.com> 7.4.1-1