#global commit b44a1d0c8134fe793e5f46d646236043b0904b7c
#global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: openambit
Version: 0.4
Release: 6%{?commit:.git%shortcommit}%{?dist}
Summary: Open software for the Suunto Ambit(2)
License: GPLv3+
URL: http://openambit.org/
Source0: https://github.com/openambitproject/openambit/archive/%{?commit:%commit}%{!?commit:%version}/openambit-%{?commit:%shortcommit}%{!?commit:%version}.tar.gz
# Unbundle hidapi (see also %%prep)
Patch0: openambit_unbundle-hidapi.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qttools-devel
BuildRequires: systemd-devel
BuildRequires: wireshark-devel
BuildRequires: hidapi-devel
BuildRequires: python
BuildRequires: zlib-devel
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: hicolor-icon-theme
%description
Openambit is application for downloading moves from the Suunto
Ambit(2) outdoor watches, and synchronizing them with the
movescount website.
%package libs
Summary: Libraries for %{name}
# For %%{_sysconfdir}/udev/rules.d/ ownership
Requires: systemd
%description libs
The %{name}-libs package contains libraries for %{name}.
%package devel
Summary: Development files for %{name}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package wireshark
Summary: Wireshark dissector for %{name}
Requires: wireshark%{?_isa} >= 1.12.6-3
License: BSD
%description wireshark
The %{name}-wireshark package contains the Wireshark dissector for %{name},
which parses pcap-files made with usbpcap.
%prep
%autosetup -p1 -n %{name}-%{?commit:%commit}%{!?commit:%version}
# Remove exec permissions since it is installed as %%doc
chmod -x tools/movescountXmlDiff.pl
# Remove bundled hidapi files
rm -rf src/libambit/hidapi
%build
%cmake \
-DCMAKE_INSTALL_UDEVRULESDIR=%{_udevrulesdir} \
-DCMAKE_INSTALL_WIRESHARKPLUGINSDIR=%{_libdir}/wireshark/plugins/ \
-DUSE_QT5=ON -DBUILD_EXTRAS=ON
%install
%make_install
%{_bindir}/appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
%{_bindir}/desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%files
%license src/openambit/COPYING
%{_bindir}/%{name}
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
%files libs
%license src/libambit/COPYING
%{_libdir}/libambit.so.*
%{_libdir}/libmovescount.so.*
%{_udevrulesdir}/libambit.rules
%files devel
%doc src/example/ambitconsole.c
%doc tools/*
%{_includedir}/libambit.h
%{_includedir}/movescount/
%{_libdir}/libambit.so
%{_libdir}/libmovescount.so
%files wireshark
%license wireshark_dissector/COPYING
%{_libdir}/wireshark/plugins/ambit.so
%changelog
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jan 18 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.4-5
- Remove obsolete scriptlets
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Jul 11 2017 Sandro Mani <manisandro@gmail.com> - 0.4-2
- Rebuild (wireshark)
* Tue Apr 25 2017 Sandro Mani <manisandro@gmail.com> - 0.4-1
- Update to 0.4
* Wed Feb 15 2017 Sandro Mani <manisandro@gmail.com> - 0.3-15.gitb44a1d0
- BR: python
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-14.gitb44a1d0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sat Nov 19 2016 Peter Robinson <pbrobinson@fedoraproject.org> 0.3-13.gitb44a1d0
- rebuild (wireshark)
* Wed Jun 15 2016 Sandro Mani <manisandro@gmail.com> - 0.3-12.gitb44a1d0
- Update to latest snapshot
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-11.git5f2b784
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sat Jan 16 2016 Sandro Mani <manisandro@gmail.com> - 0.3-10.git5f2b784
- Rebuild (wireshark)
* Wed Jul 01 2015 Sandro Mani <manisandro@gmail.com> - 0.3-9.git5f2b784
- Install the wireshark plugin in %%{_libdir}/wireshark/plugins
* Mon Jun 29 2015 Sandro Mani <manisandro@gmail.com> - 0.3-8.git5f2b784
- Install the wireshark plugin in %%{_libdir}/wireshark/plugins/current
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-7.git5f2b784
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Tue Jun 02 2015 Sandro Mani <manisandro@gmail.com> - 0.3-6.git5f2b784
- Fix location where udev rules are installed
* Fri May 15 2015 Sandro Mani <manisandro@gmail.com> - 0.3-5.git5f2b784
- Rebuild (wireshark)
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.3-4.git5f2b784
- Rebuilt for GCC 5 C++11 ABI change
* Sun Mar 08 2015 Sandro Mani <manisandro@gmail.com> - 0.3-3.git5f2b784
- Rebuild (wireshark)
* Tue Jan 27 2015 Sandro Mani <manisandro@gmail.com> - 0.3-2.git5f2b784
- Bump wireshark version
- Fix License
- Add openambit_strict-aliasing-fixes.patch
- Add openambit_fix-maybe-uninitialized.patch
- Unbundle hidapi
* Sat Dec 27 2014 Sandro Mani <manisandro@gmail.com> - 0.3-1.git5f2b784
- Initial package