File svgbob.spec of Package svgbob

#
# spec file for package svgbob
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           svgbob
Version:        0.5.0_alpha.0
Release:        0
Summary:        Convert ASCII diagrams to SVG
License:        Apache-2.0
URL:            http://ivanceras.github.io/svgbob-editor
Source:         %{name}-%{version}.tar.xz
Source1:        vendor.tar.xz
BuildRequires:  cargo
BuildRequires:  help2man
BuildRequires:  rust
BuildRequires:  rust-packaging

%description
Svgbob transforms ASCII diagrams into svg representations.

%prep
%autosetup -a1 -p1
install -d -m 0755 .cargo
cat >.cargo/config <<EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'
[term]
verbose = true
EOF

%build
%cargo_build
help2man target/release/svgbob > %{name}.1

%install
install -Dm0755 target/release/svgbob %{buildroot}%{_bindir}/%{name}
install -Dm0644 svgbob.1 %{buildroot}%{_mandir}/man1/%{name}.1

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1%{?ext_man}

%changelog
openSUSE Build Service is sponsored by