File powershell-libpsrpclient.spec of Package powershell-libpsrpclient

# spec file for package powershell-libpsrpclient
# 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

Name:           powershell-libpsrpclient
Release:        0
Summary:        Powershell remoting library that works
License:        MIT
Group:          System/Libraries
Source0:        %{name}-%{version}.tar.gz
Patch0:         basic-auth-fix.patch
Patch1:         include-fix.patch
Patch2:         cpp11-ptr-fix.patch
BuildRequires:  cmake
BuildRequires:  pkg-config
BuildRequires:  lsb-release
BuildRequires:  libopenssl-devel
BuildRequires:  pam-devel
BuildRequires:  krb5-devel
BuildRequires:  openssl
BuildRequires:  gcc-c++
BuildRequires:  powershell
%if 0%{?is_opensuse}
BuildRequires:  openSUSE-release
BuildRequires:  sles-release
Requires:       powershell

%define psdir /opt/microsoft/powershell/

Powershell remoting library that works.

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1

mkdir bin
    cd bin
    echo '#!/bin/sh' >> sudo
    echo 'p="$1"'    >> sudo
    echo 'shift'     >> sudo
    echo '"$p" "$@"' >> sudo
    chmod +x sudo;
export PATH="$(pwd)/bin:$PATH"
make debug


install -dm 755 %{buildroot}%{psdir}/preload
find -iname '*.so' -exec install -m 644 {} %{buildroot}%{psdir}/preload \;

cd %{buildroot}%{psdir}/preload
# powershell looks for liblib...
ln -s