Blob Blame History Raw
%global alt_name nicotine
%global nicotine_pythonsitedir py%{alt_name}

Name:           nicotine+
Version:        1.2.16
Release:        9%{?dist}
Summary:        A client for the SoulSeek file sharing network

Group:          Applications/Internet
License:        GPLv3+
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. Invoke this script while in the tarball's directory to retrieve and
# generate a tarball without nonfree bytes
Source1:        %{name}-generate-tarball.sh
# Use xdg-open to open URLs
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)
Patch2:         %{name}-1.2.16-RHBZ662786.patch
# Fix http://www.nicotine-plus.org/ticket/726
Patch3:         %{name}-1.2.16-ListModels_casts.patch
# Fix http://www.nicotine-plus.org/ticket/727
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
BuildRequires:  pygobject2
Requires:       notify-python
Requires:       pygtk2-libglade
Requires:       python-GeoIP
Requires:       python-miniupnpc
Requires:       python-mutagen
Requires:       python-sexy
Requires:       xdg-utils
BuildArch:      noarch

%description
Nicotine+ is a client for the SoulSeek file sharing network. It was "forked"
from Nicotine, Hyriand's Soulseek client, which in turn was forked from the
PySoulSeek project by Alexander Kanavin.


%prep
%setup -q
%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
for file in gtkgui/glade2py.py metadata_mutagen.py mp3.py _testmp3.py upnp.py; do
  sed -i.orig -e 1d $file && \
  touch -r $file.orig $file && \
  rm $file.orig
done
popd


%build
%{__python} setup.py build


%install
%{__python} setup.py install \
  --skip-build \
  --root $RPM_BUILD_ROOT

# Install the SVG version of the icon
install -Dpm 0644 files/nicotine-plus.svg $RPM_BUILD_ROOT/%{_datadir}/pixmaps/nicotine-plus.svg

# Rename nicotine.py executable to nicotine
mv $RPM_BUILD_ROOT/%{_bindir}/%{alt_name}.py $RPM_BUILD_ROOT/%{_bindir}/%{alt_name}
sed -i "s|Exec=%{alt_name}.py|Exec=%{alt_name}|" $RPM_BUILD_ROOT/%{_datadir}/applications/%{alt_name}.desktop

desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/%{alt_name}.desktop

%find_lang %{alt_name}


%files -f %{alt_name}.lang
%doc COPYING doc/{CHANGELOG,CHANGELOG_DOCS,KNOWN_BUGS,MAINTAINERS,README,README.import-winconfig,TODO,TRANSLATIONS,TRANSLATORS}
%{_bindir}/*
%dir %{_datadir}/%{alt_name}
%doc %{_datadir}/%{alt_name}/documentation
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*
%{_mandir}/man1/*.1.gz
%{python_sitelib}/*.egg-info
%{python_sitelib}/%{nicotine_pythonsitedir}


%changelog
* Thu Jul 31 2014 Mohamed El Morabity <melmorabity@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@lists.fedoraproject.org> - 1.2.16-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.16-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.16-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.16-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Mar 16 2011 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.2.16-4
- Add nicotine+-1.2.16-ListModels_casts.patch to fix
  http://www.nicotine-plus.org/ticket/726
- Add nicotine+-1.2.16-tab_labels.patch to fix
  http://www.nicotine-plus.org/ticket/727
- Install (and use) a SVG icon for the application menu
- Spec cleanup

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.16-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Dec 29 2010 Mohamed El Morabity <melmorabity@fedorapeople.org> - 1.2.16-2
- Add nicotine+-1.2.16-RHBZ662786.patch paych to fix RHBZ #66278

* Tue Nov 09 2010 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.2.16-1
- Update to 1.2.16
- Repack source to remove nonfree sound themes (licensed under CC Sampling Plus
  1.0)
- Drop nicotine+-1.2.15-about_menu_item.patch patches (fixed upstream)
- Fix nicotine+-1.2.15-urls_commands.patch patch (typo) and rename to
  nicotine+-1.2.16-urls_commands.patch
- Remove useless Requires gstreamer-python
- Disable sounds in default configuration (since there is no more sound themes)
- Fix icon name in .desktop file
- Add nicotine+-1.2.16-documentation.patch to disable documentation installation
  in %%{_datadir} (except NicotinePlusGuide.html, needed by application help)
- Rename nicotine.py executable to nicotine

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 1.2.15-3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sat Feb 20 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.15-2
- Add nicotine+-1.2.15-about_menu_item.patch patch to add missing icon in the
  "About" menu item

* Sat Feb 20 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.15-1
- Update to 1.2.15
- Drop nicotine+-1.2.14-glade_install.patch / nicotine+-1.2.14-desktop.patch /
  nicotine+-1.2.14-commands.patch / nicotine+-1.2.14-guide.patch patches (merged
  upstream)
- Add nicotine+-1.2.15-urls_commands.patch to set xdg-open as the default
  program to open URLS
- Update .spec from new Python guidelines

* Mon Jan 25 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.14-6
- Own directory %%{_datadir}/%%{alt_name}

* Thu Jan 14 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.14-5
- Drop no-shebang patch for a sed command

* Sat Jan  2 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.14-4
- Add nicotine+-1.2.14-guide.patch to force the application to retrieve the
  installed guide in the right place

* Fri Jan  1 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.14-3
- Update nicotine+-1.2.14-commands.patch patch to use GStreamer to play audio
  effects

* Fri Jan  1 2010 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.14-2
- Add nicotine+-1.2.14-commands.patch patch to set xdg-open as the default
  program to open files or URLs
- Add therefore Requires on xdg-utils

* Sun Dec 27 2009 ELMORABITY Mohamed <melmorabity@fedoraproject.org> 1.2.14-1
- Initial RPM release