#!/usr/bin/perl -w # # Installs debian/changelog. If another filename is passed to it, installs # that file as the upstream changelog. # # Looks at debian/control to determine if this is a native debian package, # if so, the debian changelog is just installed as "changelog", and it is an # error to specify an upstream changelog on the command line. BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); $upstream=shift; if (isnative($dh{MAINPACKAGE}) && defined $upstream) { error("Cannot specify an upstream changelog for a native debian package."); } if (isnative($dh{MAINPACKAGE})) { $changelog_name='changelog'; } else { $changelog_name='changelog.Debian'; } foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $changelog=pkgfile($PACKAGE,"changelog"); if (!$changelog) { $changelog="debian/changelog"; } if (! -e $changelog) { error("could not find changelog $changelog"); } if (! -d "$TMP/usr/doc/$PACKAGE") { doit("install","-d","$TMP/usr/doc/$PACKAGE"); } doit("install","-o","root","-g","root","-p","-m644",$changelog, "$TMP/usr/doc/$PACKAGE/$changelog_name"); if ($upstream) { if ($upstream=~m/\.html?$/i) { # HTML changelog doit("install","-o","root","-g","root","-p","-m644", $upstream,"$TMP/usr/doc/$PACKAGE/changelog.html"); doit("ln", "-sf", 'changelog.html', "$TMP/usr/doc/$PACKAGE/changelog"); } else { doit("install","-o","root","-g","root","-p","-m644", $upstream,"$TMP/usr/doc/$PACKAGE/changelog"); } if ($dh{K_FLAG}) { # Install symlink to original name of the upstream changelog file. # Use basename in case original file was in a subdirectory or something. doit("ln","-sf","changelog","$TMP/usr/doc/$PACKAGE/".Dh_Lib::basename($upstream)); } } }