Blob Blame Raw
%global commit0 2cb0ffbbdc83e6822cfcf288cdf268b21604ed47
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})

Name:		subdownloader
Version:	2.0.19
Release:	10%{?dist}
Summary:	Program for download/upload subtitles for video files and DVDs
# "modules/progressbar.py is LGPLv2+, everything else is GPLv3+"
License:	GPLv3+ and LGPLv2+
URL:		https://github.com/subdownloader/subdownloader
#Source0:    https://github.com/subdownloader/%{name}/releases/tag/v%{version}/%{name}-%{version}.tar.gz
Source0:    https://github.com/subdownloader/%{name}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
Patch1:     subdownloader-desktop.patch

BuildArch:	noarch
BuildRequires:	gettext desktop-file-utils python2-devel
BuildRequires:	python2-qt5-devel
Requires:	python2 >= 2.3.5-7 python2-qt5 python2-crypto
%if 0%{?fedora} < 28
Requires:   python-kaa-metadata
%endif
#Requires:	python2-progressbar
%if 0%{?fedora}
Recommends:	python2-argcomplete
%endif

%description
SubDownloader is a Free Open Source tool written in Python
for automatic download/upload subtitles for video files
(DIVX,MPEG,AVI,VOB,etc) and DVD's using fast hashing.

%prep
#setup -q -n %{name}-%{version}
%autosetup -n %{name}-%{commit0} -p1
# submitted as bugreport 361416
# https://bugs.launchpad.net/subdownloader/+bug/361416
sed -i 's#/usr/share/subdownloader#%{python2_sitelib}/%{name}#g' gui/main.py
# Remove shebang
t=$(stat -c %%y gui/ui_parser.py); sed -i -e '1{\@^#!@d}' gui/ui_parser.py; chmod -x gui/ui_parser.py; touch -d "$t" gui/ui_parser.py

%build
pushd gui
make
popd
# compile scripts
%{__python2} -mcompileall .

%install
mkdir -p %{buildroot}%{python2_sitelib}/%{name}
chmod +x run.py
sed -i '1s:#!/usr/bin/env python:#!/usr/bin/env python2:' run.py
cp -a run.py FileManagement cli gui languages modules %{buildroot}%{python2_sitelib}/%{name}
mkdir -p %{buildroot}%{_bindir}
ln -s %{python2_sitelib}/%{name}/run.py %{buildroot}%{_bindir}/%{name}
mkdir -p %{buildroot}%{_datadir}
rm -f locale/*/LC_MESSAGES/%{name}.po* locale/%{name}.pot
cp -a locale %{buildroot}%{_datadir}/locale
install -D -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -D -m 0644 gui/images/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

desktop-file-install subdownloader.desktop --dir %{buildroot}%{_datadir}/applications \
  --add-category X-AudioVideoImport
#ln -s ../..%{python2_sitelib}/%{name}/run.py %{buildroot}%{_bindir}/subdownloader
%find_lang %{name}


%files -f %{name}.lang
%doc README.md ChangeLog
%license COPYING
%{python2_sitelib}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/%{name}.1*
%{_bindir}/%{name}
%{_datadir}/pixmaps/%{name}.png

%changelog
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.19-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.19-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.19-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
- Fix FTBFS

* Fri Mar 23 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.19-7
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.19-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sun Feb 04 2018 Sérgio Basto <sergio@serjux.com> - 2.0.19-5
- python-kaa-metadata is not available in rawhide anymore

* Thu Oct 19 2017 Igor Gnatenko <ignatenko@redhat.com> - 2.0.19-4
- Remove shebang

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.19-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Wed Mar 29 2017 Sérgio Basto <sergio@serjux.com> - 2.0.19-2
- Add subdownloader-desktop.patch (#1436025)

* Fri Feb 24 2017 Sérgio Basto <sergio@serjux.com> - 2.0.19-1
- Update Homepage and SourceURL
- This is a many bug fixes
  https://github.com/subdownloader/subdownloader/pull/14
- Move to python-qt5
- Spec cleanup

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.18-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Apr 19 2016 Sérgio Basto <sergio@serjux.com> - 2.0.18-8
- Copy some scripts from opensuse rpm [1],  use gui/images/subdownloader.png instead
  SOURCE1.
  [1] https://build.opensuse.org/package/show/multimedia:apps/subdownloader
- Add license tag.

* Thu Apr 07 2016 Sérgio Basto <sergio@serjux.com> - 2.0.18-7
- Add patch from bug #1299172 .
- Add patches 554_553.diff, 555_554.diff, 556_555.diff and 557_556.diff from
  upstream.
- Spec cleanups and use python2_sitelib.

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.18-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

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

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

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

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

* Sun Nov 18 2012 Jan Klepek <jan.klepek at, gmail.com> - 2.0.18-1
- update to new version

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.14-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.14-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.14-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jan 6 2011 Jan Klepek <jan.klepek at, gmail.com> - 2.0.14-1
- new version released

* Fri Sep 3 2010 Jan Klepek <jan.klepek at, gmail.com> - 2.0.13-1
- new version released

* Mon Mar 15 2010 Jan Klepek <jan.klepek at, gmail.com> - 2.0.10-1
- new version released

* Wed Nov 11 2009 Jan Klepek <jan.klepek at, gmail.com> - 2.0.9.3-6
- disabled auto-update checks

* Wed Oct 07 2009 Jan Klepek <jan.klepek at, gmail.com> - 2.0.9.3-5
- fixed desktop file and locale handling

* Sun Sep 27 2009 Orcan Ogetbil <oget[DOT]fedora[AT]gmail[DOT]com> 2.0.9.3-4
- Update desktop file according to F-12 FedoraStudio feature

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.9.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Apr 10 2009 Jan Klepek <jan.klepek at, gmail.com> 2.0.9.3-2
- added desktop-file-utils into BuildRequires

* Mon Mar 16 2009 Jan Klepek <jan.klepek at, gmail.com> 2.0.9.3-1
- initial version of rpm package