%define run_test 0
%define make_cvs 1

Name: arts
Summary: aRts (analog realtime synthesizer) - the KDE 3 sound system
Summary(ja): aRts - KDE 3 サウンドシステム
Epoch: 1
Version: 1.5.10
Release: 6%{?_dist_release}

Group: System Environment/Daemons
License: LGPLv2
URL: http://www.kde.org

Source: ftp://ftp.kde.org/pub/kde/stable/3.5.10/src/%{name}-%{version}.tar.bz2

Patch1: arts-1.1.4-debug.patch
Patch2: arts-1.3.92-glib2.patch
Patch5: arts-1.3.1-alsa.patch
Patch6: arts-1.5.8-glibc.patch
Patch7: arts-1.5.0-check_tmp_dir.patch
Patch8: arts-1.5.2-multilib.patch
# don't pop up a dialog on CPU overload (#361891)
Patch9: arts-1.5.10-cpu-overload-quiet.patch
# kde#93359
Patch50: arts-1.5.4-dlopenext.patch
Patch51: kde-3.5-libtool-shlibext.patch
# upstream patches

# security patches
# CVE-2009-3736 libtool: libltdl may load and execute code from a library in the current directory 
Patch200: libltdl-CVE-2009-3736.patch

# tweak autoconfigury so that it builds with autoconf 2.64 or 2.65
Patch300: arts-acinclude.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gcc-c++
BuildRequires: qt-devel >= 3.3.8
BuildRequires: alsa-lib-devel
BuildRequires: audiofile-devel
%if %{make_cvs}
BuildRequires: automake libtool
%endif
BuildRequires: libogg-devel libvorbis-devel glib2-devel
BuildRequires: esound-devel jack-audio-connection-kit-devel 
BuildRequires: pkgconfig
%if %{run_test}
BuildRequires: kdelibs3
%endif

Obsoletes: kdelibs-sound
Provides: kdelibs-sound

%description
arts (analog real-time synthesizer) is the sound system of KDE 3.

The principle of arts is to create/process sound using small modules which do
certain tasks. These may be create a waveform (oscillators), play samples,
filter data, add signals, perform effects like delay/flanger/chorus, or
output the data to the soundcard.

By connecting all those small modules together, you can perform complex
tasks like simulating a mixer, generating an instrument or things like
playing a wave file with some effects.

%package devel
Summary: Development files for the aRts sound server
Summary(ja): aRts サウンドサーバの開発用ファイル
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: qt-devel
Requires: glib2-devel
Requires: pkgconfig
Obsoletes: kdelibs-sound-devel
Provides: kdelibs-sound-devel

%description devel
arts (analog real-time synthesizer) is the sound system of KDE 3.

The principle of arts is to create/process sound using small modules which do
certain tasks. These may be create a waveform (oscillators), play samples,
filter data, add signals, perform effects like delay/flanger/chorus, or
output the data to the soundcard.

By connecting all those small modules together, you can perform complex
tasks like simulating a mixer, generating an instrument or things like
playing a wave file with some effects.

Install arts-devel if you intend to write applications using arts (such as
KDE applications using sound).

%prep
%setup -q
%patch1 -p1 -b .debug
%patch2 -p1 -b .glib
%patch5 -p1 -b .alsa
%patch6 -p1 -b .glibc
%patch7 -p1 -b .check_tmp_dir
%patch8 -p1 -b .multilib
%patch9 -p1 -b .cpu-overload-quiet

%patch50 -p1 -b .dlopenext
%patch51 -p1 -b .libtool-shlibext

%patch200 -p1 -b .CVE-2009-3736

%patch300 -p1 -b .acinclude

%build
%if %{make_cvs}
# hack/fix for newer automake
  sed -iautomake -e 's|automake\*1.10\*|automake\*1.1[0-5]\*|' admin/cvs.sh
  make -f admin/Makefile.common cvs
%endif

unset QTDIR || : ; . /etc/profile.d/qt.sh

%configure \
    --includedir=%{_includedir}/kde \
    --with-qt-libraries=$QTDIR/lib \
    --disable-rpath \
    --disable-debug --disable-warnings \
    --disable-dependency-tracking \
    --enable-new-ldflags \
    --disable-libmad \
    --with-alsa \
    --enable-final

make %{?_smp_mflags}

%if %{run_test}
make check
%endif

%install
rm -rf $RPM_BUILD_ROOT
export PATH=`pwd`:$PATH
make DESTDIR=$RPM_BUILD_ROOT install

## remove references to optional external libraries in .la files (#178733)
find $RPM_BUILD_ROOT%{_libdir} -name "*.la" | xargs \
 sed -i \
 -e "s|-lmad||g" \
 -e "s|%{_libdir}/libmad.la||g" \
 -e "s|-lvorbisfile||g" \
 -e "s|-lvorbisenc||g" \
 -e "s|-lvorbis||g" \
 -e "s|-logg||g" \
 -e "s|-lasound||g" \
 -e "s|-laudiofile||g" \
 -e "s|-lesd||g" \
 -e "s|%{_libdir}/libesd.la||g" \
 -e "s|-lgmodule-2.0||g" \
 -e "s|-lgthread-2.0||g" \
 -e "s|-lglib-2.0||g" \
 -e "s|-laudio ||g" \
 -e "s|-lpng -lz ||g" \
 -e "s|%{_libdir}/libartsc.la||g" \
 -e "s@-lboost_filesystem@@g" \
 -e "s@-lboost_regex@@g" \
 -e "s@-ljack@@g"

#rm -rf $RPM_BUILD_ROOT%{_libdir}/lib*.la

#chmod a+x $RPM_BUILD_ROOT%{_libdir}/*

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc COPYING.LIB
%dir %{_libdir}/mcop
%dir %{_libdir}/mcop/Arts
%{_bindir}/arts*
%exclude %{_bindir}/artsc-config
%{_libdir}/mcop/Arts/*
%{_libdir}/mcop/*.mcopclass
%{_libdir}/mcop/*.mcoptype
%{_libdir}/lib*.so.*
%{_libdir}/lib*.la

%files devel
%defattr(-,root,root)
%{_bindir}/artsc-config
%{_bindir}/mcopidl
%{_includedir}/kde/arts
%{_includedir}/kde/artsc
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/artsc.pc

%changelog
* Mon May 07 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.5.10-6
- rebuild with audiofile-0.3.4

* Sun Sep 26 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.10-5
- rebuilt with rpm-4.8.1 for pkg-config

* Sat Jul 17 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.10-4
- disabled AutoReq: off

* Sat Mar 20 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.10-3
- rebuilt with new toolchain
- added Patch9, 200 and 300 from FC
  * Wed Dec 16 2009 Kevin Kofler <Kevin@tigcc.ticalc.org> - 1.5.10-11
  - don't pop up a dialog on CPU overload (#361891)
  * Thu Dec 10 2009 Stepan Kasal <skasal@redhat.com> - 1.5.10-10
  - patch autoconfigury to build with autoconf >= 2.64
  * Sun Dec 06 2009 Than Ngo <than@redhat.com> - 1.5.10-9
  - fix url
  - fix security issues in libltdl (CVE-2009-3736)
- added Japanese summary
- fixed duplicated entry at last changelog

* Sat May  9 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.10-2
- added Patch1,2,5,8,50 and 51 from Fedora
- added lib*.la files again...

* Wed Apr 15 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.10-1
- updated to 1.5.10
- added BuildRequires: jack-audio-connection-kit-devel 
- removed static library

* Sun Jul 12 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.8-1vl5
- applied new versioning policy
- updated build dependancies

* Wed Oct 10 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.8-0vl2
- rebuild for VineSeed

* Wed Oct 10 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.8-0vl1
- new upstream release

* Mon Jun 18 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.7-0vl2
- rebuild for VineSeed

* Sun May 20 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.7-0vl1
- new upstream release

* Wed Jan 17 2007 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.6-0vl1
- new upstream release

* Tue Nov 14 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.5-0vl5
- rebuild for VineSeed

* Tue Nov 14 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.5-0vl4
- add Patch0 [VineLinux:0369]

* Sat Oct 14 2006 NAKAMURA Kenta <kenta@vinelinux.org> 1.5.5-0vl3
- added --with-qt-libraries option
- removed --libdir=%%{_libdir} option

* Tue Oct  3 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.5-0vl2
- rebuild for VineSeed

* Tue Oct  3 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.5-0vl1
- new upstream release

* Mon Aug  7 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.4-0vl2
- rebuild for VineSeed

* Mon Aug  7 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.4-0vl1
- new upstream release
- drop Patch0

* Sat Aug 05 2006 NAKAMURA Kenta <kenta@vinelinux.org> 1.5.3-0vl5
- added --libdir=%%{_libdir} to ./configure option

* Mon Jun 12 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.3-0vl4
- rebuild for VineSeed

* Mon Jun 12 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.3-0vl3
- add Patch0 (CVE-2006-2916)

* Wed May 24 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.3-0vl2
- rebuild for VineSeed

* Wed May 24 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.3-0vl1
- new upstream release

* Mon Mar 20 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.2-0vl2
- rebuild for VineSeed

* Mon Mar 20 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.2-0vl1
- new upstream release

* Tue Jan 24 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.1-0vl2
- rebuild for VineSeed

* Tue Jan 24 2006 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.1-0vl1
- new upstream release

* Mon Dec 19 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 1.5.0-0vl3
- add "%%{epoch}:" to Requires in arts-devel

* Thu Dec  8 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.0-0vl2
- rebuild for VineSeed

* Mon Nov 21 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.0-0vl1
- new upstream release

* Fri Nov 11 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.5.0-0vl0.rc1
- new upstream release

* Thu Oct 13 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.92-0vl1
- new upstream release

* Mon Sep 12 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.91-0vl1
- new upstream release

* Fri Jul 22 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.2-0vl2
- rebuild for VineSeed

* Fri Jul 22 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.2-0vl1
- new upstream release

* Mon Jun 27 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.1-0vl2
- add alsa support for VineSeed
- add --disable-rpath to configure option

* Mon Jun 20 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.1-0vl1
- new upstream release
- use %%{?_smp_mflags} for make option
- add BuildPrereq: esound-devel libmad-devel

* Wed Mar 16 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.0-0vl2
- rebuild for VineSeed

* Thu Mar 10 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.0-0vl1
- new upstream release

* Tue Mar  1 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.4.0-0vl0.rc1
- new upstream release (1.4.0-rc1)

* Mon Feb  7 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.3.92-0vl1
- new upstream release

* Tue Jan 25 2005 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.3.91-0vl1
- new upstream release

* Sun Dec 12 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.3.2-0vl2
- rebuild for VineSeed

* Wed Dec  1 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.3.2-0vl1
- source upgrade

* Tue Oct  5 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.3.1-0vl1
- source upgrade
- refine %%files

* Sun Sep  5 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.3.0-0vl1
- source upgrade

* Tue Aug 10 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.3-0vl2
- rebuild with qt32

* Fri Jun  4 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.3-0vl1
- source upgrade
- remove lines about vine26
- BuildPrereq: XOrg-devel XOrg-gl-devel

* Fri Apr 30 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.2-0vl1
- source upgrade

* Thu Mar  4 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.1-0vl1
- source upgrade

* Sun Feb  1 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.2.0-0vl1
- source upgrade
- add Requires: glib2 to arts-devel package

* Sat Jan 17 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.5-0vl2
- rebuild for VineSeedPlus

* Sat Jan 10 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.5-0vl1
- source upgrade
- build for VinePlus/2.6
- (VinePlus/2.6) BuildPrereq: autoconf258

* Sun Dec 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.4-0vl3
- build for VineSeed with new toolchain and qt-3.2.3
- add BuildPrereq: gcc-c++ gcc-g77 glib2-devel pkgconfig

* Sun Oct 19 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.4-0.26vl2
- rebuild with qt-3.2.1-0.26vl3

* Sun Oct 19 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.4-0vl2
- rebuild with qt-3.2.1-0vl3

* Tue Sep 17 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.4-0vl1
- source upgrade
- build with gcc-3.2.3

* Thu Jul 17 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.3-0vl1
- source upgrade

* Sun Jun 29 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.2-0vl3
- change spec to build with gcc295
- change make option for SMP and add script

* Wed Jun 18 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.2-0vl2
- build with gcc295
- add KDEDIR and QTDIR

* Sat May 10 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.2-0vl1
- source upgrade

* Mon Apr 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.1-0vl3
- rebuilt with libpng >= 1.2.5 when %{vine26} is set to 0 (ie VineSeedPlus)

* Mon Apr 21 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.1-0vl2
- rebuild with qt-3.1.2-0vl2

* Sat Mar 22 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1.1-0vl1
- source upgrade

* Mon Feb 24 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1-0vl4
- rebuild with qt-3.1.1-0vl3

* Tue Feb 11 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1-0vl3
- change spec to build both VineSeed and Vine2.5/2.6

* Fri Jan 31 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1-0vl2
- OOPS! rebuild with spec that changed 1.1-0vl0.2

* Fri Jan 31 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1-0vl1
- source upgrade to kde-3.1-stable

* Wed Jan 22 2003 Tomoya TAKA <taka@vinelinux.org> 1.1-0vl0.2
- add '-fPIC' to FLAGS on alpha

* Wed Jan  8 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.1-0vl0.1
- source upgrade to kde-3.1-rc6
- stop using objprelink2, it does not work with gcc3

* Tue Oct 16 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.4-0vl2
- objprelink2 support only i386 (add %ifarch i386 ... again)
-
* Thu Oct 10 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.4-0vl1
- source upgrade

* Tue Oct  8 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.0.3-0vl4
- rebuild with qt-3.0.5-0vl1
- BuildPrereq: qt-devel >= 3.0.5 autoconf253 objprelink2

* Thu Aug 20 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.3-0vl3
- add BuildPrereq: libogg-devel libvorbis-devel

* Wed Jul 10 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.3-0vl2
- rebuild

* Mon Jul  8 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.3-0vl1
- source upgrade

* Thu Jul  4 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.2-0vl1
- source upgrade

* Fri Jun  7 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.1-0vl1
- source upgrade to 1.0.1
- add BuildPrereq: objprelink for i386

* Wed Apr 24 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.0-0vl2
- add configure option `--with-xinerama'
- add `Requires: %%{name} = %%{version}-%%{release}' for arts-devel

* Thu Apr  4 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.0.0-0vl1
- source upgrade to 1.0.0

* Sat Mar 30 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 0.9.9-1vl1
- source update to cvs-20020329
- build for VineSeed
- merged with 3.0-0.cvs20020313.1
- Epoch: 1
- add BuildPrereq: autoconf252 automake15

* Wed Mar 13 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0-0.cvs20020313.1
- Build with autoconf 2.53, automake 1.5

* Thu Feb 14 2002 Bernhard Rosenkraenzer <bero@redhat.com> 3.0-0.cvs20020114.1
- initial package
