commit 09531bdfba8b612cac6ae1b794f3461006769aa2
Author: Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl>
Date: Mon Mar 12 18:53:48 2018 +0100
Add patch to remove 0-sized and unused files.
.gitignore | 1 +
ldoce5viewer-Add-AppStream-Metadata-file.patch | 55 ++++++++
ldoce5viewer-Remove-0-sized-and-unused-files.patch | 58 ++++++++
ldoce5viewer-fix-icon-converting-process.patch | 50 +++++++
ldoce5viewer.spec | 149 +++++++++++++++++++++
sources | 1 +
6 files changed, 314 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..c455bce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/ldoce5viewer-0-20170216git4b52afb.tar.gz
diff --git a/ldoce5viewer-Add-AppStream-Metadata-file.patch
b/ldoce5viewer-Add-AppStream-Metadata-file.patch
new file mode 100644
index 0000000..a22de71
--- /dev/null
+++ b/ldoce5viewer-Add-AppStream-Metadata-file.patch
@@ -0,0 +1,55 @@
+From 66ad086d225b68e45c9785fd21957597e1e8d89b Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl>
+Date: Tue, 27 Feb 2018 15:32:18 +0100
+Subject: [PATCH] Add AppStream Metadata file
+
+---
+ ldoce5viewer.appdata.xml | 39 +++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 39 insertions(+)
+ create mode 100644 ldoce5viewer.appdata.xml
+
+diff --git a/ldoce5viewer.appdata.xml b/ldoce5viewer.appdata.xml
+new file mode 100644
+index 0000000..b3579d3
+--- /dev/null
++++ b/ldoce5viewer.appdata.xml
+@@ -0,0 +1,39 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!-- Copyright 2018 Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl> -->
++<component type="desktop">
++ <id>ldoce5viewer.desktop</id>
++ <metadata_license>CC0-1.0</metadata_license>
++ <name>ldoce5viewer</name>
++ <summary>Viewer Application for the Longman Dictionary (LDOCE
5)</summary>
++ <description>
++ <p>
++ The ldoce5viewer is an alternative dictionary viewer for the
++ Longman Dictionary of Contemporary English 5th Edition (LDOCE 5).
++ </p>
++
++ <p>Some features:</p>
++ <ul>
++ <li>Comprehensive instant search</li>
++ <li>Pleasant to use</li>
++ <li>Clean and readable</li>
++ <li>Full sound playback</li>
++ <li>Access virtually all of the LDOCE content</li>
++ <li>Powerful advanced search</li>
++ <li>Search in definitions and example sentences</li>
++ <li>Clipboard monitoring</li>
++ </ul>
++ </description>
++ <screenshots>
++ <screenshot type="default">
++
<image>https://forward-backward.co.jp/ldoce5viewer/static/images/sc/linux1.png</image>
++ </screenshot>
++ <screenshot>
++
<image>https://forward-backward.co.jp/ldoce5viewer/static/images/sc/activator.png</image>
++ </screenshot>
++ <screenshot>
++
<image>https://forward-backward.co.jp/ldoce5viewer/static/images/sc/advsearch.png</image>
++ </screenshot>
++ </screenshots>
++ <url
type="homepage">https://forward-backward.co.jp/ldoce5viewer/</url>
++ <update_contact>dwrobel_at_ertelnet.rybnik.pl</update_contact>
++</component>
diff --git a/ldoce5viewer-Remove-0-sized-and-unused-files.patch
b/ldoce5viewer-Remove-0-sized-and-unused-files.patch
new file mode 100644
index 0000000..038965b
--- /dev/null
+++ b/ldoce5viewer-Remove-0-sized-and-unused-files.patch
@@ -0,0 +1,58 @@
+From 3840ab0a6121e7061c11e5a30b0ebc4dccbdc40e Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl>
+Date: Tue, 27 Feb 2018 22:09:45 +0100
+Subject: [PATCH] Remove 0-sized and unused files
+
+---
+ ldoce5viewer/static/scripts/activator.js | 0
+ ldoce5viewer/static/scripts/body.js | 0
+ ldoce5viewer/static/scripts/collocations.js | 0
+ ldoce5viewer/static/scripts/common.js | 0
+ ldoce5viewer/static/scripts/etymologies.js | 0
+ ldoce5viewer/static/scripts/examples.js | 0
+ ldoce5viewer/static/scripts/phrases.js | 0
+ ldoce5viewer/static/scripts/thesaurus.js | 0
+ ldoce5viewer/static/scripts/word_families.js | 0
+ ldoce5viewer/static/scripts/word_sets.js | 0
+ 10 files changed, 0 insertions(+), 0 deletions(-)
+ delete mode 100644 ldoce5viewer/static/scripts/activator.js
+ delete mode 100644 ldoce5viewer/static/scripts/body.js
+ delete mode 100644 ldoce5viewer/static/scripts/collocations.js
+ delete mode 100644 ldoce5viewer/static/scripts/common.js
+ delete mode 100644 ldoce5viewer/static/scripts/etymologies.js
+ delete mode 100644 ldoce5viewer/static/scripts/examples.js
+ delete mode 100644 ldoce5viewer/static/scripts/phrases.js
+ delete mode 100644 ldoce5viewer/static/scripts/thesaurus.js
+ delete mode 100644 ldoce5viewer/static/scripts/word_families.js
+ delete mode 100644 ldoce5viewer/static/scripts/word_sets.js
+
+diff --git a/ldoce5viewer/static/scripts/activator.js
b/ldoce5viewer/static/scripts/activator.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/body.js b/ldoce5viewer/static/scripts/body.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/collocations.js
b/ldoce5viewer/static/scripts/collocations.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/common.js
b/ldoce5viewer/static/scripts/common.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/etymologies.js
b/ldoce5viewer/static/scripts/etymologies.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/examples.js
b/ldoce5viewer/static/scripts/examples.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/phrases.js
b/ldoce5viewer/static/scripts/phrases.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/thesaurus.js
b/ldoce5viewer/static/scripts/thesaurus.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/word_families.js
b/ldoce5viewer/static/scripts/word_families.js
+deleted file mode 100644
+index e69de29..0000000
+diff --git a/ldoce5viewer/static/scripts/word_sets.js
b/ldoce5viewer/static/scripts/word_sets.js
+deleted file mode 100644
+index e69de29..0000000
diff --git a/ldoce5viewer-fix-icon-converting-process.patch
b/ldoce5viewer-fix-icon-converting-process.patch
new file mode 100644
index 0000000..c8d3b80
--- /dev/null
+++ b/ldoce5viewer-fix-icon-converting-process.patch
@@ -0,0 +1,50 @@
+From 728158aea71013f1122e915ca4bf767ffb29df5d Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl>
+Date: Tue, 27 Feb 2018 11:29:08 +0100
+Subject: [PATCH] Fix icon converting process
+
+python2 icongen.py go-down-48-src.png go-down-48.png
+Traceback (most recent call last):
+ File "icongen.py", line 94, in <module>
+ make(src_path, out_path)
+ File "icongen.py", line 82, in make
+ (highlight_a, highlight) = make_highlight(srca)
+ File "icongen.py", line 51, in make_highlight
+ m1 = m1.offset(0, OFFSET_H)
+ File "/usr/lib64/python2.7/site-packages/PIL/Image.py", line 1322, in offset
+ raise NotImplementedError("offset() has been removed. "
+---
+ ldoce5viewer/qtgui/resources/icons/icongen.py | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ldoce5viewer/qtgui/resources/icons/icongen.py
b/ldoce5viewer/qtgui/resources/icons/icongen.py
+index 6298c76..e27000c 100644
+--- a/ldoce5viewer/qtgui/resources/icons/icongen.py
++++ b/ldoce5viewer/qtgui/resources/icons/icongen.py
+@@ -2,7 +2,7 @@
+
+ import sys
+
+-import Image, ImageFilter, ImageChops, ImageEnhance, ImageDraw
++from PIL import Image, ImageFilter, ImageChops, ImageEnhance, ImageDraw
+
+
+ OFFSET_S = 4
+@@ -29,7 +29,7 @@ def make_inset_shadow(alpha):
+ m1 = alpha.copy()
+ for i in xrange(6):
+ m1 = m1.filter(ImageFilter.SMOOTH_MORE)
+- m1 = m1.offset(0, OFFSET_S)
++ m1 = ImageChops.offset(m1, 0, OFFSET_S)
+ m1 = ImageChops.subtract(alpha, m1)
+ m1b = ImageEnhance.Brightness(m1).enhance(0.35)
+
+@@ -48,7 +48,7 @@ def make_highlight(alpha):
+ m1 = alpha.copy()
+ for i in xrange(2):
+ m1 = m1.filter(ImageFilter.SMOOTH_MORE)
+- m1 = m1.offset(0, OFFSET_H)
++ m1 = ImageChops.offset(m1, 0, OFFSET_H)
+ m1 = ImageChops.subtract(m1, alpha)
+ m1b = ImageEnhance.Brightness(m1).enhance(0.35)
+
diff --git a/ldoce5viewer.spec b/ldoce5viewer.spec
new file mode 100644
index 0000000..9aef0e8
--- /dev/null
+++ b/ldoce5viewer.spec
@@ -0,0 +1,149 @@
+%global date 20170216
+%global commit0 4b52afba3a0e4a93e47fe485885fe285851577ff
+%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
+
+Name: ldoce5viewer
+Version: 0
+Release: 3.%{date}git%{shortcommit0}%{?dist}
+Summary: Viewer Application for the Longman Dictionary (LDOCE 5)
+License: GPLv3+ and Public Domain
+URL:
https://hakidame.net/ldoce5viewer/
+Source:
https://github.com/ciscorn/%{name}/archive/%{commit0}.tar.gz#/%{name}-%{v...
+# Fix for icon convertin process
+# Upstream ref:
https://github.com/ciscorn/ldoce5viewer/pull/54
+Patch0:
https://github.com/ciscorn/%{name}/commit/728158aea71013f1122e915ca4bf767...
+# Add Appstream Metadata
+# Upstream ref:
https://github.com/ciscorn/ldoce5viewer/pull/55
+Patch1:
https://github.com/ciscorn/%{name}/commit/66ad086d225b68e45c9785fd2195759...
+# Remove 0-sized and unused files
+# Upstream ref:
https://github.com/ciscorn/ldoce5viewer/pull/56
+Patch2:
https://github.com/ciscorn/%{name}/commit/3840ab0a6121e7061c11e5a30b0ebc4...
+BuildArch: noarch
+
+BuildRequires: /usr/bin/git
+BuildRequires: desktop-file-utils
+BuildRequires: python2-devel
+BuildRequires: %{py2_dist whoosh}
+BuildRequires: %{py2_dist lxml}
+BuildRequires: PyQt4-devel
+BuildRequires: libappstream-glib
+# Required to regenerate icons
+BuildRequires: ImageMagick
+BuildRequires: inkscape
+BuildRequires: python2-pillow
+
+Requires: gstreamer-python
+Requires: gstreamer-plugins-good
+Requires: gstreamer-plugins-ugly
+Requires: hicolor-icon-theme
+Requires: %{py2_dist whoosh}
+Requires: %{py2_dist lxml}
+Requires: PyQt4
+
+
+%description
+The %{name} is an alternative dictionary viewer for the
+Longman Dictionary of Contemporary English 5th Edition (LDOCE 5).
+
+Features:
+ - Comprehensive instant search.
+ - Pleasant to use.
+ - Clean and readable.
+ - Full sound playback.
+ - Access virtually all of the LDOCE content.
+ - Powerful advanced search.
+ - Search in definitions and example sentences.
+ - Clipboard monitoring.
+
+Note: Before you can use the app, you have to install
+ the original LDOCE 5 software from the DVD-ROM.
+
+
+%prep
+%autosetup -S git -n %{name}-%{commit0}
+
+# Update the software version.
+sed -i "s#\(__version__.*\ =\ \).*#\1'%{date}'#" %{name}/__init__.py
+
+# Shebang removal
+for i in %{name}/__init__.py %{name}/utils/compat.py %{name}.desktop; do
+ sed '1{\@^#!/usr/bin/env@d}' $i > $i.tmp &&
+ touch -r $i $i.tmp &&
+ mv $i.tmp $i
+done
+
+# Be sure all necessary files will be regenerated.
+make clean
+make -C %{name}/qtgui/resources/icons clean
+
+# Correct EOL (preserve timestamps).
+for i in COPYING.txt LICENSE.txt; do
+ sed 's#\r##g' $i > $i.tmp && \
+ touch -r $i $i.tmp && \
+ mv $i.tmp $i
+done
+
+# Create simple installation instruction.
+cat > INSTALL.txt <<EOF
+1. Copy the 'ldoce5.data' directory from the LDOCE5 DVD-ROM [1]
+ to an arbitrary location.
+
+2. Start the %{name}
+
+3. The application will ask you the location where you put 'ldoce5.data'.
+
+More information can be obtained from [2].
+
+[1]
http://www.longmandictionariesonline.com/
+[2]
https://hakidame.net/ldoce5viewer/manual/
+EOF
+
+
+%build
+%make_build -C %{name}/qtgui/resources/icons
+%make_build qtui qtresource
+%py2_build
+
+
+%install
+%py2_install
+
+# install desktop file
+desktop-file-install \
+ --delete-original \
+ --dir=%{buildroot}%{_datadir}/applications \
+ %{name}.desktop
+
+# install icon file
+install -p -m 0644 -D %{name}/qtgui/resources/%{name}.svg \
+ %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
+
+# install and validate appdata
+install -p -m 0644 -D %{name}.appdata.xml
%{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
+appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.appdata.xml
+
+
+%files
+%doc INSTALL.txt README.md
+%license COPYING.txt LICENSE.txt
+%{_bindir}/%{name}
+%{python2_sitelib}/*
+%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
+%{_datadir}/applications/%{name}.desktop
+%{_datadir}/appdata/*.appdata.xml
+%exclude %{python2_sitelib}/%{name}/qtgui/ui/Makefile
+%exclude %{python2_sitelib}/%{name}/qtgui/resources/Makefile
+%exclude %{python2_sitelib}/%{name}/qtgui/resources/icons/Makefile
+%exclude %{python2_sitelib}/%{name}/qtgui/resources/icons/icongen.*
+
+
+%changelog
+* Tue Feb 27 2018 Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl> -
0-3.20170216git4b52afb
+- Add patch to remove 0-sized and unused files.
+
+* Tue Feb 27 2018 Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl> -
0-2.20170216git4b52afb
+- Modernize spec file,
+- Update to the latest version.
+
+* Fri May 23 2014 Damian Wrobel <dwrobel(a)ertelnet.rybnik.pl> - 0-1.20140224
+- Initial RPM release.
diff --git a/sources b/sources
index e69de29..2a70f70 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e2c1ec088881c8786d35761c11c9d0ed ldoce5viewer-0-20170216git4b52afb.tar.gz