Skip to content

Commit

Permalink
change macro defs
Browse files Browse the repository at this point in the history
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
  • Loading branch information
lsm5 committed Jul 7, 2023
1 parent ee6da8b commit 8e2dba4
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions rpm/crun.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,26 @@

# krun and wasm[edge,time] support only on aarch64 and x86_64
%ifarch aarch64 || x86_64
%global wasm_support enabled
%global wasmedge_support enabled
%global wasm_support 1

# wasmedge only found on Fedora and environments with epel enabled
%if %{defined fedora} || (%{defined copr_project} && "%{copr_project}" == "podman-next")
%global wasmedge_support 1
%global wasmedge_opts --with-wasmedge
%endif

# krun only exists on fedora
%if %{defined fedora}
%global krun_support enabled
%global krun_support 1
%global krun_opts --with-libkrun
%endif

# wasmtime exists only on podman-next copr for now
%if %{defined copr_project} && "%{?copr_project}" == "podman-next"
%global wasmtime_support enabled
%global wasmtime_support 1
%global wasmtime_opts --with-wasmtime
%endif

%endif

Summary: OCI runtime written in C
Expand All @@ -39,7 +46,7 @@ BuildRequires: automake
BuildRequires: gcc
BuildRequires: git-core
BuildRequires: libcap-devel
%if "%{krun_support}" == "enabled"
%if %{defined krun_support}
BuildRequires: libkrun-devel
%endif
BuildRequires: systemd-devel
Expand All @@ -48,10 +55,10 @@ BuildRequires: libseccomp-devel
BuildRequires: python3-libmount
BuildRequires: libtool
BuildRequires: %{_bindir}/go-md2man
%if "%{wasmedge_support}" == "enabled"
%if %{defined wasmedge_support}
BuildRequires: wasmedge-devel
%endif
%if "%{wasmtime_support}" == "enabled"
%if %{defined wasmtime_support}
BuildRequires: wasmtime-c-api-devel
%endif
%if %{defined rhel} && 0%{?rhel} == 8
Expand All @@ -64,7 +71,7 @@ Provides: oci-runtime
%description
%{name} is a OCI runtime

%if "%{krun_support}" == "enabled"
%if %{defined krun_support}
%package krun
Summary: %{name} with libkrun support
Requires: libkrun
Expand All @@ -75,7 +82,7 @@ Provides: krun = %{epoch}:%{version}-%{release}
krun is a symlink to the %{name} binary, with libkrun as an additional dependency.
%endif

%if "%{wasm_support}" == "enabled"
%if %{defined wasm_support}
%package wasm
Summary: %{name} with wasm support
Requires: %{name} = %{epoch}:%{version}-%{release}
Expand All @@ -97,18 +104,18 @@ Recommends: wasmedge
%install
# FIXME: make_install no longer finds files as expected,
# so need to run install steps explicitly
#%%make_install
install -dp %{buildroot}%{_bindir}
install -Dp -m0755 %{name} %{buildroot}%{_bindir}
install -dp %{buildroot}%{_mandir}/man1
install -Dp -m0644 %{name}.1 %{buildroot}%{_mandir}/man1
rm -rf %{buildroot}%{_usr}/lib*

%if "%{krun_support}" == "enabled"
%make_install
#install -dp %%{buildroot}%%{_bindir}
#install -Dp -m0755 %%{name} %%{buildroot}%{_bindir}
#install -dp %%{buildroot}%%{_mandir}/man1
#install -Dp -m0644 %%{name}.1 %%{buildroot}%%{_mandir}/man1
#rm -rf %%{buildroot}%%{_usr}/lib*

%if %{defined krun_support}
ln -s %{_bindir}/%{name} %{buildroot}%{_bindir}/krun
%endif

%if "%{wasm_support}" == "enabled"
%if %{defined wasm_support}
ln -s %{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}-wasm
%endif

Expand All @@ -117,13 +124,13 @@ ln -s %{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}-wasm
%{_bindir}/%{name}
%{_mandir}/man1/*

%if "%{krun_support}" == "enabled"
%if %{defined krun_support}
%files krun
%license COPYING
%{_bindir}/krun
%endif

%if "%{wasm_support}" == "enabled"
%if %{defined wasm_support}
%files wasm
%license COPYING
%{_bindir}/%{name}-wasm
Expand Down

0 comments on commit 8e2dba4

Please sign in to comment.