On Mon, 30 Oct 1995, J.H.M.Dassen wrote: > [...] > Desirable goals for source packaging > ------------------------------------ > - Upstream sources should be used unmodified. >[...] > - Distribute wholly unmodified source > - Have the source extracted and patches by a 'debianizer' script. > This could be akin to perl5-style patches (a sh script combined with > the patch). > [...]
Back in the eary days of the project, before binary packages and long before dpkg, I argued for distributing unmodified upstream sources and debianizing diffs. I lost that argument, but I had futzed around with a debianizing script, and I find that I still have a copy. I'll include it below. I haven't retried it because I'm busy with other things. I had also argued that the original sources should extract into <package>-<version>, as is usual with upstream sources, and that the debian sources should be placed in <package>-<version>.debian. I lost that argument too and I see that this script perpetuates that lost argument, which I still believe is not the way we should be doing this. Anyhow, here's my very old script. It might serve as a starting point. #!/bin/sh # # this shell script produces the debian source package # it requires that that the debian source be in $PACKAGE # and that the original pre-debian source be in $PACKAGE.orig # it assumes that this script is run from inside $PACKAGE # DIR=`pwd` PACKAGE=`basename $DIR` # # check for the original package # if [ ! -d ../$PACKAGE.orig ] then echo ERROR: $PACKAGE.orig not found exit 1 fi # # archive the original source package # we want the tarfile to extract it into $PACKAGE # cd .. # get up to the parent directory mv $PACKAGE $PACKAGE.temp.$$ # rename the debian package mv $PACKAGE.orig $PACKAGE # rename the original package tar --create --file $PACKAGE.tar $PACKAGE # make the tar file mv $PACKAGE $PACKAGE.orig # rename the original package mv $PACKAGE.temp.$$ $PACKAGE # rename the debian package gzip -9 --force $PACKAGE.tar # compress the tar file cd $PACKAGE # back down to the debian directory # # make and gzip the diff file # # NOTE -- to apply the diffs # 1. place the original sources in $PACKAGE # 2. place the the patch file in the parent directory # 3. invoke "patch -d <patch_file" from the parent directory # cd .. # up to the parent directory diff --context --recursive -P $PACKAGE.orig $PACKAGE >$PACKAGE.diff gzip -9 --force $PACKAGE.diff # compress the diff cd $DIR # back down to the debian directory # # we're done # exit 0 I recall that I later approached this from a slightly different angle, which might be better. That was to distribute a machine-built debianizing shell script which wrapped the debianizing diffs in a script to apply them. I don't seem to have a copy of that, but it ought to be pretty trivial to do. Also, I think RedHat does something like this in their package admin tools. That's been discussed a bit in debian-devel, but I don't think anyone has taken the time to look at it.