%{!?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.12.1
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-qt/plugins/discnumber.py
Source2: http://users.musicbrainz.org/~luks/picard-qt/plugins/featartist.py
Source3: http://users.musicbrainz.org/~luks/picard-qt/plugins/coverart.py
Source4: http://dispuut-ivv.nl/~jan/bonusdisc.py
Source5: http://users.musicbrainz.org/~luks/picard-qt/plugins/lastfm/__init__.py
Source6: http://users.musicbrainz.org/~luks/picard-qt/plugins/lastfm/ui_options_lastfm.py
Source7: http://users.musicbrainz.org/~luks/picard-qt/plugins/addrelease.py
# search plugins
#Source10: http://users.musicbrainz.org/~brianfreud/SearchAMG.py
#Source11: http://users.musicbrainz.org/~brianfreud/SearchAmazon3.py
#Source12: http://users.musicbrainz.org/~brianfreud/SearchCastAlbums3.py
#Source13: http://users.musicbrainz.org/~brianfreud/SearchDiscogs3.py
#Source14: http://users.musicbrainz.org/~brianfreud/SearchFilmMusziek3.py
#Source15: http://users.musicbrainz.org/~brianfreud/SearchGMR.py
#Source16: http://users.musicbrainz.org/~brianfreud/SearchGoogle3.py
#Source17: http://users.musicbrainz.org/~brianfreud/SearchLortelArchives3.py
#Source18: http://users.musicbrainz.org/~brianfreud/SearchSoundtrackCollector3.py
#Source19: http://users.musicbrainz.org/~brianfreud/SearchSoundtrackINFO3.py
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}
install -pm 0644 %{SOURCE4} ${PLUGINDIR}
mkdir ${PLUGINDIR}/lastfm/
install -pm 0644 %{SOURCE5} ${PLUGINDIR}/lastfm/
install -pm 0644 %{SOURCE6} ${PLUGINDIR}/lastfm/
install -pm 0644 %{SOURCE7} ${PLUGINDIR}
# install search plugins
#install -pm 0644 %{SOURCE10} ${PLUGINDIR}
#install -pm 0644 %{SOURCE11} ${PLUGINDIR}
#install -pm 0644 %{SOURCE12} ${PLUGINDIR}
#install -pm 0644 %{SOURCE13} ${PLUGINDIR}
#install -pm 0644 %{SOURCE14} ${PLUGINDIR}
#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}
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
* 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