ishcherb / rpms / openambit

Forked from rpms/openambit 6 years ago
Clone

Blame openambit.spec

843d301
fea961a
%global commit 5f2b7840d91121b44a9a16ac6d945b103a94c5a3
fea961a
%global shortcommit %(c=%{commit}; echo ${c:0:7})
fea961a
fea961a
Name:           openambit
fea961a
Version:        0.3
d94d520
Release:        11%{?commit:.git%shortcommit}%{?dist}
fea961a
Summary:        Open software for the Suunto Ambit(2)
fea961a
fea961a
License:        GPLv3+
fea961a
URL:            http://openambit.org/
fea961a
Source0:        https://github.com/openambitproject/openambit/archive/%{?commit:%commit}%{!?commit:%version}.tar.gz
fea961a
fea961a
# Fix some issues with the desktop file (upstreamed)
fea961a
Patch0:         openambit_desktop-file.patch
fea961a
# Add appdata file
fea961a
Patch1:         openambit_appdata.patch
fea961a
# Fix -Wstrict-aliasing issues, see https://github.com/openambitproject/openambit/pull/90
fea961a
Patch2:         openambit_strict-aliasing-fixes.patch
fea961a
# Fix -Wmaybe-uninitialized, see https://github.com/openambitproject/openambit/pull/91
fea961a
Patch3:         openambit_fix-maybe-uninitialized.patch
fea961a
# Unbundle hidapi (see also %%prep)
fea961a
Patch4:         openambit_unbundle-hidapi.patch
fea961a
fea961a
BuildRequires:  cmake
fea961a
BuildRequires:  desktop-file-utils
fea961a
BuildRequires:  libappstream-glib
fea961a
BuildRequires:  qjson-devel
fea961a
BuildRequires:  qt4-devel
fea961a
BuildRequires:  systemd-devel
843d301
BuildRequires:  wireshark-devel
fea961a
BuildRequires:  hidapi-devel
fea961a
fea961a
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
fea961a
Requires:       hicolor-icon-theme
fea961a
fea961a
%description
fea961a
Openambit is application for downloading moves from the Suunto
fea961a
Ambit(2) outdoor watches, and synchronizing them with the
fea961a
movescount website.
fea961a
fea961a
fea961a
%package libs
fea961a
Summary:        Libraries for %{name}
fea961a
# For %%{_sysconfdir}/udev/rules.d/ ownership
fea961a
Requires:       systemd
fea961a
fea961a
%description libs
fea961a
The %{name}-libs package contains libraries for %{name}.
fea961a
fea961a
fea961a
%package        devel
fea961a
Summary:        Development files for %{name}
fea961a
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}
fea961a
fea961a
%description    devel
fea961a
The %{name}-devel package contains libraries and header files for
fea961a
developing applications that use %{name}.
fea961a
fea961a
fea961a
%package        wireshark
fea961a
Summary:        Wireshark dissector for %{name}
843d301
Requires:       wireshark%{?_isa} >= 1.12.6-3
fea961a
License:        BSD
fea961a
fea961a
%description    wireshark
fea961a
The %{name}-wireshark package contains the Wireshark dissector for %{name},
fea961a
which parses pcap-files made with usbpcap.
fea961a
fea961a
fea961a
%prep
fea961a
%setup -q -n %{name}-%{?commit:%commit}%{!?commit:%version}
fea961a
%patch0 -p1
fea961a
%patch1 -p1
fea961a
%patch2 -p1
fea961a
%patch3 -p1
fea961a
%patch4 -p1
fea961a
fea961a
# Remove exec permissions since it is installed as %%doc
fea961a
chmod -x tools/movescountXmlDiff.pl
fea961a
fea961a
# Remove bundled hidapi files
fea961a
rm -rf src/libambit/hidapi
fea961a
fea961a
fea961a
%build
fea961a
# libambit (using libambit-build since Findlibambit looks for the library there)
fea961a
mkdir src/libambit-build
fea961a
(
fea961a
cd src/libambit-build
d75cac7
%cmake -DCMAKE_INSTALL_UDEVRULESDIR=%{_udevrulesdir} ../libambit
fea961a
make %{?_smp_mflags}
fea961a
)
fea961a
fea961a
# openambit 
fea961a
mkdir src/openambit-build
fea961a
(
fea961a
cd src/openambit-build
fea961a
%cmake ../openambit
fea961a
make %{?_smp_mflags}
fea961a
)
fea961a
fea961a
# wireshark dissector
fea961a
mkdir wireshark_dissector-build
fea961a
(
fea961a
cd wireshark_dissector-build
fea961a
%cmake ../wireshark_dissector
fea961a
make %{?_smp_mflags}
fea961a
)
fea961a
fea961a
fea961a
%install
fea961a
%make_install -C src/libambit-build
fea961a
%make_install -C src/openambit-build
8b1091d
install -Dpm 0755 wireshark_dissector-build/ambit.so %{buildroot}%{_libdir}/wireshark/plugins/ambit.so
fea961a
a2968a3
%{_bindir}/appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
fea961a
%{_bindir}/desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
fea961a
fea961a
fea961a
%post
fea961a
/usr/bin/update-desktop-database &> /dev/null || :
fea961a
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
fea961a
fea961a
%postun
fea961a
/usr/bin/update-desktop-database &> /dev/null || :
fea961a
if [ $1 -eq 0 ] ; then
fea961a
    /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fea961a
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
fea961a
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fea961a
fi
fea961a
fea961a
%posttrans
fea961a
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fea961a
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fea961a
fea961a
fea961a
%post libs -p /sbin/ldconfig
fea961a
fea961a
%postun libs -p /sbin/ldconfig
fea961a
fea961a
fea961a
%files
fea961a
%license src/openambit/COPYING
fea961a
%{_bindir}/%{name}
fea961a
%{_datadir}/appdata/%{name}.appdata.xml
fea961a
%{_datadir}/applications/%{name}.desktop
fea961a
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
fea961a
fea961a
%files libs
fea961a
%license src/libambit/COPYING
fea961a
%{_libdir}/libambit.so.*
d75cac7
%{_udevrulesdir}/libambit.rules
fea961a
fea961a
%files devel
fea961a
%doc src/example/ambitconsole.c
fea961a
%doc tools/*
fea961a
%{_includedir}/libambit.h
fea961a
%{_libdir}/libambit.so
fea961a
fea961a
%files wireshark
fea961a
%license wireshark_dissector/COPYING
8b1091d
%{_libdir}/wireshark/plugins/ambit.so
fea961a
fea961a
fea961a
%changelog
d94d520
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-11.git5f2b784
d94d520
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
d94d520
9624655
* Sat Jan 16 2016 Sandro Mani <manisandro@gmail.com> - 0.3-10.git5f2b784
9624655
- Rebuild (wireshark)
9624655
8b1091d
* Wed Jul 01 2015 Sandro Mani <manisandro@gmail.com> - 0.3-9.git5f2b784
8b1091d
- Install the wireshark plugin in %%{_libdir}/wireshark/plugins
8b1091d
843d301
* Mon Jun 29 2015 Sandro Mani <manisandro@gmail.com> - 0.3-8.git5f2b784
843d301
- Install the wireshark plugin in %%{_libdir}/wireshark/plugins/current
843d301
707a036
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3-7.git5f2b784
707a036
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
707a036
d001a30
* Tue Jun 02 2015 Sandro Mani <manisandro@gmail.com> - 0.3-6.git5f2b784
d001a30
- Fix location where udev rules are installed
d001a30
520230e
* Fri May 15 2015 Sandro Mani <manisandro@gmail.com> - 0.3-5.git5f2b784
520230e
- Rebuild (wireshark)
520230e
c45e35f
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.3-4.git5f2b784
c45e35f
- Rebuilt for GCC 5 C++11 ABI change
c45e35f
bc821f5
* Sun Mar 08 2015 Sandro Mani <manisandro@gmail.com> - 0.3-3.git5f2b784
bc821f5
- Rebuild (wireshark)
bc821f5
fea961a
* Tue Jan 27 2015 Sandro Mani <manisandro@gmail.com> - 0.3-2.git5f2b784
fea961a
- Bump wireshark version
fea961a
- Fix License
fea961a
- Add openambit_strict-aliasing-fixes.patch
fea961a
- Add openambit_fix-maybe-uninitialized.patch
fea961a
- Unbundle hidapi
fea961a
fea961a
* Sat Dec 27 2014 Sandro Mani <manisandro@gmail.com> - 0.3-1.git5f2b784
fea961a
- Initial package