[Pkg-zope-developers] A make a zope zope-debianing script it's right ?

debian_zope_devel-nospan@les-ledez.com debian_zope_devel-nospan@les-ledez.com
Mon, 13 Oct 2003 15:53:41 +0200


--mojUlQ0s9EVzWg2t
Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1"
Content-Disposition: inline


--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

I make a script for help me to make zope debian package easily. I send
you to help me ameliorate this.


Thanks.

--=20
Nicolas Ledez

--RnlQjJ0d97Da+TV1
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: attachment; filename=zope-debianing

#!/bin/bash

dh_testdir;if [ ! "$?" == "0" ]; then exit; fi

NAME="TinyTable"
INSTDIR="usr/lib/zope/lib/python/Products"
IMGDIR="usr/share/zope/Products"
PWD=`pwd`
TMP="debian/zope-tinytable"
LINKS="debian/links"

# List directory
list_dir() {
	for f in $*;do
		dirname $f
	done
}

# Mkdir if no exist
mkdir_ine() {
	for d in $*;do
	if [ ! "$1" == "$d" ];then
		if [ ! -d $1/$d ];then
			mkdir $1/$d
		fi
	fi
	done
}

# Creation of dir for package
mkdir -p $PWD/$TMP/$INSTDIR/$NAME
mkdir -p $PWD/$TMP/$IMGDIR/$NAME

# Construct list of files
ALL=`find * -maxdepth 0|grep -v debian`
FILES=`find $ALL -type f -not -iregex '.*\.\(gif\|jpg\|png\)'`
IMGS=`find $ALL  -type f -iregex '.*\.\(gif\|jpg\|png\)'`

# Construct list of dir
LIST_DFILES=`list_dir $FILES|sort -u|grep -Ev "^\.$"`
LIST_DIMGS=`list_dir $IMGS|sort -u|grep -Ev "^\.$"`

# Make subdir for package
mkdir_ine $PWD/$TMP/$INSTDIR/$NAME $LIST_DFILES $LIST_DIMGS
mkdir_ine $PWD/$TMP/$IMGDIR/$NAME $LIST_DIMGS

# Copy files
for f in $FILES;do
	cp $f $PWD/$TMP/$INSTDIR/$NAME/$f
done

# Creation des liens symboliques
if [ -f $LINKS ]; then
	rm $LINKS
fi
for f in $IMGS;do
	cp $f $PWD/$TMP/$IMGDIR/$NAME/$f
	echo $IMGDIR/$NAME/$f $INSTDIR/$NAME/$f >> $LINKS
done

--RnlQjJ0d97Da+TV1--

--mojUlQ0s9EVzWg2t
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Pour information voir http://www.gnupg.org

iEYEARECAAYFAj+KrmIACgkQyeOnsiGOfEnAhQCfT8FXO3Rma4q6pJahXDIcL+Zm
0tQAnRxRV+csHBPe10RRCi3RrQgNwH/s
=yqE9
-----END PGP SIGNATURE-----

--mojUlQ0s9EVzWg2t--