Modify openwsman.spec to allow flatpak builds
This commit is contained in:
parent
38d5a113e7
commit
ab115b7b54
@ -2,9 +2,26 @@
|
||||
%global gem_name %{name}
|
||||
|
||||
# defining macros needed by SELinux
|
||||
# unless running a flatpak build.
|
||||
%if 0%{?flatpak}
|
||||
%global with_selinux 0
|
||||
%else
|
||||
%global with_selinux 1
|
||||
%global selinuxtype targeted
|
||||
%global modulename openwsman
|
||||
%endif
|
||||
|
||||
# Bindings install in the wrong path for a flatpak build; this could be fixed, but
|
||||
# we don't currently need the bindings for any Flatpak'ed application
|
||||
%if 0%{?flatpak}
|
||||
%global with_ruby 0
|
||||
%global with_perl 0
|
||||
%global with_python 0
|
||||
%else
|
||||
%global with_ruby 1
|
||||
%global with_perl 1
|
||||
%global with_python 1
|
||||
%endif
|
||||
|
||||
Name: openwsman
|
||||
Version: 2.7.1
|
||||
@ -22,19 +39,29 @@ Source2: openwsmand.service
|
||||
Source3: owsmantestcert.sh
|
||||
# Source100-102: selinux policy for openwsman, extracted
|
||||
# from https://github.com/fedora-selinux/selinux-policy
|
||||
%if 0%{with_selinux}
|
||||
Source100: %{modulename}.te
|
||||
Source101: %{modulename}.if
|
||||
Source102: %{modulename}.fc
|
||||
%endif
|
||||
Patch1: openwsman-2.4.0-pamsetup.patch
|
||||
Patch2: openwsman-2.4.12-ruby-binding-build.patch
|
||||
Patch3: openwsman-2.6.2-openssl-1.1-fix.patch
|
||||
Patch4: openwsman-2.6.5-http-status-line.patch
|
||||
Patch5: openwsman-2.6.8-update-ssleay-conf.patch
|
||||
BuildRequires: make
|
||||
BuildRequires: make
|
||||
BuildRequires: swig
|
||||
BuildRequires: libcurl-devel libxml2-devel pam-devel sblim-sfcc-devel
|
||||
BuildRequires: python3 python3-devel ruby ruby-devel rubygems-devel perl-interpreter
|
||||
BuildRequires: perl-devel perl-generators pkgconfig openssl-devel
|
||||
%if %{with_python}
|
||||
BuildRequires: python3 python3-devel
|
||||
%endif
|
||||
%if %{with_ruby}
|
||||
BuildRequires: ruby ruby-devel rubygems-devel
|
||||
%endif
|
||||
%if %{with_perl}
|
||||
BuildRequires: perl-interpreter perl-devel perl-generators
|
||||
%endif
|
||||
BuildRequires: pkgconfig openssl-devel
|
||||
BuildRequires: cmake
|
||||
BuildRequires: systemd-units
|
||||
BuildRequires: gcc gcc-c++
|
||||
@ -91,6 +118,7 @@ Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
|
||||
%description server
|
||||
Openwsman Server and service libraries.
|
||||
|
||||
%if %{with_python}
|
||||
%package python3
|
||||
License: BSD
|
||||
Summary: Python bindings for openwsman client API
|
||||
@ -100,7 +128,9 @@ Requires: libwsman1 = %{version}-%{release}
|
||||
|
||||
%description python3
|
||||
This package provides Python3 bindings to access the openwsman client API.
|
||||
%endif
|
||||
|
||||
%if %{with_ruby}
|
||||
%package -n rubygem-%{gem_name}
|
||||
License: BSD
|
||||
Summary: Ruby client bindings for Openwsman
|
||||
@ -118,7 +148,9 @@ BuildArch: noarch
|
||||
|
||||
%description -n rubygem-%{gem_name}-doc
|
||||
Documentation for rubygem-%{gem_name}
|
||||
%endif
|
||||
|
||||
%if %{with_perl}
|
||||
%package perl
|
||||
License: BSD
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||
@ -127,6 +159,7 @@ Requires: libwsman1 = %{version}-%{release}
|
||||
|
||||
%description perl
|
||||
This package provides Perl bindings to access the openwsman client API.
|
||||
%endif
|
||||
|
||||
%package winrs
|
||||
Summary: Windows Remote Shell
|
||||
@ -171,7 +204,7 @@ export CFLAGS="$RPM_OPT_FLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"
|
||||
export CXXFLAGS="$RPM_OPT_FLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"
|
||||
cd build
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_FLAGS_RELEASE:STRING="$RPM_OPT_FLAGS -fno-strict-aliasing" \
|
||||
@ -181,10 +214,20 @@ cmake \
|
||||
-DLIB=%{_lib} \
|
||||
-DBUILD_JAVA=no \
|
||||
-DBUILD_PYTHON=no \
|
||||
%if ! %{with_python}
|
||||
-DBUILD_PYTHON3=no \
|
||||
%endif
|
||||
%if ! %{with_perl}
|
||||
-DBUILD_PERL=no \
|
||||
%endif
|
||||
%if ! %{with_ruby}
|
||||
-DBUILD_RUBY=no \
|
||||
%endif
|
||||
..
|
||||
|
||||
make
|
||||
|
||||
%if %{with_ruby}
|
||||
# Make the freshly build openwsman libraries available to build the gem's
|
||||
# binary extension.
|
||||
export LIBRARY_PATH=%{_builddir}/%{name}-%{version}/build/src/lib
|
||||
@ -192,6 +235,7 @@ export CPATH=%{_builddir}/%{name}-%{version}/include/
|
||||
export LD_LIBRARY_PATH=%{_builddir}/%{name}-%{version}/build/src/lib/
|
||||
|
||||
%gem_install -n ./bindings/ruby/%{name}-%{version}.gem
|
||||
%endif
|
||||
|
||||
%if 0%{?with_selinux}
|
||||
# SELinux policy (originally from selinux-policy-contrib)
|
||||
@ -205,16 +249,20 @@ bzip2 -9 %{modulename}.pp
|
||||
%install
|
||||
cd build
|
||||
|
||||
%if %{with_ruby}
|
||||
# Do not install the ruby extension, we are proviging the rubygem- instead.
|
||||
echo -n > bindings/ruby/cmake_install.cmake
|
||||
%endif
|
||||
|
||||
%make_install
|
||||
cd ..
|
||||
rm -f %{buildroot}/%{_libdir}/*.la
|
||||
rm -f %{buildroot}/%{_libdir}/openwsman/plugins/*.la
|
||||
rm -f %{buildroot}/%{_libdir}/openwsman/authenticators/*.la
|
||||
%if %{with_ruby}
|
||||
[ -d %{buildroot}/%{ruby_vendorlibdir} ] && rm -f %{buildroot}/%{ruby_vendorlibdir}/openwsmanplugin.rb
|
||||
[ -d %{buildroot}/%{ruby_vendorlibdir} ] && rm -f %{buildroot}/%{ruby_vendorlibdir}/openwsman.rb
|
||||
%endif
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
||||
install -m 644 etc/openwsman.conf %{buildroot}/%{_sysconfdir}/openwsman
|
||||
install -m 644 etc/openwsman_client.conf %{buildroot}/%{_sysconfdir}/openwsman
|
||||
@ -230,6 +278,7 @@ install -m 644 include/wsman-xml.h %{buildroot}/%{_includedir}/openwsman
|
||||
install -m 644 include/wsman-xml-binding.h %{buildroot}/%{_includedir}/openwsman
|
||||
install -m 644 include/wsman-dispatcher.h %{buildroot}/%{_includedir}/openwsman
|
||||
|
||||
%if %{with_ruby}
|
||||
mkdir -p %{buildroot}%{gem_dir}
|
||||
cp -pa ./build%{gem_dir}/* \
|
||||
%{buildroot}%{gem_dir}/
|
||||
@ -238,6 +287,7 @@ rm -rf %{buildroot}%{gem_instdir}/ext
|
||||
|
||||
mkdir -p %{buildroot}%{gem_extdir_mri}
|
||||
cp -a ./build%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
|
||||
%endif
|
||||
|
||||
%if 0%{?with_selinux}
|
||||
install -D -m 0644 build/%{modulename}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
|
||||
@ -294,12 +344,15 @@ fi
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_libdir}/*.so
|
||||
|
||||
%if %{with_python}
|
||||
%files python3
|
||||
%doc AUTHORS COPYING ChangeLog README.md
|
||||
%{python3_sitearch}/*.so
|
||||
%{python3_sitearch}/*.py
|
||||
%{python3_sitearch}/__pycache__/*
|
||||
%endif
|
||||
|
||||
%if %{with_ruby}
|
||||
%files -n rubygem-%{gem_name}
|
||||
%doc AUTHORS COPYING ChangeLog README.md
|
||||
%dir %{gem_instdir}
|
||||
@ -307,14 +360,19 @@ fi
|
||||
%{gem_extdir_mri}
|
||||
%exclude %{gem_cache}
|
||||
%{gem_spec}
|
||||
%endif
|
||||
|
||||
%if %{with_ruby}
|
||||
%files -n rubygem-%{gem_name}-doc
|
||||
%doc %{gem_docdir}
|
||||
%endif
|
||||
|
||||
%if %{with_perl}
|
||||
%files perl
|
||||
%doc AUTHORS COPYING ChangeLog README.md
|
||||
%{perl_vendorarch}/openwsman.so
|
||||
%{perl_vendorlib}/openwsman.pm
|
||||
%endif
|
||||
|
||||
%files server
|
||||
%doc AUTHORS COPYING ChangeLog README.md
|
||||
|
Loading…
Reference in New Issue
Block a user