diff --git a/Alien/Package/Deb.pm b/Alien/Package/Deb.pm index cbca104..3c0f5b3 100644 --- a/Alien/Package/Deb.pm +++ b/Alien/Package/Deb.pm @@ -28,6 +28,10 @@ Set to a true value if dpkg-deb is available. After the build stage, set to a hash reference of the directories we moved files from and to, so these moves can be reverted in the cleantree stage. +=item fixperms + +If this is set to true, the generated debian/rules will run dh_fixperms. + =back =head1 METHODS @@ -330,7 +334,8 @@ sub prep { # A minimal rules file. open (OUT, ">$dir/debian/rules") || die "$dir/debian/rules: $!"; - print OUT << 'EOF'; + my $fixpermscomment = $this->fixperms ? "" : "#"; + print OUT << "EOF"; #!/usr/bin/make -f # debian/rules for alien @@ -340,8 +345,8 @@ sub prep { # Use v3 compatability mode, so ldconfig gets added to maint scripts. export DH_COMPAT=3 -PACKAGE=$(shell dh_listpackages) -PKGFILES=$(shell ls -1 |grep -v debian) +PACKAGE=\$(shell dh_listpackages) +PKGFILES=\$(shell ls -1 |grep -v debian) build: dh_testdir @@ -360,12 +365,12 @@ binary-arch: build dh_installdirs # Copy the packages's files, if any. -ifneq "$(PKGFILES)" "" - cp -a $(PKGFILES) debian/$(PACKAGE) +ifneq "\$(PKGFILES)" "" + cp -a \$(PKGFILES) debian/\$(PACKAGE) endif # -# If you need to move files around in debian/$(PACKAGE) or do some +# If you need to move files around in debian/\$(PACKAGE) or do some # binary patching, do it here # dh_installdocs @@ -373,8 +378,7 @@ endif # This has been known to break on some wacky binaries. # dh_strip dh_compress -# This is too paranoid to be generally useful to alien. -# dh_fixperms +$fixpermscomment dh_fixperms dh_makeshlibs dh_installdeb -dh_shlibdeps diff --git a/alien.pl b/alien.pl index f235d59..9344d12 100755 --- a/alien.pl +++ b/alien.pl @@ -159,6 +159,14 @@ This is enabled by default when converting from lsb packages. By default, alien adds one to the minor version number of each package it converts. If this option is given, alien will not do this. +=item B<--fixperms> + +Sanitize all file owners and permissions when building a deb. This may be +useful if the original package is a mess. On the other hand, it may break +some things to mess with their permissions and owners to the degree this does, +so it defaults to off. This can only be used when converting to debian +packages. + =item B<-h>, B<--help> Display a short usage summary. @@ -274,6 +282,7 @@ Usage: alien [options] file [...] --nopatch Do not use patches. --single Like --generate, but do not create .orig directory. + --fixperms Munge/fix permissions and owners. -r, --to-rpm Generate a RedHat rpm package. --to-slp Generate a Stampede slp package. -l, --to-lsb Generate a LSB package. @@ -294,7 +303,7 @@ EOF # Start by processing the parameters. my (%destformats, $generate, $install, $single, $scripts, $patchfile, - $nopatch, $tgzdescription, $keepversion); + $nopatch, $tgzdescription, $keepversion, $fixperms); GetOptions( "to-deb|d", sub { $destformats{deb}=1 }, @@ -311,6 +320,7 @@ GetOptions( "nopatch", \$nopatch, "description=s", \$tgzdescription, "keep-version|k", \$keepversion, + "fixperms", \$fixperms, "help|h", \&usage, "version|v", \&version, ) || usage(); @@ -422,7 +432,9 @@ foreach my $file (@ARGV) { $package->patchfile($package->getpatch(patchdirs())); } } - + + $package->fixperms($fixperms); + $package->prep; # If generating build tree only, stop here with message. diff --git a/debian/changelog b/debian/changelog index 6a8beb0..edcf54f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +alien (8.06) unstable; urgency=low + + * Added --fixperms option. Closes: #142850 + + -- Joey Hess Sun, 21 Apr 2002 22:19:12 -0400 + alien (8.05) unstable; urgency=low * Support rpms with a description consisting of just blank lines.