Blob Blame History Raw
#global        snapdate   20120717
#%global        snaphash   5d07303
#global        snapver    {snapdate}.git{snaphash}

## set to enable Qt5 build -- rex
%if 0%{?fedora} > 21
%global qt5 1
%endif

%global         libdc_version 0.4.2

Name:           subsurface
Version:        4.4.2
#Release:        1.{snapver}%{?dist}
Release:        1%{?dist}
Summary:        A feature-full divelog in Qt

License:        GPLv2
URL:            http://subsurface-divelog.org/
#Source0:        torvalds-subsurface-v1.2-0-gc912e1f.tar.gz
# Sources generated via:
# git clone https://github.com/torvalds/subsurface.git && cd subsurface
# git archive --format=tar --prefix=subsurface-7fe652a/ 7fe652a | xz -z > subsurface-1.2-20120717git7fe652a.tar.xz
#Source0:        subsurface-1.2-20120717git7fe652a.tar.xz
Source0:        http://subsurface-divelog.org/downloads/Subsurface-%{version}.tgz

## usptreamable patches
# support parallel-installable libmarblewidget-qt5
Patch1: Subsurface-4.4.1-marblewidget-qt5.patch
# fix build with qt-5.4.1
Patch2: Subsurface-4.4.1-qt541.patch

BuildRequires:  libdivecomputer-devel == %{libdc_version}
BuildRequires:  libdivecomputer-static == %{libdc_version}
BuildRequires:  libudev-devel
BuildRequires:  libxml2-devel
BuildRequires:  libxslt-devel
BuildRequires:  libsqlite3x-devel
BuildRequires:  libzip-devel
BuildRequires:  desktop-file-utils
BuildRequires:  asciidoc
BuildRequires:  libgit2-devel
BuildRequires:  libappstream-glib

%if 0%{?qt5}
BuildRequires: marble-widget-qt5-devel
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Concurrent)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5WebKitWidgets)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Test)
# lrelease
BuildRequires: qt5-qttools-devel
%else
BuildRequires:  qt4-devel
BuildRequires:  qtwebkit-devel
BuildRequires:  marble-devel
Requires:       marble
%endif

# Since we build against the static libdivecomputer
# I want to have a hard constraint on the version compiled against
# I'll update both when needed.
Requires:       libdivecomputer == %{libdc_version}
Requires:       libgit2

%description
Subsurface is an open source dive log program.

Subsurface is able to track single- and multi-tank dives using air, Nitrox or
TriMix. It also allows logging of weights and exposure protection used, dive
masters and dive buddies and enables the user to rate dives and provide
additional dive notes.


%prep
%setup -q -n Subsurface-%{version}

# Qt4 no longer officially supported,
# http://trac.subsurface-divelog.org/ticket/821
# try using this patch until we have something better -- rex
patch -p1 --backup < packaging/ubuntu/0001-Make-build-with-Qt4.patch

%patch1 -p1 -b .marblewidget-qt5
%patch2 -p1 -b .qt541

%build
%if 0%{?qt5}
%{qmake_qt5} V=1
%else
%{qmake_qt4} V=1
%endif
make %{?_smp_mflags}

%install
make install prefix=$RPM_BUILD_ROOT/%{_prefix}

desktop-file-install                                    \
--delete-original                                       \
--dir=$RPM_BUILD_ROOT%{_datadir}/applications              \
$RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop

DESTDIR=$RPM_BUILD_ROOT appstream-util install appdata/%{name}.appdata.xml

%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || :


%files
%doc README Documentation
%{_bindir}/subsurface
%{_datadir}/applications/%{name}.desktop
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/icons/hicolor/scalable/apps/%{name}-icon.svg
%{_datadir}/%{name}/
%{_mandir}/man1/%{name}.1.*


%changelog
* Wed Sep 02 2015 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.4.2-1
- Update to 4.4.2

* Sun Aug 30 2015 Rex Dieter <rdieter@fedoraproject.org> 4.4.1-8
- rebuild (marble)

* Fri Jul 31 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.4.1-7
- Rebuilt for libgit2-0.23.0 and libgit2-glib-0.23

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed May 06 2015 Remi Collet <remi@fedoraproject.org> - 4.4.1-5
- rebuild for new libzip

* Sun Apr 19 2015 Rex Dieter <rdieter@fedoraproject.org> 4.4.1-4
- rebuild (marble)

* Thu Mar 12 2015 Rex Dieter <rdieter@fedoraproject.org> 4.4.1-3
- enable qt5 build (f22+)

* Mon Feb 23 2015 Rex Dieter <rdieter@fedoraproject.org> - 4.4.1-2
- use %%{qmake_qt?} style macro, verbose build
- support building against qt5 and marble-widget-qt5 (not used yet)

* Sat Feb 21 2015 Rex Dieter <rdieter@fedoraproject.org> 4.4.1-1
- 4.4.1 (#1194279), using unofficial ubuntu Qt4 patch for now

* Fri Feb 06 2015 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.4.0-1
- Update to 4.4

* Tue Jan 20 2015 Rex Dieter <rdieter@fedoraproject.org> 4.3-2
- bump release

* Tue Jan 20 2015 Rex Dieter <rdieter@fedoraproject.org> 4.3-1.1
- rebuild (marble, f20/f21)

* Sat Dec 20 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.3-1
- Update to 4.3

* Sun Dec 14 2014 Rex Dieter <rdieter@fedoraproject.org> 4.2-4
- rebuild (marble)

* Fri Nov 07 2014 Richard Hughes <richard@hughsie.com> - 4.2-3
- Manually install the AppData file

* Thu Aug 28 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.2-2
- Update the description

* Mon Aug 18 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.2-1
- Update to 4.2

* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Wed Aug 06 2014 Rex Dieter <rdieter@fedoraproject.org> 4.0.3-5
- rebuild (marble)

* Tue Jul 15 2014 Rex Dieter <rdieter@fedoraproject.org> 4.0.3-4
- BR: qt4-devel qtwebkit-devel

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Mar 20 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.0.3-2
- Rebuild for new version of libmarble-widget

* Thu Feb 20 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.0.3-1
- Update to 4.0.3

* Thu Feb 13 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.0.2-2
- Rebuild for the new version of libdivecomputer

* Thu Feb 06 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.0.2-1
- Rebuild for soname bump in libmarble

* Fri Jan 10 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.0.2-1
- Update to release 4.0.2

* Sun Dec 15 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 4.0-1
- Update to release 4.0

* Mon Dec 09 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.9.2-1
- Update to 3.9.2 which is the second beta release before 4.0

* Wed Aug 07 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.1.1-3
- Rebuild to fix broken dependency

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Jul 01 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.1.1-1
- Update to 3.1.1

* Fri May 17 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.1-1
- Update to 3.1
- Add BR on sqlite-devel

* Mon Mar 04 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.0.2-1
- Update to 3.0.2

* Thu Feb 21 2013 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.0-1
- Update to 3.0 which adds the dependency on osm-gps-map and a BR on
  libzip-devel

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Oct 23 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.1-1
- Update to 2.1 which brings among other language support

* Thu Oct 18 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.0.1-3
- Use $$RPM_BUILD_ROOT everywhere
- The license is GPLv2 only

* Wed Oct 17 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.0.1-2
- Use the macro libdc_version in the R and BR
- Add desktop-file-utils as BR

* Wed Oct 10 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.0.1-1
- Update to release 2.0.1

* Wed Jul 18 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.2-3.20120717.git7fe652a
- BR: libdivecomputer-static

* Tue Jul 17 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.2-2.20120717.git7fe652a
- Git snapshot

* Mon Jul 16 2012 Pierre-Yves Chibon <pingou@pingoured.fr> - 1.2-1
- Initial packaging work for Fedora