#!/bin/bash if [ `id -u` -ne 0 ] then echo lancement en fakeroot fakeroot $0 $* exit 0 fi if [ $# -ne 1 ] then if [ -f DEBIAN/control ] then wd=`pwd` root=`readlink -f $wd` base=`basename $root` cd .. else echo usage $0 dossier contenant DEBIAN/control exit 1 fi else base=$1 fi if [ ! -f $base/DEBIAN/control ] then echo $base/DEBIAN/control inacessible!!! exit 1 fi cd $base debdir=`pwd` debdir=`readlink -f $debdir` debname=`basename $debdir` derversion=`ls -rt ../$base*.deb|tail -1` echo derversion=\"$derversion\" if [ "$derversion" != "" ] then echo "dernière version : " `basename $derversion .deb` newfiles=`find . -type f -newer $derversion|wc -l` if [ $newfiles -eq 0 ] then echo aucun fichier modifié postérieurement... echo "On continue quand même ? (ou ^C)" read fi echo '===============================================' echo Fichiers modifiés postérieurement : find . -type f -newer $derversion echo '===============================================' fi newfiles=`find . -type f -newer DEBIAN/control|egrep -v "conffiles|md5sums"|wc -l` if [ $newfiles -gt 0 ] then echo $newfiles modifiés après DEBIAN/control find . -type f -newer DEBIAN/control|egrep -v "conffiles|md5sums" echo '*** ERREUR !!! mettre à jour DEBIAN/control !!!' echo '===============================================' exit 1 fi find . -type f -exec md5sum {} \; |grep -v DEBIAN >DEBIAN/md5sums find etc/ -type f 2>/dev/null |sed 's/^/\//' >DEBIAN/conffiles echo `find etc/ -type f -ls 2>/dev/null|wc -l` fichiers de configuration cd .. chown -R root.root $base chmod -R 0644 $base chmod -R +X $base find $base -type f 2>/dev/null|grep -v usr/share/doc |xargs file|egrep 'ELF|executable' |awk -F: '{print $1;}'|xargs chmod a+x echo `find $base -type f -executable -ls 2>/dev/null|wc -l` executables. echo `find $base -type f -ls 2>/dev/null|wc -l` fichiers. dpkg-deb -b $base . ls -lh $base*.deb