[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sponsor for a bootstrapping Java++ compiler



> AFAIK, this is not OK. Though I used to do it myself too. The
> correct way, I believe is to make a tar.gz file, like the one which
> is online, and build the Debian package from that.

To achieve this I use the "deb-makepkg" script below. You need to
adjust the BUILDIR to wherever you build your Debian packages. Next
you cd to your working copy of your package, and type :
deb-makepkg <package> <version>

What this does:
* "make dist" to build the .tar.gz then renames it to
package_version.orig.tar.gz
* extracts the tar.gz
* scans debian/CVS to know what files are actually part of the CVS
module (except .cvsignore files) and copies these files to debian/ in
the directory where the .tar.gz was extracted
* runs dpkg-buildpackage -rfakeroot

That way you have a non-native package with a clean diff!

Jeremy

-------------

#!/bin/bash
# $Id: deb-makepkg,v 1.4 2003/03/11 17:26:22 sharky Exp $

BUILDIR=~sharky/dev/debian
SRCDIR=`pwd`
BPACKAGE=$1
BVERSION=$2

if [ -z "$2" ]; then
  echo "Usage: deb-makepkg package version"
  exit 1
fi

if [ ! -f ChangeLog ]; then
  echo "ChangeLog not found!"
  exit 2
fi

if [ ! -f debian/CVS/Entries ]; then
  echo "debian/CVS/Entries not found!"
  exit 3
fi

rm -f ${BPACKAGE}-${BVERSION}.tar.gz
make dist

if [ ! -f ${BPACKAGE}-${BVERSION}.tar.gz ]; then
  echo "Cannot find ${BPACKAGE}-${BVERSION}.tar.gz"
  exit 4
fi

# clean up build directory
if [ ! -d $BUILDIR ]; then
  echo "Cannot find directory $BUILDIR"
  exit 5
fi

rm -rf ${BUILDIR}/${BPACKAGE}-${BVERSION}
rm -f ${BUILDIR}/${BPACKAGE}_${BVERSION}-*.diff.gz

# copy and extract archive
cp ${BPACKAGE}-${BVERSION}.tar.gz
${BUILDIR}/${BPACKAGE}_${BVERSION}.orig.tar.gz
cd $BUILDIR
tar zxvf ${BPACKAGE}_${BVERSION}.orig.tar.gz

# enter directory and copy Debian files
mkdir ${BPACKAGE}-${BVERSION}/debian
cd ${BPACKAGE}-${BVERSION}

for debfile in `cat ${SRCDIR}/debian/CVS/Entries | sed -n -e
's/^\/\(.*\)\/1\(\.[0-9]\+\)\+\/.*\/\/$/\1/p'`; do
  [ $debfile != .cvsignore ] && cp ${SRCDIR}/debian/${debfile} debian
done

# build package
dpkg-buildpackage -rfakeroot

-------------


--  
http://www.jerryweb.org/         : JerryWeb.org
http://sailcut.sourceforge.net/  : Sailcut CAD
http://mpf70.sourceforge.net/    : MPman MP-F70 support for Linux

Attachment: pgpUF1fvg4hm9.pgp
Description: PGP signature


Reply to: