[ardour-dev] [RFC]Fedora Core 6 spec file for ardour2

Alexis Deruelle alexis.deruelle at cegetel.net
Sat Dec 30 10:38:29 PST 2006


Hi,

Here's a preliminary spec file for packaging ardour2 on Fedora Core 6.
I did not investigate the compatibility with other rpm based distro.

This is primarily a learning experience in packaging for me, so ...

I will try to add the necessary support in SConstruct file to update
the spec file with version information (ardour.spec.in -> ardour.spec)

VST support :

Threre's a vst build infrastructure, that you can activate by defining
the _ardour_build_with_vst in ~/.rpmmacros. That way, a ardour-vst rpm
will be created that will depend on the ardour rpm. You also have to
copy the sdk file in the %{_topdir}/RPMS/SOURCES beforehand
(the vst_sdk2_3.zip file).

YOU CAN'T REDISTRIBUTE THOSE RPMS ! YOU'VE BEEN WARNED !

Unfortunatly, only the ardourvst program will be usable if you build
and install the rpms that way. The ardour2 will fail with missing
symbols message (fst_* functions).

Indeed, the libardour.so library is generated by both build (VST=0
and VST=1) and are incompatible. Would it be possible to separate
more carefully the VST build from the normal ardour build in order
to not have such a problem ? That way both version could coexist on
my system.

Instructions :

1) copy ardour.spec at the root of the source tree

2) apply following patch 

--- SConstruct  (révision 1253)
+++ SConstruct  (copie de travail)
@@ -1068,6 +1068,7 @@
                [ 'SConstruct', 'svn_revision.h',
                   'COPYING', 'PACKAGER_README', 'README',
                   'ardour.rc.in',
+                  'ardour.spec',
                   'ardour_system.rc',
                   'tools/config.guess',
                   'icons/icon/ardour_icon_mac_mask.png',

3) #> scons srctar

4) #> rpmbuild -ta ardour (use --target=<proc type> for processor specific build)

5) Et voilà, you should find the rpm in %{_topdir}/RPMS/i386/


Here the spec file :

%define _version 2.0
%define _extra_version beta10
%define _release 0.0.1253svn
%define _ardour_build_with_tranzport 1

Name:           ardour
Summary:        The new digital audio workstation
Version:        %{_version}%{_extra_version}
Release:        %{_release}

License:        GPL
Group:          Applications/Multimedia
Source:         %{name}-%{version}.tar.bz2
%if %{?_ardour_build_with_vst:1}0
Source1:        vst_sdk2_3.zip
%endif 
URL:            http://ardour.org

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  scons >= 0.96
BuildRequires:  gcc-c++ >= 3.1
BuildRequires:  gettext >= 0.12.1
BuildRequires:  libtool >= 1.5.0
BuildRequires:  glib2-devel >= 2.10.1
BuildRequires:  gtk2-devel >= 2.10
BuildRequires:  libgnomecanvas-devel >= 2.0
BuildRequires:  liblrdf-devel >= 0.4.0
BuildRequires:  libxslt-devel >= 1.1.0
BuildRequires:  fftw3-devel >= 3.1.0
BuildRequires:  alsa-lib-devel >= 1.0.12
BuildRequires:  jack-audio-connection-kit-devel >= 0.101.1
BuildRequires:  liblo-devel >= 0.23
BuildRequires:  libsamplerate-devel >= 0.1.0
BuildRequires:  libsndfile-devel >= 1.0.16
BuildRequires:  boost-devel >= 1.33.0
%{?_ardour_build_with_vst:BuildRequires: wine-devel}
%if ! %{?_ardour_build_without_surfaces:1}0 && %{?_ardour_build_with_tranzport:1}0
BuildRequires: libusb-devel
%endif
%{!?_without_freedesktop:BuildRequires: desktop-file-utils}

Provides: ardour2

%description

Ardour is a digital audio workstation. You can use it to record, edit and mix
multi-track audio. Produce your own CD's. Mix video soundtracks. Experiment
with new ideas about music and sound. Generate sound installations for 12
speaker gallery shows.

%prep
%setup -q -n %{name}-%{version}
%if %{?_ardour_build_with_vst:1}0
    unzip %{_sourcedir}/vst_sdk2_3.zip *.zip
    mv vstsdk2.3.zip libs/fst
%endif

%build
set -x
# build standard ardour
scons %{?_smp_mflags} \
    DIST_TARGET=%{_target_cpu} \
    PREFIX=%{_prefix} \
%if %{?_ardour_build_without_surfaces:1}0
    SURFACES=0 \
%endif
    VST=0

# build ardour with VST support
%if %{?_ardour_build_with_vst:1}0
scons %{?_smp_mflags} \
    DIST_TARGET=%{_target_cpu} \
    PREFIX=%{_prefix} \
    VST=1
%endif

%install
%{__rm} -rf %{buildroot}
mkdir -p %{buildroot}

scons DESTDIR=%{buildroot} \
    VST=0 \
    install

%if %{?_ardour_build_with_vst:1}0
scons DESTDIR=%{buildroot} \
    VST=1 \
    install
%endif

# Find language files for ardour, libardour and libgtkmm2ext
#
# WARNING
#
# Depends on the --all-name option
#
# Fedora Core: make sure the redhat-rpm-config package  is not
# installed as the find-lang.sh that comes with overrides the
# one of the rpm-build and it does not have the --all-name 
# option
#
%find_lang %{name} --all-name
%find_lang libgtkmm2ext --all-name

# Create desktop entry
%{__cat} > %{name}.desktop << EOF
[Desktop Entry]
Name=Ardour 2
Comment=Multitrack audio recording
Exec=ardour2
Icon=ardour.png
Terminal=false
Type=Application
Categories=Application;AudioVideo
Encoding=UTF-8
EOF

%if %{?_ardour_build_with_vst:1}0
# Create desktop entry
%{__cat} > %{name}vst.desktop << EOF
[Desktop Entry]
Name=Ardour 2 VST
Comment=Multitrack audio recording with VST plugins support
Exec=ardourvst
Icon=ardour.png
Terminal=false
Type=Application
Categories=Application;AudioVideo
Encoding=UTF-8
EOF
%endif

%if %{!?_without_freedesktop:1}0
%{__mkdir_p} %{buildroot}%{_datadir}/applications
desktop-file-install \
    --vendor "%{?desktop_vendor}" \
    --dir %{buildroot}%{_datadir}/applications \
    %{name}.desktop
%if %{?_ardour_build_with_vst:1}0
desktop-file-install \
    --vendor "%{?desktop_vendor}" \
    --dir %{buildroot}%{_datadir}/applications \
    %{name}vst.desktop
%endif
%else
%{__install} -Dp -m 0644 %{name}.desktop \
    %{buildroot}%{_sysconfdir}/X11/applnk/Multimedia/%{name}.desktop
if %{?_ardour_build_with_vst:1}0
%{__install} -Dp -m 0644 %{name}vst.desktop \
    %{buildroot}%{_sysconfdir}/X11/applnk/Multimedia/%{name}vst.desktop
%endif

%{__install} -Dp gtk2_ardour/icons/ardour_icon_16px.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/ardour.png
%{__install} -Dp gtk2_ardour/icons/ardour_icon_22px.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/ardour.png
%{__install} -Dp gtk2_ardour/icons/ardour_icon_32px.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/ardour.png
%{__install} -Dp gtk2_ardour/icons/ardour_icon_48px.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/ardour.png

%clean
rm -rf %{buildroot}

%files -f %{name}.lang -f libgtkmm2ext.lang
%defattr(-, root, root)
%doc COPYING README
%doc DOCUMENTATION/*

%{_bindir}/ardour2

%config %{_sysconfdir}/ardour2/ardour.menus
%config %{_sysconfdir}/ardour2/ardour_system.rc
%config %{_sysconfdir}/ardour2/ardour.rc
%config %{_sysconfdir}/ardour2/ardour.colors
%config %{_sysconfdir}/ardour2/ardour.bindings
%config %{_sysconfdir}/ardour2/ardour2_ui.rc

%{_datadir}/icons/hicolor/16x16/apps/ardour.png
%{_datadir}/icons/hicolor/22x22/apps/ardour.png
%{_datadir}/icons/hicolor/32x32/apps/ardour.png
%{_datadir}/icons/hicolor/48x48/apps/ardour.png

%{_libdir}/ardour2/ardour.bin

%{_libdir}/ardour2/libpbd.so
%{_libdir}/ardour2/libgdkmm2.so
%{_libdir}/ardour2/libgtkmm2.so
%{_libdir}/ardour2/libardour.so
%{_libdir}/ardour2/libsndfile-ardour.so
%{_libdir}/ardour2/libgtkmm2ext.so
%{_libdir}/ardour2/libmidi++.so
%{_libdir}/ardour2/libsoundtouch.so
%{_libdir}/ardour2/libsigc++2.so
%if ! %{?_ardour_build_without_surfaces:1}0
%{_libdir}/ardour2/surfaces/libardour_genericmidi.so
%if %{?_ardour_build_with_tranzport:1}0
%{_libdir}/ardour2/surfaces/libardour_tranzport.so
%endif
%endif
%{_libdir}/ardour2/libatkmm.so
%{_libdir}/ardour2/engines/libclearlooks.so
%{_libdir}/ardour2/libgnomecanvasmm.so
%{_libdir}/ardour2/libpangomm.so
%{_libdir}/ardour2/libglibmm2.so
%{_libdir}/ardour2/libardour_cp.so

%{_datadir}/applications/ardour.desktop

%{_datadir}/ardour2/templates/2?Track.template
%{_datadir}/ardour2/templates/4?Tracks.template
%{_datadir}/ardour2/templates/8?Tracks.template
%{_datadir}/ardour2/templates/16?Tracks.template
%{_datadir}/ardour2/templates/32?Tracks.template

%{_datadir}/ardour2/icons/ardour_icon_16px.png
%{_datadir}/ardour2/icons/ardour_icon_22px.png
%{_datadir}/ardour2/icons/ardour_icon_32px.png
%{_datadir}/ardour2/icons/ardour_icon_48px.png
%{_datadir}/ardour2/icons/fader_belt.png
%{_datadir}/ardour2/icons/hide.png
%{_datadir}/ardour2/icons/nudge_left.png
%{_datadir}/ardour2/icons/nudge_right.png
%{_datadir}/ardour2/icons/record_normal_red.png
%{_datadir}/ardour2/icons/record_tape_red.png
%{_datadir}/ardour2/icons/strip_width.png
%{_datadir}/ardour2/icons/tool_audition.png
%{_datadir}/ardour2/icons/tool_gain.png
%{_datadir}/ardour2/icons/tool_object.png
%{_datadir}/ardour2/icons/tool_stretch.png
%{_datadir}/ardour2/icons/tool_zoom.png
%{_datadir}/ardour2/icons/transport_end.png
%{_datadir}/ardour2/icons/transport_loop.png
%{_datadir}/ardour2/icons/transport_play.png
%{_datadir}/ardour2/icons/transport_range.png
%{_datadir}/ardour2/icons/transport_record.png
%{_datadir}/ardour2/icons/transport_start.png
%{_datadir}/ardour2/icons/transport_stop.png
%{_datadir}/ardour2/icons/zoom_full.png
%{_datadir}/ardour2/icons/zoom_in.png
%{_datadir}/ardour2/icons/zoom_out.png
%{_datadir}/ardour2/pixmaps/forwardblarrow.xpm
%{_datadir}/ardour2/pixmaps/hiin.xpm
%{_datadir}/ardour2/pixmaps/hiout.xpm
%{_datadir}/ardour2/pixmaps/hslider00.xpm
%{_datadir}/ardour2/pixmaps/hslider01.xpm
%{_datadir}/ardour2/pixmaps/left_arrow.xpm
%{_datadir}/ardour2/pixmaps/linin.xpm
%{_datadir}/ardour2/pixmaps/linout.xpm
%{_datadir}/ardour2/pixmaps/loin.xpm
%{_datadir}/ardour2/pixmaps/loop.xpm
%{_datadir}/ardour2/pixmaps/loout.xpm
%{_datadir}/ardour2/pixmaps/lr.xpm
%{_datadir}/ardour2/pixmaps/regin2.xpm
%{_datadir}/ardour2/pixmaps/regin.xpm
%{_datadir}/ardour2/pixmaps/regout2.xpm
%{_datadir}/ardour2/pixmaps/regout.xpm
%{_datadir}/ardour2/pixmaps/revdblarrow.xpm
%{_datadir}/ardour2/pixmaps/right_arrow.xpm
%{_datadir}/ardour2/pixmaps/set-next-button.xpm
%{_datadir}/ardour2/pixmaps/small-round-button-01.xpm
%{_datadir}/ardour2/pixmaps/small_x.xpm
%{_datadir}/ardour2/pixmaps/toggle-button-00.xpm
%{_datadir}/ardour2/pixmaps/toggle-button-01.xpm
%{_datadir}/ardour2/pixmaps/tool_audition.xpm
%{_datadir}/ardour2/pixmaps/tool_gain.xpm
%{_datadir}/ardour2/pixmaps/tool_object.xpm
%{_datadir}/ardour2/pixmaps/tool_range.xpm
%{_datadir}/ardour2/pixmaps/tool_stretch.xpm
%{_datadir}/ardour2/pixmaps/tool_zoom.xpm
%{_datadir}/ardour2/pixmaps/vslider00.xpm
%{_datadir}/ardour2/pixmaps/vslider01.xpm
%{_datadir}/ardour2/pixmaps/vslider02_rail.xpm
%{_datadir}/ardour2/pixmaps/vslider02_slider.xpm
%{_datadir}/ardour2/pixmaps/vslider_slider_16wide.xpm
%{_datadir}/ardour2/pixmaps/zoom_full.xpm
%{_datadir}/ardour2/pixmaps/zoom_in.xpm
%{_datadir}/ardour2/pixmaps/zoom_out.xpm
%{_datadir}/ardour2/splash.png

%if %{?_ardour_build_with_vst:1}0

%package vst

Group:   Applications/Multimedia
Summary: Ardour audio workstation with VST support

%description vst

Ardour VST enabled build. With this version of Ardour you will be able to use
many free available VST plugins. It needs the VST SDK file from Steinberg(tm)
to build. You CANNOT redistribute this build due to some legal issues with
the SDK. Ardour also uses Wine internally to run the plugins.

%files vst
%{_bindir}/ardourvst
%{_libdir}/ardour2/ardour_vst.exe.so
%{_libdir}/ardour2/libardourgtk.so

%{_datadir}/applications/ardourvst.desktop

%endif

%changelog
* Thu Dec 28 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- support for rpmbuild --target option and build ardour accordingly

* Wed Dec 27 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- add VST build support

* Tue Dec 26 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- don't discard gtkmm2ext i18n files

* Thu Dec 21 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- using macro for Version and Release, preparing for ardour.spec.in

* Tue Dec 19 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- Generate desktop file from within specfile
- Using %{__install} macro
- Cleanups

* Fri Dec 15 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- Adding desktop file

* Wed Dec 13 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- Fedora Extras conformance

* Fri Dec 01 2006 Alexis Deruelle <alexis.deruelle at laposte.net>
- Initial version



More information about the Ardour-Dev mailing list