Blob Blame Raw
%global py_name syncthing_gtk

Name:           syncthing-gtk
Summary:        Syncthing GTK+ GUI
Version:        0.9.3
Release:        1%{?dist}
License:        GPLv2

URL:            https://github.com/syncthing/%{name}
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1:        %{name}.appdata.xml

# Upstream patch to fix some type errors
Patch0:         00-fix-type-errors.patch

BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib
BuildRequires:  python2-bcrypt
BuildRequires:  python2-dateutil
BuildRequires:  python2-devel
BuildRequires:  python2-inotify
BuildRequires:  python2-setuptools

BuildArch:      noarch

Requires:       gtk3 >= 3.8
Requires:       hicolor-icon-theme
Requires:       psmisc
Requires:       python2-bcrypt
Requires:       python2-dateutil
Requires:       python2-gobject
Requires:       python2-inotify

Recommends:     syncthing >= 0.13


%description
Syncthing replaces Dropbox and BitTorrent Sync with something open,
trustworthy and decentralized. Your data is your data alone and you
deserve to choose where it is stored, if it is shared with some third
party and how it's transmitted over the Internet.

Using syncthing, that control is returned to you.

This package contains the GTK+ GUI for syncthing.


%prep
%autosetup -p1


%build
%py2_build


%install
%py2_install

%find_lang %{name}

# Install appdata file
mkdir -p %{buildroot}/%{_datadir}/appdata
cp -pav %{SOURCE1} %{buildroot}/%{_datadir}/appdata/

# Remove shebang from python source files
# https://fedoraproject.org/wiki/Packaging_tricks#Remove_shebang_from_Python_libraries

# in python2_sitelib/syncthing_gtk:
for lib in %{buildroot}/%{python2_sitelib}/%{py_name}/*.py; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done

# in _datadir/syncthing-gtk:
for lib in %{buildroot}/%{_datadir}/%{name}/*.py; do
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
 touch -r $lib $lib.new &&
 mv $lib.new $lib
done


%check
desktop-file-validate \
    %{buildroot}/%{_datadir}/applications/%{name}.desktop

appstream-util validate-relax --nonet \
    %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml


%files -f %{name}.lang
%doc README.md
%license LICENSE

%{_bindir}/%{name}

%{python2_sitelib}/%{py_name}/
%{python2_sitelib}/%{py_name}-v%{version}-py%{python2_version}.egg-info

%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop

%{_datadir}/icons/hicolor/*/apps/%{name}*.png
%{_datadir}/icons/hicolor/*/emblems/emblem-syncthing*.png
%{_datadir}/icons/hicolor/*/status/si-syncthing*.png

%{_datadir}/pixmaps/%{name}.png
%{_datadir}/%{name}/

%{_mandir}/man1/%{name}.*


%changelog
* Tue Feb 20 2018 Fabio Valentini <decathorpe@gmail.com> - 0.9.3-1
- Update to version 0.9.3.

* Sat Jan 06 2018 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.6-2
- Remove icon cache scriptlets, replaced by file triggers.

* Fri Oct 06 2017 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.6-1
- Update to version 0.9.2.6.

* Wed Aug 16 2017 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.5-1
- Update to version 0.9.2.5.

* Mon Jan 23 2017 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.4-1
- Update to version 0.9.2.4.

* Thu Nov 24 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.2-2
- Fix mistake in dependencies. Spec cleanups.

* Tue Sep 06 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.2-1
- Update to version 0.9.2.2.

* Mon Aug 29 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.2.1-1
- Update to version 0.9.2.1.

* Sat Aug 27 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.2-1
- Update to latest snapshot.

* Sat Aug 27 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.2-1
- Update to version 0.9.2.

* Tue Jul 19 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.1-1
- Update to version 0.9.1.

* Fri Jun 17 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.0.3-1
- Update to version 0.9.0.3.

* Tue May 24 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.0.2-1
- Update to version 0.9.0.2.

* Sat May 21 2016 Fabio Valentini <decathorpe@gmail.com> - 0.9.0.1-1
- Update to version 0.9.0.1.

* Thu Mar 10 2016 Fabio Valentini <decathorpe@gmail.com> - 0.8.3-2
- Fix build on dists without support for Recommends: tag.

* Thu Mar 10 2016 Fabio Valentini <decathorpe@gmail.com> - 0.8.3-1
- Update to version 0.8.3.

* Wed Jan 27 2016 Fabio Valentini <decathorpe@gmail.com> - 0.8.2-2
- Add Requires: python-inotify.

* Mon Jan 18 2016 Fabio Valentini <decathorpe@gmail.com> - 0.8.2-1
- Update to version 0.8.2.

* Sun Dec 20 2015 Fabio Valentini <decathorpe@gmail.com> - 0.8.1-1
- Update to version 0.8.1.

* Sat Nov 21 2015 Fabio Valentini <decathorpe@gmail.com> - 0.8.0.1-1
- Update to version 0.8.0.1. Fixes two minor bugs.

* Fri Nov 06 2015 Fabio Valentini <decathorpe@gmail.com> - 0.8-1
- Update to (incompatible) version 0.8.

* Mon Oct 12 2015 Fabio Valentini <decathorpe@gmail.com> - 0.7.6.1-2
- Update icon database correctly.

* Mon Oct 12 2015 Fabio Valentini <decathorpe@gmail.com> - 0.7.6.1-1
- Update to version 0.7.6.1.

* Sat Oct 10 2015 Fabio Valentini <decathorpe@gmail.com> - 0.7.6-1
- Update to version 0.7.6.

* Sun Sep 13 2015 Fabio Valentini <decathorpe@gmail.com> - 0.7.5.1-2
- Fix spec to include neccessary python module and package dependencies.

* Sun Sep 13 2015 Fabio Valentini <decathorpe@gmail.com> - 0.7.5.1-1
- First package for fedora.