Blob Blame Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:             picard
Version:          0.16
Release:          1%{?dist}
Summary:          MusicBrainz-based audio tagger
Group:            Applications/Multimedia

Source0:          http://ftp.musicbrainz.org/pub/musicbrainz/picard/picard-%{version}.tar.gz

# plugins
Source1:	  http://users.musicbrainz.org/~luks/picard-plugins/discnumber.py
Source2:          http://users.musicbrainz.org/~luks/picard-plugins/featartist.py
Source3:          http://users.musicbrainz.org/~luks/picard-plugins/coverart.py
# actual location:          http://users.musicbrainz.org/~luks/picard-plugins/lastfm/__init__.py
# had to rename SOURCE4 to avoid namespace conflict with replaygain
Source4:          http://users.musicbrainz.org/~luks/picard-plugins/lastfm/__init__lastfm.py
Source5:          http://users.musicbrainz.org/~luks/picard-plugins/lastfm/ui_options_lastfm.py
Source6:          http://users.musicbrainz.org/~luks/picard-plugins/lastfm/options_lastfm.ui
Source7:	  http://users.musicbrainz.org/~luks/picard-plugins/cuesheet.py
Source8:	  http://users.musicbrainz.org/~luks/picard-plugins/open_in_gui.py
Source9:	  http://users.musicbrainz.org/~luks/picard-plugins/swapprefix.py
Source10:	  http://users.musicbrainz.org/~luks/picard-plugins/titlecase.py
Source11:	  http://users.musicbrainz.org/~luks/picard-plugins/tracks2clipboard.py
# actual location:         http://users.musicbrainz.org/~luks/picard-plugins/replaygain/__init__..py
Source12:          http://users.musicbrainz.org/~luks/picard-plugins/replaygain/__init__replaygain.py
Source13:          http://users.musicbrainz.org/~luks/picard-plugins/replaygain/ui_options_replaygain.py
Source14:          http://users.musicbrainz.org/~luks/picard-plugins/replaygain/options_replaygain.ui
Source15:	   http://users.musicbrainz.org/~luks/picard-plugins/featartistsintitles.py
Source16:	   http://users.musicbrainz.org/~luks/picard-plugins/release_type.py
Source17:	   http://users.musicbrainz.org/~luks/picard-plugins/no_release.py
Source18:	   http://gitorious.org/musicbrainz/addrelease/blobs/raw/master/addrelease.py
Source19:	   http://github.com/voiceinsideyou/creaps-picard-plugins/raw/master/titlesort.py
Source20:	   http://github.com/voiceinsideyou/creaps-picard-plugins/raw/master/titleversion.py

# bonusdisc.py not yet ported
# search plugins are obsolete

License:          GPLv2+
Url:              http://musicbrainz.org/doc/PicardTagger
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:    python-devel
BuildRequires:    gettext
BuildRequires:    desktop-file-utils
BuildRequires:    PyQt4 >= 4.3
BuildRequires:    python-mutagen > 1.9
BuildRequires:    libofa-devel
Requires:         PyQt4 >= 4.3
Requires:         python-mutagen > 1.9
Requires:         libdiscid


%description
Picard is an audio tagging application using data from the MusicBrainz
database. The tagger is album or release oriented, rather than
track-oriented.

%prep
%setup -q -n picard-%{version}

%build
env %{__python} setup.py config
env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root=$RPM_BUILD_ROOT

%find_lang %{name}
desktop-file-install --vendor="fedora"                \
  --delete-original --remove-category="Application"   \
  --dir=$RPM_BUILD_ROOT/%{_datadir}/applications      \
  $RPM_BUILD_ROOT/%{_datadir}/applications/*

# install plugins
PLUGINDIR=$RPM_BUILD_ROOT%{python_sitearch}/picard/plugins/
install -pm 0644 %{SOURCE1} ${PLUGINDIR}
install -pm 0644 %{SOURCE2} ${PLUGINDIR}
install -pm 0644 %{SOURCE3} ${PLUGINDIR}
mkdir ${PLUGINDIR}/lastfm/
install -pm 0644 %{SOURCE4} ${PLUGINDIR}/lastfm/__init__.py
install -pm 0644 %{SOURCE5} ${PLUGINDIR}/lastfm/
install -pm 0644 %{SOURCE6} ${PLUGINDIR}/lastfm/
install -pm 0644 %{SOURCE7} ${PLUGINDIR}
install -pm 0644 %{SOURCE8} ${PLUGINDIR}
install -pm 0644 %{SOURCE9} ${PLUGINDIR}
install -pm 0644 %{SOURCE10} ${PLUGINDIR}
install -pm 0644 %{SOURCE11} ${PLUGINDIR}
mkdir ${PLUGINDIR}/replaygain/
install -pm 0644 %{SOURCE12} ${PLUGINDIR}/replaygain/__init__.py
install -pm 0644 %{SOURCE13} ${PLUGINDIR}/replaygain/
install -pm 0644 %{SOURCE14} ${PLUGINDIR}/replaygain/
install -pm 0644 %{SOURCE15} ${PLUGINDIR}
install -pm 0644 %{SOURCE16} ${PLUGINDIR}
install -pm 0644 %{SOURCE17} ${PLUGINDIR}
install -pm 0644 %{SOURCE18} ${PLUGINDIR}
install -pm 0644 %{SOURCE19} ${PLUGINDIR}
install -pm 0644 %{SOURCE20} ${PLUGINDIR}


echo %{fedora}

## disable tests for the moment
%check
%{?_with_check:%{__python} setup.py test || :}

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,-)
%doc AUTHORS.txt COPYING.txt NEWS.txt INSTALL.txt
%{_bindir}/picard
%{_datadir}/applications/fedora-picard.desktop
%{_datadir}/icons/hicolor/*/apps/picard.png
%if 0%{?fedora} >= 9
%{python_sitearch}/*egg-info
%endif
%dir %{python_sitearch}/picard
%{python_sitearch}/picard/*

%changelog
* Mon Nov 14 2011  <alex@sup35.ccdom.wi.mit.edu> - 0.16-1
- Update to 0.16
- Update plugins, add titlesort, titleversion plugins.

* Sun Aug 21 2011 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.15.1-1
- Update to 0.15.1
- Add more plugins

* Mon May 30 2011 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.15-0.1.beta1
- Update to 0.15beta1 (#683055)
- Convert plugin files to files in git, easier to manage
- Only use plugins certified to be API compatible with 0.15 from
  http://users.musicbrainz.org/~luks/picard-plugins/

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

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

* Tue Nov  3 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.12.1-1
- Update to upstream 0.12.1 (brown bag fix release)

* Tue Oct 27 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.12-1
- Update to 0.12 (#531224)
- Icons now in icons/hicolor directory

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

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Dec  9 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.11-2
- Fixed sources.

* Tue Dec  9 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.11-1
- Update to latest upstream (0.11)
- Drop upstreamed patch
- Remove sed-ing of .desktop file

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.10-3
- Rebuild for Python 2.6

* Tue Sep  2 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.10-2
- Update plugin versions to 0.10 where possible.  
- Temporarily disable the search plugins until they are ported to new API.

* Sun Aug 31 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.10-1
- Update to latest upstream (0.10).
- Add patch to work around broken setup.py.
- Fixed some spec file errors: duplicate sources.

* Sat Feb  9 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.9.0-6
- rebuilt for GCC 4.3 as requested by Fedora Release Engineering

* Wed Dec 19 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-5
- Add support for python eggs for F9+

* Wed Dec 19 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-4
- Update to proper release: 0.9.0
- Drop plugins directory patch, applied upstream

* Tue Dec 04 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-0.6.beta1
- strip out png extension from .desktop file

* Tue Dec 04 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-0.5.beta1
- Add plugins from http://musicbrainz.org/doc/PicardQt/Plugins
- Patch to find proper plugins directory (filed upstream:
  http://bugs.musicbrainz.org/ticket/3430)
- Does not depend on python-musicbrainz2 any longer, uses libdiscid directly 

* Wed Nov 15 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-0.4.beta1
- Various minor spec file cleanups to make sure timestamps stay correct

* Wed Nov 14 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-0.3.beta1
- Create pixmaps directory

* Wed Nov 14 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-0.2.beta1
- Missing BR: python-devel
- Use sitearch to make sure x86_64 builds work
- Install icons share/pixmaps/, rather than share/icons/

* Wed Nov 14 2007 Alex Lancaster <alexlan@fedoraproject.org> 0.9.0-0.1.beta1
- Initial packaging