#!/bin/sh

#clear old "build"
rm -rf package
rm -rf dist

#make new structure:

mkdir package

mkdir -p package/control
mkdir -p package/usr/local/pymuse
mkdir -p package/usr/bin
#.destkop
mkdir -p package/usr/share/applications
mkdir -p package/media/card

cp -p ../opkg/control package/control/control

#Makes an ipk package with newest files.
cp -p -r ../src/* package/usr/local/pymuse/

cp -p ../opkg/pymuse.desktop package/usr/share/applications/
cp -p ../pymuse package/usr/bin/

chmod -R 777 package
#confirm packages put on disk.
sync

mkdir -p dist

cd package/control
tar cfvz control.tar.gz control
mv control.tar.gz ../../dist
cd ../../package
tar cfvz data.tar.gz *
mv data.tar.gz ../dist

cd ../dist
echo 2.0 > debian-binary
tar cfvz pymuse.ipkg *