LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File qtVlm.spec of Package qtVlm (Project home:DocB)

#
# spec file for package qtVlm
#
# Copyright (c) 2014 Dr. Axel Braun
#
# 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/
#


Name:           qtVlm
Version:        3.4.4r2293
Release:        0
License:        GPL-2.0+
Summary:        Weather routing software for virtual and real sailing boats
Url:            http://wiki.virtual-loup-de-mer.org/index.php/QtVlm/en
Group:          Productivity/Graphics/Viewers
Source0:        %{name}-%{version}.tar.bz2
# Source0 via svn export -r2293 svn://svn.code.sf.net/p/qtvlm/code/trunk qtVlm-3.4.4r2293
# tar cvjf qtVlm-3.4.4r2293.tar.bz2 qtVlm-3.4.4r2293/
Source1:        qtVlm_wrapper
Source2:        qtVlm.desktop
# PATCH-FIX-OPENSUSE qtVlm-fix-makefile.patch axel.braun@gmx.de -- Modify Makefile for distribution install rather than user.
#FIXME Packages that are not intended for inclusion in openSUSE may want to turn such fatal errors into warnings.
Source99:       qtVlm-rpmlintrc
Patch0:         qtVlm-fix-makefile.patch
# PATCH-FIX-OPENSUSE qtVlm-fix-implicit-definitions.patch axel.braun@gmx.de -- Add missing includes when building on linux.
Patch1:         qtVlm-fix-implicit-definitions.patch
# PATCH-FIX-OPENSUSE qtVlm-fix-qt-homedir.patch axel.braun@gmx.de -- Use the users home directory for data.
Patch2:         qtVlm-fix-qt-homedir.patch
# PATCH-FIX=OPENSUSE qtVlm-skip-file-write-test.patch axel.braun@gmx.de -- Skip file write test for moment. FIXME
Patch3:         qtVlm-skip-file-write-test.patch
BuildRequires:  fdupes
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libbz2-devel
BuildRequires:  libnova-devel
BuildRequires:  libproj-devel
BuildRequires:  libQt5Multimedia-devel
BuildRequires:  libQt5XmlPatterns-devel
#BuildRequires:  libqt5-qtmultimedia-devel
#BuildRequires:  libqt5-qtxmlpatterns-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qttools-devel
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:  desktop-file-utils
%endif
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
qtVlm is a weather routing software for virtual and real sailing boats.

qtVlm can be used in two modes:
- Virtual Racing designed to manage and pilot virtual boats from Virtual
  loup de mer VLM virtual races.
- Real Boats connected (or not) to a GPS device.

qtVlm uses boat polar diagrams and grib weather files, and includes
Routing module (isochrons method),
Route module respectively allowing route optimization and waypoints
management.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

# Fix script-without-shebang warning, files should be 0644
find base_dir/polar/ -type f -exec chmod a-x {} \;

# Fix "Your file uses __DATE__ this causes the package to rebuild when not needed warning"
# We use the date from the changes file
set_date=`date --date "@\`stat --format %Y %{_sourcedir}/%{name}.changes\`" +"%B %Y"`
sed -i 's/QTVLM_VERSION_DATE  \_\_DATE\_\_/QTVLM_VERSION_DATE \"'"$set_date"'\"/g' src/Version.h

%build
# Create qmake cache file to add rpm optflags to remove informational warning.
cat > .qmake.cache <<EOF
QMAKE_CFLAGS_RELEASE += %{optflags}
QMAKE_CXXFLAGS_RELEASE += %{optflags}
EOF
make

%install
%makeinstall
install -Dm 0755 %{S:1} %{buildroot}%{_bindir}/%{name}

%if 0%{?suse_version}
install -Dm0644 base_dir/icon/qtVlm_48x48.png \
                %{buildroot}%{_datadir}/pixmaps/qtVlm.png
%suse_update_desktop_file -i %{name}
%else
%if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
desktop-file-install                                    \
--dir=%{buildroot}%{_datadir}/applications         \
%endif
%endif
%fdupes -s %{buildroot}

%if 0%{?suse_version}
%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/pixmaps/qtVlm.png
%{_datadir}/applications/%{name}.desktop

%changelog