[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]

svn-buildpackage - maintaining Debian packages with Subversion
Chapter 5 - Command reference


5.1 svn-inject


5.1.1 NAME

svn-inject - puts a Debian source package into Subversion repository


5.1.2 SYNOPSIS

svn-inject [ options ] <package>.dsc <repository URL>


5.1.3 OPTIONS

-h print this message

-v Make the command verbose

-q Hide less important messages.

-l Layout type. 1 (default) means package/{trunk,tags,branches,...} scheme, 2 means the {trunk,tags,branches,...}/package scheme. 2 is not implemented yet.

-t directory Specify the directory where the .orig.tar.gz files are stored on the local machine.

-d , --do-like=directory Looks at the working directory of some other package and uses its base URL, tarball storage directory and similar checkout target directory.

-c number Checkout nothing (0), trunk directory (1) or everything (2) when the work is done.

-o Put only files that are actually touched in the .diff file under the version control. svn-inject sets the mergeOnUpstream property automaticaly, see HOWTO.


5.2 svn-buildpackage


5.2.1 NAME

svn-buildpackage - build Debian packages from SVN repository


5.2.2 SYNOPSIS

svn-buildpackage [ OPTIONS ... ] [ OPTIONS for dpkg-buildpackage ]


5.2.3 DESCRIPTION

Builds Debian package within the SVN repository. The source code repository must be in the format created by svn-inject, and this script must be executed from the work directory (trunk/package).

By default, the working directory is used as the main source directory (assuming the whole upstream source is beeing stored in the repository). The alternative is so called "merge mode". With this method, only the debian directory (and maybe some other modified files) are stored in the repository. At build time, the contents of the svn trunk are copied to the extracted tarball contents (and can overwrite parts of it). To choose this working model, set the svn property mergeWithUpstream on the Debian directory ("svn propset mergeWithUpstream 1 debian").

The default behaviour is following: Check the working directory, complain on uncommited files (also see --svn-ignore-new) Copy the orig tarball to the build area if neccessary (also see --svn-no-links) Extract the tarball (in merge mode) or export the svn work directory to the build directory (also see below and --svn-no-links) Build with dpkg-buildpackage (also see --svn-builder, --svn-lintian, etc.) Create a changelog entry for the future version


5.2.4 OPTIONS

-h , --help Show the help message

--svn-verbose More verbose program output

--svn-dont-clean Don't run debian/rules clean (default: clean first)

--svn-dont-purge Don't run remove the build directory when the build is done. (Default: wipe after successfull build)

--svn-export Just export the working directory and do neccessary code merge operations, then exit.

--svn-no-links Don't use file links but try to export or do hard copies of the working directory (default: use links where possible). This is useful if your package fails to build because some files, empty directories, broken links, ... cannot not be transported with in the default link-copy mode.

--svn-ignore-new Don't stop on svn conflicts or new/changed files

--svn-tag Final build: Tag, export, build cleanly & make new changelog entry

--svn-tag-only, --svn-only-tag Don't build the package, do only the tag copy

--svn-retag If an existing target directory has been found while trying to create the tag copy, remove the target directory first.

--svn-lintian Run lintian in the build area when done

--svn-move When done, move the created files (as listed in .changes) to the parent directory, relativ to the one where svn-buildpackage was started.

--svn-move-to =... Specifies the target directory to move generated files to.

--svn-pkg =packagename Overrides the detected package name, use with caution. May be set too late during the processing (ie. still have the old value when expanding shell variables).

--svn-override =var=value,anothervar=value Overrides any config variable that has been autodetected or found in .svn/deb-layout.

--svn-builder =COMMAND Specifies alternative build command instead of dpkg-buildpackage, eg. debuild, pdebuild... WARNING: shell quotation rules do not completely apply here, better use wrappers for complex constructs. Using this option may break --svn-lintian and --svn-move functionality.

--svn-pass-diff Experimental function to generate the .diff.gz contents using svn and pass it to dpkg-buildpackage. Requires a hacked dpkg-buildpackage script.

--svn-prebuild, --svn-postbuild, --svn-pretag, --svn-posttag Commands (hooks) to be executed before/after the build/tag command invocations. Examples to fetch the orig tarball from a local pool (trying pool/libX/... to):

     
     svn-buildpackage --svn-prebuild='a="wget -c http://mymirror/debian/main/pool/";b="/$package/${package}_${upstream_version}.orig.tar.gz"; $a$(echo $package|cut -c0-1)$b || $a$(echo $package | cut -c0-4)$b'
     
     Multiple retries with a bashism:
     
     svn-buildpackage --svn-prebuild='wget -c http://mymirror/debian/main/pool/{`echo $package | cut -c0-1`,`echo $package | cut -c0-4`}/$package/${package}_${upstream_version}.orig.tar.gz'
     
     Or using a bounty, see below...
     
     svn-b --svn-prebuild="wget http://mymirror/debian/main/pool/$guess_loc"

5.2.5 CONFIGURATION FILE

svn-buildpackage's behaviour can be modified using the file ~/.svn-buildpackage.conf . It is basicaly a list of the long command line options (without leading minus signs), one argument per line (but without quotes embrassing multi-word arguments). The variables are expanded with the system shell if potential shell variables were found there. Avoid ~ sign because of unreliable expansion, better use $HOME instead. Example:

     
     svn-builder=debuild -EPATH
     
     svn-no-links
     
     svn-override=origDir=$HOME/debian/upstream/$PACKAGE
     
     # svn-ignore-new
     
     #svn-lintian

5.2.6 DIRECTORY LAYOUT HANDLING

By default, svn-buildpackage expects a configuration file with path/url declaration, .svn/deb-layout. The values there can be overriden with the --svn-override option, see above. If a config file could not be found, the settings are autodetected following the usual assumptions about local directories and repository layout. In addition, the contents of a custom file debian/svn-deblayout will be imported during the initial configuration. Package maintainers can store this file in the repository to pass correct defaults to new svn-buildpackage users. The format is the same as in the file .svn/deb-layout.


5.2.7 ENVIRONMENT VARIABLES

Following environment variables are exported by svn-buildpackage and can be used in hook commands or the package build system.

PACKAGE , package The source package name

SVN_BUILDPACKAGE Version of svn-buildpackage

TAG_VERSION , debian_version The complete Debian version string, also used for the tag copy

non_epoch_version Same as debian_version but without any epoch strings

upstream_version Same as debian_version but without Debian extensions

guess_loc Guessed upstream source package name in the pool, something like libm/libmeta-html-perl_3.2.1.0.orig.tar.gz

DIFFSRC (experimental) shows the location of generated diff file Following variables are understood by svn-buildpackage:

FORCETAG Tells to ignore the signs for an incomplete changelog

FORCEEXPORT Export upstream source from the repository even if mergeWithUpstream property is set


5.2.8 RECOMMENDATIONS

First thing, using shell aliases makes sense. Example for the Bash:

     
     alias svn-b="svn-buildpackage -us -uc -rfakeroot --svn-ignore"
     alias svn-br="svn-b --svn-dont-purge --svn-reuse"
     alias svn-bt="svn-buildpackage --svn-tag -rfakeroot"

That simply has the meaning: "just build no matter what", the same without re-exporting on repeated builds and "build for upload and tag". To access remote repositories, the shell access (via ssh) is the easiest way to create the link. However, it requires to enter the password and this happens more often with svn-buildpackage. There are workarounds: use ssh key without passphrase (insecure and still slow connection) or use the fsh tool which keeps a persistent connection in background and behaves like a rsh/ssh command. For details, see svn-buildpackage manual. Another way to get a remote link is using the Subversion DAV module (with SSL and Apache user authentication), see svn-buildpackage HOWTO manual for details.


5.3 svn-upgrade


5.3.1 NAME

svn-upgrade - upgrade source package from a new upstream revision


5.3.2 SYNOPSIS

svn-upgrade newtarball [ OPTIONS ... ]


5.3.3 DESCRIPTION

svn-upgrade modifies a Debian package source located in a Subversion repository, upgrading it to a new upstream release. The repository filesystem tree must be in the format created by svn-inject.

-V , --version STRING Forces a different upstream version string

-c , ---clean Runs "make clean" and removed the debian/ directory in the new source.

-P , --packagename STRING Forces a different package name

-v , --verbose More verbose program output

-r , --replay-conflicting Extra cleanup run: replaces all conflicting files with upstream versions. Review of "svn status" output before doing that could make sense.

Tarballs must be compressed with gzip or bzip2.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]

svn-buildpackage - maintaining Debian packages with Subversion

$LastChangedDate: 2005-03-29 03:19:19 +0200 (Di, 29 Mär 2005) $

Eduard Bloch