changeset 463:93efb2d59021 v1.0-linuxbuild

Linux deployment bits
author Chris Cannam
date Mon, 13 Apr 2015 13:42:40 +0100
parents 1a8ad855b7cb
children 3e285a309c74
files deploy/linux/deb-skeleton/DEBIAN/control deploy/linux/deb-skeleton/usr/lib/tony/README deploy/linux/deb-skeleton/usr/share/applications/tony.desktop deploy/linux/deb-skeleton/usr/share/doc/tony/changelog.Debian.gz deploy/linux/deb-skeleton/usr/share/doc/tony/copyright deploy/linux/debian-dependencies.sh deploy/linux/deploy-deb.sh deploy/linux/fix-lintian-bits.sh deploy/linux/remember-to-run-lintian tony.desktop
diffstat 9 files changed, 187 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/deb-skeleton/DEBIAN/control	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,13 @@
+Package: tony
+Priority: optional
+Maintainer: Chris Cannam <cannam@all-day-breakfast.com>
+Architecture: amd64
+Version: 1.0cc-1
+Installed-Size: 6056
+Section: contrib/sound
+Depends: libqt5core5a, libsndfile1, libsamplerate0, libfftw3-3, libbz2-1.0, libpulse0, libmad0, libid3tag0, liboggz2, libfishsound1, libasound2, liblo7, liblrdf0, libsord-0-0, libserd-0-0, vamp-plugin-sdk, librubberband2, libc6
+Description: Computer-aided melody annotation from audio recordings
+ Tony is a program for computer-aided melody annotation. It has a
+ graphical interface based on the Sonic Visualiser libraries, and uses
+ the pYIN Vamp plugin to extract pitch track and notes from monophonic
+ audio.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/deb-skeleton/usr/lib/tony/README	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,1 @@
+Vamp audio analysis plugins for use by the Tony melody annotation application.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/deb-skeleton/usr/share/applications/tony.desktop	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Sonic Visualiser
+Exec=sonic-visualiser %U
+Keywords=audio; sound; visualiser; sonic;
+Terminal=false
+Type=Application
+Icon=sv-icon
+Categories=Audio;AudioVideo;
+MimeType=application/x-sonicvisualiser;application/x-sonicvisualiser-layer;application/x-ogg;audio/mp3;audio/mpeg;audio/mpegurl;audio/x-flac;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-wav;audio/wav;application/ogg;audio/x-vorbis+ogg;
Binary file deploy/linux/deb-skeleton/usr/share/doc/tony/changelog.Debian.gz has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/deb-skeleton/usr/share/doc/tony/copyright	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,31 @@
+
+Tony was developed at Queen Mary, University of London in
+collaboration with New York University.
+
+Code copyright 2005-2015 Chris Cannam, Queen Mary University of
+London, and the Tony project authors: Matthias Mauch, George Fazekas,
+Justin Salamon, and Rachel Bittner, except where indicated in the
+individual source files. Thanks also to Simon Dixon and Juan Bello.
+
+If you make use of this software for any public or commercial purpose,
+we ask you to kindly mention the authors and Queen Mary, University of
+London in your user-visible documentation. We're very happy to see
+this sort of use but would much appreciate being credited, separately
+from the requirements of the software license itself (see below).
+
+If you make use of this software for academic purposes, please cite
+one of the publications indicated on the Publications page:
+https://code.soundsoftware.ac.uk/publications?project_id=tony
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A ARTICULAR PURPOSE. See the GNU
+General Public License for more details. You should have received a
+copy of the GNU General Public License along with this program. If
+not, see http://www.gnu.org/licenses/.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/debian-dependencies.sh	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+target=$1
+
+if [ ! -f "$target" ]; then 
+    echo "Usage: $0 target-executable"
+    exit 1
+fi
+
+pfile=/tmp/packages_$$
+rfile=/tmp/redundant_$$
+
+trap "rm -f $pfile $rfile" 0
+echo 1>&2
+
+ldd "$target" | awk '{ print $3; }' | grep '^/' | while read lib; do
+    if test -n "$lib" ; then
+	dpkg-query -S "$lib"
+    fi
+    done | grep ': ' | awk -F: '{ print $1 }' | sort | uniq > $pfile
+
+echo "Packages providing required libraries:" 1>&2
+cat $pfile 1>&2
+echo 1>&2
+
+for p in `cat $pfile`; do 
+    echo Looking at $p 1>&2
+    apt-cache showpkg "$p" | grep '^  ' | grep ',' | awk -F, '{ print $1; }' | \
+	while read d; do 
+	    if grep -q '^'$d'$' $pfile; then
+		echo $p
+	    fi
+    done
+done | sort | uniq > $rfile
+
+echo "Packages that can be eliminated because other packages depend on them:" 1>&2
+cat $rfile 1>&2
+echo 1>&2
+
+cat $pfile $rfile | sort | uniq -u | sed 's/$/,/' | fmt -1000 | sed 's/^/Depends: /' | sed 's/,$/, libc6/'
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/deploy-deb.sh	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,66 @@
+#!/bin/bash
+# 
+# Run this from the build root
+
+set -e
+
+usage() {
+    echo
+    echo "Usage:"
+    echo
+    echo "$0 <version> <architecture>"
+    echo
+    echo "For example: $0 1.0cc1-1 amd64"
+    echo
+    exit 2
+}
+
+set -u
+
+version="$1"
+arch="$2"
+
+if [ -z "$version" ] || [ -z "$arch" ]; then
+    usage
+fi
+
+program=tony
+plugins="chp pyin"
+
+depdir=deploy/linux
+
+targetdir="${program}_${version}_${arch}"
+
+echo "Target dir is $targetdir"
+
+if [ -d "$targetdir" ]; then
+    echo "Target directory exists, not overwriting"
+    exit
+fi
+
+mkdir "$targetdir"
+
+cp -r "$depdir"/deb-skeleton/* "$targetdir"/
+
+mkdir -p "$targetdir"/usr/bin "$targetdir"/usr/share/pixmaps
+
+cp "$program" "$targetdir"/usr/bin/
+
+for plug in $plugins; do
+    cp "$plug/$plug.so" "$targetdir"/usr/lib/"$program"/
+done
+
+cp icons/"$program"-128x128.png "$targetdir"/usr/share/pixmaps/
+cp "$program".desktop "$targetdir"/usr/share/applications/
+cp README "$targetdir"/usr/share/doc/"$program"/
+
+perl -i -p -e "s/Architecture: .*/Architecture: $arch/" "$targetdir"/DEBIAN/control
+
+deps=`bash "$depdir"/debian-dependencies.sh "$program"`
+
+perl -i -p -e "s/Depends: .*/$deps/" "$targetdir"/DEBIAN/control
+
+bash "$depdir"/fix-lintian-bits.sh "$targetdir"
+
+sudo dpkg-deb --build "$targetdir" && lintian "$targetdir".deb
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/linux/fix-lintian-bits.sh	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+dir=$1
+
+[ -d "$dir" ] || exit 1
+
+strip "$dir"/usr/bin/*
+
+sz=`du -sx --exclude DEBIAN "$dir" | awk '{ print $1; }'`
+perl -i -p -e "s/Installed-Size: .*/Installed-Size: $sz/" "$dir"/DEBIAN/control
+
+find "$dir" -name \*~ -exec rm \{\} \;
+
+sudo chown -R root.root "$dir"/*
+
+sudo chmod -R g-w "$dir"/*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tony.desktop	Mon Apr 13 13:42:40 2015 +0100
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Tony
+Exec=tony %U
+Keywords=audio; sound; melody; singing;
+Terminal=false
+Type=Application
+Icon=tony-128x128
+Categories=Audio;AudioVideo;
+MimeType=application/x-tony;application/x-ogg;audio/mp3;audio/mpeg;audio/mpegurl;audio/x-flac;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-wav;audio/wav;application/ogg;audio/x-vorbis+ogg;