LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File openambit.spec of Package openambit (Project home:smarty12)

#
# spec file for package 
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# Optional bits on by default
%define with_extras     0%{!?_without_extras:1}

%define currentVersion 0

Name:           openambit
Version:        0.3
Release:        0
License:	GPL-3.0+
Summary:	Open software for the Suunto Ambit(2) 
Url:		http://openambit.org/
Group:		Productivity/Other
Source:         %{name}-%{version}.tar.xz
Patch0:         patch-openambit.patch
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(zlib)
BuildRequires:	pkgconfig(QJson)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  libqt5-linguist-devel
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  libqt5-qtbase-common-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  cmake >= 3.0
%if %{with_extras}
BuildRequires:  pkgconfig(wireshark)
BuildRequires:  wireshark-ui
BuildRequires:  pkgconfig(glib-2.0)
%endif
BuildRequires:  update-desktop-files
BuildRequires:  hicolor-icon-theme
%if 0%{?suse_version} >= 1210
BuildRequires: systemd
%endif

BuildRequires:	-post-build-checks

Requires(post): update-desktop-files
Requires(postun): update-desktop-files

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%{?systemd_requires}

%description
The Openambit project aims at developing open software for the Suunto Ambit(2) outdoor clocks. The motive for this project is Suuntos reluctance of any kind of support for their customers on the Linux platform.

%package -n libambit%{currentVersion}
Summary:        Open software for the Suunto Ambit(2)
Group:          System/Libraries

%description -n libambit%{currentVersion}
The Openambit project aims at developing open software for the Suunto Ambit(2) outdoor clocks. The motive for this project is Suuntos reluctance of any kind of support for their customers on the Linux platform.

%package -n libmovescount%{currentVersion}
Summary:        Open software for the Suunto Ambit(2)
Group:          System/Libraries

%description -n libmovescount%{currentVersion}
The Openambit project aims at developing open software for the Suunto Ambit(2) outdoor clocks. The motive for this project is Suuntos reluctance of any kind of support for their customers on the Linux platform.

%package -n libambit-devel
Summary:        Development files for libopenambit
Group:          Development/Sources
Requires:       libambit%{currentVersion} = %{version}

%description -n libambit-devel
Development files for libopenambit.
The Openambit project aims at developing open software for the Suunto Ambit(2) outdoor clocks. The motive for this project is Suuntos reluctance of any kind of support for their customers on the Linux platform.

%package -n libmovescount-devel
Summary:        Development files for libmovescount
Group:          Development/Sources
Requires:       libmovescount%{currentVersion} = %{version}

%description -n libmovescount-devel
Development files for libmovescount.
The Openambit project aims at developing open software for the Suunto Ambit(2) outdoor clocks. The motive for this project is Suuntos reluctance of any kind of support for their customers on the Linux platform.

%if %{with_extras}
%package -n wireshark-plugin-ambit
Summary:        Wireshark plugin for the Suunto Ambit(2)
Group:          Productivity/Networking/Diagnostic
Requires:       libambit%{currentVersion} = %{version}
Requires:       wireshark < 2.0

%description -n wireshark-plugin-ambit
Wireshark dissector plugin for analysis of communication with the Suunto Ambit(2) outdoor clock.
%endif

%prep
%setup -q -n %name-%{version}
%patch0 -p1

%build
%if %{with_extras}
    %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)
    %define arg_extras -DBUILD_EXTRAS=1 -DCMAKE_INSTALL_WIRESHARKPLUGINSDIR:PATH="%{wireshark_plugindir}"
%else
    %define arg_extras -DBUILD_EXTRAS=0
%endif

%cmake \
    -DUSE_QT5=1 \
    -DCMAKE_BUILD_TYPE=release \
    -DDEBUG_PRINT_INFO=0 \
    -DCMAKE_C_FLAGS:STRING="-std=gnu11 %{optflags}" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_UDEVRULESDIR:PATH=/usr/lib/udev/rules.d \
    %{?arg_extras}
make %{?_smp_mflags}

%install
%cmake_install 

mv %{buildroot}/usr/lib/udev/rules.d/libambit.rules %{buildroot}/usr/lib/udev/rules.d/99-libambit.rules
%suse_update_desktop_file -r -N Openambit -G Openambit %{name} Utility SyncUtility

%if ! 0%{?suse_version} > 1500
%post
%desktop_database_post
%icon_theme_cache_post
%endif

%if ! 0%{?suse_version} > 1500
%postun
%desktop_database_postun
%icon_theme_cache_postun
%endif

%post -n libambit%{currentVersion}
/sbin/ldconfig

%post -n libmovescount%{currentVersion}
/sbin/ldconfig

%postun
%if 0%{?suse_version} >= 1140
%desktop_database_postun
%icon_theme_cache_postun
%endif

%postun -n libambit%{currentVersion}
/sbin/ldconfig

%postun -n libmovescount%{currentVersion}
/sbin/ldconfig

%files
%defattr(-,root,root)
%doc README.rst
%_bindir/openambit
/usr/share/applications/%{name}.desktop
/usr/share/appdata/%{name}.appdata.xml
/usr/share/icons/hicolor/64x64/apps/openambit.png
/usr/lib/udev/rules.d/99-libambit.rules

%files -n libambit%{currentVersion}
%defattr(-,root,root)
%_libdir/libambit.so.*

%files -n libmovescount%{currentVersion}
%defattr(-,root,root)
%_libdir/libmovescount.so.*

%files -n libambit-devel
%defattr(-,root,root)
%_includedir/libambit.h
%_libdir/libambit.so

%files -n libmovescount-devel
%defattr(-,root,root)
%_includedir/movescount
%_libdir/libmovescount.so

%if %{with_extras}
%files -n wireshark-plugin-ambit
%{wireshark_plugindir}/ambit.so
%endif

%changelog