%global fontfamilyname %{name}
%global majorver -0.9
%if 0%{?fedora} >= 12
%global fontpackagename fonts
%else
%global fontpackagename %{fontfamilyname}-fonts
%endif
Name: mscore
Summary: Music Composition & Notation Software
Version: 0.9.4
Release: 5%{?dist}
# rtf2html is LGPLv2+
# paper4.png paper5.png are LGPLv3
# the rest is GPLv2
License: GPLv2 and LGPLv2+ and LGPLv3
Group: Applications/Multimedia
URL: http://musescore.org/en
# Upstream tarball contains a non-free soundfont "Gort's Minipiano"
# We generate our own tarball by removing this soundfont via:
# wget http://downloads.sourceforge.net/mscore/mscore-0.9.4.tar.bz2
# tar jxf mscore-*.tar.bz2
# rm -f mscore-*/mscore/mscore/data/piano1.sf2
# tar jcf mscore-0.9.4-free.tar.bz2 mscore-0.9.4/
Source0: %{name}-%{version}-free.tar.bz2
# The upstream provides a stipped down version of AWL plugin for qtdesigner.
# We don't really need to package this. The full version of AWL plugin
# will be part of the upcoming muse2.
Patch1: %{name}-no-awl-plugin.patch
# We don't build the common files (font files, wallpapers, demo song, instrument
# list) into the binary executable to reduce its size. This is also useful to
# inform the users about the existence of different choices for common files.
# The font files need to be separated due to the font packaging guidelines.
Patch2: %{name}-separate-commonfiles.patch
# On Fedora < 11 there is no default soundfont
Patch10: %{name}-use-pclite-soundfont.patch
# Use Fedora's default soundfont instead of the removed one:
Patch11: %{name}-use-default-soundfont.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: alsa-lib-devel
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: fluidsynth-devel
BuildRequires: jack-audio-connection-kit-devel
BuildRequires: portaudio-devel
BuildRequires: qt4-devel
# Fonts related:
BuildRequires: fontforge
BuildRequires: fontpackages-devel
BuildRequires: t1utils
BuildRequires: texlive
%if 0%{?fedora} >= 11
BuildRequires: tex-cm-lgc
%else
BuildRequires: tetex-font-cm-lgc
%endif
# fontpackages-1.21 has different behavior
%if 0%{?fedora} >= 12
Requires: %{name}-fonts = %{version}-%{release}
%else
Requires: %{name}-%{fontfamilyname}-fonts = %{version}-%{release}
%endif
# Doxygen documentation is useless. Hence we don't build it for now.
# Otherwise it needs:
# BuildRequires: graphviz doxygen texlive-latex texlive-dvips
# On Fedora < 11 there is no default soundfont
%if 0%{?fedora} >= 11
Requires: soundfont2-default
%else
Requires: PersonalCopy-Lite-soundfont
%endif
Provides: musescore = %{name}-%{version}
%description
MuseScore is a free cross platform WYSIWYG music notation program. Some
highlights:
* WYSIWYG, notes are entered on a "virtual note sheet"
* Unlimited number of staves
* Up to four voices per staff
* Easy and fast note entry with mouse, keyboard or MIDI
* Integrated sequencer and FluidSynth software synthesizer
* Import and export of MusicXML and Standard MIDI Files (SMF)
* Available in 12 languages
# fontpackages-1.21 has different behavior
%package %{fontpackagename}
Summary: MuseScore fonts
Group: User Interface/X
License: GPL+ with exceptions
Requires: fontpackages-filesystem
%if "%{fontpackagename}" == "fonts"
Obsoletes: mscore-mscore-fonts < 0.9.4-4
Provides: mscore-mscore-fonts = %{version}-%{release}
%endif
%description %{fontpackagename}
MuseScore is a free cross platform WYSIWYG music notation program.
This package contains the musical notation fonts for use of MuseScore.
%prep
%setup -q
%if 0%{?fedora} < 11
%patch10 -p1 -b .pclite.soundfont
%else
%patch11 -p1 -b .default.soundfont
%endif
%patch1 -p1 -b .noawlplugin
%patch2 -p1 -b .separatecommon
# Remove the precompiled binary
rm mscore/rtf2html/rtf2html
# Force Fedora specific flags:
find . -name CMakeLists.txt -exec sed -i 's|-O3|%{optflags}|' {} \;
find . -name CMakeLists.txt -exec sed -i 's|-fno-exceptions|%{optflags}|' {} \;
# Use global fluidsynth instead of the bundled one:
sed -i 's|USE_GLOBAL_FLUID FALSE|USE_GLOBAL_FLUID TRUE|' %{name}/CMakeLists.txt
# Do not build the bundled qt scripting interface:
sed -i 's|BUILD_SCRIPT_INTERFACE TRUE|BUILD_SCRIPT_INTERFACE FALSE|' %{name}/CMakeLists.txt
sed -i 's|BUILD_SCRIPT_DEBUG TRUE|BUILD_SCRIPT_DEBUG FALSE|' %{name}/CMakeLists.txt
# Fix EOL encoding
sed 's|\r||' %{name}/rtf2html/README > tmpfile
touch -r %{name}/rtf2html/README tmpfile
mv -f tmpfile %{name}/rtf2html/README
# Fix for systems (usually 64bit ones) where size_t != unsigned int
sed -i 's|relStaff %%d, %%d|relStaff %%d, %%zd|' %{name}/%{name}/importxml.cpp
# Remove preshipped fonts. We will build them from source
rm -f %{name}/%{name}/fonts/*.ttf
%build
# Build the actual program
mkdir build
pushd build
export PATH=${PATH}:%{_libdir}/qt4/bin
%cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_FLAGS="%{optflags}" ../mscore
make lupdate %{?_smp_flags}
make lrelease %{?_smp_flags}
make %{?_smp_flags} VERBOSE=1
popd
# Build fonts from source:
pushd %{name}/%{name}/fonts
./genFont
popd
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
# Install fonts
mkdir -p %{buildroot}/%{_fontdir}
install -pm 644 %{name}/%{name}/fonts/%{fontfamilyname}*.ttf %{buildroot}/%{_fontdir}
# Desktop file
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop
# Move images to the freedesktop location
mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/{32x32,64x64}/apps/
mv %{buildroot}/%{_datadir}/pixmaps/%{name}.xpm \
%{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/
mv %{buildroot}/%{_datadir}/pixmaps/%{name}.png \
%{buildroot}/%{_datadir}/icons/hicolor/64x64/apps/
# Manpage
mkdir -p %{buildroot}/%{_mandir}/man1
install -pm 644 %{name}/packaging/%{name}.1 %{buildroot}/%{_mandir}/man1
# Openoffice templates
cp -a %{name}/utils/OOoMuseScore/ %{buildroot}/%{_datadir}/%{name}%{?majorver}
# There are many doc files spread around the tarball. Let's collect them
pushd %{name}
mv rtf2html/ChangeLog ChangeLog.rtf2html
mv rtf2html/COPYING.LESSER COPYING.LESSER.rtf2html
mv rtf2html/README README.rtf2html
mv rtf2html/README.mscore README.mscore.rtf2html
mv rtf2html/README.ru README.ru.rtf2html
mv osdabzip/README README.osdabzip
mv osdabzip/README.mscore README.mscore.osdabzip
mv share/wallpaper/COPYRIGHT COPYING.wallpaper
popd
%check
# The tests seem outdated. Skipping.
%clean
rm -rf %{buildroot}
%post
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_datadir}/icons/hicolor &>/dev/null
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files
%defattr(-,root,root,-)
%doc mscore/{ChangeLog*,COPYING*,manual/manual-de.odt,NEWS,README*}
%{_bindir}/%{name}
%{_datadir}/%{name}%{?majorver}
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/*
# fontpackages-1.21 has different behavior
%if "%{fontpackagename}" == "fonts"
%_font_pkg %{fontfamilyname}*.ttf
%else
%_font_pkg -n %{fontfamilyname} %{fontfamilyname}*.ttf
%endif
%changelog
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Jun 11 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 0.9.4-4
- Font package cleanup for F-12 (RHBZ#493463)
- One specfile for all releases
* Mon Mar 23 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 0.9.4-3.fc10.1
- Add BR: tetex-font-cm-lgc for Fedora < 11
* Mon Mar 23 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 0.9.4-3
- Add Provides: musescore = %%{name}-%%{version}
- Replace "fluid-soundfont" requirement with "soundfont2-default"
* Fri Mar 06 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 0.9.4-2
- Add extra BR:tex-cm-lgc for F-11+. This is necessary to build the fonts from source
- Update icon scriptlets according to the new guidelines
* Sat Feb 21 2009 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> 0.9.4-1
- Initial Fedora build