[nicotine+/f20] - Fix #RHBZ 1009934 - Add python-miniupnpc as Requires for UPnP support - Spec cleanup
Mohamed ElMorabity
melmorabity at fedoraproject.org
Thu Jul 31 00:30:45 UTC 2014
commit 95f38d7bf70bb56dc56b199a8bfd6cb08363dfda
Author: Mohamed El Morabity <melmorabity at fedoraproject.org>
Date: Thu Jul 31 02:30:22 2014 +0200
- Fix #RHBZ 1009934
- Add python-miniupnpc as Requires for UPnP support
- Spec cleanup
nicotine+-1.2.16-RHBZ1009934.patch | 105 ++++++++++++++++++++++++++
nicotine+-1.2.16-documentation.patch | 8 +-
nicotine+-1.2.16-remove_nonfree_sounds.patch | 20 -----
nicotine+-generate-tarball.sh | 8 +-
nicotine+.spec | 45 ++++++-----
sources | 2 +-
6 files changed, 137 insertions(+), 51 deletions(-)
---
diff --git a/nicotine+-1.2.16-RHBZ1009934.patch b/nicotine+-1.2.16-RHBZ1009934.patch
new file mode 100644
index 0000000..39214bf
--- /dev/null
+++ b/nicotine+-1.2.16-RHBZ1009934.patch
@@ -0,0 +1,105 @@
+diff -up nicotine+-1.2.16/pynicotine/metadata_mutagen.py.orig nicotine+-1.2.16/pynicotine/metadata_mutagen.py
+--- nicotine+-1.2.16/pynicotine/metadata_mutagen.py.orig 2009-09-30 17:53:21.000000000 +0200
++++ nicotine+-1.2.16/pynicotine/metadata_mutagen.py 2014-07-31 01:30:44.187442933 +0200
+@@ -1,7 +1,9 @@
+ #!/usr/bin/env python
+
++# Python core
+ from __future__ import division
+
++# Python modules
+ import mutagen
+
+ from mutagen.mp3 import MP3, MPEGInfo
+@@ -14,13 +16,20 @@ from mutagen.asf import ASFInfo
+ from mutagen.monkeysaudio import MonkeysAudioInfo
+ from mutagen.mp4 import MP4Info
+
++# Application specific
++from logfacility import log
++
++
+ def detect(path):
+ try:
+ audio = mutagen.File(path)
+ except IOError:
+ return None
+- # mutagen didn't think the file was audio
++ except Exception, e:
++ log.addwarning("Mutagen crashed on '%s': %s" % (path, e))
++ return None
+ if not audio:
++ # mutagen didn't think the file was audio
+ return None
+ if type(audio.info) == MPEGInfo:
+ return processMPEG(audio)
+diff -up nicotine+-1.2.16/pynicotine/shares.py.orig nicotine+-1.2.16/pynicotine/shares.py
+--- nicotine+-1.2.16/pynicotine/shares.py.orig 2010-07-11 12:29:58.000000000 +0200
++++ nicotine+-1.2.16/pynicotine/shares.py 2014-07-31 01:30:50.608262924 +0200
+@@ -5,6 +5,7 @@ import dircache
+ import gobject
+ import string, sys, os
+ import time
++import struct
+
+ # N+ imports
+ import slskmessages
+@@ -53,9 +54,13 @@ class Shares:
+ self.queue.put(slskmessages.SharedFoldersFiles(sharedfolders, sharedfiles))
+
+ def RescanShares(self, msg, rebuild=False):
+- files, streams, wordindex, fileindex, mtimes = self.rescandirs(msg.shared, self.config.sections["transfers"]["sharedmtimes"], self.config.sections["transfers"]["sharedfiles"], self.config.sections["transfers"]["sharedfilesstreams"], msg.yieldfunction, self.np.frame.SharesProgress, name=_("Shares"), rebuild=rebuild)
+- time.sleep(0.5)
+- self.np.frame.RescanFinished([files, streams, wordindex, fileindex, mtimes], "normal")
++ try:
++ files, streams, wordindex, fileindex, mtimes = self.rescandirs(msg.shared, self.config.sections["transfers"]["sharedmtimes"], self.config.sections["transfers"]["sharedfiles"], self.config.sections["transfers"]["sharedfilesstreams"], msg.yieldfunction, self.np.frame.SharesProgress, name=_("Shares"), rebuild=rebuild)
++ time.sleep(0.5)
++ self.np.frame.RescanFinished([files, streams, wordindex, fileindex, mtimes], "normal")
++ except:
++ log.addwarning("Failed to rebuild share, serious error occurred. If this problem persists delete ~/.nicotine/*.db and try again. If that doesn't help please file a bug report with the stack trace included (see terminal output after this message)")
++ raise
+
+ def RebuildShares(self, msg):
+ self.RescanShares(msg, rebuild=True)
+@@ -651,23 +656,26 @@ class Shares:
+ def getByteStream(self, fileinfo):
+ message = slskmessages.SlskMessage()
+
+- #size = long(fileinfo[1])
+- #size1 = size & 0xffffffff
+- #size2 = size >> 32
+-
+- #X print "chr1-" + repr(chr(1) + message.packObject(fileinfo[0]) + message.packObject(fileinfo[1]))
+- #X print "chr1+" + repr(chr(1) + message.packObject(fileinfo[0]) + message.packObject(NetworkIntType(fileinfo[1])))
+ stream = chr(1) + message.packObject(fileinfo[0]) + message.packObject(NetworkLongLongType(fileinfo[1]))
+ if fileinfo[2] is not None:
+- stream += message.packObject('mp3') + message.packObject(3)
+- #X print "net-" + repr(message.packObject(0) + message.packObject(fileinfo[2][0]) + message.packObject(1) + message.packObject(fileinfo[3]) + message.packObject(2) + message.packObject(fileinfo[2][1]))
+- #X print "net+" + repr(message.packObject(0) + message.packObject(NetworkIntType(fileinfo[2][0])) + message.packObject(1) + message.packObject(NetworkIntType(fileinfo[3])) + message.packObject(2) + message.packObject(NetworkIntType(fileinfo[2][1])))
+- stream += (message.packObject(0) +
+- message.packObject(NetworkIntType(fileinfo[2][0])) +
+- message.packObject(1) +
+- message.packObject(NetworkIntType(fileinfo[3])) +
+- message.packObject(2) +
+- message.packObject(NetworkIntType(fileinfo[2][1])))
++ try:
++ msgbytes = ''
++ msgbytes += message.packObject('mp3') + message.packObject(3)
++ msgbytes += (message.packObject(0) +
++ message.packObject(NetworkIntType(fileinfo[2][0])) +
++ message.packObject(1) +
++ message.packObject(NetworkIntType(fileinfo[3])) +
++ message.packObject(2) +
++ message.packObject(NetworkIntType(fileinfo[2][1])))
++ stream += msgbytes
++ except struct.error:
++ log.addwarning(_("Found meta data that couldn't be encoded, possible corrupt file: '%(file)s' has a bitrate of %(bitrate)s kbs, a length of %(length)s seconds and a VBR of %(vbr)s" % {
++ 'file': fileinfo[0],
++ 'bitrate': fileinfo[2][0],
++ 'length': fileinfo[3],
++ 'vbr': fileinfo[2][1]
++ }))
++ stream += message.packObject('') + message.packObject(0)
+ else:
+ stream += message.packObject('') + message.packObject(0)
+ return stream
diff --git a/nicotine+-1.2.16-documentation.patch b/nicotine+-1.2.16-documentation.patch
index f6a9440..c669f5a 100644
--- a/nicotine+-1.2.16-documentation.patch
+++ b/nicotine+-1.2.16-documentation.patch
@@ -1,8 +1,8 @@
diff -up nicotine+-1.2.16/setup.py.orig nicotine+-1.2.16/setup.py
---- nicotine+-1.2.16/setup.py.orig 2010-11-09 13:52:43.000000000 +0100
-+++ nicotine+-1.2.16/setup.py 2010-11-09 14:01:13.142538313 +0100
-@@ -100,12 +100,8 @@ for mo in mo_dirs:
- files.append((os.path.join(sys.prefix, "share", "locale", lang, "LC_MESSAGES"), [os.path.join(mo, "nicotine.mo")]))
+--- nicotine+-1.2.16/setup.py.orig 2010-01-17 22:57:24.000000000 +0100
++++ nicotine+-1.2.16/setup.py 2014-07-31 01:58:31.541832333 +0200
+@@ -110,12 +110,8 @@ for sounds in sound_dirs:
+ files.append((os.path.join(sys.prefix, "share", "nicotine", "sounds", theme), [os.path.join(sounds, file)]))
# data_files (documentation)
-doc_files = glob.glob(os.path.join("doc", "*"))
diff --git a/nicotine+-generate-tarball.sh b/nicotine+-generate-tarball.sh
index 3fb4e68..279352e 100644
--- a/nicotine+-generate-tarball.sh
+++ b/nicotine+-generate-tarball.sh
@@ -1,13 +1,11 @@
#!/bin/sh
# Regenerate nicotine+ tarball without nonfree sound themes (licensed under CC
-# Sampling Plus 1.0).
-# Original tarball can be found at:
-# http://129.125.101.92/nicotine+/nicotine+-$VERSION.tar.bz2
+# Sampling Plus 1.0)
VERSION=$1
+wget http://downloads.sourceforge.net/nicotine-plus/nicotine+-$VERSION.tar.bz2
tar -xjf nicotine+-$VERSION.tar.bz2
-rm -r nicotine+-$VERSION/sounds
-patch -d nicotine+-$VERSION -p1 < nicotine+-1.2.16-remove_nonfree_sounds.patch
+rm -r nicotine+-$VERSION/sounds/
tar -cjf nicotine+-$VERSION-without-nonfree-sounds.tar.bz2 nicotine+-$VERSION
diff --git a/nicotine+.spec b/nicotine+.spec
index 11cb3a3..59e337d 100644
--- a/nicotine+.spec
+++ b/nicotine+.spec
@@ -3,7 +3,7 @@
Name: nicotine+
Version: 1.2.16
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: A client for the SoulSeek file sharing network
Group: Applications/Internet
@@ -12,22 +12,22 @@ URL: http://www.nicotine-plus.org/
Source0: %{name}-%{version}-without-nonfree-sounds.tar.bz2
# nicotine+ contains nonfree sounds, licensed under CC Sampling Plus
# 1.0. Therefore we use this script to remove these files before shipping
-# it. Download the upstream tarball and invoke this script while in the
-# tarball's directory
+# it. Invoke this script while in the tarball's directory to retrieve and
+# generate a tarball without nonfree bytes
Source1: %{name}-generate-tarball.sh
-# Remove nonfree sound themes
-Patch0: nicotine+-1.2.16-remove_nonfree_sounds.patch
# Use xdg-open to open URLs
-Patch1: nicotine+-1.2.16-urls_commands.patch
-# Disable installation of documentation files, except the manual needed by
-# application help
-Patch2: nicotine+-1.2.16-documentation.patch
+Patch0: %{name}-1.2.16-urls_commands.patch
+# Disable installation of documentation files outside %%{_docdir}, except the
+# manual needed by application help
+Patch1: %{name}-1.2.16-documentation.patch
# Fix RHBZ #662786 (see http://www.nicotine-plus.org/ticket/697)
-Patch3: nicotine+-1.2.16-RHBZ662786.patch
+Patch2: %{name}-1.2.16-RHBZ662786.patch
# Fix http://www.nicotine-plus.org/ticket/726
-Patch4: nicotine+-1.2.16-ListModels_casts.patch
+Patch3: %{name}-1.2.16-ListModels_casts.patch
# Fix http://www.nicotine-plus.org/ticket/727
-Patch5: nicotine+-1.2.16-tab_labels.patch
+Patch4: %{name}-1.2.16-tab_labels.patch
+# Fix RHBZ #1009934 (see http://www.nicotine-plus.org/ticket/671)
+Patch5: %{name}-1.2.16-RHBZ1009934.patch
BuildRequires: desktop-file-utils
BuildRequires: gettext
@@ -35,6 +35,7 @@ BuildRequires: pygobject2
Requires: notify-python
Requires: pygtk2-libglade
Requires: python-GeoIP
+Requires: python-miniupnpc
Requires: python-mutagen
Requires: python-sexy
Requires: xdg-utils
@@ -48,11 +49,12 @@ PySoulSeek project by Alexander Kanavin.
%prep
%setup -q
-%patch1 -p1 -b .urls_commands
-%patch2 -p1 -b .documentation
-%patch3 -p3 -b .RHBZ662786
-%patch4 -p3 -b .ListModels_casts
-%patch5 -p1 -b .tab_labels
+%patch0 -p1 -b .urls_commands
+%patch1 -p1 -b .documentation
+%patch2 -p3 -b .RHBZ662786
+%patch3 -p3 -b .ListModels_casts
+%patch4 -p1 -b .tab_labels
+%patch5 -p1 -b .RHBZ1009934
# Remove shebangs
pushd pynicotine
@@ -63,9 +65,6 @@ for file in gtkgui/glade2py.py metadata_mutagen.py mp3.py _testmp3.py upnp.py; d
done
popd
-# Disable sounds in default configuration (since there is no more sound themes)
-sed -i "s|\"soundenabled\": 1|\"soundenabled\": 0|" pynicotine/config.py
-
%build
%{__python} setup.py build
@@ -89,7 +88,6 @@ desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/%{alt_name}.deskt
%files -f %{alt_name}.lang
-%defattr(-,root,root,-)
%doc COPYING doc/{CHANGELOG,CHANGELOG_DOCS,KNOWN_BUGS,MAINTAINERS,README,README.import-winconfig,TODO,TRANSLATIONS,TRANSLATORS}
%{_bindir}/*
%dir %{_datadir}/%{alt_name}
@@ -102,6 +100,11 @@ desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/%{alt_name}.deskt
%changelog
+* Thu Jul 31 2014 Mohamed El Morabity <melmorabity at fedoraproject.org> - 1.2.16-9
+- Fix #RHBZ 1009934
+- Add python-miniupnpc as Requires for UPnP support
+- Spec cleanup
+
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2.16-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
diff --git a/sources b/sources
index 8989e9a..c017308 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-61382986b03bac2e0868a3cf4863e0ce nicotine+-1.2.16-without-nonfree-sounds.tar.bz2
+63178cea7e4694cb34397af1dd5c06ac nicotine+-1.2.16-without-nonfree-sounds.tar.bz2
More information about the scm-commits
mailing list