summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-05-02 22:03:48 +0200
committerGravatar waker <wakeroid@gmail.com>2012-05-02 22:03:48 +0200
commit0a8067638eeecaeb8a2aafa99794359f240f282a (patch)
tree267fbfe519596aa580ca30ce318e361800369b11 /tools
parent2c8f0d67a5b2fc56c87801eea2f3aa375c77ad4f (diff)
package building scripts
Diffstat (limited to 'tools')
-rwxr-xr-xtools/packages/arch.sh46
-rw-r--r--tools/packages/arch_install14
-rw-r--r--tools/packages/arch_pkginfo11
-rw-r--r--tools/packages/deb_control33
-rwxr-xr-xtools/packages/deb_postinst7
-rwxr-xr-xtools/packages/deb_postrm5
-rwxr-xr-xtools/packages/debian.sh77
7 files changed, 193 insertions, 0 deletions
diff --git a/tools/packages/arch.sh b/tools/packages/arch.sh
new file mode 100755
index 00000000..8e22176e
--- /dev/null
+++ b/tools/packages/arch.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+PWD=`pwd`
+VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'`
+BUILD=`cat PORTABLE_BUILD | perl -ne 'chomp and print'`
+ARCH=`uname -m | perl -ne 'chomp and print'`
+INDIR=$PWD/static/$ARCH/deadbeef-$VERSION
+TEMPDIR=$PWD/package_temp/$ARCH/arch-$VERSION
+PKGINFO=$TEMPDIR/.PKGINFO
+INSTALL=$TEMPDIR/.INSTALL
+OUTDIR=$PWD/package_out/$ARCH/arch
+
+# make dirs
+mkdir -p $TEMPDIR
+mkdir -p $OUTDIR
+
+# copy files
+cp -r $INDIR/* $TEMPDIR/
+# rm unneeded files
+rm $TEMPDIR/opt/deadbeef/lib/deadbeef/*.la
+for i in $TEMPDIR/opt/deadbeef/lib/deadbeef/*.so.0.0.0; do
+ mv $i $TEMPDIR/opt/deadbeef/lib/deadbeef/`basename $i .0.0.0`
+done
+rm $TEMPDIR/opt/deadbeef/lib/deadbeef/*.so.*
+rm $TEMPDIR/opt/deadbeef/lib/deadbeef/*.a
+
+# move icons and other shit to /usr
+mkdir -p $TEMPDIR/usr/share/
+mv $TEMPDIR/opt/deadbeef/share/applications $TEMPDIR/usr/share/
+sed -i 's/Exec=deadbeef/Exec=\/opt\/deadbeef\/bin\/deadbeef/g' $TEMPDIR/usr/share/applications/deadbeef.desktop
+mv $TEMPDIR/opt/deadbeef/share/icons $TEMPDIR/usr/share/
+
+# generate .PKGINFO
+echo "# `date -u`" >$PKGINFO
+echo "pkgver = $VERSION-$BUILD" >>$PKGINFO
+echo "builddate = `date --utc +%s`" >>$PKGINFO
+echo "size = `du -sb $TEMPDIR | awk '{print $1}'`" >>$PKGINFO
+echo "arch = $ARCH" >>$PKGINFO
+cat tools/packages/arch_pkginfo >>$PKGINFO
+
+# generate .INSTALL
+cp tools/packages/arch_install $INSTALL
+
+# archive
+cd $TEMPDIR
+fakeroot -- tar Jcvf $OUTDIR/deadbeef-$VERSION-$BUILD-$ARCH.pkg.tar.xz * .PKGINFO .INSTALL
diff --git a/tools/packages/arch_install b/tools/packages/arch_install
new file mode 100644
index 00000000..eaf1b9a6
--- /dev/null
+++ b/tools/packages/arch_install
@@ -0,0 +1,14 @@
+pkgname=deadbeef
+
+post_install() {
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/tools/packages/arch_pkginfo b/tools/packages/arch_pkginfo
new file mode 100644
index 00000000..e58eee9e
--- /dev/null
+++ b/tools/packages/arch_pkginfo
@@ -0,0 +1,11 @@
+pkgname = deadbeef
+pkgdesc = An audio player for GNU/Linux based on GTK2.
+url = http://deadbeef.sourceforge.net
+packager = Alexey Yakovenko <waker@users.sf.net>
+license = GPL2
+depend = gtk2
+depend = hicolor-icon-theme
+depend = desktop-file-utils
+optdepend = libx11: for global hotkeys plugin
+optdepend = alsa-lib: for ALSA output
+optdepend = pulseaudio: for PulseAudio output
diff --git a/tools/packages/deb_control b/tools/packages/deb_control
new file mode 100644
index 00000000..390276cb
--- /dev/null
+++ b/tools/packages/deb_control
@@ -0,0 +1,33 @@
+Package: deadbeef
+Maintainer: Alexey Yakovenko <waker@users.sf.net>
+Depends: libasound2 (>> 1.0.16), libc6 (>= 2.7-1), libcairo2 (>= 1.2.4), libgcc1 (>= 1:4.1.1), libglib2.0-0 (>= 2.16.0), libgtk2.0-0 (>= 2.12.0), libpango1.0-0 (>= 1.20.3), libx11-6
+Recommends: libpulse0, libdbus-1-3
+Suggests:
+Section: sound
+Priority: optional
+Homepage: http://deadbeef.sourceforge.net/
+Description: ultimate music player for GNU/Linux systems
+ DeaDBeeF (as in 0xDEADBEEF) is an audio player for GNU/Linux systems with X11.
+ .
+ Features:
+ .
+ * mp3, ogg vorbis, flac, ape, wv, wav
+ * ID3v1, ID3v2.2, ID3v2.3, ID3v2.4, APEv2, xing/info tags support
+ * character set detection for non-unicode ID3 tags - supports cp1251
+ and iso8859-1
+ * unicode tags are fully supported as well (both utf8 and ucs2)
+ * cuesheet support for mp3, ogg, flac, ape
+ * autodetection of utf8/cp1251/iso8859-1 charsets in cuesheets
+ * sid and some popular chiptune formats like nsf
+ * tracker modules like mod, s3m, it, xm, etc
+ * HVSC song length database support for sid
+ * gtk2 interface with custom highly speed/memory optimized widgets
+ * no GNOME or KDE dependencies - just gtk2 and several small libraries
+ * minimize to tray, with scrollwheel volume control
+ * drag and drop, both inside of playlist, and from filemanagers and such
+ * control playback from command line (allows global hotkeys using xbindkeys)
+ * seeking works in all supported formats
+ * plugin support; ships with several standard plugins, such as global hotkeys
+ and last.fm scrobbler; sdk is included
+ * duration calculation is as precise as possible for vbr mp3
+ files (with and without xing/info tags)
diff --git a/tools/packages/deb_postinst b/tools/packages/deb_postinst
new file mode 100755
index 00000000..d0d5f4df
--- /dev/null
+++ b/tools/packages/deb_postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+# Automatically added by dh_installmenu
+if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
+ update-menus
+fi
+# End automatically added section
diff --git a/tools/packages/deb_postrm b/tools/packages/deb_postrm
new file mode 100755
index 00000000..a30dbac6
--- /dev/null
+++ b/tools/packages/deb_postrm
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+# Automatically added by dh_installmenu
+if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
+# End automatically added section
diff --git a/tools/packages/debian.sh b/tools/packages/debian.sh
new file mode 100755
index 00000000..985dca28
--- /dev/null
+++ b/tools/packages/debian.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+PWD=`pwd`
+VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print'`
+DEB_VERSION=`cat PORTABLE_VERSION | perl -ne 'chomp and print' | sed 's/-/~/'`
+BUILD=`cat PORTABLE_BUILD | perl -ne 'chomp and print'`
+ARCH=`uname -m | perl -ne 'chomp and print'`
+INDIR=$PWD/static/$ARCH/deadbeef-$VERSION
+TEMPDIR=$PWD/package_temp/$ARCH/debian-$VERSION
+OUTDIR=$PWD/package_out/$ARCH/debian
+
+if [ "$ARCH" = "i686" ] ; then
+ DEB_ARCH=i386
+elif [ "$ARCH" = "x86_64" ] ; then
+ DEB_ARCH=amd64
+else
+ DEB_ARCH=unknown
+fi
+
+# make dirs
+rm -rf $TEMPDIR
+mkdir -p $TEMPDIR
+mkdir -p $OUTDIR
+
+# copy files
+cp -r $INDIR/* $TEMPDIR/
+# rm unneeded files
+rm $TEMPDIR/opt/deadbeef/lib/deadbeef/*.la
+for i in $TEMPDIR/opt/deadbeef/lib/deadbeef/*.so.0.0.0; do
+ mv $i $TEMPDIR/opt/deadbeef/lib/deadbeef/`basename $i .0.0.0`
+done
+rm $TEMPDIR/opt/deadbeef/lib/deadbeef/*.so.*
+rm $TEMPDIR/opt/deadbeef/lib/deadbeef/*.a
+
+# move icons and other shit to /usr
+mkdir -p $TEMPDIR/usr/share/
+mv $TEMPDIR/opt/deadbeef/share/applications $TEMPDIR/usr/share/
+sed -i 's/Exec=deadbeef/Exec=\/opt\/deadbeef\/bin\/deadbeef/g' $TEMPDIR/usr/share/applications/deadbeef.desktop
+mv $TEMPDIR/opt/deadbeef/share/icons $TEMPDIR/usr/share/
+
+# generate debian-binary
+echo "2.0" >$TEMPDIR/debian-binary
+
+# generate control
+echo "Version: $VERSION-$BUILD" >$TEMPDIR/control
+echo "Installed-Size: `du -sb $TEMPDIR | awk '{print $1}'`" >>$TEMPDIR/control
+echo "Architecture: $DEB_ARCH" >>$TEMPDIR/control
+cat $PWD/tools/packages/deb_control >>$TEMPDIR/control
+
+# copy postinst and postrm
+cp $PWD/tools/packages/deb_postinst $TEMPDIR/postinst
+cp $PWD/tools/packages/deb_postrm $TEMPDIR/postrm
+
+# generate md5sums
+cd $TEMPDIR
+rm $TEMPDIR/md5sums
+find ./opt -type f | while read i ; do
+ md5sum "$i" | sed 's/\.\///g' >>$TEMPDIR/md5sums
+done
+cd $PWD
+
+# generate shlibs
+pwd
+rm $TEMPDIR/shlibs
+ls $TEMPDIR/opt/deadbeef/lib/deadbeef/*.so | while read i ; do
+echo "`basename $i .so` 0 deadbeef" >>shlibs
+done
+
+# archive control
+cd $TEMPDIR
+fakeroot -- tar zcvf ./control.tar.gz ./control ./md5sums ./postrm ./postinst ./shlibs
+# archive data
+fakeroot -- tar zcvf ./data.tar.gz ./opt ./usr
+
+# make final archive
+fakeroot -- ar cr $OUTDIR/deadbeef_${DEB_VERSION}-${BUILD}_$DEB_ARCH.deb debian-binary control.tar.gz data.tar.gz
+