Blame zellij.spec

457602
#
457602
# spec file for package zellij
457602
#
Bernhard M. Wiedemann 1847a5
# Copyright (c) 2024 SUSE LLC
457602
#
457602
# All modifications and additions to the file contributed by third parties
457602
# remain the property of their copyright owners, unless otherwise agreed
457602
# upon. The license for this file, and modifications and additions to the
457602
# file, is the same license as for the pristine package itself (unless the
457602
# license for the pristine package is not an Open Source License, in which
457602
# case the license is the MIT License). An "Open Source License" is a
457602
# license that conforms to the Open Source Definition (Version 1.9)
457602
# published by the Open Source Initiative.
457602
457602
# Please submit bugfixes or comments via https://bugs.opensuse.org/
457602
#
457602
7a6c0f
b0eeaf
%if "x%{?rust_tier1_arches}" == "x"
b0eeaf
%global rust_tier1_arches x86_64
b0eeaf
%endif
b0eeaf
457602
%bcond_with     test
457602
Name:           zellij
82f60a
Version:        0.40.0
457602
Release:        0
7a6c0f
Summary:        Terminal workspace with batteries included
457602
License:        MIT
457602
URL:            https://github.com/zellij-org/zellij
9ccdf4
Source0:        https://github.com/zellij-org/zellij/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
9ccdf4
Source1:        vendor.tar.zst
Bernhard M. Wiedemann 1847a5
Source2:        README.suse-maint.md
209077
BuildRequires:  cargo
457602
BuildRequires:  cargo-packaging
9ccdf4
BuildRequires:  zstd
7b0c4b
%if 0%{?suse_version} > 1500
7b0c4b
BuildRequires:  mandown
7b0c4b
%endif
7b0c4b
457602
ExclusiveArch:  %{rust_tier1_arches}
457602
%if %{with test}
457602
BuildRequires:  pkgconfig(openssl)
457602
%endif
457602
457602
%description
7a6c0f
Zellij is a workspace aimed at developers, ops-oriented people and anyone who loves the terminal.
7a6c0f
At its core, it is a terminal multiplexer (similar to tmux and screen), but this is merely its
457602
infrastructure layer.
457602
7a6c0f
Zellij includes a layout system, and a plugin system allowing one to create plugins in any
457602
language that compiles to WebAssembly.
457602
7b0c4b
%package bash-completion
7b0c4b
Summary:        Bash Completion for %{name}
7b0c4b
Group:          System/Shells
7b0c4b
Supplements:    (%{name} and bash-completion)
7b0c4b
Requires:       bash-completion
7b0c4b
BuildArch:      noarch
7b0c4b
7b0c4b
%description bash-completion
7b0c4b
Bash command-line completion support for %{name}.
7b0c4b
7b0c4b
%package fish-completion
7b0c4b
Summary:        Fish Completion for %{name}
7b0c4b
Group:          System/Shells
7b0c4b
Supplements:    (%{name} and fish)
7b0c4b
Requires:       fish
7b0c4b
BuildArch:      noarch
7b0c4b
7b0c4b
%description fish-completion
7b0c4b
Fish command-line completion support for %{name}.
7b0c4b
7b0c4b
%package zsh-completion
7b0c4b
Summary:        Zsh Completion for %{name}
7b0c4b
Group:          System/Shells
7b0c4b
Supplements:    (%{name} and zsh)
7b0c4b
Requires:       zsh
7b0c4b
BuildArch:      noarch
7b0c4b
7b0c4b
%description zsh-completion
7b0c4b
Zsh command-line completion support for %{name}.
7b0c4b
457602
%prep
b0eeaf
%autosetup -a1 -p1
7a6c0f
# Remove prebuilt binaries
7e10df
rm -v zellij-utils/assets/plugins/*
457602
457602
%build
7a6c0f
# First rebuilt plugins we just deleted
7a6c0f
# Note: RUSTFLAGS break linking with WASM-files, so we don't use the cargo_build-macro here
7b0c4b
pushd default-plugins/compact-bar
7b0c4b
cargo --offline build --release --target=wasm32-wasi
7b0c4b
popd
7a6c0f
pushd default-plugins/status-bar
7a6c0f
cargo --offline build --release --target=wasm32-wasi
7a6c0f
popd
7a6c0f
pushd default-plugins/tab-bar
7a6c0f
cargo --offline build --release --target=wasm32-wasi
7a6c0f
popd
7a6c0f
pushd default-plugins/strider
7a6c0f
cargo --offline build --release --target=wasm32-wasi
7a6c0f
popd
736d75
pushd default-plugins/session-manager
736d75
cargo --offline build --release --target=wasm32-wasi
736d75
popd
736d75
pushd default-plugins/fixture-plugin-for-tests
736d75
cargo --offline build --release --target=wasm32-wasi
736d75
popd
7b0c4b
7a6c0f
# Move the results to the place they are expected
7e10df
mv -v target/wasm32-wasi/release/*.wasm zellij-utils/assets/plugins/
7a6c0f
7a6c0f
# Build zellij proper
7b0c4b
%{cargo_build} --features unstable
fbd34a
fbd34a
for shell in "zsh" "bash" "fish"
fbd34a
do
fbd34a
  ./target/release/%{name} setup --generate-completion "$shell" > target/%{name}."$shell"
fbd34a
done
7b0c4b
mandown docs/MANPAGE.md > target/zellij.1
457602
457602
%install
7b0c4b
install -Dm644 -T ./target/zellij.bash %{buildroot}%{_datadir}/bash-completion/completions/zellij
7b0c4b
install -Dm644 -T ./target/zellij.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/zellij.fish
7b0c4b
install -Dm644 -T ./target/zellij.zsh %{buildroot}%{_datadir}/zsh/site-functions/_zellij
7b0c4b
install -Dm644 -T %{_builddir}/%{name}-%{version}/assets/logo.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
7b0c4b
install -Dm644 -T %{_builddir}/%{name}-%{version}/assets/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
457602
7b0c4b
%if 0%{?suse_version} > 1500
7b0c4b
install -Dm644 -T ./target/zellij.1 %{buildroot}%{_mandir}/man1/zellij.1
7b0c4b
%endif
7b0c4b
7b0c4b
%{cargo_install} --features unstable
b0eeaf
b0eeaf
install -d -m 0755 %{buildroot}%{_datadir}/%{name}
b0eeaf
cp -av example/themes %{buildroot}%{_datadir}/%{name}
b0eeaf
457602
%if %{with test}
457602
%check
7b0c4b
%{cargo_test}
457602
%endif
457602
457602
%files
457602
%{_bindir}/zellij
b0eeaf
%dir %{_datadir}/%{name}
b0eeaf
%{_datadir}/%{name}/themes
7b0c4b
%{_datadir}/pixmaps/*
7b0c4b
%{_datadir}/applications/*
7b0c4b
7b0c4b
%if 0%{?suse_version} > 1500
7b0c4b
%{_mandir}/man1/zellij.1%{?ext_man}
7b0c4b
%endif
7b0c4b
457602
%license LICENSE.md
7b0c4b
%doc README.md docs/ARCHITECTURE.md docs/MANPAGE.md docs/TERMINOLOGY.md docs/THIRD_PARTY_INSTALL.md
7b0c4b
7b0c4b
%files bash-completion
7b0c4b
%{_datadir}/bash-completion/*
7b0c4b
7b0c4b
%files fish-completion
7b0c4b
%dir %{_datadir}/fish
7b0c4b
%{_datadir}/fish/*
457602
7b0c4b
%files zsh-completion
7b0c4b
%dir %{_datadir}/zsh
7b0c4b
%{_datadir}/zsh/*
457602
457602
%changelog