cc5cf31f73f70040e0d3c600b3dd50dad260d340
[ardour.git] / tools / linux_packaging / build
1 #!/bin/bash
2
3 #
4
5 . ./buildenv
6
7 # script for pulling together a Linux app bundle.
8 #
9 # This will create a bundle for a single architecture.
10 # Execute this scirpt on both x86 and x86_64 and then use
11 # package to merge the 2 bundles into a final package with the
12 # installer.
13
14 MIXBUS=
15 WITH_LADSPA=0
16 STRIP=all
17 PRINT_SYSDEPS=
18 WITH_NLS=
19 EXTERNAL_JACK=
20 VENDOR=Ardour ;
21 BUILDTYPE=""
22
23 if [ $# -eq 0 ] ; then
24         echo ""  
25         echo "ERROR - Please specify build type"
26         echo "    --public"
27         echo "    --mixbus"
28         echo ""  
29         exit 1
30 fi
31
32 while [ $# -gt 0 ] ; do
33         echo "arg = $1"
34         case $1 in
35
36         #
37         # top level build targets
38         #
39
40         --mixbus)
41                 MIXBUS=1; 
42                 WITH_NLS=1 ; 
43                 WITH_LADSPA=; 
44                 STRIP=all
45                 APPNAME=Mixbus ;
46                 VENDOR=Harrison ;
47                 shift ;;
48         --public)
49                 WITH_NLS=1 ; 
50                 WITH_LADSPA=; 
51                 STRIP=all ; 
52                 APPNAME=Ardour ;
53                 shift ;;
54         --allinone)
55                 WITH_NLS= ; 
56                 WITH_LADSPA=1; 
57                 STRIP=all; 
58                 shift ;;
59         --test) WITH_LADSPA=; STRIP= ; shift ;;
60
61         #
62         # specific build flags
63         #
64
65         --nojack) INTERNAL_JACK= ; shift ;;
66         --noladspa) WITH_LADSPA= ; shift ;;
67         --strip) STRIP=$2 ; shift ; shift ;;
68         --sysdeps) PRINT_SYSDEPS=1; shift ;;
69         --nls) WITH_NLS=1 ; shift ;;
70
71         *)
72                 #catch all for unknown arguments
73                 echo ""
74                 echo "!!! ERROR !!! - Unknown argument $1"
75                 echo ""
76                 exit 1
77                 ;;
78         esac
79 done
80
81 if test x$STRIP != xall -a x$STRIP != xnone -a x$STRIP != xsome ; then
82     echo "Unknown strip option \"$STRIP\""
83     echo "Legal values are: all, none, some"
84     exit 1
85 fi
86
87 release_version=`grep -m 1 '^VERSION' ../../wscript | awk '{print $3}' | sed "s/'//g"`
88 svn_version=`grep -m 1 'svn_revision =' ../../libs/ardour/svn_revision.cc | cut -d"'" -f 2`
89 echo "Version is $release_version / $svn_version"
90 info_string="$release_version/$svn_version built on `hostname` by `whoami` on `date`"
91 echo "Info string is $info_string"
92
93 # Figure out our CPU type
94 case `uname -m` in
95         i[3456789]86|x86|i86pc)
96                 echo "Architecture is x86"
97                 ARCH='x86'
98                 ARCH_BITS='32-bit'
99                 ;;
100         x86_64|amd64|AMD64)
101                 echo "Architecture is x86_64"
102                 ARCH='x86_64'
103                 ARCH_BITS='64-bit'
104                 ;;
105         *)
106                 echo ""
107                 echo "ERROR - Unknown architecture `uname -m`"
108                 echo ""
109                 exit 1
110                 ;;
111 esac
112
113 # Figure out the Build Type
114 if grep -q "DEBUG = True" ../../build/c4che/default.cache.py; then
115         DEBUG="T"
116 else
117         DEBUG="F"
118 fi
119
120 if [ x$DEBUG = xT ]; then
121     BUILDTYPE="dbg"
122     if [ x$STRIP = xall ] ; then
123         echo "A debug build with --strip all makes no sense - STRIP reset to \"some\""
124         STRIP=some
125     fi
126 fi
127
128 # the waf build tree to use when copying built/generated files
129
130 BUILD_ROOT=../../build
131
132 # setup directory structure
133
134 if [ -z "${BUILDTYPE}" ]; then
135         APPDIR=${APPNAME}_${ARCH}-${release_version}_${svn_version}
136         APP_VER_NAME=${APPNAME}-${release_version}_${svn_version}
137 else
138         APPDIR=${APPNAME}_${ARCH}-${release_version}_${svn_version}-${BUILDTYPE}
139         APP_VER_NAME=${APPNAME}-${release_version}_${svn_version}-${BUILDTYPE}
140 fi
141
142 APPBIN=$APPDIR/bin
143 APPLIB=$APPDIR/lib
144 Libraries=$APPLIB
145 Etc=$APPDIR/etc
146 Shared=$APPDIR/share
147 Plugins=$APPLIB/plugins
148 Surfaces=$APPLIB/surfaces
149 Panners=$APPLIB/panners
150 ExportFormats=$Shared/export
151 Locale=$Shared/locale
152 MidiMaps=$Shared/midi_maps
153 PatchFiles=$Shared/patchfiles
154 MackieControl=$Shared/mcp
155 Modules=$Libraries/modules
156 Loaders=$Libraries/loaders
157
158 if [ x$PRINT_SYSDEPS != x ] ; then
159 #
160 # print system dependencies
161 #
162
163         for file in $APPBIN/* $Libraries/* $Modules/* $Plugins/*.so ; do 
164                 if ! file $file | grep -qs Mach-O ; then
165                         continue
166                 fi
167                 otool -L $file | awk '{print $1}' | egrep -v "(^@executable_path|^Ardour[0-9][.0-9]*.app)" 
168         done | sort | uniq
169         exit 0
170 fi
171
172 echo "Removing old $APPDIR tree ..."
173 rm -rf $APPDIR/
174
175 echo "Building new app directory structure ..."
176
177 # only bother to make the longest paths
178
179 mkdir -p $APPDIR
180 mkdir -p $APPBIN
181 mkdir -p $APPLIB
182 mkdir -p $Etc
183 mkdir -p $Plugins
184 mkdir -p $Modules
185 mkdir -p $Loaders
186 mkdir -p $Shared
187 mkdir -p $Locale
188 mkdir -p $Surfaces
189 mkdir -p $MidiMaps
190 mkdir -p $PatchFiles
191 mkdir -p $MackieControl
192 mkdir -p $ExportFormats
193 mkdir -p $Panners
194 mkdir -p $Shared/templates
195 mkdir -p $Shared/doc
196
197 # maybe set variables
198 ENVIRONMENT=environment
199 rm -f $ENVIRONMENT
200 touch $ENVIRONMENT
201
202 if test x$MIXBUS != x ; then
203         echo export ARDOUR_MIXBUS=true >> $ENVIRONMENT
204         #
205         # current default for MIXBUS version is US keyboard layout without a keypad
206         #
207         echo export ARDOUR_KEYBOARD_LAYOUT=us-nokeypad >> $ENVIRONMENT
208         echo export ARDOUR_UI_CONF=ardour3_ui.conf >> $ENVIRONMENT
209         echo export ARDOUR3_UI_RC=ardour3_ui_dark.rc >> $ENVIRONMENT
210 fi
211
212 #
213 # if we're not going to bundle JACK, make sure we can find
214 # jack in the places where it might be
215 #
216
217 echo export 'PATH=/usr/local/bin:/opt/bin:$PATH' >> $ENVIRONMENT
218
219 # create startup helper script
220
221 sed -e "/^%ENV%/r $ENVIRONMENT" -e '/^%ENV%/d' -e 's/%VER%/'"${release_version}"'/' < ardour.sh.in > $APPBIN/ardour3
222 rm $ENVIRONMENT && chmod 775 $APPBIN/ardour3
223 #MAIN_EXECUTABLE=ardour-$release_version
224 MAIN_EXECUTABLE=ardour-3.0
225
226 echo "Copying ardour executable ...."
227 cp $BUILD_ROOT/gtk2_ardour/$MAIN_EXECUTABLE $APPBIN
228 if test x$STRIP = xall ; then
229         strip $APPBIN/$MAIN_EXECUTABLE
230 fi
231
232 # copy locale files
233 # note that at present(feb 2011), the .mo files end up in the source tree which is
234 # not really as it should be.
235 if test x$WITH_NLS != x ; then
236         echo "NLS support ..."
237         echo "I hope you remembered to run scons msgupdate!"
238         LINGUAS=
239
240         for dl in gtk2_ardour libs/ardour libs/gtkmm2ext ; do 
241             files=`find ../../$dl -name "*.mo"`
242
243             if [ -z "$files" ]; then
244                 echo ""
245                 echo "!!!! WARNING !!!! - Did not find any .mo files in ../../$dl"
246                 echo ""
247             fi
248  
249             for file in $files 
250             do
251                 echo $file
252                 lang=`basename $file | sed 's/\.mo//'`
253                 mkdir -p $Locale/$lang/LC_MESSAGES
254                 cp $file $Locale/$lang/LC_MESSAGES/`basename $dl`
255                 if echo $LINGUAS | grep $lang >/dev/null 2>&1 ; then
256                     :
257                 else 
258                     LINGUAS="$LINGUAS $lang"
259                 fi
260             done
261         done
262
263         GTK_MESSAGES="atk10.mo gdk-pixbuf.mo gtk20-properties.mo gtk20.mo atk10.mo glib20.mo"
264         LOCALEROOT=/usr/share/locale
265
266         for l in $LINGUAS ; do
267                 echo "Copying GTK i18n files for $l..."
268                 for MO in $GTK_MESSAGES ; do 
269                         if [ -f $LOCALEROOT/$l/LC_MESSAGES/$MO ] ; then
270                                 cp $LOCALEROOT/$l/LC_MESSAGES/$MO $Locale/$l/LC_MESSAGES
271                         else
272                                 # try with just the language spec
273                                 just_lang=`echo $l | sed 's/_[A-Z][A-Z]$//'`
274                                 if [ -f $LOCALEROOT/$just_lang/LC_MESSAGES/$MO ] ; then
275                                         cp $LOCALEROOT/$just_lang/LC_MESSAGES/$MO $Locale/$just_lang/LC_MESSAGES
276                                 fi
277                         fi
278                 done
279         done
280 else
281         echo "Skipping NLS support"
282 fi
283
284 ### Find fontconfig ###
285 FCROOT=`pkg-config --libs-only-L fontconfig | sed -e "s/-L//" -e "s/[[:space:]]//g"`
286 if [ ! -z "$FCROOT" ]; then
287         echo "Found FCOOT using pkg-config"
288         FCETC=`dirname $FCROOT`/etc
289 elif [ -d /usr/lib/gtk-2.0 ]; then
290         FCETC="/etc"
291 elif [ -d /usr/local/lib/gtk-2.0 ]; then
292         FCETC="/usr/local/etc"
293 else
294         echo ""
295         echo "!!! ERROR !!! - Unable to locate fontconfig directory. Packager will exit"
296         echo ""
297         exit 1
298 fi
299
300 echo "Copying Fontconfig files to $Etc ..."
301 cp -r $FCETC/fonts $Etc
302
303 ### Find gtk ###
304 GTKROOT=`pkg-config --libs-only-L gtk+-2.0 | sed -e "s/-L//" -e "s/[[:space:]]//g"`
305 if [ ! -z "$GTKROOT" ]; then
306         echo "Found GTKROOT using pkg-config"
307 elif [ -d /usr/lib/gtk-2.0 ]; then
308         GTKROOT="/usr/lib"
309 elif [ -d /usr/local/lib/gtk-2.0 ]; then
310         GTKROOT="/usr/local/lib"
311 else
312         echo ""
313         echo "!!! ERROR !!! - Unable to locate gtk-2.0 directory. Packager will exit"
314         echo ""
315         exit 1
316 fi
317
318 echo "GTKROOT is ${GTKROOT}"
319 versionDir=`ls ${GTKROOT}/gtk-2.0/ | grep "[0-9]*\.[0-9]*\.[0-9]*"`
320
321 num=0
322 for name in $versionDir ; do
323     num=$(($num + 1))
324 done
325
326 if [ $num -eq 1 ]; then
327         GTKLIB=${GTKROOT}/gtk-2.0/$versionDir
328         echo "GTKLIB is ${GTKLIB}"
329 else
330         echo ""
331         echo "!!! ERROR !!! - More than one gtk-2.0 version found in ${GTKROOT}/gtk-2.0/  ( $versionDir ). Packager will exit"
332         echo ""
333         exit 1
334 fi
335
336
337 ### Find pango ###
338 PANGOROOT=`pkg-config --libs-only-L pango | sed -e "s/-L//" -e "s/[[:space:]]//g"`
339 if [ ! -z "$PANGOROOT" ]; then
340         echo "Found PANGOROOT using pkg-config"
341 elif [ -d /usr/lib/pango ]; then
342         PANGOROOT="/usr/lib"
343 elif [ -d /usr/local/lib/pango ]; then
344         PANGOROOT="/usr/local/lib"
345 elif [ -d /usr/lib/x86_64-linux-gnu/pango ]; then
346         PANGOROOT="/usr/lib/x86_64-linux-gnu"
347 else
348         echo ""
349         echo "!!! ERROR !!! - Unable to locate pango directory. Packager will exit"
350         echo ""
351         exit 1
352 fi
353
354 echo "PANGOROOT is ${PANGOROOT}"
355 versionDir=`ls ${PANGOROOT}/pango/ | grep "[0-9]*\.[0-9]*\.[0-9]*"`
356
357 num=0
358 for name in $versionDir ; do
359         num=$(($num + 1))
360 done
361
362 if [ $num -eq 1 ]; then
363         PANGOLIB=${PANGOROOT}/pango/$versionDir
364         echo "PANGOLIB is ${PANGOLIB}"
365 else
366         echo ""
367         echo "!!! ERROR !!! - More than one pango version found in ${PANGOROOT}/pango/  ( $versionDir ). Packager will exit"
368         echo ""
369         exit 1
370 fi
371
372
373 ### Find gdk-pixbuf ###
374 GDKPIXBUFROOT=`pkg-config --libs-only-L gdk-pixbuf-2.0 | sed -e "s/-L//" -e "s/[[:space:]]//g"`
375 if [ ! -z "$GDKPIXBUFROOT" ]; then
376         echo "Found GDKPIXBUFROOT using pkg-config"
377 elif [ -d /usr/lib/gdk-pixbuf-2.0 ]; then
378         GDKPIXBUFROOT="/usr/lib"
379 elif [ -d /usr/local/lib/gdk-pixbuf-2.0 ]; then
380         GDKPIXBUFROOT="/usr/local/lib"
381 elif [ -d ${GTKLIB}/loaders ]; then  #odd ball case
382         GDKPIXBUFROOT=${GTKROOT}
383         GDKPIXBUFLIB=${GTKLIB}
384 else
385         echo ""
386         echo "!!! ERROR !!! - Unable to locate gdk-pixbuf-2.0 directory. Packager will exit"
387         echo ""
388         exit 1
389 fi
390
391 echo "GDKPIXBUFROOT is ${GDKPIXBUFROOT}"
392
393 if [ -z ${GDKPIXBUFLIB} ]; then
394         versionDir=`ls ${GDKPIXBUFROOT}/gdk-pixbuf-2.0/ | grep "[0-9]*\.[0-9]*\.[0-9]*"`
395
396         num=0
397         for name in $versionDir ; do
398             num=$(($num + 1))
399         done
400
401         if [ $num -eq 1 ]; then
402                 GDKPIXBUFLIB=${GDKPIXBUFROOT}/gdk-pixbuf-2.0/$versionDir
403                 echo "GDKPIXBUFLIB is ${GDKPIXBUFLIB}"
404         else
405                 echo ""
406                 echo "!!! ERROR !!! - More than one gdk-pixbuf-2.0 version found in ${GDKPIXBUFROOT}/pango/  ( $versionDir ). Packager will exit"
407                 echo ""
408                 exit 1
409         fi
410 fi
411
412
413
414 echo "Copying all Pango modules ..."
415 cp -R $PANGOLIB/modules/*.so $Modules
416
417 echo "Copying all GDK Pixbuf loaders ..."
418 cp -R $GDKPIXBUFLIB/loaders/*.so $Loaders
419
420 pango-querymodules | sed "s?$PANGOLIB/?@ROOTDIR@/?" > $Etc/pango.modules.in
421 gdk-pixbuf-query-loaders | sed "s?$GDKPIXBUFLIB/?@ROOTDIR@/?" > $Etc/gdk-pixbuf.loaders.in
422
423 # We sort of rely on clearlooks, so include a version
424 # this one is special - we will set GTK_PATH to $Libraries/clearlooks
425
426 if [ ! -e ${GTKLIB}/engines/libclearlooks.so ]; then
427     if [ ! -e $BUILD_ROOT/libs/clearlooks-newer/libclearlooks.so ] ; then 
428         echo ""
429         echo "!!! ERROR !!! - not able to locate libclearlooks.so"
430         echo ""
431         echo "Packager with exit"
432         exit 1
433     else 
434         clearlooks_so=$BUILD_ROOT/libs/clearlooks-newer/libclearlooks.so
435     fi
436 else
437     clearlooks_so=${GTKLIB}/engines/libclearlooks.so
438 fi
439
440 echo "Copying clearlooks ..."
441 cp $clearlooks_so $Libraries
442 mkdir -p $Libraries/clearlooks/engines
443 (cd $Libraries/clearlooks/engines && ln -s ../../libclearlooks* libclearlooks.so )
444
445 # LADSPA
446 if test x$WITH_LADSPA != x ; then
447         if test x$MIXBUS != x ; then
448                 plugdir=mixbus_ladspa
449         else
450                 plugdir=ladspa
451         fi
452         echo "Copying `ls $plugdir | wc -l` plugins ..."
453         if [ -d $plugdir ] ; then
454                 cp -r $plugdir/* $Plugins
455         fi
456 fi
457
458 # Control Surfaces
459 cp $BUILD_ROOT/libs/surfaces/*/libardour*.so* $Surfaces
460 # hack ... move libardour_cp back into Libraries
461 mv $Surfaces/libardourcp.so* $Libraries
462
463 # MidiMaps
464 # got to be careful with names here
465 for x in $BUILD_ROOT/../midi_maps/*.map ; do
466     cp "$x" $MidiMaps
467     echo Copied MIDI map $x 
468 done
469
470 # MIDNAM Patch Files
471 # got to be careful with names here
472 for x in $BUILD_ROOT/../patchfiles/*.midnam ; do
473     cp "$x" $PatchFiles
474     echo Copied MIDNAM file "$x"
475 done
476
477 # MackieControl data
478 # got to be careful with names here
479 for x in $BUILD_ROOT/../mcp/*.device $BUILD_ROOT/../mcp/*.profile ; do
480     cp "$x" $MackieControl
481     echo Copied Mackie Control file $x 
482 done
483
484 # ExportFormats
485 # got to be careful with names here
486 for x in $BUILD_ROOT/../export/*.preset $BUILD_ROOT/../export/*.format ; do
487     cp "$x" $ExportFormats
488 done
489
490 # Panners
491 cp $BUILD_ROOT/libs/panners/*/lib*.so* $Panners
492
493 # VAMP plugins that we use
494 cp $BUILD_ROOT/libs/vamp-plugins/libardourvampplugins.so* $Libraries
495
496 OURLIBDIR=$BUILD_ROOT/libs
497 OURLIBS=$OURLIBDIR/vamp-sdk:$OURLIBDIR/surfaces/control_protocol:$OURLIBDIR/ardour:$OURLIBDIR/midi++2:$OURLIBDIR/pbd:$OURLIBDIR/rubberband:$OURLIBDIR/soundtouch:$OURLIBDIR/gtkmm2ext:$OURLIBDIR/sigc++2:$OURLIBDIR/glibmm2:$OURLIBDIR/gtkmm2/atk:$OURLIBDIR/gtkmm2/pango:$OURLIBDIR/gtkmm2/gdk:$OURLIBDIR/gtkmm2/gtk:$OURLIBDIR/libgnomecanvasmm:$OURLIBDIR/libsndfile:$OURLIBDIR/evoral:$OURLIBDIR/evoral/src/libsmf:$OURLIBDIR/audiographer:$OURLIBDIR/timecode:$OURLIBDIR/taglib:$OURLIBDIR/qm-dsp
498
499 echo $OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
500
501 checkedIdx=0
502 deplibs=
503
504 while [ true ] ; do 
505         missing=false
506         filelist=`find $APPLIB/ -type f`
507         filelist="$APPBIN/$MAIN_EXECUTABLE $filelist"
508
509         for file in $filelist  ; do 
510                 if ! file $file | grep -qs ELF ; then
511                         continue
512                 fi
513
514                 # speed this up a bit by not checking things multiple times.
515                 for i in "${depCheckedList[@]}"; do
516                         if [ $i == $file ]; then
517                                 continue 2
518                         fi
519                 done
520                 depCheckedList[$checkIdx]=$file
521                 checkIdx=$(($checkIdx + 1))
522                 
523                 # do not include libjack
524                 deps=`LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | awk '{print $3}'`
525
526                 # LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file | egrep "(/opt/|/local/|libs/|/usr/lib|/gtk)" | grep -v 'libjack\.'
527                 echo -n "."
528                 for dep in $deps ; do
529                         if test "not" = ${dep}; then 
530                                 echo ""
531                                 echo "!!! ERROR !!! - Missing dependant library for $file."
532                                 echo ""
533                                 (LD_LIBRARY_PATH=$OURLIBS${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ldd $file)
534                                 echo ""
535                                 echo "!!! ERROR !!! - See Above"
536                                 exit 1
537                         fi
538
539                         # don't use anything mapped at a specific address
540                         if echo $dep | grep -qs '0x' ; then continue; fi
541                         # don't include /lib
542                         if echo $dep | grep -qs "^/lib/" ; then continue; fi
543                         # don't include jack
544                         if echo $dep | grep -qs libjack ; then continue; fi
545                         # don't include any X Window libraries
546                         if echo $dep | grep -qs libX ; then continue; fi  
547                         if echo $dep | grep -qs libxcb ; then continue; fi  
548                         # don't include libc
549                         if echo $dep | grep -qs 'libc\.' ; then continue; fi
550                         # don't include libstdc++
551                         if echo $dep | grep -qs libstdc++ ; then continue; fi
552
553                         base=`basename $dep`
554                         if ! test -f $Libraries/$base; then
555                                 parent=$(basename ${file})
556                                 if echo $dep | grep -sq '^libs' ; then
557                                         echo "Copying dependant lib $BUILD_ROOT/$dep    (required by ${parent})"
558                                         cp $BUILD_ROOT/$dep $Libraries
559                                 else
560                                         echo "Copying dependant lib $dep    (required by ${parent})"
561                                         cp $dep $Libraries
562                                 fi
563                                 if echo $dep | grep -sq '^/' ; then
564                                     # absolute path, candidate for stripping
565                                     deplibs="$deplibs $base"
566                                 fi
567                                 missing=true
568                         fi
569                 done
570         done
571         if test x$missing = xfalse ; then
572                 # everything has been found
573                 break
574         fi
575 done
576 echo
577
578 # strip libraries
579 if test x$STRIP = xall ; then
580     echo Stripping all libraries
581     # Must be writable so that we can strip
582     find $APPLIB/ -name "*.so*" | xargs chmod u+w
583     # and strip ...
584     find $APPLIB/ -name "*.so*" | xargs strip
585 elif test x$STRIP = xsome ; then
586     echo Stripping dependent libraries
587     for l in $deplibs ; do
588         chmod u+w $APPLIB/$l
589         strip $APPLIB/$l
590     done
591 fi
592 find $APPLIB/ -name "*.so*" | xargs chmod a+rx
593
594 echo "Copying other stuff to $APPDIR  ..."
595
596 # these are all generated by waf
597 #cp $BUILD_ROOT/gtk2_ardour/ergonomic-us.bindings       $Etc
598 cp $BUILD_ROOT/gtk2_ardour/mnemonic-us.bindings  $Etc
599 cp $BUILD_ROOT/gtk2_ardour/ardour.menus $Etc
600 cp $BUILD_ROOT/ardour_system.rc $Etc/ardour_system.rc
601 cp $BUILD_ROOT/gtk2_ardour/ardour3*.rc $Etc
602
603 # these are copied straight from the source tree
604
605 cp ../../gtk2_ardour/ardour3_ui_default.conf $Etc/ardour3_ui_default.conf
606 cp ../../gtk2_ardour/ardour3_ui_default.conf $Etc/ardour3_ui.conf
607 cp ../../instant.xml $Etc/instant.xml
608 cp ../../gtk2_ardour/step_editing.bindings $Etc
609 cp ../../gtk2_ardour/mixer.bindings $Etc
610 cp -r ../../gtk2_ardour/icons $Shared
611 cp -r ../../gtk2_ardour/pixmaps $Shared
612
613
614 #
615 # put sooper sekrit ingredients here and they will be copied
616 #
617
618 if [ -d specialSauce ] ; then
619         cp -r specialSauce $Etc
620 fi
621
622 # share stuff
623
624 cp -R ../../gtk2_ardour/splash.png $Shared
625 # currently no templates
626 #cp ../../templates/*.template $Shared/templates/
627
628 # go through and recursively remove any .svn dirs in the bundle
629 for svndir in `find $APPDIR -name .svn -type d`; do
630         rm -rf $svndir
631 done
632
633 #
634 # Add the uninstaller
635 #
636 sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_BUILD%/${svn_version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh
637 chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh
638
639 #Sanity Check file
640 if [ -e $BUILD_ROOT/tools/sanity_check/sanityCheck ]; then
641         cp $BUILD_ROOT/tools/sanity_check/sanityCheck $APPBIN
642 else
643         echo "!!!ERROR !!! sanityCheck program is missing. packager will exit without being complete"
644         exit 1
645 fi
646
647 echo "Building tarball ..."
648
649 rm -f $APPDIR.tar.bz2
650 tar -cjf $APPDIR.tar.bz2 $APPDIR
651
652 echo "Calculating bundle size"
653 du -sb $APPDIR/  | awk '{print $1}' > $APPDIR.size
654
655 rm -rf $APPDIR/
656
657 echo "Done."
658