|
| 1 | +# If the configure script is run, it will define the package version by |
| 2 | +# prepending a definition of AC_VERSION to this spec. |
| 3 | +# If rpkg preprocesses this file, as in a COPR build, then it will generate the |
| 4 | +# package version from the "version" file and saved in the macro RPKG_VERSION. |
| 5 | +# This does not require running the configure script, which does not happen on |
| 6 | +# COPR. |
| 7 | + |
| 8 | +# It's also possible to define the macro 'version' on the command line. The |
| 9 | +# version used will be the first defined from 'version' macro, AC_VERSION, and |
| 10 | +# then RPKG_VERSION. |
| 11 | + |
| 12 | +# rpkg replaces with command output, otherwise rpmbuild replaces 3 {'s with 2 {'s. |
| 13 | +%define RPKG_VERSION {{{ sed s/-/_/ version }}} |
| 14 | +%define RPKG_SNAPINFO {{{ echo .$(git log -1 --date=format:"%Y%m%d" --format="%ad")git$(git rev-parse --short HEAD) }}} |
| 15 | +%define have_rpkg %([ "%{RPKG_VERSION}" = "{{ sed s/-/_/ version }}" ]; echo $?) |
| 16 | +%if 0%{!?version:1} |
| 17 | + %if %{have_rpkg} |
| 18 | + %define version %{RPKG_VERSION} |
| 19 | + %define snapinfo %{RPKG_SNAPINFO} |
| 20 | + %endif |
| 21 | + %{?AC_VERSION: %define version %{AC_VERSION}} |
| 22 | + %{!?version: %{error:Need to define version, e.g. --define "version x.y.z", or preprocess this file with configure or rpkg}} |
| 23 | +%endif |
| 24 | + |
| 25 | +# Define pkgrel when building to set release. Otherwise git rev is used for snapshot tag. |
| 26 | +%if 0%{!?pkgrel:1} && 0%{!?snapinfo:1} |
| 27 | +%{warn: pkgrel not defined, attempting to build snapshot from current git checkout} |
| 28 | +%{warn: Define pkgrel, e.g. --define "pkgrel 1", if not building git snapshot} |
| 29 | +%define snapinfo .%(git log -1 --date=format:"%Y%m%d" --format="%ad")git%(git rev-parse --short HEAD) |
| 30 | +%define needgit 1 |
| 31 | +%endif |
| 32 | + |
| 33 | +Name: tg-timer |
| 34 | +Version: %{version} |
| 35 | +Release: %{?pkgrel}%{!?pkgrel:1}%{?snapinfo}%{?dist} |
| 36 | +Summary: Mechanical watch movement timegrapher |
| 37 | +License: GPL2 |
| 38 | +Group: Misc |
| 39 | +URL: https://github.com/vacaboja/tg |
| 40 | +Source: %name-%version.tar.gz |
| 41 | +Packager: Trent Piepho <[email protected]> |
| 42 | +BuildRequires: gcc, gtk3-devel, portaudio-devel, fftw-devel |
| 43 | +BuildRequires: desktop-file-utils, autoconf, automake |
| 44 | +%{?needgit:BuildRequires: git} |
| 45 | + |
| 46 | +%description |
| 47 | +Tg (tg-timer) is a program to evaluate the performance of mechanical watch |
| 48 | +movements. Tg works with the noise produced by a watch mechanism, and it |
| 49 | +produces real-time readings of the rate (or accuracy) and various other |
| 50 | +operational parameters. |
| 51 | + |
| 52 | +%prep |
| 53 | +%setup -q |
| 54 | + |
| 55 | +%build |
| 56 | +autoreconf -fi |
| 57 | +%configure |
| 58 | +%make_build |
| 59 | + |
| 60 | +%install |
| 61 | +%make_install |
| 62 | + |
| 63 | +%check |
| 64 | +desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop |
| 65 | + |
| 66 | +%files |
| 67 | +%license LICENSE |
| 68 | +%doc README.md |
| 69 | +%_bindir/%{name} |
| 70 | +%_mandir/man1/%{name}.1* |
| 71 | +%{_datadir}/applications/%{name}.desktop |
| 72 | +%{_datadir}/icons/hicolor/*/apps/%{name}.png |
| 73 | +%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg |
| 74 | +%{_datadir}/icons/hicolor/*/mimetypes/application-x-%{name}-data.png |
| 75 | +%{_datadir}/icons/hicolor/scalable/mimetypes/application-x-%{name}-data.svg |
| 76 | +%{_datadir}/mime/packages/%{name}.xml |
| 77 | + |
| 78 | +%changelog |
| 79 | +* Sat Apr 03 2021 Trent Piepho <tpiepho at gmail.com> 1:0.5.2 |
| 80 | +- Initial version |
0 commit comments