File lilypond-doc.spec of Package lilypond

#
# spec file for package lilypond-doc
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


#%%define info yes

Name:           lilypond-doc
Version:        2.16.1
Release:        0
BuildRequires:  autoconf
BuildRequires:  autotrace
BuildRequires:  bison
BuildRequires:  dblatex
BuildRequires:  dejavu
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  fontconfig-devel >= 2.4.0
BuildRequires:  fontforge-devel
BuildRequires:  freetype2-devel >= 2.1.10
BuildRequires:  gcc-c++
BuildRequires:  gentium
BuildRequires:  gettext-tools
BuildRequires:  ghostscript-fonts-other
#BuildRequires:  ghostscript-fonts-rus
BuildRequires:  ghostscript-fonts-std
BuildRequires:  ghostscript-library >= 8.60
BuildRequires:  guile1 >= 1.8.2
BuildRequires:  gzip
BuildRequires:  libgnutls-devel
BuildRequires:  libguile1-devel >= 1.8.2
BuildRequires:  libtool
BuildRequires:  mftrace
BuildRequires:  pango-devel >= 1.12
BuildRequires:  perl
BuildRequires:  python-devel >= 2.4
BuildRequires:  t1utils
BuildRequires:  texlive-metapost
BuildRequires:  zip

BuildRequires:  ImageMagick-extra
BuildRequires:  netpbm
BuildRequires:  rsync
BuildRequires:  texinfo

BuildRequires:  fonts-arabic
BuildRequires:  ifntjapa
BuildRequires:  lilypond = %{version}
BuildRequires:  ttf-wqy-zenhei
BuildRequires:  xfntjp
BuildRequires:  xorg-x11-fonts
Requires:       lilypond = %{version}
Provides:       lilypond-documentation = %{version}
Obsoletes:      lilypond-documentation < %{version}
Summary:        Documentation for the lilypond typesetter
License:        GFDL-1.3
Group:          Documentation/HTML
BuildArch:      noarch
Url:            http://lilypond.org/
Source0:        http://download.linuxaudio.org/lilypond/sources/v2.16/lilypond-%{version}.tar.gz
Patch0:         lilypond-python26.patch
Patch1:         lilypond-gcc44-relocate.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         %install_info_prereq /usr/bin/touch /usr/bin/sed

%description 
LilyPond is a music typesetter, an automated engraving system.  It
produces beautiful sheet music using a high level description file as input.

LilyPond supports many forms of music notation constructs, including
chord names, drum notation, figured bass, grace notes, guitar tablature,
modern notation (cluster notation and rhythmic grouping), tremolos,
(nested) tuplets in arbitrary ratios, and more.

LilyPond's text-based music input language support can integrate into
LaTeX, HTML and Texinfo seamlessly, allowing single sheet music
or musicological treatises to be written from a single source.  Form and
content are separate, and with LilyPond's expert automated formatting,
users don't need typographical expertise to produce good notation.

LilyPond produces PDF, PostScript, SVG, or TeX printed output, as well
as MIDI for listening pleasures.  LilyPond is exported from the
RoseGarden and NoteEdit GUIs, and can import ABC, ETF and MIDI.

Documentation files for the GNU LilyPond music typesetter.

LilyPond is part of the GNU Project.

%global rlversion %{version}
#%%(bash %%{S:6} %%{S:0})
%define usrsrcp %{buildroot}

%define _configure ./smart-configure.sh

##    ln -sf ../%%{name}/%%{rlversion}/ls-R lilypond-snippets \
#      rm -f lilypond-snippets.gz; \
#      ln -sf ../doc/packages/lilypond/html/input/lsr lilypond-snippets) \

%prep
%setup -q -n lilypond-%{version}
%patch0
%patch1
# Convert translations to UTF-8
for file in $(grep -L charset=UTF-8 po/*.po) ; do
    msgconv -t UTF-8 $file >$file.new
    mv $file.new $file
done
mkdir -p out/examples/
tar -cf - input/  | tar -C out/examples/ -xf- || true

%define _buildir $PWD

%build

#smart-autogen.sh
#--noconfigure
# export GS_LIB="/home/$USER/.fonts" is a work around for bnc#568280
%if 1 == 1
export GS_LIB="/home/$USER/.fonts:%{_buildir}/mf/out"
export CFLAGS="-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -ggdb"
%if 0%{?suse_version} == 1210
export CFLAGS="$CFLAGS -fno-optimize-sibling-calls"
%endif
export GUILE_AUTO_COMPILE=0
export CFLAGS="$RPM_OPT_FLAGS -ggdb -fpermissive -fabi-version=4"
export CXXFLAGS="$CFLAGS"
%endif
export LILYPOND_EXTERNAL_BINARY="%{_bindir}/lilypond"
export LILYPOND_BINARY=$LILYPOND_EXTERNAL_BINARY
%configure --with-ncsb-dir=%{_datadir}/ghostscript/fonts/
./smart-autogen.sh --noconfigure

gs -h
# build documentation
echo "*********************************"
echo "* Start the documentation build *"
echo "*********************************"
rm -rf lily/out/lilypond
ln -s %{_bindir}/lilypond lily/out/lilypond
rm -rf GNUmakefile
cp GNUmakefile.in GNUmakefile
make -C scripts && make -C python
pushd Documentation
LILYPOND_EXTERNAL_BINARY="%{_bindir}/lilypond" LILYPOND_BINARY=$LILYPOND_EXTERNAL_BINARY make -e %{?jobs:-j%jobs CPU_COUNT=%jobs} doc \
|| (lndir  -ignorelinks out-www/notation . \
LILYPOND_EXTERNAL_BINARY="%{_bindir}/lilypond" LILYPOND_BINARY=$LILYPOND_EXTERNAL_BINARY make %{?jobs:-j%jobs CPU_COUNT=%jobs} doc)
#make po-replace
popd
make out=www WWW-post

%install
echo %rlversion
echo %{rlversion}
mkdir -p "%{buildroot}%{_datadir}/lilypond/%{rlversion}"

# install documentation
make install-doc DESTDIR=%{buildroot} webdir=%{_docdir}/lilypond

cp -a COPYING LICENSE LICENSE.DOCUMENTATION \
  DEDICATION HACKING ROADMAP AUTHORS.txt NEWS.txt \
  THANKS VERSION elisp/server.el.patch \
  %{buildroot}%{_docdir}/lilypond
#ChangeLog
#install -m0644 "%%{SOURCE3}" "%%{buildroot}%%{_docdir}/%%{name}"

find %{buildroot}%{_docdir}/lilypond -name *.signature -exec rm {} \;

# Fix any .py files with shebangs and wrong permissions.
if test -z `find %{buildroot}%{_datadir}/lilypond/ -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
then break;
else chmod -f 0755 `find %{buildroot}%{_datadir}/lilypond/ -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
fi
LILYPOND_EXTERNAL_BINARY=/usr/bin/lilypond
%find_lang lilypond
texhash %{buildroot}%{_datadir}/lilypond/%{rlversion}
find %{buildroot}%{_docdir}/lilypond/ -type f -empty -delete -print
%fdupes -s %{buildroot}%{_docdir}
%fdupes -s %{buildroot}%{_datadir}/omf
%fdupes -s %{buildroot}%{_datadir}/locale

# remove the symlink to recreate it later - brp-* scripts on old distros are broken, so we can't even have a %%ghost ;(
rm %{buildroot}%{_infodir}/lilypond

# && rm -f lilypond-snippets && ln -sf ../doc/packages/%%{name}/html/input/lsr lilypond-snippets)

%post
rm %{_infodir}/lilypond || :
ln -s %{_docdir}/lilypond/Documentation %{_infodir}/lilypond
%install_info --info-dir=%{_infodir} %{_infodir}/lilypond

%postun
rm -f %{_infodir}/lilypond

%files
%defattr(-,root,root)
%dir %{_datadir}/omf/lilypond
%dir %{_datadir}/omf
%{_datadir}/omf/lilypond/*
%{_docdir}/lilypond
%dir %{_docdir}/lilypond
%{_docdir}/lilypond/*
%exclude %{_docdir}/lilypond/LICENSE
%exclude %{_docdir}/lilypond/LICENSE.DOCUMENTATION
%exclude %{_docdir}/lilypond/COPYING
%exclude %{_docdir}/lilypond/DEDICATION
%exclude %{_docdir}/lilypond/HACKING
%exclude %{_docdir}/lilypond/ROADMAP
%exclude %{_docdir}/lilypond/THANKS
%exclude %{_docdir}/lilypond/VERSION
%exclude %{_docdir}/lilypond/AUTHORS.txt
%exclude %{_docdir}/lilypond/NEWS.txt
%exclude  %{_docdir}/lilypond/server.el.patch
%exclude %{_infodir}/*.gz
%exclude %{_datadir}/lilypond/%{rlversion}/ls-R

%changelog
openSUSE Build Service is sponsored by