Hi Hannu,

once again, Yair and I set together and created a new changeset for the deb creation script.

This time the resulting .deb file will stick more closely to the standard (i.e. there is a copyright file now, the {post,pre}{rm,inst} scripts are extended, the control file has got some other entries, we now have an menu file for ossxmix and so on.)


"lintian" (the debian binary package checker) reports less warnings/"errors" than previous and the remaining ones are mostly only related to file permissions which cannot really be fixed by mkdeb.sh (there might be ways to change the GUID or permissions of files with tar, but those are non-POSIX and thus not portable...), however, I think we can afford such non-critical glitches.

I've added a file called "md5.sh", I hope this is OK... at least it cleans up mkdeb.sh a bit, the old way with case and four different find invocations was not really nice...

Has been tested on Ubuntu and Debian by me, is still working fine (if not even better than yesterday. :))

That's it, good night. :)


-Ionic
diff -r db15e215c380 setup/Linux/copyright
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/copyright	Sun May 25 22:55:48 2008 +0200
@@ -0,0 +1,25 @@
+Upstream sources are at:
+  http://www.opensound.com
+
+Authors:
+  4Front Technologies ( http://www.4front-tech.com )
+
+Copyright:
+   Copyright (C) 2006-2008 Hannu Savolainen and Dev Mazumdar.
+   All rights reserved. 
+
+   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; version 2 dated June, 1991.
+
+   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 PARTICULAR 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, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian GNU/Linux systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
diff -r db15e215c380 setup/Linux/md5.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/md5.sh	Sun May 25 22:55:48 2008 +0200
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+i=$2
+i=${i#.}
+
+# Create the MD5 sums file using the program we have found earlier
+case "$1" in
+  MD5SUM)
+    md5sum ".$i"
+  ;;
+  MD5)
+    x=`md5 ".$i" | awk "{ for (y=1;y<=NF;y++) if ((length(\\$y) == 32) && (\\$y !~ /[\/]/)) {print \\$y; break} }"`; echo "$x  $i"
+  ;;
+  DIGEST)
+    x=`digest -a md5 ".$i"`; echo "$x  $i"
+  ;;
+  OPENSSL)
+    x=`openssl md5 $i | awk "{ for (y=1;y<=NF;y++) if ((length(\\$y) == 32) && (\\$y !~ /[\/]/)) {print \\$y; break} }"`; echo "$x  $i"
+  ;;
+esac
diff -r db15e215c380 setup/Linux/menu.ex
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/menu.ex	Sun May 25 22:55:48 2008 +0200
@@ -0,0 +1,4 @@
+?package(oss-linux):needs="X11" \
+  section="Apps/Sound" \
+  title="ossxmix" \
+  command="/usr/bin/ossxmix"
diff -r db15e215c380 setup/Linux/mkdeb.sh
--- a/setup/Linux/mkdeb.sh	Sun May 25 23:33:47 2008 +0300
+++ b/setup/Linux/mkdeb.sh	Sun May 25 22:55:48 2008 +0200
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 VERSION=`sh showversion.sh`
+VERSION=${VERSION#v}
 RELEASE=`cat buildid.dat`
 OSSNAME="oss-linux"
 
@@ -9,64 +10,82 @@ else ARCH=`uname -m|sed 's/^i[3-9]86/i38
 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
+DEBNAME=${OSSNAME}-${VERSION}-${RELEASE}_${ARCH}
+
+# Checking for known MD5 hashing programs
+if type md5sum > /dev/null 2>&1; then MD5=MD5SUM
+elif type openssl > /dev/null 2>&1; then MD5=OPENSSL
+elif type md5 > /dev/null 2>&1; then MD5=MD5
+elif type digest > /dev/null 2>&1; 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
 
-mkdir control
+
+mkdir control 2>/dev/null
 echo "2.0" > debian-binary
-echo "Package: " $OSSNAME > control/control
-echo "Version: " $VERSION_$RELEASE >> control/control
-echo "Section: sound" >> control/control
-echo "Priority: optional" >> control/control
-echo "Architecture: " $ARCH >> 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)
+cat > control/control << END
+Package: $OSSNAME
+Version: ${VERSION}-${RELEASE}
+Section: sound
+Priority: optional
+Architecture: $ARCH
+Installed-Size: `du -ks prototype | awk '{print $1}'`
+Build-Depends: build-essential sed gawk libtool libgtk2.0-dev
+Depends: binutils, gcc, libc6, libgtk2.0-0, sed (>= 1.0.0)
+Conflicts: libflashsupport
+Provides: oss
+Suggests: libsdl1.2debian-oss | libsdl1.2debian-all, libesd0, libwine-oss, libsox-fmt-oss, mpg123, gstreamer0.10-plugins-bad (>= 0.10.7), libasound2-plugins
+Maintainer: 4Front Technologies <[EMAIL PROTECTED]>
+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
+  programs.
+END
+
+# Copying the menu and copyright file to the right place, taking care that the md5sums generation will take place AFTER this step
+mkdir -p prototype/usr/share/menu prototype/usr/share/doc/oss-linux
+cp setup/Linux/menu.ex prototype/usr/share/menu/ossxmix
+cp setup/Linux/copyright prototype/usr/share/doc/oss-linux/
+
 
 # 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 -exec sh ../setup/Linux/md5.sh "$MD5" "{}" \; > ../control/md5sums)
 
 (cd prototype; find . -type f -print | sed 's/^.//g' | egrep "^/etc/" > ../control/conffiles)
 
+
+# Removing older builds
 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)
+cp setup/Linux/preinst setup/Linux/postinst setup/Linux/prerm setup/Linux/postrm control/
+if test -e prototype/usr/lib/oss/lib/libsalsa.so*
+then
+  cp setup/Linux/shlibs control/
+fi
+
+
+# Correcting file and directory permissions required by lintian
+chmod 0755 control/control
+
+# Building control and data archives
+(cd control; tar c * | gzip -9 > ../control.tar.gz)
+(cd /tmp/prototype; tar c ./* | gzip -9 > data.tar.gz)
 mv /tmp/prototype/data.tar.gz .
 
 
+# Creating the actual archive
 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
+
 
 if test -f 4front-private/export_package.sh
 then
diff -r db15e215c380 setup/Linux/postinst
--- a/setup/Linux/postinst	Sun May 25 23:33:47 2008 +0300
+++ b/setup/Linux/postinst	Sun May 25 22:55:48 2008 +0200
@@ -2,6 +2,7 @@ echo "Building OSS Modules for Linux-`un
 echo "Building OSS Modules for Linux-`uname -p` `uname -r`"
 cd /usr/lib/oss/build
 sh install.sh
+if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus; fi
 echo "Starting Open Sound System"
 sync
 /usr/sbin/soundoff >> /dev/null 2>&1
diff -r db15e215c380 setup/Linux/postrm
--- a/setup/Linux/postrm	Sun May 25 23:33:47 2008 +0300
+++ b/setup/Linux/postrm	Sun May 25 22:55:48 2008 +0200
@@ -1,3 +1,4 @@
 #!/bin/sh
 rm -rf /usr/lib/oss/*
 rm -f /usr/lib/libflashsupport.so
+if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus; fi
diff -r db15e215c380 setup/Linux/preinst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/preinst	Sun May 25 22:55:48 2008 +0200
@@ -0,0 +1,5 @@
+#!/bin/sh
+if [ -x /etc/init.d/alsa-utils ]; then /etc/init.d/alsa-utils stop || true; fi
+if [ -x /usr/sbin/alsa ]; then /usr/sbin/alsa force-unload || true; fi
+if [ -x /etc/init.d/alsa ]; then /etc/init.d/alsa force-unload || true; fi
+exit 0
diff -r db15e215c380 setup/Linux/shlibs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup/Linux/shlibs	Sun May 25 22:55:48 2008 +0200
@@ -0,0 +1,1 @@
+libsalsa 2 oss-linux
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to