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

Alexis Deruelle alexis.deruelle at cegetel.net
Thu Jan 18 10:33:14 PST 2007


Hi,

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

This was primarily a learning experience in packaging for me.

The spec file as is, is intended for inclusion into the source tree (as it is
easier to follow the versioning of the source tree).

I'll try to investigate into an out of tree spec file later on...

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) apply the patch bellow

2) #> scons srctar

3) #> rpmbuild -ta ardour-2.0* (use --target=<processor type> for processor specific build e.g. --target=i686)

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

Index: ardour.spec.in
===================================================================
--- ardour.spec.in	(revision 0)
+++ ardour.spec.in	(revision 0)
@@ -0,0 +1,336 @@
+%define _ardour_build_with_tranzport 1
+%define _sourcename ardour
+%define package_name ardour2
+%define package_version %VERSION%%EXTRA_VERSION%
+%define package_release 0.0%REVISION_STRING%
+%define package_epoch 0
+
+Name:           %{package_name}
+Version:        %{package_version}
+Release:        %{package_release}
+Epoch:		%{package_epoch}
+Summary:        The new digital audio workstation
+
+License:        GPL
+Group:          Applications/Multimedia
+Source:         %{_sourcename}-%{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}
+
+%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 %{_sourcename}-%{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 ardour --all-name
+%find_lang libgtkmm2ext --all-name
+
+# Create desktop entry
+%{__cat} > ardour2.desktop << EOF
+[Desktop Entry]
+Name=Ardour 2
+Comment=Multitrack audio recording
+Exec=ardour2
+Icon=ardour2.png
+Terminal=false
+Type=Application
+Categories=Application;AudioVideo;
+Encoding=UTF-8
+EOF
+
+%if %{?_ardour_build_with_vst:1}0
+# Create desktop entry
+%{__cat} > ardour2-vst.desktop << EOF
+[Desktop Entry]
+Name=Ardour 2 VST
+Comment=Multitrack audio recording with VST plugins support
+Exec=ardourvst
+Icon=ardour2.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 \
+    ardour2.desktop
+%if %{?_ardour_build_with_vst:1}0
+desktop-file-install \
+    --vendor "%{?desktop_vendor}" \
+    --dir %{buildroot}%{_datadir}/applications \
+    ardour2-vst.desktop
+%endif
+%else
+%{__install} -m 0644 %{name}.desktop \
+    %{buildroot}%{_sysconfdir}/X11/applnk/Multimedia/ardour2.desktop
+if %{?_ardour_build_with_vst:1}0
+%{__install} -m 0644 %{name}vst.desktop \
+    %{buildroot}%{_sysconfdir}/X11/applnk/Multimedia/ardour2-vst.desktop
+%endif
+
+%{__install} -Dp -m 0644 gtk2_ardour/icons/ardour_icon_16px.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/ardour2.png
+%{__install} -Dp -m 0644 gtk2_ardour/icons/ardour_icon_22px.png %{buildroot}%{_datadir}/icons/hicolor/22x22/apps/ardour2.png
+%{__install} -Dp -m 0644 gtk2_ardour/icons/ardour_icon_32px.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/ardour2.png
+%{__install} -Dp -m 0644 gtk2_ardour/icons/ardour_icon_48px.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/ardour2.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/ardour2.png
+%{_datadir}/icons/hicolor/22x22/apps/ardour2.png
+%{_datadir}/icons/hicolor/32x32/apps/ardour2.png
+%{_datadir}/icons/hicolor/48x48/apps/ardour2.png
+
+%{_libdir}/ardour2/ardour-%{version}
+
+%{_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/ardour2.desktop
+%if %{?_ardour_build_with_vst:1}0
+%{_datadir}/applications/ardour2-vst.desktop
+%endif
+
+%{_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 Jan 11 2007 Alexis Deruelle <alexis.deruelle at laposte.net>
+- change package name to ardour2
+
+* Tue Jan  9 2007 Alexis Deruelle <alexis.deruelle at laposte.net>
+- spec.in template support
+
+* 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
Index: SConstruct
===================================================================
--- SConstruct	(revision 1360)
+++ SConstruct	(working copy)
@@ -311,7 +311,7 @@
 #
 
 def versioned_builder(target,source,env):
-    w, r = os.popen2( "svn info | awk '/^Revision:/ { print $2}'")
+    w, r = os.popen2( "LANG= svn info | awk '/^Revision:/ { print $2}'")
     
     last_revision = r.readline().strip()
     w.close()
@@ -1061,7 +1061,14 @@
 env = conf.Finish()
 
 rcbuild = env.SubstInFile ('ardour.rc','ardour.rc.in', SUBST_DICT = subst_dict)
+subst_dict['%VERSION%'] = ardour_version[0:3]
+subst_dict['%EXTRA_VERSION%'] = ardour_version[3:]
+subst_dict['%REVISION_STRING%'] = ''
+if os.path.exists('.svn'):
+    subst_dict['%REVISION_STRING%'] = '.' + fetch_svn_revision ('.') + 'svn'
 
+specbuild = env.SubstInFile ('ardour.spec','ardour.spec.in', SUBST_DICT = subst_dict)
+
 the_revision = env.Command ('frobnicatory_decoy', [], create_stored_revision)
 
 env.Alias('revision', the_revision)
@@ -1078,6 +1085,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',




More information about the Ardour-Dev mailing list