aboutsummaryrefslogtreecommitdiff
path: root/packaging/FEDORA/textgraph.spec
blob: 0873f6960f03012e7a666ff1e67e687c4174530f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Generated by rust2rpm 25
%bcond_without check

# prevent library files from being installed
# cargo2rpm does return 1 for the crate, but we don't care about the libraries
# for this rpm
%global __cargo_is_lib() 0

%global crate textgraph

%define cargo_config .cargo/config

Name:           textgraph
Version:        %{package_version}
Release:        %{package_release}
Summary:        Text graphing utility

#License:        GPLv3
Source:        	%{name}-%{version}.tar.gz

BuildRequires:  cargo-rpm-macros >= 24

%description
Text graphing utility

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep

%build
# This is not best practice, but it was somewhat annoying to actually get all
# dependencies vendored/packaged properly.
# currently this app doesn't have any cargo dependencies, but keeping it for reference
#sed -i '/^\[source\.crates-io\]/,/^$/d' %{cargo_config}
#sed -i '/^\[source\.local-registry\]/,/^$/d' %{cargo_config}
#sed -i '/^\[net\]/,/^$/d' %{cargo_config}
#echo "[net]" >> %{cargo_config}
#echo "git-fetch-with-cli = true" >> %{cargo_config}
%cargo_build

%install
%cargo_install

mkdir -p %{buildroot}%{_mandir}/man1
install tg.1 %{buildroot}%{_mandir}/man1/tg.1

%if %{with check}
%check
%cargo_test
%endif

%files
%doc README.md
%{_bindir}/tg
%{_mandir}/man1/tg.1.gz

%changelog
%autochangelog