Name: python-music21 Version: 2.2.1 Release: 1%{?dist} Summary: A toolkit for computational musicology License: BSD or LGPLv3 URL: http://web.mit.edu/music21/ Source0: https://github.com/cuthbertLab/music21/releases/download/v.%{version}/music21-%{version}.tar.gz Patch0: 0001-Use-sensible-default-on-nix.patch Patch1: 0002-Do-not-use-a-predicatable-directory-name-for-the-scr.patch Patch2: 0003-Use-system-six-in-docstring.patch BuildRequires: lilypond BuildRequires: mscore BuildRequires: xorg-x11-server-Xvfb BuildRequires: dos2unix BuildArch: noarch # Use the same directory of the main package for subpackage licence and docs %global _docdir_fmt %{name} %description Music21 is a set of tools for helping scholars and other active listeners answer questions about music quickly and simply. It supports input of melodies in shorthand notation, printing of musical scores, etc. %package -n python2-music21 Summary: %{summary} %{?python_provide:%python_provide python2-music21} BuildRequires: python2-devel BuildRequires: python-chardet BuildRequires: python-jsonpickle BuildRequires: python-mock BuildRequires: python-webcolors BuildRequires: python-xlrd BuildRequires: python-six BuildRequires: python-enum34 BuildRequires: python-pillow BuildRequires: python-matplotlib BuildRequires: numpy BuildRequires: scipy Requires: python-chardet Requires: python-jsonpickle Requires: python-mock Requires: python-webcolors Requires: python-xlrd Requires: python-six Requires: python-enum34 Requires: python-pillow Requires: python-matplotlib Requires: numpy Requires: scipy Requires: lilypond Requires: mscore Requires: %{name}-common = %{version}-%{release} Suggests: %{name}-doc %description -n python2-music21 Music21 is a set of tools for helping scholars and other active listeners answer questions about music quickly and simply. It supports input of melodies in shorthand notation, printing of musical scores, etc. %package -n python3-music21 Summary: %{summary} %{?python_provide:%python_provide python3-music21} BuildRequires: python3-devel BuildRequires: python3-jsonpickle BuildRequires: python3-chardet BuildRequires: python3-mock BuildRequires: python3-webcolors BuildRequires: python3-xlrd BuildRequires: python3-six BuildRequires: python3-pillow BuildRequires: python3-matplotlib BuildRequires: python3-chardet BuildRequires: python3-numpy BuildRequires: python3-scipy Requires: python3-chardet Requires: python3-jsonpickle Requires: python3-mock Requires: python3-webcolors Requires: python3-xlrd Requires: python3-six Requires: python3-pillow Requires: python3-matplotlib # Requires: python3-pyaudio Requires: python3-numpy Requires: python3-scipy Requires: lilypond Requires: mscore Requires: %{name}-common = %{version}-%{release} Suggests: %{name}-doc %description -n python3-music21 Music21 is a set of tools for helping scholars and other active listeners answer questions about music quickly and simply. It supports input of melodies in shorthand notation, printing of musical scores, etc. %package common Summary: Music corpus and other shared files for music21 %description common This package contains shared files for %{name} and python3-music21. %package doc Summary: Documentation for music21 %description doc This package contains HTML documentation for %{name} and python3-music21. %prep %autosetup -n music21-%{version} -p1 rm -r music21/ext -r sed -i 's/from music21.ext.nbconvert/from IPython.html.nbconvert/' music21/documentation/writers.py find music21 -name '*.py' -exec sed -i ' s/from music21.ext import/import/; s/from music21.ext.six import/from six import/; ' {} \; find music21 -name '*.py' -exec sed -i '' {} \; sed -i 1d \ music21/alpha/trecento/exceldiff.py \ music21/demos/josquin/label_intervals.py \ music21/alpha/trecento/findTrecentoFragments.py dos2unix music21/documentation/build/html/_sources/tutorials/advancedGraphing.txt %build %py2_build %py3_build %install %py2_install %py3_install mkdir -p %{buildroot}%{_pkgdocdir} mv %{buildroot}%{python2_sitelib}/music21/documentation/build/html %{buildroot}%{_pkgdocdir}/ # source is kept around so tests can pass rm -r %{buildroot}%{python2_sitelib}/music21/documentation/build rm -r %{buildroot}%{python3_sitelib}/music21/documentation/build mkdir -p %{buildroot}%{_datadir}/music21/corpus \ %{buildroot}%{_datadir}/music21/scale/scala mv -v %{buildroot}%{python3_sitelib}/music21/corpus/[a-z]*/ \ %{buildroot}%{_datadir}/music21/corpus/ mv -v %{buildroot}%{python3_sitelib}/music21/scale/scala/scl \ %{buildroot}%{_datadir}/music21/scale/scala/ pushd %{buildroot}%{python2_sitelib}/music21/corpus/ dirs=$(echo [a-z]*/) rm -r $dirs for i in $dirs; do ln -s %{_datadir}/music21/corpus/$i .; done popd pushd %{buildroot}%{python3_sitelib}/music21/corpus/ for i in $dirs; do ln -s %{_datadir}/music21/corpus/$i .; done popd pushd %{buildroot}%{python2_sitelib}/music21/scale/scala/ rm -r scl ln -sv %{_datadir}/music21/scale/scala/scl . popd pushd %{buildroot}%{python3_sitelib}/music21/scale/scala/ ln -sv %{_datadir}/music21/scale/scala/scl . popd %check mkdir -p ~/Desktop PYTHONPATH=%{buildroot}%{python2_sitelib} \ LC_ALL=en_US.utf8 \ xvfb-run -a \ %{__python2} -c 'from music21.test.multiprocessTest import mainPoolRunner as tm; tm()' PYTHONPATH=%{buildroot}%{python3_sitelib} \ LC_ALL=en_US.utf8 \ xvfb-run -a \ %{__python3} -c 'from music21.test.multiprocessTest import mainPoolRunner as tm; tm()' %files -n python2-music21 %{python2_sitelib}/music21/ %{python2_sitelib}/*.egg-info %exclude %{python2_sitelib}/music21/documentation/source %exclude %{python2_sitelib}/music21/documentation/autogenerated %exclude %{python2_sitelib}/music21/LICENSE %files -n python3-music21 %{python3_sitelib}/music21/ %{python3_sitelib}/*.egg-info %exclude %{python3_sitelib}/music21/documentation/source %exclude %{python3_sitelib}/music21/documentation/autogenerated %exclude %{python3_sitelib}/music21/LICENSE %files common %license LICENSE %doc README.md %{_datadir}/music21/ %files doc %license LICENSE %doc README.md %{_pkgdocdir}/html/ %changelog * Sat Dec 5 2015 Zbigniew Jędrzejewski-Szmek - 2.2.1-1 - Update to latest version * Sat Dec 5 2015 Zbigniew Jędrzejewski-Szmek - 2.1.2-2 - Use Suggests for documentation - Move common files to python3 directory - Fix some encodings and file headers * Mon Oct 5 2015 Zbigniew Jędrzejewski-Szmek - 2.1.2-1 - Update to latest version - Use new python packaging macros * Fri Jul 10 2015 Zbigniew Jędrzejewski-Szmek - 2.0.5-2 - Switch to pypi tarball - Untabify and escape macros in comments * Fri Jun 19 2015 Zbigniew Jędrzejewski-Szmek - 2.0.5-1 - Initial packaging