Add RPM package definition for upcoming 1.2 release

This commit is contained in:
fnux 2020-02-15 11:04:28 +01:00
parent 96aa0f986d
commit 35315ae384

46
dist/rpm/ctt.spec vendored Normal file
View file

@ -0,0 +1,46 @@
Name: ctt
Version: 1.2
Release: 1%{?dist}
Summary: Time tracking for geeks
License: GPLv3
URL: https://code.ungleich.ch/ungleich-public/ctt
Source0: %{url}/-/archive/%{version}/ctt-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: asciidoc
%description
Command-line time-tracking tool.
%prep
%autosetup
%build
# Find all *.py files and if their first line is exactly '#!/usr/bin/env python3'
# then replace it with '#!/usr/bin/python3' (if it's the 1st line).
find . -type f -iname "*.py" -exec sed -i '1s_^#!/usr/bin/env python3$_#!/usr/bin/python3_' {} +
# Generate man page.
a2x -f manpage --no-xmllint -a encoding=UTF-8 %{name}.text
# Build python module/project.
%py3_build
%install
# Install man page
install -Dm644 %{name}.1 -t %{buildroot}%{_mandir}/man1
# Install python module/project.
%py3_install
%files
%license LICENSE
%doc README changelog
%{python3_sitelib}/%{name}*
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%{_datadir}/bash-completion/completions/%{name}
%changelog
* Sat Feb 15 2020 Timothée Floure <timothee.floure@ungleich.ch> - 1.2-1
- Let there be package.