File powershell75.spec of Package powershell75
#
# spec file for package powershell75
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define realver %{version}
%define pkgver 75
%define psdir /opt/microsoft/powershell/%{pkgver}
Name: powershell%{pkgver}
Version: 7.5.4
Release: 0
Summary: Pre-built Microsoft Powershell from Github - 7.5.x branch
License: MIT
Group: System/Shells
URL: https://github.com/PowerShell/PowerShell/
Source: https://github.com/PowerShell/PowerShell/releases/download/v%{realver}/powershell-%{realver}-linux-x64.tar.gz
Source1: pwsh-wrapper.sh
Source99: %{name}-rpmlintrc
Requires: libicu78
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: gssntlmssp
ExclusiveArch: x86_64
# !!!!
#$ sudo zypper install powershell75
#Repository-Daten werden geladen...
#Installierte Pakete werden gelesen...
#Paketabhängigkeiten werden aufgelöst...
#
#Problem: 1: nichts stellt 'liblttng-ust.so.0()(64bit)' bereit, das vom zu installierenden powershell74-7.4.2-2.2.x86_64 benötigt wird
# Lösung 1: powershell74-7.4.2-2.2.x86_64 nicht installieren
# Lösung 2: powershell74-7.4.2-2.2.x86_64 durch Ignorieren einiger Abhängigkeiten brechen
## workaround
# mit lttng-ust 2.12.0 wurde ein sobump gemacht
#Refs: v2.12.0-rc1-164-g05e8ff1f
#Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#AuthorDate: Tue Feb 23 15:31:48 2021 -0500
#Commit: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
#CommitDate: Wed Feb 24 10:23:18 2021 -0500
#
# Bump soname major to 1
# -> alte version von lttng-ustinstallieren (OBS rev 38)
# https://build.opensuse.org/projects/devel:tools:lttng/packages/lttng-ust/files/lttng-ust.spec?expand=0&rev=81b7e14693db145cff1a1323add9a487
%description
Pre-built Microsoft Powershell 7.5.x from Github.
%prep
mkdir out
cd out
tar xf %{SOURCE0}
%build
# tarball is pre-built
true
%install
install -dm 755 %{buildroot}%{psdir}
install -dm 755 %{buildroot}%{psdir}/preload
install -dm 755 %{buildroot}%{_bindir}
sed s,@@psdir@@,%{psdir},g %{SOURCE1} > pwsh%{pkgver}
install -m 755 pwsh%{pkgver} %{buildroot}%{_bindir}/pwsh%{pkgver}
cd out
cp -arv * %{buildroot}%{psdir}
chmod 755 %{buildroot}%{psdir}/pwsh
##
#rm -v %%{buildroot}%%{psdir}/libcrypto.so.1.0.0
#rm -v %%{buildroot}%%{psdir}/libssl.so.1.0.0
# create a dummy target for /etc/alternatives/pwsh
install -d %{buildroot}%{_sysconfdir}/alternatives
ln -sf %{_sysconfdir}/alternatives/pwsh %{buildroot}%{_bindir}/pwsh
%post
update-alternatives --install \
%{_bindir}/pwsh pwsh %{_bindir}/pwsh%{pkgver} %{pkgver}
%postun
if [ ! -f %{_bindir}/pwsh%{pkgver} ] ; then
update-alternatives --remove pwsh %{_bindir}/pwsh%{pkgver}
fi
%files
%dir /opt/microsoft
%dir /opt/microsoft/powershell
%{psdir}
%{_bindir}/pwsh%{pkgver}
%{_bindir}/pwsh
%ghost %{_sysconfdir}/alternatives/pwsh
%changelog