Hi Hannu,
I'm attaching a patch against the current HG version to (hopefully) fix
the deb creation completely.
I tested it on a Debian box and it works fine, from what I can say. I'll
also do some shot on Ubuntu soon, but I did not find any time to install
it yet.
First of all, I want to thank cesium (Yair K.) who helped me improving
the script and, what is most important, makeing it more portable. This
script is supposed to run on Linux, *BSD and Solaris, as well as
basically every system having OpenSSL installed.... thus deb creation
will be possible from within basically any system (featuring gzip, ar
and OpenSSL/md5(sum)/digest). I hope that is OK. ;)
However, I was too lazy to add the script to all the other setup/*
directories, so I would like to ask you to do it... I worked on that
from 12am to 12pm, I am a little bit burned-out now. :(
As you can see, I have also added postinst, prerm and postrm scripts
based on the RPM spec file commands, as Dev mentioned...
Some things to Kristian: you were right, the old script was broken and I
had to change the order of the included files into the deb archive...
and I have forgotten to go to "control" before creating the tar.gz
archive. :)
But the other changes... creating backup files etc, are not really
usable. They do not really belong into that script, removing the old deb
file (if any) is just fine. I hope you are not disappointed. :(
Ok, anways, the script is working fine now. If you experience any
problems, please do not hesitate to report them. If you have some other
ideas, Hannu, please tell me. :)
So far, I am waiting for an answer.
Have a good night and rest of weekend. :)
-Ionic
diff -r 3c6d492adbee setup/Linux/mkdeb.sh
--- a/setup/Linux/mkdeb.sh Sat May 24 10:31:34 2008 +0300
+++ b/setup/Linux/mkdeb.sh Sun May 25 00:16:45 2008 +0200
@@ -2,8 +2,20 @@
VERSION=`sh showversion.sh`
RELEASE=`cat buildid.dat`
-ARCH=`uname -m`
-OSSNAME=oss-linux
+OSSNAME="oss-linux"
+
+# Chosing the right architecture
+if test `uname -m` = "x86_64"; then ARCH=amd64
+else ARCH=`uname -m|sed 's/^i[3-9]86/i386/'`
+fi
+
+# Checking for known MD5 hasing programs
+if type md5sum; then MD5=MD5SUM
+elif type openssl; then MD5=OPENSSL
+elif type md5; then MD5=MD5
+elif type digest; then MD5=DIGEST
+else echo "There has been no MD5 creation utily found. deb archive creation will be aborted." && exit 1
+fi
DEBNAME=${OSSNAME}-${VERSION}_${RELEASE}_${ARCH}
echo building $DEBNAME.deb
@@ -15,21 +27,43 @@ echo "Section: sound" >> control/control
echo "Section: sound" >> control/control
echo "Priority: optional" >> control/control
echo "Architecture: " $ARCH >> control/control
-echo "Maintainer: Hannu Savolainen <[EMAIL PROTECTED]>" >> control/control
-echo "Description: Open Sound System
- OSS provides libraries and necessary drivers which enable you to play
- sound files, compose music, use MIDI (only included in the testing
- releases) and adjust your sound card using various user space programs." >> control/control
+echo "Installed-Size: `du -ks prototype | awk '{print $1}'`" >> control/control
+echo "Suggests: libsdl1.2debian-oss | libsdl1.2debian-all, libesd0, libwine-oss, libsox-fmt-oss, mpg123, gstreamer0.10-plugins-bad (>= 0.10.7), libasound2-plugins" >> control/control
+echo "Maintainer: 4Front Technologies <[EMAIL PROTECTED]>" >> control/control
+echo "Description: Open Sound System (http://www.opensound.com)
+ OSS provides libraries and necessary drivers for practically all sound
+ cards on the market including PnP and many PCI ones which enable you
+ to play sound files, compose music, use MIDI (only included in the
+ testing releases) and adjust your sound card using various user space
+ programs." >> control/control
-(cd prototype; find . -type f -print | sed 's/^.//g' | md5sum > ../control/md5sums)
-(cd prototype; find . -type f -print | sed 's/^.//g' | grep -E "^etc/" > ../control/conffiles)
-rm -rf /tmp/prototype
-cp -af prototype /tmp
-tar zcvf control.tar.gz control/*
-(cd /tmp/prototype; tar zcvf data.tar.gz ./*)
+# Create the MD5 sums file using the program we have found earlier
+case "$MD5" in
+ MD5SUM)
+ (cd prototype; find . -type f -exec sh -c 'i={}; i=${i#.}; md5sum ".$i"' \; > ../control/md5sums)
+ ;;
+ MD5)
+ (cd prototype; find . -type f -exec sh -c 'i={}; i=${i#.}; x=`md5 ".$i" | awk "{ for (y=1;y<=NF;y++) if ((length(\\$y) == 32) && (\\$y !~ /[\/]/)) {print \\$y; break} }"`; echo "$x $i"' \; > ../control/md5sums)
+ ;;
+ DIGEST)
+ (cd prototype; find . -type f -exec sh -c 'i={}; i=${i#.}; x=`digest -a md5 ".$i"`; echo "$x $i"' \; > ../control/md5sums)
+ ;;
+ OPENSSL)
+ (cd prototype; find . -type f -exec sh -c 'i={}; i=${i#.}; x=`openssl md5 $i | awk "{ for (y=1;y<=NF;y++) if ((length(\\$y) == 32) && (\\$y !~ /[\/]/)) {print \\$y; break} }"`; echo "$x $i"' \; > ../control/md5sums)
+ ;;
+esac
+
+(cd prototype; find . -type f -print | sed 's/^.//g' | egrep "^/etc/" > ../control/conffiles)
+
+rm -rf /tmp/prototype $DEBNAME.deb
+cp -pRf prototype /tmp
+cp setup/Linux/postinst setup/Linux/prerm setup/Linux/postrm control/
+(cd control; tar cv * | gzip -9 > ../control.tar.gz)
+(cd /tmp/prototype; tar cv ./* | gzip -9 > data.tar.gz)
mv /tmp/prototype/data.tar.gz .
-ar q $DEBNAME.deb control.tar.gz data.tar.gz debian-binary
+
+ar r $DEBNAME.deb debian-binary control.tar.gz data.tar.gz
# Cleanup
rm -rf /tmp/prototype control control.tar.gz data.tar.gz debian-binary
diff -r 3c6d492adbee setup/Linux/postinst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/postinst Sun May 25 00:16:45 2008 +0200
@@ -0,0 +1,9 @@
+#!/bin/sh
+echo "Building OSS Modules for Linux-`uname -p` `uname -r`"
+cd /usr/lib/oss/build
+sh install.sh
+echo "Starting Open Sound System"
+sync
+/usr/sbin/soundoff >> /dev/null 2>&1
+sync
+/usr/sbin/soundon || exit 0
diff -r 3c6d492adbee setup/Linux/postrm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/postrm Sun May 25 00:16:45 2008 +0200
@@ -0,0 +1,3 @@
+#!/bin/sh
+rm -rf /usr/lib/oss/*
+rm -f /usr/lib/libflashsupport.so
diff -r 3c6d492adbee setup/Linux/prerm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/prerm Sun May 25 00:16:45 2008 +0200
@@ -0,0 +1,2 @@
+#!/bin/sh
+sh /usr/lib/oss/scripts/restore_drv.sh
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel